query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
we use the OkHttp library from
@Override protected String doInBackground(String... urls) { OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url(urls[0]) .build(); Response response = null; try { response = client.newCall(request).execute(); if (response.isSuccessful()) { return response.body().string(); } } catch (IOException e) { e.printStackTrace(); } return "Download failed"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static OkHttpClient m35241c() {\n return new OkHttpClient();\n }", "public void okhttpClick(View view) {\n\n\n String url = \"https://gank.io/api/add2gank\";\n RequestBody requestBody = new MultipartRequestBody()\n .addFormDataPart(\"pageNo\", \"1\")\n .addFormDataPart(\"pageSize\", \"50\")\n .addFormDataPart(\"platform\", \"android\");\n final Request request = new Request.Builder()\n .url(url)\n .tag(this)\n .post(requestBody)\n .build();\n\n OkHttpClient okHttpClient = new OkHttpClient();\n\n okHttpClient.newCall(request).enqueue(new Callback() {\n\n @Override\n public void onFailure(Call call, Exception e) {\n e.printStackTrace();\n Log.e(\"dengzi\", \"出错了\");\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n String result = response.string();\n Log.e(\"dengzi\", result);\n }\n });\n }", "private static OkHttpClient getOkHttpClient() {\n OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder()\n .addInterceptor(new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request original = chain.request();\n\n Request.Builder requestBuilder = original.newBuilder()\n .method(original.method(), original.body());\n\n addAdditionalHttpHeaders(requestBuilder);\n addParleyHttpHeaders(requestBuilder);\n\n Request request = requestBuilder.build();\n return chain.proceed(request);\n }\n })\n .connectTimeout(30, TimeUnit.SECONDS)\n .readTimeout(30, TimeUnit.SECONDS)\n .writeTimeout(30, TimeUnit.SECONDS);\n\n applySslPinning(okHttpClientBuilder);\n\n return okHttpClientBuilder.build();\n }", "public void initOkGo() throws IOException {\r\n mSPCookieStore = new SPCookieStore(this);\r\n HttpHeaders headers = new HttpHeaders();\r\n if (new SPCookieStore(this).getAllCookie().size() != 0) {\r\n headers.put(\r\n \"Set-Cookie\",\r\n String.valueOf(mSPCookieStore.getCookie(HttpUrl.parse(BaseUrl.HTTP_Get_code_auth))));\r\n }\r\n headers.put(\"version\", \"3.0\");\r\n headers.put(\"uid\", \"6f1a8e0eb24afb7ddc829f96f9f74e9d\");\r\n\r\n OkHttpClient.Builder builder = new OkHttpClient.Builder();\r\n // log相关\r\n HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(\"OkHttp\");\r\n loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY); // log打印级别,决定了log显示的详细程度\r\n loggingInterceptor.setColorLevel(Level.INFO); // log颜色级别,决定了log在控制台显示的颜色\r\n builder.addInterceptor(loggingInterceptor); // 添加OkGo默认debug日志\r\n // 超时时间设置\r\n builder.readTimeout(10000, TimeUnit.MILLISECONDS); // 全局的读取超时时间\r\n builder.writeTimeout(10000, TimeUnit.MILLISECONDS); // 全局的写入超时时间\r\n builder.connectTimeout(10000, TimeUnit.MILLISECONDS); // 全局的连接超时时间\r\n builder.cookieJar(new CookieJarImpl(mSPCookieStore)); // 使用sp保持cookie,如果cookie不过期,则一直有效\r\n\r\n HttpsUtils.SSLParams sslParams = HttpsUtils.getSslSocketFactory(getAssets().open(\"server.cer\"));\r\n builder.sslSocketFactory(sslParams.sSLSocketFactory, sslParams.trustManager);\r\n // //配置https的域名匹配规则,使用不当会导致https握手失败\r\n builder.hostnameVerifier(HttpsUtils.UnSafeHostnameVerifier);\r\n\r\n // 其他统一的配置\r\n OkGo.getInstance()\r\n .init(this.getApplication()) // 必须调用初始化\r\n .setOkHttpClient(builder.build()) // 必须设置OkHttpClient\r\n .setCacheMode(CacheMode.NO_CACHE) // 全局统一缓存模式,默认不使用缓存,可以不传\r\n .setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE) // 全局统一缓存时间,默认永不过期,可以不传\r\n .setRetryCount(3) // 全局统一超时重连次数,默认为三次,那么最差的情况会请求4次(一次原始请求,三次重连请求),不需要可以设置为0\r\n .addCommonHeaders(headers); // 全局公共头\r\n }", "public static OkHttpClient getOkHttpClient() {\n return OK_HTTP_CLIENT;\n }", "@Override\n public OkHttpClient customMake() {\n // just for OkHttpClient customize.\n final OkHttpClient.Builder builder = new OkHttpClient.Builder();\n // you can set the connection timeout.\n builder.connectTimeout(15_000, TimeUnit.MILLISECONDS);\n // you can set the HTTP proxy.\n builder.proxy(Proxy.NO_PROXY);\n // etc.\n return builder.build();\n }", "@Provides\n @Singleton\n OkHttpClient provideOkHttpClient() {\n OkHttpClient client = new OkHttpClient();\n return client;\n }", "public OkHttpClient okHttpClient ()\n {\n OkHttpClient okHttpClient = new OkHttpClient().newBuilder()\n .connectTimeout(60, TimeUnit.SECONDS)\n .readTimeout(60, TimeUnit.SECONDS)\n .writeTimeout(60, TimeUnit.SECONDS)\n .build();\n return okHttpClient;\n }", "private OkHttpClient createClient(){\n HttpLoggingInterceptor logging = new HttpLoggingInterceptor();\n logging.setLevel(HttpLoggingInterceptor.Level.BODY);\n return new OkHttpClient.Builder()\n .addInterceptor(logging)\n .readTimeout(30, TimeUnit.SECONDS)\n .writeTimeout(30, TimeUnit.SECONDS)\n .build();\n }", "public TankOkHttpClient() {\n try {\n\n final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n\n @Override\n public X509Certificate[] getAcceptedIssuers() {\n return null;\n }\n\n @Override\n public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}\n\n @Override\n public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}\n } };\n\n // Setup SSL to accept all certs\n final SSLContext sslContext = SSLContext.getInstance(\"SSL\");\n sslContext.init(null, trustAllCerts, null);\n sslSocketFactory = sslContext.getSocketFactory();\n\n // Setup Cookie manager\n cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);\n CookieHandler.setDefault(cookieManager);\n okHttpClient.setCookieHandler(cookieManager);\n\n okHttpClient.setConnectTimeout(30000, TimeUnit.MILLISECONDS);\n okHttpClient.setReadTimeout(30000, TimeUnit.MILLISECONDS); // Socket-timeout\n okHttpClient.setFollowRedirects(true);\n okHttpClient.setFollowSslRedirects(true);\n\n okHttpClient.setSslSocketFactory(sslSocketFactory);\n okHttpClient.setHostnameVerifier(new HostnameVerifier() {\n\n @Override\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }\n });\n\n } catch (Exception e) {\n LOG.error(\"Error setting accept all: \" + e, e);\n }\n }", "public interface OkHttpDownFileCallBackListener {\r\n\r\n public void onError(Call call, Exception e, int errorCode);\r\n public void onResponse(File response, int successCode);\r\n public void inProgress(float progress, long total, int id);\r\n}", "@Override\n protected String doInBackground(String... params){\n\n try {\n //1. Create okHttp Client object\n OkHttpClient client = new OkHttpClient();\n\n Endpoint endpoint = new Endpoint();\n\n //2. Define request being sent to the server\n\n Request request = new Request.Builder()\n .url(endpoint.getUrl())\n .header(\"Connection\", \"close\")\n .build();\n\n //3. Transport the request and wait for response to process next\n Response response = client.newCall(request).execute();\n String result = response.body().string();\n setCode(response.code());\n return result;\n }\n catch(Exception e) {\n return null;\n }\n }", "public static void simple() throws IOException {\n OkHttpClient client = new OkHttpClient()\n .newBuilder()\n .connectTimeout(5, TimeUnit.SECONDS)\n .build();\n\n Request request = new Request.Builder()\n .url(\"http://www.ncq8.com/test.php\")\n .header(\"X-TEST\", \"test\")\n .header(\"User-Agent\", \"Chrome\")\n .build();\n\n\n Response response = client.newCall(request).execute();\n\n // 响应代码\n if (!response.isSuccessful()) {\n throw new IOException(\"服务器端错误: \" + response);\n }\n int httpCode = response.code();\n System.out.println(\"Status Code:\" + httpCode);\n\n // 单个响应头\n String server = response.header(\"Server\");\n System.out.println(\"Server:\" + server);\n\n // 响应头数组\n Headers headers = response.headers();\n for (int i = 0; i < headers.size(); i++) {\n System.out.println(headers.name(i) + \":\" +headers.value(i));\n }\n\n // 正文\n ResponseBody body = response.body();\n System.out.println(body.contentType().charset());\n System.out.println(body.contentType().type());\n System.out.println(body.contentLength());\n System.out.println(body.string());\n }", "@PostConstruct\n private void init(){\n\n okHttpClient = new OkHttpClient();\n\n// loadEtoroInstruments();\n\n }", "@Provides\n @Singleton\n public OkHttpClient providesOkHttpClient() {\n HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();\n interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\n\n OkHttpClient.Builder httpClient = new OkHttpClient.Builder();\n httpClient.addInterceptor(interceptor);\n\n return httpClient.build();\n\n }", "private JSONObject sendRequestWithOkHttp(int page) {\n JSONObject json = null;\n String url = \"\";\n if (chatroom_id != null) {\n url = String.format(\"http://13.112.156.96/api/asgn3/get_messages?%s&%s\", \"chatroom_id=\" + chatroom_id, \"page=\" + page);\n }\n OkHttpClient client = new OkHttpClient();\n Log.d(GET, url);\n Request request = new Request.Builder()\n .url(url)\n .build();\n try {\n Response response = client.newCall(request).execute();\n String responseData = response.body().string();\n json = new JSONObject(responseData);\n Log.d(GET, String.valueOf(json.get(\"status\")));\n } catch (Exception e) {\n e.printStackTrace();\n Log.d(GET, \"GET Request error\");\n }\n return json;\n }", "@Provides\n @Singleton\n OkHttpClient provideOkHttpClient() {\n final HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();\n loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\n\n OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder()\n .addInterceptor(loggingInterceptor);\n\n return clientBuilder.build();\n }", "private void httpSetup() {\n OkHttpClient client = new OkHttpClient.Builder()\n .readTimeout(5, TimeUnit.SECONDS)\n .writeTimeout(5, TimeUnit.SECONDS)\n .build();\n\n retrofit = new Retrofit.Builder()\n .baseUrl(BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .client(client)\n .build();\n\n service = retrofit.create(ValidatorAPI.class);\n }", "private Response makeRequest(String url) throws IOException, IllegalStateException {\n // Make the request\n Request req = new Request.Builder()\n .url(url)\n .addHeader(\"token\", NOAA.KEY)\n .build();\n Response res = client.newCall(req).execute();\n return res;\n }", "private static OkHttpClient initializeRetrofitClients() {\n OkHttpClient.Builder okHttpBuilder = new OkHttpClient().newBuilder();\n okHttpBuilder.interceptors().add(new Interceptor() {\n @Override\n public okhttp3.Response intercept(@NonNull Chain chain) throws IOException {\n Request originalRequest = chain.request();\n\n // Nothing to add to intercepted request if:\n // a) Authorization value is empty because user is not logged in yet\n // b) There is already a header with updated Authorization value\n if (authorizationTokenIsEmpty() || alreadyHasAuthorizationHeader(originalRequest)) {\n return chain.proceed(originalRequest);\n }\n\n // Add authorization header with updated authorization value to intercepted request\n Request authorisedRequest = originalRequest.newBuilder()\n .header(\"Authorization\", \"Bearer \" + accessToken)\n .build();\n return chain.proceed(authorisedRequest);\n }\n });\n okHttpBuilder.authenticator(new Authenticator() {\n @Nullable\n @Override\n public Request authenticate(@NonNull Route route, @NonNull okhttp3.Response response) throws IOException {\n // Refresh your access_token using a synchronous api request\n ABBYYLingvoAPI abbyyLingvoAPI = getApi();\n\n Call<ResponseBody> myCall = abbyyLingvoAPI.getBasicToken();\n Response<ResponseBody> response1;\n try {\n response1 = myCall.execute();\n if (response1.isSuccessful()) {\n accessToken = response1.body().string();\n Log.d(Constants.LOG_TAG, \"basic response is success, got accessToken\");\n } else {\n Log.e(Constants.LOG_TAG, \"basic response isn't successful, response code is: \" + response1.code());\n }\n } catch (IOException e) {\n Log.e(Constants.LOG_TAG, \"basic response isn't successful cause error: \" + e.toString());\n }\n\n // Add new header to rejected request and retry it\n accessTokenRequest = response.request().newBuilder()\n .addHeader(\"Authorization\", \"Bearer \" + accessToken)\n .build();\n\n return accessTokenRequest;\n }\n });\n\n try {\n // Create a trust manager that does not validate certificate chains\n final TrustManager[] trustAllCerts = new TrustManager[]{\n new X509TrustManager() {\n @Override\n public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {\n }\n\n @Override\n public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {\n }\n\n @Override\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return new java.security.cert.X509Certificate[]{};\n }\n }\n };\n\n // Install the all-trusting trust manager\n final SSLContext sslContext = SSLContext.getInstance(\"SSL\");\n sslContext.init(null, trustAllCerts, new java.security.SecureRandom());\n // Create an ssl socket factory with our all-trusting manager\n final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();\n\n okHttpBuilder.sslSocketFactory(sslSocketFactory);\n okHttpBuilder.hostnameVerifier(new HostnameVerifier() {\n @Override\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }\n });\n\n return okHttpBuilder.build();\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "private void postRequest(RequestBody requestBody, String url) throws JSONException {\n System.out.println(url);\n OkHttpClient okHttpClient = new OkHttpClient();\n Request request = new Request\n .Builder()\n .post(requestBody)\n .url(url)\n .build();\n\n okHttpClient.newCall(request).enqueue(new Callback() {\n @Override\n public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {\n\n }\n\n @Override\n public void onFailure(final Call call, final IOException e) {\n }\n });\n }", "@Override\r\n\tpublic void onOk(HttpRequest paramHttpRequest, Object paramObject) {\n\r\n\t}", "private HttpURLConnection commonConnectionSetup( String path ) throws IOException {\n URL fullPath = new URL( this.url + path );\n System.out.println(fullPath.toString());\n HttpURLConnection c = (HttpURLConnection) fullPath.openConnection();\n c.setRequestProperty(\"Content-Type\", \"application/json;charset=utf-8\");\n c.setRequestProperty(\"X-Okapi-Tenant\", this.tenant);\n c.setRequestProperty(\"X-Okapi-Token\", this.token);\n return c;\n \n }", "public static void main(String[] args) throws IOException {\n String url = \"https://fonts.gstatic.com/\";\n //String url = \"http://localhost/\";\n HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(new CustomHttpLogger());\n interceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);\n OkHttpClient client = new OkHttpClient.Builder()\n .addNetworkInterceptor(interceptor)\n .addInterceptor(interceptor)\n .build();\n Request request = new Request.Builder()\n .url(url)\n .build();\n\n try (Response response = client.newCall(request).execute()) {\n try (ResponseBody body = response.body()) {\n logger.info(\"response length: {}\", body == null ? \"no body\" : body.contentLength());\n }\n }\n }", "public interface ApiInterface {\n\n //Account API\n String ping(OkHttpClient client);\n\n String obtainAuthToken(OkHttpClient client, String username, String password);\n\n JSONObject checkAccountInfo(OkHttpClient client, String token);\n\n JSONObject getServerInformation(OkHttpClient client);\n\n //Starred File API\n List<StarredFile> listStarredFiles(OkHttpClient client, String token);\n\n //Library API\n List<Library> listLibraries(OkHttpClient client, String token);\n\n Library getLibraryInfo(OkHttpClient client, String token, String repo_id);\n\n List<LibraryHistory> getLibraryHistory(OkHttpClient client, String token, String repo_id);\n\n JSONObject createNewLibrary(OkHttpClient client, String token, String libName, String desc, String password);\n\n boolean deleteLibrary(OkHttpClient client, String token, String repo_id);\n\n //File API\n String getFileDownloadLink(OkHttpClient client, String token, String repo_id, String p, boolean reuse);\n\n FileDetail getFileDetail(OkHttpClient client, String token, String repo_id, String p);\n\n List<FileCommit> getFileHistory(OkHttpClient client, String token, String repo_id, String p);\n\n boolean createFile(OkHttpClient client, String token, String repo_id, String p);\n\n boolean renameFile(OkHttpClient client, String token, String repo_id, String p, String newName);\n\n boolean moveFile(OkHttpClient client, String token, String repo_id, String p, String dst_repo, String dst_dir);\n\n boolean revertFile(OkHttpClient client, String token, String repo_id, String p, String commit_id);\n\n boolean deleteFile(OkHttpClient client, String token, String repo_id, String p);\n\n String getUploadLink(OkHttpClient client, String token, String repo_id, String p);\n\n List<UploadFileRes> uploadFile(OkHttpClient client, String token, String uploadLink, String parent_dir, String relative_path, File... files);\n\n String getUpdateLink(OkHttpClient client, String token, String repo_id, String p);\n\n boolean updateFile(OkHttpClient client, String token, String updataLink, File file, String target_file);\n\n //Directory API\n List<DirectoryEntry> listDirEntriesByP(OkHttpClient client, String token, String repo_id, String p);\n\n// List<DirectoryEntry> listDirectoryEntriesByID(OkHttpClient client,String token,String repo_id,String id);\n\n List<DirectoryEntry> listAllDirEntries(OkHttpClient client, String token, String repo_id);\n\n boolean createNewDir(OkHttpClient client, String token, String repo_id, String p);\n\n boolean renameDir(OkHttpClient client, String token, String repo_id, String p, String newName);\n\n boolean deleteDir(OkHttpClient client, String token, String repo_id, String p);\n\n String getDirDownloadToken(OkHttpClient client, String token, String repo_id, String parent_dir, String dirents);\n\n boolean queryZipProgress(OkHttpClient client, String token, String dirDownloadToken);\n\n String getDirDownloadLink(OkHttpClient client, String token, String dirDownloadToken);\n}", "public OkHttpDownloader(OkHttpClient client) {\n this.client = client;\n }", "public interface GitHubService {\n @GET(\"repos/{owner}/{repo}/contributors\")\n Call<List<Contributor>> repoContributors(\n @Path(\"owner\") String owner,\n @Path(\"repo\") String repo);\n\n\n HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY);\n OkHttpClient okHttpClient = new OkHttpClient.Builder().addInterceptor(httpLoggingInterceptor).addInterceptor(new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request original = chain.request();\n HttpUrl originalHttpUrl = original.url();\n\n HttpUrl.Builder originalUrlBuilder = originalHttpUrl.newBuilder();\n originalUrlBuilder.addQueryParameter(\"access_token\", \"YOUR_TOKEN\");\n\n HttpUrl url = originalUrlBuilder.build();\n\n Request.Builder reqBuilder = original.newBuilder().url(url);\n return chain.proceed(reqBuilder.build());\n }\n }).build();\n\n\n\n\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(\"https://api.github.com/\")\n .addConverterFactory(GsonConverterFactory.create()).client(okHttpClient)\n .build();\n\n @GET(\"/users/{username}\")\n Call<Contributor>user(\n @Path(\"username\")String login);\n\n @GET\n Call<List<Repository>> getRepos(@Url String url);\n\n}", "private void makeSampleHttpRequest(String url) {\r\n\r\n StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {\r\n @Override\r\n public void onResponse(String response) {\r\n texto_a_imprimir = response.toString();\r\n //showToast(texto_a_imprimir);\r\n vistaprevia.setText(texto_a_imprimir);\r\n }\r\n }, new Response.ErrorListener() {\r\n @Override\r\n public void onErrorResponse(VolleyError error) {\r\n // Handle your error types accordingly.For Timeout & No connection error, you can show 'retry' button.\r\n // For AuthFailure, you can re login with user credentials.\r\n // For ClientError, 400 & 401, Errors happening on client side when sending api request.\r\n // In this case you can check how client is forming the api and debug accordingly.\r\n // For ServerError 5xx, you can do retry or handle accordingly.\r\n if( error instanceof NetworkError) {\r\n } else if( error instanceof ClientError) {\r\n texto_a_imprimir = error.toString();\r\n } else if( error instanceof ServerError) {\r\n texto_a_imprimir = error.toString();\r\n } else if( error instanceof AuthFailureError) {\r\n texto_a_imprimir = error.toString();\r\n } else if( error instanceof ParseError) {\r\n texto_a_imprimir = error.toString();\r\n } else if( error instanceof NoConnectionError) {\r\n texto_a_imprimir = error.toString();\r\n } else if( error instanceof TimeoutError) {\r\n texto_a_imprimir = error.toString();\r\n }\r\n showToast(error.getMessage());\r\n }\r\n });\r\n /*\r\n //Set a retry policy in case of SocketTimeout & ConnectionTimeout Exceptions. Volley does retry for you if you have specified the policy.\r\n jsonObjRequest.setRetryPolicy(new DefaultRetryPolicy(5000, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\r\n jsonObjRequest.setTag(TAG_REQUEST);\r\n mVolleyQueue.add(jsonObjRequest);\r\n */\r\n stringRequest.setShouldCache(true);\r\n stringRequest.setTag(TAG_REQUEST);\r\n mVolleyQueue.add(stringRequest);\r\n }", "@Provides\n OkHttpClient.Builder providesOkHttpClientBuilder(){\n return new OkHttpClient.Builder()\n .connectTimeout(10, TimeUnit.SECONDS)\n .writeTimeout(20,TimeUnit.SECONDS)\n .readTimeout(20,TimeUnit.SECONDS);\n //.addInterceptor(new MyInterceptor());\n }", "void m14051a(okhttp3.aa r2, okhttp3.aa r3) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r1 = this;\n r0 = new okhttp3.c$c;\n r0.<init>(r3);\n r2 = r2.m14017h();\n r2 = (okhttp3.C2900c.C4340b) r2;\n r2 = r2.f18085a;\n r2 = r2.m14105a();\t Catch:{ IOException -> 0x001a }\n if (r2 == 0) goto L_0x001e;\n L_0x0013:\n r0.m14043a(r2);\t Catch:{ IOException -> 0x001b }\n r2.m14099b();\t Catch:{ IOException -> 0x001b }\n goto L_0x001e;\n L_0x001a:\n r2 = 0;\n L_0x001b:\n r1.m14047a(r2);\n L_0x001e:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.c.a(okhttp3.aa, okhttp3.aa):void\");\n }", "public interface Api {\n /**{\"response\": {\"zbsVer\": 0, \"hostId\": \"001207C40173\", \"room\": [{\"type\": \"\\u603b\\u7ecf\\u7406\", \"roomId\": \"322\", \"name\": \"\\u603b\\u7ecf\\u7406\"}, {\"roomId\": \"350\", \"type\": \"\\u4e3b\\u5367\", \"name\": \"\\u4e3b\\u5367\"}, {\"type\": \"\\u53a8\\u623f\", \"roomId\": \"366\", \"name\": \"\\u5475\\u5475\"}, {\"roomId\": \"381\", \"type\": \"\\u53a8\\u623f\", \"name\": \"\\u53a8\\u623f\"}, {\"roomId\": \"382\", \"type\": \"\\u9910\\u5385\", \"name\": \"\\u9910\\u5385\"}], \"softver\": 104, \"timestamp\": 1501838857, \"zbhVer\": 0, \"lastbackup\": 1499826785, \"pandId\": 101, \"firmver\": 217, \"numbers\": \"15905214137,15252089063,18912345678,15263985632,15152208332\", \"channelNo\": \"f\", \"registerHost\": false, \"name\": \"40173\"}, \"ret\": 0, \"md5\": \"a92c08fdf3a4b4f9aef04b3ce102df32\"}\n\n * 云端接口\n */\n String wrapper_request = \"/wrapper/request\";\n //\n// CloudInterface.h\n// ihome\n//\n// Created by on 3/13/15.\n// Copyright (c) 2015 Co.ltd. All rights reserved.\n\n //测试\n String urlCloud = \"/https://api2.boericloud.com\";\n //正式\n// String urlCloud = \"/https://api.boericloud.com\";\n\n String urlResetMobile = \"/auth/resetMobile\"; //重置手机号码\n String urlNegotiate = \"/auth/negotiate\";\n String urlRegister = \"/auth/register\"; //注册\n String urlSignin = \"/auth/login\"; //登录\n String urlSignOff = \"/auth/logout\"; //登出\n\n String urlResetCloudPassword = \"/auth/resetCloudpassword\"; //重置密码\n String urlSmsVerify = \"/auth/sms_verify\"; //短信验证\n String urlResetPWD = \"/auth/reset_password\"; //忘记密码\n String urlMobileVerify = \"/auth/mobile_verify\"; //验证手机号\n\n String urlUserUpdate = \"/user/update\";\n String urlUserUpdateToken = \"/user/update_token\";\n\n String urlUserPermissions = \"/user/host_permissions\"; //查询用户权限\n String urlUserUpdateExtend = \"/user/update_extend\"; //更新铃声和震动\n String urlUserShowExtend = \"/user/show_extend\"; //获取铃声和震动\n\n String urlHostBind = \"/host/bind\";\n String urlHostShow = \"/host/show\";\n\n String urlHostverifyadminpassword = \"/host/verifyadminpassword\";\n String urlHostSwitch = \"/host/switch\";\n\n String urlWrapperRequest = \"/wrapper/request\";//透传接口,一键备份\n String urlHostRestoreproperty = \"/host/restoreproperty\";//透传接口,一键还原\n\n String urlHostUpgrade = \"/upgrade/latest\";\n String urlHostUpgradeSoftware = \"/host/software_upgrade\";\n\n String urlSystemMessageShow = \"/systemMessage/show\"; //请求某天某类型的系统消息\n\n String urlWarningShow = \"/alarm/show1\"; //请求某天某类型的历史告警\n String urlAlarmDelete = \"/alarm/delete1\";//删除单条或多条历史告警\n String urlAlarmBatchDelete = \"/alarm/batch_delete\";//删除某天某类型的所有告警\n\n String urlSystemMessageDelete = \"/systemMessage/remove\";//删除某天某类型的系统消息\n String urlSystemBatchDelete = \"/systemMessage/batch_delete\";//删除某天某类型的所有系统消息\n\n String urlAlarmRead = \"/alarm/confirm_read\";//确认某条系统告警\n String urlSystemMessageRead = \"/systemMessage/confirmRead\";//确认某条系统消息\n\n String urlAddBlackList = \"/user/add_black_list\";//加入黑名单\n String urlRemoveBlackList = \"/user/remove_black_list\";//移除黑名单\n String urlQueryBlackList = \"/user/query_in_black_list\";//查询用户是否在黑名单内\n\n /*****************************/\n//主机直连 -> 设备相关\n String urlQueryWiseMediaList = \"/device/queryWiseMediaList\";//查询华尔斯背景音乐的歌曲列表\n String urlDeviceScan = \"/device/scan\";//扫描设备\n String urlDeviceLink = \"/device/link\";//关联设备->(新增)\n String urlDeviceQuerylink = \"/device/querylink\";//查询关联设备->(新增)\n String urlDeviceCmd = \"/device/cmd\";//控制设备\n String urlDeviceRemove = \"/device/remove\";//删除设备\n String urlDeviceDismiss = \"/device/dismiss\";//解绑设备\n String urlDeviceUpdateProp = \"/device/updateprop\";//更新设备属性\n String urlDevicesProperties = \"/devices/properties\";//查询设备属性\n String urlDeviceStatus = \"/device/status\";//查询设备状态\n String urlDeviceQueryOneProp = \"/device/queryOneProp\";//查询某一设备的属性->(新增)\n String urlDeviceConfigHgc = \"/device/configHgc\";//配置中控->(新增)\n String urlDeviceDeleteHgcConfig = \"/device/deleteHgcConfig\";//删除中控配置->(新增)\n String urlDeviceQueryHgcConfig = \"/device/queryHgcConfig\";//查询中控配置->(新增)\n String urlDeviceQueryMeterAddr = \"/device/queryMeterAddr\";//查询水电表的地址->(新增)\n String urlDeviceModifyMeterName = \"/device/modifyMeterName\";//修改水电表的名称->(新增)\n String urlDeviceQueryAllDevices = \"/device/queryAllDevices\";//查询所有设备的属性和状态->(新增)\n String urlDeviceSetFloorHeatingTimeTask = \"/device/setFloorHeatingTimeTask\";//设置地暖的定时任务->(新增)\n String urlDeviceSwitchFloorHeatingTimeTask = \"/device/switchFloorHeatingTimeTask\";//开启或者关闭地暖的定时任务->(新增)\n\n //主机直连 -> 主机相关\n String urlHostShowProperty = \"/host/showproperty\";//查询主机信息\n String urlHostModifyProperty = \"/host/modifyproperty\";//修改主机信息\n String urlHostQueryglobaldata = \"/host/queryglobaldata\";//查询全局信息->(新增)\n String urlHostModifyHostName = \"/host/modifyHostName\";//修改主机名称->(新增)\n\n //主机直连 -> 联动模式相关\n String urlPlanShow = \"/plan/show\";//查询指定的联动预案或模式\n String urlPlanUpdate = \"/plan/update\";//更新联动预案或模式\n String urlPlanQueryGlobalModes = \"/plan/queryGlobalModes\";//查询全局模式->(新增)\n String urlPlanModifyModeName = \"/plan/modifyModeName\";//修改模式名称->(新增)\n String urlPlanSetTimeTask = \"/plan/setTimeTask\";//设置模式定时\n String urlPlanTimeTaskSwitch = \"/plan/switchTimeTask\";//开启或关闭模式定时\n String urlPlanAllModes = \"/plan/allModes\";//查询当前主机下所有模式\n\n //主机直连 -> 房间区域相关\n String urlRoomsRemove = \"/room/remove\";//删除房间\n String urlRoomsUpdate = \"/room/update\";//更新房间\n String urlRoomsShow = \"/room/show\";//查询房间\n String urlAreaRemove = \"/room/removearea\";//删除区域\n String urlAreaUpdate = \"/room/updatearea\";//更新区域\n String urlAreaShow = \"/room/showarea\";//查询区域\n String urlRoomsUpdateMode = \"/room/updatemode\";//更新房间模式\n String urlRoomsShowMode = \"/room/showmode\";//查询房间模式\n String urlRoomsActiveMode = \"/room/activemode\";//激活房间模式\n\n//主机直连 -> 告警相关\n\n\n //主机直连 -> 用户相关\n String urlUserLogin = \"/user/login\";//直连登录->(新增)\n String urlUserAuthorizedLogin = \"/user/authorizedLogin\";//授权后的直连登陆(已在云端登陆)->(新增)\n String urlUserLogout = \"/user/logout\";//退出登录->(新增)\n String urlUserSaveUserInfo = \"/user/saveUserInfo\";//直连登录->(新增)\n /*****************************/\n\n String urlReportBloodsugar = \"/health/report_bloodsugar\";//上报血糖值\n String urlDeleteBloodsugar = \"/health/delete_bloodsugar\";//删除血糖值\n String urlUpdateBloodsugar = \"/health/update_bloodsugar\";//修改血糖值\n\n String urlReportBloodPressure = \"/health/report_bloodpressure\";//上报血压值\n String urlDeleteBloodPressure = \"/health/delete_bloodpressure\";//删除血压值\n\n String urlReportBodyWeight = \"/health/report_bodyweight\";//上报体重值\n String urlDeleteBodyWeight = \"/health/delete_bodyweight\";//删除体重值\n\n String urlReportUrine = \"/health/report_urine\"; //上报尿检值\n String urlDeleteUrine = \"/health/delete_urine\";//删除某一条尿检记录\n\n String urlDownHealthCache = \"/data/health_down\";//下载缓存数据\n String urlUploadHealthCache = \"/data/health_upload\";//上传缓存数据\n String urlUploadBloodPressureCache = \"/data/health_upload_blood_pressure\";//上传血压缓存数据\n String urlUploadBloodGlucoseCache = \"/data/health_upload_blood_glucose\";//上传血糖缓存数据\n String urlUploadBodyWeightCache = \"/data/health_upload_body_weight\";//上传体重缓存数据\n String urlUploadUrineCache = \"/data/health_upload_urine\";//上传尿检缓存数据\n\n String urlQueryElec = \"/energy/query_elec\"; //查询电能数据\n String urlQuerySocket = \"/energy/query_socket\"; //查询插座数据\n String urlQueryWater = \"/energy/query_water\"; //查询水表数据\n String urlQueryGas = \"/energy/query_gas\"; //查询气表数据\n\n\n String urlHostShow1 = \"/host/show1\"; //家庭管理中的主机属性\n\n String urlUserInfo = \"/user/userInfo\"; //查找用户信息\n String urlShowInviteCode = \"/user/show_invitecode\"; //查看邀请码\n String urlInvitationConvert = \"/integral/exchange_integral\"; //兑换邀请码\n String urlFamilyAddUser = \"/family/add_user\"; //增加家庭成员\n String urlFamilyTransPermission = \"/family/admin_permission_transfer\"; //转让管理员权限\n String urlFamilyUpdateAlias = \"/family/update_alias\"; //更新主机别名或用户别名\n String urlFamilyDeleteUser = \"/family/delete_user\"; //主机删除用户\n String urlFamilyDeleteHost = \"/family/delete_host\"; //管理员删除主机\n String urlFamilyUserIsAdmin = \"/family/user_isAdmin\"; //当前用户是否为管理员\n String urlFamilyUpdatePermissaion = \"/family/update_permission\"; //更新用户权限\n String urlFamilyUpdateShare = \"/family/update_share\"; //家庭分享健康数据\n String urlFamilyHostAdmin = \"/family/host_admin\"; //查询主机管理员\n\n String urlApplyUserApply = \"/apply/user_apply\"; //主机用户申请\n\n String urlApplyUserApplyV1 = \"/apply/user_apply_v1\"; //主机用户申请接口V1(将判断和推送放在后台)\n String urlApplyUserShow = \"/apply/user_show\"; //查询主机用户申请\n String urlApplyUserDelete = \"/apply/user_delete\"; //删除用户申请\n String urlApplyUserUpdateStatus = \"/apply/user_update_state\"; //更新用户状态\n\n String urlApplyUserUpdateStatusV1 = \"/apply/update_status_v1\"; //更新用户申请状态(将当前状态发送给后台进行筛选)\n String urlApplyUserHost = \"/apply/host_show\"; //查询主机下申请用户\n String urlApplyUserApplyIsExists = \"/apply/user_applyuserid_exist\"; //判断当前用户是否已经申请过\n String urlApplyUserReapply = \"/family/user_reapply\"; //用户重新申请\n String urlApplyQueryUserApplyOrAdnimReject = \"/apply/query_user_apply_reject\"; //查询用户申请或管理员拒绝记录\n\n String urlQueryUserApplyOrShare = \"/apply/query_user_apply_share\"; //查询用户是否有未处理申请或分享\n\n String urlNotificationPush = \"/notification/notification_push\"; //推送通知\n\n String notification_updateMsg = \"/notification_updateMsg\"; //报警通知\n String notification_updateScence = \"/notification_updateScence\"; //场景更新\n String notification_startHomeTimer = \"/notification_startHomeTimer\"; //开启主页轮询\n String notification_stopHomeTimer = \"/notification_stopHomeTimer\"; //关闭主页轮询\n String notification_startDeviceTimer = \"/notification_startDeviceTimer\"; //开启设备轮询\n String notification_stopDeviceTimer = \"/notification_stopDeviceTimer\"; //关闭设备轮询\n String notification_changeHost = \"/notification_changeHost\"; //切换主机\n String notification_updateCity = \"/notification_updateCity\"; //更新城市信息\n String notification_updateFamilyMembers = \"/notification_updateFamilyMembers\"; //更新家庭成员信息\n String notification_removeHomeNotifications = \"/notification_removeHomeNotifications\"; //移除所有通知\n String notification_familyRefresh = \"/notification_familyRefresh\"; //家庭成员刷新\n\n String urlShareUser = \"/share/user_share\"; //查询家庭的接口\n String urlQueryHealth = \"/health/query_health\"; //查询选定日期区间健康数据接口\n String urlQueryRecentHealth = \"/health/query_recent_health\"; //查询最近的健康数据分享接口\n\n String urlQueryRecentNotification = \"/notification/query_recent_notification\"; //查询最近的通知消息\n\n String urlFeedback = \"/feedback/feedback_push\"; //客户端的意见反馈\n\n String urlHostGuard = \"/host/guard\";//门禁对讲接听推送请求\n\n\n String urlStartScanBatch = \"/device/startScanBatch\";//开始批量添加\n String urlStopScanBatch = \"/device/stopScanBatch\";//停止批量添加\n\n String urlQueryDeviceBatch = \"/device/queryDeviceBatch\";//查询设备\n String urlSaveDeviceBatch = \"/device/saveDeviceBatch\";//保存\n\n String urlCommonDevice = \"/device/commondevice\";//设置、取消常用设备\n\n String urlHostShowOnline = \"/host/showonline\"; // 主机是否在线\n String urlgetMsgSettings = \"/settings/find_message_settings_by_mobile\";//获取消息设置\n String urlsetMsgSettings = \"/settings/save_message_settings\";//设置消息设置\n String urlsetPushMsg = \"/notification/notification_push\";//消息推送\n\n String urlQueryAirFilter = \"/energy/query_airFilter\";// 查询 历史记录\n String urlQueryTableWaterFilter = \"/energy/query_tableWaterFilter\";//\n String urlQueryFloorWaterFilter = \"/energy/query_floorWaterFilter\";//\n\n\n}", "public void request(@NonNull WikiSite wiki, @NonNull Callback cb) {\n cb.success(Compilation.getMockInfoForTesting()); // returning mock info for dev/testing\n\n /*cancel();\n Retrofit retrofit = RetrofitFactory.newInstance(getEndpoint(wiki), wiki);\n Service service = retrofit.create(Service.class);\n call = request(service);\n call.enqueue(new CallbackAdapter(cb));*/\n }", "private static OkHttpClient getHttpClient(long timeout) {\n\n return new OkHttpClient\n .Builder()\n .connectTimeout(timeout, TimeUnit.SECONDS)\n .writeTimeout(10, TimeUnit.SECONDS)\n .readTimeout(30, TimeUnit.SECONDS)\n .build();\n }", "public interface GitHubInterface {\n //http://test.xdyapi.haodai.net/Wallet/getAccountList?os_type=1&appid=1&imei=867614023363542&app_version=35000&channel=web&auth_tms=20170306133730&auth_did=5793&auth_dsig=08526488a4ade5a8&auth_uid=193594&auth_usig=8493bf3e111114c9?os_type=1&appid=1&imei=867614023363542&app_version=35000&channel=web&auth_tms=20170306133730&auth_did=5793&auth_dsig=08526488a4ade5a8&auth_uid=193594&auth_usig=8493bf3e111114c9&xid=193594\n\n //这是retrofit版本\n// @POST(\"Wallet/{user}\")\n// Call<Repo> listRepos(@Path(\"user\") String user, @QueryMap Map<String, String> map);\n\n //这是retrofit2版本\n //注意:ResponseBody这个类需要导入\"import okhttp3.ResponseBody\"这个包的\n @POST(\"Wallet/{user}\")\n Call<ResponseBody> listRepos(@Path(\"user\") String user, @QueryMap Map<String, String> map);\n}", "@NonNull\n public static OkHttpClient provideOkHttpClient(Application app) {\n File cacheDir = new File(app.getCacheDir(), \"http\");\n Cache cache = new Cache(cacheDir, DISK_CACHE_SIZE);\n\n OkHttpClient.Builder okHttpClient = new OkHttpClient.Builder()\n .cache(cache);\n\n if (BuildConfig.DEBUG) {\n okHttpClient.addInterceptor(provideHttpLoggingInterceptor());\n }\n return okHttpClient.build();\n }", "private Globals(){\n HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();\n interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\n OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();\n //Creem el Retrofit\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(API_URL)\n .client(client)\n .addConverterFactory(ScalarsConverterFactory.create())\n .addConverterFactory(JacksonConverterFactory.create())\n .build();\n\n serveiRetrofit = retrofit.create(RetrofitAPI.class);\n }", "public void buildPicasso() {\n OkHttpClient client = new OkHttpClient.Builder()\n .addInterceptor(new Interceptor() {\n @Override\n public Response intercept(Chain chain) throws IOException {\n Request newRequest = chain.request().newBuilder()\n .addHeader(\"Authorization\", \"Token \" + token)\n .build();\n return chain.proceed(newRequest);\n }\n })\n .build();\n Picasso.Builder picassoBuilder = new Picasso.Builder(context)\n .downloader(new OkHttp3Downloader(client));\n picasso = picassoBuilder.build();\n isPicasso = true;\n }", "@Test\n public void getUserTest() throws Exception{\n Context appContext = InstrumentationRegistry.getTargetContext();\n String userStr= AssetsUtils.ReadAssetTxtContent(appContext, Constants.ASSET_USER_INFO_PATH);\n\n OkHttpClient client=new OkHttpClient();\n Request request = new Request.Builder().url(Constants.USER_INFO_URL).build();\n String userRequestStr=\"\";\n try(Response response=client.newCall(request).execute()){\n userRequestStr=response.body().string();\n }\n assertEquals(userStr,userRequestStr);\n }", "public okhttp3.Request followUpRequest() {\n /*\n r5 = this;\n r1 = 0;\n r0 = r5.userResponse;\n if (r0 != 0) goto L_0x000b;\n L_0x0005:\n r0 = new java.lang.IllegalStateException;\n r0.<init>();\n throw r0;\n L_0x000b:\n r0 = r5.streamAllocation;\n r0 = r0.connection();\n if (r0 == 0) goto L_0x0027;\n L_0x0013:\n r0 = r0.route();\n L_0x0017:\n r2 = r5.userResponse;\n r2 = r2.code();\n r3 = r5.userRequest;\n r3 = r3.method();\n switch(r2) {\n case 300: goto L_0x0063;\n case 301: goto L_0x0063;\n case 302: goto L_0x0063;\n case 303: goto L_0x0063;\n case 307: goto L_0x0053;\n case 308: goto L_0x0053;\n case 401: goto L_0x0046;\n case 407: goto L_0x0029;\n case 408: goto L_0x00dc;\n default: goto L_0x0026;\n };\n L_0x0026:\n return r1;\n L_0x0027:\n r0 = r1;\n goto L_0x0017;\n L_0x0029:\n if (r0 == 0) goto L_0x003f;\n L_0x002b:\n r1 = r0.proxy();\n L_0x002f:\n r1 = r1.type();\n r2 = java.net.Proxy.Type.HTTP;\n if (r1 == r2) goto L_0x0046;\n L_0x0037:\n r0 = new java.net.ProtocolException;\n r1 = \"Received HTTP_PROXY_AUTH (407) code while not using proxy\";\n r0.<init>(r1);\n throw r0;\n L_0x003f:\n r1 = r5.client;\n r1 = r1.proxy();\n goto L_0x002f;\n L_0x0046:\n r1 = r5.client;\n r1 = r1.authenticator();\n r2 = r5.userResponse;\n r1 = r1.authenticate(r0, r2);\n goto L_0x0026;\n L_0x0053:\n r0 = \"GET\";\n r0 = r3.equals(r0);\n if (r0 != 0) goto L_0x0063;\n L_0x005b:\n r0 = \"HEAD\";\n r0 = r3.equals(r0);\n if (r0 == 0) goto L_0x0026;\n L_0x0063:\n r0 = r5.client;\n r0 = r0.followRedirects();\n if (r0 == 0) goto L_0x0026;\n L_0x006b:\n r0 = r5.userResponse;\n r2 = \"Location\";\n r0 = r0.header(r2);\n if (r0 == 0) goto L_0x0026;\n L_0x0075:\n r2 = r5.userRequest;\n r2 = r2.url();\n r0 = r2.resolve(r0);\n if (r0 == 0) goto L_0x0026;\n L_0x0081:\n r2 = r0.scheme();\n r4 = r5.userRequest;\n r4 = r4.url();\n r4 = r4.scheme();\n r2 = r2.equals(r4);\n if (r2 != 0) goto L_0x009d;\n L_0x0095:\n r2 = r5.client;\n r2 = r2.followSslRedirects();\n if (r2 == 0) goto L_0x0026;\n L_0x009d:\n r2 = r5.userRequest;\n r2 = r2.newBuilder();\n r4 = okhttp3.internal.http.HttpMethod.permitsRequestBody(r3);\n if (r4 == 0) goto L_0x00c3;\n L_0x00a9:\n r4 = okhttp3.internal.http.HttpMethod.redirectsToGet(r3);\n if (r4 == 0) goto L_0x00d8;\n L_0x00af:\n r3 = \"GET\";\n r2.method(r3, r1);\n L_0x00b4:\n r1 = \"Transfer-Encoding\";\n r2.removeHeader(r1);\n r1 = \"Content-Length\";\n r2.removeHeader(r1);\n r1 = \"Content-Type\";\n r2.removeHeader(r1);\n L_0x00c3:\n r1 = r5.sameConnection(r0);\n if (r1 != 0) goto L_0x00ce;\n L_0x00c9:\n r1 = \"Authorization\";\n r2.removeHeader(r1);\n L_0x00ce:\n r0 = r2.url(r0);\n r1 = r0.build();\n goto L_0x0026;\n L_0x00d8:\n r2.method(r3, r1);\n goto L_0x00b4;\n L_0x00dc:\n r0 = r5.requestBodyOut;\n if (r0 == 0) goto L_0x00e6;\n L_0x00e0:\n r0 = r5.requestBodyOut;\n r0 = r0 instanceof okhttp3.internal.http.RetryableSink;\n if (r0 == 0) goto L_0x00f1;\n L_0x00e6:\n r0 = 1;\n L_0x00e7:\n r2 = r5.callerWritesRequestBody;\n if (r2 == 0) goto L_0x00ed;\n L_0x00eb:\n if (r0 == 0) goto L_0x0026;\n L_0x00ed:\n r1 = r5.userRequest;\n goto L_0x0026;\n L_0x00f1:\n r0 = 0;\n goto L_0x00e7;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.internal.http.HttpEngine.followUpRequest():okhttp3.Request\");\n }", "private void initialize(){\n if(uri != null)\n httpUriRequest = getHttpGet(uri);\n httpClient = HttpClients.createDefault();\n }", "public interface API {\n\n// String BASE_URL = \"https://www.apiopen.top/\";\n String BASE_URL = \"http://gc.ditu.aliyun.com/\";\n\n\n @GET\n Observable<Response<ResponseBody>> doGet(@Url String Url);\n\n @FormUrlEncoded\n @POST\n Observable<Response<ResponseBody>> doPost(@Url String Url, @FieldMap HashMap<String, String> map);\n\n @Streaming\n @GET\n Observable<Response<ResponseBody>> doDownload(@Url String Url);\n}", "private static String makeHttpRequest(URL url) throws IOException {\n String JSONResponse = null;\n HttpURLConnection urlConnection = null;\n InputStream inputStream = null;\n\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setRequestMethod(Constants.URL_REQUEST_METHOD);\n urlConnection.setReadTimeout(Constants.URL_READ_TIME_OUT);\n urlConnection.setConnectTimeout(Constants.URL_CONNECT_TIME_OUT);\n urlConnection.connect();\n\n if (urlConnection.getResponseCode() == Constants.URL_SUCCESS_RESPONSE_CODE) {\n inputStream = urlConnection.getInputStream();\n JSONResponse = readFromStream(inputStream);\n } else {\n Log.e(LOG_TAG, \"Response code : \" + urlConnection.getResponseCode());\n // If received any other code(i.e 400) return null JSON response\n JSONResponse = null;\n }\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Error Solving JSON response : makeHttpConnection() block\");\n } finally {\n if (urlConnection != null) {\n urlConnection.disconnect();\n }\n if (inputStream != null) {\n inputStream.close();\n // Input stream throws IOException when trying to close, that why method signature\n // specify about IOException\n }\n }\n return JSONResponse;\n }", "public interface ApiStore {\n String API_SERVER_URL = \"http://124.205.9.251:8082/\";//北京\n\n //轮播图\n @POST(\"/mobile/index/noticeList\")\n Call<BannerModel> bannerData(@Query(\"notice_type\") String notice_type);\n\n\n\n //上传文件\n @Multipart\n @POST(\"/mobile/fileUpload/plupload\")\n// Observable<UploadThumbModel> plupload(@Part(\"file\") MultipartBody file, @Query(\"module\") String module);\n Call<UploadThumbModelOkHttp> plupload(@Part MultipartBody.Part file, @Query(\"module\") String module);\n}", "public void loadFromNetworkWithAuth(final String ServiceTag,\n int RequestType,\n final String Url,\n final JSONObject JsonRequest,\n final OnTaskCompleted callback,\n final OnTaskError errorCallback){\n\n JsonObjectRequest jsonObjReq=new JsonObjectRequest(RequestType, Url, JsonRequest,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n Log.e(ServiceTag, response.toString());\n callback.onTaskCompleted(response);\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n if (error instanceof TimeoutError || error instanceof NoConnectionError) {\n Toast.makeText(context,\"Error: Timeout\",Toast.LENGTH_LONG).show();\n } else if (error instanceof AuthFailureError) {\n Toast.makeText(context,\"Error: AuthFailure\",Toast.LENGTH_LONG).show();\n } else if (error instanceof ServerError) {\n String responseBody = null;\n try {\n responseBody = new String(error.networkResponse.data, \"utf-8\");\n JSONObject jsonObject = new JSONObject(responseBody);\n Log.e(\"Error-Msg\",jsonObject.getString(\"errorMessage\"));\n Toast.makeText(context, jsonObject.getString(\"errorMessage\"), Toast.LENGTH_LONG).show();\n errorCallback.onTaskError(jsonObject.getString(\"errorMessage\"));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n } else if (error instanceof NetworkError) {\n Toast.makeText(context,\"Error: Network issue\",Toast.LENGTH_LONG).show();\n } else if (error instanceof ParseError) {\n Toast.makeText(context,\"Error: Parse Error\",Toast.LENGTH_LONG).show();\n }\n }\n }){\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n HashMap<String, String> headers = new HashMap<String, String>();\n headers.put(\"Content-Type\", \"application/json\");\n headers.put(\"Authorization\", ConstantVariables.auth_token);\n return headers;\n }\n };\n jsonObjReq.setRetryPolicy(retryPolicy);\n if (checkInternetConnection() == true) {\n try{\n AppController.getInstance().addToRequestQueue(jsonObjReq, ServiceTag);\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n\n }", "public static OkHttpClient.Builder okHttpClientBuilder(OkHttpClient.Builder builder) {\n return builder;\n }", "private static String makeHTTPRequest(URL url) throws IOException {\n\n // Create an empty json string\n String jsonResponse = \"\";\n\n //IF url is null, return early\n if (url == null) {\n return jsonResponse;\n }\n\n // Create an Http url connection, and an input stream, making both null for now\n HttpURLConnection connection = null;\n InputStream inputStream = null;\n\n try {\n\n // Try to open a connection on the url, request that we GET info from the connection,\n // Set read and connect timeouts, and connect\n connection = (HttpURLConnection) url.openConnection();\n connection.setRequestMethod(\"GET\");\n connection.setReadTimeout(10000 /*Milliseconds*/);\n connection.setConnectTimeout(15000 /*Milliseconds*/);\n connection.connect();\n\n // If response code is 200 (aka, working), then get and read from the input stream\n if (connection.getResponseCode() == 200) {\n\n Log.v(LOG_TAG, \"Response code is 200: Aka, everything is working great\");\n inputStream = connection.getInputStream();\n jsonResponse = readFromStream(inputStream);\n\n } else {\n // if response code is not 200, Log error message\n Log.v(LOG_TAG, \"Error Response Code: \" + connection.getResponseCode());\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n Log.v(LOG_TAG, \"Error making http request: \" + e);\n } finally {\n // If connection and inputStream are NOT null, close and disconnect them\n if (connection != null) {\n connection.disconnect();\n }\n\n if (inputStream != null) {\n // Closing the input stream could throw an IOException, which is why\n // the makeHttpRequest(URL url) method signature specifies that an IOException\n // could be thrown.\n inputStream.close();\n }\n }\n\n return jsonResponse;\n }", "public static void init() {\n client = new OkHttpClient();\n\n //Construct a HTTP builder\n retrofit = new Retrofit.Builder()\n .client(client)\n .baseUrl(apiAddress)\n .addConverterFactory(GsonConverterFactory.create())\n .build();\n\n //Form an API to receive a token\n kedronService = retrofit.create(IKedronService.class);\n }", "@Override\n public void onClick(View v) {\n sendRequestWithOkHttp();\n// intent = new Intent(MainActivity.this,JsonText.class);\n// startActivity(intent);\n// Toast.makeText(MainActivity.this,\"Success\",Toast.LENGTH_SHORT).show();\n }", "private JSONObject postRequestWithOkHttp(String msg) {\n JSONObject json = null;\n\n RequestBody requestBody = new FormBody.Builder()\n .add(\"chatroom_id\", chatroom_id)\n .add(\"user_id\", \"1155080901\")\n .add(\"name\", name)\n .add(\"message\", msg)\n .build();\n String url = \"http://13.112.156.96/api/asgn3/send_message\";\n OkHttpClient client = new OkHttpClient();\n Log.d(POST, url);\n Request request = new Request.Builder()\n .url(url)\n .post(requestBody)\n .build();\n try {\n Response response = client.newCall(request).execute();\n String responseData = response.body().string();\n json = new JSONObject(responseData);\n Log.d(POST, String.valueOf(json.get(\"status\")));\n } catch (Exception e) {\n e.printStackTrace();\n Log.d(POST, \"POST request error\");\n }\n return json;\n }", "static Downloader m61430a(Context context) {\n try {\n Class.forName(\"com.squareup.okhttp.OkHttpClient\");\n return C18811c.m61450a(context);\n } catch (ClassNotFoundException unused) {\n return new C18803ab(context);\n }\n }", "public static Retrofit getClient() {\n if (retrofit==null) {\n Gson gson = new GsonBuilder()\n .setLenient()\n .create();\n\n HttpLoggingInterceptor logging = new HttpLoggingInterceptor();\n // set your desired log level\n logging.setLevel(HttpLoggingInterceptor.Level.BODY);\n final OkHttpClient okHttpClient = new OkHttpClient.Builder()\n .readTimeout(120, TimeUnit.SECONDS)\n .connectTimeout(120, TimeUnit.SECONDS)\n .addInterceptor(logging)\n .build();\n\n HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();\n interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\n OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();\n\n retrofit = new Retrofit.Builder()\n .client(client)\n .baseUrl(BASE_URL)\n .addConverterFactory(GsonConverterFactory.create(gson))\n .build();\n }\n return retrofit;\n }", "public interface IHttpEngine {\n // get请求\n void get(Context context, String url, Map<String,Object> params,EngineCallBack callBack);\n\n // post请求\n void post(Context context,String url,Map<String,Object> params,EngineCallBack callBack);\n\n // 下载文件\n\n\n // 上传文件\n\n\n // https 添加证书\n}", "@Override\n protected Void doInBackground(Void... voids) {\n OkHttpClient client = new OkHttpClient();\n\n Request request = new Request.Builder()\n .url(surahUrl)\n .build();\n\n try {\n Response response = client.newCall(request).execute();\n\n\n //Getting Surah Metadata from API\n if(response.body() != null){\n\n JSONObject jsonObject = new JSONObject(response.body().string());\n JSONObject jsonObject1 = jsonObject.getJSONObject(\"data\");\n JSONObject jsonObject2 = jsonObject1.getJSONObject(\"surahs\");\n JSONArray jsonArray = jsonObject2.getJSONArray(\"references\");\n\n for(int i = 0; i < jsonArray.length(); i++) {\n JSONObject jsonObject3 = jsonArray.getJSONObject(i);\n\n surahNo = jsonObject3.getString(\"number\");\n surahTitle = jsonObject3.getString(\"englishName\");\n surahArabicTitle = jsonObject3.getString(\"name\");\n surahArabicTitle = surahArabicTitle.replace(\"سُورَةُ \",\"\");\n ayah = ayahNumber + \" \"+ jsonObject3.getString(\"numberOfAyahs\");\n\n if(localePreferences.contains(\"Current_Language\")) {\n String locale = localePreferences.getString(\"Current_Language\", \"\");\n if (locale.equals(\"bn\")) {\n surahTitle = translateDataToBn(surahTitle,surahs_bn,surahs_en);\n surahNo = banglaStringConverter(surahNo);\n ayah = getResources().getString(R.string.ayahNumber) + \" \"+ banglaStringConverter(ayah);\n }\n }\n surahDataModel = new SurahDataModel(surahNo, surahTitle, surahArabicTitle, ayah);\n surahDataModels.add(surahDataModel);\n\n Log.d(\"Response\", \"Surah #\"+i+ \": \" + jsonObject3.getString(\"englishName\"));\n\n }\n\n\n\n\n }\n\n } catch (IOException | JSONException e) {\n e.printStackTrace();\n progressBar.setVisibility(View.GONE);\n }\n\n\n\n\n return null;\n }", "public interface ZhiHuApi {\n\n /**\n * A factory of ZhiHuApi, you do not need to create it every time for network.\n */\n class Factory {\n\n private static final Retrofit.Builder builder;\n\n static {\n builder = new Retrofit.Builder()\n .baseUrl(Constants.BASE_HTTP_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .addCallAdapterFactory(RxJavaCallAdapterFactory.create());\n }\n\n public static <T extends ZhiHuApi> T create(Class<T> clazz) {\n return create(clazz, HostType.HTTP);\n }\n\n public static <T extends ZhiHuApi> T create(Class<T> clazz, HostType type) {\n return create(clazz, type, false);\n }\n\n public static <T extends ZhiHuApi> T create(Class<T> clazz, HostType type, boolean retryOnFailue) {\n Retrofit retrofit = builder\n .client(OkHttpClientHelper.getClient(type, retryOnFailue))\n .build();\n return retrofit.create(clazz);\n }\n\n\n }\n}", "private static String makeHttpRequest(URL url) throws IOException {\n String jsonResponse = \"\";\n // if the url is null, return the response early;\n if (url == null) {\n return jsonResponse;\n }\n HttpURLConnection urlConnection = null;\n InputStream inputStream = null;\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.setReadTimeout(10000 /* milliseconds */);\n urlConnection.setConnectTimeout(15000 /* milliseconds */);\n urlConnection.connect();\n if (urlConnection.getResponseCode() == 200) {\n inputStream = urlConnection.getInputStream();\n jsonResponse = readFromStream(inputStream);\n } else {\n Log.e(LOG_TAG, \"Error response code \" + urlConnection.getResponseCode());\n }\n\n } catch (IOException e) {\n // TODO: Handle the exception\n Log.e(LOG_TAG, \"Problem retrieving from the url\", e);\n } finally {\n if (urlConnection != null) {\n urlConnection.disconnect();\n }\n if (inputStream != null) {\n // function must handle java.io.IOException here\n inputStream.close();\n }\n }\n return jsonResponse;\n }", "public static void main(String[] args) throws ClientProtocolException, IOException {\n\t\tCloseableHttpClient httpclient=createSSLClientDefault();\r\n\t\t//设置代理\r\n\t\tHttpHost proxy=new HttpHost(\"127.0.0.1\",8888,\"http\");\r\n\t\tRequestConfig config=RequestConfig.custom().setProxy(proxy).build();\r\n\t\t//带参数的get请求\r\n\t\tList<NameValuePair> nameValuePair=new ArrayList<NameValuePair>();\r\n\t\tnameValuePair.add(new BasicNameValuePair(\"q\",\"朝花夕拾\"));\r\n\t\tnameValuePair.add(new BasicNameValuePair(\"count\",\"5\"));\r\n\t\tString str=EntityUtils.toString(new UrlEncodedFormEntity(nameValuePair,Consts.UTF_8));\t\t\r\n\t\tHttpGet httpget=new HttpGet(\"https://api.douban.com/v2/book/search\"+\"?\"+str);\r\n\t\thttpget.setConfig(config);\r\n\t\t//设置请求头\r\n\t\thttpget.setHeader(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\");\r\n\t\thttpget.setHeader(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36\");\t\r\n\t\tCloseableHttpResponse response=httpclient.execute(httpget);\r\n\t\t//获取http响应状态码\r\n\t\tint code=response.getStatusLine().getStatusCode();\r\n\t\tSystem.out.println(code);\r\n\t\tHttpEntity entity=response.getEntity();\r\n\t\tString ResponseContent=EntityUtils.toString(entity, \"utf-8\");\t\r\n\t\t//System.out.println(ResponseContent);\r\n\t\t\r\n\t\t\r\n\t\t//JSON解析\r\n\t\tJSONObject jo=new JSONObject(ResponseContent);\r\n\t\t//System.out.println(jo);\r\n\t\tString jo1=jo.getJSONArray(\"books\").getJSONObject(0).getJSONObject(\"images\").getString(\"large\");\r\n\t\tSystem.out.println(jo1);\r\n\t\thttpclient.close();\r\n\t}", "private APIClient() {\n }", "private String makeHttpRequest(URL url) throws IOException {\n String jsonResponse = \"\";\n HttpURLConnection urlConnection = null;\n InputStream inputStream = null;\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.setReadTimeout(10000 /* milliseconds */);\n urlConnection.setConnectTimeout(15000 /* milliseconds */);\n urlConnection.connect();\n if (urlConnection.getResponseCode() == 200) {\n inputStream = urlConnection.getInputStream();\n jsonResponse = readFromStream(inputStream);\n return jsonResponse;\n }\n\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Problem Http Request\", e);\n } catch (Exception e) {\n Log.e(LOG_TAG, \"Problem Http Request\", e);\n } finally {\n if (urlConnection != null) {\n urlConnection.disconnect();\n }\n if (inputStream != null) {\n // function must handle java.io.IOException here\n inputStream.close();\n }\n }\n return jsonResponse;\n }", "@Override\n\t public void onCreate() {\n\t super.onCreate();\n\n\t instance = this;\n\t okHttp = new OkHttpClient();\n\t getDefaultSSLSocketFactory();\n\t }", "private static String makeHttpRequest(URL url) throws IOException {\n String jsonResponse = \"\";\n\n // If the URL is null, then return early.\n if (url == null) {\n return jsonResponse;\n }\n\n HttpURLConnection urlConnection = null;\n InputStream inputStream = null;\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setReadTimeout(10000);\n urlConnection.setConnectTimeout(15000);\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.connect();\n\n // If the request was successful (response code 200),\n // then read the input stream and parse the response.\n if (urlConnection.getResponseCode() == 200) {\n inputStream = urlConnection.getInputStream();\n jsonResponse = readFromStream(inputStream);\n } else {\n Log.e(LOG_TAG, \"Error response code: \" + urlConnection.getResponseCode());\n }\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Problem retrieving the Guardian JSON results.\", e);\n } finally {\n if (urlConnection != null) {\n urlConnection.disconnect();\n }\n if (inputStream != null) {\n inputStream.close();\n }\n }\n return jsonResponse;\n }", "private void setupHttpConnectionStuff() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {\n System.setProperty(\"http.keepAlive\", \"false\");\n }\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n try {\n final File httpCacheDir = new File(getCacheDir(), \"http\");\n HttpResponseCache.install(httpCacheDir, TEN_MEGABYTES);\n } catch (IOException ioe) {\n Log.e(Constants.LOG_TAG, \"Could not install http cache on this device.\");\n }\n }\n }", "public static String makeHTTPRequest(URL url, Context context) throws IOException {\n // If the url is empty, return early\n String jsonResponse = null;\n if (url == null) {\n return jsonResponse;\n }\n final Context mContext = context;\n HttpURLConnection urlConnection = null;\n InputStream inputStream = null;\n\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setReadTimeout(10000 /* milliseconds */);\n urlConnection.setConnectTimeout(15000 /* milliseconds */);\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.connect();\n\n // If the request was successful, the response code should be 200. Read the input stream and\n // parse the response.\n if (urlConnection.getResponseCode() == 200) {\n inputStream = urlConnection.getInputStream();\n jsonResponse = readFromInputStream(inputStream);\n } else {\n Log.e(LOG_TAG, \"Error response code: \" + urlConnection.getResponseCode());\n }\n } catch (IOException e) {\n //use a handler to create a toast on the UI thread\n Handler handler = new Handler(Looper.getMainLooper());\n handler.post(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(mContext, \"Error: Issue with fetching JSON results from Guardian API.\", Toast\n .LENGTH_SHORT)\n .show();\n }\n });\n\n Log.e(LOG_TAG, \"Error: Issue with fetching JSON results from Guardian API. \", e);\n } finally {\n // Close connection\n if (urlConnection != null) {\n urlConnection.disconnect();\n }\n // Close stream\n if (inputStream != null) {\n inputStream.close();\n }\n }\n return jsonResponse;\n }", "public interface AsyncHttpLink{\n// @FormUrlEncoded\n// @POST(\"{url}\")\n// Call<ResponseBody> request(@Path(value = \"url\", encoded = true) String url, @FieldMap Map<String, String> params);\n\n @FormUrlEncoded\n @POST\n Call<ResponseBody> request(@Url String url, @FieldMap Map<String, String> params);\n\n @FormUrlEncoded\n @Headers(\"Authorization: basic dGFjY2lzdW06YWJjZGU=\")\n @POST\n Call<ResponseBody> login(@Url String url, @FieldMap Map<String, String> params);\n}", "@Override\n public void failure(RetrofitError error) {\n\n Toast.makeText(getApplicationContext(),\"PLEASE CHECK INTERNET\",Toast.LENGTH_LONG).show();\n }", "private void fetchEverything() {\n ApiNewsMethods newsEverything = retrofit.create(ApiNewsMethods.class);\n newsEverything.getEverything(\"bitcoin\"/*topic input by user*/, newsApiKey).enqueue(new Callback<NewsModelClass>() {\n @Override\n public void onResponse(Call<NewsModelClass> call, Response<NewsModelClass> response) {\n if(response.isSuccessful()) {\n newsModelBody = response.body();\n Log.d(\"myBODY\", newsModelBody.getStatus());\n //text to speech object of the response fetched\n newsUIChanges();\n } else {\n Log.d(\"mySTRING\", \"DID NOT OCCUR\");\n }\n }\n\n @Override\n public void onFailure(Call<NewsModelClass> call, Throwable t) {\n }\n\n });\n }", "interface BaseApi {\n Retrofit getRetrofit();\n\n OkHttpClient.Builder setInterceptor(Interceptor interceptor);\n\n Retrofit.Builder setConverterFactory(Converter.Factory factory);\n}", "public interface WeatherApi {\n String ss=\"https://free-api.heweather.com/v5/forecast?city=杭州&key=1bda33b149584e68b6932b234c12d8fe\";\n //必须以‘/’结尾\n String key=\"1bda33b149584e68b6932b234c12d8fe\";\n String Host=\"https://free-api.heweather.com/v5/\";\n //1.使用了Retrofit自己的返回类型Call和自定义泛型参数\n @GET(\"forecast\")\n @FormUrlEncoded//默认形式请求数据类型mime\n Call<HeWeathers> getWeatherJson(@Query(\"city\") String city,@Query(\"key\") String key);\n\n //2.使用了Retrofit自己的返回类型Call和okhttp3.ResponseBody\n @GET(\"forecast\")\n Call<ResponseBody> getWeather3Json(@Query(\"city\") String city,@Query(\"key\") String key);\n\n //3.使用了RxJava返回类型Observable和自定义泛型参数\n @GET(\"forecast\")\n Observable<HeWeathers> getWeather2Json(@Query(\"city\") String city,@Query(\"key\") String key);\n\n //4.使用了RxJava返回类型Observable和okhttp3.ResponseBody\n @GET(\"forecast\")\n Observable<ResponseBody> getWeather4Json(@Query(\"city\") String city,@Query(\"key\") String key);\n\n //5.使用了RxJava返回类型Observable和自定义泛型参数\n @GET(\"forecast\")\n Observable<Weather> getWeather5Json(@Query(\"city\") String city, @Query(\"key\") String key);\n /**\n * {@link Part} 后面支持三种类型,{@link RequestBody}、{@link okhttp3.MultipartBody.Part} 、任意类型\n * 除 {@link okhttp3.MultipartBody.Part} 以外,其它类型都必须带上表单字段({@link okhttp3.MultipartBody.Part} 中已经包含了表单字段的信息),\n */\n @POST(\"/form\")\n @Multipart\n Call<ResponseBody> testFileUpload1(@Part(\"name\") RequestBody name, @Part(\"age\") RequestBody age, @Part MultipartBody.Part file);\n}", "private String gatewayRequest(String url) {\n final ProgressDialog pDialog = new ProgressDialog(mCtx);\n pDialog.setMessage(\"Loading...\");\n pDialog.show();\n\n JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET,\n url, null,\n new Response.Listener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n manageResponse(response);\n //manageResponse(getDevicesMoke());\n\n pDialog.hide();\n }\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(TAG, \"Error: \" + error.getMessage());\n // hide the progress dialog\n pDialog.hide();\n }\n });\n HttpHandler.getInstance(mCtx).addToRequestQueue(jsonObjReq);\n return \"\";\n\n }", "@Override\n public void onSuccess(int statusCode, cz.msebera.android.httpclient.Header[] headers, JSONObject response) {\n try {\n String status = response.getString(\"status\");\n if (status.contains(\"status not ok\")) {\n lt.error();\n Toast.makeText(activity, response.getString(\"error\"), Toast.LENGTH_LONG).show();\n } else {\n lt.success();\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "private KubevirtNetworkingUtil() {\n }", "public interface HttpApi {\n /**\n * 使用YiXinApp.isDebug来标记是测试还是正式的\n * {@link BaseApplication}\n *\n */\n /*使用同一的开关来标识测试还是正式\n * :左侧为测试网\n * :右侧为正式网\n * */\n String unionPayMode = BaseApplication.isDebug ? \"01\" : \"00\";\n String ROOT_HOST_NAME = BaseApplication.isDebug ? \"http://210.14.72.52\" : \"http://firstaid.skyhospital.net\";\n String URL_BASE = BaseApplication.isDebug ? \"/firstaid/1.0/\" : \"/firstaid/1.0/\";\n String URL_WEB = BaseApplication.isDebug ? \"/shopweb/index.php/\" : \"/shopweb/index.php/\";\n\n /**\n * 用户登录\n */\n String lOGIN_URL = ROOT_HOST_NAME + URL_BASE + \"login.php\";\n\n}", "private RetrofitClient(Context context){\n mRetrofit=new Retrofit.Builder()\n .baseUrl(NetworkUtility.BASEURL)\n .addConverterFactory(GsonConverterFactory.create())\n// .client(createClient(context))\n .build();\n }", "public interface RequestService {\n //http://gank.io/api/data/Android/10/1\n /*@GET(\"api/data/Android/10/1\")\n Call<ResponseBody> getAndroidInfo();*/\n @GET(\"api/data/Android/10/1\")\n Call<GankBean> getAndroidInfo();\n @GET(\"api/data/Android/10/{page}\")\n Call<GankBean> getAndroidInfo(@Path(\"page\") int page);\n @GET(\"api/data/query?cityname=深圳\")\n Call<ResponseBody> getWeather(@Query(\"key\") String key,@Query(\"area\") String area);\n @GET(\"group/{id}/users\")\n Call<List<User2>> groupList(@Field(\"id\") int groupId, @QueryMap Map<String,String> options);\n @GET\n Call<GankBean> getAndroid2Info(@Url String url);\n\n}", "private static String makeHttpRequest(URL url) throws IOException {\n String jsonResponse = \"\";\n\n // If the URL is null, then return early.\n if (url == null) {\n return jsonResponse;\n }\n\n HttpURLConnection urlConnection = null;\n InputStream inputStream = null;\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setReadTimeout(10000 /* milliseconds */);\n urlConnection.setConnectTimeout(15000 /* milliseconds */);\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.connect();\n\n // If the request was successful (response code 200),\n // then read the input stream and parse the response.\n if (urlConnection.getResponseCode() == 200) {\n inputStream = urlConnection.getInputStream();\n jsonResponse = readFromStream(inputStream);\n } else {\n Log.e(LOG_TAG, \"Error response code: \" + urlConnection.getResponseCode());\n }\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Problem retrieving the posts JSON results.\", e);\n } finally {\n if (urlConnection != null) {\n urlConnection.disconnect();\n }\n if (inputStream != null) {\n inputStream.close();\n }\n }\n\n\n return jsonResponse;\n }", "@Test\n public void httpEasyRequest() throws HttpResponseException, IOException {\n Logger logger = (Logger) LoggerFactory.getILoggerFactory().getLogger(Logger.ROOT_LOGGER_NAME);\n logger.setLevel(Level.ALL);\n \n HttpEasy.withDefaults().proxyConfiguration(ProxyConfiguration.AUTOMATIC);\n\n JsonReader json = HttpEasy.request()\n .baseUrl(\"http://httpbin.org\")\n .header(\"hello\", \"world\")\n .path(\"get\")\n .queryParam(\"name\", \"fred\")\n .logRequestDetails()\n .get()\n .getJsonReader();\n\n assertThat(json.getAsString(\"url\"), is(\"http://httpbin.org/get?name=fred\"));\n\n }", "@Test\n\tpublic void latest_Client() throws ClientProtocolException, IOException\n {\n CloseableHttpClient httpclinet2=HttpClientBuilder.create().build();\n \n // 2 Url purpose\n HttpGet httpget= new HttpGet(\"https://reqres.in\");\n \n // 3 Add Header\n\t httpget.addHeader(\"Authorization\",\"Bearer_ HGHKHGKHGKGKHGHGHJGKHGK\");\n\t \n\t /*********4 execute the API and store response************/ \n\t CloseableHttpResponse response= httpclinet2.execute(httpget);\n\t \n\t // Read the status code\n\t int i= response.getStatusLine().getStatusCode();\n\t System.out.println(i);\n\t Assert.assertEquals(200, i);\n\t \n\t //Print the response and store the response in string, here you cannot directly store the response and print.\n\t HttpEntity entity= response.getEntity();\n\t String data=EntityUtils.toString(entity);\n\t System.out.println(data);\n\t \n\t //GetJson value using Rest Assured Jsonpath value\n\t JsonPath json=new JsonPath(data);\n\t String dataapi=json.getString(\"Meta_.id\");\n\t System.out.println(dataapi);\n\t \n\t //working on Jway API alternative of jpath to retrieve the value.\n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n }", "private Api() {\n // Implement a method to build your retrofit\n buildRetrofit(BASE_URL);\n }", "public interface Api {\n @Headers({\"Content-Type: application/json\",\"Accept: application/json\"})\n @POST(\"anslogsave\")\n Call<ResponseBody> anslogsave(@Body RequestBody anslog);\n\n @Headers({\"Content-Type: application/json\",\"Accept: application/json\"})\n @POST(\"robotlogsave\")\n Call<ResponseBody> robotlogsave(@Body RequestBody robotlogsave);\n\n @Headers({\"Content-Type: application/json\",\"Accept: application/json\"})\n @POST(\"robotstatsave\")\n Call<ResponseBody> robotstatsave(@Body RequestBody robotstatsave);\n\n @FormUrlEncoded\n @POST(\"borr\")\n Call<String> borr(@Field(\"title\")String title,\n @Field(\"inflag\")int inflag);\n @FormUrlEncoded\n @POST(\"guide\")\n Call<String> guide(@Field(\"title\")String title);\n @FormUrlEncoded\n @POST(\"\")\n Call<String> baidu();\n\n @Headers({\"Content-Type: application/json\",\"Accept: application/json\"})\n @POST(\"data\")\n Call<ResponseBody> upCewen(@Body RequestBody upCewen);\n\n @GET(\"doc_list?\")\n Call<String> search(@Query(\"search_txt\")String search);\n}", "private void postRequest(String my_id, int owner_id, Boolean accept) {\n ApiInterface apiService = ApiClient.getRetrofitClient().create(ApiInterface.class);\n Call<Request> call = apiService.getRequest(my_id, owner_id, accept);\n // progressDoalog.show();\n loadingDialog = new LoadingDialog((Activity) context);\n alert = new Alert((Activity) context);\n loadingDialog.startLoadingDialog();\n call.enqueue(new Callback<Request>() {\n @Override\n public void onResponse(Call<Request> call, Response<Request> response) {\n\n if (response.isSuccessful()) {\n loadingDialog.dismissDialog();\n if (response.body().equals(true))\n // progressDoalog.dismiss();\n alert.showAlertSuccess(\"تم قبول الطلب\");\n else\n alert.showAlertSuccess(\"تم رفض الطلب\");\n //Toast.makeText(context, \"don\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Request> call, Throwable t) {\n // progressDoalog.dismiss();\n loadingDialog.dismissDialog();\n // Toast.makeText(context, \"خطاء في النظام الخارجي\", Toast.LENGTH_SHORT).show();\n alert.showAlertError(\"خطاء في النظام الخارجي\");\n\n }\n });\n }", "Http.Status status();", "public interface OkHttpResponseListener<T> {\n void onJsonObjectResponse(T t);\n\n void onJsonArrayResponse(List<T> t);\n\n void onError(String error);\n}", "private void buildRetrofit() {\n OkHttpClient client = new OkHttpClient.Builder()\n .addInterceptor(new ResponseInterceptor())\n .build();\n\n Retrofit retrofit = new Retrofit.Builder()\n .baseUrl(baseURL)\n .addConverterFactory(GsonConverterFactory.create())\n .client(client)\n .build();\n\n apiInterface = retrofit.create(APIInterface.class);\n }", "@Test\n\t \n\t public void getApi() {\n\t\t \n\t\t Response getIt=get(\"https://reqres.in/api/users?page=2\");\n\t\t getIt.prettyPrint();\n\t\t System.out.println(getIt.getStatusCode());\n\t\t System.out.println(getIt.getTime());\n\t\t \n\t\t //to validate\n\t\t int validGstatus=getIt.getStatusCode();\n\t\t Assert.assertEquals(validGstatus,200);\n\t\t \n\t }", "@Test\n public void doRequestURL() throws IOException, NoSuchAlgorithmException, KeyManagementException {\n doRequest(\"https://login.cloud.huawei.com/oauth2/v2/token\");\n\n\n //doRequestWithOutHttps(\"https://124.74.46.118:7012/business/service\");\n //doRequestWithOutHttpsPool(\"https://124.74.46.118:7012/business/service\");\n }", "public RequestHandle get(final int requestID, final String[] arr, final HashMap<String, String> headerMap, final Context context, final String url,\n final ResponseHandler responseHandler,\n boolean showLoadingIndicator, IndicatorStyle style) {\n\n RequestHandle rQ = null;\n if (showLoadingIndicator) {\n progressDialog = new ProgressDialog(context, style).show();\n }\n\n switch (NetworkUtil.getConnectivityStatus(context)) {\n case OFFLINE:\n responseHandler.onRequestFinished(requestID, RequestStatus.NO_CONNECTION, 0, null);\n try {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n } catch (Exception e) {\n\n }\n\n break;\n case WIFI_CONNECTED_WITHOUT_INTERNET:\n responseHandler.onRequestFinished(requestID, RequestStatus.NO_INTERNET, 0, null);\n try {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n } catch (Exception e) {\n\n }\n break;\n case MOBILE_DATA_CONNECTED:\n case WIFI_CONNECTED_WITH_INTERNET:\n\n if (headerMap != null) {\n\n\n Iterator myVeryOwnIterator = headerMap.keySet().iterator();\n while (myVeryOwnIterator.hasNext()) {\n String key = (String) myVeryOwnIterator.next();\n String value = (String) headerMap.get(key);\n client.addHeader(key, value);\n // Toast.makeText(ctx, \"Key: \"+key+\" Value: \"+value, Toast.LENGTH_LONG).show();\n }\n\n\n }\n\n rQ = client.get(url, new AsyncHttpResponseHandler() {\n\n @Override\n public void onStart() {\n Log.v(\"URL\", url);\n\n }\n\n @Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n // Header[] header=headers;\n\n if (responseBody != null) {\n String response = new String(responseBody);\n Log.v(\"Response\", response + \"\");\n // Log.e(\"statuescode\", statusCode + \"\");\n responseHandler.onRequestSucess(requestID, arr,\n RequestStatus.SUCCEED, statusCode, response);\n } else {\n responseHandler.onRequestFinished(requestID,\n RequestStatus.SUCCEED, statusCode, null);\n // Log.e(\"statuescode\",statusCode+\"\");\n\n }\n\n try {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n } catch (Exception e) {\n\n }\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers,\n byte[] responseBody, Throwable error) {\n error.printStackTrace();\n Header[] header=headers;\n if (responseBody != null) {\n String response = new String(responseBody);\n Log.v(\"Response\", response + \"\");\n responseHandler.onRequestFinished(requestID,\n RequestStatus.FAILED, statusCode, response);\n } else {\n responseHandler.onRequestFinished(requestID,\n RequestStatus.FAILED, statusCode, null);\n }\n\n try {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n } catch (Exception e) {\n\n }\n }\n });\n // rQ.cancel(true);\n break;\n }\n return rQ;\n }", "public interface ApiService {\n public static final String Base_URL = \"http://ip.taobao.com/\";\n /**\n *普通写法\n */\n @GET(\"service/getIpInfo.php/\")\n Observable<ResponseBody> getData(@Query(\"ip\") String ip);\n\n\n @GET(\"{url}\")\n Observable<ResponseBody> executeGet(\n @Path(\"url\") String url,\n @QueryMap Map<String, String> maps);\n\n\n @POST(\"{url}\")\n Observable<ResponseBody> executePost(\n @Path(\"url\") String url,\n @FieldMap Map<String, String> maps);\n\n /* @Multipart\n @POST(\"{url}\")\n Observable<ResponseBody> upLoadFile(\n @Path(\"url\") String url,\n @Part(\"image\\\\\"; filename=\\\\\"image.jpg\") RequestBody avatar);\n\n @POST(\"{url}\")\n Call<ResponseBody> uploadFiles(\n @Url(\"url\") String url,\n @Part(\"filename\") String description,\n @PartMap() Map<String, RequestBody> maps);*/\n\n}", "public interface HttpService {\n//banner/query?type=1\n // public static final String BASE_URL=\"http://112.124.22.238:8081/course_api/\";\n @GET(\"banner/query\")\n Call<List<HeaderBean>> getHeaderData(@Query(\"type\") String type);\n @GET(\"campaign/recommend\")\n Call<List<RecommendBean>> getRecommendData();\n}", "public String hello() throws Exception {\n\n \t\tString apiUrl = \"api/hello.json\";\n \t\t\n \t\tString url = this.baseUrl + apiUrl;\n\n URL urlObj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();\n\n con.setRequestMethod(\"GET\");\n\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n int responseCode = con.getResponseCode();\n String response = \"\";\n\t\tif (responseCode == 200) {\n response = buildReponse(con);\n\t\t} else {\n\t response = \"{'error': 'Something went wrong, looks like the server is down.'}\";\n\t\t}\n\n\t\treturn response; \n \t}", "@Override\n protected PostEntityObject doInBackground(\n String... params) {\n Response response = null;\n try {\n //OKHttp3사용ㄴ\n OkHttpClient toServer = new OkHttpClient.Builder()\n .connectTimeout(15, TimeUnit.SECONDS)\n .readTimeout(15, TimeUnit.SECONDS)\n .build();\n Request request = new Request.Builder()\n .url(NetworkDefineConstant.SERVER_URL_POST_DETAIL + \"/\" + postkey)\n .build();\n\n Log.e(\"modify\", NetworkDefineConstant.SERVER_URL_POST_DETAIL + \"/\" + postkey);\n //동기 방식\n\n response = toServer.newCall(request).execute();\n\n ResponseBody responseBody = response.body();\n\n\n boolean flag = response.isSuccessful();\n\n if (flag) {\n return ParseDataParseHandler.getJSONExDetailList(\n new StringBuilder(responseBody.string()));\n }\n } catch (UnknownHostException une) {\n // e(\"aaa\", une.toString());\n } catch (UnsupportedEncodingException uee) {\n // e(\"bbb\", uee.toString());\n } catch (Exception e) {\n // e(\"ccc\", e.toString());\n } finally {\n if (response != null) {\n response.close();\n }\n }\n return null;\n\n\n }", "private static HttpClient getNewHttpClient(){\n HttpParams params = new BasicHttpParams();\n return new DefaultHttpClient(params);\n }", "@Override\n public void onSucceed(int what, Response response) {\n gson = new Gson();\n try {\n switch (what) {\n case 0x021://获取城市\n\n //企查查城市数据解法\n// String jstring = (String) response.get();\n// map = gson.fromJson(jstring, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.citys> list = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"Result\").toString(), new TypeToken<List<DataManager.citys>>() {\n// }.getType());\n// DataManager.citysList = list;\n\n //真实城市数据解法————zlh手解json\n String jstring = (String) response.get();\n map = gson.fromJson(jstring, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (((LinkedTreeMap) map.get(\"data\")).size() != 0) {\n List<LinkedTreeMap> list = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"city\");\n for (int i = 0; i < list.size(); i++) {\n DataManager.citys temp1 = new DataManager.citys();\n temp1.c_name = (String) list.get(i).get(\"c_name\");\n temp1.c_code = (String) list.get(i).get(\"c_code\");\n temp1.citycode = new ArrayList<>();\n List<LinkedTreeMap> templist = (List<LinkedTreeMap>) list.get(i).get(\"citycode\");\n for (int j = 0; j < templist.size(); j++) {\n DataManager.citycode temp2 = new DataManager.citycode();\n temp2.c_code = (String) templist.get(j).get(\"c_code\");\n temp2.c_name = (String) templist.get(j).get(\"c_name\");\n temp1.citycode.add(temp2);\n }\n DataManager.citysList.add(temp1);\n }\n }\n break;\n case 0x110://获取APP最新版本\n jsonString = (String) response.get();\n DataManager.MyNewAppS = gson.fromJson(jsonString, DataManager.MyNewApp.class);\n WelcomeActivity.handler.sendEmptyMessage(1);\n break;\n case 0x111://获取新闻\n jsonString = (String) response.get();\n DataManager.MyNewsS = gson.fromJson(jsonString, DataManager.MyNews.class);\n if (DataManager.MyNewsS.data.Newslist != null && DataManager.MyNewsS.data.Newslist.size() > 0) {\n MainActivity.MyNewsList = DataManager.MyNewsS.data.Newslist;\n }\n WelcomeActivity.handler.sendEmptyMessage(10);\n break;\n case 0x1111://获取更多新闻\n jsonString = (String) response.get();\n DataManager.MyNewsSMore = gson.fromJson(jsonString, DataManager.MyNews.class);\n if (DataManager.MyNewsSMore.data.Newslist != null && DataManager.MyNewsSMore.data.Newslist.size() > 0) {\n for (int i = 0; i < DataManager.MyNewsSMore.data.Newslist.size(); i++) {\n MainActivity.MyNewsList.add(DataManager.MyNewsSMore.data.Newslist.get(i));\n }\n MainActivity.handler.sendEmptyMessage(0);\n } else {\n MainActivity.handler.sendEmptyMessage(101);\n }\n break;\n case 0x112://获取APP首页轮播图\n jsonString = (String) response.get();\n DataManager.LBimgS = gson.fromJson(jsonString, DataManager.LBimg.class);\n WelcomeActivity.handler.sendEmptyMessage(0);\n break;\n case 0x113://获取最新认领\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n if (DataManager.MyClaimUtilsModel.data.Claimlist != null && DataManager.MyClaimUtilsModel.data.Claimlist.size() > 0) {\n MainActivity.MyCliamList = DataManager.MyClaimUtilsModel.data.Claimlist;\n if (MainActivity.handler != null) {\n MainActivity.handler.sendEmptyMessage(7);\n }\n }\n break;\n case 0x1131://获取最新认领(more)\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n if (DataManager.MyClaimUtilsModel.data.Claimlist != null && DataManager.MyClaimUtilsModel.data.Claimlist.size() > 0) {\n Main_NewCliam_MoreListActivity.MyCliamListMore = DataManager.MyClaimUtilsModel.data.Claimlist;\n MainActivity.handler.sendEmptyMessage(11);\n }\n break;\n case 0x114://获取热点\n jsonString = (String) response.get();\n DataManager.MyHotS = gson.fromJson(jsonString, DataManager.MyHot.class);\n if (DataManager.MyHotS.data != null && DataManager.MyHotS.data.HotspotAnalysis != null && DataManager.MyHotS.data.HotspotAnalysis.size() > 0) {\n MainActivity.MyHotsList = DataManager.MyHotS.data.HotspotAnalysis;\n }\n break;\n case 0x022://搜索结果\n String searchstr = (String) response.get();\n //test\n //searchstr=\"{\\\"message\\\":\\\"true\\\",\\\"status\\\":1,\\\"data\\\":{\\\"Result\\\":[{\\\"PRIPID\\\":\\\"3601032011041300098564\\\",\\\"entname\\\":\\\"江西智容科技有限公司\\\",\\\"REGNO\\\":\\\"360103210025958\\\",\\\"REGORG_CN\\\":\\\"南昌高新技术产业开发区\\\",\\\"NAME\\\":\\\"万杏娥\\\",\\\"OPFROM\\\":\\\"2011-04-28\\\",\\\"OPTO\\\":\\\"2031-04-27\\\",\\\"REGSTATE_CN\\\":\\\"存续(在营、开业、在册)\\\",\\\"C_PROVINCE\\\":\\\"36\\\",\\\"D_ADDTIME\\\":\\\"2016-03-17\\\",\\\"C_STATE\\\":\\\"1\\\",\\\"UNISCID\\\":\\\"null\\\",\\\"REGCAP\\\":\\\"5000.0\\\",\\\"ENTTYPE_CN\\\":\\\"有限责任公司(自然人投资或控股)\\\",\\\"DOM\\\":\\\"江西省南昌市高新技术产业开发区高新区高新二路建昌工业园金庐软件园海外大厦北楼306室\\\",\\\"INDUSTRYPHY\\\":\\\"I\\\",\\\"INDUSTRYPHY_NAME\\\":\\\"信息传输、软件和信息技术服务业\\\",\\\"OPSCOPE\\\":\\\"计算机软件系统开发;办公自动化设备销售;计算机系统集成;国内广告的设计、制作、发布、代理;会展服务(以上项目国家有专项规定的除外)\\\"},{\\\"PRIPID\\\":\\\"20160127091814206993\\\",\\\"entname\\\":\\\"江西智容科技有限公司南昌分公司\\\",\\\"REGNO\\\":\\\"360105220000025\\\",\\\"REGORG_CN\\\":\\\"null\\\",\\\"NAME\\\":\\\"罗川\\\",\\\"OPFROM\\\":\\\"2016-02-04\\\",\\\"OPTO\\\":\\\"null\\\",\\\"REGSTATE_CN\\\":\\\"存续(在营、开业、在册)\\\",\\\"C_PROVINCE\\\":\\\"36\\\",\\\"D_ADDTIME\\\":\\\"2016-03-17\\\",\\\"C_STATE\\\":\\\"null\\\",\\\"UNISCID\\\":\\\"91360105MA35GGBY60\\\",\\\"REGCAP\\\":\\\"null\\\",\\\"ENTTYPE_CN\\\":\\\"有限责任公司分公司(自然人投资或控股)\\\",\\\"DOM\\\":\\\"红星村原红星乡财政所\\\",\\\"INDUSTRYPHY\\\":\\\"L\\\",\\\"INDUSTRYPHY_NAME\\\":\\\"租赁和商业服务业\\\",\\\"OPSCOPE\\\":\\\"餐饮企业管理服务;食堂(主食、热菜、早点)(卫生许可证有效期至2011年5月13日止)(以上项目国家有专项规定的除外)\\\"}],\\\"Paging\\\":{\\\"PageSize\\\":40,\\\"PageIndex\\\":0,\\\"TotalRecords\\\":2}}}\";\n map = gson.fromJson(searchstr, new TypeToken<Map<String, Object>>() {\n }.getType());\n// List<DataManager.search> searchstrlist2 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"Result\").toString(), new TypeToken<List<DataManager.search>>() {\n// }.getType());\n// DataManager.searchList = searchstrlist2;\n baging = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"Paging\").toString(), DataManager.baging.class);\n List<LinkedTreeMap> searchstrlist2 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"Result\");//余思\n if (DataManager.searchList.size() != 0) {\n DataManager.searchList.clear();\n }\n if (DataManager.searchListMore.size() != 0) {\n DataManager.searchListMore.clear();\n }\n for (LinkedTreeMap temp : searchstrlist2) {\n DataManager.search serchtemp = new DataManager.search();\n\n serchtemp.ENTTYPE = (String) temp.get(\"ENTTYPE\");\n\n serchtemp.PRIPID = (String) temp.get(\"PRIPID\");\n serchtemp.ENTNAME = (String) temp.get(\"ENTNAME\");\n serchtemp.REGNO = (String) temp.get(\"REGNO\");\n serchtemp.REGORG_CN = (String) temp.get(\"REGORG_CN\");\n serchtemp.NAME = (String) temp.get(\"NAME\");\n serchtemp.OPFROM = (String) temp.get(\"ESTDATE\");//以前是OPFROM后来无缘无故变成ESTDATE\n serchtemp.OPTO = (String) temp.get(\"OPTO\");\n serchtemp.REGSTATE_CN = (String) temp.get(\"REGSTATE_CN\");\n serchtemp.C_PROVINCE = (String) temp.get(\"C_PROVINCE\");\n serchtemp.D_ADDTIME = (Object) temp.get(\"D_ADDTIME\");\n serchtemp.C_STATE = (String) temp.get(\"C_STATE\");\n if (String.valueOf(temp.get(\"REGCAP\")) == \"null\") {\n serchtemp.REGCAP = \"0\";\n }\n if (((String) temp.get(\"REGCAP\")).contains(\".\")) {\n serchtemp.REGCAP = ((String) temp.get(\"REGCAP\")).substring(0, ((String) temp.get(\"REGCAP\")).indexOf(\".\"));//查企业,品牌和失信判定是否有小数点\n } else {\n serchtemp.REGCAP = (String) temp.get(\"REGCAP\");\n }\n serchtemp.ENTTYPE_CN = (String) temp.get(\"ENTTYPE_CN\");\n serchtemp.DOM = (String) temp.get(\"DOM\");\n serchtemp.INDUSTRYPHY = (String) temp.get(\"INDUSTRYPHY\");\n serchtemp.INDUSTRYPHY_NAME = (String) temp.get(\"INDUSTRYPHY_NAME\");\n serchtemp.OPSCOPE = (String) temp.get(\"OPSCOPE\");\n DataManager.searchList.add(serchtemp);\n }\n if (DataManager.searchList != null && DataManager.searchList.size() > 0) {\n SearchFirmActivty.handler.sendEmptyMessage(0);\n } else {\n SearchFirmActivty.handler.sendEmptyMessage(500);\n }\n break;\n case 0x0221://搜索加载更多\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n baging = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"Paging\").toString(), DataManager.baging.class);\n List<LinkedTreeMap> searchstrlist22 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"Result\");\n if (DataManager.searchListMore.size() != 0) {\n DataManager.searchListMore.clear();\n }\n for (LinkedTreeMap temp : searchstrlist22) {\n DataManager.search serchtemp = new DataManager.search();\n serchtemp.ENTTYPE = (String) temp.get(\"ENTTYPE\");\n serchtemp.PRIPID = (String) temp.get(\"PRIPID\");\n serchtemp.ENTNAME = (String) temp.get(\"ENTNAME\");\n serchtemp.REGNO = (String) temp.get(\"REGNO\");\n serchtemp.REGORG_CN = (String) temp.get(\"REGORG_CN\");\n serchtemp.NAME = (String) temp.get(\"NAME\");\n serchtemp.OPFROM = (String) temp.get(\"ESTDATE\");//以前是OPFROM后来无缘无故变成ESTDATE\n serchtemp.OPTO = (String) temp.get(\"OPTO\");\n serchtemp.REGSTATE_CN = (String) temp.get(\"REGSTATE_CN\");\n serchtemp.C_PROVINCE = (String) temp.get(\"C_PROVINCE\");\n serchtemp.D_ADDTIME = (Object) temp.get(\"D_ADDTIME\");\n serchtemp.C_STATE = (String) temp.get(\"C_STATE\");\n if (String.valueOf(temp.get(\"REGCAP\")) == \"null\") {\n serchtemp.REGCAP = \"0\";\n }\n if (((String) temp.get(\"REGCAP\")).contains(\".\")) {\n serchtemp.REGCAP = ((String) temp.get(\"REGCAP\")).substring(0, ((String) temp.get(\"REGCAP\")).indexOf(\".\"));//查企业,品牌和失信去小数点\n } else {\n serchtemp.REGCAP = (String) temp.get(\"REGCAP\");\n }\n\n serchtemp.ENTTYPE_CN = (String) temp.get(\"ENTTYPE_CN\");\n serchtemp.DOM = (String) temp.get(\"DOM\");\n serchtemp.INDUSTRYPHY = (String) temp.get(\"INDUSTRYPHY\");\n serchtemp.INDUSTRYPHY_NAME = (String) temp.get(\"INDUSTRYPHY_NAME\");\n serchtemp.OPSCOPE = (String) temp.get(\"OPSCOPE\");\n DataManager.searchListMore.add(serchtemp);\n }\n if (DataManager.searchListMore != null && DataManager.searchListMore.size() > 0) {\n SearchFirmActivty.handler.sendEmptyMessage(0);\n } else {\n SearchFirmActivty.handler.sendEmptyMessage(500);\n }\n break;\n case 0x023://预留获取行业\n// gson = new Gson();\n// String str3 = (String) response.get();\n// map = gson.fromJson(str3, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<LinkedTreeMap> listtemp = (List<LinkedTreeMap>) map.get(\"data\");\n// String jsonstradd = gson.toJson(listtemp);\n// List<DataManager.industryData> listtemps = gson.fromJson(jsonstradd, new TypeToken<List<DataManager.Data>>() {\n// }.getType());\n// DataManager.dataList = listtemps;\n// for (DataManager.industryData dt : DataManager.dataList) {\n// DataManager.SubyList = dt.SubIndustryList;\n// }\n /*DataManager.industry industry1 = null;\n String industry = (String) response.get();*/\n\n /* try {\n JSONObject a=new JSONObject(industry);\n JSONArray array=a.getJSONArray(\"data\");\n for(int i=0;i<array.length();i++){\n JSONObject b=array.getJSONObject(i);\n DataManager.industry.Name= (String) b.get(\"Name\");\n DataManager.industry.Code=(String) b.get(\"Code\");\n DataManager.industry.Desc=(String) b.get(\"Desc\");\n JSONArray array1=b.getJSONArray(\"SubIndustryList\");\n for(int j=0;j<array1.length();j++){\n JSONObject c =(JSONObject) array1.get(j);\n DataManager.industry.SubIndustryList.add((String) c.get(\"Name\"));\n }\n DataManager.industryList.add(industry1);\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }*/\n String str3 = (String) response.get();\n map = gson.fromJson(str3, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (((LinkedTreeMap) map.get(\"data\")).size() != 0) {\n List<LinkedTreeMap> list4 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"industry\");\n if (DataManager.industryDataList.size() != 0) {\n DataManager.industryDataList.clear();\n }\n for (LinkedTreeMap tempTree : list4) {\n DataManager.industryData industryData = new DataManager.industryData();\n industryData.EC_VALUE = (String) tempTree.get(\"EC_VALUE\");\n industryData.EC_NAME = (String) tempTree.get(\"EC_NAME\");\n DataManager.industryDataList.add(industryData);\n }\n }\n\n break;\n case 0x024://获取企业详情24宫格等\n jsonString = (String) response.get();\n try {\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> lists2 = null;\n if (map.get(\"data\") != null && !map.get(\"data\").equals(null) && ((Map<String, Object>) map.get(\"data\")).get(\"allcount\") != null && !((Map<String, Object>) map.get(\"data\")).get(\"allcount\").equals(null)) {\n lists2 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"allcount\");\n }\n List<LinkedTreeMap> lists3 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"baseinfo\");\n if (DataManager.allcountsList != null) {\n DataManager.allcountsList.clear();\n }\n if (DataManager.BaseinfoList != null) {\n DataManager.BaseinfoList.clear();\n }\n\n if (lists2 != null && lists2.size() > 0) {\n for (LinkedTreeMap temp : lists2) {\n DataManager.allcount cfo = new DataManager.allcount();\n cfo.EnterAddtionID = temp.get(\"EnterAddtionID\").toString();\n cfo.IsFavorite = temp.get(\"IsFavorite\").toString();\n cfo.HonorCount = temp.get(\"HonorCount\").toString();\n cfo.JudiciaryCount = temp.get(\"JudiciaryCount\").toString();\n cfo.PledgeCount = temp.get(\"PledgeCount\").toString();\n cfo.CopyrightCount = temp.get(\"CopyrightCount\").toString();\n cfo.AnnualCount = temp.get(\"AnnualCount\").toString();\n cfo.AdvertisementCount = temp.get(\"AdvertisementCount\").toString();\n cfo.BaseInfoCount = temp.get(\"BaseInfoCount\").toString();\n cfo.ApprovalCount = temp.get(\"ApprovalCount\").toString();\n cfo.PunishCount = temp.get(\"PunishCount\").toString();\n cfo.WarningCount = temp.get(\"WarningCount\").toString();\n cfo.TrademarkCount = temp.get(\"TrademarkCount\").toString();\n cfo.AbnormityCount = temp.get(\"AbnormityCount\").toString();\n cfo.CreditCount = temp.get(\"CreditCount\").toString();\n cfo.SupportCount = temp.get(\"SupportCount\").toString();\n cfo.MortgagorCount = temp.get(\"MortgagorCount\").toString();\n cfo.PatentCount = temp.get(\"PatentCount\").toString();\n cfo.PageView = temp.get(\"PageView\").toString();\n cfo.IsClaim = temp.get(\"IsClaim\").toString();\n cfo.EntShowCount = temp.get(\"EntShowCount\").toString();//++\n cfo.BiddingCount = temp.get(\"BiddingCount\").toString();\n cfo.JobCount = temp.get(\"JobCount\").toString();\n cfo.EntNewCount = temp.get(\"EntNewCount\").toString();\n DataManager.allcountsList.add(cfo);\n }\n }\n if (lists3 != null && lists3.size() > 0) {\n for (LinkedTreeMap temp : lists3) {\n DataManager.Baseinfo cfo = new DataManager.Baseinfo();\n cfo.REGSTATE = temp.get(\"REGSTATE\").toString();\n cfo.REGNO = temp.get(\"REGNO\").toString();\n cfo.NAME = temp.get(\"NAME\").toString();\n cfo.REGCAP = temp.get(\"REGCAP\").toString();\n cfo.ESTDATE = temp.get(\"ESTDATE\").toString();\n cfo.ENTTYPE_CN = temp.get(\"ENTTYPE_CN\").toString();\n cfo.ENTNAME = temp.get(\"ENTNAME\").toString();\n cfo.REGSTATE_CN = temp.get(\"REGSTATE_CN\").toString();\n cfo.UNISCID = temp.get(\"UNISCID\").toString();\n cfo.PRIPID = temp.get(\"PRIPID\").toString();\n cfo.ENTTYPE = temp.get(\"ENTTYPE\").toString();\n DataManager.BaseinfoList.add(cfo);\n }\n }\n if (DataManager.allcountsList != null && DataManager.allcountsList.size() > 0) {\n SearchFirmActivty.handler.sendEmptyMessage(5);\n } else {\n SearchFirmActivty.handler.sendEmptyMessage(500);\n }\n } catch (NullPointerException e) {\n e.printStackTrace();\n Toast.show(\"该企业暂无数据\");\n SearchFirmActivty.pd.dismiss();\n }\n break;\n case 0x025://我的关注跳公司详情界面的请求\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> lists25 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"allcount\");\n List<LinkedTreeMap> lists35 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"baseinfo\");\n if (DataManager.allcountsList != null) {\n DataManager.allcountsList.clear();\n }\n if (DataManager.BaseinfoList != null) {\n DataManager.BaseinfoList.clear();\n }\n if (lists25 != null && lists25.size() > 0) {\n for (LinkedTreeMap temp : lists25) {\n DataManager.allcount cfo = new DataManager.allcount();\n cfo.EnterAddtionID = temp.get(\"EnterAddtionID\").toString();\n cfo.IsFavorite = temp.get(\"IsFavorite\").toString();\n cfo.HonorCount = temp.get(\"HonorCount\").toString();\n cfo.JudiciaryCount = temp.get(\"JudiciaryCount\").toString();\n cfo.PledgeCount = temp.get(\"PledgeCount\").toString();\n cfo.CopyrightCount = temp.get(\"CopyrightCount\").toString();\n cfo.AnnualCount = temp.get(\"AnnualCount\").toString();\n cfo.AdvertisementCount = temp.get(\"AdvertisementCount\").toString();\n cfo.BaseInfoCount = temp.get(\"BaseInfoCount\").toString();\n cfo.ApprovalCount = temp.get(\"ApprovalCount\").toString();\n cfo.PunishCount = temp.get(\"PunishCount\").toString();\n cfo.WarningCount = temp.get(\"WarningCount\").toString();\n cfo.TrademarkCount = temp.get(\"TrademarkCount\").toString();\n cfo.AbnormityCount = temp.get(\"AbnormityCount\").toString();\n cfo.CreditCount = temp.get(\"CreditCount\").toString();\n cfo.SupportCount = temp.get(\"SupportCount\").toString();\n cfo.MortgagorCount = temp.get(\"MortgagorCount\").toString();\n cfo.PatentCount = temp.get(\"PatentCount\").toString();\n cfo.PageView = temp.get(\"PageView\").toString();\n cfo.IsClaim = temp.get(\"IsClaim\").toString();\n cfo.EntShowCount = temp.get(\"EntShowCount\").toString();//++\n cfo.BiddingCount = temp.get(\"BiddingCount\").toString();\n cfo.JobCount = temp.get(\"JobCount\").toString();\n cfo.EntNewCount = temp.get(\"EntNewCount\").toString();\n DataManager.allcountsList.add(cfo);\n }\n }\n if (lists35 != null && lists35.size() > 0) {\n for (LinkedTreeMap temp : lists35) {\n DataManager.Baseinfo cfo = new DataManager.Baseinfo();\n cfo.REGSTATE = temp.get(\"REGSTATE\").toString();\n cfo.REGNO = temp.get(\"REGNO\").toString();\n cfo.NAME = temp.get(\"NAME\").toString();\n cfo.REGCAP = temp.get(\"REGCAP\").toString();\n cfo.ESTDATE = temp.get(\"ESTDATE\").toString();\n cfo.ENTTYPE_CN = temp.get(\"ENTTYPE_CN\").toString();\n cfo.ENTNAME = temp.get(\"ENTNAME\").toString();\n cfo.REGSTATE_CN = temp.get(\"REGSTATE_CN\").toString();\n cfo.UNISCID = temp.get(\"UNISCID\").toString();\n cfo.PRIPID = temp.get(\"PRIPID\").toString();\n cfo.ENTTYPE = temp.get(\"ENTTYPE\").toString();\n DataManager.BaseinfoList.add(cfo);\n }\n }\n if (DataManager.allcountsList != null && DataManager.allcountsList.size() > 0) {\n MyconcernActivity.handler.sendEmptyMessage(1);\n } else {\n SearchFirmActivty.handler.sendEmptyMessage(500);\n }\n break;\n case 0x026://主界面 跳公司详情\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> lists26 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"allcount\");\n List<LinkedTreeMap> lists261 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"baseinfo\");\n if (DataManager.allcountsList != null) {\n DataManager.allcountsList.clear();\n }\n if (DataManager.BaseinfoList != null) {\n DataManager.BaseinfoList.clear();\n }\n if (lists26 != null && lists26.size() > 0) {\n for (LinkedTreeMap temp : lists26) {\n DataManager.allcount cfo = new DataManager.allcount();\n cfo.EnterAddtionID = temp.get(\"EnterAddtionID\").toString();\n cfo.IsFavorite = temp.get(\"IsFavorite\").toString();\n cfo.HonorCount = temp.get(\"HonorCount\").toString();\n cfo.JudiciaryCount = temp.get(\"JudiciaryCount\").toString();\n cfo.PledgeCount = temp.get(\"PledgeCount\").toString();\n cfo.CopyrightCount = temp.get(\"CopyrightCount\").toString();\n cfo.AnnualCount = temp.get(\"AnnualCount\").toString();\n cfo.AdvertisementCount = temp.get(\"AdvertisementCount\").toString();\n cfo.BaseInfoCount = temp.get(\"BaseInfoCount\").toString();\n cfo.ApprovalCount = temp.get(\"ApprovalCount\").toString();\n cfo.PunishCount = temp.get(\"PunishCount\").toString();\n cfo.WarningCount = temp.get(\"WarningCount\").toString();\n cfo.TrademarkCount = temp.get(\"TrademarkCount\").toString();\n cfo.AbnormityCount = temp.get(\"AbnormityCount\").toString();\n cfo.CreditCount = temp.get(\"CreditCount\").toString();\n cfo.SupportCount = temp.get(\"SupportCount\").toString();\n cfo.MortgagorCount = temp.get(\"MortgagorCount\").toString();\n cfo.PatentCount = temp.get(\"PatentCount\").toString();\n cfo.PageView = temp.get(\"PageView\").toString();\n cfo.IsClaim = temp.get(\"IsClaim\").toString();\n cfo.EntShowCount = temp.get(\"EntShowCount\").toString();//++\n cfo.BiddingCount = temp.get(\"BiddingCount\").toString();\n cfo.JobCount = temp.get(\"JobCount\").toString();\n cfo.EntNewCount = temp.get(\"EntNewCount\").toString();\n DataManager.allcountsList.add(cfo);\n }\n }\n if (lists261 != null && lists261.size() > 0) {\n for (LinkedTreeMap temp : lists261) {\n DataManager.Baseinfo cfo = new DataManager.Baseinfo();\n cfo.REGSTATE = temp.get(\"REGSTATE\").toString();\n cfo.REGNO = temp.get(\"REGNO\").toString();\n cfo.NAME = temp.get(\"NAME\").toString();\n cfo.REGCAP = temp.get(\"REGCAP\").toString();\n cfo.ESTDATE = temp.get(\"ESTDATE\").toString();\n cfo.ENTTYPE_CN = temp.get(\"ENTTYPE_CN\").toString();\n cfo.ENTNAME = temp.get(\"ENTNAME\").toString();\n cfo.REGSTATE_CN = temp.get(\"REGSTATE_CN\").toString();\n cfo.UNISCID = temp.get(\"UNISCID\").toString();\n cfo.PRIPID = temp.get(\"PRIPID\").toString();\n cfo.ENTTYPE = temp.get(\"ENTTYPE\").toString();\n DataManager.BaseinfoList.add(cfo);\n }\n }\n if (DataManager.allcountsList != null && DataManager.allcountsList.size() > 0) {\n MainActivity.handler.sendEmptyMessage(8);\n }\n break;\n case 0x000://工商信息\n /*DataManager.Data0List.clear();\n String jstring0 = (String) response.get();\n DataManager.Root0 jsonRoot0 = gson.fromJson(jstring0, new TypeToken<DataManager.Root0>() {\n }.getType());\n DataManager.Data0 dt = jsonRoot0.data;\n DataManager.Data0List.add(dt);\n if (DataManager.Data0List != null && DataManager.Data0List.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(0);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }*/\n\n jsonString = (String) response.get();\n DataManager.gsxx = gson.fromJson(jsonString, DataManager.GSXX.class);\n if (DataManager.gsxx != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(0);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x001://行政信息\n String jstring1 = (String) response.get();\n map = gson.fromJson(jstring1, new TypeToken<Map<String, Object>>() {\n }.getType());\n\n List<LinkedTreeMap> list1 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"administrative\");\n List<LinkedTreeMap> list221 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"other\");\n if (DataManager.ad_List != null) {\n DataManager.ad_List.clear();\n }\n if (DataManager.admin_other_List != null) {\n DataManager.admin_other_List.clear();\n }\n if (list1 != null && list1.size() > 0) {\n for (LinkedTreeMap temp : list1) {\n DataManager.administraton cfo = new DataManager.administraton();\n cfo.PRIPID = (String) temp.get(\"PRIPID\");\n cfo.LICNAME = (String) temp.get(\"LICNAME\");\n cfo.LICNO = (String) temp.get(\"LICNO\");\n cfo.VALFROM = (String) temp.get(\"VALFROM\");\n cfo.LICANTH = (String) temp.get(\"LICANTH\");\n cfo.VALTO = (String) temp.get(\"VALTO\");\n DataManager.ad_List.add(cfo);\n }\n }\n if (list221 != null && list221.size() > 0) {\n for (LinkedTreeMap temp : list221) {\n DataManager.admin_other cfo = new DataManager.admin_other();\n cfo.LICANTH = (String) temp.get(\"LICANTH\");\n cfo.REGNO = (String) temp.get(\"REGNO\");\n cfo.VALFROM = (String) temp.get(\"VALFROM\");\n cfo.LICNAME_CN = (String) temp.get(\"LICNAME_CN\");\n cfo.LICID = (String) temp.get(\"LICID\");\n cfo.ENTNAME = (String) temp.get(\"ENTNAME\");\n cfo.LICNO = (String) temp.get(\"LICNO\");\n cfo.VALTO = (String) temp.get(\"VALTO\");\n cfo.PRIPID = (String) temp.get(\"PRIPID\");\n cfo.TYPE = (String) temp.get(\"TYPE\");\n cfo.LICITEM = (String) temp.get(\"LICITEM\");\n DataManager.admin_other_List.add(cfo);\n }\n }\n if (DataManager.ad_List != null || DataManager.admin_other_List != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(1);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x002://荣誉信息\n String jstring2 = (String) response.get();\n// map = gson.fromJson(jstring2, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.honorInfo> list2 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"chattel\").toString().trim(), new TypeToken<List<DataManager.honorInfo>>() {\n// }.getType());\n// DataManager.honorInfoList = list2;\n// 以下代码解决空格问题c\n map = gson.fromJson(jstring2, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> list2 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"chattel\");\n\n if (DataManager.honorInfoList != null) {\n DataManager.honorInfoList.clear();\n }\n if (list2 != null && list2.size() > 0) {\n for (LinkedTreeMap temp : list2) {\n DataManager.honorInfo cfo = new DataManager.honorInfo();\n cfo.HONORID = (String) temp.get(\"HONORID\");\n cfo.HONORNAME = (String) temp.get(\"HONORNAME\");\n cfo.HONORCONTENT = (String) temp.get(\"HONORCONTENT\");\n cfo.ORGAN = (String) temp.get(\"ORGAN\");\n cfo.C_UNIQUE_CODE = (String) temp.get(\"C_UNIQUE_CODE\");\n\n DataManager.honorInfoList.add(cfo);\n }\n }\n\n if (DataManager.honorInfoList != null && DataManager.honorInfoList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(2);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x003://企业扶持信息\n String jstring3 = (String) response.get();\n DataManager.supportInfoS = gson.fromJson(jstring3, DataManager.supportInfo.class);\n if (DataManager.supportInfoS != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(3);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x004://抵押信息/动产\n jsonString = (String) response.get();\n DataManager.MychattelS = gson.fromJson(jsonString, DataManager.Mychattel.class);\n break;\n case 0x0041://抵押信息/不动产\n jsonString = (String) response.get();\n DataManager.MyrealEstateS = gson.fromJson(jsonString, DataManager.MyrealEstate.class);\n CompanyDetailsActivity.handler.sendEmptyMessage(4);\n break;\n case 0x005://出质信息\n String jstring5 = (String) response.get();\n DataManager.Root5 jsonRoot5 = gson.fromJson(jstring5, new TypeToken<DataManager.Root5>() {\n }.getType());\n DataManager.pledgeInfoList = jsonRoot5.data;\n if (DataManager.pledgeInfoList != null && DataManager.pledgeInfoList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(5);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x006://司法信息\n String jstring6 = (String) response.get();\n map = gson.fromJson(jstring6, new TypeToken<Map<String, Object>>() {\n }.getType());\n /**\n * json报错解析方法\n */\n// List<DataManager.JudicialDocuments> list61 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"judicialDocuments\").toString(), new TypeToken<List<DataManager.JudicialDocuments>>() {\n// }.getType());\n// List<DataManager.CrackCredit> list62 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"crackCredit\").toString(), new TypeToken<List<DataManager.CrackCredit>>() {\n// }.getType());\n// List<DataManager.ShareholderInformationChange> list63 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"shareholderInformationChange\").toString(), new TypeToken<List<DataManager.ShareholderInformationChange>>() {\n// }.getType());\n// List<DataManager.FrozenInformation> list64 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"frozenInformation\").toString(), new TypeToken<List<DataManager.FrozenInformation>>() {\n// }.getType());\n List<LinkedTreeMap> list61 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"judicialDocuments\");\n List<LinkedTreeMap> list62 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"crackCredit\");\n List<LinkedTreeMap> list63 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"shareholderInformationChange\");\n List<LinkedTreeMap> list64 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"frozenInformation\");\n /**\n * 司法文书信息\n */\n if (DataManager.JudicialDocumentsList != null) {\n DataManager.JudicialDocumentsList.clear();\n }\n if (list61 != null && list61.size() > 0) {\n for (LinkedTreeMap temp : list61) {\n DataManager.JudicialDocuments jud = new DataManager.JudicialDocuments();\n jud.CASENUM = (String) temp.get(\"CASENUM\");\n jud.REDECORG_CN = (String) temp.get(\"REDECORG_CN\");\n jud.SENTENCECONMENT = (String) temp.get(\"SENTENCECONMENT\");\n jud.SENTENCEDATE = (String) temp.get(\"SENTENCEDATE\");\n jud.SUPDEPARTMENT = (String) temp.get(\"SUPDEPARTMENT\");\n DataManager.JudicialDocumentsList.add(jud);\n }\n }\n /**\n * 失信被执行人信息\n */\n if (DataManager.CrackCreditList != null) {\n DataManager.CrackCreditList.clear();\n }\n if (list62 != null && list62.size() > 0) {\n for (LinkedTreeMap temp : list62) {\n DataManager.CrackCredit cra = new DataManager.CrackCredit();\n cra.COURT_NAME = (String) temp.get(\"COURT_NAME\");\n cra.COURTCASEID = (String) temp.get(\"COURTCASEID\");\n cra.DISREPUT_TYPE_NAME = (String) temp.get(\"DISREPUT_TYPE_NAME\");\n cra.GIST_CID = (String) temp.get(\"GIST_CID\");\n cra.PERFORMANCE = (String) temp.get(\"PERFORMANCE\");\n cra.REG_DATE = (String) temp.get(\"REG_DATE\");\n cra.DUTY = (String) temp.get(\"DUTY\");\n DataManager.CrackCreditList.add(cra);\n }\n }\n /**\n * 股东变更信息\n */\n if (DataManager.ShareholderInformationChangeList != null) {\n DataManager.ShareholderInformationChangeList.clear();\n }\n if (list63 != null && list63.size() > 0) {\n for (LinkedTreeMap temp : list63) {\n DataManager.ShareholderInformationChange sha = new DataManager.ShareholderInformationChange();\n sha.ALIEN = (String) temp.get(\"ALIEN\");\n sha.FROAM = (Double) temp.get(\"FROAM\");\n sha.FROAUTH = (String) temp.get(\"FROAUTH\");\n sha.INV = (String) temp.get(\"INV\");\n sha.REGNO = (String) temp.get(\"REGNO\");\n DataManager.ShareholderInformationChangeList.add(sha);\n }\n }\n /**\n * 股权冻结信息\n */\n if (DataManager.FrozenInformationList != null) {\n DataManager.FrozenInformationList.clear();\n }\n if (list64 != null && list64.size() > 0) {\n for (LinkedTreeMap temp : list64) {\n DataManager.FrozenInformation fro = new DataManager.FrozenInformation();\n fro.FROAM = (String) temp.get(\"FROAM\");\n fro.FROAUTH = (String) temp.get(\"FROAUTH\");\n fro.FROFROM = (String) temp.get(\"FROFROM\");\n fro.FROID = (String) temp.get(\"FROID\");\n fro.FROZDEADLINE = (String) temp.get(\"FROZDEADLINE\");\n fro.INVTYPE_CN = (String) temp.get(\"INVTYPE_CN\");\n DataManager.FrozenInformationList.add(fro);\n }\n }\n\n// DataManager.JudicialDocumentsList = list61;//司法文书信息\n// DataManager.CrackCreditList = list62;//失信被执行人信息\n// DataManager.ShareholderInformationChangeList = list63;//股东变更信息\n// DataManager.FrozenInformationList = list64;//股权冻结信息\n\n CompanyDetailsActivity.handler.sendEmptyMessage(6);\n break;\n case 0x007://预警信息zlh\n String jsonstring = (String) response.get();\n DataManager.AlertInfoS = gson.fromJson(jsonstring, DataManager.AlertInfo.class);\n if (DataManager.AlertInfoS.data.size() > 0 && DataManager.AlertInfoS != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(7);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x008://行政处罚\n String jstring8 = (String) response.get();\n DataManager.Root8 jsonRoot8 = gson.fromJson(jstring8, new TypeToken<DataManager.Root8>() {\n }.getType());\n DataManager.punishInfoList = jsonRoot8.data;\n if (DataManager.punishInfoList.size() > 0 && DataManager.punishInfoList != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(8);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x009://经营异常信息\n jsonString = (String) response.get();\n// map = gson.fromJson(jstring9, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.abnormalInfo> list9 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"abNormal\").toString(), new TypeToken<List<DataManager.abnormalInfo>>() {\n// }.getType());\n// map = gson.fromJson(jstring9, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<LinkedTreeMap> list9 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"abNormal\");\n//\n// if (DataManager.abnormalInfoList != null) {\n// DataManager.abnormalInfoList.clear();\n// }\n// if (list9 != null && list9.size() > 0) {\n// for (LinkedTreeMap temp : list9) {\n// DataManager.abnormalInfo cfo = new DataManager.abnormalInfo();\n// cfo.BUSEXCLIST = (String) temp.get(\"BUSEXCLIST\");\n// cfo.SPECAUSE_CN = (String) temp.get(\"SPECAUSE_CN\");\n// cfo.ABNTIME = (String) temp.get(\"ABNTIME\");\n// cfo.DECORG_CN = (String) temp.get(\"DECORG_CN\");\n// cfo.REMEXCPRES_CN = (String) temp.get(\"REMEXCPRES_CN\");\n// cfo.REMDATE = (String) temp.get(\"REMDATE\");\n// cfo.REDECORG_CN = (String) temp.get(\"REDECORG_CN\");\n// DataManager.abnormalInfoList.add(cfo);\n// }\n\n DataManager.abnormalInfoS = gson.fromJson(jsonString, DataManager.abnormalInfo.class);\n CompanyDetailsActivity.handler.sendEmptyMessage(9);\n\n break;\n case 0x010://专利信息\n jsonString = (String) response.get();\n DataManager.PatentInfoS = gson.fromJson(jsonString, DataManager.PatentInfo.class);\n if (DataManager.PatentInfoS.data.patentInfo != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(10);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x01012://专利信息(加载更多)\n jsonString = (String) response.get();\n DataManager.PatentInfoS = gson.fromJson(jsonString, DataManager.PatentInfo.class);\n if (DataManager.PatentInfoS.data.patentInfo != null) {\n PatentActivity.handler.sendEmptyMessage(0);\n }\n\n break;\n case 0x011://商标信息\n jsonString = (String) response.get();\n DataManager.trademarkModelS = gson.fromJson(jsonString, DataManager.trademarkModel.class);\n if (DataManager.trademarkModelS.data.trademark.size() > 0 && DataManager.trademarkModelS.data.trademark != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(11);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x01112://商标信息(加载更多)\n jsonString = (String) response.get();\n DataManager.trademarkModelS = gson.fromJson(jsonString, DataManager.trademarkModel.class);\n if (DataManager.trademarkModelS.data.trademark.size() > 0 && DataManager.trademarkModelS.data.trademark != null) {\n TrademarkActivity.handler.sendEmptyMessage(0);\n }\n break;\n case 0x012://著作信息\n String jstrin12 = (String) response.get();\n map = gson.fromJson(jstrin12, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> list112 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"patentInfo\");\n List<LinkedTreeMap> list112_1 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"patentInfoSoftwore\");\n ;\n\n\n if (DataManager.copyrightInfoeList != null) {\n DataManager.copyrightInfoeList.clear();\n }\n\n if (list112 != null && list112.size() > 0) {\n for (LinkedTreeMap temp : list112) {\n DataManager.copyrightInfo cfo = new DataManager.copyrightInfo();\n cfo.ID = (String) temp.get(\"ID\");\n cfo.REGISTERDATA = (String) temp.get(\"REGISTERDATA\");\n cfo.REGISTERID = (String) temp.get(\"REGISTERID\");\n\n cfo.WORKNAME = (String) temp.get(\"WORKNAME\");\n cfo.WORKCLASS = (String) temp.get(\"WORKCLASS\");\n cfo.FINISHDATE = (String) temp.get(\"FINISHDATE\");\n cfo.FIRSTDATE = (String) temp.get(\"FIRSTDATE\");\n DataManager.copyrightInfoeList.add(cfo);\n }\n }\n if (list112_1 != null && list112_1.size() > 0) {\n for (LinkedTreeMap temp : list112_1) {\n DataManager.copyrightInfo cfo = new DataManager.copyrightInfo();\n cfo.ID = (String) temp.get(\"ID\");\n cfo.REGISTERDATA = (String) temp.get(\"REGISTERDATA\");\n cfo.REGISTERID = (String) temp.get(\"REGISTERID\");\n\n cfo.WORKCLASS = \"软件\";//额外附加值\n\n cfo.SOFTWARENAME = (String) temp.get(\"SOFTWARENAME\");\n cfo.SOFTWARESHORT = (String) temp.get(\"SOFTWARESHORT\");\n cfo.STARTINGDATE = (String) temp.get(\"STARTINGDATE\");\n DataManager.copyrightInfoeList.add(cfo);\n }\n }\n\n if (DataManager.copyrightInfoeList != null && DataManager.copyrightInfoeList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(12);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x013://广告资质\n String jstring13 = (String) response.get();\n// map = gson.fromJson(jstring13, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.advertisementInfo> list13 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"advertising\").toString(), new TypeToken<List<DataManager.advertisementInfo>>() {\n// }.getType());\n// DataManager.advertisementInfoList = list13;\n\n map = gson.fromJson(jstring13, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> list13 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"advertising\");\n\n if (DataManager.advertisementInfoList != null) {\n DataManager.advertisementInfoList.clear();\n }\n if (list13 != null && list13.size() > 0) {\n for (LinkedTreeMap temp : list13) {\n DataManager.advertisementInfo cfo = new DataManager.advertisementInfo();\n cfo.ADVERTID = (String) temp.get(\"ADVERTID\");\n cfo.C_LEVEL = (String) temp.get(\"C_LEVEL\");\n cfo.CATEGORY = (String) temp.get(\"CATEGORY\");\n cfo.IDENTIFYDATE = (String) temp.get(\"IDENTIFYDATE\");\n cfo.VALFORM = (String) temp.get(\"VALFORM\");\n cfo.VALTO = (String) temp.get(\"VALTO\");\n cfo.IDENTIFYORGANS = (String) temp.get(\"IDENTIFYORGANS\");\n DataManager.advertisementInfoList.add(cfo);\n }\n }\n\n if (DataManager.advertisementInfoList != null && DataManager.advertisementInfoList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(13);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x014://守合同重信用信息\n String jstring14 = (String) response.get();\n// map = gson.fromJson(jstring14, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.obeyedInfo> list14 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"contractInfo\").toString(), new TypeToken<List<DataManager.obeyedInfo>>() {\n// }.getType());\n// DataManager.obeyedInfoList = list14;\n map = gson.fromJson(jstring14, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> list14 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"contractInfo\");\n\n if (DataManager.obeyedInfoList != null) {\n DataManager.obeyedInfoList.clear();\n }\n if (list14 != null && list14.size() > 0) {\n for (LinkedTreeMap temp : list14) {\n DataManager.obeyedInfo cfo = new DataManager.obeyedInfo();\n cfo.PRIPID = (String) temp.get(\"PRIPID\");\n cfo.ENTNAME = (String) temp.get(\"ENTNAME\");\n cfo.REGNO = (String) temp.get(\"REGNO\");\n cfo.UNISCID = (String) temp.get(\"UNISCID\");\n cfo.CONTENT = (String) temp.get(\"CONTENT\");\n cfo.IDENTIFYDATE = (String) temp.get(\"IDENTIFYDATE\");\n cfo.IDENTIFYORGANS = (String) temp.get(\"IDENTIFYORGANS\");\n cfo.STATE = (String) temp.get(\"STATE\");\n DataManager.obeyedInfoList.add(cfo);\n }\n }\n if (DataManager.obeyedInfoList != null && DataManager.obeyedInfoList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(14);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x015://自主公示zlh\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n if ((List<LinkedTreeMap>) map.get(\"data\") != null) {\n List<LinkedTreeMap> listtemp = (List<LinkedTreeMap>) map.get(\"data\");\n\n for (int i = 0; i < listtemp.size(); i++) {\n switch (listtemp.get(i).get(\"type\").toString()) {\n case \"企业年报\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.reportList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.report>>() {\n }.getType());*/\n if (DataManager.reportList.size() > 0 || DataManager.reportList != null) {\n DataManager.reportList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.report report = new DataManager.report();\n report.ANCHEDATE = (String) r.get(\"ANCHEDATE\");\n report.ANCHEID = (String) r.get(\"ANCHEID\");\n report.ANCHEYEAR = (String) r.get(\"ANCHEYEAR\");\n DataManager.reportList.add(report);\n }\n\n }\n break;\n case \"股东及出资信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.fundedList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.funded>>() {\n }.getType());*/\n if (DataManager.fundedList.size() > 0 || DataManager.fundedList != null) {\n DataManager.fundedList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.funded funded = new DataManager.funded();\n funded.ACCONAM = (double) r.get(\"ACCONAM\");\n funded.ACCONDATE = (String) r.get(\"ACCONDATE\");\n funded.ACCONFORM = (String) r.get(\"ACCONFORM\");\n funded.ACCONFORM_CN = (String) r.get(\"ACCONFORM_CN\");\n funded.CONDATE = (String) r.get(\"CONDATE\");\n funded.CONFORM = (String) r.get(\"CONFORM\");\n funded.CONFORM_CN = (String) r.get(\"CONFORM_CN\");\n funded.INV = (String) r.get(\"INV\");\n funded.PUBLICDATE = (String) r.get(\"PUBLICDATE\");\n funded.SUBCONAM = (double) r.get(\"SUBCONAM\");\n funded.ACPUBLICDATE = (String) r.get(\"ACPUBLICDATE\");\n DataManager.fundedList.add(funded);\n\n }\n }\n break;\n case \"股权变更信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.stockList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.stock>>() {\n }.getType());*/\n if (DataManager.stockList.size() > 0 || DataManager.stockList != null) {\n DataManager.stockList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.stock stock = new DataManager.stock();\n stock.REGNO = (String) r.get(\"REGNO\");\n stock.ALTAF = (String) r.get(\"ALTAF\");\n stock.ENTNAME = (String) r.get(\"ENTNAME\");\n stock.INVUID = (String) r.get(\"INVUID\");\n stock.UNISCID = (String) r.get(\"UNISCID\");\n stock.PRIPID = (String) r.get(\"PRIPID\");\n stock.ALITEM = (String) r.get(\"ALITEM\");\n stock.ALTDATE = (String) r.get(\"ALTDATE\");\n stock.ALTBE = (String) r.get(\"ALTBE\");\n DataManager.stockList.add(stock);\n }\n }\n break;\n case \"行政许可信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.permitList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.permit>>() {\n }.getType());*/\n if (DataManager.permitList.size() > 0 || DataManager.permitList != null) {\n DataManager.permitList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.permit permit = new DataManager.permit();\n permit.invalidDate = (String) r.get(\"invalidDate\");\n permit.LICANTH = (String) r.get(\"LICANTH\");\n permit.LICITEM = (String) r.get(\"LICITEM\");\n permit.LICNAME_CN = (String) r.get(\"LICNAME_CN\");\n permit.LICNO = (String) r.get(\"LICNO\");\n permit.PUBLICDATE = (String) r.get(\"PUBLICDATE\");\n permit.VALFROM = (String) r.get(\"VALFROM\");\n permit.VALTO = (String) r.get(\"VALTO\");\n DataManager.permitList.add(permit);\n }\n }\n break;\n case \"知识产权登记信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.loreList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.lore>>() {\n }.getType());*/\n if (DataManager.loreList.size() > 0 || DataManager.loreList != null) {\n DataManager.loreList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.lore lore = new DataManager.lore();\n lore.TYPENAME = (String) r.get(\"TYPENAME\");\n lore.TMNAME = (String) r.get(\"TMNAME\");\n lore.INVALIDDATE = (String) r.get(\"INVALIDDATE\");\n lore.PLEREGPERFROM = (String) r.get(\"PLEREGPERFROM\");\n lore.EQUPLECANREA = (String) r.get(\"EQUPLECANREA\");\n lore.CANDATE = (String) r.get(\"CANDATE\");\n lore.UNISCID = (String) r.get(\"UNISCID\");\n lore.KINDS = (String) r.get(\"KINDS\");\n lore.PLEREGPERTO = (String) r.get(\"PLEREGPERTO\");\n lore.REGNO = (String) r.get(\"REGNO\");\n lore.TMREGNO = (String) r.get(\"TMREGNO\");\n lore.PLEDGOR = (String) r.get(\"PLEDGOR\");\n lore.PLEID = (String) r.get(\"PLEID\");\n lore.ENTNAME = (String) r.get(\"ENTNAME\");\n lore.INVALIDREA = (String) r.get(\"INVALIDREA\");\n lore.PRIPID = (String) r.get(\"PRIPID\");\n lore.PUBLICDATE = (String) r.get(\"PUBLICDATE\");\n lore.IMPORG = (String) r.get(\"IMPORG\");\n lore.TYPE = (String) r.get(\"TYPE\");\n DataManager.loreList.add(lore);\n }\n\n }\n break;\n case \"行政处罚信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.punishList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.punish>>() {\n }.getType());*/\n if (DataManager.punishList.size() > 0 || DataManager.punishList != null) {\n DataManager.punishList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.punish punish = new DataManager.punish();\n punish.PENTYPE_CN = (String) r.get(\"PENTYPE_CN\");\n punish.REMARK = (String) r.get(\"REMARK\");\n punish.UNISCID = (String) r.get(\"UNISCID\");\n punish.PENDECISSDATE = (String) r.get(\"PENDECISSDATE\");\n punish.PENAM = (Double) r.get(\"PENAM\");\n punish.CASEID = (String) r.get(\"CASEID\");\n punish.REGNO = (String) r.get(\"REGNO\");\n punish.JUDAUTH = (String) r.get(\"JUDAUTH\");\n punish.ENTNAME = (String) r.get(\"ENTNAME\");\n punish.PENDECNO = (String) r.get(\"PENDECNO\");\n punish.PENTYPE = (String) r.get(\"PENTYPE\");\n punish.FORFAM = (Double) r.get(\"FORFAM\");\n punish.ILLEGACTTYPE = (String) r.get(\"ILLEGACTTYPE\");\n punish.PENCONTENT = (String) r.get(\"PENCONTENT\");\n punish.PRIPID = (String) r.get(\"PRIPID\");\n punish.PUBLICDATE = (String) r.get(\"PUBLICDATE\");\n DataManager.punishList.add(punish);\n }\n }\n break;\n default:\n break;\n }\n\n }\n CompanyDetailsActivity.handler.sendEmptyMessage(15);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x101://关注企业\n jsonString = (String) response.get();\n DataManager.FavotiteS = gson.fromJson(jsonString, DataManager.Favotite.class);\n CompanyDetailsActivity.handler.sendEmptyMessage(22);\n break;\n case 0x102://取消关注企业\n jsonString = (String) response.get();\n DataManager.FavotiteS = gson.fromJson(jsonString, DataManager.Favotite.class);\n CompanyDetailsActivity.handler.sendEmptyMessage(23);\n break;\n case 0x103://我的关注列表\n jsonString = (String) response.get();\n DataManager.FavotiteListS = gson.fromJson(jsonString, DataManager.FavotiteList.class);\n MainActivity.handler.sendEmptyMessage(5);\n break;\n case 0x201://评论\n jsonString = (String) response.get();\n DataManager.MyCommentlistrS = gson.fromJson(jsonString, DataManager.MyCommentlistr.class);\n if (DataManager.MyCommentlistrS.data.userreview != null && DataManager.MyCommentlistrS.data.userreview.size() > 0) {\n CommentListActivity.handler.sendEmptyMessage(0);\n } else {\n CommentListActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x202://点赞\n String jstring202 = (String) response.get();\n DataManager.Root202 jsonRoot202 = gson.fromJson(jstring202, new TypeToken<DataManager.Root202>() {\n }.getType());\n DataManager.Data202 d202 = jsonRoot202.data;\n DataManager.Result = d202.result;\n// if (DataManager.Result.equals(\"1\")) {\n// CommentListDetailsActivity.handler.sendEmptyMessage(2);\n// }\n break;\n case 0x203://差评\n String jstring203 = (String) response.get();\n DataManager.Root202 jsonRoot203 = gson.fromJson(jstring203, new TypeToken<DataManager.Root202>() {\n }.getType());\n DataManager.Data202 d203 = jsonRoot203.data;\n DataManager.Result = d203.result;\n// if (DataManager.Result.equals(\"1\")) {\n// CommentListDetailsActivity.handler.sendEmptyMessage(2);\n// }\n break;\n case 0x204://发表评论\n String jstring204 = (String) response.get();\n DataManager.Root202 jsonRoot204 = gson.fromJson(jstring204, new TypeToken<DataManager.Root202>() {\n }.getType());\n DataManager.Data202 d204 = jsonRoot204.data;\n DataManager.Result = d204.result;\n if (DataManager.Result.equals(\"success\")) {\n ToCommentActivity.handler.sendEmptyMessage(1);\n } else {\n ToCommentActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x205://回复评论\n String jstring205 = (String) response.get();\n DataManager.Root202 jsonRoot205 = gson.fromJson(jstring205, new TypeToken<DataManager.Root202>() {\n }.getType());\n DataManager.Data202 d205 = jsonRoot205.data;\n DataManager.Result = d205.result;\n if (DataManager.Result.equals(\"success\")) {\n CommentListDetailsActivity.handler.sendEmptyMessage(1);\n } else {\n CommentListDetailsActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x206://我的评价\n jsonString = (String) response.get();\n DataManager.MyComms = gson.fromJson(jsonString, DataManager.MyComm.class);\n MainActivity.handler.sendEmptyMessage(1);\n break;\n case 0x301://提交认领s\n jsonString = (String) response.get();\n DataManager.ClaimUtilsModel = gson.fromJson(jsonString, DataManager.ClaimUtils.class);\n if (DataManager.ClaimUtilsModel.data.result.equals(\"success\")) {\n ToClaimActivity.handler.sendEmptyMessage(1);\n } else {\n ToClaimActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x302://提交认领附件\n jsonString = (String) response.get();\n DataManager.ClaimUtilsModel = gson.fromJson(jsonString, DataManager.ClaimUtils.class);\n if (DataManager.ClaimUtilsModel.data.result.equals(\"success\")) {\n ToClaimActivity.handler.sendEmptyMessage(2);\n } else {\n ToClaimActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x303://我的认领列表\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n MainActivity.handler.sendEmptyMessage(6);\n break;\n case 0x3031://我的认领列表{副}\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n MyClaimActivity.handler.sendEmptyMessage(2);\n break;\n case 0x304://我的认领详情\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n// MyClaimActivity.handler.sendEmptyMessage(6);\n break;\n case 0x305://取消认领\n jsonString = (String) response.get();\n DataManager.ClaimUtilsModel = gson.fromJson(jsonString, DataManager.ClaimUtils.class);\n if (DataManager.ClaimUtilsModel.data.result.equals(\"success\") || DataManager.ClaimUtilsModel.data.result.equals(\"fail\")) {\n MyClaimActivity.handler.sendEmptyMessage(1);\n } else {\n MyClaimActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x401://修改个人资料{\"message\":\"Success\",\"status\":\"1\",\"version\":\"v1.0\"}\n jsonString = (String) response.get();\n DataManager.user = gson.fromJson(jsonString, DataManager.User.class);\n if (DataManager.user.message.equals(\"success\")) {\n csp.putUser(DataManager.user);\n UserSetActivity.handler.sendEmptyMessage(1);\n MainActivity.loginImg(csp.getICONSTEAM());\n } else {\n UserSetActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x4011://个人资料字典\n jsonString = (String) response.get();\n DataManager.ZdianS = gson.fromJson(jsonString, DataManager.Zdian.class);\n if (DataManager.ZdianS.data.dictionarie != null && DataManager.ZdianS.data.dictionarie.size() > 0) {\n UserSetActivity.handler.sendEmptyMessage(3);\n }\n break;\n case 0x501://修改密码\n jsonString = (String) response.get();\n DataManager.user = gson.fromJson(jsonString, DataManager.User.class);\n if (DataManager.user.message.equals(\"Success\")) {\n PassWordActivity.handler.sendEmptyMessage(1);\n } else if (DataManager.user.message.equals(\"原始密码错误\")) {\n PassWordActivity.handler.sendEmptyMessage(3);\n } else {\n PassWordActivity.handler.sendEmptyMessage(2);\n }\n\n break;\n case 0x601://二维码名片\n jsonString = (String) response.get();\n DataManager.TwoDimSli = gson.fromJson(jsonString, DataManager.TwoDim.class);\n if (DataManager.TwoDimSli.message.equals(\"success\")) {\n CompanyDetailsActivity.waitDialog.dismiss();\n CompanyDetailsActivity.handler.sendEmptyMessage(25);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x701://信用报告1\n jsonString = (String) response.get();\n if (jsonString.equals(DataManager.BaseinfoList.get(0).ENTNAME + \".pdf\")) {\n DataManager.ReportText = jsonString;\n ReportActivity.handler.sendEmptyMessage(0);\n } else {\n ReportActivity.handler.sendEmptyMessage(1);\n }\n break;\n case 0x702://信用报告2\n jsonString = (String) response.get();\n if (jsonString.equals(\"success\")) {\n ReportActivity.handler.sendEmptyMessage(3);\n } else {\n ReportActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x999://登入\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n\n if (!map.get(\"status\").equals(\"1\")) {//登入失败谁动了我的账号,给我站出来\n Toast.show(map.get(\"message\").toString());\n LoginActivity.wd.dismiss();\n } else {//登入成功\n DataManager.user = gson.fromJson(jsonString, DataManager.User.class);\n csp.putUser(DataManager.user);\n csp.putLoginStatus(true);\n Toast.show(\"登录成功\");\n if (csp.getALIASNAME().equals(\"\")) {\n csp.putALIASNAME(\"用户12138\");\n }\n if (!csp.getALIASNAME().equals(\"\")) {\n MainActivity.UserSz.setText(csp.getALIASNAME());\n } else {\n MainActivity.UserSz.setText(csp.getUSERNAME());\n }\n if (!csp.getICONSTEAM().equals(\"\")) {\n MainActivity.loginImg(csp.getICONSTEAM());\n }\n LoginActivity.handler.sendEmptyMessage(0);\n LoginActivity.wd.dismiss();\n }\n break;\n case 0x998://注册\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (!map.get(\"status\").equals(\"1\")) {//注册失败\n RegisterActivity.pd.dismiss();\n Toast.show(\"注册失败\" + map.get(\"message\").toString());\n } else {//注册成功\n\n RegisterActivity.handler.sendEmptyMessage(0);\n }\n break;\n case 0x997://个人中心获取投诉列表\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n MainActivity.handler.sendEmptyMessage(2);\n\n break;\n case 0x9971://个人中心获取投诉列表\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n MycomplaintsListActivity.handler.sendEmptyMessage(21);\n\n break;\n\n case 0x996://个人中心取消投诉请求\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (!map.get(\"status\").equals(\"1\")) {//取消失败\n MycomplaintsListActivity.pd.dismiss();\n Toast.show(\"取消失败\" + map.get(\"message\").toString());\n } else {//取消成功\n MycomplaintsListActivity.handler.sendEmptyMessage(1);\n }\n break;\n case 0x995://获取投诉详情\n jsonString = (String) response.get();\n DataManager.complaintDetail = gson.fromJson(jsonString, DataManager.ComplaintDetail.class);\n MycomplaintsListActivity.handler.sendEmptyMessage(3);\n break;\n case 0x994://获取企业投诉列表\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n if (CompanyDetailsActivity.waitDialog != null) {\n CompanyDetailsActivity.waitDialog.dismiss();\n }\n CompanyDetailsActivity.handler.sendEmptyMessage(24);\n break;\n case 0x9941://获取企业投诉列表更多\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n if (CompanyDetailsActivity.waitDialog != null) {\n CompanyDetailsActivity.waitDialog.dismiss();\n }\n MycomplaintsListActivity.handler.sendEmptyMessage(6);\n break;\n\n case 0x993://提交企业投诉\n jsonString = (String) response.get();\n DataManager.toComplain = gson.fromJson(jsonString, DataManager.ToComplain.class);\n /*map=gson.fromJson(jsonString,new TypeToken<Map<String, Object>>() {\n }.getType());*/\n if (!DataManager.toComplain.status.equals(\"1\")) {//返回提交投诉失败\n Toast.show(\"提交投诉失败\" + map.get(\"message\"));\n } else {//成功\n ToComplaintActivity.handler.sendEmptyMessage(1);\n\n }\n break;\n case 0x992://提交投诉附件\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (!map.get(\"status\").equals(\"1\")) {//返回提交投诉失败\n Toast.show(\"提交投诉图片失败\" + map.get(\"message\"));\n } else {//成功\n ToComplaintActivity.handler.sendEmptyMessage(0);\n\n }\n break;\n case 0x991://提交投诉后刷新企业投诉\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n MycomplaintsListActivity.handler.sendEmptyMessage(5);\n break;\n case 0x12138://记录24宫格\n jsonString = (String) response.get();\n break;\n case 0x1001://商标查询\n jsonString = (String) response.get();\n DataManager.sb_searchS = gson.fromJson(jsonString, DataManager.sb_search.class);\n if (DataManager.sb_searchS.data.trademark.size() > 0) {\n Main_SearchActivity.handler.sendEmptyMessage(0);\n } else {\n Main_SearchActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x1002://首页专利查询\n jsonString = (String) response.get();\n DataManager.zl_searchS = gson.fromJson(jsonString, DataManager.zl_search.class);\n if (DataManager.zl_searchS.data.patentInfo.size() > 0 && DataManager.zl_searchS.data.patentInfo != null) {\n Main_SearchActivity.handler.sendEmptyMessage(1);\n } else {\n Main_SearchActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x1003://首页商标查询(上下拉事件)\n jsonString = (String) response.get();\n DataManager.sb_searchS = gson.fromJson(jsonString, DataManager.sb_search.class);\n if (DataManager.sb_searchS.data.trademark.size() > 0) {\n Main_Search_ListActivity.handler.sendEmptyMessage(0);\n }\n break;\n case 0x1004://专利查询(上下拉事件)\n jsonString = (String) response.get();\n DataManager.zl_searchS = gson.fromJson(jsonString, DataManager.zl_search.class);\n if (DataManager.zl_searchS.data.patentInfo.size() > 0 && DataManager.zl_searchS.data.patentInfo != null) {\n Main_Search_ListActivity.handler.sendEmptyMessage(1);\n }\n break;\n case 0x1005://失信查询\n jsonString = (String) response.get();\n DataManager.MyDishonestyS = gson.fromJson(jsonString, DataManager.MyDishonesty.class);\n if (DataManager.MyDishonestyS.data.Courtcaseinfo.size() > 0 && DataManager.MyDishonestyS.data.Courtcaseinfo != null) {\n Main_SearchActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x1006://失信查询(上下拉事件)\n jsonString = (String) response.get();\n DataManager.MyDishonestyS = gson.fromJson(jsonString, DataManager.MyDishonesty.class);\n if (DataManager.MyDishonestyS.data.Courtcaseinfo.size() > 0 && DataManager.MyDishonestyS.data.Courtcaseinfo != null) {\n Main_Search_ListActivity.handler.sendEmptyMessage(2);\n }\n break;\n default:\n break;\n }\n } catch (NullPointerException e) {\n showdisplay(what);\n Toast.show(\"后台数据空返回!\");\n } catch (IndexOutOfBoundsException e) {\n showdisplay(what);\n Toast.show(\"后台数据结构变更下标越界!\");\n } catch (ClassCastException e) {\n showdisplay(what);\n Toast.show(\"后台数据变更类型转换出错!\");\n } catch (NumberFormatException e) {\n showdisplay(what);\n Toast.show(\"字符串转换为数字异常!\");\n } catch (JsonSyntaxException e) {\n showdisplay(what);\n Toast.show(\"后台数据变更json解析出错!\");\n }\n }", "GetResponse() {\n\t}", "@Override\n protected String doInBackground(Void... params) {\n if(myApiService == null) {\n MyApi.Builder builder = new MyApi.Builder(AndroidHttp.newCompatibleTransport(), new AndroidJsonFactory(), null)\n // Local testing url (emulator is 10.0.2.2 or use local machine ip)\n // .setRootUrl(\"http://10.0.2.2:8080/_ah/api/\")\n .setRootUrl(\"https://androidjokes-155120.appspot.com/_ah/api/\");\n\n myApiService = builder.build();\n }\n\n // Grab a joke\n try {\n return myApiService.getJoke().execute().getData();\n } catch (IOException e) {\n return e.getMessage();\n }\n }", "@Override\n protected String doInBackground(Request... requests) {\n httpClient = utils.createAuthenticatedClient(\"1011\",\"Test@123\");\n MediaType JSON = MediaType.parse(\"application/json\");\n RequestBody body = RequestBody.create(JSON, pidData_json);\n Request request = new Request.Builder()\n .url(\"https://aepsapi.gramtarang.org:8008/mint/aeps/ipbalanceenquiry\")\n .addHeader(\"AdhaarNumber\", en_aadhaar)\n .addHeader(\"Bankid\", selected_bank_id)\n .addHeader(\"phnumber\", agentphn)\n .addHeader(\"name\", en_name)\n .addHeader(\"imeiNumber\", androidId)\n .addHeader(\"latitude\", latitude)\n .addHeader(\"longitude\", longitude)\n .addHeader(\"outletid\",outletid)\n .addHeader(\"Accept\", \"*/*\")\n /* .addHeader(\"AdhaarNumber\", \"123456781190\")\n .addHeader(\"Bankid\", \"1234\")\n .addHeader(\"phnumber\", \"7896541230\")\n .addHeader(\"name\", \"Testinggg\")\n .addHeader(\"imeiNumber\", \"1234567890\")\n .addHeader(\"latitude\", \"17.7509436\")\n .addHeader(\"longitude\", \"83.2457357\")\n .addHeader(\"outletid\",\"12345\")*/\n\n .post(body)\n .build();\n httpClient.newCall(request).enqueue(new Callback() {\n @Override\n\n //of the api calling got failed then it will go for onFailure,inside this we have added one alertDialog\n public void onFailure(Call call, IOException e) {\n Log.d(\"TAG\",\"IN API CALL FAILURE\"+e);\n //loadingDialog.dismissDialog();\n // Toast.makeText(activity_Aeps_BalanceEnquiry.this, \"Server not Connected.\", Toast.LENGTH_SHORT).show();\n }\n\n //if API call got success then it will go for this onResponse also where we are collection\n //the response as well\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n assert response.body() != null;\n //the response we are getting from api\n response_String = response.body().string();\n\n // Toast.makeText(activity_Aeps_BalanceEnquiry.this, response_String, Toast.LENGTH_SHORT).show();\n\n\n //JSON PARSING\n if (response_String != null) {\n JSONObject jsonResponse = null;\n try {\n jsonResponse = new JSONObject(response_String);\n status = jsonResponse.getString(\"status\");\n status_code = jsonResponse.getString(\"statuscode\");\n bank_RRN = jsonResponse.getString(\"ipay_uuid\");\n data = jsonResponse.getString(\"data\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n try {\n\n JSONObject jsonData = new JSONObject(data);\n transaction_status = jsonData.getString(\"status\");\n balance = jsonData.getString(\"balance\");\n fpTransId = jsonData.getString(\"opr_id\");\n merchant_transid = jsonData.getString(\"ipay_id\");\n timestamp = jsonData.getString(\"timestamp\");\n } catch (JSONException e) {\n\n } catch (NullPointerException e) {\n }\n\n\n //PASSING INTENT DATA\n Intent intent = new Intent(activity_Aeps_BalanceEnquiry.this, activity_Aeps_BalanceEnq_Receipt.class);\n intent.putExtra(\"balance\", balance);\n intent.putExtra(\"merchant_transid\", merchant_transid);\n intent.putExtra(\"timestamp\", timestamp);\n intent.putExtra(\"aadhaar\", en_aadhaar);\n intent.putExtra(\"bank_name\", selected_bank_name);\n intent.putExtra(\"agent_id\", agentId);\n intent.putExtra(\"rrn_no\", bank_RRN);\n intent.putExtra(\"custName\", en_name);\n intent.putExtra(\"message\", message);\n intent.putExtra(\"fpTransId\", fpTransId);\n intent.putExtra(\"message\", message);\n intent.putExtra(\"status\", status);\n intent.putExtra(\"status_code\", status_code);\n intent.putExtra(\"transaction_type\", transaction_type);\n startActivity(intent);\n\n\n\n } else {\n Toast.makeText(activity_Aeps_BalanceEnquiry.this, \"You are not getting any Response From Bank !! \", Toast.LENGTH_SHORT).show();\n }\n\n }\n });\n return null;\n }", "public interface HttpClientInterface {\n\n Retrofit getClient();\n}", "private static String makeHttpRequest(URL url) throws IOException {\n String jsonResponse = \"\";\n\n //Si la URL es null se devuelve inediatamente.\n if (url == null) {\n return jsonResponse;\n }\n HttpURLConnection urlConnection = null;\n InputStream inputStream = null;\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setReadTimeout(100000 /* Milisegundos.*/);\n urlConnection.setConnectTimeout(100000 /* Milisegundos.*/);\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.connect();\n\n // Si la request se realiza correctamente (código de respuesta 200) se lee el input\n // stream y se le hace parse a la respuesta.\n if (urlConnection.getResponseCode() == 200) {\n inputStream = urlConnection.getInputStream();\n jsonResponse = readFromStream(inputStream);\n } else {\n Log.e(LOG_TAG, \"Error de conexión: \" + urlConnection.getResponseCode());\n }\n // Aquí simplemente hacemos catch a la IOException.\n\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Problema obteniendo los datos en JSON del servidor\", e);\n // Independientemente de que se lance una exception o no en el bloque finally se realiza\n // una desconexión (o se \"cierra\" como en el caso del inputStream) para poder reusarlo.\n } finally {\n if (urlConnection != null) {\n urlConnection.disconnect();\n }\n if (inputStream != null) {\n inputStream.close();\n }\n }\n // Se devuelve como resultado el JsonResponse que albergará la String inputStream.\n return jsonResponse;\n }", "public interface BaseModel {\r\n Retrofit retrofit = new Retrofit.Builder()\r\n .baseUrl(\"http://39.107.224.233/firstga/app/\")\r\n .addConverterFactory(GsonConverterFactory.create())\r\n .addCallAdapterFactory(RxJavaCallAdapterFactory.create())\r\n .build();\r\n}", "public interface ApiInterface {\n String HOST = \"http://fanyi.youdao.com/\";\n String IMG_HOST = \"http://www.bing.com/\";\n\n @GET(\"openapi.do\")\n Observable<Translation> getTranslation(@Query(\"keyfrom\") String keyfrom,\n @Query(\"key\") String key,\n @Query(\"type\") String type,\n @Query(\"doctype\") String doctype,\n @Query(\"version\") String version,\n @Query(\"q\") String q);\n\n @GET(\"HPImageArchive.aspx\")\n Observable<BackImg> getBackgroundImg(@Query(\"format\") String format,\n @Query(\"idx\") int idx,\n @Query(\"n\") int n);\n\n\n\n}", "private ApiInfo apiInfo() {\n Contact contact = new Contact(\"Hanchuanjun\", \"\", \"[email protected]\");\n ApiInfo apiInfo = new ApiInfo(\n \"GEHC SmartX SSO-OAuth模块api\",\n \"GEHC SmartX SSO-OAuth模块服务api\",\n \"v0.0.1\",\n \"初始化版本\",\n contact,\n \"\",\n \"\");\n return apiInfo;\n }", "private HttpClient() {\n\t}" ]
[ "0.69246924", "0.6799639", "0.67022085", "0.66763645", "0.66354907", "0.6529461", "0.64835596", "0.6477396", "0.6381048", "0.6272685", "0.6210887", "0.61883676", "0.6163704", "0.61142814", "0.6100359", "0.6094651", "0.6054427", "0.59165025", "0.58922184", "0.5839536", "0.5797732", "0.57805526", "0.5758654", "0.57180274", "0.5703393", "0.57014406", "0.5656599", "0.5617999", "0.56141895", "0.5612504", "0.5602841", "0.5584558", "0.5560767", "0.5556936", "0.5535893", "0.549965", "0.5498057", "0.54977715", "0.548557", "0.5470489", "0.5459944", "0.54594743", "0.54409724", "0.5439121", "0.5417865", "0.54090214", "0.5404737", "0.54029757", "0.53991044", "0.5367024", "0.53647757", "0.53637743", "0.53553593", "0.53450227", "0.5327085", "0.53198504", "0.53192455", "0.53051263", "0.53037286", "0.5302491", "0.5294001", "0.5292878", "0.52901673", "0.5282525", "0.5279087", "0.5277433", "0.5277308", "0.5268539", "0.52590543", "0.5257015", "0.5256666", "0.5255654", "0.5246863", "0.5244753", "0.5236314", "0.52351165", "0.52317125", "0.52177984", "0.52128404", "0.52041507", "0.5198427", "0.5197028", "0.51966006", "0.51918447", "0.51913154", "0.5185638", "0.51776874", "0.5176971", "0.5173478", "0.51683646", "0.51667047", "0.51599056", "0.5155496", "0.5154604", "0.51498073", "0.51425064", "0.51415926", "0.5139993", "0.5139923", "0.51393944" ]
0.5472385
39
TODO code application logic here
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void autoDetails() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n protected void execute() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\t\tpublic void rest() {\n\t\t\t\n\t\t}", "protected void onFirstUse() {}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n protected void execute() {\n \n }", "@Override\n public void feedingHerb() {\n\n }", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void execute() {\n \n \n }", "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n protected void fetchData() {\n\r\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\r\n\t\t\tprotected void saveContext() {\n\t\t\t\t\r\n\t\t\t}", "protected void aktualisieren() {\r\n\r\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\t\t\tpublic void onPreExecute() {\n\t\t\t\t\n\t\t\t}", "@Override\n protected void execute() {\n }", "@Override\n protected void execute() {\n }", "@Override\n protected void execute() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "private static void oneUserExample()\t{\n\t}", "@Override\n public void onCancelled(CancelledException arg0) {\n\n }", "@Override\n protected void execute() {\n\n }", "public void logic(){\r\n\r\n\t}", "public void gored() {\n\t\t\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tprotected void execute() {\r\n\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\t \n\t\t\t super.onPreExecute();\n\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\tprotected void onPreExecute() {\n\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\t\tprotected void onPreExecute() {\n\t\t}", "@Override\n\t\t\tprotected void onPreExecute()\n\t\t\t{\n\n\t\t\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private RESTBackend()\n\t\t{\n\t\t\t\n\t\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public void redibujarAlgoformers() {\n\t\t\n\t}", "@Override\n protected void startUp() {\n }", "protected void mo6255a() {\n }", "protected void viewSetup() {\n\t\t// TODO Auto-generated method stub\n\n\t}", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "@Override\r\n\tpublic void manage() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "public void mo38117a() {\n }", "private void poetries() {\n\n\t}", "@Override\n\tpublic void queryData() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "@Override\n\t\t\t\t\tprotected void onPreExecute() {\n\t\t\t\t\t\tsuper.onPreExecute();\n\t\t\t\t\t}", "@Override\n\tpublic void getStatus() {\n\t\t\n\t}", "@Override\n protected void onPreExecute() {\n \n }", "protected void index()\r\n\t{\n\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "public void mo55254a() {\n }" ]
[ "0.60802186", "0.5912082", "0.58425087", "0.58339286", "0.5810548", "0.57580656", "0.57396024", "0.5721001", "0.5705411", "0.5666017", "0.5657976", "0.5613798", "0.5611188", "0.5611188", "0.55960613", "0.55933475", "0.557677", "0.5572332", "0.5565667", "0.55482084", "0.5536573", "0.5534607", "0.5533934", "0.5468669", "0.5460392", "0.5443554", "0.543027", "0.5422523", "0.5420404", "0.5420404", "0.5414971", "0.53763115", "0.5367869", "0.53636855", "0.53608036", "0.5329318", "0.5327322", "0.5327322", "0.53258926", "0.53220093", "0.53199", "0.5311158", "0.53085816", "0.5307914", "0.52976745", "0.52976745", "0.52976745", "0.5297331", "0.52968514", "0.5293012", "0.5281331", "0.5277546", "0.5277546", "0.52726364", "0.52688015", "0.5267047", "0.5266958", "0.5262331", "0.5261341", "0.52587026", "0.52557015", "0.5255123", "0.524477", "0.52443206", "0.5236655", "0.52359647", "0.52248156", "0.52246475", "0.52233", "0.52207166", "0.52205276", "0.5216701", "0.5206895", "0.52030635", "0.51967937", "0.51948136", "0.51947194", "0.5188396", "0.518064", "0.518064", "0.5177845", "0.5175415", "0.5175415", "0.5175415", "0.5175415", "0.5175415", "0.5175415", "0.5173223", "0.5173223", "0.5170695", "0.5168988", "0.51654655", "0.51593053", "0.5157954", "0.5156624", "0.5153031", "0.5152581", "0.51493365", "0.5148302", "0.51443505", "0.51430386" ]
0.0
-1
initializing scanner and random number generator
public static void main(String[]args)throws IOException{ Scanner scan = new Scanner(System.in); Random generator = new Random(); System.out.println("Welcome to a game of Reversi/Othello.\nChoose option 3 in the main menu if you do not know how to play the game."); System.out.println("Press any key to proceed to menu..."); System.in.read(); System.out.println("\t\t Main Menu"); System.out.println("\t\t *********"); System.out.println("\t\t 1. Play Reversi"); System.out.println("\t\t 2. Options"); System.out.println("\t\t 3. How to play"); System.out.println("\t\t 4. Exit"); int choice=scan.nextInt(); while(choice<1||choice>4){ System.out.println("Invalid option. Try again."); choice=scan.nextInt(); } while(choice==1||choice==2||choice==3){ if(choice==1){ //creating game board for(int x=0;x<boardwidth+2;x++){ for(int i=0;i<boardlength+2;i++){ board[x][i]="-"; dynamicboard[x][i]=0; } } //assigning starting pieces board[boardwidth/2][boardlength/2]="x"; board[boardwidth/2+1][boardlength/2+1]="x"; board[boardwidth/2+1][boardlength/2]="o"; board[boardwidth/2][boardlength/2+1]="o"; playerpoints(board); int movechoice; //this variable will alternate every loop to give turns to both player int playerturn=1; //piecevalue sets the value of a piece depending on the player turn, if player 1, then piecevalue will be x, if player 2, it will be o. Will be used in following loop String piecevalue="x"; //fullboard and playerlost are boolean variables that monitor the state of the board, game will end if the board is full or if a player has lost (has no more pieces left standing on the board) boolean fullboard=false; boolean playerlost=false; //preliminary fullboard check (if the dimensions are set at 2 by 2, game will automatically end at the start of the game since the board is ALREADY full) fullboard=true; for(int x=1;x<=boardwidth;x++){ for(int i=1;i<=boardlength;i++){ if(board[x][i].equals("-")){ fullboard=false; } } } //while loop begins, this loop will end once an end condition has been met //end conditions are explained in the tutorial or user manual but essentially, the game ends when the board is full, a player has no more pieces on the board left or both players cannot make a move. while(fullboard==false&&playerlost==false&&nomovecount!=2){ //boolean is first set to false and a check will be performed to see if the ai has been enabled for this player. boolean ai=false; //checks this for player 1 if(playerturn==1){ if(player1ai==true){ ai=true; } } //checks player 2 if(playerturn==2){ if(player2ai==true){ ai=true; } } //assigning the piece value according to the player's turn. Player 1=x Player 2=o if(playerturn==1){ piecevalue="x"; } else if(playerturn==2){ piecevalue="o"; } //checks board to see if ANY move can be made during this turn, if no move can, this move will be automatically skipped. boardcheck(piecevalue); //in the case that ai is not enabled for this player, the program will let the user enter values (choose their move) if(ai==false){ //display player turn and current score for both players System.out.println("\nPlayer "+playerturn+"'s turn ("+piecevalue+") Score - Player 1: "+player1score+" points (x), Player 2: "+player2score+" points (o)"); //displaying game board so the player can decide on their next move displayboard(board); //the following block of code will be initialized if boardcheck method has determined that a move can be made during this turn. if(boardavailability==true){ //player gets to choose if they want to pass or make a move. Once a player wants to make a move it is too late to pass. //However, this issue is minor since no player would want to pass their move and if they do want to, they should plan ahead and press pass. //Remember, if no moves can be made, this block of code would not even be initialized, the program would auto-skip the player's turn, therefore there will always be a move to make. System.out.println("\n(1)Make a move (2)Pass"); movechoice=scan.nextInt(); while(movechoice!=1&&movechoice!=2){ System.out.println("Invalid option, try again."); movechoice=scan.nextInt(); } //if the player chooses to make a move, this block of code is initialized if(movechoice==1){ //will keep looping and asking user to enter a row and column until valid coordinates are entered while(validation==false){ int row, column; System.out.print("Enter the row:"); row=scan.nextInt(); //a player cannot put a piece thats out of the range of the board, this prevents them from doing so while(row>boardlength||row<1){ System.out.println("Invalid row on the board. Try again."); row=scan.nextInt(); } //a player cannot put a piece thats out of the range of the board, this prevents them from doing so System.out.print("Enter the column:"); column=scan.nextInt(); while(column>boardlength||column<1){ System.out.println("Invalid column on the board. Try again."); column=scan.nextInt(); } //validationcheck method checks to see if the coordinate that the players wants to place a piece on is -, if it is, then validation will become true. //players cannot place a piece on an area of the board that has already been taken validation=validationcheck(row,column,piecevalue); //if the first validation method is true, it will then check to see if placing a piece on these coordinates will perform an action, if not, validation is still false and the loop will continue... if(validation==true){ validationcheck2(row,column,piecevalue); } //in the case that validation is true after both checks, then the program will proceed to place a piece on the specified coordinate and perform the resulting actions (see tutorial or user manual if you do not know how this game works) if(validation==true){ board[row][column]=piecevalue; changepieces(row,column,piecevalue); } //naturally if validation is false, the program will simply display a message telling the user that it is an invalid move. It will then loop again and ask for a row and column again. else if(validation==false){ System.out.println("Invalid move, try again."); } } //necessary or validation will be true on next loop skipping the inside loop. validation=false; } //if player skips, no action is performed as shown in this else if statement else if(movechoice==2){ System.out.println("Player "+playerturn+" has chosen to pass their turn."); } //checks if the board is full, if it is then the game will end. fullboard=true; for(int x=1;x<=boardwidth;x++){ for(int i=1;i<=boardlength;i++){ if(board[x][i].equals("-")){ fullboard=false; } } } //switches playerturn so that the next loop, the other player gets a turn. if(playerturn==1){ playerturn=2; } else{ playerturn=1; } //calculates the amount of points each player has (which will be displayed in the next loop or if the game ends playerpoints(board); if(player1score==0||player2score==0){ playerlost=true; } } //the following block of code will be initialized if the boardcheck method has determined that no moves can be made so it will skip the player's turn. else{ System.out.println("Auto-Pass. This turn has been skipped due to the fact that this player cannot make any moves in this turn."); System.out.println("Press any key to continue to the next turn..."); //instead of skipping too immediately and making the user lose track of what happened, the user gets to see that their move has been skipped. System.in.read(); //notice how the fullboard method check and playerpoints method have not been initialized here. This is because the player's turn has been skipped so the points and the board will not change. if(playerturn==1){ playerturn=2; } else{ playerturn=1; } } } //the following block of code is the similar to the if statement in which there is no ai. //since there is AI, the user will not be asked to enter row/column and the program will randomly generator numbers until a valid move is generated and that will be used as the row and column. else{ System.out.println("\nPlayer "+playerturn+"'s turn ("+piecevalue+") Score - Player 1: "+player1score+" points (x), Player 2: "+player2score+" points (o)"); displayboard(board); System.out.println("\n(AI player turn) Press any NUMBER to continue to the next turn..."); //System.in.read(); does not work properly in this situation (it may be skipped due to some reason) //scan.nextInt(); will always work int read=scan.nextInt(); if(boardavailability==true){ //chosenrow and chosencolumn variables int chosenrow=0,chosencolumn=0; while(validation==false){ int row, column; //generator random row and columns, these can be invalid and if so, the program will just loop this part again until valid numbers are generated. row=generator.nextInt(boardwidth)+1; column=generator.nextInt(boardlength)+1; validation=validationcheck(row,column,piecevalue); if(validation==true){ validationcheck2(row,column,piecevalue); } if(validation==true){ board[row][column]=piecevalue; changepieces(row,column,piecevalue); chosenrow=row; chosencolumn=column; } } //displaying the coordinates that the AI chose. System.out.println("Player "+playerturn+" has placed a piece on coordinates ("+chosenrow+","+chosencolumn+")\n"); validation=false; fullboard=true; for(int x=1;x<=boardwidth;x++){ for(int i=1;i<=boardlength;i++){ if(board[x][i].equals("-")){ fullboard=false; } } } if(playerturn==1){ playerturn=2; } else{ playerturn=1; } playerpoints(board); if(player1score==0||player2score==0){ playerlost=true; } } //the AI's move will also be skipped if no moves can be made on the turn. else{ System.out.println("Auto-Pass. This turn has been skipped due to the fact that this player cannot make any moves in this turn."); System.out.println("Press any key to continue..."); System.in.read(); if(playerturn==1){ playerturn=2; } else{ playerturn=1; } } } //nomovecheck method checks both players to see if they can make a move on the current board, if both of them can't, then the game will end. nomovecheck(); //boardavailability will be reset to false and further changes on this boolean will be set in the next loop //this also ensures that if the game ends and restarts, this value will be false and not cause the game to end immediately. boardavailability=false; } //game ends if the above while loop ends (due to a certain condition broken) displayboard(board); //displays board and score of each player as well as a message of congratulations System.out.println("\nFinal score - Player 1: "+player1score+" points, Player 2: "+player2score+" points"); if(player1score>player2score){ System.out.println("\nCongratulations Player 1. You are the winner! Better luck next time Player 2 :("); } else if(player2score>player1score){ System.out.println("\nCongratulations Player 2. You are the winner! Better luck next time Player 1 :("); } else if(player1score==player2score){ System.out.println("\nIt's a tie! Congratulations to both players!"); } //player scores are reset to 2 (starting game scores), nomovecount is set to 0 in case the user decides to run another game. player1score=2; player2score=2; //if nomovecount is not reset to 0, the next game will end immediately as it starts nomovecount=0; } else if(choice==2){ //Options choice, allows users to modify board dimensions and set AI players. int optionchoice; System.out.println("What would you like to modify? (1)Board Dimensions (2)Set AI players"); optionchoice=scan.nextInt(); while(optionchoice!=1&&optionchoice!=2){ System.out.println("Invalid option, try again."); optionchoice=scan.nextInt(); } //lets user change board size if(optionchoice==1){ System.out.println("Here you'll be able to change the reversi gamem board size to your liking."); System.out.print("Assign the length of the board: "); boardlength=scan.nextInt(); //having boardlength or boardwidth be less than 2, the fundamentals mechanics of Reversi will be broken. //if boardlength is over 9, then the column indicators will be inaccurate (after 9, 10 is double digit and will cause the column indicators to not line up to the game board anymore) while(boardlength<2||boardlength>9){ System.out.println("The game cannot support this board length breaks. Try again."); boardlength=scan.nextInt(); } System.out.print("Assign the width of the board: "); boardwidth=scan.nextInt(); //there is no reason why the width should be less than 9, but keeping it to maximum dimensions of 9 by 9 board is more professional. while(boardwidth<2||boardwidth>9){ System.out.println("The game cannot support this board width breaks. Try again."); boardwidth=scan.nextInt(); } System.out.println("Your board now has dimensions: "+boardlength+" by "+boardwidth); } //Here, the user will be able to set AI players, all 4 possibilities are listed. else if(optionchoice==2){ int aichange; System.out.println("(1)Player vs. Player (2)Player vs. Ai (3)AI vs. AI (4)AI vs. Player"); aichange=scan.nextInt(); while(aichange<1||aichange>4){ System.out.println("Invalid option, try again."); aichange=scan.nextInt(); } if(aichange==1){ player1ai=false; player2ai=false; } else if(aichange==2){ player1ai=false; player2ai=true; } else if(aichange==3){ player1ai=true; player2ai=true; } else if(aichange==4){ player1ai=true; player2ai=false; } } } //Game tutorial, explains the game using the actual game board to effectively teach the user how the game works else if(choice==3){ boardwidth=8; boardlength=8; for(int x=0;x<boardwidth+2;x++){ for(int i=0;i<boardlength+2;i++){ board[x][i]="-"; } } board[boardwidth/2][boardlength/2]="x"; board[boardwidth/2+1][boardlength/2+1]="x"; board[boardwidth/2+1][boardlength/2]="o"; board[boardwidth/2][boardlength/2+1]="o"; System.out.println("Reversi Game Tutorial"); System.out.println("\nPress any key to continue..."); System.in.read(); System.out.println("Reversi is a board game where each player's aim is to have more pieces on the board."); System.out.println("Turns alternate and on each player's turn, the player can make a move by placing their pieces somewhere on the board.\nAlternatively, they can pass(not recommended)"); System.out.println("Please read on to find out more about the pass feature."); System.out.println("\nPress any key to continue..."); //double System.in.read(); are used as one does not perform the action somehow System.in.read(); System.in.read(); displayboard(board); System.out.println("\nThis is the starting board for most games, each player will have 2 pieces diagonal to each other at the center of the board"); System.out.println("[x] are pieces of player 1, [o] are pieces of player 2, [-] represent unused spaces"); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("When a piece is placed, it'll convert [up, down, left, right, all diagonals directions] pieces to its own type if a specific condition is met."); System.out.println("The condition is that there must be a same-type piece in that certain direction.\nSo, if this condition is met, all enemy pieces in between the placed piece and the piece it is making a 'connection' with.\nNOTE:This connection is broken if there is a blank space [-] in between the connection."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("Example: In this situation, Player 1 (x) decides to place their piece on coordinates (5,3)"); displayboard(board); board[5][3]="x"; board[5][4]="x"; System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); displayboard(board); System.out.println("\nHere is the result of this move."); System.out.println("This can happen with all directions simultaneously as long as the above condition is met."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("There a few rules to the placing of these pieces on a player's turn:"); System.out.println("Rule #1: the player piece must be placed on a blank space represented by [-] (cannot replace an already placed piece such as [x] or [o])"); System.out.println("Rule #2: the player's move must perform an action (make a 'connection' with another piece) other than being placed on the board."); System.out.println("NOTE: Rule #2 will take some time to comprehend. Example: a unit cannot be placed in an area where its surrounding units are blank [-],\nremember, a blank space breaks/blocks potential connection."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("ILLEGAL MOVES"); board[7][7]="o"; board[3][3]="x"; displayboard(board); System.out.println("\nCoordinates (7,7) and (3,3) are illegal in this scenario.\n(7,7) cannot make any connections due to being surrounded by blank space, on top of the fact that even if it was not, its (up,down,left,right,diagonals) directions never reach the other two present [o] units.\n(3,3) does reach another x at (down,right) direction, but NO connection is made. A connection must involve opponent pieces in between friendly pieces."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("Do you need to worry about this? No, the program will not let you make any illegal moves breaking the rules.\nYou will need to re-enter your move if this happens."); System.out.println("In addition, if no move can be made during one's turn, the program will automatically skip this turn at your leisure."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("Conditions of winning:\n1.Board is full, player with most points wins\n2.One player has no units/pieces left standing, their opponent wins\n3.No moves can be made by either player, player with most points win"); System.out.println("\nFor more information, see the user manual.\nEnjoy your game!"); System.in.read(); } System.out.println("\nPress any key to return to menu..."); System.in.read(); //For some reasons, System.in.read(); does not work after a game (choice 1) has been played. This if statement ensures that it does. if(choice==1){ System.in.read(); } //re-initializing menu System.out.println("\t\t Main Menu"); System.out.println("\t\t *********"); System.out.println("\t\t 1. Play Reversi"); System.out.println("\t\t 2. Options"); System.out.println("\t\t 3. How to play"); System.out.println("\t\t 4. Exit"); choice=scan.nextInt(); } System.out.println("Thank you for playing Reversi, come play again anytime."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void randomInit(int r) { }", "private PRNG() {\n java.util.Random r = new java.util.Random();\n seed = r.nextInt();\n mersenne = new MersenneTwister(seed);\n }", "public static void init() {\n\t\tscanner = new Scanner(System.in);\n\t\treturn;\n\t}", "public void random_init()\r\n\t{\r\n\t\tRandom random_generator = new Random();\r\n\t\t\r\n\t\tfor(int i=0;i<chromosome_size;i++)\r\n\t\t{\r\n\t\t\tchromosome[i] = random_generator.nextInt(num_colors)+1;\r\n\t\t}\r\n\t}", "public GSRandom() {\r\n\t\t\r\n\t}", "private static void init() {\n\t\tguess = 0;\n\t\ttries = 10;\n\t\tlen = Random.getRand(4, 8);\n\t\tcorrectGuesses = 0;\n\t\twordGen = new RandomWordGenerator(len);\n\t\twordGen.generate();\n\t\tword = wordGen.getWord();\n\t\tguessesResult = new boolean[word.length()];\n\n\t}", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private void initialiseNumbers() {\r\n double choice = Math.random();\r\n sourceNumbers = new int[6];\r\n if(choice<0.8) {\r\n //one big number, 5 small.\r\n sourceNumbers[0] = (Integer) bigPool.remove(0);\r\n for( int i=1; i<6; i++) {\r\n sourceNumbers[i] = (Integer) smallPool.remove(0);\r\n }\r\n } else {\r\n //two big numbers, 5 small\r\n sourceNumbers[0] = (Integer) bigPool.remove(0);\r\n sourceNumbers[1] = (Integer) bigPool.remove(0);\r\n for( int i=2; i<6; i++) {\r\n sourceNumbers[i] = (Integer) smallPool.remove(0);\r\n }\r\n }\r\n\r\n //for target all numbers from 101 to 999 are equally likely\r\n targetNumber = 101 + (int) (899 * Math.random());\r\n }", "public Generator() {\n identificationNumbers = new int[100][31];\n }", "public RNGRandomImpl() {\n\t\tsetRand(new Random());\n\t}", "public Rng() {\n\t\tr = new Random();\n\t}", "private void prepareScanner() {\r\n\t\tbcLocator = new BCLocator();\r\n\t\tbcGenerator = new BCGenerator();\r\n\t}", "public Randomizer()\r\n {\r\n }", "public void init() throws ServletException {\n modTime = System.currentTimeMillis()/1000*1000;\r\n for(int i=0; i<numbers.length; i++) {\r\n numbers[i] = randomNum();\r\n }\r\n }", "private RandomLocationGen() {}", "public RandomIA() {\n\t\trandom = new Random();\n\t}", "private CandidateGenerator() {\n\t}", "public CellularAutomatonRNG()\n {\n this(DefaultSeedGenerator.getInstance().generateSeed(SEED_SIZE_BYTES));\n }", "private void getRandomNumber() {\n\t\tRandom generator = new Random();\n\t\trandomNumber = generator.nextInt(POSSIBLE_CHOICE.length);\n\t}", "public void initialize()\n {\n System.out.println(\"Enter number of bits of the prime numbers: \");\n Scanner scanner = new Scanner(System.in);\n SIZE = scanner.nextInt();\n AKS tb = new AKS();\n\n /* Step 1: Select two large prime numbers. Say p and q. */\n long startTime = System.currentTimeMillis();\n p = genPrime(tb, SIZE);\n q = genPrime(tb, SIZE);\n long stopTime = System.currentTimeMillis();\n long elapsedTime = stopTime - startTime;\n System.out.println(\"Total prime generator time: \" + elapsedTime + \" ms\");\n System.out.println(p);\n System.out.println(q);\n this.genKeyPair(p, q);\n }", "public Random getRandomNumberGenerator() { return randomNumberGenerator; }", "public Game(Scanner scan, Random gen)\n {\n\t_scan = scan;\n\t_gen = gen;\n\n\t_the_board = new Board(scan, gen);\n }", "public Random() {\n real = new UniversalGenerator();\n twister = new MersenneTwister();\n }", "private void random() {\n\n\t}", "Randomizer getRandomizer();", "public NameGenerator() {\n this.rand = new Random();\n }", "public static int randomNext() { return 0; }", "private static void initializeGame()\n {\n minSecret = 1;\n maxSecret = 100;\n secretNumber = newSecretNumber(minSecret,maxSecret);\n guessesLeft = 10;\n guessRange = 10;\n bestGuess = maxSecret + 1;\n extraGuesses = 5;\n isPlaying = true;\n safeLineUsed = false;\n showDebugInfo = false;\n\n }", "private void assuerNN_random() {\n //Check, if the variable is null..\n if (this.random == null) {\n //..and now create it.\n this.random = new Random(10);\n }\n }", "public static void numRand() {\n System.out.println(\"Please enter a random number between 1 and 50? \");\n int randNum = sc.nextInt(); \n }", "public Generator(){}", "public Ch12Ex1to9()\n {\n scan = new Scanner( System.in );\n }", "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "@Override\r\n\tpublic void initialize() {\n\t\tRandom randomGenerator = new Random();\r\n\t\tthis.size = Helper.getRandomInRange(1, 9, randomGenerator);\r\n\t\tif (this.size % 2 == 0)\r\n\t\t\tthis.size--;\r\n\t}", "public static void init()throws IOException{if(fileIO){f=new FastScanner(\"\");}else{f=new FastScanner(System.in);}}", "public GameNode(Random rng) {\n this.number = rng.nextInt(8) + 1;\n this.next = null;\n }", "private void initializeDNA() {\n\t\tint numInputs = population.numInputs;\n\t\tint numOutputs = population.numOutputs;\n\t\tfor (int i = 1; i <= numInputs; i++) {\n\t\t\tsubmitNewNode(new NNode(i, NNode.INPUT));\n\t\t}\n\t\tfor (int j = numInputs + 1; j <= numInputs + numOutputs; j++) {\n\t\t\tsubmitNewNode(new NNode(j, NNode.OUTPUT));\n\t\t}\n\n\t\tfor (int i = 0; i < numInputs; i++) {\n\t\t\tfor (int j = 0; j < numOutputs; j++) {\n\t\t\t\tint start = i + 1;\n\t\t\t\tint end = numInputs + 1 + j;\n\t\t\t\tint innovation = population.getInnovation(start, end);\n\t\t\t\tGene g = new Gene(innovation, start, end, Braincraft\n\t\t\t\t\t\t.randomWeight(), true);\n\t\t\t\tpopulation.registerGene(g);\n\t\t\t\tsubmitNewGene(g);\n\t\t\t}\n\t\t}\n\t}", "public PoissonGenerator() {\n\t}", "public static void initiate() {\n System.out.println(\n \" Welcome to crawler by sergamesnius \\n\" +\n \" 1. Start \\n\" +\n \" 2. Options \\n\" +\n \" 3. Print top pages by total hits \\n\" +\n \" 4. Exit \\n\" +\n \"------======------\"\n\n\n );\n try {\n int input = defaultScanner.nextInt();\n switch (input) {\n case 1:\n System.out.println(\"Input URL link\");\n Console.start(defaultScanner.next());\n break;\n case 2:\n Console.options();\n break;\n case 3:\n Console.printResultsFromCSV();\n break;\n case 4:\n return;\n }\n } catch (NoSuchElementException e) {\n System.err.println(\"Incorrect input\");\n defaultScanner.next();\n }\n Console.initiate();\n }", "private void scanTicket(){\r\n\t\ttext = numberField.getText();\r\n\t\t//Number field text is converted into char \r\n\t\tstringToChar(text);\r\n\t\tif(executed == false){\r\n\t\t\trandom();\r\n\t\t}\r\n\t}", "public void generateNumbers() {\n number1 = (int) (Math.random() * 10) + 1;\n number2 = (int) (Math.random() * 10) + 1;\n operator = (int) (Math.random() * 4) + 1;\n //50% chance whether the displayed answer will be right or wrong\n rightOrWrong = (int) (Math.random() * 2) + 1;\n //calculate the offset of displayed answer for a wrong equation (Error)\n error = (int) (Math.random() * 4) + 1;\n generateEquation();\n }", "public void set_random_choice()\r\n\t{\r\n\t\tfor (int i=0 ; i<size ; i++)\r\n\t\t{\r\n\t\t\tnumbers.add(get_not_selected_random_digit());\r\n\t\t}\r\n\t}", "private RandomImageFinder() {\n }", "public SecretPoemGenerator(){\n scanner = new Scanner(System.in);\n poetsAndThemesList = new ArrayList<>();\n }", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "public void placeRandomNumbers() {\n\t\t\n\t\tArrayList<HexLocation> locations = getShuffledLocations();\n\t\tint[] possibleNumbers = new int[] {2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10, 11, 11, 12};\n\t\t\n\t\tfor (int i = 0; i < possibleNumbers.length; i++)\n\t\t\tnumbers.get(possibleNumbers[i]).add(locations.get(i));\n\t}", "public InputReader() {\n reader = new Scanner(System.in);\n }", "public void setRNG(long seed);", "private void getRandomNumber() {\n\t\tRandom random = new Random();\n\t\tint randomCount = 255;\n\t\tint randNum = 0; \n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\trandNum = random.nextInt(randomCount);\n\t\t\tswitch (numberType) {\n\t\t\tcase 1:\n\t\t\t\trandomNumbers.add(Integer.toString(randNum));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif(randNum > 15)\n\t\t\t\t\trandomNumbers.add(String.format(\"%8s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\telse\n\t\t\t\t\trandomNumbers.add(String.format(\"%4s\", Integer.toBinaryString(randNum)).replace(\" \", \"0\"));\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trandomNumbers.add(Integer.toHexString(randNum));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void initialize() {\n\t\tinitialize(seedValue0, seedValue1);\n\t}", "private ConsoleScanner() {}", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "protected Agent(){\n\t\trand = SeededRandom.getGenerator();\n\t}", "public ICMGenerator() {\n super(Registry.ICM_PRNG);\n }", "public MyInput() {\r\n\t\tthis.scanner = new Scanner(System.in);\r\n\t}", "public GridSimRandom() {\n // empty\n }", "@Setup\n public void setup() {\n randomInput = new RandomComplexGenerator(inputLength).randomInputs();\n }", "private void initRandomNumber() {\n\t\tbtnAngka.setOnClickListener(new View.OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tif (!etAngka.equals(\"\")) {\n\t\t\t\t\thandleGuess(view);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void init() {\n\t\tinit(\"1,0 3,0 5,0 7,0 9,0 0,1 2,1 4,1 6,1 8,1 1,2 3,2 5,2 7,2 9,2 0,3 2,3 4,3 6,3 8,3\", \n\t\t\t \"1,6 3,6 5,6 7,6 9,6 0,7 2,7 4,7 6,7 8,7 1,8 3,8 5,8 7,8 9,8 0,9 2,9 4,9 6,9 8,9\"); \n }", "private ClientGenerator(){\n scanner = new BufferedReader(new InputStreamReader(System.in));\n Nnow = initSetN();\n Ntotal = Nnow;\n threads = new TreeMap<>();\n clients = new TreeMap<>();\n try {\n userReader = new CSVReader(new FileReader(\"randomUsers.csv\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n runClients(loadPlayersInfo());\n }", "PermutationGenerator(Random random) {\n\t\tm_random = random;\n\t}", "SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }", "public static int getRandom() \n\t{\n\t\treturn rGenerator.nextInt();\n\t}", "public void run(){\n\t\ttry {\n\t\t\tint i = 0;\n\t\t\twhile (rn_array[i] != 0) i++;\n\t\t\trn_array[i] = r.nextInt(100)+1;\n\t\t\t\n\t\t\t/*switch (index){\n\t\t\tcase 0:\n\t\t\t\trn1 = r.nextInt(100)+1;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\trn2 = r.nextInt(100)+1;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\trn3 = r.nextInt(100)+1;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\trn4 = r.nextInt(100)+1;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\trn5 = r.nextInt(100)+1;\n\t\t\t\tbreak;\n\t\t\t}*/\n\t\t\tThread.sleep(100);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "RandomArrayGenerator() {\n this.defaultLaenge = 16;\n }", "private void randomizeNum() {\n randomNums.clear();\n for (int i = 0; i < 4; i++) {\n Integer rndNum = rnd.nextInt(10);\n randomNums.add(rndNum);\n }\n }", "private void initSimulation()\r\n {\r\n int mark = rn.nextInt(2);\r\n if(mark == 0)\r\n {\r\n computer.setMarker(Marker.cross);\r\n marker = computer.getMarker();\r\n computer2.setMarker(Marker.circle);\r\n computer.makeMove(this);\r\n turn = 2;\r\n }\r\n else\r\n {\r\n computer.setMarker(Marker.circle);\r\n computer2.setMarker(Marker.cross);\r\n marker = computer2.getMarker();\r\n computer2.makeMove(this);\r\n turn = 1;\r\n }\r\n bh.setBoard(this);\r\n simtime.start();\r\n }", "public TextUI() {\n rand = new Random(System.nanoTime());\n scan = new Scanner(System.in);\n }", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\r\n System.out.print(\"Enter the number of numbers to be generated: \");\r\n int n = 0;\r\n try{\r\n n = sc.nextInt();\r\n } catch(Exception e){\r\n Ending.ender(-1);\r\n }\r\n sc.close();\r\n int[] str = generate(n); //str --> stream\r\n for(int i = 0; i < str.length; i++){\r\n System.out.println(str[i]);\r\n }\r\n }", "public void randomNumberTest() {\n //Generating streams of random numbers\n Random random = new Random();\n random.ints(5)//(long streamSize, double randomNumberOrigin, double randomNumberBound)\n .sorted()\n .forEach(System.out::println);\n /*\n -1622707470\n -452508309\n 1346762415\n 1456878623\n 1783692417\n */\n }", "protected void initializeExecutionRandomness() {\r\n\r\n\t}", "public Game() {\n\t\tRandom rand = new Random();\n\t\tfor (int i=0; i<6; i++) {\n\t\t\trandNum[i] = rand.nextInt(40) + 1;\n\t\t\t\n\t\t\t// check if randNum already exists in the array starting from 2nd input\n\t\t\tif(i > 0) { \n\t\t\t\tfor(int c=i-1; c>=0; c--) { //iterate comparison to all previous inputs\n\t\t\t\t\tif(randNum[i]==randNum[c]) { //compare existing input with previous input\n\t\t\t\t\t\ti--; // subtract one(1) from the input counter\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t}\n\t}", "public static void populate() {\n for (int i = 1; i <= 15; i++) {\n B.add(i);\n Collections.shuffle(B);\n\n }\n for (int i = 16; i <= 30; i++) {\n I.add(i);\n Collections.shuffle(I);\n }\n for (int n = 31; n <= 45; n++) {\n N.add(n);\n Collections.shuffle(N);\n }\n for (int g = 46; g <= 60; g++) {\n G.add(g);\n Collections.shuffle(G);\n }\n for (int o = 61; o <= 75; o++) {\n O.add(o);\n Collections.shuffle(O);\n }\n\n for (int i = 1; i <= 75; i++) {\n roll.add(i); // adds the numbers in the check list\n }\n }", "public Ui() {\n this.scanner = new Scanner(System.in);\n }", "public Ui() {\n this.scanner = new Scanner(System.in);\n }", "public static void generator(String nro){\n Integer.parseInt(nro);\r\n }", "public Mazealgo() {\n Random number = new Random();\n long i = number.nextLong();\n this.random = new Random(i);\n this.seed = i;\n }", "public interface IRandomAdapter {\n int nextInt(int max);\n}", "public Game() {\n\t\tsc = new Scanner(System.in);\n\t}", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "public static void main(String args[]) {\n//\t (new PleaseInput()).start();\n\t (new randomNum()).start();\n\t }", "private void loadRandomState() {\n patternName = \"Random\";\n\n for (int i = 0; i < NUMCELLS; i++)\n currentState[i] = (rand.nextInt() > 0x40000000) ? (byte)1 : (byte)0;\n\n generations = 0;\n }", "@Before\n public void setUp() {\n randSeeder = new Random(42);\n\n //Show we haven't seeded the test's random number generator\n randSeed = RAND_UNSEEDED;\n comp = IntPlus.getIntComparator();\n }", "public DuelistRNG() {\n this((long) ((Math.random() - 0.5) * 0x10000000000000L)\n ^ (long) (((Math.random() - 0.5) * 2.0) * 0x8000000000000000L),\n (long) ((Math.random() - 0.5) * 0x10000000000000L)\n ^ (long) (((Math.random() - 0.5) * 2.0) * 0x8000000000000000L));\n }", "public void startExecuting()\n {\n field_46102_e = 40 + field_46105_a.getRNG().nextInt(40);\n }", "private RandomData() {\n initFields();\n }", "private void initialize() {\n toDoList = new ToDoList(\"To-Do List\");\n scanner = new Scanner(System.in);\n }", "public Menu() {\n scanner = new Scanner(System.in);\n }", "public void random_initialize_ss()\r\n\t{\r\n//\t\tMersenneTwister mt = new MersenneTwister(10); //set seed\r\n\t\tRandom rand = new Random(); \r\n\t\tint k, n;\r\n\t\tfor (k = 0; k < num_topics; k++)\r\n\t {\r\n\t for (n = 0; n < num_terms; n++)\r\n\t {\r\n\t class_word[k][n] += 1.0/num_terms + rand.nextDouble();\r\n\t class_total[k] += class_word[k][n];\r\n\t }\r\n\t }\r\n\t}", "public Enigma(){ \r\n randNumber = new Random(); \r\n }", "public Rng(long seed) {\n\t\tr = new Random(seed);\n\t}", "public XorShiftRandom() {\n\t\tthis(System.nanoTime());\n\t}", "private void initScanner() {\n /*\n * since barcodeReaderFragment is the child fragment in the ScannerFragment therefore\n * it is get using getChildFragmentManager\n * setting up the custom bar code listener\n */\n\n }", "@Override\n\n //-----------------\n\n public void init() {\n //test(); // <---------------- Uncomment to TEST!\n\n // %-distribution of RED, BLUE and NONE\n double[] dist = {0.49, 0.49, 0.02};\n\n // Number of locations (places) in world (square)\n int nLocations = 950;\n\n Actor[] distArray = distribution(nLocations, dist); //Generates array with correct distribution.\n distArray = shuffle(distArray); //Shuffles array\n world = toMatrix(distArray, nLocations, world); //Generates the start world.\n // Should be last\n fixScreenSize(nLocations);\n }", "public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }", "@Test\n public void genRandom() {\n runAndWait(() -> genRandom(10_000, 500, 1), 32, 2000);\n runAndWait(() -> genRandom(10_000, 500, 100), 32, 2000);\n runAndWait(() -> genRandom(250_000, 4000, 50), 4, 5_000);\n }", "public static void startGame(Scanner console){\r\n // 1. generate new game ans the random number\r\n GuessFourDigits guess = new GuessFourDigits(4);\r\n \r\n System.out.println(\"Welcome to GuessDigits\"); \r\n System.out.println(\"-----------------------------------------\");\r\n System.out.println(\"guess the right sequence of digits in \"+guess.NUMBER_LENGTH+ \"digits number.\");\r\n System.out.println(\"with each try there will be tipp about result\");\r\n System.out.println(\"-----------------------------------------\");\r\n \r\n // declaring and initialization of loop flag\r\n boolean tipp = false;\r\n \r\n //counter of tries\r\n int counterTry = 0;\r\n \r\n do{\r\n // 2. asking User to guess\r\n System.out.println(\"Your guess: \");\r\n String usersNumber = UserInput.askUserToInsert(console);\r\n \r\n // 2a. check validity of inserted number\r\n if(!guess.validityCheckOfNumber(usersNumber)){\r\n System.out.println(\" inserted number is not valid+\\n\"\r\n + \" a 4 digit positive number, no digit repeated.\");\r\n continue;\r\n }\r\n \r\n // if inserted nummer valid, tipp counter goes up\r\n counterTry++;\r\n \r\n // 3. comparing numbers\r\n int[] comparingNum = guess.compareTheNumbers(usersNumber);\r\n \r\n // 4. giving tipps and congratulating user\r\n if(comparingNum[0] == guess.NUMBER_LENGTH){\r\n //user wins\r\n System.out.println(\"Congrats, you reach \"+usersNumber+\" in \"\r\n + counterTry+ \" tries.\\n\");\r\n tipp = true;\r\n }else{\r\n // tipp to user\r\n System.out.println(\"right number at right position: \"\r\n +comparingNum[0]+ \" right number at wrong position: \"\r\n + comparingNum[1]+ \"\\n\");\r\n }\r\n \r\n \r\n \r\n }while(!tipp);\r\n \r\n }", "public RandomizedCollection() {\n nums = new ArrayList<>();\n num2Index = new HashMap<>();\n rand = new Random();\n }", "private Numbers() {\n\t}", "void makeDeck(Scanner scanner) \n\t\t\tthrows IOException {\n\t\tCardNode cn = null;\n\t\tif (scanner.hasNextInt()) {\n\t\t\tcn = new CardNode();\n\t\t\tcn.cardValue = scanner.nextInt();\n\t\t\tcn.next = cn;\n\t\t\tdeckRear = cn;\n\t\t}\n\t\twhile (scanner.hasNextInt()) {\n\t\t\tcn = new CardNode();\n\t\t\tcn.cardValue = scanner.nextInt();\n\t\t\tcn.next = deckRear.next;\n\t\t\tdeckRear.next = cn;\n\t\t\tdeckRear = cn;\n\t\t}\n\t}", "private static int get() { \r\n Random r = new Random();\r\n return (r.nextInt(9));\r\n }" ]
[ "0.6724402", "0.66659266", "0.666274", "0.64989614", "0.64914125", "0.6407054", "0.63780195", "0.6227535", "0.6202566", "0.6133434", "0.611734", "0.60835254", "0.6047053", "0.6012686", "0.5969043", "0.59478575", "0.5939906", "0.59352314", "0.5921882", "0.59186804", "0.59169835", "0.59139884", "0.5904382", "0.5890933", "0.58641446", "0.58418953", "0.58096063", "0.579179", "0.57801944", "0.57476854", "0.5743838", "0.5729788", "0.5720581", "0.5690474", "0.5677163", "0.5671399", "0.5664964", "0.5646939", "0.5641902", "0.5629424", "0.56212467", "0.5616004", "0.5614354", "0.5606242", "0.5586461", "0.5582572", "0.558084", "0.55775535", "0.5572209", "0.5548859", "0.5541626", "0.5541185", "0.55339015", "0.55323654", "0.55298775", "0.5525603", "0.5525258", "0.5509167", "0.5508092", "0.5502964", "0.55022824", "0.54811", "0.5480645", "0.5473651", "0.54732573", "0.5465623", "0.54646385", "0.54607373", "0.54588336", "0.5457", "0.5445897", "0.54435956", "0.54405904", "0.5432698", "0.5432698", "0.54301596", "0.54296315", "0.542874", "0.5427762", "0.5422392", "0.5411994", "0.5409718", "0.5395932", "0.53958017", "0.5393697", "0.5385951", "0.5376045", "0.5370759", "0.5354315", "0.5353102", "0.5346854", "0.5338003", "0.53363913", "0.533469", "0.5331964", "0.5327993", "0.53193635", "0.53191537", "0.53179824", "0.5308451", "0.53028715" ]
0.0
-1
this method displays the board with column and row indicators (that line up with the rows and columns to help the user indicate what the coordinates are. displays board in accordance to the assigned width and length of the board
public static void displayboard(String board[][]){ int rowindicator[]=new int[boardwidth+1]; int rowcount=1; for(int i=1;i<=boardwidth;i++){ rowindicator[i]=rowcount; rowcount++; } int columnindicator[]=new int[boardlength+1]; int columncount=1; for(int i=1;i<=boardlength;i++){ columnindicator[i]=columncount; columncount++; } System.out.print("\n "); for(int i=1;i<=boardlength;i++){ //displays column indicator System.out.print(" "+columnindicator[i]); } //displays board System.out.println(""); for(int x=1;x<=boardwidth;x++){ //displays row indicator System.out.print(" "+rowindicator[x]); for(int i=1;i<=boardlength;i++){ System.out.print(" "+board[x][i]); } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void displayBoard() {\n System.out.printf(\"%20s\",\"\"); // to add spacing\n for(int i = 0; i < space[0].length; i++) //Put labels for number axis\n {\n System.out.printf(\"%4d\",i+1);\n }\n System.out.println();\n for(int row = 0; row < this.space.length; row++) { //Put letter labels and appropriate coordinate values\n System.out.print(\" \"+ (char)(row+'A') + \"|\");\n for (String emblem: this.space[row]) //coordinate values\n System.out.print(emblem + \" \");\n System.out.println();\n }\n }", "public void Display_Boards(){\r\n\t\tfor(int i=0; i<13; i++){\r\n\t\t\tdisplay.putStaticLine(myBoard.Display(i)+\" \"+hisBoard.Display(i));\r\n\t\t}\r\n\t}", "public Display() {\r\n\t\t//Fills the board with invalid positions\r\n\t\tboard = new int[17][17];\r\n\t\tfor (int i = 0; i < 17; i++)\r\n\t\t\tfor (int j = 0; j < 17; j++)\r\n\t\t\t\tboard[i][j] = -1;\r\n\r\n\t\t//Fills the center of the board with valid positions\r\n\t\tfor (int i = 4; i <= 12; i++)\r\n\t\t\tfor (int j = 4; j <= 12; j++)\r\n\t\t\t\tboard[i][j] = 0;\r\n\t\t\r\n\t\t//Fills the rest of the board with valid positions\r\n\t\tfillTriangle(-1, board, 0, 16, 12);\r\n\t\tfillTriangle(1, board, 0, 9, 13);\r\n\t\tfillTriangle(-1, board, 0, 7, 12);\r\n\t\tfillTriangle(1, board, 0, 0, 4);\r\n\t\tfillTriangle(-1, board, 0, 7, 3);\r\n\t\tfillTriangle(1, board, 0, 9, 4);\r\n\t\t\r\n\t\tthis.setPreferredSize(SIZE);\r\n\t}", "public StringBuffer2D printBoard(){\n StringBuffer2D sb = new StringBuffer2D();\n StringBuffer2D lettersHeader = makeLettersHeader();\n //hardcoded numberLegend width\n sb.insert(lettersHeader,2,0);\n //top row\n int actualWidth = getActualWidth(true)+1;\n //System.out.println(\" \");\n //top border\n try{\n for(int y=0;y<board.getHeight();++y){\n int startY = lettersHeader.getHeight() + y*getActualHeight();\n //LEFT number headers\n StringBuffer2D numberLegend = makeNumberLegend(y+1);\n sb.insert(numberLegend, 0, startY);\n for(int x=0;x<board.getWidth();++x){\n Position position = new Position(x,y);\n StringBuffer2D dispCell = displayCell(position);\n int startX = numberLegend.getWidth() + x*actualWidth;\n sb.replace(dispCell, startX, startY, maxWidth, startY+getActualHeight());\n }\n }\n }catch(PositionOutOfBoundsException e){\n e.printStackTrace();\n }\n return sb;\n }", "void draw_board(int x, int y, char[][] _display, char[][] _board) {\n for (int i = 0; i < 65; i++) {\n for (int j = 0; j < 33; j++) {\n if (i%8 == 0 && j%4 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '+');\n } else if (j%4 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '-');\n } else if (i%8 == 0) {\n draw_char(x + i + 1, y + j + 1, _display, '|');\n } else {\n draw_char(x + i + 1, y + j + 1, _display, ' ');\n }\n }\n }\n char label_row = '1';\n char label_column = 'A';\n for (int i = 0; i < 8; i++) {\n draw_char(x, \t\t\t\t\t\t\t4 * i + 3 + y, _display, label_row);\n draw_char(x + 66, \t\t\t\t4 * i + 3 + y, _display, label_row);\n draw_char(8 * i + 5 + x, \ty,\t\t\t\t\t\t _display, label_column);\n draw_char(8 * i + 5 + x, \ty + 34,\t\t\t\t _display, label_column);\n label_row ++;\n label_column ++;\n }\n draw_pieces(x, y, _display, _board);\n }", "public void showBoardState() {\n System.out.print(\" \");\n //top row X axis\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + i + \" \");\n }\n System.out.println();\n for (int i = 0; i < boardSize; i++) {\n //conversion 0-9 to char for display as Y axis\n System.out.print(\" \" + (char)(i + 'A') + \" \");\n for (int j = 0; j < boardSize; j++) {\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n\n }\n System.out.println();\n }", "public void displayBoard() {\n newLine();\n for (int row = _board[0].length - 1; row >= 0; row -= 1) {\n String pair = new String();\n for (int col = 0; col < _board.length; col += 1) {\n pair += \"|\";\n pair += _board[col][row].abbrev();\n }\n System.out.println(pair + \"|\");\n newLine();\n }\n }", "public void showBoard() {\n System.out.println(\"The board is\");\n System.out.println(\"| 1 | 2 | 3 |\\n| 4 | 5 | 6 | \\n| 7 | 8 | 9 |\");\n }", "public void printBoard() {\n System.out.println(\"---+---+---\");\n for (int x = 0; x < boardLength; x++) {\n for (int y = 0; y < boardWidth; y++) {\n char currentPlace = getFromCoordinates(x, y);\n System.out.print(String.format(\" %s \", currentPlace));\n\n if (y != 2) {\n System.out.print(\"|\");\n }\n }\n System.out.println();\n System.out.println(\"---+---+---\");\n }\n }", "private void displayBoard(Board board)\n {\n for (int i = 0; i < size; i++)\n {\n System.out.print(\"|\");\n for (int j = 0; j < size; j++)\n \n System.out.print(board.array[i][j] + \"|\");\n System.out.println();\n }\n }", "public void PrintBoard() {\n\tSystem.out.println(\"printing from class\");\n\t\tString[][] a = this.piece;\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 <- X axis\");\n\t\tSystem.out.println(\" +----------------+ \");\n\t\t\n\t\tfor (int i=0; i<8 ;i++) {\n\t\t\tSystem.out.print(i + \" |\");\n\t\t\tfor (int j=0; j<8;j++) {\n\t\t\t\t\n\t\tSystem.out.print(\"\" + a[i] [j] + \" \");\n\t\t\t\t\t} \n\t\t\tSystem.out.println(\"|\");\n\t\t}\n\t\tSystem.out.println(\" +----------------+ \");\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 \");\n\t\n\t}", "public void printBoard() {\n printStream.println(\n \" \" + positions.get(0) + \"| \" + positions.get(1) + \" |\" + positions.get(2) + \"\\n\" +\n \"---------\\n\" +\n \" \" + positions.get(3) + \"| \" + positions.get(4) + \" |\" + positions.get(5) + \"\\n\" +\n \"---------\\n\" +\n \" \" + positions.get(6) + \"| \" + positions.get(7) + \" |\" + positions.get(8) + \"\\n\");\n }", "public void display() {\n drawLine();\n for(int i=0; i < nRows; i++) {\n System.out.print(\"|\");\n for(int j=0; j < nCols; j++) {\n if(used[i][j] && board[i][j].equals(\" \")) {\n System.out.print(\" x |\");\n }\n else {\n System.out.print(\" \" + board[i][j] + \" |\");\n }\n }\n System.out.println(\"\");\n drawLine();\n }\n }", "public void displayBoard()\n {\n System.out.println(\"\");\n System.out.println(\" Game Board \");\n System.out.println(\" ---------------------------------\");\n for (int i = 0; i < ROW; i++)\n {\n System.out.print(i+1 + \" | \");\n for (int j = 0; j < COL; j++)\n {\n //board[i][j] = \"A\";\n System.out.print(board[i][j].getPieceName() + \" | \");\n }\n System.out.println();\n }\n System.out.println(\" ---------------------------------\");\n\n System.out.println(\" a b c d e f g h \");\n }", "public void displayBoard(Board board) { //Print the whole current board\n System.out.print(\"\\n \");\n System.out.print(\"A B C D E F G H\");\n System.out.println();\n for (int row = 0; row < BOARD_SIZE; row++) {\n System.out.print((row + 1) + \" \");\n for (int column = 0; column < BOARD_SIZE; column++) {\n System.out.print(board.board[row][column] + \" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "public void ShowBoard(){\n System.out.println(\" ___________{5}_____{4}_____{3}_____{2}_____{1}_____{0}____________\");\n System.out.println(\"| ____ ____ ____ ____ ____ ____ ____ ____ |\");\n System.out.printf(\"| | | [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] | | |\\n\",\n this.gameBoard[5], this.gameBoard[4], this.gameBoard[3],\n this.gameBoard[2], this.gameBoard[1], this.gameBoard[0]);\n System.out.println(\"| | | | | |\");\n System.out.printf(\"| | %2d | ____ ____ ____ ____ ____ ____ | %2d | |\\n\",\n this.gameBoard[6], this.gameBoard[13]);\n System.out.printf(\"| |____| [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] |____| |\\n\",\n this.gameBoard[7], this.gameBoard[8], this.gameBoard[9],\n this.gameBoard[10], this.gameBoard[11], this.gameBoard[12]);\n System.out.println(\"|_________________________________________________________________|\");\n }", "public static void drawFullBoard()\n {\n char rowLetter=' '; //Letra de las filas.\n \n System.out.println(\" 1 2 3 4 \" ); //Imprime la parte superior del tablero.\n System.out.println(\" +-------+-------+\");\n \n \n for (int i = 0; i< BOARD_HEIGHT; i++) //Controla los saltos de fila.\n {\n switch(i)\n {\n case 0: rowLetter='A';\n break;\n case 1: rowLetter='B';\n break;\n case 2: rowLetter='C';\n break;\n case 3: rowLetter='D';\n break;\n }\n \n System.out.print(rowLetter);\n \n for (int j = 0; j < BOARD_WIDTH; j++ ) //Dibuja las filas.\n {\n if (boardPos[i][j]==0)\n {\n System.out.print(\"| · \");\n }\n else\n {\n System.out.print(\"| \" + boardPos[i][j] + \" \");\n }\n }\n System.out.println(\"|\");\n \n if (i==((BOARD_HEIGHT/2)-1)) //Si se ha dibujado la mitad del tablero.\n {\n System.out.println(\" +-------+-------+\"); //Dibuja una separación en medio del tablero.\n }\n }\n \n System.out.println(\" +-------+-------+\"); //Dibuja linea de fin del tablero.\n }", "public void printBoard() {\n\t\tSystem.out.print(\"\\r\\n\");\n\t\tSystem.out.println(\" A | B | C | D | E | F | G | H\");\n\t\tfor(int i = BOARD_SIZE ; i > 0 ; i--) {\n\t\t\tSystem.out.println(\" ___ ___ ___ ___ ___ ___ ___ ___\");\n\t\t\tfor(int j = 0; j < BOARD_SIZE ; j++) {\n\t\t\t\tif(j == 0) {\n\t\t\t\t\tSystem.out.print(i + \" |\");\n\t\t\t\t} \n\t\t\t\tif(this.tiles.get(i).get(j).getPiece() != null) {\n\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece().getColor() == PrimaryColor.BLACK) {\n\t\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece() instanceof Soldier)\n\t\t\t\t\t\t\tSystem.out.print(\" B |\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tSystem.out.print(\"B Q|\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece() instanceof Soldier)\n\t\t\t\t\t\t\tSystem.out.print(\" W |\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tSystem.out.print(\"W Q|\");\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" |\");\n\t\t\t\t}\n\n\t\t\t\tif(j==BOARD_SIZE-1) {\n\t\t\t\t\tSystem.out.print(\" \" + i); \n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tSystem.out.println(\" ___ ___ ___ ___ ___ ___ ___ ___\");\n\t\tSystem.out.println(\" A | B | C | D | E | F | G | H\\r\\n\");\n\n\t}", "public static void drawBoard(){\n\t\tSystem.out.println(\"\\n\\t A B C\");\r\n\t\tSystem.out.println(\"\\t .-----------.\");\r\n\t\tSystem.out.println(\"\\t1 |_\"+TicTac.place[0]+\"_|_\"+TicTac.place[1]+\"_|_\"+TicTac.place[2]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t2 |_\"+TicTac.place[3]+\"_|_\"+TicTac.place[4]+\"_|_\"+TicTac.place[5]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t3 |_\"+TicTac.place[6]+\"_|_\"+TicTac.place[7]+\"_|_\"+TicTac.place[8]+\"_|\");\r\n\t\tSystem.out.println(\"\\t '-----------'\");\r\n\t}", "public void print_board(){\n\t\tfor(int i = 0; i < size*size; i++){\n\t\t\tif(i%this.size == 0) System.out.println(); //just for divider\n\t\t\tfor(int j = 0; j < size*size; j++){\n\t\t\t\tif(j%this.size == 0) System.out.print(\" \"); //just for divider\n\t\t\t\tSystem.out.print(board[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static void printBoard() {\n int separatorLen = 67;\n StringBuilder boardString = new StringBuilder();\n boardString.append(new String(new char [separatorLen]).replace(\"\\0\",\"*\"));\n boardString.append(\"\\n\");\n for(int y = Y_UPPER_BOUND - 1; y >= 0; y--)\n {\n boardString.append(y + 1).append(\" \");\n boardString.append(\"*\");\n for (int x = 0; x < X_UPPER_BOUND; x++)\n {\n Piece p = Board.board[x + y * X_UPPER_BOUND];\n if(p != null)\n {\n boardString.append(\" \").append(p).append(p.getColor()? \"-B\":\"-W\").append(\" \").append((p.toString().length() == 1? \" \":\"\"));\n }\n else\n {\n boardString.append(\" \");\n }\n boardString.append(\"*\");\n }\n boardString.append(\"\\n\").append((new String(new char [separatorLen]).replace(\"\\0\",\"*\"))).append(\"\\n\");\n }\n boardString.append(\" \");\n for(char c = 'A'; c <= 'H';c++ )\n {\n boardString.append(\"* \").append(c).append(\" \");\n }\n boardString.append(\"*\\n\");\n System.out.println(boardString);\n }", "public void display() { \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tSystem.out.print(\"|\"); \r\n\t\t\tfor (int j=0; j<3; j++){ \r\n\t\t\t\tSystem.out.print(board[i][j] + \"|\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(); \r\n\t\t}\r\n\t\tSystem.out.println(); \r\n\t}", "public void drawBoard() {\n String[][] strBoard= new String[4][4];\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n strBoard[x][y]= \".\";\n }\n else {\n // set color\n if(board[x][y]%3==2) {\n }\n strBoard[x][y]= \"\"+board[x][y];\n }\n }\n }\n \n String line= \"---------------------------------\";\n System.out.println(line);\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n System.out.print(\"|\"+strBoard[x][y]+\"\\t\");\n }\n System.out.println(\"|\");\n }\n System.out.println(line);\n }", "private void boardPrint(){\t\t\n\t\tfor (int i=0;i<size;i++) {\n\t for (int j=0;j<size;j++) {\n\t System.out.print(\" ---- \");\n\t }\n\t System.out.println();\n\t for (int j=0;j<size;j++) {\n\t \tint value = (i*size) + j + 1;\n\t \tif(board[i][j] == '\\u0000'){\n\t \t\tif(value < 10)\n\t \t\t\tSystem.out.print(\"| \"+ value + \" |\");\n\t \t\telse\n\t \t\t\tSystem.out.print(\"| \"+ value + \" |\");\n\t \t}\n\t \telse\n\t \t\tSystem.out.print(\"| \"+ board[i][j] + \" |\");\n\t }\n\t System.out.println();\n\t }\n\n\t for (int i=0;i<size;i++){\n\t \tSystem.out.print(\" ---- \");\n\t }\n\t System.out.println();\n\t}", "public static void printBoard() {\n System.out.println(\"\\t-------------\");\n for (int row = 0; row < SIZE_ROW; row++) {\n System.out.print(\"\\t| \");\n for (int col = 0; col < SIZE_COL; col++) {\n System.out.print(board[row][col] + \" | \");\n }\n System.out.println(\"\\n\\t-------------\");\n }\n }", "public void draw()\n\t{\n\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t\n\t\tfor (int i = 0; i < board_size; i++)\n\t\t{\n\t\t\tSystem.out.print(board_size - i + \" |\");\n\t\t\t\n\t\t\tfor (int j = 0; j < board_size; j++)\n\t\t\t{\n\t\t\t\tif (getPiece(i,j) == null) {System.out.print(\" |\");}\n\t\t\t\telse {System.out.print(\" \" + getPiece(i,j).getSymbol().toChar() + \" |\");}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" A B C D E F G H \\n\");\n\t}", "public void printBoard() {\n\t\t// loop through board and add appropriate character based on board\n\t\t// contents\n\n\t\t// for each board column\n\t\tfor (int row = 0; row < board.length; row++) {\n\t\t\t// for each board row\n\t\t\tfor (int col = 0; col < board[row].length; col++) {\n\t\t\t\tif (board[row][col] == 0) {\n\t\t\t\t\tSystem.out.println(\" \");\n\t\t\t\t} else if (board[row][col] == 1) {\n\t\t\t\t\tSystem.out.println(\"X\");\n\t\t\t\t} else if (board[row][col] == 2) {\n\t\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\t}\n\n\t\t\t\t// set the dividers\n\t\t\t\tif (col < board[row].length) {\n\t\t\t\t\tSystem.out.print(\"|\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"-----\");\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check if the board is occupied by player X, or player O, or neither\n\t\t// Print the correct character to the screen depending on the contents\n\t\t// of the square\n\t\t// System.out.print(\"stuff\") will print things on the same row\n\n\t\t// System.out.print(\"/n\") or System.out.println() will print a new line\n\t\t// Don't forget to add in the grid lines!\n\t}", "private static void showBoard()\n {\n System.out.println(board[1] + \" | \" + board[2] + \" | \" + board[3]);\n System.out.println(\"----------\");\n System.out.println(board[4] + \" | \" + board[5] + \" | \" + board[6]);\n System.out.println(\"----------\");\n System.out.println(board[7] + \" | \" + board[8] + \" | \" + board[9]);\n }", "public void printBoard() {\r\n\t\tif (getOpenTiles() != 0) {\r\n\t\t\tSystem.out.println(\"\\n\\nCurrent open tiles: \" + getOpenTiles() + \" | Total moves: \" + getMoves() + \" | Current board:\");\r\n\t\t}for (int i = 0; i < gameBoard.length; i++) {\r\n\t\t\tfor (int j = 0; j < gameBoard[i].length; j++) {\r\n\t\t\t\tif (gameBoard[i][j] != 0) {\r\n\t\t\t\t\tSystem.out.print(gameBoard[i][j]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t}System.out.print(\" | \");\r\n\t\t\t}System.out.print(\"\\n--+\");\r\n\t\t\tfor (int k = 0; k < getSize(); k++) {\r\n\t\t\t\tSystem.out.print(\"---+\");\r\n\t\t\t}System.out.println();\r\n\t\t}\r\n\t}", "static void printBoard() \r\n {\r\n \tSystem.out.println(\"/---|---|---\\\\\");\r\n \tSystem.out.println(\"| \" + board[0][0] + \" | \" + board[0][1] + \" | \" + \r\n \tboard[0][2] + \" |\");\r\n \tSystem.out.println(\"|-----------|\");\r\n \tSystem.out.println(\"| \" + board[1][0] + \" | \" + board[1][1] + \" | \" + \r\n \tboard[1][2] + \" |\");\r\n \tSystem.out.println(\"|-----------|\");\r\n \tSystem.out.println(\"| \" + board[2][0] + \" | \" + board[2][1] + \" | \" + \r\n \tboard[2][2] + \" |\");\r\n \tSystem.out.println(\"\\\\---|---|---/\");\r\n }", "public void consoleBoardDisplay(){\n\t\tString cell[][] = ttt.getCells();\n\t\tSystem.out.println(\"\\n\" +\n\t\t\t\"R0: \" + cell[0][0] + '|' + cell[0][1] + '|' + cell[0][2] + \"\\n\" +\n\t\t\t\" \" + '-' + '+' + '-' + '+' + '-' + \"\\n\" +\n\t\t\t\"R1: \" + cell[1][0] + '|' + cell[1][1] + '|' + cell[1][2] + \"\\n\" +\n\t\t\t\" \" + '-' + '+' + '-' + '+' + '-' + \"\\n\" +\n\t\t\t\"R2: \" + cell[2][0] + '|' + cell[2][1] + '|' + cell[2][2] + \"\\n\"\n\t\t);\n\t}", "public void printBoard() {\n\t\tfor (int row=8; row>=0;row--){\n\t\t\tfor (int col=0; col<9;col++){\n\t\t\t\tSystem.out.print(boardArray[col][row]);\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t}", "public String drawBoard() {\n fillBoard();\n return \"\\n\" +\n \" \" + boardArray[0][0] + \" | \" + boardArray[0][1] + \" | \" + boardArray[0][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[1][0] + \" | \" + boardArray[1][1] + \" | \" + boardArray[1][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[2][0] + \" | \" + boardArray[2][1] + \" | \" + boardArray[2][2] + \" \\n\";\n }", "public void printBoard() {\r\n // Print column numbers.\r\n System.out.print(\" \");\r\n for (int i = 0; i < BOARD_SIZE; i++) {\r\n System.out.printf(\" %d \", i+1);\r\n }\r\n System.out.println(\"\\n\");\r\n\r\n\r\n for (int i = 0; i < BOARD_SIZE; i++) {\r\n System.out.printf(\"%c %c \", 'A' + i, board[i][0].mark);\r\n\r\n for (int j = 1; j < BOARD_SIZE; j++) {\r\n System.out.printf(\"| %c \", board[i][j].mark);\r\n }\r\n\r\n System.out.println(\"\");\r\n\r\n if (i < BOARD_SIZE - 1) {\r\n System.out.print(\" \");\r\n for (int k = 1; k < BOARD_SIZE * 3 + BOARD_SIZE; k++) {\r\n System.out.print(\"-\");\r\n }\r\n System.out.println(\"\");\r\n }\r\n }\r\n System.out.println(\"\");\r\n }", "public void printBoard()\n {\n // Print column numbers;\n System.out.print(\" \");\n for (int index = 0; index < columns; index++)\n System.out.print(\" \" + index);\n\n System.out.println();\n\n // Print the row numbers and the board contents.\n for (int index = 0; index < rows; index++)\n {\n System.out.print(index);\n\n for (int index2 = 0; index2 < columns; index2++)\n System.out.print(\" \" + board[index][index2]);\n\n System.out.println();\n }\n\n }", "public static void drawPlayerBoard()\n {\n char rowLetter=' '; //Letra de las filas.\n \n System.out.println(\" 1 2 3 4 \" ); //Imprime la parte superior del tablero.\n System.out.println(\" +-------+-------+\");\n \n \n for (int i = 0; i< BOARD_HEIGHT; i++) //Controla los saltos de fila.\n {\n switch(i)\n {\n case 0: rowLetter='A';\n break;\n case 1: rowLetter='B';\n break;\n case 2: rowLetter='C';\n break;\n case 3: rowLetter='D';\n break;\n }\n \n System.out.print(rowLetter);\n \n for (int j = 0; j < BOARD_WIDTH; j++ ) //Dibuja las filas.\n {\n if (playerBoardPos[i][j]==0)\n {\n System.out.print(\"| · \");\n }\n else\n {\n System.out.print(\"| \" + playerBoardPos[i][j] + \" \");\n }\n }\n System.out.println(\"|\");\n \n if (i==((BOARD_HEIGHT/2)-1)) //Si se ha dibujado la mitad del tablero.\n {\n System.out.println(\" +-------+-------+\"); //Dibuja una separación en medio del tablero.\n }\n }\n \n System.out.println(\" +-------+-------+\"); //Dibuja linea de fin del tablero.\n }", "public void printBoard() {\n\t\tfor (int colIndex = 0; colIndex < 4; colIndex++){\n\t\t\tfor (int rowIndex = 0; rowIndex < 4; rowIndex++){\n\t\t\t\tSystem.out.print(this.myBoard[colIndex][rowIndex] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void showGameBoard() {\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int col = 0; col < BOARD_SIZE; col++) {\n System.out\n .printf(\"%3d\", playingBoard[row][col].getMoveNumber());\n if (col == BOARD_SIZE - 1) {\n System.out.println();\n }\n }\n }\n }", "static void showBoard() \n\t{\n\t\tSystem.out.println(\"|---|---|---|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[1] + \" | \" + tictactoeBoard[2] + \" | \" + tictactoeBoard[3] + \" |\");\n\t\tSystem.out.println(\"|-----------|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[4] + \" | \" + tictactoeBoard[5] + \" | \" + tictactoeBoard[6] + \" |\");\n\t\tSystem.out.println(\"|-----------|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[7] + \" | \" + tictactoeBoard[8] + \" | \" + tictactoeBoard[9] + \" |\");\n\t\tSystem.out.println(\"|---|---|---|\");\n\t}", "public static void draw() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[0][0] + \" | \" + board[0][1] + \" | \"\n\t\t\t\t+ board[0][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\"---+---+---\");\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[1][0] + \" | \" + board[1][1] + \" | \"\n\t\t\t\t+ board[1][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\"---+---+---\");\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[2][0] + \" | \" + board[2][1] + \" | \"\n\t\t\t\t+ board[2][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println();\n\t}", "private static void showBoard() {\n for (int i = 1; i < 10; i++) {\n for (int j = 1; j < 4; j++) {\n System.out.println(j + \".\" + board[i]);\n }\n\n }\n }", "private void printBoard() {\n\n for (int j=Board.getSize()-1; j >= 0; j--) {\n for (int i=0; i < Board.getSize(); i++) {\n // make sure indexes get printed for my pieces\n if (board.layout[i][j] == player) {\n //System.out.print(\" \"+ getPieceIndex(i,j)+ \" \");\n } else {\n System.out.print(\" \"+ board.layout[i][j]+ \" \");\n }\n }\n System.out.print(\"\\n\");\n\n }\n }", "private void draw() {\n GraphicsContext gc = canvas.getGraphicsContext2D();\n\n double size = getCellSize();\n Point2D boardPosition = getBoardPosition();\n\n // Clear the canvas\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the grid\n gc.setStroke(Color.LIGHTGRAY);\n for (int i = 0; i <= board.getWidth(); i++) {\n gc.strokeLine(boardPosition.getX() + i * size, boardPosition.getY(),\n boardPosition.getX() + i * size, boardPosition.getY() + board.getHeight() * size);\n }\n\n for (int i = 0; i <= board.getHeight(); i++) {\n gc.strokeLine(boardPosition.getX(), boardPosition.getY() + i * size,\n boardPosition.getX() + board.getWidth() * size, boardPosition.getY() + i * size);\n }\n\n // Draw cells\n gc.setFill(Color.ORANGE);\n for (int i = 0; i < board.getWidth(); i++) {\n for (int j = 0; j < board.getHeight(); j++) {\n if (board.isAlive(i, j)) {\n gc.fillRect(boardPosition.getX() + i * size, boardPosition.getY() + j * size, size, size);\n }\n }\n }\n }", "public void renderBoard(){\n for (int k = 0; k < grid.length; k++)\n for (int m = 0; m < grid[k].length; m++)\n grid[k][m] = 0;\n\n // fill the 2D array using information for non-empty tiles\n for (Cell c : game.getNonEmptyTiles())\n grid[c.getRow()][c.getCol()] = c.getValue();\n }", "public void printBoard() {\nString xAxis[] = {\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\"};\n\t\tfor(int k = 0; k <8; k++) {\n\t\t\tSystem.out.print(\"\\t\" + xAxis[k]);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\tfor(int i = 0; i<8;i++) {\n\t\t\tSystem.out.print((i + 1) + \"\\t\");\n\t\t\tfor(int j = 0; j<8;j++) {\n\t\t\t\tSystem.out.print(board.getBoard()[i][j] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\tfor(int k = 0; k <8; k++) {\n\t\t\tSystem.out.print(\"\\t\" + xAxis[k]);\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void printBoard() {\n\t\tSystem.out.println();\n\t\tint i;\n\t\tfor (i = 0; i < 7; i++) {\n\t\t\tSystem.out.print(board[13 - i] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.printf(\" \");\n\t\twhile (i < 14) {\n\t\t\tSystem.out.print(board[i - 7] + \" \");\n\t\t\ti++;\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void show()\n\t{\n\t\tSystem.out.print(\" \");\n\t\tfor(int i=1;i<=row;i++)\n\t\t{\n\t\t\tSystem.out.print(i+\" \");\n\t\t\t\n\t\t}\n\t\tSystem.out.println();\n\t for(int i=0;i<col;i++)\n\t\t{\n\t \t\n\t \tSystem.out.print(i+1+\" \");\n\t\t\tfor(int j=0;j<player1[i].length;j++)\n\t\t\t\tSystem.out.print(player1[i][j]+\" \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void displayBoard()\n {\n GreenfootImage toDisplay;\n \n for( int r = 0; r < board.length; r ++ )\n {\n for( int c = 0; c < board[r].length; c ++ )\n {\n toDisplay = new GreenfootImage( board[r][c], 100, Color.BLACK, new Color(0,0,0,0) ); \n getBackground().drawImage( toDisplay, c * getWidth()/3 + (getWidth()/3 - toDisplay.getWidth() )/2 , r * getHeight()/3 + (getHeight()/3 - toDisplay.getHeight() )/2 );\n }\n }\n }", "public static void printCheckerboard(int width,int height)\r\n{\n\tfor (int row=0; row<width; row++)\r\n\t{\r\n\r\n\t // for each column in this row\r\n\t for (int col=0; col<height; col++)\r\n\t {\r\n\t\t if (row % 2 == 0)\r\n\t\t\t{\r\n\t\t\t \tif (col % 2 == 0)\r\n\t\t\t \t\t{\r\n\t\t\t \t\t\tSystem.out.print(\"#\");\r\n\t\t\t \t\t}\r\n\t\t\t \tif (col % 1 == 0)\r\n\t\t\t \t\t{\r\n\t\t\t \t\t\tSystem.out.print(\" \");\r\n\t\t\t \t\t}\r\n\t\t\t}\r\n\t\t if (row % 1 == 0)\r\n\t\t {\r\n\t\t\t\tif (col % 2 == 0)\r\n\t\t \t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t \t\t\t}\r\n\t\t\t\r\n\t\t \t\tif (col % 1 == 0)\r\n\t\t \t\t\t{\r\n\t\t \t\t\t\tSystem.out.print(\"#\");\r\n\t\t \t\t\t}\r\n\t\t }\r\n\t\t System.out.println(\"\");\r\n\t }\r\n\t System.out.println(\"\");\r\n\t}\r\n}", "public void printBoard(int[][] board) //creates a user-freindly representation of the board and prints it for the user\n {\n for (int i = 0; i < 9; i++) //n\n {\n if (i == 0) { //1\n System.out.println(\"-------------------------\"); //prints top border of board //1\n }\n \n for (int j = 0; j < 9; j++) //n\n {\n if (j == 0)\n {\n System.out.print(\"| \" + board[i][j] + \" \");\n }\n else if ((j+1) % 3 == 0) // 3\n {\n System.out.print(board[i][j] + \" | \"); //prints divider to separate into sets of 3 columns //3\n }\n else \n {\n System.out.print(board[i][j] + \" \");\n }\n }\n System.out.println(); //1\n\n if ((i+1) % 3 == 0) //3\n {\n System.out.println(\"-------------------------\"); //prints to separate into sets of 3 rows //1\n }\n }\n }", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "public void printBoard() {\n String value = \"\";\n renderBoard();\n System.out.println(\"\");\n // loop to print out values in rows and columns\n for (int i = 0; i < game.getRows(); i++) {\n for (int j = 0; j < game.getCols(); j++) {\n if (grid[i][j] == 0)\n value = \".\";\n else\n value = \"\" + grid[i][j];\n System.out.print(\"\\t\" + value);\n }\n System.out.print(\"\\n\");\n }\n }", "public void displayBoard() {\r\n\t\tboard = new JButton[6][7];\r\n\t\tfor (int row = 0; row < board.length; row++) {\r\n\t\t\tfor (int col = 0; col < board[row].length; col++) {\r\n\t\t\t\tboard[row][col] = new JButton();\r\n\t\t\t\tboard[row][col].addActionListener(this);\r\n\t\t\t\tboard[row][col].setBorder(new EtchedBorder());\r\n\t\t\t\tboard[row][col].setEnabled(true);\r\n\t\t\t\tboardPanel.add(board[row][col]);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void printBoard() {\n\t\tSystem.out.println(\"Board:\");\r\n\t\tfor(int i=0; i<BoardSquare.numberOfSquare; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.print(String.format(\"%4s\", (i+1) + \":\"));\r\n\t\t\tif(BoardGame.board.get(i).isPlayerOne()) System.out.print(\" P1\"); \r\n\t\t\tif(BoardGame.board.get(i).isPlayerTwo()) System.out.print(\" P2\");\r\n\t\t\tif(BoardGame.board.get(i).isHasCard()) System.out.print(\" C\");\t\t\t\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t}", "public void printBoard(){\n\t\tfor(int row = 0; row <9; row++)\n\t\t{\n\t\t\tfor(int column = row; column<25-row; column++)\n\t\t\t{\n\t\t\t\tBoard[row][column]='O';\n\t\t\t}\n\t\t}\n\t\tfor(int iteration_i = 0;iteration_i<9;iteration_i++){\n\t\t\tfor(int iteration_j=0;iteration_j<25;iteration_j++)\n\t\t\t{\t\n\t\t\t\tif (Board[iteration_i][iteration_j]=='\\u0000')\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(Board[iteration_i][iteration_j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void setBoard() {\n margin = Math.round((sizeOfCell * 3) / 2);\n RelativeLayout.LayoutParams marginParam = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n marginParam.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);\n marginParam.addRule(RelativeLayout.CENTER_HORIZONTAL);\n marginParam.setMargins(0, 0, 0, (margin));\n gridContainer.setLayoutParams(marginParam);\n\n LinearLayout.LayoutParams lpRow = new LinearLayout.LayoutParams(sizeOfCell * maxN, sizeOfCell);\n LinearLayout.LayoutParams lpCell = new LinearLayout.LayoutParams(sizeOfCell, sizeOfCell);\n LinearLayout linRow;\n\n for (int row = 0; row < maxN; row++) {\n linRow = new LinearLayout(context);\n for (int col = 0; col < maxN; col++) {\n ivCell[row][col] = new ImageView(context);\n linRow.addView(ivCell[row][col], lpCell);\n }\n linBoardGame.addView(linRow, lpRow);\n }\n }", "void displayBoard();", "public void printBoard() {\n System.out.println(\"Updated board:\");\n for (int row = 0; row < size; row++) {\n for (int col = 0; col < size; col++) {\n\n System.out.print(grid[row][col] + \" \");\n\n }\n System.out.println(\"\");\n }\n }", "private void renderBoard() {\n Cell[][] cells = gameBoard.getCells();\n StringBuilder battleField = new StringBuilder(\"\\tA B C D E F G H I J \\n\");\n\n for (int i = 0; i < cells.length; i++) {\n battleField.append(i+1).append(\"\\t\");\n for (int j = 0; j < cells[i].length; j++) {\n if (cells[i][j].getContent().equals(Content.deck)) {\n battleField.append(\"O \");\n } else {\n battleField.append(\"~ \");\n }\n }\n battleField.append(\"\\n\");\n }\n\n System.out.println(battleField.toString());\n }", "public void printGrid() {\n // Creation of depth Z\n for (int d = 0; d < grid[0][0].length; d++) {\n System.out.println(\"\");\n int layer = d + 1;\n System.out.println(\"\");\n System.out.println(\"Grid layer: \" + layer);\n // Creation of height Y\n for (int h = 1; h < grid.length; h++) {\n System.out.println(\"\");\n // Creation of width X\n for (int w = 1; w < grid[0].length; w++) {\n if (grid[h][w][d] == null) {\n System.out.print(\" . \");\n } else {\n String gridContent = grid[h][w][d];\n char identifier = gridContent.charAt(0);\n\n int n = 0;\n if(grid[h][w][d].length() == 3) {\n n = grid[h][w][d].charAt(2) % 5;\n } else if (grid[h][w][d].length() == 2) {\n n = grid[h][w][d].charAt(1)%5;\n }\n if(n == 0) n = 6;\n\n // Labelling\n if (identifier == 'G' && grid[h][w][d].length() == 3) {\n System.out.print(\"\\033[47m\");\n System.out.print(grid[h][w][d]);\n System.out.print(\"\\033[0m\");\n } else if (identifier == 'G') {\n System.out.print(\"\\033[47m\");\n System.out.print(grid[h][w][d]);\n System.out.print(\"\\033[0m\");\n System.out.print(\" \");\n } else if (identifier == 'L' && grid[h][w][d].length() == 3) {\n System.out.print(\"\\033[3\"+ n + \"m\");\n System.out.print(grid[h][w][d]);\n System.out.print(\"\\033[0m\");\n } else if (identifier == 'L') {\n System.out.print(\"\\033[3\"+ n + \"m\");\n System.out.print(grid[h][w][d]);\n System.out.print(\"\\033[0m\");\n System.out.print(\" \");\n }\n }\n }\n }\n }\n System.out.println(\"\");\n }", "public void gameBoard()\t\n\t{\n\t\tSystem.out.println();\n\t\t\n\t\t// for loop to read through the board array\n\t\tfor( int i = 0; i < board.length; i++ )\n\t\t{\n\t\t\tboard[ i ] = \" \";\n\t\t\t\n\t\t} // end of for( int i = 0; i < board.length; i++ )\n\t\t\n\t\t// prints the top vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 1 ] + \" | \" + board[ 2 ] + \" | \" \n\t\t + board[ 3 ] );\n\t\t\n\t\t// prints top most horizontal line to create the board\n\t\tSystem.out.println( \"____________________________\");\n\t\t\n\t\t// prints the middle vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 4 ] + \" | \" + board[ 5 ] + \" | \" \n + board[ 6 ] );\n\t\t\n\t\t// prints the second horizontal line to create the board\n\t\tSystem.out.println( \"____________________________\");\n\t\t\n\t\t// prints the middle vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 7 ] + \" | \" + board[ 8 ] + \" | \" \n + board[ 9 ] );\n\t\t\n\t}", "public void printBoard() {\n \tfor(int i = 7; i >= 0; i--) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tSystem.out.print(\"\"+getPiece(j, i).getColor().toString().charAt(0)+getPiece(j, i).getName().charAt(0)+\"\\t\");\n \t\t}\n \t\tSystem.out.println();\n \t}\n }", "public static void printBoard(){\n \n System.out.println(board[0][0] + \" | \" + board[0][1] + \" | \" + board[0][2]);\n System.out.println(board[1][0] + \" | \" + board[1][1] + \" | \" + board[1][2]);\n System.out.println(board[2][0] + \" | \" + board[2][1] + \" | \" + board[2][2]);\n \n }", "public static void displayBoard(char[][] a){\r\n int rowNumber = a.length;\r\n int colNumber = a[0].length;\r\n for (int i = 0; i<rowNumber;i++){\r\n rowLine(colNumber);\r\n for (int j = 0; j<colNumber;j++){\r\n System.out.print('|');\r\n System.out.print(a[i][j]);\r\n }\r\n System.out.println('|');\r\n }\r\n rowLine(colNumber);\r\n }", "public void showBoard() {\n for (int i = 0; i < booleanBoard.length; i++) {\n for (int j = 0; j < booleanBoard.length; j++) {\n if (strBoard[i][j].equals(\"possible move\") || strBoard[i][j].equals(\"castling\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.green);\n }\n if (strBoard[i][j].equals(\"possible kill\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.red);\n }\n if (booleanBoard[i][j]) {\n if (figBoard[i][j].getColor().equals(\"white\")) {\n gA.getBoard()[i][j].setRotation(180);\n } else {\n gA.getBoard()[i][j].setRotation(0);\n }\n gA.getBoard()[i][j].setImageResource(figBoard[i][j].getImageResource());\n } else {\n gA.getBoard()[i][j].setImageResource(0);\n }\n }\n }\n }", "void draw_pieces(int x, int y, char[][] _display, char[][] _board) {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n switch (_board[i][j]) {\n case ' ':\n break;\n case 'p':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" _ \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" (_) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /_\\\\ \");\n break;\n case 'r':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" [###] \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" |_| \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \");\n break;\n case 'k':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" /\\\\_ \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" / o = \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" \\\\ \\\\ \");\n break;\n case 'b':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" O \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" ( ) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" / \\\\ \");\n break;\n case 'q':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" \\\\\\\\|// \");\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" )_( \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \" );\n break;\n case 'K':\n draw_text(i*8 + 2 + x, j*4 + 2 + y, _display, \" [###] \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 1, _display, \" (___) \" );\n draw_text(i*8 + 2 + x, j*4 + 2 + y + 2, _display, \" /___\\\\ \");\n break;\n default:\n break;\n }\n }\n }\n }", "public void displayBoard(char[][] grid) {\n System.out.println();\n System.out.println(\" 0 1 2 3 4 5 6\");\n System.out.println(\"---------------\");\n for (int row = 0; row < grid.length; row++) {\n System.out.print(\"|\");\n for (int col = 0; col < grid[0].length; col++) {\n System.out.print(grid[row][col]);\n System.out.print(\"|\");\n }\n System.out.println();\n System.out.println(\"---------------\");\n }\n System.out.println(\" 0 1 2 3 4 5 6\");\n System.out.println();\n }", "public StringBuffer2D displayCell(Position position){\n StringBuffer2D sb = new StringBuffer2D();\n //empty first lines\n for(int i=0; i<cellWidth-1 && i<2; i++) {\n sb.appendln(makeEmptyBoardLine());\n }\n\n //worker line\n BoardCell cell = board.getBoardCell(position);\n Player workerPlayer = getPlayerFromWorkersMap(position);\n String line1 = \"| \";\n line1 += \" \".repeat(cellWidth);\n line1 += \" \"+displayWorker(workerPlayer)+\" \";\n line1 += \" \".repeat(cellWidth);\n line1 +=\" |\";\n sb.appendln(line1);\n\n //level line\n String line2 = \"|\";\n line2 += \" \".repeat(cellWidth);\n line2 += displayLevel(cell.getLevel(), cell.hasDome());\n line2 += \" \".repeat(cellWidth);\n line2 += \"|\";\n sb.appendln(line2);\n\n //row first lines\n for(int i=0; i<cellWidth-2 && i<1; i++) {\n sb.appendln(makeEmptyBoardLine());\n }\n //row bottom border\n sb.appendln(makeDashBoardLine());\n return sb;\n }", "public void printBoard(LightModel board){\n String separatorSx = \"| \";\n String centralSep = \" | \";\n String separatorDx = \" |\";\n\n for(LightPlayer lp : board.getPlayers()){\n playersInfo.append(lp.getColor().toString()).append(\" = \").append(lp.getName()).append(\" \");\n }\n System.out.println(playersInfo);\n playersInfo.setLength(0);\n for(int j=0; j<=4;j++) {\n floorInfo.append(\"| \");\n pawnInfo.append(separatorSx);\n for (int i = 0; i < 4; i++) {\n if (board.getLightGrid()[j][i].isRoof()) {\n floorInfo.append(\"* \").append(board.getLightGrid()[j][i].getFloor()).append(\" | \");\n } else floorInfo.append(\" \").append(board.getLightGrid()[j][i].getFloor()).append(\" | \");\n if (board.getLightGrid()[j][i].getOccupied() == null) {\n pawnInfo.append(\" \").append(centralSep);\n } else\n pawnInfo.append(board.getLightGrid()[j][i].getOccupied().toString())\n .append(board.getLightGrid()[j][i].getOccupied().getNumber())\n .append(centralSep);\n }\n if (board.getLightGrid()[j][4].isRoof()) {\n floorInfo.append(\"* \").append(board.getLightGrid()[j][4].getFloor()).append(separatorDx);\n } else floorInfo.append(\" \").append(board.getLightGrid()[j][4].getFloor()).append(separatorDx);\n if (board.getLightGrid()[j][4].getOccupied() == null) {\n pawnInfo.append(\" \").append(separatorDx);\n } else\n pawnInfo.append(board.getLightGrid()[j][4].getOccupied().toString())\n .append(board.getLightGrid()[j][4].getOccupied().getNumber())\n .append(separatorDx);\n System.out.println(\"+ - - + - - + - - + - - + - - +\");\n System.out.println(floorInfo.toString());\n System.out.println(pawnInfo.toString());\n pawnInfo.setLength(0);\n floorInfo.setLength(0);\n\n }\n System.out.println(\"+ - - + - - + - - + - - + - - +\");\n }", "Board createLayout();", "public static void printBoard() {\n\t\tfor (int i = 0; i<3; i++) {\n\t\t\tSystem.out.println();\n\t\t\tfor (int j = 0; j<3; j++) {\n\t\t\t\tif (j == 0) {\n\t\t\t\t\tSystem.out.print(\"| \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(board[i][j] + \" | \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void printBoard() {\n\t\tint i = 0;\n\t\tint j = 0;\n\n\t\t// Row Counter\n\t\tfor (i = 0; i < numPeople; i++) {\n\n\t\t\t// Column Counter\n\t\t\tfor (j = 0; j < numPeople; j++) {\n\t\t\t\tSystem.out.print(board[i][j] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\n\t\t}\n\n\t}", "@Override\n public void printGrid(){\n for(int row = 0; row < rows; row++){\n System.out.print(\"\\n\");\n if(row==0){\n char row_char='A';\n System.out.print(\" |\");\n for(int i=0; i<rows; i++){\n System.out.print(\"[\" + row_char + \"]\");\n row_char++;\n }\n System.out.print(\"\\n\");\n System.out.print(\"---|\");\n for(int i=0; i<rows;i++){\n System.out.print(\"---\");\n }\n System.out.print(\"\\n\");\n }\n\n for(int column = 0; column < columns; column++){\n if (column==0){System.out.print(\"[\"+row+\"]|\");}\n System.out.print(grid[row][column]);\n }\n }\n }", "private void displayColumn(BoardMap map){\n System.out.print(\" \");\n for (int i = 0 ; i < map.getWidth() ; i++){\n if(i < 10){\n System.out.print(i + \" \");\n\n } else {\n System.out.print(i + \" \");\n }\n }\n System.out.println();\n }", "public XOBoard() {\n\t\t// initialise the boards\n\t\tboard = new int[4][4];\n\t\trenders = new XOPiece[4][4];\n\t\tfor (int i = 0; i < 4; i++)\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tboard[i][j] = EMPTY;\n\t\t\t\trenders[i][j] = null;\n\t\t\t}\n\t\tcurrent_player = XPIECE;\n\n\t\t// initialise the rectangle and lines\n\t\tback = new Rectangle();\n\t\tback.setFill(Color.GREEN);\n\t\th1 = new Line();\n\t\th2 = new Line();\n\t\th3 = new Line();\n\t\tv1 = new Line();\n\t\tv2 = new Line();\n\t\tv3 = new Line();\n\t\th1.setStroke(Color.WHITE);\n\t\th2.setStroke(Color.WHITE);\n\t\th3.setStroke(Color.WHITE);\n\t\tv1.setStroke(Color.WHITE);\n\t\tv2.setStroke(Color.WHITE);\n\t\tv3.setStroke(Color.WHITE);\n\n\t\t// the horizontal lines only need the endx value modified the rest of //\n\t\t// the values can be zero\n\t\th1.setStartX(0);\n\t\th1.setStartY(0);\n\t\th1.setEndY(0);\n\t\th2.setStartX(0);\n\t\th2.setStartY(0);\n\t\th2.setEndY(0);\n\t\th3.setStartX(0);\n\t\th3.setStartY(0);\n\t\th3.setEndY(0);\n\n\t\t// the vertical lines only need the endy value modified the rest of the\n\t\t// values can be zero\n\t\tv1.setStartX(0);\n\t\tv1.setStartY(0);\n\t\tv1.setEndX(0);\n\t\tv2.setStartX(0);\n\t\tv2.setStartY(0);\n\t\tv2.setEndX(0);\n\t\tv3.setStartX(0);\n\t\tv3.setStartY(0);\n\t\tv3.setEndX(0);\n\n\t\t// setup the translation of one cell height and two cell heights\n\t\tch_one = new Translate(0, 0);\n\t\tch_two = new Translate(0, 0);\n\t\tch_three = new Translate(0, 0);\n\t\th1.getTransforms().add(ch_one);\n\t\th2.getTransforms().add(ch_two);\n\t\th3.getTransforms().add(ch_three);\n\n\t\t// setup the translation of one cell width and two cell widths\n\t\tcw_one = new Translate(0, 0);\n\t\tcw_two = new Translate(0, 0);\n\t\tcw_three = new Translate(0, 0);\n\t\tv1.getTransforms().add(cw_one);\n\t\tv2.getTransforms().add(cw_two);\n\t\tv3.getTransforms().add(cw_three);\n\n\t\t// add the rectangles and lines to this group\n\t\tgetChildren().addAll(back, h1, h2, h3, v1, v2, v3);\n\n\t}", "public void displayGrid()\n {\n\t\t\n\tfor (int y=0; y<cases.length; y++)\n\t{\n for (int x=0; x<cases[y].length; x++)\n {\n\t\tSystem.out.print(\"|\"+cases[y][x].getValue());\n }\n System.out.println(\"|\");\n\t}\n }", "public void paint() {\n for (int row = 0; row < ROWS; ++row) {\n for (int col = 0; col < COLS; ++col) {\n cells[row][col].paint();\n if (col < COLS - 1) System.out.print(\"|\");\n }\n System.out.println();\n if (row < ROWS - 1) {\n System.out.println(\"-----------\");\n }\n }\n }", "public void displayGrid ()\n {\n for (int i = 0; i < getDimX(); i++) {\n System.out.print(\"[ \");\n for (int y = 0; y < getDimY(); y++) {\n System.out.print(m_grid[i][y]);\n System.out.print(\" \");\n }\n System.out.println(\"]\");\n }\n }", "public static void display(int[][] board) {\r\n\t\tfor (int i = 0; i < board.length; i++) {\r\n\t\t\tfor (int j = 0; j < board[0].length; j++)\r\n\t\t\t\tSystem.out.print(board[i][j] + \" \");\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private void displayGrid() {\r\n System.out.print(this.grid);\r\n }", "@Override\n\tpublic String toString(){\n\t\t// return a string of the board representation following these rules:\n\t\t// - if printed, it shows the board in R rows and C cols\n\t\t// - every cell should be represented as a 5-character long right-aligned string\n\t\t// - there should be one space between columns\n\t\t// - use \"-\" for empty cells\n\t\t// - every row ends with a new line \"\\n\"\n\t\t\n\t\t\n\t\tStringBuilder sb = new StringBuilder(\"\");\n\t\tfor (int i=0; i<numRows; i++){\n\t\t\tfor (int j =0; j<numCols; j++){\n\t\t\t\tPosition pos = new Position(i,j);\n\t\t\t\t\n\t\t\t\t// use the hash table to get the symbol at Position(i,j)\n\t\t\t\tif (grid.contains(pos))\n\t\t\t\t\tsb.append(String.format(\"%5s \",this.get(pos)));\n\t\t\t\telse\n\t\t\t\t\tsb.append(String.format(\"%5s \",\"-\")); //empty cell\n\t\t\t}\n\t\t\tsb.append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\n\t}", "@Override\n public String[] draw() {\n Piece[][] pieces = solver.getSolution();\n int height = pieces.length;\n int width = pieces[0].length;\n char[][] board = new char[height * 4][width * 4 + 1];\n int totalPieces = pieces.length * pieces[0].length;\n int countPieces = 0;\n // run through each piece and add it to the temp board\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n countPieces++;\n Piece curPiece = pieces[i][j];\n int tempHeight = i * 4 + 1;\n int tempWidth = j * 4 + 2;\n if (curPiece == null) {\n board[tempHeight][tempWidth] = EMPTY;\n board[tempHeight][tempWidth + 1] = EMPTY;\n board[tempHeight][tempWidth + 2] = EMPTY;\n board[tempHeight + 1][tempWidth] = EMPTY;\n board[tempHeight + 1][tempWidth + 1] = EMPTY;\n board[tempHeight + 1][tempWidth + 2] = EMPTY;\n board[tempHeight + 2][tempWidth] = EMPTY;\n board[tempHeight + 2][tempWidth + 1] = EMPTY;\n board[tempHeight + 2][tempWidth + 2] = EMPTY;\n Arrays.fill(board[tempHeight + 3], EMPTY);\n } else {\n char[][] displayPiece = pieceToDisplay(curPiece);\n\n board[tempHeight][tempWidth] = displayPiece[0][0];\n board[tempHeight][tempWidth + 1] = displayPiece[0][1];\n board[tempHeight][tempWidth + 2] = displayPiece[0][2];\n board[tempHeight + 1][tempWidth] = displayPiece[1][0];\n board[tempHeight + 1][tempWidth + 1] = displayPiece[1][1];\n board[tempHeight + 1][tempWidth + 2] = displayPiece[1][2];\n board[tempHeight + 2][tempWidth] = displayPiece[2][0];\n board[tempHeight + 2][tempWidth + 1] = displayPiece[2][1];\n board[tempHeight + 2][tempWidth + 2] = displayPiece[2][2];\n Arrays.fill(board[tempHeight + 3], EMPTY);\n }\n }\n }\n\n // convert the completed char[][] to the final string[]\n return finalBoard(board, totalPieces, totalPieces - countPieces);\n }", "public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }", "public void displayBoard(){\r\n System.out.println(board.toString());\r\n }", "void display()\n\t{\n\t\ttiles[fruit[0]][fruit[1]][fruit[2]] = \" *\";\n\n\t\t// does not write over head\n\t\tif (theSnake.getLength() == 3)\n\t\t{\n\t\t\tfor (int i = 1; i < theSnake.getLength(); i++)\n\t\t\t{\n\t\t\t\t// Places snake body parts onto the board\n\t\t\t\t//in each of its positions\n\t\t\t\ttiles[theSnake.getXofPartI(i)][theSnake.getYofPartI(i)][theSnake.getZofPartI(i)] = \" @\";\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor (int i = theSnake.getLength() - 1; tiles[theSnake.getXofPartI(i)][theSnake.getYofPartI(i)][theSnake.getZofPartI(i)] != \" @\"\n\t\t\t\t&& i != 0; i--)\n\t\t\t{\n\t\t\t\t// Places snake body parts onto the board\n\t\t\t\t//in each of its positions\n\t\t\t\ttiles[theSnake.getXofPartI(i)][theSnake.getYofPartI(i)][theSnake.getZofPartI(i)] = \" @\";\n\t\t\t}\n\t\t\t// places snake body part where its head was in the previous update\n\t\t\ttiles[theSnake.getXofPartI(1)][theSnake.getYofPartI(1)][theSnake.getZofPartI(1)] = \" @\";\n\t\t}\n\n\t\t// Print basic instructions\n\t\tangles.append(\"\\n\\tq: to quit\\n\\t8: up\\t5: down\\t\\t\\t\\t\\t\\t8: up\\t5: down\\n\\t4: left\\t6: right\\t\\t\\t\\t\\t9: left\\t3:right\\n\\t9:\");\n\t\tangles.append(\"surfacing\\t3: deeper\\t\\t\\t\\t4: surfacing\\t6: deeper\\n\");\n\n\t\t// print the board to console\n\t\tfor (int y = 0; y < size; y++){\n\t\t\tangles.append(\"\\t\");\n\t\t\tdisplayLine(y, \"xy\");\n\n\t\t\tangles.append(\"\\t\\t\");\n\t\t\tdisplayLine(y, \"zy\");\n\t\t\tangles.append(\"\\n\");\n\t\t}\n\n\t\tangles.append(\"\\n\\n\");\n\t\tfor (int z = 0; z < size; z++) {\n\t\t\tangles.append(\"\\t\");\n\t\t\tdisplayLine(z, \"xz\");\n\t\t\tangles.append(\"\\n\");\n\t\t}\n\t\t\n\t\tSystem.out.println(angles);\n\t\tangles.replace(0, angles.length(), \"\");\n\n\t\t// removes snake from board completely so we don't have to keep track\n\t\t//of conditions.\n\t\t//for (int i = 0; i < theSnake.getLength(); i++)\n\t\t//{\n\n\t\t// Only the last snake body part will need to be taken off\n\t\ttiles[theSnake.getXofPartI(theSnake.getLength() - 1)][theSnake.getYofPartI(theSnake.getLength() - 1)][theSnake.getZofPartI(theSnake.getLength() - 1)] = \" \";\n\t\t//}\n\t}", "private static void printBoard(char[][] board) {\n\n\t\t// header\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tSystem.out.print(\"- \");\n\t\t}\n\n\t\tSystem.out.println();\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board[0].length; j++) {\n\t\t\t\tSystem.out.print(board[i][j] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t// footer\n\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\tSystem.out.print(\"- \");\n\t\t}\n\n\t\tSystem.out.println();\n\t}", "private void printBoard() {\r\n for (int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n System.out.print(board[j][i] + \" \");\r\n }\r\n System.out.println();\r\n }\r\n }", "public WorldImage drawBoard() {\r\n return new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(this.currTurn) + \"/\"\r\n + Integer.toString(this.maxTurn), Cnst.textHeight, Color.BLACK),\r\n this.indexHelp(0,0).drawBoard(this.blocks)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2);\r\n }", "public void display() {\n\t\tdisplayColumnHeaders();\n\t\taddHyphens();\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\taddSpaces();\n\t\t\tSystem.out.print(\" row \" + row + ' ');\n\t\t\tfor (int col = 0; col < 3; col++)\n\t\t\t\tSystem.out.print(\"| \" + getMark(row, col) + \" \");\n\t\t\tSystem.out.println(\"|\");\n\t\t\taddSpaces();\n\t\t\taddHyphens();\n\t\t}\n\t}", "private void draw(){\n GraphicsContext gc = canvasArea.getGraphicsContext2D();\n canvasDrawer.drawBoard(canvasArea, board, gc, currentCellColor, currentBackgroundColor, gridToggle);\n }", "public void printTiles() {\r\n for (int row=0; row<BOARD_MAX_WIDTH; row++) {\r\n for (int col=0; col<BOARD_MAX_WIDTH; col++) {\r\n System.out.print(tiles[row][col]);\r\n }\r\n System.out.println();\r\n }\r\n System.out.println();\r\n }", "public void display() {\n\t\tfor (int i = 0; i < player.length; ++i) {\n\t\t\t// inserting empty line in every 3 rows.\n\t\t\tif (i % 3 == 0 && i != 0) {\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\tfor (int j = 0; j < player[i].length; ++j) {\n\t\t\t\t// inserting empty space in every 3 columns.\n\t\t\t\tif (j % 3 == 0 && j != 0) {\n\t\t\t\t\tSystem.out.print(' ');\n\t\t\t\t}\n\t\t\t\tif (problem[i][j] == 0 && player[i][j] == 0) {\n\t\t\t\t\tSystem.out.print(\"( )\");\n\t\t\t\t} else if (problem[i][j] == 0) {\n\t\t\t\t\tSystem.out.print(\"(\" + player[i][j] + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"[\" + player[i][j] + \"]\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t}", "private void generateBoardLayout() {\n Collections.shuffle(availableDice);\n List<GameCube> row1 = Arrays.asList(availableDice.get(0), availableDice.get(1), availableDice.get(2), availableDice.get(3));\n List<GameCube> row2 = Arrays.asList(availableDice.get(4), availableDice.get(5), availableDice.get(6), availableDice.get(7));\n List<GameCube> row3 = Arrays.asList(availableDice.get(8), availableDice.get(9), availableDice.get(10), availableDice.get(11));\n List<GameCube> row4 = Arrays.asList(availableDice.get(12), availableDice.get(13), availableDice.get(14), availableDice.get(15));\n board = new ArrayList<>();\n board.add(0, row1);\n board.add(1, row2);\n board.add(2, row3);\n board.add(3, row4);\n }", "public void update() {\n System.out.println(\"\\n\\n Board: \\n\");\n System.out.println(\" \" + pos1 + \" | \" + pos2 + \" | \" + pos3 + \" \");\n System.out.println(\" ---+---+--- \");\n System.out.println(\" \" + pos4 + \" | \" + pos5 + \" | \" + pos6 + \" \");\n System.out.println(\" ---+---+--- \");\n System.out.println(\" \" + pos7 + \" | \" + pos8 + \" | \" + pos9 + \" \");\n }", "public void print()\n {\n System.out.println(\"------------------------------------------------------------------\");\n System.out.println(this.letters);\n System.out.println();\n for(int row=0; row<8; row++)\n {\n System.out.print((row)+\"\t\");\n for(int col=0; col<8; col++)\n {\n switch (gameboard[row][col])\n {\n case B:\n System.out.print(\"B \");\n break;\n case W:\n System.out.print(\"W \");\n break;\n case EMPTY:\n System.out.print(\"- \");\n break;\n default:\n break;\n }\n if(col < 7)\n {\n System.out.print('\\t');\n }\n\n }\n System.out.println();\n }\n System.out.println(\"------------------------------------------------------------------\");\n }", "public void displayInfo(){\n\t\tint planeNum=0;\n\t\t\n\t\tfor(int i=0; i<planes.size(); i++){\t// loop to know the number of planes\n\t\t\tif(planes.get(i)!=null){\n\t\t\t\tplaneNum++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tPlane[] infoBoard = new Plane[planeNum];\t// create the array that will collect all the planes\n\t\t\n\t\tint j=0;\n\t\tfor(int i=0; i<planes.size(); i++){\t\t// put the planes in the array\n\t\t\tif(planes.get(i)!=null){\n\t\t\t\tinfoBoard[j] = planes.get(i);\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\t\tString[][] grid = new String[17][infoBoard.length + 1];\t// new matrix\n\t\t\n\t\t//característiques a mostrar fixes\n\t\tgrid[0][0] = \"Id..................\";\n\t\tgrid[1][0] = \"License plate.......\";\n\t\tgrid[2][0] = \"Brand...............\";\n\t\tgrid[3][0] = \"Model...............\";\n\t\tgrid[4][0] = \"Capacity............\";\n\t\tgrid[5][0] = \"Type................\";\n\t\tgrid[6][0] = \"X...................\";\n\t\tgrid[7][0] = \"Y...................\";\n\t\tgrid[8][0] = \"Height..............\";\n\t\tgrid[9][0] = \"Speed...............\";\n\t\tgrid[10][0] = \"Landing gear........\";\n\t\tgrid[11][0] = \"Engine..............\";\n\t\tgrid[12][0] = \"Crew................\";\n\t\tgrid[13][0] = \"Passengers..........\";\n\t\tgrid[14][0] = \"Missiles............\";\n\t\tgrid[15][0] = \"Origin..............\";\n\t\tgrid[16][0] = \"Destination.........\";\n\t\t\n\t\t// loop to fill the plane's data\n\t\tfor(int i=0; i<infoBoard.length; i++){\n\t\t\tPlane selection = infoBoard[i]; \t// each turn will fill the data of one plane\n\t\t\t\n\t\t\tint id= i + 1;\n\t\t\t// with the getters, the information is collected\n\t\t\tgrid[0][id] = String.valueOf(id);\n\t\t\t\n\t\t\tif(selection.isEncrypted()==false){\n\t\t\t\t\n\t\t\t\tgrid[1][id] = selection.getLicensePlate();\n\t\t\t\tgrid[2][id] = selection.getBrand();\n\t\t\t\tgrid[3][id] = selection.getModel();\n\t\t\t\tgrid[4][id] = String.valueOf(selection.getCapacity());\n\t\t\t\t\n\t\t\t\tif(selection.getClass().equals(\"CommercialPlane\")){\n\t\t\t\t\tgrid[5][id] = \"Commercial\";\n\t\t\t\t}else{\n\t\t\t\t\tgrid[5][id] = \"Military\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgrid[6][id]=String.valueOf(selection.getCoordinates().getX());\n\t\t\t\tgrid[7][id]=String.valueOf(selection.getCoordinates().getY());\n\t\t\t\tgrid[8][id]=String.valueOf(selection.getHeight());\n\t\t\t\tgrid[9][id]=String.valueOf(selection.getSpeed());\n\t\t\t\t\n\t\t\t\tif(selection.isLandingGear()==true){\n\t\t\t\t\tgrid[10][id] = \"On\";\n\t\t\t\t}else{\n\t\t\t\t\tgrid[10][id] = \"Off\";\n\t\t\t\t}\n\t\t\t\tif(selection.isEngine()==true){\n\t\t\t\t\tgrid[11][id] = \"On\";\n\t\t\t\t}else{\n\t\t\t\t\tgrid[11][id] = \"Off\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgrid[12][id] = String.valueOf(selection.getSpeed());\n\t\t\t\t\n\t\t\t\tif(selection instanceof CommercialPlane){\n\t\t\t\t\tgrid[13][id] = String.valueOf(selection.getPassengers());\n\t\t\t\t}else{\n\t\t\t\t\tgrid[13][id] = \"No\";\n\t\t\t\t}\n\t\t\t\tif(selection instanceof CommercialPlane){\n\t\t\t\t\tgrid[14][id] = \"No\";\n\t\t\t\t}else{\n\t\t\t\t\tgrid[14][id] = String.valueOf(selection.getMissiles());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tgrid[15][id]=String.valueOf(selection.getOrigin());\n\t\t\t\tgrid[16][id]=String.valueOf(selection.getDestination());\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tgrid[1][id] = \"ENCRYPTED\";\n\t\t\t\tgrid[2][id] = \"\";\n\t\t\t\tgrid[3][id] = \"\";\n\t\t\t\tgrid[4][id] = \"\";\n\t\t\t\tgrid[5][id] = \"\";\n\t\t\t\tgrid[6][id] = \"\";\n\t\t\t\tgrid[7][id] = \"\";\n\t\t\t\tgrid[8][id] = \"\";\n\t\t\t\tgrid[9][id] = \"\";\n\t\t\t\tgrid[10][id] = \"\";\n\t\t\t\tgrid[11][id] = \"\";\n\t\t\t\tgrid[12][id] = \"\";\n\t\t\t\tgrid[13][id] = \"\";\n\t\t\t\tgrid[14][id] = \"\";\n\t\t\t\tgrid[15][id] = \"\";\n\t\t\t\tgrid[16][id] = \"\";\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// each piece of data has to be in a 10 character string\n\t\tString unit = \" \";\n\t\tint stringLength = 11;\n\t\t\n\t\tfor(int a=0; a<grid.length; a++){\n\t\t\tfor(int b=1; b<grid[a].length; b++){\n\t\t\t\tint realLength = grid[a][b].length(); // current length of the string\n\t\t\t\tint spaces = stringLength - realLength;\t// spaces to fill until the 10th character\n\t\t\t\tString pack = \"\";\n\t\t\t\t\n\t\t\t\tfor(int c=0; c<=spaces; c++){\n\t\t\t\t\tpack = pack + unit;\n\t\t\t\t}\n\t\t\t\tgrid[a][b] = grid[a][b]+ pack;\t// add spaces\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// show information\n\t\tfor(int x=0; x<grid.length; x++){\n\t\t\tfor(int y=0; y<grid[x].length; y++){\n\t\t\t\tSystem.out.print(grid[x][y]);\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\t\n\t}", "public void display() {\n\t\tSystem.out.println(\" ---------------------------------------\");\n\t\t\n\t\tfor (byte r = (byte) (b.length - 1); r >= 0; r--) {\n\t\t\tSystem.out.print(r + 1);\n\t\t\t\n\t\t\tfor (byte c = 0; c < b[r].length; c++) {\n\t\t\t\tSystem.out.print(\" | \" + b[r][c]);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\" |\");\n\t\t\tSystem.out.println(\" ---------------------------------------\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" a b c d e f g h\");\n\t}", "private void printInScreen(int cols, int rows, Result[] myResults) {\n\t\t//6*8\n\t\t\n\t\tString matrix[][] = new String[rows][cols];\n\t\t\n\t\t//Llenar matriz con espacios o guiones\n\t\tfor(int i=0; i<rows; i++) {\n\n\t\t\tfor(int j=0; j<cols; j++) {\n\t\t\t\tmatrix[i][j] = \"-\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Encabezados de la matrix\n\t\tint maxChars = 20;\n\t\tString charToFill = \" \";\n\n\t\tSystem.out.println(\"\");\n\t\t\n\t\tfor(int j=0; j<cols; j++) {\n\t\t\tmatrix[0][j] = getHeaders(j, cols);\n\t\t\t\n\t\t\tif((j%2) == 0)\n\t\t\t\tfillWithSpaces(matrix, 0, j, maxChars, charToFill);\n\t\t}\n\n\t\t//Add separator rows\n\t\tfor(int i=1; i<rows; i+=2) {\n\t\t\t\n\t\t\tfor(int j=0; j<cols; j+=2) {\n\t\t\t\tmatrix[i][j] = ROW_SEPARATOR;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add results\n\t\tint indexAux = 0;\n\n\t\tfor(int i=2; i<rows; i+=2) {\n\t\t\t\n\t\t\t\n\t\t\tfor(int j=0; j<cols; j++) {\n\t\t\t\t\n\t\t\t\tif(j==0) {\n\t\t\t\t\tmatrix[i][j] = myResults[indexAux].getElements() + \" elements\";\n\t\t\t\t\tfillWithSpaces(matrix, i, j, maxChars, charToFill);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(j==2) {\n\t\t\t\t\tmatrix[i][j] = myResults[indexAux].getLinealSearch() + \" milliseconds\";\n\t\t\t\t\tfillWithSpaces(matrix, i, j, maxChars, charToFill);\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(j==4) {\n\t\t\t\t\tmatrix[i][j] = myResults[indexAux].getBinarySearch() + \" milliseconds\";\n\t\t\t\t\tfillWithSpaces(matrix, i, j, maxChars, charToFill);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\tmatrix[i][j] = \" \";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tindexAux++;\n\t\t}\n\t\t\n\t\t//Draw the matriz\n\t\tfor(int i=0; i<rows; i++) {\n\n\t\t\tfor(int j=0; j<cols; j++) {\n\t\t\t\tSystem.out.print(matrix[i][j]);\n\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void createBoard() {\n\t// An array of rows containing rows with squares are made\n\t\tfor (int i = 0; i < squares.length; i++) {\n\t \trows[i] = new Row(squares[i]);\n\t\t}\n\n\n\t// An array of columns containing columns with squares are made\n\t\tSquare[] columnArray = new Square[size];\n\t\tfor (int i = 0; i < size; i++) {\n\t\t for (int row = 0; row < size; row++) {\n\t\t\t\tcolumnArray[row] = squares[row][i];\n\t\t }\n\t\t columns[i] = new Column(columnArray);\n\t\t columnArray = new Square[size];\n\t\t}\n\n\n\t\tSquare[] boxArray;\n\t\tint counter;\n\t\t// Box nr i\n\t\tfor (int i = 0; i < size; i = i + height) {\n\t\t // Box nr j\n\t\t for (int j = 0; j < size; j = j + length) {\n\t\t\t\tcounter = 0;\n\t\t\t\tboxArray = new Square[size];\n\t\t\t\tint rowIndex = (i / height) * height;\n\t\t\t\tint columnIndex = (j / length) * length;\n\t\t\t\t// Row nr k\n\t\t\t\tfor (int k = rowIndex; k < rowIndex + height; k++) {\n\t\t\t\t // Column nr l\n\t\t\t\t for (int l = columnIndex; l < columnIndex + length; l++) {\n\t\t\t\t\t\tboxArray[counter] = squares[k][l];\n\t\t\t\t\t\tcounter++;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tboxes[j/length][i/height] = new Box(boxArray);\n\t\t }\n\t\t}\t\n\t\tcreatePointers();\n }", "public void example()\t\n\t{\n\t\t// prints line for spacing\n\t\tSystem.out.println();\n\t\t\n\t\t// for loop to read through the board array\n\t\tfor( int i = 0; i < board.length; i++ )\n\t\t{\n\t\t\tboard[ i ] = \" X \";\n\t\t\t\n\t\t} // end of for( int i = 0; i < board.length; i++ )\n\t\t\n\t\t// prints the top vertical lines to create the board\n\t\tSystem.out.println( \" \" + 1 + \" | \" + 2 + \" | \" \n\t\t + 3 );\n\t\t\n\t\t// prints top most horizontal line to create the board\n\t\tSystem.out.println( \"________________________\");\n\t\t\n\t\t// prints the middle vertical lines to create the board\n\t\tSystem.out.println( \" \" + 4 + \" | \" + 5 + \" | \" \n + 6 );\n\t\t\n\t\t// prints the second horizontal line to create the board\n\t\tSystem.out.println( \"________________________\");\n\t\t\n\t\t// prints the middle vertical lines to create the board\n\t\tSystem.out.println( \" \" + 7 + \" | \" + 8 + \" | \" \n + 9 );\n\t\t\n\t}" ]
[ "0.7779962", "0.77215385", "0.7478092", "0.74368227", "0.73855746", "0.73706996", "0.73327553", "0.73144007", "0.7269648", "0.72456187", "0.7227598", "0.7219403", "0.72185963", "0.71398365", "0.7138224", "0.71321875", "0.7127638", "0.7123956", "0.71223736", "0.71164554", "0.71128577", "0.7087846", "0.7083425", "0.7058826", "0.70450425", "0.7039053", "0.70384496", "0.7029191", "0.70141447", "0.70116675", "0.7004122", "0.69929427", "0.6982296", "0.69685596", "0.69512457", "0.69463354", "0.6928419", "0.6923058", "0.69030774", "0.6865128", "0.6856318", "0.68399876", "0.6830357", "0.6819248", "0.6804263", "0.679758", "0.6786388", "0.67754", "0.67753637", "0.67677", "0.6762257", "0.675938", "0.6731611", "0.67268944", "0.67233807", "0.67221147", "0.6710601", "0.6707543", "0.67050856", "0.66642064", "0.6658486", "0.6655317", "0.66457963", "0.6639456", "0.6613105", "0.6608793", "0.6605977", "0.6602145", "0.65902257", "0.65891397", "0.6589008", "0.65872395", "0.6584829", "0.6576197", "0.6566093", "0.6549518", "0.65347993", "0.6531092", "0.65295696", "0.6529232", "0.65011466", "0.6493301", "0.64884233", "0.64831305", "0.6472397", "0.6414518", "0.6411438", "0.6410804", "0.6399381", "0.6398103", "0.6391154", "0.63890654", "0.6376693", "0.6344553", "0.63319784", "0.6320295", "0.63157046", "0.63131106", "0.6297461", "0.62953794" ]
0.7618845
2
this method is used to check EVERY space on the board that the current player can place a piece on. If none are found, then validation will become false and the player's turn will be skipped.
public static void boardcheck(String piecevalue){ //in all check methods, an opposite piece value must be set which holds the opposite piece to the current one (ie. x's opposite piece is o, o's opposite piece is x) String oppositepiece; if(piecevalue.equals("x")){ oppositepiece="o"; } else if(piecevalue.equals("o")){ oppositepiece="x"; } //This step is needed or JAVA will think that the piecevalue may not have been initialized else{ oppositepiece="-"; } //With the 2 for loops and the if statement, the program will go through the whole board but only check the value if it is on a blank space [-]. for(int row=1;row<=boardwidth;row++){ for(int column=1;column<=boardlength;column++){ if(board[row][column].equals("-")){ //found booleans will turn into true if a 'connection' is available and an action can be made with the current row/column in the loop. boolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false; //checkfurther all begin as 1 and will increase in value if an opposite piece is found in the direction it is checking, this lets the while loop continue and check more in that direction. int checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1; //R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left. //program will check all directions using this scheme. //If the board in this direction holds and opposite piece, it will advance and check further, until something other than an opposite piece is reached. while(board[row][column+checkfurtherR].equals(oppositepiece)){ checkfurtherR++; } //If the piece after the check furthers have stopped is the same-type piece, then everything in between will be converted to the current piece. A 'connection' is made as explained in the tutorial/user manual. if(board[row][column+checkfurtherR].equals(piecevalue)&&checkfurtherR>1){ foundR=true; } while(board[row][column-checkfurtherL].equals(oppositepiece)){ checkfurtherL++; } if(board[row][column-checkfurtherL].equals(piecevalue)&&checkfurtherL>1){ foundL=true; } while(board[row+checkfurtherB][column].equals(oppositepiece)){ checkfurtherB++; } if(board[row+checkfurtherB][column].equals(piecevalue)&&checkfurtherB>1){ foundB=true; } while(board[row-checkfurtherT][column].equals(oppositepiece)){ checkfurtherT++; } if(board[row-checkfurtherT][column].equals(piecevalue)&&checkfurtherT>1){ foundT=true; } while(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){ checkfurtherTR++; } if(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)&&checkfurtherTR>1){ foundTR=true; } while(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){ checkfurtherTL++; } if(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)&&checkfurtherTL>1){ foundTL=true; } while(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){ checkfurtherBL++; } if(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)&&checkfurtherBL>1){ foundBL=true; } while(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){ checkfurtherBR++; } if(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)&&checkfurtherBR>1){ foundBR=true; } //If any pieces have if(foundR==true||foundL==true||foundT==true||foundB==true||foundTL==true||foundTR==true||foundBL==true||foundBR==true){ boardavailability=true; } } } } //This if statement does not have to do with the current method. It is useful to the next nomovecheck method. if(boardavailability==false){ nomovecount++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isValid() {\n\t\tif (isPlayer1() && currentPit < 7 && currentPit != 6) {\n\t\t\tif (board[currentPit] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true; // check appropriate side of board, excluding scoring\n\t\t}\n\t\t// pit\n\t\telse if (!isPlayer1() && currentPit >= 7 && currentPit != 13) {\n\t\t\tif (board[currentPit] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isValidBoard() {\n\t\t\n\t\tif(mainSlots.size() != NUM_MAIN_SLOTS) {\n\t\t\treturn false;\n\t\t} else if ((redHomeZone != null && redHomeZone.size() != NUM_HOME_SLOTS) ||\n\t\t\t\t(greenHomeZone != null && greenHomeZone.size() != NUM_HOME_SLOTS) ||\n\t\t\t\t(yellowHomeZone != null && yellowHomeZone.size() != NUM_HOME_SLOTS) || \n\t\t\t\t(blueHomeZone != null && blueHomeZone.size() != NUM_HOME_SLOTS)) {\n\t\t\treturn false;\n\t\t} else if ((redEndZone != null && redEndZone.size() != NUM_END_SLOTS) ||\n\t\t\t\t(greenEndZone != null && greenEndZone.size() != NUM_END_SLOTS) || \n\t\t\t\t(yellowEndZone != null && yellowEndZone.size() != NUM_END_SLOTS) || \n\t\t\t\t(blueEndZone != null && blueEndZone.size() != NUM_END_SLOTS)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "private boolean isLegalMove(String move) {\n\t\tString[] moveParts = move.split(\";\");\n\n\t\tint fromRow = Integer.parseInt(moveParts[0].charAt(0) + \"\");\n\t\tint fromCol = Integer.parseInt(moveParts[0].charAt(1) + \"\");\n\n\t\tint toRow = Integer.parseInt(moveParts[1].charAt(0) + \"\");\n\t\tint toCol = Integer.parseInt(moveParts[1].charAt(1) + \"\");\n\n\t\tint minRow = Math.min(fromRow, toRow);\n\t\tint minCol = Math.min(fromCol, toCol);\n\n\t\tint maxRow = Math.max(fromRow, toRow);\n\t\tint maxCol = Math.max(fromCol, toCol);\n\n\t\tint piece = board[fromRow][fromCol];//Integer.parseInt(moveParts[2]);\n\t\tint pieceType = Math.abs(piece);\n\t\tint team = Math.round(Math.signum(piece));\n\n\t\tif (team == Math.round(Math.signum(board[toRow][toCol]))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (toRow < 0 || toRow > 7 && toCol < 0 && toCol > 7) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (team > 0) { // WHITE\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isWhiteCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else { //BLACK\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isBlackCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (pieceType == 1) { //Pawn\n\t\t\treturn ((board[toRow][toCol] != 0 && toRow == fromRow + team && (toCol == fromCol + 1 || toCol == fromCol - 1)) || (toCol == fromCol && board[toRow][toCol] == 0 && ((toRow == fromRow + team) || (((fromRow == 1 && team == 1) || (fromRow == 6 && team == -1)) ? toRow == fromRow + 2*team && board[fromRow + team][fromCol] == 0 : false))));\n\t\t} else if (pieceType == 2) { //Rook\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (pieceType == 3) { //Knight\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy == 5;\n\t\t} else if (pieceType == 4) { //Bishop\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\tint m = dy/dx;\n\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && board[i][startCol + m*(i - minRow)] != 7) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (pieceType == 5) { //Queen\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tint dx = toRow - fromRow;\n\t\t\t\tint dy = toCol - fromCol;\n\t\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\t\tint m = dy/dx;\n\t\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && Math.abs(board[i][startCol + m*(i - minRow)]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (pieceType == 6) { //King\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy <= 2;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean validMove(int x, int y, boolean blackPlayerTurn)\n\t{\n\t\t// check holds 'B' if player black or 'W' if player white\n\t\tchar check;\n\t\tchar checkNot;\n\t\tcheck = blackPlayerTurn ? 'B' : 'W';\n\t\tcheckNot = !blackPlayerTurn ? 'B' : 'W';\n\t\tchar[][] arrayClone = cloneArray(currentBoard);\n\t\t// check if board position is empty\n\t\tif (currentBoard[x][y] == ' ')\n\t\t{\n\t\t\t// prime arrayClone by placing piece to be place in spot\n\t\t\tarrayClone[x][y] = check;\n\t\t\t// check if capture of other players pieces takes place (up, right, left, down)\n\t\t\t// checkNot\n\t\t\tcaptureCheck(x, y, checkNot, arrayClone);\n\t\t\t// if our candidate placement has liberties after capture check then place\n\t\t\t// piece!\n\t\t\tif (hasLibTest(x, y, check, arrayClone))\n\t\t\t{\n\t\t\t\tif (pastBoards.contains(arrayClone))\n\t\t\t\t{\n\t\t\t\t\t// do not allow repeat boards\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcurrentBoard = cloneArray(arrayClone);\n\t\t\t\t// make move handles actually piece placement so remove check from board\n\t\t\t\tarrayClone[x][y] = ' ';\n\t\t\t\t// arrayClone contains updated positions with captured pieces removed\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "@Override\r\n\tpublic void getLegalMoves() {\r\n\t\tint pawnX = this.getX();\r\n\t\tint pawnY = this.getY();\r\n\t\tchar pawnColor = getColor();\r\n\t\tTile[][] chessBoard = SimpleChess.getChessBoard();\r\n\t\tcheckInFront(chessBoard,pawnX,pawnY,pawnColor);\r\n\t\tcheckDiagonal(chessBoard,pawnX,pawnY,pawnColor);\r\n\t}", "@Override\n\tpublic boolean check(piece[][] board) {\n\t\t\n\t\treturn false;\n\t\t\n\t}", "@Override\n public void drawValidMove() {\n if(this.getPlayer().getPlayerID() % 2 != 0) {\n //Pawn can move one space forwards if no piece is in front\n if (board.getSquare(x-1, y).getPiece()== null) {\n board.getSquare(x-1, y).drawOutline();\n }\n \n //if first move, pawn can move 2 spaces forward\n if (!hasMoved && board.getSquare(x-2, y).getPiece() == null && board.getSquare(x-1, y).getPiece() == null) {\n board.getSquare(x-2, y).drawOutline();\n }\n \n //If there is an enemy piece in the diagonal forward square of the pawn, the pawn can move (capture the piece)\n if (y-1 > 0) { //ensures no arrayoutofbounds error\n if (board.getSquare(x-1, y-1) != null && board.getSquare(x-1, y-1).getPiece() != null &&\n board.getSquare(x-1, y-1).getPiece().getPlayer() != this.getPlayer()) {\n board.getSquare(x-1, y-1).drawOutline();\n }\n }\n \n if(y+1<SIZE) { //ensures no arrayoutofbounds error\n if (board.getSquare(x-1, y+1) != null && board.getSquare(x-1, y+1).getPiece() != null &&\n board.getSquare(x-1, y+1).getPiece().getPlayer() != this.getPlayer() ) {\n board.getSquare(x-1, y+1).drawOutline();\n }\n }\n \n System.out.println(\"\");\n //En passant\n if (y - 1 > 0) {\n \n System.out.println();\n if (board.getSquare(x, y-1).getPiece() != null) { \n System.out.println(\"the piece's enPassant is: \" + board.getSquare(x, y-1).getPiece().getEnPassant());\n System.out.println(\"The game's turn counter is: \" + board.getTurnCounter());\n }\n else {\n System.out.println(\"Null piece when checking for en passent.\");\n }\n \n if (board.getSquare(x, y-1).getPiece() != null && board.getSquare(x, y-1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y-1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x-1, y-1).drawOutline();\n board.getSquare(x-1, y-1).setEnPassent(true);\n }\n }\n \n if (y + 1 < SIZE) {\n if (board.getSquare(x, y+1).getPiece() != null && board.getSquare(x, y+1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y+1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x-1, y+1).drawOutline();\n board.getSquare(x-1, y+1).setEnPassent(true);\n }\n }\n }\n \n //If this pawn belongs to player 2:\n else {\n \n if (board.getSquare(x+1, y).getPiece() == null) {\n board.getSquare(x+1, y).drawOutline();\n }\n \n //if first move, pawn can move 2 spaces forward\n if (!hasMoved && board.getSquare(x+2, y).getPiece() == null && board.getSquare(x+1, y).getPiece() == null) {\n board.getSquare(x+2, y).drawOutline();\n \n }\n \n if(y-1 > 0) {\n if (board.getSquare(x+1, y-1) != null && board.getSquare(x+1, y-1).getPiece() != null &&\n board.getSquare(x+1, y-1).getPiece().getPlayer() != this.getPlayer() ) {\n board.getSquare(x+1, y-1).drawOutline();\n }\n }\n \n if(y+1 < SIZE) {\n if (board.getSquare(x+1, y+1) != null && board.getSquare(x+1, y+1).getPiece() != null &&\n board.getSquare(x+1, y+1).getPiece().getPlayer() != this.getPlayer()) {\n board.getSquare(x+1, y+1).drawOutline();\n }\n }\n \n //En passant\n if (y - 1 > 0) {\n if (board.getSquare(x, y-1).getPiece() != null &&board.getSquare(x, y-1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y-1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x+1, y-1).drawOutline();\n board.getSquare(x+1, y-1).setEnPassent(true);\n }\n }\n \n if (y + 1 < SIZE) {\n if (board.getSquare(x, y+1).getPiece() != null && board.getSquare(x, y+1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y+1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x+1, y+1).drawOutline();\n board.getSquare(x+1, y+1).setEnPassent(true);\n }\n }\n }\n }", "boolean isLegal(String move) {\n int[][] theStatusBoard;\n if (_playerOnMove == ORANGE) {\n theStatusBoard = _orangeStatusBoard;\n } else {\n theStatusBoard = _violetStatusBoard;\n }\n Pieces thispiece = new Pieces();\n String piecename = move.substring(0, 1);\n int col = getCoordinate(move.substring(1, 2));\n int row = getCoordinate(move.substring(2, 3));\n int ori = Integer.parseInt(move.substring(3, 4));\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n if (row + depth - 1 > 13 || col + length - 1 > 13) {\n System.out.println(\"Your move makes your piece out of the board, try again!\");\n return false;\n }\n\n boolean has1 = false;\n boolean no2 = true;\n\n int i, j;\n for (i = 0; i < depth; i++) {\n for (j = 0; j < length; j++) {\n if (finalPositions[i][j] == 1) {\n if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 1) {\n has1 = true;\n } else if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 2) {\n return false;\n }\n }\n }\n }\n System.out.println(\"has1: \" + has1);\n return has1;\n }", "private boolean isValidMove(int pressedHole) {\n return getPlayerHole(pressedHole).getKorgools() != 0;\n }", "static boolean canPlace(int row, int col, char[][] piece) {\n for (int r = 0; r < piece.length; r++) {\n for (int c = 0; c < piece[r].length; c++) {\n if (piece[r][c] != '0') {\n if (row + r >= 0 && row + r < board.length && col + c >= 0 && col + c < board[row].length) {\n if (board[row + r][col + c] != '0') {\n return false;\n }\n } else {\n return false;\n }\n }\n }\n }\n\n return true;\n }", "boolean isLegal(Move move) {\n int c = move.getCol0();\n int r = move.getRow0();\n int[] vector = move.unit();\n Piece p;\n for(int i = 0; i <= vector[2]; i++) {\n p = get(c, r);\n if (p != null && p.side() != _turn) {\n return false;\n }\n }\n return true;\n\n }", "public boolean moveValidation(Board board, Piece piece, int sourceX, int sourceY, int targetX, int targetY){//TODO make directions in Piece class\n int diffX = targetX - sourceX;\n int diffY = targetY - sourceY;\n if (!board.isPieceAtLocation(targetX, targetY) || board.isPieceAtLocationCapturable(piece.getColour(), targetX, targetY)) {\n if(diffX==0 && diffY > 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 0, 1);\n else if(diffX > 0 && diffY == 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 1, 0);\n else if(diffX < 0 && diffY == 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, -1, 0);\n else if(diffX==0 && diffY < 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 0, -1);\n }\n return false;\n }", "private boolean moveIsValid(Move move){\n BoardSpace[][] boardCopy = new BoardSpace[Constants.BOARD_DIMENSIONS][Constants.BOARD_DIMENSIONS];\n for(int i = 0; i < Constants.BOARD_DIMENSIONS; i++){\n for(int j = 0; j < Constants.BOARD_DIMENSIONS; j++){\n boardCopy[i][j] = new BoardSpace(boardSpaces[i][j]);\n }\n }\n int row = move.getStartRow();\n int col = move.getStartCol();\n String ourWord = \"\";\n String currentWord = \"\";\n for (Tile tile: move.getTiles()){\n ourWord += tile.getLetter();\n if (move.isAcross()){\n col++;\n } else {\n row++;\n }\n }\n currentWord = ourWord;\n if(move.isAcross()){\n //check if we keep going right we invalidate the word\n while(col+1 < boardCopy.length && !boardCopy[row][++col].isEmpty() ){\n if( isValidWord(currentWord += boardCopy[row][col].getTile().getLetter()) == false ) return false;\n }\n //check if we keep going left we invalidate the word\n col = move.getStartCol();\n currentWord = ourWord;\n while(col-1 >= 0 && !boardCopy[row][--col].isEmpty() ){\n if(!isValidWord( currentWord = boardCopy[row][col].getTile().getLetter() + currentWord ) ) return false;\n }\n } else if(!move.isAcross()){\n row = move.getStartRow(); col = move.getStartCol();\n currentWord = ourWord;\n //check if we keep going down we invalidate the word;\n while(row+1 < boardCopy.length && !boardCopy[++row][col].isEmpty()){\n if( !isValidWord(currentWord += boardCopy[row][col].getTile().getLetter() )) return false;\n }\n row = move.getStartRow();\n currentWord = ourWord;\n while(row-1 >= 0 && !boardCopy[--row][col].isEmpty()){\n if( !isValidWord( currentWord = boardCopy[row][col].getTile().getLetter() + currentWord )) return false;\n }\n }\n return true;\n }", "public boolean validateMove(int x, int y)\n {\n try {\n return (board[x][y] == EMPTY_FLAG);\n } catch (ArrayIndexOutOfBoundsException e) {\n return false;\n }\n }", "@Override\n\tpublic boolean isMoveValid(int row, int col) {\n\t\tif (isValidSide(row, col)) {\n\t\t\taddMissileResult(row, col);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean anyValid(OthelloPiece colour){\n boolean valid = false;\n for(int i=0; i<WIDTH;i++){\n for(int j=0;j<HEIGHT;j++){\n if(anyMove(i,j,colour)){\n valid = true;\n }\n } \n }\n clearPieces();\n return valid;\n }", "private void checkLegal() {\n\tif (undoStack.size() == 2) {\n ArrayList<Integer> canGo = \n getMoves(undoStack.get(0), curBoard);\n boolean isLegal = false;\n int moveTo = undoStack.get(1);\n for (int i = 0; i < canGo.size(); i++) {\n if(canGo.get(i) == moveTo) {\n isLegal = true;\n break;\n }\n }\n\n if(isLegal) {\n curBoard = moveUnit(undoStack.get(0), \n moveTo, curBoard);\n clearStack();\n\n moveCount++;\n\t setChanged();\n\t notifyObservers();\n }\n\t}\n }", "public boolean checkWin (int totalPieces){\n\t\treturn isFull();\n\t}", "public boolean validMove(int col){\n\t\tif (col > board.getCOLS() || col < 0 ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tint row = 5;\n\t\t\twhile(row >=0 ){\n\t\t\t\tif(board.getPlayField()[row][col].getGamePiece().equals(SharedConstants.PlayableItem.EMPTY))\n\t\t\t\t\treturn true;\n\t\t\t\trow--;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "public void setValidMoves(){\r\n int row = (int)this.space.getX();\r\n int column = (int)this.space.getY();\r\n int max = puzzleSize-1;\r\n if (row < max)\r\n this.validMoves.add(new Point(row+1, column));\r\n if (row > 0)\r\n this.validMoves.add(new Point(row-1, column));\r\n if (column < max)\r\n this.validMoves.add(new Point(row, column+1));\r\n if (column > 0)\r\n this.validMoves.add(new Point(row, column-1));\r\n }", "public boolean checkAnyPieceCanMove(Player playerInCheck) {\r\n\t\tif (playerInCheck.color == Color.WHITE) {\r\n\t\t\treturn checkAllPieces(white, playerInCheck);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn checkAllPieces(black, playerInCheck);\r\n\t\t}\r\n\t}", "public abstract boolean validMove(ChessBoard board, Square from, Square to);", "private boolean isThereValidMove() {\n\t\treturn true;\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = from.getX() - to.getX();\r\n int y = from.getY() - to.getY();\r\n \r\n if (x < 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n } \r\n return true;\r\n }\r\n else if(x > 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n }\r\n return true;\r\n }\r\n else if( x > 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n }\r\n return true; \r\n }\r\n else if (x < 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n } \r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public boolean checkRequirements(PlayerBoard playerBoard);", "public boolean checkForVictory() {\n // keep track of whether we have seen any pieces of either color.\n boolean anyWhitePieces = false;\n boolean anyRedPieces = false;\n // iterate through each row\n for (Row row : this.redBoard) {\n // whether we iterate through the red or white board does not matter; they contain the same pieces, just\n // in a different layout\n // iterate through each space in a row\n for (Space space : row) {\n // if there is a piece on this space\n if (space.getPiece() != null) {\n if (space.getPiece().getColor() == Piece.COLOR.RED) {\n // and if it's red, we have now seen at least one red piece\n anyRedPieces = true;\n } else if (space.getPiece().getColor() == Piece.COLOR.WHITE) {\n // and if it's white, we have now seen at least one white piece\n anyWhitePieces = true;\n }\n }\n }\n }\n // if we haven't seen any pieces of a color, then the other player has won\n if (!anyRedPieces) {\n // white player has won\n markGameAsDone(getWhitePlayer().getName() + \" has captured all the pieces.\");\n return true;\n } else if (!anyWhitePieces) {\n // red player has won\n markGameAsDone(getRedPlayer().getName() + \" has captured all the pieces.\");\n return true;\n }\n return false;\n }", "public boolean isLegalMove (int row, int col, BoardModel board, int side) {\n\t\t\n\t\tboolean valid = false;\n\t\t//look if the position is valid\n\t\tif(board.getBoardValue(row, col) == 2) {\n\t\t\t//look for adjacent position\n\t\t\tfor(int[] surround : surroundingCoordinates(row, col)) {\n\t\t\t\t//the adjacent poision has to be of the opponent\n\t\t\t\tif(board.getBoardValue(surround[0], surround[1]) == getOpponent(side)){\n\t\t\t\t\t//now check if we come across with a color of ourselves\n\t\t\t\t\tint row_diff = surround[0] - row;\n\t\t\t\t\tint col_diff = surround[1] - col;\t\t\t\t\t\n\t\t\t\t\tif(!valid && checkNext((row+row_diff), (col+col_diff), row_diff, col_diff, side, board) ){\n\t\t\t\t\t\tvalid = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn valid;\n\t}", "public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }", "public static boolean validationcheck(int row, int column, String piecevalue){\n\t\tif(board[row][column].equals(\"x\")||board[row][column].equals(\"o\")){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}", "private boolean canGetOutOfCheck(boolean[][] moves, Piece piece) {\r\n\t\tfor (int i = 0; i < this.SIZE; i++) {\r\n\t\t\tfor (int j = 0; j < this.SIZE; j++) {\r\n\t\t\t\tif(checkMove(moves, piece, i, j)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private boolean check(boolean isWhite) {\n Tile kingTile = null;\n ArrayList<Position> opponentMoves = new ArrayList<>();\n // find king's tile and populate opponent moves\n for (Tile[] t : this.board) {\n for (Tile tile : t) {\n if (tile.piece instanceof King && tile.piece.isWhite() == isWhite) {\n kingTile = tile;\n }\n if (tile.hasPiece && tile.piece.isWhite() != isWhite) {\n for(Position move : tile.piece.getLegalMoves()) opponentMoves.add(move);\n }\n }\n }\n // compare every position with king's position\n for (Position opponentMove : opponentMoves) {\n if (opponentMove.equals(kingTile.position)) {\n return true;\n }\n }\n return false;\n }", "private static boolean isMoveValid( int x, int y ){\n int path[] = new int[8];\n for( int distance = 1; distance < 8; distance ++ ){\n checkPath( path, 0, x + distance, y, distance );\n checkPath( path, 1, x + distance, y + distance, distance );\n checkPath( path, 2, x, y + distance, distance );\n checkPath( path, 3, x - distance, y, distance );\n checkPath( path, 4, x - distance, y - distance, distance );\n checkPath( path, 5, x, y - distance, distance );\n checkPath( path, 6, x + distance, y - distance, distance );\n checkPath( path, 7, x - distance, y + distance, distance );\n }\n for( int i = 0; i < 8; i++ ){\n if( path[ i ] > 1 ){\n return true;\n }\n }\n return false;\n }", "private static boolean isValidBoard(byte[][] board) {\n for(int columnIndex = 0; columnIndex < board.length; columnIndex++) {\n for(int rowIndex = 0; rowIndex < board[columnIndex].length; rowIndex++) {\n byte value = board[columnIndex][rowIndex];\n if((value != IBoardState.symbolOfInactiveCell) && (value != IBoardState.symbolOfEmptyCell) && (value != IBoardState.symbolOfFirstPlayer) && (value != IBoardState.symbolOfSecondPlayer)) {\n return false;\n }\n }\n }\n return true;\n }", "public boolean isValid() {\n\t\treturn (x >= 0 && x < Board.SIZE && y >= 0 && y < Board.SIZE);\n\t}", "public boolean checkBoardFull() {\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (grid[i][j].getSymbol() == '-')\n return false;\n }\n }\n return true;\n }", "public static void validationcheck2(int row, int column, String piecevalue){\n\t\tString oppositepiece;\n\t\tif(piecevalue.equals(\"x\")){\n\t\t\toppositepiece=\"o\";\n\t\t}\n\t\telse if(piecevalue.equals(\"o\")){\n\t\t\toppositepiece=\"x\";\n\t\t}\n\t\telse{\n\t\t\toppositepiece=\"-\";\n\t\t}\n\t\t//R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left.\n\t\tboolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false;\n\t\tint checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1;\n\t\twhile(board[row][column+checkfurtherR].equals(oppositepiece)){\n\t\t\tcheckfurtherR++;\n\t\t}\n\t\tif(board[row][column+checkfurtherR].equals(piecevalue)&&checkfurtherR>1){\n\t\t\tfoundR=true;\n\t\t}\n\t\twhile(board[row][column-checkfurtherL].equals(oppositepiece)){\n\t\t\tcheckfurtherL++;\n\t\t}\n\t\tif(board[row][column-checkfurtherL].equals(piecevalue)&&checkfurtherL>1){\n\t\t\tfoundL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherB][column].equals(oppositepiece)){\n\t\t\tcheckfurtherB++;\n\t\t}\n\t\tif(board[row+checkfurtherB][column].equals(piecevalue)&&checkfurtherB>1){\n\t\t\tfoundB=true;\n\t\t}\n\t\twhile(board[row-checkfurtherT][column].equals(oppositepiece)){\n\t\t\tcheckfurtherT++;\n\t\t}\n\t\tif(board[row-checkfurtherT][column].equals(piecevalue)&&checkfurtherT>1){\n\t\t\tfoundT=true;\n\t\t}\n\t\twhile(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){\n\t\t\tcheckfurtherTR++;\n\t\t}\n\t\tif(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)&&checkfurtherTR>1){\n\t\t\tfoundTR=true;\n\t\t}\n\t\twhile(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){\n\t\t\tcheckfurtherTL++;\n\t\t}\n\t\tif(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)&&checkfurtherTL>1){\n\t\t\tfoundTL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){\n\t\t\tcheckfurtherBL++;\n\t\t}\n\t\tif(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)&&checkfurtherBL>1){\n\t\t\tfoundBL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){\n\t\t\tcheckfurtherBR++;\n\t\t}\n\t\tif(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)&&checkfurtherBR>1){\n\t\t\tfoundBR=true;\n\t\t}\n\t\tif(foundR==true||foundL==true||foundT==true||foundB==true||foundTL==true||foundTR==true||foundBL==true||foundBR==true){\n\t\t\tvalidation=true;\n\t\t}\n\t\telse{\n\t\t\tvalidation=false;\n\t\t}\n\t}", "public static boolean isMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\tif (board[toRow][toCol]==0){/*is the target slot ia emtey*/\r\n\t\t\tif (player==1){\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){ /*is the starting slot is red player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther no eating jump?*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is this is legal move*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tif (player==-1){\r\n\t\t\t\tif (board[fromRow][fromCol]==-1||board[fromRow][fromCol]==-2){/*is the starting slot is blue player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther are no eating move*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the move is legal*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public boolean checkRep() {\n return location.x() >= 0 && location.x() < board.getWidth() && \n location.y() >= 0 && location.y() < board.getHeight(); \n }", "@Override\n public boolean isValidMove(Move move) {\n if (board[move.oldRow][move.oldColumn].isValidMove(move, board))\n return true;\n //player will not be in check\n //move will get player out of check if they are in check\n return false;\n }", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX());\r\n int y = Math.abs(from.getY() - to.getY());\r\n if((from.getX() - to.getX()) > 0 || (from.getY() - to.getY()) > 0){\r\n if ((x == 0 && y >= 1)) {\r\n for(int i = 1; i <= y-1; i++){\r\n if(board.getBox(from.getX(), from.getY() - i).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }else if((x >= 1 && y == 0)){\r\n for(int i = 1; i <= x-1; i++){\r\n if(board.getBox(from.getX() - i, from.getY()).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }else if((from.getX() - to.getX()) < 0 || (from.getY() - to.getY()) < 0){\r\n if (x == 0 && (from.getY() - to.getY()) <= -1) {\r\n for(int i = y-1; i > 0; i--){\r\n if(board.getBox(from.getX(), from.getY() + i).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }else if((from.getX() - to.getX()) <= -1 && y == 0){\r\n for(int i = x-1; i > 0; i--){\r\n if(board.getBox(from.getX() + i, from.getY()).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "boolean isValid() {\n\t\t// see if there is a empty square with no available move\n\t\tint counter;\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor(int j = 0; j < boardSize; j++) {\n\t\t\t\tcounter = 0;\n\t\t\t\tif (board[i][j] == 0) {\n\t\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (counter == 0) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// see if there is a number missing in availMoves + board in each line/box \n\t\tboolean[][] verticalNumbers = new boolean[boardSize][boardSize];\n\t\tboolean[][] horizontalNumbers = new boolean[boardSize][boardSize];\n\t\tboolean[][] boxNumbers = new boolean[boardSize][boardSize];\n\t\tint box = 0;\n\t\tfor(int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tbox = i/boxSize + ((j/boxSize) * boxSize); \n\t\t\t\tif (board[i][j] > 0) {\n\t\t\t\t\tverticalNumbers[i][board[i][j] - 1] = true;\n\t\t\t\t\thorizontalNumbers[j][board[i][j] - 1] = true;\n\t\t\t\t\tboxNumbers[box][board[i][j] - 1] = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\t\tverticalNumbers[i][k] = true;\n\t\t\t\t\t\t\thorizontalNumbers[j][k] = true;\n\t\t\t\t\t\t\tboxNumbers[box][k] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if there is any boolean still false it means that number is missing from that box/line\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tif (verticalNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (horizontalNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (boxNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public boolean checkMove(Piece piece, boolean check) {\n\t\tif (check) {\n\t\t\tint x = piece.getX();\n\t\t\tint y = piece.getY();\n\t\t\tif (x >= 0 && x <= 7 && y >= 0 && y <= 7) {\n\t\t\t\tstrong_enemy = false;\n\t\t\t\tfriend = false;\n\t\t\t\t// check surrounding\n\t\t\t\tcheck_enemy_and_friend(x - 1, y, piece.getStrength(), piece.getColor());\n\t\t\t\tcheck_enemy_and_friend(x + 1, y, piece.getStrength(), piece.getColor());\n\t\t\t\tcheck_enemy_and_friend(x, y - 1, piece.getStrength(), piece.getColor());\n\t\t\t\tcheck_enemy_and_friend(x, y + 1, piece.getStrength(), piece.getColor());\n\n\t\t\t\tif (strong_enemy == false) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (strong_enemy == true && friend == true) {// freezing is solved\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public boolean checkWin() {\n for (int i = 0; i <= 7; i++) {\n for (int j = 0; j <= 4; j++) {\n if (grid[i][j].equals(\"X\") && grid[i][j + 1].equals(\"X\") && grid[i][j + 2].equals(\"X\") && grid[i][j + 3].equals(\"X\")) {\n return true;\n }\n\n\n }\n\n }\n return false;\n }", "@Test\n\tpublic void moveToValidSpace() throws Exception {\n\t\tgame.board.movePiece(knightCorner1Black, 1, 2);\n\t\tgame.board.movePiece(knightCorner2White, 5, 6);\n\t\tgame.board.movePiece(knightSide1Black, 2, 2);\n\t\tgame.board.movePiece(knightSide2White, 4, 5);\n\t\tgame.board.movePiece(knightMiddleWhite, 5, 2);\n\t\tassertEquals(knightCorner1Black, game.board.getPiece(1, 2));\n\t\tassertEquals(knightCorner2White, game.board.getPiece(5, 6));\n\t\tassertEquals(knightSide1Black, game.board.getPiece(2, 2));\n\t\tassertEquals(knightSide2White, game.board.getPiece(4, 5));\n\t\tassertEquals(knightMiddleWhite, game.board.getPiece(5, 2));\n\t}", "public boolean isValidMove(Move move) {\n if (this.gameStarted && isSpaceFree(move) && isPlayerTurn(move)) {\n return true; \n }\n return false; \n }", "public List<Move> validMoves(){\n List<Move> results = new LinkedList<>();\n int kingVal = turn == WHITE ? WHITE_KING : BLACK_KING;\n int kingX = 0, kingY = 0;\n List<Piece> checks = null;\n kingSearch:\n for (int y = 0; y < 8; y++){\n for (int x = 0; x < 8; x++){\n if (board[y][x] == kingVal){\n kingX = x;\n kingY = y;\n checks = inCheck(x,y);\n break kingSearch;\n }\n }\n }\n if (checks.size() > 1){ // must move king\n for (int x = -1; x < 2; x++){\n for (int y = -1; y < 2; y++){\n if (kingX+x >= 0 && kingX + x < 8 && kingY+y >= 0 && kingY+y < 8){\n int val = board[kingY+y][kingX+x];\n if (val == 0 || turn == WHITE && val > WHITE_KING || turn == BLACK && val < BLACK_PAWN){\n // may still be a move into check, must test at end\n results.add(new Move(kingVal, kingX, kingY, kingX+x, kingY+y, val, 0, this));\n }\n }\n }\n }\n } else { // could be in check TODO: split into case of single check and none, identify pin/capture lines\n int queen = turn == WHITE ? WHITE_QUEEN : BLACK_QUEEN;\n int knight = turn == WHITE ? WHITE_KNIGHT : BLACK_KNIGHT;\n int rook = turn == WHITE ? WHITE_ROOK : BLACK_ROOK;\n int bishop = turn == WHITE ? WHITE_BISHOP : BLACK_BISHOP;\n for (int y = 0; y < 8; y++) {\n for (int x = 0; x < 8; x++) {\n int piece = board[y][x];\n if (piece == (turn == WHITE ? WHITE_PAWN : BLACK_PAWN)) { // pawns\n // regular | 2 move\n if (board[y+turn][x] == 0){\n if (y+turn == 0 || y + turn == 7){ // promotion\n results.add(new Move(piece, x, y, x, y + turn, 0, queen, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, knight, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, rook, this));\n results.add(new Move(piece, x, y, x, y + turn, 0, bishop, this));\n }\n else {\n results.add(new Move(piece, x, y, x, y + turn, 0, 0, this));\n if ((y == (turn == WHITE ? 1 : 6)) && board[y + 2 * turn][x] == 0) { // initial 2 move\n results.add(new Move(piece, x, y, x, y + 2*turn, 0, 0, this));\n }\n }\n }\n // capture\n for (int dx = -1; dx <= 1; dx += 2){\n if (x + dx >= 0 && x + dx < 8) {\n int val = board[y+turn][x+dx];\n if (val > 0 && (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n if (y + turn == 0 || y + turn == 7){ // promotion\n results.add(new Move(piece, x, y, x+dx, y + turn, val, queen, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, knight, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, rook, this));\n results.add(new Move(piece, x, y, x+dx, y + turn, val, bishop, this));\n } else {\n results.add(new Move(piece, x, y, x+dx, y + turn, val, 0, this));\n }\n }\n if (val == 0 && y == (turn == WHITE ? 4 : 3) && x+dx == enPassant){ // en passant\n results.add(new Move(piece, x, y, x+dx, y + turn, 0, 0, this));\n }\n }\n }\n\n } else if (piece == knight) { // knights TODO: lookup table\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -2; dy <= 2; dy += 4){\n if (x+dx >= 0 && x + dx < 8 && y + dy >= 0 && y + dy < 8){\n int val = board[y+dy][x+dx];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dx,y+dy,val,0,this));\n }\n }\n if (x+dy >= 0 && x + dy < 8 && y + dx >= 0 && y + dx < 8){\n int val = board[y+dx][x+dy];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dy,y+dx,val,0,this));\n }\n }\n }\n }\n } else if (piece == bishop) { // bishops\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (x + dx*i >= 0 && x + dx*i < 8 && y + dy*i >= 0 && y + dy*i < 8){\n int val = board[y+dy*i][x+dx*i];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == rook) { // rooks\n for (int dx = -1; dx <= 1; dx+= 2){\n for (int ax = 0; ax < 2; ax++){\n int i = 1;\n while (ax==0 ? y+dx*i >= 0 && y+dx*i < 8 : x+dx*i >= 0 && x+dx*i < 8){\n int val = board[y+dx*i*(1-ax)][x+dx*i*ax];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == (turn == WHITE ? WHITE_QUEEN : BLACK_QUEEN)) { // queens\n // Diagonals - same as bishops\n for (int dx = -1; dx <= 1; dx += 2){\n for (int dy = -1; dy <= 1; dy += 2){\n int i = 1;\n while (x + dx*i >= 0 && x + dx*i < 8 && y + dy*i >= 0 && y + dy*i < 8){\n int val = board[y+dy*i][x+dx*i];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i,y+dy*i,val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n for (int dx = -1; dx <= 1; dx+= 2){\n for (int ax = 0; ax < 2; ax++){\n int i = 1;\n while (ax==0 ? y+dx*i >= 0 && y+dx*i < 8 : x+dx*i >= 0 && x+dx*i < 8){\n int val = board[y+dx*i*(1-ax)][x+dx*i*ax];\n if (val == 0){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n } else {\n if (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN){\n results.add(new Move(piece,x,y,x+dx*i*ax,y+dx*i*(1-ax),val,0,this));\n }\n break;\n }\n i++;\n }\n }\n }\n } else if (piece == (turn == WHITE ? WHITE_KING : BLACK_KING)) { // king\n for (int dx = -1; dx < 2; dx++){\n for (int dy = -1; dy < 2; dy++){\n if ((dx != 0 || dy != 0) && x+dx >= 0 && x + dx < 8 && y + dy >= 0 && y + dy < 8){\n int val = board[y+dy][x+dx];\n if (val == 0 || (turn == WHITE ? val > WHITE_KING : val < BLACK_PAWN)){\n results.add(new Move(piece,x,y,x+dx,y+dy,val,0,this));\n }\n }\n }\n }\n }\n }\n }\n // castle\n if (checks.size() == 0){\n if (turn == WHITE && (castles & 0b11) != 0){//(castles[0] || castles[1])){\n board[0][4] = 0; // remove king to avoid check test collisions with extra king\n if ((castles & WHITE_SHORT) != 0 && board[0][5] == 0 && board[0][6] == 0 && inCheck(5,0).size() == 0){\n //if (castles[0] && board[0][5] == 0 && board[0][6] == 0 && inCheck(5,0).size() == 0){\n results.add(new Move(WHITE_KING, 4, 0, 6, 0, 0, 0, this));\n }\n if ((castles & WHITE_LONG) != 0 && board[0][1] == 0 && board[0][2] == 0 && board[0][3] == 0 &&\n inCheck(3,0).size() == 0){\n //if (castles[1] && board[0][1] == 0 && board[0][2] == 0 && board[0][3] == 0 && inCheck(3,0).size() == 0){\n results.add(new Move(WHITE_KING, 4, 0, 2, 0, 0, 0, this));\n }\n board[0][4] = WHITE_KING;\n }else if (turn == BLACK && (castles & 0b1100) != 0){//(castles[2] || castles[3])) {\n board[7][4] = 0; // remove king to avoid check test collisions with extra king\n //if (castles[2] && board[7][5] == 0 && board[7][6] == 0 && inCheck(5, 7).size() == 0) {\n if ((castles & BLACK_SHORT) != 0 && board[7][5] == 0 && board[7][6] == 0 && inCheck(5, 7).size() == 0) {\n results.add(new Move(BLACK_KING, 4, 7, 6, 7, 0, 0, this));\n }\n //if (castles[3] && board[7][1] == 0 && board[7][2] == 0 && board[7][3] == 0 && inCheck(3, 7).size() == 0) {\n if ((castles & BLACK_LONG) != 0 && board[7][1] == 0 && board[7][2] == 0 && board[7][3] == 0 &&\n inCheck(3, 7).size() == 0) {\n results.add(new Move(BLACK_KING, 4, 7, 2, 7, 0, 0, this));\n }\n board[7][4] = BLACK_KING;\n }\n }\n }\n List<Move> fullLegal = new LinkedList<>();\n for (Move m : results){\n makeMove(m);\n turn = -turn;\n if (m.piece == WHITE_KING || m.piece == BLACK_KING){\n if (inCheck(m.toX,m.toY).size() == 0){\n fullLegal.add(m);\n }\n }else if (inCheck(kingX,kingY).size() == 0){\n fullLegal.add(m);\n }\n turn = -turn;\n undoMove(m);\n }\n Collections.sort(fullLegal, (o1, o2) -> o2.score - o1.score); // greatest score treated as least so appears first\n return fullLegal;\n }", "private void checkMove(Tile[][] chessBoard, int pawnX, int pawnY, int direction) {\r\n\t\tUnit unit = chessBoard[pawnX][pawnY+direction].getPiece();\r\n\t\tif (unit == null) {\r\n\t\t\tMoves move = new Moves(pawnX, pawnY+direction);\r\n\t\t\tinsertMove(move, moveList);\r\n\t\t}\r\n\t}", "private boolean fail(Piece piece) {\n\n // To store the moving over\n int localColumnPos = columnPos - piece.getShift();\n\n // If the piece will go outside the bounds of the board, return false\n if (piece.getMatrix().length + rowPos > board.length ||\n piece.getMatrix()[0].length + localColumnPos > board[0].length || localColumnPos < 0) return true;\n\n // Check for no true true collisions\n for (int i = 0; i < piece.getMatrix().length; i++) {\n for (int j = 0; j < piece.getMatrix()[0].length; j++) {\n // If there is a true + true anywhere, do not add piece\n if (piece.getMatrix()[i][j] && board[i + rowPos][j + localColumnPos]) return true;\n }\n }\n return false;\n }", "private void CheckWin() throws VictoryException {\n if (!isMiddleSquareEmpty()) {\n checkDiagonalTopRightToBottomLeft();\n checkDiagonalTopLeftToBottomRight();\n }\n\n checkHorozontalWin();\n checkVercticalWin();\n\n if (didAnyoneWin) {resetBoard(myGame);\n throw (new VictoryException());\n }\n }", "public boolean isCheck()\n {\n Game g = Game.getInstance();\n\n for(Piece[] p1 : g.m_board.m_pieces)\n {\n for(Piece p2 : p1)\n {\n if(p2 == null){ continue; }\n if(g.containsMove(new Move(m_x, m_y), p2.getMoves()))\n return true;\n }\n }\n\n return false;\n }", "public void setValidMoves(Board board, int x, int y, int playerType) {\n\t\tmoves.clear();\n\t\t// if this is pawn's first move, it can move two squares forward\n\t\tif (firstMove == true)\n\t\t{\n\t\t\t// white moves forward with y++\n\t\t\tif(this.getPlayer() == 1)\n\t\t\t{\n\t\t\t\tPoint firstMove = new Point(x + 0, y + 2);\n\t\t\t\tif (board.getPiece(x, y + 1) == null && board.getPiece(x, y + 2) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(firstMove);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// black moves forward with y--\n\t\t\telse\n\t\t\t{\n\t\t\t\tPoint firstMove = new Point(x + 0, y - 2);\n\t\t\t\tif (board.getPiece(x, y - 1) == null && board.getPiece(x, y - 2) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(firstMove);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.getPlayer() == 1)\n\t\t{\n\t\t\t// if a piece is occupying a square diagonal from pawn, it can capture\n\t\t\tif (x + 1 < 8 && y + 1 < 8 && x + 1 >= 0 && y + 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 1, y + 1);\n\t\t\t\tif (board.getPiece(x + 1, y + 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x+1,y+1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x - 1 < 8 && y + 1 < 8 && x - 1 >= 0 && y + 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x - 1, y + 1);\n\t\t\t\tif (board.getPiece(x - 1, y + 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x - 1, y + 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// if no piece is in front of pawn, it can move forward one square\n\t\t\tif (x < 8 && y + 1 < 8 && x >= 0 && y + 1 >=0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 0, y + 1);\n\t\t\t\tif (board.getPiece(x, y + 1) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if a piece is occupying a square diagonal from pawn, it can capture\n\t\t\tif (x + 1 < 8 && y - 1 < 8 && x + 1 >= 0 && y - 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 1, y - 1);\n\t\t\t\tif (board.getPiece(x + 1, y - 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x + 1,y - 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x - 1 < 8 && y - 1 < 8 && x - 1 >= 0 && y - 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x - 1, y - 1);\n\t\t\t\tif (board.getPiece(x - 1, y - 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x - 1, y - 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// if no piece is in front of pawn, it can move forward one square\n\t\t\tif (x < 8 && y - 1 < 8 && x >= 0 && y - 1 >=0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 0, y - 1);\n\t\t\t\tif (board.getPiece(x, y - 1) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "@Test\n public void isValidMoveTest() {\n\n //get the board of the enemy with the method getBoard() from enemyGameBoard\n board = enemyGameBoard.getBoard();\n\n //Try two times for a existing point on the board\n assertTrue(enemyGameBoard.isValidMove(1,1));\n assertTrue(enemyGameBoard.isValidMove(2,4));\n\n //Try two times for a non-existing point on the board\n assertFalse(enemyGameBoard.isValidMove(15,5)); // x-value outside the board range\n assertFalse(enemyGameBoard.isValidMove(5,11)); // y-value outside the board range\n\n //hit a water field\n enemyGameBoard.makeMove(2, 3, false);\n assertTrue(board[2][3].equals(EnemyGameBoard.WATER_HIT));\n\n //try isValidMove() on the already hit water field\n assertFalse(enemyGameBoard.isValidMove(2,3));\n\n //hit a ship field\n enemyGameBoard.makeMove(5, 4, true);\n assertTrue(board[5][4].equals(EnemyGameBoard.SHIP_HIT));\n\n //try isValidMove() on the already hit water field\n assertFalse(enemyGameBoard.isValidMove(5,4));\n }", "public static boolean canPlayerMove(Player player){\r\n int playerX = 0;\r\n int playerY = 0;\r\n int nX;\r\n int nY;\r\n //finding the player on the board\r\n for(int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n if(player.getPosition() == board[i][j]) {\r\n playerX = i;\r\n playerY = j;\r\n }\r\n }\r\n }\r\n //making sure that the player stays on the board\r\n\r\n if(playerY != board[0].length-1) {\r\n nX = playerX;\r\n nY = playerY + 1;\r\n if (board[nX][nY].west && board[playerX][playerY].east && !board[nX][nY].isOnFire) {//if the tile will accept the player\r\n return true;\r\n }\r\n }\r\n\r\n if(playerY != 0) {\r\n nX = playerX;\r\n nY = playerY - 1;\r\n if (board[nX][nY].east && board[playerX][playerY].west && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != 0) {\r\n nX = playerX - 1;\r\n nY = playerY;\r\n if (board[nX][nY].south && board[playerX][playerY].north && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != board.length-1) {\r\n nX = playerX + 1;\r\n nY = playerY;\r\n if (board[nX][nY].north && board[playerX][playerY].south && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public void calculateLegalMoves() {\n //Gets the row and column and call the checkDiagonalMoves method to find what are the piece's legal movements.\n int currentRow = this.getSquare().getRow();\n int currentCol = this.getSquare().getCol();\n checkDiagonalMoves(currentRow, currentCol);\n }", "private boolean isValidSide(int row, int col) {\n\t\treturn (col >= (super.currentPlayer % 2) * 10 && col < ((super.currentPlayer % 2) + 1) * 10 &&\n\t\t\t\tsuper.getGridPieces()[row][col] == null);\n\t}", "public boolean isValid(Board board) {\n if (!from.isValid(board.size) || !to.isValid(board.size)) {\r\n return false;\r\n }\r\n\r\n // Confirm the 'from' space is occupied\r\n if (!board.b[from.row][from.column]) {\r\n return false;\r\n }\r\n\r\n // Confirm the 'to' space is empty\r\n if (board.b[to.row][to.column]) {\r\n return false;\r\n }\r\n\r\n int rowJump = Math.abs(from.row - to.row);\r\n int colJump = Math.abs(from.column - to.column);\r\n\r\n if (rowJump == 0) {\r\n if (colJump != 2) {\r\n return false;\r\n }\r\n }\r\n else if (rowJump == 2) {\r\n if (colJump != 0 && colJump != 2) {\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n\r\n // Confirm the 'step' space is occupied\r\n return board.b[(from.row + to.row) / 2][(from.column + to.column) / 2];\r\n }", "public void isMoveLegal(int row, int col) \r\n\t\t\tthrows IllegalMoveException {\r\n\t\tif(row < 0 || row > 7 || col < 0 || col > 7){\r\n\t\t\tthrow new IllegalMoveException();\r\n\t\t}\r\n\t}", "private boolean validate(int row, int col, int num){\n\t\t\n\t\t// Check vertical \n\t\tfor( int r = 0; r < 9; r++ ){\n\t\t\tif(puzzle[r][col] == num ){\n\t\n\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check horizontal\n\t\tfor( int c = 0; c < 9; c++ ){\n\t\t\tif(puzzle[row][c] == num ){\n\t\t\t\n\t\t\t\treturn false ; \n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check sub board\n\t\tint subrow = (row / 3) * 3 ;\n\t\tint subcol = (col / 3) * 3 ;\n\t\t\n\t\tfor( int r = 0; r < 3; r++ ){\n\t\t for( int c = 0; c < 3; c++ ){\n\t\t\t \n\t\t\t if(puzzle[subrow+r][subcol+c] == num ){\n\n\t\t\t return false ;\n\t\t\t }\n\t\t }\n\t\t}\n\t\t\n\t\treturn true;\n\t\n\t}", "public boolean isValid(Board b) {\n\t\tPosition from = move.oldPosition();\n\t\tPosition to = move.newPosition();\n\n\t\tif (b.pieceAt(from) instanceof Pawn) {\n\t\t\tif (this.isWhite() && to.row() == 8) {\n\t\t\t\treturn true;\n\t\t\t} else if (!this.isWhite() && to.row() == 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "private boolean anyMove (int x,int y, OthelloPiece colour){\n boolean valid = false;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_1,colour)) valid=true;\n return (valid);\n }", "private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private boolean isBoardFull() {\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n if (boardState[i][j] != 'X' && boardState[i][j] != 'O') {\n return false; \n }\n }\n }\n return true; \n }", "public boolean meWin(){\n return whitePieces.size() > blackPieces.size() && isWhitePlayer;\n }", "private boolean canMove(String direction) {\n\t\tif (currentPiece.getLocation() == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (Loc loc : currentPiece.getLocation()) {\n\t\t\tLoc nextPoint = nextPoint(loc, direction);\n\t\t\tif (nextPoint == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// if there's someone else's piece blocking you\n\t\t\tif ((new Loc(nextPoint.row, nextPoint.col).isOnBoard())\n\t\t\t\t\t&& boardTiles[nextPoint.row][nextPoint.col] != backgroundColor && !isMyPiece(nextPoint)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "private boolean validMove(GameWorld world, Character nextKey) {\n if (nextKey.equals('Q') || nextKey.equals('q') || nextKey.equals(':')) {\n return true;\n } else if (nextKey.equals('W') || nextKey.equals('w')) {\n if (world.world[world.avatarPosition.x]\n [world.avatarPosition.y + 1].equals(Tileset.WALL)) {\n return false;\n }\n } else if (nextKey.equals('S') || nextKey.equals('s')) {\n if (world.world[world.avatarPosition.x]\n [world.avatarPosition.y - 1].equals(Tileset.WALL)) {\n return false;\n }\n } else if (nextKey.equals('D') || nextKey.equals('d')) {\n if (world.world[world.avatarPosition.x + 1]\n [world.avatarPosition.y].equals(Tileset.WALL)) {\n return false;\n }\n } else if (nextKey.equals('A') || nextKey.equals('a')) {\n if (world.world[world.avatarPosition.x - 1]\n [world.avatarPosition.y].equals(Tileset.WALL)) {\n return false;\n }\n } else {\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean valid(Solitaire game) {\n\t\tif (crosspile.empty())\n\t\t\treturn true;\n\t\tif ((crosspile.peek().isAce()) && (cardBeingDragged.getRank() == cardBeingDragged.KING))\n\t\t\treturn true;\n\t\tif ((cardBeingDragged.getRank() == crosspile.rank() - 1))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isValidMove(int toRow,int toCol){\n //Stayed in the same spot\n if(myRow == toRow && myCol == toCol){\n return false;\n }\n //if the xy coordinate we are moving to is outside the board\n if(toRow < 0 || toRow > 11 || toCol < 0 || toCol > 11){\n return false;\n }\n return true;\n }", "public boolean isMoveLegal() {\n if (!getGame().getBoard().contains(getFinalCoords())) {\n return false;\n }\n\n // for aero units move must use up all their velocity\n if (getEntity() instanceof Aero) {\n Aero a = (Aero) getEntity();\n if (getLastStep() == null) {\n if ((a.getCurrentVelocity() > 0) && !getGame().useVectorMove()) {\n return false;\n }\n } else {\n if ((getLastStep().getVelocityLeft() > 0) && !getGame().useVectorMove()\n && !(getLastStep().getType() == MovePath.MoveStepType.FLEE\n || getLastStep().getType() == MovePath.MoveStepType.EJECT)) {\n return false;\n }\n }\n }\n\n if (getLastStep() == null) {\n return true;\n }\n\n if (getLastStep().getType() == MoveStepType.CHARGE) {\n return getSecondLastStep().isLegal();\n }\n if (getLastStep().getType() == MoveStepType.RAM) {\n return getSecondLastStep().isLegal();\n }\n return getLastStep().isLegal();\n }", "public boolean checkCheck(Player p){\n\t\tPosition position = null;\n\t\tfor (int i = Position.MAX_ROW; i >= Position.MIN_ROW; i--) {\n\t\t\tfor (char c = Position.MIN_COLUMN; c <= Position.MAX_COLUMN; c++) {\n\t Piece piece = gameState.getPieceAt(String.valueOf(c) + i);\n\t if(piece!=null &&piece.getClass().equals(King.class) && piece.getOwner()==p){\n\t \tposition = new Position(c,i);\n\t \tbreak;\n\t }\n\t\t\t}\n\t\t}\n\t\t//Find out if a move of other player contains position of king\n\t\tList<Move> moves = gameState.listAllMoves(p==Player.Black?Player.White:Player.Black,false);\n\t\tfor(Move move : moves){\n\t\t\tif(move.getDestination().equals(position)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public boolean validPosition(Player p, double x, double y) {\n\n\t\tTile tile = getTile(p, x + p.BOUNDING_BOX_X, y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x, y + p.BOUNDING_BOX_Y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x - p.BOUNDING_BOX_X, y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x, y - p.BOUNDING_BOX_Y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n public boolean currentPlayerHavePotentialMoves() {\n return !checkersBoard.getAllPotentialMoves(getCurrentPlayerIndex()).isEmpty();\n }", "public boolean hasPiece(int x, int y)\r\n {\r\n return isValidSqr(x, y) && board[x][y] != null;\r\n }", "private static void checkFreeSpace()\n {\n boolean isSpaceAvailable = false;\n int numOfFreeSpaces = 0;\n for(int index=1;index<board.length;index++)\n {\n if((board[index] == ' '))\n {\n isSpaceAvailable = true;\n numOfFreeSpaces++;\n }\n }\n if(isSpaceAvailable == false)\n {\n System.err.println(\"Board is full! You can't make another move\");\n System.exit(0);\n }\n else\n {\n System.out.println(\"Free space is available! you have \"+numOfFreeSpaces+ \" moves left\");\n }\n }", "public static boolean isLegal(int[][] board) {\nif (!isRectangleLegal(board, 0, 2, 0, 2, \"Block 1\")) return false;\nif (!isRectangleLegal(board, 3, 5, 0, 2, \"Block 2\")) return false;\nif (!isRectangleLegal(board, 6, 8, 0, 2, \"Block 3\")) return false;\nif (!isRectangleLegal(board, 0, 2, 3, 5, \"Block 4\")) return false;\nif (!isRectangleLegal(board, 3, 5, 3, 5, \"Block 5\")) return false;\nif (!isRectangleLegal(board, 6, 8, 3, 5, \"Block 6\")) return false;\nif (!isRectangleLegal(board, 0, 2, 6, 8, \"Block 7\")) return false;\nif (!isRectangleLegal(board, 3, 5, 6, 8, \"Block 8\")) return false;\nif (!isRectangleLegal(board, 6, 8, 6, 8, \"Block 9\")) return false;\n \n// check the nine columns\nif (!isRectangleLegal(board, 0, 0, 0, 8, \"Column 0\")) return false;\nif (!isRectangleLegal(board, 1, 1, 0, 8, \"Column 1\")) return false;\nif (!isRectangleLegal(board, 2, 2, 0, 8, \"Column 2\")) return false;\nif (!isRectangleLegal(board, 3, 3, 0, 8, \"Column 3\")) return false;\nif (!isRectangleLegal(board, 4, 4, 0, 8, \"Column 4\")) return false;\nif (!isRectangleLegal(board, 5, 5, 0, 8, \"Column 5\")) return false;\nif (!isRectangleLegal(board, 6, 6, 0, 8, \"Column 6\")) return false;\nif (!isRectangleLegal(board, 7, 7, 0, 8, \"Column 7\")) return false;\nif (!isRectangleLegal(board, 8, 8, 0, 8, \"Column 8\")) return false;\n \n// check the nine rows\nif (!isRectangleLegal(board, 0, 8, 0, 0, \"Row 0\")) return false;\nif (!isRectangleLegal(board, 0, 8, 1, 1, \"Row 1\")) return false;\nif (!isRectangleLegal(board, 0, 8, 2, 2, \"Row 2\")) return false;\nif (!isRectangleLegal(board, 0, 8, 3, 3, \"Row 3\")) return false;\nif (!isRectangleLegal(board, 0, 8, 4, 4, \"Row 4\")) return false;\nif (!isRectangleLegal(board, 0, 8, 5, 5, \"Row 5\")) return false;\nif (!isRectangleLegal(board, 0, 8, 6, 6, \"Row 6\")) return false;\nif (!isRectangleLegal(board, 0, 8, 7, 7, \"Row 7\")) return false;\nif (!isRectangleLegal(board, 0, 8, 8, 8, \"Row 8\")) return false;\nreturn true;\n }", "public static boolean isBasicMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\t/*Checking if coordinates are OK*/\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*Checks if the tile is empty*/\r\n\t\t\t\tif (player==1){/*Checks if player is red*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==1){/*Checks if in tile there is soldier red */\r\n\t\t\t\t\t\tif(fromRow==toRow-1&&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally upward*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\tif (board[fromRow][fromCol]==2){/*Checks if in tile there is queen red*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif (player==-1){/*Checks if player is blue*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-1){/*Checks if in tile there is soldier blue */\r\n\t\t\t\t\t\tif(fromRow==toRow+1&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally down*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-2){/*Checks if in tile there is queen blue*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "private boolean canMove(Point piece){\r\n // direction -1: red pieces +1: black pieces\r\n int dir = isRed(piece)? -1:+1;\r\n // normal movement\r\n Point left = new Point(piece.getFirst() + dir, piece.getSecond() - 1);\r\n Point right = new Point(piece.getFirst() + dir, piece.getSecond() + 1);\r\n // check for normal movements\r\n if(isValidPosition(left) && isEmpty(left)) return true;\r\n if(isValidPosition(right) && isEmpty(right)) return true;\r\n // if is a queen\r\n if(isQueen(piece)){\r\n // compute queen move points (invert direction)\r\n Point leftQ = new Point(piece.getFirst() - dir, piece.getSecond() - 1);\r\n Point rightQ = new Point(piece.getFirst() - dir, piece.getSecond() + 1);\r\n // check for down movements\r\n if(isValidPosition(leftQ) && isEmpty(leftQ)) return true;\r\n if(isValidPosition(rightQ) && isEmpty(rightQ)) return true;\r\n }\r\n return false;\r\n }", "public boolean validRook (int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t\n\t\tint distanceMovedUpDown =endRow-startRow; \n\t\tint distanceMovedLeftRight = endColumn-startColumn;\n\n\t\tif (distanceMovedUpDown !=0 && distanceMovedLeftRight != 0) { //have to stay in the same column or row to be valid\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif (startRow == endRow) { //moving left or right \n\t\t\tif (Math.abs(distanceMovedLeftRight) > 1) { //checking if there's pieces btwn start and end if moving more than 1\n\t\t\t\tif (distanceMovedLeftRight > 0) {//moving to the right \n\t\t\t\t\tint x=startColumn + 1;\n\t\t\t\t\twhile (x < endColumn) {\n\t\t\t\t\t\tif (board[startRow][x].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif (distanceMovedLeftRight < 0) {//moving to the left\n\t\t\t\t\tint x = startColumn -1;\n\t\t\t\t\twhile (x > endColumn) {\n\t\t\t\t\t\tif (board[startRow][x].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn true;\n\n\t\t}\n\t\tif (startColumn == endColumn) { //moving up or down\n\t\t\tif (Math.abs(distanceMovedUpDown) > 1) { //checking if there's pieces btwn start and end if moving more than 1\n\t\t\t\tif (distanceMovedUpDown > 0) {//moving up the array\n\t\t\t\t\tint x=startRow + 1;\n\t\t\t\t\twhile (x < endRow) {\n\t\t\t\t\t\tif (board[x][startColumn].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif (distanceMovedUpDown < 0) {//moving down the array\n\t\t\t\t\tint x = startRow -1;\n\t\t\t\t\twhile (x > endRow) {\n\t\t\t\t\t\tif (board[x][startColumn].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}", "boolean isValidLoop(int xPos, int yPos, boolean valid){\r\n\t\tfor (int j = 0; j < ChessBoard.bauer.length; j++)\r\n\t\t\tif (xPos == ChessBoard.bauer[j].xPos && yPos == ChessBoard.bauer[j].yPos)\r\n\t\t\t\tvalid = true;\r\n\t\tfor (int j = 0; j < ChessBoard.turm.length; j++)\r\n\t\t\tif (xPos == ChessBoard.turm[j].xPos && yPos == ChessBoard.turm[j].yPos)\r\n\t\t\t\tvalid = true;\r\n\t\tfor (int j = 0; j < ChessBoard.springer.length; j++)\r\n\t\t\tif (xPos == ChessBoard.springer[j].xPos && yPos == ChessBoard.springer[j].yPos)\r\n\t\t\t\tvalid = true;\r\n\t\tfor (int j = 0; j < ChessBoard.läufer.length; j++)\r\n\t\t\tif (xPos == ChessBoard.läufer[j].xPos && yPos == ChessBoard.läufer[j].yPos)\r\n\t\t\t\tvalid = true;\r\n\t\tfor (int j = 0; j < ChessBoard.dame.length; j++)\r\n\t\t\tif (xPos == ChessBoard.dame[j].xPos && yPos == ChessBoard.dame[j].yPos)\r\n\t\t\t\tvalid = true;\r\n\t\tfor (int j = 0; j < ChessBoard.könig.length; j++)\r\n\t\t\tif (xPos == ChessBoard.könig[j].xPos && yPos == ChessBoard.könig[j].yPos)\r\n\t\t\t\tvalid = true;\r\n\t\treturn valid;\r\n\t}", "protected boolean hasSpace(int[][] gameboard, int col, int row){\r\n\t\tint count = 0;\r\n\t\tint i = col;\r\n\t\tboolean valid = false;\r\n\t\t\r\n\t\tif (col + size < 10) {\r\n\t\t\tfor(int j = 0; j < size; j++){\r\n\t\t\t\tif(gameboard[i][row] == -1){\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count == size){\r\n\t\t\t\tvalid = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}", "boolean isLegal(Move move) {\n int count = pieceCountAlong(move);\n int c0 = move.getCol0();\n int r0 = move.getRow0();\n int c1 = move.getCol1();\n int r1 = move.getRow1();\n int count2 = Math.max(Math.abs(c1 - c0), Math.abs(r1 - r0));\n return ((count == count2) && !blocked(move));\n }", "public boolean validMove(int row, int col) {\n // kijken of de rij en kolom leeg zijn\n if (board2d[row][col] != 0) {\n return false;\n }\n return true;\n }", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX());\r\n int y = Math.abs(from.getY() - to.getY());\r\n // to check if the move is 1unit vertically or horizontally\r\n if (x + y == 1) {\r\n return true;\r\n }else if (x == y && x == 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "public boolean hasMoves() {\n if(color != 0){\n activePieces = getPiece();\n\n for(int i = 0; i < activePieces.size(); i++){\n Piece curr = activePieces.get(i);\n\n if(curr.possibleMoves(state).size() > 0){\n //curr.printSpecial();\n return true;\n }\n }\n return false;\n }\n System.out.println(\"Empty stop error\");\n return false;\n }", "public boolean isMoveLegal(int x, int y) {\n\t\tif (rowSize <= x || colSize <= y || x < 0 || y < 0) {\r\n\t\t\t// System.out.print(\"Position (\" + (x + 1) + \", \" + (y + 1) + \") is\r\n\t\t\t// out of range!\\n\");\r\n\t\t\treturn false;\r\n\t\t} else if (!(matrix[x][y] == 0)) {\r\n\t\t\t// System.out.print(\"Position (\" + (x + 1) + \", \" + (y + 1) + \") has\r\n\t\t\t// been occupied!\\n\");\r\n\t\t\treturn false;\r\n\t\t} else\r\n\t\t\treturn true;\r\n\t}", "public boolean withinChessboard(String column,int row)\r\n {\r\n boolean sw=false,exit=false;\r\n\r\n ChessBoard.ColumnLetter l= ChessBoard.ColumnLetter.valueOf(column.toUpperCase());//converts String to ColumnLetter for the enum\r\n switch(l)\r\n {\r\n case A:\r\n if(row<=maxRow && row>=minRow) //if the row is within the parameters then is valid\r\n {\r\n System.out.println(\"Location is valid \");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n case B:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid \");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case C:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid \");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case D:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid...\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case E:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case F:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid..\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case G:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid.\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case H:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid,\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n default:\r\n System.out.println(\"That location is not within the board\");\r\n }\r\n if(sw==false) {// if the location was not valid it will ask the user for another location\r\n return false;\r\n } else {\r\n return true;// if user doesn't want to input another location the method will end\r\n }\r\n\r\n\r\n }", "@Override\r\n\tpublic boolean isMoveValid(Game g, Location from, Location to){\n\t\tColor toColor = g.getColor(to);\r\n\t\tColor fromColor = g.getColor(from);\r\n\t\tswitch(toColor){\r\n\t\tcase RED:\r\n\t\t\tif (fromColor == Color.BLACK){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase BLACK:\r\n\t\t\tif (fromColor == Color.RED){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t//cannot make a movement if the from location is empty\r\n\t\t//cannot move if the piece belongs to the opponent\r\n\t\tswitch(g.getPlayerInTurn()){\r\n\t\tcase RED:\r\n\t\t\tif(fromColor != Color.RED){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase BLACK:\r\n\t\t\tif(fromColor != Color.BLACK){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t//just return something is wrong anyways...\r\n\t\tdefault:\r\n\t\t\treturn false;\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public int checkField() {\n //check win & impossible win\n if (checkDiagWin(X) || checkRowColWin(X)) {\n return 1; // X wins\n } else if (checkDiagWin(O) || checkRowColWin(O)) {\n return 2; // O wins\n }\n\n //check draw or not finished\n for (int i = 0; i < SIZE; i++) {\n for (int j = 0; j < SIZE; j++) {\n if (gameField[i][j] == ' ' || gameField[i][j] == '_') {\n return 0; // Not finished\n }\n }\n }\n return 3; // Draw\n }", "private boolean checkMoveBase(Pieces piece, Coordinates from, Coordinates to) {\n\t\t//seleziono una posizione senza pedina\n\t\tif ( piece == null )\n\t\t\treturn false;\n\n\t\t//se la posizione tu non è contenuta nelle soluzioni valide della pedina from\n\t\tif ( !piece.validPositions(from).contains(to) )\n\t\t\treturn false;\n\n\t\t//se la posizione di destinazione contiene una pedina dello stesso colore\n\t\treturn !( chessboard.at(to) != null && chessboard.at(to).getColour().equals(piece.getColour()));\n\t}", "protected boolean validMove(TetrisPiece piece, int rot, int gridRow, int gridCol) {\n\t\tif(detectOutOfBounds(piece, rot, gridRow, gridCol)) {\n\t\t\treturn false;\n\t\t}\n\t\tif(detectCollision(piece, rot, gridRow, gridCol)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true; \n\t}", "boolean canMove (int newRow, int newColumn, Piece piece) {\n for (int r = 0; r < piece.height; ++r)\n for (int c = 0; c < piece.width; ++c) {\n if (piece.blocks[r][c] == 1 && !board.isEmpty(newRow + r, newColumn + c))\n return false;\n }\n return true;\n }", "@Override\n\tpublic Collection<Move> calculateLegalMoves(final Board board) {\n\t\t\n\t\t//Array that will hold of the legal moves for the Pawn\n\t\tfinal List<Move> legalMoves = new ArrayList<>();\n\t\t\n\t\t//Loop through all possible moves by applying of the offsets to the Pawn's current position\n\t\tfor(final int currentCandidateOffset: CANDIDATE_MOVE_COORDINATES){\n\t\t\t\n\t\t\t//Apply the offset to the Pawn's current position\n\t\t\tfinal int candidateDestinationCoordinate = this.piecePosition + (this.getPieceTeam().getDirection() * currentCandidateOffset);\n\t\t\t\n\t\t\t//Checks if the Destination Coordinate is valid\n\t\t\tif(!BoardUtils.isValidTileCoordinate(candidateDestinationCoordinate)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Checks if this tile is occupied\n\t\t\tif(currentCandidateOffset == 8 && !board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnMove(board, this, candidateDestinationCoordinate)));\n\t\t\t\telse\n\t\t\t\t\tlegalMoves.add(new Move.PawnMove(board, this, candidateDestinationCoordinate));\t\n\t\t\t}\n\t\t\t//Checks if the Pawn is on it's first move\n\t\t\telse if(currentCandidateOffset == 16 && this.isFirstMove() && ((BoardUtils.SEVENTH_RANK[this.piecePosition] && \n\t\t\t\t\tthis.getPieceTeam().isBlack()) || (BoardUtils.SECOND_RANK[this.piecePosition] && this.getPieceTeam().isWhite()))) {\n\t\t\t\t\n\t\t\t\t//Calculate coordinate of the tile behind candidate coordinate\n\t\t\t\tfinal int behindCandidateDestinationCoordinate = this.piecePosition + (this.pieceTeam.getDirection() * 8);\n\t\t\t\t\n\t\t\t\t//Checks if the tile behind the candidate destination is NOT occupied & if the Tile at the Candidate Destination is NOT occupied\n\t\t\t\tif(!board.getTile(behindCandidateDestinationCoordinate).isTileOccupied() && \n\t\t\t !board.getTile(candidateDestinationCoordinate).isTileOccupied())\n\t\t\t\t\t\tlegalMoves.add(new Move.PawnJump(board, this, candidateDestinationCoordinate));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Checks for edge cases in the 7 direction\t\n\t\t\t} else if(currentCandidateOffset == 7 &&\n\t\t\t\t\t!((BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t\n\t\t\t\t//This basically checks if En Passant Pawn is next to Player's pawn\t\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition + (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//Checks for edge cases in the 9 direction\t\n\t\t\t} else if(currentCandidateOffset == 9 && \n\t\t\t\t\t!((BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition - (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn ImmutableList.copyOf(legalMoves);\n\t}", "private String checkLegalMove(PieceType piece, Location from, Location to) {\n\t\t// Create a string to store the error message in case the move is\n\t\t// invalid.\n\t\tString errorMessage = null;\n\n\t\t// Check that none of the arguments are null.\n\t\tif (piece == null || from == null || to == null) {\n\t\t\terrorMessage = \"Arguments to the move method must not be null.\";\n\t\t\treturn errorMessage;\n\t\t}\n\n\t\t// Make sure that the game has been started first\n\t\tif (!gameStarted) {\n\t\t\terrorMessage = \"Cannot make a move before the game has started.\";\n\t\t\treturn errorMessage;\n\t\t}\n\n\t\t// Get the piece from the from location that is attempting to move.\n\t\tfinal Piece movingPiece = gameBoard.getPieceAt(from);\n\n\t\t// Check whether the move is a valid move on the board.\n\t\terrorMessage = gameBoard.checkValidMove(piece, from, to);\n\t\tif (errorMessage != null) {\n\t\t\treturn errorMessage;\n\t\t}\n\n\t\t// A piece that is not the color whose turn it is cannot move.\n\t\tif (movingPiece.getOwner() != currentTurnColor) {\n\t\t\terrorMessage = \"You cannot move when it is not you turn.\";\n\t\t\treturn errorMessage;\n\t\t}\n\n\t\treturn null;\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to){\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX()); \r\n int y = Math.abs(from.getY() - to.getY()); \r\n if(( x == 2 && y == 1 ) || ( x == 1 && y == 2 )){\r\n return true; \r\n }\r\n\r\n return false;\r\n }", "static boolean isSolved() {\n\t\tfor (int i=0; i<Play.NUM[TOTAL]; i++) {\t\n\t\t\tif (!isPieceCorrect(Play.jigsawPieces.get(i))) { //check if the piece is in the correct position and orientation\n\t\t\t\treturn false; //return if even once piece is not\n\t\t\t}\n\t\t}\n\t\treturn true; //if the method reached here, then it means that all the pieces are correctly placed\n\t}", "boolean hasMove(Piece side) {\r\n List<Move> listOfLegalMoves = legalMoves(side);\r\n return listOfLegalMoves != null;\r\n }", "private boolean moveCheck(Piece p, List<Move> m, int fC, int fR, int tC, int tR) {\n if (null == p) {\n // Legal move!\n m.add(new Move(fC, fR, tC, tR));\n // Continue checking for moves.\n return false;\n }\n if (p.owner != whoseTurn) {\n // Enemy sighted!\n // Legal move!\n m.add(new Move(fC, fR, tC, tR));\n // No more moves!\n }\n return true;\n }", "@Override\n\tpublic boolean validMove(int xEnd, int yEnd, board b){\n\t\t//try to land one same color piece\n\t\tif(b.occupied(xEnd, yEnd)&&b.getPiece(xEnd, yEnd).getColor()==color){\n\t\t\treturn false;\n\t\t}\n\t\tif(v==0){\n\t\t\tif(!this.guard(xEnd, yEnd, b)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//normal move\n\t\tif((xEnd==x-1&&yEnd==y-1)||(xEnd==x-1&&yEnd==y)||(xEnd==x-1&&yEnd==y+1)||(xEnd==x&&yEnd==y-1)||(xEnd==x&&yEnd==y+1)||(xEnd==x+1&&yEnd==y-1)||(xEnd==x+1&&yEnd==y)||(xEnd==x+1&&yEnd==y+1)){\n\t\t\tif(b.occupied(xEnd, yEnd)){\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tb.recycle(xEnd, yEnd);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else if((xEnd==x-2&&yEnd==y)){ //castling\n\t\t\tpiece r = b.getPiece(0, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=3;i>0;i--){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(3,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else if((xEnd==x+2&&yEnd==y)){\n\t\t\tpiece r = b.getPiece(7, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=5;i<=6;i++){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(5,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }", "public boolean validBish (int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t\n\n\t\tif (Math.abs(startRow-endRow)==Math.abs(startColumn-endColumn)) {\n\t\t\tint distanceMovedRows = startRow-endRow;\n\t\t\tint distanceMovedCols =startColumn-endColumn;\n\t\t\tif (distanceMovedRows > 0 && distanceMovedCols < 0) {\n\n\t\t\t\tint x=startRow-1;\n\t\t\t\tint y = startColumn+1;\n\t\t\t\twhile (x > endRow && y < endColumn) { \n\t\t\t\t\tif (board[x][y].getOccupyingPiece() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tx--; y++;\n\t\t\t\t}\n\t\t\t} \n\t\t\tif (distanceMovedRows > 0 && distanceMovedCols > 0) { \n\n\t\t\t\tint x=startRow-1;\n\t\t\t\tint y = startColumn-1;\n\t\t\t\twhile (x > endRow && y > endColumn) {\n\t\t\t\t\tif (board[x][y].getOccupyingPiece() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tx--; y--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (distanceMovedRows < 0 && distanceMovedCols < 0) {\n\n\t\t\t\tint x=startRow+1;\n\t\t\t\tint y = startColumn+1;\n\n\t\t\t\twhile (x < endRow && y < endColumn) {\n\t\t\t\t\tif (board[x][y].getOccupyingPiece() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tx++; y++;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (distanceMovedRows < 0 && distanceMovedCols > 0) {\n\n\t\t\t\tint x=startRow+1;\n\t\t\t\tint y = startColumn-1;\n\n\t\t\t\twhile (x < endRow && y > endColumn) {\n\t\t\t\t\tif (board[x][y].getOccupyingPiece() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tx++; y--;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean isFull(){\n for(int i=0;i<3;i++){\n for(int j=0;j<3;j++){\n if(!gameBoard[i][j].equals(\"O\") && !gameBoard[i][j].equals(\"X\")){\n return false;\n }\n }\n }\n return true;\n }" ]
[ "0.71183985", "0.70717794", "0.7065794", "0.7022124", "0.69962335", "0.6980841", "0.6946115", "0.6938572", "0.6933991", "0.6915689", "0.68908983", "0.6833541", "0.6833396", "0.68263495", "0.67880374", "0.6782931", "0.6742853", "0.67358106", "0.6729848", "0.6715963", "0.67114675", "0.6705475", "0.6701118", "0.6690728", "0.66898304", "0.668339", "0.6676517", "0.66676515", "0.6661712", "0.66542864", "0.66257495", "0.6625428", "0.6622576", "0.6618983", "0.6617779", "0.6616716", "0.6602537", "0.6594705", "0.6584778", "0.65832347", "0.6579374", "0.6572487", "0.6540839", "0.65394473", "0.6532569", "0.65190977", "0.65171075", "0.65154076", "0.6514413", "0.65013635", "0.65006566", "0.65002096", "0.64992213", "0.6497873", "0.64969087", "0.6479677", "0.64785933", "0.6472227", "0.64713967", "0.647013", "0.64692754", "0.64665955", "0.645942", "0.64545673", "0.6452556", "0.644441", "0.64421445", "0.6441579", "0.64388484", "0.6438248", "0.6436776", "0.64294183", "0.6424547", "0.6419392", "0.64161956", "0.6411929", "0.64078873", "0.64072126", "0.6404972", "0.6400821", "0.63914907", "0.63912773", "0.6388021", "0.6387211", "0.63827854", "0.6378164", "0.6377678", "0.6375878", "0.6372385", "0.6372157", "0.6368684", "0.63592017", "0.6356904", "0.63555336", "0.6354655", "0.6354404", "0.63503116", "0.6335181", "0.63322103", "0.6322459", "0.63214415" ]
0.0
-1
nomovecheck method checks both players to see if they can make a move on the current board, if both of them can't, then the game will end.
public static void nomovecheck(){ nomovecount=0; boardcheck("x"); boardcheck("o"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void callingMovePossibleWhenTryingToTakeAnOpponentPieceWith2MarkersOnShouldReturnFalse() {\n player1.movePiece(12, 11, board);\r\n player1.movePiece(12, 11, board);\r\n\r\n player2.movesLeft.moves.add(2);\r\n\r\n // Then\r\n assertFalse(player2.isMovePossible(13, 11, board));\r\n }", "@Override\n public boolean isValidMove(Move move) {\n if (board[move.oldRow][move.oldColumn].isValidMove(move, board))\n return true;\n //player will not be in check\n //move will get player out of check if they are in check\n return false;\n }", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "private boolean checkMoveOthers(Pieces piece, Coordinates from, Coordinates to) {\n\t\t\t\t\n\t\t/* \n\t\t *il pedone: \n\t\t * -può andare dritto sse davanti a se non ha pedine\n\t\t * -può andare obliquo sse in quelle posizioni ha una pedina avversaria da mangiare\n\t\t * \n\t\t */\n\t\tif (piece instanceof Pawn) {\n\t\t\tif (from.getY() == to.getY()) {\n\t\t\t\tif(chessboard.at(to) == null)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(chessboard.at(to) == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//il cavallo salta le pedine nel mezzo\n\t\tif (piece instanceof Knight)\n\t\t\treturn true;\n\t\t\n\t\t//Oltre non andranno il: cavallo, il re ed il pedone.\n\t\t/*\n\t\t *Calcolo le posizioni che intercorrono tra il from ed il to escluse \n\t\t *ed per ogni posizione verifico se è vuota\n\t\t *-se in almeno una posizione c'è una pedina(non importa il colore), la mossa non è valida\n\t\t *-altrimenti, la strada è spianata quindi posso effettuare lo spostamento \n\t\t */\n\t\tArrayList<Coordinates> path = piece.getPath(from, to);\n\t\tfor (Coordinates coordinate : path) {\n\t\t\tif ( chessboard.at(coordinate) != null ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "@Test\n void checkDoMove() {\n abilities.doMove(turn, board.getCellFromCoords(1, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(1, 1));\n Worker forcedWorker = turn.getWorker();\n for (Worker other : turn.getOtherWorkers()) {\n if (other.getCell() == board.getCellFromCoords(2, 2)) {\n forcedWorker = other;\n }\n }\n\n assertEquals(forcedWorker.getCell(), board.getCellFromCoords(2, 2));\n\n // Can't move anymore after having already moved\n assertFalse(abilities.checkCanMove(turn, board.getCellFromCoords(0, 0)));\n }", "public static void twoPlayers() {\r\n\t\tint[][] board = createBoard();\r\n\t\tshowBoard(board);\r\n\r\n\t\tSystem.out.println(\"Welcome to the 2-player Checkers Game !\");\r\n\r\n\t\tboolean oppGameOver = false;\r\n\t\twhile (!gameOver(board, RED) & !oppGameOver) {\r\n\t\t\tSystem.out.println(\"\\nRED's turn\");\r\n\t\t\tboard = getPlayerFullMove(board, RED);\r\n\r\n\t\t\toppGameOver = gameOver(board, BLUE);\r\n\t\t\tif (!oppGameOver) {\r\n\t\t\t\tSystem.out.println(\"\\nBLUE's turn\");\r\n\t\t\t\tboard = getPlayerFullMove(board, BLUE);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint winner = 0;\r\n\t\tif (playerDiscs(board, RED).length == 0 | playerDiscs(board, BLUE).length == 0)\r\n\t\t\twinner = findTheLeader(board);\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"\\t ************************************\");\r\n\t\tif (winner == RED)\r\n\t\t\tSystem.out.println(\"\\t * The red player is the winner !! *\");\r\n\t\telse if (winner == BLUE)\r\n\t\t\tSystem.out.println(\"\\t * The blue player is the winner !! *\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"\\t * DRAW !! *\");\r\n\t\tSystem.out.println(\"\\t ************************************\");\r\n\t}", "public void checkWinner(){\n \n if ((board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')||(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')||(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')||(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')||(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')||(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')||(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')||(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')||(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')||(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')||(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n winner();\n }\n \n }", "@Test\r\n public void callingMovePossibleOnTakingAPieceWhenYouAlreadyHaveAZeroShouldReturnFalse() {\n player1.movePiece(12, 11, board);\r\n\r\n // moving piece to zero\r\n player2.movePiece(13, 25, board);\r\n // give 2 move\r\n player2.movesLeft.moves.add(2);\r\n\r\n // Then\r\n assertFalse(player2.isMovePossible(13, 11, board));\r\n }", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "public static boolean checkWinner(){\n \n if(board[0][0] == board[0][1] && board[0][1] == board[0][2] && (board[0][0] == 'x' || board [0][0] == 'o'))\n return true;\n else if(board[1][0] == board[1][1] && board[1][1] == board[1][2] && (board[1][0] == 'x' || board[1][0] == 'o'))\n return true;\n else if(board[2][0] == board[2][1] && board[2][1] == board[2][2] && (board[2][0] == 'x' || board[2][0] == 'o'))\n return true;\n else if(board[0][0] == board[1][0] && board[1][0] == board[2][0] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][1] == board[1][1] && board[1][1] == board[2][1] && (board[0][1] == 'x' || board[0][1] == 'o'))\n return true;\n else if(board[0][2] == board[1][2] && board[1][2] == board[2][2] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else if(board[0][0] == board[1][1] && board[1][1] == board[2][2] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][2] == board[1][1] && board[1][1] == board[2][0] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else\n return false;\n \n }", "boolean checkLegalMove(int posx, int posy) {\n\t\tBoolean bool;\n\t\tint change;\n\t\tchange = curPlayer > 1 ? (change = 1) : (change = -1);\n\t\tif (kingJumping(posx, posy, change)){\n\t\t\tbool = true;\n\t\t} else if (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\tSystem.out.println(\"Normal move\");\n\t\t\tbool = true;\n\t\t} else if (jump(posx, posy, prevPiece) && (prevPosX == posx + (change * 2) && (prevPosY == posy - 2 || prevPosY == posy + 2))) {\n\t\t\tbool = true;\n\t\t} else if (((JLabel)prevComp).getIcon().equals(Playboard.rKing) || ((JLabel)prevComp).getIcon().equals(Playboard.bKing) || ((JLabel)prevComp).getIcon().equals(Playboard.blackSKing) || ((JLabel)prevComp).getIcon().equals(Playboard.redSKing)){\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\t\tbool = true;\n\t\t\t} else\n\t\t\t\tbool = false;\n\t\t} else if (prevPiece == 4 && (prevPosX == posx + 1 || prevPosX == posx -1) && (prevPosY == posy - 1 || prevPosY == posy +1)) { // King moves\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1))\n\t\t\t\tbool = true;\n\t\t\telse\n\t\t\t\tbool = false;\n\t\t} else {\n\t\t\tbool = false;\n\t\t}\n\t\treturn bool;\n\t}", "public boolean CheckMate(Board b, Player p, boolean check) {\n int WhiteKingx = WhiteKing(b)[0];\r\n int WhiteKingy = WhiteKing(b)[1];\r\n int BlackKingx = BlackKing(b)[0];\r\n int BlackKingy = BlackKing(b)[1];\r\n\r\n if (check && p.getColor()) {\r\n //currently in check and color is white\r\n for (int horizontal = -1; horizontal < 2; horizontal++) {\r\n for (int vertical = -1; vertical < 2; vertical++) {\r\n if (b.blocks[WhiteKingx][WhiteKingy].getPiece().ValidMove(b.blocks, WhiteKingx, WhiteKingy, WhiteKingx + horizontal, WhiteKingy + vertical)) {\r\n /* Check which blocks the king can move to.\r\n * If the king can move, check if that block still puts the king on check\r\n * If all of them yield check, then see if there is a piece that can move to prevent the check\r\n */\r\n b.move(WhiteKingx, WhiteKingy, WhiteKingx + horizontal, WhiteKingy + vertical);\r\n if(!CheckChecker(b, p)) {\r\n b.move(WhiteKingx + horizontal, WhiteKingy + vertical, WhiteKingx, WhiteKingy);\r\n return false;\r\n }\r\n b.move(WhiteKingx + horizontal, WhiteKingy + vertical, WhiteKingx, WhiteKingy);\r\n }\r\n }\r\n }\r\n }\r\n if (check && !p.getColor()) {\r\n for(int horizontal = -1; horizontal < 2; horizontal++) {\r\n for(int vertical = -1; vertical < 2; vertical ++) {\r\n if(b.blocks[BlackKingx][BlackKingy].getPiece().ValidMove(b.blocks, BlackKingx, BlackKingy, BlackKingx + horizontal, BlackKingy + vertical)) {\r\n b.move(BlackKingx, BlackKingy, BlackKingx + horizontal, BlackKingy + vertical);\r\n if(!CheckChecker(b, p)) {\r\n b.move(BlackKingx + horizontal, BlackKingy + vertical, BlackKingx, BlackKingy);\r\n return false;\r\n }\r\n b.move(BlackKingx + horizontal, BlackKingy + vertical, BlackKingx, BlackKingy);\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public void checkMoveOrPass(){\n if (this.xTokens.size() > 0) {\n this.diceRoller = false;} \n else { //if no tokens to move, pass and let player roll dice\n this.turn++;\n //System.out.println(\"next turn player \" + this.players[currentPlayer].getColor());\n }\n this.currentPlayer = this.xPlayers.get(this.turn % this.xPlayers.size());\n }", "public boolean checkMove(Piece piece, boolean check) {\n\t\tif (check) {\n\t\t\tint x = piece.getX();\n\t\t\tint y = piece.getY();\n\t\t\tif (x >= 0 && x <= 7 && y >= 0 && y <= 7) {\n\t\t\t\tstrong_enemy = false;\n\t\t\t\tfriend = false;\n\t\t\t\t// check surrounding\n\t\t\t\tcheck_enemy_and_friend(x - 1, y, piece.getStrength(), piece.getColor());\n\t\t\t\tcheck_enemy_and_friend(x + 1, y, piece.getStrength(), piece.getColor());\n\t\t\t\tcheck_enemy_and_friend(x, y - 1, piece.getStrength(), piece.getColor());\n\t\t\t\tcheck_enemy_and_friend(x, y + 1, piece.getStrength(), piece.getColor());\n\n\t\t\t\tif (strong_enemy == false) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (strong_enemy == true && friend == true) {// freezing is solved\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public boolean gameOver(){\r\n if(isGame) return (currentPlayer.getChecks() == 0 || nextPlayer.getChecks() == 0 || currentPlayer.getQueens() == 4 || nextPlayer.getQueens() == 4 || (currentPlayer.cantMove() && nextPlayer.cantMove()));\r\n return getNumChecks(WHITE) == 0 || getNumChecks(BLACK) == 0 || getNumQueens(WHITE) == 4 || getNumQueens(BLACK) == 4;\r\n }", "public boolean validMove(ChessBoard board, Square from, Square to){\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX()); \r\n int y = Math.abs(from.getY() - to.getY()); \r\n if(( x == 2 && y == 1 ) || ( x == 1 && y == 2 )){\r\n return true; \r\n }\r\n\r\n return false;\r\n }", "public static boolean isMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\tif (board[toRow][toCol]==0){/*is the target slot ia emtey*/\r\n\t\t\tif (player==1){\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){ /*is the starting slot is red player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther no eating jump?*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is this is legal move*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tif (player==-1){\r\n\t\t\t\tif (board[fromRow][fromCol]==-1||board[fromRow][fromCol]==-2){/*is the starting slot is blue player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther are no eating move*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the move is legal*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "private boolean checkGameOver() {\n\t\tboolean singlePlayerWon = otherPlayer.getLife() == 0;\n\t\tboolean otherPlayerWon = singlePlayer.getLife() == 0;\n\n\t\tif (singlePlayerWon || otherPlayerWon) {\n\t\t\tthis.singlePlayer.createEndButton(singlePlayerWon);\n\t\t\tthis.singlePlayer.onGameOver();\n\t\t\tthis.otherPlayer.onGameOver();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "@Test\n void checkNoEffectMove() {\n assertTrue(abilities.checkCanMove(turn, board.getCellFromCoords(0, 1)));\n abilities.doMove(turn, board.getCellFromCoords(0, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(0, 1));\n }", "public boolean checkMove(location start_pos, location end_pos, chess[][] board){\n // move in vertical direction or horizontal direction\n if(start_pos.getY() == end_pos.getY() || start_pos.getX() == end_pos.getX() ){\n // Distance is greater than zero\n if(!isStay(start_pos, end_pos)){\n return !isChessOnWay(start_pos, end_pos, board);\n }\n }\n return false;\n }", "@Test\r\n public void settingBoardPositionAndValidMovesLeftAndCallingMovePossibleWithASimple2PositionMoveShouldReturnTrue() {\n player1.movePiece(12, 11, board);\r\n player2.movesLeft.moves.add(2);\r\n\r\n // When\r\n final boolean possible = player2.isMovePossible(13, 11, board);\r\n\r\n // Then\r\n assertTrue(possible);\r\n }", "private boolean isPlayerMoveImpossible(int playerNumber) {\n if (playerNumber != 1 && playerNumber != 2) return false;\n for (TileEnum tile : TileEnum.values()) {\n TileStateEnum tileState = getTileState(tile);\n if (!((playerNumber == 1 && tileState == TileStateEnum.PLAYERONE)\n || (playerNumber == 2 && tileState == TileStateEnum.PLAYERTWO))) continue;\n\n List<TileEnum> neighbors = getNeighborsOf(tile);\n for (TileEnum otherTile : neighbors) {\n TileStateEnum otherTileState = getTileState(otherTile);\n if (otherTileState == TileStateEnum.FREE) return false;\n\n List<TileEnum> otherNeighbors = getNeighborsOf(otherTile);\n for (TileEnum anotherTile : otherNeighbors) {\n TileStateEnum anotherTileState = getTileState(anotherTile);\n if (anotherTileState == TileStateEnum.FREE) return false;\n }\n }\n }\n return true;\n }", "@Override\n public int checkNoMovesLeft(List<Integer> userStates, List<Integer> agentStates) {\n boolean noMovesForPlayer1 = checkEmptyMovesForPlayer(userStates);\n boolean noMovesForPlayer2 = checkEmptyMovesForPlayer(agentStates);\n if (noMovesForPlayer1 && noMovesForPlayer2) return 0;\n else if (noMovesForPlayer1) return NO_MOVES_PLAYER1;\n else if (noMovesForPlayer2) return NO_MOVES_PLAYER2;\n else return BOTH_PLAYERS_HAVE_MOVES;\n }", "public boolean checkCheck(Player p){\n\t\tPosition position = null;\n\t\tfor (int i = Position.MAX_ROW; i >= Position.MIN_ROW; i--) {\n\t\t\tfor (char c = Position.MIN_COLUMN; c <= Position.MAX_COLUMN; c++) {\n\t Piece piece = gameState.getPieceAt(String.valueOf(c) + i);\n\t if(piece!=null &&piece.getClass().equals(King.class) && piece.getOwner()==p){\n\t \tposition = new Position(c,i);\n\t \tbreak;\n\t }\n\t\t\t}\n\t\t}\n\t\t//Find out if a move of other player contains position of king\n\t\tList<Move> moves = gameState.listAllMoves(p==Player.Black?Player.White:Player.Black,false);\n\t\tfor(Move move : moves){\n\t\t\tif(move.getDestination().equals(position)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public abstract boolean canMove(Board board, Spot from, Spot to);", "public boolean playerTwoWin()\n\t{\n\t\tif( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") ) \n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t}// end of if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\treturn false;\n\t}", "private static boolean checkWinner(Player playerA, Player playerB) {\n\t\tboolean gameOver = false;\n\t\tif (playerA.getShips().isEmpty()) {\n\t\t\tSystem.out.println(playerB.getName() + \" Won the Battle\");\n\t\t\tgameOver = true;\n\t\t} else if (playerB.getShips().isEmpty()) {\n\t\t\tSystem.out.println(playerA.getName() + \" Won the Battle\");\n\t\t\tgameOver = true;\n\t\t} else if (playerA.getTargetList().isEmpty() && playerB.getTargetList().isEmpty()) {\n\t\t\tSystem.out.println(\"peace\");\n\t\t\tgameOver = true;\n\t\t}\n\t\treturn gameOver;\n\t}", "private boolean isLegalMove(String move) {\n\t\tString[] moveParts = move.split(\";\");\n\n\t\tint fromRow = Integer.parseInt(moveParts[0].charAt(0) + \"\");\n\t\tint fromCol = Integer.parseInt(moveParts[0].charAt(1) + \"\");\n\n\t\tint toRow = Integer.parseInt(moveParts[1].charAt(0) + \"\");\n\t\tint toCol = Integer.parseInt(moveParts[1].charAt(1) + \"\");\n\n\t\tint minRow = Math.min(fromRow, toRow);\n\t\tint minCol = Math.min(fromCol, toCol);\n\n\t\tint maxRow = Math.max(fromRow, toRow);\n\t\tint maxCol = Math.max(fromCol, toCol);\n\n\t\tint piece = board[fromRow][fromCol];//Integer.parseInt(moveParts[2]);\n\t\tint pieceType = Math.abs(piece);\n\t\tint team = Math.round(Math.signum(piece));\n\n\t\tif (team == Math.round(Math.signum(board[toRow][toCol]))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (toRow < 0 || toRow > 7 && toCol < 0 && toCol > 7) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (team > 0) { // WHITE\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isWhiteCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else { //BLACK\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isBlackCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (pieceType == 1) { //Pawn\n\t\t\treturn ((board[toRow][toCol] != 0 && toRow == fromRow + team && (toCol == fromCol + 1 || toCol == fromCol - 1)) || (toCol == fromCol && board[toRow][toCol] == 0 && ((toRow == fromRow + team) || (((fromRow == 1 && team == 1) || (fromRow == 6 && team == -1)) ? toRow == fromRow + 2*team && board[fromRow + team][fromCol] == 0 : false))));\n\t\t} else if (pieceType == 2) { //Rook\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (pieceType == 3) { //Knight\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy == 5;\n\t\t} else if (pieceType == 4) { //Bishop\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\tint m = dy/dx;\n\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && board[i][startCol + m*(i - minRow)] != 7) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (pieceType == 5) { //Queen\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tint dx = toRow - fromRow;\n\t\t\t\tint dy = toCol - fromCol;\n\t\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\t\tint m = dy/dx;\n\t\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && Math.abs(board[i][startCol + m*(i - minRow)]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (pieceType == 6) { //King\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy <= 2;\n\t\t}\n\n\t\treturn false;\n\t}", "public abstract boolean validMove(ChessBoard board, Square from, Square to);", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = from.getX() - to.getX();\r\n int y = from.getY() - to.getY();\r\n \r\n if (x < 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n } \r\n return true;\r\n }\r\n else if(x > 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n }\r\n return true;\r\n }\r\n else if( x > 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n }\r\n return true; \r\n }\r\n else if (x < 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n } \r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX());\r\n int y = Math.abs(from.getY() - to.getY());\r\n if((from.getX() - to.getX()) > 0 || (from.getY() - to.getY()) > 0){\r\n if ((x == 0 && y >= 1)) {\r\n for(int i = 1; i <= y-1; i++){\r\n if(board.getBox(from.getX(), from.getY() - i).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }else if((x >= 1 && y == 0)){\r\n for(int i = 1; i <= x-1; i++){\r\n if(board.getBox(from.getX() - i, from.getY()).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }else if((from.getX() - to.getX()) < 0 || (from.getY() - to.getY()) < 0){\r\n if (x == 0 && (from.getY() - to.getY()) <= -1) {\r\n for(int i = y-1; i > 0; i--){\r\n if(board.getBox(from.getX(), from.getY() + i).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }else if((from.getX() - to.getX()) <= -1 && y == 0){\r\n for(int i = x-1; i > 0; i--){\r\n if(board.getBox(from.getX() + i, from.getY()).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public void checkGame(){\r\n\t\tif (foodCounter == 0){ // all food is gone, win\r\n\t\t\tSystem.out.println(\"You won!\");\r\n\t\t\t//stops ghosts and pacman\r\n\t\t\tpacman.speed = 0;\r\n\t\t\tg1.speed = 0;\r\n\t\t\tg2.speed = 0;\r\n\t\t\tg3.speed = 0;\r\n\t\t\tlost = true; // return to menu \r\n\t\t}\r\n\t\t// if pacman collide with ghost, lose\r\n\t\tif (collision2(pacmansprite,g1.sprite) || collision2(pacmansprite,g2.sprite) || collision2(pacmansprite,g3.sprite)){\r\n\t\t\tSystem.out.println(\"You lost\");\r\n\t\t\tlost = true;\r\n\t\t}\r\n\t}", "private void checkWin() {\n // Check if a dialog is already displayed\n if (!this.gameOverDisplayed) {\n // Check left paddle\n if (Objects.equals(this.scoreL.currentScore, this.winCount) && (this.scoreL.currentScore != 0)) {\n if (twoUser) {\n gameOver(GeneralFunctions.TWO_1_WIN);\n } else {\n gameOver(GeneralFunctions.ONE_LOSE);\n }\n // Right paddle\n } else if (Objects.equals(this.scoreR.currentScore, this.winCount) && (this.scoreR.currentScore != 0)) {\n if (twoUser) {\n gameOver(GeneralFunctions.TWO_2_WIN);\n } else {\n gameOver(GeneralFunctions.ONE_WIN);\n }\n }\n }\n }", "@Test\n public void isMoveActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n assertTrue(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P13));\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P05));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P04,\n CheckersPosition.P08));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P21,\n CheckersPosition.P17));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P18));\n }", "private void checkLegal() {\n\tif (undoStack.size() == 2) {\n ArrayList<Integer> canGo = \n getMoves(undoStack.get(0), curBoard);\n boolean isLegal = false;\n int moveTo = undoStack.get(1);\n for (int i = 0; i < canGo.size(); i++) {\n if(canGo.get(i) == moveTo) {\n isLegal = true;\n break;\n }\n }\n\n if(isLegal) {\n curBoard = moveUnit(undoStack.get(0), \n moveTo, curBoard);\n clearStack();\n\n moveCount++;\n\t setChanged();\n\t notifyObservers();\n }\n\t}\n }", "public GameBoard jump(APlayer opponent, Piece piece, int x, int y) {\n GameBoard newBoard = new GameBoard();\n newBoard.getPlayer2().getCheckers().clear();\n newBoard.getPlayer1().getCheckers().clear();\n newBoard.getPlayer1().getCheckers().addAll(this.getCheckers());\n newBoard.getPlayer2().getCheckers().addAll(opponent.getCheckers());\n newBoard.setCurrentTurn(1);\n int row = piece.getRow();\n int column = piece.getColumn();\n Piece piece1 = new Piece(row+2,getColumn(column-2),piece.isKing());\n Piece piece2 = new Piece(row+2,getColumn(column+2),piece.isKing());\n if(piece.isKing() && x < row) {\n Piece piece3 = new Piece(row-2, getColumn(column-2), true);\n Piece piece4 = new Piece(row-2, getColumn(column+2), true);\n if(newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece3,x,y,4) || x==row-2 && y==getColumn(column-2) && hasPlayers(opponent, row-1, getColumn(column-1)) &&\n isEmpty(opponent, row-2, getColumn(column-2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row-1,getColumn(column-1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n newBoard.getPlayer1().getCheckers().add(piece3);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece3, x, y);\n }\n if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece4,x,y,4) || x==row-2 && y==getColumn(column+2) && hasPlayers(opponent, row-1,getColumn(column+1)) &&\n isEmpty(opponent, row-2, getColumn(column+2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row-1, getColumn(column+1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n newBoard.getPlayer1().getCheckers().add(piece4);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece4, x, y);\n }\n } else if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece1,x,y,4) || x==row+2 && y== getColumn(column-2) && hasPlayers(opponent, row +1, getColumn(column -1)) &&\n isEmpty(opponent, row +2, getColumn(column -2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row+1, getColumn(column-1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece1.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(piece1);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece1, x, y);\n } else if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece2,x,y,4) || x==row+2 && y== getColumn(column+2) && hasPlayers(opponent, row +1, getColumn(column +1)) &&\n isEmpty(opponent, row +2, getColumn(column +2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row+1, getColumn(column+1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece2.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(piece2);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece2, x, y);\n }\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(new Piece(x,y,piece.isKing()));\n return newBoard;\n }", "boolean isLegal(String move) {\n int[][] theStatusBoard;\n if (_playerOnMove == ORANGE) {\n theStatusBoard = _orangeStatusBoard;\n } else {\n theStatusBoard = _violetStatusBoard;\n }\n Pieces thispiece = new Pieces();\n String piecename = move.substring(0, 1);\n int col = getCoordinate(move.substring(1, 2));\n int row = getCoordinate(move.substring(2, 3));\n int ori = Integer.parseInt(move.substring(3, 4));\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n if (row + depth - 1 > 13 || col + length - 1 > 13) {\n System.out.println(\"Your move makes your piece out of the board, try again!\");\n return false;\n }\n\n boolean has1 = false;\n boolean no2 = true;\n\n int i, j;\n for (i = 0; i < depth; i++) {\n for (j = 0; j < length; j++) {\n if (finalPositions[i][j] == 1) {\n if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 1) {\n has1 = true;\n } else if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 2) {\n return false;\n }\n }\n }\n }\n System.out.println(\"has1: \" + has1);\n return has1;\n }", "public boolean moveValidation(Board board, Piece piece, int sourceX, int sourceY, int targetX, int targetY){//TODO make directions in Piece class\n int diffX = targetX - sourceX;\n int diffY = targetY - sourceY;\n if (!board.isPieceAtLocation(targetX, targetY) || board.isPieceAtLocationCapturable(piece.getColour(), targetX, targetY)) {\n if(diffX==0 && diffY > 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 0, 1);\n else if(diffX > 0 && diffY == 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 1, 0);\n else if(diffX < 0 && diffY == 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, -1, 0);\n else if(diffX==0 && diffY < 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 0, -1);\n }\n return false;\n }", "public static boolean canPlayerMove(Player player){\r\n int playerX = 0;\r\n int playerY = 0;\r\n int nX;\r\n int nY;\r\n //finding the player on the board\r\n for(int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n if(player.getPosition() == board[i][j]) {\r\n playerX = i;\r\n playerY = j;\r\n }\r\n }\r\n }\r\n //making sure that the player stays on the board\r\n\r\n if(playerY != board[0].length-1) {\r\n nX = playerX;\r\n nY = playerY + 1;\r\n if (board[nX][nY].west && board[playerX][playerY].east && !board[nX][nY].isOnFire) {//if the tile will accept the player\r\n return true;\r\n }\r\n }\r\n\r\n if(playerY != 0) {\r\n nX = playerX;\r\n nY = playerY - 1;\r\n if (board[nX][nY].east && board[playerX][playerY].west && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != 0) {\r\n nX = playerX - 1;\r\n nY = playerY;\r\n if (board[nX][nY].south && board[playerX][playerY].north && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != board.length-1) {\r\n nX = playerX + 1;\r\n nY = playerY;\r\n if (board[nX][nY].north && board[playerX][playerY].south && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }", "public boolean isMovePossible(int start, int end, boolean isRed){\n\n int moveDiff = end - start; //moveDiff tracks the movement made based on difference btwn start and end\n //general check for if a checker is on the end square\n if (mCheckerBoard.get(end) != null)\n {\n return false; //can't move b/c a checker is on the end square\n }\n\n //general checks that start and end are on the board\n if(end<0 || end>63)\n {\n return false; //can't move b/c end is off-board\n }\n\n\n //checks for diagonalRight\n if(moveDiff == 9 || moveDiff ==-7)\n {\n if(start % 8 == 7){\n return false; //can't move b/c off-board on right\n }\n }\n\n //checks for diagonalLeft\n if(moveDiff == 7 || moveDiff ==-9)\n {\n if(start % 8 == 0){\n return false; //can't move b/c off-board on left\n }\n }\n\n //checks for jumpRight\n if(moveDiff == 18 || moveDiff == -14){\n //column check\n if((start % 8 == 7) || (start % 8 == 6)){\n return false; //can't move b/c off-board on right\n }\n //need to check if there is a piece of opposite color in between\n int jumpSpace = start + (moveDiff/2);\n Checker jumped = mCheckerBoard.get(jumpSpace);\n if(jumped == null)\n {\n return false; //can't move b/c no checker to jump\n }\n else if (jumped.isRed() == isRed)\n {\n return false; //can't move b/c can't jump own color\n }\n }\n\n //checks for jumpLeft\n if(moveDiff == 14 || moveDiff == -18){\n if((start % 8 == 7) || (start % 8 == 6)) {\n return false; //can't move b/c off-board on right\n }\n //need to check if there is a piece of opposite color in between\n int jumpSpace = start + (moveDiff/2);\n Checker jumped = mCheckerBoard.get(jumpSpace);\n if(jumped == null)\n {\n return false; //can't move b/c no checker to jump\n }\n else if (jumped.isRed() == isRed)\n {\n return false; //can't move b/c can't jump own color\n }\n }\n\n if(moveDiff == 7 || moveDiff ==-7 || moveDiff ==9 || moveDiff ==-9\n || moveDiff == 18 || moveDiff == -18 || moveDiff == 14 || moveDiff ==-14){\n return true;\n }\n else{\n return false;\n }\n\n }", "private boolean playerWin(Board board)\n {\n return check(board, PLAYER);\n }", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX());\r\n int y = Math.abs(from.getY() - to.getY());\r\n // to check if the move is 1unit vertically or horizontally\r\n if (x + y == 1) {\r\n return true;\r\n }else if (x == y && x == 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public void checkEndGame() {\n\t\tint total = 0;\n\t\tint total2 = 0;\n\t\tfor (int i = 0; i < 6; i++) {\n\t\t\ttotal += board[i];\n\t\t}\n\t\tfor (int i = 7; i < 13; i++) {\n\t\t\ttotal2 += board[i];\n\t\t}\n\n\t\tif (total == 0 || total2 == 0) {\n\t\t\tgameOver = true;\n\t\t}\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to){\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n int x = from.getX() - to.getX(); \r\n int y = from.getY() - to.getY();\r\n \r\n if(reached_end){\r\n if(y > 0){ // Going forward\r\n return false;\r\n } else { // Going backward\r\n if((Math.abs(y) == 1 || Math.abs(y) == 2) && x == 0){\r\n if (Math.abs(y)==2 && board.getBox(from.getX(),from.getY()+1).getPiece()!=null){\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }\r\n } else {\r\n if(y > 0){ // Going forward\r\n if((Math.abs(y) == 1 || Math.abs(y) == 2) && x == 0){\r\n if (Math.abs(y)==2 && board.getBox(from.getX(),from.getY()-1).getPiece()!=null){\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else { // Going backward\r\n return false;\r\n }\r\n }\r\n }", "private void checkMove(Tile[][] chessBoard, int pawnX, int pawnY, int direction) {\r\n\t\tUnit unit = chessBoard[pawnX][pawnY+direction].getPiece();\r\n\t\tif (unit == null) {\r\n\t\t\tMoves move = new Moves(pawnX, pawnY+direction);\r\n\t\t\tinsertMove(move, moveList);\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean CheckMovingRules(Board testBoard,int target_x_pos, int target_y_pos) {\n\t\treturn ((target_x_pos-cur_x_pos==1)&&(target_y_pos-cur_y_pos==2))||((target_x_pos-cur_x_pos==2)&&(target_y_pos-cur_y_pos==1))||\n\t\t\t\t((target_x_pos-cur_x_pos==2)&&(target_y_pos-cur_y_pos==-1))||((target_x_pos-cur_x_pos==1)&&(target_y_pos-cur_y_pos==-2))||\n\t\t\t\t((target_x_pos-cur_x_pos==-1)&&(target_y_pos-cur_y_pos==2))||((target_x_pos-cur_x_pos==-1)&&(target_y_pos-cur_y_pos==-2))||\n\t\t\t\t((target_x_pos-cur_x_pos==-2)&&(target_y_pos-cur_y_pos==1))||((target_x_pos-cur_x_pos==-2)&&(target_y_pos-cur_y_pos==-1));\n\t}", "public static boolean isBasicMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\t/*Checking if coordinates are OK*/\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*Checks if the tile is empty*/\r\n\t\t\t\tif (player==1){/*Checks if player is red*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==1){/*Checks if in tile there is soldier red */\r\n\t\t\t\t\t\tif(fromRow==toRow-1&&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally upward*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\tif (board[fromRow][fromCol]==2){/*Checks if in tile there is queen red*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif (player==-1){/*Checks if player is blue*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-1){/*Checks if in tile there is soldier blue */\r\n\t\t\t\t\t\tif(fromRow==toRow+1&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally down*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-2){/*Checks if in tile there is queen blue*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public boolean isGameOver() {\n if (gameStatus == null || gameStatus.getPlayerOne() == null || gameStatus.getPlayerTwo() == null) return false;\n return gameStatus.isTie()\n || gameStatus.getPlayerOne().equals(gameStatus.getWinner())\n || gameStatus.getPlayerTwo().equals(gameStatus.getWinner())\n || gameStatus.getPlayerOnePoints() == 0\n || gameStatus.getPlayerTwoPoints() == 0\n || (getWhoseTurn() == 1 && isPlayerMoveImpossible(1))\n || (getWhoseTurn() == 2 && isPlayerMoveImpossible(2));\n }", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "public Boolean checkStalemate(IBoardAgent oBoard, IPlayerAgent oPlayer) {\n\t\tIPieceAgent oKingPiece = oPlayer.getKingPiece();\n\n\t\t// Checking if any piece other than King can make any move.\n\t\tfor (Map.Entry<String, IPieceAgent> itPiece : oPlayer.getAllPieces().entrySet()) {\n\t\t\tIPieceAgent oPiece = itPiece.getValue();\n\t\t\t\n\t\t\tif (oPiece.getPosition() == null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (oPiece.equals(oKingPiece)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tMap<String, IMoveCandidate> mpCandidateMovePosition = new HashMap<String, IMoveCandidate>();\n\t\t\ttryEvaluateAllRules(oBoard, oPiece, mpCandidateMovePosition);\n\t\t\t\n\t\t\tif (!mpCandidateMovePosition.isEmpty()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fetching all the possible moves King can make.\n\t\tMap<String, IMoveCandidate> mpCandidateMovePositionForKing = new HashMap<String, IMoveCandidate>();\n\t\ttryEvaluateAllRules(oBoard, oKingPiece, mpCandidateMovePositionForKing);\n\t\t\n\t\t// Iterating through the opponent's pieces and see if there is any candidate move that King can make\n\t\t// without endangering itself.\n\t\tfor (Map.Entry<String, IPlayerAgent> itPlayer : oBoard.getAllPlayerAgents().entrySet()) {\n\t\t\tif (itPlayer.getValue().equals(oPlayer)) {\n\t\t\t\t// Ignore piece from same player.\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Iterating the pieces of the current player.\n\t\t\tfor (Map.Entry<String, IPieceAgent> itPiece : itPlayer.getValue().getAllPieces().entrySet()) {\n\t\t\t\tIPieceAgent oOpponentPiece = itPiece.getValue();\n\t\t\t\tif (oOpponentPiece.getPosition() == null) {\n\t\t\t\t\t// Piece is not linked to any piece indicates the piece has been captured.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Fetching the possible moves the piece can make.\n\t\t\t\tMap<String, IMoveCandidate> mpCandidateMovePositionsForOpponentPlayerPiece = new HashMap<String, IMoveCandidate>();\n\t\t\t\ttryEvaluateAllRules(oBoard, oOpponentPiece, mpCandidateMovePositionsForOpponentPlayerPiece);\n\t\t\t\tfor (Map.Entry<String, IMoveCandidate> itCandidateMove : mpCandidateMovePositionsForOpponentPlayerPiece.entrySet()) {\t\t\t\t\n\t\t\t\t\tif (mpCandidateMovePositionForKing.containsKey(itCandidateMove.getKey())) {\n\t\t\t\t\t\tmpCandidateMovePositionForKing.remove(itCandidateMove.getKey());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (mpCandidateMovePositionForKing.size() == 0) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (mpCandidateMovePositionForKing.size() > 0) {\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\treturn true;\n\t}", "public boolean validMove(TileEnum from, TileEnum to) {\n if (!isMyTurn() || hasMoved()\n || (getMyPlayerNumber() == 1 && TileStateEnum.PLAYERONE != getTileState(from))\n || (getMyPlayerNumber() == 2 && TileStateEnum.PLAYERTWO != getTileState(from)))\n return false;\n\n List<TileEnum> fromNeighbors = getNeighborsOf(from);\n for (TileEnum otherTile : fromNeighbors) {\n if (to.equals(otherTile)) return TileStateEnum.FREE.equals(getTileState(otherTile));\n\n List<TileEnum> otherNeighbors = getNeighborsOf(otherTile);\n for (TileEnum anotherTile : otherNeighbors) {\n if (to.equals(anotherTile)) return TileStateEnum.FREE.equals(getTileState(anotherTile));\n }\n }\n return false;\n }", "@Test\n public void isValidMoveTest() {\n\n //get the board of the enemy with the method getBoard() from enemyGameBoard\n board = enemyGameBoard.getBoard();\n\n //Try two times for a existing point on the board\n assertTrue(enemyGameBoard.isValidMove(1,1));\n assertTrue(enemyGameBoard.isValidMove(2,4));\n\n //Try two times for a non-existing point on the board\n assertFalse(enemyGameBoard.isValidMove(15,5)); // x-value outside the board range\n assertFalse(enemyGameBoard.isValidMove(5,11)); // y-value outside the board range\n\n //hit a water field\n enemyGameBoard.makeMove(2, 3, false);\n assertTrue(board[2][3].equals(EnemyGameBoard.WATER_HIT));\n\n //try isValidMove() on the already hit water field\n assertFalse(enemyGameBoard.isValidMove(2,3));\n\n //hit a ship field\n enemyGameBoard.makeMove(5, 4, true);\n assertTrue(board[5][4].equals(EnemyGameBoard.SHIP_HIT));\n\n //try isValidMove() on the already hit water field\n assertFalse(enemyGameBoard.isValidMove(5,4));\n }", "public int verifyPlayerMovement(int x1, int y1, int x2, int y2){\n int deltaX = abs(x2-x1);\n int deltaY = abs(y2-y1);\n \n // already chosen position\n if ((deltaX == 0 && deltaY == 0) && (matrixUserChoices[x1][y1] == 1 || matrixUserChoices[x1][y1] == -1)){\n return -1;\n }\n else if (deltaX == 0 && deltaY == 0){\n return POSITIONATTACK;\n }\n else if (deltaX == 1 && deltaY == 1){\n return AREAATTACK;\n }\n else if (deltaX == 0 && deltaY == canvasNumberOfColumns-1){\n return LINEATTACK;\n }\n else if (deltaY == 0 && deltaX == canvasNumberOfLines-1){\n return COLUMNATTACK;\n }\n if ((deltaX == 0 && deltaY == 0) && (gameMatrix[x1][y1] == 1)){\n return -1;\n }\n else{\n return -1;\n }\n \n // the -1 value means an invalid movement \n }", "private void checkGameOver() {\n boolean isGameOver = true;\n for(int i = 0; i< noOfColumns; i++)\n for(int j = 0; i< noOfRows; i++)\n if(cards[i][j].getCardState() != CardState.MATCHED){\n isGameOver = false;\n break;\n }\n if(isGameOver){\n endGame();\n }\n }", "private boolean moveCheck(Piece p, List<Move> m, int fC, int fR, int tC, int tR) {\n if (null == p) {\n // Legal move!\n m.add(new Move(fC, fR, tC, tR));\n // Continue checking for moves.\n return false;\n }\n if (p.owner != whoseTurn) {\n // Enemy sighted!\n // Legal move!\n m.add(new Move(fC, fR, tC, tR));\n // No more moves!\n }\n return true;\n }", "public static boolean isBasicJumpValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t//is the impot is legal\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*is the target slot avalibel*/\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){/*is the player is red*/\t\t\t\r\n\t\t\t\t\tif((board[(fromRow+toRow)/2][(fromCol+toCol)/2]==-1)||(board[(fromRow+toRow)/2][(fromCol+toCol)/2]==-2)){/*is thier enemy solduers between the begning and the target*/\r\n\t\t\t\t\t\tif (board[fromRow][fromCol]==1){/*is thie simpol soldiuer in the bignning slot*/\r\n\t\t\t\t\t\t\tif(fromRow==toRow-2&&(fromCol==toCol+2||fromCol==toCol-2)){/*is eating diagonally upward and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{/*is thir queen in the starting slot*/\r\n\t\t\t\t\t\t\tif(((fromRow==toRow+2)||(fromRow==toRow-2))&&((fromCol==toCol+2)||(fromCol==toCol-2))){\r\n\t\t\t\t\t\t\t\t/*if is eating diagonally and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (board[fromRow][fromCol]==-1|board[fromRow][fromCol]==-2){/*is the solduer is blue*/\r\n\t\t\t\t\tif((board[(fromRow+toRow)/2][(fromCol+toCol)/2]==1)||(board[(fromRow+toRow)/2][(fromCol+toCol)/2]==2)){/*thie is an enemu betwen the teget and the begning*/\r\n\t\t\t\t\t\tif (board[fromRow][fromCol]==-1){\r\n\t\t\t\t\t\t\tif(fromRow==toRow+2&&(fromCol==toCol+2||fromCol==toCol-2)){/*is eating diagonally downward and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tif(((fromRow==toRow+2)||(fromRow==toRow-2))&&((fromCol==toCol+2)||(fromCol==toCol-2))){\r\n\t\t\t\t\t\t\t\t/*if is eating diagonally and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "private boolean checkMove(boolean[][] moves, Piece piece, int i, int j) {\r\n\t\tif (moves[i][j]) {\r\n\t\t\t// Moving piece \r\n\t\t\tthis.board[piece.getY()][piece.getX()] = null;\r\n\t\t\t\r\n\t\t\tPiece savePiece = this.board[i][j]; // Piece at i and j\r\n\t\t\tint saveX = piece.getX();\r\n\t\t\tint saveY = piece.getY();\r\n\t\t\t\r\n\t\t\tthis.board[i][j] = piece;\r\n\t\t\tpiece.setXY(j, i);\r\n\t\t\t\r\n\t\t\tif (savePiece != null) {\r\n\t\t\t\tkillPiece(savePiece);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean check = checkForCheck(piece.getPlayer());\r\n\t\t\t\r\n\t\t\t// return pieces to original states\r\n\t\t\tsetBack(i, j, savePiece, saveX, saveY);\r\n\t\t\tif (!check) {\r\n\t\t\t\t// There is a viable move to get out of check\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isCheck()\n {\n Game g = Game.getInstance();\n\n for(Piece[] p1 : g.m_board.m_pieces)\n {\n for(Piece p2 : p1)\n {\n if(p2 == null){ continue; }\n if(g.containsMove(new Move(m_x, m_y), p2.getMoves()))\n return true;\n }\n }\n\n return false;\n }", "public void gameOverCheck() {\n //users\n if (tankTroubleMap.getUsers().size() != 0) {\n tankTroubleMap.setWinnerGroup(tankTroubleMap.getUsers().get(0).getGroupNumber());\n for (int i = 1; i < tankTroubleMap.getUsers().size(); i++) {\n if (tankTroubleMap.getUsers().get(i).getGroupNumber() != tankTroubleMap.getWinnerGroup())\n return;\n }\n }\n //bots\n int firstBot = 0;\n if (tankTroubleMap.getBots().size() != 0) {\n if (tankTroubleMap.getWinnerGroup() == -1) {\n firstBot = 1;\n tankTroubleMap.setWinnerGroup(tankTroubleMap.getBots().get(0).getGroupNumber());\n }\n for (int i = firstBot; i < tankTroubleMap.getBots().size(); i++) {\n if (tankTroubleMap.getBots().get(i).getGroupNumber() != tankTroubleMap.getWinnerGroup())\n return;\n }\n }\n tankTroubleMap.setGameOver(true);\n }", "@Override\r\n\tboolean isFinished() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(checkForWin() != -1)\r\n\t\t\treturn true;\r\n\t\telse if(!(hasValidMove(0) || hasValidMove(1)))\r\n\t\t\treturn true; //game draw both are stuck\r\n\t\telse return false;\r\n\t}", "@Override\n\tpublic boolean canMove(Board board, Box start, Box end) {\n\t\tif(end.getPiece().isWhite() == this.isWhite()) {\n\t\t return false;\n\t\t}\n\n\t\tint x = Math.abs(start.getX() - end.getX());\n\t\tint y = Math.abs(start.getY() - end.getY());\n\t\tif(x + y == 1) {\n\t\t // check if this move will not result in king being attacked, if so return true\n\t\t return true;\n\t\t}\n\n\t\treturn false;\n\t}", "@Test\n public void isGameOverTwo() {\n this.reset();\n this.bps.startGame(this.fullDeck, false, 1, 0);\n assertTrue(this.bps.isGameOver());\n }", "public boolean checkForEndgame() {\n\t\tCalculatePossibleMoves(true);\n\t\tint blackMoves = getNumberOfPossibleMoves();\n\t\tCalculatePossibleMoves(false);\n\t\tint redMoves = getNumberOfPossibleMoves();\n\t\t\n\t\tif (blackMoves == 0 && redMoves == 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "@Test\n public void canMoveTest() {\n assertTrue(cp1.canMove(5, 3));\n assertTrue(cp1.canMove(1, 5));\n assertTrue(cp2.canMove(4, 6));\n assertTrue(cp2.canMove(6, 5));\n\n assertFalse(cp1.canMove(0, 5));\n assertFalse(cp1.canMove(3, 4));\n assertFalse(cp2.canMove(2, 6));\n assertFalse(cp2.canMove(7, 4));\n }", "@Override\n public boolean currentPlayerHavePotentialMoves() {\n return !checkersBoard.getAllPotentialMoves(getCurrentPlayerIndex()).isEmpty();\n }", "void checkWinner() {\n\t}", "private boolean checkMoveBase(Pieces piece, Coordinates from, Coordinates to) {\n\t\t//seleziono una posizione senza pedina\n\t\tif ( piece == null )\n\t\t\treturn false;\n\n\t\t//se la posizione tu non è contenuta nelle soluzioni valide della pedina from\n\t\tif ( !piece.validPositions(from).contains(to) )\n\t\t\treturn false;\n\n\t\t//se la posizione di destinazione contiene una pedina dello stesso colore\n\t\treturn !( chessboard.at(to) != null && chessboard.at(to).getColour().equals(piece.getColour()));\n\t}", "public boolean isValidMove(Point orig, Point dest){ \r\n Color playerColor = model.getCurrentPlayer().getColor();\r\n // Validate all point between board limits\r\n if(!isValidPosition(orig) || !isValidPosition(dest)) return false;\r\n // Check for continue move starting piece\r\n if(model.getCheckPiece() != null && !model.getCheckPiece().equals(orig)) return false;\r\n // Validate origin piece to player color\r\n if((isRed(playerColor) && !isRed(orig)) || (isBlack(playerColor) && !isBlack(orig))) return false;\r\n // Only can move to empty Black space\r\n if(!isEmpty(dest)) return false;\r\n // If current player have obligatory eats, then need to eat\r\n if(obligatoryEats(playerColor) && !moveEats(orig,dest)) return false;\r\n // Check move direction and length\r\n int moveDirection = orig.getFirst() - dest.getFirst(); // Direction in Rows\r\n int rLength = Math.abs(moveDirection); // Length in Rows\r\n int cLength = Math.abs(orig.getSecond() - dest.getSecond()); // Length in Columns\r\n int mLength;\r\n // Only acepts diagonal movements in 1 or 2 places (1 normal move, 2 eats move)\r\n if ((rLength == 1 && cLength == 1) || (rLength == 2 && cLength == 2)){\r\n mLength = rLength;\r\n } else {\r\n return false;\r\n }\r\n // 1 Place movement\r\n if (mLength == 1){ \r\n if (isRed(orig) && !isQueen(orig) && moveDirection > 0) return true;\r\n if (isBlack(orig) && !isQueen(orig) && moveDirection < 0) return true;\r\n if ((isRed(orig) && isQueen(orig)) || (isBlack(orig) && isQueen(orig))) return true;\r\n }\r\n // 2 Places movement need checks if eats rivals\r\n if (mLength == 2){\r\n // Compute mid point\r\n Point midPoint = getMidPoint(orig, dest);\r\n // Check move\r\n if ((isRed(orig) && isBlack(midPoint)) || (isBlack(orig) && isRed(midPoint))){\r\n if (isRed(orig) && !isQueen(orig) && moveDirection > 0) return true;\r\n if (isBlack(orig) && !isQueen(orig) && moveDirection < 0) return true;\r\n if ((isRed(orig) && isQueen(orig)) || (isBlack(orig) && isQueen(orig))) return true;\r\n }\r\n }\r\n return false;\r\n }", "@Override\n\tpublic boolean canMove(Board board, Box start, Box end) {\n\t\tif(end.getPiece().isWhite() == this.isWhite()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tint x = Math.abs(start.getX() - end.getX());\n\t\tint y = Math.abs(start.getY() - end.getY());\n\t\treturn x * y == 2;\n\t}", "public static void checkWinCondition() {\n\t\twin = false;\n\t\tif (curPlayer == 1 && arrContains(2, 4))\n\t\t\twin = true;\n\t\telse if (curPlayer == 2 && arrContains(1, 3))\n\t\t\twin = true;\n\t\tif (curPlayer == 2 && !gameLogic.Logic.arrContains(2, 4))\n\t\t\tP2P.gameLost = true;\n\t\telse if (gameLogic.Logic.curPlayer == 1 && !gameLogic.Logic.arrContains(1, 3))\n\t\t\tP2P.gameLost = true;\n\t\tif (P2P.gameLost == true) {\n\t\t\tif (gameLogic.Logic.curPlayer == 1)\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Black player won! </font></b></center></html>\");\n\t\t\telse\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Red player won! </font></b></center></html>\");\n\t\t}\n\t\telse\n\t\t\twin = false;\n\t}", "@Test\n public final void testPlayer2Win() {\n checkPlayerWin(player2);\n }", "public MoveType isMoveValid(int newIndexX, int newIndexY, int oldIndexX, int oldIndexY) {\n\n if (!isFieldPlaceable(newIndexX, newIndexY) || isFieldOccupied(newIndexX, newIndexY)) {\n return INVALID;\n }\n\n if (bestPieceFound) {\n if (bestPieceToMove != board[oldIndexY][oldIndexX].getPiece()) {\n //check if chosen piece is the best piece to move\n return INVALID;\n }\n if (bestMoveFound) {\n int yDir = (newIndexY - oldIndexY < 0) ? -1 : 1;\n int xDir = (newIndexX - oldIndexX < 0) ? -1 : 1;\n if (xDir != bestMoveDirectionX || yDir != bestMoveDirectionY) {\n return INVALID;\n }\n }\n }\n\n if (board[oldIndexY][oldIndexX].getPiece().getType().equals(PieceType.MEN)) {\n if (abs(newIndexY - oldIndexY) == 2) {\n //kill attempt\n int enemyY = newIndexY - ((newIndexY - oldIndexY) / 2);\n int enemyX = newIndexX - ((newIndexX - oldIndexX) / 2);\n\n if (isEnemyKilled(enemyX, enemyY, board)) {\n //check if kill will be executed properly\n board[enemyY][enemyX].setPiece(null);\n if (controller.killEnemy(enemyX, enemyY)) {\n //update view after killing\n if (round == PieceColor.LIGHT) {\n darkCounter -= 1;\n } else {\n lightCounter -= 1;\n }\n return KILL;\n } else {\n return INVALID;\n }\n }\n }\n\n if (board[oldIndexY][oldIndexX].getPiece().getMoveDirection() == (oldIndexY - newIndexY)) {\n //check if men moves in right direction\n if (killAvailable) {\n //if user execute normal move when kill is available, move is invalid\n return INVALID;\n }\n return MoveType.NORMAL;\n }\n } else if (board[oldIndexY][oldIndexX].getPiece().getType().equals(PieceType.KING)) {\n\n if (abs(newIndexX - oldIndexX) == abs(newIndexY - oldIndexY)) {\n //check if king moves diagonally\n\n int yDir = (newIndexY - oldIndexY < 0) ? -1 : 1;\n int xDir = (newIndexX - oldIndexX < 0) ? -1 : 1;\n\n if (piecesInKingsWay(oldIndexX, oldIndexY, newIndexX, newIndexY, xDir, yDir) == 1)\n //check if king is able to kill piece in its way\n if (isEnemyKilled(newIndexX - xDir, newIndexY - yDir, board)) {\n //check if king is placed just behind piece and try to kill\n return killUsingKing(newIndexX, newIndexY, xDir, yDir, board);\n } else {\n return INVALID;\n }\n else {\n if (piecesInKingsWay(oldIndexX, oldIndexY, newIndexX, newIndexY, xDir, yDir) > 1) {\n //if more pieces in kings way, it cant move over them\n return INVALID;\n }\n }\n\n\n if (newIndexX != oldIndexX && newIndexY != oldIndexY) {\n //every other possibility is checked, if place is changed it is normal move\n if (killAvailable) {\n return INVALID;\n }\n return MoveType.NORMAL;\n }\n }\n }\n if (newIndexX == oldIndexX && newIndexY == oldIndexY) {\n return MoveType.NONE;\n }\n return MoveType.INVALID;\n }", "private boolean canGetOutOfCheck(boolean[][] moves, Piece piece) {\r\n\t\tfor (int i = 0; i < this.SIZE; i++) {\r\n\t\t\tfor (int j = 0; j < this.SIZE; j++) {\r\n\t\t\t\tif(checkMove(moves, piece, i, j)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean checkForWin(){\n\t\t\n\t\tPlayer p = Game.getCurrPlayer();\n\t\t// if player made it to win area, player won\n\t\tif(p.won()){\n\t\t\tGame.gameWon = true;\n\t\t\tthis.network.sendWin();\n\t\t\treturn true;\n\t\t}\n\t\t// if player is the last player on the board, player won\n\t\tif(numPlayers == 1 && !p.hasBeenKicked()){\n\t\t\tGame.gameWon = true;\n\t\t\tthis.network.sendWin();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static boolean gameOver(int[][] board, int player) {\r\n\r\n\t\tboolean ans = false;\r\n\t\tint [][] positions = playerDiscs(board,player);\r\n\t\tboolean MoveOrJumps = hasValidMoves(board,player);\r\n\r\n\t\tif (positions.length==0||MoveOrJumps==true){\r\n\t\t\tans = true;\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "boolean canMove(Color player) {\n int[][] myStatusBoard;\n if (_playerOnMove == ORANGE) {\n myStatusBoard = _orangeStatusBoard;\n } else {\n myStatusBoard = _violetStatusBoard;\n }\n if (Game._totalMoves < 2) {\n return true;\n }\n int i, j;\n for (i = 0; i < 16; i++) {\n for (j = 0; j < 16; j++) {\n if (myStatusBoard[i][j] == 1) {\n if (findMove(i, j, myStatusBoard)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "public void setValidMoves(Board board, int x, int y, int playerType) {\n\t\tmoves.clear();\n\t\t// if this is pawn's first move, it can move two squares forward\n\t\tif (firstMove == true)\n\t\t{\n\t\t\t// white moves forward with y++\n\t\t\tif(this.getPlayer() == 1)\n\t\t\t{\n\t\t\t\tPoint firstMove = new Point(x + 0, y + 2);\n\t\t\t\tif (board.getPiece(x, y + 1) == null && board.getPiece(x, y + 2) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(firstMove);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// black moves forward with y--\n\t\t\telse\n\t\t\t{\n\t\t\t\tPoint firstMove = new Point(x + 0, y - 2);\n\t\t\t\tif (board.getPiece(x, y - 1) == null && board.getPiece(x, y - 2) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(firstMove);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (this.getPlayer() == 1)\n\t\t{\n\t\t\t// if a piece is occupying a square diagonal from pawn, it can capture\n\t\t\tif (x + 1 < 8 && y + 1 < 8 && x + 1 >= 0 && y + 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 1, y + 1);\n\t\t\t\tif (board.getPiece(x + 1, y + 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x+1,y+1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x - 1 < 8 && y + 1 < 8 && x - 1 >= 0 && y + 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x - 1, y + 1);\n\t\t\t\tif (board.getPiece(x - 1, y + 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x - 1, y + 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// if no piece is in front of pawn, it can move forward one square\n\t\t\tif (x < 8 && y + 1 < 8 && x >= 0 && y + 1 >=0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 0, y + 1);\n\t\t\t\tif (board.getPiece(x, y + 1) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// if a piece is occupying a square diagonal from pawn, it can capture\n\t\t\tif (x + 1 < 8 && y - 1 < 8 && x + 1 >= 0 && y - 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 1, y - 1);\n\t\t\t\tif (board.getPiece(x + 1, y - 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x + 1,y - 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x - 1 < 8 && y - 1 < 8 && x - 1 >= 0 && y - 1 >= 0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x - 1, y - 1);\n\t\t\t\tif (board.getPiece(x - 1, y - 1) != null)\n\t\t\t\t{\n\t\t\t\t\tif (board.getPiece(x - 1, y - 1).getPlayer() != this.getPlayer())\n\t\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// if no piece is in front of pawn, it can move forward one square\n\t\t\tif (x < 8 && y - 1 < 8 && x >= 0 && y - 1 >=0)\n\t\t\t{\n\t\t\t\tPoint move = new Point(x + 0, y - 1);\n\t\t\t\tif (board.getPiece(x, y - 1) == null)\n\t\t\t\t{\n\t\t\t\t\t\tmoves.add(move);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n\tpublic Collection<Move> calculateLegalMoves(final Board board) {\n\t\t\n\t\t//Array that will hold of the legal moves for the Pawn\n\t\tfinal List<Move> legalMoves = new ArrayList<>();\n\t\t\n\t\t//Loop through all possible moves by applying of the offsets to the Pawn's current position\n\t\tfor(final int currentCandidateOffset: CANDIDATE_MOVE_COORDINATES){\n\t\t\t\n\t\t\t//Apply the offset to the Pawn's current position\n\t\t\tfinal int candidateDestinationCoordinate = this.piecePosition + (this.getPieceTeam().getDirection() * currentCandidateOffset);\n\t\t\t\n\t\t\t//Checks if the Destination Coordinate is valid\n\t\t\tif(!BoardUtils.isValidTileCoordinate(candidateDestinationCoordinate)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Checks if this tile is occupied\n\t\t\tif(currentCandidateOffset == 8 && !board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnMove(board, this, candidateDestinationCoordinate)));\n\t\t\t\telse\n\t\t\t\t\tlegalMoves.add(new Move.PawnMove(board, this, candidateDestinationCoordinate));\t\n\t\t\t}\n\t\t\t//Checks if the Pawn is on it's first move\n\t\t\telse if(currentCandidateOffset == 16 && this.isFirstMove() && ((BoardUtils.SEVENTH_RANK[this.piecePosition] && \n\t\t\t\t\tthis.getPieceTeam().isBlack()) || (BoardUtils.SECOND_RANK[this.piecePosition] && this.getPieceTeam().isWhite()))) {\n\t\t\t\t\n\t\t\t\t//Calculate coordinate of the tile behind candidate coordinate\n\t\t\t\tfinal int behindCandidateDestinationCoordinate = this.piecePosition + (this.pieceTeam.getDirection() * 8);\n\t\t\t\t\n\t\t\t\t//Checks if the tile behind the candidate destination is NOT occupied & if the Tile at the Candidate Destination is NOT occupied\n\t\t\t\tif(!board.getTile(behindCandidateDestinationCoordinate).isTileOccupied() && \n\t\t\t !board.getTile(candidateDestinationCoordinate).isTileOccupied())\n\t\t\t\t\t\tlegalMoves.add(new Move.PawnJump(board, this, candidateDestinationCoordinate));\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t//Checks for edge cases in the 7 direction\t\n\t\t\t} else if(currentCandidateOffset == 7 &&\n\t\t\t\t\t!((BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t\n\t\t\t\t//This basically checks if En Passant Pawn is next to Player's pawn\t\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition + (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//Checks for edge cases in the 9 direction\t\n\t\t\t} else if(currentCandidateOffset == 9 && \n\t\t\t\t\t!((BoardUtils.FILE_A[this.piecePosition] && this.getPieceTeam().isWhite() ||\n\t\t\t\t\t(BoardUtils.FILE_H[this.piecePosition] && this.getPieceTeam().isBlack())))){\n\t\t\t\t\n\t\t\t\tif(board.getTile(candidateDestinationCoordinate).isTileOccupied()){\n\t\t\t\t\tfinal Piece pieceOnCandidate = board.getTile(candidateDestinationCoordinate).getPiece();\n\t\t\t\t\t//If the pieces are not on the same team an Attack move is added to legal moves.\n\t\t\t\t\tif(this.getPieceTeam() != pieceOnCandidate.getPieceTeam())\n\t\t\t\t\t\tif(this.pieceTeam.isPawnPromotionSquare(candidateDestinationCoordinate))\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnPromotion(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate)));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t} else if(board.getEnPassantPawn() != null){\n\t\t\t\t\tif(board.getEnPassantPawn().getPiecePosition() == (this.piecePosition - (this.pieceTeam.getOppositeDirection()))){\n\t\t\t\t\t\tfinal Piece pieceOnCandidate = board.getEnPassantPawn();\n\t\t\t\t\t\tif(this.pieceTeam != pieceOnCandidate.getPieceTeam()){\n\t\t\t\t\t\t\tlegalMoves.add(new Move.PawnEnPassantAttackMove(board, this, candidateDestinationCoordinate, pieceOnCandidate));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn ImmutableList.copyOf(legalMoves);\n\t}", "public boolean legalMove(ArrayList<Point2D> inputMove,ArrayList<Object> Gamestate){\n FooHistory currentGameState = (FooHistory) Gamestate.get(0);\n ArrayList<Point2D> player1moves= currentGameState.getCurrentState().get(0);\n ArrayList<Point2D> player2moves= currentGameState.getCurrentState().get(1);\n //System.out.println(\"Player1 moves in FooRules: \"+ player1moves);\n \n if(inputMove.size()==1){\n for(ArrayList<Point2D> array: currentGameState.getCurrentState()){\n for(Point2D point:array){\n if(inputMove.get(0).getX()==point.getX() && inputMove.get(0).getY()==point.getY()){\n System.out.println(\"Ilegal Move\");\n return false;\n }\n }\n }\n return true;\n }\n else{//Deals with moving a piece to take pieces\n if(adjacent(inputMove.get(0),inputMove.get(1))){//Makes sure the two input moves are adjacent\n if(currentGameState.getTurnCount()%2==1){ //Player 1's turn\n for(Point2D point:player2moves){\n if(point.getX()==inputMove.get(1).getX() && point.getY()==inputMove.get(1).getY()){\n return true;\n }\n }\n }\n if(currentGameState.getTurnCount()%2==0){//Player 2's turn\n for(Point2D point:player1moves){\n if(point.getX()==inputMove.get(1).getX() && point.getY()==inputMove.get(1).getY()){\n return true;\n }\n }\n }\n }\n System.out.println(\"Ilegal Move\"); \n return false; \n }\n \n }", "void doMakeMove(CheckersMove move) {\n\n boardData.makeMove(move, false);\n\n /* If the move was a jump, it's possible that the player has another\n jump. Check for legal jumps starting from the square that the player\n just moved to. If there are any, the player must jump. The same\n player continues moving. */\n \n if (move.isJump()) {\n legalMoves = boardData.getLegalJumpsFrom(currentPlayer, move.toRow, move.toCol);\n if (legalMoves != null) {\n if (currentPlayer == CheckersData.RED) {\n console(\"RED: You must continue jumping.\");\n } else {\n console(\"BLACK: You must continue jumping.\");\n }\n selectedRow = move.toRow; // Since only one piece can be moved, select it.\n selectedCol = move.toCol;\n refreshBoard();\n return;\n }\n }\n\n /* The current player's turn is ended, so change to the other player.\n Get that player's legal moves. If the player has no legal moves,\n then the game ends. */\n if (currentPlayer == CheckersData.RED) {\n currentPlayer = CheckersData.BLACK;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"BLACK has no moves. RED wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"BLACK: Make your move. You must jump.\");\n } else {\n console(\"BLACK: Make your move.\");\n }\n } else {\n currentPlayer = CheckersData.RED;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"RED has no moves. BLACK wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"RED: Make your move. You must jump.\");\n } else {\n console(\"RED: Make your move.\");\n }\n }\n\n /* Set selectedRow = -1 to record that the player has not yet selected\n a piece to move. */\n selectedRow = -1;\n\n /* As a courtesy to the user, if all legal moves use the same piece, then\n select that piece automatically so the user won't have to click on it\n to select it. */\n if (legalMoves != null) {\n boolean sameStartSquare = true;\n for (int i = 1; i < legalMoves.length; i++) {\n if (legalMoves[i].fromRow != legalMoves[0].fromRow\n || legalMoves[i].fromCol != legalMoves[0].fromCol) {\n sameStartSquare = false;\n break;\n }\n }\n if (sameStartSquare) {\n selectedRow = legalMoves[0].fromRow;\n selectedCol = legalMoves[0].fromCol;\n }\n }\n\n /* Make sure the board is redrawn in its new state. */\n refreshBoard();\n\n }", "public boolean isValidMove(int x, int y) {\n\n\t\t//A move is invalid\n\t\t// 1 - the cell that someone is trying to move to, is not empty\n\t\t// 2 - the co-ordinate of the cell is out of bounds of our double board array\n\n\t\t// First check if move is valid\n\t\tif (!isCellEmpty(x,y)) {\n\n\t\t\treturn false; // invalid move case 1\n\n\t\t} else if (!Utility.isWithinRange(x,0,2) || !Utility.isWithinRange(y,0,2)) {\n\n\t\t\treturn false; // invalid move case 2 \n\t\t\t\n\t\t}\n\n\t\treturn true;\n\n\t}", "public void checkGameOver() {\n if(snake.getX() < 0 || snake.getX() > WIDTH - 4) { setGameState(GameState.GAME_OVER); }\n if(snake.getY() < 0 || snake.getY() > HEIGHT - 4) { setGameState(GameState.GAME_OVER); }\n if(snake.hasCollided()) { setGameState(GameState.GAME_OVER); }\n\n }", "public boolean validMove(int x, int y, boolean blackPlayerTurn)\n\t{\n\t\t// check holds 'B' if player black or 'W' if player white\n\t\tchar check;\n\t\tchar checkNot;\n\t\tcheck = blackPlayerTurn ? 'B' : 'W';\n\t\tcheckNot = !blackPlayerTurn ? 'B' : 'W';\n\t\tchar[][] arrayClone = cloneArray(currentBoard);\n\t\t// check if board position is empty\n\t\tif (currentBoard[x][y] == ' ')\n\t\t{\n\t\t\t// prime arrayClone by placing piece to be place in spot\n\t\t\tarrayClone[x][y] = check;\n\t\t\t// check if capture of other players pieces takes place (up, right, left, down)\n\t\t\t// checkNot\n\t\t\tcaptureCheck(x, y, checkNot, arrayClone);\n\t\t\t// if our candidate placement has liberties after capture check then place\n\t\t\t// piece!\n\t\t\tif (hasLibTest(x, y, check, arrayClone))\n\t\t\t{\n\t\t\t\tif (pastBoards.contains(arrayClone))\n\t\t\t\t{\n\t\t\t\t\t// do not allow repeat boards\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcurrentBoard = cloneArray(arrayClone);\n\t\t\t\t// make move handles actually piece placement so remove check from board\n\t\t\t\tarrayClone[x][y] = ' ';\n\t\t\t\t// arrayClone contains updated positions with captured pieces removed\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public static void checkWinner() {\n\t\tcontinueGame = false;\n\t\tfor (int k = 0; k < secretWordLength; k++) {\n\t\t\tif (!unseenBoard.get(k).equals(\"*\")) {\n\t\t\t\tcontinueGame = true;\n\t\t\t}\n\t\t}\n\t}", "public void NoCoordinatesValidMoveTwoInput(int worker) {\n notifyNoCoordinatesValidMoveTwoInput(worker, this.getCurrentTurn().getCurrentPlayer().getNickname());\n }", "private boolean checkPlayerOneWin()\n {\n boolean playerOneWin = false;\n \n if( board[0][0] == \"X\" && board[0][1] == \"X\" && board[0][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[1][0] == \"X\" && board[1][1] == \"X\" && board[1][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[2][0] == \"X\" && board[2][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][0] == \"X\" && board[1][0] == \"X\" && board[2][0] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][1] == \"X\" && board[1][1] == \"X\" && board[2][1] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[2][0] == \"X\" && board[2][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][0] == \"X\" && board[1][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][2] == \"X\" && board[1][1] == \"X\" && board[2][0] == \"X\" )\n {\n playerOneWin = true;\n }\n \n return playerOneWin;\n }", "public boolean isGameOver() {\n if (winner == null) {\n Piece[] diagOne = new Piece[this.size];\n Piece[] diagTwo = new Piece[this.size];\n for (int col = 0; col < _board.length; col += 1) {\n diagOne[col] = _board[col][col];\n diagTwo[col] = _board[col][this.size - 1 - col];\n if (isWinning(_board[col])) {\n alternatePlayer(currPlayer);\n winner = currPlayer;\n return true;\n }\n }\n this.transpose();\n for (int row = 0; row < _board[0].length; row += 1) {\n if (isWinning(this._board[row])) {\n this.transpose();\n alternatePlayer(currPlayer);\n winner = currPlayer;\n return true;\n }\n }\n\n this.transpose();\n\n if (isWinning(diagOne) || isWinning(diagTwo)) {\n alternatePlayer(currPlayer);\n winner = currPlayer;\n return true;\n }\n if (checkTie()) {\n return true;\n }\n }\n return false;\n }", "@Override\n\tpublic void makeMove(Game game) \n\t{\n\t\t\n\t\tint row1,col1,row2,col2;\n\t\tCheckers tttGame = (Checkers) game;\n\t\t\n\t\tboolean first = true;\n\n\t\t\tcorrectmove= false;\n\t\t\tSystem.out.println(\"Insert target (row,column) and destination (row, column) ([0,7])\");\n\n\t\t\trow1 = tttGame.x1;\n\t\t\tcol1 = tttGame.y1;\n\t\t\trow2 = tttGame.x2;\n\t\t\tcol2 = tttGame.y2;\n\t\t\tSystem.out.println(row1 + \" \" + col1 + \" \" + row2 + \" \" + col2 + \" \" + role);\n\t\t\t\n\t\t\tfirst=false;\n\t\tcorrectmove= tttGame.isValidCell(row1, col1, row2, col2,role);\n\t\tSystem.out.println(correctmove);\n\n\t\tif(correctmove)\n\t\t{\n\t\t\ttttGame.board[row2][col2]= tttGame.board[row1][col1];\n\t\t\tif(row2==0 && role==0) \n\t\t\t{\n\t\t\t\tif(role==0) tttGame.board[row2][col2]= 2;\n\t\t\t\telse tttGame.board[row2][col2]= -2;\n\t\t\t}\n\t\t\telse if(row2==7 && role==1) \n\t\t\t{\n\t\t\t\tif(role==0) tttGame.board[row2][col2]= 2;\n\t\t\t\telse tttGame.board[row2][col2]= -2;\n\t\t\t}\n\t\t\ttttGame.board[row1][col1]=0;\n\t\t\tif(abs(row1-row2)==2)\n\t\t\t{\n\t\t\t\tint x= (row1+ row2)/2;\n\t\t\t\tint y= (col1+ col2)/2;\n\t\t\t\ttttGame.board[x][y]=0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"invalid move!\");\n\t\t}\n\t\t\n//\t\ttttGame.board[row][col] = role;\n\t}", "void oppInCheck(Piece[] B,Player J2,boolean moveFound);", "public boolean isMoveLegal(int x, int y) {\n\t\tif (rowSize <= x || colSize <= y || x < 0 || y < 0) {\r\n\t\t\t// System.out.print(\"Position (\" + (x + 1) + \", \" + (y + 1) + \") is\r\n\t\t\t// out of range!\\n\");\r\n\t\t\treturn false;\r\n\t\t} else if (!(matrix[x][y] == 0)) {\r\n\t\t\t// System.out.print(\"Position (\" + (x + 1) + \", \" + (y + 1) + \") has\r\n\t\t\t// been occupied!\\n\");\r\n\t\t\treturn false;\r\n\t\t} else\r\n\t\t\treturn true;\r\n\t}", "private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }", "private boolean isCheckMate() {\n if (whitePlayer.getOccupiedSet().isEmpty()) {\n System.out.println(\"BLACK PLAYER WINS\");\n return true;\n }\n else if (blackPlayer.getOccupiedSet().isEmpty()) {\n System.out.println(\"WHITE PLAYER WINS\");\n return true;\n }\n else return false;\n }", "public boolean validMove(int x, int y){\n if(!super.validMove(x, y)){\n return false;\n }\n if(((Math.abs(x - this.x()) == 2) && (Math.abs(y - this.y()) == 1))\n || ((Math.abs(x - this.x()) == 1) && (Math.abs(y - this.y()) == 2))){\n return true;\n }else{\n return false;\n }\n }", "public void turnOver() {\n if(firstPlayer == whosTurn()) {\n turn = secondPlayer;\n } else {\n turn = firstPlayer;\n }\n hasPlacedPiece = false;\n hasRotatedBoard = false;\n }", "private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }", "public boolean isValidMove(Location from, Location to, Piece[][]b) {\n\t\t// Bishop\n\t\tboolean pieceInWay = true;\n\t\tint direction =0; \n\t\tboolean finalLocation = false;\n\t\tboolean verticalUp = false, verticalDown = false, horizontalLeft = false, horizontalRight = false;\n\t\t\n\t\tif(to.getColumn()>from.getColumn() && to.getRow()<from.getRow()){\n\t\t\tdirection = 1;\n\t\t}\n\t\telse if (to.getColumn()<from.getColumn() && to.getRow()>from.getRow()){\n\t\t\tdirection = 2;\n\t\t}\n\t\telse if (to.getColumn()<from.getColumn() && to.getRow()<from.getRow()){\n\t\t\tdirection = 4;\n\t\t}\n\t\telse\n\t\t\tdirection = 3;\t\n\t\t\n\t\t\n\t\tif (Math.abs(from.getColumn() - to.getColumn()) == Math.abs(from.getRow() - to.getRow())\n\t\t\t\t&& b[to.getRow()][to.getColumn()].getPlayer() != getPlayer()\n\t\t\t\t&& !pieceInWay/*b[to.getRow()][to.getColumn()].getPlayer() == 0 b[from.getRow()+1][from.getColumn()+1]*/) {\n\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Rook\n\n\t\t//This line checks to see if the final destination of the piece contains anything but a friendly piece. This is here, because\n\t\t//anything other than a friendly piece would make the move valid, given that every space in between is blank.\n\t\tif(b[to.getRow()][to.getColumn()].getPlayer() != b[from.getRow()][from.getColumn()].getPlayer())\n\t\t\tfinalLocation = true;\n\t\telse\n\t\t\tfinalLocation = false;\n\t\t\n\t\t//verticalUp\n\t\tif(from.getRow() == to.getRow() && from.getColumn() > to.getColumn()){\n\t\t\tverticalUp = true;\n\t\t\tfor(int i = to.getColumn(); i < from.getColumn() && verticalUp; i++){\n\t\t\t\tif(b[to.getRow()][i].getPlayer() == 0 && verticalUp){\n\t\t\t\t\tverticalUp = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tverticalUp = false;\n\t\t\t}\n\t\t}\n\t\t//verticalDown\n\t\telse if(from.getRow() == to.getRow() && from.getColumn() < to.getColumn()){\n\t\t\tverticalDown = true;\n\t\t\tfor(int i = from.getColumn(); i < to.getColumn() && verticalDown; i++){\n\t\t\t\tif(b[from.getRow()][i].getPlayer() == 0 && verticalDown){\n\t\t\t\t\tverticalDown = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tverticalDown = false;\n\t\t\t}\n\t\t}\n\t\t//horizontalLeft\n\t\telse if(from.getColumn() == to.getColumn() && from.getRow() > to.getRow()){\n\t\t\thorizontalLeft = true;\n\t\t\tfor(int i = to.getRow(); i < from.getRow() && horizontalLeft; i++){\n\t\t\t\tif(b[i][to.getColumn()].getPlayer() == 0 && horizontalLeft){\n\t\t\t\t\thorizontalLeft = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\thorizontalLeft = false;\n\t\t\t}\n\t\t}\n\t\t//horizontalRight\n\t\telse if(from.getColumn() == to.getColumn() && from.getRow() < to.getRow()){\n\t\t\thorizontalRight = true;\n\t\t\tfor(int i = from.getRow(); i < to.getRow() && horizontalRight; i++){\n\t\t\t\tif(b[i][from.getColumn()].getPlayer() == 0 && horizontalRight){\n\t\t\t\t\thorizontalRight = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\thorizontalRight = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(verticalUp || verticalDown || horizontalLeft || horizontalRight && finalLocation){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public void checkSetPlayerTurn() // Check and if needed set the players turns so it is their turn.\n\t{\n\t\tswitch (totalPlayers) // Determine how many players there are...\n\t\t{\n\t\tcase 2: // For two players...\n\t\t\tswitch (gameState)\n\t\t\t{\n\t\t\tcase twoPlayersNowPlayerOnesTurn: // Make sure it's player one's turn.\n\t\t\t\tplayers.get(0).setIsPlayerTurn(true);\n\t\t\t\tbreak;\t\t\t\t\n\t\t\tcase twoPlayersNowPlayerTwosTurn: // Make sure it's player two's turn.\n\t\t\t\tplayers.get(1).setIsPlayerTurn(true);\n\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t}", "public boolean canMove2() {\n\t\tGrid<Actor> gr = getGrid(); \n\t\tif (gr == null) {\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\tLocation loc = getLocation(); \n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (!gr.isValid(next)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!gr.isValid(next2)) {\n\t\t\treturn false;\n\t\t}\n\t\tActor neighbor = gr.get(next2); \n\t\treturn (neighbor == null) || (neighbor instanceof Flower); \n\t}", "static void checkCompleteness(Piece piece1, Piece piece2, Context context) {\n\t\tif (isSolved()) { //puzzle is solved\n \t\tpuzzleComplete(context); //cleanup\n \t} else {\n \t\tif(isPieceCorrect(piece1)) { //piece is in the correct position and orientation\n \t\t\tmarkPiece(piece1, true); //mark the piece as correct\n \t\t}\n \t\tif(Helper.isPieceCorrect(piece2)) { //piece is in the correct position and orientation\n \t\t\tmarkPiece(piece2, true); //mark the piece as correct\n \t\t}\n \t}\n\t}" ]
[ "0.6972275", "0.6912142", "0.6837607", "0.681851", "0.6780781", "0.67553604", "0.67080176", "0.66978765", "0.66589814", "0.6644148", "0.6558877", "0.6546216", "0.6495472", "0.6487584", "0.6481598", "0.6479931", "0.64747566", "0.64712393", "0.64586127", "0.6458013", "0.64565194", "0.64432955", "0.6439186", "0.64383423", "0.64357966", "0.642115", "0.63886255", "0.6374935", "0.63734555", "0.6370852", "0.636847", "0.6351947", "0.6341238", "0.6336026", "0.6322639", "0.63179696", "0.63085604", "0.6307479", "0.6305993", "0.6304165", "0.6297674", "0.6278676", "0.6278314", "0.62760365", "0.62688774", "0.62497276", "0.6247062", "0.6245879", "0.62413", "0.62359625", "0.623386", "0.623159", "0.6216164", "0.6211182", "0.6199023", "0.61950517", "0.6194862", "0.6190218", "0.6190123", "0.6182933", "0.61806417", "0.61760837", "0.61697364", "0.6163523", "0.6159591", "0.6154815", "0.615332", "0.6143249", "0.6134889", "0.612609", "0.6119163", "0.61187756", "0.61139995", "0.61091626", "0.61073875", "0.6107272", "0.6105006", "0.6104084", "0.6103574", "0.6102272", "0.6100939", "0.6099222", "0.6092812", "0.6090747", "0.60895336", "0.60881084", "0.6086763", "0.60843337", "0.60735744", "0.6072067", "0.6068235", "0.6065187", "0.60631734", "0.60626733", "0.6057695", "0.60500413", "0.60375243", "0.6034464", "0.6031294", "0.6030348" ]
0.6941133
1
First validation check, checks to see if the pending coordinate is being placed on a [] space. If it's not, the validation will resutl in false;
public static boolean validationcheck(int row, int column, String piecevalue){ if(board[row][column].equals("x")||board[row][column].equals("o")){ return false; } else{ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean judgeValid()\r\n\t{\r\n\t\tif(loc.i>=0 && loc.i<80 && loc.j>=0 && loc.j<80 && des.i>=0 && des.i<80 && des.j>=0 && des.j<80)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t\t\r\n\t}", "private boolean hasValidBounds() {\n\n\n\n return false;\n }", "private boolean isLegalCoordinate(int row, int col) {\n return row > 0 && row <= getSize() && col > 0 && col <= getSize();\n }", "protected boolean validCoord(int row, int col) {\n\t\treturn (row >= 0 && row < b.size() && col >= 0 && col < b.size());\n\t}", "@Override\n public boolean isLocationValid(XYCoord coords)\n {\n return master.isLocationValid(coords);\n }", "public boolean checkRep() {\n return location.x() >= 0 && location.x() < board.getWidth() && \n location.y() >= 0 && location.y() < board.getHeight(); \n }", "public boolean validStopCheck(){\n return points.validPolygon();\n }", "private boolean locateSafety(String[] coord) {\n\n int[] indices = getIndexFromCoord(coord);\n int x0 = indices[0];\n int y0 = indices[1];\n int x1 = indices[2];\n int y1 = indices[3];\n\n\n if (x0 == x1) {\n // horizontal\n int northIndex = x0 > 0 ? x0 - 1 : -1;\n int southIndex = x0 < Row.values().length - 1 ? x0 + 1 : -1;\n int leftIndex = y0 > 0 ? y0 - 1 : -1;\n int rightIndex = y1 < fields.length - 1 ? y1 + 1 : -1;\n // check north area\n if (northIndex != -1) {\n for (int i = y0; i <= y1; i++) {\n if (fields[northIndex][i].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check south area\n if (southIndex != -1) {\n for (int i = y0; i <= y1; i++) {\n if (fields[southIndex][i].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check left\n if (leftIndex != -1 && fields[x0][leftIndex].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check right\n if (rightIndex != -1 && fields[x0][rightIndex].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n\n } else {\n // vertical\n int leftCol = y0 > 0 ? y0 - 1 : -1;\n int rightCol = y0 < fields.length - 1 ? y0 + 1 : -1;\n int northIndex = x0 > 0 ? x0 - 1 : -1;\n int southIndex = x1 < Row.values().length -1 ? x1 + 1 : -1;\n\n // check north\n if (northIndex != -1 && fields[northIndex][y0].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check south\n if (southIndex != -1 && fields[southIndex][y0].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n // check left\n if (leftCol != -1) {\n for (int i = x0; i <= x1; i++) {\n if (fields[i][leftCol].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n // check right\n if (rightCol != -1) {\n for (int i = x0; i <= x1; i++) {\n if (fields[i][rightCol].isShip()) {\n System.out.println(\"Error! You placed it too close to another one. Try again:\");\n return false;\n }\n }\n }\n }\n return true;\n }", "@Override\n public boolean isLocationValid(int x, int y)\n {\n return master.isLocationValid(x, y);\n }", "private boolean isValidPosition(Point pos){\r\n return (0 <= pos.getFirst() && pos.getFirst() < 8 && \r\n 0 <= pos.getSecond() && pos.getSecond() < 8);\r\n }", "public boolean needCoordinates() { return needCoords; }", "private boolean hasValidNumber(String[] coord, int numShip) {\n int[] indices = getIndexFromCoord(coord);\n int x0 = indices[0];\n int y0 = indices[1];\n int x1 = indices[2];\n int y1 = indices[3];\n\n if (x0 == x1) {\n // horizontal ships\n if (Math.abs(y0 - y1) + 1 != numShip) {\n System.out.println(\"Error! Wrong length of the Submarine! Try again:\");\n return false;\n }\n return true;\n } else {\n // vertical ships\n if (Math.abs(x0 - x1) + 1 != numShip) {\n System.out.println(\"Error! Wrong length of the Submarine! Try again:\");\n return false;\n }\n return true;\n }\n }", "public boolean isValidPlacementSpot() {\n return isEmpty() && ! getNeighbours().stream().allMatch(Spot::isEmpty);\n }", "public boolean isValid(){\n\t\tif (bigstart != null && bigend != null){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isValid(){\n\t\treturn points.size() >= 2;\n\t}", "public boolean outOfRange(){\r\n\t\t\treturn (shape.x <=0 ? true : false);\r\n\t\t}", "@Override\n public boolean isLocationEmpty(int x, int y)\n {\n return isLocationEmpty(null, x, y);\n }", "public boolean Validate_Input(String attack_coord){\r\n\t\tattack_coord=attack_coord.trim(); //deletes any unecessary whitespace\r\n\t\tif(attack_coord.length()>3) { //format incorrect\r\n\t\t\tdisplay.scroll(\"Input string too long to be proper coordinate\");\r\n\t\t\tdisplay.printScreen();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(attack_coord.length()<=1){\r\n\t\t\tdisplay.scroll(\"Input string too short to be proper coordinate\");\r\n\t\t\tdisplay.printScreen();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// Convert the string inputs into integers\r\n\t\tString x_as_string = attack_coord.substring(1);\r\n\t\tycoor = letterToIndex(attack_coord.charAt(0));\r\n\t\t\r\n\t\t\r\n\t\ttry{\r\n\t\t\txcoor=Integer.parseInt(x_as_string);\r\n\t\t\txcoor--; //to match the xcoor with the array position\r\n\t\t} catch (NumberFormatException nfe) {\r\n\t display.scroll(\"Incorrect Format. Enter with letter and then number i.e. B3\");\r\n\t display.printScreen();\r\n\t return false;\r\n\t\t}\r\n\r\n\t\t\r\n\t\t\r\n\r\n\t\tif(!hisBoard.in_Grid(xcoor, ycoor)){\r\n\t\t\tdisplay.scroll(\"The Coordinate input is not within (A-J) or (1-10)\");\r\n\t\t\tdisplay.printScreen();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(hisBoard.already_attacked(xcoor,ycoor)){\r\n\t\t\tdisplay.scroll(\"Coordinate has already been attacked\");\r\n\t\t\tdisplay.printScreen();\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean isValidCoordinate(int x, int y) {\n return x >= 0 && x < gameState.mapSize\n && y >= 0 && y < gameState.mapSize;\n }", "private boolean isLegalPositon(Position checkPosition){\n if (checkPosition.equalPosition(start)||checkPosition.equalPosition(end))\n return true;\n if(checkPosition.getRow()<0 || checkPosition.getCol()<0 || checkPosition.getRow()>=this.rows || checkPosition.getCol() >= this.cols){\n return false;\n }\n\n if(maze[checkPosition.getRow()][checkPosition.getCol()]== WallType.wall){\n return false;\n }\n return true;\n }", "public boolean someLegalPos() {\n return !legalPos.isEmpty();\n }", "private boolean validateOutOfRangeCoordinate() throws IOException {\n int maxValue = Integer.parseInt(Objects.requireNonNull(FileUtils.getProperty(\"max-coordinate-value\")));\n return (Math.abs(getX()) > maxValue) || (Math.abs(getY()) > maxValue);\n }", "public boolean isPositionValid(){\n\t\t//check overlapping with walls\n\t\tfor(Wall wall : Game.gameField.getWalls()){\n\t\t\tif(wall.overlaps(center))\n\t\t\t\treturn false;\n\t\t}\n\t\t//check overlapping with other balls\n\t\tfor(Ball ball : Game.gameField.getBalls()){\n\t\t\tif(ball == this)\n\t\t\t\tcontinue;\n\t\t\tif(ball.getCenterPoint().distance(center) < RADIUS * 2)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn GameField.FIELD.contains(center);\n\t}", "public boolean hasValidPoint() {\n return mPoint.x != 0 || mPoint.y != 0;\n }", "protected boolean checkRep() {\n if ( this.getX() < 0 || this.getY() < 0 || this.getX() >= 20 || this.getY() >= 20 ) {\n return false;\n }\n return true;\n }", "public boolean isValid() {\n return coordinates != null && coordinates.size() == 2\n && coordinates.get(0) >= -180.0 && coordinates.get(0) <= 180.0\n && coordinates.get(1) >= -90.0 && coordinates.get(1) <= 90.0\n && (coordinateSystem == null || coordinateSystem.isValid());\n }", "@Override public boolean isValidated()\n{\n if (location_set.size() == 0 || !have_join) return false;\n\n return true;\n}", "public boolean validateShipPlacement(Ship thisShip, String coordinate,\r\n\t\t\tint direction) {\r\n\t\tint letterCoord = letterToIndex(coordinate.charAt(0));\r\n\t\tint numberCoord;\r\n\t\ttry{\r\n\t\tnumberCoord = Integer.parseInt(coordinate.substring(1))-1;\r\n\t\t}catch (NumberFormatException nfe){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (thisShip.placed == true)\r\n\t\t\treturn false;\r\n\t\telse {\r\n\t\t\tif (myBoard.in_Grid(numberCoord, letterCoord)) {\r\n\t\t\t\tif (direction == 1) { //left to right\r\n\t\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\t\tif (myBoard\r\n\t\t\t\t\t\t\t\t.in_Grid(numberCoord+i, letterCoord) == false\r\n\t\t\t\t\t\t\t\t|| isOccupied(numberCoord+i, letterCoord)) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (direction == 2) { //top to bottom\r\n\t\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\t\tif (myBoard\r\n\t\t\t\t\t\t\t\t.in_Grid(numberCoord, letterCoord+i) == false\r\n\t\t\t\t\t\t\t\t|| isOccupied(numberCoord, letterCoord+i)) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (direction == 3) { //right to left\r\n\t\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\t\tif (myBoard\r\n\t\t\t\t\t\t\t\t.in_Grid(numberCoord-i, letterCoord ) == false\r\n\t\t\t\t\t\t\t\t|| isOccupied(numberCoord-i, letterCoord )) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (direction == 4) { //bottom to top\r\n\t\t\t\t\tfor (int i = 0; i < thisShip.getSize(); i++) {\r\n\t\t\t\t\t\tif (myBoard\r\n\t\t\t\t\t\t\t\t.in_Grid(numberCoord, letterCoord-i) == false\r\n\t\t\t\t\t\t\t\t|| isOccupied(numberCoord, letterCoord-i)) {\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void checkRep() {\n assert (width <= Board.SIDELENGTH);\n assert (height <= Board.SIDELENGTH);\n assert (this.boundingBoxPosition.x() >= 0 && this.boundingBoxPosition.x() <= Board.SIDELENGTH);\n assert (this.boundingBoxPosition.y() >= 0 && this.boundingBoxPosition.y() <= Board.SIDELENGTH);\n }", "public boolean isValid() {\n\t\treturn (x >= 0 && x < Board.SIZE && y >= 0 && y < Board.SIZE);\n\t}", "@Override\n public boolean isLocationEmpty(XYCoord coords)\n {\n return isLocationEmpty(null, coords.xCoord, coords.yCoord);\n }", "public boolean inValidSpot(Path p1){\n\t\t// Checks to see it the path piece placed expects an entrance or exit piece out of bounds\n\t\t\n\t\tint largestRow = (height*width-1)/width;\n\t\t\n\t\t// if entrance or exit pos expected is negative, know it is expecting a path outside the top bound\n\t\tif(p1.getEntry()<0 || p1.getExit()<0){\n\t\t\treturn false;\n\t\t}\n\t\t// if entrance or exit's row greater than the maximum row, know it is expecting a path outside bottom bound\n\t\tif(p1.getEntryRow()>largestRow || p1.getExitRow()>largestRow){\n\t\t\treturn false;\n\t\t}\n\t\tint currentRow = p1.getRow();\n\t\tint nextRow=0;\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==1){\n\t\t\t// If the absolute value of the difference between the current position and its entrance is 1 ...\n\t\t\t// Checking to see if the entrance is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the entrance expected is not to the left or to the right\n\t\t\t\t// In other words, the entrance is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==1){\n\t\t\t// If the absolute value of the difference between the current position and its exit is 1 ...\n\t\t\t// Checking to see if the exit is expected to be outside of the left or right edges of Map\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(currentRow!=nextRow){\n\t\t\t\t// This means that the exit expected is not to the left or to the right\n\t\t\t\t// In other words, the exit is expected in another row\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\tif(Math.abs(p1.getPos()-p1.getEntry())==width){\n\t\t\tnextRow = p1.getEntryRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\t//Less than zero would make it on top of the top edge\n\t\t\t\t//First term calculated in this manner because any negative entrance between -1 and \n\t\t\t\t// -width+1 will have an integer rounded to zero. The double casting will give an \n\t\t\t\t// accurate number without losing the sign\n\t\t\t\t\n\t\t\t\t//Greater than height*width-1 would make in lower than the bottom edge\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(Math.abs(p1.getPos()-p1.getExit())==width){\n\t\t\tnextRow = p1.getExitRow();\n\t\t\tif(p1.getEntry()<0 || nextRow>(height-1/width)){//it used to be calculaterow(height*width-1\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\treturn true;\n\t\t\n\t}", "public boolean checkValidCoordinate(int i, int j)\n\t{\n\t\tif(i>=0 && i<this.numberOfRows && j>=0 && j<this.numberOfColumns)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isPosValid(int x, int y, int tokNum, int rotNum) {\n int [] xArray = xRotations[tokNum][rotNum];\n int [] yArray = yRotations[tokNum][rotNum];\n \n for (int i = 0; i < 4; i++) {\n \n //Positions to check \n int xIndex = x+xArray[i];\n int yIndex = y+yArray[i];\n \n //Check range\n if (xIndex < 0) return false;\n if (xIndex >= 10) return false;\n if (yIndex < 0) return false;\n if (yIndex >= 20) return false;\n \n //Check to see if space is occupied\n if (gameBoard[xIndex][yIndex] == 1) return false;\n }\n\n return true;\n }", "public boolean validateLng() {\r\n\t\treturn true;\r\n\t}", "private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private void assertValidity() {\n if (latitudes.size() != longitudes.size()) {\n throw new IllegalStateException(\"GIS location needs equal number of lat/lon points.\");\n }\n if (!(latitudes.size() == 1 || latitudes.size() >= 3)) {\n throw new IllegalStateException(\"GIS location needs either one point or more than two.\");\n }\n }", "private boolean checkFull() {\n\t\treturn this.array.length - 1 == this.lastNotNull();\n\t}", "private boolean verifyBounds() {\r\n\t if((x>RobotController.BOUNDS_X || y>RobotController.BOUNDS_Y)\r\n\t || x<0 || y<0){\r\n\t return false;\r\n\t }\r\n\t return true;\r\n\t }", "@Override\n public boolean isLocationEmpty(Unit unit, XYCoord coords)\n {\n return isLocationEmpty(unit, coords.xCoord, coords.yCoord);\n }", "public static boolean validPos(String moveTo)\n\t{\n\t\tfor(int rows = 0; rows < 8; rows++)\n\t\t{\n\t\t\tfor(int cols = 0; cols < 8; cols++)\n\t\t\t{\n\t\t\t\tif(posMap[rows][cols].equals(moveTo))\n\t\t\t\t{\t\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "void pointCheck(LatLng point, boolean valid);", "@Test\n public void testIsPositionValid() {\n assertFalse(this.board.isPositionValid(new Position(-1, -1)));\n assertFalse(this.board.isPositionValid(new Position(11, 11)));\n for (int line = 0; line < 11; line++) {\n for (int column = 0; column < 11; column++) {\n assertTrue(this.board.isPositionValid(new Position(line, column)));\n }\n }\n }", "@Override\n\tpublic boolean outOfBounds() {\n\t\treturn this.getY() < 0;\n\t}", "private boolean isOutOfBounds(int row, int col) {\n if (row < 0 || row >= this.getRows()) {\n return true;\n }\n else if (col < 0 || col >= this.getColumns()) {\n return true;\n }\n else {\n return false; // the placement is valid\n }\n }", "boolean hasCoordinates();", "boolean hasCoordinates();", "boolean hasCoordinates();", "private boolean isOccupied(Location loc)\n\t{\n\t\treturn grid[loc.getRow()][loc.getCol()] != null;\n\t}", "private boolean isLegalPos(int row, int col){\r\n return !(row < 0 || row > 7 || col < 0 || col > 7);\r\n }", "@Test\n\tpublic void testIfCoordinatesAreValid()\n\t{\n\t\tData d = new Data();\n\t\tCoordinate c = d.getCoordinate(0); // at index 0 is the king's default location (5, 5)\n\t\tassertEquals(c.getX(), 5);\n\t\tassertEquals(c.getY(), 5);\t\n\t}", "public boolean isFreeCoordinate(int x, int y)\n {\n boolean isFree = false;\n if(this.grille[x][y] == \"0\")\n {\n isFree = true;\n // System.out.println(\"case libre : [\" + x + \" \" + y + \"] \" +this.grille[x][y]);\n }\n else{\n // System.out.println(\"case occupee [\"+ x + \" \" + y + \" ] \" +this.grille[x][y]);\n\n }\n return isFree;\n }", "private boolean isValidLocationFound() {\n return latitudeValue != null && longitudeValue != null;\n }", "public boolean validPosition(Player p, double x, double y) {\n\n\t\tTile tile = getTile(p, x + p.BOUNDING_BOX_X, y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x, y + p.BOUNDING_BOX_Y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x - p.BOUNDING_BOX_X, y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttile = getTile(p, x, y - p.BOUNDING_BOX_Y);\n\t\tif (tile == null || !tile.canEnter(p)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "boolean hasCoordInfo();", "boolean FindUnassignedLocation(int grid[][], Point p)\n {\n int row=p.x,col=p.y;\n for (row = 0; row < N; row++)\n for (col = 0; col < N; col++)\n if (grid[row][col] == UNASSIGNED)\n {\n p.x=row;p.y=col;\n return true;\n }\n return false;\n }", "static boolean isSafe(int x, int y, int sol[][]) {\n return (x >= 0 && x < N && y >= 0 &&\n y < N && sol[x][y] == -1);\n }", "private boolean valid(Cell[] siblings, Point p)\n\t{\n\t\tint c = 0;\n\t\tfor (int i = 0; i < siblings.length; i++) {\n\t\t\tif (siblings[i] == Cell.EMPTY)\n\t\t\t\tc++;\n\t\t\tif (siblings[i] == null && crossPoint != null)\n\t\t\t{\n\t\t\t\tcrossPoint = p;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn c == 3;\n\t}", "public void checkBlankSpace() {\n\t\tif (xOffset < 0) {\n\t\t\txOffset = 0;\n\t\t} else if (xOffset > handler.getWorld().getWidth() * Tile.TILEWIDTH - handler.getWidth()) {\n\t\t\txOffset = handler.getWorld().getWidth() * Tile.TILEWIDTH - handler.getWidth();\n\t\t}\n\t\t\n\t\tif (yOffset < 0) {\n\t\t\tyOffset = 0;\n\t\t} else if (yOffset > handler.getWorld().getHeight() * Tile.TILEHEIGHT - handler.getHeight()) {\n\t\t\tyOffset = handler.getWorld().getHeight() * Tile.TILEWIDTH - handler.getHeight();\n\t\t}\n\t}", "public boolean goodCoordinatesForm(String coord) {\n\t\tString[] parts = coord.split(\"-\");\r\n\t\ttry{\r\n\t\t\t //Where exception may happen\r\n\t\tchar letter1 = parts[0].charAt(0);\r\n\t\t\r\n\t\tif(( parts[0] != coord && isNumeric(parts[1])) && parts[0].equals(parts[0].toUpperCase()) && Character.isLetter(letter1) && parts[0].length() ==1 ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse { \r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t}\r\n\r\n\t\tcatch(java.lang.ArrayIndexOutOfBoundsException e){\r\n\t\t\treturn false;\r\n\t\t\t}\r\n\t\tcatch (java.lang.StringIndexOutOfBoundsException s) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private boolean hasValidOrientation(String[] coord) {\n int[] indices = getIndexFromCoord(coord);\n int x0 = indices[0];\n int y0 = indices[1];\n int x1 = indices[2];\n int y1 = indices[3];\n\n boolean result = x0 == x1 || y0 == y1;\n if (!result) {\n System.out.println(\"Error! Wrong ship location! Try again:\");\n }\n return result;\n }", "private boolean valid (int row, int column) {\n\n boolean result = false;\n \n // check if cell is in the bounds of the matrix\n if (row >= 0 && row < grid.length &&\n column >= 0 && column < grid[0].length)\n\n // check if cell is not blocked and not previously tried\n if (grid[row][column] == 1)\n result = true;\n\n return result;\n\n }", "@Override\n\t\tpublic boolean isValid() {\n\t\t\treturn false;\n\t\t}", "private ArrayList<Location> canMoveInit() {\n if (last == null) {\n ArrayList<Location> firstList = new ArrayList<>();\n firstList.add(getLocation());\n firstList.add(null);\n crossLocation.push(firstList);\n }\n if (crossLocation.empty() || isEnd) {\n return null;\n }\n Grid gr = getGrid();\n if (gr == null) {\n return null;\n }\n last = getLocation();\n return getValid(getLocation());\n }", "public boolean repOk()\n {\n boolean flag[] = new boolean[3];\n if(shipLength >0 )\n {\n flag[0] = true;\n }\n for(Point p: shipLocation)\n {\n if(p.x>0)\n {flag[1] = true;}\n if(p.y>0)\n {flag[2] = true;}\n }\n \n return (flag[0]&&flag[1]&&flag[2]);\n \n }", "private boolean isValid(int x, int y, int newX, int newY, int row, int col, int[][] rooms) {\n int INF = Integer.MAX_VALUE; // (2^31 - 1) = 2147483647\n return newX >= 0 && newY >= 0 && newX < row && newY < col && rooms[newX][newY] > 0 && rooms[x][y] != INF;\n }", "static boolean isPositionAlreadyFilled(int i, int j, String[][] board) {\r\n\t\tboolean isOccupied = false;\r\n\t\tif (board[i][j] == \"*\" || board[i][j] == \"O\") {\r\n\t\t\tSystem.out.println(i + \" \" + j + \"board is \" + board[i][j]\r\n\t\t\t\t\t+ \"The current place is already filled Please choose the other place to fill\");\r\n\t\t\tisOccupied = true;\r\n\t\t}\r\n\t\treturn isOccupied;\r\n\t}", "private boolean isValid(final int y, final int x, final char[][] g) {\n if (visited[y][x]) {\n return false;\n }\n if (g[y][x] != '.' && g[y][x] != 'E') {\n return false;\n }\n return true;\n }", "@Override\r\n\tpublic boolean isValid() {\n\t\treturn false;\r\n\t}", "private static boolean isMoveValid( int x, int y ){\n int path[] = new int[8];\n for( int distance = 1; distance < 8; distance ++ ){\n checkPath( path, 0, x + distance, y, distance );\n checkPath( path, 1, x + distance, y + distance, distance );\n checkPath( path, 2, x, y + distance, distance );\n checkPath( path, 3, x - distance, y, distance );\n checkPath( path, 4, x - distance, y - distance, distance );\n checkPath( path, 5, x, y - distance, distance );\n checkPath( path, 6, x + distance, y - distance, distance );\n checkPath( path, 7, x - distance, y + distance, distance );\n }\n for( int i = 0; i < 8; i++ ){\n if( path[ i ] > 1 ){\n return true;\n }\n }\n return false;\n }", "public boolean valid() {\n return start != null && ends != null && weavingRegion != null;\n }", "@Override\n\tpublic void CheckBounds() {\n\t\t\n\t}", "public void checkRep()\n {\n assert (x>=0 && x<=19 && y >=0 && y<=19 && (orientation == 0 || orientation == 90 || orientation == 180 || orientation == 270));\n }", "@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}", "boolean isValid() {\n\t\t// see if there is a empty square with no available move\n\t\tint counter;\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor(int j = 0; j < boardSize; j++) {\n\t\t\t\tcounter = 0;\n\t\t\t\tif (board[i][j] == 0) {\n\t\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (counter == 0) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// see if there is a number missing in availMoves + board in each line/box \n\t\tboolean[][] verticalNumbers = new boolean[boardSize][boardSize];\n\t\tboolean[][] horizontalNumbers = new boolean[boardSize][boardSize];\n\t\tboolean[][] boxNumbers = new boolean[boardSize][boardSize];\n\t\tint box = 0;\n\t\tfor(int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tbox = i/boxSize + ((j/boxSize) * boxSize); \n\t\t\t\tif (board[i][j] > 0) {\n\t\t\t\t\tverticalNumbers[i][board[i][j] - 1] = true;\n\t\t\t\t\thorizontalNumbers[j][board[i][j] - 1] = true;\n\t\t\t\t\tboxNumbers[box][board[i][j] - 1] = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\t\tverticalNumbers[i][k] = true;\n\t\t\t\t\t\t\thorizontalNumbers[j][k] = true;\n\t\t\t\t\t\t\tboxNumbers[box][k] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if there is any boolean still false it means that number is missing from that box/line\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tif (verticalNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (horizontalNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (boxNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private boolean isSafe(int[][] input, char[][] path, int row, int col, int n) {\n if (row >= 0 && row < n && col >= 0 && col < n && input[row][col] == 0 && path[row][col] == 'N')\n return true;\n return false;\n }", "public boolean isValid() {\n return latitudeSouth != INVALID_LAT_LON;\n }", "private boolean check(int[] bestPoint) {\n\t\tif (bestPoint[0] > Mirror.spec || bestPoint[1] > Mirror.spec || bestPoint[0] < width - Mirror.spec\n\t\t\t\t|| bestPoint[1] < width - Mirror.spec) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\n\t}", "private boolean buildStreetIsAllowed() {\r\n\t\tif (clickedRoad.getEnd() == lastSettlementNode\r\n\t\t\t\t|| clickedRoad.getStart() == lastSettlementNode) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean outOfBounds()\n {\n if((lastpowerUp.equals(\"BLUE\") || lastpowerUp.equals(\"RAINBOW\")) && powerupTimer > 0)\n {\n return false;\n }\n \n if(head.getA() < 150 || head.getA() >= 1260)\n return true;\n else if(head.getB() <150 || head.getB() >=630)\n return true;\n else \n return false;\n \n \n }", "@Override\n public boolean isEmpty(){\n return points.isEmpty();\n }", "public boolean valid(int x, int y) {\n return board[x][y] == 0;\n }", "private static boolean checkSpace(Unit unit, GameMap myMap, SearchNode currentNode, XYCoord coord, boolean ignoreUnits)\n {\n // if we're past the edges of the map\n if( !myMap.isLocationValid(coord) )\n {\n return false;\n }\n // if there is a unit in that space\n if( !ignoreUnits && (myMap.getLocation(coord).getResident() != null) )\n { // if that unit is an enemy\n if( unit.CO.isEnemy(myMap.getLocation(coord).getResident().CO) )\n {\n return false;\n }\n }\n // if this unit can't traverse that terrain.\n if( findMoveCost(unit, coord.xCoord, coord.yCoord, myMap) == 99 )\n {\n return false;\n }\n return true;\n }", "@Override\n\t\tpublic boolean isInvalid() {\n\t\t\treturn false;\n\t\t}", "@Override\n public boolean isLocationEmpty(Unit unit, int x, int y)\n {\n Unit resident = master.getLocation(x, y).getResident();\n // if there's nothing there, yeah...\n if (resident == null)\n return true;\n // say it's not there if we dunno it's there\n if (resident.model.hidden && !confirmedVisibles.contains(resident)) \n return true;\n // otherwise, consult the fog map and master map\n return isLocationFogged(x, y) || master.isLocationEmpty(unit, x, y);\n }", "private GenericGridError testShipBoundaries(final ShipCommand command, GenericGridError errors){\r\n\t\tInteger xCount;\r\n\t\tInteger yCount;\r\n\t\tif(command.getIsHorizontal()){\r\n\t\t\txCount = command.getShipSize()+2;\r\n\t\t\tyCount = 3;\r\n\t\t} else{\r\n\t\t\txCount = 3;\r\n\t\t\tyCount = command.getShipSize()+2;\r\n\t\t}\r\n\t\tPoint currentPosition = command.getTile().getPosition();\r\n\t\tScanArea scanArea = new ScanArea(\r\n\t\t\t\t\t\t\tnew Point((currentPosition.x - 1), (currentPosition.y - 1)), \r\n\t\t\t\t\t\t\tnew Dimension(xCount, yCount));\r\n\t\t\r\n\t\tList<Point> positionList = scanArea.getScanAreaPositions();\r\n\t\t\r\n\t\tfor(Point position : positionList){\r\n\t\t\tAbstractTile currentTile = command.getGrid().getTile(position);\r\n\t\t\tif(AbstractShipTile.class.isInstance(currentTile)){\r\n\t\t\t\terrors.addErrorMessage(\"SHIP TILE DETECTED AT POSITION(X,Y): \" \r\n\t\t\t\t\t\t+ currentTile.getPosition().x + \", \" \r\n\t\t\t\t\t\t+ currentTile.getPosition().y \r\n\t\t\t\t\t\t+ \"\\nRULE VIOLATION: SHIPS CANNOT BE PLACED ADJACENT TO OTHER SHIPS (INCLUDING DIAGONAL)\");\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn errors;\r\n\t}", "private boolean checkSpaceAvailability(Point targetLocation, ICityFragment element) {\r\n //basic constraint:no other things here\r\n\r\n if (city.isAnythingHere(targetLocation, element.getBoundary().width, element.getBoundary().height, element)) {\r\n return false;\r\n }\r\n\r\n //crossroads:at least one road can connected\r\n if (element instanceof Crossroads) {\r\n var crossroad = (Crossroads) element;\r\n\r\n var accessibleRoad = findAccessibleRoads(crossroad, targetLocation);\r\n\r\n if (accessibleRoad == null || accessibleRoad.size() <= 1) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "boolean validateOffset() {\n\t\t\tint num = entriesByIndex.size() + 1; // assuming 0, plus 1-N)\n\t\t\tfor (int index : entriesByIndex.keySet()) {\n\t\t\t\tif (index > num || index < 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "private boolean isEmpty(Point pos){\r\n Cells aux = model.getValueAt(pos);\r\n return (aux == Cells.BLACK_FLOOR);\r\n }", "public boolean isEmpty( IPlayer iPlayer, Coordinates startCoord, Coordinates endCoord) {\n\t\tboolean empty = true;\r\n\t\t\r\n\t\t//We first chose the smallest coordinates to increment\r\n\t\tint nb1 = startCoord.getNumber();\r\n\t\tchar letter1 = startCoord.getLetter();\r\n\t\tint nb2 = endCoord.getNumber();\r\n\t\tchar letter2 = endCoord.getLetter();\r\n\t\t\r\n\t\tfor (int i = nb1; i<= nb2; i++)\r\n\t\t{\r\n\t\t\tfor (char j = letter1; j <= letter2; j++){\r\n\t\t\t\t\r\n\t\t\t\tif ( iPlayer.occupyCoordinates(new Coordinates(j,i))) {\r\n\t\t\t\t\tempty = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn empty;\t\r\n\t}", "@Override\n\tboolean isValidSpecialMove(int newX, int newY) {\n\t\tint xDisplacement = newX - xLocation;\n\t\tint yDisplacement = newY - yLocation;\n\t\tif(isValidQueenMove(xDisplacement, yDisplacement)){\n\t\t\tint steps = Math.max(Math.abs(xDisplacement), Math.abs(yDisplacement));\n\t\t\tint xDirection = xDisplacement/steps;\n\t\t\tint yDirection = yDisplacement/steps;\n\t\t\t// Check for obstacles in path of Queen.\n\t\t\tfor(int i = 1; i < steps; i++){\n\t\t\t\tSquare squareToCheck = currentBoard.squaresList[xLocation + i*xDirection][yLocation + i*yDirection];\n\t\t\t\tif(squareToCheck.isOccupied)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Test\n\tvoid testCheckCoordinates4() {\n\t\tassertFalse(DataChecker.checkCoordinate(-100));\n\t}", "public boolean istrianglevalid() {\n //if all of the sides are valid, then return true, else return false\n if (sideA > 0 && sideB > 0 && sideC > 0) {\n return true;\n } else {\n return false;\n }\n }", "public boolean hasCoordInfo() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "protected void onBadCoords()\n\t{\n\t}", "boolean checkIfValidToCreate(int start, int end) {\n return myMarkerTree.processOverlappingWith(start, end, region->{\n int rStart = region.getStartOffset();\n int rEnd = region.getEndOffset();\n if (rStart < start) {\n if (region.isValid() && start < rEnd && rEnd < end) {\n return false;\n }\n }\n else if (rStart == start) {\n if (rEnd == end) {\n return false;\n }\n }\n else {\n if (rStart > end) {\n return true;\n }\n if (region.isValid() && rStart < end && end < rEnd) {\n return false;\n }\n }\n return true;\n });\n }", "protected boolean avoidNegativeCoordinates() {\n \t\treturn false;\n \t}", "public boolean hasCoordInfo() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public static boolean isValidPlace(int[] setPos){\n if(setPos[0]<=4 && setPos[0]>=0)\n return (setPos[1]<=4 && setPos[1]>=0);\n return false;\n }" ]
[ "0.6740807", "0.671091", "0.6550293", "0.6542579", "0.65371525", "0.6530339", "0.648184", "0.6459767", "0.64237386", "0.64066786", "0.6392082", "0.63244355", "0.63094676", "0.6307224", "0.6300341", "0.62814313", "0.62608105", "0.6234125", "0.62314147", "0.62263256", "0.62219274", "0.61612064", "0.6160531", "0.6158912", "0.6154556", "0.6147153", "0.6138445", "0.6103648", "0.6103115", "0.6068052", "0.60663825", "0.6064532", "0.60640144", "0.6044539", "0.6040201", "0.60265195", "0.60184926", "0.600432", "0.60020673", "0.5997549", "0.59859043", "0.59775907", "0.595077", "0.5932856", "0.5926136", "0.59193254", "0.59193254", "0.59193254", "0.5904496", "0.5880971", "0.58783865", "0.5877734", "0.58321077", "0.5831156", "0.58235246", "0.5816899", "0.58163404", "0.58138895", "0.5812869", "0.5806141", "0.5802606", "0.5801666", "0.5800403", "0.5797898", "0.5777223", "0.5774413", "0.57615876", "0.5760034", "0.5757853", "0.5755637", "0.57547605", "0.575104", "0.5749951", "0.57422173", "0.57422173", "0.57422173", "0.573786", "0.5693892", "0.5691137", "0.5677768", "0.5674307", "0.5671856", "0.5671703", "0.5665722", "0.5663935", "0.56626755", "0.56620026", "0.5658975", "0.5658891", "0.565451", "0.565442", "0.5650724", "0.5649416", "0.564653", "0.5640178", "0.5637142", "0.5633398", "0.5629855", "0.5627093", "0.56196374", "0.56163275" ]
0.0
-1
Same as the boardcheck method but checks only a specific row and column to find out if its valid or not.
public static void validationcheck2(int row, int column, String piecevalue){ String oppositepiece; if(piecevalue.equals("x")){ oppositepiece="o"; } else if(piecevalue.equals("o")){ oppositepiece="x"; } else{ oppositepiece="-"; } //R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left. boolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false; int checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1; while(board[row][column+checkfurtherR].equals(oppositepiece)){ checkfurtherR++; } if(board[row][column+checkfurtherR].equals(piecevalue)&&checkfurtherR>1){ foundR=true; } while(board[row][column-checkfurtherL].equals(oppositepiece)){ checkfurtherL++; } if(board[row][column-checkfurtherL].equals(piecevalue)&&checkfurtherL>1){ foundL=true; } while(board[row+checkfurtherB][column].equals(oppositepiece)){ checkfurtherB++; } if(board[row+checkfurtherB][column].equals(piecevalue)&&checkfurtherB>1){ foundB=true; } while(board[row-checkfurtherT][column].equals(oppositepiece)){ checkfurtherT++; } if(board[row-checkfurtherT][column].equals(piecevalue)&&checkfurtherT>1){ foundT=true; } while(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){ checkfurtherTR++; } if(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)&&checkfurtherTR>1){ foundTR=true; } while(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){ checkfurtherTL++; } if(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)&&checkfurtherTL>1){ foundTL=true; } while(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){ checkfurtherBL++; } if(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)&&checkfurtherBL>1){ foundBL=true; } while(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){ checkfurtherBR++; } if(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)&&checkfurtherBR>1){ foundBR=true; } if(foundR==true||foundL==true||foundT==true||foundB==true||foundTL==true||foundTR==true||foundBL==true||foundBR==true){ validation=true; } else{ validation=false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean valid (int row, int column) {\n\n boolean result = false;\n \n // check if cell is in the bounds of the matrix\n if (row >= 0 && row < grid.length &&\n column >= 0 && column < grid[0].length)\n\n // check if cell is not blocked and not previously tried\n if (grid[row][column] == 1)\n result = true;\n\n return result;\n\n }", "protected void validateCell( int row, int column )\n {\n }", "static boolean isValid(int row, int col)\n{\n\t// return true if row number and\n\t// column number is in range\n\treturn (row >= 0) && (row < ROW) &&\n\t\t(col >= 0) && (col < COL);\n}", "boolean isLegalRow (int row, int col, int num) {\n\t\tfor (int c = 0; c<9; c++){\n\t\t\tif (c != col) {\n\t\t\t\tif (boardArray[c][row]==num){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn true;\t\t\n\t}", "private boolean isValid(int row, int col) {\n if (row < 1 || row > this.side || col < 1 || col > this.side)\n return false;\n return true;\n }", "private boolean validate(int row, int col) {\n if (row < 1 || row > this.n || col < 1 || col > this.n) {\n throw new IllegalArgumentException(\"row \" + row + \" col \" + col + \" is out of the grid.\");\n }\n else return true;\n }", "private boolean validate(int row, int col, int num){\n\t\t\n\t\t// Check vertical \n\t\tfor( int r = 0; r < 9; r++ ){\n\t\t\tif(puzzle[r][col] == num ){\n\t\n\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check horizontal\n\t\tfor( int c = 0; c < 9; c++ ){\n\t\t\tif(puzzle[row][c] == num ){\n\t\t\t\n\t\t\t\treturn false ; \n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check sub board\n\t\tint subrow = (row / 3) * 3 ;\n\t\tint subcol = (col / 3) * 3 ;\n\t\t\n\t\tfor( int r = 0; r < 3; r++ ){\n\t\t for( int c = 0; c < 3; c++ ){\n\t\t\t \n\t\t\t if(puzzle[subrow+r][subcol+c] == num ){\n\n\t\t\t return false ;\n\t\t\t }\n\t\t }\n\t\t}\n\t\t\n\t\treturn true;\n\t\n\t}", "boolean isLegalCol (int col, int row, int num) {\n\t\tfor (int r = 0; r<9; r++){\n\t\t\tif(r != row) {\n\t\t\t\tif (boardArray[col][r]==num){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\n\t}", "public boolean valid(int x, int y) {\n return board[x][y] == 0;\n }", "private boolean isLegalPos(int row, int col){\r\n return !(row < 0 || row > 7 || col < 0 || col > 7);\r\n }", "@Override\n\tpublic boolean check(piece[][] board) {\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public static boolean isLegal(int[][] board) {\nif (!isRectangleLegal(board, 0, 2, 0, 2, \"Block 1\")) return false;\nif (!isRectangleLegal(board, 3, 5, 0, 2, \"Block 2\")) return false;\nif (!isRectangleLegal(board, 6, 8, 0, 2, \"Block 3\")) return false;\nif (!isRectangleLegal(board, 0, 2, 3, 5, \"Block 4\")) return false;\nif (!isRectangleLegal(board, 3, 5, 3, 5, \"Block 5\")) return false;\nif (!isRectangleLegal(board, 6, 8, 3, 5, \"Block 6\")) return false;\nif (!isRectangleLegal(board, 0, 2, 6, 8, \"Block 7\")) return false;\nif (!isRectangleLegal(board, 3, 5, 6, 8, \"Block 8\")) return false;\nif (!isRectangleLegal(board, 6, 8, 6, 8, \"Block 9\")) return false;\n \n// check the nine columns\nif (!isRectangleLegal(board, 0, 0, 0, 8, \"Column 0\")) return false;\nif (!isRectangleLegal(board, 1, 1, 0, 8, \"Column 1\")) return false;\nif (!isRectangleLegal(board, 2, 2, 0, 8, \"Column 2\")) return false;\nif (!isRectangleLegal(board, 3, 3, 0, 8, \"Column 3\")) return false;\nif (!isRectangleLegal(board, 4, 4, 0, 8, \"Column 4\")) return false;\nif (!isRectangleLegal(board, 5, 5, 0, 8, \"Column 5\")) return false;\nif (!isRectangleLegal(board, 6, 6, 0, 8, \"Column 6\")) return false;\nif (!isRectangleLegal(board, 7, 7, 0, 8, \"Column 7\")) return false;\nif (!isRectangleLegal(board, 8, 8, 0, 8, \"Column 8\")) return false;\n \n// check the nine rows\nif (!isRectangleLegal(board, 0, 8, 0, 0, \"Row 0\")) return false;\nif (!isRectangleLegal(board, 0, 8, 1, 1, \"Row 1\")) return false;\nif (!isRectangleLegal(board, 0, 8, 2, 2, \"Row 2\")) return false;\nif (!isRectangleLegal(board, 0, 8, 3, 3, \"Row 3\")) return false;\nif (!isRectangleLegal(board, 0, 8, 4, 4, \"Row 4\")) return false;\nif (!isRectangleLegal(board, 0, 8, 5, 5, \"Row 5\")) return false;\nif (!isRectangleLegal(board, 0, 8, 6, 6, \"Row 6\")) return false;\nif (!isRectangleLegal(board, 0, 8, 7, 7, \"Row 7\")) return false;\nif (!isRectangleLegal(board, 0, 8, 8, 8, \"Row 8\")) return false;\nreturn true;\n }", "private void validate(int row, int col)\n {\n if (row <= 0 || row > gridSize) throw new IllegalArgumentException(\"row index out of bounds\");\n if (col <= 0 || col > gridSize) throw new IllegalArgumentException(\"col index out of bounds\");\n }", "public boolean isValid(int row, int col) {\n\t\tif (row < 0 || row >= w || col < 0 || col >= l) return false;\n\t\tif (visited[row][col] != 0) return false;\n\t\treturn true;\n\t}", "boolean isLegalBox (int row, int col, int num) {\n\t\tint x = (row / 3) * 3 ;\n\t\tint y = (col / 3) * 3 ;\n\t\tfor( int r = 0; r < 3; r++ ) {\n\t\t\tfor( int c = 0; c < 3; c++ ) {\n\t\t\t\tif(r != row && c != col) {\n\t\t\t\t\tif( boardArray[y+c][x+r] == num ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isBasicMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\t/*Checking if coordinates are OK*/\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*Checks if the tile is empty*/\r\n\t\t\t\tif (player==1){/*Checks if player is red*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==1){/*Checks if in tile there is soldier red */\r\n\t\t\t\t\t\tif(fromRow==toRow-1&&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally upward*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\tif (board[fromRow][fromCol]==2){/*Checks if in tile there is queen red*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif (player==-1){/*Checks if player is blue*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-1){/*Checks if in tile there is soldier blue */\r\n\t\t\t\t\t\tif(fromRow==toRow+1&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally down*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-2){/*Checks if in tile there is queen blue*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public boolean IsSafe(int rowIndex, int columIndex) {\n for (int i = 0; i < this.SIZE_OF_CHESS_BOARD; i++) {\n //this.list_cells[rowIndex][i].setBackground(Color.red);\n if (maps[rowIndex][i] == true) {\n return false;\n }\n }\n\n //check in a colums\n for (int i = 0; i < this.SIZE_OF_CHESS_BOARD; i++) {\n //this.list_cells[i][columIndex].setBackground(Color.red);\n if (maps[i][columIndex] == true) {\n return false;\n }\n }\n\n //check in a diagonal line\n for (int x = -(this.SIZE_OF_CHESS_BOARD - 1); x < this.SIZE_OF_CHESS_BOARD; x++) {\n for (int y = -(this.SIZE_OF_CHESS_BOARD - 1); y < this.SIZE_OF_CHESS_BOARD; y++) {\n int newRowIndex = x + rowIndex;\n int newColumIndex = y + columIndex;\n if (newColumIndex >= 0 && newColumIndex < this.SIZE_OF_CHESS_BOARD && newRowIndex >= 0 && newRowIndex < this.SIZE_OF_CHESS_BOARD) {\n if (newColumIndex + newRowIndex == columIndex + rowIndex || columIndex - rowIndex == newColumIndex - newRowIndex) {\n // System.out.println(newRowIndex + \",\" + newColumIndex);\n if (maps[newRowIndex][newColumIndex] == true) {\n return false;\n }\n //this.list_cells[newRowIndex][newColumIndex].setBackground(Color.red);\n }\n }\n }\n }\n return true;\n }", "public boolean withinChessboard(String column,int row)\r\n {\r\n boolean sw=false,exit=false;\r\n\r\n ChessBoard.ColumnLetter l= ChessBoard.ColumnLetter.valueOf(column.toUpperCase());//converts String to ColumnLetter for the enum\r\n switch(l)\r\n {\r\n case A:\r\n if(row<=maxRow && row>=minRow) //if the row is within the parameters then is valid\r\n {\r\n System.out.println(\"Location is valid \");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n case B:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid \");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case C:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid \");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case D:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid...\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case E:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case F:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid..\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case G:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid.\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n case H:\r\n if(row<=maxRow && row>=minRow)\r\n {\r\n System.out.println(\"Location is valid,\");\r\n sw=true;\r\n exit=true;\r\n }else{\r\n System.out.println(\"Location not valid\");\r\n }\r\n break;\r\n\r\n default:\r\n System.out.println(\"That location is not within the board\");\r\n }\r\n if(sw==false) {// if the location was not valid it will ask the user for another location\r\n return false;\r\n } else {\r\n return true;// if user doesn't want to input another location the method will end\r\n }\r\n\r\n\r\n }", "private boolean isValid(int num, int row, int col) {\n if(!checkRow(num, row)){\n return false;\n }\n if(!checkCol(num, col)){\n return false;\n }\n\n // check if putting it there would break any constraints\n if(!checkConstraints(num, row, col)){\n return false;\n }\n\n // passed all checks so return true\n return true;\n }", "private static boolean isSafe(int[][] board, int row, int column)\n\t{\n\t\tfor (int i = 0; i < column; i++)\n\t\t{\n\t\t\tif (board[row][i] == 1)\n\t\t\t\treturn false;\n\t\t}\n\n\t\t//check upper diagonal entries\n\t\tfor (int i = row, j = column; i >= 0 && j >= 0; i--, j--)\n\t\t{\n\t\t\tif (board[i][j] == 1)\n\t\t\t\treturn false;\n\t\t}\n\n\t\t//check lower diagonal entries\n\t\tfor (int i = row, j = column; i < numberOfQueens && j >= 0 ; i++, j--)\n\t\t{\n\t\t\tif (board[i][j] == 1)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "boolean isValidMove(int col);", "public boolean isValid(int row, int col) {\r\n return isValid(row) && isValid(col);\r\n }", "private boolean isValid( int r, int c )\n {\n return r >= 0 && r < rows && c >= 0 && c < cols ; \n }", "public String check() {\n\t\tboolean validity = true;\n\t\tboolean completion = true;\n\t\tint rowNumber = 0;\n\t\tint columnNumber = 0;\n\t\t/*\n\t\t * keeps repeating the loop until all the rows and columns are checked\n\t\t * unless validity is false for any row or column\n\t\t * for each row and column, checks for duplicates\n\t\t * if duplicate is found, validity is set to false\n\t\t * and vice versa\n\t\t */\n\t\twhile (validity == true && rowNumber < Utils.SIZE && columnNumber < Utils.SIZE) {\n\t\t\tArrayList<Integer> extractedRowList = rowExtractor(finalGrid[rowNumber]);\n\t\t\tArrayList<Integer> extractedColumnList = columnExtractor(finalGrid, columnNumber);\n\t\t\tif (duplicateCheck(extractedRowList) == true || duplicateCheck(extractedColumnList) == true) {\n\t\t\t\tvalidity = false;\n\t\t\t} else {\n\t\t\t\tvalidity = true;\n\t\t\t}\n\t\t\trowNumber++;\n\t\t\tcolumnNumber++;\n\t\t}\n\t\t//System.out.println(\"row and column validity: \" + validity);\n\t\t/*\n\t\t * if validity is still true then checks if all rows and columns have 9 elements\n\t\t * if any row or column does not have 9 elements, the loop stops as completion is set to false\n\t\t */\n\t\tif (validity == true) {\n\t\t\trowNumber = 0;\n\t\t\tcolumnNumber = 0;\n\t\t\t\n\t\t\twhile (completion == true && rowNumber < Utils.SIZE && columnNumber < Utils.SIZE) {\n\t\t\t\tArrayList<Integer> extractedRowList = rowExtractor(finalGrid[rowNumber]);\n\t\t\t\tArrayList<Integer> extractedColumnList = columnExtractor(finalGrid, columnNumber);\n\t\t\t\tif (completeCheck(extractedRowList) == true && completeCheck(extractedColumnList) == true) {\n\t\t\t\t\tcompletion = true;\n\t\t\t\t} else {\n\t\t\t\t\tcompletion = false;\n\t\t\t\t}\n\t\t\t\trowNumber++;\n\t\t\t\tcolumnNumber++;\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"row and column completion: \" + completion);\n\t\t/*\n\t\t * only checks the validity of all the 3x3 grids if rows and columns were valid\n\t\t * if there are any duplicates found in any grid, validity becomes false and loop stops\n\t\t * if no duplicates are found within the 3x3 grid, validity is true\n\t\t */\n\t\tint maxRow = 0;\n\t\twhile (validity == true && maxRow < Utils.SIZE) {\n\t\t\tmaxRow = maxRow + 3;\n\t\t\tint maxColumn = 3;\n\t\t\twhile (validity == true && maxColumn <= Utils.SIZE) {\n\t\t\t\tArrayList<Integer> extractedMiniGridList = miniGridExtractor(finalGrid, maxRow, maxColumn);\n\t\t\t\t//System.out.println(extractedMiniGridList);\n\t\t\t\tif (duplicateCheck(extractedMiniGridList) == true) {\n\t\t\t\t\tvalidity = false;\n\t\t\t\t} else {\n\t\t\t\t\tvalidity = true;\n\t\t\t\t}\n\t\t\t\t maxColumn = maxColumn + 3;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * if there aren't any duplicates in the entire sudoku grid and no 0 elements, returns Valid\n\t\t * if there aren't any duplicates in the entire sudoku grid but does have 0 elements, returns Incomplete\n\t\t * if there are duplicates, returns Invalid\n\t\t */\n\t\tif (validity == true && completion == true) {\n\t\t\treturn Utils.VALID;\n\t\t} else if (validity == true && completion == false) {\n\t\t\treturn Utils.INCOMPLETE;\n\t\t} else {\n\t\t\treturn Utils.INVALID;\n\t\t}\n\t}", "public boolean checkValid(int[] board, int value, int row, int col) {\n\t\t\n\t\t// check if valid for row\n\t\tfor (int j = 0; j < 9; j++) {\n\t\t\tif ((board[j + row*9]) == value) return false;\n\t\t}\n\n\t\t// check if valid for col\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tif ((board[col + i*9]) == value) return false;\n\t\t}\n\t\t\n\t\t// check if valid for block\n\t\tint startRow = (row/3) * 3;\n\t\tint startCol = (col/3) * 3;\n\n\t\tfor (int i = startRow; i < startRow + 3; i++) {\n\t\t\tfor (int j = startCol; j < startCol + 3; j++) {\n\t\t\t\tif ((board[j + i*9]) == value) return false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// all valid so return true\n\t\treturn true;\n\t}", "public boolean isValidMove(int toRow,int toCol){\n //Stayed in the same spot\n if(myRow == toRow && myCol == toCol){\n return false;\n }\n //if the xy coordinate we are moving to is outside the board\n if(toRow < 0 || toRow > 11 || toCol < 0 || toCol > 11){\n return false;\n }\n return true;\n }", "private boolean onBoard(int x, int y){\n if((x<WIDTH&&y<HEIGHT)){\n if(0<=x&&0<=y){\n return true;\n }\n return false;\n }else{\n return false;\n }\n\t}", "private void validate(int row, int col) {\n if (!isInGrid(row, col)) {\n throw new IllegalArgumentException(\"Row : \" + row + \" Col : \" + col + \" is not in percolation(\" + size + \")\");\n }\n }", "private boolean check(int i, int j, int n){\n\t\treturn checkRow(i, j, n) && checkColumn(i, j ,n) && checkSquare(i, j, n);\n\t}", "private boolean isSafe(int row, int column, int value) throws Exception {\n for (int rowClash = 0; rowClash < DIMENSION; rowClash++) {\n if (this.board.get(row, rowClash) == value) {\n return false;\n }\n }\n\n for (int columnClash = 0; columnClash < DIMENSION; columnClash++) {\n if (this.board.get(columnClash, column) == value) {\n return false;\n }\n }\n\n int boxClash = (int)Math.sqrt(DIMENSION);\n int boxRowStart = row - row % boxClash;\n int boxColumnStart = column - column % boxClash;\n\n for (int rowBox = boxRowStart; rowBox < boxRowStart + boxClash; rowBox++) {\n for (int columnBox = boxColumnStart; columnBox < boxColumnStart + boxClash; columnBox++) {\n if (this.board.get(rowBox, columnBox) == value) {\n return false;\n }\n }\n }\n\n return true;\n }", "private int checkRow() {\n for (int i = 0; i < 3; i++) {\n if ((this.board[0][i] == this.board[1][i]) && (this.board[0][i] == this.board[2][i])) {\n return this.board[0][i];\n }\n }\n return 0;\n }", "private boolean columnOkay(int row, int column) throws Exception {\n ArrayList<Integer> clue = puzzle.getColumnClue(column);\n var filledGroups = searchBoard.getFilledGroups(column, TraversalType.COLUMN);\n if(filledGroups.size() > clue.size()) {\n return false;\n }\n int availableSquares = puzzle.getRows()-row-1;\n int tilesRequired;\n if(filledGroups.size() == 0) {\n tilesRequired = clue.size()-1;\n for(int s : clue) {\n tilesRequired += s;\n }\n } else {\n int index = filledGroups.size()-1;\n if(filledGroups.get(index) > clue.get(index)) {\n return false;\n }\n if(searchBoard.getState(row, column) == CellState.EMPTY && !filledGroups.get(index).equals(clue.get(index))) {\n return false;\n }\n tilesRequired = clue.get(index)-filledGroups.get(index);\n tilesRequired += clue.size()-filledGroups.size();\n if(searchBoard.getState(row, column) == CellState.EMPTY) {\n --tilesRequired;\n }\n for(int i = index+1; i < clue.size(); ++i) {\n tilesRequired += clue.get(i);\n }\n }\n return availableSquares >= tilesRequired;\n }", "public boolean safeBox(int num, int[][] board, int row, int col) //check if it is safe to place num in given grid\n {\n int boxR = row - row % 3; //1\n int boxC = col - col % 3; //1\n boolean flag = true; //1\n\n for (int r = boxR; r < boxR + 3; r++) //n\n {\n for (int c = boxC; c < boxC + 3; c++) //n\n {\n if (board[r][c] == num) //1\n {\n flag = false; //1\n }\n } \n }\n return flag; //1\n }", "private boolean checkRow(int num, int row) {\n for(int col = 0; col < 5; col++){\n if(numberGrid[row][col] == num){\n return false;\n }\n }\n return true;\n }", "public abstract boolean checkIfCellHasValue(int row, int col);", "public boolean check(Square[][] square)\n {\n int count = 0;\n int row = -1;\n boolean ret = false;\n for(int i = 1; i <= 9; i++)\n {\n for(int r = 0; r < square.length; r++)\n {\n if(square[r][colNum].getValue() == i)\n count += 2;\n if(square[r][colNum].isPossible(i))\n {\n count++;\n row = r;\n }\n } \n if(count == 1)\n {\n \tret = true;\n square[row][colNum].setValue(i);\n }\n count = 0;\n }\n return ret;\n }", "public static boolean isValid(int[][] board)\r\n\t{\r\n\t\t// Verifie les lignes et les colonnes\r\n\t\tfor (int i = 0; i < board.length; i++)\r\n\t\t{\r\n\t\t\tBitSet bsRow = new BitSet( 9);\r\n\t\t\tBitSet bsColumn = new BitSet( 9);\r\n\t\t\tfor (int j = 0; j < board[i].length; j++)\r\n\t\t\t{\r\n\t\t\t\tif (board[i][j] == 0 || board[j][i] == 0)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tif (bsRow.get( board[i][j] - 1) || bsColumn.get( board[j][i] - 1))\r\n\t\t\t\t\treturn false;\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tbsRow.set( board[i][j] - 1);\r\n\t\t\t\t\tbsColumn.set( board[j][i] - 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Verifie la taille de la grile\r\n\t\tfor (int rowOffset = 0; rowOffset < 9; rowOffset += 3)\r\n\t\t{\r\n\t\t\tfor (int columnOffset = 0; columnOffset < 9; columnOffset += 3)\r\n\t\t\t{\r\n\t\t\t\tBitSet threeByThree = new BitSet( 9);\r\n\t\t\t\tfor (int i = rowOffset; i < rowOffset + 3; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfor (int j = columnOffset; j < columnOffset + 3; j++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (board[i][j] == 0)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (threeByThree.get( board[i][j] - 1))\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthreeByThree.set( board[i][j] - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Renvoie Vrai\r\n\t\treturn true;\r\n\t}", "public boolean coordOnBoard(int row, int col, ArrayList<ArrayList<GamePiece>> board) {\n return (0 <= row && row < board.size()) && (0 <= col && col < board.get(0).size());\n }", "public void checkCellStatus()\r\n {\r\n for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n {\r\n for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n {\r\n checkNeighbours(rows, columns);\r\n } // end of for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n } // end of for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n }", "public boolean validMove(int row, int col) {\n // kijken of de rij en kolom leeg zijn\n if (board2d[row][col] != 0) {\n return false;\n }\n return true;\n }", "public boolean isValid(int row, int col) {\r\n return row < this.arrangement[0].length && col < this.arrangement.length\r\n && row >= 0 && col >= 0;\r\n }", "private boolean rowCheck(int row, int n)\r\n {\r\n for(int c = 0; c < game[0].length; c++)\r\n if(game[row][c] == n)\r\n return false;\r\n return true;\r\n }", "private boolean colWin(){ \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tif (checkValue (board[0][i], board[1][i], board[2][i]))\r\n\t\t\t\treturn true; \r\n\t\t}\r\n\t\treturn false; \r\n\t}", "private boolean rowOkay(int row, int column) throws Exception {\n var clue = puzzle.getRowClue(row);\n var filledGroups = searchBoard.getFilledGroups(row, TraversalType.ROW);\n if(filledGroups.size() > clue.size()) {\n return false;\n }\n int availableSquares = puzzle.getColumns()-column-1;\n int tilesRequired;\n if(filledGroups.size() == 0) {\n tilesRequired = clue.size()-1;\n for(int s : clue) {\n tilesRequired += s;\n }\n } else {\n int index = filledGroups.size()-1;\n for(int i = 0; i < index; ++i) {\n if(!filledGroups.get(i).equals(clue.get(i))) {\n return false;\n }\n }\n if(filledGroups.get(index) > clue.get(index)) {\n return false;\n }\n if(searchBoard.getState(row, column) == CellState.EMPTY && !filledGroups.get(index).equals(clue.get(index))) {\n return false;\n }\n tilesRequired = clue.get(index)-filledGroups.get(index);\n tilesRequired += clue.size()-filledGroups.size();\n if(searchBoard.getState(row, column) == CellState.EMPTY) {\n --tilesRequired;\n }\n for(int i = index+1; i < clue.size(); ++i) {\n tilesRequired += clue.get(i);\n }\n }\n return availableSquares >= tilesRequired;\n }", "private static boolean isValidBoard(byte[][] board) {\n for(int columnIndex = 0; columnIndex < board.length; columnIndex++) {\n for(int rowIndex = 0; rowIndex < board[columnIndex].length; rowIndex++) {\n byte value = board[columnIndex][rowIndex];\n if((value != IBoardState.symbolOfInactiveCell) && (value != IBoardState.symbolOfEmptyCell) && (value != IBoardState.symbolOfFirstPlayer) && (value != IBoardState.symbolOfSecondPlayer)) {\n return false;\n }\n }\n }\n return true;\n }", "public boolean safeRow(int num, int[][] board, int row) //check if it is safe to place num in given row\n {\n boolean flag = true; //1\n for (int c = 0; c < 9; c++) //n\n {\n if (board[row][c] == num) //1\n {\n flag = false; //1\n }\n } \n return flag; //1\n }", "private boolean isLegalCoordinate(int row, int col) {\n return row > 0 && row <= getSize() && col > 0 && col <= getSize();\n }", "public boolean isValid(int row, int column, int value) {\n\t\tfor (int k = 0; k < 9; k++) { // Check row.\n\t\t\tif (value == player[k][column]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (int k = 0; k < 9; k++) { // Check column.\n\t\t\tif (value == player[row][k]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tint boxRowOffset = (row / 3) * 3; // Set offset to determine box.\n\t\tint boxColOffset = (column / 3) * 3;\n\t\tfor (int k = 0; k < 3; k++) { // Check box.\n\t\t\tfor (int m = 0; m < 3; m++) {\n\t\t\t\tif (value == player[boxRowOffset + k][boxColOffset + m]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true; // no violations, so it's legal\n\t}", "protected boolean validCoord(int row, int col) {\n\t\treturn (row >= 0 && row < b.size() && col >= 0 && col < b.size());\n\t}", "public static boolean isMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\tif (board[toRow][toCol]==0){/*is the target slot ia emtey*/\r\n\t\t\tif (player==1){\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){ /*is the starting slot is red player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther no eating jump?*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is this is legal move*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tif (player==-1){\r\n\t\t\t\tif (board[fromRow][fromCol]==-1||board[fromRow][fromCol]==-2){/*is the starting slot is blue player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther are no eating move*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the move is legal*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "private int checkColumn() {\n for (int i = 0; i < 3; i++) {\n if ((this.board[i][0] == this.board[i][1]) && (this.board[i][0] == this.board[i][2])) {\n return this.board[i][0];\n }\n }\n return 0;\n }", "public static boolean isValid(int row, int col) {\n return (row >= 0) && (row < ROW) &&\n (col >= 0) && (col < COL);\n }", "private boolean colCheck(int col, int n)\r\n {\r\n for(int r = 0; r < game.length; r++)\r\n if(game[r][col] == n)\r\n return false;\r\n return true;\r\n }", "public boolean validRook (int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t\n\t\tint distanceMovedUpDown =endRow-startRow; \n\t\tint distanceMovedLeftRight = endColumn-startColumn;\n\n\t\tif (distanceMovedUpDown !=0 && distanceMovedLeftRight != 0) { //have to stay in the same column or row to be valid\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif (startRow == endRow) { //moving left or right \n\t\t\tif (Math.abs(distanceMovedLeftRight) > 1) { //checking if there's pieces btwn start and end if moving more than 1\n\t\t\t\tif (distanceMovedLeftRight > 0) {//moving to the right \n\t\t\t\t\tint x=startColumn + 1;\n\t\t\t\t\twhile (x < endColumn) {\n\t\t\t\t\t\tif (board[startRow][x].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif (distanceMovedLeftRight < 0) {//moving to the left\n\t\t\t\t\tint x = startColumn -1;\n\t\t\t\t\twhile (x > endColumn) {\n\t\t\t\t\t\tif (board[startRow][x].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn true;\n\n\t\t}\n\t\tif (startColumn == endColumn) { //moving up or down\n\t\t\tif (Math.abs(distanceMovedUpDown) > 1) { //checking if there's pieces btwn start and end if moving more than 1\n\t\t\t\tif (distanceMovedUpDown > 0) {//moving up the array\n\t\t\t\t\tint x=startRow + 1;\n\t\t\t\t\twhile (x < endRow) {\n\t\t\t\t\t\tif (board[x][startColumn].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx++;\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif (distanceMovedUpDown < 0) {//moving down the array\n\t\t\t\t\tint x = startRow -1;\n\t\t\t\t\twhile (x > endRow) {\n\t\t\t\t\t\tif (board[x][startColumn].getOccupyingPiece() != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tx--;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}", "public boolean safeCol(int num, int[][] board, int col) //check if it is safe to place num in the given column\n {\n boolean flag = true; //1\n for (int r = 0; r < 9; r++) //n\n {\n if (board[r][col] == num) //1 \n {\n flag = false; //1\n }\n }\n return flag; //1\n }", "public static boolean validInput(int columnnumber){ //determine if column chosen is valid, and if user has won or not \r\n if(columnnumber>=0&&columnnumber<8){\r\n for(int i = 0; i<=5; i++){\r\n if(arrayCircles[i][columnnumber-1].getColor()==Color.white){ //if there is still open space left in the column, return true\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "private void validateRowAndColumn(int row, int col) {\n // row or column must be in range [1, N]\n if ((row < 1 || row > size) || (col < 1 || col > size)) {\n throw new IllegalArgumentException(\"wrong row or column\");\n }\n }", "private boolean tileIsInbounds(int row, int col){\n\t\treturn row >= 0 && col >= 0\n\t\t\t\t&& row < board.length && col < board[0].length;\n\t}", "public static boolean isBasicJumpValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t//is the impot is legal\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*is the target slot avalibel*/\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){/*is the player is red*/\t\t\t\r\n\t\t\t\t\tif((board[(fromRow+toRow)/2][(fromCol+toCol)/2]==-1)||(board[(fromRow+toRow)/2][(fromCol+toCol)/2]==-2)){/*is thier enemy solduers between the begning and the target*/\r\n\t\t\t\t\t\tif (board[fromRow][fromCol]==1){/*is thie simpol soldiuer in the bignning slot*/\r\n\t\t\t\t\t\t\tif(fromRow==toRow-2&&(fromCol==toCol+2||fromCol==toCol-2)){/*is eating diagonally upward and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{/*is thir queen in the starting slot*/\r\n\t\t\t\t\t\t\tif(((fromRow==toRow+2)||(fromRow==toRow-2))&&((fromCol==toCol+2)||(fromCol==toCol-2))){\r\n\t\t\t\t\t\t\t\t/*if is eating diagonally and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (board[fromRow][fromCol]==-1|board[fromRow][fromCol]==-2){/*is the solduer is blue*/\r\n\t\t\t\t\tif((board[(fromRow+toRow)/2][(fromCol+toCol)/2]==1)||(board[(fromRow+toRow)/2][(fromCol+toCol)/2]==2)){/*thie is an enemu betwen the teget and the begning*/\r\n\t\t\t\t\t\tif (board[fromRow][fromCol]==-1){\r\n\t\t\t\t\t\t\tif(fromRow==toRow+2&&(fromCol==toCol+2||fromCol==toCol-2)){/*is eating diagonally downward and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tif(((fromRow==toRow+2)||(fromRow==toRow-2))&&((fromCol==toCol+2)||(fromCol==toCol-2))){\r\n\t\t\t\t\t\t\t\t/*if is eating diagonally and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "private static boolean isSafe(int[][] board, int row, int col) {\n\t\tfor(int i=0;i<=row;i++) {\n\t\t\tif(board[i][col]==1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// case for upper left diagonal\n\t\tfor(int i=row,j=col;i>=0 && j>=0;i--,j--) {\n\t\t\tif(board[i][j]==1)\n\t\t\t\treturn false;\n\t\t\t\n\t\t}\n\t\t// case for upper right diagonal\n\t\tfor(int i=row,j=col;i>=0 && j<N;i--,j++) {\n\t\t\tif(board[i][j]==1)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean checkSafety(int[][] board, int row, int col) {\n for (int i = row - 1, j = col; i >= 0; i--) {\n if (board[i][j] == 1) {\n return false;\n }\n }\n\n // LEFT D\n for (int i = row - 1, j = col - 1; i >= 0 && j >= 0; i--, j--) {\n if (board[i][j] == 1) {\n return false;\n }\n }\n // Right D\n for (int i = row - 1, j = col + 1; i >= 0 && j < board.length; i--, j++) {\n if (board[i][j] == 1) {\n return false;\n }\n }\n\n return true;\n }", "private boolean isOutOfBounds(int row, int col) {\n if (row < 0 || row >= this.getRows()) {\n return true;\n }\n else if (col < 0 || col >= this.getColumns()) {\n return true;\n }\n else {\n return false; // the placement is valid\n }\n }", "private boolean rowWin (){ \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tif (checkValue (board[i][0], board[i][1], board[i][2])){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false; \r\n\t}", "private boolean checkCol(int num, int col) {\n for(int row = 0; row < 5; row++){\n if(numberGrid[row][col] == num){\n return false;\n }\n }\n return true;\n }", "private boolean columnCheck() {\n\t\tfor(int col = 0; col < puzzle[0].length; col++) {\n\t\t\tfor(int i = 0; i < puzzle[0].length; i++) {\n\t\t\t\tif(puzzle[i][col] != 0) {\n\t\t\t\t\tfor(int j = i + 1; j < puzzle[0].length; j++) {\n\t\t\t\t\t\tif(puzzle[i][col] == puzzle[j][col])\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean checkOrTurn(int row,int column, ItemState itemStateCurrentPlayer, int x, int y) {\n\t\t if(column==Settings.nbrRowsColumns||column<0){\n\t\t\t return false; //Get the hell out\n\t\t }\n\t\t if(row==Settings.nbrRowsColumns||row<0){ \n\t\t\t return false; //Get the hell out\n\t\t }\n\t\t if (gameStateInt[row][column]==Helpers.getOpponentPlayerCorrespondingInt(itemStateCurrentPlayer)){ //Still another color\n\t\t\t if(checkOrTurn(row+y,column+x, itemStateCurrentPlayer, x, y)){ //continue check next\n\t\t\t\t\t changed.add(new Action(row,column));\n\t\t\t\t return true;\n\t\t\t }else{\n\t\t\t\t return false;\n\t\t\t }\n\t\t }else if (gameStateInt[row][column]==Helpers.getPlayerCorrespondingInt(itemStateCurrentPlayer)){\n\t\t\t return true; //found same color\n\t\t }else{\n\t\t\t return false; //found grass\n\t\t }\n\t }", "private void valid_rc(int row, int col) {\n\t\tif (row < 1 || row > n || col < 1 || col > n) \r\n\t\t\tthrow new IllegalArgumentException(\"Index is outside its prescribed range\");\r\n\t}", "public boolean validBish (int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t\n\n\t\tif (Math.abs(startRow-endRow)==Math.abs(startColumn-endColumn)) {\n\t\t\tint distanceMovedRows = startRow-endRow;\n\t\t\tint distanceMovedCols =startColumn-endColumn;\n\t\t\tif (distanceMovedRows > 0 && distanceMovedCols < 0) {\n\n\t\t\t\tint x=startRow-1;\n\t\t\t\tint y = startColumn+1;\n\t\t\t\twhile (x > endRow && y < endColumn) { \n\t\t\t\t\tif (board[x][y].getOccupyingPiece() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tx--; y++;\n\t\t\t\t}\n\t\t\t} \n\t\t\tif (distanceMovedRows > 0 && distanceMovedCols > 0) { \n\n\t\t\t\tint x=startRow-1;\n\t\t\t\tint y = startColumn-1;\n\t\t\t\twhile (x > endRow && y > endColumn) {\n\t\t\t\t\tif (board[x][y].getOccupyingPiece() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tx--; y--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (distanceMovedRows < 0 && distanceMovedCols < 0) {\n\n\t\t\t\tint x=startRow+1;\n\t\t\t\tint y = startColumn+1;\n\n\t\t\t\twhile (x < endRow && y < endColumn) {\n\t\t\t\t\tif (board[x][y].getOccupyingPiece() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tx++; y++;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (distanceMovedRows < 0 && distanceMovedCols > 0) {\n\n\t\t\t\tint x=startRow+1;\n\t\t\t\tint y = startColumn-1;\n\n\t\t\t\twhile (x < endRow && y > endColumn) {\n\t\t\t\t\tif (board[x][y].getOccupyingPiece() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tx++; y--;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean isMoveLegal(int x, int y) {\n\t\tif (rowSize <= x || colSize <= y || x < 0 || y < 0) {\r\n\t\t\t// System.out.print(\"Position (\" + (x + 1) + \", \" + (y + 1) + \") is\r\n\t\t\t// out of range!\\n\");\r\n\t\t\treturn false;\r\n\t\t} else if (!(matrix[x][y] == 0)) {\r\n\t\t\t// System.out.print(\"Position (\" + (x + 1) + \", \" + (y + 1) + \") has\r\n\t\t\t// been occupied!\\n\");\r\n\t\t\treturn false;\r\n\t\t} else\r\n\t\t\treturn true;\r\n\t}", "private boolean isMoveValid (int rows, int columns) {\n return rows < this.rows && columns < this.columns && rows >= 0 && columns >= 0;\n }", "public void checkNeighbours(int row, int column)\r\n {\r\n int counter = 0;\r\n //*************************************************\r\n //Following code was adapted from Harry Tang 2015-04-27\r\n for (int columnNeighbours = column - 1; columnNeighbours <= column + 1; columnNeighbours ++)\r\n {\r\n for (int rowNeighbours = row - 1; rowNeighbours <= row + 1; rowNeighbours ++)\r\n {\r\n try \r\n {\r\n if (cellGrid[columnNeighbours][rowNeighbours].isAlive()\r\n && cellGrid[columnNeighbours][rowNeighbours] != cellGrid[column][row])\r\n {\r\n counter ++;\r\n }\r\n }\r\n catch (IndexOutOfBoundsException e)\r\n {\r\n // do nothing\r\n }\r\n } // end of for (int y = indexY - 1; y == indexY; y++)\r\n } // end of for (int x = indexX - 1; x == indexX; x++)\r\n //*************************************************\r\n \r\n decisionOnCellState(counter, row, column);\r\n }", "public boolean isValid() {\n\t\treturn (x >= 0 && x < Board.SIZE && y >= 0 && y < Board.SIZE);\n\t}", "private boolean win(int row, int col, int player)\n {\n int check;\n // horizontal line\n // Start checking at a possible and valid leftmost point\n for (int start = Math.max(col - 3, 0); start <= Math.min(col,\n COLUMNS - 4); start++ )\n {\n // Check 4 chess horizontally from left to right\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of column increases 1 every time\n if (chessBoard[row][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // vertical line\n // Start checking at the point inputed if there exists at least 3 rows under\n // it.\n if (row + 3 < ROWS)\n {\n // Check another 3 chess vertically from top to bottom\n for (check = 1; check < 4; check++ )\n {\n // The coordinate of row increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row + check][col] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // diagonal line \"\\\"\n // Start checking at a possible and valid leftmost and upmost point\n for (int start = Math.max(Math.max(col - 3, 0), col - row); start <= Math\n .min(Math.min(col, COLUMNS - 4), col + ROWS - row - 4); start++ )\n {\n // Check 4 chess diagonally from left and top to right and bottom\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of row increases 1 every time\n // The coordinate of column increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row - col + start + check][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // diagonal line \"/\"\n // Start checking at a possible and valid leftmost and downmost point\n for (int start = Math.max(Math.max(col - 3, 0),\n col - ROWS + row + 1); start <= Math.min(Math.min(col, COLUMNS - 4),\n col + row - 3); start++ )\n {\n // Check 4 chess diagonally from left and bottom to right and up\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of row decreases 1 every time\n // The coordinate of column increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row + col - start - check][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n // no checking passed, not win\n return false;\n }", "private boolean isInsideBoard(int x, int y){\n if(x < 0 || x > getWidth() - 1 || y < 0 || y > getHeight() - 1)\n return false;\n\n return true;\n }", "public static boolean validationcheck(int row, int column, String piecevalue){\n\t\tif(board[row][column].equals(\"x\")||board[row][column].equals(\"o\")){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}", "private boolean isSafe(int row, int column) \r\n\t{\r\n\t\tfor(int i=0;i<row;i++)\r\n\t\t{\r\n\t\t\tif(x[i] == column) // Same Column\r\n\t\t\t\treturn false;\r\n\t\t\t\r\n\t\t\tif(i-row == x[i] -column || i-row == column-x[i]) // Same Diagonal\r\n\t\t\t\treturn false;\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public static boolean validity(int x, int y, int[][] grid) {\n\t String temp=\"\";\n\t for (int i=0;i<9;i++) {\n\t temp+=Integer.toString(grid[i][y]);//horizontal\n\t temp+=Integer.toString(grid[x][i]);//verical\n\t temp+=Integer.toString(grid[(x/3)*3+i/3][(y/3)*3+i%3]);//square\n\t }\n\t int count=0, idx=0;\n\t while ((idx=temp.indexOf(Integer.toString(grid[x][y]), idx))!=-1)\n\t {idx++; count++;}\n\t return count==3;\n\t }", "public boolean isValidSudoku(char[][] board) {\n\t\tif (board.length != 9 || board[0].length != 9) {\n\t\t\treturn false;\n\t\t}\n\t\tchar empty = '.';\n\n\t\t// Arraylists of Boolean arrays for row, column and block\n\t\tArrayList<boolean[]> rowCheck = new ArrayList<boolean[]>();\n\t\tArrayList<boolean[]> colCheck = new ArrayList<boolean[]>();\n\t\tArrayList<boolean[]> blockCheck = new ArrayList<boolean[]>();\n\n\t\t// 9 boolean arrays in each arraylist\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\trowCheck.add(new boolean[9]);\n\t\t\tcolCheck.add(new boolean[9]);\n\t\t\tblockCheck.add(new boolean[9]);\n\t\t}\n\n\t\t// loop through the matrix\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tfor (int j = 0; j < 9; j++) {\n\n\t\t\t\t// Skip loop for empty positions\n\t\t\t\tif (board[i][j] == empty) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Get number at current position. Its index position in array\n\t\t\t\t// would be 1 less than it value\n\t\t\t\tint curr = board[i][j] - '1'; // ' ' due to char data type\n\n\t\t\t\t// Check that row, column or block does not have the value yet\n\t\t\t\tif (rowCheck.get(i)[curr] == true\n\t\t\t\t\t\t|| colCheck.get(j)[curr] == true\n\t\t\t\t\t\t|| blockCheck.get(i / 3 * 3 + j / 3)[curr] == true) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else { // If not found yet, set to true\n\t\t\t\t\trowCheck.get(i)[curr] = true;\n\t\t\t\t\tcolCheck.get(j)[curr] = true;\n\t\t\t\t\tblockCheck.get(i / 3 * 3 + j / 3)[curr] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true; // Valid\n\t}", "public boolean isValid(int row, int column) {\n for (int i = 1; i <= row; i++)\n if (queens[row - i] == column // Check column\n || queens[row - i] == column - i // Check upleft diagonal\n || queens[row - i] == column + i) // Check upright diagonal\n return false; // There is a conflict\n return true; // No conflict\n }", "public boolean isLegalMove (int row, int col, BoardModel board, int side) {\n\t\t\n\t\tboolean valid = false;\n\t\t//look if the position is valid\n\t\tif(board.getBoardValue(row, col) == 2) {\n\t\t\t//look for adjacent position\n\t\t\tfor(int[] surround : surroundingCoordinates(row, col)) {\n\t\t\t\t//the adjacent poision has to be of the opponent\n\t\t\t\tif(board.getBoardValue(surround[0], surround[1]) == getOpponent(side)){\n\t\t\t\t\t//now check if we come across with a color of ourselves\n\t\t\t\t\tint row_diff = surround[0] - row;\n\t\t\t\t\tint col_diff = surround[1] - col;\t\t\t\t\t\n\t\t\t\t\tif(!valid && checkNext((row+row_diff), (col+col_diff), row_diff, col_diff, side, board) ){\n\t\t\t\t\t\tvalid = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn valid;\n\t}", "public boolean isPositionValid(int row, int col, int value){\n return !isInRow(row, value) && !isInCol(col, value) && !isInBox(row, col, value);\n }", "public void isMoveLegal(int row, int col) \r\n\t\t\tthrows IllegalMoveException {\r\n\t\tif(row < 0 || row > 7 || col < 0 || col > 7){\r\n\t\t\tthrow new IllegalMoveException();\r\n\t\t}\r\n\t}", "public boolean checkRep() {\n return location.x() >= 0 && location.x() < board.getWidth() && \n location.y() >= 0 && location.y() < board.getHeight(); \n }", "boolean isSafe(int grid[][], int row, int col, int num)\n{\n /* Check if 'num' is not already placed in current row,\n current column and current 3x3 box */\n return !UsedInRow(grid, row, num) &&\n !UsedInCol(grid, col, num) &&\n !UsedInBox(grid, row - row%3 , col - col%3, num);\n}", "@Override\n public boolean isInBounds(int row, int col) {\n return row >= 0 && row < grid.length && col >= 0 && col < grid[0].length;\n }", "private boolean checkRowColWin(char symbol) {\n boolean cols, rows;\n\n for (int col = 0; col < SIZE; col++) {\n cols = true;\n rows = true;\n\n for (int row = 0; row < SIZE; row++) {\n cols &= (gameField[col][row] == symbol);\n rows &= (gameField[row][col] == symbol);\n }\n if (cols || rows) {\n return true;\n }\n }\n return false;\n }", "private boolean beyondBoard(int col, int row) {\n if (col >= size || row >= size || col <= -1 || row <= -1) {\n return true;\n }\n return false;\n }", "private static boolean isPossible(int[][] board, int row, int col, int value) {\r\n\r\n\t\tif (!isPossibleRow(board, row, col, value))\r\n\t\t\treturn false;\r\n\t\tif (!isPossibleCol(board, row, col, value))\r\n\t\t\treturn false;\r\n\t\tif (!isPossibleGrid(board, row, col, value))\r\n\t\t\treturn false;\r\n\r\n\t\treturn true;\r\n\r\n\t}", "private boolean checkRange(int rowIndex, int columnIndex) {\n return rowIndex >= 0 && rowIndex < matrix.length\n && columnIndex >= 0 && columnIndex < matrix[rowIndex].length;\n\n }", "private static boolean isPossibleGrid(int[][] board, int row, int col, int value) {\r\n\t\tint srow = row - row % 3;\r\n\t\tint scol = col - col % 3;\r\n\t\tfor (int i = srow; i < srow + 3; i++) {\r\n\t\t\tfor (int j = scol; j < scol + 3; j++) {\r\n\t\t\t\tif (board[i][j] == value)\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public Chip checkFour(int row, int col, int ord) {\n Chip checker = (ord == 1) ? Chip.RED : Chip.BLUE;\n // check vertically\n if (row <= (this.getRows() - 4)) {\n if (this.getBoard()[row+1][col].equals(checker) && this.getBoard()[row+2][col].equals(checker) &&\n this.getBoard()[row+3][col].equals(checker)) {\n return checker;\n }\n }\n // check horizontally\n if (col <= (this.getColumns() - 4)) {\n if (this.getBoard()[row][col+1].equals(checker) && this.getBoard()[row][col+2].equals(checker) &&\n this.getBoard()[row][col+3].equals(checker)) {\n return checker;\n }\n }\n // check diagonally: top left to bottom right\n if (row <= (this.getRows() - 4) && col <= (this.getColumns() - 4)) {\n if (this.getBoard()[row+1][col+1].equals(checker) && this.getBoard()[row+2][col+2].equals(checker) &&\n this.getBoard()[row+3][col+3].equals(checker)) {\n return checker;\n }\n }\n // check diagonally: top right to bottom left\n if (row <= (this.getRows() - 4) && col >= 3) {\n if (this.getBoard()[row+1][col-1].equals(checker) && this.getBoard()[row+2][col-2].equals(checker) &&\n this.getBoard()[row+3][col-3].equals(checker)) {\n return checker;\n }\n }\n\n // if none of the checks is satisfied, return EMPTY;\n return Chip.EMPTY;\n }", "public boolean isLegalMove(int row, int column) {\n // Check move beyond half of the rows\n if (getSide() == Side.NORTH && row > 4)\n return false;\n\n if (getSide() == Side.SOUTH && (chessBoard.getMaxRows() - 5) > row)\n return false;\n\n return isLegalNonCaptureMove(row, column);\n }", "private boolean checkValid(Integer[] columns, int row1, int col1) {\n\t\tfor(int row2 = 0; row2 < row1; row2++) {\n\t\t\tint col2 = columns[row2];\n\t\t\t\n\t\t\tif (col1 == col2) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t/* Check diagonals: if the distance between the columns equals the distance\n\t\t\t* between the rows, then they're in the same diagonal. */\n\t\t\t\n\t\t\tint colDis = Math.abs(col2 - col1);\n\t\t\tint rowDis = row1 - row2;\n\t\t\tif(colDis == rowDis) {\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t\treturn true;\n\t}", "private boolean cell_in_bounds(int row, int col) {\n return row >= 0\n && row < rowsCount\n && col >= 0\n && col < colsCount;\n }", "private void checkBounds(final int row, final int col) {\n if (row <= 0 || row > size) {\n throw new IndexOutOfBoundsException(\n \"row index \" + row + \" out of bounds\"\n );\n }\n if (col <= 0 || col > size) {\n throw new IndexOutOfBoundsException(\n \"col index \" + col + \" out of bounds\"\n );\n }\n }", "public static boolean checkWin(int[][] board) {\n boolean win = true;\n\n //loops through rows\n for (int i = 0; i < board.length; i++) {\n int checkrow[] = new int[9];\n int checkcol[] = new int[9];\n\n //loops through columns and stores the numbers in that row and in that column\n for (int j = 0; j < board.length; j++) {\n checkrow[j] = board[i][j];\n checkcol[j] = board[j][i];\n }\n\n Arrays.sort(checkrow);//sorts the numbers\n Arrays.sort(checkcol);\n\n //checks the sorted numbers to see if there is a winnner by checking the values of the\n //sorted array. first number in the array with 1, second with 2, third with 3 etc...\n // if the numbers dont match at any point then there was not a winner and the program returns\n //false.\n for (int x = 1; x < board.length; x++) {\n if (checkrow[x] != x + 1 || checkcol[x] != x + 1) {\n win = false;\n return win;\n }\n }\n }\n\n return win;\n }", "boolean isValid() {\n\t\t// see if there is a empty square with no available move\n\t\tint counter;\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor(int j = 0; j < boardSize; j++) {\n\t\t\t\tcounter = 0;\n\t\t\t\tif (board[i][j] == 0) {\n\t\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (counter == 0) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// see if there is a number missing in availMoves + board in each line/box \n\t\tboolean[][] verticalNumbers = new boolean[boardSize][boardSize];\n\t\tboolean[][] horizontalNumbers = new boolean[boardSize][boardSize];\n\t\tboolean[][] boxNumbers = new boolean[boardSize][boardSize];\n\t\tint box = 0;\n\t\tfor(int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tbox = i/boxSize + ((j/boxSize) * boxSize); \n\t\t\t\tif (board[i][j] > 0) {\n\t\t\t\t\tverticalNumbers[i][board[i][j] - 1] = true;\n\t\t\t\t\thorizontalNumbers[j][board[i][j] - 1] = true;\n\t\t\t\t\tboxNumbers[box][board[i][j] - 1] = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\t\tverticalNumbers[i][k] = true;\n\t\t\t\t\t\t\thorizontalNumbers[j][k] = true;\n\t\t\t\t\t\t\tboxNumbers[box][k] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if there is any boolean still false it means that number is missing from that box/line\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tif (verticalNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (horizontalNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (boxNumbers[i][j] == false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private static boolean isBoxValid(int[][] sudoku, int row, int col, int num) {\n int rowStart = row - row % 2;\n int colStart = col - col % 2;\n for (int i = rowStart; i < rowStart + 2; i++) {\n for (int j = colStart; j < colStart + 2; j++) {\n if (sudoku[i][j] == num) {\n return false;\n }\n }\n }\n return true;\n }", "private boolean isValidNumber(char[][] board, int row, int column, int num) {\n char digit = (char) num;\n // column valid\n for (int i = 0;i < 9;i++) {\n if (board[i][column] == digit) {\n return false;\n }\n }\n // row valid\n for (int j = 0;j < 9;j++) {\n if (board[row][j] == digit) {\n return false;\n }\n }\n \n // sub-box valid\n int startR = (row / 3) * 3;\n int startC = (column / 3) * 3;\n for (int r = startR; r < startR + 3;r++){\n for (int c = startC; c < startC + 3;c++) {\n char curr = board[r][c];\n if (curr == digit) {\n return false;\n } \n }\n }\n return true;\n }", "public abstract boolean validMove(ChessBoard board, Square from, Square to);" ]
[ "0.77507055", "0.7622198", "0.7501211", "0.74974406", "0.74868107", "0.7478383", "0.73417526", "0.73245716", "0.73112625", "0.73033255", "0.7294153", "0.72924346", "0.72710526", "0.7237017", "0.72293544", "0.72111934", "0.72100645", "0.71997577", "0.7185766", "0.7174827", "0.7169935", "0.71695447", "0.71653455", "0.71531296", "0.71341324", "0.7130801", "0.7118455", "0.7115021", "0.7114384", "0.710765", "0.7091678", "0.70807105", "0.7079632", "0.70735323", "0.7065654", "0.70297", "0.70182407", "0.70057446", "0.70046514", "0.70024115", "0.700108", "0.6997824", "0.69865716", "0.6986428", "0.69807124", "0.6973729", "0.69720304", "0.69700855", "0.6963441", "0.6953901", "0.693811", "0.69366544", "0.692512", "0.69224036", "0.69011915", "0.6885317", "0.6883422", "0.68751496", "0.6849977", "0.68467927", "0.68423194", "0.68406135", "0.68286586", "0.68111134", "0.6806668", "0.67933375", "0.67858857", "0.67846996", "0.6778493", "0.6775067", "0.67737484", "0.6770529", "0.67651623", "0.6764282", "0.67383707", "0.6733783", "0.67151284", "0.67075294", "0.66951466", "0.6691673", "0.6686427", "0.66857433", "0.6682178", "0.66771597", "0.66658133", "0.66646206", "0.6658464", "0.6656772", "0.66555333", "0.6651501", "0.66510934", "0.6645429", "0.6639485", "0.6638579", "0.66345453", "0.66316235", "0.66314524", "0.6631136", "0.6625429", "0.6622072" ]
0.69764775
45
This method uses the same mechanics as the boardcheck or validationcheck2 methods but actually changes the board, it doesn't just check.
public static void changepieces(int row, int column, String piecevalue){ String oppositepiece; if(piecevalue.equals("x")){ oppositepiece="o"; } else if(piecevalue.equals("o")){ oppositepiece="x"; } else{ oppositepiece="-"; } //R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left. boolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false; int checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1; while(board[row][column+checkfurtherR].equals(oppositepiece)){ checkfurtherR++; } if(board[row][column+checkfurtherR].equals(piecevalue)){ foundR=true; } //The board changes the board if a 'connection' has been found in the [right] direction. It makes the connection following the game rules. if(foundR==true){ for(int i=column;i<column+checkfurtherR;i++){ board[row][i]=(piecevalue); } } while(board[row][column-checkfurtherL].equals(oppositepiece)){ checkfurtherL++; } if(board[row][column-checkfurtherL].equals(piecevalue)){ foundL=true; } //Again, if something is found in the [left] direction, this block of code will be initialized to change to board array (making that 'connection' on the board). if(foundL==true){ for(int i=column;i>column-checkfurtherL;i--){ board[row][i]=(piecevalue); } } while(board[row+checkfurtherB][column].equals(oppositepiece)){ checkfurtherB++; } if(board[row+checkfurtherB][column].equals(piecevalue)){ foundB=true; } if(foundB==true){ for(int i=row;i<row+checkfurtherB;i++){ board[i][column]=(piecevalue); } } while(board[row-checkfurtherT][column].equals(oppositepiece)){ checkfurtherT++; } if(board[row-checkfurtherT][column].equals(piecevalue)){ foundT=true; } if(foundT==true){ for(int i=row;i>row-checkfurtherT;i--){ board[i][column]=(piecevalue); } } //Diagonal directions are harder and different from the 4 basic directions //It must use dynamic board to 'mark' the coordinates that it must convert to make a proper 'connection' while(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){ //each coordinate that is reached will be recorded on the dynamic board dynamicboard[row-checkfurtherTR][column+checkfurtherTR]=1; checkfurtherTR++; } if(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)){ foundTR=true; } //Now the board will be changed if an available move has been found if(foundTR==true){ for(int x=row;x>row-checkfurtherTR;x--){ for(int i=column;i<column+checkfurtherTR;i++){ //without the use of the dynamic board, some units of the board that should not be converted, will be converted. //(hard to explain)Example, if coordinate places a piece on the Top right of an available move, the connection and change on the board will be performed but [down] and [right] directions will also be inconveniently converted if(dynamicboard[x][i]==1){ board[x][i]=(piecevalue); } } } } //dynamicboard must be cleared each time for its next job in 'marking' units in the array to be converted. cleandynamicboard(); while(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){ dynamicboard[row-checkfurtherTL][column-checkfurtherTL]=1; checkfurtherTL++; } if(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)){ foundTL=true; } if(foundTL==true){ for(int x=row;x>row-checkfurtherTL;x--){ for(int i=column;i>column-checkfurtherTL;i--){ if(dynamicboard[x][i]==1){ board[x][i]=(piecevalue); } } } } cleandynamicboard(); while(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){ dynamicboard[row+checkfurtherBL][column-checkfurtherBL]=1; checkfurtherBL++; } if(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)){ foundBL=true; } if(foundBL==true){ for(int x=row;x<row+checkfurtherBL;x++){ for(int i=column;i>column-checkfurtherBL;i--){ if(dynamicboard[x][i]==1){ board[x][i]=(piecevalue); } } } } cleandynamicboard(); while(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){ dynamicboard[row+checkfurtherBR][column+checkfurtherBR]=1; checkfurtherBR++; } if(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)){ foundBR=true; } if(foundBR==true){ for(int x=row;x<row+checkfurtherBR;x++){ for(int i=column;i<column+checkfurtherBR;i++){ if(dynamicboard[x][i]==1){ board[x][i]=(piecevalue); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean check(piece[][] board) {\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }", "@Test\r\n\tpublic void testDirectCheck() {\n\t\tBoard b = new Board();\r\n\t\tb.state = new Piece[][] //set up the board in the standard way\r\n\t\t\t\t{\r\n\t\t\t\t{new Rook(\"b\"), new Knight(\"b\"),new Bishop(\"b\"),new Queen(\"b\"), new King(\"b\"), new Bishop(\"b\"),\r\n\t\t\t\t\tnew Knight(\"b\"), new Rook(\"b\")},\r\n\t\t\t\t{new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),\r\n\t\t\t\t\t\tnew Pawn(\"b\")},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,new Knight(\"b\"),null,null},\r\n\t\t\t\t{new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),\r\n\t\t\t\t\tnew Pawn(\"w\")},\r\n\t\t\t\t{new Rook(\"w\"), new Knight(\"w\"),new Bishop(\"w\"),new Queen(\"w\"), new King(\"w\"), new Bishop(\"w\"),\r\n\t\t\t\t\tnew Knight(\"w\"), new Rook(\"w\")}\r\n\t\t\t\t};\r\n\t\tassertTrue(b.whiteCheck());\t\r\n\t}", "public void makeChanges() { \n for(int i = 1; i < 9; i++) {\n for(int j = 1; j < 11; j++) {\n if(!(controller.getBoard().getPiece(i, j) instanceof Forbidden)) {\n Cell[i][j].setBackground(Color.white);\n if(controller.getBoard().getPiece(i,j) != null) {\n if(controller.getPlayer(controller.getTurn()).getColour() != controller.getBoard().getPiece(i,j).getColour()) {\n if(controller.getTurn() == 1) {\n Cell[i][j].setIcon(new ImageIcon(\"pieces\\\\redHidden.png\"));\n Cell[i][j].setEnabled(false);\n } else {\n Cell[i][j].setIcon(new ImageIcon(\"pieces\\\\blueHidden.png\"));\n Cell[i][j].setEnabled(false);\n }\n } else {\n Cell[i][j].setIcon((controller.getBoard().getPiece(i, j).getIcon()));\n Cell[i][j].setEnabled(true);\n }\n if(controller.getBoard().getPiece(i,j) instanceof Trap || controller.getBoard().getPiece(i,j) instanceof Flag) {\n Cell[i][j].removeActionListener(handler);\n Cell[i][j].setEnabled(false);\n }\n } else {\n Cell[i][j].setBackground(Color.white);\n Cell[i][j].setEnabled(false);\n }\n }\n }\n }\n controller.setTurn(); \n }", "boolean updateBoard(String currentPlayerTurn, String newBoard);", "public boolean CheckMate(Board b, Player p, boolean check) {\n int WhiteKingx = WhiteKing(b)[0];\r\n int WhiteKingy = WhiteKing(b)[1];\r\n int BlackKingx = BlackKing(b)[0];\r\n int BlackKingy = BlackKing(b)[1];\r\n\r\n if (check && p.getColor()) {\r\n //currently in check and color is white\r\n for (int horizontal = -1; horizontal < 2; horizontal++) {\r\n for (int vertical = -1; vertical < 2; vertical++) {\r\n if (b.blocks[WhiteKingx][WhiteKingy].getPiece().ValidMove(b.blocks, WhiteKingx, WhiteKingy, WhiteKingx + horizontal, WhiteKingy + vertical)) {\r\n /* Check which blocks the king can move to.\r\n * If the king can move, check if that block still puts the king on check\r\n * If all of them yield check, then see if there is a piece that can move to prevent the check\r\n */\r\n b.move(WhiteKingx, WhiteKingy, WhiteKingx + horizontal, WhiteKingy + vertical);\r\n if(!CheckChecker(b, p)) {\r\n b.move(WhiteKingx + horizontal, WhiteKingy + vertical, WhiteKingx, WhiteKingy);\r\n return false;\r\n }\r\n b.move(WhiteKingx + horizontal, WhiteKingy + vertical, WhiteKingx, WhiteKingy);\r\n }\r\n }\r\n }\r\n }\r\n if (check && !p.getColor()) {\r\n for(int horizontal = -1; horizontal < 2; horizontal++) {\r\n for(int vertical = -1; vertical < 2; vertical ++) {\r\n if(b.blocks[BlackKingx][BlackKingy].getPiece().ValidMove(b.blocks, BlackKingx, BlackKingy, BlackKingx + horizontal, BlackKingy + vertical)) {\r\n b.move(BlackKingx, BlackKingy, BlackKingx + horizontal, BlackKingy + vertical);\r\n if(!CheckChecker(b, p)) {\r\n b.move(BlackKingx + horizontal, BlackKingy + vertical, BlackKingx, BlackKingy);\r\n return false;\r\n }\r\n b.move(BlackKingx + horizontal, BlackKingy + vertical, BlackKingx, BlackKingy);\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public void changeBoard(int columnnumber, int whoseTurn, Color color1, Color color2){ //changes the colour of the circles on the board\r\n \r\n if(whoseTurn==1){ \r\n if(erase>0){ //this if statement runs if a checker needs to be erased; (because AI was checking future game states)\r\n for(int i = 0; i<=5; i++){ //going from top to bottom to change the last entered checker\r\n if(arrayCircles[i][erase-1].getColor()==color1){\r\n arrayCircles[i][erase-1].setColor(Color.white); //removing the checker that was previously placed\r\n repaint();\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n for(int i = 5; i>=0; i--){\r\n if(arrayCircles[i][columnnumber-1].getColor()==Color.white){ //starting from row 5 (the bottom one) see if any of those within the column is null\r\n arrayCircles[i][columnnumber-1].setColor(color1); //if so, set that value to the colour of the player who inputted that columnnumber\r\n repaint(); //repainting the board so that it updates and is visible to viewers\r\n break; //break once the colour has been changed and a move has been made\r\n }\r\n }\r\n }\r\n }\r\n \r\n else if(whoseTurn==2){\r\n for(int i = 5; i>=0; i--){\r\n if(arrayCircles[i][columnnumber-1].getColor()==Color.white){ //if there is an open space, set its colour to the desired colour \r\n arrayCircles[i][columnnumber-1].setColor(color2);\r\n repaint();\r\n break;\r\n }\r\n }\r\n }\r\n \r\n else if(whoseTurn==3||whoseTurn==4){ //either the easyAI or the hardAI\r\n \r\n \r\n if(erase>0){ //this if statement erases the last placed coloured checker\r\n for(int i = 0; i<=5; i++){ //going from top to bottom to change the last entered checker to white\r\n if(arrayCircles[i][erase-1].getColor()==Color.magenta){\r\n arrayCircles[i][erase-1].setColor(Color.white); //sets it back to white\r\n repaint(); //repaints and breaks\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n for(int i = 5; i>=0; i--){ //setting the colour of the column to magenta (for the AI)\r\n if(arrayCircles[i][columnnumber-1].getColor()==Color.white){\r\n arrayCircles[i][columnnumber-1].setColor(color2);\r\n repaint();\r\n break;\r\n }\r\n }\r\n } \r\n }\r\n }", "public abstract boolean validMove(ChessBoard board, Square from, Square to);", "public void changeBoard(Board board){\n this.board = board;\n }", "public void updateBoard() {\n notifyBoardUpdate(board);\n }", "void setBoard(Board board);", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "private boolean checkOrTurn(int row,int column, ItemState itemStateCurrentPlayer, int x, int y) {\n\t\t if(column==Settings.nbrRowsColumns||column<0){\n\t\t\t return false; //Get the hell out\n\t\t }\n\t\t if(row==Settings.nbrRowsColumns||row<0){ \n\t\t\t return false; //Get the hell out\n\t\t }\n\t\t if (gameStateInt[row][column]==Helpers.getOpponentPlayerCorrespondingInt(itemStateCurrentPlayer)){ //Still another color\n\t\t\t if(checkOrTurn(row+y,column+x, itemStateCurrentPlayer, x, y)){ //continue check next\n\t\t\t\t\t changed.add(new Action(row,column));\n\t\t\t\t return true;\n\t\t\t }else{\n\t\t\t\t return false;\n\t\t\t }\n\t\t }else if (gameStateInt[row][column]==Helpers.getPlayerCorrespondingInt(itemStateCurrentPlayer)){\n\t\t\t return true; //found same color\n\t\t }else{\n\t\t\t return false; //found grass\n\t\t }\n\t }", "public void setBoard(Board board){this.board = board;}", "private void initializeBoard(){\r\n checks =new int[][]{{0,2,0,2,0,2,0,2},\r\n {2,0,2,0,2,0,2,0},\r\n {0,2,0,2,0,2,0,2},\r\n {0,0,0,0,0,0,0,0},\r\n {0,0,0,0,0,0,0,0},\r\n {1,0,1,0,1,0,1,0},\r\n {0,1,0,1,0,1,0,1},\r\n {1,0,1,0,1,0,1,0}};\r\n }", "public static void validationcheck2(int row, int column, String piecevalue){\n\t\tString oppositepiece;\n\t\tif(piecevalue.equals(\"x\")){\n\t\t\toppositepiece=\"o\";\n\t\t}\n\t\telse if(piecevalue.equals(\"o\")){\n\t\t\toppositepiece=\"x\";\n\t\t}\n\t\telse{\n\t\t\toppositepiece=\"-\";\n\t\t}\n\t\t//R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left.\n\t\tboolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false;\n\t\tint checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1;\n\t\twhile(board[row][column+checkfurtherR].equals(oppositepiece)){\n\t\t\tcheckfurtherR++;\n\t\t}\n\t\tif(board[row][column+checkfurtherR].equals(piecevalue)&&checkfurtherR>1){\n\t\t\tfoundR=true;\n\t\t}\n\t\twhile(board[row][column-checkfurtherL].equals(oppositepiece)){\n\t\t\tcheckfurtherL++;\n\t\t}\n\t\tif(board[row][column-checkfurtherL].equals(piecevalue)&&checkfurtherL>1){\n\t\t\tfoundL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherB][column].equals(oppositepiece)){\n\t\t\tcheckfurtherB++;\n\t\t}\n\t\tif(board[row+checkfurtherB][column].equals(piecevalue)&&checkfurtherB>1){\n\t\t\tfoundB=true;\n\t\t}\n\t\twhile(board[row-checkfurtherT][column].equals(oppositepiece)){\n\t\t\tcheckfurtherT++;\n\t\t}\n\t\tif(board[row-checkfurtherT][column].equals(piecevalue)&&checkfurtherT>1){\n\t\t\tfoundT=true;\n\t\t}\n\t\twhile(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){\n\t\t\tcheckfurtherTR++;\n\t\t}\n\t\tif(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)&&checkfurtherTR>1){\n\t\t\tfoundTR=true;\n\t\t}\n\t\twhile(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){\n\t\t\tcheckfurtherTL++;\n\t\t}\n\t\tif(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)&&checkfurtherTL>1){\n\t\t\tfoundTL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){\n\t\t\tcheckfurtherBL++;\n\t\t}\n\t\tif(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)&&checkfurtherBL>1){\n\t\t\tfoundBL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){\n\t\t\tcheckfurtherBR++;\n\t\t}\n\t\tif(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)&&checkfurtherBR>1){\n\t\t\tfoundBR=true;\n\t\t}\n\t\tif(foundR==true||foundL==true||foundT==true||foundB==true||foundTL==true||foundTR==true||foundBL==true||foundBR==true){\n\t\t\tvalidation=true;\n\t\t}\n\t\telse{\n\t\t\tvalidation=false;\n\t\t}\n\t}", "public void setBoard(){\n \n\t m_Pieces[3][3]= WHITE_PIECE;\n m_Pieces[4][4]= WHITE_PIECE;\n m_Pieces[3][4]= BLACK_PIECE;\n m_Pieces[4][3]= BLACK_PIECE;\n for(int x=0;x<WIDTH;x++){\n for(int y=0;y<HEIGHT;y++){\n if(m_Pieces[x][y]==null){\n m_Pieces[x][y]=NONE_PIECE;\n }\n }\n }\n }", "@Test\n public void isValidMoveTest() {\n\n //get the board of the enemy with the method getBoard() from enemyGameBoard\n board = enemyGameBoard.getBoard();\n\n //Try two times for a existing point on the board\n assertTrue(enemyGameBoard.isValidMove(1,1));\n assertTrue(enemyGameBoard.isValidMove(2,4));\n\n //Try two times for a non-existing point on the board\n assertFalse(enemyGameBoard.isValidMove(15,5)); // x-value outside the board range\n assertFalse(enemyGameBoard.isValidMove(5,11)); // y-value outside the board range\n\n //hit a water field\n enemyGameBoard.makeMove(2, 3, false);\n assertTrue(board[2][3].equals(EnemyGameBoard.WATER_HIT));\n\n //try isValidMove() on the already hit water field\n assertFalse(enemyGameBoard.isValidMove(2,3));\n\n //hit a ship field\n enemyGameBoard.makeMove(5, 4, true);\n assertTrue(board[5][4].equals(EnemyGameBoard.SHIP_HIT));\n\n //try isValidMove() on the already hit water field\n assertFalse(enemyGameBoard.isValidMove(5,4));\n }", "public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }", "void doMakeMove(CheckersMove move) {\n\n boardData.makeMove(move, false);\n\n /* If the move was a jump, it's possible that the player has another\n jump. Check for legal jumps starting from the square that the player\n just moved to. If there are any, the player must jump. The same\n player continues moving. */\n \n if (move.isJump()) {\n legalMoves = boardData.getLegalJumpsFrom(currentPlayer, move.toRow, move.toCol);\n if (legalMoves != null) {\n if (currentPlayer == CheckersData.RED) {\n console(\"RED: You must continue jumping.\");\n } else {\n console(\"BLACK: You must continue jumping.\");\n }\n selectedRow = move.toRow; // Since only one piece can be moved, select it.\n selectedCol = move.toCol;\n refreshBoard();\n return;\n }\n }\n\n /* The current player's turn is ended, so change to the other player.\n Get that player's legal moves. If the player has no legal moves,\n then the game ends. */\n if (currentPlayer == CheckersData.RED) {\n currentPlayer = CheckersData.BLACK;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"BLACK has no moves. RED wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"BLACK: Make your move. You must jump.\");\n } else {\n console(\"BLACK: Make your move.\");\n }\n } else {\n currentPlayer = CheckersData.RED;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"RED has no moves. BLACK wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"RED: Make your move. You must jump.\");\n } else {\n console(\"RED: Make your move.\");\n }\n }\n\n /* Set selectedRow = -1 to record that the player has not yet selected\n a piece to move. */\n selectedRow = -1;\n\n /* As a courtesy to the user, if all legal moves use the same piece, then\n select that piece automatically so the user won't have to click on it\n to select it. */\n if (legalMoves != null) {\n boolean sameStartSquare = true;\n for (int i = 1; i < legalMoves.length; i++) {\n if (legalMoves[i].fromRow != legalMoves[0].fromRow\n || legalMoves[i].fromCol != legalMoves[0].fromCol) {\n sameStartSquare = false;\n break;\n }\n }\n if (sameStartSquare) {\n selectedRow = legalMoves[0].fromRow;\n selectedCol = legalMoves[0].fromCol;\n }\n }\n\n /* Make sure the board is redrawn in its new state. */\n refreshBoard();\n\n }", "public void checkWin(){\n if(gameBoard[0][0].getText().equals(\"x\") && gameBoard[0][1].getText().equals(\"x\")\n && gameBoard[0][2].getText().equals(\"x\") && gameBoard[0][3].getText().equals(\"o\") \n && gameBoard[0][4].getText().equals(\"o\") && gameBoard[0][5].getText().equals(\"x\")\n && gameBoard[0][6].getText().equals(\"x\") && gameBoard[0][7].getText().equals(\"x\")\n && gameBoard[1][0].getText().equals(\"x\") && gameBoard[1][1].getText().equals(\"o\")\n && gameBoard[1][2].getText().equals(\"x\") && gameBoard[1][3].getText().equals(\"x\")\n && gameBoard[1][4].getText().equals(\"x\") && gameBoard[1][5].getText().equals(\"x\")\n && gameBoard[1][6].getText().equals(\"o\") && gameBoard[1][7].getText().equals(\"x\")\n && gameBoard[2][0].getText().equals(\"o\") && gameBoard[2][1].getText().equals(\"x\")\n && gameBoard[2][2].getText().equals(\"x\") && gameBoard[2][3].getText().equals(\"x\")\n && gameBoard[2][4].getText().equals(\"x\") && gameBoard[2][5].getText().equals(\"x\")\n && gameBoard[2][6].getText().equals(\"x\") && gameBoard[2][7].getText().equals(\"o\")\n && gameBoard[3][0].getText().equals(\"x\") && gameBoard[3][1].getText().equals(\"x\")\n && gameBoard[3][2].getText().equals(\"o\") && gameBoard[3][3].getText().equals(\"x\")\n && gameBoard[3][4].getText().equals(\"x\") && gameBoard[3][5].getText().equals(\"o\")\n && gameBoard[3][6].getText().equals(\"x\") && gameBoard[3][7].getText().equals(\"x\")\n && gameBoard[4][0].getText().equals(\"x\") && gameBoard[4][1].getText().equals(\"x\")\n && gameBoard[4][2].getText().equals(\"x\") && gameBoard[4][3].getText().equals(\"o\")\n && gameBoard[5][0].getText().equals(\"x\") && gameBoard[5][1].getText().equals(\"x\")\n && gameBoard[5][2].getText().equals(\"o\") && gameBoard[5][3].getText().equals(\"x\")\n && gameBoard[6][0].getText().equals(\"x\") && gameBoard[6][1].getText().equals(\"o\")\n && gameBoard[6][2].getText().equals(\"x\") && gameBoard[6][3].getText().equals(\"x\")\n && gameBoard[7][0].getText().equals(\"o\") && gameBoard[7][1].getText().equals(\"x\")\n && gameBoard[7][2].getText().equals(\"x\") && gameBoard[7][3].getText().equals(\"x\")){\n System.out.println(\"Congratulations, you won the game! ! !\");\n System.exit(0);\n } \n }", "private void easyMove(Board board) {\n\t\t\r\n\t}", "private static void test3x3() {\n MutableBoard simpleBoard = new SimpleBoard(3,3);\n if (!simpleBoard.putPiece(new Move(1, 1))) throw new AssertionError(); // O\n if (!simpleBoard.toString().equals(\"---\\n-O-\\n---\\n\")) throw new AssertionError();\n if (simpleBoard.wins() != Board.PieceType.NONE) throw new AssertionError();\n if (simpleBoard.gameover()) throw new AssertionError();\n // Cannot replace any placed position.\n if (simpleBoard.putPiece(new Move(1, 1))) throw new AssertionError(); // X\n if (!simpleBoard.toString().equals(\"---\\n-O-\\n---\\n\")) throw new AssertionError();\n if (!simpleBoard.putPiece(new Move(0, 1))) throw new AssertionError(); // X\n if (!simpleBoard.toString().equals(\"-X-\\n-O-\\n---\\n\")) throw new AssertionError();\n if (simpleBoard.wins() != Board.PieceType.NONE) throw new AssertionError();\n if (simpleBoard.gameover()) throw new AssertionError();\n // Create a new light draft board.\n Board draftBoard = new LightDraftBoard(simpleBoard, new Move(0, 0), Board.PieceType.CIRCLE);\n if (!draftBoard.toString().equals(\"OX-\\n-O-\\n---\\n\")) throw new AssertionError();\n if (draftBoard.wins() != Board.PieceType.NONE) throw new AssertionError();\n if (draftBoard.gameover()) throw new AssertionError();\n // DraftBoard is immutable.\n draftBoard = new LightDraftBoard(draftBoard, new Move(1, 2), Board.PieceType.CROSS);\n if (!draftBoard.toString().equals(\"OX-\\n-OX\\n---\\n\")) throw new AssertionError();\n if (draftBoard.wins() != Board.PieceType.NONE) throw new AssertionError();\n if (draftBoard.gameover()) throw new AssertionError();\n draftBoard = new LightDraftBoard(draftBoard, new Move(2, 2), Board.PieceType.CIRCLE); // wins\n if (!draftBoard.toString().equals(\"OX-\\n-OX\\n--O\\n\")) throw new AssertionError();\n if (draftBoard.wins() != Board.PieceType.CIRCLE) throw new AssertionError();\n if (!draftBoard.gameover()) throw new AssertionError();\n }", "@Test\n void RookMoveDownBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 7, 1, 1);\n Piece rook2 = new Rook(board, 7, 4, 1);\n\n board.getBoard()[7][1] = rook1;\n board.getBoard()[7][4] = rook2;\n\n board.movePiece(rook1, 7, 7);\n\n Assertions.assertEquals(rook1, board.getBoard()[7][1]);\n Assertions.assertEquals(rook2, board.getBoard()[7][4]);\n Assertions.assertNull(board.getBoard()[7][7]);\n }", "public static void nomovecheck(){\n\t\tnomovecount=0;\n\t\tboardcheck(\"x\");\n\t\tboardcheck(\"o\");\n\t}", "@Test\r\n public void testIsSolved() {\r\n assertTrue(boardManager4.puzzleSolved());\r\n boardManager4.getBoard().swapTiles(0,0,0,1);\r\n assertFalse(boardManager4.puzzleSolved());\r\n }", "public static void setPieceTest2() {\n\t\t\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n\t\t\t \tBoard.setBoard();\n\t\t\t\tBoard.decPieceCount();\n\t\t\t \tSystem.out.println(Board.getPieceCount());\t\n\t\t\t\tSystem.out.println(Board.move(\n\t\t\t\t\t\tTEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t\t\t\tBoard.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tBoard.checkWin();\n\t\t\t\tSystem.out.println(\"Valid inputs\");\n\t\t\t\tSystem.out.println(\"OthelloBoard.clearPieces() - Begin\");\n\t\t\t\tSystem.out.println(\"Expected output: Throws exception\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\ttry{\n\t\t\t\t\t\n\t\t\t\t}catch(UnsupportedOperationException e){\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t}", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "protected boolean processSimulCurrentBoardChanged(int gameNumber, String oppName){\n return false;\n }", "private void board() {\r\n\t\tfor (int n = 0; n < ROW; n++) {\r\n\t\t\tfor (int m = 0; m < COL; m++) {\r\n\t\t\t\tboard[n][m] = 'X';\r\n\t\t\t}\r\n\t\t}\r\n\t\tturnRemaining = 42;\r\n\t}", "@Test\n void RookMoveUpBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 6, 4, 1);\n Piece rook2 = new Rook(board, 6, 2, 1);\n\n board.getBoard()[6][4] = rook1;\n board.getBoard()[6][2] = rook2;\n\n board.movePiece(rook1, 6, 1);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][4]);\n Assertions.assertEquals(rook2, board.getBoard()[6][2]);\n Assertions.assertNull(board.getBoard()[6][1]);\n }", "public boolean play(int[][] board) //the recursive definition of fillling the board with valid moves\n {\n for (int r = 0; r < board.length; r++) //n\n {\n for (int c = 0; c < board.length; c++) //n\n { \n if (board[r][c] == 0) //1\n {\n for (int y = 1; y <= 9; y++) //n\n {\n if (safeRow(y, board, r) && safeCol(y, board, c) && safeBox(y, board, r, c)) //3n\n { \n board[r][c] = y; //fill cell with the given value (1-9) //1\n\n if (play(board))\n { //1\n return true; //1\n }\n else \n {\n board[r][c] = 0; //reset cell to 0\n }\n }\n } \n return false; //backtracking\n }\n }\n }\n return true; //returns true if board is completely filled with valid numbers //1\n }", "private void checkAndUpdateIfSmallGameWin(SmallGameBoard gameToCheckForWin){\n String[] letters = gameToCheckForWin.getLettersOfAllButtons();\n if (checkGameWin(letters)) {\n //Set buttons' properties \"partOfWonBoard = true\" so they cannot be clicked again\n for (ButtonClass b : chosenGame.getAllButtons()) {\n b.setPartOfWonBoard(true);\n }\n chosenGame.changeGameColor(activity.getColor());\n chosenGame.setLetterOfWinner(currentLetter);\n //If this win leads to a big game win, then MainActivity finishes the game\n if(checkForBigGameWin()){\n activity.finishGame();\n }\n }\n }", "public void turn(){ \r\n\t\tif (currentTurn == 0){ \r\n\t\t\tSystem.out.println(\"Computer's Turn\");\r\n\t\t\tnextRowWin();\r\n\t\t\tnextColWin(); \r\n\t\t\tnextDiagWin();\r\n\t\t\t//check if next move is row win\r\n\t\t\tif (!Arrays.equals(rowWin, checkWin)){\r\n\t\t\t\tcounter(rowWin); \r\n\t\t\t}\r\n\t\t\t//check if next move is column win \r\n\t\t\telse if (!Arrays.equals (colWin, checkWin)) {\r\n\t\t\t\tcounter(colWin); \r\n\t\t\t}\r\n\t\t\t//check if next move is diagonal win\r\n\t\t\telse if (!Arrays.equals(diagWin, checkWin)){\r\n\t\t\t\tcounter(diagWin);\r\n\t\t\t}\r\n\t\t\t//computer moves based on priority positions\r\n\t\t\telse\r\n\t\t\t\tcompMove(); \r\n\t\t\tchangeTurn(); \r\n\t\t}\r\n\t\telse { \r\n\t\t\tSystem.out.println(\"Player's Turn\");\r\n\t\t\tint nextCol, nextRow; \r\n\t\t\tScanner in = new Scanner (System.in); \r\n\t\t\tSystem.out.print (\"Please enter row and column to place your piece [Enter as col row]: \");\r\n\t\t\tif (in.hasNext()) { \r\n\t\t\t\tnextCol = in.nextInt(); \r\n\t\t\t\tnextRow = in.nextInt(); \r\n\t\t\t\tif (nextCol == 3 || nextRow == 3)\r\n\t\t\t\t\tSystem.out.println(\"Input of of range. col and row must be between 0-2.\");\r\n\t\t\t\telse if (board[nextCol][nextRow] == '-') {\r\n\t\t\t\t\tboard[nextCol][nextRow] = 'X'; \r\n\t\t\t\t\tchangeTurn(); \r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tSystem.out.println(\"Invalid Input. There is already a piece in that location.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse { \r\n\t\t\t\tSystem.out.println(\"Invalid Input. Please input integers for col row.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static boolean isValidBoard(byte[][] board) {\n for(int columnIndex = 0; columnIndex < board.length; columnIndex++) {\n for(int rowIndex = 0; rowIndex < board[columnIndex].length; rowIndex++) {\n byte value = board[columnIndex][rowIndex];\n if((value != IBoardState.symbolOfInactiveCell) && (value != IBoardState.symbolOfEmptyCell) && (value != IBoardState.symbolOfFirstPlayer) && (value != IBoardState.symbolOfSecondPlayer)) {\n return false;\n }\n }\n }\n return true;\n }", "private void notifyBoardChanged() {\n if(this.boardChangeListenerList == null || this.boardChangeListenerList.isEmpty()) return;\n\n // yes - there are - create a thread and inform them\n (new Thread(new Runnable() {\n @Override\n public void run() {\n for(LocalBoardChangedListener listener : SchiffeVersenkenImpl.this.boardChangeListenerList) {\n listener.changed();\n }\n }\n })).start();\n }", "public static boolean testCheckMateBlack() {\n\t\tint i = 0;\n\t\tfor(Square s : BOARD_SQUARES) {\n\t\t\tPiece p = s.getPiece();\n\t\t\tif(s.hasPiece() && (p.getTeamColor()).equals(TeamColor.BLACK)) {\n\t\t\t\tif(!p.getPossibleMoves().isEmpty()) {\n\t\t\t\t\tfor(int[] potentialMove : p.getPossibleMoves()) {\n\t\t\t\t\t\tif(hasSquare(potentialMove)) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Completely move piece\n\t\t\t\t\t\t\tSquare targetSquare = getSquare(potentialMove);\n\t\t\t\t\t\t\tPiece savedPiece = targetSquare.getPiece();\n\t\t\t\t\t\t\ttargetSquare.setIcon(p);\n\t\t\t\t\t\t\ts.removePiece();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Update positions/square protections\n\t\t\t\t\t\t\tupdatePositions();\n\t\t\t\t\t\t\tsetProtectedSquares();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Test if still in check\n\t\t\t\t\t\t\tif(!testCheckBlack()) {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Undo move\n\t\t\t\t\t\t\ttargetSquare.setIcon(savedPiece);\n\t\t\t\t\t\t\ts.setIcon(p);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (i==0);\n\t}", "public static void setPieceTest() {\n\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n\t\tBoard.setBoard();\n\t\tBoard.decPieceCount();\n\t\tSystem.out.println(Board.getPieceCount());\n\t\tSystem.out.println(Board.move(\n\t\t\t\tTEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t\tBoard.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"\");\n\t\tBoard.checkWin();\n\t\tSystem.out.println(\"Valid inputs\");\n\t\tSystem.out.println(\"OthelloBoard.setPiece() - Begin\");\n\t\tSystem.out.println(\"Expected output: true\");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Actual output: \" + \n\t\tBoard.setPiece(\n\t\t\t\tOUTPUT_SETPIECE_TEST_X,OUTPUT_SETPIECE_TEST_Y,Board.BLACK_PIECE));\n\t\tSystem.out.println(\"\");\n\t}", "public GameBoard jump(APlayer opponent, Piece piece, int x, int y) {\n GameBoard newBoard = new GameBoard();\n newBoard.getPlayer2().getCheckers().clear();\n newBoard.getPlayer1().getCheckers().clear();\n newBoard.getPlayer1().getCheckers().addAll(this.getCheckers());\n newBoard.getPlayer2().getCheckers().addAll(opponent.getCheckers());\n newBoard.setCurrentTurn(1);\n int row = piece.getRow();\n int column = piece.getColumn();\n Piece piece1 = new Piece(row+2,getColumn(column-2),piece.isKing());\n Piece piece2 = new Piece(row+2,getColumn(column+2),piece.isKing());\n if(piece.isKing() && x < row) {\n Piece piece3 = new Piece(row-2, getColumn(column-2), true);\n Piece piece4 = new Piece(row-2, getColumn(column+2), true);\n if(newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece3,x,y,4) || x==row-2 && y==getColumn(column-2) && hasPlayers(opponent, row-1, getColumn(column-1)) &&\n isEmpty(opponent, row-2, getColumn(column-2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row-1,getColumn(column-1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n newBoard.getPlayer1().getCheckers().add(piece3);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece3, x, y);\n }\n if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece4,x,y,4) || x==row-2 && y==getColumn(column+2) && hasPlayers(opponent, row-1,getColumn(column+1)) &&\n isEmpty(opponent, row-2, getColumn(column+2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row-1, getColumn(column+1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n newBoard.getPlayer1().getCheckers().add(piece4);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece4, x, y);\n }\n } else if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece1,x,y,4) || x==row+2 && y== getColumn(column-2) && hasPlayers(opponent, row +1, getColumn(column -1)) &&\n isEmpty(opponent, row +2, getColumn(column -2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row+1, getColumn(column-1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece1.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(piece1);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece1, x, y);\n } else if (newBoard.getPlayer1().isValidJump(newBoard.getPlayer2(),piece2,x,y,4) || x==row+2 && y== getColumn(column+2) && hasPlayers(opponent, row +1, getColumn(column +1)) &&\n isEmpty(opponent, row +2, getColumn(column +2))) {\n newBoard.getPlayer2().getCheckers().remove(new Piece(row+1, getColumn(column+1)));\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece2.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(piece2);\n return newBoard.getPlayer1().jump(newBoard.getPlayer2(), piece2, x, y);\n }\n newBoard.getPlayer1().getCheckers().remove(piece);\n if (x == 7) {\n piece.setKing(true);\n }\n newBoard.getPlayer1().getCheckers().add(new Piece(x,y,piece.isKing()));\n return newBoard;\n }", "public void initializeDebugBoard() {\n\t\tboolean hasNotMoved = false;\n\t\tboolean hasMoved = true;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set empty rows\n\t\tfor (int row = 0; row < 8; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\tboard[5][4] = new Piece('k', white, hasMoved, 5, 4, PieceArray.E_kingId);\n//\t\tboard[1][4] = new Piece(\"rook\", white, hasMoved, 1, 4);\n\t\tboard[2][2] = new Piece('q', black, hasMoved, 2, 2, PieceArray.A_rookId);\n//\t\tboard[3][2] = new Piece('q', black, hasMoved, 3, 2, PieceArray.H_rookId);\n\t\t\n\n\t\tboard[0][0] = new Piece('k', black, hasMoved, 0, 0, PieceArray.E_kingId);\n//\t\tboard[7][7] = new Piece('r', black, hasNotMoved, 7, 7, PieceArray.A_rookId);\n//\t\tboard[6][7] = new Piece('p', black, hasNotMoved, 6, 7, PieceArray.A_pawnId);\n//\t\tboard[6][6] = new Piece('p', black, hasNotMoved, 6, 6, PieceArray.B_pawnId);\n//\t\tboard[6][5] = new Piece('p', black, hasNotMoved, 6, 5, PieceArray.C_pawnId);\n//\t\tboard[6][4] = new Piece('p', black, hasNotMoved, 6, 4, PieceArray.D_pawnId);\n\t\n//\t\tboard[6][6] = new Piece(\"pawn\", black, hasMoved, 6, 6);\n//\t\tboard[6][7] = new Piece(\"pawn\", black, hasMoved, 6, 7);\n//\t\tboard[6][4] = new Piece(\"pawn\", black, hasMoved, 6, 4);\n//\t\t\t\n//\t\t\n//\t\tboard[4][4] = new Piece(\"pawn\", black, hasMoved, 4,4);\n//\t\tboard[3][5] = new Piece(\"rook\", white,hasMoved,3,5);\n//\t\tboard[1][7] = new Piece(\"pawn\",black,hasMoved,1,7);\n\n\t}", "@Override\r\n\tpublic void setBoard(Board board) {\n\t\t\r\n\t}", "public void checkPlay(int[][] boardState)\n {\n if(ai)\n {\n takeTurn(boardState);\n }\n }", "@Override\n public boolean detect() {\n QQRobot.checkBoardExists(RGB_MY_SPACE);\n QQRobot.findBoard(RGB_MY_SPACE, CurrentData.REAL.board);\n if (!BoardUtils.isSameBoard(CurrentData.REAL.board, CurrentData.CALCULATED.board)) {\n this.boardChangeDetected++;\n if (this.boardChangeDetected == 3) {\n throw new UnexpectedBoardChangeException(\"找到变动!\");\n }\n }\n return false;\n }", "private boolean checkMove(boolean[][] moves, Piece piece, int i, int j) {\r\n\t\tif (moves[i][j]) {\r\n\t\t\t// Moving piece \r\n\t\t\tthis.board[piece.getY()][piece.getX()] = null;\r\n\t\t\t\r\n\t\t\tPiece savePiece = this.board[i][j]; // Piece at i and j\r\n\t\t\tint saveX = piece.getX();\r\n\t\t\tint saveY = piece.getY();\r\n\t\t\t\r\n\t\t\tthis.board[i][j] = piece;\r\n\t\t\tpiece.setXY(j, i);\r\n\t\t\t\r\n\t\t\tif (savePiece != null) {\r\n\t\t\t\tkillPiece(savePiece);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean check = checkForCheck(piece.getPlayer());\r\n\t\t\t\r\n\t\t\t// return pieces to original states\r\n\t\t\tsetBack(i, j, savePiece, saveX, saveY);\r\n\t\t\tif (!check) {\r\n\t\t\t\t// There is a viable move to get out of check\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\n\tpublic int updateBoard(int num) {\n\t\treturn 0;\n\t}", "public boolean validMove(int x, int y, boolean blackPlayerTurn)\n\t{\n\t\t// check holds 'B' if player black or 'W' if player white\n\t\tchar check;\n\t\tchar checkNot;\n\t\tcheck = blackPlayerTurn ? 'B' : 'W';\n\t\tcheckNot = !blackPlayerTurn ? 'B' : 'W';\n\t\tchar[][] arrayClone = cloneArray(currentBoard);\n\t\t// check if board position is empty\n\t\tif (currentBoard[x][y] == ' ')\n\t\t{\n\t\t\t// prime arrayClone by placing piece to be place in spot\n\t\t\tarrayClone[x][y] = check;\n\t\t\t// check if capture of other players pieces takes place (up, right, left, down)\n\t\t\t// checkNot\n\t\t\tcaptureCheck(x, y, checkNot, arrayClone);\n\t\t\t// if our candidate placement has liberties after capture check then place\n\t\t\t// piece!\n\t\t\tif (hasLibTest(x, y, check, arrayClone))\n\t\t\t{\n\t\t\t\tif (pastBoards.contains(arrayClone))\n\t\t\t\t{\n\t\t\t\t\t// do not allow repeat boards\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcurrentBoard = cloneArray(arrayClone);\n\t\t\t\t// make move handles actually piece placement so remove check from board\n\t\t\t\tarrayClone[x][y] = ' ';\n\t\t\t\t// arrayClone contains updated positions with captured pieces removed\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public void tick() {\r\n //2d array gameBoard is being copied to 2d array update\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n update[i] = gameBoard[i].clone();\r\n }\r\n\r\n //For the entire board, go through every tile\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n for (int j = 0; j < gameBoard[0].length; j++) {\r\n //Counting neighbours\r\n int count = 0;\r\n\r\n //For the current tile, go through all the neighbouring tiles\r\n for (int y = -1; y <= 1; y++) {\r\n for (int x = -1; x <= 1; x++) {\r\n if (x == 0 && y == 0) {\r\n } else {\r\n try {\r\n if (gameBoard[y + i][x + j] > 0) {\r\n count++;\r\n }\r\n } catch (Exception e) {\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Automation Rules (check)\r\n if (count < 2 || count >= 4) {\r\n update[i][j] = -1;\r\n } else if (count == 3) {\r\n update[i][j] = 1;\r\n }\r\n\r\n }\r\n }\r\n\r\n //Once board, neighbours, and automation are completed\r\n //2d array update is copied back to the original 2d array gameBoard\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n gameBoard[i] = update[i].clone();\r\n }\r\n }", "@Test\n public void test12() { \n Board board12 = new Board();\n board12.put(1,3,1);\n \n assertFalse(board12.checkWin());\n }", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "public static boolean testCheckMateWhite() {\n\t\t\t\tint i = 0;\n\t\t\t\tfor(Square s : BOARD_SQUARES) {\n\t\t\t\t\tPiece p = s.getPiece();\n\t\t\t\t\tif(s.hasPiece() && (p.getTeamColor()).equals(TeamColor.WHITE)) {\n\t\t\t\t\t\tif(!p.getPossibleMoves().isEmpty()) {\n\t\t\t\t\t\t\tfor(int[] potentialMove : p.getPossibleMoves()) {\n\t\t\t\t\t\t\t\tif(hasSquare(potentialMove)) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// Completely move piece\n\t\t\t\t\t\t\t\t\tSquare targetSquare = getSquare(potentialMove);\n\t\t\t\t\t\t\t\t\tPiece savedPiece = targetSquare.getPiece();\n\t\t\t\t\t\t\t\t\ttargetSquare.setIcon(p);\n\t\t\t\t\t\t\t\t\ts.removePiece();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// Update positions/square protections\n\t\t\t\t\t\t\t\t\tupdatePositions();\n\t\t\t\t\t\t\t\t\tsetProtectedSquares();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// Test if still in check\n\t\t\t\t\t\t\t\t\tif(!testCheckWhite()) {\n\t\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// Undo move\n\t\t\t\t\t\t\t\t\ttargetSquare.setIcon(savedPiece);\n\t\t\t\t\t\t\t\t\ts.setIcon(p);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn (i==0);\n\t}", "public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean moveValidation(Board board, Piece piece, int sourceX, int sourceY, int targetX, int targetY){//TODO make directions in Piece class\n int diffX = targetX - sourceX;\n int diffY = targetY - sourceY;\n if (!board.isPieceAtLocation(targetX, targetY) || board.isPieceAtLocationCapturable(piece.getColour(), targetX, targetY)) {\n if(diffX==0 && diffY > 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 0, 1);\n else if(diffX > 0 && diffY == 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 1, 0);\n else if(diffX < 0 && diffY == 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, -1, 0);\n else if(diffX==0 && diffY < 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 0, -1);\n }\n return false;\n }", "public static void boardcheck(String piecevalue){\n\t\t//in all check methods, an opposite piece value must be set which holds the opposite piece to the current one (ie. x's opposite piece is o, o's opposite piece is x)\n\t\tString oppositepiece;\n\t\tif(piecevalue.equals(\"x\")){\n\t\t\toppositepiece=\"o\";\n\t\t}\n\t\telse if(piecevalue.equals(\"o\")){\n\t\t\toppositepiece=\"x\";\n\t\t}\n\t\t//This step is needed or JAVA will think that the piecevalue may not have been initialized\n\t\telse{\n\t\t\toppositepiece=\"-\";\n\t\t}\n\t\t//With the 2 for loops and the if statement, the program will go through the whole board but only check the value if it is on a blank space [-].\n\t\tfor(int row=1;row<=boardwidth;row++){\n\t\t\tfor(int column=1;column<=boardlength;column++){\n\t\t\t\tif(board[row][column].equals(\"-\")){\n\t\t\t\t\t//found booleans will turn into true if a 'connection' is available and an action can be made with the current row/column in the loop. \n\t\t\t\t\tboolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false;\n\t\t\t\t\t//checkfurther all begin as 1 and will increase in value if an opposite piece is found in the direction it is checking, this lets the while loop continue and check more in that direction.\n\t\t\t\t\tint checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1;\n\t\t\t\t\t//R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left.\n\t\t\t\t\t//program will check all directions using this scheme.\n\t\t\t\t\t//If the board in this direction holds and opposite piece, it will advance and check further, until something other than an opposite piece is reached.\n\t\t\t\t\twhile(board[row][column+checkfurtherR].equals(oppositepiece)){\n\t\t\t\t\t\tcheckfurtherR++;\n\t\t\t\t\t}\n\t\t\t\t\t//If the piece after the check furthers have stopped is the same-type piece, then everything in between will be converted to the current piece. A 'connection' is made as explained in the tutorial/user manual.\n\t\t\t\t\tif(board[row][column+checkfurtherR].equals(piecevalue)&&checkfurtherR>1){\n\t\t\t\t\t\tfoundR=true;\n\t\t\t\t\t}\n\t\t\t\t\twhile(board[row][column-checkfurtherL].equals(oppositepiece)){\n\t\t\t\t\t\tcheckfurtherL++;\n\t\t\t\t\t}\n\t\t\t\t\tif(board[row][column-checkfurtherL].equals(piecevalue)&&checkfurtherL>1){\n\t\t\t\t\t\tfoundL=true;\n\t\t\t\t\t}\n\t\t\t\t\twhile(board[row+checkfurtherB][column].equals(oppositepiece)){\n\t\t\t\t\t\tcheckfurtherB++;\n\t\t\t\t\t}\n\t\t\t\t\tif(board[row+checkfurtherB][column].equals(piecevalue)&&checkfurtherB>1){\n\t\t\t\t\t\tfoundB=true;\n\t\t\t\t\t}\n\t\t\t\t\twhile(board[row-checkfurtherT][column].equals(oppositepiece)){\n\t\t\t\t\t\tcheckfurtherT++;\n\t\t\t\t\t}\n\t\t\t\t\tif(board[row-checkfurtherT][column].equals(piecevalue)&&checkfurtherT>1){\n\t\t\t\t\t\tfoundT=true;\n\t\t\t\t\t}\n\t\t\t\t\twhile(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){\n\t\t\t\t\t\tcheckfurtherTR++;\n\t\t\t\t\t}\n\t\t\t\t\tif(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)&&checkfurtherTR>1){\n\t\t\t\t\t\tfoundTR=true;\n\t\t\t\t\t}\n\t\t\t\t\twhile(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){\n\t\t\t\t\t\tcheckfurtherTL++;\n\t\t\t\t\t}\n\t\t\t\t\tif(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)&&checkfurtherTL>1){\n\t\t\t\t\t\tfoundTL=true;\n\t\t\t\t\t}\n\t\t\t\t\twhile(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){\n\t\t\t\t\t\tcheckfurtherBL++;\n\t\t\t\t\t}\n\t\t\t\t\tif(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)&&checkfurtherBL>1){\n\t\t\t\t\t\tfoundBL=true;\n\t\t\t\t\t}\n\t\t\t\t\twhile(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){\n\t\t\t\t\t\tcheckfurtherBR++;\n\t\t\t\t\t}\n\t\t\t\t\tif(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)&&checkfurtherBR>1){\n\t\t\t\t\t\tfoundBR=true;\n\t\t\t\t\t}\n\t\t\t\t\t//If any pieces have\n\t\t\t\t\tif(foundR==true||foundL==true||foundT==true||foundB==true||foundTL==true||foundTR==true||foundBL==true||foundBR==true){\n\t\t\t\t\t\tboardavailability=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//This if statement does not have to do with the current method. It is useful to the next nomovecheck method.\n\t\tif(boardavailability==false){\n\t\t\tnomovecount++;\n\t\t}\n\t}", "private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }", "@Test\n void checkDoMove() {\n abilities.doMove(turn, board.getCellFromCoords(1, 1));\n assertEquals(turn.getWorker().getCell(), board.getCellFromCoords(1, 1));\n Worker forcedWorker = turn.getWorker();\n for (Worker other : turn.getOtherWorkers()) {\n if (other.getCell() == board.getCellFromCoords(2, 2)) {\n forcedWorker = other;\n }\n }\n\n assertEquals(forcedWorker.getCell(), board.getCellFromCoords(2, 2));\n\n // Can't move anymore after having already moved\n assertFalse(abilities.checkCanMove(turn, board.getCellFromCoords(0, 0)));\n }", "private void updateBoard(int column, int turn) {\n rowHeight = cfBoard.rowHeight(column);\n int color = cfBoard.getColor(rowHeight-1, column-1);\n switch(column) {\n case 1:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c1.setBackground(Color.BLACK);\n break;\n case 2:\n r1c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c1.setBackground(Color.BLACK);\n break;\n case 2:\n r2c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c1.setBackground(Color.BLACK);\n break;\n case 2:\n r3c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c1.setBackground(Color.BLACK);\n break;\n case 2:\n r4c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c1.setBackground(Color.BLACK);\n break;\n case 2:\n r5c1.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c1.setBackground(Color.BLACK);\n break;\n case 2:\n r6c1.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 2:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c2.setBackground(Color.BLACK);\n break;\n case 2:\n r1c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c2.setBackground(Color.BLACK);\n break;\n case 2:\n r2c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c2.setBackground(Color.BLACK);\n break;\n case 2:\n r3c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c2.setBackground(Color.BLACK);\n break;\n case 2:\n r4c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c2.setBackground(Color.BLACK);\n break;\n case 2:\n r5c2.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c2.setBackground(Color.BLACK);\n break;\n case 2:\n r6c2.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 3:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c3.setBackground(Color.BLACK);\n break;\n case 2:\n r1c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c3.setBackground(Color.BLACK);\n break;\n case 2:\n r2c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c3.setBackground(Color.BLACK);\n break;\n case 2:\n r3c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c3.setBackground(Color.BLACK);\n break;\n case 2:\n r4c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c3.setBackground(Color.BLACK);\n break;\n case 2:\n r5c3.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c3.setBackground(Color.BLACK);\n break;\n case 2:\n r6c3.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 4:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c4.setBackground(Color.BLACK);\n break;\n case 2:\n r1c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c4.setBackground(Color.BLACK);\n break;\n case 2:\n r2c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c4.setBackground(Color.BLACK);\n break;\n case 2:\n r3c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c4.setBackground(Color.BLACK);\n break;\n case 2:\n r4c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c4.setBackground(Color.BLACK);\n break;\n case 2:\n r5c4.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c4.setBackground(Color.BLACK);\n break;\n case 2:\n r6c4.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 5:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c5.setBackground(Color.BLACK);\n break;\n case 2:\n r1c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c5.setBackground(Color.BLACK);\n break;\n case 2:\n r2c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c5.setBackground(Color.BLACK);\n break;\n case 2:\n r3c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c5.setBackground(Color.BLACK);\n break;\n case 2:\n r4c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c5.setBackground(Color.BLACK);\n break;\n case 2:\n r5c5.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c5.setBackground(Color.BLACK);\n break;\n case 2:\n r6c5.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 6:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c6.setBackground(Color.BLACK);\n break;\n case 2:\n r1c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c6.setBackground(Color.BLACK);\n break;\n case 2:\n r2c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c6.setBackground(Color.BLACK);\n break;\n case 2:\n r3c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c6.setBackground(Color.BLACK);\n break;\n case 2:\n r4c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c6.setBackground(Color.BLACK);\n break;\n case 2:\n r5c6.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c6.setBackground(Color.BLACK);\n break;\n case 2:\n r6c6.setBackground(Color.RED);\n break;\n }\n }\n break;\n case 7:\n if(rowHeight == 1) {\n switch(color) {\n case 1:\n r1c7.setBackground(Color.BLACK);\n break;\n case 2:\n r1c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 2) {\n switch(color) {\n case 1:\n r2c7.setBackground(Color.BLACK);\n break;\n case 2:\n r2c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 3) {\n switch(color) {\n case 1:\n r3c7.setBackground(Color.BLACK);\n break;\n case 2:\n r3c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 4) {\n switch(color) {\n case 1:\n r4c7.setBackground(Color.BLACK);\n break;\n case 2:\n r4c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 5) {\n switch(color) {\n case 1:\n r5c7.setBackground(Color.BLACK);\n break;\n case 2:\n r5c7.setBackground(Color.RED);\n break;\n }\n }\n if(rowHeight == 6) {\n switch(color) {\n case 1:\n r6c7.setBackground(Color.BLACK);\n break;\n case 2:\n r6c7.setBackground(Color.RED);\n break;\n }\n }\n break;\n }\n \n if (turn%2 ==1) {\n turnButton.setBackground(Color.RED);\n jTextField1.setText(\"It's Red's turn.\");\n }\n if (turn%2 ==0) {\n turnButton.setBackground(Color.BLACK);\n jTextField1.setText(\"It's Black's turn.\");\n }\n \n }", "@Override\r\n\tpublic boolean movement(BoardCells[][] chessBoard, Piece targetPiece, int fromX,int fromY,int toX,int toY) {\t\t\r\n\t\t//DEBUG -- System.out.println(\"\"+fromX+fromY+\" \"+toX+toY);\r\n\t\t\r\n\t\tif(fromY == toY){\t\t\t\r\n\t\t\tif(fromX > toX) {\r\n\t\t\t\tfor(int i = fromX-1; i>toX; i--) {\r\n\t\t\t\t\tif(chessBoard[8-fromY][i].getPiece() != null) {\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t} else if (fromX < toX) {\r\n\t\t\t\tfor(int i = fromX+1; i<toX; i++) {\r\n\t\t\t\t\tif(chessBoard[8-fromY][i].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\t\t\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(getPieceID().equals(\"bR\")) {\r\n\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"bKc\")) {\r\n\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"bK\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(getPieceID().equals(\"wR\")) {\r\n\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"wKc\")) {\r\n\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"wK\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\tif(fromX == toX) {\t\t\t\t\r\n\t\t\tif(fromY > toY) {\t\r\n\t\t\t\tfor(int i = fromY-1; i>toY; i--) {\r\n\t\t\t\t\tif(chessBoard[8-i][toX].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\t\t\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t} else if (fromY < toY) {\t\t\t\t\r\n\t\t\t\tfor(int i = fromY+1; i<toY; i++) {\t\t\t\t\t\r\n\t\t\t\t\tif(chessBoard[8-i][toX].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\t\t\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(getPieceID().equals(\"bR\")) {\r\n\t\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"bKc\")) {\r\n\t\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"bK\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(getPieceID().equals(\"wR\")) {\r\n\t\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"wKc\")) {\r\n\t\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"wK\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\r\n\t\t\treturn true;\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn false;\t\t\r\n\t}", "@Test\n void RookMoveRightBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 2, 3, 1);\n Piece rook2 = new Rook(board, 6, 3, 1);\n\n board.getBoard()[2][3] = rook1;\n board.getBoard()[6][3] = rook2;\n\n board.movePiece(rook1, 7, 3);\n\n Assertions.assertEquals(rook1, board.getBoard()[2][3]);\n Assertions.assertEquals(rook2, board.getBoard()[6][3]);\n Assertions.assertNull(board.getBoard()[7][3]);\n }", "@Test\n public void makeMoveTest() {\n\n //get the board of the enemy with the method getBoard() from enemyGameBoard\n board = enemyGameBoard.getBoard();\n\n //try two times to hit a field on the board that is water, and after that assert it is done succesfully\n enemyGameBoard.makeMove(2, 3, false);\n assertTrue(board[2][3].equals(EnemyGameBoard.WATER_HIT));\n enemyGameBoard.makeMove(9, 9, false);\n assertTrue(board[9][9].equals(EnemyGameBoard.WATER_HIT));\n\n //try two times to hit a field on the board that is not water, and after that assert it is done succesfully\n enemyGameBoard.makeMove(5, 4, true);\n assertTrue(board[5][4].equals(EnemyGameBoard.SHIP_HIT));\n enemyGameBoard.makeMove(8, 1, true);\n assertTrue(board[8][1].equals(EnemyGameBoard.SHIP_HIT));\n }", "public void checkMilestones()\n {\n if(\n (beliefs.puzzle[0][0] == 1) &&\n (beliefs.puzzle[0][1] == 2) &&\n (beliefs.puzzle[0][2] == 3) &&\n (beliefs.puzzle[0][3] == 4)\n )\n {\n Blackboard.firstMilestoneAccomplished = true;\n }//end if\n\n if(\n (beliefs.puzzle[0][0] == 1) &&\n (beliefs.puzzle[0][1] == 2) &&\n (beliefs.puzzle[0][2] == 3) &&\n (beliefs.puzzle[0][3] == 4) &&\n (beliefs.puzzle[1][0] == 5) &&\n (beliefs.puzzle[1][1] == 6) &&\n (beliefs.puzzle[1][2] == 7) &&\n (beliefs.puzzle[1][3] == 8)\n )\n {\n Blackboard.secondMilestoneAccomplished = true;\n }//end if\n\n if(\n (beliefs.puzzle[0][0] == 1) &&\n (beliefs.puzzle[0][1] == 2) &&\n (beliefs.puzzle[0][2] == 3) &&\n (beliefs.puzzle[0][3] == 4) &&\n (beliefs.puzzle[1][0] == 5) &&\n (beliefs.puzzle[1][1] == 6) &&\n (beliefs.puzzle[1][2] == 7) &&\n (beliefs.puzzle[1][3] == 8) &&\n (beliefs.puzzle[2][0] == 9) &&\n (beliefs.puzzle[3][0] == 13)\n )\n {\n Blackboard.thirdMilestoneAccomplished = true;\n }//end if\n\n if(\n (beliefs.puzzle[0][0] == 1) &&\n (beliefs.puzzle[0][1] == 2) &&\n (beliefs.puzzle[0][2] == 3) &&\n (beliefs.puzzle[0][3] == 4) &&\n (beliefs.puzzle[1][0] == 5) &&\n (beliefs.puzzle[1][1] == 6) &&\n (beliefs.puzzle[1][2] == 7) &&\n (beliefs.puzzle[1][3] == 8) &&\n (beliefs.puzzle[2][0] == 9) &&\n (beliefs.puzzle[2][1] == 10) &&\n (beliefs.puzzle[2][2] == 11) &&\n (beliefs.puzzle[2][3] == 12) &&\n (beliefs.puzzle[3][0] == 13) &&\n (beliefs.puzzle[3][1] == 14) &&\n (beliefs.puzzle[3][2] == 15)\n )\n {\n Blackboard.finalMilestoneAccomplished = true;\n }//end if\n }", "public void initChessBoardManually() {\r\n\t\tstatus.setStatusEdit();\r\n\t\tclearBoard();\r\n\t\tthis.setBoardEnabled(true);\r\n\t\tfor (int i=0; i<8*8; i++) {\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setBorderPainted(false);\r\n\t\t}\r\n\t\tswitcher.setEnabled(true);\r\n\t\tconfirm.setEnabled(true);\r\n\t\tt.setText(\"<html>Please choose position to put the pieces.<br>Right click to set/cancel King flag</html>\");\r\n\t}", "public CheckersGame(CheckersData passedBoard) {\n boardData = passedBoard;\n }", "private boolean check(int l, int r, boolean checkForBlacks) {\n\t\tif (checkForBlacks) {\n\t\t\t// If black increment counter and continue\n\t\t\tif (board[l][r].isBlack()) {\n\t\t\t\tcounter++;\n\t\t\t\tpossibleFlips.add(board[l][r]);\n\t\t\t}\n\n\t\t\t// If red break out of loop\n\t\t\telse if (board[l][r].isRed())\n\t\t\t\treturn false;\n\n\t\t\t// If empty and count > 0 set square as possible move else return from function\n\t\t\telse if (board[l][r].isEmpty()) {\n\t\t\t\tif (counter > 0) {\n\t\t\t\t\tboard[l][r].setPossMove(true);\n\t\t\t\t\tboard[l][r].addToFlipSquares(possibleFlips);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// If red increment counter and continue\n\t\t\tif (board[l][r].isRed()) {\n\t\t\t\tcounter++;\n\t\t\t\tpossibleFlips.add(board[l][r]);\n\t\t\t}\n\n\t\t\t// If black break out of loop\n\t\t\telse if (board[l][r].isBlack()) \n\t\t\t\treturn false;\n\n\t\t\t// If empty and count > 0 set square as possible move else return from function\n\t\t\telse if (board[l][r].isEmpty()) {\n\t\t\t\tif (counter > 0) {\n\t\t\t\t\tboard[l][r].setPossMove(true);\n\t\t\t\t\tboard[l][r].addToFlipSquares(possibleFlips);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\treturn true;\n\t}", "public boolean move(Piece piece, int moved_xgrid, int moved_ygrid, boolean check) {// check stores if it\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// needs to check\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// freezing and rabbits' moving backward\n\t\tif (moved_xgrid >= 0 && moved_xgrid <= 7 && moved_ygrid >= 0 && moved_ygrid <= 7) {//if it is in grid\n\t\t\tif (piece.possibleMoves(moved_xgrid, moved_ygrid,check)) {//check possible moves\n\t\t\t\tif (getPiece(moved_xgrid, moved_ygrid) == null) {\n\t\t\t\t\tif(checkMove(piece, check)) {\n\t\t\t\t\t// move\n\t\t\t\t\tpiece.setX(moved_xgrid);\n\t\t\t\t\tpiece.setY(moved_ygrid);\n\t\t\t\t\tchecktrap();\n\t\t\t\t\trepaint();\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmessage = \"It is freezed\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmessage = \"There is piece on the place\";\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmessage = \"It is not next to the piece, or rabbit cannot move backward\";\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t} else {\n\t\t\tmessage = \"The selected square is outside the grid\";\n\t\t\treturn false;\n\t\t}\n\t}", "private void setUpCorrect() {\n List<Tile> tiles = makeTiles();\n Board board = new Board(tiles, 4, 4);\n boardManager = new BoardManager(board);\n }", "private void checkLegal() {\n\tif (undoStack.size() == 2) {\n ArrayList<Integer> canGo = \n getMoves(undoStack.get(0), curBoard);\n boolean isLegal = false;\n int moveTo = undoStack.get(1);\n for (int i = 0; i < canGo.size(); i++) {\n if(canGo.get(i) == moveTo) {\n isLegal = true;\n break;\n }\n }\n\n if(isLegal) {\n curBoard = moveUnit(undoStack.get(0), \n moveTo, curBoard);\n clearStack();\n\n moveCount++;\n\t setChanged();\n\t notifyObservers();\n }\n\t}\n }", "@Override\n public boolean Danger(Board board)\n {\n return false;\n }", "public void resetBoard() {\n //sets current board to a new board\n currentBoard = new Board(7, 6);\n\n //sets all text fields back to white\n for (int i = 0; i < currentBoard.getSizeX(); i++) {\n for (int v = 0; v < currentBoard.getSizeY(); v++) {\n squares[i][v].setBackground(Color.white);\n }\n }\n //sets turn to true (first player)\n turn = true;\n }", "private void resetBoard() {\r\n\t\tboard.removeAll();\r\n\t\tboard.revalidate();\r\n\t\tboard.repaint();\r\n\t\tboard.setBackground(Color.WHITE);\r\n\r\n\t\t// Reset filled\r\n\t\tfilled = new boolean[length][length];\r\n\t\tfor (int x = 0; x < length; x++) {\r\n\t\t\tfor (int y = 0; y < length; y++) {\r\n\t\t\t\tfilled[x][y] = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tupdateBoard();\r\n\t}", "public static boolean isBasicMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\t/*Checking if coordinates are OK*/\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*Checks if the tile is empty*/\r\n\t\t\t\tif (player==1){/*Checks if player is red*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==1){/*Checks if in tile there is soldier red */\r\n\t\t\t\t\t\tif(fromRow==toRow-1&&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally upward*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\tif (board[fromRow][fromCol]==2){/*Checks if in tile there is queen red*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif (player==-1){/*Checks if player is blue*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-1){/*Checks if in tile there is soldier blue */\r\n\t\t\t\t\t\tif(fromRow==toRow+1&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally down*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-2){/*Checks if in tile there is queen blue*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "@Test\n void RookMoveLeftBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 6, 2, 1);\n Piece rook2 = new Rook(board, 4, 2, 1);\n\n board.getBoard()[6][2] = rook1;\n board.getBoard()[4][2] = rook2;\n\n board.movePiece(rook1, 1, 2);\n\n Assertions.assertEquals(rook1, board.getBoard()[6][2]);\n Assertions.assertEquals(rook2, board.getBoard()[4][2]);\n Assertions.assertNull(board.getBoard()[1][2]);\n }", "@Override\n public WorkflowStep fail() {\n this.boardChangeDetected = 0;\n QQTetris.calculationThread.cancel();\n return INITIAL_BOARD.execute(false);\n }", "@Override\n public boolean validateMove(int currX, int currY, int newX, int newY) {\n if(!onBoard(newX, newY)){\n return false;\n }\n\n //must move linearly\n if(newX == currX && (newY == (currY + 1))){\n return true;\n }\n return false;\n }", "@Override\r\n\tpublic int updateBoard(Board board) {\n\t\treturn session.update(namespace+\"updateBoard\",board);\r\n\t}", "public void setBeginningBoard() {\n clearBooleanBoard();\n\n figBoard[0][0] = new Rook(\"white\", 00, white[0]);\n figBoard[0][1] = new Knight(\"white\", 01, white[1]);\n figBoard[0][2] = new Bishop(\"white\", 02, white[2]);\n figBoard[0][4] = new King(\"white\", 04, white[3]);\n figBoard[0][3] = new Queen(\"white\", 03, white[4]);\n figBoard[0][5] = new Bishop(\"white\", 05, white[2]);\n figBoard[0][6] = new Knight(\"white\", 06, white[1]);\n figBoard[0][7] = new Rook(\"white\", 07, white[0]);\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[0][i] = true;\n gA.getBoard()[0][i].setRotation(180);\n }\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[1][i] = true;\n gA.getBoard()[1][i].setRotation(180);\n figBoard[1][i] = new Pawn(\"white\", 10 + i, white[8]);\n }\n\n figBoard[7][0] = new Rook(\"black\", 70, black[0]);\n figBoard[7][1] = new Knight(\"black\", 71, black[1]);\n figBoard[7][2] = new Bishop(\"black\", 72, black[2]);\n figBoard[7][4] = new King(\"black\", 74, black[3]);\n figBoard[7][3] = new Queen(\"black\", 73, black[4]);\n figBoard[7][5] = new Bishop(\"black\", 75, black[2]);\n figBoard[7][6] = new Knight(\"black\", 76, black[1]);\n figBoard[7][7] = new Rook(\"black\", 77, black[0]);\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[7][i] = true;\n gA.getBoard()[7][i].setRotation(0);\n }\n\n for (int i = 0; i < gA.getBoard().length; i++) {\n booleanBoard[6][i] = true;\n gA.getBoard()[6][i].setRotation(0);\n figBoard[6][i] = new Pawn(\"black\", 60 + i, black[8]);\n }\n\n clearFallenFigures();\n clearBoardBackground();\n clearStringBoard();\n showBoard(); //shows the figures\n showScore();\n setBoardClickable();\n\n if (beginner % 2 == 0)\n this.turn = 0;\n else this.turn = 1;\n\n beginner++;\n\n numberOfBlackFallen = 0;\n numberOfWhiteFallen = 0;\n fallenFiguresWhite = new ArrayList<Figure>();\n fallenFiguresBlack = new ArrayList<Figure>();\n\n showCheck();\n showTurn();\n }", "private boolean moveIsValid(Move move){\n BoardSpace[][] boardCopy = new BoardSpace[Constants.BOARD_DIMENSIONS][Constants.BOARD_DIMENSIONS];\n for(int i = 0; i < Constants.BOARD_DIMENSIONS; i++){\n for(int j = 0; j < Constants.BOARD_DIMENSIONS; j++){\n boardCopy[i][j] = new BoardSpace(boardSpaces[i][j]);\n }\n }\n int row = move.getStartRow();\n int col = move.getStartCol();\n String ourWord = \"\";\n String currentWord = \"\";\n for (Tile tile: move.getTiles()){\n ourWord += tile.getLetter();\n if (move.isAcross()){\n col++;\n } else {\n row++;\n }\n }\n currentWord = ourWord;\n if(move.isAcross()){\n //check if we keep going right we invalidate the word\n while(col+1 < boardCopy.length && !boardCopy[row][++col].isEmpty() ){\n if( isValidWord(currentWord += boardCopy[row][col].getTile().getLetter()) == false ) return false;\n }\n //check if we keep going left we invalidate the word\n col = move.getStartCol();\n currentWord = ourWord;\n while(col-1 >= 0 && !boardCopy[row][--col].isEmpty() ){\n if(!isValidWord( currentWord = boardCopy[row][col].getTile().getLetter() + currentWord ) ) return false;\n }\n } else if(!move.isAcross()){\n row = move.getStartRow(); col = move.getStartCol();\n currentWord = ourWord;\n //check if we keep going down we invalidate the word;\n while(row+1 < boardCopy.length && !boardCopy[++row][col].isEmpty()){\n if( !isValidWord(currentWord += boardCopy[row][col].getTile().getLetter() )) return false;\n }\n row = move.getStartRow();\n currentWord = ourWord;\n while(row-1 >= 0 && !boardCopy[--row][col].isEmpty()){\n if( !isValidWord( currentWord = boardCopy[row][col].getTile().getLetter() + currentWord )) return false;\n }\n }\n return true;\n }", "public boolean winCheck(){\n for(int i=0; i<3; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j+3] != 0 && board[i+1][j+2] != 0 && board[i+2][j+1] != 0 && \n board[i+3][j] != 0)\n if(board[i][j+3]==(board[i+1][j+2]))\n if(board[i][j+3]==(board[i+2][j+1]))\n if(board[i][j+3]==(board[i+3][j])){\n GBoard[i][j+3].setIcon(star);\n GBoard[i+1][j+2].setIcon(star);\n GBoard[i+2][j+1].setIcon(star);\n GBoard[i+3][j].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n //checks for subdiagonals\n for(int i=0; i<3; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j] != 0 && board[i+1][j+1] != 0 && board[i+2][j+2] != 0 &&\n board[i+3][j+3] != 0)\n if(board[i][j] == (board[i+1][j+1]))\n if(board[i][j] == (board[i+2][j+2]))\n if(board[i][j] == (board[i+3][j+3])){\n GBoard[i][j].setIcon(star);\n GBoard[i+1][j+1].setIcon(star);\n GBoard[i+2][j+2].setIcon(star);\n GBoard[i+3][j+3].setIcon(star);\n wonYet=true;\n return true;\n } \n }\n }\n //check horizontals\n for(int i=0; i<6; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j] != 0 && board[i][j+1] != 0 && board[i][j+2] != 0 && \n board[i][j+3] != 0){\n if(board[i][j]==(board[i][j+1]))\n if(board[i][j]==(board[i][j+2]))\n if(board[i][j]==(board[i][j+3])){\n GBoard[i][j].setIcon(star);\n GBoard[i][j+1].setIcon(star);\n GBoard[i][j+2].setIcon(star);\n GBoard[i][j+3].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n }\n //checks for vertical wins\n for(int i=0; i<3; i++){//checks rows\n for(int j=0; j<7; j++){//checks columns\n if(board[i][j] != 0 && board[i+1][j] != 0 && board[i+2][j] != 0 && \n board[i+3][j] != 0){\n if(board[i][j]==(board[i+1][j]))\n if(board[i][j]==(board[i+2][j]))\n if(board[i][j]==(board[i+3][j])){\n GBoard[i][j].setIcon(star);\n GBoard[i+1][j].setIcon(star);\n GBoard[i+2][j].setIcon(star);\n GBoard[i+3][j].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n }\n return false; \n }", "@Override\n\tpublic boolean validMove(int xEnd, int yEnd, board b){\n\t\t//try to land one same color piece\n\t\tif(b.occupied(xEnd, yEnd)&&b.getPiece(xEnd, yEnd).getColor()==color){\n\t\t\treturn false;\n\t\t}\n\t\tif(v==0){\n\t\t\tif(!this.guard(xEnd, yEnd, b)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//normal move\n\t\tif((xEnd==x-1&&yEnd==y-1)||(xEnd==x-1&&yEnd==y)||(xEnd==x-1&&yEnd==y+1)||(xEnd==x&&yEnd==y-1)||(xEnd==x&&yEnd==y+1)||(xEnd==x+1&&yEnd==y-1)||(xEnd==x+1&&yEnd==y)||(xEnd==x+1&&yEnd==y+1)){\n\t\t\tif(b.occupied(xEnd, yEnd)){\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tb.recycle(xEnd, yEnd);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t//set the enpass flage back\n\t\t\t\tb.setFlag(color, 100, 100);\n\t\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\t\tb.update();\n\t\t\t\tc=0;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else if((xEnd==x-2&&yEnd==y)){ //castling\n\t\t\tpiece r = b.getPiece(0, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=3;i>0;i--){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(3,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else if((xEnd==x+2&&yEnd==y)){\n\t\t\tpiece r = b.getPiece(7, y);\n\t\t\tif(r==null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(r.getC()==0||r.getColor()!=color||r.getType()!= type.ROOK||c==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor(int i=5;i<=6;i++){\n\t\t\t\tif(b.occupied(i, y)){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.setPosition(xEnd, yEnd);\n\t\t\tr.setPosition(5,y);\n\t\t\tc=0;\n\t\t\tr.setC(0);\n\t\t\tb.setFlag(color, 100, 100);\n\t\t\tb.update();\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public void checkWinner(){\n \n if ((board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')||(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')||(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')||(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')||(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')||(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')||(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')||(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')||(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')||(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')||(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n winner();\n }\n \n }", "public void checkAll() {\n for (int i = 0; i < size * size; i++) {\r\n if (flowGrid[i]!=size*size) {\r\n if ((flowGrid[i] != flowGrid[flowGrid[i]]) || i != flowGrid[i]) {\r\n flowGrid[i] = flowGrid[flowGrid[i]];\r\n if (flowGrid[i] < size) {\r\n grid[i / size][i % size] = 2;\r\n }\r\n }\r\n }\r\n }\r\n\r\n }", "private boolean addToBoardVer(int col,int row,int all, ArrayList<String> test, Board board){\n int rowToStart = row;\n String onBoard = test.get(all).toUpperCase();\n int newIndex = 0;\n if (row-1>=0 && board.getPiece(row-1, col)!= null){\n int index = row-1;\n while (index >=0 && board.getPiece(index, col)!= null){\n index--;\n }\n index++;\n \n while (index<row){\n if (newIndex<onBoard.length() && board.getPiece(index, col).theLetter() != onBoard.charAt(newIndex)){\n board.clearNonPinned();\n return false;\n }\n newIndex++;\n index++;\n }\n }\n int chars = newIndex;\n for (; chars < onBoard.length(); chars++) {\n char toFind = onBoard.charAt(chars);\n if (rowToStart == 15){\n board.clearNonPinned();\n return false;\n }\n \n if (chars == onBoard.length()-1 && rowToStart+1 < 15 && board.getPiece(rowToStart+1, col)!= null){\n board.clearNonPinned();\n return false;\n }\n \n Piece onB = board.getPiece(rowToStart, col);\n if(onB!= null && onB.theLetter()!=toFind){\n board.clearNonPinned();\n return false;\n }\n else if (onB== null){\n Piece toAddToBoard = null;\n for (int allPieces = 0; allPieces < this.playersPieces.size() && toAddToBoard==null; allPieces++) {\n if (this.playersPieces.get(allPieces).theLetter()==toFind){\n toAddToBoard = this.playersPieces.get(allPieces);\n }\n }\n if (toAddToBoard==null){\n board.clearNonPinned();\n return false;\n }\n else\n board.add(toAddToBoard, rowToStart, col);\n }\n rowToStart++;\n }\n return true;\n }", "public void setBoard(Board board) {\n this.board = board;\n }", "public void setBoard(Board board) {\n this.board = board;\n }", "public static boolean isBasicJumpValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t//is the impot is legal\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*is the target slot avalibel*/\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){/*is the player is red*/\t\t\t\r\n\t\t\t\t\tif((board[(fromRow+toRow)/2][(fromCol+toCol)/2]==-1)||(board[(fromRow+toRow)/2][(fromCol+toCol)/2]==-2)){/*is thier enemy solduers between the begning and the target*/\r\n\t\t\t\t\t\tif (board[fromRow][fromCol]==1){/*is thie simpol soldiuer in the bignning slot*/\r\n\t\t\t\t\t\t\tif(fromRow==toRow-2&&(fromCol==toCol+2||fromCol==toCol-2)){/*is eating diagonally upward and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{/*is thir queen in the starting slot*/\r\n\t\t\t\t\t\t\tif(((fromRow==toRow+2)||(fromRow==toRow-2))&&((fromCol==toCol+2)||(fromCol==toCol-2))){\r\n\t\t\t\t\t\t\t\t/*if is eating diagonally and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (board[fromRow][fromCol]==-1|board[fromRow][fromCol]==-2){/*is the solduer is blue*/\r\n\t\t\t\t\tif((board[(fromRow+toRow)/2][(fromCol+toCol)/2]==1)||(board[(fromRow+toRow)/2][(fromCol+toCol)/2]==2)){/*thie is an enemu betwen the teget and the begning*/\r\n\t\t\t\t\t\tif (board[fromRow][fromCol]==-1){\r\n\t\t\t\t\t\t\tif(fromRow==toRow+2&&(fromCol==toCol+2||fromCol==toCol-2)){/*is eating diagonally downward and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tif(((fromRow==toRow+2)||(fromRow==toRow-2))&&((fromCol==toCol+2)||(fromCol==toCol-2))){\r\n\t\t\t\t\t\t\t\t/*if is eating diagonally and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "private static void play(Board chess, Scanner scan) {\r\n boolean whiteCanCastle = true;\r\n boolean blackCanCastle = true;\r\n\r\n // Get's user's choice\r\n // Split into the <old x position>, <old y position>, <new x position>, <new y position>\r\n for (int i = 0; i < 100; i++) {\r\n // Gets the user's requested move, moves the pieces (with move verification), and prints the final board\r\n int[] move = Tasks.getMove(chess, scan);\r\n boolean valid = chess.move(move[1], move[0], move[3], move[2], move[4], move[5]);\r\n if (move[4] == 99 && valid) {whiteCanCastle = false;}\r\n else if (move[4] == -99 && valid) {blackCanCastle = false;}\r\n chess.printBoard();\r\n }\r\n // System.out.println(\"50 Move Rule Exceeded!\\nGame Over!\");\r\n }", "@Override\r\n\tpublic void resetBoard() {\r\n\t\tcontroller.resetGame(player);\r\n\t\tclearBoardView();\r\n\t\tif (ready)\r\n\t\t\tcontroller.playerIsNotReady();\r\n\t}", "public boolean checkRequirements(PlayerBoard playerBoard);", "public void updateBoard(int[][] board, int piece){\r\n this.board=board;\r\n this.piece=piece;\r\n columns = board.length;\r\n rows = board[0].length;\r\n save = Math.min((size / columns), (size / rows));\r\n this.repaint();\r\n repaint();\r\n }", "public interface Board\n{\n /** Value for an invalid move */\n int INVALID_MOVE = -1;\n\n /**\n * Returns the height of this Board.\n *\n * @return the height of this Board\n */\n int getHeight();\n\n /**\n * Returns the width of this Board.\n *\n * @return the width of this Board\n */\n int getWidth();\n\n /**\n * Returns the win condition of this Board.\n *\n * @return the win condition of this Board\n */\n int getWinCondition();\n\n /**\n * Returns the winner based on the current state of the board. Assumes that\n * the board is in a valid state and that there is only one player who has\n * n-in-a-row.\n *\n * @return the winner\n */\n Piece getWinner();\n\n /**\n * Returns the piece in the specified column and row.\n *\n * @param col the column\n * @param row the row\n * @return the Piece at the specified position\n */\n Piece getPieceAt(int col, int row);\n\n /**\n * Returns the current turn. Turns start at 0.\n *\n * @return the current turn\n */\n int getCurrentTurn();\n\n /**\n * Returns the next piece to be played. Turns alternate between Black and\n * Red, starting with Black on the first turn.\n *\n * @return the next piece to be played\n */\n Piece getNextPiece();\n\n /**\n * Plays the next piece in the specified column. Columns start from 0 on the\n * far left and end with (width - 1) on the far right. The next piece is\n * determined by the current turn. The piece will be placed in the lowest\n * empty row in the specified column.\n *\n * @param col the column to play the next piece\n * @throws IllegalMoveException if the column is not a valid column or if\n * the column is full\n */\n void play(int col) throws IllegalMoveException;\n\n /**\n * Undoes the last play on this Board.\n *\n * @throws IllegalStateException if the board is empty (i.e. no plays have\n * been made)\n */\n void undoPlay();\n\n /**\n * Checks if playing a piece in the specified column is valid. A move is\n * valid if the column is greater than or equal to 0 (far left column) and\n * less than the width of this Board (far right column) and the column is\n * not full. This method assumes that the board is in a valid state and only\n * checks if the top row of the column is empty.\n *\n * @param col the column to play the next piece\n * @return true if the move is valid, false otherwise.\n */\n boolean isValidMove(int col);\n\n /**\n * Adds a BoardListener to this Board.\n *\n * @param boardListener the BoardListener being added\n */\n void addBoardListener(BoardListener boardListener);\n\n /**\n * Returns an immutable view of this board.\n *\n * @return an immutable view of this board\n */\n ImmutableBoard getImmutableView();\n}", "public boolean isMovePossible(int start, int end, boolean isRed){\n\n int moveDiff = end - start; //moveDiff tracks the movement made based on difference btwn start and end\n //general check for if a checker is on the end square\n if (mCheckerBoard.get(end) != null)\n {\n return false; //can't move b/c a checker is on the end square\n }\n\n //general checks that start and end are on the board\n if(end<0 || end>63)\n {\n return false; //can't move b/c end is off-board\n }\n\n\n //checks for diagonalRight\n if(moveDiff == 9 || moveDiff ==-7)\n {\n if(start % 8 == 7){\n return false; //can't move b/c off-board on right\n }\n }\n\n //checks for diagonalLeft\n if(moveDiff == 7 || moveDiff ==-9)\n {\n if(start % 8 == 0){\n return false; //can't move b/c off-board on left\n }\n }\n\n //checks for jumpRight\n if(moveDiff == 18 || moveDiff == -14){\n //column check\n if((start % 8 == 7) || (start % 8 == 6)){\n return false; //can't move b/c off-board on right\n }\n //need to check if there is a piece of opposite color in between\n int jumpSpace = start + (moveDiff/2);\n Checker jumped = mCheckerBoard.get(jumpSpace);\n if(jumped == null)\n {\n return false; //can't move b/c no checker to jump\n }\n else if (jumped.isRed() == isRed)\n {\n return false; //can't move b/c can't jump own color\n }\n }\n\n //checks for jumpLeft\n if(moveDiff == 14 || moveDiff == -18){\n if((start % 8 == 7) || (start % 8 == 6)) {\n return false; //can't move b/c off-board on right\n }\n //need to check if there is a piece of opposite color in between\n int jumpSpace = start + (moveDiff/2);\n Checker jumped = mCheckerBoard.get(jumpSpace);\n if(jumped == null)\n {\n return false; //can't move b/c no checker to jump\n }\n else if (jumped.isRed() == isRed)\n {\n return false; //can't move b/c can't jump own color\n }\n }\n\n if(moveDiff == 7 || moveDiff ==-7 || moveDiff ==9 || moveDiff ==-9\n || moveDiff == 18 || moveDiff == -18 || moveDiff == 14 || moveDiff ==-14){\n return true;\n }\n else{\n return false;\n }\n\n }", "@Override\n\tpublic void makeMove(Game game) \n\t{\n\t\t\n\t\tint row1,col1,row2,col2;\n\t\tCheckers tttGame = (Checkers) game;\n\t\t\n\t\tboolean first = true;\n\n\t\t\tcorrectmove= false;\n\t\t\tSystem.out.println(\"Insert target (row,column) and destination (row, column) ([0,7])\");\n\n\t\t\trow1 = tttGame.x1;\n\t\t\tcol1 = tttGame.y1;\n\t\t\trow2 = tttGame.x2;\n\t\t\tcol2 = tttGame.y2;\n\t\t\tSystem.out.println(row1 + \" \" + col1 + \" \" + row2 + \" \" + col2 + \" \" + role);\n\t\t\t\n\t\t\tfirst=false;\n\t\tcorrectmove= tttGame.isValidCell(row1, col1, row2, col2,role);\n\t\tSystem.out.println(correctmove);\n\n\t\tif(correctmove)\n\t\t{\n\t\t\ttttGame.board[row2][col2]= tttGame.board[row1][col1];\n\t\t\tif(row2==0 && role==0) \n\t\t\t{\n\t\t\t\tif(role==0) tttGame.board[row2][col2]= 2;\n\t\t\t\telse tttGame.board[row2][col2]= -2;\n\t\t\t}\n\t\t\telse if(row2==7 && role==1) \n\t\t\t{\n\t\t\t\tif(role==0) tttGame.board[row2][col2]= 2;\n\t\t\t\telse tttGame.board[row2][col2]= -2;\n\t\t\t}\n\t\t\ttttGame.board[row1][col1]=0;\n\t\t\tif(abs(row1-row2)==2)\n\t\t\t{\n\t\t\t\tint x= (row1+ row2)/2;\n\t\t\t\tint y= (col1+ col2)/2;\n\t\t\t\ttttGame.board[x][y]=0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"invalid move!\");\n\t\t}\n\t\t\n//\t\ttttGame.board[row][col] = role;\n\t}", "public static void main(String[] args) {\n\n Scanner scanner = new Scanner(System.in);\n\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n gameBoard[i][j] = ' ';\n }\n }\n\n printBoard();\n// String input = scanner.nextLine();\n//\n\n//\n// String line1 = input.substring(0, 3);\n// String line2 = input.substring(3, 6);\n// String line3 = input.substring(6);\n//\n// System.out.println(\"Enter cells: \" + input);\n//\n// System.out.println(\"---------\");\n//\n// spaceOut(line1);\n// spaceOut(line2);\n// spaceOut(line3);\n//\n// System.out.println(\"---------\");\n\n boolean gameOver = false;\n\n while(!gameOver){\n System.out.println(\"Enter the coordinates:\");\n\n String entry = scanner.nextLine();\n\n String value = checkCoordinates(entry);\n\n if (value == \"good\") {\n //Change the game board\n printBoard();\n String result = checkResult();\n\n if(result != \"Game not finished\") {\n System.out.println(result);\n gameOver = true;\n }\n\n } else {\n System.out.println(value);\n }\n\n }\n\n\n\n// checkResult(input);\n }", "@Test\n public void test11() { \n Board board11 = new Board();\n board11.put(1,3,1);\n board11.put(2,3,1);\n board11.put(3,3,1);\n assertTrue(board11.checkWin());\n }", "public boolean checkMoveValidity(Board board, Piece[][] b, int curRow, int curCol, int newRow, int newCol)\n {\n if(new Rook(color).checkMoveValidity(board, b, curRow, curCol, newRow, newCol) || new Bishop(color).checkMoveValidity(board, b, curRow, curCol, newRow, newCol))\n return true;\n return false;\n }", "public TicTacToe() {\n resetBoard();\n }", "public Tile[][] updateBoard(int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\t\t/*String[] fileRanks = input.split(\" \");\n\t\tint startRow= 8 -Integer.parseInt(fileRanks[0].substring(1));\n\t\tint startColumn = (fileRanks[0].charAt(0)) -'a';\n\t\tint endRow = 8-Integer.parseInt(fileRanks[1].substring(1));\n\t\tint endColumn = (fileRanks[1].charAt(0))-'a'; */\n\n\t\tboard[endRow][endColumn].setOccupyingPiece(null);\n\t\tboard[endRow][endColumn].setOccupyingPiece(board[startRow][startColumn].getOccupyingPiece());\n\t\tboard[startRow][startColumn].setOccupyingPiece(null);\n\n\t\treturn board;\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = from.getX() - to.getX();\r\n int y = from.getY() - to.getY();\r\n \r\n if (x < 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n } \r\n return true;\r\n }\r\n else if(x > 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n }\r\n return true;\r\n }\r\n else if( x > 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n }\r\n return true; \r\n }\r\n else if (x < 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n } \r\n return true;\r\n }\r\n\r\n return false;\r\n }", "@Test\n\tpublic void moveToValidSpace() throws Exception {\n\t\tgame.board.movePiece(knightCorner1Black, 1, 2);\n\t\tgame.board.movePiece(knightCorner2White, 5, 6);\n\t\tgame.board.movePiece(knightSide1Black, 2, 2);\n\t\tgame.board.movePiece(knightSide2White, 4, 5);\n\t\tgame.board.movePiece(knightMiddleWhite, 5, 2);\n\t\tassertEquals(knightCorner1Black, game.board.getPiece(1, 2));\n\t\tassertEquals(knightCorner2White, game.board.getPiece(5, 6));\n\t\tassertEquals(knightSide1Black, game.board.getPiece(2, 2));\n\t\tassertEquals(knightSide2White, game.board.getPiece(4, 5));\n\t\tassertEquals(knightMiddleWhite, game.board.getPiece(5, 2));\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX());\r\n int y = Math.abs(from.getY() - to.getY());\r\n if((from.getX() - to.getX()) > 0 || (from.getY() - to.getY()) > 0){\r\n if ((x == 0 && y >= 1)) {\r\n for(int i = 1; i <= y-1; i++){\r\n if(board.getBox(from.getX(), from.getY() - i).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }else if((x >= 1 && y == 0)){\r\n for(int i = 1; i <= x-1; i++){\r\n if(board.getBox(from.getX() - i, from.getY()).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }else if((from.getX() - to.getX()) < 0 || (from.getY() - to.getY()) < 0){\r\n if (x == 0 && (from.getY() - to.getY()) <= -1) {\r\n for(int i = y-1; i > 0; i--){\r\n if(board.getBox(from.getX(), from.getY() + i).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }else if((from.getX() - to.getX()) <= -1 && y == 0){\r\n for(int i = x-1; i > 0; i--){\r\n if(board.getBox(from.getX() + i, from.getY()).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public void actionPerformed(ActionEvent evt) {\n if ( player == 0 ) { // Player O - blackstone\n if (jButton[j].getIcon().equals(B)) {\n jButton[j].setIcon(O); // value of current button read left to right and then top to bottom\n \n board[j/csize][j%csize] = 0;\n int win = 1;\n win = checkrow(board,j/csize,0);\n if ( win == 0 ) {\n win = checkcol(board,j%csize,0);\n }\n if ( win == 0 ) {\n win = checkdiag(board,0 , j/csize, j%csize);\n }\n player = 1; // switches player\n markers++;\n\n if ( win == 1 ) {\n exitAction(\"Blackstone wins!\\n\");\n }\n if ( markers == gsize ) { // if all blocks have been taken\n exitAction(\"Draw!\\n\");\n }\n } \n } else { // Player X - whitestone = 1\n if (jButton[j].getIcon().equals(B)) {\n jButton[j].setIcon(X);\n board[j/csize][j%csize] = 1;\n int win = 1;\n win = checkrow(board,j/csize,1);\n if ( win == 0 ) {\n win = checkcol(board,j%csize,1);\n }\n if ( win == 0 ) {\n win = checkdiag(board, 1, j/csize, j%csize );\n }\n player = 0;\n markers++;\n\n if ( win == 1 ) {\n exitAction(\"Whitestone wins!\\n\");\n }\n if ( markers == gsize ) {\n exitAction(\"Draw!\\n\");\n }\n } \n }\n }", "private void buttonClicked(int c){\r\n boardRep[currentFilled[c]][c] = blackToPlay ? 1:-1; //adjust board rep\r\n if (blackToPlay){\r\n boardSquares[5-currentFilled[c]][c].setBackground(Color.BLACK);\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.RED);\r\n }\r\n int y = 5-currentFilled[c];\r\n \r\n \r\n for (int i = 0; i < 4; i++) { //check horizontal for black win\r\n if ((c-3 + i)>-1 && c-3+i<4){\r\n horizontal4s[y][c-3+i]++;\r\n if (horizontal4s[y][c-3+i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check vertical for black win\r\n if (y-3+i>-1 && y-3+i<3){\r\n vertical4s[y-3+i][c]++;\r\n if (vertical4s[y-3+i][c] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TLBR diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c-3+i>-1 && c-3+i<4){\r\n diagonalTLBR4s[y-3+i][c-3+i]++;\r\n if (diagonalTLBR4s[y-3+i][c-3+i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TRBL diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c+3-i>-1 && c+3-i < 4){\r\n diagonalTRBL4s[y-3+i][c+3-i]++;\r\n if (diagonalTRBL4s[y-3+i][c+3-i] == 4){\r\n winnerText.setText(\"BLACK WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n \r\n \r\n }\r\n else{\r\n boardSquares[5-currentFilled[c]][c].setBackground(Color.RED);\r\n for (int i = 0; i < 7; i++) {\r\n moveSelect[i].setBackground(Color.BLACK);\r\n }\r\n \r\n int y = 5-currentFilled[c];\r\n \r\n \r\n for (int i = 0; i < 4; i++) { //check horizontal for black win\r\n if ((c-3 + i)>-1 && c-3+i<4){\r\n horizontal4s[y][c-3+i]--;\r\n if (horizontal4s[y][c-3+i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check vertical for black win\r\n if (y-3+i>-1 && y-3+i<3){\r\n vertical4s[y-3+i][c]--;\r\n if (vertical4s[y-3+i][c] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TLBR diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c-3+i>-1 && c-3+i<4){\r\n diagonalTLBR4s[y-3+i][c-3+i]--;\r\n if (diagonalTLBR4s[y-3+i][c-3+i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n for (int i = 0; i < 4; i++) { //check TRBL diag for black win\r\n if (y-3+i>-1 && y-3+i<3 && c+3-i>-1 && c+3-i < 4){\r\n diagonalTRBL4s[y-3+i][c+3-i]--;\r\n if (diagonalTRBL4s[y-3+i][c+3-i] == -4){\r\n winnerText.setText(\"RED WINS\");\r\n disableMoves();\r\n }\r\n }\r\n }\r\n \r\n \r\n }\r\n blackToPlay = !blackToPlay;\r\n currentFilled[c]++;\r\n if(currentFilled[c] == 6)\r\n moveSelect[c].setEnabled(false);\r\n }" ]
[ "0.7013071", "0.6868344", "0.65192896", "0.64055544", "0.6398928", "0.6360477", "0.63574296", "0.6351401", "0.62972456", "0.62766486", "0.624728", "0.6218869", "0.61810714", "0.61248213", "0.61132705", "0.60965663", "0.60804826", "0.60790545", "0.60661364", "0.6054188", "0.6050476", "0.6044665", "0.6030463", "0.6025035", "0.602403", "0.601559", "0.6008197", "0.6002872", "0.600279", "0.60019475", "0.5999547", "0.5998834", "0.5997702", "0.59877545", "0.5984363", "0.59834796", "0.59765595", "0.5957795", "0.5956861", "0.5955331", "0.5954833", "0.5940831", "0.59383696", "0.5932043", "0.59251654", "0.5914633", "0.5911085", "0.5910082", "0.59085053", "0.590765", "0.59064955", "0.5881668", "0.5879821", "0.5866801", "0.5858305", "0.584539", "0.58446324", "0.58418757", "0.5840747", "0.5837154", "0.5836051", "0.5834342", "0.5829486", "0.58263916", "0.5820714", "0.5815374", "0.58121985", "0.58063394", "0.5802755", "0.5800737", "0.57969", "0.5794137", "0.57917106", "0.5789612", "0.57850945", "0.5784924", "0.578487", "0.5784706", "0.57811695", "0.5780949", "0.57765114", "0.5775848", "0.5775848", "0.5772972", "0.5768554", "0.57581407", "0.5755788", "0.57478917", "0.57470965", "0.57443494", "0.5742333", "0.5734391", "0.5730926", "0.5730514", "0.5727344", "0.5722609", "0.5720827", "0.5714551", "0.5711003", "0.5707523", "0.5706474" ]
0.0
-1
This method simply goes through the whole board the check player points and set their score for the main method.
public static void playerpoints(String board[][]){ int player1pointcount=0, player2pointcount=0; for(int x=1;x<=boardwidth;x++){ for(int i=1;i<=boardlength;i++){ if(board[x][i]=="x"){ player1pointcount++; } if(board[x][i]=="o"){ player2pointcount++; } } } player1score=player1pointcount; player2score=player2pointcount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void calculateScores()\r\n {\r\n for(int i = 0; i < gameBoard.getBoardRows(); i++)\r\n for(int j = 0; j < gameBoard.getBoardCols(); j++)\r\n {\r\n if(gameBoard.tilePlayer(i,j) == 0)\r\n currentRedScore = currentRedScore + gameBoard.tileScore(i,j);\r\n if(gameBoard.tilePlayer(i,j) == 1)\r\n currentBlueScore = currentBlueScore + gameBoard.tileScore(i,j);\r\n }\r\n }", "private void scoreboard() {\n Intent intent = new Intent(this, AlienPainterScoreboardActivity.class);\n intent.putExtra(SCOREBOARD_STATUS, presenter.getIsVictorious());\n intent.putExtra(POINTS, presenter.getPoints());\n intent.putExtra(NUM_MOVES, presenter.getNumMoves());\n intent.putExtra(TIME_LEFT, presenter.getTimeLeft());\n intent.putExtra(LANGUAGE, isEnglish);\n intent.putExtra(PASS_USER, currUser);\n startActivity(intent);\n finish();\n }", "public static void setScoreBoard(Player p) {\n\t\n}", "public void updateScoreBoard() {\n Player player1 = playerManager.getPlayer(1);\n Player player2 = playerManager.getPlayer(2);\n MainActivity mainActivity = (MainActivity) this.getContext();\n\n mainActivity.updateScoreBoard(player1, player2);\n }", "public void countPoints() {\n points = 0;\n checkAnswerOne();\n checkAnswerTwo();\n checkAnswerThree();\n checkAnswerFour();\n checkAnswerFive();\n checkAnswerSix();\n checkAnswerSeven();\n checkAnswerEight();\n checkAnswerNine();\n checkAnswerTen();\n }", "public void testScoreboardCaseOne () throws Exception {\n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20 (a No before first yes)\n \"2,1,A,3,Yes\", // 3 (first yes counts Minute points but never Run Penalty points)\n \"3,1,A,5,No\", // zero -- after Yes\n \"4,1,A,7,Yes\", // zero -- after Yes\n \"5,1,A,9,No\", // zero -- after Yes\n \"6,1,B,11,No\", // zero -- not solved\n \"7,1,B,13,No\", // zero -- not solved\n \"8,2,A,30,Yes\", // 30 (minute points; no Run points on first Yes)\n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n scoreboardTest (2, runsData, rankData);\n }", "@Test\n void should_first_player_win_and_finish_the_game_when_second_player_has_score_5() {\n List<Integer> setPointOrderTab = Arrays.asList(2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1); // 7-5\n\n //WHEN\n game.computePoint(setPointOrderTab, true);\n\n //THEN\n assertTrue(firstPlayer.isWinner());\n assertEquals(GameStatus.FINISHED, game.getGameStatus());\n }", "public void checkScore() {\n\n whatIsTurnScore();\n\n if (turn == 1) {\n\n if ((p1.getScore() - turnScore < 0) || (p1.getScore() - turnScore == 1)) {\n newScore.setText(null);\n\n displayScore();\n\n\n Toast.makeText(this, \"Bust\", Toast.LENGTH_SHORT).show();\n } else if (p1.getScore() - turnScore > 1) {\n if ((turnScore > 99) && (turnScore < 140)) {\n p1.setHundres(p1.getHundres() + 1);\n } else if ((turnScore > 139) && (turnScore < 180)) {\n p1.setOneforties(p1.getOneforties() + 1);\n } else if (turnScore == 180) {\n p1.setOneeighties(p1.getOneeighties() + 1);\n }\n calculateScore();\n\n\n displayScore();\n } else if (p1.getScore() - turnScore == 0) {\n p1.setScore(0);\n }\n }\n\n if (turn == 2) {\n if ((p2.getScore() - turnScore < 0) || (p2.getScore() - turnScore == 1)) {\n newScore.setText(null);\n teamBCheckout.setText(checkOut(p2.getScore()));\n displayScore();\n\n\n Toast.makeText(this, \"Bust\", Toast.LENGTH_SHORT).show();\n } else if (p2.getScore() - turnScore > 1) {\n\n if ((turnScore > 99) && (turnScore < 140)) {\n p2.setHundres(p2.getHundres() + 1);\n } else if ((turnScore > 139) && (turnScore < 180)) {\n p2.setOneforties(p2.getOneforties() + 1);\n } else if (turnScore == 180) {\n p2.setOneeighties(p2.getOneeighties() + 1);\n }\n calculateScore();\n\n displayScore();\n\n } else if (p2.getScore() - turnScore == 0) {\n p2.setScore(0);\n }\n\n }\n\n\n }", "@Test\r\n public void calculateScore() {\r\n board3.swapTiles(0,0,1,1);\r\n board3.getSlidingScoreBoard().setTime(2);\r\n board3.getSlidingScoreBoard().calculateScore();\r\n assertEquals(496, board3.getSlidingScoreBoard().getScore());\r\n }", "public void testScoreboardCaseOneA() throws Exception{\n \n String [] runsData = {\n \"2,8,C,1,No\",\n \"15,8,D,1,Yes\",\n \"23,8,D,1,No\",\n \"29,8,D,1,No\",\n \"43,8,C,1,No\",\n \"44,8,A,1,Yes\",\n \"52,8,C,1,Yes\",\n \"65,8,B,2,Yes\",\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team8,4,45\",\n \"2,team1,0,0\",\n \"2,team2,0,0\",\n \"2,team3,0,0\",\n \"2,team4,0,0\",\n \"2,team5,0,0\",\n \"2,team6,0,0\",\n \"2,team7,0,0\",\n };\n \n scoreboardTest (8, runsData, rankData);\n }", "public void testScoreboardCaseFour () throws Exception {\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n\n \"1,1,A,1,No\", //20\n \"2,1,A,3,Yes\", //3 (first yes counts Minutes only)\n \"3,1,A,5,No\", //20\n \"4,1,A,7,Yes\", //20 \n \"5,1,A,9,No\", //20\n \n \"6,1,B,11,No\", //20 (all runs count)\n \"7,1,B,13,No\", //20 (all runs count)\n \n \"8,2,A,30,Yes\", //30\n \n \"9,2,B,35,No\", //20 (all runs count)\n \"10,2,B,40,No\", //20 (all runs count)\n \"11,2,B,45,No\", //20 (all runs count)\n \"12,2,B,50,No\", //20 (all runs count)\n \"13,2,B,55,No\", //20 (all runs count)\n\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 4 tests when all runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n \n// Team 1 -- 123 <-- Team 1 is winning again\n// Team 2 -- 130\n \n// String [] rankData = {\n// \"1,team1,1,123\",\n// \"2,team2,1,130\"\n// };\n \n scoreboardTest (2, runsData, rankData);\n }", "public void calculateScore() {\n\n turnScore();\n\n if (turn == 1) {\n p1.setScore(p1.getScore() - turnScore);\n\n } else if (turn == 2) {\n p2.setScore(p2.getScore() - turnScore);\n\n }\n\n\n }", "@Override\n\tpublic void checkScore() {\n\t\t\n\t}", "public void scoring(){\n for (int i=0; i< players.size(); i++){\n Player p = players.get(i);\n p.setScore(10*p.getTricksWon());\n if(p.getTricksWon() < p.getBid() || p.getTricksWon() > p.getBid()){\n int diff = Math.abs(p.getTricksWon() - p.getBid());\n p.setScore(p.getScore() - (10*diff));\n }\n if(p.getTricksWon() == p.getBid()){\n p.setScore(p.getScore() + 20);\n }\n }\n }", "public static void scoreBoard(int scoreP1, int scoreP2)\n { \n System.out.println(\" ______________\");\n System.out.println(\"| *Scores* |\");\n System.out.println(\"|Player 1: \"+scoreP1+\" |\");\n System.out.println(\"|--------------|\"); \n System.out.println(\"|Player 2: \"+scoreP2+\" |\");\n System.out.println(\"|______________|\");\n \n }", "public void CalculatePointsFromEachPlayerToWinner(Player winner) {\n\n\t\tfor (int i = 0; i < players.size(); i++) { \n\t\t\tif (players.get(i).getName() != winner.getName()) {\n\t\t\t\tfor (int j = 0; j < players.get(i).getPlayersHand().size(); j++) {\n\t\t\t\t\twinner.setPlayerScore(players.get(i).getPlayersHand().get(j).getValue() + winner.getPlayerScore());\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\t\tif (winner.getPlayerScore() > 500) {\n\t\t\t//End of game. Implement this later\n\t\t}\n\t}", "public int evaluate(PentagoBoardState pbs) {\n PentagoBoardState.Piece[][] pieces = pbs.getBoard();\n\n\n int whitescore =0; //keep track of white's total score\n int blackscore = 0;//keep track of black's total score\n\n //Check rows\n for (int x = 0; x <6 ; x++) {\n int countWHori = 0;\n int countBHori = 0;\n\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = 0; y <5 ; y++) {\n //Count how many black and white pieces\n if (pieces[x][y].ordinal() == 0 ) {\n\n //countBHori = countBHori + countvalue;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWHori = countWHori +countvalue;\n whites++;\n }\n\n //Check for consecutive\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n\n //Check for disjoint and joint set If * B B W * * then disjoint and * B B * B * Then joint set for B * B\n if (y!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 && pieces[x][y+2].ordinal() == 1){\n countBHori = countBHori +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 && pieces[x][y+2].ordinal() == 0){\n countWHori = countWHori +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 0){\n countBHori = countBHori +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 1){\n countWHori = countWHori +jointset;\n }\n }\n }\n //check if unwinnable\n if (blacks == 4 && whites==2){\n countBHori += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWHori += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countWHori += unwinnable;\n countBHori += unwinnable;\n }\n\n\n //Run value for row in evaluation scheme and add to total score\n int valuew = consecutivevalue(countWHori);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBHori);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec hori \" + valueb + \"White consec hori \" + valuew);\n\n }\n\n //Check Verticals\n for (int y = 0; y <6 ; y++) {\n int countWvert = 0;\n int countBvert = 0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int x = 0; x <5 ; x++) {\n if (pieces[x][y].ordinal() == 0) {\n\n //countBvert = countBvert +1;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWvert = countWvert +1;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n\n if (x!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 1){\n countBvert = countBvert +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 0){\n countWvert = countWvert +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0){\n countBvert = countBvert +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1){\n countWvert = countWvert +jointset;\n }\n }\n }\n\n if (blacks == 4 && whites==2){\n countBvert += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBvert += unwinnable;\n countWvert += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWvert += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBvert + \"White consec \" + countWvert);\n int valuew = consecutivevalue(countWvert);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBvert);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec VERT \" + valueb + \"White consec hori \" + valuew);\n }\n\n //S West N EAST Top\n for (int a = 1; a <6 ; a++) { //loop through all diagonal lines\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = a; y !=0 ; y--) { //loop through one diagonal line\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +2;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n // check for joint and disjoint set at these x y coordinates by looking 2 pieces ahead\n if (x==0 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==0 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n\n x++;\n\n\n }\n if (blacks == 4 && whites==2){\n countBdiagSoNe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n //S West N EAST Bot\n for (int a = 1; a <5 ; a++) {\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int y=5;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n if (x==1 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n //System.out.println(x + \" y:\" + y +\" Black consec DIAGOMAAL \" + countBdiagSoNe + \"White consec hori \" + countWdiagSoNe);\n y--;\n\n\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n /*if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }*/\n if (a==1&& blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n\n //NorthWest S EAST Left\n for (int a = 0; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int y=0;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n //System.out.println(pbs+\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n y++;\n\n\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n if (blacks == 4 && whites==2){\n countBdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagNoSe += unwinnable;\n countWdiagNoSe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n //NorthWest S EAST Right\n for (int a = 1; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n for (int y = a; y <5 ; y++) {\n //System.out.println(\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0 ) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n x++;\n\n\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n\n\n\n\n\n //System.out.println(\"Black consec score \" + blackscore +\" \" + \"White consec scpre \" + whitescore);\n //System.out.println(\"max player is \" + maxplayer + \"My colour is \" + mycolour);\n int i = -123456789;\n if (mycolour == 0){\n //System.out.println(blackscore-whitescore +\" I am black\");\n\n\n i= blackscore-whitescore;\n return i;\n\n }\n else {\n //System.out.println(whitescore-blackscore +\" I am white\");\n i= whitescore-blackscore;\n return i;\n }\n /*\n if(i>0 && i<1000){\n return 100; //i*2;\n }\n else if(i>=1000 && i<10000){\n return 1000; //i*10;\n }\n else if(i>=10000 && i<100000){\n return 10000; //i*50;\n }\n else if(i>=100000){\n return 100000;//i*500;\n }\n else if(i<=0 && i>-100){\n return -100; //i*2;\n }\n else if(i<=-100 && i>-1000){\n return -1000; //i*10;\n }\n else if(i<=-1000 && i>-10000){\n return -10000; //i*50;\n }\n else if(i<=0 && i>-100000){\n return -100000;//i*500;\n }\n\n */\n\n\n }", "@Override\n\tpublic void homeTeamScored(int points) {\n\t\t\n\t}", "public void scoresForGameModes() {\r\n \tCalculateScore myScore = new CalculateScore();\r\n \tthis.score = myScore.giveScore();\r\n \tif (gamemode == 1) {\r\n \t\treturn;\r\n \t}\r\n \tif (gamemode ==2 ) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() - set.size()));\r\n \t}\r\n \tif (gamemode ==3) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() -set.size()));\r\n \t}\r\n }", "public void testScoreboardCaseThree () throws Exception {\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (first Yes counts only Min.Pts)\n \"3,1,A,5,No\", // 20\n \"4,1,A,7,Yes\", // 20 (all runs count!)\n \"5,1,A,9,No\", // 20\n\n \"6,1,B,11,No\", // zero (not solved)\n \"7,1,B,13,No\", // zero (not solved)\n\n \"8,2,A,30,Yes\", // 30\n\n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 3 tests when all runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n \n// String [] rankData = {\n// \"1,team2,1,30\"\n// \"2,team1,1,83\",\n// };\n \n scoreboardTest (2, runsData, rankData);\n }", "public void testScoreboardCaseTwo () throws Exception{\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (Minute points for 1st Yes count)\n \"3,1,A,5,No\", // 20 (a No on a solved problem)\n \"4,1,A,7,Yes\", // zero (only \"No's\" count)\n \"5,1,A,9,No\", // 20 (another No on the solved problem)\n \n \"6,1,B,11,No\", // zero (problem has not been solved)\n \"7,1,B,13,No\", // zero (problem has not been solved)\n \n \"8,2,A,30,Yes\", // 30 (Minute points for 1st Yes)\n \n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n\n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\",\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 2 tests when all no runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n\n// Team 2 -- 30 <-- Team 2 is now winning with a lower score \n// Team 1 -- 63 (same database; different scoring method)\n \n// String [] rankData = {\n// \"1,team2,1,30\",\n// \"2,team1,1,63\",\n// };\n \n \n scoreboardTest (2, runsData, rankData);\n \n }", "private void initializeBoard(){\r\n checks =new int[][]{{0,2,0,2,0,2,0,2},\r\n {2,0,2,0,2,0,2,0},\r\n {0,2,0,2,0,2,0,2},\r\n {0,0,0,0,0,0,0,0},\r\n {0,0,0,0,0,0,0,0},\r\n {1,0,1,0,1,0,1,0},\r\n {0,1,0,1,0,1,0,1},\r\n {1,0,1,0,1,0,1,0}};\r\n }", "public static void postScores() {\r\n\t\t//Copies the scores for four handed team based play.\r\n\t\tif (Main.isFourHandedTeams) {\r\n\t\t\tMain.team1Score = Main.teamOne.score;\r\n\t\t\tMain.team2Score = Main.teamTwo.score;\r\n\t\t//Copies the scores for non four handed team based play.\r\n\t\t} else {\r\n\t\t\tMain.player1Score = Main.playerOne.score;\r\n\t\t\tMain.player2Score = Main.playerTwo.score;\r\n\t\t\tMain.player3Score = Main.playerThree.score;\r\n\r\n\t\t\t//Copies the scores for four handed single player game.\r\n\t\t\tif (!Main.isThreeHanded) {\r\n\t\t\t\tMain.player4Score = Main.playerFour.score;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void scoregain() {\n \tif (playerturn%2==0) {\n \tscoreplayer1 = scoreplayer1+2;}\n if(playerturn%2==1) {\n \tscoreplayer2 = scoreplayer2+2;\n }\n }", "private void computeTrickPoints(int leadPlayer, int numAlive) {\n trickPoints = new ArrayList<Integer>();\n for (int i = 0; i < numAlive; i++) {\n trickPoints.add(0);\n }\n \n List<Integer> cardsPlayed = trickInfo.getCardsPlayed();\n for (int i = 0; i < numAlive; i++) {\n int turn = (i + leadPlayer) % numAlive;\n if (turn == trickInfo.getHighestPlayPlayer()) {\n // Winner gets points equal to their card\n trickPoints.set(turn, trickInfo.getHighestPlay());\n \n } else if (cardsPlayed.get(turn) == trickInfo.getHighestPlay()) {\n // Deduct points from players who played same rank as winner\n trickPoints.set(turn, -trickInfo.getHighestPlay());\n }\n }\n }", "@Override\n public void updateScore(int winner)\n {\n if (winner == 0)\n {\n playerOneScore++;\n }\n else\n {\n playerTwoScore++;\n }\n }", "@Test\n void should_second_player_win_match_when_he_won_tie_break() {\n List<Integer> setPointOrderTab = Arrays.asList(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2); // 6-6 and 1-3 for secondPlayer\n\n //WHEN\n game.computePoint(setPointOrderTab, true);\n\n //THEN\n assertEquals(GameStatus.FINISHED, game.getGameStatus());\n assertTrue(secondPlayer.isWinner());\n }", "public void updatePlayerScore()\n\t{\n\t\tthis.score = (int)(getBalance() - 500) - (getNumberOfLoans()*500); \n\t}", "@Test\n public void addScoreTest() {\n assertTrue(enemyGameBoard.getScore() == 0); //Check if initial value of points = 0\n\n enemyGameBoard.addScore(false, false); //Did not hit a ship\n assertTrue(enemyGameBoard.getScore() == 0);\n\n enemyGameBoard.addScore(true, false); //Hit a ship, but the ship did not sink\n assertTrue(enemyGameBoard.getScore() == 1); \n\n enemyGameBoard.addScore(false, false); //Did not hit a ship, so points should stay 1\n assertTrue(enemyGameBoard.getScore() == 1); \n\n enemyGameBoard.addScore(true, true); //Hit a ship, and ship has been sunk\n assertTrue(enemyGameBoard.getScore() == 3);\n\n enemyGameBoard.addScore(false, false); //Did not hit a ship, so points should stay 3 after a ship has been sunk\n assertTrue(enemyGameBoard.getScore() == 3);\n\n enemyGameBoard.addScore(false, true); //Did not hit a ship, but did sunk the ship. This should not add any points to the score\n assertTrue(enemyGameBoard.getScore() == 3);\n }", "@Test\n void should_first_player_win_and_finish_the_game() {\n List<Integer> setPointOrderTab = Arrays.asList(1, 1, 1, 2, 1, 1, 1); // 6-1\n\n //WHEN\n game.computePoint(setPointOrderTab, true);\n\n //THEN\n assertTrue(firstPlayer.isWinner());\n assertEquals(GameStatus.FINISHED, game.getGameStatus());\n }", "private static int evalState(GameState state){\n Move m = state.getMove();\n int counter = 0;\n\n // return directly if we encouter win or loss\n if(m.isXWin()){\n return 10000;\n }\n else if(m.isOWin()){\n return -1;\n }\n\n Vector<Integer> points = new Vector<Integer>();\n points.setSize(state.BOARD_SIZE*2+2);\n int player;\n Collections.fill(points, 1);\n int scaling = 4;\n int value = 0;\n\n for(int row = 0; row < state.BOARD_SIZE; row ++){\n for(int col = 0; col < state.BOARD_SIZE; col ++){\n player = state.at(row, col);\n\n // add points to the vector, increase by a factor for every new entry\n if(player == 1){\n points.set(row, points.get(row)*scaling);\n points.add(state.BOARD_SIZE + col, points.get(state.BOARD_SIZE - 1 + col)*scaling);\n\n // if it's in the first diagonal\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, points.get(state.BOARD_SIZE*2)*scaling);\n }\n\n // checking other diagonal\n if(counter%state.BOARD_SIZE-1 == 0 && row+col != 0){\n points.add(state.BOARD_SIZE*2 + 1, points.get(state.BOARD_SIZE*2)*scaling);\n }\n }\n // if an enemy player is encoutered null the value of the row/col\n else if(player == 2){\n points.set(row, 0);\n points.set(state.BOARD_SIZE + col, 0);\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, 0);\n }\n if(counter%state.BOARD_SIZE-1 == 0){\n points.add(state.BOARD_SIZE*2 + 1, 0);\n }\n }\n counter++;\n }\n }\n\n // if we have nulled the point we don't count it for the value of the state\n for(Integer i: points){\n if(i > 1){\n value += i;\n }\n }\n //System.err.println(\"Value: \" + value);\n return value;\n }", "public void setScoreboard(final Player player) {\n ConfigurationSection scoreboardSettings = ConfigurationManager.getInstance().getMainConfiguration().getConfigurationSection(Strings.CONFIG_SCOREBOARD_SECTION);\n\n ScoreboardManager scoreboardManager = CustomGUIShop.getInstance().getServer().getScoreboardManager();\n final Scoreboard scoreboard = scoreboardManager.getNewScoreboard();\n addPlayerToGroup(scoreboard, player);\n final Objective objective = scoreboard.registerNewObjective(\"sb\", \"dummy\");\n objective.setDisplaySlot(DisplaySlot.SIDEBAR);\n\n final Objective objective2 = scoreboard.registerNewObjective(\"sb2\", \"dummy\");\n objective2.setDisplaySlot(DisplaySlot.PLAYER_LIST);\n\n // SERVER\n objective.getScore(ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_REPUTATION_TITLE))).setScore(15);\n final Team reputation = scoreboard.registerNewTeam(\"reputation\");\n reputation.addPlayer(Bukkit.getOfflinePlayer(\" \"));\n objective.getScore(\" \").setScore(14);\n objective.getScore(\" \").setScore(13);\n\n // COINS\n objective.getScore(ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_LEVEL_TITLE))).setScore(12);\n final Team level = scoreboard.registerNewTeam(\"level\");\n level.addPlayer(Bukkit.getOfflinePlayer(\" \"));\n objective.getScore(\" \").setScore(11);\n objective.getScore(\" \").setScore(10);\n\n // PIXELITES\n objective.getScore(ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_NEXTLEVEL_TITLE))).setScore(9);\n final Team nextLevel = scoreboard.registerNewTeam(\"nextLevel\");\n nextLevel.addPlayer(Bukkit.getOfflinePlayer(\" \"));\n objective.getScore(\" \").setScore(8);\n objective.getScore(\" \").setScore(7);\n\n // RANK\n objective.getScore(ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_BALANCE_TITLE))).setScore(6);\n final Team balance = scoreboard.registerNewTeam(\"balance\");\n balance.addPlayer(Bukkit.getOfflinePlayer(\" \"));\n objective.getScore(\" \").setScore(5);\n objective.getScore(\" \").setScore(4);\n\n final String title = ChatColor.translateAlternateColorCodes('&', scoreboardSettings.getString(Strings.CONFIG_SCOREBOARD_DISPLAY_NAME));\n\n new BukkitRunnable() {\n public void run() {\n try {\n objective.setDisplayName(title);\n reputation.setPrefix(String.valueOf(ReputationManager.getReputation(player)));\n level.setPrefix(String.valueOf(ReputationManager.getReputationLevel(player)));\n nextLevel.setPrefix(String.valueOf(ReputationManager.getReputation(player)) + \"/\" + String.valueOf(ReputationManager.getReputation(player) + ReputationManager.getNextLevel(player)));\n balance.setPrefix(String.valueOf(CustomGUIShop.getInstance().getEconomy().getBalance(player)));\n objective2.getScore(player).setScore(ReputationManager.getReputationLevel(player));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }.runTaskTimer(CustomGUIShop.getInstance(), 0, 5);\n player.setScoreboard(scoreboard);\n }", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "@Test\n void should_first_player_win_set_and_game_still_in_progress_when_tie_break_activated() {\n List<Integer> setPointOrderTab = Arrays.asList(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1); // 6-6 and 1-0 for firstPlayer\n\n //WHEN\n game.computePoint(setPointOrderTab, true);\n\n //THEN\n assertEquals(GameStatus.IN_PROGRESS, game.getGameStatus());\n assertTrue(game.isTiebreakIsActivated());\n }", "private void pointsChecker(Points score) {\n boolean correct_Form=true;;\n try {\n Number = Integer.parseInt(scorefield.getText());\n\n } catch (Exception e) {\n reset(true);\n JOptionPane.showMessageDialog(frame, \"Not a correct input\");\n reset(false);\n correct_Form=false;\n\n\n }\n if (Number<0) {\n reset(false);\n JOptionPane.showMessageDialog(frame, \"Score can't be lower than 0\");\n }\n else if (Number>30) {\n reset(false);\n JOptionPane.showMessageDialog(frame, \"Score can't be greater than 30\");\n\n }\n else if (correct_Form){\n if(W.isSelected()) {\n\n score.increasePointsOfWe(Number,mee.isSelected(),tegen.isSelected());\n mee.setSelected(false);\n tegen.setSelected(false);\n }\n else if(Z.isSelected()) {\n score.increasePointsOfThem(Number,mee.isSelected(),tegen.isSelected());\n mee.setSelected(false);\n tegen.setSelected(false);\n }\n reset(true);\n JOptionPane.showMessageDialog(frame, score.toString());\n\n\n }\n }", "private void setPoints () {\n\t\tArrayList<Point> emptySpot = new ArrayList<Point>();\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\tif (maze[i][j] == 0) {\n\t\t\t\temptySpot.add(new Point (i, j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tCollections.shuffle(emptySpot);\n\t\tthis.goal = emptySpot.get(0);\n\t\tdouble goalRange = this.goal.getX() + this.goal.getY();\n\t\tfor (int i = 1; i < emptySpot.size(); i++) {\n\t\t\tPoint playerStart = emptySpot.get(i);\n\t\t\tdouble playerRange = playerStart.getX() + playerStart.getY();\n\t\t\tif (Math.abs(playerRange - goalRange) > width/2)\n\t\t\tthis.playerStart = playerStart;\n\t\t}\n\t}", "public static void main(String[] args) throws InterruptedException, NumberFormatException, IOException {\n\n\t\tint game = 0;\n\t\tFile fileToBeModified = new File(\"src/Game/winCount.txt\");\n\t\tBufferedReader reader = new BufferedReader(new FileReader(fileToBeModified));\n\n\t\tint whiteWin = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"White Wins:\" + whiteWin);\n\t\tint blackWin = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"Black Wins:\" + blackWin);\n\t\tint stalemates = Integer.parseInt(reader.readLine());\n\t\tSystem.out.println(\"Stalemates:\" + stalemates);\n\n\t\tint currWhiteWin = 0;\n\t\tint currBlackWin = 0;\n\t\tint currStalemate = 0;\n\n\t\tlong start= System.currentTimeMillis();\n\n\t\tBoardState board = new BoardState();\n\t\tMinimaxAI minimaxBlackPlayer = new MinimaxAI(5);\n\t\tMinimaxAI minimaxWhitePlayer = new MinimaxAI(5);\n\t\tAlphaBetaAI abBlackPlayer = new AlphaBetaAI(5);\n\t\tAlphaBetaAI abWhitePlayer = new AlphaBetaAI(5);\n\t\twhile (game <=30) {\t\n\t\t\tfor (int y = 8; y > 0; y--) {\n\t\t\t\tfor (int x = 1; x <= 8; x++) {\n\t\t\t\t\tSystem.out.print(board.getTile(x, y) + \"\\t\");\n\t\t\t\t}System.out.println();\n\t\t\t}\n\t\t\t\n\t\t\tint turn = 1;\n\t\t\twhile (!board.gameOver()) {\n\t\t\t\tif (board != null) {\n\t\t\t\t\tif (board.isWhiteTurn) {\n\t\t\t\t\t\t//board = abWhitePlayer.alphaBetaPlay(board);\n\t\t\t\t\t\tboard = minimaxWhitePlayer.minimaxPlay(board);\n\t\t\t\t\t}else {\n\t\t\t\t\t\t//board = abBlackPlayer.alphaBetaPlay(board);\n\t\t\t\t\t\tboard = minimaxBlackPlayer.minimaxPlay(board);\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"Turn #\" + turn++);\n\t\t\t\t\tboard.printBoard();\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tTimeUnit.MILLISECONDS.sleep(250);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (board.whiteWin()) {\n\t\t\t\tSystem.out.println(\"White Wins\");\n\t\t\t\twhiteWin++;\n\t\t\t\tcurrWhiteWin++;\n\t\t\t}else if(board.blackWin()){\n\t\t\t\tSystem.out.println(\"Black Wins\");\n\t\t\t\tblackWin++;\n\t\t\t\tcurrBlackWin++;\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Stalemate\");\n\t\t\t\tstalemates++;\n\t\t\t\tcurrStalemate++;\n\t\t\t}\n\t\t\t\n//\t\t\tboard.reset();\n//\t\t\tgame++;\n\t\t\tbreak;\n\t\t}\n\n\t\tlong elapsed = System.currentTimeMillis() - start;\n\t\tSystem.out.println(\"Time Elapsed: \" + elapsed);\n\n\t\tFileWriter writer = new FileWriter(fileToBeModified);\n\t\twriter.write(Integer.toString(whiteWin));\n\t\twriter.write(System.getProperty( \"line.separator\" ));\n\t\twriter.write(Integer.toString(blackWin));\n\t\twriter.write(System.getProperty( \"line.separator\" ));\n\t\twriter.write(Integer.toString(stalemates));\n\t\tSystem.out.println(\"White Wins:\" + currWhiteWin);\n\t\tSystem.out.println(\"Black Wins:\" + currBlackWin);\n\t\tSystem.out.println(\"Stalemates:\" + currStalemate);\n\t\treader.close();\n\t\twriter.close();\n\t}", "private void checkMyScore() {\n\n int[] scores = ar.checkMyScore();\n System.out.println(\" My score: \");\n int level = 1;\n for (int i : scores) {\n System.out.println(\" level \" + level + \" \" + i);\n if (i > 0)\n solved[level - 1] = 1;\n level++;\n }\n }", "public void testScoreboardForBeingJudgedState () throws Exception {\n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20 (a No before first yes)\n \"2,1,A,3,Yes\", // 3 (first yes counts Minute points but never Run Penalty points)\n \"3,1,A,5,No\", // zero -- after Yes\n \"4,1,A,7,Yes\", // zero -- after Yes\n \"5,1,A,9,No\", // zero -- after Yes\n \"6,1,B,11,No\", // zero -- not solved\n \"7,1,B,13,No\", // zero -- not solved\n \"8,2,A,30,Yes\", // 30 (minute points; no Run points on first Yes)\n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n// startExplorer(getOutputDataDirectory());\n \n InternalContest contest = new InternalContest();\n \n int numTeams = 2;\n\n initData(contest, numTeams, 5);\n \n for (String runInfoLine : runsData) {\n SampleContest.addRunFromInfo(contest, runInfoLine);\n }\n\n Run [] runs = contest.getRuns();\n \n for (Run run : runs){\n run.setStatus(RunStates.BEING_JUDGED);\n }\n\n checkOutputXML(contest);\n\n confirmRanks(contest, rankData);\n }", "public void countAllPoints() {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.points = PointCounter.countPoint(player.clientCards);\n\t\t\tview.writeLog(player.name+\" : \"+player.points);\n\t\t}\n\t}", "public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }", "public void score(){\r\n\t\tint playerLocation = player.getLocationX();\r\n\t\tint obstacleX = obstacle.getLocationX();\r\n\t\tint obstacleY = obstacle.getLocationY();\r\n\r\n\r\n\t\tstr =\"\" + countCoins;\r\n\r\n\t\t//if you hit a coin, the number of points goes up by one.\r\n\t\tif(obstacleY == 280 && obstacleX==300 && playerLocation == 250){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\t\tif(obstacleY== 450 && obstacleX==300 && playerLocation ==450){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\r\n\t\t//if you hit the green monster, you lose one point.\r\n\t\tif((obstacleX-50) == 250 && (obstacleY-240) == 250 && playerLocation ==250){\r\n\t\t\tcountCoins--;\r\n\t\t}\r\n\r\n\t\t//if you hit the blue monster, you lose 3 points.\r\n\t\tif((obstacleX+180) == 480 && (obstacleY+180) == 250 && playerLocation ==450){\r\n\t\t\tcountCoins-=3;\r\n\t\t}\r\n\t}", "private int updataChessBoardScoreBinary(Point x, final int[][] chessData,\r\n\t\t\tint color) {\n\t\tint res = 0;\r\n\t\tint combo = 0;\r\n\t\t// System.out.println(\"\"+x.x+\",\"+x.y);\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tLineState pre = getLineStateBinary(x, chessData, i, color, 2, true);\r\n\t\t\tLineState las = getLineStateBinary(x, chessData, i + 4, color, 2,\r\n\t\t\t\t\tfalse);\r\n\r\n\t\t\tint ax = (pre.line << (las.length)) | las.line;\r\n\t\t\tint buf[] = tanslateStateToScoreBinary(new LineState(ax, las.length\r\n\t\t\t\t\t+ pre.length));\r\n\t\t\tres += calculateScore2(buf);\r\n\t\t\tcombo += buf[0] < 0 ? buf[0] : 0;\r\n\r\n\t\t}\r\n\t\tcombo *= -1;\r\n\t\tres += combo > 600 ? combo : 0;\r\n\t\t// System.out.println(\"res:\"+res);\r\n\t\treturn res;\r\n\r\n\t}", "@Test\n public void scoreExample5() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(1, 3, 3, 3);\n exampleBoard.move(2, 1, 2, 3);\n exampleBoard.move(2, 4, 2, 2);\n exampleBoard.move(2, 6, 2, 4);\n exampleBoard.move(4, 6, 2, 6);\n exampleBoard.move(3, 4, 3, 6);\n exampleBoard.move(4, 4, 4, 6);\n exampleBoard.move(3, 2, 3, 4);\n exampleBoard.move(2, 4, 4, 4);\n exampleBoard.move(4, 3, 4, 5);\n exampleBoard.move(4, 6, 4, 4);\n exampleBoard.move(4, 1, 4, 3);\n exampleBoard.move(5, 3, 3, 3);\n exampleBoard.move(3, 0, 3, 2);\n exampleBoard.move(2, 2, 4, 2);\n exampleBoard.move(0, 2, 2, 2);\n exampleBoard.move(0, 4, 2, 4);\n exampleBoard.move(5, 2, 3, 2);\n exampleBoard.move(5, 4, 3, 4);\n exampleBoard.move(3, 2, 1, 2);\n exampleBoard.move(3, 4, 1, 4);\n exampleBoard.move(2, 6, 4, 6);\n\n assertEquals(true, exampleBoard.isGameOver());\n assertEquals(10, exampleBoard.getScore());\n }", "void checkerboard(int checkerSquareArea);", "private void increaseScore() {\n this.game.getPlayers().values().forEach(ship -> {\n ship.increaseScore();\n if (ship.getScore() % 5 == 0) {\n this.asteroidsLimit++;\n }\n });\n }", "private List<Player> calculatePoints()\n\t{\n\t\tthis.systemDataInput.printMessage(\"Calculating points...\");\n\t\t\n\t\tArrayList<Player> winningPlayers = new ArrayList<Player>();\n\t\tint maxPoints = 0;\n\t\tint maxBuilding = 0;\n\t\t\n\t\tfor(Player player : playerList)\n\t\t{\n\t\t\tint points = 0;\n\t\t\tint bestBuilding = 0;\n\t\t\t\n\t\t\tfor(Area area : board.getAreaList())\n\t\t\t{\n\t\t\t\tif (!area.hasDemon())\n\t\t\t\t{\n\t\t\t\t\tif (area.hasBuilding(player))\n\t\t\t\t\t{\n\t\t\t\t\t\tpoints += area.getCost();\n\t\t\t\t\t\tif (area.getCost() > bestBuilding)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbestBuilding = area.getCost();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpoints += 5 * area.getMinionList(player).size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint playerMoney = player.getMoneyAmount();\n\t\t\tpoints += playerMoney;\n\t\t\t\n\t\t\tfor(Card card : player.getInFrontOfHimDeck())\n\t\t\t{\n\t\t\t\tfor(Action action : card.getActions(BorrowMoneyFromTheBank.class))\n\t\t\t\t{\n\t\t\t\t\tint moneyToPayBack = ((BorrowMoneyFromTheBank)action).getMoneyToPayBack();\n\t\t\t\t\tif (playerMoney >= moneyToPayBack)\n\t\t\t\t\t{\n\t\t\t\t\t\tpoints -= moneyToPayBack;\n\t\t\t\t\t\tplayerMoney -= moneyToPayBack;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tpoints -= ((BorrowMoneyFromTheBank)action).getPointsToLose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tplayer.addPoints(points);\n\t\t\tplayer.getDataInput().printMessage(points + \" points\");\n\t\t\t\n\t\t\tif (points > maxPoints || (points == maxPoints && bestBuilding > maxBuilding))\n\t\t\t{\n\t\t\t\tmaxPoints = points;\n\t\t\t\tmaxBuilding = bestBuilding;\n\t\t\t\twinningPlayers.clear();\n\t\t\t\twinningPlayers.add(player);\n\t\t\t}\n\t\t\telse if (points == maxPoints && bestBuilding == maxBuilding)\n\t\t\t{\n\t\t\t\twinningPlayers.add(player);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn winningPlayers;\n\t}", "public void start() {\n clear();\n // Assigning chess pieces to players.\n whitePieces.add(new Piece(Owner.WHITE, Who.KING, Rank.R1, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.QUEEN, Rank.R1, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.ROOK, Rank.R1, File.H));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.BISHOP, Rank.R1, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.KNIGHT, Rank.R1, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.A));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.B));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.C));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.D));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.E));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.F));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.G));\n whitePieces.add(new Piece(Owner.WHITE, Who.PAWN, Rank.R2, File.H));\n\n for (Piece p : whitePieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n blackPieces.add(new Piece(Owner.BLACK, Who.KING, Rank.R8, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.QUEEN, Rank.R8, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.ROOK, Rank.R8, File.H));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.BISHOP, Rank.R8, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.KNIGHT, Rank.R8, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.A));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.B));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.C));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.D));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.E));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.F));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.G));\n blackPieces.add(new Piece(Owner.BLACK, Who.PAWN, Rank.R7, File.H));\n\n for (Piece p : blackPieces) {\n board[p.row.ordinal()][p.col.ordinal()] = p;\n }\n\n whoseTurn = Owner.WHITE;\n canCastle = 15;\n passer = null;\n movesDone = lastEatMove = 0;\n }", "public void Move(){\n for(int i = 0; i < moveList.length; i++){\n playerString = \"\";\n switch(moveList[i]) {\n case 1: {\n //TODO: Visited points to others\n System.out.println(\"Moving up!\");\n //Logic for fitness score might need to be moved\n if(!(game.mazeArray[game.playerPosition.getPlayerY() -1][game.playerPosition.getPlayerX()] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() - 1 + game.playerPosition.getPlayerX()\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 10;\n }\n game.moveUp();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 2: {\n System.out.println(\"Moving left!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY()][game.playerPosition.getPlayerX() -1] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + game.playerPosition.getPlayerX() -1\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveLeft();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 3: {\n System.out.println(\"Moving right!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY()][game.playerPosition.getPlayerX() +1] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + game.playerPosition.getPlayerX() +1\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveRight();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 4: {\n System.out.println(\"Moving down!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY() +1][game.playerPosition.getPlayerX()] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + 1 + game.playerPosition.getPlayerX()\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n freedomPoints += 1;\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveDown();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n default: {\n System.out.println(\"End of line\");\n break;\n //You shouldn't be here mate.\n }\n }\n }\n\n }", "public static void main(String[] args) {\n String[] players = {\"Player1\",\"Player2\",\"Player3\",\"Player4\"};\n int numPlayers = players.length;\n \n System.out.println(\"Generating Deck and shuffling...\");\n Deck curDeck = new Deck();\n curDeck.generateDeck();\n //curDeck.showDeck();\n curDeck.shuffleDeck();\n \n System.out.println();\n \n Rules ruleBook = new Rules();\n \n ArrayList<Player> playersArray = new ArrayList<Player>();\n System.out.println(\"Creating Players...\");\n for(int i=0;i<numPlayers;i++) {\n playersArray.add(new Player(players[i]));\n playersArray.get(i).dealPlayersCard(curDeck);\n playersArray.get(i).createPlayerMetaData();\n }\n \n \n ArrayList<Player> winnerList = new ArrayList<Player>();\n \n checkForTrailWinners(winnerList,playersArray,ruleBook);\n \n if(winnerList.size()==1) {\n System.out.println(winnerList.get(0).getPlayerName() + \" wins!\");\n return;\n }\n \n checkForSequenceWinner(winnerList,playersArray,ruleBook);\n \n if(winnerList.size()==1) {\n System.out.println(winnerList.get(0).getPlayerName() + \" wins!\");\n return;\n }\n \n checkForPairWinner(winnerList,playersArray,ruleBook);\n \n if(winnerList.size()==1) {\n System.out.println(winnerList.get(0).getPlayerName() + \" wins!\");\n return;\n }\n if(winnerList.size()==0)\n winnerList=playersArray;\n \n ArrayList<Integer> scoreOfPlayers = new ArrayList<Integer>();\n for(int i=0;i<winnerList.size();i++) {\n scoreOfPlayers.add(winnerList.get(i).getPlayerCard(0));\n }\n \n checkForWinner(winnerList,scoreOfPlayers);\n if(winnerList.size()==1)\n return;\n \n // Each player in consideration picks up a card from the deck till winner is declared or deck has no cards\n \n drawCardsAndDeclareWinner(winnerList,curDeck);\n \n \n \n }", "public void testAltScoring() throws Exception {\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (Minute points for 1st Yes count)\n \"3,1,A,5,No\", // 20 (a No on a solved problem)\n \"4,1,A,7,Yes\", // zero (only \"No's\" count)\n \"5,1,A,9,No\", // 20 (another No on the solved problem)\n \n \"6,1,B,11,No\", // zero (problem has not been solved)\n \"7,1,B,13,No\", // zero (problem has not been solved)\n \n \"8,2,A,30,Yes\", // 30 (Minute points for 1st Yes)\n \n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n\n // Rank TeamId Solved Penalty\n \n // alt1: 0 0 200\n \n String[] alt1rankData = {\n \"1,team1,1,200\",\n \"2,team2,1,200\", // tie-breaker causes rank 2\n };\n \n scoreboardTest (2, runsData, alt1rankData, alt1);\n // alt2: 30 5 0\n String[] alt2rankData = {\n \"1,team1,1,45\", // 1 no@30 each + 3 min * 5\n \"2,team2,1,150\", // 5*30\n };\n \n scoreboardTest (2, runsData, alt2rankData, alt2);\n \n // alt3: 0 10 0\n String[] alt3rankData = {\n \"1,team1,1,30\", // 3 min * 10\n \"2,team2,1,300\", // 30 min * 10\n };\n \n scoreboardTest (2, runsData, alt3rankData, alt3);\n \n // alt4: 5 0 20\n String[] alt4rankData = {\n \"1,team2,1,20\", // base yes\n \"2,team1,1,25\", // base yes + 1 no\n };\n \n scoreboardTest (2, runsData, alt4rankData, alt4);\n\n }", "void addPointsToScore(int points) {\n score += points;\n }", "private void checkScore() {\n // Score is made\n if ((this.ball.getX() < 0) || (this.ball.getX() > getWidth())) {\n // Play R.raw.bleep\n soundPool.play(soundIds[1], 1, 1, 1, 0, 1);\n\n this.touchEnabled = false;\n this.pongThread = new GameThread(this, getHolder(), true);\n\n // Right scores\n if (this.ball.getX() < 0) {\n this.scoreR.update();\n // Left scores\n } else if (this.ball.getX() > getWidth()) {\n this.scoreL.update();\n }\n\n // Reset positions of sprites\n this.paddleL.setX(PADDLE_WALL_DIST);\n this.paddleL.setY(getHeight()/2 - PADDLE_HEIGHT);\n this.paddleR.setX(getWidth() - PADDLE_WALL_DIST - PADDLE_WIDTH);\n this.paddleR.setY(getHeight()/2 - PADDLE_HEIGHT);\n this.ball.setX(getWidth()/2 - 16 - BALL_DIAMETER/2);\n this.ball.setY(getHeight()/2 - BALL_DIAMETER /2);\n this.ball.setEnabled(false);\n this.fakeBall.setX(getWidth()/2 - 16 - BALL_DIAMETER/2);\n this.fakeBall.setY(getHeight()/2 - BALL_DIAMETER /2);\n this.fakeBall.setEnabled(false);\n\n checkWin();\n }\n }", "public void checkWinner(){\n \n if ((board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')||(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')||(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')||(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')||(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')||(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')||(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')||(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')||(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')||(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')||(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n winner();\n }\n \n }", "public void updateWithPointWonBy(Player player) {\n if(managerTennisMatch.statusTennisMatch == \"ClassicalGame\") {\n if (player == player1) {\n managerTennisMatch.checkScoreAndUpdateGame(player, player2);\n } else {\n managerTennisMatch.checkScoreAndUpdateGame(player, player1);\n }\n } else if(managerTennisMatch.statusTennisMatch == \"TieBreakInProgress\") {\n player.setScore(player.getScore() + 1);\n if((player1.getScore() >= 7 && player1.getScore() - player2.getScore() >= 2) || (player2.getScore() >= 7 && player2.getScore() - player1.getScore() >= 2)) {\n tennisSetList.get(tennisSetList.size() - 1).getBaseGameList().add(new TieBreakGame(player));\n player1.setScore(0);\n player2.setScore(0);\n }\n } else {\n return;\n }\n }", "public static void initial()\n\t{\n\t\tscoreteam1 = 0; scoreteam2 = 0;\n\t\tdelayed = 0;\n\t\tplayers = new Player[5];\n\t\tfor (int i = 0; i < 5; i++) \n\t\t{\n\t\t\tplayers[i] = new Player();\n\t\t}\n\n\t\t// finding how many players there are (2, 3, or 4) and initializing status\n\t\tplayerNum = 0;\n\t\tfor (int i = 0; i < 5; i++)\n\t\t{\n\t\t\tif (Selection.exist[i])\n\t\t\t{\n\t\t\t\tplayerNum++;\n\t\t\t}\n\t\t\tplayers[i].exist = Selection.exist[i]; \n\t\t\tplayers[i].ai = Selection.ai[i];\n\t\t\tplayers[i].name = Selection.name[i];\t\t \n\t\t}\n\n\n\t\tplayers[3].keyDown = KeyEvent.VK_SEMICOLON;\n\t\tplayers[3].keyLeft = KeyEvent.VK_L;\n\t\tplayers[3].keyRight = KeyEvent.VK_QUOTE;\n\t\tplayers[3].keyUp = KeyEvent.VK_P;\n\t\tplayers[2].keyDown = KeyEvent.VK_H;\n\t\tplayers[2].keyLeft = KeyEvent.VK_G;\n\t\tplayers[2].keyRight = KeyEvent.VK_J;\n\t\tplayers[2].keyUp = KeyEvent.VK_Y;\n\t\tplayers[1].keyDown = KeyEvent.VK_S;\n\t\tplayers[1].keyLeft = KeyEvent.VK_A;\n\t\tplayers[1].keyRight = KeyEvent.VK_D;\n\t\tplayers[1].keyUp = KeyEvent.VK_W;\n\t\tplayers[4].keyDown = KeyEvent.VK_DOWN;\n\t\tplayers[4].keyLeft = KeyEvent.VK_LEFT;\n\t\tplayers[4].keyRight = KeyEvent.VK_RIGHT;\n\t\tplayers[4].keyUp = KeyEvent.VK_UP;\n\t\tplayers[1].color = Color.red;\n\t\tplayers[3].color = Color.green;\n\n\t\tif (Selection.team)\n\t\t{\n\t\t\tplayers[2].color = Color.red;\n\t\t\tplayers[4].color = Color.green;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tplayers[2].color = Color.blue;\n\t\t\tplayers[4].color = Color.yellow;\n\t\t}\n\n\t}", "public synchronized void updateScore(PlayerHandler playerHandler) {\n\n int points = teams.length * Server.TEAM_SCORE / numMaxPlayers;\n playerHandler.increaseCorrectAnswers();\n\n if(points < 3){\n points = 3;\n }\n\n if (playerHandler.getTeam() == teams[0]) {\n score -= points;\n System.out.println(score);\n return;\n }\n score += points;\n }", "public void score() {\n\t\tif (Integer.parseInt(px.getPosition()) != Integer.parseInt(getCurrentPositionX()))\n\t\t{\n\t\t\tpx.addObserver(Obsx);\n\t\t\tpx.setPosition(getCurrentPositionX());\n\t\t}\n\t\tif (Integer.parseInt(py.getPosition()) != Integer.parseInt(getCurrentPositionY()))\n\t\t{\n\t\t\tpy.addObserver(Obsy);\n\t\t\tpy.setPosition(getCurrentPositionY());\n\t\t}\n\t}", "public abstract Scoreboard update(Player player);", "public static void main ( String [] args ) {\n\t\t// Initialize board to play on, passing initial card count and winning threshold\n\t\tBoard Board = new Board ( 7, 25 );\n\t\tBoard.go ();\n\t\t// Loop through until we choose not to play again\n\t\twhile ( true ) {\n\t\t\t// Loop through until a winner is crowned\n\t\t\twhile ( !Board.checkWinner () ) {\n\t\t\t\t// Loop through until the round has ended\n\t\t\t\twhile ( !Board.checkRoundEnd () ) {\n\t\t\t\t\t// Render the board after clearing screen\n\t\t\t\t\tBoard.render ();\n\t\t\t\t\t// If it is the player's turn\n\t\t\t\t\tif ( Board.turn ) {\n\t\t\t\t\t\t// Prompt user for a turn\n\t\t\t\t\t\tBoard.Player.turn ();\n\t\t\t\t\t}\n\t\t\t\t\t// Otherwise it is the computer's turn\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Prompt computer for a turn\n\t\t\t\t\t\tBoard.Computer.turn ();\n\t\t\t\t\t}\n\t\t\t\t\t// Change who's turn it is\n\t\t\t\t\tBoard.turn = !Board.turn;\n\t\t\t\t}\n\t\t\t\t// If the game continues, then deal cards\n\t\t\t\tif ( !Board.checkWinner () ) {\n\t\t\t\t\t// Reset board and copy score and dealer data into board\n\t\t\t\t\tBoard = Board.reset ( true );\n\t\t\t\t\tBoard.go ();\n\t\t\t\t}\n\t\t\t\t// Ask user if they want to play again\n\t\t\t\telse {\n\t\t\t\t\t// Clear the screen\n\t\t\t\t\tSystem.out.print (\"\\033[2J\\033[1;1H\");\n\t\t\t\t\t// Render scores\n\t\t\t\t\tSystem.out.println (\n\t\t\t\t\t\tCardPile.REDTEXT + \"Your Score: \" + CardPile.RESET + Board.Player.score +\n\t\t\t\t\t\tCardPile.REDTEXT + \"\\tAI's Score: \" + CardPile.RESET + Board.Computer.score\n\t\t\t\t\t);\n\t\t\t\t\t// Did the player win?\n\t\t\t\t\tif ( Board.Player.Hand.size == 0 && Board.Player.score < Board.Computer.score ) {\n\t\t\t\t\t\tSystem.out.println (\"You won! Would you like to play again?\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t// Then the computer won\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println (\"You lost! Would you like to play again?\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check to see if the user wants to play again\n\t\t\tScanner reader = new Scanner ( System.in );\n\t\t\tString command;\n\t\t\tSystem.out.print (\"> \");\n\t\t\tcommand = reader.nextLine ();\n\t\t\t// See if user wants to play again\n\t\t\tif ( command.equals (\"Y\") || command.equals (\"y\") ) {\n\t\t\t\t// State who won the game, and ask user if they want to play again\n\t\t\t\tBoard = Board.reset ( false );\n\t\t\t\tBoard.go ();\n\t\t\t}\n\t\t\t// Otherwise break\n\t\t\telse {\n\t\t\t\tSystem.out.println (\"\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void gameOver() {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Game is over. Calculating points\");\r\n\t\tstatus = \"over\";\r\n\t\ttry {\r\n\t\t\tupdateBoard();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tupdateEvents(false);\r\n\t\tEmbedBuilder embed = new EmbedBuilder();\r\n\t\tembed.setTitle(\"Game Results\");\r\n\t\tMap<Integer, Integer> scores = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tfor (int i = 0; i < players.size(); i++) {\r\n\t\t\tscores.put(i,players.get(i).calculatePoints());\r\n\t\t\t// Utils.getName(players.get(i).getPlayerID(),guild)\r\n\t\t}\r\n\t\t\r\n\t\tList<Entry<Integer, Integer>> sortedList = sortScores(scores);\r\n\t\t\r\n\t\t// If tied, add highest artifact values\r\n\t\tif ((playerCount > 1) && (sortedList.get(0).getValue().equals(sortedList.get(1).getValue()))) {\r\n\t\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Scores were tied\");\r\n\t\t\tint highestScore = sortedList.get(0).getValue();\r\n\t\t\tfor (Map.Entry<Integer, Integer> entry : sortedList) {\r\n\t\t\t\t// Only add artifacts to highest scores\r\n\t\t\t\tif (entry.getValue().equals(highestScore)) {\r\n\t\t\t\t\tscores.put(entry.getKey(),entry.getValue()+players.get(entry.getKey()).getHighestArtifactValue());\r\n\t\t\t\t\tplayers.get(entry.getKey()).setAddedArtifactValue(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Sort with added artifact values\r\n\t\tsortedList = sortScores(scores);\r\n\t\t\r\n\t\t// Assigns 1st, 2nd, 3rd\r\n\t\tfor (int i = 0; i < sortedList.size(); i++) {\r\n\t\t\tMap.Entry<Integer, Integer> entry = sortedList.get(i);\r\n\t\t\t// If tie, include artifact\r\n\t\t\tString name = Utils.getName(players.get(entry.getKey()).getPlayerID(),guild);\r\n\t\t\tif (players.get(entry.getKey()).getAddedArtifactValue()) {\r\n\t\t\t\tint artifactValue = players.get(entry.getKey()).getHighestArtifactValue();\r\n\t\t\t\tembed.addField(Utils.endGamePlaces[i],\"**\"+name+\"** - ``\"+(entry.getValue()-artifactValue)+\" (\"+artifactValue+\")``\",true);\r\n\t\t\t} else {\r\n\t\t\t\tembed.addField(Utils.endGamePlaces[i],\"**\"+name+\"** - ``\"+entry.getValue()+\"``\",true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tembed.setFooter(\"Credit to Renegade Game Studios\", null);\r\n\t\tgameChannel.sendMessage(embed.build()).queueAfter(dragonAttackingDelay+3000,TimeUnit.MILLISECONDS);\r\n\t\t\r\n\t\tGlobalVars.remove(this);\r\n\t}", "@Test\n public void scoreExample4() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl(7);\n exampleBoard.move(2, 0, 0, 0);\n assertEquals(26, exampleBoard.getScore());\n }", "public void turn(){ \r\n\t\tif (currentTurn == 0){ \r\n\t\t\tSystem.out.println(\"Computer's Turn\");\r\n\t\t\tnextRowWin();\r\n\t\t\tnextColWin(); \r\n\t\t\tnextDiagWin();\r\n\t\t\t//check if next move is row win\r\n\t\t\tif (!Arrays.equals(rowWin, checkWin)){\r\n\t\t\t\tcounter(rowWin); \r\n\t\t\t}\r\n\t\t\t//check if next move is column win \r\n\t\t\telse if (!Arrays.equals (colWin, checkWin)) {\r\n\t\t\t\tcounter(colWin); \r\n\t\t\t}\r\n\t\t\t//check if next move is diagonal win\r\n\t\t\telse if (!Arrays.equals(diagWin, checkWin)){\r\n\t\t\t\tcounter(diagWin);\r\n\t\t\t}\r\n\t\t\t//computer moves based on priority positions\r\n\t\t\telse\r\n\t\t\t\tcompMove(); \r\n\t\t\tchangeTurn(); \r\n\t\t}\r\n\t\telse { \r\n\t\t\tSystem.out.println(\"Player's Turn\");\r\n\t\t\tint nextCol, nextRow; \r\n\t\t\tScanner in = new Scanner (System.in); \r\n\t\t\tSystem.out.print (\"Please enter row and column to place your piece [Enter as col row]: \");\r\n\t\t\tif (in.hasNext()) { \r\n\t\t\t\tnextCol = in.nextInt(); \r\n\t\t\t\tnextRow = in.nextInt(); \r\n\t\t\t\tif (nextCol == 3 || nextRow == 3)\r\n\t\t\t\t\tSystem.out.println(\"Input of of range. col and row must be between 0-2.\");\r\n\t\t\t\telse if (board[nextCol][nextRow] == '-') {\r\n\t\t\t\t\tboard[nextCol][nextRow] = 'X'; \r\n\t\t\t\t\tchangeTurn(); \r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tSystem.out.println(\"Invalid Input. There is already a piece in that location.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse { \r\n\t\t\t\tSystem.out.println(\"Invalid Input. Please input integers for col row.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic BoardEvaluation evaluate(IBoard board, PlayerColor color) {\n\t\tBoardAnalyzer analyzer = board.getAnalyzer();\r\n\r\n\t\tBoardEvaluation e = new BoardEvaluation();\r\n\r\n\t\tint white = 0;\r\n\t\tint black = 0;\r\n\r\n\t\tList<IPiece> pieces = board.getAllPieces();\r\n\r\n\t\tint[] pawnCount = new int[2];\r\n\t\tint[] bishopCount = new int[2];\r\n\t\tint[] knightCount = new int[2];\r\n\t\tfor (IPiece piece : pieces) {\r\n\t\t\tif (piece.getColor() == PlayerColor.WHITE) {\r\n\t\t\t\twhite += piece.getPieceValue();\r\n\t\t\t} else {\r\n\t\t\t\tblack += piece.getPieceValue();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint index = piece.getColor().ordinal();\r\n\t\t\tif (piece instanceof Pawn) {\r\n\t\t\t\tpawnCount[index]++;\r\n\t\t\t} else if (piece instanceof Bishop) {\r\n\t\t\t\tbishopCount[index]++;\r\n\t\t\t} else if (piece instanceof Knight) {\r\n\t\t\t\tknightCount[index]++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint totalPieceValue = white + black;\r\n\t\tint blackIndex = PlayerColor.BLACK.ordinal();\r\n\t\tint whiteIndex = PlayerColor.WHITE.ordinal();\r\n\t\tblack += extraBishopValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\tblack += extraKnightValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\tblack += extraPawnValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\twhite += extraBishopValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\t\twhite += extraKnightValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\t\twhite += extraPawnValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\r\n\t\t// Stalemate\r\n\t\tif (analyzer.isStalemate()) {\r\n\t\t\te.draw = true;\r\n\t\t\tblack += 90;\r\n\t\t} else if (analyzer.canClaimDraw()) {\r\n\t\t\tif (board.getTurn() == PlayerColor.WHITE) {\r\n\t\t\t\t// White can stop black from claiming draw\r\n\t\t\t\t//black += 50;\r\n\t\t\t} else {\r\n\t\t\t\t// Black can claim draw immediately!\r\n\t\t\t\te.draw = true;\r\n\t\t\t\tblack += 4;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Checkmate ?\r\n\t\tif (analyzer.isCheckmate(PlayerColor.BLACK)) {\r\n\t\t\twhite += 100;\r\n\t\t\te.checkmate = true;\r\n\t\t}\r\n\r\n\t\tif (analyzer.isCheckmate(PlayerColor.WHITE)) {\r\n\t\t\tblack += 100;\r\n\t\t\te.checkmate = true;\r\n\t\t}\r\n\r\n\t\tif (color == null) {\r\n\t\t\te.value = white - black;\r\n\t\t} else if (color == PlayerColor.BLACK) {\r\n\t\t\te.value = Math.abs(white - FULL_BOARD_VALUE);\r\n\t\t} else {\r\n\t\t\te.value = Math.abs(black - FULL_BOARD_VALUE);\r\n\t\t}\r\n\r\n\t\treturn e;\r\n\t}", "@Test\n void updateScore() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n\n RealPlayer p = new RealPlayer('b', \"ciccia\");\n p.setTurn(true);\n p.updateScore(3);\n assertTrue(p.getScore()==3);\n\n p = new RealPlayer('b', \"ciccia\");\n p.updateScore(-1);\n assertTrue(p.getScore()==0);\n }", "@Test\n void should_activate_tie_break_when_two_players_reach_set_6() {\n List<Integer> setPointOrderTab = Arrays.asList(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2); // 6-6\n\n //WHEN\n game.computePoint(setPointOrderTab, true);\n\n //THEN\n assertEquals(GameStatus.IN_PROGRESS, game.getGameStatus());\n assertTrue(game.isTiebreakIsActivated());\n }", "public void playRound(){\n int roundScoreOne = 0;\n int roundScoreTwo = 0 ;\n this.handOne.drawNewHandFrom(gameDeck);\n this.handTwo.drawNewHandFrom(gameDeck);\n roundScoreOne = this.scoreHand(handOne, handTwo);\n roundScoreTwo = this.scoreHand(handTwo, handOne);\n\n System.out.println(\"Your hand: \");\n System.out.println(handOne.toString());\n System.out.println(\"Score: \" + roundScoreOne + \"\\n\");\n\n System.out.println(\"Opponent's hand: \");\n System.out.println(handTwo.toString());\n System.out.println(\"Score: \" + roundScoreTwo + \"\\n\");\n\n if (roundScoreOne > roundScoreTwo) {\n int updateAmount = roundScoreOne - roundScoreTwo;\n this.playerScore += updateAmount;\n System.out.println(\"You score \" + updateAmount + \" points !\");\n System.out.println(\"You: \" + playerScore);\n System.out.println(\"Opponent: \" + oppoScore);\n } else if (roundScoreTwo > roundScoreOne) {\n int updateAmount = roundScoreTwo - roundScoreOne;\n this.oppoScore += updateAmount;\n System.out.println(\"Opponent scores \" + updateAmount + \" points !\");\n System.out.println(\"You: \" + playerScore);\n System.out.println(\"Opponent: \" + oppoScore);\n }\n }", "static private void calculateMissionScore() {\n\n HashMap<String, Boolean> missionStatus = allMissions.missionStatus;\n\n for (String i : missionStatus.keySet()) {\n\n if (missionStatus.get(i) == true) {\n score.addToPoints(250);\n }\n }\n }", "private boolean checkPoints() {\n\n for (Map.Entry pair : playersAgentsMap.entrySet()) {\n ArrayList<IAgent> iAgentList = (ArrayList<IAgent>) pair.getValue();\n\n int points = 0;\n try {\n points = iPlayerList.get(iAgentList.get(0).getName()).getPoints();\n } catch (RemoteException ex) {\n Logger.getLogger(ServerFrame.class.getName()).log(Level.SEVERE, null, ex);\n }\n try {\n for (Component comp : playerList.getComponents()) {\n if (comp instanceof PlayerPanel) {\n PlayerPanel panel = (PlayerPanel) comp;\n if (panel.getName().equals(iAgentList.get(0).getName())) {\n panel.setPlayerPoints(points);\n }\n }\n\n }\n } catch (RemoteException e1) {\n e1.printStackTrace();\n }\n if (points >= targetAmount) {\n try {\n System.out.println(iAgentList.get(0).getName() + \" has won with \" + points + \" points\");\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n return false;\n }\n }\n\n return true;\n }", "void calculateScore(){\r\n playerScore = 0;\r\n for(int i = 1; i<=10; i++) {\r\n scoreQuestion(i);\r\n }\r\n }", "static int SetScore(int p){\n\t\tif (p==1) {\n\t\t\tp1Score=p1Score+4;\n\t\t\tlblp1Score.setText(Integer.toString(p1Score));\n\t\t\t\n\t\t\t//check whether the score reaches to destination score or not..........\n\t\t\t\n\t\t\tif(p1Score>=destinationScore){\n\t\t\t\tfrmCardGame.dispose();\n\t\t\t\tnew EndGame(p,p1Score,destinationScore).setVisible(true);\n\t\t\t}\n\t\t}\n\t\telse if(p==2){\n\t\t\tp2Score=p2Score+4;\n\t\t\tlblp2Score.setText(Integer.toString(p2Score));\n\t\t\t\n\t\t\tif(p2Score>=destinationScore){\n\t\t\t\tfrmCardGame.dispose();\n\t\t\t\tnew EndGame(p,p2Score,destinationScore).setVisible(true);\n\t\t\t}\n\t\t}\n\t\telse if(p==3){\n\t\t\tp3Score=p3Score+4;\n\t\t\tlblp3Score.setText(Integer.toString(p3Score));\n\t\t\t\n\t\t\tif(p3Score>=destinationScore){\n\t\t\t\tfrmCardGame.dispose();\n\t\t\t\tnew EndGame(p,p3Score,destinationScore).setVisible(true);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tp4Score=p4Score+4;\n\t\t\tlblp4Score.setText(Integer.toString(p4Score));\n\t\t\t\n\t\t\tif(p4Score>=destinationScore){\n\t\t\t\tfrmCardGame.dispose();\n\t\t\t\tnew EndGame(p,p4Score,destinationScore).setVisible(true);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public void scoringTrick(){\n wizardRule();\n winner.tricksWon++;\n winner = new Player();\n }", "public void changeRob(int x, int y) {\n if (identifier == 1) {\n redY = y;\n redX = x;\n if (redY == goalY & redX == goalX & identifier == goalId) {\n if (bid.PlayerTurn == 1) {\n Scores.P1Scores = Scores.P1Scores + 1;\n }\n if (bid.PlayerTurn == 2) {\n Scores.P2Scores = Scores.P2Scores + 1;\n }\n if (bid.PlayerTurn == 3) {\n Scores.P3Scores = Scores.P3Scores + 1;\n }\n if (bid.PlayerTurn == 4) {\n Scores.P4Scores = Scores.P4Scores + 1;\n }\n bid.TooManyMoves();\n bid.BackToBidLayer();\n loadGoal();\n }\n }\n if (identifier == 2) {\n blueY = y;\n blueX = x;\n if (blueY == goalY & blueX == goalX & identifier == goalId) {\n if (bid.PlayerTurn == 1) {\n Scores.P1Scores = Scores.P1Scores + 1;\n }\n if (bid.PlayerTurn == 2) {\n Scores.P2Scores = Scores.P2Scores + 1;\n }\n if (bid.PlayerTurn == 3) {\n Scores.P3Scores = Scores.P3Scores + 1;\n }\n if (bid.PlayerTurn == 4) {\n Scores.P4Scores = Scores.P4Scores + 1;\n }\n bid.TooManyMoves();\n bid.BackToBidLayer();\n loadGoal();\n }\n }\n if (identifier == 3) {\n greenY = y;\n greenX = x;\n if (greenY == goalY & greenX == goalX & identifier == goalId) {\n if (bid.PlayerTurn == 1) {\n Scores.P1Scores = Scores.P1Scores + 1;\n }\n if (bid.PlayerTurn == 2) {\n Scores.P2Scores = Scores.P2Scores + 1;\n }\n if (bid.PlayerTurn == 3) {\n Scores.P3Scores = Scores.P3Scores + 1;\n }\n if (bid.PlayerTurn == 4) {\n Scores.P4Scores = Scores.P4Scores + 1;\n }\n bid.TooManyMoves();\n bid.BackToBidLayer();\n loadGoal();\n }\n }\n if (identifier == 4) {\n yellowY = y;\n yellowX = x;\n if (yellowY == goalY & yellowX == goalX & identifier == goalId) {\n if (bid.PlayerTurn == 1) {\n Scores.P1Scores = Scores.P1Scores + 1;\n }\n if (bid.PlayerTurn == 2) {\n Scores.P2Scores = Scores.P2Scores + 1;\n }\n if (bid.PlayerTurn == 3) {\n Scores.P3Scores = Scores.P3Scores + 1;\n }\n if (bid.PlayerTurn == 4) {\n Scores.P4Scores = Scores.P4Scores + 1;\n }\n bid.TooManyMoves();\n bid.BackToBidLayer();\n loadGoal();\n }\n }\n }", "public void tick() {\r\n //2d array gameBoard is being copied to 2d array update\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n update[i] = gameBoard[i].clone();\r\n }\r\n\r\n //For the entire board, go through every tile\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n for (int j = 0; j < gameBoard[0].length; j++) {\r\n //Counting neighbours\r\n int count = 0;\r\n\r\n //For the current tile, go through all the neighbouring tiles\r\n for (int y = -1; y <= 1; y++) {\r\n for (int x = -1; x <= 1; x++) {\r\n if (x == 0 && y == 0) {\r\n } else {\r\n try {\r\n if (gameBoard[y + i][x + j] > 0) {\r\n count++;\r\n }\r\n } catch (Exception e) {\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Automation Rules (check)\r\n if (count < 2 || count >= 4) {\r\n update[i][j] = -1;\r\n } else if (count == 3) {\r\n update[i][j] = 1;\r\n }\r\n\r\n }\r\n }\r\n\r\n //Once board, neighbours, and automation are completed\r\n //2d array update is copied back to the original 2d array gameBoard\r\n for (int i = 0; i < gameBoard.length; i++) {\r\n gameBoard[i] = update[i].clone();\r\n }\r\n }", "public static void update_scoreboard2(){\n\t\t//Update score\n\tif(check_if_wicket2){\n\t\t\n\t\twicket_2++;\n\t\tupdate_score2.setText(\"\"+team_score_2+\"/\"+wicket_2);\n\t}\n\telse{\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\ttempshot2=PlayArena2.usershot2;\n\t\tteam_score_2=team_score_2+PlayArena2.usershot2;\n\t\treq=req-tempshot2;\n\t\t}\n\t\telse{\n\t\t\ttempshot2=PlayArena2.compshot2;\n\t\t\tteam_score_2=team_score_2+PlayArena2.compshot2;\n\t\t\treq=req-tempshot2;\n\t\t\t}\n\t\tif(req<0)\n\t\t{\treq=0;}\n\t\t\n\t\tupdate_score2.setText(\"\"+team_score_2+\"/\"+wicket_2);\n\t}\n\t// Overs update\n\tif(over_ball_2==5){\n\t\tover_ball_2=0;\n\t\tover_overs_2++;\n\t\tover_totalballs_2--;\n\t}\n\telse{\n\t\tover_ball_2++;\n\tover_totalballs_2--;}\n\tupdate_overs2.setText(\"\"+over_overs_2+\".\"+over_ball_2+\" (\"+PlayMode.overs+\")\");\n\t\n\t//Check if_first_inning_over\n\tif(over_overs_2==Integer.parseInt(PlayMode.overs) || wicket_2==3 || PlayBrain1.team_score_1<team_score_2)\n\t\t\t{\n\t\tif_second_inning_over=true;\n\t\treference2.add(PlayArena2.viewscore2);\n\t\t\t}\n\t\n\t\n\t//Needed update\n\t\t\tupdate_runrate2.setText(\"<html>NEED<br>\"+req+\"<br>OFF<br>\"+over_totalballs_2+\" <br>BALLS</html>\");\n\t\t}", "public void assignPointsToTeams(){\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getTotalRuns() < two.getTotalRuns()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsRuns(setvalue);\n }\n \n //SORTS FOR TOTALHOMERUNS THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getTotalHomeRuns() < two.getTotalHomeRuns()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsHomeRuns(setvalue);\n }\n \n //SORTS FOR RunsBattedIn THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getTotalRunsBattedIn() < two.getTotalRunsBattedIn()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsRunsBattedIn(setvalue);\n }\n \n //SORTS FOR STOLENBASES THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getTotalStolenBases() < two.getTotalStolenBases()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsStolenBases(setvalue);\n }\n \n //SORTS FOR BATTINGAVERAGE THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getBattingAverage() < two.getBattingAverage()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsBattingAverage(setvalue);\n }\n \n //SORTS FOR Wins THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getWins() < two.getWins()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsWins(setvalue);\n }\n \n //SORTS FOR Strikeouts THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getStrikeouts() < two.getStrikeouts()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsStrikeouts(setvalue);\n }\n \n //SORTS FOR Saves THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getSaves() < two.getSaves()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsSaves(setvalue);\n }\n \n //SORTS FOR ERA THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getEarnedRunAverage() < two.getEarnedRunAverage()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsERA(setvalue);\n }\n \n //SORTS FOR WHIP THEN ASSIGNS EACH THE CORRESPONDING POINT VALUE\n Collections.sort(this.teams, new Comparator<Object>() {\n @Override\n public int compare(final Object object1, final Object object2) {\n Team one = (Team)object1;\n Team two = (Team)object2;\n \n if(one.getWhip() < two.getWhip()){\n return 1;\n }\n else{\n return -1;\n }\n }\n });\n \n for(int i=0;i<teams.size();i++){\n int setvalue = 12-i;\n if(setvalue<0){\n setvalue = 0;\n }\n Team t = teams.get(i);\n t.setPointsWHIP(setvalue);\n } \n }", "public void executeMove(Game game) {\n int bestScore = 0;\n int comScore = 0;\n Board board = game.getBoard();\n int col = (board.getCols());\n int row = (board.getRows());\n \n // Basic for loop to go through and grab each gem and call the score policy on it\n // it stores the best opton in best score\n for(int i = 0; i < row; i++){\n for(int ii = 0; ii < col; ii++){\n if(board.gemAt(i,ii).isEmpty() == true){\n continue;\n }\n comScore = game.getPolicy().scoreMove(i,ii,board);\n if(comScore >= bestScore){\n bestScore = comScore;\n }\n }\n }\n \n // This for loop makes a Coord with the rows and col i and ii to keep track of where the best gem was located \n for(int i = 0; i < row; i++){\n for(int ii = 0; ii < col; ii++){\n if(board.gemAt(i,ii).isEmpty() == true){\n continue;\n }\n if(game.getPolicy().scoreMove(i,ii,board) == bestScore){\n holder.add(new Coord(i,ii));\n }\n }\n }\n \n // For loop to choose the best Gem out of the holders Coords to call \"removeGemAdjustScore()\"\n for(int i = 0; i < holder.size(); i++){\n if(holder.size() == 1){\n game.removeGemAdjustScore(holder.get(i).row,holder.get(i).col);\n break;\n }\n game.removeGemAdjustScore(holder.get(i).row,holder.get(i).col);\n break;\n }\n \n // Resets the holder and best score for the next move\n holder = new ArrayList<Coord>();\n bestScore = 0;\n \n }", "public static void main (String args[]){\n\t\tString input = null;\n\t\tboolean gameDone = false;\n\t\tPlayerOne p1 = new PlayerOne();\n\t\tPlayerTwo p2 = new PlayerTwo();\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t// grabs the state of the game board \n\t\tGameBoard aBoard = new GameBoard();\n\t\tchar[][] board = aBoard.getBoard();\n\t\t\n\n\t\t// game loop\n\t\twhile (gameDone != true){\n\t\t\t\n\t\t\t// asks for input for player 1 row move \n\t\t\tSystem.out.println(\"Player One Move {R}: \");\n\t\t\tint p1r = sc.nextInt();\n\t\t\t// asks for input for player 1 column move \n\t\t\tSystem.out.println(\"Player One Move {C}: \");\n\t\t\tint p1c = sc.nextInt();\n\t\t\t// places move on the board \n\t\t\tboard[p1r][p1c] = p1.playerPiece;\n\t\t\t// checks win condition \n\t\t\tprintBoard(board);\n\t\t\tif (checkWin(board, p1.playerPiece) || checkDraw(board)){\n\t\t\t\tgameDone = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// asks for input for player 2 row move\n\t\t\tSystem.out.println(\"Player Two Move {R}: \");\n\t\t\tint p2r = sc.nextInt();\n\t\t\t// asks for input for player 2 column move\n\t\t\tSystem.out.println(\"Player Two Move {C}: \");\n\t\t\tint p2c = sc.nextInt();\n\t\t\t// places move on the board \n\t\t\tboard[p2r][p2c] = p2.playerPiece;\n\t\t\tprintBoard(board);\n\t\t\t// checks win and draw condition \n\t\t\tif(checkWin(board, p2.playerPiece) || checkDraw(board)){\n\t\t\t\tgameDone = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "private void getWinner() {\r\n int nWhite = 0, nBlack = 0;\r\n if(nextPlayer.getChecks() == 0 && nextPlayer.getQueens() == 0){\r\n winner = currentPlayer;\r\n }\r\n else if(currentPlayer.getQueens() == nextPlayer.getQueens()){\r\n for (int i = 1; i<8; i++){\r\n for (int x = 0; x<8; x++) {\r\n if (checks[i][x] == 1) nBlack++;\r\n if (checks[7 - i][x] == 2) nWhite++;\r\n }\r\n if (nWhite>nBlack) winner = getPlayer(WHITE);\r\n else if(nBlack>nWhite)winner = getPlayer(BLACK);\r\n nWhite = 0;\r\n nBlack = 0;\r\n }\r\n }\r\n else if (currentPlayer.getQueens() > nextPlayer.getQueens()){ winner = currentPlayer;}\r\n else{winner = nextPlayer; }\r\n }", "public void startGameState(){\n\n ArrayList<Integer> checkeredSpaces = new ArrayList<Integer>(Arrays.asList(1, 3, 5, 7, 8, 10, 12, 14, 17, 19, 21,\n 23, 24, 26, 28, 30, 33, 35, 37, 39, 41, 42, 44, 46, 48,\n 51, 53, 55, 56, 58, 60, 62));\n\n\n\n for(int i =0; i < 63; i++){\n if(!checkeredSpaces.contains(i)){\n //set all black spaces to null on the board\n mCheckerBoard.add(null);\n }\n else if(i < 24){\n //set first three rows to red checkers\n mCheckerBoard.add(new Checker((i/2), true));\n }\n else if(i < 40){\n //set middle two rows to null\n mCheckerBoard.add(null);\n }\n else{\n //set top three row to black checkers\n mCheckerBoard.add(new Checker((i/2), false));\n }\n }\n\n }", "public void calculateResult() {\n\t\tfor (GameEngineCallback callback : callbacks) {\n\t\t\t// Roll for house\n\t\t\tthis.rollHouse(INITIAL_DELAY, FINAL_DELAY, DELAY_INCREMENT);\n\t\t\t\n\t\t\tfor (Player player : this.players.values()) {\n\t\t\t\t// Players who are playing must have a bet and a score\n\t\t\t\t// This conditional may not be required in Assignment 2\n\t\t\t\tif (player.getBet() > 0 && player.getRollResult()\n\t\t\t\t\t\t.getTotalScore() > 0) {\n\t\t\t\t\t// Compare rolls, set result and add/subtract points\n\t\t\t\t\tif (this.houseDice.getTotalScore() > player.\n\t\t\t\t\t\t\tgetRollResult().getTotalScore()) {\n\t\t\t\t\t\tGameStatus status = GameEngine.GameStatus.LOST;\t\t\t\t\t\n\t\t\t\t\t\tplayer.setGameResult(status);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Subtract bet from player points\n\t\t\t\t\t\tint points = player.getPoints() - player.getBet();\n\t\t\t\t\t\tthis.setPlayerPoints(player, points);\n\t\t\t\t\t}\n\t\t\t\t\telse if (houseDice.getTotalScore() == player.\n\t\t\t\t\t\t\tgetRollResult().getTotalScore()) {\n\t\t\t\t\t\tGameStatus status = GameEngine.GameStatus.DREW;\t\t\t\t\t\n\t\t\t\t\t\tplayer.setGameResult(status);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// No change to points on a draw\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tGameStatus status = GameEngine.GameStatus.WON;\t\t\t\t\t\n\t\t\t\t\t\tplayer.setGameResult(status);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add bet to player points\n\t\t\t\t\t\tint points = player.getPoints() + player.getBet();\n\t\t\t\t\t\tthis.setPlayerPoints(player, points);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Display result\n\t\t\t\t\tcallback.gameResult(this.getPlayer(player.getPlayerId()), \n\t\t\t\t\t\t\tthis.getPlayer(player.getPlayerId()).getGameResult(), this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void adjustScoreIncrement() {\n\t\tint extraPoints = 0;\n\t\tif (!Snake.warpWallOn) {\n\t\t\textraPoints++;\n\t\t}\n\t\tif (Block.blocksOn) {\n\t\t\textraPoints++;\n\t\t}\n\t\tif (Snake.snakeGrowsQuickly) {\n\t\t\textraPoints++;\n\t\t}\n\t\tif (Snake.snakeGrowsReallyQuickly) {\n\t\t\textraPoints+=3;\n\t\t}\n\t\t// increment equals all the bonuses, starting at a minimum of 1. This decreases if user switches to easier modes. Bigness and Fastness are reduced by 1 each here to keep the amount of increase down; it could be pumped up for a really high-scoring game\n\t\tincrement = extraPoints + SnakeGame.getBigness()-1 + SnakeGame.getFastness()-1 + Snake.snakeSize/10 ;\n\t}", "private void sketchScore() {\r\n View.sketch(score, this.getSize().width + 15, 0);\r\n }", "@Override\n\tpublic void visitingTeamScored(int points) {\n\t\t\n\t}", "public int checkForWinner() {\n\n // Check horizontal wins\n for (int i = 0; i <= 6; i += 3)\t{\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+1] == HUMAN_PLAYER &&\n mBoard[i+2]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+1]== COMPUTER_PLAYER &&\n mBoard[i+2] == COMPUTER_PLAYER)\n return 3;\n }\n\n // Check vertical wins\n for (int i = 0; i <= 2; i++) {\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+3] == HUMAN_PLAYER &&\n mBoard[i+6]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+3] == COMPUTER_PLAYER &&\n mBoard[i+6]== COMPUTER_PLAYER)\n return 3;\n }\n\n // Check for diagonal wins\n if ((mBoard[0] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[8] == HUMAN_PLAYER) ||\n (mBoard[2] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[6] == HUMAN_PLAYER))\n return 2;\n if ((mBoard[0] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[8] == COMPUTER_PLAYER) ||\n (mBoard[2] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[6] == COMPUTER_PLAYER))\n return 3;\n\n // Check for tie\n for (int i = 0; i < BOARD_SIZE; i++) {\n // If we find a number, then no one has won yet\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER)\n return 0;\n }\n\n // If we make it through the previous loop, all places are taken, so it's a tie\n return 1;\n }", "private void doMatchesStats(int week){\r\n \r\n \r\n List<FantasyMatch> fMatches = fmatchBean.findByWeek(week);\r\n for(int i = 0; i < fMatches.size(); i++){\r\n FantasyMatch fm = fMatches.get(i);\r\n FantasyTeam team1 = fm.getTeam1();\r\n FantasyTeam team2 = fm.getTeam2();\r\n int team1Points = 0, team2Points = 0;\r\n \r\n team1Points += retrievePoints(fm.getTeam1QB(), week);\r\n team2Points += retrievePoints(fm.getTeam2QB(), week);\r\n \r\n team1Points += retrievePoints(fm.getTeam1RB1(), week);\r\n team2Points += retrievePoints(fm.getTeam2RB1(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1RB2(), week);\r\n team2Points += retrievePoints(fm.getTeam2RB2(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1WR1(), week);\r\n team2Points += retrievePoints(fm.getTeam2WR1(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1WR2(), week);\r\n team2Points += retrievePoints(fm.getTeam2WR2(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1WRRB(), week);\r\n team2Points += retrievePoints(fm.getTeam2WRRB(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1TE(), week);\r\n team2Points += retrievePoints(fm.getTeam2TE(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1K(), week);\r\n team2Points += retrievePoints(fm.getTeam2K(), week);\r\n\r\n team1Points += retrievePoints(fm.getTeam1DEF(), week);\r\n team2Points += retrievePoints(fm.getTeam2DEF(), week);\r\n \r\n fm.setTeam1Points(team1Points);\r\n fm.setTeam2Points(team2Points);\r\n \r\n if(team1Points > team2Points){\r\n team1.setWins(team1.getWins() + 1);\r\n team2.setLosses(team2.getLosses() + 1);\r\n }\r\n if(team1Points == team2Points){\r\n team1.setDraws(team1.getDraws() + 1);\r\n team2.setDraws(team2.getDraws() + 1);\r\n }\r\n if(team1Points < team2Points){\r\n team1.setLosses(team1.getLosses() + 1);\r\n team2.setWins(team2.getWins() + 1);\r\n }\r\n \r\n team1.setPointsFor(team1.getPointsFor() + team1Points);\r\n team1.setPointsAgainst(team1.getPointsAgainst() + team2Points);\r\n \r\n team2.setPointsFor(team2.getPointsFor() + team2Points);\r\n team2.setPointsAgainst(team2.getPointsAgainst() + team1Points);\r\n \r\n fmatchBean.edit(fm);\r\n ftBean.edit(team1);\r\n ftBean.edit(team2);\r\n }\r\n \r\n List<FantasyLeague> leagues = flBean.findAll();\r\n for(int i = 0; i < leagues.size(); i++){\r\n List<FantasyTeam> teams = ftBean.findByLeague(leagues.get(i));\r\n \r\n //DO SORTING BY WINS\r\n Collections.sort(teams, new TeamWinComparator());\r\n \r\n for(int j = 0; j < teams.size(); j++){\r\n FantasyTeam team = teams.get(j);\r\n team.setPreviousRank(team.getRank());\r\n team.setRank(j + 1); \r\n }\r\n }\r\n \r\n }", "public void updatescore() {\n scorelabel.setText(\"\" + score + \" points\");\n if (100 - score <= 10) win();\n }", "public void awardPoints(int points)\n {\n score += points ;\n }", "public static void score() {\n\t\tSystem.out.println(\"SCORE: \");\n\t\tSystem.out.println(player1 + \": \" + score1);\n\t\tSystem.out.println(player2 + \": \" + score2);\n\t}", "public void game(int set1hometeampoints, int set2hometeampoints,\n int set3hometeampoints, int set4hometeampoints, int set5hometeampoints,\n int set1awayteampoints, int set2awayteampoints, int set3awayteampoints, \n int set4awayteampoints, int set5awayteampoints)\n { \n if (set1hometeampoints == 21){\n setsWonHT ++;\n } else if(set1awayteampoints == 21){\n setsWonAT ++; \n } \n if (set2hometeampoints == 21){\n setsWonHT ++;\n } else if(set2awayteampoints == 21){\n setsWonAT ++; \n } \n if (set3hometeampoints == 21){\n setsWonHT ++;\n } else if(set3awayteampoints == 21){\n setsWonAT ++; \n }\n if (set4hometeampoints == 21){\n setsWonHT ++;\n } else if(set4awayteampoints == 21){\n setsWonAT ++; \n } \n if (set5hometeampoints == 15){\n setsWonHT ++;\n } else if(set5awayteampoints == 15){\n setsWonAT ++; \n }\n }", "@Before\r\n public void setUpBoard(){\r\n board3 = new Board(makeTiles(3*3), boardManager3, 3);\r\n board4 = new Board(makeTiles(4*4), boardManager4, 4);\r\n board5 = new Board(makeTiles(5*5), boardManager5, 5);\r\n boardManager3.setBoard(board3);\r\n boardManager4.setBoard(board4);\r\n boardManager5.setBoard(board5);\r\n board3.setSlidingScoreBoard(slidingScoreBoard3);\r\n board4.setSlidingScoreBoard(slidingScoreBoard4);\r\n board5.setSlidingScoreBoard(slidingScoreBoard5);\r\n }", "public static void main(String[] args) {\r\n int grade = 0;\r\n \r\n initializeBoard();\r\n \r\n System.out.println(game);\r\n//getValueIn is a simple getter method the returns value at given array index \r\n if (game.getValueIn(1, 1) == 5)\r\n grade += 5;\r\n else\r\n System.out.println(\"getValueIn(r,c) test failed\");\r\n//confirms that to string was done correctly \r\n if (testToString()) \r\n grade += 5;\r\n else\r\n System.out.println(\"toString() test failed\");\r\n//testAddGuess1() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 3, 5);\r\n if (testAddGuess1()) \r\n grade += 5;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 1 failed\"); \r\n//testAddGuess2() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 2, 5);\r\n if (testAddGuess2()) \r\n grade += 5;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 2 failed\"); \r\n//testAddGuess3() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 4, 1);\r\n if (testAddGuess3()) \r\n grade += 10;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 3 failed\"); \r\n //tests reset(), by re-running the first toString test above, after running game.reset() \r\n game.reset();\r\n if (testToString())\r\n grade += 10;\r\n else\r\n System.out.println(\"reset() test failed\");\r\n//tests the game.getAllowedValues method by passing the game object method call and hence it's results\r\n//to the testGetAllowedValues(), which appears to only apply to one cell/array index at a time\r\n//so if I am correct this is saying what values can be used at coordinates 8, 8.\r\n//the answer that it uses to compare is a visual/manual analysis of expected results for cell 8, 8. \r\n if (testGetAllowedValues(game.getAllowedValues(8, 8)))\r\n grade += 10;\r\n else\r\n System.out.println(\"getAllowedValues() test failed\");\r\n \r\n System.out.printf(\"Your grade is %d/50.\\n\", grade);\r\n }", "@Test\n public void scoreExample4() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl(5);\n exampleBoard.move(6, 4, 6, 6);\n assertEquals(103, exampleBoard.getScore());\n }", "private void checkPoints() {\n if (mPointsManager.getScore() < 20 && !SharedDataManager.isHuntReady(this)) {\n /* Before the 30 points 'reward', player must have no locked target in history */\n if (SharedDataManager.isLockedTargetInHistory(MainActivity.this)) {\n return;\n }\n mPointsManager.setScore(30);\n updateInfo();\n try {\n if (!requestingPoints) {\n requestingPoints = true;\n /* Update the value in the server database if possible */\n mPointsManager.updateInDatabase(MainActivity.this, new ResponseTask.OnResponseTaskCompleted() {\n @Override\n public void onResponseTaskCompleted(Request request, Response response, OHException ohex, Object data) {\n /* It's ok if the request was not successful, the update will be done later */\n requestingPoints = false;\n }\n });\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "public void Game() {\n\t\tboard = new int[3][3];\n\t\trowSum = new int[3];\n\t\tcolSum = new int[3];\n\t\tdiagSum = new int[2];\n\t\treset();\n\t}", "public void updateScore(Player player, Piece piece, Move move) {\n var newScore = player.getScore();\n newScore += Math.abs(move.getSource().x() - move.getDestination().x());\n newScore += Math.abs(move.getSource().y() - move.getDestination().y());\n player.setScore(newScore);\n System.out.println(\"score \" + newScore);\n }", "public void resetAllScores(View v) {\n scorePlayerB = 0;\n scorePlayerA = 0;\n triesPlayerA = 0;\n triesPlayerB = 0;\n displayForPlayerA(scorePlayerA);\n displayForPlayerB(scorePlayerB);\n displayTriesForPlayerA(triesPlayerA);\n displayTriesForPlayerB(triesPlayerB);\n }", "private boolean win(int row, int col, int player)\n {\n int check;\n // horizontal line\n // Start checking at a possible and valid leftmost point\n for (int start = Math.max(col - 3, 0); start <= Math.min(col,\n COLUMNS - 4); start++ )\n {\n // Check 4 chess horizontally from left to right\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of column increases 1 every time\n if (chessBoard[row][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // vertical line\n // Start checking at the point inputed if there exists at least 3 rows under\n // it.\n if (row + 3 < ROWS)\n {\n // Check another 3 chess vertically from top to bottom\n for (check = 1; check < 4; check++ )\n {\n // The coordinate of row increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row + check][col] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // diagonal line \"\\\"\n // Start checking at a possible and valid leftmost and upmost point\n for (int start = Math.max(Math.max(col - 3, 0), col - row); start <= Math\n .min(Math.min(col, COLUMNS - 4), col + ROWS - row - 4); start++ )\n {\n // Check 4 chess diagonally from left and top to right and bottom\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of row increases 1 every time\n // The coordinate of column increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row - col + start + check][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // diagonal line \"/\"\n // Start checking at a possible and valid leftmost and downmost point\n for (int start = Math.max(Math.max(col - 3, 0),\n col - ROWS + row + 1); start <= Math.min(Math.min(col, COLUMNS - 4),\n col + row - 3); start++ )\n {\n // Check 4 chess diagonally from left and bottom to right and up\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of row decreases 1 every time\n // The coordinate of column increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row + col - start - check][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n // no checking passed, not win\n return false;\n }", "public void solve() {\n\t\tArrayList<Piece> pieceListBySize = new ArrayList<Piece>(pieceList);\n\t\tCollections.sort(pieceListBySize);\t// This is done since the order\n\t\t\t\t\t\t\t\t\t\t\t// of piece placements does not matter.\n\t\t\t\t\t\t\t\t\t\t\t// Placing larger pieces down first lets\n\t\t\t\t\t\t\t\t\t\t\t// pruning occur sooner.\n\t\t\n\t\t/**\n\t\t * Calculates number of resets needed for a game board.\n\t\t * A \"reset\" refers to a tile that goes from the solved state to\n\t\t * an unsolved state and back to the solved state.\n\t\t * \n\t\t * This is the calculation used for pruning.\n\t\t */\n\t\t\n\t\tArrayList<Integer> areaLeft = new ArrayList<Integer>();\n\t\tareaLeft.add(0);\n\t\tint totalArea = 0;\n\t\tfor (int i = pieceListBySize.size() - 1; i >= 0; i--) {\n\t\t\ttotalArea += pieceListBySize.get(i).numberOfFlips;\n\t\t\tareaLeft.add(0, totalArea);\n\t\t}\n\t\tint totalResets = (totalArea - gameBoard.flipsNeeded) / (gameBoard.goal + 1);\n\t\tSystem.out.println(\"Total Resets: \" + totalResets);\n\t\t\n\t\t/* \n\t\tint highRow = 0;\n\t\tint highCol = 0;\n\t\tint[][] maxDim = new int[2][pieceListBySize.size()];\n\t\tfor (int i = pieceListBySize.size() - 1; i >= 0; i--) {\n\t\t\tif (highRow < pieceListBySize.get(i).rows)\n\t\t\t\thighRow = pieceListBySize.get(i).rows;\n\t\t\t\n\t\t\tif (highCol < pieceListBySize.get(i).cols)\n\t\t\t\thighCol = pieceListBySize.get(i).cols;\n\t\t\t\n\t\t\tmaxDim[0][i] = highRow;\n\t\t\tmaxDim[1][i] = highCol;\n\t\t}\n\t\t*/\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\t\t\n\t\tNode<GameBoard> currentNode = new Node<GameBoard>(gameBoard);\n\t\tStack<Node<GameBoard>> stack = new Stack<Node<GameBoard>>();\n\t\tstack.push(currentNode);\n\t\t\n\t\twhile (!stack.isEmpty()) {\n\t\t\tnodeCount++;\n\t\t\t\n\t\t\tNode<GameBoard> node = stack.pop();\n\t\t\tGameBoard current = node.getElement();\n\t\t\tint depth = node.getDepth();\n\t\t\t\n\t\t\t// Checks to see if we reach a solved state.\n\t\t\t// If so, re-order the pieces then print out the solution.\n\t\t\tif (depth == pieceListBySize.size() && current.isSolved()) {\n\t\t\t\tArrayList<Point> moves = new ArrayList<Point>();\n\t\t\t\t\n\t\t\t\twhile (node.parent != null) {\n\t\t\t\t\tint index = node.level - 1;\n\t\t\t\t\tint sequence = pieceList.indexOf(pieceListBySize.get(index));\n\t\t\t\t\tPoint p = new Point(current.moveRow, current.moveCol, sequence);\n\t\t\t\t\tmoves.add(p);\n\t\t\t\t\t\n\t\t\t\t\tnode = node.parent;\n\t\t\t\t\tcurrent = node.getElement();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tCollections.sort(moves);\n\t\t\t\tfor (Point p : moves) {\n\t\t\t\t\tSystem.out.println(p);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Nodes opened: \" + nodeCount);\n\t\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\t\tSystem.out.println(\"Elapsed Time: \" + ((endTime - startTime) / 1000) + \" secs.\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tPiece currentPiece = pieceListBySize.get(depth);\n\t\t\tint pieceRows = currentPiece.rows;\n\t\t\tint pieceCols = currentPiece.cols;\n\t\t\t\n\t\t\tPriorityQueue<Node<GameBoard>> pQueue = new PriorityQueue<Node<GameBoard>>();\n\t\t\t\n\t\t\t// Place piece in every possible position in the board\n\t\t\tfor (int i = 0; i <= current.rows - pieceRows; i++) {\n\t\t\t\tfor (int j = 0; j <= current.cols - pieceCols; j++) {\n\t\t\t\t\tGameBoard g = current.place(currentPiece, i, j);\n\t\t\t\t\t\n\t\t\t\t\tif (totalResets - g.resets < 0)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t// Put in the temporary priority queue\n\t\t\t\t\tpQueue.add(new Node<GameBoard>(g, node));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Remove from priority queue 1 at a time and put into stack.\n\t\t\t// The reason this is done is so that boards with the highest reset\n\t\t\t// count can be chosen over ones with fewer resets.\n\t\t\twhile (!pQueue.isEmpty()) {\n\t\t\t\tNode<GameBoard> n = pQueue.remove();\n\t\t\t\tstack.push(n);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "protected void fillBoard(Color playerColor)\n {\n for(int i = 0; i < 9; i++)\n this.setSquare(i, playerColor);\n }" ]
[ "0.6991874", "0.67492455", "0.67082316", "0.66929626", "0.66498804", "0.6600745", "0.6555265", "0.6503112", "0.64672905", "0.6452299", "0.6446668", "0.6417586", "0.6380305", "0.6373713", "0.6367624", "0.63553274", "0.6343133", "0.6325692", "0.6300121", "0.6295358", "0.62726694", "0.6252389", "0.62499046", "0.62485933", "0.6241435", "0.6204106", "0.6190439", "0.61853135", "0.6173171", "0.617139", "0.61684966", "0.6163555", "0.6147927", "0.6133838", "0.6119924", "0.61160475", "0.611516", "0.6110365", "0.61029774", "0.60664904", "0.60619193", "0.6041798", "0.6033151", "0.60164803", "0.6006892", "0.59991175", "0.5998944", "0.5998159", "0.5997144", "0.59960794", "0.5992014", "0.5971997", "0.5966829", "0.59606504", "0.5959631", "0.5957465", "0.5956687", "0.5954482", "0.5947751", "0.5946804", "0.594139", "0.5940236", "0.593863", "0.5935962", "0.59269625", "0.5924725", "0.5921978", "0.59218603", "0.5921729", "0.59181494", "0.5914644", "0.5913717", "0.5906414", "0.59024596", "0.5897447", "0.5896185", "0.589368", "0.5891654", "0.5890507", "0.58902735", "0.5888922", "0.5886315", "0.58845973", "0.5883836", "0.5881304", "0.58760095", "0.5870397", "0.5869836", "0.58683294", "0.5867959", "0.58639205", "0.5857374", "0.58569264", "0.5852305", "0.5850317", "0.58467066", "0.58464676", "0.5837573", "0.58360326", "0.5821021" ]
0.72149414
0
cleans dynamicboard for the changepieces method.
public static void cleandynamicboard(){ for(int x=0;x<boardwidth+2;x++){ for(int i=0;i<boardlength+2;i++){ dynamicboard[x][i]=0; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clearBoard() {\r\n\t\tbody.removeAll();\r\n\t\tpiece.clear();\r\n\t\t\r\n\t\t// Assign1, Remove 'K' label of all pieces\r\n\t\tfor (int i=0; i<blackPieces.length; i++) {\r\n\t\t\tblackPieces[i].setText(null);\r\n\t\t}\r\n\t\tfor (int i=0; i<whitePieces.length; i++) {\r\n\t\t\twhitePieces[i].setText(null);\r\n\t\t}\r\n\t\tbody.repaint();\r\n\t}", "public static void clearBoard(){\n for(int i = 0; i < Board.X_UPPER_BOUND * Board.Y_UPPER_BOUND ; i++){\n Board.board[i] = null;\n }\n white_player.setpieceList(null);\n black_player.setpieceList(null);\n }", "public void clearBoard() \n {\n\tfor(int i=0;i<rows;i++)\n\t {\n\t\tfor(int j=0;j<cols;j++)\n\t\t {\n\t\t\tfrontBoard[i][j] = \"00\";\n\t\t\tbackBoard[i][j] = \"00\";\n\t\t }\n\t }\n\tunused = new Piece[pieces.length];\n\tfor(int i=0;i<pieces.length;i++)\n\t {\n\t\t\tunused[i] = pieces[i];\n\t }\n }", "public void cleanBoard(){\n\n for(PositionInBoard position : positionsThatArePainted){\n int i = position.row();\n int j = position.column();\n if ((i+j)%2==0) {\n board[i][j].setBackground(Color.BLACK);\n }\n else {\n board[i][j].setBackground(Color.WHITE);\n }\n\n board[i][j].setText(null);\n board[i][j].setIcon(null);\n }\n positionsThatArePainted.clear();\n }", "public void cleanBoard()\n {\n System.out.println(\"Function: GameMain, cleanBoard()\");\n game.setBoard(game.returnRandomBoard(ROWS, COLS));\n }", "public void clear() {\n for (int row = 0; row < 8; ++row) {\n for (int col = 0; col < 8; ++col) {\n board[row][col] = null;\n }\n }\n whitePieces = new LinkedList<Piece>();\n blackPieces = new LinkedList<Piece>();\n }", "public void clearBoardData()\n {\n player_turn = RED;\n total_moves = 0;\n int[][] clear_board = new int[7][6];\n for (int i = 0; i < clear_board.length; i++)\n current_board[i] = clear_board[i].clone();\n }", "public void resetBoard() {\n piece = 1;\n b = new Board(9);\n board = b.getBoard();\n\n board2d = new int[3][3];\n makeBoard2d();\n\n }", "public void removeAllPieces()\n\t{\n\t\t/* iterate over the rows and columns */\n\t\tfor (int i = 0; i < m_rows; i++) {\n\t\t\tfor (int j = 0; j < m_cols; j++) {\n\t\t\t\tremovePiece(i, j);\n\t\t\t}\n\t\t}\n\t}", "public void clearPieces(){\n for(int i =0; i<WIDTH;i++){\n for(int j = 0 ; j<HEIGHT;j++){\n piecesToSwap[i][j]=null;\n }\n }\n }", "public void cleartbl(View view) {\n\n table.removeAllViews();\n buttons.clear();\n lauta = new int[9];\n moves = 0;\n turn = true;\n create_board();\n victory1 = false;\n victory2 = false;\n }", "private void resetBoard() {\r\n\t\tboard.removeAll();\r\n\t\tboard.revalidate();\r\n\t\tboard.repaint();\r\n\t\tboard.setBackground(Color.WHITE);\r\n\r\n\t\t// Reset filled\r\n\t\tfilled = new boolean[length][length];\r\n\t\tfor (int x = 0; x < length; x++) {\r\n\t\t\tfor (int y = 0; y < length; y++) {\r\n\t\t\t\tfilled[x][y] = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tupdateBoard();\r\n\t}", "private void clearBoard() {\n for (int i = 0; i < BOARD_HEIGHT * BOARD_WIDTH; ++i) {\n board[i] = Tetrominoe.NoShape;\n }\n }", "public void resetBoard(){\n totalmoves = 0;\n this.board = new Cell[3][3];\n //fill the board with \"-\"\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n this.board[i][j]=new Cell(new Coordinates(i,j), \"-\");\n }\n }\n }", "public static void clearBoard() {\n\t\tfor(int i = 0; i < display.length; i++){\n\t\t\tfor(int j = 0; j < display[i].length; j++){\n\t\t\t\tdisplay[i][j].setSelected(false);\n\t\t\t\tdisplay[i][j].setIcon(DEFAULT);\n\t\t\t}\n\t\t}\t\n\t\t\n\t}", "public void clearGame() {\n //loop through piece array erase pieces\n\n //clear piece array\n for (int i = 0; i < 64; i++) {\n ChessBoard.pieces[i] = null;\n }\n\n //remove all piece components from chessboard\n chessboard.removeAll();\n \n //clear game log\n gamelog.clearLog();\n \n //refresh graphics\n frame.update(frame.getGraphics());\n }", "public static void blankBoard() {\r\n\t\tfor (int i = 0; i < Spaces.length; i++) {\r\n\t\t\tSpaces[i] = new Piece();\r\n\t\t}\r\n\t}", "public void clearMoveData(ChessBoard board){\n\t\twhile(!dependentSpaces.empty())\n\t\t\tdependentSpaces.pop().removeDependentMove(this);\n\t\tcommandSequences.clear();\n\t}", "public void updateBoard() {\n for(SnakePart s : snakePartList) {\n board[s.getSnakePartRowsOld()][s.getSnakePartCollsOld()] = ' ';\n board[s.getSnakePartRowsNew()][s.getSnakePartCollsNew()] = 'S';\n }\n \n for (SnakeEnemyPart e : snakeEnemyPartList) {\n board[e.getSnakeEnemyPartRowsOld()][e.getSnakeEnemyPartCollsOld()] = ' ';\n board[e.getSnakeEnemyPartRowsNew()][e.getSnakeEnemyPartCollsNew()] = 'E';\n }\n }", "Board() {\n clear();\n }", "Board() {\n clear();\n }", "public void clearGrid() {\n\t\tfor (int i = 0; i < this.board.length; i++) {\n\t\t\tArrays.fill(this.board[i], EMPTY);\n\t\t}\n\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t}", "public void setBoard(){\n \n\t m_Pieces[3][3]= WHITE_PIECE;\n m_Pieces[4][4]= WHITE_PIECE;\n m_Pieces[3][4]= BLACK_PIECE;\n m_Pieces[4][3]= BLACK_PIECE;\n for(int x=0;x<WIDTH;x++){\n for(int y=0;y<HEIGHT;y++){\n if(m_Pieces[x][y]==null){\n m_Pieces[x][y]=NONE_PIECE;\n }\n }\n }\n }", "public void resetBoard() {\n for (int y = 0; y < length; y++) {\n for (int x = 0; x < width; x++) {\n grid[x][y].setBackground(null);\n grid[x][y].setEnabled(true);\n }\n }\n }", "private void clearStragglers() {\n for (int i = 0; i < game.gridPieces.length; i++) {\n GridPiece piece = game.gridPieces[i];\n\n if (piece.state == game.STATE_TEMP) {\n piece.restoreState();\n //restoreState(piece);\n } else if (piece.state == game.STATE_TEMP_NOTOUCH) {\n piece.setState(game.STATE_FINAL);\n }\n }\n }", "public void removeAllSeconderyColorsFromBoard() {\n\t\tArrayList<Tile> boardTiles= getAllBoardTiles();\n\t\tif(!this.coloredTilesList.isEmpty()) {\n\t\t\tboardTiles.retainAll(coloredTilesList);\n\t\t\tfor(Tile t :boardTiles) {\n\t\t\t\tTile basicTile= new Tile.Builder(t.getLocation(), t.getColor1()).setPiece(t.getPiece()).build();\n\t\t\t\treplaceTileInSameTileLocation(basicTile);\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tthis.coloredTilesList=null;\n\t\tthis.coloredTilesList=new ArrayList<Tile>();\n\t\tthis.orangeTiles=null;\n\t\tthis.orangeTiles=new ArrayList<Tile>();\n\n\t}", "public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }", "public void initializeDebugBoard() {\n\t\tboolean hasNotMoved = false;\n\t\tboolean hasMoved = true;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set empty rows\n\t\tfor (int row = 0; row < 8; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\tboard[5][4] = new Piece('k', white, hasMoved, 5, 4, PieceArray.E_kingId);\n//\t\tboard[1][4] = new Piece(\"rook\", white, hasMoved, 1, 4);\n\t\tboard[2][2] = new Piece('q', black, hasMoved, 2, 2, PieceArray.A_rookId);\n//\t\tboard[3][2] = new Piece('q', black, hasMoved, 3, 2, PieceArray.H_rookId);\n\t\t\n\n\t\tboard[0][0] = new Piece('k', black, hasMoved, 0, 0, PieceArray.E_kingId);\n//\t\tboard[7][7] = new Piece('r', black, hasNotMoved, 7, 7, PieceArray.A_rookId);\n//\t\tboard[6][7] = new Piece('p', black, hasNotMoved, 6, 7, PieceArray.A_pawnId);\n//\t\tboard[6][6] = new Piece('p', black, hasNotMoved, 6, 6, PieceArray.B_pawnId);\n//\t\tboard[6][5] = new Piece('p', black, hasNotMoved, 6, 5, PieceArray.C_pawnId);\n//\t\tboard[6][4] = new Piece('p', black, hasNotMoved, 6, 4, PieceArray.D_pawnId);\n\t\n//\t\tboard[6][6] = new Piece(\"pawn\", black, hasMoved, 6, 6);\n//\t\tboard[6][7] = new Piece(\"pawn\", black, hasMoved, 6, 7);\n//\t\tboard[6][4] = new Piece(\"pawn\", black, hasMoved, 6, 4);\n//\t\t\t\n//\t\t\n//\t\tboard[4][4] = new Piece(\"pawn\", black, hasMoved, 4,4);\n//\t\tboard[3][5] = new Piece(\"rook\", white,hasMoved,3,5);\n//\t\tboard[1][7] = new Piece(\"pawn\",black,hasMoved,1,7);\n\n\t}", "public static void setPieceTest2() {\n\t\t\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n\t\t\t \tBoard.setBoard();\n\t\t\t\tBoard.decPieceCount();\n\t\t\t \tSystem.out.println(Board.getPieceCount());\t\n\t\t\t\tSystem.out.println(Board.move(\n\t\t\t\t\t\tTEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t\t\t\tBoard.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\tBoard.checkWin();\n\t\t\t\tSystem.out.println(\"Valid inputs\");\n\t\t\t\tSystem.out.println(\"OthelloBoard.clearPieces() - Begin\");\n\t\t\t\tSystem.out.println(\"Expected output: Throws exception\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t\ttry{\n\t\t\t\t\t\n\t\t\t\t}catch(UnsupportedOperationException e){\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\");\n\t\t}", "protected static char[][] update_Board(){\n return null;\n }", "public void resetModel() {\n\t\twhitePieces.removeAll();\n\t\tblackPieces.removeAll();\n\t\tcapturedPieces.removeAll(capturedPieces);\n\t\tmoveList.removeAll(moveList);\n\n\t\tinitializeBoard();\n\t\tpopulateLists();\n\t}", "public static void getPiecesTest() {\n\t\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n\t\t \tBoard.setBoard();\n\t\t\tBoard.decPieceCount();\n\t\t \tSystem.out.println(Board.getPieceCount());\t\n\t\t\tSystem.out.println(Board.move(\n\t\t\t\t\tTEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t\t\tBoard.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"\");\n\t\t\tBoard.checkWin();\n\t\t\tSystem.out.println(\"Valid inputs\");\n\t\t\tSystem.out.println(\"OthelloBoard.clearPieces() - Begin\");\n\t\t\tSystem.out.println(\"Expected output: 0\");\n\t\t\tSystem.out.println(\"\");\n\t\t\tBoard.clearPieces();\n\t\t\tSystem.out.println(\"Actual output: \" + Board.getPieces());\n\t\t\tSystem.out.println(\"\");\n\t}", "public void resetBoard() {\n //sets current board to a new board\n currentBoard = new Board(7, 6);\n\n //sets all text fields back to white\n for (int i = 0; i < currentBoard.getSizeX(); i++) {\n for (int v = 0; v < currentBoard.getSizeY(); v++) {\n squares[i][v].setBackground(Color.white);\n }\n }\n //sets turn to true (first player)\n turn = true;\n }", "public void clearBoard()\n {\n for (int i = 0; i < buttons.length; i++)\n {\n buttons[i].setText(\"\");\n }\n }", "Board (boolean[][] board, List<Piece> pieces) {\n\n this.board = board;\n unusedPieces = new ArrayList<>(pieces);\n List<Piece> possiblePieces = new ArrayList<>(pieces);\n tessellate(possiblePieces.get(0));\n }", "public void updateBoard() {\r\n\t\tfor(int i = 0, k = 0; i < board.getWidth(); i+=3) {\r\n\t\t\tfor(int j = 0; j < board.getHeight(); j+=3) {\r\n\t\t\t\t//Check that there are pieces to display\r\n\t\t\t\tif(k < bag.size()) {\r\n\t\t\t\t\tboard.setTile(bag.get(k), i, j);\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tboard.fillSpace(GridSquare.Type.EMPTY, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void createBoard() {\n\t\tboard = new Piece[8][8];\n\t\t\n\t\tfor(int i=0; i<8; i++) {\n\t\t\tfor(int j=0; j<8; j++) {\n\t\t\t\tboard[i][j] = null;\n\t\t\t}\n\t\t}\n\t}", "public void initChessBoardAutomaticly() {\r\n\t\tthis.initPieces();\r\n\t\tthis.clearBoard();\r\n\t\tfor (int i=0; i<board.size(); i++) {\r\n\t\t\tChessBoardBlock b = board.get(order[i]);\r\n\t\t\tb.setBorderPainted(false);\r\n\t\t}\r\n\t\tfor (int i = 0, w = 0, b = 0, s = 0; i < 8 * 8; i++) {\r\n\r\n\t\t\t// Assign1, Disable board clickable\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setEnabled(false);\r\n\r\n\t\t\t// Assign1, Put black pieces and record the position\r\n\t\t\tif (i % 2 != 1 && i >= 8 && i < 16) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t} else if (i % 2 != 0 && (i < 8 || (i > 16 && i < 24))) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Assign1, Put white pieces and record the position\r\n\t\t\telse if (i % 2 != 0 && i > 48 && i < 56) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t} else if (i % 2 != 1\r\n\t\t\t\t\t&& ((i >= 40 && i < 48) || (i >= 56 && i < 64))) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\t\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t}\r\n\r\n\t\t\t// Assign1, Put empty pieces on the board\r\n\t\t\t// Actually, empty pieces will not display on the board, they are\r\n\t\t\t// not existing\r\n\t\t\t// to chess players, just for calculation\r\n\t\t\telse {\r\n\t\t\t\tChessPiece spacePiece = spacePieces[s];\r\n\t\t\t\tspacePiece.position = order[i];\r\n\t\t\t\tbody.add(spacePiece);\r\n\t\t\t\tpiece.put(order[i], spacePiece);\r\n\t\t\t\tspacePiece.setVisible(false);\r\n\t\t\t\ts++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tt.setText(\"Chess Board has been initialized automatically\");\r\n\t\tthis.startGame();\r\n\t}", "private void board() {\r\n\t\tfor (int n = 0; n < ROW; n++) {\r\n\t\t\tfor (int m = 0; m < COL; m++) {\r\n\t\t\t\tboard[n][m] = 'X';\r\n\t\t\t}\r\n\t\t}\r\n\t\tturnRemaining = 42;\r\n\t}", "public static void resetBoard() {\n\t\tfor (int i = 0; i<3; i++) {\n\t\t\tfor (int j = 0; j<3; j++) {\n\t\t\t\tboard[i][j] = '_';\n\t\t\t}\n\t\t}\n\t\tprintBoard();\n\t}", "public void updateComputerBoard()\r\n {\r\n boardpanel.removeAll();\r\n for (int i = 0; i < 3; i++) {\r\n for (int j = 0; j < 3; j++) {\r\n buttons[i][j].setEnabled(false);\r\n boardpanel.add(buttons[i][j]);\r\n }\r\n }\r\n }", "public void clearCommand() {\r\n _board = new Board();\r\n _playing = false;\r\n }", "public void makeChanges() { \n for(int i = 1; i < 9; i++) {\n for(int j = 1; j < 11; j++) {\n if(!(controller.getBoard().getPiece(i, j) instanceof Forbidden)) {\n Cell[i][j].setBackground(Color.white);\n if(controller.getBoard().getPiece(i,j) != null) {\n if(controller.getPlayer(controller.getTurn()).getColour() != controller.getBoard().getPiece(i,j).getColour()) {\n if(controller.getTurn() == 1) {\n Cell[i][j].setIcon(new ImageIcon(\"pieces\\\\redHidden.png\"));\n Cell[i][j].setEnabled(false);\n } else {\n Cell[i][j].setIcon(new ImageIcon(\"pieces\\\\blueHidden.png\"));\n Cell[i][j].setEnabled(false);\n }\n } else {\n Cell[i][j].setIcon((controller.getBoard().getPiece(i, j).getIcon()));\n Cell[i][j].setEnabled(true);\n }\n if(controller.getBoard().getPiece(i,j) instanceof Trap || controller.getBoard().getPiece(i,j) instanceof Flag) {\n Cell[i][j].removeActionListener(handler);\n Cell[i][j].setEnabled(false);\n }\n } else {\n Cell[i][j].setBackground(Color.white);\n Cell[i][j].setEnabled(false);\n }\n }\n }\n }\n controller.setTurn(); \n }", "public void clearBoard(boolean eraseWins)\n {\n if(eraseWins)\n {\n computerWins = 0;\n humanWins = 0;\n ties = 0;\n }\n mBoard = new char[]{'1', '2', '3', '4', '5', '6', '7', '8', '9'};\n for(int i = 0; i < BOARD_SIZE; i++) {\n mBoardButtons[i].setText(\"\");\n mBoardButtons[i].setEnabled(true);\n\n }\n }", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "public void clean() {\n \tfor(int f=0; f<NUMCARTAS;f++) \n \tfor(int c=0; c<NUMCARTAS;c++) {\n \t\ttablero[f][c].setSelected(false);\n\t \t \t//Devuelve al color original\n\t if(tablero[f][c].getText().length()==2) tablero[f][c].setBackground(colorDiagonal);\n\t else if(tablero[f][c].getText().charAt(2)=='s') tablero[f][c].setBackground(colorSuited);\n\t else tablero[f][c].setBackground(colorOffsuited);\n \t}\n }", "void changepos(MouseEvent e, pieces chessPiece) \n { \n for(int beta : chessPiece.movnum)\n { \n if (chessPiece.color == 0 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allWhitePositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false;\n \n \n \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/\n }\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = false;\n }\n else if (chessPiece.color == 1 && e.getSource()== panel[beta-1 ]&& chessPiece.select == true && Checkerboard.allBlackPositions.contains(beta-1) == false)\n {\n if(this.getPiece(beta-1) != null)\n { \n getPiece(beta-1).alive = false; \n panel[beta-1].removeAll();/*getPiece(beta-1).position = 64;*/}\n chessPiece.position = beta-1;\n chessPiece.movnum.clear();\n chessPiece.mov.clear();\n chessPiece.select = false;\n chessPiece.timesMoved++;\n whiteToPlay = true;\n }\n }//for ends\n \n }", "@Override\r\n\tpublic void resetBoard() {\r\n\t\tcontroller.resetGame(player);\r\n\t\tclearBoardView();\r\n\t\tif (ready)\r\n\t\t\tcontroller.playerIsNotReady();\r\n\t}", "private void generateBoard(){\n\t}", "public void reset() {\n \tboard = new char[columns][rows];\n \tfor(int i = 0; i < columns; i++) {\n \t\tfor(int j = 0; j < rows; j++) {\n \t\t\tboard[i][j] = EMPTY;\n \t\t}\n \t}\n\t}", "private void displayBoard() {\r\n\r\n for (int r = 0; r < 8; r++) {\r\n for (int c = 0; c < 8; c++) {\r\n if (model.pieceAt(r, c) == null)\r\n board[r][c].setIcon(null);\r\n else if (model.pieceAt(r, c).player() == Player.WHITE) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(wPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(wRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(wKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(wBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(wQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(wKing);\r\n } else if (model.pieceAt(r, c).player() == Player.BLACK) {\r\n if (model.pieceAt(r, c).type().equals(\"Pawn\"))\r\n board[r][c].setIcon(bPawn);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Rook\"))\r\n board[r][c].setIcon(bRook);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Knight\"))\r\n board[r][c].setIcon(bKnight);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Bishop\"))\r\n board[r][c].setIcon(bBishop);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"Queen\"))\r\n board[r][c].setIcon(bQueen);\r\n\r\n if (model.pieceAt(r, c).type().equals(\"King\"))\r\n board[r][c].setIcon(bKing);\r\n }\r\n repaint();\r\n }\r\n }\r\n if (model.inCheck(Player.WHITE))\r\n JOptionPane.showMessageDialog(null, \"White King in Check\");\r\n if (model.inCheck(Player.BLACK))\r\n JOptionPane.showMessageDialog(null, \"Black King in Check\");\r\n if (model.movingIntoCheck())\r\n JOptionPane.showMessageDialog(null, \"Cannot move into check\");\r\n if (model.isComplete())\r\n JOptionPane.showMessageDialog(null, \"Checkmate\");\r\n }", "public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }", "public void reset() {\n\t\trabbitcount[1]=8;\n\t\trabbitcount[2]=8;\n\t\tpieces.clear();\n\t\tselectedsquares.clear();\n\t\trepaint();\n\t}", "public void reset() {\n // White Pieces\n placePiece(new Rook(Player.White), new Position(\"a1\"));\n placePiece(new Knight(Player.White), new Position(\"b1\"));\n placePiece(new Bishop(Player.White), new Position(\"c1\"));\n placePiece(new Queen(Player.White), new Position(\"d1\"));\n placePiece(new King(Player.White), new Position(\"e1\"));\n placePiece(new Bishop(Player.White), new Position(\"f1\"));\n placePiece(new Knight(Player.White), new Position(\"g1\"));\n placePiece(new Rook(Player.White), new Position(\"h1\"));\n placePiece(new Pawn(Player.White), new Position(\"a2\"));\n placePiece(new Pawn(Player.White), new Position(\"b2\"));\n placePiece(new Pawn(Player.White), new Position(\"c2\"));\n placePiece(new Pawn(Player.White), new Position(\"d2\"));\n placePiece(new Pawn(Player.White), new Position(\"e2\"));\n placePiece(new Pawn(Player.White), new Position(\"f2\"));\n placePiece(new Pawn(Player.White), new Position(\"g2\"));\n placePiece(new Pawn(Player.White), new Position(\"h2\"));\n\n // Black Pieces\n placePiece(new Rook(Player.Black), new Position(\"a8\"));\n placePiece(new Knight(Player.Black), new Position(\"b8\"));\n placePiece(new Bishop(Player.Black), new Position(\"c8\"));\n placePiece(new Queen(Player.Black), new Position(\"d8\"));\n placePiece(new King(Player.Black), new Position(\"e8\"));\n placePiece(new Bishop(Player.Black), new Position(\"f8\"));\n placePiece(new Knight(Player.Black), new Position(\"g8\"));\n placePiece(new Rook(Player.Black), new Position(\"h8\"));\n placePiece(new Pawn(Player.Black), new Position(\"a7\"));\n placePiece(new Pawn(Player.Black), new Position(\"b7\"));\n placePiece(new Pawn(Player.Black), new Position(\"c7\"));\n placePiece(new Pawn(Player.Black), new Position(\"d7\"));\n placePiece(new Pawn(Player.Black), new Position(\"e7\"));\n placePiece(new Pawn(Player.Black), new Position(\"f7\"));\n placePiece(new Pawn(Player.Black), new Position(\"g7\"));\n placePiece(new Pawn(Player.Black), new Position(\"h7\"));\n }", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "private void killPiece(Piece piece) {\r\n\t\tif (piece.getPlayer().color == Color.BLACK) {\r\n\t\t\tblack.removeElement(piece);\r\n\t\t}\r\n\t\telse {\r\n\t\t\twhite.removeElement(piece);\r\n\t\t}\r\n\t\t\r\n\t}", "public void createPieces(){ \n\t\tfor(int x = 0; x<BOARD_LENGTH; x++){\n\t\t\tfor(int y = 0; y<BOARD_LENGTH; y++){ \n\t\t\t\tif(CHESS_MAP[x][y] != (null)){\n\t\t\t\t\tswitch (CHESS_MAP[x][y]){\n\t\t\t\t\tcase KING:\n\t\t\t\t\t\tpieces[pieceCounter] = new King(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase QUEEN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Queen(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BISHOP:\n\t\t\t\t\t\tpieces[pieceCounter] = new Bishop(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KNIGHT:\n\t\t\t\t\t\tpieces[pieceCounter] = new Knight(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PAWN:\n\t\t\t\t\t\tpieces[pieceCounter] = new Pawn(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ROOK:\n\t\t\t\t\t\tpieces[pieceCounter] = new Rook(pieceCounter, new Point(x+1,y+1), new Point(0,0), true, true, BOARD_PIECE_LENGTH, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tsetPieceIconAndName(x, y, CHESS_MAP[x][y]); \t\n\t\t\t\t\tpieceCounter++;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "void prepareBoardBeforePlacement( Board board );", "void clear() {\n _whoseMove = WHITE;\n _gameOver = false;\n\n for (int i = 0; i <= MAX_INDEX; i += 1) {\n set(i, BLACK);\n }\n for (int i : _initWhite) {\n set(i, WHITE);\n }\n set(12, EMPTY);\n _history.clear();\n\n setInitialDirection(MAX_INDEX);\n\n setChanged();\n notifyObservers();\n }", "@Override\n public String[] draw() {\n Piece[][] pieces = solver.getSolution();\n int height = pieces.length;\n int width = pieces[0].length;\n char[][] board = new char[height * 4][width * 4 + 1];\n int totalPieces = pieces.length * pieces[0].length;\n int countPieces = 0;\n // run through each piece and add it to the temp board\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n countPieces++;\n Piece curPiece = pieces[i][j];\n int tempHeight = i * 4 + 1;\n int tempWidth = j * 4 + 2;\n if (curPiece == null) {\n board[tempHeight][tempWidth] = EMPTY;\n board[tempHeight][tempWidth + 1] = EMPTY;\n board[tempHeight][tempWidth + 2] = EMPTY;\n board[tempHeight + 1][tempWidth] = EMPTY;\n board[tempHeight + 1][tempWidth + 1] = EMPTY;\n board[tempHeight + 1][tempWidth + 2] = EMPTY;\n board[tempHeight + 2][tempWidth] = EMPTY;\n board[tempHeight + 2][tempWidth + 1] = EMPTY;\n board[tempHeight + 2][tempWidth + 2] = EMPTY;\n Arrays.fill(board[tempHeight + 3], EMPTY);\n } else {\n char[][] displayPiece = pieceToDisplay(curPiece);\n\n board[tempHeight][tempWidth] = displayPiece[0][0];\n board[tempHeight][tempWidth + 1] = displayPiece[0][1];\n board[tempHeight][tempWidth + 2] = displayPiece[0][2];\n board[tempHeight + 1][tempWidth] = displayPiece[1][0];\n board[tempHeight + 1][tempWidth + 1] = displayPiece[1][1];\n board[tempHeight + 1][tempWidth + 2] = displayPiece[1][2];\n board[tempHeight + 2][tempWidth] = displayPiece[2][0];\n board[tempHeight + 2][tempWidth + 1] = displayPiece[2][1];\n board[tempHeight + 2][tempWidth + 2] = displayPiece[2][2];\n Arrays.fill(board[tempHeight + 3], EMPTY);\n }\n }\n }\n\n // convert the completed char[][] to the final string[]\n return finalBoard(board, totalPieces, totalPieces - countPieces);\n }", "public void reset() {\n for (int r = 0; r < size; r++) {\n for (int c = 0; c < size; c++) {\n board[r][c] = null;\n }\n }\n }", "public void setHiddenPiece() {\n for(int j = 0; j < 12; j++) {\n controller.getBoard().setPiece(new Forbidden(), 0, j);\n Cell[0][j] = new JButton();\n }\n for(int j = 0; j < 12; j++) {\n controller.getBoard().setPiece(new Forbidden(), 9, j);\n Cell[9][j] = new JButton();\n }\n for(int j = 0; j < 10; j++) {\n controller.getBoard().setPiece(new Forbidden(), j, 0);\n Cell[j][0] = new JButton();\n }\n for(int j = 0; j < 10; j++) {\n controller.getBoard().setPiece(new Forbidden(), j, 11);\n Cell[j][11] = new JButton();\n }\n }", "void clearUndo() {\r\n while (!listOfBoards.isEmpty()) {\r\n listOfMoves.pop();\r\n listOfBoards.pop();\r\n }\r\n }", "public void resetBoard(){\r\n for(int i = 0;i<6;i++){ //empty board \r\n for (int j = 0; j < 7; j++) {\r\n boardRep[i][j] = 0;\r\n }\r\n }\r\n \r\n for (int i = 0; i < 7; i++) { // set column heights to 0\r\n currentFilled[i] = 0;\r\n }\r\n \r\n blackToPlay = true; //black goes first for now\r\n refreshDisplay(); \r\n \r\n }", "private void cleanUpTile(ArrayList<Move> moves)\n {\n for(Move m1 : moves)\n {\n gb.getTile(m1.getX(),m1.getY()).setStyle(null);\n gb.getTile(m1.getX(),m1.getY()).setOnMouseClicked(null);\n }\n gb.setTurn(gb.getTurn() + 1);\n }", "public void reset()\n {\n playersPiece = -1;\n king = false;\n empty = true;\n setTileColor(-1);\n }", "public void initChessBoardManually() {\r\n\t\tstatus.setStatusEdit();\r\n\t\tclearBoard();\r\n\t\tthis.setBoardEnabled(true);\r\n\t\tfor (int i=0; i<8*8; i++) {\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setBorderPainted(false);\r\n\t\t}\r\n\t\tswitcher.setEnabled(true);\r\n\t\tconfirm.setEnabled(true);\r\n\t\tt.setText(\"<html>Please choose position to put the pieces.<br>Right click to set/cancel King flag</html>\");\r\n\t}", "public void initPieces() {\r\n\t\tfor (int i = 0; i < 64; i++) {\r\n\t\t\tif (i < 12) {\r\n\t\t\t\tblackPieces[i] = new ChessPiece(\"black\", \"\");\r\n\t\t\t\tblackPieces[i].setBackground(Color.BLACK);\r\n\t\t\t\tblackPieces[i].addMouseMotionListener(this);\r\n\t\t\t\tblackPieces[i].addMouseListener(this);\r\n\t\t\t\tblackPieces[i].setText(null);\r\n\t\t\t\twhitePieces[i] = new ChessPiece(\"white\", \"\");\r\n\t\t\t\twhitePieces[i].setBackground(Color.WHITE);\r\n\t\t\t\twhitePieces[i].addMouseMotionListener(this);\r\n\t\t\t\twhitePieces[i].addMouseListener(this);\r\n\t\t\t\twhitePieces[i].setText(null);\r\n\t\t\t}\r\n\t\t\tspacePieces[i] = new ChessPiece(\"empty\", \"\");\r\n\t\t\tspacePieces[i].setEnabled(false);\r\n\t\t\tspacePieces[i].setVisible(false);\r\n\t\t\tspacePieces[i].setText(null);\r\n\t\t}\r\n\t}", "@Override\n\tpublic int deleteBoard(int num) {\n\t\treturn 0;\n\t}", "public void clearBoard() {\r\n int i, j;\r\n for (i = 1; i < yMax; i++) {\r\n for (j = 2; j < xMax; j += 2){\r\n grid[i][j] = ' ';\r\n }\r\n }\r\n }", "public void reFormatPieceLayer() {\r\n\t\tbody.removeAll();\r\n\t\tfor (int i = 0; i < 8 * 8; i++) {\r\n\t\t\tChessPiece tmpPiece = piece.get(order[i]);\r\n\t\t\tif (tmpPiece == null) {\r\n\t\t\t\tspacePieces[i].position = order[i];\r\n\t\t\t\tpiece.put(order[i], spacePieces[i]);\r\n\t\t\t\tbody.add(spacePieces[i]);\r\n\t\t\t} else {\r\n\t\t\t\tpiece.put(order[i], tmpPiece);\r\n\t\t\t\tbody.add(tmpPiece);\r\n\t\t\t}\r\n\t\t}\r\n\t\tbody.repaint();\r\n\t}", "public void populateLists() {\n\t\tfor (int row = 0; row < 8; row++) {\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tif (board[row][col] != null && board[row][col].isWhite())\n\t\t\t\t\twhitePieces.add(board[row][col]);\n\t\t\t\t\t//whitePieces.add(board[row][col]);\n\t\t}\n\t\tfor (int row = 0; row < 8; row++) {\n\t\t\tfor (int col = 0; col < 8; col++){\n\t\t\t\tif (board[row][col] != null && !board[row][col].isWhite())\n\t\t\t\t\tblackPieces.add(board[row][col]);}\n\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void reset() {\n\t\tfor (int i = 0; i < _board.length; i++)\n for (int j = 0; j < _board[i].length; j++)\n \t_board[i][j] = null;\n\n\t\t_columnFull = new HashSet<Integer>();\n\t\t_lastPosition = new HashMap<Integer,Integer>();\n\t}", "public void CleanScr() {\n\t\tint a = 0;\n\t\twhile (a < 16) {\n\t\t\tR0[a].setSelected(false);\n\t\t\tR1[a].setSelected(false);\n\t\t\tR2[a].setSelected(false);\n\t\t\tR3[a].setSelected(false);\n\t\t\tX1[a].setSelected(false);\n\t\t\tX2[a].setSelected(false);\n\t\t\tX3[a].setSelected(false);\n\t\t\tMAR[a].setSelected(false);\n\t\t\tMBR[a].setSelected(false);\n\t\t\tIR[a].setSelected(false);\n//\t\t\tMem[a].setSelected(false);\n\t\t\ta++;\n\t\t}\n\t\tint b = 0;\n\t\twhile (b < 12) {\n\t\t\tPC[b].setSelected(false);\n\t\t\tb++;\n\t\t}\n\t}", "void generateBoard(){\r\n rearrangeSolution();\r\n makeInitial();\r\n }", "public void resetBoard() {\n\t\tplayerTurn = 1;\n\t\tgameStart = true;\n\t\tdispose();\n\t\tplayerMoves.clear();\n\t\tnew GameBoard();\n\t}", "private void copyBoard(Piece[][] board){\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tfor (int j = 0; j < SIZE; j++) {\r\n\t\t\t\tif (board[i][j] != null) {\r\n\t\t\t\t\tthis.board[i][j] = board[i][j].deepCopy();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (board[i][j] == null) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\telse if(this.board[i][j].getPlayer().color == Color.BLACK) {\r\n\t\t\t\t\tthis.black.addElement(this.board[i][j]);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tthis.white.addElement(this.board[i][j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void recolheMao() {\n\t\tcartas[0].visible = false;\n\t\tfor (int i = 4; i <= 15; i++) {\n\t\t\tCartaVisual c = cartas[i];\n\t\t\tif ((c.top != topBaralho) || (c.left != leftBaralho)) {\n\t\t\t\tc.movePara(leftBaralho, topBaralho, 100);\n\t\t\t\tc.setCarta(null);\n\t\t\t\tc.descartada = false;\n\t\t\t\tcartasJogadas.remove(c);\n\t\t\t}\n\t\t}\n\t}", "public Piece[][] createStandardChessboard(Player whitePlayer, Player blackPlayer) {\t\t\r\n\t\tPiece[][] start_board = {\r\n\t\t\t\t{new Rook(0,0,blackPlayer), new Knight(1,0,blackPlayer), new Bishop(2,0,blackPlayer), new Queen(3,0,blackPlayer),new King(4,0,blackPlayer), new Bishop(5,0,blackPlayer), new Knight(6,0,blackPlayer), new Rook(7,0,blackPlayer)},\r\n\t\t\t\t{new Pawn(0,1,blackPlayer), new Pawn(1,1,blackPlayer), new Pawn(2,1,blackPlayer), new Pawn(3,1,blackPlayer),new Pawn(4,1,blackPlayer), new Pawn(5,1,blackPlayer), new Pawn(6,1,blackPlayer), new Pawn(7,1,blackPlayer)},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{null, null, null, null,null, null, null, null},\r\n\t\t\t\t{new Pawn(0,6,whitePlayer), new Pawn(1,6,whitePlayer), new Pawn(2,6,whitePlayer), new Pawn(3,6,whitePlayer),new Pawn(4,6,whitePlayer), new Pawn(5,6,whitePlayer), new Pawn(6,6,whitePlayer), new Pawn(7,6,whitePlayer)},\r\n\t\t\t\t{new Rook(0,7,whitePlayer), new Knight(1,7,whitePlayer), new Bishop(2,7,whitePlayer), new Queen(3,7,whitePlayer),new King(4,7,whitePlayer), new Bishop(5,7,whitePlayer), new Knight(6,7,whitePlayer), new Rook(7,7,whitePlayer)}\r\n\t\t};\r\n\t\treturn start_board;\r\n\t}", "private void pieceDropped() {\n for (int i = 0; i < 4; ++i) {\n\n int x = curX + curPiece.x(i);\n int y = curY - curPiece.y(i);\n board[(y * BOARD_WIDTH) + x] = curPiece.getShape();\n }\n//check if any lines can be removed\n removeFullLines();\n//creates a new piece when a piece finished falling\n if (!isFallingFinished) {\n newPiece();\n }\n }", "public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }", "public void clearGame() {\n\t\tthis.turnColor = null;\n\t\tthis.inPlay = false;\n\t\tthis.board = new Board();\n\t\tpieces.get(Chess.Color.WHITE).clear();\n\t\tpieces.get(Chess.Color.BLACK).clear();\n\t\tmoveStack.clear();\n\t}", "private void prepareBoard(){\n gameBoard.arrangeShips();\n }", "public void refactor() {\n this.maxX = SnakeGame.getxSquares();\n this.maxY = SnakeGame.getySquares();\n snakeSquares = new int[this.maxX][this.maxY];\n fillSnakeSquaresWithZeros();\n createStartSnake();\n }", "public void CaptuePiece(int i , int j , int k , int l){\r\n if(GameBoard.get(i,j).getColour() != GameBoard.get(k,l).getColour()){\r\n pos.setPosition(k,l);\r\n GameBoard.get(i,j).capture(pos);\r\n GameBoard.get(k,l).captured();\r\n \r\n\r\n //We need a method to null the (k,l) cell in GameBoard\r\n pos.setPosition(k,l);\r\n GameBoard.setNull(pos);\r\n GameBoard.get(i,j).move(pos); //to move the killer in new cell\r\n\r\n\r\n\r\n }\r\n }", "private void setupBoard(int size) {\n\t\t\n\t\tthis.board = new Disc[size][size];\n\t\t// COMPLETE THIS METHOD\n\t\tDisc currentDisc = getCurrentPlayerDisc();\n\t\tint halfway = (board.length / 2) - 1;\n\t\tint halfwayIncre = halfway + 1;\n\t\t\n\t\t\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\t\n\t\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\t\t\n\t\t\t\tboard[i][j] = null;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n if (currentDisc == Disc.BLACK) {\n\t\t\t\n\t\t\tplaceDiscAt(halfway, halfway);\n\t\t\tplaceDiscAt(halfway, halfwayIncre);\n\t\t\tplaceDiscAt(halfwayIncre, halfwayIncre);\t\t\t\n\t\t\tplaceDiscAt(halfwayIncre, halfway);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tplaceDiscAt(halfway, halfwayIncre);\n\t\t\tplaceDiscAt(halfway, halfway);\n\t\t\tplaceDiscAt(halfwayIncre, halfway);\n\t\t\tplaceDiscAt(halfwayIncre, halfwayIncre);\n\t\t\t\n\t\t} \n\t\t\n\t\t\n\t\t\n\t}", "public static void clearBoard() {\n for (int row = 0; row < SIZE_ROW; row++) {\n for (int col = 0; col < SIZE_COL; col++) {\n board[row][col] = 0;\n }\n }\n }", "public void resetBoard() {\n\t\t\n\t\tfor(int row = 0; row < board.length; row++) {\n\t\t\tfor(int col = 0; col < board[row].length; col++) {\n\t\t\t\t\n\t\t\t\tboard[row][col] = 0;\n\t\t\t}\n\t\t}\n\t}", "public void removePiece() {\n\t\troot.getChildren().clear();\n\t\tthis.piece = null;\n\t\troot.getChildren().add(rectangle);\n\t}", "public void clear() {\n\t\tfor (int i = 0; i < 3; i++)\n\t\t\tfor (int j = 0; j < 3; j++)\n\t\t\t\ttheBoard[i][j] = SPACE_CHAR;\n\t\tmarkCount = 0;\n\t}", "private void clearGrid() {\n\n }", "private void clear() {\n\t\tfor(int i = 0; i < 9; i++){\n\t\t\tfor(int k = 0; k < 9; k++){\n\t\t\t\tfield[i][k].clear();\n\t\t\t\tsudokuBoard.clear();\n\t\t\t}\n\t\t}\n\t}", "public void reset() {\n for (int i = 0; i < numberOfRows; i++ ) {\n for (int j =0; j < numberOfColumns; j++) {\n if (grid[i][j] == LASER) {\n this.Remove(i,j);\n }\n }\n }\n }", "private void removePiece(int row, int col, int storedRow, int storedCol){\r\n int pieceRow = -1;\r\n int pieceCol = -1;\r\n if(col > storedCol && row > storedRow){\r\n pieceRow = row-1;\r\n pieceCol = col-1;\r\n }\r\n if(col > storedCol && row < storedRow){\r\n pieceRow = row+1;\r\n pieceCol = col-1;\r\n }\r\n if(col < storedCol && row > storedRow){\r\n pieceRow = row-1;\r\n pieceCol = col+1;\r\n }\r\n if(col < storedCol && row < storedRow){\r\n pieceRow = row+1;\r\n pieceCol = col+1;\r\n }\r\n checks[pieceRow][pieceCol] = 0;\r\n if(isGame) nextPlayer.subCheck();\r\n }", "public void prepareTheTable() {\n setHiddenPiece();\n BGrave = new JButton[12];\n RGrave = new JButton[12];\n for(int i = 0; i < 12; i++) {\n RGrave[i] = new JButton(controller.getPlayer(2).getMyCollection().getPiece(i).getIcon());\n controller.getPlayer(2).getMyCollection().setPiece(i);\n RGrave[i].setToolTipText(\"0/\" + (new Collection('R')).getQuantity(i));\n \n BGrave[i] = new JButton(controller.getPlayer(1).getMyCollection().getPiece(i).getIcon());\n controller.getPlayer(1).getMyCollection().setPiece(i);\n BGrave[i].setToolTipText(\"0/\" + (new Collection('B')).getQuantity(i));\n }\n NJPanel.removeAll();\n NJPanel.setLayout(new GridLayout(10, 12));\n for(int i = 1; i < 9; i++) {\n for(int j = 1; j < 11; j++) {\n if(controller.getBoard().getPiece(i, j) instanceof MovablePiece) {\n MovablePiece tmp = (MovablePiece) controller.getBoard().getPiece(i, j);\n if(tmp.isMoving(controller.getBoard().getTable(), i, j) == false) { \n Cell[i][j].setEnabled(false);\n } else {\n Cell[i][j].setEnabled(true);\n }\n }\n }\n } \n for(int j = 0; j < 12; j++) {\n NJPanel.add(BGrave[j]);\n }\n JButton tmp;\n for(int i = 1; i < 9; i++) {\n tmp = new JButton();\n tmp.setVisible(false);\n NJPanel.add(tmp);\n for(int j = 1; j < 11; j++) {\n if(i < 4) {\n Cell[i][j].setIcon(new ImageIcon(\"pieces\\\\blueHidden.png\"));\n Cell[i][j].setEnabled(false);\n }\n if(!(controller.getBoard().getPiece(i, j) instanceof Trap) && !(controller.getBoard().getPiece(i, j) instanceof Flag)) {\n Cell[i][j].removeActionListener(mixSorting);\n Cell[i][j].removeActionListener(setSorting);\n Cell[i][j].addActionListener(handler);\n } else {\n Cell[i][j].setEnabled(false);\n }\n NJPanel.add(Cell[i][j]);\n }\n tmp = new JButton();\n tmp.setVisible(false);\n NJPanel.add(tmp);\n }\n for(int j = 0; j < 12; j++) {\n NJPanel.add(RGrave[j]);\n }\n add(NJPanel);\n }", "private void resetBoard() {\n\t\tGameScores.ResetScores();\n\t\tgameTime = SystemClock.elapsedRealtime();\n\t\t\n\t}", "private void completeGameBoard() {\n for (int i = 0; i < row; i++) {\n for (int j = 0; j < column; j++) {\n if (game[i][j].equals(open)) {\n int replaceOpen = getNearbyMines(i, j); //calls to get nearby mines\n game[i][j] = String.valueOf(replaceOpen);\n }\n }\n }\n }", "@Override\r\n\tpublic void reset() {\r\n\t\tfor(int i = 0; i < rows_size; i++) {\r\n\t\t\tfor(int j = 0; j < columns_size; j++)\r\n\t\t\t\tgame[i][j].Clear();\r\n\t\t}\r\n\t\tcomputerTurn();\r\n\t\tcomputerTurn();\r\n\t\tfreeCells = rows_size*columns_size - 2;\r\n\t\ttakenCells = 2;\r\n\t}", "private void undoPosition() {\r\n String undoingBoard = listOfBoards.pop();\r\n listOfMoves.pop();\r\n for (Square sq : map.keySet()) {\r\n char piece = undoingBoard.charAt(sq.index() + 1);\r\n if (piece == '-') {\r\n map.put(sq, EMPTY);\r\n }\r\n if (piece == 'B') {\r\n map.put(sq, BLACK);\r\n }\r\n if (piece == 'W') {\r\n map.put(sq, WHITE);\r\n }\r\n if (piece == 'K') {\r\n map.put(sq, KING);\r\n }\r\n board[sq.col()][sq.row()] = map.get(sq);\r\n }\r\n _moveCount -= 1;\r\n _turn = _turn.opponent();\r\n _repeated = false;\r\n }", "public static void removePieceList(String piece)\n\t{\n\t\tfor(int loop = 0; loop < 32; loop++)\n\t\t{\n\t\t\tif(pieceList[loop] == piece)\n\t\t\t{\n\t\t\t\tpieceList[loop] = \"\";\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7229526", "0.7143044", "0.7129801", "0.7033402", "0.68127084", "0.67741156", "0.6613575", "0.6603037", "0.6538431", "0.6442157", "0.64259946", "0.63819754", "0.6344033", "0.6338527", "0.63172567", "0.6287836", "0.62625235", "0.6262068", "0.62553155", "0.625018", "0.625018", "0.6248167", "0.62244445", "0.6221442", "0.6187195", "0.61779094", "0.6141911", "0.6113251", "0.6110958", "0.6100174", "0.6099183", "0.6096146", "0.60766894", "0.6072084", "0.60713196", "0.60643667", "0.6064329", "0.6051707", "0.60313565", "0.6023245", "0.60210735", "0.60065824", "0.5990964", "0.59740686", "0.595377", "0.59507906", "0.5945974", "0.5941465", "0.5939717", "0.5932215", "0.59270257", "0.59141505", "0.5900687", "0.58946764", "0.58933866", "0.58919233", "0.5890304", "0.5889788", "0.5873904", "0.5863484", "0.58591807", "0.5858967", "0.58553857", "0.58541214", "0.584409", "0.58350307", "0.5826645", "0.5820253", "0.5791697", "0.5791148", "0.5789725", "0.5769868", "0.5750236", "0.5745613", "0.5744498", "0.57393736", "0.5726972", "0.5706211", "0.56967384", "0.56723076", "0.56722504", "0.56706786", "0.56671154", "0.56649375", "0.56641954", "0.565532", "0.56483096", "0.5640306", "0.5636605", "0.56364715", "0.5634189", "0.5627294", "0.5627171", "0.5623712", "0.5620908", "0.56205785", "0.5613785", "0.56002164", "0.5596873", "0.55966485" ]
0.73818576
0
create datacenter with 2 hosts
private static Datacenter Create_Datacenter(String name){ // creating list of host machine List<Host> hostList = new ArrayList<Host>(); // creating list of CPU for each host machine, In our simulation with choose 1 core per machine List<Pe> peList1 = new ArrayList<Pe>(); int mips = 1000; // computing power of each core // add 1 core to each host machine for (int i =0; i < VM_number; i ++ ) { peList1.add(new Pe(i, new PeProvisionerSimple(mips))); } // configuring host int hostId=0; int ram = 56320; //host memory 40 GB long storage = 10240000; //host storage 10000 GB int bw = 102400; // bandwidth 100 Gbps // create first host machine with 4 cores hostList.add( new Host( hostId, new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList1, new VmSchedulerTimeShared(peList1) ) ); // create another host machine with 1 cores List<Pe> peList2 = new ArrayList<Pe>(); // add 1 core to each host machine for (int i =0; i < VM_number; i ++ ) { peList2.add(new Pe(i, new PeProvisionerSimple(mips))); } hostId++; hostList.add( new Host( hostId, new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList2, new VmSchedulerTimeShared(peList2) ) ); // configuring datacenter String arch = "x86"; // system architecture String os = "Linux"; // operating system String vmm = "Xen"; double time_zone = 10.0; // time zone this resource located double cost = 3.0; // the cost of using processing in this resource double costPerMem = 0.05; // the cost of using memory in this resource double costPerStorage = 0.001; // the cost of using storage in this resource double costPerBw = 0.0; // the cost of using bw in this resource LinkedList<Storage> storageList = new LinkedList<Storage>(); DatacenterCharacteristics characteristics = new DatacenterCharacteristics( arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw); // creating data center Datacenter datacenter = null; try { datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0); } catch (Exception e) { e.printStackTrace(); } return datacenter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Datacenter createDatacenter(String name){\n List<Host> hostList = new ArrayList<Host>();\n\n for (int i=0; i<HostCount; i++){\n\n // 2. A Machine contains one or more PEs or CPUs/Cores.\n List<Pe> peList = new ArrayList<Pe>();\n\n // 3. Create PEs and add these into a list.\n for (int j=0; j<HostCoreCount; j++){\n peList.add(new Pe(j, new PeProvisionerSimple(HostCoreMips)));\n }\n\n\n //in this example, the VMAllocatonPolicy in use is SpaceShared. It means that only one VM\n //is allowed to run on each Pe. As each Host has only one Pe, only one VM can run on each Host.\n hostList.add(\n new Host(\n i,\n new RamProvisionerSimple(HostRam),\n new BwProvisionerSimple(HostBandwidth),\n HostStorage,\n peList,\n new VmSchedulerSpaceShared(peList)\n )\n );\n }\n\n\n // 5. Create a DatacenterCharacteristics object that stores the\n // properties of a data center: architecture, OS, list of\n // Machines, allocation policy: time- or space-shared, time zone\n // and its price (G$/Pe time unit).\n String arch = \"x86\"; // system architecture\n String os = \"Linux\"; // operating system\n String vmm = \"Xen\";\n double time_zone = 10.0; // time zone this resource located\n double cost = 3.0; // the cost of using processing in this resource\n double costPerMem = 0.05;\t\t// the cost of using memory in this resource\n double costPerStorage = 0.001;\t// the cost of using storage in this resource\n double costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n LinkedList<Storage> storageList = new LinkedList<Storage>();\t//we are not adding SAN devices by now\n\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n // 6. Finally, we need to create a PowerDatacenter object.\n Datacenter datacenter = null;\n\n try {\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return datacenter;\n }", "private static Datacenter CreateDataCenter() {\n\t\tList<Pe> peList = new ArrayList<Pe>();\n\t\t//One PE with 1000 Mips\n\t\tPeProvisionerSimple peProvisioner = new PeProvisionerSimple(1000);\n\t\t////Four 1000 MIPS PEs\n\t\tfor (int id = 0; id < 4; id++) {\n\t\t\tPe core = new Pe(id, peProvisioner);\n\t\t\tpeList.add(core);\n\t\t}\n\t\t//Initialize the hosts\n\t\tList<Host> hostList = new ArrayList<Host>();\n\t\t//8 GB RAM\n\t\tint ram = 8000;\n\t\t//1 MPBS network bandwidth\n\t\tint bw = 1000;\n\t\t//100 GB storage\n\t\tlong storage = 100000;\n\t\tfor (int id = 0; id < 4; id++) {\n\t\t\tHost host = new Host(id, new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList,\n\t\t\t\t\tnew VmSchedulerSpaceShared(peList));\n\t\t\thostList.add(host);\n\t\t}\n\t\t//Initialize the data center\n\t\tString architecture = \"x64\";\n\t\tString os = \"Kelly Linux\";\n\t\tString vmm = \"XEN\";\n\t\tdouble timeZone = -4.0;\n\t\tdouble computeCostPerSec = 3.0;\n\t\tdouble costPerMem = 1.0;\n\t\tdouble costPerStorage = 0.05;\n\t\tdouble costPerBW = 0.10;\n\t\tDatacenterCharacteristics datacenterCharacteristics = new DatacenterCharacteristics(architecture, os, vmm,\n\t\t\t\thostList, timeZone, computeCostPerSec, costPerMem, costPerStorage, costPerBW);\n\t\tLinkedList<Storage> SANstorage = new LinkedList<Storage>();\n\t\tDatacenter datacenter = null;\n\t\ttry {\n\t\t\tdatacenter = new Datacenter(\"datacenter0\", datacenterCharacteristics,\n\t\t\t\t\tnew VmAllocationPolicySimple(hostList), SANstorage, 1);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn datacenter;\n\t}", "private static Datacenter createDatacenter(String name) {\n List<Host> hostList = new ArrayList<Host>();\r\n\r\n // 2. A Machine contains one or more PEs or CPUs/Cores.\r\n // In this example, it will have only one core.\r\n List<Pe> peList = new ArrayList<Pe>();\r\n\r\n\r\n // 3. Create PEs and add these into a list.\r\n peList.add(new Pe(0, new PeProvisionerSimple(mips+100))); // need to store Pe id and MIPS Rating\r\n\r\n // 4. Create Host with its id and list of PEs and add them to the list\r\n // of machines\r\n long storage = 1000000; // host storage\r\n\r\n\r\n for (int hostId = 0; hostId < vmNum; hostId++) {\r\n hostList.add(\r\n new Host(\r\n hostId,\r\n new RamProvisionerSimple((int)((ram*1.1)/Constants.MB)),\r\n new BwProvisionerSimple(bw+10),\r\n storage,\r\n peList,\r\n new VmSchedulerTimeShared(peList)\r\n )\r\n ); // This is our machine\r\n }\r\n\r\n\r\n // 5. Create a DatacenterCharacteristics object that stores the\r\n // properties of a data center: architecture, OS, list of\r\n // Machines, allocation policy: time- or space-shared, time zone\r\n // and its price (G$/Pe time unit).\r\n String arch = \"x86\"; // system architecture\r\n String os = \"Linux\"; // operating system\r\n String vmm = \"Xen\";\r\n double time_zone = 10.0; // time zone this resource located\r\n double cost = 3.0; // the cost of using processing in this resource\r\n double costPerMem = 0.05; // the cost of using memory in this resource\r\n double costPerStorage = 0.001; // the cost of using storage in this\r\n // resource\r\n double costPerBw = 0.0; // the cost of using bw in this resource\r\n LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN\r\n // devices by now\r\n\r\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\r\n arch, os, vmm, hostList, time_zone, cost, costPerMem,\r\n costPerStorage, costPerBw);\r\n\r\n // 6. Finally, we need to create a PowerDatacenter object.\r\n Datacenter datacenter = null;\r\n try {\r\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return datacenter;\r\n }", "public void createHost( String hostname );", "protected static WorkflowDVFSDatacenter createDatacenter(String name) {\n List<PowerHost> hostList = new ArrayList<>();\n \n // 2. A Machine contains one or more PEs or CPUs/Cores. Therefore, should\n // create a list to store these PEs before creating\n // a Machine.\n for (int i = 1; i <= 20; i++) {\n List<Pe> peList1 = new ArrayList<>();\n double maxPower = 250; // 250W\n \t\tdouble staticPowerPercent = 0.7; // 70%\n int mips = 1500;\n \n boolean enableDVFS = true; // is the Dvfs enable on the host\n \t\tArrayList<Double> freqs = new ArrayList<>(); // frequencies available by the CPU\n \t\tfreqs.add(59.925); // frequencies are defined in % , it make free to use Host MIPS like we want.\n \t\tfreqs.add(69.93); // frequencies must be in increase order !\n \t\tfreqs.add(79.89);\n \t\tfreqs.add(89.89);\n \t\tfreqs.add(100.0);\n \t\t\n \t\tHashMap<Integer,String> govs = new HashMap<Integer,String>(); // Define wich governor is used by each CPU\n \t\tgovs.put(0, \"ondemand\"); // CPU 1 use OnDemand Dvfs mode\n \t\t//govs.put(0, \"powersave\");\n \t\t//govs.put(0, \"performance\");\n \t\t//govs.put(0, \"conservative\");\n \t\t\n \t\tConfigDvfs = new DvfsDatas();\n\t\t\tHashMap<String,Integer> tmp_HM_OnDemand = new HashMap<>();\n\t\t\ttmp_HM_OnDemand.put(\"up_threshold\", 95);\n\t\t\ttmp_HM_OnDemand.put(\"sampling_down_factor\", 100);\n\t\t\tHashMap<String,Integer> tmp_HM_Conservative = new HashMap<>();\n\t\t\ttmp_HM_Conservative.put(\"up_threshold\", 80);\n\t\t\ttmp_HM_Conservative.put(\"down_threshold\", 20);\n\t\t\ttmp_HM_Conservative.put(\"enablefreqstep\", 0);\n\t\t\ttmp_HM_Conservative.put(\"freqstep\", 5);\n\t\t\tHashMap<String,Integer> tmp_HM_UserSpace = new HashMap<>();\n\t\t\ttmp_HM_UserSpace.put(\"frequency\", 3);\n\t\t\tConfigDvfs.setHashMapOnDemand(tmp_HM_OnDemand);\n\t\t\tConfigDvfs.setHashMapConservative(tmp_HM_Conservative);\n\t\t\tConfigDvfs.setHashMapUserSpace(tmp_HM_UserSpace);\n \t\t\n // 3. Create PEs and add these into the list.\n //for a quad-core machine, a list of 4 PEs is required:\n peList1.add(new Pe(0, new PeProvisionerSimple(mips), freqs, govs.get(0), ConfigDvfs)); // need to store Pe id and MIPS Rating\n //peList1.add(new Pe(1, new PeProvisionerSimple(mips), freqs, govs.get(0), ConfigDvfs));//\n \n int hostId = i;\n int ram = 2048; //host memory (MB)\n long storage = 1000000; //host storage\n int bw = 10000;\n hostList.add(\n \tnew PowerHost(\n \thostId,\n \tnew RamProvisionerSimple(ram),\n \tnew BwProvisionerSimple(bw),\n \tstorage,\n \tpeList1,\n \tnew VmSchedulerTimeShared(peList1),\n \tnew PowerModelSpecPower_BAZAR(peList1),\n\t\t\t\t\tfalse,\n\t\t\t\t\tenableDVFS\n )\n ); \t// This is our first machine\n \t//hostId++;\n }\n \n // 4. Create a DatacenterCharacteristics object that stores the\n // properties of a data center: architecture, OS, list of\n // Machines, allocation policy: time- or space-shared, time zone\n // and its price (G$/Pe time unit).\n String arch = \"x86\"; \t\t// system architecture\n String os = \"Linux\"; \t// operating system\n String vmm = \"Xen\";\n double time_zone = 10.0; // time zone this resource located\n double cost = 3.0; // the cost of using processing in this resource\n double costPerMem = 0.05;\t\t// the cost of using memory in this resource\n double costPerStorage = 0.1;\t// the cost of using storage in this resource\n double costPerBw = 0.1;\t\t\t// the cost of using bw in this resource\n LinkedList<Storage> storageList = new LinkedList<>();\t//we are not adding SAN devices by now\n WorkflowDVFSDatacenter datacenter = null;\n \n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n \n // 5. Finally, we need to create a storage object.\n /**\n * The bandwidth within a data center in MB/s.\n */\n int maxTransferRate = 15; // the number comes from the futuregrid site, you can specify your bw\n \n try {\n // Here we set the bandwidth to be 15MB/s\n HarddriveStorage s1 = new HarddriveStorage(name, 1e12);\n s1.setMaxTransferRate(maxTransferRate);\n storageList.add(s1);\n datacenter = new WorkflowDVFSDatacenter(name, characteristics, new PowerVmAllocationPolicySimpleWattPerMipsMetric(hostList), storageList, 0.01);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return datacenter;\n }", "public void initAsg(){\n\t\tConfigure conf = Configure.getConf();\n\t\tint min = conf.getMaxNum();\n\t\t\n\t\t//launch min number of instances\n\t\tTimeManager.PrintCurrentTime(\"Init Cluster, launching %d DC\\n\", min);\n\t\tfor(int i=0; i < min; i++){\n\t\t\tConnToDC dc = nova.launchOne(conf.getInatanceName());\n\t\t\tif(dc != null){\n\t\t\t\tdcList.offer(dc);\n\t\t\t\tlb.addDC(dc.getIp());\n\t\t\t\tTimeManager.PrintCurrentTime(\"Successfully launch 1 DC [%s:%s]\\n\", \n\t\t\t\t\t\tdc.getIp(), dc.getId());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ;\n\t}", "Cloud createCloud();", "public void newHost(Host aHost);", "@Override\n\tpublic void startDatacenters() throws Exception {\n\t}", "public DhcpHost() {\n }", "@Override\n\tpublic void execute(DelegateExecution execution) throws Exception {\n\t\tString ip = (String) execution.getVariable(\"ip\");\n\t\tString serviceHome = (String) execution.getVariable(\"serviceHome\");\n\t\tString coRoot = (String) execution.getVariable(\"coRoot\");\n\t\tString customizationId = (String) execution.getVariable(\"customizationId\");\n\t\tHashMap<String, String> data = toscaService.getCloudData(customizationId);\n\n\t\t// TODO al momento è vuoto perchè non lo leggiamo da nulla valutare se\n\t\t// leggerlo dinamicamente o da file di configurazione\n\t\tString privateKeyPath = (String) execution.getVariable(\"privateKeyPath\");\n\t\tString passphrase = (String) execution.getVariable(\"passphrase\");\n\n\t\t// prepare the certificates\n\t\tshellCert(serviceHome, caPath, data.get(\"vmname\"), ip, caPassword);\n\t\t// send the key\n\t\ttransferFile(serviceHome, \"key.pem\", privateKeyPath, passphrase, ip);\n\t\t// send the cert\n\t\ttransferFile(serviceHome, \"cert.pem\", privateKeyPath, passphrase, ip);\n\n\t\t// now that all the pieces are in the machine we can join it to swarm\n\t\tString remote_command = \"systemctl start docker && /usr/bin/docker run -itd --name=swarm-agent --expose=2376 -e SWARM_HOST=:2376 swarm join --advertise=\"\n\t\t\t\t+ ip + \":\" + dockerPort + \" consul://\" + hostip + \":8500\";\n\n\t\tProperties config = new Properties();\n\t\tconfig.put(\"StrictHostKeyChecking\", \"no\"); // without this it cannot\n\t\t\t\t\t\t\t\t\t\t\t\t\t// connect because the host\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key verification fails\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the right way would be to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// somehow get the server\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key and add it to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// trusted keys\n\t\t\t\t\t\t\t\t\t\t\t\t\t// jsch.setKnownHosts()\n\t\t\t\t\t\t\t\t\t\t\t\t\t// https://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/JSch.html#setKnownHosts-java.lang.String-\n\t\t\t\t\t\t\t\t\t\t\t\t\t// see also\n\t\t\t\t\t\t\t\t\t\t\t\t\t// http://stackoverflow.com/a/32858953/28582\n\t\tJSch jsch = new JSch();\n\t\tjsch.addIdentity(privateKeyPath, passphrase);\n\n\t\tSession session = jsch.getSession(ROOT_USER, ip, SSH_PORT);\n\t\tsession.setConfig(config);\n\t\tsession.connect();\n\n\t\tChannelExec channel = (ChannelExec) session.openChannel(\"exec\");\n\t\tint exitStatus = sendCommand(remote_command, channel);\n\t\tlog.debug(\"Command: [\" + remote_command + \"]\");\n\t\tif (exitStatus != 0) {\n\t\t\tlog.debug(\"FAILED - exit status: \" + exitStatus);\n\t\t} else {\n\t\t\tlog.debug(\"Executed successfully\");\n\t\t}\n\t\tchannel.disconnect();\n\t\tsession.disconnect();\n\n\t\tlog.debug(\"in DeployDockerSwarm\");\n\t\t// toscaService.getNodeType(\"\");\n\t\t// dockerService.addMachine(ip, 2376); //SSL\n\t\tString clusterToken = dockerService.addMachine(swarmIp, Integer.parseInt(swarmPort)); // no SSL\n\t\texecution.setVariable(\"clusterToken\", clusterToken);\n\t\tString clusterInfo = dockerService.clusterDetail(clusterToken);\n\t}", "public static void createCacheServer1() throws Exception {\n ds = (new ClearGlobalDUnitTest()).getSystem(props);\n cache = CacheFactory.create(ds);\n AttributesFactory factory = new AttributesFactory();\n factory.setScope(Scope.GLOBAL);\n RegionAttributes attr = factory.create();\n region = cache.createRegion(REGION_NAME, attr);\n\n }", "public void createHostSet(String clustName, String hostName) throws Exception {\n _log.info(\"3PARDriver:createHostSet enter\");\n ClientResponse clientResp = null;\n String body = \"{\\\"name\\\": \\\"\" + clustName + \"\\\", \\\"setmembers\\\": [\\\"\" + hostName + \"\\\"]}\";\n _log.info(\"3PARDriver: createHostSet body is {}\", body);\n \n try {\n clientResp = post(URI_HOSTSETS, body);\n if (clientResp == null) {\n _log.error(\"3PARDriver:There is no response from 3PAR\");\n throw new HP3PARException(\"There is no response from 3PAR\");\n } else if (clientResp.getStatus() != 201) {\n String errResp = getResponseDetails(clientResp);\n throw new HP3PARException(errResp);\n } else {\n String responseString = getHeaderFieldValue(clientResp, \"Location\");\n _log.info(\"3PARDriver:createHostSet 3PAR response is {}\", responseString);\n }\n } catch (Exception e) {\n throw e;\n } finally {\n if (clientResp != null) {\n clientResp.close();\n }\n _log.info(\"3PARDriver:createHostSet leave\");\n } //end try/catch/finally\n }", "public SubTaskGroup createStartYbcTasks(Collection<NodeDetails> nodes) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleClusterServerCtl\");\n for (NodeDetails node : nodes) {\n AnsibleClusterServerCtl.Params params = new AnsibleClusterServerCtl.Params();\n UserIntent userIntent = taskParams().getClusterByUuid(node.placementUuid).userIntent;\n // Add the node name.\n params.nodeName = node.nodeName;\n // Add the universe uuid.\n params.setUniverseUUID(taskParams().getUniverseUUID());\n // Add the az uuid.\n params.azUuid = node.azUuid;\n // The service and the command we want to run.\n params.process = \"controller\";\n params.command = \"start\";\n params.placementUuid = node.placementUuid;\n // Set the InstanceType\n params.instanceType = node.cloudInfo.instance_type;\n params.useSystemd = userIntent.useSystemd;\n // sshPortOverride, in case the passed imageBundle has a different port\n // configured for the region.\n params.sshPortOverride = node.sshPortOverride;\n // Create the Ansible task to get the server info.\n AnsibleClusterServerCtl task = createTask(AnsibleClusterServerCtl.class);\n task.initialize(params);\n // Add it to the task list.\n subTaskGroup.addSubTask(task);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "public static void main(String[] args) {\n\t\tint numUser = 1;\n\t\tCalendar cal = Calendar.getInstance();\n\t\tboolean traceFlag = false;\n\t\tCloudSim.init(numUser, cal, traceFlag);\n\t\t// TODO Create the data center and define the the policies for the allocating and scheduling\n\t\tDatacenter datacenter = CreateDataCenter();\n\t\t// TODO Create the data center broker\n\t\tDatacenterBroker datacenterBroker = CreateDataCenterBroker();\n\t\t// TODO Create Cloudlet\n\t\tList<Cloudlet> cloudletList = new ArrayList<Cloudlet>();\n\t\t//Try to set the random number for the cloudlet length\n\t\tlong cloudletLength = 40000;\n\t\tint pesNumber = 1;\n\t\tlong cloudletFileSize = 300;\n\t\tlong cloudletOutputSize = 400;\n\t\tUtilizationModel utilizationModelCpu = new UtilizationModelFull();\n\t\tUtilizationModel utilizationModelRam = new UtilizationModelFull();\n\t\tUtilizationModel utilizationModelBw = new UtilizationModelFull();\n\t\tfor (int cloudletId = 0; cloudletId < 40; cloudletId++) {\n\t\t\tCloudlet cloudlet = new Cloudlet(cloudletId, cloudletLength, pesNumber, cloudletFileSize, cloudletOutputSize,\n\t\t\t\t\tutilizationModelCpu, utilizationModelRam, utilizationModelBw);\n\t\t\tcloudlet.setUserId(datacenterBroker.getId());\n\t\t\tcloudletList.add(cloudlet);\n\t\t}\n\t\t// TODO Create Virtual Machines and define the Procedure for task scheduling algorithm\n\t\tList<Vm> vmList = new ArrayList<Vm>();\n\t\tint userId = 0;\n\t\tdouble mips = 1000;\n\t\tint numberOfPes = 1;\n\t\tint ram = 2000;\n\t\tlong bandwidth = 1000;\n\t\tlong diskSize = 20000;\n\t\tString vmm = \"XEN\";\n\t\tCloudletScheduler cloudletScheduler = new CloudletSchedulerTimeShared();\n\t\tfor (int id = 0; id < 10; id++) {\n\t\t\tVm virtualMachine = new Vm(id, datacenterBroker.getId(), mips, numberOfPes, ram, bandwidth, diskSize, vmm,\n\t\t\t\t\tcloudletScheduler);\n\t\t\tvmList.add(virtualMachine);\n\t\t}\n\t\tdatacenterBroker.submitCloudletList(cloudletList);\n\t\tdatacenterBroker.submitVmList(vmList);\n\t\t// TODO Implement the Power classes\n\t\tCloudSim.startSimulation();\n\t\tList<Cloudlet> finalCloudletExecutionResults = datacenterBroker.getCloudletReceivedList();\n\t\tCloudSim.stopSimulation();\n\t\t// TODO Test the demo and Print the result\n\t\tfor (Cloudlet cloudlet : finalCloudletExecutionResults) {\n\t\t\tLog.printLine(\"Cloudlet: \" + cloudlet.getCloudletId() + \" VM: \" + cloudlet.getVmId() + \n\t\t\t\t\t\" Status: \" + cloudlet.getStatus() + \" Execution Time: \" + cloudlet.getActualCPUTime() + \n\t\t\t\t\t\" Start Time \" + cloudlet.getExecStartTime() + \" Finished Time: \" + cloudlet.getFinishTime());\n\t\t\tLog.printLine(\"----------------------------------------------------------------------------------------------------\");\n\t\t}\n\t}", "private static DatacenterBroker createBroker(){\n\n\t\tDatacenterBroker broker = null;\n\t\ttry {\n\t\t\tbroker = new DatacenterBroker(\"Broker\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\treturn broker;\n\t}", "private void createClusterForAks(ProvisionRequest provisionRequest, String processID) {\n\t\tif (\"Y\".equals(provisionRequest.getMonitoringEnabled())) {\n\t\t\tprovisionRequest.setKubeMonitoring(\"Grafana\");\n\t\t}\n\t\tstartCreateClusterTaskForAks(provisionRequest);\n\t}", "@Override\n @BeforeMethod(alwaysRun=true)\n public boolean testSetUp()\n throws Exception\n {\n ifolder = new Folder(connectAnchor);\n idvs = new DistributedVirtualSwitch(connectAnchor);\n ihs = new HostSystem(connectAnchor);\n\n // get a standalone hostmors\n // We need at at least 2 hostmors\n hostMors = ihs.getAllHosts(VersionConstants.ESX4x, HostSystemConnectionState.CONNECTED);\n authentication = new AuthorizationManager(connectAnchor);\n Assert.assertTrue(hostMors.size() >= 2, \"Unable to find two hosts\");\n\n Set<ManagedObjectReference> hostSet = hostMors.keySet();\n Iterator<ManagedObjectReference> hostIterator = hostSet.iterator();\n if (hostIterator.hasNext()) {\n hostMor1 = hostIterator.next();\n srcHostProfile1 = NetworkResourcePoolHelper.extractHostConfigSpec(\n connectAnchor, ProfileConstants.SRC_PROFILE + getTestId(),\n hostMor1);\n }\n if (hostIterator.hasNext()) {\n hostMor2 = hostIterator.next();\n srcHostProfile2 = NetworkResourcePoolHelper.extractHostConfigSpec(\n connectAnchor, ProfileConstants.SRC_PROFILE + getTestId()\n + \"-1\", hostMor2);\n }\n\n // create the dvs\n dvsMor = ifolder.createDistributedVirtualSwitch(\"dvs\",\n DVSTestConstants.VDS_VERSION_41);\n Assert.assertNotNull(dvsMor, \"DVS created\", \"DVS not created\");\n\n // enable netiorm\n Assert.assertTrue(idvs.enableNetworkResourceManagement(dvsMor, true),\n \"Netiorm not enabled\");\n\n Assert.assertTrue(NetworkResourcePoolHelper.isNrpEnabled(connectAnchor,\n dvsMor), \"NRP enabled on the dvs\",\n \"NRP is not enabled on the dvs\");\n\n // Extract the network resource pool related to the vm from the dvs\n nrp = idvs.extractNetworkResourcePool(dvsMor, DVSTestConstants.NRP_VM);\n\n // set the values in the config spec\n setNrpConfigSpec();\n authHelper = new AuthorizationHelper(connectAnchor, getTestId(), false,\n data.getString(TestConstants.TESTINPUT_USERNAME),\n data.getString(TestConstants.TESTINPUT_PASSWORD));\n authHelper.setPermissions(dvsMor, DVSWITCH_RESOURCEMANAGEMENT, testUser,\n false);\n return authHelper.performSecurityTestsSetup(testUser);\n\n }", "@Test\n\tpublic void createCluster() throws KeeperException, InterruptedException {\n\n\t\tclusterManager.createCluster(clusterResourceName);\n\n\t}", "CreateClusterResult createCluster(CreateClusterRequest createClusterRequest);", "public SubTaskGroup createStartTServersTasks(Collection<NodeDetails> nodes) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleClusterServerCtl\");\n for (NodeDetails node : nodes) {\n AnsibleClusterServerCtl.Params params = new AnsibleClusterServerCtl.Params();\n UserIntent userIntent = taskParams().getClusterByUuid(node.placementUuid).userIntent;\n // Add the node name.\n params.nodeName = node.nodeName;\n // Add the universe uuid.\n params.setUniverseUUID(taskParams().getUniverseUUID());\n // Add the az uuid.\n params.azUuid = node.azUuid;\n // The service and the command we want to run.\n params.process = \"tserver\";\n params.command = \"start\";\n params.placementUuid = node.placementUuid;\n // Set the InstanceType\n params.instanceType = node.cloudInfo.instance_type;\n params.useSystemd = userIntent.useSystemd;\n // Create the Ansible task to get the server info.\n AnsibleClusterServerCtl task = createTask(AnsibleClusterServerCtl.class);\n task.initialize(params);\n // Add it to the task list.\n subTaskGroup.addSubTask(task);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "public void setup(){\n this.cluster = Cluster.builder().addContactPoint(\"127.0.0.1\").build();\n this.session = this.cluster.connect(\"demo\");\n }", "private EnsembleProvider buildProvider(Properties properties) {\n //String servers = properties.getProperty(\"host.rest.servers\"); //hosts.servers = 127.0.0.1,127.0.0.2\n \tString servers = \"192.168.31.10\"; //hosts.servers = 127.0.0.1,127.0.0.2\n if (servers == null || servers.isEmpty()) {\n throw new IllegalArgumentException(\"host.servers cant be empty\");\n }\n //List<String> hostnames = Arrays.asList(servers.split(\",\"));\n List<String> hostnames = Arrays.asList(\"192.168.31.10\");\n //String port = properties.getProperty(\"host.rest.port\");\n String port = \"2181\";\n Integer restPort = 80; //default\n if (port != null) {\n restPort = Integer.valueOf(port);\n }\n //final String backupAddress = properties.getProperty(\"host.backup\");//127.0.0.1:2181\n final String backupAddress = \"127.0.0.1:2181\";//127.0.0.1:2181\n //if network is error,you should sepcify a backup zk-connectString\n Exhibitors exhibitors = new Exhibitors(hostnames, restPort, new Exhibitors.BackupConnectionStringProvider() {\n @Override\n public String getBackupConnectionString() throws Exception {\n return backupAddress;\n }\n });\n //rest,as meaning of getting fresh zk-connectString list.\n ExhibitorRestClient restClient = new DefaultExhibitorRestClient();\n //String restUriPath = properties.getProperty(\"host.rest.path\");\n //String period = properties.getProperty(\"host.rest.period\");\n String restUriPath = properties.getProperty(\"host.rest.path\");\n String period = properties.getProperty(\"host.rest.period\");\n Integer pollingMs = 180000; //3 min\n if (period != null) {\n pollingMs = Integer.valueOf(period);\n }\n return new ExhibitorEnsembleProvider(exhibitors, restClient, restUriPath, pollingMs, new RetryNTimes(10, 1000));\n }", "protected void createAndRunAServiceInGroup(String group) throws RunNodesException {\n ImmutableMap<String, String> userMetadata = ImmutableMap.of(\"test\", group);\n ImmutableSet<String> tags = ImmutableSet.of(group);\n Stopwatch watch = Stopwatch.createStarted();\n template = buildTemplate(client.templateBuilder());\n template.getOptions().inboundPorts(22, 8080).blockOnPort(22, 300).userMetadata(userMetadata).tags(tags);\n NodeMetadata node = getOnlyElement(client.createNodesInGroup(group, 1, template));\n long createSeconds = watch.elapsed(TimeUnit.SECONDS);\n final String nodeId = node.getId();\n //checkUserMetadataContains(node, userMetadata);\n //checkTagsInNodeEquals(node, tags);\n getAnonymousLogger().info(\n format(\"<< available node(%s) os(%s) in %ss\", node.getId(), node.getOperatingSystem(), createSeconds));\n watch.reset().start();\n client.runScriptOnNode(nodeId, JettyStatements.install(), nameTask(\"configure-jetty\"));\n long configureSeconds = watch.elapsed(TimeUnit.SECONDS);\n getAnonymousLogger().info(\n format(\n \"<< configured node(%s) with %s and jetty %s in %ss\",\n nodeId,\n exec(nodeId, \"java -fullversion\"),\n exec(nodeId, JettyStatements.version()), configureSeconds));\n trackProcessOnNode(JettyStatements.start(), \"start jetty\", node);\n client.runScriptOnNode(nodeId, JettyStatements.stop(), runAsRoot(false).wrapInInitScript(false));\n trackProcessOnNode(JettyStatements.start(), \"start jetty\", node);\n }", "@Override\n public DataStore initialize(Map<String, Object> dsInfos) {\n final String CAPACITY_IOPS = \"capacityIops\";\n\n String url = (String)dsInfos.get(\"url\");\n Long zoneId = (Long)dsInfos.get(\"zoneId\");\n Long podId = (Long)dsInfos.get(\"podId\");\n Long clusterId = (Long)dsInfos.get(\"clusterId\");\n String storagePoolName = (String)dsInfos.get(\"name\");\n String providerName = (String)dsInfos.get(\"providerName\");\n Long capacityBytes = (Long)dsInfos.get(\"capacityBytes\");\n Long capacityIops = (Long)dsInfos.get(CAPACITY_IOPS);\n String tags = (String)dsInfos.get(\"tags\");\n @SuppressWarnings(\"unchecked\")\n Map<String, String> details = (Map<String, String>)dsInfos.get(\"details\");\n\n if (podId == null) {\n throw new CloudRuntimeException(\"The Pod ID must be specified.\");\n }\n\n if (clusterId == null) {\n throw new CloudRuntimeException(\"The Cluster ID must be specified.\");\n }\n\n String storageVip = SolidFireUtil.getStorageVip(url);\n int storagePort = SolidFireUtil.getStoragePort(url);\n\n if (capacityBytes == null || capacityBytes <= 0) {\n throw new IllegalArgumentException(\"'capacityBytes' must be present and greater than 0.\");\n }\n\n if (capacityIops == null || capacityIops <= 0) {\n throw new IllegalArgumentException(\"'capacityIops' must be present and greater than 0.\");\n }\n\n HypervisorType hypervisorType = getHypervisorTypeForCluster(clusterId);\n\n if (!isSupportedHypervisorType(hypervisorType)) {\n throw new CloudRuntimeException(hypervisorType + \" is not a supported hypervisor type.\");\n }\n\n String datacenter = SolidFireUtil.getValue(SolidFireUtil.DATACENTER, url, false);\n\n if (HypervisorType.VMware.equals(hypervisorType) && datacenter == null) {\n throw new CloudRuntimeException(\"'Datacenter' must be set for hypervisor type of \" + HypervisorType.VMware);\n }\n\n PrimaryDataStoreParameters parameters = new PrimaryDataStoreParameters();\n\n parameters.setType(getStorageType(hypervisorType));\n parameters.setZoneId(zoneId);\n parameters.setPodId(podId);\n parameters.setClusterId(clusterId);\n parameters.setName(storagePoolName);\n parameters.setProviderName(providerName);\n parameters.setManaged(false);\n parameters.setCapacityBytes(capacityBytes);\n parameters.setUsedBytes(0);\n parameters.setCapacityIops(capacityIops);\n parameters.setHypervisorType(hypervisorType);\n parameters.setTags(tags);\n parameters.setDetails(details);\n\n String managementVip = SolidFireUtil.getManagementVip(url);\n int managementPort = SolidFireUtil.getManagementPort(url);\n\n details.put(SolidFireUtil.MANAGEMENT_VIP, managementVip);\n details.put(SolidFireUtil.MANAGEMENT_PORT, String.valueOf(managementPort));\n\n String clusterAdminUsername = SolidFireUtil.getValue(SolidFireUtil.CLUSTER_ADMIN_USERNAME, url);\n String clusterAdminPassword = SolidFireUtil.getValue(SolidFireUtil.CLUSTER_ADMIN_PASSWORD, url);\n\n details.put(SolidFireUtil.CLUSTER_ADMIN_USERNAME, clusterAdminUsername);\n details.put(SolidFireUtil.CLUSTER_ADMIN_PASSWORD, clusterAdminPassword);\n\n if (capacityBytes < SolidFireUtil.MIN_VOLUME_SIZE) {\n capacityBytes = SolidFireUtil.MIN_VOLUME_SIZE;\n }\n\n long lMinIops = 100;\n long lMaxIops = 15000;\n long lBurstIops = 15000;\n\n try {\n String minIops = SolidFireUtil.getValue(SolidFireUtil.MIN_IOPS, url);\n\n if (minIops != null && minIops.trim().length() > 0) {\n lMinIops = Long.parseLong(minIops);\n }\n } catch (Exception ex) {\n LOGGER.info(\"[ignored] error getting Min IOPS: \" + ex.getLocalizedMessage());\n }\n\n try {\n String maxIops = SolidFireUtil.getValue(SolidFireUtil.MAX_IOPS, url);\n\n if (maxIops != null && maxIops.trim().length() > 0) {\n lMaxIops = Long.parseLong(maxIops);\n }\n } catch (Exception ex) {\n LOGGER.info(\"[ignored] error getting Max IOPS: \" + ex.getLocalizedMessage());\n }\n\n try {\n String burstIops = SolidFireUtil.getValue(SolidFireUtil.BURST_IOPS, url);\n\n if (burstIops != null && burstIops.trim().length() > 0) {\n lBurstIops = Long.parseLong(burstIops);\n }\n } catch (Exception ex) {\n LOGGER.info(\"[ignored] error getting Burst IOPS: \" + ex.getLocalizedMessage());\n }\n\n if (lMinIops > lMaxIops) {\n throw new CloudRuntimeException(\"The parameter '\" + SolidFireUtil.MIN_IOPS + \"' must be less than or equal to the parameter '\" + SolidFireUtil.MAX_IOPS + \"'.\");\n }\n\n if (lMaxIops > lBurstIops) {\n throw new CloudRuntimeException(\"The parameter '\" + SolidFireUtil.MAX_IOPS + \"' must be less than or equal to the parameter '\" + SolidFireUtil.BURST_IOPS + \"'.\");\n }\n\n if (lMinIops != capacityIops) {\n throw new CloudRuntimeException(\"The parameter '\" + CAPACITY_IOPS + \"' must be equal to the parameter '\" + SolidFireUtil.MIN_IOPS + \"'.\");\n }\n\n if (lMinIops > SolidFireUtil.MAX_MIN_IOPS_PER_VOLUME) {\n throw new CloudRuntimeException(\"This volume's Min IOPS cannot exceed \" + NumberFormat.getInstance().format(SolidFireUtil.MAX_MIN_IOPS_PER_VOLUME) + \" IOPS.\");\n }\n\n if (lMaxIops > SolidFireUtil.MAX_IOPS_PER_VOLUME) {\n throw new CloudRuntimeException(\"This volume's Max IOPS cannot exceed \" + NumberFormat.getInstance().format(SolidFireUtil.MAX_IOPS_PER_VOLUME) + \" IOPS.\");\n }\n\n if (lBurstIops > SolidFireUtil.MAX_IOPS_PER_VOLUME) {\n throw new CloudRuntimeException(\"This volume's Burst IOPS cannot exceed \" + NumberFormat.getInstance().format(SolidFireUtil.MAX_IOPS_PER_VOLUME) + \" IOPS.\");\n }\n\n details.put(SolidFireUtil.MIN_IOPS, String.valueOf(lMinIops));\n details.put(SolidFireUtil.MAX_IOPS, String.valueOf(lMaxIops));\n details.put(SolidFireUtil.BURST_IOPS, String.valueOf(lBurstIops));\n\n SolidFireUtil.SolidFireConnection sfConnection = new SolidFireUtil.SolidFireConnection(managementVip, managementPort, clusterAdminUsername, clusterAdminPassword);\n\n SolidFireCreateVolume sfCreateVolume = createSolidFireVolume(sfConnection, storagePoolName, capacityBytes, lMinIops, lMaxIops, lBurstIops);\n\n SolidFireUtil.SolidFireVolume sfVolume = sfCreateVolume.getVolume();\n\n String iqn = sfVolume.getIqn();\n\n details.put(SolidFireUtil.VOLUME_ID, String.valueOf(sfVolume.getId()));\n\n parameters.setUuid(iqn);\n\n if (HypervisorType.VMware.equals(hypervisorType)) {\n String datastore = iqn.replace(\"/\", \"_\");\n String path = \"/\" + datacenter + \"/\" + datastore;\n\n parameters.setHost(\"VMFS datastore: \" + path);\n parameters.setPort(0);\n parameters.setPath(path);\n\n details.put(SolidFireUtil.DATASTORE_NAME, datastore);\n details.put(SolidFireUtil.IQN, iqn);\n details.put(SolidFireUtil.STORAGE_VIP, storageVip);\n details.put(SolidFireUtil.STORAGE_PORT, String.valueOf(storagePort));\n }\n else {\n parameters.setHost(storageVip);\n parameters.setPort(storagePort);\n parameters.setPath(iqn);\n }\n\n ClusterVO cluster = clusterDao.findById(clusterId);\n\n GlobalLock lock = GlobalLock.getInternLock(cluster.getUuid());\n\n if (!lock.lock(SolidFireUtil.LOCK_TIME_IN_SECONDS)) {\n String errMsg = \"Couldn't lock the DB on the following string: \" + cluster.getUuid();\n\n LOGGER.debug(errMsg);\n\n throw new CloudRuntimeException(errMsg);\n }\n\n DataStore dataStore = null;\n\n try {\n // this adds a row in the cloud.storage_pool table for this SolidFire volume\n dataStore = primaryDataStoreHelper.createPrimaryDataStore(parameters);\n\n // now that we have a DataStore (we need the id from the DataStore instance), we can create a Volume Access Group, if need be, and\n // place the newly created volume in the Volume Access Group\n List<HostVO> hosts = hostDao.findByClusterId(clusterId);\n\n String clusterUuId = clusterDao.findById(clusterId).getUuid();\n\n SolidFireUtil.placeVolumeInVolumeAccessGroups(sfConnection, sfVolume.getId(), hosts, clusterUuId);\n\n SolidFireUtil.SolidFireAccount sfAccount = sfCreateVolume.getAccount();\n Account csAccount = CallContext.current().getCallingAccount();\n\n SolidFireUtil.updateCsDbWithSolidFireAccountInfo(csAccount.getId(), sfAccount, dataStore.getId(), accountDetailsDao);\n } catch (Exception ex) {\n if (dataStore != null) {\n primaryDataStoreDao.expunge(dataStore.getId());\n }\n\n throw new CloudRuntimeException(ex.getMessage());\n }\n finally {\n lock.unlock();\n lock.releaseRef();\n }\n\n return dataStore;\n }", "@PostConstruct\n public void initPool() {\n SpringHelper.setApplicationContext(applicationContext);\n if (!initialized) {\n try {\n final File configDirectory = ConfigDirectory.setupTestEnvironement(\"OGCRestTest\");\n final File dataDirectory2 = new File(configDirectory, \"dataCsw2\");\n dataDirectory2.mkdir();\n\n try {\n serviceBusiness.delete(\"csw\", \"default\");\n serviceBusiness.delete(\"csw\", \"intern\");\n } catch (ConfigurationException ex) {}\n\n final Automatic config2 = new Automatic(\"filesystem\", dataDirectory2.getPath());\n config2.putParameter(\"shiroAccessible\", \"false\");\n serviceBusiness.create(\"csw\", \"default\", config2, null);\n\n writeProvider(\"meta1.xml\", \"42292_5p_19900609195600\");\n\n Automatic configuration = new Automatic(\"internal\", (String)null);\n configuration.putParameter(\"shiroAccessible\", \"false\");\n serviceBusiness.create(\"csw\", \"intern\", configuration, null);\n\n initServer(null, null, \"api\");\n pool = GenericDatabaseMarshallerPool.getInstance();\n initialized = true;\n } catch (Exception ex) {\n Logger.getLogger(OGCRestTest.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "Swarm createSwarm();", "abstract ManagedChannel createChannel(List<ServerInfo> servers);", "public SubTaskGroup createConfigureServerTasks(\n Collection<NodeDetails> nodes, Consumer<AnsibleConfigureServers.Params> paramsCustomizer) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleConfigureServers\");\n for (NodeDetails node : nodes) {\n Cluster cluster = taskParams().getClusterByUuid(node.placementUuid);\n UserIntent userIntent = cluster.userIntent;\n AnsibleConfigureServers.Params params = new AnsibleConfigureServers.Params();\n // Set the device information (numVolumes, volumeSize, etc.)\n params.deviceInfo = userIntent.getDeviceInfoForNode(node);\n // Add the node name.\n params.nodeName = node.nodeName;\n // Add the universe uuid.\n params.setUniverseUUID(taskParams().getUniverseUUID());\n // Add the az uuid.\n params.azUuid = node.azUuid;\n params.placementUuid = node.placementUuid;\n // Sets the isMaster field\n params.enableYSQL = userIntent.enableYSQL;\n params.enableYCQL = userIntent.enableYCQL;\n params.enableYCQLAuth = userIntent.enableYCQLAuth;\n params.enableYSQLAuth = userIntent.enableYSQLAuth;\n // Set if this node is a master in shell mode.\n // The software package to install for this cluster.\n params.ybSoftwareVersion = userIntent.ybSoftwareVersion;\n params.setEnableYbc(taskParams().isEnableYbc());\n params.setYbcSoftwareVersion(taskParams().getYbcSoftwareVersion());\n params.setYbcInstalled(taskParams().isYbcInstalled());\n // Set the InstanceType\n params.instanceType = node.cloudInfo.instance_type;\n params.enableNodeToNodeEncrypt = userIntent.enableNodeToNodeEncrypt;\n params.enableClientToNodeEncrypt = userIntent.enableClientToNodeEncrypt;\n params.rootAndClientRootCASame = taskParams().rootAndClientRootCASame;\n\n params.allowInsecure = taskParams().allowInsecure;\n params.setTxnTableWaitCountFlag = taskParams().setTxnTableWaitCountFlag;\n params.rootCA = taskParams().rootCA;\n params.setClientRootCA(taskParams().getClientRootCA());\n params.enableYEDIS = userIntent.enableYEDIS;\n params.useSystemd = userIntent.useSystemd;\n // sshPortOverride, in case the passed imageBundle has a different port\n // configured for the region.\n params.sshPortOverride = node.sshPortOverride;\n paramsCustomizer.accept(params);\n\n // Development testing variable.\n params.itestS3PackagePath = taskParams().itestS3PackagePath;\n\n Universe universe = Universe.getOrBadRequest(taskParams().getUniverseUUID());\n UUID custUUID = Customer.get(universe.getCustomerId()).getUuid();\n\n params.callhomeLevel = CustomerConfig.getCallhomeLevel(custUUID);\n // Set if updating master addresses only.\n if (params.updateMasterAddrsOnly) {\n params.type = UpgradeTaskParams.UpgradeTaskType.GFlags;\n if (params.isMaster) {\n params.setProperty(\"processType\", ServerType.MASTER.toString());\n params.gflags =\n GFlagsUtil.getGFlagsForNode(\n node,\n ServerType.MASTER,\n universe.getUniverseDetails().getClusterByUuid(cluster.uuid),\n universe.getUniverseDetails().clusters);\n } else {\n params.setProperty(\"processType\", ServerType.TSERVER.toString());\n params.gflags =\n GFlagsUtil.getGFlagsForNode(\n node,\n ServerType.TSERVER,\n universe.getUniverseDetails().getClusterByUuid(cluster.uuid),\n universe.getUniverseDetails().clusters);\n }\n }\n // Create the Ansible task to get the server info.\n AnsibleConfigureServers task = createTask(AnsibleConfigureServers.class);\n task.initialize(params);\n task.setUserTaskUUID(userTaskUUID);\n // Add it to the task list.\n subTaskGroup.addSubTask(task);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "Builder hostName(String hostName);", "public static void main(String... args) throws SQLException {\n new CreateCluster().runTool(args);\n }", "@Test(groups = {\"rest-commands\"})\n public void createClusterInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandCreateInstance(INSTANCE_NAME, TestDomainV4Constants.CLUSTER,\n TestDomainV4Constants.NODE_NAME);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandCreateInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandCreateInstance command execution failed: \" + gfie.getMessage());\n }\n }", "public SubTaskGroup createCreateServerTasks(Collection<NodeDetails> nodes) {\n SubTaskGroup subTaskGroup = createSubTaskGroup(\"AnsibleCreateServer\");\n for (NodeDetails node : nodes) {\n UserIntent userIntent = taskParams().getClusterByUuid(node.placementUuid).userIntent;\n AnsibleCreateServer.Params params = new AnsibleCreateServer.Params();\n fillCreateParamsForNode(params, userIntent, node);\n params.creatingUser = taskParams().creatingUser;\n params.platformUrl = taskParams().platformUrl;\n // Create the Ansible task to setup the server.\n AnsibleCreateServer ansibleCreateServer = createTask(AnsibleCreateServer.class);\n ansibleCreateServer.initialize(params);\n // Add it to the task list.\n subTaskGroup.addSubTask(ansibleCreateServer);\n }\n getRunnableTask().addSubTaskGroup(subTaskGroup);\n return subTaskGroup;\n }", "private void createStagingPrivateInstance() throws Exception\r\n\t{\r\n\t\t//TODO stop public jboss and grid service -- do not bother now --\r\n\r\n\t\tfinal String dropPublicDBCmd = ApplicationProperties.getValue(\"createPrivateDump\");\r\n\t\tthis.executeCommand(dropPublicDBCmd);\r\n\r\n\t\tfinal String createPubliDumpCmd = ApplicationProperties.getValue(\"dropStagingDB\");\r\n\t\tthis.executeCommand(createPubliDumpCmd);\r\n\r\n\t\tfinal String createPublicDB = ApplicationProperties.getValue(\"createStagingDB\");\r\n\t\tthis.executeCommand(createPublicDB);\r\n\t\t//TODO start public jboss and grid service -- do not bother now --\r\n\t}", "protected abstract Node createCenterContent();", "public void createCon(){\n\t\ttry {\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\");\n\t\t\tcon=DriverManager.getConnection(\"jdbc:oracle:thin:@172.26.132.40:1521:ORCLILP\", \"a63d\", \"a63d\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\n\t}", "private static Map<String, Object> createClusterTemplateArtifact(Object configuration1, Object configuration2, Object configuration3) {\n return\n map(\n \"mpack_instances\",\n list(\n map(\n \"name\", \"HDPCORE\",\n \"version\", \"1.0.0.0\",\n \"configurations\", configuration1,\n \"service_instances\", list(\n map(\n \"name\", \"ZK1\",\n \"type\", \"ZOOKEEPER\",\n \"configurations\", configuration2\n )\n )\n )\n ),\n \"host_groups\",\n list(\n map(\n \"name\", \"hostgroup1\",\n \"host_count\", \"1\"\n )\n ),\n \"configurations\", configuration3\n );\n }", "public void createClusters() {\n\t\t/*\n\t\t * double simAvg = documentDao.getSimilarity(avg); double simMax =\n\t\t * documentDao.getSimilarity(max); double simMin =\n\t\t * documentDao.getSimilarity(min);\n\t\t */\n\n\t\t// initClusters();\n\n\t\tList<Document> docList = documentDao.getDocumentListOrderBySimilarity();\n\t\tList<Cluster> clusterList = clusterDao.getClusterList();\n\n\t\tint i = 0;\n\t\tCluster cluster = clusterList.get(i);\n\t\tfor (Document document : docList) {\n\t\t\twhile (document.getSimilarity() < cluster.getLow()) {\n\t\t\t\tcluster = clusterList.get(++i);\n\t\t\t}\n\t\t\tif (document.getSimilarity() < cluster.getHigh() && document.getSimilarity() >= cluster.getLow()) {\n\t\t\t\tdocument.setClusterId(cluster.getId());\n\t\t\t\tdocumentDao.insertDocument(document);\n\t\t\t}\n\t\t}\n\n\t}", "abstract public Transports createTransports();", "void formCluster(Set<ControllerNode> nodes, String ipPrefix);", "private void createCentipede() {\n\t\tcentipede = new ArrayList<>();\n\t\tfor(int i = 0; i < centipedeSize; i ++) {\n\t\t\tcentipede.add(new Segment(304 + 16 * i, 0));\n\t\t}\n\t}", "public KVServerInstance createServerInstance(KVCommunicationModule com, KVServer master){\n KVServerInstance newInstance = new KVServerInstance(com,master);\n newInstance.changeLogLevel(kv_out.getOutputLevel(),kv_out.getLogLevel());\n return newInstance;\n }", "public void setHost(com.vmware.converter.DistributedVirtualSwitchHostMemberConfigSpec[] host) {\r\n this.host = host;\r\n }", "public void testSetHost() {\n }", "public void setupDryadCloudDataSets(){\n\t\ttry{\n\t\t\t\n\t\t\t// A Dryad \n\t\t\tDryadDataSet ds = new DryadDataSet(_DRYAD_D1_TREEBASE);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D1_TREEBASE_F1);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D3_POPULAR);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D3_POPULAR_F1);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D4_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D4_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D4_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D6_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D6_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D6_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D2_GENBANK);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F1);\t\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F2);\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F3);\n\t\t\tds.harvestDataToRDF(_DRYAD_D2_GENBANK_F4);\n\t\t\t_datasets.add(ds);\n\t\t\tds = new DryadDataSet(_DRYAD_D5_CSV);\n\t\t\tds.harvestMetadataToRDF();\n\t\t\tds.harvestDataToRDF(_DRYAD_D5_CSV_F1);\n\t\t\tds.harvestDataToRDF(_DRYAD_D5_CSV_F2);\n\t\t\t_datasets.add(ds);\n\t\t}\n\t\tcatch(Exception ex){\n\t\t\tSystem.out.println(\"ERROR: Exception \"+ex.getMessage());\n\t\t}\n\t}", "pvcs createpvcs();", "@Override\n ManagedChannel createChannel(List<ServerInfo> servers) {\n checkArgument(!servers.isEmpty(), \"No management server provided.\");\n XdsLogger logger = XdsLogger.withPrefix(\"xds-client-channel-factory\");\n ServerInfo serverInfo = servers.get(0);\n String serverUri = serverInfo.getServerUri();\n logger.log(XdsLogLevel.INFO, \"Creating channel to {0}\", serverUri);\n List<ChannelCreds> channelCredsList = serverInfo.getChannelCredentials();\n ManagedChannelBuilder<?> channelBuilder = null;\n // Use the first supported channel credentials configuration.\n // Currently, only \"google_default\" is supported.\n for (ChannelCreds creds : channelCredsList) {\n if (creds.getType().equals(\"google_default\")) {\n logger.log(XdsLogLevel.INFO, \"Using channel credentials: google_default\");\n channelBuilder = GoogleDefaultChannelBuilder.forTarget(serverUri);\n break;\n }\n }\n if (channelBuilder == null) {\n logger.log(XdsLogLevel.INFO, \"Using default channel credentials\");\n channelBuilder = ManagedChannelBuilder.forTarget(serverUri);\n }\n\n return channelBuilder\n .keepAliveTime(5, TimeUnit.MINUTES)\n .build();\n }", "void addHost(Service newHost);", "public static void main(String[] args) {\n try {\n //创建一个远程对象\n\n String ip = args[0];\n String port = args[1];\n Integer totalSpace = args[2] == null ? 100 :Integer.valueOf(args[2]);\n ChunkServerProperties properties = new ChunkServerProperties();\n properties.setIp(ip);\n properties.setPort(port);\n\n IChunkServerService chunkServer = new BFSChunkServer(totalSpace,0,\"/\",ip);\n\n LocateRegistry.createRegistry(Integer.parseInt(port));\n\n String rmi = \"rmi://\"+properties.getServerIpPort()+\"/chunk_server\";\n Printer.println(rmi);\n Naming.bind(rmi,chunkServer);\n\n String masterRMI =\"rmi://127.0.0.1:8888/master\";\n\n IMasterService masterService =(IMasterService) Naming.lookup(\"rmi://127.0.0.1:8888/master\");\n\n\n masterService.registerChunkServer(properties);\n\n Printer.println(\"register to master \"+masterRMI + \" succcess\");\n\n } catch (RemoteException e) {\n e.printStackTrace();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (AlreadyBoundException e) {\n e.printStackTrace();\n } catch (NotBoundException e) {\n e.printStackTrace();\n }\n }", "@Test public void buildManaged_persistentZone() {\n // Restart.\n Location loc = Location.create(ZONE_DIR);\n Zone zone = Zone.connect(loc);\n\n Quad q1 = SSE.parseQuad(\"(:g :s :p 1)\");\n Quad q2 = SSE.parseQuad(\"(:g :s :p 2)\");\n\n {\n DatasetGraph dsg = ManagedDatasetBuilder.create()\n .deltaLink(deltaLink)\n .logName(\"ABD\")\n .zone(zone)\n .syncPolicy(SyncPolicy.TXN_RW)\n .storageType(LocalStorageType.TDB2)\n .build();\n\n DeltaConnection conn = (DeltaConnection)(dsg.getContext().get(symDeltaConnection));\n Txn.executeWrite(dsg, ()->dsg.add(q1));\n Txn.executeRead( conn.getDatasetGraph(), ()->assertTrue(conn.getDatasetGraph().contains(q1)) );\n }\n\n // Same zone\n Zone.clearZoneCache();\n zone = Zone.connect(loc);\n // Storage should be recovered from the on-disk state.\n\n {\n DatasetGraph dsg1 = ManagedDatasetBuilder.create()\n .deltaLink(deltaLink)\n .logName(\"ABD\")\n .zone(zone)\n .syncPolicy(SyncPolicy.TXN_RW)\n //.storageType(LocalStorageType.TDB2) // Storage required. Should detect [FIXME]\n .build();\n DatasetGraph dsg2 = ManagedDatasetBuilder.create()\n .deltaLink(deltaLink)\n .logName(\"ABD\")\n .zone(zone)\n .syncPolicy(SyncPolicy.TXN_RW)\n //.storageType(LocalStorageType.TDB) // Wrong storage - does not matter; dsg1 setup choice applies\n .build();\n DeltaConnection conn1 = (DeltaConnection)(dsg1.getContext().get(symDeltaConnection));\n DeltaConnection conn2 = (DeltaConnection)(dsg2.getContext().get(symDeltaConnection));\n\n Txn.executeRead(conn1.getDatasetGraph(), ()->assertTrue(conn1.getDatasetGraph().contains(q1)) );\n Txn.executeWrite(conn2.getDatasetGraph(), ()->conn2.getDatasetGraph().add(q2));\n Txn.executeRead(conn1.getDatasetGraph(), ()->assertTrue(conn1.getDatasetGraph().contains(q2)) );\n }\n }", "@Create\n public void create()\n {\n \n log.debug(\"Creating users and mailboxes\");\n //MailboxService ms = MMJMXUtil.getMBean(\"meldware.mail:type=MailboxManager,name=MailboxManager\", MailboxService.class);\n AdminTool at = MMJMXUtil.getMBean(\"meldware.mail:type=MailServices,name=AdminTool\", AdminTool.class);\n \n for (MeldwareUser meldwareUser : getUsers())\n {\n at.createUser(meldwareUser.getUsername(), meldwareUser.getPassword(), meldwareUser.getRoles());\n // TODO This won't work on AS 4.2\n /*Mailbox mbox = ms.createMailbox(meldwareUser.getUsername());\n for (String alias : meldwareUser.getAliases())\n {\n ms.createAlias(mbox.getId(), alias);\n }*/\n log.debug(\"Created #0 #1 #2\", meldwareUser.isAdministrator() ? \"administrator\" : \"user\", meldwareUser.getUsername(), meldwareUser.getAliases() == null || meldwareUser.getAliases().size() == 0 ? \"\" : \"with aliases \" + meldwareUser.getAliases());\n }\n }", "public static void createCacheServer2() throws Exception {\n ds = (new ClearGlobalDUnitTest()).getSystem(props);\n CacheObserverImpl observer = new CacheObserverImpl();\n origObserver = CacheObserverHolder.setInstance(observer);\n LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true;\n\n cache = CacheFactory.create(ds);\n AttributesFactory factory = new AttributesFactory();\n factory.setScope(Scope.GLOBAL);\n RegionAttributes attr = factory.create();\n region = cache.createRegion(REGION_NAME, attr);\n cache.setLockTimeout(3);\n\n }", "private void prepareTestEnv() throws InterruptedException {\n\n createGroup(numDataNodes);\n\n for (int i=0; i < numDataNodes; i++) {\n final ReplicatedEnvironment env = repEnvInfo[i].getEnv();\n final int targetGroupSize = groupSize;\n\n ReplicationGroup group = null;\n for (int j=0; j < 100; j++) {\n group = env.getGroup();\n if (group.getNodes().size() == targetGroupSize) {\n break;\n }\n /* Wait for the replica to catch up. */\n Thread.sleep(1000);\n }\n assertEquals(\"Nodes\", targetGroupSize, group.getNodes().size());\n assertEquals(RepTestUtils.TEST_REP_GROUP_NAME, group.getName());\n for (int ii = 0; ii < targetGroupSize; ii++) {\n RepTestUtils.RepEnvInfo rinfo = repEnvInfo[ii];\n final ReplicationConfig repConfig = rinfo.getRepConfig();\n ReplicationNode member =\n group.getMember(repConfig.getNodeName());\n assertNotNull(\"Member\", member);\n assertEquals(repConfig.getNodeName(), member.getName());\n assertEquals(repConfig.getNodeType(), member.getType());\n assertEquals(repConfig.getNodeSocketAddress(),\n member.getSocketAddress());\n }\n\n /* verify data nodes */\n final Set<ReplicationNode> dataNodes = group.getDataNodes();\n for (final ReplicationNode n : dataNodes) {\n assertEquals(NodeType.ELECTABLE, n.getType());\n }\n logger.info(\"data nodes verified\");\n }\n }", "public static void main(String[] args) {\n FinalGroupProjectCS2141 dbProject = new FinalGroupProjectCS2141();\r\n dbProject.createConnection();\r\n }", "public void setup_servers()\n {\n // get ServerInfo\n ServerInfo t = new ServerInfo();\n // all 3 servers\n for(int i=0;i<3;i++)\n {\n // get the server IP and port info\n String t_ip = t.hmap.get(i).ip;\n int t_port = Integer.valueOf(t.hmap.get(i).port);\n Thread x = new Thread()\n {\n public void run()\n {\n try\n {\n Socket s = new Socket(t_ip,t_port);\n // SockHandle instance with svr_hdl true and rx_hdl false as this is the socket initiator\n SockHandle t = new SockHandle(s,my_ip,my_port,my_c_id,c_list,s_list,false,true,cnode);\n }\n catch (UnknownHostException e) \n {\n \tSystem.out.println(\"Unknown host\");\n \tSystem.exit(1);\n } \n catch (IOException e) \n {\n \tSystem.out.println(\"No I/O\");\n e.printStackTrace(); \n \tSystem.exit(1);\n }\n }\n };\n \n x.setDaemon(true); \t// terminate when main ends\n x.setName(\"Client_\"+my_c_id+\"_SockHandle_to_Server\"+i);\n x.start(); \t\t\t// start the thread\n }\n }", "public static void main(String args[]){\n ClientConfig remoteConfig = getCluster2();\n\n remoteClient = HazelcastClient.newHazelcastClient(remoteConfig);\n\n Map usCarMap = remoteClient.getMap(\"cars\");\n\n System.out.println(usCarMap.size());\n\n //ClientConfig localConfig = getEUClientConfig();\n Config localConfig = getHCCluster1();\n\n localClient = Hazelcast.newHazelcastInstance(localConfig);\n localClient.getMap(\"cars\");\n\n ClusterReconTask clusterReconTask = new ClusterReconTask(localClient, localClusterName, remoteClient, remoteClusterName);\n\n ClusterReconTask clusterReconTask1 = clusterReconTask;\n\n ClusterReconResults reconResults = null;\n\n try {\n reconResults = clusterReconTask1.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n System.out.println(reconResults.getMissingKeysByMap().size());\n\n System.out.println(reconResults.getMissingKeysByMap().toString());\n\n // Run Repair Task if needed\n if (reconResults.getMissingKeysByMap().size() > 0){\n ClusterRepairTask clusterRepairTask = new ClusterRepairTask(localClient, localClusterName, remoteClient, remoteClusterName, reconResults);\n try {\n clusterRepairTask.call();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n\n }", "private void init() {\n\t\t/* Add the DNS of your database instances here */\n\t\tdatabaseInstances[0] = \"ec2-52-0-167-69.compute-1.amazonaws.com\";\n\t\tdatabaseInstances[1] = \"ec2-52-0-247-64.compute-1.amazonaws.com\";\n\t}", "public void createMiniKdcConf() {\n\t\tconf = MiniKdc.createConf();\n\t}", "public static void main(String args[]) {\n ContentServer cs = new ContentServer();\n try {\n // Bind the RMI Object\n ContentServerIntf stub =\n (ContentServerIntf) UnicastRemoteObject.exportObject(cs, 0);\n LocateRegistry.createRegistry(40000);\n Registry registry = LocateRegistry.getRegistry(InetAddress.getLocalHost().getHostAddress(), 40000);\n registry.rebind(cs.getCsPublicIp(), stub);\n\n // start the ContentServer\n cs.setUp();\n cs.start();\n\n // register with proxy\n NodeData nodeData = new NodeData();\n nodeData.setIpAddress(cs.getCsPublicIp());\n Registry masterReg = LocateRegistry.getRegistry(\"52.7.96.47\", 50000);\n MasterInter masterInter = (MasterInter) masterReg.lookup(\"master\");\n masterInter.join(nodeData);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void createFaultInjectionForHosts(final Datacenter datacenter) {\n PoissonDistr poisson = new PoissonDistr(MEAN_FAILURE_NUMBER_PER_HOUR, getSeed());\n\n faultInjection = new HostFaultInjection(datacenter, poisson);\n getFaultInjection().setMaxTimeToFailInHours(MAX_TIME_TO_GENERATE_FAILURE_IN_HOURS);\n\n for (DatacenterBroker broker : getBrokerList()) {\n getFaultInjection().addVmCloner (broker, new VmClonerSimple(this::cloneVm, this::cloneCloudlets));\n }\n\n System.out.printf(\n \"\\tFault Injection created for %s.\\n\\tMean Number of Failures per hour: %.6f (1 failure expected at each %.4f hours).\\n\",\n datacenter, MEAN_FAILURE_NUMBER_PER_HOUR, poisson.getInterArrivalMeanTime());\n }", "@Override\n\tpublic void terminateDatacenters() {\n\t}", "Community createCommunity( String name, byte[] user_short_pid ) \r\n throws CommunityException;", "@Test(timeOut = DEFAULT_TEST_TIMEOUT * 2, groups = \"1\", enabled = false)\r\n \tpublic void bootstrapEc2CloudTest() throws Exception {\r\n \t \r\n \t\tfor (int i = 0; i < NUM_OF_MANAGEMENT_MACHINES; i++) {\r\n \t\t\t// The rest home page is a JSP page, which will fail to compile if there is no JDK installed. So use testrest instead\r\n \t\t\tassertWebServiceAvailable(new URL( restAdminUrl[i].toString() + \"/service/testrest\"));\r\n \t\t\tassertWebServiceAvailable(webUIUrl[i]);\r\n \t\t}\r\n \t \r\n \t\tString connectCommand = \"connect \" + restAdminUrl[0].toString() + \";\";\r\n \t \r\n \t URL machinesURL = getMachinesUrl(restAdminUrl[0].toString());\r\n \t assertEquals(\"Expecting \" + NUM_OF_MANAGEMENT_MACHINES + \" machines\", \r\n \t \t\tNUM_OF_MANAGEMENT_MACHINES, getNumberOfMachines(machinesURL));\r\n \t \r\n \t //running install application on simple\r\n \t String installCommand = new StringBuilder()\r\n \t .append(\"install-application \")\r\n \t .append(\"--verbose \")\r\n \t .append(\"-timeout \")\r\n \t .append(TimeUnit.MILLISECONDS.toMinutes(DEFAULT_TEST_TIMEOUT * 2)).append(\" \")\r\n\t .append((new File(ScriptUtils.getBuildPath(), \"examples/travel\").toString()).replace('\\\\', '/'))\r\n \t .toString();\r\n \t \r\n \t String output = CommandTestUtils.runCommandAndWait(connectCommand + installCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(INSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \r\n \t // Travel is started with 2 instances (1 tomcat, 1 cassandra) so we are expecting two more machine\r\n assertEquals(\"Expecting \" + (NUM_OF_MANAGEMENT_MACHINES+2) + \" machines\", \r\n NUM_OF_MANAGEMENT_MACHINES+2, getNumberOfMachines(machinesURL));\r\n \t \r\n \t \r\n \t //uninstall simple application\r\n \t String uninstallCommand = \"uninstall-application --verbose travel\";\r\n \t output = CommandTestUtils.runCommandAndWait(connectCommand + uninstallCommand);\r\n \t \r\n \t Assert.assertTrue(output.contains(UNINSTALL_TRAVEL_EXPECTED_OUTPUT));\r\n \t \r\n \t}", "public static void main(String[] args) throws Exception {\n CenterServerImp mtlServer = new CenterServerImp(Location.MTL);\n CenterServerImp lvlServer = new CenterServerImp(Location.LVL);\n CenterServerImp ddoServer = new CenterServerImp(Location.DDO);\n Registry registry = LocateRegistry.createRegistry(Constants.REGISTRY_PORT);\n registry.bind(\"MontrealServer\", mtlServer);\n registry.bind(\"LavalServer\", lvlServer);\n registry.bind(\"DDOServer\", ddoServer);\n System.out.println(\"#================= Server is up and running =================#\");\n }", "private ITaskCluster createTaskCluster(ITaskObject... taskObjects) {\n ITaskCluster taskCluster = getTaskManagerConfiguration().getTaskFactory().newTaskCluster();\n taskCluster = getTaskManagerConfiguration().getTaskManagerWriter().saveNewTaskCluster(taskCluster);\n\n return createTaskGraphForTaskCluster(taskCluster, taskObjects);\n }", "OperacionColeccion createOperacionColeccion();", "public static void setUpServer() {\n\t\tList<ServerDefinition> srvToSC0CascDefs = new ArrayList<ServerDefinition>();\r\n\t\tServerDefinition srvToSC0CascDef = new ServerDefinition(TestConstants.COMMUNICATOR_TYPE_PUBLISH, TestConstants.logbackSrv, TestConstants.pubServerName1,\r\n\t\t\t\tTestConstants.PORT_PUB_SRV_TCP, TestConstants.PORT_SC0_TCP, 1, 1, TestConstants.pubServiceName1);\r\n\t\tsrvToSC0CascDefs.add(srvToSC0CascDef);\r\n\t\tSystemSuperTest.srvDefs = srvToSC0CascDefs;\r\n\t}", "public static void main(String[] args) throws Exception {\n\n\t\tString dockerIp = InetAddress.getLocalHost().getHostAddress();//getByName(\"localhost\")\n\t\tVertxOptions options = new VertxOptions();\n\t\toptions.setClusterHost(dockerIp);\n\t\tVertx.clusteredVertx(options,\n\t\t\t\tvertxAsyncResult -> vertxAsyncResult.result().deployVerticle(new Receiver()));//new Receiver()));\n\t \n\t}", "@Test\n public void testClusterKeyWithMultiplePorts() throws Exception {\n testKey(\"server1:2182\", 2181, \"/hbase\", true);\n // multiple servers have their own port\n testKey(\"server1:2182,server2:2183,server3:2184\", 2181, \"/hbase\", true);\n // one server has no specified port, should use default port\n testKey(\"server1:2182,server2,server3:2184\", 2181, \"/hbase\", true);\n // the last server has no specified port, should use default port\n testKey(\"server1:2182,server2:2183,server3\", 2181, \"/hbase\", true);\n // multiple servers have no specified port, should use default port for those servers\n testKey(\"server1:2182,server2,server3:2184,server4\", 2181, \"/hbase\", true);\n // same server, different ports\n testKey(\"server1:2182,server1:2183,server1\", 2181, \"/hbase\", true);\n // mix of same server/different port and different server\n testKey(\"server1:2182,server2:2183,server1\", 2181, \"/hbase\", true);\n }", "private void setupEscenario2( )\n {\n setupEscenario1( );\n\n String nombre = \"Alberto\";\n String direccion = \"dirección\";\n String telefono = \"1234567\";\n String email = \"[email protected]\";\n Contacto contacto2 = new Contacto( nombre, telefono, direccion, email );\n\n try\n {\n contacto1.insertar( contacto2 );\n }\n catch( ContactoRepetidoException e )\n {\n fail( \"El contacto debió agregarse\" );\n }\n }", "private void createTargetCollection() throws Exception {\n List<String> nodeNames = this.startServers(shardCount * replicationFactor);\n this.collectionToNodeNames.put(TARGET_COLLECTION, nodeNames);\n this.createCollection(TARGET_COLLECTION);\n this.waitForRecoveriesToFinish(TARGET_COLLECTION, true);\n this.updateMappingsFromZk(TARGET_COLLECTION);\n }", "void initAgents() {\n Runtime rt = Runtime.instance();\n\n //Create a container to host the Default Agent\n Profile p = new ProfileImpl();\n p.setParameter(Profile.MAIN_HOST, \"localhost\");\n //p.setParameter(Profile.MAIN_PORT, \"10098\");\n p.setParameter(Profile.GUI, \"false\");\n ContainerController cc = rt.createMainContainer(p);\n\n HashMap<Integer, String> neighbors = new HashMap <Integer, String>();\n neighbors.put(1, \"2, 4, 3\");\n neighbors.put(2, \"1, 3\");\n neighbors.put(3, \"1, 2, 4\");\n neighbors.put(4, \"1, 3, 5\");\n neighbors.put(5, \"4\");\n\n//Create a container to host the Default Agent\n try {\n for (int i = 1; i <= MainController.numberOfAgents; i++) {\n AgentController agent = cc.createNewAgent(Integer.toString(i), \"ru.spbu.mas.DefaultAgent\",\n new Object[]{neighbors.get(i)});\n agent.start();\n }\n } catch (StaleProxyException e) {\n e.printStackTrace();\n }\n }", "Container createContainer();", "@Test\n public void cluster() throws FlywayException {\n flyway.setLocations(\"migration/dbsupport/oracle/sql/cluster\");\n flyway.migrate();\n flyway.clean();\n flyway.migrate();\n }", "private static void setupConfigsAndStartCluster() throws Exception {\n setUpConfigForMiniCluster(conf1);\n conf1.setFloat(\"hbase.regionserver.logroll.multiplier\", 0.0003f);\n conf1.setInt(\"replication.source.size.capacity\", 10240);\n conf1.setLong(\"replication.source.sleepforretries\", 100);\n conf1.setInt(\"hbase.regionserver.maxlogs\", 10);\n conf1.setLong(\"hbase.master.logcleaner.ttl\", 10);\n conf1.setInt(\"zookeeper.recovery.retry\", 1);\n conf1.setInt(\"zookeeper.recovery.retry.intervalmill\", 10);\n conf1.setBoolean(\"dfs.support.append\", true);\n conf1.setLong(HConstants.THREAD_WAKE_FREQUENCY, 100);\n conf1.setInt(\"replication.stats.thread.period.seconds\", 5);\n conf1.setBoolean(\"hbase.tests.use.shortcircuit.reads\", false);\n\n utility1 = new HBaseTestingUtility(conf1);\n utility1.startMiniZKCluster();\n MiniZooKeeperCluster miniZK = utility1.getZkCluster();\n // Have to reset conf1 in case zk cluster location different\n // than default\n conf1 = utility1.getConfiguration();\n zkw1 = new ZKWatcher(conf1, \"cluster1\", null, true);\n admin = ConnectionFactory.createConnection(conf1).getAdmin();\n LOGGER.info(\"Setup first Zk\");\n\n // Base conf2 on conf1 so it gets the right zk cluster, and general cluster configs\n conf2 = HBaseConfiguration.create(conf1);\n conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, \"/2\");\n conf2.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6);\n conf2.setBoolean(\"dfs.support.append\", true);\n conf2.setBoolean(\"hbase.tests.use.shortcircuit.reads\", false);\n\n utility2 = new HBaseTestingUtility(conf2);\n utility2.setZkCluster(miniZK);\n zkw2 = new ZKWatcher(conf2, \"cluster2\", null, true);\n\n LOGGER.info(\"Setup second Zk\");\n utility1.startMiniCluster(2);\n utility2.startMiniCluster(2);\n //replicate from cluster 1 -> cluster 2, but not back again\n admin.addReplicationPeer(\"1\",\n ReplicationPeerConfig.newBuilder().setClusterKey(utility2.getClusterKey()).build());\n }", "Source createDatasourceFolder(Source ds, Provider prov) throws RepoxException;", "private ClientBootstrap createPeerBootStrap() {\n\n if (workerThreads == 0) {\n execFactory = new NioClientSocketChannelFactory(\n Executors.newCachedThreadPool(groupedThreads(\"onos/pcc\", \"boss-%d\")),\n Executors.newCachedThreadPool(groupedThreads(\"onos/pcc\", \"worker-%d\")));\n return new ClientBootstrap(execFactory);\n } else {\n execFactory = new NioClientSocketChannelFactory(\n Executors.newCachedThreadPool(groupedThreads(\"onos/pcc\", \"boss-%d\")),\n Executors.newCachedThreadPool(groupedThreads(\"onos/pcc\", \"worker-%d\")),\n workerThreads);\n return new ClientBootstrap(execFactory);\n }\n }", "private void addClouds()\n {\n Cloud cloud1 = new Cloud(170, 125);\n addObject(cloud1, 170, 125);\n Cloud cloud2 = new Cloud(450, 175);\n addObject(cloud2, 450, 175);\n Cloud cloud3 = new Cloud(775, 50);\n addObject(cloud3, 775, 50);\n }", "boolean createPortPairGroup(PortPairGroup portPairGroup);", "public void setupMongo(final String username, final String password, final String database2, final String host, final int port) {\n client = new MongoClient(new ServerAddress(\"localhost\", 27017));\n //client = new MongoClient(new MongoClientURI(\"mongodb://ulxi4s6tvez9ckircdpk:R7nFCkRGsMeLjq1c7Z7e@b60upaqifl4t0hi-mongodb.services.clever-cloud.com:27017/b60upaqifl4t0hi\"));\n }", "@Override\n\t\tpublic DRPCClient create() throws Exception {\n\t\t\tMap<String, Object> config = Utils.readStormConfig();\n\t\t\treturn new DRPCClient(config, configuration.drpcHost,\n\t\t\t\t\tconfiguration.drpcPort, MAX_WAIT_TO_EXECUTE);\n\t\t}", "private void createTopology() {\n deviceService = createMock(DeviceService.class);\n linkService = createMock(LinkService.class);\n\n deviceService.addListener(anyObject(DeviceListener.class));\n linkService.addListener(anyObject(LinkListener.class));\n\n createDevices(NUM_DEVICES, NUM_PORTS_PER_DEVICE);\n createLinks(NUM_DEVICES);\n addIntfConfig();\n popluateEdgePortService();\n }", "public static void setupV1Crds(KubeClusterResource cluster) {\n cluster.replaceCustomResources(CRD_V1_KAFKA);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT_S2I);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER_2);\n cluster.replaceCustomResources(CRD_V1_KAFKA_BRIDGE);\n cluster.replaceCustomResources(CRD_V1_TOPIC);\n cluster.replaceCustomResources(CRD_V1_KAFKA_USER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECTOR);\n cluster.replaceCustomResources(CRD_V1_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "public void connectClusters()\n\t{\n//\t\tfor(int i = 0; i<edges.size();i++)\n//\t\t{\n//\t\t\tEdgeElement edge = edges.get(i);\n//\t\t\tString fromNodeID = edge.fromNodeID;\n//\t\t\tNodeElement fromNode = findSubNode(fromNodeID);\n//\t\t\tString toNodeID = edge.toNodeID;\n//\t\t\tNodeElement toNode = findSubNode(toNodeID); \n//\t\t\t\n//\t\t\tif(fromNode != null && toNode != null)\n//\t\t\t{\n//\t\t\t\tPortInfo oport = new PortInfo(edge, fromNode);\n//\t\t\t\tfromNode.addOutgoingPort(oport);\n//\t\t\t\tedge.addIncomingPort(oport);\n//\t\t\t\tPortInfo iport = new PortInfo(edge, toNode);\n//\t\t\t\ttoNode.addIncomingPort(iport);\n//\t\t\t\tedge.addOutgoingPort(iport);\n//\t\t\t}\n//\t\t}\n\t}", "public interface InstanceDeployCenter {\r\n\r\n /**\r\n * 启动已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 启动已存在的实例,无需进行redis资源包校验\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstanceWithoutResourceCheck(long appId, int instanceId);\r\n\r\n /**\r\n * 下线已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean shutdownExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * cluster forget\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean forgetInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 清理(cluster forget)集群内所有fail节点\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean clearFailInstances(long appId);\r\n \r\n /**\r\n * 展示实例最近的日志\r\n * @param instanceId\r\n * @param maxLineNum\r\n * @return\r\n */\r\n String showInstanceRecentLog(int instanceId, int maxLineNum);\r\n\r\n /**\r\n * 修改实例配置\r\n * @param appId\r\n * @param appAuditId\r\n * @param host\r\n * @param port\r\n * @param instanceConfigKey\r\n * @param instanceConfigValue\r\n * @return\r\n */\r\n boolean modifyInstanceConfig(long appId, Long appAuditId, String host, int port, String instanceConfigKey,\r\n String instanceConfigValue);\r\n\r\n /**\r\n * 检测pod是否有被调度其他宿主机\r\n * @param ip\r\n */\r\n MachineSyncEnum podChangeStatus(String ip);\r\n\r\n /**\r\n * 检测pod是否有心跳停止实例&启动\r\n * @return\r\n */\r\n List<InstanceAlertValueResult> checkAndStartExceptionInstance(String ip, Boolean isAlert);\r\n\r\n\r\n}", "private void initSCMHAConfig() {\n // Set configurations required for starting OM HA service, because that\n // is the serviceID being passed to start Ozone HA cluster.\n // Here setting internal service and OZONE_OM_SERVICE_IDS_KEY, in this\n // way in OM start it uses internal service id to find it's service id.\n conf.set(ScmConfigKeys.OZONE_SCM_SERVICE_IDS_KEY, scmServiceId);\n conf.set(ScmConfigKeys.OZONE_SCM_DEFAULT_SERVICE_ID, scmServiceId);\n String scmNodesKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_NODES_KEY, scmServiceId);\n StringBuilder scmNodesKeyValue = new StringBuilder();\n StringBuilder scmNames = new StringBuilder();\n\n for (int i = 1; i <= numOfSCMs; i++) {\n String scmNodeId = SCM_NODE_ID_PREFIX + i;\n scmNodesKeyValue.append(\",\").append(scmNodeId);\n\n String scmAddrKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_ADDRESS_KEY, scmServiceId, scmNodeId);\n String scmHttpAddrKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_HTTP_ADDRESS_KEY, scmServiceId, scmNodeId);\n String scmHttpsAddrKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_HTTPS_ADDRESS_KEY, scmServiceId, scmNodeId);\n String scmRatisPortKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_RATIS_PORT_KEY, scmServiceId, scmNodeId);\n String dnPortKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_DATANODE_ADDRESS_KEY,\n scmServiceId, scmNodeId);\n String blockClientKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY,\n scmServiceId, scmNodeId);\n String ssClientKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY,\n scmServiceId, scmNodeId);\n String scmGrpcPortKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_GRPC_PORT_KEY, scmServiceId, scmNodeId);\n String scmSecurityAddrKey = ConfUtils.addKeySuffixes(\n ScmConfigKeys.OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY, scmServiceId,\n scmNodeId);\n\n conf.set(scmAddrKey, \"127.0.0.1\");\n conf.set(scmHttpAddrKey, localhostWithFreePort());\n conf.set(scmHttpsAddrKey, localhostWithFreePort());\n conf.set(scmSecurityAddrKey, localhostWithFreePort());\n conf.set(\"ozone.scm.update.service.port\", \"0\");\n\n int ratisPort = getFreePort();\n conf.setInt(scmRatisPortKey, ratisPort);\n //conf.setInt(\"ozone.scm.ha.ratis.bind.port\", ratisPort);\n\n int dnPort = getFreePort();\n conf.set(dnPortKey, \"127.0.0.1:\" + dnPort);\n scmNames.append(\",localhost:\").append(dnPort);\n\n conf.set(ssClientKey, localhostWithFreePort());\n conf.setInt(scmGrpcPortKey, getFreePort());\n\n String blockAddress = localhostWithFreePort();\n conf.set(blockClientKey, blockAddress);\n conf.set(ScmConfigKeys.OZONE_SCM_BLOCK_CLIENT_ADDRESS_KEY,\n blockAddress);\n }\n\n conf.set(scmNodesKey, scmNodesKeyValue.substring(1));\n conf.set(ScmConfigKeys.OZONE_SCM_NAMES, scmNames.substring(1));\n }", "public static void main(String[] args)\n {\n Client oneClient;\n\n try\n {\n oneClient = new Client();\n\n // We will try to create a new virtual machine. The first thing we\n // need is an OpenNebula virtual machine template.\n\n // This VM template is a valid one, but it will probably fail to run\n // if we try to deploy it; the path for the image is unlikely to\n // exist.\n String vmTemplate =\n \"NAME = vm_from_java CPU = 0.1 MEMORY = 64\\n\"\n + \"#DISK = [\\n\"\n + \"#\\tsource = \\\"/home/user/vmachines/ttylinux/ttylinux.img\\\",\\n\"\n + \"#\\ttarget = \\\"hda\\\",\\n\"\n + \"#\\treadonly = \\\"no\\\" ]\\n\"\n + \"# NIC = [ NETWORK = \\\"Non existing network\\\" ]\\n\"\n + \"FEATURES = [ acpi=\\\"no\\\" ]\";\n\n // You can try to uncomment the NIC line, in that case OpenNebula\n // won't be able to insert this machine in the database.\n\n System.out.println(\"Virtual Machine Template:\\n\" + vmTemplate);\n System.out.println();\n\n System.out.print(\"Trying to allocate the virtual machine... \");\n OneResponse rc = VirtualMachine.allocate(oneClient, vmTemplate);\n\n if( rc.isError() )\n {\n System.out.println( \"failed!\");\n throw new Exception( rc.getErrorMessage() );\n }\n\n // The response message is the new VM's ID\n int newVMID = Integer.parseInt(rc.getMessage());\n System.out.println(\"ok, ID \" + newVMID + \".\");\n\n // We can create a representation for the new VM, using the returned\n // VM-ID\n VirtualMachine vm = new VirtualMachine(newVMID, oneClient);\n\n // Let's hold the VM, so the scheduler won't try to deploy it\n System.out.print(\"Trying to hold the new VM... \");\n rc = vm.hold();\n\n if(rc.isError())\n {\n System.out.println(\"failed!\");\n throw new Exception( rc.getErrorMessage() );\n }\n else\n System.out.println(\"ok.\");\n\n // And now we can request its information.\n rc = vm.info();\n\n if(rc.isError())\n throw new Exception( rc.getErrorMessage() );\n\n System.out.println();\n System.out.println(\n \"This is the information OpenNebula stores for the new VM:\");\n System.out.println(rc.getMessage() + \"\\n\");\n\n // This VirtualMachine object has some helpers, so we can access its\n // attributes easily (remember to load the data first using the info\n // method).\n System.out.println(\"The new VM \" +\n vm.getName() + \" has status: \" + vm.status());\n\n // And we can also use xpath expressions\n System.out.println(\"The path of the disk is\");\n System.out.println( \"\\t\" + vm.xpath(\"template/disk/source\") );\n\n // Let's delete the VirtualMachine object.\n vm = null;\n\n // The reference is lost, but we can ask OpenNebula about the VM\n // again. This time however, we are going to use the VM pool\n VirtualMachinePool vmPool = new VirtualMachinePool(oneClient);\n // Remember that we have to ask the pool to retrieve the information\n // from OpenNebula\n rc = vmPool.info();\n\n if(rc.isError())\n throw new Exception( rc.getErrorMessage() );\n\n System.out.println(\n \"\\nThese are all the Virtual Machines in the pool:\");\n for ( VirtualMachine vmachine : vmPool )\n {\n System.out.println(\"\\tID : \" + vmachine.getId() +\n \", Name : \" + vmachine.getName() );\n\n // Check if we have found the VM we are looking for\n if ( vmachine.getId().equals( \"\"+newVMID ) )\n {\n vm = vmachine;\n }\n }\n\n // We have also some useful helpers for the actions you can perform\n // on a virtual machine, like suspend:\n rc = vm.suspend();\n System.out.println(\"\\nTrying to suspend the VM \" + vm.getId() +\n \" (should fail)...\");\n\n // This is all the information you can get from the OneResponse:\n System.out.println(\"\\tOpenNebula response\");\n System.out.println(\"\\t Error: \" + rc.isError());\n System.out.println(\"\\t Msg: \" + rc.getMessage());\n System.out.println(\"\\t ErrMsg: \" + rc.getErrorMessage());\n\n rc = vm.terminate();\n System.out.println(\"\\nTrying to terminate the VM \" +\n vm.getId() + \"...\");\n\n System.out.println(\"\\tOpenNebula response\");\n System.out.println(\"\\t Error: \" + rc.isError());\n System.out.println(\"\\t Msg: \" + rc.getMessage());\n System.out.println(\"\\t ErrMsg: \" + rc.getErrorMessage());\n\n\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n }\n\n\n }", "private void postProcess() {\n for (ClusterData cd : clusters) {\n for (String serverName : cd.serverRefs) {\n if (instanceName.equals(serverName)) {\n cluster = cd;\n return;\n }\n }\n }\n // if we get here that means the instance either \n // does not exist or it is stand-alone\n cluster = new ClusterData();\n cluster.configRef = serverConfigRef;\n cluster.serverRefs.add(instanceName);\n }", "@Override\n public Datasource createDatasource(final String name, final String url, \n final String username, final String password, final String driverClassName) \n throws ConfigurationException, DatasourceAlreadyExistsException {\n List<Datasource> conflictingDS = new ArrayList<>();\n for (Datasource datasource : getDatasources()) {\n if (name.equals(datasource.getJndiName())) {\n conflictingDS.add(datasource);\n }\n }\n if (conflictingDS.size() > 0) {\n throw new DatasourceAlreadyExistsException(conflictingDS);\n }\n if (tomcatVersion.isAtLeast(TomcatVersion.TOMCAT_55)) {\n if (tomeeVersion != null) {\n // we need to store it to resources.xml\n TomeeResources resources = getResources(true);\n assert resources != null;\n modifyResources( (TomeeResources tomee) -> {\n Properties props = new Properties();\n props.put(\"userName\", username); // NOI18N\n props.put(\"password\", password); // NOI18N\n props.put(\"jdbcUrl\", url); // NOI18N\n props.put(\"jdbcDriver\", driverClassName); // NOI18N\n StringWriter sw = new StringWriter();\n try {\n props.store(sw, null);\n } catch (IOException ex) {\n // should not really happen\n LOGGER.log(Level.WARNING, null, ex);\n }\n int idx = tomee.addTomeeResource(sw.toString());\n tomee.setTomeeResourceId(idx, name);\n tomee.setTomeeResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n });\n } else {\n // Tomcat 5.5.x or Tomcat 6.0.x\n modifyContext((Context context) -> {\n int idx = context.addResource(true);\n context.setResourceName(idx, name);\n context.setResourceAuth(idx, \"Container\"); // NOI18N\n context.setResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n context.setResourceDriverClassName(idx, driverClassName);\n context.setResourceUrl(idx, url);\n context.setResourceUsername(idx, username);\n context.setResourcePassword(idx, password);\n context.setResourceMaxActive(idx, \"20\"); // NOI18N\n context.setResourceMaxIdle(idx, \"10\"); // NOI18N\n context.setResourceMaxWait(idx, \"-1\"); // NOI18N\n });\n }\n } else {\n // Tomcat 5.0.x\n modifyContext((Context context) -> {\n int idx = context.addResource(true);\n context.setResourceName(idx, name);\n context.setResourceAuth(idx, \"Container\"); // NOI18N\n context.setResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n // check whether resource params not already defined\n ResourceParams[] resourceParams = context.getResourceParams();\n for (int i = 0; i < resourceParams.length; i++) {\n if (name.equals(resourceParams[i].getName())) {\n // if this happens in means that for this ResourceParams\n // element was no repspective Resource element - remove it\n context.removeResourceParams(resourceParams[i]);\n }\n }\n ResourceParams newResourceParams = createResourceParams(\n name,\n new Parameter[] {\n createParameter(\"factory\", \"org.apache.commons.dbcp.BasicDataSourceFactory\"), // NOI18N\n createParameter(\"driverClassName\", driverClassName), // NOI18N\n createParameter(\"url\", url), // NOI18N\n createParameter(\"username\", username), // NOI18N\n createParameter(\"password\", password), // NOI18N\n createParameter(\"maxActive\", \"20\"), // NOI18N\n createParameter(\"maxIdle\", \"10\"), // NOI18N\n createParameter(\"maxWait\", \"-1\") // NOI18N\n }\n );\n context.addResourceParams(newResourceParams);\n });\n }\n return new TomcatDatasource(username, url, password, name, driverClassName);\n }", "private DataNode(String machineName, \n String[] dataDirs, \n InetSocketAddress nameNodeAddr, \n Configuration conf ) throws IOException {\n File[] volumes = new File[dataDirs.length];\n for (int idx = 0; idx < dataDirs.length; idx++) {\n volumes[idx] = new File(dataDirs[idx]);\n }\n\n // use configured nameserver & interface to get local hostname\n machineName =\n DNS.getDefaultHost\n (conf.get(\"dfs.datanode.dns.interface\",\"default\"),\n conf.get(\"dfs.datanode.dns.nameserver\",\"default\"));\n \n // get storage info and lock the data dirs\n storage = new DataStorage( volumes );\n int numDirs = storage.getNumLocked();\n if (numDirs == 0) { // all data dirs are in use\n throw new IOException(\"Cannot start multiple Datanode instances \"\n + \"sharing the same data directories.\\n\"\n + StringUtils.arrayToString(dataDirs) + \" are locked. \");\n }\n volumes = storage.getLockedDirs();\n // connect to name node\n this.namenode = (DatanodeProtocol) \n RPC.waitForProxy(DatanodeProtocol.class,\n DatanodeProtocol.versionID,\n nameNodeAddr, \n conf);\n // find free port\n ServerSocket ss = null;\n int tmpPort = conf.getInt(\"dfs.datanode.port\", 50010);\n String bindAddress = conf.get(\"dfs.datanode.bindAddress\", \"0.0.0.0\");\n while (ss == null) {\n try {\n ss = new ServerSocket(tmpPort,0,InetAddress.getByName(bindAddress));\n LOG.info(\"Opened server at \" + tmpPort);\n } catch (IOException ie) {\n LOG.info(\"Could not open server at \" + tmpPort + \", trying new port\");\n tmpPort++;\n }\n }\n // construct registration\n this.dnRegistration = new DatanodeRegistration(\n DFS_CURRENT_VERSION, \n machineName + \":\" + tmpPort, \n storage.getStorageID(),\n -1,\n \"\" );\n // initialize data node internal structure\n this.data = new FSDataset(volumes, conf);\n this.dataXceiveServer = new Daemon(new DataXceiveServer(ss));\n\n long blockReportIntervalBasis =\n conf.getLong(\"dfs.blockreport.intervalMsec\", BLOCKREPORT_INTERVAL);\n this.blockReportInterval =\n blockReportIntervalBasis - new Random().nextInt((int)(blockReportIntervalBasis/10));\n this.heartBeatInterval = conf.getLong(\"dfs.heartbeat.interval\", HEARTBEAT_INTERVAL) * 1000L;\n this.nameNodeAddr = nameNodeAddr;\n }", "@Test\n @Ignore\n public void testDomainCatalogueService() {\n //Domain A objects\n final String DOMAIN_A_ID=\"DomainAid\";\n DomainInterface domainAinterface = new DomainInterface(\"url.url.rul\", 8080, true, InterfaceType.HTTP);\n VerticalDomainLayer verticalDomainLayer = new VerticalDomainLayer(\"verticalDomainLayerID\",DspType.VERTICAL_EXPERIMENT);\n ArrayList<DomainLayer> listOwnedLayerDomainA = new ArrayList<DomainLayer>();\n listOwnedLayerDomainA.add(verticalDomainLayer);\n Domain domainA = new Domain(DOMAIN_A_ID,\"domainNameA\",\"domainDescriptionA\",\"domainOwnerA\",\"Domain adminA\", DomainStatus.ACTIVE, listOwnedLayerDomainA,new HashSet<>(),domainAinterface);\n\n //Domain B objects\n final String DOMAIN_B_ID=\"DomainBid\";\n NspDomainLayer nspDomainLayer = new NHNspDomainLayer(\"nspDomainLayerID\",\"test\", \"test\");\n NfvoDomainLayer nfvoDomainLayer = new OsmNfvoDomainLayer(\"nfvoDomainLayerId\",\"username\", \"password\", \"project\");\n ArrayList<DomainLayer> listOwnedLayerDomainB = new ArrayList<DomainLayer>();\n listOwnedLayerDomainB.add(nspDomainLayer);\n listOwnedLayerDomainB.add(nfvoDomainLayer);\n DomainInterface domainBinterface = new DomainInterface(\"url2.url2.rul2\", 8081, true, InterfaceType.HTTP);\n Domain domainB = new Domain(DOMAIN_B_ID,\"domainNameB\",\"domainDescriptionB\",\"domainOwnerB\",\"Domain adminB\", DomainStatus.ACTIVE, listOwnedLayerDomainB,new HashSet<>(),domainBinterface);\n\n\n //Test on board Domain B and A\n log.info(\"Testing on boarding Domain B\");\n onBoardDomainTest(domainB);\n\n //An agreement between domain A and two domains layer owned by domain B is performed. Eventually, the domain A is on boarded with such info.\n ArrayList<String> idDomainLayers = new ArrayList<String>();\n idDomainLayers.add(domainB.getOwnedLayers().get(0).getDomainLayerId());\n idDomainLayers.add(domainB.getOwnedLayers().get(1).getDomainLayerId());\n\n DomainAgreement domainAgreement = new DomainAgreement(domainB.getDomainId(),idDomainLayers);\n HashSet<DomainAgreement> domainAgreements = new HashSet<DomainAgreement>();\n domainAgreements.add(domainAgreement);\n domainA.setDomainsAgreement(domainAgreements);\n log.info(\"Testing on boarding domain A\");\n onBoardDomainTest(domainA);\n try {\n domainCatalogueService.deleteDomain(domainA.getDomainId());\n } catch (NotExistingEntityException e) {\n e.printStackTrace();\n }\n boolean notFound=false;\n try {\n domainCatalogueService.getDomain(domainA.getDomainId());\n\n } catch (NotExistingEntityException e) {\n notFound=true;\n log.info(\"Element not found as expected\");\n }\n assertTrue(notFound);\n assertTrue(domainCatalogueService.getAllDomains().size()==1);\n }", "public static void main(String[] args) throws IOException{\n\t\tString accessToken = \"<YOUR_ACCESS_TOKEN>\";\n\t\t// The IBM Cloud organization & space to query - case sensitive.\n\t\tString org = \"<YOUR_ORG>\"; // Example: [email protected]\n\t\tString space = \"<YOUR_SPACE>\"; // Example: dev \n\n\t\t// Use TLSv1.2.\n\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t// Create the URL.\n\t\tURL orgsURL = new URL(apiEndpoint + \"/organizations/\" + org + \"/spaces/\" + space + \"/serviceinstances\");\n\t\tHttpURLConnection con = (HttpURLConnection) orgsURL.openConnection();\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"Authorization\", \"Bearer \" + accessToken);\n\t\tcon.setRequestProperty(\"Content-Type\",\"application/json\");\n\t\tcon.setDoOutput(true);\n\n\t\t/* CREATE OPTIONS\n\t\t * Type: The plan type to create.\n\t\t * \t\t\t\t\t\t\tEnum: [\"LibertyCollective\", \"LibertyCore\", \"LibertyNDServer\", \"WASBase\", \"WASCell\", \"WASNDServer\"]\n\t\t *\n\t\t * Name: Name your new service icon in IBM Cloud.\n\t\t *\n\t\t * ApplicationServerVMSize: The size of the virtual machine.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * ControlServerVMSize: The size of the Virtual Machine containing the Collective Controller for a LibertyCollective service instance,\n\t\t * \t\t\t\t\t\t\tor the size of the Virtual Machine containing the DMGR for a WASCell service instance. This is required for\n\t\t * \t\t\t\t\t\t \ttypes \"LibertyCollective\" and \"WASCell\", Illegal argument for the other Types.\n\t\t * \t\t\t\t\t\t\tEnum: [S, M, L, XL, XXL]\n\t\t *\n\t\t * NumberOfApplicationVMs: The number (integer) of application server Virtual Machines to create This is required for types \"LibertyCollective\"\n\t\t * \t\t\t\t\t\t\tand \"WASCell\", Illegal argument for the other Types.\n\t\t *\n\t\t * Software_Level: This is optional for types \"WASBase\", \"WASNDServer\", and \"WASCell\". If one is not specified version \"9.0.0\" will be default.\n\t\t * \t\t\t\t\t\t\tEnum: [\"8.5.5\", \"9.0.0\"]\n\t\t */\n\t\tString createOptionsJSON = \"{\\\"Type\\\":\\\"LibertyCore\\\",\\\"Name\\\":\\\"MyFirstAPIServiceInstance\\\",\\\"ApplicationServerVMSize\\\":\\\"S\\\"}\";\n\n\t\t// Add JSON POST data.\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(createOptionsJSON);\n\t\twr.flush();\n\t\twr.close();\n\n\t\tBufferedReader br = null;\n\t\tif (HttpURLConnection.HTTP_OK == con.getResponseCode()) {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t}\n\t\telse {\n\t\t\tbr = new BufferedReader(new InputStreamReader(con.getErrorStream()));\n\t\t}\n\n\t\tStringBuffer response = new StringBuffer();\n\t\tString line;\n\n\t\twhile ((line = br.readLine()) != null) {\n\t\t\tresponse.append(line);\n\t\t}\n\t\tbr.close();\n\n\t\t// Response from the request.\n\t\tSystem.out.println(response.toString());\n\n\t\t/* Example Response for creating a service instance of type \"LibertyCore\"\n\t\t * {\n\t\t * \t\"Status\":\"Active\",\n\t\t * \t\"ApplicationVMInfo\":\n\t\t * \t{\n\t\t * \t\t\"disk\":12.0,\n\t\t * \t\t\"memory\":2048,\"vcpu\":1\n\t\t * \t},\n\t\t * \t\"ServiceInstance\":\n\t\t * \t{\n\t\t * \t\t\"ServiceInstanceID\":\"8b80bac5-4e78-4a87-bb3e-0e4a8fd6d13a\",\n\t\t * \t\t\"ServiceType\":\"LibertyCore\",\n\t\t * \t\t\"SpaceID\":\"esw7jc13-b12a-47jn-9627-06jdu78d98ed\",\n\t\t * \t\t\"OrganizationID\":\"a23w6701-5324-4af8-b593-e9fdffer36a2\",\n\t\t * \t\t\"Name\":\"MyFirstAPIServiceInstance\"\n\t\t * \t}\n\t\t * }\n\t\t */\n\t}", "public void markIncludeDestHostCreate() throws JNCException {\n markLeafCreate(\"includeDestHost\");\n }", "private static void createSlave(Boolean cycle){\n\t\tISlaveNode slaveNode = new CSlaveNode(INode.ID_SLAVE);\n\t\t/* Creo Servidor */\n\t\tInteger port = slaveNode.getNodeConfiguration().getPort();\n\t\tCServer server = new CServer(port,slaveNode);\n\t\tserver.listen(cycle);\n\t}", "private void createInstance(RemoteService remote, Path tmp, String groupName, ProductManifest product, String instanceName,\n String... nodeNames) {\n InstanceConfiguration instanceConfig = TestFactory.createInstanceConfig(instanceName, product);\n try (BHive hive = new BHive(tmp.resolve(\"hive\").toUri(), null, new ActivityReporter.Null())) {\n PushOperation pushOperation = new PushOperation();\n Builder instanceManifest = new InstanceManifest.Builder().setInstanceConfiguration(instanceConfig);\n\n for (String nodeName : nodeNames) {\n InstanceNodeConfiguration nodeConfig = new InstanceNodeConfiguration();\n nodeConfig.id = UuidHelper.randomId();\n nodeConfig.applications.add(TestFactory.createAppConfig(product));\n\n Key instanceNodeKey = new InstanceNodeManifest.Builder().setInstanceNodeConfiguration(nodeConfig)\n .setMinionName(nodeName).insert(hive);\n instanceManifest.addInstanceNodeManifest(nodeName, instanceNodeKey);\n pushOperation.addManifest(instanceNodeKey);\n }\n\n Key instanceKey = instanceManifest.insert(hive);\n pushOperation.addManifest(instanceKey);\n hive.execute(pushOperation.setHiveName(groupName).setRemote(remote));\n }\n }", "private ReplicaInfo createNewReplicaObj(ExtendedBlock block, FsDatasetImpl\n fsDataSetImpl) throws IOException {\n ReplicaInfo replicaInfo = fsDataSetImpl.getReplicaInfo(block);\n FsVolumeSpi destVolume = getDestinationVolume(block, fsDataSetImpl);\n return fsDataSetImpl.copyReplicaToVolume(block, replicaInfo,\n destVolume.obtainReference());\n }", "void createComputeInstance(LaunchSpecifications launchSpecifications)\n throws CloudExceptions;", "public Ms2Cluster() { super(); }", "private boolean createPeer() {\n\t\tIH2HSerialize serializer = new FSTSerializer(false, new SCSecurityClassProvider());\n\t\th2hNode = H2HNode.createNode(FileConfiguration.createDefault(), new SpongyCastleEncryption(serializer), serializer);\n\t\tif (h2hNode.connect(networkConfig)) {\n\t\t\tLOG.debug(\"H2HNode successfully created.\");\n\n\t\t\tFutureBootstrap bootstrap = h2hNode.getPeer().peer().bootstrap().inetAddress(networkConfig.getBootstrapAddress()).ports(networkConfig.getBootstrapPort()).start();\n\t\t\tbootstrap.awaitUninterruptibly();\n\t\t\tboostrapAddresses = bootstrap.bootstrapTo();\n\t\t\treturn true;\n\t\t} else {\n\t\t\tLOG.error(\"H2HNode cannot connect.\");\n\t\t\treturn false;\n\t\t}\n\n\n\t}", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-03-24 16:07:21.755 -0400\", hash_original_method = \"6CE719C205449F0EA4502B7666A015C0\", hash_generated_method = \"598EFFAE1DD0E9452464135FF7EE1426\")\n \npublic static String p2pConnect(WifiP2pConfig config, boolean joinExistingGroup) {\n if (config == null) return null;\n List<String> args = new ArrayList<String>();\n WpsInfo wps = config.wps;\n args.add(config.deviceAddress);\n\n switch (wps.setup) {\n case WpsInfo.PBC:\n args.add(\"pbc\");\n break;\n case WpsInfo.DISPLAY:\n //TODO: pass the pin back for display\n args.add(\"pin\");\n args.add(\"display\");\n break;\n case WpsInfo.KEYPAD:\n args.add(wps.pin);\n args.add(\"keypad\");\n break;\n case WpsInfo.LABEL:\n args.add(wps.pin);\n args.add(\"label\");\n default:\n break;\n }\n\n //TODO: Add persist behavior once the supplicant interaction is fixed for both\n // group and client scenarios\n /* Persist unless there is an explicit request to not do so*/\n //if (config.persist != WifiP2pConfig.Persist.NO) args.add(\"persistent\");\n\n if (joinExistingGroup) args.add(\"join\");\n\n int groupOwnerIntent = config.groupOwnerIntent;\n if (groupOwnerIntent < 0 || groupOwnerIntent > 15) {\n groupOwnerIntent = 3; //default value\n }\n args.add(\"go_intent=\" + groupOwnerIntent);\n\n String command = \"P2P_CONNECT \";\n for (String s : args) command += s + \" \";\n\n return doStringCommand(command);\n }" ]
[ "0.72537225", "0.7115208", "0.6985777", "0.60574734", "0.5923377", "0.58679867", "0.5706707", "0.5516754", "0.54930973", "0.5464983", "0.5458991", "0.5441326", "0.53525615", "0.5274352", "0.5241603", "0.51800704", "0.5149127", "0.5134232", "0.5111367", "0.50610286", "0.5054839", "0.5050914", "0.5022226", "0.5016836", "0.5000652", "0.49985123", "0.49965075", "0.49941316", "0.49764404", "0.49575073", "0.49527875", "0.49515614", "0.49514413", "0.49288154", "0.49183497", "0.49151212", "0.4913288", "0.49033973", "0.48949605", "0.4879857", "0.48790187", "0.48772654", "0.48566064", "0.4853631", "0.48534957", "0.4848797", "0.48472193", "0.48471367", "0.48422083", "0.4834223", "0.48146012", "0.48072746", "0.48040393", "0.4799115", "0.4799051", "0.47935817", "0.47931775", "0.4792508", "0.4791321", "0.47875485", "0.47841525", "0.47743142", "0.4767897", "0.47574788", "0.47527808", "0.47526234", "0.47500226", "0.47447446", "0.4722169", "0.47201973", "0.47199407", "0.4719098", "0.4717823", "0.47137797", "0.47048295", "0.47029886", "0.47025666", "0.4689815", "0.4676156", "0.46694654", "0.4667904", "0.46607944", "0.46592385", "0.46579698", "0.4656753", "0.4652694", "0.46441126", "0.4643355", "0.46302092", "0.46225613", "0.4622513", "0.46147674", "0.4612324", "0.46116", "0.46078902", "0.46058252", "0.4602002", "0.45971885", "0.4595654", "0.45940366" ]
0.74904996
0
create data center brokers
private static DatacenterBroker createBroker(){ DatacenterBroker broker = null; try { broker = new DatacenterBroker("Broker"); } catch (Exception e) { e.printStackTrace(); return null; } return broker; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostConstruct\n private void init() {\n Properties props = new Properties();\n props.put(\"oracle.user.name\", user);\n props.put(\"oracle.password\", pwd);\n props.put(\"oracle.service.name\", serviceName);\n //props.put(\"oracle.instance.name\", instanceName);\n props.put(\"oracle.net.tns_admin\", tnsAdmin); //eg: \"/user/home\" if ojdbc.properies file is in home \n props.put(\"security.protocol\", protocol);\n props.put(\"bootstrap.servers\", broker);\n //props.put(\"group.id\", group);\n props.put(\"enable.auto.commit\", \"true\");\n props.put(\"auto.commit.interval.ms\", \"10000\");\n props.put(\"linger.ms\", 1000);\n // Set how to serialize key/value pairs\n props.setProperty(\"key.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n props.setProperty(\"value.serializer\", \"org.oracle.okafka.common.serialization.StringSerializer\");\n\n producer = new KafkaProducer<>(props);\n }", "private Datacenter createDatacenter(String name){\n List<Host> hostList = new ArrayList<Host>();\n\n for (int i=0; i<HostCount; i++){\n\n // 2. A Machine contains one or more PEs or CPUs/Cores.\n List<Pe> peList = new ArrayList<Pe>();\n\n // 3. Create PEs and add these into a list.\n for (int j=0; j<HostCoreCount; j++){\n peList.add(new Pe(j, new PeProvisionerSimple(HostCoreMips)));\n }\n\n\n //in this example, the VMAllocatonPolicy in use is SpaceShared. It means that only one VM\n //is allowed to run on each Pe. As each Host has only one Pe, only one VM can run on each Host.\n hostList.add(\n new Host(\n i,\n new RamProvisionerSimple(HostRam),\n new BwProvisionerSimple(HostBandwidth),\n HostStorage,\n peList,\n new VmSchedulerSpaceShared(peList)\n )\n );\n }\n\n\n // 5. Create a DatacenterCharacteristics object that stores the\n // properties of a data center: architecture, OS, list of\n // Machines, allocation policy: time- or space-shared, time zone\n // and its price (G$/Pe time unit).\n String arch = \"x86\"; // system architecture\n String os = \"Linux\"; // operating system\n String vmm = \"Xen\";\n double time_zone = 10.0; // time zone this resource located\n double cost = 3.0; // the cost of using processing in this resource\n double costPerMem = 0.05;\t\t// the cost of using memory in this resource\n double costPerStorage = 0.001;\t// the cost of using storage in this resource\n double costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n LinkedList<Storage> storageList = new LinkedList<Storage>();\t//we are not adding SAN devices by now\n\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n // 6. Finally, we need to create a PowerDatacenter object.\n Datacenter datacenter = null;\n\n try {\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return datacenter;\n }", "private static Datacenter CreateDataCenter() {\n\t\tList<Pe> peList = new ArrayList<Pe>();\n\t\t//One PE with 1000 Mips\n\t\tPeProvisionerSimple peProvisioner = new PeProvisionerSimple(1000);\n\t\t////Four 1000 MIPS PEs\n\t\tfor (int id = 0; id < 4; id++) {\n\t\t\tPe core = new Pe(id, peProvisioner);\n\t\t\tpeList.add(core);\n\t\t}\n\t\t//Initialize the hosts\n\t\tList<Host> hostList = new ArrayList<Host>();\n\t\t//8 GB RAM\n\t\tint ram = 8000;\n\t\t//1 MPBS network bandwidth\n\t\tint bw = 1000;\n\t\t//100 GB storage\n\t\tlong storage = 100000;\n\t\tfor (int id = 0; id < 4; id++) {\n\t\t\tHost host = new Host(id, new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList,\n\t\t\t\t\tnew VmSchedulerSpaceShared(peList));\n\t\t\thostList.add(host);\n\t\t}\n\t\t//Initialize the data center\n\t\tString architecture = \"x64\";\n\t\tString os = \"Kelly Linux\";\n\t\tString vmm = \"XEN\";\n\t\tdouble timeZone = -4.0;\n\t\tdouble computeCostPerSec = 3.0;\n\t\tdouble costPerMem = 1.0;\n\t\tdouble costPerStorage = 0.05;\n\t\tdouble costPerBW = 0.10;\n\t\tDatacenterCharacteristics datacenterCharacteristics = new DatacenterCharacteristics(architecture, os, vmm,\n\t\t\t\thostList, timeZone, computeCostPerSec, costPerMem, costPerStorage, costPerBW);\n\t\tLinkedList<Storage> SANstorage = new LinkedList<Storage>();\n\t\tDatacenter datacenter = null;\n\t\ttry {\n\t\t\tdatacenter = new Datacenter(\"datacenter0\", datacenterCharacteristics,\n\t\t\t\t\tnew VmAllocationPolicySimple(hostList), SANstorage, 1);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn datacenter;\n\t}", "@Override\n\tpublic KBase createKB() {\n\t\treturn BnetDistributedKB.create(this);\n\t}", "private void closeBrokers() {\n memberBroker.close();\naccountBroker.close();\n }", "public MALBrokerBinding createBroker(String localName, Blob authenticationId,\r\n QoSLevel[] expectedQos, UInteger priorityLevelNumber, Map qosProperties)\r\n throws MALException {\n return null;\r\n }", "private static Datacenter Create_Datacenter(String name){\n\t\t// creating list of host machine \n\t\tList<Host> hostList = new ArrayList<Host>();\n\t\t// creating list of CPU for each host machine, In our simulation with choose 1 core per machine \n\t\tList<Pe> peList1 = new ArrayList<Pe>();\n\t\tint mips = 1000; // computing power of each core\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\tpeList1.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t}\n\t\t// configuring host\n\t\tint hostId=0;\n\t\tint ram = 56320; //host memory 40 GB\n\t\tlong storage = 10240000; //host storage 10000 GB\n\t\tint bw = 102400; // bandwidth 100 Gbps\n\t\t// create first host machine with 4 cores \n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList1,\n \t\t\t\tnew VmSchedulerTimeShared(peList1)\n \t\t\t)\n \t\t);\n\t\t// create another host machine with 1 cores\n\t\tList<Pe> peList2 = new ArrayList<Pe>();\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\t\tpeList2.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t\t}\n\t\thostId++;\n\n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList2,\n \t\t\t\tnew VmSchedulerTimeShared(peList2)\n \t\t\t)\n \t\t);\n\t\t\n\t // configuring datacenter \n\t\tString arch = \"x86\"; // system architecture\n\t\tString os = \"Linux\"; // operating system\n\t\tString vmm = \"Xen\";\n\t\tdouble time_zone = 10.0; // time zone this resource located\n\t\tdouble cost = 3.0; // the cost of using processing in this resource\n\t\tdouble costPerMem = 0.05;\t\t// the cost of using memory in this resource\n\t\tdouble costPerStorage = 0.001;\t// the cost of using storage in this resource\n\t\tdouble costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n\t\tLinkedList<Storage> storageList = new LinkedList<Storage>();\n\t\tDatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n\t\t// creating data center \n\t\tDatacenter datacenter = null;\n\t\ttry {\n\t\t\tdatacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn datacenter;\n\t\t\n\t}", "private KafkaProducer<String, String> createProducer(String brokerList) {\n if (USERNAME==null) USERNAME = \"token\";\n\n Properties properties = new Properties();\n //common Kafka configs\n properties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, brokerList);\n properties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, \"SASL_SSL\");\n properties.put(SaslConfigs.SASL_MECHANISM, \"PLAIN\");\n properties.put(SaslConfigs.SASL_JAAS_CONFIG, \"org.apache.kafka.common.security.plain.PlainLoginModule required username=\\\"\" + USERNAME + \"\\\" password=\\\"\" + API_KEY + \"\\\";\");\n properties.put(SslConfigs.SSL_PROTOCOL_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENABLED_PROTOCOLS_CONFIG, \"TLSv1.2\");\n properties.put(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, \"HTTPS\");\n //Kafka producer configs\n properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.put(ProducerConfig.CLIENT_ID_CONFIG, \"stocktrader-producer\");\n properties.put(ProducerConfig.ACKS_CONFIG, \"all\");\n properties.put(ProducerConfig.CLIENT_DNS_LOOKUP_CONFIG,\"use_all_dns_ips\");\n\n KafkaProducer<String, String> kafkaProducer = null;\n \n try {\n kafkaProducer = new KafkaProducer<>(properties);\n } catch (KafkaException kafkaError ) {\n logger.warning(\"Error while creating producer: \"+kafkaError.getMessage());\n Throwable cause = kafkaError.getCause();\n if (cause != null) logger.warning(\"Caused by: \"+cause.getMessage());\n throw kafkaError;\n }\n return kafkaProducer;\n }", "private static Datacenter createDatacenter(String name) {\n List<Host> hostList = new ArrayList<Host>();\r\n\r\n // 2. A Machine contains one or more PEs or CPUs/Cores.\r\n // In this example, it will have only one core.\r\n List<Pe> peList = new ArrayList<Pe>();\r\n\r\n\r\n // 3. Create PEs and add these into a list.\r\n peList.add(new Pe(0, new PeProvisionerSimple(mips+100))); // need to store Pe id and MIPS Rating\r\n\r\n // 4. Create Host with its id and list of PEs and add them to the list\r\n // of machines\r\n long storage = 1000000; // host storage\r\n\r\n\r\n for (int hostId = 0; hostId < vmNum; hostId++) {\r\n hostList.add(\r\n new Host(\r\n hostId,\r\n new RamProvisionerSimple((int)((ram*1.1)/Constants.MB)),\r\n new BwProvisionerSimple(bw+10),\r\n storage,\r\n peList,\r\n new VmSchedulerTimeShared(peList)\r\n )\r\n ); // This is our machine\r\n }\r\n\r\n\r\n // 5. Create a DatacenterCharacteristics object that stores the\r\n // properties of a data center: architecture, OS, list of\r\n // Machines, allocation policy: time- or space-shared, time zone\r\n // and its price (G$/Pe time unit).\r\n String arch = \"x86\"; // system architecture\r\n String os = \"Linux\"; // operating system\r\n String vmm = \"Xen\";\r\n double time_zone = 10.0; // time zone this resource located\r\n double cost = 3.0; // the cost of using processing in this resource\r\n double costPerMem = 0.05; // the cost of using memory in this resource\r\n double costPerStorage = 0.001; // the cost of using storage in this\r\n // resource\r\n double costPerBw = 0.0; // the cost of using bw in this resource\r\n LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN\r\n // devices by now\r\n\r\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\r\n arch, os, vmm, hostList, time_zone, cost, costPerMem,\r\n costPerStorage, costPerBw);\r\n\r\n // 6. Finally, we need to create a PowerDatacenter object.\r\n Datacenter datacenter = null;\r\n try {\r\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return datacenter;\r\n }", "private ClientBootstrap createPeerBootStrap() {\n\n if (workerThreads == 0) {\n execFactory = new NioClientSocketChannelFactory(\n Executors.newCachedThreadPool(groupedThreads(\"onos/pcc\", \"boss-%d\")),\n Executors.newCachedThreadPool(groupedThreads(\"onos/pcc\", \"worker-%d\")));\n return new ClientBootstrap(execFactory);\n } else {\n execFactory = new NioClientSocketChannelFactory(\n Executors.newCachedThreadPool(groupedThreads(\"onos/pcc\", \"boss-%d\")),\n Executors.newCachedThreadPool(groupedThreads(\"onos/pcc\", \"worker-%d\")),\n workerThreads);\n return new ClientBootstrap(execFactory);\n }\n }", "public BrokerAlgo() {}", "public static void main(String[] args) throws Exception {\n DefaultMQProducer producer = new\n DefaultMQProducer(\"producer1\");\n //Launch the instance.\n producer.setNamesrvAddr(\"192.168.0.159:9876\");\n\n producer.start();\n for (int i = 0; i < 2000; i++) {\n //Create a message instance, specifying topic, tag and message body.\n Message msg = new Message(\"test111\" /* Topic */,\n \"TagA\" /* Tag */,\n (\"{\\\"_db_\\\":\\\"order_service\\\",\\\"_table_\\\":\\\"order_base\\\",\\\"_event_\\\":\\\"row_insert\\\",\\\"order_id\\\":\\\"1\" + i +\"\\\",\\\"order_from\\\":\\\"rocketmq\\\",\\\"order_no\\\":\\\"P12311111\\\",\" +\n \"\\\"category\\\":\\\"1\\\",\\\"serve_type\\\":\\\"2\\\",\\\"account_id\\\":\\\"\\\",\\\"account_type\\\":\\\"\\\",\\\"order_status\\\":\\\"\\\",\\\"region_id\\\":\\\"\\\",\\\"appoint_method\\\":\\\"\\\",\\\"sp_type\\\":\\\"\\\",\\\"order_type\\\":\\\"\\\",\\\"is_delete\\\":\\\"\\\",\\\"refund_status\\\":\\\"\\\",\\\"order_pay_status\\\":\\\"\\\",\\\"is_logistics\\\":\\\"\\\",\\\"repair_type\\\":\\\"\\\",\\\"is_return\\\":\\\"\\\",\\\"create_time\\\":\\\"\\\",\\\"update_time\\\":\\\"\\\"}\").getBytes(RemotingHelper.DEFAULT_CHARSET) /* Message body */\n );\n //Call send message to deliver message to one of brokers.\n SendResult sendResult = producer.send(msg);\n System.out.printf(\"%s%n\", sendResult);\n }\n //Shut down once the producer instance is not longer in use.\n producer.shutdown();\n }", "@Override\n\tpublic KBase newKB() throws RemoteException {\n\t\treturn BnetDistributedKB.create(this);\n\t}", "public MALBrokerBinding createBroker(MALEndpoint endPoint,\r\n Blob authenticationId, QoSLevel[] expectedQos,\r\n UInteger priorityLevelNumber, Map qosProperties) throws MALException {\n return null;\r\n }", "abstract ManagedChannel createChannel(List<ServerInfo> servers);", "void setBrokerName(String brokerName);", "private void setupBroker(String uri) {\n try {\n broker = BrokerFactory.createBroker(uri);\n\n VirtualDestinationInterceptor interceptor = new VirtualDestinationInterceptor();\n VirtualTopic virtualTopic = new VirtualTopic();\n virtualTopic.setName(\"VirtualOrders.>\");\n virtualTopic.setSelectorAware(true);\n VirtualDestination[] virtualDestinations = { virtualTopic };\n interceptor.setVirtualDestinations(virtualDestinations);\n broker.setDestinationInterceptors(new DestinationInterceptor[]{interceptor});\n\n SubQueueSelectorCacheBrokerPlugin subQueueSelectorCacheBrokerPlugin = new SubQueueSelectorCacheBrokerPlugin();\n BrokerPlugin[] updatedPlugins = {subQueueSelectorCacheBrokerPlugin};\n broker.setPlugins(updatedPlugins);\n\n broker.setUseJmx(false);\n broker.start();\n broker.waitUntilStarted();\n } catch (Exception e) {\n LOG.error(\"Failed creating broker\", e);\n }\n }", "void retrieveBrokerList() {\n java.util.logging.Logger.getLogger(TAG).log(Level.INFO, \"Start: retrieveBrokerList()\");\n // request the list to the cloud\n // parse the response and add brokers to \"brokers\"\n NetworkThread thread = new NetworkThread();\n thread.start();\n try {\n thread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n java.util.logging.Logger.getLogger(TAG).log(Level.INFO, \"Finish: retrieveBrokerList()\");\n }", "private static void createCouchbaseClient() {\n LOGGER.debug(\"Creating Couchbase Client\");\n String bucket = CONFIG.getString(\"couchbase.bucket\");\n String[] hosts = CONFIG.getString(\"couchbase.host\").split(\";\");\n String port = CONFIG.getString(\"couchbase.port\");\n String base = CONFIG.getString(\"couchbase.base\");\n\n List<URI> uris = new ArrayList<>();\n for (final String host : hosts) {\n uris.add(URI.create(\"http://\" + host + \":\" + port + \"/\" + base));\n }\n try {\n tapClient = new TapClient(uris, bucket, \"\");\n } catch (Exception ex) {\n LOGGER.error(\"Caught exception trying to connect to Couchbase\", ex);\n }\n }", "@Override\n\tpublic void createClient(Client clt) {\n\t\t\n\t}", "@Override\r\n\tprotected void setup() {\n\t\tgetContentManager().registerLanguage(codec);\r\n\t\tgetContentManager().registerOntology(ontology);\r\n\t\t\r\n\t\tObject[] args = getArguments();\r\n\t\tif(args != null && args.length > 0) {\r\n\t\t\tbroker = (Broker)args[0];\r\n\t\t} else {\r\n\t\t\tbroker = new Broker(\"Broker\");\r\n\t\t}\r\n\t\t\r\n\t\tProgramGUI.getInstance().printToLog(broker.hashCode(), getLocalName(), \"created\", Color.GREEN.darker());\r\n\t\t\r\n\t\t// Register in the DF\r\n\t\tDFRegistry.register(this, BROKER_AGENT);\r\n\t\t\r\n\t\tsubscribeToRetailers();\r\n\t\tquery();\r\n\t\tpurchase();\r\n\t}", "@Override\n\tpublic void startDatacenters() throws Exception {\n\t}", "public static void main(String[] args) {\n\t\tint[][] ports = {{2001, 0, 2002, 2003, 0},\r\n\t\t\t\t\t\t {2002, 2001, 2004, 2005, 2010},\r\n\t\t\t\t\t\t {2003, 2001, 2006, 2017, 2018},\r\n\t\t\t\t\t\t {2004, 2002, 2011, 2012, 0},\r\n\t\t\t\t\t\t {2005, 2002, 2013, 2014, 0},\r\n\t\t\t\t\t\t {2006, 2003, 2015, 2016, 0},\r\n\t\t\t\t\t\t {2010, 2002, 0, 0, 0},\r\n\t\t\t\t\t\t {2011, 2004, 0, 0, 0},\r\n\t\t\t\t\t\t {2012, 2004, 0, 0, 0},\r\n\t\t\t\t\t\t {2013, 2005, 0, 0, 0},\r\n\t\t\t\t\t\t {2014, 2005, 0, 0, 0},\r\n\t\t\t\t\t\t {2015, 2006, 0, 0, 0},\r\n\t\t\t\t\t\t {2016, 2006, 0, 0, 0},\r\n\t\t\t\t\t\t {2017, 2003, 0, 0, 0},\r\n\t\t\t\t\t\t {2018, 2003, 0, 0, 0}};\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tint portForBrokers = 2001;\t//Keep track of current next available port number for Broker\r\n\t\tint portForClients = 2010;\t//Keep track of current next available port number for Client\r\n\t\tfinal int portOfSuperBroker = 2000; //The port number for the Super Broker\r\n\t\tint currentPortForBroker=portForBrokers;\r\n\t\tint currentPortForClient=portForClients;\r\n\t\tString inputLine;\r\n\t\t\r\n\t\ttry (ServerSocket serverSocket = new ServerSocket(portOfSuperBroker)){ //initialize the ServerSocket\r\n\t\t\twhile (true){\r\n\t\t\t\t//Create a new connection with either a Broker or a Client\r\n\t\t\t\tSocket clientSocket = serverSocket.accept();\r\n\t\t\t\t\r\n\t\t\t\tPrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);\r\n\t BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\r\n\t\t\t\t\r\n\t inputLine = in.readLine();\r\n\t \r\n\t int childIndex = 2;\t// The childIndex starts from 2 according to the structure table\r\n\t while (!inputLine.equals(\"I'm done.\")){\r\n\t \tif (inputLine.equals(\"I'm a Broker. What is my port?\")){\r\n\t \t\t//Check if the port number for Broker beyond its range\r\n\t \t\tif (portForBrokers > 2006){\r\n\t\t\t\t\t\t\tSystem.err.println(\"SuperBroker: There's no more port availble for Broker!\");\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t \t\tout.println(portForBrokers);\r\n\t\t\t\t\t\tcurrentPortForBroker=portForBrokers;\r\n\t \t\tportForBrokers++;\r\n\t\t\t\t\t\tchildIndex=2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (inputLine.equals(\"I'm a Broker. What is my parent's port?\")){\r\n\t\t\t\t\t\t//To find the corresponding entry in the structure table\r\n\t\t\t\t\t\tfor (int i=0; i<15; i++){\r\n\t\t\t\t\t\t\tif (ports[i][0] == (currentPortForBroker)){\r\n\t\t\t\t\t\t\t\tout.println(ports[i][1]);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (inputLine.equals(\"I'm a Broker. What is my child's port?\")){\r\n\t\t\t\t\t\t//To find the corresponding entry in the structure table\r\n\t\t\t\t\t\tfor (int i=0; i<15; i++){\r\n\t\t\t\t\t\t\tif (ports[i][0] == (currentPortForBroker)){\r\n\t\t\t\t\t\t\t\tif (ports[i][childIndex] != 0){\r\n\t\t\t\t\t\t\t\t\tif (childIndex > 4){\r\n\t\t\t\t\t\t\t\t\t\tSystem.err.println(\"SuperBroker: There's no more children for this broker!\");\r\n\t\t\t\t\t\t\t\t\t\tSystem.exit(1);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tout.println(ports[i][childIndex]);\r\n\t\t\t\t\t\t\t\t\tchildIndex++;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\t\tout.println(\"0\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (inputLine.equals(\"I'm a Client. What is my port?\")){\r\n\t\t\t\t\t\t//Check if the port number of Client beyond its range\r\n\t\t\t\t\t\tif (portForClients > 2018){\r\n\t\t\t\t\t\t\tSystem.err.println(\"SuperBroker: There's no more port availble for Client!\");\r\n\t\t\t\t\t\t\tSystem.exit(1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tout.println(portForClients);\r\n\t\t\t\t\t\tcurrentPortForClient=portForClients;\r\n\t\t\t\t\t\tportForClients++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (inputLine.equals(\"I'm a Client. What is my broker's port?\")){\r\n\t\t\t\t\t\t//To find the corresponding entry in the structure table\r\n\t\t\t\t\t\tfor (int i=0; i<15; i++){\r\n\t\t\t\t\t\t\tif (ports[i][0] == (currentPortForClient)){\r\n\t\t\t\t\t\t\t\tout.println(ports[i][1]);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else break;\r\n\t \tinputLine = in.readLine();\r\n\t }\r\n\t \r\n\t out.close();\r\n\t in.close();\r\n\t\t\t\tclientSocket.close();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"I/O Exception caught at SuperBroker. System will shut down now.\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n public void testZookeeperCacheLoader() throws InterruptedException, KeeperException, Exception {\n\n DiscoveryZooKeeperClientFactoryImpl.zk = mockZookKeeper;\n\n @SuppressWarnings(\"resource\")\n ZookeeperCacheLoader zkLoader = new ZookeeperCacheLoader(new DiscoveryZooKeeperClientFactoryImpl(), \"\", 30_000);\n\n List<String> brokers = Lists.newArrayList(\"broker-1:15000\", \"broker-2:15000\", \"broker-3:15000\");\n for (int i = 0; i < brokers.size(); i++) {\n try {\n LoadManagerReport report = i % 2 == 0 ? getSimpleLoadManagerLoadReport(brokers.get(i))\n : getModularLoadManagerLoadReport(brokers.get(i));\n zkLoader.getLocalZkCache().getZooKeeper().create(LOADBALANCE_BROKERS_ROOT + \"/\" + brokers.get(i),\n ObjectMapperFactory.getThreadLocal().writeValueAsBytes(report), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n } catch (Exception e) {\n fail(\"failed while creating broker znodes\");\n }\n }\n\n // strategically wait for cache to get sync\n for (int i = 0; i < 5; i++) {\n if (zkLoader.getAvailableBrokers().size() == 3 || i == 4) {\n break;\n }\n Thread.sleep(1000);\n }\n\n // 2. get available brokers from ZookeeperCacheLoader\n List<LoadManagerReport> list = zkLoader.getAvailableBrokers();\n\n // 3. verify retrieved broker list\n Set<String> cachedBrokers = list.stream().map(loadReport -> loadReport.getWebServiceUrl())\n .collect(Collectors.toSet());\n Assert.assertEquals(list.size(), brokers.size());\n Assert.assertTrue(brokers.containsAll(cachedBrokers));\n\n // 4.a add new broker\n final String newBroker = \"broker-4:15000\";\n LoadManagerReport report = getSimpleLoadManagerLoadReport(newBroker);\n zkLoader.getLocalZkCache().getZooKeeper().create(LOADBALANCE_BROKERS_ROOT + \"/\" + newBroker,\n ObjectMapperFactory.getThreadLocal().writeValueAsBytes(report), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n brokers.add(newBroker);\n\n Thread.sleep(100); // wait for 100 msec: to get cache updated\n\n // 4.b. get available brokers from ZookeeperCacheLoader\n list = zkLoader.getAvailableBrokers();\n\n // 4.c. verify retrieved broker list\n cachedBrokers = list.stream().map(loadReport -> loadReport.getWebServiceUrl()).collect(Collectors.toSet());\n Assert.assertEquals(list.size(), brokers.size());\n Assert.assertTrue(brokers.containsAll(cachedBrokers));\n\n }", "@Override\n\tpublic void createClient() {\n\t\t\n\t}", "@Bean\n BrokerService broker() throws Exception {\n BrokerService broker = new BrokerService();\n // configure the broker\n broker.addConnector(BROKER_URL);\n broker.start();\n return broker;\n }", "public static void main(String[] args) throws Exception {\n zooKeeper = new ZooKeeper(\"192.168.24.120:2181\",500,new CreateNodeSyn());\n countDownLatch.await();\n String path = zooKeeper.create(\"/zk-test-book-\", \"123\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);\n System.out.println(\"Success create zNode:\" + path);\n String path2 = zooKeeper.create(\"/zk-test-book-\", \"123\".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);\n System.out.println(\"Success create zNode:\" + path2);\n }", "@BeforeMethod\n void setup() throws Exception {\n bkEnsemble = new LocalBookkeeperEnsemble(3, 0, () -> 0);\n bkEnsemble.start();\n // Start broker\n ServiceConfiguration config = new ServiceConfiguration();\n config.setLoadManagerClassName(ModularLoadManagerImpl.class.getName());\n config.setClusterName(\"use\");\n config.setWebServicePort(Optional.of(0));\n config.setMetadataStoreUrl(\"zk:127.0.0.1:\" + bkEnsemble.getZookeeperPort());\n\n config.setAdvertisedAddress(\"localhost\");\n config.setBrokerShutdownTimeoutMs(0L);\n config.setLoadBalancerOverrideBrokerNicSpeedGbps(Optional.of(1.0d));\n config.setBrokerServicePort(Optional.of(0));\n config.setBrokerServicePortTls(Optional.of(0));\n config.setWebServicePortTls(Optional.of(0));\n pulsar = new PulsarService(config);\n pulsar.start();\n }", "public void createMiniKdcConf() {\n\t\tconf = MiniKdc.createConf();\n\t}", "public static void main(String[] args) throws Exception{\n\n\t\tLogo.printLogo();\n\t\tSystem.out.print(\"GUMBOCOIN version: 0-0-0 made by Carson\");\n//\t\tfor(int i = 0;i<5;i++){\n//\t\t\tThread.sleep(100);\n//\t\t\tSystem.out.print(\".\");\n//\t\t}\n\t\tSystem.out.println(\"\\nstarting!\\n\\n\");\n\t\t\n//\t\t\n//\t\tnew ClientConsole(\"public key\").prifatHelp();\n//\t\t\n//\t\tSystem.exit(0);\n\t\t\n\t\tboolean server = false;\n\t\t\n\t\t\n\t\tString publicKey1 = \"key--publicKey1\";\n\t\tString privateKey1 = \"key--privateKey1\";\n\t\tString publicKey2 = \"key--publicKey2\";\n\t\tString privateKey2 = \"key--privateKey2\";\n\t\t\n\t\t\n\t\t\n\t\tif(server) {\n\t\t\tBlockChainManager manager = new BlockChainManager();\n\t\t\tnew Server(manager).start(1111);\n\t\t\tSystem.exit(0);\n\t\t}\n\t\t\n\t\tConversation.summitUser(new UserPayload(publicKey1,privateKey1));\n\t\t\n\t\t\n//\t\tUserPayload user1 = new UserPayload(publicKey1, privateKey1);\n//\t\tUserPayload user2 = new UserPayload(publicKey2, privateKey2);\n//\t\t\n//\t\tConversation.summitUser(user1);\n\t\t\n//\t\t\n//\t\tTransaction t = new Transaction(BlockClient.hashKeys(publicKey1, privateKey1),publicKey1,publicKey2);\n//\t\tt.sign(privateKey1);\n//\t\tt.setAmount(10);\n\t\t\n//\t\tmanager.addTransaction(t);\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n//\t\tfor(int i = 0;i<5;i++) {\n//\t\t\tThread.sleep(1000);\n//\t\t\tSystem.out.println(\"\\n\\n\\nstarting loop\");\n//\t\t\tDataPayload data = Conversation.getDataPayload();\n//\t\t\tSystem.out.println(\"=========\\\\/data from server:\" + ObjectToJson.dataPayloadToString(data));\n//\t\t\tdata.blockchain.printChainHashes();\n//\t\t\tSystem.out.println(\"received data\");\n//\t\t\tBlockChain chain;\n//\t\t\tchain = data.blockchain.copy();\n//\t\t\tSystem.out.println(\"========hashing data\");\n//\t\t\tchain.hashAllBlocks();\n//\t\t\tSystem.out.println(\"========mining\");\n//\t\t\tchain.mine(data);\n//\t\t\tSystem.out.println(\"=========\\\\/total chain:\" + ObjectToJson.dataPayloadToString(new DataPayload(chain,new BlockChainDataContainer())));//just to print the chain\n//\t\t\tchain.printChainHashes();\n//\t\t\tSystem.out.println(Conversation.requestSync(new SyncPayload(chain, (i%2 == 0 ? publicKey1 : publicKey2))));\n//\t\t}\n//\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\tfor(int i = 0;i<5;i++) {\n\t\t\tThread.sleep(1000);\n\t\t\tSystem.out.println(\"\\n\\n\\nstarting loop\");\n\t\t\tDataPayload data = Conversation.getDataPayload();\n\t\t\tSystem.out.println(\"=========\\\\/data from server:\" + ObjectToJson.dataPayloadToString(data));\n\t\t\tdata.blockchain.printChainHashes();\n\t\t\tSystem.out.println(\"received data\");\n\t\t\tBlockChain chain;\n\t\t\tchain = data.blockchain.copy();\n\t\t\tSystem.out.println(\"========hashing data\");\n\t\t\tchain.hashAllBlocks();\n\t\t\tSystem.out.println(\"========mining\");\n\t\t\tchain.mine(data);\n\t\t\tSystem.out.println(\"=========\\\\/total chain:\" + ObjectToJson.dataPayloadToString(new DataPayload(chain,new BlockChainDataContainer())));//just to print the chain\n\t\t\tchain.printChainHashes();\n\t\t\tSystem.out.println(Conversation.requestSync(new SyncPayload(chain, (i%2 == 0 ? publicKey1 : publicKey2))));\n\t\t}\n}", "public static void main(String[] args) throws Exception {\n\t\tProperties props = new Properties();\n\t\tprops.put(\"bootstrap.servers\", \"127.0.0.1:9092\");\n\t\tprops.put(\"acks\", \"all\");\n\t\tprops.put(\"retries\", 0);\n\t\tprops.put(\"batch.size\", 16384);\n\t\tprops.put(\"linger.ms\", 1);\n\t\tprops.put(\"buffer.memory\", 33554432);\n\t\tprops.put(\"key.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\t\tprops.put(\"value.serializer\", \"org.apache.kafka.common.serialization.StringSerializer\");\n\n\t\t/*\n\t\t * Define new Kafka producer\n\t\t */\n\t\t@SuppressWarnings(\"resource\")\n\t\tProducer<String, String> producer = new KafkaProducer<>(props);\n\n\t\t/*\n\t\t * parallel generation of JSON messages on Transaction topic\n\t\t * \n\t\t * this could also include business logic, projection, aggregation, etc.\n\t\t */\n\t\tThread transactionThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Transaction\";\n\t\t\t\tList<JSONObject> transactions = new ArrayList<JSONObject>();\n\t\t\t\tinitJSONData(\"ETLSpark_Transactions.json\", transactions);\n\t\t\t\tfor (int i = 0; i < transactions.size(); i++) {\n\t\t\t\t\tif (i % 200 == 0) {\n\t\t\t\t\t\tSystem.out.println(\"200 Transaction Messages procuded\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), transactions.get(i).toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * parallel generation of customer topic messages \n\t\t */\n\t\tThread customerThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Customer\";\n\t\t\t\tList<JSONObject> customer = new ArrayList<JSONObject>();\n\t\t\t\tinitJSONData(\"ETLSpark_Customer.json\", customer);\n\t\t\t\tfor (int i = 0; i < customer.size(); i++) {\n\t\t\t\t\tif (i % 200 == 0) {\n\t\t\t\t\t\tSystem.out.println(\"200 Customer Messages procuded\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), customer.get(i).toString()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/*\n\t\t * parallel generation of messages (variable produceMessages)\n\t\t * \n\t\t * generated messages are based on mockaroo api\n\t\t */\n\t\tint produceMessages = 100000;\n\t\tThread accountThread = new Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tString topic = \"Account\";\n\t\t\t\tfor (int i = 0; i < produceMessages; i++) {\n//\t\t\t\t\tSystem.out.println(\"Account procuded\");\n\t\t\t\t\tproducer.send(new ProducerRecord<String, String>(topic, Integer.toString(i), getRandomTransactionJSON(i)));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\ttransactionThread.start();\n\t\tcustomerThread.start();\n\t\taccountThread.start();\n\n\t}", "public void createContract() {\n\r\n\t}", "@Override\n\tprotected XmlStation createCwbData(List<DbStation> stns) throws DatatypeConfigurationException {\n\t\tXmlStation cwbData = factory.createCwbdata();\n\t\tcwbData.setIdentifier(UUID.randomUUID().toString());\n\t\tcwbData.setDatasetID(dataSetId);\n\t\tcwbData.setDatasetName(DATASET_NAME);\n\t\tcwbData.setDataItemID(dataItemId);\n\t\tcwbData.setDataItemName(DATAITEM_NAME);\n\t\tcwbData.setSender(attr.SENDER);\n\t\tcwbData.setSent(Utility.getXmlDateTime(LocalDateTime.now()));\n\t\tcwbData.setStatus(attr.STATUS_ACTUAL);\n\t\tcwbData.setScope(attr.SCOPE_PUBLIC);\n\t\tcwbData.setMsgType(attr.MSG_TYPE_ISSUE);\n\t\tcwbData.setPublisherOID(attr.PUBLISHER_OID);\n\t\tcwbData.setNote(NOTE);\n\t\t\n\t\tXmlStation.Resources resources = factory.createCwbdataResources();\n\t\tXmlStation.Resources.Resource resource = factory.createCwbdataResourcesResource();\n\t\tXmlStation.Resources.Resource.Metadata metadata = factory.createCwbdataResourcesResourceMetadata();\n\t\tresource.setMetadata(createMetadata(metadata));\n\t\t\n\t\tData data = factory.createCwbdataResourcesResourceData();\n\t\tStationsStatus stnStatus = factory.createCwbdataResourcesResourceDataStationsStatus();\n\t\tstnStatus.getStation().addAll(createStns(stns));\n\t\tdata.setStationsStatus(stnStatus);\n\t\tresource.setData(data);\n\t\tresources.setResource(resource);\n\t\tcwbData.setResources(resources);\n\t\treturn cwbData;\n\t}", "private void createRpBlockConsistencyGroups() {\n DbClient dbClient = this.getDbClient();\n List<URI> protectionSetURIs = dbClient.queryByType(ProtectionSet.class, false);\n\n Iterator<ProtectionSet> protectionSets =\n dbClient.queryIterativeObjects(ProtectionSet.class, protectionSetURIs);\n\n while (protectionSets.hasNext()) {\n ProtectionSet ps = protectionSets.next();\n Project project = dbClient.queryObject(Project.class, ps.getProject());\n\n BlockConsistencyGroup cg = new BlockConsistencyGroup();\n cg.setId(URIUtil.createId(BlockConsistencyGroup.class));\n cg.setLabel(ps.getLabel());\n cg.setDeviceName(ps.getLabel());\n cg.setType(BlockConsistencyGroup.Types.RP.toString());\n cg.setProject(new NamedURI(project.getId(), project.getLabel()));\n cg.setTenant(project.getTenantOrg());\n\n dbClient.createObject(cg);\n\n log.debug(\"Created ConsistencyGroup (id={}) based on ProtectionSet (id={})\",\n cg.getId().toString(), ps.getId().toString());\n\n // Organize the volumes by replication set\n for (String protectionVolumeID : ps.getVolumes()) {\n URI uri = URI.create(protectionVolumeID);\n Volume protectionVolume = dbClient.queryObject(Volume.class, uri);\n protectionVolume.addConsistencyGroup(cg.getId().toString());\n\n dbClient.persistObject(protectionVolume);\n\n log.debug(\"Volume (id={}) added to ConsistencyGroup (id={})\",\n protectionVolume.getId().toString(), cg.getId().toString());\n }\n }\n }", "private void runBCIDCreatorService(){\n\n // Initialize variables\n dataGroupMinter dataset = null;\n SettingsManager sm = SettingsManager.getInstance();\n sm.loadProperties();\n\n EZIDService ezidAccount = new EZIDService();\n Integer user_id = 1;\n Integer NAAN = new Integer(sm.retrieveValue(\"bcidNAAN\"));\n Integer ResourceType = ResourceTypes.PRESERVEDSPECIMEN;\n String doi = null;\n String webaddress = null;\n String title = \"TEST Load from Java\";\n\n // Create a new dataset\n System.out.println(\"\\nCreating a new dataset\");\n dataset = new dataGroupMinter(true, true);\n dataset.mint(NAAN, user_id, new ResourceTypes().get(ResourceType).uri, doi, webaddress, null,title);\n dataset.close();\n\n /*\n // Create test data by using input file\n String path = Thread.currentThread().getContextClassLoader().getResource(\"bigfile.txt\").getFile();\n System.out.println(\"\\nReading input file = \" + path + \" ...\");\n try {\n testDatafile = new inputFileParser(readFile(path), dataset).elementArrayList;\n } catch (IOException e) {\n e.printStackTrace();\n } catch (URISyntaxException e) {\n e.printStackTrace();\n }\n\n\n // Create an elementMinter object by using a dataset\n elementMinter minter = new elementMinter(dataset.getDatasets_id());\n\n // Mint a list of identifiers\n System.out.println(\"\\nPreparing to mint \" + testDatafile.size()+ \" identifiers\");\n String datasetUUID = minter.mintList(testDatafile);\n\n // Return the list of identifiers that were made here\n System.out.println(JSONArray.fromObject(minter.getIdentifiers(datasetUUID)).toString());\n */\n }", "public BrokersStatus()\r\n {\r\n brokers = new ArrayList<BrokerStatus>();\r\n }", "@Override\n ManagedChannel createChannel(List<ServerInfo> servers) {\n checkArgument(!servers.isEmpty(), \"No management server provided.\");\n XdsLogger logger = XdsLogger.withPrefix(\"xds-client-channel-factory\");\n ServerInfo serverInfo = servers.get(0);\n String serverUri = serverInfo.getServerUri();\n logger.log(XdsLogLevel.INFO, \"Creating channel to {0}\", serverUri);\n List<ChannelCreds> channelCredsList = serverInfo.getChannelCredentials();\n ManagedChannelBuilder<?> channelBuilder = null;\n // Use the first supported channel credentials configuration.\n // Currently, only \"google_default\" is supported.\n for (ChannelCreds creds : channelCredsList) {\n if (creds.getType().equals(\"google_default\")) {\n logger.log(XdsLogLevel.INFO, \"Using channel credentials: google_default\");\n channelBuilder = GoogleDefaultChannelBuilder.forTarget(serverUri);\n break;\n }\n }\n if (channelBuilder == null) {\n logger.log(XdsLogLevel.INFO, \"Using default channel credentials\");\n channelBuilder = ManagedChannelBuilder.forTarget(serverUri);\n }\n\n return channelBuilder\n .keepAliveTime(5, TimeUnit.MINUTES)\n .build();\n }", "@Override\n protected void setUp() throws Exception {\n brokerService = new BrokerService();\n LevelDBStore adaptor = new LevelDBStore();\n brokerService.setPersistenceAdapter(adaptor);\n brokerService.deleteAllMessages();\n\n // A small max page size makes this issue occur faster.\n PolicyMap policyMap = new PolicyMap();\n PolicyEntry pe = new PolicyEntry();\n pe.setMaxPageSize(1);\n policyMap.put(new ActiveMQQueue(\">\"), pe);\n brokerService.setDestinationPolicy(policyMap);\n\n brokerService.addConnector(ACTIVEMQ_BROKER_BIND);\n brokerService.start();\n\n ACTIVEMQ_BROKER_URI = brokerService.getTransportConnectors().get(0).getPublishableConnectString();\n destination = new ActiveMQQueue(getName());\n }", "public StockBrokerImpl() throws java.rmi.RemoteException {\n\t\tsuper();\n\t\tthis.priceUpdater = new PriceUpdater();\n\t\tthis.priceUpdater.start();\n\t}", "Communicator createCommunicator();", "public static void main(String[] args) throws Exception {\n\t\tZkHosts zkHosts = new ZkHosts(\"192.168.0.111:2181\");\n\t\t//Create the KafkaSpout configuration\n\t\t//Second argument -> topic name\n\t\t//Third argument -> zk root for Kafka\n\t\t//Forth argument -> consumer group id\n\t\t\n\t\tSpoutConfig kafkaConfig = new SpoutConfig(zkHosts, \"words_topic\", \"\", \"id111\");\n\t\t//Specify kafka message type\n\t\tkafkaConfig.scheme = new SchemeAsMultiScheme(new StringScheme());\n\t\t//We want to consume all the first message in the topic every time\n\t\t//方便debug,在生产环境应该设置为false not sure used to be `forceFromStart`\n\t\tkafkaConfig.useStartOffsetTimeIfOffsetOutOfRange = true;\n\t\t//create the topology\n\t\tTopologyBuilder builder = new TopologyBuilder();\n\t\t//set kafka spout class\n\t\tbuilder.setSpout(\"KafkaSpout\", new KafkaSpout(kafkaConfig), 1);\n\t\t//configure bolts ##after update not work\n//\t\tbuilder.setBolt(\"SentenceBolt\", new SentenceBolt(), 1).globalGrouping(\"KafkaSpout\");\n//\t\tbuilder.setBolt(\"PrintBolt\", new PrintBolt(), 1).globalGrouping(\"SentenceBolt\");\n\t\t\n\t\tLocalCluster cluster = new LocalCluster();\n\t\tConfig conf = new Config();\n\t\t\n\t\tcluster.submitTopology(\"KafkaTopology\", conf, builder.createTopology());\n\t\t\n\t\ttry {\n\t\t\tSystem.out.println(\"Waiting to consume from kafka\");\n\t\t\tTimeUnit.SECONDS.sleep(100);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tcluster.killTopology(\"KafkaTopology\");\n\t\tcluster.shutdown();\n\t}", "private void setupAmqpEndpoits() {\n\n // NOTE : Last Will and Testament Service endpoint is opened only if MQTT client provides will information\n // The receiver on the unique client publish address will be opened only after\n // connection is established (and CONNACK sent to the MQTT client)\n\n // setup and open AMQP endpoint for receiving on unique client control/publish addresses\n ProtonReceiver receiverControl = this.connection.createReceiver(String.format(AmqpReceiverEndpoint.CLIENT_CONTROL_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n ProtonReceiver receiverPublish = this.connection.createReceiver(String.format(AmqpReceiverEndpoint.CLIENT_PUBLISH_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n this.rcvEndpoint = new AmqpReceiverEndpoint(new AmqpReceiver(receiverControl, receiverPublish));\n\n // setup and open AMQP endpoint to Subscription Service\n ProtonSender ssSender = this.connection.createSender(AmqpSubscriptionServiceEndpoint.SUBSCRIPTION_SERVICE_ENDPOINT);\n this.ssEndpoint = new AmqpSubscriptionServiceEndpoint(ssSender);\n\n // setup and open AMQP endpoint for publishing\n ProtonSender senderPubrel = this.connection.createSender(String.format(AmqpPublishEndpoint.AMQP_CLIENT_PUBREL_ENDPOINT_TEMPLATE, this.mqttEndpoint.clientIdentifier()));\n this.pubEndpoint = new AmqpPublishEndpoint(senderPubrel);\n\n this.rcvEndpoint.openControl();\n this.ssEndpoint.open();\n this.pubEndpoint.open();\n }", "private void createClassSQLContract(){\n //---------------------------------------------------------------------------\n buffer=new StringBuffer();\n createGetColumnPropertiesHash();\n createGetPrimaryKeyVector();\n createGetTableName();\n createSetFKParent();\n\t}", "public BrokersStatus(List<BrokerStatus> inBrokers)\r\n {\r\n brokers = inBrokers;\r\n }", "public static void main(String[] args) {\n\t\tString configPath = null;\n\t\tString configZks = null;\n\t\t\n\t\tFileInputStream in;\n\t\ttry {\n\t\t\tin = new FileInputStream(\"ZkClient.cfg\");\n\t\t\tProperties prop = new Properties();\n\t\t\tprop.load(in);\n\t\t\tin.close();\n\t\t\tconfigZks\t= prop.getProperty(\"cfg_zks\");\n\t\t\tif (configZks == null){\n\t \treturn;\n\t }\n\t\t\tconfigPath\t= prop.getProperty(\"cfg_path\");\n\t\t\tif (configPath == null){\n\t \treturn;\n\t }\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tFile file = new File(\"node.content\"); \n Long filelength = file.length(); \n byte[] fileContent = new byte[filelength.intValue()]; \n try {\n\t\t\tin = new FileInputStream(file);\n\t\t\tin.read(fileContent); \n\t in.close(); \n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} \n \n //JSONObject jsonObj = new JSONObject(filecontent); \n\t\t\n\t\tCuratorFramework client = CuratorFrameworkFactory.builder()\n\t\t\t\t.connectString(configZks)\n\t\t\t\t.sessionTimeoutMs(5000)\n\t\t\t\t.connectionTimeoutMs(3000)\n\t\t\t\t.retryPolicy(new ExponentialBackoffRetry(1000,3))\n\t\t\t\t.build();\n\t\tclient.start(); \n\t\t\n\t try { \n client.setData().forPath(configPath, fileContent); \n } catch (Exception e) { \n e.printStackTrace(); \n }\n\n\t}", "public Broker() {\n\t\tbrokerSocket = null;\n\t\tclientSocket = null;\n\t\tresWriter = null;\n\t\tmqttReader = null;\n\t\tportNumber = 1883;\n\t}", "@Override\n\t\tpublic DRPCClient create() throws Exception {\n\t\t\tMap<String, Object> config = Utils.readStormConfig();\n\t\t\treturn new DRPCClient(config, configuration.drpcHost,\n\t\t\t\t\tconfiguration.drpcPort, MAX_WAIT_TO_EXECUTE);\n\t\t}", "private MQTTNetworkLayer createMQTTNetworkLayer(NetworkLayerParams networkParams) \r\n throws Exception {\r\n String serverURI = networkParams.serverURI;\r\n String clientId = networkParams.clientId;\r\n String remoteMAC = networkParams.remoteMAC;\r\n \r\n return new MQTTNetworkLayer(\r\n networkParams.connectionStorage,\r\n serverURI, clientId, remoteMAC\r\n );\r\n }", "@Override\n\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\"topic 消息类型开始产生消息 \" + \"生产者: \" + Thread.currentThread().getName());\n\t\t\t\ttry {\n\t\t\t\t\t\t/**第一步 创建连接工厂*/\n\t\t\t\t\t\tfactory = new ActiveMQConnectionFactory(MqConfigConstants.USERNAME, MqConfigConstants.PASSWORD, MqConfigConstants.BROKEURL_ALI);\n\t\t\t\t\t\t/**第二步 创建JMS 连接*/\n\t\t\t\t\t\tConnection connection = factory.createConnection();\n\t\t\t\t\t\tconnection.start();\n\t\t\t\t\t\t/** 第三步 创建Session,开启事务 */\n\t\t\t\t\t\tSession session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);\n\t\t\t\t\t\t/** 第四步: 创建topic,Topic是 Destination接口的子接口*/\n\t\t\t\t\t\tTopic topic = session.createTopic(MqConfigConstants.TopicName);\n\t\t\t\t\t\t/** 第五步 创建生产者producer */\n\t\t\t\t\t\tMessageProducer producer = session.createProducer(topic);\n\n\t\t\t\t\t\t/** 设置消息不需要持久化 */\n\t\t\t\t\t\tproducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);\n\t\t\t\t\t\t//发送文本消息\n\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\t/** 第六步 发送消息 */\n\t\t\t\t\t\t\t\tMessage message = createMessage(session,\"vincent\",27,\"江西省赣州市\");\n\t\t\t\t\t\t\t\tproducer.send(message);\n\t\t\t\t\t\t\t\tsession.commit();//开启事务必须需要提交,消费者才能获取到\n\t\t\t\t\t\t\t\tSystem.out.println(\"发送消息: \" +message.toString() );\n\t\t\t\t\t\t\t\tThread.sleep(200);\n\t\t\t\t\t\t}\n\t\t\t\t} catch (JMSException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t}", "@Override\n public void run() {\n ApplicationInfo ai = null;\n try {\n ai = MainActivity.getAppContext().getPackageManager().getApplicationInfo(MainActivity.getAppContext().getPackageName(), PackageManager.GET_META_DATA);\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n }\n String brokerAddress = (String) ai.metaData.get(\"BROKER_ADDRESS\");\n int brokerPort = (int) ai.metaData.get(\"BROKER_PORT\");\n\n // configurazione delle proprietà del broker e avvio del server relativo\n Properties properties = new Properties();\n properties.setProperty(BrokerConstants.HOST_PROPERTY_NAME, brokerAddress);\n properties.setProperty(BrokerConstants.PORT_PROPERTY_NAME, String.valueOf(brokerPort));\n properties.setProperty(BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME, Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + BrokerConstants.DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME);\n MemoryConfig memoryConfig = new MemoryConfig(properties);\n Server mqttBroker = new Server();\n try {\n mqttBroker.startServer(memoryConfig);\n } catch (IOException e) {\n e.printStackTrace();\n }\n Log.i(TAG, \"Server Started\");\n }", "private static KafkaProducer<String, String> createProducer(String a_broker) {\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(\"bootstrap.servers\", a_broker);\r\n\t\tprops.put(\"compression.type\", \"none\");\r\n\t\tprops.put(\"value.serializer\", StringSerializer.class.getName());\r\n\t\tprops.put(\"key.serializer\", StringSerializer.class.getName());\r\n\t\t\r\n\t\treturn new KafkaProducer<String, String>(props);\r\n\t}", "public static void setupAllCrds(KubeClusterResource cluster) {\n cluster.createCustomResources(TestUtils.CRD_KAFKA);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECT);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECT_S2I);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_MIRROR_MAKER);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_MIRROR_MAKER_2);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_BRIDGE);\n cluster.createCustomResources(TestUtils.CRD_TOPIC);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_USER);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_CONNECTOR);\n cluster.createCustomResources(TestUtils.CRD_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "public static void main(String[] args) {\n\t\tDDSEntityManager mgrPub;\n\t\tbjDealerTypeSupport typeSupportPub;\n\t\tDataWriter writer;\n\t\tbjDealerDataWriter typedWriter;\n\t\tbjDealer pubInstance;\n\t\t\n\t\t// Declare Subscriber variables (bjPlayer data subscribe)\n\t\tDDSEntityManager mgrSub;\n\t\tbjPlayerTypeSupport typeSupportSub;\n\t\tDataReader reader;\n\t\tbjPlayerDataReader typedReader;\n\t\tbjPlayerSeqHolder sequence;\n\t\tSampleInfoSeqHolder sampleInfoSequence; // no idea what this does, leaving it in.\n\t\t\n\t\t// End PubSub declarations\n\t\t\n\t\tdealer = new Dealer(); // TODO add constructor params\n\t\t\n\t\t// Instantiate helper objects to maintain player information\n\t\tmgrPub = new DDSEntityManager(); // bjD type send\n\t\tmgrSub = new DDSEntityManager(); // bjP type receive\n\t\tString partitionName = \"CasinoRoyale example\";\n\n\t\t// create Domain Participant, Type\n\t\tmgrPub.createParticipant(partitionName);\n\t\ttypeSupportPub = new bjDealerTypeSupport();\n\t\tmgrPub.registerType(typeSupportPub); // send bjD\n\t\tmgrSub.createParticipant(partitionName);\n\t\ttypeSupportSub = new bjPlayerTypeSupport();\n\t\tmgrSub.registerType(typeSupportSub); // receive bjP\n\n\t\t// create Publisher, DataWriter, Topic\n\t\tmgrPub.createTopic(\"Casino_RoyaleDealerPub\"); // no spaces, should be same as other group's\n\t\tmgrPub.createPublisher();\n\t\tmgrPub.createWriter();\n\t\tmgrSub.createTopic(\"Casino_RoyalePlayerPub\");\n\t\tmgrSub.createSubscriber();\n\t\tmgrSub.createReader();\n\t\t\n\t\t// set up subscriber to read the p2p connection (on localhost) and sequences to receive a bjP\n\t\treader = mgrSub.getReader();\n\t\ttypedReader = bjPlayerDataReaderHelper.narrow(reader);\n\t\tsequence = new bjPlayerSeqHolder();\n\t\tsampleInfoSequence = new SampleInfoSeqHolder();\n\t\t\n\t\t// Prepare the publisher\n\t\twriter = mgrPub.getWriter();\n\t\ttypedWriter = bjDealerDataWriterHelper.narrow(writer);\n\t\t\n\t\t// Prepare an object for sending\n\t\tpubInstance = new bjDealer(); // TODO: Replace this with a bjDealer instance created by the Dealer class\n\t\tpubInstance.uuid = 1;\n\t\t\n\t\t\n\t\tSystem.out.println(\"Running DealerMain\");\n\t\t\n\t\t\n\t\tboolean runFlag = true; // loop end condition\n\t\tint gameCount = 1; // run a game this many times\n\t\tint replyCount = 0; // this many players have replied to our pub\n\t\tint repliesExpected = 1; // assume only one player for now\n\t\t// repliesExpected = playerList.size(); // number of players ingame\n\t\twhile(runFlag)\n\t\t{\n\t\t\t//test\n\t\t\t//publishInstance(typedWriter,pubInstance); // note: 100 ms wait before sending\n\t\t\t\n\t\t\t//shuffling (handle join)\n\t\t\tTimer.wait(1000);\n\t\t\tpubInstance.action = CR.bjd_action.shuffling;\n\t\t\tpublishInstance(typedWriter,pubInstance); // publish\n\t\t\tSystem.out.println(\"\\n[Dealer] Shuffling action published; accepting joins\\n\");\n\t\t\t\n\t\t\t//(handlings joins)\n\t\t\tTimer.start(); // allow 5 seconds for joins\n\t\t\twhile(Timer.getTimeMs()<5000)\n\t\t\t{\n\t\t\t\tbjPlayer obj = readSequence(typedReader, sequence, sampleInfoSequence);\n\t\t\t\thandleSequence(obj);\n\t\t\t\thandleSequenceDebug(obj);\n\t\t\t\ttypedReader.return_loan(sequence, sampleInfoSequence); // free memory\n\t\t\t}\n\t\t\t\n\t\t\t//waiting (handle wager receive, echo if received)\n\t\t\tTimer.wait(1000);\n\t\t\tpubInstance.action = CR.bjd_action.waiting;\n\t\t\tpublishInstance(typedWriter,pubInstance); // publish\n\t\t\tSystem.out.println(\"\\n[Dealer] waiting action published; accepting wagers\\n\");\n\t\t\t\n\t\t\t//(echo wagers)\n\t\t\twhile(replyCount<repliesExpected)\n\t\t\t{\n\t\t\t\tbjPlayer obj = readSequence(typedReader, sequence, sampleInfoSequence);\n\t\t\t\thandleSequence(obj);\n\t\t\t\thandleSequenceDebug(obj);\n\t\t\t\ttypedReader.return_loan(sequence, sampleInfoSequence); // free memory\n\t\t\t\t\n\t\t\t\tpublishInstance(typedWriter,pubInstance); // publish\n\t\t\t\tSystem.out.println(\"\\n[Dealer] player X has wagered Y credits\\n\");\n\t\t\t\t\n\t\t\t\treplyCount++;\n\t\t\t}\n\t\t\t\n\t\t\t//dealing (initial deal)\n\t\t\tTimer.wait(1000);\n\t\t\tpubInstance.action = CR.bjd_action.dealing;\n\t\t\tpublishInstance(typedWriter,pubInstance); // publish\n\t\t\tSystem.out.println(\"\\n[Dealer] dealing action published; cards sent\\n\");\n\t\t\t\n\t\t\t\n\t\t\t//(ask for hit/stand, then deal. Repeat.)\n\t\t\twhile(replyCount<repliesExpected)\n\t\t\t{\n\t\t\t\tTimer.wait(1000);\n\t\t\t\tpublishInstance(typedWriter,pubInstance); // publish\n\t\t\t\tSystem.out.println(\"\\n[Dealer] asking player X for hit/stand\\n\");\n\t\t\t\t\n\t\t\t\tbjPlayer obj = readSequence(typedReader, sequence, sampleInfoSequence);\n\t\t\t\thandleSequence(obj);\n\t\t\t\thandleSequenceDebug(obj);\n\t\t\t\ttypedReader.return_loan(sequence, sampleInfoSequence); // free memory\n\t\t\t\t\n\t\t\t\tif(obj.action.value() == bjp_action._none)\n\t\t\t\t{\n\t\t\t\t\treplyCount++;\n\t\t\t\t\tSystem.out.println(\"\\n[Dealer] Player X has stood\\n\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\\n[Dealer] Player X has hit\\n\");\n\t\t\t\t\tpublishInstance(typedWriter,pubInstance); // publish\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treplyCount=0;\n\t\t\t//collecting (look at who won or lost. Take money from losers)\n\t\t\tTimer.wait(1000);\n\t\t\tpubInstance.action = CR.bjd_action.collecting;\n\t\t\tpublishInstance(typedWriter,pubInstance); // publish\n\t\t\tSystem.out.println(\"\\n[Dealer] collecting losses\\n\");\n\t\t\t\n\t\t\t\n\t\t\t//paying (give money to winners)\n\t\t\tTimer.wait(1000);\n\t\t\tpubInstance.action = CR.bjd_action.paying;\n\t\t\tpublishInstance(typedWriter,pubInstance); // publish\n\t\t\tSystem.out.println(\"\\n[Dealer] paying out winning bets\\n\");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//end game\n\t\t\t\n\t\t\t\n\t\t\tif(--gameCount <= 0) // decrement first\n\t\t\t\trunFlag = false;\n\t\t}\n\t\tTimer.wait(1000);\n\t\t\n\t\t// clean up\n\t\tSystem.out.println();\n\t\tcleanUpPublisher(mgrPub, typedWriter);\n\t\tcleanUpSubscriber(mgrSub,typedReader);\n\t}", "public static void main(String[] args) {\n\t\tList<Customer> customerList=new ArrayList<Customer>();\n\t\tCluster cluster = null;\n\t\tSession session = null;\n\t\ttry {\n\n\t\t\tcluster = Cluster\n\t\t\t\t\t.builder()\n\t\t\t\t\t.addContactPoints(LOCAL_HOST_IP)\n\t\t\t\t\t.withProtocolVersion(ProtocolVersion.NEWEST_SUPPORTED)\n\t\t\t\t\t.build();\n\t\t\t\n\t\t\tsession = cluster.connect(CAS_KEYSPACE);\n\t\t\tSystem.out.println(\"Connection Successful\");\n\n\t\t\t\n\t\t\tResultSet execute = session.execute(\"select * from orders\");\n\n\t\t\tfor (Row row : execute) {\n\t\t\t\tUDTValue customerUDT = row.get(\"customer\",UDTValue.class);\n\t\t\t\tCustomer customer=new Customer();\n\t\t\t\tcustomer.setId(customerUDT.get(0, String.class));\n\t\t\t\tcustomer.setName(customerUDT.get(1, String.class));\n\t\t\t\tcustomer.setCouponCode(customerUDT.get(2, String.class));\n\t\t\t\tcustomer.setAddress(customerUDT.get(3, String.class));\n\t\t\t\tcustomerList.add(customer);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Customer List :: \"+customerList);\n\t\t\t\n\n\t\t} catch (Exception exp) {\n\t\t\texp.printStackTrace();\n\t\t} finally {\n\t\t\tcluster.close();\n\t\t}\n\t}", "public void send(Order brokerMsg) {\n// System.out.println(\"Sending a transaction from. price\" + brokerMsg.getPrice() + \" buy : \" + brokerMsg.isBuy());\n\n\n MessageCreator messageCreator = new MessageCreator() {\n @Override\n public Message createMessage(Session session) throws JMSException {\n\n\n Message msg = session.createTextMessage(brokerMsg.toString());\n msg.setJMSCorrelationID(brokerMsg.getStratId().toString());\n// System.out.println(msg);\n return msg;\n }\n };\n orderService.writeOrder(brokerMsg);\n jmsTemplate.send(\"OrderBroker\", messageCreator);\n }", "@SuppressWarnings(\"empty-statement\")\n public void runClient() {\n // setup MQTT Client\n String clientID = \"apto01\";\n String pass = \"1234\";\n connOpt = new MqttConnectOptions();\n\n connOpt.setCleanSession(true);\n connOpt.setKeepAliveInterval(30);\n connOpt.setUserName(\"isis2503\");\n connOpt.setPassword(pass.toCharArray());\n\n alertaLogic = new AlertLogic();\n\n // Connect to Broker\n try {\n myClient = new MqttClient(BROKER_URL, clientID);\n myClient.setCallback(this);\n myClient.connect(connOpt);\n } catch (MqttException e) {\n e.printStackTrace();\n System.exit(-1);\n }\n\n System.out.println(\"Connected to \" + BROKER_URL);\n\n // setup topic\n // topics on m2m.io are in the form <domain>/<stuff>/<thing>\n // subscribe to topic if subscriber\n if (subscriber) {\n try {\n int subQoS = 0;\n myClient.subscribe(infoInoTopic, subQoS);\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }\n // disconnect\n try {\n // wait to ensure subscribed messages are delivered\n while (subscriber);\n myClient.disconnect();\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }", "public void setBrokerId(String value) {\n this.brokerId = value;\n }", "public void setBrokerId(String value) {\n this.brokerId = value;\n }", "protected void createClient(MqttCallback callback) {\n\t\tLoggerUtility.info(CLASS_NAME, \"createClient\", \"Org ID = \" + getOrgId() +\n\t\t\t\t\"\\n Client ID = \" + clientId);\n\t\tthis.mqttAsyncClient = null;\n\t\tthis.mqttClientOptions = new MqttConnectOptions();\n\t\tthis.mqttCallback = callback;\n\t}", "@Test\n public void testBrokerScaleDown() throws Exception {\n Tenant tenant =\n new Tenant.TenantBuilder(TENANT_NAME).setRole(TenantRole.BROKER).setTotalInstances(NEW_NUM_BROKERS).build();\n\n // Send the 'put' (instead of 'post') request, that updates the tenants instead of creating\n JSONObject request = tenant.toJSON();\n sendPutRequest(_controllerRequestURLBuilder.forBrokerTenantCreate(), request.toString());\n\n TestUtils.waitForCondition(new Function<Void, Boolean>() {\n @Override\n public Boolean apply(@Nullable Void aVoid) {\n return _helixAdmin.getInstancesInClusterWithTag(_clusterName, BROKER_TENANT_NAME).size() == 1;\n }\n }, 60_000L, \"Failed to get in a consistent state after scaling down the brokers\");\n }", "@Create\n public void create()\n {\n \n log.debug(\"Creating users and mailboxes\");\n //MailboxService ms = MMJMXUtil.getMBean(\"meldware.mail:type=MailboxManager,name=MailboxManager\", MailboxService.class);\n AdminTool at = MMJMXUtil.getMBean(\"meldware.mail:type=MailServices,name=AdminTool\", AdminTool.class);\n \n for (MeldwareUser meldwareUser : getUsers())\n {\n at.createUser(meldwareUser.getUsername(), meldwareUser.getPassword(), meldwareUser.getRoles());\n // TODO This won't work on AS 4.2\n /*Mailbox mbox = ms.createMailbox(meldwareUser.getUsername());\n for (String alias : meldwareUser.getAliases())\n {\n ms.createAlias(mbox.getId(), alias);\n }*/\n log.debug(\"Created #0 #1 #2\", meldwareUser.isAdministrator() ? \"administrator\" : \"user\", meldwareUser.getUsername(), meldwareUser.getAliases() == null || meldwareUser.getAliases().size() == 0 ? \"\" : \"with aliases \" + meldwareUser.getAliases());\n }\n }", "public LineStroker() {\n }", "public static void main(String[] args) {\n Properties configs = new Properties();\r\n //commit\r\n // 환경 변수 설정\r\n configs.put(\"bootstrap.servers\", \"localhost:9092\");\t\t// kafka server host 및 port\r\n configs.put(\"session.timeout.ms\", \"10000\");\t\t\t\t// session 설정\r\n configs.put(\"group.id\", \"test191031\");\t\t\t\t\t// topic 설정\r\n configs.put(\"key.deserializer\", \"org.apache.kafka.common.serialization.StringDeserializer\");\t// key deserializer\r\n configs.put(\"value.deserializer\", \"org.apache.kafka.common.serialization.StringDeserializer\"); // value deserializer\r\n \r\n @SuppressWarnings(\"resource\")\r\n\t\tKafkaConsumer<String, String> consumer = new KafkaConsumer<>(configs);\t// consumer 생성\r\n consumer.subscribe(Arrays.asList(\"test191031\"));\t\t// topic 설정\r\n \r\n SimpleDateFormat format1 = new SimpleDateFormat ( \"yyyy-MM-dd HH:mm:ss\");\r\n\r\n while (true) {\t// 계속 loop를 돌면서 producer의 message를 띄운다.\r\n ConsumerRecords<String, String> records = consumer.poll(500);\r\n for (ConsumerRecord<String, String> record : records) {\r\n \t\r\n \tDate time = new Date();\r\n \tString time1 = format1.format(time);\r\n \t\r\n String s = record.topic();\r\n if (\"test191031\".equals(s)) {\r\n System.out.println(time1 + \" | \" + record.value());\r\n } else {\r\n throw new IllegalStateException(\"get message on topic \" + record.topic());\r\n\r\n }\r\n }\r\n }\r\n \r\n\t}", "public static void main(String[] args) {\n\t\tint numUser = 1;\n\t\tCalendar cal = Calendar.getInstance();\n\t\tboolean traceFlag = false;\n\t\tCloudSim.init(numUser, cal, traceFlag);\n\t\t// TODO Create the data center and define the the policies for the allocating and scheduling\n\t\tDatacenter datacenter = CreateDataCenter();\n\t\t// TODO Create the data center broker\n\t\tDatacenterBroker datacenterBroker = CreateDataCenterBroker();\n\t\t// TODO Create Cloudlet\n\t\tList<Cloudlet> cloudletList = new ArrayList<Cloudlet>();\n\t\t//Try to set the random number for the cloudlet length\n\t\tlong cloudletLength = 40000;\n\t\tint pesNumber = 1;\n\t\tlong cloudletFileSize = 300;\n\t\tlong cloudletOutputSize = 400;\n\t\tUtilizationModel utilizationModelCpu = new UtilizationModelFull();\n\t\tUtilizationModel utilizationModelRam = new UtilizationModelFull();\n\t\tUtilizationModel utilizationModelBw = new UtilizationModelFull();\n\t\tfor (int cloudletId = 0; cloudletId < 40; cloudletId++) {\n\t\t\tCloudlet cloudlet = new Cloudlet(cloudletId, cloudletLength, pesNumber, cloudletFileSize, cloudletOutputSize,\n\t\t\t\t\tutilizationModelCpu, utilizationModelRam, utilizationModelBw);\n\t\t\tcloudlet.setUserId(datacenterBroker.getId());\n\t\t\tcloudletList.add(cloudlet);\n\t\t}\n\t\t// TODO Create Virtual Machines and define the Procedure for task scheduling algorithm\n\t\tList<Vm> vmList = new ArrayList<Vm>();\n\t\tint userId = 0;\n\t\tdouble mips = 1000;\n\t\tint numberOfPes = 1;\n\t\tint ram = 2000;\n\t\tlong bandwidth = 1000;\n\t\tlong diskSize = 20000;\n\t\tString vmm = \"XEN\";\n\t\tCloudletScheduler cloudletScheduler = new CloudletSchedulerTimeShared();\n\t\tfor (int id = 0; id < 10; id++) {\n\t\t\tVm virtualMachine = new Vm(id, datacenterBroker.getId(), mips, numberOfPes, ram, bandwidth, diskSize, vmm,\n\t\t\t\t\tcloudletScheduler);\n\t\t\tvmList.add(virtualMachine);\n\t\t}\n\t\tdatacenterBroker.submitCloudletList(cloudletList);\n\t\tdatacenterBroker.submitVmList(vmList);\n\t\t// TODO Implement the Power classes\n\t\tCloudSim.startSimulation();\n\t\tList<Cloudlet> finalCloudletExecutionResults = datacenterBroker.getCloudletReceivedList();\n\t\tCloudSim.stopSimulation();\n\t\t// TODO Test the demo and Print the result\n\t\tfor (Cloudlet cloudlet : finalCloudletExecutionResults) {\n\t\t\tLog.printLine(\"Cloudlet: \" + cloudlet.getCloudletId() + \" VM: \" + cloudlet.getVmId() + \n\t\t\t\t\t\" Status: \" + cloudlet.getStatus() + \" Execution Time: \" + cloudlet.getActualCPUTime() + \n\t\t\t\t\t\" Start Time \" + cloudlet.getExecStartTime() + \" Finished Time: \" + cloudlet.getFinishTime());\n\t\t\tLog.printLine(\"----------------------------------------------------------------------------------------------------\");\n\t\t}\n\t}", "BrokerAlgo getBrokerAlgo();", "protected WMTemplate(Broker broker) {\n this(broker,\"wm\");\n }", "public void init() {\n configuration.init();\n \n //Connections connections = configuration.getBroker().getConnections(\"topic\");\n Connections connections = configuration.getBrokerPool().getBroker().getConnections(\"topic\");\n \n if (connections == null) {\n handleException(\"Couldn't find the connection factor: \" + \"topic\");\n }\n \n sensorCatalog = new SensorCatalog();\n clientCatalog = new ClientCatalog();\n \n nodeCatalog = new NodeCatalog();\n \n updateManager = new UpdateManager(configuration, sensorCatalog, this);\n updateManager.init();\n \n endpointAllocator = new EndpointAllocator(configuration, nodeCatalog);\n\n registry = new JCRRegistry(this);\n registry.init();\n\n // Initialize Public-End-Point\n if(!isPublicEndPointInit) {\n \tinitPublicEndpoint();\n }\n }", "public static void main(String... args) throws SQLException {\n new CreateCluster().runTool(args);\n }", "public void createCon(){\n\t\ttry {\n\t\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\");\n\t\t\tcon=DriverManager.getConnection(\"jdbc:oracle:thin:@172.26.132.40:1521:ORCLILP\", \"a63d\", \"a63d\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\n\t}", "public interface KafkaClientFactory {\n\n /**\n * Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a\n * {@link ConsumerConfig} argument. Uses default Kafka cluster connection information (default == single configuration\n * found in Bootique; if none or more than one exists, an exception is thrown). Returned Consumer needs to be\n * closed by the calling code when it is no longer in use.\n *\n * @param config Configuration of consumer specific to the given method call.\n * @param <K> Consumed message key type.\n * @param <V> Consumed message value type.\n * @return a new instance of Consumer.\n */\n <K, V> Consumer<K, V> createConsumer(ConsumerConfig<K, V> config);\n\n /**\n * Creates and returns a {@link Consumer} by merging default Bootique configuration with settings provided in a\n * {@link ConsumerConfig} argument. Returned Consumer needs to be closed by the calling code when it is no longer\n * in use.\n *\n * @param clusterName symbolic configuration name for the Kafka cluser coming from configuration.\n * @param config Configuration of consumer specific to the given method call.\n * @param <K> Consumed message key type.\n * @param <V> Consumed message value type.\n * @return a new instance of Consumer.\n */\n <K, V> Consumer<K, V> createConsumer(String clusterName, ConsumerConfig<K, V> config);\n\n <K, V> Producer<K, V> createProducer(ProducerConfig<K, V>config);\n\n <K, V> Producer<K, V> createProducer(String clusterName, ProducerConfig<K, V>config);\n}", "public MqttBrokerMeta() {\n\n addDescription(\n \"This is an Mqtt client based on the Paho Mqtt client library. Mqtt is a machine-to-machine (M2M)/'Internet of Things' connectivity protocol. See http://mqtt.org\");\n addCategory(\"cloud\", \"network\");\n\n addDependency(\"io.moquette\", \"moquette-broker\", \"0.15\");\n exclude(\"com.fasterxml.jackson.core\", \"*\");\n exclude(\"io.netty\", \"*\");\n exclude(\"org.slf4j\", \"slf4j-log4j12\");\n\n addDependency(\"com.fasterxml.jackson.core\", \"jackson-core\", \"2.14.0\");\n addDependency(\"com.fasterxml.jackson.core\", \"jackson-databind\", \"2.14.0\");\n addDependency(\"com.fasterxml.jackson.core\", \"jackson-annotations\", \"2.14.0\");\n\n addDependency(\"io.netty\", \"netty-all\", \"4.1.82.Final\");\n\n \n\n setCloudService(false);\n\n }", "public void createTables(){\n Map<String, String> name_type_map = new HashMap<>();\n List<String> primaryKey = new ArrayList<>();\n try {\n name_type_map.put(KEY_SINK_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_SINK_DETAIL, MyDatabase.TYPE_VARCHAR);\n primaryKey.add(KEY_SINK_ADDRESS);\n myDatabase.createTable(TABLE_SINK, name_type_map, primaryKey, null);\n }catch (MySQLException e){ //数据表已存在\n e.print();\n }\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_NAME, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_DETAIL, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_ADDRESS,MyDatabase.TYPE_VARCHAR);\n primaryKey.clear();\n primaryKey.add(KEY_NODE_PARENT);\n primaryKey.add(KEY_NODE_ADDRESS);\n myDatabase.createTable(TABLE_NODE, name_type_map, primaryKey, null);\n }catch (MySQLException e){\n e.print();\n }\n\n try {\n name_type_map.clear();\n name_type_map.put(KEY_NODE_ADDRESS, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_NODE_PARENT, MyDatabase.TYPE_VARCHAR);\n name_type_map.put(KEY_DATA_TIME, MyDatabase.TYPE_TIMESTAMP);\n name_type_map.put(KEY_DATA_VAL, MyDatabase.TYPE_FLOAT);\n primaryKey.clear();\n primaryKey.add(KEY_DATA_TIME);\n primaryKey.add(KEY_NODE_ADDRESS);\n primaryKey.add(KEY_NODE_PARENT);\n myDatabase.createTable(TABLE_DATA, name_type_map, primaryKey, null);\n }catch (MySQLException e) {\n e.print();\n }\n }", "public static void main(String[] args) {\n\t\tCluster cluster = CouchbaseCluster.create();\n\t\t// Open the default bucket and the \"beer-sample\" one\n\t\tBucket defaultBucket = cluster.openBucket();\n\t\t// Disconnect and clear all allocated resources\n\n\t\t/*JsonObject productJson = JsonObject.empty().put(\"name\", \"An ice sculpture\").put(\"price\", 12.50)\n\t\t\t\t.put(\"length\", 7.0).put(\"width\", 12.0).put(\"height\", 9.5)\n\t\t\t\t.put(\"description\", \"This product is not for sale\");\n\n\t\tJsonDocument productJsonToBeStored = JsonDocument.create(\"productKey\", productJson);\n\t\tJsonDocument productRecievedFromDB = defaultBucket.upsert(productJsonToBeStored);*/\n\t\t\n\t\t\n\n\t\tcluster.disconnect();\n\t}", "private void createCanvasBorders() {\n\n\t\tLabel lblBorderMiddle = new Label(canvasLabel, SWT.NONE);\n\t\tlblBorderMiddle.setBackground(ResourceUtils.getColor(iDartColor.BLACK));\n\t\tlblBorderMiddle.setBounds(0, 72, 285, 2);\n\n\t\tLabel lblBorderBottom = new Label(canvasLabel, SWT.NONE);\n\t\tlblBorderBottom.setBounds(0, 198, 285, 2);\n\t\tlblBorderBottom.setBackground(ResourceUtils.getColor(iDartColor.BLACK));\n\n\t\tLabel lblBorderLeft = new Label(canvasLabel, SWT.NONE);\n\t\tlblBorderLeft.setBounds(0, 0, 2, 200);\n\t\tlblBorderLeft.setBackground(ResourceUtils.getColor(iDartColor.BLACK));\n\n\t\tLabel lblBorderRight = new Label(canvasLabel, SWT.NONE);\n\t\tlblBorderRight.setBounds(283, 0, 2, 200);\n\t\tlblBorderRight.setBackground(ResourceUtils.getColor(iDartColor.BLACK));\n\n\t\tLabel lblBorderTop = new Label(canvasLabel, SWT.NONE);\n\t\tlblBorderTop.setBounds(0, 0, 285, 2);\n\t\tlblBorderTop.setBackground(ResourceUtils.getColor(iDartColor.BLACK));\n\t}", "public static void main(String[] args) throws NacosException, InterruptedException, IOException {\n String dataId = \"StreamingServiceOrderMainV2.yml\";\n// downLoadFromConfigCenter(dataId);\n// String group = \"DEFAULT_GROUP\";\n// String namespace = \"847b80b1-0e6f-4409-ac09-442efd3b969b\";\n// Properties properties = new Properties();\n// properties.put(PropertyKeyConst.NAMESPACE, namespace);\n// properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);\n// ConfigService configService = NacosFactory.createConfigService(properties);\n// String content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n// configService.addListener(dataId, group, new Listener() {\n// @Override\n// public void receiveConfigInfo(String configInfo) {\n// System.out.println(\"recieve:\" + configInfo);\n// }\n//\n// @Override\n// public Executor getExecutor() {\n// return null;\n// }\n// });\n//\n// boolean isPublishOk = configService.publishConfig(dataId, group, \"content\");\n// System.out.println(isPublishOk);\n//\n// Thread.sleep(3000);\n// content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n//\n// boolean isRemoveOk = configService.removeConfig(dataId, group);\n// System.out.println(isRemoveOk);\n// Thread.sleep(3000);\n//\n// content = configService.getConfig(dataId, group, 5000);\n// System.out.println(content);\n// Thread.sleep(300000);\n }", "void sss_create_shares(byte[] out, byte[] data, int n, int k);", "BSQLMachine createBSQLMachine();", "public abstract void createTables() throws DataServiceException;", "public static void main(String[] args) throws Exception {\n Thread broker = new Broker();\n broker.start();\n\n // Start the catalog server\n ServerSocket serverSocket = new ServerSocket(9999);\n HashMap<SimpleEntry<String, String>, POSTNegotiation> negotiations = new HashMap<>();\n HashSet<String> importers = new HashSet<>();\n HashSet<String> producers = new HashSet<>();\n while (true) {\n Socket connectionSocket = serverSocket.accept();\n\n Thread h = new CHandler(connectionSocket, negotiations, importers, producers);\n h.start();\n }\n }", "public static void main(String[] args) {\n\n\n final KafkaProducer<String, String> kafkaProducer = new KafkaProducer<String, String>(getKafkaProducerProperties());\n\n // kafka\n final String topic = \"test-4\";\n\n // queue manager.\n String PARAM_QUEUE_NAME = \"DEV.QUEUE.1\";\n String PARAM_USERNAME = \"app\";\n String PARAM_PASSWORD = \"passw0rd\";\n String PARAM_QMGR_CHANNEL_NAME = \"DEV.APP.SVRCONN\";\n String PARAM_QMGR_NAME = \"QM1\";\n int PARAM_QMGR_PORT = 1414;\n String PARAM_QMGR_HOST_NAME = \"localhost\";\n\n Connection conn = null;\n\n try {\n\n // Set up the connection factory to connect to the queue manager,\n // populating it with all the properties we have been provided.\n MQConnectionFactory cf = new MQQueueConnectionFactory();\n cf.setTransportType(WMQConstants.WMQ_CM_CLIENT);\n cf.setHostName(PARAM_QMGR_HOST_NAME);\n cf.setPort(PARAM_QMGR_PORT);\n cf.setQueueManager(PARAM_QMGR_NAME);\n cf.setChannel(PARAM_QMGR_CHANNEL_NAME);\n\n // Create the connection to the queue manager\n conn = cf.createConnection(PARAM_USERNAME, PARAM_PASSWORD);\n\n // Create a session and a queue object to enable us to interact with the\n // queue manager. By creating a transactional session we can roll back\n // the message onto the queue if the processing fails.\n Session session = conn.createSession(true, 0);\n Queue q = session.createQueue(\"queue:///\"+PARAM_QUEUE_NAME);\n\n // For testing purposes we can put some messages onto the queue using this\n\n // Set up the consumer to read from the queue\n MessageConsumer consumer = session.createConsumer(q);\n\n // Don't forget to start the connection before trying to receive messages!\n conn.start();\n\n try {\n\n // Read messages from the queue and process them until there\n // are none left to read.\n while (true) {\n Message receivedMsg = consumer.receiveNoWait();\n if (receivedMsg != null) {\n // use final -> multithreading env\n final TextMessage rcvTxtMsg = (TextMessage) receivedMsg;\n final String txt = rcvTxtMsg.getText();\n final ProducerRecord<String, String> objectStringProducerRecord = new ProducerRecord<>(topic, null, txt);\n kafkaProducer.send(objectStringProducerRecord, (recordMetadata, e) -> {\n if (e!=null){\n logger.warn(\"Producer call back end up with exception\");\n try {\n session.rollback();\n logger.warn(\"Ibm mq session rollback\");\n } catch (JMSException ex) {\n logger.warn(\"Ibm mq session failed to rollback\");\n ex.printStackTrace();\n }\n } else {\n try {\n session.commit();\n logger.info(\"Transaction success: Message was committed by IBM MQ Session and was delivered by Kafka-producer to kafka topic: {}, with offset: {}\", recordMetadata.topic(), recordMetadata.offset());\n } catch (JMSException ex) {\n logger.info(\"Transaction failed: Message was not committed by IBM MQ Session\");\n throw new RuntimeException(e);\n }\n }\n });\n\n\n // Since we returned from processing the message without\n // an exception being thrown we have successfully\n // processed the message, so increment our success count\n // and commit the transaction so that the message is\n // permanently removed from the queue.\n// messagesProcessed++;\n// session.commit();\n }\n\n }\n\n } catch (JMSException jmse2)\n {\n // This block catches any JMS exceptions that are thrown during\n // the business processing of the message.\n jmse2.printStackTrace();\n\n // Roll the transaction back so that the message can be put back\n // onto the queue ready to have its proessing retried next time\n // the action is invoked.\n session.rollback();\n throw new RuntimeException(jmse2);\n\n } catch (RuntimeException e) {\n e.printStackTrace();\n\n // Roll the transaction back so that the message can be put back\n // onto the queue ready to have its proessing retried next time\n // the action is invoked.\n session.rollback();\n throw e;\n }\n\n // Indicate to the caller how many messages were successfully processed.\n\n } catch (JMSException jmse) {\n // This block catches any JMS exceptions that are thrown before the\n // message is retrieved from the queue, so we don't need to worry\n // about rolling back the transaction.\n jmse.printStackTrace();\n\n // Pass an indication about the error back to the caller.\n throw new RuntimeException(jmse);\n\n } finally {\n if (conn != null) {\n try {\n conn.close();\n } catch (JMSException jmse2) {\n // Swallow final errors.\n }\n }\n }\n\n }", "void createOrUpdateContracts(List<PsdContract> wrapContracts);", "public static void setupV1Crds(KubeClusterResource cluster) {\n cluster.replaceCustomResources(CRD_V1_KAFKA);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECT_S2I);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_MIRROR_MAKER_2);\n cluster.replaceCustomResources(CRD_V1_KAFKA_BRIDGE);\n cluster.replaceCustomResources(CRD_V1_TOPIC);\n cluster.replaceCustomResources(CRD_V1_KAFKA_USER);\n cluster.replaceCustomResources(CRD_V1_KAFKA_CONNECTOR);\n cluster.replaceCustomResources(CRD_V1_KAFKA_REBALANCE);\n\n waitForCrd(cluster, \"kafkas.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects2is.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnects.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormaker2s.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkamirrormakers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkabridges.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkatopics.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkausers.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkaconnectors.kafka.strimzi.io\");\n waitForCrd(cluster, \"kafkarebalances.kafka.strimzi.io\");\n }", "public void createPackageContents() {\n\t\tif (isCreated) return;\n\t\tisCreated = true;\n\n\t\t// Create classes and their features\n\t\tbluetoothPortEClass = createEClass(BLUETOOTH_PORT);\n\n\t\tl2CAPInJobEClass = createEClass(L2CAP_IN_JOB);\n\n\t\tl2CAPoutJobEClass = createEClass(L2CA_POUT_JOB);\n\t}", "private void createChannelAccess(Nx100Type config) throws FactoryException {\n \t\ttry {\n \t\t\tjobChannel = channelManager.createChannel(config.getJOB().getPv(), false);\n \t\t\tstartChannel = channelManager.createChannel(config.getSTART().getPv(), false);\n \t\t\tholdChannel = channelManager.createChannel(config.getHOLD().getPv(), false);\n \t\t\tsvonChannel = channelManager.createChannel(config.getSVON().getPv(), false);\n \t\t\terrChannel = channelManager.createChannel(config.getERR().getPv(), errls, false);\n \n \t\t\t// acknowledge that creation phase is completed\n \t\t\tchannelManager.creationPhaseCompleted();\n \t\t} catch (Throwable th) {\n \t\t\tthrow new FactoryException(\"failed to create all channels\", th);\n \t\t}\n \t}", "BOp createBOp();", "private JPanel initCenterPanel() {\r\n JPanel centerPanel = new JPanel(new GridLayout(0, 2, gapSize, gapSize));\r\n\r\n centerPanel.add(chcBoxBowDepartment);\r\n centerPanel.add(new JLabel(\"gebühren: 5\"));\r\n centerPanel.add(chcBoxAtmosphericDepartment);\r\n centerPanel.add(new JLabel(\"gebühren: 10\"));\r\n centerPanel.add(chcBoxFirearmDepartment);\r\n centerPanel.add(new JLabel(\"gebühren: 15\"));\r\n\r\n centerPanel.add(lDiscounts);\r\n TitledBorder border = new TitledBorder(\"Abteilungen\");\r\n centerPanel.setBorder(border);\r\n\r\n return centerPanel;\r\n }", "DatabaseClient newFinalClient();", "public void createPartition(int nPid);", "@Override\r\n\tprotected List<CreateKeyspaceSpecification> getKeyspaceCreations() {\r\n\t\tCreateKeyspaceSpecification specification = CreateKeyspaceSpecification.createKeyspace(KEYSPACE);\r\n\t\treturn Arrays.asList(specification);\r\n\t}", "protected void setup() {\n\t\tSystem.out.println(\"Broker Agent \"+getAID().getName()+\" is ready.\");\r\n\t\tthis.getContentManager().registerLanguage(new SLCodec());\r\n\t\tthis.getContentManager().registerOntology(RequestOntology.getInstance());\r\n\t\t\r\n\t\tObject[] args = getArguments();\r\n\t\tif (args != null && args.length > 0) {\r\n\t\t\tprice = (String) args[0];\r\n\t\t\tvolume= (String) args[1];\r\n\t\t\t\r\n\t\t\tDFAgentDescription dfd = new DFAgentDescription();\r\n\t\t\tdfd.setName(getAID());\r\n\t\t\tServiceDescription sd = new ServiceDescription();\r\n\t\t\tsd.setType(\"energy-selling\");\r\n\t\t\tsd.setName(\"Energy-Broker\");\r\n\t\t\tdfd.addServices(sd);\r\n\t\t\ttry {\r\n\t\t\t\tDFService.register(this, dfd);\r\n\t\t\t}\r\n\t\t\tcatch (FIPAException fe) {\r\n\t\t\t\tfe.printStackTrace();\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.println(getAID().getName()+\" No available arguments\");\r\n\t\t\tdoDelete();\r\n\t\t}\r\n\t\taddBehaviour(new BOReply(this));\r\n\t}", "public TPCCClient(String args[]) {\n super(args);\n \n m_tpccConfig = TPCCConfig.createConfig(this.getCatalog(), m_extraParams);\n if (LOG.isDebugEnabled()) LOG.debug(\"TPC-C Client Configuration:\\n\" + m_tpccConfig);\n \n // makeForRun requires the value cLast from the load generator in\n // order to produce a valid generator for the run. Thus the sort\n // of weird eat-your-own ctor pattern.\n RandomGenerator.NURandC base_loadC = new RandomGenerator.NURandC(0,0,0);\n RandomGenerator.NURandC base_runC = RandomGenerator.NURandC.makeForRun(\n new RandomGenerator.Implementation(0), base_loadC);\n RandomGenerator rng = new RandomGenerator.Implementation(0);\n rng.setC(base_runC);\n \n RandomGenerator.NURandC base_loadC2 = new RandomGenerator.NURandC(0,0,0);\n RandomGenerator.NURandC base_runC2 = RandomGenerator.NURandC.makeForRun(\n new RandomGenerator.Implementation(0), base_loadC2);\n // RandomGenerator rng2 = new RandomGenerator.Implementation(0);\n rng.setC(base_runC2);\n \n HStoreConf hstore_conf = this.getHStoreConf();\n m_scaleParams = ScaleParameters.makeWithScaleFactor(m_tpccConfig.num_warehouses, m_tpccConfig.first_warehouse, hstore_conf.client.scalefactor);\n m_tpccSim = new TPCCSimulation(this, rng, new Clock.RealTime(), m_scaleParams, m_tpccConfig, hstore_conf.client.skewfactor);\n // m_tpccSim2 = new TPCCSimulation(this, rng2, new Clock.RealTime(), m_scaleParams, m_tpccConfig, hstore_conf.client.skewfactor);\n \n // Set up checking\n buildConstraints();\n \n //m_sampler = new VoltSampler(20, \"tpcc-cliet-sampling\");\n }", "Cloud createCloud();", "private boolean checkBrokers ()\n {\n if (game.getAgentMap().size() < 1) {\n log.info(String.format(\"Game: %s (round %s) reports no brokers \"\n + \"registered\",\n game.getGameId(), game.getRound().getRoundId()));\n return false;\n }\n\n for (Agent agent: game.getAgentMap().values()) {\n Broker broker = agent.getBroker();\n // Check if any broker is disabled in the interface\n if (!MemStore.getBrokerState(broker.getBrokerId())) {\n log.info(String.format(\"Not starting game %s : broker %s is disabled\",\n game.getGameId(), broker.getBrokerId()));\n return false;\n }\n\n // Check if any broker is already running the maxAgent nof agents\n if (!broker.hasAgentsAvailable(game.getRound())) {\n log.info(String.format(\"Not starting game %s : broker %s doesn't have \"\n + \"enough available agents\",\n game.getGameId(), broker.getBrokerId()));\n return false;\n }\n\n brokers += broker.getBrokerName() + \"/\" + agent.getBrokerQueue() + \",\";\n }\n brokers = brokers.substring(0, brokers.length() - 1);\n return true;\n }", "public void setBorderPaneCenterMain(BorderPane bp){\n VBox userInfo = new VBox();\n bp.setCenter(userInfo);\n \n //style\n userInfo.getStyleClass().add(\"nodeBkg\");\n userInfo.setPadding(new Insets(40));\n \n // borderPane Settings\n bp.setAlignment(userInfo, Pos.CENTER);\n \n \n //Vbox settings\n userInfo.setAlignment(Pos.CENTER);\n \n // create labels\n Label savings = new Label(\"1: Savings Account\");\n Label netSavings = new Label(\"2: Net Savings Account\");\n Label cheque = new Label(\"3: Cheque Account\");\n Label fixed = new Label(\"4: Fixed Account\");\n \n \n // add labels to VBOX\n userInfo.getChildren().add(savings);\n userInfo.getChildren().add(netSavings);\n userInfo.getChildren().add(cheque);\n userInfo.getChildren().add(fixed);\n \n \n \n }", "private void initBroker() throws URISyntaxException, IOException {\n\n ClassLoader classloader = Thread.currentThread().getContextClassLoader();\n\n // InputStream is = classloader.getResourceAsStream(\"data/merchant.csv\");\n\n URL brokerURL = classloader.getResource(\"data/broker/\");\n String[] merchantFiles = new File(brokerURL.toURI()).list();\n\n int j = 0;\n while (j < merchantFiles.length) {\n InputStream is = classloader.getResourceAsStream(\"data/broker/\" + merchantFiles[j]);\n CSVReader reader = new CSVReader(new InputStreamReader(is, \"UTF-8\"));\n String[] nextLine;\n while ((nextLine = reader.readNext()) != null) {\n String tradeName = nextLine[FORENAME];\n if (StringUtils.isBlank(tradeName)) {\n continue;\n }\n brokerImportService.saveOrUpdateBroker(fillUpBrokerImportVO(nextLine));\n }\n j++;\n }\n\n }", "@Before\n public void setUp() throws Exception {\n csConf = new CapacitySchedulerConfiguration();\n csConf.setClass(YarnConfiguration.RM_SCHEDULER, CapacityScheduler.class,\n ResourceScheduler.class);\n\n // By default, set 3 queues, a/b, and a.a1\n csConf.setQueues(\"root\", new String[]{\"a\", \"b\"});\n csConf.setNonLabeledQueueWeight(\"root\", 1f);\n csConf.setNonLabeledQueueWeight(\"root.a\", 1f);\n csConf.setNonLabeledQueueWeight(\"root.b\", 1f);\n csConf.setQueues(\"root.a\", new String[]{\"a1\"});\n csConf.setNonLabeledQueueWeight(\"root.a.a1\", 1f);\n csConf.setAutoQueueCreationV2Enabled(\"root\", true);\n csConf.setAutoQueueCreationV2Enabled(\"root.a\", true);\n csConf.setAutoQueueCreationV2Enabled(\"root.e\", true);\n csConf.setAutoQueueCreationV2Enabled(PARENT_QUEUE, true);\n // Test for auto deletion when expired\n csConf.setAutoExpiredDeletionTime(1);\n }", "public static void main(String[] args) throws Exception {\n final String clientId = ExtensionConst.clientId;\n final String device_name = \"QchDevice0409\";\n final String serverUrl = ExtensionConst.mqttUrl;\n final String tenant = ExtensionConst.tenant;\n final String username = ExtensionConst.username;\n final String password = ExtensionConst.password;\n\n // MQTT connection options\n final MqttConnectOptions options = new MqttConnectOptions();\n options.setUserName(tenant + \"/\" + username);\n options.setPassword(password.toCharArray());\n\n // connect the client to Cumulocity IoT\n final MqttClient client = new MqttClient(serverUrl, clientId, null);\n client.connect(options);\n\n // 创建设备(100,myDevice,myType)\n client.publish(ExtensionConst.publish_topic, (\"100,\" + device_name + \",qchtype\").getBytes(), 2, false);\n\n // 设置硬件信息(110,serialNumber,model,revision)\n client.publish(ExtensionConst.publish_topic, \"110,serial123456789,MQTT test model,Rev0.1\".getBytes(), 2, false);\n\n // 向云端申明支持的下发操作类型\n client.publish(ExtensionConst.publish_topic, \"114,c8y_Restart,c8y_Command,c8y_Configuration,c8y_SoftwareList\".getBytes(), 2, false);\n\n // 设置网关设备要求间隔时间(117,requireIntervalInSeconds)\n client.publish(ExtensionConst.publish_topic, \"117,60\".getBytes(), 2, false);\n }", "public MessageCenter( String name )\n {\n receiver_table = new Hashtable<Object,Vector<IReceiveMessage>>();\n message_table = new Hashtable<Object,Vector<Message>>();\n sender_receiver_table = null;\n sender_message_table = null;\n center_name = name;\n }", "public void init(int yea)\n {\n try\n {\n InitialContext initialContext = new InitialContext(getProperties());\n //logger.info(\"initial context successful\");\n\n// ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup(\"/ConnectionFactory\");\n// System.out.println(\"lookup successful\");\n// Connection connection = connectionFactory.createConnection();\n//\n// Queue bridgeQueue = (Queue)initialContext.lookup(\"/queue/bridgeQueue\");\n// Queue himsQueue = (Queue)initialContext.lookup(\"/queue/himsQueue\");\n//\n// Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);\n// consumer = session.createConsumer(bridgeQueue);\n// producer = session.createProducer(himsQueue);\n\n System.out.println(\"connection successful\");\n //logger.info(\"Jms Connection factory and resources created without errors\");\n// connection.start();\n }\n catch (Exception e)\n {\n e.printStackTrace();\n //logger.error(\"error looking up jms connection factory\", e);\n }\n }", "public static BrokerCompatibilityCheck create(final Map<String, Object> streamsConfig, final Set<String> topicNames) {\n if (topicNames.isEmpty()) {\n throw new KsqlException(\"Unable to check broker compatibility against a broker without any topics\");\n }\n final Map<String, Object> consumerConfigs = new StreamsConfig(streamsConfig)\n .getConsumerConfigs(\"__ksql_compatibility_check\", \"ksql_server\");\n\n // remove this otherwise it will try and instantiate the StreamsPartitionAssignor\n consumerConfigs.remove(\"partition.assignment.strategy\");\n final KafkaConsumer<String, String> consumer\n = new KafkaConsumer<>(consumerConfigs, new StringDeserializer(), new StringDeserializer());\n return new BrokerCompatibilityCheck(consumer, new TopicPartition(topicNames.iterator().next(), 0));\n }" ]
[ "0.5879939", "0.58418936", "0.5834202", "0.5801835", "0.5786039", "0.57818013", "0.57221746", "0.5698351", "0.5651542", "0.5500502", "0.5497762", "0.54851156", "0.540663", "0.54028034", "0.5371037", "0.5330681", "0.53215915", "0.53115773", "0.52500516", "0.5242055", "0.5240201", "0.522002", "0.5192399", "0.5179335", "0.5115242", "0.51131654", "0.51118493", "0.5096751", "0.5088602", "0.5079245", "0.5078679", "0.5077587", "0.5076979", "0.5076417", "0.505354", "0.5030457", "0.50265723", "0.50175774", "0.499842", "0.49870184", "0.49807116", "0.49621606", "0.4961246", "0.49418607", "0.49370944", "0.49324757", "0.49168366", "0.4906498", "0.48935914", "0.48929122", "0.48894334", "0.48815694", "0.48711532", "0.48674524", "0.48651576", "0.48529875", "0.48493665", "0.48493665", "0.4838413", "0.48217618", "0.48184213", "0.48171246", "0.48061186", "0.4805155", "0.48017538", "0.4798434", "0.47943208", "0.47932076", "0.47901264", "0.47845283", "0.47829944", "0.47829688", "0.4779479", "0.47729638", "0.47565413", "0.47552872", "0.4754952", "0.4747295", "0.47452724", "0.47448367", "0.4740097", "0.47322115", "0.47281507", "0.47245172", "0.47242674", "0.47211924", "0.4711926", "0.47100818", "0.470744", "0.47037587", "0.47036657", "0.46970582", "0.46933034", "0.46846232", "0.46769062", "0.46762934", "0.46715295", "0.46695736", "0.46657073", "0.46559522" ]
0.7197028
0
print out all runtime results of cloudlets
private static void printCloudletList(List<Cloudlet> list) { int size = list.size(); Cloudlet cloudlet; List<Double> CPUtime = new ArrayList<Double>(); List <Double> cputime = new ArrayList<Double>(); List <Double> start_time = new ArrayList<Double>(); List<Double> starttime = new ArrayList<Double>(); List<Double> endtime = new ArrayList<Double>(); String indent = " "; Log.printLine(); Log.printLine("========== OUTPUT =========="); DecimalFormat dft = new DecimalFormat("###.##"); for (int i = 0; i < size; i++) { cloudlet = list.get(i); if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS){ cputime.add(cloudlet.getActualCPUTime()); start_time.add(cloudlet.getExecStartTime()); } } for (int i = 0; i < size; i++) { cloudlet = list.get(i); if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS){ if(!CPUtime.contains(cloudlet.getActualCPUTime())) { CPUtime.add(cloudlet.getActualCPUTime()); } if(!starttime.contains(cloudlet.getExecStartTime())) { starttime.add(cloudlet.getExecStartTime()); } if(!endtime.contains(cloudlet.getFinishTime())) { endtime.add(cloudlet.getFinishTime()); } } } int n=0; for (int i=0; i< CPUtime.size();i++) { n= Collections.frequency(cputime,CPUtime.get(i)); Log.printLine(dft.format(n)+" "+"Cloudlets finish in "+ dft.format(CPUtime.get(i))+"s" ); } Log.printLine(); for (int i=0; i< starttime.size();i++) { n= Collections.frequency(start_time,starttime.get(i)); Log.printLine(dft.format(n)+" "+"Cloudlets executes in time "+ dft.format(starttime.get(i))+"~" + dft.format(endtime.get(i))+"s"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printRuntimes() {\n\t\tfor(long x: runtimes){\n\t\t\tSystem.out.println(\"run with time \"+x+\" nanoseconds\");\n\t\t}\t\n\t}", "public static void stdout(){\n\t\tSystem.out.println(\"Buildings Found: \" + buildingsFound);\n\t\tSystem.out.println(\"Pages searched: \"+ pagesSearched);\n\t\tSystem.out.println(\"Time Taken: \" + (endTime - startTime) +\"ms\");\t\n\t}", "public static void printResults() {\n System.out.println(\" Results: \");\n Crawler.getKeyWordsHits().forEach((keyWord, hitsNumber) -> System.out.println(keyWord + \" : \" + hitsNumber + \";\"));\n System.out.println(\" Total hits: \" + Crawler.getTotalHits());\n\n }", "public void printInfo(){\n\t\tSystem.out.println(\"id : \" + id + \" label : \" + label);\n\t\tSystem.out.println(\"vms : \" );\n\t\tfor(VirtualMachine v : vms){\n\t\t\tv.printInfo();\n\t\t}\n\t}", "void print_statistics(long tot_arrived, long tot_processed, Double end_time){\n\n CloudEvent cloudEvent = new CloudEvent();\n CloudletEvent cletEvent = new CloudletEvent();\n PrintFile print = new PrintFile();\n\n\n // System response time & throughput\n\n float system_response_time = (float)(sum_service_times1_clet+ sum_service_times1_cloud + sum_service_times2_clet+ sum_service_times2_cloud)/ tot_processed;\n float response_time_class1 = (float) ((sum_service_times1_clet+ sum_service_times1_cloud)/ (completition_clet_type1 + completition_cloud_type1));\n float response_time_class2 = (float) ((sum_service_times2_clet+ sum_service_times2_cloud)/ (completition_clet_type2 + completition_cloud_type2));\n\n float lambda_tot = (float) (tot_arrived/end_time);\n float lambda_1 = (float)((arrival_type1_clet+arrival_type1_cloud)/end_time);\n float lambda_2 = (float)((arrival_type2_clet+arrival_type2_cloud)/end_time);\n\n\n // per-class effective cloudlet throughput\n\n float task_rate_clet1 = (float) ((float)completition_clet_type1 / end_time);\n float task_rate_clet2 = (float) ((float)completition_clet_type2 / end_time);\n\n\n // per-class cloud throughput\n\n float lambda_cloud1 = (float) ((arrival_type1_cloud)/end_time);\n float lambda_cloud2 = (float) ((arrival_type2_cloud)/end_time);\n\n\n // class response time and mean population\n\n float response_time_cloudlet = (float) (sum_service_times1_clet+ sum_service_times2_clet)/ (completition_clet_type1 + completition_clet_type2);\n float response_time_cloudlet1 = (float) sum_service_times1_clet/ completition_clet_type1;\n float response_time_cloudlet2 = (float) (sum_service_times2_clet/ completition_clet_type2);\n\n float response_time_cloud = (float) ((sum_service_times1_cloud+ sum_service_times2_cloud)/ (completition_cloud_type1 + completition_cloud_type2));\n float response_time_cloud1 = (float) (sum_service_times1_cloud/ completition_cloud_type1);\n float response_time_cloud2 = (float) (sum_service_times2_cloud/ completition_cloud_type2);\n\n // E[N] cloudlet\n float mean_cloudlet_jobs = cletEvent.mean_cloudlet_jobs_number();\n // E[N] class 1 cloudlet\n float mean_cloudlet_jobs1 = cletEvent.mean_cloudlet_jobs_number1();\n // E[N] class 2 cloudlet\n float mean_cloudlet_jobs2 = cletEvent.mean_cloudlet_jobs_number2();\n\n // E[N] cloud\n float mean_cloud_jobs = cloudEvent.mean_cloud_jobs_number();\n // E[N] class 1 cloud\n float mean_cloud_jobs1 = cloudEvent.mean_cloud_jobs_number1();\n // E[N] class 2 cloud\n float mean_cloud_jobs2 = cloudEvent.mean_cloud_jobs_number2();\n\n\n // Altre statistiche di interesse\n\n float lambda_clet = (float) ((arrival_type1_clet+ arrival_type2_clet)/end_time);\n float lambda_clet1 = (float) ((arrival_type1_clet)/end_time);\n float lambda_clet2 = (float) ((arrival_type2_clet)/end_time);\n float lambda_cloud = (float) ((arrival_type1_cloud+ arrival_type2_cloud)/end_time);\n\n double rate1_clet = mean_cloudlet_jobs1*0.45;\n double rate2_clet = mean_cloudlet_jobs2*0.27;\n\n\n\n NumberFormat numForm = NumberFormat.getInstance();\n numForm.setMinimumFractionDigits(6);\n numForm.setMaximumFractionDigits(6);\n numForm.setRoundingMode(RoundingMode.HALF_EVEN);\n\n\n System.out.println(\"\\n\\n\\n 1) SYSTEM RESPONSE TIME & THROUGHPUT \" + \"(GLOBAL & PER-CLASS)\");\n\n System.out.println(\"\\n Global System response time ...... = \" + numForm.format( system_response_time));\n System.out.println(\" Response time class 1 ...... = \" + numForm.format( response_time_class1));\n System.out.println(\" Response time class 2 ...... = \" + numForm.format( response_time_class2));\n\n System.out.println(\"\\n Global System throughput ...... = \" + numForm.format( lambda_tot));\n System.out.println(\" Throughput class 1 ...... = \" + numForm.format( lambda_1));\n System.out.println(\" Throughput class 2 ...... = \" + numForm.format( lambda_2));\n\n\n System.out.println(\"\\n\\n\\n 2) PER_CLASS EFFECTIVE CLOUDLET THROUGHPUT \");\n System.out.println(\" Task-rate cloudlet class 1 ...... = \" + numForm.format( rate1_clet));\n System.out.println(\" Task-rate cloudlet class 2 ...... = \" + numForm.format( rate2_clet));\n\n\n System.out.println(\"\\n\\n\\n 3) PER_CLASS CLOUD THROUGHPUT \");\n System.out.println(\" Throughput cloud class 1 ...... = \" + numForm.format( lambda_cloud1));\n System.out.println(\" Throughput cloud class 2 ...... = \" + numForm.format( lambda_cloud2));\n\n\n System.out.println(\"\\n\\n\\n 4) CLASS RESPONSE TIME & MEAN POPULATION \" + \"(CLOUDLET & CLOUD)\");\n\n System.out.println(\"\\n Response Time class 1 cloudlet ...... = \" + numForm.format( response_time_cloudlet1));\n System.out.println(\" Response Time class 2 cloudlet ...... = \" + numForm.format(response_time_cloudlet2));\n System.out.println(\" Response Time class 1 cloud ...... = \" + numForm.format( response_time_cloud1));\n System.out.println(\" Response Time class 2 cloud ...... = \" + numForm.format( response_time_cloud2));\n\n System.out.println(\"\\n Mean Population class 1 cloudlet ...... = \" + numForm.format( mean_cloudlet_jobs1));\n System.out.println(\" Mean Population class 2 cloudlet ...... = \" + numForm.format( mean_cloudlet_jobs2));\n System.out.println(\" Mean Population class 1 cloud ...... = \" + numForm.format( mean_cloud_jobs1));\n System.out.println(\" Mean Population class 2 cloud ...... = \" + numForm.format( mean_cloud_jobs2));\n\n }", "void print() {\n for (Process process : workload) {\n System.out.println(process);\n }\n }", "public static void printResults() {\n resultMap.entrySet().stream().forEach((Map.Entry<File, String> entry) -> {\n System.out.println(String.format(\"%s processed by thread: %s\", entry.getKey(), entry.getValue()));\n });\n System.out.println(String.format(\"processed %d entries\", resultMap.size()));\n }", "public void print() {\n\t\tSystem.out.println(\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName+\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)+\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress);\r\n\t}", "public static void main(String[] args) {\n\t\tint numUser = 1;\n\t\tCalendar cal = Calendar.getInstance();\n\t\tboolean traceFlag = false;\n\t\tCloudSim.init(numUser, cal, traceFlag);\n\t\t// TODO Create the data center and define the the policies for the allocating and scheduling\n\t\tDatacenter datacenter = CreateDataCenter();\n\t\t// TODO Create the data center broker\n\t\tDatacenterBroker datacenterBroker = CreateDataCenterBroker();\n\t\t// TODO Create Cloudlet\n\t\tList<Cloudlet> cloudletList = new ArrayList<Cloudlet>();\n\t\t//Try to set the random number for the cloudlet length\n\t\tlong cloudletLength = 40000;\n\t\tint pesNumber = 1;\n\t\tlong cloudletFileSize = 300;\n\t\tlong cloudletOutputSize = 400;\n\t\tUtilizationModel utilizationModelCpu = new UtilizationModelFull();\n\t\tUtilizationModel utilizationModelRam = new UtilizationModelFull();\n\t\tUtilizationModel utilizationModelBw = new UtilizationModelFull();\n\t\tfor (int cloudletId = 0; cloudletId < 40; cloudletId++) {\n\t\t\tCloudlet cloudlet = new Cloudlet(cloudletId, cloudletLength, pesNumber, cloudletFileSize, cloudletOutputSize,\n\t\t\t\t\tutilizationModelCpu, utilizationModelRam, utilizationModelBw);\n\t\t\tcloudlet.setUserId(datacenterBroker.getId());\n\t\t\tcloudletList.add(cloudlet);\n\t\t}\n\t\t// TODO Create Virtual Machines and define the Procedure for task scheduling algorithm\n\t\tList<Vm> vmList = new ArrayList<Vm>();\n\t\tint userId = 0;\n\t\tdouble mips = 1000;\n\t\tint numberOfPes = 1;\n\t\tint ram = 2000;\n\t\tlong bandwidth = 1000;\n\t\tlong diskSize = 20000;\n\t\tString vmm = \"XEN\";\n\t\tCloudletScheduler cloudletScheduler = new CloudletSchedulerTimeShared();\n\t\tfor (int id = 0; id < 10; id++) {\n\t\t\tVm virtualMachine = new Vm(id, datacenterBroker.getId(), mips, numberOfPes, ram, bandwidth, diskSize, vmm,\n\t\t\t\t\tcloudletScheduler);\n\t\t\tvmList.add(virtualMachine);\n\t\t}\n\t\tdatacenterBroker.submitCloudletList(cloudletList);\n\t\tdatacenterBroker.submitVmList(vmList);\n\t\t// TODO Implement the Power classes\n\t\tCloudSim.startSimulation();\n\t\tList<Cloudlet> finalCloudletExecutionResults = datacenterBroker.getCloudletReceivedList();\n\t\tCloudSim.stopSimulation();\n\t\t// TODO Test the demo and Print the result\n\t\tfor (Cloudlet cloudlet : finalCloudletExecutionResults) {\n\t\t\tLog.printLine(\"Cloudlet: \" + cloudlet.getCloudletId() + \" VM: \" + cloudlet.getVmId() + \n\t\t\t\t\t\" Status: \" + cloudlet.getStatus() + \" Execution Time: \" + cloudlet.getActualCPUTime() + \n\t\t\t\t\t\" Start Time \" + cloudlet.getExecStartTime() + \" Finished Time: \" + cloudlet.getFinishTime());\n\t\t\tLog.printLine(\"----------------------------------------------------------------------------------------------------\");\n\t\t}\n\t}", "private static void printStats()\r\n\t{\r\n\t\tSystem.out.println(\"Keywords found: \" + keywordHits);\r\n\t\tSystem.out.println(\"Links found: \" + SharedLink.getLinksFound());\r\n\t\tSystem.out.println(\"Pages found: \" + SharedPage.getPagesDownloaded());\r\n\t\tSystem.out.println(\"Failed downloads: \" + SharedPage.getFailedDownloads());\r\n\t\tSystem.out.println(\"Producers: \" + fetchers);\r\n\t\tSystem.out.println(\"Consumers: \" + parsers);\r\n\t}", "private void printResults() {\n\t\tfor (Test test : tests) {\n\t\t\ttest.printResults();\n\t\t}\n\t}", "private void go(String[] args) {\n System.setProperty(\"jsse.enableSNIExtension\", \"false\");\n\n // process command line arguments\n options = new SampleCommandLineOptions();\n options.parseOptions(args);\n\n // Log in to vCHS API, getting a session in response if login is successful\n System.out.print(\"\\nConnecting to vCHS...\");\n\n authToken = IAM.login(options.hostname, options.username, options.password, options.version);\n\n System.out.println(\"Success\\n\");\n\n // Retrieve the collection of compute services which can be of type dedicated cloud or vpc\n // and has VDC in it.\n List<PlanType> plans = ServiceController.getPlans(options.hostname, options.version,\n authToken);\n if (null != plans && plans.size() > 0) {\n System.out.println(\"PLANS\");\n System.out.println(\"-----\");\n System.out.println();\n\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\", \"Name\", \"Id\", \"Region\",\n \"Service Name\", \"Plan Version\");\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\",\n \"----------------------------------------\",\n \"----------------------------------------\",\n \"--------------------------------------------------\",\n \"------------------------------\", \"-------------------\");\n\n for (PlanType plan : plans) {\n System.out.printf(\"%-40s %-40s %-50s %-30s %-20s\\n\", plan.getName(), plan.getId(),\n plan.getRegion(), plan.getServiceName(), plan.getPlanVersion());\n }\n }\n\n List<InstanceType> instances = ServiceController.getInstances(options.hostname,\n options.version, authToken);\n System.out.println(\"\\n\");\n\n if (null != instances && instances.size() > 0) {\n System.out.println(\"INSTANCES\");\n System.out.println(\"---------\");\n System.out.println();\n\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\", \"Name\", \"Id\", \"Region\", \"Plan Id\");\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\",\n \"----------------------------------------\",\n \"----------------------------------------\",\n \"--------------------------------------------------\",\n \"--------------------------------------------------\");\n\n for (InstanceType instance : instances) {\n System.out.printf(\"%-40s %-40s %-50s %-50s\\n\", instance.getName(),\n instance.getId(), instance.getRegion(), instance.getPlanId());\n }\n }\n\n System.out.println(\"\\n\\n\");\n }", "public void printAllComputers( ) { \n\t\tint i=1;\n\t\tfor (Computer temp : computers ) {\n\n\t\t\tSystem.out.println(\"Computer number : \"+i);\n\t\t\ttemp.printComputerSummary();\n\t\t\ti++;\n\n\t\t}\n\t}", "void displayResults(final InvokeResult[] results)\n {\n for (int i = 0; i < results.length; ++i)\n {\n final InvokeResult result = results[i];\n\n final String s = new SmartStringifier(\"\\n\", false).stringify(result);\n println(s + \"\\n\");\n }\n }", "public static void displaySta() {\n System.out.println(\"\\n\\n\");\n System.out.println(\"average service time: \" + doAvgProcessingTime() /100 + \" milliseconds\");\n System.out.println(\"max service time: \" + maxProcessingTime /100 + \" milliseconds\");\n System.out.println(\"average turn around time \" + doAvgTurnAroundTime()/100 + \" milliseconds\");\n System.out.println(\"max turn around time \" + maxTurnAroundTime/100 + \" milliseconds\");\n System.out.println(\"average wait time \" + doAvgWaitTime()/10000 + \" milliseconds\");\n System.out.println(\"max wait time \" + maxWaitTime/10000 + \" milliseconds\");\n System.out.println(\"end time \" + endProgramTime);\n System.out.println(\"start time \" + startProgramTime);\n System.out.println(\"processor utilization: \" + doCPU_usage() + \" %\");\n System.out.println(\"Throughput: \" + doThroughPut());\n System.out.println(\"---------------------------\");\n\n\n }", "protected void printExecutionTime(){\n //Do nothing\n }", "public static void printExecutionTime() {\n long endTime = System.currentTimeMillis();\n\n logger.info(\"Completed Execution in: \" + (endTime - ClientExecutorEngine.getStartTime())/1000.0 + \" seconds.\");\n }", "private static void printGridletList(GridletList list, String name)\r\n {\r\n int size = list.size();\r\n Gridlet gridlet = null;\r\n\r\n String indent = \" \";\r\n System.out.println();\r\n System.out.println(\"============= OUTPUT for \" + name + \" ==========\");\r\n System.out.println(\"Gridlet ID\" + indent + \"getResourceID\" + \"STATUS\" + indent +\r\n \"Resource ID\" + \" getGridletLength getGridletFileSize getGridletOutputSize getGridletOutputSize getSubmissionTime getWaitingTime getWallClockTime getExecStartTime\");\r\n\r\n // a loop to print the overall result\r\n int i = 0;\r\n for (i = 0; i < size; i++)\r\n {\r\n gridlet = (Gridlet) list.get(i);\r\n printGridlet(gridlet);\r\n \r\n\r\n System.out.println();\r\n }\r\n }", "public void printComputerSummary() {\n\t\tfor (Component comp: configuration.values())\n\t\t{\n\t\t\tSystem.out.println(comp.getDescription());\n\t\t}\n\t}", "private void dumpResults(long startTime, long endTime) {\n \n Log.info(TAG_LOG, \"***************************************\");\n \n if (testResults != null) {\n int tot = 0;\n int failed = 0;\n int success = 0;\n int skipped = 0;\n for(int i=0;i<testResults.size();++i) {\n StringBuffer res = new StringBuffer();\n \n TestStatus status = (TestStatus)testResults.elementAt(i);\n String url = status.getScriptName();\n \n res.append(\"Script=\").append(url);\n String r;\n switch (status.getStatus()) {\n case TestStatus.SUCCESS:\n r = \"SUCCESS\";\n success++;\n break;\n case TestStatus.FAILURE:\n r = \"FAILURE\";\n failed++;\n // Record that we had an error\n errorCode = -1;\n break;\n case TestStatus.SKIPPED:\n r = \"SKIPPED\";\n skipped++;\n break;\n default:\n r = \"UNDEFINED\";\n break;\n }\n \n res.append(\" Result=\").append(r);\n String detailedError = status.getDetailedError();\n tot++;\n if (detailedError != null) {\n res.append(\" Error=\").append(detailedError);\n }\n Log.info(TAG_LOG, res.toString());\n }\n Log.info(TAG_LOG, \"---------------------------------------\");\n Log.info(TAG_LOG, \"Total number of tests: \" + tot);\n Log.info(TAG_LOG, \"Total number of success: \" + success);\n Log.info(TAG_LOG, \"Total number of failures: \" + failed);\n Log.info(TAG_LOG, \"Total number of skipped: \" + skipped);\n long secs = (endTime - startTime) / 1000;\n Log.info(TAG_LOG, \"Total execution time: \" + secs);\n } else {\n Log.info(TAG_LOG, \"No tests performed\");\n }\n Log.info(TAG_LOG, \"***************************************\");\n }", "public void print_dev() {\n\t\tSystem.out.println(\r\n\t\t\t\t\t\t\t\t\t\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName\r\n\t\t\t\t\t\t\t\t+\t\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)\r\n\t\t\t\t\t\t\t\t+\t\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Function Limit Count\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Eat : \"+TMGCSYS.tmgcLimitEat+\", Sleep : \"+TMGCSYS.tmgcLimitSleep\r\n\t\t\t\t\t\t\t\t+\t\", Walk : \"+TMGCSYS.tmgcLimitWalk+\", Study : \"+TMGCSYS.tmgcLimitStudy+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Character Ability\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" STR : \"+TMGCSYS.tmgcSTR+\", INT : \"+TMGCSYS.tmgcINT\r\n\t\t\t\t\t\t\t\t+\t\", DEB : \"+TMGCSYS.tmgcDEB+\", HET : \"+TMGCSYS.tmgcHET+\"\\n\\n\\n\"\r\n\t\t\t\t\t\t\t\t+\t\" Character Job : \"+TMGCSYS.tmgc2ndJob\r\n\t\t\t\t\t\t\t\t);\r\n\t}", "public void displayResults() {\n\t\tcreateCluster();\n\t\tassignClusterID();\n\t\tSystem.out.println(iterations);\n\t\tWriter writer;\n\t\ttry {\n\t\t\twriter = new FileWriter(\"/Users/saikalyan/Documents/ClusterResult_kmeans.txt\");\n\t\t\tfor (int key : labelsMap.keySet()) {\n\t\t\t\tclusterResultsList.add(clusterIdMap.get(labelsMap.get(key)));\n\t\t\t\twriter.write(String.valueOf(clusterIdMap.get(labelsMap.get(key))));\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t\tSystem.out.println(key + \" : \" + clusterIdMap.get(labelsMap.get(key)));\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tExternalValidator extValidation = new ExternalValidator(count, groundTruthList, clusterResultsList);\n\n\t\tfloat res = extValidation.getCoefficient();\n\t\tSystem.out.println(\"Rand Index------------\" + res);\n\n\t\tfloat jaccard = extValidation.getJaccardCoeff();\n\t\tSystem.out.println(\"Jaccard co-efficient------------\" + jaccard);\n\n\t}", "public void dump() {\n for(Object object : results) {\n System.out.println( object );\n }\n }", "public void Sample() {\n \t\tfor (int loop = 0; loop < 10; loop++) {\n \t\t\tJobs jobUnit = new Jobs(\"java -version\");\n \t\t\tjobqueue.add(jobUnit);\n \t\t}\n \t}", "private void psvm() {\n\t\tSystem.out.println(\"test\");\r\n\t}", "public void printMetrics() {\n System.out.println(\"\\nPROG_SIZE = \" + Metrics.getProgSize() + '\\n' + \"EXEC_TIME = \" + Metrics.getExecTime() + \" ms\" + '\\n' + \"EXEC_MOVE = \" + Metrics.getExecMove() + '\\n' + \"DATA_MOVE = \" + Metrics.getDataMove() + '\\n' + \"DATA_READ = \" + Metrics.getDataRead() + '\\n' + \"DATA_WRITE = \" + Metrics.getDataWrite() + '\\n');\n }", "public void reportStats() {\n System.out.println(\"Number of requests: \" + (requestCount - warmUpRequests));\n System.out.println(\"Number of hits: \" + hitCount);\n System.out.println(\"hit ratio: \" + (double) hitCount / (requestCount - warmUpRequests));\n System.out.println(\"Average hit cost: \" + (double) hitCost / hitCount);\n }", "public void dump() {\n System.out.println(\"ID : \"+hostID);\n for (int i=0; i<hostAddresses.size(); i++) System.out.println(\" - addresse : \"+hostAddresses.elementAt(i).getNormalizedAddress());\n System.out.println(\"CPU : \"+cpuLoad);\n System.out.println(\"Memoire : \"+memoryLoad);\n System.out.println(\"Batterie : \"+batteryLevel);\n System.out.println(\"Threads : \"+numberOfThreads);\n System.out.println(\"CMs : \"+numberOfBCs);\n System.out.println(\"connecteurs : \"+numberOfConnectors);\n System.out.println(\"connecteurs entree reseau : \"+numberOfConnectorsNetworkInputs);\n System.out.println(\"connecteurs sortie reseau : \"+numberOfConnectorsNetworkOutputs);\n System.out.println(\"Traffic PF entree : \"+networkPFInputTraffic);\n System.out.println(\"Traffic PF sortie : \"+networkPFOutputTraffic);\n System.out.println(\"Traffic application entree : \"+networkApplicationInputTraffic);\n System.out.println(\"Traffic application sortie : \"+networkApplicationOutputTraffic);\n }", "private static void printUsage() throws Exception {\n\t\tSystem.out.println(new ResourceGetter(\"uk/ac/cam/ch/wwmm/oscar3/resources/\").getString(\"usage.txt\"));\n\t}", "private static void printStats(Stats stats) {\n long elapsedTime = (System.nanoTime() - startTime) / 1000000;\n System.out.println(\"Analysis completed - \" + keyCount + \" keys processed in \" + elapsedTime + \" ms\");\n getConsole().println(\"Analysis completed - \" + keyCount + \" keys processed in \" + elapsedTime + \" ms\");\n stats.print();\n }", "private void printTimer() {\n\t\tif (_verbose) {\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"-- \" + getTimeString() + \" --\");\n\t\t}\n\t}", "protected static void printJobList(List<Job> list) {\n //String indent = \" \";\n String indent = \"\\t\";\n Log.printLine();\n Log.printLine(\"========== OUTPUT ==========\");\n Log.printLine(\"Job ID\" + indent + indent + \"Task ID\" + indent + indent + \"STATUS\" + indent + indent\n + \"Data center ID\" + indent + \"VM ID\" + indent + indent\n + \"Time\" + indent + indent + \"Start Time\" + indent + \"Finish Time\" + indent + \"Depth\");\n DecimalFormat dft = new DecimalFormat(\"###.##\");\n for (Job job : list) {\n \tLog.print(job.getCloudletId() + indent + indent);\n if (job.getClassType() == ClassType.STAGE_IN.value) {\n \tLog.print(\"Stage-in\");\n if (job.getCloudletStatus() == Cloudlet.SUCCESS) {\n \tLog.print(indent + \"SUCCESS\");\n \tLog.printLine(indent + indent + job.getResourceId() + indent + indent + job.getVmId()\n + indent + indent + dft.format(job.getActualCPUTime())\n + indent + indent + dft.format(job.getExecStartTime()) + indent + indent\n + dft.format(job.getFinishTime()) + indent + indent + job.getDepth());\n } else if (job.getCloudletStatus() == Cloudlet.FAILED) {\n \tLog.print(\"FAILED\");\n \tLog.printLine(indent + indent + job.getResourceId() + indent + indent + job.getVmId()\n + indent + indent + dft.format(job.getActualCPUTime())\n + indent + indent + dft.format(job.getExecStartTime()) + indent + indent\n + dft.format(job.getFinishTime()) + indent + indent + job.getDepth());\n }\n }\n for (Task task : job.getTaskList()) {\n \tLog.print(task.getCloudletId());\n if (job.getCloudletStatus() == Cloudlet.SUCCESS) {\n \tLog.print(indent + indent + \"SUCCESS\");\n \tLog.printLine(indent + indent + job.getResourceId() + indent + indent + job.getVmId()\n + indent + indent + dft.format(job.getActualCPUTime())\n + indent + indent + dft.format(job.getExecStartTime()) + indent + indent\n + dft.format(job.getFinishTime()) + indent + indent + job.getDepth());\n } else if (job.getCloudletStatus() == Cloudlet.FAILED) {\n \tLog.print(\"FAILED\");\n \tLog.printLine(indent + indent + job.getResourceId() + indent + indent + job.getVmId()\n + indent + indent + dft.format(job.getActualCPUTime())\n + indent + indent + dft.format(job.getExecStartTime()) + indent + indent\n + dft.format(job.getFinishTime()) + indent + indent + job.getDepth());\n }\n }\n //Verbose.toPrint(indent);\n \n \n }\n }", "public void echo() {\n\tSystem.out.printf(\"cache name: %s\\n\", myCache.getName());\n\tSystem.out.printf(\"cache size: %s\\n\", myCache.size());\n\tSystem.out.printf(\"cache entry[%s]: %s\\n\", \"bean1\", myCache.get(\"bean1\").toString());\n\tSystem.out.printf(\"cache entry[%s]: %s\\n\", \"bean2\", myCache.get(\"bean2\").toString());\n }", "static void loopcomp () {\r\n\t\tint t40k= timer(8000,40000); \r\n\t\tint t1k= timer(8000,1000); \r\n\t\tSystem.out.println(\"Total number of loops for printing every 40k loops = \" + t40k);\r\n\t\tSystem.out.println(\"Total number of loops for printing every 1k loops = \"+ t1k);\r\n\t}", "public void helloVM()\n {\n \ttry {\n\n\t\t\t\n\t\t\tVirtualMachineConfigInfo vminfo = vm.getConfig();\n\t\t\tVirtualMachineCapability vmc = vm.getCapability();\n\t\t\tVirtualMachineRuntimeInfo vmri = vm.getRuntime();\n\t\t\tVirtualMachineSummary vmsum = vm.getSummary();\n\n\t\t\t\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"VM Information : \");\n\t\t\t\n\t\t\tSystem.out.println(\"VM Name: \" + vminfo.getName());\n\t\t\tSystem.out.println(\"VM OS: \" + vminfo.getGuestFullName());\n\t\t\tSystem.out.println(\"VM ID: \" + vminfo.getGuestId());\n\t\t\tSystem.out.println(\"VM Guest IP Address is \" +vm.getGuest().getIpAddress());\n\t\t\t\n\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"Resource Pool Informtion : \");\n\t\t\t\n\t\t\tSystem.out.println(\"Resource pool: \" +vm.getResourcePool());\n\t\t\t\n\t\t\tSystem.out.println(\"VM Parent: \" +vm.getParent());\n\t\t\t//System.out.println(\"VM Values: \" +vm.getValues());\n\t\t\tSystem.out.println(\"Multiple snapshot supported: \"\t+ vmc.isMultipleSnapshotsSupported());\n\t\t\tSystem.out.println(\"Powered Off snapshot supported: \"+vmc.isPoweredOffSnapshotsSupported());\n\t\t\tSystem.out.println(\"Connection State: \" + vmri.getConnectionState());\n\t\t\tSystem.out.println(\"Power State: \" + vmri.getPowerState());\n\t\t\t\n\n\t\t\t//CPU Statistics\n\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"CPU and Memory Statistics\" );\n\t\t\t\n\t\t\tSystem.out.println(\"CPU Usage: \" +vmsum.getQuickStats().getOverallCpuUsage());\n\t\t\tSystem.out.println(\"Max CPU Usage: \" + vmri.getMaxCpuUsage());\n\t\t\tSystem.out.println(\"Memory Usage: \"+vmsum.getQuickStats().getGuestMemoryUsage());\n\t\t\tSystem.out.println(\"Max Memory Usage: \" + vmri.getMaxMemoryUsage());\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\n\t\t} catch (InvalidProperty e) {\n\t\t\te.printStackTrace();\n\t\t} catch (RuntimeFault e) {\n\t\t\te.printStackTrace();\n\t\t} catch (RemoteException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "public void getResults() {\n\t\tSystem.out.println(\"|V| : \" + g.getV());\n\t\tSystem.out.println(\"|E| : \" + g.getE());\n\t\tSystem.out.println(\"Max flow : \" + g.getVertex(sink).e);\n\t\tSystem.out.println(\"Run time : \" + (System.currentTimeMillis()-timeStart) + \" ms\"+\"\\n\");\n\t}", "@Override\n public void printReportStats(Printer printer) {\n super.printReportStats(printer);\n printer.println(\"Classes: \" + jvmClasses.size());\n printer.println(\"Fields: \" + jvmFields.size());\n printer.println(\"Methods: \" + jvmMethods.size());\n printer.println(\"Variables: \" + jvmVariables.size());\n printer.println(\"HeapAllocations: \" + jvmHeapAllocations.size());\n printer.println(\"MethodInvocations: \" + jvmInvocations.size());\n printer.println(\"Usages: \" + usages.size());\n printer.println(\"Aliases: \" + aliases.size());\n printer.println(\"StringConstants: \" + jvmStringConstants.size());\n }", "private void displayAll()\n {\n for (int i = 0; i < cache.size(); ++i)\n {\n Record r = cache.get(i); \n System.out.println(r.key() + \" \" + r.value());\n }\n }", "void showProcessList(TimelyResultProcessor resultProcessor);", "public void displayResults() {\r\n Preferences.debug(\" ******* FitMultiExponential ********* \\n\\n\", Preferences.DEBUG_ALGORITHM);\r\n dumpTestResults();\r\n }", "@Override\r\n\tpublic void showSpeed() {\n\t\tSystem.out.println(\"i can run at 100km/h\");\r\n\t}", "public void printt() {\n for (int i=0 ; i<number ; i++) {\n System.out.println(\"LAB\" + (i+1) + \" ON \" + labs[i].getDay() + \" TEACHING BY: \" + labs[i].getTeacher());\n for (int j=0 ; j<labs[i].getCurrentSize() ; j++) {\n System.out.println(labs[i].getStudents()[j].getFirstName() + \" \" + labs[i].getStudents()[j].getLastName() + \" \" + labs[i].getStudents()[j].getId() + \" \" +labs[i].getStudents()[j].getGrade());\n }\n System.out.println(\"THE CAPACITY OF THE LAB IS: \" + labs[i].getCapacity());\n System.out.println(\"THE AVERAGE IS : \" + labs[i].getAvg());\n System.out.println();\n }\n }", "public static void Print() {\n\t\tSystem.out.println(\"Ticks: total \" + totalTicks + \", idle \" + idleTicks + \", system \" + systemTicks + \", user \"\n\t\t\t\t+ userTicks);\n\n\t\tSystem.out.println(\"Disk I/O: reads \" + numDiskReads + \", writes \" + numDiskWrites);\n\t\tSystem.out.println(\"Console I/O: reads \" + numConsoleCharsRead + \", writes \" + numConsoleCharsWritten);\n\t\tSystem.out.println(\"Paging: faults \" + numPageFaults);\n\n\t\tSystem.out.println(\"Network I/O: packets received \" + numPacketsRecvd + \", sent \" + numPacketsSent);\n\t}", "public void printStatistics() {\r\n\t\tLog.info(\"*** Statistics of Sequence Selector ***\");\r\n\r\n\t\t// chains\r\n\t\tLog.info(String.format(\"Chains: %d\", chains.size()));\r\n\t\tLog.info(String.format(\"Executable Chains: %d\", execChains.size()));\r\n\t\tLog.info(String.format(\"Causal Executable Chains: %d\",\r\n\t\t\t\tcausalExecChains.size()));\r\n\r\n\t\t// bushes\r\n\t\tLog.info(String.format(\"Bushes: %d\", bushes.size()));\r\n\t\tLog.info(String.format(\"Executable Bushes: %d\", execBushes.size()));\r\n\t\tLog.info(String.format(\"Required Bushes: %d\", requiredExecBushes.size()));\r\n\t\tLog.info(String.format(\"Redundant Bushes: %d\",\r\n\t\t\t\tredundantExecBushes.size()));\r\n\r\n\t\t// total\r\n\t\tLog.info(String.format(\"Bushes in Chains: %d\", bushesInChains.size()));\r\n\t\tLog.info(String.format(\"Total Sequences: %d\", totalSequences.size()));\r\n\r\n\t\t// time\r\n\t\tLog.info(String.format(\"Total Time: %d ms\", stopWatch.getTime()));\r\n\t\tLog.info(String.format(\"Time per Event: %d ms\", stopWatch.getTime()\r\n\t\t\t\t/ events.size()));\r\n\t}", "private static void consoleOutput() {\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n airportFlightCounter.toConsole();\n flightInventory.toConsole();\n flightPassengerCounter.toConsole();\n mileageCounter.toConsole();\n }", "public static void main (String[] args) {\n IdeCfg lg = new IdeCfg (\"/home/tb97952/nb34/netbeans/bin/ide.cfg\"); //(\"/space/nbsrc/performance/gc/report/vanilla/gclog\");\n Iterator i = lg.iterator();\n System.out.println(\"Printing the stuff:\");\n while (i.hasNext()) {\n System.out.println(i.next());\n }\n }", "public void printStats() {\n\t\tSystem.out.println(\"QuickSort terminates!\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Duration: \" + getDuration() + \" seconds\");\n\t\tSystem.out.println(\"Comparisons: \" + this.comparisonCounter);\n\t\tSystem.out.println(\"Boundary: \" + this.b);\n\t}", "public void printTypeInfo(){\n\t\tSystem.out.println(\"This type of computer is suitable for massive usage, when it comes to portability.\");\n\t\tSystem.out.println(\"Main thing at these computers is portability and funcionality.\");\n\t\t\n\t}", "void printParking();", "@Override\n\tpublic void printCacheEntries() {\n\t\tSystem.out.println(\"********* Fast Cache Entries *********\");\n\t\tSet<Map.Entry<K, V>> entrySet = cache.entrySet();\n\t\tfor (Map.Entry<K, V> entry : entrySet) {\n\t\t\tSystem.out.println(entry.getKey() + \", \" + entry.getValue());\n\t\t}\n\t\tSystem.out.println(\"*******************************\");\n\t}", "void printStats();", "public static void printUsage() {\n\t\tSystem.out.println(getVersions());\n\t\tSystem.out.println(\"Collect BE Metrics about Cache, Agent, and RTC\");\n\t\tSystem.out.println(\"BEJMX Usage:\");\n\t\tSystem.out.println(\"java com.tibco.metrics.bejmx.BEJMX -config <configFile> [-pid <pidList>]\");\n\t}", "public void printToStdout() {\n\t\tfor (int i = 0; i < results.size(); i++) {\n\t\t\tSystem.out.println(results.get(i).toString());\n\t\t}\n\t}", "static void print (){\n \t\tSystem.out.println();\r\n \t}", "private static void JVMInfo() {\n System.out.println(\"Available processors (cores): \" +\n Runtime.getRuntime().availableProcessors());\n\n /* Total amount of free memory available to the JVM */\n System.out.println(\"Free memory (bytes): \" +\n Runtime.getRuntime().freeMemory());\n\n /* This will return Long.MAX_VALUE if there is no preset limit */\n long maxMemory = Runtime.getRuntime().maxMemory();\n /* Maximum amount of memory the JVM will attempt to use */\n System.out.println(\"Maximum memory (bytes): \" +\n (maxMemory == Long.MAX_VALUE ? \"no limit\" : maxMemory));\n\n /* Total memory currently in use by the JVM */\n System.out.println(\"Total memory (bytes): \" +\n Runtime.getRuntime().totalMemory());\n\n }", "public void statistics(){\n\t\tSystem.out.println(\"heads: \"+ heads+\"\\ttails: \"+tails);\n\t\t\n\t}", "public void printResults() {\n\t System.out.println(\"BP\\tBR\\tBF\\tWP\\tWR\\tWF\");\n\t System.out.print(NF.format(boundaryPrecision) + \"\\t\" + NF.format(boundaryRecall) + \"\\t\" + NF.format(boundaryF1()) + \"\\t\");\n\t System.out.print(NF.format(chunkPrecision) + \"\\t\" + NF.format(chunkRecall) + \"\\t\" + NF.format(chunkF1()));\n\t System.out.println();\n }", "public void debugPrint() {\n\t\tsuper.debugPrint();\n\t\tSystem.out.println(\"requestID: \" + requestID);\n\t\tSystem.out.println(\"jzn: \" + jzn);\n\t\tif (jzn != null) {\n\t\t\tfor (int i = 0; i < jzn.length; i++) {\n\t\t\t\tSystem.out.println(i + \": \" + (jzn[i] != null ? jzn[i].length() : 0));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"jzt: \" + jzt);\t\t\n\t}", "public void printWorkload() {\n System.out.println(\"Routing Station \" + stationNumber + \" Has Total Workload Of \" + workload);\n }", "public void printStats() {\n\t\tSystem.out.println(\"========== LCMFreq v0.96r18 - STATS ============\");\n\t\tSystem.out.println(\" Freq. itemsets count: \" + frequentCount);\n\t\tSystem.out.println(\" Total time ~: \" + (endTimestamp - startTimestamp)\n\t\t\t\t+ \" ms\");\n\t\tSystem.out.println(\" Max memory:\" + MemoryLogger.getInstance().getMaxMemory());\n\t\tSystem.out.println(\"=====================================\");\n\t}", "public static void show(){\n // We will test all the APIs here\n System.out.println(\"Pasture seeds: \" + PastureSeed.count + \"\\tPasture product : \" + PastureProduct.count);\n System.out.println(\"Corn seeds: \" + CornSeed.count + \"\\t\\tCorn product : \" + CornProduct.count);\n System.out.println(\"Rice seeds: \" + RiceSeed.count + \"\\t\\tRice product : \" + RiceProduct.count);\n }", "public void show() {\n\t\t\n\t\tSystem.out.println(\"time (tree setup) = \" + treeSetup + \" ms\");\n\t\tSystem.out.println(\"time (average search) = \" + (totalSearch/(float)countSearch) + \" ms\");\n\t\tSystem.out.println(\"time (average at) = \" + (totalAt/(float)countAt) + \" ms\");\n \t}", "private static void printData(List<Long> runningTimes) {\n\t\tlong min = Collections.min(runningTimes);\n\t\tlong max = Collections.max(runningTimes);\n\t\t\n\t\tlong total = 0;\n\t\tfor(long runTime : runningTimes)\n\t\t\ttotal+=runTime;\n\t\t\n\t\tSystem.out.println(\"******* SEQUENTIAL RESULTS *******\");\n\t\tSystem.out.println(\"MIN RUNNING TIME(ms): \"+min);\n\t\tSystem.out.println(\"MAX RUNNING TIME(ms): \"+max);\n\t\tSystem.out.println(\"AVG RUNNING TIME(ms): \"+(total/runningTimes.size()));\n\t\tSystem.out.println(\"***********************************\");\n\t\tSystem.out.println();\n\t}", "private void printResults(List<CityByDegrees> cities){\r\n\t\tStringBuffer buffer = new StringBuffer();\r\n\t\tfor(int i = 0; i < cities.size(); i++) {\r\n\t\t\tCityByDegrees tempCity = cities.get(i);\r\n\t\t\tbuffer.append(tempCity.getDegrees()).append(\" \").append(tempCity.getCity()).append(\", \").append(tempCity.getState());\r\n\t\t\tSystem.out.println(buffer.toString());\r\n\t\t\tbuffer.setLength(0);\r\n\t\t}\r\n\t}", "public void debugPrint() {\n System.out.println(\"### Image Handler ###\");\n System.out.println(\"Handling: \" + images.size());\n }", "public static void execAndPrint() {\n\t\tArrays.parallelSetAll(Main.arrays, value -> ThreadLocalRandom.current().nextInt(1000000));\n\t\tRunnable task = null;\n\t\tStopWatch watch = new StopWatch();\n\n\t\tfor (int i = 0; i < TaskFactory.values().length; i++) {\n\t\t\ttask = TaskFactory.values()[i].getTask();\n\n\t\t\tSystem.out.println(\"Starting Task: \" + task.toString());\n\n\t\t\twatch.start();\n\t\t\ttask.run();\n\t\t\twatch.stop();\n\n\t\t\tSystem.out.printf(\"Elapsed time is %.5f sec\\n\\n\", watch.getElapsed());\n\n\t\t\twatch.reset();\n\t\t}\n\n\n\t}", "public void finish() {\n printReport();\n printGlobalOpsPerSec();\n }", "public static void main(String[] args) {\n final HostFaultInjectionExperiment exp = new HostFaultInjectionExperiment(System.currentTimeMillis());\n\n exp.setVerbose(true).run();\n exp.getBrokerList().forEach(b -> System.out.printf(\"%s - Availability %%: %.4f\\n\", b, exp.getFaultInjection().availability(b) * 100));\n\n System.out.println(\"Percentage of Brokers meeting the Availability Metric in SLA: \" + exp.getPercentageOfAvailabilityMeetingSla() * 100);\n System.out.println(\"# Ratio VMS per HOST: \" + exp.getRatioVmsPerHost());\n System.out.println(\"\\n# Number of Host faults: \" + exp.getFaultInjection().getNumberOfHostFaults());\n System.out.println(\"# Number of VM faults (VMs destroyed): \" + exp.getFaultInjection().getNumberOfFaults());\n System.out.printf(\"# VMs MTBF average: %.2f minutes\\n\", exp.getFaultInjection().meanTimeBetweenVmFaultsInMinutes());\n System.out.printf(\"# Time the simulations finished: %.2f minutes\\n\", exp.getCloudSim().clockInMinutes());\n System.out.printf(\"# Hosts MTBF: %.2f minutes\\n\", exp.getFaultInjection().meanTimeBetweenHostFaultsInMinutes());\n System.out.printf(\"\\n# If the hosts are showing in the result equal to 0, it was because the vms ended before the failure was set.\\n\\n\");\n }", "private void print() {\r\n // Print number of survivors and zombies\r\n System.out.println(\"We have \" + survivors.length + \" survivors trying to make it to safety (\" + childNum\r\n + \" children, \" + teacherNum + \" teachers, \" + soldierNum + \" soldiers)\");\r\n System.out.println(\"But there are \" + zombies.length + \" zombies waiting for them (\" + cInfectedNum\r\n + \" common infected, \" + tankNum + \" tanks)\");\r\n }", "public void showCatalogue() {\n for (Record r : cataloue) {\n System.out.println(r);\n }\n }", "private void summarize() {\n System.out.println();\n System.out.println(totalErrors + \" errors found in \" +\n totalTests + \" tests.\");\n }", "private void summarize() {\n System.out.println();\n System.out.println(totalErrors + \" errors found in \" +\n totalTests + \" tests.\");\n }", "public void printGS(){\r\n\t\tLogger.append(\" ITANet locations:\t\");\r\n\t\tfor (int i = 0; i < this.locVec.length; i++)\r\n\t\t\tLogger.append(this.locVec[i] + \" \");\r\n\t\tLogger.append(\"\\r\\n\");\r\n\r\n\t\tLogger.append(\" Interruption vector:\t\");\r\n\t\tfor(int i = 0; i < this.interVec.length; i++){\r\n\t\t\tif(this.interVec[i] == true)\r\n\t\t\t\tLogger.append(\"true \");\r\n\t\t\telse\r\n\t\t\t\tLogger.append(\"false \");\r\n\t\t}\r\n\t\tLogger.append(\"\\r\\n\");\r\n\r\n\t\tLogger.append(\" CPUStack:\t\");\r\n\t\tthis.stack.printAllEle();\r\n\t\tLogger.append(\"\\r\\n\");\r\n\r\n\t\tLogger.append(\" Control variable:\t\");\r\n\t\tthis.cvMap.printAllEle();\r\n\t\tLogger.append(\"\\r\\n\");\r\n\t\t\r\n\t\tLogger.append(\" IRQSwitch: \");\r\n\t\tthis.switches.print();\r\n\t\tLogger.append(\"\\r\\n\");\r\n\t}", "public void printAll()\n {\n r.showAll();\n }", "public void print() {\n\t\tSystem.out.println(\"针式打印机打印了\");\n\t\t\n\t}", "public boolean printExecutionTime(){\r\n return false;\r\n }", "public void print() {\r\n\t\tSystem.out.print(\"|\");\r\n\t\t//loop executes until all elements of the list are printed\r\n\t\tfor (int i=0;i<capacity;i++) {\r\n\t\t\tSystem.out.print(list[i]+\" |\");\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public static void print() {\r\n System.out.println();\r\n }", "public void printClientList() {\n uiService.underDevelopment();\n }", "public void printAll(){\n\t\tSystem.out.println(\"Single hits: \" + sin);\n\t\tSystem.out.println(\"Double hits: \" + doub);\n\t\tSystem.out.println(\"Triple hits: \" + trip);\n\t\tSystem.out.println(\"Homerun: \" + home);\n\t\tSystem.out.println(\"Times at bat: \" + atbat);\n\t\tSystem.out.println(\"Total hits: \" + hits);\n\t\tSystem.out.println(\"Baseball average: \" + average);\n\t}", "public void printVirtualMachines() throws InvalidProperty, RuntimeFault, RemoteException{\r\n\t\tManagedEntity[] mes = new\r\n\t\t\t\tInventoryNavigator(_instance.getRootFolder()).searchManagedEntities(\"VirtualMachine\");\r\n\t\tfor (int i = 0; i < mes.length; i++) {\r\n\t\t\tVirtualMachine currVm = (VirtualMachine)mes[i];\r\n\t\t\tSystem.out.printf(\"vm[%d]: Name = %s\\n\", i, currVm.getName());\r\n\t\t}\r\n\t}", "public void printAllStages() {\n printIndex();\n printRemoval();\n }", "private static void showClock(MicroBlazeProcessor mb) {\r\n Clock clock = mb.getClock();\r\n //System.out.println(\"Number o clock cycles:\"+clock.getLatency());\r\n console.print(\"Number o clock cycles:\"+clock.getLatency());\r\n }", "public static void main(String[] args) {\n double SumOfTimes = 0;\n for(int j=0; j<100; j++) {\n\n TimeCounter timer = new TimeCounter();\n timer.StartToCount();\n\n for (int i = 1; i <= 100000; i++) {\n if (i % 3 == 0) {\n System.out.print(\"fizz \");\n }\n if (i % 5 == 0) {\n System.out.print(\"buzz\");\n }\n if (i % 3 != 0 && i % 5 != 0) {\n System.out.print(i);\n }\n System.out.println();\n }\n\n timer.FinishToCount();\n SumOfTimes+=timer.GetCountedTime();\n\n }\n System.out.println(\"Average time = \"+SumOfTimes/100); // Average time = 0.318....... (in my processor)\n }", "public synchronized void PrintDisplayList()\t{\n\t\tSystem.out.print(\"\\n\\tCar Model:\"+getModel()+\"\\n\\tBase Price is:\"\n +getBasePrice());\n\t\tfor(OptionSet Temp: opset)\n System.out.print(Temp.DisplayOptionSet());\n }", "public static void printVMinfo(VirtualMachine vm) throws IOException, InterruptedException{\n\t\t\t\n\t\t\t\tvm.getResourcePool();\n\t\t\t\tSystem.out.println(\"Hello \" + vm.getName());\n\t\t\t\tSystem.out.println(\"Status \" + vm.getGuestHeartbeatStatus());\n\t\t\t\tSystem.out.println(\"get ip \"+ vm.getSummary().getGuest().getIpAddress());\n\t\t\t\tSystem.out.println(\"get id \"+ vm.getSummary().getGuest().getGuestId());\n\t\t\t\tSystem.out.println(\"get toolstatus \"+ vm.getSummary().getGuest().toolsRunningStatus);\n\t\t\t\tSystem.out.println(\"get hostname \"+ vm.getSummary().getGuest().getHostName());\n\t\t\t\tSystem.out.println(\"GuestOS: \" + vm.getConfig().getGuestFullName());\n\t\t\t\tSystem.out.println(\"vm version: \" + vm.getConfig().version);\n\t\t\t\tSystem.out.println(\"meomery: \" + vm.getConfig().getHardware().memoryMB + \"MB\");\n\t\t\t\t//System.out.println(\"meomery overhead: \" + vm.getConfig().memoryAllocation.reservation.toString() + \"MB\");\n\t\t\t\tSystem.out.println(\"cpu: \" + vm.getConfig().getHardware().numCPU);\n\t\t\t\tSystem.out.println(\"Multiple snapshot supported: \" + vm.getCapability().isMultipleSnapshotsSupported());\n\t\t\t\tSystem.out.println(\"====================================================================\");\n\t\t\t}", "private void printReport() {\n\t\t\tSystem.out.println(\"Processed \" + this.countItems + \" items:\");\n\t\t\tSystem.out.println(\" * Labels: \" + this.countLabels);\n\t\t\tSystem.out.println(\" * Descriptions: \" + this.countDescriptions);\n\t\t\tSystem.out.println(\" * Aliases: \" + this.countAliases);\n\t\t\tSystem.out.println(\" * Statements: \" + this.countStatements);\n\t\t\tSystem.out.println(\" * Site links: \" + this.countSiteLinks);\n\t\t}", "public void printInfo() {\n System.out.println(\"\\n\" + name + \"#\" + id);\n System.out.println(\"Wall clock time: \" + endWallClockTime + \" ms ~ \" + convertFromMillisToSec(endWallClockTime) + \" sec\");\n System.out.println(\"User time: \" + endUserTimeNano + \" ns ~ \" + convertFromNanoToSec(endUserTimeNano) + \" sec\");\n System.out.println(\"System time: \" + endSystemTimeNano + \" ns ~ \" + convertFromNanoToSec(endSystemTimeNano) + \" sec\");\n System.out.println(\"CPU time: \" + (endUserTimeNano + endSystemTimeNano) + \" ns ~ \" + convertFromNanoToSec(endUserTimeNano + endSystemTimeNano) + \" sec\\n\");\n }", "public void print()\n {\n StringBuffer buffer = new StringBuffer();\n for (int i = 0; i < memorySize; i++)\n {\n buffer.append(mainMemory[i]);\n }\n System.out.println(buffer.toString());\n }", "void dumpStats() {\n long wallTimeNanos = totalStopwatch.elapsed(TimeUnit.NANOSECONDS);\n long dbtime = 0;\n for (String name : methodCalls.keySet()) {\n long calls = methodCalls.get(name);\n long time = methodTotalTime.get(name);\n dbtime += time;\n long average = time / calls;\n double proportion = (time + 0.0) / (wallTimeNanos + 0.0);\n log.info(name + \" c:\" + calls + \" r:\" + time + \" a:\" + average + \" p:\" + String.format(\"%.2f\", proportion));\n }\n double dbproportion = (dbtime + 0.0) / (wallTimeNanos + 0.0);\n double hitrate = (hit + 0.0) / (hit + miss + 0.0);\n log.info(\"Cache size:\" + utxoCache.size() + \" hit:\" + hit + \" miss:\" + miss + \" rate:\"\n + String.format(\"%.2f\", hitrate));\n bloom.printStat();\n log.info(\"hasTxOut call:\" + hasCall + \" True:\" + hasTrue + \" False:\" + hasFalse);\n log.info(\"Wall:\" + totalStopwatch + \" percent:\" + String.format(\"%.2f\", dbproportion));\n String stats = db.getProperty(\"leveldb.stats\");\n System.out.println(stats);\n\n }", "private void showExecutionStart() {\n log.info(\"##############################################################\");\n log.info(\"Creating a new web application with the following parameters: \");\n log.info(\"##############################################################\");\n log.info(\"Name: \" + data.getApplicationName());\n log.info(\"Package: \" + data.getPackageName());\n log.info(\"Database Choice: \" + data.getDatabaseChoice());\n log.info(\"Database Name: \" + data.getDatabaseName());\n log.info(\"Persistence Module: \" + data.getPersistenceChoice());\n log.info(\"Web Module: \" + data.getWebChoice());\n }", "public static void printRuntimeTable(functionRuntimes fRT)\r\n {\r\n\r\n }", "public void printStatistics() {\n\t// Skriv statistiken samlad så här långt\n stats.print();\n }", "public static void main(String[] args) {\n System.out.println(System.nanoTime());\n }", "private static void Display()\n\t{\n\t\tStringBuilder memoryValues = new StringBuilder();\n\t\tSystem.out.println(\"\\nPipleline Stages: \");\n\t\tif (stages.get(\"F\") != null)\n\t\t\tSystem.out.println(\"--------Fetch-----------> \" + stages.get(\"F\").getContent());\n\t\tif (stages.get(\"D\") != null)\n\t\t\tSystem.out.println(\"--------Decode----------> \" + stages.get(\"D\").getContent());\n\t\tif (stages.get(\"E\") != null)\n\t\t\tSystem.out.println(\"--------Execution1------> \" + stages.get(\"E\").getContent());\n\t\tif (stages.get(\"E2\") != null)\n\t\t\tSystem.out.println(\"--------Execution2------> \" + stages.get(\"E2\").getContent());\n\t\tif (stages.get(\"B1\") != null)\n\t\t\tSystem.out.println(\"--------Branch----------> \" + stages.get(\"B1\").getContent());\n\t\tif (stages.get(\"Dly\") != null)\n\t\t\tSystem.out.println(\"--------Delay-----------> \" + stages.get(\"Dly\").getContent());\n\t\tif (stages.get(\"M\") != null)\n\t\t\tSystem.out.println(\"--------Memory----------> \" + stages.get(\"M\").getContent());\n\t\tif (stages.get(\"W\") != null)\n\t\t\tSystem.out.println(\"--------Writeback-------> \" + stages.get(\"W\").getContent());\n\n\t\tSystem.out.println(\"\\nRegister File Details: \\n\");\n\t\tfor (Entry<String, Integer> register : registerFile.entrySet())\n\t\t{\n\t\t\tSystem.out.print(register.getKey() + \" : \" + register.getValue() + \"|\\t|\");\n\t\t}\n\t\tSystem.out.println(\"Special Register X:\" + specialRegister);\n\t\tSystem.out.println(\"\\n0 to 99 Memory Address Details: \");\n\t\tfor (int i = 0; i < 100; i++)\n\t\t{\n\t\t\tmemoryValues.append(\" [\" + i + \" - \" + memoryBlocks[i] + \"] \");\n\t\t\tif (i > 0 && i % 10 == 0)\n\t\t\t\tmemoryValues.append(\"\\n\");\n\t\t}\n\t\tSystem.out.println(memoryValues);\n\n\t}", "private static void printUsage()\n {\n HelpFormatter hf = new HelpFormatter();\n String header = String.format(\n \"%nAvailable commands: ring, cluster, info, cleanup, compact, cfstats, snapshot [name], clearsnapshot, bootstrap\");\n String usage = String.format(\"java %s -host <arg> <command>%n\", NodeProbe.class.getName());\n hf.printHelp(usage, \"\", options, header);\n }", "private void publishResults()\r\n\t{\n\t\tif (toBeOutputBranches.size() >= guiObject.getNumberOfBranchesFilter()) {\r\n\t\t\t\r\n\t\t\t//prints the default header each block gets\r\n\t\t\tmultiThreadingObj.myPublish(mainHeader);\r\n\t\t\t\r\n\t\t\t//prints out all of the branches (of a block) which passed the filters\r\n\t\t\tfor (Entry<String, String> branch : toBeOutputBranches.entrySet()) {\r\n\t\t\t\tString branchHeader = branch.getKey();\r\n\t\t\t\tString formattedBranch = branch.getValue();\r\n\t\t\t\tmultiThreadingObj.myPublish(branchHeader + formattedBranch);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//prints the upper state energies at the end of the block\r\n\t\t\tmultiThreadingObj.myPublish(energyVals);\r\n\t\t}\r\n\t}", "public void printList()\n {\n tasks.forEach(task -> System.out.println(task.getDetails()));\n }", "public void displayFastestJetInFleet() {\n\t\tfor (Jet jet : hangar.getCurrentJets()) {\n\n\t\t\tSystem.out.println(jet.getModelsOfJets());\n\t\t\tSystem.out.println(jet.getMachSpeed());\n\t\t}\n\t}", "private void printAllClients() {\n Set<Client> clients = ctrl.getAllClients();\n clients.stream().forEach(System.out::println);\n }" ]
[ "0.68659896", "0.6412911", "0.60707206", "0.60406214", "0.5961284", "0.595488", "0.59206575", "0.5860434", "0.581589", "0.58138037", "0.58050585", "0.5729597", "0.5694924", "0.5683936", "0.5678493", "0.5654876", "0.5617875", "0.5598696", "0.5579681", "0.55496305", "0.55364877", "0.55112743", "0.5485681", "0.54658914", "0.5460668", "0.54496557", "0.5445786", "0.5445658", "0.54404753", "0.5437217", "0.54334116", "0.54303676", "0.54294586", "0.54158604", "0.5395811", "0.53938496", "0.5384265", "0.53840584", "0.5373251", "0.53714496", "0.536432", "0.5362576", "0.5362168", "0.53335464", "0.5327652", "0.5322824", "0.53208685", "0.53057796", "0.5300158", "0.52988863", "0.5290459", "0.5274992", "0.5269872", "0.5263582", "0.52518135", "0.52470386", "0.52448106", "0.524429", "0.52423817", "0.5242162", "0.523926", "0.5232316", "0.5227506", "0.52274275", "0.5224242", "0.5224193", "0.5218876", "0.5209925", "0.51924735", "0.51924014", "0.5188204", "0.5188204", "0.51877487", "0.51808715", "0.51718104", "0.5168192", "0.5165886", "0.5161007", "0.5158322", "0.51504743", "0.51433885", "0.51354456", "0.51304466", "0.51274556", "0.51138115", "0.51100457", "0.5109629", "0.5106496", "0.5103661", "0.50985396", "0.5085962", "0.5084253", "0.50841963", "0.5083683", "0.50834477", "0.5078431", "0.5078066", "0.50750154", "0.5073054", "0.507065" ]
0.7081279
0
update view for event list view
public void updateEvent(EasyRVHolder holder, GithubEvent event) { Glide.with(GithubApp.getsInstance()).load(event.actor.avatar_url) .placeholder(R.mipmap.ic_default_avatar) .transform(new GlideRoundTransform(GithubApp.getsInstance())) .override(ScreenUtils.dpToPxInt(40), ScreenUtils.dpToPxInt(40)) .into((ImageView) holder.getView(R.id.ivAvatar)); StyledText main = new StyledText(); StyledText details = new StyledText(); String icon = EventTypeManager.valueOf(event.type.toString()) .generateIconAndFormatStyledText(this, event, main, details); if (TextUtils.isEmpty(icon)) { holder.setVisible(R.id.tvEventIcon, View.GONE); } else { TypefaceUtils.setOcticons((TextView) holder.getView(R.id.tvEventIcon)); holder.setText(R.id.tvEventIcon, icon); } ((TextView) holder.getView(R.id.tvEvent)).setText(main); if (TextUtils.isEmpty(details)) { holder.setVisible(R.id.tvEventDetails, View.GONE); } else { ((TextView) holder.getView(R.id.tvEventDetails)).setText(details); } ((TextView) holder.getView(R.id.tvEventDate)).setText(TimeUtils.getRelativeTime(event.created_at)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateListView(List<Event> list) {\n this.eventsList = list;\n notifyDataSetChanged();\n }", "public interface OwnEventsView extends BaseView {\n\n void adaptEventsList(List<EventModel> eventModelsList);\n\n void viewEvent(EventModel eventModel);\n\n void showViewRefreshing();\n\n void hideViewRefreshing();\n\n void hideViewEmpty();\n\n void showViewEmpty();\n\n}", "public void updateEventsView(ViewRender eventsRender) {\n\t\tDefaultTableModel eventsTableModel = eventsRender.getTableModel(eventsData);\n\t\teventsTable.setModel(eventsTableModel);\n\t\teventsRender.setTableFormate(eventsTable);\n\t}", "public void setEvents(View convertView) {\n imgLeft = (RemoteImageView) convertView.findViewById(R.id.img_one_left);\r\n int imgW = (Config.getInstance().getScreenWidth(context) - ContextUtil\r\n .dip2px(context, ListItemBaseNews.ThreeImg_Dip_Offset)) / 3;\r\n int imgH = (int) (imgW * ListItemBaseNews.Defult_Img_Percent);\r\n imgLeft.getLayoutParams().width = imgW;\r\n imgLeft.getLayoutParams().height = imgH;\r\n RelaRight = (RelativeLayout) convertView.findViewById(R.id.rela_left);\r\n RelaRight.getLayoutParams().width = imgW;\r\n RelaRight.getLayoutParams().height = imgH;\r\n\r\n imgPlay = (ImageView) convertView.findViewById(R.id.img_play_icon);\r\n txtTitle = (TextView) convertView.findViewById(R.id.txt_newstitle1);\r\n txtSource = (TextView) convertView.findViewById(R.id.txt_source_3line);\r\n imgMore = (ImageView) convertView.findViewById(R.id.news_more_3line);\r\n txtTime = (TextView) convertView.findViewById(R.id.txt_time_3line);\r\n txtOffline = (TextView) convertView.findViewById(R.id.txt_offline3);\r\n linAddTag = (LinearLayout) convertView\r\n .findViewById(R.id.lin_addlabel_3line);\r\n\r\n }", "public void refresh(){\n\t\tlong d = calendar.getDate();\n\t\tDate todayDate = new Date(d);\n\t\tdateText.setText(\"Events for \" + todayDate);\n\t\tArrayList<String> events = new ArrayList<String>();\n\t\t\n\t\tfor (int i =0; i < 5; i++){\n\t\t\tevents.add(\"Sample event \" + i + \" for \" + todayDate);\n\t\t}\n\t\t\n\t\tArrayAdapter<String> eventArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, events);\n\t\teventList.setAdapter(eventArrayAdapter);\n\t}", "void updateView();", "void updateView();", "private void updateViews() {\n\t\tList<Task> list = null;\n\t\tDBHelper db = new DBHelper();\n\t\ttry {\n\t\t\tlist = db.getTaskList(this, Task.COLUMN_ID, taskID);\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(\"Could not get Single Task\", \"Bam\", e);\n\t\t}\n\n\t\ttask = list.get(0);\n\n\t\tint prioPos = 0;\n\n\t\tfor (int i = 0; i < prioList.size(); i++) {\n\n\t\t\tif (prioList.get(i).getId() == task.getPriority().getId()) {\n\t\t\t\tprioPos = i;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tprioSpinner.setSelection(prioPos);\n\n\t\tint catPos = 0;\n\n\t\tfor (int i = 0; i < categoryList.size(); i++) {\n\n\t\t\tif (categoryList.get(i).getId() == task.getCategory().getId()) {\n\t\t\t\tcatPos = i;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t\tcategorySpinner.setSelection(catPos);\n\n\t\ttitle.setText(task.getTitle());\n\t\tdescription.setText(task.getDescription());\n\t\tdatePicker.updateDate(task.getAblaufJahr(), task.getAblaufMonat(),\n\t\t\t\ttask.getAblaufTag());\n\t}", "@Override\n protected void populateViewHolder(Upcoming_Events.EventViewHolder viewHolder, Event_accept model, int position) {\n }", "@Override\n public void updateListAfterEventCreated(String eventName) {\n\n Log.i(TAG, \"New event called \" + eventName);\n\n MainFragment mainFragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(MainFragment.newEventCode, eventName);\n mainFragment.setArguments(args);\n\n createTransactionAndReplaceFragment(mainFragment, getString(R.string.frg_tag_main));\n }", "@FXML\n public void OAWeekView(ActionEvent event) {\n Appointment.clearWeeklyAppointments();\n Appointment.setWeekAppointments();\n Appointments.setItems(Appointment.getWeekAppointments());\n }", "public interface EventView {\n void Arrived(List<EventModel> list);\n void NoEvents(String error);\n //void ArrivedAllEvents(List<EventModel> list);\n //void NoAllEvents(String error);\n\n}", "public void listentry(ArrayList<HashMap<String, String>> Event_list){\n\n\t\t\t\tListAdapter adapter = new SimpleAdapter(getActivity(), Event_list, R.layout.funnel_list,\n\t\t\t\t\t\tnew String[] {VALUE1,KEY1,VALUE2}, new int[] {\n\t\t\t\t R.id.funnel_list_text,R.id.funnel_list_amount,R.id.funnel_list_time});\n\t\t \n\t\t\t\t\tthis.setListAdapter(adapter);\n\t\t\t \n\t\t\t\t\n\t\t\t\n \t\tListView lv = getListView();\n\t\t\n \t\t \t\t\t\t \n\t}", "public void updateView(ClientView view);", "public void events(View v){\n }", "@Override\n public void updateView(Message msg)\n {\n \n }", "@Override\n\tprotected void refreshView() {\n\t\t\n\t}", "private void update(LinkedTaskList linkedTaskList){\n dispose();\n new View(linkedTaskList);\n }", "public void update_list_view() {\n\n Collections.sort(mA.alarms);\n\n // make array adapter to bind arraylist to listview with new custom item layout\n AlarmsAdapter aa = new AlarmsAdapter(mA, R.layout.alarm_entry, mA.alarms);\n alarm_list_view.setAdapter(aa);\n registerForContextMenu(alarm_list_view);\n aa.notifyDataSetChanged(); // to refresh items in the list\n }", "public void update()\n\t{\n\t\t//update the view's list of movies...\n\t\tthis.getRemoveButton().setEnabled((this.database.getNumberOfMovies()>0));\n\t\tthis.movieList.setListData(this.database.toList());\n\t}", "public void updateAlarmListView() {\n AlarmListViewUpdater alarmListViewUpdater = new AlarmListViewUpdater();\n alarmListViewUpdater.execute();\n\n\n }", "private void refreshListView() {\n model.updateAllFilteredLists(history.getPrevKeywords(), history.getPrevStartDate(),\n history.getPrevEndDate(), history.getPrevState(),\n history.getPrevSearches());\n }", "private void DisplayEventListView() {\n Cursor cursor = dbHelper.fetchYourEvents(belongsTo);\n\n String[] Eventcolumns = new String[]{\n DBAdapter.KEY_NOMEVENT,\n DBAdapter.KEY_DATE,\n DBAdapter.KEY_HEUREDEB,\n DBAdapter.KEY_HEUREFIN,\n };\n\n int[] boundTo2 = new int[]{\n R.id.EventName,\n R.id.EventDate,\n R.id.EventStart,\n R.id.EventEnd,\n };\n\n dataAdapter2 = new SimpleCursorAdapter(this, R.layout.event_info,\n cursor,\n Eventcolumns,\n boundTo2,\n 0);\n\n ListView eventListview = (ListView) findViewById(R.id.listView2);\n eventListview.setAdapter(dataAdapter2);\n\n eventListview.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> listView, View view,\n int position, long id) {\n //Avoir le cursor lié à la ligne qui lui correspond\n Cursor cursor = (Cursor) listView.getItemAtPosition(position);\n Toast.makeText(EventListActivity.this, \"Longer click to delete\", Toast.LENGTH_SHORT).show();\n }\n });\n\n eventListview.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {\n @Override\n public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {\n //get the cursor, positioned to corresponding row in the result set\n Cursor cursor = (Cursor) eventListview.getItemAtPosition(position);\n String EventoDelete = cursor.getString(cursor.getColumnIndexOrThrow(\"nomEvent\"));\n dbHelper.deleteEvent(EventoDelete);\n Toast.makeText(EventListActivity.this, \"Deleted \"+parent.getItemAtPosition(position).toString(), Toast.LENGTH_SHORT).show();\n DisplayEventListView();\n dataAdapter2.notifyDataSetChanged();\n return false;\n }\n });\n\n }", "public View getView(int position, View convertView, ViewGroup parent) {\n\n final ViewHolder holder;\n View itemView = convertView;\n if (itemView == null) {\n itemView = getActivity().getLayoutInflater().inflate(R.layout.item_views_list, parent, false);\n holder = new ViewHolder();\n\n holder.imageView = (ImageView) itemView.findViewById(R.id.imgview);\n holder.event_name_Text = (TextView) itemView.findViewById(R.id.evntname);\n holder.event_date = (TextView)itemView.findViewById(R.id.date);\n holder.event_category = (TextView)itemView.findViewById(R.id.category);\n holder.event_dedc_Text = (TextView) itemView.findViewById(R.id.evntdesc);\n itemView.setTag(holder);\n }else {\n\n holder = (ViewHolder)itemView.getTag();\n }\n //Find the car to work with.\n\n final Event currentevent = t_events.get(position);\n //Fill the View\n \n\n holder.imageView.setImageResource(currentevent.getImage_id());\n holder.event_date.setText(currentevent.getDate().toString());\n\n\n// holder.imageView.setImageResource(currentevent.getImage_id());\n holder.imageView.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View arg0) {\n Toast.makeText(getActivity(), \"Event of \" + currentevent.getEvent_name() + \" Clicked\", Toast.LENGTH_SHORT).show();\n\n }\n });\n //Make\n\n holder.event_name_Text.setText(currentevent.getEvent_name());\n\n\n holder.event_date.setText(currentevent.getDate());\n\n //TextView event_category = (TextView)itemView.findViewById(R.id.category);\n holder.event_category.setText(currentevent.getCategory());\n //Year\n //TextView event_dedc_Text = (TextView) itemView.findViewById(R.id.evntdesc);\n holder.event_dedc_Text.setText(currentevent.getEvent_desc());\n\n /*//Condition\n TextView conditionText = (TextView)itemView.findViewById(R.id.item_txtCondition);\n conditionText.setText(currentCar.getCondition());*/\n /*Animation animation = AnimationUtils.loadAnimation(getContext(), (position > lastPosition) ? R.anim.up_from_bottom : R.anim.down_from_top);\n itemView.startAnimation(animation);\n lastPosition = position;*/\n return itemView;\n\n //return super.getView(position, convertView, parent);\n }", "@Override\r\n\tpublic void updateView(List<Pays> models) {\n\t}", "protected void displayListView(ListView eventsList) {\n final ArrayAdapter adapter = new EventsAdapter(this, events);\n eventsList.setAdapter(adapter);\n eventsList.setVisibility(View.VISIBLE);\n }", "public EventsListAdapter(List<Event> events) {\n this.events = events;\n }", "private void refreshEvent() {\n DatabaseReference databaseEventsRef = firebaseDatabase.getReference(\"Events\");\n databaseEventsRef.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n EventsItem selected = snapshot.getValue(EventsItem.class);\n if (occaID.equals(selected.getEventID())) {\n titleView.setText(selected.getTitle());\n dateView.setText(DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.UK)\n .format(selected.getDateInfo()));\n updatedDate = selected.getDateInfo();\n timeView.setText(selected.getTimeInfo());\n locationView.setText(selected.getLocationInfo());\n descView.setText(selected.getDescription());\n break;\n }\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }", "@FXML\n private void handleChangeDatesButton(ActionEvent e) {\n updateView();\n }", "public void updateListView(){\n mAdapter = new ListViewAdapter(getActivity(),((MainActivity)getActivity()).getRockstarsList());\n mRockstarsListView.setAdapter(mAdapter);\n }", "public void handleSidePanelListClick(Event event) {\n try {\n this.executeCommand(\"list e\");\n Index index = this.listPanel.getEventIndex(event);\n if (index == null) {\n this.executeCommand(\"list all e\");\n index = this.listPanel.getEventIndex(event);\n }\n assert index != null;\n this.executeCommand(\"view \" + index.getOneBased());\n } catch (CommandException | ParseException e) {\n logger.info(\"Invalid command: list e + view index\");\n resultDisplay.setFeedbackToUser(e.getMessage());\n }\n }", "private void notifyViews(Event event) {\n // Notify the views. This must be done in the UI thread,\n // since views might have to redraw themselves\n new Handler(Looper.getMainLooper()).post\n (() -> MVC.forEachView(view -> view.onModelChanged(event)));\n }", "@Override\n\tpublic void refreshView() {\n\n\t}", "void updateViewFromModel();", "@Override\n\tprotected void RefreshView() {\n\t\t\n\t}", "@FXML\n public void OAMonthView(ActionEvent event) {\n Appointment.clearMonthlyAppointment();\n Appointment.setMonthAppointments();\n Appointments.setItems(Appointment.getMonthAppointments());\n\n }", "@Override\n public void onChanged(@Nullable List<Event> events) {\n adapter.setEvents(events);\n for (Event event:events) {\n Log.e(\"** EVENT **\", \"CATEGORY: \" +event.getCategoryId() + \", Event : \" + event.getName());\n }\n }", "public void add_events_screen(View view) {\n Calendar calendar = Calendar.getInstance();\n calendar.set(selectedYear, selectedMonth, selectedDay);\n\n Intent intent = new Intent(Intent.ACTION_EDIT);\n intent.setType(\"vnd.android.cursor.item/event\");\n intent.putExtra(CalendarContract.Events.TITLE, \"\");\n intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, calendar.getTimeInMillis());\n intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, calendar.getTimeInMillis());\n intent.putExtra(CalendarContract.Events.ALL_DAY, false);\n intent.putExtra(CalendarContract.Events.DESCRIPTION,\"\");\n startActivity(intent);\n }", "public void updateView() {\n if (mData.isEmpty()) {\n Logger.d(TAG, \"The mData is empty\");\n return;\n }\n Set<View> viewSet = mData.keySet(); // keySet() returns [] if map is\n // empty\n Iterator<View> viewIterator = viewSet.iterator();\n if (viewIterator == null) {\n Logger.d(TAG, \"The viewIterator is null\");\n return;\n }\n while (viewIterator.hasNext()) {\n View view = viewIterator.next();\n if (view == null) {\n Logger.d(TAG, \"The view is null\");\n } else {\n Object obj = mData.get(view);\n if (obj == null) {\n Logger.d(TAG, \"The value is null\");\n } else {\n if (obj instanceof ChatsStruct) {\n ChatsStruct chatStruct = (ChatsStruct) obj;\n updateChats(view, chatStruct);\n } else if (obj instanceof InvitationStruct) {\n InvitationStruct inviteStruct = (InvitationStruct) obj;\n updateInvitations(view, inviteStruct);\n } else {\n Logger.d(TAG, \"Unknown view type\");\n }\n }\n }\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_event_list, container, false);\n try {\n if(getArguments()!= null){\n //try to get data from addEventFragment\n EventListFragmentArgs args = EventListFragmentArgs.fromBundle(getArguments());\n //add the event into the model\n ModelDemo.instance.addEvent(args.getEvent());\n //refresh the adapter\n adapter.notifyDataSetChanged();\n }\n }catch (Exception e){}\n\n rv = view.findViewById(R.id.eventListFrag);\n rv.hasFixedSize();\n\n LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());\n rv.setLayoutManager(layoutManager);\n\n List<Event> data = ModelDemo.instance.getAllEvents();\n\n adapter = new EventAdapter();\n adapter.data = data;\n rv.setAdapter(adapter);\n\n adapter.setOnClickListener(new EventAdapter.OnItemClickListener() {\n @Override\n public void onItemClick(int position) {\n callback.onItemClickEvent(data.get(position));\n }\n });\n\n FloatingActionButton Fab= view.findViewById(R.id.addEventBtn);\n Fab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Navigation.findNavController(view).navigate(R.id.actionEventListFrag_To_addEventFrag);\n }\n });\n return view;\n }", "View(LinkedTaskList myList){\n myNewList = myList;\n setJList(myNewList);\n setDefaultCloseOperation(EXIT_ON_CLOSE);\n setBounds(50, 25, 1200 ,700);\n setResizable(false);\n setTitle(\"Task Manager\");\n\n\n//Buttons\n weekPlan.setBackground(Color.ORANGE);\n addTask.setBackground(Color.ORANGE);\n editTask.setBackground(Color.ORANGE);\n detailView.setBackground(Color.ORANGE);\n removeTask.setBackground(Color.ORANGE);\n calendar.setBackground(Color.ORANGE);\n update.setBackground(Color.ORANGE);\n\n weekPlan.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n new ViewWeek(myNewList);\n }\n });\n\n addTask.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n new View(1, myNewList);\n }\n });\n\n editTask.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n try {\n new ViewEdit(taskList.getSelectedIndex(), myNewList);\n } catch (Exception ex){\n JOptionPane.showMessageDialog(null, \"Task didn`t choose\");\n }\n }\n });\n\n calendar.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n SwingCalendar sc = new SwingCalendar(myNewList);\n }\n });\n\n update.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n update(myNewList);\n }\n });\n\n\n//Panel\n JPanel panel = new JPanel();\n panel.setLayout(new FlowLayout());\n panel.setBackground(Color.darkGray);\n\n panel.add(weekPlan);\n panel.add(addTask);\n panel.add(editTask);\n panel.add(detailView);\n panel.add(removeTask);\n panel.add(calendar);\n panel.add(update);\n\n\n\n removeTask.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n try {\n if (taskList.getSelectedIndex() == -1) {\n throw new IOException();\n }\n new ViewRemove(taskList.getSelectedIndex(), myNewList);\n } catch (Exception ex) {\n logger.error(\"The task for removing did not choose.\");\n JOptionPane.showMessageDialog(null, \"Task didn`t choose\");\n }\n }\n });\n\n JScrollPane scrollPane = new JScrollPane(taskList);\n scrollPane.setPreferredSize(new Dimension(700,500));\n panel.add(scrollPane);\n setContentPane(panel);\n\n detailView.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n new DetailView(myNewList);\n }\n });\n\n setVisible(true);\n }", "private void handleView(View view) throws AppiaEventException {\n \t\tSystem.out.println(\"Received a new View\");\n \n \t\t//Get the parameters\n \t\tVsGroup[] allGroups = VsClientManagement.getAllGroups();\n \n \t\t//Update the view\n \t\tvs = view.vs;\t\t\n \n \t\t//We start from scratch\n \t\tUpdateManager.cleanUpdateViews();\n \n \t\t//We seize the oportunity to put the future clients and future dead clients in the view\n \t\tfor(VsGroup group : allGroups){\n\t\t\tVsClientManagement.setFutureClientsIntoPresent(group.getGroupId());\n\t\t\tVsClientManagement.setFutureDeadsIntoPresent(group.getGroupId());\n\n \t\t\tVsClientManagement.clearFutureClients(group.getGroupId());\n \t\t\tVsClientManagement.clearFutureDead(group.getGroupId());\n \t\t}\n \n \t\t//I have received a new view, must send the other servers my views clients (and me)\n \t\tVsGroup[] allGroupsWithOnlyMyClients = VsClientManagement.getAllGroupsWithOnlyMyClients(listenAddress);\n \n \t\tUpdateProxyEvent updateProxy = new UpdateProxyEvent(allGroupsWithOnlyMyClients, myEndpt);\n \t\tsendToOtherServers(updateProxy);\n \t\tsendToMyself(updateProxy);\t\t\n \t}", "void updateItem(E itemElementView);", "@FXML\n void editEvent (Event event) {\n\n// removes the event and then creates a new one\n// (ensures Events stay sorted chronologically even if dates are changed)\n event.timeline.events.remove(event);\n addEvent();\n\n// exits the add window\n cancelEventEdit();\n\n setMessage(\"Successfully edited Event.\", false);\n }", "private void initView() {\n\t\tbtnMapMode = contentView.findViewById(R.id.venue_iv_map);\n\t\tbtnMapMode.setOnClickListener(this);\n\t\tbtnSearch = contentView.findViewById(R.id.venue_iv_search);\n\t\tbtnSearch.setOnClickListener(this);\n\t\temptyView = contentView.findViewById(R.id.event_ll_empty);\n\t\temptyView.findViewById(R.id.event_empty_other_area).setOnClickListener(\n\t\t\t\tthis);\n\t\temptyView.findViewById(R.id.event_empty_add_event).setOnClickListener(\n\t\t\t\tthis);\n\n\t\tglHotImage = (ViewPager) vHeader.findViewById(R.id.header_viewpager);\n\t\tllIndic = (LinearLayout) vHeader.findViewById(R.id.header_ll_indic);\n\t\tbtnPlace = (Button) vHeader.findViewById(R.id.header_btn_place);\n\t\tbtnVenue = (Button) vHeader.findViewById(R.id.header_btn_venue);\n//\t\tviewGroup = (ViewGroup) vHeader.findViewById(R.id.viewGroup);\n\t\tbtnPlace.setOnClickListener(this);\n\t\tbtnVenue.setOnClickListener(this);\n\n\t\tmPullRefreshListView = (PullToRefreshListView) contentView\n\t\t\t\t.findViewById(R.id.venue_lv);\n\t\tmPullRefreshListView.setMode(Mode.BOTH);\n\t\tmListView = mPullRefreshListView.getRefreshableView();\n\t\tmListView.setHeaderDividersEnabled(false);\n\t\tmPullRefreshListView.getRefreshableView().setSelector(\n\t\t\t\tnew ColorDrawable(Color.TRANSPARENT));\n\t\t// android.R.color.transparent\n\t\t// mListView.setEmptyView(emptyView);\n\t\tmPullRefreshListView.setOnItemClickListener(this);\n\t\tmListView.addHeaderView(vHeader, null, true);\n\t\tmListView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);\n\t\tmAdapter = new VenueListAdapter(getActivity(), mList);\n\t\tmPullRefreshListView.setAdapter(mAdapter);\n\t\tmPullRefreshListView.setOnRefreshListener(this);\n\t\tglHotImage.setOnPageChangeListener(new HeaderChangeListener());\n\t\tif (null != pagerAdapter) {\n\t\t\tpagerAdapter.notifyDataSetChanged();\n\t\t}\n\t}", "public void updateListViewAndCount() {\n \t\n \t//updating the currentTaskItems then getting a array of the list\n \tListView items = (ListView)findViewById(R.id.showAttachedItems);\n \t\n \tArrayList<ItemListElement> item = formatOutputForList();\n \tItemListElement[] elm = new ItemListElement[item.size()];\n \titem.toArray(elm);\n \t\n \t//updating the list view\n \tItemListAdapter adapter = \n \t new ItemListAdapter(this, R.layout.list_multi, elm);\n items.setAdapter(adapter);\n \t\n \t//update the item count\n \tEditText num = (EditText)findViewById(R.id.showCurrentItemNum);\n \tint value = currentTaskItems.size();\n \tString val = Integer.toString(value);\n \tnum.setText(val);\t\n }", "private final void updateEvent(Feed feed) {\n\t ContentValues values = new ContentValues();\n\t // values.put(NotePad.Notes.COLUMN_NAME_MODIFICATION_DATE, System.currentTimeMillis());\n\n\t // This puts the desired notes text into the map.\n\t values.put(FeedingEventsContract.Feeds.column_timeStamp, feed.ts.toString());\n\t values.put(FeedingEventsContract.Feeds.column_leftDuration, Integer.toString(feed.lDuration) );\n\t values.put(FeedingEventsContract.Feeds.column_rightDuration, Integer.toString(feed.rDuration));\n\t values.put(FeedingEventsContract.Feeds.column_bottleFeed, Double.toString(feed.BFQuantity));\n\t values.put(FeedingEventsContract.Feeds.column_expressFeed, Double.toString(feed.EFQuantity));\n\t values.put(FeedingEventsContract.Feeds.column_note, feed.note);\n\t \n\t /*\n\t * Updates the provider with the new values in the map. The ListView is updated\n\t * automatically. The provider sets this up by setting the notification URI for\n\t * query Cursor objects to the incoming URI. The content resolver is thus\n\t * automatically notified when the Cursor for the URI changes, and the UI is\n\t * updated.\n\t * Note: This is being done on the UI thread. It will block the thread until the\n\t * update completes. In a sample app, going against a simple provider based on a\n\t * local database, the block will be momentary, but in a real app you should use\n\t * android.content.AsyncQueryHandler or android.os.AsyncTask.\n\t */\n\t getContentResolver().update(\n\t mUri, // The URI for the record to update.\n\t values, // The map of column names and new values to apply to them.\n\t null, // No selection criteria are used, so no where columns are necessary.\n\t null // No where columns are used, so no where arguments are necessary.\n\t );\n\n\n\t }", "private void initView() {\n initRefreshListView(mListview);\n }", "@Override\n\tprotected void setView() {\n\t\thttp = new HttpUtils();\n\t\thttp.configTimeout(5000);\n\t\thttp.configCurrentHttpCacheExpiry(1000); // 缓存时间\n\t\tif (null == list) {\n\t\t\tlist = new ArrayList<HashMap<String, String>>();\n\t\t}\n\t\tsetContentView(R.layout.activity_searchschedule);\n\t\tModifySysTitle.ModifySysTitleStyle(R.color.title_blue,\n\t\t\t\tSearchScheduleActivity.this);\n\t\tsw_lv_searchschedule = (PullToRefreshListView) findViewById(R.id.sw_lv_searchschedule);\n\t\trel_show = (RelativeLayout) findViewById(R.id.rel_show);\n\t\ttextView_show = (TextView) findViewById(R.id.textView_show);\n\t\tsw_lv_searchschedule.getRefreshableView().setDivider(null);\n\t\tsw_lv_searchschedule.getRefreshableView().setSelector(\n\t\t\t\tandroid.R.color.transparent);\n\t\tsw_lv_searchschedule.setMode(Mode.BOTH);\n\t\tsw_lv_searchschedule\n\t\t\t\t.setOnRefreshListener(new OnRefreshListener<ListView>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onRefresh(\n\t\t\t\t\t\t\tPullToRefreshBase<ListView> refreshView) {\n\t\t\t\t\t\tString label = DateUtils.formatDateTime(\n\t\t\t\t\t\t\t\tSearchScheduleActivity.this,\n\t\t\t\t\t\t\t\tSystem.currentTimeMillis(),\n\t\t\t\t\t\t\t\tDateUtils.FORMAT_SHOW_TIME\n\t\t\t\t\t\t\t\t\t\t| DateUtils.FORMAT_SHOW_DATE\n\t\t\t\t\t\t\t\t\t\t| DateUtils.FORMAT_ABBREV_ALL);\n\t\t\t\t\t\t// Update the LastUpdatedLabel\n\t\t\t\t\t\trefreshView.getLoadingLayoutProxy()\n\t\t\t\t\t\t\t\t.setLastUpdatedLabel(label);\n\t\t\t\t\t\t// Do work to refresh the list here.\n\t\t\t\t\t\tif (sw_lv_searchschedule.isHeaderShown()) {// 显示头部UI\n\t\t\t\t\t\t\t// 添加数据 网络请求\n\t\t\t\t\t\t\tmHandler.sendEmptyMessage(10);\n\t\t\t\t\t\t} else if (sw_lv_searchschedule.isFooterShown()) {// 显示底部UI\n\t\t\t\t\t\t\t// 加载更多\n\t\t\t\t\t\t\tmHandler.sendEmptyMessage(100);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// 网络请求\n\t\t\t\t\t\t\tLogUtils.d(\"初始化网络数据\");\n\t\t\t\t\t\t\tlist_size = 0;\n\t\t\t\t\t\t\tmHandler.sendEmptyMessage(10);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t// 设置自动刷新\n\t\tsw_lv_searchschedule.setRefreshing(true);\n\n\t}", "private void updateListView() {\n fileList.getItems().setAll(files.readList());\n //System.out.println(System.currentTimeMillis() - start + \" мс\");\n }", "public void refreshListClicked(View view){\n\n mPetList = ((ListView) findViewById(R.id.pet_list_view));\n\n final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, petList);\n mPetList.setAdapter(adapter);\n }", "private void updateSessionListView() {\n FastLap[] temp = lapMap.values().toArray(new FastLap[lapMap.size()]);\n SessionAdapter adapter = new SessionAdapter(getApplicationContext(), temp);\n mSessionFragment.update(adapter);\n //Log.d(TAG, \"sessionListView UI updated...\");\n }", "@Override\n\tpublic void initView() {\n\t\tmylis_show.setTitleText(\"我的物流\");\n\t\tlistView = mylis_listview.getRefreshableView();\n\t\t\n\t}", "public void refreshListView() {\n \n \tLog.i(\"refresh list view\", \"Enter\");\n \ttry {\n \t\tif(taskListCursor != null) {\n\t \t\ttaskListCursor.close();\n\t \t\ttaskListCursor = null;\n \t\t}\n FileDbAdapter fda = new FileDbAdapter();\n fda.open();\n \t\ttaskListCursor = fda.fetchTasksForSource(getSource(), true);\n \tfda.close();\n \t} catch (Exception e) {\n \t\te.printStackTrace(); \t// TODO handle exception\n \t}\n \ttasks.changeCursor(taskListCursor);\n \tstartManagingCursor(taskListCursor);\n \ttasks.notifyDataSetChanged();\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n setHasOptionsMenu(true);\n View x = inflater.inflate(R.layout.fragment_event,null);;\n swipe = (SwipeRefreshLayout) x.findViewById(R.id.swipe_refresh_layout);\n list = (ListView) x.findViewById(R.id.list_event);\n// SearchView sv= (SearchView) x.findViewById(R.id.mSearch);\n\n eventList.clear();\n\n list.setOnItemClickListener(new AdapterView.OnItemClickListener()\n\n {\n\n @Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n // TODO Auto-generated method stub\n session = new SessionManager(getActivity());\n\n if (session.isLoggedIn()) {\n\n pref = getActivity().getSharedPreferences(\"data\", Context.MODE_PRIVATE);\n String judulss = eventList.get(position).getJudul();\n final String apikey = pref.getString(\"apikey\", \"\");\n String click = pref.getString(\"click\"+judulss, \"0\");\n\n\n if(click == \"0\" ) {\n\n ((MainActivity)getActivity()).startCountdownTimer(judulss);\n// startCountdownTimer(judulss);\n inputKlik(apikey, eventList.get(position).getId());\n\n Intent intent = new Intent(getActivity(), DetailEvent.class);\n intent.putExtra(\"event_id\", eventList.get(position).getId());\n intent.putExtra(\"event_judul\", eventList.get(position).getJudul()); //you can name the keys whatever you like\n intent.putExtra(\"event_deskripsi\", eventList.get(position).getDeskripsi()); //note that all these values have to be primitive (i.e boolean, int, double, String, etc.)\n intent.putExtra(\"event_image\", eventList.get(position).getImageUrl());\n intent.putExtra(\"event_lat\", eventList.get(position).getLat());\n intent.putExtra(\"event_lng\", eventList.get(position).getLng());\n intent.putExtra(\"event_email\", eventList.get(position).getEmail());\n intent.putExtra(\"event_phone\", eventList.get(position).getPhone());\n intent.putExtra(\"event_alamat\", eventList.get(position).getAlamat());\n intent.putExtra(\"event_web\", eventList.get(position).getWeb());\n intent.putExtra(\"event_youtube\", eventList.get(position).getYoutube());\n intent.putExtra(\"event_instagram\", eventList.get(position).getInstagram());\n intent.putExtra(\"event_fb\", eventList.get(position).getFb());\n intent.putExtra(\"event_faq\", eventList.get(position).getFaq());\n intent.putExtra(\"event_kategori\", eventList.get(position).getKategori_acara());\n intent.putExtra(\"event_twitter\", eventList.get(position).getTwitter());\n intent.putExtra(\"event_lokasi\", eventList.get(position).getLokasi());\n intent.putExtra(\"event_startdate\", eventList.get(position).getStart_date());\n intent.putExtra(\"event_enddate\", eventList.get(position).getEnd_date());\n intent.putExtra(\"event_slug\", eventList.get(position).getSlug());\n\n startActivity(intent);\n }else if(click == \"1\"){\n Intent intent = new Intent(getActivity(), DetailEvent.class);\n intent.putExtra(\"event_id\", eventList.get(position).getId());\n intent.putExtra(\"event_judul\", eventList.get(position).getJudul()); //you can name the keys whatever you like\n intent.putExtra(\"event_deskripsi\", eventList.get(position).getDeskripsi()); //note that all these values have to be primitive (i.e boolean, int, double, String, etc.)\n intent.putExtra(\"event_image\", eventList.get(position).getImageUrl());\n intent.putExtra(\"event_lat\", eventList.get(position).getLat());\n intent.putExtra(\"event_lng\", eventList.get(position).getLng());\n intent.putExtra(\"event_email\", eventList.get(position).getEmail());\n intent.putExtra(\"event_phone\", eventList.get(position).getPhone());\n intent.putExtra(\"event_alamat\", eventList.get(position).getAlamat());\n intent.putExtra(\"event_web\", eventList.get(position).getWeb());\n intent.putExtra(\"event_youtube\", eventList.get(position).getYoutube());\n intent.putExtra(\"event_instagram\", eventList.get(position).getInstagram());\n intent.putExtra(\"event_fb\", eventList.get(position).getFb());\n intent.putExtra(\"event_faq\", eventList.get(position).getFaq());\n intent.putExtra(\"event_kategori\", eventList.get(position).getKategori_acara());\n intent.putExtra(\"event_twitter\", eventList.get(position).getTwitter());\n intent.putExtra(\"event_lokasi\", eventList.get(position).getLokasi());\n intent.putExtra(\"event_startdate\", eventList.get(position).getStart_date());\n intent.putExtra(\"event_enddate\", eventList.get(position).getEnd_date());\n intent.putExtra(\"event_slug\", eventList.get(position).getSlug());\n\n startActivity(intent);\n }else {\n Intent intent = new Intent(getActivity(), DetailEvent.class);\n intent.putExtra(\"event_id\", eventList.get(position).getId());\n intent.putExtra(\"event_judul\", eventList.get(position).getJudul()); //you can name the keys whatever you like\n intent.putExtra(\"event_deskripsi\", eventList.get(position).getDeskripsi()); //note that all these values have to be primitive (i.e boolean, int, double, String, etc.)\n intent.putExtra(\"event_image\", eventList.get(position).getImageUrl());\n intent.putExtra(\"event_lat\", eventList.get(position).getLat());\n intent.putExtra(\"event_lng\", eventList.get(position).getLng());\n intent.putExtra(\"event_email\", eventList.get(position).getEmail());\n intent.putExtra(\"event_phone\", eventList.get(position).getPhone());\n intent.putExtra(\"event_alamat\", eventList.get(position).getAlamat());\n intent.putExtra(\"event_web\", eventList.get(position).getWeb());\n intent.putExtra(\"event_youtube\", eventList.get(position).getYoutube());\n intent.putExtra(\"event_instagram\", eventList.get(position).getInstagram());\n intent.putExtra(\"event_fb\", eventList.get(position).getFb());\n intent.putExtra(\"event_faq\", eventList.get(position).getFaq());\n intent.putExtra(\"event_kategori\", eventList.get(position).getKategori_acara());\n intent.putExtra(\"event_twitter\", eventList.get(position).getTwitter());\n intent.putExtra(\"event_lokasi\", eventList.get(position).getLokasi());\n intent.putExtra(\"event_startdate\", eventList.get(position).getStart_date());\n intent.putExtra(\"event_enddate\", eventList.get(position).getEnd_date());\n intent.putExtra(\"event_slug\", eventList.get(position).getSlug());\n\n startActivity(intent);\n }\n }\n else{\n Intent intent = new Intent(getActivity(), DetailEvent.class);\n intent.putExtra(\"event_id\", eventList.get(position).getId());\n intent.putExtra(\"event_judul\", eventList.get(position).getJudul()); //you can name the keys whatever you like\n intent.putExtra(\"event_deskripsi\", eventList.get(position).getDeskripsi()); //note that all these values have to be primitive (i.e boolean, int, double, String, etc.)\n intent.putExtra(\"event_image\", eventList.get(position).getImageUrl());\n intent.putExtra(\"event_lat\", eventList.get(position).getLat());\n intent.putExtra(\"event_lng\", eventList.get(position).getLng());\n intent.putExtra(\"event_email\", eventList.get(position).getEmail());\n intent.putExtra(\"event_phone\", eventList.get(position).getPhone());\n intent.putExtra(\"event_alamat\", eventList.get(position).getAlamat());\n intent.putExtra(\"event_web\", eventList.get(position).getWeb());\n intent.putExtra(\"event_youtube\", eventList.get(position).getYoutube());\n intent.putExtra(\"event_instagram\", eventList.get(position).getInstagram());\n intent.putExtra(\"event_fb\", eventList.get(position).getFb());\n intent.putExtra(\"event_faq\", eventList.get(position).getFaq());\n intent.putExtra(\"event_kategori\", eventList.get(position).getKategori_acara());\n intent.putExtra(\"event_twitter\", eventList.get(position).getTwitter());\n intent.putExtra(\"event_lokasi\", eventList.get(position).getLokasi());\n intent.putExtra(\"event_startdate\", eventList.get(position).getStart_date());\n intent.putExtra(\"event_enddate\", eventList.get(position).getEnd_date());\n intent.putExtra(\"event_slug\", eventList.get(position).getSlug());\n\n startActivity(intent);\n }\n }\n }\n\n );\n adapter = new EventAdapter(getActivity(), eventList\n );\n\n list.setAdapter(adapter);\n\n\n\n//\n\n swipe.setOnRefreshListener(this);\n\n swipe.post(new\n\n Runnable() {\n @Override\n public void run() {\n swipe.setRefreshing(true);\n// eventList.clear();\n adapter.notifyDataSetChanged();\n callEvent(0);\n }\n }\n\n );\n\n list.setOnScrollListener(new AbsListView.OnScrollListener()\n\n {\n\n private int currentVisibleItemCount;\n private int currentScrollState;\n private int currentFirstVisibleItem;\n private int totalItem;\n\n @Override\n public void onScrollStateChanged(AbsListView view, int scrollState) {\n this.currentScrollState = scrollState;\n this.isScrollCompleted();\n }\n\n @Override\n public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,\n int totalItemCount) {\n this.currentFirstVisibleItem = firstVisibleItem;\n this.currentVisibleItemCount = visibleItemCount;\n this.totalItem = totalItemCount;\n }\n\n private void isScrollCompleted() {\n if (totalItem - currentFirstVisibleItem == currentVisibleItemCount\n && this.currentScrollState == SCROLL_STATE_IDLE) {\n\n// swipe.setRefreshing(true);\n handler = new Handler();\n\n runnable = new Runnable() {\n public void run() {\n callEvent(offSet);\n }\n };\n\n handler.postDelayed(runnable, 3000);\n }\n }\n\n });\n// FloatingActionButton fab = (FloatingActionButton) x.findViewById(R.id.fab);\n// fab.setOnClickListener(new View.OnClickListener() {\n// @Override\n// public void onClick(View view) {\n// alertSingleChoiceItems();\n//// Snackbar.make(view, \"Replace with your own action in eventfrag\", Snackbar.LENGTH_LONG)\n//// .setAction(\"Action\", null).show();\n// }\n// });\n\n\n// sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n// @Override\n// public boolean onQueryTextSubmit(String query) {\n// return false;\n// }\n//\n// @Override\n// public boolean onQueryTextChange(String query) {\n// adapter.getFilter().filter(query);\n// return false;\n// }\n// });\n\n return x;\n }", "void onEditItem(E itemElementView);", "private void updateListViewLogWindow()\n {\n listViewMessageItems.clear();\n\n for(int i =0;i<= printResult.size() - 1;i++)\n {\n listViewMessageItems.add(printResult.get(i));\n }\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.fragment_saved_items, container, false);\n\n\n db= FirebaseFirestore.getInstance();\n SavedEventsListAdapter savedEventsListAdapter = new SavedEventsListAdapter(getActivity(),events);\n listView = view.findViewById(R.id.saved_items_list_view);\n listView.setAdapter(savedEventsListAdapter);\n\n\n if (savedItems!=null){\n for (String s:savedItems) {\n db.collection(\"events\").document(s).get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\n @Override\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\n if (task.isSuccessful()){\n Event event = new Event();\n event = task.getResult().toObject(Event.class);\n events.add(event);\n savedEventsListAdapter.notifyDataSetChanged();\n }\n }\n });\n }\n }\n\n else {\n Toast.makeText(getActivity(),\"No saved Items\",Toast.LENGTH_LONG).show();\n }\n\n\n return view;\n }", "public void tableViewChanged(ObjectViewModelEvent pEvent);", "public void currentAdapter(View view) {\n\n currentGroc = buildCurrentList(currentGroc);\n adapter = new GroceryRowAdapter(mContext, currentGroc);\n lv.setAdapter(adapter);\n //This is where we can create the modal for edit delete\n setListener(lv);\n }", "private void updateExpenseListView() {\n expenseListView.getItems().clear();\n int count = 1;\n for (Expense expense : duke.expenseList.getExternalList()) {\n expenseListView.getItems().add(count + \". \" + expense.toString());\n count++;\n }\n }", "@Override\n\tprotected void enter(ViewChangeEvent event, List<URIParameter> parameters) {\n\t\tthis.presenter.fillViewWithData();\n\t}", "private void showVenuesOnListview() {\n if(venues == null || venues.isEmpty()) return;\n\n // Get the view\n View view = getView();\n venueListView = view.findViewById(R.id.venue_listView);\n\n // connecting the adapter to recyclerview\n VenueListAdapter venueListAdapter = new VenueListAdapter(getActivity(), R.layout.item_venue_list, venues);\n\n // Initialize ItemAnimator, LayoutManager and ItemDecorators\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext());\n\n int verticalSpacing = 5;\n VerticalSpaceItemDecorator itemDecorator = new VerticalSpaceItemDecorator(verticalSpacing);\n\n // Set the LayoutManager\n venueListView.setLayoutManager(layoutManager);\n\n // Set the ItemDecorators\n venueListView.addItemDecoration(itemDecorator);\n venueListView.setAdapter(venueListAdapter);\n venueListView.setHasFixedSize(true);\n }", "public UpdateRecordListener(MainView view) {\n\t\t// TODO Auto-generated constructor stub\n\t\tthis.view = view;\n\t}", "private void updateUi (){\n //get the first list item postion\n int currentPosition =listView.getFirstVisiblePosition();\n //append the new recipes to listview\n RecipeAdapter adapter = new RecipeAdapter(this , recipesList);\n listView.setAdapter(adapter);\n // Setting new scroll position to continue\n listView.setSelectionFromTop(currentPosition + 1, 0);\n }", "private void populateListView() {\n Log.d(TAG, \"populateListView: Displaying data in the ListView.\");\n\n Cursor data = mDatabaseHelper.getEventData();\n ArrayList<String> listData = new ArrayList<>();\n while(data.moveToNext()){\n listData.add(data.getString(1));\n }\n\n /* Set list adapter */\n ListAdapter adapter = new ArrayAdapter<>(this, R.layout.event_list_item, listData);\n mListView.setAdapter(adapter);\n\n /* Set onClick Listener to take user to single event and transfer ID and Name intent to new activity */\n mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n String eventName = adapterView.getItemAtPosition(i).toString();\n Log.d(TAG, \"onItemClick: You Clicked on \" + eventName);\n\n Cursor data = mDatabaseHelper.getEventID(eventName);\n int eventID = -1;\n while(data.moveToNext()){\n eventID = data.getInt(0);\n }\n if(eventID > -1){\n Log.d(TAG, \"onItemClick: The ID is: \" + eventID);\n Intent SingleEventIntent = new Intent(calendarAllEvents.this, calendarSingleEvent.class);\n SingleEventIntent.putExtra(\"eventID\",eventID);\n SingleEventIntent.putExtra(\"eventName\",eventName);\n startActivity(SingleEventIntent);\n }\n else{\n toastMessage(getResources().getString(R.string.noID));\n }\n }\n });\n }", "private void setupOpenHoursListView() {\n }", "@FXML \r\n\t public void ReadOnAction(Event e) {\r\n\t \tViewManager.getInstance().switchViews(\"/View/BookListView.fxml\", e, new BookListController());\r\n\t }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View root = inflater.inflate(R.layout.fragment_event_details_view, container, false);\n this.ctx = root.getContext();\n this.tvDate = (TextView) root.findViewById(R.id.tv_date);\n this.tvTitle = (TextView) root.findViewById(R.id.tv_title);\n this.tvCreator = (TextView) root.findViewById(R.id.tv_creator);\n this.tvDescription = (TextView) root.findViewById(R.id.tv_description);\n this.tvStartTime = (TextView) root.findViewById(R.id.tv_start_time);\n this.tvEndTime = (TextView) root.findViewById(R.id.tv_end_time);\n this.btnAlarm = (Button) root.findViewById(R.id.btn_alarm);\n this.btnJoinEvent = (Button)root.findViewById(R.id.btn_join_event);\n this.lvParticipants = (ListView) root.findViewById(R.id.lv_participants);\n this.adapter = new ArrayAdapter<String>(this.getContext(),android.R.layout.simple_list_item_1,new ArrayList<String>());\n lvParticipants.setAdapter(this.adapter);\n\n this.btnAlarm.setOnClickListener(this);\n this.btnJoinEvent.setOnClickListener(this);\n this.presenter.start();\n\n return root;\n }", "private void setupListView() {\n viewModel.getPeriodString().observe(this, (string) -> {\n if(string != null) {\n TextView periodTextView = findViewById(R.id.tvTimeFrame);\n periodTextView.setText(string);\n }\n });\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n int size = prefs.getInt(\"hourSize\", getResources().getInteger(R.integer.hourSizeDefault));\n viewModel.getAppointments().observe(this, (appointments) -> {\n if(appointments != null) {\n for(int day = 0; day < appointments.size(); day++) {\n AppointmentAdapter adapter = new AppointmentAdapter(this, size, popup, viewModel);\n adapter.setList(appointments.get(day));\n listViews.get(day).setAdapter(adapter);\n }\n }\n });\n HourAdapter adapter = new HourAdapter(this, this, size);\n viewModel.getTimeSlots().observe(this, adapter::setList);\n timeSlotView.setAdapter(adapter);\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n adapter.notifyDataSetChanged();\n handler.postDelayed(this, 60*1000);\n }\n }, 60*1000);\n }", "public void updateUI(){\n\n getCurrentDate();\n List<Object> tasks = new ArrayList<Object>(TaskManager.sharedInstance().GetTasksInProject());\n //creating a welcome message for when there are no tasks\n if(tasks.size() == 0){\n welcome.setVisibility(View.VISIBLE);\n welcome.setText(R.string.no_tasks);\n\n }else {\n welcome.setText(R.string.empty);\n welcome.setVisibility(View.GONE);\n }\n Project currentProject = ProjectManager.sharedInstance().getCurrentProject();\n List<Object> sortedTaskLists = sortTasks(tasks);\n\n if (mTaskAdapter == null) {\n mTaskAdapter = new TaskAdapter(this.getContext(), sortedTaskLists);\n myTaskListView.setAdapter(mTaskAdapter);\n } else {\n mTaskAdapter.updateData(sortedTaskLists);\n mTaskAdapter.notifyDataSetChanged();\n }\n }", "@Override\n public void updateView(Intent intent)\n {\n \n }", "ViewElementEvent createViewElementEvent();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_list, container, false);\n ButterKnife.bind(this, view);\n EventBus.getDefault().register(this);\n\n loadListEvent(data.getData().getPagination().getPage(),\n data.getData().getPagination().getLast());\n\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());\n linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);\n rvList.setLayoutManager(linearLayoutManager);\n rvList.setHasFixedSize(true);\n rvList.addOnScrollListener(new PaginationScrollListener(linearLayoutManager) {\n @Override\n protected void loadMoreItems() {\n isLoading = true;\n EventBus.getDefault().post(new Object[]{MessageEventType.HEY_PRESENTER_GET_EVENTS, currentPage+1});\n }\n\n @Override\n public boolean isLastPage() {\n return isLastPage;\n }\n\n @Override\n public boolean isLoading() {\n return isLoading;\n }\n });\n rvList.setAdapter(adapter);\n return view;\n }", "void updateModelFromView();", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View fragmentView = inflater.inflate(R.layout.fragment_events, container, false);\n\n parentActivity = (MainActivity) getActivity();\n parentActivity.setTitle(R.string.main_nav_events);\n mSwipeRefreshLayout = (SwipeRefreshLayout) fragmentView.findViewById(R.id.swiperefresh);\n\n preferences = parentActivity.getSharedPreferences(getString(R.string.app_name) + SP_EVENTS, Context.MODE_PRIVATE);\n\n listView = (ListView) fragmentView.findViewById(R.id.events_list_view);\n listView.setOnItemClickListener(this);\n\n mSwipeRefreshLayout.setOnRefreshListener(\n new SwipeRefreshLayout.OnRefreshListener() {\n @Override\n public void onRefresh() {\n Log.i(TAG, \"onRefresh called from SwipeRefreshLayout\");\n\n // This method performs the actual data-refresh operation.\n // The method calls setRefreshing(false) when it's finished.\n refresh();\n }\n }\n );\n refresh();\n return fragmentView;\n }", "@Override\n\tpublic void OnUpdateNavigation( ) {\n\t\t\n\t\tCalendar calendar1 = Calendar.getInstance();\n\t\tcalendar1.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar1.set(Calendar.MINUTE, 0);\n\t\tcalendar1.set(Calendar.SECOND, 0);\n\t\tcalendar1.set(Calendar.MILLISECOND, 0);\n\t\tthis.selectedDate = calendar1.getTimeInMillis();\n\t\t\n\t\toverviewFragment = new OverviewFragment();\n\t\tBundle bundle = new Bundle();\n\t\tbundle.putLong(\"selectedDate\", this.selectedDate);\n\t\toverviewFragment.setArguments(bundle);\n\n\t\tFragmentTransaction fragmentTransaction1 = this.getSupportFragmentManager().beginTransaction();\n\t\tfragmentTransaction1.replace(R.id.content_frame,\n\t\t\t\toverviewFragment);\n\t\tfragmentTransaction1.commit();\n\t\t\n\t\toverViewNavigationListAdapter.setChoosed(0);\n\t\toverViewNavigationListAdapter.setSubTitle(turnToDate(this.selectedDate));\n\t\toverViewNavigationListAdapter.notifyDataSetChanged();\n\t\t\n\t}", "private void setList() {\n Log.i(LOG,\"+++ setList\");\n txtCount.setText(\"\" + projectTaskList.size());\n if (projectTaskList.isEmpty()) {\n return;\n }\n\n projectTaskAdapter = new ProjectTaskAdapter(projectTaskList, darkColor, getActivity(), new ProjectTaskAdapter.TaskListener() {\n @Override\n public void onTaskNameClicked(ProjectTaskDTO projTask, int position) {\n projectTask = projTask;\n mListener.onStatusUpdateRequested(projectTask,position);\n }\n\n\n });\n\n mRecyclerView.setAdapter(projectTaskAdapter);\n mRecyclerView.scrollToPosition(selectedIndex);\n\n }", "public void updateViews() {\n updateViews(null);\n }", "public void upDateListView(List<FlightInfoTemp> list) {\n adapter.setData(list);\n adapter.notifyDataSetChanged();\n }", "@Override\r\n\tpublic void enter(ViewChangeEvent event) {\n\t\t\r\n\t}", "public CarritoListAdapter(List<ItemCarrito> list, CarritoHolder.Events events){\n this.list = list;\n this.events = events;\n idEditable=new ArrayList<>();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_events, container, false);\n list = new ArrayList<>();\n activity=this.getActivity();\n activity.setTitle(\"Events\");\n FirebaseApp.initializeApp(getContext());\n //Retrieve From Database\n mDatabase = FirebaseDatabase.getInstance().getReference(\"Events\");\n\n mDatabase.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.exists()) {\n\n for (DataSnapshot dataSnapshot1 : dataSnapshot.getChildren()) {\n //routinelist routinelistobj = dataSnapshot1.getValue(routinelist.class);\n\n EventModel eventModel = dataSnapshot1.getValue(EventModel.class);\n // Toast.makeText(getContext(),eventModel.getmTitle(),Toast.LENGTH_LONG).show();\n\n //RECYCLER VIEW\n\n list.add(eventModel);\n mRecyclerView=(RecyclerView) rootView.findViewById(R.id.recyclerViewEvents);\n mRecyclerView.setHasFixedSize(true);\n mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));\n //creating recyclerview adapter\n RecyclerViewAdapterEvent adapter= new RecyclerViewAdapterEvent(getActivity(),list);\n\n //setting adapter to recyclerview\n mRecyclerView.setAdapter(adapter);\n\n\n }\n }\n }\n\n @Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }\n });\n return rootView;\n }", "private void updateOverview() {\n\t\t\n\t\t//check if anything is selected\n\t\tif (!listView.getSelectionModel().isEmpty()) {\n\t\t\tItemBox itemBox = listView.getSelectionModel().getSelectedItem();\n\n\t\t\tnameLabel.setText(itemBox.getName());\n\t\t\tamountLabel.setText(String.valueOf(itemBox.getAmount()) + \"x\");\n\t\t\tgtinLabel.setText(itemBox.getGtin());\n\t\t\tcategoriesLabel.setText(itemBox.getCategoriesText(\"long\"));\n\t\t\tattributesLabel.setText(itemBox.getAttributes());\n\t\t\tlog.info(\"Overview set to \" + itemBox.getName());\n\t\t}\t\n\t}", "public UpdateEventsTask(Context context, RecyclerView rvList, ContentResolver cr) {\n super();\n this.cr = cr;\n this.context = context;\n this.rvList = rvList;\n }", "@Override\n public void eventsChanged() {\n }", "public void updateBook(View view){\n update();\n }", "@Override\n public int getItemCount() {\n return events.size();\n }", "@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tsuper.handleMessage(msg);\n\t\t\t\tswitch (msg.what) {\n\t\t\t\tcase EventManager.EventType_VoteChange:\n\t\t\t\tcase EventManager.EventType_SurveyChange:\n\t\t\t\t\tif(mDateArray == null || mDateArray.length() == 0){\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tfor(int i = 0; i < mDateArray.length(); i++){\n\t\t\t\t\t\tJSONObject obj = mDateArray.optJSONObject(i);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif(obj.optString(\"id\").equalsIgnoreCase((String) ((Object[])msg.obj)[0])){\n\t\t\t\t\t\t\t\tobj.put(\"favoriteStatus\", \"6\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(mListViewAdapter != null){\n\t\t\t\t\t\tmListViewAdapter.notifyDataSetChanged();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "private void updateListView() {\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.textview, geofences);\n ListView list = (ListView) findViewById(R.id.listView);\n list.setAdapter(adapter);\n }", "private void refreshListView() {\n\t\t\tisEnd=false;\n\t\t\tlistView.setMode(Mode.PULL_FROM_START);\n\t\t\tjsonArray=new JSONArray();\n\t\t\tcurrentPage=0;\n\t\t\tgetSharePage(++currentPage);\n\t\t\t\n\t\t}", "private void populateViewCollections() {\n\n\t}", "void parseEventList() {\n\t\tfor (int eventsId : events.keySet()) {\n\t\t\tfinal Event event = events.get(eventsId);\n\t\t\tif (users.get(event.getUser().getName()).isActiveStatus()\n\t\t\t\t\t&& !event.isViewed()\n\t\t\t\t\t&& event.getInnerSisdate().compareTo(\n\t\t\t\t\t\t\tnew GregorianCalendar()) >= 0) {\n\t\t\t\tevent.setViewed(true);\n\t\t\t\tfinal SimpleDateFormat fm = new SimpleDateFormat(\n\t\t\t\t\t\t\"dd.MM.yyyy-HH:mm:ss\");\n\t\t\t\tt.schedule(new TimerTask() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tif (event.isActive()) {\n\t\t\t\t\t\t\tgenerateEventMessage(\"User \"\n\t\t\t\t\t\t\t\t\t+ event.getUser().getName()\n\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t+ fm.format(event.getInnerSisdate()\n\t\t\t\t\t\t\t\t\t\t\t.getTime()) + \" \" + event.getText());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, event.getInnerSisdate().getTime());\n\n\t\t\t}\n\t\t}\n\n\t}", "private void setOnListView() {\n\t\tlist.setItems(obs);\n\t\tlist.setCellFactory(new Callback<ListView<User>, ListCell<User>>(){\n\n\t\t\t@Override\n\t\t\tpublic ListCell<User> call(ListView<User> p) {\n\t\t\t\t\n\t\t\t\tListCell<User> cell = new ListCell<User>() {\n\t\t\t\t\t\n\t\t\t\t\t@Override \n\t\t\t\t\tprotected void updateItem(User s, boolean bln) {\n\t\t\t\t\t\tsuper.updateItem(s, bln);\n\t\t\t\t\t\tif(s != null) {\n\t\t\t\t\t\t\tsetText(s.getUserName());\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t\tsetText(\"\");\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treturn cell;\n\t\t\t}\n\t\t});\n\t}", "private void updateListView() {\n adapter = new TableItemAdapter(this, tableItems);\n this.listView.setAdapter(adapter);\n }", "public abstract void refreshView();", "public void itemStateChanged(ItemEvent e){\n model.setSolution();\n view.update();\n\n }", "public void populateListView() {\n\n\n }", "@Override\n public void onClick(View view) {\n update(holder.getAdapterPosition());\n }", "@Override\n public void onPlayListEdited(PlayList playList) {\n }" ]
[ "0.7361302", "0.66950625", "0.66597044", "0.653114", "0.64463943", "0.6415051", "0.6415051", "0.63933504", "0.63572633", "0.62991804", "0.6296234", "0.6286773", "0.62852323", "0.62732846", "0.6271444", "0.62653893", "0.6260679", "0.62494415", "0.6248532", "0.6246283", "0.6242496", "0.6241105", "0.62234217", "0.6214042", "0.6213926", "0.62033874", "0.619819", "0.61920834", "0.6186972", "0.61461556", "0.61427826", "0.6124387", "0.6120983", "0.61172175", "0.6106673", "0.61033976", "0.60986567", "0.6087628", "0.6069801", "0.60511", "0.60340536", "0.6023073", "0.60111684", "0.6002056", "0.6000176", "0.59858304", "0.59696007", "0.5960669", "0.59564227", "0.5954018", "0.5951263", "0.59510255", "0.5946777", "0.59428763", "0.59368944", "0.5926185", "0.5916602", "0.59145933", "0.5912673", "0.5895786", "0.58834374", "0.58690655", "0.5868625", "0.58675355", "0.58635724", "0.5841404", "0.5835979", "0.5835545", "0.58349234", "0.58173496", "0.5814511", "0.5812983", "0.5809546", "0.58086985", "0.5803605", "0.57988834", "0.57979316", "0.5788238", "0.5777822", "0.5766205", "0.5759231", "0.575396", "0.5753322", "0.57527643", "0.5751712", "0.5746725", "0.57444006", "0.57429385", "0.5741736", "0.57415956", "0.57409495", "0.5734806", "0.5727994", "0.57274497", "0.57256603", "0.572516", "0.5722086", "0.5717998", "0.5715591", "0.5710118" ]
0.5920372
56
Finish the Activity off (unless was never launched anyway)
@Override protected void tearDown() throws Exception { Activity a = super.getActivity(); if (a != null) { a.finish(); setActivity(null); } // Scrub out members - protects against memory leaks in the case where someone // creates a non-static inner class (thus referencing the test case) and gives it to // someone else to hold onto scrubClass(ActivityInstrumentationTestCase2.class); super.tearDown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void tryToFinishActivity() {\n Log.i(TAG, \"[tryToFinishActivity]\");\n finish();\n }", "public void exitActivity() {\n\n finish();\n\n }", "public void finishActivity() {\r\n if (handler != null)\r\n handler.postDelayed(new Runnable() {\r\n @Override\r\n public void run() {\r\n finish();\r\n }\r\n }, 1000);\r\n\r\n }", "public void finishActivity(){\n this.finish ();\n }", "private void closeActivity() {\n final Handler handler = new Handler(Looper.getMainLooper());\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n finish();\n }\n }, 250);\n }", "public void finishSetup() {\n // Start main activity\n Intent intent = new Intent(mActivity, MainActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n mActivity.startActivity(intent);\n mActivity.finish();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tAppManager.getAppManager().finishActivity(this);\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tappManager.finishActivity(this);\n\t}", "public void FinishRemi(View view) {\n Intent intent = new Intent(this, StartRemiActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n }", "boolean isActivityFinishing();", "public static void stopFinish()\t\t//from Alert by Stop:Yes //~va56I~\r\n { //~va56I~\r\n \tif (Dump.Y) Dump.println(\"Utils stopFinish\"); //~va56I~\r\n \ttry //~va56I~\r\n { //~va56I~\r\n \tAG.aMainActivity.finish(); //~va56I~\r\n } //~va56I~\r\n catch (Exception e) //~va56I~\r\n { //~va56I~\r\n \tDump.println(e,\"stopFinish\"); //~va56I~\r\n AG.aMainActivity.finish(); //~va56I~\r\n } //~va56I~\r\n }", "private void FINISH_ACTIVITY() {\n\t\tif (pDialog != null)\r\n\t\t\tpDialog.dismiss();\r\n\t\tNMApp.getThreadPool().stopRequestAllWorkers();\r\n\t\tfinish();\r\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tMyApplication.getInstance().finishActivity(this);\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\trunActivity = 0;\r\n\t}", "void closeActivity();", "public void finishSportsActivity() {\n Log.v(TAG,\"finishSportsActivity\");\n mRTS.getAndroidLocationListener().requestGps(false, TAG);\n\n if (mStatus == ActivityUtil.SPORTS_ACTIVITY_STATUS_NO_ACTIVITY) {\n return;\n // Doesnt' make sense ot finish something that has not\n // started\n }\n mStatus = ActivityUtil.SPORTS_ACTIVITY_STATUS_NO_ACTIVITY;\n stamp();\n hideNotification();\n mRTS.getReconEventHandler()\n .writeSportsActivityEvent(ReconEventHandler\n .SPORTS_ACTIVITY_FINISH_EVENT,\n mType);\n mRTS.updatePostActivityValues();\n notifyAndSaveTempStates();\n }", "@Override\n\tpublic void finish() {\n\t\tsuper.finish();\n\t\tstop();\n\t}", "private void programShutdown(){\n\n am.finishAllActivity();\n activity .moveTaskToBack(true);\n activity .finish();\n android.os.Process.killProcess(android.os.Process.myPid());\n System.exit(0);\n\n\n }", "@Override\n\t\t\t\t public void run() {\n\t\t\t\t \tsplashActivity.get().finish();\n\t\t\t\t \tsplashActivity = null;\n\t\t\t\t }", "private void onEndGame() {\n Intent intent1 = new Intent(this, MainActivity.class);\n startActivity(intent1);\n finish();\n }", "public void finish(){\n\t\tnotfinish = false;\n\t}", "public void onFinish() {\n if (isNetworkAvailable(context)){\n Intent intent = ((Activity)context).getIntent();\n ((Activity) context).finish();\n context.startActivity(intent);\n }\n }", "public void finishActivity(View view)\n {\n finish();\n }", "public void onDestroy() {\n if (getIntent() != null && getIntent().getBooleanExtra(Constants.EXTRA_FROM_MAINACTIVITY, false)) {\n MainActivity.gotoMainActivity(this);\n }\n super.onDestroy();\n }", "@Override\n public void onPositiveClick() {\n quitThisActivity();\n }", "public void stopAct(View view){\n finish();\n }", "@Override\n public void onClick(View v) {\n finish();\n System.exit(0);\n }", "@Override\n public void onClick(View v) {\n finish();\n System.exit(0);\n }", "private void returnToPriviousActivityWithoutDevice(){\r\n \tIntent finishIntent = new Intent();\r\n finishIntent.putExtra(EXTRA_DEVICE_ADDRESS, \"finish\");\r\n setResult(Activity.RESULT_CANCELED, finishIntent);\r\n BluetoothActivity.this.finish();\r\n }", "@Override\n public void run() {\n MainActivity.this.finish();\n }", "public void end(){\r\n\t\tsetResult( true ); \r\n\t}", "public void finish() {\n\t\tsuper.finish();\n\t\tthis.overridePendingTransition(0, R.anim.acvivity_stop_anim);\n\t}", "@Override\n public void onClick(View v) {\n startActivity(finishIntent);\n }", "@JavascriptInterface\n public void finish() {\n OBLogger.e(\"CLOSRE WINDOW\");\n ((Activity) mContext).finish();\n }", "public void finish();", "protected void finish() {\n }", "private void finish() {\n }", "private void close() {\n startActivity(new Intent(BaseActivity.this, ChooserActivity.class));\n Log.d(TAG, \"Finish BaseActivity\");\n finish();\n }", "@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\t\n\t\t\t\tfinish();\n\t\t\t\t\n\t\t\t\tmApplication.exit();\n\t\t\t}", "public void onFinish(){\n Intent clicky = new Intent(AlertActivity.this,NurseActivity.class);\n startActivity(clicky);\n }", "@Override\n\t\tpublic void finish() {\n\t\t\tunregisterReceiver(mBroadcastReceiver);\n\t\t\tsuper.finish();\n\t\t}", "@Override\n\tprotected void onPause() {\n\t\tsuper.onPause();\n\t\tthis.finish();\n\t}", "protected void onExit() {\r\n\t\tnew DelayAsyncTask(this, 500).execute();\r\n\t}", "@Override\n\tpublic void finish() {\n\t\tsuper.finish();\n\t}", "public void onStop() {\n super.onStop();\n finish();\n }", "private void gotoOtherActivity() {\n finish();\n }", "public void closeActivity(boolean result) {\n\n if (result) {\n Intent returnIntent = new Intent();\n setResult(2, returnIntent);\n }\n\n PostAccomodationActivity.super.onBackPressed();\n\n }", "public void exit() {\n Intent intent = new Intent(this, MainActivity.class);\n this.startActivity(intent);\n }", "@Override\n\tprotected void onPause() {\n\t\tsuper.onPause();\n\t\tStartScreenActivity.this.finish();\n\t}", "public static void finishTempActivity(Activity activity) {\n if (activity != null && (activity instanceof TbAuthActivity)) {\n CallbackContext.activity = null;\n activity.finish();\n }\n }", "@Override\n\tpublic void finish() {\n\t\tsuper.finish();\n\t\tSystem.exit(0);\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\t// 结束Activity从堆栈中移除\r\n//\t\tActivityManagerUtil.getActivityManager().finishActivity(this);\r\n\t}", "public void finish() {}", "@Override\n\tpublic void finish()\n\t{\n\t\tsuper.finish();\n\t}", "public void run() {\n ((GameActivity)context).finish();\n }", "@Override\n\t\t public void onClick(View view) {\n\t\t \n\t\t finish();\n\t\t }", "@Override\n public void onAdClosed() {\n finish();\n }", "@Override\r\n\tpublic void finish() {\n\t\tsuper.finish();\r\n\t \r\n\t}", "@Override\n public void endActionMode() {\n if (mActionMode != null) {\n mActionMode.finish();\n }\n }", "@Override\n public void run() {\n \tfinish();\n }", "private void endCall() {\n removeLocalVideo();\n removeRemoteVideo();\n leaveChannel();\n removeCallFromDb(mUser.getUid());\n // go back to home screen after selected end call\n startActivity(new Intent(this, MainActivity.class));\n // Prevent back button back into the call\n finish();\n }", "@Override\n public void onFinish(){\n Intent intent = new Intent(getBaseContext(), CodakActivity.class);\n startActivity(intent);\n }", "public void finish() {\n\t \n\t super.onDestroy();\n\t MainActivity.nowcontext=MainActivity.context;\n\t super.finish();\n\t \n\t //关闭窗体动画显示 \n\t this.overridePendingTransition(R.anim.activity_open_right,R.anim.activity_close_right); \n\t}", "protected abstract void finish();", "@Override\n\t\t\tpublic void onCancel() {\n\t\t\t\tfinish();\n\t\t\t}", "@Override\r\n\tprotected void onPause() {\n\t\tsuper.onPause();\r\n\t\t// finish();\r\n\t}", "@Override\r\n\tprotected void onPause() {\n\t\tsuper.onPause();\r\n\t\tfinish();\r\n\t}", "@Override\r\n\tprotected void onPause() {\n\t\tif (SystemCheckTools.isApplicationSentToBackground(AppStartToMainActivity.this) == true) {\r\n\t\t\tExitApp.getInstance().exit();\r\n\t\t}\r\n\t\tsuper.onPause();\r\n\t}", "@Override\n protected void onPostExecute(Void result) {\n Intent intent = new Intent(game_play.this, user_input.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n finish();\n }", "public abstract void finish();", "@Override\n\t\t\tpublic void onClick(android.view.View v) {\n\t\t\t\tzActivity.finish();\n\t\t\t}", "@Override\n protected void onPause() {\n super.onPause();\n finish();\n }", "@Override\n protected void onPause() {\n super.onPause();\n finish();\n }", "@Override\n protected void onPause() {\n super.onPause();\n finish();\n }", "@Override\n protected void onPause() {\n super.onPause();\n finish();\n }", "@Override\n protected void onPause() {\n super.onPause();\n finish();\n }", "@Override\n protected void onPause() {\n super.onPause();\n finish();\n }", "@Override\n\tprotected void onPause() {\n\t\tsuper.onPause();\n\t\tfinish();\n\t}", "@Override\n\tprotected void onPause() {\n\t\tsuper.onPause();\n\t\tfinish();\n\t}", "@Override\n\tprotected void onPause() {\n\t\tsuper.onPause();\n\t\tfinish();\n\t}", "@Override\r\n protected void onPause() {\n super.onPause();\r\n\r\n finishAndRemoveTask();\r\n }", "public void finish(){\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tCfmpManagerAcyivity.this.finish();\n\t\t}", "protected void finishSetup() {\n Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);\n Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1);\n\n // Add a persistent setting to let other apps know the SetupWizard active state.\n // Value 0: SetupWizard finish\n // Value 1: SetupWizard active\n Settings.Global.putInt(getContentResolver(), SETUP_WIZARD_ACTIVE_STATE, 0);\n\n // remove this activity from the package manager.\n PackageManager pm = getPackageManager();\n ComponentName name = new ComponentName(this, SetupWelcomeActivity.class);\n pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,\n PackageManager.DONT_KILL_APP);\n\n ((StatusBarManager)getApplication().getSystemService(Context.STATUS_BAR_SERVICE))\n .disable(StatusBarManager.DISABLE_NONE);\n\n //set Launcher3 as the preferred home activity\n setupDefaultLauncher(pm);\n // terminate the activity.\n finish();\n }", "@Override\n protected void onDestroy() {\n android.os.Process.killProcess(android.os.Process.myPid());\n super.onDestroy();\n // this.finish();\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\n\t\t\t\tActivityCollector.finishAll();\n\t\t\t\t\n\t\t\t}", "private void EndButtonListener() {\n endButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (clickable) {\n Intent intent = createIntent();\n startActivity(intent);\n finish();\n }\n\n }\n });\n }", "@Override\n public void run() {\n\n Intent starthome = new Intent(SplashScreenActivity.this, WelcomeActivity.class);\n starthome.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(starthome);\n\n finish();\n }", "protected void onPause() {\n super.onPause();\n finish();\n }", "private void m3179g() {\n finish();\n startActivity(new Intent(this, WelcomeActivity.class));\n }", "@Override\n public void onFinish() {\n mpAudio.start();\n stopService(new Intent( getBaseContext(), MeditationService.class ) );\n }", "void finish();", "void finish();", "void finish();", "void finish();", "void finish();", "@Override\n protected void onDestroy() {\n\n activitiesLaunched.getAndDecrement();\n\n super.onDestroy();\n\n }", "@Override\n public void onClick(View view) {\n isFromResultActivity=false;\n finish();\n }", "public void finish() {\n PackageManagerActivity.super.finish();\n d a2 = d.a((Context) this);\n Iterator<String> it = this.g.iterator();\n while (it.hasNext()) {\n String next = it.next();\n a2.e(next);\n com.miui.permcenter.a.a.a(next);\n }\n }", "public void finish() {\n\n }", "@Override\n public void run() {\n thisActivity.setResult(FROM_LOADINGSCREEN_NO_ADS_FOUND);\n thisActivity.finish();\n }" ]
[ "0.8038519", "0.74261427", "0.73406506", "0.73156655", "0.7303257", "0.72095037", "0.7082912", "0.7006911", "0.6985956", "0.6981455", "0.6953694", "0.6942703", "0.69333786", "0.690403", "0.68899965", "0.68744516", "0.6856123", "0.6842417", "0.6839579", "0.68187875", "0.6758963", "0.6700144", "0.6697867", "0.66972506", "0.6683775", "0.6683589", "0.66729164", "0.66729164", "0.6672372", "0.66676927", "0.6666174", "0.66617", "0.66591966", "0.66585314", "0.6608956", "0.6589312", "0.657948", "0.6572951", "0.6561606", "0.65605485", "0.6556578", "0.6553308", "0.654539", "0.654193", "0.6530189", "0.65105367", "0.650264", "0.6498651", "0.64928776", "0.6489724", "0.64757305", "0.64715147", "0.64670503", "0.64626265", "0.64626086", "0.6454967", "0.6449198", "0.6441863", "0.6440828", "0.6439047", "0.6438418", "0.643111", "0.64272374", "0.6425191", "0.6413975", "0.6411106", "0.6394962", "0.639174", "0.6388684", "0.63842034", "0.6383722", "0.637395", "0.637395", "0.637395", "0.637395", "0.637395", "0.637395", "0.63700676", "0.63700676", "0.63700676", "0.63697827", "0.636942", "0.6368341", "0.63663864", "0.6364238", "0.63563764", "0.63547605", "0.63510925", "0.6350632", "0.63475835", "0.6340229", "0.6336884", "0.6336884", "0.6336884", "0.6336884", "0.6336884", "0.63344175", "0.6325437", "0.63239545", "0.63230956", "0.63177884" ]
0.0
-1
Get the list of all animation callbacks that have been requested and have not been canceled.
public List<AnimationCallback> getAnimationCallbacks() { return callbacks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<TweenCallback> getCallbacks()\n\t{\n\t\treturn callbacks;\n\t}", "public List<Callback> pendingCallbacks() {\n ObjectNode req = makeRequest(\"callbacks\");\n JsonNode resp = this.runtime.requestResponse(req);\n\n JsonNode callbacksResp = resp.get(\"callbacks\");\n if (callbacksResp == null || !callbacksResp.isArray()) {\n throw new JsiiError(\"Expecting a 'callbacks' key with an array in response\");\n }\n\n ArrayNode callbacksArray = (ArrayNode) callbacksResp;\n\n List<Callback> result = new ArrayList<>();\n callbacksArray.forEach(node -> {\n result.add(JsiiObjectMapper.treeToValue(node, NativeType.forClass(Callback.class)));\n });\n\n return result;\n }", "@NonNull\n protected final List<Pair<PlayerCallback, Executor>> getCallbacks() {\n List<Pair<PlayerCallback, Executor>> list = new ArrayList<>();\n synchronized (mLock) {\n list.addAll(mCallbacks);\n }\n return list;\n }", "public Map<String, Callback> getCallbacks() {\n return callbacks;\n }", "public ArrayList getCallbackListeners() {\n return statusCbL;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public entity.LoadCallback[] getCallbacks();", "List<LifecycleCallbackItem> getLifecycleCallbacks();", "public List<Frame> getAllFrames(){\n\t\treturn Collections.unmodifiableList(frames);\n\t}", "List<IKeyframe> getKeyframes();", "public FunctionInfo[] getFunctions() {\n/* 236 */ return this.functions;\n/* */ }", "protected List<FunctionPrototype> getEncounteredFunctionPrototypes() {\n return Collections.unmodifiableList(encounteredFunctionPrototypes);\n }", "public List<PluginStatsEvent> getPastEvents() {\n\t\tsynchronized (queue) {\n\t\t\tPluginStatsEvent[] info = new PluginStatsEvent[queue.size()];\n\t\t\tList<PluginStatsEvent> returnList = new ArrayList<PluginStatsEvent>();\n\t\t\tCollections.addAll(returnList, queue.toArray(info));\n\t\t\treturn returnList;\n\t\t}\n\t}", "public PhaseListener[] getPhaseListeners() {\n \n synchronized (listeners) {\n PhaseListener results[] = new PhaseListener[listeners.size()];\n return ((PhaseListener[]) listeners.toArray(results));\n }\n \n }", "public IInifileChangeListener[] getListeners() {\n // make a copy, just in case there are adds/removes during iteration\n // Maybe a copy on/write implementation would be more efficient\n IInifileChangeListener[] newArray = new IInifileChangeListener[array.length];\n System.arraycopy(array, 0, newArray, 0, array.length);\n return newArray;\n }", "public java.util.ArrayList<android.animation.Animator> getChildAnimations() { throw new RuntimeException(\"Stub!\"); }", "public void clearCallbacks() {\n callbacks.clear();\n }", "@Override\n public List<Function> getFunctions() {\n if (!isLoaded()) {\n throw new IllegalStateException(\"Error: The module is not loaded\");\n }\n\n return new ArrayList<Function>(m_functions);\n }", "private Callback[] getCallbacks()\n throws LoginException\n {\n if ( callbackHandler == null ) {\n throwLoginException( \"No CallbackHandler Specified\" );\n }\n\n Callback[] callbacks;\n if ( isIdentityAssertion ) {\n callbacks = new Callback[1];\n } else {\n callbacks = new Callback[2];\n callbacks[1] = new PasswordCallback( \"password: \", false );\n }\n callbacks[0] = new NameCallback( \"username: \" );\n\n try {\n callbackHandler.handle( callbacks );\n } catch ( IOException e ) {\n throw new LoginException( e.toString() );\n } catch ( UnsupportedCallbackException e ) {\n throwLoginException( e.toString() + \" \" + e.getCallback().toString() );\n }\n\n return callbacks;\n }", "public List<Function> getFunctions(){\n\t\t\n\t\treturn null;\n\t}", "public String[] getNames() {\n\t\tString[] names = new String[functions.size()];\n\t\tint index = 0;\n\t\tfor (Enumeration en = functions.keys(); en.hasMoreElements(); index++) {\n\t\t\tnames[index] = (String) en.nextElement();\n\t\t}\n\t\treturn names;\n\t}", "public GazListener[] getGazListeners() {\n return this.listeners.getListeners(GazListener.class);\n }", "public Iterator<Object> listeners() {\n return Arrays.asList(fListeners).iterator();\n }", "default Animator getInAnimation() {\n return null;\n }", "public List<ObserverAsync<Capteur>> getListObserver() {\n\t\tList<ObserverAsync<Capteur>> ret = new ArrayList<ObserverAsync<Capteur>>();\n\t\tIterator ite = this.listObserver.iterator();\n\t\twhile(ite.hasNext()){\n\t\t\tret.add((ObserverAsync<Capteur>) ite.next());\n\t\t}\n\t\t\n\t\treturn ret;\n\t}", "protected abstract Animator[] getAnimators(View itemView);", "protected abstract String[] getFrameNames();", "public interface AnimationCallBack {\n void StartAnimation();\n void EndAnimation();\n}", "public final List<DepFunction> getFunctions() {\n\t\treturn new LinkedList<>(this.functionMap.values());\n\t}", "public synchronized WindowListener[] getWindowListeners() {\n return (WindowListener[]) AWTEventMulticaster.getListeners(\n (EventListener)windowListener,\n WindowListener.class);\n }", "public Iterable<L> getListeners() {\r\n if (weakHandler || listeners.size() == 0) return weak.keySet();\r\n if (weak.size() == 0) return listeners.keySet();\r\n LinkedList<L> ll = new LinkedList<L>(listeners.keySet());\r\n ll.addAll(weak.keySet());\r\n return ll;\r\n }", "public List<String> getMessages() {\n logger.info(Thread.currentThread().getStackTrace()[1].getMethodName());\n logger.debug(\"Getting All Messages -> \"+messages);\n return messages;\n }", "public PhaseHandler[] getAllHandlers() {\r\n return this.delegate.getAllHandlers();\r\n }", "public Object[] getListenersArray() {\r\n Object[] list = null;\r\n synchronized (listeners) {\r\n Object[] list1 = weakHandler ? null : listeners.keySet().toArray();\r\n Object[] list2 = weak.keySet().toArray();\r\n if (list1 == null) list = list2;\r\n else if (list2.length == 0) list = list1;\r\n else if (list1.length == 0) list = list2;\r\n else {\r\n list = new Object[list1.length + list2.length];\r\n System.arraycopy(list1, 0, list, 0, list1.length);\r\n System.arraycopy(list2, 0, list, list1.length, list2.length);\r\n }\r\n }\r\n return list;\r\n }", "public ProgressEvent [] getReceivedEvents() {\n ProgressEvent [] answer = new ProgressEvent[this.receivedEvents.size()];\n return (ProgressEvent []) this.receivedEvents.toArray(answer);\n }", "Iterable<Callable<?>> getCommands(Class<? extends Annotation> transition);", "final Effect[] getEffects() {\n/* 3082 */ if (this.effects != null) {\n/* 3083 */ return this.effects.<Effect>toArray(new Effect[this.effects.size()]);\n/* */ }\n/* 3085 */ return emptyEffects;\n/* */ }", "IEvent[] getEvents();", "List<ContinuousQueryListener<K, ?>> getListeners();", "public Set<Position> getPositionsWithActiveEffects() {\n return activeEffects.keySet();\n }", "public List<FacesMessage> getMessages() {\n return FxJsfUtils.getMessages(null);\n }", "public int size() {\n\t\treturn callbacks.size();\n\t}", "private Callback[] getCallbacks() throws LoginException\n {\n if (callbackHandler == null) {\n throwLoginException(\"No CallbackHandler Specified\");\n }\n\n if (database == null) {\n throwLoginException(\"Database not specified\");\n }\n\n Callback[] callbacks;\n callbacks = new Callback[2]; // need one for the user name and one for the password\n\n // add in the password callback\n callbacks[1] = new PasswordCallback(\"password: \",false);\n\n // add in the user name callback\n callbacks[0] = new NameCallback(\"username: \");\n\n // Call the callback handler, who in turn, calls back to the\n // callback objects, handing them the user name and password.\n // These callback objects hold onto the user name and password.\n // The login module retrieves the user name and password from them later.\n try {\n callbackHandler.handle(callbacks);\n } catch (IOException e) {\n throw new LoginException(e.toString());\n } catch (UnsupportedCallbackException e) {\n throwLoginException(e.toString()+\" \"+e.getCallback().toString());\n }\n\n return callbacks;\n }", "public List<String> listeners();", "private void updateAnimations() {\n // Copy the animation requests to avoid concurrent modifications.\n AnimationHandleImpl[] curAnimations = new AnimationHandleImpl[animationRequests.size()];\n curAnimations = animationRequests.toArray(curAnimations);\n\n // Iterate over the animation requests.\n Duration duration = new Duration();\n for (AnimationHandleImpl requestId : curAnimations) {\n // Remove the current request.\n animationRequests.remove(requestId);\n\n // Execute the callback.\n requestId.getCallback().execute(duration.getStartMillis());\n }\n\n // Reschedule the timer if there are more animation requests.\n if (animationRequests.size() > 0) {\n /*\n * In order to achieve as close to 60fps as possible, we calculate the new\n * delay based on the execution time of this method. The delay will be\n * less than 16ms, assuming this method takes more than 1ms to complete.\n */\n timer.schedule(Math.max(MIN_FRAME_DELAY, DEFAULT_FRAME_DELAY - duration.elapsedMillis()));\n }\n }", "public ArrayList<Animator> getChildAnimations() {\n/* 106 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public Set<String> getEnteringFunctionNames() {\n Set<String> results = new HashSet<>();\n Set<CFANode> visited = new HashSet<>();\n Queue<CFANode> waitlist = new ArrayDeque<>();\n waitlist.offer(this);\n while (!waitlist.isEmpty()) {\n CFANode current = waitlist.poll();\n if (visited.add(current)) {\n if (current.getFunctionName()\n .equals(CFASingleLoopTransformation.ARTIFICIAL_PROGRAM_COUNTER_FUNCTION_NAME)) {\n waitlist.addAll(CFAUtils.allPredecessorsOf(current).toList());\n } else {\n results.add(current.getFunctionName());\n }\n }\n }\n return results;\n }", "public List<FxFacesMessage> getFxMessages() {\n return FxJsfUtils.getFxMessages();\n }", "public List<boolean[]> getValidActions()\n\t{\n\t\tList<boolean[]> validActions = new ArrayList<boolean[]>(allActions);\n\t\t//TODO remove actions that contain jump if environment.mayMarioJump() is false\n\t\treturn validActions;\n\t}", "public synchronized List<EventListener> getListeners() {\n \treturn listeners;\n }", "public SortedSet<EvDecimal> getFrames()\n\t\t{\n\t\treturn Collections.unmodifiableSortedSet((SortedSet<EvDecimal>)frameInfo.keySet());\n\t\t}", "public List<Observer> getList() {\n return list;\n }", "public Call[] getCalls();", "public static int getScriptActionEvents() {\n return threadActionEvents.size();\n }", "@Override public Iterable<JflowModel.Method> getStartMethods()\n{\n Vector<JflowModel.Method> v = new Vector<JflowModel.Method>();\n\n for (JflowMethod cm : model_master.getStartMethods()) {\n ModelMethod cs = complete_calls.get(cm);\n if (cs != null) v.add(cs);\n }\n\n return v;\n}", "public boolean[] getWhoseShowing() {\n\t\tif (showing == null) {\n\t\t\tshowing = new boolean[getList(TimeLineEvent.ACTORS).size()];\n\t\t\tArrays.fill(showing, true);\n\t\t}\n\t\treturn showing;\n\t}", "protected Animator[] getAnimators(View view) {\n return new Animator[]{ObjectAnimator.ofFloat(view, \"alpha\", 0f, 1f)};\n }", "public synchronized String[] getOutputNames() {\n String[] names = new String[buffers.length];\n\n for (int i = 0; i < buffers.length; i++) {\n names[i] = buffers[i].getName();\n if (names[i] == null) {\n throw new IllegalStateException(\"BUFFER IS BROKEN\");\n }\n }\n\n return names;\n }", "private void handleAnimations() {\n pendingLoop:\n for (Animation pending : new ArrayList<>(pendingAnimations)) {\n for (Animation a : new ArrayList<>(animations)) {\n if (a.getClass().equals(pending.getClass())) {\n continue pendingLoop;\n }\n }\n pendingAnimations.remove(pending);\n addAnimation(pending);\n }\n\n for (Animation animation : new ArrayList<>(animations)) {\n animation.doAnimation(this);\n }\n }", "public FunctionIterator getExternalFunctions();", "Iterable<T> getFunctions();", "public Fence[] getFences() {\n/* 601 */ if (this.fences != null)\n/* 602 */ return (Fence[])this.fences.values().toArray((Object[])new Fence[this.fences.size()]); \n/* 603 */ return emptyFences;\n/* */ }", "@SuppressWarnings(\"unchecked\")\n\tpublic synchronized GraphChangeListener<N, ET>[] getGraphChangeListeners()\n\t{\n\t\treturn listenerList.getListeners(GraphChangeListener.class);\n\t}", "public List<CALFunction> getFunctions() {\n List<CALFunction> result = new ArrayList<>(functionsObject.functions.values());\n Collections.sort(result, new Comparator<CALFunction>() {\n public int compare(CALFunction f1, CALFunction f2) {\n return f1.toString().compareTo(f2.toString());\n }\n });\n return result;\n }", "private synchronized static Map getListeners() {\n\t\tif (registeredListeners == null) {\n\t\t\tregisteredListeners = Collections.synchronizedMap(new HashMap());\n\t\t}\n\t\treturn registeredListeners;\n\t}", "@Override\n public void onAnimationCancel(Animator animation) {\n animation.removeAllListeners();\n }", "IHttpRequestResponse[] getHttpMessages();", "public Set<BitfinexStreamSymbol> getActiveSymbols() {\n\t\tsynchronized (lastTick) {\n\t\t\treturn lastTick.keySet();\n\t\t}\n\t}", "@Override\n\tpublic Collection<MemcachedClientStateListener> getStateListeners() {\n\t\treturn null;\n\t}", "public static Collection<FlashScope> getAllFlashScopes(HttpServletRequest req) {\n Map<Integer, FlashScope> scopes = getContainer(req, false);\n\n if (scopes == null) {\n return Collections.emptySet();\n } else {\n return scopes.values();\n }\n }", "public Set<String> getRegisteredFunctions();", "public ArrayList getTaskListeners(){\n initListener();\n return listeners;\n }", "public LocaleChangeListener[] getLocaleChangeListeners() {\n\t\t\n\t\treturn (LocaleChangeListener[])listenerList.getListeners(LocaleChangeListener.class);\n\t}", "private TreeSet<Float> getKeyTimes() {\n TreeSet<Float> ret = new TreeSet<>();\n for (XmlNode animation : library_animations.getChildren(\"animation\")) {\n if (animation.getChild(\"animation\") != null) {\n animation = animation.getChild(\"animation\");\n }\n XmlNode timeData = animation.getChild(\"source\").getChild(\"float_array\");\n String[] rawTimes = timeData.getData().trim().split(\"\\\\s+\");\n for (String rawTime : rawTimes) {\n ret.add(Float.parseFloat(rawTime));\n\n }\n }\n return ret;\n }", "private void loadAnimations() {\n if (activityWeakReference != null && activityWeakReference.get() != null) {\n hideAnimation = AnimationUtils.loadAnimation(activityWeakReference.get(), R.anim.down_to_top);\n showAnimation = AnimationUtils.loadAnimation(activityWeakReference.get(), R.anim.top_to_down);\n }\n }", "java.util.List<org.chromium.components.paint_preview.common.proto.PaintPreview.PaintPreviewFrameProto> \n getSubframesList();", "@Override\n\tpublic LifecycleListener[] findLifecycleListeners() {\n\t\treturn lifecycle.findLifecycleListeners();\n\t}", "protected abstract void onAnimStart(boolean isCancelAnim);", "Collection<EventDetector> getEventsDetectors();", "public interface\t\tUCallbackList\n{\n /**\n * Removes all the registered callbacks.\n * <p>\n\t */\n\tpublic void\t\tremoveAll();\n\n /**\n * Removes the registered callback associated with the given tag.\n * <p>\n * @param tag The tag associated with the removed callback.\n\t */\n\tpublic void\t\tremoveUCallbackListener(String\t\ttag);\n\n /**\n * Registers a callback associated with the given tag.\n * <p>\n * @param listener The registered callback.\n * @param tag The tag associated with the registered callback.\n\t */\n\tpublic void\t\taddUCallbackListener(UCallbackListener listener,\n\t\t\t\t\t\t\t\t\t\t String tag);\n\n /**\n * Returns the callback associated with the given tag.\n * <p>\n * @param tag The tag associated with the callback.\n\t * @return The callback or null.\n\t */\n\tpublic UCallbackListener\t\tgetUCallbackListener(String tag);\n\n /**\n * Calls the actionPerformed method of all the registered callbacks.\n * <p>\n\t */\n\tpublic void\t\tnotifyUCallbackListeners();\n\n /**\n * Calls the actionPerformed method of a registered callback\n\t * associated with the given event.\n * <p>\n * @param event The event associated with the registered callback.\n\t */\n\tpublic void\t\tnotifyUCallbackListener(URBIEvent event);\n}", "public List<Script> getWatchedScripts() {\n try {\n return new ArrayList<Script>(watchedScripts);\n } finally {\n }\n }", "public List <Integer> getKeyFrameTimes() { return getKeyFrameTimes(null, true); }", "public Set<ScopeEventListener> getScopeRegistrationListeners();", "public int[] getValidActions() {\n\t\treturn getValidActions(currentState);\n\t}", "@Override\n\tpublic List<Function> list() {\n\t\treturn null;\n\t}", "public Iterable<Transition> getTransitions() {\n return new TransitionsIterable();\n }", "public final native boolean getFutureEvents() /*-{\n return this.getFutureEvents();\n }-*/;", "public BufferedImage getAccumulatedEvents() {\n return getFrame();\n }", "public FunctionIterator getFunctions(boolean forward);", "public Map<Pair<ID, SpecialEffectT>, List<Image>> getAnimationsEffect() {\n return AnimationsEffect;\n }", "public abstract Event[] getInitialEvents();", "public ArrayList<Voice> getReceivedVoiceCalls() {\n\t\tArrayList<Voice> receivedVoiceCalls = new ArrayList<Voice>();\n\t\tfor (Communication communication : getCommunicationReceived())\n\t\t\tif (communication instanceof Voice) {\n\t\t\t\treceivedVoiceCalls.add((Voice) communication);\n\t\t\t}\n\t\treturn receivedVoiceCalls;\n\t}", "private static Set<WorkFrame> findActiveWorkframes(Set<WorkFrame> wfs) {\n\t\tSet<WorkFrame> activeFrames = new HashSet<WorkFrame>();\n\t\tfor (WorkFrame workFrame : wfs) {\n\t\t\tif (workFrame.getExecuted()\n\t\t\t\t\t&& workFrame.getRepeat().equals(\"false\"))\n\t\t\t\tcontinue;\n\t\t\tif (ActiveFrame.isFrameActive(b, workFrame))\n\t\t\t\tactiveFrames.add(workFrame);\n\t\t}\n\t\treturn activeFrames;\n\t}", "private void stopCallBack() {\r\n\t\tfor (RecordingEventHandler oberserver : recordingEventHandlers) {\r\n\t\t\toberserver.stopCallBack();\r\n\t\t}\r\n\t}", "java.util.List<org.mojolang.mojo.lang.FuncDecl> \n getMethodsList();", "public ONDEXListener[] getONDEXListeners() {\n return listeners.toArray(new ONDEXListener[0]);\n }", "public List<String> getIcons(){\n List<String> icons = new ArrayList<String>();\n for(Intent i : super.getOutgoingIntentsForType(IntentType.bottomNavigIntent)) {\n String icon = ((BottomNavigationIntent) i).getIconId();\n if(!icons.contains(icon)){\n icons.add(icon);\n }\n }\n\n return icons;\n }", "public ArrayList<Voice> getReceivedVoiceCalls() {\n ArrayList<Voice> receivedVoiceCalls = new ArrayList<Voice>();\n for (Communication communication : getCommunicationReceived())\n if (communication instanceof Voice) {\n receivedVoiceCalls.add((Voice) communication);\n }\n return receivedVoiceCalls;\n }", "org.globus.swift.language.Function[] getFunctionArray();", "public interface Callbacks {\n void onStateChanged();\n void onProximityNegative();\n }", "public Machinetta.RAPInterface.InputMessages.InputMessage[] getMessages() {\n Debugger.debug(3,\"Unimplemented getMessages() being called ... \");\n return null;\n }" ]
[ "0.6754207", "0.6457786", "0.6356525", "0.62166387", "0.60267305", "0.5918305", "0.5602264", "0.5528044", "0.54075956", "0.53414136", "0.53055", "0.5257517", "0.52077127", "0.5178258", "0.5170903", "0.51673406", "0.51568615", "0.5134082", "0.5127861", "0.51237404", "0.5105693", "0.50957924", "0.5071689", "0.5069313", "0.5023849", "0.50033915", "0.49999115", "0.4970433", "0.49250433", "0.49228403", "0.48962376", "0.48757237", "0.48701307", "0.48646298", "0.48616305", "0.48571157", "0.48568967", "0.48485804", "0.48450303", "0.48446295", "0.48422596", "0.4818377", "0.48161417", "0.48102173", "0.4795157", "0.47950125", "0.47935662", "0.47892046", "0.47890684", "0.4786179", "0.47856754", "0.4778815", "0.47736922", "0.4771086", "0.47683126", "0.47560725", "0.47360978", "0.47278568", "0.47137862", "0.4705968", "0.47053584", "0.47026876", "0.46937582", "0.46907943", "0.4690287", "0.46833235", "0.46827826", "0.46773696", "0.46759653", "0.4673829", "0.46588507", "0.46528974", "0.4651027", "0.46434543", "0.46355924", "0.4627711", "0.46175218", "0.46136427", "0.4612755", "0.46127132", "0.46091124", "0.4608382", "0.46052125", "0.45992336", "0.4597269", "0.45946", "0.45945007", "0.4587694", "0.4586873", "0.45860428", "0.45842192", "0.45817372", "0.4579781", "0.45772052", "0.45768717", "0.45708776", "0.45673323", "0.45560288", "0.45519993", "0.45515877" ]
0.76543576
0
updateStatus Update a status of a task.
public boolean updateStatus(TaskStatus status) { TaskAttemptID taskID = status.getTaskID(); TaskStatus oldStatus = taskStatuses.get(taskID); if (oldStatus != null) { if (oldStatus.getState() == status.getState()) { return false; } } taskStatuses.put(taskID, status); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setStatus(TaskStatus status);", "public void updateTaskStatus(CaptureTask task, String status, String description) {\n\t\t\r\n\t}", "public void setStatus(ServiceTaskStatus status) {\n\t\tthis.status = status;\n\t}", "Status updateStatus(String status) throws TwitterException;", "@Override\n\tpublic boolean updateTaskStatus(int id, String status) throws SQLException, ClassNotFoundException{\n\t\t Connection c = null;\n\t\t Statement stmt = null;\n\t\t \n\t\t Class.forName(\"org.postgresql.Driver\");\n\t\t c = DriverManager.getConnection(dataBaseLocation, dataBaseUser, dataBasePassword);\n\t\t c.setAutoCommit(false);\n\t\t \n\t\t logger.info(\"Opened database successfully (updateTaskStatus)\");\n\t\t \n\t\t stmt = c.createStatement();\n\t ResultSet rs = stmt.executeQuery( \"SELECT * FROM task WHERE id=\"+id+\";\" );\n\t rs.next();\n\t \n\t if(rs.getString(\"status\").equals(status))\n\t {\n\t \t return false;\n\t }\n\t \n\t stmt = c.createStatement();\n\t \n\t String sql = \"UPDATE task SET status='\"+status+\"' WHERE id=\"+id+\";\";\n\t \n\t stmt.executeUpdate(sql);\n\t \n\t stmt.close();\n\t c.commit();\n\t c.close();\n\t \n\t logger.info(\"Task Status changed to planned\");\n\t\t \n\t return true;\n\t}", "@Override\n public void updateStatus(Status status) {\n this.status = status;\n }", "protected void status(String status) throws InvalidKeyException {\n task.setStatus(status);\n }", "private void updateStatus(@NonNull MediaTaskStatus newStatus) {\n if (mStatus != newStatus) {\n mStatus = newStatus;\n mChanged = true;\n }\n }", "public void updateStatus() {\n var taskStatuses = new ArrayList<OptimizationTaskStatus>();\n\n synchronized (tasks) {\n for (var task : tasks.values()) {\n taskStatuses.add(task.getStatus());\n }\n }\n\n wrapper.setStatus(JsonSerializer.toJson(new OptimizationToolStatus(taskStatuses)));\n }", "TaskStatus getStatus();", "Status updateStatus(StatusUpdate latestStatus) throws TwitterException;", "public void updateTask(int tid,String title,String detail,int money,String type,int total_num,int current_num,Timestamp start_time,Timestamp end_time,String state);", "public void setStatus(JobStatus status);", "public void updateTransactionStatus(String accountId, String transactionId, TransferState status) {\n }", "boolean updateActiveTask(Task task);", "public abstract void updateStatus() throws Throwable;", "boolean updateTask(Task updatedTask);", "public void updateStatus(final String status) {\n // Be a good citizen. Make sure UI changes fire on the UI thread.\n this.runOnUiThread(new Runnable() {\n public void run() {\n sipLabel.setText(status);\n }\n });\n }", "public String updateTableStatus(String taskMethod, String accessToken, String tableUUID, int tableStatus) {\n\n String response = null;\n IApiConnector apiConnector;\n\n Map<String, String> requestParams = new HashMap<>();\n requestParams.put(\"Status\", String.valueOf(tableStatus));\n\n Map<String, String> requestHeaders = new HashMap<>();\n requestHeaders.put(\"Content-Type\", \"application/json\");\n requestHeaders.put(\"Authorization\", String.format(\"Bearer %s\", accessToken));\n\n String url = Constants.BASE_URL + Constants.UPDATE_TABLE_STATUS_URL +\n tableUUID;\n\n if (taskMethod.equals(Constants.ASYNC_METHOD)) {\n apiConnector = new AsyncApiConnector();\n response = apiConnector.sendHttpJsonPutRequest(url, requestHeaders, requestParams, Constants.UPDATE_TABLE_STATUS);\n } else if (taskMethod.equals(Constants.SYNC_METHOD)) {\n apiConnector = new SyncApiConnector();\n response = apiConnector.sendHttpJsonPutRequest(url, requestHeaders, requestParams, Constants.UPDATE_TABLE_STATUS);\n }\n\n return response;\n }", "private void updateTask(String task_id, final String task, final String status, final int position){\n if(!preference.getAPI_KEY().isEmpty()){\n Call call = service.updateTask(preference.getAPI_KEY(), task_id, task, status);\n connection.request(call, new ResponseListener() {\n @Override\n public void onSuccess(String response) {\n Log.e(TAG, \"\"+response);\n list_task.get(position).setTask(task);\n list_task.get(position).setStatus(status);\n notifyDataSetChanged();\n }\n\n @Override\n public void onError(String error) {\n Log.e(TAG, \"\"+error);\n }\n });\n }else {\n Toast.makeText(context, \"please login to check data\", Toast.LENGTH_SHORT).show();\n }\n\n }", "public int updateTask(Task task) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_TASKNAME, task.getTaskName());\n values.put(KEY_STATUS, task.getStatus());\n values.put(KEY_DATE,task.getDateAt());\n\n // updating row\n return db.update(TABLE_TASKS, values, KEY_ID + \" = ?\",\n new String[] { String.valueOf(task.getId()) });\n }", "void onStatusUpdate(int status);", "@PostMapping(value=\"/update\",consumes={MediaType.APPLICATION_JSON_VALUE},produces={MediaType.APPLICATION_JSON_VALUE})\n\t public StatusDTO updateTask(@RequestBody TaskDTO task){\n\t\t taskService.updateTask(task);\n\t\t StatusDTO status = new StatusDTO();\n\t status.setMessage(\"Task details updated successfully\");\n\t status.setStatus(200);\n\t return status;\n\t }", "Transfer updateStatus(Long id, Payment.Status status);", "@Override\n public boolean statusUpdate(TaskAttemptID taskId, TaskStatus taskStatus)\n throws IOException, InterruptedException {\n superStepCount = taskStatus.getSuperstepCount();\n return true;\n }", "public void updateTask() {}", "TaskResponse updateTask(TaskRequest taskRequest, Long taskId);", "@SuppressWarnings(\"unchecked\")\r\n public UserPlanTask UserPlanTaskUpdate(long taskId, String TTitle, String TDescription, String TDate, Integer status) {\r\n session = sf.openSession();\r\n Transaction t = session.beginTransaction();\r\n UserPlanTask UpdateTaskList = (UserPlanTask) session.load(UserPlanTask.class, taskId);\r\n UpdateTaskList.setTTitle(TTitle);\r\n UpdateTaskList.setTDescription(TDescription);\r\n UpdateTaskList.setTDate(TDate);\r\n UpdateTaskList.setStatus(status);\r\n if (null != UpdateTaskList) {\r\n session.update(UpdateTaskList);\r\n }\r\n t.commit();\r\n session.close();\r\n sf.close();\r\n return UpdateTaskList;\r\n }", "public void updateStatus(JobStatus status, String userId) throws DatabaseException, IllegalArgumentException;", "@RequestMapping(value = \"/update/{id}\", method = RequestMethod.POST)\r\n public @ResponseBody\r\n List<Task> updateStatus(@PathVariable(\"id\") String id,\r\n @RequestParam(required = false) String content,\r\n @RequestParam(required = false) String status,\r\n @RequestParam(required = false) String assigneeId,\r\n @RequestParam(required = false) String timeInDays) {\n \r\n int taskId = ResourceUtil.stringToIntegerConversion(\"task_id\", id);\r\n List<Task> result = new ArrayList<Task>();\r\n \r\n try { \r\n Task task = new Task();\r\n task = taskManager.readTask(taskId);\r\n \r\n if (content != null)\r\n task.setContent(content);\r\n if (status != null)\r\n task.setStatus(TaskStatus.valueOf(status));\r\n if (assigneeId != null)\r\n task.setUser(userServiceManager.readUser(assigneeId));\r\n if (timeInDays != null) {\r\n \tint time_In_Days = ResourceUtil.stringToIntegerConversion(\"task_time_in_days\", timeInDays);\r\n task.setMilestonePeriod(timeInDays);\r\n task.setTimeInDays(time_In_Days);\r\n } \r\n // if none of these was changed, do not update\r\n if (content != null || status != null || assigneeId != null || timeInDays != null)\r\n taskManager.updateTask(task);\r\n result.add(task);\r\n } catch (Exception e) {\r\n logger.error(e.getMessage(), e);\r\n String exceptionMsg = \"Error occured while updating the task (pKey) \"+id;\r\n ScrumrException.create(exceptionMsg, MessageLevel.SEVERE, e);\r\n }\r\n return result;\r\n }", "public void setStatus(Status status) {\r\n\t this.status = status;\r\n\t }", "@POST\n @ApiOperation(\"Update process status\")\n @javax.ws.rs.Path(\"{id}/status\")\n @Consumes(MediaType.TEXT_PLAIN)\n @WithTimer\n public void updateStatus(@ApiParam @PathParam(\"id\") UUID instanceId,\n @ApiParam(required = true) @QueryParam(\"agentId\") String agentId,\n @ApiParam(required = true) ProcessStatus status) {\n\n ProcessKey processKey = assertProcessKey(instanceId);\n processManager.updateStatus(processKey, agentId, status);\n }", "public void setStatus(@NotNull Status status) {\n this.status = status;\n }", "private void handleStatusUpdate(AppEvent event)\n {\n if( ( !event.getTask().hasStatus() )\n || ( !event.getTask().getStatus().getState().equals( event.getTaskStatus().getState() ))\n || ( this.app.getState(event.getTask().getNodeId()).equals(SchedulerNode.State.REREGISTERED) ))\n {\n //do info update first in case user issues a AppDriver call that depends on it\n this.updateTaskInfo(event.getTask(), event.getTaskStatus());\n\n SchedulerNode.State state = this.app.getState(event.getTask().getNodeId());\n\n switch (event.getTaskStatus().getState())\n {\n //case TASK_DROPPED:\n case TASK_ERROR:\n case TASK_FAILED:\n //case TASK_GONE:\n case TASK_LOST:\n //case TASK_UNKNOWN:\n // case TASK_GONE_BY_OPERATOR:\n //case TASK_UNREACHABLE:\n if( !state.equals(SchedulerNode.State.FAILED)\n && !state.equals(SchedulerNode.State.FINISHED)\n && !state.equals(SchedulerNode.State.KILLED)) {\n this.app.nodeFailed(this, event.getTask().getNodeId());\n }\n break;\n case TASK_FINISHED:\n if( !state.equals(SchedulerNode.State.FAILED)\n && !state.equals(SchedulerNode.State.FINISHED)\n && !state.equals(SchedulerNode.State.KILLED)) {\n this.app.nodeFinished(this, event.getTask().getNodeId());\n }\n break;\n case TASK_RUNNING:\n this.app.nodeRunning(this, event.getTask().toBuilder().setStatus(event.getTaskStatus()).build());\n break;\n case TASK_KILLED:\n if( !state.equals(SchedulerNode.State.FAILED)\n && !state.equals(SchedulerNode.State.FINISHED)\n && !state.equals(SchedulerNode.State.KILLED)) {\n this.app.nodeKilled(this, event.getTask().getNodeId());\n }\n break;\n default:\n }\n }\n\n this.updateTaskInfo(event.getTask(), event.getTaskStatus());\n }", "void setStatus(STATUS status);", "public void setStatus(Status status)\n {\n this.status = status;\n }", "public void setStatus(int status);", "public void setStatus(int status);", "void setStatus(final UserStatus status);", "public void setStatus(Status status) {\r\n this.status = status;\r\n }", "public void setStatus(long status) {\r\n this.status = status;\r\n }", "public void setStatus(Status status) {\n this.status = status;\n }", "public void setStatus(Status status) {\n this.status = status;\n }", "public void setStatus(Status status) {\n this.status = status;\n }", "public void setStatus(Status status) {\n this.status = status;\n }", "public void setStatus(Status newStatus){\n status = newStatus;\n }", "public void setStatus(int status) {\n\t\tthis.status = (byte) status;\n\t\trefreshStatus();\n\t}", "void setStatus(java.lang.String status);", "public void updateSyncStatus(String id, String status)\n {\n SQLiteDatabase database = this.getWritableDatabase(); \n String updateQuery = \"Update UsersTable set udpateStatus = '\"+ status +\"' where userId=\"+\"'\"+ id +\"'\";\n Log.d(\"query\",updateQuery); \n database.execSQL(updateQuery);\n database.close();\n }", "public void setStatus(STATUS status) {\n this.status = status;\n }", "void setStatus(int status);", "@Override\n\tpublic void updateStatus(int appointmentId, String status, String reason) {\n\t\ttry{\n\t\t\tjdbcTemplate.update(UPDATE_STATUS, (ps)->{\n\t\t\t\tps.setString(1, status);\n\t\t\t\tps.setString(2, reason);\n\t\t\t\tps.setInt(3, appointmentId);\n\t\t\t});\n\t\t}catch(DataAccessException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public synchronized void setStatus(Status stat) {\n if (!isMutable()) {\n throw new IllegalStateException(\n \"This TestResult is no longer mutable!\");\n }\n\n if (stat == null) {\n throw new IllegalArgumentException(\n \"TestResult status cannot be set to null!\");\n }\n\n // close out message section\n sections[0].setStatus(null);\n\n execStatus = stat;\n\n if (execStatus == inProgress) {\n execStatus = interrupted;\n }\n\n // verify integrity of status in all sections\n for (Section section : sections) {\n if (section.isMutable()) {\n section.setStatus(incomplete);\n }\n }\n\n props = PropertyArray.put(props, SECTIONS,\n StringArray.join(getSectionTitles()));\n props = PropertyArray.put(props, EXEC_STATUS,\n execStatus.toString());\n\n // end time now required\n // mainly for writing in the TRC for the Last Run Filter\n if (PropertyArray.get(props, END) == null) {\n props = PropertyArray.put(props, END, formatDate(new Date()));\n }\n\n // this object is now immutable\n notifyCompleted();\n }", "public void setStatus(int status) {\n this.status = status;\n }", "public void setStatus(int status) {\n this.status = status;\n }", "private void updateStatus(final String status)\n {\n jLabelStatus.setText(status);\n jLabelStatus.paintImmediately(jLabelStatus.getVisibleRect());\n }", "public void setStatus(String status) {\r\n this.status = status;\r\n }", "public void setStatus(String status) {\r\n this.status = status;\r\n }", "public List<String> statusUpdate(String status) {\r\n\t\tList<String> twitterResponseList = new ArrayList<String>();\r\n\t\ttry {\r\n\t\t\tProperties properties = getProperties();\r\n\t\t\tString apiUrl = properties.getProperty(\"twitter.api.status.update\");\r\n\t\t\tapiUrl = apiUrl + \"?status=\" + status.replace(\" \", \"%20\"); //Appending the API url with the messgae to be tweeted.\r\n\r\n\t\t\tHttpResponse apiResponse = executeHttpPost(apiUrl);\r\n\t\t\tif (200 == apiResponse.getStatusLine().getStatusCode()) {\r\n\t\t\t\ttwitterResponseList.add(\"API call was Successful. Tweeted: \"+ status );\r\n\t\t\t} else {\r\n\t\t\t\ttwitterResponseList.add(\"API call was Unsuccessful\");\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn twitterResponseList;\r\n\t}", "public void setStatus(String status) {\r\n this.status = status;\r\n }", "public void setStatus(int status){\r\n\t\tthis.status=status;\r\n\t}", "void onStatusChanged(Status newStatus);", "private static String getStatus(Task task) {\n Status myStatus = task.getStatus();\n if (myStatus == Status.UP_NEXT) {\n return \"UP_NEXT\";\n } else if (myStatus == Status.IN_PROGRESS) {\n return \"IN_PROGRESS\";\n } else {\n return myStatus.toString();\n }\n }", "public void setStatus(String status) { this.status = status; }", "void setStatus(String status);", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(int status)\r\n\t{\r\n\t\tthis.m_status = status;\r\n\t}", "public void setStatus(String _status) {\n this._status = _status;\n }", "public void setStatus(String status) {\n mBundle.putString(KEY_STATUS, status);\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String status) {\n this.status = status;\n }", "public void setStatus(String stat)\n {\n status = stat;\n }", "public void setStatus(int v) \n {\n \n if (this.status != v)\n {\n this.status = v;\n setModified(true);\n }\n \n \n }", "public void setStatus(Integer status) {\r\n this.status = status;\r\n }", "public void setStatus(Integer status) {\r\n this.status = status;\r\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }", "public void setStatus(Integer status) {\n this.status = status;\n }" ]
[ "0.78919566", "0.7824492", "0.7311404", "0.7088133", "0.7086696", "0.69836813", "0.6784794", "0.6719823", "0.664444", "0.66248256", "0.66244334", "0.66171646", "0.6616617", "0.65368146", "0.64955324", "0.64738554", "0.64647925", "0.6460799", "0.64561903", "0.642336", "0.64109933", "0.6377871", "0.6375819", "0.63480794", "0.63308185", "0.6310488", "0.6303237", "0.62950546", "0.62331676", "0.6198672", "0.6154158", "0.61141974", "0.61063457", "0.6090563", "0.6090236", "0.60880613", "0.6079047", "0.6079047", "0.60784316", "0.6074195", "0.6041372", "0.6041231", "0.6041231", "0.6041231", "0.6041231", "0.600412", "0.5997588", "0.5984954", "0.59825236", "0.5967672", "0.5959271", "0.5953204", "0.59478605", "0.5945661", "0.5945661", "0.59455", "0.5934622", "0.5934622", "0.59339195", "0.5933532", "0.5929494", "0.5929243", "0.5927434", "0.5924369", "0.5923845", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916931", "0.5916584", "0.5907416", "0.5906967", "0.59047073", "0.59047073", "0.58993083", "0.5898864", "0.58964616", "0.58964616", "0.5888965", "0.5888965", "0.5888965", "0.5888965", "0.5888965", "0.5888965", "0.5888965", "0.5888965", "0.5888965", "0.5888965" ]
0.6957571
6
setTaskCompleted Set a task to complete.
public void setTaskCompleted(TaskAttemptID taskID) { taskStatuses.get(taskID).setState(TaskStatus.SUCCEEDED); successfulTaskID = taskID; activeTasks.remove(taskID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void completeTask() {\n completed = true;\n }", "@Override\n public void completeTask(@NonNull String taskId) {\n }", "@Override\n protected void onPostExecute(BackgroundTaskResult result)\n {\n taskCompleted = true;\n dismissProgressDialog();\n notifyTaskCompletion(result);\n }", "void TaskFinished(Task task) {\n\n repository.finishTask(task);\n }", "public void setCompleted(){\r\n\t\tisCompleted = true;\r\n\t}", "public void setCompleted() {\n this.completed = true;\n }", "public void markTaskCompleted(int taskIndex) {\n Task taskToMark = tasks.get(taskIndex);\n taskToMark.markTaskAsCompleted();\n cachedTasks.push(new CachedTask(taskToMark, \"done\", taskIndex));\n }", "public void completeTask() {\r\n int selected = list.getSelectedIndex();\r\n if (selected >= 0) {\r\n Task task = myTodo.getTaskByIndex(selected + 1);\r\n myTodo.getTodo().get(task.getHashKey()).setComplete(true);\r\n showCompleted = true;\r\n playSound(\"c1.wav\");\r\n }\r\n todoListGui();\r\n }", "public void taskComplete() {\n mTasksLeft--;\n if ((mTasksLeft==0) & mHasCloRequest){\n onAllTasksCompleted();\n }\n }", "private void doMarkTaskAsCompleted() {\n System.out.println(\n \"Select the task you would like to mark as complete by entering the appropriate index number.\");\n int index = input.nextInt();\n todoList.markTaskAsCompleted(index);\n System.out.println(\"The selected task has been marked as complete. \");\n }", "@Override\n public boolean complete(boolean succeed) {\n if (completed.compareAndSet(false, true)) {\n onTaskCompleted(task, succeed);\n return true;\n }\n return false;\n }", "protected void handleCompletedTask(Future<Task> task)\n {\n m_RunningTasks.remove(task);\n\n }", "public void setCompleted (boolean isCompleted) {\n this.isCompleted = isCompleted;\n }", "public void CompleteTask() {\n\t\tCompletionDate = new Date();\n\t}", "public void onTaskCompletion(Task<?> task)\n {\n m_RunningTasks.remove(task);\n }", "@Override\n protected void onPreExecute()\n {\n taskCompleted = false;\n\n //display the progress dialog\n showProgressDialog();\n }", "void onTaskCompleted(T t, boolean succeed) {\n metrics.markCompletion(t, succeed);\n for (CompletableTask.Listener<T> listener : listeners) {\n listener.onComplete(t, succeed);\n }\n }", "@Override\n\tprotected void onCancelled(BackgroundTaskResult result)\n\t{\n\t\ttaskCompleted = true;\n\t\tdismissProgressDialog();\n\t\tnotifyTaskCancelled(result);\n\t}", "void onTaskCompleted(TaskResult taskResult);", "public void notifyAsyncTaskDone();", "public void completeTask()\n throws NumberFormatException, NullPointerException, IndexOutOfBoundsException {\n System.out.println(LINEBAR);\n try {\n int taskNumber = Integer.parseInt(userIn.split(\" \")[TASK_NUMBER]);\n\n int taskIndex = taskNumber - 1;\n\n tasks.get(taskIndex).markAsDone();\n storage.updateFile(tasks.TaskList);\n System.out.println(\"Bueno! The following task is marked as done: \\n\" + tasks.get(taskIndex));\n } catch (NumberFormatException e) {\n ui.printNumberFormatException();\n } catch (NullPointerException e) {\n ui.printNullPtrException();\n } catch (IndexOutOfBoundsException e) {\n ui.printIndexOOBException();\n }\n System.out.println(LINEBAR);\n }", "public interface TaskCompleted {\n\tvoid onTaskComplete(String response, String type);\n}", "public void setTask(Task task) {\n this.task = task;\n }", "public void onTaskComplete(){\n findViewById(R.id.downloadend).setVisibility(View.VISIBLE);\n findViewById(R.id.finito).setBackgroundResource(R.drawable.ok);\n }", "public void set_completed();", "public static boolean toggleComplete(Task task) {\n Boolean complete = task.getCompleted(); // Get the current value\n\n // TOGGLE COMPLETE\n if (complete) // store the opposite of the current value\n complete = false;\n else\n complete = true;\n try{\n String query = \"UPDATE TASK SET ISCOMPLETE = ? WHERE (NAME = ? AND COLOUR = ? AND DATE = ?)\"; // Setup query for task\n PreparedStatement statement = DatabaseHandler.getConnection().prepareStatement(query); // Setup statement for query\n statement.setString(1, complete.toString()); // Store new isCompleted value\n statement.setString(2, task.getName()); // store values of task\n statement.setString(3, task.getColor().toString());\n statement.setString(4, Calendar.selectedDay.getDate().toString());\n int result = statement.executeUpdate(); // send out the statement\n if (result > 0){ // If swapped successfully, re-load the tasks\n getMainController().loadTasks(); // Reload the task list to update the graphics.\n }\n return (result > 0);\n } catch (SQLException e) {\n e.printStackTrace(); // If task was unable to be edited\n e.printStackTrace(); // Create alert for failing to edit\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setHeaderText(null);\n alert.setContentText(\"Unable to edit task.\");\n alert.showAndWait();\n }\n return false;\n }", "public void finishTask() {\n\t\t\n\t}", "@Override\n\tpublic void onTaskPostExecute() {\n\t\tLog.i(TAG, \"post executing\");\n\t\tupdateAdapter();\n\t\tspinner.setVisibility(View.GONE);\n\t\tlistView.setVisibility(View.VISIBLE);\n\t\tlistView.onLoadMoreComplete();\n\t}", "public void markComplete(int taskNumber) {\n Task currentTask = storage.get(taskNumber);\n currentTask.complete();\n line();\n System.out.println(\"Marked task \" + (taskNumber + 1) + \" as complete.\");\n System.out.println(currentTask);\n line();\n }", "public void setCompleted(boolean flag) {\r\n completed = flag;\r\n }", "public interface OnResponseTaskCompleted {\n /**\n * Called when the task completes with or without error.\n *\n * @param request Original sent request.\n * @param response Response to the request. Can be null.\n * @param ohex OHException thrown on server, null otherwise.\n * @param data Data registered to the task on which this method calls back.\n */\n void onResponseTaskCompleted(Request request, Response response, OHException ohex, Object data);\n }", "public void setCompleted(boolean achievementCompleted) {\n\t\t\n\t\tcompleted = achievementCompleted;\n\t\t\n\t}", "@Override\n protected void onPostExecute(Void result) {\n super.onPostExecute(result);//Run the generic code that should be ran when the task is complete\n onCompleteListener.onAsyncTaskComplete(result);//Run the code that should occur when the task is complete\n }", "@Override\n protected void onPostExecute(String result) {\n mListener.onTaskCompleted(result);\n }", "public void setNumCompleted(int numCompleted)\n\t{\n\t\tthis.numCompleted = numCompleted;\n\t}", "void onTaskComplete(T result);", "void addDoneTask(Task task);", "public void setProcessCompleted(String processCompleted)\r\n\t{\r\n\t\tthis.processCompleted = processCompleted;\r\n\t}", "@Override\n public void completeFlower(@NonNull String taskId) {\n }", "public void onCompleted() {\n\t\t\n\t\t }", "public CompletedTask(Task task, String date)\r\n\t{\r\n\t\tsuper(task.ID, task.description, task.priority, task.order, STATUS_COMPLETE);\r\n\t\tthis.date = date;\r\n\t}", "void finish(Task task);", "void onTaskFinished(A finishedTask, R result);", "@Override\n protected void succeeded() {\n eventService.publish(new TaskEndedEvent(this));\n\n }", "public void edit_task_completion(boolean completion_status)\n {\n task_completion_boolean = completion_status;\n }", "@IcalProperty(pindex = PropertyInfoIndex.COMPLETED,\n todoProperty = true)\n public void setCompleted(final String val) {\n completed = val;\n }", "@Override\n protected void onPostExecute(Boolean success) {\n super.onPostExecute(success);\n resultListener.onTaskFinished(this, success);\n }", "public abstract Task markAsDone();", "public boolean addNewFinishedTask(Task task){\r\n return finished.add(task);\r\n }", "@Override\n\t\tpublic void onCompleted() {\n\t\t}", "@Override\n public void onTaskComplete(String result) {\n\n //TODO\n\n }", "@Override\n public String markComplete() {\n if (this.isDone) {\n return Ui.getTaskAlrCompletedMessage(this);\n } else {\n this.isDone = true;\n return Ui.getMarkCompleteEventMessage(this);\n }\n }", "public void setScriptCompletedAt(long timeCompleted) {\n scriptHistory.setCompletedAt(timeCompleted);\n }", "public void markAsDone() {\n this.isDone = true;\n this.completed = \"1\";\n }", "void taskFinished(Throwable t);", "public void setDone() {\n this.isDone = true;\n }", "public void setDone() {\n this.isDone = true;\n }", "public void setDone() {\n this.isDone = true;\n }", "@Override\r\n public void tasksFinished()\r\n {\n }", "@Override\n public void onComplete(@NonNull Task<Void> task) {\n }", "@Override\n public void onComplete(@NonNull Task<Void> task) {\n }", "public TaskSlotCounts withCompleted(int completed) {\n this.completed = completed;\n return this;\n }", "public void SetDone(){\n this.isDone = true;\n }", "@Override\n\t\tpublic void onTaskComplete(Vehicle vh) {\n\t\t\tVehicleActivity.this.onTaskCompleteCreateOrUpdate(vh);\n\t\t}", "public synchronized void setComplete() {\n status = Status.COMPLETE;\n }", "protected void postTask(Task __task) {\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\ttaskList.addLast(__task);\r\n\t\t\tcondition.signalAll();\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}", "public void taskFinished(NewsRssUrlCheckTask finishedTask, boolean result);", "public Task markAsDone() {\n isDone = true;\n status = \"\\u2713\"; // A tick symbol indicating the task is done.\n\n return this;\n }", "public void setTask(TaskDTO task) {\n\t\tthis.task = task;\r\n\t\t\r\n\t\t\r\n\t}", "public void markAsDone() throws TaskAlreadyDoneException {\n if (!this.isDone) {\n this.isDone = true;\n } else {\n throw new TaskAlreadyDoneException();\n }\n }", "public void done() {\n try {\n AsyncTask.this.a(get());\n } catch (InterruptedException e) {\n Log.w(\"AsyncTask\", e);\n } catch (ExecutionException e2) {\n throw new RuntimeException(\"An error occured while executing doInBackground()\", e2.getCause());\n } catch (CancellationException unused) {\n AsyncTask.this.a(null);\n }\n }", "public boolean get_task_completion()\n {\n return task_completion_boolean;\n }", "private static void taskCompleted(Context context, String uniqueId) {\n context.getContentResolver().delete(TaskContract.TaskEntry.CONTENT_URI,\n TaskContract.TaskEntry.UNIQUE_ID+\"=?\",\n new String[] {uniqueId});\n NotificationUtils.clearAllNotifications(context);\n }", "@Override\n public void taskIsUncompleted(final String taskId) {\n trace(LogMessage.TASK_3, taskId);\n final Task task = getTaskService().createTaskQuery().taskId(taskId).active().singleResult();\n assertThat(task, is(notNullValue()));\n\n // Assert the process is not completed\n new ProcessInstanceAssert(getConfiguration()).processIsActive(task.getProcessInstanceId());\n\n }", "public void completeNext()\n {\n\tTask t = toDo.get(0);\n\tt.complete();\n\ttoDo.remove(0);\n\tcompleted.add(t);\n }", "public interface OnTaskCompleted {\n void onTaskCompleted();\n}", "private TasksLists setTaskDone(ITaskCluster taskCluster, ICommonTask task, Object taskServiceResult) {\n return nextTasks(taskCluster, task, taskServiceResult);\n }", "public void markAsCompleted(BulkItemResponse translatedResponse) {\n assertInvariants(ItemProcessingState.EXECUTED);\n assert executionResult != null && translatedResponse.getItemId() == executionResult.getItemId();\n assert translatedResponse.getItemId() == getCurrentItem().id();\n\n if (translatedResponse.isFailed() == false && requestToExecute != null && requestToExecute != getCurrent()) {\n request.items()[currentIndex] = new BulkItemRequest(request.items()[currentIndex].id(), requestToExecute);\n }\n getCurrentItem().setPrimaryResponse(translatedResponse);\n currentItemState = ItemProcessingState.COMPLETED;\n advance();\n }", "public void awaitPendingTasksFinished() throws IgniteCheckedException {\n GridCompoundFuture pendingFut = this.pendingTaskFuture;\n\n this.pendingTaskFuture = new GridCompoundFuture();\n\n if (pendingFut != null) {\n pendingFut.markInitialized();\n\n pendingFut.get();\n }\n }", "private void notifyTaskCompletion(BackgroundTaskResult result)\n {\n //Use the activity reference to update the UI only\n //if it is available.\n if (null != activity) {\n BaseController controller = getController();\n if (controller != null && controller instanceof BackgroundTaskListener) {\n ((BackgroundTaskListener)controller).onBackgroundTaskCompleted(result);\n }\n updateOnActivityAttach = false;\n }\n else {\n updateOnActivityAttach = true;\n }\n }", "private void updateFinishedTask(DataSnapshot dataSnapshot) {\n finished_firebaseRef_tasks.push().setValue(dataSnapshot);\n }", "@Override\n @NonNull\n public StorageTask<ResultT> addOnCompleteListener(@NonNull OnCompleteListener<ResultT> listener) {\n Preconditions.checkNotNull(listener);\n completeListener.addListener(null, null, listener);\n return this;\n }", "void onTaskComplete(MediaDownloadTask mediaDownloadTask);", "public void markAsDone() {\n this.isDone = true;\n\n }", "void completeTask(String userId, Long taskId, Map<String, Object> results);", "@Override\n public void onCompleted() {\n }", "@Override\n public void onCompleted() {\n }", "public interface OnAsyncTaskCompleted {\n /**\n * On task completed.\n *\n * @param o the object will be return by the asynctask\n */\n void onTaskCompleted(Object o);\n}", "public void complete()\n {\n isComplete = true;\n }", "@Override\n public void onComplete(@NonNull Task<Void> task) {\n if (progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n\n // Finish this activity.\n finish();\n\n }", "void saveTask( org.openxdata.server.admin.model.TaskDef task, AsyncCallback<Void> callback );", "boolean getTaskResultAfterDone(ManagedObjectReference task)\n throws InvalidPropertyFaultMsg, RuntimeFaultFaultMsg,\n InvalidCollectorVersionFaultMsg {\n\n boolean retVal = false;\n\n // info has a property - state for state of the task\n Object[] result =\n waitForValues.wait(task, new String[]{\"info.state\", \"info.error\"},\n new String[]{\"state\"}, new Object[][]{new Object[]{\n TaskInfoState.SUCCESS, TaskInfoState.ERROR}});\n\n if (result[0].equals(TaskInfoState.SUCCESS)) {\n retVal = true;\n }\n if (result[1] instanceof LocalizedMethodFault) {\n throw new RuntimeException(\n ((LocalizedMethodFault) result[1]).getLocalizedMessage());\n }\n return retVal;\n }", "public void markAsDone() {\n this.isDone = true;\n }", "public void markAsDone() {\n this.isDone = true;\n }", "public void markAsDone() {\n this.isDone = true;\n }", "void setAggregatedTask(Task aggregatedTask);", "public void finish() {\n\t\ttask.run();\n\t\ttask.cancel();\n\t}", "public void markAsDone() {\r\n this.isDone = true;\r\n }", "public void completeTask(String title) {\n ContentValues args = new ContentValues();\n args.put(KEY_COMPLETED, \"true\");\n storage.update(TABLE_NAME, args, KEY_TITLE + \"='\" + title+\"'\", null);\n }", "@Override\n\tpublic void onTaskCompleted(String response, int serviceCode) {\n\n\t\tLog.d(\"pavan\", \"Response is \" + response);\n\n\t}" ]
[ "0.7220624", "0.6645527", "0.6614889", "0.65461296", "0.64381963", "0.64137703", "0.63632435", "0.6293023", "0.62860006", "0.62624395", "0.6248954", "0.6189483", "0.6172629", "0.6101055", "0.6064891", "0.60525584", "0.603075", "0.60095435", "0.60013515", "0.59628934", "0.5931109", "0.58787024", "0.58302593", "0.5813357", "0.58089036", "0.5795232", "0.57835716", "0.5741894", "0.5739947", "0.57274765", "0.568983", "0.56866056", "0.5682567", "0.5676381", "0.56600887", "0.5659731", "0.56475776", "0.5549342", "0.554835", "0.55339426", "0.55202055", "0.55119795", "0.54959625", "0.5480269", "0.54663724", "0.54585934", "0.5442022", "0.5439327", "0.54358476", "0.5420839", "0.5418842", "0.54116184", "0.54031867", "0.5396871", "0.53785634", "0.5355641", "0.5355641", "0.5355641", "0.53549963", "0.5342273", "0.5342273", "0.5336606", "0.5330274", "0.53299224", "0.532946", "0.5307493", "0.53054154", "0.52995145", "0.5298265", "0.5271358", "0.52692556", "0.5268325", "0.5260439", "0.5253776", "0.5246576", "0.52380025", "0.52323526", "0.52309644", "0.52254575", "0.52243024", "0.52186793", "0.5214065", "0.5213551", "0.5208105", "0.5206693", "0.51872635", "0.51872635", "0.5186988", "0.5184473", "0.5182304", "0.51808256", "0.5174298", "0.5173587", "0.5173587", "0.5173587", "0.51728207", "0.5172386", "0.5172306", "0.5171263", "0.516807" ]
0.7423937
0
getTaskToRun Set the task to running state.
public Task getTaskToRun(String taskTrackerName) throws RemoteException, NotBoundException { TaskAttemptID attemptID = new TaskAttemptID(taskID, nextAttemptID++); Task newTask = null; if (isMapTask()) { newTask = new MapTask(attemptID, partition, locatedBlock); } else { HashSet<String> locations = job.getAllMapTaskLocations(); newTask = new ReduceTask(attemptID, partition, locatedBlock, locations); } activeTasks.put(attemptID, taskTrackerName); allTaskAttempts.add(attemptID); jobTracker.createTaskEntry(attemptID, taskTrackerName, this); return newTask; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRunning(boolean b) {\n mRun = b;\n }", "public void setRunning(boolean run) {\n _run = run;\r\n }", "private synchronized void startTask(Task task) {\n if (_scheduledTasks.get(task.table) == task) {\n _scheduledTasks.remove(task.table);\n }\n _runningTask = task;\n }", "public void setRunning(boolean run)\n\t{\n\t\tmRun=run;\n\t}", "void setRunMode(TaskRunMode runMode);", "public void setRunning(boolean running) {\n isRunning = running;\n }", "public static void activateFixedTaskScheduling(Week week, FixedTask taskToPut){\n Putter.putTask(week, taskToPut);\n }", "public void runTask(Task task) throws SchedulerException {\n scheduler.runTask(task);\n }", "public void setRunning(boolean running) \n\t {\n\t\t \n\t\t _running = running;\n\t\t \n\t }", "public final void run() {\n\t\ttask();\n\t\t_nextTaskHasRan = true;\n\t}", "public void setRunning(boolean running) {\n this.running = running;\n }", "public void setRunning(boolean isrunning) {\r\n running = isrunning;\r\n }", "public static void activateNonFixedTaskScheduling(Week week, NonFixedTask taskToSchedule){\n NonFixedTask NonFixedTaskToPut = Scheduler.ScheduleTaskInWeek(week, taskToSchedule);\n Putter.putTask(week, NonFixedTaskToPut);\n }", "public void setRunning(boolean b) {\n\t\t// Do not allow mRun to be modified while any canvas operations\n\t\t// are potentially in-flight. See doDraw().\n\t\tsynchronized (mRunLock) {\n\t\t\tmRun = b;\n\t\t}\n\t}", "public void setRunning(boolean running)\n\t{\n\t\tthis.running = running;\n\t}", "public static void setRunning(boolean run) {\n\t\tmRunning = run;\n\t\tif (mRunning) {\n\t\t\tsetStartRecordingTime();\n\t\t}\n\n\t\tif (mContext != null) {\n\t\t\tEditor edit = mContext.getSharedPreferences(Defines.SHARED_PREF_NAME, Context.MODE_PRIVATE).edit();\n\t\t\tedit.putBoolean(Defines.SHARED_PREF_RUNNNING, mRunning);\n\t\t\tedit.commit();\n\t\t}\n\t}", "public void setActiveTask(boolean active)\r\n\t{\r\n\t\tif (active)\r\n\t\t{\r\n\t\t\tif (this.getPeriod() != null)\r\n\t\t\t{\r\n\t\t\t\t// Support without at load\r\n\t\t\t\tMassivePlugin plugin = this.getPlugin();\r\n\t\t\t\tif (plugin.isEnabled())\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this.isSync())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.task = Bukkit.getScheduler().runTaskTimer(this.getPlugin(), this, this.getDelay(), this.getPeriod());\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.task = Bukkit.getScheduler().runTaskTimerAsynchronously(this.getPlugin(), this, this.getDelay(), this.getPeriod());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (this.task != null)\r\n\t\t\t{\r\n\t\t\t\tthis.task.cancel();\r\n\t\t\t\tthis.task = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void runInThread() {\n\t\tTaskRunner taskRunner = Dep.get(TaskRunner.class);\n\t\tATask atask = new ATask<Object>(getClass().getSimpleName()) {\n\t\t\t@Override\n\t\t\tprotected Object run() throws Exception {\n\t\t\t\tBuildTask.this.run();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t};\n\t\ttaskRunner.submitIfAbsent(atask);\n\t}", "public void setRunning(boolean running) {\n //Restarts the counter.\n counter = 0;\n isRunning = running;\n }", "public void setRunningTasksToFailure() {\r\n\t\tsetRunningTasksToFailureRecursive(elements);\r\n\t}", "public void setRun(Boolean run){\n runnnig = run;\n }", "public void stopTask() {\n if(canRunTaskThread != null)\n canRunTaskThread.set(false);\n }", "void setRunning(boolean running) {\n this.running = running;\n }", "void setRunning(boolean running) {\n this.running = running;\n }", "@Override\n public void setRunning(boolean running)\n {\n this.step.setRunning(running);\n\n // Rogers: Executar o metodo stepActive do provStepListener...\n synchronized (provStepListeners)\n {\n for (int i = 0; i < provStepListeners.size(); i++)\n {\n StepListener stepListener = provStepListeners.get(i);\n stepListener.stepActive(this.getTrans(), this.getStepMeta(),\n this);\n }\n }\n }", "public void setRun(boolean b) {\n\t\tfirst.setRun(b);\n\t\trest.setRun(b);\n\t}", "public void setTaskInstance(Task taskInstance) {\n\t\tthis.taskInstance = taskInstance;\n\t}", "public void toggleRunning() {\r\n\t\trunning = !running;\r\n\t}", "public void run() {\n long start = System.nanoTime();\n try {\n activeCount.inc();\n long delay = start - nextExecutionTime;//实践执行时间-理论应该执行的实际点\n taskExecutionDelay.record(delay, TimeUnit.NANOSECONDS);\n // real logic\n if (isPeriodic())\n runPeriodic();\n else\n ScheduledFutureTask.super.run();\n } finally {\n activeCount.dec();\n taskExecutionTime.record(System.currentTimeMillis() - start, TimeUnit.MILLISECONDS);\n }\n }", "public void startTask() {\n\t}", "@Override\n public void run() {\n runTask();\n\n }", "@Override\n public void run() {\n task.run();\n }", "WorkingTask getWorkingTask();", "public final void setTimerRunning(final boolean tR) {\n this.timerRunning = tR;\n }", "public void isRunning(boolean isRunning)\r\n {\r\n _isRunning = isRunning;\r\n\r\n }", "@PostConstruct\n public void setUpTasks() {\n final Iterable<Task> findAll = taskService.findAll();\n if (findAll != null) {\n findAll.forEach(task -> {\n\n final RunnableTask runnableTask = new RunnableTask(task.getId(), runTaskService);\n\n if (task.getCronExpression() != null) {\n log.info(\"Adding cron schedule for {} : {}\", task.getId(), task.getCronExpression());\n threadPoolTaskScheduler.schedule(runnableTask, new CronTrigger(task.getCronExpression()));\n }\n else if (task.getDelayPeriod() > 0) {\n log.info(\"Adding periodic schedule for {} : {}\", task.getId(), task.getDelayPeriod());\n threadPoolTaskScheduler.schedule(runnableTask, new PeriodicTrigger(task.getDelayPeriod()));\n }\n else {\n log.error(\"Invalid task {}\", task.getId());\n }\n\n });\n }\n }", "public com.opentext.bn.converters.avro.entity.DocumentEvent.Builder setTaskId(java.lang.String value) {\n validate(fields()[23], value);\n this.taskId = value;\n fieldSetFlags()[23] = true;\n return this;\n }", "public void setRunnning(boolean bool) {\n\t\trunning = bool;\n\t}", "public void setTask(Task task) {\n this.task = task;\n }", "private TimerTask getTask() {\n\t\tfinal TimedTask tt = this;\n\t\treturn new TimerTask() {\n\t\t\tpublic void run() {\n\t\t\t\ttask();\n\t\t\t\ttt._nextTaskHasRan = true;\n\t\t\t}\n\t\t};\n\t}", "@Override\n protected void beforeExecute(final Thread thread, final Runnable run) {\n mActiveTasks.add(run);\n super.beforeExecute(thread, run);\n }", "private void schedule() {\n service.scheduleDelayed(task, schedulingInterval);\n isScheduled = true;\n }", "@Override\n public void startTask(TrcRobot.RunMode runMode)\n {\n }", "public UfRuleRunning() {\n this(DSL.name(\"uf_rule_running\"), null);\n }", "public void setRunWhenInitilizing(boolean value) {\n\t\trunWhenInitilizing = value;\n\t}", "protected final boolean rescheduleTaskIfNecessary(Object task) {\n if (this.running) {\n try {\n doRescheduleTask(task);\n } catch (RuntimeException ex) {\n logRejectedTask(task, ex);\n this.pausedTasks.add(task);\n }\n return true;\n } else if (this.active) {\n this.pausedTasks.add(task);\n return true;\n } else {\n return false;\n }\n }", "public Builder setTaskId(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n taskId_ = value;\n onChanged();\n return this;\n }", "public void run(Task task) {\n try {\n // inject before serializing, to check that all fields are serializable as JSON\n injectionService.injectMembers(task);\n\n String s = objectMapper.writeValueAsString(task);\n log.info(\"Executing \" + s);\n\n // inject after deserializing, for proper execution\n AbstractTask deserialized = objectMapper.readValue(s, AbstractTask.class);\n injectionService.injectMembers(deserialized);\n setupTask(task);\n\n try {\n ((AbstractTask)deserialized).run(this);\n incCompletedTaskCount(task.getQueueName());\n } finally {\n teardownTask(task);\n }\n\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public void startTaskTriggerCheckerThread() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n canRunEnqueueTaskThread.set(true);\n while(canRunEnqueueTaskThread.get()) {\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n if(taskEnqueued.get() || canRunTaskThread.get()) { //do not enqueue the task if an instance of that task is already enqueued or running.\n continue;\n //log(PrioritizedReactiveTask.this.getClass().getSimpleName() + \" already in queue or is currently executing\");\n } else if(shouldTaskActivate()) {\n System.out.println(\"Thread \" + Thread.currentThread().getId() + \" enqueued task: \" + this.getClass().getSimpleName());\n taskQueue.add(PrioritizedReactiveTask.this);\n activeTasks.add(PrioritizedReactiveTask.this);\n taskEnqueued.set(true);\n try {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }\n }\n }).start();\n }", "@Override\n public ScheduledFuture<?> schedule(Runnable task, Trigger trigger) {\n if (!canRun()) {\n return null;\n }\n return super.schedule(task, trigger);\n }", "@Override\n\tpublic void run() {\n\t\t\tList<TaskTO> taskTOList = PriortyScheduler.getPriorityList(getEmployeeTO().getTaskTOList());\n\t\t\tfor(TaskTO taskTO : taskTOList){\n\t\t\t\tSystem.out.println(getEmployeeTO().getEmpName()+\">>\"+taskTO.getTaskName()+\">>\"+taskTO.getTimeTake());\n\t\t\t}\n\t\t\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\ttask();\n\t\t}", "public void setTask(Task inTask){\n punchTask = inTask;\n }", "public void run() {\n final String tag = \"Scheduled session[\"+taskid+\"]\";\n LOG.entering(SessionTask.class.getName(),\"run\");\n LOG.finer(tag+\" starting...\");\n try {\n if (execute()==false) return;\n\n LOG.finer(tag+\" terminating - state is \"+state+\n ((delayBeforeNext >0)?(\" next session is due in \"+delayBeforeNext+\" ms.\"):\n \" no additional session scheduled\"));\n\n // if delayBeforeNext <= 0 we are done, either because the session was\n // stopped or because it successfully completed.\n if (delayBeforeNext <= 0) {\n if (!notifyStateChange(COMPLETED,\"scan-done\"))\n LOG.finer(tag+\" stopped: done\");\n else\n LOG.finer(tag+\" completed: done\");\n return;\n }\n\n // we need to reschedule a new session for 'delayBeforeNext' ms.\n scheduleNext();\n\n } finally {\n tasklist.remove(this);\n LOG.finer(tag+\" finished...\");\n LOG.exiting(SessionTask.class.getName(),\"run\");\n }\n }", "@Override\n public void addTasksToRun() {\n //gets the tasks that are ready for execution from the list with new tasks\n List<Task> collect = tasks.stream().filter((task) -> (task.getDate() == TIME))\n .collect(Collectors.toList());\n //sort the tasks inserted. The sort is based in \"priority\" value for all the tasks.\n collect.sort(new Comparator<Task>() {\n @Override\n public int compare(Task o1, Task o2) {\n return o1.getPriority() - o2.getPriority();\n }\n });\n //Change the status of tasks for READY\n collect.stream().forEach((task) -> {\n task.setStatus(Task.STATUS_READY);\n });\n //Adds the tasks to the queue of execution\n tasksScheduler.addAll(collect);\n\n //Removes it from list of new tasks\n tasks.removeAll(collect);\n }", "public void setRunning(boolean incRunning){\n\t\trunning = incRunning;\n\t}", "@Override\n\tpublic void initTask() {\n\t\tRankTempInfo rankInfo = RankServerManager.getInstance().getRankTempInfo(player.getPlayerId());\n\t\tif(rankInfo!=null){\n\t\t\tgetTask().getTaskInfo().setProcess((int)rankInfo.getSoul());\n\t\t}\n\t}", "public TaskSlotCounts withRunning(int running) {\n this.running = running;\n return this;\n }", "abstract void doTaskOnRun();", "private void setTaskEnabled(boolean enabled)\n {\n final String funcName = \"setTaskEnabled\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API, \"enabled=%s\", Boolean.toString(enabled));\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API);\n }\n\n if (enabled)\n {\n TrcTaskMgr.getInstance().registerTask(instanceName, this, TrcTaskMgr.TaskType.STOP_TASK);\n TrcTaskMgr.getInstance().registerTask(instanceName, this, TrcTaskMgr.TaskType.POSTCONTINUOUS_TASK);\n }\n else\n {\n TrcTaskMgr.getInstance().unregisterTask(this, TrcTaskMgr.TaskType.STOP_TASK);\n TrcTaskMgr.getInstance().unregisterTask(this, TrcTaskMgr.TaskType.POSTCONTINUOUS_TASK);\n }\n }", "@Override\n public void activateTask(@NonNull String taskId) {\n }", "public void startTaskRunnerThread() {\n canRunTaskThread.set(true);\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n log(\"Starting task: \" + getClassName());\n task();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n log(\"Finished task: \" + getClassName());\n canRunTaskThread.set(false);\n }\n }\n }).start();\n }", "public void start() {\n\t\ttry {\n\t\t\t_timer.cancel();\n\t\t} catch (Exception e) {\n\t\t\t// Attempting to stop just in case, so this isn't a problem.\n\t\t}\n\t\t_timer = new Timer();\n\t\ttry {\n\t\t\t_timer.schedule(getTask(), TIME, TIME);\n\t\t} catch (IllegalStateException e) {\n\t\t\tstop();\n\t\t\tstart(); // Redo method if it was already running before.\n\t\t}\n\t}", "public Task(String task, boolean isDone) {\n this.task = task;\n this.isDone = isDone;\n }", "public void setTask(TaskDTO task) {\n\t\tthis.task = task;\r\n\t\t\r\n\t\t\r\n\t}", "@VisibleForTesting(otherwise = VisibleForTesting.NONE)\r\n LiveData<Task> getActiveTask();", "public void schedule() {\n\t\tnew Timer().schedule(getTask(), TIME);\n\t}", "public void startTask(final SlideshowFXTask task) {\n if(task == null) throw new NullPointerException(\"The task to start can not be null\");\n\n synchronized(this.currentTasks) {\n this.currentTasks.add(task);\n }\n\n task.stateProperty().addListener((value, oldState, newState) -> {\n if(newState != null && (\n newState == Worker.State.CANCELLED ||\n newState == Worker.State.SUCCEEDED ||\n newState == Worker.State.FAILED)) {\n synchronized (this.currentTasks) {\n this.currentTasks.remove(task);\n }\n }\n });\n\n this.startTaskActions.forEach(action -> action.execute(task));\n new Thread(task).start();\n }", "public void run() {\n\t\t\t\tIMSScheduleManager.super.startCron();\r\n\t\t\t\t\r\n\t\t\t}", "private void foundRunning() {\n\t\tif (state == BridgeState.RUNNING || state == BridgeState.CREATED) {\n\t\t\tstate = BridgeState.RUNNING;\n\t\t}\n\t}", "public void stop() {\n if (this.runningTaskId != -1) {\n plugin.getServer().getScheduler().cancelTask(this.runningTaskId);\n }\n reset(true);\n running = false;\n }", "public void runTask(Runnable task) {\n\t\tthreadPool.execute(task);\r\n\t\t// System.out.println(\"Queue Size after assigning the\r\n\t\t// task..\"+queue.size() );\r\n\t\t// System.out.println(\"Pool Size after assigning the\r\n\t\t// task..\"+threadPool.getActiveCount() );\r\n\t\t// System.out.println(\"Task count..\"+threadPool.getTaskCount() );\r\n\t\tSystem.out.println(\"Task count..\" + queue.size());\r\n\r\n\t}", "private synchronized boolean changeTaskState(String taskKey, SchedulerTaskState newState)\n {\n if (timer == null)\n return false;\n \n // the task has already been canceled\n SchedulerTimerTask timerTask = (SchedulerTimerTask) scheduledTimerTasks.get(taskKey);\n if (null == timerTask)\n {\n return false;\n }\n \n // and write changed state to internal db if needed\n if (timerTask.schedulerTask.isVisible())\n {\n IDataAccessor accessor = AdminApplicationProvider.newDataAccessor();\n IDataTransaction transaction = accessor.newTransaction();\n try\n {\n IDataTable table = accessor.getTable(Enginetask.NAME);\n table.qbeClear();\n table.qbeSetKeyValue(Enginetask.schedulerid, getId());\n table.qbeSetKeyValue(Enginetask.taskid, timerTask.schedulerTask.getKey());\n if (table.search() > 0)\n {\n IDataTableRecord record = table.getRecord(0); \n record.setValue(transaction, Enginetask.taskstatus, newState.getName());\n transaction.commit();\n }\n }\n catch (Exception ex)\n {\n if (logger.isWarnEnabled())\n {\n logger.warn(\"Could not update task in DB: \" + timerTask.schedulerTask, ex);\n }\n }\n finally\n {\n\t\t\t\ttransaction.close();\n\t\t\t}\n }\n return timerTask.schedulerTask.setState(newState);\n }", "@Override\n public void run() {\n //如果本延迟任务已经执行,那么做个标识标注本清楚任务已经执行,然后手按下的时候那里就不会移除本任务\n b = false;\n cleanLine();\n }", "public void setRunnable(Runnable runnable) {\n this.runnable = runnable;\n }", "public static ITask findWorkOnTaskById(long taskId) {\r\n Ivy ivy = Ivy.getInstance();\r\n IPropertyFilter<TaskProperty> taskFilter =\r\n ivy.session.getWorkflowContext().createTaskPropertyFilter(TaskProperty.ID, RelationalOperator.EQUAL, taskId);\r\n IQueryResult<ITask> queryResult =\r\n ivy.session.findWorkTasks(taskFilter, null, 0, 1, true,\r\n EnumSet.of(TaskState.SUSPENDED, TaskState.RESUMED, TaskState.PARKED));\r\n List<ITask> tasks = queryResult.getResultList();\r\n if (tasks != null && tasks.size() > 0) {\r\n return tasks.get(0);\r\n }\r\n return null;\r\n }", "public ITask getTask() {\n \t\treturn task;\n \t}", "@Override\n\tpublic void run() {\n\t\tif (queue.size() > 0) {\n\t\t\tITask task = queue.poll();\n\t\t\tpool.execute(task);\n\t\t} else {\n\t\t\tqueue.setTaskRunning(false);\n\t\t}\n\t}", "void editTask(ReadOnlyTask taskToEdit, Name taskName, Date startDate, Date endDate, Priority priority,\n\t\t\tRecurrenceRate recurrenceRate);", "public static boolean isRunningTask(Long tkId) {\n\t\treturn runningTasks.contains(tkId);\n\t}", "private void start()\n {\n _taskThread.start();\n _state = ActivityState.RUNNING;\n }", "@Override\n public Task markUndone() {\n ReadOnlyTask oldTask = this;\n \n TaskName newName = oldTask.getName();\n TaskTime newStartTime = oldTask.getStartTime();\n TaskTime newEndTime = oldTask.getEndTime();\n TaskTime newDeadline = oldTask.getDeadline();\n Tag newTag = oldTask.getTag();\n\n Task newTask = null;\n try {\n newTask = new Task(newName, newStartTime, newEndTime, newDeadline, newTag, false);\n } catch (IllegalValueException e) {\n assert false;\n }\n return newTask;\n }", "public void onRunActionRunnerAvailabilityChange(boolean isRunning);", "public Task getTaskInstance() {\n\t\treturn taskInstance;\n\t}", "public void run()\r\n\t{\r\n\t\ttimer.scheduleAtFixedRate(this.getTimerTask(), 0, repeat * 60 * 1000);\r\n\t}", "public static void launchTask(Task tsk)\n {\n getInstance().doExecute(tsk);\n }", "boolean updateActiveTask(Task task);", "@Override\n\t\tpublic void run() {\n\t\t\tlogging.info(prefix + \"WorkerTask has been initiated\");\n\t\t\tlogging.trace(prefix + \"Storing containing Thread for shutdown\");\n\t\t\trunningThread = Thread.currentThread();\n\t\t\tlogging.trace(prefix + \"Entering running loop\");\n\t\t\tincrementReadyWorkerTasks();\n\t\t\twhile (running.get() && !Thread.currentThread().isInterrupted()) {\n\t\t\t\ttry {\n\t\t\t\t\tlogging.trace(prefix + \"Awaiting next Task\");\n\t\t\t\t\tRunnable runnable = taskQueue.takeFirst();\n\t\t\t\t\tlogging.trace(prefix + \"Fetched next Task to execute\");\n\t\t\t\t\tdecrementReadyWorkerTasks();\n\t\t\t\t\tlogging.trace(prefix + \"Got new Task. Performing Task\");\n\t\t\t\t\tlogging.trace(prefix + \"Task: \" + runnable.toString());\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlogging.debug(prefix + \"Starting requested Task\");\n\t\t\t\t\t\trunnable.run();\n\t\t\t\t\t\tlogging.debug(prefix + \"Finished requested Task\");\n\t\t\t\t\t\tlogging.trace(prefix + \"Task finished successfully\");\n\t\t\t\t\t} catch (Throwable t) {\n\t\t\t\t\t\tlogging.error(prefix + \"Could not complete Task! Encountered unexpected Throwable!\", t);\n\t\t\t\t\t\tUnhandledExceptionContainer.catching(t);\n\t\t\t\t\t\tlogging.warn(prefix + \"Trying to continue as if nothing happened.\");\n\t\t\t\t\t}\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tif (running.get()) {\n\t\t\t\t\t\tlogging.warn(prefix + \"Interrupted while waiting on Task queue. Shutting down this WorkerTask!\", e);\n\t\t\t\t\t\tUnhandledExceptionContainer.catching(e);\n\t\t\t\t\t\tshutdown();\n\t\t\t\t\t}\n\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t}\n\t\t\t\tincrementReadyWorkerTasks();\n\t\t\t\tpostCheck();\n\t\t\t}\n\t\t\tlogging.debug(prefix + \"Left while loop. Shutdown eminent.\");\n\t\t\tlogging.trace(prefix + \"Informing shutdown callback\");\n\t\t\tshutdownConsumer.accept(this);\n\t\t\tlogging.info(prefix + \"Finished\");\n\t\t}", "@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"======开始执行任务======\");\n\t\trunning = true;\n\t\twhile (running) {\n\t\t}\n\t\tSystem.out.println(\"======结束执行任务======\");\n\t}", "public boolean getRunning() {\n\t\treturn running;\n\t}", "private <E, F extends ITaskObject> IStatusTask createInitTask(F taskObject) {\n ITaskObjectManager<E, F> taskObjectManager = getTaskManagerConfiguration().getTaskObjectManagerRegistry().getTaskObjectManager(taskObject);\n Class<F> taskObjectClass = taskObjectManager.getTaskObjectClass();\n\n E currentStatus = taskObjectManager.getInitialStatus(taskObject);\n\n // Create a first task, it does nothing\n return getTaskManagerConfiguration().getTaskFactory().newStatusTask(null, taskObjectClass, currentStatus);\n }", "@Override\r\n public void run() {\r\n if (node.isPredecessorSet()) {\r\n // Create the task and set the timer\r\n task = new CheckPredecessorTimer(node);\r\n (new Timer()).schedule(task, CHECK_PERIOD);\r\n\r\n node.checkPredecessor();\r\n }\r\n }", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public void startTask(Long taskId, String userId) {\n TaskServiceSession taskSession = null;\n try {\n taskSession = taskService.createSession();\n Task taskObj = taskSession.getTask(taskId);\n int sessionId = taskObj.getTaskData().getProcessSessionId();\n \n taskSession.taskOperation(Operation.Start, taskId, userId, null, null, null);\n eventSupport.fireTaskStarted(taskId, userId);\n }catch(Exception x) {\n throw new RuntimeException(\"startTask\", x);\n }finally {\n if(taskSession != null)\n taskSession.dispose();\n }\n }", "public void resetTask() {}", "public void cancelRunnable() {\n\t\tif (taskID != null) {\n\t\t\tplugin.getServer().getScheduler().cancelTask(taskID);\n\t\t}\n\t}", "public void setCurrentTaskName(String name);", "@Override\n public void scheduler(Task task) {\n task.setStatus(Task.STATUS_RUNNING);\n for (int q = 0; q < quantum; q++) {\n task.addElapsedTime(1);\n generateLog(task);\n TIME++;\n addTasksToRun();\n if (task.getElapsedTime() >= task.getTotalTime()) {\n task.setStatus(Task.STATUS_FINISHED);\n return;\n }\n }\n task.setStatus(Task.STATUS_READY);\n }", "private Object getTask(Runnable runnable)\r\n {\r\n Object innerTask = \r\n ObservableExecutors.getInnerTask(runnable, Object.class);\r\n if (innerTask != null)\r\n {\r\n return innerTask;\r\n }\r\n return runnable;\r\n }", "public final void execute() {\n\t\tLogUtils.i(TAG, \"execute\");\n\t\tpurelySetState(TaskState.Preparing);\n\t\tTaskQueue.addTask(this);\n\t}", "public void setTaskId(String taskId) {\r\n\t\tthis.taskId=taskId;\r\n\t}", "@Override\n\tpublic void run() {\n\t\tif (this.isRunning == true) {\n\t\t\treturn;\n\t\t}\n\t\tthis.isRunning = true;\n\t\t// 写入一条日志\n\t\t\n\t\t// 详细运行参数\n\t\ttry {\n\t\t\tthis.taskRun();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.isRunning = false;\n\t\tthis.addHistory(new Date());\n\t\tif(this.once) {\n\t\t\tthis.cancel();\n\t\t}\n\t}" ]
[ "0.580173", "0.5787465", "0.5785471", "0.57758844", "0.5439274", "0.5424531", "0.5352626", "0.526999", "0.5261035", "0.5256253", "0.52319735", "0.52186316", "0.5201057", "0.5178088", "0.5169167", "0.5155029", "0.5120765", "0.5119403", "0.51185614", "0.510463", "0.5042828", "0.503579", "0.5005594", "0.5005594", "0.49522096", "0.48947698", "0.48711663", "0.48664603", "0.48493156", "0.48250726", "0.48052052", "0.47973195", "0.47824335", "0.47807965", "0.4780559", "0.47712293", "0.4760692", "0.47538784", "0.47507256", "0.4742914", "0.4742907", "0.4739217", "0.4730209", "0.47257072", "0.47222733", "0.47178108", "0.47142103", "0.47098112", "0.47086665", "0.470814", "0.47050086", "0.46951497", "0.4692058", "0.46839085", "0.466953", "0.46625233", "0.46558985", "0.46429855", "0.4640772", "0.4638158", "0.46321627", "0.46292484", "0.46287403", "0.46278095", "0.46224865", "0.46211454", "0.46073854", "0.4604649", "0.46025336", "0.45992106", "0.4595924", "0.4580279", "0.4574213", "0.45634148", "0.45554477", "0.45424408", "0.45335498", "0.45268062", "0.4525762", "0.45067662", "0.45015794", "0.44979063", "0.44867614", "0.4486238", "0.44753748", "0.44740164", "0.44630402", "0.44531342", "0.44527435", "0.4450396", "0.4449642", "0.44475427", "0.44438034", "0.44406146", "0.44394138", "0.44355327", "0.44237575", "0.4420873", "0.44131002", "0.44099227", "0.4401812" ]
0.0
-1
Add user account info to Firebase Database
@Override public void onComplete(@NonNull Task<AuthResult> task) { dbHelper.addNewUser( user ); // Get new FirebaseUser dbHelper.fetchCurrentUser(); // Add the new user to a new chat containing only the new user String chatID = dbHelper.getNewChildKey( dbHelper.getChatUserPath() ); String userID = dbHelper.getAuth().getUid(); String displayName = dbHelper.getAuthUserDisplayName(); dbHelper.addToChatUser( chatID, userID, displayName ); dbHelper.addToUserChat( userID, chatID ); String messageOneID = dbHelper.getNewChildKey(dbHelper.getMessagePath()); String timestampOne = dbHelper.getNewTimestamp(); String messageOne = "COUCH POTATOES:\nWelcome to Couch Potatoes!" + "\nEnjoy meeting new people with similar interests!"; dbHelper.addToMessage( messageOneID, userID, "COUCH POTATOES", chatID, timestampOne, messageOne ); String messageTwoID = dbHelper.getNewChildKey(dbHelper.getMessagePath()); String timestampTwo = dbHelper.getNewTimestamp(); String messageTwo = "COUCH POTATOES:\nThis chat is your space. Feel free to experiment with the chat here."; dbHelper.addToMessage( messageTwoID, userID, "COUCH POTATOES", chatID, timestampTwo, messageTwo ); // Registration complete. Redirect the new user the the main activity. startActivity( new Intent( getApplicationContext(), MainActivity.class ) ); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void uploadUserDetailsToDatabase(String email, String password){\n User user = new User(email, password);\n FirebaseDatabase.getInstance().getReference(\"Users\").push()\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n Log.i(\"details\", \"uploaded\");\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.i(\"details\", \"upload failed\");\n }\n });\n }", "private void saveUserInformation() {\n String name = editTextName.getText().toString().trim();\n String add = editTextAddress.getText().toString().trim();\n\n //creating a userinformation object\n UserInformation userInformation = new UserInformation(name, add);\n\n //getting the current logged in user\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n //saving data to firebase database\n /*\n * first we are creating a new child in firebase with the\n * unique id of logged in user\n * and then for that user under the unique id we are saving data\n * for saving data we are using setvalue method this method takes a normal java object\n * */\n databaseReference.child(user.getUid()).setValue(userInformation);\n\n //displaying a success toast\n Toast.makeText(this, \"Information Saved...\", Toast.LENGTH_LONG).show();\n }", "private void SaveUserToFirebase(FirebaseUser user)\n {\n\n }", "private void registerUser() {\n\n // Store values at the time of the login attempt.\n String username = mUsernameView.getText().toString();\n String email = mEmailView.getText().toString();\n String password = mPasswordView.getText().toString();\n String firstName = mFirstNameView.getText().toString();\n String lastName = mLastNameView.getText().toString();\n String dob = mDoBView.getText().toString();\n double height = Double.parseDouble(mHeightView.getText().toString());\n double weight = Double.parseDouble(mWeightView.getText().toString());\n String gender = mGenderView.getSelectedItem().toString();\n String role;\n\n //if role switch is in \"on\" position\n if (mRoleView.isChecked())\n {\n role = mRoleView.getTextOn().toString();\n }\n\n //if role switch is in \"off\" position\n else\n {\n role = mRoleView.getTextOff().toString();\n }\n\n\n\n //check if insertion is successful or not\n DatabaseReference.CompletionListener insertListener = new DatabaseReference.CompletionListener()\n {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference usersRef)\n {\n\n\n if (databaseError != null)\n {\n Log.d(\"test\", \"failed insertion\");\n\n //Failed insertion\n }\n\n else\n {\n //Successful insertion, return to main activity\n finish();\n }\n\n }\n };\n\n //create user object, push into database\n\n\n\n if (role.equals(\"Coach\"))\n {\n Coach newUser = new Coach(username, email, password, firstName, lastName, dob, height, weight, gender, role);\n appState.userRef.child(\"coaches\").child(username).setValue(newUser, insertListener);\n\n }\n\n else if (role.equals(\"Athlete\"))\n {\n Athlete newUser = new Athlete(username, email, password, firstName, lastName, dob, height, weight, gender, role);\n appState.userRef.child(\"athletes\").child(username).setValue(newUser, insertListener);\n\n }\n\n\n }", "private void register() {\r\n if (mName.getText().length() == 0) {\r\n mName.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mEmail.getText().length() == 0) {\r\n mEmail.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() == 0) {\r\n mPassword.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() < 6) {\r\n mPassword.setError(\"password must have at least 6 characters\");\r\n return;\r\n }\r\n\r\n\r\n final String email = mEmail.getText().toString();\r\n final String password = mPassword.getText().toString();\r\n final String name = mName.getText().toString();\r\n\r\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (!task.isSuccessful()) {\r\n Snackbar.make(view.findViewById(R.id.layout), \"sign up error\", Snackbar.LENGTH_SHORT).show();\r\n } else {\r\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\r\n\r\n //Saves the user's info in the database\r\n Map<String, Object> mNewUserMap = new HashMap<>();\r\n mNewUserMap.put(\"email\", email);\r\n mNewUserMap.put(\"name\", name);\r\n\r\n FirebaseDatabase.getInstance().getReference().child(\"users\").child(uid).updateChildren(mNewUserMap);\r\n }\r\n }\r\n });\r\n\r\n }", "public void registerClicked(View view) {\n mDatabase = FirebaseDatabase.getInstance().getReference();\n\n\n //Creates local variable for user input on each field\n String name = ((EditText) findViewById(R.id.first_name)).getText().toString().trim();\n String lName = ((EditText) findViewById(R.id.last_name)).getText().toString().trim();\n String mail = ((EditText) findViewById(R.id.email_address)).getText().toString().trim();\n String pass = ((EditText) findViewById(R.id.confirm_password)).getText().toString().trim();\n\n HashMap<String, String> dataMap = new HashMap<String, String>();\n dataMap.put(\"Name\", name);\n dataMap.put(\"Last Name\", lName);\n dataMap.put(\"Email\", mail);\n dataMap.put(\"Password\", pass);\n\n //Push Hash Object to root of Database\n //The on-complete listener makes sure the information was pushed\n //successfully to the database.\n mDatabase.push().setValue(dataMap).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if(task.isSuccessful()){\n Toast.makeText(LogIn.this, \"Registered!\", Toast.LENGTH_LONG).show();\n }else {\n Toast.makeText(LogIn.this, \"Try Again\", Toast.LENGTH_LONG).show();\n }\n }\n });\n setContentView(R.layout.activity_log_in);\n setTypeFace();\n }", "private void addUserToDatabase( DatabaseReference postRef) {\n\n // check username, password cannot be null and may not have spaces\n final String usernameChecked = checkNullString(usernameText.getText().toString());\n final String password = checkNullString(passwordText.getText().toString());\n final String confirmPassword = checkNullString(confirmPasswordText.getText().toString());\n\n if (usernameChecked == null || password == null) {\n Toast.makeText(this, \"Entries may not be null, and may not have spaces!\", Toast.LENGTH_LONG).show();\n return;\n }\n\n if (!password.equals(confirmPassword)){\n Toast.makeText(this, \"Passwords do not match!\", Toast.LENGTH_LONG).show();\n return;\n }\n\n if (users.contains(usernameChecked)){\n Toast.makeText(this, \"Username is already taken\", Toast.LENGTH_LONG).show();\n return;\n }\n\n // initialize data for SentCount\n postRef\n .child(\"Users\")\n .child(usernameChecked)\n .runTransaction(new Transaction.Handler() {\n\n @NonNull\n @Override\n public Transaction.Result doTransaction(@NonNull MutableData currentData) {\n User newUser = new User(usernameChecked, password);\n currentData.setValue(newUser);\n return Transaction.success(currentData);\n }\n\n @Override\n public void onComplete(@Nullable DatabaseError error, boolean committed,\n @Nullable DataSnapshot currentData) {\n Log.d(TAG, \"postTransaction:onComplete:\" + currentData);\n Toast.makeText(getApplicationContext(), \"Sign up successful!\", Toast.LENGTH_LONG);\n finish();\n }\n });\n }", "private void signUpNewUserToDB(){\n dbAuthentication.createUserWithEmailAndPassword(this.newUser.getEmail(), this.newUser.getPassword())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n /**signUp success, will update realTime DB ant firebase Authentication*/\n FirebaseUser currentUser = dbAuthentication.getCurrentUser();\n addToRealDB(currentUser.getUid());\n /**will send verification email to the user from Firebase Authentication*/\n currentUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n }\n });\n }else{isBadEmail = true;}\n }\n });\n }", "public static void signUp(final String email, String password, final String fullName, final String pictureUrl, final Activity activity) {\n Statics.auth.createUserWithEmailAndPassword(email, password)\n .addOnSuccessListener(new OnSuccessListener<AuthResult>() {\n @Override\n public void onSuccess(AuthResult authResult) {\n // add user to database\n Log.d(\"Test\",\"Facebook to firebase success\");\n User userToAdd = new User();\n userToAdd.setEmailAddress(email);\n String[] splited = fullName.split(\"\\\\s+\");\n userToAdd.setFirstName(splited[0]);\n userToAdd.setLastName(splited[1]);\n userToAdd.setPictureUrl(pictureUrl);\n usersTable.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(userToAdd).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"Failure\",e.getMessage());\n }\n });\n Toast.makeText(activity, \"added to database \", Toast.LENGTH_LONG).show();\n }\n }).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(\"Test\",\"Facebook ato firebase success\");\n\n }\n });\n }", "@Override\n public void onSuccess(AuthResult authResult) {\n Log.d(\"Test\",\"Facebook to firebase success\");\n User userToAdd = new User();\n userToAdd.setEmailAddress(email);\n String[] splited = fullName.split(\"\\\\s+\");\n userToAdd.setFirstName(splited[0]);\n userToAdd.setLastName(splited[1]);\n userToAdd.setPictureUrl(pictureUrl);\n usersTable.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(userToAdd).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"Failure\",e.getMessage());\n }\n });\n Toast.makeText(activity, \"added to database \", Toast.LENGTH_LONG).show();\n }", "private void sendUserData() {\n FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();\n DatabaseReference myref = firebaseDatabase.getReference(Objects.requireNonNull(firebaseAuth.getUid()));\n UserProfile userProfile = new UserProfile(name, email, post, 0);\n myref.setValue(userProfile);\n }", "@Override\n public void onSuccess(AuthResult authResult) {\n Demo_User demo_user = new Demo_User();\n demo_user.setEmail(editEmail.getText().toString());\n demo_user.setPassword(editPassword.getText().toString());\n demo_user.setName(editName.getText().toString());\n demo_user.setPhone(editPhone.getText().toString());\n\n //user email to key\n users.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(demo_user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Snackbar.make(rootLayout,\"Register success fully\",Snackbar.LENGTH_LONG).show();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Snackbar.make(rootLayout,\"Failed\" + e.getMessage(),Snackbar.LENGTH_LONG).show();\n }\n });\n }", "@Override\n public void onSuccess(AuthResult authResult) {\n User user = new User();\n user.setEmail(edtMail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n user.setName(edtName.getText().toString());\n user.setPhone(edtPhone.getText().toString());\n Log.d(\"RRR\", \"OKET\" + user);\n\n users.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void unused) {\n Snackbar.make(rootLayout, \"Register success\", Snackbar.LENGTH_SHORT)\n .show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Snackbar.make(rootLayout, \"Failed\" + e.getMessage(), Snackbar.LENGTH_SHORT)\n .show();\n }\n });\n }", "@Override\n public void onSuccess(AuthResult authResult) {\n Users user = new Users();\n user.setEmail(inputEmail.getText().toString());\n user.setName(inputName.getText().toString());\n user.setPhone(inputPhoneNumber.getText().toString());\n user.setPassword(inputPassword.getText().toString());\n\n users.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Snackbar.make(relativeLayoutsignup,\"SignUp Successfully\",Snackbar.LENGTH_SHORT)\n .show();\n\n startActivity(new Intent(SignUpActivity.this,SignInActivity.class));\n finish();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Snackbar.make(relativeLayoutsignup,\"Failed\"+e.getMessage(),Snackbar.LENGTH_SHORT)\n .show();\n }\n });\n }", "private void CreateNewAccount(final String phone, final String password, final String name) {\n if (TextUtils.isEmpty(phone)){\n Toast.makeText(this,\"Please enter your phone number ...\",Toast.LENGTH_SHORT).show();\n }\n else if(TextUtils.isEmpty(password)){\n Toast.makeText(this,\"Please enter your phone password ...\",Toast.LENGTH_SHORT).show();\n }\n else if(TextUtils.isEmpty(name)){\n Toast.makeText(this,\"Please enter your phone name ...\",Toast.LENGTH_SHORT).show();\n }\n else{\n //start creating account\n LoadingBar.show();\n\n final DatabaseReference mRef;\n mRef = FirebaseDatabase.getInstance().getReference();\n mRef.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n if (!(snapshot.child(\"Users\").child(phone).exists())){\n //if user not exist then we create account in database\n HashMap<String,Object> userdata = new HashMap<>();\n userdata.put(\"phone\",phone);\n userdata.put(\"password\",password);\n userdata.put(\"name\",name);\n mRef.child(\"Users\").child(phone).updateChildren(userdata)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()){\n LoadingBar.dismiss();\n Toast.makeText(RegisterActivity.this,\"Registration Successful\",Toast.LENGTH_SHORT).show();\n }\n else{\n LoadingBar.dismiss();\n Toast.makeText(RegisterActivity.this,\"Please try again after sometime ....\",Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n else{\n LoadingBar.dismiss();\n Toast.makeText(RegisterActivity.this,\"User with this number already exist ....\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n\n }\n }", "public void createUserAccount(String email, String password, final String userId, final SignUpInterface listner) {\n collectionReference = db.collection(\"Users\");\n firebaseAuth = FirebaseAuth.getInstance();\n firebaseAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if(task.isSuccessful()){\n currentUser = FirebaseAuth.getInstance().getCurrentUser();\n assert currentUser!= null;\n final String currentUserId = currentUser.getUid();\n\n Map<String, String> userMap = new HashMap<>();\n userMap.put(\"UserIdInDB\", currentUserId);\n userMap.put(\"UserName\", userId);\n\n collectionReference.add(userMap)\n .addOnSuccessListener(new OnSuccessListener<DocumentReference>() {\n @Override\n public void onSuccess(DocumentReference documentReference) {\n documentReference.get()\n .addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\n @Override\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\n if(task.getResult().exists()) {\n\n String name = task.getResult().getString(\"UserName\");\n\n EntityClass entityObj = EntityClass.getInstance();\n entityObj.setUserName(name);\n entityObj.setUserIdInDb(currentUserId);\n listner.signUpStatus(true);\n }\n }\n });\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(TAG, \"onFailure: \" + e.getMessage());\n listner.signUpStatus(false);\n listner.onFailure(e.getMessage());\n }\n });\n }\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(TAG, \"onFailure: \" + e.getMessage());\n listner.signUpStatus(false);\n listner.onFailure(e.getMessage());\n }\n });\n }", "public static void createUser(Context context, String email, String password, String name, String bio) {\n if (name.isEmpty() || name.contains(\".\") || name.contains(\"$\") || name.contains(\"#\") || name.contains(\"[\") || name.contains(\"]\") || name.contains(\"/\")) { // No characters that would conflict with firebase path name restrictions\n Log.d(\"RecipeFinderAuth\", \"Sign up Failed!\");\n Toast.makeText(context, \"Sign Up Failed!\", Toast.LENGTH_SHORT).show();\n return;\n }\n FirebaseDatabase.getInstance().getReference().child(\"displayNames\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n if (snapshot.hasChild(name)) { // Display name taken\n Log.d(\"RecipeFinderAuth\", \"Sign up Failed!\");\n Toast.makeText(context, \"Sign Up Failed!\", Toast.LENGTH_SHORT).show();\n } else {\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult> () {\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) { // Account was successfully created\n Log.d(\"RecipeFinderAuth\", \"Account Created!\");\n Toast.makeText(context, \"Account Created!\", Toast.LENGTH_SHORT).show();\n addNewToDataBase(name, bio); // Add the user to the database of users\n ((AppCompatActivity)(context)).finish();\n\n // Logged in, show home\n Intent intent = new Intent(context, HomeActivity.class);\n context.startActivity(intent);\n } else { // Account was not successfully created\n Log.d(\"RecipeFinderAuth\", \"Sign up Failed!\");\n Toast.makeText(context, \"Sign Up Failed!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n }", "private void addUserToFireBase() {\n Storage storage = new Storage(activity);\n RetrofitInterface retrofitInterface = RetrofitClient.getRetrofit().create(RetrofitInterface.class);\n Call<String> tokenCall = retrofitInterface.addUserToFreebase(RetrofitClient.FIREBASE_ENDPOINT + \"/\" + storage.getUserId() + \"/\" + storage.getFirebaseToken(), storage.getAccessToken());\n tokenCall.enqueue(new Callback<String>() {\n @Override\n public void onResponse(Call<String> call, Response<String> response) {\n if (response.isSuccessful()) {\n\n Toast.makeText(activity, \"Firebase success!\", Toast.LENGTH_SHORT).show();\n\n } else {\n Toast.makeText(activity, \"Failed to add you in Firebase!\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<String> call, Throwable t) {\n\n /*handle network error and notify the user*/\n if (t instanceof SocketTimeoutException) {\n Toast.makeText(activity, R.string.connection_timeout, Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }", "private void registerUser(){\n mAuth.createUserWithEmailAndPassword(correo, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //mapa de valores\n Map<String, Object> map = new HashMap<>();\n map.put(\"name\",name);\n map.put(\"email\",correo);\n map.put(\"password\",password);\n map.put(\"birthday\",cumple);\n map.put(\"genre\",genre);\n map.put(\"size\",size);\n //obtenemos el id asignado por la firebase\n String id= mAuth.getCurrentUser().getUid();\n //pasamos el mapa de valores\n mDatabase.child(\"Users\").child(id).setValue(map).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task2) {\n //validams que la tarea sea exitosa\n if(task2.isSuccessful()){\n startActivity(new Intent(DatosIniciales.this, MainActivity.class));\n //evitamos que vuelva a la pantalla con finsh cuando ya se ha registrado\n finish();\n }else{\n Toast.makeText(DatosIniciales.this, \"Algo fallo ups!!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }else{\n Toast.makeText(DatosIniciales.this, \"No pudimos completar su registro\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "private void userRegister(){\n String Email = email.getText().toString().trim();\n String Username = username.getText().toString().trim();\n String Password = password.getText().toString().trim();\n\n if(TextUtils.isEmpty(Email)){\n Toast.makeText(this,\"Please Enter Email ID\",Toast.LENGTH_SHORT).show();\n return;\n }\n if(TextUtils.isEmpty(Username)){\n Toast.makeText(this,\"Please Enter Username\",Toast.LENGTH_SHORT).show();\n return;\n }\n if(TextUtils.isEmpty(Password)){\n Toast.makeText(this,\"Please Enter Password\",Toast.LENGTH_SHORT).show();\n return;\n }\n\n progressDialog.setMessage(\"Registering User....\");\n progressDialog.show();\n\n mAuth.createUserWithEmailAndPassword(Email,Password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful())\n {\n Toast.makeText(SignUp.this,\"Registered Successfully\",Toast.LENGTH_SHORT).show();\n// startActivity(new Intent(getApplicationContext(),LogIn.class));\n// finish();\n } else{\n return;\n }\n }\n });\n\n User user = new User(mAuth.getCurrentUser().getUid(), 1, Email, Username);\n dbRef.child(\"users\")\n .child(mAuth.getCurrentUser().getUid())\n .setValue(user);\n\n UserAccountSetting settings = new UserAccountSetting(\n \"\",\n \"\",\n 0,\n 0,\n 0,\n \"\",\n Username);\n dbRef.child(\"user_account_setting\").child(mAuth.getCurrentUser().getUid()).setValue(settings);\n\n\n }", "private void registerUser() {\n String finalFullName = fullName.getText().toString().trim();\n String finalAge = age.getText().toString().trim();\n String finalEmail = email.getText().toString().trim();\n String finalPassword = password.getText().toString().trim();\n\n if(finalFullName.isEmpty()){\n fullName.setError(\"Full name is required.\");\n fullName.requestFocus();\n return;\n }\n\n if(finalAge.isEmpty()){\n age.setError(\"Age is required.\");\n age.requestFocus();\n return;\n }\n\n if(finalEmail.isEmpty()){\n email.setError(\"Email is required.\");\n email.requestFocus();\n return;\n }\n\n if(!Patterns.EMAIL_ADDRESS.matcher(finalEmail).matches()){\n email.setError(\"Please provide valid email!.\");\n email.requestFocus();\n return;\n }\n\n if(finalPassword.length() < 6){\n password.setError(\"Min. password length is 6 characters.\");\n password.requestFocus();\n return;\n }\n\n if(finalPassword.isEmpty()){\n password.setError(\"Password is required.\");\n password.requestFocus();\n return;\n }\n\n progressBar.setVisibility(View.VISIBLE);\n\n setEmail(finalEmail);\n setAge(finalAge);\n setFullName(finalFullName);\n\n //Using Firebase libraries, create the user data and send the info to Firebase\n mAuth.createUserWithEmailAndPassword(finalEmail, finalPassword)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //Create the User object\n User user = new User(getFullName(),getEmail(),getAge());\n\n //Now send that object to the Realtime Database\n FirebaseDatabase.getInstance().getReference(\"Users\")\n //Get registered user's ID and set it the the User object\n //so that they're connected\n .child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n //pass the user object. OnCompleteListener is used to Check if\n //the data was added to the database.\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n //Inside OnCompleteListener you must complete that\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if(task.isSuccessful()){\n Toast.makeText(RegistrationActivity.this, \"User has been registered successfully!\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n\n //Then redirect to login layout\n } else {\n Toast.makeText(RegistrationActivity.this,\"Failed to register. Try again.\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n }\n\n }\n });\n } else {\n Toast.makeText(RegistrationActivity.this,\"Failed to register. Try again.\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n }\n }\n });\n\n\n\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if(firebaseMethods.checkIfUsernameExists(username, dataSnapshot)){\n append = myRef.push().getKey().substring(0,7);\n }\n username = username + append;\n\n //add new user to the database\n firebaseMethods.addNewUser(\"notdone\",username,\"emp\",userID);\n Toast.makeText(mContext, \"Signup successful. Admin Verification \" +\n \"Left.\", Toast.LENGTH_SHORT).show();\n Intent i = new Intent(Register.this, Login.class);\n startActivity(i);\n finish();\n }", "public void addNewUser(String email) {\n String userName = email.split(\"@\")[0];\n mUsersRef.child(userName).setValue(userName);\n userRef = db.getReference(\"users/\" + getUsername());\n userRef.child(\"email\").setValue(email);\n userSigns = new HashMap<String, UserSign>();\n }", "private void registerUserToFirebaseAuth() {\n Utils.showProgressDialog(this);\n Task<AuthResult> task = mAuth.createUserWithEmailAndPassword(etEmail.getText().toString().trim(), etPassword.getText().toString().trim());\n task.addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Utils.dismissProgressDialog();\n if (task.isSuccessful()) {\n String firebaseId = task.getResult().getUser().getUid();\n\n // Storage Image to Firebase Storage.\n addProfileImageToFirebaseStorage(firebaseId);\n\n } else {\n Utils.toast(context, \"Some Error Occurs\");\n }\n }\n });\n }", "private void createAccountActivity() {\n // everything is converted to string\n String userName = createUserName.getText().toString().trim();\n String phoneNumber = createPhoneNumber.getText().toString().trim();\n String email = createEmail.getText().toString().trim();\n String password = createPassword.getText().toString().trim();\n\n\n // Validate that the entry should not be empty\n if (userName.isEmpty()) {\n createUserName.setError(\"It should not be empty. \");\n createUserName.requestFocus();\n return;\n }\n if (phoneNumber.isEmpty()) {\n createPhoneNumber.setError(\"It should not be empty. \");\n createPhoneNumber.requestFocus();\n return;\n }\n if (email.isEmpty()) {\n createEmail.setError(\"It should not be empty. \");\n createEmail.requestFocus();\n return;\n } else if (!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {\n createEmail.setError(\"Invalid email\");\n createEmail.requestFocus();\n return;\n }\n\n if (password.isEmpty()) {\n createPassword.setError(\"It should not be empty. \");\n createPassword.requestFocus();\n return;\n }\n\n // connect to the firebase\n auth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n String userID = FirebaseAuth.getInstance().getCurrentUser().getUid();\n User user = new User(userName, phoneNumber, email, password, userID);\n // We will send everything in user to the firebase database\n FirebaseDatabase.getInstance()\n .getReference(\"User\")\n .child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user).addOnCompleteListener(task1 -> {\n if (task1.isSuccessful()) {\n Toast.makeText(RegisterUser.this, \"The account has been created successfully. \", Toast.LENGTH_LONG).show();\n finish(); //basically same as clicking back button\n } else {\n Toast.makeText(RegisterUser.this, \"The account creation failed!\", Toast.LENGTH_LONG).show();\n }\n });\n } else {\n Toast.makeText(RegisterUser.this, \"The account creation failed!\", Toast.LENGTH_LONG).show();\n }\n });\n }", "private void registerUser(){\n final String email = editTextEmail.getText().toString().trim();\n final String password = editTextPassword.getText().toString().trim();\n final String name=editTextName.getText().toString().trim();\n final String joiningdate=editTextJoiningDate.getText().toString().trim();\n //final String uid=firebaseAuth.getCurrentUser().getUid();\n //checking if email and passwords are empty\n if(TextUtils.isEmpty(email)){\n Toast.makeText(this,\"Please enter email\",Toast.LENGTH_LONG).show();\n return;\n }\n\n if(TextUtils.isEmpty(password)){\n Toast.makeText(this,\"Please enter password\",Toast.LENGTH_LONG).show();\n return;\n }\n if(TextUtils.isEmpty(name)){\n Toast.makeText(this,\"Please enter Name\",Toast.LENGTH_LONG).show();\n return;\n }\n\n if(TextUtils.isEmpty(joiningdate)){\n Toast.makeText(this,\"Please enter Joining Date\",Toast.LENGTH_LONG).show();\n return;\n }\n //if the email and password are not empty\n //displaying a progress dialog\n\n progressDialog.setMessage(\"Registering Please Wait...\");\n progressDialog.show();\n\n getLocation();\n\n //creating a new user\n firebaseAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n\n\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.i(\"Hey Entered OnComplete\",\"\");\n //checking if success\n if(task.isSuccessful()){\n Log.i(\"Hey Entered issuccess\",\"\");\n User user= new User(name,joiningdate,email,loc);\n// Map map=new HashMap();\n// map.put(\"name\",name);\n// map.put(\"joining date\",joiningdate);\n// map.put(\"email\",email);\n// map.put(\"uid\",uid);\n database=FirebaseDatabase.getInstance();\n\n myRef=database.getReference(\"Users\");\n\n myRef.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if(task.isSuccessful()){\n Toast.makeText(MainActivity.this,\"Registration Successful\",Toast.LENGTH_LONG).show();\n startActivity(new Intent(getApplicationContext(),MenuActivity.class));\n }\n else{\n Toast.makeText(MainActivity.this,\"Registration Error\",Toast.LENGTH_LONG).show();\n }\n }\n });\n\n// String id=myRef.push().getKey();\n// myRef.child(id).setValue(user);\n\n\n }\n else{\n //display some message here\n Toast.makeText(MainActivity.this,\"Registration Error\",Toast.LENGTH_LONG).show();\n }\n progressDialog.dismiss();\n }\n });\n\n }", "public void registerUser(View view) {\n TextView emailAddressField = (TextView) findViewById(R.id.registerEmailAddress);\n final String emailAddress = emailAddressField.getText().toString();\n\n TextView passwordField = (TextView) findViewById(R.id.registerPassword);\n final String password = passwordField.getText().toString();\n\n TextView nameField = (TextView) findViewById(R.id.registerName);\n final String name = nameField.getText().toString();\n\n final String company = \"Purple Store\";\n\n if(emailAddress.isEmpty() || password.isEmpty() || name.isEmpty()) {\n Toast.makeText(this, \"Email Address, password or name cannot be blank\",Toast.LENGTH_SHORT).show();\n return;\n }\n\n mAuth.createUserWithEmailAndPassword(emailAddress, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"createUserWithEmail:success\");\n FirebaseUser currentUser = mAuth.getCurrentUser();\n String uid = currentUser.getUid();\n\n // Write credentials in Fire Store\n User newUser = new User();\n newUser.createUser(uid, emailAddress, name, company);\n newUser.writeData();\n\n // Save the details on shared preferences for future calls\n SharedPreferences sharedPreferences = getSharedPreferences(\"USER_DETAILS\", Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"userId\", uid);\n editor.putString(\"emailAddress\", emailAddress);\n editor.putString(\"name\", name);\n editor.putString(\"companyId\", company);\n editor.apply();\n\n // Redirect to Dashboard\n Intent intent = new Intent(RegisterActivity.this, MainActivity.class);\n startActivity(intent);\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(RegisterActivity.this, task.getException().getMessage(),Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "public void registerNewUser(final FirebaseFirestore db, final User user) {\n FirebaseUser FbUser = FirebaseAuth.getInstance().getCurrentUser();\n if (FbUser != null) {\n UserProfileChangeRequest request = new UserProfileChangeRequest.Builder()\n .setDisplayName(user.getName())\n .build();\n FbUser.updateProfile(request);\n }\n\n final DatabaseHelper localDB = new DatabaseHelper(getApplicationContext());\n db.collection(collection)\n .document(user.getEmail())\n .set(user)\n .addOnSuccessListener(avoid -> {\n Toast.makeText(getApplicationContext(), \"Registered\", Toast.LENGTH_SHORT).show();\n\n // Send to cache (local db)\n addToCache(user, localDB);\n\n // Send intent to dashboard\n Intent goToDashboard = new Intent(SignupActivity.this, Dashboard.class);\n Bundle myBundle = new Bundle();\n myBundle.putString(\"email\", user.getEmail());\n// myBundle.putString(\"name\", user.getName());\n// myBundle.putString(\"maxIncome\", String.valueOf(user.getMaxIncome()));\n myBundle.putBoolean(\"coming_from_login_signup\", true);\n goToDashboard.putExtras(myBundle);\n startActivity(goToDashboard);\n })\n .addOnFailureListener(e -> snackbar.showStatus(\"Not Registered\"));\n }", "void onUserCreated(FirebaseUser firebaseUser);", "@Override\n public void onSuccess(Map<String, Object> result) {\n Firebase newUserRef = ref.child(\"users\").child(\"username\");\n User newUser = new User();\n\n newUser.email = signUpEmail;\n newUser.fullName = fullName;\n newUser.password = password;\n\n newUserRef.setValue(newUser);\n\n Toast.makeText(SignupActivity.this, \"Successfully created new account\", Toast.LENGTH_LONG).show();\n finish();\n }", "public static void addNewToDataBase(String name, String bio) {\n FirebaseAuth mAuth = FirebaseAuth.getInstance();\n String uid = mAuth.getUid();\n DatabaseReference ref = FirebaseDatabase.getInstance().getReference();\n\n // Initialize the new user with a fridge, a list of friends, a list of allergies, and preferred units\n ref.child(\"users\").child(uid).child(\"fridge\").setValue(\"null\");\n ref.child(\"users\").child(uid).child(\"followers\").child(uid).setValue(uid);\n ref.child(\"users\").child(uid).child(\"following\").setValue(\"null\");\n ref.child(\"users\").child(uid).child(\"allergies\").setValue(\"null\");\n ref.child(\"users\").child(uid).child(\"units\").setValue(\"imperial\");\n ref.child(\"users\").child(uid).child(\"feed\").setValue(\"null\");\n ref.child(\"users\").child(uid).child(\"name\").setValue(name);\n ref.child(\"displayNames\").child(name).setValue(name);\n ref.child(\"users\").child(uid).child(\"bio\").setValue(bio);\n ref.child(\"users\").child(uid).child(\"posts\").setValue(\"null\");\n }", "private void registerUser(final String email, final String password) {\n\n progressDialog.show();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, dismiss dialog and start register activity\n progressDialog.dismiss();\n FirebaseUser user = mAuth.getCurrentUser();\n\n String email = user.getEmail();\n String uid = user.getUid();\n String username = mUserNameEdt.getText().toString().trim();\n int selectedId = radioGroup.getCheckedRadioButtonId();\n RadioButton radioSexButton = findViewById(selectedId);\n String gender = radioSexButton.getText().toString();\n\n //store the registered user info into firebase using Hashmap\n HashMap<Object, String> hashMap = new HashMap<>();\n\n hashMap.put(\"email\",email);\n hashMap.put(\"uid\",uid);\n hashMap.put(\"username\", username);\n hashMap.put(\"gender\", gender);\n\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference reference = database.getReference();\n\n reference.child(uid).setValue(hashMap);\n\n Toast.makeText(SignUpActivity.this, \"Registered...\\n\"+user.getEmail(), Toast.LENGTH_SHORT).show();\n startActivity(new Intent(SignUpActivity.this,UserProfileActivity.class));\n finish();\n\n } else {\n // If sign in fails, display a message to the user.\n progressDialog.dismiss();\n Toast.makeText(SignUpActivity.this, \"Authentication failed.\", Toast.LENGTH_SHORT).show();\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n //error, dismiss progress error, get and show the error message\n progressDialog.dismiss();\n Toast.makeText(SignUpActivity.this,\"\"+e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }", "private void addMember(String firstName, String lastName, String emailId) {\n Log.e(\"AddMember\", \"Fn \" + firstName + \", Ln \" + lastName + \"eid \" + emailId);\n\n\n// myRef.setValue(\"Hello, World!\");\n String key = myRef.push().getKey();\n Log.e(\"AddMember\", \"key \" + key);\n\n CoreMember member = new CoreMember(firstName, lastName, emailId);\n myRef.child(key).setValue(member, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {\n if (databaseError != null) {\n System.out.println(\"Data could not be saved \" + databaseError.getMessage());\n } else {\n System.out.println(\"Data saved successfully.\" + databaseReference.toString());\n memberKey = databaseReference.getKey();\n hideInputForm(true);\n\n }\n }\n });\n }", "@Override\n public void performRegister(final String name, final String email, final String gender, final String password){\n\n mAuth.createUserWithEmailAndPassword(email.toLowerCase(),password)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n User user = new User();\n user.setName(name);\n user.setEmail(email.toLowerCase());\n user.setGender(gender);\n user.setPassword(password);\n FirebaseDatabase.getInstance().getReference(\"Users\")\n .child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(context, \"Authentication Success.\",\n Toast.LENGTH_LONG).show();\n view.redirectToLogin();\n } else {\n Toast.makeText(context, \"Authentication Failed.\",\n Toast.LENGTH_LONG).show();\n }\n }\n });\n } else {\n Log.w(TAG, \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(context, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }", "private void signup(final String email, String password) {\n firebaseAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()) {\n databaseRef.child(firebaseAuth.getCurrentUser().getUid()).child(\"email\").setValue(email);\n startActivity(new Intent(getBaseContext(), ShoppingActivity.class));\n setResult(1);\n finish();\n } else {\n alert(task.getException().getMessage());\n }\n }\n });\n }", "@Override\n public void onClick(View v) {\n\n String Id = FCMdatabase.push().getKey();\n residentUser user = new residentUser(Id.toString(), txtusername.getText().toString(), txtpassword.getText().toString(), \"\");\n FCMdatabase.child(Id).setValue(user);\n Toast.makeText(getContext(), \"user added successfully\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (!task.isSuccessful()) {\n Toast.makeText(LoginActivity.this,\n getResources().getString\n (R.string.login_wrong_combination_error)\n ,Toast.LENGTH_LONG).show();\n }\n\n else {\n // else check if a profile exists for the user, if not create one\n\n // get current user\n final FirebaseUser user = mFirebaseAuth.getCurrentUser();\n\n // Attach a listener to read the data\n databaseReference.child(user.getUid())\n .addListenerForSingleValueEvent(\n new ValueEventListener() {\n\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n User userInfo = dataSnapshot.getValue(User.class);\n\n // null make a new one\n if (userInfo == null)\n {\n userInfo = new User();\n\n // update database using user id\n databaseReference.child\n (user.getUid()).setValue(userInfo);\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n Toast.makeText(LoginActivity.this,\n getResources().getString(R.string.db_error_text)\n + databaseError.getCode(),\n Toast.LENGTH_LONG).show();\n }\n });\n }\n }", "public void SignUp2(View view){\n\n mFirebaseAuth.createUserWithEmailAndPassword(EditEmail.getText().toString(),EditPass.getText().toString())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n saveUser(EditFirstName.getText().toString(),EditLastName.getText().toString(),EditEmail.getText().toString(),SelectSpinner.getSelectedItem().toString());\n mUserDatabaseReference.push().setValue(mClassUser);\n EditFirstName.setText(\"\");\n EditLastName.setText(\"\");\n EditEmail.setText(\"\");\n EditPass.setText(\"\");\n\n if (!task.isSuccessful()) {\n// Toast.makeText(ActivitySignup.this, \"failed to sign up\",\n// Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n\n }", "private void writeNewUser(String name,String email,String password) {\n mDatabase.child(\"User\").child(name).child(\"Email\").setValue(email);\n mDatabase.child(\"User\").child(name).child(\"Password\").setValue(password);\n }", "public void createAccount(final String userName , final String email , String password){\n //checking if user input is not empty\n\n\n if(userName!=null && email!=null && password!=null){\n\n\n progressBar.setVisibility(View.VISIBLE);\n\n //setting up new user ----- see assistant\n firebaseAuth.createUserWithEmailAndPassword(email , password)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n\n //onCopletion of user sign in\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n // safe check if was sussesfull\n if(task.isSuccessful()) {\n //Maping a user on database\n currentUser = firebaseAuth.getCurrentUser() ;\n assert currentUser != null;\n final String userId = currentUser.getUid();\n // creating a hashmap to map\n\n Map<String,String> userObj = new HashMap<>() ;\n\n userObj.put(\"userId\", userId) ;\n userObj.put(\"userName\" , userName) ;\n\n collectionReference.add(userObj)\n .addOnSuccessListener(new OnSuccessListener<DocumentReference>() {\n @Override\n public void onSuccess(DocumentReference documentReference) {\n //Toast.makeText(CreateAccActivity.this,\"onSucess\",Toast.LENGTH_LONG).show();\n\n Log.d(\"hello\",\"sussess\") ;\n documentReference.get()\n .addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\n @Override\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\n\n //if(!Objects.requireNonNull(task.getResult()).exists()){\n\n //Log.d(\"hello\",\"sussess\") ;\n progressBar.setVisibility(View.INVISIBLE);\n\n //Toast.makeText(CreateAccActivity.this,userName,Toast.LENGTH_LONG).show();\n\n\n String name = Objects.requireNonNull(task.getResult()).getString(\"userName\") ;\n\n journalApi journalApi = new journalApi() ;\n util.journalApi.getInstance().setUserID(userId);\n util.journalApi.getInstance().setUserName(userName);\n\n //Toast.makeText(CreateAccActivity.this,name,Toast.LENGTH_LONG).show();\n\n Log.d(\"hello\",userName) ;\n Intent intent = new Intent(CreateAccActivity.this\n ,PostJournalActivity.class) ;\n\n intent.putExtra(\"username\",name);\n intent.putExtra(\"userid\",userId) ;\n\n startActivity(intent);\n\n\n }\n /*else{\n progressBar.setVisibility(View.INVISIBLE);\n }*/\n\n\n });\n\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(CreateAccActivity.this\n ,\"error\" , Toast.LENGTH_LONG).show();\n }\n });\n\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n\n Toast.makeText(CreateAccActivity.this,\"Something Went wrong\"+e\n ,Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.INVISIBLE);\n\n }\n });\n\n }\n else{\n\n Toast.makeText(CreateAccActivity.this,\"All the Fields are Requoired\",Toast.LENGTH_LONG).show();\n }\n\n }", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "private void writeNewUser(String userId, String name, String email) {\n User user = new User(name, email);\n\n mDatabase.child(\"users\")\n .child(userId)\n .child(\"Name\").setValue(name);\n\n mDatabase.child(\"users\")\n .child(userId)\n .child(\"Email\").setValue(email);\n\n\n }", "private void registerUser(String email, String passwd){\n\n mAuth.createUserWithEmailAndPassword(email, passwd)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n String key = \"\";\n //checking if success\n if(task.isSuccessful()){\n key = task.getResult().getUser().getUid();\n toastMessage(\"seccuss here \"+key);\n String name = \"\";\n String phone = \"\";\n String c = String.valueOf(spinner.getSelectedItem());\n Classe classe = new Classe(c);\n name = nom.getText().toString();\n phone = tel.getText().toString();\n UserInformation U = new UserInformation(name,phone,classe);\n // toastMessage(\"hello uid \"+Useruid);\n myRef.child(\"users\").child(key).setValue(U);\n /* sharedPref = getApplicationContext().getSharedPreferences(Name, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(Key, key);\n editor.apply();*/\n\n }else{\n toastMessage(\"Failed\"); }\n\n\n }\n });\n /*sharedPref = getApplicationContext().getSharedPreferences(Name, MODE_PRIVATE);\n uid = sharedPref.getString(Key, null);\n // toastMessage(\"hello thoast \"+uid);\n return uid ;*/\n }", "String addAccount(UserInfo userInfo);", "public void addAccount(String user, String password);", "private void saveData() {\n firebaseUser = firebaseAuth.getInstance().getCurrentUser();\n String uID = firebaseUser.getUid();\n\n //Get auth credentials from the user for re-authentication\n credential = EmailAuthProvider.getCredential(mEmailField, mPassField);\n\n\n final DatabaseReference userDatabase = firebaseDatabase.getInstance().getReference().child(\"users\").child(uID);\n //Get the value of edit text\n editTextValue = changeFieldEt.getText().toString().trim();\n //Check whether edit text is empty\n if (!TextUtils.isEmpty(editTextValue)) {\n //if change name\n if (mNameField.equals(\"name\")) {\n UserProfileChangeRequest userProfileChangeRequest = new UserProfileChangeRequest.Builder()\n .setDisplayName(editTextValue).build();\n firebaseUser.updateProfile(userProfileChangeRequest).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.i(\"PROFILE\", \"User profile updated.\");\n updateDatabase(userDatabase);\n spotsDialog.dismiss();\n }\n }\n });\n }//if change password\n else if (mNameField.equals(\"password\")) {\n\n firebaseUser.reauthenticate(credential)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n firebaseUser.updatePassword(editTextValue).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.i(\"PASSWORD\", \"User password updated.\");\n updateDatabase(userDatabase);\n } else {\n Log.i(\"PASSWORD\", \"User cannot updated.\");\n Utility.MakeLongToastToast(activity, \"Password must have more than 7 characters\");\n spotsDialog.dismiss();\n }\n }\n });\n } else {\n Log.i(\"AUTH\", \"Error auth failed\");\n }\n }\n });\n }//if change email\n else if (mNameField.equals(\"email\")) {\n firebaseUser.reauthenticate(credential)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n firebaseUser.updateEmail(editTextValue).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.i(\"EMAIL\", \"User email address updated.\");\n updateDatabase(userDatabase);\n } else {\n Utility.MakeLongToastToast(activity, \"Cannot Updated. Please try another name \");\n spotsDialog.dismiss();\n }\n }\n });\n } else {\n Log.i(\"AUTH\", \"Error auth failed\");\n }\n }\n });\n\n }\n\n\n } else {\n Utility.MakeLongToastToast(getActivity(), \"Please enter your change.\");\n spotsDialog.dismiss();\n }\n }", "private void Register(String mailSTR, String passwordSTR, String fNameSTR, String lNameSTR, String citySTR, String phoneNumberSTR) throws Exception {\n mAuth.createUserWithEmailAndPassword(mailSTR, passwordSTR)\n .addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n final Map<String, Object>[] dataToSave = new Map[]{new HashMap<String, Object>()};\n dataToSave[0].put(constants.FIRST_NAME, fNameSTR);\n dataToSave[0].put(constants.SEC_NAME, lNameSTR);\n dataToSave[0].put(constants.CITY, citySTR);\n dataToSave[0].put(constants.EMAIL, mailSTR);\n dataToSave[0].put(constants.PHONE, phoneNumberSTR);\n\n\n\n FirebaseDatabase.getInstance().getReference(constants.DOC_REF_USERS)\n //here we creating users folder in real time data baes , getting uid from user and storing the data in folder named by id\n .child(Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getUid())\n .setValue(dataToSave[0]).addOnCompleteListener(task1 -> {\n if (task1.isSuccessful()) {\n Toast.makeText(register3.this,\n R.string.register_toast_success, Toast.LENGTH_LONG).show();\n {//adds all new data for newely registered clients\n dayTime dtDEF = new dayTime(0, 0, 23, 59);//default for first time\n Gson gson = new Gson();\n SharedPreferences sp = getSharedPreferences(constants.SHARED_PREFS,\n Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n String dayDEF = gson.toJson(dtDEF);\n Map<String, String> docData = new HashMap<>();\n for (String day : constants.daysNames) {\n docData.put(day, dayDEF);\n editor.putString(day, dayDEF);\n }\n docData.put(constants.rangeChoice, \"\" + 10.0);\n editor.putFloat(constants.rangeChoice, (float) 10.0);\n\n docData.put(constants.SHARED_PREFS_LOCATION, constants.CITY);\n editor.putString(constants.SHARED_PREFS_LOCATION, constants.CITY);\n editor.putBoolean(\"sync\",true);\n FirebaseAuth userIdentifier = FirebaseAuth.getInstance();\n String UID = userIdentifier.getCurrentUser().getUid();\n DocumentReference DRF = FirebaseFirestore.getInstance()\n .document(constants.DOC_REF_USERS+\"/\" + UID);\n final boolean[] success = {true};\n final Exception[] failToRet = new Exception[1];\n DRF.set(docData).addOnFailureListener(e -> {\n success[0] = false;\n failToRet[0] = e;\n });\n if (!success[0]) {\n // show/make log for case of failure\n }\n editor.apply();\n\n }\n }\n });\n\n\n }\n\n }).addOnFailureListener(e -> {\n try {\n throw new Exception(constants.FAILED_REGISTER);\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n });\n\n\n }", "private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }", "public void addUserToFirestore() {\n if (isSignedIn()) {\n getUserTask().addOnCompleteListener(\n new OnCompleteListener<DocumentSnapshot>()\n {\n @Override\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\n if (task.isSuccessful() && !task.getResult().exists()) {\n setUser(userMap(false));\n setAnalysis(analysisMap(new ArrayList<String>()));\n setSlouches(slouchMap(new ArrayList<Date>(), new ArrayList<Double>()));\n }\n }\n });\n }\n }", "private void Register(String mailSTR, String passwordSTR, String fNameSTR, String lNameSTR, String citySTR, String phoneNumberSTR) throws Exception {\n mAuth.createUserWithEmailAndPassword(mailSTR, passwordSTR)\n .addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n final Map<String, Object>[] dataToSave = new Map[]{new HashMap<String, Object>()};\n dataToSave[0].put(constants.FIRST_NAME, fNameSTR);\n dataToSave[0].put(constants.SEC_NAME, lNameSTR);\n dataToSave[0].put(constants.CITY, citySTR);\n dataToSave[0].put(constants.EMAIL, mailSTR);\n dataToSave[0].put(constants.PHONE, phoneNumberSTR);\n dataToSave[0].put(constants.VOLUNTEER, \"false\");\n\n\n FirebaseDatabase.getInstance().getReference(constants.DOC_REF_USERS)\n //here we creating users folder in real time data baes , getting uid from user and storing the data in folder named by id\n .child(Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getUid())\n .setValue(dataToSave[0]).addOnCompleteListener(task1 -> {\n if (task1.isSuccessful()) {\n Toast.makeText(register2.this,\n R.string.register_toast_success, Toast.LENGTH_LONG).show();\n {//adds all new data for newely registered clients\n dayTime dtDEF = new dayTime(0, 0, 23, 59);//default for first time\n Gson gson = new Gson();\n SharedPreferences sp = getSharedPreferences(constants.SHARED_PREFS,\n Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n String dayDEF = gson.toJson(dtDEF);\n Map<String, String> docData = new HashMap<>();\n for (String day : constants.daysNames) {\n docData.put(day, dayDEF);\n editor.putString(day, dayDEF);\n }\n docData.put(constants.rangeChoice, \"\" + 10.0);\n editor.putFloat(constants.rangeChoice, (float) 10.0);\n\n docData.put(constants.SHARED_PREFS_LOCATION, constants.SET_CITY);\n editor.putString(constants.SHARED_PREFS_LOCATION, constants.SET_CITY);\n\n FirebaseAuth userIdentifier = FirebaseAuth.getInstance();\n String UID = userIdentifier.getCurrentUser().getUid();\n DocumentReference DRF = FirebaseFirestore.getInstance()\n .document(constants.DOC_REF_USERS+\"/\" + UID);\n final boolean[] success = {true};\n final Exception[] failToRet = new Exception[1];\n DRF.set(docData).addOnFailureListener(e -> {\n success[0] = false;\n failToRet[0] = e;\n });\n if (!success[0]) {\n // show/make log for case of failure\n }\n editor.apply();\n\n }\n }\n });\n\n\n }\n\n }).addOnFailureListener(e -> {\n try {\n throw new Exception(constants.FAILED_REGISTER);\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n });\n\n\n }", "private void insertUserDetails() {\n // Progress dialog for better user experience\n final ProgressDialog progressDialog = new ProgressDialog(\n NewAccountActivity.this,\n R.style.LoginTheme_Dark_Dialog);\n progressDialog.setIndeterminate(true);\n progressDialog.setMessage(getString(R.string.creating_account));\n progressDialog.show();\n // Prevent Progress dialog from dismissing when user click on rest of the screen\n progressDialog.setCancelable(false);\n\n // Get the text provided by user\n String name = mUserName.getText().toString().trim();\n String email = mUserEmail.getText().toString().trim();\n String password = mUserPassword.getText().toString().trim();\n String tableName = email.replace(\".\", \"_\");\n tableName = tableName.replace(\"@\", \"_\");\n tableName = tableName.replace(\"-\", \"_\");\n\n // Content value object to insert data entered by user into database\n final ContentValues contentValues = new ContentValues();\n contentValues.put(ItemEntry.CREDENTIALS_TABLE_COLUMN_USER_NAME, name);\n contentValues.put(ItemEntry.CREDENTIALS_TABLE_COLUMN_EMAIL, email);\n contentValues.put(ItemEntry.CREDENTIALS_TABLE_COLUMN_PASSWORD, password);\n contentValues.put(ItemEntry.CREDENTIALS_TABLE_USER_INVENTORY_TABLE, tableName);\n\n // Run AsyncTask to add data into database in background thread,\n // without disturbing UI thread\n AsyncTask.execute(new Runnable() {\n @Override\n public void run() {\n // Insert data into Credentials database\n Uri uri = getContentResolver().insert(ItemEntry.CREDENTIALS_CONTENT_URI, contentValues);\n try {\n // Put thread to sleep for 2seconds to show user a progress dialog\n Thread.sleep(2000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n progressDialog.dismiss();\n // If inserting data was successful, finish the activity\n if (uri != null) {\n finish();\n }\n }\n });\n }", "@Override\n public void onSuccess(AuthResult authResult) {\n userWAPFirebase.create(newUser, firebaseAuth.getCurrentUser().getUid()).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(TAG, \"User \" + newUser.getUsername() + \" has been successfully created\");\n Toast.makeText(SignUpActivity.this, \"Sign up successful!\", Toast.LENGTH_SHORT).show();\n\n //Go back to Login Activity\n Intent loginIntent = new Intent(SignUpActivity.this, LoginActivity.class);\n loginIntent.putExtra(PASSWORD_KEY, etPasswordSignup.getText().toString());\n loginIntent.putExtra(EMAIL_KEY, newUser.getEmail());\n startActivity(loginIntent);\n }\n });\n }", "public void onAccountCreate()\n {\n //Object ne=new Object();\n Log.d(\"stupid\", \"onAccountCreate: \");\n fName=firstName.getText().toString();\n lName=lastName.getText().toString();\n con=contact.getText().toString();\n addr=address.getText().toString();\n bGrp=bloodGroup.getText().toString();\n\n mRef2 = FirebaseDatabase.getInstance().getReference().child(\"donordata\").getRef();\n\n Map<String,Object> donorMap=new HashMap<String, Object>();\n Map<String,Object> x= new HashMap<String, Object>();\n\n\n String id= mRef2.push().getKey();\n Log.d(\"keyTAG\", \"onAccountCreate: \"+mRef2.push().getKey());\n x.put(\"id\",id);\n x.put(\"firstname\", fName);\n x.put(\"lastname\", lName);\n x.put(\"address\", addr);\n x.put(\"bloodgroup\", bGrp);\n x.put(\"contact\", con);\n\n\n\n donorMap.put(fName,x);\n\n mRef2.updateChildren(donorMap);\n Toast.makeText(BloodDonorsActivity.this,\"Your account has been successfully created. Thank you!\",Toast.LENGTH_LONG).show();\n Intent backToLogin=new Intent(BloodDonorsActivity.this,LoginActivity.class);\n startActivity(backToLogin);\n\n\n //mRef2.setValue(donorMap);\n\n\n\n //Toast.makeText(BloodDonorsActivity.this, \"Your details are not valid!\", Toast.LENGTH_LONG).show();\n\n\n\n }", "private void saveSettings(){\n // get current user from shared preferences\n currentUser = getUserFromSharedPreferences();\n\n final User newUser = currentUser;\n Log.i(\"currentUser name\",currentUser.getUsername());\n String username = ((EditText)findViewById(R.id.usernameET)).getText().toString();\n\n if(\"\".equals(username)||username==null){\n Toast.makeText(getApplicationContext(),\"Failed to save, user name cannot be empty\",Toast.LENGTH_LONG).show();\n return;\n }\n\n newUser.setUsername(username);\n\n // update user data in firebase\n Firebase.setAndroidContext(this);\n Firebase myFirebaseRef = new Firebase(Config.FIREBASE_URL);\n\n // set value and add completion listener\n myFirebaseRef.child(\"users\").child(newUser.getFireUserNodeId()).setValue(newUser,new Firebase.CompletionListener() {\n @Override\n public void onComplete(FirebaseError firebaseError, Firebase firebase) {\n if (firebaseError != null) {\n\n Toast.makeText(getApplicationContext(),\"Data could not be saved. \" + firebaseError.getMessage(),Toast.LENGTH_SHORT).show();\n } else {\n // if user info saved successfully, then save user image\n uploadPhoto();\n Toast.makeText(getApplicationContext(),\"User data saved successfully.\",Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }", "private void putFacbookUserInfo(AccessToken token)\n {\n final ProgressDialog progressDialog= new ProgressDialog(this);\n GraphRequest request = GraphRequest.newMeRequest(\n token,\n new GraphRequest.GraphJSONObjectCallback() {\n @Override\n public void onCompleted(\n JSONObject object,\n GraphResponse response) {\n try {\n String fullName=object.getString(\"first_name\")+\" \"+\n object.getString(\"last_name\");\n String userName=object.getString(\"name\");\n String email=object.getString(\"email\");\n String currentUserId =FirebaseAuth.getInstance().getCurrentUser().getUid();\n DatabaseReference userRef= FirebaseDatabase.getInstance().getReference().child(\"Users\");\n HashMap<String,Object> userMap= new HashMap<>();\n userMap.put(\"uid\",currentUserId);\n userMap.put(\"fullname\",fullName);\n userMap.put(\"username\",userName);\n userMap.put(\"email\",email);\n userMap.put(\"bio\",\"hey I am using insta\");\n userMap.put(\"image\",\"https://firebasestorage.googleapis.com/v0/b/myins-7aa34.appspot.com/o/default_images%2Fprofile.png?alt=media&token=b6eb9810-3c06-41d1-827c-c79aabd54139\");\n userRef.child(currentUserId).setValue(userMap).addOnCompleteListener( new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if(task.isSuccessful())\n {\n progressDialog.dismiss();\n Toast.makeText(SignInActivity.this,\"Account has been created successfully\",Toast.LENGTH_LONG).show();\n Intent intent =new Intent(SignInActivity.this,MainActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n finish();\n }\n else\n {\n String messaqge =task.getException().toString();\n Toast.makeText(SignInActivity.this,\"Error :\"+messaqge,Toast.LENGTH_LONG).show();\n FirebaseAuth.getInstance().signOut();\n progressDialog.dismiss();\n }\n }\n });\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n });\n Bundle parameters = new Bundle();\n parameters.putString(\"fields\", \"id,name,email,first_name,last_name\");\n request.setParameters(parameters);\n request.executeAsync();\n }", "public static void writeNewUser(User user) {\n DatabaseReference usersRef = FirebaseDatabase.getInstance().getReference();\n FirebaseAuth mAuth = FirebaseAuth.getInstance();\n usersRef.child(\"users\").child(mAuth.getUid()).setValue(user);\n }", "public void onCreateAccountPressed(final View view) throws FirebaseAuthUserCollisionException{\n username=mEditTextUsernameCreate.getText().toString();\n email=mEditTextEmailCreate.getText().toString();\n password=mEditTextPasswordCreate.getText().toString();\n\n if(!isEmailValid(email) || !isUserNameValid(username) || !isPasswordValid(password)){\n return;\n }\n mAuthProgressDialog.show();\n final FirebaseAuth auth=FirebaseAuth.getInstance();\n final DatabaseReference ref=mReference.child(Constants.FIREBASE_LOCATION_USER_ACCOUNTS).child(Utils.encodeEmail(email));\n auth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if (task.isSuccessful()){\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n mAuthProgressDialog.dismiss();\n ref.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.getValue()==null){\n User user=new User(username, email);\n ref.setValue(user);\n }\n else {\n showErrorToast(getResources().getString(R.string.error_email_taken));\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n Log.e(LOG_TAG, databaseError.getMessage());\n }\n });\n onSignInPressed(view);\n\n }\n else {\n mAuthProgressDialog.dismiss();\n Log.d(TAG, \"createUserWithEmail:onFailure:\" + task.getException());\n showErrorToast(task.getException().getMessage());\n\n }\n }\n\n\n });\n }", "public void createNewUser(){\n Users user = new Users(winnerName);\n mDatabase.child(\"users\").child(winnerName).setValue(user);\n Log.d(\"DB\", \"Writing new user \" + winnerName + \" to the database\");\n\n Toast.makeText(this, \"Scoreboard has been updated!\", Toast.LENGTH_SHORT).show();\n\n endGame();\n\n\n\n }", "@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n progressBar.setVisibility(View.GONE);\n if (!task.isSuccessful()) {\n // there was an error\n if (password.length() < 6) {\n passwordW.setError(getString(R.string.minimum_password));\n } else {\n Toast.makeText(SignUpActivity.this, getString(R.string.auth_failed), Toast.LENGTH_LONG).show();\n }\n } else {\n\n FirebaseUser user = auth.getCurrentUser();\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()\n .setDisplayName(dpName)\n .build();\n\n user.updateProfile(profileUpdates)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(SignUpActivity.this, \"User Created! Welcome to Udghosh.\", Toast.LENGTH_LONG).show();\n }\n else {\n Toast.makeText(SignUpActivity.this, \"Cannot connect to servers right now.\", Toast.LENGTH_LONG).show();\n }\n }\n });\n mDatabase.child(\"app\").child(\"users\").child(user.getUid()).setValue(phoneNumber);\n\n Intent intent = new Intent(SignUpActivity.this, HomeActivity.class);\n startActivity(intent);\n finish();\n }\n }", "public void registerUser(String email, String password){\n fbAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n Log.d(TAG, \"createUserWithEmail:success\");\n FirebaseUser user = fbAuth.getCurrentUser();\n updateUI(user);\n Toast.makeText(Signup.this, \"Registration success.\",\n Toast.LENGTH_SHORT).show();\n } else {\n // If sign in fails, display a message to the user.\n Log.w(TAG, \"createUserWithEmail:failure\", task.getException());\n Toast.makeText(Signup.this, \"Registration failed.\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }\n });\n }", "public void updateUser(int uid, String name, String phone, String email, String password, int money, int credit);", "@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n userProfileChangeRequest = new UserProfileChangeRequest.Builder().setDisplayName(name).build();\n firebaseUser = FirebaseAuth.getInstance().getCurrentUser();\n firebaseUser.updateProfile(userProfileChangeRequest);\n UsersInfo user = new UsersInfo(name, phone, mail, \"\");\n database.child(userAuth.getCurrentUser().getUid()).setValue(user);\n userRegister.onRegisterSuccess();\n } else {\n if (task.getException().getMessage().equals(\"The email address is already in use by another account.\")) {\n userRegister.onMailExistedError();\n }\n if (task.getException().getMessage().equals(\"The email address is badly formatted.\")) {\n userRegister.onMailFormatError();\n }\n }\n }", "public String registerUser(ChatRoomUser newUser) throws Exception{\n Firebase roomsNodeRef = fire_db.child(\"Users\");\n Firebase newNodeRef = roomsNodeRef.push();\n if (newUser != null)\n try {\n newNodeRef.setValue(newUser,new Firebase.CompletionListener() {\n @Override\n public void onComplete(FirebaseError firebaseError, Firebase firebase) {\n if (firebaseError != null) {\n System.out.println(\"Data could not be saved. \" + firebaseError.getMessage());\n } else {\n System.out.println(\"Data saved successfully.\");\n }\n }\n });\n String postId = newNodeRef.getKey();\n return postId;\n }catch (Exception exc){\n throw new Exception(\"Something failed.\", new Throwable(String.valueOf(Exception.class)));\n }\n return null;\n }", "private void createAccount() {\n mAuth.createUserWithEmailAndPassword(mTextEmail.getText().toString(), mTextPassword.getText().toString()).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n if(!task.isSuccessful()){\n Toast.makeText(SignInActivity.this, \"Account creation failed!\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(SignInActivity.this, \"Account creation success!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "private void saveUserInformation() {\n name.setText(nameInput.getText().toString());\n\n if (name.getText().toString().isEmpty()) {\n name.setError(\"Name required\");\n name.requestFocus();\n return;\n }\n\n FirebaseUser user = mAuth.getCurrentUser();\n if (user != null) {\n if (isBname()) {\n updateName(user);\n }\n if (isBtitle()) {\n updateTitle(user);\n }\n }\n }", "private void registerNewUser() {\n progressBar.setVisibility(View.VISIBLE);\n\n final String email, password, displayName;\n email = emailTV.getText().toString();\n password = passwordTV.getText().toString();\n displayName = nameTV.getText().toString();\n\n //Make sure user has entered details for all fields.\n if(TextUtils.isEmpty(displayName)){\n Toast.makeText(getApplicationContext(), \"Please enter username.\", Toast.LENGTH_LONG).show();\n return;\n }\n if (TextUtils.isEmpty(email)) {\n Toast.makeText(getApplicationContext(), \"Please enter email.\", Toast.LENGTH_LONG).show();\n return;\n }\n if (TextUtils.isEmpty(password)) {\n Toast.makeText(getApplicationContext(), \"Please enter password.\", Toast.LENGTH_LONG).show();\n return;\n }\n if(filePath == null){\n Toast.makeText(getApplicationContext(), \"Please select an image and try again.\", Toast.LENGTH_LONG).show();\n return;\n }\n //Updates Firebase to register a new user with email and password\n //also uploads image to Firebase for user account.\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n Uri userUri;\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n Toast.makeText(getApplicationContext(), \"Registration successful!\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n //Create a new user with name and email address.\n User newUser = new User(displayName, email , getLocationAddress(), loc.getLatitude(), loc.getLongitude());\n newUser.writeUser(FirebaseAuth.getInstance().getCurrentUser().getUid());\n //Update user profile on Firebase to add a display name.\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder().setDisplayName(displayName).build();\n mAuth.getCurrentUser().updateProfile(profileUpdates);\n\n if (filePath != null) {\n //displaying progress dialog while image is uploading\n Log.e(\"FilePath: \", filePath.toString());\n Log.e(\"Current User: \", mAuth.getCurrentUser().getEmail());\n final StorageReference sRef = mStorageReference.child(\"users/\" + mAuth.getCurrentUser().getUid());\n //Get image from users phone media.\n Bitmap bmpImage = null;\n try {\n bmpImage = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n //Compress image size.\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bmpImage.compress(Bitmap.CompressFormat.JPEG, 25, baos);\n byte[] data = baos.toByteArray();\n //adding the file to firebase reference\n sRef.putBytes(data)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n sRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n final Uri downloadUri = uri;\n userUri = downloadUri;\n //Upload image file to Firebase database.\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference dbRef = database.getReference().child(\"users\").child(mAuth.getCurrentUser().getUid()).child(\"photoUri\");\n Log.e(\"user download url: \", userUri.toString());\n dbRef.setValue(userUri.toString());\n //displaying success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n //Add user dp url to user class in Firebase.\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder().setPhotoUri(downloadUri).build();\n mAuth.getCurrentUser().updateProfile(profileUpdates);\n }\n });\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n } else {\n Toast.makeText(getApplicationContext(), \"Select a picture and try again.\", Toast.LENGTH_SHORT).show();\n }\n Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);\n startActivity(intent);\n }\n else {\n Toast.makeText(getApplicationContext(), \"Registration failed! Please try again later\", Toast.LENGTH_LONG).show();\n progressBar.setVisibility(View.GONE);\n }\n }\n });\n }", "public void onCreateAccountPressed(View view) {\n\n\n mUserName = mEditTextUsernameCreate.getText().toString();\n mUserEmail = mEditTextEmailCreate.getText().toString().toLowerCase();\n mPassword = mEditTextPasswordCreate.getText().toString();\n\n /**\n * Check that email and user name are okay\n */\n boolean validEmail = isEmailValid(mUserEmail);\n boolean validUserName = isUserNameValid(mUserName);\n boolean validPassword = isPasswordValid(mPassword);\n if (!validEmail || !validUserName || !validPassword) return;\n /**\n * If everything was valid show the progress dialog to indicate that\n * account creation has started\n */\n mAuthProgressDialog.show();\n\n\n // [START create_user_with_email]\n mAuth.createUserWithEmailAndPassword(mUserEmail, mPassword)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(LOG_TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n Toast.makeText(CreateAccountActivity.this, R.string.auth_failed,\n Toast.LENGTH_SHORT).show();//error message\n //showErrorToast(\"createUserWithEmail : \"+task.isSuccessful());\n }\n\n // [START_EXCLUDE]\n mAuthProgressDialog.dismiss();\n Intent intent = new Intent(CreateAccountActivity.this, LoginActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n finish();\n // [END_EXCLUDE]\n //end\n }\n });\n // [END create_user_with_email]\n\n\n\n /**\n * Create new user with specified email and password\n */\n /*mFirebaseRef.createUser(mUserEmail, mPassword, new Firebase.ValueResultHandler<Map<String, Object>>() {\n @Override\n public void onSuccess(Map<String, Object> result) {\n Dismiss the progress dialog\n mAuthProgressDialog.dismiss();\n Log.i(LOG_TAG, getString(R.string.log_message_auth_successful));\n }\n\n @Override\n public void onError(FirebaseError firebaseError) {\n *//* Error occurred, log the error and dismiss the progress dialog *//*\n Log.d(LOG_TAG, getString(R.string.log_error_occurred) +\n firebaseError);\n mAuthProgressDialog.dismiss();\n *//* Display the appropriate error message *//*\n if (firebaseError.getCode() == FirebaseError.EMAIL_TAKEN) {\n mEditTextEmailCreate.setError(getString(R.string.error_email_taken));\n } else {\n showErrorToast(firebaseError.getMessage());\n }\n\n }\n });*/\n }", "public void addUser(User u){\n\r\n userRef.child(u.getUuid()).setValue(u);\r\n\r\n DatabaseReference zipUserReference;\r\n DatabaseReference zipNotifTokenReference;\r\n List<String> zipList = u.getZipCodes();\r\n\r\n for (String zipCode : zipList) {\r\n zipUserReference = baseRef.child(zipCode).child(ZIPCODE_USERID_REFERENCE_LIST);\r\n // Add uuid to zipcode user list\r\n zipUserReference.child(u.getUuid()).setValue(u.getUuid());\r\n\r\n // Add notifToken to list\r\n zipNotifTokenReference = baseRef.child(zipCode).child(ZIPCODE_NOTIFICATION_TOKENS_LIST);\r\n zipNotifTokenReference.child(u.getNotificationToken()).setValue(u.getNotificationToken());\r\n\r\n }\r\n }", "private void addToRealDB(String GoogleId){\n this.newUser.setGOOGLE_ID(GoogleId);\n dbRootRef.child(USERS).child(this.newUser.getGOOGLE_ID()).setValue(this.newUser);\n dbRootRef.child(USERS_NOTES).child(this.newUser.getGOOGLE_ID()).child(\"numOfNotesInAllTime\").setValue(\"0\");\n }", "private void updateUserAccount() {\n final UserDetails details = new UserDetails(HomeActivity.this);\n //Get Stored User Account\n final Account user_account = details.getUserAccount();\n //Read Updates from Firebase\n final Database database = new Database(HomeActivity.this);\n DatabaseReference user_ref = database.getUserReference().child(user_account.getUser().getUser_id());\n user_ref.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n //Read Account Balance\n String account_balance = dataSnapshot.child(Database.USER_ACC_BALANCE).getValue().toString();\n //Read Expire date\n String expire_date = dataSnapshot.child(Database.USER_ACC_SUB_EXP_DATE).getValue().toString();\n //Read Bundle Type\n String bundle_type = dataSnapshot.child(Database.USER_BUNDLE_TYPE).getValue().toString();\n //Attach new Values to the Account Object\n user_account.setBalance(Double.parseDouble(account_balance));\n //Attach Expire date\n user_account.setExpire_date(expire_date);\n //Attach Bundle Type\n user_account.setBundle_type(bundle_type);\n //Update Local User Account\n details.updateUserAccount(user_account);\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n //No Implementation\n }\n });\n }", "private void addAccount(Account account)\n\t {\n\t\t if(accountExists(account)) return;\n\t\t \n\t\t ContentValues values = new ContentValues();\n\t\t values.put(DatabaseContract.AccountContract.COLUMN_NAME_USERNAME, account.getUsername());\n\t\t values.put(DatabaseContract.AccountContract.COLUMN_NAME_BALANCE, account.getBalance());\n\t\t values.put(DatabaseContract.AccountContract.COLUMN_NAME_AUTH_TOKEN, account.getAuthenticationToken());\n\t\t \n\t\t db.insert(DatabaseContract.AccountContract.TABLE_NAME,\n\t\t\t\t null,\n\t\t\t\t values);\n\t\t \n\t }", "private void CreateUser(){\n String uid = currUser.getUid();\n Map<String, Object> userMap = new HashMap<>();\n\n //add the user details to the userMap\n userMap.put(\"car-make\", \"\");\n userMap.put(\"firstname\", \"firstname\");\n userMap.put(\"lastname\", \"lastname\");\n userMap.put(\"registration-no\", \"\");\n userMap.put(\"seats-no\", 0);\n userMap.put(\"user-email\", currUser.getEmail());\n userMap.put(\"user-id\", currUser.getUid());\n userMap.put(\"p-ride\", null);\n userMap.put(\"d-ride\", null);\n userMap.put(\"latitude\", null);\n userMap.put(\"longitude\", null);\n userMap.put(\"rating\", -1);\n userMap.put(\"amountOfRatings\", 0);\n userMap.put(\"ride-price\", null);\n\n //set the details into the database\n dataStore.collection(\"users\").document(uid)\n .set(userMap)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void v) {\n Log.d(TAG, \"User was added to the db\");\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(TAG, \"Exception: \", e);\n }\n });\n }", "void addUser(String uid, String firstname, String lastname, String pseudo);", "private void fillYourInfo(){\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n if (user != null) {\n // Name, email address, and profile photo Url\n String user_name = user.getDisplayName();\n String email = user.getEmail();\n Uri photoUrl = user.getPhotoUrl();\n\n // Check if user's email is verified\n boolean emailVerified = user.isEmailVerified();\n\n // The user's ID, unique to the Firebase project. Do NOT use this value to\n // authenticate with your backend server, if you have one. Use\n // FirebaseUser.getToken() instead.\n TextView UserName = findViewById(R.id.playername1);\n ImageView ProfilePic = findViewById(R.id.playerimg1);\n UserName.setText(user_name);\n if (photoUrl != null) {\n Picasso.with(this).load(photoUrl).into(ProfilePic);\n }\n }\n if (user == null){\n TextView UserName = findViewById(R.id.playername1);\n ImageView ProfilePic = findViewById(R.id.playerimg1);\n UserName.setText(getText(R.string.def_user));\n ProfilePic.setImageResource(R.drawable.def_icon);\n }\n }", "public void goClicked(View view){\n final String email=emailEditText.getText().toString();\n final String password=passwordEditText.getText().toString();\n\n\n mAuth.signInWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n //Sign in the user\n Log.i(\"Infograph\", \"Sign in was successful\");\n loginUser();\n Toast.makeText(MainActivity.this, \"Signed in successfully !\", Toast.LENGTH_SHORT).show();\n } else {\n //Sign up the user\n Log.i(\"Infograph\", \"Sign in was not successful, Attempting SignUp\");\n mAuth.createUserWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //Add to database\n DatabaseReference reference=database.getReference().child(\"users\").child(mAuth.getCurrentUser().getUid()).child(\"email\");\n\n reference.setValue(email);\n\n Log.i(\"Infograph\",\"Sign up was successful\");\n loginUser();\n Toast.makeText(MainActivity.this, \"Signed up successfully !\", Toast.LENGTH_SHORT).show();\n\n\n }else{\n Log.i(\"Infograph\",\"Sign up was not successful\");\n Toast.makeText(MainActivity.this, task.getException().getMessage(), Toast.LENGTH_SHORT).show();\n\n }\n }\n });\n }\n\n\n }\n });\n }", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.save_activity);\n\n fullname = (EditText)findViewById(R.id.fullname);\n uni = (EditText)findViewById(R.id.uni);\n save = (Button)findViewById(R.id.save);\n\n mAuth = FirebaseAuth.getInstance();\n database = FirebaseDatabase.getInstance(); // get database\n // db =(TextView) findViewById(R.id.db);\n\n FirebaseUser users = mAuth.getCurrentUser(); // current signed in user\n userId = users.getUid(); // Id of signed in user\n myRef= database.getReference(); //A reference to databse\n\n mAuthListener = new FirebaseAuth.AuthStateListener() { //It is auth listner means user signed in and then quite app and again resumem then he will remain signed in.\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user != null) {\n // User is signed in\n // Log.d(TAG, \"onAuthStateChanged:signed_in:\" + user.getUid());\n // toastMessage(\"Successfully signed in with: \" + user.getEmail());\n } else {\n // User is signed out\n // Log.d(TAG, \"onAuthStateChanged:signed_out\");\n // toastMessage(\"Successfully signed out.\");\n }\n // ...\n }\n };\n\n save.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String fname = fullname.getText().toString();\n String Uni = uni.getText().toString();\n User u = new User(fname,Uni);\n if(!fname.equals(\"\") && !Uni.equals(\"\"))\n {\n myRef.child(\"users\").child(userId).setValue(u);\n }\n }\n });\n\n\n }", "public void createUserInFirebase(String name, String email, String Uid) {\n User user = new User();\n user.setName(name);\n user.setEmail(email);\n mDatabase.child(\"users\").child(Uid).setValue(user);\n }", "private void setupFirebase(){\n FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();\n if (user!=null){\n databaseReference = firebaseDatabase.getReference(\"Users\").child(user.getUid()).child(\"teacher\");\n }\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Uri downloadUrl = taskSnapshot.getDownloadUrl();\n //push database\n User user = new User(id, String.valueOf(downloadUrl), username, mail, idMajor, gendle, startYear, pass);\n mDatabase.child(\"Users\").child(id).setValue(user);\n }", "public void mySaveInfo(View view){\n\n String fname = fName.getText().toString();\n String lname = lName.getText().toString();\n String my_address = address.getText().toString();\n\n // Checks field for empty or not\n if(isEmptyField(fName))return;\n if(isEmptyField(lName))return;\n if(isEmptyField(address))return;\n\n Map<String,Object> myMap = new HashMap<String,Object>();\n myMap.put(KEY_FNAME,fname);\n myMap.put(KEY_LNAME,lname);\n myMap.put(KEY_ADDRESS, my_address);\n myMap.put(\"role\", \"user\");\n\n /*\n By geting rid of the document, Firestore will generate a new Id each time a\n new user is created.\n */\n db.collection(\"users\").document(RegisteredUserID)\n .set(myMap).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(UserSignUp.this, \"User Saved\", Toast.LENGTH_SHORT).show();\n // This should go to the home screen if the user is succesfully entered\n startActivity(new Intent(UserSignUp.this,MainActivity.class));\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(UserSignUp.this, \"Error!\", Toast.LENGTH_SHORT).show();\n Log.d(TAG, e.toString());\n }\n });\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n for (DataSnapshot snapshot: dataSnapshot.getChildren()){\n if (snapshot.getKey().equals(currentUser)){\n Intent login = new Intent(getApplicationContext(), MainActivity.class);\n login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(login);\n }\n }\n Map<String, Object> user = new HashMap<String, Object>();\n user.put(\"username\", mAuth.getCurrentUser().getDisplayName());\n user.put(\"kilometer\", 0);\n user.put(\"points\", 0);\n user.put(\"number\", \"\");\n user.put(\"firstName\", \"\");\n user.put(\"lastName\", \"\");\n user.put(\"dob\", \"\");\n user.put(\"reward\", null);\n\n DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child(\"users\").child(currentUser);\n myRef.setValue(user);\n\n\n Intent freshGoogleLogin = new Intent(getApplicationContext(), MainActivity.class);\n freshGoogleLogin.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(freshGoogleLogin);\n\n }", "@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n\n saveUser save = new saveUser(registerEmailString, registerPassword);\n FirebaseDatabase.getInstance().getReference(\"Register\").child(FirebaseAuth.\n getInstance().getCurrentUser().getUid()).setValue(save).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if (task.isSuccessful()) {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Sign up successful\", Toast.LENGTH_SHORT).show();\n\n pleaseWait.setVisibility(View.GONE);//\n Intent bac = new Intent(Sign_Up.this, Sign_In.class);\n startActivity(bac);\n\n } else {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Email already exist error\", Toast.LENGTH_SHORT).show();\n pleaseWait.setVisibility(View.GONE);\n\n }\n }\n });\n } else {\n progressDialog.dismiss();\n Toast.makeText(Sign_Up.this, \"Error try again\", Toast.LENGTH_SHORT).show();\n pleaseWait.setVisibility(View.GONE);\n }\n }", "public void doDataAddToDb() {\n String endScore = Integer.toString(pointsScore);\r\n String mLongestWordScore = Integer.toString(longestWordScore);\r\n String date = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.US).format(new Date());\r\n Log.e(TAG, \"date\" + date);\r\n\r\n // creating a new user for the database\r\n User newUser = new User(userNameString, endScore, date, longestWord, mLongestWordScore); // creating a new user object to hold that data\r\n\r\n // add new node in database\r\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\r\n mDatabase.child(\"users\").child(userNameString).setValue(newUser);\r\n\r\n Log.e(TAG, \"pointsScore\" + pointsScore);\r\n Log.e(TAG, \"highestScore\" + highestScore);\r\n\r\n\r\n // if high score is achieved, send notification\r\n if (highestScore > pointsScore) {\r\n new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n sendMessageToNews();\r\n }\r\n }).start();\r\n }\r\n }", "@Override\n public void onError(FirebaseError firebaseError) {\n Log.d(TAG, \"New user creation Firebase error\");\n }", "private void CreateUserAccount(final String lname, String lemail, String lpassword, final String lphone, final String laddress, final String groupid, final String grouppass ){\n mAuth.createUserWithEmailAndPassword(lemail,lpassword).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //account creation successful\n showMessage(\"Account Created\");\n //after user account created we need to update profile other information\n updateUserInfo(lname, pickedImgUri,lphone, laddress, groupid, grouppass, mAuth.getCurrentUser());\n }\n else{\n //account creation failed\n showMessage(\"Account creation failed\" + task.getException().getMessage());\n regBtn.setVisibility(View.VISIBLE);\n loadingProgress.setVisibility(View.INVISIBLE);\n\n }\n }\n });\n }", "public void addUser(String name, String email, String uid, String created_at,String address,String number) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, name); // Name\n values.put(KEY_EMAIL, email); // Email\n values.put(KEY_UID, uid); // Email\n values.put(KEY_CREATED_AT, created_at); // Created At\n values.put(KEY_ADDRESS, address);\n values.put(KEY_NUMBER, number);\n\n // Inserting Row\n long id = db.insert(TABLE_USER, null, values);\n db.close(); // Closing database connection\n\n Log.d(TAG, \"New user inserted into sqlite: \" + id);\n }", "public void createUserAccount(UserAccount account);", "@Override\n public void onChildAdded(DataSnapshot snapshot, String previousChildKey) {\n DataBaseUsers user = snapshot.getValue(DataBaseUsers.class);\n //System.out.println(user.getEmail());\n userList.add(user);\n }", "private void callRegisterByEmailToGoogleFirebase(){\n mFirebaseAuth = FirebaseAuth.getInstance();\n\n String userEmail = mEmailAddress.getText().toString();\n String userPassword = mPassword.getText().toString();\n\n // create the user with email and password\n mFirebaseAuth.createUserWithEmailAndPassword(userEmail,userPassword).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n showBottomSnackBar(\"Corresponding Firebase User Created\");\n }else{\n showBottomSnackBar(\"Firebase User Creation Fails\");\n }\n\n replaceActivity(MainActivity.class, null);\n }\n });\n\n }", "void addUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_utilizador, user.getUser()); // Contact Name\n values.put(KEY_pass, user.getPass()); // Contact Phone\n values.put(KEY_Escola, user.getEscola());\n db.insert(tabela, null, values);\n db.close(); // Closing database connection\n }", "public void insertUser() {}", "void addAccount(Accounts account) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, account.getName());\n values.put(KEY_PASSWORD, account.getPassword());\n values.put(KEY_PH_NO, account.getPhoneNumber());\n values.put(KEY_EMAIL, account.getEmail());\n\n // Inserting Row\n db.insert(TABLE_ACCOUNTS, null, values);\n //2nd argument is String containing nullColumnHack\n db.close(); // Closing database connection\n }", "private void addemail() {\n //get email address entered by user.\n String emailaddress = email.getText().toString().trim();\n //get password entered by user.\n String pass = password.getText().toString().trim();\n //Create new child of user in db if both email and password is not empty.\n if (!(emailaddress.isEmpty() || pass.isEmpty())) {\n String id = emailaddress.split(\"@\")[0];\n User useremail = new User(id, emailaddress, pass, \"\",\"\");\n dblogin.child(id).setValue(useremail);\n Toast.makeText(this, \"User Registered\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(this, \"Please enter a valid email address to sign up\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n FirebaseUser usuarioActual = FirebaseAuth.getInstance().getCurrentUser();\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()\n .setDisplayName(name.getText().toString() + \" \" + lastname.getText().toString()).build();\n usuarioActual.updateProfile(profileUpdates);\n\n ref.child(projectnameNew.getText().toString());\n\n Intent i = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(i);\n }\n if (!task.isSuccessful()) {\n Toast.makeText(RegisterActivity.this, \"Algo está mal :C\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }", "public void addUser(String name, String email, String uid, String created_at) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, name); // Nombre\n values.put(KEY_EMAIL, email); // Email\n values.put(KEY_UID, uid); // Email\n values.put(KEY_CREATED_AT, created_at); // Fecha de creación\n\n // Insertar tabla\n long id = db.insert(TABLE_USER, null, values);\n db.close(); // Cerra la conexion con la base de datos\n\n Log.d(TAG, \"Nuevo usuario insertado en sqlite: \" + id);\n }", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n binding = ActivitySignupBinding.inflate(getLayoutInflater());\n setContentView(binding.getRoot());\n mRegisterBtn= findViewById(R.id.signup);\n mEmail = findViewById(R.id.username);\n mPassword = findViewById(R.id.password);\n\n getSupportActionBar().hide();\n mAuth = FirebaseAuth.getInstance();\n database = FirebaseDatabase.getInstance();\n\n progressDialog = new ProgressDialog(SignupActivity.this);\n progressDialog.setTitle(\"creating your account\");\n progressDialog.setMessage(\"We're creating your account\");\n\n mRegisterBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n final String email = binding.username.getText().toString().trim();\n String password = binding.password.getText().toString().trim();\n String confirm_password = binding.confirmPassword.getText().toString().trim();\n\n if (TextUtils.isEmpty(email)) {\n mEmail.setError(\"Email is Required.\");\n return;\n }\n\n if (TextUtils.isEmpty(password)) {\n mPassword.setError(\"Password is Required.\");\n return;\n }\n\n if (password.length() < 6) {\n mPassword.setError(\"Password Must be greater than 6 Characters\");\n return;\n }\n\n if (TextUtils.isEmpty(confirm_password)) {\n mPassword.setError(\"Confirm Password\");\n return;\n }\n\n if(password.equals(confirm_password))\n {\n progressDialog.show();\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(task -> {\n progressDialog.dismiss();\n if (task.isSuccessful()) {\n Users user = new Users(email, password);\n\n String id = task.getResult().getUser().getUid();\n database.getReference(\"Users\").child(id).setValue(user);\n\n Toast.makeText(SignupActivity.this, \"user created\", Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(SignupActivity.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();\n\n }\n });\n }\n }\n });\n binding.login.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent i = new Intent(SignupActivity.this,LoginActivity.class);\n startActivity(i);\n finish();\n }\n });\n\n\n\n }", "private void saveDetails() {\n //get the editted data\n String name = m_ChangeName.getText().toString();\n final String age = m_ChangeAge.getText().toString();\n final String bio = m_ChangeBio.getText().toString();\n\n //get the image from the image view\n final Bitmap img = ((BitmapDrawable) m_ProfilePic.getDrawable()).getBitmap();\n\n //get a reference to firebase database\n final DatabaseReference ref = FirebaseDatabase.getInstance().getReference();\n\n //get the current logged in user\n final FirebaseUser fUser = FirebaseAuth.getInstance().getCurrentUser();\n\n // add the new name of the user\n ref.child(\"user\").child(fUser.getUid()).child(\"name\").setValue(name);\n\n // when the name is updated, update the other relevant info\n ref.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n // update the age and bio\n ref.child(\"user\").child(fUser.getUid()).child(\"age\").setValue(age);\n ref.child(\"user\").child(fUser.getUid()).child(\"bio\").setValue(bio);\n //object to convert image to byte array for storage on firebase\n ByteArrayOutputStream imgConverted = new ByteArrayOutputStream();\n\n //save the image as a .jpg file\n img.compress(Bitmap.CompressFormat.JPEG, 100, imgConverted);\n\n String imageEncoded = Base64.encodeToString(imgConverted.toByteArray(), Base64.DEFAULT);\n ref.child(\"user\").child(fUser.getUid()).child(\"image\").setValue(imageEncoded);\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n //display error if any occur\n Toasty.error(m_context, \"Error\" + databaseError, Toast.LENGTH_SHORT).show();\n }\n });\n\n }", "@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n progressBarlogin.setVisibility(View.GONE);\n if (!task.isSuccessful()) {\n // there was an error\n if (password.length() < 6) {\n inputPassword.setError(getString(R.string.minimum_password));\n } else {\n Toast.makeText(MainActivity.this, getString(R.string.auth_failed), Toast.LENGTH_LONG).show();\n }\n } else {\n FirebaseUser user = mAuth.getCurrentUser();\n String email = user.getEmail();\n String uid = user.getUid();\n HashMap<Object,String> hashMap = new HashMap<>();\n hashMap.put(\"email\", email);\n hashMap.put(\"uid\", uid);\n hashMap.put(\"onlineStatus\", \"online\");\n hashMap.put(\"typingTo\",\"noOne\");\n hashMap.put(\"username\", \"\");\n hashMap.put(\"phone\", \"\");\n hashMap.put(\"image\",\"\");\n hashMap.put(\"cover\",\"\");\n // path to store data\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference reference = database.getReference(\"Users\");\n reference.child(uid).setValue(hashMap);\n Intent intent = new Intent(MainActivity.this, MainActivity.class);\n startActivity(intent);\n finish();\n }\n }", "public void registerNewEmail(final String userID, String password){\n\n showDialog();\n\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(userID, password)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(\"파베 아이디 등록\", \"유저 이메일 등록:onComplete:\" + task.isSuccessful());\n\n if (task.isSuccessful()){\n Log.d(\"파베 아이디 등록\", \"onComplete: Auth상태: \" + FirebaseAuth.getInstance().getCurrentUser().getUid());\n\n //insert some default data\n User user = new User();\n user.setEmail(userID);\n user.setUsername(userID.substring(0, userID.indexOf(\"@\")));\n user.setUser_id(FirebaseAuth.getInstance().getUid());\n\n FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()\n .setTimestampsInSnapshotsEnabled(true)\n .build();\n mDb.setFirestoreSettings(settings);\n\n DocumentReference newUserRef = mDb\n .collection(getString(R.string.collection_users))\n .document(FirebaseAuth.getInstance().getUid());\n\n newUserRef.set(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n hideDialog();\n\n if(task.isSuccessful()){\n redirectLoginScreen();\n }else{\n View parentLayout = findViewById(android.R.id.content);\n Snackbar.make(parentLayout, \"파베 가입 오류1\", Snackbar.LENGTH_SHORT).show();\n }\n }\n });\n\n }\n else {\n View parentLayout = findViewById(android.R.id.content);\n Snackbar.make(parentLayout, \"파베 가입 오류2\", Snackbar.LENGTH_SHORT).show();\n hideDialog();\n }\n\n // ...\n }\n });\n }" ]
[ "0.7641824", "0.73897165", "0.73144656", "0.7299505", "0.7269646", "0.7268222", "0.72624207", "0.7231295", "0.72205925", "0.72200966", "0.71550554", "0.7133968", "0.71305233", "0.7122674", "0.70455235", "0.700148", "0.6995268", "0.6988102", "0.698118", "0.69725525", "0.69567883", "0.6954726", "0.6932695", "0.6903431", "0.68991464", "0.68838954", "0.68795115", "0.6867344", "0.6866447", "0.68653244", "0.68423104", "0.6810932", "0.6804927", "0.67956626", "0.6790903", "0.6762851", "0.67436343", "0.674004", "0.6734455", "0.6725405", "0.67103815", "0.6700324", "0.6651769", "0.66441023", "0.6623826", "0.6601575", "0.6588843", "0.65813154", "0.6567108", "0.6549026", "0.65474385", "0.6538565", "0.6515766", "0.65137035", "0.65088004", "0.6507364", "0.6496965", "0.6494895", "0.6486134", "0.6481422", "0.6480272", "0.64799976", "0.6470936", "0.64589846", "0.6456734", "0.64553785", "0.6451762", "0.64437175", "0.64369226", "0.64352655", "0.64315265", "0.64303905", "0.6383392", "0.637746", "0.6376407", "0.63679534", "0.6356923", "0.63498837", "0.6346664", "0.6345514", "0.6342344", "0.63402754", "0.6339044", "0.6335818", "0.6335731", "0.63342047", "0.6333028", "0.6302937", "0.62992543", "0.6295329", "0.6284334", "0.6281497", "0.62709737", "0.62605876", "0.6259061", "0.6238303", "0.6230981", "0.6226244", "0.62260896", "0.6220499" ]
0.63613725
76
Gets the contentFlowno value for this CustomContentInfo.
public long getContentFlowno() { return contentFlowno; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setContentFlowno(long contentFlowno) {\n this.contentFlowno = contentFlowno;\n }", "public int getFlow() {\r\n\r\n return flow;\r\n }", "public int getCompFlow(){\n return this.mFarm.getCompFlow();\n }", "public int flow() {\n\t\treturn this.flow;\n\t}", "public String getFlowId() {\n\t\treturn flowId;\n\t}", "public String getFileFlow() {\r\n\t\treturn fileFlow;\r\n\t}", "public Long getFlowLimit() {\r\n \treturn flowLimit;\r\n }", "public Flow getFlow() {\r\n\t\treturn flow;\r\n\t}", "public int getPkg_content_seq() {\n return pkg_content_seq;\n }", "public java.lang.String getContentFileId() {\n return contentFileId;\n }", "public java.lang.String getContentFileId() {\n return contentFileId;\n }", "public int getContenido_neto() {\n return contenido_neto;\n }", "public Flow getFlow() {\n return flow;\n }", "public Integer getContentId() {\n return contentId;\n }", "public int getChunkNo() {\n return chunkNo;\n }", "public int getChunkNo() {\n return chunkNo;\n }", "public FlowNode getFlowNode() {\n\t\treturn this.getHasInstanceRelationship().getNode();\n\t}", "public String getCfNo() {\n\t\treturn cfNo;\n\t}", "EDataType getCurrentFlow();", "public String getElementFlow() {\r\n\t\treturn elementFlow;\r\n\t}", "public FlowType type() {\r\n\t\treturn FlowType.FLOW;\r\n\t}", "@Field(3) \n\tpublic int SequenceNo() {\n\t\treturn this.io.getIntField(this, 3);\n\t}", "@java.lang.Override\n public int getContentId() {\n return instance.getContentId();\n }", "public String getCashFlow() {\n\n return this.cashFlow;\n }", "public String getContentId() {\n\n String as[] = getMimeHeader(\"Content-Id\");\n\n if (as != null && as.length > 0) {\n return as[0];\n } else {\n return null;\n }\n }", "public Integer getFileNo() {\n return fileNo;\n }", "@java.lang.Override public int getContentTypeValue() {\n return contentType_;\n }", "public BaseFlow getFlow() {\n\t\treturn this;\n\t}", "public int getFlowsFired() {\n\t\treturn flowsFired;\n\t}", "public int getIncomingFiredFlowsNeeded() {\n\t\treturn incomingFiredFlowsNeeded;\n\t}", "int getDataflow_num();", "public Number getWorkflowNotificationId() {\r\n return (Number) getAttributeInternal(WORKFLOWNOTIFICATIONID);\r\n }", "@java.lang.Override public int getContentTypeValue() {\n return contentType_;\n }", "public String getContentId() {\n\t\treturn _contentId;\n\t}", "public Integer getHostelOrderDetailNo() {\n return hostelOrderDetailNo;\n }", "public double getEdgeFlow() {\n\t\treturn this.flow;\r\n\t}", "public int getDisplaySequence() {\r\n\t\treturn displaySequence;\r\n\t}", "public int getItemNo() {\r\n\t\treturn itemNo;\r\n\t}", "public Integer getItemNo() {\n\t\treturn itemNo;\n\t}", "@java.lang.Override\n public int getContentId() {\n return contentId_;\n }", "public int flow(Edge e) {\n\t\tif(mcg!=null)\n\t\t{\n\t\t\treturn mcg.flow(e);\n\t\t}\n\t\treturn 0;\n\t}", "public int currentChunkNum() {\n\t\treturn cp.chunk().getChunkNum();\n\t}", "public Integer getDisplaySequence() {\n return this.displaySequence;\n }", "public String getOrgFlow() {\r\n\t\treturn orgFlow;\r\n\t}", "public FlowControl getFlowControl() {\n\t\treturn flowControl;\n\t}", "public int getFlowSize()\n\t{\n\t\tint result = 0;\n\t\t\n\t\tfor(Edge e : this.source.getOutgoingEdges())\n\t\t{\n\t\t\tresult += e.getFlow();\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "@Field(8) \n\tpublic long channel_layout() {\n\t\treturn this.io.getLongField(this, 8);\n\t}", "public String getContentDisposition() {\n return contentdisposition;\n }", "public int getCont() {\n\t\tint cont = 0;\n\t\tsynchronized (store) {\n\t\t\tStorage storage = (Storage) store.getContents();\n\t\t\tif (storage != null)\n\t\t\t\tcont = storage.cont;\n\t\t}\n\t\treturn cont;\n\t}", "int getNo() {\n\t\treturn no;\n\t}", "public String getResourceFlow() {\r\n\t\treturn resourceFlow;\r\n\t}", "public int getNumber() {\n\t\treturn 666;\n\t}", "public String getContentDisposition() {\n return this.contentDisposition;\n }", "@Override\n\tpublic int getCount() {\n\t\treturn this.flows.size();\n\t}", "public java.lang.Short getCauseOfNoId() {\r\n return causeOfNoId;\r\n }", "public String getIsmtransitionCareflowstepCode() {\n\t\treturn ismtransitionCareflowstepCode;\n\t}", "public Integer getFinancialDocumentLineNumber() {\r\n return financialDocumentLineNumber;\r\n }", "public String getFlowLogId() {\n return this.flowLogId;\n }", "public int getContentViewId() {\n return R.id.tv_content;\n }", "int getContentTypeValue();", "public int getNumber() {\n\t\t\n\t\treturn number;\n\t}", "public int getNum() {\n\t\treturn num;\n\t}", "@AutoEscape\n\tpublic String getFlowType();", "public int getSequenceNumber() {\n\t\treturn fSequenceNumber;\n\t}", "public Long getUpdateFlow() {\n return updateFlow;\n }", "public Integer getSchFileId() {\n\t\treturn schFileId;\n\t}", "public int getMMSCount(){\r\n\t\t//if(_debug) Log.v(_context, \"NotificationViewFlipper.getMMSCount() MMSCount: \" + _mmsCount);\r\n\t\treturn _mmsCount;\r\n\t}", "public Integer getPositionnum() {\n\t\treturn positionnum;\n\t}", "public int getCLNO() {\n return clno;\n }", "public double getTargetFlowDisplay(){\n return this.mFarm.getTargetFlowDisplay();\n }", "public int getDisableComment() {\n return instance.getDisableComment();\n }", "public String getRecordFlow() {\r\n\t\treturn recordFlow;\r\n\t}", "public String getRecordFlow() {\r\n\t\treturn recordFlow;\r\n\t}", "public Set<DataFlowID> getFlows() {\r\n return mFlowData.keySet();\r\n }", "public Long getLayoutsequence() {\n return layoutsequence;\n }", "java.lang.String getContentId();", "public static int getBlockNum() {\n\t\treturn (blockContext.blockNum);\n\t}", "@Override\n\tpublic long getContent_id() {\n\t\treturn _contentupdate.getContent_id();\n\t}", "public String getDataRecordFlow() {\r\n\t\treturn dataRecordFlow;\r\n\t}", "public int getMessageNum() {\n return mMessageNum;\n }", "public CardLayout getCl() {\n\t\treturn cl;\n\t}", "public int getContentCount()\r\n\t{\r\n\t\treturn this.contentItems.size();\r\n\t}", "public int getNo() {\n return no;\n }", "public int getDef() {\n\t\treturn def;\n\t}", "public double getTargetNodeFlow(){\n return this.targetNodeFlow;\n }", "private long getFlowSizeByte(long seq) {\n return Math.min(MAX_SEGMENT_SIZE, flowSizeByte - seq + 1);\n }", "public int getCPTLNO() {\n return cptlno;\n }", "public byte get_seqnum() {\n return (byte)getSIntElement(offsetBits_seqnum(), 8);\n }", "public int getCommunicationTurnNo() {\n\t\treturn communicationTurn;\n\t}", "public Long getWorkflowId() {\n return this.workflowId;\n }", "public int getContentLayout() {\n return R.layout.activity_search_contact;\n }", "@objid (\"40a43de4-291a-451c-8b86-60b46e1223bb\")\n public static SmDependency getDefaultFlowDep() {\n return DefaultFlowDep;\n }", "public final String getChannelNumber() {\n\t\treturn impl.getChannelNumber();\n }", "public int getNumber() {\n\t\treturn number;\n\t}", "public int getNumber() {\n\t\treturn number;\n\t}", "public int getNumber() {\n\t\treturn number;\n\t}", "public int getNumber() {\n\t\treturn number;\n\t}", "public void setFlow(int flow) {\r\n\r\n this.flow = flow;\r\n }", "String getFlowdirct();", "public int getNumber() {\n return field.getNumber();\n }" ]
[ "0.73687387", "0.6175913", "0.5962681", "0.59192216", "0.55223423", "0.54574066", "0.5426244", "0.53608286", "0.5297047", "0.5221876", "0.52018285", "0.5197071", "0.515945", "0.50639117", "0.50483304", "0.50483304", "0.50449514", "0.50449437", "0.502824", "0.4931141", "0.48912865", "0.4870116", "0.48692465", "0.48346615", "0.48238498", "0.48145893", "0.48112574", "0.48095098", "0.47943553", "0.4779989", "0.47624657", "0.47551295", "0.47533375", "0.4744865", "0.47388738", "0.47056583", "0.4697324", "0.46819526", "0.46703747", "0.4667385", "0.46661687", "0.46413508", "0.46334827", "0.46279413", "0.46222976", "0.46174693", "0.461653", "0.46063063", "0.460455", "0.46043918", "0.45965716", "0.4593215", "0.45847702", "0.45708597", "0.4566825", "0.45623258", "0.45590624", "0.455766", "0.4553437", "0.45502934", "0.45335326", "0.4531356", "0.45081204", "0.4504398", "0.45011207", "0.4488207", "0.44876358", "0.44784707", "0.44710928", "0.4469374", "0.44690526", "0.44657946", "0.44657946", "0.4458983", "0.44582686", "0.44494373", "0.44493863", "0.44471776", "0.444549", "0.4444366", "0.44432655", "0.4439093", "0.44353703", "0.4434264", "0.4433818", "0.44329816", "0.44286194", "0.44274446", "0.44215614", "0.4421331", "0.4420746", "0.44116065", "0.4408356", "0.44080988", "0.44080988", "0.44080988", "0.44080988", "0.4405513", "0.44042104", "0.4402989" ]
0.8097677
0
Sets the contentFlowno value for this CustomContentInfo.
public void setContentFlowno(long contentFlowno) { this.contentFlowno = contentFlowno; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long getContentFlowno() {\n return contentFlowno;\n }", "public void setFlow(int flow) {\r\n\r\n this.flow = flow;\r\n }", "public void setCompFlow(int compFlow){\n this.mFarm.setCompFlow(compFlow);\n }", "public void setFlowType(String flowType);", "public void setFileFlow(String fileFlow) {\r\n\t\tthis.fileFlow = fileFlow;\r\n\t}", "public void setFlowLimit(Long flowLimit) {\r\n \tthis.flowLimit = flowLimit;\r\n }", "public void setEdgeFlow(double flow) throws Exception {\r\n\t\tif (this.capacity < flow || flow < 0)\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\tthis.flow = flow;\r\n\t}", "private void setContentId(int value) {\n bitField0_ |= 0x00000001;\n contentId_ = value;\n }", "public void setVisitFlow(String visitFlow) {\r\n\t\tthis.visitFlow = visitFlow;\r\n\t}", "public void setFlowControl(FlowControl flowControl) throws FTD2XXException {\n ensureFTStatus(ftd2xx.FT_SetFlowControl(ftHandle, (short) flowControl.constant(), (byte) 0, (byte) 0));\n }", "public void setCashFlow(String cashFlow) {\n\n this.cashFlow = cashFlow;\n }", "private void setFlow(Flow flow) throws IllegalArgumentException {\r\n\t\tAssert.hasText(getId(), \"The id of the state should be set before adding the state to a flow\");\r\n\t\tAssert.notNull(flow, \"The owning flow is required\");\r\n\t\tthis.flow = flow;\r\n\t\tflow.add(this);\r\n\t}", "public String getFlowId() {\n\t\treturn flowId;\n\t}", "public void setControlFlowHeader(ElementHeader controlFlowHeader)\n {\n this.controlFlowHeader = controlFlowHeader;\n }", "public void setElementFlow(String elementFlow) {\r\n\t\tthis.elementFlow = elementFlow;\r\n\t}", "protected void f_set(Long eID, int flowValue) {\n\t\tincreaseAccess(); // Zugriff auf den Graphen\n\t\tgraph.setValE(eID, flowAttr, flowValue);\n\t}", "public void setUserFlow(String userFlow) {\r\n\t\tthis.userFlow = userFlow;\r\n\t}", "public Builder setContentTypeValue(int value) {\n \n contentType_ = value;\n onChanged();\n return this;\n }", "public void setOrgFlow(String orgFlow) {\r\n\t\tthis.orgFlow = orgFlow;\r\n\t}", "public int getFlow() {\r\n\r\n return flow;\r\n }", "public void setContent(Object content) {\n this.content = content;\n }", "public synchronized void setContent(Object content) {\n // nothing\n }", "public void setContenido_neto(int contenido_neto) {\n this.contenido_neto = contenido_neto;\n }", "@Override\n\tpublic void modifyFlowCardMaster(String flowCardVouNo, FlowCard flowCard)\n\t\t\tthrows DaoException {\n\n\t}", "protected void addFlowPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_SecuritySchema_flow_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_SecuritySchema_flow_feature\", \"_UI_SecuritySchema_type\"),\n\t\t\t\t CorePackage.Literals.SECURITY_SCHEMA__FLOW,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "void setFlow(double amount);", "public void setItemNo(int value) {\n this.itemNo = value;\n }", "@Override\n public void set(C content) {\n this.content = content;\n }", "public Long getFlowLimit() {\r\n \treturn flowLimit;\r\n }", "public void setOdlOpenflowFlowstats2(String x) throws SnmpStatusException;", "public CashFlowImportStatus(Key<CashFlow> cashflow, int total) {\n\t\tthis.cashflow = cashflow;\n\t\tthis.setTotal(total);\n\t}", "public void setContentType( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), CONTENTTYPE, value);\r\n\t}", "public Boolean setFlowTracking(String flowtracking) throws PermissionDeniedException;", "@Override\n\tpublic void setContent_id(long content_id) {\n\t\t_contentupdate.setContent_id(content_id);\n\t}", "public void setContent(String content) { this.content = content; }", "protected void setContent(WaypointCardBase<?> content) {\n this.content.setValue(content);\n }", "public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder setContentFileId(java.lang.String value) {\n validate(fields()[0], value);\n this.contentFileId = value;\n fieldSetFlags()[0] = true;\n return this;\n }", "public void setContentObj(String contentObj) {\n this.contentObj = contentObj;\n }", "public void setContentHandler(ContentHandler handler) {\n m_ch = handler;\n }", "public void setArticleNo(String value) {\n setAttributeInternal(ARTICLENO, value);\n }", "public void setArticleNo(String value) {\n setAttributeInternal(ARTICLENO, value);\n }", "public void setDataRecordFlow(String dataRecordFlow) {\r\n\t\tthis.dataRecordFlow = dataRecordFlow;\r\n\t}", "public void setFacturaModificada(es.gob.agenciatributaria.www2.static_files.common.internet.dep.aplicaciones.es.aeat.ssii.fact.ws.SuministroInformacion_xsd.FacturaModificadaType facturaModificada) {\r\n this.facturaModificada = facturaModificada;\r\n }", "public void setResourceFlow(String resourceFlow) {\r\n\t\tthis.resourceFlow = resourceFlow;\r\n\t}", "public void setContentId(Integer contentId) {\n this.contentId = contentId;\n }", "@Immutable\n @IcalProperties({\n @IcalProperty(pindex = PropertyInfoIndex.ENTITY_TYPE,\n jname = \"entityType\",\n required = true,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true),\n @IcalProperty(pindex = PropertyInfoIndex.DOCTYPE,\n jname = \"_type\",\n required = true,\n eventProperty = true,\n todoProperty = true,\n journalProperty = true)}\n )\n public void setEntityType(final int val) {\n entityType = val;\n }", "public void setActiveFlow(Flow activeFlow) {\n this.m_activeFlows.add(activeFlow);\n }", "public abstract void setCntCod(int cntCod);", "private void showFlow(VFlow flow, Stage stage, String title) {\n ScalableContentPane canvas = new ScalableContentPane();\r\n\r\n // define it as background (css class)\r\n canvas.getStyleClass().setAll(\"vflow-background\");\r\n\r\n // create skin factory for flow visualization\r\n FXValueSkinFactory fXSkinFactory = new FXValueSkinFactory(canvas.getContentPane());\r\n\r\n // register visualizations for Integer, String and Image\r\n fXSkinFactory.addSkinClassForValueType(Integer.class, IntegerFlowNodeSkin.class);\r\n fXSkinFactory.addSkinClassForValueType(String.class, StringFlowNodeSkin.class);\r\n fXSkinFactory.addSkinClassForValueType(Image.class, ImageFlowNodeSkin.class);\r\n\r\n // generate the ui for the flow\r\n flow.addSkinFactories(fXSkinFactory);\r\n\r\n // the usual application setup\r\n Scene scene = new Scene(canvas, 1024, 600);\r\n\r\n // add css style\r\n scene.getStylesheets().setAll(\r\n \"/eu/mihosoft/vrl/workflow/tutorial05/resources/default.css\");\r\n\r\n stage.setTitle(title);\r\n stage.setScene(scene);\r\n stage.show();\r\n }", "public void setContent(String content) {\n\t this.content = content;\n\t}", "public void setContent(String content) {\r\n\t\tthis.content = content;\r\n\t}", "private synchronized void setContentType(ContentType contentType) {\n\n // Check for null\n if (contentType == null)\n throw new IllegalArgumentException(\"Given ContentType can't be null\");\n\n // Check whether we're changing\n if (this.displayState != null && this.displayState.contentType == contentType)\n return;\n\n // update the fragment\n Fragment fragment = constructFragmentForContentType(contentType);\n getSupportFragmentManager()\n .beginTransaction()\n .replace(R.id.content_main, fragment)\n .commit();\n\n // Start to update all other properties\n final ActionBar actionBar = this.getSupportActionBar();\n final Navigatable.Properties properties = fragment instanceof Navigatable ? ((Navigatable) fragment).getProperties() : null;\n final FloatingActionButton fab = (FloatingActionButton) this.findViewById(R.id.fab);\n\n\n // Apply the title properties to the action bar, if applicable\n if (actionBar != null){\n if (properties != null && properties.usesTitle())\n actionBar.setTitle(properties.getTitle(this));\n else\n actionBar.setTitle(\"SAN Seminar\");\n\n // Indicate that the options menu should be recreated.\n this.invalidateOptionsMenu();\n }\n\n // Show and handle the Floating Action Button, if applicable\n if(properties != null && properties.usesFloatingActionButton()){\n fab.setVisibility(View.VISIBLE);\n fab.setOnClickListener(properties.getFabClickListener());\n fab.setImageResource(properties.getFabIconResource());\n } else {\n fab.setVisibility(View.GONE);\n fab.setOnClickListener(null);\n }\n\n // Update the current content type, and reflect this in the navigation drawer.\n this.displayState = new DisplayState(contentType, fragment, properties);\n this.navigationView.setCheckedItem(contentType.navigationResource);\n\n }", "public void setNUMSECFO(int value) {\n this.numsecfo = value;\n }", "public void setItemNo(Integer itemNo) {\n\t\tif (itemNo == 0) {\n\t\t\tthis.itemNo = null;\n\t\t} else {\n\t\t\tthis.itemNo = itemNo;\n\t\t}\n\t}", "public void setTrackNumber( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), TRACKNUMBER, value);\r\n\t}", "@Override\n\tpublic void setContent_id(long content_id) {\n\t\t_buySellProducts.setContent_id(content_id);\n\t}", "public void setFileNo(Integer fileNo) {\n this.fileNo = fileNo;\n }", "public void setCfNo(String cfNo) {\n\t\tthis.cfNo = cfNo;\n\t}", "public void setContent(String content)\n/* */ {\n/* 1340 */ this.content = content;\n/* */ }", "public void setQueryFlow(String queryFlow) {\r\n\t\tthis.queryFlow = queryFlow;\r\n\t}", "public void setOdlOpenflowNode2(String x) throws SnmpStatusException;", "public void setContent(String content) {\n\t\tthis.content = content == null ? null : content.trim();\n\t}", "public void setDef(int def){\r\n this.def = def;\r\n }", "public void setFlowControl(FlowControl flowControl, byte uXon, byte uXoff) throws FTD2XXException {\n ensureFTStatus(ftd2xx.FT_SetFlowControl(ftHandle, (short) flowControl.constant(), uXon, uXoff));\n }", "public void setUpdateFlow(Long updateFlow) {\n this.updateFlow = updateFlow;\n }", "void setContent(String data) {\n this.content = data;\n }", "public abstract void setCntFtc(int cntFtc);", "public void setNo(String no) {\n this.no = no;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n this.content = content;\n }", "public void setContent(String content) {\n\t\tthis.content = content;\n\t}", "public void setContent(String content) {\n\t\tthis.content = content;\n\t}", "public void setContent(String content) {\n this.m_content = content;\n }", "public void setCLNO(int value) {\n this.clno = value;\n }", "public void setContent(String content) {\r\n this.content = content == null ? null : content.trim();\r\n }", "public void setContent(String content) {\n\t\tmContent = content;\n\t}", "public abstract void setContentType(ContentType contentType);", "public int flow() {\n\t\treturn this.flow;\n\t}", "public void setNum(int num) {\r\n this.num = num;\r\n }", "private void setContent(String content) {\n this.content = content;\n }", "public final native void setContent(String content) /*-{\n this.setContent(content);\n }-*/;", "public void setContent(String content) {\n this.content = content == null ? null : content.trim();\n }", "public void setContent(String content) {\n this.content = content == null ? null : content.trim();\n }", "public void setContent(String content) {\n this.content = content == null ? null : content.trim();\n }", "public void setContent(String content) {\n this.content = content == null ? null : content.trim();\n }", "public void setContent(String content) {\n this.content = content == null ? null : content.trim();\n }", "public void setContent(String content) {\n this.content = content == null ? null : content.trim();\n }", "public void setNum(int num) {\n\t\tthis.num = num;\n\t}", "public String getFileFlow() {\r\n\t\treturn fileFlow;\r\n\t}", "public void setTCPConnection(TCPConnectionHandler tcp) {\r\n\t\tthis.tcp = tcp;\r\n\t}", "public void setPkg_content_seq(int pkg_content_seq) {\n this.pkg_content_seq = pkg_content_seq;\n }" ]
[ "0.62117016", "0.5773436", "0.53224146", "0.5258136", "0.49501434", "0.49253407", "0.46749982", "0.4644235", "0.4591876", "0.4583912", "0.45304403", "0.45123976", "0.44773278", "0.44680017", "0.444549", "0.44292575", "0.4376892", "0.43747994", "0.42971662", "0.42934966", "0.42658398", "0.42537907", "0.42406264", "0.42359373", "0.42019776", "0.41847757", "0.41843498", "0.4169291", "0.41569388", "0.41311494", "0.4125857", "0.4109433", "0.41042542", "0.4088347", "0.4072213", "0.4071598", "0.40655562", "0.4060633", "0.40547088", "0.40477762", "0.40477762", "0.40446538", "0.4022334", "0.40209025", "0.40121177", "0.40080544", "0.40042046", "0.39980274", "0.39874378", "0.39864257", "0.39809248", "0.39785546", "0.397705", "0.39743656", "0.39718726", "0.39713243", "0.39592734", "0.39413148", "0.39372247", "0.39340147", "0.39285633", "0.3923336", "0.3916701", "0.3914957", "0.39126253", "0.3905308", "0.39033136", "0.39030978", "0.38979656", "0.38979656", "0.38979656", "0.38979656", "0.38979656", "0.38979656", "0.38979656", "0.38979656", "0.38979656", "0.38979656", "0.38979656", "0.3893952", "0.3893952", "0.38885078", "0.38873497", "0.38870257", "0.38861322", "0.38818073", "0.3879897", "0.3878678", "0.38772672", "0.38719454", "0.38654998", "0.38654998", "0.38654998", "0.38654998", "0.38654998", "0.38654998", "0.38636866", "0.38575494", "0.38534117", "0.3846836" ]
0.8320489
0
Gets the informationSystem value for this CustomContentInfo.
public long getInformationSystem() { return informationSystem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getSystem() {\r\n return this.system;\r\n }", "public String getIsSystem() {\n return isSystem;\n }", "@ApiModelProperty(required = true, value = \"The id of the system where this file lives.\")\n public String getSystem() {\n return system;\n }", "public String getSystemName() {\n return systemName;\n }", "public AS400 getSystem() {\r\n return system;\r\n }", "public String getSystemName() {\n\t\treturn systemName;\n\t}", "public SystemData systemData() {\n return this.systemData;\n }", "public SystemData systemData() {\n return this.systemData;\n }", "public SystemData systemData() {\n return this.systemData;\n }", "public SystemData systemData() {\n return this.systemData;\n }", "public java.lang.String getSystemName() {\r\n return systemName;\r\n }", "public String getSystemType() {\n \t\treturn fSystemType;\n \t}", "public CodeSystem getCodeSystem() {\r\n\t\treturn codeSystem;\r\n\t}", "public void setInformationSystem(long informationSystem) {\n this.informationSystem = informationSystem;\n }", "public String getSystemInfo() {\n listItems();\n return String.format(\"Owner: %s\\nNumber of maximum items: %d\\nNumber of current items: %d\\nCurrent items \" +\n \"stocked: %s\\nTotal money in machine: %.2f\\nUser money in machine: %.2f\\nStatus of machine: %s\", owner,\n maxItems, itemCount, Arrays.toString(itemList), totalMoney, userMoney, vmStatus.getStatus());\n }", "public final boolean isSystem() {\n\t\treturn m_info.isSystem();\n\t}", "public String getSystemId() { return this.systemId; }", "protected SystemCatalog getSystemCatalog() {\n return catalog;\n }", "public String getExternalSystem() {\n return externalSystem;\n }", "public Object systemNumber() {\n return this.systemNumber;\n }", "public ShipSystem getSystem() {\n return system;\n }", "public String getSystemId() {\n\t\treturn mSystemId;\n\t}", "public String getSystemProperties() {\n return systemProperties;\n }", "public java.lang.String getSystemCode() {\n return systemCode;\n }", "@ApiModelProperty(value = \"The process name, job ID, etc...\")\n public String getSystemName() {\n return systemName;\n }", "public String getInformation() {\n return mInformation;\n }", "public void getSystemInfo(){\n //get system info\n System.out.println(\"System Information\");\n System.out.println(\"------------------\");\n System.out.println(\"Available Processors: \"+Runtime.getRuntime().availableProcessors());\n System.out.println(\"Max Memory to JVM: \"+String.valueOf(Runtime.getRuntime().maxMemory()/1000000)+\" MB\");\n System.out.println(\"------------------\");\n System.out.println();\n }", "public String getSystemdatum() {\n\t\treturn systemdatum;\n\t}", "public java.lang.String getSystemCode () {\r\n\t\treturn systemCode;\r\n\t}", "public static String getSystemName()\n {\n return sSysName;\n }", "public TypeSystemNode getTypeSystemNode() {\r\n return typeSystemNode;\r\n }", "public String getSysType() {\n return sysType;\n }", "public java.util.Map<java.lang.String, ch.epfl.dedis.proto.StatusProto.Response.Status> getSystemMap() {\n return internalGetSystem().getMap();\n }", "public java.util.Map<java.lang.String, ch.epfl.dedis.proto.StatusProto.Response.Status> getSystemMap() {\n return internalGetSystem().getMap();\n }", "public String getInformation() {\n return information;\n }", "public String getSystemVer() {\n return systemVer;\n }", "public String getInformation() {\n\t\treturn \"\";\n\t}", "public String getInformation() {\n\t\treturn \"\";\n\t}", "@JsonProperty(\"system_id\")\n public int getSystemId() {\n return systemId;\n }", "public String getSystemName();", "public SystemExportContentDefinition getSystemExportContentDefinition() {\n return systemExportContentDefinition;\n }", "public CoordinateSystem getCoordinateSystem() {\n System.out.println(\"BaseCatalog: getCoordinateSystem() \");\n CoordinateSystem cs = null;\n if (_layout.getMapElementCount() >0 ) {\n MapElement mapEle = (MapElement)_layout.getMapElements().next();\n cs = mapEle.getMap().getCoordinateSystem();\n }\n System.out.println(\"BaseCatalog: getCoordinateSystem() \" + cs);\n return cs;\n }", "public UnitSystems GetCurrentUnitSystem()\n {\n return MethodsCommon.GetSystemFromUnit(Unit, false, true);\n }", "public Map<Integer, SystemMessage> getSystemMessages(){\n\t\treturn hmSysMsg;\n\t}", "public java.lang.Long getSystemId () {\r\n\t\treturn systemId;\r\n\t}", "public String getSystemId() {\n // TODO Auto-generated method stub\n return null;\n }", "public String getSysNo() {\n return sysNo;\n }", "public Number getSystemId() {\n return (Number)getAttributeInternal(SYSTEMID);\n }", "public String getInfo() {\n return this.info;\n }", "public String getSystemId() {\n return agentConfig.getSystemId();\n }", "public Number getSystemId() {\n return (Number) getAttributeInternal(SYSTEMID);\n }", "public SystemServiceManager getSystemServiceManager() {\n return this.mService.mSystemServiceManager;\n }", "public ManagementInfo getManagementInfo() {\n return managementInfo;\n }", "public String getInfo() {\n\t\treturn null;\r\n\t}", "public MagnitudeSystem getMagnitudeSystem ( ) {\r\n\t\treturn system;\r\n\t}", "public String getCodeSystemVersion() {\r\n\t\treturn codeSystemVersion;\r\n\t}", "public CommandlineJava.SysProperties getSysProperties() {\r\n return getCommandLine().getSystemProperties();\r\n }", "public String getSysId() {\n return sysId;\n }", "public String getSysId() {\n return sysId;\n }", "java.lang.String getSystem();", "public String getInfo() {\n return info;\n }", "public Integer getSysId() {\n return sysId;\n }", "public boolean isSystemClass()\n {\n return systemClass;\n }", "public final static InformationManager getInformationManager() {\n\t\treturn informationManager;\n\t}", "private SystemDef getSystemDef(String systemDefName) {\n for (DatacollectionGroup group : externalGroupsMap.values()) {\n for (SystemDef sd : group.getSystemDefCollection()) {\n if (sd.getName().equals(systemDefName)) {\n return sd;\n }\n }\n }\n return null;\n }", "public void setSystem(String value) {\r\n this.system = value;\r\n }", "public byte[] getSystemOperationData() {\n\t\treturn this.systemOperationData;\n\t}", "public String getInfo()\n {\n return info;\n }", "public int getSysID() {\n return sysID_;\n }", "public SystemDisk getSystemDisk() {\n return this.SystemDisk;\n }", "public abstract String getSystemName();", "@Override\n public String getName() {\n return getSoftwareSystem().getName() + \" - System Context\";\n }", "public Object getInfo() {\n return info;\n }", "public String getOperatingSystem() {\n return this.operatingSystem;\n }", "public int getSysID() {\n return sysID_;\n }", "public EventBus getEventSystem() {\n return system;\n }", "public ServiceInformationType getServiceInformationType() {\r\n\t\treturn this.siType;\r\n\t}", "@Override\n\t\t\tpublic boolean isSystemEntry() {\n\t\t\t\treturn true;\n\t\t\t}", "public double[][] getSystemInputModel()\n {\n return systemInputModel;\n }", "public String getForeignSystemId() {\n return foreignSystemId;\n }", "public String getOperatingSystem() {\n return this.operatingSystem;\n }", "public SystemResourceNode getSystemResourceNode() {\n\t\treturn systemResourceNode;\n\t}", "org.hyperflex.roscomponentmodel.System getSystem();", "public Long getSystemmenu() {\n return systemmenu;\n }", "public String getDocumentInfo() {\n MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());\n return dt.getName() + \" \" + getDocumentNo();\n }", "public String getInfo() {\n return null;\n }", "protected String getSubsystem() {\n return subsystem;\n }", "@Override\n public String getInfo() {\n return this.info;\n }", "public String displaySystemProperties()\n\t{\n\t\tString displaySystemInfo = \"\";\n\t\tString yourOS = \"\";\n\t\t\n\t\t//Positive\n\t\t//For TestingOnly - By Default, the below line is commented\n\t\t//if (java.lang.System.getProperty(\"os.name\").equalsIgnoreCase(\"Mac OS X\")){\t\n\t\n\t\tif (java.lang.System.getProperty(\"os.name\").equalsIgnoreCase(\"Windows 10\")){\n\t\t\t\n\t\t\tyourOS = \"Positive - Be Awesome. Run on Windows\";\n\t\t\t\n\t\t}\n\t\t\n\t\t//Negative\n\t\t//For Testing - By Default, the below line is commented\n\t\t//else if (java.lang.System.getProperty(\"os.name\").equalsIgnoreCase(\"Mac OS X\")){\n\t\t\n\t\telse if (java.lang.System.getProperty(\"os.name\").equalsIgnoreCase(\"Linux\")){\n\t\t\tyourOS = \"Negative - Linux\";\n\t\t}\n\t\t\n\t\t//Neutral\n\t\telse {\n\t\t\tyourOS = \"Neutral - You've got a decent OS here\";\n\t\t}\n\t\t\n\t\tdisplaySystemInfo = \"Operating System Architecture\\t=>\\t\" + java.lang.System.getProperty(\"os.arch\") +\n\t\t\t\t \"\\nOperating System Name\\t\\t=>\\t\" + java.lang.System.getProperty(\"os.name\") +\n\t\t\t\t \"\\nOperating System Version\\t=>\\t\" + java.lang.System.getProperty(\"os.version\") +\n\t\t\t\t \"\\nUser Account Name\\t\\t=>\\t\" + java.lang.System.getProperty(\"user.name\") +\n\t\t\t\t \"\\nJava Version\\t\\t\\t=>\\t\" + java.lang.System.getProperty(\"java.version\") +\n\t\t\t\t \"\\n\" + yourOS;\n\t\t\n\t\t\n\t\treturn displaySystemInfo;\n\t\t\n\t}", "public abstract String getSystem( );", "public String getSystemID()\n/* */ {\n/* 1299 */ return this.systemID;\n/* */ }", "public Integer getSysid() {\r\n\t\treturn sysid;\r\n\t}", "public boolean isSystemPackage(PackageInfo pkgInfo) {\n return ((pkgInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);\n }", "Information getInfo();", "public String globalInfo() {\n return \"Class for building and using a PRISM rule set for classification. \"\n + \"Can only deal with nominal attributes. Can't deal with missing values. \"\n + \"Doesn't do any pruning.\\n\\n\"\n + \"For more information, see \\n\\n\"\n + getTechnicalInformation().toString();\n }", "public TreeMap<String, Vector<TechnicalSystemStateEvaluation>> getSystemsVariability() {\r\n\t\tif (systemsVariability==null) {\r\n\t\t\tsystemsVariability = new TreeMap<String, Vector<TechnicalSystemStateEvaluation>>();\r\n\t\t}\r\n\t\treturn systemsVariability;\r\n\t}", "public String getInformationTitle() {\n return getName();\n }", "public SystemInfo() {\r\n\t}", "public String getSystemId() {\n return this.source.getURI();\n }", "private SpaceSystemType getSpaceSystemByName(String systemName, SpaceSystemType startingSystem)\n {\n // Search the space system hierarchy, beginning at the specified space system\n return searchSpaceSystemsForName(systemName, startingSystem, null);\n }" ]
[ "0.7012555", "0.6771391", "0.67464167", "0.65498793", "0.65188515", "0.6475458", "0.6399715", "0.6399715", "0.6399715", "0.6399715", "0.63899827", "0.6286752", "0.62378764", "0.61800694", "0.6173959", "0.6172105", "0.6162572", "0.6134674", "0.6130312", "0.6106724", "0.6090443", "0.60779464", "0.6062568", "0.60362667", "0.5995654", "0.5958167", "0.5935078", "0.589308", "0.5883585", "0.5865273", "0.5860456", "0.5859045", "0.5858274", "0.58225536", "0.5798449", "0.57230645", "0.57221425", "0.57221425", "0.57078105", "0.5693593", "0.5691928", "0.5646381", "0.56164616", "0.5606244", "0.5591312", "0.5568603", "0.5553161", "0.55490965", "0.5524689", "0.5524597", "0.55225176", "0.5512204", "0.5488573", "0.5482165", "0.54782754", "0.5460023", "0.5447216", "0.5447122", "0.5447122", "0.5431527", "0.543125", "0.5420244", "0.5406129", "0.53951716", "0.53814316", "0.53804684", "0.53771526", "0.53744334", "0.53680146", "0.5363445", "0.5358106", "0.5347092", "0.534552", "0.53318435", "0.5330769", "0.5329094", "0.53276664", "0.53257626", "0.5311492", "0.5308645", "0.5298185", "0.5293434", "0.5286948", "0.5283117", "0.52777433", "0.52744675", "0.5274205", "0.5268623", "0.52651626", "0.5234646", "0.5226372", "0.5217209", "0.5208281", "0.51985854", "0.51951194", "0.51859486", "0.5183908", "0.517472", "0.5165567", "0.51645154" ]
0.7580528
0
Sets the informationSystem value for this CustomContentInfo.
public void setInformationSystem(long informationSystem) { this.informationSystem = informationSystem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSystem(String value) {\r\n this.system = value;\r\n }", "void setSystem(java.lang.String system);", "public void setCodeSystem(CodeSystem codeSystem) {\r\n\t\tthis.codeSystem = codeSystem;\r\n\t}", "public void setSystemName(String systemName) {\n this.systemName = systemName;\n }", "public void setIsSystem(String isSystem) {\n this.isSystem = isSystem == null ? null : isSystem.trim();\n }", "public long getInformationSystem() {\n return informationSystem;\n }", "public void setSystemId(String systemId);", "public void setSystemName(java.lang.String systemName) {\r\n this.systemName = systemName;\r\n }", "public void setSystemPath(String systemPath) {\r\n\t\tthis.systemPath = systemPath;\r\n\t}", "public void setSystem(byte system) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeByte(__io__address + 4, system);\n\t\t} else {\n\t\t\t__io__block.writeByte(__io__address + 4, system);\n\t\t}\n\t}", "public void setSystemId( String systemId ) { this.systemId = systemId; }", "public void setSystemProperties(String systemProperties) {\n this.systemProperties = systemProperties;\n }", "public void setInformation(String information);", "@ApiModelProperty(required = true, value = \"The id of the system where this file lives.\")\n public String getSystem() {\n return system;\n }", "void xsetSystem(org.apache.xmlbeans.XmlString system);", "public void setInformation(String information) {\n this.mInformation = information;\n }", "public String getIsSystem() {\n return isSystem;\n }", "SystemConfiguration(String description)\n {\n this.mDescription = description;\n }", "public void setSystemId(String systemId) {\n agentConfig.setSystemId(systemId);\n }", "public void setMagnitudeSystem ( MagnitudeSystem system ) {\r\n\t\tthis.system = system;\r\n\t}", "public void setSystemId(int val) {\n systemId = val;\n }", "public void setSystemId (java.lang.Long systemId) {\r\n\t\tthis.systemId = systemId;\r\n\t}", "public final void setSystemID(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String systemid)\r\n\t{\r\n\t\tgetMendixObject().setValue(context, MemberNames.SystemID.toString(), systemid);\r\n\t}", "public final void setSystemID(java.lang.String systemid)\r\n\t{\r\n\t\tsetSystemID(getContext(), systemid);\r\n\t}", "public void setSystemdatum(String systemdatum) {\n\t\tthis.systemdatum = systemdatum;\n\t}", "public void setMemory(int systemMemorySize)\n\t{\n\t\tmemorySize = systemMemorySize;\n\t}", "public void setExternalSystem(String externalSystem) {\n this.externalSystem = externalSystem;\n }", "void setIntermediateSystemName(String intermediateSystemName);", "void setIntermediateSystemName(String intermediateSystemName);", "public final boolean isSystem() {\n\t\treturn m_info.isSystem();\n\t}", "public void setSystemProperties() {\n Properties systemP = System.getProperties();\n Enumeration e = systemP.propertyNames();\n while (e.hasMoreElements()) {\n String propertyName = (String) e.nextElement();\n String value = systemP.getProperty(propertyName);\n this.setPropertyInternal(propertyName, value);\n }\n }", "public SystemInfo() {\r\n\t}", "public void setSystemDisk(SystemDisk SystemDisk) {\n this.SystemDisk = SystemDisk;\n }", "@SuppressWarnings(\"unchecked\")\n \tvoid addSystem(EntitySystem system) {\n \t\tif (systems.contains(system))\n \t\t\tthrow new RuntimeException(\"System already added\");\n \t\tsystem.id = getNewSystemId();\n \t\tsystem.componentBits = world.getComponentBits(system.components);\n \n \t\tClass<? extends EntitySystem> class1 = system.getClass();\n \t\tdo {\n \t\t\tfor (Field field : class1.getDeclaredFields()) {\n \t\t\t\t// Check for ComponentManager declarations.\n \t\t\t\tif (field.getType() == ComponentMapper.class) {\n \t\t\t\t\tfield.setAccessible(true);\n \t\t\t\t\t// Read the type in the <> of componentmanager\n \t\t\t\t\tType type = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];\n \t\t\t\t\ttry {\n \t\t\t\t\t\t// Set the component manager declaration with the right\n \t\t\t\t\t\t// component manager.\n \t\t\t\t\t\tfield.set(system, world.getComponentMapper((Class<? extends Component>) type));\n \t\t\t\t\t} catch (IllegalArgumentException e) {\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t} catch (IllegalAccessException e) {\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t// check for EventListener declarations.\n \t\t\t\tif (field.getType() == EventListener.class) {\n \t\t\t\t\tfield.setAccessible(true);\n \t\t\t\t\t// Read the type in the <> of eventListener.\n \t\t\t\t\tType type = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];\n \t\t\t\t\t@SuppressWarnings(\"rawtypes\")\n \t\t\t\t\tEventListener<? extends Event> eventListener = new EventListener();\n \t\t\t\t\tworld.registerEventListener(eventListener, (Class<? extends Event>) type);\n \n \t\t\t\t\ttry {\n \t\t\t\t\t\t// Set the event listener declaration with the right\n \t\t\t\t\t\t// field listener.\n \t\t\t\t\t\tfield.set(system, eventListener);\n \t\t\t\t\t} catch (IllegalArgumentException e) {\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t} catch (IllegalAccessException e) {\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tclass1 = (Class<? extends EntitySystem>) class1.getSuperclass();\n \t\t} while (class1 != EntitySystem.class);\n \t\tsystems.add(system);\n \t\tsystemMap.put(system.id, system);\n\t\tsystem.world = world;\n \t}", "public void setCodeSystemVersion(String codeSystemVersion) {\r\n\t\tthis.codeSystemVersion = codeSystemVersion;\r\n\t}", "public void setSystemIdentifier(gov.ucore.ucore._2_0.StringType systemIdentifier)\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.ucore.ucore._2_0.StringType target = null;\n target = (gov.ucore.ucore._2_0.StringType)get_store().find_element_user(SYSTEMIDENTIFIER$0, 0);\n if (target == null)\n {\n target = (gov.ucore.ucore._2_0.StringType)get_store().add_element_user(SYSTEMIDENTIFIER$0);\n }\n target.set(systemIdentifier);\n }\n }", "public void setInfoText(String infoText);", "public void setSystemCode(java.lang.String systemCode) {\n this.systemCode = systemCode;\n }", "public void setHardDisk(double systemHardDisk)\n\t{\n\t\thardDiskSize = systemHardDisk;\n\t}", "public void setManagementInfo(ManagementInfo managementInfo) {\n managementInfo.setParent(this);\n this.managementInfo = managementInfo;\n }", "public OrthoContentItem(ContentSystem contentSystem, String name) {\r\n\t\tsuper(contentSystem, name);\r\n\t}", "@Override\n public void setInfo(String s) {\n this.info = s;\n\n }", "protected void createTelemetryMetadata(SpaceSystemType spaceSystem)\n {\n spaceSystem.setTelemetryMetaData(factory.createTelemetryMetaDataType());\n }", "public void setSystemId(Number value) {\n setAttributeInternal(SYSTEMID, value);\n }", "public void setSystemId(Number value) {\n setAttributeInternal(SYSTEMID, value);\n }", "public void setInfo(String info) {\n this.info = info;\n }", "public void initInfoSystem(){\r\n infoSys = new FedInfoSystem();\r\n subscriberList = new ConcurrentHashMap<String, List>();\r\n //singleCptNodes = new ArrayList<String>();\r\n //infoServiceRequest(\"CPT-UPDATE\", null);\r\n //infoServiceRequest(\"REQ-UPDATE\", null);\r\n }", "public void setSystemCode (java.lang.String systemCode) {\r\n\t\tthis.systemCode = systemCode;\r\n\t}", "public void setSysNo(String sysNo) {\n this.sysNo = sysNo;\n }", "public String getSystem() {\r\n return this.system;\r\n }", "public AS400 getSystem() {\r\n return system;\r\n }", "public void setInputSystemType(int inputSystemType) {\n\t\tthis.inputSystemType = inputSystemType;\n\t}", "public void setInformation(String information) {\n this.information = information == null ? null : information.trim();\n }", "protected void setInfoFile(String[] info){\n\n }", "public final void mT__14() throws RecognitionException {\n try {\n int _type = T__14;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalReqLNG.g:13:7: ( 'System' )\n // InternalReqLNG.g:13:9: 'System'\n {\n match(\"System\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void setInfo(Object o) {\n info = o;\n }", "public final void setInfo(Info info)\n {\n this.info = info;\n }", "public String getSystemName() {\n return systemName;\n }", "public String getSystemName() {\n\t\treturn systemName;\n\t}", "public void setTypeId(int systemTypeId)\n {\n mSystemTypeId = systemTypeId;\n }", "public void setInfo(String i)\n {\n info = i;\n }", "public void setSystemVer(String systemVer) {\n this.systemVer = systemVer == null ? null : systemVer.trim();\n }", "public void setSysId(String sysId) {\n this.sysId = sysId;\n }", "public void setSysId(String sysId) {\n this.sysId = sysId;\n }", "public void setInfoWindow(MarkerInfoWindow infoWindow){\n\t\tmInfoWindow = infoWindow;\n\t}", "@Override\n\t\t\tpublic boolean isSystemEntry() {\n\t\t\t\treturn true;\n\t\t\t}", "@Override\n\t\tpublic void setService(String system_id) throws RemoteException {\n\t\t\tSystem.out.println(\"set service invoke on \" + system_id);\n\t\t}", "public ImagingStudy setAccessionNo( String theSystem, String theValue) {\n\t\tmyAccessionNo = new IdentifierDt(theSystem, theValue); \n\t\treturn this; \n\t}", "public boolean isSystem(PackageInfo pi) {\n // check if bit the for the flag \"system\" is 1.\n // if is NOT system, (f1 & flag_system) = 0\n //is system if (f1 & flag_system) != 0\n // (basic bitwise operation)\n\n return (pi.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;\n }", "public void setSystemInputModel(double[][] inputModel)\n {\n this.systemInputModel = inputModel;\n this.systemUpdated = true;\n stateChanged();\n }", "public void setSystemmenu(Long systemmenu) {\n this.systemmenu = systemmenu;\n }", "public void setSysId(Integer sysId) {\n this.sysId = sysId;\n }", "public ReferenceSystemMetadata(final ReferenceSystem crs) {\n super(crs);\n }", "public void setSystemOperationData(byte[] sysOpdata) {\n\t\tthis.systemOperationData=sysOpdata;\n\t}", "public void setLocationInfo(boolean locationInfo) {\n this.locationInfo = locationInfo;\n }", "public String getSystemId() { return this.systemId; }", "@ApiModelProperty(value = \"The process name, job ID, etc...\")\n public String getSystemName() {\n return systemName;\n }", "public void setMetaData(MetaData md) throws SystemException {\n group.setNameAndDescriptionMetaDataId(md == null ? null : md.getId());\n ModelInputGroupLocalServiceUtil.updateModelInputGroup(group);\n }", "private SystemInfo() {\n }", "public void setSystemPath(String path) {\r\n\t\ttry {\r\n\t\t\tPaths.get(path);\r\n\t\t} catch (InvalidPathException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\tthis.settings.setProperty(\"systemPath\", path);\r\n\t\tthis.saveChanges();\r\n\t}", "public java.lang.String getSystemName() {\r\n return systemName;\r\n }", "public void setSysType(String sysType) {\n this.sysType = sysType;\n }", "@JsonProperty(\"system_id\")\n public int getSystemId() {\n return systemId;\n }", "public void setOperatingSystem(OperatingSystem operatingSystem) {\n this.operatingSystem = operatingSystem;\n }", "public void setInformationId(ConfigurationKey informationId) {\n this.informationId = informationId;\n }", "public void setInfoHtmlContent(String htmlInfoContent);", "public static void setSystemAttributes() throws InvalidDBTransferException {\n \texecuteInitialization(CHECK_ATTRIBUTES, INIT_ATTRIBUTES);\n }", "public static void setSaveInSystem(boolean saveInSystem) {\n\t\tPropertyLoader.saveInSystem = saveInSystem;\n\t}", "boolean setInfo();", "boolean isSetSystem();", "public CodeSystem getCodeSystem() {\r\n\t\treturn codeSystem;\r\n\t}", "public static final String setSystemProperty(String key, String value) {\n\t\tif (!saveInSystem) {\n\t\t\tlog.warn(\"Attempting to set System Property \" + key + \" to \"\n\t\t\t\t\t+ value\n\t\t\t\t\t+ \" but the file System Properties have not yet been read.\");\n\t\t}\n\t\treturn System.setProperty(key, value);\n\t}", "public boolean isSystemPackage(PackageInfo pkgInfo) {\n return ((pkgInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);\n }", "public System(String systemMake, String systemModel, int processorSpeed)\n\t{\n\t\tmake = systemMake;\n\t\tmodel = systemModel;\n\t\tspeed = processorSpeed;\n\t}", "public void setInfo(java.util.Map<java.lang.String,java.util.List<java.lang.String>> value) {\n this.info = value;\n }", "void logSystemDetails() throws CometApiException {\n sendSynchronously(restApiClient::logSystemDetails, SystemUtils.readSystemDetails());\n }", "public void setCurrentInfoText(String name) {\n\t\tthis.currentInfoText = name;\n\t}", "public void setSys_Sentence(java.lang.String sys_Sentence) {\n this.sys_Sentence = sys_Sentence;\n }", "public final void rule__System__Group__0__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:2364:1: ( ( 'system' ) )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:2365:1: ( 'system' )\n {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:2365:1: ( 'system' )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:2366:1: 'system'\n {\n before(grammarAccess.getSystemAccess().getSystemKeyword_0()); \n match(input,27,FOLLOW_27_in_rule__System__Group__0__Impl5016); \n after(grammarAccess.getSystemAccess().getSystemKeyword_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public SingleSystem(MaltipsSystem maltipsSystem) {\n this.maltipsSystem = maltipsSystem;\n }" ]
[ "0.66385144", "0.65328145", "0.6082662", "0.60810184", "0.60054845", "0.5973015", "0.5963681", "0.59293246", "0.5896924", "0.5888917", "0.58535135", "0.57795566", "0.57367444", "0.5700364", "0.5652763", "0.5652672", "0.5500373", "0.54994714", "0.54460084", "0.5436409", "0.53852713", "0.5381177", "0.53324217", "0.53301173", "0.5323714", "0.53021944", "0.5295187", "0.5251714", "0.5251714", "0.52447873", "0.52360255", "0.5177857", "0.51706415", "0.5140343", "0.51215106", "0.5114728", "0.5106417", "0.50975966", "0.50913197", "0.5069081", "0.5061356", "0.50431716", "0.50385743", "0.5032844", "0.5032844", "0.50236976", "0.50191957", "0.501522", "0.49371618", "0.49299115", "0.4922214", "0.48633754", "0.48523524", "0.48364642", "0.4832191", "0.48072678", "0.48032838", "0.47993216", "0.47983885", "0.47938958", "0.47891635", "0.47826567", "0.4780268", "0.4780268", "0.47723925", "0.47554192", "0.4753607", "0.47519967", "0.47451916", "0.47424987", "0.47339976", "0.47311127", "0.47259313", "0.47238207", "0.47131726", "0.47119427", "0.47118312", "0.47087413", "0.46998876", "0.46967873", "0.4694203", "0.46923062", "0.4688704", "0.46885064", "0.46869317", "0.4686924", "0.4669541", "0.4667388", "0.46640217", "0.4661443", "0.46591368", "0.46563196", "0.46558893", "0.46544102", "0.4651266", "0.4648053", "0.46476468", "0.46419388", "0.46384332", "0.4632764" ]
0.78455883
0
Gets the shareName value for this CustomContentInfo.
public java.lang.String getShareName() { return shareName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setShareName(java.lang.String shareName) {\n this.shareName = shareName;\n }", "public String getIsShare() {\n return isShare;\n }", "public Share getShare(String name) throws Exception{\n return (Share) collectionObjectFinder.search(this.getAllSharesAsSnapshot(), name, new ShareNotFoundException());\n }", "public java.lang.String getShareUserType() {\n return shareUserType;\n }", "@AutoEscape\n public String getShareholderName();", "public String getSharedSetName() {\r\n return sharedSetName;\r\n }", "public String name() {\n\t\treturn \"shared\";\n\t}", "@Override\n\tpublic ToolStripButton getShareButton() {\n\t\treturn shareButton;\n\t}", "public static Pair<Drawable, CharSequence> getShareableIconAndNameForText() {\n return getShareableIconAndName(getShareTextAppCompatibilityIntent());\n }", "public int getShare(){\n\t\treturn this.shares;\n\t}", "public void setShareholderName(String shareholderName);", "private static Pair<Drawable, CharSequence> getShareableIconAndName(Intent shareIntent) {\n Drawable directShareIcon = null;\n CharSequence directShareTitle = null;\n\n final ComponentName component = getLastShareComponentName();\n boolean isComponentValid = false;\n if (component != null) {\n shareIntent.setPackage(component.getPackageName());\n List<ResolveInfo> resolveInfoList =\n PackageManagerUtils.queryIntentActivities(shareIntent, 0);\n for (ResolveInfo info : resolveInfoList) {\n ActivityInfo ai = info.activityInfo;\n if (component.equals(new ComponentName(ai.applicationInfo.packageName, ai.name))) {\n isComponentValid = true;\n break;\n }\n }\n }\n if (isComponentValid) {\n boolean retrieved = false;\n final PackageManager pm = ContextUtils.getApplicationContext().getPackageManager();\n try {\n // TODO(dtrainor): Make asynchronous and have a callback to update the menu.\n // https://crbug.com/729737\n try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) {\n directShareIcon = pm.getActivityIcon(component);\n directShareTitle = pm.getActivityInfo(component, 0).loadLabel(pm);\n }\n retrieved = true;\n } catch (NameNotFoundException exception) {\n // Use the default null values.\n }\n RecordHistogram.recordBooleanHistogram(\n \"Android.IsLastSharedAppInfoRetrieved\", retrieved);\n }\n\n return new Pair<>(directShareIcon, directShareTitle);\n }", "@NonNull\n public String getCommonName() {\n return commonName;\n }", "public String getUrlForSharing() {\n PostData pd = getAdapter().getPost(mPager.getCurrentItem());\n return pd.getUrl();\n }", "public String getSLinkName() {\n return sLinkName;\n }", "protected String getName(){\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //Log.d(\"TYPE\", sharedPref.getString(\"accountType\", null));\n return sharedPref.getString(AppCSTR.ACCOUNT_NAME, null);\n }", "@Override\r\n\tpublic void ShowShare(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e( \"ShowShare\");\r\n\t}", "public String getName() {\n\t\tSharedPreferences settings = parentContext.getSharedPreferences(PREFERENCE_FILE,\n\t\t\t\tContext.MODE_PRIVATE);\n\t\treturn settings.getString(USERNAME_KEY, null);\n\t}", "public String getShareableStatus() {\n return shareableStatus;\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Shared \"+id;\n\t}", "public String getSiteName() {\n return siteName;\n }", "@Nullable\n @Generated\n @Selector(\"cloudKitShareMetadata\")\n public native CKShareMetadata cloudKitShareMetadata();", "protected String getSharedFileName()\n\t\t{\n\t\t\treturn null;\n\t\t}", "public String getCustomName ( ) {\n\t\treturn extract ( handle -> handle.getCustomName ( ) );\n\t}", "@Override\r\n\tpublic void ShowShare(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e(\"ShowShare\");\r\n\t}", "public ShareResourcesImpl getShareResources() {\n return this.shareResources;\n }", "public String getSiteName() {\r\n\t\treturn siteName;\r\n\t}", "public String getSiteName() {\n\t\treturn siteName;\n\t}", "public String siteName() {\n return this.siteName;\n }", "public String getLinkName() {\n return linkName;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getShare() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(SHARE_PROP.get());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getShare() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(SHARE_PROP.get());\n }", "@Override\n\tpublic String getContentShareable() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getContentShareable() {\n\t\treturn null;\n\t}", "public String getName() {\n return sname;\n }", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public String GetMediaTitle() {\n\t\treturn mediatitle;\n\t}", "public String getName() {\r\n\t\treturn this.title;\r\n\t}", "@ApiModelProperty(value = \"This field is optionally used by Push Payments Gateway participants (merchants and acquirers) to specify the network access priority.<br><br>Refer to <a href=\\\"/request_response_codes#network_id_and_sharing_group_code\\\">Sharing Group Code</a><br><br><b>Note:</b><br>Supported only in US for domestic transactions involving Push Payments Gateway Service.\")\n public String getSharingGroupCode() {\n return sharingGroupCode;\n }", "public StringKey getName() {\n return ModelBundle.SHIP_NAME.get(name);\n }", "@Internal(\"Represented as part of archivePath\")\n public String getArchiveName() {\n if (customName != null) {\n return customName;\n }\n String name = GUtil.elvis(getBaseName(), \"\") + maybe(getBaseName(), getAppendix());\n name += maybe(name, getVersion());\n name += maybe(name, getClassifier());\n name += GUtil.isTrue(getExtension()) ? \".\" + getExtension() : \"\";\n return name;\n }", "public String getImageCreativeName() {\r\n return imageCreativeName;\r\n }", "public String getNameSite(){\n return this.mFarm.getNameSite();\n }", "public String getWebSiteShowName() {\r\n\t\treturn webSiteShowName;\r\n\t}", "public static String retrieveFromSharePreference(String key) {\n\n return appSharePreference.getString(key, \"\");\n }", "public void setSharedSetName(String sharedSetName) {\r\n this.sharedSetName = sharedSetName;\r\n }", "@Override // com.android.server.wm.ConfigurationContainer\n public String getName() {\n return this.mName;\n }", "public String getSendName() {\r\n return sendName;\r\n }", "protected void shareIt() {\n\t\tIntent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\r\n\t\tsharingIntent.setType(\"text/plain\");\r\n\t\tString shareBody = content.getText().toString();\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sharing\");\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\r\n\t\tstartActivity(Intent.createChooser(sharingIntent, \"Share via\"));\r\n\t}", "public String getFreehostsharekey() {\r\n return freehostsharekey;\r\n }", "public String getName() \n {\n return m_sName;\n }", "@Override\n\tpublic String getName() {\n\t\treturn ((Extension)_item).getId() + \".\" + ((Extension)_item).getTitle();\n\t}", "public String getName() {\n\t\treturn this.data.getName();\n\t}", "String getLinkName();", "protected void showShare() {\n \t\tApplicationData applicationData;\n \t\ttry {\n \t\t\tapplicationData = ApplicationData.readApplicationData(this);\n \t\t\tif(applicationData != null){\n \t\t\t\tIntent intent = getIntent();\n \t\t\t\tNextLevel nextLevel = (NextLevel)intent.getSerializableExtra(ApplicationData.NEXT_LEVEL_TAG);\n \t\t\t\tAppLevelDataItem item = applicationData.getDataItem(this, nextLevel);\t\t\t\t\n \t\t\t\tAppDataItemText textItem;\n \t\t\t\ttry {\n \t\t\t\t\ttextItem = (AppDataItemText)item;\n \t\t\t\t\t\n \t\t\t\t\tIntent sharingIntent = new Intent(Intent.ACTION_SEND);\n \t\t\t\t\tsharingIntent.setType(\"text/plain\");\n \t\t\t\t\t//sharingIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { \"[email protected]\" });\n \t\t\t\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, textItem.getItemText());\n \t\t\t\t\tstartActivity(Intent.createChooser(sharingIntent,\"Compartir contenido\"));\n \n \t\t\t\t}catch (ClassCastException e) {\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (InvalidFileException e) {\n \t\t}\n \t}", "public java.lang.String getName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$26);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public java.lang.String getCardTypeName() {\r\n return cardTypeName;\r\n }", "@Override\n public String getName() {\n return \"Custom - \" + getTitle();\n }", "public String getCardName() {\n \t\treturn cardName;\n \t}", "public static String getName() {\n return name;\n }", "public String getCardName() {\r\n\t\treturn cardName;\r\n\t}", "public String getName() {\r\n\t\treturn name.get();\r\n\t}", "public String getName() {\n return _file.getAbsolutePath();\n }", "public Integer getShareholderid() {\r\n return shareholderid;\r\n }", "public String getName() {\n return name.get();\n }", "public String getLinkName();", "@Override\r\n\tpublic String getName() {\r\n\t\treturn this.title;\r\n\t}", "public String getScholarshipTitle() {\n\t\treturn scholarshipTitle;\n\t}", "public String getdipsplayname() {\n\t\treturn this.displayname;\n\t}", "public String getDisplayName()\n {\n return getString(\"DisplayName\");\n }", "public double getSharePrice() {\n\t\treturn sharePrice;\n\t}", "public String getName() {\n return name_;\n }", "public String getName() {\n return name_;\n }", "public String getName() {\n return name_;\n }", "public String GetName() {\n\t\treturn this.name;\n\t}", "public String getName ()\n {\n return name_;\n }", "public ScreenshareReason getReason() {\n return reason;\n }", "String getAbsoluteName() {\n return absoluteName;\n }", "public int getShareholderId() {\n\t\treturn shareholderId;\n\t}", "public BigDecimal getSharePct() {\n\t\treturn sharePct;\n\t}", "public String getTheName() {\n\t\treturn name.getText();\n\t}", "public byte[] share(Sharer s) {\n sharer = s;\n return segment_data;\n }", "public void onShareAdded(ShareEntry shareEntry);", "public String getName() {\n return (String) getValue(NAME);\n }", "public java.lang.String getName() {\r\n return this._name;\r\n }", "String getName() {\n return mName;\n }", "public String getName() {\r\n return _name;\r\n }", "protected void addShare() {\n \t\t((InputMethodManager) this.getContext().getSystemService(\n \t\t\t\tContext.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(\n \t\t\t\tthis.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n \t\tIntent intent = new Intent(Intent.ACTION_SEND);\n \t\tArrayList<String> images = this.mNoteItemModel.getImages();\n \t\tLog.i(TAG, images.toString());\n \t\tif (images.isEmpty())\n \t\t\tintent.setType(\"text/plain\");\n \t\telse if (images.size() == 1) {\n \t\t\tintent.setType(\"image/*\");\n \t\t} else if (images.size() > 1) {\n \t\t\tintent.setAction(Intent.ACTION_SEND_MULTIPLE);\n \t\t\tintent.setType(\"images/*\");\n \t\t}\n \t\tintent.putExtra(Intent.EXTRA_TITLE, \"Share my note...\");\n \t\tintent.putExtra(Intent.EXTRA_TEXT, this.mNoteItemModel.getContent());\n \t\tif (images.size() == 1) {\n \t\t\tUri uri = this.mNoteItemModel.getImageUri(images.get(0));\n \t\t\tintent.putExtra(Intent.EXTRA_STREAM, uri);\n \t\t} else if (images.size() > 1) {\n \t\t\tArrayList<Uri> uris = new ArrayList<Uri>();\n \t\t\tfor (String image : images) {\n \t\t\t\turis.add(this.mNoteItemModel.getImageUri(image));\n \t\t\t}\n \t\t\tintent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);\n \t\t}\n \t\tthis.getContext().startActivity(Intent.createChooser(intent, \"Share\"));\n \t}", "public String getName() {\r\n return mFile.getName();\r\n }", "@ApiModelProperty(value = \"A name commonly used by people to refer to this Service Site.\")\n\n\n public String getSiteName() {\n return siteName;\n }", "public String getName() {\n\t\t\treturn this.name;\n\t\t}", "public String getSname() {\n return sname;\n }", "public java.lang.String getName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$8);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public java.lang.String getName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$4);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getName() {\n return dishName;\n }", "public java.lang.String getName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$6);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "@Override\n\tpublic String getName() {\n\t\tfinal PsiElement nameIdentifier = getNameIdentifier();\n\t\treturn nameIdentifier != null ? nameIdentifier.getText() : getText();\n\t}", "public String getName()\r\n\t{\r\n\t\treturn this._name;\r\n\t}", "public String getName() {\n return name_;\n }", "public String getName() {\n\t\treturn _name;\n\t}" ]
[ "0.67472816", "0.627916", "0.597184", "0.5911845", "0.5878564", "0.5874765", "0.5834849", "0.58204705", "0.54810536", "0.54792583", "0.5468903", "0.5445566", "0.5438818", "0.5436207", "0.5282035", "0.5232004", "0.51992995", "0.51942605", "0.51940906", "0.51816624", "0.5140041", "0.51153755", "0.51059145", "0.51031035", "0.5096905", "0.5071758", "0.5050987", "0.50433856", "0.49962392", "0.49806854", "0.496441", "0.49131796", "0.49041405", "0.49041405", "0.48622507", "0.48615077", "0.4860432", "0.48381245", "0.4830393", "0.48236704", "0.4820131", "0.48123437", "0.48087782", "0.48003805", "0.47941345", "0.4786826", "0.47838375", "0.47764054", "0.47715288", "0.4762486", "0.47603333", "0.47450328", "0.47436932", "0.47369805", "0.4731854", "0.4731324", "0.47245708", "0.47159162", "0.4711757", "0.4702142", "0.47020024", "0.46980125", "0.46928918", "0.4691051", "0.46895465", "0.46727523", "0.46701914", "0.46696553", "0.4669123", "0.46609983", "0.46606496", "0.4658259", "0.4658259", "0.4658259", "0.4657073", "0.46568695", "0.46562517", "0.463825", "0.46336716", "0.4633649", "0.4626494", "0.46261212", "0.4621307", "0.46207497", "0.462074", "0.46207348", "0.46197167", "0.46181428", "0.46171114", "0.46151367", "0.46124595", "0.4610995", "0.4607953", "0.46070257", "0.46004212", "0.46003067", "0.4599238", "0.4599179", "0.45976612", "0.45947635" ]
0.8134476
0
Sets the shareName value for this CustomContentInfo.
public void setShareName(java.lang.String shareName) { this.shareName = shareName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getShareName() {\n return shareName;\n }", "public void setShareholderName(String shareholderName);", "public void setSharedSetName(String sharedSetName) {\r\n this.sharedSetName = sharedSetName;\r\n }", "public void setIsShare(String isShare) {\n this.isShare = isShare == null ? null : isShare.trim();\n }", "public Share getShare(String name) throws Exception{\n return (Share) collectionObjectFinder.search(this.getAllSharesAsSnapshot(), name, new ShareNotFoundException());\n }", "public void setName(String name) {\n\t\tSharedPreferences settings = parentContext.getSharedPreferences(PREFERENCE_FILE, 0);\n\t\tSharedPreferences.Editor editor = settings.edit();\n\t\teditor.putString(USERNAME_KEY, name);\n\t\teditor.commit();\n\t}", "@Override\r\n\tpublic void ShowShare(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e( \"ShowShare\");\r\n\t}", "public void setShareUserType(java.lang.String shareUserType) {\n this.shareUserType = shareUserType;\n }", "public String getIsShare() {\n return isShare;\n }", "private void setShareIntent(Intent shareIntent) {\n if (mShareActionProvider != null) {\n mShareActionProvider.setShareIntent(shareIntent);\n }\n }", "private void setShareIntent(Intent shareIntent) {\n if (mShareActionProvider != null) {\n mShareActionProvider.setShareIntent(shareIntent);\n }\n }", "@Override\r\n\tpublic void ShowShare(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e(\"ShowShare\");\r\n\t}", "public void setLinkName(String linkName);", "public void setName( String name ) {\n doCommand( new UpdateSegmentObject( getUser().getUsername(), getFlow(), \"name\", name ) );\n }", "public void changeShareIntent(ShareActionProvider mShareActionProvider, Intent shareIntent) {\n mShareActionProvider.setShareIntent(shareIntent);\n }", "public void setName(String name)\n {\n this.name = name;\n modifiedMetadata = true;\n addDetails(\"name\");\n }", "protected void shareIt() {\n\t\tIntent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\r\n\t\tsharingIntent.setType(\"text/plain\");\r\n\t\tString shareBody = content.getText().toString();\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sharing\");\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\r\n\t\tstartActivity(Intent.createChooser(sharingIntent, \"Share via\"));\r\n\t}", "public void setCommonName(@NonNull String commonName) {\n this.commonName = commonName;\n }", "public void setCustomName ( String name ) {\n\t\texecute ( handle -> handle.setCustomName ( name ) );\n\t}", "public void setNameSite(String nameSite){\n this.mFarm.setNameSite(nameSite);\n }", "@External\n\tpublic void set_game_developers_share(BigInteger _share) {\n\t\t\n\t\tif (!Context.getCaller().equals(Context.getOwner())) {\n\t\t\tContext.revert(\"This function can only be called by GAS owner\");\n\t\t}\n\t\tthis.game_developers_share.set(_share);\n\t}", "public void setSiteName(String siteName) {\n this.siteName = siteName;\n }", "public void setName(String name) {\r\n\t\tthis.title = name;\r\n\t}", "private void setShareIntent(String text) {\n\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, text);\n sendIntent.setType(\"text/plain\");\n\n if (shareActionProvider != null) {\n shareActionProvider.setShareIntent(sendIntent);\n }\n }", "private void setShareIntent(Intent shareIntent) {\n if(shareIntent.resolveActivity(getActivity().getPackageManager())!=null) {\n if (mShareActionProvider != null) {\n mShareActionProvider.setShareIntent(shareIntent);\n }\n } else {\n Toast.makeText(getActivity(), R.string.no_application_found,Toast.LENGTH_LONG).show();\n }\n }", "public void setName(String name) {\n\t\tmName = name;\n\t}", "public void setName(String name) {\r\n\t\t_name = name;\r\n\t}", "@Override\n\tpublic void onShareButton() {\n\t\tDialogs.getShareEditDialog(this, false).show();\n\t}", "public void setName(final String name) {\n mName = name;\n }", "@Override\n\tpublic void setName(String name) throws RemoteException {\n\t\tthis.name = name;\n\t}", "public void setName(String name) {\r\n this._name = name;\r\n }", "@Override\r\n\tpublic void setName(String name) {\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\n this.mName = name;\n }", "public void setSiteName(String siteName) {\r\n\t\tthis.siteName = siteName;\r\n\t}", "public void setName(String name) {\n m_Name = name;\n }", "public void setName(String name)\r\n {\r\n this.mName = name;\r\n }", "@Override\n\tpublic void setName(java.lang.String name) {\n\t\t_scienceApp.setName(name);\n\t}", "protected void setName(String name) {\n this._name = name;\n }", "public void setName(String name) {\n _name = name;\n }", "protected void addShare() {\n \t\t((InputMethodManager) this.getContext().getSystemService(\n \t\t\t\tContext.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(\n \t\t\t\tthis.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n \t\tIntent intent = new Intent(Intent.ACTION_SEND);\n \t\tArrayList<String> images = this.mNoteItemModel.getImages();\n \t\tLog.i(TAG, images.toString());\n \t\tif (images.isEmpty())\n \t\t\tintent.setType(\"text/plain\");\n \t\telse if (images.size() == 1) {\n \t\t\tintent.setType(\"image/*\");\n \t\t} else if (images.size() > 1) {\n \t\t\tintent.setAction(Intent.ACTION_SEND_MULTIPLE);\n \t\t\tintent.setType(\"images/*\");\n \t\t}\n \t\tintent.putExtra(Intent.EXTRA_TITLE, \"Share my note...\");\n \t\tintent.putExtra(Intent.EXTRA_TEXT, this.mNoteItemModel.getContent());\n \t\tif (images.size() == 1) {\n \t\t\tUri uri = this.mNoteItemModel.getImageUri(images.get(0));\n \t\t\tintent.putExtra(Intent.EXTRA_STREAM, uri);\n \t\t} else if (images.size() > 1) {\n \t\t\tArrayList<Uri> uris = new ArrayList<Uri>();\n \t\t\tfor (String image : images) {\n \t\t\t\turis.add(this.mNoteItemModel.getImageUri(image));\n \t\t\t}\n \t\t\tintent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);\n \t\t}\n \t\tthis.getContext().startActivity(Intent.createChooser(intent, \"Share\"));\n \t}", "@Override\n public void setName(String name) {\n this.name = name;\n }", "@Override\n public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n\t this.name = name;\n\t }", "public void setName(String mName) {\n this.mName = mName;\n }", "public void setName(String name) {\n if (!name.isEmpty()) {\n this.name = name;\n }\n }", "public void setName(java.lang.String name)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NAME$26);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NAME$26);\r\n }\r\n target.setStringValue(name);\r\n }\r\n }", "public void setName(String name) {\n mBundle.putString(KEY_NAME, name);\n }", "@Override\n\tpublic void setName(String name) {\n\t\tthis.name = name;\n\t}", "public void setName(String name) {\n\t\tName = name;\n\t}", "public void plotShare()\r\n\t{\r\n\t\tSystem.out.println(\"Name: \" + name + \" Short name: \" + shortName + \" WKN: \" + wkn);\r\n\t\tif(share == null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Entry has no data yet. If you want to update the data use the 'IMPORT' function\\n\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tshare.plot();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void setName(String name) {\n\t\tthis.name = name;\n\n\t}", "public void setName(String name) {\n\t\t\tthis.name = name;\n\t\t}", "public void setName(String name) {\n\t\t\tthis.name = name;\n\t\t}", "public void setName(String name)\r\n {\r\n m_name = name;\r\n }", "private void setCustomName(String name) {\n this.name = ChatColorConverter.convert(name);\n this.getLivingEntity().setCustomName(this.name);\n this.hasCustomName = true;\n if (ConfigValues.defaultConfig.getBoolean(DefaultConfig.ALWAYS_SHOW_NAMETAGS))\n eliteMob.setCustomNameVisible(true);\n }", "public void setName(String name)\n {\n if (name == null || DefaultFileHandler.sanitizeFilename(name, getLogger()).isEmpty())\n {\n throw new NullPointerException(\"Custom deployable name cannot be null or empty\");\n }\n this.name = name;\n }", "public void share(View view){\n Toast.makeText(this, \"Loading share options ...\", Toast.LENGTH_SHORT).show();\n //Create an intent to share\n Intent sharingIntent = new Intent(Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n String shareBody = \"You should check out \" + getString(R.string.app_name) + \", an app where you can easily find books at the school library!\";\n if(currentBook.title != null)\n shareBody = \"Check out \\\"\" + currentBook.title + \"\\\", a book that I found with the app, \" + getString(R.string.app_name);\n sharingIntent.putExtra(Intent.EXTRA_SUBJECT, \"\" + getString(R.string.app_name));\n sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);\n startActivity(Intent.createChooser(sharingIntent, \"Share via\"));\n }", "public void setName (String name) {\n this.name = name;\n }", "public void setName (String name) {\n this.name = name;\n }", "public void setName (String name) {\n this.name = name;\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "@Override\n\tpublic void setName(String name) {\n\t\tsuper.setName(name);\n\t}", "@Override\n\tpublic void setName(String name) {\n\t\tsuper.setName(name);\n\t}", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n\n this.name = name;\n }", "@Override\n\tpublic void setName(String name) {\n\t\tcomparedChart.setName(name);\n\t}", "public void onShareAdded(ShareEntry shareEntry);", "public void setName(final String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(final String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name)\n {\n this.name = name;\n }", "protected void setName(String name) {\n this.name = name;\n }", "protected void setName(final String theName)\r\n {\r\n _theName = theName;\r\n }", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}" ]
[ "0.6989729", "0.6349417", "0.5972731", "0.5821812", "0.53689605", "0.5347893", "0.5309321", "0.5291541", "0.5289067", "0.52571213", "0.52571213", "0.5213136", "0.5208696", "0.5203485", "0.51423067", "0.51393944", "0.5123863", "0.5093585", "0.50730395", "0.505705", "0.5053612", "0.5049085", "0.50423586", "0.50388104", "0.50210017", "0.5019391", "0.5018399", "0.50047475", "0.50033146", "0.4999597", "0.49950674", "0.49838874", "0.49815807", "0.49714985", "0.49650106", "0.49562886", "0.49530622", "0.4937102", "0.49348572", "0.49339366", "0.49314636", "0.49314636", "0.49296826", "0.49238917", "0.49201697", "0.49177298", "0.49133885", "0.49131143", "0.4912268", "0.4911218", "0.49082798", "0.49002224", "0.49002224", "0.4895716", "0.48931208", "0.48906386", "0.4886296", "0.48826846", "0.48826846", "0.48826846", "0.48812887", "0.48772794", "0.48772794", "0.48761293", "0.48761293", "0.48761293", "0.48761293", "0.48702475", "0.48671466", "0.48628247", "0.48609084", "0.48609084", "0.48558885", "0.4851398", "0.4848636", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878", "0.48467878" ]
0.8335743
0
Gets the shareUserType value for this CustomContentInfo.
public java.lang.String getShareUserType() { return shareUserType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setShareUserType(java.lang.String shareUserType) {\n this.shareUserType = shareUserType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n\t\treturn _userType;\n\t}", "public int getUserType() {\n\t\treturn userType;\n\t}", "public java.lang.String getShareName() {\n return shareName;\n }", "public Short getUserType() {\r\n return userType;\r\n }", "public String getUsercomtype() {\n\t\treturn usercomtype;\n\t}", "public Byte getUserType() {\n return userType;\n }", "public String getUsertype() {\n return usertype;\n }", "public Byte getUserType() {\r\n return userType;\r\n }", "public String getIsShare() {\n return isShare;\n }", "protected String getType(){\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //Log.d(\"TYPE\", sharedPref.getString(\"accountType\", null));\n return sharedPref.getString(AppCSTR.ACCOUNT_TYPE, null);\n }", "public Integer getUsertype() {\n return usertype;\n }", "public java.lang.String getUsertype() {\n return usertype;\n }", "@NotNull\n\tpublic UserType getType() {\n\t\treturn super.getTypeEnum();\n\t}", "public UserType getUserType() {\n\t\tif (userType == CustomerControl.dummyUserType)\n\t\t\tuserType = CustomerControl.getUserTypeById(userTypeID);\n\t\treturn userType;\n\t}", "public String getRcTypeUser() {\r\n return rcTypeUser;\r\n }", "public String getOwnerType() {\n\t\treturn ownerType;\n\t}", "public String getManageType() {\n return manageType;\n }", "public java.lang.String getVideoUserUserTypeGuid() {\n return videoUserUserTypeGuid;\n }", "public String getShareableStatus() {\n return shareableStatus;\n }", "public pl.stormit.protobuf.UserProtos.User.UserType getUserType() {\n pl.stormit.protobuf.UserProtos.User.UserType result = pl.stormit.protobuf.UserProtos.User.UserType.valueOf(userType_);\n return result == null ? pl.stormit.protobuf.UserProtos.User.UserType.NORMAL : result;\n }", "public pl.stormit.protobuf.UserProtos.User.UserType getUserType() {\n pl.stormit.protobuf.UserProtos.User.UserType result = pl.stormit.protobuf.UserProtos.User.UserType.valueOf(userType_);\n return result == null ? pl.stormit.protobuf.UserProtos.User.UserType.NORMAL : result;\n }", "public static String getUserType()\n {\n try\n {\n if (userType == \"\")\n {\n System.out.println(\"User type not set\");\n return \"\";\n }\n else\n {\n return userType;\n }\n }\n catch (Exception exc)\n {\n System.out.println(\"User type error: \" + exc.toString());\n return \"\";\n }\n }", "public OwnerType getOwnerType() {\n\t\treturn ownerType;\n\t}", "public Integer getUserTypeId() {\n return userTypeId;\n }", "public SocialAddressTypeCodeType getSocialAddressType() {\n\t return this.socialAddressType;\n\t}", "public String getMembershipType() {\n return membershipType;\n }", "public Integer getUserTypeId()\n {\n return userTypeId;\n }", "public int getShare(){\n\t\treturn this.shares;\n\t}", "public java.lang.String getVideoUserUserTypeName() {\n return videoUserUserTypeName;\n }", "public String getAccountType() {\n return accountType;\n }", "public String getAccountType() {\n return accountType;\n }", "@Override\n\tpublic TLEType getType() {\n\t\ttry {\n\t\t\tUser current_user = AccountManager.current_account.getUser();\n\t\t\tif (this.user.id == current_user.id) {\n\t\t\t\treturn TLEType.OWN;\n\t\t\t}\n\t\t\tif (this.mentionsUser(current_user)) {\n\t\t\t\treturn TLEType.MENTION;\n\t\t\t}\n\t\t\tif (this.id > AccountManager.current_account.getMaxReadTweetID()) {\n\t\t\t\treturn TLEType.UNREAD;\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\n\t\t}\n\t\treturn TLEType.READ;\n\t}", "public int getEditAuthUserType() {\n return editAuthUserType;\n }", "public java.lang.String getSecurityType() {\r\n return securityType;\r\n }", "@Override\n public String getTypeForDisplay() {\n return \"User\";\n }", "public int getAccountType() {\r\n return accountType;\r\n }", "UserType getType();", "public java.lang.String getOrganizationType() {\n return organizationType;\n }", "public UserCompact getUserOwnedBy()\n {\n return userOwnedBy;\n }", "@Override\n\tpublic ToolStripButton getShareButton() {\n\t\treturn shareButton;\n\t}", "public __Type getSubscriptionType() {\n return (__Type) get(\"subscriptionType\");\n }", "public String getType() {\n return \"uid\";\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getShare() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(SHARE_PROP.get());\n }", "public String getSysType() {\n return sysType;\n }", "public Integer getShareholderid() {\r\n return shareholderid;\r\n }", "@Column(name = \"ACCOUNT_TYPE\")\n\tpublic String getAccountType()\n\t{\n\t\treturn accountType;\n\t}", "public String getWashType() {\n return (String) getAttributeInternal(WASHTYPE);\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getShare() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(SHARE_PROP.get());\n }", "public PersonUserType getUserType() throws NotLoadedException {\n return userType.getValue();\n }", "java.lang.String getAppType();", "public SecurityType getSecurityType() {\n return securityType;\n }", "@Override\n\tpublic String getDisplayText() {\n\t\tif (userType == null)\n\t\t\treturn \"New user type\"; //$NON-NLS-1$\n\n\t\treturn \"Edit user type\"; //$NON-NLS-1$\n\t}", "public AccountType getAccountType() {\n return accountType;\n }", "public AccountType getAccountType() {\n return accountType;\n }", "public String getFacebookUserId() {\n return sp.getString(FACEBOOK_USER_ID, null);\n }", "public String getSrcCompanyType() {\r\n return (String) getAttributeInternal(SRCCOMPANYTYPE);\r\n }", "@Nullable\n @Generated\n @Selector(\"handoffUserActivityType\")\n public native String handoffUserActivityType();", "public int getLoginType() {\n return loginType_;\n }", "public String getOwnerUsername(long shareableSchemaID)\n\t{\n\t\tString ownerUsername = null;\n\t\t\n\t\t//Connecting to data base\n \t\tconnect();\n \t\t\n\t\tif (dbConnection == null)\t\t\t\t\t\t\t//failed connection\n \t\t{\n \t\t\treturn null;\n \t\t}\n \t\t\n \t\t//Proceeding, if database connection is successful\n \t\tResultSet rsOwnerUser = null; \t\t\n \t\ttry\n \t\t{\n \t\t\t//Fetching owner username of shareable schema from the user schema database\n \t\t\tString ownerQuery = \"SELECT owner_username FROM shareable_schema WHERE schema_id = ? ;\";\n \t\t\tPreparedStatement prepStmt = dbConnection.prepareStatement(ownerQuery);\n \t\t\tprepStmt.setLong(1, shareableSchemaID);\n \t\t\t\n \t\t\trsOwnerUser = prepStmt.executeQuery();\n \t\t\tif (rsOwnerUser.next())\n \t\t\t\townerUsername = rsOwnerUser.getString(1);\n \t\t\t\n \t\t\trsOwnerUser.close();\n \t\t\tprepStmt.close();\n \t\t}\n \t\tcatch (SQLException sqle)\n \t\t{\n \t\t\trsOwnerUser = null;\n \t\t\tlog.error(\"SQLException occurred while fetching owner username from user schema database... \" + sqle.getMessage());\n \t\t}\n \t\tfinally\n \t\t{\n \t\t\tdisconnect();\n \t\t}\n \t\t \t\t\n \t\treturn ownerUsername;\n\t}", "public String getSuptypeNo() {\n return suptypeNo;\n }", "public int getLoginType() {\n return loginType_;\n }", "public Integer getJuserType() {\n return juserType;\n }", "public String getOrganizationType() {\n\t\treturn organizationType;\n\t}", "public String getClientType() {\n return (String)getAttributeInternal(CLIENTTYPE);\n }", "public String getWindowType() {\n\t\treturn windowType;\n\t}", "im.turms.common.constant.ChatType getChatType();", "public String getType() {\n if (this.mInvitation != null) return TYPE_INVITATION;\n else if (this.mChatMessageFragment != null) return TYPE_CHAT_MESSAGE;\n else return null;\n }", "public String getOwnerEntityType()\r\n\t{\r\n\t\treturn ownerEntityType;\r\n\t}", "@External(readonly = true)\n\tpublic BigInteger get_game_developers_share() {\n\t\t\n\t\treturn this.game_developers_share.get(); \n\t}", "public java.lang.String getStructuretype()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STRUCTURETYPE$2);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public java.lang.String getTypeName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TYPENAME$6);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getClaimType(){\n\t\treturn this.claimType;\n\t}", "public static String getType() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(App.getAppContext());\n String defaultValue = Strings.getStringByRId(R.string.c_elastic_search_type_name_default_value);\n String value = Strings.getStringByRId(R.string.c_select_elastic_search_type_name);\n String type = sp.getString(value, defaultValue);\n return type;\n }", "PlatformComponentType getActorSendType();", "public String getRelationshipTypeGUID()\n {\n return relationshipTypeGUID;\n }", "public String getSharedSetName() {\r\n return sharedSetName;\r\n }", "public com.profitbricks.api.ws.OsType getOsType() {\r\n return osType;\r\n }", "@ApiModelProperty(value = \"This field is optionally used by Push Payments Gateway participants (merchants and acquirers) to specify the network access priority.<br><br>Refer to <a href=\\\"/request_response_codes#network_id_and_sharing_group_code\\\">Sharing Group Code</a><br><br><b>Note:</b><br>Supported only in US for domestic transactions involving Push Payments Gateway Service.\")\n public String getSharingGroupCode() {\n return sharingGroupCode;\n }", "public byte getSType() {\r\n return _sType;\r\n }", "public String getSystemType() {\n \t\treturn fSystemType;\n \t}", "public ShareResourcesImpl getShareResources() {\n return this.shareResources;\n }", "public String getType() {\n return (String) getObject(\"type\");\n }", "public Constants.UsageType getUsageType() {\n return this.usageType;\n }", "public String getTypeAccountInNumber() {\n return typeAccountInNumber;\n }", "public java.lang.String getMediaType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(MEDIATYPE$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(MEDIATYPE$18);\n }\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "@java.lang.Override public int getDisplayUploadProductTypeValue() {\n return displayUploadProductType_;\n }", "public String getAuthenticationType() {\n return this.authenticationType;\n }", "@java.lang.Override public int getDisplayUploadProductTypeValue() {\n return displayUploadProductType_;\n }", "public boolean userType()\n {\n return false;\n }", "public String getScimType() {\n return scimType == null ? \"\" : scimType.getValue();\n }", "public int getType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(TYPE$2);\n if (target == null)\n {\n return 0;\n }\n return target.getIntValue();\n }\n }", "public OSType osType() {\n return this.osType;\n }", "@Override\n\tpublic com.google.gwt.event.shared.GwtEvent.Type<LoadProfileItemEventHandler> getAssociatedType() {\n\t\treturn TYPE;\n\t}", "int getLoginType();", "@Override\n public final Integer getOwnerType() {\n return null;\n }" ]
[ "0.6994159", "0.59299964", "0.59299964", "0.59299964", "0.59299964", "0.59146637", "0.57210505", "0.5710259", "0.5683617", "0.5663514", "0.55762637", "0.5568301", "0.55639625", "0.55527174", "0.546308", "0.5405414", "0.5369842", "0.53136355", "0.5258311", "0.5248842", "0.5247777", "0.5184186", "0.51767564", "0.51691496", "0.51223683", "0.51045334", "0.5063315", "0.50368166", "0.50215423", "0.50176775", "0.50012374", "0.4991287", "0.49464926", "0.49463165", "0.49458268", "0.49458268", "0.49281335", "0.49166805", "0.490249", "0.48724324", "0.48188904", "0.48183417", "0.47884494", "0.47855535", "0.47814456", "0.4777941", "0.4772012", "0.47580346", "0.47542933", "0.47437814", "0.4740481", "0.47316724", "0.47305867", "0.4722847", "0.4713904", "0.46947598", "0.4686625", "0.46862686", "0.46862686", "0.46828082", "0.4680584", "0.4677802", "0.4671601", "0.46649805", "0.46547723", "0.4653653", "0.46529177", "0.46253738", "0.46224612", "0.46041414", "0.46039474", "0.45995453", "0.45939225", "0.45882344", "0.4584721", "0.4564574", "0.45514628", "0.4529194", "0.45152983", "0.45118913", "0.45076048", "0.45069727", "0.4503747", "0.44919717", "0.44863448", "0.44861302", "0.44857824", "0.44844308", "0.44735318", "0.44684327", "0.4466994", "0.44663522", "0.44581288", "0.44562933", "0.44496033", "0.44482443", "0.44370386", "0.4435955", "0.44354966", "0.4435073" ]
0.8369713
0
Sets the shareUserType value for this CustomContentInfo.
public void setShareUserType(java.lang.String shareUserType) { this.shareUserType = shareUserType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getShareUserType() {\n return shareUserType;\n }", "public void setUserType(String userType) {\n\t\t_userType = userType;\n\t}", "public void setUserType(UserType userType) {\n\t\tthis.userType = userType;\n\t\tif (userType != CustomerControl.dummyUserType)\n\t\t\tthis.userTypeID=userType.getUserTypeID();\n\t}", "public void setUserType(Byte userType) {\r\n this.userType = userType;\r\n }", "public void setIsShare(String isShare) {\n this.isShare = isShare == null ? null : isShare.trim();\n }", "public void setShareName(java.lang.String shareName) {\n this.shareName = shareName;\n }", "public void setUserType(Byte userType) {\n this.userType = userType;\n }", "public void setUserType(String userType) {\n this.userType = userType;\n }", "@External\n\tpublic void set_game_developers_share(BigInteger _share) {\n\t\t\n\t\tif (!Context.getCaller().equals(Context.getOwner())) {\n\t\t\tContext.revert(\"This function can only be called by GAS owner\");\n\t\t}\n\t\tthis.game_developers_share.set(_share);\n\t}", "public void setUserType(String userType) {\n this.userType = userType == null ? null : userType.trim();\n }", "public void setUserType(String userType) {\n this.userType = userType == null ? null : userType.trim();\n }", "public void setUserType(String userType) {\n this.userType = userType == null ? null : userType.trim();\n }", "void setType(final UserType type);", "private void setShareIntent(Intent shareIntent) {\n if (mShareActionProvider != null) {\n mShareActionProvider.setShareIntent(shareIntent);\n }\n }", "private void setShareIntent(Intent shareIntent) {\n if (mShareActionProvider != null) {\n mShareActionProvider.setShareIntent(shareIntent);\n }\n }", "public void setUserTypeId(Integer userTypeId)\n {\n this.userTypeId = userTypeId;\n }", "public void setUserType(String type) {\r\n switch(type) {\r\n case (\"admin\"): \r\n this.userType = 0;\r\n break;\r\n case (\"seller\"):\r\n this.userType = 1;\r\n break;\r\n case (\"buyer\"):\r\n this.userType = 2;\r\n break;\r\n \r\n }\r\n }", "public void setUserTypeId(final Integer userTypeId) {\n this.userTypeId = userTypeId;\n }", "public void setUsercomtype(String usercomtype) {\n\t\tthis.usercomtype = usercomtype == null ? null : usercomtype.trim();\n\t}", "@Override\r\n\tpublic void ShowShare(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e( \"ShowShare\");\r\n\t}", "public void setUsertype(String usertype) {\n this.usertype = usertype;\n }", "@Override\r\n\tpublic void ShowShare(Context _in_context, String _in_data) {\n\t\tTypeSDKLogger.e(\"ShowShare\");\r\n\t}", "public ShareFileHttpHeaders setContentType(String contentType) {\n this.contentType = contentType;\n return this;\n }", "private void setShareIntent(Intent shareIntent) {\n if(shareIntent.resolveActivity(getActivity().getPackageManager())!=null) {\n if (mShareActionProvider != null) {\n mShareActionProvider.setShareIntent(shareIntent);\n }\n } else {\n Toast.makeText(getActivity(), R.string.no_application_found,Toast.LENGTH_LONG).show();\n }\n }", "public void setUsertype(java.lang.String usertype) {\n this.usertype = usertype;\n }", "public String getIsShare() {\n return isShare;\n }", "public void changeShareIntent(ShareActionProvider mShareActionProvider, Intent shareIntent) {\n mShareActionProvider.setShareIntent(shareIntent);\n }", "public void setUsertype(Integer usertype) {\n this.usertype = usertype;\n }", "public void gppShare_setURLToShareAndOpen (String urlToShare) {\n\t\tGPPShare.sharedInstance().shareDialog().setURLToShare(new NSURL(urlToShare)).open();\n\t}", "public void setMailShareholder(String mailShareholder);", "public void setShareholderName(String shareholderName);", "private void setShareIntent(String text) {\n\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, text);\n sendIntent.setType(\"text/plain\");\n\n if (shareActionProvider != null) {\n shareActionProvider.setShareIntent(sendIntent);\n }\n }", "protected void addShare() {\n \t\t((InputMethodManager) this.getContext().getSystemService(\n \t\t\t\tContext.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(\n \t\t\t\tthis.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);\n \t\tIntent intent = new Intent(Intent.ACTION_SEND);\n \t\tArrayList<String> images = this.mNoteItemModel.getImages();\n \t\tLog.i(TAG, images.toString());\n \t\tif (images.isEmpty())\n \t\t\tintent.setType(\"text/plain\");\n \t\telse if (images.size() == 1) {\n \t\t\tintent.setType(\"image/*\");\n \t\t} else if (images.size() > 1) {\n \t\t\tintent.setAction(Intent.ACTION_SEND_MULTIPLE);\n \t\t\tintent.setType(\"images/*\");\n \t\t}\n \t\tintent.putExtra(Intent.EXTRA_TITLE, \"Share my note...\");\n \t\tintent.putExtra(Intent.EXTRA_TEXT, this.mNoteItemModel.getContent());\n \t\tif (images.size() == 1) {\n \t\t\tUri uri = this.mNoteItemModel.getImageUri(images.get(0));\n \t\t\tintent.putExtra(Intent.EXTRA_STREAM, uri);\n \t\t} else if (images.size() > 1) {\n \t\t\tArrayList<Uri> uris = new ArrayList<Uri>();\n \t\t\tfor (String image : images) {\n \t\t\t\turis.add(this.mNoteItemModel.getImageUri(image));\n \t\t\t}\n \t\t\tintent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);\n \t\t}\n \t\tthis.getContext().startActivity(Intent.createChooser(intent, \"Share\"));\n \t}", "@Override\n\tpublic void onShareButton() {\n\t\tDialogs.getShareEditDialog(this, false).show();\n\t}", "public java.lang.String getShareName() {\n return shareName;\n }", "public void setShare(java.math.BigDecimal value) {\n __getInternalInterface().setFieldValue(SHARE_PROP.get(), value);\n }", "public void shareSocial(Activity act,UiLifecycleHelper uiHelper, SocialType socialToShare,\n String title, String text, String shareUrl, String[] recipients, boolean fromGmail)\n {\n switch (socialToShare) {\n case FACEBOOK:\n this._fbAppShare(act, uiHelper, shareUrl, text);\n break;\n case TWITTER:\n this._tweetShare(act, title, text);\n break;\n case EMAIL:\n this._emailShare(act, title, text, recipients, fromGmail);\n break;\n }\n }", "public static void shareWithSystemShareSheetUi(\n ShareParams params, @Nullable Profile profile, boolean saveLastUsed) {\n shareWithSystemShareSheetUi(params, profile, saveLastUsed, null);\n }", "public void setType(int type)\n {\n editor.putInt(KEY_TYPE, type);\n // commit changes\n editor.commit();\n Log.d(TAG,\"user type modified in pref\");\n }", "public void setSocialAddressType(SocialAddressTypeCodeType socialAddressType) {\n\t this.socialAddressType = socialAddressType;\n\t}", "public abstract void setContentType(ContentType contentType);", "public void setShare(java.math.BigDecimal value) {\n __getInternalInterface().setFieldValue(SHARE_PROP.get(), value);\n }", "public void setUserType(int type) throws IllegalArgumentException {\n\t\tif (type != TELEPHONE_SUBSCRIBER && type != USER) {\n\t\t\tthrow new IllegalArgumentException(\"Parameter not in range\");\n\t\t}\n\t\tuserType = type;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_detail, menu);\n MenuItem mi = menu.findItem(R.id.shareid);\n\n sap = (ShareActionProvider) MenuItemCompat.getActionProvider(mi);\n Intent iu = new Intent(Intent.ACTION_SEND);\n TextView tv = (TextView) findViewById(R.id.my_weat);\n data = tv.getText().toString();\n iu.setType(\"text/plain\");\n Log.e(\"hello\", data);\n iu.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);\n iu.putExtra(Intent.EXTRA_TEXT, data + \" #Sunshineapp\");\n if(sap!=null) {\n Log.e(\"uclicked\", \"share button\");\n sap.setShareIntent(iu);\n //startActivity(iu);\n }\n return true;\n }", "protected void shareIt() {\n\t\tIntent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);\r\n\t\tsharingIntent.setType(\"text/plain\");\r\n\t\tString shareBody = content.getText().toString();\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sharing\");\r\n\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);\r\n\t\tstartActivity(Intent.createChooser(sharingIntent, \"Share via\"));\r\n\t}", "public void setSharedSetName(String sharedSetName) {\r\n this.sharedSetName = sharedSetName;\r\n }", "protected <T> void setSharedContextVariable(String name, Class<T> type, T value) {\r\n T typedValue = TypeCastUtility.castValue(value, type);\r\n m_sharedVariableMap.put(name, typedValue);\r\n }", "public interface ShareInterface {\n\n/** 是否显示管理菜单 置顶, 删除*/\n// public boolean visibleManager ();\n\n/** 是否是置顶 2置顶, 其他 解除置顶 */\n public String getStick ();\n /** 是否是置顶 2置顶, 其他 解除置顶 */\n public void setStick (String s);\n\n/** 是否显示报名管理, 1线下活动, 2 线上活动,999 系列活动 , 显示管理, 其他不显示*/\n public String getCategory ();\n/** 创始人标记, 是否显示删除 1 创始人(显示删除)*/\n public String getIsJoin ();\n\n /**\n * 是否为新版的线下活动贴, null 否, 不为空 是新版活动帖\n * @return\n */\n public String getNewActive();\n\n /**\n * 俱乐部Id\n * @return\n */\n public String getClubId ();\n\n /**\n * 帖子Id\n * @return\n */\n public String getTopicId ();\n\n /**\n * 图片Url 地址\n * @return\n */\n public String getImageUrl ();\n\n /**\n * 分享显示标题\n * @return\n */\n public String getTitle ();\n\n /**\n * 分享内容\n * @return\n */\n public String getShareTxt ();\n\n /**\n * 分享连接地址\n * @return\n */\n public String getShareUrl ();\n\n /**\n * 帖子类型\n * @return 0, 其他, 1, 线上\n */\n public int getType();\n\n\n}", "public void setManageType(String manageType) {\n this.manageType = manageType == null ? null : manageType.trim();\n }", "public void setContentType(String contentType);", "public void setShareableStatus(String shareableStatus) {\n if (SHAREABLE_STATUS_ENUM.contains(shareableStatus)) {\n this.shareableStatus = shareableStatus;\n } else {\n throw new IllegalArgumentException(\"Invalid ShareableStatus value: \" + shareableStatus);\n }\n }", "private void shareTotalScore(String typeOfShare) {\n final String fbType = getResources().getString(R.string.action_share_on_facebook);\n\n if (typeOfShare.equals(fbType)) {\n // Share total score on Facebook social network\n shareOnFacebook();\n } else {\n // Share total score on P2A web\n shareOnP2A();\n }\n }", "@Override\n\tpublic Boolean setUserId(String openId, UserAccountType type, Long userId) {\n\t\tString key = CacheConstants.KEY_PRE_XLUSERID_BY_OPENID_TYPE + openId + \":\" + type.name();\n\t\treturn cache.set(key, userId, CacheConstants.EXPIRE_XLUSERID_BY_OPENID_TYPE) > 0;\n\t}", "public void registerMedia(String mediaTypeId,String period,String sendTo) {\r\n\t\tmediaUser.put(\"active\", 0);\r\n\t\tmediaUser.put(\"mediatypeid\", mediaTypeId);\r\n\t\tmediaUser.put(\"period\", period);\r\n\t\tmediaUser.put(\"sendto\", sendTo);\r\n\t\t//mediaUser.put(\"userid\", userId);\r\n\t\tmediaUser.put(\"severity\", 0);\r\n\t}", "@OptIn(markerClass = BuildCompat.PrereleaseSdkCheck.class)\n public static void shareWithSystemShareSheetUi(ShareParams params, @Nullable Profile profile,\n boolean saveLastUsed, @Nullable ChromeCustomShareAction.Provider customActionProvider) {\n assert (customActionProvider == null || ChooserActionHelper.isSupported())\n : \"Custom action is not supported.\";\n\n recordShareSource(ShareSourceAndroid.ANDROID_SHARE_SHEET);\n if (saveLastUsed) {\n params.setCallback(new SaveComponentCallback(profile, params.getCallback()));\n }\n Intent intent = getShareIntent(params);\n\n sendChooserIntent(params.getWindow(), intent, params.getCallback(), customActionProvider);\n }", "public void setOwnerType(OwnerType ownerType) {\n\t\tthis.ownerType = ownerType;\n\t}", "public void share(View view){\n Toast.makeText(this, \"Loading share options ...\", Toast.LENGTH_SHORT).show();\n //Create an intent to share\n Intent sharingIntent = new Intent(Intent.ACTION_SEND);\n sharingIntent.setType(\"text/plain\");\n String shareBody = \"You should check out \" + getString(R.string.app_name) + \", an app where you can easily find books at the school library!\";\n if(currentBook.title != null)\n shareBody = \"Check out \\\"\" + currentBook.title + \"\\\", a book that I found with the app, \" + getString(R.string.app_name);\n sharingIntent.putExtra(Intent.EXTRA_SUBJECT, \"\" + getString(R.string.app_name));\n sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);\n startActivity(Intent.createChooser(sharingIntent, \"Share via\"));\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch (id) {\n case R.id.logout:\n // signout();\n return true;\n\n case R.id.share:\n\n String nombre, correo;\n nombre = mAuth.getCurrentUser().getDisplayName();\n correo = mAuth.getCurrentUser().getEmail();\n Intent sendIntent = new Intent();\n sendIntent.setAction(Intent.ACTION_SEND);\n sendIntent.putExtra(Intent.EXTRA_TEXT, nombre + \"\\n\" + correo);\n sendIntent.setType(\"text/plain\");\n startActivity(sendIntent);\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic void openUserProfileFromActivity(WUser wuser) {\n\t\t\n\t}", "public final void mo73097a(EBookAnnotationShareTemplate eBookAnnotationShareTemplate) {\n C32569u.m150519b(eBookAnnotationShareTemplate, C6969H.m41409d(\"G7D86D80AB331BF2C\"));\n this.f49948g.postValue(eBookAnnotationShareTemplate);\n }", "public final native void setType(String type) /*-{\n this.setType(type);\n }-*/;", "@ApiModelProperty(value = \"This field is optionally used by Push Payments Gateway participants (merchants and acquirers) to specify the network access priority.<br><br>Refer to <a href=\\\"/request_response_codes#network_id_and_sharing_group_code\\\">Sharing Group Code</a><br><br><b>Note:</b><br>Supported only in US for domestic transactions involving Push Payments Gateway Service.\")\n public String getSharingGroupCode() {\n return sharingGroupCode;\n }", "public void xsetStructuretype(org.apache.xmlbeans.XmlString structuretype)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlString target = null;\r\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(STRUCTURETYPE$2);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(STRUCTURETYPE$2);\r\n }\r\n target.set(structuretype);\r\n }\r\n }", "public void setContentType(java.lang.String value) {\r\n\t\tBase.set(this.model, this.getResource(), CONTENTTYPE, value);\r\n\t}", "public void setActivityType(ActivityType activity, UsertypeType type) {\n\t\tactivity.setUsertype(type);\n\t}", "public void setOwnerType(String ownerType) {\n\t\tthis.ownerType = ownerType;\n\t}", "public void setContentType(Header contentType) {\n/* 114 */ this.contentType = contentType;\n/* */ }", "public void setSendType(Boolean sendType) {\n this.sendType = sendType;\n }", "public void setpermitTypeName(String value) {\n setAttributeInternal(PERMITTYPENAME, value);\n }", "public void setMediaType(java.lang.String mediaType)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(MEDIATYPE$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(MEDIATYPE$18);\n }\n target.setStringValue(mediaType);\n }\n }", "public void setContentType( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.set(this.model, this.getResource(), CONTENTTYPE, value);\r\n\t}", "public void setStructuretype(java.lang.String structuretype)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STRUCTURETYPE$2);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STRUCTURETYPE$2);\r\n }\r\n target.setStringValue(structuretype);\r\n }\r\n }", "void setCryptProviderType(org.openxmlformats.schemas.presentationml.x2006.main.STCryptProv.Enum cryptProviderType);", "@Override\n\tpublic ToolStripButton getShareButton() {\n\t\treturn shareButton;\n\t}", "public void setContentType(java.lang.Object contentType) {\r\n this.contentType = contentType;\r\n }", "void setupConnectorType(String userId,\n String assetManagerGUID,\n String assetManagerName,\n boolean assetManagerIsHome,\n String connectionGUID,\n String connectorTypeGUID,\n Date effectiveFrom,\n Date effectiveTo,\n Date effectiveTime,\n boolean forLineage,\n boolean forDuplicateProcessing) throws InvalidParameterException,\n UserNotAuthorizedException,\n PropertyServerException;", "@Override\n protected void sendChooserIntent(WindowAndroid windowAndroid, Intent sharingIntent) {\n super.sendChooserIntent(windowAndroid, sharingIntent);\n }", "public void setMetaType(ARecordType metaType);", "@Override\n public boolean onCreateOptionsMenu(Menu menu){\n\n getMenuInflater().inflate(R.menu.menu_aboutus, menu);\n\n// Inflate the menu; this adds items to the action bar if it is present.\n\n MenuItem shareItem = menu.findItem(R.id.menu_share);\n myShareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(shareItem);\n myShareActionProvider.setShareHistoryFileName(\n ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);\n myShareActionProvider.setShareIntent(Shareintent());\n\n return super.onCreateOptionsMenu(menu);\n\n\n }", "public void setRcTypeUser(String rcTypeUser) {\r\n this.rcTypeUser = rcTypeUser;\r\n }", "public void share(View view) {\n if (urlImage != \"\") {\n try {\n new ShareOnFacebook(bitmapArray, this).share();\n } catch (Exception e) {\n e.printStackTrace();\n Intent mIntentFacebookBrowser = new Intent(Intent.ACTION_SEND);\n String mStringURL = \"https://www.facebook.com/sharer/sharer.php?u=\" + urlImage;\n mIntentFacebookBrowser = new Intent(Intent.ACTION_VIEW, Uri.parse(mStringURL));\n startActivity(mIntentFacebookBrowser);\n }\n }\n }", "public void setShared(boolean shared) {\n isShared = shared;\n }", "public void setUser(UserModel user) {\n this.sender = user;\n }", "@Override\r\n public void onClick(View v) {\n UMImage urlImage = new UMImage(LotteryListActivity.this,\r\n share.getImage());\r\n new ShareAction(LotteryListActivity.this)\r\n .setPlatform(SHARE_MEDIA.SINA)\r\n .withText(share.getContent()).withTitle(share.getTitle()).withMedia(urlImage)\r\n .withTargetUrl(share.getUrl())\r\n .setCallback(umShareListener).share();\r\n\r\n }", "public void setSocialNetwork(int value) {\n this.socialNetwork = value;\n }", "private void setGlobalSettingDeviceOwnerType(int deviceOwnerType) {\n mInjector.binderWithCleanCallingIdentity(\n () -> mInjector.settingsGlobalPutInt(\"device_owner_type\", deviceOwnerType));\n }", "public void setContentType(String contentType) {\n\t\t// only null assertion is needed since \"\" is a valid value\n\t\tAssert.notNull(contentType, \"'contentType' must not be null\");\n\t\tthis.contentTypeExplicitlySet = true;\n\t\tthis.contentType = contentType.trim();\n\t}", "protected void showShare() {\n \t\tApplicationData applicationData;\n \t\ttry {\n \t\t\tapplicationData = ApplicationData.readApplicationData(this);\n \t\t\tif(applicationData != null){\n \t\t\t\tIntent intent = getIntent();\n \t\t\t\tNextLevel nextLevel = (NextLevel)intent.getSerializableExtra(ApplicationData.NEXT_LEVEL_TAG);\n \t\t\t\tAppLevelDataItem item = applicationData.getDataItem(this, nextLevel);\t\t\t\t\n \t\t\t\tAppDataItemText textItem;\n \t\t\t\ttry {\n \t\t\t\t\ttextItem = (AppDataItemText)item;\n \t\t\t\t\t\n \t\t\t\t\tIntent sharingIntent = new Intent(Intent.ACTION_SEND);\n \t\t\t\t\tsharingIntent.setType(\"text/plain\");\n \t\t\t\t\t//sharingIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { \"[email protected]\" });\n \t\t\t\t\tsharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, textItem.getItemText());\n \t\t\t\t\tstartActivity(Intent.createChooser(sharingIntent,\"Compartir contenido\"));\n \n \t\t\t\t}catch (ClassCastException e) {\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (InvalidFileException e) {\n \t\t}\n \t}", "private void configureViewElementsBasedOnProvider() {\n JRDictionary socialSharingProperties = mSelectedProvider.getSocialSharingProperties();\n \n if (socialSharingProperties.getAsBoolean(\"content_replaces_action\"))\n updatePreviewTextWhenContentReplacesAction();\n else\n updatePreviewTextWhenContentDoesNotReplaceAction();\n \n if (isPublishThunk()) {\n mMaxCharacters = mSelectedProvider.getSocialSharingProperties()\n .getAsDictionary(\"set_status_properties\").getAsInt(\"max_characters\");\n } else {\n mMaxCharacters = mSelectedProvider.getSocialSharingProperties()\n .getAsInt(\"max_characters\");\n }\n \n if (mMaxCharacters != -1) {\n mCharacterCountView.setVisibility(View.VISIBLE);\n } else\n mCharacterCountView.setVisibility(View.GONE);\n \n updateCharacterCount();\n \n boolean can_share_media = mSelectedProvider.getSocialSharingProperties()\n .getAsBoolean(\"can_share_media\");\n \n // Switch on or off the media content view based on the presence of media and ability to\n // display it\n boolean showMediaContentView = mActivityObject.getMedia().size() > 0 && can_share_media;\n mMediaContentView.setVisibility(showMediaContentView ? View.VISIBLE : View.GONE);\n \n // Switch on or off the action label view based on the provider accepting an action\n //boolean contentReplacesAction = socialSharingProperties.getAsBoolean(\"content_replaces_action\");\n //mPreviewLabelView.setVisibility(contentReplacesAction ? View.GONE : View.VISIBLE);\n \n mUserProfileInformationAndShareButtonContainer.setBackgroundColor(\n colorForProviderFromArray(socialSharingProperties.get(\"color_values\"), true));\n \n int colorWithNoAlpha = colorForProviderFromArray(\n mSelectedProvider.getSocialSharingProperties().get(\"color_values\"), false);\n \n mJustShareButton.getBackground().setColorFilter(colorWithNoAlpha, PorterDuff.Mode.MULTIPLY);\n mConnectAndShareButton.getBackground().setColorFilter(colorWithNoAlpha,\n PorterDuff.Mode.MULTIPLY);\n mPreviewBorder.getBackground().setColorFilter(colorWithNoAlpha, PorterDuff.Mode.SRC_ATOP);\n \n // Drawable providerIcon = mSelectedProvider.getProviderListIconDrawable(this);\n //\n // mConnectAndShareButton.setCompoundDrawables(null, null, providerIcon, null);\n // mJustShareButton.setCompoundDrawables(null, null, providerIcon, null);\n mProviderIcon.setImageDrawable(mSelectedProvider.getProviderListIconDrawable(this));\n }", "public void setContentType(String s) {\n\n\t}", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif (AppConstants.ENABLE_FACEBOOK_SHARE) {\n\t\t\tFacebookManager.getInstance().onActivityResult(requestCode,\n\t\t\t\t\tresultCode, data, this);\n\t\t}\n\n\t}", "public void setSharePct(BigDecimal sharePct) {\n\t\tthis.sharePct = sharePct;\n\t}", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public void setMainTypeset(String value) {\n setAttributeInternal(MAINTYPESET, value);\n }", "@Override\n public void setContentType(String arg0) {\n\n }", "public void loadUserTypeConfiguration()\r\n\t{\r\n\t\tString userType = \"\";\r\n\t\tif (baseStoreConfigurationService!= null) {\r\n\t\t\tuserType = (String) baseStoreConfigurationService.getProperty(\"sapproductrecommendation_usertype\");\r\n\t\t}\r\n\t\tthis.setUserType(userType);\t\t\r\n\t}", "public void xsetMediaType(org.apache.xmlbeans.XmlString mediaType)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(MEDIATYPE$18);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(MEDIATYPE$18);\n }\n target.set(mediaType);\n }\n }" ]
[ "0.72036624", "0.56014234", "0.5539446", "0.55248433", "0.5483902", "0.54818577", "0.5470023", "0.54661906", "0.5455425", "0.5336002", "0.5336002", "0.5336002", "0.52641934", "0.50910485", "0.50910485", "0.50659215", "0.5045248", "0.5028664", "0.502328", "0.49946746", "0.496971", "0.49017003", "0.48823842", "0.4879184", "0.48694333", "0.48607498", "0.4803361", "0.47700104", "0.4753407", "0.47463518", "0.47273207", "0.47111583", "0.4708559", "0.46686336", "0.4652369", "0.4647273", "0.46360004", "0.46344823", "0.4627398", "0.4619423", "0.4567761", "0.4553111", "0.45498177", "0.45377967", "0.45140955", "0.45095637", "0.45049733", "0.44869158", "0.4484301", "0.44775409", "0.44676656", "0.44514453", "0.44497755", "0.44283348", "0.441812", "0.44137836", "0.4412838", "0.4386747", "0.43834883", "0.43766394", "0.43757683", "0.4365267", "0.4364135", "0.43614382", "0.43538487", "0.43500406", "0.43461663", "0.43093112", "0.430697", "0.43024448", "0.4297677", "0.42957044", "0.42945495", "0.42930594", "0.4292735", "0.42900825", "0.42856142", "0.42793587", "0.4267488", "0.42557567", "0.42490104", "0.42473283", "0.42441085", "0.42431366", "0.4241529", "0.42379594", "0.42363867", "0.42279026", "0.4220678", "0.42171967", "0.42163157", "0.42115423", "0.4210154", "0.4210154", "0.4210154", "0.4210154", "0.4205531", "0.42010158", "0.41972506", "0.41971448" ]
0.8436232
0
Return type metadata object
public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MetadataType getType();", "public MetadataType getType() {\n return type;\n }", "public MilanoTypeMetadata.TypeMetadata getMetadata()\n {\n if (typeMetadata == null) {\n return null;\n }\n\n return typeMetadata;\n }", "private Metadata getMetadata(RubyModule type) {\n for (RubyModule current = type; current != null; current = current.getSuperClass()) {\n Metadata metadata = (Metadata) current.getInternalVariable(\"metadata\");\n \n if (metadata != null) return metadata;\n }\n \n return null;\n }", "public Metadata getMetadata( MetadataType type )\n\t{\n\t\tfor( Metadata metadata: mMetadata )\n\t\t{\n\t\t\tif( metadata.getMetadataType() == type )\n\t\t\t{\n\t\t\t\treturn metadata;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "Metadata getMetaData();", "public List<TypeMetadata> getTypeMetadata() {\n return types;\n }", "@Override\n public Class<? extends Metadata> getMetadataType() {\n throw new RuntimeException( \"Not yet implemented.\" );\n }", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "String getType();", "public MetaData getMetaData();", "private Class<?> getType(final Object metadata, final ValueNode node) throws ParseException {\n if (node.type != null) {\n return readType(node);\n }\n Class type;\n if (metadata instanceof ReferenceSystemMetadata || metadata instanceof Period || metadata instanceof AbstractTimePosition || metadata instanceof Instant) {\n final Method getter = ReflectionUtilities.getGetterFromName(node.name, metadata.getClass());\n return getter.getReturnType();\n } else {\n type = standard.asTypeMap(metadata.getClass(), KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.ELEMENT_TYPE).get(node.name);\n }\n final Class<?> special = specialized.get(type);\n if (special != null) {\n return special;\n }\n return type;\n }", "public Map<String, Variant<?>> GetMetadata();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public String getType();", "public TypeSummary getTypeSummary() {\r\n return type;\r\n }", "String provideType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "java.lang.String getType();", "public Type getType();", "@Override\n public String toString() {\n return metaObject.getType().toString();\n }", "public String metadataClass() {\n return this.metadataClass;\n }", "Type getType();", "Type getType();", "Type getType();", "Type getType();", "Type getType();", "Type getType();", "Type getType();", "Type getType();", "Type getType();", "Type getType();", "Type getType();", "abstract public Type getType();", "public String type();", "private String getType(){\r\n return type;\r\n }", "protected abstract String getType();", "Coding getType();", "@Override\n TypeInformation<T> getProducedType();", "type getType();", "TypeDefinition createTypeDefinition();", "abstract public String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract String getType();", "public abstract Type getType();", "protected static LibMetaData createLibMetaData(LibMetaData lmd) {\n MetaData metaData = new MetaData();\r\n metaData.add(\"IsThing\", new Integer(1), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"ImageSource\", \"Items\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Image\", new Integer(0), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Number\", new Integer(1), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n lmd.add(THING, metaData);\r\n \r\n metaData = new MetaData(lmd.get(\"thing\"));\r\n metaData.add(\"IsItem\", new Integer(1), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"ImageSource\", \"Items\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Image\", new Integer(1), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Name\", \"Thing\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"NameType\", new Integer(Description.NAMETYPE_NORMAL), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Z\", new Integer(Thing.Z_ITEM), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n lmd.add(ITEM, metaData);\r\n \r\n metaData = new MetaData(lmd.get(\"thing\"));\r\n metaData.add(\"IsBeing\",new Integer(1), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"ImageSource\", \"Creatures\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Image\", new Integer(340), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"IsMobile\",new Integer(1), new Integer[]{new Integer(0), new Integer(1)}, MetaDataEntry.CERTAIN_VALUES, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"IsBlocking\", new Integer(1), new Integer[]{new Integer(0), new Integer(1)}, MetaDataEntry.CERTAIN_VALUES, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"MoveCost\", new Integer(100), null, MetaDataEntry.POSITIVE_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"DeathDecoration\", \"blood pool\", null, MetaDataEntry.ANY_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"NameType\", new Integer(Description.NAMETYPE_NORMAL), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n metaData.add(\"Z\", new Integer(Thing.Z_MOBILE), null, MetaDataEntry.FIX_VALUE, MetaDataEntry.MANDATORY_PROPERTY);\r\n lmd.add(BEING, metaData);\r\n \r\n lmd = createEffectMetaData(lmd);\r\n lmd = createPoisonMetaData(lmd);\r\n lmd = createFoodMetaData(lmd);\r\n lmd = createScrollMetaData(lmd);\r\n lmd = createMissileMetaData(lmd);\r\n lmd = createRangedWeaponMetaData(lmd);\r\n lmd = createPotionMetaData(lmd);\r\n lmd = createWandMetaData(lmd);\r\n lmd = createRingMetaData(lmd);\r\n lmd = createCoinMetaData(lmd);\r\n lmd = createArmourMetaData(lmd);\r\n lmd = createWeaponMetaData(lmd);\r\n lmd = createSecretMetaData(lmd);\r\n lmd = createSpellBookMetaData(lmd);\r\n lmd = createChestMetaData(lmd);\r\n lmd = createDecorationMetaData(lmd);\r\n lmd = createSceneryMetaData(lmd);\r\n lmd = createPortalMetaData(lmd);\r\n lmd = createTrapMetaData(lmd);\r\n createMonsterMetaData(lmd);\r\n createPersonMetaData(lmd);\r\n return lmd;\r\n }", "String getTypeAsString();", "public gov.niem.niem.structures._2_0.MetadataType getMetadata()\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.niem.niem.structures._2_0.MetadataType target = null;\n target = (gov.niem.niem.structures._2_0.MetadataType)get_store().find_element_user(METADATA$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "TypeRef getType();", "String getMetadataClassName();" ]
[ "0.7969707", "0.7373198", "0.7358018", "0.7090138", "0.67353225", "0.67259765", "0.66725683", "0.65644145", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6510972", "0.648206", "0.6352795", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.6329532", "0.62937546", "0.6285329", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.628487", "0.627527", "0.6265675", "0.6235292", "0.6227797", "0.6227797", "0.6227797", "0.6227797", "0.6227797", "0.6227797", "0.6227797", "0.6227797", "0.6227797", "0.6227797", "0.6227797", "0.6221452", "0.6209023", "0.6196509", "0.61801785", "0.6180045", "0.6168281", "0.61679584", "0.6166462", "0.6161522", "0.6146188", "0.6146188", "0.6146188", "0.6146188", "0.6146188", "0.6146188", "0.6146188", "0.6146188", "0.6141369", "0.6140734", "0.6133515", "0.61228573", "0.6116976", "0.6111749" ]
0.0
-1
JMS Queue Consumer handles incoming request messages JMS message handling entry point for incoming Request messages (i.e. requests for remote method invocation).
public void handleJMSMessage(Message jmsMessage) { if (jmsMessage == null) return; Request request = null; // First get Request instance from jms message (see sendCallRequest for send code) try { if (jmsMessage instanceof ObjectMessage) { Serializable object = ((ObjectMessage) jmsMessage).getObject(); if (object instanceof Request) request = (Request) object; } if (request == null) throw new JMSException("Invalid message=" + jmsMessage); //$NON-NLS-1$ } catch (JMSException e) { log("handleJMSMessage message=" + jmsMessage, e); //$NON-NLS-1$ return; } // Process call request locally handleJMSRequest(jmsMessage, request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void handleJMSRequest(Message jmsMessage, Request request) {\n \t\tfinal RemoteServiceRegistrationImpl localRegistration = getLocalRegistrationForJMSRequest(request);\n \t\t// Else we've got a local service and we invoke it\n \t\tfinal RemoteCallImpl call = request.getCall();\n \t\tResponse response = null;\n \t\tObject result = null;\n \t\t// Actually call local service here\n \t\ttry {\n \t\t\tresult = localRegistration.callService(call);\n \t\t\tresponse = new Response(request.getRequestId(), result);\n \t\t} catch (final Exception e) {\n \t\t\tresponse = new Response(request.getRequestId(), e);\n \t\t\tlog(208, \"Exception invoking service\", e); //$NON-NLS-1$\n \t\t}\n \t\t// Then send response back to initial sender\n \t\ttry {\n \t\t\tObjectMessage responseMessage = container.getSession().createObjectMessage();\n \t\t\tresponseMessage.setObject(response);\n \t\t\tresponseMessage.setJMSCorrelationID(jmsMessage.getJMSCorrelationID());\n \t\t\tcontainer.getMessageProducer().send(jmsMessage.getJMSReplyTo(), responseMessage);\n \t\t} catch (JMSException e) {\n \t\t\tlog(\"sendCallResponse jmsMessage=\" + jmsMessage + \", response=\" + response, e); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t}\n \t\t// XXX end need for job\n \t}", "private synchronized void onRequest(ObjectMessage message) {\n try {\n Serializable request = message.getObject(); //serializer.requestFromString(message.getText());\n activeRequests.put(request, message);\n requestListener.receivedRequest(request);\n } catch (JMSException ex) {\n Logger.getLogger(AsynchronousReplier.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "void onMessageProcessingAttempt(String internalQueueName);", "public void handleMessageEvent(StunMessageEvent e) {\n delegate.processRequest(e);\n }", "@Override\n void onMessage(Message msg, Session session) throws JMSException;", "protected void handleInboundMessage(Object msg) {\n/* 748 */ inboundMessages().add(msg);\n/* */ }", "private void processRequestMessage(ServerSessionFactory factory, JsonObject requestJsonObject,\n final ResponseSender responseSender, String transportId) throws IOException {\n\n final Request<JsonElement> request = JsonUtils.fromJsonRequest(requestJsonObject,\n JsonElement.class);\n\n switch (request.getMethod()) {\n case METHOD_CONNECT:\n\n log.debug(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processReconnectMessage(factory, request, responseSender, transportId);\n break;\n case METHOD_PING:\n log.trace(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processPingMessage(factory, request, responseSender, transportId);\n break;\n\n case METHOD_CLOSE:\n log.trace(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processCloseMessage(factory, request, responseSender, transportId);\n\n break;\n default:\n\n final ServerSession session = getOrCreateSession(factory, transportId, request);\n\n log.debug(\"{} Req-> {} [jsonRpcSessionId={}, transportId={}]\", label, request,\n session.getSessionId(), transportId);\n\n // TODO, Take out this an put in Http specific handler. The main\n // reason is to wait for request before responding to the client.\n // And for no contaminate the ProtocolManager.\n if (request.getMethod().equals(Request.POLL_METHOD_NAME)) {\n\n Type collectionType = new TypeToken<List<Response<JsonElement>>>() {\n }.getType();\n\n List<Response<JsonElement>> responseList = JsonUtils.fromJson(request.getParams(),\n collectionType);\n\n for (Response<JsonElement> response : responseList) {\n session.handleResponse(response);\n }\n\n // Wait for some time if there is a request from server to\n // client\n\n // TODO Allow send empty responses. Now you have to send at\n // least an\n // empty string\n responseSender.sendResponse(new Response<Object>(request.getId(), Collections.emptyList()));\n\n } else {\n session.processRequest(new Runnable() {\n @Override\n public void run() {\n handlerManager.handleRequest(session, request, responseSender);\n }\n });\n }\n break;\n }\n\n }", "protected void syncConsumeLoop(MessageConsumer requestConsumer) {\n try {\n Message message = requestConsumer.receive(5000);\n if (message != null) {\n onMessage(message);\n } else {\n System.err.println(\"No message received\");\n }\n } catch (JMSException e) {\n onException(e);\n }\n }", "@Override\n\tpublic void receiveRequest() {\n\n\t}", "public void handleMessageFromClient(Object msg) {\n\n }", "RequestSender onInform(Consumer<Message> consumer);", "public interface MessageHandler {\n\n /**\n * handle message\n * @param result\n */\n public void handleMessage(ConsumerResult result);\n\n}", "void consumeMessage(String message);", "public void onMessage(Message msg) {\n\t\tMapMessage message = null;\n\t\tQueueConnection conn = null;\n\t\tQueueSession session = null;\n\t\tQueueSender sender = null;\n\t\tQueryProcessorUtil qpUtil = QueryProcessorUtil.getInstance();\n\t\tQueue replyToQueue = null;\n\t\tUserTransaction transaction = sessionContext.getUserTransaction();\n\t\t//default timeout three minutes\n\t\tint transactionTimeout = 180;\n\t\ttry {\n\t\t\t\n\t\t\tif (callingMDBName.equalsIgnoreCase(QueryManagerBeanUtil.MEDIUM_QUEUE_NAME)) {\n\t\t\t\t//four hours\n\t\t\t\ttransactionTimeout = 14400;\n\t\t\t} else if (callingMDBName.equalsIgnoreCase(QueryManagerBeanUtil.LARGE_QUEUE_NAME)) {\n\t\t\t\t//twelve hours\n\t\t\t\ttransactionTimeout = 43200;\n\t\t\t} \n\t\t\t\n\t\t\ttransaction.setTransactionTimeout(transactionTimeout);\n\t\t\t\n\t\t\t\n\t\t\ttransaction.begin();\n\t\t\tmessage = (MapMessage) msg;\n\t\t\tString sessionId = msg.getJMSCorrelationID();\n\t\t\treplyToQueue = (Queue) msg.getJMSReplyTo();\n\t\t\tlog.debug(\"Extracting the message [\" + msg.getJMSMessageID());\n\t\t\tString patientSetId = \"\";\n\t\t\ttransaction.commit();\n\t\t\tif (message != null) {\n\t\t\t\tString sqlString = message.getString(QueryManagerBeanUtil.QUERY_MASTER_GENERATED_SQL_PARAM);\n\t\t\t\tString queryInstanceId = message.getString(QueryManagerBeanUtil.QUERY_INSTANCE_ID_PARAM);\n\t\t\t\tpatientSetId = message.getString(QueryManagerBeanUtil.QUERY_PATIENT_SET_ID_PARAM);\n\t\t\t\tString xmlRequest = message.getString(QueryManagerBeanUtil.XML_REQUEST_PARAM);\n\t\t\t\t\n\t\t\t\tString dsLookupDomainId = message.getString(QueryManagerBeanUtil.DS_LOOKUP_DOMAIN_ID);\n\t\t\t\tString dsLookupProjectId = message.getString(QueryManagerBeanUtil.DS_LOOKUP_PROJECT_ID);\n\t\t\t\tString dsLookupOwnerId = message.getString(QueryManagerBeanUtil.DS_LOOKUP_OWNER_ID);\n\t\t\t\t\n\t\t\t\tDAOFactoryHelper daoFactoryHelper = new DAOFactoryHelper(dsLookupDomainId, dsLookupProjectId, dsLookupOwnerId);\n\t\t\t\n\t\t\t\tDataSourceLookupHelper dataSourceHelper = new DataSourceLookupHelper();\n\t\t\t\tDataSourceLookup dsLookup = dataSourceHelper.matchDataSource(dsLookupDomainId, dsLookupProjectId, dsLookupOwnerId);\n\t\t\t\t\n\t\t\t\tIDAOFactory daoFactory = daoFactoryHelper.getDAOFactory();\n\t\t\t\t\n\t\t\t\tSetFinderDAOFactory sfDAOFactory = daoFactory.getSetFinderDAOFactory();\n\t\t\t\ttry { \n\t\t\t\t\t \n\t\t\t\t\tpatientSetId = processQueryRequest(transaction,transactionTimeout,dsLookup,sfDAOFactory ,xmlRequest,sqlString, sessionId,queryInstanceId,patientSetId);\n\t\t\t\t\tlog.debug(\"QueryExecutorMDB completed processing query instance [\" + queryInstanceId + \"]\");\n\t\t\t\t} catch (CRCTimeOutException daoEx) {\n\t\t\t\t\t//catch this error and ignore. send general reply message. \n\t\t\t\t\tlog.error(daoEx.getMessage(),daoEx);\n\t\t\t\t\tif (callingMDBName.equalsIgnoreCase(LARGE_QUEUE)) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t// set status to error\n\t\t\t\t\t\tsetQueryInstanceStatus(sfDAOFactory,queryInstanceId, 4) ;\n\t\t\t\t\t\t\n\t\t\t\t\t} else { \n\t\t\t\t\t\t//send message to next queue and if the there is no next queue then update query instance to error\n\t\t\t\t\t\ttryNextQueue(sfDAOFactory,sessionId, message,queryInstanceId);\n\t\t\t\t\t}\n\t\t\t\t} catch (I2B2DAOException daoEx) {\n\t\t\t\t\t//catch this error and ignore. send general reply message. \n\t\t\t\t\tlog.error(daoEx.getMessage(),daoEx);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsendReply(sessionId,patientSetId, replyToQueue);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\ttry {\n\t\t\t\ttransaction.rollback();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t\tlog.error(\"Error extracting message\", ex);\n\t\t} finally {\n\t\t\tQueryManagerBeanUtil qmBeanUtil = new QueryManagerBeanUtil();\n\t\t\tqmBeanUtil.closeAll(sender, null, conn, session);\n\t\t}\n\t}", "@Override\r\n public void handleMessage(Message msg) {\n }", "@Override\n public void onMessage(Message message) {\n try {\n // Generate data\n QueueProcessor processor = getBean(QueueProcessor.class);\n ServiceData serviceData = processor.parseResponseMessage(response, message);\n\n // If return is a DataList or Data, parse it with the query\n if (serviceData.getClientActionList() == null || serviceData.getClientActionList().isEmpty()) {\n serviceData = queryService.onSubscribeData(query, address, serviceData, parameterMap);\n } else {\n // Add address to client action list\n for (ClientAction action : serviceData.getClientActionList()) {\n action.setAddress(getAddress());\n }\n }\n\n // Broadcast data\n broadcastService.broadcastMessageToUID(address.getSession(), serviceData.getClientActionList());\n\n // Log sent message\n getLogger().log(QueueListener.class, Level.DEBUG,\n \"New message received from subscription to address {0}. Content: {1}\",\n getAddress().toString(), message.toString());\n } catch (AWException exc) {\n broadcastService.sendErrorToUID(address.getSession(), exc.getTitle(), exc.getMessage());\n\n // Log error\n getLogger().log(QueueListener.class, Level.ERROR, \"Error in message from subscription to address {0}. Content: {1}\", exc,\n getAddress().toString(), message.toString());\n } catch (Exception exc) {\n broadcastService.sendErrorToUID(address.getSession(), null, exc.getMessage());\n\n // Log error\n getLogger().log(QueueListener.class, Level.ERROR, \"Error in message from subscription to address {0}. Content: {1}\", exc,\n getAddress().toString(), message.toString());\n }\n }", "protected void processRequest(Message request)\n\t{\n\t\ttry\n\t\t{\n\t\t\tmessageHandlers.process(request);\n\t\t} catch (CommunicationException e)\n\t\t{\n\t\t\tSystem.out.println(\"No handler for \" + request.getClass() + \": \" + request + \" which was received from \"\n\t\t\t\t\t+ socket.getInetAddress().getHostName() + \" at \" + socket.getInetAddress().getHostAddress());\n\t\t}\n\t}", "void onMessageProcessingSuccess(String internalQueueName);", "RequestSender onRefuse(Consumer<Message> consumer);", "void handleMessage(EndpointPort from, EndpointPort to, Object message);", "protected void handleMessage(Message msg) {}", "public static void doClientMessageSend() {\n\t\tfinal String correlationId = \"ABC123\";\n\t\tMessage toSend = new Message(\"query message to server\", correlationId);\n\n\t\tMessagingSystemInfo messagingSystemInfo = oneAgentSDK.createMessagingSystemInfo(\"myCreativeMessagingSystem\",\n\t\t\t\t\"theOnlyQueue\", MessageDestinationType.QUEUE, ChannelType.TCP_IP, \"localhost:4711\");\n\n\t\t// sending the request:\n\t\t{\n\t\t\tOutgoingMessageTracer outgoingMessageTracer = oneAgentSDK.traceOutgoingMessage(messagingSystemInfo);\n\t\t\toutgoingMessageTracer.start();\n\t\t\ttry {\n\t\t\t\t// transport the Dynatrace tag along with the message to allow the outgoing message tracer to be linked\n\t\t\t\t// with the message processing tracer on the receiving side\n\t\t\t\ttoSend.setHeaderField(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME, outgoingMessageTracer.getDynatraceStringTag());\n\t\t\t\ttheQueue.send(toSend);\n\t\t\t\toutgoingMessageTracer.setVendorMessageId(toSend.getMessageId()); // optional payload\n\t\t\t\toutgoingMessageTracer.setCorrelationId(toSend.correlationId);\n\t\t\t} catch (Exception e) {\n\t\t\t\toutgoingMessageTracer.error(e.getMessage());\n\t\t\t} finally {\n\t\t\t\toutgoingMessageTracer.end();\n\t\t\t}\n\t\t}\n\n\t\t// waiting for server response message:\n\t\t{\n\t\t\tIncomingMessageReceiveTracer receivingMessageTracer = oneAgentSDK.traceIncomingMessageReceive(messagingSystemInfo);\n\t\t\treceivingMessageTracer.start();\n\t\t\ttry {\n\t\t\t\tMessage answer = theQueue.receive(correlationId);\n\t\t\t\t\n\t\t\t\tIncomingMessageProcessTracer processMessageTracer = oneAgentSDK.traceIncomingMessageProcess(messagingSystemInfo);\n\t\t\t\t// retrieve Dynatrace tag created using the outgoing message tracer to link both sides together\n\t\t\t\tprocessMessageTracer.setDynatraceStringTag(answer.getHeaderField(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME));\n\t\t\t\tprocessMessageTracer.setVendorMessageId(answer.msgId);\n\t\t\t\tprocessMessageTracer.setCorrelationId(answer.correlationId);\n\t\t\t\tprocessMessageTracer.start();\n\t\t\t\ttry {\n\t\t\t\t\t// handle answer message in sync way ...\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tprocessMessageTracer.error(e.getMessage());\n\t\t\t\t} finally {\n\t\t\t\t\tprocessMessageTracer.end();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\treceivingMessageTracer.error(e.getMessage());\n\t\t\t} finally {\n\t\t\t\treceivingMessageTracer.end();\n\t\t\t}\n\t\t}\n\t}", "public void queueMessage(Message message);", "public interface MqConsumer {\n}", "void onSqsRequestAttempt(String internalQueueName);", "public String processMsg(RequestObject reqObj);", "public Message invokeRequest(Message msg) {\n JMSBindingContext context = msg.getBindingContext();\n javax.jms.Message jmsMsg = context.getJmsMsg();\n\n Operation op = msg.getOperation();\n List<DataType> inputDataTypes = op.getInputType().getLogical();\n\n Class<?> inputType = null;\n if (inputDataTypes.size() == 1) {\n inputType = inputDataTypes.get(0).getPhysical();\n }\n if (inputType != null && javax.jms.Message.class.isAssignableFrom(inputType)) {\n msg.setBody(new Object[] { jmsMsg });\n \n if (jmsMsg instanceof BytesMessage) {\n context.setUseBytesForWFJMSDefaultResponse(true);\n } else {\n context.setUseBytesForWFJMSDefaultResponse(false);\n }\n } else {\n\n // If there is only one arg we must add a wrapper if the operation is wrapper style\n Object wrapper = this.inputWrapperMap.get(msg.getOperation().getName());\n\n Object requestPayload;\n if (jmsMsg instanceof BytesMessage) {\n requestPayload = responseMessageProcessor.extractPayloadFromJMSBytesMessage(jmsMsg, wrapper);\n context.setUseBytesForWFJMSDefaultResponse(true);\n } else {\n requestPayload = responseMessageProcessor.extractPayloadFromJMSTextMessage(jmsMsg, wrapper );\n context.setUseBytesForWFJMSDefaultResponse(false);\n }\n\n msg.setBody(new Object[] { requestPayload });\n }\n\n return msg;\n\n }", "protected void handleOutboundMessage(Object msg) {\n/* 741 */ outboundMessages().add(msg);\n/* */ }", "private void requestHandler(Object context)\n {\n final String funcName = \"requestHandler\";\n @SuppressWarnings(\"unchecked\")\n TrcRequestQueue<Request>.RequestEntry entry = (TrcRequestQueue<Request>.RequestEntry) context;\n Request request = entry.getRequest();\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.TASK, \"request=%s\", request);\n }\n\n request.canceled = entry.isCanceled();\n if (!request.canceled)\n {\n if (request.readRequest)\n {\n request.buffer = readData(request.address, request.length);\n if (debugEnabled)\n {\n if (request.buffer != null)\n {\n dbgTrace.traceInfo(funcName, \"readData(addr=0x%x,len=%d)=%s\",\n request.address, request.length, Arrays.toString(request.buffer));\n \n }\n }\n }\n else\n {\n request.length = writeData(request.address, request.buffer, request.length);\n }\n }\n\n if (request.completionEvent != null)\n {\n request.completionEvent.set(true);\n }\n\n if (request.completionHandler != null)\n {\n request.completionHandler.notify(request);\n }\n\n if (debugEnabled)\n {\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.TASK);\n }\n }", "@Override\n public void onMessage(Message message) {\n try {\n TextMessage requestMessage = (TextMessage) message;\n\n\n Destination replyDestination = requestMessage.getJMSReplyTo();\n\n // TODO\n // String value =\n // ActiveMQDestination.getClientId((ActiveMQDestination)\n // replyDestination);\n // assertEquals(\"clientID from the temporary destination must be the\n // same\", clientSideClientID, value);\n\n TextMessage replyMessage = serverSession.createTextMessage(\"Hello: \" + requestMessage.getText());\n\n replyMessage.setJMSCorrelationID(requestMessage.getJMSMessageID());\n\n if (dynamicallyCreateProducer) {\n replyProducer = serverSession.createProducer(replyDestination);\n replyProducer.send(replyMessage);\n } else {\n replyProducer.send(replyDestination, replyMessage);\n }\n\n } catch (JMSException e) {\n onException(e);\n }\n }", "void handleMessage(byte messageType, Object message);", "public void handleMessage(Message message);", "@Override\n\tpublic void handleMsg(String in) {\n\n\t}", "public interface MessagingQueueListener {\n\n void onMessage(MessageEvent messageEvent);\n}", "@Override\n public void receiveRequest(final Request request) {\n\n }", "@ControlInterface (defaultBinding=\"org.apache.beehive.controls.system.jms.impl.JMSControlImpl\")\npublic interface JMSControl\n{\n /**\n * The destination type. \n */\n enum DestinationType \n { \n /** The destination is set from the object obtained from JNDI. */\n Auto, \n /** The destination must be a javax.jms.QueueSender. */\n Queue, \n /** The destination must be a javax.jms.TopicPublisher. */\n Topic \n };\n \n /**\n * The header type. Corresponds to the JMS* bean properties on a JMS message.\n */\n enum HeaderType \n { \n /** @see javax.jms.Message#getJMSCorrelationID */\n JMSCorrelationID, \n /** @see javax.jms.Message#getJMSDeliveryMode */\n JMSDeliveryMode, \n /** @see javax.jms.Message#getJMSPriority */\n JMSPriority, \n /** @see javax.jms.Message#getJMSExpiration */\n JMSExpiration, \n /** @see javax.jms.Message#getJMSMessageID */\n JMSMessageID, \n /** @see javax.jms.Message#getJMSType */\n JMSType, \n /** @see javax.jms.Message#getJMSRedelivered */\n JMSRedelivered, \n /** @see javax.jms.Message#getJMSTimestamp */\n JMSTimestamp \n };\n \n /**\n * The message type. \n */\n enum MessageType \n { \n /** Message is determined from the body instance class. If the method is not annotated with Body, then the message type is Map. */\n Auto, \n /** Message is a {@link javax.jms.TextMessage} */\n Text, \n /** Message is a {@link javax.jms.BytesMessage} */\n Bytes, \n /** Message is a {@link javax.jms.ObjectMessage} */\n Object, \n /** Message is a {@link javax.jms.MapMessage} */\n Map, \n /** Message is a {@link javax.jms.Message} as given by the Body parameter */\n JMSMessage \n };\n\n /**\n * The delivery mode.\n */\n enum DeliveryMode \n { \n /**\n * @see javax.jms.DeliveryMode#NON_PERSISTENT\n */\n NonPersistent, \n /**\n * @see javax.jms.DeliveryMode#PERSISTENT\n */\n Persistent,\n /** The default for the provider */\n Auto\n };\n \n /**\n * The acknowledge mode.\n */ \n enum AcknowledgeMode \n { \n /**\n * @see javax.jms.Session#AUTO_ACKNOWLEDGE\n */\n Auto, \n /**\n * @see javax.jms.Session#CLIENT_ACKNOWLEDGE\n */\n Client, \n /**\n * @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE\n */\n DupsOk \n };\n\n /**\n * Indicates the JMSCorrelationID message header. \n *\n * @deprecated\n * @see HeaderType#JMSCorrelationID\n */\n public static final String HEADER_CORRELATIONID = HeaderType.JMSCorrelationID.toString();\n\n /**\n * Indicates the JMSDeliveryMode message header. \n * \n * @deprecated\n * @see HeaderType#JMSDeliveryMode\n */\n public static final String HEADER_DELIVERYMODE = HeaderType.JMSDeliveryMode.toString();\n\n /**\n * Indicates the JMSExpiration message header. \n * Use with the getHeaders and setHeaders methods.\n * \n * @deprecated\n * @see HeaderType#JMSExpiration\n */\n public static final String HEADER_EXPIRATION = HeaderType.JMSExpiration.toString();\n\n /**\n * Indicates the JMSMessageID message header. \n * \n * @deprecated\n * @see HeaderType#JMSMessageID\n */\n public static final String HEADER_MESSAGEID = HeaderType.JMSMessageID.toString();\n\n /**\n * Indicates the JMSPriority message header. \n * \n * @deprecated\n * @see HeaderType#JMSPriority\n */\n public static final String HEADER_PRIORITY = HeaderType.JMSPriority.toString();\n\n /**\n * Indicates the JMSRedelivered message header. \n * \n * @deprecated\n * @see HeaderType#JMSRedelivered\n */\n public static final String HEADER_REDELIVERED = HeaderType.JMSRedelivered.toString();\n\n /**\n * Indicates the JMSTimestamp message header. \n * \n * @deprecated\n * @see HeaderType#JMSTimestamp\n */\n public static final String HEADER_TIMESTAMP = HeaderType.JMSTimestamp.toString();\n\n /**\n * Indicates the JMSType message header. \n * \n * @deprecated\n * @see HeaderType#JMSType\n */\n public static final String HEADER_TYPE = HeaderType.JMSType.toString();\n \n /**\n * Get the {@link Session}.\n * @return the session.\n */\n public Session getSession() throws ControlException;\n \n /**\n * Get the {@link javax.jms.Connection}.\n *\n * @return the connection.\n */\n public javax.jms.Connection getConnection() throws ControlException;\n \n /**\n * Get the {@link javax.jms.Destination}.\n * \n * @return an instance destination object.\n */\n public javax.jms.Destination getDestination() throws ControlException;\n\n\n /**\n * Sets the JMS headers to be assigned to the next JMS message\n * sent. Note that these headers are set only on the next message,\n * subsequent messages will not get these headers. Also note that\n * if the body is a message itself,\n * then any header set through this map will override headers set\n * in the message.\n * \n * @param headers A map of header names (Strings or HeaderType) to header values.\n */\n public void setHeaders(Map headers);\n \n /**\n * Sets a JMS header to be assigned to the next JMS message\n * sent. Note that this headers is set only on the next message,\n * subsequent messages will not get this header. Also note that\n * if the body is a message itself,\n * then the header set here will override the header set\n * in the message.\n * \n * @param type the header type.\n * @param value the value for the header.\n */\n public void setHeader(JMSControl.HeaderType type,Object value);\n \n /**\n * Sets the JMS properties to be assigned to the next JMS message\n * sent. Note that these properties are set only on the next\n * message, subsequent messages will not get these\n * properties. Also note that if the next message is sent through\n * a publish method, then any property set through this\n * map will override properties set in the message itself.\n * \n * @param properties A map of property names (Strings) to property\n * values.\n */\n public void setProperties(Map properties); \n \n /**\n * Set the given JMS property to be assigned to the next JMS message sent. Note that\n * this property is set only on the next message, subsequent messages will not get this\n * property. Also note that if the body is a message itself, then the property set here\n * will override the property set in the message.\n * \n * @param name the property name.\n * @param value the property value.\n */\n public void setProperty(String name,Object value); \n\n /**\n * The message type used by the method. The default is to use the type of the body parameter.\n */\n @PropertySet(prefix=\"Message\")\n @Target({ElementType.METHOD})\n @Retention(RetentionPolicy.RUNTIME)\n public @interface Message\n { \n @FeatureInfo(shortDescription=\"The message type\")\n \tpublic JMSControl.MessageType value() default JMSControl.MessageType.Auto;\n }\n\n /**\n * The method parameter representing a message property with the given name.\n * For more information, see the property getter and setter methods on {@link Message}.\n */\n @Target({ElementType.PARAMETER})\n @Retention(RetentionPolicy.RUNTIME)\n public @interface Property\n {\n /**\n * The property name.\n */\n public String name();\n }\n \n /**\n * The method parameter representing a message property with the given name and value.\n * For more information, see the property getter and setter methods on {@link Message}.\n */\n @PropertySet(prefix=\"Property\")\n @Target({ElementType.METHOD})\n @Retention(RetentionPolicy.RUNTIME)\n public @interface PropertyValue\n {\n /**\n * The property name.\n */\n public String name();\n \n /**\n * The property value.\n */\n public String value();\n \n /**\n * The property type.\n */\n public Class type() default String.class;\n \n }\n \n /**\n * The method/parameter annotation representing a message priority. If not given\n * then the default for the JMS provider is used.\n */ \n @PropertySet(prefix=\"Priority\")\n @Target({ElementType.PARAMETER,ElementType.METHOD})\n @Retention(RetentionPolicy.RUNTIME)\n @AnnotationConstraints.AllowExternalOverride\n public @interface Priority\n {\n @AnnotationMemberTypes.Optional\n public int value() default -1;\n }\n\n /**\n * The method/parameter representing the message JMS type. \n */ \n @PropertySet(prefix=\"Type\")\n @Target({ElementType.PARAMETER, ElementType.METHOD})\n @Retention(RetentionPolicy.RUNTIME)\n public @interface Type\n {\n public String value() default \"\";\n } \n\n /**\n * The method/parameter representing the message JMS CorrelationID. \n */ \n @PropertySet(prefix=\"CorrelationId\")\n @Target({ElementType.PARAMETER,ElementType.METHOD})\n @Retention(RetentionPolicy.RUNTIME)\n public @interface CorrelationId\n {\n public String value() default \"\";\n } \n\n /**\n * The method parameter representing a message expiration in milliseconds. \n * If not given then the default for the JMS provider is used.\n */ \n @PropertySet(prefix=\"Expiration\")\n @Target({ElementType.PARAMETER,ElementType.METHOD})\n @Retention(RetentionPolicy.RUNTIME)\n @AnnotationConstraints.AllowExternalOverride\n public @interface Expiration\n {\n @AnnotationMemberTypes.Optional\n public long value() default -1L;\n }\n\n /**\n * The method parameter representing a message delivery mode. \n * If not given then the default for the JMS provider is used.\n */ \n @PropertySet(prefix=\"Delivery\")\n @Target({ElementType.PARAMETER,ElementType.METHOD})\n @Retention(RetentionPolicy.RUNTIME)\n public @interface Delivery\n {\n public JMSControl.DeliveryMode value() default JMSControl.DeliveryMode.Auto;\n }\n\n /**\n * The method parameter representing one or more properties. \n */ \n @PropertySet(prefix=\"Properties\")\n @Target({ElementType.METHOD})\n @Retention(RetentionPolicy.RUNTIME)\n public @interface Properties\n {\n public PropertyValue[] value();\n }\n\n /**\n * The JMS destination annotation for a extended class method.\n */ \n @PropertySet\n @Retention(RetentionPolicy.RUNTIME)\n @Target({ElementType.TYPE,ElementType.FIELD})\n @AnnotationConstraints.AllowExternalOverride\n public @interface Destination\n {\n /**\n * The JNDI name of the queue or topic.\n */\n // BUG: There should be a JMS_TOPIC_OR_QUEUE resource type.\n @FeatureInfo(shortDescription=\"JNDI name of the queue or topic\")\n @AnnotationMemberTypes.JndiName( resourceType = AnnotationMemberTypes.JndiName.ResourceType.OTHER )\n \tpublic String sendJndiName();\n \n /**\n * The Correlation-Id for messages.\n */\n @FeatureInfo(shortDescription=\"Correlation-Id for messages\")\n @AnnotationMemberTypes.Optional\n \tpublic String sendCorrelationProperty() default \"\";\n \n /**\n * The JNDI name of queue connection factory.\n */\n @FeatureInfo(shortDescription=\"JNDI name of queue connection factory\")\n \tpublic String jndiConnectionFactory();\n \n /**\n * The destination type (DestinationType). The default is to use the type of the destination object named by the JNDI name.\n */\n @FeatureInfo(shortDescription=\"The destination type (DestinationType). The default is to use the type of the destination object named by the JNDI name\")\n @AnnotationMemberTypes.Optional\n public JMSControl.DestinationType sendType() default JMSControl.DestinationType.Auto; \n \n /**\n * True if send is transacted. The default is transacted.\n */\n @FeatureInfo(shortDescription=\"True if send is transacted. The default is transacted\")\n @AnnotationMemberTypes.Optional\n public boolean transacted() default true;\n \n /**\n * The acknowledge mode. The default is to use auto-acknowledge.\n */\n @FeatureInfo(shortDescription=\"The acknowledge mode. The default is to use auto-acknowledge\")\n @AnnotationMemberTypes.Optional\n public JMSControl.AcknowledgeMode acknowledgeMode() default JMSControl.AcknowledgeMode.Auto;\n \n /**\n * The JNDI context factory.\n */\n @FeatureInfo(shortDescription=\"JNDI context factory\")\n @AnnotationMemberTypes.Optional\n \tpublic String jndiContextFactory() default \"\";\n \n /**\n * The JNDI provider URL.\n */\n @FeatureInfo(shortDescription=\"JNDI provider URL\") \n @AnnotationMemberTypes.Optional\n @AnnotationMemberTypes.URI\n \tpublic String jndiProviderURL() default \"\";\n \n /**\n * The JNDI security principal.\n */\n @FeatureInfo(shortDescription=\"JNDI security principal\") \n @AnnotationMemberTypes.Optional\n \tpublic String jndiUsername() default \"\";\n\n /**\n * The JNDI security credentials.\n */\n @FeatureInfo(shortDescription=\"JNDI security credentials\") \n @AnnotationMemberTypes.Optional\n \tpublic String jndiPassword() default \"\";\n }\n}", "public void handleMessage(Message inMessage) {\n if (RestApiUtil.checkIfAnonymousAPI(inMessage)) {\n return;\n }\n \n handleRequest(inMessage, null);\n }", "public void onMessage(Message message, Session session) throws JMSException {\n }", "public void handle_request(Request request){\n currentRequest.add(request);\n System.out.println(\"[Worker\"+String.valueOf(id)+\"] Received request of client \"+String.valueOf(request.getId()));\n }", "abstract public Object handleMessage(Object message) throws Exception;", "@Override\n public void handleMessage(Message message) {}", "public Message handleRequest(Message request){\n\n Message error = new Message(Message.GENERIC_ERROR);\n\n switch (request.getId()){\n\n case Message.LOGIN:\n return handleLogin(request);\n case Message.CREATE_DOCUMENT:\n return handleCreate(request);\n case Message.REMOVE_INVITE:\n controlServer.removeInvite(request.getUserName(),request.getDocumentName());\n return request;\n case Message.PORTIONS:\n System.out.println(\"HANDLER pre-handle: \" +request.getDocumentName());\n request.setSectionNumbers(controlServer.getPortions(request.getDocumentName()));\n return request;\n case Message.ADMINS:\n Message response = new Message(Message.ADMINS);\n response.setStringVector(new Vector<>(controlServer.getAdmins(request.getDocumentName())));\n return response;\n case Message.USERS:\n request.setStringVector(controlServer.getUserNames());\n return request;\n case Message.INVITATION:\n controlServer.addAdmin(request.getDocumentName(),request.getReceiver());\n controlServer.addInvite(request.getReceiver(),request.getDocumentName());\n request.setId(Message.INVITE_SENT);\n return request;\n case Message.GET_INVITES:\n String owner = request.getUserName();\n request.setStringVector(controlServer.getUserData(owner).getInvites());\n return request;\n case Message.GET_USERDATA:\n return handleGetUserData(request);\n case Message.LOCK:\n if(!controlServer.lock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.LOCK_NOK);\n else\n request.setId(Message.LOCK_OK);\n return request;\n case Message.UNLOCK:\n if(controlServer.unlock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.UNLOCK_OK);\n return request;\n case Message.EDIT:\n String DocumentName = request.getDocumentName();\n int SectionNumbers = request.getSectionNumbers();\n request.setText(controlServer.getSection(DocumentName,SectionNumbers));\n return request;\n case Message.END_EDIT:\n controlServer.editDoc(request.getDocumentName(),request.getSectionNumbers(),request.getText());\n return request;\n case Message.PRINT:\n request.setText(controlServer.getDocumentString(request.getDocumentName()));\n return request;\n case Message.SHOW:\n String text = controlServer.getSection(request.getDocumentName(),request.getSectionNumbers());\n request.setText(text);\n return request;\n default:\n controlServer.showMessage(\"unknown request\");\n break;\n }return error;\n }", "@Override\n public void handleDelivery(String consumerTag, Envelope envelope,\n AMQP.BasicProperties properties, byte[] body) throws IOException \n {\n try\n {\n Object obj = getObjectForBytes(body);\n json = returnJson(obj);\n System.out.println(\"The json is \"+json.toString());\n \n } catch (ClassNotFoundException ex)\n {\n Logger.getLogger(JsonTranslator.class.getName()).log(Level.SEVERE, null, ex);\n }finally \n {\n System.out.println(\" [x] Done\");\n publishJsonData();//VERY INOVATIVE\n //DDO NOT KILL THE \n // channel.basicAck(envelope.getDeliveryTag(), false);\n }\n \n }", "SourceMessage onNewMessageReceived(PubsubMessage pubsubMessage, AckReplyConsumer ackReplyConsumer);", "void requestReceived( C conn ) ;", "<T extends RequestMessage> void addRequestConsumer(Class<T> cls, Consumer<T> consumer);", "public void processMessage(JsonObject messagetJsonObject, ServerSessionFactory factory,\n ResponseSender responseSender, String internalSessionId) throws IOException {\n\n if (messagetJsonObject.has(Request.METHOD_FIELD_NAME)) {\n processRequestMessage(factory, messagetJsonObject, responseSender, internalSessionId);\n } else {\n processResponseMessage(messagetJsonObject, internalSessionId);\n }\n }", "@Override\n\tpublic void onMessage(Message msg) {\n\t\tSystem.out.println(\"[INFO] [HANDLE ACL MSG] Received ACL message in QueueMDB\");\n\t\ttry {\n\t\t\tACLMessage receivedMessage = (ACLMessage) ((ObjectMessage) msg).getObject();\n\t\t\tAID[] receivers = receivedMessage.getReceivers();\n\t\t\tSet<String> ipAddresses = new HashSet<String>();\n\t\t\t\n\t\t\tSystem.out.println(\"[INFO] [HANDLE ACL MSG] Forwarding messages to agents on this host\");\n\t\t\tfor (AID a: receivers) {\n\t\t\t\tif(a.getHost().getIpAddress().equals(this.hostManagerBean.getCurrentSlaveHost().getIpAddress())) {\n\t\t\t\t\tAgent at = HostService.findAgentWithAID(this.hostManagerBean.getRunningAgents().get(this.hostManagerBean.getCurrentSlaveHost().getIpAddress()), a);\n\t\t\t\t\tat.handleMessage(receivedMessage);\n\t\t\t\t} else {\n\t\t\t\t\tipAddresses.add(a.getHost().getIpAddress());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"[INFO] [HANDLE ACL MSG] Forwarding messages to agents on other hosts\");\n\t\t\tfor(String receivingHostIp: ipAddresses) {\n\t\t\t\tSystem.out.println(\"[INFO] [HANDLE ACL MSG] Forwarding message to {\" + receivingHostIp + \"}\");\n\t\t\t\tRestHostBuilder.sendACLMessageBuilder(this.hostManagerBean.getCurrentSlaveHost(), receivingHostIp, receivedMessage);\n\t\t\t}\n\t\t\t\n\t\t\t//TODO Update socket\n\t\t\t//TODO kad se sve poruke posalju, potrebno je azurirati spisak ACL poruka\n\t\t\t\n\t\t\tSystem.out.println(\"[INFO] [HANDLE ACL MSG] FINISHED\");\n\t\t\t//ws.echoTextMessage(tmsg.getText());\n\t\t} catch (JMSException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface MessageSender {\n boolean handle(Context context, MessageResponse response);\n}", "CompletionStage<ResponseMessage> invoke(RequestMessage requestMessage);", "public interface MessageHandler {\n void onMessage(final byte messageType, final int messageId, final byte[] buffer, final int startIndex, final int length);\n}", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\tcase 911:\n\t\t\t\tqueryMsg();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "private void createQueue(RoutingContext routingContext) {\n LOGGER.debug(\"Info: createQueue method started;\");\n JsonObject requestJson = routingContext.getBodyAsJson();\n HttpServerRequest request = routingContext.request();\n HttpServerResponse response = routingContext.response();\n String instanceID = request.getHeader(HEADER_HOST);\n JsonObject authenticationInfo = new JsonObject();\n authenticationInfo.put(API_ENDPOINT, \"/management/queue\");\n requestJson.put(JSON_INSTANCEID, instanceID);\n if (request.headers().contains(HEADER_TOKEN)) {\n authenticationInfo.put(HEADER_TOKEN, request.getHeader(HEADER_TOKEN));\n authenticator.tokenInterospect(requestJson.copy(), authenticationInfo, authHandler -> {\n LOGGER.debug(\"Info: Authenticating response ;\".concat(authHandler.result().toString()));\n if (authHandler.succeeded()) {\n Future<Boolean> validNameResult =\n isValidName(requestJson.copy().getString(JSON_QUEUE_NAME));\n validNameResult.onComplete(validNameHandler -> {\n if (validNameHandler.succeeded()) {\n Future<JsonObject> brokerResult = managementApi.createQueue(requestJson, databroker);\n brokerResult.onComplete(brokerResultHandler -> {\n if (brokerResultHandler.succeeded()) {\n LOGGER.info(\"Success: Creating Queue\");\n handleSuccessResponse(response, ResponseType.Created.getCode(),\n brokerResultHandler.result().toString());\n } else if (brokerResultHandler.failed()) {\n LOGGER.error(\"Fail: Bad request\" + brokerResultHandler.cause().getMessage());\n processBackendResponse(response, brokerResultHandler.cause().getMessage());\n }\n });\n } else {\n LOGGER.error(\"Fail: Bad request\");\n handleResponse(response, ResponseType.BadRequestData, MSG_INVALID_EXCHANGE_NAME);\n }\n\n });\n } else if (authHandler.failed()) {\n LOGGER.error(\"Fail: Unauthorized;\" + authHandler.cause().getMessage());\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n });\n } else {\n LOGGER.error(\"Fail: Unauthorized\");\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n }", "public abstract void msgHandler(Message msg);", "public void receiveResponse(String queueName) throws MessagingException {\n \t\t\n \t}", "@Override\n\t\tpublic int onMessage(int srcId, int requestId, int subject, int cmd, Object payload) {\n\t\t\treturn 0;\n\t\t}", "public void handleRequest(Request req) {\n\n }", "public interface MessageListener {\n\t\n\t/**\n\t * Method used to consume message\n\t * @param message\tMessage that You want to consume\n\t */\n\tvoid consumeMessage(String message);\n\t\n\t/**\n\t * Method used when You want to get all consumed messages\n\t * @return\tList of messages consumed from a jms queue/topic\n\t */\n\tList<String> getFeeds();\n\n}", "@Override\n\t\t\tpublic void onMessage(Message message) {\n\t\t\t\tTextMessage msg = null;\n\t\t\t\t\n\t\t\t\tif(message instanceof TextMessage){\n\t\t\t\t\tmsg = (TextMessage)message;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSystem.out.println(\"Consumer:->Receiving message: \"+ msg.getText());\n\t\t\t\t\t} catch (JMSException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"Message of wrong type: \"+message.getClass().getName());\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void consume(Message message) {\n\t\tif (!AMQ_CONTENT_TYPE_JSON_GET.equals(message.getStringProperty(AMQ_CONTENT_TYPE)))\n\t\t\treturn;\n\n\t\tJson node = Util.readBodyBuffer(message.toCore());\n\t\tString correlation = message.getStringProperty(Config.AMQ_CORR_ID);\n\t\tString destination = message.getStringProperty(Config.AMQ_REPLY_Q);\n\n\t\t// deal with diff format\n\t\tif (node.has(CONTEXT) && (node.has(GET))) {\n\t\t\tif (logger.isDebugEnabled())\n\t\t\t\tlogger.debug(\"GET msg: {}\", node.toString());\n\t\t\tString ctx = node.at(CONTEXT).asString();\n\t\t\tString jwtToken = null;\n\t\t\tif (node.has(SignalKConstants.TOKEN) && !node.at(SignalKConstants.TOKEN).isNull()) {\n\t\t\t\tjwtToken = node.at(SignalKConstants.TOKEN).asString();\n\t\t\t}\n\t\t\tString root = StringUtils.substringBefore(ctx, dot);\n\t\t\troot = Util.sanitizeRoot(root);\n\n\t\t\t// limit to explicit series\n\t\t\tif (!vessels.equals(root) && !CONFIG.equals(root) && !sources.equals(root) && !resources.equals(root)\n\t\t\t\t\t&& !aircraft.equals(root) && !sar.equals(root) && !aton.equals(root) && !ALL.equals(root)) {\n\t\t\t\ttry {\n\t\t\t\t\tsendReply(destination, FORMAT_FULL, correlation, Json.object(), jwtToken);\n\t\t\t\t\treturn;\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(e, e);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tString qUuid = StringUtils.substringAfter(ctx, dot);\n\t\t\tif (StringUtils.isBlank(qUuid))\n\t\t\t\tqUuid = \"*\";\n\t\t\tArrayList<String> fullPaths = new ArrayList<>();\n\n\t\t\ttry {\n\t\t\t\tNavigableMap<String, Json> map = new ConcurrentSkipListMap<>();\n\t\t\t\tfor (Json p : node.at(GET).asJsonList()) {\n\n\t\t\t\t\tString path = p.at(PATH).asString();\n\t\t\t\t\tString time = p.has(\"time\") ? p.at(\"time\").asString() : null;\n\t\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\t\tlogger.debug(\"GET time : {}={}\", time,\n\t\t\t\t\t\t\t\tStringUtils.isNotBlank(time) ? Util.getMillisFromIsoTime(time) : null);\n\t\t\t\t\tpath = Util.sanitizePath(path);\n\t\t\t\t\tfullPaths.add(Util.sanitizeRoot(ctx + dot + path));\n\n\t\t\t\t\tMap<String, String> queryMap = new HashMap<>();\n\t\t\t\t\tif (StringUtils.isNotBlank(path))\n\t\t\t\t\t\tqueryMap.put(skey, Util.regexPath(path).toString());\n\t\t\t\t\tif (StringUtils.isNotBlank(qUuid))\n\t\t\t\t\t\tqueryMap.put(\"uuid\", Util.regexPath(qUuid).toString());\n\t\t\t\t\tswitch (root) {\n\t\t\t\t\tcase CONFIG:\n\t\t\t\t\t\tinflux.loadConfig(map, queryMap);\n\t\t\t\t\t\tif (map.size() == 0 && queryMap.size() == 0) {\n\t\t\t\t\t\t\t// send defaults\n\t\t\t\t\t\t\tConfig.setDefaults(map);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase resources:\n\t\t\t\t\t\tinflux.loadResources(map, queryMap);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase sources:\n\t\t\t\t\t\tinflux.loadSources(map, queryMap);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase vessels:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, vessels, queryMap, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, vessels, queryMap);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase aircraft:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, aircraft, queryMap, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, aircraft, queryMap);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase sar:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, sar, queryMap, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, sar, queryMap);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase aton:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, aton, queryMap, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, aton, queryMap);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ALL:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, vessels, null, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, vessels, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// loadAllDataFromInflux(map,aircraft);\n\t\t\t\t\t\t// loadAllDataFromInflux(map,sar);\n\t\t\t\t\t\t// loadAllDataFromInflux(map,aton);\n\t\t\t\t\tdefault:\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\tlogger.debug(\"GET token: {}, map : {}\", jwtToken, map);\n\n\t\t\t\t// security filter here\n\t\t\t\tSecurityUtils.trimMap(map, message.getStringProperty(Config.AMQ_USER_ROLES));\n\n\t\t\t\tJson json = SignalkMapConvertor.mapToFull(map);\n\n\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\tlogger.debug(\"GET json : {}\", json);\n\n\t\t\t\tString fullPath = StringUtils.getCommonPrefix(fullPaths.toArray(new String[] {}));\n\t\t\t\t// fullPath=StringUtils.remove(fullPath,\".*\");\n\t\t\t\t// fullPath=StringUtils.removeEnd(fullPath,\".\");\n\n\t\t\t\t// for REST we only send back the sub-node, so find it\n\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\tlogger.debug(\"GET node : {}\", fullPath);\n\n\t\t\t\tif (StringUtils.isNotBlank(fullPath) && !root.startsWith(CONFIG) && !root.startsWith(ALL))\n\t\t\t\t\tjson = Util.findNodeMatch(json, fullPath);\n\n\t\t\t\tsendReply(destination, FORMAT_FULL, correlation, json, jwtToken);\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(e, e);\n\n\t\t\t}\n\n\t\t}\n\t\treturn;\n\t}", "public void processRequest(StunMessageEvent evt)\n {\n if(messageSequence.isEmpty())\n return;\n Object obj = messageSequence.remove(0);\n\n if( !(obj instanceof Response) )\n return;\n\n Response res = (Response)obj;\n\n try\n {\n stunStack.sendResponse(evt.getMessage().getTransactionID(),\n res, serverAddress, evt.getRemoteAddress());\n }\n catch (Exception ex)\n {\n logger.log(Level.WARNING, \"failed to send a response\", ex);\n }\n\n }", "void received() throws ImsException;", "@Override\n public void handleClientRequest(User sender, ISFSObject params) {\n }", "@GET\n @Path(\"read/{queue}/{msgid}\")\n @Produces(\"application/xml\")\n public SEHRDataObject readMessage(\n @PathParam(\"queue\") String queue,\n @PathParam(\"msgid\") String msgid) {\n ActiveMQConnection amqcon = (ActiveMQConnection) sctx.getAttribute(\"ActiveMQConnection\");\n //SEHRDataObjectTxHandler sdoTxHandler = SEHRDataObjectTxHandler.getInstance();\n SEHRDataObject sdo = new SEHRDataObject();\n try {\n QueueSession sess = amqcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);\n //ActiveMQQueue q = new ActiveMQQueue(queue);\n //QueueBrowser queueBrowser = sess.createBrowser((Queue) q);\n Destination q = sess.createQueue(queue);\n MessageConsumer consumer = sess.createConsumer(q, \"JMSMessageID='\" + msgid + \"'\");\n //get specified message\n amqcon.start();\n Message message = consumer.receiveNoWait();\n if (message == null) {\n Logger.getLogger(SDOTxResource.class.getName()).warning(\"No message wit ID \" + msgid);\n consumer.close();\n sess.close();\n return null;\n }\n if (message instanceof MapMessage) {\n MapMessage mm = (MapMessage) message;\n Map<String, Object> msgProperties = txMsgHeader2SDOHeader(message);\n //'param' is part of data / body...\n //TODO check specification\n Object oParam = mm.getObject(\"param\");\n if (oParam != null) {\n msgProperties.put(\"param\", oParam);\n }\n sdo.setSDOProperties(msgProperties);\n //TODO process data / body / content\n Object oData = mm.getObject(\"data\");\n// if (oData instanceof Map){\n// try {\n// //WebService does not accept a Map\n// byte[] b = DeSerializer.serialize(oData);\n// sdo.setDataobject(b);\n// } catch (ObjectHandlerException ex) {\n// Logger.getLogger(SDOTxResource.class.getName()).log(Level.SEVERE, null, ex);\n// }\n// }else{\n// sdo.setDataobject(oData);\n// }\n //always serialize...\n try {\n //WebService does not accept some types (like Map)\n byte[] b = DeSerializer.serialize(oData);\n sdo.setDataobject(b);\n } catch (ObjectHandlerException ex) {\n Logger.getLogger(SDOTxResource.class.getName()).log(Level.SEVERE, null, ex.getMessage());\n }\n //System.out.println(\"Received and marshalled: \" + message.toString());\n Logger.getLogger(SDOTxResource.class.getName()).info(\"Received and marshalled: \" + message.toString());\n } else if (message instanceof ObjectMessage) {\n Logger.getLogger(SDOTxResource.class.getName()).info(\"ObjectMessage received. byte[] transforming of message: \" + message.toString());\n try {\n //WebService does not accept some types (like Map)\n byte[] b = DeSerializer.serialize(((ObjectMessage) message).getObject());\n sdo.setDataobject(b);\n } catch (ObjectHandlerException ex) {\n Logger.getLogger(SDOTxResource.class.getName()).log(Level.SEVERE, null, ex.getMessage());\n }\n //System.out.println(\"Received but not marshalled, not a MapMessage: \" + message.toString());\n } else if (message instanceof TextMessage) {\n Logger.getLogger(SDOTxResource.class.getName()).info(\"ObjectMessage received. byte[] transforming of message: \" + message.toString());\n sdo.setDataobject(((TextMessage) message).getText());\n } else {\n Logger.getLogger(SDOTxResource.class.getName()).warning(\"No processor for message: \" + message.toString());\n }\n consumer.close();\n sess.close();\n } catch (JMSException ex) {\n Logger.getLogger(SDOTxResource.class.getName()).log(Level.SEVERE, null, ex.getMessage());\n return null;\n }\n return sdo;\n }", "@Override\n\tpublic void processRequest(RequestEvent requestEvent) {\n\t\t requestEvent.getServerTransaction();\n\t\tSystem.out.println(\"Sending ------------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"[]:\"+requestEvent.toString());\n\t}", "@Override\n\tpublic void requestHandle(IPlayer player, IMessage message) {\n\t\t\n\t}", "String addReceiveQueue();", "public void onQueue();", "Consumer<VoidMessage> outgoingConsumer();", "public interface RequestSender {\n\n /**\n * Adds a message consumer to be invoked when an AGREE response is received.\n * There may be more than one message consumer, and all message consumers will be invoked when this condition is met.\n * The Future will be marked as completed once the message consumer(s) are invoked.\n *\n * @param consumer Message consumer.\n * @return This request sender.\n */\n RequestSender onAgree(Consumer<Message> consumer);\n\n /**\n * Adds a message consumer to be invoked when a REFUSE response is received.\n * There may be more than one message consumer, and all message consumers will be invoked when this condition is met.\n * The Future will be marked as completed once the message consumer(s) are invoked.\n *\n * @param consumer Message consumer.\n * @return This request sender.\n */\n RequestSender onRefuse(Consumer<Message> consumer);\n\n /**\n * Adds a message consumer to be invoked when a FAILURE response is received.\n * There may be more than one message consumer, and all message consumers will be invoked when this condition is met.\n * The Future will be marked as completed once the message consumer(s) are invoked.\n *\n * @param consumer Message consumer.\n * @return This request sender.\n */\n RequestSender onFailure(Consumer<Message> consumer);\n\n /**\n * Adds a message consumer to be invoked when an INFORM message is received.\n * There may be more than one message consumer, and all message consumers will be invoked when this condition is met.\n * The Future will be marked as completed once the message consumer(s) are invoked.\n *\n * @param consumer Message consumer.\n * @return This request sender.\n */\n RequestSender onInform(Consumer<Message> consumer);\n\n /**\n * Adds a Runnable to be invoked when this operation times out.\n * There may be more than one timeout Runnable, but only the one associated with the triggered timeout is invoked.\n * The Future will be marked as completed once the Runnable is invoked.\n *\n * @param timeout Timeout (ms).\n * @param runnable Runnable.\n * @return This request sender.\n */\n RequestSender onTimeout(long timeout, Runnable runnable);\n\n /**\n * Adds a message consumer to be invoked when a message that is not one of AGREE, REFUSE, FAILURE, INFORM is received.\n * There may be more than one message consumer, and all message consumers will be invoked when this condition is met.\n * The Future will be marked as completed once the message consumer(s) are invoked.\n *\n * @param consumer Message consumer.\n * @return This request sender.\n */\n RequestSender otherwise(Consumer<Message> consumer);\n\n /**\n * Sends the message asynchronously.\n * The returned Future will return the response message for any of the message types which have a message consumer associated.\n *\n * @return A Future returning the response message.\n */\n Future<Message> send();\n\n /**\n * Sends the message synchronously.\n *\n * @return A response message for any of the message types which have a message consumer associated, null if the operation timed out.\n */\n Message sendAndWait();\n}", "public void consume(Connector connector) {\n\n\t}", "@Override\n\tpublic void channelRead(ChannelHandlerContext ctx, Object msg)\n\t\t\tthrows Exception {\n\t\thandleRequestWithsingleThread(ctx, msg);\n\t}", "@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}", "@Override\n\tpublic void processMessage(Message message) {\n\t\t\n\t}", "private void handleMessage(Message input, SessionID sessionID) throws UnsupportedMessageType {\n LOG.debug(\"type of message: \" + input.getClass().getSimpleName());\n String classSimpleName = input.getClass().getSimpleName();\n if (classSimpleName.equalsIgnoreCase(\"NewOrderSingle\")) {\n handleNewOrderSingle(input, sessionID);\n } else {\n throw new UnsupportedMessageType();\n }\n }", "<T extends Message> void visitConsumer(Class<T> consumedType, MethodHandle handle);", "@Override\n public void processMessage(int type, String receivedMsg) {\n }", "public static void main(String[] args) throws JMSException, IOException {\n JmsFactoryFactory jmsFact = JmsFactoryFactory.getInstance();\n\n // Create a JMS destination\n Destination dest;\n\n // Create JMS queue\n JmsQueue queue = jmsFact.createQueue(QUEUE_NAME);\n dest = queue;\n\n // Create a unified JMS connection factory\n JmsConnectionFactory connFact = jmsFact.createConnectionFactory();\n\n // Configure the connection factory\n connFact.setBusName(BUS_NAME);\n connFact.setProviderEndpoints(JMS_ENDPOINT);\n\n // Create the connection\n Connection conn = connFact.createConnection();\n\n Session session = null;\n MessageProducer producer = null;\n MessageConsumer consumer = null;\n try {\n\n // Create a session\n session = conn.createSession(false, // Not transactional\n Session.AUTO_ACKNOWLEDGE);\n\n // Create a message producer\n producer = session.createProducer(dest);\n consumer = session.createConsumer(dest);\n\n // Loop reading lines of text from the console to send\n System.out.println(\"Ready to send to \" + dest + \" on bus \" + BUS_NAME);\n BufferedReader lineInput = new BufferedReader(new InputStreamReader(System.in));\n String line = lineInput.readLine();\n\n TextMessage message = session.createTextMessage();\n message.setText(line);\n\n // Send the message\n producer.send(message,\n Message.DEFAULT_DELIVERY_MODE,\n Message.DEFAULT_PRIORITY,\n Message.DEFAULT_TIME_TO_LIVE);\n\n // should start the connection to receive messages\n conn.start();\n Message msg = consumer.receiveNoWait();\n System.out.println(\"Consumed a message from queue\");\n if (msg != null) {\n msg.acknowledge();\n System.out.println(msg.toString());\n } else System.out.println(\"null msg\");\n\n }\n // Finally block to ensure we close our JMS objects\n finally {\n\n // Close the message producer\n try {\n if (producer != null) producer.close();\n if (consumer != null) consumer.close();\n } catch (JMSException e) {\n System.err.println(\"Failed to close message producer: \" + e);\n }\n\n // Close the session\n try {\n if (session != null) session.close();\n } catch (JMSException e) {\n System.err.println(\"Failed to close session: \" + e);\n }\n\n // Close the connection\n try {\n conn.close();\n } catch (JMSException e) {\n System.err.println(\"Failed to close connection: \" + e);\n }\n\n }\n }", "public Object handleRequest(P request) throws Exception;", "private void messageHandler(Message message, ArrayList<Message> from,\t\n\t\t\tArrayList<Message> to) {\n\t\tassert (message != null);\n\t\tassert (from != null);\n\t\tassert (to != null);\n\t\tif (from.size() > 0) {\n\t\t\tMessage responderMessage = from.remove(0);\n\t\t\ttry {\n\t\t\t\tchannel.sendMessage(\n\t\t\t\t\t\tnew Message(Message.Type.Assigned, message.getInfo(),\n\t\t\t\t\t\t\t\tresponderMessage.getClientID()).toString(),\n\t\t\t\t\t\tresponderMessage.getClientID());\n \n\t\t\t\tchannel.sendMessage(new Message(Message.Type.Assigned,\n\t\t\t\t\t\tresponderMessage.getInfo(), message.getClientID())\n\t\t\t\t\t\t.toString(), message.getClientID());\n\t\t\t\tmethods.add(responderMessage.getType().toString()); // adds the type of request to the methods array to store it \n\t\t\t \n\t\t\t\t\n\t\t\t\n\t\t\t} catch (ChannelException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t} else {\n\t\t\tto.add(message);\n\t\t\ttry {\n\t\t\t\tchannel.sendMessage(new Message(Message.Type.Searching, \"\",\n\t\t\t\t\t\tmessage.getClientID()).toString(), message\n\t\t\t\t\t\t.getClientID());\n\t\t\t} catch (ChannelException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\tpublic void onMessage(Message message) {\n\t\t\tTextMessage msg = null;\n\t\t\t\n\t\t\tif(message instanceof TextMessage){\n\t\t\t\tmsg = (TextMessage)message;\n\t\t\t\ttry {\n\t\t\t\t\tSystem.out.println(\"Consumer:->Receiving message: \"+ msg.getText());\n\t\t\t\t} catch (JMSException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"Message of wrong type: \"+message.getClass().getName());\n\t\t\t}\n\t\t}", "public void invoke(MessageContext msgContext) throws AxisFault\n {\n JMSConnector connector = null;\n try\n {\n Object destination = msgContext.getProperty(JMSConstants.DESTINATION);\n if(destination == null)\n throw new AxisFault(\"noDestination\");\n\n connector = (JMSConnector)msgContext.getProperty(JMSConstants.CONNECTOR);\n\n JMSEndpoint endpoint = null;\n if(destination instanceof String)\n endpoint = connector.createEndpoint((String)destination);\n else\n endpoint = connector.createEndpoint((Destination)destination);\n\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n msgContext.getRequestMessage().writeTo(out);\n\n HashMap props = createSendProperties(msgContext);\n\n // If the request message contains attachments, set\n // a contentType property to go in the outgoing message header\n String ret = null;\n Message message = msgContext.getRequestMessage();\n Attachments mAttachments = message.getAttachmentsImpl();\n if (mAttachments != null && 0 != mAttachments.getAttachmentCount()) \n {\n String contentType = mAttachments.getContentType();\n if(contentType != null && !contentType.trim().equals(\"\")) \n {\n props.put(\"contentType\", contentType);\n }\n }\n\n boolean waitForResponse = true;\n if(msgContext.containsProperty(JMSConstants.WAIT_FOR_RESPONSE))\n waitForResponse =\n ((Boolean)msgContext.getProperty(\n JMSConstants.WAIT_FOR_RESPONSE)).booleanValue();\n if(waitForResponse)\n {\n long timeout = (long) msgContext.getTimeout();\n byte[] response = endpoint.call(out.toByteArray(), timeout, props);\n Message msg = new Message(response);\n msgContext.setResponseMessage(msg);\n }\n else\n {\n endpoint.send(out.toByteArray(), props);\n }\n }\n catch(Exception e)\n {\n throw new AxisFault(\"failedSend\", e);\n }\n finally\n {\n if (connector != null)\n JMSConnectorManager.getInstance().release(connector);\n }\n }", "public boolean processEMSInService(String p_msg_str, String msgQ) {\n String emsQueueCf = \n FCApplicationGlobals.getProps().getProperty(IFCConstants.EMS_INT_QCF);\n String emsQueue = msgQ;\n // getVal(IFCConstants.EMS_INT_QUEUE);\n flushResources();\n boolean l_retVal = false;\n PreparedStatement updPstmt = null;\n\n g_transacted = \n true; //settting g_transacted to true helps all JMS transaction to be explicitly committed once\n\n TextMessage l_txt_msg = null;\n Queue l_Qu = null;\n int res = 0;\n\n InitialContext initialContext = null;\n\n\n try {\n initialContext = new InitialContext();\n if (qConnectionFactory == null) {\n qConnectionFactory = \n (QueueConnectionFactory)initialContext.lookup(emsQueueCf);\n }\n l_Qu = (Queue)initialContext.lookup(emsQueue);\n\n if (g_Qcon == null) {\n g_Qcon = qConnectionFactory.createQueueConnection();\n }\n\n g_Qcon.start();\n\n if (g_Qses == null) {\n g_Qses = \n g_Qcon.createQueueSession(g_transacted, Session.AUTO_ACKNOWLEDGE);\n }\n\n\n //Create Sender using seesion\n if (g_Qsend == null) {\n g_Qsend = g_Qses.createSender(l_Qu);\n }\n\n\n l_txt_msg = g_Qses.createTextMessage();\n l_txt_msg.setText(p_msg_str);\n\n g_Qsend.send(l_txt_msg);\n l_retVal = true;\n } catch (Exception ex) {\n dbg(\"processEMSInService-->Exception = \" + ex.getMessage());\n\n ex.printStackTrace();\n l_retVal = false;\n }\n return l_retVal;\n }", "private void handleIncomingMessage(MulticastPackage receivedMessage) {\n if (shouldBeIgnored(receivedMessage)) {\n Log.warn(\"Silently ignoring incoming message {0}.\", receivedMessage);\n return;\n }\n\n if (receivedMessage.isQuery()) {\n responder.accept(receivedMessage);\n } else {\n querier.accept(receivedMessage);\n }\n }", "public void handle(int ID, Object message){}", "@Override\n\tpublic void msgReceived(Message msg) {\n\n\t}", "RequestSender onAgree(Consumer<Message> consumer);", "@Override\n\tpublic MulticastResponse processRequest(InterChildrenRequest request)\n\t{\n\t\treturn null;\n\t}", "@Override\n public void channelRead(final ChannelHandlerContext ctx,final Object msg) {\n deliveryService.delivery(ctx,msg);\n }", "public void handleRequest(Request request)\n {\n Request proxied = new Request(extractMethodName(request.getMethodName()), request.getParams()).withResponseBlock(request.getResponseBlock());\n proxied.setIdentifier(request.getIdentifier());\n receiver.handleMessage(proxied.toJsonString());\n }", "@Override\n\tpublic void processMessage(byte[] message) {\n\t}", "public void handleMessage(Message msg, String listenerId)\n {\n String messageType = popString(Message.MESSAGE_TYPE_TAG, msg);\n\n if (messageType.equals(Message.REQUEST_SEARCH))\n {\n handleRequest(msg, listenerId);\n } else if (messageType.equals(Message.REQUEST_RESOLVE))\n {\n handleResponse(msg, listenerId);\n } else\n {\n LOG.error(\"Ignoring message type: \" + messageType);\n }\n }", "public void onMessage(ClientSubscription subscription,\n HazelcastMQMessage msg);", "@Override\n public void onNext(RequestData request) {\n System.out.println(\"Requestor:\" + request.getName());\n System.out.println(\"Request Message:\" + request.getMessage());\n }", "public AsynchronousReplier(String requestReceiverQueue) throws Exception {\n super();\n gateway = new MessagingGateway(requestReceiverQueue);\n gateway.setListener(new MessageListener() {\n\n @Override\n public void onMessage(Message message) {\n onRequest((ObjectMessage) message);\n }\n });\n this.activeRequests = new Hashtable<Serializable, Message>();\n }", "void handleRequest();", "public interface QueueService {\n\n /**\n * 添加元素\n *\n * @param messageQueue\n */\n void add(MessageQueue messageQueue);\n\n\n /**\n * 弹出元素\n */\n MessageQueue poll();\n\n Iterator<MessageQueue> iterator();\n\n\n}", "@Override\n\tpublic void handleIncomingMessage(IMessage incoming) throws RPCException {\n\t\t\n\t}", "public MessageConsumer getMessageConsumer() {\n return messageConsumer;\n }", "void addToQueue(WebhookMessage msg);" ]
[ "0.7280152", "0.67240244", "0.63188136", "0.6268633", "0.62472093", "0.6159754", "0.6080197", "0.605946", "0.6028903", "0.601523", "0.597764", "0.59605", "0.59238684", "0.5909902", "0.5884185", "0.58778685", "0.5875004", "0.58668333", "0.5866066", "0.5849763", "0.5844052", "0.58125216", "0.5803441", "0.58013695", "0.57730246", "0.57702976", "0.57669735", "0.5741992", "0.57321894", "0.5731473", "0.5723826", "0.5721553", "0.5714589", "0.5712577", "0.5692991", "0.5687258", "0.5677968", "0.5675774", "0.5666384", "0.5655562", "0.5633065", "0.5626737", "0.5617712", "0.56078964", "0.5601638", "0.5598004", "0.5596199", "0.55903655", "0.5566076", "0.5553835", "0.55499655", "0.55470103", "0.554591", "0.5543255", "0.55385065", "0.55332285", "0.5528582", "0.5522131", "0.55056906", "0.55011874", "0.55002433", "0.5497128", "0.54876214", "0.548677", "0.5482777", "0.5470462", "0.5470286", "0.5460516", "0.5458204", "0.54581124", "0.5453966", "0.5451516", "0.54497105", "0.5447762", "0.54471546", "0.54465705", "0.54201776", "0.541922", "0.538787", "0.5378406", "0.5375741", "0.5342486", "0.5342359", "0.53396475", "0.53364855", "0.5332093", "0.53299516", "0.5329075", "0.53290284", "0.5326809", "0.53237915", "0.5322746", "0.5322397", "0.5319416", "0.53188735", "0.53187", "0.531518", "0.5314108", "0.53138316", "0.53130144" ]
0.6753657
1
XXX should have some use of Job to actually make synchronous call in response to request and send result
void handleJMSRequest(Message jmsMessage, Request request) { final RemoteServiceRegistrationImpl localRegistration = getLocalRegistrationForJMSRequest(request); // Else we've got a local service and we invoke it final RemoteCallImpl call = request.getCall(); Response response = null; Object result = null; // Actually call local service here try { result = localRegistration.callService(call); response = new Response(request.getRequestId(), result); } catch (final Exception e) { response = new Response(request.getRequestId(), e); log(208, "Exception invoking service", e); //$NON-NLS-1$ } // Then send response back to initial sender try { ObjectMessage responseMessage = container.getSession().createObjectMessage(); responseMessage.setObject(response); responseMessage.setJMSCorrelationID(jmsMessage.getJMSCorrelationID()); container.getMessageProducer().send(jmsMessage.getJMSReplyTo(), responseMessage); } catch (JMSException e) { log("sendCallResponse jmsMessage=" + jmsMessage + ", response=" + response, e); //$NON-NLS-1$ //$NON-NLS-2$ } // XXX end need for job }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public byte[] execute() {\n return buildResponse();\n }", "JobResponse apply();", "@SuppressWarnings(\"WeakerAccess\")\n protected void makeRequest() {\n if (mCallback == null) {\n CoreLogger.logError(addLoaderInfo(\"mCallback == null\"));\n return;\n }\n\n synchronized (mWaitLock) {\n mWaitForResponse.set(true);\n }\n\n doProgressSafe(true);\n\n Utils.runInBackground(true, new Runnable() {\n @Override\n public void run() {\n try {\n CoreLogger.log(addLoaderInfo(\"makeRequest\"));\n makeRequest(mCallback);\n }\n catch (Exception exception) {\n CoreLogger.log(addLoaderInfo(\"makeRequest failed\"), exception);\n callbackHelper(false, wrapException(exception));\n }\n }\n });\n }", "CompletableFuture<WriteResponse> submit();", "CompletableFuture<HttpResponse> sendRequest(HttpRequest request);", "ResponseEntity execute();", "private Object proxyGet (Request request, Response response) {\n\n final long startTimeMsec = System.currentTimeMillis();\n\n final String bundleId = request.params(\"bundleId\");\n final String workerVersion = request.params(\"workerVersion\");\n\n WorkerCategory workerCategory = new WorkerCategory(bundleId, workerVersion);\n String address = broker.getWorkerAddress(workerCategory);\n if (address == null) {\n Bundle bundle = null;\n // There are no workers that can handle this request. Request one and ask the UI to retry later.\n final String accessGroup = request.attribute(\"accessGroup\");\n final String userEmail = request.attribute(\"email\");\n WorkerTags workerTags = new WorkerTags(accessGroup, userEmail, \"anyProjectId\", bundle.regionId);\n broker.createOnDemandWorkerInCategory(workerCategory, workerTags);\n response.status(HttpStatus.ACCEPTED_202);\n response.header(\"Retry-After\", \"30\");\n response.body(\"Starting worker.\");\n return response;\n } else {\n // Workers exist in this category, clear out any record that we're waiting for one to start up.\n // FIXME the tracking of which workers are starting up should really be encapsulated using a \"start up if needed\" method.\n broker.recentlyRequestedWorkers.remove(workerCategory);\n }\n\n String workerUrl = \"http://\" + address + \":7080/single\"; // TODO remove hard-coded port number.\n LOG.info(\"Re-issuing HTTP request from UI to worker at {}\", workerUrl);\n\n\n HttpClient httpClient = HttpClient.newBuilder().build();\n HttpRequest httpRequest = HttpRequest.newBuilder()\n .GET()\n .uri(URI.create(workerUrl))\n .header(\"Accept-Encoding\", \"gzip\") // TODO Explore: is this unzipping and re-zipping the result from the worker?\n .build();\n try {\n response.status(0);\n // content-type response.header();\n return httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofInputStream());\n } catch (Exception exception) {\n response.status(HttpStatus.BAD_GATEWAY_502);\n response.body(ExceptionUtils.stackTraceString(exception));\n return response;\n } finally {\n\n }\n }", "JobResponse apply(Context context);", "private void sendRequest() throws IOException {\n\t\tHttpURLConnection urlConnection = getHttpURLConnection2(request.getServerUrl());\n\t\t\n\t\ttry {\n\t\t\tInputStream responseStream = null;\n\t final int serverResponseCode = urlConnection.getResponseCode();\n\t if (serverResponseCode / 100 == 2) {\n\t \tresponseStream = urlConnection.getInputStream();\n\t } else { // getErrorStream if the response code is not 2xx\n\t \tresponseStream = urlConnection.getErrorStream();\n\t }\n\t \n\t uploadLstener.onCompleted(uploadId, serverResponseCode, getResponseBodyAsString(responseStream));\n\t responseStream.close();\n\t\t} finally {\n\t\t\turlConnection.disconnect();\n\t\t}\n\t}", "public Object call() throws Exception {\n\t\t\t\t\t\tProducerSimpleNettyResponseFuture future;\n\t\t\t\t\t\tProducerSimpleNettyResponse responseFuture;\n\t\t\t\t\t\tfuture = clientProxy.request(message);\n\t\t\t\t\t\tresponseFuture = future\n\t\t\t\t\t\t\t\t.get(3000, TimeUnit.MILLISECONDS);\n\t\t\t\t\t\treturn responseFuture.getResponse();\n\t\t\t\t\t}", "public void process()\n {\n ClientRequest clientRequest = threadPool.remove();\n\n if (clientRequest == null)\n {\n return;\n }\n\n\n // Do the work\n // Create new Client\n ServiceLogger.LOGGER.info(\"Building client...\");\n Client client = ClientBuilder.newClient();\n client.register(JacksonFeature.class);\n\n // Get uri\n ServiceLogger.LOGGER.info(\"Getting URI...\");\n String URI = clientRequest.getURI();\n\n ServiceLogger.LOGGER.info(\"Getting endpoint...\");\n String endpointPath = clientRequest.getEndpoint();\n\n // Create WebTarget\n ServiceLogger.LOGGER.info(\"Building WebTarget...\");\n WebTarget webTarget = client.target(URI).path(endpointPath);\n\n // Send the request and save it to a Response\n ServiceLogger.LOGGER.info(\"Sending request...\");\n Response response = null;\n if (clientRequest.getHttpMethodType() == Constants.getRequest)\n {\n // Create InvocationBuilder\n ServiceLogger.LOGGER.info(\"Starting invocation builder...\");\n Map<String, Object> queryMap = clientRequest.getQueryParams();\n String pathParam = clientRequest.getPathParam();\n\n if (pathParam != null)\n {\n webTarget = webTarget.path(pathParam);\n }\n\n if (queryMap != null)\n {\n ServiceLogger.LOGGER.info(\"QUERY MAP NOT NULL.\");\n for (Map.Entry<String, Object> entry : queryMap.entrySet())\n {\n webTarget = webTarget.queryParam(entry.getKey(), entry.getValue());\n }\n }\n ServiceLogger.LOGGER.info(\"WEBTARGET: \" + webTarget.toString());\n\n Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n\n ServiceLogger.LOGGER.info(\"Got a GET request.\");\n response = invocationBuilder\n .header(\"email\", clientRequest.getEmail())\n .header(\"sessionID\", clientRequest.getSessionID())\n .header(\"transactionID\", clientRequest.getTransactionID())\n .get();\n }\n else if (clientRequest.getHttpMethodType() == Constants.postRequest)\n {\n // Create InvocationBuilder\n ServiceLogger.LOGGER.info(\"Starting invocation builder...\");\n Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n Map<String, Object> queryMap = clientRequest.getQueryParams();\n\n if (queryMap != null)\n {\n ServiceLogger.LOGGER.info(\"QUERY MAP NOT NULL.\");\n for (Map.Entry<String, Object> entry : queryMap.entrySet())\n {\n webTarget = webTarget.queryParam(entry.getKey(), entry.getValue());\n }\n }\n ServiceLogger.LOGGER.info(\"WEBTARGET: \" + webTarget.toString());\n\n ServiceLogger.LOGGER.info(\"Got a POST request.\");\n response = invocationBuilder\n .header(\"email\", clientRequest.getEmail())\n .header(\"sessionID\", clientRequest.getSessionID())\n .header(\"transactionID\", clientRequest.getTransactionID())\n .post(Entity.entity(clientRequest.getRequest(), MediaType.APPLICATION_JSON));\n }\n else if (clientRequest.getHttpMethodType() == Constants.deleteRequest)\n {\n String pathParam = clientRequest.getPathParam();\n if (pathParam != null)\n {\n webTarget = webTarget.path(pathParam);\n }\n Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n\n ServiceLogger.LOGGER.info(\"Got a DELETE request.\");\n response = invocationBuilder\n .header(\"email\", clientRequest.getEmail())\n .header(\"sessionID\", clientRequest.getSessionID())\n .header(\"transactionID\", clientRequest.getTransactionID())\n .delete();\n }\n else\n {\n ServiceLogger.LOGGER.warning(ANSI_YELLOW + \"Request was not sent successfully\");\n }\n ServiceLogger.LOGGER.info(ANSI_GREEN + \"Sent!\" + ANSI_RESET);\n\n // Check status code of request\n String jsonText = \"\";\n int httpstatus = response.getStatus();\n\n jsonText = response.readEntity(String.class);\n\n // Add response to database\n String email = clientRequest.getEmail();\n String sessionID = clientRequest.getSessionID();\n ResponseDatabase.insertResponseIntoDB(clientRequest.getTransactionID(), jsonText, email, sessionID, httpstatus);\n\n }", "@Override\n\tpublic Response call() throws Exception {\n\t\tClientResponse response = callWebService(this.spaceEntry);\n\t\tthis.transId = (int) response.getEntity(Integer.class);\n\t\tresponse.close();\n\t\t/*wait for web service to provide tuple Object result*/\n\t\tawaitResult();\n\t\t\n\t\t/*return result*/\n\t\treturn result;\n\t}", "@Api(1.1)\n public Response execute() throws HaloNetException {\n return mBuilder.mClient.request(mRequest);\n }", "@Override\n public void run() {\n super.run(); // obtain connection\n if (connection == null)\n return; // problem obtaining connection\n\n try {\n request_spec.context.setAttribute\n (ExecutionContext.HTTP_CONNECTION, connection);\n\n doOpenConnection();\n\n HttpRequest request = (HttpRequest) request_spec.context.\n getAttribute(ExecutionContext.HTTP_REQUEST);\n request_spec.executor.preProcess\n (request, request_spec.processor, request_spec.context);\n\n response = request_spec.executor.execute\n (request, connection, request_spec.context);\n\n request_spec.executor.postProcess\n (response, request_spec.processor, request_spec.context);\n\n doConsumeResponse();\n\n } catch (Exception ex) {\n if (exception != null)\n exception = ex;\n\n } finally {\n conn_manager.releaseConnection(connection, -1, null);\n }\n }", "CompletableFuture<RawContentResponse> executeSingleRequest(Request<?> request);", "@Override\n\tpublic void run() {\n\t\tRequestBody body = RequestBody.create(this.jsonType, this.contents);\n\t\tRequest request = new Request.Builder()\n\t\t\t.url(this.serverURL)\n\t\t\t.post(body)\n\t\t\t.build();\n\t\t\n\t\ttry {\n\t\t\tResponse response = client.newCall(request).execute();\n\t\t\tString str = response.body().string();\n\t\t\t//logger.log(Level.INFO, \n\t\t\t//\t\tString.format(\"DEBUG postCallInfoToServerTask succeed: %s\", str));\n\t\t} catch (IOException e) {\n\t\t\tNetProphetLogger.logError(\"PostCallInfoTask.run\", e.toString());\n\t\t}\n\t}", "public abstract List<C_result> processJob(C_request processing_cmd);", "public interface AsyncResponse {\n void processFinish(double calories, double date);\n}", "@Override\n\t\t\t\t\t\t public void run() {\n\t\t\t\t\t\t\t getResponse();\n\t\t\t\t\t\t }", "CompletableFuture<WebClientServiceResponse> whenComplete();", "private int sendJob(HttpURLConnection connection) {\n int responseCode = -1;\n String response = \"\";\n try {\n responseCode = connection.getResponseCode();\n\n if (responseCode == HttpURLConnection.HTTP_OK) {\n String line;\n StringBuilder buf = new StringBuilder();\n try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {\n while ((line = br.readLine()) != null) {\n buf.append(line);\n }\n }\n response = buf.toString();\n } else {\n response = \"\";\n }\n } catch (IOException e) {\n e.printStackTrace();\n Log.e(LOG_TAG, \"io exception\");\n }\n Log.i(LOG_TAG, response);\n return responseCode;\n }", "public interface AsyncResponse {\n\n void processFinish(String output);\n\n}", "JobResponse refresh();", "public interface AsyncResponse {\n void processFinish(String output);\n}", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tProxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(\n\t\t\t\t\t\t\"proxy.iiit.ac.in\", 8080));\n\t\t\t\tURL url = new URL(url1);\n\t\t\t\tHttpURLConnection connection = (HttpURLConnection) url\n\t\t\t\t\t\t.openConnection(proxy);\n\t\t\t\tconnection.setRequestMethod(\"POST\");\n\t\t\t\t// connection.setRequestProperty(\"Content-Type\",\n\t\t\t\t// \"application/x-www-form-urlencoded\");\n\n\t\t\t\tconnection.setRequestProperty(\"Content-Length\",\n\t\t\t\t\t\t\"\" + Integer.toString(parameters.getBytes().length));\n\t\t\t\tconnection.setRequestProperty(\"Content-Language\", \"en-US\");\n\n\t\t\t\tconnection.setUseCaches(false);\n\t\t\t\tconnection.setDoInput(true);\n\t\t\t\tconnection.setDoOutput(true);\n\n\t\t\t\t// Send request\n\t\t\t\tDataOutputStream wr = new DataOutputStream(\n\t\t\t\t\t\tconnection.getOutputStream());\n\t\t\t\twr.writeBytes(parameters);\n\t\t\t\twr.flush();\n\t\t\t\twr.close();\n\n\t\t\t\t// Get Response\n\t\t\t\tInputStream is = connection.getInputStream();\n\t\t\t\tBufferedReader rd = new BufferedReader(\n\t\t\t\t\t\tnew InputStreamReader(is));\n\t\t\t\tString line;\n\t\t\t\tStringBuffer response = new StringBuffer();\n\t\t\t\twhile ((line = rd.readLine()) != null) {\n\t\t\t\t\tresponse.append(line);\n\t\t\t\t\tresponse.append('\\r');\n\t\t\t\t}\n\t\t\t\trd.close();\n\t\t\t\t// return response.toString();\n\t\t\t\tlong tID = Thread.currentThread().getId();\n\t\t\t\tlong time = ManagementFactory.getThreadMXBean()\n\t\t\t\t\t\t.getThreadCpuTime(tID);\n\t\t\t\tSystem.out.println(\"My thread \" + tID + \" execution time: \"\n\t\t\t\t\t\t+ time + \" ns.\");\n\t\t\t\tsumTimes=sumTimes+time;\n\t\t\t\tconnection.disconnect();\n\t\t\t} catch (Exception e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t\t// return null;\n\n\t\t\t} finally {\n\n\t\t\t}\n\t\t}", "public interface AsyncResponse {\n void processFinish(HttpJson output);\n}", "RESPONSE_TYPE doSync(final RequestImpl _requestImpl) throws Exception;", "protected void awaitResult(){\t\n\t\ttry {\n\t\t\t/*place thread/tuple identifier in waitlist for future responses from web service*/\n\t\t\tResponses.getInstance().addToWaitList(this.transId, this);\n\t\t\tthis.latch.await();\n\t\t\t\n\t\t} catch (InterruptedException e) {\n\n\t\t\tLogger.getLogger(\"RSpace\").log(Level.WARNING, \"Transaction #\" + transId + \" response listener was terminated\");\n\t\t}\n\t}", "interface RequestExecution\n\t{\n\t\tvoid execute(AbstractResponseBuilder response);\n\t}", "JobResponse.Update update();", "@SuppressWarnings(\"unchecked\")\n public <T> T execute() {\n return (T) fetchResponse(getCallToExecute());\n }", "@Override\r\n\tpublic void run() {\n\t\ttry {\r\n\t\t\tObjectInputStream objectInput = new ObjectInputStream(\r\n\t\t\t\t\tclsock.getInputStream());\r\n\t\t\tObject object = objectInput.readObject();\r\n\t\t\ttask = (String) object;// reading URLs from client\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\tSystem.out.println(\"The task Batch has not come from the Client\");\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tString clientId = task.split(\",\")[0];\r\n\r\n\t\tRemoteScheduler remoteScheduler = new RemoteScheduler(clientId,\r\n\t\t\t\ttask);\r\n\t\tremoteScheduler.sendTaskToQueue();\r\n\t\tExecutorService remoteService = Executors.newFixedThreadPool(1);\r\n\t\ttry {\r\n\t\t\tFuture<String> remoteResult = remoteService\r\n\t\t\t\t\t.submit(remoteScheduler);\r\n\t\t\tString clientResult = remoteResult.get();\r\n\t\t\tObjectOutputStream outputStream = new ObjectOutputStream(\r\n\t\t\t\t\tclsock.getOutputStream());\r\n\t\t\toutputStream.writeObject(clientResult);\r\n\t\t\toutputStream.close();\r\n\t\t} catch (InterruptedException | ExecutionException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tclsock.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "JobResponse create();", "public interface AsyncResultsResponse {\n void processResult(ArrayList<HashMap<String, String>> resultList, int flag);\n}", "private synchronized String execute(final HttpUriRequest request) {\n request.setParams(params);\n\n // Set the request's headers\n for (Entry<String, String> header : headers.entrySet()) {\n request.setHeader(header.getKey(), header.getValue());\n }\n\n // Execute the request and get it's content\n HttpResponse response;\n String content;\n try {\n\n // Execute the request\n response = getClient().execute(request);\n\n // Get the response content\n content = EntityUtils.toString(response.getEntity(), charset);\n } catch (IOException e) {\n throw new JsogClientException(\"Get request failed.\", e);\n }\n\n // Check the response code\n StatusLine sl = response.getStatusLine();\n if (sl.getStatusCode() != 200) {\n throw new Non200ResponseCodeException(\n sl.getStatusCode(),\n sl.getReasonPhrase(),\n content);\n }\n\n return content;\n }", "CompletableFuture<Void> sendRequestOneWay(HttpRequest request);", "@Override\n protected boolean performTask() {\n Map<WebSocketChannel, ProcessRequest> requests = this.channelManager.getRequests(MessageType.PROCESS_REQUEST);\n if (requests.isEmpty()) {\n return false;\n }\n\n List<Request> l = requests.entrySet().stream()\n .map(e -> new Request(e.getKey(), e.getValue()))\n .collect(Collectors.toList());\n\n dispatch(l);\n\n return false;\n }", "public interface AsyncResponse {\n void processFinish(RoadInfo output);\n }", "@SuppressWarnings(\"unchecked\")\n\t\tpublic void run() {\n long throughputMeasurementStartTime = System.currentTimeMillis();\n\n byte[] reply;\n int reqId;\n int req = 0;\n\n Storage st = new Storage(nTXs);\n\n System.out.println(\"Executing experiment for \" + nTXs + \" ops\");\n\n for (int i = 0; i < nTXs; i++, req++) {\n long last_send_instant = System.nanoTime();\n if (dos) {\n reqId = proxy.generateRequestId((readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n proxy.TOMulticast(request, reqId, (readOnly) ? TOMMessageType.UNORDERED_REQUEST : TOMMessageType.ORDERED_REQUEST); \n\n } else {\n \tif(readOnly) {\n \t\treply = proxy.invokeUnordered(request);\n \t} else {\n \t\treply = proxy.invokeOrdered(request);\n \t}\n }\n st.store(System.nanoTime() - last_send_instant);\n\n if (timeout > 0) {\n //sleeps timeout ms before sending next request\n try {\n\t\t\t\t\t\tThread.sleep(timeout);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n } \n\n } \n writeReportJSON(throughputMeasurementStartTime, st); \n }", "public void requestDone(Request request, boolean isSuccessful);", "@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public com.onedrive.sdk.extensions.AsyncOperationStatus generateResult(com.onedrive.sdk.http.IHttpRequest r2, com.onedrive.sdk.http.IConnection r3, com.onedrive.sdk.serializer.ISerializer r4, com.onedrive.sdk.logger.ILogger r5) throws java.lang.Exception {\n /*\n r1 = this;\n int r2 = r3.getResponseCode()\n r0 = 303(0x12f, float:4.25E-43)\n if (r2 != r0) goto L_0x001e\n java.lang.String r2 = \"Item copy job has completed.\"\n r5.logDebug(r2)\n java.util.Map r2 = r3.getHeaders()\n java.lang.String r3 = \"Location\"\n java.lang.Object r2 = r2.get(r3)\n java.lang.String r2 = (java.lang.String) r2\n com.onedrive.sdk.extensions.AsyncOperationStatus r2 = com.onedrive.sdk.extensions.AsyncOperationStatus.createdCompleted(r2)\n return r2\n L_0x001e:\n r2 = 0\n java.io.BufferedInputStream r5 = new java.io.BufferedInputStream // Catch:{ all -> 0x0048 }\n java.io.InputStream r0 = r3.getInputStream() // Catch:{ all -> 0x0048 }\n r5.<init>(r0) // Catch:{ all -> 0x0048 }\n java.lang.String r2 = com.onedrive.sdk.http.DefaultHttpProvider.streamToString(r5) // Catch:{ all -> 0x0046 }\n java.lang.Class<com.onedrive.sdk.extensions.AsyncOperationStatus> r0 = com.onedrive.sdk.extensions.AsyncOperationStatus.class\n java.lang.Object r2 = r4.deserializeObject(r2, r0) // Catch:{ all -> 0x0046 }\n com.onedrive.sdk.extensions.AsyncOperationStatus r2 = (com.onedrive.sdk.extensions.AsyncOperationStatus) r2 // Catch:{ all -> 0x0046 }\n java.util.Map r3 = r3.getHeaders() // Catch:{ all -> 0x0046 }\n java.lang.String r4 = \"Location\"\n java.lang.Object r3 = r3.get(r4) // Catch:{ all -> 0x0046 }\n java.lang.String r3 = (java.lang.String) r3 // Catch:{ all -> 0x0046 }\n r2.seeOther = r3 // Catch:{ all -> 0x0046 }\n r5.close()\n return r2\n L_0x0046:\n r2 = move-exception\n goto L_0x004b\n L_0x0048:\n r3 = move-exception\n r5 = r2\n r2 = r3\n L_0x004b:\n if (r5 == 0) goto L_0x0050\n r5.close()\n L_0x0050:\n throw r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.onedrive.sdk.concurrency.AsyncMonitorResponseHandler.generateResult(com.onedrive.sdk.http.IHttpRequest, com.onedrive.sdk.http.IConnection, com.onedrive.sdk.serializer.ISerializer, com.onedrive.sdk.logger.ILogger):com.onedrive.sdk.extensions.AsyncOperationStatus\");\n }", "protected abstract ClassicHttpResponse execute(ClassicHttpRequest request, HttpClientContext context) throws IOException;", "public interface Request {\n\n /**\n * This method executes the request.\n * @return a responseEntity containing the reponse (status and body).\n */\n ResponseEntity execute();\n}", "boolean service(Request request, Response response) throws IOException;", "public void sendRRequests() {\n\n }", "public void run() {\n\t\t\t\tHttpURLConnection connection = null;\r\n\t\t\t\tStringBuilder response = new StringBuilder();\r\n\t\t\t\ttry{\r\n\t\t\t\t\tURL url = new URL(address);\r\n\t\t\t\t\tconnection = (HttpURLConnection) url.openConnection();\r\n\t\t\t\t\tconnection.setRequestMethod(\"GET\");\r\n\t\t\t\t\tconnection.setConnectTimeout(8000);\r\n\t\t\t\t\tconnection.setReadTimeout(8000);\r\n\t\t\t\t\tconnection.setDoInput(true);\r\n\t\t\t\t\t//connection.setDoOutput(true);\r\n\t\t\t\t\tint responseCode = connection.getResponseCode();\r\n\t\t\t\t\tLog.d(\"HttpUtil\", String.valueOf(responseCode));\r\n\t\t\t\t\tif(responseCode != 200){\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Get Fail\");\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tInputStream in = connection.getInputStream();\r\n\t\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\r\n\t\t\t\t\t\tString line;\r\n\t\t\t\t\t\twhile((line = reader.readLine()) != null){\r\n\t\t\t\t\t\t\tresponse.append(line);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Get Success\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onFinish(response.toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onError(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}finally{\r\n\t\t\t\t\tif(connection != null){\r\n\t\t\t\t\t\tconnection.disconnect();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n protected String doInBackground(String... params){\n\n try {\n //1. Create okHttp Client object\n OkHttpClient client = new OkHttpClient();\n\n Endpoint endpoint = new Endpoint();\n\n //2. Define request being sent to the server\n\n Request request = new Request.Builder()\n .url(endpoint.getUrl())\n .header(\"Connection\", \"close\")\n .build();\n\n //3. Transport the request and wait for response to process next\n Response response = client.newCall(request).execute();\n String result = response.body().string();\n setCode(response.code());\n return result;\n }\n catch(Exception e) {\n return null;\n }\n }", "private AylaCallResponse execute(int method, AylaRestService rs)\n\t{\n\n\t\trequestRetryCounter = 3;\n\t\tAylaCallResponse commitResponse = null;\n\t\tBundle responseBundle = null;\n\n if (!AylaReachability.isCloudServiceAvailable()) {\n if (AylaReachability.isDeviceLanModeAvailable(null) && supportsLanModeResponse(method)) {\n // We aren't connected to the cloud, but we are connected to the LAN mode device\n AylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"V\", \"ExecuteRequest\", \"lanMode\", method, \"execute\");\n } else if (!supportsOfflineResponse(method)) {\n // Make sure the method supports cached results if we cannot reach the service.\\\n // return failure here\n AylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"E\", \"ExecuteRequest\", \"!cloud && !supportOffline\", method, \"execute\");\n responseBundle = new Bundle();\n responseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n responseBundle.putInt(\"subTask\", rs.subTaskFailed);\n responseCode = AylaNetworks.AML_ERROR_UNREACHABLE;\n \n if (async) {\n receiver.send(responseCode, responseBundle);\n } else {\n commitResponse = new AylaCallResponse(responseCode, responseBundle);\n }\n return commitResponse;\n } else {\n AylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"V\", \"ExecuteRequest\", \"cached\", method, \"execute\");\n }\n }\n\n\t\tAylaCallResponse failureResponse = checkRequest(method, rs);\n\t\tif ( failureResponse != null ) {\n\t\t\treturn failureResponse;\n\t\t}\n\n\t\ttry{\n\t\t\tswitch(method)\n\t\t\t{\n\t\t\t\tcase AylaRestService.CREATE_GROUP_ZIGBEE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.UPDATE_GROUP_ZIGBEE:\n\t\t\t\tcase AylaRestService.TRIGGER_GROUP_ZIGBEE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.DELETE_GROUP_ZIGBEE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.CREATE_BINDING_ZIGBEE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs );\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.UPDATE_BINDING_ZIGBEE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.DELETE_BINDING_ZIGBEE:\n\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.CREATE_SCENE_ZIGBEE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.UPDATE_SCENE_ZIGBEE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.RECALL_SCENE_ZIGBEE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.DELETE_SCENE_ZIGBEE:\n\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.CREATE_USER_SHARE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.UPDATE_USER_SHARE:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcase AylaRestService.GET_USER_SHARE:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"GET\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.DELETE_USER_SHARE:\n\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\tcase AylaRestService.LOGIN_THROUGH_OAUTH :\t// Compound objects, no service API, just return to handler\n\t\t\t\t{\n\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.CREATE_USER_CONTACT:\n\t\t\t\t\tif (!AylaSystemUtils.ERR_URL.equals(url)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.UPDATE_USER_CONTACT:\n\t\t\t\t\tif (!AylaSystemUtils.ERR_URL.equals(url)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}// end of if error_url.equals(url)\n\n\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.DELETE_USER_CONTACT:\n\t\t\t\t\tif (!AylaSystemUtils.ERR_URL.equals(url)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.CREATE_USER_METADATA:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.UPDATE_USER_METADATA:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.GET_USER_METADATA_BY_KEY:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"GET\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.DELETE_USER_METADATA:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.CREATE_DEVICE_METADATA:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.UPDATE_DEVICE_METADATA:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.GET_DEVICE_METADATA_BY_KEY:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"GET\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.DELETE_DEVICE_METADATA:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.CREATE_LOG_IN_SERVICE:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.CREATE_SCHEDULE_ACTION:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.UPDATE_SCHEDULE_ACTION:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.DELETE_SCHEDULE_ACTION:\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t}\n\t\t\t\t\telse { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t//case AylaRestService.CREATE_SCHEDULE:\n\t\t\t\tcase AylaRestService.UPDATE_SCHEDULE:\n\t\t\t\tcase AylaRestService.CLEAR_SCHEDULE:\n\t\t\t\t\t//case AylaRestService.DELETE_SCHEDULE:\n\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase AylaRestService.CREATE_SCHEDULE_ACTIONS: // only called on (url.equals(AylaSystemUtils.ERR_URL)\n\t\t\t\tcase AylaRestService.DELETE_SCHEDULE_ACTIONS: // only called on (url.equals(AylaSystemUtils.ERR_URL)\n\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase AylaRestService.UPDATE_DEVICE:\n\t\t\t\t\tif(!url.equals(AylaSystemUtils.ERR_URL)){\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase AylaRestService.SEND_NETWORK_PROFILE_LANMODE:\n\t\t\t\tcase AylaRestService.DELETE_NETWORK_PROFILE_LANMODE:\n\n\t\t\t\tcase AylaRestService.GET_DEVICES_LANMODE:\n\t\t\t\tcase AylaRestService.GET_NODES_LOCAL_CACHE:\n\t\t\t\tcase AylaRestService.CREATE_DATAPOINT_LANMODE:\n\t\t\t\tcase AylaRestService.CREATE_NODE_DATAPOINT_LANMODE:\n\n\t\t\t\tcase AylaRestService.GET_DATAPOINT_LANMODE:\n\t\t\t\tcase AylaRestService.GET_DATAPOINTS_LANMODE:\n\t\t\t\tcase AylaRestService.GET_PROPERTIES_LANMODE:\n\t\t\t\tcase AylaRestService.GET_NODES_CONNECTION_STATUS_ZIGBEE_LANMODE:\n\n\t\t\t\tcase AylaRestService.GET_NODE_PROPERTIES_LANMODE:\n\t\t\t\tcase AylaRestService.GET_NODE_DATAPOINT_LANMODE:\n\n\t\t\t\tcase AylaRestService.GET_PROPERTY_DETAIL_LANMODE:\n\t\t\t\t{\n\t\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\t\t\tresponseCode = rs.responseCode;\n\n\t\t\t\t\tif (async) {\n\t\t\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.GET_DATAPOINT_BLOB_SAVE_TO_FILE:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\n\t\t\t\t\t\tsetUrlConnection(\"GET\", url, NETWORK_TIMEOUT_CLOUD, false);\n\t\t\t\t\t\t// For debug, reserved for future.\n//\t\t\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s, %s, %s, %s.\", \"D\", tag,\n//\t\t\t\t\t\t\t\t\"getDatapointBlobSaveToFile\"\n//\t\t\t\t\t\t\t\t, \"url:\" + urlConnection.getURL()\n//\t\t\t\t\t\t\t\t, \"method:\" + urlConnection.getRequestMethod()\n//\t\t\t\t\t\t\t\t, \"headers:\" + headers);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.GET_DEVICES:\n\t\t\t\tcase AylaRestService.GET_DEVICE_DETAIL:\n\t\t\t\tcase AylaRestService.GET_DEVICE_DETAIL_BY_DSN:\n\t\t\t\tcase AylaRestService.GET_NEW_DEVICE_CONNECTED:\n\t\t\t\tcase AylaRestService.GET_REGISTERED_NODES:\n\t\t\t\tcase AylaRestService.GET_DEVICE_NOTIFICATIONS:\n\t\t\t\tcase AylaRestService.GET_APP_NOTIFICATIONS:\n\t\t\t\tcase AylaRestService.GET_PROPERTIES:\n\t\t\t\tcase AylaRestService.GET_PROPERTY_DETAIL:\n\t\t\t\tcase AylaRestService.GET_DATAPOINTS:\n\t\t\t\tcase AylaRestService.GET_DATAPOINT_BY_ID:\n\n\t\t\t\tcase AylaRestService.GET_DATAPOINT_BLOB:\n\t\t\t\tcase AylaRestService.GET_PROPERTY_TRIGGERS:\n\t\t\t\tcase AylaRestService.GET_APPLICATION_TRIGGERS:\n\t\t\t\tcase AylaRestService.GET_REGISTRATION_CANDIDATE:\n\t\t\t\tcase AylaRestService.GET_GATEWAY_REGISTRATION_CANDIDATES:\n\n\t\t\t\tcase AylaRestService.GET_NEW_DEVICE_STATUS:\n\t\t\t\tcase AylaRestService.GET_NEW_DEVICE_SCAN_RESULTS_FOR_APS:\n\t\t\t\tcase AylaRestService.GET_MODULE_WIFI_STATUS:\n\t\t\t\tcase AylaRestService.GET_NEW_DEVICE_PROFILES:\n\t\t\t\tcase AylaRestService.GET_DEVICE_LANMODE_CONFIG:\n\t\t\t\tcase AylaRestService.GET_USER_INFO:\n\t\t\t\tcase AylaRestService.GET_SCHEDULES:\n\t\t\t\tcase AylaRestService.GET_SCHEDULE:\n\t\t\t\tcase AylaRestService.GET_SCHEDULE_ACTIONS:\n\t\t\t\tcase AylaRestService.GET_SCHEDULE_ACTIONS_BY_NAME:\n\t\t\t\tcase AylaRestService.GET_TIMEZONE:\n\t\t\t\tcase AylaRestService.GET_USER_METADATA:\n\t\t\t\tcase AylaRestService.GET_DEVICE_METADATA:\n\t\t\t\tcase AylaRestService.GET_USER_SHARES:\n\t\t\t\tcase AylaRestService.GET_USER_RECEIVED_SHARES:\n\t\t\t\tcase AylaRestService.GET_GROUP_ZIGBEE:\n\t\t\t\tcase AylaRestService.GET_GROUPS_ZIGBEE:\n\t\t\t\tcase AylaRestService.GET_BINDING_ZIGBEE:\n\t\t\t\tcase AylaRestService.GET_BINDINGS_ZIGBEE:\n\t\t\t\tcase AylaRestService.GET_SCENE_ZIGBEE:\n\t\t\t\tcase AylaRestService.GET_SCENES_ZIGBEE:\n\t\t\t\tcase AylaRestService.GET_NODES_CONNECTION_STATUS_ZIGBEE:\n\t\t\t\tcase AylaRestService.GET_USER_CONTACT:\n\t\t\t\tcase AylaRestService.GET_USER_CONTACT_LIST:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tString combinedParams = \"\";\n\n\t\t\t\t\t\tif(params!= null && !params.isEmpty()) {\n\t\t\t\t\t\t\tcombinedParams += \"?\";\n\t\t\t\t\t\t\tfor(AylaParcelableNVPair p : params) {\n\t\t\t\t\t\t\t\tif ( p.getName() != null && p.getValue() != null ) {\n\t\t\t\t\t\t\t\t\tString paramString = p.getName() + \"=\" + URLEncoder.encode(p.getValue(), \"UTF-8\");\n\t\t\t\t\t\t\t\t\tif (combinedParams.length() > 1) {\n\t\t\t\t\t\t\t\t\t\tcombinedParams += \"&\" + paramString;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tcombinedParams += paramString;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\turl+=combinedParams;\n\t\t\t\t\t\tsetUrlConnection(\"GET\", url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.GET_MODULE_REGISTRATION_TOKEN:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tString combinedParams = \"\";\n\n\t\t\t\t\t\tif(params!= null && !params.isEmpty()) {\n\t\t\t\t\t\t\tcombinedParams += \"?\";\n\t\t\t\t\t\t\tfor(AylaParcelableNVPair p : params) {\n\t\t\t\t\t\t\t\tif ( p.getName() != null && p.getValue() != null ) {\n\t\t\t\t\t\t\t\t\tString paramString = p.getName() + \"=\" + URLEncoder.encode(p.getValue(), \"UTF-8\");\n\t\t\t\t\t\t\t\t\tif (combinedParams.length() > 1) {\n\t\t\t\t\t\t\t\t\t\tcombinedParams += \"&\" + paramString;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tcombinedParams += paramString;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\turl+=combinedParams;\n\t\t\t\t\t\tsetUrlConnection(\"GET\", url, NETWORK_TIMEOUT_LAN);\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t} else { // return errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.POST_USER_LOGIN:\n\t\t\t\tcase AylaRestService.POST_USER_LOGOUT:\n\t\t\t\tcase AylaRestService.POST_USER_SIGNUP:\n\t\t\t\tcase AylaRestService.POST_USER_RESEND_CONFIRMATION:\n\t\t\t\tcase AylaRestService.POST_USER_RESET_PASSWORD:\n\t\t\t\tcase AylaRestService.POST_USER_REFRESH_ACCESS_TOKEN:\n\t\t\t\tcase AylaRestService.POST_USER_OAUTH_LOGIN:\n\t\t\t\tcase AylaRestService.POST_USER_OAUTH_AUTHENTICATE_TO_SERVICE:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\n\t\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else { // return user sign-up errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.CREATE_DATAPOINT_BLOB_POST_TO_FILE:\n\t\t\t\t{\n\t\t\t/* Interact with amazon S3\n\t\t\t * authorization mechanism and param already in url\n\t\t\t * do not need header.*/\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD, false);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return user sign-up errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.PUT_USER_CHANGE_PASSWORD:\n\t\t\t\tcase AylaRestService.PUT_RESET_PASSWORD_WITH_TOKEN:\n\t\t\t\tcase AylaRestService.PUT_USER_CHANGE_INFO:\n\t\t\t\tcase AylaRestService.PUT_USER_SIGNUP_CONFIRMATION:\n\t\t\t\tcase AylaRestService.UPDATE_PROPERTY_TRIGGER:\n\t\t\t\tcase AylaRestService.UPDATE_APPLICATION_TRIGGER:\n\t\t\t\tcase AylaRestService.UPDATE_DEVICE_NOTIFICATION:\n\t\t\t\tcase AylaRestService.UPDATE_APP_NOTIFICATION:\n\t\t\t\tcase AylaRestService.PUT_DEVICE_FACTORY_RESET:\n\t\t\t\tcase AylaRestService.BLOB_MARK_FETCHED:\n\t\t\t\tcase AylaRestService.BLOB_MARK_FINISHED:\n\t\t\t\tcase AylaRestService.IDENTIFY_NODE:\n\t\t\t\tcase AylaRestService.UPDATE_USER_EMAIL:\n case AylaRestService.PUT_DISCONNECT_AP_MODE:\n\t\t\t\t{\n\t\t\t\t\tif (!url.equals(AylaSystemUtils.ERR_URL)) {\n\t\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\t\twriteData();\n\t\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\t} else { // return user sign-up errors to handler\n\t\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.CREATE_DATAPOINT:\n\t\t\t\tcase AylaRestService.CREATE_BATCH_DATAPOINT:\n\t\t\t\tcase AylaRestService.CREATE_DATAPOINT_BLOB:\n\t\t\t\tcase AylaRestService.CREATE_PROPERTY_TRIGGER:\n\t\t\t\tcase AylaRestService.CREATE_APPLICATION_TRIGGER:\n\t\t\t\tcase AylaRestService.START_NEW_DEVICE_SCAN_FOR_APS:\n\t\t\t\tcase AylaRestService.REGISTER_DEVICE:\n\t\t\t\t\t//\tcase AylaRestService.SET_DEVICE_CONNECT_TO_NETWORK:\n\t\t\t\tcase AylaRestService.POST_LOCAL_REGISTRATION:\n\t\t\t\tcase AylaRestService.OPEN_REGISTRATION_WINDOW:\n\t\t\t\tcase AylaRestService.CREATE_TIMEZONE:\n\t\t\t\tcase AylaRestService.CREATE_DEVICE_NOTIFICATION:\n\t\t\t\tcase AylaRestService.CREATE_APP_NOTIFICATION:\n\t\t\t\t{\n\t\t\t\t\tsetUrlConnection(\"POST\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\twriteData();\n\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase AylaRestService.SET_DEVICE_CONNECT_TO_NETWORK:\n\t\t\t\t{\n\t\t\t\t\t// request = new HttpPost(url);\n\n\t\t\t\t\tString urlQueryParams = \"\";\n\t\t\t\t\tif (!params.isEmpty()) {\n\t\t\t\t\t\turlQueryParams += \"?\";\n\t\t\t\t\t\tfor (AylaParcelableNVPair p : params) {\n\t\t\t\t\t\t\tString paramString = p.getName() + \"=\" + URLEncoder.encode(p.getValue(), \"UTF-8\");\n\t\t\t\t\t\t\tif (urlQueryParams.length() > 1) {\n\t\t\t\t\t\t\t\turlQueryParams += \"&\" + paramString;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\turlQueryParams += paramString;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\turl = rs.url + urlQueryParams;\n\t\t\t\t\t//request = new HttpPost(url);\n\n\t\t\t\t\tsetUrlConnection(\"POST\", url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\twriteData();\n\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase AylaRestService.PUT_LOCAL_REGISTRATION:\n\t\t\t\tcase AylaRestService.PUT_NEW_DEVICE_TIME:\n\t\t\t\tcase AylaRestService.PUT_DATAPOINT: // used to mark blob fetched\n\t\t\t\tcase AylaRestService.UPDATE_TIMEZONE:\n\t\t\t\t{\n\t\t\t\t\tsetUrlConnection(\"PUT\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\twriteData();\n\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase AylaRestService.DELETE:\n\t\t\t\tcase AylaRestService.DESTROY_DEVICE_NOTIFICATION:\n\t\t\t\tcase AylaRestService.DESTROY_APP_NOTIFICATION:\n\t\t\t\tcase AylaRestService.DESTROY_PROPERTY_TRIGGER:\n\t\t\t\tcase AylaRestService.DESTROY_APPLICATION_TRIGGER:\n\t\t\t\tcase AylaRestService.UNREGISTER_DEVICE:\n\t\t\t\tcase AylaRestService.DELETE_DEVICE_WIFI_PROFILE:\n\t\t\t\tcase AylaRestService.DELETE_USER:\n\t\t\t\t{\n\t\t\t\t\tsetUrlConnection(\"DELETE\", rs.url, NETWORK_TIMEOUT_CLOUD);\n\t\t\t\t\tcommitResponse = commit(rs);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t//\t\tcase AylaRestService.SECURE_SETUP_SESSION_COMPLETED:\n\t\t\t\tcase AylaRestService.PROPERTY_CHANGE_NOTIFIER:\n\t\t\t\t{\n\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.REACHABILITY:\n\t\t\t\t{\n\t\t\t\t\tsendToReceiver(rs);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.REGISTER_NEW_DEVICE:\t\t\t// Compound objects, no service API, just return to handler\n\t\t\t\t{\n\t\t\t\t\t// wait for completion if it's a synchronous call\n\t\t\t\t\tif (async == false) {\n\t\t\t\t\t\twhile (rs.jsonResults == null) {\n\t\t\t\t\t\t\ttry { //NOP\n\t\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\t\t\tresponseCode = rs.responseCode;\n\t\t\t\t\tif (async) {\n\t\t\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.CONNECT_TO_NEW_DEVICE: // Compound objects no service API, just return to handler\n\t\t\t\tcase AylaRestService.RETURN_HOST_WIFI_STATE: // Using host local calls, no service API, just return to handler\n\t\t\t\tcase AylaRestService.RETURN_HOST_SCAN:\n\t\t\t\tcase AylaRestService.RETURN_HOST_NETWORK_CONNECTION:\n\t\t\t\tcase AylaRestService.SET_HOST_NETWORK_CONNECTION:\n\t\t\t\tcase AylaRestService.DELETE_HOST_NETWORK_CONNECTION:\n\t\t\t\tcase AylaRestService.DELETE_HOST_NETWORK_CONNECTIONS:\n\t\t\t\tcase AylaRestService.RETURN_HOST_DNS_CHECK:\n\t\t\t\tcase AylaRestService.GROUP_ACK_ZIGBEE:\n\t\t\t\tcase AylaRestService.BINDING_ACK_ZIGBEE:\n\t\t\t\tcase AylaRestService.SCENE_ACK_ZIGBEE:\n\t\t\t\tcase AylaRestService.GET_NODES_CONNECTION_STATUS:\n\t\t\t\t{\n\t\t\t\t\t// wait for completion if it's a synchronous call\n\t\t\t\t\tif (async == false) {\n\t\t\t\t\t\twhile (rs.jsonResults == null) {\n\t\t\t\t\t\t\ttry { //NOP\n\t\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\t\t\tresponseCode = rs.responseCode;\n\t\t\t\t\tif (async) {\n\n\t\t\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AylaRestService.CONNECT_NEW_DEVICE_TO_SERVICE:\n\t\t\t\tcase AylaRestService.CONFIRM_NEW_DEVICE_TO_SERVICE_CONNECTION: // Compound object\n\t\t\t\tcase AylaRestService.GET_NEW_DEVICE_WIFI_STATUS: // compound object\n\t\t\t\tcase AylaRestService.GET_NODES_CONNECTION_STATUS_LANMODE:\n\t\t\t\t{\n\t\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\t\t\tresponseCode = rs.responseCode;\n\n\t\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s, %s.\", \"E\", tag, \"execute\", \"method \" + method + \" unknown\");\n\t\t\t\t\tbreak;\n\t}\n\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tcloseResources();\n\t\t\tresponseBundle = new Bundle();\n\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\tresponseCode = rs.responseCode;\n\t\t\tif (async) {\n\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t} else {\n\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t}\n\t\t} finally{\n\t\t\tcloseResources();\n\t\t}\n\t\treturn commitResponse;\n\t}", "public Response execute(final NetworkHelper networkHelper)\n\t\t\tthrows IOException {\n\t\tnetworkHelper.connListener.onRequest(this);\n\t\tHttpURLConnection urlConnection;\n\t\tif (proxy != null) urlConnection = networkHelper.openConnection(url,\n\t\t\t\tproxy);\n\t\telse\n\t\t\turlConnection = networkHelper.openConnection(url);\n\t\turlConnection.setRequestMethod(method.name());\n\t\turlConnection.setConnectTimeout(connectTimeout > -1 ? connectTimeout\n\t\t\t\t: networkHelper.defaultConnectTimeout);\n\t\turlConnection.setReadTimeout(readTimeout > -1 ? readTimeout\n\t\t\t\t: networkHelper.defaultReadTimout);\n\n\t\tif (!cookies.isEmpty()) CookieManager\n\t\t\t\t.setCookies(urlConnection, cookies);\n\t\tif (useCookies) networkHelper.cookieManager.setupCookies(urlConnection);\n\n\t\turlConnection.setInstanceFollowRedirects(followRedirects);\n\n\t\tMap<String, String> headers = new HashMap<String, String>(\n\t\t\t\tnetworkHelper.defaultHeaderMap);\n\t\theaders.putAll(headerMap);\n\t\tsetupHeaders(urlConnection, headers);\n\n\t\tswitch (method) {\n\t\tcase POST:\n\t\tcase PUT:\n\t\t\tif (urlConnection.getRequestProperty(\"Content-Type\") == null) {\n\t\t\t\turlConnection.setRequestProperty(\"Content-Type\",\n\t\t\t\t\t\t\"application/x-www-form-urlencoded\");\n\t\t\t}\n\t\t\tif (payload == null) break;\n\t\t\turlConnection.setDoOutput(true);\n\t\t\turlConnection.setFixedLengthStreamingMode(payload.length);\n\t\t\tfinal OutputStream output = urlConnection.getOutputStream();\n\t\t\toutput.write(payload);\n\t\t\toutput.close();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\tInputStream inputStream = null;\n\t\ttry {\n\t\t\tfinal URL url = urlConnection.getURL();\n\t\t\tnetworkHelper.log.info(\"Request {}:{}://{}{}\", method,\n\t\t\t\t\turl.getProtocol(), url.getAuthority(), url.getPath());\n\t\t\turlConnection.connect();\n\t\t\tinputStream = NetworkHelper.getInputStream(urlConnection);\n\t\t\tnetworkHelper.log.info(\"Response {}\",\n\t\t\t\t\turlConnection.getResponseMessage());\n\t\t} catch (final IOException e) {\n\t\t\tfinal int statusCode = urlConnection.getResponseCode();\n\t\t\tif (!ignoreErrorChecks && statusCode >= 400) {\n\t\t\t\tnetworkHelper.log.info(\"Response {}\",\n\t\t\t\t\t\turlConnection.getResponseMessage());\n\t\t\t\tinputStream = NetworkHelper.getErrorStream(urlConnection);\n\t\t\t} else\n\t\t\t\tthrow e;\n\t\t} finally {\n\t\t\tif (useCookies) networkHelper.cookieManager\n\t\t\t\t\t.putCookieList(CookieManager.getCookies(urlConnection));\n\t\t\tnetworkHelper.connListener.onFinish(url, urlConnection);\n\t\t}\n\n\t\treturn getResponse(urlConnection, inputStream);\n\n\t}", "public void run() {\n\t\t\t\tHttpURLConnection connection = null;\r\n\r\n\t\t\t\tPrintWriter printWriter = null;\r\n\t\t\t\tBufferedReader bufferedReader = null;\r\n\r\n\t\t\t\tStringBuffer response = new StringBuffer();\r\n\t\t\t\tStringBuffer request = new StringBuffer();\r\n\r\n\t\t\t\t// 组织请求参数\r\n\t\t\t\tif (null != params && !params.isEmpty()){\r\n\t\t\t\t\tfor (Map.Entry<String, String> entry : params.entrySet()){\r\n\t\t\t\t\t\trequest.append(entry.getKey()).append(\"=\").append(entry.getValue()).append(\"&\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//< 删除多余的&\r\n\t\t\t\t\trequest.deleteCharAt(request.length() - 1);\r\n\t\t\t\t}\r\n\t\t\t\tLog.d(\"HttpUtil\", request.toString());\r\n\r\n\t\t\t\ttry{\r\n\t\t\t\t\tURL url = new URL(address);\r\n\t\t\t\t\tconnection = (HttpURLConnection) url.openConnection();\r\n\t\t\t\t\tconnection.setRequestMethod(\"POST\");\r\n\t\t\t\t\tconnection.setRequestProperty(\"Content-Length\", String.valueOf(request.length()));\r\n\t\t\t\t\tconnection.setDoInput(true);\r\n\t\t\t\t\tconnection.setDoOutput(true);\r\n\t\t\t\t\tprintWriter = new PrintWriter(connection.getOutputStream());\r\n\t\t\t\t\tprintWriter.write(request.toString());\r\n\t\t\t\t\tprintWriter.flush();\r\n\r\n\t\t\t\t\tint responseCode = connection.getResponseCode();\r\n\t\t\t\t\tif(responseCode != 200){\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Post Fail\");\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Post Success\");\r\n\t\t\t\t\t\tbufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()));\r\n\t\t\t\t\t\tString line;\r\n\t\t\t\t\t\twhile ((line = bufferedReader.readLine()) != null) {\r\n\t\t\t\t\t\t\tresponse.append(line);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onFinish(response.toString());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onError(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}finally{\r\n\t\t\t\t\tif(connection != null){\r\n\t\t\t\t\t\tconnection.disconnect();\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tif (printWriter != null) {\r\n\t\t\t\t\t\t\tprintWriter.close();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (bufferedReader != null) {\r\n\t\t\t\t\t\t\tbufferedReader.close();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "Single<WebClientServiceResponse> whenComplete();", "Single<WebClientServiceResponse> whenComplete();", "public abstract HTTPResponse finish();", "java.util.concurrent.Future<GetJobRunResult> getJobRunAsync(GetJobRunRequest getJobRunRequest);", "@Override\n public V call() throws HttpRequestException {\n boolean bl = false;\n try {\n V v = this.run();\n return v;\n }\n catch (HttpRequestException httpRequestException) {\n bl = true;\n throw httpRequestException;\n }\n catch (IOException iOException) {\n bl = true;\n throw new HttpRequestException(iOException);\n }\n finally {\n this.done();\n }\n }", "@Override\n\tpublic ResponseEntity<String> handle(PiazzaJobType jobRequest) throws InterruptedException {\n\t\tlogger.log(\"Executing a Service.\", Severity.DEBUG);\n\n\t\tExecuteServiceJob job = (ExecuteServiceJob) jobRequest;\n\t\t// Check to see if this is a valid request\n\t\tif (job != null) {\n\t\t\t// Get the ResourceMetadata\n\t\t\tExecuteServiceData esData = job.data;\n\t\t\tResponseEntity<String> handleResult = handle(esData);\n\t\t\tResponseEntity<String> result = new ResponseEntity<>(handleResult.getBody(), handleResult.getStatusCode());\n\t\t\tlogger.log(\"The result is \" + result, Severity.DEBUG);\n\n\t\t\t// TODO Use the result, send a message with the resource Id and jobId\n\t\t\treturn result;\n\t\t} else {\n\t\t\tlogger.log(\"Job is null\", Severity.ERROR);\n\t\t\treturn new ResponseEntity<>(\"Job is null\", HttpStatus.BAD_REQUEST);\n\t\t}\n\t}", "private void doRequest() {\n\n try {\n JsonObject request = new JsonObject()\n .put(\"action\", Math.random() < 0.5 ? \"w\" : \"r\")\n .put(\"timeOfRequest\", System.currentTimeMillis());\n\n if (request.getString(\"action\") == \"w\") {\n request.put(\"data\", new JsonObject()\n .put(\"key\", \"value\")\n );\n logger.debug(\"requesting write: \" + request.toString());\n eb.send(\"storage-write-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n } else {\n Random random = new Random();\n List<String> keys = new ArrayList<String>(map.keySet());\n String randomKey = keys.get(random.nextInt(keys.size()));\n request.put(\"id\", randomKey);\n logger.debug(\"waiting for read: \" + request.toString());\n eb.send(\"storage-read-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n }\n } catch (Exception e) {\n logger.warn(\"Error\");\n makeRequest();\n }\n\n }", "private RawHttpResponse<?> executeRequest(String method, String path) throws IOException {\r\n\t\tSocket socket = new Socket(\"localhost\", 8080);\r\n\t\treturn executeRequest(method, path, \"\", socket);\r\n\t}", "private Response execute_work(Request request){\n if (request.getFname().equals(\"tellmenow\")){\n int returnValue = tellMeNow();\n }\n else if(request.getFname().equals(\"countPrimes\")){\n int returnValue = countPrimes(request.getArgs()[0]);\n }\n else if(request.getFname().equals(\"418Oracle\")){\n int returnValue = oracle418();\n }\n else{\n System.out.println(\"[Worker\"+String.valueOf(this.id)+\"] WARNING function name not recognized, dropping request\");\n }\n\n return new Response(id,request.getId(),request.getFname(),0);//0 meaning ok!\n }", "public RequestResponse run() {\n try (Socket client = new Socket(ip, port)) {\n System.out.println(\"Connected to server.\");\n OutputStream out = client.getOutputStream();\n ObjectOutputStream writer = new ObjectOutputStream(out);\n writer.writeObject(request);\n System.out.println(\"REQUEST Sent . \");\n InputStream in = client.getInputStream();\n ObjectInputStream reader = new ObjectInputStream(in);\n Thread.sleep(2000);\n requestResponse=(RequestResponse) reader.readObject();\n System.out.println(\"RESPONSE RECEIVED .\");\n client.close();\n } catch (IOException | ClassNotFoundException | InterruptedException ex) {\n ex.printStackTrace();\n }\n System.out.println(\"CLIENT \" + \" has done its job .\");\n return requestResponse;\n }", "void execute(SlingHttpServletRequest request, SlingHttpServletResponse response, boolean writeAllowed) throws ServletException {\n String path = request.getResource().getResourceType().equals(RESOURCE_TYPE) ? request.getParameter(PARAM_PATH) : request.getResource().getPath();\n try {\n if (StringUtils.isBlank(path)) {\n throw new IllegalArgumentException(\"path should be provided\");\n }\n Map<String, Object> bindings = plumber.getBindingsFromRequest(request, writeAllowed);\n String asyncParam = request.getParameter(PARAM_ASYNC);\n if (StringUtils.isNotBlank(asyncParam) && asyncParam.equals(Boolean.TRUE.toString())){\n Job job = plumber.executeAsync(request.getResourceResolver(), path, bindings);\n if (job != null){\n response.getWriter().append(\"pipe execution registered as \" + job.getId());\n response.setStatus(HttpServletResponse.SC_CREATED);\n } else {\n response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, \"Some issue with your request, or server not being ready for async execution\");\n }\n } else {\n OutputWriter writer = getWriter(request, response);\n plumber.execute(request.getResourceResolver(), path, bindings, writer, true);\n }\n }\n catch (AccessControlException e) {\n response.setStatus(HttpServletResponse.SC_FORBIDDEN);\n }\n catch (Exception e) {\n throw new ServletException(e);\n }\n }", "public interface AsynchResponse {\n\n void processFinish(String output);\n}", "String execute(HttpServletRequest req, HttpServletResponse res);", "public void request() {\n }", "protected final ClientHttpResponse executeInternal(HttpHeaders headers, byte[] bufferedOutput)\r\n/* 39: */ throws IOException\r\n/* 40: */ {\r\n/* 41:65 */ RequestExecution requestExecution = new RequestExecution(null);\r\n/* 42: */ \r\n/* 43:67 */ return requestExecution.execute(this, bufferedOutput);\r\n/* 44: */ }", "private StreamObserver<JobResultsRequestWrapper> getJobResultsRequestWrapperStreamObserver(CoordinationProtos.NodeEndpoint foreman,\n ResponseSender sender,\n String queryId) {\n final JobResultsServiceGrpc.JobResultsServiceStub stub = getJobResultsServiceStub(foreman, queryId);\n Pointer<StreamObserver<JobResultsRequestWrapper>> streamObserverInternal = new Pointer<>();\n\n Context.current().fork().run( () -> {\n MethodDescriptor<JobResultsRequestWrapper, JobResultsResponse> jobResultsMethod =\n JobResultsRequestUtils.getJobResultsMethod(allocator);\n\n ClientCall<JobResultsRequestWrapper, JobResultsResponse> clientCall =\n stub.getChannel().newCall(jobResultsMethod, stub.getCallOptions());\n\n streamObserverInternal.value = ClientCalls.asyncBidiStreamingCall(clientCall,\n getResponseObserver(foreman, sender, queryId));\n });\n return streamObserverInternal.value;\n }", "@Override\n public void processResult(HttpResponseMessage response) {\n }", "@Override\n public String call() throws Exception {\n if (!iAmSpecial) {\n blocker.await();\n }\n ran = true;\n return result;\n }", "public interface EPAsyncResponseListener {\n public void getJokesfromEndpoint(String result);\n}", "@Override\r\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\t\r\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tProxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(\n\t\t\t\t\t\t\"proxy.iiit.ac.in\", 8080));\n\t\t\t\tURL url = new URL(url1);\n\t\t\t\tHttpURLConnection conn = (HttpURLConnection) url\n\t\t\t\t\t\t.openConnection(proxy);\n\t\t\t\tconn.setRequestMethod(\"GET\");\n\t\t\t\tconn.setRequestProperty(\"Accept\", \"application/json\");\n\n\t\t//\t\tif (conn.getResponseCode() != 200) {\n\t\t\t//\t\tthrow new RuntimeException(\"Failed : HTTP error code : \"\n\t\t\t//\t\t\t\t+ conn.getResponseCode());\n\t\t\t//\t}\n\n\t\t\t\t/*\n\t\t\t\t * BufferedReader br = new BufferedReader(new InputStreamReader(\n\t\t\t\t * (conn.getInputStream())));\n\t\t\t\t * \n\t\t\t\t * String output;\n\t\t\t\t * System.out.println(\"Output from Server .... \\n\"); while\n\t\t\t\t * ((output = br.readLine()) != null) {\n\t\t\t\t * System.out.println(output); }\n\t\t\t\t */\n\t\t\t\tlong tID = Thread.currentThread().getId();\n\t\t\t\tlong time = ManagementFactory.getThreadMXBean()\n\t\t\t\t\t\t.getThreadCpuTime(tID);\n\t\t\t\tSystem.out.println(\"My thread \" + tID + \" execution time: \"\n\t\t\t\t\t\t+ time + \" ns.\");\n\t\t\t\tsumTimes=sumTimes+time;\n\t\t\t\tconn.disconnect();\n\n\t\t\t} catch (MalformedURLException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t} catch (Exception e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}\n\n\t\t\t// long end_time = System.currentTimeMillis();\n\n\t\t\t// long difference = end_time-start_time;\n\t\t\t// System.out.println(\"Complete in \"+difference+\" ms.\");\n\t\t}", "@Override\n\t\t\tpublic Boolean execute() throws EvrythngException {\n\t\t\t\tHttpClient client = new DefaultHttpClient();\n\t\t\t\ttry {\n\t\t\t\t\t// Execute request (response status code will be automatically checked):\n\t\t\t\t\treturn command.execute(client) != null;\n\t\t\t\t} finally {\n\t\t\t\t\tcommand.shutdown(client);\n\t\t\t\t}\n\t\t\t}", "public Response callback() throws Exception;", "public interface ResponseHandlerInterface {\n\n /**\n * Returns data whether request completed successfully\n *\n * @param response HttpResponse object with data\n * @throws java.io.IOException if retrieving data from response fails\n */\n void sendResponseMessage(HttpResponse response) throws IOException;\n\n /**\n * Notifies callback, that request started execution\n */\n void sendStartMessage();\n\n /**\n * Notifies callback, that request was completed and is being removed from thread pool\n */\n void sendFinishMessage();\n\n /**\n * Notifies callback, that request (mainly uploading) has progressed\n *\n * @param bytesWritten number of written bytes\n * @param bytesTotal number of total bytes to be written\n */\n void sendProgressMessage(int bytesWritten, int bytesTotal);\n\n /**\n * Notifies callback, that request was cancelled\n */\n void sendCancelMessage();\n\n /**\n * Notifies callback, that request was handled successfully\n *\n * @param statusCode HTTP status code\n * @param headers returned headers\n * @param responseBody returned data\n */\n void sendSuccessMessage(int statusCode, Header[] headers, byte[] responseBody);\n\n /**\n * Returns if request was completed with error code or failure of implementation\n *\n * @param statusCode returned HTTP status code\n * @param headers returned headers\n * @param responseBody returned data\n * @param error cause of request failure\n */\n void sendFailureMessage(int statusCode, Header[] headers, byte[] responseBody, Throwable error);\n\n /**\n * Notifies callback of retrying request\n *\n * @param retryNo number of retry within one request\n */\n void sendRetryMessage(int retryNo);\n\n /**\n * Returns URI which was used to request\n *\n * @return uri of origin request\n */\n public URI getRequestURI();\n\n /**\n * Returns Header[] which were used to request\n *\n * @return headers from origin request\n */\n public Header[] getRequestHeaders();\n\n /**\n * Helper for handlers to receive Request URI info\n *\n * @param requestURI claimed request URI\n */\n public void setRequestURI(URI requestURI);\n\n /**\n * Helper for handlers to receive Request Header[] info\n *\n * @param requestHeaders Headers, claimed to be from original request\n */\n public void setRequestHeaders(Header[] requestHeaders);\n\n /**\n * Can set, whether the handler should be asynchronous or synchronous\n *\n * @param useSynchronousMode whether data should be handled on background Thread on UI Thread\n */\n void setUseSynchronousMode(boolean useSynchronousMode);\n\n /**\n * Returns whether the handler is asynchronous or synchronous\n *\n * @return boolean if the ResponseHandler is running in synchronous mode\n */\n boolean getUseSynchronousMode();\n}", "protected HttpResponse executeRequest(RPCRequest invocation) throws Exception {\n\t\treturn getHttpInvokerRequestExecutor().executeRequest(getServiceUrl(), invocation);\n\t}", "@Override\n\t\tpublic void asyncRequestSuccess(long id, Object response)\n\t\t\t\tthrows ConnectorException {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic Object request(Invocation invocation) throws Exception {\n\t\tRpcRequest req=new RpcRequest();\r\n\t\treq.setId(UUID.randomUUID().toString());\r\n\t\treq.setArgs(invocation.getAgrs());\r\n\t\treq.setMethod(invocation.getMethod().getName());\r\n\t\treq.setParameterTypes(invocation.getMethod().getParameterTypes());\r\n\t\treq.setType(invocation.getInterface());\r\n\t\treq.setAsyn(invocation.isAsyn());\r\n\t\tCompletableFuture<Object> result=new CompletableFuture<>();\r\n\t\tclientPool.borrowObject().request(req,result);\r\n\t\tif(invocation.isAsyn()){\r\n\t\t\treturn result;\r\n\t\t}else{\r\n\t\t\treturn result.get();\r\n\t\t}\r\n\r\n\r\n\t}", "abstract void request() throws IOException;", "R request();", "void execute(HttpServletRequest request, HttpServletResponse response)\n throws Exception;", "@Override\n public Void run() throws Exception {\n Callable<Job> jobCreator = ReflectionUtils.newInstance(jobConfig.getJobCreator(), jobConfiguration);\n Job job = jobCreator.call();\n job.submit();\n\n // Blocking mode is only for testing\n if(waitForCompletition) {\n job.waitForCompletion(true);\n }\n\n // And generate event with further job details\n EventRecord event = getContext().createEventRecord(\"job-created\", 1);\n Map<String, Field> eventMap = ImmutableMap.of(\n \"tracking-url\", Field.create(job.getTrackingURL()),\n \"job-id\", Field.create(job.getJobID().toString())\n );\n event.set(Field.create(eventMap));\n getContext().toEvent(event);\n return null;\n }", "protected WebClientServiceResponse doProceed(WebClientServiceRequest serviceRequest, HttpClientResponse response) {\n this.responseHeaders = response.headers();\n this.responseStatus = response.status();\n\n WebClientServiceResponse.Builder builder = WebClientServiceResponse.builder();\n if (response.entity().hasEntity()) {\n builder.inputStream(response.inputStream());\n }\n return builder\n .serviceRequest(serviceRequest)\n .whenComplete(whenComplete)\n .status(response.status())\n .headers(response.headers())\n .connection(new Http2CallEntityChain.Http1ResponseResource(response))\n .build();\n }", "private Result performRequest(String endpointUrl, List<NameValuePair> nameValuePairs) {\n Status status = Status.FAILED_UNRECOVERABLE;\n String response = null;\n try {\n // the while(retries) loop is a workaround for a bug in some Android HttpURLConnection\n // libraries- The underlying library will attempt to reuse stale connections,\n // meaning the second (or every other) attempt to connect fails with an EOFException.\n // Apparently this nasty retry logic is the current state of the workaround art.\n int retries = 0;\n boolean succeeded = false;\n while (retries < 3 && !succeeded) {\n InputStream in = null;\n BufferedInputStream bin = null;\n OutputStream out = null;\n BufferedOutputStream bout = null;\n HttpURLConnection connection = null;\n\n try {\n final URL url = new URL(endpointUrl);\n connection = (HttpURLConnection) url.openConnection();\n if (null != nameValuePairs) {\n connection.setDoOutput(true);\n final UrlEncodedFormEntity form = new UrlEncodedFormEntity(nameValuePairs, \"UTF-8\");\n connection.setRequestMethod(\"POST\");\n connection.setFixedLengthStreamingMode((int)form.getContentLength());\n out = connection.getOutputStream();\n bout = new BufferedOutputStream(out);\n form.writeTo(bout);\n bout.close();\n bout = null;\n out.close();\n out = null;\n }\n in = connection.getInputStream();\n bin = new BufferedInputStream(in);\n response = StringUtils.inputStreamToString(in);\n bin.close();\n bin = null;\n in.close();\n in = null;\n succeeded = true;\n } catch (final EOFException e) {\n if (MPConfig.DEBUG) Log.d(LOGTAG, \"Failure to connect, likely caused by a known issue with Android lib. Retrying.\");\n retries = retries + 1;\n } finally {\n if (null != bout)\n try { bout.close(); } catch (final IOException e) { ; }\n if (null != out)\n try { out.close(); } catch (final IOException e) { ; }\n if (null != bin)\n try { bin.close(); } catch (final IOException e) { ; }\n if (null != in)\n try { in.close(); } catch (final IOException e) { ; }\n if (null != connection)\n connection.disconnect();\n }\n }// while\n } catch (final MalformedURLException e) {\n Log.e(LOGTAG, \"Cannot iterpret \" + endpointUrl + \" as a URL\", e);\n status = Status.FAILED_UNRECOVERABLE;\n } catch (final IOException e) {\n if (MPConfig.DEBUG) Log.d(LOGTAG, \"Cannot post message to Mixpanel Servers (ok, can retry.)\");\n status = Status.FAILED_RECOVERABLE;\n } catch (final OutOfMemoryError e) {\n Log.e(LOGTAG, \"Cannot post message to Mixpanel Servers, will not retry.\", e);\n status = Status.FAILED_UNRECOVERABLE;\n }\n\n if (null != response) {\n status = Status.SUCCEEDED;\n if (MPConfig.DEBUG) Log.d(LOGTAG, \"Request returned:\\n\" + response);\n }\n\n return new Result(status, response);\n }", "@Override\r\n\tpublic String call() throws Exception {\n\t\tSystem.out.println(\"开始query\");\r\n\t\tThread.sleep(2000);\r\n\t\tString result = this.query + \"处理结束\";\r\n\t\treturn result;\r\n\t}", "@Override\n public void callSync() {\n\n }", "private String getResultByUrl(String url) {\r\n\r\n\t\tRequestConfig.Builder requestBuilder = RequestConfig.custom();\r\n\t\trequestBuilder = requestBuilder.setConnectTimeout(75000);\r\n\t\trequestBuilder = requestBuilder.setConnectionRequestTimeout(75000);\r\n\t\trequestBuilder.setSocketTimeout(75000);\r\n\r\n\t\tHttpClientBuilder builder = HttpClientBuilder.create();\r\n\t\tbuilder.setDefaultRequestConfig(requestBuilder.build());\r\n\t\tclient = builder.build();\r\n\r\n\t\trequest = new HttpGet(url);\r\n\t\trequest.addHeader(\"Accept\", \"application/json\");\r\n\r\n\t\tHttpResponse response = null;\r\n\t\tString r = \"\";\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < 7; i++) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"Sending request: \" + url);\r\n\t\t\t\t\tresponse = client.execute(request);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (ConnectionPoolTimeoutException e) {\r\n\t\t\t\t\tSystem.out.println(\"Connection timeout. Trying again...\");\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tTimeUnit.SECONDS.sleep(10);\r\n\t\t\t\t\t} catch (InterruptedException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Response Code : \"\r\n\t\t\t\t\t+ response.getStatusLine().getStatusCode());\r\n\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(response.getEntity()\r\n\t\t\t\t\t.getContent()));\r\n\r\n\t\t\tStringBuffer result = new StringBuffer();\r\n\t\t\tString line = \"\";\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tresult.append(line);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(result + \"\\n\");\r\n\t\t\ttry {\r\n\t\t\t\tTimeUnit.SECONDS.sleep(1);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tr = result.toString();\r\n\t\t\tGson gson = new GsonBuilder().setPrettyPrinting().create();\r\n\r\n\t\t\tJsonObject jsonResult = gson.fromJson(result.toString(),\r\n\t\t\t\t\tJsonObject.class);\r\n\t\t\tif (jsonResult.get(\"backoff\") != null) {\r\n\t\t\t\tint backoff = (jsonResult.get(\"backoff\")).getAsInt();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"Received backoff. Waiting for \"\r\n\t\t\t\t\t\t\t+ backoff + \"seconds...\");\r\n\t\t\t\t\tTimeUnit.SECONDS.sleep(backoff + 5);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn r;\r\n\t}", "JobResponse refresh(Context context);", "@Override\n public void sendResultToOutput(JobTask jobTask, JobTaskResult jobTaskResult) {\n\n }", "public String execute(){\r\n\t\t\r\n\t\tString resultHtml = null;\r\n\t\tdebug(1,\"jsrpc start...\"+screenName+\" \"+rpcid); \r\n\t\tHashMap hm = jsrpcProcessBL(screenName);\r\n\t\tJSONObject jobj = new JSONObject(hm);\r\n\t\tresultHtml = jobj.toString();\r\n\t\tdebug(1,\"json result:\"+resultHtml);\r\n\t\tinputStream = new StringBufferInputStream(resultHtml);\r\n\t\treturn SUCCESS;\r\n\t}", "public abstract String getResponse();", "private void maybeOnSucceededOnExecutor() {\n synchronized (mNativeStreamLock) {\n if (isDoneLocked()) {\n return;\n }\n if (!(mWriteState == State.WRITING_DONE && mReadState == State.READING_DONE)) {\n return;\n }\n mReadState = mWriteState = State.SUCCESS;\n // Destroy native stream first, so UrlRequestContext could be shut\n // down from the listener.\n destroyNativeStreamLocked(false);\n }\n try {\n mCallback.onSucceeded(CronetBidirectionalStream.this, mResponseInfo);\n } catch (Exception e) {\n Log.e(CronetUrlRequestContext.LOG_TAG, \"Exception in onSucceeded method\", e);\n }\n mInflightDoneCallbackCount.decrement();\n }", "public String call() throws Exception {\n LOG.info(\"Starting to process task\");\n Thread.sleep(5000);\n LOG.info(\"Task is now done\");\n return \"Camel rocks\";\n }", "public String call() throws Exception {\n LOG.info(\"Starting to process task\");\n Thread.sleep(5000);\n LOG.info(\"Task is now done\");\n return \"Camel rocks\";\n }", "void onServiceSuccess(MasterResponse masterResponse, int taskCode);", "@Override\n public void run() {\n handleClientRequest();\n }", "public interface AsyncResponce {\n\n /// Cette classe permet de realiser une callback dans une Async Task en overidant cette classe\n void ComputeResult(Object result);\n}", "private synchronized void startProcessing() throws IOException {\n\n if (privateInput == null) {\n privateInput = new PrivateInputStream(this);\n }\n boolean more = true;\n\n if (isGet) {\n if (!isDone) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x03);\n }\n\n if (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n parent.sendRequest(0x83, null, replyHeaders, privateInput);\n }\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n }\n } else {\n\n if (!isDone) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x02);\n\n }\n }\n\n if (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n parent.sendRequest(0x82, null, replyHeaders, privateInput);\n }\n\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n }\n }", "@Override\n public void execute() {\n Task<Void> task = new Task<Void>() {\n @Override\n protected Void call() throws Exception {\n exportData();\n return null;\n }\n\n @Override\n protected void succeeded(){\n callback.onSuccess();\n super.succeeded();\n }\n\n @Override\n protected void failed(){\n callback.onFail(this.getException());\n super.failed();\n }\n };\n new Thread(task).start();\n }", "public void run() {\n req.response().end(\"0\"); // Default response = 0\n }", "@Override\n\tpublic void execute() {\n\t\tsuper.execute();\n\n\t\t// TBD Needs rewrite for multi tenant\n\t\ttry {\t\n\t\t\tif (async == null || !async)\n\t\t\t\tupdated = Crosstalk.getInstance().refresh(customer);\n\t\t\telse {\n\t\t\t\tfinal Long id = random.nextLong();\n\t\t\t\tfinal ApiCommand theCommand = this;\n\t\t\t\tThread thread = new Thread(new Runnable() {\n\t\t\t\t @Override\n\t\t\t\t public void run(){\n\t\t\t\t \ttry {\n\t\t\t\t\t\t\tupdated = Crosstalk.getInstance().refresh(customer);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\terror = true;\n\t\t\t\t\t\t\tmessage = e.toString();\n\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t});\n\t\t\t\tthread.start();\n\t\t\t\tasyncid = \"\" + id;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}" ]
[ "0.67672485", "0.66923016", "0.6448357", "0.6355778", "0.63354486", "0.6292546", "0.62463236", "0.6238822", "0.6234964", "0.62222266", "0.6100803", "0.60879904", "0.60739547", "0.6029415", "0.60183555", "0.5994023", "0.5927785", "0.5922658", "0.5918867", "0.59157974", "0.5897145", "0.587626", "0.5854937", "0.58549213", "0.580624", "0.57965225", "0.57936805", "0.5785025", "0.5778835", "0.5764797", "0.57549024", "0.5744563", "0.57443833", "0.57382643", "0.5735174", "0.57292163", "0.57278496", "0.57259285", "0.57155204", "0.5713226", "0.56908476", "0.56525755", "0.564906", "0.56356925", "0.56251395", "0.5623788", "0.5620416", "0.56141096", "0.5613262", "0.5611861", "0.56100315", "0.5599831", "0.5599831", "0.55987173", "0.559198", "0.5588725", "0.55881053", "0.5586951", "0.5574003", "0.5567012", "0.5559145", "0.55591345", "0.55469567", "0.5546141", "0.5545157", "0.55438226", "0.5541984", "0.55384254", "0.55378497", "0.5537824", "0.55347145", "0.5519273", "0.5512662", "0.5510169", "0.55009353", "0.55008376", "0.5487985", "0.5486897", "0.5483978", "0.5483733", "0.54828256", "0.5479825", "0.54757404", "0.54736626", "0.5473165", "0.5472072", "0.5468755", "0.5465451", "0.54642355", "0.5463077", "0.5462414", "0.54572517", "0.5455227", "0.5455227", "0.5451023", "0.54503983", "0.54431003", "0.5441505", "0.54389024", "0.54323864", "0.5426913" ]
0.0
-1
Override of RegistrySharedObject.sendCallRequest. This is called when RegistrySharedObject.callSynch is called (i.e. when an IRemoteService proxy or IRemoteService.callSync is called.
protected Request sendCallRequest(RemoteServiceRegistrationImpl remoteRegistration, final IRemoteCall call) throws IOException { Request request = new Request(this.getLocalContainerID(), remoteRegistration.getServiceId(), RemoteCallImpl.createRemoteCall(null, call.getMethod(), call.getParameters(), call.getTimeout()), null); requests.add(request); try { //Get a temporary queue that this client will listen for responses Destination tempDest = container.getResponseQueue(); MessageConsumer responseConsumer = container.getSession().createConsumer(tempDest); //This class will handle the messages to the temp queue as well responseConsumer.setMessageListener(responseHandler); // Create the request message and set the object (the Request itself) ObjectMessage objMessage = container.getSession().createObjectMessage(); objMessage.setObject(request); //Set the reply to field to the temp queue you created above, this is the queue the server //will respond to objMessage.setJMSReplyTo(tempDest); //Set a correlation ID so when you get a response you know which sent message the response is for objMessage.setJMSCorrelationID(request.getRequestContainerID().getName() + "-" + request.getRequestId()); //$NON-NLS-1$ container.getMessageProducer().send(objMessage); } catch (JMSException e) { log("sendCallRequest request=" + request, e); //$NON-NLS-1$ } return request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object sendRpcRequest(RpcRequest rpcRequest);", "void sendRequest(String invocationId, HttpRequest request);", "@Override\n public void callSync() {\n\n }", "public void writeSysCall() {\n clientChannel.write(writeBuffer, this, writeCompletionHandler);\n }", "@Override\n public void onCallInformationRequestRequest(CallInformationRequestRequest arg0) {\n\n }", "@Override\r\n\tpublic void callMethod(MethodDescriptor method, RpcController controller, Message request, Message responsePrototype, RpcCallback<Message> done) {\n\t\t\r\n\t}", "@DSSink({DSSinkKind.SYNCHRONIZATION_DATA})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.550 -0500\", hash_original_method = \"EEAA69B320108852E46A6304535CC9F5\", hash_generated_method = \"D642B9F06D082255CC2F6570E4A84B40\")\n \npublic Message sendMessageSynchronously(int what, int arg1, int arg2, Object obj) {\n Message msg = Message.obtain();\n msg.what = what;\n msg.arg1 = arg1;\n msg.arg2 = arg2;\n msg.obj = obj;\n Message resultMsg = sendMessageSynchronously(msg);\n return resultMsg;\n }", "@Override\n\tpublic void sendRequest( boolean fUseCache, boolean fInvalidate, RequestDesc request, Object cookie, XRPCRequest callback )\n\t{\n\t\tif( fInvalidate )\n\t\t{\n\t\t\t//GWT.log( \"CACHE-CLEAR for request \" + request.getUniqueKey() + \" / \" + request.getExtraInfo() );\n\t\t\tcache.clear();\n\t\t}\n\n\t\tRequestCallInfo requestCallInfo = new RequestCallInfo( request, callback, cookie );\n\t\trequestStack.add( requestCallInfo );\n\n\t\tif( fUseCache )\n\t\t{\n\t\t\t//GWT.log( \"CACHE-STATE for request \" + request.getUniqueKey() + \" / \" + request.getExtraInfo() + \" size:\" + cache.size() + \" hasResponse:\" + cache.containsKey( request.getUniqueKey() ) );\n\n\t\t\t// is the result already in cache ?\n\t\t\tResponseJSO cached = cache.get( request.getUniqueKey() );\n\t\t\tif( cached != null )\n\t\t\t{\n\t\t\t\trequestCallInfo.setResult( 0, null, null, cached );\n\t\t\t\tcheckAnswersToGive();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// is the same request already pending ?\n\t\t\tfor( PendingRequestInfo pending : pendingRequests )\n\t\t\t{\n\t\t\t\tif( !pending.requestKey.equals( request.getUniqueKey() ) )\n\t\t\t\t\tcontinue;\n\n\t\t\t\tpending.addSubscription( requestCallInfo );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// create a pending request\n\t\tPendingRequestInfo pending = new PendingRequestInfo( fUseCache && (!fInvalidate), requestCallInfo );\n\t\tpendingRequests.add( pending );\n\n\t\t// send the request to the server\n\t\tsrv.sendRequest( request, pending, this );\n\t}", "public void responseSent(DesktopCtrl desktopCtrl, String channel, String reqId, Object resInfo);", "public static native void send( String cmd );", "@Override\n public byte[] callMethod(String methodName, byte[] requestData) throws RemoteException\n {\n final ServiceData<? extends Writer> serviceData = serviceImpl.callMethod(methodName, requestData, null);\n return serviceData.getByteArray();\n }", "private boolean sendRequest() {\n\t\tclSyncNTPMessage _mess = new clSyncNTPMessage();\n\t\t_mess.setOriginateDate(new Date().getTime());\n\t\t\n\t\treturn sendToServer(_mess);\n\t}", "void send() {\n if (mInFlight == this) {\n // This was probably queued up and sent during a sync runnable of the last callback.\n // Don't queue it again.\n return;\n }\n if (mInFlight != null) {\n throw new IllegalStateException(\"Sync Transactions must be serialized. In Flight: \"\n + mInFlight.mId + \" - \" + mInFlight.mWCT);\n }\n mInFlight = this;\n if (DEBUG) Slog.d(TAG, \"Sending sync transaction: \" + mWCT);\n if (mLegacyTransition != null) {\n mId = new WindowOrganizer().startLegacyTransition(mLegacyTransition.getType(),\n mLegacyTransition.getAdapter(), this, mWCT);\n } else {\n mId = new WindowOrganizer().applySyncTransaction(mWCT, this);\n }\n if (DEBUG) Slog.d(TAG, \" Sent sync transaction. Got id=\" + mId);\n mMainExecutor.executeDelayed(mOnReplyTimeout, REPLY_TIMEOUT);\n }", "@DSSink({DSSinkKind.SYNCHRONIZATION_DATA})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.552 -0500\", hash_original_method = \"35A5E39A8A1820326BDEA32FA9EDD100\", hash_generated_method = \"CE016FA9F8D335C8879BF83223FA7CD6\")\n \npublic Message sendMessageSynchronously(int what, Object obj) {\n Message msg = Message.obtain();\n msg.what = what;\n msg.obj = obj;\n Message resultMsg = sendMessageSynchronously(msg);\n return resultMsg;\n }", "@DSSink({DSSinkKind.SYNCHRONIZATION_DATA})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.548 -0500\", hash_original_method = \"AFDADB0B0E37C71FB8D4BE31CA39F990\", hash_generated_method = \"B6827FF2C6A650BBE4692173D7372E8C\")\n \npublic Message sendMessageSynchronously(int what, int arg1, int arg2) {\n Message msg = Message.obtain();\n msg.what = what;\n msg.arg1 = arg1;\n msg.arg2 = arg2;\n Message resultMsg = sendMessageSynchronously(msg);\n return resultMsg;\n }", "@DSSink({DSSinkKind.SYNCHRONIZATION_DATA})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.546 -0500\", hash_original_method = \"69DA3E1B323882B9D4B744C6E35751A3\", hash_generated_method = \"60004DC4003AFFE42822995754840E35\")\n \npublic Message sendMessageSynchronously(int what, int arg1) {\n Message msg = Message.obtain();\n msg.what = what;\n msg.arg1 = arg1;\n Message resultMsg = sendMessageSynchronously(msg);\n return resultMsg;\n }", "@Override\n public void onCallInformationReportRequest(CallInformationReportRequest arg0) {\n\n }", "private void sendBinderCallToCarService(Parcel data, int callNumber) {\n IBinder carService;\r\n synchronized (mLock) {\r\n carService = mCarService;\r\n }\r\n try {\r\n carService.transact(IBinder.FIRST_CALL_TRANSACTION + callNumber,\r\n data, null, Binder.FLAG_ONEWAY);\r\n } catch (RemoteException e) {\r\n Slog.w(TAG, \"RemoteException from car service\", e);\r\n handleCarServiceCrash();\r\n } finally {\r\n data.recycle();\r\n }\r\n }", "public com.google.common.util.concurrent.ListenableFuture<lnrpc.Rpc.SendResponse> sendPaymentSync(\n lnrpc.Rpc.SendRequest request) {\n return futureUnaryCall(\n getChannel().newCall(getSendPaymentSyncMethod(), getCallOptions()), request);\n }", "@Override\n\tpublic InReply sendRequest(final ModuleUniqueId target, final Message msg) {\n\t\treturn eventDispatcher.sendRequest(target, msg);\n\t}", "public void makeCall() {\n\n }", "RESPONSE_TYPE doSync(final RequestImpl _requestImpl) throws Exception;", "@DSSink({DSSinkKind.SYNCHRONIZATION_DATA})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.544 -0500\", hash_original_method = \"42BD69B2114459AD691B3AEBDAE73546\", hash_generated_method = \"C285A4D23EAB85D82915D70E1F66F84C\")\n \npublic Message sendMessageSynchronously(int what) {\n Message msg = Message.obtain();\n msg.what = what;\n Message resultMsg = sendMessageSynchronously(msg);\n return resultMsg;\n }", "public boolean sendRequest(com.webobjects.appserver.WORequest request){\n return false; //TODO codavaj!!\n }", "public static void asyncSend(XxlRpcRequest xxlRpcRequest, String address,\n Class<? extends ConnectClient> connectClientImpl,\n final XxlRpcReferenceBean xxlRpcReferenceBean) throws Exception {\n\n // client pool\t[tips03 : may save 35ms/100invoke if move it to constructor, but it is necessary. cause by ConcurrentHashMap.get]\n ConnectClient clientPool = ConnectClient.getPool(address, connectClientImpl, xxlRpcReferenceBean);\n\n try {\n // do invoke\n clientPool.send(xxlRpcRequest);\n } catch (Exception e) {\n throw e;\n }\n\n }", "@Override\n\tpublic IResponse sendCommand(ICommand command) throws RPCException {\n\t\treturn null;\n\t}", "IfaceSpecial getCallSpecial(IfaceProgramPoint pt,IfaceMethod fm);", "private void doRemoteCall() {\n\n // Create the intent used to identify the bound service\n final Intent remoteBoundIntent = new Intent(this, MyRemoteBoundService.class);\n\n // Lets get a reference to it (asynchronously, hence the ServiceConnection object)\n bindService(remoteBoundIntent, new ServiceConnection() {\n @Override\n public void onServiceConnected(ComponentName name, IBinder service) {\n\n try {\n // Let's call it!\n (MyBoundServiceContract.Stub.asInterface(service)).doSomething(10);\n // We're done. Free the reference to the service\n unbindService(this);\n\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onServiceDisconnected(ComponentName name) {\n // Called upon unbind, just in case we need some cleanup\n }\n }, Context.BIND_AUTO_CREATE);\n }", "public void SetInboundCall(XMSCall in){\n FunctionLogger logger=new FunctionLogger(\"SetInboundCall\",this,myLogger);\n logger.args(in);\n myInboundCall = in;\n myInboundCall.EnableAllEvents(this);\n }", "public void sendRRequests() {\n\n }", "<T> T sendRequestAndAwaitReply(String objectId, String operationName, Type typeOfReturnValue, String accessToken, Object... argument);", "@Override\r\n\tpublic ResponseMessage performService(Scope cSScope)\r\n\t{\r\n\t\t//implemented in ChatRequest on C# server side;\r\n\t\t/*\r\n\t\t * Send back a response confirming that we got the request \r\n\t\t */\r\n\t\treturn OkResponse.reusableInstance;\r\n\t}", "@Override\n\tpublic void receiveCall(Call call) {\n\t\tthis.call = call;\n\t\tcall.attend();\n\t}", "public abstract void execute(String correlationId, ServiceRegistration sr, ServiceInput input);", "protected HttpResponse executeRequest(RPCRequest invocation) throws Exception {\n\t\treturn getHttpInvokerRequestExecutor().executeRequest(getServiceUrl(), invocation);\n\t}", "protected byte[] send(byte[] cmd) throws CommunicationException {\n return send(cmd, true);\n }", "public static void sendReq(SocketChannel socketChannel, Operation op)\n {\n try\n {\n Utils.sendObject(socketChannel,op);\n }\n catch(NullPointerException npe)\n {\n System.err.println(\"Connection not yet open\");\n }\n catch(ClosedChannelException e)\n {\n System.err.println(\"Closed TCP Socket\");\n }\n catch(IOException ioe)\n {\n System.err.println(\"Error sending operation \" + op.getCode());\n ioe.printStackTrace();\n }\n\n }", "public int sendRequest(ChannelSession chnl, com.thomsonreuters.upa.transport.Error error)\n {\n if (!hasSymbolListCapability(capabilities()))\n {\n error.text(\"SYMBOL_LIST domain is not supported by the indicated provider\");\n return CodecReturnCodes.FAILURE;\n }\n\n /* get a buffer for the item request */\n TransportBuffer msgBuf = chnl.getTransportBuffer(TRANSPORT_BUFFER_SIZE_REQUEST, false, error);\n if (msgBuf == null)\n {\n return CodecReturnCodes.FAILURE;\n }\n\n /* initialize state management array */\n /* these will be updated as refresh and status messages are received */\n state.dataState(DataStates.NO_CHANGE);\n state.streamState(StreamStates.UNSPECIFIED);\n\n /* encode symbol list request */\n symbolListRequest.clear();\n\n if (!snapshotRequested)\n symbolListRequest.applyStreaming();\n symbolListRequest.symbolListName().data(symbolListName.data(), symbolListName.position(), symbolListName.length());\n symbolListRequest.streamId(SYMBOL_LIST_STREAM_ID_START);\n symbolListRequest.serviceId(serviceId());\n symbolListRequest.applyHasServiceId();\n symbolListRequest.qos().dynamic(qos.isDynamic());\n symbolListRequest.qos().rate(qos.rate());\n symbolListRequest.qos().timeliness(qos.timeliness());\n symbolListRequest.applyHasQos();\n symbolListRequest.priority(1, 1);\n\n encIter.clear();\n encIter.setBufferAndRWFVersion(msgBuf, chnl.channel().majorVersion(), chnl.channel().minorVersion());\n\n System.out.println(symbolListRequest.toString());\n int ret = symbolListRequest.encode(encIter);\n if (ret != CodecReturnCodes.SUCCESS)\n {\n return ret;\n }\n\n return chnl.write(msgBuf, error);\n }", "public void sendCommand(Command cmd);", "void sendRequest(IRequest request)\n throws ConnectionFailedException;", "protected byte[] send(byte[] cmd, boolean waitForResponse) throws CommunicationException {\n try {\n out.write(cmd);\n log.info(\"Send: {} bytes | {} | {}\", cmd.length, BytesUtils.bytesToHex(cmd, ' '), new String(cmd));\n if (waitForResponse) {\n return receive();\n } else {\n return new byte[0];\n }\n } catch (IOException e) {\n throw new CommunicationException(\"Sending error\", e);\n }\n }", "public void dispatchCall(Call call) {\n\t\t/*\n\t\t * Try to route call to an employee with minimal rank\n\t\t */\n\t\tEmployee emp = getHandlerForCall(call);\n\t\tif(emp != null) {\n\t\t\temp.receiveCall(call);\n\t\t\tcall.setHandler(emp);\n\t\t}else {\n\t\t\t/*\n\t\t\t * Place the call into corresponding call\n\t\t\t * queue according to it's rank\n\t\t\t */\n\t\t\tcall.reply(\"Please wait for free employee to reply\");\n\t\t\tcallQueues.get(call.getRank().getValue()).add(call);\n\t\t}\n\t}", "public lnrpc.Rpc.SendResponse sendPaymentSync(lnrpc.Rpc.SendRequest request) {\n return blockingUnaryCall(\n getChannel(), getSendPaymentSyncMethod(), getCallOptions(), request);\n }", "@Override\n\tpublic void send(IMessage sending) throws RPCException {\n\t\t\n\t}", "Call(int id, final BlockingService service, final MethodDescriptor md, RequestHeader header,\n Message param, CellScanner cellScanner, Connection connection, long size, TraceInfo tinfo,\n final InetAddress remoteAddress) {\n super(id, service, md, header, param, cellScanner, connection, size, tinfo, remoteAddress);\n }", "public void sendResponse(ResponseNetObject response){\r\n\r\n sendObject(response);\r\n\r\n }", "@Override\n\tpublic Object invoke(Object proxy, Method method, Object[] args) throws UnknownHostException, IOException, ClassNotFoundException {\n\t\tSocket sock = new Socket(IP_adr, Port);\n\t\tCommunicationModule cm = new CommunicationModule();\n\n\t\tTranSegment seg = new TranSegment(Obj_Key, method.getName(), args);\n\n\t\tboolean s = cm.SendObj(sock, seg);\n\t\tif (s) {\n\t\t\t//Get the invoking result returned from server end\n\t\t\tObject result = cm.RecObj(sock);\n\t\t\treturn result;\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public void onCallGapRequest(CallGapRequest ind) {\n\n }", "public void setCallName(String callName) {\n\n\t}", "final protected void callActivated( String callId ) {\n callActivated( getNativeObject(), callId );\n }", "private static void doCallAction(\n final Call call,\n final CallAction callAction)\n {\n new Thread()\n {\n public void run()\n {\n try\n {\n List<Call> calls;\n CallGroup group = call.getCallGroup();\n if(group != null)\n {\n calls = group.getCalls();\n }\n else\n {\n calls = new Vector<Call>();\n calls.add(call);\n }\n Call tmpCall;\n Iterator<? extends CallPeer> callPeers;\n CallPeer callPeer;\n\n for(int i = 0; i < calls.size(); ++i)\n {\n tmpCall = calls.get(i);\n final OperationSetBasicTelephony<?> opSet =\n tmpCall.getProtocolProvider()\n .getOperationSet(OperationSetBasicTelephony.class);\n callPeers = tmpCall.getCallPeers();\n while(callPeers.hasNext())\n {\n callPeer = callPeers.next();\n switch(callAction)\n {\n case ANSWER:\n if(callPeer.getState() ==\n CallPeerState.INCOMING_CALL)\n {\n opSet.answerCallPeer(callPeer);\n }\n break;\n case HANGUP:\n opSet.hangupCallPeer(callPeer);\n break;\n }\n }\n }\n\n }\n catch(OperationFailedException e)\n {\n logger.info(\n \"Failed to answer/hangup call via global shortcut\",\n e);\n }\n }\n }.start();\n\n\n }", "public Call createCall(QName arg0, String arg1) throws ServiceException {\n\t\treturn null;\n\t}", "@Override\n\tpublic void call() {\n\t\t\n\t}", "public JSONObject requestSync(RequestType operation_code, JSONObject json_data)\r\n\t\t\tthrows GenericSyncException {\r\n\t\tJSONObject json_request = new JSONObject(), json_response = null, composed_json_request, decomposed_json_response = null;\r\n\t\ttry {\r\n\t\t\tjson_request.put(\"operation_code\", operation_code.toString());\r\n\t\t\tjson_request.put(\"data\", json_data);\r\n\t\t\t// NR: create Json composer for composing & DeComposing the Json\r\n\t\t\t// request and response.\r\n\t\t\tDataRequestComposer sync_request_composer = new DataRequestComposer();\r\n\t\t\tcomposed_json_request = sync_request_composer.compose(json_request);\r\n\r\n\t\t\tApplication.logInfo(\"SyncProxy\",\"Data Ready for Sync: \" + composed_json_request.toString());\r\n\t\t\t//NR: create object of Request proxy & fire request\r\n\t\t\tRequestProxy sync_request = new RequestProxy(operation_code);\r\n\t\t\tjson_response = sync_request.send(composed_json_request);\r\n\t\t\t//NR: Decompose the response recieved\r\n\t\t\tdecomposed_json_response = sync_request_composer\r\n\t\t\t\t\t.deCompose(json_response);\r\n\t\t} catch (CommunicationException e) {\r\n\t\t\tthrow (new GenericSyncException(e.toString()));\r\n\t\t} catch (InvalidCompositionException e) {\r\n\t\t\tthrow (new GenericSyncException(e.toString()));\r\n\t\t} catch (JSONException e) {\r\n\t\t\tthrow (new GenericSyncException(e.toString()));\r\n\t\t}\r\n\t\treturn decomposed_json_response;\r\n\t}", "public Call createCall(QName arg0, QName arg1) throws ServiceException {\n\t\treturn null;\n\t}", "public Call createCall() throws ServiceException {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic int call(Runnable thread_base, String strMsg) {\n\t\treturn 0;\r\n\t}", "@Override\n public void onSendChargingInformationRequest(SendChargingInformationRequest arg0) {\n\n }", "public void doCall(){\n CalculatorPayload operation = newContent();\n\n ((PBFTClient)getProtocol()).syncCall(operation);\n }", "public abstract void call();", "public Call createCall(QName arg0) throws ServiceException {\n\t\treturn null;\n\t}", "public abstract void push(SDGNode call);", "public int sendRequest(String request, String hostAddr, int port)\n\t{\n\t\t\n\t}", "public boolean inCall();", "JsonElement invokeRpc(String name, JsonObject rpcInput);", "protected HttpResponse executeRequest(\n\t\t\tRPCRequest invocation, MethodInvocation originalInvocation) throws Exception {\n\t\treturn executeRequest(invocation);\n\t}", "public void logCall( PeerInfo client, PeerInfo server, String signature, Message request, Message response, String errorMessage, int correlationId, long requestTS, long responseTS );", "private void start(final Object channel, final StartRequest request,\n final CallMetadata data) {\n String statusInfo = null;\n final String contextId = request.getContext();\n final String requestId = request.getRequestId();\n LOGGER.info(\"received a start request for context \" + contextId\n + \" with request id \" + requestId);\n MMIContext context = null;\n try {\n context = getContext(request, true);\n } catch (MMIMessageException e) {\n LOGGER.error(e.getMessage(), e);\n statusInfo = e.getMessage();\n }\n final ModalityComponentState state = context.getState();\n if (state == ModalityComponentState.RUNNING) {\n LOGGER.info(\"terminating old session\");\n final Session session = context.getSession();\n context.setSession(null);\n session.hangup();\n callManager.cleanupSession(session);\n }\n final String source = request.getSource();\n context.setTarget(source);\n context.setChannel(channel);\n URI uri = null;\n try {\n uri = getUri(context, request);\n } catch (URISyntaxException | MMIMessageException e) {\n LOGGER.error(e.getMessage(), e);\n statusInfo = e.getMessage();\n }\n if (uri == null) {\n statusInfo = \"Neither URI nor content given. Unable to start\";\n } else {\n context.setContentURL(uri);\n }\n try {\n if (statusInfo == null) {\n LOGGER.info(\"calling '\" + uri + \"'\");\n Session session = context.getSession();\n if (session == null) {\n copyCallMetadata(request, data);\n session = callManager.createSession(data);\n context.setSession(session);\n }\n final ExtensionNotificationDataConverter converter = callManager\n .getExtensionNotificationDataConverter();\n final DetailedSessionListener listener = new MmiDetailedSessionListener(\n adapter, context, converter);\n final JVoiceXmlSession jvxmlSession = (JVoiceXmlSession) session;\n jvxmlSession.addSessionListener(listener);\n session.call(uri);\n session.addSessionListener(this);\n }\n } catch (ErrorEvent e) {\n LOGGER.error(e.getMessage(), e);\n statusInfo = e.getMessage();\n } catch (UnsupportedResourceIdentifierException e) {\n LOGGER.error(e.getMessage(), e);\n statusInfo = e.getMessage();\n } catch (URISyntaxException e) {\n LOGGER.error(e.getMessage(), e);\n statusInfo = e.getMessage();\n }\n final StartResponse response = new StartResponse();\n final String target = request.getSource();\n response.setTarget(target);\n response.setContext(contextId);\n response.setRequestId(requestId);\n if (statusInfo == null) {\n response.setStatus(StatusType.SUCCESS);\n context.setRequestId(requestId);\n } else {\n LOGGER.info(\"start failed: \" + statusInfo);\n response.setStatus(StatusType.FAILURE);\n response.addStatusInfo(statusInfo);\n }\n try {\n final Mmi mmi = new Mmi();\n mmi.setLifeCycleEvent(response);\n adapter.sendMMIEvent(channel, mmi);\n context.setState(ModalityComponentState.RUNNING);\n LOGGER.info(context + \": \" + ModalityComponentState.RUNNING);\n } catch (IOException e) {\n LOGGER.error(e.getMessage(), e);\n removeContext(contextId);\n }\n }", "@Override\n\tpublic String execute() throws Exception {\n\t\treturn \"send\";\n\t}", "public void sendPaymentSync(lnrpc.Rpc.SendRequest request,\n io.grpc.stub.StreamObserver<lnrpc.Rpc.SendResponse> responseObserver) {\n asyncUnaryCall(\n getChannel().newCall(getSendPaymentSyncMethod(), getCallOptions()), request, responseObserver);\n }", "protected abstract void beforeCall();", "public MSSRegistrationResp send(final MSSRegistrationReq req) throws IOException {\n return this.send(req, null);\n }", "private void makeCall() {\n\t\t// send the originate action (Call)\n\t\tthis.asteriskServer.originateAsync(this.originateAction, new OriginateCallbackAdapter() {\n\t\t\t@Override\n\t\t\tpublic void onDialing(final AsteriskChannel asteriskChannel) {\n\t\t\t\tCall.this.log.log(Level.INFO, \"Dialing: \" + asteriskChannel.getName() + \" \" + Call.this.destination);\n\t\t\t\tCall.this.state=CallState.DIALING;\n\t\t\t\tCall.this.currentChannel = asteriskChannel.getName();\n\t\t\t\t// Make sure when there was a hangup event that it is realy hung up.\n\t\t\t\tif(Call.this.hangup)\n\t\t\t\t\tCall.this.hangup();\n\t\t\t\t// Listen for cool stuff like \"ringing\"\n\t\t\t\tasteriskChannel.addPropertyChangeListener(new PropertyChangeListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void propertyChange(PropertyChangeEvent evt) {\n\t\t\t\t\t\t// is the phone ringing?\n\t\t\t\t\t\tif (evt.getPropertyName().equals(\"state\") && evt.getNewValue().toString().equals(\"RINGING\")) {\n\t\t\t\t\t\t\tCall.this.log.log(Level.INFO, \"Ringing: \" + asteriskChannel.getName() + \" \" + Call.this.destination);\n\t\t\t\t\t\t\t// Schedule hangup timeout\n\t\t\t\t\t\t\tCall.this.timeoutTimer.schedule(new TimerTask() {\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\tif (!Call.this.success) {\n\t\t\t\t\t\t\t\t\t\tCall.this.asteriskServer.getChannelByName(Call.this.currentChannel).hangup();\n\t\t\t\t\t\t\t\t\t\t// no \"noAnswer()\" called here because a\n\t\t\t\t\t\t\t\t\t\t// onNoAnswer event will come in anyway\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, new Long(EPursuit.properties.getProperty(\"callTime\")));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(AsteriskChannel asteriskChannel) {\n\t\t\t\tCall.this.state=CallState.RUNNING;\n\t\t\t\tCall.this.success = true;\n\t\t\t\tCall.this.log.log(Level.INFO, \"Connection successful: \" + asteriskChannel.getName() + \" \" + Call.this.destination);\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onNoAnswer(AsteriskChannel asteriskChannel) {\n\t\t\t\tCall.this.log.log(Level.INFO, \"Channel not answered: \" + Call.this.currentChannel + \" \" + Call.this.destination);\n\t\t\t\tif (asteriskChannel.getHangupCause().toString().equals(\"CALL_REJECTED\")) {\n\t\t\t\t\tCall.this.noAnswer();\n\t\t\t\t} else {\n\t\t\t\t\tCall.this.noAnswer();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onBusy(AsteriskChannel asteriskChannel) {\n\t\t\t\tCall.this.noAnswer();\n\n\t\t\t\tCall.this.log.log(Level.INFO, \"Busy: \" + asteriskChannel.getName() + \" \" + Call.this.destination);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(LiveException cause) {\n\t\t\t\tCall.this.noAnswer();\n\n\t\t\t\tif (cause.getClass().getCanonicalName().equals(\"org.asteriskjava.live.NoSuchChannelException\")) {\n\t\t\t\t\t// Called when the channel is busy... dunno why\n\t\t\t\t\tCall.this.log.log(Level.INFO, \"Channel perhabs busy. \" + Call.this.destination);\n\t\t\t\t} else {\n\t\t\t\t\tCall.this.log.log(Level.WARNING, \"Received unknown error.\\n\" + cause + \" \" + Call.this.destination);\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t}", "@Scheduled(fixedRate = 2000)\n private void doSendRpcUsage() {\n List<MethodCallDTO> items = stats.values()\n .stream()\n .map(stat -> new MethodCallDTO(\n stat.name,\n stat.count.longValue(),\n stat.lastCall.longValue(),\n stat.lastResult.get(),\n stat.curl))\n .sorted((s1, s2) -> s1.getMethodName().compareTo(s2.getMethodName()))\n .collect(Collectors.toList());\n\n clientMessageService.sendToTopic(\"/topic/rpcUsage\", items);\n }", "@Override\r\n \tpublic Object invoke(Object arg0, Method arg1, Object[] arg2)\r\n \t\t\tthrows Throwable {\n \t\tString urlfortheobject = baseUrl+methodToID(arg1);\r\n \t\t\r\n \t\t// Get the IRemoteRestCall object for this method...\r\n\t\tClientResource cr = new ClientResource(urlfortheobject);\r\n \t\tIRemoteRestCall resource = cr.wrap(IRemoteRestCall.class, arg1.getReturnType());\r\n \t\t\r\n \t\t// Call\r\n \t\tObject returnObject = resource.doCall(arg2);\r\n\t\tcr.release();\r\n \t\t\r\n \t\t// return\r\n \t\treturn returnObject;\r\n \t}", "private void logCallMade(String number, String leadId) {\n\n final HashMap<String, String> params = new HashMap<>();\n\n params.put(Constants.SHARE_SOURCE, Constants.CATEGORY_SELLER_LEADS);\n\n params.put(Constants.SHARE_TYPE, ShareType.CALL.name());\n params.put(Constants.MOBILE_NUM, number);\n // params.put(Constants.CAR_ID, carId);\n params.put(Constants.LEAD_ID_KEY, leadId);\n params.put(Constants.METHOD_LABEL, Constants.SENT_CARS_METHOD);\n\n RetrofitRequest.shareCarsRequest(mContext, params, new Callback<GeneralResponse>() {\n @Override\n public void success(GeneralResponse generalResponse, retrofit.client.Response response) {\n }\n\n @Override\n public void failure(RetrofitError error) {\n if (error.getCause() instanceof UnknownHostException) {\n ApplicationController.getInstance().getGAHelper().sendEvent(GAHelper.TrackerName.APP_TRACKER,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.ACTION_TAP,\n Constants.LABEL_NO_INTERNET,\n 0);\n\n } else {\n ApplicationController.getInstance().getGAHelper().sendEvent(GAHelper.TrackerName.APP_TRACKER,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_IO_ERROR,\n error.getMessage(),\n 0);\n }\n }\n });\n /* ShareCarsRequest shareCarsRequest = new ShareCarsRequest(mContext,\n Request.Method.POST,\n Constants.getWebServiceURL(mContext),\n params,\n new Response.Listener<GeneralResponse>() {\n @Override\n public void onResponse(GeneralResponse response) {\n\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n if (error.getCause() instanceof UnknownHostException) {\n ApplicationController.getInstance().getGAHelper().sendEvent(GAHelper.TrackerName.APP_TRACKER,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.ACTION_TAP,\n Constants.LABEL_NO_INTERNET,\n 0);\n\n } else {\n ApplicationController.getInstance().getGAHelper().sendEvent(GAHelper.TrackerName.APP_TRACKER,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_SELLER_LEADS,\n Constants.CATEGORY_IO_ERROR,\n error.getMessage(),\n 0);\n }\n\n }\n });\n\n ApplicationController.getInstance().addToRequestQueue(shareCarsRequest);*/\n\n }", "public void addPendingCallToProxy(IBinder iBinder) {\n HiLog.info(LOG_LABEL, \"addPendingCallToProxy\", new Object[0]);\n this.mRemote = iBinder;\n processLiveCallWhenServiceConnected();\n CallAudioState callAudioState = this.mPendingCallAudioState;\n if (callAudioState != null) {\n HiLog.info(LOG_LABEL, \"addPendingCallToProxy:onCallAudioStateChanged %{public}s\", new Object[]{callAudioState.toString()});\n onCallAudioStateChanged(this.mPendingCallAudioState);\n this.mPendingCallAudioState = null;\n }\n Boolean bool = this.mPendingCanAddCall;\n if (bool != null) {\n HiLog.info(LOG_LABEL, \"addPendingCallToProxy:onCanAddCallChanged %{public}s\", new Object[]{bool.toString()});\n onCanAddCallChanged(this.mPendingCanAddCall.booleanValue());\n this.mPendingCanAddCall = null;\n }\n }", "public DataObject doCall(DataObject subsystemMessage, boolean synchronous, FunctionCallback callback, FunctionCallbackHandler callbackHandler) throws SubsystemException {\n\t\tDataObject returnMessage = null;\r\n\t\t \r\n\t\ttry {\r\n\t\t\tLong myMessageID = new Long(getNextMessageID());\r\n\t\t\ttrackCurrentThreadOrCallBack(myMessageID, synchronous, callback, callbackHandler);\r\n\t\t\tDataObject meta = subsystemMessage.getDataObject(com.textserv.framework.subsystem.common.internal.Constants.SubsystemMeta);\r\n\t\t\tmeta.setString(com.textserv.framework.subsystem.calling.internal.async.Constants.AsyncSenderUniqueName, uniqueName);\r\n\t\t\tmeta.setLong(com.textserv.framework.subsystem.calling.internal.async.Constants.AysncMessageID, myMessageID);\r\n\t\t\tlogger.debug(\"AsyncMessageFunctionCallCaller.doCall sending message \" + subsystemMessage.toStringEncoded(true));\r\n\t\t\r\n\t\t\tasyncMessager.sendMessage(uniqueName, subsystemMessage);\r\n\t\t\tif (synchronous) {\r\n\t\t\t\tlong synchronousWaitTimeout = defaultSynchronousWaitTimeout;\r\n\t\t\t\t\tDataObject params = subsystemMessage.getDataObject(com.textserv.framework.subsystem.common.internal.Constants.Params);\r\n\t\t\t\t\tif ( params != null ) {\r\n\t\t\t\t\t\tif ( params.itemExists(com.textserv.framework.subsystem.common.internal.Constants.FuncTimeOut)) {\r\n\t\t\t\t\t\t\tsynchronousWaitTimeout = params.getLong(com.textserv.framework.subsystem.common.internal.Constants.FuncTimeOut);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturnMessage = makeCurrentThreadWaitIfNeeded(myMessageID,synchronousWaitTimeout);\r\n\t\t\t}\r\n\t\t} catch( Exception e ) {\r\n\t\t\tlogger.error(\"AsyncMessageFunctionCallCaller.doCall Exception in doCall\", e);\r\n\t\t\tif ( e instanceof SubsystemException ) {\r\n\t\t\t\tthrow (SubsystemException)e;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new SubsystemException(\"Exception in doCall\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn returnMessage;\r\n\t}", "protected synchronized Object call(final String method, final Object... params) throws XmlRpcException {\r\n\r\n\t\tLOGGER.finest(\"Executing call \" + method + \" \" + Arrays.toString(params));\r\n\t\treturn client.execute(method, params);\r\n\t}", "public void handleCall(Call c) {\n\t}", "public Call getCurrentCall();", "public abstract void retrain(Call serviceCall, Response serviceResponse, CallContext messageContext);", "void doSend(Map<String, Object> parameters);", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.591 -0500\", hash_original_method = \"73417FF22870072B41D9E8892C6ACEAF\", hash_generated_method = \"98D30C9AEE1B66AD2FCFA7D7A2E2B430\")\n \nprivate static Message sendMessageSynchronously(Messenger dstMessenger, Message msg) {\n SyncMessenger sm = SyncMessenger.obtain();\n try {\n if (dstMessenger != null && msg != null) {\n msg.replyTo = sm.mMessenger;\n synchronized (sm.mHandler.mLockObject) {\n dstMessenger.send(msg);\n sm.mHandler.mLockObject.wait();\n }\n } else {\n sm.mHandler.mResultMsg = null;\n }\n } catch (InterruptedException e) {\n sm.mHandler.mResultMsg = null;\n } catch (RemoteException e) {\n sm.mHandler.mResultMsg = null;\n }\n Message resultMsg = sm.mHandler.mResultMsg;\n sm.recycle();\n return resultMsg;\n }", "public void setCallReturn(Object obj) {\n\n\t}", "public Response Call(String rmi, Request req, int id){\n Response callReply = null;\n\n ByzantineKingRMI stub;\n try{\n Registry registry=LocateRegistry.getRegistry(this.ports[id]);\n stub=(ByzantineKingRMI) registry.lookup(\"ByzantineKing\");\n if(rmi.equals(\"Round1\"))\n callReply = stub.Round1(req);\n else if(rmi.equals(\"Round2\"))\n callReply = stub.Round2(req);\n else if(rmi.equals(\"Round3\"))\n callReply = stub.Round3(req);\n else if(rmi.equals(\"Receive\"))\n callReply = stub.Receive(req);\n else\n System.out.println(\"Wrong parameters!\");\n } catch(Exception e){\n return null;\n }\n return callReply;\n }", "@Override\n protected void callFunction(final String name, final Object... arguments) {\n\n if (!unsupported) {\n super.callFunction(name, arguments);\n } else {\n Logger.getLogger(getClass().getName()).warning(\n \"PushState is unsupported by the client \"\n + \"browser. Ignoring RPC call for \"\n + getClass().getSimpleName() + \".\" + name);\n }\n }", "protected void doInvocation(){\n org.omg.CORBA.portable.Delegate delegate=StubAdapter.getDelegate(\n _target);\n // Initiate Client Portable Interceptors. Inform the PIHandler that\n // this is a DII request so that it knows to ignore the second\n // inevitable call to initiateClientPIRequest in createRequest.\n // Also, save the RequestImpl object for later use.\n _orb.getPIHandler().initiateClientPIRequest(true);\n _orb.getPIHandler().setClientPIInfo(this);\n InputStream $in=null;\n try{\n OutputStream $out=delegate.request(null,_opName,!_isOneWay);\n // Marshal args\n try{\n for(int i=0;i<_arguments.count();i++){\n NamedValue nv=_arguments.item(i);\n switch(nv.flags()){\n case ARG_IN.value:\n nv.value().write_value($out);\n break;\n case ARG_OUT.value:\n break;\n case ARG_INOUT.value:\n nv.value().write_value($out);\n break;\n }\n }\n }catch(Bounds ex){\n throw _wrapper.boundsErrorInDiiRequest(ex);\n }\n $in=delegate.invoke(null,$out);\n }catch(ApplicationException e){\n // REVISIT - minor code.\n // This is already handled in subcontract.\n // REVISIT - uncomment.\n //throw new INTERNAL();\n }catch(RemarshalException e){\n doInvocation();\n }catch(SystemException ex){\n _env.exception(ex);\n // NOTE: The exception should not be thrown.\n // However, JDK 1.4 and earlier threw the exception,\n // so we keep the behavior to be compatible.\n throw ex;\n }finally{\n delegate.releaseReply(null,$in);\n }\n }", "@Override\n\t\t\tpublic void callStarted(String channel) {\n\t\t\t}", "@Override\n\tpublic String requstPDDDataFlowNotify(MYNotifyDataFlowReq req) {\n\t\t// TODO Auto-generated method stub\n\t\tString status = req.getStatus().equals(\"4\")?\"SUCCESS\":\"FAIL\";\n\t\t\n\t\tMap<String,String> map = new HashMap<String,String>();\n\t\t\t\t\n\t\tmap.put(\"order_sn\", req.getOutTradeNo());\n\t\tmap.put(\"outer_order_sn\", req.getTaskID());\n\t\tmap.put(\"status\", status);\n\t\tmap.put(\"mall_id\", \"637786\");\n\t\tDate date = new Date();\n\t\tString timestamp = (date.getTime()/1000-60)+\"\";\n\t\tmap.put(\"type\", \"pdd.virtual.mobile.charge.notify\");\n\t\tmap.put(\"data_type\", \"JSON\");\n\t\tmap.put(\"timestamp\", timestamp);\n\t\t\t\t\n\t\tString sign = maiYuanService.PDD_Md5(map,Util.getMaiYuanConfig(\"PDD_SecretKey\"));\n\t\t\t\t\n\t\tString PDD_Url=\"http://open.yangkeduo.com/api/router?type=pdd.virtual.mobile.charge.notify&data_type=JSON&timestamp=\"+timestamp\n\t\t\t\t\t\t+\"&order_sn=\"+req.getOutTradeNo()\n\t\t\t\t\t\t+\"&outer_order_sn=\"+req.getTaskID()\n\t\t\t\t\t\t+\"&status=\"+status\n\t\t\t\t\t\t+\"&mall_id=637786&sign=\"+sign;\n\t\t\t\t\n\t\ttry {\n\t\t\tSystem.out.println(\"拼多多请求:\"+PDD_Url);\n\t\t\tString resp = Request.Post(PDD_Url).execute().returnContent().asString();\n\t\t\tSystem.out.println(\"拼多多回调数据:\"+resp);\n\t\t\treturn resp;\n\t\t\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn \"FAIL\";\n\t}", "@Override\r\n\tpublic Object request(Invocation invocation) throws Exception {\n\t\tRpcRequest req=new RpcRequest();\r\n\t\treq.setId(UUID.randomUUID().toString());\r\n\t\treq.setArgs(invocation.getAgrs());\r\n\t\treq.setMethod(invocation.getMethod().getName());\r\n\t\treq.setParameterTypes(invocation.getMethod().getParameterTypes());\r\n\t\treq.setType(invocation.getInterface());\r\n\t\treq.setAsyn(invocation.isAsyn());\r\n\t\tCompletableFuture<Object> result=new CompletableFuture<>();\r\n\t\tclientPool.borrowObject().request(req,result);\r\n\t\tif(invocation.isAsyn()){\r\n\t\t\treturn result;\r\n\t\t}else{\r\n\t\t\treturn result.get();\r\n\t\t}\r\n\r\n\r\n\t}", "@Override\n\tpublic void Call() {\n\t\tSystem.out.println( phoneName+\"'s Call.\");\n\t}", "@DSSink({DSSinkKind.SYNCHRONIZATION_DATA})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.541 -0500\", hash_original_method = \"44E20F477AE4DBE39F2143CAA1307C1F\", hash_generated_method = \"36868A8632F5BB2EF68675431B9B2D63\")\n \npublic Message sendMessageSynchronously(Message msg) {\n Message resultMsg = SyncMessenger.sendMessageSynchronously(mDstMessenger, msg);\n return resultMsg;\n }", "void sendRequest(String message);", "protected void send(O operation)\n {\n }", "private void invokeSync()\n \t{\n if (iDeviceList.size() == 0)\n {\n System.out.println(\"No devices found, so nothing to test\");\n return;\n }\n CpDevice device = iDeviceList.get(0);\n System.out.println(\"\\n\\nSync call to device \" + device.getUdn());\n \n CpProxyUpnpOrgConnectionManager1 connMgr = new CpProxyUpnpOrgConnectionManager1(device);\n try {\n GetProtocolInfo points = connMgr.syncGetProtocolInfo();\n System.out.println(\"source is \" + points.getSource() + \"\\nsink is \" + points.getSink());\n } catch (ProxyError pe) { }\n connMgr.dispose();\n \t}", "@Override\n public ServiceResponse send(final ServiceRequest request, final ServiceRequestSerializer serializer,\n final ServiceResponseDeserializer deserializer) throws SOAPException {\n return this.soapClient.send(request, this.getTargetUrl(), serializer, deserializer);\n }", "public final void mCALL() throws RecognitionException\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal int _type = AshvmLexer.CALL;\n\t\t\tfinal int _channel = BaseRecognizer.DEFAULT_TOKEN_CHANNEL;\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:726:6: ( 'call' )\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:726:8: 'call'\n\t\t\t{\n\t\t\t\tthis.match(\"call\");\n\n\t\t\t}\n\n\t\t\tthis.state.type = _type;\n\t\t\tthis.state.channel = _channel;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t}\n\t}", "public synchronized String sendCommand(String command) {\n\n\t\tlog.debug(\"Send command \" + command);\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t//Send the bytes and flush the output stream\n\t\t\tbyte[] commandByteArray = new String(command + \"\\r\").getBytes(\"ASCII\");\n\t\t\tlog.info(\"Sending bytes: \" + byteArrayToHexString(commandByteArray));\n\t\t\t\n\t\t\t//Flush the output stream\n\t\t\tthis.outputStream.write(commandByteArray);\n\t\t\tthis.outputStream.flush();\n\t\t\t\n\t\t} catch (UnsupportedEncodingException uee) {\n\t\t\tlog.error(\"Error sending \" + command + \" command.\", uee);\n\t\t} catch (IOException ioe) {\n\t\t\tlog.error(\"Error sending \" + command + \" command.\", ioe);\n\t\t}\n\t\t\n\t\t//Set the last command and return the response\n\t\tthis.lastCommand = command + \"\\r\";\n\t\treturn receiveResponse();\n\n\t}", "@Override\n\tvoid receiveCall() {\n\n\t}" ]
[ "0.5969786", "0.5530751", "0.55268335", "0.5463744", "0.5452925", "0.5388251", "0.5377536", "0.5361625", "0.5355967", "0.5296846", "0.5270217", "0.5242815", "0.52345574", "0.52205765", "0.5217821", "0.52107084", "0.5205808", "0.5171984", "0.5169628", "0.5148546", "0.5145587", "0.5137809", "0.5115399", "0.509917", "0.5086901", "0.50782657", "0.5065824", "0.50567585", "0.5054236", "0.50379145", "0.49896982", "0.49685362", "0.49598035", "0.49529052", "0.4931726", "0.49287602", "0.49273822", "0.49174613", "0.49106938", "0.49055302", "0.4902078", "0.48970369", "0.48952234", "0.48945746", "0.48768458", "0.4872983", "0.48716614", "0.48689675", "0.48653227", "0.48574904", "0.48412207", "0.48304838", "0.48280412", "0.48278472", "0.4825014", "0.48229703", "0.48152116", "0.48125613", "0.47948396", "0.47694904", "0.47672418", "0.47635674", "0.47629136", "0.47574413", "0.4751673", "0.47511253", "0.47454008", "0.473704", "0.47369638", "0.47366783", "0.4726369", "0.47059327", "0.47010624", "0.47004753", "0.4697025", "0.46927366", "0.46926254", "0.46887514", "0.46880412", "0.46865878", "0.46857092", "0.4683282", "0.46802825", "0.467972", "0.46710452", "0.46657106", "0.4664635", "0.46560106", "0.465366", "0.46511406", "0.46437326", "0.46391377", "0.46351188", "0.46280682", "0.4626343", "0.4621122", "0.46166718", "0.4613702", "0.46135402", "0.46092406" ]
0.5934414
1
==================== PUBLIC METHODS ==================== ==================== PROTECTED METHODS ==================== ==================== PRIVATE METHODS ==================== ==================== OVERRIDE METHODS ====================
@Override public int getCount() { return drinks.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n protected void prot() {\n }", "@Override\n protected void init() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "@Override\n public void init() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public void init() {}", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() { \n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n public void initialize() {\n \n }", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n public void init() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override public int describeContents() { return 0; }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "protected void init() {\n // to override and use this method\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "protected void initialize() {}", "protected void initialize() {}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n protected void end() {\n \n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void init() {\n\n super.init();\n\n }" ]
[ "0.65445083", "0.6460066", "0.6432554", "0.63927174", "0.63927174", "0.63927174", "0.63927174", "0.63927174", "0.63927174", "0.6383184", "0.6366494", "0.6256918", "0.62398374", "0.61758244", "0.6170681", "0.6145826", "0.6145826", "0.6144714", "0.61325765", "0.6129376", "0.6129376", "0.6123312", "0.61075234", "0.6102886", "0.6102265", "0.6102265", "0.6074686", "0.60672027", "0.6039936", "0.603495", "0.60338247", "0.60234576", "0.6008218", "0.59786737", "0.59768945", "0.59717125", "0.59717125", "0.5940356", "0.5931897", "0.5929247", "0.5929247", "0.5929247", "0.592223", "0.5908192", "0.5908192", "0.5908192", "0.5908192", "0.5908192", "0.5905884", "0.5905884", "0.59040165", "0.59040165", "0.5899863", "0.5896367", "0.58954203", "0.58954203", "0.58954203", "0.5892846", "0.58928305", "0.58907384", "0.5884272", "0.5884272", "0.5871891", "0.58702487", "0.58688456", "0.58615714", "0.58502346", "0.58374906", "0.5831296", "0.58292705", "0.5823348", "0.5823348", "0.5823348", "0.5823348", "0.5823348", "0.5823348", "0.5823348", "0.5823348", "0.5823348", "0.5823348", "0.582025", "0.581107", "0.5803517", "0.5803517", "0.5803517", "0.5783844", "0.5779519", "0.57726467", "0.576734", "0.5756295", "0.5756295", "0.5756128", "0.5755564", "0.5755564", "0.5755564", "0.57549846", "0.5750659", "0.57502985", "0.57498217", "0.57487744", "0.57422817" ]
0.0
-1
/ selectedRounds is a list of Integers that are the IDs of the rounds selected by the user in the 'Admin'form of the tournament scheduler. This function gives this list to the scheduler to make sure that this will be the list of running rounds.
public void loadRounds () { for (Integer roundId : selectedRounds) { log.info("Loading Round " + roundId); } log.info("End of list of rounds that are loaded"); Scheduler scheduler = Scheduler.getScheduler(); scheduler.loadRounds(selectedRounds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRoundNum(int roundNum){\n gameRounds = roundNum;\n }", "public ArrayList<Move> getRound(int round) {\r\n\t\tint startIndex;\r\n\t\tint endIndex;\r\n\t\t\r\n\t\tArrayList<Move> moves = new ArrayList<Move>();\r\n\t\t\r\n\t\t// Guard against negatives\r\n\t\tif (round < 0) {\r\n\t\t\tround = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif (round >= offsets.size()) {\r\n\t\t\tround = offsets.size() - 1;\r\n\t\t\tendIndex = offsets.size();\r\n\t\t} else {\r\n\t\t\tendIndex = offsets.get(round+1);\r\n\t\t}\r\n\t\t\r\n\t\tstartIndex = offsets.get(round);\r\n\t\t\r\n\t\tfor(int i = startIndex; i < endIndex; i++) {\r\n\t\t\tmoves.add(this.getResults().get(i));\r\n\t\t}\r\n\t\t\r\n\t\treturn moves;\r\n\t}", "public static List<Match> getRound(int roundNum) {\n\t\tList<Match> round = new ArrayList<Match>();\n\t\tint numInRound = numInRound(roundNum);\n\t\tint roundStart = numInRound - 1;\n\t\tfor (int i = 0; i < numInRound; i++)\n\t\t\tround.add(matches[roundStart + i]);\n\t\treturn round;\n\t}", "public void setNumberRounds(int numberRounds) {\n this.numberRounds = numberRounds;\n }", "public int getRounds() {\n\n\t\treturn rounds;\n\t}", "public int getRoundNum(){\n return gameRounds;\n }", "public static void startRunnableGames (List <Round> runningRounds)\n {\n if (runningRounds == null || runningRounds.isEmpty()) {\n log.info(\"No rounds available for runnable games\");\n return;\n }\n\n log.info(\"Looking for Runnable Games\");\n\n List<Game> games = new ArrayList<Game>();\n\n Session session = HibernateUtil.getSession();\n Transaction transaction = session.beginTransaction();\n try {\n games = GamesScheduler.getStartableGames(session, runningRounds);\n log.info(\"Check for startable games\");\n transaction.commit();\n } catch (Exception e) {\n transaction.rollback();\n e.printStackTrace();\n }\n session.close();\n\n log.info(String.format(\"Found %s game(s) ready to start\", games.size()));\n\n machinesAvailable = true;\n for (Game game: games) {\n log.info(String.format(\"Game %s will be started ...\", game.getGameId()));\n new RunGame(game).run();\n\n if (!machinesAvailable) {\n log.info(\"No free machines, stop looking for Startable Games\");\n break;\n }\n }\n }", "public static String manyRounds(int rounds) {\n\t\tString StringToJSON = \"{\\\"Rounds\\\":[\";\n\t\tfor(int i = 1; i <= rounds; i++) {\n\t\t\tPlayerBean.PLAYERTWO = 0;\n\t\t\tStringToJSON += round();\n\t\t\tif ( i < rounds) {\n\t\t\t\tStringToJSON += \",\";\n\t\t\t}\n\t\t}\n\t\tStringToJSON += \"]}\";\n\t\treturn StringToJSON;\n\t}", "public static int numRounds() {\n\t\treturn numRounds;\n\t}", "public int calculate(java.util.List<Round> rounds, int index, Round round);", "private void nextRound(){\n round++;\n if(round == 6){\n endGame();\n }else{\n out.println(\"###ROUND \" + round + \"###\");\n// ArrayList<Player> playerList = game.getPlayerList();\n for (Player e : playerList) {\n e.resetActions();\n }\n game.applyCards();\n }\n }", "public int getRoundsToWait() {\n\t\treturn this.roundsToWait;\n\t}", "public static ArrayList<String> getPreviousBillRounds() {\n\n\t\tAppLog.begin();\n\t\tConnection conn = null;\n\t\tPreparedStatement ps = null;\n\t\tResultSet rs = null;\n\t\tList<String> previousBillRoundList = new ArrayList<String>();\n\t\ttry {\n\t\t\tString query = QueryContants.getPreviousBillRoundQuery();\n\t\t\tAppLog.info(\"getPreviousBillRoundsQuery::\" + query);\n\t\t\tconn = DBConnector.getConnection();\n\t\t\tps = conn.prepareStatement(query);\n\t\t\trs = ps.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tString previousBillRound = rs.getString(\"PREV_BILL_ROUND\");\n\t\t\t\tpreviousBillRoundList.add(previousBillRound);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tAppLog.error(e);\n\t\t} catch (IOException e) {\n\t\t\tAppLog.error(e);\n\t\t} catch (Exception e) {\n\t\t\tAppLog.error(e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (null != ps) {\n\t\t\t\t\tps.close();\n\t\t\t\t}\n\t\t\t\tif (null != rs) {\n\t\t\t\t\trs.close();\n\t\t\t\t}\n\t\t\t\tif (null != conn) {\n\t\t\t\t\tconn.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tAppLog.error(e);\n\t\t\t}\n\t\t}\n\t\tAppLog.end();\n\t\treturn (ArrayList<String>) previousBillRoundList;\n\t}", "public void playRound() {\r\n\t\twhile (!theModel.isGameOver()) {\r\n\t\t\tif (theModel.setActivePlayer(winningPlayer) == true) {\r\n\t\t\t\t// theModel.selectCategory();\r\n\t\t\t\t// so at this point we have returned strings?\r\n\t\t\t\ttheModel.displayTopCard();\r\n\t\t\t\twinningPlayer = theModel.compareCards(theModel.getSelectedCategory(theModel.selectCategory()));\r\n\t\t\t\t\r\n\t\t\t\tcheckIfWinOrDraw();\r\n\t\t\t\t\r\n\t\t\t\tRoundID++;\r\n\t\t\t\t\r\n\t\t\t\tSystem.err.println(\"\\nThe current Round : \" + RoundID);\r\n\t\t\t\t\r\n\t\t\t\tlog.writeFile(\"\\nThe current Round : \" + RoundID);\r\n\t\t\t\t\r\n\t\t\t\tsql.setRoundDataToSQL(GameID, RoundID, winningPlayer.getName(), theModel.getIsDraw(), theModel.humanIsActivePlayer);\r\n\t\t\t\r\n\t\t\t\t//System.out.println(\"this should be the human having won round\");\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcheckIfHumanPlayerInGame();\r\n\t\t\t\twinningPlayer = theModel.compareCards(theModel.getSelectedCategory(theModel.autoCategory()));\r\n\t\t\t\tcheckIfWinOrDraw();\r\n\t\t\t\t\r\n\t\t\t\tRoundID++;\r\n\t\t\t\t\r\n\t\t\t\tSystem.err.println(\"\\nThe current Round: \" + RoundID);\r\n\t\t\t\tlog.writeFile(\"\\nThe current Round : \" + RoundID);\r\n\t\t\t\tsql.setRoundDataToSQL(GameID, RoundID, winningPlayer.getName(), theModel.getIsDraw(), theModel.humanIsActivePlayer);\r\n\r\n\t\t\t\t//System.out.println(\"this should be the ai \" + winningPlayer.getName() + \"who has won the last round\");\r\n\t\t\t\t// return true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public int getCurrentGameRound(){\n\t\treturn currentGameRound;\n\t}", "public void setCurrentGameRound(int round){\n\t\tcurrentGameRound = round;\n\t\trepaint();\n\t}", "public void finishSubRound(){\n\n\t\t/* sorts the cards on in the table pool in a decsending order */\n List<PlayerCardArray> sortedTableHand =\n\t\t\t\tgameLogic.getTableHand().sortedTableHand(gameLogic.getTrumpCard().getSuit(),\n gameLogic.getLeadSuitCard().getSuit());\n\n System.out.println(sortedTableHand);\n\n PlayerCardArray winner = sortedTableHand.get(0);\n\n\t\t/* Display winner of the round */\n System.out.println(\"The winner of this round is player ID: \" + winner.getPlayerId());\n gameLogic.getScoreboard().addTricksWon(round, winner.getPlayerId());\n\n\t\t/* Get the winner name */\n\t\tif (winner.getPlayerId() == 0){\n\t\t\twinnerName = lblNameA.getText();\n\t\t} else if (winner.getPlayerId() == 1){\n\t\t\twinnerName = lblNameB.getText();\n\t\t}else if (winner.getPlayerId() == 2){\n\t\t\twinnerName = lblNameC.getText();\n\t\t}else if (winner.getPlayerId() == 3){\n\t\t\twinnerName = lblNameD.getText();\n\t\t}\n\n\t\t/* displays the message dialog box informing winner of the round */\n JOptionPane.showMessageDialog(null, \"Round: \" + round + \"\\nSubround: \" + (roundCounter+1) + \"\\nWinner is: \" + winnerName);\n\n\t\t/* set Winner for player */\n for (Player p : gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n if ( p.getPlayerId() == winner.getPlayerId() ) {\n p.setTrickWinner(true);\n } else {\n p.setTrickWinner(false);\n }\n }\n\n\t\t/* updates the UI informing play how many tricks won so far */\n\t\tfor (Player p : gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n\t\t\tif (winner.getPlayerId() == 0){\n\t\t\t\troundBidsWon += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 1){\n\t\t\t\troundBidsWon1 += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 2){\n\t\t\t\troundBidsWon2 += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 3){\n\t\t\t\troundBidsWon3 += 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* Set position for players */\n System.out.println(\"OLD PLAYER ORDER: \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers());\n if (round != 11) {\n gameLogic.setPlayerOrder(round);\n currentPlayer = gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getPlayerId();\n if (currentPlayer == 0){\n \tSystem.out.println(\"YOU ARE NOW THE FIRST PERSON TO PLAY\");\n \twaitingUser = true;\n } else {\n \twaitingUser = false;\n }\n System.out.println(\"NEW PLAYER ORDER: \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers());\n }\n\n\t\t/* Clear tableHand at end of subround */\n gameLogic.getTableHand().clearTableHand();\n\t}", "public int getCurrentRound()\n\t{\n \treturn currentRound;\n\t}", "public void playRound(List<Player> players) {\n\n //winners ArrayList initializer\n List<Player> winners = new ArrayList<>();\n\n //When the tournament started\n start = System.currentTimeMillis();\n\n //Main loop for running rounds, loop x numberOfRounds\n for (int i = 0; i < numberOfRounds; i++) {\n //Loop for titles, if not the last iteration then roundTitle\n if (i != numberOfRounds - 1) {\n roundTitle();\n //else display finalTitle\n } else {\n finalTitle();\n }\n //winners List is passed as the players to run through the round\n winners = playMatch(players);\n players = winners;\n\n //for each loop that calls on Player object method calculateScore, this happens with each round iteration\n for (Player player : players) {\n player.calculateScore();\n }\n\n //Output for the champion\n if (i == numberOfRounds - 1) {\n lineDivider();\n //With numberOfRounds - 1, append remaining winner in the List output as Champion\n String champion = \"\\n\" + winners.get(0).printName() + \" is the champion !!\";\n //Convert string to uppercase for increased impact\n String championUpper = champion.toUpperCase();\n System.out.println(championUpper);\n lineDivider();\n System.out.println(\"******************************************************\");\n\n }\n\n\n }\n //Small method to calculate/sys out time taken to complete the tournament\n end = System.currentTimeMillis();\n timeTaken = start - end;\n System.out.println(\"\\n\\n This Tournament took\" + timeTaken + \" milliseconds to complete\");\n\n }", "public void displayRoundUI() {\n\n\t\tif (!(roundList.isEmpty())){\n\t\t\tfor (JLabel item: roundList){\n\t\t\t\testimationGame.getContentPane().remove(item);\n\t\t\t}\n\t\t\troundList.clear();\n\t\t}\n\n\t\tJLabel lblRound = new JLabel(\"Round: \" + round);\n\n springLayout.putConstraint(SpringLayout.WEST, lblRound, 10, SpringLayout.WEST,\n estimationGame.getContentPane());\n lblRound.setForeground(Color.WHITE);\n springLayout.putConstraint(SpringLayout.NORTH, lblRound, 50, SpringLayout.NORTH,\n estimationGame.getContentPane());\n lblRound.setFont(new Font(\"Tahoma\", Font.PLAIN, 15));\n\n roundList.add(lblRound);\n estimationGame.getContentPane().add(lblRound);\n estimationGame.validate();\n\t estimationGame.repaint();\n\t}", "public Vector<String[]> startGame(int rounds){\n\t\tSystem.out.println(\"Game started!\");\n\t\t\n\t\t//signal all connected clients that game has started\n\t\tbroadCastMessage(\"@startGame\"); \n\t\t\n\t\t//initialize the game data results\n\t\tVector<String[]> resultsData = new Vector<String[]>();\n\t\t\n\t\t/*\n\t\t * the number of word challenges/rounds\n\t\t * TODO: this could be defined by the game host \n\t\t */\n\t\twhile(rounds > 0){\n\t\t\tString word = gameServer.getAword();\n\n\t\t\t//get a random word (results does not contain)\n\t\t\tword = gameServer.getAword(); //TODO reduce chances of repeated words per game\n\t\t\t\n\t\t\t//the first string in the round result is the received word from teh server\n\t\t\tString [] results = new String [clientListeners.size()+1];\n\t\t\tresults[0] = word; \n\t\t\t\n\t\t\tbroadCastMessage(word);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tThread.sleep(timeOut); //timer or wait for clients to reply their entries\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t/*Iterate through listeners collection and store answers in resultsMap*/\n\t\t\tfor(int i=0;i<clientListeners.size();i++){\n\t\t\t\tresults[i+1] = clientListeners.get(i).getAnswer(); //populate the collection of answers from all clients\n\t\t\t}\n\t\t\t\n\t\t\t//store result data\n\t\t\tresultsData.add(results);\n\t\t\t\n\t\t\trounds--;\n\t\t}\n\t\treturn resultsData;\n\t}", "private void resetRoundVars() {\n\t\tmAttackerDelay = 0;\n\t\tmRoundTimeElapsed = 0;\n\t\tmRoundScore = 0f;\n\t\tmKnightSpawnChance = 0.35f + (0.1f * (mRoundNumber - 1)); // +10% chance per round, starting at 35%\n\t\tif(mKnightSpawnChance > 0.65f) mKnightSpawnChance = 0.65f; // Hard cap at 65%\n\t\tmRoundMaxAttackers = 5 + mRoundNumber * 2;\n\t\tmRoundMaxTime = 50 + (mRoundNumber * 1.5f);\n\t\tmRoundSaved = false;\n\t\tmRoundText = \"Round: \" + mRoundNumber;\n\t\tmSpawnTimeMin = mSpawnTimeMin - (mRoundNumber * 5);\n\t\tmSpawnTimeMax = mSpawnTimeMax - (mRoundNumber * 5);\n\n\t\t// Kill all living attackers\n\t\tfor(int i = 0; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\tmAttackers[i].kill();\n\t\t}\n\t}", "private void newRound(){\n\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\tSystem.out.println(\"PREPPING ROUND \" + round + \" SETUP. Game Logic round (should be aligned) : \" + gameLogic.getRound());\n\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\n\t\tSystem.out.println(\"PRINTING LEADSUIT OF NEW ROUND \" + gameLogic.getLeadSuitCard());\n\t\tgameLogic.initialiseDeck();\n\t\tgameLogic.setDealer(round);\n\t\t\n\t\tSystem.out.println(\"Players Hand (Should be empty): \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getHand());\n\t\t\n\t\tgameLogic.setPlayersHand(round);\n\t\tgameLogic.setTrumpCard();\n\t\tgameLogic.setPlayerOrder(round);\n\t\tgameLogic.getTableHand().clearTableHand();\n\n\t\twaitingUser = false;\n\t\tif (waitingUser()){\n\t\t\twaitingUser = true;\n\t\t}\n\n\t\tcurrentPlayer = gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getPlayerId();\n\n\t\tdisplayRoundUI();\n\t\tdisplayTrumpUI();\n\t\tdisplayCardUI();\n\t\tdisplayAvailableBidsUI();\n\t\tdisplayTableHandUI();\n\n\t\tSystem.out.println(\"BEGIN ROUND \" + round);\n\t\ttodoThread();\n\t}", "public int getRoundID() {\n return rounds.get(currentRound).getRoundID();\n }", "public void setRound(int round) {\r\n this.round = round;\r\n }", "public PaxosRound getRound(int a_round)\n {\n PaxosRound result = (PaxosRound) m_rounds.get(new Integer(a_round));\n return result;\n }", "public TournamentMode(int rounds) {\n\n\t\tthis.rounds = rounds;\n\t\tdealer = Director.getInstance().getDealer();\n\t}", "public int getCurrentRound() {\n\t\treturn roundNumber;\n\t}", "public Round(int roundNo) {\n\t\tthis.niceMoves = new ArrayList<Move>();\n\t\tthis.roundNo = roundNo;\n\t}", "public void setNumberOfRounds(int duration) {\n numberOfRounds = players.size() * duration;\n }", "public void round(Player playerWhoseTurn, ArrayList<Player> players) {\n\n view.print(\"\");\n view.print(\"--Player \" + playerWhoseTurn.getPlayerId() + \"--\");\n view.print(\"\");\n\n // displaying decisive player's card\n view.printCard(playerWhoseTurn.showTopCard());\n view.print(\"\\n\\n\");\n\n // creating list of cards currently in game (table)\n ArrayList<Card> cardsOnTable = new ArrayList<Card>();\n\n // All players lay their cards on table\n for (Player player : players) {\n cardsOnTable.add(player.layCardOnTable());\n }\n\n // Actual round\n\n // Asking player for decision which feature to fight with\n int playerDecision;\n\n while (true) {\n\n // decisive player decides which feature to fight with\n playerDecision = view.decideWhichFeature();\n\n // possible decisions\n int[] possibleChoices = {1, 2, 3, 4};\n\n // check if player choose existing option\n if (!checkIfValueInArray(possibleChoices, playerDecision)) {\n view.print(\"No such choice! Try again!\");\n } else {\n break;\n }\n }\n\n // Dealer checks who won (there might be exequo winners!)\n ArrayList<Integer> winnersIds = dealer.getWinner(cardsOnTable, playerDecision);\n\n // if there are no exequo winners, so there is only one winner:\n if (winnersIds.size() == 1) {\n\n // display message who won\n view.print(\"\\nPlayer \" + winnersIds.get(0) + \" won the round!\");\n\n //add cards from cardsOnTable to winner's hand\n for (Card card : cardsOnTable) {\n for (Player player : players) {\n if (player.getPlayerId() == winnersIds.get(0)) {\n player.addCard(card);\n }\n }\n }\n // clear cardsOnTable\n cardsOnTable.clear();\n\n //add cards from tempCardStack (if ther are any) to winner's hand\n for (Card card : tempCardStack) {\n for (Player player : players) {\n if (player.getPlayerId() == winnersIds.get(0)) {\n player.addCard(card);\n }\n }\n }\n // clear tempCardStack\n tempCardStack.clear();\n }\n\n // when there are exequo winners:\n else if (winnersIds.size() > 1) {\n\n // Nobody gets the cards, instead cards go to temporary stack untill someone wins them\n // in the next round\n for (Card card : cardsOnTable) {\n tempCardStack.add(card);\n }\n // display who won (for example \"Players 1, 2, 3 exequo won the round\")\n view.printExequoWinners(winnersIds);\n }\n }", "public float getTimeBetweenRounds() {\r\n\t\treturn timeBetweenRounds;\r\n\t}", "@Test\n public void testAddGetAllRoundsByGameId() {\n Game testGame = new Game();\n \n testGame.setCorrectSolution(\"1234\");\n testGame.setGameOver(false);\n gameDao.addGame(testGame);\n \n Round testRound1 = new Round();\n testRound1.setGameId(testGame.getGameId());\n testRound1.setUserGuess(\"3214\");\n testRound1.setTime(LocalDateTime.now());\n testRound1.setResult(\"RESULT\");\n testRound1 = roundDao.addRound(testRound1);\n \n Round testRound2 = new Round();\n testRound2.setGameId(testGame.getGameId());\n testRound2.setUserGuess(\"4567\");\n testRound2.setTime(LocalDateTime.now());\n testRound2.setResult(\"RESULT\");\n testRound2 = roundDao.addRound(testRound2);\n \n List<Round> rounds = roundDao.getAllRoundsByGameId(testGame.getGameId());\n \n assertEquals(2, rounds.size());\n // assertNotNull(testRound1 = roundDao.getRoundById(testRound1.getRoundId()));\n //assertNotNull(testRound2 = roundDao.getRoundById(testRound2.getRoundId()));\n\n assertTrue(rounds.contains(testRound1));\n assertTrue(rounds.contains(testRound2));\n }", "public void makeRounds() {\n for (int i = 0; i < nrofturns; i++) {\n int check = 0;\n // If all distributors are bankrupt we intrrerupt the simulation\n for (Distributor d : listOfDistributors.getList()) {\n if (d.isBankrupt()) {\n continue;\n }\n check = 1;\n break;\n }\n if (check == 0) {\n break;\n }\n // Auxiliary variable that will point to the best deal for the consumers\n Distributor bestDist;\n // Making the updates at the start of each month\n if (listOfUpdates.getList().get(i).getNewConsumers().size() != 0) {\n for (Consumer x : listOfUpdates.getList().get(i).getNewConsumers()) {\n listOfConsumers.getList().add(x);\n }\n }\n if (listOfUpdates.getList().get(i).getDistributorChanges().size() != 0) {\n for (DistributorChanges x : listOfUpdates.getList().get(\n i).getDistributorChanges()) {\n listOfDistributors.grabDistributorbyID(\n x.getId()).setInitialInfrastructureCost(x.getInfrastructureCost());\n }\n }\n\n // Checking if the producers have changed their costs asta ar trb sa fie update\n\n // Making the variable point to the best deal in the current round\n // while also calculating the contract price for each distributor\n bestDist = listOfDistributors.getBestDistinRound();\n // Removing the link between consumers and distributors when the contract has ended\n for (Distributor d : listOfDistributors.getList()) {\n if (d.isBankrupt()) {\n // Case in which we delete the due payment of the consumer if\n // its current distributor goes bankrupt\n for (Consumer cons : listOfConsumers.getList()) {\n if (cons.getIdofDist() == d.getId()) {\n cons.setDuepayment(0);\n cons.setMonthstoPay(0);\n cons.setIdofDist(-1);\n }\n }\n continue;\n }\n d.getSubscribedconsumers().removeIf(\n c -> c.isBankrupt() || c.getMonthstoPay() <= 0);\n }\n // Giving the non-bankrupt consumers their monthly income and getting the ones\n // without a contract a deal (the best one)\n for (Consumer c : listOfConsumers.getList()) {\n if (c.isBankrupt()) {\n continue;\n }\n c.addtoBudget(c.getMonthlyIncome());\n if (c.getMonthstoPay() <= 0 || c.getIdofDist() == -1) {\n c.setIdofDist(bestDist.getId());\n c.setMonthstoPay(bestDist.getContractLength());\n c.setToPay(bestDist.getContractPrice());\n bestDist.addSubscribedconsumer(c);\n }\n }\n // Making the monthly payments for the non-bankrupt consumers\n for (Consumer entity : listOfConsumers.getList()) {\n if (entity.isBankrupt()) {\n continue;\n }\n // If the consumer has no due payment we check if he can pay the current rate\n if (entity.getDuepayment() == 0) {\n // If he can, do just that\n if (entity.getBudget() >= entity.getToPay()) {\n entity.addtoBudget(-entity.getToPay());\n listOfDistributors.grabDistributorbyID(entity.getIdofDist()).addBudget(\n entity.getToPay());\n entity.reduceMonths();\n // Contract has ended\n if (entity.getMonthstoPay() <= 0) {\n entity.setIdofDist(-1);\n }\n } else {\n // He cannot pay so he gets a due payment\n entity.setDuepayment(entity.getToPay());\n entity.reduceMonths();\n }\n } else {\n // The consumer has a due payment\n if (entity.getMonthstoPay() == 0) {\n // He has one to a distributor with whom he has ended the contract so\n // he must make the due payment and the one to the new distributor\n int aux = (int) Math.round(Math.floor(DUECOEFF * entity.getDuepayment()));\n int idAux = entity.getIdofDist();\n entity.setIdofDist(bestDist.getId());\n entity.setToPay(bestDist.getContractPrice());\n entity.setMonthstoPay(bestDist.getContractLength());\n bestDist.addSubscribedconsumer(entity);\n // He is able to\n if (entity.getBudget() >= (aux + entity.getToPay())) {\n entity.addtoBudget(-(aux + entity.getToPay()));\n listOfDistributors.grabDistributorbyID(idAux).addBudget(\n aux);\n listOfDistributors.grabDistributorbyID(entity.getIdofDist()).addBudget(\n entity.getToPay());\n entity.reduceMonths();\n } else {\n // He has insufficient funds\n entity.setBankrupt(true);\n }\n } else {\n // His due payment is at the same distributor he has to make the monthly\n // payments\n // He can do the payments\n if (entity.getBudget()\n >= (int) Math.round(Math.floor(DUECOEFF * entity.getDuepayment())\n + entity.getToPay())) {\n entity.addtoBudget(-(int) Math.round(Math.floor(DUECOEFF\n * entity.getDuepayment()) + entity.getToPay()));\n listOfDistributors.grabDistributorbyID(entity.getIdofDist()).addBudget(\n (int) Math.round(Math.floor(DUECOEFF * entity.getDuepayment())\n + entity.getToPay()));\n entity.reduceMonths();\n } else {\n // He cannot do the payments\n entity.setBankrupt(true);\n }\n }\n }\n }\n // The non-bankrupt distributors pay their monthly rates\n for (Distributor d : listOfDistributors.getList()) {\n if (d.isBankrupt()) {\n continue;\n }\n d.reduceBudget();\n // Those who cannot, go bankrupt\n if (d.getBudget() < 0) {\n d.setBankrupt(true);\n }\n }\n\n this.roundsAdjustments(i);\n }\n }", "public int getRound() {\n\t\treturn myHistory.size() + opponentHistory.size();\n\t}", "public Round(ArrayList<Move> niceMoves, int roundNo) {\n\t\tthis.niceMoves = niceMoves;\n\t\tthis.roundNo = roundNo;\n\t}", "public void logRoundDraw(ArrayList<Player> winners, int round){\n\t\tlog += String.format(\"ROUND %d DRAW BETWEEN \", round);\n\t\tint i = 0;\n\t\tif (winners.get(0) instanceof HumanPlayer)\n\t\t{\n\t\t\tlog += \"USER \";\n\t\t\ti++;\n\t\t}\n\t\tfor (; i < winners.size(); i++)\n\t\t{\n\t\t\tAIPlayer p = (AIPlayer) winners.get(i);\n\t\t\tlog += String.format(\"%s \", p.getName().toUpperCase());\n\t\t}\n\t\tlineBreak();\n\t}", "public void play(){\n\n gameRounds++;\n mRound = new Round(players);\n mRound.beginRound();\n\n }", "private void handleRoundStart() {\n\t\t// Increment attackerDelay\n\t\tmAttackerDelay++;\n\t\tmRoundText = \"Starting Round \" + mRoundNumber + \"...\";\n\n\t\t// If it is over the threshold of 15 frames, start the standard round\n\t\tif(mAttackerDelay > 15) {\n\t\t\tmGameState = STATE_ROUND_PLAY;\n\t\t\tmRoundText = \"Round: \" + mRoundNumber;\n\t\t\thideAllButtons();\n\t\t}\n\t}", "public static int playOneRound(String name1, int roundNumber) {\n\t\t\n\t\t//if the round number that was an input is not a number between 1 and 6\n\t\tif ((roundNumber < 1) || (roundNumber > 6)) {\n\t\t\t\n\t\t\t//the program prints an error and returns -1\n\t\t\tSystem.out.println(\"Error: invalid input\");\n\t\t\treturn -1; \n\t\t} else {\n\t\t\n\t\t//otherwise, the dice roll method is called three times and stored as an integer each time\t\n\t\tint dieOne = diceRoll(); \n\t\tint dieTwo = diceRoll();\n\t\tint dieThree = diceRoll(); \n\t\t\n\t\t//these values are used as input to get the score of the round, which is stored as an integer\n\t\tint points = getScore(dieOne, dieTwo, dieThree, roundNumber); \n\t\t\n\t\t//the program displays what the player rolled and their score\n\t\tSystem.out.println(name1 + \" rolled \" + dieOne + \" \" + dieTwo + \" \" + dieThree + \" and scored \" + points + \" points\");\t\n\t\n\t\t//the number of points the player received is returned\n\t\treturn points;\n\t\t}\n\t}", "public void setRoundScore(int roundScore) {\n\t\tthis.roundScore = roundScore;\n\t}", "private void setRound(ChesspairingRound round) {\n\t\tint rNumber = round.getRoundNumber();\n\t\tif (rNumber < 1) {\n\t\t\tthrow new IllegalStateException();\n\t\t}\n\t\tList<ChesspairingRound> rounds = mTournament.getRounds();\n\t\tif (rounds.size() >= rNumber) {\n\t\t\trounds.remove(rNumber - 1);\n\t\t}\n\t\trounds.add(rNumber - 1, round);\n\t}", "public void displayAvailableBidsUI() {\n\t\tSystem.out.println(\"BIDDING TIME\");\n\n ArrayList<Integer> availableBids = new ArrayList<Integer>();\n numberOfSubRounds = cardsToDealPerRound[round - 1];\n\n\t\t/* loop through the players and set their bids */\n\t\tfor (Player p: gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n\t\t\tif (p instanceof Computer) {\n\t\t\t\twaitingUser = false;\n\t\t\t\tComputer pComputer = (Computer) p;\n\n\t\t\t\tpComputer.bidWinningTricks(numberOfSubRounds, gameLogic.getScoreboard().getTotalBidForRound(round),\n gameLogic.getTrumpCard().getSuit());\n\t\t\t\tint predictedBid = p.getBid();\n\t\t\t\tgameLogic.getScoreboard().addPrediction(round,p.getPlayerId(),predictedBid);\n\t\t\t} else {\n\t\t\t\t// User needs to set the predicted Bids\n int totalBidsSoFar = gameLogic.getScoreboard().getTotalBidForRound(round);\n availableBids = p.getAvailableBids(numberOfSubRounds, totalBidsSoFar);\n\t\t } \n\t\t}\n\n\t\tString[] availableBidsString = new String[availableBids.size()];\n\t\tfor (int i = 0; i < availableBids.size(); i++) {\n\t\t\tavailableBidsString[i] = Integer.toString(availableBids.get(i));\n\t\t}\n\n\t\t/* check if it is the player's turn */\n\t\tif (waitingUser()) {\n\t\t\twaitingUser = true;\n\t\t} else {\n\t\t\twaitingUser = false;\n\t\t}\n\n\t\t/* prompt the user to select a bid with dialog box */\n \tint bidSelected = JOptionPane.showOptionDialog(null,\n \"Select one from the available bids:\", \"BID WINDOW\", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, availableBidsString, availableBidsString[0]);\n\t\t\n\t\tdisplayBidUI(bidSelected);\n\n\t\tfor (Player p: gameLogic.getArrayOfPlayers().getArrayOfPlayers()){\n\t\t\tif (!(p instanceof Computer)){\n\t\t\t\tp.setBid(bidSelected);\n\t\t\t gameLogic.getScoreboard().addPrediction(round, p.getPlayerId(), bidSelected);\n\t\t\t}\n\t\t}\n \testimationGame.validate();\n\t\testimationGame.repaint();\n\t}", "public int getRoundNumber() {\n return roundNumber;\n }", "public ArrayList<Integer> getWinners() {\n return this.winners;\n }", "public void runRound(StartRoundDto startRoundDto) {\n this.startRoundDto = startRoundDto;\n GameScreen.getUiHandler().hideDrawnCards();\n for (IPlayer player : players) {\n if (!mainPlayer().equals(player)) {\n OnlinePlayer onlinePlayer = (OnlinePlayer) player;\n for (PlayerDto playerDto : startRoundDto.players) {\n if (playerDto.id == onlinePlayer.getId()) {\n if (playerDto.isPoweredDown) {\n onlinePlayer.setPoweredDown(true);\n } else {\n onlinePlayer.setPoweredDown(false);\n onlinePlayer.setCards(playerDto.cards);\n }\n }\n }\n } else {\n for (PlayerDto playerDto : startRoundDto.players) {\n if (playerDto.id == mainPlayer().getId() && !mainPlayer().isPoweredDown() && playerDto.cards != null) {\n ((Player) mainPlayer()).getCards().setSelectedCards(playerDto.cards);\n }\n }\n }\n }\n GameGraphics.getRoboRally().round();\n\n }", "public void runOff(int round) {\n\t\tfor (int i = 0; i < voteOrder.size(); i++) {\n\n\t\t\t// Depending on the round, get the number voted\n\t\t\tint count = voteOrder.elementAt(i).elementAt(round) - 1;\n\n\t\t\tCandidat candidat = Candidats.elementAt(count);\n\n\t\t\tif (candidat.getId() == count && !candidat.isEliminated) {\n\t\t\t\tint vow = candidat.getVows() + 1;\n\t\t\t\tcandidat.setVows(vow);\n\n\t\t\t\t// candidat.calculatePercentage(voteOrder.size());\n\t\t\t}\n\n\t\t}\n\n\t}", "public static boolean processScoringTeams() {\r\n\t\tboolean done = true;\r\n\t\tint player1Tricks = 0;\r\n\t\tint player2Tricks = 0;\r\n\t\tint player3Tricks = 0;\r\n\t\tint player4Tricks = 0;\r\n\t\t\r\n\t\t//Get the value of all the players tricks taken.\r\n\t\tplayer1Tricks = FrameUtils.player1TricksTaken.getSelectedIndex();\r\n\t\tplayer2Tricks = FrameUtils.player2TricksTaken.getSelectedIndex();\r\n\t\tplayer3Tricks = FrameUtils.player3TricksTaken.getSelectedIndex();\r\n\t\tplayer4Tricks = FrameUtils.player4TricksTaken.getSelectedIndex();\r\n\t\t\r\n\t\t//Check if all the choice boxes have been selected.\r\n\t\tif (player1Tricks == -1 || player1Tricks == 0) {\r\n\t\t\tdone = false;\r\n\t\t}\r\n\t\tif (player2Tricks == -1 || player2Tricks == 0) {\r\n\t\t\tdone = false;\r\n\t\t}\r\n\t\tif (player3Tricks == -1 || player3Tricks == 0) {\r\n\t\t\tdone = false;\r\n\t\t\t//Needed because the player bid was not a nil and the index for\r\n\t\t\t//the tricks taken is never read, by design. This only happens on\r\n\t\t\t//bids that are nils.\r\n\t\t\tif (FrameUtils.player3Bid.getSelectedItem() != \"nil\" ||\r\n\t\t\t\t\tFrameUtils.player3Bid.getSelectedItem() != \"dbl\") {\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (player4Tricks == -1 || player4Tricks == 0) {\r\n\t\t\tdone = false;\r\n\t\t\t//Needed because the player bid was not a nil and the index for\r\n\t\t\t//the tricks taken is never read, by design. This only happens on\r\n\t\t\t//bids that are nils.\r\n\t\t\tif (FrameUtils.player4Bid.getSelectedItem() != \"nil\" ||\r\n\t\t\t\t\tFrameUtils.player4Bid.getSelectedItem() != \"dbl\") {\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Get the value of all the players tricks taken.\r\n\t\tplayer1Tricks = stringToInt(FrameUtils.player1TricksTaken.getSelectedItem());\r\n\t\tplayer2Tricks = stringToInt(FrameUtils.player2TricksTaken.getSelectedItem());\r\n\t\tplayer3Tricks = stringToInt(FrameUtils.player3TricksTaken.getSelectedItem());\r\n\t\tplayer4Tricks = stringToInt(FrameUtils.player4TricksTaken.getSelectedItem());\r\n\t\t\r\n\t\t//Check if tricks taken in a game equals 13.\r\n\t\tif (player1Tricks + player2Tricks + player3Tricks + player4Tricks != 13) {\r\n\t\t\tdone = false;\r\n\t\t}\r\n\t\r\n\t\t//Show dialog box reminder.\r\n\t\tif (!done) FrameUtils.showDialogBox(\"Tricks taken was entered wrong.\");\r\n\t\t\t\r\n\t\t//Save tricks taken data.\r\n\t\tsaveTricksTakenData();\r\n\t\t\r\n\t\treturn done;\r\n\t}", "public synchronized int getCurrentRoundNumber()\r\n {\r\n return currentRoundNumber;\r\n }", "private void nextRound() {\r\n action = 0;\r\n if (round == GameConstants.ROUNDS) {\r\n round = 0;\r\n if (phase == 0) {\r\n vc = null;\r\n missioncontrollpieces = GameConstants.PIECES_SET;\r\n }\r\n phase++;\r\n } else {\r\n round++;\r\n }\r\n }", "public Round(ArrayList<Move> niceMoves) {\n\t\tthis.niceMoves = niceMoves;\n\t\tthis.roundNo = 1;\n\t}", "public void unloadRounds ()\n {\n log.info(\"Unloading Rounds\");\n\n Scheduler scheduler = Scheduler.getScheduler();\n scheduler.unloadRounds(true);\n }", "public int[] getYourScore(int[] details, int round) throws RemoteException {\n return sd.getGames().get(details[0]).getRound(round).\n getPlayerScore(details[1]);\n }", "public int calculateNextRound(Tournament tournament) {\r\n\t\treturn tournament.getRounds().size() + 1;\r\n\t}", "private void nextRound() {\n\t\n\t\t\n\t\tcfight++;\n\t\tif(cfight>=maxround)\n\t\t{\n\t\tcfight=0;\n\t\t\n\t\tround++;\n\t\t\tmaxround/=2;\n\t\t}\n\t\t\n\tif(round<4)\n\t{\n\tcontrollPCRound();\n\t}\n\telse\n\t{\n\t\tint sp=0;\n\t\tint round=0;\n\t\tfor(int i=0; i<fighter.length; i++)\n\t\t{\n\t\t\tif(spieler[i]>0)\n\t\t\t{\n\t\t\t\tsp++;\n\t\t\t\tif(fround[i]>round)\n\t\t\t\t{\n\t\t\t\tround=fround[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tif(geld==false)\n\t{\n\t\tgeld=true;\n\t\tif(sp==1)\n\t\t{\n\t\tZeniScreen.addZenis(round*3500);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint w=round*4000-500*sp;\n\t\t\tif(w<1)\n\t\t\t{\n\t\t\t\tw=100;\n\t\t\t}\n\t\t\tZeniScreen.addZenis(w);\t\n\t\t}\n\t}\n\t}\n\t\n\t\n\t}", "private void nextRound()\n {\n Player currentPlayer = roundManager.next();\n\n if(!currentPlayer.getClientConnection().isConnected() || !currentPlayer.getClientConnection().isLogged())\n {\n if(currentPlayer.equals(lastFinalFrenzyPlayer))return;\n nextRound();\n return;\n }\n\n if(gameMode == GameMode.FINAL_FRENZY_BEFORE_FP && roundManager.isFirstPlayer(currentPlayer))gameMode = GameMode.FINAL_FRENZY_AFTER_FP;\n\n try\n {\n currentPlayer.getView().roundStart();\n notifyOtherClients(currentPlayer, virtualView -> virtualView.showNotification(\"È il turno di \"+currentPlayer.getUsername()));\n\n if(roundManager.isFirstRound() || !currentPlayer.isFirstRoundPlayed()) firstRound(currentPlayer);\n\n for(int i = 0; i < gameMode.getPlayableAction(); i++)\n {\n currentPlayer.resetExecutedAction();\n boolean continueRound = executeAction(currentPlayer);\n if(!continueRound)break;\n }\n\n if(gameMode == GameMode.NORMAL)new ReloadAction(this, currentPlayer, ReloadAction.RELOAD_ALL).execute();\n }\n catch (ConnectionErrorException e)\n {\n Logger.error(\"Connection error during \"+currentPlayer.getUsername()+\"'s round!\");\n notifyOtherClients(currentPlayer, virtualView -> virtualView.showNotification(currentPlayer.getUsername()+\" si è disconnesso!\"));\n }\n catch (TimeOutException e)\n {\n Logger.info(\"Player \"+currentPlayer.getUsername()+\" has finished his time\");\n }\n\n currentPlayer.getView().roundEnd();\n currentPlayer.resetExecutedAction();\n refillMap();\n sendBroadcastUpdate();\n if(isFinalFrenzy())currentPlayer.setLastRoundPlayed(true);\n handleDeadPlayers(currentPlayer);\n if(isFinalFrenzy() && currentPlayer.equals(lastFinalFrenzyPlayer))return;\n checkForFinalFrenzy(currentPlayer);\n if(match.connectedPlayerSize() <= 0 || match.connectedPlayerSize() < MatchSettings.getInstance().getMinPlayers())return;\n nextRound();\n\n }", "private ArrayList<int[]> selectionRoulette(int[][] chromosomes, float percentToSelect) {\n\n\t\tArrayList<int[]> selectedChromosomes = new ArrayList<int[]>();\n\n\t\t//sum up fitnesses for population\n\t\tint fitnessSum = 0;\n\t\tfor (int[] chromosome : chromosomes) {\n\t\t\tfitnessSum += getFitness(chromosome);\n\t\t}\n\n\t\t//minimization problem - invert fitness\n\t\tint invertFitnessSum = 0;\n\t\tfor (int[] chromosome : chromosomes) {\n\t\t\tinvertFitnessSum += Math.round((fitnessSum * 1.0) / getFitness(chromosome)); //small fitness values (few bins) are favored\n\t\t}\n\n\t\t//get fitnesses of chromosomes, save in array to avoid recalculating\n\t\tint[] fitnesses = new int[chromosomes.length];\n\t\tfor (int i = 0; i < chromosomes.length; i++) {\n\t\t\tfitnesses[i] = (int) Math.round((fitnessSum * 1.0) / getFitness(chromosomes[i]));\n\t\t}\n\n\t\t//spin the roulette wheel\n\t\tfor (int i = 0; i < chromosomes.length * percentToSelect; i++) {\n\t\t\tint currentFitnessTotal = 0;\n\t\t\tint fitnessCutoff = rand.nextInt(invertFitnessSum); //where the wheel stops\n\n\t\t\tfor (int j = 0; j < chromosomes.length; j++) { //go through all chromosomes to see who is selected this spin\n\t\t\t\tif (currentFitnessTotal < fitnessCutoff)\n\t\t\t\t\tcurrentFitnessTotal += fitnesses[j];\n\n\t\t\t\tif (currentFitnessTotal >= fitnessCutoff) { //if this chromosome pushed us over the edge, save it\n\t\t\t\t\tselectedChromosomes.add(chromosomes[j]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}//end roulette spinning\n\t\treturn selectedChromosomes;\n\t}", "public Integer getRound() {\n return round;\n }", "public int getMaxRounds() {\n\t\treturn maxRounds;\n\t}", "public void startRound() {\n\t\troundWindow = new Stage();\n\t\troundWindow.initModality(Modality.APPLICATION_MODAL);\n\t\troundWindow.setTitle(\"Rundenoptionen\");\n\t\troundWindow.setMinWidth(400);\n\t\troundWindow.setMinHeight(500);\n\t\tif (player.isJailed()) { // give options to either pay 50, use card if\n\t\t\t\t\t\t\t\t\t// in possession, roll dice 3 times\n\t\t\tLabel header = new Label(\"DU BIST IM GEFÄNGNIS!\");\n\t\t\tButton firstOpt = new Button(\"Bezahle M 50\");\n\t\t\tButton secondOpt = new Button(\"Gefängnis-frei Karte\");\n\t\t\tButton thirdOpt = new Button(\"Würfeln\");\n\t\t\tfirstOpt.setOnAction(e -> {\n\t\t\t\tMonopolyClient.unjail(\"money\");\n\t\t\t\tMonopolyClient.toInterruptInterrupt();\n\n\t\t\t});\n\t\t\tsecondOpt.setOnAction(e -> {\n\t\t\t\tMonopolyClient.unjail(\"card\");\n\t\t\t\tMonopolyClient.toInterruptInterrupt();\n\n\t\t\t});\n\t\t\tthirdOpt.setOnAction(e -> {\n\t\t\t\tMonopolyClient.rollDice();\n\t\t\t\tMonopolyClient.toInterruptInterrupt();\n\t\t\t});\n\t\t\tHBox dices = new HBox(10);\n\t\t\tdices.setAlignment(Pos.CENTER);\n\t\t\tVBox dice1 = new VBox(10);\n\t\t\tVBox dice2 = new VBox(10);\n\t\t\tLabel header1 = new Label(\"Würfel\");\n\t\t\tLabel header2 = new Label(\"Pasch\");\n\t\t\tLabel diceNumber1 = new Label();\n\t\t\tLabel diceNumber2 = new Label();\n\t\t\tdice1.getChildren().addAll(header1, diceNumber1);\n\t\t\tdice2.getChildren().addAll(header2, diceNumber2);\n\t\t\tdices.getChildren().addAll(dice1, dice2);\n\t\t\tlayout = new VBox(10);\n\t\t\tlayout.setPadding(new Insets(10, 10, 10, 10));\n\t\t\tlayout.getChildren().addAll(header, firstOpt, secondOpt, thirdOpt, dices);\n\t\t\tlayout.setAlignment(Pos.CENTER);\n\t\t\tScene scene = new Scene(layout);\n\t\t\troundWindow.setScene(scene);\n\t\t\troundWindow.showAndWait();\n\n\t\t} else {\n\t\t\tHBox dices = new HBox(10);\n\t\t\tdices.setAlignment(Pos.CENTER);\n\t\t\tVBox dice1 = new VBox(10);\n\t\t\tVBox dice2 = new VBox(10);\n\t\t\tLabel header1 = new Label(\"Augenzahl\");\n\t\t\tLabel header2 = new Label(\"Pasch\");\n\t\t\tLabel diceNumber1 = new Label();\n\t\t\tLabel diceNumber2 = new Label();\n\t\t\tdice1.getChildren().addAll(header1, diceNumber1);\n\t\t\tdice2.getChildren().addAll(header2, diceNumber2);\n\t\t\tdices.getChildren().addAll(dice1, dice2);\n\t\t\tButton rollDice = new Button(\"Würfeln\");\n\t\t\trollDice.setOnAction(e -> { // send message to Server to roll Dice\n\t\t\t\tMonopolyClient.rollDice();\n\t\t\t\tMonopolyClient.toInterruptInterrupt();\n\t\t\t});\n\t\t\tlayout = new VBox(10);\n\t\t\tlayout.setPadding(new Insets(10, 10, 10, 10));\n\t\t\tlayout.getChildren().addAll(dices, rollDice);\n\t\t\tlayout.setAlignment(Pos.CENTER);\n\t\t\tScene scene = new Scene(layout);\n\t\t\troundWindow.setScene(scene);\n\n\t\t\troundWindow.showAndWait();\n\t\t}\n\t}", "public static int numberOfRounds() {\n System.out.print(\"Entrez le nombre de rounds de cette partie : \");\n while (true) {\n try {\n int rounds = new Scanner(System.in).nextInt();\n if (rounds > 0) return rounds;\n } catch (Exception ignored) {\n }\n System.out.println(\"Entrez un entier supérieur à 0 : \");\n }\n }", "private List<Integer> getLstRunnerIds(InflatedMarketPrices thisMarket) {\n\t\tList<Integer> lstRunnerIds = new ArrayList<Integer>();\r\n\t\tfor (InflatedRunner thisRunner : thisMarket.getRunners()) {\r\n\t\t\tlstRunnerIds.add(thisRunner.getSelectionId());\r\n\t\t}\r\n\t\tCollections.sort(lstRunnerIds);\r\n\t\treturn lstRunnerIds;\r\n\t}", "public void setRoundsWon(byte roundsWon){ this.roundsWon=roundsWon; }", "@Override\r\n\tpublic void setRound(int round) {\n\t\tthis.round = \"Round: \"+round;\r\n\t\tupdate();\r\n\t}", "public void playRound(){\n\t\tsetHumanThrow(humanType); \n\t\tsetCompThrow();\n\t\tSystem.out.println(\"Your Throw: \" + humanThrow.getThrowType());\n\t\tSystem.out.println(\"The Computer's Throw: \" + compThrow.getThrowType());\n\t\tRound current = new Round(humanThrow, compThrow);\n\t\tthisGame.updateScores(current);\n\t\tSystem.out.println(current.getRoundSummary());\n\t\tif(thisGame.getRoundNumber() < totalRounds){\n\t\t\tplayRound();\n\t\t}\n\t\telse{\n\t\t\tendGame();\n\t\t}\n\t}", "public void setGameRound(boolean gameRound){\n this.gameRound = gameRound;\n }", "public void playRound(){\n this.gameState = GameController.createGameState(this.game);\n \n // Verifica se o \n if(this.gameState.isEnded()){\n var winner = this.gameState.getPlayerQttCards() == 0 ? this.game.getComputer() : this.game.getPlayer();\n\n this.gameState.setWinner(winner);\n }\n else{\n \n // Mostrando o vira, as manilhas, a quantidade de cartas dos jogadores e as cartas do jogador\n this.view.displayGame(this.gameState);\n\n var playerCardChose = this.getPlayerCardChose();\n var computerCardChose = Utils.generateRandomNumber(getGameState().getComputerQttCards());\n\n try{\n var playerCard = this.game.getPlayer().playCard(playerCardChose);\n var computerCard = this.game.getComputer().playCard(computerCardChose);\n\n var winnerCard = this.verifyBiggerCard(playerCard, computerCard);\n\n // Verificando qual `Player` ganhou e se um ganhou\n\n var hasPlayerWon = winnerCard.equals(playerCard);\n var hasComputerWon = winnerCard.equals(computerCard);\n\n var turnedCard = this.getGameState().getTurnedCard();\n\n // Aqui caso o player tenha ganhado ele recebe a carta do computador e senão ele perde a carta para o computador\n if(hasPlayerWon){\n this.game.getPlayer().earnCard(computerCard);\n this.game.getComputer().loseCard(computerCard);\n }\n else if(hasComputerWon){\n this.game.getComputer().earnCard(playerCard);\n this.game.getPlayer().loseCard(playerCard);\n }\n \n // Na hora de mostrar o vencedor eu verifico se um player venceu, se sim eu mostro vitória ou derrota para o Player\n // Se não eu mostro empate\n \n if(hasComputerWon || hasPlayerWon){\n this.view.displayRoundWinner(turnedCard, playerCard, computerCard, hasPlayerWon);\n }\n else {\n this.view.displayRoundWinner(turnedCard, playerCard, computerCard);\n }\n\n }\n catch(Exception excp){\n this.view.displayMessageError(excp.getMessage());\n\n this.playRound();\n }\n }\n \n }", "public void executeRound(int round) {\n subBytes(stateMatrix);\n// System.out.println(\"after subBytes:\");\n// printMatrix(stateMatrix);\n\n ShiftRows(stateMatrix);\n// System.out.println(\"after shiftRows:\");\n// printMatrix(stateMatrix);\n\n MixColumns(stateMatrix);\n// System.out.println(\"after mixColumns:\");\n// printMatrix(stateMatrix);\n\n AddRoundKey(stateMatrix, getKeysForRound(round));\n// System.out.println(\"after addRound:\");\n// printMatrix(stateMatrix);\n }", "public ArrayList<int[]> getRoundHistory()\n {\n return this.roundHistory;\n }", "public static ArrayList<Double> rounding(){\r\n roundQuestion = new ArrayList<Double>();\r\n for (int k=0;k<12;k++){\r\n Double rand = randomDecimal();\r\n roundQuestion.add(rand);\r\n }\r\n return roundQuestion;\r\n }", "private ChesspairingRound getRound(int roundNumber) {\n\t\tList<ChesspairingRound> rounds = mTournament.getRounds();\n\t\tfor (ChesspairingRound round : rounds) {\n\t\t\tif (round.getRoundNumber() == roundNumber) {\n\t\t\t\treturn round;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalStateException(\n\t\t\t\t\"Tournament in inconsistent state! Not able to find roundNumber = \" + roundNumber);\n\t}", "public Round getRound(){\n return mRound;\n }", "public void load(){\n gameRounds = 0;\n mRound = new Round(players);\n mRound.loadRound();\n }", "public Round() {\n\t\tthis.niceMoves = null;\n\t\tthis.roundNo = 1;\n\t}", "public int calculateRounds(int numberOfPlayers) {\n //logarithm to find how many 2s to multiply to get numberOfPlayers 32 players (2 x 2 x 2 x 2 x 2 = 32) = 5 Rounds\n return (int) (Math.log(numberOfPlayers) / Math.log(2));\n }", "public Collection<Die> getDice(int round){\n return new ArrayList<>(dice.get(round-1));\n }", "public boolean nextRound() {\n if (numberOfRounds > playedRounds) {\n return true;\n }\n return false;\n }", "public void setNRounds(long nRounds) {\n cSetNRounds(this.cObject, nRounds);\n }", "public String wantPlayGame(int[][] payoffs, int roundTotal){\n\tcurRound=0;\n\tthis.roundTotal = roundTotal;\n\tprintString=getWelcomeScreen()+\"\\n\\n\";\n\tp1.setPayoffsAndTurns(payoffs[0][0],payoffs[1][0],payoffs[2][0],payoffs[3][0],roundTotal);\n\tp2.setPayoffsAndTurns(payoffs[0][1],payoffs[2][1],payoffs[1][1],payoffs[3][1],roundTotal);\n\tprintString+=\"------Player Rulesets------\\n\";\n\tprintString+=rulesNiceAndTidy(true);\n\tprintString+=rulesNiceAndTidy(false);\n\tprintString+=\"---------------------------\\n\\n\";\n\twhile (curRound<roundTotal){\n\t p1move = p1.nextMove(); //gets move for both players\n\t p2move = p2.nextMove();\n\t p1choice = (p1move==true?0:1); //gets index to assign points\n\t p2choice = (p2move==true?0:1);\n\t p1.yourReward(p1choice,p2choice); //gives them their rewaaaarrhhdd (this is a crucial Aladdin reference)\n\t p2.yourReward(p2choice,p1choice);\n\t curRound++;\t\t\t\t\t\t\t\t//increments the round\n\t p1.andSoItGoes(p1move,p2move,curRound); //updates histories and rounds of players\n\t p2.andSoItGoes(p2move,p1move,curRound);\n\t printString+=getMoveData(0)+\"\\n\\n\";\n\t}\n\tprintString+=\"\\n\\n\"+getWinner();\n\tprintDataToFile();\n\treturn getWinner();\n }", "public String runPostSeason()\n {\n String westernChamp = \"\";\n\n int r = new Random().nextInt(1 + 1);\n\n\n\n //First Round\n\n for(int i = 0; i < 4; i++)\n {\n b.setFirstRoundWest(i,0,playoffs[i]);\n b.setFirstRoundWest(i,1,playoffs[7 - i]);\n }\n\n\n //Second Round\n for(int i = 0; i < 2; i++)\n {\n for(int j = 0; j < 8; j++) {\n if (winningTeam(b.getFirstRoundWest()[i][0], b.getFirstRoundWest()[i][1]).equals(b.getFirstRoundWest()[i][0]))\n {\n firstRoundRecords[i][0] += 1;\n }\n else\n {\n firstRoundRecords[i][1] += 1;\n }\n\n if (firstRoundRecords[i][0] >= 4)\n {\n b.setSecondRoundWest(0, i, b.getFirstRoundWest()[i][0]);\n break;\n }\n else if (firstRoundRecords[i][1] >= 4)\n {\n b.setSecondRoundWest(0, i, b.getFirstRoundWest()[i][1]);\n break;\n }\n }\n\n for(int j = 0; j < 8; j++) {\n if (winningTeam(b.getFirstRoundWest()[i+2][0], b.getFirstRoundWest()[i+2][1]).equals(b.getFirstRoundWest()[i+2][0]))\n {\n firstRoundRecords[i+2][0] += 1;\n }\n else\n {\n firstRoundRecords[i+2][1] += 1;\n }\n\n if (firstRoundRecords[i+2][0] >= 4)\n {\n b.setSecondRoundWest(1, i, b.getFirstRoundWest()[i+2][0]);\n break;\n }\n else if (firstRoundRecords[i+2][1] >= 4)\n {\n b.setSecondRoundWest(1, i, b.getFirstRoundWest()[i+2][1]);\n break;\n }\n }\n }\n\n //Third Round\n for(int i = 0; i < 2; i++)\n {\n for(int j = 0; j < 8; j++)\n {\n if (winningTeam(b.getSecondRoundWest()[i][0], b.getSecondRoundWest()[i][1]).equals(b.getSecondRoundWest()[i][0]))\n {\n secondRoundRecords[i][0] += 1;\n }\n else\n {\n secondRoundRecords[i][1] += 1;\n }\n\n\n if (secondRoundRecords[i][0] >= 4)\n {\n b.setThirdRoundWest(i, b.getSecondRoundWest()[i][0]);\n break;\n }\n else if (secondRoundRecords[i][1] >= 4)\n {\n b.setThirdRoundWest(i, b.getSecondRoundWest()[i][1]);\n break;\n }\n }\n\n }\n\n //Finals Western Team\n for(int i = 0; i < 8; i++)\n {\n if (winningTeam(b.getThirdRoundWest()[0],b.getThirdRoundWest()[1]).equals(b.getThirdRoundWest()[0]))\n {\n westFinalsRecord[0] += 1;\n }\n else\n {\n westFinalsRecord[1] += 1;\n }\n\n\n if (westFinalsRecord[0] >= 4)\n {\n westernChamp = b.getThirdRoundWest()[0];\n break;\n }\n else if (westFinalsRecord[1] >= 4)\n {\n westernChamp = b.getThirdRoundWest()[1];\n break;\n }\n\n }\n\n return westernChamp;\n }", "public int getRound() {\n return round;\n }", "public List<Player> getAvailablePlayers(Round round) {\r\n\t\tList<Player> availablePlayers = playerLogic.createNew(round.getPlayers());\r\n\r\n\t\tfor (Match match : round.getMatches()) {\r\n\t\t\tavailablePlayers.removeAll(match.getHomeTeam());\r\n\t\t\tavailablePlayers.removeAll(match.getAwayTeam());\r\n\t\t}\r\n\t\treturn availablePlayers;\r\n\t}", "private ArrayList<int[]> selectionRank(int[][] chromosomes, float percentToSelect) {\n\n\t\tArrayList<int[]> selectedChromosomes = new ArrayList<int[]>();\n\n\t\t//get fitnesses and ranks of chromosomes, save in array to avoid recalculating\n\t\tint[] fitnesses = new int[chromosomes.length];\n\t\tArrayList<Integer> ranks = new ArrayList<Integer>(); //holds indices of chromosomes, position in arraylist indicates rank\n\n\t\tfor (int i = 0; i < chromosomes.length; i++) { //set up list of fitnesses and ranks\n\t\t\tfitnesses[i] = getFitness(chromosomes[i]);\n\n\n\t\t\tboolean added = false;\n\t\t\tfor (int keyIndex = 0; keyIndex < ranks.size(); keyIndex++) { //only search the second half\n\t\t\t\tif (fitnesses[ranks.get(keyIndex)] > fitnesses[i]) { //if this one is worse\n\t\t\t\t\tranks.add(keyIndex, i); //inverted rank\n\t\t\t\t\tadded = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!added) {\n\t\t\t\tranks.add(i);\n\t\t\t}\n\n\t\t}// end fitness ranking (low fitness is best, last index is worst)\n\n\n\t\t//spin the roulette wheel\n\t\tfor (int i = 0; i < chromosomes.length * percentToSelect; i++) {\n\t\t\tint currentFitnessTotal = 0;\n\t\t\tint fitSelector = rand.nextInt(chromosomes.length); //where the wheel stops\n\t\t\tint fitnessCutoff = (fitSelector * (fitSelector + 1)) / 2;\n\n\t\t\tfor (int j = 0; j < ranks.size(); j++) { //go through all ranks to see who is selected this spin\n\t\t\t\tif (currentFitnessTotal < fitnessCutoff)\n\t\t\t\t\tcurrentFitnessTotal += chromosomes.length - ranks.get(j); //reorder fitness properly\n\n\t\t\t\tif (currentFitnessTotal >= fitnessCutoff) { //if this rank pushed us over the edge, save it\n\t\t\t\t\tselectedChromosomes.add(chromosomes[ranks.get(j)]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}//end roulette spinning\n\n\t\treturn selectedChromosomes;\n\t}", "public void updateRound() {\n\t\t//System.out.println(\" Updating the round...\");\n\t\tif (loads.size() < 1)\n\t\t\treturn;\n\n\t\tArrayList<AidLoad> tempLoads = new ArrayList<AidLoad>(loads);\n\n\t\tfor (int i = 1; i < tempLoads.size(); i++) {\n\t\t\tAidLoad p = tempLoads.get(i - 1);\n\t\t\tdouble dist = Double.MAX_VALUE;\n\t\t\tint best = -1;\n\n\t\t\tfor (int j = i; j < tempLoads.size(); j++) {\n\t\t\t\tAidLoad pj = tempLoads.get(j);\n\t\t\t\tdouble pjdist = pj.deliveryLocation.distance(p.deliveryLocation);\n\t\t\t\tif (pjdist < dist) {\n\t\t\t\t\tdist = pjdist;\n\t\t\t\t\tbest = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tAidLoad closestLoad = tempLoads.remove(best);\n\t\t\ttempLoads.add(i, closestLoad);\n\t\t}\n\t\tmyLoad = tempLoads;\n\t}", "public void haveGo(int roundsTaken)\n {\n int diceRolls = 0;\n boolean madeChoice = false;\n\n while(diceRolls <= 1){\n ArrayList<Integer> diceRoll = new ArrayList<Integer>();\n boolean firstMove = false;\n boolean secondMove = true;\n\n if(diceRolls == 0){\n //Roll dice cleanly and print related information\n System.out.println(\"\\n\\t--------------------------\\n\\t\" + this.name + \"'s Go!\\n\\t--------------------------\\n\\nRoll One...\");\n diceRoll = dice.cleanRoll();\n System.out.println(\"\\t\" + diceRoll + \"\\n\");\n\n }\n else if(diceRolls == 1)\n {\n //Roll dice based on previous preferences\n System.out.println(\"\\nRoll Two...\");\n diceRoll = dice.roll();\n System.out.println(\"\\t\" + diceRoll + \"\\n\");\n secondMove = false;\n firstMove = true;\n }\n //Make first action\n while(!firstMove)\n {\n boolean repeat = false;\n //Print Menu\n System.out.println(\"Available Actions:\");\n System.out.println(\"\\t--------------------------\");\n System.out.println(\"\\t0) Exit to Desktop\\n\\t1) Fill a Row\\n\\t2) Possible Scores\\n\\t3) Check Scorecard\\n\\t4) Clean Roll\");\n System.out.println(\"\\t--------------------------\\n\");\n System.out.println(\"Enter Choice...\");\n int choice = GameManager.makeValidChoice(-1,5);\n if(choice == 0)\n {\n //Update and send GameFinisher variables to save\n scorecard.update();\n scorer.update();\n gameFinisher.exitSequence(filename,name, diceRoll, saveString,roundsTaken, 1);\n }\n else if(choice == 3)\n {\n //Print Scorecard\n System.out.println(\"\\n*********************************************\\n\" + name + \"'s Scorecard\\n********************************************\");\n scorecard.printScorecard();\n repeat = true;\n }\n\n else if(choice == 4)\n {\n //Cleanly Roll Dice\n diceRolls++;\n firstMove = true;\n }\n else if(choice == 2)\n {\n //Print Possibilities\n scorer.printPossibilities(diceRoll, scorecard.getFreeCategories());\n repeat =true;\n }\n else if(choice == 1)\n {\n //Fill a Row\n boolean categoryUsed = true;\n while(categoryUsed)\n {\n System.out.println(\"\\nRow to Fill...\");\n int category = GameManager.makeValidChoice(-1,14);\n scorer.findPossibilities(diceRoll, scorecard.getFreeCategories());\n //Check category isnt already filled\n try{\n if(scorecard.getFreeCategories().contains(category)){\n int score = scorer.getScore(category);\n //Set row to be filled and add score\n scorecard.addCategory(category,score);\n madeChoice = true;\n categoryUsed = false;\n }\n else\n {\n System.out.println(\"Row is already filled. Please choose another...\");\n }\n } catch(NullPointerException e) \n {\n System.out.println(\"Program Crash: Free categories doesnt exist.\");\n }\n\n }\n diceRolls = 2;\n firstMove = true;\n secondMove = true;\n madeChoice = true;\n }\n else\n {\n System.out.println(\"Something's gone very wrong, you shouldn't be here...\");\n repeat = true;\n }\n if(repeat){\n if(diceRolls == 0){\n System.out.println(\"Roll One...\");\n System.out.println(\"\\t\" + diceRoll + \"\\n\");\n }\n else if(diceRolls == 1)\n {\n System.out.println(\"Roll Two...\");\n System.out.println(\"\\t\" + diceRoll + \"\\n\");\n }\n }\n }\n\n while(!secondMove)\n {\n boolean repeat = false;\n //Print Menu \n System.out.println(\"Available Actions:\");\n System.out.println(\"\\t--------------\");\n System.out.println(\"\\t0) Exit to Desktop\\n\\t1) Fill a Row\\n\\t2) Possible Scores\\n\\t3) Check Scorecard\\n\\t4) Clean Roll\\n\\t5) Hold and Roll Dice\");\n System.out.println(\"\\t--------------\\n\");\n System.out.println(\"Enter Choice...\");\n\n int choice = GameManager.makeValidChoice(-1,6);\n\n if(choice == 0)\n {\n //Update and send GameFinisher variables to save\n gameFinisher.exitSequence(filename, name, diceRoll, saveString,roundsTaken, 2);\n }\n else if(choice == 3)\n {\n //Print Scorecard\n System.out.println(\"\\n********************************************\\n\" + name + \"'s Scorecard\\n********************************************\");\n scorecard.printScorecard();\n repeat = true;\n }\n else if(choice == 5)\n {\n //Get Holdings preferences from Player\n System.out.println(\"\\n\\t--------------------------\");\n System.out.println(\"\\tDice Holder\\n\\t-----\\n\\t[0) Leave [1) Hold\");\n System.out.println(\"\\t--------------------------\\n\");\n System.out.println(diceRoll);\n System.out.println(\"---------------\");\n System.out.print(\"[\" + diceRoll.get(0) + \"]\");\n boolean one = toHold();\n System.out.print(\"[\" + diceRoll.get(1) + \"]\");\n boolean two = toHold();\n System.out.print(\"[\" + diceRoll.get(2) + \"]\");\n boolean three = toHold();\n System.out.print(\"[\" + diceRoll.get(3) + \"]\");\n boolean four = toHold();\n System.out.print(\"[\" + diceRoll.get(4) + \"]\");\n boolean five = toHold();\n //Send Preferences to Dice()\n ArrayList<Boolean> newState = new ArrayList<Boolean>();\n newState.add(one);\n newState.add(two);\n newState.add(three);\n newState.add(four);\n newState.add(five);\n dice.setDiceHoldState(newState);\n System.out.println(\"\\n\\t--------------------------\\n\\tDice Held\\n\\t-----\\n\\tRolling Dice...\\n\\t--------------------------\");\n diceRolls++;\n secondMove = true;\n }\n else if(choice == 4)\n {\n //Cleanly Roll Dice\n diceRolls++;\n secondMove = true;\n madeChoice = false;\n }\n else if(choice == 2)\n {\n //Print Possibilities\n scorer.printPossibilities(diceRoll, scorecard.getFreeCategories());\n repeat =true;\n }\n else if(choice == 1)\n {\n //Fill a Row\n boolean categoryUsed = true;\n while(categoryUsed)\n {\n System.out.println(\"What row would you like to fill?\");\n int category = GameManager.makeValidChoice(-1,14);\n //Check category isnt already filled\n try{\n if(scorecard.getFreeCategories().contains(category)){\n int score = scorer.getScore(category);\n //Set row to be filled and add score\n scorecard.addCategory(category,score);\n madeChoice = true;\n categoryUsed = false;\n }\n else\n {\n System.out.println(\"Row is already filled. Please choose another...\");\n }\n } catch(NullPointerException e) {\n System.out.println(\"Program Crash: Free categories doesnt exist.\");\n }\n }\n diceRolls = 2;\n repeat = false;\n secondMove = true;\n madeChoice = true;\n }\n else\n {\n System.out.println(\"Something's gone very wrong, you shouldn't be here...\");\n repeat = true;\n }\n\n if(repeat){\n if(diceRolls == 0){\n System.out.println(\"Roll One...\");\n System.out.println(\"\\t\" + diceRoll + \"\\n\");\n }\n else if(diceRolls == 1)\n {\n System.out.println(\"Roll Two...\");\n System.out.println(\"\\t\" + diceRoll + \"\\n\");\n }\n\n }\n }\n }\n ArrayList<Integer> diceRoll = dice.roll(); \n while(!madeChoice)\n {\n System.out.println(\"\\nFinal Roll...\");\n System.out.println(\"\\t\" + diceRoll + \"\\n\");\n //Print Menu\n System.out.println(\"Available Actions:\");\n System.out.println(\"\\t--------------------------\");\n System.out.println(\"\\t0) Exit to Desktop\\n\\t1) Fill a Row\\n\\t2) Possible Scores\\n\\t3) Check Scorecard\");\n System.out.println(\"\\t--------------------------\");\n System.out.println(\"Enter Choice...\");\n int choice = GameManager.makeValidChoice(-1,4);\n if(choice == 0)\n {\n //Update and send GameFinisher variables to save\n gameFinisher.exitSequence(filename, name, diceRoll, saveString, roundsTaken, 3);\n }\n else if(choice == 3)\n {\n //Print Scorecard\n System.out.println(\"\\n********************************************\\n\" + name + \"'s Scorecard\\n********************************************\");\n scorecard.printScorecard();\n }\n\n else if(choice == 2)\n {\n //Print Possibilities\n scorer.printPossibilities(diceRoll, scorecard.getFreeCategories());\n }\n else if(choice == 1)\n {\n //Fill a Row\n boolean categoryUsed = true;\n while(categoryUsed)\n {\n System.out.println(\"What row would you like to fill?\");\n int category = GameManager.makeValidChoice(-1,14);\n //Check category isnt already filled\n try{\n if(scorecard.getFreeCategories().contains(category)){\n int score = scorer.getScore(category);\n //Set row to be filled and add score\n scorecard.addCategory(category,score);\n madeChoice = true;\n categoryUsed = false;\n }\n else\n {\n System.out.println(\"Row is already filled. Please choose another...\");\n }\n } catch(NullPointerException e) {\n System.out.println(\"Program Crash: Free categories doesnt exist.\");\n }\n }\n }\n }\n }", "public static void StartNewRound () {\n System.out.println(\"The game \" + (rounds == 0 ? \"begins!\" : \"continues...\"));\r\n System.out.println(\"===============================================\");\r\n\r\n // GENERATE A NEW NUMBER\r\n SetNewNumber();\r\n\r\n // RESET PICKED ARRAY\r\n ResetPickedNumbers();\r\n }", "public void todoThread() {\n\t\twhile (true) {\n\t\t\tnumberOfSubRounds = cardsToDealPerRound[round - 1];\n\t\t\tdisplaySubRoundUI();\n\n\t\t\t/* checks if a subround is completed */\n\t\t\tif (completeSubRound()) {\n\t\t\t\t/* execute calculations for trick winner and clean up after the subround */\n\t\t\t\tfinishSubRound();\n\n\t\t\t\t/* clears the lead suit and displays the cards left */\n\t\t\t\tgameLogic.setLeadSuitCard(null);\n\t\t\t\tclearLeadUI();\n\t\t\t\tdisplayTableHandUI();\n\t\t\t\tdisplayCardUI();\n\n\t\t\t\troundCounter++;\n\n\t\t\t\t/* checks if round is completed */\n\t\t\t\tif (completeRound()) {\n\n\t\t\t\t\t/* updates number of tricks won for the UI */\n\t\t\t\t\troundBidsWon = 0;\n\t\t\t\t\troundBidsWon1 = 0;\n\t\t\t\t\troundBidsWon2 = 0;\n\t\t\t\t\troundBidsWon3 = 0;\n\n\t\t\t\t\t/* updates the scoreboard */\n\t\t\t\t\tupdateScoreUI();\n \t\tSystem.out.println(gameLogic.getScoreboard().getTotalScore());\n \t\tint[] winner = gameLogic.getScoreboard().getWinner(round);\n\n\t\t\t\t\t/* check if game is completed */\n \t\tif (completeGame(winner)){\n \t\t\tJOptionPane.showMessageDialog(new JFrame(), \"THE GRAND WINNER IS Player \" + winner[0] + \" with \" + winner[1] + \" POINTS!!!!\", \"Info\",\n JOptionPane.INFORMATION_MESSAGE);\n \t\t\tMainMenuUI.main(null);\n \t\t\treturn;\n \t\t} else {\n \t\t\tnewRound();\n \t\t}\n \t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* continues playing logic */\n\t\t\tif (waitingUser) {\n\t\t\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PLAYER'S TURN~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\tdrawNoti(\"Your turn\");\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~COMPUTER'S TURN~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\tdrawNoti(\"...\");\n\t\t\t\tplaySubRound(-1);\n\t\t\t\tdisplayTableHandUI();\n\n\t\t\t\tif (waitingUser()) {\n\t\t\t\t\tdisplayTableHandUI();\n\t\t\t\t\tdisplayCardUI();\n\t\t\t\t\twaitingUser = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void logRoundWinner(Player player, int round){\n\t\tif(player instanceof HumanPlayer)\n\t\t\tlog += String.format(\"%nUSER WINS ROUND %d\", round);\n\t\telse\n\t\t{\n\t\t\tAIPlayer ai = (AIPlayer) player;\n\t\t\tlog += String.format(\"%n%s WINS ROUND %d\", ai.getName().toUpperCase(), round);\n\t\t\tString win = ai.getName();\n\t\t\tif(win.equals(\"ai player1\"))\n\t\t\t{\n\t\t\t\troundWins[1]=roundWins[1]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player2\"))\n\t\t\t{\n\t\t\t\troundWins[2]=roundWins[2]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player3\"))\n\t\t\t{\n\t\t\t\troundWins[3]=roundWins[3]+1;\n\t\t\t}\n\t\t\telse if(win.equals(\"ai player4\"))\n\t\t\t{\n\t\t\t\troundWins[4]=roundWins[4]+1;\n\t\t\t}\n\t\t\t/*switch(win)\n\t\t\t{\n\t\t\tcase \"ai player1\":{\n\t\t\t\troundWins[1]=roundWins[1]+1;\n\t\t\t}\n\t\t\tcase \"ai player2\":{\n\t\t\t\troundWins[2]=roundWins[2]+1;\n\t\t\t}\n\t\t\tcase \"ai player3\":{\n\t\t\t\troundWins[3]=roundWins[3]+1;\n\t\t\t}\n\t\t\tcase \"ai player4\":{\n\t\t\t\troundWins[4]=roundWins[4]+1;\n\t\t\t}\n\t\t\t}*/\n\t\t}\n\t\tlineBreak();\n\t}", "public void addRound(ArrayList<Move> round) {\r\n\t\tfor (Move move : round) {\r\n\t\t\tadd(move);\r\n\t\t}\r\n\r\n\t\tint lastIndex = offsets.size() - 1;\r\n\t\toffsets.add(round.size() + offsets.get(lastIndex)); // accumulate the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// index\r\n\t}", "public void startRound(int round) {\n\t\tif (round != 1) {\n\t\t\tSystem.out.println(\" Vous avez effectuez votre : \" + round + \" ème attaques\\n\");\n\t\t} else {\n\t\t\tSystem.out.println(\" Vous avez effectuez votre : \" + round + \" ère attaque\\n\");\n\t\t}\n\n\t}", "private void loadPlayersIntoQueueOfTurns() {\n if(roundNumber == 1) eventListener.addEventObject(new RoundEvent(EventNamesConstants.GameStarted));\n if(gameDescriptor.getPlayersList() != null) {\n playersTurns.addAll(gameDescriptor.getPlayersList());\n }\n else\n System.out.println(\"NULL\");\n }", "public void displayRoundScore() {\n\n System.out.println(\"Round stats: \");\n System.out.println(\"Par: \" + parTotal);\n System.out.println(\"Strokes: \" + strokesTotal);\n\n if(strokesTotal > parTotal) {\n System.out.println(strokesTotal-parTotal + \" over par\\n\");\n } \n else if (strokesTotal < parTotal) {\n System.out.println(parTotal-strokesTotal + \" under par\\n\");\n }\n else {\n System.out.println(\"Making par\\n\");\n }\n }", "private boolean canIGenerateNextRound() {\n\t\tint totalRounds = mTournament.getTotalRounds();\n\t\tint currentRouns = mTournament.getRounds().size();\n\n\t\tList<Integer> roundNumbers = new ArrayList<>();\n\t\tfor (ChesspairingRound round : mTournament.getRounds()) {\n\t\t\tif (roundNumbers.contains(round.getRoundNumber())) {\n\t\t\t\t// you have 2 rounds with the same id\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\troundNumbers.add(round.getRoundNumber());\n\t\t}\n\n\t\tif (currentRouns < totalRounds) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "void computeResult() {\n // Get the winner (null if draw).\n roundWinner = compareTopCards();\n\n\n if (roundWinner == null) {\n logger.log(\"Round winner: Draw\");\n logger.log(divider);\n // Increment statistic.\n numDraws++;\n\n } else {\n logger.log(\"Round winner: \" + roundWinner.getName());\n\t logger.log(divider);\n this.gameWinner = roundWinner;\n if (roundWinner.getIsHuman()) {\n // Increment statistic.\n humanWonRounds++;\n }\n }\n\n setGameState(GameState.ROUND_RESULT_COMPUTED);\n }", "public List<Integer> getWinTurns(Predicate<GameResult> filter) {\n return results.stream()\n .filter(filter)\n .map(GameResult::getEndTurn)\n .distinct()\n .sorted()\n .collect(Collectors.toList());\n }", "public int[] getSelectedRows() {\n ArrayList tmp = new ArrayList(NUMBER_OF_GAMES);\n\n for (int i = 0; i < NUMBER_OF_GAMES; i++) {\n if (singleSystem[i] != 0) {\n tmp.add(new Integer(singleSystem[i]));\n }\n }\n\n // fix upp return value, e.g as a int[].\n int size = tmp.size();\n int[] returnValue = new int[size];\n\n for (int i = 0; i < size; i++) {\n returnValue[i] = ((Integer) tmp.get(i)).intValue();\n }\n\n return returnValue;\n }", "protected List<Score> getScoresToDisplay(){\n boolean allUsers = btnUser.getText() == btnUser.getTextOff();\n Integer selectedOption = gameOptions.get(spinGameOptions.getSelectedItem().toString());\n String fileName = Board.getHighScoreFile(Game.SLIDING_TILES, selectedOption);\n return allUsers?\n GameScoreboard.getScores(this, fileName, Board.getComparator()) :\n GameScoreboard.getScoresByUser(this, fileName, user, Board.getComparator());\n }", "@Override\n\tpublic void onRoundStarted(RoundStartedEvent event) {\n\t\tsuper.onRoundStarted(event);\n\t}", "private int getNumberOfRounds(int changingAxiomsCount) {\n\t\treturn Math.min(maxRounds_,\n\t\t\t\t2 * (31 - Integer.numberOfLeadingZeros(changingAxiomsCount)));\n\t}", "public int getRound()\r\n\t{\r\n\t\treturn this.round;\r\n\t}" ]
[ "0.56702876", "0.5629443", "0.557572", "0.5535272", "0.55350035", "0.54923815", "0.54827607", "0.5193189", "0.5156438", "0.51245177", "0.51239604", "0.511997", "0.51101667", "0.51079607", "0.5026324", "0.50006735", "0.49871776", "0.49856102", "0.4881916", "0.48806372", "0.48757386", "0.4868562", "0.48600438", "0.48583055", "0.4852239", "0.4827347", "0.47838646", "0.4767682", "0.47539404", "0.4744045", "0.47423247", "0.47288752", "0.46910906", "0.4686607", "0.46822506", "0.46779373", "0.46734005", "0.4669906", "0.46687764", "0.4651976", "0.4651468", "0.46442562", "0.46424857", "0.463507", "0.4632464", "0.46282595", "0.46228087", "0.46218765", "0.46079743", "0.45933646", "0.45876428", "0.45858902", "0.45835462", "0.45715657", "0.45688108", "0.45545325", "0.45487055", "0.45448825", "0.4533084", "0.4529684", "0.4528374", "0.45173064", "0.45134833", "0.4512063", "0.45068505", "0.45046693", "0.45027167", "0.45023304", "0.44804296", "0.44768405", "0.446399", "0.44593352", "0.4451567", "0.4443923", "0.44428465", "0.44409952", "0.44347197", "0.4426144", "0.4425341", "0.44205433", "0.4419749", "0.44177973", "0.44008318", "0.43950984", "0.43897083", "0.43884763", "0.4386361", "0.4379247", "0.4366394", "0.4359241", "0.43563285", "0.4352989", "0.4346836", "0.4343681", "0.4342687", "0.4342493", "0.43375236", "0.4334041", "0.4332012", "0.43171144" ]
0.68715703
0
/ This function is run when the user presses the 'Unload'button on the 'Admin'form of the tournament scheduler. It makes sure that the scheduler will clear the list with running rounds.
public void unloadRounds () { log.info("Unloading Rounds"); Scheduler scheduler = Scheduler.getScheduler(); scheduler.unloadRounds(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void removeFromSavedScheduleList() {\n if (!yesNoQuestion(\"This will print every schedule, are you sure? \")) {\n return;\n }\n\n showAllSchedules(scheduleList.getScheduleList());\n\n System.out.println(\"What is the number of the one you want to remove?\");\n int removeIndex = obtainIntSafely(1, scheduleList.getScheduleList().size(), \"Number out of bounds\");\n scheduleList.getScheduleList().remove(removeIndex - 1);\n System.out.println(\"Removed!\");\n }", "public static void clearWinners(){winners.clear();}", "public void unload() {\n this.currentRooms.clear();\n // Zero the info panel.\n this.roomNameField.setText(\"\");\n this.includeField.setText(\"\");\n this.inheritField.setText(\"\");\n this.streetNameField.setSelectedIndex(0);\n this.determinateField.setText(\"\");\n this.lightField.setText(\"\");\n this.shortDescriptionField.setText(\"\");\n this.longDescriptionField.setText(\"\");\n this.exitPanel.removeAll();\n }", "public void clearGameList() {\n gameJList.removeAll();\n }", "public void endOfRoundUpdates() {\n roundsHistory.push(new RoundHistory(gameDescriptor,++roundNumber));\n loadPlayersIntoQueueOfTurns();\n //activateEventsHandler();\n }", "private void shutdownWatchListTimers()\r\n {\r\n debug(\"shutdownWatchListTimers() all timers\");\r\n // Null our our parser, It is not needed now.\r\n if (populateListVector == null)\r\n {\r\n return;\r\n }\r\n // Stop All of our timers.\r\n for (int i = 0; i < populateListVector.size(); i++)\r\n {\r\n PopulateWatchListTask task = (PopulateWatchListTask) populateListVector.elementAt(i);\r\n task.cancel();\r\n this.setStatusBar(\"WatchList [\" + tabPane.getTitleAt(i) + \"] - Stopped.\");\r\n debug(\"WatchList [\" + tabPane.getTitleAt(i) + \"] - Stopped.\");\r\n }\r\n // Clear all objects from the Timer List\r\n populateListVector.removeAllElements();\r\n populateListVector = null;\r\n // Signal the Garbage Collector to reclaim anything it may see neccessary\r\n System.gc();\r\n debug(\"shutdownWatchListTimers() all timers - complete\");\r\n }", "public synchronized void resetSchedules() {\n schedules = null;\n }", "@FXML\n public void clearPlanner(){\n\n String confirmationBoxTitle = \"Clear Planner\";\n String confirmationMessage = \"Are you sure you want to clear the planner?\";\n\n //If the user confirms to clear the planner from the dialog box\n if (plannerBox.confirmDiaglogBox(confirmationBoxTitle, confirmationMessage)){\n for (Days dm : weekList.getItems()){\n dm.setBreakfast(null);\n dm.setLunch(null);\n dm.setDinner(null);\n }\n breakfastCombo.getSelectionModel().clearSelection();\n lunchCombo.getSelectionModel().clearSelection();\n dinnerCombo.getSelectionModel().clearSelection();\n weekList.refresh();\n\n //if the shopping List is greater than 0 then the cleared planner will not be synced to the shopping List\n if (shoppingListIngredients.size() > 0){\n plannerOutOfSyncWithShoppingList(true);\n } else {\n plannerOutOfSyncWithShoppingList(false);\n }\n\n saveMealPlanner();\n }\n\n }", "@FXML\n public void clearLunchPlanner(){\n //get the day selection\n Days selectedDay = weekList.getSelectionModel().getSelectedItem();\n if (selectedDay != null){\n selectedDay.setLunch(null);\n lunchCombo.getSelectionModel().clearSelection();\n weekList.refresh();\n } else {\n System.out.println(\"No Day Selection made\");\n }\n //shopping list is now out of sync with the planner\n plannerOutOfSyncWithShoppingList(true);\n saveMealPlanner();\n }", "@FXML\n public void clearBreakfastPlanner(){\n //get the day selection\n Days selectedDay = weekList.getSelectionModel().getSelectedItem();\n if (selectedDay != null){\n selectedDay.setBreakfast(null);\n breakfastCombo.getSelectionModel().clearSelection();\n weekList.refresh();\n } else {\n System.out.println(\"No Day Selection made\");\n }\n //shopping list is now out of sync with the planner\n plannerOutOfSyncWithShoppingList(true);\n saveMealPlanner();\n }", "public static void exitScheduledClear() {\n stopAutoClear();\n }", "private CommandResult clearAllLessons() {\n timetable.clearTimetable();\n logger.log(Level.INFO, \"User has cleared timetable\");\n return new CommandResult(\"Timetable has been cleared completely\");\n }", "public void cmdClearGames(User teller) {\n tournamentService.clearSchedule();\n tournamentService.flush();\n command.qtell(teller, \" Okay, I''ve cleared the schedule. Tell me \\\"show\\\" to see.\");\n command.sendCommand(\"-notify *\");\n }", "public void unloadItems() {\n if (dishwasherState == State.ON) {\n throw new InvalidStateException(\"The washing cycle hasn't been run yet\");\n } else if (dishwasherState == State.RUNNING) {\n throw new InvalidStateException(\"Please wait until washing cycle is finished\");\n }\n items = 0;\n dishwasherState = State.ON;\n System.out.println(\"The dishwasher is ready to go\");\n }", "public static void deleteButtonActionPerformed(ActionEvent evt){\r\n yearField.setEditable(true);\r\n semesterChoice.setEnabled(true);\r\n mylist.empty();\r\n subjectCodes = new ArrayList<>();\r\n timeLabels = new ArrayList<>();\r\n schedulePanel.removeAll();\r\n schedulePanel.repaint();\r\n schedulePanel.add(monLabel);\r\n schedulePanel.add(tueLabel);\r\n schedulePanel.add(wedLabel);\r\n schedulePanel.add(thuLabel);\r\n schedulePanel.add(friLabel); \r\n }", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tBaseApplication.totalList.remove(this);\n\t}", "public static void deleteTimeButtonClicked() {\n ObservableList<Occasion> allTimes;\n allTimes = tableHoliday.getItems();\n Occasion occasion = tableHoliday.getSelectionModel().getSelectedItem();\n\n allTimes.remove(occasion);\n OccasionCommunication.removeOccasion(occasion.getId());\n }", "public void unload(){ \n load.unloadFirst(); \n }", "void unsetSchedule();", "public void clearTaskListRecNums() { taskListRecNums.clear(); }", "@Override\n public void RageQuit() {\n //They won't have a score\n timer.stopTimer();\n\n if (view.confirmRageQuit()){\n // Punish them!\n DesktopAudio.getInstance().playPunish();\n grid = game.getSolved();\n for (int i = 0; i < 9; i++){\n for (int j = 0; j < 9; j++){\n view.setGiven(i, j, grid.getNumber(i, j));\n }\n }\n if (view.confirmNewGame()){\n setNextGame();\n }\n }else{\n timer.startTimer();\n }\n }", "private void cleanSweep(){\n // Corrects the reminder dates for those reminders which will be repeating.\n refreshAllRepeatReminderDates();\n\n // Starts removing expired reminders.\n Calendar timeRightNow = Calendar.getInstance();\n boolean cleanList;\n for (int outerCounter=0; outerCounter<reminderItems.size();outerCounter++) {\n cleanList=true;\n for (int counter = 0; counter < reminderItems.size(); counter++) {\n int year = reminderItems.get(counter).getReminderYear();\n int month = reminderItems.get(counter).getReminderMonth();\n int day = reminderItems.get(counter).getReminderDay();\n int hour = reminderItems.get(counter).getReminderHour();\n int minute = reminderItems.get(counter).getReminderMinute();\n int second = 0;\n\n Calendar timeOfDeletion = Calendar.getInstance();\n timeOfDeletion.set(year, month, day, hour, minute, second);\n\n if (timeOfDeletion.before(timeRightNow)) {\n deleteReminderItem(counter);\n cleanList=false;\n break;\n }\n }\n if(cleanList){\n break;\n }\n }\n\n // Refreshes the reminder date descriptions (correcting \"Today\" and \"Tomorrow\" depending on the date).\n refreshAllDateDescriptions();\n }", "public abstract void unschedule();", "@Override\n\tpublic void redo() {\n\t\tfor (TAPNQuery q : queriesInclusion) {\n\t\t\tq.inclusionPlaces().removePlace(timedPlace);\n\t\t}\n\n\t\ttapn.remove(timedPlace);\n\t\tguiModel.removePetriNetObject(timedPlaceComponent);\n\t}", "public void endRound() {\n if (!myTurn()) {\n return;\n }\n if (this.board.getWinners().size() > 0 && this.playerId == board.getPlayers().get(board.getPlayers().size() - 1).playerId) {\n this.board.setRunning(false);\n }\n // currentPlayerNumber = (currentPlayerNumber + 1) % players.size();\n // current = players.get(currentPlayerNumber);\n this.removableBlockades = new ArrayList<>();\n coins = (float) 0;\n bought = false;\n specialAction.setDraw(0);\n specialAction.setRemove(0);\n specialAction.setSteal(0);\n history = new ArrayList<>();\n //for (int i = tmpDiscardPile.size(); i > 0; i--){\n // discardPile.add(tmpDiscardPile.remove(0));\n //}\n discardPile.addAll(tmpDiscardPile);\n tmpDiscardPile = new ArrayList<Card>();\n draw();\n board.endRound();\n }", "private void refreshList() {\n if (loadStepsTask != null) {\n loadStepsTask.cancel(false);\n }\n loadStepsTask = new LoadStepsTask(this, dbManager);\n loadStepsTask.execute();\n }", "public void unloaded(){\n\t\tloaded=false;\n\t}", "public void clearAppointments(){\n appointments.clear();\n }", "private void removeList()\r\n {\n if (tableCheckBinding != null)\r\n {\r\n tableCheckBinding.dispose();\r\n tableCheckBinding = null;\r\n }\r\n\r\n // m_TableViewer.setInput(null);\r\n WritableList newList = new WritableList(SWTObservables.getRealm(Display.getDefault()));\r\n for (int i = 0; i < 10; ++i)\r\n {\r\n newList.add(this.generateNewDataModelItem());\r\n }\r\n m_TableViewer.setInput(newList);\r\n }", "@FXML\n public void clearDinnerPlanner(){\n //get the day selection\n Days selectedDay = weekList.getSelectionModel().getSelectedItem();\n if (selectedDay != null){\n selectedDay.setDinner(null);\n dinnerCombo.getSelectionModel().clearSelection();\n weekList.refresh();\n } else {\n System.out.println(\"No Day Selection made\");\n }\n //shopping list is now out of sync with the planner\n plannerOutOfSyncWithShoppingList(true);\n saveMealPlanner();\n }", "private void destroyGameInstance() {\n // Destroy Game\n this.model.setPuzzle(null);\n this.model.setHintsUsed(0);\n this.model.getTimer().stop();\n this.model.setTimer(null);\n view.getGamePanel().getHintBtn().setEnabled(true);\n for (Cell cell : this.view.getGamePanel().getViewCellList()) {\n this.view.getGamePanel().getGrid().remove(cell);\n }\n }", "public void unloadDocument() {\n\t\tfor (int i=0; i<jtp.getTabCount()-1; i++) {\n\t\t\t((XCDisplay)jtp.getComponentAt(i)).unloadDocument();\n\t\t}\n\t\t//jtp.removeChangeListener(jtp.getChangeListeners()[0]);\n\t\t//jtp.removeAll();\n\t}", "public void unload() {\n releasePressureToReturn();\n releasePressureToShooter();\n latch(false);\n// reloaded = false;\n }", "public static void removeAllObservers() {\n compositeDisposable.clear();\n observersList.clear();\n Timber.i(\"This is the enter point: All live assets and team feed auto refresh DOs are removed\");\n }", "public void retourActionPerformed(java.awt.event.ActionEvent evt) throws IOException{ \n if(Games!=null){\n for(Game g:Games)\n g.stop=true;\n Games.clear();\n }\n welcomePage();\n }", "public void removeAllTime() {\r\n\t\tBase.removeAll(this.model, this.getResource(), TIME);\r\n\t}", "public void onUnload() {\n\t}", "private void resetGame() {\n rockList.clear();\n\n initializeGame();\n }", "public void clearTheGame() {\n players.clear();\n categories.clear();\n playedRounds = 0;\n indexOfActiveCategory = -1;\n indexOfActivePlayer = 0;\n numberOfRounds = 0;\n }", "void cancelStaleSimulations();", "public void unload() {\n plugin.getEngine().getWorldProvider().getHeartbeat().unsubscribe(WIND);\n plugin.getRootConfig().unsubscribe(TEMPERATURES);\n }", "@Override\n public void purgeFlows() {\n setOfFlowsToAdd.clear();\n setOfFlowsToDelete.clear();\n }", "void unsetRaceList();", "public void\t\tremoveAll()\n\t{\n\t\ttab.clear();\n\t}", "public static int rmScheduledEvent()\n\t{\n\t\tString sql = \"DELETE FROM BSM_SCHEDULER_EVENT_REPORT\";\n\t\tDBUtil.executeSQL(sql);\n\t\t\n\t\t//Remove report event from table BSM_SCHEDULER_EVENT\n\t\tsql = String.format(\"DELETE FROM BSM_SCHEDULER_EVENT\");\n\t\tint ret = DBUtil.executeSQL(sql);\n\t\t\n\t\treturn ret;\n\t}", "void removeFromGame() {\n\t\t// remove from game\n\t\t//only for multi-player\n\t}", "protected void clear() {\n\n\t\tthis.myRRList.clear();\n\t}", "public void removeOldRoutes()\n\t{\n\t\tList<RouteTableEntry> safeList = Collections.synchronizedList(getList());\n\t\t\n\t\ttable.clear(); // clear the table\n\t\t\n\t\tfor (RouteTableEntry entry : safeList)\n\t\t{\n\t\t\tif (entry.getCurrentAgeInSeconds() > NetworkConstants.ROUTE_TABLE_TIMEOUT)\n\t\t\t{\n\t\t\t\t// do nothing, the entry expired so leave it out of the table\n\t\t\t} // end if\n\t\t\telse\n\t\t\t{\n\t\t\t\ttable.add(entry); // put it back in the table\n\t\t\t} // end else\n\t\t} // end for each loop\n\t\t\n\t\t/*addOrUpdate(Utilities.getLL3PIntFromLL3PString(NetworkConstants.MY_LL3P_ADDRESS), \n\t\t\t\tnew NetworkDistancePair(Utilities.getLL3PIntFromLL3PString(NetworkConstants.MY_LL3P_ADDRESS), \n\t\t\t\t0), // I am zero away from myself\n\t\t\t\tUtilities.getLL3PIntFromLL3PString(NetworkConstants.MY_LL3P_ADDRESS));*/\n\t\t\n\t\tparentActivity.runOnUiThread(new Runnable()\n\t\t{ \n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tuiManager.resetRoutingListAdapter();\n\t\t\t\tuiManager.resetForwardingListAdapter();\n\t\t\t} // end public method run\n\t\t}); // end runOnUiThread\n\t}", "public void clearLeadUI() {\n\t\tfor (JLabel item : leadList) {\n\t\t\testimationGame.getContentPane().remove(item);\n\t\t}\n\t\tleadList.clear();\n\t}", "@Override\n\tpublic void removeAll() throws SystemException {\n\t\tfor (InterviewSchedule interviewSchedule : findAll()) {\n\t\t\tremove(interviewSchedule);\n\t\t}\n\t}", "public void Unload() {\n\t\tsceneLoaded = false;\n\t\tfor (GameObject gO : gameObjects) {\n\t\t\tEngine.Instance.RemoveObject(gO);\n\t\t}\n\t\tEngine.Instance.currentScenes.remove(this);\n\t}", "public void removeAllFightsystems()\r\n {\n\r\n }", "public void resetLastRoom(){this.aLastRooms.clear();}", "@AfterMethod(description = \"After method: deleting all list\")\n public void clearList()\n {\n HTMLReport htmlReport = new HTMLReport();\n TodoMVCWorkFlow flow = new TodoMVCWorkFlow();\n htmlReport.log(\"STARTING AfterMethod\");\n htmlReport.logINFO(\"Clearing of the rows in the list before new session\");\n flow.deleteAllList();\n }", "void endPeriodic() {\n\t\tupdateDashboard();\n\t}", "public void removeLastEntry(){\r\n\t\tboards.remove(boards.size() -1 );\r\n\t}", "public void exit() {\n\t\tnextPlace = exitName;\n\t\tOrganizer.getOrganizer().deleteSuspended();\n\t\texit(Values.LANDSCAPE);\n\t}", "@Override\n\tpublic void onGuiClosed() {\n\t\tfield_154330_a.removed();\n\t\tsuper.onGuiClosed();\n\t}", "private void clearRecord() {\n // Clearing current booking information from sharedPreference\n SharedPreferences.Editor editor = sharedpreferences.edit();\n editor.clear();\n editor.commit();\n shutdown();\n }", "@Override\n public void removeAll(){\n gameCollection.removeAllElements();\n }", "public void removeFromGame(){\n this.isInGame = false;\n }", "public void cancel()\n {\n Enumeration en = m_rounds.keys();\n while (en.hasMoreElements())\n {\n PaxosRound tmp = (PaxosRound) m_rounds.get(en.nextElement());\n tmp.abort();\n }\n }", "private void reset(){\r\n\t\tScheduleDao dao = new ScheduleDaoImpl();\r\n\t\tfinal List<Schedule> result = dao.queryAll();\r\n\t\tif (result != null && result.size() > 0) {\r\n\t\t\tfor (Schedule schedule : result) {\r\n\t\t\t\tif(schedule.getStatus() == Schedule.STATUS_PENDING||schedule.getStatus()==Schedule.STATUS_INPROGRESS){\r\n\t\t\t\t\treset(schedule);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void clearRealmCollection() {\n if (mRvHistoryAdapter.getData() != null) {\n mRealm.beginTransaction();\n for (TranslationInfo translationInfo : mRvHistoryAdapter.getData()) {\n translationInfo.getTranslation().deleteFromRealm();\n translationInfo.getDictionary().getDefinitionsList().deleteAllFromRealm();\n translationInfo.getDictionary().deleteFromRealm();\n }\n mRvHistoryAdapter.getData().deleteAllFromRealm();\n mRealm.commitTransaction();\n }\n }", "private void refreshGameList() {\n ((DefaultListModel) gameJList.getModel()).removeAllElements();\n client.joinServer(connectedServerName, connectedServerIP, connectedServerPort);\n }", "private void clearLists() {\n\t\tobjects = new ArrayList<Entity>();\n\t\tenemies.clear();\n\t\titemList.clear();\n\t}", "void cleanUpEventsAndPlaces();", "private void quit() {\n\t\t\tArrayList<ClientThread> delList = new ArrayList<ClientThread>();\n\t\t\tdelList.add(this);\n\t\t\tplayers.removeAll(delList);\n\t\t\twaitingPlayers.removeAll(delList);\n\t\t\tview.changeInAndWait(players.size(),waitingPlayers.size());\t\t\n\t\t\tif(dealer == this) {\n\t\t\t\tdealer = null;\n\t\t\t\tview.writeLog(\"Dealer: \" + name + \" has quited. NO DEALER NOW.\");\n\t\t\t}else view.writeLog(\"Player: \" + name + \" has quited.\");\n\t\t\tstatusCheck();\n\t\t}", "public void clearFinishedTasks(){\n todayLayout.removeAllViewsInLayout();\n tomorrowLayout.removeAllViewsInLayout();\n weekLayout.removeAllViewsInLayout();\n laterLayout.removeAllViewsInLayout();\n expiredLayout.removeAllViewsInLayout();\n tasksNumber = 0;\n taskManager.updateTasksTimeTag();\n for (Task t : taskManager.getTasksList()){\n t.setIdInView(tasksNumber);\n updateTaskInDatabase(t);\n submit(t.getName(), tasksNumber, t.getTimeForTask(), t.isFinished());\n tasksNumber++;\n }\n }", "public void clearScreen()\n {\n showText(\"\", 150, 175);\n List objects = getObjects(null);\n if(objects != null)\n {\n removeObjects(objects);\n }\n }", "public void shutdown()\n {\n valid = false;\n quitSafely();\n\n synchronized (loading) {\n loading.clear();\n }\n synchronized (toLoad) {\n toLoad.clear();\n }\n synchronized (tilesByFetchRequest) {\n tilesByFetchRequest.clear();\n }\n }", "public void clearGame() {\n\t\tselectedObjects.clear();\n\t}", "public void clearAggroList()\n\t{\n\t\tgetAggroList().clear();\n\t}", "private void deleteList(){\n new Thread(() -> agenda.getConnector().deleteItem(currentList)).start();\n numberOfLists--;\n for(Component c:window.getComponents()){\n if (c.getName().equals(comboBox.getSelectedItem().toString())){\n window.remove(c);\n }\n }\n if(comboBox.getItemCount() == 1){\n comboBox = new JComboBox();\n }else {\n comboBox.removeItemAt(comboBox.getSelectedIndex());\n }\n setUpHeader();\n this.updateComponent(header);\n }", "public void dropWaitingStates() {\n waitlist.clear();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tmStateHolder.cancelAlltasks();\n\n\t}", "private void clearBooking() {\n // Clearing current booking information from sharedPreference\n SharedPreferences.Editor editor = sharedpreferences.edit();\n editor.putBoolean(BOOKING, false);\n editor.commit();\n time = 0;\n shutdown();\n }", "@Override\n public void removeCheckInDates() {\n\n List<String> theDatesToRemove = new ArrayList<>(checkInTimeList.getSelectedValuesList());\n DefaultListModel theModel = (DefaultListModel)checkInTimeList.getModel();\n \n //Remote the dates\n for( String aStr : theDatesToRemove )\n theModel.removeElement(aStr); \n \n }", "public static void cancelRefreshJob() {\n\t\ttry {\n\t\t\tScheduler sched = StdSchedulerFactory.getDefaultScheduler();\n\t\t\tSet<JobKey> jobKeys = sched.getJobKeys(jobGroupEquals(SCHEDULER_GROUP));\n\t\t\tif (jobKeys.size() > 0) {\n\t\t\t\tsched.deleteJobs(new ArrayList<JobKey>(jobKeys));\n\t\t\t\tlogger.debug(\"Found {} refresh jobs to delete from DefaulScheduler (keys={})\", jobKeys.size(), jobKeys);\n\t\t\t}\n\t\t} catch (SchedulerException e) {\n\t\t\tlogger.warn(\"Could not remove refresh job: {}\", e.getMessage());\n\t\t}\t\t\n\t}", "private void deleteRoutine() {\n String message = \"Are you sure you want to delete this routine\\nfrom your routine collection?\";\n int n = JOptionPane.showConfirmDialog(this, message, \"Warning\", JOptionPane.YES_NO_OPTION);\n if (n == JOptionPane.YES_OPTION) {\n Routine r = list.getSelectedValue();\n\n collection.delete(r);\n listModel.removeElement(r);\n }\n }", "protected void clearUpdateScores() {\n\t\tupdateScore.clear();\n\t}", "void reset(){\n\t\tstatsRB.setSelected(true);\n\t\tcustTypeCB.setSelectedIndex(0);\n\t\tcustIdTF.setText(\"\");\n\t\toutputTA.setText(\"\");\n\t\t\n\t\tLong currentTime = System.currentTimeMillis();\n\t\t\n\t\t//THE TIME IN TIME SPINNERS ARE SET TO THE MAX POSSIBLE TIME WINDOW THAT IS \n\t\t//FROM THE TIME THAT THE SHOP STARTED TO THE CURRENT TIME.\n\t\t\n\t\t//THE STARTING DATE AND TIME OF SHOP OS CONSIDERED AS -- 1 JAN 2010 00:00\n\t\tstartDateS.setModel(new SpinnerDateModel(new Date(1262284200000L), new Date(1262284200000L), new Date(currentTime), Calendar.DAY_OF_MONTH));\n\t\t//AND END DATE AND TIME WILL THE THE CURRENT SYSTEM DATE AND TIME.\n\t\tendDateS.setModel(new SpinnerDateModel(new Date(currentTime), new Date(1262284200000L), new Date(currentTime), Calendar.DAY_OF_MONTH));\n\t\n\t}", "public void endGame() {\n\t\twaitingPlayers.addAll(players);\n\t\tplayers.clear();\n\t\tfor(ClientThread player: waitingPlayers) {\n\t\t\tplayer.points = 0;\n\t\t\tplayer.clientCards.clear();\n\t\t}\n\t\twinners = 0;\n\t\tlosers = 0;\n\t\tpassCounter = 0;\n\t\tdeck.init();\n\t\tview.changeInAndWait(players.size(), waitingPlayers.size());\n\t\tview.writeLog(\"-------------GAME END--------------\");\n\t\tstatus = \"waiting\";\n\t\tstatusCheck();\n\t}", "public void actionPerformed(ActionEvent event) {\n remove(tabbedPaneTeachers);\r\n //load period info from file\r\n try {\r\n loadPeriodInfo();\r\n }catch (IOException E) {\r\n System.out.println (\"ERROR READING 'Period List.txt\"); \r\n }\r\n //add teacherzonepanel to main frame\r\n add(teacherZonePanel);\r\n //for loop to loop through the teacher's period\r\n for (int j = 0; j < teachers.get(teacherUser).getPeriodNumbers().size(); j++){\r\n //remove the tabs for each period in the teacher\r\n String name = \"Period \" + teachers.get(teacherUser).getPeriodNumbers().get(j);\r\n tabbedPaneTeachers.remove(tabbedPaneTeachers.indexOfTab(name));\r\n }\r\n //refresh page\r\n teacherZonePanel.setVisible(false);\r\n teacherZonePanel.setVisible(true);\r\n \r\n }", "public void closeTestList(){\n\t\t\n\t\tint panelIndex = tabbedPane.getSelectedIndex();\n\t\t\n\t\t\tif(panelIndex == LOCAL_UNIT ){\n\t\t\t\ttabbedPane.setTitleAt(panelIndex, LOCAL_NAME);\n\t\t\t}else{\n\t\t\t\ttabbedPane.setTitleAt(panelIndex,REMOTE_NAME+ getUnitKey());\n\t\t\t}\n\t\t\tgetSelectedPanel().clearResults();\n\t\t\tgetSelectedPanel().clearTestList();\n\t\t\n\t}", "public void onUnload(ClientEvent clientEvent) {\n \n try {\n String action = (String) AdfFacesContext.getCurrentInstance().getPageFlowScope().get(\"lstbpmaction\");\n logger.error(\"PropValApproveBean : onUnload..action..\"+action);\n if(\"addcomment\".equalsIgnoreCase(action))\n updateBPMTask();\n } catch(Exception e) {\n e.printStackTrace();\n logger.error(\"onUnload\", e);\n }\n // closeTaskFlow();\n\n }", "public void EmptyList(){\n BusStopSearcherPresenter.setListview(initList(emptylist));\n }", "private void clearStragglers() {\n for (int i = 0; i < game.gridPieces.length; i++) {\n GridPiece piece = game.gridPieces[i];\n\n if (piece.state == game.STATE_TEMP) {\n piece.restoreState();\n //restoreState(piece);\n } else if (piece.state == game.STATE_TEMP_NOTOUCH) {\n piece.setState(game.STATE_FINAL);\n }\n }\n }", "private void refreshScheduleTable() {\n\t\tint gameIdx = 0;\n\t\tList<GameDetails> games = getGames();\n\t\tif (games != null) {\n\t\t\tfor (GameDetails game : games) {\n\t\t\t\tfor (int i = 0; i < 2; i++) {\n\t\t\t\t\tboolean isHome = (i == 0);\n\n\t\t\t\t\tTeamDetails team = (isHome ? game.getHomeTeam() : game.getAwayTeam()); \n\n\t\t\t\t\tboolean isSelected = false;\n\t\t\t\t\tboolean canSelect = true;\n\t\t\t\t\tif (getUiHandlers() != null) {\n\t\t\t\t\t\tisSelected = getUiHandlers().isTeamSelected(team);\n\t\t\t\t\t\tcanSelect = getUiHandlers().canSelectTeam(team);\n\t\t\t\t\t}\n\n\t\t\t\t\tString text = (isHome ? \"@ \" + team.getDisplayName() : team.getDisplayName());\n\n\t\t\t\t\tint row = rowFromGameIdx(gameIdx, isHome);\n\t\t\t\t\tint col = colFromGameIdx(gameIdx, isHome);\n\n\t\t\t\t\tsetScheduleCell(row, col, text, isSelected, canSelect);\t\n\t\t\t\t}\n\n\t\t\t\tgameIdx++;\n\t\t\t}\n\t\t}\n\n\t\t// Clear out any remaining cells (in case of bye weeks).\n\t\tfor (; gameIdx < NFLConstants.MAX_GAMES_PER_WEEK; gameIdx++) {\n\t\t\tfor (int i = 0; i < 2; i++) {\n\t\t\t\tboolean isHome = (i == 0);\n\t\t\t\t\n\t\t\t\tint row = rowFromGameIdx(gameIdx, isHome);\n\t\t\t\tint col = colFromGameIdx(gameIdx, isHome);\n\n\t\t\t\tsetScheduleCell(row, col, \"\", false, true);\n\t\t\t}\n\t\t}\n\t}", "void exitSession()\n\t{\n\t\t// clear out our watchpoint list and displays\n\t\t// keep breakpoints around so that we can try to reapply them if we reconnect\n\t\tm_displays.clear();\n\t\tm_watchpoints.clear();\n\n\t\tif (m_fileInfo != null)\n\t\t\tm_fileInfo.unbind();\n\n\t\tif (m_session != null)\n\t\t\tm_session.terminate();\n\n\t\tm_session = null;\n\t\tm_fileInfo = null;\n\t}", "public void clear() {\r\n\t\tremoveAll();\r\n\t\tdrawBackGround();\r\n\t\tclearEntries();\r\n\t\t\r\n\t}", "public void clear() {\r\n\t\tdisplayEntries.clear();\r\n\t\tupdate();\r\n\t}", "public void run() {\n AuctionItemCollection coll = AuctionItemCollection.getInstance();\n for (AuctionItem item : coll.getValues()) {\n if (!item.isOpen())\n coll.remove(item.getItemInfo().getId());\n }\n coll.rebuildCache();\n }", "public void endGame(){\n\t\tgameRunning = false;\t// set gameRunning to false\n\t\tfinal SnakeGame thisGame = this;\t// store reference to the current game\n\t\tSwingUtilities.invokeLater(new Runnable() {\n public void run() {\n \t// remove our board and scoreboard\n \tgetContentPane().remove(board);\n \tgetContentPane().remove(scoreboard);\n \t// create a game over page\n \tgameOverPage = new GameOver(thisGame, scoreboard.getScore());\n \t// set our board and scoreboard to null\n \tboard = null;\n \tscoreboard = null;\n \t// add the game over page\n \tadd(gameOverPage);\n \t// validate and repaint\n \tvalidate();\n \trepaint();\n }\n\t\t});\t\n\t}", "public synchronized void resetUserWorkouts() {\n userWorkouts = null;\n }", "private void ExitRoom() {\n stopFirestoreListenerService();\n\n SharedPreferences roomInfo = getSharedPreferences(\"PreviousRoom\", 0);\n SharedPreferences.Editor roomInfoEditor = roomInfo.edit();\n\n roomInfoEditor.putString(\"roomID\", \"\");\n\n roomInfoEditor.apply();\n\n SelectRoomActivity.recentRooms.remove(roomId);\n }", "public void clear() {\n\t\tlists.clear();\n\t}", "@Override\n public void onGuiClosed(){\n\t\tfor(int displayListID : partDisplayLists.values()){\n\t\t\tGL11.glDeleteLists(displayListID, 1);\n\t\t}\n }", "public void reset() {\n this.list.clear();\n }", "public void supprimerToutesLesLignes() {\n\t\tlisteVente.clear();\r\n\t\tfireTableDataChanged();\r\n\t}" ]
[ "0.65442145", "0.646687", "0.63234025", "0.6118957", "0.60431314", "0.6017023", "0.60028875", "0.59678966", "0.5960545", "0.59126407", "0.59027344", "0.5896921", "0.5896061", "0.5862987", "0.58505833", "0.5841117", "0.5813088", "0.5805522", "0.5764609", "0.5755086", "0.5735805", "0.569015", "0.5683527", "0.5669828", "0.5657962", "0.56579155", "0.5657553", "0.5652207", "0.565026", "0.5649045", "0.5635823", "0.5634651", "0.5610769", "0.5609425", "0.56061405", "0.55986995", "0.5593089", "0.55915785", "0.5587296", "0.558728", "0.5581562", "0.5576236", "0.55740136", "0.5573474", "0.5563301", "0.55474925", "0.55366695", "0.552837", "0.552776", "0.55144614", "0.5506788", "0.5504753", "0.5494762", "0.549416", "0.5484106", "0.5481458", "0.5480225", "0.5471986", "0.5455021", "0.5454545", "0.5453005", "0.5449343", "0.54479843", "0.5444616", "0.54384536", "0.5436936", "0.5436424", "0.54299974", "0.54125684", "0.5411705", "0.54105294", "0.5403923", "0.54028815", "0.53862995", "0.5378726", "0.5374494", "0.5373738", "0.53734773", "0.5365919", "0.5358775", "0.53469735", "0.5346523", "0.5345484", "0.5344426", "0.53385085", "0.53340393", "0.533355", "0.533266", "0.53283066", "0.53277874", "0.5324906", "0.5324045", "0.53232086", "0.53231114", "0.5321342", "0.5320585", "0.53182083", "0.5314825", "0.530721", "0.5301302" ]
0.68811977
0
/ Represents a strategy to perform zip operation.
public interface IZipStrategy { void zip(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface CompressionStrategy {\n\n /**\n * The type of compression performed.\n */\n String getType();\n\n /**\n * Uncompresses the data. The array received should not be modified, but it\n * may be returned unchanged.\n * \n * @param data compressed data.\n * @return uncompressed data.\n * @throws IOException if there is an issue during the operation.\n */\n byte[] inflate(byte[] data) throws IOException;\n\n /**\n * Compresses the data. The array received should not be modified, but it\n * may be returned unchanged.\n * \n * @param data uncompressed data.\n * @return compressed data.\n * @throws IOException if there is an issue during the operation.\n */\n byte[] deflate(byte[] data) throws IOException;\n}", "public static void main(String[] args) {\n\t\tSystem.out.println(zipZap(((\"azbcpppzop\") ) ));\n\t}", "public boolean ZipFile(String sSourceFilePath, String sDestinationZipFilePath, boolean bReplaceExisting) {\n byte[] buffer = new byte[30720];\n FileInputStream fin = null;\n FileOutputStream fout = null;\n ZipOutputStream zout = null;\n int length;\n String sZipEntryFileName = \"\";\n File objFile = null;\n try {\n //check for source file\n if (sSourceFilePath.trim().equalsIgnoreCase(\"\")) {\n throw new Exception(\"Invalid Source File : \" + sSourceFilePath);\n }\n objFile = new File(sSourceFilePath);\n if (!objFile.exists()) {\n throw new Exception(\"Source file not found : \" + sSourceFilePath);\n }\n\n //check for destination Zip file\n if (sDestinationZipFilePath.trim().equalsIgnoreCase(\"\") || sDestinationZipFilePath == null) {\n String stmp_Path = objFile.getAbsolutePath();\n String stmp_Name = objFile.getName();\n if (stmp_Name.contains(\".\")) { //check for removing extension\n int indx = 0;\n try {\n indx = stmp_Name.indexOf(\".\", stmp_Name.length() - 5);\n } catch (Exception e) {\n indx = 0;\n }\n if (indx <= 0) {\n indx = stmp_Name.length();\n }\n\n stmp_Name = stmp_Name.substring(0, indx);\n stmp_Name = stmp_Name + \".zip\";\n }\n sDestinationZipFilePath = stmp_Path + File.separator + stmp_Name;\n }\n\n objFile = new File(sDestinationZipFilePath);\n if (objFile.exists()) {\n if (bReplaceExisting) {\n objFile.delete();\n } else {\n throw new Exception(\"Destination ZipFile Already exists : \" + sDestinationZipFilePath);\n }\n }\n\n //Zipping File\n sZipEntryFileName = sSourceFilePath.substring(sSourceFilePath.lastIndexOf(\"\\\\\") + 1);\n fout = new FileOutputStream(sDestinationZipFilePath);\n zout = new ZipOutputStream(fout);\n fin = new FileInputStream(sSourceFilePath);\n zout.putNextEntry(new ZipEntry(sZipEntryFileName));\n while ((length = fin.read(buffer)) > 0) {\n zout.write(buffer, 0, length);\n }\n\n return true;\n\n } catch (Exception exp) {\n println(\"Src = \" + sSourceFilePath + \" : Dest = \" + sDestinationZipFilePath + \" : \" + exp.toString());\n return false;\n } finally {\n try {\n fin.close();\n } catch (Exception exp) {\n }\n try {\n zout.closeEntry();\n } catch (Exception exp) {\n }\n try {\n zout.close();\n } catch (Exception exp) {\n }\n }\n }", "abstract void initZipper(SynchronizationRequest req, Zipper z) \n throws IOException, ConfigException;", "static <A , B, C> Stream<C> zip(Stream<A> a, Stream<B> b, BiFunction<A, B, C> zipper) {\n Objects.requireNonNull(zipper);\n Spliterator<? extends A> aSpliterator = Objects.requireNonNull(a).spliterator();\n Spliterator<? extends B> bSpliterator = Objects.requireNonNull(b).spliterator();\n\n // Zipping looses DISTINCT and SORTED characteristics\n int characteristics = aSpliterator.characteristics() & bSpliterator.characteristics() &\n ~(Spliterator.DISTINCT | Spliterator.SORTED);\n\n long zipSize = ((characteristics & Spliterator.SIZED) != 0)\n ? Math.min(aSpliterator.getExactSizeIfKnown(), bSpliterator.getExactSizeIfKnown())\n : -1;\n\n Iterator<A> aIterator = Spliterators.iterator(aSpliterator);\n Iterator<B> bIterator = Spliterators.iterator(bSpliterator);\n Iterator<C> cIterator = new Iterator<C>() {\n @Override\n public boolean hasNext() {\n return aIterator.hasNext() && bIterator.hasNext();\n }\n\n @Override\n public C next() {\n return zipper.apply(aIterator.next(), bIterator.next());\n }\n };\n\n Spliterator<C> split = Spliterators.spliterator(cIterator, zipSize, characteristics);\n return (a.isParallel() || b.isParallel())\n ? StreamSupport.stream(split, true)\n : StreamSupport.stream(split, false);\n }", "private ZipCompressor(){}", "public void zip() {\n\t\tif (zipFile != null) {\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\ttry (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) {\n\t\t\t\tzos.setLevel(ZipOutputStream.STORED);\n\t\t\t\tbyte[] buffer = new byte[4096];\n\t\t\t\tFiles.list(Paths.get(tool_builddir))\n\t\t\t\t\t\t.forEach(x -> {\n\t\t\t\t\t\t\tFile f = x.toFile();\n\t\t\t\t\t\t\tif (f.isFile() && !f.getName().contains(\".\")) {\n\t\t\t\t\t\t\t\ttry (FileInputStream fis = new FileInputStream(f)) {\n\t\t\t\t\t\t\t\t\tZipEntry zipEntry = new ZipEntry(f.getName());\n\t\t\t\t\t\t\t\t\tzos.putNextEntry(zipEntry);\n\t\t\t\t\t\t\t\t\tint count;\n\t\t\t\t\t\t\t\t\twhile ((count = fis.read(buffer)) >= 0) {\n\t\t\t\t\t\t\t\t\t\tzos.write(buffer, 0, count);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tzos.closeEntry();\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\tout.println(\"Zipped to '\" + zipFile + \"' - \" + Duration.ofMillis(System.currentTimeMillis() - start));\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t}", "public int getZip() {\n return zip;\n }", "public boolean intZip() {\n return intZip;\n }", "public File getZip() {\r\n try {\r\n close(); // if the file is currently open close it\r\n Log.d(LOG_TAG, \"getZip()\");\r\n File zipFile = new File(mBaseFileName + \".zip\");\r\n zipFile.delete();\r\n ZipOutputStream zipStream = new ZipOutputStream(new FileOutputStream(zipFile));\r\n for (int i = 0; i < mNumSegments; i++) {\r\n File chunk = new File(getFileNameForIndex(i));\r\n if (chunk.exists()) {\r\n FileInputStream fis = new FileInputStream(chunk);\r\n writeToZipFile(zipStream, fis, chunk.getName());\r\n }\r\n }\r\n zipStream.close();\r\n return zipFile;\r\n } catch (Exception e) {\r\n Log.e(LOG_TAG, \"Failed to create zip file\", e);\r\n }\r\n\r\n return null;\r\n }", "private void addFilesToZip(List<File> files,String outputPath) throws IOException \r\n\t{\r\n\t\t// create a zip output stream\r\n\t\tString zipFileName = outputPath + File.separator + Constants.name + zipIndex + Constants.zipExtension;\r\n\t\tOutputStreamWithLength chunkedFile = new OutputStreamWithLength(zipFileName);\r\n\t\tzipOutputStream = new ZipOutputStream(chunkedFile);\r\n\t\tdouble totalBytesRead = 0L;\r\n\t\tint count = 10; \r\n\t\tfor(File file:files)\r\n\t\t{\r\n\t\t\t// reset the file index\r\n\t\t\tfileIndex = 0;\r\n\t\t\tString zipEntryPath = file.getAbsolutePath().substring(basePath.length() + 0);\r\n\t\t\t\r\n\t\t\tif(file.isDirectory())\r\n\t\t\t{\r\n\t\t\t\tZipEntry entry =new ZipEntry(zipEntryPath+\"/\");\r\n\t\t\t\tzipOutputStream.putNextEntry(entry);\r\n\t\t\t\tzipOutputStream.closeEntry();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tzipEntryPath = zipEntryPath + Constants.fragmentLabel + fileIndex++;\r\n\t\t\t}\t\t\t\r\n\r\n\t\t\t// add the current file to the zip\r\n\t\t\tZipEntry entry =new ZipEntry(zipEntryPath);\r\n\t\t\tzipOutputStream.putNextEntry(entry);\r\n\r\n\t\t\tbyte[] buffer = new byte[1024]; \t \r\n\r\n\t\t\tFileInputStream inputFileStream = new FileInputStream(file);\r\n\t\t\tint len; \r\n\t\t\twhile ((len = inputFileStream.read(buffer)) > 0) \r\n\t\t\t{ \r\n\t\t\t\tif((chunkedFile.getCurrentWriteLength() + len ) > maxSplitSize){\r\n\t\t\t\t\t// close current zip output stream\r\n\t\t\t\t\tzipOutputStream.closeEntry();\r\n\t\t\t\t\tzipOutputStream.finish();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// reset the write length\r\n\t\t\t\t\tchunkedFile.setCurrentWriteLength(0);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// create new zip output stream\r\n\t\t\t\t\tzipIndex += 1;\r\n\t\t\t\t\tzipFileName = outputPath+ File.separator + Constants.name + zipIndex + Constants.zipExtension;\r\n\t\t\t\t\tchunkedFile = new OutputStreamWithLength(zipFileName);\r\n\t\t\t\t\tzipOutputStream = new ZipOutputStream(chunkedFile);\r\n\r\n\t\t\t\t\t// add the current file to write remaining bytes\r\n\t\t\t\t\tzipEntryPath = file.getAbsolutePath().substring(basePath.length() + 0);\r\n\t\t\t\t\tzipEntryPath = zipEntryPath + Constants.fragmentLabel + fileIndex++;\r\n\t\t\t\t\tentry = new ZipEntry(zipEntryPath);\r\n\t\t\t\t\tzipOutputStream.putNextEntry(entry);\r\n\r\n\t\t\t\t\t// write the bytes to the zip output stream\r\n\t\t\t\t\tzipOutputStream.write(buffer, 0, len);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// write the bytes to the zip output stream\r\n\t\t\t\t\tzipOutputStream.write(buffer, 0, len);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Show progress\r\n\t\t\t\ttotalBytesRead += len;\r\n\t\t\t\tdouble progress = totalBytesRead / totalBytes;\r\n\t\t\t\tif (progress*100 > 10)\r\n\t\t\t\t{\r\n\t\t\t\t\ttotalBytesRead = 0L;\r\n\t\t\t\t\tcount += 10;\r\n\t\t\t\t\tSystem.out.println(\"Finished \" + count +\"%\");\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\t\t\r\n\t\t\tinputFileStream.close();\r\n\t\t}\r\n\r\n\t\tzipOutputStream.closeEntry();\r\n\t\tzipOutputStream.finish();\r\n\t}", "public int getZip() {\r\n\t\treturn zip;\r\n\t}", "public void m63703d() {\n Throwable th;\n ZipCoordinator zipCoordinator = this;\n if (getAndIncrement() == 0) {\n C17455a[] c17455aArr = zipCoordinator.f53839c;\n Observer observer = zipCoordinator.f53837a;\n Object obj = zipCoordinator.f53840d;\n boolean z = zipCoordinator.f53841e;\n int i = 1;\n while (true) {\n int length = c17455aArr.length;\n int i2 = 0;\n int i3 = 0;\n int i4 = 0;\n while (i2 < length) {\n int i5;\n C17455a c17455a = c17455aArr[i2];\n if (obj[i3] == null) {\n boolean z2 = c17455a.f53845c;\n Object poll = c17455a.f53844b.poll();\n boolean z3 = poll == null;\n i5 = i2;\n if (!m63700a(z2, z3, observer, z, c17455a)) {\n if (z3) {\n i4++;\n } else {\n obj[i3] = poll;\n }\n } else {\n return;\n }\n }\n C17455a c17455a2 = c17455a;\n i5 = i2;\n if (c17455a2.f53845c && !z) {\n th = c17455a2.f53846d;\n if (th != null) {\n m63698a();\n observer.onError(th);\n return;\n }\n }\n i3++;\n i2 = i5 + 1;\n }\n if (i4 != 0) {\n i = addAndGet(-i);\n if (i == 0) {\n return;\n }\n } else {\n try {\n observer.onNext(C15684a.m58895a(zipCoordinator.f53838b.apply(obj.clone()), \"The zipper returned a null value\"));\n Arrays.fill(obj, null);\n } catch (Throwable th2) {\n th = th2;\n C15678a.m58850b(th);\n m63698a();\n observer.onError(th);\n return;\n }\n }\n }\n }\n }", "@Override\n public void map(LongWritable key, Text value, Mapper.Context context)\n throws IOException, InterruptedException {\n // package (zip) file to be processed\n Project project = Project.getCurrentProject();\n project.resetCurrentMapCount();\n String[] inputs = value.toString().split(\";\");\n String zipFile = inputs[0];\n // no empty or incorrect lines!\n if (zipFile.trim().isEmpty()) {\n return;\n }\n logger.info(\"Processing: {}\", zipFile);\n if (inputs.length >= 3) {\n project.setMapItemStart(Integer.parseInt(inputs[1]));\n project.setMapItemEnd(Integer.parseInt(inputs[2]));\n logger.info(\"From {} to {}\", project.getMapItemStart(), project.getMapItemEnd());\n }\n int filesInZip = new TrueZipUtil().countFiles(zipFile);\n Stats.getInstance().setCurrentItemTotal(filesInZip);\n Stats.getInstance().setZipFileName(zipFile);\n \n project.setupCurrentCustodianFromFilename(zipFile);\n logger.info(\"Will use current custodian: {}\", project.getCurrentCustodian());\n // if we are in Hadoop, copy to local tmp \n if (project.isEnvHadoop()) {\n String extension = org.freeeed.services.Util.getExtension(zipFile);\n String tmpDir = ParameterProcessing.TMP_DIR_HADOOP;\n File tempZip = File.createTempFile(\"freeeed\", (\".\" + extension), new File(tmpDir));\n tempZip.delete();\n if (project.isFsHdfs() || project.isFsLocal()) {\n String cmd = \"hadoop fs -copyToLocal \" + zipFile + \" \" + tempZip.getPath();\n OsUtil.runCommand(cmd);\n } else if (project.isFsS3()) {\n S3Agent s3agent = new S3Agent();\n s3agent.getStagedFileFromS3(zipFile, tempZip.getPath());\n }\n \n zipFile = tempZip.getPath();\n }\n \n if (PstProcessor.isPST(zipFile)) {\n try {\n new PstProcessor(zipFile, context, luceneIndex).process();\n } catch (Exception e) {\n logger.error(\"Problem with PST processing...\", e);\n }\n } else {\n logger.info(\"Will create Zip File processor for: {}\", zipFile);\n // process archive file\n ZipFileProcessor processor = new ZipFileProcessor(zipFile, context, luceneIndex);\n processor.process(false, null);\n }\n }", "public void setZip(int value) {\n this.zip = value;\n }", "public default <ANOTHER, TARGET> StreamPlus<TARGET> zipWith(Stream<ANOTHER> anotherStream, ZipWithOption option, BiFunction<DATA, ANOTHER, TARGET> combinator) {\n val iteratorA = streamPlus().iterator();\n val iteratorB = IteratorPlus.from(anotherStream.iterator());\n return StreamPlusHelper.doZipWith(option, combinator, iteratorA, iteratorB);\n }", "@AutoEscape\n\tpublic String getZip();", "public int getZip() {\n return this.zip;\n }", "void makeZip(String zipFilePath, String srcFilePaths[],\n\t\t\tMessageDisplay msgDisplay) {\n\t\t...\n\t\tfor (int i = 0; i < srcFilePaths.length; i++) {\n\t\t\tmsgDisplay.showMessage(\"Zipping \"+srcFilePaths[i]);\n\t\t\t//add the file srcFilePaths[i] into the zip file.\n\t\t\t...\n\t\t}\n\t}", "public int getZip() {\n\t\treturn zip;\n\t}", "public default <ANOTHER> StreamPlus<Tuple2<DATA, ANOTHER>> zipWith(Stream<ANOTHER> anotherStream, ZipWithOption option) {\n return zipWith(anotherStream, option, Tuple2::of);\n }", "@Override\n\tpublic long getZip() {\n\t\treturn _candidate.getZip();\n\t}", "abstract void postProcess(long zipSize, SynchronizationRequest[] results)\n throws IOException;", "public interface ZipListener {\n /**\n * notify that zip task with given token that status has changed.\n * \n * @param token used to differentiate zip task.\n * @param status status of zip task.\n */\n void onZipStatusChange(String token, ZipStatus status);\n\n /**\n * notify that zip task with given token that progress has changed.\n * \n * @param token used to differentiate zip task.\n * @param percent percent of current progress.\n */\n void onZipProgressChange(String token, int percent);\n\n }", "public String getZip() {\r\n return zip;\r\n }", "public String getZip() {\r\n return zip;\r\n }", "public static void generateZip(File file) {\r\n\t\t\r\n\t\tFile zipfile=new File(file.toString().replaceAll(\".xlsx\",\".zip\" ));\r\n\t\tFileOutputStream fos=null;\r\n\t\tZipOutputStream zos=null;\r\n\t\tFileInputStream fin=null;\r\n\t\tZipEntry ze=null; \r\n\t\t\t\r\n\t\tif(!zipfile.exists()){\r\n\t\t\ttry {\r\n\t\t\t\tzipfile.createNewFile();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t//create ZipOutputStream to write to the zipfile\r\n fos=new FileOutputStream(zipfile);\r\n\t\t\t zos=new ZipOutputStream(fos);\r\n\t\t\t \r\n\t\t//add a new Zip Entry to the ZipOutPutStream \r\n\t\t\t ze=new ZipEntry(file.getName());\r\n\t\t\t zos.putNextEntry(ze);\r\n\t\t\t \r\n\t\t//read the file and write to the ZipOutPutStream\t \r\n\t\t\t fin=new FileInputStream(file);\r\n\t\t\t int i;\r\n\t\t\t \r\n\t\t\t while((i=fin.read())!=-1){\r\n\t\t\t\t zos.write(i);\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\t \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tif(zos!=null && fos!=null && fin!=null){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t //close the zip entry to write to to zip file\r\n\t\t\t\t\t\tzos.closeEntry();\r\n\t\t\t\t\t//close Resources.\t\r\n\t\t\t\t\t\tzos.close();\r\n\t\t\t\t\t\tfos.close();\r\n\t\t\t\t\t\tfin.close();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public void setupZipFile(String[] args) {\n\t\tif (args.length > 0) {\n\t\t\tif (!args[0].endsWith(\".zip\")) {\n\t\t\t\tthrow new IllegalArgumentException(\"zip file expected, but: \" + args[0]);\n\t\t\t}\n\t\t\tbuildDirectory = new File(\n\t\t\t\t\tgetBuildDirectory(),\n\t\t\t\t\tString.valueOf(System.currentTimeMillis()));\n\t\t\ttool_builddir = buildDirectory.toString();\n\t\t\tif (!buildDirectory.mkdirs()) {\n\t\t\t\tLoggedUtils.ignore(\"Unable to create directory \" + tool_builddir, null);\n\t\t\t}\n\t\t\tzipFile = args[0];\n\t\t} else if (requireZipArgument){\n\t\t\tthrow new IllegalArgumentException(\"zip file is expected as a first argument\");\n\t\t}\n\t}", "public void tozip() {\r\n\t\t//session.setAttribute(Constant.USER_SESSION_KEY, null);\r\n\t\tList<Netlog> result = null;\r\n\t\tInteger total = null;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t\tresult = (List<Netlog>)netlogDao.findNetlogByPage(1,10000);\r\n\t\t\t\ttotal= result.size();\r\n\t\t\t\t//total= netlogDao.findNetlogCount();\r\n\t\t\t\r\n\t\t} catch (SQLException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tNetlogs netlogs = new Netlogs(result);\r\n\t\tString path = this.getClass().getClassLoader().getResource(\"\").getPath();\r\n\t\tSystem.out.println(path);\r\n\t\tpath = path.replace(\"WEB-INF/classes/\", \"\");\r\n\t\tString path1 = path + \"netlog/\";\r\n\t\tLong time = System.currentTimeMillis()/1000;\r\n\t\tXml2Java.beanToXML(netlogs,path1+\"145-330000-\"+time.toString()+\"-00001-WA-SOURCE_NETLOG_0001-0.xml\");\r\n\r\n\t\tZipUtil.ZipMultiFile(path1, path+\"145-353030334-330300-330300-netlog-00001.zip\");\r\n\t}", "public String getZip() {\r\n\t\treturn zip;\r\n\t}", "public void setZip(int zip) {\r\n\t\tthis.zip = zip;\r\n\t}", "public void convertToZip(String input, String output) throws ZipException {\n\t\tZipFile zip = new ZipFile(output); \n\t ZipParameters parameters = new ZipParameters();\n parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);\n parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL); \n\t zip.addFolder(input, parameters);\n\t}", "public static ZipFile zip(File zip, File fileToAdd, String password)\r\n\t\t\tthrows ZipException {\n\t\tZipFile zipFile = new ZipFile(zip);\r\n\r\n\t\tZipParameters parameters = new ZipParameters();\r\n\t\tparameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);\r\n\t\tparameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);\r\n\t\tif (!StringUtil.isEmpty(password)) {\r\n\t\t\tparameters.setEncryptFiles(true);\r\n\t\t\tparameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD);\r\n\t\t\tparameters.setPassword(password);\r\n\t\t}\r\n\t\tzipFile.addFile(fileToAdd, parameters);\r\n\t\treturn zipFile;\r\n\t}", "public static void zipObservables(CountDownLatch latch) {\n\n Observable<Observable<String>> source = Observable.create(observableEmitter -> {\n System.out.println(\"create\");\n observableEmitter.onNext(Observable.just(\"abc\", \"def\"));\n observableEmitter.onNext(Observable.just(\"123\", \"456\"));\n observableEmitter.onNext(Observable.just(\"alpha\", \"beta\", \"gama\"));\n observableEmitter.onComplete();\n });\n\n source.doOnSubscribe(d -> System.out.println(\"source doOnSubscribe\"));\n source.doOnNext(i -> System.out.println(\"source doOnNext = \" + i.toString()));\n source.doOnComplete(() -> System.out.println(\"source doOnComplete\"));\n\n\n Observable.zip(source, items -> items[0] + \"-\" + items[1] + \"-\" + items[2])\n .doOnSubscribe(d -> System.out.println(\"zip doOnSubscribe\"))\n .doOnNext(i -> System.out.println(\"zip doOnNext\"))\n .subscribe(new MyObserver<>(latch));\n }", "public void newZipEntry(ZipEntry zipEntry, InputStream inputStream);", "public static boolean generateZipFile(ArrayList<String> sourcesFilenames, String destinationDir, String zipFilename){\n byte[] buf = new byte[1024]; \r\n\r\n try \r\n {\r\n // VER SI HAY QUE CREAR EL ROOT PATH\r\n boolean result = (new File(destinationDir)).mkdirs();\r\n\r\n String zipFullFilename = destinationDir + \"/\" + zipFilename;\r\n\r\n System.out.println(result);\r\n\r\n // Create the ZIP file \r\n ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFullFilename)); \r\n \r\n // Compress the files \r\n for (String filename: sourcesFilenames) { \r\n FileInputStream in = new FileInputStream(filename); \r\n // Add ZIP entry to output stream. \r\n File file = new File(filename); //\"Users/you/image.jpg\"\r\n out.putNextEntry(new ZipEntry(file.getName())); //\"image.jpg\" \r\n // Transfer bytes from the file to the ZIP file \r\n int len; \r\n while ((len = in.read(buf)) > 0) { \r\n out.write(buf, 0, len); \r\n } \r\n // Complete the entry \r\n out.closeEntry(); \r\n in.close(); \r\n } // Complete the ZIP file \r\n out.close();\r\n\r\n return true;\r\n } \r\n catch (Exception e) \r\n { \r\n System.out.println(e);\r\n return false;\r\n } \r\n }", "protected abstract String getUpDateZip();", "void onUnzipCompleted(String output);", "public void setZip(String zip);", "public void zipDirectory(String sourceDirectoryPath, String zipOutputPath, Boolean ifAbsolutePath, Boolean ifProtect, int maxZipMbSizeToProtect) throws Exception {\t\t \n\t\t if(ifAbsolutePath) { zipOutputPath = zipDirectoryFullPath(sourceDirectoryPath, zipOutputPath); }\n\t\t else { zipOutputPath = zipDirectoryInternalPath(sourceDirectoryPath, zipOutputPath); }\t\t \n\t\t if(fileSizeMB(zipOutputPath) < maxZipMbSizeToProtect) {\n\t\t\t if(ifProtect){ fileRename(zipOutputPath,zipOutputPath.replace(\".zip\",\".renameToZip\")); }\n\t\t\t }\n\t\t }", "private void createZipEntry(ZipOutputStream out, String fileName, byte[] content) throws IOException\n\t{\n\t\tZipEntry entry = new ZipEntry(fileName);\n\t\tentry.setMethod(ZipEntry.DEFLATED);\n\t\tout.putNextEntry(entry);\n\t\tout.write(content);\n\t}", "public interface CompressionService {\n public static final String ARCHIVE_EXTENSION = \"zip\";\n /**\n * Compresses given directory into zip file\n *\n * @param directory the content to compress\n * @param size default archive size\n *\n * @return zipped archive/s\n */\n List<File> compress(File directory, int size);\n}", "protected File createZipArchive(File directoryToZip, String modpackName, String workspace) throws Exception {\n zipName = LocalDateTime.now().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd-HH-mm-ss\")) + \"--\" + modpackName + \".zip\";\n uploadStatus = \"Creating Zipfile from Directory\";\n File zipFile = new File(workspace + \"\\\\\" + zipName);\n try {\n ProgressBarLogic progressBarLogic = new ProgressBarLogic(directoryToZip);\n ZipUtil.pack(directoryToZip, zipFile, name -> {\n uploadStatus = \"Adding file: \" + name + \" to the zip\";\n progressBarLogic.progressPercentage = 0;\n progressBarLogic.progress.add(name);\n progressBarLogic.calculateProgress(progressBarLogic.progress);\n notifyObserver();\n return name;\n });\n } catch (ZipException e) {\n throw e;\n } catch (Exception e) {\n System.out.println(e);\n }\n return zipFile;\n }", "@Override\n\tpublic String getZip() {\n\t\treturn this.zip;\n\t}", "@Override\n\tpublic int Address2Zip(int String) {\n\t\treturn 0;\n\t}", "public interface ExtractorStrategy {\n\n /**\n * Extracts all the entries of an compressed archive and returns a map with the name of the entry as key and\n * the proper data content of the entry as value.\n */\n Map<String, InputStream> extract(TypedValue<InputStream> archive) throws DecompressionException;\n}", "public void zip(String directoryInZip, \n String filePath) throws Exception\n {\n File thisFile = new File(filePath);\n\n if (thisFile.exists()) {\n\n try {\n FileInputStream fi = new FileInputStream(thisFile);\n\n origin = new BufferedInputStream(fi, BUFFER);\n\n ZipEntry entry = new ZipEntry(directoryInZip + File.separator\n + thisFile.getName());\n out.putNextEntry(entry);\n\n int count;\n while ((count = origin.read(data, 0, BUFFER)) != -1) {\n out.write(data, 0, count);\n }\n origin.close();\n\n } catch (FileNotFoundException e) {\n logger.error(\"File \" + filePath + \" not found !!\", e);\n } catch (IOException e) {\n logger.error(\"Could not write to Zip File \", e);\n throw new Exception(\"Could not write to Zip File \", e);\n }\n\n } else {\n // Log message if file does not exist\n logger.info(\"File \" + thisFile.getName()\n + \" does not exist on file system\");\n\n } \t\t\n }", "public interface IZipNode {\n\n\t/**\n\t * If <tt>getChildren()</tt> returns null\n\t * Zipper considers this node to be a leaf node.\n\t * Return a collection to add/remove child nodes.\n\t * \n\t * @return null if child node, a collection (empty or not) otherwise.\n\t */\n\tabstract public Collection<? extends IZipNode> getChildren();\n\t\n}", "private ZipCodes() {}", "@Test\n public void testDERIVATIVE_COMPRESS_CRC() throws IOException {\n// ZipMeVariables.getSINGLETON().setCRC___(true);\n// ZipMeVariables.getSINGLETON().setCOMPRESS___(true);\n// ZipMeVariables.getSINGLETON().setDERIVATIVE_COMPRESS_CRC___(true);\n\t Configuration.CRC=true;\n\t Configuration.COMPRESS=true;\n\t Configuration.DERIVATIVE_COMPRESS_CRC=true;\n if(Configuration.CRC && Configuration.COMPRESS && Configuration.DERIVATIVE_COMPRESS_CRC) { \n ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(new File(\n homeDir + \"/files/src.zip\")));\n zout.crc.update(1);\n ZipEntry ze = new ZipEntry(\"C://\");\n zout.putNextEntry(ze);\n zout.hook41();\n assertTrue(zout.crc.crc == 0);\n\n zout.write(new byte[32], 0, 31);\n assertTrue(zout.size == 31);\n zout.closeEntry();\n assertTrue(ze.getCrc() == zout.crc.crc);\n }\n }", "public default <ANOTHER, TARGET> StreamPlus<TARGET> zipWith(Stream<ANOTHER> anotherStream, BiFunction<DATA, ANOTHER, TARGET> combinator) {\n return zipWith(anotherStream, RequireBoth, combinator);\n }", "private ZipEntry processEntry( ZipFile zip, ZipEntry inputEntry ) throws IOException{\n /*\n First, some notes.\n On MRJ 2.2.2, getting the size, compressed size, and CRC32 from the\n ZipInputStream does not work for compressed (deflated) files. Those calls return -1.\n For uncompressed (stored) files, those calls do work.\n However, using ZipFile.getEntries() works for both compressed and \n uncompressed files.\n \n Now, from some simple testing I did, it seems that the value of CRC-32 is\n independent of the compression setting. So, it should be easy to pass this \n information on to the output entry.\n */\n String name = inputEntry .getName();\n if ( ! (inputEntry .isDirectory() || name .endsWith( \".class\" )) ) {\n try {\n InputStream input = zip.getInputStream( zip .getEntry( name ) );\n String className = ClassNameReader .getClassName( input );\n input .close();\n if ( className != null ) {\n name = className .replace( '.', '/' ) + \".class\";\n }\n } catch( IOException ioe ) {}\n }\n ZipEntry outputEntry = new ZipEntry( name );\n outputEntry.setTime(inputEntry .getTime() );\n outputEntry.setExtra(inputEntry.getExtra());\n outputEntry.setComment(inputEntry.getComment());\n outputEntry.setTime(inputEntry.getTime());\n if (compression){\n outputEntry.setMethod(ZipEntry.DEFLATED);\n //Note, don't need to specify size or crc for compressed files.\n } else {\n outputEntry.setMethod(ZipEntry.STORED);\n outputEntry.setCrc(inputEntry.getCrc());\n outputEntry.setSize(inputEntry.getSize());\n }\n return outputEntry;\n }", "public abstract String getZipCode();", "public void unZip(String apkFile) throws Exception \r\n\t{\r\n\t\tLog.p(tag, apkFile);\r\n\t\tFile file = new File(apkFile);\r\n\t\r\n\t\t/*\r\n\t\t * Create the Base Directory, whose name should be same as Zip file name.\r\n\t\t * All decompressed contents will be placed under this folder.\r\n\t\t */\r\n\t\tString apkFileName = file.getName();\r\n\t\t\r\n\t\tif(apkFileName.indexOf('.') != -1)\r\n\t\t\tapkFileName = apkFileName.substring(0, apkFileName.indexOf('.'));\r\n\t\t\r\n\t\tLog.d(tag, \"Folder name: \"+ apkFileName);\r\n\t\t\r\n\t\tFile extractFolder = new File((file.getParent() == null ? \"\" : file.getParent() + File.separator) + apkFileName);\r\n\t\tif(!extractFolder.exists())\r\n\t\t\textractFolder.mkdir();\r\n\t\t\r\n\t\t/*\r\n\t\t * Read zip entries.\r\n\t\t */\r\n\t\tFileInputStream fin = new FileInputStream(apkFile);\r\n\t\tZipInputStream zin = new ZipInputStream(new BufferedInputStream(fin));\r\n\t\t\r\n\t\t/*\r\n\t\t * Zip InputStream shifts its index to every Zip entry when getNextEntry() is called.\r\n\t\t * If this method returns null, Zip InputStream reaches EOF.\r\n\t\t */\r\n\t\tZipEntry ze = null;\r\n\t\tBufferedOutputStream dest;\r\n\t\t\r\n\t\twhile((ze = zin.getNextEntry()) != null)\r\n\t\t{\r\n\t\t\tLog.d(tag, \"Zip entry: \" + ze.getName() + \" Size: \"+ ze.getSize());\r\n\t\t\t/*\r\n\t\t\t * Create decompressed file for each Zip entry. A Zip entry can be a file or directory.\r\n\t\t\t * ASSUMPTION: APK Zip entry uses Unix style File seperator- \"/\"\r\n\t\t\t * \r\n\t\t\t * 1. Create the prefix Zip Entry folder, if it is not yet available\r\n\t\t\t * 2. Create the individual Zip Entry file.\r\n\t\t\t */\r\n\t\t\tString zeName = ze.getName();\r\n\t\t\tString zeFolder = zeName;\r\n\t\t\t\r\n\t\t\tif(ze.isDirectory())\r\n\t\t\t{\r\n\t\t\t\tzeName = null; // Don't create Zip Entry file\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(zeName.indexOf(\"/\") == -1) // Zip entry uses \"/\"\r\n\t\t\t\t\tzeFolder = null; // It is File. don't create Zip entry Folder\r\n\t\t\t\telse {\r\n\t\t\t\t\tzeFolder = zeName.substring(0, zeName.lastIndexOf(\"/\"));\r\n\t\t\t\t\tzeName = zeName.substring( zeName.lastIndexOf(\"/\") + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tLog.d(tag, \"zeFolder: \"+ zeFolder +\" zeName: \"+ zeName);\r\n\t\t\t\r\n\t\t\t// Create Zip Entry Folder\r\n\t\t\tFile zeFile = extractFolder;\r\n\t\t\tif(zeFolder != null)\r\n\t\t\t{\r\n\t\t\t\tzeFile = new File(extractFolder.getPath() + File.separator + zeFolder);\r\n\t\t\t\tif(!zeFile.exists())\r\n\t\t\t\t\tzeFile.mkdirs();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Create Zip Entry File\r\n\t\t\tif(zeName == null)\r\n\t\t\t\tcontinue;\r\n\t\t\t\r\n\t\t\t// Keep track of XML files, they are in Android Binary XML format\r\n\t\t\tif(zeName.endsWith(\".xml\"))\r\n\t\t\t\txmlFiles.add(zeFile.getPath() + File.separator + zeName);\r\n\t\t\t\r\n\t\t\t// Keep track of the Dex/ODex file. Need to convert to Jar\r\n\t\t\tif(zeName.endsWith(\".dex\") || zeName.endsWith(\".odex\"))\r\n\t\t\t\tdexFile = zeFile.getPath() + File.separator + zeName;\r\n\t\t\t\r\n\t\t\t// Keep track of Resources.arsc file- resources.arsc\r\n\t\t\tif(zeName.endsWith(\".arsc\"))\r\n\t\t\t\tresFile = zeFile.getPath() + File.separator + zeName;\r\n\t\t\t\r\n\t\t\t// Write Zip entry File to the disk\r\n\t\t\tint count;\r\n\t\t\tbyte data[] = new byte[BUFFER];\r\n\t\t\t\r\n\t\t\tFileOutputStream fos = new FileOutputStream(zeFile.getPath() + File.separator + zeName);\r\n\t\t\tdest = new BufferedOutputStream(fos, BUFFER);\r\n\r\n\t\t\twhile ((count = zin.read(data, 0, BUFFER)) != -1) \r\n\t\t\t{\r\n\t\t\t\tdest.write(data, 0, count);\r\n\t\t\t}\r\n\t\t\tdest.flush();\r\n\t\t\tdest.close();\r\n\t\t}\r\n\r\n\t\t// Close Zip InputStream\r\n\t\tzin.close();\r\n\t\tfin.close();\r\n\t}", "@Override\n\tpublic void setZip(long zip) {\n\t\t_candidate.setZip(zip);\n\t}", "public String getZipId() {\n return zipId;\n }", "private DataSet zipfDataSet(){\n ZipfDistribution zipfDistribution = new ZipfDistribution(NUM_DISTINCT_TASKS, 1);\n //Magic number which is computed the following way\n //Take the H_{2500,1}/(1+4+9+...) * Target Mean\n //this will result in mean of 50\n Double multiplier = (8.4/1.644)*TARGET_MEAN;\n DataSet dataSet = new DataSet();\n Map<Integer, UUID> ids = new HashMap<>();\n //generate costs from sampling from normal distribution\n for(int i=0; i < NUM_TASKS; i++){\n //zipf gives numbers from 1 to NUM_DISTINCT_TASKS where 1 is most frequent\n int sample = zipfDistribution.sample();\n UUID id = ids.getOrDefault(sample, UUID.randomUUID());\n ids.put(sample, id);\n Double cost = multiplier * (1D/sample);\n dataSet.getTasks().add(new Task(cost.longValue(), id));\n }\n return dataSet;\n }", "public void setZip(String s) {\r\n\t\tzip = s;\t\r\n\t}", "private static void processZip(File zip_name, final Histogram class_use, final Histogram method_use) {\n ZipFile zip_file;\n try {\n zip_file = new ZipFile(zip_name);\n } catch (Exception e) {\n throw new IllegalStateException(\"while reading archive '\"+zip_name+\"': \"+e);\n }\n final Enumeration< ? extends ZipEntry> en = zip_file.entries();\n while (en.hasMoreElements()) {\n final ZipEntry e = en.nextElement();\n final String e_name = e.getName();\n if (e.isDirectory()) continue;\n if (e_name.endsWith(\".class\")){\n try {\n final InputStream object_stream=zip_file.getInputStream(e);\n MethodCallEnumerator.analyzeClass(object_stream,class_use,method_use);\n object_stream.close();\n } catch (Exception ex) {\n throw new IllegalStateException(\"while processing: \"+ ex);\n }\n } \n }\n try {\n zip_file.close();\n } catch (Exception e) {\n throw new IllegalStateException(\"while reading archive: \" + e);\n }\n }", "public interface IGenerator {\n\n void execute(List<ClassInfo> classInfos, Map<String, Object> extParam, ZipOutputStream zipOutputStream) throws Exception;\n\n}", "public static void unzip(Context context, InputStream zipFile) {\n try (BufferedInputStream bis = new BufferedInputStream(zipFile)) {\n try (ZipInputStream zis = new ZipInputStream(bis)) {\n ZipEntry ze;\n int count;\n byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];\n while ((ze = zis.getNextEntry()) != null) {\n try (FileOutputStream fout = context.openFileOutput(ze.getName(), Context.MODE_PRIVATE)) {\n while ((count = zis.read(buffer)) != -1)\n fout.write(buffer, 0, count);\n }\n }\n }\n } catch (IOException | NullPointerException ex) {\n Log.v(MainActivity.TAG, \"Zip not opened.\\n\"+ex.getMessage());\n }\n }", "public interface CompressDecompressService {\n\n /**\n * Run compression in number of threads\n *\n * @param input\n * @param output\n * @param maxSizeInMB\n * @param nThread\n * @return\n * @throws IOException\n */\n List<CompressResult> parallelCompress(Path input, Path output, int maxSizeInMB, int nThread) throws IOException;\n\n /**\n * Run compression in main thread\n *\n * @param input the full path of the folder or file to read from\n * @param output the full path of the folder or file to write, if\n * @param maxSizeInMB\n * @return\n * @throws IOException\n */\n List<CompressResult> compress(Path input, Path output, int maxSizeInMB) throws IOException;\n\n /**\n * Run decompression in main thread\n *\n * @param input\n * @param output\n * @return\n * @throws IOException\n */\n List<CompressResult> decompress(Path input, Path output) throws IOException;\n}", "private String writeZipFile(File directoryToZip, List<File> fileList, String zipName) throws IOException{\r\n // If the zip name is null then provide the name of the directory\r\n if(zipName == null){\r\n zipName = directoryToZip.getName();\r\n }\r\n // Store the file name\r\n String fileName = zipName;\r\n // Create the zip file\r\n FileOutputStream fos = new FileOutputStream(fileName);\r\n ZipOutputStream zos = new ZipOutputStream(fos);\r\n for (File file : fileList) {\r\n if (!file.isDirectory()) { // we only zip files, not directories\r\n // Add files that are not in the skip list\r\n if(!isFileToSkip(file.getName())) {\r\n addToZip(directoryToZip, file, zos);\r\n }\r\n }\r\n }\r\n zos.close();\r\n fos.close();\r\n // Return the full name of the file\r\n return fileName;\r\n }", "protected static void zipDir(File zipDir, ZipOutputStream zos, String archiveSourceDir)\n throws IOException {\n String[] dirList = zipDir.list();\n byte[] readBuffer = new byte[40960];\n int bytesIn;\n //loop through dirList, and zip the files\n if (dirList != null) {\n for (String aDirList : dirList) {\n File f = new File(zipDir, aDirList);\n //place the zip entry in the ZipOutputStream object\n zos.putNextEntry(new ZipEntry(getZipEntryPath(f, archiveSourceDir)));\n if (f.isDirectory()) {\n //if the File object is a directory, call this\n //function again to add its content recursively\n zipDir(f, zos, archiveSourceDir);\n //loop again\n continue;\n }\n //if we reached here, the File object f was not a directory\n //create a FileInputStream on top of f\n try (FileInputStream fis = new FileInputStream(f)) {\n //now write the content of the file to the ZipOutputStream\n while ((bytesIn = fis.read(readBuffer)) != -1) {\n zos.write(readBuffer, 0, bytesIn);\n }\n }\n }\n }\n }", "public static boolean zipFileAtPath(String[] sourcePaths, String toLocation) {\n\t\t// ArrayList<String> contentList = new ArrayList<String>();\n\n\t\ttry {\n\t\t\tBufferedInputStream origin = null;\n\t\t\tFileOutputStream dest = new FileOutputStream(toLocation);\n\t\t\tZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(\n\t\t\t\t\tdest));\n\t\t\tfor (String sourcePath : sourcePaths) {\n\t\t\t\tFile sourceFile = new File(sourcePath);\n\t\t\t\tif (sourceFile.isDirectory()) {\n\t\t\t\t\tzipSubFolder(out, sourceFile, sourceFile.getParent()\n\t\t\t\t\t\t\t.length());\n\t\t\t\t} else {\n\t\t\t\t\tbyte data[] = new byte[BUFFER_SIZE];\n\t\t\t\t\tFileInputStream fi = new FileInputStream(sourcePath);\n\t\t\t\t\torigin = new BufferedInputStream(fi, BUFFER_SIZE);\n\t\t\t\t\tZipEntry entry = new ZipEntry(\n\t\t\t\t\t\t\tgetLastPathComponent(sourcePath));\n\t\t\t\t\tout.putNextEntry(entry);\n\t\t\t\t\tint count;\n\t\t\t\t\twhile ((count = origin.read(data, 0, BUFFER_SIZE)) != -1) {\n\t\t\t\t\t\tout.write(data, 0, count);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tout.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "@WebService(targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", name = \"ClassifierZip\")\n@XmlSeeAlso({ObjectFactory.class, iac.cud.infosweb.ws.classif.common.ObjectFactory.class})\npublic interface ClassifierZip {\n\n @WebResult(name = \"return\", targetNamespace = \"\")\n @RequestWrapper(localName = \"getClassifierByClassifierNameCUD\", targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", className = \"ru.spb.iac.ws.classifierzip.GetClassifierByClassifierName\")\n @WebMethod\n @ResponseWrapper(localName = \"getClassifierByClassifierNameResponseCUD\", targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", className = \"ru.spb.iac.ws.classifierzip.GetClassifierByClassifierNameResponse\")\n public iac.cud.infosweb.ws.classifierzip.ResponseElement52 getClassifierByClassifierName(\n @WebParam(name = \"login\", targetNamespace = \"\")\n java.lang.String login,\n @WebParam(name = \"pass\", targetNamespace = \"\")\n java.lang.String pass,\n @WebParam(name = \"Fullname\", targetNamespace = \"\")\n java.lang.String fullname,\n @WebParam(name = \"ActualDoc\", targetNamespace = \"\")\n int actualDoc\n );\n\n @WebResult(name = \"return\", targetNamespace = \"\")\n @RequestWrapper(localName = \"getClassifierZipListByClassifierNameCUD\", targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", className = \"ru.spb.iac.ws.classifierzip.GetClassifierZipListByClassifierName\")\n @WebMethod\n @ResponseWrapper(localName = \"getClassifierZipListByClassifierNameResponseCUD\", targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", className = \"ru.spb.iac.ws.classifierzip.GetClassifierZipListByClassifierNameResponse\")\n public iac.cud.infosweb.ws.classifierzip.ResponseElement54 getClassifierZipListByClassifierName(\n @WebParam(name = \"login\", targetNamespace = \"\")\n java.lang.String login,\n @WebParam(name = \"pass\", targetNamespace = \"\")\n java.lang.String pass,\n @WebParam(name = \"Fullname\", targetNamespace = \"\")\n java.lang.String fullname\n );\n\n @WebResult(name = \"return\", targetNamespace = \"\")\n @RequestWrapper(localName = \"getClassifierZipListByClassifierNumberCUD\", targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", className = \"ru.spb.iac.ws.classifierzip.GetClassifierZipListByClassifierNumber\")\n @WebMethod\n @ResponseWrapper(localName = \"getClassifierZipListByClassifierNumberResponseCUD\", targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", className = \"ru.spb.iac.ws.classifierzip.GetClassifierZipListByClassifierNumberResponse\")\n public iac.cud.infosweb.ws.classifierzip.ResponseElement53 getClassifierZipListByClassifierNumber(\n @WebParam(name = \"login\", targetNamespace = \"\")\n java.lang.String login,\n @WebParam(name = \"pass\", targetNamespace = \"\")\n java.lang.String pass,\n @WebParam(name = \"RegNumber\", targetNamespace = \"\")\n int regNumber\n );\n\n @WebResult(name = \"return\", targetNamespace = \"\")\n @RequestWrapper(localName = \"getClassifierByClassifierNumberCUD\", targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", className = \"ru.spb.iac.ws.classifierzip.GetClassifierByClassifierNumber\")\n @WebMethod\n @ResponseWrapper(localName = \"getClassifierByClassifierNumberResponseCUD\", targetNamespace = \"http://ws.iac.spb.ru/ClassifierZip\", className = \"ru.spb.iac.ws.classifierzip.GetClassifierByClassifierNumberResponse\")\n public iac.cud.infosweb.ws.classifierzip.ResponseElement51 getClassifierByClassifierNumber(\n @WebParam(name = \"login\", targetNamespace = \"\")\n java.lang.String login,\n @WebParam(name = \"pass\", targetNamespace = \"\")\n java.lang.String pass,\n @WebParam(name = \"RegNumber\", targetNamespace = \"\")\n int regNumber,\n @WebParam(name = \"ActualDoc\", targetNamespace = \"\")\n int actualDoc\n );\n}", "public static void main(String[] args) throws IOException {\n\t\tFile targetFile = new File(\"D:\\\\program\\\\360cse\\\\360Chrome\\\\test.zip\");\n\t\tFile sourceFiles = new File(\"D:\\\\temple\\\\sysMenu-add.html\");\n\t\tboolean flag = compressZip(false, targetFile, sourceFiles);\n\t\tSystem.out.println(flag);\n\t}", "public final int zza(com.google.android.gms.internal.ads.zzno r8, com.google.android.gms.internal.ads.zznt r9) throws java.io.IOException, java.lang.InterruptedException {\n /*\n r7 = this;\n r0 = 0\n r7.zzaoo = r0\n r1 = 1\n r2 = 1\n L_0x0005:\n if (r2 == 0) goto L_0x003c\n boolean r3 = r7.zzaoo\n if (r3 != 0) goto L_0x003c\n com.google.android.gms.internal.ads.zzob r2 = r7.zzazx\n boolean r2 = r2.zzb(r8)\n if (r2 == 0) goto L_0x0005\n long r3 = r8.getPosition()\n boolean r5 = r7.zzaob\n if (r5 == 0) goto L_0x0025\n r7.zzaod = r3\n long r3 = r7.zzaoc\n r9.zzahv = r3\n r7.zzaob = r0\n L_0x0023:\n r3 = 1\n goto L_0x0039\n L_0x0025:\n boolean r3 = r7.zzbam\n if (r3 == 0) goto L_0x0038\n long r3 = r7.zzaod\n r5 = -1\n int r3 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r3 == 0) goto L_0x0038\n long r3 = r7.zzaod\n r9.zzahv = r3\n r7.zzaod = r5\n goto L_0x0023\n L_0x0038:\n r3 = 0\n L_0x0039:\n if (r3 == 0) goto L_0x0005\n return r1\n L_0x003c:\n if (r2 == 0) goto L_0x003f\n return r0\n L_0x003f:\n r8 = -1\n return r8\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzod.zza(com.google.android.gms.internal.ads.zzno, com.google.android.gms.internal.ads.zznt):int\");\n }", "static void unzip(String zipFilePath, String destDirectory, boolean recursive, boolean teacherZip) throws IOException {\n\n if (students == null) {\n students = new ArrayList<Student>();\n }\n\n ZipInputStream zipIn = null;\n\n try {\n zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n\n // iterates over entries in the zip file\n while (entry != null) {\n createFiles(destDirectory, zipIn, entry, recursive);\n\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n\n } catch (IOException e) {\n System.err.println(e.getMessage());\n Errors.setUnzipperError(true);\n\n } finally {\n if (zipIn != null) {\n zipIn.close();\n }\n }\n }", "public void testChangeZIPArchive2() throws Exception {\n IPath projectPath = env.addProject(\"Project\");\n env.addExternalJars(projectPath, Util.getJavaClassLibs());\n String internalLib = env.getProject(\"Project\").getLocation().toOSString() + File.separator + \"internalLib.abc\";\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \" public void foo() {\\n\" + \" }\\n\" + \"}\" }, internalLib, \"1.4\");\n env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null);\n env.addEntry(projectPath, JavaCore.newLibraryEntry(new Path(\"/Project/internalLib.abc\"), null, null));\n //$NON-NLS-1$\n IPath root = env.getPackageFragmentRootPath(projectPath, \"\");\n env.setOutputFolder(projectPath, \"\");\n IPath classY = env.addClass(root, \"q\", \"Y\", \"package q;\\n\" + \"public class Y {\\n\" + \" void bar(p.X x) {\\n\" + \" x.foo();\\n\" + \" }\\n\" + \"}\");\n fullBuild(projectPath);\n expectingNoProblems();\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \"}\" }, internalLib, \"1.4\");\n env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null);\n incrementalBuild(projectPath);\n expectingProblemsFor(classY, \"Problem : The method foo() is undefined for the type X [ resource : </Project/q/Y.java> range : <54,57> category : <50> severity : <2>]\");\n env.removeProject(projectPath);\n }", "default <R> EagerFutureStream<Tuple2<U,R>> zipFutures(Stream<R> other) {\n\t\treturn (EagerFutureStream<Tuple2<U,R>>)FutureStream.super.zipFutures(other);\n\n\t}", "public File getZipLocation ()\n\t{\n\t\treturn zipFileLocation;\n\t}", "private static void extract (Path zipPath, Path destination)\n\t\tthrows IOException\n\t{\n\t\tif (Files.isDirectory (zipPath))\n\t\t{\n\t\t\ttry (DirectoryStream<Path> directoryStream = Files\n\t\t\t\t.newDirectoryStream (zipPath);)\n\t\t\t{\n\t\t\t\tfor (Path file : directoryStream)\n\t\t\t\t{\n\t\t\t\t\textract (file, destination);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPath fileOutZip = destination\n\t\t\t\t.resolve (\"./\" + zipPath.normalize ().toString ()).normalize ();\n\t\t\tFiles.createDirectories (fileOutZip.getParent ());\n\t\t\tFiles.copy (zipPath, fileOutZip, Utils.COPY_OPTION);\n\t\t}\n\t}", "public static void zip(BasicShell shell, File archive, List<File> filesToZip) {\n\t\ttry {\n\t\t\tshell.printOut(\"Creating archive '\" + archive.getPath() + \"'.\");\n\t\t\tfinal BufferedOutputStream archiveStream = new BufferedOutputStream(new FileOutputStream(archive));\n\t\t\tZipOutputStream zipStream = new ZipOutputStream(archiveStream);\n\t\t\tzipStream.setLevel(7);\n\t\t\t\n\t\t\tString pwd = shell.pwd().getPath();\n\t\t\tfor ( File file : filesToZip) {\n\t\t\t\tString name = file.getPath();\n\t\t\t\tif (name.equals(pwd)) continue;\n\t\t\t\t\n\t\t\t\tif ( name.startsWith(pwd) ) {\n\t\t\t\t\tname = name.substring(pwd.length()+1);\n\t\t\t\t}\n\t\t\t\tZipEntry entry = new ZipEntry(name);\n\t\t\t\tzipStream.putNextEntry(entry);\n\t\t\t\tif ( file.isFile() ) {\n\t\t\t\t\tBufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(file));\n\t\t\t\t\tbyte[] buffer = new byte[2048];\n\t\t\t\t\tint count = fileStream.read(buffer);\n\t\t\t\t\twhile ( count > -1 ) {\n\t\t\t\t\t\tzipStream.write(buffer, 0, count);\n\t\t\t\t\t\tcount = fileStream.read(buffer);\n\t\t\t\t\t}\n\t\t\t\t\tfileStream.close();\n\t\t\t\t}\n\t\t\t\tshell.printOut(\"File '\" + entry.getName() + \"' added.\");\n\t\t\t}\n\t\t\tzipStream.close();\n\t\t} catch (Exception e) {\n\t\t\tshell.getErrorHandler().handleError(Diagnostic.ERROR, e.getClass().getSimpleName() + \": \"+ e.getMessage());\n\t\t}\n\t}", "public PersonWithZip(String firstName, String lastName, int zipCode)\n {\n this.firstName = firstName;\n this.lastName = lastName;\n this.zipCode = zipCode;\n }", "default <R> EagerFutureStream<Tuple2<U,R>> zipFutures(FutureStream<R> other) {\n\t\treturn (EagerFutureStream<Tuple2<U,R>>)FutureStream.super.zipFutures(other);\n\n\t}", "public static void zipOSM(File[] files, String destDir, String destFile) throws FileNotFoundException, IOException {\n\n\t\tFile dirFile = new File(destDir);\n\n\t\tif (!dirFile.exists()) {\n\t\t\tdirFile.mkdirs();\n\t\t}\n\n\t\tString[] strs = new String[files.length];\n\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tstrs[i] = files[i].getAbsolutePath();\n\t\t}\n\n\t\tString file = destDir + destFile + \".zip\";\n\t\tfile.replace(\".osm\", \"\");\n\t\tCompressFile.instance.zip(strs, file);\n\t}", "protected void getFile(ZipEntry e) throws IOException {\n String zipName = e.getName();\n switch (mode) {\n case EXTRACT:\n if (zipName.startsWith(\"/\")) {\n if (!warnedMkDir)\n System.out.println(\"Ignoring absolute paths\");\n warnedMkDir = true;\n zipName = zipName.substring(1);\n }\n // if a directory, just return. We mkdir for every file,\n // since some widely-used Zip creators don't put out\n // any directory entries, or put them in the wrong place.\n if (zipName.endsWith(\"/\")) {\n return;\n }\n // Else must be a file; open the file for output\n // Get the directory part.\n int ix = zipName.lastIndexOf('/');\n if (ix > 0) {\n //String dirName = zipName.substring(0, ix);\n String fileName = zipName.substring(ix + 1, zipName.length());\n zipName = fileName;\n\n }\n String targetFile = this.unzipFileTargetLocation;\n File file = new File(targetFile);\n if (!file.exists())\n file.createNewFile();\n FileOutputStream os = null;\n InputStream is = null;\n try {\n os = new FileOutputStream(targetFile);\n is = zippy.getInputStream(e);\n int n = 0;\n while ((n = is.read(b)) > 0)\n os.write(b, 0, n);\n\n } finally {\n if (is != null) {\n try {\n is.close();\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n if (os != null) {\n try {\n os.close();\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n }\n break;\n case LIST:\n // Not extracting, just list\n if (e.isDirectory()) {\n System.out.println(\"Directory \" + zipName);\n } else {\n System.out.println(\"File \" + zipName);\n }\n break;\n default:\n throw new IllegalStateException(\"mode value (\" + mode + \") bad\");\n }\n }", "public String getZip()\n\t{\n\t\treturn zipCode;\n\t}", "private void unzipDownloadedFile(String zipFile) throws ZipException, IOException{\n\t int BUFFER = 2048;\n\t \n\t // get zip file\n\t File file = new File(zipFile);\n\t ZipFile zip = new ZipFile(file);\n\t \n\t // unzip to directory of the same name\n\t // When sip is a directory, this gets two folders\n\t //String newPath = zipFile.substring(0, zipFile.length() - 4);\n\t //new File(newPath).mkdir();\n\t \n\t // unzip to parent directory of the zip file\n\t // This is assuming zip if of a directory\n\t String newPath = file.getParent();\n\t \n\t // Process each entry\n\t Enumeration<? extends ZipEntry> zipFileEntries = zip.entries();\n\t while (zipFileEntries.hasMoreElements())\n\t {\n\t // grab a zip file entry\n\t ZipEntry entry = (ZipEntry) zipFileEntries.nextElement();\n\t String currentEntry = entry.getName();\n\t File destFile = new File(newPath, currentEntry);\n\t File destinationParent = destFile.getParentFile();\n\n\t // create the parent directory structure if needed\n\t destinationParent.mkdirs();\n\n\t if (!entry.isDirectory())\n\t {\n\t BufferedInputStream is = new BufferedInputStream(zip.getInputStream(entry));\n\t int currentByte;\n\t // establish buffer for writing file\n\t byte data[] = new byte[BUFFER];\n\n\t // write the current file to disk\n\t FileOutputStream fos = new FileOutputStream(destFile);\n\t BufferedOutputStream dest = new BufferedOutputStream(fos,\n\t BUFFER);\n\n\t // read and write until last byte is encountered\n\t while ((currentByte = is.read(data, 0, BUFFER)) != -1) {\n\t dest.write(data, 0, currentByte);\n\t }\n\t dest.flush();\n\t dest.close();\n\t is.close();\n\t }\n\n\t if (currentEntry.endsWith(\".zip\"))\n\t {\n\t // found a zip file, try to open\n\t \tunzipDownloadedFile(destFile.getAbsolutePath());\n\t }\n\t }\n\t zip.close();\n\t}", "void makeZip(String zipFilePath, String srcFilePaths[], ZipMainFrame f) {\n ...\n for (int i = 0; i < srcFilePaths.length; i++) {\n f.setStatusBarText(\"Zipping \"+srcFilePaths[i]);\n //add the file srcFilePaths[i] into the zip file.\n ...\n }\n }", "private static void zipFolder(ZipOutputStream out, File folder) throws IOException {\n\n final int BUFFER = 2048;\n\n File[] fileList = folder.listFiles();\n BufferedInputStream origin;\n\n for (File file : fileList) {\n if (file.isDirectory()) {\n zipFolder(out, file);\n } else {\n byte data[] = new byte[BUFFER];\n\n String unmodifiedFilePath = file.getPath();\n FileInputStream fi = new FileInputStream(unmodifiedFilePath);\n\n origin = new BufferedInputStream(fi, BUFFER);\n ZipEntry entry = new ZipEntry(file.getName());\n\n out.putNextEntry(entry);\n\n int count;\n while ((count = origin.read(data, 0, BUFFER)) != -1) {\n out.write(data, 0, count);\n }\n\n out.closeEntry();\n origin.close();\n }\n }\n\n // Finish the zip stream and close it\n out.finish();\n out.close();\n }", "public static void zip(File destFile, File[] files) throws IOException {\n BufferedInputStream origin = null;\n FileOutputStream dest = new FileOutputStream(destFile);\n ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(dest));\n out.setMethod(ZipOutputStream.DEFLATED);\n byte[] data = new byte[BUFFER_SIZE];\n for (int i = 0; i < files.length; i++) {\n if (log.isDebugEnabled()) {\n log.debug(\"Adding: \" + files[i].getName());\n }\n if (files[i].isDirectory()) {\n if (log.isDebugEnabled()) {\n log.debug(\"Skipping directory: \" + files[i]);\n }\n continue;\n }\n FileInputStream fi = new FileInputStream(files[i]);\n origin = new BufferedInputStream(fi, BUFFER_SIZE);\n ZipEntry entry = new ZipEntry(files[i].getName());\n out.putNextEntry(entry);\n int count;\n while ((count = origin.read(data, 0, BUFFER_SIZE)) != -1) {\n out.write(data, 0, count);\n }\n origin.close();\n }\n out.flush();\n out.close();\n }", "public void zipShuffle() {\r\n List<Card> half = new ArrayList<Card>();\r\n List<Card> shuffledDeck = new ArrayList<Card>();\r\n List<Card> tempDeck = null;\r\n for (int x = 0; x < SHUFFLE_COUNT; x++) {\r\n int h = cards.size()/2;\r\n for (int i = 0; i < h; i++) {\r\n half.add(draw());\r\n }\r\n int j = 0;\r\n while ((half.size() + cards.size()) > 0) {\r\n if (half.size() > 0 && cards.size() > 0) {\r\n if (j % 2 == 0) {\r\n shuffledDeck.add(half.remove(0));\r\n } else {\r\n shuffledDeck.add(draw());\r\n }\r\n } else if (half.size() > 0) {\r\n shuffledDeck.add(half.remove(0));\r\n } else if (cards.size() > 0) {\r\n shuffledDeck.add(draw());\r\n }\r\n j++;\r\n }\r\n tempDeck = cards;\r\n cards = shuffledDeck;\r\n half.clear();\r\n shuffledDeck = tempDeck;\r\n shuffledDeck.clear();\r\n }\r\n }", "public static int zipfDistribution(int permutation[], double shape) {\n\n\t\tint i_res = 0;\n\t\tdouble res = 0;\n \tboolean todo = true;\n\n\t\twhile (todo) {\t\n\t\t\tres = Math.pow(_random.nextDouble(), -1. / shape);\n\t \t\ti_res = (int) (res - 1); \n\t \t\ttodo = i_res >= (permutation.length - 1) || (i_res < 0);\n\t\t}\n\t\treturn permutation[i_res]; \n }", "private static String createZipFile(String directory, String zipFilename, List<File> filesToAdd)\n throws IOException {\n String zipFilePath = String.format(\"%s/%s\", directory, zipFilename);\n File zipFile = new File(zipFilePath);\n if (zipFile.exists()) {\n if (zipFile.delete()) {\n log.info(\"Zipfile existed and was deleted: \" + zipFilePath);\n } else {\n log.warn(\"Zipfile exists but was not deleted: \" + zipFilePath);\n }\n }\n\n // Create and add files to zip file\n addFilesToZip(zipFile, filesToAdd);\n\n return zipFilePath;\n }", "private StreamSource getZipSource(final File requestedDirectory) {\n StreamSource zippedDirSource = new StreamSource() {\n private static final long serialVersionUID = 7060525220398731933L;\n public InputStream getStream() {\n // Pipe bauen, um Steam als Download umzulenken\n final CircularByteBuffer cbb = new CircularByteBuffer(1024);\n new Thread(\n new Runnable(){\n public void run(){\n ZipOutputStream zos = new ZipOutputStream(cbb.getOutputStream());\n Utils.zipDir(getVolume(), requestedDirectory.getPath(), zos);\n\n try {\n if (zos != null) {\n zos.flush();\n zos.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n ).start();\n\n return cbb.getInputStream();\n }\n };\n return zippedDirSource;\n }", "public static void zipFiles(String output, File... files) {\n try (ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(output))) {\n for (File fileToZip : files) {\n zipOut.putNextEntry(new ZipEntry(fileToZip.getName()));\n Files.copy(fileToZip.toPath(), zipOut);\n }\n } catch (FileNotFoundException e) {\n LOGGER.error(\"Unable to find file for archive operation!\", e);\n } catch (IOException e) {\n LOGGER.error(\"IO exception for archive operation!\", e);\n }\n }", "public void testChangeZIPArchive1() throws Exception {\n String externalLib = Util.getOutputDirectory() + File.separator + \"externalLib.abc\";\n IPath projectPath = env.addProject(\"Project\");\n try {\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \" public void foo() {\\n\" + \" }\\n\" + \"}\" }, externalLib, \"1.4\");\n env.addExternalJars(projectPath, Util.getJavaClassLibs());\n env.addExternalJars(projectPath, new String[] { externalLib });\n //$NON-NLS-1$\n IPath root = env.getPackageFragmentRootPath(projectPath, \"\");\n env.setOutputFolder(projectPath, \"\");\n IPath classY = env.addClass(root, \"q\", \"Y\", \"package q;\\n\" + \"public class Y {\\n\" + \" void bar(p.X x) {\\n\" + \" x.foo();\\n\" + \" }\\n\" + \"}\");\n fullBuild(projectPath);\n expectingNoProblems();\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \"}\" }, externalLib, \"1.4\");\n IJavaProject p = env.getJavaProject(projectPath);\n p.getJavaModel().refreshExternalArchives(new IJavaElement[] { p }, null);\n incrementalBuild(projectPath);\n expectingProblemsFor(classY, \"Problem : The method foo() is undefined for the type X [ resource : </Project/q/Y.java> range : <54,57> category : <50> severity : <2>]\");\n } finally {\n new File(externalLib).delete();\n env.removeProject(projectPath);\n }\n }", "public static boolean UnzipFile(ZipFile zf, String filepathinzip, File fileinfiledir) {\r\n BufferedOutputStream Output_fos = null;\r\n BufferedInputStream bufbr = null;\r\n try {\r\n ZipEntry ze = zf.getEntry(filepathinzip);\r\n if (ze != null) {\r\n BufferedOutputStream Output_fos2 = new BufferedOutputStream(new FileOutputStream(fileinfiledir));\r\n try {\r\n byte[] buf = new byte[65536];\r\n BufferedInputStream bufbr2 = new BufferedInputStream(zf.getInputStream(ze));\r\n while (true) {\r\n try {\r\n int readlen = bufbr2.read(buf);\r\n if (readlen < 0) {\r\n break;\r\n }\r\n Output_fos2.write(buf, 0, readlen);\r\n } catch (Exception e) {\r\n e = e;\r\n bufbr = bufbr2;\r\n Output_fos = Output_fos2;\r\n } catch (Throwable th) {\r\n th = th;\r\n bufbr = bufbr2;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e2) {\r\n e2.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e3) {\r\n e3.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e4) {\r\n e4.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e5) {\r\n e5.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n throw th;\r\n }\r\n }\r\n if (Output_fos2 != null) {\r\n try {\r\n Output_fos2.close();\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e6) {\r\n e6.printStackTrace();\r\n BufferedInputStream bufferedInputStream = bufbr2;\r\n BufferedOutputStream bufferedOutputStream = Output_fos2;\r\n return false;\r\n }\r\n }\r\n } catch (IOException e7) {\r\n e7.printStackTrace();\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e8) {\r\n e8.printStackTrace();\r\n BufferedInputStream bufferedInputStream2 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream2 = Output_fos2;\r\n return false;\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream3 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream3 = Output_fos2;\r\n return false;\r\n } finally {\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e9) {\r\n e9.printStackTrace();\r\n BufferedInputStream bufferedInputStream4 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream4 = Output_fos2;\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream5 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream5 = Output_fos2;\r\n return true;\r\n } catch (Exception e10) {\r\n e = e10;\r\n Output_fos = Output_fos2;\r\n try {\r\n e.printStackTrace();\r\n if (Output_fos == null) {\r\n return false;\r\n }\r\n try {\r\n Output_fos.close();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e11) {\r\n e11.printStackTrace();\r\n return false;\r\n }\r\n } catch (IOException e12) {\r\n e12.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e13) {\r\n e13.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e14) {\r\n e14.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n } catch (Throwable th2) {\r\n th = th2;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } catch (Throwable th3) {\r\n th = th3;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } else if (Output_fos == null) {\r\n return false;\r\n } else {\r\n try {\r\n Output_fos.close();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e15) {\r\n e15.printStackTrace();\r\n return false;\r\n }\r\n } catch (IOException e16) {\r\n e16.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e17) {\r\n e17.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e18) {\r\n e18.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n } catch (Exception e19) {\r\n e = e19;\r\n }\r\n }", "public final void zza(T r25, byte[] r26, int r27, int r28, com.google.android.gms.internal.clearcut.zzay r29) throws java.io.IOException {\n /*\n r24 = this;\n r15 = r24;\n r14 = r25;\n r12 = r26;\n r13 = r28;\n r11 = r29;\n r0 = r15.zzmq;\n if (r0 == 0) goto L_0x01e1;\n L_0x000e:\n r9 = zzmh;\n r0 = r27;\n L_0x0012:\n if (r0 >= r13) goto L_0x01d8;\n L_0x0014:\n r1 = r0 + 1;\n r0 = r12[r0];\n if (r0 >= 0) goto L_0x0024;\n L_0x001a:\n r0 = com.google.android.gms.internal.clearcut.zzax.zza(r0, r12, r1, r11);\n r1 = r11.zzfd;\n r10 = r0;\n r16 = r1;\n goto L_0x0027;\n L_0x0024:\n r16 = r0;\n r10 = r1;\n L_0x0027:\n r6 = r16 >>> 3;\n r7 = r16 & 7;\n r8 = r15.zzai(r6);\n if (r8 < 0) goto L_0x01b8;\n L_0x0031:\n r0 = r15.zzmi;\n r1 = r8 + 1;\n r5 = r0[r1];\n r0 = 267386880; // 0xff00000 float:2.3665827E-29 double:1.321066716E-315;\n r0 = r0 & r5;\n r4 = r0 >>> 20;\n r0 = 1048575; // 0xfffff float:1.469367E-39 double:5.18065E-318;\n r0 = r0 & r5;\n r2 = (long) r0;\n r0 = 17;\n r1 = 2;\n if (r4 > r0) goto L_0x0106;\n L_0x0046:\n r0 = 5;\n r6 = 1;\n switch(r4) {\n case 0: goto L_0x00f9;\n case 1: goto L_0x00ec;\n case 2: goto L_0x00db;\n case 3: goto L_0x00db;\n case 4: goto L_0x00ce;\n case 5: goto L_0x00c1;\n case 6: goto L_0x00b7;\n case 7: goto L_0x00a2;\n case 8: goto L_0x0091;\n case 9: goto L_0x0079;\n case 10: goto L_0x006d;\n case 11: goto L_0x00ce;\n case 12: goto L_0x0069;\n case 13: goto L_0x00b7;\n case 14: goto L_0x00c1;\n case 15: goto L_0x005b;\n case 16: goto L_0x004d;\n default: goto L_0x004b;\n };\n L_0x004b:\n goto L_0x01b8;\n L_0x004d:\n if (r7 != 0) goto L_0x01b8;\n L_0x004f:\n r6 = com.google.android.gms.internal.clearcut.zzax.zzb(r12, r10, r11);\n r0 = r11.zzfe;\n r4 = com.google.android.gms.internal.clearcut.zzbk.zza(r0);\n goto L_0x00e3;\n L_0x005b:\n if (r7 != 0) goto L_0x01b8;\n L_0x005d:\n r0 = com.google.android.gms.internal.clearcut.zzax.zza(r12, r10, r11);\n r1 = r11.zzfd;\n r1 = com.google.android.gms.internal.clearcut.zzbk.zzm(r1);\n goto L_0x00d6;\n L_0x0069:\n if (r7 != 0) goto L_0x01b8;\n L_0x006b:\n goto L_0x00d0;\n L_0x006d:\n if (r7 != r1) goto L_0x01b8;\n L_0x006f:\n r0 = com.google.android.gms.internal.clearcut.zzax.zze(r12, r10, r11);\n L_0x0073:\n r1 = r11.zzff;\n L_0x0075:\n r9.putObject(r14, r2, r1);\n goto L_0x0012;\n L_0x0079:\n if (r7 != r1) goto L_0x01b8;\n L_0x007b:\n r0 = r15.zzad(r8);\n r0 = zza(r0, r12, r10, r13, r11);\n r1 = r9.getObject(r14, r2);\n if (r1 != 0) goto L_0x008a;\n L_0x0089:\n goto L_0x0073;\n L_0x008a:\n r4 = r11.zzff;\n r1 = com.google.android.gms.internal.clearcut.zzci.zza(r1, r4);\n goto L_0x0075;\n L_0x0091:\n if (r7 != r1) goto L_0x01b8;\n L_0x0093:\n r0 = 536870912; // 0x20000000 float:1.0842022E-19 double:2.652494739E-315;\n r0 = r0 & r5;\n if (r0 != 0) goto L_0x009d;\n L_0x0098:\n r0 = com.google.android.gms.internal.clearcut.zzax.zzc(r12, r10, r11);\n goto L_0x0073;\n L_0x009d:\n r0 = com.google.android.gms.internal.clearcut.zzax.zzd(r12, r10, r11);\n goto L_0x0073;\n L_0x00a2:\n if (r7 != 0) goto L_0x01b8;\n L_0x00a4:\n r0 = com.google.android.gms.internal.clearcut.zzax.zzb(r12, r10, r11);\n r4 = r11.zzfe;\n r7 = 0;\n r1 = (r4 > r7 ? 1 : (r4 == r7 ? 0 : -1));\n if (r1 == 0) goto L_0x00b1;\n L_0x00b0:\n goto L_0x00b2;\n L_0x00b1:\n r6 = 0;\n L_0x00b2:\n com.google.android.gms.internal.clearcut.zzfd.zza(r14, r2, r6);\n goto L_0x0012;\n L_0x00b7:\n if (r7 != r0) goto L_0x01b8;\n L_0x00b9:\n r0 = com.google.android.gms.internal.clearcut.zzax.zzc(r12, r10);\n r9.putInt(r14, r2, r0);\n goto L_0x00f5;\n L_0x00c1:\n if (r7 != r6) goto L_0x01b8;\n L_0x00c3:\n r4 = com.google.android.gms.internal.clearcut.zzax.zzd(r12, r10);\n r0 = r9;\n r1 = r25;\n r0.putLong(r1, r2, r4);\n goto L_0x0102;\n L_0x00ce:\n if (r7 != 0) goto L_0x01b8;\n L_0x00d0:\n r0 = com.google.android.gms.internal.clearcut.zzax.zza(r12, r10, r11);\n r1 = r11.zzfd;\n L_0x00d6:\n r9.putInt(r14, r2, r1);\n goto L_0x0012;\n L_0x00db:\n if (r7 != 0) goto L_0x01b8;\n L_0x00dd:\n r6 = com.google.android.gms.internal.clearcut.zzax.zzb(r12, r10, r11);\n r4 = r11.zzfe;\n L_0x00e3:\n r0 = r9;\n r1 = r25;\n r0.putLong(r1, r2, r4);\n r0 = r6;\n goto L_0x0012;\n L_0x00ec:\n if (r7 != r0) goto L_0x01b8;\n L_0x00ee:\n r0 = com.google.android.gms.internal.clearcut.zzax.zzf(r12, r10);\n com.google.android.gms.internal.clearcut.zzfd.zza(r14, r2, r0);\n L_0x00f5:\n r0 = r10 + 4;\n goto L_0x0012;\n L_0x00f9:\n if (r7 != r6) goto L_0x01b8;\n L_0x00fb:\n r0 = com.google.android.gms.internal.clearcut.zzax.zze(r12, r10);\n com.google.android.gms.internal.clearcut.zzfd.zza(r14, r2, r0);\n L_0x0102:\n r0 = r10 + 8;\n goto L_0x0012;\n L_0x0106:\n r0 = 27;\n if (r4 != r0) goto L_0x013e;\n L_0x010a:\n if (r7 != r1) goto L_0x01b8;\n L_0x010c:\n r0 = r9.getObject(r14, r2);\n r0 = (com.google.android.gms.internal.clearcut.zzcn) r0;\n r1 = r0.zzu();\n if (r1 != 0) goto L_0x012a;\n L_0x0118:\n r1 = r0.size();\n if (r1 != 0) goto L_0x0121;\n L_0x011e:\n r1 = 10;\n goto L_0x0123;\n L_0x0121:\n r1 = r1 << 1;\n L_0x0123:\n r0 = r0.zzi(r1);\n r9.putObject(r14, r2, r0);\n L_0x012a:\n r5 = r0;\n r0 = r15.zzad(r8);\n r1 = r16;\n r2 = r26;\n r3 = r10;\n r4 = r28;\n r6 = r29;\n r0 = zza(r0, r1, r2, r3, r4, r5, r6);\n goto L_0x0012;\n L_0x013e:\n r0 = 49;\n if (r4 > r0) goto L_0x0177;\n L_0x0142:\n r0 = (long) r5;\n r17 = r0;\n r0 = r24;\n r1 = r25;\n r19 = r2;\n r2 = r26;\n r3 = r10;\n r5 = r4;\n r4 = r28;\n r21 = r5;\n r5 = r16;\n r22 = r9;\n r15 = r10;\n r9 = r17;\n r11 = r21;\n r12 = r19;\n r14 = r29;\n r0 = r0.zza(r1, r2, r3, r4, r5, r6, r7, r8, r9, r11, r12, r14);\n if (r0 != r15) goto L_0x0169;\n L_0x0166:\n r2 = r0;\n goto L_0x01bc;\n L_0x0169:\n r14 = r25;\n r12 = r26;\n r13 = r28;\n r11 = r29;\n r9 = r22;\n r15 = r24;\n goto L_0x0012;\n L_0x0177:\n r19 = r2;\n r21 = r4;\n r22 = r9;\n r15 = r10;\n r0 = 50;\n r9 = r21;\n if (r9 != r0) goto L_0x019e;\n L_0x0184:\n if (r7 != r1) goto L_0x019c;\n L_0x0186:\n r14 = r15;\n r0 = r24;\n r1 = r25;\n r2 = r26;\n r3 = r14;\n r4 = r28;\n r5 = r8;\n r7 = r19;\n r9 = r29;\n r0 = r0.zza(r1, r2, r3, r4, r5, r6, r7, r9);\n if (r0 != r14) goto L_0x01ca;\n L_0x019b:\n goto L_0x0166;\n L_0x019c:\n r14 = r15;\n goto L_0x01bb;\n L_0x019e:\n r14 = r15;\n r0 = r24;\n r1 = r25;\n r2 = r26;\n r3 = r14;\n r4 = r28;\n r10 = r5;\n r5 = r16;\n r12 = r8;\n r8 = r10;\n r10 = r19;\n r13 = r29;\n r0 = r0.zza(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r12, r13);\n if (r0 != r14) goto L_0x01ca;\n L_0x01b7:\n goto L_0x0166;\n L_0x01b8:\n r22 = r9;\n r14 = r10;\n L_0x01bb:\n r2 = r14;\n L_0x01bc:\n r0 = r16;\n r1 = r26;\n r3 = r28;\n r4 = r25;\n r5 = r29;\n r0 = zza(r0, r1, r2, r3, r4, r5);\n L_0x01ca:\n r15 = r24;\n r14 = r25;\n r12 = r26;\n r13 = r28;\n r11 = r29;\n r9 = r22;\n goto L_0x0012;\n L_0x01d8:\n r4 = r13;\n if (r0 != r4) goto L_0x01dc;\n L_0x01db:\n return;\n L_0x01dc:\n r0 = com.google.android.gms.internal.clearcut.zzco.zzbo();\n throw r0;\n L_0x01e1:\n r4 = r13;\n r5 = 0;\n r0 = r24;\n r1 = r25;\n r2 = r26;\n r3 = r27;\n r4 = r28;\n r6 = r29;\n r0.zza(r1, r2, r3, r4, r5, r6);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.clearcut.zzds.zza(java.lang.Object, byte[], int, int, com.google.android.gms.internal.clearcut.zzay):void\");\n }", "public static void createArchiveFile( final Configuration conf, final Path zipFile, final List<Path> files, int pathTrimCount, boolean isJar, Manifest jarManifest) throws IOException\r\n\t{\r\n\t\t\r\n\t\tFSDataOutputStream out = null;\r\n\t\tZipOutputStream zipOut = null;\r\n\t\t/** Did we actually write an entry to the zip file */\r\n\t\tboolean wroteOne = false;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tout = zipFile.getFileSystem(conf).create(zipFile);\r\n\t\t\tif (files.isEmpty()) {\r\n\t\t\t\treturn;\t/** Don't try to create a zip file with no entries it will throw. just return empty file. */\r\n\t\t\t}\r\n\t\t\tif (isJar) {\r\n\t\t\t\tif (jarManifest!=null) {\r\n\t\t\t\t\tzipOut = new JarOutputStream(out,jarManifest);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tzipOut = new JarOutputStream(out);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tzipOut = new ZipOutputStream(out);\r\n\t\t\t}\r\n\t\t\tfor ( Path file : files) {\r\n\t\t\t\tFSDataInputStream in = null;\r\n\t\t\t\t/** Try to complete the file even if a file fails. */\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFileSystem fileSystem = file.getFileSystem(conf);\r\n\t\t\t\t\tin = fileSystem.open(file);\r\n\t\t\t\t\tZipEntry zipEntry = new ZipEntry(pathTrim(file, pathTrimCount));\r\n\t\t\t\t\tzipOut.putNextEntry(zipEntry);\r\n\t\t\t\t\tIOUtils.copyBytes(in, zipOut, (int) Math.min(32768, fileSystem.getFileStatus(file).getLen()), false);\r\n\t\t\t\t\twroteOne = true;\r\n\t\t\t\t} catch( IOException e) {\r\n\t\t\t\t\tLOG.error( \"Unable to store \" + file + \" in zip file \" + zipFile + \", skipping\", e);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tif (in!=null) {\r\n\t\t\t\t\t\ttry { in.close(); } catch( IOException ignore ) {}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} finally { /** Ensure everything is always closed before the function exits */\r\n\t\t\t\r\n\t\t\tif (zipOut!=null&&wroteOne) {\r\n\t\t\t\tzipOut.closeEntry();\r\n\t\t\t\tzipOut.flush();\r\n\t\t\t\tzipOut.close();\r\n\t\t\t\tout = null;\r\n\t\t\t}\r\n\t\t\tif (out!=null) {\r\n\t\t\t\tout.close();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private boolean extractSettingsZip(File fSettingsZip, String destDir, int index)\n {\n boolean result = false;\n try\n {\n //m_logWriter.write(\"Unzipping to destination: \"+destDir+\"\\n\");\n //m_logWriter.flush();\n \tboolean backFavFile = false;\n \tFile dest = new File(destDir);\n \tif (dest.exists()) {\n \t\tString userPath = destDir + \"/userdata/\";\n \t\tFile userFile = new File(userPath);\n \t\tString favDir = userPath + Update.FavouriteFile;\n \t\tFile favFile = new File(favDir);\n \t\tif (userFile.exists() && favFile.exists()) {\n \t\t\tCopyFile(userPath, Update.FavouriteFile, Update.pathSD);\n \t\t\tbackFavFile = true;\n \t\t}\n \t\t\n \t\tDeleteDir(destDir);\n \t}\n \telse\n \t\tdest.mkdirs();\n \t\n publishProgress(PROGRESS_EXTRACT, (int)(0.5 * index));\n // open the zip\n ZipFile zip = new ZipFile(fSettingsZip);\n int count=0;\n int zipSize = zip.size();\n Enumeration<? extends ZipEntry> entries = zip.entries();\n //while(entries.hasMoreElements())\n while (true)\n {\n if (isCancelled()) {\n \tresult = false;\n \tm_ErrorCode = 4;\n break;\n }\n\n if (m_DownloadStop)\n \tcontinue;\n \n if (!entries.hasMoreElements())\n \tbreak;\n \n // todo: update progress\n ZipEntry ze = (ZipEntry)entries.nextElement();\n count++;\n String entryName = ze.getName();\n String destFullpath = destDir+\"/\"+entryName;\n //m_logWriter.write(\"Extracting: \"+destFullpath+\"\\n\");\n File fDestPath = new File(destFullpath);\n if (ze.isDirectory())\n {\n fDestPath.mkdirs();\n publishProgress(PROGRESS_EXTRACT, (int)(0.5 * (index + count*100/zipSize)));\n continue;\n }\n fDestPath.getParentFile().mkdirs();\n\n // write file\n try {\n InputStream is = zip.getInputStream(ze);\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFullpath));\n int n=0;\n byte buf[] = new byte[4096];\n while((n = is.read(buf, 0, 4096)) > -1)\n {\n bos.write(buf, 0, n);\n }\n // close\n is.close();\n bos.close();\n } catch(IOException ioe) {\n \tm_ErrorCode = 5;\n //m_logWriter.write(\"Could not write, error: \"+ioe.toString());\n }\n\n // update progress\n //publishProgress(PROGRESS_EXTRACT, (count*100/zipSize));\n }\n\n // close zip and bail\n zip.close();\n //m_logWriter.write(\"Successfully extracted: \"+fSettingsZip.getName()+\"\\n\");\n //m_logWriter.flush();\n if (backFavFile) {\n \t\tString userPath = destDir + \"/userdata/\";\n \t\tFile userFile = new File(userPath);\n \t\tif (!userFile.exists())\n \t\t\tuserFile.mkdirs();\n \t\t\n \t\tFile inputFile = new File(Update.pathSD + Update.FavouriteFile);\n \t\tif (inputFile.exists())\n \t\t\tCopyFile(Update.pathSD, Update.FavouriteFile, userPath);\n }\n \n result = !isCancelled();\n }\n catch(Exception e)\n {\n //Log.e(\"SettingsDownloader\", \"Error: \"+e.toString());\n result = false;\n m_ErrorCode = 6;\n }\n\n return result;\n }", "void importDivision(Connection con, ZipFile zip) throws Exception;", "public File getZipFile() {\n return distZip;\n }", "public void zipFiles() {\r\n byte[] buffer = new byte[1024];\r\n try {\r\n\r\n // On rare occasions, there will be a semi colon in the title name,\r\n // ruining everything while zipping the file.\r\n if (title.contains(\":\") || title.contains(\".\")) {\r\n String temp = \"\";\r\n for (int i = 0; i < title.length(); i++) {\r\n \r\n if (title.charAt(i) == ':' || title.charAt(i) == '.') {\r\n \r\n } else {\r\n temp += title.charAt(i);\r\n }\r\n }\r\n title = temp;\r\n }\r\n System.out.println(\"File name: \" + title);\r\n \r\n FileOutputStream fos = new FileOutputStream(savePath + \"\\\\\" + title + \".zip\");\r\n ZipOutputStream zos = new ZipOutputStream(fos);\r\n \r\n for (String fileName : fileNames) {\r\n \r\n System.out.println(\"zipping file: \" + fileName);\r\n \r\n fileName = savePath + \"\\\\\" + fileName;\r\n File srcFile = new File(fileName);\r\n FileInputStream fis;\r\n if (srcFile.exists()) {\r\n fis = new FileInputStream(srcFile);\r\n \r\n zos.putNextEntry(new ZipEntry(srcFile.getName()));\r\n int length;\r\n while ((length = fis.read(buffer)) > 0) {\r\n zos.write(buffer, 0, length);\r\n }\r\n zos.closeEntry();\r\n fis.close();\r\n \r\n boolean success = (new File(fileName)).delete();\r\n }\r\n }\r\n zos.close();\r\n \r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"File not found!\");\r\n } catch (IOException ex) {\r\n }\r\n }", "public interface UnzipCallback {\n\n /**\n * Get called when unzip completed\n * \n * @param output\n */\n void onUnzipCompleted(String output);\n }", "public ZipFileWriter(String zipFile) throws FileNotFoundException {\r\n\t\tFileOutputStream fos = new FileOutputStream(zipFile);\r\n\t\t// ajout du checksum\r\n\t\tCheckedOutputStream checksum = new CheckedOutputStream(fos,\r\n\t\t\t\tnew Adler32());\r\n\t\tthis.zos = new ZipOutputStream(new BufferedOutputStream(checksum));\r\n\t}", "private void compress()\n\t{\n\t\ttry\n\t\t{\n\t\t\tZipOutputStream rfoFile = new ZipOutputStream(new FileOutputStream(path + fileName)); \n\t\t\tFile dirToZip = new File(rfoDir); \n\t\t\tString[] fileList = dirToZip.list(); \n\t\t\tbyte[] buffer = new byte[4096]; \n\t\t\tint bytesIn = 0; \n\n\t\t\tfor(int i=0; i<fileList.length; i++) \n\t\t\t{ \n\t\t\t\tFile f = new File(dirToZip, fileList[i]); \n\t\t\t\tFileInputStream fis = new FileInputStream(f); \n\t\t\t\tString zEntry = f.getPath();\n\t\t\t\t//System.out.println(\"\\n\" + zEntry);\n\t\t\t\tint start = zEntry.indexOf(uniqueName);\n\t\t\t\tzEntry = zEntry.substring(start + uniqueName.length() + 1, zEntry.length());\n\t\t\t\t//System.out.println(tempDir);\n\t\t\t\t//System.out.println(zEntry + \"\\n\");\n\t\t\t\tZipEntry entry = new ZipEntry(zEntry); \n\t\t\t\trfoFile.putNextEntry(entry); \n\t\t\t\twhile((bytesIn = fis.read(buffer)) != -1) \n\t\t\t\t\trfoFile.write(buffer, 0, bytesIn); \n\t\t\t\tfis.close();\n\t\t\t}\n\t\t\trfoFile.close();\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.compress(): \" + e);\n\t\t}\n\t}", "private final int zza(T r18, byte[] r19, int r20, int r21, int r22, int r23, int r24, int r25, int r26, long r27, int r29, com.google.android.gms.internal.clearcut.zzay r30) throws java.io.IOException {\n /*\n r17 = this;\n r0 = r17;\n r1 = r18;\n r3 = r19;\n r4 = r20;\n r2 = r22;\n r8 = r23;\n r5 = r24;\n r9 = r27;\n r6 = r29;\n r11 = r30;\n r12 = zzmh;\n r7 = r0.zzmi;\n r13 = r6 + 2;\n r7 = r7[r13];\n r13 = 1048575; // 0xfffff float:1.469367E-39 double:5.18065E-318;\n r7 = r7 & r13;\n r13 = (long) r7;\n r7 = 5;\n r15 = 2;\n switch(r26) {\n case 51: goto L_0x0168;\n case 52: goto L_0x0158;\n case 53: goto L_0x0148;\n case 54: goto L_0x0148;\n case 55: goto L_0x013b;\n case 56: goto L_0x012f;\n case 57: goto L_0x0124;\n case 58: goto L_0x010e;\n case 59: goto L_0x00e2;\n case 60: goto L_0x00bc;\n case 61: goto L_0x00a4;\n case 62: goto L_0x013b;\n case 63: goto L_0x0076;\n case 64: goto L_0x0124;\n case 65: goto L_0x012f;\n case 66: goto L_0x0068;\n case 67: goto L_0x005a;\n case 68: goto L_0x0028;\n default: goto L_0x0026;\n };\n L_0x0026:\n goto L_0x017c;\n L_0x0028:\n r7 = 3;\n if (r5 != r7) goto L_0x017c;\n L_0x002b:\n r2 = r2 & -8;\n r7 = r2 | 4;\n r2 = r0.zzad(r6);\n r3 = r19;\n r4 = r20;\n r5 = r21;\n r6 = r7;\n r7 = r30;\n r2 = zza(r2, r3, r4, r5, r6, r7);\n r3 = r12.getInt(r1, r13);\n if (r3 != r8) goto L_0x004b;\n L_0x0046:\n r15 = r12.getObject(r1, r9);\n goto L_0x004c;\n L_0x004b:\n r15 = 0;\n L_0x004c:\n if (r15 != 0) goto L_0x0052;\n L_0x004e:\n r3 = r11.zzff;\n goto L_0x0154;\n L_0x0052:\n r3 = r11.zzff;\n r3 = com.google.android.gms.internal.clearcut.zzci.zza(r15, r3);\n goto L_0x0154;\n L_0x005a:\n if (r5 != 0) goto L_0x017c;\n L_0x005c:\n r2 = com.google.android.gms.internal.clearcut.zzax.zzb(r3, r4, r11);\n r3 = r11.zzfe;\n r3 = com.google.android.gms.internal.clearcut.zzbk.zza(r3);\n goto L_0x0150;\n L_0x0068:\n if (r5 != 0) goto L_0x017c;\n L_0x006a:\n r2 = com.google.android.gms.internal.clearcut.zzax.zza(r3, r4, r11);\n r3 = r11.zzfd;\n r3 = com.google.android.gms.internal.clearcut.zzbk.zzm(r3);\n goto L_0x0143;\n L_0x0076:\n if (r5 != 0) goto L_0x017c;\n L_0x0078:\n r3 = com.google.android.gms.internal.clearcut.zzax.zza(r3, r4, r11);\n r4 = r11.zzfd;\n r5 = r0.zzaf(r6);\n if (r5 == 0) goto L_0x009a;\n L_0x0084:\n r5 = r5.zzb(r4);\n if (r5 == 0) goto L_0x008b;\n L_0x008a:\n goto L_0x009a;\n L_0x008b:\n r1 = zzn(r18);\n r4 = (long) r4;\n r4 = java.lang.Long.valueOf(r4);\n r1.zzb(r2, r4);\n r2 = r3;\n goto L_0x017d;\n L_0x009a:\n r2 = java.lang.Integer.valueOf(r4);\n r12.putObject(r1, r9, r2);\n r2 = r3;\n goto L_0x0178;\n L_0x00a4:\n if (r5 != r15) goto L_0x017c;\n L_0x00a6:\n r2 = com.google.android.gms.internal.clearcut.zzax.zza(r3, r4, r11);\n r4 = r11.zzfd;\n if (r4 != 0) goto L_0x00b2;\n L_0x00ae:\n r3 = com.google.android.gms.internal.clearcut.zzbb.zzfi;\n goto L_0x0154;\n L_0x00b2:\n r3 = com.google.android.gms.internal.clearcut.zzbb.zzb(r3, r2, r4);\n r12.putObject(r1, r9, r3);\n L_0x00b9:\n r2 = r2 + r4;\n goto L_0x0178;\n L_0x00bc:\n if (r5 != r15) goto L_0x017c;\n L_0x00be:\n r2 = r0.zzad(r6);\n r5 = r21;\n r2 = zza(r2, r3, r4, r5, r11);\n r3 = r12.getInt(r1, r13);\n if (r3 != r8) goto L_0x00d3;\n L_0x00ce:\n r15 = r12.getObject(r1, r9);\n goto L_0x00d4;\n L_0x00d3:\n r15 = 0;\n L_0x00d4:\n if (r15 != 0) goto L_0x00da;\n L_0x00d6:\n r3 = r11.zzff;\n goto L_0x0154;\n L_0x00da:\n r3 = r11.zzff;\n r3 = com.google.android.gms.internal.clearcut.zzci.zza(r15, r3);\n goto L_0x0154;\n L_0x00e2:\n if (r5 != r15) goto L_0x017c;\n L_0x00e4:\n r2 = com.google.android.gms.internal.clearcut.zzax.zza(r3, r4, r11);\n r4 = r11.zzfd;\n if (r4 != 0) goto L_0x00ef;\n L_0x00ec:\n r3 = \"\";\n goto L_0x0154;\n L_0x00ef:\n r5 = 536870912; // 0x20000000 float:1.0842022E-19 double:2.652494739E-315;\n r5 = r25 & r5;\n if (r5 == 0) goto L_0x0103;\n L_0x00f5:\n r5 = r2 + r4;\n r5 = com.google.android.gms.internal.clearcut.zzff.zze(r3, r2, r5);\n if (r5 == 0) goto L_0x00fe;\n L_0x00fd:\n goto L_0x0103;\n L_0x00fe:\n r1 = com.google.android.gms.internal.clearcut.zzco.zzbp();\n throw r1;\n L_0x0103:\n r5 = new java.lang.String;\n r6 = com.google.android.gms.internal.clearcut.zzci.UTF_8;\n r5.<init>(r3, r2, r4, r6);\n r12.putObject(r1, r9, r5);\n goto L_0x00b9;\n L_0x010e:\n if (r5 != 0) goto L_0x017c;\n L_0x0110:\n r2 = com.google.android.gms.internal.clearcut.zzax.zzb(r3, r4, r11);\n r3 = r11.zzfe;\n r5 = 0;\n r7 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1));\n if (r7 == 0) goto L_0x011e;\n L_0x011c:\n r15 = 1;\n goto L_0x011f;\n L_0x011e:\n r15 = 0;\n L_0x011f:\n r3 = java.lang.Boolean.valueOf(r15);\n goto L_0x0154;\n L_0x0124:\n if (r5 != r7) goto L_0x017c;\n L_0x0126:\n r2 = com.google.android.gms.internal.clearcut.zzax.zzc(r19, r20);\n r2 = java.lang.Integer.valueOf(r2);\n goto L_0x0162;\n L_0x012f:\n r2 = 1;\n if (r5 != r2) goto L_0x017c;\n L_0x0132:\n r2 = com.google.android.gms.internal.clearcut.zzax.zzd(r19, r20);\n r2 = java.lang.Long.valueOf(r2);\n goto L_0x0173;\n L_0x013b:\n if (r5 != 0) goto L_0x017c;\n L_0x013d:\n r2 = com.google.android.gms.internal.clearcut.zzax.zza(r3, r4, r11);\n r3 = r11.zzfd;\n L_0x0143:\n r3 = java.lang.Integer.valueOf(r3);\n goto L_0x0154;\n L_0x0148:\n if (r5 != 0) goto L_0x017c;\n L_0x014a:\n r2 = com.google.android.gms.internal.clearcut.zzax.zzb(r3, r4, r11);\n r3 = r11.zzfe;\n L_0x0150:\n r3 = java.lang.Long.valueOf(r3);\n L_0x0154:\n r12.putObject(r1, r9, r3);\n goto L_0x0178;\n L_0x0158:\n if (r5 != r7) goto L_0x017c;\n L_0x015a:\n r2 = com.google.android.gms.internal.clearcut.zzax.zzf(r19, r20);\n r2 = java.lang.Float.valueOf(r2);\n L_0x0162:\n r12.putObject(r1, r9, r2);\n r2 = r4 + 4;\n goto L_0x0178;\n L_0x0168:\n r2 = 1;\n if (r5 != r2) goto L_0x017c;\n L_0x016b:\n r2 = com.google.android.gms.internal.clearcut.zzax.zze(r19, r20);\n r2 = java.lang.Double.valueOf(r2);\n L_0x0173:\n r12.putObject(r1, r9, r2);\n r2 = r4 + 8;\n L_0x0178:\n r12.putInt(r1, r13, r8);\n goto L_0x017d;\n L_0x017c:\n r2 = r4;\n L_0x017d:\n return r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.clearcut.zzds.zza(java.lang.Object, byte[], int, int, int, int, int, int, int, long, int, com.google.android.gms.internal.clearcut.zzay):int\");\n }" ]
[ "0.5382652", "0.5301716", "0.5293611", "0.5281589", "0.52726924", "0.52262735", "0.5218736", "0.51827186", "0.51671505", "0.514773", "0.51073253", "0.5098309", "0.5090201", "0.50887525", "0.508748", "0.5083619", "0.50731814", "0.50345916", "0.5034229", "0.50024754", "0.49763232", "0.4968932", "0.49646598", "0.49533415", "0.49390498", "0.49390498", "0.49258322", "0.49182713", "0.49131432", "0.49088603", "0.49033114", "0.49006924", "0.48970264", "0.4855953", "0.4834332", "0.48176473", "0.47852594", "0.4780989", "0.476475", "0.47541475", "0.4722856", "0.4722609", "0.47215316", "0.4705988", "0.46859613", "0.46790612", "0.46585864", "0.46422023", "0.4626614", "0.46220154", "0.46210393", "0.4610458", "0.46049488", "0.45922902", "0.4592262", "0.4577567", "0.45686483", "0.45583522", "0.4555418", "0.45330757", "0.45297232", "0.45277473", "0.45252416", "0.45089328", "0.45080143", "0.45035085", "0.4503276", "0.44988582", "0.4484164", "0.44625077", "0.44603273", "0.44515753", "0.4440898", "0.44404826", "0.4433715", "0.44219273", "0.44195542", "0.44187233", "0.44174185", "0.4416229", "0.44155085", "0.44104", "0.4409944", "0.44070712", "0.43977478", "0.43911913", "0.43896466", "0.43874487", "0.43869618", "0.4373561", "0.4367129", "0.4366539", "0.4360882", "0.43606916", "0.43573004", "0.43529356", "0.43489322", "0.43424168", "0.43412", "0.4339065" ]
0.81606513
0
TODO move business logic from view.
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); RecyclerView.ViewHolder viewHolder = null; View view; if (viewType == TaskDetail.VIEW_TYPE_EDIT_VALUE) { view = inflater.inflate(R.layout.item_detail_task_title, parent, false); viewHolder = new TaskTitleViewHolder(view); } else if (viewType == TaskDetail.VIEW_TYPE_ADD_SUBTASK || viewType == TaskDetail.VIEW_TYPE_NOTE || viewType == TaskDetail.VIEW_TYPE_SCHEDULE) { view = inflater.inflate(R.layout.item_detail_basic, parent, false); viewHolder = new BasicViewHolder(view); } else if (viewType == TaskDetail.VIEW_TYPE_SUBTASK) { view = inflater.inflate(R.layout.item_detail_subtask, parent, false); viewHolder = new SubtaskViewHolder(view); } return viewHolder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\n public void prepareView() {\n }", "@Override\n\tprotected void refreshView() {\n\t\t\n\t}", "@Override\n\tpublic void viewItem() {\n\t\t\n\t}", "@Override\n\tpublic void InitView() {\n\t\t\n\t}", "@Override\n\tprotected void RefreshView() {\n\t\t\n\t}", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "protected ReliedOnView() {}", "Object getViewDetails();", "@Override\n public void onViewCreate() {\n }", "public interface InformationView extends BaseView {\n String getPage();\n String getPagecount();\n void getDoctorNoticeList(ResultModel<List<InfoUserNoticeListBean>> model);\n\n String getUserUuid();\n void getInformationList(ResultModel<InformationBean> model);\n\n\n}", "@Override\n\tpublic void setView(Resultado resultado, HttpServletRequest request, HttpServletResponse response) {\n\n\t}", "@Override\n\tpublic void initView() {\n\t\t\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}", "protected void render(){}", "interface View {\n\n void displayError(String error);\n\n String getBarcode();\n \n String getDescription();\n \n BigDecimal getPrice();\n \n \n }", "interface RedeemView extends BaseView {\n\n void LoadingReddemData (List<RedeemResponse> redeemResponses );\n void hide_refreshView();\n void show_errorView(boolean Isshow , String error);\n}", "public interface TypeView extends BaseView {\n void getNewListEnd();\n\n void getNewListSuccess(List<New> news, int page);\n\n void getNewListError(String message, int page);\n}", "@Override\r\n\tpublic ModelAndView dataPreview(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\treturn null;\r\n\t}", "private void populateViewCollections() {\n\n\t}", "@Override\n\tpublic void refreshView() {\n\n\t}", "@Override\n public void Create() {\n\n initView();\n }", "public interface IOrderStatisticsView extends IBaseView {\n\n //所有订单\n void onGetStylistOrderCount(StylistOrderBean bean);\n //订单统计\n void getStylistTimeSliceOrder(List<List<OrderChartBean>> orderChartBeans);\n}", "@Override\n\tpublic View GetDynamicView() {\n\t\treturn null;\n\t}", "private void viewInit() {\n }", "public void execute(View view){\n //method in view to show the choice\n }", "private void producueViews() {\n if (splittedPostComponent != null && splittedPostComponent.size() > 0) {\n // loop through each component\n for (int i = 0; i < splittedPostComponent.size(); i++) {\n // create view if collection did not equal to empty string \"\"\n if (!splittedPostComponent.get(i).trim().equals(\"\")) {\n generateView(splittedPostComponent.get(i));\n }\n }\n }\n }", "void updateViewFromModel();", "void setupRender() {\n List<Predmet> predmets = adminService.findAllPredmetsForPredavac(predavac);\n // create a SelectModel from my izlistaj of colors\n predmetSelectModel = selectModelFactory.create(predmets, \"name\");\n years = adminService.getYears();\n// List<Aktivnost> activities = adminService.getActivities(1, 2015);\n }", "@Override\n protected void initViewSetup() {\n }", "@Override\n public void initView() {\n }", "@RequestMapping\n\tprotected String defaultView(RenderRequest renderRequest) {\n\t\tString tipoReplicador;\n\t\ttipoReplicador = renderRequest.getPreferences().getValue(\"tipoReplicador\", \"\");\n\n\t\trenderRequest.setAttribute(\"tipoReplicador\", tipoReplicador);\n\t\t// JSonUtil.LogAuditoria(renderRequest, indicadorPortlet, indicadorController);\n\n\t\treturn \"edit\";\n\t}", "public interface ListFrgView extends BaseView {\n void getDpSuccess(List<Map<String, Object>> testModel);\n}", "@Override\n\tpublic void staticFindViewByView() {\n\t\t\n\t}", "@Override\n public void initView() {\n\n }", "@Override\n public void updateView(Message msg)\n {\n \n }", "@Override\n public void beforeRender()\n {\n\n }", "public abstract String getView();", "public interface SearchView {\n void showPictureSuccess(int page, List<ResponseSearch.DataBean> dataBeen);\n void showNoMoreData();\n void showFailed();\n}", "@Override\n\t\tpublic void viewAccepted(View joiner) {\n\t\t}", "public interface NewBookView extends BaseView{\n void initData(List<NewBookBean> data);\n void showLoading();\n void showLoaded();\n}", "@Override\r\n\tpublic String detail() {\n\t\tSystem.out.println(\"detailView.\");\r\n\t\t//javax.servlet.http.HttpSession session=request.getSession();\r\n\t\t//javax.servlet.ServletContext application=request.getServletContext();\r\n\t\t\r\n\t\t//String vId=request.getParameter(\"id\");\r\n\t\tif(!SysFun.isNullOrEmpty(id)) {\r\n\t\t\tLong iId=SysFun.parseLong(id);\r\n\t\t\tHeadLine bean=headLineService.load(iId);\r\n\t\t\tif(bean!=null) {\r\n\t\t\t\trequest.put(\"bean\", bean);\r\n\t\t\t\treturn \"detail\";\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"detail\";\r\n\t}", "interface HistoryDetailsView {\n\n\n /**\n * <h>hideProgress</h>\n * <p>hide progress bar</p>\n */\n void hideProgress();\n\n /**\n * <h>showProgress</h>\n * <p>show progress bar</p>\n */\n void showProgress();\n void showError(String message, int code);\n void setViews(OrderDetailsModel orderedItemDetails, boolean isCityLogin);\n\n\n }", "public abstract View mo2155b();", "public interface ExpensesRecordView extends BaseView {\n void showData(List entityList);\n}", "public interface MyAcountView extends BaseView{\n void renderBalance(BalanceBean bean);\n}", "@Override\n\tpublic ModelAndView resolverView(PageContainer pContainer) throws Exception{\n\t\treturn null;\n\t}", "public interface StockTransferByAllocationView extends MvpView {\n\n void initViewPage(List<StockTransferWithAllocationSnBo> stockTransferWithAllocationSnBoList,int originDataSize, boolean isRefresh,int position);\n\n void dealPosition(List<StockTransferWithAllocationSnBo> stockTransferWithAllocationSnBo, int position,int size);\n\n}", "void view();", "public interface WalletBalanceView extends BaseView {\n void renderAccountInfo(NewAccountInfo info);\n}", "@Override\n protected View getUpperView() {\n return null;\n }", "public interface ClassifyView extends IView {\n\n void loadRv(UserLeftRvAdapter leftAdapter, UserRightRecAdapter rightAdapter);\n\n void loadBanner(List<BannerBean.RecordsBean> list);\n\n}", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "public interface OrderListsViewImpl extends IBaseViewImpl {\n void onOrderListSuccess(OrderListsResponseBean orderListBean);\n void onOrderListFailed(String msg);\n}", "public interface HomePageView extends BaseView{\n Context getContext();\n\n void getSummary(SummaryBean.Data repest);\n\n void getUserinfo(UserInfoBean.Data userInfo);\n\n}", "public interface AlreadyGetTaskView extends BaseView {\n\n String getPage();\n\n String getPerpage();\n\n /**\n * 查询类型 1未完成 2审核中 3已完成\n *\n * @return\n */\n String getTab();\n\n /**\n * 获得已完成的数据\n */\n void getUnCompleteSuccess(AlreadyGetTaskListInfo mAlreadyGetTaskListInfo,int maxpage);\n /**\n * 刷新\n */\n void doRefresh();\n\n /**\n * 获得审核中的数据\n */\n void getAuditSuccess();\n\n /**\n * 获得已完成的数据\n */\n void getCompleteSuccess();\n}", "public interface NoteView extends View{\n void showNotesResponse(Object response);\n void showNoteByUserIdAndEntityIdResponse (NoteResponse notesResponse);\n void showCreateProductNoteResponse(CreateProductNoteResponse createProductNoteResponse);\n}", "private void getDataFromView() throws EmptyTextFieldException, EmptyChoiceBoxException, NumberSmallerOneException {\n\n date = _view.getDate().getValue();\n title = _view.getTitle().getText();\n function = _view.getFunction().getText();\n protagonist = _view.getProtagonist().getText();\n source = _view.getSource().getText();\n references = _view.getReferences().getText();\n description = _view.getDescription().getText();\n checkForEmptyFields();\n\n priority = _view.getPriorityMap().get(_view.getPriority().getValue());\n classification = _view.getClassificationMap().get(_view.getClassification().getValue());\n checkForEmptyChoiceBox();\n\n id = Integer.parseInt(_view.getId().getText());\n ftr = Integer.parseInt(_view.getFtr().getText());\n det = Integer.parseInt(_view.getDet().getText());\n checkForNumbersSmallerOne();\n }", "@Override\n public void Create() {\n initView();\n initData();\n }", "public interface IQuotaConversionView extends IBaseView{\n\n void onNoAutoTransferInfo(ConversionInfoBean o);\n\n void onRefreshApis(UserAssert bankCards);\n\n void onTransfersMoney(QuotaConversionBean o);\n\n void onReconnectTransfer(QuotaConversionBean o);\n\n void onRefreshApi(ApiBean o);\n\n void selectedGame(String bankName,int index);\n\n void onRecovery(HttpResult refreshhApis);\n\n}", "public interface UserInfoView {\n\n void onGetUserData(List<UserBean> followings);\n\n\n\n}", "public abstract void viewRun();", "public interface PayView extends BaseView{\n void renderData(PayInfoBean bean);\n void paySuccess(PayResultBean bean);\n void payBalanceNotEnough();\n void payFail();\n void renderMyTaoCan(MyTaocanBean bean);\n}", "protected abstract void bindingView();", "private View() {}", "protected String getView() {\r\n/* 216 */ return \"/jsp/RoomView.jsp\";\r\n/* */ }", "interface PostsView extends BaseView {\n\n void setPosts(List<Post> posts);\n\n void showRetryMessage(Throwable throwable);\n\n void showError(Throwable throwable);\n\n void showProgress();\n\n void hideProgress();\n\n}", "void updateModelFromView();", "public interface ContractsView extends MvpView {\n void showContracts(LoadMoreWrapper wrapper,List<Contact> contacts);\n void showPayContactOrder(PayOrderContactDto payOrderContactDto);\n}", "private void addViews() {\n\t}", "@Override\n public JSONObject viewApprisalFormByDirector() {\n\n return in_apprisialformdao.viewApprisalFormByDirector();\n }", "protected abstract void populateView(View v, T model);", "public interface MyAttentionView extends BaseView {\n void attentionsuccess(MyAttentionBean myAttentionBean);\n void attentionerror();\n}", "protected void doView (RenderRequest request,\n\t\t RenderResponse response)\n throws PortletException, java.io.IOException\n {\n throw new PortletException(\"doView method not implemented\");\n }", "public void showNoteView(MyNoteDto noteDto);", "public void verHistorialCitas(View view){\n\n }", "@Override\n protected ModelAndView handleRequestInternal(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception {\n\t\t\t\n\t\tString result = \"indexAdmin\";\n\t\ttry {\n\t\t\tif(action.doWork(request))\n\t\t\t\tresult = \"viewFonti\";\n\t\t}catch(Exception e){e.printStackTrace();}\n\t\t\n\t\t/*Aggiungo la lista delle fonti alla pagina*/\n\t\tList<Fonte> listaFonti = (List<Fonte>)request.getAttribute(\"listaFonti\");\n\t\tList<Statistics> listaStatistiche = (List<Statistics>) request.getAttribute(\"listaStatistiche\");\n\t\tModelAndView m = new ModelAndView(result);\n\t\tm.addObject(\"listaFonti\", listaFonti);\n\t\tm.addObject(\"listaStatistiche\", listaStatistiche);\n\t\treturn m;\n\t}", "protected Object getViewData() {\n\t\treturn view.getViewData();\n\t}", "public interface JoinCartView extends BaseView {\n void succcessful(JoinCart cart);\n\n void failed(Exception e);\n}", "public interface IBufbkView {\n void queryBufbkListSuccess(List<EntityBufbk> entityBufbkList);\n void queryBufbkListFail(Exception e);\n// void queryBufbkDetailSuccess(List<EntityBufbkFeedback> entityBufbk);\n// void queryBufbkDetailFail(Exception se);\n\n}", "public interface DailyView {\n void onLoadDaily(List<DailyModel> daily);\n}", "@Override\r\n\tpublic void render() {\n\t\t\r\n\t}", "protected void viewSetup() {\n\t\t// TODO Auto-generated method stub\n\n\t}", "public interface WaterAndSandDetailsView extends BaseView {\n void successData(Map<String, String> data);\n\n}", "@RequestMapping(\"/reply_view\")\n\tpublic String reply_view(HttpServletRequest request, Model model) {\n\t\tBDto dto = dao.reply_view(request.getParameter(\"bId\"));\n\t\tmodel.addAttribute(\"reply_view\", dto);\n\t\treturn \"reply_view\";\n\t}", "public ViewFinalFixAction() {\n this.viewData = new StudioFinalFixDTO();\n }", "@Override\r\n\tpublic String update() {\n\t\tSystem.out.println(\"updateView.\");\r\n\t\t\r\n\t\t//javax.servlet.http.HttpSession session=request.getSession();\r\n\t\t//javax.servlet.ServletContext application=request.getServletContext();\r\n\t\t\r\n\t\t//String vId=request.getParameter(\"id\");\r\n\t\tif(!SysFun.isNullOrEmpty(id)) {\r\n\t\t\tLong iId=SysFun.parseLong(id);\r\n\t\t\tHeadLine bean=headLineService.load(iId);\r\n\t\t\t\r\n\t\t\tif(bean!=null) {\r\n\t\t\t\t\r\n\t\t\t\trequest.put(\"Id\", bean.getId());\r\n\t\t\t\trequest.put(\"lineName\", bean.getLineName());\r\n\t\t\t\trequest.put(\"lineLink\", bean.getLineLink());\r\n\t\t\t\t//request.put(\"lineImg\", bean.getLineImg());\r\n\t\t\t\treturn \"update\";\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn \"go_preload\";\r\n\t}", "private void processObject( HttpServletResponse oResponse, Object oViewObject ) throws ViewExecutorException\r\n {\n try\r\n {\r\n oResponse.getWriter().print( oViewObject );\r\n }\r\n catch ( IOException e )\r\n {\r\n throw new ViewExecutorException( \"View \" + oViewObject.getClass().getName() + \", generic object view I/O error\", e );\r\n }\r\n }", "public void initView(){}", "private void initView() {\n\n }", "void setupRender() {\n List<Predmet> predmets = adminService.findAllPredmetsForPredavac(predavac);\n\n // create a SelectModel from my izlistaj of colors\n predmetSelectModel = selectModelFactory.create(predmets, \"name\");\n }", "public interface ICollectView extends IBaseView {\n\n void showResult(int result);\n\n void showResult(long result);\n\n void showList(List<CollectBean> list);\n}" ]
[ "0.6352832", "0.61935586", "0.61935586", "0.61018366", "0.6097702", "0.6097702", "0.6057193", "0.5973011", "0.59212345", "0.5921226", "0.5912992", "0.58622044", "0.58622044", "0.5857603", "0.5823805", "0.57559574", "0.5751031", "0.5714346", "0.5686387", "0.56784075", "0.56784075", "0.56747663", "0.5673173", "0.56484807", "0.5632071", "0.56225085", "0.56039184", "0.5579175", "0.5551075", "0.5547247", "0.55457824", "0.554461", "0.5528105", "0.55236727", "0.55141795", "0.55133075", "0.5511601", "0.55000496", "0.549757", "0.5494308", "0.54857546", "0.54751253", "0.54722595", "0.5470556", "0.5470295", "0.5459904", "0.5455258", "0.5453005", "0.5444309", "0.54260236", "0.5421881", "0.5415099", "0.54100055", "0.54058444", "0.5390418", "0.53898615", "0.53861827", "0.53808266", "0.5379785", "0.5374063", "0.5368725", "0.5368725", "0.5360552", "0.5356393", "0.5354639", "0.5354464", "0.53500646", "0.5349226", "0.5346366", "0.53428113", "0.5336833", "0.5330627", "0.5318685", "0.53157675", "0.53060466", "0.530506", "0.530448", "0.5300407", "0.5293741", "0.5293095", "0.5292272", "0.52877784", "0.5287546", "0.52803946", "0.5277935", "0.52773094", "0.52770543", "0.5275747", "0.5275134", "0.5271043", "0.5269271", "0.5267711", "0.52643776", "0.5263528", "0.5262215", "0.52620023", "0.5261559", "0.52599615", "0.5258864", "0.5251401", "0.52501726" ]
0.0
-1
TODO move business logic from view.
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { int viewType = holder.getItemViewType(); if (viewType == TaskDetail.VIEW_TYPE_EDIT_VALUE) { presenter.bindTaskTitleViewToValue((TaskTitleViewHolder) holder, position); } else if (viewType == TaskDetail.VIEW_TYPE_ADD_SUBTASK || viewType == TaskDetail.VIEW_TYPE_NOTE || viewType == TaskDetail.VIEW_TYPE_SCHEDULE) { presenter.bindBasicViewToValue((BasicViewHolder) holder, position); } else if (viewType == TaskDetail.VIEW_TYPE_SUBTASK) { presenter.bindSubtaskViewToValue((SubtaskViewHolder) holder, position); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\n public void prepareView() {\n }", "@Override\n\tprotected void refreshView() {\n\t\t\n\t}", "@Override\n\tpublic void viewItem() {\n\t\t\n\t}", "@Override\n\tpublic void InitView() {\n\t\t\n\t}", "@Override\n\tprotected void RefreshView() {\n\t\t\n\t}", "@Override\n protected void initView() {\n }", "@Override\n protected void initView() {\n }", "protected ReliedOnView() {}", "Object getViewDetails();", "@Override\n public void onViewCreate() {\n }", "public interface InformationView extends BaseView {\n String getPage();\n String getPagecount();\n void getDoctorNoticeList(ResultModel<List<InfoUserNoticeListBean>> model);\n\n String getUserUuid();\n void getInformationList(ResultModel<InformationBean> model);\n\n\n}", "@Override\n\tpublic void setView(Resultado resultado, HttpServletRequest request, HttpServletResponse response) {\n\n\t}", "@Override\n\tpublic void initView() {\n\t\t\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}", "protected void render(){}", "interface View {\n\n void displayError(String error);\n\n String getBarcode();\n \n String getDescription();\n \n BigDecimal getPrice();\n \n \n }", "interface RedeemView extends BaseView {\n\n void LoadingReddemData (List<RedeemResponse> redeemResponses );\n void hide_refreshView();\n void show_errorView(boolean Isshow , String error);\n}", "public interface TypeView extends BaseView {\n void getNewListEnd();\n\n void getNewListSuccess(List<New> news, int page);\n\n void getNewListError(String message, int page);\n}", "@Override\r\n\tpublic ModelAndView dataPreview(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\treturn null;\r\n\t}", "private void populateViewCollections() {\n\n\t}", "@Override\n\tpublic void refreshView() {\n\n\t}", "@Override\n public void Create() {\n\n initView();\n }", "public interface IOrderStatisticsView extends IBaseView {\n\n //所有订单\n void onGetStylistOrderCount(StylistOrderBean bean);\n //订单统计\n void getStylistTimeSliceOrder(List<List<OrderChartBean>> orderChartBeans);\n}", "@Override\n\tpublic View GetDynamicView() {\n\t\treturn null;\n\t}", "private void viewInit() {\n }", "public void execute(View view){\n //method in view to show the choice\n }", "private void producueViews() {\n if (splittedPostComponent != null && splittedPostComponent.size() > 0) {\n // loop through each component\n for (int i = 0; i < splittedPostComponent.size(); i++) {\n // create view if collection did not equal to empty string \"\"\n if (!splittedPostComponent.get(i).trim().equals(\"\")) {\n generateView(splittedPostComponent.get(i));\n }\n }\n }\n }", "void updateViewFromModel();", "void setupRender() {\n List<Predmet> predmets = adminService.findAllPredmetsForPredavac(predavac);\n // create a SelectModel from my izlistaj of colors\n predmetSelectModel = selectModelFactory.create(predmets, \"name\");\n years = adminService.getYears();\n// List<Aktivnost> activities = adminService.getActivities(1, 2015);\n }", "@Override\n protected void initViewSetup() {\n }", "@Override\n public void initView() {\n }", "@RequestMapping\n\tprotected String defaultView(RenderRequest renderRequest) {\n\t\tString tipoReplicador;\n\t\ttipoReplicador = renderRequest.getPreferences().getValue(\"tipoReplicador\", \"\");\n\n\t\trenderRequest.setAttribute(\"tipoReplicador\", tipoReplicador);\n\t\t// JSonUtil.LogAuditoria(renderRequest, indicadorPortlet, indicadorController);\n\n\t\treturn \"edit\";\n\t}", "public interface ListFrgView extends BaseView {\n void getDpSuccess(List<Map<String, Object>> testModel);\n}", "@Override\n\tpublic void staticFindViewByView() {\n\t\t\n\t}", "@Override\n public void initView() {\n\n }", "@Override\n public void updateView(Message msg)\n {\n \n }", "@Override\n public void beforeRender()\n {\n\n }", "public abstract String getView();", "public interface SearchView {\n void showPictureSuccess(int page, List<ResponseSearch.DataBean> dataBeen);\n void showNoMoreData();\n void showFailed();\n}", "@Override\n\t\tpublic void viewAccepted(View joiner) {\n\t\t}", "public interface NewBookView extends BaseView{\n void initData(List<NewBookBean> data);\n void showLoading();\n void showLoaded();\n}", "@Override\r\n\tpublic String detail() {\n\t\tSystem.out.println(\"detailView.\");\r\n\t\t//javax.servlet.http.HttpSession session=request.getSession();\r\n\t\t//javax.servlet.ServletContext application=request.getServletContext();\r\n\t\t\r\n\t\t//String vId=request.getParameter(\"id\");\r\n\t\tif(!SysFun.isNullOrEmpty(id)) {\r\n\t\t\tLong iId=SysFun.parseLong(id);\r\n\t\t\tHeadLine bean=headLineService.load(iId);\r\n\t\t\tif(bean!=null) {\r\n\t\t\t\trequest.put(\"bean\", bean);\r\n\t\t\t\treturn \"detail\";\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"detail\";\r\n\t}", "interface HistoryDetailsView {\n\n\n /**\n * <h>hideProgress</h>\n * <p>hide progress bar</p>\n */\n void hideProgress();\n\n /**\n * <h>showProgress</h>\n * <p>show progress bar</p>\n */\n void showProgress();\n void showError(String message, int code);\n void setViews(OrderDetailsModel orderedItemDetails, boolean isCityLogin);\n\n\n }", "public abstract View mo2155b();", "public interface ExpensesRecordView extends BaseView {\n void showData(List entityList);\n}", "public interface MyAcountView extends BaseView{\n void renderBalance(BalanceBean bean);\n}", "@Override\n\tpublic ModelAndView resolverView(PageContainer pContainer) throws Exception{\n\t\treturn null;\n\t}", "public interface StockTransferByAllocationView extends MvpView {\n\n void initViewPage(List<StockTransferWithAllocationSnBo> stockTransferWithAllocationSnBoList,int originDataSize, boolean isRefresh,int position);\n\n void dealPosition(List<StockTransferWithAllocationSnBo> stockTransferWithAllocationSnBo, int position,int size);\n\n}", "void view();", "public interface WalletBalanceView extends BaseView {\n void renderAccountInfo(NewAccountInfo info);\n}", "@Override\n protected View getUpperView() {\n return null;\n }", "public interface ClassifyView extends IView {\n\n void loadRv(UserLeftRvAdapter leftAdapter, UserRightRecAdapter rightAdapter);\n\n void loadBanner(List<BannerBean.RecordsBean> list);\n\n}", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}", "public interface OrderListsViewImpl extends IBaseViewImpl {\n void onOrderListSuccess(OrderListsResponseBean orderListBean);\n void onOrderListFailed(String msg);\n}", "public interface HomePageView extends BaseView{\n Context getContext();\n\n void getSummary(SummaryBean.Data repest);\n\n void getUserinfo(UserInfoBean.Data userInfo);\n\n}", "public interface AlreadyGetTaskView extends BaseView {\n\n String getPage();\n\n String getPerpage();\n\n /**\n * 查询类型 1未完成 2审核中 3已完成\n *\n * @return\n */\n String getTab();\n\n /**\n * 获得已完成的数据\n */\n void getUnCompleteSuccess(AlreadyGetTaskListInfo mAlreadyGetTaskListInfo,int maxpage);\n /**\n * 刷新\n */\n void doRefresh();\n\n /**\n * 获得审核中的数据\n */\n void getAuditSuccess();\n\n /**\n * 获得已完成的数据\n */\n void getCompleteSuccess();\n}", "public interface NoteView extends View{\n void showNotesResponse(Object response);\n void showNoteByUserIdAndEntityIdResponse (NoteResponse notesResponse);\n void showCreateProductNoteResponse(CreateProductNoteResponse createProductNoteResponse);\n}", "private void getDataFromView() throws EmptyTextFieldException, EmptyChoiceBoxException, NumberSmallerOneException {\n\n date = _view.getDate().getValue();\n title = _view.getTitle().getText();\n function = _view.getFunction().getText();\n protagonist = _view.getProtagonist().getText();\n source = _view.getSource().getText();\n references = _view.getReferences().getText();\n description = _view.getDescription().getText();\n checkForEmptyFields();\n\n priority = _view.getPriorityMap().get(_view.getPriority().getValue());\n classification = _view.getClassificationMap().get(_view.getClassification().getValue());\n checkForEmptyChoiceBox();\n\n id = Integer.parseInt(_view.getId().getText());\n ftr = Integer.parseInt(_view.getFtr().getText());\n det = Integer.parseInt(_view.getDet().getText());\n checkForNumbersSmallerOne();\n }", "@Override\n public void Create() {\n initView();\n initData();\n }", "public interface IQuotaConversionView extends IBaseView{\n\n void onNoAutoTransferInfo(ConversionInfoBean o);\n\n void onRefreshApis(UserAssert bankCards);\n\n void onTransfersMoney(QuotaConversionBean o);\n\n void onReconnectTransfer(QuotaConversionBean o);\n\n void onRefreshApi(ApiBean o);\n\n void selectedGame(String bankName,int index);\n\n void onRecovery(HttpResult refreshhApis);\n\n}", "public interface UserInfoView {\n\n void onGetUserData(List<UserBean> followings);\n\n\n\n}", "public abstract void viewRun();", "public interface PayView extends BaseView{\n void renderData(PayInfoBean bean);\n void paySuccess(PayResultBean bean);\n void payBalanceNotEnough();\n void payFail();\n void renderMyTaoCan(MyTaocanBean bean);\n}", "protected abstract void bindingView();", "private View() {}", "protected String getView() {\r\n/* 216 */ return \"/jsp/RoomView.jsp\";\r\n/* */ }", "interface PostsView extends BaseView {\n\n void setPosts(List<Post> posts);\n\n void showRetryMessage(Throwable throwable);\n\n void showError(Throwable throwable);\n\n void showProgress();\n\n void hideProgress();\n\n}", "void updateModelFromView();", "public interface ContractsView extends MvpView {\n void showContracts(LoadMoreWrapper wrapper,List<Contact> contacts);\n void showPayContactOrder(PayOrderContactDto payOrderContactDto);\n}", "private void addViews() {\n\t}", "@Override\n public JSONObject viewApprisalFormByDirector() {\n\n return in_apprisialformdao.viewApprisalFormByDirector();\n }", "protected abstract void populateView(View v, T model);", "public interface MyAttentionView extends BaseView {\n void attentionsuccess(MyAttentionBean myAttentionBean);\n void attentionerror();\n}", "protected void doView (RenderRequest request,\n\t\t RenderResponse response)\n throws PortletException, java.io.IOException\n {\n throw new PortletException(\"doView method not implemented\");\n }", "public void showNoteView(MyNoteDto noteDto);", "public void verHistorialCitas(View view){\n\n }", "@Override\n protected ModelAndView handleRequestInternal(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception {\n\t\t\t\n\t\tString result = \"indexAdmin\";\n\t\ttry {\n\t\t\tif(action.doWork(request))\n\t\t\t\tresult = \"viewFonti\";\n\t\t}catch(Exception e){e.printStackTrace();}\n\t\t\n\t\t/*Aggiungo la lista delle fonti alla pagina*/\n\t\tList<Fonte> listaFonti = (List<Fonte>)request.getAttribute(\"listaFonti\");\n\t\tList<Statistics> listaStatistiche = (List<Statistics>) request.getAttribute(\"listaStatistiche\");\n\t\tModelAndView m = new ModelAndView(result);\n\t\tm.addObject(\"listaFonti\", listaFonti);\n\t\tm.addObject(\"listaStatistiche\", listaStatistiche);\n\t\treturn m;\n\t}", "protected Object getViewData() {\n\t\treturn view.getViewData();\n\t}", "public interface JoinCartView extends BaseView {\n void succcessful(JoinCart cart);\n\n void failed(Exception e);\n}", "public interface IBufbkView {\n void queryBufbkListSuccess(List<EntityBufbk> entityBufbkList);\n void queryBufbkListFail(Exception e);\n// void queryBufbkDetailSuccess(List<EntityBufbkFeedback> entityBufbk);\n// void queryBufbkDetailFail(Exception se);\n\n}", "public interface DailyView {\n void onLoadDaily(List<DailyModel> daily);\n}", "@Override\r\n\tpublic void render() {\n\t\t\r\n\t}", "protected void viewSetup() {\n\t\t// TODO Auto-generated method stub\n\n\t}", "public interface WaterAndSandDetailsView extends BaseView {\n void successData(Map<String, String> data);\n\n}", "@RequestMapping(\"/reply_view\")\n\tpublic String reply_view(HttpServletRequest request, Model model) {\n\t\tBDto dto = dao.reply_view(request.getParameter(\"bId\"));\n\t\tmodel.addAttribute(\"reply_view\", dto);\n\t\treturn \"reply_view\";\n\t}", "public ViewFinalFixAction() {\n this.viewData = new StudioFinalFixDTO();\n }", "@Override\r\n\tpublic String update() {\n\t\tSystem.out.println(\"updateView.\");\r\n\t\t\r\n\t\t//javax.servlet.http.HttpSession session=request.getSession();\r\n\t\t//javax.servlet.ServletContext application=request.getServletContext();\r\n\t\t\r\n\t\t//String vId=request.getParameter(\"id\");\r\n\t\tif(!SysFun.isNullOrEmpty(id)) {\r\n\t\t\tLong iId=SysFun.parseLong(id);\r\n\t\t\tHeadLine bean=headLineService.load(iId);\r\n\t\t\t\r\n\t\t\tif(bean!=null) {\r\n\t\t\t\t\r\n\t\t\t\trequest.put(\"Id\", bean.getId());\r\n\t\t\t\trequest.put(\"lineName\", bean.getLineName());\r\n\t\t\t\trequest.put(\"lineLink\", bean.getLineLink());\r\n\t\t\t\t//request.put(\"lineImg\", bean.getLineImg());\r\n\t\t\t\treturn \"update\";\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn \"go_preload\";\r\n\t}", "private void processObject( HttpServletResponse oResponse, Object oViewObject ) throws ViewExecutorException\r\n {\n try\r\n {\r\n oResponse.getWriter().print( oViewObject );\r\n }\r\n catch ( IOException e )\r\n {\r\n throw new ViewExecutorException( \"View \" + oViewObject.getClass().getName() + \", generic object view I/O error\", e );\r\n }\r\n }", "public void initView(){}", "private void initView() {\n\n }", "void setupRender() {\n List<Predmet> predmets = adminService.findAllPredmetsForPredavac(predavac);\n\n // create a SelectModel from my izlistaj of colors\n predmetSelectModel = selectModelFactory.create(predmets, \"name\");\n }", "public interface ICollectView extends IBaseView {\n\n void showResult(int result);\n\n void showResult(long result);\n\n void showList(List<CollectBean> list);\n}" ]
[ "0.6352832", "0.61935586", "0.61935586", "0.61018366", "0.6097702", "0.6097702", "0.6057193", "0.5973011", "0.59212345", "0.5921226", "0.5912992", "0.58622044", "0.58622044", "0.5857603", "0.5823805", "0.57559574", "0.5751031", "0.5714346", "0.5686387", "0.56784075", "0.56784075", "0.56747663", "0.5673173", "0.56484807", "0.5632071", "0.56225085", "0.56039184", "0.5579175", "0.5551075", "0.5547247", "0.55457824", "0.554461", "0.5528105", "0.55236727", "0.55141795", "0.55133075", "0.5511601", "0.55000496", "0.549757", "0.5494308", "0.54857546", "0.54751253", "0.54722595", "0.5470556", "0.5470295", "0.5459904", "0.5455258", "0.5453005", "0.5444309", "0.54260236", "0.5421881", "0.5415099", "0.54100055", "0.54058444", "0.5390418", "0.53898615", "0.53861827", "0.53808266", "0.5379785", "0.5374063", "0.5368725", "0.5368725", "0.5360552", "0.5356393", "0.5354639", "0.5354464", "0.53500646", "0.5349226", "0.5346366", "0.53428113", "0.5336833", "0.5330627", "0.5318685", "0.53157675", "0.53060466", "0.530506", "0.530448", "0.5300407", "0.5293741", "0.5293095", "0.5292272", "0.52877784", "0.5287546", "0.52803946", "0.5277935", "0.52773094", "0.52770543", "0.5275747", "0.5275134", "0.5271043", "0.5269271", "0.5267711", "0.52643776", "0.5263528", "0.5262215", "0.52620023", "0.5261559", "0.52599615", "0.5258864", "0.5251401", "0.52501726" ]
0.0
-1
Clears the current contents of this object and prepares it for reuse.
public void clear() { super.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clear() {\n\t\tthis.contents.clear();\n\t}", "public void clear() {\r\n init();\r\n }", "public void clear() {\n this.init(buffer.length);\n }", "public void clear() {\n this.data().clear();\n }", "public void clear () {\n\t\treset();\n\t}", "@Override\n public void clear() {\n initialize();\n }", "public final void clear() {\n clear(true);\n }", "void clear() {\n data = new Data(this);\n }", "public synchronized void clear()\n {\n clear(false);\n }", "@Override\n public synchronized void clear() {\n }", "public void clear() {\n doClear( false );\n }", "void clear() {\n\t\tdispose();\n\t}", "public void clear() {\n doClear();\n }", "public void clear() {\r\n\t\tdata.clear();\r\n\r\n\t}", "public void clear()\n {\n }", "@Override\n public void clear() {\n \n }", "public void clear() {\n\t\t\r\n\t}", "public void clear()\n {\n current = null;\n size = 0;\n }", "public void reset () {\n\t\topen();\n\t\ttry {\n\t\t\tcontainer.setLength(0);\n\t\t\treservedBitMap.setLength(0);\n\t\t\tupdatedBitMap.setLength(0);\n\t\t\tfreeList.setLength(0);\n\t\t\tsize = 0;\n\t\t}\n\t\tcatch (IOException ie) {\n\t\t\tthrow new WrappingRuntimeException(ie);\n\t\t}\n\t}", "@Override public void clear() {\n }", "@Override\r\n\tpublic void clear() {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void clear() {\n\t\t\t\t\n\t\t\t}", "public void clear() {\n\t\tbufferLast = 0;\n\t\tbufferIndex = 0;\n\t}", "@Override\n\t\tpublic void clear() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void clear() {\n\t\t\t\n\t\t}", "private void reset() {\n\t\tdata.clear();\n\t}", "public void clear() {\n\t\tcurrentSize = 0;\n\t}", "@Override\n public void clear() {\n isLoaded = false;\n }", "@Override\n public void clear()\n {\n }", "public void clear(){\n this.clearing = true;\n }", "public void clear() {\n\t\tthis.sizeinbits = 0;\n\t\tthis.actualsizeinwords = 1;\n\t\tthis.rlw.position = 0;\n\t\t// buffer is not fully cleared but any new set operations should\n\t\t// overwrite stale data\n\t\tthis.buffer[0] = 0;\n\t}", "public void clear()\n {\n keys.clear();\n comments.clear();\n data.clear();\n }", "@Override\n public void clear() {\n super.clear();\n }", "@Override\n public void clearData() {\n }", "public void clear() {\n items.clear();\n update();\n }", "public void clear() {\n super.clear();\n locationToWidget.clear();\n widgetToCaptionWrapper.clear();\n }", "public void clear() {\n context = null;\n nestedElements.clear();\n }", "private void clear() {\n }", "@Override\n protected void clear() {\n\n }", "public void clear() {\r\n items.clear();\r\n keys.clear();\r\n }", "public synchronized void clear() {\n _setModel(null);\n _lastParseTime = -1;\n }", "public Builder clearContents() {\n bitField0_ = (bitField0_ & ~0x00000004);\n contents_ = getDefaultInstance().getContents();\n onChanged();\n return this;\n }", "@Override\n public void clear()\n {\n\n }", "@Override\n public void clear() {\n size = 0;\n storage = null;\n }", "public Builder clearContent() {\n copyOnWrite();\n instance.clearContent();\n return this;\n }", "public Builder clearContent() {\n copyOnWrite();\n instance.clearContent();\n return this;\n }", "public Builder clearContents() {\n bitField0_ = (bitField0_ & ~0x00000001);\n contents_ = getDefaultInstance().getContents();\n onChanged();\n return this;\n }", "public void clear(){\n\t\tclear(0);\n\t}", "public Builder clearContent() {\n copyOnWrite();\n instance.clearContent();\n return this;\n }", "public Builder clearContent() {\n copyOnWrite();\n instance.clearContent();\n return this;\n }", "public void clear() {\n\n\t}", "public void clear(){\r\n currentSize = 0;\r\n }", "protected void reset()\n {\n this.shapeDataCache.removeAllEntries();\n this.sector = null;\n }", "public void clear() {\n\n\t\tdata = null;\n\t\tnumRows = 0;\n\t\tnumCols = 0;\n\t\tsize = 0L;\n\n\t}", "@Override\n public void clear() {\n size = 0;\n first = null;\n last = null;\n }", "@Override\r\n\tpublic void clear() {\n\r\n\t}", "private void clearContent() {\n \n content_ = getDefaultInstance().getContent();\n }", "private void clearContent() {\n \n content_ = getDefaultInstance().getContent();\n }", "public Builder clearObject() {\n if (objectBuilder_ == null) {\n object_ = null;\n onChanged();\n } else {\n object_ = null;\n objectBuilder_ = null;\n }\n\n return this;\n }", "@Override\n public void clear() {\n initialized = false;\n }", "public void clear() {\n }", "@Override\n\tpublic void clear() {\n\t}", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "public void clear() {\n }", "public void clear() {\n }", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();" ]
[ "0.743447", "0.74014795", "0.738529", "0.7317419", "0.7231902", "0.7225262", "0.7207089", "0.7143764", "0.7135566", "0.7049034", "0.704184", "0.7038369", "0.701683", "0.70141226", "0.6973435", "0.69579303", "0.6943925", "0.6938591", "0.6913943", "0.69135195", "0.6911195", "0.6903408", "0.6901398", "0.68961245", "0.68961245", "0.6890432", "0.68848747", "0.68635523", "0.68626493", "0.6861654", "0.6857426", "0.6856091", "0.68455875", "0.68454486", "0.68313456", "0.6823192", "0.68093544", "0.6807432", "0.6800937", "0.6796491", "0.6795596", "0.67882615", "0.6786292", "0.6785871", "0.6784748", "0.6784748", "0.678037", "0.67603624", "0.6755035", "0.6755035", "0.6753298", "0.67519134", "0.6750719", "0.6735537", "0.6735407", "0.6734765", "0.6726215", "0.6726215", "0.67238986", "0.6719094", "0.6703874", "0.669772", "0.6694601", "0.6694601", "0.6694601", "0.6690619", "0.6690619", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866", "0.66816866" ]
0.71300006
9
Decode a UPA message into a market by order close message.
@Override public int decode(DecodeIterator dIter, Msg msg) { clear(); if (msg.msgClass() != MsgClasses.CLOSE) return CodecReturnCodes.FAILURE; streamId(msg.streamId()); return CodecReturnCodes.SUCCESS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "IMessage decode(byte[] data) throws InvalidMessageException;", "public String decode(String message)\n\t{\n\t\treturn decode(message, 0);\n\t}", "public String decode(String message) {\n if (message == null || message.isEmpty()) {\n return \"\";\n }\n StringBuilder source = new StringBuilder(message);\n StringBuilder target = new StringBuilder();\n while (source.length() >= 8) {\n String substring = source.substring(0,8);\n source.delete(0, 8);\n target.append(decodeByte(substring));\n }\n int bitOverlap = target.length() % 8;\n if (bitOverlap > 0 && target.length() > 8) {\n target.delete(target.length() - bitOverlap, target.length());\n }\n return target.toString();\n }", "protected abstract void DecodeFromCBORObject(CBORObject messageObject) throws CoseException;", "@Override\n\tpublic void decodeMsg(byte[] message) {\n\t\t\n\t\tIoBuffer buf = IoBuffer.allocate(message.length).setAutoExpand(true);\n\t\tbuf.put(message);\n\t\tbuf.flip();\n\t\t\n\t\tslaveId = buf.get();\n\t\tcode = buf.get();\n\t\toffset = buf.getShort();\n\t\tdata = buf.getShort();\n\n\t\tif(buf.remaining() >= 2)\n\t\t\tcrc16 = buf.getShort();\n\t}", "Message decode(ByteBuffer buffer, Supplier<Message> messageSupplier);", "protected Object decode(\n ChannelHandlerContext ctx, Channel channel, Object msg)\n throws Exception {\n\n String sentence = (String) msg;\n\n // Send response #1\n if (sentence.contains(\"##\")) {\n if (channel != null) {\n channel.write(\"LOAD\");\n }\n return null;\n }\n\n // Send response #2\n if (sentence.length() == 15 && Character.isDigit(sentence.charAt(0))) {\n if (channel != null) {\n channel.write(\"ON\");\n }\n return null;\n }\n\n // Parse message\n Matcher parser = pattern.matcher(sentence);\n if (!parser.matches()) {\n if(log.isInfoEnabled())\n log.info(\"Parse failed, message: \" + sentence);\n return null;\n }\n\n // Create new position\n PositionData position = new PositionData();\n \n Integer index = 1;\n\n // Get device by IMEI\n String imei = parser.group(index++);\n position.setUdid(imei);\n\n String alarm = parser.group(index++);\n \n // Date\n Calendar time = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n time.clear();\n time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++)));\n time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1);\n time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++)));\n \n int localHours = Integer.valueOf(parser.group(index++));\n int localMinutes = Integer.valueOf(parser.group(index++));\n \n int utcHours = Integer.valueOf(parser.group(index++));\n int utcMinutes = Integer.valueOf(parser.group(index++));\n\n // Time\n time.set(Calendar.HOUR, localHours);\n time.set(Calendar.MINUTE, localMinutes);\n time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++)));\n time.set(Calendar.MILLISECOND, Integer.valueOf(parser.group(index++)));\n \n // Timezone calculation\n int deltaMinutes = (localHours - utcHours) * 60 + localMinutes - utcMinutes;\n if (deltaMinutes <= -12 * 60) {\n deltaMinutes += 24 * 60;\n } else if (deltaMinutes > 12 * 60) {\n deltaMinutes -= 24 * 60;\n }\n time.add(Calendar.MINUTE, -deltaMinutes);\n position.setTime(time.getTime());\n\n // Validity\n position.setValid(parser.group(index++).compareTo(\"A\") == 0 ? true : false);\n\n // Latitude\n Double latitude = Double.valueOf(parser.group(index++));\n latitude += Double.valueOf(parser.group(index++)) / 60;\n if (parser.group(index++).compareTo(\"S\") == 0) latitude = -latitude;\n position.setLatitude(latitude);\n\n // Longitude\n Double lonlitude = Double.valueOf(parser.group(index++));\n lonlitude += Double.valueOf(parser.group(index++)) / 60;\n String hemisphere = parser.group(index++);\n if (hemisphere != null) {\n if (hemisphere.compareTo(\"W\") == 0) lonlitude = -lonlitude;\n }\n position.setLongitude(lonlitude);\n\n // Altitude\n position.setAltitude(-1d);\n // Speed from knot to km\n position.setSpeed(1.852 * Double.valueOf(parser.group(index++)));\n\n // Course\n String course = parser.group(index++);\n if (course != null) {\n position.setCourse(Double.valueOf(course));\n } else {\n position.setCourse(-1d);\n }\n\n // Extended info from GPS103 protocol\n Map<String,Object> extendedInfo = position.getExtendedInfo();\n extendedInfo.put(\"protocol\", \"gps103\");\n // Alarm message\n if(alarm != null){\n \tif(alarm.indexOf(\"help me\") != -1){\n \t\t// it's emergency\n \t\tposition.setMessageType(2/*MESSAGE_TYPE_EMERGENCY*/);\n \t\tposition.setMessage(alarm);\n \t}else if(alarm.equalsIgnoreCase(\"tracker\")){\n \t\t// do nothing\n \t}else if(alarm.equalsIgnoreCase(\"speed\")){\n \t\tposition.setMessageType(1/*MESSAGE_TYPE_ALERT*/);\n \t\tposition.setMessage(\"Over Speed!\");\n \t}else if(alarm.equalsIgnoreCase(\"low battery\")){\n \t\tposition.setMessageType(1/*MESSAGE_TYPE_ALERT*/);\n \t\tposition.setMessage(\"Low Battery!\");\n \t}else{\n \t\tposition.setMessage(alarm);\n \t}\n }\n \n return position;\n }", "public void decodeMessage() {\n StringBuilder decoded = new StringBuilder();\n\n for (int i = 0; i < message.length(); i += 3) {\n if (message.charAt(i) == message.charAt(i + 1)) {\n decoded.append(message.charAt(i));\n } else if (message.charAt(i) == message.charAt(i + 2)) {\n decoded.append(message.charAt(i));\n } else {\n decoded.append(message.charAt(i + 1));\n }\n }\n\n message = decoded;\n }", "public FeedEvent processMessage(byte[] message) {\n\t\tif ((message == null) || (message.length < 2))\n\t\t\treturn null;\n\n\t\tDdfMarketBase msg = Codec.parseMessage(message);\n\n\t\tif (msg == null) {\n\t\t\tlog.error(\"DataMaster.processMessage(\" + new String(message) + \") failed.\");\n\t\t\treturn null;\n\t\t}\n\n\t\treturn processMessage(msg);\n\t}", "public RTCMPackage decodeValue(BerCoder coder, DecoderInput source)\n\t throws DecoderException\n {\n\tint total_len0 = source.mLength;\n\tint end_pos0 = (total_len0 < 0) ? java.lang.Integer.MAX_VALUE : (source.position() + total_len0);\n\tint tag;\n\n\tdo {\n\t tag = source.decodeTagLength();\n\t if (tag == 0xA0) {\n\t\ttry {\n\t\t this.anchorPoint = new FullPositionVector();\n\t\t this.anchorPoint.decodeValue(coder, source);\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"anchorPoint\", \"FullPositionVector\");\n\t\t throw ee;\n\t\t}\n\t\ttag = source.decodeTagLength();\n\t }\n\t if (tag != 0x81 && tag != 0xA1)\n\t\tsource.raiseTagMismatchException(tag);\n\t try {\n\t\tthis.rtcmHeader = new RTCMHeader(coder.decodeOctetString(source));\n\t } catch (Exception e) {\n\t\tDecoderException ee = DecoderException.wrapException(e);\n\t\tee.appendFieldContext(\"rtcmHeader\", \"RTCMHeader\");\n\t\tthrow ee;\n\t }\n\t if (source.position() >= end_pos0)\n\t\tbreak;\n\t tag = source.decodeTagLength();\n\t if (tag == 0)\n\t\tbreak;\n\t if (tag == 0x82 || tag == 0xA2) {\n\t\ttry {\n\t\t this.msg1001 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1001\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x83 || tag == 0xA3) {\n\t\ttry {\n\t\t this.msg1002 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1002\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x84 || tag == 0xA4) {\n\t\ttry {\n\t\t this.msg1003 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1003\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x85 || tag == 0xA5) {\n\t\ttry {\n\t\t this.msg1004 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1004\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x86 || tag == 0xA6) {\n\t\ttry {\n\t\t this.msg1005 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1005\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x87 || tag == 0xA7) {\n\t\ttry {\n\t\t this.msg1006 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1006\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x88 || tag == 0xA8) {\n\t\ttry {\n\t\t this.msg1007 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1007\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x89 || tag == 0xA9) {\n\t\ttry {\n\t\t this.msg1008 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1008\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x8A || tag == 0xAA) {\n\t\ttry {\n\t\t this.msg1009 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1009\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x8B || tag == 0xAB) {\n\t\ttry {\n\t\t this.msg1010 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1010\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x8C || tag == 0xAC) {\n\t\ttry {\n\t\t this.msg1011 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1011\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x8D || tag == 0xAD) {\n\t\ttry {\n\t\t this.msg1012 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1012\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x8E || tag == 0xAE) {\n\t\ttry {\n\t\t this.msg1013 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1013\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x8F || tag == 0xAF) {\n\t\ttry {\n\t\t this.msg1014 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1014\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x90 || tag == 0xB0) {\n\t\ttry {\n\t\t this.msg1015 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1015\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x91 || tag == 0xB1) {\n\t\ttry {\n\t\t this.msg1016 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1016\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x92 || tag == 0xB2) {\n\t\ttry {\n\t\t this.msg1017 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1017\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x93 || tag == 0xB3) {\n\t\ttry {\n\t\t this.msg1019 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1019\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x94 || tag == 0xB4) {\n\t\ttry {\n\t\t this.msg1020 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1020\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x95 || tag == 0xB5) {\n\t\ttry {\n\t\t this.msg1021 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1021\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x96 || tag == 0xB6) {\n\t\ttry {\n\t\t this.msg1022 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1022\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x97 || tag == 0xB7) {\n\t\ttry {\n\t\t this.msg1023 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1023\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x98 || tag == 0xB8) {\n\t\ttry {\n\t\t this.msg1024 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1024\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x99 || tag == 0xB9) {\n\t\ttry {\n\t\t this.msg1025 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1025\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x9A || tag == 0xBA) {\n\t\ttry {\n\t\t this.msg1026 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1026\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x9B || tag == 0xBB) {\n\t\ttry {\n\t\t this.msg1027 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1027\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x9C || tag == 0xBC) {\n\t\ttry {\n\t\t this.msg1029 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1029\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x9D || tag == 0xBD) {\n\t\ttry {\n\t\t this.msg1030 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1030\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x9E || tag == 0xBE) {\n\t\ttry {\n\t\t this.msg1031 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1031\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t if (tag == 0x9F1F || tag == 0xBF1F) {\n\t\ttry {\n\t\t this.msg1032 = new OctetString(coder.decodeOctetString(source));\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendFieldContext(\"msg1032\", \"OCTET STRING\");\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t for (;;) {\n\t\ttry {\n\t\t coder.skipContents(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException ee = DecoderException.wrapException(e);\n\t\t ee.appendExtensionContext(\"RTCMPackage\", -1);\n\t\t throw ee;\n\t\t}\n\t\tif (source.position() >= end_pos0)\n\t\t break;\n\t\ttag = source.decodeTagLength();\n\t\tif (tag == 0)\n\t\t break;\n\t }\n\t} while(false);\n\n\tif (source.position() > end_pos0)\n\t throw new DecoderException(ExceptionDescriptor._inconsis_len, null);\n\tif (total_len0 < 0 && source.mLength != 0)\n\t throw new DecoderException(ExceptionDescriptor._non_std_eoc, null);\n\n\treturn this;\n }", "private void decode_message(String receivedMessage) {\n String[] messageComponents = receivedMessage.split(\"##\");\n String actionName = messageComponents[0];\n int actionType = caseMaps.get(actionName);\n\n switch (actionType) {\n case 1:\n String nodeToConnect = messageComponents[1];\n break;\n case 2:\n String receivedPrevNode = messageComponents[1].split(\"&&\")[0];\n String receivedNextNode = messageComponents[1].split(\"&&\")[1];\n break;\n case 3:\n String key = messageComponents[1].split(\"&&\")[0];\n String value = messageComponents[1].split(\"&&\")[1];\n insertIntoDB(key,value);\n break;\n case 4:\n String portRequested = messageComponents[1].split(\"&&\")[0];\n String AllMessages = messageComponents[1].split(\"&&\")[1];\n break;\n case 5:\n String portRequestedSelect = messageComponents[1].split(\"&&\")[0];\n String selection = messageComponents[1].split(\"&&\")[1];\n break;\n case 6:\n String selectionDelete = messageComponents[1];\n DeleteKeys(selectionDelete);\n break;\n default:\n }\n\n }", "private List<GPSData> decodeMessageFrame(ChannelBuffer buff, Channel channel, int fSize, int wSize) {\n\t\tbuff.skipBytes(INITIAL_ZERO_BYTES + FRAME_BYTES_SIZE);\n\t\t\n\t\t// codecId byte is ignored\n\t\tbuff.skipBytes(CODEC_BYTE);\n\t\t\n\t\tshort numberOfData = buff.readUnsignedByte();\n\t\t// response to modem about data reception\n\t\tacknowledgeTeltonikaModem(channel, numberOfData);\n\t\tList<GPSData> list = new ArrayList<GPSData>();\n\t\tString imeiLast7digits = imeiMap.get(channel.getId());\n\t\tLOGGER.info(\"Received package decode start: \" + System.currentTimeMillis() + \"ms from device: \" + imeiLast7digits);\n\t\tfor (int i = 0; i < numberOfData; i++) {\n\n\t\t\tGPSData data = new GPSData();\n\n\t\t\tDate timestamp = new Date(buff.getLong(buff.readerIndex()));\n\t\t\tbuff.readerIndex(buff.readerIndex() + 8);\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\t\t\tdata.setTimestamp(format.format(timestamp));\n\n\t\t\tdata.setUnitId(imeiMap.get(channel.getId()));\n\n\t\t\t// priority byte is ignored\n\t\t\tbuff.skipBytes(1);\n\n\t\t\t// X\n\t\t\tStringBuilder longitude = new StringBuilder(String.valueOf(buff\n\t\t\t\t\t.readUnsignedInt()));\n\t\t\tlongitude.insert(2, '.');\n\t\t\tdata.setLongitude(Double.parseDouble(longitude.toString()));\n\n\t\t\t// Y\n\t\t\tStringBuilder latitude = new StringBuilder(String.valueOf(buff\n\t\t\t\t\t.readUnsignedInt()));\n\t\t\tlatitude.insert(2, '.');\n\t\t\tdata.setLatitude(Double.parseDouble(latitude.toString()));\n\n\t\t\t// H\n\t\t\tint altitude = buff.readUnsignedShort();\n\t\t\tdata.setAltitude((double) altitude);\n\n\t\t\tint angle = buff.readUnsignedShort();\n\t\t\tdata.setAngle(angle);\n\n\t\t\tshort satelite = buff.readUnsignedByte();\n\t\t\tdata.setSatelite(satelite);\n\n\t\t\tint speed = buff.readUnsignedShort();\n\t\t\tdata.setSpeed((double) speed);\n\n\t\t\t// IO INFORMATION START\n\n\t\t\t// IO ENETS\n\t\t\t//\n\t\t\t// IO element ID of Event generated (in case when 00 data\n\t\t\t// generated not on event)\n\t\t\t// we skip this byte\n\t\t\t\n\t\t\tbuff.skipBytes(1);\n\t\t\t\n\t\t\t// could read elements number but not necessary\n\t\t\t// instead we can skip it\n\t\t\t// short elementsNumber = buff.readUnsignedByte();\n\n\t\t\tbuff.skipBytes(1);\n\n\t\t\t// number of records with value 1 byte length\n\t\t\tshort oneByteElementNum = buff.readUnsignedByte();\n\n\t\t\tfor (int j = 0; j < oneByteElementNum; j++) {\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t}\n\n\t\t\t// number of records with value 2 byte length\n\t\t\tshort twoByteElementNum = buff.readUnsignedByte();\n\n\t\t\tfor (int j = 0; j < twoByteElementNum; j++) {\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t\tbuff.skipBytes(2);\n\t\t\t}\n\n\t\t\t// number of records with value 4 byte length\n\t\t\tshort fourByteElementNum = buff.readUnsignedByte();\n\n\t\t\tfor (int j = 0; j < fourByteElementNum; j++) {\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t\tbuff.skipBytes(4);\n\t\t\t}\n\n\t\t\t// number of records with value 8 byte length\n\t\t\tshort eightByteElementNum = buff.readUnsignedByte();\n\n\t\t\tfor (int j = 0; j < eightByteElementNum; j++) {\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t\tbuff.skipBytes(8);\n\t\t\t}\n\t\t\t// IO INFORMATION END\n\t\t\tlist.add(data);\n\t\t}\n\t\tLOGGER.info(\"Received package decode end: \" + System.currentTimeMillis() + \"ms from device: \" + imeiLast7digits);\n\t\t// records number(1 byte) and CRC(4 bytes) left in the buffer unread\n\t\tLOGGER.info(\"Number of packages decoded: \" + numberOfData);\n\t\tnumberOfData = buff.readByte();\n\t\t// skip CRC bytes\n\t\tlong CRC = buff.readUnsignedInt();\n\t\tLOGGER.info(\"Data CRC: \" + CRC);\n\t\t\n\t\treturn list;\n\t}", "private static void decodeString(String in){\n\t\t//reverse anything done in encoded string\n\t\tString demess = decrypt(in);\n\t\tString decodeMessage = bigIntDecode(demess);\n\n\t\tSystem.out.println(\"Decoded message: \" + decodeMessage + \"***make function to actually decode!\");\n\t}", "protected String decodeByte(String given) {\n if (given == null || given.length() % 8 != 0 || given.isEmpty()) {\n return \"\";\n }\n StringBuilder source = new StringBuilder(given);\n StringBuilder target = new StringBuilder();\n while (source.length() > 0) {\n String pair = source.substring(0, 2);\n source.delete(0, 2);\n if (pair.charAt(0) == pair.charAt(1)) {\n target.append(pair.charAt(0));\n } else {\n target.append(\"?\");\n }\n }\n if (target.substring(0,4).contains(\"?\")) {\n target = new StringBuilder(decodeByteWithParity(target.toString()));\n }\n while (target.length() > 3) {\n target.deleteCharAt(target.length() - 1);\n }\n\n return target.toString();\n }", "public static final Aircraft decodeModeS(ModeSMessage message) {\n\n\t\tint length = message.mBytes.length;\n\t\tif (length != 14 && length != 7)\n\t\t\treturn null;\n\n\t\tint[] rawMsg = new int[length];\n\t\tSystem.arraycopy(message.mBytes, 0, rawMsg, 0, length);\n\n\t\tmessage.mCrc = getChecksum(message.mBytes);\n\n\t\tif (!message.isValid()) {\n\t\t\t//\n\t\t\t// Fixing single bit errors in DF-11 is a bit dodgy because we have\n\t\t\t// no way to know for sure if the crc is supposed to be 0 or not -\n\t\t\t// it could be any value less than 80. Therefore, attempting to fix\n\t\t\t// DF-11 errors can result in a multitude of possible crc solutions,\n\t\t\t// only one of which is correct.\n\t\t\t//\n\n\t\t\tfixBitErrors(message);\n\n\t\t\tif (message.mNumCorrectedBits > 0)\n\t\t\t\tmessage.mCrc = getChecksum(message.mBytes);\n\t\t}\n\n\t\tint format = message.getFormat();\n\t\tint icao = 0;\n\t\tif (message.isValid() && (format == 11 || format == 17 || format == 18)) {\n\t\t\ticao = message.getIcao();\n\n\t\t\tmessage.mCa = message.mBytes[0] & 0x07;\n\n\t\t\tif (icao > 0)\n\t\t\t\tsRecentIcaoCache.put(icao, 1);\n\t\t} else { // All other DF's\n\n\t\t\t// reset the message to the original bytes\n\t\t\tmessage = new ModeSMessage(rawMsg, message.mClockCount);\n\t\t\tmessage.mCrc = getChecksum(message.mBytes);\n\n\t\t\tif (message.getFormat() != 11\n\t\t\t\t\t|| (message.getFormat() == 11 && message.mCrc < 80)) {\n\n\t\t\t\t// Compare the checksum with the whitelist of recently seen ICAO\n\t\t\t\t// addresses. If it matches one, then declare the message as\n\t\t\t\t// valid\n\t\t\t\tif (sRecentIcaoCache.get(message.mCrc) != null) {\n\t\t\t\t\ticao = message.mCrc;\n\t\t\t\t\tmessage.mCrc = 0; // this makes the message valid\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (icao == 0 || !message.isValid())\n\t\t\treturn null;\n\n\t\tsNow = System.currentTimeMillis();\n\t\tboolean positionFound = false;\n\n\t\tAircraft aircraft = RecentAircraftCache.get(icao);\n\t\tif (aircraft == null) {\n\t\t\taircraft = new Aircraft(icao);\n\t\t\tRecentAircraftCache.add(icao, aircraft);\n\t\t}\n\n\t\taircraft.addSignalStrength(message.getSignalLevel());\n\t\taircraft.setUat(false);\n\t\taircraft.setReady(false);\n\t\taircraft.setMessageCount(aircraft.getMessageCount() + 1);\n\t\taircraft.setSeen(sNow);\n\n\t\tif (format == 5 || format == 21) {\n\t\t\tint id13Field = ((message.mBytes[2] << 8) | message.mBytes[3]) & 0x1FFF;\n\t\t\tif (id13Field > 0)\n\t\t\t\taircraft.setSquawk(decodeId13Field(id13Field));\n\t\t}\n\n\t\tif (format == 4 || format == 5 || format == 16 || format == 20) {\n\t\t\tint ac13Field = ((message.mBytes[2] << 8) | message.mBytes[3]) & 0x1FFF;\n\t\t\tif (ac13Field > 0)\n\t\t\t\taircraft.setAltitude(decodeAc13Field(ac13Field), sNow);\n\t\t}\n\n\t\t// Fields for DF4, DF5, DF20, DF21\n\t\tif (format == 4 || format == 5 || format == 20 || format == 21)\n\t\t\taircraft.setStatus(message.mBytes[0] & 7); // Flight status for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// DF4,5,20,21\n\t\tif (format == 17\n\t\t\t\t|| (format == 18 && (message.mCa == 0 || message.mCa == 1 || message.mCa == 6))) {\n\t\t\tif (length != 14)\n\t\t\t\treturn null;\n\n\t\t\tint type = message.mBytes[4] >> 3; // Extended squitter message\n\t\t\t\t\t\t\t\t\t\t\t\t// type\n\t\t\tint subType = type == 29 ? (message.mBytes[4] & 6) >> 1\n\t\t\t\t\t: message.mBytes[4] & 7;\n\n\t\t\tif (type >= 1 && type <= 4) {\n\t\t\t\taircraft.setIdentity(decodeIdentity(message));\n\t\t\t\taircraft.setCategory(((0x0E - type) << 4) | subType);\n\t\t\t} else if (type == 19) { // velocity\n\t\t\t\tif (subType >= 1 && subType <= 4) {\n\t\t\t\t\tint vertRate = ((message.mBytes[8] & 0x07) << 6)\n\t\t\t\t\t\t\t| (message.mBytes[9] >> 2);\n\t\t\t\t\tif (vertRate > 0) {\n\t\t\t\t\t\t--vertRate;\n\t\t\t\t\t\tif ((message.mBytes[8] & 0x08) == 0x08)\n\t\t\t\t\t\t\tvertRate *= -1;\n\n\t\t\t\t\t\tvertRate *= 64;\n\n\t\t\t\t\t\taircraft.setVerticalRate(vertRate);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tint velocity = Integer.MIN_VALUE;\n\t\t\t\tint heading = Integer.MAX_VALUE;\n\n\t\t\t\tif (subType == 1 || subType == 2) {\n\t\t\t\t\tint ewRaw = ((message.mBytes[5] & 0x03) << 8)\n\t\t\t\t\t\t\t| message.mBytes[6];\n\t\t\t\t\tint ewVel = ewRaw - 1;\n\t\t\t\t\tint nsRaw = ((message.mBytes[7] & 0x7F) << 3)\n\t\t\t\t\t\t\t| (message.mBytes[8] >> 5);\n\t\t\t\t\tint nsVel = nsRaw - 1;\n\n\t\t\t\t\tif (subType == 2) { // If (supersonic) unit is 4 kts\n\t\t\t\t\t\tnsVel = nsVel << 2;\n\t\t\t\t\t\tewVel = ewVel << 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((message.mBytes[5] & 0x04) == 0x04)\n\t\t\t\t\t\tewVel *= -1;\n\n\t\t\t\t\tif ((message.mBytes[7] & 0x80) == 0x80)\n\t\t\t\t\t\tnsVel *= -1;\n\n\t\t\t\t\tif (ewRaw > 0 && nsRaw > 0)\n\t\t\t\t\t\tvelocity = (int) Math.hypot(nsVel, ewVel);\n\n\t\t\t\t\tif (velocity > 0)\n\t\t\t\t\t\theading = (int) Math\n\t\t\t\t\t\t\t\t.toDegrees(Math.atan2(ewVel, nsVel));\n\t\t\t\t} else if (subType == 3 || subType == 4) {\n\t\t\t\t\tvelocity = ((message.mBytes[7] & 0x7f) << 3)\n\t\t\t\t\t\t\t| (message.mBytes[8] >> 5);\n\t\t\t\t\tif (velocity > 0) {\n\t\t\t\t\t\t--velocity;\n\t\t\t\t\t\tif (subType == 4) // If (supersonic) unit is 4 kts\n\t\t\t\t\t\t\tvelocity = velocity << 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((message.mBytes[5] & 0x04) == 0x04)\n\t\t\t\t\t\theading = ((((message.mBytes[5] & 0x03) << 8) | message.mBytes[6]) * 45) >> 7;\n\t\t\t\t}\n\n\t\t\t\tif (heading < 0)\n\t\t\t\t\theading += 360;\n\t\t\t\telse if (heading == 360)\n\t\t\t\t\theading = 0;\n\n\t\t\t\tif (velocity != Integer.MIN_VALUE)\n\t\t\t\t\taircraft.setVelocity(velocity, sNow);\n\n\t\t\t\tif (heading != Integer.MAX_VALUE)\n\t\t\t\t\taircraft.setHeading(heading, sNow);\n\t\t\t} else if (type >= 5 && type <= 22) { // Position Message\n\t\t\t\taircraft.setOnGround(type < 9);\n\n\t\t\t\tint altitude = Integer.MIN_VALUE;\n\t\t\t\tint velocity = Integer.MIN_VALUE;\n\t\t\t\tint heading = Integer.MAX_VALUE;\n\n\t\t\t\tif (aircraft.isOnGround()) { // ground\n\t\t\t\t\tint movement = ((message.mBytes[4] << 4) | (message.mBytes[5] >> 4)) & 0x007F;\n\t\t\t\t\tif (movement > 0 && movement < 125)\n\t\t\t\t\t\tvelocity = decodeMovementField(movement);\n\n\t\t\t\t\tif ((message.mBytes[5] & 0x08) == 0x08)\n\t\t\t\t\t\theading = ((((message.mBytes[5] << 4) | (message.mBytes[6] >> 4)) & 0x007F) * 45) >> 4;\n\t\t\t\t} else { // airborne\n\t\t\t\t\tint ac12Field = ((message.mBytes[5] << 4) | (message.mBytes[6] >> 4)) & 0x0FFF;\n\t\t\t\t\tif (ac12Field > 0)\n\t\t\t\t\t\taltitude = decodeAc12Field(ac12Field);\n\t\t\t\t}\n\n\t\t\t\tif (heading < 0)\n\t\t\t\t\theading += 360;\n\t\t\t\telse if (heading == 360)\n\t\t\t\t\theading = 0;\n\n\t\t\t\tif (altitude != Integer.MIN_VALUE)\n\t\t\t\t\taircraft.setAltitude(altitude, sNow);\n\n\t\t\t\tif (velocity != Integer.MIN_VALUE)\n\t\t\t\t\taircraft.setVelocity(velocity, sNow);\n\n\t\t\t\tif (heading != Integer.MAX_VALUE && !positionFound)\n\t\t\t\t\taircraft.setHeading(heading, sNow);\n\n\t\t\t\tboolean odd = (message.mBytes[6] & 0x04) == 0x04;\n\n\t\t\t\tint rawLatitude = ((message.mBytes[6] & 3) << 15)\n\t\t\t\t\t\t| (message.mBytes[7] << 7) | (message.mBytes[8] >> 1);\n\t\t\t\tint rawLongitude = ((message.mBytes[8] & 1) << 16)\n\t\t\t\t\t\t| (message.mBytes[9] << 8) | (message.mBytes[10]);\n\n\t\t\t\t// Seen from at least:\n\t\t\t\t// 400F3F (Eurocopter ECC155 B1) - Bristow Helicopters\n\t\t\t\t// 4008F3 (BAE ATP) - Atlantic Airlines\n\t\t\t\t// 400648 (BAE ATP) - Atlantic Airlines\n\t\t\t\t// altitude == 0, longitude == 0, type == 15 and zeros in\n\t\t\t\t// latitude LSB.\n\t\t\t\t// Can alternate with valid reports having type == 14\n\t\t\t\tif (altitude > 0 || rawLongitude > 0\n\t\t\t\t\t\t|| (rawLatitude & 0x0fff) > 0 || type != 15) {\n\n\t\t\t\t\tint nucp = 0;\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 5:\n\t\t\t\t\tcase 9:\n\t\t\t\t\tcase 20:\n\t\t\t\t\t\tnucp = 9;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\tcase 10:\n\t\t\t\t\tcase 21:\n\t\t\t\t\t\tnucp = 8;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\n\t\t\t\t\tcase 11:\n\t\t\t\t\t\tnucp = 7;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 8:\n\t\t\t\t\tcase 12:\n\t\t\t\t\t\tnucp = 6;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 13:\n\t\t\t\t\t\tnucp = 5;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 14:\n\t\t\t\t\t\tnucp = 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 15:\n\t\t\t\t\t\tnucp = 3;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 16:\n\t\t\t\t\t\tnucp = 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 17:\n\t\t\t\t\t\tnucp = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// for mlat\n\t\t\t\t\tif (nucp > 5) {\n\t\t\t\t\t\tif (odd)\n\t\t\t\t\t\t\taircraft.setOddMessage(message);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\taircraft.setEvenMessage(message);\n\t\t\t\t\t}\n\n\t\t\t\t\taircraft.addRawPosition(new RawPosition(rawLatitude,\n\t\t\t\t\t\t\trawLongitude, nucp), odd);\n\n\t\t\t\t\tpositionFound = decodeCpr(aircraft, odd);\n\t\t\t\t}\n\n\t\t\t\tif (!positionFound)\n\t\t\t\t\tpositionFound = decodeCprRelative(aircraft, odd);\n\n\t\t\t\taircraft.setReady(positionFound);\n\t\t\t} else if (type == 23) { // Test metype squawk field\n\t\t\t\tif (subType == 7) { // (see 1090-WP-15-20)\n\t\t\t\t\tint id13Field = (((message.mBytes[5] << 8) | message.mBytes[6]) & 0xFFF1) >> 3;\n\t\t\t\t\tif (id13Field > 0)\n\t\t\t\t\t\taircraft.setSquawk(decodeId13Field(id13Field));\n\t\t\t\t}\n\t\t\t} else if (type == 24) { // Reserved for Surface System Status\n\t\t\t} else if (type == 28) { // Extended Squitter Aircraft Status\n\t\t\t\tif (subType == 1) { // Emergency status squawk field\n\t\t\t\t\tint id13Field = (((message.mBytes[5] << 8) | message.mBytes[6]) & 0x1FFF);\n\t\t\t\t\tif (id13Field > 0)\n\t\t\t\t\t\taircraft.setSquawk(decodeId13Field(id13Field));\n\t\t\t\t}\n\t\t\t} else if (type == 29) { // Aircraft Trajectory Intent\n\t\t\t\tif (BuildConfig.DEBUG) {\n\t\t\t\t\tSystem.out.println(aircraft.getIdentity());\n\t\t\t\t\tSystem.out.println(\"29:\" + subType);\n\t\t\t\t}\n\n\t\t\t\tif (subType == 0) {\n\t\t\t\t\taircraft.setAltitudeSource((message.mBytes[5] & 0x40) == 0x40 ? \"ASL\"\n\t\t\t\t\t\t\t: \"BARO\");\n\t\t\t\t\tint selectedAlt = ((message.mBytes[5] << 9)\n\t\t\t\t\t\t\t| (message.mBytes[6] << 1) | (message.mBytes[7] >> 7)) & 0x3FF;\n\t\t\t\t\tif (selectedAlt < 1011) { // 1011 --- 1023 invalid\n\t\t\t\t\t\tselectedAlt = selectedAlt * 100 - 1000;\n\n\t\t\t\t\t\taircraft.setSelectedAltitude(selectedAlt);\n\n\t\t\t\t\t\tif (BuildConfig.DEBUG)\n\t\t\t\t\t\t\tSystem.out.println(\"Alt: \" + selectedAlt + \" \"\n\t\t\t\t\t\t\t\t\t+ aircraft.getAltitudeSource());\n\t\t\t\t\t}\n\n\t\t\t\t\tint selectedHeading = ((message.mBytes[7] << 4) | (message.mBytes[8] >> 4)) & 0x1FF;\n\t\t\t\t\tif (selectedHeading < 360) { // 360 --- 511 invalid\n\t\t\t\t\t\tif ((message.mBytes[8] & 0x8) == 0x0) { // heading\n\t\t\t\t\t\t\taircraft.setSelectedHeading(selectedHeading);\n\t\t\t\t\t\t\taircraft.setTrackAngle(null);\n\n\t\t\t\t\t\t\tif (BuildConfig.DEBUG)\n\t\t\t\t\t\t\t\tSystem.out.println(\"Head: \" + selectedHeading);\n\t\t\t\t\t\t} else { // track angle\n\t\t\t\t\t\t\taircraft.setSelectedHeading(null);\n\t\t\t\t\t\t\taircraft.setTrackAngle(selectedHeading);\n\n\t\t\t\t\t\t\tif (BuildConfig.DEBUG)\n\t\t\t\t\t\t\t\tSystem.out.println(\"Track: \" + selectedHeading);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (BuildConfig.DEBUG)\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"Auto pilot: \"\n\t\t\t\t\t\t\t\t\t\t+ ((message.mBytes[5] & 0x4) == 0x4 || (message.mBytes[8] & 0x4) == 0x4));\n\n\t\t\t\t\taircraft.setAutoPilotEngaged((message.mBytes[8] & 0x4) == 0x4\n\t\t\t\t\t\t\t|| (message.mBytes[8] & 0x4) == 0x4);\n\n\t\t\t\t\tint eCode = message.mBytes[10] & 0x7;\n\t\t\t\t\tif (eCode == 0x1)\n\t\t\t\t\t\taircraft.setSquawk(0x7700);\n\t\t\t\t\telse if (eCode == 0x4)\n\t\t\t\t\t\taircraft.setSquawk(0x7600);\n\t\t\t\t\telse if (eCode == 0x5)\n\t\t\t\t\t\taircraft.setSquawk(0x7500);\n\t\t\t\t} else if (subType == 1) {\n\t\t\t\t\t// Altitude\n\t\t\t\t\taircraft.setAltitudeSource((message.mBytes[5] & 0x80) == 0x80 ? \"FMS\"\n\t\t\t\t\t\t\t: \"MCP/FCU\");\n\t\t\t\t\tint selectedAlt = ((message.mBytes[5] << 4) | (message.mBytes[6] >> 4)) & 0x7FF;\n\t\t\t\t\tif (selectedAlt > 0) {\n\t\t\t\t\t\tselectedAlt = selectedAlt * 32 - 32;\n\n\t\t\t\t\t\taircraft.setSelectedAltitude(selectedAlt);\n\n\t\t\t\t\t\tif (BuildConfig.DEBUG)\n\t\t\t\t\t\t\tSystem.out.println(\"Alt: \" + selectedAlt + \" \"\n\t\t\t\t\t\t\t\t\t+ aircraft.getAltitudeSource());\n\t\t\t\t\t}\n\n\t\t\t\t\t// Barometer\n\t\t\t\t\tfloat selectedBaro = ((message.mBytes[6] << 5) | (message.mBytes[7] >> 3)) & 0x1FF;\n\t\t\t\t\tselectedBaro = selectedBaro * 0.8f - 0.8f;\n\n\t\t\t\t\taircraft.setBaroSetting(selectedBaro);\n\n\t\t\t\t\tif (BuildConfig.DEBUG)\n\t\t\t\t\t\tSystem.out.println(\"Baro: \" + selectedBaro);\n\n\t\t\t\t\t// Heading\n\t\t\t\t\tif ((message.mBytes[7] & 0x4) == 0x4) { // validity check\n\t\t\t\t\t\tint selectedHeading = ((message.mBytes[7] << 7) | (message.mBytes[8] >> 1)) & 0xFF;\n\t\t\t\t\t\tselectedHeading = (int) Math\n\t\t\t\t\t\t\t\t.round(selectedHeading * 180.0 / 256);\n\t\t\t\t\t\tif ((message.mBytes[7] & 0x10) == 0x10) // negative bit\n\t\t\t\t\t\t\tselectedHeading *= -1;\n\n\t\t\t\t\t\tif (selectedHeading < 0)\n\t\t\t\t\t\t\tselectedHeading += 360;\n\t\t\t\t\t\telse if (selectedHeading == 360)\n\t\t\t\t\t\t\tselectedHeading = 0;\n\n\t\t\t\t\t\taircraft.setSelectedHeading(selectedHeading);\n\n\t\t\t\t\t\tif (BuildConfig.DEBUG)\n\t\t\t\t\t\t\tSystem.out.println(\"Track: \" + selectedHeading);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Status\n\t\t\t\t\tif ((message.mBytes[9] & 0x2) == 0x2) {\n\t\t\t\t\t\tif (BuildConfig.DEBUG) {\n\t\t\t\t\t\t\tSystem.out.println(\"Auto pilot: \"\n\t\t\t\t\t\t\t\t\t+ ((message.mBytes[9] & 0x1) == 0x1));\n\t\t\t\t\t\t\tSystem.out.println(\"VNav: \"\n\t\t\t\t\t\t\t\t\t+ ((message.mBytes[10] & 0x80) == 0x80));\n\t\t\t\t\t\t\tSystem.out.println(\"Hold: \"\n\t\t\t\t\t\t\t\t\t+ ((message.mBytes[10] & 0x40) == 0x40));\n\t\t\t\t\t\t\tSystem.out.println(\"Approach: \"\n\t\t\t\t\t\t\t\t\t+ ((message.mBytes[10] & 0x10) == 0x10));\n\t\t\t\t\t\t\tSystem.out.println(\"TCAS: \"\n\t\t\t\t\t\t\t\t\t+ ((message.mBytes[10] & 0x8) == 0x8));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taircraft.setAutoPilotEngaged((message.mBytes[9] & 0x1) == 0x1);\n\t\t\t\t\t\taircraft.setVerticalNavEnabled((message.mBytes[10] & 0x80) == 0x80);\n\t\t\t\t\t\taircraft.setAltitudeHoldEnabled((message.mBytes[10] & 0x40) == 0x40);\n\t\t\t\t\t\taircraft.setOnApproach((message.mBytes[10] & 0x10) == 0x10);\n\t\t\t\t\t\taircraft.setTcasEnabled((message.mBytes[10] & 0x8) == 0x8);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (BuildConfig.DEBUG) {\n\t\t\t\t\t\t\tSystem.out.println(\"Auto pilot: false\");\n\t\t\t\t\t\t\tSystem.out.println(\"VNav: false\");\n\t\t\t\t\t\t\tSystem.out.println(\"Hold: false\");\n\t\t\t\t\t\t\tSystem.out.println(\"Approach: false\");\n\t\t\t\t\t\t\tSystem.out.println(\"TCAS: false\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taircraft.setAutoPilotEngaged(false);\n\t\t\t\t\t\taircraft.setVerticalNavEnabled(false);\n\t\t\t\t\t\taircraft.setAltitudeHoldEnabled(false);\n\t\t\t\t\t\taircraft.setOnApproach(false);\n\t\t\t\t\t\taircraft.setTcasEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (type == 30) { // Aircraft Operational Coordination\n\n\t\t\t} else if (type == 31) { // Aircraft Operational Status\n\n\t\t\t} else { // Other types\n\n\t\t\t}\n\t\t} else if (format == 20 || format == 21) {\n\t\t\t// Fields for DF20, DF21 Comm-B\n\t\t\tif (message.mBytes[4] == 0x20) // Aircraft Identification\n\t\t\t\taircraft.setIdentity(decodeIdentity(message));\n\t\t}\n\n\t\treturn aircraft;\n\t}", "public static Package decode(byte[] input) throws Exception {\n\n ByteBuffer wrapper = ByteBuffer.wrap(input).order(ByteOrder.BIG_ENDIAN);\n byte bMagic = wrapper.get();\n if(bMagic!= 0x13)\n throw new MagicByteException(bMagic);\n\n byte bSrc = wrapper.get();\n long bPktId = wrapper.getLong();\n int wLen = wrapper.getInt();\n\n\n //-----check 1 ------//\n short expectedCrc1 = wrapper.getShort();\n short actualCrc1 = CRC16.getCrc(input,0,14);\n\n if(expectedCrc1 != actualCrc1)\n throw new WrongCrcException(\"First crc check was not passed\\n\" +\n \"Expected crc: \"+expectedCrc1+\", actual crc:\"+actualCrc1\n );\n\n\n //-----check 2 ------//\n short expectedCrc2 = ByteBuffer.wrap(input,16+wLen,2).order(ByteOrder.BIG_ENDIAN).getShort();\n short actualCrc2 = CRC16.getCrc(input,16,wLen);\n\n if(expectedCrc2 != actualCrc2)\n throw new WrongCrcException(\"Second crc check was not passed\\n\" +\n \"Expected crc: \"+expectedCrc2+\", actual crc:\"+actualCrc2\n );\n\n //decrypt message\n byte[] bMsq = new byte[wLen];\n System.arraycopy(input, 16, bMsq,0,wLen);\n bMsq = processor.decrypt(bMsq);\n\n //parse message\n ByteBuffer msqWrapper = ByteBuffer.wrap(bMsq).order(ByteOrder.BIG_ENDIAN);\n\n int cType = msqWrapper.getInt();\n int bUserId = msqWrapper.getInt();\n byte[] message = new byte[bMsq.length-8];\n msqWrapper.get(message);\n\n\n return (new Package(bSrc,bPktId,cType,bUserId, new String(message)));\n }", "public static String eightBitDecode(String encmsg) throws NumberFormatException\n\t{\n\t\t// encmsg: encoded string to decode.\n\t\t// msglen: the requested number of characters to decode.\n\t\tint i, o;\n\t\tStringBuffer msg = new StringBuffer(160);\n\t\tString ostr;\n\t\tchar c;\n\t\t\n\t\t// assumes even number of chars in octet string.\n\t\tfor (i = 0; i < encmsg.length(); i = i + 2)\n\t\t{\n\t\t\tostr = encmsg.substring(i, i + 2);\n\t\t\to = Integer.parseInt(ostr, 16);\n\t\t\tc = (char) o;\n\t\t\tc = gsmToIsoMap[c];\n\t\t\tmsg.append(c);\n\t\t}\n\t\treturn msg.toString();\n\t}", "@Override\n\tpublic void popDecodeBarcode(boolean sucflg, String msg,\n\t\t\tBaseInfoObjectDTO itemDTO) {\n\t\tif (sucflg) {\n\t\t\tif (itemDTO != null) {\n\t\t\t\tif (\"B2\".equals(_ftype)) {\n\t\t\t\t\ttheEntry.setFspId(\"\");\n\t\t\t\t\ttheEntry.setFspName(\"\");\n\t\t\t\t\ttheEntry.setFspNumber(\"\");\n\t\t\t\t\tfsp.setText(\"\");\n\t\t\t\t\ttheEntry.setFstockId(itemDTO.getfItemID());\n\t\t\t\t\ttheEntry.setFstockName(itemDTO.getfName());\n\t\t\t\t\ttheEntry.setFstockNumber(itemDTO.getfNumber());\n\t\t\t\t\tfck.setText(PbF.inzStr(itemDTO.getfName()));\n\t\t\t\t\t_isqycw = itemDTO.getfParam();\n\t\t\t\t} else if (\"B3\".equals(_ftype)) {\n\t\t\t\t\ttheEntry.setFspId(itemDTO.getfItemID());\n\t\t\t\t\ttheEntry.setFspName(itemDTO.getfName());\n\t\t\t\t\ttheEntry.setFspNumber(itemDTO.getfNumber());\n\t\t\t\t\tfsp.setText(PbF.inzStr(itemDTO.getfName()));\n\t\t\t\t\t// _isqycw=itemDTO.getfParam();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\t\t\talertDialog.setMessage(msg);\n\t\t\talertDialog.show();\n\t\t\treturn;\n\t\t}\n\n\t}", "@Override\r\n\tpublic void finishDecode(IoSession session, ProtocolDecoderOutput out)\r\n\t\t\tthrows Exception {\n\r\n\t}", "public int decodeBytes(byte[] bytes) {\n if (bytes.length < 200)\n return 0;\n\n List<Code> createdCodes = null;\n // Size of symbol is 10 bytes, so we need to shift\n for (int i = 0; i < 10; i++) {\n byte[] tempBytes = new byte[bytes.length - i];\n System.arraycopy(bytes, i, tempBytes, 0, bytes.length - i);\n\n createdCodes = Code.createCodes(tempBytes);\n\n // Counter for incorrect symbols\n int bad = 0;\n\n // Check on errors\n for (Code sign : createdCodes)\n if (sign.equals(ERROR_CODE))\n bad++;\n\n if (!(tempBytes.length / 10 - bad < 10))\n break;\n }\n\n // Message ready for further decoding?\n int headPosition = findHeadPosition(createdCodes);\n // if we've found beginning then continue decoding\n // else remove 21 bytes\n if (headPosition < 0)\n return 21;\n\n // Do we need to put back into buffer and save?\n int endPosition = findEndingPosition(createdCodes);\n // if we've found end of sequence then continue decoding\n // else remove bytes\n if (endPosition < 0) {\n if (bytes.length > 2000)\n return 50;\n\n return 0;\n }\n\n // Is DSC with expanded sequence?\n int expandPosition = findExpandPosition(\n createdCodes, endPosition + endingPattern.size()\n );\n if (expandPosition < 0 && bytes.length < 2000) {\n return 0;\n }\n\n // To the end position adds two for decoding ECC symbol\n List<Code> message = processMessage(\n createdCodes, headPosition,\n expandPosition < 0 ? endPosition + 3 : expandPosition + 3,\n expandPosition > 0\n );\n\n String decodedSymbols = message.stream().map(\n (c) -> c.getSymbol() + \"\" + \" \"\n ).reduce(\n (s1, s2) -> s1 + s2\n ).orElse(\"\");\n\n logger.info(\"Decoded symbols: \" + decodedSymbols);\n\n codeDecoder.decodeCodes(message);\n\n return (endPosition * 10 + endingPattern.size() * 10);\n }", "public static RTCMPackage decodeValue(PerCoder coder, InputBitStream source, RTCMPackage data)\n\t throws IOException, DecoderException, DecodeFailedException\n {\n\tboolean _has_extensions0 = source.readBit();\n\tint len0 = 0;\n\tInputBitStream bitstream0 = null;\n\n\tboolean has_anchorPoint0 = source.readBit();\n\tboolean has_msg10010 = source.readBit();\n\tboolean has_msg10020 = source.readBit();\n\tboolean has_msg10030 = source.readBit();\n\tboolean has_msg10040 = source.readBit();\n\tboolean has_msg10050 = source.readBit();\n\tboolean has_msg10060 = source.readBit();\n\tboolean has_msg10070 = source.readBit();\n\tboolean has_msg10080 = source.readBit();\n\tboolean has_msg10090 = source.readBit();\n\tboolean has_msg10100 = source.readBit();\n\tboolean has_msg10110 = source.readBit();\n\tboolean has_msg10120 = source.readBit();\n\tboolean has_msg10130 = source.readBit();\n /** Decode root fields **/\n\tif (has_anchorPoint0) {\n\t // Decode field 'anchorPoint'\n\t try {\n\t\tif (data.anchorPoint == null)\n\t\t data.anchorPoint = new FullPositionVector();\n\t\tdata.anchorPoint.decodeValue(coder, source, data.anchorPoint);\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"anchorPoint\", \"FullPositionVector\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.anchorPoint = null;\n\t}\n\t// Decode field 'rtcmHeader'\n\ttry {\n\t data.rtcmHeader = new RTCMHeader(com.oss.coders.per.PerOctets.decode(coder, source, 5, 5));\n\t} catch (Exception e) {\n\t DecoderException de = DecoderException.wrapException(e);\n\t de.appendFieldContext(\"rtcmHeader\", \"RTCMHeader\");\n\t throw de;\n\t}\n\tif (has_msg10010) {\n\t // Decode field 'msg1001'\n\t try {\n\t\tdata.msg1001 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 16, 124));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1001\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1001 = null;\n\t}\n\tif (has_msg10020) {\n\t // Decode field 'msg1002'\n\t try {\n\t\tdata.msg1002 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 18, 156));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1002\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1002 = null;\n\t}\n\tif (has_msg10030) {\n\t // Decode field 'msg1003'\n\t try {\n\t\tdata.msg1003 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 21, 210));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1003\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1003 = null;\n\t}\n\tif (has_msg10040) {\n\t // Decode field 'msg1004'\n\t try {\n\t\tdata.msg1004 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 24, 258));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1004\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1004 = null;\n\t}\n\tif (has_msg10050) {\n\t // Decode field 'msg1005'\n\t try {\n\t\tdata.msg1005 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 19, 19));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1005\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1005 = null;\n\t}\n\tif (has_msg10060) {\n\t // Decode field 'msg1006'\n\t try {\n\t\tdata.msg1006 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 21, 21));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1006\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1006 = null;\n\t}\n\tif (has_msg10070) {\n\t // Decode field 'msg1007'\n\t try {\n\t\tdata.msg1007 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 5, 36));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1007\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1007 = null;\n\t}\n\tif (has_msg10080) {\n\t // Decode field 'msg1008'\n\t try {\n\t\tdata.msg1008 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 6, 68));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1008\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1008 = null;\n\t}\n\tif (has_msg10090) {\n\t // Decode field 'msg1009'\n\t try {\n\t\tdata.msg1009 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 16, 136));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1009\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1009 = null;\n\t}\n\tif (has_msg10100) {\n\t // Decode field 'msg1010'\n\t try {\n\t\tdata.msg1010 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 18, 166));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1010\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1010 = null;\n\t}\n\tif (has_msg10110) {\n\t // Decode field 'msg1011'\n\t try {\n\t\tdata.msg1011 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 21, 222));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1011\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1011 = null;\n\t}\n\tif (has_msg10120) {\n\t // Decode field 'msg1012'\n\t try {\n\t\tdata.msg1012 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 24, 268));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1012\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1012 = null;\n\t}\n\tif (has_msg10130) {\n\t // Decode field 'msg1013'\n\t try {\n\t\tdata.msg1013 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 13, 27));\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendFieldContext(\"msg1013\", \"OCTET STRING\");\n\t\tthrow de;\n\t }\n\t} else {\n\t data.msg1013 = null;\n\t}\n /** Decode extensions **/\n\tif (!_has_extensions0) {\n\t data.msg1014 = null;\n\t data.msg1015 = null;\n\t data.msg1016 = null;\n\t data.msg1017 = null;\n\t data.msg1019 = null;\n\t data.msg1020 = null;\n\t data.msg1021 = null;\n\t data.msg1022 = null;\n\t data.msg1023 = null;\n\t data.msg1024 = null;\n\t data.msg1025 = null;\n\t data.msg1026 = null;\n\t data.msg1027 = null;\n\t data.msg1029 = null;\n\t data.msg1030 = null;\n\t data.msg1031 = null;\n\t data.msg1032 = null;\n\t return data;\n\t}\n\tlen0 = coder.decodeNormallySmallLength(source);\n\tif (coder.moreFragments())\n\t throw new DecoderException(com.oss.util.ExceptionDescriptor._too_many_ext_additions, null, \"16384 or more\");\n\tboolean has_msg10140 = len0 > 0 ? source.readBit() : false;\n\tboolean has_msg10150 = len0 > 1 ? source.readBit() : false;\n\tboolean has_msg10160 = len0 > 2 ? source.readBit() : false;\n\tboolean has_msg10170 = len0 > 3 ? source.readBit() : false;\n\tboolean has_msg10190 = len0 > 4 ? source.readBit() : false;\n\tboolean has_msg10200 = len0 > 5 ? source.readBit() : false;\n\tboolean has_msg10210 = len0 > 6 ? source.readBit() : false;\n\tboolean has_msg10220 = len0 > 7 ? source.readBit() : false;\n\tboolean has_msg10230 = len0 > 8 ? source.readBit() : false;\n\tboolean has_msg10240 = len0 > 9 ? source.readBit() : false;\n\tboolean has_msg10250 = len0 > 10 ? source.readBit() : false;\n\tboolean has_msg10260 = len0 > 11 ? source.readBit() : false;\n\tboolean has_msg10270 = len0 > 12 ? source.readBit() : false;\n\tboolean has_msg10290 = len0 > 13 ? source.readBit() : false;\n\tboolean has_msg10300 = len0 > 14 ? source.readBit() : false;\n\tboolean has_msg10310 = len0 > 15 ? source.readBit() : false;\n\tboolean has_msg10320 = len0 > 16 ? source.readBit() : false;\n\tint unknown_exts0 = 0;\n\tif (len0 > 17)\n\t for (int idx0 = 0; idx0 < len0 - 17; idx0++) {\n\t\tif (source.readBit())\n\t\t ++unknown_exts0;\n\t }\n /** Decode extension fields **/\n\tbitstream0 = source;\n\tsource = coder.createNestedStream(bitstream0);\n\ttry {\n\t if (has_msg10140) {\n\t\t// Decode extension 'msg1014'\n\t\ttry {\n\t\t data.msg1014 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 15, 15));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1014\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1014 = null;\n\t }\n\t if (has_msg10150) {\n\t\t// Decode extension 'msg1015'\n\t\ttry {\n\t\t data.msg1015 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 13, 69));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1015\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1015 = null;\n\t }\n\t if (has_msg10160) {\n\t\t// Decode extension 'msg1016'\n\t\ttry {\n\t\t data.msg1016 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 14, 81));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1016\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1016 = null;\n\t }\n\t if (has_msg10170) {\n\t\t// Decode extension 'msg1017'\n\t\ttry {\n\t\t data.msg1017 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 16, 115));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1017\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1017 = null;\n\t }\n\t if (has_msg10190) {\n\t\t// Decode extension 'msg1019'\n\t\ttry {\n\t\t data.msg1019 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 62, 62));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1019\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1019 = null;\n\t }\n\t if (has_msg10200) {\n\t\t// Decode extension 'msg1020'\n\t\ttry {\n\t\t data.msg1020 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 45, 45));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1020\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1020 = null;\n\t }\n\t if (has_msg10210) {\n\t\t// Decode extension 'msg1021'\n\t\ttry {\n\t\t data.msg1021 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 62, 62));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1021\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1021 = null;\n\t }\n\t if (has_msg10220) {\n\t\t// Decode extension 'msg1022'\n\t\ttry {\n\t\t data.msg1022 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 75, 75));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1022\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1022 = null;\n\t }\n\t if (has_msg10230) {\n\t\t// Decode extension 'msg1023'\n\t\ttry {\n\t\t data.msg1023 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 73, 73));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1023\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1023 = null;\n\t }\n\t if (has_msg10240) {\n\t\t// Decode extension 'msg1024'\n\t\ttry {\n\t\t data.msg1024 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 74, 74));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1024\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1024 = null;\n\t }\n\t if (has_msg10250) {\n\t\t// Decode extension 'msg1025'\n\t\ttry {\n\t\t data.msg1025 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 25, 25));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1025\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1025 = null;\n\t }\n\t if (has_msg10260) {\n\t\t// Decode extension 'msg1026'\n\t\ttry {\n\t\t data.msg1026 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 30, 30));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1026\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1026 = null;\n\t }\n\t if (has_msg10270) {\n\t\t// Decode extension 'msg1027'\n\t\ttry {\n\t\t data.msg1027 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 33, 33));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1027\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1027 = null;\n\t }\n\t if (has_msg10290) {\n\t\t// Decode extension 'msg1029'\n\t\ttry {\n\t\t data.msg1029 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 10, 69));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1029\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1029 = null;\n\t }\n\t if (has_msg10300) {\n\t\t// Decode extension 'msg1030'\n\t\ttry {\n\t\t data.msg1030 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 14, 105));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1030\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1030 = null;\n\t }\n\t if (has_msg10310) {\n\t\t// Decode extension 'msg1031'\n\t\ttry {\n\t\t data.msg1031 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 15, 107));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1031\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1031 = null;\n\t }\n\t if (has_msg10320) {\n\t\t// Decode extension 'msg1032'\n\t\ttry {\n\t\t data.msg1032 = new OctetString(com.oss.coders.per.PerOctets.decode(coder, source, 20, 20));\n\t\t coder.completeWrappedEncoding(source);\n\t\t} catch (Exception e) {\n\t\t DecoderException de = DecoderException.wrapException(e);\n\t\t de.appendFieldContext(\"msg1032\", \"OCTET STRING\");\n\t\t throw de;\n\t\t}\n\t } else {\n\t\tdata.msg1032 = null;\n\t }\n\t} finally {\n\t source.close();\n\t}\n\tsource = bitstream0;\n\tfor (int idx0 = 0; idx0 < unknown_exts0; idx0++) {\n\t try {\n\t\tcom.oss.coders.per.PerOctets.skip(coder, source);\n\t } catch (Exception e) {\n\t\tDecoderException de = DecoderException.wrapException(e);\n\t\tde.appendExtensionContext(null, idx0);\n\t\tthrow de;\n\t }\n\t}\n\treturn data;\n }", "private byte[] decode(byte[] msg) {\r\n\t\treturn Base64.decode(msg); \r\n\t}", "@Override\r\n public String decode(String message) throws IllegalStateException {\r\n StringBuilder sb = new StringBuilder();\r\n TrieNode currNode = root;\r\n //check validity of the encoded message\r\n for (char ch : message.toCharArray()) {\r\n if (!this.codeSymbolsSet.contains(ch)) {\r\n throw new IllegalStateException();\r\n }\r\n }\r\n //regular decoding\r\n for (int i = 0; i < message.length(); i++) {\r\n char currChar = message.charAt(i);\r\n if (currNode.getChildrenMap().containsKey(currChar)) {\r\n currNode = currNode.getChildrenMap().get(currChar);\r\n if (currNode.isLeaf()) {\r\n sb.append(currNode.getSymbol());\r\n currNode = root;\r\n }\r\n }\r\n //wrong decoding\r\n else {\r\n throw new IllegalStateException();\r\n }\r\n }\r\n if (!currNode.isLeaf() && currNode != root) {\r\n throw new IllegalStateException();\r\n }\r\n return sb.toString();\r\n }", "public String decode(String codedMessage) {\n StringBuilder result = new StringBuilder(); //Create a new stringbuilder\n BinaryTree<HuffData> currentTree = huffTree; //Get the Huffman Tree\n for (int i = 0; i < codedMessage.length(); i++) { //Loop through the coded message\n //If the character is a 1, set currentTree to the right subtree\n if(codedMessage.charAt(i) == '1') { \n currentTree = currentTree.getRightSubtree();\n } else { //If the character is a 0, set currentTree to the left subtree\n currentTree = currentTree.getLeftSubtree();\n }\n if(currentTree.isLeaf()) { //Once you hit a leaf\n HuffData theData = currentTree.getData(); //Get the data of the leaf\n result.append(theData.symbol); //Append the symbol to the stringbuilder\n currentTree = huffTree; //Reset the currentTree to be the entire tree\n }\n }\n //Return the string of the stringbuilder\n return result.toString();\n }", "private String uncompressLogoutMessage(final String originalMessage) {\n final byte[] binaryMessage = Base64.decodeBase64(originalMessage);\n\n Inflater decompresser = null;\n try {\n // decompress the bytes\n decompresser = new Inflater();\n decompresser.setInput(binaryMessage);\n final byte[] result = new byte[binaryMessage.length * 10];\n\n final int resultLength = decompresser.inflate(result);\n\n // decode the bytes into a String\n return new String(result, 0, resultLength, \"UTF-8\");\n } catch (final Exception e) {\n logger.error(\"Unable to decompress logout message\", e);\n throw new RuntimeException(e);\n } finally {\n if (decompresser != null) {\n decompresser.end();\n }\n }\n }", "byte decodeByte();", "protected void decodeAtom(PushbackInputStream inStream, OutputStream outStream, int l) throws IOException {\n int i, p1, p2, np1, np2;\n byte a = -1, b = -1, c = -1;\n byte high_byte, low_byte;\n byte tmp[] = new byte[3];\n\n i = inStream.read(tmp);\n if (i != 3) {\n throw new CEStreamExhausted();\n }\n for (i = 0; (i < 64) && ((a == -1) || (b == -1) || (c == -1)); i++) {\n if (tmp[0] == map_array[i]) {\n a = (byte) i;\n }\n if (tmp[1] == map_array[i]) {\n b = (byte) i;\n }\n if (tmp[2] == map_array[i]) {\n c = (byte) i;\n }\n }\n high_byte = (byte) (((a & 0x38) << 2) + (b & 0x1f));\n low_byte = (byte) (((a & 0x7) << 5) + (c & 0x1f));\n p1 = 0;\n p2 = 0;\n for (i = 1; i < 256; i = i * 2) {\n if ((high_byte & i) != 0)\n p1++;\n if ((low_byte & i) != 0)\n p2++;\n }\n np1 = (b & 32) / 32;\n np2 = (c & 32) / 32;\n if ((p1 & 1) != np1) {\n throw new CEFormatException(\"UCDecoder: High byte parity error.\");\n }\n if ((p2 & 1) != np2) {\n throw new CEFormatException(\"UCDecoder: Low byte parity error.\");\n }\n outStream.write(high_byte);\n crc.update(high_byte);\n if (l == 2) {\n outStream.write(low_byte);\n crc.update(low_byte);\n }\n }", "private void itemDecode(Player player) {\n\t\tPlayerInventory inventory = player.getInventory();\n\t\tItemStack heldItem = inventory.getItemInMainHand();\n\n\t\tif(heldItem.getItemMeta() instanceof BookMeta) {\n\t\t\tBookMeta meta = (BookMeta) heldItem.getItemMeta();\n\t\t\tif(meta.hasPages()) {\n\t\t\t\tList<String> data = meta.getPages();\n\t\t\t\tItemStack decode = CryptoSecure.decodeItemStack(data);\n\t\t\t\t\n\t\t\t\tif(decode != null) {\n\t\t\t\t\tinventory.addItem(decode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn;\n\t\t}\n\t}", "private void callDecode(ChannelHandlerContext context, Channel channel,\n ChannelBuffer cumulation, SocketAddress remoteAddress) throws Exception {\n List<Object> results = new ArrayList<Object>();\n while (cumulation.readable()) {\n int oldReaderIndex = cumulation.readerIndex();\n Object frame = decode(context, channel, cumulation);\n if (frame == null) {\n if (oldReaderIndex == cumulation.readerIndex()) {\n // Seems like more data is required.\n // Let us wait for the next notification.\n break;\n } else {\n // Previous data has been discarded.\n // Probably it is reading on.\n continue;\n }\n } else if (oldReaderIndex == cumulation.readerIndex()) {\n throw new IllegalStateException(\"decode() method must read at least one byte \"\n + \"if it returned a frame (caused by: \" + getClass() + \")\");\n }\n\n results.add(frame);\n }\n if (results.size() > 0) {\n fireMessageReceived(context, remoteAddress, results);\n }\n }", "public FeedEvent processMessage(DdfMarketBase msg) {\n\t\tif (msg == null) {\n\t\t\t// sanity check\n\t\t\treturn null;\n\t\t}\n\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"processMessage: \" + msg);\n\t\t}\n\n\t\t/*\n\t\t * Can contain Quotes, Book, and a series of Market Events. Always\n\t\t * return the DDF message even if we can't process it by this class. The\n\t\t * TCP and UDP Listen modes (which pushes data from the replay server)\n\t\t * just use the raw DDF Message.\n\t\t */\n\t\tFeedEvent fe = new FeedEvent();\n\t\t// Save RAW DDF Message\n\t\tfe.setDdfMessage(msg);\n\n\t\tif (_type == MasterType.EndOfDay) {\n\t\t\t// Do not process live messages if EOD cache.\n\t\t\treturn fe;\n\t\t}\n\n\t\t/*\n\t\t * Mark as an unknown symbol until we receive the refresh quote.\n\t\t */\n\t\tif (msg.getSymbol() != null && msg.getSymbol().length() > 0) {\n\t\t\tString s = msg.getSymbol();\n\t\t\tQuote quote = getQuote(s);\n\t\t\tif (quote == null) {\n\t\t\t\tunrecoginzedSymbols.put(s, System.currentTimeMillis());\n\t\t\t} else if (unrecoginzedSymbols.containsKey(s)) {\n\t\t\t\t// We have the quote, pull from the unrecognized list\n\t\t\t\tunrecoginzedSymbols.remove(s);\n\t\t\t}\n\t\t}\n\n\t\t// //////////////////////////////////////////////////////////\n\t\t// //////////////////////////////////////////////////////////\n\t\t// Process based on Record Type (Message Type)\n\t\t// ///////////////////////////////////////////////////////////\n\t\t// ///////////////////////////////////////////////////////////\n\t\tif (msg.getRecord() == DdfRecord.Timestamp.value()) {\n\t\t\t// /////////////////////////////\n\t\t\t// TimeStamp Beacon\n\t\t\t// TIME!ZONE\n\t\t\t// ///////////////////////////\n\t\t\tmillisCST = ((DdfTimestamp) msg).getMillisCST();\n\t\t\tDate d = new Date(millisCST);\n\t\t\tfe.setDate(d);\n\n\t\t} else if (msg.getRecord() == DdfRecord.RefreshOld.value()) {\n\t\t\t// /////////////////////////////////////////////////////////\n\t\t\t// record = % - Older Refresh Message, not Used\n\t\t\t// /////////////////////////////////////////////////////////\n\t\t} else if (msg.getRecord() == DdfRecord.RefreshXml.value()) {\n\t\t\t// /////////////////////////////////////////////////////////\n\t\t\t// record = X - Market Data Refresh Messages from Jerq, in XML\n\t\t\t// format\n\t\t\t// ///////////////////////////////////////////////////////////\n\t\t\trecordX_marketRefresh(msg, fe);\n\n\t\t} else if ((msg.getRecord() == '2') || (msg.getRecord() == 'C')) {\n\t\t\t// /////////////////////////////////////////////////////////\n\t\t\t// record = 2 live prices\n\t\t\t// ///////////////////////////////////////////////////////////\n\t\t\t/*\n\t\t\t * If the message is a Trade, set here in order for the\n\t\t\t * ExchangeTradeHandler to be called, regardless if there is a quote\n\t\t\t * available or not.\n\t\t\t */\n\n\t\t\tif (msg instanceof DdfMarketTrade) {\n\t\t\t\tfe.setTrade((DdfMarketTrade) msg);\n\t\t\t}\n\n\t\t\tfinal Quote quote = getQuote(msg.getSymbol());\n\t\t\tif (quote == null) {\n\t\t\t\t/*\n\t\t\t\t * Initial Quote refresh not received yet, get snapshot refresh\n\t\t\t\t * from the web service. Until we receive the snapshot we will\n\t\t\t\t * not call the QuoteHandler.\n\t\t\t\t */\n\t\t\t\tif (feedService != null) {\n\t\t\t\t\t// Schedule the refresh\n\t\t\t\t\tfeedService.scheduleQuoteRefresh(msg.getSymbol());\n\t\t\t\t}\n\t\t\t\treturn fe;\n\t\t\t}\n\t\t\t/*\n\t\t\t * Process record 2, since the symbol is in the system and we have\n\t\t\t * the refresh quote. The Quote object will be updated.\n\t\t\t */\n\t\t\trecord2_liveprices(msg, quote, fe);\n\t\t\tfe.setQuote(quote);\n\t\t\treturn fe;\n\n\t\t} else if (msg.getRecord() == DdfRecord.DepthEndOfDay.value()) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 3 Market Depth, End of Day\n\t\t\t// ///////////////////////////////////////////\n\t\t\tBookQuote b = record3_book_eod(msg);\n\t\t\tfe.setBook(b);\n\t\t} else {\n\t\t\tlog.warn(\"Unrecognized DDF Message: \" + msg);\n\t\t}\n\n\t\treturn fe;\n\t}", "public Message processMessage(Message in) throws ApplicationException {\n\t\ttry {\n\t\t\t// get default ACK\n\t\t\tMessage out = makeACK(in);\n\t\t\tfillDetails(out);\n\t\t\treturn out;\n\t\t} catch (Exception e) {\n\t\t\tthrow new ApplicationException(\"Couldn't create response message: \"\n\t\t\t\t\t+ e.getMessage());\n\t\t}\n\n\t}", "Object decode(String encoded);", "void mo23214a(Message message);", "final void parseUpperTransportPDU(@NonNull final Message message) throws ExtendedInvalidCipherTextException {\n try {\n switch (message.getPduType()) {\n case MeshManagerApi.PDU_TYPE_NETWORK:\n if (message instanceof AccessMessage) { //Access message\n final AccessMessage accessMessage = (AccessMessage) message;\n reassembleLowerTransportAccessPDU(accessMessage);\n final byte[] decryptedUpperTransportControlPdu = decryptUpperTransportPDU(accessMessage);\n accessMessage.setAccessPdu(decryptedUpperTransportControlPdu);\n } else {\n //TODO\n //this where control messages such as heartbeat and friendship messages are to be implemented\n }\n break;\n case MeshManagerApi.PDU_TYPE_PROXY_CONFIGURATION:\n final ControlMessage controlMessage = (ControlMessage) message;\n if (controlMessage.getLowerTransportControlPdu().size() == 1) {\n final byte[] lowerTransportControlPdu = controlMessage.getLowerTransportControlPdu().get(0);\n final ByteBuffer buffer = ByteBuffer.wrap(lowerTransportControlPdu)\n .order(ByteOrder.BIG_ENDIAN);\n message.setOpCode(buffer.get());\n final byte[] parameters = new byte[buffer.capacity() - 1];\n buffer.get(parameters);\n message.setParameters(parameters);\n }\n break;\n }\n } catch (InvalidCipherTextException ex) {\n throw new ExtendedInvalidCipherTextException(ex.getMessage(), ex.getCause(), TAG);\n }\n }", "@Override\r\n\tpublic JT808ProtocalPack receive(String message) throws Exception {\n\t\treturn null;\r\n\t}", "@RabbitListener(queues = \"fulfillment.order\")\n public void processOrderMessage(Object message) {\n\t\tLOG.info(\"Message is of type: \" + message.getClass().getName());\n\t\tif(!(message instanceof byte[])) message = ((Message) message).getBody();\n\t\tString content = new String((byte[])message, StandardCharsets.UTF_8);\n\t\t\n\t\tLOG.info(\"Received on order: \" + content);\n\n\t\ttry {\n\t mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n\t Orderr orderr = mapper.readValue(content, Orderr.class);\n\t\t\tthis.orderRepository.save(orderr);\n\t\t\tString paymentStatus = Shipment.TO_BE_PAID;\n\t\t\tif(orderr.isPaymentReceived()) paymentStatus = Shipment.SHIPPABLE;\n\t\t\tShipment shipment = new Shipment(UUID.randomUUID(), paymentStatus, orderr.getShippingAddress(), orderr);\n\t\t\tthis.shipmentRepository.save(shipment);\n\t\t\tLOG.info(\"Order \" +orderr.getUuid().toString()+ \" received and created a shipment:\\n\" + shipment.toString());\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\tLOG.error(\"Error: \" + e.getMessage());\n\t\t}\n\t\tlatch.countDown();\n }", "public String decode(String message, int groupLength)\n\t{\n\t\tString value = null;\n\n\t\ttry\n\t\t{\n\t\t\tvalue = decode(new StringReader(message), groupLength);\n\t\t}\n\t\tcatch (IOException ioe)\n\t\t{\n\t\t\t// this should NEVER happen with a StringReader\n\t\t\tassert(false);\n\t\t\tioe.printStackTrace();\n\t\t}\n\n\t\treturn value;\n\t}", "private void receiveSymbol(Complex symbol) {\n\t\tphase = (previousSymbol.conjugateTimes(symbol)).phase();\n\t\tpreviousSymbol = symbol;\n\n\t\t// ensure phase is between 0 and 2 pi radians\n\t\tif (phase < 0) {\n\t\t\tphase += 2 * Math.PI;\n\t\t}\n\n\t\t// work out if phase inversion has occurred\n\t\tbits = (((int) (phase / Math.PI + 0.5)) & 1) << 1;\n\n\t\t// simple low pass filter for quality of signal\n\t\tquality = new Complex(0.02 * Math.cos(2 * phase) + 0.98 * quality.Re(), 0.02 * Math.sin(2 * phase) + 0.98 * quality.Im());\n\t\tmetric = 100.0 * quality.norm();\n\n\t\tdecodeShiftRegister = (decodeShiftRegister << 2) | bits;\n\n\t\tswitch (decodeShiftRegister) {\n\t\tcase 0xAAAAAAAA: /* decode is on for preamble - 16 inversions */\n\t\t\tdecode = true;\n\t\t\tquality = new Complex(1.0, 0.0);\n\t\t\tbreak;\n\n\t\tcase 0: /* decode is off for postamble */\n\t\t\tdecode = false;\n\t\t\tquality = new Complex(0.0, 0.0);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tdecode = (!squelchOn || metric > squelch);\n\t\t}\n\n\t\tif (decode) {\n\t\t\treceiveBit(bits == 0 ? 1 : 0);\n\t\t}\n\t}", "public BencodeValue decode() throws IOException\t{\n if (this.getNextIndicator() == -1)\n return null;\n //depending on the possible value of indicator, we decode into an appropriate Object\n if (this.indicator >= '0' && this.indicator <= '9')\n return this.decodeBytes();\n else if (this.indicator == 'i')\n return this.decodeNumber();\n else if (this.indicator == 'l')\n return this.decodeList();\n else if (this.indicator == 'd')\n return this.decodeMap();\n else\n throw new BencodeFormatException\n (\"Unknown indicator '\" + this.indicator + \"'\");\n }", "void decode(Collection<Frame> into, ShareableBytes bytes)\n {\n decode(into, bytes, HEADER_LENGTH);\n }", "@Override\r\n\tprotected void parsePacket(byte[] data)\r\n\t\t\tthrows BeCommunicationDecodeException {\r\n\t\ttry {\r\n\t\t\tsuper.parsePacket(data);\r\n\r\n\t\t\tsimpleHiveAp = CacheMgmt.getInstance().getSimpleHiveAp(apMac);\r\n\t\t\tif (simpleHiveAp == null) {\r\n\t\t\t\tthrow new BeCommunicationDecodeException(\"Invalid apMac: (\" + apMac\r\n\t\t\t\t\t\t+ \"), Can't find corresponding data in cache.\");\r\n\t\t\t}\r\n\t\t\tHmDomain owner = CacheMgmt.getInstance().getCacheDomainById(\r\n\t\t\t\t\tsimpleHiveAp.getDomainId());\r\n\t\t\tString apName = simpleHiveAp.getHostname();\r\n\t\t\t\r\n\t\t\tByteBuffer buf = ByteBuffer.wrap(resultData);\r\n\t\t\t\r\n\t\t\tbuf.getShort(); //tlv number\r\n\t\t\tHmTimeStamp timeStamp = new HmTimeStamp(getMessageTimeStamp(), getMessageTimeZone());\r\n\t\t\tint ifIndex = 0;\r\n\t\t\tString ifName = \"\";\r\n\r\n\t\t\twhile (buf.hasRemaining()) {\r\n\r\n\t\t\t\tshort tlvType = buf.getShort();\r\n\t\t\t\tbuf.getShort(); //tlv length\r\n\t\t\t\tbuf.getShort(); //tlv version\r\n\t\t\t\tif (tlvType == TLVTYPE_RADIOINFO) {\r\n\t\t\t\t\tifIndex = buf.getInt();\r\n\t\t\t\t\tbyte len = buf.get();\r\n\t\t\t\t\tifName = AhDecoder.bytes2String(buf, len);\r\n\t\t\t\t} else if (tlvType == TLVTYPE_INTERFERENCESTATS) {\r\n\t\t\t\t\tAhInterferenceStats interferenceStats = new AhInterferenceStats();\r\n\t\t\t\t\tinterferenceStats.setApMac(apMac);\r\n\t\t\t\t\tinterferenceStats.setTimeStamp(timeStamp);\r\n\t\t\t\t\tinterferenceStats.setIfIndex(ifIndex);\r\n\t\t\t\t\tinterferenceStats.setIfName(ifName);\r\n\t\t\t\t\tinterferenceStats.setOwner(owner);\r\n\t\t\t\t\tinterferenceStats.setApName(apName);\r\n\r\n\t\t\t\t\tinterferenceStats.setChannelNumber((short)AhDecoder.byte2int(buf.get()));\r\n\t\t\t\t\tinterferenceStats.setAverageTXCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setAverageRXCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setAverageInterferenceCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setAverageNoiseFloor(buf.get());\r\n\t\t\t\t\tinterferenceStats.setShortTermTXCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setShortTermRXCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setShortTermInterferenceCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setShortTermNoiseFloor(buf.get());\r\n\t\t\t\t\tinterferenceStats.setSnapShotTXCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setSnapShotRXCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setSnapShotInterferenceCU(buf.get());\r\n\t\t\t\t\tinterferenceStats.setSnapShotNoiseFloor(buf.get());\r\n\t\t\t\t\tinterferenceStats.setCrcError(buf.get());\r\n\t\t\t\t\tinterferenceStats.setInterferenceCUThreshold(buf.get());\r\n\t\t\t\t\tinterferenceStats.setCrcErrorRateThreshold(buf.get());\r\n\t\t\t\t\tinterferenceStats.setSeverity(buf.get());\r\n\t\t\t\t\t\r\n\t\t\t\t\tinterferenceStatsList.add(interferenceStats);\r\n\t\t\t\t} else if (tlvType == TLVTYPE_ACSPNEIGHBOR) {\r\n\t\t\t\t\tAhACSPNeighbor neighbor = new AhACSPNeighbor();\r\n\t\t\t\t\tneighbor.setApMac(apMac);\r\n\t\t\t\t\tneighbor.setTimeStamp(timeStamp);\r\n\t\t\t\t\tneighbor.setIfIndex(ifIndex);\r\n\t\t\t\t\tneighbor.setOwner(owner);\r\n\r\n\t\t\t\t\tneighbor.setBssid(AhDecoder.bytes2hex(buf, 6).toUpperCase());\r\n\t\t\t\t\tneighbor.setNeighborMac(AhDecoder.bytes2hex(buf, 6).toUpperCase());\r\n\t\t\t\t\tneighbor.setNeighborRadioMac(AhDecoder.bytes2hex(buf, 6).toUpperCase());\r\n\t\t\t\t\tneighbor.setLastSeen(AhDecoder.int2long(buf.getInt()) * 1000);\r\n\t\t\t\t\tneighbor.setChannelNumber(AhDecoder.byte2int(buf.get()));\r\n\t\t\t\t\tneighbor.setTxPower(buf.get());\r\n\t\t\t\t\tneighbor.setRssi(buf.get());\r\n\t\t\t\t\tbyte len = buf.get();\r\n\t\t\t\t\tneighbor.setSsid(AhDecoder.bytes2String(buf, AhDecoder.byte2int(len)));\r\n\r\n\t\t\t\t\tneighborList.add(neighbor);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new BeCommunicationDecodeException(\r\n\t\t\t\t\t\"BeInterferenceMapResultEvent.parsePacket() catch exception\", e);\r\n\t\t}\r\n\t}", "private byte[] decryptUpperTransportPDU(@NonNull final AccessMessage accessMessage) throws InvalidCipherTextException {\n byte[] decryptedUpperTransportPDU;\n byte[] key;\n final int transportMicLength = accessMessage.getAszmic() == SZMIC ? MAXIMUM_TRANSMIC_LENGTH : MINIMUM_TRANSMIC_LENGTH;\n //Check if the key used for encryption is an application key or a device key\n final byte[] nonce;\n if (APPLICATION_KEY_IDENTIFIER == accessMessage.getAkf()) {\n key = mMeshNode.getDeviceKey();\n //If its a device key that was used to encrypt the message we need to create a device nonce to decrypt it\n nonce = createDeviceNonce(accessMessage.getAszmic(), accessMessage.getSequenceNumber(), accessMessage.getSrc(), accessMessage.getDst(), accessMessage.getIvIndex());\n decryptedUpperTransportPDU = SecureUtils.decryptCCM(accessMessage.getUpperTransportPdu(), key, nonce, transportMicLength);\n } else {\n final List<ApplicationKey> keys = mUpperTransportLayerCallbacks.getApplicationKeys(accessMessage.getNetworkKey().getKeyIndex());\n if (keys.isEmpty())\n throw new IllegalArgumentException(\"Unable to find the app key to decrypt the message\");\n\n nonce = createApplicationNonce(accessMessage.getAszmic(), accessMessage.getSequenceNumber(), accessMessage.getSrc(),\n accessMessage.getDst(), accessMessage.getIvIndex());\n\n if (MeshAddress.isValidVirtualAddress(accessMessage.getDst())) {\n decryptedUpperTransportPDU = decrypt(accessMessage, mUpperTransportLayerCallbacks.gerVirtualGroups(), keys, nonce, transportMicLength);\n } else {\n decryptedUpperTransportPDU = decrypt(accessMessage, keys, nonce, transportMicLength);\n }\n }\n\n if (decryptedUpperTransportPDU == null)\n throw new IllegalArgumentException(\"Unable to decrypt the message, invalid application key identifier!\");\n\n final byte[] tempBytes = new byte[decryptedUpperTransportPDU.length];\n ByteBuffer decryptedBuffer = ByteBuffer.wrap(tempBytes);\n decryptedBuffer.order(ByteOrder.LITTLE_ENDIAN);\n decryptedBuffer.put(decryptedUpperTransportPDU);\n decryptedUpperTransportPDU = decryptedBuffer.array();\n return decryptedUpperTransportPDU;\n }", "@RabbitListener(queues = \"fulfillment.payment\")\n public void processPaymentMessage(Object message) {\n\t\tLOG.info(\"Message is of type: \" + message.getClass().getName());\n\t\tif(!(message instanceof byte[])) message = ((Message) message).getBody();\n\t\tString content = new String((byte[])message, StandardCharsets.UTF_8);\n \tLOG.info(\"Received on payment: \" + content);\n\t\ttry {\n\t HashMap payment = mapper.readValue(content, HashMap.class);\n\t\t\tLOG.info(\"Payment [\" +payment.toString()+ \"] received.\");\n\t String orderID = payment.get(\"orderUUID\").toString();\n\t boolean paymentReceived = ((Boolean) payment.get(\"paymentReceived\")).booleanValue();\n\t Orderr orderr = this.orderRepository.findOne(UUID.fromString(orderID));\n\t if(orderr != null){\n\t\t orderr.setPaymentReceived(paymentReceived);\n\t\t this.orderRepository.save(orderr);\n\t\t if(paymentReceived){\n\t\t \tShipment shipment = this.shipmentRepository.findByOrderr(orderr);\n\t\t \tshipment.setStatus(Shipment.SHIPPABLE);\n\t\t \tthis.shipmentRepository.save(shipment);\n\t\t \tLOG.info(\"Shipment updated to status:\" + shipment.getStatus());\n\t\t }\n\t }\n\t else{\n\t \tLOG.info(\"Could not find order with ID: \" + orderID);\n\t }\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\tLOG.error(\"Error: \" + e.getMessage());\n\t\t}\n\t\tlatch.countDown();\n }", "public void testParsing2() throws Exception {\n String data = \"8=FIX.4.2\\0019=76\\001\";\n data += \"35=6\\001\";\n data += \"23=IDENTIFIER\\001\";\n data += \"28=N\\001\";\n data += \"55=MSFT\\001\";\n data += \"54=1\\001\";\n data += \"711=2\\001\";\n data += \"311=DELL\\001\";\n data += \"318=USD\\001\";\n data += \"311=IBM\\001\";\n data += \"318=CAD\\001\";\n data += \"10=037\\001\";\n Message message = new Message(data, DataDictionaryTest.getDictionary());\n \n assertHeaderField(message, \"FIX.4.2\", BeginString.FIELD);\n assertHeaderField(message, \"76\", BodyLength.FIELD);\n assertHeaderField(message, MsgType.INDICATION_OF_INTEREST, MsgType.FIELD);\n assertBodyField(message, \"IDENTIFIER\", IOIid.FIELD);\n assertTrailerField(message, \"037\", CheckSum.FIELD);\n IndicationOfInterest.NoUnderlyings valueMessageType = new IndicationOfInterest.NoUnderlyings();\n message.getGroup(1, valueMessageType);\n assertEquals(\"wrong value\", \"DELL\", valueMessageType.getString(UnderlyingSymbol.FIELD));\n assertEquals(\"wrong value\", \"USD\", valueMessageType.getString(UnderlyingCurrency.FIELD));\n message.getGroup(2, valueMessageType);\n assertEquals(\"wrong value\", \"IBM\", valueMessageType.getString(UnderlyingSymbol.FIELD));\n assertEquals(\"wrong value\", \"CAD\", valueMessageType.getString(UnderlyingCurrency.FIELD));\n }", "@Test void longerMessage() {\n\t\tString message = \" ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\" +\n\t\t\t\t\" ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\t\tAztecCode marker = new AztecEncoder().addUpper(message).fixate();\n\t\tclearMarker(marker);\n\n\t\tassertTrue(new AztecDecoder().process(marker));\n\t\tassertEquals(message, marker.message);\n\t}", "private void reportClose(final HRegionInfo region, final byte[] message) {\n outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_CLOSE, region, message));\n }", "@Override\n public FriendsDTO decode(String s) throws DecodeException {\n FriendsDTO friendsDTO = new FriendsDTO();\n // friendsDTO.setSender(Long.valueOf(obj.getString(\"sender\")));\n // friendsDTO.setReceiver(Long.valueOf(obj.getString(\"receiver\")));\n // friendsDTO.setAccept(obj.getBoolean(\"accept\"));\n return friendsDTO;\n }", "@Override\n public Message decode( String string ) throws DecodeException {\n try {\n byte[] data = EncodeUtil.decodeBase64Zipped( string );\n InputStream is = new ByteArrayInputStream( data );\n ObjectInputStream ois = new ObjectInputStream( is );\n Object o = ois.readObject();\n ois.close();\n return (Message) o;\n } catch ( Exception e ) {\n throw new RuntimeException( \"Unexpected error trying to decode object.\", e );\n }\n }", "@Test\n\tpublic void testDecodeFromStreamWithPauseInTheMiddleOfMessage() throws Exception {\n\n\t\tByteArrayOutputStream bos = new ByteArrayOutputStream();\n\t\tString msg = \"POST /AppName HTTP/1.1\\r\\n\" + \"Content-Type: application/hl7-v2; charset=ISO-8859-2\\r\\n\" + \"Content-Length: \" + ourSampleMessage.getBytes(StandardCharsets.ISO_8859_1).length + \"\\r\\n\" + \"Authorization: Basic aGVsbG86d29ybGQ=\\r\\n\" + \"\\r\\n\";\n\t\tbos.write(msg.getBytes(StandardCharsets.ISO_8859_1));\n\t\tbos.write(ourSampleMessage.getBytes(\"ISO-8859-2\"));\n\t\tAbstractHl7OverHttpDecoder d = new Hl7OverHttpRequestDecoder();\n\n\t\tByteArrayInputStream bais = new ByteArrayInputStream(bos.toByteArray());\n\t\tSplitInputStream is = new SplitInputStream(bais, msg.length() + 10);\n\n\t\td.readHeadersAndContentsFromInputStreamAndDecode(is);\n\n\t\tassertEquals(0, bais.available());\n\t\tassertTrue(d.getConformanceProblems().toString(), d.getConformanceProblems().isEmpty());\n\t\tassertEquals(Charset.forName(\"ISO-8859-2\"), d.getCharset());\n\t\tassertTrue(d.isCharsetExplicitlySet());\n\t\tassertEquals(\"application/hl7-v2\", d.getContentType());\n\t\tassertEquals(ourSampleMessage, d.getMessage());\n\t\tassertEquals(\"hello\", d.getUsername());\n\t\tassertEquals(\"world\", d.getPassword());\n\t\tassertEquals(\"/AppName\", d.getPath());\n\n\t}", "public static String decode(String decode, String decodingName) {\r\n\t\tString decoder = \"\";\r\n\t\tif (decodingName.equalsIgnoreCase(\"base64\")) {\r\n\t\t\tbyte[] decoded = Base64.decodeBase64(decode);\r\n\t\t\ttry {\r\n\t\t\t\tdecoder = new String(decoded, \"UTF-8\");\r\n\t\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\t\tlog.error(\"decode :\" + e.getMessage());\r\n\t\t\t}\r\n\t\t} else if (decodingName.equalsIgnoreCase(\"PBEWithMD5AndDES\")) {\r\n\t\t\t// Key generation for enc and desc\r\n\t\t\tKeySpec keySpec = new PBEKeySpec(secretKey.toCharArray(), salt, iterationCount);\r\n\t\t\tSecretKey key;\r\n\t\t\ttry {\r\n\t\t\t\tkey = SecretKeyFactory.getInstance(\"PBEWithMD5AndDES\").generateSecret(keySpec);\r\n\t\t\t\t// Prepare the parameter to the ciphers\r\n\t\t\t\tAlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);\r\n\t\t\t\t// Decryption process; same key will be used for decr\r\n\t\t\t\tdcipher = Cipher.getInstance(key.getAlgorithm());\r\n\t\t\t\tdcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);\r\n\t\t\t\tif (decode.indexOf(\"(\", 0) > -1) {\r\n\t\t\t\t\tdecode = decode.replace('(', '/');\r\n\t\t\t\t}\r\n\t\t\t\tbyte[] enc = Base64.decodeBase64(decode);\r\n\t\t\t\tbyte[] utf8 = dcipher.doFinal(enc);\r\n\t\t\t\tString charSet = \"UTF-8\";\r\n\t\t\t\tString plainStr = new String(utf8, charSet);\r\n\t\t\t\treturn plainStr;\r\n\t\t\t} catch (InvalidKeySpecException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException\r\n\t\t\t\t\t| InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException\r\n\t\t\t\t\t| IOException e) {\r\n\t\t\t\tlog.error(\"decode :\" + e.getMessage());\r\n\t\t\t}\r\n\t\t} else if (decodingName.equalsIgnoreCase(\"DES/ECB/PKCS5Padding\")) {\r\n\t\t\t// Get a cipher object.\r\n\t\t\tCipher cipher;\r\n\t\t\ttry {\r\n\t\t\t\tcipher = Cipher.getInstance(\"DES/ECB/PKCS5Padding\");\r\n\t\t\t\tcipher.init(Cipher.DECRYPT_MODE, generateKey());\r\n\t\t\t\t// decode the BASE64 coded message\r\n\t\t\t\tBASE64Decoder decoder1 = new BASE64Decoder();\r\n\t\t\t\tbyte[] raw = decoder1.decodeBuffer(decode);\r\n\t\t\t\t// decode the message\r\n\t\t\t\tbyte[] stringBytes = cipher.doFinal(raw);\r\n\t\t\t\t// converts the decoded message to a String\r\n\t\t\t\tdecoder = new String(stringBytes, \"UTF8\");\r\n\t\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IOException\r\n\t\t\t\t\t| IllegalBlockSizeException | BadPaddingException e) {\r\n\t\t\t\tlog.error(\"decode :\" + e.getMessage());\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn decoder;\r\n\t}", "public abstract int decode(ByteBuffer buffer, int offset);", "public BencodeValue decodeBytes() throws IOException {\n int c = this.getNextIndicator();\n int num = c - '0';\n if (num < 0 || num > 9)\n throw new BencodeFormatException(\"Next char should be a digit, instead it is: '\"\n + (char)c + \"'\");\n this.indicator = 0;\n\n c = this.read();\n int i = c - '0';\n while (i >= 0 && i <= 9) {\n num = num*10 + i; //reconstruct a number digit by digit\n c = this.read();\n i = c - '0';\n }\n\n if (c != ':') {\n throw new BencodeFormatException(\"Next char should be a colon, instead it is: '\" +\n (char)c + \"'\");\n }\n return new BencodeValue(read(num));\n }", "public lnrpc.Rpc.PayReq decodePayReq(lnrpc.Rpc.PayReqString request) {\n return blockingUnaryCall(\n getChannel(), getDecodePayReqMethod(), getCallOptions(), request);\n }", "public void upcall(ReadMessage m) {\n \tObject mesg;\r\n \t\r\n try {\r\n mesg = m.readObject();\r\n } catch (ClassNotFoundException e) {\r\n mesg = null;\r\n } catch (IOException e) {\r\n mesg = null;\r\n e.printStackTrace();\r\n } catch (Throwable th) {\r\n mesg = null;\r\n th.printStackTrace();\r\n }\r\n\r\n IbisIdentifier ii = m.origin().ibisIdentifier();\r\n\r\n if (mesg != null) {\r\n ProcessIdentifier pi = new ProcessIdentifier(ii);\r\n if (mesg instanceof RepMILTMMessage) {\r\n\r\n // DEBUG\r\n /* System.err.println(\"Got RepMI upcall of type \"\r\n + ((RepMILTMMessage) mesg).arg.getType() + \" from \"\r\n + m.origin().name());\r\n*/\r\n if (((RepMILTMMessage) mesg).arg.getType() == Operation.LW)\r\n ((RepMILTMMessage) mesg).arg.setType(Operation.RW);\r\n\r\n /* i might not do communication, so i delay the call to m.finish */\r\n proto.processRemoteOperation(((RepMILTMMessage) mesg).arg,\r\n ((RepMILTMMessage) mesg).localLTM, pi, m);\r\n return;\r\n\r\n } else if (mesg instanceof RepMIJoinMessage) {\r\n\r\n// DEBUG\r\n /* System.err.println(\"Got RepMI upcall for joining from \"\r\n + m.origin().name());\r\n */\r\n /*\r\n * needs to be called to release the thread before entering the\r\n * processJoin call which will broadcast the join request to all\r\n * other processes in the system\r\n */\r\n ReceivePortIdentifier joinAckPort = ((RepMIJoinMessage) mesg).recvPortId;\r\n ReceivePortIdentifier joiningIbisPort = ((RepMIJoinMessage) mesg).ibisRPI;\r\n ReceivePortIdentifier joinAckNormalNode = ((RepMIJoinMessage) mesg).joinAckNormalNode;\r\n\r\n try {\r\n m.finish();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n\r\n proto.processJoin(pi, joinAckPort, joiningIbisPort,\r\n joinAckNormalNode);\r\n\r\n return;\r\n\r\n } else if (mesg instanceof RepMISOSMessage) {\r\n try {\r\n m.finish();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n proto.processSOS(ii, ((RepMISOSMessage) mesg).TS,\r\n ((RepMISOSMessage) mesg).recoveryRound);\r\n return;\r\n\r\n } else if (mesg instanceof RepMISOSReplyMessage) {\r\n proto.processSOSReply(ii,\r\n ((RepMISOSReplyMessage) mesg).whomIHelp,\r\n ((RepMISOSReplyMessage) mesg).TS,\r\n ((RepMISOSReplyMessage) mesg).myOps);\r\n return;\r\n }\r\n }\r\n }", "private KarelPacket receiveClosingPacket(KarelPacket receivedKarelPacket) {\n if (receivedKarelPacket.getFlag().isFinishing()) {\n System.out.printf(\"Received a finishing packet. Received %d bytes in %d successful of %d total packets during this session.\\n\", totalBytes, successfulPackets, totalPackets);\n return KarelPacket.createAcknowledgePacket(connectionId, receivedKarelPacket.getSq().toInteger(), receivedKarelPacket.getFlag());\n } else {\n System.out.println(\"Received an error packet.\");\n return null;\n }\n }", "@Test\n public void testClientMessageDecodeWithReleasedInputChannel() throws Exception {\n testNettyMessageClientDecoding(false, true, false);\n }", "public interface OpenOrder {\n\n /**\n * Returns the ID for this order.\n *\n * @return the ID of the order.\n */\n String getId();\n\n /**\n * Returns the exchange date/time the order was created.\n *\n * @return The exchange date/time.\n */\n Date getCreationDate();\n\n /**\n * Returns the id of the market this order was placed on.\n *\n * @return the id of the market.\n */\n String getMarketId();\n\n /**\n * Returns the type of order. Value will be {@link OrderType#BUY} or {@link OrderType#SELL}.\n *\n * @return the type of order.\n */\n OrderType getType();\n\n /**\n * Returns the price per unit for this order. This is usually in BTC or USD.\n *\n * @return the price per unit for this order.\n */\n BigDecimal getPrice();\n\n /**\n * Returns the Quantity remaining for this order. This is usually the amount of the other currency\n * you want to trade for BTC/USD.\n *\n * @return the Quantity remaining for this order.\n */\n BigDecimal getQuantity();\n\n /**\n * Returns the Original total order quantity. If the Exchange does not provide this information,\n * the value will be null. This is usually the amount of the other currency you want to trade for\n * BTC/USD.\n *\n * @return the Original total order quantity if the Exchange provides this information, null\n * otherwise.\n */\n BigDecimal getOriginalQuantity();\n\n /**\n * Returns the Total value of order (price * quantity). This is usually in BTC or USD.\n *\n * @return the Total value of order (price * quantity).\n */\n BigDecimal getTotal();\n}", "org.adscale.format.opertb.AmountMessage.Amount getExchangeprice();", "public ZABEMobileNetwork decode(ProtoReader hVar) throws IOException {\n C30677a aVar = new C30677a();\n long a = hVar.mo40516a();\n while (true) {\n int b = hVar.mo40518b();\n if (b != -1) {\n FieldEncoding c = hVar.mo40519c();\n aVar.addUnknownField(b, c, c.rawProtoAdapter().decode(hVar));\n } else {\n hVar.mo40517a(a);\n return aVar.build();\n }\n }\n }", "byte[] decodeBytes();", "public void decode() throws Exception {\n decodeFat();\n decodeDat();\n }", "Contract decodeContract(String s, XElem elem)\n { \n StringTokenizer st = new StringTokenizer(s, \" \");\n ArrayList acc = new ArrayList(); \n while(st.hasMoreTokens()) acc.add(decodeRefUri(st.nextToken(), elem));\n return new Contract((Uri[])acc.toArray(new Uri[acc.size()]));\n }", "private static String urlDecode(String toDecode) throws UnsupportedEncodingException{\r\n\t\treturn URLDecoder.decode(toDecode, \"UTF-8\");\r\n\t}", "@Override\n public Message decode( byte[] msg, int offset, int maxIdx ) {\n if ( _binDecodeBuilder.getCurrentIndex() < _binDecodeBuilder.getMaxIdx() ) {\n\n ++_msgInPkt;\n \n _binDecodeBuilder.start( msg, offset, maxIdx );\n\n // have space so assume another message present\n \n _pMap.readMap( _binDecodeBuilder );\n \n _templateId = _templateIdReader.read( _binDecodeBuilder, _pMap ); \n\n if ( _templateId == BSE_FAST_RESET ) {\n resetActiveFields();\n }\n \n // @TODO add hard coded generated templates\n \n // Message m = null;\n // \n // // HAND TEMPLATES - ENSURE SWITCH STATEMENT HAS FILLERS\n //\n // if ( m != null ) {\n // _binDecodeBuilder.end(); // only one message per packet in BSE\n // \n // return m;\n // }\n \n return processsSoftTemplateDecode( _templateId );\n }\n \n return null;\n }", "public static int decodeTo(byte[] bufIn, int offsetIn, int lengthIn, byte[] bufOut, int offsetOut, int lengthOut) {\n \n if (bufIn == null || bufOut == null) {\n throw new NullPointerException();\n } else if ((offsetIn < 0) || (offsetIn > bufIn.length) || (lengthIn < 0) \n || ((offsetIn + lengthIn) > bufIn.length) || ((offsetIn + lengthIn) < 0)\n || (offsetOut < 0) || (offsetOut > bufOut.length) || (lengthOut < 0) \n || ((offsetOut + lengthOut) > bufOut.length) || ((offsetOut + lengthOut) < 0)) {\n throw new IndexOutOfBoundsException();\n } else if (lengthIn == 0 || lengthOut == 0) {\n return 0;\n }\n \n /* From RFC 2440 http://tools.ietf.org/html/rfc2440\n * \n * Input data: 0x14fb9c03d97e \n * Hex: 1 4 f b 9 c | 0 3 d 9 7 e \n * 8-bit: 00010100 11111011 10011100 | 00000011 11011001 11111110 \n * 6-bit: 000101 001111 101110 011100 | 000000 111101 100111 111110 \n * Decimal: 5 15 46 28 0 61 37 62 \n * Output: F P u c A 9 l + \n * \n * Input data: 0x14fb9c03d9 \n * Hex: 1 4 f b 9 c | 0 3 d 9 \n * 8-bit: 00010100 11111011 10011100 | 00000011 11011001 \n * pad with 00 \n * 6-bit: 000101 001111 101110 011100 | 000000 111101 100100 \n * Decimal: 5 15 46 28 0 61 36 \n * pad with = \n * Output: F P u c A 9 k = \n * \n * Input data: 0x14fb9c03 \n * Hex: 1 4 f b 9 c | 0 3 \n * 8-bit: 00010100 11111011 10011100 | 00000011 \n * pad with 0000 \n * 6-bit: 000101 001111 101110 011100 | 000000 110000 \n * Decimal: 5 15 46 28 0 48 \n * pad with = = \n * Output: F P u c A w = =\n */\n \n int posOut = 0;\n int posIn = offsetIn;\n // compute output length; 4 bytes in input match 3 bytes in output\n int maxOutLen = (int) ((float) lengthIn * 3 / 4);\n \n byte[] decoded = new byte[maxOutLen];\n int threeOctets = 0; //a group of 3 \"proper\" (8bit) bytes\n for (posIn = offsetIn; posIn < offsetIn + lengthIn && posIn < bufIn.length; posIn++) {\n byte b = bufIn[posIn];\n \n if (b == PAD) {\n break;\n }\n \n if (b >= 0 && b < DECODE_TABLE.length) {\n int result = DECODE_TABLE[b];\n threeOctets = (threeOctets << 6) + result;\n }\n \n if (posIn % 4 == 3) {\n decoded[posOut++] = (byte) (threeOctets >> 16);\n decoded[posOut++] = (byte) ((threeOctets >> 8) & 0xFF);\n decoded[posOut++] = (byte) (threeOctets & 0xFF);\n threeOctets = 0;\n }\n }\n posIn--;\n // at least one shift left to do to align\n threeOctets = threeOctets << 6;\n switch (posIn % 4) {\n case 1:\n threeOctets = threeOctets << 6;\n decoded[posOut++] = (byte) ((threeOctets >> 16));\n break;\n\n case 2:\n decoded[posOut++] = (byte) (threeOctets >> 16);\n decoded[posOut++] = (byte) ((threeOctets >> 8) & 0xFF);\n break;\n }\n \n if (posOut <= lengthOut) {\n System.arraycopy(decoded, 0, bufOut, offsetOut, posOut);\n return posOut;\n }\n else {\n throw new ArrayStoreException(\"The decoded data doesn't fit in the supplied output buffer!\");\n }\n }", "void mo80456b(Message message);", "void close(Order order);", "@Override\n\tpublic void decode(Element aElement) throws EPPDecodeException {\n\n\t\t// Status\n\t\tElement theElm = EPPUtil.getElementByTagNameNS(aElement,\n\t\t\t\tEPPNameVerificationMapFactory.NS, ELM_STATUS);\n\t\tString theStatusStr = theElm.getAttribute(ATTR_STATUS);\n\t\tthis.status = EPPNameVerificationStatus.getStatus(theStatusStr);\n\n\t\t// Reason\n\t\tthis.reason = EPPUtil.decodeString(aElement,\n\t\t\t\tEPPNameVerificationMapFactory.NS, ELM_REASON);\n\n\t\t// Language\n\t\t/**\n\t\t * @todo Uncomment once the lang attribute is added to the reason / msg\n\t\t * element. Element theElm =\n\t\t * EPPUtil.getElementByTagNameNS(aElement,\n\t\t * EPPNameVerificationMapFactory.NS, ELM_REASON); this.language =\n\t\t * theElm.getAttribute(ATTR_LANG);\n\t\t */\n\t}", "public static String decodeStarsMessage(byte[] res) {\n\t\t// First 2 bytes contain message header\n\t\tint header = Util.read16(res, 0);\n\n\t\t// Lower 10 bits, this means 1023 max message bytesize!\n\t\tint byteSize = (header & 0x3ff); \n\t\tint asciiIndicator = header >> 10; // Upper 6 bits\n\n\t\t// If the top 6 bits are all 1's, then the entire message is ASCII\n\t\t// encoded instead of Stars! encoded and the bytesize bits are inverted\n\t\tboolean useAscii = false;\n\t\tif(asciiIndicator == 0x3f) {\n\t\t\tuseAscii = true;\n\t\t\tbyteSize = (~byteSize & 0x3ff);\n\t\t}\n\n\t\t// Convert byte array to hex string, stripping off first 2 header bytes\n\t\tbyte[] textBytes = Util.subArray(res, 2);\n\t\tString hexChars = Util.byteArrayToHex(textBytes);\n\n\t\tString decoded = \"Error decoding message\";\n\t\tif(useAscii)\n\t\t\tdecoded = Util.decodeHexAscii(hexChars, byteSize);\n\t\telse\n\t\t\tdecoded = Util.decodeHexStarsString(hexChars, byteSize);\n\n\t\treturn decoded;\n\t}", "@Override\n public Order deserialize(String topic, byte[] data) {\n ObjectMapper objectMapper = new ObjectMapper();\n Order order = null;\n try {\n // Deserialize the byte array into an Order object using Jackson\n order = objectMapper.readValue(data, Order.class);\n } catch (IOException e) {\n // Handle any deserialization errors and print the stack trace\n e.printStackTrace();\n }\n return order;\n }", "String decodeString();", "private SigmaProtocolMsg receiveMsgFromProver() throws ClassNotFoundException, IOException {\n\t\tSerializable msg = null;\n\t\ttry {\n\t\t\t//receive the mesage.\n\t\t\tmsg = channel.receive();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IOException(\"failed to receive the a message. The thrown message is: \" + e.getMessage());\n\t\t}\n\t\t//If the given message is not an instance of SigmaProtocolMsg, throw exception.\n\t\tif (!(msg instanceof SigmaProtocolMsg)){\n\t\t\tthrow new IllegalArgumentException(\"the given message should be an instance of SigmaProtocolMsg\");\n\t\t}\n\t\t//Return the given message.\n\t\treturn (SigmaProtocolMsg) msg;\n\t}", "void mo80453a(Message message);", "public Track2EquivalentData(byte[] data) {\n if (data.length > 19) {\n throw new SmartCardException(\"Invalid Track2EquivalentData length: \" + data.length);\n }\n String str = Util.byteArrayToHexString(data).toUpperCase();\n //Field Separator (Hex 'D')\n int fieldSepIndex = str.indexOf('D');\n pan = new PAN(str.substring(0, fieldSepIndex));\n //Skip Field Separator\n int YY = Util.binaryHexCodedDecimalToInt(str.substring(fieldSepIndex + 1, fieldSepIndex + 3));\n int MM = Util.binaryHexCodedDecimalToInt(str.substring(fieldSepIndex + 3, fieldSepIndex + 5));\n Calendar cal = Calendar.getInstance();\n cal.set(2000 + YY, MM - 1, 0, 0, 0, 0);\n cal.set(Calendar.MILLISECOND, 0);\n this.expirationDate = cal.getTime();\n serviceCode = new ServiceCode(str.substring(fieldSepIndex + 5, fieldSepIndex + 8).toCharArray());\n int padIndex = str.indexOf('F', fieldSepIndex + 8);\n if (padIndex != -1) {\n //Padded with one Hex 'F' if needed to ensure whole bytes\n discretionaryData = str.substring(fieldSepIndex + 8, padIndex);\n } else {\n discretionaryData = str.substring(fieldSepIndex + 8);\n }\n }", "public void receive( Message message )\n\t{\n\t\tif( mCanProcessAudio )\n\t\t{\n\t\t\tif( message instanceof LDUMessage )\n\t\t\t{\n\t\t\t\tLDUMessage ldu = (LDUMessage)message;\n\t\t\t\t\n\t\t\t\t/* Check valid ldu frames for encryption. Set state to encrypted\n\t\t\t\t * so that no encrypted frames are sent to the converter */\n\t\t\t\tif( ldu.isValid() )\n\t\t\t\t{\n\t\t\t\t\tmEncryptedAudio = ldu.isEncrypted();\n\t\t\t\t}\n\n\t\t\t\tif( !mEncryptedAudio )\n\t\t\t\t{\n\t\t\t\t\tfor( byte[] frame: ((LDUMessage)message).getIMBEFrames() )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( !mIMBEFrameQueue.offer( frame ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmLog.debug( \"IMBE frame queue full - throwing away \"\n\t\t\t\t\t\t\t\t\t+ \"imbe audio frame\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private CharsetDecoder decoderFromExternalDeclaration(String encoding)\n throws SAXException {\n if (encoding == null) {\n return null;\n }\n encoding = encoding.toUpperCase();\n if (\"ISO-8859-1\".equals(encoding)) {\n encoding = \"Windows-1252\";\n }\n if (\"UTF-16\".equals(encoding) || \"UTF-32\".equals(encoding)) {\n swallowBom = false;\n }\n try {\n Charset cs = Charset.forName(encoding);\n String canonName = cs.name();\n if (canonName.startsWith(\"X-\") || canonName.startsWith(\"x-\")\n || canonName.startsWith(\"Mac\")) {\n if (encoding.startsWith(\"X-\")) {\n err(\"The encoding \\u201C\"\n + encoding\n + \"\\u201D is not an IANA-registered encoding. (Charmod C022)\");\n } else {\n err(\"The encoding \\u201C\"\n + encoding\n + \"\\u201D is not an IANA-registered encoding and did\\u2019t start with \\u201CX-\\u201D. (Charmod C023)\");\n }\n } else if (!canonName.equalsIgnoreCase(encoding)) {\n err(\"The encoding \\u201C\"\n + encoding\n + \"\\u201D is not the preferred name of the character encoding in use. The preferred name is \\u201C\"\n + canonName + \"\\u201D. (Charmod C024)\");\n }\n if (EncodingInfo.isObscure(canonName)) {\n warn(\"The character encoding \\u201C\"\n + encoding\n + \"\\u201D is not widely supported. Better interoperability may be achieved by using \\u201CUTF-8\\u201D.\");\n }\n return cs.newDecoder();\n } catch (IllegalCharsetNameException e) {\n err(\"Illegal character encoding name: \\u201C\" + encoding\n + \"\\u201D. Will sniff.\");\n } catch (UnsupportedCharsetException e) {\n err(\"Unsupported character encoding name: \\u201C\" + encoding\n + \"\\u201D. Will sniff.\");\n swallowBom = true;\n }\n return null; // keep the compiler happy\n }", "Stock retrieveStock(String symbol, String asOf);", "public interface MsgManageInf {\n void parseOrder(String order);\n}", "protected String decodeByteWithParity(String given) {\n if (given == null || given.length() != 4) {\n return \"\";\n }\n if (given.charAt(3) == '?') {\n return given.substring(0, 3);\n }\n boolean parityActual = false;\n String result = given.substring(0, 3);\n for (char c : result.toCharArray()) {\n if (c == '1') {\n parityActual = !parityActual;\n }\n }\n boolean parityExpected = given.charAt(3) == '1';\n return parityExpected == parityActual ?\n result.replaceAll(\"\\\\?\", \"0\") :\n result.replaceAll(\"\\\\?\", \"1\");\n }", "public static void decode() {\n char[] symbols = initializeSymbols();\n int position;\n while (!BinaryStdIn.isEmpty()) {\n position = BinaryStdIn.readChar();\n char symbol = symbols[position];\n BinaryStdOut.write(symbol, BITS_PER_BYTE);\n System.arraycopy(symbols, 0, symbols, 1, position);\n symbols[0] = symbol;\n }\n BinaryStdOut.close();\n }", "public static Command decode(ByteBuf buffer) {\n\t\tbyte [] bucket = readPackageFromBuffer(buffer);\n\t\t\n\t\t//read the type\n\t\tCommand.Type type = Command.Type.getTypeForValue(bucket[0]);\n\t\t\n\t\t//call the factory with the actual type to give a hint to it of wth this package is about\n\t\treturn CommandFactory.deserializeCommand(type, bucket);\n\t}", "public byte[] decode(byte[] pArray) throws DecoderException {\n return decodeQuotedPrintable(pArray);\n }", "public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {\n\t\tlong ret = bindings.ChannelReestablish_read(ser);\n\t\tif (ret < 1024) { return null; }\n\t\tResult_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);\n\t\treturn ret_hu_conv;\n\t}", "public RTCMPackage decodeValue(JsonCoder coder, JsonReader source)\n\t throws IOException, DecoderException\n {\n\tboolean[] present0 = new boolean[33];\n\n\tcoder.decodeObject(source);\n\tif (coder.hasMoreProperties(source, true))\n\t do {\n\t\tString tag0 = coder.nextProperty(source);\n\t\tRTCMPackage.__Tag t_tag0 = RTCMPackage.__Tag.getTagSub(tag0);\n\t\tif (t_tag0 == null) \n\t\t t_tag0 = RTCMPackage.__Tag._null_;\n\t\tswitch (t_tag0) {\n\t\t case __anchorPoint:\n\t\t // Decode field 'anchorPoint'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[0])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t if (this.anchorPoint == null)\n\t\t\t\tthis.anchorPoint = new FullPositionVector();\n\t\t\t this.anchorPoint.decodeValue(coder, source);\n\t\t\t present0[0] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"anchorPoint\", \"FullPositionVector\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __rtcmHeader:\n\t\t // Decode field 'rtcmHeader'\n\t\t try {\n\t\t\tif (present0[1])\n\t\t\t throw new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\tthis.rtcmHeader = new RTCMHeader(coder.decodeOctetString(source));\n\t\t\tpresent0[1] = true;\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"rtcmHeader\", \"RTCMHeader\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1001:\n\t\t // Decode field 'msg1001'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[2])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1001 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[2] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1001\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1002:\n\t\t // Decode field 'msg1002'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[3])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1002 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[3] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1002\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1003:\n\t\t // Decode field 'msg1003'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[4])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1003 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[4] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1003\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1004:\n\t\t // Decode field 'msg1004'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[5])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1004 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[5] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1004\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1005:\n\t\t // Decode field 'msg1005'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[6])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1005 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[6] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1005\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1006:\n\t\t // Decode field 'msg1006'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[7])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1006 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[7] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1006\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1007:\n\t\t // Decode field 'msg1007'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[8])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1007 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[8] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1007\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1008:\n\t\t // Decode field 'msg1008'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[9])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1008 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[9] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1008\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1009:\n\t\t // Decode field 'msg1009'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[10])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1009 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[10] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1009\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1010:\n\t\t // Decode field 'msg1010'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[11])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1010 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[11] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1010\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1011:\n\t\t // Decode field 'msg1011'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[12])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1011 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[12] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1011\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1012:\n\t\t // Decode field 'msg1012'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[13])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1012 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[13] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1012\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1013:\n\t\t // Decode field 'msg1013'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[14])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1013 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[14] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1013\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1014:\n\t\t // Decode extension 'msg1014'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[15])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1014 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[15] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1014\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1015:\n\t\t // Decode extension 'msg1015'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[16])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1015 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[16] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1015\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1016:\n\t\t // Decode extension 'msg1016'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[17])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1016 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[17] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1016\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1017:\n\t\t // Decode extension 'msg1017'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[18])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1017 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[18] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1017\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1019:\n\t\t // Decode extension 'msg1019'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[19])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1019 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[19] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1019\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1020:\n\t\t // Decode extension 'msg1020'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[20])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1020 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[20] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1020\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1021:\n\t\t // Decode extension 'msg1021'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[21])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1021 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[21] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1021\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1022:\n\t\t // Decode extension 'msg1022'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[22])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1022 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[22] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1022\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1023:\n\t\t // Decode extension 'msg1023'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[23])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1023 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[23] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1023\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1024:\n\t\t // Decode extension 'msg1024'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[24])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1024 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[24] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1024\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1025:\n\t\t // Decode extension 'msg1025'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[25])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1025 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[25] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1025\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1026:\n\t\t // Decode extension 'msg1026'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[26])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1026 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[26] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1026\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1027:\n\t\t // Decode extension 'msg1027'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[27])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1027 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[27] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1027\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1029:\n\t\t // Decode extension 'msg1029'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[28])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1029 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[28] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1029\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1030:\n\t\t // Decode extension 'msg1030'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[29])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1030 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[29] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1030\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1031:\n\t\t // Decode extension 'msg1031'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[30])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1031 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[30] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1031\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t case __msg1032:\n\t\t // Decode extension 'msg1032'\n\t\t try {\n\t\t\tif (!coder.isNullValue(source)) {\n\t\t\t if (present0[31])\n\t\t\t\tthrow new DecoderException(ExceptionDescriptor._field_repeat, null);\n\t\t\t this.msg1032 = new OctetString(coder.decodeOctetString(source));\n\t\t\t present0[31] = true;\n\t\t\t}\n\t\t } catch (Exception e) {\n\t\t\tDecoderException de = DecoderException.wrapException(e);\n\t\t\tde.appendFieldContext(\"msg1032\", \"OCTET STRING\");\n\t\t\tthrow de;\n\t\t }\n\t\t break;\n\t\t default:\n\t\t\tcoder.skipValue(source);\n\t\t\tbreak;\n\t\t}\n\t } while (coder.hasMoreProperties(source, false));\n\tif (!present0[0])\n\t this.anchorPoint = null;\n\tif (!present0[1])\n\t throw new DecoderException(ExceptionDescriptor._field_omit, \": 'rtcmHeader'\");\n\tif (!present0[2])\n\t this.msg1001 = null;\n\tif (!present0[3])\n\t this.msg1002 = null;\n\tif (!present0[4])\n\t this.msg1003 = null;\n\tif (!present0[5])\n\t this.msg1004 = null;\n\tif (!present0[6])\n\t this.msg1005 = null;\n\tif (!present0[7])\n\t this.msg1006 = null;\n\tif (!present0[8])\n\t this.msg1007 = null;\n\tif (!present0[9])\n\t this.msg1008 = null;\n\tif (!present0[10])\n\t this.msg1009 = null;\n\tif (!present0[11])\n\t this.msg1010 = null;\n\tif (!present0[12])\n\t this.msg1011 = null;\n\tif (!present0[13])\n\t this.msg1012 = null;\n\tif (!present0[14])\n\t this.msg1013 = null;\n\tif (!present0[15])\n\t this.msg1014 = null;\n\tif (!present0[16])\n\t this.msg1015 = null;\n\tif (!present0[17])\n\t this.msg1016 = null;\n\tif (!present0[18])\n\t this.msg1017 = null;\n\tif (!present0[19])\n\t this.msg1019 = null;\n\tif (!present0[20])\n\t this.msg1020 = null;\n\tif (!present0[21])\n\t this.msg1021 = null;\n\tif (!present0[22])\n\t this.msg1022 = null;\n\tif (!present0[23])\n\t this.msg1023 = null;\n\tif (!present0[24])\n\t this.msg1024 = null;\n\tif (!present0[25])\n\t this.msg1025 = null;\n\tif (!present0[26])\n\t this.msg1026 = null;\n\tif (!present0[27])\n\t this.msg1027 = null;\n\tif (!present0[28])\n\t this.msg1029 = null;\n\tif (!present0[29])\n\t this.msg1030 = null;\n\tif (!present0[30])\n\t this.msg1031 = null;\n\tif (!present0[31])\n\t this.msg1032 = null;\n\treturn this;\n }", "private void debit(APDU apdu) {\n\n // access authentication\n if ( ! pin.isValidated() )\n ISOException.throwIt\n(SW_PIN_VERIFICATION_REQUIRED);\n\n byte[] buffer = apdu.getBuffer();\n\n byte numBytes =\n (byte)(buffer[ISO7816.OFFSET_LC]);\n\n byte byteRead =\n (byte)(apdu.setIncomingAndReceive());\n\n if ( ( numBytes != 1 ) || (byteRead != 1) )\n ISOException.throwIt\n (ISO7816.SW_WRONG_LENGTH);\n\n // get debit amount\n byte debitAmount =\n buffer[ISO7816.OFFSET_CDATA];\n\n // check debit amount\n if ( ( debitAmount > MAX_TRANSACTION_AMOUNT)\n || ( debitAmount < 0 ) )\n ISOException.throwIt\n (SW_INVALID_TRANSACTION_AMOUNT);\n\n // check the new balance\n if ( (short)( balance - debitAmount ) < (short)0 )\n ISOException.throwIt(SW_NEGATIVE_BALANCE);\n\n balance = (short) (balance - debitAmount);\n\n }", "protected RFCMessageStructure closePart (RFCMessageStructure curPart, long dataEndOffset, boolean isLastPart) throws UnsupportedEncodingException\n {\n if (isLastPart)\n return popPartsStack(curPart, dataEndOffset);\n\n if ((null == _topParts) || _topParts.isEmpty())\n return null;\n\n // update the parent, but do not remove it from the stack\n final RFCMessageStructure parent=_topParts.peek();\n if (null == parent)\n return null;\n\n if (!parent.equals(curPart))\n parent.addSubPart(curPart, true);\n\n final RFCMessageStructure newPart=new RFCMessageStructure();\n newPart.setPartId(RFCMessageStructure.getNextPartId(parent));\n newPart.setHeadersStartOffset(_streamOffset);\n _hdrsParse = true; // need to parse headers of new part\n\n return newPart;\n }", "int decode()\n throws IOException {\n final int start = _in.getBytesRead() - 4;\n \n _callback.objectStart();\n while ( decodeElement() );\n _callback.objectDone();\n \n final int read = _in.getBytesRead() - start;\n\n if ( read != _in._length ) {\n //throw new IllegalArgumentException( \"bad data. lengths don't match \" + read + \" != \" + len );\n }\n\n return _in._length;\n }", "@Override\n public String decode(String code) throws IllegalStateException {\n if (code == null || code.equals(\"\")) {\n throw new IllegalStateException(\"the code cannot be null or empty.\");\n }\n Tree iterator = root;\n decode = \"\";\n\n for (int i = 0; i < code.length(); i++) {\n if (!encodingArray.contains(code.charAt(i))) {\n throw new IllegalStateException(\"The encoded string contains illegal symbol\");\n }\n }\n\n code = decoder(code, iterator);\n\n if (code.length() != 0) {\n throw new IllegalStateException(\"there is some problem with decoding.\");\n }\n\n return decode;\n }", "public BackendService decode(ProtoReader hVar) throws IOException {\n C30726a aVar = new C30726a();\n long a = hVar.mo40516a();\n while (true) {\n int b = hVar.mo40518b();\n if (b != -1) {\n FieldEncoding c = hVar.mo40519c();\n aVar.addUnknownField(b, c, c.rawProtoAdapter().decode(hVar));\n } else {\n hVar.mo40517a(a);\n return aVar.build();\n }\n }\n }", "public abstract String decryptMsg(String msg);", "public synchronized void closeMarket() throws InvalidDataException, OrderNotFoundException {\n\t\tgetBuySide().cancelAll();\n\t\tgetSellSide().cancelAll();\n\t\tupdateCurrentMarket();\n\t}", "public static String sevenBitDecode(String encmsg, int msglen) throws NumberFormatException\n\t{\n\t\t// encmsg: encoded string to decode.\n\t\t// msglen: the requested number of characters to decode.\n\t\tint i, o, r = 0, rlen = 0, olen = 0, charcnt = 0; // ints are 32 bit long.\n\t\tStringBuffer msg = new StringBuffer(160);\n\t\tint encmsglen = encmsg.length();\n\t\tString ostr;\n\t\tboolean exttableescape = false;\n\t\tchar c;\n\t\t\n\t\t// assumes even number of chars in octet string.\n\t\tfor (i = 0; ((i + 1) < encmsglen) && (charcnt < msglen); i = i + 2)\n\t\t{\n\t\t\tostr = encmsg.substring(i, i + 2);\n\t\t\to = Integer.parseInt(ostr, 16);\n\t\t\tolen = 8;\n\t\t\tif (rlen >= 7)\n\t\t\t{\n\t\t\t\t// take a full char off remainder.\n\t\t\t\tc = (char) (r & 127);\n\t\t\t\tr >>>= 7;\n\t\t\t\trlen -= 7;\n\t\t\t\tmsg.append(c);\n\t\t\t\tcharcnt++;\n\t\t\t}\n\t\t\to <<= rlen; // push remainding bits from r to o.\n\t\t\to |= r;\n\t\t\tolen += rlen;\n\t\t\tc = (char) (o & 127); // get first 7 bits from o.\n\t\t\to >>>= 7;\n\t\t\tolen -= 7;\n\t\t\tr = o; // put remainding bits from o to r.\n\t\t\trlen = olen;\n\t\t\n\t\t\t// handle character conversion.\n\t\t\tc = gsmToIsoMap[c];\n\t\t\tif (c == EXTTABLEESCAPE)\n\t\t\t{\n\t\t\t\t// ext table character handling.\n\t\t\t\texttableescape = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (exttableescape == true)\n\t\t\t{\n\t\t\t\texttableescape = false;\n\t\t\t\tc = gsmToIsoExtMap[c];\n\t\t\t}\n\t\t\tmsg.append(c);\n\t\t\tcharcnt++;\n\t\t} \n\t\t// end: for(i=0; ((i+1)<encmsglen) && (charcnt<msglen); i=i+2) {\n\t\t\n\t\tif ((rlen > 0) && (charcnt < msglen)) msg.append((char) r);\n\t\treturn msg.toString();\n\t}", "public void translateTo(PriceEvent event, long sequence, String msg) {\n\t\t}", "@Test\n public void decodeStringDelta()\n {\n {\n final BinaryEncoder encoder = new BinaryEncoder(0, 16, 1.0);\n assertEquals(3.0, encoder.decode(\"0011\"), 0.0);\n }\n\n {\n final BinaryEncoder encoder = new BinaryEncoder(0, 16, 2.0);\n assertEquals(0.0, encoder.decode(\"0001\"), 2.0);\n }\n\n {\n final BinaryEncoder encoder = new BinaryEncoder(0, 16, 0.5);\n assertEquals(3.0, encoder.decode(\"00110\"), 0.0);\n }\n }", "@QMInternal\r\n public AdaptationEvent unpack() {\r\n return event;\r\n }", "@Override\n\t public void onMessage(NewOrderSingle message, SessionID sessionID)\n\t throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue {\n\t System.out.println(\"Inside onMessage for New Order Single\");\n//\t super.onMessage(message, sessionID);\n\t OrdType orderType = message.getOrdType();\n\t Symbol currencyPair = message.getSymbol();\n\t /*\n\t * Assuming that we are directly dealing with Market\n\t */\n\t Price price = null;\n\t if (OrdType.FOREX_MARKET == orderType.getValue()) {\n\t if(this.priceMap.containsKey(currencyPair.getValue())){\n\t price = new Price(this.priceMap.get(currencyPair.getValue()));\n\t } else {\n\t price = new Price(1.4589);\n\t }\n\t }\n\t \n\t //We are hardcoding this to 1, but in real world this may be something like a sequence.\n\t OrderID orderNumber = new OrderID(\"1\");\n\t //Id of the report, a unique identifier, once again this will be somthing like a sequence\n\t ExecID execId = new ExecID(\"1\");\n\t //In this case this is a new order with no exception hence mark it as NEW\n\t ExecTransType exectutionTransactioType = new ExecTransType(ExecTransType.NEW);\n\t //This execution report is for confirming a new Order\n\t ExecType purposeOfExecutionReport =new ExecType(ExecType.FILL);\n\t //Represents status of the order, since this order was successful mark it as filled.\n\t OrdStatus orderStatus = new OrdStatus(OrdStatus.FILLED);\n\t //Represents the currencyPair\n\t Symbol symbol = currencyPair;\n\t //Represents side\n\t Side side = message.getSide();\n\t //What is the quantity left for the day, we will take 100 as a hardcoded value, we can also keep a note of this from say limit module.\n\t LeavesQty leavesQty = new LeavesQty(100);\n\t //Total quantity of all the trades booked in this applicaition, here it is hardcoded to be 100.\n\t CumQty cummulativeQuantity = new CumQty(100);\n\t //Average Price, say make it 1.235\n\t AvgPx avgPx = new AvgPx(1.235);\n\t ExecutionReport executionReport = new ExecutionReport(orderNumber,execId, exectutionTransactioType,\n\t purposeOfExecutionReport, orderStatus, symbol, side, leavesQty, cummulativeQuantity, avgPx);\n\t executionReport.set(price);\n\t try {\n\t Session.sendToTarget(executionReport, sessionID);\n\t } catch (SessionNotFound e) {\n\t e.printStackTrace();\n\t }\n\t \n\t }", "private void processSecureMessage(APDU apdu) {\r\n\t\t// unwrapping message, if no secure messaging specified in CLA of apdu,\r\n\t\t// exception is thrown\r\n\t\tif (!apdu.isSecureMessagingCLA())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\tmSecureChannel.unwrap(apdu.getBuffer(), apdu.getOffsetCdata(),\r\n\t\t\t\tapdu.getIncomingLength());\r\n\t}", "@Override\n\tpublic MapDataMessage decode(ChannelBuffer buffer) {\n\t\tint constant = buffer.readShort();\n\t\tint id = buffer.readShort();\n\t\tint length = buffer.readUnsignedByte();\n\t\tbyte[] data = new byte[length];\n\t\tbuffer.readBytes(data);\n\t\treturn new MapDataMessage(id, data);\n\t}", "@Test\n public void decodeStringNegative()\n {\n final BinaryEncoder encoder = new BinaryEncoder(-8, 8, 1.0);\n assertThat(encoder.decode(\"0011\"), is(-5.0));\n }", "@Override\n protected Message receiveMessage() throws IOException {\n String encoded = this.din.readUTF();\n this.lastMessage = new Date();\n String decodedXml = new String(\n DatatypeConverter.parseBase64Binary(encoded));\n\n return Message.msgFromXML(decodedXml);\n }" ]
[ "0.5742109", "0.55227417", "0.5401231", "0.5259003", "0.5258162", "0.520585", "0.51273835", "0.5066266", "0.5012486", "0.49366596", "0.4925714", "0.4924141", "0.49153635", "0.49097306", "0.48834392", "0.4794204", "0.47343096", "0.472892", "0.47225896", "0.47137225", "0.47055933", "0.46786132", "0.4634931", "0.46347797", "0.46188024", "0.46143484", "0.46078154", "0.4598891", "0.4598207", "0.45946482", "0.45861062", "0.45733196", "0.45675904", "0.4565175", "0.45591652", "0.45466685", "0.45277885", "0.452184", "0.45147565", "0.4506575", "0.45035222", "0.450255", "0.4487146", "0.44585213", "0.44552752", "0.44551885", "0.44395453", "0.4429631", "0.44140443", "0.44059032", "0.44031283", "0.4402809", "0.4388824", "0.43822914", "0.43787822", "0.4377863", "0.437065", "0.43655488", "0.43578398", "0.43557465", "0.4352481", "0.4352233", "0.43461764", "0.43433577", "0.4332372", "0.43236402", "0.43222022", "0.43194798", "0.43166688", "0.42986736", "0.42940462", "0.42932495", "0.42875263", "0.42827135", "0.427779", "0.42707697", "0.42675075", "0.42666125", "0.42651206", "0.42630818", "0.42594108", "0.4258286", "0.42546096", "0.42461807", "0.42396438", "0.42253086", "0.4215486", "0.42103162", "0.41987845", "0.41910324", "0.418972", "0.41896796", "0.41868153", "0.4172198", "0.41719246", "0.4156926", "0.4156224", "0.4154346", "0.41506115", "0.41477352" ]
0.4988301
9
Creates a property descriptor with the given id and display name.
public BooleanPropertyDescriptor(Object id, String displayName, boolean readonly) { super(id, displayName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ListPropertyDescriptor(Object id, String displayName) {\r\n\t\tsuper(id, displayName);\r\n\t}", "public static <T extends AbstractEntity<?>> PropertyDescriptor<T> fromString(final String toStringRepresentation, final Optional<EntityFactory> factory) {\n try {\n final String[] parts = toStringRepresentation.split(\":\");\n final Class<T> entityType = (Class<T>) Class.forName(parts[0]);\n final String propertyName = parts[1];\n\n final Pair<String, String> pair = TitlesDescsGetter.getTitleAndDesc(propertyName, entityType);\n final PropertyDescriptor<T> inst = (PropertyDescriptor<T>) factory.map(f -> f.newByKey(PropertyDescriptor.class, pair.getKey())).orElse(new PropertyDescriptor<>());\n inst.setKey(pair.getKey());\n inst.setDesc(pair.getValue());\n inst.setEntityType(entityType);\n inst.setPropertyName(propertyName);\n\n return inst;//new PropertyDescriptor<T>(entityType, propertyName);\n } catch (final ClassNotFoundException ex) {\n throw Result.failure(ex);\n }\n }", "ServiceDescriptor getIdLocalServiceDescriptor(String id, Object metadata) {\n return new ServiceDescriptor(localAddress.geAddressString(), id, null, null, id, metadata);\n }", "Property createProperty();", "public static <T extends AbstractEntity<?>> PropertyDescriptor<T> fromString(final String toStringRepresentation) {\n try {\n final String[] parts = toStringRepresentation.split(\":\");\n final Class<T> entityType = (Class<T>) Class.forName(parts[0]);\n final String propertyName = parts[1];\n return new PropertyDescriptor<>(entityType, propertyName);\n } catch (final ClassNotFoundException ex) {\n throw Result.failure(ex);\n }\n }", "public DataModelDescriptorBuilder property(PropertyDescriptor descriptor) {\n this.properties.add(descriptor);\n return this;\n }", "A createAttribute( @NonNull final String p_id, @Nonnull final String p_property );", "protected void addCdobj_idPropertyDescriptor(Object object) {\r\n\t\titemPropertyDescriptors.add\r\n\t\t\t(createItemPropertyDescriptor\r\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\r\n\t\t\t\t getResourceLocator(),\r\n\t\t\t\t getString(\"_UI_Icc_cdobj_rec_cdobj_id_feature\"),\r\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Icc_cdobj_rec_cdobj_id_feature\", \"_UI_Icc_cdobj_rec_type\"),\r\n\t\t\t\t IccPackage.Literals.ICC_CDOBJ_REC__CDOBJ_ID,\r\n\t\t\t\t true,\r\n\t\t\t\t false,\r\n\t\t\t\t false,\r\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\r\n\t\t\t\t null,\r\n\t\t\t\t null));\r\n\t}", "protected void addIdPropertyDescriptor ( Object object )\n {\n itemPropertyDescriptors.add ( createItemPropertyDescriptor ( ( (ComposeableAdapterFactory)adapterFactory ).getRootAdapterFactory (), getResourceLocator (), getString ( \"_UI_Site_id_feature\" ), getString ( \"_UI_PropertyDescriptor_description\", \"_UI_Site_id_feature\", \"_UI_Site_type\" ), GlobalPackage.Literals.SITE__ID, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null ) );\n }", "public PropertyType createPropertyType(String id, String css, \r\n String name, String desc, PropertyConfig config) \r\n throws RepositoryAccessException {\r\n \r\n PropertyType type = new PropertyType(id, css, name, desc, config);\r\n if (!createPropertyType(type))\r\n type = null;\r\n \r\n return type;\r\n }", "protected void addTitlePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_UnitField_title_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_UnitField_title_feature\", \"_UI_UnitField_type\"),\n\t\t\t\t WafPackage.Literals.UNIT_FIELD__TITLE,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "protected void addIdentifierPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Requirement_identifier_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Requirement_identifier_feature\", \"_UI_Requirement_type\"),\n\t\t\t\t Y3853992Package.Literals.REQUIREMENT__IDENTIFIER,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "public Descriptor() {\n super(ID);\n }", "public Spec(int id, String name) {\n super();\n this.id = id;\n this.name = name;\n }", "protected void addNamePropertyDescriptor(Object object) {\r\n\t\titemPropertyDescriptors\r\n\t\t\t\t.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),\r\n\t\t\t\t\t\tgetResourceLocator(), getString(\"_UI_OperationCall_name_feature\"),\r\n\t\t\t\t\t\tgetString(\"_UI_PropertyDescriptor_description\", \"_UI_OperationCall_name_feature\",\r\n\t\t\t\t\t\t\t\t\"_UI_OperationCall_type\"),\r\n\t\t\t\t\t\tSystemModelPackage.Literals.OPERATION_CALL__NAME, true, false, false,\r\n\t\t\t\t\t\tItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));\r\n\t}", "protected void addIdentifierPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(createItemPropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),\n\t\t\t\tgetString(\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_identifier_feature\"),\n\t\t\t\tgetString(\"_UI_PropertyDescriptor_description\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_identifier_feature\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_type\"),\n\t\t\t\tAwsworkbenchPackage.Literals.APPLICATION_LOAD_BALANCER_BUILDER_ELASTICLOADBALANCINGV2__IDENTIFIER, true,\n\t\t\t\tfalse, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));\n\t}", "public Property createProperty() {\n Property p = new Property();\n p.setProject(getProject());\n p.setTaskName(\"property\");\n properties.addElement(p);\n return p;\n }", "protected void addNamePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_SecuritySchema_name_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_SecuritySchema_name_feature\", \"_UI_SecuritySchema_type\"),\n\t\t\t\t CorePackage.Literals.SECURITY_SCHEMA__NAME,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "protected void addTitlePropertyDescriptor(Object object) {\n itemPropertyDescriptors.add\n (createItemPropertyDescriptor\n (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n getResourceLocator(),\n getString(\"_UI_ProceedingsType_title_feature\"),\n getString(\"_UI_PropertyDescriptor_description\", \"_UI_ProceedingsType_title_feature\", \"_UI_ProceedingsType_type\"),\n BibtexmlPackage.Literals.PROCEEDINGS_TYPE__TITLE,\n true,\n false,\n false,\n ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n null,\n null));\n }", "private void createImageDescriptor(String id) {\n\t\timageDescriptors.put(id, imageDescriptorFromPlugin(PLUGIN_ID, \"icons/\" + id)); //$NON-NLS-1$\n\t}", "protected void addDisplayLabelPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_DisplayElement_displayLabel_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_DisplayElement_displayLabel_feature\", \"_UI_DisplayElement_type\"),\n\t\t\t\t WafPackage.Literals.DISPLAY_ELEMENT__DISPLAY_LABEL,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "public static SystemProps createNewProperty(String propID, String type, String desc)\n throws DBException\n {\n if (!StringTools.isBlank(propID)) {\n SystemProps prop = SystemProps.getProperty(propID, true/*create*/); // does not return null\n prop.setDataType(StringTools.blankDefault(type,TYPE_STRING));\n if (!StringTools.isBlank(desc)) {\n prop.setDescription(desc);\n }\n prop.save();\n return prop;\n } else {\n throw new DBException(\"Invalid PropertyID specified\");\n }\n }", "protected abstract Property createProperty(String key, Object value);", "protected void addNamePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Cell_name_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Cell_name_feature\", \"_UI_Cell_type\"),\n\t\t\t\t LDEExperimentsPackage.Literals.CELL__NAME,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "protected void addRec_idPropertyDescriptor(Object object) {\r\n\t\titemPropertyDescriptors.add\r\n\t\t\t(createItemPropertyDescriptor\r\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\r\n\t\t\t\t getResourceLocator(),\r\n\t\t\t\t getString(\"_UI_Icc_cdobj_rec_rec_id_feature\"),\r\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Icc_cdobj_rec_rec_id_feature\", \"_UI_Icc_cdobj_rec_type\"),\r\n\t\t\t\t IccPackage.Literals.ICC_CDOBJ_REC__REC_ID,\r\n\t\t\t\t true,\r\n\t\t\t\t false,\r\n\t\t\t\t false,\r\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\r\n\t\t\t\t null,\r\n\t\t\t\t null));\r\n\t}", "NamedLinkDescriptor createNamedLinkDescriptor();", "private <V> Definition<V> addPropertyDefinition(String name, Class<V> type,\n String caption, Method getter, Method setter) {\n if (getter == null)\n throw new IllegalArgumentException(\"null getter\");\n return this.addPropertyDefinition(name, type, caption,\n target -> Primitive.wrap(type).cast(ReflectUtil.invoke(getter, target)),\n setter != null ? (target, value) -> ReflectUtil.invoke(setter, target, value) : null);\n }", "public EditorPropertyDisplayer(Property p) {\n this(p, null);\n }", "protected void addProfileNamePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(createItemPropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),\n\t\t\t\tgetString(\"_UI_WebsphereServerTask_profileName_feature\"),\n\t\t\t\tgetString(\"_UI_PropertyDescriptor_description\", \"_UI_WebsphereServerTask_profileName_feature\",\n\t\t\t\t\t\t\"_UI_WebsphereServerTask_type\"),\n\t\t\t\tServerPackage.Literals.WEBSPHERE_SERVER_TASK__PROFILE_NAME, true, false, false,\n\t\t\t\tItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));\n\t}", "@Override\n\tpublic void createPropertyDescriptors(List<IPropertyDescriptor> desc) {\n\t\tvalidator = new ParameterNameValidator();\n\t\tvalidator.setTargetNode(this);\n\t\tJSSValidatedTextPropertyDescriptor nameD = new JSSValidatedTextPropertyDescriptor(JRDesignParameter.PROPERTY_NAME,\n\t\t\t\tMessages.common_name, validator);\n\t\tnameD.setDescription(Messages.MParameterSystem_name_description);\n\t\tdesc.add(nameD);\n\n\t\tNClassTypePropertyDescriptor classD = new NClassTypePropertyDescriptor(JRDesignParameter.PROPERTY_VALUE_CLASS_NAME,\n\t\t\t\tMessages.common_class, ClassTypeComboCellEditor.DEFAULT_ITEMS) {\n\t\t\t@Override\n\t\t\tpublic ASPropertyWidget<RWComboBoxPropertyDescriptor> createWidget(Composite parent, AbstractSection section) {\n\t\t\t\tSPClassTypeCombo<RWComboBoxPropertyDescriptor> classNameWidget = new SPClassTypeCombo<RWComboBoxPropertyDescriptor>(\n\t\t\t\t\t\tparent, section, this);\n\t\t\t\tclassNameWidget.setClassesOfType(classes);\n\t\t\t\tclassNameWidget.setReadOnly(readOnly);\n\t\t\t\treturn classNameWidget;\n\t\t\t}\n\t\t};\n\t\tclassD.setDescription(Messages.MParameterSystem_class_description);\n\t\tdesc.add(classD);\n\t\tclassD.setHelpRefBuilder(\n\t\t\t\tnew HelpReferenceBuilder(\"net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#parameter_class\"));\n\t}", "public Property createProperty() {\n if (newProject == null) {\n reinit();\n }\n Property p = new Property(true, getProject());\n p.setProject(newProject);\n p.setTaskName(\"property\");\n properties.addElement(p);\n return p;\n }", "protected void addIdentifyingDescriptionsPropertyDescriptor(Object object) {\r\n\t\titemPropertyDescriptors.add\r\n\t\t\t(createItemPropertyDescriptor\r\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\r\n\t\t\t\t getResourceLocator(),\r\n\t\t\t\t getString(\"_UI_ComputerSystem_identifyingDescriptions_feature\"),\r\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_ComputerSystem_identifyingDescriptions_feature\", \"_UI_ComputerSystem_type\"),\r\n\t\t\t\t CimPackage.eINSTANCE.getComputerSystem_IdentifyingDescriptions(),\r\n\t\t\t\t true,\r\n\t\t\t\t false,\r\n\t\t\t\t false,\r\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\r\n\t\t\t\t null,\r\n\t\t\t\t null));\r\n\t}", "Builder addProperty(String name, String value);", "public String getDescription(String id) throws IllegalArgumentException;", "ComponentBuilder named(String label);", "protected void addPy_cdPropertyDescriptor(Object object) {\r\n\t\titemPropertyDescriptors.add\r\n\t\t\t(createItemPropertyDescriptor\r\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\r\n\t\t\t\t getResourceLocator(),\r\n\t\t\t\t getString(\"_UI_Icc_cdobj_rec_py_cd_feature\"),\r\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Icc_cdobj_rec_py_cd_feature\", \"_UI_Icc_cdobj_rec_type\"),\r\n\t\t\t\t IccPackage.Literals.ICC_CDOBJ_REC__PY_CD,\r\n\t\t\t\t true,\r\n\t\t\t\t false,\r\n\t\t\t\t false,\r\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\r\n\t\t\t\t null,\r\n\t\t\t\t null));\r\n\t}", "PropertyType createPropertyType();", "void declare(String name, Supplier<T> propertySupplier);", "public void putProperty(Integer id, IExpObject value) throws ExpException {\n \n }", "public String prop(String name);", "public WizardPanelDescriptor getPanelDesc(Object id){\n return (WizardPanelDescriptor) wp.get(id);\n }", "public PaletteEntry(String label, String shortDescription,\n ImageDescriptor smallIcon, ImageDescriptor largeIcon, Object type,\n String id) {\n setLabel(label);\n setDescription(shortDescription);\n setSmallIcon(smallIcon);\n setLargeIcon(largeIcon);\n setType(type);\n setId(id);\n }", "public static Property createProperty(String key, String value) {\n Property prop = new Property();\n prop.setKey(key);\n prop.setValue(value);\n\n return prop;\n }", "@Override\n @Nonnull\n public String getDescriptionId() {\n return super.getOrCreateDescriptionId();\n }", "private PropertyPagePropertyDescriptor getPropertyDescriptor() {\n \t\treturn propertyDescriptor;\n \t}", "public SettableBeanProperty constructCreatorProperty(DeserializationContext ctxt, BeanDescription beanDesc, PropertyName name, int index, AnnotatedParameter param, Object injectableValueId) throws JsonMappingException {\n PropertyMetadata metadata;\n DeserializationConfig config = ctxt.getConfig();\n AnnotationIntrospector intr = ctxt.getAnnotationIntrospector();\n if (intr == null) {\n metadata = PropertyMetadata.STD_REQUIRED_OR_OPTIONAL;\n } else {\n metadata = PropertyMetadata.construct(intr.hasRequiredMarker(param), intr.findPropertyDescription(param), intr.findPropertyIndex(param), intr.findPropertyDefaultValue(param));\n }\n JavaType type = resolveMemberAndTypeAnnotations(ctxt, param, param.getType());\n Std property = new Std(name, type, intr.findWrapperName(param), beanDesc.getClassAnnotations(), param, metadata);\n TypeDeserializer typeDeser = (TypeDeserializer) type.getTypeHandler();\n if (typeDeser == null) {\n typeDeser = findTypeDeserializer(config, type);\n }\n SettableBeanProperty prop = new CreatorProperty(name, type, property.getWrapperName(), typeDeser, beanDesc.getClassAnnotations(), param, index, injectableValueId, metadata);\n JsonDeserializer<?> deser = findDeserializerFromAnnotation(ctxt, param);\n if (deser == null) {\n deser = (JsonDeserializer) type.getValueHandler();\n }\n if (deser != null) {\n return prop.withValueDeserializer(ctxt.handlePrimaryContextualization(deser, prop, type));\n }\n return prop;\n }", "public static PropertyMaker getPropertyMakerFor(int propId) {\n return propertyListTable[propId];\n }", "protected void addDescriptionPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Bean_description_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Bean_description_feature\", \"_UI_Bean_type\"),\n\t\t\t\t BeansPackage.Literals.BEAN__DESCRIPTION,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "public Professor(String name, int id)\r\n {\r\n this.name = name;\r\n this.id = id;\r\n }", "private static String createNameForProperty(String prop) {\r\n if (prop == null)\r\n return \"property\";\r\n String theProp = prop;\r\n\r\n // remove last \"AnimationProperties\"\r\n if (theProp.length() > 10\r\n && theProp.substring(theProp.length() - 10).equalsIgnoreCase(\r\n \"properties\"))\r\n theProp = theProp.substring(0, theProp.length() - 10);\r\n // first char is lowercase\r\n if (theProp.length() > 0)\r\n theProp = theProp.toLowerCase().charAt(0) + theProp.substring(1);\r\n return theProp;\r\n }", "protected void addVisitIDPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(new ItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Cell_visitID_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Cell_visitID_feature\", \"_UI_Cell_type\"),\n\t\t\t\t LDEExperimentsPackage.Literals.CELL__VISIT_ID,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null)\n\t\t\t\t{\n\t\t\t\t@Override\n\t\t\t\tpublic Collection<?> getChoiceOfValues(Object object) {\n\t\t\t\t\treturn getVisitIDs();\n\t\t\t\t}\n\t\t\t\t});\n\t}", "public void setNewProperty_description(java.lang.String param){\n localNewProperty_descriptionTracker = true;\n \n this.localNewProperty_description=param;\n \n\n }", "@NotNull\n public String getDisplayName() {\n // The ID is deliberately kept in a pretty user-readable format but we could\n // consider prepending layout/ on ids that don't have it (to make the display\n // more uniform) or ripping out all layout[-constraint] prefixes out and\n // instead prepending @ etc.\n return myId;\n }", "protected void addDescriptionPropertyDescriptor(Object object) {\r\n\t\titemPropertyDescriptors.add\r\n\t\t\t(createItemPropertyDescriptor\r\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\r\n\t\t\t\t getResourceLocator(),\r\n\t\t\t\t getString(\"_UI_Configuration_description_feature\"),\r\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Configuration_description_feature\", \"_UI_Configuration_type\"),\r\n\t\t\t\t SpringConfigDslPackage.Literals.CONFIGURATION__DESCRIPTION,\r\n\t\t\t\t true,\r\n\t\t\t\t false,\r\n\t\t\t\t false,\r\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\r\n\t\t\t\t null,\r\n\t\t\t\t null));\r\n\t}", "private PropertyDefinition getProperty(\n String property,\n String name,\n String description,\n String defaultValue,\n PropertyType type\n ) {\n return PropertyDefinition.builder(property)\n .name(name)\n .description(description)\n .defaultValue(defaultValue)\n .type(type)\n .category(Constants.CATEGORY)\n .subCategory(Constants.SUBCATEGORY)\n .index(propertyIndex++)\n .build();\n }", "public Product(String id, String name, String description) {\n this.id = id;\n this.name = name;\n this.description = description;\n }", "String getDomainObjectLabel(String id, DynamicAttribute dynamicAttribute);", "protected void addPlacaPropertyDescriptor(Object object) {\r\n\t\titemPropertyDescriptors.add\r\n\t\t\t(createItemPropertyDescriptor\r\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\r\n\t\t\t\t getResourceLocator(),\r\n\t\t\t\t getString(\"_UI_ContenedorDetalleVehiculoViewModel_placa_feature\"),\r\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_ContenedorDetalleVehiculoViewModel_placa_feature\", \"_UI_ContenedorDetalleVehiculoViewModel_type\"),\r\n\t\t\t\t ContenedorregistrovehiculoviewmodelPackage.Literals.CONTENEDOR_DETALLE_VEHICULO_VIEW_MODEL__PLACA,\r\n\t\t\t\t true,\r\n\t\t\t\t false,\r\n\t\t\t\t false,\r\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\r\n\t\t\t\t null,\r\n\t\t\t\t null));\r\n\t}", "public PropertySpecBuilder<T> description(String desc)\n {\n Preconditions.checkArgument(description == null, \"property description already set\");\n this.description = desc;\n\n return this;\n }", "public interface LayoutDescriptorBuilder {\n\n LayoutDescriptorBuilder setId(String id);\n\n LayoutDescriptorBuilder setKey(String key);\n\n LayoutDescriptorBuilder setName(Localized<String> name);\n\n LayoutDescriptorBuilder addPlaceholder(String id, String key);\n\n LayoutDescriptor build();\n}", "interface WithDescription {\n /**\n * Specifies the description property: The description of the lab..\n *\n * @param description The description of the lab.\n * @return the next definition stage.\n */\n WithCreate withDescription(String description);\n }", "private void showPropertyDescription(MouseEvent event) {\r\n\t\tPropertyDescriptionStage propertyDescriptionStage = new PropertyDescriptionStage(property);\r\n\t\tpropertyDescriptionStage.show();\r\n\t}", "public Property(String name) {\n super(SOME, NONE);\n this.name = name;\n }", "public NamedEntity(Long id, String name) {\n super(id);\n this.name = name;\n }", "public DisplayObject(String id) {\n\t\tthis.setId(id);\n\t\tpointTransform =new AffineTransform();\n\t\tinitBbox();\n\t}", "protected void addDescriptionPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_SecuritySchema_description_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_SecuritySchema_description_feature\", \"_UI_SecuritySchema_type\"),\n\t\t\t\t CorePackage.Literals.SECURITY_SCHEMA__DESCRIPTION,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "protected void addVarNamePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(createItemPropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),\n\t\t\t\tgetString(\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_varName_feature\"),\n\t\t\t\tgetString(\"_UI_PropertyDescriptor_description\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_varName_feature\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_type\"),\n\t\t\t\tAwsworkbenchPackage.Literals.APPLICATION_LOAD_BALANCER_BUILDER_ELASTICLOADBALANCINGV2__VAR_NAME, true,\n\t\t\t\tfalse, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));\n\t}", "protected void addPropNames()\n{\n addPropNames(\"Visible\", \"X\", \"Y\", \"Width\", \"Height\", \"Roll\", \"ScaleX\", \"ScaleY\",\n \"Font\", \"TextColor\", \"FillColor\", \"StrokeColor\", \"URL\");\n}", "public void setDisplayName(String name);", "protected void addElementFormNamePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Widget_elementFormName_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Widget_elementFormName_feature\", \"_UI_Widget_type\"),\n\t\t\t\t WavePackage.Literals.WIDGET__ELEMENT_FORM_NAME,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "public void setProperty(String prop, Object value)\r\n {\r\n\tswitch(prop)\r\n\t{\r\n\t case \"name\":\r\n\t\tname = value.toString();\r\n\t\tbreak;\r\n\t case \"description\":\r\n\t\tdesc = value.toString();\r\n\t\tbreak;\r\n\t case \"type\":\r\n\t\tsetType(value.toString());\r\n\t\tbreak;\r\n\t case \"level\":\r\n\t\tlevel = (Integer) value;\r\n\t\tbreak;\r\n\t case \"rarity\":\r\n\t\trare = Rarity.valueOf(value.toString().toUpperCase());\r\n\t\tbreak;\r\n\t case \"vendor_value\":\r\n\t\tvendorValue = (Integer) value;\r\n\t\tbreak;\r\n\t case \"game_types\":\r\n\t\taddGameType(value.toString());\r\n\t\tbreak;\r\n\t case \"flags\":\r\n\t\taddFlag(value.toString());\r\n\t\tbreak;\r\n\t case \"restrictions\":\r\n\t\taddRestriction(value.toString());\r\n\t\tbreak;\r\n\t case \"id\":\r\n\t\tid = (Integer) value;\r\n\t\tbreak;\r\n\t case \"icon\":\r\n\t\ttry {\r\n\t\t icon = new URL(value.toString());\r\n\t\t}\r\n\t\tcatch(MalformedURLException e) {\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t\tbreak;\r\n\t}\r\n }", "public MetricDescriptor(MetricID metricID) {\n this.name = metricID.getName();\n this.tags = extractTags(metricID.getTagsAsList());\n this.metricId = sanitizeMetricID(metricID, this);\n }", "public ImageDescriptor getImageDescriptor(String id) {\n \tif (imageDescriptors == null);\n \t\tthis.initializeImages();\n\t\treturn (ImageDescriptor) imageDescriptors.get(id);\n }", "private static boolean setProperty(String id, CyAttributes attrs,\n\t\t\tString propertyName, String propertyValue) {\n\t\tVisualPropertyType visPropType = getVisualPropertyType(propertyName);\n\t\tValueParser parser = visPropType.getValueParser();\n\t\tString value = parser.parseStringValue(propertyValue).toString();\n\t\tattrs.setAttribute(id, visPropType.getBypassAttrName(), value);\n\n\t\treturn true;\n\t}", "Object getProperty(Long id, String name) throws RemoteException;", "com.microsoft.schemas.xrm._2013.metadata.AttributeTypeDisplayName addNewAttributeTypeDisplayName();", "protected void addPodcastTitleParameterPropertyDescriptor(Object object) {\r\n\t\titemPropertyDescriptors.add\r\n\t\t\t(createItemPropertyDescriptor\r\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\r\n\t\t\t\t getResourceLocator(),\r\n\t\t\t\t getString(\"_UI_MPublishNewMp3Step_podcastTitleParameter_feature\"),\r\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_MPublishNewMp3Step_podcastTitleParameter_feature\", \"_UI_MPublishNewMp3Step_type\"),\r\n\t\t\t\t LogicPackage.Literals.MPUBLISH_NEW_MP3_STEP__PODCAST_TITLE_PARAMETER,\r\n\t\t\t\t false,\r\n\t\t\t\t false,\r\n\t\t\t\t false,\r\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\r\n\t\t\t\t null,\r\n\t\t\t\t null));\r\n\t}", "@DISPID(-2147417110)\n @PropGet\n java.lang.String id();", "public void setID(String id) {\n \t\tthis.name.setID(id);\n \t\t\n \t}", "public InstrumentDescriptionDTO(String name, String instrumentType, String brand, double rentalPrice, int id) {\n this.name = name;\n this.instrumentType = instrumentType;\n this.brand = brand;\n this.rentalPrice = rentalPrice;\n this.id = id;\n }", "public Plato(int id, String nombre, String descripcion){\n\t\tthis.id=id;\n\t\tthis.nombre=nombre;\n\t\tthis.descripcion=descripcion;\n\t}", "interface WithDescription {\n /**\n * Specifies the description property: The user description of the source control..\n *\n * @param description The user description of the source control.\n * @return the next definition stage.\n */\n WithCreate withDescription(String description);\n }", "private static PropertyDescriptor[] getPdescriptor(){\n PropertyDescriptor[] properties = new PropertyDescriptor[19];\n \n try {\n properties[PROPERTY_board] = new PropertyDescriptor ( \"board\", org.yccheok.jstock.gui.MutableStock.class, \"getBoard\", null ); // NOI18N\n properties[PROPERTY_buyPrice] = new PropertyDescriptor ( \"buyPrice\", org.yccheok.jstock.gui.MutableStock.class, \"getBuyPrice\", \"setBuyPrice\" ); // NOI18N\n properties[PROPERTY_buyQuantity] = new PropertyDescriptor ( \"buyQuantity\", org.yccheok.jstock.gui.MutableStock.class, \"getBuyQuantity\", \"setBuyQuantity\" ); // NOI18N\n properties[PROPERTY_changePrice] = new PropertyDescriptor ( \"changePrice\", org.yccheok.jstock.gui.MutableStock.class, \"getChangePrice\", \"setChangePrice\" ); // NOI18N\n properties[PROPERTY_changePricePercentage] = new PropertyDescriptor ( \"changePricePercentage\", org.yccheok.jstock.gui.MutableStock.class, \"getChangePricePercentage\", \"setChangePricePercentage\" ); // NOI18N\n properties[PROPERTY_code] = new PropertyDescriptor ( \"code\", org.yccheok.jstock.gui.MutableStock.class, \"getCode\", null ); // NOI18N\n properties[PROPERTY_highPrice] = new PropertyDescriptor ( \"highPrice\", org.yccheok.jstock.gui.MutableStock.class, \"getHighPrice\", \"setHighPrice\" ); // NOI18N\n properties[PROPERTY_industry] = new PropertyDescriptor ( \"industry\", org.yccheok.jstock.gui.MutableStock.class, \"getIndustry\", null ); // NOI18N\n properties[PROPERTY_lastPrice] = new PropertyDescriptor ( \"lastPrice\", org.yccheok.jstock.gui.MutableStock.class, \"getLastPrice\", \"setLastPrice\" ); // NOI18N\n properties[PROPERTY_lastVolume] = new PropertyDescriptor ( \"lastVolume\", org.yccheok.jstock.gui.MutableStock.class, \"getLastVolume\", \"setLastVolume\" ); // NOI18N\n properties[PROPERTY_lowPrice] = new PropertyDescriptor ( \"lowPrice\", org.yccheok.jstock.gui.MutableStock.class, \"getLowPrice\", \"setLowPrice\" ); // NOI18N\n properties[PROPERTY_name] = new PropertyDescriptor ( \"name\", org.yccheok.jstock.gui.MutableStock.class, \"getName\", null ); // NOI18N\n properties[PROPERTY_openPrice] = new PropertyDescriptor ( \"openPrice\", org.yccheok.jstock.gui.MutableStock.class, \"getOpenPrice\", \"setOpenPrice\" ); // NOI18N\n properties[PROPERTY_prevPrice] = new PropertyDescriptor ( \"prevPrice\", org.yccheok.jstock.gui.MutableStock.class, \"getPrevPrice\", \"setPrevPrice\" ); // NOI18N\n properties[PROPERTY_sellPrice] = new PropertyDescriptor ( \"sellPrice\", org.yccheok.jstock.gui.MutableStock.class, \"getSellPrice\", \"setSellPrice\" ); // NOI18N\n properties[PROPERTY_sellQuantity] = new PropertyDescriptor ( \"sellQuantity\", org.yccheok.jstock.gui.MutableStock.class, \"getSellQuantity\", \"setSellQuantity\" ); // NOI18N\n properties[PROPERTY_stock] = new PropertyDescriptor ( \"stock\", org.yccheok.jstock.gui.MutableStock.class, \"getStock\", null ); // NOI18N\n properties[PROPERTY_symbol] = new PropertyDescriptor ( \"symbol\", org.yccheok.jstock.gui.MutableStock.class, \"getSymbol\", null ); // NOI18N\n properties[PROPERTY_volume] = new PropertyDescriptor ( \"volume\", org.yccheok.jstock.gui.MutableStock.class, \"getVolume\", \"setVolume\" ); // NOI18N\n }\n catch(IntrospectionException e) {\n e.printStackTrace();\n }//GEN-HEADEREND:Properties\n // Here you can add code for customizing the properties array.\n\n return properties; }", "protected void addKeyPropertyDescriptor(Object object) {\n itemPropertyDescriptors.add\n (createItemPropertyDescriptor\n (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n getResourceLocator(),\n getString(\"_UI_ProceedingsType_key_feature\"),\n getString(\"_UI_PropertyDescriptor_description\", \"_UI_ProceedingsType_key_feature\", \"_UI_ProceedingsType_type\"),\n BibtexmlPackage.Literals.PROCEEDINGS_TYPE__KEY,\n true,\n false,\n false,\n ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n null,\n null));\n }", "@Override\n\tpublic void addProperty(String name) {\n\t}", "WithCreate withDescription(String description);", "WithCreate withDescription(String description);", "public interface IDescriptorViewer\r\n{\r\n\t/**\r\n\t * Get the description for this descriptor\r\n\t * @return\r\n\t */\r\n\tpublic String getDescription();\r\n\t\r\n\t@Override\r\n\tpublic String toString();\r\n}", "private void setPropertyID(String v)\n {\n this.setFieldValue(FLD_propertyID, StringTools.trim(v));\n }", "private void settingNewIdForBean(DataBeanBuilder bean, JavaClassWriter cf, String beanImpl) throws IOException {\n for (DataBeanPropertyBuilder property : bean.properties.values()) {\n String capitalizeName = getCapitalizeName(property.name);\n if (property.isId())\n cf.println(\"if(((\" + beanImpl + \") bean).get\" + capitalizeName + \"() != \" +\n \"((\" + beanImpl + \") beanGetting).get\" + capitalizeName + \"())\\n\" +\n \"((\" + beanImpl + \") bean).set\" + capitalizeName + \"(((\" + beanImpl + \") beanGetting).get\" + capitalizeName + \"());\");\n }\n }", "public void setDescriptor(Descriptor inDescriptor);", "@DISPID(-2147417110)\n @PropPut\n void id(\n java.lang.String rhs);", "public ImageDescriptor getImageDescriptor(String id) {\n\t ImageDescriptor imageDescriptor = (ImageDescriptor) imageDescriptors\n\t .get(id);\n\t if (imageDescriptor == null) {\n\t imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(\n\t getDefault().getBundle().getSymbolicName(), ICON_PATH + id);\n\t imageDescriptors.put(id, imageDescriptor);\n\t }\n\t return imageDescriptor;\n\t}", "private String getPropertyLabel() {\n return itemPropertyDescriptor.getDisplayName(eObject);\n }", "protected void addDescriptionPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Requirement_description_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Requirement_description_feature\", \"_UI_Requirement_type\"),\n\t\t\t\t Y3853992Package.Literals.REQUIREMENT__DESCRIPTION,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "protected void addGeneratedClassNamePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(createItemPropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),\n\t\t\t\tgetString(\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_generatedClassName_feature\"),\n\t\t\t\tgetString(\"_UI_PropertyDescriptor_description\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_generatedClassName_feature\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_type\"),\n\t\t\t\tAwsworkbenchPackage.Literals.APPLICATION_LOAD_BALANCER_BUILDER_ELASTICLOADBALANCINGV2__GENERATED_CLASS_NAME,\n\t\t\t\tfalse, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));\n\t}", "public interface UnitTypeProperties extends PropertyAccess<UnitTypeDTO> {\n @Editor.Path(\"id\")\n ModelKeyProvider<UnitTypeDTO> key();\n ValueProvider<UnitTypeDTO, String> id();\n ValueProvider<UnitTypeDTO, String> name();\n @Editor.Path(\"name\")\n LabelProvider<UnitTypeDTO> nameLabel();\n}", "public SimpleTabDescriptor(String category, String id, String label, \n ISectionDescriptor... sectionDescriptors) {\n this.category = category;\n this.id = id;\n this.label = label;\n List<ISectionDescriptor> sDesc = new ArrayList<ISectionDescriptor>();\n for (int s = 0; s < sectionDescriptors.length; s++) {\n sDesc.add(sectionDescriptors[s]);\n }\n setSectionDescriptors(sDesc);\n }", "public void setCurrentPanelDesc(Object id){ \n currentPanel = (WizardPanelDescriptor) wp.get(id);\n }", "protected void addUniquePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_EntityAttribute_unique_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_EntityAttribute_unique_feature\", \"_UI_EntityAttribute_type\"),\n\t\t\t\t PersistencePackage.Literals.ENTITY_ATTRIBUTE__UNIQUE,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,\n\t\t\t\t getString(\"_UI_ModelPropertyCategory\"),\n\t\t\t\t null));\n\t}" ]
[ "0.6464241", "0.60921824", "0.58358777", "0.5669488", "0.5616335", "0.5611811", "0.5605618", "0.55789965", "0.55033803", "0.5484122", "0.5483197", "0.5471708", "0.542557", "0.5421038", "0.5396688", "0.53733927", "0.5370932", "0.53506166", "0.5340828", "0.53199637", "0.53113997", "0.5291335", "0.5247306", "0.5218285", "0.5205393", "0.5189343", "0.5186856", "0.5170327", "0.5149254", "0.51183766", "0.5100813", "0.5098434", "0.5085469", "0.5075853", "0.5075085", "0.5069913", "0.5068614", "0.5064311", "0.5050819", "0.5043612", "0.50374466", "0.5029976", "0.5028286", "0.50178427", "0.501194", "0.50035256", "0.49809462", "0.4932479", "0.49322024", "0.4913575", "0.49090216", "0.48914713", "0.4888811", "0.48806694", "0.4879493", "0.48782802", "0.4861241", "0.48611397", "0.48599976", "0.48587593", "0.48564187", "0.48531377", "0.48525617", "0.4851011", "0.48451358", "0.4843456", "0.48427713", "0.48397636", "0.48080134", "0.48040003", "0.48023647", "0.48016098", "0.47855234", "0.47677824", "0.47669688", "0.47516122", "0.47481158", "0.47457707", "0.47366", "0.47309768", "0.47300166", "0.47296873", "0.4728926", "0.4723495", "0.47229162", "0.47184372", "0.47184372", "0.47176194", "0.47156796", "0.47118422", "0.4706868", "0.47032246", "0.4692776", "0.4691977", "0.46892795", "0.46882161", "0.46831533", "0.4682242", "0.46811667", "0.4674678" ]
0.5020674
43
Creates new form search_package
public search_package() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form getSearchForm() throws PublicationTemplateException;", "private DynamicForm createSearchBox() {\r\n\t\tfinal DynamicForm filterForm = new DynamicForm();\r\n\t\tfilterForm.setNumCols(4);\r\n\t\tfilterForm.setAlign(Alignment.LEFT);\r\n\t\tfilterForm.setAutoFocus(false);\r\n\t\tfilterForm.setWidth(\"59%\"); //make it line up with sort box\r\n\t\t\r\n\t\tfilterForm.setDataSource(SmartGWTRPCDataSource.getInstance());\r\n\t\tfilterForm.setOperator(OperatorId.OR);\r\n\t\t\r\n\t\t//Visible search box\r\n\t\tTextItem nameItem = new TextItem(\"name\", \"Search\");\r\n\t\tnameItem.setAlign(Alignment.LEFT);\r\n\t\tnameItem.setOperator(OperatorId.ICONTAINS); // case insensitive\r\n\t\t\r\n\t\t//The rest are hidden and populated with the contents of nameItem\r\n\t\tfinal HiddenItem companyItem = new HiddenItem(\"company\");\r\n\t\tcompanyItem.setOperator(OperatorId.ICONTAINS);\r\n\t\tfinal HiddenItem ownerItem = new HiddenItem(\"ownerNickName\");\r\n\t\townerItem.setOperator(OperatorId.ICONTAINS);\r\n\r\n\t\tfilterForm.setFields(nameItem,companyItem,ownerItem);\r\n\t\t\r\n\t\tfilterForm.addItemChangedHandler(new ItemChangedHandler() {\r\n\t\t\tpublic void onItemChanged(ItemChangedEvent event) {\r\n\t\t\t\tString searchTerm = filterForm.getValueAsString(\"name\");\r\n\t\t\t\tcompanyItem.setValue(searchTerm);\r\n\t\t\t\townerItem.setValue(searchTerm);\r\n\t\t\t\tif (searchTerm==null) {\r\n\t\t\t\t\titemsTileGrid.fetchData();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tCriteria criteria = filterForm.getValuesAsCriteria();\r\n\t\t\t\t\titemsTileGrid.fetchData(criteria);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn filterForm;\r\n\t}", "public void create_new_package(View V) {\n make_request();\r\n progressDialog.show();\r\n }", "public abstract Search create(String search, SearchBuilder builder);", "public SearchByName() {\n initComponents();\n }", "private void addSearchInventory() { \t\r\n \tsearchButton = new JButton (\"Search\");\r\n \tsearchText = new JTextField (5);\r\n \t\r\n \tidRadio = new JRadioButton (\"id\");\r\n \tnameRadio = new JRadioButton (\"name\");\r\n \tButtonGroup group = new ButtonGroup();\r\n group.add(idRadio);\r\n group.add(nameRadio);\r\n \r\n listModel = new DefaultListModel<String>();\r\n inventoryField = new JList<String> (listModel);\r\n inventoryField.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r\n \r\n scrollPane = new JScrollPane(inventoryField);\r\n scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\r\n \r\n \r\n \tadd (searchButton);\r\n \tadd (searchText);\r\n add (idRadio);\r\n add (nameRadio);\r\n add (scrollPane);\r\n \r\n \tsearchButton.setBounds (275, 200, 100, 25);\r\n\t\tsearchText.setBounds (95, 200, 160, 25);\r\n\t idRadio.setBounds (100, 160, 50, 25);\r\n\t nameRadio.setBounds (150, 160, 100, 25);\r\n\t scrollPane.setBounds (90, 245, 415, 415);\r\n }", "private void makeSearchButton() {\n searchButton = new JButton();\n searchButton.setBorder(new CompoundBorder(\n BorderFactory.createMatteBorder(4, 0, 4, 7, DrawAttribute.lightblue),\n BorderFactory.createRaisedBevelBorder()));\n searchButton.setBackground(new Color(36, 45, 50));\n searchButton.setIcon(new ImageIcon(MapIcon.iconURLs.get(\"searchIcon\")));\n searchButton.setFocusable(false);\n searchButton.setBounds(320, 20, 43, 37);\n searchButton.setActionCommand(\"search\");\n }", "@RequestMapping(value = \"/add\",method = RequestMethod.GET)\n \tpublic String addPackageForm (@RequestParam(value=\"id\", required=true) Integer programId, Model model) {\n \t\tlogger.info (\"Generated new package form.\");\n\n \t\tmodel.addAttribute (\"pack\", new Package());\n \t\tmodel.addAttribute(\"programId\", programId);\n \t\t\n \t\treturn \"packageAddNew\";\n \t}", "TSearchResults createSearchResults(TSearchQuery searchQuery);", "public void treatmentSearch(){\r\n searchcb.getItems().addAll(\"treatmentID\",\"treatmentName\",\"medicineID\", \"departmentID\", \"diseaseID\");\r\n searchcb.setValue(\"treatmentID\");;\r\n }", "@Override\r\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\t\r\n\t\t\t\tvenEditarPacks.init(\"NEW\",null);\r\n\t\t\t\tUI.getCurrent().addWindow(venEditarPacks);\r\n\t\t\t\t\r\n\t\t\t}", "private void addSearchFieldAndButton() {\n\t\tsearchButton = new EAdSimpleButton(EAdSimpleButton.SimpleButton.SEARCH);\n\t\tsearchButton.setEnabled(false);\n searchField = new JTextField(20);\n searchField.setEnabled(false);\n\t\tsearchField.setToolTipText(\"Search...\");\n\t\ttoolPanel.add(searchField);\n\t\ttoolPanel.add(searchButton);\n\n ActionListener queryListener = new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tString query = searchField.getText();\n controller.getViewController().addView(\"query\", \"q\"+query, false);\n\t\t\t}\n\t\t};\n\n searchField.addActionListener(queryListener);\n\t\tsearchButton.addActionListener(queryListener);\n }", "public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }", "void searchView(String name);", "private void setUpSearchButton()\n {\n searchButton.setCaption(\"Go\");\n searchButton.addClickListener(new Button.ClickListener() {\n public void buttonClick(Button.ClickEvent event)\n {\n //Grab the data from the database base on the search text\n //Assume all search is author name for now\n String searchValue = searchText.getValue();\n \n //Remove all values in the table\n bookTable.removeAllItems();\n \n //Grab Data from database\n List<Book> books = collectDataFromDatabase(searchValue);\n \n //Put the data into the table\n allBooksBean.addAll(books);\n //putDataIntoTable(books);\n }\n });\n }", "private Search() {}", "public insearch() {\n initComponents();\n }", "@Override\n\tprotected BaseSearchForm devuelveFormBusqueda() throws Exception {\n\t\tMantenimientoCRAMatrizDiasSearchForm form = new MantenimientoCRAMatrizDiasSearchForm();\n\t\treturn form;\n\t}", "public search() {\n }", "FORM createFORM();", "@UiHandler(\"catalogue_search_send_button\")\r\n\t/*\r\n\t * Call to the OpenSearch service to get the list of the available\r\n\t * parameters\r\n\t */\r\n\tvoid onCatalogue_search_send_buttonClick(ClickEvent event) {\r\n\t\tString url = catalogue_search_panel_os_textbox.getValue();\r\n\t\tUrlValidator urlValidator = new UrlValidator();\r\n\t\tif (!urlValidator.isValidUrl(url, false)) {\r\n\t\t\tWindow.alert(\"ERROR : Opensearch URL not valid!\");\r\n\t\t} else {\r\n\t\t\topensearchService.getDescriptionFile(url, new AsyncCallback<Map<String, String>>() {\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onFailure(Throwable caught) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\tSystem.out.println(\"fail!\");\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void onSuccess(final Map<String, String> result) {\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Form building according to the available parameters\r\n\t\t\t\t\t * (result)\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatalogue_search_param_panel.setVisible(true);\r\n\r\n\t\t\t\t\tcatalogue_search_panel_see_description_button.setVisible(true);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Click on this button to see the description file\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcatalogue_search_panel_see_description_button.addClickHandler(new ClickHandler() {\r\n\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void onClick(ClickEvent event) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\tWindow.open(result.get(\"description\"), \"description\", result.get(\"description\"));\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * If the map doesn't contain the parameter then the field\r\n\t\t\t\t\t * is disabled. Otherwise, the parameter's key is register\r\n\t\t\t\t\t * to build the request url later\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (!result.containsKey(\"eo:platform\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_platform.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_platform.setName(result.get(\"eo:platform\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:orbitType\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitType.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitType.setName(result.get(\"eo:orbitType\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:instrument\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensor.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensor.setName(result.get(\"eo:instrument\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:sensorType\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensortype.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensortype.setName(result.get(\"eo:sensorType\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:sensorMode\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensorMode.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_sensorMode.setName(result.get(\"eo:sensorMode\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:resolution\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_resolutionMax.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_resolutionMin.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_resolutionMax.setName(result.get(\"eo:resolution\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_resolutionMin.setName(result.get(\"eo:resolution\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:swathId\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_swathId.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_swathId.setName(result.get(\"eo:swathId\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:wavelength\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_waveLenght1.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_waveLenght2.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_waveLenght1.setName(result.get(\"eo:wavelength\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_waveLenght2.setName(result.get(\"eo:wavelength\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:spectralRange\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_spectralRange.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_spectralRange.setName(result.get(\"eo:spectralRange\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:orbitNumber\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitMax.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitMin.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitMax.setName(result.get(\"eo:orbitNumber\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitMin.setName(result.get(\"eo:orbitNumber\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:orbitDirection\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitDirection.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_orbitDirection.setName(result.get(\"eo:orbitDirection\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:track\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_trackAccross.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_trackAlong.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_trackAccross.setName(result.get(\"eo:track\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_trackAlong.setName(result.get(\"eo:track\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:frame\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_frame1.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_frame2.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_frame1.setName(result.get(\"eo:frame\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_frame2.setName(result.get(\"eo:frame\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:identifier\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_identifier.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_identifier.setName(result.get(\"eo:identifier\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:type\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_entryType.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_entryType.setName(result.get(\"eo:type\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:acquisitionType\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_acquisitionType.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_acquisitionType.setName(result.get(\"eo:acquisitionType\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:status\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_status.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_status.setName(result.get(\"eo:status\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:archivingCenter\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_archivingCenter.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_archivingCenter.setName(result.get(\"eo:archivingCenter\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:acquisitionStation\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_acquisitionStation.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_acquisitionStation.setName(result.get(\"eo:acquisitionStation\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:processingCenter\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingCenter.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingCenter.setName(result.get(\"eo:processingCenter\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:processingSoftware\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingSoftware.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingSoftware.setName(result.get(\"eo:processingSoftware\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:processingDate\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingDate1.setEnabled(false);\r\n\t\t\t\t\t\tcatalogue_search_panel_processingDate2.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingDate1.setName(result.get(\"eo:processingDate\"));\r\n\t\t\t\t\t\tcatalogue_search_panel_processingDate2.setName(result.get(\"eo:processingDate\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:processingLevel\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingLevel.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_processingLevel.setName(result.get(\"eo:processingLevel\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:compositeType\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_compositeType.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_compositeType.setName(result.get(\"eo:compositeType\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:contents\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_contents.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_contents.setName(result.get(\"eo:contents\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:cloudCover\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_cloud.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_cloud.setName(result.get(\"eo:cloudCover\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!result.containsKey(\"eo:snowCover\")) {\r\n\t\t\t\t\t\tcatalogue_search_panel_snow.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcatalogue_search_panel_snow.setName(result.get(\"eo:snowCover\"));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tSystem.out.println(\"success!\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}\r\n\r\n\t}", "public SearchResultPanel()\n\t{\n\t\tcreateComponents();\n\t\tdesignComponents();\n\t\taddComponents();\n\t}", "public update_and_search_vendor() {\n initComponents();\n }", "private JButton createSearchButton() {\n\t\tfinal JButton searchButton = new JButton(\"Search\");\n\n\t\tsearchButton.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(final ActionEvent e) {\n\t\t\t\ttry{\n\t\t\t\t\tupdateTable(nameSearchBar.getText(), locationSearchBar.getText());\n\t\t\t\t}catch(final BookingServiceException bse){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, bse.getMessage());\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}catch(final ServiceUnavailableException sue){\n\t\t\t\t\tJOptionPane.showMessageDialog(null, sue.getMessage());\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn searchButton;\n\t}", "public MagicSearch createMagicSearch();", "public GUISearch() {\n initComponents();\n }", "@Override\r\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\r\n\t\t\t\t\t\tvenObjectsByPack.init(\"NEW\");\r\n\t\t\t\t\t\tUI.getCurrent().addWindow(venObjectsByPack);\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t}", "private void groupSearchActivity() {\n startActivity(new Intent(CreateGroup.this, AutoCompleteGroupSearch.class));\n }", "public static void searchBtnPressed() throws IOException {\r\n // define a search model to search PCs\r\n PC search_model = new PC();\r\n if (nameFilter != null && !nameFilter.isEmpty())\r\n search_model.setName(nameFilter);\r\n if (descriptionFilter != null && !descriptionFilter.isEmpty())\r\n search_model.setDescription(descriptionFilter);\r\n if (instalationDateFilter != null)\r\n search_model.setInstallDate(instalationDateFilter);\r\n switch (statusFilter) {\r\n case 1:\r\n search_model.setStatus(Status.ENABLE);\r\n break;\r\n case 2:\r\n search_model.setStatus(Status.DISABLE);\r\n break;\r\n case 3:\r\n search_model.setStatus(Status.SUSPENDED);\r\n break;\r\n }\r\n if (selectedComponentsFilter != null)\r\n for (int i = 0 ; i < selectedComponentsFilter.length ; i ++)\r\n if (selectedComponentsFilter[i]) {\r\n Calendar cal = Calendar.getInstance();\r\n cal.add(Calendar.DAY_OF_MONTH, 1);\r\n search_model.setInstalledComps(new PCComp(enaComp.get(i).getID(), cal.getTime()));\r\n }\r\n \r\n // define search model options\r\n String search_options = installationDateModeFilter + \",\" + warrentyModeFilter;\r\n if (selectedSpecsFilter != null)\r\n for (int i = 0 ; i < selectedSpecsFilter.length ; i ++)\r\n if (selectedSpecsFilter[i])\r\n search_options = search_options + \",\" + enaSpec.get(i).toString();\r\n PCNMClientModel.sendMessageToServer(new Message(MessageType.PC_SEARCH, search_model, search_options));\r\n }", "public SearchPage() {\n\t\tdoRender();\n\t}", "public SearchResultPanel(String name)\n\t{\n\t\tthis.setName(name);\n\t\tcreateComponents();\n\t\tdesignComponents();\n\t\taddComponents();\n\t}", "@FXML\n\tpublic void buttonCreateProductType(ActionEvent event) {\n\t\tString empty = \"\";\n\t\tString name = txtProductTypeName.getText();\n\t\tif (!name.equals(empty)) {\n\t\t\tProductType obj = new ProductType(txtProductTypeName.getText());\n\t\t\ttry {\n\t\t\t\tboolean found = restaurant.addProductType(obj, empleadoUsername); // Se añade a la lista de tipos de\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// producto DEL RESTAURANTE\n\t\t\t\tif (found == false) {\n\t\t\t\t\ttypeOptions.add(name);// Se añade a la lista de tipos de producto para ser mostrada en los combobox\n\t\t\t\t}\n\t\t\t\ttxtProductTypeName.setText(\"\");\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} else {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setContentText(\"El tipo de producto a crear debe tener un nombre \");\n\t\t\tdialog.setTitle(\"Error, Campo sin datos\");\n\t\t\tdialog.show();\n\n\t\t}\n\t}", "void searchUI();", "@Override\n public void onClick(View v) {\n\n new SimpleSearchDialogCompat(RegisterActivity.this, \"Select your new postcode\",\n \"What are you looking for?\", null, createSampleData(),\n new SearchResultListener<SearchModelForPostcode>() {\n @Override\n public void onSelected(BaseSearchDialogCompat dialog,\n SearchModelForPostcode item, int position) {\n\n //SharedPreferences.Editor editor = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE).edit();\n //editor.putString(\"postcode\", item.getTitle());\n\n\n Toast.makeText(RegisterActivity.this, \"postcode selected:\"+item.getTitle(),\n Toast.LENGTH_SHORT).show();\n pc.setText(item.getTitle());\n dialog.dismiss();\n }\n }).show();\n\n }", "public abstract void addSelectorForm();", "public void clickCreate() {\n\t\tbtnCreate.click();\n\t}", "public SearchPage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t\n\t}", "public SearchEntry() {\n initComponents();\n }", "private void searchExec(){\r\n\t\tString key=jComboBox1.getSelectedItem().toString();\r\n\t\tkey=NameConverter.convertViewName2PhysicName(\"Discount\", key);\r\n\t\tString valueLike=searchTxtArea.getText();\r\n\t\tList<DiscountBean>searchResult=discountService.searchDiscountByKey(key, valueLike);\r\n\t\tjTable1.setModel(ViewUtil.transferBeanList2DefaultTableModel(searchResult,\"Discount\"));\r\n\t}", "public ProductCreate() {\n initComponents();\n }", "@FXML\n\tvoid search(ActionEvent event) {\n\n\t\ttry {\n\n\t\t\tif(idEditText.getText().equals(\"\")) {\n\n\t\t\t\tthrow new InsufficientInformationException();\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tPlanetarySystem ps = ns.search(Integer.parseInt(idEditText.getText()));\n\n\t\t\t\tif(ps != null) {\n\t\t\t\t\t\n\t\t\t\t\tloadInformation(ps);\t\t\t\t\t\n\t\t\t\t\teditSelectionAlerts();\n\t\t\t\t\tupdateValidationsAvailability(true);\n\t\t\t\t\tupdateButtonsAvailability(true, true, true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsystemNotFoundAlert();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\tcatch(InsufficientInformationException e) {\n\t\t\tinsufficientDataAlert();\n\t\t}\n\t\tcatch(Exception ex) {\n\t\t\tsystemNotFoundAlert();\n\t\t}\n\n\t}", "@Execute\n public HtmlResponse index(final SearchForm form) {\n return search(form);\n }", "@RequestMapping(\"/new\")\n\tpublic String displayProjectForm(Model model) {\n\t\tProject aproject = new Project();\n\t//Iterable<Employee> employees = \tpro.getall();\n\t\n\t\tmodel.addAttribute(\"project\", aproject);\n\n\t\t//model.addAttribute(\"allEmployees\", employees);\n\t\t\n\t\t\n\t\treturn \"newproject\";\n\t\t\n\t}", "private void fillSearchFields() {\n view.setMinPrice(1);\n view.setMaxPrice(10000);\n view.setMinSQM(1);\n view.setMaxSQM(10000);\n view.setBedrooms(1);\n view.setBathrooms(1);\n view.setFloor(1);\n view.setHeating(false);\n view.setLocation(\"Athens\");\n }", "public void setNewSearch(String query){\n isNewSearch = true;\n this.query = query;\n }", "private SearchServiceFactory() {}", "@Override\n public void onClick(View v) {\n NewBucketDialogFragment newBucketDialogFragment = NewBucketDialogFragment.newInstance();\n newBucketDialogFragment.setTargetFragment(BucketListFragment.this, REQ_CODE_NEW_BUCKET);\n newBucketDialogFragment.show(getFragmentManager(), NewBucketDialogFragment.TAG);\n }", "private void findPopMenuItemActionPerformed(java.awt.event.ActionEvent evt) {\n if (sdd == null) {\n sdd = new SearchDialog(this);\n }\n sdd.setVisible(true);\n }", "public Inventory inventorySearch (TheGroceryStore g, String searchKey);", "SearchResultsType createSearchResultsType();", "@RequestMapping(method = RequestMethod.POST)\n\tpublic String processSearch(@ModelAttribute(\"search\") Search search) {\n\t\tSystem.out.println(\"SearchController.processSearch()\");\n\t\t\n\t\t// Retrieve search keyword\n\t\tString searchFor = search.getKeyword();\n\t\t\n\t\t// search & set results\n\t\tsearch.setResults(cat.findByKeyword(searchFor));\n\t\t\n\t\t// return to search results view\n\t\treturn \"searchResults\";\n\t}", "public static Result newProduct() {\n Form<models.Product> productForm = form(models.Product.class).bindFromRequest();\n if(productForm.hasErrors()) {\n return badRequest(\"Tag name cannot be 'tag'.\");\n }\n models.Product product = productForm.get();\n product.save();\n return ok(product.toString());\n }", "public FrmSearchBox(JInternalFrame internalFrame) {\r\n initComponents();\r\n this.setModal(true);\r\n this.setInternalFrame(internalFrame);\r\n productDAO = new ProductDAO();\r\n }", "public SearchActionGroup(IWorkbenchSite site) {\r\n\t\t\r\n\t\tfSearch = new SearchRepositoryAction(site);\r\n\t\t\r\n\t\tISelectionProvider provider = site.getSelectionProvider();\r\n\t\tISelection selection = provider.getSelection();\r\n\t\t\r\n\t\tfSearch.update(selection);\r\n\t\tprovider.addSelectionChangedListener(fSearch);\r\n\t}", "public void buttonNew(View view) {\n Intent intent = new Intent(this, ProductNewActivity.class);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Log.e(\"Add Button Clicked\",\"*************************************************\");\n Log.e(\"search Adapter\",\"\"+tempProduct.getmItemName()+\" \"+1+\" \"+ tempProduct.getType()+\" \"+ tempProduct.getmCost());\n adapter.addItem(new MenuItemClass(tempProduct.getmItemName(),1, tempProduct.getType(), tempProduct.getmCost(), tempProduct.getmId(), tempProduct.getmUnit(), tempProduct.getmGstPercent()));\n searchView.setQuery(\"\", false);\n listView.setVisibility(View.GONE);\n }", "void searchProbed (Search search);", "private void visitToSearch() {\n if (search_Attendance==null) {\n search_Attendance=new Search_Attendance();\n search_Attendance.setVisible(true);\n } else {\n search_Attendance.setVisible(true);\n }\n }", "private void SearchAndReplaceActionPerformed(java.awt.event.ActionEvent evt) {\n \n if (srf==null)\n srf = new SearchAndReplaceFrame();\n \n if (srf!=null)\n {\n String jar_path = \"\";\n String class_path = filePath;\n if (filePath.contains(PathSeparator))\n {\n String[] splited = filePath.split(PathSeparator);\n jar_path = splited[0];\n if (splited.length>1)\n class_path = splited[1];\n }\n srf.SetJarPath(jar_path);\n srf.SetClassPath(class_path);\n srf.setVisible(true);\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n panelAddSearch = new javax.swing.JPanel();\n labelNameSearch = new javax.swing.JLabel();\n nameSearch = new javax.swing.JTextField();\n buttonAddSearch = new javax.swing.JButton();\n tabbedPaneSearch = new javax.swing.JTabbedPane();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"FlexibleFileFinder\");\n setName(\"FlexibleFileFinder\"); // NOI18N\n\n panelAddSearch.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));\n\n labelNameSearch.setFont(new java.awt.Font(\"Monospaced\", 0, 12)); // NOI18N\n labelNameSearch.setText(\"Name Search:\");\n\n nameSearch.setFont(new java.awt.Font(\"Monospaced\", 0, 12)); // NOI18N\n\n buttonAddSearch.setFont(new java.awt.Font(\"Monospaced\", 0, 12)); // NOI18N\n buttonAddSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/org/bz/filefinder/usedPictures/AddSearch.png\"))); // NOI18N\n buttonAddSearch.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n buttonAddSearchActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout panelAddSearchLayout = new javax.swing.GroupLayout(panelAddSearch);\n panelAddSearch.setLayout(panelAddSearchLayout);\n panelAddSearchLayout.setHorizontalGroup(\n panelAddSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(panelAddSearchLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(labelNameSearch)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(nameSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(buttonAddSearch)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n panelAddSearchLayout.setVerticalGroup(\n panelAddSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(panelAddSearchLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)\n .addComponent(labelNameSearch)\n .addComponent(nameSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(buttonAddSearch))\n );\n\n tabbedPaneSearch.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(tabbedPaneSearch)\n .addGroup(layout.createSequentialGroup()\n .addComponent(panelAddSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 772, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(panelAddSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(tabbedPaneSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 563, Short.MAX_VALUE))\n );\n\n pack();\n }", "private void createSearchViewModel() {\n SearchChampionViewModelFactory searchChampionViewModelFactory =\n new SearchChampionViewModelFactory(Injection.provideChampionsRepository(this));\n\n // Create ViewModel\n searchChampionViewModel = ViewModelProviders\n .of(this, searchChampionViewModelFactory)\n .get(SearchChampionViewModel.class);\n }", "public void search() {\r\n \t\r\n }", "@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tdropdown.clear();\r\n\t\t\tRootPanel.get(\"details\").clear();\r\n\t\t\tSpielplanErstellenForm erstellen = new SpielplanErstellenForm();\r\n\r\n\t\t\tRootPanel.get(\"details\").add(erstellen);\r\n\t\t}", "@RequestMapping(value = \"/newrecipe\", method = RequestMethod.GET)\n\tpublic String newRecipeForm(Model model) {\n\t\tmodel.addAttribute(\"recipe\", new Recipe()); //empty recipe object\n\t\tmodel.addAttribute(\"categories\", CatRepo.findAll());\n\t\treturn \"newrecipe\";\n\t}", "private void createRowForNewRegexButton(Composite compo)\n {\n buttonNewRegex = toolkit.createButton(section, \"New Regex...\", SWT.PUSH); //$NON-NLS-1$\n buttonGridData(buttonNewRegex, SWT.TOP);\n buttonNewRegex.addSelectionListener(new SelectionListener()\n {\n public void widgetDefaultSelected(SelectionEvent e)\n {\n }\n\n public void widgetSelected(SelectionEvent e)\n {\n PopupRegexDialog dialog = new PopupRegexDialog(getShell());\n if (dialog.open() == Dialog.OK)\n {\n // if the first field is not set\n if (valueToRecognizeReq == null)\n {\n valueToRecognizeReq = new Regex(dialog.getRegexInput());\n reqIdComponent.setValueText(valueToRecognizeReq.getText());\n }\n else\n {\n tree.add(new Regex(dialog.getRegexInput()));\n listFormat.refresh();\n }\n controller.removeDocumentType();\n updateWizard();\n }\n }\n });\n }", "public String actionCreateNew() {\r\n \t\tsetBook(new Book());\r\n \t\treturn \"new\";\r\n \t}", "private void hahaha() {\t\t\n\t\tfinal Button searchButton = new Button(\"Search\");\n\t\tfinal TextBox nameField = new TextBox();\n\t\tnameField.setText(\"GWT User\");\n\t\tfinal Label errorLabel = new Label();\n\t\t\n\t\t// We can add style names to widgets\n\t\tsearchButton.addStyleName(\"sendButton\");\n\n\t\t// Add the nameField and sendButton to the RootPanel\n\t\t// Use RootPanel.get() to get the entire body element\n\t\tRootPanel.get(\"nameFieldContainer\").add(nameField);\n\t\tRootPanel.get(\"sendButtonContainer\").add(searchButton);\n\t\tRootPanel.get(\"errorLabelContainer\").add(errorLabel);\n\n\t\t// Focus the cursor on the name field when the app loads\n\t\tnameField.setFocus(true);\n\t\tnameField.selectAll();\n\n\t\t// Create the popup dialog box\n\n\t\t// Create a handler for the sendButton and nameField\n\t\tclass MyHandler implements ClickHandler, KeyUpHandler {\n\t\t\t/**\n\t\t\t * Fired when the user clicks on the sendButton.\n\t\t\t */\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tsendNameToServer();\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Fired when the user types in the nameField.\n\t\t\t */\n\t\t\tpublic void onKeyUp(KeyUpEvent event) {\n\t\t\t\tif (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {\n\t\t\t\t\tsendNameToServer();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Send the name from the nameField to the server and wait for a\n\t\t\t * response.\n\t\t\t */\n\t\t\tprivate void sendNameToServer() {\n\t\t\t\t// First, we validate the input.\n\t\t\t\terrorLabel.setText(\"\");\n\t\t\t\tString textToServer = nameField.getText();\n\t\t\t\tif (!FieldVerifier.isValidName(textToServer)) {\n\t\t\t\t\terrorLabel.setText(\"Please enter at least four characters\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Then, we send the input to the server.\n\t\t\t\t// sendButton.setEnabled(false);\n\t\t\t\tSearchRequest request = new SearchRequest();\n\t\t\t\tDate twoMinsAgo = new Date(new Date().getTime() - 1000*60*2);\n\t\t\t\trequest.setFetchTime(Interval.after(twoMinsAgo));\n\t\t\t\tgreetingService.greetServer(request,\n\t\t\t\t\t\tnew AsyncCallback<Collection<Place>>() {\n\t\t\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\t\t\tnotification.handleFailure(caught);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpublic void onSuccess(Collection<Place> result) {\n\t\t\t\t\t\t\t\t// TODO: sign of utter stupidity\n\t\t\t\t\t\t\t\tfinal MapWidget map = (MapWidget) RootPanel\n\t\t\t\t\t\t\t\t\t\t.get(\"mapsTutorial\").getWidget(0);\n\t\t\t\t\t\t\t\tmap.clearOverlays();\n\n\t\t\t\t\t\t\t\tLatLng markerPos = null;\n\t\t\t\t\t\t\t\tfor (final Place place : result) {\n\t\t\t\t\t\t\t\t\tLocation coordinates = place.getCoordinates();\n\t\t\t\t\t\t\t\t\tmarkerPos = LatLng.newInstance(\n\t\t\t\t\t\t\t\t\t\t\tcoordinates.getLatitude(), coordinates.getLongitude());\n\n\t\t\t\t\t\t\t\t\t// Add a marker\n\t\t\t\t\t\t\t\t\tMarkerOptions options = MarkerOptions\n\t\t\t\t\t\t\t\t\t\t\t.newInstance();\n\t\t\t\t\t\t\t\t\toptions.setTitle(place.getAddress());\n\t\t\t\t\t\t\t\t\tMarker marker = new Marker(markerPos,\n\t\t\t\t\t\t\t\t\t\t\toptions);\n\t\t\t\t\t\t\t\t\tfinal LatLng currMarkerPos = markerPos;\n\t\t\t\t\t\t\t\t\tmarker.addMarkerClickHandler(new MarkerClickHandler() {\n\n\t\t\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\t\t\tMarkerClickEvent event) {\n\t\t\t\t\t\t\t\t\t\t\tPlaceFormatter places = new PlaceFormatter();\n\t\t\t\t\t\t\t\t\t\t\tInfoWindowContent wnd = new InfoWindowContent(places.format(place));\n\t\t\t\t\t\t\t\t\t\t\twnd.setMaxWidth(200);\n\t\t\t\t\t\t\t\t\t\t\tmap.getInfoWindow().open(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcurrMarkerPos,\n\t\t\t\t\t\t\t\t\t\t\t\t\twnd);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\tmap.addOverlay(marker);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (markerPos != null) {\n\t\t\t\t\t\t\t\t\tmap.setCenter(markerPos);\n\t\t\t\t\t\t\t\t\tmap.setZoomLevel(12);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Add a handler to send the name to the server\n\t\tMyHandler handler = new MyHandler();\n\t\tsearchButton.addClickHandler(handler);\n\t\tnameField.addKeyUpHandler(handler);\n\t\t\n\t\tfinal Button startFetching = new Button(\"Fetch\");\n\t\tRootPanel.get(\"startFetchingContainer\").add(startFetching);\n\t\tstartFetching.addClickHandler(new ClickHandler() {\n\t\t\tpublic void onClick(ClickEvent event) {\n\t\t\t\tadminService.checkDataSources(new AsyncCallback<AdminResponse>() {\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tnotification.handleFailure(caught);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpublic void onSuccess(AdminResponse result) {\n\t\t\t\t\t\tnotification.show(\"Coolio\", \"Everything is cool\", \"\");\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "public Project_Create() {\n initComponents();\n }", "public SOASearchPage() {\r\n\t\tsuper();\r\n\t}", "@FXML\n\tprivate void searchButtonAction(ActionEvent clickEvent) {\n\t\t\n\t\tString searchParameter = partsSearchTextField.getText().trim();\n\t\tScanner scanner = new Scanner(searchParameter);\n\t\t\n\t\tif (scanner.hasNextInt()) {\n\t\t\t\n\t\t\tPart part = Inventory.lookupPart(Integer.parseInt(searchParameter));\n\t\t\t\n\t\t\tif (part != null) {\n\t\t\t\t\n\t\t\t\tpartSearchProductTable.setItems(\n\t\t\t\t\tInventory.lookupPart(part.getName().trim().toLowerCase()));\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\tpartSearchProductTable.setItems(\n\t\t\t\t\tInventory.lookupPart(searchParameter.trim().toLowerCase()));\n\t\t}\n\t}", "private void newProject()\n\t{\n\t\tnew FenetreCreationProjet();\n\t}", "public void searchProduct(ActionEvent actionEvent) throws IOException {\r\n //Creates the search product scene and displays it.\r\n FXMLLoader loader = new FXMLLoader();\r\n loader.setLocation(getClass().getResource(\"SearchProduct.fxml\"));\r\n Parent searchProductParent = loader.load();\r\n Scene searchProductScene = new Scene(searchProductParent);\r\n\r\n //Passes in the controller.\r\n SearchProductController searchProductController = loader.getController();\r\n searchProductController.initData(controller);\r\n\r\n Stage window = (Stage) ((Node) actionEvent.getSource()).getScene().getWindow();\r\n window.hide();\r\n window.setScene(searchProductScene);\r\n window.show();\r\n }", "private void startSearch()\n {\n model.clear();\n ArrayList<String> result;\n if (orRadio.isSelected())\n {\n SearchEngine.search(highTerms.getText(), lowTerms.getText());\n result = SearchEngine.getShortForm();\n }\n else\n {\n SearchEngine.searchAnd(highTerms.getText(), lowTerms.getText());\n result = SearchEngine.getShortForm();\n }\n for (String s : result)\n {\n model.addElement(s);\n }\n int paragraphsRetrieved = result.size();\n reviewedField.setText(\" Retrieved \" + paragraphsRetrieved + \" paragraphs\");\n }", "public CrearProductos() {\n initComponents();\n }", "public CreateTremaDbDialogForm(AnActionEvent event) {\n this.event = event;\n this.windowTitle = \"New Trema XML database file\";\n init();\n }", "@RequestMapping(\"/save\")\n\tpublic String createProjectForm(Project project, Model model) {\n\t\t\n\tproRep.save(project);\n\tList<Project> getall = (List<Project>) proRep.getAll();\n\tmodel.addAttribute(\"projects\", getall);\n\t\n\treturn \"listproject\";\n\t\t\n\t}", "public static Result startNewForm() {\r\n\t\tString formName = ChangeOrderForm.NAME;\r\n\t\tDecision firstDecision = CMSGuidedFormFill.startNewForm(formName,\r\n\t\t\t\tCMSSession.getEmployeeName(), CMSSession.getEmployeeId());\r\n\t\treturn ok(backdrop.render(firstDecision));\r\n\t}", "public search_user() {\n initComponents();\n }", "public void searchField(String name) {\r\n\t\tsafeType(addVehiclesHeader.replace(\"Add Vehicle\", \"Search\"), name);\r\n\t\t;\r\n\t}", "Search getSearch();", "public void search() {\n }", "@RequestMapping(value = \"/add\",method = RequestMethod.POST)\n \tpublic String addPackage (@RequestParam(value=\"id\", required=true) Integer programId, \n \t\t\t@Valid@ModelAttribute(value=\"pack\") Package pack, BindingResult result, Model model) {\n \t\t(new PackageValidator ()).validate (pack, result);\n \t\tif (result.hasErrors ()) {\n \t\t\tString err = \"\";\n \t\t\tfor(ObjectError error : result.getAllErrors ())\n \t\t\t\terr += \"Error: \" + error.getCode () + \" - \" + error.getDefaultMessage () + \"\\n\";\n \t\t\tlogger.error (err);\n \t\t\t\n \t\t\tmodel.addAttribute (\"pack\", pack);\n \t \t\tmodel.addAttribute(\"programId\", programId);\n \t \t\t\n \t \t\treturn \"packageAddNew\";\n \t\t} else {\n \t\t\tlogger.info (\"Package \"+pack+\" successfully added!\");\n \t\t\t\n \t\t\ttry {\n \t\t\t\tApplicationContext context = new ClassPathXmlApplicationContext (\"beans.xml\");\n \t\t\t\tPackageDao packageDao = (PackageDao) context.getBean (\"packageDao\");\n \t\t\t\t\n \t\t\t\tpackageDao.create(pack);\n \t\t\t\t\n \t\t\t\t\n \t\t\t} catch (Exception e) {\n \t\t\t\tlogger.error (\"FAIL: \" + e);\n \t\t\t}\n \t\t\t\n \t\t\treturn \"redirect:\" + pack.getProgramId();\n \t\t}\n \t}", "public com.vodafone.global.er.decoupling.binding.request.CatalogFullPackagesRequest createCatalogFullPackagesRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CatalogFullPackagesRequestImpl();\n }", "public void onSearchButtonClick(View view){\r\n\t\t\r\n\t\tfor (ListingItem item : ListingContent.ITEMS) {\r\n\t\t\tif (item.content.toUpperCase(Locale.getDefault()).contains(searchField.getText().toString().toUpperCase(Locale.getDefault()))) {\r\n\t\t\t\tresults.add(item);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tsetListAdapter(new ArrayAdapter<ListingContent.ListingItem>(this,\r\n\t\t\t\tandroid.R.layout.simple_list_item_1,\r\n\t\t\t\tandroid.R.id.text1, results));\r\n\t}", "public com.vodafone.global.er.decoupling.binding.request.CatalogFullPackageRequest createCatalogFullPackageRequest()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CatalogFullPackageRequestImpl();\n }", "public static AssessmentSearchForm openFillSearchForm(Assessment assm) {\n openCreationSearchForm(Roles.STAFF, WingsTopMenu.WingsStaffMenuItem.P_ASSESSMENTS, Popup.Search);\n\n Logger.getInstance().info(\"Fill out some search criteria fields with any data\");\n AssessmentSearchForm searchPage = new AssessmentSearchForm();\n searchPage.fillSearchForm(assm);\n\n return new AssessmentSearchForm();\n }", "public NewConsultasS() {\n initComponents();\n limpiar();\n bloquear();\n }", "private void enterSearchMode(String resultContent) {\n\n\t\tthis.removeAll();\n\n\t\tJLabel welcomeLabel = new JLabel(\"Search the word you want to modify.\");\n\t\twelcomeLabel.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 17));\n\t\tGridBagConstraints welcomeC = new GridBagConstraints();\n\t\twelcomeC.anchor = GridBagConstraints.CENTER;\n\t\twelcomeC.gridwidth = 2;\n\t\twelcomeC.weighty = 5;\n\t\twelcomeC.gridy = 0;\n\t\tthis.add(welcomeLabel, welcomeC);\n\n\t\tAction submit = new AbstractAction() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tsubmitSearch(searchBox.getText());\n\t\t\t}\n\t\t};\n\n\t\tsearchBox = new JTextField();\n\t\tsearchBox.addActionListener(submit);\n\t\tGridBagConstraints sboxC = new GridBagConstraints();\n\t\tsboxC.fill = GridBagConstraints.HORIZONTAL;\n\t\tsboxC.weightx = 4;\n\t\tsboxC.weighty = 1;\n\t\tsboxC.gridx = 0;\n\t\tsboxC.gridy = 1;\n\t\tsboxC.insets = new Insets(0, 20, 0, 10);\n\t\tthis.add(searchBox, sboxC);\n\n\t\tJButton submitButton = new JButton(\"Search\");\n\t\tsubmitButton.addActionListener(submit);\n\t\tGridBagConstraints submitC = new GridBagConstraints();\n\t\tsubmitC.weightx = 0;\n\t\tsubmitC.gridx = 1;\n\t\tsubmitC.gridy = 1;\n\t\tsubmitC.anchor = GridBagConstraints.EAST;\n\t\tsubmitC.insets = new Insets(0, 0, 0, 30);\n\t\tthis.add(submitButton, submitC);\n\n\t\tresult = new JLabel(resultContent);\n\t\tresult.setFont(new Font(\"\", Font.ITALIC, 14));\n\t\tGridBagConstraints resultC = new GridBagConstraints();\n\t\tresultC.fill = GridBagConstraints.BOTH;\n\t\tresultC.weighty = 5;\n\t\tresultC.gridy = 8;\n\t\tresultC.gridwidth = 3;\n\t\tresultC.anchor = GridBagConstraints.WEST;\n\t\tresultC.insets = new Insets(0, 40, 0, 0);\n\t\tthis.add(result, resultC);\n\n\t\tthis.repaint();\n\n\t}", "public void buttonClick(Button.ClickEvent event)\n {\n String searchValue = searchText.getValue();\n \n //Remove all values in the table\n bookTable.removeAllItems();\n \n //Grab Data from database\n List<Book> books = collectDataFromDatabase(searchValue);\n \n //Put the data into the table\n allBooksBean.addAll(books);\n //putDataIntoTable(books);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton3 = new javax.swing.JButton();\n jButton4 = new javax.swing.JButton();\n photo = new javax.swing.JLabel();\n initials = new javax.swing.JLabel();\n address = new javax.swing.JLabel();\n tp = new javax.swing.JLabel();\n bday = new javax.swing.JLabel();\n gender = new javax.swing.JLabel();\n sem = new javax.swing.JLabel();\n jLabel16 = new javax.swing.JLabel();\n jLabel17 = new javax.swing.JLabel();\n jLabel18 = new javax.swing.JLabel();\n jLabel19 = new javax.swing.JLabel();\n jLabel20 = new javax.swing.JLabel();\n jLabel21 = new javax.swing.JLabel();\n jLabel22 = new javax.swing.JLabel();\n jLabel23 = new javax.swing.JLabel();\n jLabel24 = new javax.swing.JLabel();\n first = new javax.swing.JLabel();\n index = new javax.swing.JLabel();\n jButton2 = new javax.swing.JButton();\n jLabel2 = new javax.swing.JLabel();\n date = new javax.swing.JLabel();\n\n jButton3.setText(\"jButton3\");\n\n jButton4.setText(\"jButton4\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Search\");\n\n initials.setText(\"niw\");\n\n address.setText(\"hm\");\n\n tp.setText(\"tp\");\n\n bday.setText(\"bda\");\n\n gender.setText(\"gen\");\n\n sem.setText(\"sem\");\n\n jLabel16.setText(\"Photograph\");\n\n jLabel17.setText(\"Name With Initials\");\n\n jLabel18.setText(\"First Name\");\n\n jLabel19.setText(\"Index Number\");\n\n jLabel20.setText(\"Home Address\");\n\n jLabel21.setText(\"Telephone No\");\n\n jLabel22.setText(\"Date Of Birth\");\n\n jLabel23.setText(\"Gender\");\n\n jLabel24.setText(\"Semester\");\n\n first.setText(\"fn\");\n\n index.setText(\"in\");\n\n jButton2.setText(\"Close\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jLabel2.setText(\"Registered Date\");\n\n date.setText(\"jLabel3\");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel21)\n .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel18)\n .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel20)\n .addComponent(jLabel22)\n .addComponent(jLabel23)\n .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2)\n .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(10, 10, 10)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bday, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(initials, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(first, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(photo, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(address, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(index, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE))\n .addComponent(tp, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(date, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(sem, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(gender, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE))))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(21, 21, 21)\n .addComponent(photo, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(jLabel16)))\n .addGap(14, 14, 14)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel17)\n .addComponent(initials, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel18)\n .addComponent(first, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel19)\n .addComponent(index, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel20)\n .addComponent(address, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel21)\n .addComponent(tp, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel22)\n .addComponent(bday, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel23)\n .addComponent(gender, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel24)\n .addComponent(sem, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(date))\n .addGap(18, 18, 18)\n .addComponent(jButton2)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public CadastroProdutoNew() {\n initComponents();\n }", "public DisputeSearchPanel() {\n initComponents();\n }", "private void promptNewIndexFile()\n {\n JPanel message = new JPanel(new GridLayout(2, 1));\n JLabel messageLabel = new JLabel(\"Enter name for new index database\");\n JPanel defaultWrapper = new JPanel();\n JLabel defaultLabel = new JLabel(\"Make this the default index? \");\n JCheckBox makeDefault = new JCheckBox(); \n \n defaultWrapper.add(defaultLabel);\n defaultWrapper.add(makeDefault);\n message.add(defaultWrapper);\n message.add(messageLabel);\n \n String fileName = JOptionPane.showInputDialog(null, message, \"Create new index file\", JOptionPane.OK_CANCEL_OPTION);\n if(fileName != null && !fileName.equalsIgnoreCase(\"\"))\n {\n spider.setIndexer(Indexer.createIndexer(\"data/\" + fileName + \".db\"));\n searchEngine.setIndexer(spider.getIndexer());\n \n if(makeDefault.isSelected())\n {\n spider.getConfig().setDatabaseFile(\"data/\" + fileName + \".db\");\n spider.updateConfig();\n }\n }\n }", "@PreAuthorize(\"hasRole('SEARCH_PRODUCT')\")\n\t@RequestMapping(\"/searchProductByNameForCopy\")\n\tpublic ModelAndView searchProductByNameForCopy(Map<String, Object> model,\n\t\t\t@ModelAttribute(\"productForm\") Product productForm, BindingResult bindingresult, HttpServletRequest request)\n\t\t\tthrows ServiceException, ProductException {\n\n\t\tlogger.debug(CCLPConstants.ENTER);\n\t\tModelAndView mav = new ModelAndView();\n\t\tString productName = \"\";\n\t\tString searchType = \"\";\n\n\t\tList<ProductDTO> productDtoList = null;\n\t\tmav.setViewName(\"productConfig\");\n\t\tsearchType = request.getParameter(\"searchType\");\n\t\tmav.addObject(\"SearchType\", searchType);\n\n\t\tlogger.debug(\"Before calling productService.getAllProducts()\");\n\n\t\tif (bindingresult.hasErrors()) {\n\t\t\treturn mav;\n\t\t}\n\n\t\tproductName = productForm.getProductName();\n\t\tproductDtoList = productService.getProductsByNameForCopy(productName);\n\n\t\tlogger.debug(\"after calling productService.getProductsByName()\");\n\n\t\tmav.addObject(\"productForm\", new Product());\n\t\tmav.setViewName(\"productConfig\");\n\t\tmav.addObject(\"productTableList\", productDtoList);\n\t\tmav.addObject(\"productForm\", productForm);\n\t\tmav.addObject(\"showGrid\", \"true\");\n\t\tlogger.debug(CCLPConstants.EXIT);\n\t\treturn mav;\n\t}", "private SearchBar() {\n controller = FilterController.getInstance();\n initComponents();\n createNewQueryPanel();\n }", "@Token(save = true, validate = false)\n @Execute\n public HtmlResponse createpage(final SuggestBadWordEditForm form) {\n form.initialize();\n form.crudMode = CrudMode.CREATE;\n return asHtml(path_AdminSuggestbadword_EditJsp);\n }", "public Controller(FrameSearch frameSearch) {\n this.frameSearch = frameSearch;\n this.criteria = new Criteria();\n search = new Search();\n getCriteriaSaved();\n frameSearch.getTpDataBase().getBtLoad().addMouseListener(new MouseAdapter() {\n public void mouseClicked(MouseEvent evt) {\n buttonEventClicked(evt);\n }\n });\n }", "private void search() {\n if (dateFind.getValue() == null) {\n dateFind.setValue(LocalDate.now().minusDays(DEFAULT_PERIOD));\n }\n Long days = ChronoUnit.DAYS.between(dateFind.getValue(), LocalDate.now());\n final List<Project> findProject = ServiceFactory.getProjectService().getFindProject(days, comboProject.getValue());\n observableProjects.clear();\n observableProjects.addAll(findProject);\n table.setItems(observableProjects);\n }", "@PreAuthorize(\"hasRole('SEARCH_PRODUCT')\")\n\t@RequestMapping(\"/searchProductByName\")\n\tpublic ModelAndView searchProductByName(Map<String, Object> model,\n\t\t\t@Validated(Product.ValidationStepOne.class) @ModelAttribute(\"productForm\") Product productForm,\n\t\t\tBindingResult bindingresult, HttpServletRequest request) throws ServiceException, ProductException {\n\n\t\tlogger.debug(CCLPConstants.ENTER);\n\t\tModelAndView mav = new ModelAndView();\n\t\tString productName = \"\";\n\t\tString searchType = \"\";\n\n\t\tList<ProductDTO> productDtoList = null;\n\t\tmav.setViewName(\"productConfig\");\n\t\tsearchType = request.getParameter(\"searchType\");\n\t\tmav.addObject(\"SearchType\", searchType);\n\n\t\tlogger.debug(\"Before calling productService.getAllIssuers()\");\n\n\t\tif (bindingresult.hasErrors()) {\n\t\t\treturn mav;\n\t\t}\n\n\t\tproductName = productForm.getProductName();\n\t\tproductDtoList = productService.getProductsByName(productName);\n\n\t\tlogger.debug(\"after calling productService.getProductsByName()\");\n\n\t\tmav.addObject(\"productForm\", new Product());\n\t\tmav.setViewName(\"productConfig\");\n\t\tmav.addObject(\"productTableList\", productDtoList);\n\t\tmav.addObject(\"productForm\", productForm);\n\t\tmav.addObject(\"showGrid\", \"true\");\n\t\tlogger.debug(CCLPConstants.EXIT);\n\t\treturn mav;\n\t}", "private void actionNewProject ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDataController.scenarioNewProject();\r\n\r\n\t\t\thelperDisplayProjectFiles();\r\n\r\n\t\t\t//---- Change button icon\r\n\t\t\tImageIcon iconButton = FormUtils.getIconResource(FormStyle.RESOURCE_PATH_ICO_VIEW_SAMPLES);\r\n\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setIcon(iconButton);\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setActionCommand(FormMainHandlerCommands.AC_VIEW_SAMPLES_ON);\r\n\t\t\tmainFormLink.getComponentToolbar().getComponentButtonViewSamples().setToolTipText(\"View detected samples\");\r\n\r\n\t\t\tmainFormLink.reset();\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}" ]
[ "0.6002915", "0.5979369", "0.59331447", "0.5594465", "0.5512492", "0.5500552", "0.54461116", "0.5396839", "0.53941375", "0.53785735", "0.5376238", "0.53728825", "0.53652716", "0.531743", "0.5310169", "0.5286538", "0.52777636", "0.5267216", "0.5253768", "0.5237197", "0.5202801", "0.52022916", "0.51725626", "0.516289", "0.51399136", "0.5115777", "0.5110621", "0.5108668", "0.51065284", "0.50909173", "0.50861317", "0.5081923", "0.505935", "0.5038049", "0.5035239", "0.5030092", "0.50219977", "0.5020243", "0.50019133", "0.4991058", "0.49854094", "0.4976756", "0.4968056", "0.4962256", "0.49556196", "0.49542364", "0.4952184", "0.494798", "0.49446073", "0.49406072", "0.49405488", "0.49403015", "0.4938153", "0.4922014", "0.4911363", "0.49086893", "0.49052843", "0.49051675", "0.49046144", "0.4902229", "0.49007702", "0.48811945", "0.48799494", "0.48752505", "0.48691893", "0.48672748", "0.48630688", "0.48591685", "0.48573875", "0.4856937", "0.48552898", "0.4850278", "0.48489556", "0.48460042", "0.4844893", "0.48391142", "0.48258105", "0.48218533", "0.48117182", "0.48115957", "0.48090008", "0.48056585", "0.4802832", "0.47982252", "0.47919905", "0.4787522", "0.47840196", "0.4782526", "0.4781903", "0.47799844", "0.47725245", "0.4771015", "0.4757584", "0.4746064", "0.47456184", "0.4740114", "0.47392708", "0.47384018", "0.473275", "0.4722184" ]
0.6755813
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); jScrollPane1 = new javax.swing.JScrollPane(); jList1 = new javax.swing.JList(); jSeparator2 = new javax.swing.JSeparator(); jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jTextField3 = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); jTextField4 = new javax.swing.JTextField(); ClearCmdButton = new javax.swing.JButton(); ExitCmdButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowActivated(java.awt.event.WindowEvent evt) { formWindowActivated(evt); } }); jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 1, 30)); jLabel1.setForeground(new java.awt.Color(51, 0, 255)); jLabel1.setText("SEARCH PACKAGE INFO"); jLabel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); jSeparator1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jList1.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 0, 0), 3, true), "ID-DURATION", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 14), new java.awt.Color(255, 51, 0))); // NOI18N jList1.setModel(new DefaultListModel()); jList1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jList1MouseClicked(evt); } }); jScrollPane1.setViewportView(jList1); jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL); jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 18)); jLabel2.setForeground(new java.awt.Color(0, 102, 102)); jLabel2.setText("PACKAGE ID"); jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 18)); jLabel3.setForeground(new java.awt.Color(0, 102, 102)); jLabel3.setText("DURATION"); jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 18)); jLabel4.setForeground(new java.awt.Color(0, 102, 102)); jLabel4.setText("PRICE"); jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 18)); jLabel5.setForeground(new java.awt.Color(0, 102, 102)); jLabel5.setText("GYM FACIILTY"); ClearCmdButton.setFont(new java.awt.Font("Times New Roman", 1, 18)); ClearCmdButton.setForeground(new java.awt.Color(0, 102, 102)); ClearCmdButton.setText("CLEAR"); ClearCmdButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ClearCmdButtonActionPerformed(evt); } }); ExitCmdButton.setFont(new java.awt.Font("Times New Roman", 1, 18)); ExitCmdButton.setForeground(new java.awt.Color(0, 102, 102)); ExitCmdButton.setText("EXIT"); ExitCmdButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ExitCmdButtonActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(214, 214, 214) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel5) .addComponent(jLabel2) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(40, 40, 40) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addComponent(jTextField3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE))) .addGroup(layout.createSequentialGroup() .addGap(81, 81, 81) .addComponent(ClearCmdButton, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(143, 143, 143) .addComponent(ExitCmdButton, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE))) .addContainerGap(39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(91, 91, 91) .addComponent(jLabel1) .addContainerGap(93, Short.MAX_VALUE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(26, 26, 26) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addGap(69, 69, 69) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField1) .addComponent(jLabel2)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addGap(30, 30, 30) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addGap(26, 26, 26) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5)) .addGap(65, 65, 65) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ClearCmdButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ExitCmdButton, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(41, 41, 41)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(67, 67, 67) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)) .addGap(110, 110, 110))) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public quotaGUI() {\n initComponents();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.7318948", "0.7290426", "0.7290426", "0.7290426", "0.7284922", "0.7247965", "0.7213206", "0.72080696", "0.7195916", "0.7189941", "0.71835536", "0.71579427", "0.7147217", "0.70927703", "0.7080282", "0.7055882", "0.6987108", "0.69770193", "0.6954159", "0.69529283", "0.6944756", "0.6941631", "0.69351804", "0.6931676", "0.69271684", "0.6924507", "0.6924333", "0.6910886", "0.6910063", "0.6893039", "0.6892514", "0.68902403", "0.68896806", "0.68873954", "0.688239", "0.68815583", "0.68807346", "0.6877274", "0.68747336", "0.6873939", "0.6871645", "0.6858798", "0.68562996", "0.68551964", "0.6854526", "0.6853759", "0.6852625", "0.6852071", "0.6852071", "0.6842801", "0.6836393", "0.6835916", "0.6827825", "0.68275064", "0.6826875", "0.6823854", "0.68217176", "0.6816455", "0.68164307", "0.68095225", "0.68079925", "0.6807973", "0.6807133", "0.6806263", "0.6802961", "0.67933935", "0.6793082", "0.6791554", "0.6789944", "0.6788754", "0.6787684", "0.67871934", "0.6783336", "0.67656237", "0.6765452", "0.6764802", "0.67560065", "0.67553526", "0.67517436", "0.6751359", "0.67414886", "0.67386204", "0.67362994", "0.67358786", "0.6732659", "0.6726978", "0.67262286", "0.6719745", "0.6715412", "0.67137116", "0.6713403", "0.670771", "0.67069227", "0.670236", "0.6701016", "0.6700013", "0.66983503", "0.66981363", "0.6694568", "0.66907334", "0.66893756" ]
0.0
-1
The Game constructor is used to create a new game instance to track game progress.
public Game() { this.players = new Player[Config.PlayerLimit]; this.resetGame(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Game() {}", "public Game() {\n\n\t}", "public Game() {\n }", "public Game() {\n\n GameBoard gameBoard = new GameBoard();\n Renderer renderer = new Renderer(gameBoard);\n }", "public Game(){\n\n }", "public Game()\n {\n // initialise instance variables\n playerName = \"\";\n gameTotal = 0;\n }", "public GdGame()\n\t{\n\t\tthis(100);\t\t\n\t}", "public Game() {\n gameRounds = 0;\n players.add(mHuman);\n players.add(mComputer);\n }", "public Game() { \n super(1000, 640, 1);\n updateScore(0);\n }", "public Game() \n {\n Logger.setLogger(null);\n createInstances();\n parser = new Parser();\n player = new Player();\n userInputs = new ArrayList<String>();\n }", "public Game() {\n generatePort();\n status = Status.ATTENTE;\n generateGameID();\n name = \"GameG4B\";\n players = new ArrayList<>();\n maxRealPlayer = 0;\n maxVirtualPlayer = 0;\n realPlayerNb = 0;\n virtualPlayerNb = 0;\n rounds = new ArrayList<>();\n currentRound = 0;\n }", "public Game() {\n parser = new Parser();\n }", "public Game()\r\n { \r\n // Create a new world with 800x600 cells with a cell size of 1x1 pixels.\r\n super(800, 600, 1);\r\n \r\n // add grill obj on left\r\n grill = new Grill();\r\n addObject(grill, 200, 400);\r\n \r\n // add table on right\r\n prepTable = new PrepTable();\r\n addObject(prepTable, 600, 400);\r\n \r\n // add all the table buttons\r\n addTableButtons();\r\n \r\n // add timer text\r\n timerText = new Text(\"2:00\");\r\n addObject(timerText, 60, 30);\r\n \r\n // setup the timer\r\n frameRate = 60;\r\n timeLeft = frameRate * 2;\r\n \r\n // setup the points\r\n score = 0;\r\n scoreText = new Text(\"$0\");\r\n addObject(scoreText, 50, 80);\r\n \r\n // setup orders\r\n orders = new ArrayList<Order>();\r\n orderTimer = frameRate * 4; // start with a 4 sec delay before the first order\r\n \r\n // the game is still updating\r\n stillRunning = true;\r\n \r\n // fix layering order\r\n setPaintOrder(Text.class, Topping.class, Button.class, Patty.class, Order.class);\r\n \r\n // set order variance\r\n orderVariance = 2 * frameRate;\r\n \r\n // init seconds counter\r\n totalSecondsElapsed = 0;\r\n }", "public Game() {\r\n\r\n\t\tmakeFrame();\r\n\t\tisClicked = false;\r\n\t\tisPlaying = false;\r\n\t\tlevelEasy = true;\r\n\t\tlevelIntermediate = false;\r\n\t\tlevelHard = false;\r\n\t\tplayerScore = 0;\r\n\r\n\t}", "public Game() {\n\t\tsetChanged();\n\t\t// This will NOT call any Observer's update methods, since you can't add\n\t\t// an Observer until you have initialized the game. Call\n\t\t// Game.notifyObservers() from wherever you instantiate it\n\t}", "private Game() {}", "public Game()\n {\n createRooms();\n parser= new Parser();\n }", "public Game() {\r\n\t\tcards = new ArrayList<Card>();\r\n\t\tfor (int i = 0; i < NBCARDS; i++) {\r\n\t\t\tcards.add(new Card());\r\n\t\t}\r\n\t\tplayers = new ArrayList<Player>();\r\n\t\tfor (int i = 0; i < NBPLAYER; i++) {\r\n\t\t\tplayers.add(new Player(i + 1));\r\n\t\t}\r\n\t}", "public Game() {\n playerBlack = new Player(Player.BLACK);\n playerBlack.setIsTurn(true);\n playerWhite = new Player(Player.WHITE);\n playerWhite.setIsTurn(false);\n boardObject = new Board();\n\n // Set invalid parameters to start. This is used in move verification.\n potentialSuccessiveSlot = new Slot(Board.MAX_ROW, Board.MAX_COLUMN, 2);\n slotFrom = boardObject.getSlot(-1, -1);\n slotTo = boardObject.getSlot(-1, -1);\n\n // First click is always true in the starting game state.\n firstClick = true;\n\n successiveMove = false;\n turnColor = Slot.BLACK;\n\n rootValues = new ArrayList<>();\n plyCutoff = 0;\n minimaxMove = null;\n firstClickCompMove = true;\n alphaBetaEnable = false;\n }", "public Game() \n {\n gameLoaded = false;\n }", "public Game() {\n this.date = LocalDateTime.now();\n }", "public Game() \n {\n parser = new Parser();\n name = new String();\n player = new Player();\n ai = new AI();\n createRooms();\n rand = -1;\n enemyPresent = false;\n wantToQuit = false;\n alive = true;\n createItems();\n createWeapons();\n createEnemy();\n setEnemy();\n setItems();\n setWeapons();\n setExits();\n }", "public Game(Game game) {\n this.players = game.players.stream()\n .map(Player::new)\n .collect(Collectors.toCollection(LinkedList::new));\n this.playerStack = new ActionStack(game.playerStack, this);\n this.gameStack = new ActionStack(game.gameStack, this);\n// this.phase =\n }", "public Game() {\n\t\tusers = new ArrayList<>();\n\t\ttmpTeam = new UserTeam();\n\t\tcore = new Core();\n\t\tmarket = new Market(core);\n\t}", "public Game() {\n\t\tbPlayer = new Player(false);\n\t\twPlayer = new Player(true);\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Game()\r\n\t{\r\n\t\tenemy = new ArrayList<Enemy>();\r\n\t\tbullets = new ArrayList<Bullet>();\r\n\t\tplatforms = new ArrayList<Platforms>();\r\n\t\tsetAlive(false);\r\n\t\tlevel = 1;\r\n\t\tscore = 0;\r\n\t}", "public Game() {\n board = new TileState[BOARD_SIZE][BOARD_SIZE];\n for(int i=0; i<BOARD_SIZE; i++)\n for(int j=0; j<BOARD_SIZE; j++)\n board[i][j] = TileState.BLANK;\n movesPlayed = 0;\n playerOneTurn = true;\n gameOver = false;\n }", "public PlayableGame() {\r\n\r\n }", "public Game() {\n initializeBoard();\n }", "public Game() {\n\t\tsuper();\n\t\tgameModel = new GameModel();\n\t\tview = new GamePane(gameModel);\n\t\t\n\t\tadd(view);\n\t\tpack();\n\t\tsetLocationRelativeTo(null);\n\t}", "public void initGame() {\n this.game = new Game();\n }", "public Game() \n {\n createRooms();\n parser = new Parser();\n }", "public Game() \n {\n createRooms();\n parser = new Parser();\n }", "public Game(){\n player = new Player(createRooms());\n parser = new Parser(); \n }", "public Game(){\n\t\tDimension dimension = new Dimension(Game.WIDTH, Game.HEIGHT); //Create dimensions for window size\n\t\tsetPreferredSize(dimension); //Set the start size\n\t\tsetMinimumSize(dimension); //Set the min size\n\t\tsetMaximumSize(dimension); //Set the max size, this locks the window size.\n\t\taddKeyListener(this); //Add the key listener to the game object\n\t\tlevel1(); //Load level 1\n\t\twinScreen = new WinScreen(); //Create win object\n\t\tdeadScreen = new DeadScreen(); //Create dead object\n\t\tstartScreen = new StartScreen(); //Create startScreen object\n\t\tpauseScreen = new PauseScreen(); //Create pauseScreen object\n\t\tspriteSheet = new SpriteSheet(\"img/sprites.png\"); //Create SpriteSheet object\n\t\tnew Texture(); //Initialize texture object\n\t}", "public GameLoop(Game game) {\n\t\tthis.game = game;\n\t}", "public Game() {\n\t\tthis.board = new Board();\n\t\tthis.pieces = new HashMap<Chess.Color, List<Piece>>();\n\t\tthis.pieces.put(Chess.Color.WHITE, new ArrayList<Piece>());\n\t\tthis.pieces.put(Chess.Color.BLACK, new ArrayList<Piece>());\n\t\tthis.moveStack = new Stack<Move>();\n\t}", "public AbstractGame() {\n config = new Config(\"config/config.cfg\");\n isRunning = false;\n // Update 120 times per second\n NS_PER_UPDATE = 1000000000L / Long.parseLong(config.getProperty(\"updateInterval\"));\n }", "public Player(Game game){\r\n this.game = game;\r\n }", "public GamePlayer() {}", "public States(Gameengine game) {\r\n\t\tthis.game = game;\r\n\t}", "public Game() \n {\n parser = new Parser();\n }", "public GameState() {}", "public MiniGame() {\n\n\t}", "public Game() {\n initComponents();\n }", "public BoardGame()\n\t{\n\t\tplayerPieces = new LinkedHashMap<String, GamePiece>();\n\t\tplayerLocations = new LinkedHashMap<String, Location>();\n\t\t\n\t}", "public RunningGame() {\n initComponents();\n }", "public playGame()\n {\n // initialise instance variables\n //no constructor\n }", "public GameOfLifeGameActivity() {\n\t\tsuper(new GameOfLifeModel(), new GameOfLifeController(), new GameOfLifeView());\n\t\tsetKeyResources(R.layout.game, R.id.game_surface);\n\t}", "public GameOfLifeTest()\n {\n }", "public Game() {\n super(\"Project 6 Game\");\n setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n gamePanel = new GamePanel();\n setContentPane(gamePanel);\n pack();\n setLocationRelativeTo(null);\n setVisible(true);\n }", "public Running(Game g) {\n\t\tsuper(g);\n\t}", "public BattleShipGame(){\n ui = new UserInterface();\n played = false;\n highestScore = 0;\n }", "public Game(){\n\t\tDimension size = new Dimension(width * scale, height * scale);\n\t\tsetPreferredSize(size);\n\t\t\n\t\tscreen = new Screen(width, height);//instantiated the new screen\n\t\t\n\t\tframe = new JFrame();\n\t\t\n\t}", "public Game() {\n String configPath= String.valueOf(getClass().getResource(\"/config/conf.xml\"));\n\n listeners= new ArrayList<>();\n assembler= new Assembler(configPath);\n levelApple= (ILevel) assembler.newInstance(\"levelApple\");\n levelRarity= (ILevel) assembler.newInstance(\"levelRarity\");\n levelRainbow= (ILevel) assembler.newInstance(\"levelRainbow\");\n levelRunning= levelApple;\n levelApple.selected();\n levelFlutter= null;\n levelPinky= null;\n jukebox = (Jukebox) assembler.newInstance(\"jukebox\");\n jukebox.switchTo(\"apple\");\n event = new LevelChangeEvent();\n event.setNumberOfLevel(6);\n setEventSelected(true, false, false);\n setEventRunning(true, true, true);\n }", "public GameView() {\n initComponents();\n gameView(30, 30);\n }", "public BeanGame () {\n\t}", "public GameDisplay(Game game) {\n _game = game;\n setPreferredSize(BOARD_WIDTH, BOARD_HEIGHT);\n }", "public GameManager(){\r\n init = new Initialisation();\r\n tower=init.getTower();\r\n courtyard=init.getCourtyard();\r\n kitchen=init.getKitchen();\r\n banquetHall=init.getBanquetHall();\r\n stock=init.getStock();\r\n throneHall=init.getThroneHall();\r\n vestibule=init.getVestibule();\r\n stables=init.getStables();\r\n\r\n this.player = new Player(tower);\r\n\r\n push(new IntroductionState());\r\n\t}", "public Game(int width, int height)\n {\n //make a panel with dimensions width by height with a black background\n this.setLayout( null );//Don't change\n this.setBackground( new Color(150,150,150 ));\n this.setPreferredSize( new Dimension( constants.getWidth(), constants.getHeight () ));//Don't change\n \n //initialize the instance variables\n over = false;\n player = new Player( (constants.getWidth())/2, (constants.getHeight())/2); //change these numbers and see what happens\n circle = new Circle( 400, 200 );\n label = new JLabel(\"Points: \" + points);\n this.add( label );\n label.setBounds(300,50,400,50);\n label.setForeground(Color.BLUE);\n label.setFont(new Font(\"Arial\",Font.BOLD,32));\n label.setHorizontalAlignment(SwingConstants.CENTER);\n projectileInitW=false;\n projectileInitA=false;\n projectileInitS=false;\n projectileInitD=false;\n this.addKeyListener(this);//allows the program to respond to key presses - Don't change\n track = new Sound(\"song.wav\");\n track.loop();\n this.setFocusable(true);//I'll tell you later - Don't change\n }", "public Controller (Game game) {\n fsm = new FiniteStateMachine();\n this.game = game;\n }", "public GamePlayStatus() {}", "public Game() { \n // Create the new environment. Must be done in the same\n // method as the game loop\n env = new Env();\n \n // Sets up the camera\n env.setCameraXYZ(25, 50, 55);\n env.setCameraPitch(pitch);\n\n // Turn off the default controls\n env.setDefaultControl(false);\n\n // Make the room 50 x 50.\n env.setRoom(new Room());\n creatures = new ArrayList<Creature>();\n }", "private GameProgress() {\n maxTime = 3000;\n heathMax = 1000;\n fuelMax = 4000;\n difficultyLv = 1;\n fuelGainMultiply = 0;\n healthGainMultiply = 0;\n money = 0;\n lives = 1;\n increaseSafeTime = 0;\n livesWereBought = 0;\n decreaseDamage = 0;\n time = 0;\n lv = 1;\n }", "public SnakeGame() {\n\t\t// game initialy not running\n\t\tgameRunning = false; \n\t\t// init our GUI\n\t\tinitGUI();\n\t}", "public GameController() {\n \t\t// Fill the table empty positions.\n \t\tfor (int i = 0; i < MAX_NUMBER_OF_PILES; i++) {\n \t\t\tmTable.add(i, null);\n \t\t}\n \t\tcreateDeck();\n \t\tgs = new GameState(mTable, pileNames, pileNo);\n \t\tnew Listener(this);\n \t}", "public Game() {\t\t\t\t\t\n\t\t\n\t\tmDeck = new Deck();\t\t\t\t\t\t\t\t\t\t\t\n\t\tmDealer = new Dealer(mDeck.getCard(), mDeck.getCard());\t//dealer gets a random value card twice to initialise the dealers hand with 2 cards\n\t\tmUser = new User();\t\t\t\t\t\t\t\t\t\t\t\n\t\tgiveCard();\t\t\t\t\t\n\t}", "public ResultState(Game game){\r\n super(game);\r\n game.newGameState(); // Makes a new gameState, but doesn't set the State to it yet. This is to reset all\r\n // variables so that the next hand starts fresh.\r\n }", "public Game() {\n whitePlayer = new AwfulAIPlayer(Colour.WHITE, board);\n blackPlayer = new HumanPlayer(Colour.BLACK, board);\n\n sharedBoard = new CompositeBitBoard(whitePlayer.getOccupied(), blackPlayer.getOccupied());\n }", "public ParkingSquare(Game game) \r\n {\r\n super(game);\r\n }", "public GameSession()\r\n {\r\n red = new Player(\"Red\");\r\n blue = new Player(\"Blue\");\r\n \r\n gameBoard = new Board();\r\n \r\n redRounds = 0;\r\n blueRounds = 0;\r\n \r\n currentRedScore = 0;\r\n currentBlueScore = 0;\r\n \r\n matchEnd = false;\r\n roundEnd = false;\r\n \r\n redWin = false;\r\n blueWin = false;\r\n \r\n move[0] = -1;\r\n move[1] = -1;\r\n \r\n line[0] = -1;\r\n line[1] = -1;\r\n }", "public Game(String playerTexturePath) {\r\n this.player = new Player(playerTexturePath);\r\n this.world = new GameWorld(this.player, this);\r\n this.gameWindow = new GameWindow(this.player, this.world);\r\n this.win = new Window(1032, 670, this.gameWindow);\r\n }", "public Game() {\n board = new FourBoard();\n }", "public Game(String title, int width, int height) {\n this.title = title;\n this.width = width;\n this.height = height;\n running = false;\n started = false;\n gameover = false;\n pause = false;\n keyManager = new KeyManager();\n score = 0;\n lost = false;\n vidas = 3;\n win= false;\n enemiesCont = 0;\n cont=0;\n enemiesbombaCont=0;\n contadorbalas=0;\n }", "public GameState(){\n this.gameResults = \"\";\n initVars();\n this.theme = DEFAULT_THEME;\n this.board = new Board(DEFAULT_BOARD);\n createSetOfPlayers(DEFAULT_PLAYERS, DEFAULT_AUTOPLAYER, DEFAULT_AUTOMODE);\n }", "public Game()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1, false); \n Greenfoot.start(); //Autostart the game\n Greenfoot.setSpeed(50); // Set the speed to 30%\n setBackground(bgImage);// Set the background image\n \n //Create instance\n \n Airplane gameplayer = new Airplane ();\n addObject (gameplayer, 100, getHeight()/2);\n \n }", "public Game()\n\t{\n\t\tsetSize(Main.FRAMEWIDTH, Main.FRAMEHEIGHT);\n\t\taddMouseListener(mouse);\n\t\taddMouseMotionListener(mouse);\n\t\taddKeyListener(key);\n\t\taddMouseWheelListener(mouse);\n\t\tsetFocusable(true);\n\t\t//setVisible(false);\n\t\t\n\t\tengine.start();\n\t}", "@Override\n\tpublic void newGame() {\n\t\tround = 0;\n\t\tnewRound();\n\t\t\n\t\tgameOverSoundPlayed = false;\n\t\t\n\t\t// Reset player scores\n\t\tfor (Player player : players) {\n\t\t\tsetPlayerScore(player, 0);\n\t\t}\n\t\t\n\t\t// Reset all button press counters\n\t\tfor (IButton button : buttons) {\n\t\t\tbutton.resetPressCounter();\n\t\t}\n\t\t\n\t\t// Start the game timer\n\t\tdeltaTimeAlive = getPhysicsTickMillis();\n\t\tdeltaTimeDead = deltaTimeAlive / 4;\n\t}", "private GameManager() \n\t{\n\t\t\n\t}", "public GameLuncher(GameGUI gameGUI) {\n this.gameGUI = gameGUI;\n createGame();\n }", "void startGame(int gameId) {\n game = new Game(gameId);\n }", "public Menu(Game game) {\n this.game = game;\n }", "public void\tinitialize(Game game);", "public Game(String title, int width, int height) {\n this.title = title;\n this.width = width;\n this.height = height;\n this.isRunning = false;\n this.backgroundFrames = Const.TOTAL_BACKGROUND_FRAMES;\n this.delay = Const.DELAY;\n }", "public Game createGame();", "public Game() {\n //Create the deck of cards\n cards = new Card[52 * numDecks];\n cards = initialize(cards, numDecks);\n cards = shuffleDeck(cards, numDecks);\n }", "public void newGame() {\r\n\r\n gameObjects.newGame();\r\n\r\n // Reset the mScore\r\n playState.mScore = 0;\r\n\r\n // Setup mNextFrameTime so an update can triggered\r\n mNextFrameTime = System.currentTimeMillis();\r\n }", "public Game(String name) {\t\t\t// constructor\n\t\tthis.gameName = name;\n\t\tthis.topScore = -1;\t\t\t\t// -1 means game has not yet been played\n\t\tthis.topScorerName = \"\";\n\t\tthis.secondScore = -1;\n\t\tthis.secondScorerName = \"\";\n\t}", "public GameWorld(){\r\n\t\t\r\n\t}", "public WarGame() {\r\n\t\tsetGame();\r\n\t}", "public TimGame() \n {\n /* set up timer for displaying splash screen */\n timTimer = new Timer(10, this);\n\n /* set up splash screen */\n\t\ttimSplash = new JFrame();\n\t\tJLabel splashLabel = new JLabel();\n\t\tsplashLabel.setIcon(new ImageIcon(getClass().getClassLoader().getResource(\"resources/images/TIMG4logo.jpg\")));\n\t\ttimSplash.add(splashLabel);\n\t\ttimSplash.setSize(1000,550);\n\t\ttimSplash.setUndecorated(true);\n\t\ttimSplash.setLocationRelativeTo(null);\n\t\ttimSplash.setVisible(true);\t\n \n /* instantiate large objects */\n pf = new PlayerProfile();\n\t ap = new AudioPlayer();\n timWorld = new TimWorld();\n timHelp = new TimHelp();\n\n /* instantiate widget scroller and add to all listeners */\n ws = new WidgetScroller();\n ws.addMouseListener(this);\n ws.addMouseMotionListener(this);\n\n /* instantiate game canvas and add to all listeners */\n canvas = new GameCanvas(timWorld);\n canvas.addMouseListener(this);\n canvas.addMouseMotionListener(this);\n canvas.addKeyListener(this);\n canvas.addDrawable(this);\n\t}", "public Game(TileGrid grid) {\n this.grid = grid;\n\n waveManager = new WaveManager(\n new Enemy(quickLoad(\"Ufo\"), grid.getTile(2, 9), grid, TILE_SIZE, TILE_SIZE, 70, 25), 2, 10);\n player = new Player(grid, waveManager);\n player.setup();\n setupUI();\n\n }", "public AbstractGameState() {\n\t\tsuper();\n\t}", "public void newGame() {\n init();\n updateScoreBoard();\n Toast.makeText(getContext(), \"New Game started\", Toast.LENGTH_LONG).show();\n }", "public Game() {\n\t\toptions = Options.load();\n\t\tmenu = new Menu(this);\n\t\twindow = new JFrame(Game.TITLE);\n\t\twindow.setExtendedState(JFrame.MAXIMIZED_BOTH);\n\t\twindow.setMinimumSize(new Dimension(window.getWidth(), window.getHeight()));\n\t\twindow.setLocationRelativeTo(null);\n\t\twindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\twindow.setVisible(true);\n\t\tloadMenu();\n\t}", "public GameController() {\n GameLoop.getInstance();\n }", "public GameHandler() {\n boardGraph = new BoardGraph();\n reset();\n }", "private GameController() {\n\n }", "public OrchardGame() {\n\t\t\n\t}", "public GameView(Context context) {\n super(context);\n this.context = context;\n gameThread = new GameThread(this);\n volumeThread = new VolumeThread(this);\n holder = getHolder();\n holder.addCallback(new Callback() {\n @Override\n public void surfaceDestroyed(SurfaceHolder holder) {\n ControlScore.save(score,context);\n }\n @Override\n public void surfaceCreated(SurfaceHolder holder) {\n initSprites();\n setCollision();\n score = ControlScore.load(context);\n ControlScore.save(score,context);\n gameThread.setRunning(true);\n gameThread.start();\n volumeThread.setRunning(true);\n volumeThread.start();\n }\n @Override\n public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {\n }\n });\n }" ]
[ "0.76979506", "0.76940507", "0.7677524", "0.76167434", "0.75755113", "0.7387691", "0.73847973", "0.7367482", "0.73578364", "0.73447645", "0.7332422", "0.72944003", "0.72893715", "0.7262542", "0.7225731", "0.71399796", "0.7105542", "0.7095395", "0.70819426", "0.70690644", "0.7067162", "0.7014391", "0.6983155", "0.695782", "0.6945193", "0.6943084", "0.69342697", "0.69237095", "0.6910517", "0.6880898", "0.68407905", "0.6825709", "0.6825709", "0.6824049", "0.68212366", "0.68154377", "0.6804367", "0.6800522", "0.6774987", "0.6748179", "0.6744185", "0.67366207", "0.6734413", "0.66920775", "0.6682128", "0.6678226", "0.6646705", "0.66438055", "0.6628593", "0.6615327", "0.6594534", "0.6587097", "0.65579045", "0.6557253", "0.65390253", "0.6527181", "0.65133095", "0.65083265", "0.6495634", "0.64945984", "0.649263", "0.6481407", "0.6461676", "0.64590055", "0.64472276", "0.6446027", "0.6445815", "0.64395905", "0.6435723", "0.6435188", "0.6433532", "0.642524", "0.64104897", "0.639602", "0.639138", "0.6390711", "0.6385258", "0.6384591", "0.6384558", "0.6377895", "0.6372777", "0.63671625", "0.6358806", "0.6349759", "0.6348116", "0.63441616", "0.63391066", "0.6333891", "0.6333449", "0.63130283", "0.6305695", "0.6303562", "0.63015425", "0.62957835", "0.6294865", "0.62872756", "0.627658", "0.62601405", "0.6255388", "0.6254752" ]
0.6758834
39
The resetGame instance method is used to reset the game object back to its default state.
public void resetGame() { this.inProgress = false; this.round = 0; this.phase = 0; this.prices = Share.generate(); int i = 0; while(i < this.prices.size()) { this.prices.get(i).addShares(Config.StartingStockPrice); ++i; } int p = 0; while(p < Config.PlayerLimit) { if(this.players[p] != null) { this.players[p].reset(); } ++p; } this.deck = Card.createDeck(); this.onTable = new LinkedList<>(); Collections.shuffle(this.deck); this.dealToTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void reset(MiniGame game) {\n }", "public void resetGame() {\r\n\r\n\t\tplayerScore = 0;\r\n\t\tframe.setVisible(false);\r\n\t\tgame = new Game();\r\n\r\n\t}", "@Override\n public void resetGame() {\n\n }", "private void resetGame(){\n\n }", "public void resetGame(){\n\t\tPlayer tempPlayer = new Player();\n\t\tui.setPlayer(tempPlayer);\n\t\tui.resetCards();\n\t}", "private void resetAfterGame() {\n }", "public void resetGame() {\n\t\thandler.setDown(false);\n\t\thandler.setLeft(false);\n\t\thandler.setRight(false);\n\t\thandler.setUp(false);\n\n\t\tclearOnce = 0;\n\t\thp = 100;\n\t\tfromAnotherScreen = true;\n\t\tsetState(1);\n\t}", "private void resetGame() {\n rockList.clear();\n\n initializeGame();\n }", "public void resetGame() {\r\n\t\tfor(Player p : players) {\r\n\t\t\tp.reset();\r\n\t\t}\r\n\t\tstate.reset();\r\n\t}", "public GameChart resetGame();", "public void reset() { \r\n myGameOver = false; \r\n myGamePaused = false; \r\n }", "public void reset(){\n newGame();\n removeAll();\n repaint();\n ended = false;\n }", "private void resetGame() {\n game.resetScores();\n this.dialogFlag = false;\n rollButton.setDisable(false);\n undoButton.setDisable(true);\n resetButton.setDisable(true);\n setDefault(\"player\");\n setDefault(\"computer\");\n }", "void reset() {\n myManager.reset();\n myScore = 0;\n myGameOver = false;\n myGameTicks = myInitialGameTicks;\n myOldGameTicks = myInitialGameTicks;\n repaint();\n }", "public void reset() {\n playing = true;\n won = false;\n startGame();\n\n // Make sure that this component has the keyboard focus\n requestFocusInWindow();\n }", "public void resetGame(){\r\n\t\tSystem.out.println(\"Reset game min:\"+minimum+\" max:\"+maximum);\r\n\t\t//reset the target, set guesses to 1, and newGame flag to true\r\n\t\ttarget.setRandom(minimum, maximum, \"reset game\");\r\n\t\tthis.msg.setMessage(\"\");\r\n\t\tthis.guesses.setValue(1);\r\n\t\t\r\n\t}", "public void resetGame(Game g) {\r\n\t\tint size = g.getBoard().getBoardSize();\r\n\t\tint mines = g.getBoard().getNumberOfMines();\r\n\t\tg = new Game(size,mines);\r\n\t}", "void resetGame() {\r\n if (GameInfo.getInstance().isWin()) {\r\n GameInfo.getInstance().resetDots();\r\n MazeMap.getInstance().init();\r\n GameInfo.getInstance().resetFruitDisappearTime();\r\n MazeMap.getInstance().updateMaze(GameInfo.getInstance().getMode());\r\n }\r\n for (PropertyChangeListener pcl : pcs.getPropertyChangeListeners(Constants.PACMAN)) {\r\n pcs.removePropertyChangeListener(Constants.PACMAN, pcl);\r\n }\r\n for (PropertyChangeListener pcl : pcs.getPropertyChangeListeners(Constants.GHOSTS)) {\r\n pcs.removePropertyChangeListener(Constants.GHOSTS, pcl);\r\n }\r\n PacMan pacMan = initPacMan();\r\n initGhosts(pacMan);\r\n }", "public void resetGame() { \n\t\tInvokeMessage im = new InvokeMessage();\n\t\tim.setMethodName(\"doResetGame\");\n\t\tSheepPhysicsState sps = getSps();\n\t\tnew InvokeCallable(im, sps);\n\t}", "public void reset() {\n\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\tfor (int j = 0; j<DIVISIONS; j++){\n\t\t\t\tgameArray[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\tgameWon = false;\n\t\twinningPlayer = NEITHER;\n\t\tgameTie = false;\n\t\tcurrentPlayer = USER;\n\t}", "private void ResetGame(){\n this.deck = new Deck();\n humanPlayer.getHand().clear();\n humanPlayer.setWager(0);\n dealer.getHand().clear();\n }", "private void resetGame() {\r\n\t\t\r\n\t\tif(easy.isSelected()) {\r\n\t\t\tGRID_SIZE = 10;\r\n\t\t\tlbPits = 3;\r\n\t\t\tubPits = 5;\t\t\t\r\n\t\t} else if(medium.isSelected()) {\r\n\t\t\tGRID_SIZE = 15;\r\n\t\t\tlbPits = 8;\r\n\t\t\tubPits = 12;\r\n\t\t} else if(hard.isSelected()) {\r\n\t\t\tGRID_SIZE = 20;\r\n\t\t\tlbPits = 35;\r\n\t\t\tubPits = 45;\r\n\t\t} else {\r\n\t\t\tGRID_SIZE = 10;\r\n\t\t\tlbPits = 3;\r\n\t\t\tubPits = 5;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tvisited = new boolean[GRID_SIZE][GRID_SIZE];\r\n\t\tGameMapFactory mf = new GameMapFactory(new Obstacle[GRID_SIZE][GRID_SIZE], new Random(), GRID_SIZE, lbPits, ubPits);\r\n\t\tmf.setupMap();\r\n\t\tgame.resetGame(GRID_SIZE, mf.getGameMap(), visited, mf.getHunterPosition());\r\n\t\t\r\n\t}", "public void resetGame() {\n\t\tBrickPanel.resetBallLocation();\n\t\tBrickPanel.repaint();\n\t}", "@Override\n public void reset() {\n updateDice(1, 1);\n playerCurrentScore = 0;\n playerScore = 0;\n updateScore();\n notifyPlayer(\"\");\n game.init();\n }", "private void resetGame() {\n game.resetGame();\n round_score = 0;\n\n // Reset values in views\n player_tot_view.setText(String.valueOf(game.getPlayer_total()));\n bank_tot_view.setText(String.valueOf(game.getBank_total()));\n round_score_view.setText(String.valueOf(round_score));\n String begin_label = \"Round \" + game.getRound() + \" - Player's Turn\";\n round_label.setText(begin_label);\n\n getTargetScore();\n }", "public void resetGame(){\n initBoard(ROWS, COLS, rand);\n }", "public void resetGame() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tboard[i][j] = 0;\n\t\t\t\tgetChildren().remove(renders[i][j]);\n\t\t\t\trenders[i][j] = null;\n\t\t\t}\n\t\t}\n\t}", "public void ResetGame(){\n handComputer.clear();\n handHuman.clear();\n deck.clear();\n\n InitializeDeck();\n InitializeComputerHand();\n InitializeHumanHand();\n\n topCard = deck.get(0);\n }", "public void resetgamestate() {\n \tthis.gold = STARTING_GOLD;\n \tthis.crew = STARTING_FOOD;\n \tthis.points = 0;\n \tthis.masterVolume = 0.1f;\n this.soundVolume = 0.5f;\n this.musicVolume = 0.5f;\n \n this.ComputerScience = new Department(COMP_SCI_WEPS.getWeaponList(), COMP_SCI_UPGRADES.getRoomUpgradeList(), this);\n this.LawAndManagement = new Department(LMB_WEPS.getWeaponList(), LMB_UPGRADES.getRoomUpgradeList(), this);\n this.Physics = new Department(PHYS_WEPS.getWeaponList(), PHYS_UPGRADES.getRoomUpgradeList(), this);\n \n this.playerShip = STARTER_SHIP.getShip();\n this.playerShip.setBaseHullHP(700);\n this.playerShip.repairHull(700);\n this.combatPlayer = new CombatPlayer(playerShip);\n }", "private void reset() // reset the game so another game can be played.\n\t{\n\t\tenableControls(); // enable the controls again..\n\n\t\tfor (MutablePocket thisMutPocket: playerPockets) // Reset the pockets to their initial values.\n\t\t{\n\t\t\tthisMutPocket.setDiamondCount(3);\n\t\t}\n\n\t\tfor(ImmutablePocket thisImmPocket: goalPockets)\n\t\t{\n\t\t\tthisImmPocket.setDiamondCount(0);\n\t\t}\n\n\t\tfor(Player thisPlayer: players) // Same for the player..\n\t\t{\n\t\t\tthisPlayer.resetPlayer();\n\t\t}\n\n\t\tupdatePlayerList(); // Update the player list.\n\n\t}", "public void gameReset() {\r\n\t\tfor (int n = 0; n < 6; n++) {\r\n\t\t\tfor (int m = 0; m < 7; m++) {\r\n\t\t\t\tsquares[n][m].setText(\"\");\r\n\t\t\t\tsquares[n][m].setBackground(Color.BLUE);\r\n\t\t\t\tsquares[n][m].setEnabled(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int a = 0; a < 7; a++) {\r\n\t\t\tbuttons[a].setEnabled(true);\r\n\t\t\tbuttons[a].setBackground(Color.BLACK);\r\n\r\n\t\t}\r\n\t\tif (gameType == 2) {\r\n\t\t\tboard();\r\n\t\t\tfor (int i = 0; i < 7; i++) {\r\n\t\t\t\tindex[i] = 6;\r\n\t\t\t}\r\n\r\n\t\t} else if (gameType == 1) {\r\n\t\t\tcompAI.setUpArray(ROW, COL);\r\n\t\t}\r\n\t}", "public void reset() {\r\n\t\tplayAgain = false;\r\n\t\tmainMenu = false;\r\n\t\tachievement = 0;\r\n\t}", "private void resetGame() {\r\n SCORE = 0;\r\n defaultState();\r\n System.arraycopy(WordCollection.WORD, 0, tempWord, 0, WordCollection.WORD.length);\r\n }", "public void resetGame(){\n\t\tlabyrinth.reset();\n\t\tlabyrinth = Labyrinth.getInstance();\n\t\tplayer.setX(0);\n\t\tplayer.setY(0);\n\n\t\tcandies = new HashMap();\n\t\tenemies = new HashMap();\n\t\tbuttons = new HashMap();\n\n\t\tint coordX = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tint coordY = ThreadLocalRandom.current().nextInt(0, 16);\n\t\tdoor.setX(coordX);\n\t\tdoor.setY(coordY);\n\n\t\tgenerateCandies();\n\t\tgenerateEnemies();\n\n\t}", "public void resetGame() {\n frameRate(framerate);\n w = width;\n h = height;\n if (width % pixelSize != 0 || height % pixelSize != 0) {\n throw new IllegalArgumentException();\n }\n\n this.resetGrid();\n this.doRespawn = false;\n this.runGame = true;\n\n spawns = new HashMap();\n spawns.put(\"RIGHT\", new Location(50, (h - topHeight) / 2)); // LEFT SIDE\n spawns.put(\"LEFT\", new Location(w-50, (h - topHeight) / 2)); // RIGHT SIDE\n spawns.put(\"DOWN\", new Location(w/2, topHeight + 50)); // TOP SIDE\n spawns.put(\"UP\", new Location(w/2, h - 50)); // BOTTOM SIDE\n}", "public void reset() {\n gameStatus = null;\n userId = null;\n gameId = null;\n gameUpdated = false;\n selectedTile = null;\n moved = false;\n }", "public void resetGameRoom() {\n gameCounter++;\n score = MAX_SCORE / 2;\n activePlayers = 0;\n Arrays.fill(players, null);\n }", "public void resetBoard() {\n\t\tplayerTurn = 1;\n\t\tgameStart = true;\n\t\tdispose();\n\t\tplayerMoves.clear();\n\t\tnew GameBoard();\n\t}", "public void reset()\r\n {\r\n gameBoard.reset();\r\n fillBombs();\r\n fillBoard();\r\n scoreBoard.reset();\r\n }", "public void restartGame() {\n\t\tclearGame();\n\t\tstartGame();\n\t}", "public void reset() {\n // corresponding function called in the Board object to reset piece\n // positions\n board.reset();\n // internal logic reset\n lastColor = true;\n gameOver = false;\n opponentSet = false;\n }", "private void resetGame()\n {\n createRooms();\n createItems();\n createCharacters();\n\n int itemsToAdd = getRandomNumber(10,items.size());\n addRoomItems(itemsToAdd);\n winItem = createWinItem();\n\n moves = 1;\n currentRoom = getRoom(STARTROOM); // Player's start location.\n }", "public final void reset(){\n\t\tthis.undoStack = new GameStateStack();\n\t\tthis.redoStack = new GameStateStack();\n\t\t\n\t\tthis.currentBoard = currentRules.createBoard(currentSize);\n\t\tthis.currentRules.initBoard(currentBoard, currentInitCells, currentRandom);\n\t}", "public void resetPlayerForNewGame(Game game){\n\t\tthis.game = game;\n\t\tthis.coins = game.getStartCoins();\n\t\tthis.collectedCards = new int[game.getMaxCardValue() + 1];\n\t\tSystem.out.println(name + \" is ready for the new Game.\");\n\t}", "public void resetGame(){\n removeAll();\n\n brickManager = new BrickManager(BRICKMANAGER_X_POSITION, BRICKMANAGER_Y_POSITION);\n ball = new Ball(BALL_INITIAL_X_POSITION, BALL_INITIAL_Y_POSITION, BALL_RADIUS*2, BALL_RADIUS*2);\n bar = new Bar(BAR_INITIAL_X_POSITION, BAR_INITIAL_Y_POSITION, BAR_LENGTH, BAR_WIDTH);\n\n add(ball);\n add(bar);\n add(brickManager);\n }", "private void resetBoard() {\n\t\tGameScores.ResetScores();\n\t\tgameTime = SystemClock.elapsedRealtime();\n\t\t\n\t}", "public void\tdeinitialize(Game game);", "public void reset(){\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm -r data/games_module\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"sed -i \\\"1s/.*/ \"+\"0\"+\" /\\\" data/winnings\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"sed -i \\\"1s/.*/ \"+\"175\"+\" /\\\" data/tts_speed\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/answered_questions\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/five_random_categories\");\n\t\tBashCmdUtil.bashCmdNoOutput(\"rm data/current_player\");\n\t\t_currentPlayer = null;\n\t\t_internationalUnlocked = false;\n\t\t_gamesData.clear();\n\t\t_fiveRandomCategories.clear();\n\t\tfor (int i= 0; i<5;i++) {\n\t\t\t_answeredQuestions[i]=0;\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/answered_questions\");\n\t\tinitialiseCategories();\n\t\ttry {\n\t\t\treadCategories();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tsetFiveRandomCategories();\n\t}", "public void restart() {\n this.getPlayerHand().getHandCards().clear();\n this.dealerHand.getHandCards().clear();\n this.getPlayerHand().setActualValue(0);\n this.getDealerHand().setActualValue(0);\n this.gameOver = false;\n this.playerBet = MIN_BET;\n this.roundCount = 0;\n this.isRunning = true;\n this.startGame();\n }", "public void reset(){\r\n\t\tif (moveTimer != null) moveTimer.stop();\r\n\t\tmySnake = new Snake(MAX_WIDTH/2, MAX_HEIGHT/2, MAX_WIDTH, MAX_HEIGHT);\r\n\t\tmoveSpeed = mySnake.getList().size();\r\n\t\tmoveTimer = new Timer(1000/moveSpeed, new MoveTimerHelper());\r\n\t\tmoveTimer.start();\r\n\t\tshrooms = new ArrayList<Mushroom>();\r\n\r\n\t\tignoreStrokes = 0;\r\n\t\t\r\n\t\tif (lives <= 0){\r\n\t\t\tgameOver = true;\r\n\t\t\tendGame();\r\n\t\t}\r\n\t}", "private void resetGame() {\n \tcanvas.reset();\n \tguessesLeft = 8;\n \tcurrentWord = \"\";\n \t\n \tguesses = \"\";\n \tword = pickWord();\n \tlist = new boolean[word.length()];\n \t\n \tfor (int i = 0; i < word.length(); i++) {\n \t\tcurrentWord += \"-\";\n \t}\n }", "public void reset() {\n\t\tAssets.playSound(\"tweet\");\n\t\tscore = respawnTimer = spawnCount= 0;\n\t\t\n\t\twalls = new ArrayList<Wall>();\n\t\tcheckPoints = new ArrayList<Wall>();\n\t\tground = new ArrayList<Ground>();\n\n\t\tGround g;\n\t\tPoint[] points = new Point[21];\n\t\tfor (int i = 0; i < 21; i++) {\n\t\t\tpoints[i] = new Point(i * 32, 448);\n\t\t}\n\t\tfor (int j = 0; j < points.length; j++) {\n\t\t\tg = new Ground();\n\t\t\tg.setBounds(new Rectangle(points[j].x, 448, 32, 32));\n\t\t\tground.add(g);\n\t\t}\n\n\t\tsky = new Background(-0.2);\n\t\tsky.setImage(Assets.sprite_sky);\n\t\t\n\t\tmountains = new Background(-0.4);\n\t\tmountains.setImage(Assets.sprite_mountains);\n\t\t\n\t\ttrees = new Background(-1.4);\n\t\ttrees.setImage(Assets.sprite_trees);\n\n\t\tstarted = false;\n\t\tplayer.reset();\n\n\t}", "public void resetState();", "public void reset()\n\t{\n\t\t\n\t\tif (lifeCount > 1)\n\t\t{\n\t\t\tthis.setCollisionOn(false);\n\t\t\tthis.setEingabe(false);\n\t\t\tthis.reduceLifeCount();\n\t\t\timg.setRotation(0);\n\t\t\tthis.posX = startPosX;\n\t\t\tthis.setPosY(startPosY + 105);\n\t\t\tthis.spdX = startSpdX;\n\t\t\tthis.setSpdY(-60);\n\t\t\tcollisionShape.setCenterX(startPosX);\n\t\t\tcollisionShape.setCenterY(startPosY);\n\t\t\tsetRupeesInBag(0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/*\n\t\t\t * When Gameover\n\t\t\t */\n\t\t\t\n\t\t\tthis.posX = startPosX;\n\t\t\tthis.setPosY(startPosY);\n\t\t\tcollisionShape.setCenterX(startPosX);\n\t\t\tcollisionShape.setCenterY(startPosY);\n\t\t\tthis.reduceLifeCount();\n\t\t}\n\t}", "public void restartGame() {\n\t\tplayerTurn = 1;\n\t\tgameStart = true;\n\t\tdispose();\n\t\tplayerMoves.clear();\n\t\tboardSize();\n\t\tnew GameBoard();\n\t}", "public void Reset()\r\n\t{\r\n\t\tif(!levelEditingMode)//CAN ONLY RESET IN LEVEL EDITING MODE\r\n\t\t{\r\n\t\t\tgrid.clearUserObjects();\r\n\t\t\tmenu = new SpriteMenu(listFileName, playButton);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void reset() {\r\n\t\tfor(int i = 0; i < rows_size; i++) {\r\n\t\t\tfor(int j = 0; j < columns_size; j++)\r\n\t\t\t\tgame[i][j].Clear();\r\n\t\t}\r\n\t\tcomputerTurn();\r\n\t\tcomputerTurn();\r\n\t\tfreeCells = rows_size*columns_size - 2;\r\n\t\ttakenCells = 2;\r\n\t}", "protected void reset() {\n speed = 2.0;\n max_bomb = 1;\n flame = false;\n }", "public void reset() {\n\t\tFile file = new File(\"src/LevelData.txt\");\n\t\tpaddle = new Paddle(COURT_WIDTH, COURT_HEIGHT, Color.BLACK);\n\t\tbricks = new Bricks(COURT_WIDTH, COURT_HEIGHT, file);\n\t\tball = new Ball(COURT_WIDTH, COURT_HEIGHT, 5, Color.BLACK);\n\n\t\tplaying = true;\n\t\tcurrScoreVal = 0;\n\t\tlivesLeft = 3;\n\t\tstatus.setText(\"Running...\");\n\t\tyourScore.setText(\"Your Score: 0\");\n\t\tlives.setText(\" Lives: \" + livesLeft.toString() + \"| \");\n\n\t\t// Making sure that this component has the keyboard focus\n\t\trequestFocusInWindow();\n\t}", "@Override\r\n\tpublic void resetBoard() {\r\n\t\tcontroller.resetGame(player);\r\n\t\tclearBoardView();\r\n\t\tif (ready)\r\n\t\t\tcontroller.playerIsNotReady();\r\n\t}", "@Override\n\tpublic void execute(Game game, Controller controller) {\n\t\tgame.reset();\n\t}", "public static void resetGame() {\r\n\t\t//Set all variables to their default values.\r\n\t\tMain.isGameStarted = false;\r\n\t\tMain.isSetupDone = false;\r\n\t\tMain.isGameWon = false;\r\n\t\tMain.isGameLost = false;\r\n\t\tMain.isThreeHanded = false;\r\n\t\tMain.isFourHandedSingle = false;\r\n\t\tMain.isFourHandedTeams = false;\r\n\t\tMain.doBidding = false;\r\n\t\tMain.doScoring = false;\r\n\t\tMain.dealerIsPlayer1 = false;\r\n\t\tMain.dealerIsPlayer2 = false;\r\n\t\tMain.dealerIsPlayer3 = false;\r\n\t\tMain.dealerIsPlayer4 = false;\r\n\t\tMain.isNilAllowed = true;\r\n\t\tMain.isDoubleNilAllowed = true;\r\n\t\tMain.nilBidTeam1 = false;\r\n\t\tMain.nilBidTeam2 = false;\r\n\t\tMain.doubleIsAllowedPlayer1 = false;\r\n\t\tMain.doubleIsAllowedPlayer2 = false;\r\n\t\tMain.doubleIsAllowedPlayer3 = false;\r\n\t\tMain.doubleIsAllowedPlayer4 = false;\r\n\t\tMain.doubleIsAllowedTeam1 = false;\r\n\t\tMain.doubleIsAllowedTeam2 = false;\r\n\r\n\t\t\r\n\t\tMain.player1 = \"\";\r\n\t\tMain.player2 = \"\";\r\n\t\tMain.player3 = \"\";\r\n\t\tMain.player4 = \"\";\r\n\t\tMain.team1 = \"\";\r\n\t\tMain.team2 = \"\";\r\n\t\tMain.player1Bid = \"\";\r\n\t\tMain.player2Bid = \"\";\r\n\t\tMain.player3Bid = \"\";\r\n\t\tMain.player4Bid = \"\";\r\n\t\tMain.player1TricksTaken = \"\";\r\n\t\tMain.player2TricksTaken = \"\";\r\n\t\tMain.player3TricksTaken = \"\";\r\n\t\tMain.player4TricksTaken = \"\";\r\n\t\tMain.curDealer = \"\";\r\n\t\tMain.startDealer = \"\";\r\n\t\tMain.bagValue = \"1\";\r\n\t\tMain.nilValue = \"50\";\r\n\t\tMain.doubleNilValue = \"200\";\r\n\t\t\r\n\t\tMain.round = 0;\r\n\t\tMain.player1TimesSet = 0;\r\n\t\tMain.player2TimesSet = 0;\r\n\t\tMain.player3TimesSet = 0;\r\n\t\tMain.player4TimesSet = 0;\r\n\t\tMain.player1Score = \"0\";\r\n\t\tMain.player2Score = \"0\";\r\n\t\tMain.player3Score = \"0\";\r\n\t\tMain.player4Score = \"0\";\r\n\t\tMain.team1Score = \"0\";\r\n\t\tMain.team2Score = \"0\";\r\n\t\t\r\n\t\tGameSetup.gameTypeHidden.setState(true);\r\n\t\tGameSetup.threeHanded.setEnabled(true);\r\n\t\tGameSetup.fourHandedSingle.setEnabled(true);\r\n\t\tGameSetup.fourHandedTeams.setEnabled(true);\r\n\t\tGameSetup.dealerHidden.setState(true);\r\n\t\tGameSetup.choiceBoxPlayer1.setEnabled(true);\r\n\t\tGameSetup.choiceBoxPlayer2.setEnabled(true);\r\n\t\tGameSetup.choiceBoxPlayer3.setEnabled(true);\r\n\t\tGameSetup.choiceBoxPlayer4.setEnabled(true);\r\n\t\tGameSetup.hasPlayerChanged = false;\r\n\t\t\r\n\t\tEditGame.playerChanged = false;\r\n\t\tEditGame.scoreChanged = false;\r\n\t\tEditGame.roundToEdit = 0;\r\n\t\tEditGame.editedRound = 0;\r\n\t}", "public void restartGame() {\n game.level = 1;\n game.overallMoves = 0;\n f.score.setText(\"Overall Score: 0\");\n restartLevel();\n }", "@Override\n public void reset() {\n mMoveButtonActive = true;\n mMoveButtonPressed = false;\n mFireButtonPressed = false;\n droidHitPoints = 0;\n totalKillCollectPoints = 0;\n totalCollectNum = 0;\n// mCoinCount = 0;\n// mRubyCount = 0;\n mTotalKillCollectPointsDigits[0] = 0;\n mTotalKillCollectPointsDigits[1] = -1;\n mTotalCollectNumDigits[0] = 0;\n mTotalCollectNumDigits[1] = -1;\n totalKillCollectPointsDigitsChanged = true;\n totalCollectNumDigitsChanged = true;\n// mCoinDigits[0] = 0;\n// mCoinDigits[1] = -1;\n// mRubyDigits[0] = 0;\n// mRubyDigits[1] = -1;\n// mCoinDigitsChanged = true;\n// mRubyDigitsChanged = true;\n \n levelIntro = false;\n// mLevelIntro = false;\n \n mFPS = 0;\n mFPSDigits[0] = 0;\n mFPSDigits[1] = -1;\n mFPSDigitsChanged = true;\n mShowFPS = false;\n for (int x = 0; x < mDigitDrawables.length; x++) {\n mDigitDrawables[x] = null;\n }\n// mXDrawable = null;\n mFadePendingEventType = GameFlowEvent.EVENT_INVALID;\n mFadePendingEventIndex = 0;\n }", "@Override\n public void reset(MiniGame game)\n {\n // PUT ALL THE TILES IN ONE PLACE AND MAKE THEM VISIBLE\n moveAllTilesToStack();\n for (MahjongSolitaireTile tile : stackTiles)\n {\n tile.setX(TILE_STACK_X);\n tile.setY(TILE_STACK_Y);\n tile.setState(VISIBLE_STATE);\n } \n\n // RANDOMLY ORDER THEM\n Collections.shuffle(stackTiles);\n \n // START THE CLOCK\n startTime = new GregorianCalendar();\n \n // NOW LET'S REMOVE THEM FROM THE STACK\n // AND PUT THE TILES IN THE GRID \n for (int i = 0; i < gridColumns; i++)\n {\n for (int j = 0; j < gridRows; j++)\n {\n for (int k = 0; k < levelGrid[i][j]; k++)\n {\n // TAKE THE TILE OUT OF THE STACK\n MahjongSolitaireTile tile = stackTiles.remove(stackTiles.size()-1);\n \n // PUT IT IN THE GRID\n tileGrid[i][j].add(tile);\n tile.setGridCell(i, j);\n \n // WE'LL ANIMATE IT GOING TO THE GRID, SO FIGURE\n // OUT WHERE IT'S GOING AND GET IT MOVING\n float x = calculateTileXInGrid(i, k);\n float y = calculateTileYInGrid(j, k);\n tile.setTarget(x, y);\n tile.startMovingToTarget(MAX_TILE_VELOCITY);\n movingTiles.add(tile);\n }\n }\n } \n // AND START ALL UPDATES\n beginGame();\n \n // CLEAR ANY WIN OR LOSS DISPLAY\n miniGame.getGUIDialogs().get(WIN_DIALOG_TYPE).setState(INVISIBLE_STATE);\n miniGame.getGUIDialogs().get(LOSS_DIALOG_TYPE).setState(INVISIBLE_STATE);\n miniGame.getGUIDialogs().get(STATS_DIALOG_TYPE).setState(INVISIBLE_STATE);\n }", "public void clearGame() {\n\t\tthis.turnColor = null;\n\t\tthis.inPlay = false;\n\t\tthis.board = new Board();\n\t\tpieces.get(Chess.Color.WHITE).clear();\n\t\tpieces.get(Chess.Color.BLACK).clear();\n\t\tmoveStack.clear();\n\t}", "public void resetTheGame(){\n\t\tfjCount = 0;\n\t\tquestionAnsweredCount = 0;\n\t\tfor(int i = 0 ; i< 5; i++){\n\t\t\tfor(int j = 0 ; j < 5 ; j++){\n\t\t\t\tboard[i][j].reset();\n\t\t\t}\n\t\t}\n\t\tfor(int i = 0 ; i < teamNum; i ++){\n\t\t\tteams[i].reset();\n\t\t\tbets[i] = 0; \n\t\t}\n\t}", "public final void reset() {\n\t\tscore = 0;\n\t\tlives = 10;\n\t\tshields = 3;\n\t}", "public void reset() {\n\t\tsetVisible(false);\n\t\tfor (GameObject gameObject : objects) {\n\t\t\tgameObject.reset();\n\t\t}\n\t}", "public void reset()\n {\n playersPiece = -1;\n king = false;\n empty = true;\n setTileColor(-1);\n }", "public void resetScreen(){\n\t\tGame_Map_Manager.infoVisible= false;\n\t\tGame_PauseMenu.actorManager.open = false;\n\t\tPlayerGoals.open = false;\n\t\tGame_Shop.actorManager.open = false;\n\t\tTrainDepotUI.actorManager.open = false;\n\t\tGameScreenUI.resourcebarexpanded =false;\n\t\tGoalMenu.open= false;\n\t\t\n\t\t//CARDS\n\t\tGame_CardHand.actorManager.open=false;\n\t\tGame_CardHand.actorManager.cardactors.clear();;\n\t\t\n\t\t//Map\n\t\tGame_StartingSequence.reset();\n\t\tGame_Map_Manager.resetMap();\n\t}", "public void reset() {\n\n players = new Player[numAIPlayers + 1];\n createHumanPlayer();\n createAIPlayers(numAIPlayers);\n wholeDeck.shuffle();\n\n // --- DEBUG LOG ---\n // The contents of the complete deck after it has been shuffled\n Logger.log(\"COMPLETE GAME DECK AFTER SHUFFLE:\", wholeDeck.toString());\n\n assignCards(wholeDeck, players);\n activePlayer = randomlySelectFirstPlayer(players);\n playersInGame = new ArrayList<>(Arrays.asList(players));\n winningCard = null;\n roundWinner = null;\n\n roundNumber = 1;\n drawRound = 0;\n }", "public void reset ()\n\t{\n\t\t//The PaperAirplane and the walls (both types) use their reconstruct ()\n\t\t//method to set themselves back to their starting points.\n\t\tp.reconstruct ();\n\t\tfor (int i = 0; i < w.length; i++)\n\t\t\tw[i].reconstruct ();\n\t\t\n\t\tfor (int i = 0; i < sW.length; i++)\n\t\t\tsW[i].reconstruct ();\n\t\t\t\n\t\t//the time is reset using the resetTime () method from the Timer class.\n\t\ttime.resetTime ();\n\t\t\n\t\t//the score is reset using the reconstruct method from the Score class.\n\t\tscore.reconstruct ();\n\t\t\n\t\t//The following variables are set back to their original values set in\n\t\t//the driver class.\n\t\ttimePassed = 0;\t\n\t\tnumClicks = 0;\n\t\teventFrame = 0;\n\t\tlevel = 1;\n\t\txClouds1 = 0;\n\t\txClouds2 = -500;\n\t\tyBkg1 = 0;\n\t\tyBkg2 = 600;\t\t\n\t}", "public void reset() {\n\t\tscore = 0;\n\t}", "private void reset() {\n\n try {\n if (playerOne.win() || playerTwo.win()) {\n Stage stage = application.getPrimaryStage();\n stage.setScene(new EndScene(application, playerOne, playerTwo));\n } else {\n ball.setLayoutX(WIDTH / 2 - LAYOUT / 2);\n ball.setLayoutY(HEIGHT / 2 - LAYOUT / 2);\n\n ball.randomiseDirection(new Random().nextInt(4));\n ball.resetMovementSpeed();\n\n playerOnePaddle.setLayoutY(HEIGHT / 2 - playerOnePaddle.getHeight() / 2);\n playerTwoPaddle.setLayoutY(playerOnePaddle.getLayoutY());\n\n countdown = 50;\n }\n } catch (Exception ex) {\n Logger.getLogger(GameScene.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void reset() {\n\t\tmakeSolutionState();\n\t\twhile (isSolution(this.gameBoard)) {\n\t\t\trandomizeBoard();\n\t\t}\n\t\tlog.clear();\n\t\twon =false;\n\t\twasReset=true;\n\t\t\n\t\tsetChanged();\n\t\tnotifyObservers();\t\t\n\t}", "private void resetGame() {\n for (int row = 0; row < this.boardSize; row++) {\n for (int col = 0; col < this.boardSize; col++) {\n this.board[row][col] = ' ';\n }\n }\n }", "public void clearGame() {\n\t\tselectedObjects.clear();\n\t}", "public void resetPlayer() {\n\t\tthis.carrotCards = 65;\n\t\tthis.playerSpace = 0;\n\n\t}", "public void reset() {\n\t board = new int[]{1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,\n 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0,\n 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2};\n\t currentPlayer = 1;\n\t turnCount = 0;\n\t for (int i=0; i<81; i++) {\n\t \n\t\t hash ^= rand[3*i+board[i]]; //row-major order\n\t \n\t }\n }", "public void reset()\n {\n currentScore = 0;\n }", "public void reset() {\r\n this.x = resetX;\r\n this.y = resetY;\r\n state = 0;\r\n }", "private void softReset() {\n // variables\n lapMap.clear();\n // ui\n sessionTView.setText(\"\");\n positionTView.setText(\"-\");\n currentLapTView.setText(\"--:--:---\");\n lastLapTView.setText(\"--:--:---\");\n bestLapTView.setText(\"--:--:---\");\n currentLapNumberTView.setText(\"-\");\n gapTView.setText(\" -.---\");\n fastestDriver = Float.MAX_VALUE;\n fastestDriverName = null;\n fastestDriverTView.setText(\"--:--:---\");\n fastestDriverNameTView.setText(\"Fastest lap\");\n Log.d(TAG, \"SOFT Reset: between game states\");\n }", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void reset();", "public void initGame() {\n this.game = new Game();\n }", "protected void resetState()\n {\n // Nothing to do by default.\n }" ]
[ "0.8372879", "0.8242723", "0.8198773", "0.81964046", "0.80499667", "0.8040182", "0.80287826", "0.79989046", "0.79198545", "0.7874916", "0.7842612", "0.780214", "0.7715352", "0.7708213", "0.76820606", "0.76223934", "0.75863963", "0.7548463", "0.75316286", "0.7512772", "0.7486984", "0.7476648", "0.74614525", "0.74589926", "0.7430522", "0.74139166", "0.7407868", "0.7382899", "0.7314694", "0.7310844", "0.7296055", "0.7260703", "0.723901", "0.7219818", "0.719828", "0.71673554", "0.7164061", "0.7139153", "0.7124684", "0.7094408", "0.7036442", "0.70353174", "0.69732064", "0.69669414", "0.69656724", "0.6938088", "0.6836597", "0.68355167", "0.68203485", "0.6812175", "0.6785029", "0.67811227", "0.6776138", "0.67759615", "0.6774155", "0.6764481", "0.6721857", "0.6720819", "0.6719804", "0.670884", "0.67064744", "0.6693712", "0.66925085", "0.6692377", "0.668633", "0.668233", "0.6674714", "0.664201", "0.66379255", "0.66363055", "0.6634599", "0.66255987", "0.6620355", "0.6602983", "0.6589628", "0.6572958", "0.6561118", "0.65543413", "0.65486616", "0.6544137", "0.65356886", "0.65353197", "0.6519423", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6518996", "0.6513304", "0.6510197" ]
0.7204229
34
The dealToTable instance method is used to deal fresh cards from the deck to the table.
private void dealToTable() { this.onTable.clear(); if(this.deck.size() >= Config.TableCards) { this.onTable.addAll(this.deck.subList(0, Config.TableCards)); this.deck = this.deck.subList(Config.TableCards, this.deck.size()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deal(){\n\t\tInteger topRank;\n\t\tInteger btmRank;\n\t\tDouble[] currPercent = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};\n\t\tlastRaise = -1;\n\t\tcurrBet = 3.0;\n\t\tfor (int i = 0; i<tablePlayers.length*2+5; i++) {\n\t\t\tif (i<tablePlayers.length) {\n\t\t\t\ttablePlayers[i].setCard1(deck[i]); \n\t\t\t}\n\t\t\telse if (i<tablePlayers.length*2) {\n\t\t\t\ttablePlayers[i%tablePlayers.length].setCard2(deck[i]); \n\t\t\t}\n\t\t\telse {\n\t\t\t\ttableCards[i-tablePlayers.length*2].setRank(deck[i].getRank());\n\t\t\t\ttableCards[i-tablePlayers.length*2].setSuit(deck[i].getSuit());\n\t\t\t}\n\t\t}\n\t\t//determine each hand's winning percentage and go through first round of betting\n\t\tfor (int j = 0; j < tablePlayers.length; j++) {\n\t\t\tint i = (button + 3 + j) % 10;\n\t\t\t//if (j==0) System.out.println(\"button = \" + button + \"; first = \" + i);\n\t\t\tif (tablePlayers[i].getCard1().getRank() == 1 || tablePlayers[i].getCard2().getRank() == 1) {\n\t\t\t\ttopRank = 14;\n\t\t\t\tbtmRank = Math.max(tablePlayers[i].getCard1().getRank(), tablePlayers[i].getCard2().getRank());\n\t\t\t\tif (btmRank == 1) {\n\t\t\t\t\tbtmRank = 14;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (tablePlayers[i].getCard1().getRank() <= tablePlayers[i].getCard2().getRank()) {\n\t\t\t\t\ttopRank = tablePlayers[i].getCard2().getRank();\n\t\t\t\t\tbtmRank = tablePlayers[i].getCard1().getRank();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttopRank = tablePlayers[i].getCard1().getRank();\n\t\t\t\t\tbtmRank = tablePlayers[i].getCard2().getRank();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (topRank == btmRank) { //pocket pair\n\t\t\t\tif (topRank == 14) {\n\t\t\t\t\tcurrPercent[i] = winPercent[168];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcurrPercent[i] = winPercent[154 + topRank];\n\t\t\t\t}\n\t\t\t} \n\t\t\telse {\n\t\t\t\tint index = -1;\n\t\t\t\tfor (int k = 1; k < topRank-2; k++) {\n\t\t\t\t\tindex += k;\n\t\t\t\t}\n\t\t\t\tindex += btmRank-1;\n\t\t\t\tindex *= 2;\n\t\t\t\tif (tablePlayers[i].getCard1().getSuit() == tablePlayers[i].getCard2().getSuit()) {\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t\tcurrPercent[i] = winPercent[index];\n\t\t\t}\n\t\t\t\n\t\t\t//place first round of pre-flop bets\n\t\t\tif (currPercent[i] > 0.20) { \n\t\t\t\tbetOrRaise(i,12.,3.);\n\t\t\t}\t\t\t\n\t\t\telse if ((currPercent[i] > 0.166 && currBet <= 3.0) ) { \n\t\t\t\tbetOrRaise(i,6.,3.);\n\t\t\t}\n\t\t\telse if (currPercent[i] > preFlopCallBBOdds[i] && currBet <= 3.0) {\n\t\t\t\tcallBetOrCheck(i,3.);\n\t\t\t}\n\t\t\telse if (currPercent[i] > preFlopCallARaiseOdds[i] && currBet <= 6.0) {\n\t\t\t\tcallBetOrCheck(i,6.);\n\t\t\t}\n\t\t\telse if (currPercent[i] > preFlopCallMultiRaiseOdds[i] && currBet > 6.0) {\n\t\t\t\tcallBetOrCheck(i,12.);\n\t\t\t}\n\t\t\telse if (i == ((button + 1) % 10)) {\n\t\t\t\ttablePlayers[i].placeBet(1.0);\n\t\t\t\tpot += 1.0;\n\t\t\t\ttablePlayers[i].foldHand();\n\t\t\t}\n\t\t\telse if (i == ((button + 2) % 10)) {\n\t\t\t\ttablePlayers[i].placeBet(3.0);\n\t\t\t\tpot += 3.0;\n\t\t\t\tif (currBet > 3.0) {\n\t\t\t\t\tif (currPercent[i] > preFlopCallBBOdds[i] && currBet <= 6.0) {\n\t\t\t\t\t\tcallBetOrCheck(i,6.);\n\t\t\t\t\t}\n\t\t\t\t\telse tablePlayers[i].foldHand();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (tablePlayers[i].getBet() < currBet) {\n\t\t\t\ttablePlayers[i].foldHand();\n\t\t\t}\n\t\t}\n\t\tif (lastRaise > -1) {\n\t\t\traiseCount++;\n\t\t}\n\t\t// call raises and allow for re-raises to cap\n\t\twhile (lastRaise > -1) {\n\t\t\tlastRaise = -1;\n\t\t\tfor (int j = 0; j < tablePlayers.length; j++) {\n\t\t\t\tint i = (button + 3 + j) % 10;\n\t\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\t\tif (currPercent[i] > 0.20) {\n\t\t\t\t\t\tbetOrRaise(i,12.,3.);\n\t\t\t\t\t}\n\t\t\t\t\tif (tablePlayers[i].getBet() >= currBet) {\n\t\t\t\t\t\tcontinue; //check\n\t\t\t\t\t}\n\t\t\t\t\telse if (tablePlayers[i].getBet() == currBet - 3.0 && currPercent[i] > preFlopCallBBOdds[i]) {\n\t\t\t\t\t\t//call one raise if player would have called BB\n\t\t\t\t\t\tcallBetOrCheck(i, currBet);\n\t\t\t\t\t}\n\t\t\t\t\telse if (tablePlayers[i].getBet() < currBet - 3.0 && currPercent[i] > preFlopCallMultiRaiseOdds[i]) {\n\t\t\t\t\t\t//call the multiRaise if would have called multiple raises on first action\n\t\t\t\t\t\tcallBetOrCheck(i,12.);\n\t\t\t\t\t}\n\t\t\t\t\telse tablePlayers[i].foldHand();\n\t\t\t\t}\n\t\t\t}\n//\t\t\tprintTableStatus();\n\t\t}\n//\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n//\t\t\tif (!tablePlayers[9].hasFolded()) flopsPlayed++;\n//\t\t}\n\t\t//Bet the flop\n\t\tresetPlayerBets();\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\tplayersLeft++;\n\t\t\t\tflopPlayers++;\n\t\t\t}\n\t\t}\n\t\tif (playersLeft > 1) flopsSeen++;\n\t\tplayersLeft = 0;\n\t\tbetFlop();\n\t\t//Bet the turn\n\t\tresetPlayerBets();\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\tplayersLeft++;\n\t\t\t\tturnPlayers++;\n\t\t\t}\n\t\t}\n\t\tif (playersLeft > 1) turnsSeen++;\n\t\tplayersLeft = 0;\n\t\tbetTurn();\n\t\t\n\t\t//Bet the river\n\t\tresetPlayerBets();\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\triverPlayers++;\n\t\t\t\tplayersLeft++;\n\t\t\t}\n\t\t}\n\t\tif (playersLeft > 1) riversSeen++;\n\t\tplayersLeft = 0;\n\t\tbetRiver();\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) {\n\t\t\t\tplayersLeft++;\n\t\t\t}\n\t\t}\n\t\tif (playersLeft > 1) showdowns++;\n\t\tplayersLeft = 0;\n\t\t\n\t}", "private void clearTable() {\n\t\tcards.clear();\n\t\ttopCard = new Card();\n\t}", "public void giveFlop(Deck deck, ArrayList<Cards> table)\n {\n //Burn one card\n deck.getCard();\n\n //Add 3 cards\n for(int i=0; i < 3; i++)\n table.add(deck.getCard());\n }", "public void deal(){\n // deal cards when game is started and game stage is 0\n // need to clear everything\n if(turn == 4){\n turn = 0;\n }\n player1Hand.clear();\n player2Hand.clear();\n player3Hand.clear();\n player4Hand.clear();\n kitty.clear();\n currentMiddle.clear();\n\n /**\n * External Citation\n * Date: 19 September 2019\n * Problem: Did not have a good way to shuffle array\n * Resource: Dr. Tribelhorn, https://www.geeksforgeeks.org/collections-shuffle-java-examples/\n * Solution: Tribelhorn informed us of the shuffle function, and\n * we used the code in this post as a resource\n */\n // shuffle deck\n Collections.shuffle(deck.cardDeck);\n\n // deal cards to each player\n // player 1's hand\n for (int i = 0; i < 5; i++) {\n player1Hand.add(i, deck.cardDeck.get(i));\n player2Hand.add(i, deck.cardDeck.get(5 + i));\n player3Hand.add(i, deck.cardDeck.get(10 + i));\n player4Hand.add(i, deck.cardDeck.get(15 + i));\n }\n\n for (int i = 0; i < 4; i++) {\n kitty.add(i, deck.cardDeck.get(20 + i));\n }\n kittyTop = kitty.get(0);\n middleCard = deck.cardDeck.get(20);\n middleCardSuit = middleCard.getSuit();\n\n // make middle card visible\n middleVisible = true;\n\n // change game state to 1\n gameStage++;\n }", "private void repopulateTableForDelete()\n {\n clearTable();\n populateTable(null);\n }", "public void dealGame()\n {\n for(int i=0; i<7;i++)\n for(int j=i;j<7;j++)\n {\n tableauHidden[j].push(deck.deal());\n }\n }", "public static void deal()\n\t{\n\t\tdealersCards.add(deck.deal());\n\t\tdealersCards.add(deck.deal());\n\t\tplayersCards.add(deck.deal());\n\t\tplayersCards.add(deck.deal());\n\n\t\tdealerCardImg[0].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(dealersCards.get(0)))));\n\t\tuserCardImg[0].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(0)))));\n\t\tuserCardImg[1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(1)))));\n\t\tcurrentValue();\n\t\tArrayList<Card> dealerCard= new ArrayList<Card>();\n\t\tdealerCard.add(dealersCards.get(0));\n\t\tdealerVal.setText(\">\"+String.valueOf(calculateHand(dealerCard)));\n\n\t\tcheckBlackjack();\n\t}", "public void deal() {\r\n\t\tfor(Player p : players) {\r\n\t\t\tp.recieveCards();\r\n\t\t}\r\n\t\t/*Deals the cards onto the board, 5 cards */\r\n\t\tfor(int i = 0; i < 5; i++) {\r\n\t\t\tboard.add(gameDeck.deal());\r\n\t\t}\r\n\t}", "private void dealCards(){\n\t\tfor(int k = 0; k <2;k++){\n\t\t\tfor(int i = 0; i < Players.size();i++){\n\t\t\t\tPlayers.get(i).addCardToHand(gameDeck.dealCard());\n\t\t\t}\n\t\t}\n\t\t\n\t setChanged();\n\t notifyObservers(\"CardsDealed\");\n\t}", "public void giveOneCard(Deck deck, ArrayList<Cards> table)\n {\n //Burn one card\n deck.getCard();\n\n //Add 1 card\n table.add(deck.getCard());\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tint row = deckTable.getSelectedRow();\n\t\t\t\tif (row >= 0) {\n\t\t\t\t\tdeck.removeCard(((String)deckTable.getValueAt(row, 0)));\n\t\t\t\t\tSystem.out.println(((String)deckTable.getValueAt(row, 0)));\n\t\t\t\t\tArrayList<Object[]> objs = new ArrayList<Object[]>();\n\t\t\t\t\t\n\t\t\t\t\t// update the dcek table\n\t\t\t\t\tDeckObject[] deckRows = deck.getTable();\n\t\t\t\t\tfor (int i = 0; i < deckRows.length; i++) {\n\t\t\t\t\t\tobjs.add(deckRows[i].get());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString[][] rows = objs.toArray(new String[0][0]);\n\t\t\t\t\t\n\t\t\t\t\t// display the new table\n\t\t\t\t\tdeckTable.setModel(new UneditableTableModel(rows, deckColumns));\n\t\t\t\t\tint newSelectRow = row;\n\t\t\t\t\tif (row == deckTable.getRowCount())\n\t\t\t\t\t\tnewSelectRow = deckTable.getRowCount()-1;\n\t\t\t\t\t\n\t\t\t\t\t// select the next item on the table\n\t\t\t\t\tif (newSelectRow >= 0)\n\t\t\t\t\t\tdeckTable.setRowSelectionInterval(newSelectRow,newSelectRow);\n\t\t\t\t\tSystem.out.println(deckTable.getRowCount());\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tCard temp = db.getCard((String)table.getValueAt(table.getSelectedRow(), 0));\n\t\t\t\tSystem.out.println(temp.getName());\n\t\t\t\tdeck.addCard(temp);\n\t\t\t\t\n\t\t\t\t// update the deck list\n\t\t\t\tArrayList<Object[]> objs = new ArrayList<Object[]>();\n\t\t\t\t\n\t\t\t\tDeckObject[] deckRows = deck.getTable();\n\t\t\t\tfor (int i = 0; i < deckRows.length; i++) {\n\t\t\t\t\tobjs.add(deckRows[i].get());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString[][] rows = objs.toArray(new String[0][0]);\n\t\t\t\t\n\t\t\t\t// display updated deck list\n\t\t\t\tdeckTable.setModel(new UneditableTableModel(rows, deckColumns));\n\t\t\t}", "public void dealCards () {\t\n\n\t\tint numOfPlayers = players.size();\n\t\tint count = 0;\n\t\tCard[] cards = deck.getDeck();\n\t\tfor (int i=0; i<cards.length; i++) {\n\t\t\t\t// Go through all the cards, for each player deal 1 card at a time\n\t\t\t\t(players.get(count % numOfPlayers).getCards()).add(cards[i]); \n\t\t\t\tcount++;\n\t\t}\n\t}", "public void deal()\n\t{\n\t Random generator = new Random();\n\t int thisCard = generator.nextInt(52);\n\n\t face = faces[thisCard % 13];\n\t suit = suits[thisCard / 13];\n\n\t faceValue = thisCard %13;\n\t}", "void dealTheCards();", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tint row = deckTable.getSelectedRow();\n\t\t\t\tif (row >= 0) {\n\t\t\t\t\t// remove a single copy of the card\n\t\t\t\t\tdeck.removeCard(((String)deckTable.getValueAt(row, 0)), 1);\n\t\t\t\t\tSystem.out.println(((String)deckTable.getValueAt(row, 0)));\n\t\t\t\t\tArrayList<Object[]> objs = new ArrayList<Object[]>();\n\t\t\t\t\t\n\t\t\t\t\t// update the deck list\n\t\t\t\t\tDeckObject[] deckRows = deck.getTable();\n\t\t\t\t\tfor (int i = 0; i < deckRows.length; i++) {\n\t\t\t\t\t\tobjs.add(deckRows[i].get());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString[][] rows = objs.toArray(new String[0][0]);\n\n\t\t\t\t\t// update the table\n\t\t\t\t\tdeckTable.setModel(new UneditableTableModel(rows, deckColumns));\n\t\t\t\t\tint newSelectRow = row;\n\t\t\t\t\tif (row == deckTable.getRowCount())\n\t\t\t\t\t\tnewSelectRow = deckTable.getRowCount()-1;\n\t\t\t\t\t\n\t\t\t\t\t// select the next object in table\n\t\t\t\t\tif (newSelectRow >= 0)\n\t\t\t\t\t\tdeckTable.setRowSelectionInterval(newSelectRow,newSelectRow);\n\t\t\t\t\tSystem.out.println(deckTable.getRowCount());\n\t\t\t\t}\n\t\t\t}", "@Test\n\tpublic void test() \n\t{\n\t\tTable table = new Table(4);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t//calling the method to deal 5 cards to every player\n\t\t\ttable.dealCards(5);\n\t\t\t\n\t\t\t//setting 4 ArrayLists to the ArrayLists in 'table's players arrayList\n\t\t\tArrayList<Card> p1 = table.getPlayerHands(0);\n\t\t\tArrayList<Card> p2 = table.getPlayerHands(1);\n\t\t\tArrayList<Card> p3 = table.getPlayerHands(2);\n\t\t\tArrayList<Card> p4 = table.getPlayerHands(3);\n\t\t\t\n\t\t\t//showing an example hand\n\t\t\ttable.printPlayersHand(0);\n\t\t\t\n\t\t\t//testing that all players have a hand size of 5 cards\n\t\t\tassertEquals(5, p1.size());\n\t\t\tassertEquals(5, p2.size());\n\t\t\tassertEquals(5, p3.size());\n\t\t\tassertEquals(5, p4.size());\n\t\t\t\n\t\t\t//testing that after 20 cards were removed from the deck, 31 cards remain\n\t\t\tassertEquals(31, table.getDeckSize());\n\t\t\t\n\t\t\t//dealing out another 6 cards\n\t\t\ttable.dealCards(6);\n\n\t\t\t//resetting the ArrayLists to contain the new hands drawn\n\t\t\tp1 = table.getPlayerHands(0);\n\t\t\tp2 = table.getPlayerHands(1);\n\t\t\tp3 = table.getPlayerHands(2);\n\t\t\tp4 = table.getPlayerHands(3);\n\t\t\t\n\t\t\t//testing that the 'players' ArrayList can handle a different hand size from the previous drawing\n\t\t\tassertEquals(6, p1.size());\n\t\t\tassertEquals(6, p2.size());\n\t\t\tassertEquals(6, p3.size());\n\t\t\tassertEquals(6, p4.size());\n\n\t\t\t//now that hand testing has been finished, test to make sure that an invalid index for getPlayerHands() returns null and outputs to the console\n\t\t\tp1 = table.getPlayerHands(4);\n\t\t\tassertEquals(null, p1);\n\t\t\tp1 = table.getPlayerHands(-2);\n\t\t\tassertEquals(null, p1);\n\t\t\t\n\t\t\t//at this point 7 cards remain in the deck, so if another round of 5 cards were to be dealt, then an exception should be thrown\n\t\t\ttable.dealCards(5);\n\n\t\t\t//if the exception is not thrown, then the test will fail\n\t\t\tfail();\n\t\t}\n\t\tcatch(DeckException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch(TableException e1)\n\t\t{\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public Card dealCard() {\n if (deck.size() == 52) {\n shuffle();\n }\n Card temp;\n temp = deck.get(0);\n remove(0);\n return temp;\n }", "private void repopulateTableForAdd()\n {\n clearTable();\n populateTable(null);\n }", "public void resetBJTable() {\n\t\t((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)).clearTable(blackjack.getCashAmount());\n\t\tif (blackjack.getCashAmount() <= 0) {\n\t\t\tJOptionPane.showMessageDialog(((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)),\n\t\t\t\t\t\"You ran out of cash! Please, go back\\n to the menu and make a deposit to\\n keep playing.\",\n\t\t\t\t\t\"** NO MONEY **\", JOptionPane.PLAIN_MESSAGE);\n\t\t}\n\t\tblackjack.setOkBet(false);\n\t}", "public void createNewTable() {\n String dropOld = \"DROP TABLE IF EXISTS card;\";\n\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS card (\\n\"\n + \"id INTEGER PRIMARY KEY AUTOINCREMENT, \\n\"\n + \"number TEXT, \\n\"\n + \"pin TEXT,\\n\"\n + \"balance INTEGER DEFAULT 0\"\n + \");\";\n\n try (Connection connection = connect();\n Statement stmt = connection.createStatement()) {\n\n //drop old table\n stmt.execute(dropOld);\n\n //create a new table\n stmt.execute(sql);\n } catch (SQLException e) {\n System.out.println(\"Exception3: \" + e.getMessage());\n }\n }", "private void beginDeal()\n { \n for (int i = 0; i < DEAL; i++)\n {\n FirstPlayer.addCard(gameDeck.dealCard());\n SecondPlayer.addCard(gameDeck.dealCard());\n }\n \n }", "public SpoonsCard dealCard() {\r\n\t SpoonsCard card = deck.get(0);\r\n\t deck.remove(0);\r\n\t return card;\r\n }", "@Override\r\n public ICard dealCard() {\r\n //get the first card from top of the deck \r\n ICard top = this.deck[ZERO];\r\n //shift cards to the left, because we get the first one \r\n for (int i = ONE; i < this.numOfCards; i++) {\r\n this.deck[i - ONE] = this.deck[i];\r\n }\r\n this.deck[this.numOfCards - ONE] = null;\r\n //decrement the number of cards currently in the deck \r\n this.numOfCards--;\r\n\r\n return top;\r\n }", "public Card dealCard() {\n\t\tnumCards = deckCount * 52;\n\t\tif (dealt >= numCards) {\n\t\t\tthrow new IllegalStateException(\"No Cards Left In The Deck\");\n\t\t} else {\n\n\t\t\tcardsRemaining = numCards - dealt;\n\t\t\tswitch (cardsRemaining) {\n\t\t\tcase 15:\n\t\t\t\tSystem.out.println(\"15 cards remaining in the shoe\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tSystem.out\n\t\t\t\t.println(\"5 cards remaining in the shoe, adding cards \"\n\t\t\t\t\t\t+ \"to shoe \");\n\t\t\t\tShoe.clear();\n\t\t\t\tfor (int h = 0; h < deckCount; h++) {\n\t\t\t\t\tfor (int i = 1; i < 14; i++) {\n\t\t\t\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\t\t\t\tShoe.add(new Card(i, j));\n\t\t\t\t\t\t\tCollections.shuffle(Shoe);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdealt++;\n\t\t\treturn Shoe.get(dealt - 1);\n\t\t}\n\t}", "private void setNewTable() {\n\n for (List<Entity> list:\n masterList) {\n for (Entity entity :\n list) {\n entity.removeFromWorld();\n }\n list.clear();\n }\n\n gameFacade.setGameTable(gameFacade.newFullPlayableTable(\"asd\",\n 6, 0.5, 2, 2));\n for (Bumper bumper :\n gameFacade.getBumpers()) {\n Entity bumperEntity = factory.newBumperEntity(bumper);\n targets.add(bumperEntity);\n getGameWorld().addEntity(bumperEntity);\n }\n\n for (Target target :\n gameFacade.getTargets()) {\n Entity targetEntity = factory.newTargetEntity(target);\n targets.add(targetEntity);\n getGameWorld().addEntity(targetEntity);\n }\n }", "@Override\r\n public void dealerShuffleDeck(){\r\n this.dealer.shuffleDecks();\r\n }", "public Card deal()\r\n\t{\r\n\t\tCard card = deck.remove(0);\r\n\t\treturn card;\r\n\t}", "private void deal()\n { \n for(int i = 1; i <= dealer.NUM_CARDS; i++)\n {\n dw.enqueue(((Card)dealer.dequeue())); \n i++;\n de.enqueue(((Card)dealer.dequeue())); \n i++;\n }\n }", "public Card deal() {\n size--;\n return cards[size];\n }", "private void deal() {\n int index = 0;\n while (!deck.isEmpty()) {\n Card card = deck.get(0);\n players.get(index).receiveCard(card);\n deck.remove(0);\n if (index < players.size() - 1) {\n index++;\n } else {\n index = 0;\n }\n }\n }", "void refillCards() {\n if (this.gameDeck.isEmpty() && !this.wonDeck.isEmpty()) {\n this.wonDeck.shufffle();\n Deck temp = this.gameDeck;\n this.gameDeck = this.wonDeck;\n this.wonDeck = temp;\n\n }\n\n }", "public deal()\n {\n player1Hand = 0;\n player2Hand = 0;\n dealerHand = 0;\n }", "public Card deal() {\n\t\tif (cardsUsed == deck.length)\n\t\t\tthrow new IllegalStateException(\"No cards are left in the deck.\");\n\t\tcardsUsed++;\n\t\treturn deck[cardsUsed - 1];\n\n\t}", "@Override\n\tpublic void sortDeck() {\n\t\tfor(int i = 0; i < getCount() - 1; i++) {\n\t\t\tfor(int j = i + 1; j < getCount(); j++) {\n\t\t\t\tif(aktuellesDeck[i].compareTo(aktuellesDeck[j]) == 1) {\n\t\t\t\t\tSkatCard speicherCard = new SkatCard(aktuellesDeck[i].getSuit(), aktuellesDeck[i].getRank());\n\t\t\t\t\taktuellesDeck[i] = null;\n\t\t\t\t\taktuellesDeck[i] = new SkatCard(aktuellesDeck[j].getSuit(), aktuellesDeck[j].getRank());\n\t\t\t\t\taktuellesDeck[j] = null;\n\t\t\t\t\taktuellesDeck[j] = new SkatCard(speicherCard.getSuit(), speicherCard.getRank());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void dropTable() {\n }", "public void dealCard(int id)\n\t{\n\t\tCard handSlot = deck.getTopCard();\n\t\thands[id].add(handSlot);\n\t\tdeck.removeTopCard();\n\t}", "private void refreashTableView() {\n this.scoreboard.refresh();\n sortScoreboard();\n }", "public void deal() {\r\n\t\twhile(! deck.isEmpty()) {\r\n\t\t\tplayer1.addToUnplayedPile(deck.deal());\r\n\t\t\tplayer2.addToUnplayedPile(deck.deal());\r\n\t\t}\r\n\t}", "public Table() {\n startingCash = 10000;\n renderWinState = false;\n players = new Player[4];\n river = new River();\n deck = new Deck();\n dealer = new Dealer();\n initRiver();\n initPlayers();\n }", "@Override\r\n public void dealerCreateNewDeck() {\r\n this.dealer.createNewDeck();\r\n System.out.println(\"Dealer deck created\");\r\n }", "public void dealCards() {\n for(int i=0; i < 5; i++) { \n for(PokerPlayer player : players) {\n player.takeCard(deck.draw());\n }\n }\n }", "public HandEvaluation(Dealer dealer, Table table) {\n\t\tthis.dealer = dealer;\n\t\tthis.table = table;\n\t}", "public CardGao dealCard()\r\n {\r\n return cards.get(top--);\r\n\r\n }", "private Pile createDeck() {\n \t\tPile deck = new Pile(\"deck\"); // TODO Refactor, no hardcoded string\n\t\tpileNames.add(\"deck\");\n \t\tfor (Suit suit : Suit.values()) {\n \t\t\tfor (Rank rank : Rank.values()) {\n \t\t\t\tdeck.addCard(new Card(suit, rank));\n \t\t\t}\n \t\t}\n \t\t// Put the deck at the middle of the table\n \t\tmTable.set(MID_OF_TABLE, deck);\n \t\treturn deck;\n \t}", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "Card dealOneCard();", "private void prepareDeal(){\n\t\tdeck.shuffle();\n\t\tplayers.clear(); //Remove any possible rubbish\n\t\tfor(Player p : seatPlayers){\n\t\t\tif(p != null){\n\t\t\t\tList<BlackjackHand> hands = new ArrayList<>();\n\t\t\t\tBlackjackHand hand = new BlackjackHandPlayer();\n\t\t\t\thands.add(hand);\n\t\t\t\thistoricalActions.put(hand, new ArrayList<>());\n\t\t\t\tplayers.put(p, hands);\n\t\t\t}\n\t\t}\n\t\tdealerHand = new BlackjackHandDealer();\n\t}", "public Cards deal() {\n if (!hasMoreCards()) {\n return null;\n } else {\n Cards temp = null;\n temp = deck[cardHold];\n cardHold = cardHold + 1;\n return temp;\n }\n }", "public Card deal()\n\t{\n\t\tif (cards.isEmpty())\n\t\t\treturn null;\n\t\t\n\t\t//Generate a random index to pull a random card from the ordered deck\n\t\tint rand = (int) (Math.random() * cards.size());\n\t\tCard dealt = cards.get(rand);\n\t\t//Remove the pulled card from the deck\n\t\tcards.remove(rand);\n\t\t\n\t\treturn dealt;\n\t}", "@Test\n public void testDeal() {\n System.out.println(\"deal\");\n int players = 2;\n int cardsEach = 10;\n StandardDeck instance = testDeck;\n Card expResult = TWO_OF_CLUBS;\n Map<Integer, Hand> result = instance.deal(players, cardsEach);\n assert(expResult.equals(result.get(1).getCards().get(0)));\n assertEquals(10, result.get(2).size());\n assertNull(result.get(3));\n expResult = new StandardCard(StandardCard.Rank.EIGHT, StandardCard.Suit.DIAMONDS);\n assert(expResult.equals(result.get(2).getCards().get(9)));\n }", "private java.util.List<Card> deal(java.util.List<Card> hand, int numCards) {\n for (int i = 0; i < numCards; ++i) {\n hand.add(removeTop(deck));\n }\n return hand;\n }", "public void prepareTable() {\n \tthis.table = new Tape(this.height,this.width,2,this.map);\n }", "@Override\r\n public List<Card> getDeck() {\n myDeck2.clear();\r\n\r\n //loops through twice in order to create the deck of 104\r\n for (int k = 0; k < 2; k++) {\r\n for (int i = 0; i < 4; i++) {\r\n for (int j = 1; j <= 13; j++) {\r\n Card nextCard = new Card(suit[i], j);\r\n myDeck2.add(nextCard);\r\n }\r\n }\r\n }\r\n\r\n return myDeck2;\r\n }", "public void resetDeck() {\n cards.addAll(removedCards);\n removedCards.clear();\n }", "public void initializeTable(){\n tableData = new Object[cards.size()][8];\n\n for(int i = 0; i < cards.size(); i++){\n Object[] player = tableData[i];\n BsbCard card = cards.get(i);\n\n player[0] = card.getName();\n player[1] = card.getAge();\n player[2] = card.getTeam().getName();\n player[3] = card.getPos().getName();\n\n player[4] = card.getYrsPlayed();\n player[5] = card.getCondition();\n\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < card.getRarity(); j++){\n sb.append(\"\\u2605\");\n }\n player[6] = sb.toString();\n if(card.isTrade()){\n player[7] = \"\\u2714\";\n } else {\n player[7] = \"\\u0078\";\n }\n }\n }", "private void fillDeck(){\r\n this.cards = new ArrayList<Card>();\r\n int cardPerSuit = this.deckSize/4;\r\n \r\n for( Suit Su: suits ){\r\n for(int i = 0; i < cardPerSuit; i++){\r\n this.cards.add(i, new Card(i+2, Su.ordinal()));\r\n }\r\n }\r\n \r\n }", "public void start(Deck deck) {\n\t\tfor(int i = 0; i < this.getNumOfPlayers(); i++) {\n\t\t\tthis.getPlayerList().get(i).removeAllCards();\n\t\t}\n\t\tthis.getHandsOnTable().clear();\n\t\tfor (int i = 0; i < deck.size(); i++) {\n\t\t\tthis.getPlayerList().get(i%getNumOfPlayers()).addCard(deck.getCard(i));\n\t\t\tif (deck.getCard(i).getRank() == 2 && deck.getCard(i).getSuit() == 0) {\n\t\t\t\tcurrentIdx = i % getNumOfPlayers();\n\t\t\t\ttable.setActivePlayer(this.getCurrentIdx());\n\t\t\t}\n\t\t}\n\t\tfirstturn = true;\n\t\ttable.reset();\n\t\ttable.repaint();\n\t\ttable.printMsg(this.getPlayerList().get(this.getCurrentIdx()).getName()+\"'s turn:\\n\");\n\t}", "public Card dealCard() {\n //Return an invalid card if there are no cards in the deck.\n if (this.topCard < 0)\n return new Card('0', Card.Suit.spades);\n else {\n //Create a copy of the card on the top of the deck.\n Card card = new Card(this.cards[this.topCard - 1]);\n //Set the actual card on the top of the deck to null, to destroy it.\n this.cards[this.topCard - 1] = null;\n //The topCard is now one less than it was.\n this.topCard--;\n //return the copy.\n return card;\n }\n }", "public static void deal () {\n //Create a new instance of the Deck class called thisDeck.\n //This is the deck that we will deal from and remove cards from as we go.\n ArrayList<String> thisDeck = Deck.createDeck();\n //Create another new instance of the Deck class called unchangedDeck.\n //This is the deck we will use to check card values. It will remain unchanged.\n ArrayList<String> unchangedDeck = Deck.createDeck();\n\n //Create a variable called numberOfPlayers that we will set to the number entered by the user in the\n //getNumberOfPlayers method.\n int numberOfPlayers = getNumberOfPlayers();\n //Create a new array list where we will store our list of players.\n ArrayList<String> playerPositions = new ArrayList<>();\n playerPositions.add(\"Player One\");\n playerPositions.add(\"Player Two\");\n playerPositions.add(\"Player Three\");\n playerPositions.add(\"Player Four\");\n playerPositions.add(\"Player Five\");\n playerPositions.add(\"Player Six\");\n\n //Create an array called dealtCards where we will track the value of the cards that have been dealt.\n int dealtCards[] = {0, 0, 0, 0, 0, 0};\n\n //This loop will deal cards. We want to run it a number of times equal to the number of players.\n for (int i = 0; i < numberOfPlayers; i++) {\n \n //Create a new instance of the Random class called random that will allow us to select a random\n //index from the deck array list.\n Random random = new Random();\n \n //Create a variable called index that will select a random index from our deck array list.\n int index = random.nextInt(thisDeck.size());\n\n //Create a String variable that will represent a random card. Set it to whichever card is in the position\n //that we just randomly chose in the deck array list.\n String randomCard = thisDeck.get(index);\n\n //Create an int variable that will represent the absolute position of the card in a complete deck.\n //We need to know its original position to calculate its value because we are going to be removing cards\n //from thisDeck. Therefore we set it to its original index in the unchangedDeck array list - its index\n //will represent its score. twoOfSpades = 0, threeOfSpades = 1, aceOfHearts = 52, etc.\n int randomCardPosition = unchangedDeck.indexOf(randomCard);\n\n //Print each players card. Since we started our loop at 0, the player number will end up being i+1.\n System.out.println(\"Player \" + (i + 1) + \"'s card is: \" + randomCard);\n\n //Set the value of dealtCards in the current position to the score of our random card.\n dealtCards[i] = randomCardPosition;\n\n //Remove the card we chose from our deck so that it can not be dealt again.\n thisDeck.remove(randomCard);\n }\n\n //Create a new array called staticDealtCards that will track the starting position of each of our cards.\n //We need to do this because we are going to sort the dealtCards array to figure out a winner, but we need to\n //remember which score belongs to which player.\n int[] staticDealtCards = {0, 0, 0, 0, 0, 0};\n\n //Create a loop that will run a number of times equal to the length of our staticDealtCards array.\n //This will set our staticDealtCards array to the same numbers as our dealtCards array.\n for (int m = 0; m < staticDealtCards.length; m++) {\n staticDealtCards[m] = dealtCards[m];\n }\n\n //This is a bubble sort that will sort our dealtCards array from smallest to largest.\n for (int y = 0; y < dealtCards.length - 1; y++) {\n for (int z = 0; z < dealtCards.length - y - 1; z++) {\n if (dealtCards[z] > dealtCards[z + 1]) {\n int newPosition = dealtCards[z];\n dealtCards[z] = dealtCards[z + 1];\n dealtCards[z + 1] = newPosition;\n }\n }\n }\n\n //Create a new variable called winningCard that will equal the largest number in the array (which is always\n //going to be the number in the 5th position after our sort).\n int winningCard = dealtCards[5];\n\n //Create a loop that will look through all of our dealt cards until it finds the one that is equal to our winning card.\n //Then we will print the winning player and the winning card.\n for (int n = 0; n < dealtCards.length; n++) {\n //If the user was never able to enter a number between 2 and 6 (for example if they entered a character or string,\n //numberOfPlayers will still be set to 0 and we will not have a winner so we don't want to run this loop in that case.\n if (numberOfPlayers < 2) {\n break;\n }\n if (winningCard == staticDealtCards[n]) {\n System.out.println(\"The winner is \" + playerPositions.get(n) + \" with the \" + unchangedDeck.get(winningCard) + \".\");\n }\n }\n\n }", "public void dealHouse() {\n //Deal two cards to the dealer, but keep one hidden\n dealerStack.add(null);\n hiddenCard = talonStack;\n talonStack++;\n\n dealerStack.add(cards[talonStack]);\n dealerScore += evaluateCardScore(dealerScore, cards[talonStack].rank);\n talonStack++;\n }", "public int deal(){\n\t\tint topCard = deck[top];\n\t\ttop--;\n\t\treturn topCard;\n\t}", "public void resetDeck() {\r\n\t\tcards = new ArrayList<Card>();\r\n\t\tfor (Suit f : Suit.values())\r\n\t\t\tfor (int i = 2; i < 15; i++)\r\n\t\t\t\tcards.add(new Card(i, f));\r\n\r\n\t}", "private void addCards(){\n\t\tDeck deck = new BasicDeckBuilder().getDeck();\r\n\t\tTabletop table = new Tabletop(deck);\r\n\t\tcardtable.getChildren().addAll(table);\r\n\t\tAnchorPane.setTopAnchor(table, 30.0);\r\n\t\tAnchorPane.setBottomAnchor(table, 30.0);\r\n\t\tAnchorPane.setLeftAnchor(table, 30.0);\r\n\t\tAnchorPane.setRightAnchor(table, 30.0);\r\n\t}", "public void dropTable();", "@SuppressWarnings(\"unchecked\")\n private void createTable() {\n table = (LinkedList<Item<V>>[])new LinkedList[capacity];\n for(int i = 0; i < table.length; i++) {\n table[i] = new LinkedList<>();\n }\n }", "ICard deal();", "public void doDropTable();", "@Override\n public void createDeck(){\n for (char suit:standardSuits) {\n for (Map.Entry<Character, Integer> item:deckCards.entrySet()) {\n Card card = new Card(item.getKey(),item.getValue(),suit);\n deckOfCards.add(card);\n }\n }\n }", "public Card deal() {\r\n if (this.cardsLeft == 0) {\r\n return null;\r\n }\r\n \r\n// In the event that there are no cards left, a null value is returned\r\n \r\n Card topOfDeck = cardDeck[this.cardsLeft-1]; \r\n this.cardsLeft--;\r\n return topOfDeck;\r\n \r\n// The card off of the top of the deck is returned and the amount of cards remaining is deincremented\r\n \r\n }", "public void RefillDeck()\n\t{\n\t\tRefillDeck(false);\n\t}", "public static void UpdateCardsTable() {\n\t\tString url = null;\n\t\tString cards = null;\n\n\t\ttry {\n\t\t\tfor (int i = 0; i < Config.getHundredsOfCardsAvailable(); i++) {\n\t\t\t\turl = \"https://contentmanager-lb.interact.io/content-cards/search?offset=\" + i * 100 + \"&limit=100\";\n\t\t\t\t// hard-set limit of Content Manager is 100 cards\n\t\t\t\tcards = Requester.sendPostRequest(url);\n\n\t\t\t\tString id;\n\t\t\t\tString metaDataContentType;\n\n\t\t\t\tfor (int cardIndex = 0; cardIndex < 100; cardIndex++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (isCardToBeAdded(cards, cardIndex)) {\n\t\t\t\t\t\t\tid = JsonPath.parse(cards).read(\"$.data.[\" + cardIndex + \"].id\");\n\t\t\t\t\t\t\tmetaDataContentType = JsonPath.parse(cards)\n\t\t\t\t\t\t\t\t\t.read(\"$.data.[\" + cardIndex + \"].metadata.contentType\");\n\t\t\t\t\t\t\t// Logger.print(id);\n\t\t\t\t\t\t\t// Logger.print(metaDataContentType);\n\t\t\t\t\t\t\tString labeledCardTag = metaDataContentType.replaceAll(\" \", \"_\").toLowerCase();\n\t\t\t\t\t\t\t// TODO if this tag isn't already in cards table, add it as a new column\n\t\t\t\t\t\t\taddCardToTable(id, labeledCardTag);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// FIXME don't ignore exception here... it's bad practice\n\t\t\t\t\t\t// TODO make it so that JsonPath only checks up until there are cards\n\t\t\t\t\t\t// e.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void resetTable() {\n\t\tif (table != null) {\n\t\t\ttable.removeAll();\n\t\t}\n\t}", "public void dealCardsToPile()\n {\n // Set the first initial computer card to display\n computerCard = highCardGame.getCardFromDeck();\n\n // Sets the first initial player card\n playerCard = highCardGame.getCardFromDeck();\n }", "public Card dealCard() {\n\t\tsize--;\n\t\t//return deck.pop();\n\t\tCard card = deck.pop();\n\t\tint rank = card.getRank();\n\t\t\n\t\t// Adjust total count accordingly\n\t\tif ((rank >= 2) && (rank <= 6)) {\n\t\t\ttotal_count++;\n\t\t}\n\t\telse if ((rank >= 10) || (rank == 1)) {\n\t\t\ttotal_count--;\n\t\t}\n\t\t\n\t\treturn card;\n\t}", "private void Deal(Player player, Dealer dealer) {\n\n //Adds the top card of the deck to each player's hand 1 at a time.\n for (int i = 0; i < 2; i++) {\n player.getHand().add(player.TakeTopCard(deck));\n dealer.getHand().add(dealer.TakeTopCard(deck));\n }\n //Displays the top card of the dealer's hand\n dealer.ShowTopCard(dealer.getHand());\n }", "public static void resetTable() {\n tableModel.resetDefault();\n updateSummaryTable();\n }", "@Override\r\n public void fillDealerDeckPlayingCards(int deckPosition){\r\n\r\n for(int i = 0; i < 4; i ++){\r\n for(int j = 0; j < 13; j ++){\r\n this.dealer.addCard(deckPosition, new PlayingCard(i,j)); \r\n }\r\n }\r\n System.out.println(\"Deck Filled\");\r\n }", "public void deal() {\n\n\t}", "public void deal() {\n\n\t}", "public void deal() {\n\n\t}", "public void dealerTurn() {\n //Uncover hidden card\n dealerStack.set(0, cards[hiddenCard]);\n dealerScore += evaluateCardScore(dealerScore, cards[hiddenCard].rank);\n\n //Deal cards until dealer blackjack, bust, or score is greater than players\n while ((dealerScore < playerScore) && (dealerScore < 17) && (playerScore <= 21)) {\n //Add a new card to the dealer deck\n dealerStack.add(cards[talonStack]);\n\n //Increment the score based on the new card\n dealerScore = evaluateDeckScore(dealerStack);\n\n //Increment the counter for the talon deck\n talonStack++;\n }\n\n }", "public Deck() {\n System.out.println(\"Inside deck\");\n cards = new ArrayList<>();\n fillDeck();\n }", "public List<Card> cardsOnTable()\r\n\t{\r\n\t\treturn this.onTable;\r\n\t}", "public void createNewTable() {\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS card (\\n\"\n + \" id INTEGER PRIMARY KEY AUTOINCREMENT,\\n\"\n + \" number TEXT,\\n\"\n + \" pin TEXT,\\n\"\n + \" balance INTEGER DEFAULT 0\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(url);\n Statement stmt = conn.createStatement()) {\n // create a new table\n stmt.execute(sql);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public void play(int[] handSize, Table table){\n\t\t\n\t\tTable copyTable = new Table();\n\t\tcopyTable = table;\n\t\t\n\t\tboolean canPlay = false;\n\t\t//ArrayList<Tile> melds = table.getMelds();\n\t\t\n\t\t//ArrayList<Meld> copyMelds = (ArrayList<Tile>)table.getMelds().clone();\n\t\tArrayList<Tile> copyHand =(ArrayList<Tile>)hand.clone();\n\t\t//ArrayList<Meld> copyTable = (ArrayList<Meld>)melds.clone();\n\t\t\n\t\t//makeMeldsOnlyInHand(copyHand, copyTable);\n\t\t//makeMeldBetweenHandAndTable(copyHand, copyTable);\n\t\t\n\t\t/*System.out.println(\"copyhand\" + copyHand.toString());\n\t\tSystem.out.println(\"copyTable\" + copyTable.toString());\n\t\t*/\n\t\t\n\t\tif(copyHand.isEmpty()){\n\t\t\tcanPlay = canMakeMeldsOnlyInHand(hand, table);\n\t\t\tcanPlay = makeMeldBetweenHandAndTable(hand, table);\n\t\t\tSystem.out.println(hand.toString());\n\t\t}else {\n\t\t\t//if someone has 3 tiles more than p3\n\t\t\tif(!hasALessHand(handSize)) {\n\t\t\t\t//p3 can plays only the tiles of its hand that require using tiles on the table to make melds\n\t\t\t\tcanPlay = makeMeldBetweenHandAndTable(hand, table);\n\t\t\t}else {\n\t\t\t\tcanPlay = canMakeMeldsOnlyInHand(hand, table);\n\t\t\t}\n\t\t}\n\t\tif(canPlay == false) {\n\t\t\tplayer.drawTile(hand,table);\n\t\t}\n\t}", "protected void createTable() {\n table = (MapEntry<K, V>[]) new MapEntry[capacity]; // safe cast\n }", "public Card dealCard(Player player) {\n\t\tCard card = null;\n\t\tif (dealtCards.get() < DECK_SIZE) { // Check if deck still has cards available. \n\t\t\tcard = cards.get(dealtCards.getAndIncrement());\n\t\t\tif (card != null) { // If card has been found.\n\t\t\t\tplayer.addCard(card);\n\t\t\t\tAtomicInteger cardsBySuit = dealtCardsBySuit.get(card.getSuit());\n\t\t\t\tcardsBySuit.getAndIncrement(); // Update cards by suit counters.\n\t\t\t}\n\t\t}\n\t\treturn card;\n\t}", "public Deck() {\n generateDeckOfCards();\n }", "public void dealPlayer() {\n //Deal two cards to the player\n playerStack.add(cards[talonStack]);\n playerScore += evaluateCardScore(playerScore, cards[talonStack].rank);\n talonStack++;\n\n playerStack.add(cards[talonStack]);\n playerScore += evaluateCardScore(playerScore, cards[talonStack].rank);\n talonStack++;\n }", "public void dealInitialPlayerHands() {\n\t\tint temp = 0;\n\t\tSystem.out.println(\"This is the deck size before dealing: \" + this.tileDeck.deckSize());\n\t\tSystem.out.println(\"_______________________________________________\");\n\t\tfor (Player p : this.playerList) {\n\t\t\ttemp++;\n\t\t\tfor (int i = 0; i < 14; i ++) {\n\t\t\t\tp.hand.add(this.tileDeck.dealTile());\n\t\t\t}\n\t\t\tp.sort();\n\t\t\tSystem.out.println(\"Player \" + temp + \"'s hand: \" + p.getHandTiles());\n\t\t\tSystem.out.println(\"_______________________________________________\");\n\t\t}\n\t\t//System.out.println(this.tileDeck.deckSize());\n\t}", "private void changeToScanTable() {\n\t\tswitch (fileType) {\n\t\tcase INVENTORY:\n\t\t\ttableView.setItems(presentationInventoryData);\n\t\t\tbreak;\n\t\tcase INITIAL:\n\t\t\ttableView.setItems(presentationInitialData);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttableView.getColumns().clear();\n\t\t\tbreak;\n\t\t} // End switch statement\n\t}", "public void fillDeck()\n {\n //start with an empty card at the 2 of clubs\n Card c = new Card(); \n int s = c.CLUB;\n int r = c.MIN_RANK;\n\n while (s <= c.SPADE)\n {\n while (r <= c.ACE)\n {\n Card dealing = new Card(s, r); \n dealer.enqueue(dealing); \n r++; \n }\n \n s++; \n r = c.MIN_RANK; \n }\n }", "@Test\r\n public void testCustomDeal() {\n Game g = new Game();\r\n g.deck = new Deck();\r\n g.customDeal(0, 3, 6, 9);\r\n assertEquals(\"2Clubs\",g.columns.get(0).cards.get(0).toString());\r\n assertEquals(\"3Clubs\",g.columns.get(1).cards.get(0).toString());\r\n assertEquals(\"4Clubs\",g.columns.get(2).cards.get(0).toString());\r\n assertEquals(\"5Clubs\",g.columns.get(3).cards.get(0).toString());\r\n }", "public void fillMyGoodsTable() {\n\t\tHashMap<Goods, Integer> myGoods = ship.getMyGoods();\n\t\tDefaultTableModel model = (DefaultTableModel)this.myGoodsTable.getModel();\n\t\tint number = 1;\n\t\tfor (HashMap.Entry<Goods, Integer> set: myGoods.entrySet()) {\n\t\t\tString name = set.getKey().getName();\n\t\t\tint quantity = set.getKey().getQuantityOwned();\n\t\t\tint price = set.getValue();\n\t\t\tmodel.addRow(new Object [] {number, name, quantity, price});\n\t\t\tnumber++;\n\t\t}\n\t}", "public Card dealCard() {\n int randPos = random.nextInt(51 - 0 + 1);\n Card rand = deck[randPos];\n return rand;\n\n }", "void makeDeck() {\n\t\t// start with an array of 1..28 for easy shuffling\n\t\tint[] cardValues = new int[28];\n\t\t// assign values from 1 to 28\n\t\tfor (int i=0; i < cardValues.length; i++) {\n\t\t\tcardValues[i] = i+1;\n\t\t}\n\n\t\t// shuffle the cards\n\t\tRandom randgen = new Random();\n\t\tfor (int i = 0; i < cardValues.length; i++) {\n\t\t\tint other = randgen.nextInt(28);\n\t\t\tint temp = cardValues[i];\n\t\t\tcardValues[i] = cardValues[other];\n\t\t\tcardValues[other] = temp;\n\t\t}\n\n\t\t// create a circular linked list from this deck and make deckRear point to its last node\n\t\tCardNode cn = new CardNode();\n\t\tcn.cardValue = cardValues[0];\n\t\tcn.next = cn;\n\t\tdeckRear = cn;\n\t\tfor (int i=1; i < cardValues.length; i++) {\n\t\t\tcn = new CardNode();\n\t\t\tcn.cardValue = cardValues[i];\n\t\t\tcn.next = deckRear.next;\n\t\t\tdeckRear.next = cn;\n\t\t\tdeckRear = cn;\n\t\t}\n\t}", "private void populateTable() {\n \n DefaultTableModel dtm = (DefaultTableModel) tblAllCars.getModel();\n dtm.setRowCount(0);\n \n for(Car car : carFleet.getCarFleet()){\n \n Object[] row = new Object[8];\n row[0]=car.getBrandName();\n row[1]=car.getModelNumber();\n row[2]=car.getSerialNumber();\n row[3]=car.getMax_seats();\n row[4]=car.isAvailable();\n row[5]=car.getYearOfManufacturing();\n row[6]=car.isMaintenenceCerticateExpiry();\n row[7]=car.getCity();\n \n dtm.addRow(row);\n \n }\n }", "public int dealCard() {\n\n\t\tif (currentPosition == 52) {\n\t\t\tshuffle();\n\t\t}\n\t\tcurrentPosition++;\n\t\treturn deck[currentPosition - 1];\n\t}", "public void initGame() {\n // Create a new deck, with the right numbers of cards and shuffle it.\n this.deck.clear();\n this.deck.init();\n\n // Init all the players.\n for (Player player : this.players.values()) {\n player.init();\n }\n\n // Give START_NUM_CARD to each players.\n for (int i = 0; i < START_NUM_CARD; i++) {\n for (Player player : this.players.values()) {\n player.addCard(this.deck.pop());\n }\n }\n\n // Reset vars\n this.table.clear();\n this.onTableAmount = 0;\n this.numTurns = 0;\n this.newTurn = false;\n this.numPlayerInTurn = 0;\n this.currentPlayer = this.startingGamePlayer;\n\n // Subtract the blind to each players.\n this.players.get(this.currentPlayer).addToTable(this.currentSmallBlind);\n this.addOnTableAmount(this.currentSmallBlind);\n for (int i = 0; i < this.playerAmount; i++) {\n if (!(i == this.currentPlayer)) {\n this.players.get(i).addToTable(this.currentSmallBlind * 2);\n this.addOnTableAmount(this.currentSmallBlind * 2);\n }\n }\n this.currentHighestPlayerBet = currentSmallBlind * 2;\n\n // Add the first 3 cards.\n for (int i = 0; i < 3; i++) {\n this.table.push(this.deck.pop());\n }\n\n // Increment numTurns\n this.numTurns++;\n this.numGame++;\n }" ]
[ "0.5949106", "0.5946713", "0.5899441", "0.5846753", "0.58383924", "0.5826058", "0.58257776", "0.58129877", "0.5796115", "0.57738906", "0.57240283", "0.5716875", "0.5674992", "0.56350666", "0.562432", "0.56077343", "0.5606883", "0.5538377", "0.55191183", "0.549962", "0.547814", "0.54564166", "0.5450605", "0.5449675", "0.54363734", "0.5429869", "0.5424482", "0.542235", "0.5416296", "0.5414224", "0.54072577", "0.5346554", "0.53335637", "0.5289627", "0.5265733", "0.5265686", "0.526353", "0.52623653", "0.5259724", "0.52527", "0.5248837", "0.523306", "0.52323806", "0.5198857", "0.51879776", "0.51815695", "0.5167268", "0.5162267", "0.5146905", "0.514594", "0.513066", "0.51234406", "0.5118439", "0.51181924", "0.51143336", "0.5106231", "0.51018864", "0.5098185", "0.509777", "0.50953484", "0.5088076", "0.5084661", "0.5075434", "0.50663185", "0.50657195", "0.5064988", "0.50647277", "0.50599724", "0.50534886", "0.5051791", "0.50495106", "0.50401956", "0.50365895", "0.5033592", "0.5031222", "0.5021908", "0.49923006", "0.4981155", "0.497567", "0.497567", "0.497567", "0.49472448", "0.49321628", "0.49321058", "0.49293056", "0.49203682", "0.4919127", "0.490984", "0.4907468", "0.49056062", "0.48846725", "0.48832437", "0.48820704", "0.48781708", "0.48746544", "0.4872401", "0.48715082", "0.4870429", "0.4861538", "0.48607504" ]
0.8226038
0
The cardsOnTable instance method is used to get the list of cards currently on the table.
public List<Card> cardsOnTable() { return this.onTable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Card> getCards() {\n return new ArrayList<Card>(cards);\n }", "@Override\n\tpublic List<Card> findAllCard() {\n\t\treturn cb.findAllCard();\n\t}", "public List<Card> getCards(){\r\n\t\treturn cards;\r\n\t}", "public List<Card> findAllCards();", "public List<Card> getCards() {\n\t\treturn cards;\n\t}", "@JsonIgnore\n\tpublic List<Card> getAvailableCards() {\n\t\tList<Card> availableCards = new ArrayList<>();\n\t\tfor (int i = dealtCards.get(); i < Deck.DECK_SIZE; i++) {\n\t\t\tCard card = cards.get(i);\n\t\t\tavailableCards.add(card);\n\t\t}\n\t\treturn availableCards;\n\t}", "public List<Card> getCards()\n {\n return this.deckOfCards;\n }", "public List<Card> getCards() throws RemoteException {\n return mainScreenProvider.getCards();\n }", "public ArrayList<Card> getCards() {\n\n return cards;\n }", "public List<Card> list();", "List<Card> getCards() {\n return cards;\n }", "public List<Card> getCards() {\n\t\treturn new ArrayList<Card>(this.content);\n\t}", "public List<AbstractCard> cards();", "public ArrayList<VentraCard> getAllCards(){\n \treturn allCards;\n }", "public ArrayList<Card> getCards()\n\t{\n\t\treturn cards;\n\t}", "public ArrayList<Card> getCards() {return cards;}", "public Cards getCards() {\r\n\t\treturn cards;\r\n\t}", "public Card getAllCards() {\n\t\tfor (Card cardInDeck : cards) {\n\t\t\tSystem.out.println(\"Rank: \" + cardInDeck.getRank() + \"\\n\"\n\t\t\t\t\t+ \"Suit: \" + cardInDeck.getSuit()+ \"\\n\");\n\t\t\t//System.out.println(i++);\n\t\t}\n\t\treturn null;\n\t}", "public ArrayList<Card> getCards(){\n return this.cards;\n }", "ObservableList<Card> getCardList();", "public List<List<GameCard>> getPlayerCardsList() {\n return this.playerCardsList;\n }", "@Override\n\tpublic Cards getCards() {\n\t\treturn cards;\n\t}", "public List<Card> getCardsInPlay() {\n List<Card> cards = new ArrayList<>(cardsInPlayStack);\n cardsInPlayStack.removeAllElements();\n return cards;\n }", "public List<Card> getCards()\n {\n // RETURN the CardMessage's list of <code>ClueCards</code>\n return this.cards;\n }", "public ArrayList<Card> getCurrentCards() {\r\n return currentCards;\r\n }", "public int[] getCards() {\n \t\treturn cards;\n \t}", "public List<Card> getCards(){\n\t\treturn this.pile;\n\t}", "public ArrayList<Card> getCards(){\r\n return cards;\r\n }", "public List<Card> getVegasDeckCardList(){\n return vegasDeckCardList;\n }", "public ArrayList<Card> getPlayedCards()\n\t{\n\t\treturn playedCards;\n\t}", "public synchronized List<Card> getCardsInPlay(){\n cardsInPlay.clear();\r\n \r\n for(Player player: players){\r\n if(player == null){\r\n continue;\r\n }\r\n if(player.getCardsInHand().isEmpty()){\r\n continue;\r\n }\r\n for(Card card: player.getCardsInHand()){\r\n cardsInPlay.add(card);\r\n }\r\n }\r\n return cardsInPlay;\r\n }", "public static void UpdateCardsTable() {\n\t\tString url = null;\n\t\tString cards = null;\n\n\t\ttry {\n\t\t\tfor (int i = 0; i < Config.getHundredsOfCardsAvailable(); i++) {\n\t\t\t\turl = \"https://contentmanager-lb.interact.io/content-cards/search?offset=\" + i * 100 + \"&limit=100\";\n\t\t\t\t// hard-set limit of Content Manager is 100 cards\n\t\t\t\tcards = Requester.sendPostRequest(url);\n\n\t\t\t\tString id;\n\t\t\t\tString metaDataContentType;\n\n\t\t\t\tfor (int cardIndex = 0; cardIndex < 100; cardIndex++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (isCardToBeAdded(cards, cardIndex)) {\n\t\t\t\t\t\t\tid = JsonPath.parse(cards).read(\"$.data.[\" + cardIndex + \"].id\");\n\t\t\t\t\t\t\tmetaDataContentType = JsonPath.parse(cards)\n\t\t\t\t\t\t\t\t\t.read(\"$.data.[\" + cardIndex + \"].metadata.contentType\");\n\t\t\t\t\t\t\t// Logger.print(id);\n\t\t\t\t\t\t\t// Logger.print(metaDataContentType);\n\t\t\t\t\t\t\tString labeledCardTag = metaDataContentType.replaceAll(\" \", \"_\").toLowerCase();\n\t\t\t\t\t\t\t// TODO if this tag isn't already in cards table, add it as a new column\n\t\t\t\t\t\t\taddCardToTable(id, labeledCardTag);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// FIXME don't ignore exception here... it's bad practice\n\t\t\t\t\t\t// TODO make it so that JsonPath only checks up until there are cards\n\t\t\t\t\t\t// e.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic List<CreditCard> findAll() {\n\t\treturn this.cardList;\r\n\t\t\r\n\t}", "@GetMapping(\"/cards\")\n List<StarbucksCard> all() {\n return repository.findAll();\n }", "public ArrayList<TACardInfo> getCardList() {\n synchronized (cardInfoListLock) {\n ArrayList<TACardInfo> cardInfoList = new ArrayList<>();\n if (cardInfoListCache == null) {\n try {\n cardInfoListCache = getCardListFromTa();\n LogC.i(\"cardInfoListCache is null, refresh\", false);\n } catch (WalletTaException.WalletTaSystemErrorException e) {\n LogC.e(\"WalletTaManager get tacardList erro,errorCode=\" + e.getCode(), false);\n return null;\n }\n }\n if (cardInfoListCache != null) {\n if (cardInfoListCache.size() != 0) {\n Iterator<TACardInfo> it = cardInfoListCache.iterator();\n while (it.hasNext()) {\n cardInfoList.add(it.next().clone());\n }\n return cardInfoList;\n }\n }\n }\n }", "@GetMapping(\"/startRound/{gameId}/{UID}/cards\")\n public List<Ycard> getCurrentCardsForUser() {\n return new ArrayList<Ycard>();\n }", "public ArrayList<Item> getAllCards()\n {\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor res = db.rawQuery( \"SELECT * FROM \" + CARDS_TABLE_NAME + \" ORDER BY \" + CARDS_COLUMN_NAME + \" COLLATE NOCASE\", null );\n res.moveToFirst();\n\n while(res.isAfterLast() == false){\n card = new Item();\n card.setItemId(res.getInt(res.getColumnIndex(CARDS_COLUMN_ID)));\n card.setItemName(res.getString(res.getColumnIndex(CARDS_COLUMN_NAME)));\n card.setItemCategory(res.getString(res.getColumnIndex(CARDS_COLUMN_CATEGORY)));\n card.setItemFormat(res.getString(res.getColumnIndex(CARDS_COLUMN_FORMAT)));\n card.setItemNumber(res.getString(res.getColumnIndex(CARDS_COLUMN_NUMBER)));\n items.add(card);\n res.moveToNext();\n }\n return items;\n }", "public Color[] getCards() {\n\t\treturn cards;\n\t}", "public ArrayList<Card> getHand(){\n return cards;\n }", "@Override\n\tpublic PlayingCard[] getCards() {\n\t\tif(getCount() != 0) {\n\t\t\tPlayingCard[] kopie = new SkatCard[getCount()];\n\t\t\tfor(int i = 0; i < getCount(); i++) {\n\t\t\t\tkopie[i] = new SkatCard(aktuellesDeck[i].getSuit(), aktuellesDeck[i].getRank());\n\t\t\t}\n\t\t\treturn kopie;\n\t\t}else {\n\t\t\tSystem.out.println(\"Stapel leer --> Kopie vom Stapel leer\");\n\t\t\treturn null;\n\t\t}\n\t}", "public ArrayList<Card> getPlayableCards(Player p) {\n ArrayList<Card> playableCards;\n\t if (gameLogic.getLeadSuitCard() == null) {\n\t playableCards = p.getPlayableHand(null, gameLogic.getTrumpCard().getSuit());\n\t System.out.println(playableCards);\n\t System.out.println(\"Player's playable Cards: \" + p.getPlayableHand(null, gameLogic.getTrumpCard().getSuit()));\n\t } else {\n\t playableCards = p.getPlayableHand(gameLogic.getLeadSuitCard().getSuit(), gameLogic.getTrumpCard().getSuit());\n\t System.out.println(\"Player's playable Cards: \" + p.getPlayableHand(gameLogic.getLeadSuitCard().getSuit(),\n\t gameLogic.getTrumpCard().getSuit()));\n\t }\n\n\t return playableCards;\n\t}", "public com.google.protobuf.ByteString getCards() {\n return cards_;\n }", "public List<Card> getCardsOf(Long idGame, Long idPlayer){\n Game game = this.getGameById(idGame);\n\n if(game == null) {\n return null;\n }\n\n List<Player> players = game.getPlayers();\n for(Player player : players) {\n if(idPlayer.equals(player.getPlayer_identifier())) {\n return player.getCards();\n }\n }\n\n return null;\n }", "public com.google.protobuf.ByteString getCards() {\n return cards_;\n }", "private void dealToTable()\r\n\t{\r\n\t\tthis.onTable.clear();\r\n\t\tif(this.deck.size() >= Config.TableCards)\r\n\t\t{\r\n\t\t\tthis.onTable.addAll(this.deck.subList(0, Config.TableCards));\r\n\t\t\tthis.deck = this.deck.subList(Config.TableCards, this.deck.size());\r\n\t\t}\r\n\t}", "public List<Card> getcardbyuser(String user_id);", "public ArrayList<Cards> getSeedCards() {\r\n\t\treturn seedCards;\r\n\t}", "public Collection<Card> getCopyOfCardsList() {\n\t\treturn new ArrayList<>(cards);\n\t}", "public Iterator<CardView> iterator() {\n return cards.iterator();\n }", "public ArrayList<Card> getCardsInHand(){\n\t\tCollections.sort(CardsInHand, Card.CardRank);\r\n\t\treturn CardsInHand;\r\n\t}", "private Set<Node> getAllCardNodes() {\n return guiRobot.lookup(CARD_PANE_ID).queryAll();\n }", "public String getCards()\r\n\t{\r\n\t\t// creates a larger string which will have the cards appended to it\r\n\t\tString cardList = \"\";\r\n\t\t\r\n\t\t// adds all cards currently in hand\r\n\t\tfor (int i = 0; i < handCount; i++)\r\n\t\t{\r\n\t\t\tcardList = cardList + pCards[i] + \" \";\r\n\t\t}\r\n\t\t\r\n\t\treturn cardList;\r\n\t}", "private void addCards(){\n\t\tDeck deck = new BasicDeckBuilder().getDeck();\r\n\t\tTabletop table = new Tabletop(deck);\r\n\t\tcardtable.getChildren().addAll(table);\r\n\t\tAnchorPane.setTopAnchor(table, 30.0);\r\n\t\tAnchorPane.setBottomAnchor(table, 30.0);\r\n\t\tAnchorPane.setLeftAnchor(table, 30.0);\r\n\t\tAnchorPane.setRightAnchor(table, 30.0);\r\n\t}", "@Query(\"SELECT * FROM FlashCards\")\n List<FlashCards> getCards();", "public ArrayList<Card> giveAllCards() {\n\t\tArrayList<Card> temp = new ArrayList<Card>();\n\t\ttemp.addAll(cards);\n\t\tcards.clear();\n\t\ttopCard = new Card();\n\t\treturn temp;\n\t}", "private ArrayList<Card> getDeckCards(){\n\t\t\t\tArrayList<Card> getdeck = new ArrayList<>();\r\n\t\t\t\t// deck = new ArrayList(52);\r\n\r\n\t\t\t\t// create cards in the deck (0-51)\r\n\t\t\t\tfor (int i = 0; i <= 10; i++) {\r\n\t\t\t\t\tgetdeck.add(new Card(i));\r\n\t\t\t\t}\r\n\t\t\t\t//Collections.shuffle(getdeck);\r\n\t\t\t\t// shuffle the cards\r\n\t\t\t\tfor (int i = 0; i <= getdeck.size()-1; i++) {\r\n\t\t\t\t\tint newindex = (int) (Math.random() * 51);\r\n\t\t\t\t\tCard temp = getdeck.get(i);\r\n\t\t\t\t\tgetdeck.set(i, getdeck.get(newindex));\r\n\t\t\t\t\tgetdeck.set(newindex, temp);\r\n\t\t\t\t}\r\n\t\t\t\t//TODO delete println\r\n\t\t\t\t// print shuffled deck\r\n\t\t\t\tfor (int i = 0; i <= getdeck.size()-1; i++) {\r\n\t\t\t\t\tSystem.out.println(getdeck.get(i).getCardNbr());\r\n\t\t\t\t}\r\n\t\t\t\treturn getdeck;\r\n\t}", "private ArrayList<Card> getCurrentTopCards() {\n // logic to get round cards from all players\n ArrayList<Card> currentTopCards = new ArrayList<>();\n for (Player player : players) {\n player.submitActiveCard(currentTopCards);\n }\n return currentTopCards;\n }", "public ArrayList<ActionCards> getActionCardDeck(){\n\t\treturn actionCardDeck;\n\t}", "public ArrayList<card> displayPack()\n {\n dbObj=new dbFlashCards(uid);\n return dbObj.fetchAllCards(packId);\n \n \n \n }", "public CardInfo[] getCardInfo() {\n return cardInfo;\n }", "@Override\n public List<MemCard> queryAllCardInfo(IRequest request, Long memberId) {\n List<MemCard> cards = cardMapper.selectAllBankByMemberId(memberId);\n return cards;\n }", "public Card[] GetCards() { return mCard; }", "public Card getCard(){\n return cards.get(0);\n }", "public ArrayList<Card> peek() {\n return this.cards;\n }", "void displayCards(List<Card> cards, String title);", "public void showCards() {\n\t\tfor(int i=0;i<cards.size();i++) {\n\t\t\tSystem.out.println(cards.get(i).toString());\n\t\t}\n\t}", "public List<Card> getCards(CardType type) {\n List<Card> cards = new ArrayList<>();\n for (Card card : this) {\n if (card.getCardType() == type) {\n cards.add(card);\n }\n }\n return cards;\n }", "ObservableList<Flashcard> getFlashcardList();", "public ArrayList<PlayingCard> getHand();", "public Card [] getCards() {\r\n Card [] cardDeckCopy = new Card [this.cardsLeft];\r\n \r\n // A copy of the cardDeck is made of the size of the remaining cards so that the private attribute is not directly\r\n // affected\r\n \r\n for (int index = 0; index < this.cardsLeft; index++) {\r\n cardDeckCopy [index] = cardDeck [index];\r\n }\r\n return cardDeckCopy;\r\n }", "public Deck getDeck(){\r\n\t\t return cards;\r\n\t }", "public ArrayList<Card> getDeck()\n {\n return deck;\n }", "public ArrayList<Card> getDeck() {\n return deck;\n }", "public int numOfCards() {\n return cards.size();\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<CardIssue> getCardDetailList(String cardNo) {\r\n\t\treturn (List<CardIssue>)getHibernateTemplate().find(\"FROM CardIssue WHERE status='Active' and cardNo = ?\",cardNo);\r\n\t}", "public int getTotalCards() {\n\t\treturn cards.size();\n\t}", "public CardStack getAvailableCards()\n {\n return null;\n }", "private TableView<Card> createCardView(){\n TableView<Card> table = new TableView<>();\n\n //url / name column\n TableColumn<Card, Hyperlink> urlColumn = new TableColumn<>(\"Name\");\n urlColumn.setCellValueFactory(new PropertyValueFactory<>(\"pictureLink\"));\n urlColumn.setMinWidth(400);\n\n //cmc column\n TableColumn<Card, String> manaCostColumn = new TableColumn<>(\"Cost\");\n manaCostColumn.setMinWidth(30);\n manaCostColumn.setCellValueFactory(new PropertyValueFactory<>(\"manaCost\"));\n\n //type column\n TableColumn<Card, String> typeColumn = new TableColumn<>(\"Type\");\n typeColumn.setMinWidth(50);\n typeColumn.setCellValueFactory(new PropertyValueFactory<>(\"type\"));\n\n table.getColumns().addAll(urlColumn, manaCostColumn, typeColumn);\n table.setMinSize(600, 250);\n table.setStyle(\"-fx-selection-bar: NavajoWhite; -fx-selection-bar-non-focused: NavajoWhite;\");\n\n return table;\n }", "public void retrieveCardInventoryList() {\n try {\n systemResultViewUtil.setCardInventoryDataBeansList(cardInventoryTransformerBean.retrieveAllCardInventory());\n System.out.println(\"Retrive CardInventory Successfully\");\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"Error in Retrive CardInventory\");\n }\n }", "public void display(){\r\n for(Card c: cards){\r\n System.out.println(c);\r\n }\r\n }", "public ArrayList<MainCard> getMainCards() {\n\t\treturn this.mainCards;\n\t}", "public List<Map<String, Integer>> getTopCards() {\n return topCards;\n }", "public void getCardsShown(List<Room> roomList) {\n\n //Removes cards that are now in the view\n cardHolder.getChildren().clear();\n\n for (Room r : roomList) {\n HBox roomCard = roomCards.get(r.getRoomId().get());\n cardHolder.getChildren().add(roomCard);\n }\n\n\n }", "public DevCard[][] getUpperDevCardsOnTable(){\n DevCard[][] cardsOnTable = new DevCard[4][3];\n for(int i=0;i<4;i++){\n for(int j=0; j<3;j++){\n if (!devDecksOnTable[i][j].littleDevDeck.isEmpty())\n cardsOnTable[i][j]= devDecksOnTable[i][j].littleDevDeck.get(0);\n }\n }\n return cardsOnTable;\n }", "public void initializeTable(){\n tableData = new Object[cards.size()][8];\n\n for(int i = 0; i < cards.size(); i++){\n Object[] player = tableData[i];\n BsbCard card = cards.get(i);\n\n player[0] = card.getName();\n player[1] = card.getAge();\n player[2] = card.getTeam().getName();\n player[3] = card.getPos().getName();\n\n player[4] = card.getYrsPlayed();\n player[5] = card.getCondition();\n\n StringBuilder sb = new StringBuilder();\n for(int j = 0; j < card.getRarity(); j++){\n sb.append(\"\\u2605\");\n }\n player[6] = sb.toString();\n if(card.isTrade()){\n player[7] = \"\\u2714\";\n } else {\n player[7] = \"\\u0078\";\n }\n }\n }", "void showcards() {\n \tfor(String card: mycards){\n \t\tSystem.out.println(\"My card is \" + card);\n \t\t}\n\t}", "public CardCollection() {\n cards = new ArrayList<>();\n }", "public CardSet getCardSet() {\n return cardSet;\n }", "@Override\r\n public List<Card> getDeck() {\n myDeck2.clear();\r\n\r\n //loops through twice in order to create the deck of 104\r\n for (int k = 0; k < 2; k++) {\r\n for (int i = 0; i < 4; i++) {\r\n for (int j = 1; j <= 13; j++) {\r\n Card nextCard = new Card(suit[i], j);\r\n myDeck2.add(nextCard);\r\n }\r\n }\r\n }\r\n\r\n return myDeck2;\r\n }", "private List<Card> createDeck(){\n List<Card> newDeck= new ArrayList<Card>();\n for (int i =0;i<CardSet.ALL_CARDS.size(); ++i ) {\n newDeck.add(CardSet.ALL_CARDS.get(i));\n }\n return newDeck;\n }", "public List<LcMain> listCards(Short status) {\n List<LcMain> list;\n //String sql = \"SELECT distinct(l.lcid), l.* FROM lc_main l, lc_cad c WHERE l.lcid=c.lcid\";\n //same result, but faster\n String where = \"\";\n if (status != null) {\n where = \"WHERE l.status=\" + status;\n }\n String sql = \"SELECT distinct(l.lcid), l.* \" + where + \" FROM lc_main l JOIN lc_cad c on l.lcid=c.lcid\";\n\n Log.finer(LifeCARDAdmin.class.getName() + \":listCards():sql=\" + sql);\n Query query = em.createNativeQuery(sql, LcMain.class);\n try {\n list = query.getResultList();\n } catch (PersistenceException pe) {\n Log.warning(LifeCARDAdmin.class.getName() + \":listCards():\" + pe.getMessage());\n return null;\n }\n return list;\n }", "private List<Card> setupDeck(){\n List<Card> llist = new LinkedList<Card>();\n String[] faceCards = {\"J\",\"Q\",\"K\",\"A\"};\n String[] suits = {\"spades\",\"clubs\",\"diamonds\",\"hearts\"};\n\n for(int i=2; i<=10; i++){\n for(int j=1; j<=4; j++){\n llist.add(new Card(Integer.toString(i), suits[j-1], j, i));\n }\n }\n for(int k=1; k<=4; k++){\n for(int l=1; l<=4; l++){\n llist.add(new Card(faceCards[k-1],suits[l-1], l, k+10));\n }\n }\n return llist;\n }", "private void initCards() {\n\t\tArrayList<Card> cardsChart = new ArrayList<Card>();\n\t\tCard card = init_info_card(tmp.getFull(), tmp.getStatus(), tmp.getDue_date());\n\t\tcardsChart.add(card);\n\t\tcard = init_fulfilled_card();\n\t\tcardsChart.add(card);\n\t\tcard = init_proof_card();\n\t\tcardsChart.add(card);\n\t\tcard = init_chart_detail_card();\n\t\tcardsChart.add(card);\n\t\t\n\t\t/*for (int i = 0; i < 5; i++) {\n\t\t\tcard = init_chart_card();\n\t\t\tcardsChart.add(card);\n\t\t}*/\n\t\tCardArrayAdapter mCardArrayAdapterGrades = new CardArrayAdapter(getActivity(), cardsChart);\n\n\t\tCardListView listView = (CardListView) getActivity().findViewById(R.id.card_list);\n\t\tif (listView != null) {\n\t\t\tlistView.setAdapter(mCardArrayAdapterGrades);\n\t\t}\n\t}", "@Override\n public List<MemCard> autoQueryCard(IRequest request, Long memberId) {\n List<MemCard> cards = cardMapper.selectByMemberId(memberId);\n for (MemCard card : cards) {\n StringBuffer sb = new StringBuffer();\n sb.append(card.getBankCode() == null ? \"\" : card.getBankCode());\n sb.append(MemberConstants.MM_LEFT_BRACKET);\n sb.append(card.getMaskedCardNumber().substring(card.getMaskedCardNumber().length() - 4,\n card.getMaskedCardNumber().length()));\n sb.append(MemberConstants.MM_RIGHT_BRACKET);\n card.setBankCode(sb.toString());\n }\n return cards;\n }", "public Card getCard() {\n return this.card;\n }", "public int CardsOnDeck()\n\t{\n\t\treturn cardNumber;\n\t}", "public ArrayList<CareerCards> getCareerCardDeck(){\n\t\treturn careerCardDeck;\n\t}", "public static List<ScrumPokerCard> getDeck() {\n return Arrays.stream(values()).collect(Collectors.toList());\n }", "public Card getCard() {\n return this.card;\n }", "public ArrayList<CardGamePlayer> getPlayerList(){\n\t\treturn this.playerList;\n\t}" ]
[ "0.68857574", "0.6834336", "0.6828815", "0.6815238", "0.67658556", "0.6755368", "0.66971934", "0.6637439", "0.6561376", "0.65366036", "0.65322083", "0.65016425", "0.65003777", "0.6499346", "0.6495082", "0.64055824", "0.63896334", "0.6385005", "0.6382844", "0.6347153", "0.632435", "0.6324111", "0.63133395", "0.63100743", "0.6263514", "0.62519026", "0.6246605", "0.6207503", "0.61964923", "0.61857486", "0.61483556", "0.6135895", "0.60648537", "0.60452986", "0.60070527", "0.59857106", "0.59521675", "0.5940012", "0.5891735", "0.5891556", "0.58762556", "0.5867728", "0.5834911", "0.5822257", "0.5799507", "0.579721", "0.57892406", "0.5786039", "0.57857275", "0.57772094", "0.57621884", "0.57619303", "0.57322586", "0.5724984", "0.57194", "0.5717943", "0.570751", "0.570505", "0.57029843", "0.56942403", "0.56830406", "0.56624335", "0.5661999", "0.56557256", "0.56536466", "0.56494385", "0.56402785", "0.5638861", "0.56159073", "0.5615081", "0.55897856", "0.5589045", "0.55888116", "0.558175", "0.55800605", "0.55707425", "0.55604017", "0.5515493", "0.550076", "0.54962826", "0.54882854", "0.54856306", "0.54774207", "0.54591", "0.54552907", "0.54431003", "0.5434299", "0.54229474", "0.5420007", "0.53723264", "0.53663343", "0.5346934", "0.53308976", "0.5329027", "0.5327052", "0.5326718", "0.532481", "0.5309187", "0.5308781", "0.53024626" ]
0.8553714
0
The trigger method is used to respond to a player readying up.
public void trigger() { if(!this.inProgress && this.round >= Config.RoundLimit) { this.sendMessages(new String[]{"The game has already ended."}); } else { int count = this.playerCount(); if(count > 1 && count - this.readyCount() == 0) { List<String> messages = new LinkedList<>(); if(this.inProgress) { if(Config.Phases[this.phase].equals(Config.VotePhaseName)) { messages.add("Voting ended. Counting votes."); // Sum all the votes from each player. int[] votes = new int[Config.TableCards]; for(Player player : this.players) { if(player != null) { int[] playerVotes = player.getVotes(); int i = 0; while(i < playerVotes.length) { if(playerVotes[i] != 0) { votes[i] += playerVotes[i]; } ++i; } player.resetVotes(); } } // Pick the cards with more yes votes than no votes. List<Card> picked = new LinkedList<>(); int pos = 0; while(pos < this.onTable.size()) { if(votes[pos] > 0) { Card card = this.onTable.get(pos); picked.add(card); for(Share price : this.prices) { if(price.getStock().equals(card.stock)) { price.addShares(card.effect); break; } } } ++pos; } // Prepare the output string for the picked cards. String message = ""; boolean isNotFirst = false; for(Card card : picked) { if(isNotFirst) { message += ", "; } else { isNotFirst = true; } message += card.stock; if(card.effect > 0) { message += "+"; } message += card.effect; } this.dealToTable(); messages.add("Picked influence cards: " + message); messages.add(""); } ++this.phase; if(this.phase >= Config.Phases.length) { this.phase = 0; ++this.round; if(this.round >= Config.RoundLimit) { this.stopGame(); Share[] prices = this.prices.toArray(new Share[0]); for(Player player : this.players) { if(player != null) { player.sellAll(prices); } } messages.add("Game over. Scores:"); // Copy and sort the players list by total money. Player[] winners = Arrays.copyOf(this.players, this.players.length); Arrays.sort(winners, (Player o1, Player o2) -> { if(o1 == null && o2 == null) { return 0; } else if(o1 == null) { return 1; } else if(o2 == null) { return -1; } else { return o2.getMoney() - o1.getMoney(); } }); int lastScore = winners[0].getMoney(); int num = 0; int i = 0; while(i < winners.length) { if(winners[i] == null) { break; } else { if(lastScore > winners[i].getMoney()) { num = i; } messages.add(Config.PlayerPositions[num] + ": Player " + winners[i].getPlayerNumber() + ", " + winners[i].getName() + " - " + Config.Currency + winners[i].getMoney()); } ++i; } } else { messages.add("Round " + (this.round + 1) + " of " + Config.RoundLimit + "."); messages.add(Config.Phases[this.phase] + " phase started."); } } else { messages.add(Config.Phases[this.phase] + " phase started."); } } else { this.inProgress = true; messages.add("Game started. Round " + (this.round + 1) + " of " + Config.RoundLimit + "."); messages.add(Config.Phases[this.phase] + " phase started."); } this.sendMessages(messages.toArray(new String[0])); for(Player player : this.players) { if(player != null) { player.setReady(false); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void playerWon()\r\n {\r\n \r\n }", "void trigger();", "public abstract void onTrigger();", "protected void roomAction() {\n if (this.count < 1 && !this.room.isTriggerSet())\n {\n System.out.println(\"Prisoner: \" + this.id + \" turns trigger on!\");\n this.count++;\n this.room.setTrigger();\n }\n else {\n System.out.println(\"Prisoner: \" + this.id + \" in room... nothing to do!\");\n }\n }", "boolean notifyWhenReady(int playerNr);", "public void execute(FieldPlayer player){\n if (player.isBallWithinReceivingRange() || !player.getTeam().inControl()){\n player.getFSM().changeState(ChaseBall.Instance());\n\n return;\n } \n\n if (player.getSteering().PursuitIsOn()){\n player.getSteering().setTarget(player.getBall().getPos());\n }\n\n //if the player has 'arrived' at the steering target he should wait and\n //turn to face the ball\n if (player.isAtTarget()){\n player.getSteering().arriveOff();\n player.getSteering().pursuitOff();\n player.trackBall(); \n player.setVelocity(new Vector2D(0,0));\n } \n }", "public void notifyTurn()\n {\n playerObserver.onTurnStart();\n }", "@Override\n\t\t\t\t\t public void visit(Player player) {\n\t\t\t\t\t\t\tPacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_MSG_HF_ShugoCaravanAppear);\n\t\t\t\t\t }", "@Override\n\tpublic void playerReady(String playerID, boolean isReady) {\n\t\t//printMessage(\"ph.playerReady: \"+playerID+\" is ready\");\n\t\t//moeten wij niets met doen\n\t}", "public abstract void onBakeCommand(Player player);", "public void trigger() {\n triggered = true;\n\n // Get events from the user\n stage = new Stage(new ScreenViewport());\n show();\n }", "public void trigger() {\n button.release(true);\n }", "@Override\n public void landedOn(Player player) {}", "public void gameComplete() {\n if (soundToggle == true) {\n gameComplete.start();\n } // if\n }", "private void WaitTalk() {\n // to restart as touched screen.\n if (this.mRestartF) this.RestartTalk();\n }", "public abstract void fire(Player holder);", "@Override\n\tpublic void landedOn() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(300);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 300 dollars by landing on Bonus Square\");\n\t\tMonopolyGameController.allowCurrentPlayerToEndTurn();\n\n\t}", "private boolean triggered() {\n\t\treturn true;\n\t}", "public abstract void activatedBy(Player player);", "public void play() {\n System.out.println(\"Player \" + this.name + \" started to play...\");\n System.out.println(\"Current balance: \" + getTotalAsset());\n\n // roll a dice to move\n int steps = rollDice();\n System.out.println(\"Player diced \" + steps);\n\n // move\n move(steps);\n Land land = Map.getLandbyIndex(position);\n\n // land triggered purchase or opportunity events\n land.trigger();\n\n System.out.println(\"Player \" + this.name + \"has finished.\");\n }", "public void playerTurnStart() {\n\r\n\t}", "public void playerLost()\r\n {\r\n \r\n }", "public void onAction(Player player) {\n }", "public void waitForUserClick(Player player){\n Log.d(getClass().toString(),\"wait for user click???\");\n }", "@Override\n public synchronized void isReady(String username, boolean ready) throws RemoteException {\n Player p = getPlayer(username);\n if (p != null) {\n p.setReady(ready);\n System.out.println(username + (ready ? \" no\" : \"\") + \" esta listo!\");\n }\n }", "public void autoGrab(){\n \tif (getTrigger() == true){\n\t \tif(triggerTimer.get() >= TRIGGER_LOCKOUT){\n\t\t \tClawAct.set(true);\n\t\t \tisClosed = true;\n\t \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\t \t}\n \t}\n\n }", "public void enter(FieldPlayer player){\n player.getTeam().setReceiver(player);\n \n //this player is also now the controlling player\n player.getTeam().setControllingPlayer(player);\n\n //there are two types of receive behavior. One uses arrive to direct\n //the receiver to the position sent by the passer in its telegram. The\n //other uses the pursuit behavior to pursue the ball. \n //This statement selects between them dependent on the probability\n //ChanceOfUsingArriveTypeReceiveBehavior, whether or not an opposing\n //player is close to the receiving player, and whether or not the receiving\n //player is in the opponents 'hot region' (the third of the pitch closest\n //to the opponent's goal\n double PassThreatRadius = 70.0;\n\n if (( player.isInHotRegion() ||\n RandFloat() < Params.Instance().ChanceOfUsingArriveTypeReceiveBehavior) &&\n !player.getTeam().isOpponentWithinRadius(player.getPos(), PassThreatRadius)){\n player.getSteering().arriveOn();\n }\n else{\n player.getSteering().pursuitOn();\n }\n \n //FIXME: Change animation\n// player.info.setAnim(\"Run\");\n// player.info.setDebugText(\"ReceiveBall\");\n }", "public void giveUp() {\n if (!finished)\n player.kill();\n }", "public String callPlayer() {\n\t\treturn \"OVER HERE!!\";\n\t}", "public void askForPowerUpAsAmmo() {\n mainPage.setRemoteController(senderRemoteController);\n mainPage.setMatch(match);\n if (!mainPage.isPowerUpAsAmmoActive()) { //check if there is a PowerUpAsAmmo already active\n Platform.runLater(\n () -> {\n try {\n mainPage.askForPowerUpAsAmmo();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }\n\n }", "public void playerListenerFiringCallback(Player player) {\n\t\tif (!m_CSActionStates.containsKey(player) || m_CSActionStates.get(player) == ActionState.NOACTION) {\n\t\t\tm_PlayerListener.stopListeningTo(player);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (m_CSActionStates.get(player) == ActionState.FM_TARGETING) {\n\t\t\tLocation curLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\tm_CSUnconfirmedLocations.put(player, curLoc);\n\t\t\tm_CSActionStates.put(player, ActionState.FM_CONFIRMING);\n\t\t\tOrbitalStrike.sendMessage(player, \"Confirm target (\" + curLoc.getBlockX() + \",\" + curLoc.getBlockZ() + \") for fire mission\");\n\t\t}\n\t\telse if (m_CSActionStates.get(player) == ActionState.FM_CONFIRMING) {\n\t\t\tLocation prevLoc = m_CSUnconfirmedLocations.get(player);\n\t\t\tLocation curLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\tif (prevLoc.equals(curLoc)) {\n\t\t\t\tm_Handler.initiateOrbitalStrike(m_Handler.new BeamLocation(curLoc), m_CSBeamSettings.get(player));\n\t\t\t\tsenderStateCleanup(player);\n\t\t\t\tOrbitalStrike.sendMessage(player, \"Fire mission confirmed, firing for effect!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm_CSActionStates.put(player, ActionState.FM_TARGETING);\n\t\t\t\tOrbitalStrike.sendMessage(player, \"Cannot confirm target location, awaiting new target\");\n\t\t\t}\n\t\t}\n\t\telse if (m_CSActionStates.get(player) == ActionState.FS_TARGETING) {\n\t\t\tif (!m_CSUnconfirmedSwathStartLocations.containsKey(player)) {\t// STEP 1: target start\n\t\t\t\tLocation startLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\t\tm_CSUnconfirmedSwathStartLocations.put(player, startLoc);\n\t\t\t\tm_CSActionStates.put(player, ActionState.FS_CONFIRMING);\n\t\t\t\tOrbitalStrike.sendMessage(player, \"Confirm start position (\" + startLoc.getBlockX() + \",\" + startLoc.getBlockZ() + \") for fire sweep\");\n\t\t\t}\n\t\t\telse if (!m_CSUnconfirmedSwathEndLocations.containsKey(player)) {\t// STEP 3: target end\n\t\t\t\tLocation endLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\t\tm_CSUnconfirmedSwathEndLocations.put(player, endLoc);\n\t\t\t\tm_CSActionStates.put(player, ActionState.FS_CONFIRMING);\n\t\t\t\tOrbitalStrike.sendMessage(player, \"Confirm end position (\" + endLoc.getBlockX() + \",\" + endLoc.getBlockZ() + \") for fire sweep\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tOrbitalStrike.logInfo(\"Error: Logic error in swath targetting \" + player, 1);\n\t\t\t\tsenderStateCleanup(player);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse if (m_CSActionStates.get(player) == ActionState.FS_CONFIRMING) {\n\t\t\tif (m_CSUnconfirmedSwathStartLocations.containsKey(player) && !m_CSUnconfirmedSwathEndLocations.containsKey(player)) {\t// STEP 2: confirm start\n\t\t\t\tLocation prevLoc = m_CSUnconfirmedSwathStartLocations.get(player);\n\t\t\t\tLocation startLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\t\tif (prevLoc.equals(startLoc)) {\n\t\t\t\t\tm_CSActionStates.put(player, ActionState.FS_TARGETING);\n\t\t\t\t\tOrbitalStrike.sendMessage(player, \"Start position confirmed, designate end position\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tm_CSUnconfirmedSwathStartLocations.remove(player);\n\t\t\t\t\tm_CSActionStates.put(player, ActionState.FS_TARGETING);\n\t\t\t\t\tOrbitalStrike.sendMessage(player, \"Cannot confirm target location, awaiting new start position\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (m_CSUnconfirmedSwathStartLocations.containsKey(player) && m_CSUnconfirmedSwathEndLocations.containsKey(player)) {\t//STEP 4: confirm end\n\t\t\t\tLocation prevLoc = m_CSUnconfirmedSwathEndLocations.get(player);\n\t\t\t\tLocation endLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\t\tif (prevLoc.equals(endLoc)) {\n\t\t\t\t\tLocation startLoc = m_CSUnconfirmedSwathStartLocations.get(player);\n\t\t\t\t\tm_Handler.initiateOrbitalSwath(m_Handler.new BeamLocation(startLoc), m_Handler.new BeamLocation(endLoc), m_CSBeamSettings.get(player));\n\t\t\t\t\tsenderStateCleanup(player);\n\t\t\t\t\tOrbitalStrike.sendMessage(player, \"Fire sweep confirmed, firing for effect!\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tm_CSUnconfirmedSwathEndLocations.remove(player);\n\t\t\t\t\tm_CSActionStates.put(player, ActionState.FS_TARGETING);\n\t\t\t\t\tOrbitalStrike.sendMessage(player, \"Cannot confirm target location, awaiting new end position\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tOrbitalStrike.logInfo(\"Error: Logic error in swath targetting \" + player, 1);\n\t\t\t\tsenderStateCleanup(player);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "void waitingForMyTurn();", "private void triggerReset() {\n DefenceField.fieldActivated = false;\n OnFieldReset event = new OnFieldReset(this::doActivation);\n event.beginTask();\n DefenceField.getShrineEntity().send(event);\n event.finishTask();\n }", "public void ready(int playerNo) {\r\n\t\tthis.playersReady++;\r\n\r\n\t\t// Tell all of the players in the lobby that somebody has become ready\r\n\t\tthis.queueMessage(\"% \" + playerNo + \" READY\");\r\n\r\n\t\t// Do a 15 second timer to wait for more people to join\r\n\t\tif (this.playersReady != 0 && this.playersReady == this.players.size()) {\r\n\t\t\tthis.startReadyTimer(true);\r\n\t\t}\r\n\t}", "@Override\n public void execute() {\n vars.setState(\"Teleporting...\");\n Methods.teleToFlameKing();\n }", "public void startGame() {\n status = Status.COMPLETE;\n }", "@Override\n public void trigger() {\n output.addNewEvent(\"Suspender Assinante \" + subscriber.getId() + \" da Central \" + central.getId());\n this.sucess = this.network.suspendSubscriberFromCentral(this.subscriber.getId(), this.central.getId());\n if (sucess) {\n output.addNewSignal(\"Assinante \" + this.subscriber.getId() + \" suspendida da Central \" + central.getId());\n } else {\n output.addNewSignal(\"Assinante \" + this.subscriber.getId() + \" não está conectado ou ativo à Central \" + central.getId());\n }\n }", "public void onReadyButton(View view) {\n mUser.setState(User.UserState.DoneWithNight);\n\n // NOTE!!!!!!!!!!!!!!!!!!\n // When ever the User updates,\n // Because of our event up above,\n // A check goes to see if everyone is ready.\n // If everyone is ready, then it moves to the next Lobby!\n // I hope.\n mRoom.updateUser(mUser);\n Intent intent = new Intent(this, DayMain.class);\n intent.putExtra(\"Client_Data\", mUser);\n intent.putExtra(\"Room_Data\", mRoom);\n Log.v(TAG, \"Starting day for the Villager \");\n startActivity(intent);\n\n }", "public void forceOnCompletion() {\n onCompletion(player);\n }", "@Override\n public void trigger() {\n output.addNewEvent(\"Assinante \" + subscriberReconnect.getId() + \" deseja reconectar sua última ligação\");\n if (this.subscriberReconnect.isFree()) {\n takePhone();\n reestablishConnection();\n }\n }", "public void battleComplete() {\n\t}", "public void triggerEvent() {\n\t\ts.changeOpenState();\n\t\ts.setChangedAndNotify();\n\t\t\n\t}", "protected void execute() {\n \tRobot.chassisSubsystem.shootHighM.set(0.75);\n \tif(timeSinceInitialized() >= 1.25){\n \t\tRobot.chassisSubsystem.liftM.set(1.0);\n \t}\n }", "@Override\n\tpublic void onStandDown(PlatformPlayer player) {\n\t\t\n\t}", "public abstract void tellStarting();", "public void toWaitingTurn() {\n }", "@Override\n\t\t\tpublic void execute() {\n\t\t\t\tif (Math.abs(player.getPosition().getX() - x) > 25 || Math.abs(player.getPosition().getY() - y) > 25) {\n\t\t\t\t\tplayer.getMovementQueue().reset();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Get ground item..\n\t\t\t\tOptional<ItemOnGround> item = ItemOnGroundManager.getGroundItem(Optional.of(player.getUsername()), itemId, position);\n\t\t\t\tif(item.isPresent()) {\n\t\t\t\t\t//Handle it..\n\t\t\t\t\t\n\t\t\t\t\t/** FIREMAKING **/\n\t\t\t\t\tOptional<LightableLog> log = LightableLog.getForItem(item.get().getItem().getId());\n\t\t\t\t\tif(log.isPresent()) {\n\t\t\t\t\t\tplayer.getSkillManager().startSkillable(new Firemaking(log.get(), item.get()));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void play(int robot) {\n\t\tSystem.out.println(\"Robot\"+ robot+ \" is Defending!\");\n\t}", "protected void execute() {\n \tif (isIntaking) {\n \t\tRobot.conveyor.forward();\n \t} else {\n \t\tRobot.conveyor.backward();\n \t}\n }", "@Override\r\n\t\t\tpublic void onReadyChange(boolean ready) {\n\r\n\t\t\t}", "public void hang() {\n // WRITE CODE BETWEEN THESE LINES -------------------------------------------------------- //\n // TODO: run the intake motor to both extend and pull in hanger\n // Note: only enable running motor when the m_extended flag is true\n\n // ^^-----------------------------------------------------------------------------------^^ //\n }", "void trigger(Entity e);", "@Override\n\tpublic void addTrigger() {\n\t\tthis.listener = new ObjectListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onEvent(ObjectEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t\tRankTempInfo rankInfo = RankServerManager.getInstance().getRankTempInfo(player.getPlayerId());\n\t\t\t\tif(rankInfo!=null){\n\t\t\t\t\tgetTask().updateProcess((int)rankInfo.getSoul());\n\t\t\t\t}\n\t\t\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\tplayer.addListener(this.listener, EventNameType.SOUL_FIGHT);\n\t}", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}", "public abstract void sendConfirmationMessage(Player player);", "public void doTurn() {\n\t\tGFrame.getInstance().aiHold();\n\t}", "void onStartGameRequested();", "public void invokeCompletionListener() {\n if (completionListener == null) return;\n completionListener.onCompletion( player );\n }", "void playerPassedStart(Player player);", "void notifyNewGame();", "public abstract void ready();", "public void onTurnBegin() {\n\n\t}", "public void notifyPlayerDefeat(Player p);", "public void action(){\n turn.sendMsg(turn.getController().getTurnOwner().getName()+\"'s turn!\");\n if(turn.getPlayer().isDown()){\n turn.setPhase(new RecoveryPhase());\n }else {\n turn.setPhase(new StarsPhase());\n }\n }", "protected void execute() {\n\n\t\t// SmartDashboard.putString(\"DB/String 0\", \"Vision was reached = \" +\n\t\t// Vision.getInstance().reached());\n\n\t\t// checks to see if the trigger is pressed, and sends diff variables\n\t\t// accordingly\n\n\t\tif (DriveTrain.getInstance().orientationTriggerGet()) {\n\t\t\tDriveTrain.getInstance().tankDrive(getLeftStick(), -getRightStick(), squaredInputs);\n\n\t\t} else {\n\t\t\tDriveTrain.getInstance().tankDrive(-getRightStick(), getLeftStick(), squaredInputs);\n\t\t}\n\n\t}", "void notifyPlayerHasAnotherTurn();", "@Override\n\tpublic void onMessagePlayCompleted() {\n\t\tbtnSend.setEnabled(true);\n\t}", "@Override\n public void poll() {\n if( state == State.attacking ) {\n if( !ctx.movement.running() && ctx.movement.energyLevel() >= 75) {\n stateText = \"Setting running\";\n ctx.movement.running(true);\n }\n stateText = \"\";\n if( isAttacking() ) {\n stateText = \"Attacking\";\n Item ammo = inventory.getFirst(ammoUsed);\n if( ammo != null && ammo.valid() ){\n inventory.clickItem(ammo);\n sleep(100);\n }\n } else {//TODO find out why it stops picking up arrows after some time\n if (!inventory.full() && (targetBone == null || !targetBone.valid() || !misc.pointOnScreen(targetBone.centerPoint())) ) {\n targetBone = getNextGroundBone();\n clickedGroundItem = false;\n }\n if (!inventory.full() && targetBone != null && targetBone.valid() && misc.pointOnScreen(targetBone.centerPoint())) {\n stateText = \"Picking up bones\";\n if( !ctx.players.local().inMotion() )\n clickedGroundItem = false;\n if (!clickedGroundItem ) {\n clickedGroundItem = groundItems.pickup(targetBone);\n }\n } else if( inventory.full() && inventory.contains(bones) ) {\n state = State.burying;\n } else {\n if( !clickedMonster || !target.valid() || target.health() <= 0 || target.interacting() != ctx.players.local() ) {\n target = getNextTarget();\n clickedMonster = false;\n }\n if (!misc.pointOnScreen(target.centerPoint())) {\n if (target.tile().matrix(ctx).onMap()) {\n stateText = \"Walking to monster\";\n movement.walkTile(target.tile());\n }\n } else {\n stateText = \"Attacking monster\";\n if( !clickedMonster ) {\n clickedMonster = npcs.attackMonster(target);\n }\n }\n }\n }\n }else if( state == State.burying){\n Item invBones = inventory.getFirst(bones);\n if( invBones!= null && invBones.valid()) {\n stateText = \"Clicking bones\";\n inventory.clickItem(invBones);\n }else {\n state = State.attacking;\n }\n }\n checkIfBeingAttacked();\n }", "public void pickUpHerd() {\n rounds.get(currentRound).currentPlayerPickUpHerd();\n }", "@Then(\"the game shall become ready to start\")\n\tpublic void the_game_shall_become_ready_to_start() {\n\t}", "public void run() {\n\t\tif (timeToStart > 0 && timeToStart <= 3) {\n\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\tonline.sendMessage(Main.prefix() + \"UHC is starting in §6\" + String.valueOf(timeToStart) + \"§7.\");\n\t\t\t\tonline.playSound(online.getLocation(), Sound.SUCCESSFUL_HIT, 1, 0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (timeToStart == 1) {\n\t\t\tMain.stopCountdown();\n\t\t\tBukkit.getServer().getScheduler().scheduleSyncDelayedTask(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.SUCCESSFUL_HIT, 1, 1);\n\t\t\t\t\t\tif (ArrayUtil.spectating.contains(online.getName())) {\n\t\t\t\t\t\t\tSpectator.getManager().set(online, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.setAllowFlight(false);\n\t\t\t\t\t\tonline.setFlying(false);\n\t\t\t\t\t\tonline.setHealth(20.0);\n\t\t\t\t\t\tonline.setFireTicks(0);\n\t\t\t\t\t\tonline.setSaturation(20);\n\t\t\t\t\t\tonline.setLevel(0);\n\t\t\t\t\t\tonline.setExp(0);\n\t\t\t\t\t\tif (!ArrayUtil.spectating.contains(online.getName())) {\n\t\t\t\t\t\t\tonline.showPlayer(online);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.awardAchievement(Achievement.OPEN_INVENTORY);\n\t\t\t\t\t\tonline.setFoodLevel(20);\n\t\t\t\t\t\tonline.getInventory().clear();\n\t\t\t\t\t\tonline.getInventory().setArmorContents(null);\n\t\t\t\t\t\tonline.setItemOnCursor(new ItemStack (Material.AIR));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (online.getGameMode() != GameMode.SURVIVAL) {\n\t\t\t\t\t\t\tonline.setGameMode(GameMode.SURVIVAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (PotionEffect effect : online.getActivePotionEffects()) {\n\t\t\t\t\t\t\tonline.removePotionEffect(effect.getType());\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 250, 100));\n\t\t\t\t\t\tonline.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 6000, 100));\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"UHC has now started, Good luck!\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"PvP will be enabled in §6\" + Settings.getInstance().getData().getInt(\"game.pvp\") + \" §7mins in.\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"Meetup at §6\" + Settings.getInstance().getData().getInt(\"game.meetup\") + \" §7mins in.\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"Remember to read the match post: \" + Settings.getInstance().getData().getString(\"match.post\"));\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"/helpop questions.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tGameState.setState(GameState.INGAME);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§a§lPvE\", 1);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§a§lPvE\", 0);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lMeetup\", Integer.parseInt(\"-\" + Settings.getInstance().getData().getInt(\"game.meetup\")));\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lPvP\", Integer.parseInt(\"-\" + Settings.getInstance().getData().getInt(\"game.pvp\")));\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lFinal heal\", -1);\n\t\t\t\t\t\n\t\t\t\t\tfor (World world : Bukkit.getWorlds()) {\n\t\t\t\t\t\tworld.setTime(0);\n\t\t\t\t\t\tworld.setDifficulty(Difficulty.HARD);\n\t\t\t\t\t\tworld.setPVP(false);\n\t\t\t\t\t\tfor (Entity mobs : world.getEntities()) {\n\t\t\t\t\t\t\tif (mobs.getType() == EntityType.BLAZE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.CAVE_SPIDER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.CREEPER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.ENDERMAN ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.ZOMBIE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.WITCH ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.WITHER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.DROPPED_ITEM ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.GHAST ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.GIANT ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.MAGMA_CUBE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.DROPPED_ITEM ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SKELETON ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SPIDER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SLIME ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SILVERFISH ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SKELETON || \n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.EXPERIENCE_ORB) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tmobs.remove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 20);\n\t\t\t\n\t\t\tBukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lFinal heal\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lFinal heal\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"§6§lFinal heal!\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\tonline.setHealth(20.0);\n\t\t\t\t\t\t\t\tonline.setFireTicks(0);\n\t\t\t\t\t\t\t\tonline.setFoodLevel(20);\n\t\t\t\t\t\t\t\tonline.setSaturation(20);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lFinal heal\", Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lPvP\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lPvP\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lPvP\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"PvP is now enabled, Good luck everyone.\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (World world : Bukkit.getWorlds()) {\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lPvP\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lPvP\", Scoreboards.getManager().getScore(\"§b§lPvP\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lPvP\") == -5) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"5 minutes to pvp, do §6/stalk §7if you think you're being stalked.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lPvP\") == -1) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"1 minute to pvp, do §6/stalk §7if you think you're being stalked.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lMeetup\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lMeetup\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.DARK_GRAY + \"==============================================\");\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.GREEN + \" Meetup has started, start headding to 0,0.\");\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.GREEN + \" Only stop for a fight, nothing else.\");\n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.DARK_GRAY + \"==============================================\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.WITHER_DEATH, 1, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lMeetup\", Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lMeetup\") == -1) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"1 minute to meetup, Pack your stuff and get ready to head to 0,0.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 1200, 1200);\n\t\t\t\n\t\t\tBukkit.getServer().getScheduler().runTaskLater(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tBukkit.getPlayer(Settings.getInstance().getData().getString(\"game.host\")).chat(\"/gamerule doMobSpawning true\");\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t}\n\t\t\t}, 3600);\n\t\t}\n\t\ttimeToStart -=1;\n\t}", "@Override\n public void powerOn() {\n if(isOn)System.out.println(\"The Projector is already ON!\");\n else{\n System.out.println(\"The Projector is now ON!\");\n isOn = true;\n }\n }", "public void fireInteraction() {\n Callback callback = this.mCallback;\n if (callback != null) {\n callback.onInteraction();\n }\n }", "public void startPlaying() {\n\t\t\n\t\t// make the player travel to its home base\n\t\ttravelTo(Location.Home);\n\t\t\n\t\t// once it has travelled to its home base, start performing \n\t\t// the appropriate tasks -- whether that is attack or defend\n\t\tif (role == Role.Defender) defend();\n\t\telse if (role == Role.Attacker) attack();\n\t\t\n\t}", "private void control() {\n try {\n gameThread.sleep(17);\n } catch (InterruptedException e) { }\n }", "public void triggerPickedUp(boolean b);", "public void playSoundGameWon() {\n\t\tcompletedGameSound.play();\n\t}", "public void playTurn() {\r\n\r\n }", "public void onUpPressed(){\n shipSoundPlayer.setVolume(App.getVolume()/2);\n if(timeAfterStateChanged > 3){\n timeAfterStateChanged = 0;\n if(fireState_1){\n player.setSprite(spaceship_flying_2);\n }else{\n player.setSprite(spaceship_flying_1);\n }\n fireState_1 = !fireState_1;\n }\n timeAfterStateChanged++;\n\n if(shipSoundPlayer.getCurrentTime().toMillis()>3400){\n shipSoundPlayer = new MediaPlayer(new Media(new File(\"Sounds\\\\SpaceShip_move.mp3\").toURI().toString()));\n }\n shipSoundPlayer.play();\n if(Math.pow(Math.pow(player.getSpeed().getX(),2)+Math.pow(player.getSpeed().getY(),2),0.5)<player.getSpeedLimit()) {\n player.setSpeed(new Point2D(player.getSpeed().getX() - Math.cos(Math.toRadians(player.getRotation() + 90)) * player.getAcceleration(), player.getSpeed().getY() - Math.sin(Math.toRadians(player.getRotation() + 90)) * player.getAcceleration()));\n }\n }", "@Override\n\tpublic void onTurnLeft(PlatformPlayer player) {\n\t\t\n\t}", "@Override\n\tpublic void onRun(PlatformPlayer player) {\n\t\t\n\t}", "@Override\n public void triggerEvent() {\n samplePlayer.setPosition(loop_start.getCurrentValue());\n // Write your DynamicControl code above this line \n }", "public void showTriggered();", "public void playTriggerSound() {\n ScreenSpeakService service = ScreenSpeakService.getInstance();\n if (service != null) {\n service.getFeedbackController().playAuditory(R.raw.tutorial_trigger);\n }\n }", "public boolean triggersNow()\n\t{\n\t\tif(!this.canTrigger())\n\t\t\treturn false;\n\n\t\tfor(GameObject object: this.game.actualState.stack())\n\t\t\tif(object instanceof StateTriggeredAbility)\n\t\t\t\tif(((StateTriggeredAbility)object).printedVersionID == this.ID)\n\t\t\t\t\treturn false;\n\n\t\tIdentified source = this.getSource(this.state);\n\t\tint controller;\n\t\tif(source.isGameObject())\n\t\t\tcontroller = ((GameObject)source).controllerID;\n\t\telse\n\t\t\t// it's a player\n\t\t\tcontroller = source.ID;\n\t\tfor(GameObject object: this.game.actualState.waitingTriggers.get(controller))\n\t\t\tif((object instanceof StateTriggeredAbility) && (((StateTriggeredAbility)object).printedVersionID == this.ID))\n\t\t\t\treturn false;\n\n\t\tfor(SetGenerator condition: this.triggerConditions)\n\t\t\tif(!condition.evaluate(this.game, this).isEmpty())\n\t\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public void onTurnOver() {}", "@Override\n public void run(){\n\n boolean gotReady = false;\n\n try {\n player.sendCommandToPlayer(new Command(CommandTypes.waitingForClientToGetReady , null));\n } catch (IOException e) {\n God.removeOfflinePlayerNotifyOthers(player);\n }\n\n while (! gotReady){\n try {\n Command command = player.receivePlayerRespond();\n\n if(command.getType() == CommandTypes.imReady){\n gotReady = true;\n }\n\n else {\n God.doTheCommand(command);\n }\n\n } catch (IOException e) {\n God.removeOfflinePlayerNotifyOthers(player);\n break;\n }\n }\n }", "public void notifyRespawn()\n {\n playerObserver.onRespawn();\n }", "protected void execute() {\n if (oi.getButton(1,3).get()){\n speedModifier = 0.6;\n }\n else if(oi.getButton(2,3).get()){\n speedModifier = 1;\n }\n else if(oi.getButton(1,2).get()&&oi.getButton(2, 2).get()){\n speedModifier = 0.75;\n }\n chassis.tankDrive((oi.getJoystick(1).getAxis(Joystick.AxisType.kY)*speedModifier), (oi.getJoystick(2).getAxis(Joystick.AxisType.kY)*speedModifier));\n //While no triggers are pressed the robot moves at .75 the joystick input\n }", "protected void execute() { \t\n \tif (isLowered != Robot.oi.getOperator().getRawButton(2)) {\n \t\tisLowered = Robot.oi.getOperator().getRawButton(2);\n \t\tif (isLowered)\n \t\t\tRobot.gearSubsystem.getRaiser().set(DoubleSolenoid.Value.kForward);\n \t\telse\n \t\t\tRobot.gearSubsystem.getRaiser().set(DoubleSolenoid.Value.kReverse);\n \t}\n \t\n \tif (Robot.oi.getOperator().getRawButton(11))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(0.75);\n \telse if (Robot.oi.getOperator().getRawButton(12))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(0);\n \telse if (Robot.oi.getOperator().getRawButton(10))\n \t\tRobot.gearSubsystem.getIntakeMotor().set(-0.75);\n }", "@Override\n public Boolean call() throws RemoteException {\n stateGame = applicationServerGameInterface.startMessage(playerId);\n return true;\n }", "public void play() {\n field.draw();\n userTurn();\n if(! field.isFull()) {\n computerTurn();\n }\n }", "@Override\n\t\tvoid runCommand() {\n\t\t\ttrigger.execute();\n\t\t}", "@Override\n public void onAction(RPObject player, RPAction action) {\n }", "public void win()\r\n\t{\r\n\t\tmWon = true;\r\n\t}", "@Override\n\tpublic void nowPlaying() {\n\t}", "public void executeJoiningPlayer(Player player) {\r\n nui.setupNetworkPlayer(player);\r\n }", "protected void keyPressedImpl()\n {\n if (key == 'g') {\n trigger = true;\n triggerCount = 1;\n }\n else if (key == 'h') {\n trigger = !trigger;\n }\n }", "@Override\n\tpublic boolean playerWon() {\n\t\treturn lastPlayerWin;\n\t}", "public void announceWinner(){\n gameState = GameState.HASWINNER;\n notifyObservers();\n }" ]
[ "0.6886458", "0.6803918", "0.6669573", "0.66227406", "0.65321314", "0.63903475", "0.63430965", "0.6313317", "0.63108456", "0.6290668", "0.6260295", "0.62048084", "0.6204701", "0.6192604", "0.6181876", "0.61772573", "0.61647135", "0.61595213", "0.61576736", "0.6147395", "0.6139583", "0.6075673", "0.6064998", "0.60466194", "0.60396224", "0.6022606", "0.60205704", "0.60088134", "0.5985806", "0.5984347", "0.59825593", "0.5935012", "0.5932845", "0.5927683", "0.5918211", "0.5917794", "0.5914591", "0.59134144", "0.5908453", "0.5897463", "0.58939123", "0.589389", "0.58899355", "0.58740443", "0.5873039", "0.58697695", "0.58648866", "0.58499855", "0.5841891", "0.5835372", "0.58296025", "0.5829086", "0.58270305", "0.582343", "0.5823229", "0.5822166", "0.58213633", "0.58212376", "0.5815478", "0.58149123", "0.58086616", "0.58079624", "0.5792729", "0.57900214", "0.57852954", "0.57843804", "0.5779824", "0.57797927", "0.5779334", "0.5776567", "0.5776144", "0.5771281", "0.57695174", "0.5767293", "0.57665914", "0.5760891", "0.5748061", "0.5745184", "0.57397556", "0.573915", "0.5738937", "0.57314765", "0.5731475", "0.5729174", "0.57264316", "0.57254267", "0.5724917", "0.5715741", "0.5715312", "0.57146704", "0.57094544", "0.5705217", "0.5699433", "0.5699196", "0.5699163", "0.56933177", "0.569296", "0.5691911", "0.5689832", "0.56817496" ]
0.6151694
19
The playerCount instance method is used to get the number of currently connected players.
public int playerCount() { int count = 0; for(Player player: this.players) { if(player != null) { ++count; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getPlayerCount() {\n\t\treturn playerCount;\n\t}", "public int getPlayerCount() {\n \n \treturn playerCount;\n \t\n }", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "public int playerCount() {\n\t\treturn playerList.size();\n\t}", "public int getNumPlayers() {\n\n\t\treturn this.playerCount;\n\t}", "public int countPlayers(){\n return players.size();\n }", "public int numPlayers() {\n return playerList.size();\n }", "public static int getNumPlayers(){\n\t\treturn numPlayers;\n\t}", "public int getNumOfPlayers() {\n\t\treturn playerList.size();\n\t}", "public int getNumPlayers(){\n\t\treturn this.players.size();\n\t}", "public int getNumOfPlayers() {\n\t\treturn numOfPlayers;\n\t}", "public int getNumPlayers() {\n return numPlayers;\n }", "public int getPlayerCount() {\n return 0;\n }", "int getNumOfPlayers() {\n return this.numOfPlayers;\n }", "public int activePlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null && player.getState()) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int nrOfPlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int getNumPlayers(){\n return m_numPlayers;\n }", "public int numPlayers(){\n return this.members.size();\n }", "public int getPlayerIdsCount() {\n return playerIds_.size();\n }", "public int getPlayerIdsCount() {\n return playerIds_.size();\n }", "private int getOnlinePlayers()\n {\n return (int) Bukkit.getOnlinePlayers().stream().filter( p -> p != null && p.isOnline() ).count();\n }", "public int getNumberOfPlayers() {\n return listaJogadores.size() - listaJogadoresFalidos.size();\n }", "int getNumberOfPlayers(){\n return players.size();\n }", "@Override\npublic int getNumPlayers() {\n\treturn numPlayer;\n}", "private void getNumPlayers() {\n\t\tSystem.out.println(\"How many people are playing? (must be between \"+MIN_PLAYERS+\" and \"+MAX_PLAYERS+\")\");\n\t\tnumPlayers = GetInput.getInstance().anInteger(MIN_PLAYERS, MAX_PLAYERS);\n\t}", "public int getCurentPlayerNumber() {\n return players.size();\n }", "@Override\n\tpublic int getOnlinePlayerSum() {\n\t\treturn PlayerManager.getInstance().getOnlinePlayers().size();\n\t}", "public int loadedPlayers(){\n return playerMap.size();\n }", "private int getTotalPlayerCount() {\n String baseUrl = \"https://www.runescape.com/player_count.js?varname=iPlayerCount\";\n String url = baseUrl + \"&callback=jQuery33102792551319766081_1618634108386&_=\" + System.currentTimeMillis();\n try {\n String response = new NetworkRequest(url, false).get().body;\n Matcher matcher = Pattern.compile(\"\\\\(\\\\d+\\\\)\").matcher(response);\n if(!matcher.find()) {\n throw new Exception();\n }\n return Integer.parseInt(response.substring(matcher.start() + 1, matcher.end() - 1));\n }\n catch(Exception e) {\n return 0;\n }\n }", "public int getCount() {\n\t\treturn channelCountMapper.getCount();\n\t}", "@Override\n\tpublic int selectCount() {\n\n\t\tint res = session.selectOne(\"play.play_count\");\n\n\t\treturn res;\n\t}", "public int readyCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\tif(player.isReady())\r\n\t\t\t\t{\r\n\t\t\t\t\t++count;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public static void setPlayerCount(int playerCount) {\n PLAYER_COUNT = playerCount;\n }", "public int size ()\n\t{\n\t\treturn playerList.size();\n\t}", "int getPeerCount();", "int getCount(Side player) {\n return player == BLACK ? _countBlack : _countWhite;\n }", "public static int getConnectionCount()\r\n {\r\n return count_; \r\n }", "public int getNumberOfSelectedPlayers() {\n\t\treturn tmpTeam.size();\n\t}", "public int countPlayers(Long gameId){\n List<User_Game> user_games = userGameRepository.retrieveGamePlayers(gameId);\n return user_games.size();\n }", "public static int getCurrentSessionCount() {\n\t\treturn (currentSessionCount);\n\t}", "@Override\n public int getTotalHumanPlayers() {\n return totalHumanPlayers;\n }", "public int getUserCount() {\n return instance.getUserCount();\n }", "public int getNumOfPlayerPieces() {\n return playerPiecePositions.length;\n }", "int getConnectionsCount();", "public long getConnectionCount() {\n return connectionCount.getCount();\n }", "public Tuple<Integer, Integer> getPlayersPlayedCardsCount() {\n\t int player1Count = players[0].totalPlayedCards();\n\t int player2Count = players[1].totalPlayedCards();\n\n\t\treturn new Tuple<>(player1Count, player2Count);\n\t}", "public int readyCount ()\n\t{\n\t\tint count =0;\n\t\tIterator<Player> it = iterator();\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tPlayer p = it.next();\n\t\t\tif(p.available())\n\t\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}", "int getChannelStatisticsCount();", "public int getChannelCount() {\n return channelCount;\n }", "int getPeersCount();", "public int getChannelCount();", "public int playerCount(int playerStatus)\n\t{\n\t\tint count = 0;\n\t\tfor(int i=0;i<this.numberOfRows;i+=1)\n\t\t{\n\t\t\tfor(int j=0;j<this.numberOfColumns;j+=1)\n\t\t\t{\n\t\t\t\tif(this.board[i][j].playerStatus==playerStatus)\n\t\t\t\t{\n\t\t\t\t\tcount+=this.board[i][j].value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public int getTurnCount() {\n return turnEncoder.getCount();\n }", "int getParticipantsCount();", "int getParticipantsCount();", "int getChannelsCount();", "public int clientsCount(){\n return clientsList.size();\n }", "public int getChannelCount() {\n if (channelBuilder_ == null) {\n return channel_.size();\n } else {\n return channelBuilder_.getCount();\n }\n }", "public int countryCount(){\n\t\treturn this.countries.size();\n\t}", "public int getChannelCount() {\n return channel_.size();\n }", "public int connectionCount()\n {\n return _connectionCount;\n }", "public Long getMaximumPlayerSessionCount() {\n return this.MaximumPlayerSessionCount;\n }", "public int getNumConnects() {\n\t\treturn numConnects;\n\t}", "public static int numberofplayers (String filename) throws IOException\n {\n int countplayer = 0;\n LineNumberReader L1= new LineNumberReader(new FileReader(filename));// reading the lines by using line reader\n while ((L1.readLine())!=null) {};\t// reading the line while its not null\n countplayer = L1.getLineNumber(); // number of lines equals the number of player\n L1.close();\n return countplayer;\n }", "public int getParticipantsCount()\n {\n return participants.size();\n }", "public int numConnections(){\n return connections.size();\n }", "public int countAllActivePlayers(ArrayList<PlayerController> allPlayers)\n\t{\n\t\tint count = 0;\n\t\tfor(int i=0;i<allPlayers.size();i+=1)\n\t\t{\n\t\t\tif(allPlayers.get(i).active)\n\t\t\t{\n\t\t\t\tcount+=1;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public @UInt32 int getChannelCount();", "public int getListCount() {\n\t\tConnection con = getConnection();\r\n\t\tMemberDAO memberDao = MemberDAO.getInstance();\r\n\t\tmemberDao.setConnection(con);\r\n\r\n\t\tint listCount = memberDao.selectRatingCount();\r\n\r\n\t\tclose(con);\r\n\t\treturn listCount;\r\n\t}", "public int getMaximumPlayers() {\n return maximumPlayers;\n }", "@Override\r\n\tpublic int getConnectionsCount() {\r\n\t\treturn currentConnections.get();\r\n\t}", "public int getChatCount()\n {\n return chatCount;\n }", "public int count() {\r\n return count;\r\n }", "public int getNumCharacters()\n\t{\n\t\treturn gameCharCount;\n\t}", "int getSessionCount();", "public int getParticipantsCount() {\n return participants_.size();\n }", "public int getParticipantsCount() {\n return participants_.size();\n }", "Integer getConnectorCount();", "public int count() {\n return count;\n }", "public int getMaximumPlayers() {\n return getOption(ArenaOption.MAXIMUM_PLAYERS);\n }", "public int getMaxPlayers() {\n return maxPlayers;\n }", "public int count() {\n\t\treturn count;\n\t}", "public int getParticipantsCount() {\n return participants_.size();\n }", "public int getParticipantsCount() {\n return participants_.size();\n }", "@Override\r\n\tpublic int memberCount() {\n\t\treturn sqlSession.selectOne(NAMESPACE + \".member_count_user\");\r\n\t}", "public int getConnectedDeviceCount() {\n return getConnectedDevices().size();\n }", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();", "public int getStatsCount() {\n return instance.getStatsCount();\n }", "public int getCount() {\n\t\treturn Dispatch.get(object, \"Count\").getInt();\n\t}", "int getConnectionCount();", "public int getNumPlayed()\n\t{\n\t\treturn numPlayed;\n\t}", "public Integer getNumCompetitions() {\r\n return numCompetitions;\r\n }", "public int getLobbyIdCount() {\n return lobbyId_.size();\n }", "public int getCardCount() {\n\t\treturn this.cardsInhand.size();\n\t}", "public int getLobbyIdCount() {\n return lobbyId_.size();\n }", "@Exported\n public int getNumberOfOnlineSlaves() {\n int count = 0;\n for (Slave s : slaves) {\n if (s.getComputer().isOnline()) {\n count++;\n }\n }\n return count;\n }", "public int getAvailableCount();", "public int count() {\n return this.count;\n }" ]
[ "0.82681185", "0.8267662", "0.81939244", "0.8176777", "0.8141179", "0.8029487", "0.7968089", "0.79046917", "0.7861193", "0.7847334", "0.7752351", "0.7713133", "0.75327015", "0.74983364", "0.74870425", "0.74741316", "0.7451059", "0.7405569", "0.7370881", "0.7363518", "0.7305456", "0.72584486", "0.72077405", "0.71295524", "0.7087906", "0.70265687", "0.70192975", "0.6966435", "0.69052106", "0.68657625", "0.682046", "0.6813612", "0.67543054", "0.67082906", "0.66934097", "0.66297007", "0.65797573", "0.6551588", "0.65427506", "0.6519181", "0.65009624", "0.6486245", "0.6480723", "0.64681065", "0.6460842", "0.64328337", "0.6416094", "0.6415613", "0.6398628", "0.639699", "0.6393011", "0.63873535", "0.6376673", "0.63712233", "0.63712233", "0.6367622", "0.6366073", "0.6362309", "0.6357947", "0.63457435", "0.63436776", "0.6334143", "0.62872165", "0.6284299", "0.6284021", "0.62727576", "0.6264283", "0.624173", "0.62229204", "0.62228036", "0.6220384", "0.62031573", "0.6192501", "0.61853766", "0.61772704", "0.6169309", "0.6169309", "0.61618197", "0.6153457", "0.61492485", "0.6142152", "0.61405796", "0.61399996", "0.61399996", "0.6133773", "0.6133403", "0.6130138", "0.6130138", "0.6130138", "0.6124574", "0.61220515", "0.61166626", "0.61091435", "0.6106412", "0.6100868", "0.608085", "0.6076609", "0.6076052", "0.6066983", "0.6065364" ]
0.8205426
2
The readyCount instance method is used to get the number of players marked as ready.
public int readyCount() { int count = 0; for(Player player: this.players) { if(player != null) { if(player.isReady()) { ++count; } } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int readyCount ()\n\t{\n\t\tint count =0;\n\t\tIterator<Player> it = iterator();\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tPlayer p = it.next();\n\t\t\tif(p.available())\n\t\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}", "int getNewlyAvailableQuestsCount();", "public int getAvailableCount();", "public int countPlayers(){\n return players.size();\n }", "public int getNewlyAvailableQuestsCount() {\n if (newlyAvailableQuestsBuilder_ == null) {\n return newlyAvailableQuests_.size();\n } else {\n return newlyAvailableQuestsBuilder_.getCount();\n }\n }", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "public int getPlayerCount() {\n \n \treturn playerCount;\n \t\n }", "public int getNewlyAvailableQuestsCount() {\n return newlyAvailableQuests_.size();\n }", "public int playerCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public int getAvailableVersionCount() {\n if (availableVersionBuilder_ == null) {\n return availableVersion_.size();\n } else {\n return availableVersionBuilder_.getCount();\n }\n }", "public int getPlayerCount() {\n\t\treturn playerCount;\n\t}", "public int activePlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null && player.getState()) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int available() {\n return numAvailable;\n }", "public int getNumPlayers() {\n\n\t\treturn this.playerCount;\n\t}", "public int playerCount() {\n\t\treturn playerList.size();\n\t}", "public int getPlayerCount() {\n return 0;\n }", "private int getOnlinePlayers()\n {\n return (int) Bukkit.getOnlinePlayers().stream().filter( p -> p != null && p.isOnline() ).count();\n }", "public static int getNumPlayers(){\n\t\treturn numPlayers;\n\t}", "public int getNumPlayers(){\n\t\treturn this.players.size();\n\t}", "public final int getKnownCount()\r\n {\r\n return knownCount;\r\n }", "public int getReservePokemonCount() {\n if (reservePokemonBuilder_ == null) {\n return reservePokemon_.size();\n } else {\n return reservePokemonBuilder_.getCount();\n }\n }", "int getReservePokemonCount();", "int available() {\n return numAvailable;\n }", "@Override\n\tpublic int selectCount() {\n\n\t\tint res = session.selectOne(\"play.play_count\");\n\n\t\treturn res;\n\t}", "int getDeliveredCount();", "public int getAcksCount() {\n return acks_.size();\n }", "public int getAcksCount() {\n return acks_.size();\n }", "public int numPlayers() {\n return playerList.size();\n }", "int getQuestCount();", "public int getAcksCount() {\n return acks_.size();\n }", "public int getAcksCount() {\n return acks_.size();\n }", "public int getPlayerIdsCount() {\n return playerIds_.size();\n }", "@java.lang.Override\n public int getAvailableVersionCount() {\n return availableVersion_.size();\n }", "public int getCount() {\n\t\treturn channelCountMapper.getCount();\n\t}", "public int nrOfPlayers() {\n int playerCount = 0;\n for (Player player : players) {\n if (player.getName() != null) {\n playerCount++;\n }\n }\n\n return playerCount;\n }", "public int loadedPlayers(){\n return playerMap.size();\n }", "public int getPlayerIdsCount() {\n return playerIds_.size();\n }", "public int getNumOfPlayers() {\n\t\treturn numOfPlayers;\n\t}", "int getParticipantsCount();", "int getParticipantsCount();", "int getProgressCount();", "int getProgressCount();", "int getProgressCount();", "public int numPlayers(){\n return this.members.size();\n }", "public int getNumPlayers() {\n return numPlayers;\n }", "public int numAlivePokemon() {\r\n\t\tint count = 0;\r\n\t\tfor (Pokemon p : ownedPokemon) {\r\n\t\t\tif (p.getCurrentHP() > 0) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}", "public int getNumOfPlayers() {\n\t\treturn playerList.size();\n\t}", "int getNumOfPlayers() {\n return this.numOfPlayers;\n }", "int getAcksCount();", "int getAcksCount();", "int getNumberOfPlayers(){\n return players.size();\n }", "public int getProgressCount() {\n return progress_.size();\n }", "public int getProgressCount() {\n return progress_.size();\n }", "public int getProgressCount() {\n return progress_.size();\n }", "public int getNumberOfPlayers() {\n return listaJogadores.size() - listaJogadoresFalidos.size();\n }", "public int getNumPlayers(){\n return m_numPlayers;\n }", "int getResponsesCount();", "public int getProgressCount() {\n return progress_.size();\n }", "public int getProgressCount() {\n return progress_.size();\n }", "public int getProgressCount() {\n return progress_.size();\n }", "@Exported\n public int getNumberOfOnlineSlaves() {\n int count = 0;\n for (Slave s : slaves) {\n if (s.getComputer().isOnline()) {\n count++;\n }\n }\n return count;\n }", "long getJoinedEventsCount();", "public int getRetryWaitingCount() {\r\n return root.getRetryWaitingCount();\r\n }", "int getCompletedTutorialsCount();", "int getPeerCount();", "public int getQuestCount() {\n if (questBuilder_ == null) {\n return quest_.size();\n } else {\n return questBuilder_.getCount();\n }\n }", "public long getPublicQuestionCount() {\n return Question.count(\"select count(q.id) from Question q, User u, Company c \" +\n \"where q.user = u and u.company = c and u.company = ? and q.status = ? and active = ?\",\n this, QuestionStatus.ACCEPTED, true);\n }", "boolean notifyWhenReady(int playerNr);", "public boolean getReady() {\r\n\t\treturn ready;\r\n\t}", "@Override\n\tpublic int getOnlinePlayerSum() {\n\t\treturn PlayerManager.getInstance().getOnlinePlayers().size();\n\t}", "@javax.annotation.Nullable\n @ApiModelProperty(value = \"readyReplicas is the number of pods targeted by this Deployment with a Ready Condition.\")\n\n public Integer getReadyReplicas() {\n return readyReplicas;\n }", "@java.lang.Override\n public int getReservePokemonCount() {\n return reservePokemon_.size();\n }", "@Override\n public synchronized void isReady(String username, boolean ready) throws RemoteException {\n Player p = getPlayer(username);\n if (p != null) {\n p.setReady(ready);\n System.out.println(username + (ready ? \" no\" : \"\") + \" esta listo!\");\n }\n }", "public int checkNoOfRapelPlayerHolds () { return noOfRapels; }", "public int getParticipantsCount()\n {\n return participants.size();\n }", "public int getCount() {\n return sync.getCount();\n }", "int getFaintedPokemonCount();", "public int countCompletedLevels() {\n return (int)levels.stream().filter(Level::isCompleted).count();\n }", "public final int getPendingCount()\n/* */ {\n/* 508 */ return this.pending;\n/* */ }", "public int getUnreadCount(Player player) {\n QuestionInstance instance = this.getInstance(player);\n if (this.getCbx()) {\n return instance.getActive() && !instance.getValidated() ? 1 : 0;\n } else {\n return instance.getActive() && !instance.getValidated() && instance.getReplies(player).isEmpty() ? 1 : 0;\n }\n }", "private void getNumPlayers() {\n\t\tSystem.out.println(\"How many people are playing? (must be between \"+MIN_PLAYERS+\" and \"+MAX_PLAYERS+\")\");\n\t\tnumPlayers = GetInput.getInstance().anInteger(MIN_PLAYERS, MAX_PLAYERS);\n\t}", "public Integer getScannedCount() {\n return this.scannedCount;\n }", "List<PlayedQuestion> getPlayedQuestionsCount();", "public int getQuestCount() {\n return quest_.size();\n }", "int getPickupsCount();", "int getSubscriptionCount();", "int getDeliveriesCount();", "private int getTotalPlayerCount() {\n String baseUrl = \"https://www.runescape.com/player_count.js?varname=iPlayerCount\";\n String url = baseUrl + \"&callback=jQuery33102792551319766081_1618634108386&_=\" + System.currentTimeMillis();\n try {\n String response = new NetworkRequest(url, false).get().body;\n Matcher matcher = Pattern.compile(\"\\\\(\\\\d+\\\\)\").matcher(response);\n if(!matcher.find()) {\n throw new Exception();\n }\n return Integer.parseInt(response.substring(matcher.start() + 1, matcher.end() - 1));\n }\n catch(Exception e) {\n return 0;\n }\n }", "public int count() {\r\n return count;\r\n }", "int getUserQuestJobsCount();", "public int getNumAlive() {\n return numAlive;\n }", "public static int GetPlayersLeft () {\n int players_left = 0;\r\n\r\n // LOOK AT EACH PLAYER AND CHECK IF THEY HAVEN'T LOST\r\n for (int i = 0; i < player_count; i++) {\r\n if (!player[i].lost)\r\n players_left++;\r\n }\r\n\r\n // RETURN THE RESULTS\r\n return players_left;\r\n }", "public int getNumberOfPeopleWaitingAtFloor(int floor) {\r\n return personCount.get(floor);\r\n }", "@Override\npublic int getNumPlayers() {\n\treturn numPlayer;\n}", "public int getParticipantsCount() {\n return participants_.size();\n }", "public int getParticipantsCount() {\n return participants_.size();\n }", "public int getAllCount(){\r\n\t\tString sql=\"select count(*) from board_notice\";\r\n\t\tint result=0;\r\n\t\tConnection conn=null;\r\n\t\tStatement stmt=null;\r\n\t\tResultSet rs=null;\r\n\t\ttry{\r\n\t\t\tconn=DBManager.getConnection();\r\n\t\t\tstmt=conn.createStatement();\r\n\t\t\trs=stmt.executeQuery(sql);\r\n\t\t\trs.next();\r\n\t\t\tresult=rs.getInt(1);\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tDBManager.close(conn, stmt, rs);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();" ]
[ "0.84620833", "0.68994975", "0.6890458", "0.66155684", "0.6573826", "0.6557323", "0.64937717", "0.648371", "0.6416672", "0.6397754", "0.6391072", "0.6325577", "0.63246846", "0.63131607", "0.63087004", "0.6290155", "0.6271074", "0.6238433", "0.619113", "0.6171227", "0.61708003", "0.61696583", "0.61341804", "0.6133235", "0.6132025", "0.61148936", "0.61148936", "0.6109763", "0.60931265", "0.6085962", "0.6085962", "0.60803515", "0.6065538", "0.60641026", "0.605794", "0.6044213", "0.60322267", "0.6002291", "0.59878296", "0.59878296", "0.5980603", "0.5980603", "0.5980603", "0.5979375", "0.5972055", "0.5956391", "0.59345514", "0.59304893", "0.59177554", "0.59177554", "0.5906676", "0.59050715", "0.59050715", "0.59050715", "0.5904004", "0.58888346", "0.5886611", "0.58676535", "0.58676535", "0.58676535", "0.5848129", "0.58455276", "0.5843512", "0.5829204", "0.58280665", "0.58251256", "0.58214045", "0.57997847", "0.57985836", "0.57842714", "0.5779142", "0.5776149", "0.57732403", "0.57715344", "0.5771315", "0.57697535", "0.5765879", "0.57639337", "0.5763601", "0.5759268", "0.57560956", "0.5746475", "0.574152", "0.5739606", "0.5738415", "0.5716296", "0.57133156", "0.57046014", "0.5704466", "0.5703098", "0.56907123", "0.56902945", "0.5687943", "0.56858635", "0.56781566", "0.56781566", "0.567562", "0.5674512", "0.5674512", "0.5674512" ]
0.8617662
0
The getPrice instance method is used to get the current price of a stock.
public int getPrice(Stock stock) { for(Share share: this.prices) { if(share.getStock().equals(stock)) { return share.getShares(); } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public double getPrice(){\n \n return currentPrice; \n }", "public double getStockPrice() {\n\t\treturn stockPrice;\n\t}", "public Money getPrice() {\n\t\treturn price;\n\t}", "public BigDecimal getStock_price() {\n return stock_price;\n }", "public Double getPrice() {\r\n\t\treturn price;\r\n\t}", "public double getPrice() \n\t{\n\t\treturn price;\n\t}", "public double getPrice() \n\t{\n\t\treturn price;\n\t}", "@Override\r\n\tpublic double getPrice() {\n\t\treturn price;\r\n\t}", "public Double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n return price_;\n }", "public double getPrice()\n\t{\n\t\treturn this.price;\n\t}", "public double getPrice() {\n return price_;\n }", "protected float getPrice() {\n\t\t\treturn price;\n\t\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "public double getPrice() {\r\n\t\treturn this.price;\r\n\t}", "public double getPrice() {\n\t\treturn this.price;\n\t\t\n\t}", "public java.lang.Integer getPrice()\n {\n return price;\n }", "public double getPrice() {\n\t\t\treturn price;\n\t\t}", "public double getPrice(){\n\t\t\treturn price;\n\t\t}", "public double getPrice() {\n\t\treturn this.price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice() {\n\t\treturn price;\n\t}", "public double getPrice()\n {\n \treturn price;\n }", "public BigDecimal getPrice()\n\t{\n\t\treturn price;\n\t}", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice(){\n\t\t\n\t\treturn price;\n\t}", "public Double getPrice() {\n return price;\n }", "public Double getPrice() {\n return price;\n }", "public double getPrice(){\n\t\treturn this.price;\n\t}", "public double getPrice() {\n return this.price;\n }", "public java.math.BigDecimal getPrice() {\n return price;\n }", "public double getPrice()\n {\n return this.price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice(){\r\n\t\treturn price;\r\n\t}", "public Double getPrice() {\r\n return price;\r\n }", "public double getPrice()\r\n {\r\n return this.price;\r\n }", "public double getPrice()\r\n {\r\n return price;\r\n }", "public double getPrice(){\n\t\treturn price;\n\t}", "public Number getPrice() {\n return (Number)getAttributeInternal(PRICE);\n }", "Price getTradePrice();", "@Override\n\tpublic double getPrice() {\n\t\treturn constantPO.getPrice();\n\t}", "public ArmCurrency getPrice() {\n return (getPrice(true));\n }", "public BigDecimal getPrice() {\r\n return price;\r\n }", "public BigDecimal getPrice() {\r\n return price;\r\n }", "public double getPrice()\n {\n return price;\n }", "public java.lang.String getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public Money getPrice() {\n return price;\n }", "public double price() {\n return price;\n }", "public double getPrice(){\n\t\treturn Price; // Return the product's price\n\t}", "public Integer getPrice() {\r\n return price;\r\n }", "public Integer getPrice() {\r\n return price;\r\n }", "public BigDecimal\tgetPrice();", "public String getCurrentPrice() {\n\t\treturn currPrice;\n\t}", "public Double getPrice();", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "public Integer getPrice() {\n return price;\n }", "@Override\n\tpublic int getPrice() {\n\t\treturn product.getPrice();\n\t}", "TickerPrice getPrice(String symbol);", "public long getPrice() {\n return price;\n }", "double getPrice();", "double getPrice();", "double getPrice();", "public Date getPrice() {\n return price;\n }", "public float getPrice() {\n return _price;\n }", "public BigDecimal getPrice() {\n return (BigDecimal)getAttributeInternal(PRICE);\n }", "public Long getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public double getPrice();", "public double getStockMarketPrice() {\n\t\treturn stockMarketPrice;\n\t}", "public String getPrice() {\n return price;\n }", "public String getPrice() {\n return price;\n }", "Price getPrice() throws Exception;", "public Float getPrice() {\n return price;\n }", "public int getPrice() {\n return price_;\n }" ]
[ "0.79063666", "0.781557", "0.76037586", "0.75794786", "0.75559133", "0.7546828", "0.7546828", "0.753589", "0.7526091", "0.752348", "0.75163734", "0.7514892", "0.7508464", "0.75038743", "0.75038743", "0.75038743", "0.7490746", "0.74890155", "0.74873894", "0.7482088", "0.7481485", "0.7478742", "0.7478742", "0.7478742", "0.7478742", "0.7478742", "0.7478431", "0.747282", "0.74684596", "0.74684596", "0.74684596", "0.74684596", "0.7460659", "0.74521494", "0.74521494", "0.74505556", "0.7449515", "0.7444296", "0.7435573", "0.74289495", "0.74289495", "0.74289495", "0.74289495", "0.74289495", "0.74289495", "0.74289495", "0.74289495", "0.74289495", "0.74289495", "0.74289495", "0.7424554", "0.7407264", "0.7403969", "0.7392289", "0.738882", "0.7387275", "0.7374861", "0.7368126", "0.7341684", "0.733766", "0.733766", "0.73376256", "0.73176825", "0.73114216", "0.73047906", "0.73047906", "0.73047906", "0.73047906", "0.73047906", "0.73037523", "0.7299947", "0.72981024", "0.7283107", "0.7283107", "0.7264344", "0.7264296", "0.72642714", "0.7262661", "0.7262661", "0.7262661", "0.7262661", "0.7244919", "0.7242095", "0.72397226", "0.7226375", "0.7226375", "0.7226375", "0.72167337", "0.7207294", "0.71968085", "0.71941644", "0.71899205", "0.71899205", "0.71899205", "0.71888757", "0.71530795", "0.7147488", "0.7147488", "0.71105015", "0.71029943", "0.7100083" ]
0.0
-1
The getPrices instance method is used to get the full list of current prices.
public List<Share> getPrices() { return this.prices; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Double> GetPrices()\r\n\t{\r\n\t\treturn dayStockPrices;\r\n\t}", "public ReservedInstancePriceItem [] getPrices() {\n return this.Prices;\n }", "public static Vector<Company> getAllPrices(){\n\t\treturn all_prices;\n\t}", "Price[] getTradePrices();", "public PriceList getPriceList() {\n\t\treturn priceList;\n\t}", "java.util.List<cosmos.base.v1beta1.CoinOuterClass.Coin> \n getPriceList();", "public ArrayList getPrice() {\n return priceArray;\n }", "@Override\r\n\tpublic List<ProductRaw_Price> getPrices(PageRequest pageable) {\n\t\treturn productRaw_PriceDao.getProductRawPrices(pageable);\r\n\t}", "List<SpotPrice> getAll();", "@java.lang.Override\n public java.util.List<cosmos.base.v1beta1.CoinOuterClass.Coin> getPriceList() {\n return price_;\n }", "public java.util.List<cosmos.base.v1beta1.CoinOuterClass.Coin> getPriceList() {\n if (priceBuilder_ == null) {\n return java.util.Collections.unmodifiableList(price_);\n } else {\n return priceBuilder_.getMessageList();\n }\n }", "public StockPricesVOImpl getStockPricesVO() {\n return (StockPricesVOImpl)findViewObject(\"StockPricesVO\");\n }", "public List<ResourcePrice> listResourcePrices() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn new LinkedList<ResourcePrice>();\n\t}", "public BigDecimal getPriceList();", "public long getPriceList() {\r\n return priceList;\r\n }", "public List prices() {\n List ls = new ArrayList();\n try {\n\n Connection connection = DBUtil.getConnection();\n //PreparedStatement pst = connection.prepareStatement(\"select PriceId,VegetableId,GovernmentPrice,FarmerPrice,WholeSellerPrice,\"\n // + \"RetailerPrice from PriceDetails\");\n /*PreparedStatement pst = connection.prepareStatement(\"SELECT PriceDetails.PriceId,VegetableDetails.VegetableName,PriceDetails.GovernmentPrice,\"\n + \"PriceDetails.FarmerPrice,PriceDetails.WholeSellerPrice,PriceDetails.RetailerPrice\"\n + \" from PriceDetails INNER JOIN VegetableDetails \"\n + \"ON PriceDetails.VegetableId = VegetableDetails.VegetableId\");\n */\n\n PreparedStatement pst = connection.prepareStatement(\"select PriceDetails.PriceId,VegetableDetails.VegetableName,\"\n + \"PriceDetails.GovernmentPrice,PriceDetails.FarmerPrice,PriceDetails.WholeSellerPrice,\"\n + \"PriceDetails.RetailerPrice from PriceDetails INNER JOIN VegetableDetails ON PriceDetails.VegetableId = \"\n + \"VegetableDetails.VegetableId\");\n\n ResultSet rs = pst.executeQuery();\n while (rs.next()) {\n ViewPricesBean vpb = new ViewPricesBean();\n\n vpb.setPriceId(rs.getInt(1));\n vpb.setVegetableName(rs.getString(2));\n // vpb.setRegionName(rs.getString(3));\n vpb.setGovernmentPrice(rs.getFloat(3));\n vpb.setFarmerPrice(rs.getFloat(4));\n vpb.setWholeSellerPrice(rs.getFloat(5));\n vpb.setRetailerPrice(rs.getFloat(6));\n\n\n ls.add(vpb);\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return ls;\n\n }", "public static List getAllPrices() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT cena FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n int naziv = result.getInt(\"cena\");\n polovniautomobili.add(naziv);\n\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }", "public ArrayList<History> getPriceHistory() { return priceHistory; }", "public List<InstanceTypePrice> listInstanceTypePrices() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn new LinkedList<InstanceTypePrice>();\n\t}", "private double[] getMenuItemPrices() {\n double[] prices = new double[menuItemPrices.size()];\n for (int i = 0; i < menuItemPrices.size(); i ++) {\n prices[i] = menuItemPrices.get(i).doubleValue();\n }\n return prices;\n }", "public float getPrices(Integer id);", "@Transactional(readOnly = true)\n public List<AlterationPriceDTO> findAll() {\n log.debug(\"Request to get all AlterationPrices\");\n List<AlterationPriceDTO> result = alterationPriceRepository.findAll().stream()\n .map(alterationPriceMapper::alterationPriceToAlterationPriceDTO)\n .collect(Collectors.toCollection(LinkedList::new));\n\n return result;\n }", "public static List<OptionPricing> getPriceHistory(Date startTradeDate, Date endTradeDate, Date expiration, double strike, String callPut) {\r\n\t\t\r\n\t\tEntityManagerFactory emf = Persistence.createEntityManagerFactory(\"JPAOptionsTrader\");\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\t\r\n\t\t// Note: table name refers to the Entity Class and is case sensitive\r\n\t\t// field names are property names in the Entity Class\r\n\t\tQuery query = em.createQuery(\"select opt from \" + TradeProperties.SYMBOL_FOR_QUERY + \" opt where \"\r\n\t\t\t\t+ \"opt.trade_date >= :startTradeDate \" \r\n\t\t\t\t+ \"and opt.trade_date <= :endTradeDate \" \r\n\t\t\t\t+ \"and opt.expiration=:expiration \"\t\r\n\t\t\t\t+ \"and opt.call_put = :call_put \"\r\n\t\t\t\t+ \"and opt.strike = :strike \"\r\n\t\t\t\t+ \" order by opt.trade_date\");\r\n\t\t\r\n\t\tquery.setParameter(\"startTradeDate\", startTradeDate);\r\n\t\tquery.setParameter(\"endTradeDate\", endTradeDate);\r\n\t\tquery.setParameter(\"expiration\", expiration);\r\n\t\tquery.setParameter(\"call_put\", callPut);\r\n\t\tquery.setParameter(\"strike\", strike);\r\n\t\t\r\n\t\tquery.setHint(\"odb.read-only\", \"true\");\r\n\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tList<OptionPricing> options = query.getResultList();\r\n\t\t\r\n\t\tem.close();\r\n\t\t\r\n\t\treturn options;\r\n\t}", "public java.util.List<? extends cosmos.base.v1beta1.CoinOuterClass.CoinOrBuilder> \n getPriceOrBuilderList() {\n if (priceBuilder_ != null) {\n return priceBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(price_);\n }\n }", "List<Price> findAll();", "@Override\n public double getPrice(){\n \n return currentPrice; \n }", "@java.lang.Override\n public java.util.List<? extends cosmos.base.v1beta1.CoinOuterClass.CoinOrBuilder> \n getPriceOrBuilderList() {\n return price_;\n }", "public TestStockPricesVOImpl getTestStockPricesVO() {\n return (TestStockPricesVOImpl)findViewObject(\"TestStockPricesVO\");\n }", "void loadCurrentPrices() {\n for(SecurityRow row : allSecurities) {\n row.updateCurrentPrice();\n }\n fireTableRowsUpdated(0, allSecurities.size()-1);\n }", "@Override\r\n\tpublic List<GoldPrice> selectAllGoldPrice() {\n\t\tList<GoldPrice> selectAllGoldPrice = gDao.selectAllGoldPrice();\r\n\t\treturn selectAllGoldPrice;\r\n\t}", "public List<SoftwarePrice> listSoftwarePrices() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn new LinkedList<SoftwarePrice>();\n\t}", "public Date getPrice() {\n return price;\n }", "public BigDecimal getPriceListOld();", "public Double getPrice() {\n return price;\n }", "public Double getPrice() {\n return price;\n }", "List<PriceInformation> getPriceForProduct(ProductModel product);", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\n return price;\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public double getPrice() {\r\n return price;\r\n }", "public Double getPrice() {\r\n return price;\r\n }", "public Double getPrice();", "protected float getPrice() {\n\t\t\treturn price;\n\t\t}", "public List<StoragePrice> listStoragePrices() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn new LinkedList<StoragePrice>();\n\t}", "public double getPrice()\r\n {\r\n return price;\r\n }", "public double getPrice()\n {\n return price;\n }", "public double getPrice();", "public float getPrice() {\n return _price;\n }", "public List<BigDecimal> getEarningsList(){\n return earningsList;\n }", "public Double getPrice() {\r\n\t\treturn price;\r\n\t}", "public double getPrice() {\n return this.price;\n }", "public static Collection getCostingRates() throws EnvoyServletException\n {\n try\n {\n return ServerProxy.getCostingEngine().getRates();\n }\n catch (Exception e)\n {\n throw new EnvoyServletException(e);\n }\n }", "Price getTradePrice();", "public double getPrice()\n {\n return this.price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "public BigDecimal getPrice() {\n return price;\n }", "double getPrice();", "double getPrice();", "double getPrice();", "public BigDecimal getPrice() {\r\n return price;\r\n }", "public BigDecimal getPrice() {\r\n return price;\r\n }", "public double getPrice() {\n return price;\n }", "java.util.List<? extends cosmos.base.v1beta1.CoinOuterClass.CoinOrBuilder> \n getPriceOrBuilderList();", "public double getPrice(){\r\n\t\treturn price;\r\n\t}", "public double getPrice()\n {\n \treturn price;\n }", "public java.math.BigDecimal getPrice() {\n return price;\n }", "public double getPrice() {\n return price_;\n }", "@Override\r\n\tpublic List<ProductRaw_Price> findprices(String text, PageRequest pageable) {\n\t\treturn productRaw_PriceDao.findProductRawPrices(text, pageable);\r\n\t}", "public double getPrice()\r\n {\r\n return this.price;\r\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public float getPrice() {\n return price;\n }", "public Float getPrice() {\n return price;\n }", "List<List<Order>> getAllOrdersByPrice() throws OrderBookOrderException;", "public BigDecimal\tgetPrice();", "public Double getPrice() {\n\t\treturn price;\n\t}", "public Float getPrice() {\r\n return price;\r\n }", "public BigDecimal getPrice()\n\t{\n\t\treturn price;\n\t}", "public Money getPrice() {\n return price;\n }", "public double getPrice(){\n\t\t\treturn price;\n\t\t}", "public void UpdatePFStorePrices()\n {\n PlayFabClientModels.GetStoreItemsRequest req = new PlayFabClientModels.GetStoreItemsRequest();\n req.StoreId = cStoreId;\n\n PlayFabErrors.PlayFabResult<PlayFabClientModels.GetStoreItemsResult> result = PlayFabClientAPI.GetStoreItems(req);\n\n String errors = CompileErrorsFromResult(result);\n Log.d(TAG, \"GetStoreItems: \" + (errors == null? \"success\" : errors));\n\n if(result.Result != null)\n {\n for(PlayFabClientModels.StoreItem item : result.Result.Store)\n {\n Log.d(TAG, \"Store Item ID: \" + item.ItemId);\n\n if(item.VirtualCurrencyPrices.containsKey(cVC))\n {\n mStorePrices.put(item.ItemId, Objects.requireNonNull(item.VirtualCurrencyPrices.get(cVC)));\n }\n }\n }\n }", "@Override\n\tpublic List<ProductInfo> getProducts() {\n\t\treturn shoppercnetproducts;\n\t}", "public void setPrices(ReservedInstancePriceItem [] Prices) {\n this.Prices = Prices;\n }", "public double getPrice(){\n\t\treturn price;\n\t}", "List<SpotPrice> getAll(Integer pageNumber, Integer pageSize);", "public double getPrice() {\n return price_;\n }" ]
[ "0.78247297", "0.77679914", "0.75758", "0.72160065", "0.717855", "0.7120052", "0.70184404", "0.69153816", "0.6892907", "0.68544656", "0.6843557", "0.6772173", "0.6647583", "0.6639269", "0.6604595", "0.6602248", "0.6523243", "0.6463167", "0.64497477", "0.64132816", "0.63781005", "0.6298326", "0.6281789", "0.6257503", "0.6238649", "0.6191651", "0.61857665", "0.61631507", "0.6143573", "0.6142487", "0.6128524", "0.61078626", "0.6086277", "0.6067112", "0.6067112", "0.60463184", "0.6013456", "0.6013456", "0.6013456", "0.6013456", "0.6013456", "0.6013456", "0.6013456", "0.6013456", "0.6013456", "0.6013456", "0.6013456", "0.6011066", "0.6011066", "0.6011066", "0.6011066", "0.6009776", "0.6008112", "0.59798276", "0.59716547", "0.5965002", "0.59582067", "0.5952349", "0.59519935", "0.5949346", "0.5949339", "0.59475833", "0.5947072", "0.5939994", "0.59375244", "0.5935924", "0.5935924", "0.5935924", "0.5935924", "0.5935924", "0.59337944", "0.59337944", "0.59337944", "0.59314084", "0.59314084", "0.5927855", "0.59136754", "0.5911145", "0.59085625", "0.59061927", "0.589818", "0.58957446", "0.58941174", "0.58922505", "0.58922505", "0.58922505", "0.58911914", "0.58853424", "0.5881842", "0.587888", "0.5875927", "0.5868829", "0.5868397", "0.5864596", "0.58637476", "0.5862208", "0.58614904", "0.5857633", "0.585414", "0.5850695" ]
0.75046736
3
The getPlayers instance method is used to get the list of currently connected players.
public Player[] getPlayers() { return this.players; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<Player> getPlayers() {\r\n\t\treturn players;\r\n\t}", "public List<Player> getPlayers() {\n\n\t\treturn players;\n\t}", "public List<Player> getPlayers() {\n\t\treturn players;\n\t}", "@Override\n public List<Player> getPlayers() {\n return players;\n }", "protected ClientList getCurrentPlayers() {\r\n\t\treturn this.players;\r\n\t}", "@Override\n public List<Player> getPlayers() {\n return new ArrayList<Player>(players);\n }", "public ArrayList<Player> getPlayers() {\n return players;\n }", "public static Collection<? extends Player> getOnlinePlayers() {\n return Bukkit.getServer().getOnlinePlayers();\n }", "public ArrayList<Player> getPlayers() {\n return players;\n }", "List<Player> getPlayers();", "public ListResponse<PlayerResponse> getPlayers() {\n\t\tcheckProvided();\n\t\treturn players;\n\t}", "@Override\r\n\tpublic ArrayList<PlayerPO> getAllPlayers() {\n\t\treturn playerController.getAllPlayers();\r\n\t}", "@Override\n public ArrayList<Player> getPlayers() throws RemoteException {\n return players;\n }", "public List<Player> getPlayers() {\r\n\t\tList<Player> playerList = new ArrayList<Player>();\r\n\r\n\t\tfor (Player p : players.values()) {\r\n\t\t\tif (p != null)\r\n\t\t\t\tplayerList.add(p);\r\n\t\t}\r\n\r\n\t\treturn playerList;\r\n\t}", "public LinkedList<Player> getPlayers() {\n\t\treturn this.players;\n\t}", "static List<Player> getAllPlayers() {\n\t\treturn null;\r\n\t}", "public Player[] getPlayers() {\n return this.players;\n }", "public Player[] getPlayers() {\n return this.players;\n }", "public Player[] getPlayers() {\n return players;\n }", "public Player[] getPlayers()\n\t{\n\t\treturn players;\n\t}", "public Player[] getPlayers() {\r\n return players;\r\n }", "public List<Player> findAllPlayers(){\n\t\treturn playerRepository.findAll();\n\t}", "public EntityList<Player> getPlayers() {\n\t\treturn players;\n\t}", "public static Map<String, PlayerConfig> getPlayers() {\n return players;\n }", "public Set<Player> getPlayers() {\n return players;\n }", "private Collection<Player> getPlayers() {\n\t\treturn players;\n\t}", "public List<Player> getPlayerList(){\n return this.players;\n }", "public List<Player> getPlayerList()\n\t{\n\t\treturn playerList;\n\t}", "public List<ServerPlayerEntity> getPlayerList() {\n return this.players;\n }", "public String[] getPlayers() {\r\n return playerIds;\r\n }", "public void getPlayerList() {\n if (connected == true) {\n try {\n write(\"get playerlist\");\n } catch (IOException e) {\n System.out.println(\"No connecting with server:ServerCommunication:getPlayerList()\");\n }\n }\n }", "public CompactPlayer[] getPlayers()\n {\n return players;\n }", "@Override\n public ArrayList<Player> getPlayers() {return steadyPlayers;}", "List<Player> listPlayers();", "public ArrayList<Player> getPlayersInGame() {\n return playersInGame;\n }", "public ArrayList<Player> getPlayerList() {\n ArrayList<Player> ret = new ArrayList<>();\n ret.addAll(playerList);\n return ret;\n }", "public Set<UUID> getAlivePlayers() {\n return new HashSet<>(players);\n }", "public List <FootballPlayer> getAllPlayers() {\n\t\treturn market.getAllPlayers();\n\t}", "public List<Player> getPlayersInRoom() {\n\t\treturn playersInRoom;\n\t}", "public Set<String> getPlayers()\n\t{\n\t\tSet<String> player = playerPieces.keySet();\n\t\treturn player;\n\t}", "@Override\n\tpublic List<Player> getPlayer() {\n\t\treturn ofy().load().type(Player.class).list();\n\t}", "public List<Player> getAllPlayers() {\r\n // TODO fix actual order of players in the List.\r\n\r\n List<Player> players = new ArrayList<>();\r\n players.addAll(teamRed.getPlayers());\r\n players.addAll(teamBlue.getPlayers());\r\n\r\n return players;\r\n }", "public Hashtable<Integer, Player> getPlayers() {\r\n\t\treturn players;\r\n\t}", "public List<Player> getAll() {\n PlayerDB pdb = new PlayerDB();\n return pdb.getAll();\n }", "public ArrayList<Entity> getPlayers() {\n ArrayList<Entity> players = new ArrayList<>();\n students.forEach(student -> players.add(student.getPlayer()));\n return players;\n }", "public ArrayList<CardGamePlayer> getPlayerList(){\n\t\treturn this.playerList;\n\t}", "public ArrayList<CardGamePlayer> getPlayerList() {\n\t\treturn playerList;\n\t}", "public List<String> getAllPlayers() throws ServerProblem {\r\n\ttry (Connection connTDB = ConnectionManager.getInstance().getConnection()) {\r\n\t LOGGER.debug(\"Getting all players\");\r\n\t List<String> results = engine.getAllPlayers(connTDB);\r\n\t LOGGER.debug(\"Players found in the database: \" + results);\r\n\t return results;\r\n\t} catch (Exception ex) {\r\n\t String error = \"Problem encountered getting all players: \" + ex;\r\n\t LOGGER.error(error);\r\n\t throw new ServerProblem(error, ex);\r\n\t}\r\n }", "public TennisPlayer[] getAllPlayers() throws TennisDatabaseRuntimeException {\n\t\t \t\n\t\tTennisPlayerContainerIterator iterator = this.iterator();\n\t\t\n iterator.setInorder();\n \t\n TennisPlayer[] outputArray = new TennisPlayer[playerCount];\n \n int index = 0;\n \n while (iterator.hasNext()) {\n \t\n outputArray[index] = iterator.next();\n \n index++;\n \n }\n \n return outputArray;\n \n\t}", "public static List<Player> getTrackablePlayers() {\n\t\tPlayer[] players = Bukkit.getOnlinePlayers();\n\t\tList<Player> players1 = new ArrayList<Player>();\n\t\tfor (int i = 0; i < players.length; i++) {\n\t\t\tif (!players[i].hasMetadata(\"invisible\")) {\n\t\t\t\tplayers1.add(players[i]);\n\t\t\t}\n\n\t\t}\n\t\treturn players1;\n\t}", "@RequestMapping(\"/players\")\n public List<Player> getAllPlayers() {\n return playerService.getPlayerList();\n }", "public ArrayList<Player> getPlayers() {\n return players;\n}", "public List<String> listPlayerNames() {\n return this.playersNames;\n }", "public Map<String, Player> getPlayersMap(){\n return this.players;\n }", "public CopyOnWriteArrayList<Player> getPlayerList() \t\t\t\t\t\t\t{ return this.playerList; }", "public static ArrayList<Player> getPlayerAry(){\n\t\treturn players;\n\t}", "public static ArrayList<Player> getWinners(){return winners;}", "public List<Player> getPlayersOrdered() {\r\n ArrayList<Player> result = new ArrayList<>();\r\n for (PlayerContainer container : players) {\r\n result.add(container.player);\r\n }\r\n return result;\r\n }", "public GUIPlayer[] getGUIPlayers() {\n return this.guiPlayers;\n }", "public List<String> getToggledPlayers() {\n return toggledPlayers;\n }", "public List<PlayerInfo> getPlayerList(GameInfo gi){\n\t\tClientModelFacade facade = ClientModelFacade.getInstance(null);\n\t\t\n\t\tGameInfo[] gameList = facade.getGamesList();\n\n\t\tfor(int i = 0; i < gameList.length; i++){\n\t\t\tif(gameList[i].getId() == gi.getId()){\n\t\t\t\treturn gameList[i].getPlayers();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public List<OpenPlayer> getOpenPlayers() {\r\n if(actuelAktionators.isEmpty()){\r\n throw new IllegalStateException(\"In der Liste der Spieler muss mindestens ein Spieler sein (der Hoechtbietende)\");\r\n }\r\n return actuelAktionators;\r\n }", "public Connect4Player[] getPlayers(){\n\t\tConnect4Player[] output = new Connect4Player[4];\n\t\tif(players.isEmpty()){\n\t\t\tplayers.add(new Connect4Player(this, TOKEN.X));\n\t\t\tplayers.add(new Connect4Player(this, TOKEN.O));\n\t\t}\n\t\toutput[0] = players.get(0);\n\t\toutput[1] = players.get(1);\n\t\treturn output;\n\t}", "public List<PlayerInstance> getAllPlayers()\n\t{\n\t\tfinal List<PlayerInstance> players = new ArrayList<>();\n\t\tfor (Creature temp : getCharactersInside())\n\t\t{\n\t\t\tif (temp instanceof PlayerInstance)\n\t\t\t{\n\t\t\t\tplayers.add((PlayerInstance) temp);\n\t\t\t}\n\t\t}\n\t\treturn players;\n\t}", "public List<ColorId> getPlayerList() {\n return playerList;\n }", "public static ArrayList<Player> getOtherPlayers() {\n ArrayList<Player> all = getAllPlayingPlayers();\n all.remove(getCurrentPlayer());\n\n return all;\n }", "ArrayList<Player> getAllPlayer();", "Collection<User> players();", "private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }", "Set<String> getPlayers();", "List<Player> findAllPlayers();", "public List<Player> getPassengers() {\n\t\tList<Player> ret = new ArrayList<Player>();\n\t\t\n\t\tfor (Player p : Bukkit.getOnlinePlayers()) {\n\t\t\tif (isPassenger(p))\n\t\t\t\tret.add(p);\n\t\t}\n\t\treturn ret;\n\t}", "private List<String> receiveConnectedPlayers(@NotNull String data) {\n ConnectedPlayersDto result = GameGraphics.gson.fromJson(data, ConnectedPlayersDto.class);\n if (result.players != null) {\n players = result.players.stream()\n .filter(Objects::nonNull)\n .map(player -> player.name)\n .collect(Collectors.toList());\n return players;\n }\n return null;\n }", "public Set<Character> players(){\r\n\t\tSet<Character> players = new HashSet<Character>();\r\n\t\tfor(Character character: characters()){\r\n\t\t\tif(character.isPlayer())\r\n\t\t\t\tplayers.add(character);\r\n\t\t}\r\n\t\treturn players;\r\n\t}", "public ArrayList<Player> getOtherPlayers() {\r\n\t\tArrayList<Player> output = new ArrayList<Player>();\r\n\t\toutput.addAll(players);\r\n\t\toutput.remove(getWhoseTurn() - 1);\r\n\t\treturn output;\r\n\t}", "public List<Player> getAllOrdered() {\n PlayerDB pdb = new PlayerDB();\n return pdb.getAllOrdered();\n }", "public synchronized List<Card> getCardsInPlay(){\n cardsInPlay.clear();\r\n \r\n for(Player player: players){\r\n if(player == null){\r\n continue;\r\n }\r\n if(player.getCardsInHand().isEmpty()){\r\n continue;\r\n }\r\n for(Card card: player.getCardsInHand()){\r\n cardsInPlay.add(card);\r\n }\r\n }\r\n return cardsInPlay;\r\n }", "public int getNumOfPlayers() {\n\t\treturn playerList.size();\n\t}", "public List<LobbyPlayer> getPlayers(String code) throws NoDocumentException {\n return Firebase.requestDocument(\"lobbies/\" + code).toObject(LobbyDTO.class).toModel().getPlayers();\n }", "public Collection<Player> getPlayersChunk() {\n var chunk = new Chunk<Player>();\n var playersChunk = chunk.get(this.players, ALL_PLAYERS_CHUNK_SIZE, allPlayersChunkIndex);\n\n // up to ALL_PLAYERS_CHUNK_SIZE with empty players\n // to have an even view\n var startIndex = playersChunk.size();\n for (var i = startIndex; i < ALL_PLAYERS_CHUNK_SIZE; i++) {\n playersChunk.add(new Player(new Person()));\n }\n\n return playersChunk;\n }", "public List<String> getAllPlayerNames() {\n List<String> playerNames = new ArrayList<>(10);\n for (Player p : players) {\n playerNames.add(p.getName());\n }\n return playerNames;\n }", "public static ArrayList<Player> getAllPlayingPlayers() {\n // Anton fix: Would copy the list itself, we want just the items.\n // Remove/add manipulations would affect original list\n /*\n * ArrayList<Player> all = players; for (Player player: all) { if\n * (!player.isPlaying()) { all.remove(player); } }\n */\n\n ArrayList<Player> all = new ArrayList<Player>();\n for (Player player : players) {\n if (player.isPlaying()) all.add(player);\n }\n\n return all;\n }", "public Board getPlayersBoard() {\n return playersBoard;\n }", "public synchronized List<Game> getGameList() {\n return games;\n }", "public Set<GamePiece> getPlayerPieces() \n\t{\n\t\tSet<GamePiece> pieces = new HashSet<GamePiece>();\n\t\tfor(GamePiece piece: playerPieces.values())\n\t\t{\n\t\t\tpieces.add(piece);\n\t\t}\n\t\treturn pieces;\n\t}", "public Set<Player> getParticipants() { //TODO: not sure the validation needs to happend here\n\t\t// Run through the results and make sure all players have been pushed into the participants set.\n\t\tfor ( Result result : results ) {\n\t\t\tparticipants.add(result.getWinner());\n\t\t\tparticipants.add(result.getLoser());\n\t\t}\n\n\t\treturn participants;\n\t}", "public List<List<GameCard>> getPlayerCardsList() {\n return this.playerCardsList;\n }", "public JList<Player> getPlayerListGui() {\r\n return playerListGui;\r\n }", "private int getOnlinePlayers()\n {\n return (int) Bukkit.getOnlinePlayers().stream().filter( p -> p != null && p.isOnline() ).count();\n }", "int getNumberOfPlayers(){\n return players.size();\n }", "public int numPlayers() {\n return playerList.size();\n }", "public static ArrayList<EntityPlayer> getAll() {\r\n\t\ttry {\r\n\t\t\tArrayList<EntityPlayer> players = new ArrayList<EntityPlayer>();\r\n\t\t\t\r\n\t\t\tfor (EntityPlayer player : mc.world.playerEntities) {\r\n\t\t\t\tif (!player.isEntityEqual(mc.player)) {\r\n\t\t\t\t\tplayers.add(player);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn players;\r\n\t\t} catch (NullPointerException ignored) {\r\n\t\t\treturn new ArrayList<EntityPlayer>();\r\n\t\t}\r\n\t}", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "@SuppressWarnings(\"unused\")\n public static List<String> getDiscordChatMutedPlayers() {\n return DiscordListener.chatMuted;\n }", "public int getNumPlayers() {\n return numPlayers;\n }", "public List<Player> getAttackedPlayers() {\r\n\t\tArrayList<Player> output = new ArrayList<Player>();\r\n\t\tfor(Player p : getOtherPlayers()) {\r\n\t\t\tif(!(p.deck.hand.contains(new Moat()) \r\n\t\t\t\t\t|| p.deck.duration.contains(new Lighthouse()) \r\n\t\t\t\t\t|| p.deck.duration.contains(new Champion()) \r\n\t\t\t\t\t|| p.getPlayerNum() == getWhoseTurn())) {\r\n\t\t\t\toutput.add(p);\r\n\t\t\t}\r\n\t\t\tArrayList<Card> reactions = new ArrayList<Card>();\r\n\t\t\tfor(Card c : p.deck.hand) {\r\n\t\t\t\tif(c.isReaction()) reactions.add(c);\r\n\t\t\t}\r\n\t\t\tfor(Card c : reactions) {\r\n\t\t\t\tc.reactAttack();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t}", "public ArrayList<Integer> getXPlayers() {\n return this.xPlayers;\n }", "public int getNumPlayers(){\n\t\treturn this.players.size();\n\t}" ]
[ "0.79977614", "0.79977614", "0.7964292", "0.79313743", "0.7915567", "0.7910655", "0.7873358", "0.78220856", "0.78201693", "0.780598", "0.7802151", "0.77900636", "0.77395314", "0.77046937", "0.7704655", "0.763593", "0.76280755", "0.7622997", "0.75699437", "0.75699437", "0.7555775", "0.7538517", "0.7531326", "0.75150925", "0.7437734", "0.7412961", "0.74124295", "0.74116325", "0.73783547", "0.7370809", "0.7349676", "0.73481095", "0.7327873", "0.72880435", "0.72715825", "0.7239873", "0.7209793", "0.7190319", "0.718907", "0.71549404", "0.7139712", "0.7114627", "0.7105924", "0.7084925", "0.7062948", "0.7051065", "0.6986125", "0.69804853", "0.6917574", "0.6850797", "0.68135244", "0.68081915", "0.68016315", "0.68004113", "0.6780618", "0.6768674", "0.6729844", "0.66908085", "0.66601276", "0.66598624", "0.6659299", "0.665305", "0.6649939", "0.6607822", "0.6600758", "0.65852153", "0.6584608", "0.6563788", "0.655356", "0.65149546", "0.6498141", "0.6497749", "0.6476524", "0.64647317", "0.6457068", "0.6429511", "0.63892996", "0.63694775", "0.63543", "0.6312958", "0.62997854", "0.6298629", "0.6298024", "0.6267286", "0.62640834", "0.6254593", "0.6242998", "0.6229206", "0.6210844", "0.6203856", "0.6200461", "0.61864203", "0.61596906", "0.6140383", "0.61304206", "0.6110457", "0.61090726", "0.6076513", "0.60691077", "0.60486996" ]
0.75324
22
The getRound instance method is used to get the current round.
public int getRound() { return this.round; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getCurrentRound()\n\t{\n \treturn currentRound;\n\t}", "public int getCurrentRound() {\n\t\treturn roundNumber;\n\t}", "public Round getRound(){\n return mRound;\n }", "public Integer getRound() {\n return round;\n }", "public int getRound() {\n return round;\n }", "public synchronized int getCurrentRoundNumber()\r\n {\r\n return currentRoundNumber;\r\n }", "public int getCurrentGameRound(){\n\t\treturn currentGameRound;\n\t}", "public int getRoundNumber() {\n return roundNumber;\n }", "public Round getActualRound() {\n\t\treturn actualRound;\n\t}", "public int getRoundNum(){\n return gameRounds;\n }", "public PaxosRound getRound(int a_round)\n {\n PaxosRound result = (PaxosRound) m_rounds.get(new Integer(a_round));\n return result;\n }", "public PaxosRound createRound()\n {\n return createRound(0);\n }", "public int getNround()\n {\n \treturn this.nround;\n }", "public int getRoundID() {\n return rounds.get(currentRound).getRoundID();\n }", "public static Round currentRound(Group group)\n\t{\n\t\tSession session = HibernateUtil.getSessionFactory().getCurrentSession();\n\t\tRound round = (Round)session.createSQLQuery(\"{call get_current_round(:group_id)}\").addEntity(Round.class).setParameter(\"group_id\", group.getId()).uniqueResult();\n\t\tround.setMatches(MatchDAO.listByRound(round));\n\t\treturn round;\n\t}", "public int getTriggerRound() {\n return triggerRound;\n }", "public double getRoundingIncrement() {\n return roundingIncrement;\n }", "public Round() {\n\t\tthis.niceMoves = null;\n\t\tthis.roundNo = 1;\n\t}", "public int getMaxRound() {\n return maxRound;\n }", "public int getRoundScore() {\n return score;\n }", "public String getSleeveRound() {\r\n\t\treturn sleeveRound;\r\n\t}", "public void setRound(int round) {\r\n this.round = round;\r\n }", "public int getRound() {\n\t\treturn myHistory.size() + opponentHistory.size();\n\t}", "private ChesspairingRound getRound(int roundNumber) {\n\t\tList<ChesspairingRound> rounds = mTournament.getRounds();\n\t\tfor (ChesspairingRound round : rounds) {\n\t\t\tif (round.getRoundNumber() == roundNumber) {\n\t\t\t\treturn round;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalStateException(\n\t\t\t\t\"Tournament in inconsistent state! Not able to find roundNumber = \" + roundNumber);\n\t}", "public int getRounds() {\n\n\t\treturn rounds;\n\t}", "public float getTimeBetweenRounds() {\r\n\t\treturn timeBetweenRounds;\r\n\t}", "abstract GameRound setupRound();", "public static String nextRound() {\n return \"Starting next round.\";\n }", "public int getPointsGainedLastRound(){return pointsGainedLastRound;}", "public Time round() {\n return new Time(DateUtils.truncate(this.date(), Calendar.MINUTE));\n }", "public int getDraws() {\n return drawRound;\n }", "@Override\n protected float getCurrentBottomCornerRadius() {\n return getCurrentTopCornerRadius();\n }", "public Player round() {\n chooseFighter(player1, player2);\n // It's not allowed to construct a Fighter with Health (or Attack) equals 0\n\n Player winner = fight();\n\n gameOver = winner.scoreAPoint(winningScoreLimit);\n\n return winner;\n }", "public PaxosRound createRound(int a_round)\n {\n PaxosRound result = new PaxosRound(this, a_round, getNextRoundLeader(a_round));\n m_rounds.put(new Integer(a_round), result);\n return result;\n }", "public void incrementCurrentRoundNumber() {\n\t\t\n\t\tcurrentRoundnumber = currentRoundnumber +1;\n\t}", "private void newRound() {\r\n\t\tballoonsThisRound = currentRoundNumber * balloonsPerRound * 5;\r\n\t\tcurrentRound = new Round(balloonTypes, 0.3f, balloonsThisRound);\r\n\t\tcurrentRoundNumber++;\r\n\r\n\t\tSystem.out.println(\"Begining Round: \" + currentRoundNumber);\r\n\t}", "public void beginRound() {\r\n\t\tnewRound();\r\n\t}", "public java.math.BigDecimal getRoundOffValue () {\n\t\treturn roundOffValue;\n\t}", "public int getCount() {\n\t\treturn this.countRound;\n\t}", "public void setActualRound(Round actualRound) {\n\t\tthis.actualRound = actualRound;\n\t}", "abstract void startRound();", "public int getRoundsToWait() {\n\t\treturn this.roundsToWait;\n\t}", "public ArrayList<Move> getRound(int round) {\r\n\t\tint startIndex;\r\n\t\tint endIndex;\r\n\t\t\r\n\t\tArrayList<Move> moves = new ArrayList<Move>();\r\n\t\t\r\n\t\t// Guard against negatives\r\n\t\tif (round < 0) {\r\n\t\t\tround = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif (round >= offsets.size()) {\r\n\t\t\tround = offsets.size() - 1;\r\n\t\t\tendIndex = offsets.size();\r\n\t\t} else {\r\n\t\t\tendIndex = offsets.get(round+1);\r\n\t\t}\r\n\t\t\r\n\t\tstartIndex = offsets.get(round);\r\n\t\t\r\n\t\tfor(int i = startIndex; i < endIndex; i++) {\r\n\t\t\tmoves.add(this.getResults().get(i));\r\n\t\t}\r\n\t\t\r\n\t\treturn moves;\r\n\t}", "public double getRadius() { return radius.get(); }", "public Round createRound(Tournament tournament) {\r\n\t\tRound round = new Round(calculateNextRound(tournament));\r\n\t\tcopyAllTournamentPlayers(tournament, round);\r\n\t\treturn round;\r\n\t}", "@Override\r\n\tpublic void setRound(int round) {\n\t\tthis.round = \"Round: \"+round;\r\n\t\tupdate();\r\n\t}", "private static double getWinRate() {\n\t\treturn winRate ;\n\t}", "public void handleNextRound() {\n\t\t\r\n\t}", "public Floor floor() {\r\n\t\treturn this.floor;\r\n\t}", "public int getCurrentFloor() {\n return currentFloor;\n }", "public int getCurrentFloor() {\n return currentFloor;\n }", "public void setRoundNum(int roundNum){\n gameRounds = roundNum;\n }", "public int getRadius()\n {\n return this.radius;\n }", "private void nextRound() {\n\t\n\t\t\n\t\tcfight++;\n\t\tif(cfight>=maxround)\n\t\t{\n\t\tcfight=0;\n\t\t\n\t\tround++;\n\t\t\tmaxround/=2;\n\t\t}\n\t\t\n\tif(round<4)\n\t{\n\tcontrollPCRound();\n\t}\n\telse\n\t{\n\t\tint sp=0;\n\t\tint round=0;\n\t\tfor(int i=0; i<fighter.length; i++)\n\t\t{\n\t\t\tif(spieler[i]>0)\n\t\t\t{\n\t\t\t\tsp++;\n\t\t\t\tif(fround[i]>round)\n\t\t\t\t{\n\t\t\t\tround=fround[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tif(geld==false)\n\t{\n\t\tgeld=true;\n\t\tif(sp==1)\n\t\t{\n\t\tZeniScreen.addZenis(round*3500);\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint w=round*4000-500*sp;\n\t\t\tif(w<1)\n\t\t\t{\n\t\t\t\tw=100;\n\t\t\t}\n\t\t\tZeniScreen.addZenis(w);\t\n\t\t}\n\t}\n\t}\n\t\n\t\n\t}", "public int getCurrentFloor() {\n\t\treturn currentFloor;\n\t}", "public Number getGroundPricePerMeter() {\n return (Number) getAttributeInternal(GROUNDPRICEPERMETER);\n }", "public Game getCurrentGame()\r\n {\r\n return currentGame;\r\n }", "@Override\n public Move getMove() {\n\n return Move.ROCK;\n }", "@RequestMapping(\"/playerDoubles\")\n\tpublic @ResponseBody\n\tRound playerDoubles() {\n\t\tblackJackService.playerDoubles(round);\n\t\treturn round;\n\t}", "@RequestMapping(\"/startGame\")\n\tpublic @ResponseBody\n\tRound startGame() {\n\n\t\tblackJackService.startRound(round);\n\t\treturn round;\n\t}", "public double getRadius()\n {\n return m_Radius;\n }", "public int currentFloor(){\n return currentFloor;\n }", "public float getWindowCornerRadius() {\n return this.mWindowCornerRadius;\n }", "public GoLBoard nextRound()\n\t{ \n\t\t//tempBoard = the new upcoming GoLBoard that will be returned\n \tGoLBoard tempBoard = this.copyBoard(); \n \t\n \t//set the births and deaths to the beginning\n \tcurrentDeath = 0;\n \tcurrentBirths = 0;\n \t \n \t//currRow = current row\n \t//currCol = current column\n \t//Accumulate number of cells that birthed and died\n \t//Update the tempBoard using the updateCell method\n \tfor (int currRow = 1; currRow <= setSize; currRow++)\n \t{\n \tfor (int currCol = 1;currCol <= setSize; currCol++)\n \t{\n \t boolean wasAlive = myGoLCell[currRow][currCol].isAlive();\n \t boolean nowAlive =\n \t \ttempBoard.getCell(currRow,currCol).updateCell(getNeighborhood(currRow,currCol));\n \t currentDeath += (wasAlive && !nowAlive)?1:0;\n \t currentBirths += (!wasAlive && nowAlive)?1:0;\n \t}\n \t}\n \t\n \t//Replace the current myGoLCell with the updated\n \tthis.myGoLCell = tempBoard.myGoLCell;\n \t\n \t//Add number of rounds\n \tcurrentRound++;\n \t\n \t//return the current board\n \treturn this;\n\t}", "public Ground getGround() {\n\t\treturn ground;\n\t}", "public double getRadius(){\n return r;\n }", "public String getRadius()\n\t{\n\t\treturn radius.getText();\n\t}", "public LookupAccountTransactions round(Long round) {\n addQuery(\"round\", String.valueOf(round));\n return this;\n }", "public int getCurrentFloor();", "public double getRadius() {\n\t\treturn r;\n\t}", "public IconBuilder round() {\n\t\tthis.shape = IconShape.ROUND;\n\t\treturn this;\n\t}", "public Round(int roundNo) {\n\t\tthis.niceMoves = new ArrayList<Move>();\n\t\tthis.roundNo = roundNo;\n\t}", "long getRadius();", "int getRadius();", "private void newRound(){\n\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\tSystem.out.println(\"PREPPING ROUND \" + round + \" SETUP. Game Logic round (should be aligned) : \" + gameLogic.getRound());\n\t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\n\t\tSystem.out.println(\"PRINTING LEADSUIT OF NEW ROUND \" + gameLogic.getLeadSuitCard());\n\t\tgameLogic.initialiseDeck();\n\t\tgameLogic.setDealer(round);\n\t\t\n\t\tSystem.out.println(\"Players Hand (Should be empty): \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getHand());\n\t\t\n\t\tgameLogic.setPlayersHand(round);\n\t\tgameLogic.setTrumpCard();\n\t\tgameLogic.setPlayerOrder(round);\n\t\tgameLogic.getTableHand().clearTableHand();\n\n\t\twaitingUser = false;\n\t\tif (waitingUser()){\n\t\t\twaitingUser = true;\n\t\t}\n\n\t\tcurrentPlayer = gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getPlayerId();\n\n\t\tdisplayRoundUI();\n\t\tdisplayTrumpUI();\n\t\tdisplayCardUI();\n\t\tdisplayAvailableBidsUI();\n\t\tdisplayTableHandUI();\n\n\t\tSystem.out.println(\"BEGIN ROUND \" + round);\n\t\ttodoThread();\n\t}", "public Money round(RoundingType roundingType) {\n\n if (amount != null) {\n amount = amount.setScale(0, roundingType.getRoundingKey());\n amount = amount.setScale(2, roundingType.getRoundingKey());\n\n }\n\n return this;\n }", "public Double getRadius() {\n return this.radius;\n }", "public int getRadius() {\n return radius;\n }", "public GRect getSquare() {\n\t\treturn square;\n\t}", "void newRound() {\n // Increase the round number on every round.\n round++;\n\n // Write to the log file\n\t logger.log(divider);\n logger.log(\"\\nRound \" + round + \" starting.\");\n logger.log(\"Active player: \" + activePlayer.getName());\n\n // Log player name and topmost card for all players.\n for (Player player : players) {\n logger.log(player.getName() + \"'s card: \" + player.getTopMostCard()\n .toString());\n }\n\n setGameState(GameState.NEW_ROUND_INITIALISED);\n }", "public float getRadius()\n {\n return _radius;\n }", "@Override\n public double getRadius() {\n return this.getRenderable().getRadius();\n }", "double getRadius();", "public int getCurrentTurnID() {\n return rounds.get(currentRound).getTurnID();\n }", "public void increaseRound() {\n\t\tif(this.activePlayer==this.player1) {\n\t\t\tthis.setScorePlayer1(this.getScorePlayer1()+1);\n\t\t}else {\n\t\t\tthis.setScorePlayer2(this.getScorePlayer2()+1);\n\t\t}\n\t\t//On check si c'est le dernier round\n\t\tif (round != ROUNDMAX) {\n\t\tthis.round++;\n\t\t//On change un round sur deux le premier joueur de la manche\n\t\t\n\t\tif (0==round%2) {\n\t\t\t\n\t\t\tthis.setActivePlayer(player2);\n\t\t}else {\n\t\t\n\t\t\tthis.setActivePlayer(player1);\n\t\t}\n\t\t}else {\n\t\t\t//Sinon la partie est gagne\n\t\t\tdraw.win = true;\n\t\t}\n\t\t}", "@Override\n\tpublic RacingBike get() {\n\t\tSystem.out.println(\"Inside get method of provider class!!!\");\n\t\treturn new ApacheRR310();\n\t}", "public double getCornering() {\r\n return cornering;\r\n }", "public eu.m6r.format.openrtb.MbrWin.Win getWin() {\n return win_;\n }", "public static Game getGame() {\n return game;\n }", "public JButton getLockButton(int round) {\n\t\t\n\t\tJButton tempButton = null;\t//create a temp variable to return depending on which integer is passed to this function\n\t\t\n\t\tif(round == 1) {\n\t\t\ttempButton = firstRaceLockButton;\n\t\t}\n\t\t\n\t\tif(round == 2) {\n\t\t\ttempButton = secondRaceLockButton;\n\t\t}\n\t\t\n\t\tif(round == 3) {\n\t\t\ttempButton = semiFinalRaceLockButton;\n\t\t}\n\t\t\n\t\tif(round == 4) {\n\t\t\ttempButton = finalRaceLockButton;\n\t\t}\n\t\t\n\t\treturn tempButton;\n\t}", "public static List<Match> getRound(int roundNum) {\n\t\tList<Match> round = new ArrayList<Match>();\n\t\tint numInRound = numInRound(roundNum);\n\t\tint roundStart = numInRound - 1;\n\t\tfor (int i = 0; i < numInRound; i++)\n\t\t\tround.add(matches[roundStart + i]);\n\t\treturn round;\n\t}", "public static int numInRound(int round) {\n\t\treturn (int) (Math.pow(2, round - 1));\n\t}", "@Basic @Raw @Immutable\n public double getRadius(){\n return this.startRadius;\n }", "public double getRadius()\r\n {\r\n return radius;\r\n }", "public GtSpins findNextSpin() {\r\n\t\treturn gtSpinsServiceImpl.findNextSpin();\r\n\t}", "public int getRadius() {\n return radius_;\n }", "public final Object getCurrent()\n\t{\n\t\treturn getCapture();\n\t}", "public int getRadius() { return radius; }", "public Rectangle getCurrentRectangle() {\n return this.wotCharacter.getDrawable(this).getRectangle();\n }", "public int getRadius() {\r\n\t\treturn this.radius;\r\n\t}" ]
[ "0.84180677", "0.8356365", "0.82741916", "0.821651", "0.8107867", "0.7925991", "0.7807371", "0.7766279", "0.7673339", "0.70740855", "0.7065951", "0.68071645", "0.6768157", "0.6676699", "0.66464734", "0.66136074", "0.64570737", "0.6410125", "0.6275228", "0.6158244", "0.6126895", "0.60979503", "0.6002317", "0.6000546", "0.5998609", "0.59589106", "0.59435815", "0.592521", "0.5905281", "0.5899967", "0.58816594", "0.58626544", "0.57401115", "0.5739471", "0.5731243", "0.5722597", "0.56775904", "0.5625594", "0.5619357", "0.5619334", "0.5590519", "0.55339515", "0.5524655", "0.54968995", "0.54959285", "0.5491471", "0.54869103", "0.5465903", "0.5460504", "0.5454822", "0.5454822", "0.53955686", "0.53944767", "0.5373219", "0.53720385", "0.53704333", "0.53667945", "0.53445125", "0.5339218", "0.5338103", "0.5328618", "0.53235555", "0.5320754", "0.5318704", "0.5295447", "0.52774453", "0.5266129", "0.5266124", "0.5263092", "0.5259644", "0.5256872", "0.52509564", "0.52500623", "0.52289885", "0.52235806", "0.5222626", "0.5218418", "0.52175844", "0.52169764", "0.5216598", "0.5211652", "0.5208882", "0.52066004", "0.5203469", "0.5199222", "0.51901555", "0.51821816", "0.51806605", "0.51760316", "0.51751614", "0.5173662", "0.5169787", "0.5164484", "0.51618755", "0.5160463", "0.5158417", "0.51554537", "0.5155017", "0.5150458", "0.5146383" ]
0.80654335
5
The getPhase instance method is used to get the current phase.
public int getPhase() { return this.phase; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int getPhase() {\n return this.phase;\n }", "public int getPhase() {\n return this.phase;\n }", "public Integer getPhase() {\n return phase;\n }", "public String getPhase() {\n\t\treturn phase;\n\t}", "public Phase getD_CurrentPhase() {\n return d_CurrentPhase;\n }", "double getPhase();", "public String phase() {\n return this.phase;\n }", "public Phase getGamePhase() {\r\n return gamePhase;\r\n }", "public String getPhaseName() {\r\n return this.phaseName;\r\n }", "public String phaseName() {\n return this.phaseName;\n }", "public ProjectPhaseStatus getPhaseStatus() {\r\n return phaseStatus;\r\n }", "public ProjectPhaseType getPhaseType() {\r\n return phaseType;\r\n }", "public DoubleProperty getControlPhase() {\n return this.inputAdjuster.getCurrentPhase();\n }", "@Override\r\n\tpublic PhaseId getPhaseId() {\n\t\treturn PhaseId.ANY_PHASE;\r\n\r\n\t}", "public PhaseValidator getPhaseValidator() {\r\n return this.delegate.getPhaseValidator();\r\n }", "public DoubleProperty getReactorPhase() {\n return this.reactorLine.getCurrentPhase();\n }", "public void setPhase(Integer phase) {\n this.phase = phase;\n }", "public PhaseResult getResult(){return result;}", "public void setPhase(int phase) {\n this.phase = phase;\n }", "@Override\n\tpublic PhaseId getPhaseId() {\n\t\treturn PhaseId.RENDER_RESPONSE;\n\t}", "public boolean active() //ignores them. yeahhhhhh\r\n\t{\r\n\t\treturn super.getPhase();\r\n\t}", "XMLSecurityConstants.Phase getPhase();", "public void setPhaseName(String phaseName) {\r\n this.phaseName = phaseName;\r\n }", "@Override\n public void toTurnPhase() {\n changePhase(new TurnPhase());\n }", "protected double performMappedPhase(double time) {\n\t\tif (getPhase() == null) {\n//\t\t\treturn time;\n\t\t\tthrow new IllegalArgumentException(person + \"'s Task phase is null\");\n\t\t}\n\t\t\n\t\tif (DRINK_WATER.equals(getPhase())) {\n\t\t\treturn drinkingWaterPhase(time);\t\t\t\n\t\t} else if (LOOK_FOR_FOOD.equals(getPhase())) {\n\t\t\treturn lookingforFoodPhase(time);\n\t\t} else if (EAT_MEAL.equals(getPhase())) {\n\t\t\treturn eatingMealPhase(time);\n\t\t} else if (EAT_PRESERVED_FOOD.equals(getPhase())) {\n\t\t\treturn eatingPreservedFoodPhase(time);\t\n\t\t} else if (PICK_UP_DESSERT.equals(getPhase())) {\n\t\t\treturn pickingUpDessertPhase(time);\n\t\t} else if (EAT_DESSERT.equals(getPhase())) {\n\t\t\treturn eatingDessertPhase(time);\n\t\t} else {\n\t\t\treturn time;\n\t\t}\n\t}", "@Override\r\n\tpublic PhaseId getPhaseId() {\n\t\treturn PhaseId.RESTORE_VIEW;\r\n\t}", "private ExonPhase determinePhase(int _bound)\n\t{\n\t\tswitch(_bound % 3)\n\t\t{\n\t\tcase 0:\n\t\t\treturn ExonPhase.PHASE0;\n\t\tcase 1:\n\t\t\treturn ExonPhase.PHASE1;\n\t\tdefault:\n\t\t\treturn ExonPhase.PHASE2;\n\t\t}\n\t}", "private void phase(PhaseId phaseId, Phase phase, FacesContext context)\n throws FacesException {\n boolean exceptionThrown = false;\n Throwable ex = null;\n if (logger.isLoggable(Level.FINE)) {\n logger.fine(\"phase(\" + phaseId.toString() + \",\" + context + \")\");\n }\n \n \tint \n \t i = 0,\n \t maxBefore = 0;\n List<PhaseListener> tempListeners = (ArrayList<PhaseListener>)listeners.clone();\n \ttry {\n // Notify the \"beforePhase\" method of interested listeners\n \t // (ascending)\n // Fix for bug 6223295. Get a pointer to 'listeners' so that \n // we still have reference to the original list for the current \n // thread. As a result, any listener added would not show up \n // until the NEXT phase but we want to avoid the lengthy\n // synchronization block. Due to this, \"listeners\" should be \n // modified only via add/remove methods and must never be updated\n // directly.\n \t if (tempListeners.size() > 0) {\n PhaseEvent event = new PhaseEvent(context, phaseId, this);\n for (i = 0; i < tempListeners.size(); i++) {\n PhaseListener listener = tempListeners.get(i);\n if (phaseId.equals(listener.getPhaseId()) ||\n PhaseId.ANY_PHASE.equals(listener.getPhaseId())) {\n listener.beforePhase(event);\n }\n maxBefore = i;\n }\n }\n \t}\n\tcatch (Throwable e) {\n \t if (logger.isLoggable(Level.WARNING)) {\n logger.warning(\"phase(\" + phaseId.toString() + \",\" + context + \n \t\t\t \") threw exception: \" + e + \" \" + e.getMessage() +\n \t\t\t \"\\n\" + Util.getStackTraceString(e));\n \t }\n }\n \t \n \ttry { \n \t // Execute this phase itself (if still needed)\n \t if (!skipping(phaseId, context)) {\n \t\tphase.execute(context);\n \t }\n \t} catch (Exception e) {\n // Log the problem, but continue\n if (logger.isLoggable(Level.WARNING)) {\n logger.log(Level.WARNING, \"executePhase(\" + phaseId.toString() + \",\" \n + context + \") threw exception\", e);\n }\n ex = e;\n exceptionThrown = true;\n } \n \tfinally {\n try {\n // Notify the \"afterPhase\" method of interested listeners\n // (descending)\n if (tempListeners.size() > 0) {\n PhaseEvent event = new PhaseEvent(context, phaseId, this);\n for (i = maxBefore; i >= 0; i--) {\n PhaseListener listener = tempListeners.get(i);\n if (phaseId.equals(listener.getPhaseId()) ||\n PhaseId.ANY_PHASE.equals(listener.getPhaseId())) {\n listener.afterPhase(event);\n }\n }\n }\n }\n catch (Throwable e) {\n if (logger.isLoggable(Level.WARNING)) {\n logger.warning(\"phase(\" + phaseId.toString() + \",\" + context + \n \") threw exception: \" + e + \" \" + e.getMessage() +\n \"\\n\" + Util.getStackTraceString(e));\n }\n }\n }\n // Allow all afterPhase listeners to execute before throwing the\n // exception caught during the phase execution.\n if (exceptionThrown) {\n throw new FacesException(ex.getCause());\n } \n }", "@Override\n\tpublic PhaseId getPhaseId() {\n\t\treturn PhaseId.RESTORE_VIEW;\n\t}", "@Override\n public AnalysisPhase getAnalysisPhase() {\n return AnalysisPhase.FINDING_ANALYSIS;\n }", "public void testGetPhase_Simple() throws Exception {\n Phase phase = persistence.getPhase(6);\n Project project = phase.getProject();\n assertEquals(\"Failed to get project of phase.\", 2, project.getId());\n assertEquals(\"Failed to get phase status.\", 1, phase.getPhaseStatus().getId());\n assertEquals(\"Failed to get phase type.\", 1, phase.getPhaseType().getId());\n assertEquals(\"Failed to get fixedStartTime.\", null, phase.getFixedStartDate());\n assertEquals(\"Failed to get scheduledStartTime\", parseDate(\"2006-01-01 11:11:11.111\"), phase\n .getScheduledStartDate());\n assertEquals(\"Failed to get scheduledEndTime\", parseDate(\"2006-01-01 11:11:22.111\"), phase\n .getScheduledEndDate());\n assertEquals(\"Failed to get actualStartTime\", null, phase.getActualStartDate());\n assertEquals(\"Failed to get actualEndTime\", null, phase.getActualEndDate());\n assertEquals(\"Failed to get length\", 6000, phase.getLength());\n assertEquals(\"There should be 2 phases of the project.\", 2, project.getAllPhases().length);\n }", "float getStepPhaseShiftIncrement();", "public String getMoonPhaseString()\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Phase: \").append(getMoonPhaseName());\n\t\tsb.append(\", Percent Illuminated: \").append(percentIlluminated).append(\"%\");\n\t\t\n\t\treturn sb.toString();\n\t}", "public void setPhaseType(ProjectPhaseType phaseType) {\r\n this.phaseType = phaseType;\r\n }", "public TimeStep getTimeStep() {\n\t\t// Only here to ensure it is being used correctly.\n\t\t// cbit.util.Assertion.assertNotNull(fieldTimeStep);\n\t\treturn fieldTimeStep;\n\t}", "@Test\n public void testStartUpPhase() {\n d_gameEngine.setPhase(new StartUpPhase(d_gameEngine));\n assertEquals(\"StartUpPhase\", d_gameEngine.d_gamePhase.getClass().getSimpleName());\n }", "float getVoltageStepIncrementOutOfPhase();", "public void setPhaseStatus(ProjectPhaseStatus phaseStatus) {\r\n this.phaseStatus = phaseStatus;\r\n }", "public PhaseStatus[] getAllPhaseStatuses() throws PhaseManagementException {\r\n return this.delegate.getAllPhaseStatuses();\r\n }", "public void updatePhase(Phase currentPhase) {\n\t\titem.setText(0, currentPhase.name());\n\t}", "public AttackPhaseObserver() {\n\t\tsuper();\n\t\tthis.actions = new ArrayList<String>();\n\t\tthis.gamePhaseName = \"ATTACK PHASE\";\n\t}", "protected String getCurrentStatusColumn() {\n\t\treturn \"CurrentPhase\";\n\t}", "public boolean isLastPhase ()\n {\n return true;\n }", "public Direction getCurrentHeading()\r\n\t{\r\n\t\treturn this.currentDirection;\r\n\t\t\r\n\t}", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public int getStep() {\n return step_;\n }", "public Integer getStep() {\n return step;\n }", "public void testCreatePhase_Special() throws Exception {\n // prepare the phase instance to test.\n Project project = new Project(new Date(), new DefaultWorkdays());\n project.setId(2);\n Phase phase = new Phase(project, 12345678);\n phase.setScheduledStartDate(parseDate(\"2006-01-02 11:11:13.111\"));\n phase.setScheduledEndDate(parseDate(\"2006-01-03 11:11:13.111\"));\n phase.setPhaseStatus(new PhaseStatus(2, \"Open\"));\n phase.setPhaseType(new PhaseType(1, \"dummy\"));\n phase.setId(2468);\n\n // create the phase in persistence\n persistence.createPhase(phase, \"reviewer\");\n\n // validate the result\n DBRecord record = TestHelper.getPhaseRecords(\" WHERE project_phase_id=\" + phase.getId())[0];\n assertEquals(\"Failed to store fixedStartDate as null\", phase.getFixedStartDate(), record\n .getValue(\"fixed_start_time\"));\n assertEquals(\"Failed to store scheduledStartDate\", phase.getScheduledStartDate(), record\n .getValue(\"scheduled_start_time\"));\n assertEquals(\"Failed to store scheduledEndDate\", phase.getScheduledEndDate(), record\n .getValue(\"scheduled_end_time\"));\n assertEquals(\"Failed to store actualStartDate as null\", phase.getActualStartDate(), record\n .getValue(\"actual_start_time\"));\n assertEquals(\"Failed to store actualEndDate as null\", phase.getActualEndDate(), record\n .getValue(\"actual_end_time\"));\n assertEquals(\"Failed to store phase status id\", new Long(2), record.getValue(\"phase_status_id\"));\n assertEquals(\"Failed to store phase type id\", new Long(1), record.getValue(\"phase_type_id\"));\n }", "public int getStep () {\n\t\treturn step_;\n\t}", "protected int getStep() {\n\t\treturn step;\n\t}", "public int getStep()\n\t{\n\t\treturn step;\n\t}", "int getStep();", "int getStep();", "int getStep();", "public double getStep() {\n\t\treturn step;\n\t}", "public void phaseManager() throws IOException {\n\t\t\r\n\t\t\r\n\t\tswitch (phase) {\r\n\t\tcase DEPLOY:\r\n\t\t\tdeploy();\r\n\t\t\tbreak;\r\n\t\tcase ATTACK:\r\n\t\t\tattack();\r\n\t\t\tbreak;\r\n\t\tcase REINFORCE:\r\n\t\t\treinforce();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public float getElapsed()\n {\n return this.elapsed;\n }", "void setPhaseStatus(GeneralStatus phaseStatus);", "public Vertex2F getStep()\n {\n return this.step.clone();\n }", "public void testGetPhase_NotExist() throws Exception {\n Phase phase = persistence.getPhase(212354);\n assertNull(\"Should return null for unknown id.\", phase);\n }", "public int getStep() {\n\t\treturn step;\n\t}", "public RateApolicyPage identifyPhase(String PhaseValue) {\r\n sleep(3000);\r\n ExtentReporter.logger.log(LogStatus.PASS, \"Verify Phase is changed to Binder.\");\r\n PolicyBinderPage pbp = new PolicyBinderPage(driver);\r\n pbp.verifyPhase(PhaseValue);\r\n return new RateApolicyPage(driver);\r\n }", "public ElementHeader getCurrentStep()\n {\n return currentStep;\n }", "public String getMoonPhaseName()\n\t{\n\t\tint moonInt;\n\t\ttry\n\t\t{\n\t\t\tmoonInt = Integer.valueOf(ageOfMoon);\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tmoonInt = 0;\n\t\t}\n\t\treturn (MOON_PHASE.getByAge(moonInt)).getTxtName();\n\t}", "public SHPEnvelope getEnvelope() {\n return envelope;\n }", "public Optional<Step> getCurrentStep() {\n return fromNullable(currentStep);\n }", "public Stage returnStage() {\n\t\t\treturn stage;\n\t\t}", "public Stage getStage() {\n return stage;\n }", "public Stage getStage() {\n return stage;\n }", "public Stage getStage() {\n return stage;\n }", "public GameObjectState getState() {\r\n\t\treturn state;\r\n\t}", "@Override\r\n\tpublic double getCurrentStepStart() {\n\t\treturn 0;\r\n\t}", "protected void changePhase(Phase phase) {\n controller.setPhase(phase);\n }", "public CockpitPhaseManager() {\r\n }", "public void resetPhase();", "public GameState getGameProgress() {\r\n return gameProgress;\r\n }", "public GameTimer getTimer()\n {\n return timer;\n }", "public PhaseMovement(GameScreen gameScreen) {\n super(gameScreen, TurnPhaseType.MOVEMENT);\n }", "public Stage getStage() {\n return stage;\n }", "public V1NamespaceStatus withPhase(String phase) {\n this.phase = phase;\n return this;\n }", "public GamePhase(String name)\n\t{\n\t\t// Initializes attributes\n\t\tthis.dead = false;\n\t\tthis.name = name;\n\t\tthis.connectedBankNames = new HashMap<ResourceType, String[]>();\n\t}", "@Override\r\n\tpublic void beforePhase(PhaseEvent event) {\n\t\t\r\n\t}", "public Stage retrieveStage()\n {\n return gameStage;\n }", "public void testCreatePhase_Normal() throws Exception {\n // prepare the phase instance to test.\n Project project = new Project(new Date(), new DefaultWorkdays());\n project.setId(1);\n Phase phase = new Phase(project, 12345678);\n phase.setFixedStartDate(parseDate(\"2006-01-01 11:11:13.111\"));\n phase.setScheduledStartDate(parseDate(\"2006-01-02 11:11:13.111\"));\n phase.setScheduledEndDate(parseDate(\"2006-01-03 11:11:13.111\"));\n phase.setActualStartDate(parseDate(\"2006-01-04 11:11:13.111\"));\n phase.setActualEndDate(parseDate(\"2006-01-05 11:11:13.111\"));\n phase.setPhaseStatus(new PhaseStatus(2, \"Open\"));\n phase.setPhaseType(new PhaseType(1, \"dummy\"));\n phase.setId(13579);\n\n // add some dependencies to the phase\n Phase phase1 = new Phase(project, 1234);\n phase1.setId(1);\n phase.addDependency(new Dependency(phase1, phase, true, false, 1234567));\n Phase phase3 = new Phase(project, 1234);\n phase3.setId(3);\n phase.addDependency(new Dependency(phase3, phase, false, true, 7654321));\n\n // create the phase in persistence\n persistence.createPhase(phase, \"reviewer\");\n\n // validate the result\n DBRecord record = TestHelper.getPhaseRecords(\" WHERE project_phase_id=\" + phase.getId())[0];\n assertEquals(\"Failed to store project_id\", new Long(1), record.getValue(\"project_id\"));\n assertEquals(\"Failed to store fixedStartDate\", phase.getFixedStartDate(), record\n .getValue(\"fixed_start_time\"));\n assertEquals(\"Failed to store scheduledStartDate\", phase.getScheduledStartDate(), record\n .getValue(\"scheduled_start_time\"));\n assertEquals(\"Failed to store scheduledEndDate\", phase.getScheduledEndDate(), record\n .getValue(\"scheduled_end_time\"));\n assertEquals(\"Failed to store actualStartDate\", phase.getActualStartDate(), record\n .getValue(\"actual_start_time\"));\n assertEquals(\"Failed to store actualEndDate\", phase.getActualEndDate(), record\n .getValue(\"actual_end_time\"));\n assertEquals(\"Failed to store phase status id\", new Long(2), record.getValue(\"phase_status_id\"));\n assertEquals(\"Failed to store phase type id\", new Long(1), record.getValue(\"phase_type_id\"));\n\n // validate the dependency\n DBRecord[] records = TestHelper.getDependencyRecords(\" WHERE dependent_phase_id=\" + phase.getId());\n assertEquals(\"Should store 2 dependencies.\", 2, records.length);\n record = null;\n for (int i = 0; i < records.length; ++i) {\n if (records[i].getValue(\"dependency_phase_id\").equals(new Long(3))) {\n record = records[i];\n }\n }\n assertNotNull(\"Should add dependency with phase 3.\", record);\n assertEquals(\"Failed to store dependencyStart.\", new Boolean(false), record\n .getValue(\"dependency_start\"));\n assertEquals(\"Failed to store dependentStart.\", new Boolean(true), record.getValue(\"dependent_start\"));\n assertEquals(\"Failed to store lagtime.\", new Long(7654321), record.getValue(\"lag_time\"));\n }", "public String endActionPhase() {\n String phaseDescription = \"\\n\" + applyAllEffects() + \"\\n\";\n removeDeadEnemies();\n return phaseDescription;\n }", "public PhaseListener[] getPhaseListeners() {\n \n synchronized (listeners) {\n PhaseListener results[] = new PhaseListener[listeners.size()];\n return ((PhaseListener[]) listeners.toArray(results));\n }\n \n }", "public long getElapsedTime() {\n\t\treturn this.getTime();\n\t}", "String wkhtmltoimage_phase_description(PointerByReference converter, int phase);", "public PhaseType[] getAllPhaseTypes() throws PhaseManagementException {\r\n return this.delegate.getAllPhaseTypes();\r\n }", "public double getElapsedTime()\n\t{\n\t\treturn elapsedTime;\n\t}", "@Override\n\tpublic float getRotation() {\n\t\treturn player.getRotation();\n\t}", "public ProcessingStage getStage();", "public int getMovement() {\n return tempUnit.getMovement();\n }", "public synchronized double getPhi() {\n return phi;\n }", "public String getTransition(int subsystem) {\n return _avTable.get(ATTR_TRANSITION, subsystem);\n }" ]
[ "0.84086406", "0.8405662", "0.8339386", "0.8243151", "0.81131893", "0.79948896", "0.79521406", "0.7731136", "0.77106464", "0.74260104", "0.7217502", "0.716918", "0.71565753", "0.6990769", "0.6731599", "0.6607765", "0.6467386", "0.6461022", "0.6445761", "0.6109343", "0.5856984", "0.5839353", "0.5838009", "0.5720742", "0.57101524", "0.56648123", "0.56257033", "0.55963844", "0.5554285", "0.5518085", "0.5497428", "0.54869914", "0.5414318", "0.53596956", "0.53552353", "0.52836496", "0.52481794", "0.52393603", "0.52323717", "0.5216211", "0.517436", "0.5162204", "0.51350933", "0.512122", "0.50992334", "0.50992334", "0.50992334", "0.50835323", "0.50741243", "0.50741243", "0.50741243", "0.50696", "0.50573605", "0.50560236", "0.50518215", "0.5047875", "0.5043838", "0.5043838", "0.5043838", "0.5032998", "0.50323737", "0.5024512", "0.50069535", "0.4999568", "0.49838382", "0.49508786", "0.49389926", "0.49357542", "0.49350473", "0.49302465", "0.49237177", "0.48927304", "0.4865136", "0.4865136", "0.4865136", "0.48528564", "0.48512536", "0.48495266", "0.48402396", "0.48400506", "0.48393038", "0.48361957", "0.4834759", "0.48236868", "0.48232016", "0.481541", "0.48137048", "0.47927025", "0.4786438", "0.4783548", "0.4768657", "0.4763832", "0.47589827", "0.4754094", "0.47460365", "0.4743854", "0.47359052", "0.47263494", "0.47173285", "0.47165498" ]
0.83340263
3
The isInProgress instance method is used to check if a game is in progress.
public boolean isInProgress() { return this.inProgress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean isInProgress() {\n\t\treturn false;\r\n\t}", "public boolean isInGame() {\n return this.hasStarted;\n }", "boolean hasProgress();", "boolean hasProgress();", "boolean isGameComplete();", "public boolean hasProgress();", "private boolean hasInProgressAttempt(QueuedRequestWithState queuedRequestWithState) {\n return (\n queuedRequestWithState.getCurrentState() ==\n InternalRequestStates.SEND_APPLY_REQUESTS &&\n !agentManager\n .getAgentResponses(queuedRequestWithState.getQueuedRequestId().getRequestId())\n .isEmpty()\n );\n }", "@Override\n public Boolean isLoading() {\n return loadingInProgress;\n }", "public boolean inProgress(){return (this.currentTicket != null);}", "public abstract boolean isSearchInProgress();", "public boolean isRunning(){\n\t\treturn gameRunning;\n\t}", "public boolean isRunning(){\n return !paused;\n }", "protected boolean hasGameStarted() {\r\n return super.hasGameStarted();\r\n }", "@Override\n public boolean isRunning() {\n return !paused;\n }", "public boolean isPaused();", "boolean isNetworkCallInProgress() {\n return mRepository.isNetworkCallInProgress();\n }", "@Test\n void testInProgressTrue() {\n Mockito.when(level.isAnyPlayerAlive()).thenReturn(true);\n Mockito.when(level.remainingPellets()).thenReturn(1);\n\n game.start();\n game.start();\n\n Assertions.assertThat(game.isInProgress()).isTrue();\n Mockito.verify(level, Mockito.times(1)).addObserver(Mockito.eq(game));\n Mockito.verify(level, Mockito.times(1)).start();\n }", "public boolean isRequestInProgress(final int requestId) {\n return (mRequestSparseArray.indexOfKey(requestId) >= 0);\n }", "boolean hasStartGameRequest();", "@java.lang.Override\n public boolean hasProgress() {\n return progress_ != null;\n }", "boolean isPlayableInGame();", "public void isStillInCombat() {\n isInCombat = enemiesInCombat.size() > 0;\n }", "public boolean userStillInGame() {\n return playersInGame.contains(humanPlayer);\n }", "public boolean is_completed();", "protected abstract boolean isGameFinished();", "public boolean\t\t\t\t\t\tisGameStarted()\t\t\t\t\t\t\t\t{ return this.gameStarted; }", "public boolean isPaused(){\r\n\t\tif (this.pauseGame(_p)){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t}", "public boolean hasEnded(){\r\n\t\treturn state == GameState.FINISHED;\r\n\t}", "protected boolean isFinished() {\n \t\n \tif(current_time >= goal) {\n \t\t\n \t\treturn true;\n \t}else {\n \t\t\n \t\treturn false;\n \t}\n }", "boolean hasIsComplete();", "boolean hasIsComplete();", "@Override\n public final boolean isRunning() {\n return (this.running && runningAllowed());\n }", "boolean isRunning();", "boolean isRunning();", "boolean isRunning();", "boolean isRunning();", "boolean isRunning();", "public boolean hasProgress() {\n return progressBuilder_ != null || progress_ != null;\n }", "public boolean isFinished() {\n\t\tif (gameSituation == UNFINISHED) {\n\t\t\treturn false;\n\t\t} // Of if\n\n\t\treturn true;\n\t}", "public boolean isRunning();", "public boolean isRunning();", "public boolean isRunning();", "public boolean isRunning();", "public boolean isRunning();", "public boolean isRunning();", "public boolean isCurrentPlayer() {\n return playerStatus.isActive;\n }", "private boolean canPauseGame() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n && gameStateManager.getState().equals(GameState.PLAY);\n }", "public void checkPaused()\n {\n paused = true;\n }", "boolean isComplete();", "boolean isComplete();", "private boolean canResumeGame() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n && isGamePaused();\n }", "protected boolean isFinished() {\n\t\tif(switchSide) {\n\t\t\treturn !launchCubeSwitch.isRunning() && state == 4;\n\t\t}\n\t\telse if(scaleSide) {\n\t\t\treturn !launchCubeScale.isRunning() && state == 4;\n\t\t}\n\t\telse {\n\t\t\treturn !crossLine.isRunning() && timer.get() > 1;\n\t\t}\n\t}", "public boolean getIsCompletingGame()\r\n {\r\n return this.isCompletingGame; \r\n }", "public boolean isPaused() {\r\n return paused;\r\n }", "@Override\n protected boolean isFinished() {\n return (Math.abs(hpIntake.getWristPosition()) - HatchPanelIntake.positions[position.ordinal()] < Math.PI/12);\n }", "protected boolean isFinished() {\n return System.currentTimeMillis() - timeStarted >= timeToGo;\n }", "public boolean isPaused() {\n return paused;\n }", "public boolean isPaused() {\n return _isPaused;\n }", "boolean hasActivePokemon();", "public boolean isRunning () {\n\t\t\tsynchronized (runningLock) {\n\t\t\t\treturn running;\n\t\t\t}\n\t\t}", "public boolean gameStarted() {\n\t\treturn startGame;\n\t}", "public boolean isExecuting(){\n return !pausing;\n }", "public void setStateToInProgress() {\n progressBar.setIndeterminate(true);\n progressBarLabel.setText(\"Simulation is in progress...\");\n openFolderButton.setVisible(false);\n }", "public void isPaused() { \r\n myGamePaused = !myGamePaused; \r\n repaint(); \r\n }", "boolean isOpen() {\n return state == RUNNING;\n }", "public boolean isPaused()\n\t{\n\t\treturn isPaused;\n\t}", "boolean hasFinished();", "public boolean gameStarted() {\r\n\t\treturn this.gameStarted;\r\n\t}", "@Override\n\tpublic boolean isStatus() {\n\t\treturn _candidate.isStatus();\n\t}", "public boolean isPaused()\r\n\t{\r\n\t\treturn currentstate == TIMER_PAUSE;\r\n\t}", "boolean isPreviewInBackground();", "public boolean isPaused() {\r\n return this.paused;\r\n }", "private void checkPlayProgress() {\n\n if (playState == PLAY_STATE_PLAYING) {\n sendPosition();\n\n Runnable notification = new Runnable() {\n public void run() {\n checkPlayProgress();\n }\n };\n\n // keep updating while playing\n handler.postDelayed(notification, UPDATE_DELAY);\n }\n }", "public boolean isComplete();", "protected boolean isFinished() {\n\t\treturn Robot.gearIntake.getPegSwitch();\n\t}", "public boolean isPaused() {\n return this.paused;\n }", "boolean isStarted();", "boolean isStarted();", "void hasPausedPreview(boolean paused);", "public boolean isPaused() {\n \t\treturn isPaused;\n \t}", "@java.lang.Override\n public boolean hasActivePokemon() {\n return activePokemon_ != null;\n }", "protected final boolean isRunning() {\n\t\treturn _running;\n\t}", "boolean isGameSpedUp();", "public boolean isRunning() {\r\n return running;\r\n }", "public boolean gameStillActive() {\n boolean active = true;\n \n // Check max days is not reached.\n active = active && getCurrentDay() < maxDays;\n \n // Check there is still living crew members\n active = active && crewState.getLivingCrewCount() > 0;\n \n // Check ship is not destroyed\n active = active && crewState.getShip().getShieldLevel() > 0;\n \n // Check ship parts have not been found.\n active = active && crewState.getShipPartsFoundCount() < getShipPartsNeededCount();\n \n return active;\n }", "@Override\n public boolean isWaitingForTurnPhase() {return true;}", "public final boolean isRunning() {\n return running;\n }", "public boolean isRunning(){\n\t\treturn this.running;\n\t}", "protected boolean isFinished() {\r\n\t\t \tboolean ans = false;\r\n\t\t \treturn ans;\r\n\t\t }", "public boolean isRunning()\n\t{\n\t\treturn running;\n\t}", "public boolean isPaused() {\r\n return DownloadWatchDog.this.stateMachine.isState(PAUSE_STATE);\r\n }", "public abstract boolean isComplete();", "public boolean isBusy();", "public final boolean isRunning() {\n\t\treturn running;\n\t}", "protected boolean isFinished() {\n\t\treturn Robot.elevator.isInPosition(newPosition, direction);\n\t}", "public boolean isIsCurrentlyProcessed() {\n return isCurrentlyProcessed;\n }", "public boolean isPaused() {\n return MotionViewer.this.isPaused();\n }", "public synchronized boolean isPaused() {\n\t\treturn State.PAUSED.equals(state);\n\t}", "public boolean doesGuiPauseGame()\n {\n return !this.doesGuiPauseGame;\n }", "boolean isCompleted();" ]
[ "0.73214716", "0.6756821", "0.6575066", "0.6575066", "0.6550368", "0.6513505", "0.64501417", "0.64220613", "0.6275364", "0.62673223", "0.6253216", "0.61739945", "0.6169875", "0.60692513", "0.6064543", "0.6056077", "0.60463893", "0.6041199", "0.6021367", "0.5953381", "0.5944748", "0.59073544", "0.58790344", "0.5836596", "0.5833645", "0.58311886", "0.5823616", "0.5820808", "0.58138657", "0.58033794", "0.58033794", "0.5780883", "0.5778652", "0.5778652", "0.5778652", "0.5778652", "0.5778652", "0.5775214", "0.5770438", "0.5760683", "0.5760683", "0.5760683", "0.5760683", "0.5760683", "0.5760683", "0.5750477", "0.5747239", "0.5734175", "0.57178926", "0.57178926", "0.57121915", "0.5681461", "0.5681019", "0.5672", "0.56714356", "0.56644136", "0.56632835", "0.5648756", "0.5640762", "0.5639019", "0.56386673", "0.56355715", "0.56327325", "0.56316286", "0.5629017", "0.56128585", "0.5611531", "0.5604501", "0.56002784", "0.5599076", "0.55927294", "0.559123", "0.5588186", "0.557682", "0.55711424", "0.5569892", "0.55690783", "0.55690783", "0.55668396", "0.55628556", "0.5561752", "0.5555797", "0.555444", "0.55443954", "0.5534676", "0.5534102", "0.5532451", "0.5526555", "0.55254644", "0.5523193", "0.55204165", "0.55199", "0.5517458", "0.55153406", "0.5514878", "0.55025136", "0.5500004", "0.54994446", "0.5498369", "0.5495643" ]
0.7839518
0
The stopGame instance method is used to end the game.
public void stopGame() { this.inProgress = false; if(this.round == 0) { ++this.round; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stopGame() {\n\t\tgetGameThread().stop();\n\t\tgetRenderer().stopRendering();\n\t}", "public synchronized void stopGame(){\n \t\tif (running){\n \t\t\trunning = false;\n \t\t}\n \t}", "public void stopGame() {\r\n\t\tif (logger.isDebugEnabled())\r\n\t\t\tlogger.debug(\"Stop\");\r\n\t\t\r\n\t\tif (state != GameState.STOPPED) {\r\n\t\t\tlogger.info(\"Game ended by user\");\r\n\t\t\t\r\n\t\t\t// Change state\r\n\t\t\tstate = GameState.STOPPED;\r\n\t\t\t\r\n\t\t\t// Wake scheduling thread up\r\n\t\t\twakeUp();\r\n\t\t}\r\n\t}", "private void stopGame() {\n\t\ttimer.cancel();\n\t\tboard.stopGame();\n\t\treplayButton.setEnabled(true);\n\t\t// to do - stopGame imp\n\t}", "@Override\n public void stopGame() {\n ((MultiplayerHostController) Main.game).stopGame();\n super.stopGame();\n }", "public void stop() {\n\t\t\n\t\tif(stop){\n\t\t\tGameError error=new GameError(\"The game already has been stopped\");\n\t\t\t\t\n\t\t\t\tnotifyObservers(new GameEvent<S, A>(EventType.Stop,null,currentState,\n\t\t\t\t\terror,\"The game already has been stopped\"));\n\t\t\t\n\t\t\tthrow error;\n\t\t}else{\n\t\t\tstop=true;\n\t\t\tnotifyObservers(new GameEvent<S, A>(EventType.Stop,null,currentState,null,\"The game has been stopped\"));\n\t\t}\n\t\t\n\t}", "@Callable\n public static void stopGame() {\n Blockchain.require(Blockchain.getCaller().equals(owner));\n Blockchain.require(isGameOnGoing);\n\n requireNoValue();\n\n isGameOnGoing = false;\n BettingEvents.gameStopped();\n }", "void stopGame() {\n leader.disconnect();\n opponent.disconnect();\n }", "private void stopGame() {\r\n gameThread.interrupt();\r\n gameWindow.getStartButton().setText(\"Start\");\r\n gameRunning = false;\r\n }", "public void stop(){\n\t\tthis.timer.stop();\n\t\t//whenever we stop the entire game, also calculate the endTime\n\t\tthis.endTime = System.nanoTime();\n\t\tthis.time = this.startTime - this.endTime;\t//calculate the time difference\n\t\t\n\t\tthis.stop = true;\n\t}", "public void stopGame() {\n\t\t\tif (extended)\n\t\t\t\textendTimer.stop();//stops the extend timer\n\t\t\tpause=true;//waits for other stimuli to unpause.\n\t\t\tstopped = true;//set the stopped flag to true\n\t\t\trepaint();//repaint once to indicate user said to pause\n\t\t\t\n\t\t}", "@Override\n public void stop() {\n GameManager.getInstance().stopTimer();\n }", "public void endGame() {\n\r\n\t\tplaying = false;\r\n\t\tstopShip();\r\n\t\tstopUfo();\r\n\t\tstopMissle();\r\n\t}", "public static void stopCurrentGamePlay() {\r\n\t\tif(!STATUS.equals(Gamestatus.RUNNING) && !STATUS.equals(Gamestatus.PREPARED)) return;\r\n\t\tif(STATUS.equals(Gamestatus.RUNNING)) clock.stop();\r\n\t\tSTATUS = Gamestatus.STOPPED;\r\n\t\tgui.setMenu(new LoseMenu(), false);\r\n\t}", "public synchronized void stop() {\n\t\tif(!isRunning) return; //If the game is stopped, exit method\n\t\tisRunning = false; //Set boolean to false to show that the game is no longer running\n\t\t//Attempt to join thread (close the threads, prevent memory leaks)\n\t\ttry {\n\t\t\tthread.join();\n\t\t}\n\t\t//If there is an error, print the stack trace for debugging\n\t\tcatch(InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void endGame() {\r\n\t\t// Change state (if not already done)\r\n\t\tstate = GameState.STOPPED;\r\n\t\t\r\n\t\t// End simulator\r\n\t\tsimulator.endGame();\r\n\t}", "public void endGame()\n\t{\n\t\tbuttonPanel.endGameButton.setEnabled(false);\n\t\tstopThreads();\n\t\tsendScore();\n\t}", "private void stop()\r\n {\r\n player.stop();\r\n }", "@Override\n\tpublic void endGame() {\n\t\tsuper.endGame();\n\t}", "public void stop()\n\t{\n\t\ttry\n\t\t{\n\t\t\tstopPlayer();\n\t\t}\n\t\tcatch (JavaLayerException ex)\n\t\t{\n\t\t\tSystem.err.println(ex);\n\t\t}\n\t}", "public void stopHostingGame() {\n \t\tgameSetup.reset();\n \t\tlobbyManager.stopHostingGame();\n \t\tlobby.updateGameListPane();\n \t\tgameMain.showScreen(lobby);\n \t}", "void endGame () {\n gameOver = true;\n System.out.println(\"Game over\");\n timer.cancel();\n }", "public void endGame() {\r\n\t\tthis.gameStarted = false;\r\n\t\tthis.sendMessages = false;\r\n\t\tthis.centralServer.removeServer(this);\r\n\t}", "public void finishGame(){\r\n\t\t\t\tgameStarted = false;\r\n\t\t\t}", "@Override\n\tpublic void gameStopped() {\n\t}", "boolean endGame() throws Exception;", "private void stop(){ player.stop();}", "public void stopScene()\r\n\t{\r\n\t\tthis.stop();\r\n\t}", "public void endGame(){\n\t\tgameRunning = false;\t// set gameRunning to false\n\t\tfinal SnakeGame thisGame = this;\t// store reference to the current game\n\t\tSwingUtilities.invokeLater(new Runnable() {\n public void run() {\n \t// remove our board and scoreboard\n \tgetContentPane().remove(board);\n \tgetContentPane().remove(scoreboard);\n \t// create a game over page\n \tgameOverPage = new GameOver(thisGame, scoreboard.getScore());\n \t// set our board and scoreboard to null\n \tboard = null;\n \tscoreboard = null;\n \t// add the game over page\n \tadd(gameOverPage);\n \t// validate and repaint\n \tvalidate();\n \trepaint();\n }\n\t\t});\t\n\t}", "public void stop() {\n\t\t//If we have already stopped, or are not running, we don't have to do anything.\n\t\tif (thread == null || stop || done) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.stop = true;\n\t\t\n\t\t//If we are RUNNING, we are now STOPPING\n\t\tif (isRunning()) {\n\t\t\tstateProperty.set(GameState.STOPPING);\n\t\t}\n\t}", "public void endGame() {\r\n if (state[0]) {\r\n if (state[1]) {\r\n frame.remove(pause);\r\n state[1] = false;\r\n }\r\n records.newRecord(game.map, game.end());\r\n frame.remove(game);\r\n records.saveRecords();\r\n state[0] = false;\r\n menu.setVisible(true);\r\n }\r\n }", "private void gameTimerOnFinish() {\n if (currentScreenGameState == GameState.PLAYING) {\n stopGame();\n }\n }", "public static void playerStop() {\n\t\tif(playing){\n\t\t\tPlayer.stop();\n\t\t\tmicroseconds = 0;\n\t\t\tplaying = false;\n\t\t\tif (sim!=null) sim.stop();\n\t\t}\n\t}", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t\tif(!gameOverBool){\n\t\t\ttry{\n\t\t\t\tsoundHandler.getSoundPool().autoPause();\n\t\t\t\tsoundHandler.getSoundPool().release();\n\t\t\t\tgarbagegame.stopGame();\n\t\t\t\tLog.d(\"On Stop\", \"Called cancel timers\");\n\t\t\t} catch(Exception e) {\n\t\t\t\tLog.d(\"On Stop\", \"exception caught\");\n\t\t\t}\n\t\t}else{\n\t\t\toverDialog.dismiss();\n\t\t}\n\t\tfinish();\n\t\t\n\t\t\n\t}", "public boolean stop();", "public void quitGame() {\n quitGame = true;\n }", "public void endGame()\n\t{\n\t\tthis.opponent = null;\n\t\tthis.haveGame = false;\n\t\tthis.isTurn = false;\n\t\tfor(int i = 0; i < 3; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < 3; j++)\n\t\t\t{\n\t\t\t\tboard[i][j] = 0;\n\t\t\t}\n\t\t}\n\t}", "public void stop() {\n enemyTimeline.stop();\n }", "public void stopPlaying()\n {\n player.stop();\n }", "public void stop() {\n\t\tplaybin.stop();\n\t}", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop()\n\t{\n\t\trunning = false;\n\t}", "public void endGame() {\n \t\tisOver = true;\n \t\ttimeGameEnded = System.nanoTime();\n \t\tremoveAll();\n \t\trequestFocusInWindow();\n \t}", "public void quitGame() {\n\t\tactive = false;\n\t}", "public void stop() {}", "public void stop() {\n\t\tthis.stopTime = System.nanoTime();\n\t\tthis.running = false;\n\t}", "public void stop() {\n mCurrentPlayer.reset();\n mIsInitialized = false;\n }", "private void exitGame() {\n System.exit(0);\n }", "public void stopPlaying() {\n seq.stop();\n }", "public void stop() {\r\n\t\t//If the program has an error this will stop the program\r\n\t\ttry {\r\n\t\t\trunning = false;\r\n\t\t\tg.dispose();\r\n\t\t\tthread.join();\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void pauseGame() {\n\t\ttimer.cancel();\n\t}", "public void stopGame(boolean win) {\n switchGameState(GameState.EDITING);\n if(win == true) {\n if (pf.getPlayerSetting().getSound() == PlayerSetting.Setting.ON)\n {\n ap.playGoodSound();\n }\n }\n }", "public void endGame()\r\n {\r\n mode = 2;\r\n }", "public synchronized void stop() {\n this.running = false;\n }", "public void shutDown() {\n isStarted = false;\n logger.info(\"[GAME] shut down\");\n }", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "void stop();", "@Override\n public void endGame(){\n gameOver = true;\n }", "public void stop() {\n }", "public void stop() {\n }", "public void endTurn() {\n controller.endTurn();\n }", "public void stop() {\n\t\tResources.getmScene().unregisterUpdateHandler(time);\n\t\trunning = false;\n\t}", "public void stop() {\n AudioPlayer.player.stop(cas);\n playing = false;\n }", "public void closeGame(int gameID){\n\t}", "public void stopGameAndWait() throws InterruptedException {\n\t\t//Stop the game and render thread\n\t\tstopGame();\n\t\t\n\t\t//Wait until the game thread has stopped.\n\t\tgetGameThread().stopAndWait();\n\t}", "public void stop() {\n _running = false;\n }", "public abstract void stop();", "public abstract void stop();", "public abstract void stop();", "public abstract void stop();", "public abstract void stop();" ]
[ "0.8672555", "0.86236274", "0.8618185", "0.8360121", "0.83188444", "0.82794267", "0.82311434", "0.8006411", "0.7994857", "0.7773786", "0.77678716", "0.7737656", "0.771298", "0.76491565", "0.76461816", "0.761492", "0.7474701", "0.74675405", "0.7280287", "0.7168279", "0.71486783", "0.7138298", "0.71144134", "0.7114289", "0.7088579", "0.7052067", "0.70305884", "0.69557637", "0.69252133", "0.68975383", "0.68929327", "0.68903166", "0.6869376", "0.6847611", "0.68356735", "0.6821235", "0.68165714", "0.6805808", "0.68019825", "0.67989475", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.67918414", "0.6736903", "0.6733073", "0.6713509", "0.6711736", "0.67070705", "0.67067385", "0.6702637", "0.6688908", "0.6685281", "0.665595", "0.6617759", "0.66152394", "0.66096324", "0.6595517", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65912575", "0.65878326", "0.65849453", "0.65849453", "0.65832204", "0.6561783", "0.6555666", "0.6551105", "0.65458494", "0.65432066", "0.65268075", "0.65268075", "0.65268075", "0.65268075", "0.65268075" ]
0.73546755
18
The sendMessages instance method is used to send a list of messages to all connected players.
public void sendMessages(String[] messages) { for(Player player: this.players) { if(player != null) { player.sendMessages(messages); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendMessages(List<String> messages) {\n if (!this.isConnectedToClientServer){return;}\n for (String message : messages){\n try {\n outputQueue.put(message);\n break;\n //board is sending a ball message about this ball, which means this ball is leaving the board\n } catch (InterruptedException e) {\n //don't do anything --> queue to server is interrupted, but single-machine play still happens\n }\n }\n }", "private void send(Iterable<T> aMessages) {\n for (Listener<T> myL : _listeners)\n myL.arrived(aMessages);\n }", "public void messageToAll(String s) {\n\t\tfor(ClientThread player: players) {\n\t\t\tplayer.send(new Package(\"MESSAGE\",s));\n\t\t}\n\t\t\n\t}", "@Override\n public void broadcast(T msg) {\n for (Integer i : activeUsers.keySet()) {\n this.send(Integer.valueOf(i), msg);\n }\n\n }", "public void sendMessage(final List<ProxiedPlayer> players, final BaseComponent component) {\r\n\t\tfor(ProxiedPlayer player : players) {\r\n\t\t\tplayer.sendMessage(component);\r\n\t\t}\r\n\t}", "protected abstract void sendMessage(UUID[] players, BaseComponent[][] messages, IntConsumer response);", "private void sendToAll(String msg){\r\n for(ClientHandler ch: clientThreads){\r\n try{\r\n //Get the client's ObjectOutputStream\r\n ObjectOutputStream oos = ch.getOOS();\r\n //Print the message to the client\r\n oos.writeObject(new DataWrapper(DataWrapper.STRINGCODE, msg, false));\r\n } catch(IOException ioe) {\r\n System.out.println(\"IOException occurred: \" + ioe.getMessage());\r\n ioe.printStackTrace();\r\n }\r\n }\r\n }", "private void sendGMToAll(String msg){\r\n for(ClientHandler ch: clientThreads){\r\n try{\r\n //Get the client's ObjectOutputStream\r\n ObjectOutputStream oos = ch.getOOS();\r\n //Print the message to the client\r\n oos.writeObject(new DataWrapper(0, msg, true));\r\n } catch(IOException ioe) {\r\n System.out.println(\"IOException occurred: \" + ioe.getMessage());\r\n ioe.printStackTrace();\r\n }\r\n }\r\n }", "public void sendPeerListToAll() {\r\n\t\tPacket packet = new Packet();\r\n\t\tpacket.eventCode = 1;\r\n\t\tfor(int i = 0; i < peerClientNodeConnectionList.size(); i++) {\r\n\t\t\tPeer peer = new Peer();\r\n\t\t\tpeer.peerID = peerClientNodeConnectionList.get(i).peerClientID;\r\n\t\t\tpeer.peerIP = peerClientNodeConnectionList.get(i).peerClientIP;\r\n\t\t\tpeer.peerPort = peerClientNodeConnectionList.get(i).peerClientListeningPort;\r\n\t\t\tpacket.peerList.add(peer);\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < peerClientNodeConnectionList.size(); i++) {\r\n\t\t\ttry {\r\n\t\t\t\tpeerClientNodeConnectionList.get(i).outStream.writeObject(packet);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}", "private static void sendMessageToAll(Message msg) throws IOException, EncodeException {\n String jsonStr = JSON.toJSONString(msg);\n\n for (String key : onlineSessions.keySet()) {\n System.out.println(\"WebSocketChatServer - Message \" + jsonStr + \" sent to client with username \" + key + \" and session \" + onlineSessions.get(key));\n System.out.println(key + \" : \" + onlineSessions.get(key));\n try {\n onlineSessions.get(key).getBasicRemote().sendObject(msg);\n } catch (IOException | EncodeException error) {\n error.printStackTrace();\n }\n }\n }", "public synchronized void sendUserList()\n {\n String userString = \"USERLIST#\" + getUsersToString();\n for (ClientHandler ch : clientList)\n {\n ch.sendUserList(userString);\n }\n }", "public void sendMessage(String[] messages) {}", "public void sendGameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDGM\" + lobby.getGameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "private void sendToAll(final byte[] data) {\n for (ServerClient client : clients) {\n send(data, client.getAddress(), client.getPort());\n }\n }", "protected abstract void sendMessage(UUID[] players, String[] messages, IntConsumer response);", "public void sendAllOnlineUsers(ArrayList<String> users)\n {\n try {\n this.writeData(Message.getAllUsersMessage(users));\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "public void sendMatch() {\n for (int i = 0; i < numberOfPlayers; i++) {\n try {\n // s = ss.accept();\n oos = new ObjectOutputStream(sockets.get(i).getOutputStream());\n oos.writeObject(game);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }", "private void sendMessages(Queue<Message<M>> sendQueue) {\n while (!sendQueue.isEmpty()) {\n context.sendMessage(sendQueue.poll());\n numMessageSent++;\n }\n }", "private int sendAll( \n Hashtable<Object,Vector<Message>> my_message_table,\n Hashtable<Object,Vector<IReceiveMessage>> my_receiver_table ) \n {\n // get all messages from the message table\n // in an array, and sort based on time\n int num_messages = 0;\n Enumeration<Vector<Message>> lists = my_message_table.elements();\n Vector<Message> list;\n while ( lists.hasMoreElements() )\n {\n list = lists.nextElement();\n num_messages += list.size();\n }\n\n Message messages[] = new Message[ num_messages ];\n lists = my_message_table.elements();\n int index = 0;\n while ( lists.hasMoreElements() )\n {\n list = lists.nextElement();\n for ( int i = 0; i < list.size(); i++ )\n {\n messages[index] = list.elementAt(i);\n index++;\n }\n }\n\n Arrays.sort( messages, new MessageComparator() );\n\n // now route the ordered messages\n // to the receivers, and increment\n // the number of messages sent, if\n // there were any receivers.\n int num_true = 0;\n for ( int i = 0; i < messages.length; i++ )\n if ( sendMessage( messages[i], my_receiver_table ) )\n num_true++;\n // Send the MESSAGES_PROCESSED \n // message, if sending some\n // messages returned true\n if ( num_true > 0 || always_notify )\n sendMessage( MESSAGES_PROCESSED, my_receiver_table );\n\n return num_true;\n }", "static void sendMsg(String msg){\r\n for(ServerThread t: threads){\r\n t.sendMsgToClient(msg);\r\n }\r\n }", "public void syncMessages() {\n\t\tArrayList<ChatEntity> nonSyncedChatEntities = new ArrayList<>();\n\t\tnonSyncedChatEntities.addAll(chatViewModel.loadChatsWithSyncStatus(false, nameID));\n\n\t\tif (nonSyncedChatEntities.size() > 0) {\n\t\t\tfor (int i = 0; i < nonSyncedChatEntities.size(); i++) {\n\t\t\t\tChatEntity chatEntity = nonSyncedChatEntities.get(i);\n\t\t\t\tchatEntity.setSynced(true);\n\t\t\t\tchatViewModel.updateSource(chatEntity);\n\t\t\t\tgetChatResult(nonSyncedChatEntities.get(i).getMessage());\n\t\t\t}\n\t\t}\n\t}", "private void sendMessageToAll(String message){\n for(Session s : sessions){\n try {\n s.getBasicRemote().sendText(message);\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n }", "public void sendMessage ( String... messages ) {\n\t\texecute ( handle -> handle.sendMessage ( messages ) );\n\t}", "public void sendGameStateToAllClients(GameState gameState) {\n for (String player : this.getDistantPlayers()) {\n\n Socket s = getPlayersSocket().get(player);\n\n // System.out.println(\"GAMESTATE READY TO BE SENT to \"+player);\n ObjectOutputStream out = null;\n if ((!s.isClosed()) && s.isConnected()) {\n\n }\n\n try {\n out = new ObjectOutputStream(this.getPlayersSocket().get(player).getOutputStream());\n // System.out.println(\"GAMESTATE READY TO BE SENT to \"+player+\"Soket ok\");\n out.writeObject(gameState);\n // System.out.println(\"GAMESTATE READY TO BE SENT to \"+player+\"Soket ok\"+\" Written\");\n out.flush();\n } catch (IOException e) {\n e.printStackTrace();\n }\n //System.out.println(\"GAMESTATE SENT\");\n }\n ((LocalClientI) AppSingleton.getInstance().getClient()).receive(gameState);\n }", "public void cardToAll() {\n\t\tfor(ClientThread player: players) {\n\t\t\tcardToOne(player);\n\t\t\ttry {Thread.sleep(200);}catch(Exception exc) {exc.printStackTrace();}\n\t\t}\n\t}", "@Override\n\tpublic void send(Trino mensaje, List<String> listaContactos) throws RemoteException{\n\t\tbbdd.almacenTrinos(mensaje);\n\t\tfor(String contacto : listaContactos){\n\t\t\t synchronized (contacto) {\n\t\t\t\t if(bbdd.buscarUsuarioConectado(contacto)){\n\t\t\t\t\t\tif(memoria.isEmpty()){\n\t\t\t\t\t\t\tArrayList<Trino> lista = new ArrayList<Trino>();\n\t\t\t\t\t\t\tlista.add(mensaje);\n\t\t\t\t\t\t\tmemoria.put(contacto, lista);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(memoria.get(contacto) == null){\n\t\t\t\t\t\t\t\tArrayList<Trino> lista = new ArrayList<Trino>();\n\t\t\t\t\t\t\t\tlista.add(mensaje);\n\t\t\t\t\t\t\t\tmemoria.put(contacto, lista);\n\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t\tList<Trino> list = memoria.get(contacto);\n\t\t\t\t\t\t\t\tlist.add(mensaje);\n\t\t\t\t\t\t\t\tmemoria.replace(contacto, (ArrayList<Trino>) list);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbbdd.setMensajeOffline(contacto, mensaje.getTexto());\n\t\t\t\t\t\tbbdd.setMensajeOffline(contacto, mensaje);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t}", "@Override\n public void sendOrder(List<AbstractPlayer> playersOrderList) {\n List<Integer> orderList = new ArrayList<>();\n for (AbstractPlayer player : playersOrderList) {\n orderList.add(player.getIdPlayer());\n }\n try {\n if (getClientInterface() != null)\n getClientInterface().notifyTurnOrder(orderList);\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending order error\");\n }\n }", "boolean send(String message, PlayerID from, PlayerID to) {\n\t\tfor (Player player : players) {\n\t\t\tif (player.id().equals(to)) {\n\t\t\t\tplayer.sendMsg(\"P\" + from.toString() + \": \" + message);\n\t\t\t\tlog.add(new String[] { from.toString(), message, String.valueOf(System.currentTimeMillis()) });\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void handleSendPlayers(long id, List<Player> players){\r\n\t\t//convert arraylist to array\r\n\t\tPlayer[] playerArray = players.toArray(new Player[players.size()]);\r\n\t\t\r\n\t\tsuper.handleSendPlayers(id, playerArray);\r\n\t}", "public void sendAll(String message) {\n for (String id : sessions.keySet()) {\n send(id, message);\n }\n }", "protected abstract void sendInternal(List<String> messages) throws NotificationException;", "public void sendNameInfoToAll(){\r\n\t\t\r\n\t\tVector<Player> players = lobby.getLobbyPlayers();\t\r\n\t\tString message = \"UDNM\" + lobby.getNameString();\r\n\t\t\r\n\t\tif(!players.isEmpty()){\r\n\t \tfor(int i=0; i<players.size(); i++){\t \t\t\r\n\t \t\tsendOnePlayer(players.get(i), message);\t \t\t\r\n\t \t}\r\n\t\t}\r\n\t}", "public void sendMessageToAllClients(MessageWrapper message) {\n sendMessageToServer(message);\n\n for (SendenDevice device : clientsConnected.values()) {\n if (!device.getDeviceMac().equals(wiFiP2PInstance.getThisDevice().getDeviceMac())) {\n sendMessage(device, message);\n }\n }\n }", "private static void send() {\n Map<String, ArrayList<Event>> eventsByStream = new HashMap<>();\n for (Event event : QUEUE) {\n String stream = event.getStream();\n if (!eventsByStream.containsKey(stream) || eventsByStream.get(stream) == null) {\n eventsByStream.put(stream, new ArrayList<>());\n }\n eventsByStream.get(stream).add(event);\n }\n for (String stream : eventsByStream.keySet()) {\n if (Prefs.INSTANCE.isEventLoggingEnabled()) {\n sendEventsForStream(STREAM_CONFIGS.get(stream), eventsByStream.get(stream));\n }\n }\n }", "private void broadcast(String message)\n \t{\n \t\tfor(int i = 0; i < players.length; i++)\n \t\t{\n // PROTOCOL\n \t\t\tplayers[i].sendMessage(message);\n // PROTOCOL\n \t\t}\n \t}", "public void sendMessage ( UUID sender , String... messages ) {\n\t\texecute ( handle -> handle.sendMessage ( sender , messages ) );\n\t}", "protected void deliverMessages()\n {\n Set<Envelope> envelopes = messengerDao.getEnvelopes();\n\n Map<String, Set<Envelope>> peerEnvelopesMap = Maps.newHashMap();\n int maxTimeToLive = 0;\n //distribute envelops to peers\n for ( Envelope envelope : envelopes )\n {\n if ( envelope.getTimeToLive() > maxTimeToLive )\n {\n maxTimeToLive = envelope.getTimeToLive();\n }\n Set<Envelope> peerEnvelopes = peerEnvelopesMap.get( envelope.getTargetPeerId() );\n if ( peerEnvelopes == null )\n {\n //sort by createDate asc once more\n peerEnvelopes = new TreeSet<>( new Comparator<Envelope>()\n {\n @Override\n public int compare( final Envelope o1, final Envelope o2 )\n {\n return o1.getCreateDate().compareTo( o2.getCreateDate() );\n }\n } );\n peerEnvelopesMap.put( envelope.getTargetPeerId(), peerEnvelopes );\n }\n\n peerEnvelopes.add( envelope );\n }\n\n\n //try to send messages in parallel - one thread per peer\n try\n {\n for ( Map.Entry<String, Set<Envelope>> envelopsPerPeer : peerEnvelopesMap.entrySet() )\n {\n Peer targetPeer = messenger.getPeerManager().getPeer( envelopsPerPeer.getKey() );\n if ( targetPeer.isLocal() )\n {\n completer.submit(\n new LocalPeerMessageSender( messenger, messengerDao, envelopsPerPeer.getValue() ) );\n }\n else\n {\n completer.submit(\n new RemotePeerMessageSender( messengerDao, targetPeer, envelopsPerPeer.getValue() ) );\n }\n }\n\n //wait for completion\n try\n {\n for ( int i = 0; i < peerEnvelopesMap.size(); i++ )\n {\n Future<Boolean> future = completer.take();\n future.get();\n }\n }\n catch ( InterruptedException | ExecutionException e )\n {\n LOG.warn( \"ignore\", e );\n }\n }\n catch ( PeerException e )\n {\n LOG.error( e.getMessage(), e );\n }\n }", "public void broadcastMsg(String msg) {\n for (Client c : sockets) {\n c.sendMessage(msg);\n }\n }", "@Override\n public void run() {\n for (int i = 0; i < numberOfPlayers; i++) {\n addPlayer();\n controller\n .getSpf()\n .getLabel1()\n .setText(\n \"\" +\n players.get(players.size() - 1).getName() +\n \" Jugador # \" +\n (players.size() - 1)\n );\n }\n\n controller\n .getSpf()\n .getLabel1()\n .setText(\"Jugadores listos, iniciando partida\");\n\n startMatch();\n\n sendId();\n\n UpdateMatchThread umt = new UpdateMatchThread(this, 0);\n umt.start();\n\n UpdateMatchThread umt1 = new UpdateMatchThread(this, 1);\n umt1.start();\n\n UpdateServerThread upt = new UpdateServerThread(this);\n upt.start();\n }", "public void sendUpdate() {\n int i = 1;\n\n Deque<ProxiedPlayer> removePlayers = new LinkedList<>();\n\n for (ProxiedPlayer player : playersQueue) {\n Server playerServer = player.getServer();\n\n // Player is not connected OR Player Server is not the Queue Server\n if (!player.isConnected() || !playerServer.getInfo().getName().equals(Config.queue)) {\n removePlayers.add(player);\n continue;\n }\n\n player.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', Config.messagePosition.replaceAll(\"%position%\", Integer.toString(i))) + \"§r\"));\n\n i++;\n }\n\n for (ProxiedPlayer player : removePlayers) {\n try {\n // Remove Player from the queue\n mutex.acquire();\n playersQueue.remove(player);\n\n Main.log(\"sendUpdate\", \"§3§b\" + player.toString() + \"§3 was removed from §b\" + Config.queue + \"§3 (wrong server or disconnected). Queue count is \" + playersQueue.size() + \".\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n mutex.release();\n }\n }\n }", "public void listMessages() {\n\t\tSystem.out.println(\"== The wall of \" + name + \" ==\");\n\t\tfor(String msg : messages)\n\t\t{\n\t\t\tSystem.out.println(msg);\n\t\t}\n\t}", "private void broadcast(ArrayList<Integer> update){\n for (Player p : players.values()){\n p.sendModel(update);\n }\n }", "public static void sendMessagesByDirectory(String directory, Pollable jmsInstance) throws IOException {\n List<File> files = getMessagesFromDirectory(directory);\n for (File file : files) {\n String text = FileUtils.readFileToString(file);\n String threadNumber = Long.toString(Thread.currentThread().getId());\n logger.info(String.format(\">> Ready to send one message[%s]\", file.getName()));\n jmsInstance.send(text, System.currentTimeMillis(), threadNumber, text.length(), \"Rex-thread\", \"\");\n logger.info(String.format(\">> Message has been sent.\"));\n }\n\n }", "public void sendMessage(final List<ProxiedPlayer> players, final SoundType sound, final BaseComponent component) {\r\n\t\tfor(ProxiedPlayer player : players) {\r\n\t\t\tplayer.sendMessage(component);\r\n\t\t\tKaranteeniCore.getSoundHandler().playSound(player, sound);\r\n\t\t}\r\n\t}", "private void sendUpdates() {\n\n List<PeerUpdateMessage.Part> parts = new ArrayList<PeerUpdateMessage.Part>();\n for (ActivePlayer peer : player.getSavedNeighbors()) {\n PeerUpdateMessage.Part part = new PeerUpdateMessage.Part(\n peer.character.id, peer.character.getExtrapolatedMotionState());\n parts.add(part);\n }\n\n if (!parts.isEmpty()) {\n PeerUpdateMessage msg = new PeerUpdateMessage(parts);\n new ToClientMessageSink(player.session).sendWithoutConfirmation(msg);\n }\n }", "@Override\n public void run(){\n ServerConnection[] clients = new ServerConnection[]{client2, client3, client1};\n\n for( ServerConnection c : clients ) {\n if ( c != null ){\n if ( client3 == null ){\n c.send(\"Game has started with code:\" + gameID + \".\\n\" + \"Current players are \" +\n client1.getName() + \", \" + client2.getName());\n }\n else {\n c.send(\"Game has started with code:\" + gameID + \".\\n\" + \"Current players are \" +\n client1.getName() + \", \" + client2.getName() + \", \" + client3.getName());\n }\n c.setGameID(gameID);\n }\n }\n\n String[] gods = readChallengerMessage();\n\n for (int i=0; i<2 && currClient != client1; i++){\n currClient.send(Arrays.toString(gods) );\n clientMessage = readClientMessage();\n if (i == 0) {\n gameMessage.setGod2(clientMessage.getGod());\n gameMessage.setName2(clientMessage.getName());\n } else if (i == 1) {\n gameMessage.setGod3(clientMessage.getGod());\n gameMessage.setName3(clientMessage.getName());\n }\n List<String> list = new ArrayList<String>(Arrays.asList(gods));\n list.remove( clientMessage.getGod().name());\n gods = list.toArray(new String[0]);\n currClient.send(\"Choice confirmed\");\n updateCurrClient();\n }\n\n currClient.send(gods[0]);\n gameMessage.setGod1(God.valueOf(gods[0]));\n gameMessage.setName1(client1.getName());\n updateCurrClient();\n resetUpdate();\n gameMessage.notify(gameMessage);\n sendLiteGame();\n\n for( ServerConnection c : clients ) {\n resetUpdate();\n if ( c != null ) {\n while ( !updateModel) {\n sendToCurrClient(\"Placing workers\");\n clientMessage = readClientMessage();\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.setSpace2(clientMessage.getSpace2());\n gameMessage.notify(gameMessage);\n if (!updateModel) {\n sendLiteGame();\n }\n }\n updateCurrClient();\n liteGame.setPlayer(currClient.getName());\n sendLiteGame();\n }\n }\n\n\n while ( !endOfTheGame ) {\n sendToCurrClient(\"Next action\");\n clientMessage = readClientMessage();\n\n if ( \"Choose Worker\".equals(clientMessage.getAction()) ) {\n chooseWorker();\n }\n else if ( \"Charon Switch\".equals(clientMessage.getAction()) ) {\n charonSwitch();\n }\n else if ( \"Prometheus Build\".equals(clientMessage.getAction()) ) {\n build();\n }\n else if ( \"Move\".equals(clientMessage.getAction()) ) {\n move();\n }\n else if ( \"Build\".equals(clientMessage.getAction()) ) {\n build();\n }\n\n if ( \"End\".equals(clientMessage.getAction()) ) {\n gameMessage.resetGameMessage();\n updateCurrClient();\n liteGame.setCurrWorker(5,5);\n liteGame.setPlayer(currClient.getName());\n sendLiteGame();\n }\n else {\n sendLiteGame();\n if ( !endOfTheGame && !playerRemoved ) {\n if (!updateModel) {\n currClient.send(\"Invalid action\");\n } else currClient.send(\"Action performed\");\n }\n else playerRemoved = false;\n }\n }\n\n sendToCurrClient(\"You won the match.\");\n server.endMatch(gameID, null);\n }", "@Override\n public void run() {\n try {\n boolean autoFlush = true;\n fromClient = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n toClient = new PrintWriter(clientSocket.getOutputStream(), autoFlush);\n } catch (IOException ioe) {\n throw new UncheckedIOException(ioe);\n }\n for (String entry : communicationWhenStarting) {\n sendMsg(entry);\n }\n while (connected) {\n try {\n Message msg = new Message(fromClient.readLine());\n updateClientAction(msg);\n } catch (IOException ioe) {\n disconnectClient();\n throw new MessageException(ioe);\n }\n }\n }", "private void sendTextToAllClients(String text) {\n\t\tfor (ClientManager cm : serverHolder.findAllClientManagers()) {\n\t\t\tcm.sendText(name, text);\n\t\t}\n\t}", "private void broadcast(String msg) {\n\t\tfor (PrintWriter out : clients) {\n\t\t\tout.println(msg);\n\t\t\tout.flush();\n\t\t}\n\t}", "private void sendMsgList(String queue, List<String> listMessage) throws JMSException {\n for (String textMessage : listMessage) {\n this.sendMsg(queue, textMessage);\n }\n }", "public List<ChatMessage> getChatMessages() {\n logger.info(\"**START** getChatMessages \");\n return messagesMapper.findAllMessages();\n }", "public static void send(CommandSender sender, String[] messages) {\n\n\t\tif (sender == null) {\n\t\t\tfor (String s : messages)\n\t\t\t\tlog(s);\n\t\t}\n\n\t\tfor (String message : messages) {\n\t\t\tmessage = Tools.parseColors(message, false);\n\t\t}\n\n\t\tsender.sendMessage(messages);\n\t}", "public void sendList(String msg, int count) {\n\t\t\toutput.println((count + 1) + \". \" + msg);\n\t\t}", "@Override\n\t\tpublic void onMessage(String msg) {\n\t\t\tif(msg.equals(\"update\")) {\n\t\t\t\tAuctionList al = new AuctionList();\n\t\t\t\tal.refreshAuction();\n\t\t\t}\n\t\t\tfor (ChatWebSocket member : webSockets) {\n\t\t try {\n\t\t member.connection.sendMessage(msg);\n\t\t \n\t\t } catch(IOException e) {\n\t\t \te.printStackTrace();\n\t\t }\n\t\t }\n\t\t}", "@Override\n\tpublic void run() {\n\t\twhile(!Server.killServer){\n\t\t\ttry {\n\t\t\t\tThread.sleep(Constants.BROADCAST_BATTLEFIELD_PERIOD_TO_CLIENTS);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t//send to EACH client\n\t\t\tfor(Node client : Server.getClientList().keySet()){\n\t\t\t\t//get client's RMI instance\n\t\t\t\tClientServer clientComm = null;\n\t\t\t\tclientComm = Server.getClientReg(client); \n\t\t\t\t//create Message\n\t\t\t\tClientServerMessage sendBattlefieldMessage = new ClientServerMessage(\n\t\t\t\t\t\t\tMessageType.GetBattlefield,\n\t\t\t\t\t\t\tthis.serverOwner.getName(),\n\t\t\t\t\t\t\tthis.serverOwner.getIP(),\n\t\t\t\t\t\t\tclient.getName(),\n\t\t\t\t\t\t\tclient.getIP());\n\t\t\t\tsendBattlefieldMessage.setBattlefield(Server.getBattlefield());\n\t\t\t\t\n\t\t\t\tif(clientComm==null){\n\t\t\t\t\tSystem.out.println(\"clientComm is null\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(\"Server: Battlefield sent\");\n\n\t\t\t\ttry {\n\t\t\t\t\tclientComm.onMessageReceived(sendBattlefieldMessage);\n\t\t\t\t} catch (RemoteException e) {\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} catch (NotBoundException e) {\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\t\tfor (Communication communication: listCommunication) {\n\t\t\tcommunication.run();\n\t\t}\n\t}", "public void broadcast() {\n for (int i = 1; i <= nbMessagesToBroadcast; i++) {\n Message broadcastMsg = new Message(pid, pid, i,false, null);\n lcb.broadcast(broadcastMsg);\n logs.add(String.format(\"b %d\\n\",i));\n }\n }", "public void sendMessage()\r\n {\r\n MessageScreen messageScreen = new MessageScreen(_lastMessageSent);\r\n pushScreen(messageScreen);\r\n }", "public static void broadcastPacket(@NonNull Iterable<Player> players, @NonNull PacketContainer packet) {\n for (Player player : players) {\n sendPacket(player, packet);\n }\n }", "private synchronized void sendToAllClients(Object whatever) // Synchronized to work among multiple clients and multiple threads\n {\n System.out.println(\"Sending '\" + whatever + \"' to everyone.\");\t\n \n ObjectOutputStream[] oosList = whosIn.values().toArray(new ObjectOutputStream[0]);\n \n for (ObjectOutputStream clientOOS : oosList)\n {\n try {clientOOS.writeObject(whatever);}\n catch (IOException e) {} \n }\n\t \n }", "@Override\n\tpublic void sendMessage() {\n\t\t\n\t}", "public void chat_list() {\n\n synchronized(chat_room) {\n Set chat_room_set = chat_room.keySet();\n Iterator iter = chat_room_set.iterator();\n\n clearScreen(client_PW);\n client_PW.println(\"------------Chat Room List-----------\");\n while(iter.hasNext()) {\n client_PW.println(iter.next());\n }\n client_PW.flush();\n }\n }", "public static void sendFormattedMessage(CommandSender sender, List<String> messageList) {\r\n for (String message : messageList) {\r\n sendFormattedMessage(sender, message);\r\n }\r\n }", "@Override\n public void sendChatMessage(EntityPlayer player) {\n }", "public void sendPacket() throws IOException {\n\t\tbyte[] buf = playerList.toString().getBytes();\n\n\t\t// send the message to the client to the given address and port\n\t\tInetAddress address = packet.getAddress();\n\t\tint port = packet.getPort();\n\t\tpacket = new DatagramPacket(buf, buf.length, address, port);\n\t\tsocket.send(packet);\n\t}", "private void sendGroupMessage(String message){\n\n\t\tObject[] userIDs = chatInstanceMap.keySet().toArray();\n\n\t\tfor(int i = 0; i < userIDs.length; i++ ){\n\n\t\t\tsendMessage((String) userIDs[i], message);\n\t\t}\n\t}", "@Transactional\n @MessageMapping(\"/place-stone/{gameId}\")\n @SendTo(\"/topic/game/{gameId}\")\n public void sendMessage(StompSendMessage sendMessage) {\n\n\n // 1) 데이터 저장 (GameRecords Entity)\n // 게임\n // 로그인 유저\n Games game = gamesRepository.findById(sendMessage.getGameId());\n // 게임 종료 조건 시, Games 테이블의 상태 값 변경 (게임 종료 상태)\n if (sendMessage.getIsFinish() == GAME_OVER) {\n game.setGameStatus(GAME_OVER);\n }\n\n Users loginUser = usersRepository.findByNickname(sendMessage.getLoginUserNickname());\n\n GameRecords gameRecords = GameRecords.builder()\n .game(game)\n .loginUser(loginUser)\n .isFinish(sendMessage.getIsFinish())\n .x(sendMessage.getX())\n .y(sendMessage.getY())\n .unallowedList(sendMessage.getUnallowedList().toString())\n .prevStateList(sendMessage.getPrevStateList().toString())\n .stoneStatus(sendMessage.getLoginUserTurn())\n .build();\n\n // [GameRecords to game_records] Database에 저장\n gameRecordsRepository.save(gameRecords);\n\n // 2) 각 클라이언트로 착수한 돌 정보 전송 ( 돌 상태, 좌표 값 전송 )\n this.simpMessagingTemplate.convertAndSend(\"/topic/game/\"+sendMessage.getGameId(), sendMessage);\n\n }", "public void saveAllPlayers() {\n for (Player player : bukkitService.getOnlinePlayers()) {\n savePlayer(player);\n }\n }", "@Override\n\tpublic void sendMessageGroup(Client cm, String msg) throws RemoteException {\n\t\tif(!users.contains(cm)) {\n\t\t\tusers.add(cm); \n\t\t\t} \t\t\t\n\t\t//envoyes les message vers tous les utilisateur\n\t\ttry {\n\t\t\tfor (Client c : users) {\n\t\t\n\t\t\t// 回调远程客户端方法\n\t\t\tString user=cm.getName(); \n\t if(user==null || user==\"\") {\n\t \t user = \"anonymous\";\n\t }\t \n\t c.afficherMessage(user + \" : \" + msg);\n\t //c.showDialog(msg);\n\t\t\t}\n\t\t} catch (RemoteException ex) {\n\t\t\tusers.remove(cm);\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t/*\n\t\t for(int i=0;i<users.size();i++)\n\t\t {\n\t\t String user=c.getName(); \n\t\t if(user==null || user==\"\")\n\t\t user = \"anonymous\";\n\t\t ( (Client) users.get(i)).sendMessage(user + \" : \" + msg);\n\t\t }*/\n }", "public void serverSendMessageToAllUsers(String message) {\r\n \t\tServerCommand serverCommand = new MessageServerCommand(message, \"server\", null);\r\n \r\n \t\tthis.sendCommandToClient(this.clients.getClients(), serverCommand);\r\n \t}", "private synchronized void sendAdvance(){\r\n\t\t\tfor(PrintWriter p : players){\r\n\t\t\t\tif(p != null){\r\n\t\t\t\t\tp.println(\"5\");\r\n\t\t\t\t\tp.println(Integer.toString(x));\r\n\t\t\t\t\tp.println(Integer.toString(y));\r\n\t\t\t\t\tp.flush();\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}", "synchronized static void chat(String name, String message) throws IOException\n {\t \n PrintWriter pw;\n \n //prints message to the server console\n System.out.println(name + \" >> \" + message);\n \n //goes through each ChatClient stored in linkedList \n for (Object o : linkedList)\n {\n //casts object in linked list to a socket\n pw = new PrintWriter(((Socket) o).getOutputStream(), true);\n \n //prints ChatClient's name with message to all connected ChatClients\n //on ChatClient socket outputstream\n pw.println(name + \" >> \" + message);\n }\n }", "public void getMessages(){\n if(GUI.getInstance().getBusiness().getCurrentChat() != null) {\n Set<? extends IMessageIn> response = GUI.getInstance().getBusiness().getCurrentChat().getMessages();\n if(response != null){\n messages.addAll(response);\n }\n }\n }", "public static void sendMessagesByNumber(int number, String directory, Pollable jmsInstance) throws IOException {\n List<File> files = JmsUtils.getMessagesFromDirectory(directory);\n for (int i = 0; i < number; i++) {\n int index = i % files.size();\n String text = FileUtils.readFileToString(files.get(index));\n String threadNumber = Long.toString(Thread.currentThread().getId());\n jmsInstance.send(text, System.currentTimeMillis(), threadNumber, text.length(), \"Rex-thread\", \"\");\n logger.info(String.format(\">> Message[%s] has been sent\", i));\n }\n }", "public void sendMessage(final List<ProxiedPlayer> players, final SoundType sound, String message) {\r\n\t\t//message = ChatColor.translateHexColorCodes(message);\r\n\t\tfor(ProxiedPlayer player : players) {\r\n\t\t\tplayer.sendMessage(TextComponent.fromLegacyText(message));\r\n\t\t\tKaranteeniCore.getSoundHandler().playSound(player, sound);\r\n\t\t}\r\n\t}", "public void getPlayerList() {\n if (connected == true) {\n try {\n write(\"get playerlist\");\n } catch (IOException e) {\n System.out.println(\"No connecting with server:ServerCommunication:getPlayerList()\");\n }\n }\n }", "public void send(Message msg);", "public void sendOpponents(ArrayList<Player> plist, Player sentTo) {\n try {\n // Send the number of players being sent\n sendNumOpponents(plist.size()-1);\n for (Player p : plist) {\n if (p != sentTo) { // Do not send player self data as opponent\n dOut.writeObject(p);\n dOut.flush();\n }\n }\n } catch (IOException e) {\n System.out.println(\"Could not send player objects\");\n e.printStackTrace();\n }\n }", "public static void broadcastFormattedMessage(List<String> messageList, World world) {\r\n for (Player p : world.getPlayers()) {\r\n sendFormattedMessage(p, messageList);\r\n }\r\n sendFormattedMessage(Bukkit.getConsoleSender(), messageList);\r\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\r\n\tvoid updateNames () {\n\t\tConnection[] connections = server.getConnections();\r\n\t\t\r\n\t\tArrayList<String> names = new ArrayList<>(connections.length);\r\n\t\tfor (int i = connections.length - 1; i >= 0; i--) {\r\n\t\t\tChatConnection connection = (ChatConnection)connections[i];\r\n\t\t\tnames.add(connection.name);\r\n\t\t}\r\n\t\t// Send the names to everyone.\r\n\t\tUpdateNames updateNames = new UpdateNames();\r\n\t\tupdateNames.names = (String[])names.toArray(new String[names.size()]);\r\n\t\tserver.sendToAll(updateNames, true);\r\n\t}", "public void addAllMessages(List<MessageInterface> messages) {\n messages.forEach(this::addMessage);\n }", "private void sendNotifications() {\n for (long sid : self.getCurrentAndNextConfigVoters()) {\n QuorumVerifier qv = self.getQuorumVerifier();\n ToSend notmsg = new ToSend(\n ToSend.mType.notification,\n proposedLeader,\n proposedZxid,\n logicalclock.get(),\n QuorumPeer.ServerState.LOOKING,\n sid,\n proposedEpoch,\n qv.toString().getBytes(UTF_8));\n\n LOG.debug(\n \"Sending Notification: {} (n.leader), 0x{} (n.zxid), 0x{} (n.round), {} (recipient),\"\n + \" {} (myid), 0x{} (n.peerEpoch) \",\n proposedLeader,\n Long.toHexString(proposedZxid),\n Long.toHexString(logicalclock.get()),\n sid,\n self.getMyId(),\n Long.toHexString(proposedEpoch));\n\n sendqueue.offer(notmsg);\n }\n }", "public void doSendMsg() {\n FacesContext fctx = FacesContext.getCurrentInstance();\n HttpSession sess = (HttpSession) fctx.getExternalContext().getSession(false);\n SEHRMessagingListener chatHdl = (SEHRMessagingListener) sess.getAttribute(\"ChatHandler\");\n if (chatHdl.isSession()) {\n //TODO implement chat via sehr.xnet.DOMAIN.chat to all...\n if (room.equalsIgnoreCase(\"public\")) {\n //send public inside zone\n chatHdl.sendMsg(this.text, SEHRMessagingListener.PUBLIC, moduleCtrl.getLocalZoneID(), -1, -1);\n } else {\n chatHdl.sendMsg(this.text, SEHRMessagingListener.PRIVATE_USER, moduleCtrl.getLocalZoneID(), -1, curUserToChat.getUsrid());\n }\n this.text = \"\";\n }\n //return \"pm:vwChatRoom\";\n }", "final protected void sendAll() {\n\t\tsendAllBut(null);\n\t}", "public void writeAll(MESSAGE message) {\n log.debug(\"write all : \" + MessageManger.messageToStringFormatted(message));\n\n ConcurrentHashMap<String, Client> clientsList = ccv.getClients();\n synchronized (clientsList) {\n //invio a tutti il messaggio\n\n //in qiesta lista saòvo tutti gli utenti che hanno dato errore nel socket\n List<Client> toRemoves = new LinkedList<Client>();\n\n for (Client client : clientsList.values()) {\n if (client.getMainSocket() != null) {\n try {\n OutputStream outputStream = client.getMainSocket().getOutputStream();\n MessageManger.directWriteMessage(message, outputStream);\n\n //se il client non risponde lo levo dalla lista dei connessi\n } catch (Exception ex) {\n log.warn(ex + \" \" + ex.getMessage());\n\n //aggiungo alla lista il cliet che ha doto errore\n toRemoves.add(client);\n }\n }\n }\n\n //rimuovo tutti i client che risultno cascati\n //e invio il comando a tutti\n for (Client client : toRemoves) {\n clientsList.remove(client.getNick());\n }\n\n //avviso tutti di eliminare gli utenti che hanno dato errore\n for (Client toRemove : toRemoves) {\n ServerWriter sw = new ServerWriter(ccv);\n MESSAGE toSend = MessageManger.createCommand(Command.REMOVEUSER, null);\n MessageManger.addParameter(toSend, \"nick\", toRemove.getNick());\n sw.writeAll(toSend);\n }\n }\n\n }", "public static void playerBroadcast(Player sender, final String message, boolean webchat, boolean console) {\n\t\tfor (StandardPlayer player : instance.getOnlinePlayers()) {\n\t\t\tif (player != sender && player.isOnline()) {\n\t\t\t\ttry {\n\t\t\t\t\tplayer.sendMessage(message);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// Can happen if a player leaves as this handler is running\n\t\t\t\t\tinstance.getLogger().severe(\"Exception while broadcasting\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tBukkit.getConsoleSender().sendMessage(webchatConsoleGate(message, webchat, console));\n\t}", "public void run() {\n\t\tTestTool.log(mPort + \"[AutoSender] waiting...\");\n\t\twhile (mUserList.size() < 2) {\n\t\t\ttry {\n\t\t\t\tmClientEvent.trigger(EE.client_command_getListUser, null);\n\t\t\t\tThread.sleep(1000);\n\t\t\t\tif (mUserList.size() >= 2) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (InterruptedException e) { e.printStackTrace(); }\n\t\t}\n\t\tTestTool.log(mPort + \"[AutoSender] ...okay\");\n\n\t\t\n\t\tint count = 0;\n\t\twhile (mIsRunning && count++ < 5) {\n\t\t\tJSONObject msg = autoCreateMessage(count);\n\t\t\tTestTool.log(mPort + \"[AutoSender: run] sending message:\", msg);\n\t\t\tmMessengerUser.addMessage(msg);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tThread.sleep((int) Math.random() * 1000);\n\t\t\t} catch (InterruptedException e) { e.printStackTrace(); }\n\t\t}\n\t}", "@NotNull Publisher<Void> send(Publisher<VesEvent> messages);", "private void individualSend(UserLogic t) {\n if(t != UserLogic.this && t != null && ((String)UI.getContacts().getSelectedValue()).equals(t.username)){\r\n if(((String)t.UI.getContacts().getSelectedValue()).equals(username)) { //If both users are directly communicating\r\n t.UI.getProperList().addElement(username + \"> \" + UI.getMessage().getText()); //Send message\r\n t.UI.getContacts().setCellRenderer(clearNotification); //Remove notification\r\n }\r\n else{ //If the user are not directly communicating\r\n t.UI.getContacts().setCellRenderer(setNotification); //Set notification\r\n }\r\n if(t.chats.containsKey(username)){ //Store chats in other users database (When database exists)\r\n ArrayList<String> arrayList = t.chats.get(username); //Get data\r\n arrayList.add(username + \"> \" + UI.getMessage().getText()); //Add new message to the database\r\n t.chats.put(username, arrayList); //Store data\r\n }\r\n else { //When database doesn't exist\r\n ArrayList<String> arrayList = new ArrayList<>(); //create new database\r\n arrayList.add(username + \"> \" + UI.getMessage().getText()); //Add new message to the database\r\n t.chats.put(username, arrayList); //Store data\r\n }\r\n }\r\n //This writes on my screen\r\n if(t == UserLogic.this && t!=null){ //On the current user side\r\n UI.getProperList().addElement(\"Me> \" + UI.getMessage().getText()); //Write message to screen\r\n String currentChat = (String) UI.getContacts().getSelectedValue(); //Get selected user\r\n if(chats.containsKey(currentChat)){ //check if database exists\r\n ArrayList<String> arrayList = chats.get(currentChat);\r\n arrayList.add(\"Me> \" + UI.getMessage().getText());\r\n chats.put(currentChat, arrayList);\r\n }\r\n else { //When database doesn't exist\r\n ArrayList<String> arrayList = new ArrayList<>();\r\n arrayList.add(\"Me> \" + UI.getMessage().getText());\r\n chats.put(currentChat, arrayList);\r\n }\r\n }\r\n }", "public void sendChat(String s) {\n ACLMessage m = new ACLMessage(briscola.common.ACLCodes.ACL_CHAT);\n m.setConversationId(getChatID());\n m.setContent(s);\n if (players == null) {\n say(\"Nessun giocatore in lista\");\n } else {\n for (Player p : players) {\n m.addReceiver(p.getAID());\n }\n send(m);\n }\n }", "public void broadcastmsg(String msg){\r\n Server.getUsers().forEach((user) -> {\r\n user.sendmsg(msg);\r\n });\r\n }", "public synchronized boolean dispatchMessages()\n { \n synchronized(lists_lock)\n {\n\n if ( message_table.size() <= 0 ) // nothing to send\n {\n if ( always_notify )\n send( MESSAGES_PROCESSED );\n return false;\n }\n // grab all current messages and\n // replace master table of messgaes\n // with a new empty table\n sender_message_table = message_table;\n message_table = new Hashtable<Object,Vector<Message>>();\n\n // get copy of table of receivers\n sender_receiver_table = new Hashtable<Object,Vector<IReceiveMessage>>();\n\n Vector<IReceiveMessage> list;\n Vector<IReceiveMessage> new_list;\n Enumeration keys = receiver_table.keys();\n while ( keys.hasMoreElements() )\n {\n Object key = keys.nextElement();\n list = receiver_table.get( key );\n new_list = new Vector<IReceiveMessage>();\n for ( int i = 0; i < list.size(); i++ )\n new_list.add( list.elementAt(i) );\n sender_receiver_table.put( key, new_list );\n }\n\n int n_changed = sendAll( sender_message_table, sender_receiver_table );\n if ( n_changed > 0 )\n return true;\n else\n return false;\n }\n }", "public void send(String raw_msg, AbstractVisitor sender) {\n\n for(AbstractVisitor user : users) {\n if(sender != user) {\n user.receive(\"From \" + sender.getName() + \" to \" + user.getName() + \": \" + raw_msg);\n }\n }\n\n }", "public static void send(String msg) {\n for (int i = 0; i < 10000; i++) {\n EchoClient.os.println(msg + \" \" + i);\n }\n\n }", "public void run() {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"SERVER: all players connected!\");\n\t\t\t\t\n\t\t\t\t//build the info message for clients\n\t\t\t\tString gameConfig = \"INFO \" + Integer.toString(pitsPerPlayer) + \" \" + Integer.toString(seedsPerPit)\n\t\t\t\t + \" \" + Integer.toString(timerValMils);\n\t\t\t\t\n\t\t\t\t//append first/second character\n\t\t\t\tif (playerNum == 1) {\n\t\t\t\t\tgameConfig += \" F\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgameConfig += \" S\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//append random/uniform distro character\n\t\t\t\tif (randomDistro) {\n\t\t\t\t\tgameConfig += \" R\";\n\t\t\t\t\tcurrentGame = new kalah(pitsPerPlayer, seedsPerPit, randomDistro);\n\t\t\t\t\t\n\t\t\t\t\tArrayList<Integer> randomSeeds = currentGame.getP1pits();\n\t\t\t\t\tfor (int i = 0; i < randomSeeds.size(); i++) {\n\t\t\t\t\t\tgameConfig += \" \" + Integer.toString(randomSeeds.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgameConfig += \" S\";\n\t\t\t\t\tcurrentGame = new kalah(pitsPerPlayer, seedsPerPit, randomDistro);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//send to server \n\t\t\t\twriter.println(gameConfig);\n\t\t\t\t\n\t\t\t\t//process client commands (game loop for each client)\n\t\t\t\twhile (true) {\n\t\t\t\t\t\n\t\t\t\t\tString clientMessage = reader.readLine();\n\t\t\t\t\t\n\t\t\t\t\t//ignore empty commands\n\t\t\t\t\tif (!clientMessage.equals(null) && !clientMessage.equals(\"\")) {\n\t\t\t\t\t\tif (clientMessage.startsWith(\"MOVE\")) {\n\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Client \" + playerNum + \" sent move: \" + clientMessage.substring(5));\n\n\t\t\t\t\t\t\tint clientMove = Integer.parseInt(clientMessage.substring(5));\n\n\t\t\t\t\t\t\tif (currentGame.move(clientMove)) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: acknowledged client \" + playerNum + \"'s \" + \"move: \" + clientMessage.substring(5));\n\t\t\t\t\t\t\t\twriter.println(\"OK\");\n\n\t\t\t\t\t\t\t\t//send move to other client to keep their game in sync\n\t\t\t\t\t\t\t\topponent.writer.println(\"MOVE \" + clientMessage.substring(5));\n\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Sent move \" + clientMessage.substring(5) + \" to client \" + opponent.playerNum);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//check for winner \n\t\t\t\t\t\t\t\tcurrentGame.checkGameOver();\n\t\t\t\t\t\t\t\tif (currentGame.gameOver) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: GAME OVER\");\n\t\t\t\t\t\t\t\t\tif (currentGame.winner == 0) {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Tie!\");\n\t\t\t\t\t\t\t\t\t\twriter.println(\"TIE\");\n\t\t\t\t\t\t\t\t\t\topponent.writer.println(\"TIE\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (playerNum == currentGame.winner) {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Player \" + playerNum + \" wins!\");\n\t\t\t\t\t\t\t\t\t\twriter.println(\"WINNER\");\n\t\t\t\t\t\t\t\t\t\topponent.writer.println(\"LOSER\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: Player \" + playerNum + \" wins!\");\n\t\t\t\t\t\t\t\t\t\twriter.println(\"LOSER\");\n\t\t\t\t\t\t\t\t\t\topponent.writer.println(\"WINNER\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tSystem.out.println(\"SERVER: rejected client's move: \" + clientMessage.substring(5));\n\t\t\t\t\t\t\t\twriter.println(\"ILLEGAL\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (IOException e) {\n\t\t\t\tSystem.out.println(\"Player error: \" + e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tsocket.close();\n\t\t\t\t}\n\t\t\t\tcatch (IOException e) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void sendMessage(final List<ProxiedPlayer> players, final SoundType sound, final String prefix, String message) {\r\n\t\t//message = ChatColor.translateHexColorCodes(message);\r\n\t\tfor(ProxiedPlayer player : players) {\r\n\t\t\tplayer.sendMessage(TextComponent.fromLegacyText(prefix + message));\r\n\t\t\tKaranteeniCore.getSoundHandler().playSound(player, sound);\r\n\t\t}\r\n\t}", "public void flush() {\n mMessages.postToServer();\n }", "public void sendMessage(String msg) {\n\t\tfor (MessagingServer server : servers) {\n\t\t\tserver.messages.add(msg + \" (received from \" + this.serverId + \")\");\n\t\t}\n\t}", "public void sendCommandToClient(Collection<RoMClient> clientsToSend, ServerCommand serverCommand) {\r\n \t\tLogger.logMessage(\"Sending Command \\\"\" + serverCommand + \"\\\"\");\r\n \r\n \t\t// Add Command to clients MessageQueue\r\n \t\tfor (RoMClient client : clientsToSend) {\r\n \t\t\tclient.addCommandToQueue(serverCommand);\r\n \t\t}\r\n \t}", "public void printAllPlayers(){\n for (Player player : players){\n player.printPlayerInfo();\n }\n }" ]
[ "0.67061657", "0.6358617", "0.6329156", "0.6314923", "0.62853146", "0.62835634", "0.6251713", "0.62020797", "0.6196456", "0.61734086", "0.6167636", "0.6112832", "0.61036706", "0.6102614", "0.6099181", "0.6061626", "0.6057576", "0.6001087", "0.5979728", "0.59749204", "0.597004", "0.59662664", "0.5946215", "0.5894798", "0.58902663", "0.58522886", "0.5831494", "0.58297634", "0.58277094", "0.580544", "0.5750778", "0.5725843", "0.5722601", "0.5710347", "0.56643796", "0.5662195", "0.5621454", "0.56131643", "0.5598296", "0.5594231", "0.5590828", "0.55854523", "0.5555901", "0.55361474", "0.5529963", "0.5519438", "0.55038726", "0.5502763", "0.55017775", "0.5499955", "0.5493996", "0.54648477", "0.5462437", "0.5460672", "0.5450232", "0.5449411", "0.54381484", "0.54301417", "0.5426962", "0.5419517", "0.5400565", "0.53875434", "0.538432", "0.5373962", "0.5364935", "0.5363585", "0.53588", "0.535286", "0.5343483", "0.53390867", "0.5337236", "0.53262496", "0.5324674", "0.5323559", "0.5320392", "0.531352", "0.53062433", "0.53059685", "0.5303906", "0.5302417", "0.52957135", "0.52924293", "0.52873576", "0.5281642", "0.5269795", "0.5265229", "0.5264249", "0.52598715", "0.5236606", "0.5236598", "0.522582", "0.52183324", "0.520979", "0.5207729", "0.5206854", "0.52023894", "0.51982975", "0.5193779", "0.5191822", "0.51822996" ]
0.74275255
0
/ Initialize standard Hardware interfaces
public void init(HardwareMap ahwMap) { // Save reference to Hardware map hwMap = ahwMap; // Define and Initialize Motors // leftRearMotor = hwMap.dcMotor.get("left_rear_drive"); // rightRearMotor = hwMap.dcMotor.get("right_rear_drive"); leftFrontMotor = hwMap.dcMotor.get("left_front_drive"); rightFrontMotor = hwMap.dcMotor.get("right_front_drive"); // liftMotor = hwMap.dcMotor.get("lift_motor"); brushMotor = hwMap.dcMotor.get("brush_motor"); leftSpinMotor = hwMap.dcMotor.get("left_spin_motor"); rightSpinMotor = hwMap.dcMotor.get("right_spin_motor"); tiltMotor = hwMap.dcMotor.get("tilt_motor"); // rangeSensor = hwMap.get(ModernRoboticsI2cRangeSensor.class, "range sensor"); //define and initialize servos // loadServo = hwMap.servo.get("load_servo"); // loadServo.setPosition(BEGIN_SERVO); pushServo = hwMap.servo.get("push_servo"); pushServo.setPosition(MID_SERVO); leftLiftServo = hwMap.servo.get("left_lift_servo"); leftLiftServo.setPosition(MID_SERVO); rightLiftServo = hwMap.servo.get("right_lift_servo"); rightLiftServo.setPosition(MID_SERVO); //define and initialize buttons // bottomTouchButton = hwMap.touchSensor.get("bottom_touch_button"); // topTouchButton = hwMap.touchSensor.get("top_touch_button"); leftSpinMotor.setDirection(DcMotor.Direction.REVERSE); leftFrontMotor.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors rightFrontMotor.setDirection(DcMotor.Direction.FORWARD); // Set to FORWARD if using AndyMark motors // Set all motors to zero power // leftRearMotor.setPower(0); // rightRearMotor.setPower(0); leftFrontMotor.setPower(0); rightFrontMotor.setPower(0); // liftMotor.setPower(0); brushMotor.setPower(0); leftSpinMotor.setPower(0); rightSpinMotor.setPower(0); tiltMotor.setPower(0); // Set all motors to run without encoders. // May want to use RUN_USING_ENCODERS if encoders are installed. // leftRearMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); // rightRearMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); leftFrontMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); rightFrontMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); // liftMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); brushMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); leftSpinMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); // rightSpinMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); tiltMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initHardware(){\n }", "protected abstract void initHardwareInstructions();", "public void initDevice() {\r\n\t\t\r\n\t}", "@Override\n public void init() {\n imu = new IMU(hardwareMap, \"imu\");\n left = hardwareMap.get(DcMotor.class, \"left\");\n right = hardwareMap.get(DcMotor.class, \"right\");\n\n left.setDirection(DcMotorSimple.Direction.FORWARD);\n right.setDirection(DcMotorSimple.Direction.REVERSE);\n }", "@Override public void init() {\n drive = MecanumDrive.standard(hardwareMap); // Comment this line if you, for some reason, don't need to use the drive motors\n\n // Uncomment the next three lines if you need to use the gyroscope\n // gyro = IMUGyro.standard(hardwareMap);\n // gyro.initialize();\n // gyro.calibrate();\n\n // Uncomment the next two lines if you need to use the vision system\n // vision = new Vision(hardwareMap);\n // vision.init();\n\n // Uncomment the next line if you have a servo\n // myServo = hardwareMap.get(Servo.class, \"myServo\");\n\n /** Place any code that should run when INIT is pressed here. **/\n }", "public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n// imu = hwMap.get(BNO055IMU.class, \"imu\");\n\n leftFront = hwMap.get(DcMotor.class, \"left_front\");//hub2 - port 0\n rightFront = hwMap.get(DcMotor.class, \"right_front\");//hub2 - port 1\n leftBack = hwMap.get(DcMotor.class, \"left_back\");//hub2 - port 2\n rightBack = hwMap.get(DcMotor.class, \"right_back\");//hub2 - port 3\n\n leftFront.setDirection(DcMotor.Direction.FORWARD);\n leftBack.setDirection(DcMotor.Direction.FORWARD);\n rightFront.setDirection(DcMotor.Direction.FORWARD);\n rightBack.setDirection(DcMotor.Direction.FORWARD);\n\n leftFront.setPower(0);\n leftBack.setPower(0);\n rightFront.setPower(0);\n rightBack.setPower(0);\n\n\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n }", "@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n robot.FL.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot.FL.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }", "public void init() {\n // Define and Initialize Motors (note: need to use reference to actual OpMode).\n leftDrive = myOpMode.hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = myOpMode.hardwareMap.get(DcMotor.class, \"right_drive\");\n armMotor = myOpMode.hardwareMap.get(DcMotor.class, \"arm\");\n\n // To drive forward, most robots need the motor on one side to be reversed, because the axles point in opposite directions.\n // Pushing the left stick forward MUST make robot go forward. So adjust these two lines based on your first test drive.\n // Note: The settings here assume direct drive on left and right wheels. Gear Reduction or 90 Deg drives may require direction flips\n leftDrive.setDirection(DcMotor.Direction.REVERSE);\n rightDrive.setDirection(DcMotor.Direction.FORWARD);\n\n // If there are encoders connected, switch to RUN_USING_ENCODER mode for greater accuracy\n // leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n // rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n // Define and initialize ALL installed servos.\n leftHand = myOpMode.hardwareMap.get(Servo.class, \"left_hand\");\n rightHand = myOpMode.hardwareMap.get(Servo.class, \"right_hand\");\n leftHand.setPosition(MID_SERVO);\n rightHand.setPosition(MID_SERVO);\n\n myOpMode.telemetry.addData(\">\", \"Hardware Initialized\");\n myOpMode.telemetry.update();\n }", "@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n\n //ColorSensor colorSensor;\n //colorSensor = hardwareMap.get(ColorSensor.class, \"Sensor_Color\");\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }", "@Override\r\n public void init() {\r\n /* Initialize the hardware variables.\r\n * The init() method of the hardware class does all the work here\r\n */\r\n robot.init(hardwareMap);\r\n\r\n // Send telemetry message to signify robot waiting;\r\n telemetry.addData(\"Status\", \"Initialized\");\r\n }", "@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n\n robot.leftDriveMotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n robot.rightDriveMotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n // Possibly add a delay\n robot.leftDriveMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n robot.rightDriveMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }", "public void init(HardwareMap ahwMap){\n init(ahwMap, true);\n }", "public void initialize() throws MMDeviceException;", "public void initInterfaces() {\r\n scheduleUpdate(theCounter.countIs());\r\n scheduleState(StateEvent.MINIMUM);\r\n }", "public void robotInit() {\n \tboardSubsystem = new BoardSubsystem();\n }", "@Override\n public void robotInit() {\n\t\t// set up logging\n\t\tlogger = EventLogging.getLogger(Robot.class, Level.INFO);\n\n // set up hardware\n RobotMap.init();\n\n // set up subsystems\n //initalized drive subsystem, which control motors to move robot\n driveSubsystem = new DriveSubsystem();\n\t\tbuttonSubstyem = new ButtonSubsystem();\n servoSubsystem = new ServoSubsystem();\n wingSubsystem = new WingSubsystem();\n flagSpinnerSubsystem = new FlagSpinnerSubsystem();\n // OI must be constructed after subsystems. If the OI creates Commands\n //(which it very likely will), subsystems are not guaranteed to be\n // constructed yet. Thus, their requires() statements may grab null\n // pointers. Bad news. Don't move it.\n oi = new OI();\n\n // Add commands to Autonomous Sendable Chooser\n chooser.addDefault(\"Autonomous Command\", new AutonomousCommand());\n SmartDashboard.putData(\"Auto mode\", chooser);\n }", "public void autonomousInit() {\n \tNetworkCommAssembly.start();\n }", "public void initDevices() {\n for (Device device: deviceList) {\n device.init(getCpu().getTime());\n }\n }", "public static void initialize()\n\t{\n\t\t// USB\n\t\tdriveJoystick = new EJoystick(getConstantAsInt(USB_DRIVE_STICK));\n\t\tcontrolGamepad = new EGamepad(getConstantAsInt(USB_CONTROL_GAMEPAD));\n\n\t\t// Power Panel\n\t\tpowerPanel = new PowerDistributionPanel();\n\n\t\t//Compressor\n\t\tcompressor = new Compressor(Constants.getConstantAsInt(Constants.PCM_CAN));\n\t\tcompressor.start();\n\t}", "@Override\n public void init() {\n leftDrive = hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = hardwareMap.get(DcMotor.class, \"right_drive\");\n }", "@Override\n public void init() {\n\n stevens_IMU = new AdafruitBNO055IMU(hardwareMap.i2cDeviceSynch.get(\"IMU\"));\n\n parameters = new BNO055IMU.Parameters();\n\n success = stevens_IMU.initialize(parameters);\n telemetry.addData(\"Success: \", success);\n\n doDaSleep(500);\n\n }", "public void hardwareResources() {\n\t\tSystem.out.println(\"I am the Hardware implemented through Multiple inheritence in Desktop class\");\r\n\r\n\t}", "private void initDevice() {\n device = new Device();\n device.setManufacture(new Manufacture());\n device.setInput(new Input());\n device.setPrice(new Price());\n device.getPrice().setCurrency(\"usd\");\n device.setCritical(DeviceCritical.FALSE);\n }", "@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n\n telemetry.addData(\"Status\", \"Initialized\");\n\n //the below lines set up the configuration file\n BallSensor = hardwareMap.i2cDevice.get(\"BallSensor\");\n\n BallSensorreader = new I2cDeviceSynchImpl(BallSensor, I2cAddr.create8bit(0x3a), false);\n\n BallSensorreader.engage();\n\n sensorGyro = hardwareMap.gyroSensor.get(\"gyro\"); //Point to the gyro in the configuration file\n mrGyro = (ModernRoboticsI2cGyro)sensorGyro; //ModernRoboticsI2cGyro allows us to .getIntegratedZValue()\n mrGyro.calibrate(); //Calibrate the sensor so it knows where 0 is and what still is. DO NOT MOVE SENSOR WHILE BLUE LIGHT IS SOLID\n\n //touch = hardwareMap.touchSensor.get(\"touch\");\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n telemetry.update();\n\n }", "public void robotInit() {\n RobotMap.init();\n driveWithJoystick = new DriveTrain();\n \n oi = new OI();\n }", "protected abstract void initHardwareCriteria();", "public Hardware() {\n hwMap = null;\n }", "protected void initialize() {\n\t\tthis.oi = Robot.getInstance().getOI();\n\n }", "public void robotInit() {\n RobotMap.init();\n driveTrain = new DriveTrain();\n oi = new OI();\n flippy = new Flipper();\n flappy = new Flapper();\n autonomousCommand = new AutoFlip();\n \n OI.init();\n CommandBase.init();\n autoChooser = new SendableChooser();\n autoChooser.addDefault(\"Flap Left\", new AutoFlip());\n SmartDashboard.putData(\"Autonomous_Mode\", autoChooser); \n }", "public void initFromResource() {\n String[] hwStrings = Resources.getSystem().getStringArray(17236074);\n if (hwStrings != null) {\n for (String hwString : hwStrings) {\n HardwareConfig hw = new MtkHardwareConfig(hwString);\n if (hw.type == 0) {\n updateOrInsert(hw, mModems);\n } else if (hw.type == 1) {\n updateOrInsert(hw, mSims);\n }\n }\n }\n }", "@Override\n public void init() {\n\n robot.init(hardwareMap);\n\n // Tell the driver that initialization is complete.\n\n telemetry.addData(\"Robot Mode:\", \"Initialized\");\n telemetry.update();\n }", "public void initRegisters() {\n\tProcessor processor = Machine.processor();\n\n\t// by default, everything's 0\n\tfor (int i=0; i<processor.numUserRegisters; i++)\n\t processor.writeRegister(i, 0);\n\n\t// initialize PC and SP according\n\tprocessor.writeRegister(Processor.regPC, initialPC);\n\tprocessor.writeRegister(Processor.regSP, initialSP);\n\n\t// initialize the first two argument registers to argc and argv\n\tprocessor.writeRegister(Processor.regA0, argc);\n\tprocessor.writeRegister(Processor.regA1, argv);\n }", "@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n // robot.leftBumper.setPosition(.5);\n // robot.leftStageTwo.setPosition(1);\n // robot.rightStageTwo.setPosition(0.1);\n robot.colorDrop.setPosition(0.45);\n robot.align.setPosition(0.95);\n\n // robot.rightBumper.setPosition(.7);\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }", "private static native int initSPIDevice();", "@Override\n public void init() {\n robot.init(hardwareMap);\n telemetry.addData(\"Status\", \"Initialized\");\n }", "@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initialized Interative TeleOp Mode\");\n telemetry.update();\n\n // Initialize the hardware variables. Note that the strings used here as parameters\n // to 'get' must correspond to the names assigned during the robot configuration\n // step (using the FTC Robot Controller app on the phone).\n leftDrive = hardwareMap.dcMotor.get(\"leftDrive\");\n rightDrive = hardwareMap.dcMotor.get(\"rightDrive\");\n armMotor = hardwareMap.dcMotor.get(\"armMotor\");\n\n leftGrab = hardwareMap.servo.get(\"leftGrab\");\n rightGrab = hardwareMap.servo.get(\"rightGrab\");\n colorArm = hardwareMap.servo.get(\"colorArm\");\n leftTop = hardwareMap.servo.get(\"leftTop\");\n rightTop = hardwareMap.servo.get(\"rightTop\");\n\n /*\n left and right drive = motion of robot\n armMotor = motion of arm (lifting the grippers)\n extendingArm = motion of slider (used for dropping the fake person)\n left and right grab = grippers to get the blocks\n */\n\n }", "@Override\n public void init() {\n // Get references to dc motors and set initial mode and direction\n // It appears all encoders are reset upon robot startup, but just in case, set all motor\n // modes to Stop-And-Reset-Encoders during initialization.\n motorLeftA = hardwareMap.dcMotor.get(MOTOR_DRIVE_LEFT_A);\n motorLeftA.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorLeftA.setDirection(DcMotor.Direction.FORWARD);\n\n motorLeftB = hardwareMap.dcMotor.get(MOTOR_DRIVE_LEFT_B);\n motorLeftB.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorLeftB.setDirection(DcMotor.Direction.FORWARD);\n\n motorRightA = hardwareMap.dcMotor.get(MOTOR_DRIVE_RIGHT_A);\n motorRightA.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorRightA.setDirection(DcMotor.Direction.REVERSE);\n\n motorRightB = hardwareMap.dcMotor.get(MOTOR_DRIVE_RIGHT_B);\n motorRightB.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n motorRightB.setDirection(DcMotor.Direction.REVERSE);\n\n //motorGlyphLift = hardwareMap.dcMotor.get(GLYPH_LIFT);\n //motorGlyphLift.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n //motorGlyphLift.setDirection(DcMotor.Direction.FORWARD);\n\n sGlyphL = hardwareMap.servo.get(GLYPH_LEFT);\n //sGlyphL.scaleRange(0,180);\n\n sGlyphR = hardwareMap.servo.get(GLYPH_RIGHT);\n sGem = hardwareMap.servo.get(Gem);\n\n //Initialize vex motor\n sGLift = hardwareMap.crservo.get(Servo_GlyphLift);\n\n //sGLift.setPower(0);\n\n //sGLift2 = hardwareMap.servo.get(Servo_GlyphLift);\n\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n imu = hardwareMap.get(BNO055IMU.class,\"imu\");\n imu.initialize(parameters);\n\n //servoGlyph1.setPosition(180);\n //servoGlyph2.setPosition(180);\n\n bDirection = true;\n }", "public void robotInit() {\n\t\toi = OI.getInstance();\r\n\t\t\r\n\t\t// instantiate the command used for the autonomous and teleop period\r\n\t\treadings = new D_SensorReadings();\r\n\t\t// Start pushing values to the SD.\r\n\t\treadings.start();\r\n\t\t//Gets the single instances of driver and operator, from OI. \r\n\t\tdriver = oi.getDriver();\r\n\t\toperator = oi.getOperator();\r\n\r\n\t\t//Sets our default auto to NoAuto, if the remainder of our code doesn't seem to work. \r\n\t\tauto = new G_NoAuto();\r\n\t\t\r\n\t\t//Sets our teleop commandGroup to T_TeleopGroup, which contains Kaj,ELevator, Intake, and Crossbow Commands. \r\n\t\tteleop = new T_TeleopGroup();\r\n\t\t\r\n\t}", "protected void init() {\n try {\n updateDevice();\n } catch (Exception e) {\n RemoteHomeManager.log.error(42,e);\n }\n }", "public void init() {\n robot.init(hardwareMap);\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftRotate.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftRotate.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot.liftUpDown.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot.blinkinLedDriver.setPattern(RevBlinkinLedDriver.BlinkinPattern.GREEN);\n\n }", "void openHardware(){\n if(hardware!=null && hardware.isOpen()){\n playMode=PlayMode.LIVE; // in case (like StereoHardwareInterface) where device can be open but not by MotionViewer\n return;\n }\n try{\n hardware=(SiLabsC8051F320_OpticalFlowHardwareInterface)OpticalFlowHardwareInterfaceFactory.instance().getFirstAvailableInterface();\n hardware.setChip(chip);\n chip.setHardwareInterface(hardware);\n hardware.open();\n\n\n \n if(hardware==null) {\n fixLoggingControls();\n fixBiasgenControls();\n return;\n }\n\n fixLoggingControls();\n fixBiasgenControls();\n // note it is important that this openHardware succeeed BEFORE hardware is assigned to biasgen, which immeiately tries to openHardware and download biases, creating a storm of complaints if not sucessful!\n \n// if(hardware instanceof BiasgenHardwareInterface){\n// chip.getBiasgen().sendConfiguration(chip.getBiasgen());\n// chip.setHardwareInterface(hardware); // if we do this, events do not start coming again after reconnect of device\n// biasgen=chip.getBiasgen();\n// if(biasgenFrame==null) {\n// biasgenFrame=new BiasgenFrame(biasgen); // should check if exists...\n// }\n// }\n \n setPlaybackControlsEnabledState(true);\n setPlayMode(PlayMode.LIVE);\n setTitleAccordingToState();\n }catch(Exception e){\n log.warning(e.getMessage());\n if(hardware!= null) hardware.close();\n setPlaybackControlsEnabledState(false);\n fixLoggingControls();\n fixBiasgenControls();\n setPlayMode(PlayMode.WAITING);\n }\n }", "@Override\n public void init() {\n runtime.reset();\n robot.init(hardwareMap);\n\n telemetry.addData(\"Status\", \"Initialized\");\n }", "public static void init() {\r\n try {\r\n defaultImplementation = new LinkLayer_Impl_PC();\r\n } catch (IOException e) {\r\n Log.e(TAG, e, \"Failed in creating defaultImplementation!\");\r\n }\r\n }", "abstract protected void init(HardwareMap hardwareMap, TelemetryUtil telemetryUtil);", "protected void initialize() {\r\n\r\n Robot.pneumatics.pneuOpen();\r\n }", "protected void initialize() {\n drivebase.engageOmni();\n }", "public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n FrontLeft = hwMap.dcMotor.get(\"frontLeft\");\n FrontRight = hwMap.dcMotor.get(\"frontRight\");\n RearLeft = hwMap.dcMotor.get(\"rearLeft\");\n RearRight = hwMap.dcMotor.get(\"rearRight\");\n Collector = hwMap.dcMotor.get(\"collector\");\n Launcher = hwMap.dcMotor.get(\"launcher\");\n Elevator = hwMap.dcMotor.get(\"elevator\");\n\n ServoElevate = hwMap.crservo.get(\"Servo\");\n\n imu = hwMap.get(BNO055IMU.class, \"imu\");\n\n FrontLeft.setPower(0);\n FrontRight.setPower(0);\n RearLeft.setPower(0);\n RearRight.setPower(0);\n }", "@Override\n public void init() {\n robot.init(hardwareMap, telemetry, false);\n //robot.resetServo();\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.addData(\"Status\", \"Initialized\");\n // robot.FL.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n // robot.FR.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n // robot.BL.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n // robot.BR.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n }", "public void autonomousInit() {\n\t\t\n\t}", "public void autonomousInit() {\n }", "public void autonomousInit() {\n }", "@Override\r\n public void open() throws HardwareInterfaceException {\r\n if(!UsbIoUtilities.usbIoIsAvailable) return;\r\n \r\n //device has already been UsbIo Opened by now, in factory\r\n \r\n // opens the USBIOInterface device, configures it, binds a reader thread with buffer pool to read from the device and starts the thread reading events.\r\n // we got a UsbIo object when enumerating all devices and we also made a device list. the device has already been\r\n // opened from the UsbIo viewpoint, but it still needs firmware download, setting up pipes, etc.\r\n \r\n if(isOpened){\r\n log.warning(\"already opened interface and setup device\");\r\n return;\r\n }\r\n \r\n int status;\r\n \r\n gUsbIo=new UsbIo();\r\n gDevList=UsbIo.createDeviceList(GUID);\r\n status = gUsbIo.open(0,gDevList,GUID);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"can't open USB device: \"+UsbIo.errorText(status));\r\n }\r\n \r\n // get device descriptor\r\n status = gUsbIo.getDeviceDescriptor(deviceDescriptor);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"getDeviceDescriptor: \"+UsbIo.errorText(status));\r\n } else {\r\n log.log(Level.INFO, \"getDeviceDescriptor: Vendor ID (VID) {0} Product ID (PID) {1}\", new Object[]{HexString.toString((short)deviceDescriptor.idVendor), HexString.toString((short)deviceDescriptor.idProduct)});\r\n }\r\n \r\n // set configuration -- must do this BEFORE downloading firmware!\r\n USBIO_SET_CONFIGURATION Conf = new USBIO_SET_CONFIGURATION();\r\n Conf.ConfigurationIndex = CONFIG_INDEX;\r\n Conf.NbOfInterfaces = CONFIG_NB_OF_INTERFACES;\r\n Conf.InterfaceList[0].InterfaceIndex = CONFIG_INTERFACE;\r\n Conf.InterfaceList[0].AlternateSettingIndex = CONFIG_ALT_SETTING;\r\n Conf.InterfaceList[0].MaximumTransferSize = CONFIG_TRAN_SIZE;\r\n status = gUsbIo.setConfiguration(Conf);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n// gUsbIo.destroyDeviceList(gDevList);\r\n // if (status !=0xE0001005)\r\n log.log(Level.WARNING, \"setting configuration: {0}\", UsbIo.errorText(status));\r\n }\r\n \r\n // get device descriptor\r\n status = gUsbIo.getDeviceDescriptor(deviceDescriptor);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"getDeviceDescriptor: \"+UsbIo.errorText(status));\r\n } else {\r\n log.log(Level.INFO, \"getDeviceDescriptor: Vendor ID (VID) {0} Product ID (PID) {1}\", new Object[]{HexString.toString((short)deviceDescriptor.idVendor), HexString.toString((short)deviceDescriptor.idProduct)});\r\n }\r\n \r\n if (deviceDescriptor.iSerialNumber!=0)\r\n this.numberOfStringDescriptors=3;\r\n \r\n // get string descriptor\r\n status = gUsbIo.getStringDescriptor(stringDescriptor1,(byte)1,0);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"getStringDescriptor: \"+UsbIo.errorText(status));\r\n } else {\r\n log.log(Level.INFO, \"getStringDescriptor 1: {0}\", stringDescriptor1.Str);\r\n }\r\n \r\n // get string descriptor\r\n status = gUsbIo.getStringDescriptor(stringDescriptor2,(byte)2,0);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"getStringDescriptor: \"+UsbIo.errorText(status));\r\n } else {\r\n log.log(Level.INFO, \"getStringDescriptor 2: {0}\", stringDescriptor2.Str);\r\n }\r\n \r\n if (this.numberOfStringDescriptors==3) {\r\n // get serial number string descriptor\r\n status = gUsbIo.getStringDescriptor(stringDescriptor3,(byte)3,0);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"getStringDescriptor: \"+UsbIo.errorText(status));\r\n } else {\r\n log.log(Level.INFO, \"getStringDescriptor 3: {0}\", stringDescriptor3.Str);\r\n }\r\n }\r\n \r\n // get outPipe information and extract the FIFO size\r\n USBIO_CONFIGURATION_INFO configurationInfo = new USBIO_CONFIGURATION_INFO();\r\n status = gUsbIo.getConfigurationInfo(configurationInfo);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"getConfigurationInfo: \"+UsbIo.errorText(status));\r\n }\r\n \r\n if(configurationInfo.NbOfPipes==0){\r\n// gUsbIo.cyclePort();\r\n throw new HardwareInterfaceException(\"didn't find any pipes to bind to\");\r\n }\r\n \r\n servoCommandWriter=new ServoCommandWriter();\r\n status=servoCommandWriter.bind(0,(byte)ENDPOINT_OUT,gDevList,GUID);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"can't bind command writer to endpoint: \"+UsbIo.errorText(status));\r\n }\r\n USBIO_PIPE_PARAMETERS pipeParams=new USBIO_PIPE_PARAMETERS();\r\n pipeParams.Flags=UsbIoInterface.USBIO_SHORT_TRANSFER_OK;\r\n status=servoCommandWriter.setPipeParameters(pipeParams);\r\n if (status != USBIO_ERR_SUCCESS) {\r\n UsbIo.destroyDeviceList(gDevList);\r\n throw new HardwareInterfaceException(\"startAEWriter: can't set pipe parameters: \"+UsbIo.errorText(status));\r\n }\r\n \r\n servoCommandWriter.startThread(3);\r\n isOpened=true;\r\n submittedCmdAfterOpen=false;\r\n }", "@Override\n public void init() {\n touchSensor1 = hardwareMap.touchSensor.get(\"touchSensor1\");\n lightSensor1 = hardwareMap.lightSensor.get(\"lightSensor1\");\n motorLeft1 = hardwareMap.dcMotor.get(\"motorLeft1\");\n motorLeft2 = hardwareMap.dcMotor.get(\"motorLeft2\");\n motorRight1 = hardwareMap.dcMotor.get(\"motorRight1\");\n motorRight2 = hardwareMap.dcMotor.get(\"motorRight2\");\n\n //Setup Hardware\n motorLeft1.setDirection(DcMotor.Direction.REVERSE);\n motorLeft2.setDirection(DcMotor.Direction.REVERSE);\n\n // Set up the parameters with which we will use our IMU. Note that integration\n // algorithm here just reports accelerations to the logcat log; it doesn't actually\n // provide positional information.\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"AdafruitIMUCalibration.json\"; // see the calibration sample opmode\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n // parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n\n // Retrieve and initialize the IMU. We expect the IMU to be attached to an I2C port\n // on a Core Device Interface Module, configured to be a sensor of type \"AdaFruit IMU\",\n // and named \"imu\".\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n imu.initialize(parameters);\n\n currentState = MotorState.WAIT_TO_START;\n nextState = MotorState.WAIT_TO_START;\n count = 0;\n composeTelemetry();\n }", "public void init(HardwareMap hardwareMap) {\n imu = hardwareMap.get(BNO055IMU.class, \"imu\");\n\n //Initialize IMU parameters\n BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();\n parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;\n parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;\n parameters.calibrationDataFile = \"BNO055IMUCalibration.json\"; // see the calibration sample opmode\n parameters.loggingEnabled = true;\n parameters.loggingTag = \"IMU\";\n parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();\n imu.initialize(parameters);\n\n /*\n telemetry.addData(\"Odometry System Calibration Status\", \"IMU Init Complete\");\n telemetry.clear();\n\n //Odometry System Calibration Init Complete\n telemetry.addData(\"Odometry System Calibration Status\", \"Init Complete\");\n telemetry.update();\n */\n\n }", "@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initializing\");\n\n // Initialize the hardware variables. Note that the strings used here as parameters\n // to 'get' must correspond to the names assigned during the robot configuration\n // step (using the FTC Robot Controller app on the phone).\n leftDrive = hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = hardwareMap.get(DcMotor.class, \"right_drive\");\n elev = hardwareMap.get(DcMotor.class, \"elev\");\n arm = hardwareMap.get(DcMotor.class,\"arm\");\n hook = hardwareMap.get(Servo.class,\"hook\");\n claw = hardwareMap.get(Servo.class,\"claw\");\n\n // Most robots need the motor on one side to be reversed to drive forward\n // Reverse the motor that runs backwards when connected directly to the battery\n leftDrive.setDirection(DcMotor.Direction.FORWARD);\n rightDrive.setDirection(DcMotor.Direction.REVERSE);\n elev.setDirection(DcMotor.Direction.REVERSE);\n arm.setDirection(DcMotor.Direction.REVERSE);\n elev.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n arm.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n lowerLimit = hardwareMap.digitalChannel.get(\"lower_limit\");\n upperLimit = hardwareMap.digitalChannel.get(\"upper_limit\");\n lowerLimit.setMode(DigitalChannel.Mode.INPUT);\n upperLimit.setMode(DigitalChannel.Mode.INPUT);\n\n// rightElev.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER); // Encoder on Left Elev only\n\n // Tell the driver that initialization is complete.\n telemetry.addData(\"Status\", \"Initialized\");\n }", "public void autonomousInit() {\n \n }", "protected void initialize()\n\t{\n\t\tenable = SmartDashboard.getBoolean(RobotMap.EnableRespoolWinch);\n\t}", "protected void initialize() {\n\t\tLiquidCrystal lcd = RobotMap.lcd;\n\t\tlcd.clear();\n\n\t\tRobotMap.chassisfrontLeft.set(0);\n\t\tRobotMap.chassisfrontRight.set(0);\n\t\tRobotMap.chassisrearRight.set(0);\n\t\tRobotMap.climberclimbMotor.set(0);\n\t\tRobotMap.floorfloorLift.set(0);\n\t\tRobotMap.acquisitionacquisitionMotor.set(0);\n\n\t\t\n\t\t}", "public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n// frontLeft = hwMap.get(DcMotor.class, \"frontLeft\");\n// frontRight = hwMap.get(DcMotor.class, \"frontRight\");\n// backLeft = hwMap.get(DcMotor.class, \"backLeft\");\n// lift = hwMap.get(DcMotor.class, \"lift\");\n// backRight = hwMap.get(DcMotor.class, \"backRight\");\n\n leftIntake = hwMap.get(DcMotor.class, \"leftIntake\");\n rightIntake = hwMap.get(DcMotor.class, \"rightIntake\");\n dropper = hwMap.get(DcMotor.class, \"dropper\");\n\n\n //range = hwMap.get(ModernRoboticsI2cRangeSensor.class, \"range\");\n gyro = (ModernRoboticsI2cGyro)hwMap.gyroSensor.get(\"gyro\");\n //color = hwMap.get(ModernRoboticsI2cColorSensor.class, \"color\");\n\n frontLeft.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n frontRight.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors\n backLeft.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n backRight.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors\n\n // Set all motors to zero power\n frontLeft.setPower(0);\n frontRight.setPower(0);\n backLeft.setPower(0);\n backRight.setPower(0);\n leftIntake.setPower(0);\n rightIntake.setPower(0);\n dropper.setPower(0);\n\n // Set all motors to run without encoders.\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n frontLeft.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n frontRight.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n backLeft.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n backRight.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n leftIntake.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n rightIntake.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n dropper.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n\n // Define and initialize ALL installed servos.\n\n// claimingArm = hwMap.get(Servo.class, \"claimingArm\");\n// claw1 = hwMap.get(Servo.class, \"claw1\");\n// claw2 = hwMap.get(Servo.class, \"claw2\");\n// samplingArm = hwMap.get(Servo.class, \"samplingArm\");\n\n helper = hwMap.get(Servo.class, \"helper\");\n leftUp = hwMap.get(Servo.class, \"leftUp\");\n rightUp = hwMap.get(Servo.class, \"rightUp\");\n outLeft = hwMap.get(Servo.class, \"outLeft\");\n outRight = hwMap.get(Servo.class, \"outRight\");\n\n// claimingArm.setPosition(0); // find out what servo they are using\n// claw1.setPosition(0);\n// claw2.setPosition(0);\n// samplingArm.setPosition(0);\n\n helper.setPosition(MID_SERVO);\n leftUp.setPosition(MID_SERVO);\n rightUp.setPosition(MID_SERVO);\n outLeft.setPosition(0.5);\n outRight.setPosition(0.5);\n\n dim = hwMap.get(DeviceInterfaceModule.class, \"Device Interface Module 1\");\n\n }", "public void setInit(){\n anInterface.SetInit();\n }", "private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}", "@Override\n protected void initialize() {\n headingPID.enable();\n headingPID.resetPID();\n Robot.driveBase.enableDriveBase();\n ahrs.reset();\n }", "@Override\r\n public void init() {\r\n // Define and Initialize Motors\r\nFL = hardwareMap.get(DcMotor.class, \"Front Left\");\r\n FR = hardwareMap.get(DcMotor.class, \"Front Right\");\r\n BL = hardwareMap.get(DcMotor.class, \"Back Left\");\r\n BR = hardwareMap.get(DcMotor.class, \"Back Right\");\r\n\r\n\r\nFL.setDirection(DcMotor.Direction.FORWARD);\r\n FR.setDirection(DcMotor.Direction.REVERSE);\r\n BL.setDirection(DcMotor.Direction.FORWARD);\r\n BR.setDirection(DcMotor.Direction.REVERSE);\r\n // Set all motors to zero power\r\n FL.setPower(0);\r\n FR.setPower(0);\r\n BL.setPower(0);\r\n BR.setPower(0); }", "public void init() throws Exception {\n List<String> bridges = VsctlCommand.listBridge();\n if (!bridges.contains(bridgeName)) {\n //throw new PhyBridgeNotFound();\n }\n\n /**\n *2.Set bridge datapath_type: ovs-vsctl --may-exist add-br br-phy set Bridge br-int datapath_type=system\n *3.Set security mode: ovs-vsctl set-fail-mode br-phy secure\n *4.Delete controller: ovs-vsctl del-controller br-phy\n */\n super.init();\n\n /**\n * 6.Install normal flow: ovs-ofctl add-flows br-phy \"table=0, priority=0, actions=normal\"\n */\n addFlows(new OvsFlow(FLowTable.LOCAL_SWITCHING, 0, FlowAction.NORMAL));\n\n /**\n * 7.Create port: ovs-vsctl --may-exist add-port br-int int-xxx\n */\n ovsAgent.getOvsIntegrationBridge().addPort(intIfName);\n\n /**\n * 8.Create port: ovs-vsctl --may-exist add-port br-phy phy-xxx\n */\n addPort(phyIfName);\n\n /**\n * 9.Drop flows: ovs-ofctl add-flows br-int \"table=O, priority=2, in_port=int_if_name, actions=drop\"\n */\n ovsAgent.getOvsIntegrationBridge().addFlows(\n new OvsFlow(FLowTable.LOCAL_SWITCHING, 2, intIfName, FlowAction.DROP));\n\n /**\n * 10.Drop flows: ovs-ofctl add-flows br-phy \"table=O, priority=2, i n_port=phys_if_name, actions=drop\"\n */\n addFlows(new OvsFlow(FLowTable.LOCAL_SWITCHING, 2, phyIfName, FlowAction.DROP));\n\n //11.Set status(up) and mtu\n }", "public void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\tteleopCommand = new TeleopCommand();\n }", "public void robotInit()\n\t{\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\t// autonomousCommand = new Driver();\n\t}", "public abstract void init() throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, RemoteReadException, InterruptedException;", "@Override\n public void init() {\n robot.init(hardwareMap);\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Status\", \"Initialized\"); //\n }", "public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n try {\n leftMotor1 = hwMap.dcMotor.get(\"right_motor1\");\n leftMotor2 = hwMap.dcMotor.get(\"right_motor2\");\n rightMotor1 = hwMap.dcMotor.get(\"left_motor1\");\n rightMotor2 = hwMap.dcMotor.get(\"left_motor2\");\n //servo_one = hwMap.servo.get(\"servant\");\n leftMotor1.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n leftMotor2.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n rightMotor1.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors\n rightMotor2.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors\n\n // Set all motors to zero power\n leftMotor1.setPower(0);\n rightMotor1.setPower(0);\n leftMotor2.setPower(0);\n rightMotor2.setPower(0);\n\n // Set all motors to run without encoders.\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n leftMotor1.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightMotor1.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n leftMotor2.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightMotor2.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n // Enable NavX Sensor\n\n navx_device = AHRS.getInstance(hwMap.deviceInterfaceModule.get(\"DIM1\"),\n NAVX_DIM_I2C_PORT,\n AHRS.DeviceDataType.kProcessedData,\n NAVX_DEVICE_UPDATE_RATE_HZ);\n } catch (Exception e) {\n\n RobotLog.ee(MESSAGETAG,e.getMessage());\n\n }\n }", "public void robotInit() {\n // Initialize all subsystems\n CommandBase.init();\n \n SmartDashboard.putNumber(RobotMap.Autonomous.MODE_KEY, 0);\n \n //temperary method to test door closing speeds\n SmartDashboard.putNumber(RobotMap.Force.DOOR_FORCE_KEY, 50);\n }", "public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n try {\n leftMotor = hwMap.dcMotor.get(LEFT_MOTOR);\n rightMotor = hwMap.dcMotor.get(RIGHT_MOTOR);\n\n scooperMotor = hwMap.dcMotor.get(LEFT_SCOP_MOTOR);\n\n leftShotMotor = hwMap.dcMotor.get(LEFT_SHOT_MOTOR);\n rightShotMotor = hwMap.dcMotor.get(RIGHT_SHOT_MOTOR);\n beaconPresserServo = hwMap.servo.get(\"beaconPresserServo\");\n } catch (IllegalArgumentException e) {\n\n }\n //setp with encoders, can change it later\n setupMotors(true);\n }", "@Override\n public void init() {\n telemetry.addData(\">\", \"Initializing...\");\n telemetry.update();\n\n // Sensors\n gyro = new Gyro(hardwareMap, \"gyro\");\n if (!gyro.isAvailable()) {\n telemetry.log().add(\"ERROR: Unable to initalize gyro\");\n }\n\n // Drive motors\n tank = new WheelMotorConfigs().init(hardwareMap, telemetry);\n tank.stop();\n\n // Vuforia\n vuforia = new VuforiaFTC(VuforiaConfigs.AssetName, VuforiaConfigs.TargetCount,\n VuforiaConfigs.Field(), VuforiaConfigs.Bot());\n vuforia.init();\n\n // Wait for the game to begin\n telemetry.addData(\">\", \"Ready for game start\");\n telemetry.update();\n }", "private void initWirelessCommunication() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n showToast(\"BLE is not supported\");\n finish();\n } else {\n showToast(\"BLE is supported\");\n // Access Location is a \"dangerous\" permission\n int hasAccessLocation = ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION);\n if (hasAccessLocation != PackageManager.PERMISSION_GRANTED) {\n // ask the user for permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},\n REQUEST_ACCESS_LOCATION);\n // the callback method onRequestPermissionsResult gets the result of this request\n }\n }\n // enable wireless communication alternative\n if (communicationAdapter == null || !communicationAdapter.isReadyToBeUsed()) {\n assert communicationAdapter != null;\n Intent enableWirelessCommunicationIntent = new Intent(communicationAdapter.actionRequestEnable());\n startActivityForResult(enableWirelessCommunicationIntent, REQUEST_ENABLE_BT);\n }\n }", "public void init(HardwareMap ahwMap) {\n\n// Giving hwMap a value\n hwMap = ahwMap;\n\n// Declaring servos to use in other classes\n claw = hwMap.get(Servo.class, \"servoClaw\");\n clawLeft = hwMap.get(Servo.class, \"servoClawLeft\");\n clawRight = hwMap.get(Servo.class, \"servoClawRight\");\n }", "public void init (HardwareMap ahwMap) {\n\n hwMap = ahwMap;\n\n // Initialize the hardware variables.\n lDrive = hwMap.get(DcMotor.class, \"lDrive\");\n rDrive = hwMap.get(DcMotor.class, \"rDrive\");\n\n //Setting direction of motor's rotation\n lDrive.setDirection(DcMotor.Direction.REVERSE);\n rDrive.setDirection(DcMotor.Direction.FORWARD);\n\n //setting motors to use Encoders\n setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n setZeroMode(DcMotor.ZeroPowerBehavior.BRAKE);\n //setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); // Temporary until encoders fixed\n\n //Setting motors with zero power when initializing\n setMotorPower(0.0, 0.0);\n }", "public void init(HardwareMap ahwMap) {\n // save reference to HW Map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n name = hwMap.dcMotor.get(\"left motor\");\n\n // Set all motors to zero power\n name.setPower(0);\n\n // Set all motors to run without encoders.\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n name.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n\n // Define and initialize ALL installed servos.\n name1 = hwMap.servo.get(\"arm\");\n name1.setPosition(0);\n }", "public void initialize() throws Exception {\n\t\tdataStore = new SimpleProcessImage();\r\n\t\tdataStore.addDigitalOut(new SimpleDigitalOut(true));\r\n\t\tdataStore.addDigitalOut(new SimpleDigitalOut(false));\r\n\t\tdataStore.addDigitalIn(new SimpleDigitalIn(false));\r\n\t\tdataStore.addDigitalIn(new SimpleDigitalIn(true));\r\n\t\tdataStore.addDigitalIn(new SimpleDigitalIn(false));\r\n\t\tdataStore.addDigitalIn(new SimpleDigitalIn(true));\r\n\r\n\t\tfor (int i = 0; i < num_registers; i++) {\r\n\t\t\tdataStore.addRegister(new SimpleRegister(0));\r\n\t\t}\t\t\r\n\r\n\t\t// 3. Set the image on the coupler\r\n\t\tModbusCoupler.getReference().setProcessImage(dataStore);\r\n\t\tModbusCoupler.getReference().setMaster(false);\r\n\t\tModbusCoupler.getReference().setUnitID(15);\r\n\r\n\t\tif(null != slaveListener && slaveListener.isListening()){\r\n\t\t\tslaveListener.stop();\r\n\t\t}\r\n\t\tslaveListener = new ModbusTCPListener(3);\r\n\t\tslaveListener.setPort(port);\r\n\t\tslaveListener.listen();\r\n\t}", "@Override \n public void init() {\n intakeLeft = hardwareMap.crservo.get(\"intakeLeft\");\n intakeRight = hardwareMap.crservo.get(\"intakeRight\");\n topLeft = hardwareMap.servo.get(\"topLeft\");\n bottomLeft = hardwareMap.servo.get(\"bottomRight\");\n topRight = hardwareMap.servo.get(\"topRight\");\n bottomRight = hardwareMap.servo.get(\"bottomRight\");\n lift = hardwareMap.dcMotor.get(\"lift\");\n }", "public void init (HardwareMap ahwMap) {\n\n hwMap = ahwMap;\n\n // Initialize the hardware variables.\n leftFront = hwMap.get(DcMotor.class, \"left-front\");\n leftRear = hwMap.get(DcMotor.class, \"left-rear\");\n rightFront = hwMap.get(DcMotor.class, \"right-front\");\n rightRear = hwMap.get(DcMotor.class, \"right-rear\");\n\n //Setting direction of motor's rotation\n leftFront.setDirection(DcMotor.Direction.REVERSE);\n leftRear.setDirection(DcMotor.Direction.REVERSE);\n rightFront.setDirection(DcMotor.Direction.FORWARD);\n rightRear.setDirection(DcMotor.Direction.FORWARD);\n\n //setting motors to use Encoders\n setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n //setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); // Temporary until encoders fixed\n\n //Setting motors with zero power when initializing\n setPower(0.0, 0.0);\n }", "private void setupTapInterfaces() {\n mTetheredReader.start(mHandler);\n mTetheredParams = InterfaceParams.getByName(mTetheredReader.iface.getInterfaceName());\n assertNotNull(mTetheredParams);\n mTetheredPacketReader = mTetheredReader.getReader();\n mHandler.post(mTetheredPacketReader::start);\n }", "public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n leftDrive = hwMap.get(DcMotor.class, \"left_drive\");\n rightDrive = hwMap.get(DcMotor.class, \"right_drive\");\n liftDrive = hwMap.get(DcMotor.class, \"lift_drive\");\n\n markerServo = hwMap.get(Servo.class, \"marker_servo\");\n hookServo = hwMap.get(Servo.class, \"hook_servo\"); //Hook server motor\n// distanceSensor = hardwareMap.get(DistanceSensor.class, \"sensor_color_distance\");\n touchSensor = hardwareMap.get(TouchSensor.class, \"touch_sensor\");\n\n leftDrive.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors\n rightDrive.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors\n liftDrive.setDirection(DcMotor.Direction.FORWARD);\n\n // Set all motors to zero power\n leftDrive.setPower(0);\n rightDrive.setPower(0);\n liftDrive.setPower(0);\n\n\n\n }", "@Override\n public void init() {\n \n \n rightFront = hardwareMap.dcMotor.get(\"frontR\");\n rightBack = hardwareMap.dcMotor.get(\"backR\");\n \n \n \n rightFront.setDirection(DcMotor.Direction.FORWARD); \n rightBack.setDirection(DcMotor.Direction.FORWARD);\n \n \n \n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }", "@Override\n\tpublic void teleopInit() {\n\t\tservoCIMCommand.start();\n\t\tmonitorCommand.start();\n\t\twindowCommand.start();\n\t\t\n\t}", "public void initialize() {\n \n CommPortIdentifier portId = null;\n\t\tEnumeration portEnum = CommPortIdentifier.getPortIdentifiers();\n\n\t\t//First, Find an instance of serial port as set in PORT_NAMES.\n\t\twhile (portEnum.hasMoreElements()) {\n\t\t\tCommPortIdentifier currPortId = (CommPortIdentifier) portEnum.nextElement();\n\t\t\tfor (String portName : PORT_NAMES) {\n\t\t\t\tif (currPortId.getName().equals(portName)) {\n\t\t\t\t\tportId = currPortId;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (portId == null) {\n\t\t\tSystem.out.println(\"Could not find COM port.\");\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t// open serial port, and use class name for the appName.\n\t\t\tserialPort = (SerialPort) portId.open(this.getClass().getName(),\n\t\t\t\t\tTIME_OUT);\n\n\t\t\t// set port parameters\n\t\t\tserialPort.setSerialPortParams(DATA_RATE,\n\t\t\t\t\tSerialPort.DATABITS_8,\n\t\t\t\t\tSerialPort.STOPBITS_1,\n\t\t\t\t\tSerialPort.PARITY_NONE);\n\n\t\t\t// open the streams\n\t\t\tinput = new BufferedReader(new InputStreamReader(serialPort.getInputStream()));\n\t\t\toutput = serialPort.getOutputStream();\n\n\t\t\t// add event listeners\n\t\t\tserialPort.addEventListener(this);\n\t\t\tserialPort.notifyOnDataAvailable(true);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e.toString());\n\t\t}\n\t}", "protected void initialize() {\n \tRobot.chassisSubsystem.setShootingMotors(0);\n }", "public void robotInit() {\n\t\toi = new OI();\n // instantiate the command used for the autonomous period\n }", "@Override\r\n public void init() {\r\n BackRight = hardwareMap.dcMotor.get(\"BackRight\");\r\n BackLeft = hardwareMap.dcMotor.get(\"BackLeft\");\r\n FrontRight = hardwareMap.dcMotor.get(\"FrontRight\");\r\n FrontLeft = hardwareMap.dcMotor.get(\"FrontLeft\");\r\n FrontRight.setDirection(DcMotor.Direction.REVERSE);\r\n BackRight.setDirection(DcMotor.Direction.REVERSE);\r\n\r\n TreadLeft = hardwareMap.dcMotor.get(\"TreadLeft\");\r\n TreadRight = hardwareMap.dcMotor.get(\"TreadRight\");\r\n\r\n ArmMotor = hardwareMap.dcMotor.get(\"ArmMotor\");\r\n }", "@Override\n public void init_loop() {\n smDrive.init_loop();\n smArm.init_loop();\n }", "public void robotInit()\r\n {\r\n // Initialize all subsystems\r\n CommandBase.init();\r\n // instantiate the command used for the autonomous period\r\n //Initializes triggers\r\n mecanumDriveTrigger = new MechanumDriveTrigger();\r\n tankDriveTrigger = new TankDriveTrigger();\r\n resetGyro = new ResetGyro();\r\n }", "public static void init() {\n\t\tfinal CxCommandManager ccm = CxCommandManager.getInstance();\n\t\tccm.register( SEND_HOST_INFO,\tnew SendHostInfoCommandDecoder() );\n\t\tccm.register( SEND_MSG, \t\tnew SendMessageCommandDecoder() );\n\t}", "public native void initPhysFS();", "public void setup() {\n\n // Initialize the serial port for communicating to a PC\n uartInit(UART6,9600);\n\n // Initialize the Analog-to-Digital converter on the HAT\n analogInit(); //need to call this first before calling analogRead()\n\n // Initialize the MMQ8451 Accelerometer\n try {\n accelerometer = new Mma8451Q(\"I2C1\");\n accelerometer.setMode(Mma8451Q.MODE_ACTIVE);\n } catch (IOException e) {\n Log.e(\"HW3Template\",\"setup\",e);\n }\n }", "public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n // left frond drive motor\n try\n {\n\n left_front_drv_Motor = hwMap.dcMotor.get(\"l_f_drv\");\n }\n catch (Exception p_exeception)\n {\n\n\n left_front_drv_Motor = null;\n }\n //left back drive motor\n\n try\n {\n\n left_back_drv_Motor = hwMap.dcMotor.get(\"l_b_drv\");\n }\n catch (Exception p_exeception)\n {\n\n\n left_back_drv_Motor = null;\n }\n // right front drive motor\n try\n {\n\n right_front_drv_Motor = hwMap.dcMotor.get(\"r_f_drv\");\n }\n catch (Exception p_exeception)\n {\n\n right_front_drv_Motor = null;\n }\n //right back drive motor\n try\n {\n\n right_back_drv_Motor = hwMap.dcMotor.get(\"r_b_drv\");\n }\n catch (Exception p_exeception)\n {\n\n\n right_back_drv_Motor = null;\n }\n\n //hinge motor for arm\n\n try\n {\n\n hinge = hwMap.dcMotor.get(\"hinge\");\n }\n catch (Exception p_exeception)\n {\n\n\n hinge = null;\n }\n //hang motor to land\n try\n {\n\n hang_motor = hwMap.dcMotor.get(\"hang\");\n }\n catch (Exception p_exeception)\n {\n\n\n hang_motor= null;\n }\n //intake motor\n try\n {\n\n fly_wheel = hwMap.dcMotor.get(\"intake\");\n }\n catch (Exception p_exeception)\n {\n\n\n hang_motor= null;\n }\n\n // Servos :\n\n\n try\n {\n //v_motor_left_drive = hardwareMap.dcMotor.get (\"l_drv\");\n //v_motor_left_drive.setDirection (DcMotor.Direction.REVERSE);\n marker = hwMap.servo.get(\"marker\");\n if (marker != null) {\n marker.setPosition(SERVO_LEFT_MIN);\n }\n\n\n }\n\n catch (Exception p_exeception)\n {\n //m_warning_message (\"l_drv\");\n // DbgLog.msg (p_exeception.getLocalizedMessage ());\n\n marker = null;\n }\n\n\n //set dc motors to run without an encoder and set intial power to 0\n //l_f_drv\n if (left_front_drv_Motor != null)\n {\n //l_return = left_drv_Motor.getPower ();\n left_front_drv_Motor.setDirection(DcMotor.Direction.FORWARD); // FORWARD was moving it backwards\n left_front_drv_Motor.setPower(0);\n left_front_drv_Motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n }\n //l_b_drv\n if (left_back_drv_Motor != null)\n {\n //l_return = left_drv_Motor.getPower ();\n left_back_drv_Motor.setDirection(DcMotor.Direction.FORWARD); // FORWARD was moving it backwards\n left_back_drv_Motor.setPower(0);\n left_back_drv_Motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n }\n\n //r_f_drv\n if (right_front_drv_Motor != null)\n {\n //l_return = left_drv_Motor.getPower ();\n right_front_drv_Motor.setDirection(DcMotor.Direction.FORWARD);// REVERSE was moving it backwards\n right_front_drv_Motor.setPower(0);\n right_front_drv_Motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n }\n //r_b_drv\n if (right_back_drv_Motor != null)\n {\n //l_return = left_drv_Motor.getPower ();\n right_back_drv_Motor.setDirection(DcMotor.Direction.FORWARD);// REVERSE was moving it backwards\n right_back_drv_Motor.setPower(0);\n right_back_drv_Motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n }\n //hinge\n if (hinge != null)\n {\n //l_return = left_drv_Motor.getPower ();\n hinge.setPower(0);\n hinge.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n }\n //hang\n if(hang_motor != null)\n\n {\n hang_motor.setPower(0);\n hang_motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n }\n //intake\n if(fly_wheel != null)\n\n {\n fly_wheel.setPower(0);\n fly_wheel.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n }\n\n/*\ninitalize the colorSensor and colorSensor\n*/\n try {\n colorSensor = hwMap.colorSensor.get(\"color\");\n }\n catch (Exception p_exeception)\n {\n //m_warning_message (\"colr_f\");\n // DbgLog.msg (p_exeception.getLocalizedMessage ());\n colorSensor = null;\n }\n\n\n try {\n LightSensorBottom = hwMap.lightSensor.get(\"ods\");\n }\n catch (Exception p_exeception)\n {\n //m_warning_message (\"ods\");\n // DbgLog.msg (p_exeception.getLocalizedMessage ());\n LightSensorBottom = null;\n }\n\n\n if (colorSensor != null) {\n //ColorFront reads beacon light and is in passive mode\n colorSensor.setI2cAddress(i2CAddressColorFront);\n colorSensor.enableLed(false);\n }\n\n if (LightSensorBottom != null) {\n //OpticalDistance sensor measures dist from the beacon\n LightSensorBottom.enableLed(false);\n }\n\n }", "public void initializeComponentCharacteristics() {\n super.initializeComponentCharacteristics();\n }", "public void initializeComponentCharacteristics() {\n super.initializeComponentCharacteristics();\n }", "protected void initialize() {\n\t\t// set the target for the PID subsystem\n\t\tRobot.minipidSubsystem.setSetpoint(90);\n\n\t\t// set the minimum and maximum output limits for the PID subsystem\n\t\tRobot.minipidSubsystem.setOutputLimits(-80, 80);\n\n\t\t// Disable safety checks on drive subsystem\n\t\tRobot.driveSubsystem.robotDrive.setSafetyEnabled(false);\n\t\t\n\t\tRobot.camera.setBrightness(0);\n\n\t}", "private void initialize() {\n\ttry {\n\t\t// user code begin {1}\n\t\t// user code end\n\t\tsetName(\"PlatformInfoPanel\");\n\t\tsetLayout(null);\n\t\tsetSize(353, 240);\n\t\tadd(getPnlOS(), getPnlOS().getName());\n\t\tadd(getPnlJava(), getPnlJava().getName());\n\t} catch (java.lang.Throwable ivjExc) {\n\t\thandleException(ivjExc);\n\t}\n\t// user code begin {2}\n\tgetTxtOSName().setText(System.getProperty(\"os.name\"));\n\tgetTxtOSArchitecture().setText(System.getProperty(\"os.arch\"));\n\tgetTxtOSVersion().setText(System.getProperty(\"os.version\"));\n\tgetTxtOSLocale().setText(java.util.Locale.getDefault().toString());\n\tgetTxtJavaVersion().setText(System.getProperty(\"java.version\"));\n\tgetTxtJavaVMVersion().setText(System.getProperty(\"java.vm.version\"));\n\t// user code end\n}", "public void init() {\n\t\ttry {\n\t\t\tthis.is = new ObjectInputStream(clientSocket.getInputStream());\n\t\t\tthis.os = new ObjectOutputStream(clientSocket.getOutputStream());\n\t\t\twhile (this.readCommand()) {}\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void robotInit() {\n\t\tmyRobot = new RobotDrive(0,1);\n\t\tteleop = new Teleop(myRobot);\n\t\tauto = new AutonomousDrive(myRobot);\n\t}", "public void init(HardwareMap ahwMap) {\n // Save reference to Hardware map\n hwMap = ahwMap;\n\n // Define and Initialize Motors\n frontLeft = hwMap.get(DcMotor.class, \"front_left\");\n frontRight = hwMap.get(DcMotor.class, \"front_right\");\n backLeft = hwMap.get(DcMotor.class, \"back_left\");\n backRight = hwMap.get(DcMotor.class, \"back_right\");\n flipper = hwMap.get(DcMotor.class, \"flipper\");\n intake = hwMap.get(CRServo.class, \"intake\");\n reelIn = hwMap.get(DcMotor.class, \"reelIn\");\n reelOut = hwMap.get(DcMotor.class, \"reelOut\");\n bucket = hwMap.get(Servo.class, \"bucket\");\n frontLeft.setDirection(DcMotor.Direction.FORWARD);\n frontRight.setDirection(DcMotor.Direction.REVERSE);\n backLeft.setDirection(DcMotor.Direction.REVERSE);\n backRight.setDirection(DcMotor.Direction.FORWARD);\n \n // Set all motors to zero power\n frontLeft.setPower(0);\n frontRight.setPower(0);\n backLeft.setPower(0);\n backRight.setPower(0);\n reelIn.setPower(0);\n reelOut.setPower(0);\n // Set all motors to run without encoders.\n // May want to use RUN_USING_ENCODERS if encoders are installed.\n frontLeft.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n frontRight.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n backLeft.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n backRight.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n flipper.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n}" ]
[ "0.8218544", "0.73745877", "0.72169113", "0.6796372", "0.6724548", "0.6694773", "0.6593789", "0.65810317", "0.6566287", "0.6544252", "0.65379685", "0.65292406", "0.65153146", "0.6504885", "0.6436474", "0.6425336", "0.6412519", "0.64116925", "0.64075726", "0.6403585", "0.63959414", "0.6379852", "0.63721305", "0.6363383", "0.63593286", "0.63411456", "0.6329106", "0.6325575", "0.6324859", "0.63213533", "0.63112205", "0.63101584", "0.62944925", "0.6281293", "0.6268348", "0.62655705", "0.62634987", "0.6258102", "0.6253022", "0.62216175", "0.6219202", "0.62143004", "0.6210679", "0.62053525", "0.6188938", "0.61564314", "0.61534077", "0.61491483", "0.6146843", "0.6138344", "0.6138344", "0.61290807", "0.6112946", "0.6112483", "0.6110459", "0.6108141", "0.61074257", "0.60965145", "0.6095884", "0.6090937", "0.60857666", "0.6085065", "0.6082038", "0.6079568", "0.6070314", "0.60694176", "0.6059889", "0.60479033", "0.60477257", "0.601541", "0.60150766", "0.600803", "0.60040265", "0.59997207", "0.5998229", "0.5994847", "0.5992019", "0.59911287", "0.59892005", "0.59887457", "0.59807116", "0.59769213", "0.59737915", "0.5961726", "0.5954373", "0.59482926", "0.5934978", "0.59349155", "0.5934595", "0.5932337", "0.59253395", "0.59210324", "0.59177357", "0.59175515", "0.59175515", "0.5912899", "0.5909515", "0.59071535", "0.59067357", "0.5902747" ]
0.61488396
48
waitForTick implements a periodic delay. However, this acts like a metronome with a regular periodic tick. This is used to compensate for varying processing times for each cycle. The function looks at the elapsed cycle time, and sleeps for the remaining time interval.
public void waitForTick(long periodMs) throws InterruptedException { long remaining = periodMs - (long)period.milliseconds(); // sleep for the remaining portion of the regular cycle period. if (remaining > 0) Thread.sleep(remaining); // Reset the cycle clock for the next pass. period.reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void waitForTick(long periodMs) throws InterruptedException {\n\n long remaining = periodMs - (long)period.milliseconds();\n\n // sleep for the remaining portion of the regular cycle period.\n if (remaining > 0)\n Thread.sleep(remaining);\n\n // Reset the cycle clock for the next pass.\n period.reset();\n }", "public void waitForTick(long periodMs) throws InterruptedException{\r\n long remaining = periodMs - (long)period.milliseconds();\r\n\r\n // sleep for the remaining portion of the regular cycle period.\r\n if (remaining > 0)\r\n sleep(remaining);\r\n\r\n // Reset the cycle clock for the next pass.\r\n period.reset();\r\n }", "public void waitForTick(long periodMs) throws InterruptedException {\n\n long remaining = periodMs - (long)period.milliseconds();\n\n // sleep for the remaining portion of the regular cycle period.\n if (remaining > 0)\n Thread.sleep(remaining);\n\n // Reset the cycle clock for the next pass.\n period.reset();\n }", "public void waitForTick(long periodMs) throws InterruptedException {\n\n long remaining = periodMs - (long) period.milliseconds();\n\n // sleep for the remaining portion of the regular cycle period.\n if (remaining > 0)\n Thread.sleep(remaining);\n\n // Reset the cycle clock for the next pass.\n period.reset();\n }", "public void waitForTick(long periodMs) {\n\n long remaining = periodMs - (long)period.milliseconds();\n\n // sleep for the remaining portion of the regular cycle period.\n if (remaining > 0) {\n try {\n Thread.sleep(remaining);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n }\n\n // Reset the cycle clock for the next pass.\n period.reset();\n }", "public void waitForTick(long periodMs) {\n\n long remaining = periodMs - (long) period.milliseconds();\n\n // sleep for the remaining portion of the regular cycle autoPeriod.\n if (remaining > 0) {\n try {\n Thread.sleep(remaining);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n }\n\n // Reset the cycle clock for the next pass.\n period.reset();\n }", "public void waitForNextTick() throws InterruptedException {\n Thread.sleep(timeoutPeriod);\n }", "private void timeSync() throws InterruptedException {\n long realTimeDateMs = currentTimeMs - System.currentTimeMillis();\n long sleepTime = periodMs + realTimeDateMs + randomJitter();\n\n if (slowdownFactor != 1) {\n sleepTime = periodMs * slowdownFactor;\n }\n\n if (sleepTime > 0) {\n Thread.sleep(sleepTime);\n }\n }", "public synchronized void tick(){\r\n\t\ttime++;\r\n\t\tnotifyAll();\r\n\t}", "private void sleepByScheduleTime() throws InterruptedException\n\t{\n\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\tcalendar.setTime(new java.util.Date(System.currentTimeMillis()));\n\t\tint currHour = calendar.get(calendar.HOUR_OF_DAY);\n\t\tif ((24 - currHour) * 60 < 2 * FtpData.SCHEDULE_TIME)\n\t\t{\n\t\t\tsleep((FtpData.SCHEDULE_TIME + 1) * 60000); // 00h:01\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsleep(FtpData.SCHEDULE_TIME * 60000); // n * minutes;\n\t\t}\n\t}", "void delayForDesiredFPS(){\n delayMs=(int)Math.round(desiredPeriodMs-(float)getLastDtNs()/1000000);\n if(delayMs<0) delayMs=1;\n try {Thread.currentThread().sleep(delayMs);} catch (java.lang.InterruptedException e) {}\n }", "public void delay(long waitAmount){\r\n long time = System.currentTimeMillis();\r\n while ((time+waitAmount)>=System.currentTimeMillis()){ \r\n //nothing\r\n }\r\n }", "void tick(long tickSinceStart);", "public static void tick() {\n if (tickTime == 0L) {\n tickTime = System.currentTimeMillis();\n } else {\n System.err.println(\"Must call tock before tick\");\n System.exit(1);\n }\n }", "public void tick(double dt) {\n }", "public void onTimeTick() {\n tick++;\n try {\n sendBeaconLog(10);\n } catch (InterruptedException e) {\n }\n if (tick % 10 == 0) {\n sendDirectedPresence();\n }\n }", "public void sleep() throws InterruptedException, IllegalArgumentException, Time.Ex_TimeNotAvailable, Time.Ex_TooLate\n {\n // The current time.\n AbsTime now;\n // The duration to wait.\n RelTime duration;\n\n // Make error if NEVER.\n if (isNEVER()) {\n throw new IllegalArgumentException(\"this == NEVER\");\n }\n\n // Don't do anything if ASAP.\n if (!isASAP()) {\n\n // Calculate the time now.\n now = new AbsTime();\n\n // Figure out how long to wait for.\n duration = Time.diff(this, now);\n\n // If duration is negative, throw the Ex_TooLate exception.\n if (duration.getValue() < 0L) {\n throw new Time.Ex_TooLate();\n }\n\n // Do the wait.\n duration.sleep();\n }\n }", "private void beginTicks() throws IOException, InterruptedException {\n while (!game.isEnded() || endGui.getActiveWindow() != null) {\n tick();\n Thread.sleep(1000L / Game.TICKS_PER_SECOND);\n }\n\n System.exit(0);\n }", "public synchronized void scheduleTick(long deltat){\n\t\tscheduler.schedule(tickTask, deltat, TimeUnit.MILLISECONDS);\n\t}", "public void tick(){\r\n if(timer != 0)\r\n timer++;\r\n }", "private void sync() {\n float loopSlot = 1.0f/TARGET_FPS;\n double endTime = updateTimer.getLastRecordedTime() + loopSlot;\n while(updateTimer.getTime() < endTime) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException ie) {\n ie.printStackTrace();\n Thread.currentThread().interrupt();\n }\n }\n }", "public static void alarmTest1() {\n\tint durations[] = {1000, 10*1000, 100*1000};\n\tlong t0, t1;\n\tfor (int d : durations) {\n\t t0 = Machine.timer().getTime();\n\t ThreadedKernel.alarm.waitUntil (d);\n\t t1 = Machine.timer().getTime();\n\t System.out.println (\"alarmTest1: waited for \" + (t1 - t0) + \" ticks\");\n\t}\n }", "private void tick(boolean catchUp) {\n if (catchUp && lastTick != 0) {\n long sinceLastTick = System.currentTimeMillis() - lastTick;\n long ticksMissed = (sinceLastTick / 50) - 1;\n\n if (ticksMissed > 0) {\n Server.getLogger().warn(\"Trying to catch up! Last server tick took \" + sinceLastTick + \"ms \" +\n \"(or the time of \" + (ticksMissed + 1) + \" ticks)\");\n\n for (int i = 0; i < ticksMissed; i++) {\n tick(false);\n }\n }\n }\n\n lastTick = System.currentTimeMillis();\n PuddingServer.getComponentManager().tickAll();\n }", "void tick(long ticksSinceStart);", "public void tick()\r\n\t{\r\n\t\tduration = (int) (((Sys.getTime() - lastCall) * resolution) / Sys\r\n\t\t\t\t.getTimerResolution());\r\n\t\tlastCall = Sys.getTime();\r\n\t}", "public void delay(){\n try {\n Thread.sleep((long) ((samplingTime * simulationSpeed.factor)* 1000));\n } catch (InterruptedException e) {\n started = false;\n }\n }", "public static void waitFor(int timeSecond) {\n try {\n Thread.sleep(timeSecond * 1000L);\n } catch (Exception e) {\n log.error(e.toString());\n }\n }", "private void waitConstant() {\r\n \t\tlong\tlwait = CL_FRMPRDAC;\r\n \t\t// drawing is active?\r\n \t\tif(m_fHorzShift == 0 && m_lTimeZoomStart == 0\r\n \t\t\t\t&& GloneApp.getDoc().isOnAnimation() == false)\r\n \t\t\tlwait = CL_FRMPRDST;\t\t// stalled\r\n \r\n \t\t// make constant fps\r\n \t\t// http://stackoverflow.com/questions/4772693/\r\n \t\tlong\tldt = System.currentTimeMillis() - m_lLastRendered;\r\n \t\ttry {\r\n \t\t\tif(ldt < lwait)\r\n \t\t\t\tThread.sleep(lwait - ldt);\r\n \t\t} catch (InterruptedException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t}\r\n \t}", "private void waitFPS() {\n try {\n Thread.sleep((int) (1000.0f / 60.0f));\n } catch (InterruptedException e) {\n logger.error(\"Unable to wait some milli's !\", e);\n }\n }", "public static void sleepFor(float time) {\n try {\r\n Thread.sleep((int)(time*1000));\r\n } catch (InterruptedException e){\r\n }\r\n }", "public static void waitTime(long s) {\n long l = System.currentTimeMillis() + s;\n while (System.currentTimeMillis() < l) {\n\n }\n }", "private void sleep(long ms) throws InterruptedException {\n Thread.sleep(ms);\n }", "public void tick() {\n long elapsed = (System.nanoTime()-startTime)/1000000;\n\n if(elapsed>delay) {\n currentFrame++;\n startTime = System.nanoTime();\n }\n if(currentFrame == images.length){\n currentFrame = 0;\n }\n }", "public static void sleepForTwoSec() throws InterruptedException {\n Thread.sleep(2000);\n }", "public void testSleep() {\n System.out.println(\"sleep\");\n long thinkTime = 0L;\n IOUtil.sleep(thinkTime);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "private void sleepFor(long t) {\n\t\ttry {\n\t\t\tThread.sleep(t);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void tick() {\n\t\tmFrameCount++;\n\t\t\n\t\tif (mStopwatch.getElapsedTime() > 1000) {\n\t\t\tmFramesPerSecond = mFrameCount;\n\t\t\tmFrameCount = 0;\n\t\t\t\n\t\t\tmStopwatch.restart();\n\t\t}\n\t}", "public void sleepy(long ms)\n\t{\n\t\ttry {\n\t\t\tsleep(ms);\n\t\t} catch(InterruptedException e) {}\n\t}", "private void sleepMilliseconds(int time) {\n int multipliedParam = (int) (Math.random() * time + 1);\n\n try {\n TimeUnit.MILLISECONDS.sleep(multipliedParam);\n Log.v(\"DLASync.sleep\", \" sleep \" + multipliedParam + \" milliseconds...\");\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public static final long getTickMillis() {\n return p().TIME_TICK;\n }", "private static void tickOnThread() {\n final Thread thread = new Thread(new Runnable(){\n @Override\n public void run() {\n tick(true);\n }\n });\n thread.start();\n }", "public void sleep(long millis) {\n\n\t\tlong timeOld = System.currentTimeMillis();\n\t\tlong timeNew = 0;\n\t\tlong temp = timeNew - timeOld;\n\n\t\twhile (temp < millis) {\n\t\t\ttimeNew = System.currentTimeMillis();\n\t\t\ttemp = timeNew - timeOld;\n\t\t}\n\n\t}", "@Override\n public void reactTo(Tick tick) {\n\ttry {\n\t Thread.sleep(FRAME_INTERVAL_MILLIS);\n\t} catch (InterruptedException e) {\n\t // TODO Auto-generated catch block\n\t e.printStackTrace();\n\t}\n\tscreen.update();\n\tmpq.add(new Tick(tick.time() + 1));\n }", "protected void timerTicked() {\n\t\t// 5% of the time, increment or decrement the counter\n\t\tif (Math.random() >= 0.05) return; // do nothing 95% of the time\n\n\t\t// \"flip a coin\" to determine whether to increment or decrement\n\t\tboolean move = Math.random() >= 0.5;\n\t\t\n\t\t// send the move-action to the game\n\t\tgame.sendAction(new CounterMoveAction(this, move));\n\t}", "private void wait(long lastLoopTime, final long OPTIMAL_TIME) {\n try {\n Thread.sleep( (lastLoopTime - System.nanoTime() + OPTIMAL_TIME)/1000000);\n } catch (Exception e) {}\n }", "public void testTimedPoll() {\n try {\n SynchronousQueue q = new SynchronousQueue();\n assertNull(q.poll(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));\n } catch (InterruptedException e){\n\t unexpectedException();\n\t}\n }", "private long goToSleep(long lastSleepTime)\n\t{\n\t\tlong diff, sleepTime;\n\t\t\n\t\tdiff = System.currentTimeMillis() - lastSleepTime;\n sleepTime = PERIOD - lastSleepTime;\n if(sleepTime <= 0)\n sleepTime = 5;\n\n try \n {\n Thread.sleep(sleepTime);\n }\n catch(InterruptedException e){}\n\n return System.currentTimeMillis();\n\t}", "public void tick() {\n\t\ttick(1);\n\t}", "public void update()\r\n\t{\r\n\t\tcurrenttime = Calendar.getInstance();\r\n\t\trunningTime = (currenttime.getTimeInMillis() - starttime.getTimeInMillis()) - amountOfPause;\r\n\t\t\r\n\t\tif (tickPeriod != 0)\r\n\t\t{\r\n\t\t\tif (runningTime - lastRunningTime >= tickPeriod)\r\n\t\t\t{\r\n\t\t\t\tpassedTicks++;\r\n\t\t\t\tlastRunningTime = passedTicks * tickPeriod;\r\n\t\t\t\tif (tickListener != null) tickListener.onTick(this);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void pauseUntilNextClock(){\n\t\tlong sleepTime = (long) (1000.0 / Settings.getSettings().getClockSpeed())\n\t\t\t\t- (System.currentTimeMillis() - this.mStartOfClock);\n\t\t\n\t\tif(sleepTime > 0){\n\t\t\ttry {\n\t\t\t\tThread.sleep(sleepTime);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}else{\n\t\t\tSystem.out.println(\"WARNING: System cannot keep up with simulator clock speed!\");\n\t\t\tSystem.out.println(\"WARNING: Reduce clock speed!\");\n\t\t\t}\n\t\t\n\t\tthis.mStartOfClock = System.currentTimeMillis();\n\t}", "public static void sleepFor(int sec) throws InterruptedException {\n Thread.sleep(sec * 1000);\n }", "public void run() {\n\ttimedOut = false;\n\tlong startTime = new Date().getTime();\n\tlong delta = 0;\n\twhile (delta < interval) {\n\t try {\n\t\tThread.sleep(interval - delta);\n\t } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n\t\treturn;\n\t }\n\t delta = new Date().getTime() - startTime;\n\t}\n\ttimedOut = true;\n\ttimeoutHandler.handleTimeout();\n\treturn;\n }", "public void sleep()\n\t{\n\t\ttry\n\t\t{\n\t\t\tThread.sleep(getMilliseconds());\n\t\t}\n\t\tcatch (InterruptedException e)\n\t\t{\n\t\t\t// ignore but return\n\t\t}\n\t}", "public void cycleOutput(long tick)\n {\n }", "public void tick()\n {\n if ( --ticksUntilVSync == 0 )\n {\n ticksUntilVSync = ticksUntilVSyncLatch;\n copper.restart();\n irqController.triggerIRQ( IRQController.IRQSource.VBLANK );\n }\n if ( dmaController.isCopperDMAEnabled() )\n {\n copper.tick();\n }\n\n hpos++;\n if ( hpos == 0xd8 ) { // $d8 = 216 = 8 pixel hblank + 200 pixel + 8 pixel hblank\n hpos = 0;\n\n if ( amiga.isNTSC() )\n {\n // toggle long/short line flag, only applicable for NTSC amigas\n longLine ^= 0b1000_0000;\n }\n\n vpos++;\n /*\n | Normal | Interlaced\nPAL | 283 | 567\nNTSC| 241 | 483\n */\n\n if ( isInterlaced() )\n {\n final int maxY = amiga.isPAL() ? 283 : 241;\n if ( vpos >= maxY )\n {\n longFrame = 0x8000;\n }\n }\n\n int maxY;\n if ( amiga.isPAL() )\n {\n maxY = 29 + (isInterlaced() ? 567 : 283);\n }\n else\n {\n maxY = 21 + (isInterlaced() ? 483 : 241);\n }\n if ( vpos == maxY ) {\n vpos = 0;\n longFrame = 0;\n copper.restart();\n }\n }\n }", "public void waitUntilTimeStamp(long _timeStamp) throws InterruptedException {\n long delta = _timeStamp - getTime();\n while(delta>0) {\n Thread.sleep(delta/10);\n delta = _timeStamp - getTime();\n }\n }", "private void delay (int milliSec)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tThread.sleep (milliSec);\r\n\t\t}\r\n\t\tcatch (InterruptedException e)\r\n\t\t{\r\n\t\t}\r\n\t}", "public void testPeriodic()\n\t{\n\t\tif (oi.getGunS() > 0.5)\t{\n\t\t\tdrive.TimerMove(0.3, 0.75);\n\t\t\tdrive.TimerMove(-0.3, 0.75);\n\t\t}\n\t\tlong milis = (long)(1.5 * 1000);\n \tlong time = System.currentTimeMillis();\n \twhile (System.currentTimeMillis() < time + milis)\n \t\tconveyor.setConveyor(1);\n\t\ttime = System.currentTimeMillis();\n\t\twhile (System.currentTimeMillis() < time + milis)\n\t\t\tconveyor.setConveyor(-1);\n\t\tconveyor.setConveyor(0);\n\t\ttime = System.currentTimeMillis();\n\t\twhile (System.currentTimeMillis() < time + milis)\n\t\t\tconveyor.setPlate(false);\n\t\ttime = System.currentTimeMillis();\n\t\twhile (System.currentTimeMillis() < time + milis)\n\t\t\tconveyor.setPlate(true);\n\t\telRaise.elCycle();\n\t\tLiveWindow.run();\n\t}", "public synchronized static void incrementTimeBy(int ticks) {\n\t\tif (ticks > 0) {\n\t\t\ttime += ticks;\n\t\t}\n\t}", "public void clock(double period);", "public void tick() {\r\n tick++;\r\n }", "private static void waiting(int time) {\r\n\t\ttry {\r\n\t\t\tThread.sleep(time);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public void tick() {\r\n if (this.ticking == true) {\r\n \t this.ticks++;\r\n //Every 100 ticks is 10 seconds.\r\n //Reset the display.\r\n if (this.ticks == 100) {\r\n if (this.isLocked == false) {\r\n this.lockGui.setDisplay(\"Open\");\r\n }\r\n\r\n else {\r\n this.lockGui.setDisplay(\"Locked\");\r\n }\r\n\r\n this.ticking = false;\r\n this.entered = \"\";\r\n }\r\n }\r\n }", "private void stepTiming() {\n\t\tdouble currTime = System.currentTimeMillis();\n\t\tstepCounter++;\n\t\t// if it's been a second, compute frames-per-second\n\t\tif (currTime - lastStepTime > 1000.0) {\n\t\t\tdouble fps = (double) stepCounter * 1000.0\n\t\t\t\t\t/ (currTime - lastStepTime);\n\t\t\t// System.err.println(\"FPS: \" + fps);\n\t\t\tstepCounter = 0;\n\t\t\tlastStepTime = currTime;\n\t\t}\n\t}", "public void delay(long waitAmountMillis)\n {\n long endTime = System.currentTimeMillis() + waitAmountMillis;\n\n while (System.currentTimeMillis() < endTime)\n {\n String checkStyle = \"is absolute garbage\";\n }\n }", "private void sleep()\n {\n try {\n Thread.sleep(Driver.sleepTimeMs);\n }\n catch (InterruptedException ex)\n {\n\n }\n }", "public void tick(){\n\t\ttimer += System.currentTimeMillis() - lastTime;\n\t\tif(timer > speed){\n\t\t\tcurrent = image.next();\n\t\t\ttimer = 0;\n\t\t}\n\t\tlastTime = System.currentTimeMillis();\n\t}", "public void waitForSeconds(int i){\r\n\t\ttry {\r\n\t\t\tThread.sleep(1000*i);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic synchronized void run() {\n\t\tlong secElapsed;\r\n\t\t//long startTime = System.currentTimeMillis();\r\n\t\tlong start= System.currentTimeMillis();;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tTimeUnit.SECONDS.sleep(1);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\tlong timeElapsed = System.currentTimeMillis() - start;\r\n\t\t\tsecElapsed = timeElapsed / 1000;\r\n\t\t\tif(secElapsed==10) {\r\n\t\t\t\tstart=System.currentTimeMillis();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"Time -> 00:\"+secElapsed);\r\n\t\t}while(secElapsed<=10);\r\n\t\t\r\n\t}", "public void waitSleep(int pTime)\n{\n\n try {Thread.sleep(pTime);} catch (InterruptedException e) { }\n\n}", "@Override\n public void secondTick(int ms) {\n if (this.interactionTimeout == 0) {\n this.image = image_on;\n }\n super.secondTick(ms);\n }", "public final long tickMillis() {\n return TIME_TICK;\n }", "boolean isRunningDuringTick(int tick);", "public void onTick(long millisecondsUntilDone) {\n\n Log.i(\"Seconds left\", String.valueOf(millisecondsUntilDone / 1000));\n\n }", "protected abstract void tick();", "public abstract void onTick(long millisUntilFinished);", "public void step(long now) {\n\t}", "public void step(float time)\n {\n if(this.firstTick)\n {\n this.firstTick = false;\n this.elapsed = 0.0f;\n }\n else\n {\n this.elapsed += time;\n }\n\n float updateTime = (float)Math.min(1.0f, this.elapsed/this.duration);\n\n this.update(updateTime);\n }", "public void waitTime(double time){\n double startTime = System.currentTimeMillis() + time *1000 ;\n while (opMode.opModeIsActive()){\n if (System.currentTimeMillis() > startTime) break;\n }\n }", "private void sync(double lastCallTime) {\r\n\t\tfloat renderInterval = 1f / TARGET_FPS;\r\n\t\tdouble endTime = lastCallTime + renderInterval;\r\n\t\t//while current time is less than allotted time, wait\r\n\t\twhile (System.nanoTime() / 1e9 < endTime) {\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(1);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t}", "int getFinalTick();", "private void step ()\n {\n // a car arrives approximately every four minutes\n int chance = randGen.nextInt(CarWashApplication.CHANCE_INT);\n if (chance == 0)\n {\n waitingLine.enqueue(new Car(currentTime));\n numCars++;\n\n /** For printed output of each step */\n //System.out.println(currentTime);\n //waitingLine.toPrint();\n }\n\n // process the waiting cars\n if (bay.isEmpty() && !waitingLine.isEmpty())\n {\n bay.startWash();\n Car car = (Car) waitingLine.dequeue();\n waitTimeArray[arrayIndex] = currentTime - (car.arrivalTime());\n arrayIndex++;\n }\n\n if (!bay.isEmpty())\n bay.keepWashing();\n\n currentTime++;\n }", "public void cycle() {\n ticks++;\n for (int i = 0; i < validDevices; i++)\n devices[i].onClockTick(ticks);\n }", "public void sleep()\r\n\t{\r\n\t\tif (regulate)\r\n\t\t{\r\n\t\t\tDisplay.sync(fps);\r\n\t\t}\r\n\t}", "private static void testDelayOverhead() throws InterruptedException {\n Object m = \"\";\n int iters = 1000;\n long delay = 50;\n\n long before = System.currentTimeMillis();\n\n for (int i = 0; i < iters; i++) {\n\n synchronized (m) {\n m.wait(delay);\n }\n }\n\n long after = System.currentTimeMillis();\n\n long tottime = after - before;\n System.out.println(\"total time: \" + tottime + \"ms\");\n long ovhd = tottime - iters * delay;\n System.out.println(\"overhead: \" + ovhd + \"ms (\" + (100 * (ovhd / ((double) tottime))) + \"%)\");\n }", "public void updateWaitingTime(){\n waitingTime = waitingTime - 1;\n }", "private void waitMs(final long toWait) {\n synchronized (this) {\n try {\n if (toWait > 0) {\n wait(toWait);\n }\n } catch (InterruptedException ex) {\n Log.e(TAG, ex.getMessage(), ex);\n }\n }\n }", "void tick();", "void tick();", "void tick(H host, int systemTick);", "public void kickTimer() {\n delayTime = System.currentTimeMillis() + shutdownDelay;\n// System.out.println(\"Time at which the loop should kick: \" + delayTime);\n }", "void incrementTick();", "public void incrementWaitCounter() {\n ticksWaitingToBeAssigned++;\n }", "public static void aroundForTime(Task t, long time) {\n\t\ttry {\n\t\t\tThread.sleep(time);\n\t\t\tt.complete();\n\t\t\tThread.sleep(time);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void threadDelay() {\n saveState();\n if (pauseSimulator) {\n halt();\n }\n try {\n Thread.sleep(Algorithm_Simulator.timeGap);\n\n } catch (InterruptedException ex) {\n Logger.getLogger(RunBFS.class.getName()).log(Level.SEVERE, null, ex);\n }\n if (pauseSimulator) {\n halt();\n }\n }", "public static void wait(int ms) {\n try {\n Thread.sleep(ms);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }", "void awaitNanos(final long timeout) throws InterruptedException;", "public static void waitFilesystemTime() throws InterruptedException {\n /*\n * How much time to wait until we are sure that the file system will update the last\n * modified timestamp of a file. This is usually related to the accuracy of last timestamps.\n * In modern windows systems 100ms be more than enough (NTFS has 100us accuracy --\n * see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724290(v=vs.85).aspx).\n * In linux it will depend on the filesystem. ext4 has 1ns accuracy (if inodes are 256 byte\n * or larger), but ext3 has 1 second.\n */\n Thread.sleep(2000);\n }", "public void wait(int time) {\r\n\t\t\tsuper.sleep(time);\r\n\t\t}" ]
[ "0.7622029", "0.75536036", "0.7522144", "0.7517583", "0.73249257", "0.7297914", "0.7264519", "0.636563", "0.5797119", "0.5728334", "0.56351984", "0.55938864", "0.55850667", "0.5576087", "0.5488821", "0.5452249", "0.5356256", "0.5310051", "0.52522993", "0.5249029", "0.52489555", "0.52173984", "0.51948744", "0.5191543", "0.5176143", "0.51698625", "0.5153326", "0.51418495", "0.51401", "0.51330245", "0.5114265", "0.5082645", "0.5079562", "0.50441194", "0.50407714", "0.5032593", "0.501274", "0.49935505", "0.49711293", "0.4970442", "0.49603766", "0.49524993", "0.49446833", "0.49425438", "0.49318573", "0.49288878", "0.49285445", "0.4919867", "0.49134418", "0.4912896", "0.48880544", "0.48864767", "0.48822778", "0.48817787", "0.4877175", "0.487459", "0.48681343", "0.48675543", "0.4865578", "0.48622164", "0.48299104", "0.4828852", "0.48238918", "0.48228624", "0.48211354", "0.48196983", "0.48172325", "0.48146808", "0.48119813", "0.48082793", "0.48082173", "0.4805116", "0.47900322", "0.47825837", "0.47759038", "0.47754022", "0.47687778", "0.4762704", "0.4761696", "0.47583959", "0.47545922", "0.4751317", "0.47493222", "0.47397602", "0.4732435", "0.47300822", "0.47273502", "0.47235432", "0.47235432", "0.47232643", "0.4723207", "0.4715051", "0.47145414", "0.47131374", "0.4711623", "0.47033736", "0.46963733", "0.4695121", "0.46933594" ]
0.7514138
5
Implemented by keywords that precede the WITH statement.
public interface BeforeWith<T extends BeforeWith<T>> extends QueryPart, QueryPartSQL<T>, QueryPartLinked<T> { /** * Continue query with WITH * * @param name The name of the with-block * @return The new WITH statement */ default With with(final String name) { return new With(this, name); } /** * Accept an existing WITH statement as predecessor * * @param with The existing WITH statement * @return Returns the passed WITH statement */ default With with(final With with) { return with.parent(this); } /** * Use plain SQL to form this WITH statement * * @param sql The sql string * @return The new WITH statement */ default With withSQL(final String sql) { return with((String) null).sql(sql); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ParseTree parseWithStatement() {\n SourcePosition start = getTreeStartLocation();\n eat(TokenType.WITH);\n eat(TokenType.OPEN_PAREN);\n ParseTree expression = parseExpression();\n eat(TokenType.CLOSE_PAREN);\n ParseTree body = parseStatement();\n return new WithStatementTree(getTreeLocation(start), expression, body);\n }", "public T caseWithClause(WithClause object)\n {\n return null;\n }", "static boolean newExpressionWithKeyword(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"newExpressionWithKeyword\")) return false;\n if (!nextTokenIs(b, \"\", CONST, NEW)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_);\n r = newExpressionWithKeyword_0(b, l + 1);\n p = r; // pin = 1\n r = r && report_error_(b, type(b, l + 1));\n r = p && report_error_(b, newExpressionWithKeyword_2(b, l + 1)) && r;\n r = p && argumentsWrapper(b, l + 1) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "public final PythonParser.with_stmt_return with_stmt() throws RecognitionException {\n PythonParser.with_stmt_return retval = new PythonParser.with_stmt_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token WITH167=null;\n Token COLON170=null;\n PythonParser.test_return test168 = null;\n\n PythonParser.with_var_return with_var169 = null;\n\n PythonParser.suite_return suite171 = null;\n\n\n PythonTree WITH167_tree=null;\n PythonTree COLON170_tree=null;\n\n\n stmt stype = null;\n\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:977:5: ( WITH test[expr_contextType.Load] ( with_var )? COLON suite[false] )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:977:7: WITH test[expr_contextType.Load] ( with_var )? COLON suite[false]\n {\n root_0 = (PythonTree)adaptor.nil();\n\n WITH167=(Token)match(input,WITH,FOLLOW_WITH_in_with_stmt3957); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n WITH167_tree = (PythonTree)adaptor.create(WITH167);\n adaptor.addChild(root_0, WITH167_tree);\n }\n pushFollow(FOLLOW_test_in_with_stmt3959);\n test168=test(expr_contextType.Load);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) adaptor.addChild(root_0, test168.getTree());\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:977:40: ( with_var )?\n int alt73=2;\n int LA73_0 = input.LA(1);\n\n if ( (LA73_0==NAME||LA73_0==AS) ) {\n alt73=1;\n }\n switch (alt73) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:977:41: with_var\n {\n pushFollow(FOLLOW_with_var_in_with_stmt3963);\n with_var169=with_var();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) adaptor.addChild(root_0, with_var169.getTree());\n\n }\n break;\n\n }\n\n COLON170=(Token)match(input,COLON,FOLLOW_COLON_in_with_stmt3967); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n COLON170_tree = (PythonTree)adaptor.create(COLON170);\n adaptor.addChild(root_0, COLON170_tree);\n }\n pushFollow(FOLLOW_suite_in_with_stmt3969);\n suite171=suite(false);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) adaptor.addChild(root_0, suite171.getTree());\n if ( state.backtracking==0 ) {\n\n stype = new With(WITH167, actions.castExpr((test168!=null?((PythonTree)test168.tree):null)), (with_var169!=null?with_var169.etype:null),\n actions.castStmts((suite171!=null?suite171.stypes:null)));\n \n }\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n if ( state.backtracking==0 ) {\n\n retval.tree = stype;\n\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "public Rule incUsing()\n \t{\n \t\treturn enforcedSequence(\n \t\t\t\tKW_USING,\n \t\t\t\toptional(ffi()),\n \t\t\t\toptional(id()), // Not optional, but we want a valid ast for completion if missing\n \t\t\t\tzeroOrMore(sequence(DOT, id())),// not enforced to allow completion\n \t\t\t\toptional(sequence(SP_COLCOL, id())),// not enforced to allow completion\n \t\t\t\toptional(usingAs()),\n \t\t\t\toptional(eos()));\n \t}", "public boolean isWith() {\n return true;\n }", "GeneralClauseContinuation createGeneralClauseContinuation();", "public final void mK_WITH() throws RecognitionException {\n try {\n int _type = K_WITH;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:486:7: ( W I T H )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:486:16: W I T H\n {\n mW(); \n mI(); \n mT(); \n mH(); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Override\r\n\tpublic Node visitBlock(BlockContext ctx) {\n\t\treturn super.visitBlock(ctx);\r\n\t}", "public void testWithAndClosure1() throws Exception {\n createUnit(\"p\", \"D\",\n \"package p\\n\" +\n \"class D {\\n\" +\n \" String foo\\n\" +\n \" D bar\\n\" +\n \"}\");\n String contents =\n \"package p\\n\" +\n \"class E {\\n\" +\n \" D d = new D()\\n\" +\n \" void doSomething() {\\n\" +\n \" d.with {\\n\" +\n \" foo = 'foo'\\n\" +\n \" bar = new D()\\n\" +\n \" bar.foo = 'bar'\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n\n int start = contents.indexOf(\"foo\");\n int end = start + \"foo\".length();\n assertType(contents, start, end, \"java.lang.String\");\n\n start = contents.indexOf(\"bar\", end);\n end = start + \"bar\".length();\n assertType(contents, start, end, \"p.D\");\n\n start = contents.indexOf(\"bar\", end);\n end = start + \"bar\".length();\n assertType(contents, start, end, \"p.D\");\n\n start = contents.indexOf(\"foo\", end);\n end = start + \"foo\".length();\n assertType(contents, start, end, \"java.lang.String\");\n }", "public with(final String beginWith) {\n this.beginWith = beginWith;\n }", "default With with(final With with) {\r\n\t\treturn with.parent(this);\r\n\t}", "@Override\r\n\tpublic void visit(BlockExpression blockExpression) {\n\r\n\t}", "@Override\n public R visit(NamedGraphClause n, A argu) {\n R _ret = null;\n n.nodeToken.accept(this, argu);\n n.sourceSelector.accept(this, argu);\n return _ret;\n }", "private static boolean newExpressionWithKeyword_2(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"newExpressionWithKeyword_2\")) return false;\n newExpressionWithKeyword_2_0(b, l + 1);\n return true;\n }", "StatementBlock createStatementBlock();", "private static void transformUsing(SQLParser.UsingContext ctx, String name1, String name2) {\n\n // Back up old contexts\n Token using = (Token) ctx.getToken(SQLParser.USING, 0).getPayload();\n Token lbr = (Token) ctx.getToken(SQLParser.LBR, 0).getPayload();\n ParseTree ids = ctx.columns();\n Token rbr = (Token) ctx.getToken(SQLParser.RBR, 0).getPayload();\n\n // Remove all blocks\n for (int i = ctx.getChildCount(); i > 0; i--) {\n ctx.removeLastChild();\n }\n\n // Convert \"using\" token to \"on\" token\n CommonToken on = (CommonToken) using;\n on.setText(\"on \");\n\n // Convert ids\n ParserRuleContext parserRuleContext = new ParserRuleContext();\n for (int i = 0; i < ids.getChildCount(); i++) {\n CommonToken newId = (CommonToken) ids.getChild(i).getPayload();\n newId.setText(transformColumns(newId, name1, name2));\n parserRuleContext.addChild(newId);\n }\n\n // And replace it with the new block\n ctx.addChild(on);\n ctx.addChild(lbr);\n ctx.addChild(parserRuleContext);\n ctx.addChild(rbr);\n }", "@Override\r\n\tpublic void visit(InstrumentStatement instrumentStatement) {\n\t\t\r\n\t}", "@Override\n\tpublic void visit(WhenClause arg0) {\n\t\t\n\t}", "default With with(final String name) {\r\n\t\treturn new With(this, name);\r\n\t}", "public final void mT__27() throws RecognitionException {\n try {\n int _type = T__27;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:26:7: ( 'with' )\n // InternalMyDsl.g:26:9: 'with'\n {\n match(\"with\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "private static boolean newExpressionWithKeyword_2_0(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"newExpressionWithKeyword_2_0\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = consumeToken(b, DOT);\n r = r && newExpressionWithKeyword_2_0_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "@Override\n\tpublic void nest(Scope scope) {\n\t\tif (scope instanceof SymbolWithScope) {\n\t\t\tthrow new SymbolTableException(\"Add SymbolWithScope instance \" + scope.getName() + \" via define()\");\n\t\t}\n\t\tnestedScopesNotSymbols.add(scope);\n\t}", "public final void mT__27() throws RecognitionException {\n try {\n int _type = T__27;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalReqLNG.g:26:7: ( 'with' )\n // InternalReqLNG.g:26:9: 'with'\n {\n match(\"with\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "CompoundStatement createCompoundStatement();", "private Stmt compoundStmt() {\n if (lexer.token == Symbol.IF) {\n return iftStmt();\n } else if (lexer.token == Symbol.WHILE) {\n return whileStmt();\n }\n return forStmt();\n }", "public String with() {\n\t\treturn prefix(\"with\").replaceAll(\"ies$\", \"y\").replaceAll(\"s$\", \"\");\n\t}", "@Override\n\tpublic void visit(WhenClause arg0) {\n\n\t}", "public interface Compound extends Clause {}", "private ParseTree parseStatement() {\n return parseSourceElement();\n }", "@Disabled\n @Test void testKeywords() {\n final String[] reserved = {\"AND\", \"ANY\", \"END-EXEC\"};\n final StringBuilder sql = new StringBuilder(\"select \");\n final StringBuilder expected = new StringBuilder(\"SELECT \");\n for (String keyword : keywords(null)) {\n // Skip \"END-EXEC\"; I don't know how a keyword can contain '-'\n if (!Arrays.asList(reserved).contains(keyword)) {\n sql.append(\"1 as \").append(keyword).append(\", \");\n expected.append(\"1 as `\").append(keyword.toUpperCase(Locale.ROOT))\n .append(\"`,\\n\");\n }\n }\n sql.setLength(sql.length() - 2); // remove ', '\n expected.setLength(expected.length() - 2); // remove ',\\n'\n sql.append(\" from t\");\n expected.append(\"\\nFROM t\");\n sql(sql.toString()).ok(expected.toString());\n }", "@Override\n public void visitBlockStmt(BlockStmt stmt) {\n enterBlockStmt(stmt);\n super.visitBlockStmt(stmt);\n leaveBlockStmt(stmt);\n }", "public void testInClosureDeclaringType4() throws Exception {\n String contents = \n \"class Bar {\\n\" +\n \" def method() { }\\n\" +\n \"}\\n\" +\n \"new Bar().method {\\n \" +\n \" this\\n\" +\n \"}\";\n int start = contents.lastIndexOf(\"this\");\n int end = start + \"this\".length();\n assertDeclaringType(contents, start, end, \"Search\", false);\n }", "@Override\n\tpublic void visit(OracleHint arg0) {\n\t\t\n\t}", "@Override\n\tpublic Void visit(ClauseImport clause, Void ctx) {\n\t\treturn null;\n\t}", "public interface CustomConstruct extends AgnosticStatement, QueryCondition {\n}", "private void blockStatement(Scope scope, Vector queue)\r\n {\r\n Modifier modify = new Modifier();\r\n\r\n modify.access = 0;\r\n modify.classes &= Keyword.FINALSY.value | Keyword.STRICTFPSY.value;\r\n modify.fields &= Keyword.FINALSY.value | Keyword.TRANSIENTSY.value | Keyword.VOLATILESY.value;\r\n modify.methods &= Keyword.FINALSY.value | Keyword.SYNCHRONIZEDSY.value | Keyword.NATIVESY.value | Keyword.STRICTFPSY.value;\r\n modify.constants &= Keyword.FINALSY.value;\r\n\r\n Token t;\r\n\r\n if (comment != null && comment.length() > 0)\r\n {\r\n Operation op = new Operation();\r\n op.code = comment + '\\n';\r\n op.operator = Keyword.COMMENTSY;\r\n queue.add(op);\r\n resetComment();\r\n }\r\n\r\n if (isLocalVarDecl(false))\r\n {\r\n localVariableDeclaration(modify, scope, queue);\r\n matchKeyword(Keyword.SEMICOLONSY);\r\n }\r\n else\r\n {\r\n peekReset();\r\n \r\n t = nextToken;\r\n\r\n while(t.kind == Keyword.PUBLICSY || t.kind == Keyword.PROTECTEDSY ||\r\n t.kind == Keyword.PRIVATESY || t.kind == Keyword.ABSTRACTSY ||\r\n t.kind == Keyword.STATICSY || t.kind == Keyword.FINALSY ||\r\n t.kind == Keyword.STRICTFPSY)\r\n t = peek();\r\n \r\n if (t.kind == Keyword.CLASSSY || t.kind == Keyword.INTERFACESY)\r\n classOrInterfaceDeclaration(modify, scope, \"\");\r\n else\r\n statement(modify, scope, Scope.SEQUENCE, null, queue, true);\r\n }\r\n }", "public Rule itBlock()\n \t{\n \t\treturn sequence(BRACKET_L, zeroOrMore(stmt()), BRACKET_R);\n \t}", "@Override\r\n public void visit(HStoreStmt n, Graph argu) {\r\n cur.addUse(Integer.parseInt(n.f1.f1.f0.tokenImage)); // Temp is used\r\n cur.addUse(Integer.parseInt(n.f3.f1.f0.tokenImage)); // Temp is used\r\n argu.addStatement(cur, true);\r\n }", "@Override\n\tpublic Void visit(ClauseModifier clause, Void ctx) {\n\t\treturn null;\n\t}", "public boolean parse()\n {\n withClause = withClause.trim();\n if (!withClause.toLowerCase().substring(0, 5).equals(\"with \")) {\n return false;\n }\n\n int pos = 5;\n int level = 0;\n String currentParameter = \"\";\n String currentTerm = \"\";\n List<String> currentArgumentList = new ArrayList<>();\n boolean inQuote = false;\n parameters = new Hashtable<>();\n while (pos < withClause.length()) {\n // if quoted content, write quotes (since they are part of the argument as well)\n // but remember and do ignore other steering characters until quote is closed\n if (withClause.charAt(pos) == '\\\"') {\n // at this point, earlier we had:\n // currentTerm += withClause.charAt(pos);\n // this would include the quotes in the parameter; so if the parameter is a String,\n // the client of WithClauseParser would have to \"unquote\" it to get the content.\n // Maybe in future we solve this differently, e.g. put without quotes, but have some\n // type property (e.g. not having Strings in the param list, but some Data Object class\n // which is able to differentiate on the types of the content (int, String, etc.)\n // then this would be the place to set the type\n pos++;\n inQuote = !inQuote;\n continue;\n }\n\n if (!inQuote) {\n if (withClause.charAt(pos) == '(') {\n if (level < 1) {\n currentParameter = currentTerm.trim();\n currentArgumentList = new ArrayList<>();\n currentTerm = \"\";\n level++;\n } else\n // no brackets within brackets allowed\n {\n return false;\n }\n } else if (withClause.charAt(pos) == ')') {\n if (level == 1) {\n level--;\n currentArgumentList.add(currentTerm);\n currentTerm = \"\";\n parameters.put(currentParameter, currentArgumentList);\n parametersLowerCase.put(currentParameter.toLowerCase(), currentParameter);\n } else\n // don't the hell know what's going on here...\n {\n return false;\n }\n } else if (withClause.charAt(pos) == ',') {\n if (level == 0) {\n currentTerm = \"\";\n } else {\n currentArgumentList.add(currentTerm.trim());\n currentTerm = \"\";\n }\n } else {\n currentTerm += withClause.charAt(pos);\n }\n } else {\n currentTerm += withClause.charAt(pos);\n }\n\n pos++;\n }\n\n return true;\n }", "@Override\n\tpublic void visitXindent(Xindent p) {\n\n\t}", "@Override\r\n\tpublic void visit(InstrumentBlock instrumentBlock) {\n\t\t\r\n\t}", "public void masterDeclaration();", "public interface StatementContext {\n\n @SuppressWarnings(\"HardCodedStringLiteral\")\n enum Expression {\n /**\n * Please note that this tuple might not always resolve to the domain controller. For some edge cases (e.g. when the\n * current user is assigned to a host scoped role which is scoped to a secondary host), this tuple is resolved to the\n * first host which was read during bootstrap. In any case it is resolved to an existing host.\n * <p>\n * Address templates which use this tuple must be prepared that it does not always resolve to the domain controller.\n */\n DOMAIN_CONTROLLER(\"domain.controller\", HOST), SELECTED_PROFILE(\"selected.profile\", PROFILE), SELECTED_GROUP(\n \"selected.group\", SERVER_GROUP), SELECTED_HOST(\"selected.host\", HOST), SELECTED_SERVER_CONFIG(\n \"selected.server-config\", SERVER_CONFIG), SELECTED_SERVER(\"selected.server\", SERVER);\n\n private final String name;\n private final String resource;\n\n Expression(String name, String resource) {\n this.name = name;\n this.resource = resource;\n }\n\n public String resource() {\n return resource;\n }\n\n /** @return the {@code name} surrounded by \"{\" and \"}\" */\n public String expression() {\n return \"{\" + name + \"}\";\n }\n\n public static Expression from(String name) {\n for (Expression t : Expression.values()) {\n if (t.name.equals(name)) {\n return t;\n }\n }\n return null;\n }\n }\n\n StatementContext NOOP = new StatementContext() {\n\n @Override\n public String resolve(String placeholder, AddressTemplate template) {\n return placeholder;\n }\n\n @Override\n public String[] resolveTuple(String placeholder, AddressTemplate template) {\n return new String[] { placeholder, placeholder };\n }\n\n @Override\n public String domainController() {\n return null;\n }\n\n @Override\n public String selectedProfile() {\n return null;\n }\n\n @Override\n public String selectedServerGroup() {\n return null;\n }\n\n @Override\n public String selectedHost() {\n return null;\n }\n\n @Override\n public String selectedServerConfig() {\n return null;\n }\n\n @Override\n public String selectedServer() {\n return null;\n }\n };\n\n /** Resolves a single value. */\n String resolve(String placeholder, AddressTemplate template);\n\n /** Resolves a tuple. */\n String[] resolveTuple(String placeholder, AddressTemplate template);\n\n /** @return the domain controller */\n String domainController();\n\n /** @return the selected profile */\n String selectedProfile();\n\n /** @return the selected server group */\n String selectedServerGroup();\n\n /** @return the selected host */\n String selectedHost();\n\n /** @return the selected server config */\n String selectedServerConfig();\n\n /** @return the selected server */\n String selectedServer();\n}", "@Override\n\tpublic void visit(KeepExpression arg0) {\n\t\t\n\t}", "private ParseTree parseContinueStatement() {\n SourcePosition start = getTreeStartLocation();\n eat(TokenType.CONTINUE);\n IdentifierToken name = null;\n if (!peekImplicitSemiColon()) {\n name = eatIdOpt();\n }\n eatPossiblyImplicitSemiColon();\n return new ContinueStatementTree(getTreeLocation(start), name);\n }", "Context mo1490b();", "ForStatement(AST ast) {\n super(ast); }", "@Override\n\tpublic void visitXdefindent(Xdefindent p) {\n\n\t}", "@Override\n public void caseAIdentifierExpr(AIdentifierExpr node) {\n String identifier = node.getIdentifier().toString().toLowerCase().replaceAll(\" \",\"\");\n if (currentBlock != null) {\n if (!currentBlock.hasUse()) {\n currentBlock.addUse(identifier);\n } else {\n if (!currentBlock.getUse().contains(identifier)) {\n currentBlock.addUse(identifier);\n }\n }\n }\n\n }", "@Test\n public void findsByKeyword() throws Exception {\n final Base base = new DyBase(\n this.dynamo.region(), new MkSttc().counters().get(\"ttt\")\n );\n final Book book = base.books().add(\n \"@book{best2014, author=\\\"Walter\\\"}\"\n );\n final Quotes quotes = base.quotes();\n quotes.add(\n book, \"never give up and never think about bad things, Bobby\",\n \"99-101, 256-257, 315\"\n );\n MatcherAssert.assertThat(\n quotes.refine(\"bobby\").iterate(),\n Matchers.<Quote>iterableWithSize(1)\n );\n MatcherAssert.assertThat(\n quotes.refine(\"another-something\").iterate(),\n Matchers.<Quote>iterableWithSize(0)\n );\n }", "public aql k()\r\n/* 114: */ {\r\n/* 115:126 */ return aql.b;\r\n/* 116: */ }", "public final void mT__35() throws RecognitionException {\n try {\n int _type = T__35;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:18:7: ( 'with' )\n // InternalDSL.g:18:9: 'with'\n {\n match(\"with\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Override\n\tpublic void visit(CaseLabeledStatement n) { // This is neither a leaf nor a non-leaf in CFG.\n\t\tn.getF3().accept(this);\n\t}", "SkipStatement createSkipStatement();", "public Iterator<String> getKeywords() {\n/* 364 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Override\n public void outBlockStatement(BlockStatement node)\n {\n\n }", "@Override\n\tpublic void visit(OracleHierarchicalExpression arg0) {\n\t\t\n\t}", "CodeContext(Context ctx, Node node) {\n super(ctx, node);\n switch (node.op) {\n case DO:\n case WHILE:\n case FOR:\n case FINALLY:\n case SYNCHRONIZED:\n this.breakLabel = new Label();\n this.contLabel = new Label();\n break;\n case SWITCH:\n case TRY:\n case INLINEMETHOD:\n case INLINENEWINSTANCE:\n this.breakLabel = new Label();\n break;\n default:\n if ((node instanceof Statement) && (((Statement)node).labels != null)) {\n this.breakLabel = new Label();\n }\n }\n }", "private Token scanKeywordOrIdentifier() {\n Token tok;\n Pair<Integer, Integer> pos = new Pair<>(in.line(), in.pos());\n while ((Character.isLetterOrDigit(c) || c == '_') && c != -1) {\n buffer.add(c);\n c = in.read();\n }\n\n String st = buffer.toString();\n TokenType type;\n buffer.flush();\n\n if ((type = Token.KEYWORD_TABLE.get(st)) != null) {\n tok = new Token(st, type, pos);\n } else {\n tok = new Token(st, TokenType.IDENTIFIER, pos);\n }\n return tok;\n }", "interface WithLevel {\n /**\n * Specifies the level property: The level of the lock. Possible values are: NotSpecified, CanNotDelete,\n * ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete.\n * ReadOnly means authorized users can only read from a resource, but they can't modify or delete it..\n *\n * @param level The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly.\n * CanNotDelete means authorized users are able to read and modify the resources, but not delete.\n * ReadOnly means authorized users can only read from a resource, but they can't modify or delete it.\n * @return the next definition stage.\n */\n WithCreate withLevel(LockLevel level);\n }", "void with(final Gizmo g) {\n\t}", "private Operation blockEnd(Scope scope)\r\n {\r\n\tOperation root = new Operation();\r\n\t\r\n\troot.operator = Keyword.BLOCKENDSY;\r\n\troot.code = (String)scope.label.get(0);\r\n\r\n return root;\r\n }", "final public Token IdentifierOrReserved() throws ParseException {\n /*@bgen(jjtree) IdentifierOrReserved */\n SimpleNode jjtn000 = new SimpleNode(JJTIDENTIFIERORRESERVED);\n boolean jjtc000 = true;\n jjtree.openNodeScope(jjtn000);Token t1;\n log.trace(\"Entering IdentifierOrReserved\");\n try {\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\n case DEFINE:\n t1 = jj_consume_token(DEFINE);\n break;\n case LOAD:\n t1 = jj_consume_token(LOAD);\n break;\n case FILTER:\n t1 = jj_consume_token(FILTER);\n break;\n case FOREACH:\n t1 = jj_consume_token(FOREACH);\n break;\n case MATCHES:\n t1 = jj_consume_token(MATCHES);\n break;\n case ORDER:\n t1 = jj_consume_token(ORDER);\n break;\n case ARRANGE:\n t1 = jj_consume_token(ARRANGE);\n break;\n case DISTINCT:\n t1 = jj_consume_token(DISTINCT);\n break;\n case COGROUP:\n t1 = jj_consume_token(COGROUP);\n break;\n case JOIN:\n t1 = jj_consume_token(JOIN);\n break;\n case CROSS:\n t1 = jj_consume_token(CROSS);\n break;\n case UNION:\n t1 = jj_consume_token(UNION);\n break;\n case SPLIT:\n t1 = jj_consume_token(SPLIT);\n break;\n case INTO:\n t1 = jj_consume_token(INTO);\n break;\n case IF:\n t1 = jj_consume_token(IF);\n break;\n case ALL:\n t1 = jj_consume_token(ALL);\n break;\n case ANY:\n t1 = jj_consume_token(ANY);\n break;\n case AS:\n t1 = jj_consume_token(AS);\n break;\n case BY:\n t1 = jj_consume_token(BY);\n break;\n case USING:\n t1 = jj_consume_token(USING);\n break;\n case INNER:\n t1 = jj_consume_token(INNER);\n break;\n case OUTER:\n t1 = jj_consume_token(OUTER);\n break;\n case PARALLEL:\n t1 = jj_consume_token(PARALLEL);\n break;\n case GROUP:\n t1 = jj_consume_token(GROUP);\n break;\n case AND:\n t1 = jj_consume_token(AND);\n break;\n case OR:\n t1 = jj_consume_token(OR);\n break;\n case NOT:\n t1 = jj_consume_token(NOT);\n break;\n case GENERATE:\n t1 = jj_consume_token(GENERATE);\n break;\n case FLATTEN:\n t1 = jj_consume_token(FLATTEN);\n break;\n case EVAL:\n t1 = jj_consume_token(EVAL);\n break;\n case ASC:\n t1 = jj_consume_token(ASC);\n break;\n case DESC:\n t1 = jj_consume_token(DESC);\n break;\n case INT:\n t1 = jj_consume_token(INT);\n break;\n case LONG:\n t1 = jj_consume_token(LONG);\n break;\n case FLOAT:\n t1 = jj_consume_token(FLOAT);\n break;\n case DOUBLE:\n t1 = jj_consume_token(DOUBLE);\n break;\n case CHARARRAY:\n t1 = jj_consume_token(CHARARRAY);\n break;\n case BYTEARRAY:\n t1 = jj_consume_token(BYTEARRAY);\n break;\n case BAG:\n t1 = jj_consume_token(BAG);\n break;\n case TUPLE:\n t1 = jj_consume_token(TUPLE);\n break;\n case MAP:\n t1 = jj_consume_token(MAP);\n break;\n case IS:\n t1 = jj_consume_token(IS);\n break;\n case NULL:\n t1 = jj_consume_token(NULL);\n break;\n case STREAM:\n t1 = jj_consume_token(STREAM);\n break;\n case THROUGH:\n t1 = jj_consume_token(THROUGH);\n break;\n case STORE:\n t1 = jj_consume_token(STORE);\n break;\n case SHIP:\n t1 = jj_consume_token(SHIP);\n break;\n case CACHE:\n t1 = jj_consume_token(CACHE);\n break;\n case INPUT:\n t1 = jj_consume_token(INPUT);\n break;\n case OUTPUT:\n t1 = jj_consume_token(OUTPUT);\n break;\n case ERROR:\n t1 = jj_consume_token(ERROR);\n break;\n case STDIN:\n t1 = jj_consume_token(STDIN);\n break;\n case STDOUT:\n t1 = jj_consume_token(STDOUT);\n break;\n case LIMIT:\n t1 = jj_consume_token(LIMIT);\n break;\n case SAMPLE:\n t1 = jj_consume_token(SAMPLE);\n break;\n case IDENTIFIER:\n t1 = jj_consume_token(IDENTIFIER);\n break;\n default:\n jj_la1[7] = jj_gen;\n jj_consume_token(-1);\n throw new ParseException();\n }\n jjtree.closeNodeScope(jjtn000, true);\n jjtc000 = false;\n {if (true) return t1;}\n } finally {\n if (jjtc000) {\n jjtree.closeNodeScope(jjtn000, true);\n }\n }\n throw new Error(\"Missing return statement in function\");\n }", "@Test\n public void noSpacesBetweenKeywordsTest() {\n tester.yields(\"LaLaLaLaLaaaLi\", lala.EXPRESSION);\n }", "@Override\n\tpublic void visit(Parenthesis arg0) {\n\t\t\n\t}", "private void clearPreviouslyVisitedAfterWith(With with) {\n\t\tSet<IdentifiableElement> retain = new HashSet<>();\n\t\tSet<IdentifiableElement> visitedNamed = dequeOfVisitedNamed.peek();\n\t\tif (visitedNamed == null) {\n\t\t\treturn;\n\t\t}\n\t\twith.accept(segment -> {\n\t\t\tif (segment instanceof SymbolicName symbolicName) {\n\t\t\t\tvisitedNamed.stream()\n\t\t\t\t\t.filter(element -> {\n\t\t\t\t\t\tif (element instanceof Named named) {\n\t\t\t\t\t\t\treturn named.getRequiredSymbolicName().equals(segment);\n\t\t\t\t\t\t} else if (element instanceof Aliased aliased) {\n\t\t\t\t\t\t\treturn aliased.getAlias().equals((symbolicName).getValue());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn element.equals(segment);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.forEach(retain::add);\n\t\t\t}\n\t\t});\n\n\t\tretain.addAll(Optional.ofNullable(implicitScope.peek()).orElseGet(Set::of));\n\t\tvisitedNamed.retainAll(retain);\n\t}", "public interface AdditionalOperations extends Statements {\n}", "@Override\n\tpublic Void visit(ClauseType clause, Void ctx) {\n\t\treturn null;\n\t}", "@Override\n public void close(Statement st) {\n super.close(st);\n }", "@Test\n public void testPartlyQuotedGroup() throws Exception {\n String sql = \"SELECT a from db.\\\"g\\\" where a = 5\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"a\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, \"db.g\");\n\n Node criteriaNode = verify(queryNode, Query.CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n verifyElementSymbol(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, \"a\");\n verifyConstant(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, 5);\n \n verifySql(\"SELECT a FROM db.g WHERE a = 5\", fileNode);\n }", "@Override\n public Void visit(IVariableDeclaration stmt, Set<String> overallContext) {\n overallContext.add(stmt.getType().getName());\n return null;\n }", "public ContextNodeStatement getStatement();", "public void testInClosureDeclaringType2() throws Exception {\n String contents = \n \"class Baz {\\n\" +\n \" def method() { }\\n\" +\n \"}\\n\" +\n \"class Bar extends Baz {\\n\" +\n \"}\\n\" +\n \"new Bar().method {\\n \" +\n \" other\\n\" +\n \"}\";\n int start = contents.lastIndexOf(\"other\");\n int end = start + \"other\".length();\n assertDeclaringType(contents, start, end, \"Search\", false, true);\n }", "public void testInClosureDeclaringType3() throws Exception {\n String contents = \n \"class Baz {\\n\" +\n \" def method() { }\\n\" +\n \"}\\n\" +\n \"class Bar extends Baz {\\n\" +\n \" def sumthin() {\\n\" +\n \" new Bar().method {\\n \" +\n \" other\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n int start = contents.lastIndexOf(\"other\");\n int end = start + \"other\".length();\n assertDeclaringType(contents, start, end, \"Bar\", false, true);\n }", "interface WithKind {\n /**\n * Specifies the kind property: The Kind of the resource..\n *\n * @param kind The Kind of the resource.\n * @return the next definition stage.\n */\n WithCreate withKind(String kind);\n }", "private void initClauses() {\n if (!mIsInitialized) {\n if (ConnectionUtil.getDBProductID() == ConnectionUtil.DB_ORACLE ||\n ConnectionUtil.getDBProductID() == ConnectionUtil.DB_MYSQL) {\n mForUpdateClause = \" FOR UPDATE \";\n } else if (ConnectionUtil.getDBProductID() == ConnectionUtil.DB_SQLSERVER) {\n mWithClause = \" WITH (ROWLOCK, UPDLOCK) \";\n }\n mIsInitialized = true;\n }\n\n }", "public Snippet visit(ContinueStatement n, Snippet argu) {\n\t\t Snippet _ret = new Snippet(\"\", \"\", null, false);\n\t n.nodeToken.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t _ret.returnTemp = \"continue;\";\n\t\t\ttPlasmaCode+=generateTabs(blockDepth)+_ret.returnTemp+\"\\n\";\n\t return _ret;\n\t }", "private void applyImmediateDirective(final GeneratingKeyword kw) throws IOException {\n\t\tPrinter.printTokens(tokenizer);\n\t\ttokenizer.pushTokens(new StringReader(kw.generate(new PythonAdapter())));\n\t\tPrinter.printTokens(tokenizer);\n\t}", "protected void enterBlockStmt(BlockStmt blockStmt) {\n enclosingBlocks.addFirst(blockStmt);\n if (blockStmt.introducesNewScope()) {\n pushScope();\n }\n }", "private void nextKwId() {\n\t\tint old=pos;\n\t\tmany(letters);\n\t\tmany(legits);\n\t\tString lexeme=program.substring(old,pos);\n\t\ttoken=new Token((keywords.contains(lexeme) ? lexeme : \"id\"),lexeme);\n }", "abstract protected void passHitQueryContextToClauses(HitQueryContext context);", "private String importDeclaration()\r\n {\r\n String handle;\r\n\r\n matchKeyword(Keyword.IMPORTSY);\r\n handle = nextToken.string;\r\n matchKeyword(Keyword.IDENTSY);\r\n handle = qualifiedImport(handle);\r\n matchKeyword(Keyword.SEMICOLONSY);\r\n\r\n return handle;\r\n }", "@Override\n\tpublic void enterDslStatement(AAIDslParser.DslStatementContext ctx) {\n\t\tif (isUnionBeg) {\n\t\t\tisUnionBeg = false;\n\t\t\tisUnionTraversal = true;\n\n\t\t} else if (unionMembers > 0) {\n\t\t\tunionMembers--;\n\t\t\tquery += \",builder.newInstance()\";\n\t\t\tisUnionTraversal = true;\n\t\t}\n\n\t}", "@Override\n public void addStatement(IRBodyBuilder builder, TranslationContext context,\n FunctionCall call) {\n \n }", "static void EnterScope(){\r\n\t\tcurLevel++;\r\n\t\tScope scope = new Scope(curLevel);\r\n\t\t//scope.nextAdr = 3;\r\n\t\ttopScope.ant = scope;\r\n\t\tscope.sig = topScope; \r\n\t\ttopScope = scope;\r\n }", "public final void mT__35() throws RecognitionException {\n try {\n int _type = T__35;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalMyDsl.g:34:7: ( 'with' )\n // InternalMyDsl.g:34:9: 'with'\n {\n match(\"with\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public hk a(String s, a a1)\n {\n class c {}\n\n c c1 = new c(null);\n /* block-local class not found */\n class b {}\n\n b.a(new b(s, a1, c1));\n return c1;\n }", "interface WithTags {\n /**\n * Specifies the tags property: Specifies the tags that will be assigned to the job..\n *\n * @param tags Specifies the tags that will be assigned to the job.\n * @return the next definition stage.\n */\n WithCreate withTags(Object tags);\n }", "String getCTE();", "String getCTE();", "String getCTE();", "String getCTE();", "@Override\n protected void translate(int n, LanguageBuilder sb) {\n\t sb.indent(n)\n\t \t.append(Keyword.FOR).space().append('(').append(_condition).append(')').beginBlock();\n\t \n\t childrenTranslate(n + PrintStyle.INDENT, sb);\n\t \n\t sb.indent(n).endBlock();\n\t}", "public abstract String\n openScope\n (\n boolean first, \n int level \n );", "private void catchClause(String label, Scope scope, Vector queue)\r\n {\r\n matchKeyword(Keyword.CATCHSY);\r\n matchKeyword(Keyword.LPARSY);\r\n\r\n Parameter parameter = formalParameter();\r\n\r\n Operation root = new Operation();\r\n root.code = \"DUP \\\" \" + parameter.type.ident.string.substring(parameter.type.ident.string.lastIndexOf('.') + 1) + \" \\\" INSTANCEOF\\n IF\\n\";\r\n queue.add(root);\r\n\r\n matchKeyword(Keyword.RPARSY);\r\n\r\n VariableType a = new VariableType(parameter.type, 0);\r\n a.name = parameter.name;\r\n\r\n Vector v = new Vector();\r\n v.add(\"\" + Operation.newLabel());\r\n block(null, a, scope, v, Scope.CATCH, null, queue);\r\n\r\n root = new Operation();\r\n root.code = \"DUP \" + label + \" BRANCH\\nENDIF\\n\";\r\n queue.add(root);\r\n }", "boolean getOwnStatement();", "@Override\n protected Statement withBeforeClasses(final Statement originalStatement) {\n final Statement onlyBefores = super.withBeforeClasses(new EmptyStatement());\n return new Statement() {\n @Override\n public void evaluate() throws Throwable {\n adaptor.beforeClass(\n Arquillian.this.getTestClass().getJavaClass(),\n new StatementLifecycleExecutor(onlyBefores));\n originalStatement.evaluate();\n }\n };\n }", "private void RecordStoreLockFactory() {\n }" ]
[ "0.634191", "0.5309057", "0.5291128", "0.5236089", "0.52353394", "0.5211241", "0.52087605", "0.5180937", "0.5144532", "0.5136329", "0.5131977", "0.50836205", "0.5082199", "0.50676763", "0.5000713", "0.4976135", "0.49729675", "0.49356726", "0.4934884", "0.4927079", "0.48920164", "0.48848", "0.48720607", "0.48252246", "0.48189542", "0.48177648", "0.4814305", "0.47985741", "0.47867614", "0.4780124", "0.47789374", "0.47656587", "0.47480738", "0.47477457", "0.47449127", "0.47342822", "0.47328097", "0.47148618", "0.47134754", "0.47129112", "0.47116625", "0.47111782", "0.4667922", "0.46646422", "0.4663429", "0.46618363", "0.46538094", "0.46513245", "0.4637239", "0.46326774", "0.4629914", "0.46255085", "0.46238095", "0.4618851", "0.46151882", "0.4608341", "0.45963916", "0.45904955", "0.45736971", "0.45714444", "0.45641792", "0.45636332", "0.45623055", "0.45443776", "0.453208", "0.45232418", "0.45190686", "0.45181483", "0.45175293", "0.45133257", "0.4512657", "0.4502265", "0.4501239", "0.4496544", "0.44959894", "0.4491021", "0.4477658", "0.44770905", "0.44760895", "0.44706425", "0.44697562", "0.44685656", "0.4467973", "0.44650602", "0.44639987", "0.4456853", "0.4454014", "0.44539714", "0.44523203", "0.44505474", "0.44488838", "0.44488838", "0.44488838", "0.44488838", "0.44463772", "0.44423983", "0.44374183", "0.44354835", "0.4434378", "0.44335684" ]
0.6408788
0
Continue query with WITH
default With with(final String name) { return new With(this, name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void applyToQuery(DatabaseQuery theQuery, GenerationContext context);", "public interface BeforeWith<T extends BeforeWith<T>> extends QueryPart, QueryPartSQL<T>, QueryPartLinked<T> {\r\n\r\n\t/**\r\n\t * Continue query with WITH\r\n\t *\r\n\t * @param name The name of the with-block\r\n\t * @return The new WITH statement\r\n\t */\r\n\tdefault With with(final String name) {\r\n\t\treturn new With(this, name);\r\n\t}\r\n\r\n\t/**\r\n\t * Accept an existing WITH statement as predecessor\r\n\t *\r\n\t * @param with The existing WITH statement\r\n\t * @return Returns the passed WITH statement\r\n\t */\r\n\tdefault With with(final With with) {\r\n\t\treturn with.parent(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Use plain SQL to form this WITH statement\r\n\t *\r\n\t * @param sql The sql string\r\n\t * @return The new WITH statement\r\n\t */\r\n\tdefault With withSQL(final String sql) {\r\n\t\treturn with((String) null).sql(sql);\r\n\t}\r\n\r\n}", "@Test\n public void testGroupedItemsAreStillGroupedWhenBatchSplitResults() {\n IdentityFieldProvider<HasId> hasIdIdentifierProvider =\n new IdentityFieldProvider<HasId>() {\n @Override\n protected Object getIdentifier(HasId resultProxy) {\n return resultProxy.getId();\n }\n };\n TestDataCreator creator = new TestDataCreator(getSessionFactory());\n Town town = creator.createTestTown();\n Person johny = creator.createTestPerson(town, \"Johny\");\n Person angie = creator.createTestPerson(town, \"Angie\");\n Person josh = creator.createTestPerson(town, \"Josh\");\n Person alberta = creator.createTestPerson(town, \"Alberta\");\n\n Person becky = creator.createTestPerson(town, \"Becky\");\n Person fred = creator.createTestPerson(town, \"Fred\");\n Set<String> childNames = new HashSet<>();\n childNames.add(becky.getName());\n childNames.add(fred.getName());\n\n // johny has 2 kids, angie and alberta have 1, josh has none\n creator.addChildRelation(johny, becky);\n creator.addChildRelation(angie, becky);\n creator.addChildRelation(johny, fred);\n creator.addChildRelation(alberta, fred);\n\n Town townProxy = query.from(Town.class);\n Person inhabitant = query.join(townProxy.getInhabitants());\n Relation child = query.join(inhabitant.getChildRelations(), JoinType.Left);\n\n query.where(child.getChild().getId()).isNull().or(child.getChild().getName()).in(childNames, 1);\n\n TownDto selectTown = query.select(TownDto.class, hasIdIdentifierProvider);\n PersonDto selectParent = query.select(selectTown.getInhabitants(),\n PersonDto.class, hasIdIdentifierProvider);\n PersonDto selectChild = query.select(selectParent.getChildren(),\n PersonDto.class, hasIdIdentifierProvider);\n\n selectTown.setId(townProxy.getId());\n selectParent.setId(inhabitant.getId());\n selectParent.setThePersonsName(inhabitant.getName());\n selectChild.setId(child.getChild().getId());\n selectChild.setThePersonsName(child.getChild().getName());\n\n validate(\"select hobj1.id as id, hobj2.id as g1__id, hobj2.name as g1__thePersonsName, \"\n + \"hobj4.id as g2__id, hobj4.name as g2__thePersonsName \"\n + \"from Town hobj1 \"\n + \"join hobj1.inhabitants hobj2 \"\n + \"left join hobj2.childRelations hobj3 \"\n + \"left join hobj3.child hobj4 \"\n + \"where hobj4.id is null or hobj4.name in (:np1)\", childNames);\n\n @SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n List<TownDto> results = (List) doQueryResult;\n assertEquals(1, results.size());\n TownDto townResult = results.get(0);\n assertEquals(6, townResult.getInhabitants().size());\n\n Map<Long, Set<Long>> resultIds = new HashMap<>();\n for(PersonDto dto: townResult.getInhabitants()) {\n Set<Long> childIds = new HashSet<>();\n if (dto.getChildren() != null) {\n for(PersonDto dtoChild: dto.getChildren()) {\n childIds.add(dtoChild.getId());\n }\n }\n resultIds.put(dto.getId(), childIds);\n }\n assertEquals(toIds(becky, fred), resultIds.get(johny.getId()));\n assertEquals(toIds(becky), resultIds.get(angie.getId()));\n assertEquals(emptySet(), resultIds.get(josh.getId()));\n assertEquals(toIds(fred), resultIds.get(alberta.getId()));\n assertEquals(emptySet(), resultIds.get(becky.getId()));\n assertEquals(emptySet(), resultIds.get(fred.getId()));\n }", "public void addResult(CloseableIteration<T, QueryEvaluationException> res);", "private ParseTree parseWithStatement() {\n SourcePosition start = getTreeStartLocation();\n eat(TokenType.WITH);\n eat(TokenType.OPEN_PAREN);\n ParseTree expression = parseExpression();\n eat(TokenType.CLOSE_PAREN);\n ParseTree body = parseStatement();\n return new WithStatementTree(getTreeLocation(start), expression, body);\n }", "@Test\n public void testSelectAll() throws Exception {\n String sql = \"SELECT ALL a FROM g\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"a\");\n verifyProperty(selectNode, Select.DISTINCT_PROP_NAME, false);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"g\");\n\n verifySql(\"SELECT a FROM g\", fileNode);\n }", "@Test\n public void testBatchedInQuery() {\n TestDataCreator creator = new TestDataCreator(getSessionFactory());\n Town town = creator.createTestTown();\n\n int n = 10;\n List<Long> ids = new ArrayList<>(n);\n for (long i=0; i < n; i++) {\n Person savedPerson = creator.createTestPerson(town, \"P\" + i);\n ids.add(savedPerson.getId());\n }\n for (long i=0; i < n; i++) {\n creator.createTestPerson(town, \"P\" + i);\n }\n\n Person person = query.from(Person.class);\n query.where(person.getId()).in(ids, 2);\n\n validate(\"from Person hobj1 where hobj1.id in (:np1)\", ids);\n assertEquals(n, doQueryResult.size());\n }", "public Iterable<Todo> select(TodoQuery t){\n\t return (select(t.getStatement()));\n\t}", "@Override\n protected void load() {\n //recordId can be null when in batchMode\n if (this.recordId != null && this.properties.isEmpty()) {\n this.sqlgGraph.tx().readWrite();\n if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().getBatchManager().isStreaming()) {\n throw new IllegalStateException(\"streaming is in progress, first flush or commit before querying.\");\n }\n\n //Generate the columns to prevent 'ERROR: cached plan must not change result type\" error'\n //This happens when the schema changes after the statement is prepared.\n @SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n EdgeLabel edgeLabel = this.sqlgGraph.getTopology().getSchema(this.schema).orElseThrow(() -> new IllegalStateException(String.format(\"Schema %s not found\", this.schema))).getEdgeLabel(this.table).orElseThrow(() -> new IllegalStateException(String.format(\"EdgeLabel %s not found\", this.table)));\n StringBuilder sql = new StringBuilder(\"SELECT\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n appendProperties(edgeLabel, sql);\n List<VertexLabel> outForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getOutVertexLabels()) {\n outForeignKeys.add(vertexLabel);\n sql.append(\", \");\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.OUT_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.OUT_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.OUT_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n List<VertexLabel> inForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getInVertexLabels()) {\n sql.append(\", \");\n inForeignKeys.add(vertexLabel);\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.IN_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.IN_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.IN_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n sql.append(\"\\nFROM\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.schema));\n sql.append(\".\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(EDGE_PREFIX + this.table));\n sql.append(\" WHERE \");\n //noinspection Duplicates\n if (edgeLabel.hasIDPrimaryKey()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n sql.append(\" = ?\");\n } else {\n int count = 1;\n for (String identifier : edgeLabel.getIdentifiers()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(identifier));\n sql.append(\" = ?\");\n if (count++ < edgeLabel.getIdentifiers().size()) {\n sql.append(\" AND \");\n }\n\n }\n }\n if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {\n sql.append(\";\");\n }\n Connection conn = this.sqlgGraph.tx().getConnection();\n if (logger.isDebugEnabled()) {\n logger.debug(sql.toString());\n }\n try (PreparedStatement preparedStatement = conn.prepareStatement(sql.toString())) {\n if (edgeLabel.hasIDPrimaryKey()) {\n preparedStatement.setLong(1, this.recordId.sequenceId());\n } else {\n int count = 1;\n for (Comparable identifierValue : this.recordId.getIdentifiers()) {\n preparedStatement.setObject(count++, identifierValue);\n }\n }\n ResultSet resultSet = preparedStatement.executeQuery();\n if (resultSet.next()) {\n loadResultSet(resultSet, inForeignKeys, outForeignKeys);\n }\n } catch (SQLException e) {\n throw new RuntimeException(e);\n }\n }\n }", "@Test\n\tpublic void testPassThroughHandler_MultiSourceQuery() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\n\t\ttry (RepositoryConnection conn = fedxRule.getRepository().getConnection()) {\n\n\t\t\t// SELECT query\n\t\t\tTupleQuery tq = conn\n\t\t\t\t\t.prepareTupleQuery(\n\t\t\t\t\t\t\t\"SELECT ?person ?interest WHERE { ?person <http://xmlns.com/foaf/0.1/name> ?name ; <http://xmlns.com/foaf/0.1/interest> ?interest }\");\n\t\t\ttq.setBinding(\"name\", l(\"Alan\"));\n\n\t\t\tAtomicBoolean started = new AtomicBoolean(false);\n\t\t\tAtomicInteger numberOfResults = new AtomicInteger(0);\n\n\t\t\ttq.evaluate(new AbstractTupleQueryResultHandler() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void startQueryResult(List<String> bindingNames) throws TupleQueryResultHandlerException {\n\t\t\t\t\tif (started.get()) {\n\t\t\t\t\t\tthrow new IllegalStateException(\"Must not start query result twice.\");\n\t\t\t\t\t}\n\t\t\t\t\tstarted.set(true);\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Expected trace looks like this java.lang.Exception at\n\t\t\t\t\t * org.eclipse.rdf4j.federated.BasicTests$1.startQueryResult(BasicTests.java:276) at\n\t\t\t\t\t * org.eclipse.rdf4j.query.QueryResults.report(QueryResults.java:263) at\n\t\t\t\t\t * org.eclipse.rdf4j.federated.structures.FedXTupleQuery.evaluate(FedXTupleQuery.java:69)\n\t\t\t\t\t */\n\t\t\t\t\tAssertions.assertEquals(QueryResults.class.getName(),\n\t\t\t\t\t\t\tnew Exception().getStackTrace()[1].getClassName());\n\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void handleSolution(BindingSet bs) throws TupleQueryResultHandlerException {\n\t\t\t\t\tAssertions.assertEquals(bs.getValue(\"person\"), iri(\"http://example.org/\", \"a\"));\n\t\t\t\t\tAssertions.assertEquals(bs.getValue(\"interest\").stringValue(), \"SPARQL 1.1 Basic Federated Query\");\n\t\t\t\t\tnumberOfResults.incrementAndGet();\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tAssertions.assertTrue(started.get());\n\t\t\tAssertions.assertEquals(1, numberOfResults.get());\n\t\t}\n\t}", "public void prepareSelectAllRows() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareSelectAllRows();\n }", "@Test\r\n\tpublic void testGetStatementsInMultipleContexts()\r\n\t\tthrows Exception\r\n\t{\r\n\t\tURI ur = vf.createURI(\"http://abcd\");\r\n\t\t\r\n\t\t\r\n\t\tCloseableIteration<? extends Statement, RepositoryException> iter1 = testAdminCon.getStatements(null, null, null, false, null);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter1.hasNext()) {\r\n\t\t\t\titer1.next();\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be 0 statements\", 0 , count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer1.close();\r\n\t\t\titer1 = null;\r\n\t\t}\r\n\t\t\r\n\t\ttestAdminCon.begin();\r\n\t\ttestAdminCon.add(micah, lname, micahlname, dirgraph1);\r\n\t\ttestAdminCon.add(micah, fname, micahfname, dirgraph1);\r\n\t\ttestAdminCon.add(micah, homeTel, micahhomeTel, dirgraph1);\r\n\t\ttestAdminCon.add(dirgraph1, ur, vf.createLiteral(\"test\"));\r\n\t\ttestAdminCon.commit();\r\n\r\n\t\t// get statements with either no context or dirgraph1\r\n\t\tCloseableIteration<? extends Statement, RepositoryException> iter = testAdminCon.getStatements(null, null,\r\n\t\t\t\tnull, false, null , dirgraph1);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(), anyOf(is(nullValue(Resource.class)), is(equalTo((Resource)dirgraph1))));\r\n\t\t\t}\r\n\r\n\t\t\tassertEquals(\"there should be four statements\", 4, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\t\t\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, dirgraph1, dirgraph);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph1)));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be three statements\", 3 , count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\t\t\r\n\r\n\t\t// get all statements with unknownContext or context2.\r\n\t\tURI unknownContext = testAdminCon.getValueFactory().createURI(\"http://unknownContext\");\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, unknownContext, dirgraph1);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tcount++;\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph1)));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be three statements\", 3, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\r\n\t\t// add statements to dirgraph\r\n\t\ttry{\r\n\t\t\ttestAdminCon.begin();\r\n\t\t\ttestAdminCon.add(john, fname, johnfname, dirgraph);\r\n\t\t\ttestAdminCon.add(john, lname, johnlname, dirgraph);\r\n\t\t\ttestAdminCon.add(john, homeTel, johnhomeTel, dirgraph);\r\n\t\t\ttestAdminCon.commit();\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif(testAdminCon.isActive())\r\n\t\t\t\ttestAdminCon.rollback();\r\n\t\t}\r\n\t\t\t\r\n\t\t// get statements with either no context or dirgraph\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, null, dirgraph);\r\n\t\ttry {\r\n\t\t\tassertThat(iter, is(notNullValue()));\r\n\t\t\tassertThat(iter.hasNext(), is(equalTo(true)));\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(), anyOf(is(nullValue(Resource.class)), is(equalTo((Resource)dirgraph)) ));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be four statements\", 4, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\t\t\r\n\t\t// get all statements with dirgraph or dirgraph1\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, null, dirgraph, dirgraph1);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(),\r\n\t\t\t\t\t\tanyOf(is(nullValue(Resource.class)),is(equalTo((Resource)dirgraph)), is(equalTo((Resource)dirgraph1))));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be 7 statements\", 7, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\r\n\t\t// get all statements with dirgraph or dirgraph1\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, dirgraph, dirgraph1);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(),\r\n\t\t\t\t\t\tanyOf(is(equalTo((Resource)dirgraph)), is(equalTo((Resource)dirgraph1))));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be 6 statements\", 6, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\t\t\r\n}", "abstract protected Entity selectNextEntity();", "@Override\n\tpublic final Iterable<R> execute() {\n\t\t\n\t\treturn new Iterable<R>() {\n\t\t\t\n\t\t\t@Override \n\t\t\tpublic Iterator<R> iterator() {\n\t\t\t\t\n\t\t\t\treturn AbstractMultiQuery.this.iterator();\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t\n\t}", "public void prepareExecuteSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteSelect();\n }", "@Test\n public void testQueryWithAllSegmentsAreEmpty() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\" [20120101000000_20120102000000]\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\" [20120102000000_20120103000000]\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\" [20120103000000_20120104000000]\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\" [20120104000000_20120105000000]\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\" [20120105000000_20120106000000]\n\n EnhancedUnitOfWork.doInTransactionWithCheckAndRetry(() -> {\n NDataflowManager dfMgr = NDataflowManager.getInstance(getTestConfig(), project);\n NDataflow dataflow = dfMgr.getDataflow(dfId);\n Segments<NDataSegment> segments = dataflow.getSegments();\n // update\n NDataflowUpdate dataflowUpdate = new NDataflowUpdate(dfId);\n dataflowUpdate.setToRemoveSegs(segments.toArray(new NDataSegment[0]));\n dfMgr.updateDataflow(dataflowUpdate);\n return null;\n }, project);\n\n val sql = \"select cal_dt, sum(price), count(*) from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" //\n + \"group by cal_dt\\n\";\n\n MetadataTestUtils.updateProjectConfig(project, \"kylin.query.index-match-rules\", QueryRouter.USE_VACANT_INDEXES);\n try (QueryContext queryContext = QueryContext.current()) {\n OLAPContext olapContext = OlapContextTestUtil.getOlapContexts(project, sql).get(0);\n StorageContext storageContext = olapContext.storageContext;\n Assert.assertEquals(-1L, storageContext.getLayoutId().longValue());\n Assert.assertFalse(queryContext.getQueryTagInfo().isVacant());\n }\n }", "public abstract Statement queryToRetrieveData();", "public void prepareCursorSelectAllRows() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareCursorSelectAllRows();\n }", "@Test\n public void test3() throws Exception {\n String query = \"A =LOAD 'file.txt' AS (a:(u,v), b, c);\" +\n \"B = FOREACH A GENERATE $0, b;\" +\n \"C = FILTER B BY 8 > 5;\" +\n \"STORE C INTO 'empty';\"; \n LogicalPlan newLogicalPlan = buildPlan( query );\n\n Operator load = newLogicalPlan.getSources().get( 0 );\n Assert.assertTrue( load instanceof LOLoad );\n Operator filter = newLogicalPlan.getSuccessors( load ).get( 0 );\n Assert.assertTrue( filter instanceof LOFilter );\n Operator fe1 = newLogicalPlan.getSuccessors( filter ).get( 0 );\n Assert.assertTrue( fe1 instanceof LOForEach );\n Operator fe2 = newLogicalPlan.getSuccessors( fe1 ).get( 0 );\n Assert.assertTrue( fe2 instanceof LOForEach );\n }", "@Test\n public void test2() throws Exception {\n String query = \"A =LOAD 'file.txt' AS (a:(u,v), b, c);\" +\n \"B = FOREACH A GENERATE $0, b;\" +\n \"C = FILTER B BY \" + SIZE.class.getName() +\"(TOTUPLE(*)) > 5;\" +\n \"STORE C INTO 'empty';\"; \n LogicalPlan newLogicalPlan = buildPlan( query );\n\n Operator load = newLogicalPlan.getSources().get( 0 );\n Assert.assertTrue( load instanceof LOLoad );\n Operator fe1 = newLogicalPlan.getSuccessors( load ).get( 0 );\n Assert.assertTrue( fe1 instanceof LOForEach );\n Operator filter = newLogicalPlan.getSuccessors( fe1 ).get( 0 );\n Assert.assertTrue( filter instanceof LOFilter );\n Operator fe2 = newLogicalPlan.getSuccessors( filter ).get( 0 );\n Assert.assertTrue( fe2 instanceof LOForEach );\n }", "@Test\n public void testQueryMore1() throws Exception {\n testQueryMore(true, true);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate CompoundQuery handleQuery() throws Exception{\n\t\tif (this.resultant != null && this.resultant.getResultsContainer() != null){\n\t\t\t//compoundQuery = (CompoundQuery) resultant.getAssociatedQuery();\n\t\t\tViewable view = newCompoundQuery.getAssociatedView();\n\t\t\tResultsContainer resultsContainer = this.resultant.getResultsContainer();\n\t\t\tsampleCrit = null;\n\t Collection sampleIDs = new ArrayList(); \n\t\t\t//Get the samples from the resultset object\n\t\t\tif(resultsContainer!= null){\n\t\t\t\tCollection samples = null;\n\t\t\t\tif(resultsContainer != null &&resultsContainer instanceof DimensionalViewContainer){\t\t\t\t\n\t\t\t\t\tDimensionalViewContainer dimensionalViewContainer = (DimensionalViewContainer)resultsContainer;\n\t\t\t\t\t\tCopyNumberSingleViewResultsContainer copyNumberSingleViewContainer = dimensionalViewContainer.getCopyNumberSingleViewContainer();\n\t\t\t\t\t\tGeneExprSingleViewResultsContainer geneExprSingleViewContainer = dimensionalViewContainer.getGeneExprSingleViewContainer();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(copyNumberSingleViewContainer!= null){\n\t\t\t\t\t\t\tSet<BioSpecimenIdentifierDE> biospecimenIDs = copyNumberSingleViewContainer.getAllBiospecimenLabels();\n\t\t\t\t \t\tfor (BioSpecimenIdentifierDE bioSpecimen: biospecimenIDs) {\n\t\t\t\t \t\t\tif(bioSpecimen.getSpecimenName()!= null){\n\t\t\t\t \t\t\t\tsampleIDs.add(new SampleIDDE(bioSpecimen.getSpecimenName()));\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(geneExprSingleViewContainer!= null){\n\t\t\t\t\t\t\tSet<BioSpecimenIdentifierDE> biospecimenIDs = geneExprSingleViewContainer.getAllBiospecimenLabels();\n\t\t\t\t \t\tfor (BioSpecimenIdentifierDE bioSpecimen: biospecimenIDs) {\n\t\t\t\t \t\t\tif(bioSpecimen.getSpecimenName()!= null){\n\t\t\t\t \t\t\t\t\tsampleIDs.add(new SampleIDDE(bioSpecimen.getSpecimenName()));\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t \t\tsampleCrit = new SampleCriteria();\n\t\t \t\t\tsampleCrit.setSampleIDs(sampleIDs);\n\n AddConstrainsToQueriesHelper constrainedSamplesHandler= new AddConstrainsToQueriesHelper();\n constrainedSamplesHandler.constrainQueryWithSamples(newCompoundQuery,sampleCrit);\n\t\t\t\tnewCompoundQuery = getShowAllValuesQuery(newCompoundQuery);\n\t\t\t\tnewCompoundQuery.setAssociatedView(view);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn newCompoundQuery;\n\t\t}", "@Test\n public void test4() throws Exception {\n String query = \"A =LOAD 'file.txt' AS (a:(u,v), b, c);\" +\n \"B = FOREACH A GENERATE $0, b, flatten(1);\" +\n \"C = FILTER B BY \" + SIZE.class.getName() +\"(TOTUPLE(*)) > 5;\" +\n \"STORE C INTO 'empty';\"; \n LogicalPlan newLogicalPlan = buildPlan( query );\n\n Operator load = newLogicalPlan.getSources().get( 0 );\n Assert.assertTrue( load instanceof LOLoad );\n Operator fe1 = newLogicalPlan.getSuccessors( load ).get( 0 );\n Assert.assertTrue( fe1 instanceof LOForEach );\n Operator fe2 = newLogicalPlan.getSuccessors( fe1 ).get( 0 );\n Assert.assertTrue( fe2 instanceof LOForEach );\n Operator filter = newLogicalPlan.getSuccessors( fe2 ).get( 0 );\n Assert.assertTrue( filter instanceof LOFilter );\n }", "@Test\n public void testQueryMore3() throws Exception {\n testQueryMore(false, false);\n }", "@Test\n public void testFromClauses() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2), g3\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, 1, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_CROSS);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"g3\");\n \n verifySql(\"SELECT * FROM g1 CROSS JOIN g2, g3\", fileNode);\n }", "@Test\n public void testQueryWithEmptySegment() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\" [20120101000000_20120102000000]\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\" [20120102000000_20120103000000]\n val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"; // [20120103000000_20120104000000]\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\" [20120104000000_20120105000000]\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\" [20120105000000_20120106000000]\n\n EnhancedUnitOfWork.doInTransactionWithCheckAndRetry(() -> {\n NDataflowManager dfMgr = NDataflowManager.getInstance(getTestConfig(), project);\n NDataflow dataflow = dfMgr.getDataflow(dfId);\n NDataSegment latestReadySegment = dataflow.getSegment(seg3Id);\n if (latestReadySegment != null) {\n NDataSegDetails segDetails = latestReadySegment.getSegDetails();\n List<NDataLayout> allLayouts = segDetails.getAllLayouts();\n\n // update\n NDataflowUpdate dataflowUpdate = new NDataflowUpdate(dfId);\n NDataLayout[] toRemoveLayouts = allLayouts.stream()\n .filter(dataLayout -> dataLayout.getLayoutId() == 20001).toArray(NDataLayout[]::new);\n dataflowUpdate.setToRemoveLayouts(toRemoveLayouts);\n dfMgr.updateDataflow(dataflowUpdate);\n }\n return null;\n }, project);\n\n val sql = \"select cal_dt, sum(price), count(*) from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" //\n + \"group by cal_dt\\n\";\n // can not query\n {\n OLAPContext olapContext = OlapContextTestUtil.getOlapContexts(project, sql).get(0);\n StorageContext storageContext = olapContext.storageContext;\n Assert.assertEquals(-1L, storageContext.getLayoutId().longValue());\n }\n\n {\n MetadataTestUtils.updateProjectConfig(project, \"kylin.query.index-match-rules\",\n QueryRouter.USE_VACANT_INDEXES);\n try (QueryContext queryContext = QueryContext.current()) {\n OLAPContext olapContext = OlapContextTestUtil.getOlapContexts(project, sql).get(0);\n StorageContext storageContext = olapContext.storageContext;\n Assert.assertEquals(10001L, storageContext.getLayoutId().longValue());\n Assert.assertFalse(queryContext.getQueryTagInfo().isVacant());\n }\n }\n }", "public void prepareSelectOneRow() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareSelectOneRow();\n }", "SELECT createSELECT();", "public void visit(Query obj) {\n if (obj.getOrderBy() != null || obj.getLimit() != null) {\n visitor.namingContext.aliasColumns = true;\n } \n visitNode(obj.getFrom());\n visitNode(obj.getCriteria());\n visitNode(obj.getGroupBy());\n visitNode(obj.getHaving());\n visitNode(obj.getSelect());\n visitNode(obj.getOrderBy());\n }", "public void testKeepStatementWithConnectionPool() throws Exception {\n CountingDataSource ds1 = new CountingDataSource(getConnection());\n\n Configuration c1 =\n create().configuration().derive(new DataSourceConnectionProvider(ds1));\n\n for (int i = 0; i < 5; i++) {\n ResultQuery<Record1<Integer>> query =\n DSL.using(c1)\n .select(TBook_ID())\n .from(TBook())\n .where(TBook_ID().eq(param(\"p\", 0)));\n\n query.bind(\"p\", 1);\n assertEquals(1, (int) query.fetchOne().getValue(TBook_ID()));\n query.bind(\"p\", 2);\n assertEquals(2, (int) query.fetchOne().getValue(TBook_ID()));\n\n assertEquals((i + 1) * 2, ds1.open);\n assertEquals((i + 1) * 2, ds1.close);\n }\n\n assertEquals(10, ds1.open);\n assertEquals(10, ds1.close);\n\n // Keeping an open statement [#3191]\n CountingDataSource ds2 = new CountingDataSource(getConnection());\n\n Configuration c2 =\n create().configuration().derive(new DataSourceConnectionProvider(ds2));\n\n for (int i = 0; i < 5; i++) {\n ResultQuery<Record1<Integer>> query =\n DSL.using(c2)\n .select(TBook_ID())\n .from(TBook())\n .where(TBook_ID().eq(param(\"p\", 0)))\n .keepStatement(true);\n\n query.bind(\"p\", 1);\n assertEquals(1, (int) query.fetchOne().getValue(TBook_ID()));\n query.bind(\"p\", 2);\n assertEquals(2, (int) query.fetchOne().getValue(TBook_ID()));\n\n assertEquals(i + 1, ds2.open);\n assertEquals(i , ds2.close);\n\n query.close();\n\n assertEquals(i + 1, ds2.open);\n assertEquals(i + 1, ds2.close);\n }\n\n assertEquals(5, ds1.open);\n assertEquals(5, ds1.close);\n }", "@Override\n\tprotected void runData(Query query) throws SQLException {\n\t\tStringBuilder q = new StringBuilder();\n\t\tArrayList<Integer> destinationList = new ArrayList<Integer>();\n\t\tquery.inc(2);\n\t\twhile (!isData(query.part()) || !isComment(query.part()) || !isCode(query.part())) {\n\t\t\tq.append(query.part());\n\t\t\tq.append(\" \");\n\t\t\tquery.inc();\n\t\t}\n\t\tArrayList<Integer> originList = getLinesFromData(q.toString());\n\t\tparseSecondCondition(query, originList, destinationList);\n\t}", "List<Transaction> selectByExample(TransactionExample example);", "void rewrite(MySqlSelectQueryBlock query);", "public static void importPreviousQueries(StandaloneSupport support, RequiredData content, User user) throws JSONException, IOException {\n\t\tint id = 1;\n\t\tfor (ResourceFile queryResults : content.getPreviousQueryResults()) {\n\t\t\tUUID queryId = new UUID(0L, id++);\n\n\t\t\tfinal CsvParser parser = new CsvParser(support.getConfig().getCsv().withParseHeaders(false).withSkipHeader(false).createCsvParserSettings());\n\t\t\tString[][] data = parser.parseAll(queryResults.stream()).toArray(new String[0][]);\n\n\t\t\tConceptQuery q = new ConceptQuery(new CQExternal(Arrays.asList(FormatColumn.ID, FormatColumn.DATE_SET), data));\n\n\t\t\tManagedExecution<?> managed = ExecutionManager.createQuery(support.getNamespace().getNamespaces(),q, queryId, user.getId(), support.getNamespace().getDataset().getId());\n\t\t\tuser.addPermission(support.getStandaloneCommand().getMaster().getStorage(), QueryPermission.onInstance(AbilitySets.QUERY_CREATOR, managed.getId()));\n\t\t\tmanaged.awaitDone(1, TimeUnit.DAYS);\n\n\t\t\tif (managed.getState() == ExecutionState.FAILED) {\n\t\t\t\tfail(\"Query failed\");\n\t\t\t}\n\t\t}\n\n\t\t// wait only if we actually did anything\n\t\tif (!content.getPreviousQueryResults().isEmpty()) {\n\t\t\tsupport.waitUntilWorkDone();\n\t\t}\n\t}", "@Test\n public void testQueryAdHocs() throws Exception {\n\n // SETUP: Change all the Tasks to Blocks\n List<RefTaskClassKey> lClasses = new ArrayList<RefTaskClassKey>();\n SchedStaskTable lSchedStask = SchedStaskTable.create( new TaskKey( 4650, 101 ) );\n lClasses.add( lSchedStask.getTaskClass() );\n lSchedStask.setTaskClass( RefTaskClassKey.ADHOC );\n lSchedStask.update();\n lSchedStask = SchedStaskTable.create( new TaskKey( 4650, 102 ) );\n lClasses.add( lSchedStask.getTaskClass() );\n lSchedStask.setTaskClass( RefTaskClassKey.ADHOC );\n lSchedStask.update();\n lSchedStask = SchedStaskTable.create( new TaskKey( 4650, 400 ) );\n lClasses.add( lSchedStask.getTaskClass() );\n lSchedStask.setTaskClass( RefTaskClassKey.ADHOC );\n lSchedStask.update();\n lSchedStask = SchedStaskTable.create( new TaskKey( 4650, 500 ) );\n lClasses.add( lSchedStask.getTaskClass() );\n lSchedStask.setTaskClass( RefTaskClassKey.ADHOC );\n lSchedStask.update();\n\n execute( DateUtils.parseDateTimeString( \"15-MAY-2007 01:00\" ), 5, 4650, 100 );\n\n // There should be 4 rows\n MxAssert.assertEquals( \"Number of retrieved rows\", 4, iDataSet.getRowCount() );\n\n // Set them all back to REQ\n lSchedStask = SchedStaskTable.create( new TaskKey( 4650, 101 ) );\n lSchedStask.setTaskClass( lClasses.get( 0 ) );\n lSchedStask.update();\n lSchedStask = SchedStaskTable.create( new TaskKey( 4650, 102 ) );\n lSchedStask.setTaskClass( lClasses.get( 1 ) );\n lSchedStask.update();\n lSchedStask = SchedStaskTable.create( new TaskKey( 4650, 400 ) );\n lSchedStask.setTaskClass( lClasses.get( 2 ) );\n lSchedStask.update();\n lSchedStask = SchedStaskTable.create( new TaskKey( 4650, 500 ) );\n lSchedStask.setTaskClass( lClasses.get( 3 ) );\n lSchedStask.update();\n }", "@Test\n public void test1() throws Exception {\n String query = \"A =LOAD 'file.txt' AS (a:bag{(u,v)}, b, c);\" +\n \"B = FOREACH A GENERATE $0, b;\" +\n \"C = FILTER B BY \" + COUNT.class.getName() +\"($0) > 5;\" +\n \"STORE C INTO 'empty';\"; \n LogicalPlan newLogicalPlan = buildPlan( query );\n\n Operator load = newLogicalPlan.getSources().get( 0 );\n Assert.assertTrue( load instanceof LOLoad );\n Operator fe1 = newLogicalPlan.getSuccessors( load ).get( 0 );\n Assert.assertTrue( fe1 instanceof LOForEach );\n Operator filter = newLogicalPlan.getSuccessors( fe1 ).get( 0 );\n Assert.assertTrue( filter instanceof LOFilter );\n Operator fe2 = newLogicalPlan.getSuccessors( filter ).get( 0 );\n Assert.assertTrue( fe2 instanceof LOForEach );\n }", "@Test\n @Tag(\"CREATE\")\n @Tag(\"RESOURCE\")\n @DisplayName(\"Test HQL Query for Multiple Select and Pagination with Address 02\")\n public void testHQLQueryForMultipleSelectAndPaginationWithAddress02()\n {\n System.out.println(\"Programme Start\");\n long startTime = System.nanoTime();\n\n try (Session session = HibernateUtil.getSessionFactory().openSession()) {\n Transaction transaction = null;\n try {\n transaction = session.beginTransaction();\n\n Query query = session.createQuery(\n \"select address02Street, address02Zip from SBAddress02 order by address02Street asc\");\n query.setFirstResult(5);\n query.setMaxResults(10);\n\n List<Object[]> addressDetails = query.list();\n\n transaction.commit();\n\n addressDetails.forEach(address -> System.out.println(\"Added Address : \" + address[0]));\n\n System.out.println(addressDetails.size());\n } catch (Exception e) {\n if (transaction != null) {\n transaction.rollback();\n }\n LOGGER.error(ExceptionUtils.getFullStackTrace(e));\n e.printStackTrace();\n }\n\n } catch (Throwable throwable) {\n LOGGER.error(ExceptionUtils.getFullStackTrace(throwable));\n throwable.printStackTrace();\n }\n\n long endTime = System.nanoTime();\n ELAPSED_TIME = endTime - startTime;\n System.out.println(\"Programme End\");\n\n }", "public static void main(String[] args) {\n\n entityManager.getTransaction().begin();\n\n\n\n Account account1 = entityManager.createQuery(\"from Account where accountNr = 1\", Account.class).getSingleResult();\n Account account2 = entityManager.createQuery(\"from Account where accountNr = 2\", Account.class).getSingleResult();\n\n account1.setBalance(1000);\n account2.setBalance(1000);\n\n entityManager.getTransaction().commit();\n\n System.out.println(entityManager.createQuery(\"from Account\").getResultList());\n\n new Thread(() -> {\n\n entityManager.getTransaction().begin();\n\n Account account = entityManager.createQuery(\"from Account where accountNr = 1\", Account.class).getSingleResult();\n\n try {\n Thread.sleep(1000);\n }\n catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n account.withdraw(1000);\n System.out.println(entityManager.createQuery(\"from Account\").getResultList());\n\n entityManager.getTransaction().commit();\n\n }).run();\n\n new Thread(() -> {\n\n entityManager2.getTransaction().begin();\n\n Account account = entityManager.createQuery(\"from Account where accountNr = 1\", Account.class).getSingleResult();\n\n try {\n Thread.sleep(1000);\n }\n catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n\n account.withdraw(500);\n System.out.println(entityManager.createQuery(\"from Account\").getResultList());\n\n entityManager2.getTransaction().begin();\n\n }).run();\n\n System.out.println(entityManager.createQuery(\"from Account\").getResultList());\n\n }", "private void setAllLocalResults() {\n TreeMap<FlworKey, List<FlworTuple>> keyValuePairs = mapExpressionsToOrderedPairs();\n // get only the values(ordered tuples) and save them in a list for next() calls\n keyValuePairs.forEach((key, valueList) -> valueList.forEach((value) -> _localTupleResults.add(value)));\n\n _child.close();\n if (_localTupleResults.size() == 0) {\n this._hasNext = false;\n } else {\n this._hasNext = true;\n }\n }", "private void queryFlat(int columnCount, ResultTarget result, long limitRows) {\n if (limitRows > 0 && offsetExpr != null) {\r\n int offset = offsetExpr.getValue(session).getInt();\r\n if (offset > 0) {\r\n limitRows += offset;\r\n }\r\n }\r\n int rowNumber = 0;\r\n prepared.setCurrentRowNumber(0);\r\n int sampleSize = getSampleSizeValue(session);\r\n while (topTableFilter.next()) {\r\n prepared.setCurrentRowNumber(rowNumber + 1);\r\n if (condition == null ||\r\n Boolean.TRUE.equals(condition.getBooleanValue(session))) {\r\n Value[] row = new Value[columnCount];\r\n for (int i = 0; i < columnCount; i++) {\r\n Expression expr = expressions.get(i);\r\n row[i] = expr.getValue(session);\r\n }\r\n result.addRow(row);\r\n rowNumber++;\r\n if ((sort == null) && limitRows > 0 &&\r\n result.getRowCount() >= limitRows) {\r\n break;\r\n }\r\n if (sampleSize > 0 && rowNumber >= sampleSize) {\r\n break;\r\n }\r\n }\r\n }\r\n }", "public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }", "@Test\n public void testQueryMore4() throws Exception {\n testQueryMore(true, false);\n }", "static void compressTwoNode(ExecutableNodeBase node, ExecutableNodeBase parent) {\n if (!(node instanceof QueryNodeBase) || !(parent instanceof QueryNodeBase)) {\n return;\n }\n QueryNodeBase parentQuery = (QueryNodeBase) parent;\n QueryNodeBase nodeQuery = (QueryNodeBase) node;\n\n // Change the query of parents\n BaseTable placeholderTableinParent =\n ((QueryNodeWithPlaceHolders) parent)\n .getPlaceholderTables()\n .get(parent.getExecutableNodeBaseDependents().indexOf(node));\n ((QueryNodeWithPlaceHolders) parent).getPlaceholderTables().remove(placeholderTableinParent);\n\n // If temp table is in from list of parent, just direct replace with the select query of node\n boolean find = false;\n for (AbstractRelation table : parentQuery.getSelectQuery().getFromList()) {\n if (table instanceof BaseTable && table.equals(placeholderTableinParent)) {\n int index = parentQuery.getSelectQuery().getFromList().indexOf(table);\n nodeQuery\n .getSelectQuery()\n .setAliasName(\n parentQuery.getSelectQuery().getFromList().get(index).getAliasName().get());\n parentQuery.getSelectQuery().getFromList().set(index, nodeQuery.getSelectQuery());\n find = true;\n break;\n } else if (table instanceof JoinTable) {\n for (AbstractRelation joinTable : ((JoinTable) table).getJoinList()) {\n if (joinTable instanceof BaseTable && joinTable.equals(placeholderTableinParent)) {\n int index = ((JoinTable) table).getJoinList().indexOf(joinTable);\n nodeQuery.getSelectQuery().setAliasName(joinTable.getAliasName().get());\n ((JoinTable) table).getJoinList().set(index, nodeQuery.getSelectQuery());\n find = true;\n break;\n }\n }\n if (find) break;\n }\n }\n\n // Otherwise, it need to search filter to find the temp table\n if (!find) {\n List<SubqueryColumn> placeholderTablesinFilter =\n ((QueryNodeWithPlaceHolders) parent).getPlaceholderTablesinFilter();\n for (SubqueryColumn filter : placeholderTablesinFilter) {\n if (filter.getSubquery().getFromList().size() == 1\n && filter.getSubquery().getFromList().get(0).equals(placeholderTableinParent)) {\n filter.setSubquery(nodeQuery.getSelectQuery());\n }\n }\n }\n\n // Move node's placeholderTable to parent's\n ((QueryNodeWithPlaceHolders) parent)\n .placeholderTables.addAll(((QueryNodeWithPlaceHolders) node).placeholderTables);\n\n // Compress the node tree\n parentQuery.cancelSubscriptionTo(nodeQuery);\n for (Pair<ExecutableNodeBase, Integer> s : nodeQuery.getSourcesAndChannels()) {\n parentQuery.subscribeTo(s.getLeft(), s.getRight());\n }\n // parent.getListeningQueues().removeAll(node.broadcastingQueues);\n // parent.getListeningQueues().addAll(node.getListeningQueues());\n // parent.dependents.remove(node);\n // parent.dependents.addAll(node.dependents);\n // for (BaseQueryNode dependent:node.dependents) {\n // dependent.parents.remove(node);\n // dependent.parents.add(parent);\n // }\n }", "public DbFileIterator iterator(final TransactionId tid) { \t\n// some code goes here\n \t\n \tDbFileIterator dbfi = new DbFileIterator() {\n \tint pgno = 0;\n \tHeapPage currPg = null;\n \tString name = Database.getCatalog().getTableName(getId());\n \tint tblid = Database.getCatalog().getTableId(name);\n \tint open = 0; \t\n \t\n \t//Todo: pass along the tid from the outer method.\n \t//DONE. by making tid param final.\n \tTransactionId m_tid = tid;\n \t\n \tIterator<Tuple> titr = null;\n \t\n\t\t\t@Override\n\t\t\tpublic void rewind() throws DbException, TransactionAbortedException {\n\t\t\t\tclose();\n\t\t\t\topen();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void nextPage() throws DbException, TransactionAbortedException {\n\n\t\t\t\tif (pgno >= numPages())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tcurrPg = (HeapPage) Database.getBufferPool().getPage(m_tid, new HeapPageId(tblid, pgno), simpledb.Permissions.READ_ONLY);\n\t\t\t\t\ttitr = currPg.iterator();\n\t\t\t\t\tif (titr == null)\n\t\t\t\t\t\tthrow new DbException(\"blah blah blah\");\n\t\t\t\t\tpgno++;\n\t\t\t\t\treturn;\n\t\t\t\t} catch (DbException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new DbException(\"page was not found or no more iterators..?\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void open() throws DbException, TransactionAbortedException {\n\t\t\t\topen = 1;\n\t\t\t\tpgno = 0;\n\t\t\t\tnextPage();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Tuple next() throws DbException, TransactionAbortedException,\n\t\t\t\t\tNoSuchElementException {\n\t\t\t\tif (open != 1)\n\t\t\t\t\tthrow new NoSuchElementException();\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\treturn titr.next();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() throws DbException, TransactionAbortedException {\n\t\t\t\tif (open !=1)\n\t\t\t\t\treturn false;\n\t\t\t\tif (titr == null) //TODO: remove\n\t\t\t\t\tthrow new DbException(Integer.toString(pgno) + Integer.toString(open) + Integer.toString(numPages()) + m_f.getPath());\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\tif (titr.hasNext())\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void close() {\n\t\t\t\topen = 0;\n\t\t\t\ttitr = null;\n\t\t\t}\n\t\t};\n return dbfi;\n }", "@Test\n public void testQueryMore2() throws Exception {\n testQueryMore(false, true);\n }", "@Override\n public void visit(ASTCube node, Object data) throws Exception {\n getOutput(data).delete(getOutput(data).length() - 2, getOutput(data).length());\n\n getOutput(data).append(\" from \");\n\n Set<String> tables = new HashSet<String>();\n\n tables.add(TranslationUtils.tableExpression(getQueryMetadata(data).getCube().getSchemaName(),\n getQueryMetadata(data).getCube().getTableName()));\n\n for (Level level : levelsPresent((TranslationContext) data))\n for (Level lowerLevel : level.getLowerLevels())\n tables.add(TranslationUtils.tableExpression(lowerLevel.getSchemaName(), lowerLevel.getTableName()));\n\n for (String table : tables)\n getOutput(data).append(table).append(\", \");\n\n if (!tables.isEmpty())\n getOutput(data).delete(getOutput(data).length() - 2, getOutput(data).length());\n\n getOutput(data).append(\" where \");\n\n whereExpression((TranslationContext) data);\n }", "@Override\n\tpublic void enterDslStatement(AAIDslParser.DslStatementContext ctx) {\n\t\tif (isUnionBeg) {\n\t\t\tisUnionBeg = false;\n\t\t\tisUnionTraversal = true;\n\n\t\t} else if (unionMembers > 0) {\n\t\t\tunionMembers--;\n\t\t\tquery += \",builder.newInstance()\";\n\t\t\tisUnionTraversal = true;\n\t\t}\n\n\t}", "Query query();", "private void montaQuery(Publicacao object, Query q) {\t\t\n\t}", "@Override\n\tpublic boolean hasNext() {\n\t\tthis.res = new Row();\n\t\ttry{\n\t\t\twhile(index < dataCopy.size()){\n\t\t\t\tdata2 = dataCopy.get(index++);\t\t\t\t\t\t\t\n\t\t\t\tif(whereExp != null && !eval1.eval(whereExp).toBool()) continue;\t\n\t\t\t\t\n\t\t\t\tTableContainer.orderByData.add(new Row());\n\t\t\t\tfor(PrimitiveValue v : data2.rowList)\n\t\t\t\t\tTableContainer.orderByData.get(count).rowList.add(v);\t\n\t\t\t\tcount++;\n\t\t\t\n\t\t\t\t/*if the query is SELECT * FROM R*/\n\t\t\t\tif(flag2){\n\t\t\t\t\tres = data2;\n\t\t\t\t}else{\n\t\t\t\t\t/*if it is the regular query*/\n\t\t\t\t\tfor (int i = 0; i < itemLen; i++) res.rowList.add(eval1.eval((selectItemsExpression.get(i))));\n\t\t\t\t}\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n protected TupleBatch fetchNextReady() throws DbException {\r\n final Operator child = getChild();\r\n\r\n if (child.eos()) {\r\n return getResultBatch();\r\n }\r\n\r\n TupleBatch tb = child.nextReady();\r\n while (tb != null) {\r\n for (int row = 0; row < tb.numTuples(); ++row) {\r\n int rowHash = HashUtils.hashSubRow(tb, gfields, row);\r\n IntArrayList hashMatches = groupKeyMap.get(rowHash);\r\n if (hashMatches == null) {\r\n hashMatches = newKey(rowHash);\r\n newGroup(tb, row, hashMatches);\r\n continue;\r\n }\r\n boolean found = false;\r\n for (int i = 0; i < hashMatches.size(); i++) {\r\n int value = hashMatches.get(i);\r\n if (TupleUtils.tupleEquals(tb, gfields, row, groupKeys, grpRange, value)) {\r\n updateGroup(tb, row, aggStates.get(value));\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!found) {\r\n newGroup(tb, row, hashMatches);\r\n }\r\n Preconditions.checkState(groupKeys.numTuples() == aggStates.size());\r\n }\r\n tb = child.nextReady();\r\n }\r\n\r\n /*\r\n * We know that child.nextReady() has returned <code>null</code>, so we have processed all tuple we can. Child is\r\n * either EOS or we have to wait for more data.\r\n */\r\n if (child.eos()) {\r\n return getResultBatch();\r\n }\r\n\r\n return null;\r\n }", "@Override\n public void apply(AsgQuery query, AsgStrategyContext context) {\n AsgQueryUtil.elements(query, HQuant.class).forEach(hQuant -> {\n List<AsgEBase<RelProp>> relPropsAsgBChildren = AsgQueryUtil.bAdjacentDescendants(hQuant, RelProp.class);\n\n RelPropGroup rPropGroup;\n List<RelProp> relProps = Stream.ofAll(relPropsAsgBChildren).map(AsgEBase::geteBase).toJavaList();\n\n if (relProps.size() > 0) {\n rPropGroup = new RelPropGroup(relProps);\n rPropGroup.seteNum(Stream.ofAll(relProps).map(RelProp::geteNum).min().get());\n\n relPropsAsgBChildren.forEach(hQuant::removeBChild);\n } else {\n rPropGroup = new RelPropGroup();\n rPropGroup.seteNum(Stream.ofAll(AsgQueryUtil.eNums(query)).max().get() + 1);\n }\n\n hQuant.addBChild(new AsgEBase<>(rPropGroup));\n });\n }", "@Test\n @Tag(\"CREATE\")\n @Tag(\"RESOURCE\")\n @DisplayName(\"Test HQL Query for Multiple Select for Map and Pagination with Address 02\")\n public void testHQLQueryForMultipleSelectForMapAndPaginationWithAddress02()\n {\n System.out.println(\"Programme Start\");\n long startTime = System.nanoTime();\n\n try (Session session = HibernateUtil.getSessionFactory().openSession()) {\n Transaction transaction = null;\n try {\n transaction = session.beginTransaction();\n\n Query query = session.createQuery(\n \"select new Map(address02Zip, address02Street) from SBAddress02 order by address02Street asc\");\n query.setFirstResult(5);\n query.setMaxResults(10);\n\n List<Map<String, String>> addressDetails = query.list();\n\n transaction.commit();\n\n System.out.println(addressDetails.size());\n\n String street = addressDetails\n .stream()\n .filter(address -> address.containsKey(\"1\"))\n .findFirst()\n .get()\n .get(\"1\");\n\n System.out.println(\"First Street : \" + street);\n\n List<String> streets = addressDetails\n .stream()\n .map(address -> address.get(\"1\"))\n .collect(Collectors.toList());\n\n streets.forEach(System.out::println);\n } catch (Exception e) {\n if (transaction != null) {\n transaction.rollback();\n }\n LOGGER.error(ExceptionUtils.getFullStackTrace(e));\n e.printStackTrace();\n }\n } catch (Throwable throwable) {\n LOGGER.error(ExceptionUtils.getFullStackTrace(throwable));\n throwable.printStackTrace();\n }\n\n long endTime = System.nanoTime();\n ELAPSED_TIME = endTime - startTime;\n System.out.println(\"Programme End\");\n\n }", "@Test\n public void testAliasesInFrom() throws Exception {\n String sql = \"SELECT myG.*, myH.b FROM g AS myG, h AS myH\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node meSymbolNode = verify(selectNode, Select.SYMBOLS_REF_NAME, 1, MultipleElementSymbol.ID);\n Node groupSymbolNode = verify(meSymbolNode, MultipleElementSymbol.GROUP_REF_NAME, GroupSymbol.ID);\n verifyProperty(groupSymbolNode, Symbol.NAME_PROP_NAME, \"myG\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"myH\", \"h\");\n \n verifySql(sql, fileNode);\n }", "private CompletableFuture<Iterator<T>> batch() {\n return batch.thenCompose(iterator -> {\n if (iterator != null && !iterator.hasNext()) {\n batch = fetch(iterator.position());\n return batch.thenApply(Function.identity());\n }\n return CompletableFuture.completedFuture(iterator);\n });\n }", "private static void executeQuery2(PersistenceManager pm) {\n Query query = pm.newQuery(Item.class, \"parent.elements.size() <= size\");\n query.declareParameters(\"int size\");\n Collection results = (Collection)query.execute(new Integer(3));\n printCollection(\"Items in small categories:\", results.iterator());\n query.closeAll();\n }", "@Test\n public void testDAM31201001() {\n // In this test case the where clause is specified in a common sql shared in multiple queries.\n testDAM30505001();\n }", "protected void sequence_GroupByQuerySelection_SELECT(ISerializationContext context, GroupByQuerySelection semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "@Test\n public void testFilterPushDown() throws IOException { 'bla' as (x, y);\n // B = load 'morebla' as (a, b);\n // C = join A on x, B on a;\n // D = filter C by x = a and x = 0 and b = 1 and y = b;\n // store D into 'whatever';\n \n // A = load\n LogicalPlan lp = new LogicalPlan();\n {\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, lp);\n \tlp.add(A);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, lp);\n \tlp.add(B);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(lp, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \tlp.add(C);\n \tlp.connect(A, C);\n \tlp.connect(B, C);\n \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(0));\n \tEqualExpression eq1 = new EqualExpression(filterPlan, fx, fc0);\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tAndExpression and1 = new AndExpression(filterPlan, eq1, eq2);\n \tProjectExpression fb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(filterPlan, DataType.INTEGER, new Integer(1));\n \tEqualExpression eq3 = new EqualExpression(filterPlan, fb, fc1);\n \tAndExpression and2 = new AndExpression(filterPlan, and1, eq3);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, and2, eq4);\n \n \tLOFilter D = new LOFilter(lp, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \t// Connect D to B, since the transform has happened.\n \tlp.add(D);\n \tlp.connect(C, D);\n }\n \n LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(lp, 500);\n optimizer.optimize();\n \n LogicalPlan expected = new LogicalPlan();\n {\n // A = load\n \tLogicalSchema aschema = new LogicalSchema();\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \taschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \taschema.getField(0).uid = 1;\n \taschema.getField(1).uid = 2;\n \tLOLoad A = new LOLoad(new FileSpec(\"bla\", new FuncSpec(\"PigStorage\", \"\\t\")), aschema, expected);\n \texpected.add(A);\n \t\n \t// DA = filter\n \tLogicalExpressionPlan DAfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fx = new ProjectExpression(DAfilterPlan, DataType.INTEGER, 0, 0);\n \tfx.neverUseForRealSetUid(1);\n \tConstantExpression fc0 = new ConstantExpression(DAfilterPlan, DataType.INTEGER, new Integer(0));\n \tnew EqualExpression(DAfilterPlan, fx, fc0);\n\t \n \tLOFilter DA = new LOFilter(expected, DAfilterPlan);\n \tDA.neverUseForRealSetSchema(aschema);\n \texpected.add(DA);\n \texpected.connect(A, DA);\n\t \n \t// B = load\n \tLogicalSchema bschema = new LogicalSchema();\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tbschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tbschema.getField(0).uid = 3;\n \tbschema.getField(1).uid = 4;\n \tLOLoad B = new LOLoad(null, bschema, expected);\n \texpected.add(B);\n \t\n \t// DB = filter\n \tLogicalExpressionPlan DBfilterPlan = new LogicalExpressionPlan();\n \tProjectExpression fb = new ProjectExpression(DBfilterPlan, DataType.INTEGER, 0, 1);\n \tfb.neverUseForRealSetUid(4);\n \tConstantExpression fc1 = new ConstantExpression(DBfilterPlan, DataType.INTEGER, new Integer(1));\n \tnew EqualExpression(DBfilterPlan, fb, fc1);\n\t \n \tLOFilter DB = new LOFilter(expected, DBfilterPlan);\n \tDB.neverUseForRealSetSchema(bschema);\n \texpected.add(DB);\n \texpected.connect(B, DB);\n\t \n \t// C = join\n \tLogicalSchema cschema = new LogicalSchema();\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"x\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"y\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"a\", null, DataType.INTEGER));\n \tcschema.addField(new LogicalSchema.LogicalFieldSchema(\n \t\"b\", null, DataType.INTEGER));\n \tcschema.getField(0).uid = 1;\n \tcschema.getField(1).uid = 2;\n \tcschema.getField(2).uid = 3;\n \tcschema.getField(3).uid = 4;\n \tLogicalExpressionPlan aprojplan = new LogicalExpressionPlan();\n \tProjectExpression x = new ProjectExpression(aprojplan, DataType.INTEGER, 0, 0);\n \tx.neverUseForRealSetUid(1);\n \tLogicalExpressionPlan bprojplan = new LogicalExpressionPlan();\n \tProjectExpression y = new ProjectExpression(bprojplan, DataType.INTEGER, 1, 0);\n \ty.neverUseForRealSetUid(3);\n \tMultiMap<Integer, LogicalExpressionPlan> mm = \n \tnew MultiMap<Integer, LogicalExpressionPlan>();\n \tmm.put(0, aprojplan);\n \tmm.put(1, bprojplan);\n \tLOJoin C = new LOJoin(expected, mm, JOINTYPE.HASH, new boolean[] {true, true});\n \tC.neverUseForRealSetSchema(cschema);\n \texpected.add(C);\n \texpected.connect(DA, C);\n \texpected.connect(DB, C);\n\t \n \t// D = filter\n \tLogicalExpressionPlan filterPlan = new LogicalExpressionPlan();\n \tProjectExpression fanotherx = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 0);\n \tfanotherx.neverUseForRealSetUid(1);\n \tProjectExpression fa = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 2);\n \tfa.neverUseForRealSetUid(3);\n \tEqualExpression eq2 = new EqualExpression(filterPlan, fanotherx, fa);\n \tProjectExpression fanotherb = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 3);\n \tfanotherb.neverUseForRealSetUid(4);\n \tProjectExpression fy = new ProjectExpression(filterPlan, DataType.INTEGER, 0, 1);\n \tfy.neverUseForRealSetUid(2);\n \tEqualExpression eq4 = new EqualExpression(filterPlan, fy, fanotherb);\n \tnew AndExpression(filterPlan, eq2, eq4);\n\t \n \tLOFilter D = new LOFilter(expected, filterPlan);\n \tD.neverUseForRealSetSchema(cschema);\n \texpected.add(D);\n \texpected.connect(C, D);\n }\n \n assertTrue( lp.isEqual(expected) );\n // assertEquals(lp, expected);\n }", "@Override\r\n\tpublic Node visitSequential(SequentialContext ctx) {\n\t\treturn super.visitSequential(ctx);\r\n\t}", "public QueryExecution createQueryExecution(Query qry);", "private void executeQuery1(PersistenceManager pm) {\n Query query = pm.newQuery(Book.class, \"pages > 300\");\n Collection results = (Collection)query.execute();\n printCollection(\"Books with more than 300 pages:\", results.iterator());\n query.closeAll();\n }", "private static QueryIterator execute(NodeTupleTable nodeTupleTable, Node graphNode, BasicPattern pattern, \n QueryIterator input, Predicate<Tuple<NodeId>> filter,\n ExecutionContext execCxt)\n {\n if ( Quad.isUnionGraph(graphNode) )\n graphNode = Node.ANY ;\n if ( Quad.isDefaultGraph(graphNode) )\n graphNode = null ;\n \n List<Triple> triples = pattern.getList() ;\n boolean anyGraph = (graphNode==null ? false : (Node.ANY.equals(graphNode))) ;\n\n int tupleLen = nodeTupleTable.getTupleTable().getTupleLen() ;\n if ( graphNode == null ) {\n if ( 3 != tupleLen )\n throw new TDBException(\"SolverLib: Null graph node but tuples are of length \"+tupleLen) ;\n } else {\n if ( 4 != tupleLen )\n throw new TDBException(\"SolverLib: Graph node specified but tuples are of length \"+tupleLen) ;\n }\n \n // Convert from a QueryIterator (Bindings of Var/Node) to BindingNodeId\n NodeTable nodeTable = nodeTupleTable.getNodeTable() ;\n \n Iterator<BindingNodeId> chain = Iter.map(input, SolverLib.convFromBinding(nodeTable)) ;\n List<Abortable> killList = new ArrayList<>() ;\n \n for ( Triple triple : triples )\n {\n Tuple<Node> tuple = null ;\n if ( graphNode == null )\n // 3-tuples\n tuple = tuple(triple.getSubject(), triple.getPredicate(), triple.getObject()) ;\n else\n // 4-tuples.\n tuple = tuple(graphNode, triple.getSubject(), triple.getPredicate(), triple.getObject()) ;\n // Plain RDF\n //chain = solve(nodeTupleTable, tuple, anyGraph, chain, filter, execCxt) ;\n // RDF-star\n chain = SolverRX.solveRX(nodeTupleTable, tuple, anyGraph, chain, filter, execCxt) ;\n chain = makeAbortable(chain, killList) ; \n }\n \n // DEBUG POINT\n if ( false )\n {\n if ( chain.hasNext())\n chain = Iter.debug(chain) ;\n else\n System.out.println(\"No results\") ;\n }\n \n // Timeout wrapper ****\n // QueryIterTDB gets called async.\n // Iter.abortable?\n // Or each iterator has a place to test.\n // or pass in a thing to test?\n \n \n // Need to make sure the bindings here point to parent.\n Iterator<Binding> iterBinding = convertToNodes(chain, nodeTable) ;\n \n // \"input\" will be closed by QueryIterTDB but is otherwise unused.\n // \"killList\" will be aborted on timeout.\n return new QueryIterTDB(iterBinding, killList, input, execCxt) ;\n }", "@Test\r\n\tpublic void testPrepareGraphQuery3() throws Exception\r\n\t{\r\n\t\tStatement st1 = vf.createStatement(john, fname, johnfname, dirgraph);\r\n\t\tStatement st2 = vf.createStatement(john, lname, johnlname, dirgraph);\r\n\t\tStatement st3 = vf.createStatement(john, homeTel, johnhomeTel, dirgraph);\r\n\t\tStatement st4 = vf.createStatement(john, email, johnemail, dirgraph);\r\n\t\tStatement st5 = vf.createStatement(micah, fname, micahfname, dirgraph);\r\n\t\tStatement st6 = vf.createStatement(micah, lname, micahlname, dirgraph);\r\n\t\tStatement st7 = vf.createStatement(micah, homeTel, micahhomeTel, dirgraph);\r\n\t\tStatement st8 = vf.createStatement(fei, fname, feifname, dirgraph);\r\n\t\tStatement st9 = vf.createStatement(fei, lname, feilname, dirgraph);\r\n\t\tStatement st10 = vf.createStatement(fei, email, feiemail, dirgraph);\r\n\t\t\r\n\t\r\n\t\ttestWriterCon.add(st1);\r\n\t\ttestWriterCon.add(st2);\r\n\t\ttestWriterCon.add(st3);\r\n\t\ttestWriterCon.add(st4);\r\n\t\ttestWriterCon.add(st5);\r\n\t\ttestWriterCon.add(st6);\r\n\t\ttestWriterCon.add(st7);\r\n\t\ttestWriterCon.add(st8);\r\n\t\ttestWriterCon.add(st9);\r\n\t\ttestWriterCon.add(st10);\r\n\t\t\r\n\t\tAssert.assertTrue(testWriterCon.hasStatement(st1, false));\r\n\t\tAssert.assertFalse(testWriterCon.hasStatement(st1, false, (Resource)null));\r\n\t\tAssert.assertFalse(testWriterCon.hasStatement(st1, false, null));\r\n\t\tAssert.assertTrue(testWriterCon.hasStatement(st1, false, dirgraph));\r\n\t\t\r\n\t\t\r\n\t\tAssert.assertEquals(10, testAdminCon.size(dirgraph));\t\t\r\n\t\t\t\r\n\t\tString query = \" DESCRIBE <http://marklogicsparql.com/addressbook#firstName> \";\r\n\t\tGraphQuery queryObj = testReaderCon.prepareGraphQuery(query);\r\n\t\t\t\r\n\t\tGraphQueryResult result = queryObj.evaluate();\r\n\t\tresult.hasNext();\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(false)));\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t}", "@Test(timeout = 4000)\n public void test056() throws Throwable {\n boolean boolean0 = SQLUtil.isQuery(\"SELECT * FROM join SELECT * FROM as SELECT * FROM on SELECT * FROM .SELECT * FROM = SELECT * FROM .SELECT * FROM and SELECT * FROM .null = SELECT * FROM .null and SELECT * FROM .SELECT * FROM = SELECT * FROM .SELECT * FROM and SELECT * FROM .null = SELECT * FROM .null and SELECT * FROM .null = SELECT * FROM .null and SELECT * FROM .null = SELECT * FROM .null\");\n assertTrue(boolean0);\n }", "GroupQuery createQuery();", "@Test\n public void testMixedJoin2() throws Exception {\n String sql = \"SELECT * FROM g1 cross join (g2 cross join g3), g4, g5 cross join g6\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, 1, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n\n verifyUnaryFromClauseGroup(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n \n Node jpNode2 = verify(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n \n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g2\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g3\");\n\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"g4\");\n\n Node jpNode3 = verify(fromNode, From.CLAUSES_REF_NAME, 3, JoinPredicate.ID);\n verifyJoin(jpNode3, JoinTypeTypes.JOIN_CROSS);\n\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g5\");\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g6\");\n \n verifySql(\"SELECT * FROM g1 CROSS JOIN (g2 CROSS JOIN g3), g4, g5 CROSS JOIN g6\", fileNode);\n }", "private SelectOnConditionStep<Record> commonTestItemDslSelect() {\n\t\treturn dsl.select().from(TEST_ITEM).join(TEST_ITEM_RESULTS).on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID));\n\t}", "void doNestedNaturalJoin(WorkflowExpressionQuery e, NestedExpression nestedExpression, StringBuffer columns, StringBuffer where, StringBuffer whereComp, List values, List queries, StringBuffer orderBy) { // throws WorkflowStoreException {\n\n Object value;\n Field currentExpField;\n\n int numberOfExp = nestedExpression.getExpressionCount();\n\n for (int i = 0; i < numberOfExp; i++) { //ori\n\n //for (i = numberOfExp; i > 0; i--) { //reverse 1 of 3\n Expression expression = nestedExpression.getExpression(i); //ori\n\n //Expression expression = nestedExpression.getExpression(i - 1); //reverse 2 of 3\n if (!(expression.isNested())) {\n FieldExpression fieldExp = (FieldExpression) expression;\n\n FieldExpression fieldExpBeforeCurrent;\n queries.add(expression);\n\n int queryId = queries.size();\n\n if (queryId > 1) {\n columns.append(\" , \");\n }\n\n //do; OS_CURRENTSTEP AS a1 ....\n if (fieldExp.getContext() == Context.CURRENT_STEPS) {\n columns.append(currentTable + \" AS \" + 'a' + queryId);\n } else if (fieldExp.getContext() == Context.HISTORY_STEPS) {\n columns.append(historyTable + \" AS \" + 'a' + queryId);\n } else {\n columns.append(entryTable + \" AS \" + 'a' + queryId);\n }\n\n ///////// beginning of WHERE JOINS/s : //////////////////////////////////////////\n //do for first query; a1.ENTRY_ID = a1.ENTRY_ID\n if (queryId == 1) {\n where.append(\"a1\" + '.' + stepProcessId);\n where.append(\" = \");\n\n if (fieldExp.getContext() == Context.CURRENT_STEPS) {\n where.append(\"a\" + queryId + '.' + stepProcessId);\n } else if (fieldExp.getContext() == Context.HISTORY_STEPS) {\n where.append(\"a\" + queryId + '.' + stepProcessId);\n } else {\n where.append(\"a\" + queryId + '.' + entryId);\n }\n }\n\n //do; a1.ENTRY_ID = a2.ENTRY_ID\n if (queryId > 1) {\n fieldExpBeforeCurrent = (FieldExpression) queries.get(queryId - 2);\n\n if (fieldExpBeforeCurrent.getContext() == Context.CURRENT_STEPS) {\n where.append(\"a\" + (queryId - 1) + '.' + stepProcessId);\n } else if (fieldExpBeforeCurrent.getContext() == Context.HISTORY_STEPS) {\n where.append(\"a\" + (queryId - 1) + '.' + stepProcessId);\n } else {\n where.append(\"a\" + (queryId - 1) + '.' + entryId);\n }\n\n where.append(\" = \");\n\n if (fieldExp.getContext() == Context.CURRENT_STEPS) {\n where.append(\"a\" + queryId + '.' + stepProcessId);\n } else if (fieldExp.getContext() == Context.HISTORY_STEPS) {\n where.append(\"a\" + queryId + '.' + stepProcessId);\n } else {\n where.append(\"a\" + queryId + '.' + entryId);\n }\n }\n\n ///////// end of LEFT JOIN : \"LEFT JOIN OS_CURRENTSTEP a1 ON a0.ENTRY_ID = a1.ENTRY_ID\n //\n //////// BEGINNING OF WHERE clause //////////////////////////////////////////////////\n value = fieldExp.getValue();\n currentExpField = fieldExp.getField();\n\n //if the Expression is negated and FieldExpression is \"EQUALS\", we need to negate that FieldExpression\n if (expression.isNegate()) {\n //do ; a2.STATUS !=\n whereComp.append(\"a\" + queryId + '.' + fieldName(fieldExp.getField()));\n\n switch (fieldExp.getOperator()) { //WHERE a1.STATUS !=\n case EQUALS:\n\n if (value == null) {\n whereComp.append(\" IS NOT \");\n } else {\n whereComp.append(\" != \");\n }\n\n break;\n\n case NOT_EQUALS:\n\n if (value == null) {\n whereComp.append(\" IS \");\n } else {\n whereComp.append(\" = \");\n }\n\n break;\n\n case GT:\n whereComp.append(\" < \");\n\n break;\n\n case LT:\n whereComp.append(\" > \");\n\n break;\n\n default:\n whereComp.append(\" != \");\n\n break;\n }\n\n switch (currentExpField) {\n case START_DATE:\n case FINISH_DATE:\n values.add(new Timestamp(((java.util.Date) value).getTime()));\n\n break;\n\n default:\n\n if (value == null) {\n values.add(null);\n } else {\n values.add(value);\n }\n\n break;\n }\n } else {\n //do; a1.OWNER =\n whereComp.append(\"a\" + queryId + '.' + fieldName(fieldExp.getField()));\n\n switch (fieldExp.getOperator()) { //WHERE a2.FINISH_DATE <\n case EQUALS:\n\n if (value == null) {\n whereComp.append(\" IS \");\n } else {\n whereComp.append(\" = \");\n }\n\n break;\n\n case NOT_EQUALS:\n\n if (value == null) {\n whereComp.append(\" IS NOT \");\n } else {\n whereComp.append(\" <> \");\n }\n\n break;\n\n case GT:\n whereComp.append(\" > \");\n\n break;\n\n case LT:\n whereComp.append(\" < \");\n\n break;\n\n default:\n whereComp.append(\" = \");\n\n break;\n }\n\n switch (currentExpField) {\n case START_DATE:\n case FINISH_DATE:\n values.add(new Timestamp(((java.util.Date) value).getTime()));\n\n break;\n\n default:\n\n if (value == null) {\n values.add(null);\n } else {\n values.add(value);\n }\n\n break;\n }\n }\n\n //do; a1.OWNER = ? ... a2.STATUS != ?\n whereComp.append(\" ? \");\n\n //////// END OF WHERE clause////////////////////////////////////////////////////////////\n if ((e.getSortOrder() != WorkflowExpressionQuery.SORT_NONE) && (e.getOrderBy() != null)) {\n // System.out.println(\"ORDER BY ; queries.size() : \" + queries.size());\n orderBy.append(\" ORDER BY \");\n orderBy.append(\"a1\" + '.' + fieldName(e.getOrderBy()));\n\n if (e.getSortOrder() == WorkflowExpressionQuery.SORT_ASC) {\n orderBy.append(\" ASC\");\n } else if (e.getSortOrder() == WorkflowExpressionQuery.SORT_DESC) {\n orderBy.append(\" DESC\");\n }\n }\n } else {\n NestedExpression nestedExp = (NestedExpression) expression;\n\n where.append('(');\n\n doNestedNaturalJoin(e, nestedExp, columns, where, whereComp, values, queries, orderBy);\n\n where.append(')');\n }\n\n //add AND or OR clause between the queries\n if (i < (numberOfExp - 1)) { //ori\n\n //if (i > 1) { //reverse 3 of 3\n if (nestedExpression.getExpressionOperator() == LogicalOperator.AND) {\n where.append(\" AND \");\n whereComp.append(\" AND \");\n } else {\n where.append(\" OR \");\n whereComp.append(\" OR \");\n }\n }\n }\n }", "void findWithPagination(Pagination<Task, Project> pagination);", "@Override\n public SinkContext executeByRow(VirtualFrame frame, FrameDescriptorPart framePart, SinkContext context) throws UnexpectedResultException {\n if (this.receiverFrameSlots.size() > 0 && this.objects.size() == 0) {\n for (FrameSlot receiverFrameSlot: this.receiverFrameSlots) {\n TANewObject object = TANewObjectNodeGen.create();\n this.objects.add(object); // TODO remove this.objects after moving this statement to init\n StatementWriteLocalNodeGen.create(object, receiverFrameSlot).executeVoid(frame);\n }\n }\n List<Object> grouping = new ArrayList<>();\n for (Integer i : groupSet) {\n FrameSlot slot = this.aggregateFramePart.findFrameSlotInPrevious(i);\n Objects.requireNonNull(slot);\n Object value = frame.getValue(slot);\n grouping.add(value);\n }\n StatementWriteLocalNodeGen.create(\n ExprLiteral.Object(grouping.toString()), this.keyFrameSlot).executeVoid(frame);\n List<Object> funcResults =\n this.aggFunctions.stream().map(f -> f.executeGeneric(frame)).collect(Collectors.toList());\n map.put(grouping, funcResults);\n return context;\n }", "SelectQuery createSelectQuery();", "abstract protected void passHitQueryContextToClauses(HitQueryContext context);", "public NestedClause getXQueryClause();", "private Cursor selectStatements(TransferObject feature) throws Exception {\r\n\t //ContentValues cv = new ContentValues(); \r\n\t List<FieldTO> fields = feature.getFields();\r\n\t String[] selectionArgs = new String[fields.size()];\r\n\t for (int i=0; i<fields.size();i++) {\r\n\t \tFieldTO fieldTO = fields.get(i);\r\n\t \tString name = fieldTO.getName();\r\n\t \tObject value = fieldTO.getValue();\r\n\t \tselectionArgs[i] = String.valueOf(value);\r\n\r\n\t\t}\r\n\t // return getDb().insert(getTableName(), null, cv);\r\n\t\tStatementFactory statement = new StatementFactory(feature);\r\n StringBuilder sqls = statement.createStatementSQL();\r\n Cursor c = getDb().rawQuery(sqls.toString(), selectionArgs);\r\n\t return c;\r\n\t}", "@Test\n public void testSelectTrimFamilyWithParameters()\n {\n\n testQuery(\n \"SELECT\\n\"\n + \"TRIM(BOTH ? FROM ?),\\n\"\n + \"TRIM(TRAILING ? FROM ?),\\n\"\n + \"TRIM(? FROM ?),\\n\"\n + \"TRIM(TRAILING FROM ?),\\n\"\n + \"TRIM(?),\\n\"\n + \"BTRIM(?),\\n\"\n + \"BTRIM(?, ?),\\n\"\n + \"LTRIM(?),\\n\"\n + \"LTRIM(?, ?),\\n\"\n + \"RTRIM(?),\\n\"\n + \"RTRIM(?, ?),\\n\"\n + \"COUNT(*)\\n\"\n + \"FROM foo\",\n ImmutableList.of(\n Druids.newTimeseriesQueryBuilder()\n .dataSource(CalciteTests.DATASOURCE1)\n .intervals(querySegmentSpec(Filtration.eternity()))\n .granularity(Granularities.ALL)\n .aggregators(aggregators(new CountAggregatorFactory(\"a0\")))\n .postAggregators(\n expressionPostAgg(\"p0\", \"'foo'\"),\n expressionPostAgg(\"p1\", \"'xfoo'\"),\n expressionPostAgg(\"p2\", \"'foo'\"),\n expressionPostAgg(\"p3\", \"' foo'\"),\n expressionPostAgg(\"p4\", \"'foo'\"),\n expressionPostAgg(\"p5\", \"'foo'\"),\n expressionPostAgg(\"p6\", \"'foo'\"),\n expressionPostAgg(\"p7\", \"'foo '\"),\n expressionPostAgg(\"p8\", \"'foox'\"),\n expressionPostAgg(\"p9\", \"' foo'\"),\n expressionPostAgg(\"p10\", \"'xfoo'\")\n )\n .context(QUERY_CONTEXT_DEFAULT)\n .build()\n ),\n ImmutableList.of(\n new Object[]{\"foo\", \"xfoo\", \"foo\", \" foo\", \"foo\", \"foo\", \"foo\", \"foo \", \"foox\", \" foo\", \"xfoo\", 6L}\n ),\n ImmutableList.of(\n new SqlParameter(SqlType.VARCHAR, \"x\"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \"x\"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \" \"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \"x\"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \"x\"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \"x\")\n )\n );\n }", "@Test\n public void testPartialLimitPushDownMerge() {\n QueryToolChest<Row, GroupByQuery> toolChest = groupByFactory.getToolchest();\n QueryRunner<Row> theRunner = new org.apache.druid.query.FinalizeResultsQueryRunner(toolChest.mergeResults(groupByFactory.mergeRunners(executorService, getRunner1(0))), ((QueryToolChest) (toolChest)));\n QueryRunner<Row> theRunner2 = new org.apache.druid.query.FinalizeResultsQueryRunner(toolChest.mergeResults(groupByFactory2.mergeRunners(executorService, getRunner2(1))), ((QueryToolChest) (toolChest)));\n QueryRunner<Row> finalRunner = new org.apache.druid.query.FinalizeResultsQueryRunner(toolChest.mergeResults(new QueryRunner<Row>() {\n @Override\n public Sequence<Row> run(QueryPlus<Row> queryPlus, Map<String, Object> responseContext) {\n return Sequences.simple(ImmutableList.of(theRunner.run(queryPlus, responseContext), theRunner2.run(queryPlus, responseContext))).flatMerge(Function.identity(), queryPlus.getQuery().getResultOrdering());\n }\n }), ((QueryToolChest) (toolChest)));\n QuerySegmentSpec intervalSpec = new org.apache.druid.query.spec.MultipleIntervalSegmentSpec(Collections.singletonList(Intervals.utc(1500000000000L, 1600000000000L)));\n GroupByQuery query = GroupByQuery.builder().setDataSource(\"blah\").setQuerySegmentSpec(intervalSpec).setDimensions(new DefaultDimensionSpec(\"dimA\", \"dimA\"), new org.apache.druid.query.dimension.ExtractionDimensionSpec(ColumnHolder.TIME_COLUMN_NAME, \"hour\", ValueType.LONG, new TimeFormatExtractionFn(null, null, null, new org.apache.druid.java.util.common.granularity.PeriodGranularity(new Period(\"PT1H\"), null, DateTimeZone.UTC), true))).setAggregatorSpecs(new LongSumAggregatorFactory(\"metASum\", \"metA\")).setLimitSpec(new DefaultLimitSpec(Arrays.asList(new org.apache.druid.query.groupby.orderby.OrderByColumnSpec(\"hour\", Direction.ASCENDING, StringComparators.NUMERIC), new org.apache.druid.query.groupby.orderby.OrderByColumnSpec(\"dimA\", Direction.ASCENDING)), 1000)).setContext(ImmutableMap.of(CTX_KEY_APPLY_LIMIT_PUSH_DOWN, true)).setGranularity(ALL).build();\n Sequence<Row> queryResult = finalRunner.run(QueryPlus.wrap(query), new HashMap());\n List<Row> results = queryResult.toList();\n Row expectedRow0 = GroupByQueryRunnerTestHelper.createExpectedRow(\"2017-07-14T02:40:00.000Z\", \"dimA\", \"mango\", \"hour\", 1505260800000L, \"metASum\", 26L);\n Row expectedRow1 = GroupByQueryRunnerTestHelper.createExpectedRow(\"2017-07-14T02:40:00.000Z\", \"dimA\", \"pomegranate\", \"hour\", 1505260800000L, \"metASum\", 7113L);\n Row expectedRow2 = GroupByQueryRunnerTestHelper.createExpectedRow(\"2017-07-14T02:40:00.000Z\", \"dimA\", \"mango\", \"hour\", 1505264400000L, \"metASum\", 10L);\n Row expectedRow3 = GroupByQueryRunnerTestHelper.createExpectedRow(\"2017-07-14T02:40:00.000Z\", \"dimA\", \"pomegranate\", \"hour\", 1505264400000L, \"metASum\", 7726L);\n Assert.assertEquals(4, results.size());\n Assert.assertEquals(expectedRow0, results.get(0));\n Assert.assertEquals(expectedRow1, results.get(1));\n Assert.assertEquals(expectedRow2, results.get(2));\n Assert.assertEquals(expectedRow3, results.get(3));\n }", "@Test\n public void testMultiCrossJoin2() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2) cross join (g3 cross join g4)\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode1 = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode1, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode2 = verify(jpNode1, JoinPredicate.LEFT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode2, JoinTypeTypes.JOIN_CROSS);\n\n Node jpNode3 = verify(jpNode1, JoinPredicate.RIGHT_CLAUSE_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode3, JoinTypeTypes.JOIN_CROSS);\n \n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode2, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g3\");\n verifyUnaryFromClauseGroup(jpNode3, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g4\");\n \n verifySql(\"SELECT * FROM (g1 CROSS JOIN g2) CROSS JOIN (g3 CROSS JOIN g4)\", fileNode);\n }", "@Override\r\n\tpublic Node visitBlock(BlockContext ctx) {\n\t\treturn super.visitBlock(ctx);\r\n\t}", "protected Tuple fetchNext() throws NoSuchElementException, TransactionAbortedException, DbException {\n\t\t// some code goes here\n\t\tTuple ret;\n\t\twhile (childOperator.hasNext()) {\n\t\t\tret = childOperator.next();\n\t\t\tif (pred.filter(ret))\n\t\t\t\treturn ret;\n\t\t}\n\t\treturn null;\n\t}", "@Test\n public void queryWithOneInnerQueryCreate() throws IOException {\n BaseFuseClient fuseClient = new BaseFuseClient(\"http://localhost:8888/fuse\");\n //query request\n CreateQueryRequest request = new CreateQueryRequest();\n request.setId(\"1\");\n request.setName(\"test\");\n request.setQuery(Q1());\n //submit query\n given()\n .contentType(\"application/json\")\n .header(new Header(\"fuse-external-id\", \"test\"))\n .with().port(8888)\n .body(request)\n .post(\"/fuse/query\")\n .then()\n .assertThat()\n .body(new TestUtils.ContentMatcher(o -> {\n try {\n final QueryResourceInfo queryResourceInfo = fuseClient.unwrap(o.toString(), QueryResourceInfo.class);\n assertTrue(queryResourceInfo.getAsgUrl().endsWith(\"fuse/query/1/asg\"));\n assertTrue(queryResourceInfo.getCursorStoreUrl().endsWith(\"fuse/query/1/cursor\"));\n assertEquals(1,queryResourceInfo.getInnerUrlResourceInfos().size());\n assertTrue(queryResourceInfo.getInnerUrlResourceInfos().get(0).getAsgUrl().endsWith(\"fuse/query/1->q2/asg\"));\n assertTrue(queryResourceInfo.getInnerUrlResourceInfos().get(0).getCursorStoreUrl().endsWith(\"fuse/query/1->q2/cursor\"));\n return fuseClient.unwrap(o.toString()) != null;\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n }))\n .statusCode(201)\n .contentType(\"application/json;charset=UTF-8\");\n\n //get query resource by id\n given()\n .contentType(\"application/json\")\n .header(new Header(\"fuse-external-id\", \"test\"))\n .with().port(8888)\n .get(\"/fuse/query/\"+request.getId()+\"->\"+Q2().getName())\n .then()\n .assertThat()\n .body(new TestUtils.ContentMatcher(o -> {\n try {\n final QueryResourceInfo queryResourceInfo = fuseClient.unwrap(o.toString(), QueryResourceInfo.class);\n assertTrue(queryResourceInfo.getAsgUrl().endsWith(\"fuse/query/1->q2/asg\"));\n assertTrue(queryResourceInfo.getCursorStoreUrl().endsWith(\"fuse/query/1->q2/cursor\"));\n return fuseClient.unwrap(o.toString()) != null;\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n }))\n .statusCode(200)\n .contentType(\"application/json;charset=UTF-8\");\n\n\n }", "Query queryOn(Connection connection);", "private QueryResponse query(Query query) throws ElasticSearchException{\r\n\t\tQueryResponse response = executor.executeQuery(query);\r\n\t\tresponse.setObjectMapper(mapper);\r\n\t\treturn response;\t\t\r\n\t}", "@Test\n public void basic1() throws Exception {\n try {\n test(\"ALTER SESSION SET `planner.slice_target` = 1\");\n test(\"ALTER SESSION SET `store.format` = 'parquet'\");\n test(\"CREATE TABLE dfs.tmp.region_basic1 AS SELECT * from cp.`region.json`\");\n test(\"ANALYZE TABLE dfs.tmp.region_basic1 COMPUTE STATISTICS\");\n test(\"SELECT * FROM dfs.tmp.`region_basic1/.stats.drill`\");\n test(\"create table dfs.tmp.flatstats1 as select flatten(`directories`[0].`columns`) as `columns`\"\n + \" from dfs.tmp.`region_basic1/.stats.drill`\");\n\n testBuilder()\n .sqlQuery(\"SELECT tbl.`columns`.`column` as `column`, tbl.`columns`.rowcount as rowcount,\"\n + \" tbl.`columns`.nonnullrowcount as nonnullrowcount, tbl.`columns`.ndv as ndv,\"\n + \" tbl.`columns`.avgwidth as avgwidth\"\n + \" FROM dfs.tmp.flatstats1 tbl\")\n .unOrdered()\n .baselineColumns(\"column\", \"rowcount\", \"nonnullrowcount\", \"ndv\", \"avgwidth\")\n .baselineValues(\"`region_id`\", 110.0, 110.0, 110L, 8.0)\n .baselineValues(\"`sales_city`\", 110.0, 110.0, 109L, 8.663636363636364)\n .baselineValues(\"`sales_state_province`\", 110.0, 110.0, 13L, 2.4272727272727272)\n .baselineValues(\"`sales_district`\", 110.0, 110.0, 23L, 9.318181818181818)\n .baselineValues(\"`sales_region`\", 110.0, 110.0, 8L, 10.8)\n .baselineValues(\"`sales_country`\", 110.0, 110.0, 4L, 3.909090909090909)\n .baselineValues(\"`sales_district_id`\", 110.0, 110.0, 23L, 8.0)\n .go();\n } finally {\n resetSessionOption(\"planner.slice_target\");\n resetSessionOption(\"store.format\");\n }\n }", "void expand(List<R> results);", "@Test\n public void testPartlyQuotedGroup() throws Exception {\n String sql = \"SELECT a from db.\\\"g\\\" where a = 5\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"a\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, \"db.g\");\n\n Node criteriaNode = verify(queryNode, Query.CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n verifyElementSymbol(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, \"a\");\n verifyConstant(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, 5);\n \n verifySql(\"SELECT a FROM db.g WHERE a = 5\", fileNode);\n }", "String limitSubquery();", "@Override\n public Expression<?> visit(SubQueryExpression<?> expr, @Nullable Void context) {\n return expr;\n }", "public FeatureCursor queryFeaturesForChunk(GeometryEnvelope envelope,\n int limit) {\n return queryFeaturesForChunk(envelope, getPkColumnName(), limit);\n }", "public void testQuery() throws Exception {\n DummyApprovalRequest req1 = new DummyApprovalRequest(reqadmin, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);\n DummyApprovalRequest req2 = new DummyApprovalRequest(admin1, null, caid, SecConst.EMPTY_ENDENTITYPROFILE, false);\n DummyApprovalRequest req3 = new DummyApprovalRequest(admin2, null, 3, 2, false);\n\n approvalSessionRemote.addApprovalRequest(admin1, req1, gc);\n approvalSessionRemote.addApprovalRequest(admin1, req2, gc);\n approvalSessionRemote.addApprovalRequest(admin1, req3, gc);\n\n // Make som queries\n Query q1 = new Query(Query.TYPE_APPROVALQUERY);\n q1.add(ApprovalMatch.MATCH_WITH_APPROVALTYPE, BasicMatch.MATCH_TYPE_EQUALS, \"\" + req1.getApprovalType());\n\n List result = approvalSessionRemote.query(admin1, q1, 0, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 2 && result.size() <= 3);\n\n result = approvalSessionRemote.query(admin1, q1, 1, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 1 && result.size() <= 3);\n\n result = approvalSessionRemote.query(admin1, q1, 0, 1, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() == 1);\n\n Query q2 = new Query(Query.TYPE_APPROVALQUERY);\n q2.add(ApprovalMatch.MATCH_WITH_STATUS, BasicMatch.MATCH_TYPE_EQUALS, \"\" + ApprovalDataVO.STATUS_WAITINGFORAPPROVAL, Query.CONNECTOR_AND);\n q2.add(ApprovalMatch.MATCH_WITH_REQUESTADMINCERTSERIALNUMBER, BasicMatch.MATCH_TYPE_EQUALS, reqadmincert.getSerialNumber().toString(16));\n\n result = approvalSessionRemote.query(admin1, q1, 1, 3, \"cAId=\" + caid, \"(endEntityProfileId=\" + SecConst.EMPTY_ENDENTITYPROFILE + \")\");\n assertTrue(\"Result size \" + result.size(), result.size() >= 1 && result.size() <= 3);\n\n // Remove the requests\n int id1 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req1.generateApprovalId()).iterator().next()).getId();\n int id2 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req2.generateApprovalId()).iterator().next()).getId();\n int id3 = ((ApprovalDataVO) approvalSessionRemote.findApprovalDataVO(admin1, req3.generateApprovalId()).iterator().next()).getId();\n approvalSessionRemote.removeApprovalRequest(admin1, id1);\n approvalSessionRemote.removeApprovalRequest(admin1, id2);\n approvalSessionRemote.removeApprovalRequest(admin1, id3);\n }", "public void selectQuery(String query) {\n\t\tQuery q = QueryFactory.create(query);\n\t\tQueryExecution qe = QueryExecutionFactory.create(q, model);\n\t\tResultSet result = qe.execSelect();\n\t\tprintResultSet(result);\n\t\tqe.close();\n\t}", "public interface TradeoffRepository extends GraphRepository<Tradeoff> {\n\n /**\n * Problem occured here, because in the testdata there were multiple tradeoffs with the same over and under -> should not be possible\n * Limit 1 for making sure that only 1 Tradeoff is within the result set.\n * @param idTradeoffItemOver Which Tradeoffitem Over\n * @param idTradeoffItemUnder Which Tradeoffitem Under\n * @return\n */\n @Query(\"MATCH (t:Tradeoff)-[:UNDER]->(under:TradeoffItem), (t)-[:OVER]->(over:TradeoffItem) where id(under) = {1} and id(over) = {0} WITH t LIMIT 1 RETURN t\")\n Tradeoff findTradeoffByTradeoffItems(Long idTradeoffItemOver, Long idTradeoffItemUnder);\n\n}", "public FeatureCursor queryFeaturesForChunk(GeometryEnvelope envelope,\n String where, String[] whereArgs, int limit) {\n return queryFeaturesForChunk(envelope, where, whereArgs,\n getPkColumnName(), limit);\n }", "protected void sequence_FROM_Query(ISerializationContext context, Query semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}", "StatementChain and(ProfileStatement... statements);", "@FixFor( \"MODE-869\" )\n @Test\n public void shouldProducePlanWhenUsingSubquery() {\n schemata = schemataBuilder.addTable(\"someTable\", \"column1\", \"column2\", \"column3\")\n .addTable(\"otherTable\", \"columnA\", \"columnB\").build();\n // Define the subquery command ...\n QueryCommand subquery = builder.select(\"columnA\").from(\"otherTable\").query();\n builder = new QueryBuilder(typeSystem);\n\n // Define the query command (which uses the subquery) ...\n query = builder.selectStar().from(\"someTable\").where().path(\"someTable\").isLike(subquery).end().query();\n initQueryContext();\n plan = planner.createPlan(queryContext, query);\n // print = true;\n print(plan);\n assertThat(problems.hasErrors(), is(false));\n assertThat(problems.isEmpty(), is(true));\n\n // The top node should be the dependent query ...\n assertThat(plan.getType(), is(Type.DEPENDENT_QUERY));\n assertThat(plan.getChildCount(), is(2));\n\n // The first child should be the plan for the subquery ...\n PlanNode subqueryPlan = plan.getFirstChild();\n assertProjectNode(subqueryPlan, \"columnA\");\n assertThat(subqueryPlan.getProperty(Property.VARIABLE_NAME, String.class), is(Subquery.VARIABLE_PREFIX + \"1\"));\n assertThat(subqueryPlan.getChildCount(), is(1));\n assertThat(subqueryPlan.getSelectors(), is(selectors(\"otherTable\")));\n PlanNode subquerySource = subqueryPlan.getFirstChild();\n assertSourceNode(subquerySource, \"otherTable\", null, \"columnA\", \"columnB\");\n assertThat(subquerySource.getChildCount(), is(0));\n\n // The second child should be the plan for the regular query ...\n PlanNode queryPlan = plan.getLastChild();\n assertProjectNode(queryPlan, \"column1\", \"column2\", \"column3\");\n assertThat(queryPlan.getType(), is(PlanNode.Type.PROJECT));\n assertThat(queryPlan.getChildCount(), is(1));\n assertThat(queryPlan.getSelectors(), is(selectors(\"someTable\")));\n PlanNode criteriaNode = queryPlan.getFirstChild();\n assertThat(criteriaNode.getType(), is(PlanNode.Type.SELECT));\n assertThat(criteriaNode.getChildCount(), is(1));\n assertThat(criteriaNode.getSelectors(), is(selectors(\"someTable\")));\n assertThat(criteriaNode.getProperty(Property.SELECT_CRITERIA),\n is((Object)like(nodePath(\"someTable\"), var(Subquery.VARIABLE_PREFIX + \"1\"))));\n\n PlanNode source = criteriaNode.getFirstChild();\n assertSourceNode(source, \"someTable\", null, \"column1\", \"column2\", \"column3\");\n assertThat(source.getChildCount(), is(0));\n }", "public FeatureCursor queryFeaturesForChunk(GeometryEnvelope envelope,\n String where, String orderBy, int limit) {\n return queryFeaturesForChunk(false, envelope, where, orderBy, limit);\n }", "private void checkInlineQueries() throws Exceptions.OsoException, Exceptions.InlineQueryFailedError {\n Ffi.Query nextQuery = ffiPolar.nextInlineQuery();\n while (nextQuery != null) {\n if (!new Query(nextQuery, host).hasMoreElements()) {\n String source = nextQuery.source();\n throw new Exceptions.InlineQueryFailedError(source);\n }\n nextQuery = ffiPolar.nextInlineQuery();\n }\n }", "public FeatureCursor queryFeaturesForChunk(GeometryEnvelope envelope,\n String where, String[] whereArgs, int limit, long offset) {\n return queryFeaturesForChunk(envelope, where, whereArgs,\n getPkColumnName(), limit, offset);\n }", "SqlSelect wrapSelectAndPushOrderBy(SqlNode node) {\n assert node instanceof SqlJoin\n || node instanceof SqlIdentifier\n || node instanceof SqlMatchRecognize\n || node instanceof SqlCall\n && (((SqlCall) node).getOperator() instanceof SqlSetOperator\n || ((SqlCall) node).getOperator() == SqlStdOperatorTable.AS\n || ((SqlCall) node).getOperator() == SqlStdOperatorTable.VALUES)\n : node;\n\n // Migrate the order by clause to the wrapping select statement,\n // if there is no fetch or offset clause accompanying the order by clause.\n SqlNodeList pushUpOrderList = null;\n if ((this.node instanceof SqlSelect) && shouldPushOrderByOut()) {\n SqlSelect selectClause = (SqlSelect) this.node;\n if ((selectClause.getFetch() == null) && (selectClause.getOffset() == null)) {\n pushUpOrderList = selectClause.getOrderList();\n selectClause.setOrderBy(null);\n\n if (node.getKind() == SqlKind.AS && pushUpOrderList != null) {\n // Update the referenced tables of the ORDER BY list to use the alias of the sub-select.\n\n List<SqlNode> selectList = (selectClause.getSelectList() == null)?\n Collections.emptyList() : selectClause.getSelectList().getList();\n\n OrderByAliasProcessor processor = new OrderByAliasProcessor(\n pushUpOrderList, SqlValidatorUtil.getAlias(node, -1), selectList);\n pushUpOrderList = processor.processOrderBy();\n }\n }\n }\n\n SqlNodeList selectList = getSelectList(node);\n\n return new SqlSelect(POS, SqlNodeList.EMPTY, selectList, node, null, null, null,\n SqlNodeList.EMPTY, pushUpOrderList, null, null);\n }" ]
[ "0.51794016", "0.5172465", "0.51546013", "0.51300955", "0.51294535", "0.50884265", "0.49982187", "0.49654195", "0.49580547", "0.49138653", "0.49109137", "0.48987406", "0.4883453", "0.4872609", "0.48671827", "0.48521683", "0.48320463", "0.48302302", "0.48234868", "0.48220164", "0.48171073", "0.4807766", "0.48032734", "0.4762571", "0.47443047", "0.47440973", "0.47347856", "0.47307575", "0.47296357", "0.47275132", "0.47226447", "0.47138274", "0.4709207", "0.47048593", "0.46968484", "0.4693142", "0.46439064", "0.46358892", "0.46351942", "0.4626061", "0.4620829", "0.46152848", "0.46140224", "0.46067342", "0.46019906", "0.45796216", "0.45773992", "0.45722905", "0.45684108", "0.4563674", "0.45566437", "0.45445153", "0.4534786", "0.45255238", "0.45129678", "0.44996664", "0.44984937", "0.44830957", "0.44830486", "0.44791406", "0.44754884", "0.44722578", "0.44666994", "0.44579476", "0.44443718", "0.44440055", "0.44365403", "0.44257027", "0.44250286", "0.44181445", "0.44098133", "0.4408995", "0.4408196", "0.44057274", "0.44010383", "0.4394761", "0.43941545", "0.43916115", "0.43914115", "0.4390226", "0.43898267", "0.43885764", "0.43863034", "0.4379459", "0.43789348", "0.4377012", "0.43732435", "0.43710145", "0.4364749", "0.4364275", "0.43609273", "0.43573093", "0.4350346", "0.43502116", "0.43491548", "0.43465695", "0.4345759", "0.43454272", "0.4344635", "0.43439615", "0.43379948" ]
0.0
-1
Accept an existing WITH statement as predecessor
default With with(final With with) { return with.parent(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ParseTree parseWithStatement() {\n SourcePosition start = getTreeStartLocation();\n eat(TokenType.WITH);\n eat(TokenType.OPEN_PAREN);\n ParseTree expression = parseExpression();\n eat(TokenType.CLOSE_PAREN);\n ParseTree body = parseStatement();\n return new WithStatementTree(getTreeLocation(start), expression, body);\n }", "public interface BeforeWith<T extends BeforeWith<T>> extends QueryPart, QueryPartSQL<T>, QueryPartLinked<T> {\r\n\r\n\t/**\r\n\t * Continue query with WITH\r\n\t *\r\n\t * @param name The name of the with-block\r\n\t * @return The new WITH statement\r\n\t */\r\n\tdefault With with(final String name) {\r\n\t\treturn new With(this, name);\r\n\t}\r\n\r\n\t/**\r\n\t * Accept an existing WITH statement as predecessor\r\n\t *\r\n\t * @param with The existing WITH statement\r\n\t * @return Returns the passed WITH statement\r\n\t */\r\n\tdefault With with(final With with) {\r\n\t\treturn with.parent(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Use plain SQL to form this WITH statement\r\n\t *\r\n\t * @param sql The sql string\r\n\t * @return The new WITH statement\r\n\t */\r\n\tdefault With withSQL(final String sql) {\r\n\t\treturn with((String) null).sql(sql);\r\n\t}\r\n\r\n}", "@Test\n void testExample1() {\n List<Token> input = Arrays.asList(\n new Token(Token.Type.IDENTIFIER, \"LET\", -1),\n new Token(Token.Type.IDENTIFIER, \"first\", -1),\n new Token(Token.Type.OPERATOR, \":\", -1),\n new Token(Token.Type.IDENTIFIER, \"INTEGER\", -1),\n new Token(Token.Type.OPERATOR, \"=\", -1),\n new Token(Token.Type.INTEGER, \"1\", -1),\n new Token(Token.Type.OPERATOR, \";\", -1),\n\n new Token(Token.Type.IDENTIFIER, \"WHILE\", -1),\n new Token(Token.Type.IDENTIFIER, \"first\", -1),\n new Token(Token.Type.OPERATOR, \"!=\", -1),\n new Token(Token.Type.INTEGER, \"10\", -1),\n new Token(Token.Type.IDENTIFIER, \"DO\", -1),\n\n new Token(Token.Type.IDENTIFIER, \"PRINT\", -1),\n new Token(Token.Type.OPERATOR, \"(\", -1),\n new Token(Token.Type.IDENTIFIER, \"first\", -1),\n new Token(Token.Type.OPERATOR, \")\", -1),\n new Token(Token.Type.OPERATOR, \";\", -1),\n\n new Token(Token.Type.IDENTIFIER, \"first\", -1),\n new Token(Token.Type.OPERATOR, \"=\", -1),\n new Token(Token.Type.IDENTIFIER, \"first\", -1),\n new Token(Token.Type.OPERATOR, \"+\", -1),\n new Token(Token.Type.INTEGER, \"1\", -1),\n new Token(Token.Type.OPERATOR, \";\", -1),\n\n new Token(Token.Type.IDENTIFIER, \"END\", -1)\n );\n Ast.Source expected = new Ast.Source(Arrays.asList(\n new Ast.Statement.Declaration(\"first\", \"INTEGER\",\n Optional.of(new Ast.Expression.Literal(BigInteger.valueOf(1)))),\n new Ast.Statement.While(\n new Ast.Expression.Binary(\"!=\",\n new Ast.Expression.Variable(\"first\"),\n new Ast.Expression.Literal(BigInteger.valueOf(10))\n ),\n Arrays.asList(\n new Ast.Statement.Expression(\n new Ast.Expression.Function(\"PRINT\", Arrays.asList(\n new Ast.Expression.Variable(\"first\"))\n )\n ),\n new Ast.Statement.Assignment(\"first\",\n new Ast.Expression.Binary(\"+\",\n new Ast.Expression.Variable(\"first\"),\n new Ast.Expression.Literal(BigInteger.valueOf(1))\n )\n )\n )\n )\n ));\n test(input, expected, Parser::parseSource);\n }", "public final PythonParser.with_stmt_return with_stmt() throws RecognitionException {\n PythonParser.with_stmt_return retval = new PythonParser.with_stmt_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token WITH167=null;\n Token COLON170=null;\n PythonParser.test_return test168 = null;\n\n PythonParser.with_var_return with_var169 = null;\n\n PythonParser.suite_return suite171 = null;\n\n\n PythonTree WITH167_tree=null;\n PythonTree COLON170_tree=null;\n\n\n stmt stype = null;\n\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:977:5: ( WITH test[expr_contextType.Load] ( with_var )? COLON suite[false] )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:977:7: WITH test[expr_contextType.Load] ( with_var )? COLON suite[false]\n {\n root_0 = (PythonTree)adaptor.nil();\n\n WITH167=(Token)match(input,WITH,FOLLOW_WITH_in_with_stmt3957); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n WITH167_tree = (PythonTree)adaptor.create(WITH167);\n adaptor.addChild(root_0, WITH167_tree);\n }\n pushFollow(FOLLOW_test_in_with_stmt3959);\n test168=test(expr_contextType.Load);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) adaptor.addChild(root_0, test168.getTree());\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:977:40: ( with_var )?\n int alt73=2;\n int LA73_0 = input.LA(1);\n\n if ( (LA73_0==NAME||LA73_0==AS) ) {\n alt73=1;\n }\n switch (alt73) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:977:41: with_var\n {\n pushFollow(FOLLOW_with_var_in_with_stmt3963);\n with_var169=with_var();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) adaptor.addChild(root_0, with_var169.getTree());\n\n }\n break;\n\n }\n\n COLON170=(Token)match(input,COLON,FOLLOW_COLON_in_with_stmt3967); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n COLON170_tree = (PythonTree)adaptor.create(COLON170);\n adaptor.addChild(root_0, COLON170_tree);\n }\n pushFollow(FOLLOW_suite_in_with_stmt3969);\n suite171=suite(false);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) adaptor.addChild(root_0, suite171.getTree());\n if ( state.backtracking==0 ) {\n\n stype = new With(WITH167, actions.castExpr((test168!=null?((PythonTree)test168.tree):null)), (with_var169!=null?with_var169.etype:null),\n actions.castStmts((suite171!=null?suite171.stypes:null)));\n \n }\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n if ( state.backtracking==0 ) {\n\n retval.tree = stype;\n\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "public T caseWithClause(WithClause object)\n {\n return null;\n }", "public StatementParse addSubTransform(StatementParse node) {\n\n ArrayList<StatementParse> expanded = this.expandNode(node);\n expanded = this.nonConstantFirst(expanded);\n expanded = this.collapseExpression(expanded);\n expanded = this.positiveFirst(expanded);\n node = this.reconstructTree(expanded);\n return node;\n }", "private void clearPreviouslyVisitedAfterWith(With with) {\n\t\tSet<IdentifiableElement> retain = new HashSet<>();\n\t\tSet<IdentifiableElement> visitedNamed = dequeOfVisitedNamed.peek();\n\t\tif (visitedNamed == null) {\n\t\t\treturn;\n\t\t}\n\t\twith.accept(segment -> {\n\t\t\tif (segment instanceof SymbolicName symbolicName) {\n\t\t\t\tvisitedNamed.stream()\n\t\t\t\t\t.filter(element -> {\n\t\t\t\t\t\tif (element instanceof Named named) {\n\t\t\t\t\t\t\treturn named.getRequiredSymbolicName().equals(segment);\n\t\t\t\t\t\t} else if (element instanceof Aliased aliased) {\n\t\t\t\t\t\t\treturn aliased.getAlias().equals((symbolicName).getValue());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn element.equals(segment);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.forEach(retain::add);\n\t\t\t}\n\t\t});\n\n\t\tretain.addAll(Optional.ofNullable(implicitScope.peek()).orElseGet(Set::of));\n\t\tvisitedNamed.retainAll(retain);\n\t}", "GeneralClauseContinuation createGeneralClauseContinuation();", "public void testWithAndClosure1() throws Exception {\n createUnit(\"p\", \"D\",\n \"package p\\n\" +\n \"class D {\\n\" +\n \" String foo\\n\" +\n \" D bar\\n\" +\n \"}\");\n String contents =\n \"package p\\n\" +\n \"class E {\\n\" +\n \" D d = new D()\\n\" +\n \" void doSomething() {\\n\" +\n \" d.with {\\n\" +\n \" foo = 'foo'\\n\" +\n \" bar = new D()\\n\" +\n \" bar.foo = 'bar'\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\";\n\n int start = contents.indexOf(\"foo\");\n int end = start + \"foo\".length();\n assertType(contents, start, end, \"java.lang.String\");\n\n start = contents.indexOf(\"bar\", end);\n end = start + \"bar\".length();\n assertType(contents, start, end, \"p.D\");\n\n start = contents.indexOf(\"bar\", end);\n end = start + \"bar\".length();\n assertType(contents, start, end, \"p.D\");\n\n start = contents.indexOf(\"foo\", end);\n end = start + \"foo\".length();\n assertType(contents, start, end, \"java.lang.String\");\n }", "private ParseTree parseStatement() {\n return parseSourceElement();\n }", "public T and() { return parent; }", "@Override\n\tpublic void enterDslStatement(AAIDslParser.DslStatementContext ctx) {\n\t\tif (isUnionBeg) {\n\t\t\tisUnionBeg = false;\n\t\t\tisUnionTraversal = true;\n\n\t\t} else if (unionMembers > 0) {\n\t\t\tunionMembers--;\n\t\t\tquery += \",builder.newInstance()\";\n\t\t\tisUnionTraversal = true;\n\t\t}\n\n\t}", "@Override\n public R visit(NamedGraphClause n, A argu) {\n R _ret = null;\n n.nodeToken.accept(this, argu);\n n.sourceSelector.accept(this, argu);\n return _ret;\n }", "@Override\n protected Statement withBeforeClasses(final Statement originalStatement) {\n final Statement onlyBefores = super.withBeforeClasses(new EmptyStatement());\n return new Statement() {\n @Override\n public void evaluate() throws Throwable {\n adaptor.beforeClass(\n Arquillian.this.getTestClass().getJavaClass(),\n new StatementLifecycleExecutor(onlyBefores));\n originalStatement.evaluate();\n }\n };\n }", "public static Source wrap(Source incomplete, String withName, String withContent){\n\n final String content = withContent + incomplete.getContents() + END;\n\n final Source revised = from(incomplete, content);\n if(!revised.getName().equals(withName)){\n revised.setName(withName + \".java\");\n }\n\n return revised;\n }", "WindowingClauseOperandPreceding createWindowingClauseOperandPreceding();", "default With with(final String name) {\r\n\t\treturn new With(this, name);\r\n\t}", "protected LambdaTerm getParent() { return parent; }", "SqlSelect wrapSelectAndPushOrderBy(SqlNode node) {\n assert node instanceof SqlJoin\n || node instanceof SqlIdentifier\n || node instanceof SqlMatchRecognize\n || node instanceof SqlCall\n && (((SqlCall) node).getOperator() instanceof SqlSetOperator\n || ((SqlCall) node).getOperator() == SqlStdOperatorTable.AS\n || ((SqlCall) node).getOperator() == SqlStdOperatorTable.VALUES)\n : node;\n\n // Migrate the order by clause to the wrapping select statement,\n // if there is no fetch or offset clause accompanying the order by clause.\n SqlNodeList pushUpOrderList = null;\n if ((this.node instanceof SqlSelect) && shouldPushOrderByOut()) {\n SqlSelect selectClause = (SqlSelect) this.node;\n if ((selectClause.getFetch() == null) && (selectClause.getOffset() == null)) {\n pushUpOrderList = selectClause.getOrderList();\n selectClause.setOrderBy(null);\n\n if (node.getKind() == SqlKind.AS && pushUpOrderList != null) {\n // Update the referenced tables of the ORDER BY list to use the alias of the sub-select.\n\n List<SqlNode> selectList = (selectClause.getSelectList() == null)?\n Collections.emptyList() : selectClause.getSelectList().getList();\n\n OrderByAliasProcessor processor = new OrderByAliasProcessor(\n pushUpOrderList, SqlValidatorUtil.getAlias(node, -1), selectList);\n pushUpOrderList = processor.processOrderBy();\n }\n }\n }\n\n SqlNodeList selectList = getSelectList(node);\n\n return new SqlSelect(POS, SqlNodeList.EMPTY, selectList, node, null, null, null,\n SqlNodeList.EMPTY, pushUpOrderList, null, null);\n }", "@Override\n\tpublic Void visit(Plus plus) {\n\t\tprintIndent(plus.token.getText());\n\t\tindent++;\n\t\tplus.left.accept(this);\n\t\tplus.right.accept(this);\n\t\tindent--;\n\t\treturn null;\n\t}", "public InsertStatement from(SelectStatement statement) {\r\n return copyOnWriteOrMutate(\r\n b -> b.from(statement),\r\n () -> {\r\n if (fromTable != null) {\r\n throw new UnsupportedOperationException(\"Cannot specify both a source SelectStatement and a source table\");\r\n }\r\n if (!values.isEmpty()) {\r\n throw new UnsupportedOperationException(\"Cannot specify both a source SelectStatement and a set of literal field values.\");\r\n }\r\n this.selectStatement = statement;\r\n }\r\n );\r\n }", "@Override\r\n\tpublic Node visitSequential(SequentialContext ctx) {\n\t\treturn super.visitSequential(ctx);\r\n\t}", "public Snippet visit(ContinueStatement n, Snippet argu) {\n\t\t Snippet _ret = new Snippet(\"\", \"\", null, false);\n\t n.nodeToken.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t _ret.returnTemp = \"continue;\";\n\t\t\ttPlasmaCode+=generateTabs(blockDepth)+_ret.returnTemp+\"\\n\";\n\t return _ret;\n\t }", "SkipStatement createSkipStatement();", "@Override\n public boolean visit(SQLInSubQueryExpr subQuery) {\n subQuery.getExpr().setParent(subQuery);\n return true;\n }", "@Test\n public void testFromClauses() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2), g3\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, 1, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_CROSS);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"g3\");\n \n verifySql(\"SELECT * FROM g1 CROSS JOIN g2, g3\", fileNode);\n }", "private void createEOG(Statement statement) {\n if (statement == null)\n return; // For null statements, and to avoid null checks in every ifelse branch\n this.intermediateNodes.add(statement);\n if (statement instanceof CallExpression) {\n CallExpression callExpression = (CallExpression) statement;\n\n // Todo add call as throwexpression to outer scope of call can throw (which is trivial to find\n // out for java, but impossible for c++)\n\n // evaluate base first, if there is one\n if (callExpression instanceof MemberCallExpression\n && ((MemberCallExpression) callExpression).getBase() instanceof Statement) {\n createEOG((Statement) ((MemberCallExpression) callExpression).getBase());\n }\n\n // first the arguments\n for (Expression arg : callExpression.getArguments()) {\n createEOG(arg);\n }\n\n // then the call itself\n pushToEOG(statement);\n\n // look, whether the function is known to us\n /*\n\n State state = State.getInstance();\n\n todo Reconsider if this is the right thing to do \"Do we want to expressionRefersToDeclaration to the call target?\n todo We might not resolve the appropriate function\". In addition the Return may better expressionRefersToDeclaration to the block\n todo root node instead of just leading to nowhere.\n functionDeclaration = state.findMethod(callExpression);\n if (functionDeclaration != null) {\n // expressionRefersToDeclaration call to function\n State.getInstance().addEOGEdge(callExpression, functionDeclaration);\n\n // expressionRefersToDeclaration all return statements of function to statement after call expression\n State.getInstance().setCurrentEOGs(functionDeclaration.getReturnStatements());\n }*/\n\n } else if (statement instanceof MemberExpression) {\n // analyze the base\n if (((MemberExpression) statement).getBase() instanceof Statement) {\n createEOG((Statement) ((MemberExpression) statement).getBase());\n }\n\n // analyze the member\n if (((MemberExpression) statement).getMember() instanceof Statement) {\n createEOG((Statement) ((MemberExpression) statement).getMember());\n }\n\n pushToEOG(statement);\n\n } else if (statement instanceof ArraySubscriptionExpression) {\n ArraySubscriptionExpression arraySubs = (ArraySubscriptionExpression) statement;\n\n // Connect according to evaluation order, first the array reference, then the contained index.\n createEOG(arraySubs.getArrayExpression());\n createEOG(arraySubs.getSubscriptExpression());\n\n pushToEOG(statement);\n\n } else if (statement instanceof ArrayCreationExpression) {\n ArrayCreationExpression arrayCreate = (ArrayCreationExpression) statement;\n\n for (Expression dimension : arrayCreate.getDimensions())\n if (dimension != null) createEOG(dimension);\n createEOG(arrayCreate.getInitializer());\n\n pushToEOG(statement);\n\n } else if (statement instanceof DeclarationStatement) {\n // loop through declarations\n for (Declaration declaration : ((DeclarationStatement) statement).getDeclarations()) {\n if (declaration instanceof VariableDeclaration) {\n // analyze the initializers if there is one\n handleDeclaration(declaration);\n }\n }\n\n // push statement itself\n pushToEOG(statement);\n } else if (statement instanceof ReturnStatement) {\n // analyze the return value\n createEOG(((ReturnStatement) statement).getReturnValue());\n\n // push the statement itself\n pushToEOG(statement);\n\n // reset the state afterwards, we're done with this function\n currentEOG.clear();\n\n } else if (statement instanceof BinaryOperator) {\n\n BinaryOperator binOp = (BinaryOperator) statement;\n createEOG(binOp.getLhs());\n createEOG(binOp.getRhs());\n\n // push the statement itself\n pushToEOG(statement);\n\n } else if (statement instanceof UnaryOperator) {\n\n Expression input = ((UnaryOperator) statement).getInput();\n createEOG(input);\n if (((UnaryOperator) statement).getOperatorCode().equals(\"throw\")) {\n Type throwType;\n Scope catchingScope =\n lang.getScopeManager()\n .getFirstScopeThat(\n scope -> scope instanceof TryScope || scope instanceof FunctionScope);\n\n if (input != null) {\n throwType = input.getType();\n } else {\n // do not check via instanceof, since we do not want to allow subclasses of\n // DeclarationScope here\n Scope decl =\n lang.getScopeManager()\n .getFirstScopeThat(scope -> scope.getClass().equals(DeclarationScope.class));\n if (decl != null\n && decl.getAstNode() instanceof CatchClause\n && ((CatchClause) decl.getAstNode()).getParameter() != null) {\n throwType = ((CatchClause) decl.getAstNode()).getParameter().getType();\n } else {\n LOGGER.info(\"Unknown throw type, potentially throw; in a method\");\n throwType = new Type(\"UKNOWN_THROW_TYPE\");\n }\n }\n\n pushToEOG(statement);\n if (catchingScope instanceof TryScope) {\n ((TryScope) catchingScope)\n .getCatchesOrRelays()\n .put(throwType, new ArrayList<>(this.currentEOG));\n } else if (catchingScope instanceof FunctionScope) {\n ((FunctionScope) catchingScope)\n .getCatchesOrRelays()\n .put(throwType, new ArrayList<>(this.currentEOG));\n }\n currentEOG.clear();\n } else {\n pushToEOG(statement);\n }\n } else if (statement instanceof CompoundStatement) {\n lang.getScopeManager().enterScope(statement);\n // analyze the contained statements\n for (Statement child : ((CompoundStatement) statement).getStatements()) {\n createEOG(child);\n }\n lang.getScopeManager().leaveScope(statement);\n pushToEOG(statement);\n } else if (statement instanceof CompoundStatementExpression) {\n createEOG(((CompoundStatementExpression) statement).getStatement());\n pushToEOG(statement);\n } else if (statement instanceof IfStatement) {\n IfStatement ifs = (IfStatement) statement;\n List<Node> openBranchNodes = new ArrayList<>();\n lang.getScopeManager().enterScope(statement);\n createEOG(ifs.getInitializerStatement());\n handleDeclaration(ifs.getConditionDeclaration());\n createEOG(ifs.getCondition());\n List<Node> openConditionEOGs = new ArrayList<>(currentEOG);\n createEOG(ifs.getThenStatement());\n openBranchNodes.addAll(currentEOG);\n\n if (ifs.getElseStatement() != null) {\n setCurrentEOGs(openConditionEOGs);\n createEOG(ifs.getElseStatement());\n openBranchNodes.addAll(currentEOG);\n } else openBranchNodes.addAll(openConditionEOGs);\n\n lang.getScopeManager().leaveScope(statement);\n\n setCurrentEOGs(openBranchNodes);\n pushToEOG(statement); // Todo Remove root, if not wanted\n } else if (statement instanceof AssertStatement) {\n AssertStatement ifs = (AssertStatement) statement;\n createEOG(ifs.getCondition());\n List<Node> openConditionEOGs = new ArrayList<>(currentEOG);\n createEOG(ifs.getMessage());\n setCurrentEOGs(openConditionEOGs);\n pushToEOG(statement);\n } else if (statement instanceof WhileStatement) {\n\n lang.getScopeManager().enterScope(statement);\n WhileStatement whs = (WhileStatement) statement;\n\n handleDeclaration(whs.getConditionDeclaration());\n\n createEOG(whs.getCondition());\n List<Node> tmpEOGNodes = new ArrayList<>(currentEOG);\n createEOG(whs.getStatement());\n connectCurrentToLoopStart();\n\n // Replace current EOG nodes without triggering post setEOG ... processing\n currentEOG.clear();\n exitLoop(statement, (LoopScope) lang.getScopeManager().leaveScope(statement));\n\n currentEOG.addAll(tmpEOGNodes);\n\n pushToEOG(statement); // Todo Remove root, if not wanted\n } else if (statement instanceof DoStatement) {\n lang.getScopeManager().enterScope(statement);\n DoStatement dos = (DoStatement) statement;\n\n createEOG(dos.getStatement());\n\n createEOG(dos.getCondition());\n connectCurrentToLoopStart();\n exitLoop(statement, (LoopScope) lang.getScopeManager().leaveScope(statement));\n\n pushToEOG(statement); // Todo Remove root, if not wanted\n } else if (statement instanceof ForStatement) {\n lang.getScopeManager().enterScope(statement);\n ForStatement forStmt = (ForStatement) statement;\n\n createEOG(forStmt.getInitializerStatement());\n handleDeclaration(forStmt.getConditionDeclaration());\n createEOG(forStmt.getCondition());\n\n List<Node> tmpEOGNodes = new ArrayList<>(currentEOG);\n\n createEOG(forStmt.getStatement());\n createEOG(forStmt.getIterationExpression());\n\n connectCurrentToLoopStart();\n currentEOG.clear();\n exitLoop(statement, (LoopScope) lang.getScopeManager().leaveScope(statement));\n\n currentEOG.addAll(tmpEOGNodes);\n\n pushToEOG(statement); // Todo Remove root, if not wanted\n } else if (statement instanceof ForEachStatement) {\n lang.getScopeManager().enterScope(statement);\n ForEachStatement forStmt = (ForEachStatement) statement;\n\n createEOG(forStmt.getIterable());\n handleDeclaration(forStmt.getVariable());\n\n List<Node> tmpEOGNodes = new ArrayList<>(currentEOG);\n\n createEOG(forStmt.getStatement());\n\n connectCurrentToLoopStart();\n currentEOG.clear();\n exitLoop(statement, (LoopScope) lang.getScopeManager().leaveScope(statement));\n\n currentEOG.addAll(tmpEOGNodes);\n\n pushToEOG(statement); // Todo Remove root, if not wanted\n } else if (statement instanceof TryStatement) {\n lang.getScopeManager().enterScope(statement);\n TryScope tryScope = (TryScope) lang.getScopeManager().getCurrentScope();\n TryStatement tryStmt = (TryStatement) statement;\n\n if (tryStmt.getResources() != null) tryStmt.getResources().forEach(this::createEOG);\n createEOG(tryStmt.getTryBlock());\n\n List<Node> tmpEOGNodes = new ArrayList<>(currentEOG);\n\n Map<Type, List<Node>> catchesOrRelays = tryScope.getCatchesOrRelays();\n\n for (CatchClause catchClause : tryStmt.getCatchClauses()) {\n currentEOG.clear();\n // Try to catch all internally thrown exceptions under the catching clause and remove caught\n // ones\n HashSet<Type> toRemove = new HashSet<>();\n for (Map.Entry entry : catchesOrRelays.entrySet()) {\n Type throwType = (Type) entry.getKey();\n List<Node> eogEdges = (List<Node>) entry.getValue();\n if (catchClause.getParameter() == null) { // e.g. catch (...)\n currentEOG.addAll(eogEdges);\n } else if (TypeManager.getInstance()\n .isSupertypeOf(catchClause.getParameter().getType(), throwType)) {\n currentEOG.addAll(eogEdges);\n toRemove.add(throwType);\n }\n }\n toRemove.forEach(catchesOrRelays::remove);\n\n createEOG(catchClause.getBody());\n tmpEOGNodes.addAll(currentEOG);\n }\n boolean canTerminateExceptionfree =\n tmpEOGNodes.stream().anyMatch(EvaluationOrderGraphPass::reachableFromValidEOGRoot);\n\n currentEOG.clear();\n currentEOG.addAll(tmpEOGNodes);\n // connect all try-block, catch-clause and uncought throws eog points to finally start if\n // finally exists\n if (tryStmt.getFinallyBlock() != null) {\n // extends current EOG by all value EOG from open throws\n currentEOG.addAll(\n catchesOrRelays.entrySet().stream()\n .flatMap(entry -> entry.getValue().stream())\n .collect(Collectors.toList()));\n createEOG(tryStmt.getFinallyBlock());\n\n // all current-eog edges , result of finally execution as value List of uncought\n // catchesOrRelaysThrows\n for (Map.Entry entry : catchesOrRelays.entrySet()) {\n ((List) entry.getValue()).clear();\n ((List) entry.getValue()).addAll(this.currentEOG);\n }\n }\n // Forwards all open and uncought throwing nodes to the outer scope that may handle them\n Scope outerScope =\n lang.getScopeManager()\n .getFirstScopeThat(\n lang.getScopeManager().getCurrentScope().getParent(),\n scope -> scope instanceof TryScope || scope instanceof FunctionScope);\n Map outerCatchesOrRelays =\n outerScope instanceof TryScope\n ? ((TryScope) outerScope).getCatchesOrRelays()\n : ((FunctionScope) outerScope).getCatchesOrRelays();\n for (Map.Entry entry : catchesOrRelays.entrySet()) {\n List<Node> catches =\n (List<Node>) outerCatchesOrRelays.getOrDefault(entry.getKey(), new ArrayList<Node>());\n catches.addAll((List<Node>) entry.getValue());\n outerCatchesOrRelays.put(entry.getKey(), catches);\n }\n\n lang.getScopeManager().leaveScope(statement);\n // To Avoid edges out of the finally block to the next regular statement.\n if (!canTerminateExceptionfree) {\n currentEOG.clear();\n }\n\n pushToEOG(statement);\n } else if (statement instanceof ContinueStatement) {\n pushToEOG(statement);\n\n lang.getScopeManager().addContinueStatment((ContinueStatement) statement);\n\n currentEOG.clear();\n\n } else if (statement instanceof DeleteExpression) {\n\n createEOG(((DeleteExpression) statement).getOperand());\n pushToEOG(statement);\n\n } else if (statement instanceof BreakStatement) {\n pushToEOG(statement);\n\n lang.getScopeManager().addBreakStatment((BreakStatement) statement);\n\n currentEOG.clear();\n\n } else if (statement instanceof SwitchStatement) {\n\n SwitchStatement switchStatement = (SwitchStatement) statement;\n\n lang.getScopeManager().enterScope(statement);\n\n createEOG(switchStatement.getInitializerStatement());\n\n handleDeclaration(switchStatement.getSelectorDeclaration());\n\n createEOG(switchStatement.selector);\n\n CompoundStatement compound;\n List<Node> tmp = new ArrayList<>(currentEOG);\n if (switchStatement.getStatement() instanceof DoStatement) {\n createEOG(switchStatement.getStatement());\n compound =\n (CompoundStatement) ((DoStatement) switchStatement.getStatement()).getStatement();\n } else {\n compound = (CompoundStatement) switchStatement.getStatement();\n }\n currentEOG = new ArrayList<>();\n\n for (Statement subStatement : compound.getStatements()) {\n if (subStatement instanceof CaseStatement || subStatement instanceof DefaultStatement)\n currentEOG.addAll(tmp);\n createEOG(subStatement);\n }\n pushToEOG(compound);\n\n SwitchScope switchScope = (SwitchScope) lang.getScopeManager().leaveScope(switchStatement);\n this.currentEOG.addAll(switchScope.getBreakStatements());\n\n pushToEOG(statement);\n } else if (statement instanceof LabelStatement) {\n lang.getScopeManager().addLabelStatement((LabelStatement) statement);\n createEOG(((LabelStatement) statement).getSubStatement());\n } else if (statement instanceof GotoStatement) {\n GotoStatement gotoStatement = (GotoStatement) statement;\n pushToEOG(gotoStatement);\n if (gotoStatement.getTargetLabel() != null)\n lang.registerObjectListener(\n gotoStatement.getTargetLabel(), (from, to) -> addEOGEdge(gotoStatement, (Node) to));\n currentEOG.clear();\n } else if (statement instanceof CaseStatement) {\n createEOG(((CaseStatement) statement).getCaseExpression());\n pushToEOG(statement);\n } else if (statement instanceof SynchronizedStatement) {\n createEOG(((SynchronizedStatement) statement).getExpression());\n createEOG(((SynchronizedStatement) statement).getBlockStatement());\n pushToEOG(statement);\n } else if (statement instanceof EmptyStatement) {\n pushToEOG(statement);\n } else if (statement instanceof Literal) {\n pushToEOG(statement);\n } else if (statement instanceof DefaultStatement) {\n pushToEOG(statement);\n } else if (statement instanceof TypeIdExpression) {\n pushToEOG(statement);\n } else if (statement instanceof NewExpression) {\n NewExpression newStmt = (NewExpression) statement;\n createEOG(newStmt.getInitializer());\n\n pushToEOG(statement);\n } else if (statement instanceof CastExpression) {\n CastExpression castExpr = (CastExpression) statement;\n createEOG(castExpr.getExpression());\n pushToEOG(castExpr);\n } else if (statement instanceof ExpressionList) {\n ExpressionList exprList = (ExpressionList) statement;\n for (Statement expr : exprList.getExpressions()) createEOG(expr);\n\n pushToEOG(statement);\n } else if (statement instanceof ConditionalExpression) {\n ConditionalExpression condExpr = (ConditionalExpression) statement;\n\n List<Node> openBranchNodes = new ArrayList<>();\n createEOG(condExpr.getCondition());\n List<Node> openConditionEOGs = new ArrayList<>(currentEOG);\n createEOG(condExpr.getThenExpr());\n openBranchNodes.addAll(currentEOG);\n\n setCurrentEOGs(openConditionEOGs);\n createEOG(condExpr.getElseExpr());\n openBranchNodes.addAll(currentEOG);\n\n setCurrentEOGs(openBranchNodes);\n pushToEOG(statement); // Todo Remove root, if not wanted\n } else if (statement instanceof InitializerListExpression) {\n InitializerListExpression initList = (InitializerListExpression) statement;\n\n // first the arguments\n for (Expression inits : initList.getInitializers()) {\n createEOG(inits);\n }\n\n pushToEOG(statement);\n } else if (statement instanceof ConstructExpression) {\n ConstructExpression constructExpr = (ConstructExpression) statement;\n\n // first the arguments\n for (Expression arg : constructExpr.getArguments()) {\n createEOG(arg);\n }\n\n pushToEOG(statement);\n } else if (statement instanceof DeclaredReferenceExpression) {\n pushToEOG(statement);\n } else {\n // In this case the ast -> cpg translation has to implement the cpg node creation\n pushToEOG(statement);\n }\n }", "ASTNode rebuild() {\n ASTNode child = null;\n switch (this.type) {\n case \"else if statement\":\n child = children.get(0);\n break;\n\n default:\n }\n\n return this;\n }", "public ASTQuery subCreate(){\r\n\t\tASTQuery ast = create();\r\n\t\tast.setGlobalAST(this);\r\n\t\tast.setNSM(getNSM());\r\n\t\treturn ast;\r\n\t}", "@Override\n protected SyntaxTreeNode rewriteBlock(@Nonnull final BlockBuilder parent, @Nonnull final Block block) {\n final String content = concatNodeContent(block.getChildren());\n\n final SyntaxTreeNode first = parent.getChildren().stream().findFirst().orElse(null);\n assert first != null;\n\n // Create a new span containing this content\n final SpanBuilder span = new SpanBuilder();\n span.setEditHandler(new SpanEditHandler(HtmlTokenizer.createTokenizeDelegate()));\n fillSpan(span, first.getStart(), content);\n return span.build();\n }", "public R visit(HStoreStmt n) {\n R _ret=null;\n n.f0.accept(this);\n Integer temp1 = (Integer)n.f1.accept(this);\n //new\n \tArrayList<Integer> newHold = use.get(statementNumber);\n \tnewHold.add(temp1);\n \t\n //new\n \n \n ArrayList<Integer> hold = null;\n if(temp1 >= arguments){\n\t hold = live.get(temp1);\n\t hold.add(statementNumber);\n\t live.put(temp1, hold);\n }\n n.f2.accept(this);\n\n Integer temp2 = (Integer)n.f3.accept(this);\n //new\n \n newHold.add(temp2);\n use.put(statementNumber, newHold);\n //new\n if(temp2 >= arguments){\n hold = live.get(temp2);\n hold.add(statementNumber);\n live.put(temp2, hold);\n }\n return _ret;\n }", "OperationContinuation createOperationContinuation();", "public void visit(Statement n) {\n n.f0.accept(this);\n }", "private ParseTree parseContinueStatement() {\n SourcePosition start = getTreeStartLocation();\n eat(TokenType.CONTINUE);\n IdentifierToken name = null;\n if (!peekImplicitSemiColon()) {\n name = eatIdOpt();\n }\n eatPossiblyImplicitSemiColon();\n return new ContinueStatementTree(getTreeLocation(start), name);\n }", "StatementChain and(ProfileStatement... statements);", "static void compressTwoNode(ExecutableNodeBase node, ExecutableNodeBase parent) {\n if (!(node instanceof QueryNodeBase) || !(parent instanceof QueryNodeBase)) {\n return;\n }\n QueryNodeBase parentQuery = (QueryNodeBase) parent;\n QueryNodeBase nodeQuery = (QueryNodeBase) node;\n\n // Change the query of parents\n BaseTable placeholderTableinParent =\n ((QueryNodeWithPlaceHolders) parent)\n .getPlaceholderTables()\n .get(parent.getExecutableNodeBaseDependents().indexOf(node));\n ((QueryNodeWithPlaceHolders) parent).getPlaceholderTables().remove(placeholderTableinParent);\n\n // If temp table is in from list of parent, just direct replace with the select query of node\n boolean find = false;\n for (AbstractRelation table : parentQuery.getSelectQuery().getFromList()) {\n if (table instanceof BaseTable && table.equals(placeholderTableinParent)) {\n int index = parentQuery.getSelectQuery().getFromList().indexOf(table);\n nodeQuery\n .getSelectQuery()\n .setAliasName(\n parentQuery.getSelectQuery().getFromList().get(index).getAliasName().get());\n parentQuery.getSelectQuery().getFromList().set(index, nodeQuery.getSelectQuery());\n find = true;\n break;\n } else if (table instanceof JoinTable) {\n for (AbstractRelation joinTable : ((JoinTable) table).getJoinList()) {\n if (joinTable instanceof BaseTable && joinTable.equals(placeholderTableinParent)) {\n int index = ((JoinTable) table).getJoinList().indexOf(joinTable);\n nodeQuery.getSelectQuery().setAliasName(joinTable.getAliasName().get());\n ((JoinTable) table).getJoinList().set(index, nodeQuery.getSelectQuery());\n find = true;\n break;\n }\n }\n if (find) break;\n }\n }\n\n // Otherwise, it need to search filter to find the temp table\n if (!find) {\n List<SubqueryColumn> placeholderTablesinFilter =\n ((QueryNodeWithPlaceHolders) parent).getPlaceholderTablesinFilter();\n for (SubqueryColumn filter : placeholderTablesinFilter) {\n if (filter.getSubquery().getFromList().size() == 1\n && filter.getSubquery().getFromList().get(0).equals(placeholderTableinParent)) {\n filter.setSubquery(nodeQuery.getSelectQuery());\n }\n }\n }\n\n // Move node's placeholderTable to parent's\n ((QueryNodeWithPlaceHolders) parent)\n .placeholderTables.addAll(((QueryNodeWithPlaceHolders) node).placeholderTables);\n\n // Compress the node tree\n parentQuery.cancelSubscriptionTo(nodeQuery);\n for (Pair<ExecutableNodeBase, Integer> s : nodeQuery.getSourcesAndChannels()) {\n parentQuery.subscribeTo(s.getLeft(), s.getRight());\n }\n // parent.getListeningQueues().removeAll(node.broadcastingQueues);\n // parent.getListeningQueues().addAll(node.getListeningQueues());\n // parent.dependents.remove(node);\n // parent.dependents.addAll(node.dependents);\n // for (BaseQueryNode dependent:node.dependents) {\n // dependent.parents.remove(node);\n // dependent.parents.add(parent);\n // }\n }", "@Override\r\n\tpublic Node visitBlock(BlockContext ctx) {\n\t\treturn super.visitBlock(ctx);\r\n\t}", "void coreInsertSiblingsBefore(CoreDocumentFragment fragment) throws HierarchyException, NodeMigrationException, DeferredBuildingException;", "@Override\r\n\tpublic Node visitComposition(CompositionContext ctx) {\n\t\treturn super.visitComposition(ctx);\r\n\t}", "@Override\r\n\tpublic void visit(InstrumentStatement instrumentStatement) {\n\t\t\r\n\t}", "@Override\r\n public void visit(StmtExp n, Graph argu) {\r\n n.f1.accept(this, argu);\r\n\r\n // RETURN is treated as a statement\r\n cur = new Statement(null);\r\n n.f3.accept(this, argu);\r\n argu.addStatement(cur, true);\r\n argu.setRet(n.f3);\r\n }", "void continued(Consumer<First> continuationFirst);", "@Override\n\tpublic void inANewObjExpr(ANewObjExpr node){\n\t\tType resultType = nodeTypes.get(node.getType());\n\t\til.append(fi.createNew(new ObjectType(resultType.getTypeName())));\n\t\til.append(new DUP()); \n\t}", "StatementBlock createStatementBlock();", "public void visit(ContinueStatement n) {\n n.f0.accept(this);\n n.f1.accept(this);\n n.f2.accept(this);\n }", "interface WithIdentity {\n /**\n * Specifies identity.\n * @param identity the identity parameter value\n * @return the next definition stage\n */\n WithCreate withIdentity(Identity identity);\n }", "SemanticRegion<T> outermost();", "public with(final String beginWith) {\n this.beginWith = beginWith;\n }", "private static void transformUsing(SQLParser.UsingContext ctx, String name1, String name2) {\n\n // Back up old contexts\n Token using = (Token) ctx.getToken(SQLParser.USING, 0).getPayload();\n Token lbr = (Token) ctx.getToken(SQLParser.LBR, 0).getPayload();\n ParseTree ids = ctx.columns();\n Token rbr = (Token) ctx.getToken(SQLParser.RBR, 0).getPayload();\n\n // Remove all blocks\n for (int i = ctx.getChildCount(); i > 0; i--) {\n ctx.removeLastChild();\n }\n\n // Convert \"using\" token to \"on\" token\n CommonToken on = (CommonToken) using;\n on.setText(\"on \");\n\n // Convert ids\n ParserRuleContext parserRuleContext = new ParserRuleContext();\n for (int i = 0; i < ids.getChildCount(); i++) {\n CommonToken newId = (CommonToken) ids.getChild(i).getPayload();\n newId.setText(transformColumns(newId, name1, name2));\n parserRuleContext.addChild(newId);\n }\n\n // And replace it with the new block\n ctx.addChild(on);\n ctx.addChild(lbr);\n ctx.addChild(parserRuleContext);\n ctx.addChild(rbr);\n }", "@Test\n @Ignore\n public void testReplaceCommonSubexpression() throws Exception {\n\n checkPlanning( ProjectRemoveRule.INSTANCE, \"select d1.deptno from (select * from dept) d1, (select * from dept) d2\" );\n }", "private Block replaceMethodChain(Block oldBlock) throws LookupException {\n // The defined variables\n Stack<Variable> variables = new Stack<>();\n // The parameter passed to the {@code Constants.CREATE_DOCUMENT} method\n FormalParameter formalParameter = oldBlock.nearestAncestor(Method.class).formalParameter(0);\n variables.push(formalParameter);\n // Use a string as we constantly have to create new NameExpressions\n lastElement = null;\n\n Block block = new Block();\n oldBlock.replaceWith(block);\n Block loneCode = oFactory().createBlock();\n loneCode.setMetadata(new TagImpl(), Neio.LONE_CODE);\n int prevCodeId = -1;\n\n List<Statement> statements = new ArrayList<>(oldBlock.statements());\n for (int i = 0; i < statements.size(); i++) {\n Statement statement = statements.get(i);\n // Is this a block of lonecode\n if (statement.hasMetadata(Neio.LONE_CODE)) {\n int id = ((CodeTag) statement.metadata(Neio.LONE_CODE)).id();\n // New codeblock\n if (loneCode.nbStatements() <= 0) {\n prevCodeId = id;\n }\n // Statement in same block\n if (id == prevCodeId) {\n loneCode.addStatement(statement);\n // Accumulate all of the statements of the lonecode\n if (i < statements.size() - 1) {\n continue;\n }\n // Process the last instruction, aka the last lonecode\n else {\n statement = loneCode;\n }\n }\n // New lonecode\n else {\n prevCodeId = id;\n statement = loneCode;\n // We still have to process the second block\n i--;\n }\n }\n // Set the counter back by one and process the lonecode\n else if (loneCode.nbStatements() > 0) {\n i--;\n statement = loneCode;\n }\n\n // Handles a codeblock if there is one\n statement = fixCodeBlock(block, statement, variables, loneCode);\n if (statement == null) {\n continue;\n }\n\n Stack<RegularMethodInvocation> callStack = new Stack<>();\n // MethodInvocations start from the back so push the invocations on a stack to get the correct order\n RegularMethodInvocation inv;\n Element methodChain = statement;\n while ((inv = getInvocation(methodChain)) != null) {\n callStack.push(inv);\n methodChain = inv;\n if (inv.getTarget() instanceof ThisLiteral) {\n break;\n }\n }\n\n\n breakupMethodChain(callStack, variables, block, methodChain, statement);\n }\n\n return block;\n }", "@FixFor( \"MODE-869\" )\n @Test\n public void shouldProducePlanWhenUsingSubquery() {\n schemata = schemataBuilder.addTable(\"someTable\", \"column1\", \"column2\", \"column3\")\n .addTable(\"otherTable\", \"columnA\", \"columnB\").build();\n // Define the subquery command ...\n QueryCommand subquery = builder.select(\"columnA\").from(\"otherTable\").query();\n builder = new QueryBuilder(typeSystem);\n\n // Define the query command (which uses the subquery) ...\n query = builder.selectStar().from(\"someTable\").where().path(\"someTable\").isLike(subquery).end().query();\n initQueryContext();\n plan = planner.createPlan(queryContext, query);\n // print = true;\n print(plan);\n assertThat(problems.hasErrors(), is(false));\n assertThat(problems.isEmpty(), is(true));\n\n // The top node should be the dependent query ...\n assertThat(plan.getType(), is(Type.DEPENDENT_QUERY));\n assertThat(plan.getChildCount(), is(2));\n\n // The first child should be the plan for the subquery ...\n PlanNode subqueryPlan = plan.getFirstChild();\n assertProjectNode(subqueryPlan, \"columnA\");\n assertThat(subqueryPlan.getProperty(Property.VARIABLE_NAME, String.class), is(Subquery.VARIABLE_PREFIX + \"1\"));\n assertThat(subqueryPlan.getChildCount(), is(1));\n assertThat(subqueryPlan.getSelectors(), is(selectors(\"otherTable\")));\n PlanNode subquerySource = subqueryPlan.getFirstChild();\n assertSourceNode(subquerySource, \"otherTable\", null, \"columnA\", \"columnB\");\n assertThat(subquerySource.getChildCount(), is(0));\n\n // The second child should be the plan for the regular query ...\n PlanNode queryPlan = plan.getLastChild();\n assertProjectNode(queryPlan, \"column1\", \"column2\", \"column3\");\n assertThat(queryPlan.getType(), is(PlanNode.Type.PROJECT));\n assertThat(queryPlan.getChildCount(), is(1));\n assertThat(queryPlan.getSelectors(), is(selectors(\"someTable\")));\n PlanNode criteriaNode = queryPlan.getFirstChild();\n assertThat(criteriaNode.getType(), is(PlanNode.Type.SELECT));\n assertThat(criteriaNode.getChildCount(), is(1));\n assertThat(criteriaNode.getSelectors(), is(selectors(\"someTable\")));\n assertThat(criteriaNode.getProperty(Property.SELECT_CRITERIA),\n is((Object)like(nodePath(\"someTable\"), var(Subquery.VARIABLE_PREFIX + \"1\"))));\n\n PlanNode source = criteriaNode.getFirstChild();\n assertSourceNode(source, \"someTable\", null, \"column1\", \"column2\", \"column3\");\n assertThat(source.getChildCount(), is(0));\n }", "ForStatement(AST ast) {\n super(ast); }", "public Token nextToken() throws TokenStreamException\r\n {\r\n Token token = null;\r\n int type;\r\n\r\n int returnCount = 0;\r\n /*\r\n * First skip over whitespace/comments\r\n */\r\n do {\r\n token = getNextToken();\r\n type = token.getType();\r\n\r\n if (type == MExprANTLRParserTokenTypes.WHITESPACE) {\r\n if (\"\\n\".equals(token.getText()))\r\n returnCount++;\r\n }\r\n \r\n \r\n } while ((!tokenIndexStore_ && type == MExprANTLRParserTokenTypes.COMMENT)\r\n || type == MExprANTLRParserTokenTypes.WHITESPACE \r\n || fTypesetParse && whiteSpaceTypeset(token));\r\n\r\n /*\r\n * Now check for semi as the last token.\r\n */\r\n if (lastExprToken != null\r\n && lastExprToken.getType() == MExprANTLRParserTokenTypes.SEMI)\r\n token = fixSEMI(token, returnCount > 0 && nestingLevel == 0);\r\n\r\n boolean incrementNestingLevel = false;\r\n int lastNestingLevel = nestingLevel;\r\n /*\r\n * Now fix up individual tokens.\r\n */\r\n switch (token.getType()) {\r\n \tcase MExprANTLRParserTokenTypes.LONGNAME:\r\n \t\ttoken = fixLongName( token);\r\n \t\tbreak;\r\n \r\n case MExprANTLRParserTokenTypes.MINUS:\r\n if (!tokenCanEnd(lastExprToken) || tokenIsPrefix(lastExprToken))\r\n token.setType(MExprANTLRParserTokenTypes.UNARYMINUS);\r\n break;\r\n\r\n case MExprANTLRParserTokenTypes.PLUS:\r\n if (!tokenCanEnd(lastExprToken) || tokenIsPrefix(lastExprToken))\r\n token.setType(MExprANTLRParserTokenTypes.UNARYPLUS);\r\n break;\r\n\r\n case MExprANTLRParserTokenTypes.AMP:\r\n token = fixPostfix(\"AMPXX\", MExprANTLRParserTokenTypes.AMPINFIX,\r\n token);\r\n break;\r\n\r\n case MExprANTLRParserTokenTypes.DERIVATIVE:\r\n token = fixPostfix(\"DERIVATIVEXX\", MExprANTLRParserTokenTypes.DERIVATIVEINFIX,\r\n token);\r\n break;\r\n\r\n case MExprANTLRParserTokenTypes.SET:\r\n token = fixSET(token);\r\n break;\r\n\r\n case MExprANTLRParserTokenTypes.REPEATED:\r\n token = fixPostfix(\"REPEATEDXX\", MExprANTLRParserTokenTypes.REPEATEDINFIX,\r\n token);\r\n break;\r\n\r\n case MExprANTLRParserTokenTypes.REPEATEDNULL:\r\n token = fixPostfix(\"REPEATEDNULLXX\", MExprANTLRParserTokenTypes.REPEATEDNULLINFIX,\r\n token);\r\n break;\r\n\r\n\t/*\r\n\t * Convert EXCLAM into prefix NOT or postfix FACTORIAL.\r\n\t * \r\n\t * Turns into NOT if lastToken is an infix or a prefix.\r\n\t * If lastToken can end or is not a prefix becomes NOT\r\n\t * a + !b, + ! a, \r\n\t * \r\n * Also if last token can end and we have returnCount/lastNestingLevel\r\n * set then we will be inserting a PACKAGE token and this will become \r\n * NOT, so the real test is (a + b) || !a || !c which equals b || !a || !c\r\n */\r\n case MExprANTLRParserTokenTypes.EXCLAM:\r\n if ((returnCount > 0 && lastNestingLevel <= 0) || !tokenCanEnd(lastExprToken) || tokenIsPrefix( lastExprToken)) {\r\n token.setType(MExprANTLRParserTokenTypes.NOT);\r\n }\r\n else {\r\n \ttoken = fixPostfix(\"EXCLAM\", MExprANTLRParserTokenTypes.NOTINFIX,\r\n token);\r\n }\r\n break;\r\n \r\n /*\r\n * See EXCLAM\r\n */\r\n case MExprANTLRParserTokenTypes.EXCLAM2:\r\n if ((returnCount > 0 && lastNestingLevel <= 0) || !tokenCanEnd(lastExprToken) || tokenIsPrefix(lastExprToken)) {\r\n token.setType(MExprANTLRParserTokenTypes.NOTNOT);\r\n }\r\n else {\r\n \ttoken = fixPostfix(\"EXCLAM2\", MExprANTLRParserTokenTypes.NOTNOTINFIX,\r\n token);\r\n }\r\n break;\r\n \r\n\r\n case MExprANTLRParserTokenTypes.PLUSPLUS:\r\n if (tokenCanEnd(lastExprToken) && !tokenIsPrefix(lastExprToken))\r\n token = fixPostfix(\"PLUSPLUSXX\", MExprANTLRParserTokenTypes.PLUSPLUSINFIX,\r\n token);\r\n break;\r\n \r\n case MExprANTLRParserTokenTypes.MINUSMINUS:\r\n if (tokenCanEnd(lastExprToken) && !tokenIsPrefix(lastExprToken))\r\n token = fixPostfix(\"MINUSMINUSXX\", MExprANTLRParserTokenTypes.MINUSMINUSINFIX,\r\n token);\r\n break;\r\n\r\n case MExprANTLRParserTokenTypes.COMMA:\r\n token = fixThisComma(token);\r\n break;\r\n\r\n\r\n case MExprANTLRParserTokenTypes.LPAREN:\r\n case MExprANTLRParserTokenTypes.LBRACE:\r\n case MExprANTLRParserTokenTypes.LBRACKET:\r\n \tincrementNestingLevel = true;\r\n break;\r\n\r\n \r\n case MExprANTLRParserTokenTypes.RPAREN:\r\n nestingLevel--;\r\n \tbreak;\r\n\r\n case MExprANTLRParserTokenTypes.RBRACE:\r\n case MExprANTLRParserTokenTypes.RBRACKET:\r\n \ttoken = fixLastComma( token);\r\n \tif ( token.getType() != MExprANTLRParserTokenTypes.NULLID)\r\n \t\tnestingLevel--;\r\n \t\tbreak;\r\n \r\n case MExprANTLRParserTokenTypes.ID:\r\n token = fixID( token);\r\n \tbreak;\r\n \r\n case MExprANTLRParserTokenTypes.BLANK1:\r\n case MExprANTLRParserTokenTypes.BLANK2:\r\n case MExprANTLRParserTokenTypes.BLANK3:\r\n token = fixBLANK( token);\r\n \tbreak;\r\n\r\n case MExprANTLRParserTokenTypes.EQUALEXCLAM:\r\n \ttoken = fixEQUALEXCLAM( token);\r\n \tbreak;\r\n\r\n case MExprANTLRParserTokenTypes.TYPESETOPEN:\r\n token = fixTypesetOpen(token);\r\n break;\r\n\r\n case MExprANTLRParserTokenTypes.TYPESETSPACE:\r\n return nextToken();\r\n\r\n }\r\n\r\n /*\r\n * The test for Comment is here because tokenCanStart does not \r\n * return True for Comment (this would mess up all sorts of \r\n * other things).\r\n * \r\n * If this changes see EXCLAM\r\n */\r\n if (returnCount > 0 && lastNestingLevel <= 0 && tokenCanEnd(lastExprToken)\r\n //&& (tokenCanStart(token) || \r\n //\t\ttoken.getType() == MExprANTLRParserTokenTypes.COMMENT)\r\n ) {\r\n pushToken(token);\r\n int lim = getLimit( lastExprToken, token);\r\n token = makeToken(MExprANTLRParserTokenTypes.PACKAGE, \"Package\", lastExprToken);\r\n setLimit( token, lim);\r\n nestingLevel = 0;\r\n }\r\n else if ( incrementNestingLevel) {\r\n \tnestingLevel++;\r\n }\r\n \r\n if ( token.getType() != MExprANTLRParserTokenTypes.COMMENT) {\r\n \tlastExprToken = token;\r\n }\r\n \r\n//\t\t// LOCATION: added this\r\n // this must happen here instead of the ExprLexer because this TokenStream\r\n // changes the token count;\r\n if ( tokenIndexStore_)\r\n \t((MExprToken)token).tokenIndex_ = currTokenIndex_++;\r\n else\r\n \t((MExprToken)token).tokenIndex_ = -1;\r\n return token;\r\n }", "@Test\r\n\tpublic void testGetStatementsInMultipleContexts()\r\n\t\tthrows Exception\r\n\t{\r\n\t\tURI ur = vf.createURI(\"http://abcd\");\r\n\t\t\r\n\t\t\r\n\t\tCloseableIteration<? extends Statement, RepositoryException> iter1 = testAdminCon.getStatements(null, null, null, false, null);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter1.hasNext()) {\r\n\t\t\t\titer1.next();\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be 0 statements\", 0 , count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer1.close();\r\n\t\t\titer1 = null;\r\n\t\t}\r\n\t\t\r\n\t\ttestAdminCon.begin();\r\n\t\ttestAdminCon.add(micah, lname, micahlname, dirgraph1);\r\n\t\ttestAdminCon.add(micah, fname, micahfname, dirgraph1);\r\n\t\ttestAdminCon.add(micah, homeTel, micahhomeTel, dirgraph1);\r\n\t\ttestAdminCon.add(dirgraph1, ur, vf.createLiteral(\"test\"));\r\n\t\ttestAdminCon.commit();\r\n\r\n\t\t// get statements with either no context or dirgraph1\r\n\t\tCloseableIteration<? extends Statement, RepositoryException> iter = testAdminCon.getStatements(null, null,\r\n\t\t\t\tnull, false, null , dirgraph1);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(), anyOf(is(nullValue(Resource.class)), is(equalTo((Resource)dirgraph1))));\r\n\t\t\t}\r\n\r\n\t\t\tassertEquals(\"there should be four statements\", 4, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\t\t\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, dirgraph1, dirgraph);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph1)));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be three statements\", 3 , count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\t\t\r\n\r\n\t\t// get all statements with unknownContext or context2.\r\n\t\tURI unknownContext = testAdminCon.getValueFactory().createURI(\"http://unknownContext\");\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, unknownContext, dirgraph1);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tcount++;\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph1)));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be three statements\", 3, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\r\n\t\t// add statements to dirgraph\r\n\t\ttry{\r\n\t\t\ttestAdminCon.begin();\r\n\t\t\ttestAdminCon.add(john, fname, johnfname, dirgraph);\r\n\t\t\ttestAdminCon.add(john, lname, johnlname, dirgraph);\r\n\t\t\ttestAdminCon.add(john, homeTel, johnhomeTel, dirgraph);\r\n\t\t\ttestAdminCon.commit();\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif(testAdminCon.isActive())\r\n\t\t\t\ttestAdminCon.rollback();\r\n\t\t}\r\n\t\t\t\r\n\t\t// get statements with either no context or dirgraph\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, null, dirgraph);\r\n\t\ttry {\r\n\t\t\tassertThat(iter, is(notNullValue()));\r\n\t\t\tassertThat(iter.hasNext(), is(equalTo(true)));\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(), anyOf(is(nullValue(Resource.class)), is(equalTo((Resource)dirgraph)) ));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be four statements\", 4, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\t\t\r\n\t\t// get all statements with dirgraph or dirgraph1\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, null, dirgraph, dirgraph1);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(),\r\n\t\t\t\t\t\tanyOf(is(nullValue(Resource.class)),is(equalTo((Resource)dirgraph)), is(equalTo((Resource)dirgraph1))));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be 7 statements\", 7, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\r\n\t\t// get all statements with dirgraph or dirgraph1\r\n\t\titer = testAdminCon.getStatements(null, null, null, false, dirgraph, dirgraph1);\r\n\r\n\t\ttry {\r\n\t\t\tint count = 0;\r\n\t\t\twhile (iter.hasNext()) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tStatement st = iter.next();\r\n\t\t\t\tassertThat(st.getContext(),\r\n\t\t\t\t\t\tanyOf(is(equalTo((Resource)dirgraph)), is(equalTo((Resource)dirgraph1))));\r\n\t\t\t}\r\n\t\t\tassertEquals(\"there should be 6 statements\", 6, count);\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\titer.close();\r\n\t\t\titer = null;\r\n\t\t}\r\n\t\t\r\n}", "@Override\n protected GraphTraversal translateImpl(GraphTraversal traversal, PlanWithCost<Plan, PlanDetailedCost> plan, PlanOp planOp, TranslationContext context) {\n RelationFilterOp relationFilterOp = (RelationFilterOp) planOp;\n Optional<RelationOp> relationOp = PlanUtil.adjacentPrev(plan.getPlan(), relationFilterOp);\n if (!relationOp.isPresent()) {\n return traversal;\n }\n\n TraversalUtil.remove(traversal, TraversalUtil.lastConsecutiveSteps(traversal, HasStep.class));\n\n traversal = appendRelationAndPropertyGroup(\n traversal,\n relationOp.get().getAsgEbase().geteBase(),\n relationFilterOp.getAsgEbase().geteBase(),\n context.getOnt());\n\n return traversal;\n }", "@Override\n\tpublic void preVisit(ASTNode node) {\n\t\tnodeList.add(node);\n\t}", "public boolean isWith() {\n return true;\n }", "public ContextNodeStatement getStatement();", "WindowingClauseOperandFollowing createWindowingClauseOperandFollowing();", "public interface SemagrowQuery extends Query {\n\n TupleExpr getDecomposedQuery() throws QueryDecompositionException;\n\n void addExcludedSource(URI source);\n\n void addIncludedSource(URI source);\n\n Collection<URI> getExcludedSources();\n\n Collection<URI> getIncludedSources();\n}", "CompoundStatement createCompoundStatement();", "ParenthesisExpr createParenthesisExpr();", "SemanticRegion<T> parent();", "@Override\n public R visit(SparqlSpin n, A argu) {\n R _ret = null;\n n.prologue.accept(this, argu);\n n.nodeList.accept(this, argu);\n return _ret;\n }", "@Test\n \tpublic void whereClauseForNodeSibling() {\n \t\tnode23.addJoin(new Sibling(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_rank23.parent\", \"_rank42.parent\"),\n \t\t\t\tjoin(\"=\", \"_component23.type\", \"'d'\"),\n\t\t\t\t\"_component23.name IS NULL\"\n \t\t);\n \t}", "protected void addToParent(RuleDirectedParser parser, IScriptToken token)\n {\n IScriptToken parent = (IScriptToken) parser.peek();\n \n parent.addToken(token);\n }", "@Override\n\tpublic WhereNode getParent() {\n\t\treturn parent;\n\t}", "protected void mergeWith(BasicBlock succ) {\n if (this.start_states[succ.getID()] == null) {\n if (TRACE_INTRA) out.println(succ+\" not yet visited.\");\n this.start_states[succ.getID()] = this.s.copy();\n this.change = true;\n } else {\n //if (TRACE_INTRA) out.println(\"merging out set of \"+bb+\" \"+Strings.hex8(this.s.hashCode())+\" into in set of \"+succ+\" \"+Strings.hex8(this.start_states[succ.getID()].hashCode()));\n if (TRACE_INTRA) out.println(\"merging out set of \"+bb+\" into in set of \"+succ);\n if (this.start_states[succ.getID()].merge(this.s)) {\n if (TRACE_INTRA) out.println(succ+\" in set changed\");\n this.change = true;\n }\n }\n }", "public void applyToAncestors( Operation operation ) {\n PlanNode ancestor = getParent();\n while (ancestor != null) {\n operation.apply(ancestor);\n ancestor = ancestor.getParent();\n }\n }", "@Override\r\n\tpublic boolean manipulate() {\n\t\tStatement statement = mp.getStatement();\r\n\t\tStatement ingredStatementCopy = (Statement) ASTNode.copySubtree(statement.getAST(), ingredStatement);\r\n\t\trewriter.replace(statement, ingredStatementCopy, null);\r\n\t\treturn true;\r\n\t}", "static AST getChainParent(JavaNode node)\n {\n JavaNode parent = node.getParent();\n\n switch (parent.getType())\n {\n case JavaTokenTypes.EXPR :\n\n /**\n * @todo maybe more operators make sense?\n */\n case JavaTokenTypes.PLUS :\n //case JavaTokenTypes.NOT_EQUAL:\n //case JavaTokenTypes.EQUAL:\n return getChainParent(parent);\n\n default :\n return parent;\n }\n }", "public final void rule__RelativeTransformation__Group__1__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:6143:1: ( ( 'with' ) )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:6144:1: ( 'with' )\n {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:6144:1: ( 'with' )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:6145:1: 'with'\n {\n before(grammarAccess.getRelativeTransformationAccess().getWithKeyword_1()); \n match(input,55,FOLLOW_55_in_rule__RelativeTransformation__Group__1__Impl12442); \n after(grammarAccess.getRelativeTransformationAccess().getWithKeyword_1()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public default StreamPlus<DATA> prependWith(Stream<DATA> head) {\n return StreamPlus.concat(StreamPlus.from(head), streamPlus());\n }", "@NonNull\n @Override\n public <ContinuationResultT> Task<ContinuationResultT> continueWith(\n @NonNull Continuation<ResultT, ContinuationResultT> continuation) {\n return continueWithImpl(null, continuation);\n }", "WindowingClause createWindowingClause();", "AnalyticClause createAnalyticClause();", "@FixFor( \"MODE-869\" )\n @Test\n public void shouldProducePlanWhenUsingSubqueryInSubquery() {\n schemata = schemataBuilder.addTable(\"someTable\", \"column1\", \"column2\", \"column3\")\n .addTable(\"otherTable\", \"columnA\", \"columnB\").addTable(\"stillOther\", \"columnX\", \"columnY\")\n .build();\n // Define the innermost subquery command ...\n QueryCommand subquery2 = builder.select(\"columnY\").from(\"stillOther\").where().propertyValue(\"stillOther\", \"columnX\")\n .isLessThan().cast(3).asLong().end().query();\n builder = new QueryBuilder(typeSystem);\n\n // Define the outer subquery command ...\n QueryCommand subquery1 = builder.select(\"columnA\").from(\"otherTable\").where().propertyValue(\"otherTable\", \"columnB\")\n .isEqualTo(subquery2).end().query();\n builder = new QueryBuilder(typeSystem);\n\n // Define the query command (which uses the subquery) ...\n query = builder.selectStar().from(\"someTable\").where().path(\"someTable\").isLike(subquery1).end().query();\n initQueryContext();\n plan = planner.createPlan(queryContext, query);\n // print = true;\n print(plan);\n assertThat(problems.hasErrors(), is(false));\n assertThat(problems.isEmpty(), is(true));\n\n // The top node should be the dependent query ...\n assertThat(plan.getType(), is(Type.DEPENDENT_QUERY));\n assertThat(plan.getChildCount(), is(2));\n\n // The first child of the top node should be a dependent query ...\n PlanNode depQuery1 = plan.getFirstChild();\n assertThat(depQuery1.getType(), is(PlanNode.Type.DEPENDENT_QUERY));\n assertThat(depQuery1.getChildCount(), is(2));\n\n // The first child should be the plan for the 2nd subquery (since it has to be executed first) ...\n PlanNode subqueryPlan2 = depQuery1.getFirstChild();\n assertProjectNode(subqueryPlan2, \"columnY\");\n assertThat(subqueryPlan2.getProperty(Property.VARIABLE_NAME, String.class), is(Subquery.VARIABLE_PREFIX + \"2\"));\n assertThat(subqueryPlan2.getChildCount(), is(1));\n assertThat(subqueryPlan2.getSelectors(), is(selectors(\"stillOther\")));\n PlanNode criteriaNode2 = subqueryPlan2.getFirstChild();\n assertThat(criteriaNode2.getType(), is(PlanNode.Type.SELECT));\n assertThat(criteriaNode2.getChildCount(), is(1));\n assertThat(criteriaNode2.getSelectors(), is(selectors(\"stillOther\")));\n assertThat(criteriaNode2.getProperty(Property.SELECT_CRITERIA),\n is((Object)lessThan(property(\"stillOther\", \"columnX\"), literal(3L))));\n PlanNode subquerySource2 = criteriaNode2.getFirstChild();\n assertSourceNode(subquerySource2, \"stillOther\", null, \"columnX\", \"columnY\");\n assertThat(subquerySource2.getChildCount(), is(0));\n\n // The second child of the dependent query should be the plan for the subquery ...\n PlanNode subqueryPlan1 = depQuery1.getLastChild();\n assertProjectNode(subqueryPlan1, \"columnA\");\n assertThat(subqueryPlan1.getProperty(Property.VARIABLE_NAME, String.class), is(Subquery.VARIABLE_PREFIX + \"1\"));\n assertThat(subqueryPlan1.getChildCount(), is(1));\n assertThat(subqueryPlan1.getSelectors(), is(selectors(\"otherTable\")));\n PlanNode criteriaNode1 = subqueryPlan1.getFirstChild();\n assertThat(criteriaNode1.getType(), is(PlanNode.Type.SELECT));\n assertThat(criteriaNode1.getChildCount(), is(1));\n assertThat(criteriaNode1.getSelectors(), is(selectors(\"otherTable\")));\n assertThat(criteriaNode1.getProperty(Property.SELECT_CRITERIA),\n is((Object)equals(property(\"otherTable\", \"columnB\"), var(Subquery.VARIABLE_PREFIX + \"2\"))));\n PlanNode subquerySource1 = criteriaNode1.getFirstChild();\n assertSourceNode(subquerySource1, \"otherTable\", null, \"columnA\", \"columnB\");\n assertThat(subquerySource1.getChildCount(), is(0));\n\n // The second child of the top node should be the plan for the regular query ...\n PlanNode queryPlan = plan.getLastChild();\n assertProjectNode(queryPlan, \"column1\", \"column2\", \"column3\");\n assertThat(queryPlan.getType(), is(PlanNode.Type.PROJECT));\n assertThat(queryPlan.getChildCount(), is(1));\n assertThat(queryPlan.getSelectors(), is(selectors(\"someTable\")));\n PlanNode criteriaNode = queryPlan.getFirstChild();\n assertThat(criteriaNode.getType(), is(PlanNode.Type.SELECT));\n assertThat(criteriaNode.getChildCount(), is(1));\n assertThat(criteriaNode.getSelectors(), is(selectors(\"someTable\")));\n assertThat(criteriaNode.getProperty(Property.SELECT_CRITERIA),\n is((Object)like(nodePath(\"someTable\"), var(Subquery.VARIABLE_PREFIX + \"1\"))));\n\n PlanNode source = criteriaNode.getFirstChild();\n assertSourceNode(source, \"someTable\", null, \"column1\", \"column2\", \"column3\");\n assertThat(source.getChildCount(), is(0));\n }", "@Test\n public void test3() throws Exception {\n String query = \"A =LOAD 'file.txt' AS (a:(u,v), b, c);\" +\n \"B = FOREACH A GENERATE $0, b;\" +\n \"C = FILTER B BY 8 > 5;\" +\n \"STORE C INTO 'empty';\"; \n LogicalPlan newLogicalPlan = buildPlan( query );\n\n Operator load = newLogicalPlan.getSources().get( 0 );\n Assert.assertTrue( load instanceof LOLoad );\n Operator filter = newLogicalPlan.getSuccessors( load ).get( 0 );\n Assert.assertTrue( filter instanceof LOFilter );\n Operator fe1 = newLogicalPlan.getSuccessors( filter ).get( 0 );\n Assert.assertTrue( fe1 instanceof LOForEach );\n Operator fe2 = newLogicalPlan.getSuccessors( fe1 ).get( 0 );\n Assert.assertTrue( fe2 instanceof LOForEach );\n }", "Optional<Node<UnderlyingData>> prevNode(Node<UnderlyingData> node);", "public interface StatementContext {\n\n @SuppressWarnings(\"HardCodedStringLiteral\")\n enum Expression {\n /**\n * Please note that this tuple might not always resolve to the domain controller. For some edge cases (e.g. when the\n * current user is assigned to a host scoped role which is scoped to a secondary host), this tuple is resolved to the\n * first host which was read during bootstrap. In any case it is resolved to an existing host.\n * <p>\n * Address templates which use this tuple must be prepared that it does not always resolve to the domain controller.\n */\n DOMAIN_CONTROLLER(\"domain.controller\", HOST), SELECTED_PROFILE(\"selected.profile\", PROFILE), SELECTED_GROUP(\n \"selected.group\", SERVER_GROUP), SELECTED_HOST(\"selected.host\", HOST), SELECTED_SERVER_CONFIG(\n \"selected.server-config\", SERVER_CONFIG), SELECTED_SERVER(\"selected.server\", SERVER);\n\n private final String name;\n private final String resource;\n\n Expression(String name, String resource) {\n this.name = name;\n this.resource = resource;\n }\n\n public String resource() {\n return resource;\n }\n\n /** @return the {@code name} surrounded by \"{\" and \"}\" */\n public String expression() {\n return \"{\" + name + \"}\";\n }\n\n public static Expression from(String name) {\n for (Expression t : Expression.values()) {\n if (t.name.equals(name)) {\n return t;\n }\n }\n return null;\n }\n }\n\n StatementContext NOOP = new StatementContext() {\n\n @Override\n public String resolve(String placeholder, AddressTemplate template) {\n return placeholder;\n }\n\n @Override\n public String[] resolveTuple(String placeholder, AddressTemplate template) {\n return new String[] { placeholder, placeholder };\n }\n\n @Override\n public String domainController() {\n return null;\n }\n\n @Override\n public String selectedProfile() {\n return null;\n }\n\n @Override\n public String selectedServerGroup() {\n return null;\n }\n\n @Override\n public String selectedHost() {\n return null;\n }\n\n @Override\n public String selectedServerConfig() {\n return null;\n }\n\n @Override\n public String selectedServer() {\n return null;\n }\n };\n\n /** Resolves a single value. */\n String resolve(String placeholder, AddressTemplate template);\n\n /** Resolves a tuple. */\n String[] resolveTuple(String placeholder, AddressTemplate template);\n\n /** @return the domain controller */\n String domainController();\n\n /** @return the selected profile */\n String selectedProfile();\n\n /** @return the selected server group */\n String selectedServerGroup();\n\n /** @return the selected host */\n String selectedHost();\n\n /** @return the selected server config */\n String selectedServerConfig();\n\n /** @return the selected server */\n String selectedServer();\n}", "public static Statement build(LinkedListTree ast) {\n\t\tswitch (ast.getType()) {\n\t\t\tcase AS3Parser.BLOCK:\n\t\t\t\treturn new ASTStatementList(ast);\n\t\t\tcase AS3Parser.DO:\n\t\t\t\treturn new ASTASDoWhileStatement(ast);\n\t\t\tcase AS3Parser.EXPR_STMNT:\n\t\t\t\treturn new ASTASExpressionStatement(ast);\n\t\t\tcase AS3Parser.FOR_EACH:\n\t\t\t\treturn new ASTASForEachInStatement(ast);\n\t\t\tcase AS3Parser.FOR_IN:\n\t\t\t\treturn new ASTASForInStatement(ast);\n\t\t\tcase AS3Parser.FOR:\n\t\t\t\treturn new ASTASForStatement(ast);\n\t\t\tcase AS3Parser.IF:\n\t\t\t\treturn new ASTASIfStatement(ast);\n\t\t\tcase AS3Parser.SWITCH:\n\t\t\t\treturn new ASTASSwitchStatement(ast);\n\t\t\tcase AS3Parser.CONST:\n\t\t\tcase AS3Parser.VAR:\n\t\t\t\treturn new ASTASDeclarationStatement(ast);\n\t\t\tcase AS3Parser.WHILE:\n\t\t\t\treturn new ASTASWhileStatement(ast);\n\t\t\tcase AS3Parser.WITH:\n\t\t\t\treturn new ASTASWithStatement(ast);\n\t\t\tcase AS3Parser.RETURN:\n\t\t\t\treturn new ASTASReturnStatement(ast);\n\t\t\tcase AS3Parser.SUPER:\n\t\t\t\treturn new ASTASSuperStatement(ast);\n\t\t\tcase AS3Parser.BREAK:\n\t\t\t\treturn new ASTASBreakStatement(ast);\n\t\t\tcase AS3Parser.TRY:\n\t\t\t\treturn new ASTASTryStatement(ast);\n\t\t\tcase AS3Parser.DEFAULT_XML_NAMESPACE:\n\t\t\t\treturn new ASTASDefaultXMLNamespaceStatement(ast);\n\t\t\tcase AS3Parser.CONTINUE:\n\t\t\t\treturn new ASTASContinueStatement(ast);\n\t\t\tcase AS3Parser.THROW:\n\t\t\t\treturn new ASTASThrowStatement(ast);\n\t\t\tdefault:\n\t\t\t\tthrow new SyntaxException(\"Unsupported statement node type: \"+ASTUtils.tokenName(ast)+\" in \"+ActionScriptFactory.str(ASTUtils.stringifyNode(ast)));\n\t\t}\n\t}", "Expression unaryExpressionNotPlusMinus() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tif (isKind(OP_EXCLAMATION)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e = unaryExpression();\r\n\t\t\treturn new ExpressionUnary(first,op,e);\r\n\t\t} else \t{\r\n\t\t\treturn primary(); //errors will be reported by primary()\r\n\t\t}\r\n\t}", "@Override\n public Expression<?> visit(SubQueryExpression<?> expr, @Nullable Void context) {\n return expr;\n }", "protected void enterBlockStmt(BlockStmt blockStmt) {\n enclosingBlocks.addFirst(blockStmt);\n if (blockStmt.introducesNewScope()) {\n pushScope();\n }\n }", "@Override\n public R visit(Query n, A argu) {\n R _ret = null;\n n.prologue.accept(this, argu);\n n.nodeChoice.accept(this, argu);\n return _ret;\n }", "String getCTE();", "String getCTE();", "String getCTE();", "String getCTE();", "@Override\r\n public PlanNode makePlan(SelectClause selClause,\r\n List<SelectClause> enclosingSelects) {\r\n\r\n // For HW1, we have a very simple implementation that defers to\r\n // makeSimpleSelect() to handle simple SELECT queries with one table,\r\n // and an optional WHERE clause.\r\n\r\n PlanNode plan = null;\r\n\r\n if (enclosingSelects != null && !enclosingSelects.isEmpty()) {\r\n throw new UnsupportedOperationException(\r\n \"Not implemented: enclosing queries\");\r\n }\r\n\r\n FromClause fromClause = selClause.getFromClause();\r\n // case for when no From clause is present. Creates a ProjectNode.\r\n if (fromClause == null) {\r\n plan = new ProjectNode(selClause.getSelectValues());\r\n plan.prepare();\r\n return plan;\r\n }\r\n // implementation of our ExpressionProcessor\r\n AggregateFinder processor = new AggregateFinder();\r\n\r\n List<SelectValue> selectValues = selClause.getSelectValues();\r\n // call helper function to recursively handle From Clause\r\n plan = processFromClause(fromClause, selClause, processor);\r\n Expression whereExpr = selClause.getWhereExpr();\r\n if (whereExpr != null){\r\n whereExpr.traverse(processor);\r\n if (!processor.aggregates.isEmpty()) {\r\n throw new InvalidSQLException(\"Can't have aggregates in WHERE\\n\");\r\n }\r\n plan = PlanUtils.addPredicateToPlan(plan, whereExpr);\r\n }\r\n\r\n\r\n for (SelectValue sv : selectValues) {\r\n // Skip select-values that aren't expressions\r\n if (!sv.isExpression())\r\n continue;\r\n\r\n Expression e = sv.getExpression().traverse(processor);\r\n sv.setExpression(e);\r\n }\r\n\r\n Map<String, FunctionCall> colMap = processor.initMap();\r\n\r\n List<Expression> groupByExprs = selClause.getGroupByExprs();\r\n\r\n\r\n if (!groupByExprs.isEmpty() || !colMap.isEmpty()){\r\n plan = new HashedGroupAggregateNode(plan, groupByExprs, colMap);\r\n }\r\n\r\n Expression havingExpr = selClause.getHavingExpr();\r\n if (havingExpr != null){\r\n havingExpr.traverse(processor);\r\n selClause.setHavingExpr(havingExpr);\r\n plan = PlanUtils.addPredicateToPlan(plan, havingExpr);\r\n }\r\n\r\n\r\n\r\n List<OrderByExpression> orderByExprs = selClause.getOrderByExprs();\r\n if (orderByExprs.size() > 0){\r\n // need to do something about order by clause.\r\n plan = new SortNode(plan, orderByExprs);\r\n }\r\n\r\n if (!selClause.isTrivialProject())\r\n plan = new ProjectNode(plan, selectValues);\r\n\r\n plan.prepare();\r\n return plan;\r\n }", "@Test\n public void test2() throws Exception {\n String query = \"A =LOAD 'file.txt' AS (a:(u,v), b, c);\" +\n \"B = FOREACH A GENERATE $0, b;\" +\n \"C = FILTER B BY \" + SIZE.class.getName() +\"(TOTUPLE(*)) > 5;\" +\n \"STORE C INTO 'empty';\"; \n LogicalPlan newLogicalPlan = buildPlan( query );\n\n Operator load = newLogicalPlan.getSources().get( 0 );\n Assert.assertTrue( load instanceof LOLoad );\n Operator fe1 = newLogicalPlan.getSuccessors( load ).get( 0 );\n Assert.assertTrue( fe1 instanceof LOForEach );\n Operator filter = newLogicalPlan.getSuccessors( fe1 ).get( 0 );\n Assert.assertTrue( filter instanceof LOFilter );\n Operator fe2 = newLogicalPlan.getSuccessors( filter ).get( 0 );\n Assert.assertTrue( fe2 instanceof LOForEach );\n }", "@Override\n\tpublic Void visit(Program program) {\n\t\tprintIndent(\"program\");\n indent++;\n for (var stmt : program.stmts) {\n \tstmt.accept(this);\n }\n indent--;\n\t\treturn null;\n\t}", "public final void mK_WITH() throws RecognitionException {\n try {\n int _type = K_WITH;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:486:7: ( W I T H )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:486:16: W I T H\n {\n mW(); \n mI(); \n mT(); \n mH(); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Test\n \tpublic void whereClauseForNodeSameSpan() {\n \t\tnode23.addJoin(new SameSpan(node42));\n \t\tcheckWhereCondition(\n \t\t\t\tjoin(\"=\", \"_node23.text_ref\", \"_node42.text_ref\"),\n \t\t\t\tjoin(\"=\", \"_node23.left\", \"_node42.left\"),\n \t\t\t\tjoin(\"=\", \"_node23.right\", \"_node42.right\")\n \t\t);\n \t}", "@Override\n public void setParent(IStatement _statement) {\n\t this._parent = _statement;\n }", "ASTNode clone(AST target) {\n ForStatement result = new ForStatement(target);\n result.setLeadingComment(getLeadingComment());\n result.initializers().addAll(ASTNode.copySubtrees(target, initializers()));\n result.setExpression(\n (Expression) ASTNode.copySubtree(target, getExpression()));\n result.updaters().addAll(ASTNode.copySubtrees(target, updaters()));\n result.setBody(\n (Statement) ASTNode.copySubtree(target, getBody()));\n return result; }", "@Override\n\tpublic Void visit(ClauseImport clause, Void ctx) {\n\t\treturn null;\n\t}", "public abstract OperatorImpl getParent();", "void visit(PlusExpression expression);" ]
[ "0.6766358", "0.6666881", "0.49690145", "0.49477813", "0.4942035", "0.493057", "0.48435014", "0.48421955", "0.48006582", "0.47915897", "0.47484758", "0.46888533", "0.46482936", "0.46227553", "0.46044135", "0.45949382", "0.45571828", "0.45243528", "0.45065513", "0.44965035", "0.4490097", "0.4485328", "0.44474897", "0.44368285", "0.4429337", "0.44246662", "0.44088283", "0.44085607", "0.43747112", "0.43381703", "0.4330739", "0.4330187", "0.432877", "0.43284708", "0.4321408", "0.4311718", "0.43111694", "0.4305107", "0.42949957", "0.42763427", "0.42686203", "0.42672488", "0.4260536", "0.42541105", "0.42522925", "0.42494154", "0.42486712", "0.424564", "0.42432785", "0.42227322", "0.42221677", "0.4213988", "0.42130637", "0.42006904", "0.41883913", "0.41874135", "0.41834474", "0.41825116", "0.41773188", "0.41715539", "0.41700444", "0.41633192", "0.41501245", "0.41485858", "0.4147307", "0.4144936", "0.41441095", "0.41432378", "0.41371018", "0.412787", "0.41273978", "0.41231307", "0.4121809", "0.41177934", "0.4117199", "0.41171622", "0.41166416", "0.41158444", "0.41142404", "0.41142303", "0.41138935", "0.41126177", "0.41105488", "0.41090953", "0.41074422", "0.4098241", "0.40922642", "0.40922642", "0.40922642", "0.40922642", "0.40907624", "0.40906435", "0.408727", "0.4086777", "0.40858185", "0.4084045", "0.40811715", "0.40801358", "0.40747136", "0.4071753" ]
0.5486227
2
Use plain SQL to form this WITH statement
default With withSQL(final String sql) { return with((String) null).sql(sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SELECT createSELECT();", "public interface BeforeWith<T extends BeforeWith<T>> extends QueryPart, QueryPartSQL<T>, QueryPartLinked<T> {\r\n\r\n\t/**\r\n\t * Continue query with WITH\r\n\t *\r\n\t * @param name The name of the with-block\r\n\t * @return The new WITH statement\r\n\t */\r\n\tdefault With with(final String name) {\r\n\t\treturn new With(this, name);\r\n\t}\r\n\r\n\t/**\r\n\t * Accept an existing WITH statement as predecessor\r\n\t *\r\n\t * @param with The existing WITH statement\r\n\t * @return Returns the passed WITH statement\r\n\t */\r\n\tdefault With with(final With with) {\r\n\t\treturn with.parent(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Use plain SQL to form this WITH statement\r\n\t *\r\n\t * @param sql The sql string\r\n\t * @return The new WITH statement\r\n\t */\r\n\tdefault With withSQL(final String sql) {\r\n\t\treturn with((String) null).sql(sql);\r\n\t}\r\n\r\n}", "private ParseTree parseWithStatement() {\n SourcePosition start = getTreeStartLocation();\n eat(TokenType.WITH);\n eat(TokenType.OPEN_PAREN);\n ParseTree expression = parseExpression();\n eat(TokenType.CLOSE_PAREN);\n ParseTree body = parseStatement();\n return new WithStatementTree(getTreeLocation(start), expression, body);\n }", "protected void generateFromClause( WrqInfo wrqInfo, SQLStatementWithParams sqlStatement ) throws BindingException\n {\n sqlStatement.append(\" FROM \");\n WrqBindingSet bs = wrqInfo.getResultingBindingSet();\n resolvedBindingSets.addAll(bs.getResolvedBindingSets());\n sqlStatement.append(wrqInfo.getSQLSelectWithParams()); \n }", "@Override\n protected void load() {\n //recordId can be null when in batchMode\n if (this.recordId != null && this.properties.isEmpty()) {\n this.sqlgGraph.tx().readWrite();\n if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().getBatchManager().isStreaming()) {\n throw new IllegalStateException(\"streaming is in progress, first flush or commit before querying.\");\n }\n\n //Generate the columns to prevent 'ERROR: cached plan must not change result type\" error'\n //This happens when the schema changes after the statement is prepared.\n @SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n EdgeLabel edgeLabel = this.sqlgGraph.getTopology().getSchema(this.schema).orElseThrow(() -> new IllegalStateException(String.format(\"Schema %s not found\", this.schema))).getEdgeLabel(this.table).orElseThrow(() -> new IllegalStateException(String.format(\"EdgeLabel %s not found\", this.table)));\n StringBuilder sql = new StringBuilder(\"SELECT\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n appendProperties(edgeLabel, sql);\n List<VertexLabel> outForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getOutVertexLabels()) {\n outForeignKeys.add(vertexLabel);\n sql.append(\", \");\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.OUT_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.OUT_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.OUT_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n List<VertexLabel> inForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getInVertexLabels()) {\n sql.append(\", \");\n inForeignKeys.add(vertexLabel);\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.IN_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.IN_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.IN_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n sql.append(\"\\nFROM\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.schema));\n sql.append(\".\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(EDGE_PREFIX + this.table));\n sql.append(\" WHERE \");\n //noinspection Duplicates\n if (edgeLabel.hasIDPrimaryKey()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n sql.append(\" = ?\");\n } else {\n int count = 1;\n for (String identifier : edgeLabel.getIdentifiers()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(identifier));\n sql.append(\" = ?\");\n if (count++ < edgeLabel.getIdentifiers().size()) {\n sql.append(\" AND \");\n }\n\n }\n }\n if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {\n sql.append(\";\");\n }\n Connection conn = this.sqlgGraph.tx().getConnection();\n if (logger.isDebugEnabled()) {\n logger.debug(sql.toString());\n }\n try (PreparedStatement preparedStatement = conn.prepareStatement(sql.toString())) {\n if (edgeLabel.hasIDPrimaryKey()) {\n preparedStatement.setLong(1, this.recordId.sequenceId());\n } else {\n int count = 1;\n for (Comparable identifierValue : this.recordId.getIdentifiers()) {\n preparedStatement.setObject(count++, identifierValue);\n }\n }\n ResultSet resultSet = preparedStatement.executeQuery();\n if (resultSet.next()) {\n loadResultSet(resultSet, inForeignKeys, outForeignKeys);\n }\n } catch (SQLException e) {\n throw new RuntimeException(e);\n }\n }\n }", "private void appendSelectStatement() {\n builder.append(SELECT).append(getSelectedFields()).append(FROM);\n }", "SelectQuery createSelectQuery();", "@Override\r\n public StringBuilder getWhereStatement(BuildingContext context, StringBuilder targetAlias, List<Object> params) {\n AbstractMsSQLDatabaseDialect dialect = (AbstractMsSQLDatabaseDialect)context.getDialect(); \r\n String schemaName;\r\n try{\r\n schemaName = dialect.getSchemaName();\r\n }catch(Exception e){\r\n throw new RuntimeException(\"Failed to get schema name from MSSQL Dialect\", e);\r\n }\r\n \r\n StringBuilder statement = new StringBuilder((schemaName.length() != 0 ? schemaName+\".\" : \"\"))\r\n .append(\"PREAD\")\r\n .append(\"(\")\r\n .append(QueryUtils.asPrefix(targetAlias)).append(dialect.convertColumnName(Constants.FIELD_ID))\r\n .append(\",\")\r\n .append(QueryUtils.asPrefix(targetAlias)).append(dialect.convertColumnName(Constants.TABLE_NODE__SECURITY_ID))\r\n .append(\",?,?,?,?)>0\");\r\n\r\n \r\n Collection<String> groups = context.getSession().getGroupIDs();\r\n Collection<String> contexts = context.getSession().getContextIDs();\r\n StringBuffer groupNames = new StringBuffer();\r\n int i = 0;\r\n for(String group:groups){\r\n if(i++>0) {\r\n groupNames.append(',');\r\n }\r\n \r\n groupNames.append(dialect.convertStringToSQL(group));\r\n }\r\n \r\n StringBuffer contextNames = new StringBuffer();\r\n i = 0;\r\n for(String c:contexts){\r\n if(i++>0)\r\n contextNames.append(',');\r\n \r\n contextNames.append(dialect.convertStringToSQL(c));\r\n }\r\n \r\n \r\n params.add(dialect.convertStringToSQL(context.getSession().getUserID()));\r\n params.add(groupNames.toString());\r\n params.add(contextNames.toString());\r\n params.add(context.isAllowBrowse());\r\n \r\n return statement;\r\n }", "default With with(final With with) {\r\n\t\treturn with.parent(this);\r\n\t}", "protected void decorateSQL(Statement stmt) throws SQLException\n {\n getConnection();\n\n // create a table with some data\n stmt.executeUpdate(\n \"CREATE TABLE foo (a int, b char(100))\");\n stmt.execute(\"insert into foo values (1, 'hello world')\");\n stmt.execute(\"insert into foo values (2, 'happy world')\");\n stmt.execute(\"insert into foo values (3, 'sad world')\");\n stmt.execute(\"insert into foo values (4, 'crazy world')\");\n for (int i=0 ; i<7 ; i++)\n stmt.execute(\"insert into foo select * from foo\");\n stmt.execute(\"create index fooi on foo(a, b)\");\n }", "public SelectStatement() {\n\t\tthis.columnSpecs = new ArrayList<>();\n\t}", "@Override\n public PlainSqlQuery<T, ID> createPlainSqlQuery() {\n return null;\n }", "private ASTQuery() {\r\n dataset = Dataset.create();\r\n }", "@Test\n public void testPartlyQuotedGroup() throws Exception {\n String sql = \"SELECT a from db.\\\"g\\\" where a = 5\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"a\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, \"db.g\");\n\n Node criteriaNode = verify(queryNode, Query.CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n verifyElementSymbol(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, \"a\");\n verifyConstant(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, 5);\n \n verifySql(\"SELECT a FROM db.g WHERE a = 5\", fileNode);\n }", "public abstract Statement queryToRetrieveData();", "@Override\n SqlSelect wrapSelect(SqlNode node) {\n throw new UnsupportedOperationException();\n }", "@Test\n public void testSelectAll() throws Exception {\n String sql = \"SELECT ALL a FROM g\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"a\");\n verifyProperty(selectNode, Select.DISTINCT_PROP_NAME, false);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"g\");\n\n verifySql(\"SELECT a FROM g\", fileNode);\n }", "protected void createSelectStatement() throws Exception\n {\n selectStatement = new SQLStatementWithParams();\n\n // Generate the SQL and collect all host variables needed to execute it later\n generateSelectClause( wrqInfo, selectStatement );\n generateFromClause( wrqInfo, selectStatement );\n generateWhereClause( wrqInfo, selectStatement );\n generateGroupingClause( wrqInfo, selectStatement );\n generateHavingClause( wrqInfo, selectStatement );\n generateOrderClause( wrqInfo, selectStatement );\n }", "DataSet sql(SQLContext context, String sql);", "GroupQuery createQuery();", "public abstract void applyToQuery(DatabaseQuery theQuery, GenerationContext context);", "SqlSelect wrapSelectAndPushOrderBy(SqlNode node) {\n assert node instanceof SqlJoin\n || node instanceof SqlIdentifier\n || node instanceof SqlMatchRecognize\n || node instanceof SqlCall\n && (((SqlCall) node).getOperator() instanceof SqlSetOperator\n || ((SqlCall) node).getOperator() == SqlStdOperatorTable.AS\n || ((SqlCall) node).getOperator() == SqlStdOperatorTable.VALUES)\n : node;\n\n // Migrate the order by clause to the wrapping select statement,\n // if there is no fetch or offset clause accompanying the order by clause.\n SqlNodeList pushUpOrderList = null;\n if ((this.node instanceof SqlSelect) && shouldPushOrderByOut()) {\n SqlSelect selectClause = (SqlSelect) this.node;\n if ((selectClause.getFetch() == null) && (selectClause.getOffset() == null)) {\n pushUpOrderList = selectClause.getOrderList();\n selectClause.setOrderBy(null);\n\n if (node.getKind() == SqlKind.AS && pushUpOrderList != null) {\n // Update the referenced tables of the ORDER BY list to use the alias of the sub-select.\n\n List<SqlNode> selectList = (selectClause.getSelectList() == null)?\n Collections.emptyList() : selectClause.getSelectList().getList();\n\n OrderByAliasProcessor processor = new OrderByAliasProcessor(\n pushUpOrderList, SqlValidatorUtil.getAlias(node, -1), selectList);\n pushUpOrderList = processor.processOrderBy();\n }\n }\n }\n\n SqlNodeList selectList = getSelectList(node);\n\n return new SqlSelect(POS, SqlNodeList.EMPTY, selectList, node, null, null, null,\n SqlNodeList.EMPTY, pushUpOrderList, null, null);\n }", "default With with(final String name) {\r\n\t\treturn new With(this, name);\r\n\t}", "@Test\n public void testAliasesInFrom() throws Exception {\n String sql = \"SELECT myG.*, myH.b FROM g AS myG, h AS myH\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node meSymbolNode = verify(selectNode, Select.SYMBOLS_REF_NAME, 1, MultipleElementSymbol.ID);\n Node groupSymbolNode = verify(meSymbolNode, MultipleElementSymbol.GROUP_REF_NAME, GroupSymbol.ID);\n verifyProperty(groupSymbolNode, Symbol.NAME_PROP_NAME, \"myG\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"myH\", \"h\");\n \n verifySql(sql, fileNode);\n }", "@Test\n public void testHiddenAliasesInFrom() throws Exception {\n String sql = \"SELECT myG.*, myH.b FROM g myG, h myH\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node meSymbolNode = verify(selectNode, Select.SYMBOLS_REF_NAME, 1, MultipleElementSymbol.ID);\n Node groupSymbolNode = verify(meSymbolNode, MultipleElementSymbol.GROUP_REF_NAME, GroupSymbol.ID);\n verifyProperty(groupSymbolNode, Symbol.NAME_PROP_NAME, \"myG\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"myH\", \"h\");\n\n verifySql(\"SELECT myG.*, myH.b FROM g AS myG, h AS myH\", fileNode);\n }", "List<Transaction> selectByExample(TransactionExample example);", "Statement createStatement();", "Statement createStatement();", "Statement createStatement();", "protected JPAQuery<T> createQuery() {\n\t\tJPAQuery<T> query = new JPAQuery<>(entityManager);\n\t\tquery.from(getDslRoot());\n\t\treturn query;\n\t}", "@Override\n public SqlSelect asSelect() {\n if (node instanceof SqlSelect) {\n return (SqlSelect) node;\n }\n if (node.isA(SqlKind.SET_QUERY) || isSubQuery() || !dialect.hasImplicitTableAlias()) {\n return wrapSelectAndPushOrderBy(asFrom());\n }\n return wrapSelectAndPushOrderBy(node);\n }", "DataSet sql(HiveContext context, String sql);", "@Override\r\n public PlanNode makePlan(SelectClause selClause,\r\n List<SelectClause> enclosingSelects) {\r\n\r\n // For HW1, we have a very simple implementation that defers to\r\n // makeSimpleSelect() to handle simple SELECT queries with one table,\r\n // and an optional WHERE clause.\r\n\r\n PlanNode plan = null;\r\n\r\n if (enclosingSelects != null && !enclosingSelects.isEmpty()) {\r\n throw new UnsupportedOperationException(\r\n \"Not implemented: enclosing queries\");\r\n }\r\n\r\n FromClause fromClause = selClause.getFromClause();\r\n // case for when no From clause is present. Creates a ProjectNode.\r\n if (fromClause == null) {\r\n plan = new ProjectNode(selClause.getSelectValues());\r\n plan.prepare();\r\n return plan;\r\n }\r\n // implementation of our ExpressionProcessor\r\n AggregateFinder processor = new AggregateFinder();\r\n\r\n List<SelectValue> selectValues = selClause.getSelectValues();\r\n // call helper function to recursively handle From Clause\r\n plan = processFromClause(fromClause, selClause, processor);\r\n Expression whereExpr = selClause.getWhereExpr();\r\n if (whereExpr != null){\r\n whereExpr.traverse(processor);\r\n if (!processor.aggregates.isEmpty()) {\r\n throw new InvalidSQLException(\"Can't have aggregates in WHERE\\n\");\r\n }\r\n plan = PlanUtils.addPredicateToPlan(plan, whereExpr);\r\n }\r\n\r\n\r\n for (SelectValue sv : selectValues) {\r\n // Skip select-values that aren't expressions\r\n if (!sv.isExpression())\r\n continue;\r\n\r\n Expression e = sv.getExpression().traverse(processor);\r\n sv.setExpression(e);\r\n }\r\n\r\n Map<String, FunctionCall> colMap = processor.initMap();\r\n\r\n List<Expression> groupByExprs = selClause.getGroupByExprs();\r\n\r\n\r\n if (!groupByExprs.isEmpty() || !colMap.isEmpty()){\r\n plan = new HashedGroupAggregateNode(plan, groupByExprs, colMap);\r\n }\r\n\r\n Expression havingExpr = selClause.getHavingExpr();\r\n if (havingExpr != null){\r\n havingExpr.traverse(processor);\r\n selClause.setHavingExpr(havingExpr);\r\n plan = PlanUtils.addPredicateToPlan(plan, havingExpr);\r\n }\r\n\r\n\r\n\r\n List<OrderByExpression> orderByExprs = selClause.getOrderByExprs();\r\n if (orderByExprs.size() > 0){\r\n // need to do something about order by clause.\r\n plan = new SortNode(plan, orderByExprs);\r\n }\r\n\r\n if (!selClause.isTrivialProject())\r\n plan = new ProjectNode(plan, selectValues);\r\n\r\n plan.prepare();\r\n return plan;\r\n }", "public With as(Select select) {\n\t\tgetLast().setSelect(Objects.requireNonNull(select, \"select cannot be null\"));\n\t\treturn this;\n\t}", "void rewrite(MySqlSelectQueryBlock query);", "AnalyticClause createAnalyticClause();", "private Builder() {\n super(org.apache.gora.cascading.test.storage.TestRow.SCHEMA$);\n }", "protected String applyLocks(String sql, LockOptions lockOptions, Dialect dialect) throws HibernateException {\n \t\treturn sql;\n \t}", "public NestedClause getXQueryClause();", "abstract protected String buildSQL(BatchSQLEnum sql);", "protected abstract NativeSQLStatement createNativeEnvelopeStatement();", "@Override\n\tpublic void enterDslStatement(AAIDslParser.DslStatementContext ctx) {\n\t\tif (isUnionBeg) {\n\t\t\tisUnionBeg = false;\n\t\t\tisUnionTraversal = true;\n\n\t\t} else if (unionMembers > 0) {\n\t\t\tunionMembers--;\n\t\t\tquery += \",builder.newInstance()\";\n\t\t\tisUnionTraversal = true;\n\t\t}\n\n\t}", "private static void transformUsing(SQLParser.UsingContext ctx, String name1, String name2) {\n\n // Back up old contexts\n Token using = (Token) ctx.getToken(SQLParser.USING, 0).getPayload();\n Token lbr = (Token) ctx.getToken(SQLParser.LBR, 0).getPayload();\n ParseTree ids = ctx.columns();\n Token rbr = (Token) ctx.getToken(SQLParser.RBR, 0).getPayload();\n\n // Remove all blocks\n for (int i = ctx.getChildCount(); i > 0; i--) {\n ctx.removeLastChild();\n }\n\n // Convert \"using\" token to \"on\" token\n CommonToken on = (CommonToken) using;\n on.setText(\"on \");\n\n // Convert ids\n ParserRuleContext parserRuleContext = new ParserRuleContext();\n for (int i = 0; i < ids.getChildCount(); i++) {\n CommonToken newId = (CommonToken) ids.getChild(i).getPayload();\n newId.setText(transformColumns(newId, name1, name2));\n parserRuleContext.addChild(newId);\n }\n\n // And replace it with the new block\n ctx.addChild(on);\n ctx.addChild(lbr);\n ctx.addChild(parserRuleContext);\n ctx.addChild(rbr);\n }", "@Test\n public void testFromClauses() throws Exception {\n String sql = \"SELECT * FROM (g1 cross join g2), g3\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, 1, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_CROSS);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g1\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g2\");\n\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 2, \"g3\");\n \n verifySql(\"SELECT * FROM g1 CROSS JOIN g2, g3\", fileNode);\n }", "public void withWhiteCompoundPk() {\n _query.xdoNss(() -> _query.queryWhiteCompoundPk());\n }", "public Iterable<Todo> select(TodoQuery t){\n\t return (select(t.getStatement()));\n\t}", "public IEntityBacked query(SqlStatement sql) throws DataStoreException {\r\n \t\tlogger.warn(\"Naive implementation - considerable performance problems!\");\r\n \r\n \t\tConnection connection;\r\n \t\ttry {\r\n \t\t\tconnection = getConnection();\r\n \t\t\tStatement createStatement = connection.createStatement();\r\n \t\t\tResultSet executeQuery = createStatement.executeQuery(sql.getCommandText());\r\n \t\t\treturn new IEntityBacked(executeQuery, connection);\r\n \t\t} catch (SQLException e) {\r\n \t\t\tthrow new DataStoreException(e);\r\n \t\t}\r\n \t}", "@Test\n public void testLeftOuterJoinWithAliases() throws Exception {\n String sql = \"Select myG.a myA, myH.b from g myG left outer join h myH on myG.x=myH.x\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyAliasSymbolWithElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, \"myA\", \"myG.a\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_LEFT_OUTER);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"myH\", \"h\");\n\n Node criteriaNode = verify(jpNode, JoinPredicate.JOIN_CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n\n Node leftExpression = verify(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(leftExpression, Symbol.NAME_PROP_NAME, \"myG.x\");\n\n Node rightExpression = verify(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(rightExpression, Symbol.NAME_PROP_NAME, \"myH.x\");\n \n verifySql(\"SELECT myG.a AS myA, myH.b FROM g AS myG LEFT OUTER JOIN h AS myH ON myG.x = myH.x\", fileNode);\n }", "public Builder clearOwnStatement() {\n \n ownStatement_ = false;\n onChanged();\n return this;\n }", "protected String generateSQL() {\n String fields = generateFieldsJSON();\n return String.format(QUERY_PATTERN, fields, esQuery.generateQuerySQL(), from, size);\n }", "@Test void testInterpretOrder() {\n final String sql = \"select y\\n\"\n + \"from (values (1, 'a'), (2, 'b'), (3, 'c')) as t(x, y)\\n\"\n + \"order by -x\";\n sql(sql).withProject(true).returnsRows(\"[c]\", \"[b]\", \"[a]\");\n }", "@Test\n public void testAliasInFrom() throws Exception {\n String sql = \"SELECT myG.a FROM g AS myG\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, \"myG.a\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"myG\", \"g\");\n \n verifySql(sql, fileNode);\n }", "@Test\n public void testHeterogeneousSegmentFilterConditionLimit() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n // val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\"\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\"\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\"\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\"\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\"\n // \n val sql = \"with T1 as (select cal_dt, trans_id \\n\" + \"from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" + \"group by cal_dt, trans_id)\\n\";\n\n {\n val sqlWithTooManyOrs = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 12) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 13) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 14) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 15) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 16) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 17) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 18) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 19) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 20)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithTooManyOrs);\n Assert.assertEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n {\n val sqlWithFilter = sql + \" select * from T1 where \" + \"(cal_dt='2012-01-01' and trans_id = 1) or \\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 2) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 3) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 4) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 5) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 6) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 7) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 8) or\\n\" + \"(cal_dt='2012-01-01' and trans_id = 9) or\\n\"\n + \"(cal_dt='2012-01-01' and trans_id = 10)\";\n val contexts = OlapContextTestUtil.getOlapContexts(project, sqlWithFilter);\n Assert.assertNotEquals(\n \">=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-01),<=(DEFAULT.TEST_KYLIN_FACT.CAL_DT, 2012-01-03)\",\n contexts.get(0).getExpandedFilterConditions().stream().map(RexNode::toString)\n .collect(Collectors.joining(\",\")));\n }\n\n }", "private Cursor selectStatements(TransferObject feature) throws Exception {\r\n\t //ContentValues cv = new ContentValues(); \r\n\t List<FieldTO> fields = feature.getFields();\r\n\t String[] selectionArgs = new String[fields.size()];\r\n\t for (int i=0; i<fields.size();i++) {\r\n\t \tFieldTO fieldTO = fields.get(i);\r\n\t \tString name = fieldTO.getName();\r\n\t \tObject value = fieldTO.getValue();\r\n\t \tselectionArgs[i] = String.valueOf(value);\r\n\r\n\t\t}\r\n\t // return getDb().insert(getTableName(), null, cv);\r\n\t\tStatementFactory statement = new StatementFactory(feature);\r\n StringBuilder sqls = statement.createStatementSQL();\r\n Cursor c = getDb().rawQuery(sqls.toString(), selectionArgs);\r\n\t return c;\r\n\t}", "public void testEmbeddedSelect() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName,\" + \"(SELECT COUNT(c.ColumnName) FROM AD_Column c WHERE t.AD_Table_ID=c.AD_Table_ID) \" + \"FROM AD_Table t WHERE t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Column=c|AD_Table=t|1]\", fixture.toString());\n }", "public ASTQuery subCreate(){\r\n\t\tASTQuery ast = create();\r\n\t\tast.setGlobalAST(this);\r\n\t\tast.setNSM(getNSM());\r\n\t\treturn ast;\r\n\t}", "public static void main(String args[]){\n String sql = \"select * from TBLS limit 2\";\n String sqlComplex = \"select testpartition.filename,format_.o,title.s,identifier.o,id.o,date_.o \" +\n \"from testpartition join format_ on (testpartition.filename=format_.s) \" +\n \"join title on (testpartition.filename=title.s) \" +\n \"join identifier on (testpartition.filename=identifier.s) \" +\n \"join id on (testpartition.filename=id.s) \" +\n \"join date_ on (testpartition.filename=date_.s) \" +\n \"where testpartition.gid0=1 and testpartition.sid=2 and testpartition.fid<100000 and testpartition.pfid=0\";\n String sqlOriginal = \"select idTable.filename,format_.o,title.s,identifier.o,id.o,date_.o \" +\n \"from idTable join format_ on (idTable.filename=format_.s) \" +\n \"join title on (idTable.filename=title.s) \" +\n \"join identifier on (idTable.filename=identifier.s) \" +\n \"join id on (idTable.filename=id.s) \" +\n \"join date_ on (idTable.filename=date_.s) \" +\n \"where idTable.gid0=1 and idTable.sid=2 and idTable.fid<100000\";\n\n QueryRewrite my = new QueryRewrite(sqlOriginal);\n String sqlRewrite = my.rewrite();\n System.out.println(sqlRewrite);\n\n\n }", "public String constructHaving(Stream strm) {\n\t\tSet<String> tmpSet = new HashSet<String>();\n\t\tHavingTreeWalkerExareme hWalker = new HavingTreeWalkerExareme(strm, getUnf(), this);\n\t\tString subStreams = HelperFunctions.getSetAsString(hWalker.getSubStreams(), true, \"\\r\\n\");\n\t\tString ontopSubStreams = HelperFunctions.getSetAsString(hWalker.getOntopSubStreams(), true, \"\\r\\n\");\n\t\tString str = genTableStr + strm.getName() + \"_having AS WCACHE \\r\\n\";\t\n\t\tArrayList<StarqlVar> sVars = new ArrayList<StarqlVar>(strm.getVars());\n\t\tIndexedTriple iTriple = null;\n\t\tif(strm.getWhere() != null)\n\t\t\tiTriple = strm.getWhere().getiTriples().iterator().next();\n\t\tSet<Triple> trples = new HashSet<Triple>();\n\t\tstr += \"SELECT \";\n\t\tif(strm.getHvg() != null){\n\t\t\tstr +=\t\"wid, \";\n\t\t\tfor(StarqlVar sVar : hWalker.getFreeVars())\n\t\t\t\ttmpSet.add(sVar.toStringSQL());\n\t\t\tfor(StarqlVar var : strm.getHvg().getUnboundIndex())\n\t\t\t\ttmpSet.add(var.toStringSQL());\n\t\t\t\t\n\t\t}\n\t\tfor(StarqlVar sVar : iTriple.getUnboundValues()){\n\t\t\ttmpSet.add(sVar.toStringSQL());\n\t\t}\n\t\tstr += HelperFunctions.getSetAsString(tmpSet, true, \", \");\n\t\tstr += \"\\r\\n\" + \"FROM\\r\\n ( SELECT * FROM\\r\\n\";\n\t\tString fromStr = \"\";\n\t\tString subName = strm.getName() +\"_sub\";\n\t\tontopStrm += hWalker.getOntopStrm();\n\t\tif(!iTriple.getTriple().isEmpty()){\t\t\t\n\t\t\tfromStr += \"(\" + getUnf().unfoldDirect(iTriple, null, false, strm.getFrom().getList()).replaceAll(\"(?m)^\", \"\\t\")+\") SUB_WHERE\";// + \" AS \"+trple.toStringSQL();\n\t\t\tif((hWalker.getString() != null)){\n\t\t\t\tfromStr += \"\\r\\nNATURAL JOIN\\r\\n\";\n\t\t\t}\n\t\t}\n\t\tif(hWalker.getString() != null){\n\t\t\tSet<String> unbound = new HashSet<String>();\n\t\t\tfor(StarqlVar var : strm.getHvg().getUnboundValues())\n\t\t\t\tunbound.add(var.toStringSQL());\n\t\t\tfor(StarqlVar var : strm.getHvg().getUnboundIndex())\n\t\t\t\tunbound.add(var.toStringSQL());\n\t\t\tif(hWalker.getString().trim().startsWith(\"(\"))\n\t\t\t\tfromStr += \" ( SELECT wid\" + HelperFunctions.getSetAsString( unbound, false, \", \" )+ \" FROM \"+hWalker.getString().replaceAll(\"(?m)^\", \"\\t\") + \"\\r\\n) SUB_HAVING\";\n\t\t\telse\n\t\t\t\tfromStr += \" (\"+hWalker.getString().replaceAll(\"(?m)^\", \"\\t\") + \"\\r\\n) SUB_HAVING\";\n\t\t}\n\t\tstr += fromStr.replaceAll(\"(?m)^\", \"\\t\");\n\t\tstr += \"\\r\\n) SUB_FROM;\\r\\n\";\n\t\tontopStrm += hWalker.getOntopStrm();\n\t\t\n\t\treturn ontopSubStreams + subStreams + \"\\r\\n\" + str;\n\t}", "private Row.SimpleBuilder rowBuilder()\n {\n if (rowBuilder == null)\n {\n rowBuilder = updateBuilder.row();\n if (noRowMarker)\n rowBuilder.noPrimaryKeyLivenessInfo();\n }\n\n return rowBuilder;\n }", "public StatementQueryMechanism(DatabaseQuery query) {\n super(query);\n }", "@Test\n public void testFullOuterJoinWithAliases() throws Exception {\n String sql = \"Select myG.a myA, myH.b from g myG full outer join h myH on myG.x=myH.x\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyAliasSymbolWithElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, \"myA\", \"myG.a\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_FULL_OUTER);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"myH\", \"h\");\n\n Node criteriaNode = verify(jpNode, JoinPredicate.JOIN_CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n\n Node leftExpression = verify(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(leftExpression, Symbol.NAME_PROP_NAME, \"myG.x\");\n\n Node rightExpression = verify(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(rightExpression, Symbol.NAME_PROP_NAME, \"myH.x\");\n \n verifySql(\"SELECT myG.a AS myA, myH.b FROM g AS myG FULL OUTER JOIN h AS myH ON myG.x = myH.x\", fileNode);\n }", "@Test\n public void testSelectTrimFamilyWithParameters()\n {\n\n testQuery(\n \"SELECT\\n\"\n + \"TRIM(BOTH ? FROM ?),\\n\"\n + \"TRIM(TRAILING ? FROM ?),\\n\"\n + \"TRIM(? FROM ?),\\n\"\n + \"TRIM(TRAILING FROM ?),\\n\"\n + \"TRIM(?),\\n\"\n + \"BTRIM(?),\\n\"\n + \"BTRIM(?, ?),\\n\"\n + \"LTRIM(?),\\n\"\n + \"LTRIM(?, ?),\\n\"\n + \"RTRIM(?),\\n\"\n + \"RTRIM(?, ?),\\n\"\n + \"COUNT(*)\\n\"\n + \"FROM foo\",\n ImmutableList.of(\n Druids.newTimeseriesQueryBuilder()\n .dataSource(CalciteTests.DATASOURCE1)\n .intervals(querySegmentSpec(Filtration.eternity()))\n .granularity(Granularities.ALL)\n .aggregators(aggregators(new CountAggregatorFactory(\"a0\")))\n .postAggregators(\n expressionPostAgg(\"p0\", \"'foo'\"),\n expressionPostAgg(\"p1\", \"'xfoo'\"),\n expressionPostAgg(\"p2\", \"'foo'\"),\n expressionPostAgg(\"p3\", \"' foo'\"),\n expressionPostAgg(\"p4\", \"'foo'\"),\n expressionPostAgg(\"p5\", \"'foo'\"),\n expressionPostAgg(\"p6\", \"'foo'\"),\n expressionPostAgg(\"p7\", \"'foo '\"),\n expressionPostAgg(\"p8\", \"'foox'\"),\n expressionPostAgg(\"p9\", \"' foo'\"),\n expressionPostAgg(\"p10\", \"'xfoo'\")\n )\n .context(QUERY_CONTEXT_DEFAULT)\n .build()\n ),\n ImmutableList.of(\n new Object[]{\"foo\", \"xfoo\", \"foo\", \" foo\", \"foo\", \"foo\", \"foo\", \"foo \", \"foox\", \" foo\", \"xfoo\", 6L}\n ),\n ImmutableList.of(\n new SqlParameter(SqlType.VARCHAR, \"x\"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \"x\"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \" \"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \"x\"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \"x\"),\n new SqlParameter(SqlType.VARCHAR, \" foo \"),\n new SqlParameter(SqlType.VARCHAR, \"xfoox\"),\n new SqlParameter(SqlType.VARCHAR, \"x\")\n )\n );\n }", "public RepoSQL() { // constructor implicit\r\n\t\t super();\r\n\t }", "PivotForClause createPivotForClause();", "@Test\n public void testDAM31201001() {\n // In this test case the where clause is specified in a common sql shared in multiple queries.\n testDAM30505001();\n }", "public interface SemagrowQuery extends Query {\n\n TupleExpr getDecomposedQuery() throws QueryDecompositionException;\n\n void addExcludedSource(URI source);\n\n void addIncludedSource(URI source);\n\n Collection<URI> getExcludedSources();\n\n Collection<URI> getIncludedSources();\n}", "public String wrapStatement(String statement);", "protected String buildDataQuery() {\n StringBuilder sql = new StringBuilder(\"select\");\n String delim = \" \";\n for (String vname : getColumnNames()) {\n sql.append(delim).append(vname);\n delim = \", \";\n }\n \n Element ncElement = getNetcdfElement();\n \n String table = ncElement.getAttributeValue(\"dbTable\");\n if (table == null) {\n String msg = \"No database table defined. Must set 'dbTable' attribute.\";\n _logger.error(msg);\n throw new TSSException(msg);\n }\n sql.append(\" from \" + table);\n \n String predicate = ncElement.getAttributeValue(\"predicate\");\n if (predicate != null) sql.append(\" where \" + predicate);\n \n //Order by time.\n String tname = getTimeVarName();\n sql.append(\" order by \"+tname+\" ASC\");\n \n return sql.toString();\n }", "public static SqlNode getTestSqlNode() {\n final TableMetadata clicksMeta = getClicksTableMetadata();\n final SqlTable fromClause = new SqlTable(\"CLICKS\", clicksMeta);\n final SqlSelectList selectList = SqlSelectList.createRegularSelectList(ImmutableList\n .of(new SqlColumn(0, clicksMeta.getColumns().get(0)), new SqlFunctionAggregate(AggregateFunction.COUNT,\n ImmutableList.<SqlNode>of(new SqlColumn(1, clicksMeta.getColumns().get(1))), false)));\n final SqlNode whereClause = new SqlPredicateLess(new SqlLiteralExactnumeric(BigDecimal.ONE),\n new SqlColumn(0, clicksMeta.getColumns().get(0)));\n final SqlExpressionList groupBy = new SqlGroupBy(\n ImmutableList.<SqlNode>of(new SqlColumn(0, clicksMeta.getColumns().get(0))));\n final SqlNode countUrl = new SqlFunctionAggregate(AggregateFunction.COUNT,\n ImmutableList.<SqlNode>of(new SqlColumn(1, clicksMeta.getColumns().get(1))), false);\n final SqlNode having = new SqlPredicateLess(new SqlLiteralExactnumeric(BigDecimal.ONE), countUrl);\n final SqlOrderBy orderBy = new SqlOrderBy(\n ImmutableList.<SqlNode>of(new SqlColumn(0, clicksMeta.getColumns().get(0))), ImmutableList.of(true),\n ImmutableList.of(true));\n final SqlLimit limit = new SqlLimit(10);\n return new SqlStatementSelect(fromClause, selectList, whereClause, groupBy, having, orderBy, limit);\n }", "public void testEmbeddedFrom() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName, cc.CCount \" + \"FROM AD_Table t,\" + \"(SELECT COUNT(ColumnName) AS CCount FROM AD_Column) cc \" + \"WHERE t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Column|AD_Table=t,(##)=cc|1]\", fixture.toString());\n }", "RepeatStatement createRepeatStatement();", "public abstract DatabaseQuery createDatabaseQuery(ParseTreeContext context);", "Select createSelect();", "@Test\n public void createSqlQueryWithWhereAndGroupBySucceed()\n {\n // arrange\n // act\n QuerySpecification querySpecification = new QuerySpecificationBuilder(\"*\", QuerySpecificationBuilder.FromType.ENROLLMENTS).where(\"validWhere\").groupBy(\"validGroupBy\").createSqlQuery();\n\n // assert\n Helpers.assertJson(querySpecification.toJson(), \"{\\\"query\\\":\\\"select * from enrollments where validWhere group by validGroupBy\\\"}\");\n }", "@Test\n public void testLeftJoinWithAliases() throws Exception {\n String sql = \"Select myG.a myA, myH.b from g myG left outer join h myH on myG.x=myH.x\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyAliasSymbolWithElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, \"myA\", \"myG.a\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_LEFT_OUTER);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"myH\", \"h\");\n\n Node criteriaNode = verify(jpNode, JoinPredicate.JOIN_CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n\n Node leftExpression = verify(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(leftExpression, Symbol.NAME_PROP_NAME, \"myG.x\");\n\n Node rightExpression = verify(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(rightExpression, Symbol.NAME_PROP_NAME, \"myH.x\");\n \n verifySql(\"SELECT myG.a AS myA, myH.b FROM g AS myG LEFT OUTER JOIN h AS myH ON myG.x = myH.x\", fileNode);\n }", "public ColumnContext context();", "public SqlFromSubSelect(WrqQueryBuilder wrqQueryBuilder, SqlFromSubSelect parent, Element selectElem)\n throws Exception\n {\n super();\n\n this.selectElem = selectElem;\n this.wrqQueryBuilder = wrqQueryBuilder;\n this.parent = parent;\n\n // Let's detect start end end, because we have some extra activity depending on it. rowEnd -1 means unlimited\n String rowStartAttrStr = selectElem.getAttribute(\"rowStart\");\n if( ! rowStartAttrStr.isEmpty() ) rowStart = Integer.parseInt(rowStartAttrStr);\n String rowEndAttrStr = selectElem.getAttribute(\"rowEnd\");\n rowEnd = wrqQueryBuilder.getMaxRows() + (rowStart > 1 ? rowStart - 1 : 0);\n if( ! rowEndAttrStr.isEmpty() ) {\n int rowEndAttr = Integer.parseInt(rowEndAttrStr) + rowStart;\n if( rowEndAttr >= 0 && rowEnd >= 0 ) rowEnd = Math.min(rowEnd, Integer.parseInt(rowEndAttrStr) );\n if( rowEndAttr >= 0 && rowEnd < 0 ) rowEnd = Integer.parseInt(rowEndAttrStr);\n }\n\n // SELECTs which go to a non-virtual BindingSet support rowStart > 1\n // Currently only for top-level selects from BindingSet\n if( rowStart > 1 && (rowEnd == -1 || rowEnd >= rowStart) ) {\n XPath xp = XPathUtils.newXPath();\n XPathExpression bindingSetXpathExpr = xp.compile(\"./wrq:From/wrq:BindingSet/text()\");\n String bindingSetName = (String)bindingSetXpathExpr.evaluate(selectElem, XPathConstants.STRING);\n if( ! bindingSetName.isEmpty() ) {\n StringBuilder bis = new StringBuilder();\n StringBuilder keyBis = new StringBuilder();\n\n StandardBindingSet resultingBindingSet = (StandardBindingSet) wrqQueryBuilder.getBindings().get(bindingSetName, Collections.emptyList());\n for( BindingItem bi: resultingBindingSet.getBindingItems() ) {\n bis.append(bi.getId()+\" \");\n if(bi.isKey()) keyBis.append(bi.getId()+\" \");\n }\n DOMSource source = new DOMSource(selectElem);\n StreamSource styleSource = new StreamSource( new StringReader(wrqTransformRowLimitXsltStatic) );\n Transformer transformer = SecureXmlFactory.newTransformerFactory().newTransformer(styleSource);\n transformer.setParameter(\"allBindingItems\", bis.toString());\n transformer.setParameter(\"allKeyBindingItems\", keyBis.toString());\n DOMResult result = new DOMResult();\n transformer.transform(source, result);\n\n selectElem = (Element)result.getNode().getFirstChild();\n }\n }\n \n wrqInfo = new WrqInfo( this, selectElem );\n\n // Complete initialization\n createSelectStatement();\n }", "protected void generateSelectClause( WrqInfo wrqInfo, SQLStatementWithParams sqlStatement ) throws BindingNotFoundException\n {\n StringBuilder sql = new StringBuilder();\n List<Element> boundVariables = new LinkedList<Element>();\n\n sql.append(\"SELECT \");\n Iterator<String> it = wrqInfo.getFullSelectListBRefs().iterator();\n String concat=\"\";\n while( it.hasNext() )\n {\n WrqBindingItem bi = wrqInfo.getAllBRefAggrs().get(it.next());\n sql.append(concat);\n // We may want to not calculate this value if another bRef part of Grouping Set is on (sub)total level\n // Typical case is the caption. It could be part of the Grouping Set itself but this keeps the query simpler, see scorecard\n if( wrqInfo.reqHasGroupingFunction() && wrqInfo.getGroupingBRefs().contains(bi.getSkipForTotals()) ) {\n String[] grpFM = DatabaseCompatibility.getInstance().getCalcFktMapping(wrqQueryBuilder.getJdbcResourceName()).get(\"Grouping\");\n WrqBindingItem sftBi = wrqInfo.getAllBRefs().get(bi.getSkipForTotals());\n sql.append(\"CASE WHEN \").append(grpFM[1]).append(sftBi.getQColumnExpression()).append(grpFM[3]).append(\" = 0 THEN \");\n sql.append(bi.getQColumnExpressionWithAggr()).append(\" END \");\n } else {\n sql.append(bi.getQColumnExpressionWithAggr()).append(\" \");\n }\n sql.append( bi.getAlias() );\n concat = \", \";\n boundVariables.addAll( bi.getBoundVariables() );\n }\n sqlStatement.append(sql.toString(), boundVariables, wrqInfo.getResultingBindingSet());\n }", "CompoundStatement createCompoundStatement();", "@Override\n protected String applyLocks(String sql, LockOptions lockOptions, Dialect dialect) throws QueryException {\n \t\tfinal String result;\n \t\tif ( lockOptions == null ||\n \t\t\t( lockOptions.getLockMode() == LockMode.NONE && lockOptions.getAliasLockCount() == 0 ) ) {\n \t\t\treturn sql;\n \t\t}\n \t\telse {\n \t\t\tLockOptions locks = new LockOptions();\n \t\t\tlocks.setLockMode(lockOptions.getLockMode());\n \t\t\tlocks.setTimeOut(lockOptions.getTimeOut());\n \t\t\tlocks.setScope(lockOptions.getScope());\n \t\t\tIterator iter = lockOptions.getAliasLockIterator();\n \t\t\twhile ( iter.hasNext() ) {\n \t\t\t\tMap.Entry me = ( Map.Entry ) iter.next();\n \t\t\t\tlocks.setAliasSpecificLockMode( getAliasName( ( String ) me.getKey() ), (LockMode) me.getValue() );\n \t\t\t}\n \t\t\tMap keyColumnNames = null;\n \t\t\tif ( dialect.forUpdateOfColumns() ) {\n \t\t\t\tkeyColumnNames = new HashMap();\n \t\t\t\tfor ( int i = 0; i < names.length; i++ ) {\n \t\t\t\t\tkeyColumnNames.put( names[i], persisters[i].getIdentifierColumnNames() );\n \t\t\t\t}\n \t\t\t}\n \t\t\tresult = dialect.applyLocksToSql( sql, locks, keyColumnNames );\n \t\t}\n \t\tlogQuery( queryString, result );\n \t\treturn result;\n \t}", "Query query();", "public String getPlanSQL() {\n Expression[] exprList = expressions.toArray(\r\n new Expression[expressions.size()]);\r\n StatementBuilder buff = new StatementBuilder(\"SELECT\");\r\n if (distinct) {\r\n buff.append(\" DISTINCT\");\r\n }\r\n for (int i = 0; i < visibleColumnCount; i++) {\r\n buff.appendExceptFirst(\",\");\r\n buff.append('\\n');\r\n buff.append(StringUtils.indent(exprList[i].getSQL(), 4, false));\r\n }\r\n buff.append(\"\\nFROM \");\r\n TableFilter filter = topTableFilter;\r\n if (filter != null) {\r\n buff.resetCount();\r\n int i = 0;\r\n do {\r\n buff.appendExceptFirst(\"\\n\");\r\n buff.append(filter.getPlanSQL(i++ > 0));\r\n filter = filter.getJoin();\r\n } while (filter != null);\r\n } else {\r\n buff.resetCount();\r\n int i = 0;\r\n for (TableFilter f : topFilters) {\r\n do {\r\n buff.appendExceptFirst(\"\\n\");\r\n buff.append(f.getPlanSQL(i++ > 0));\r\n f = f.getJoin();\r\n } while (f != null);\r\n }\r\n }\r\n if (condition != null) {\r\n buff.append(\"\\nWHERE \").append(\r\n StringUtils.unEnclose(condition.getSQL()));\r\n }\r\n if (groupIndex != null) {\r\n buff.append(\"\\nGROUP BY \");\r\n buff.resetCount();\r\n for (int gi : groupIndex) {\r\n Expression g = exprList[gi];\r\n g = g.getNonAliasExpression();\r\n buff.appendExceptFirst(\", \");\r\n buff.append(StringUtils.unEnclose(g.getSQL()));\r\n }\r\n }\r\n if (group != null) {\r\n buff.append(\"\\nGROUP BY \");\r\n buff.resetCount();\r\n for (Expression g : group) {\r\n buff.appendExceptFirst(\", \");\r\n buff.append(StringUtils.unEnclose(g.getSQL()));\r\n }\r\n }\r\n if (having != null) {\r\n // could be set in addGlobalCondition\r\n // in this case the query is not run directly, just getPlanSQL is\r\n // called\r\n Expression h = having;\r\n buff.append(\"\\nHAVING \").append(\r\n StringUtils.unEnclose(h.getSQL()));\r\n } else if (havingIndex >= 0) {\r\n Expression h = exprList[havingIndex];\r\n buff.append(\"\\nHAVING \").append(\r\n StringUtils.unEnclose(h.getSQL()));\r\n }\r\n if (sort != null) {\r\n buff.append(\"\\nORDER BY \").append(\r\n sort.getSQL(exprList, visibleColumnCount));\r\n }\r\n if (limitExpr != null) {\r\n buff.append(\"\\nLIMIT \").append(\r\n StringUtils.unEnclose(limitExpr.getSQL()));\r\n if (offsetExpr != null) {\r\n buff.append(\" OFFSET \").append(\r\n StringUtils.unEnclose(offsetExpr.getSQL()));\r\n }\r\n }\r\n if (sampleSizeExpr != null) {\r\n buff.append(\"\\nSAMPLE_SIZE \").append(\r\n StringUtils.unEnclose(sampleSizeExpr.getSQL()));\r\n }\r\n if (isForUpdate) {\r\n buff.append(\"\\nFOR UPDATE\");\r\n }\r\n return buff.toString();\r\n }", "private String constructSQL() {\n\t\tString sql = \"\";\n\t\tif (!minAgeSet) {\n\t\t\tsql = \"SELECT E.EMP_ID, E.EMP_FULLNAME\" + \" FROM \" + empTable\n\t\t\t+ \" E\";\n\t\t} else {\n\t\t\tsql = \"SELECT E.EMP_ID, E.EMP_FULLNAME\" + \" FROM \" + empTable\n\t\t\t+ \" E WHERE E.EMP_BIRTH_DATE <= ? \";\n\t\t}\n\n\t\toriSqlLength = sql.length();\n\n\t\tStringTokenizer empTok = new StringTokenizer(employee, \",\");\n\t\tStringTokenizer calcTok = new StringTokenizer(calcGroup, \",\");\n\t\tStringTokenizer payTok = new StringTokenizer(payGroup, \",\");\n\t\tStringTokenizer teamTok = new StringTokenizer(team, \",\");\n\n\t\t// check if any of the selects have been used.\n\n\t\tif (empTok.hasMoreTokens() && !empTok.nextToken().equalsIgnoreCase(all))\n\t\t\tsql = groupSelect(\"employee\", sql);\n\t\tif (calcTok.hasMoreTokens()\n\t\t\t\t&& !calcTok.nextToken().equalsIgnoreCase(all))\n\t\t\tsql = groupSelect(\"calcGroup\", sql);\n\t\tif (payTok.hasMoreTokens() && !payTok.nextToken().equalsIgnoreCase(all))\n\t\t\tsql = groupSelect(\"payGroup\", sql);\n\t\tif (teamTok.hasMoreTokens()\n\t\t\t\t&& !teamTok.nextToken().equalsIgnoreCase(all))\n\t\t\tsql = groupSelect(\"team\", sql);\n\t\t\n\t\treturn sql;\n\t}", "public String buildJS() {\n if (className == null || instanceName == null) {\n // The query is only \"select `JS_expression`\" - in that case, just eval it\n return \"{ visitor = wrapVisitor(visitor); let result = \"+selectExpression+\"; let isIterable = result != null && typeof result[Symbol.iterator] === 'function'; if (isIterable) { for (r in result) { if (visitor.visit(result[r])) { break }; }} else { visitor.visit(result); } }\";\n } else {\n // The query is \"select `JS_expression` from `class_name` `identifier`\n // visitor is\n String selectFunction = \"function __select__(\"+instanceName+\") { return \"+selectExpression+\" };\";\n String iteratorConstruction = \"let iterator = heap.objects('\"+className+\"', \"+isInstanceOf+\");\";\n String whereFunction;\n String resultsIterator;\n if (whereExpression == null) {\n whereFunction = \"\";\n resultsIterator = \"while (iterator.hasNext()) { let item = iterator.next(); if (visitor.visit(__select__(item))) { break; }; };\";\n } else {\n whereFunction = \"function __where__(\"+instanceName+\") { return \"+whereExpression+\" };\";\n resultsIterator = \"while (iterator.hasNext()) { let item = iterator.next(); if(__where__(item)) { if (visitor.visit(__select__(item))) { break; } } };\";\n }\n return \"{ visitor = wrapVisitor(visitor); \" + selectFunction + whereFunction + iteratorConstruction + resultsIterator + \"}\";\n }\n }", "private SelectOnConditionStep<Record> commonTestItemDslSelect() {\n\t\treturn dsl.select().from(TEST_ITEM).join(TEST_ITEM_RESULTS).on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID));\n\t}", "@Override\n public void visit(ASTCube node, Object data) throws Exception {\n getOutput(data).delete(getOutput(data).length() - 2, getOutput(data).length());\n\n getOutput(data).append(\" from \");\n\n Set<String> tables = new HashSet<String>();\n\n tables.add(TranslationUtils.tableExpression(getQueryMetadata(data).getCube().getSchemaName(),\n getQueryMetadata(data).getCube().getTableName()));\n\n for (Level level : levelsPresent((TranslationContext) data))\n for (Level lowerLevel : level.getLowerLevels())\n tables.add(TranslationUtils.tableExpression(lowerLevel.getSchemaName(), lowerLevel.getTableName()));\n\n for (String table : tables)\n getOutput(data).append(table).append(\", \");\n\n if (!tables.isEmpty())\n getOutput(data).delete(getOutput(data).length() - 2, getOutput(data).length());\n\n getOutput(data).append(\" where \");\n\n whereExpression((TranslationContext) data);\n }", "@Test\n public void testVisit_PlainSelect() throws JSQLParserException {\n String sql = \"select a,b,c from test\";\n Select select = (Select) parserManager.parse(new StringReader(sql));\n final AddAliasesVisitor instance = new AddAliasesVisitor();\n select.accept(instance);\n\n assertEquals(\"SELECT a AS A1, b AS A2, c AS A3 FROM test\", select.toString());\n }", "private String buildSelect() {\r\n\t\tString select = \"select all_source.line, ' '||replace(all_source.TEXT,chr(9),' ')|| ' ' line from all_source where 2=2 \";\r\n\t\tString ownerCondition = \"\";\r\n\t\tString ownerInnerCondition = \"\";\r\n\t\tString beginProcedureCondition = \"\";\r\n\r\n\t\tif (!oraJdbcDTO.dbSchema.equals(\"\")) {\r\n\t\t\townerCondition = \" and all_source.OWNER = ? \";\r\n\t\t\townerInnerCondition = \" and all_source1.OWNER = ? \";\r\n\t\t}\r\n\t\tif (!oraJdbcDTO.packageName.equals(\"\")) {\r\n\t\t\t// Procedure in package\r\n\t\t\tbeginProcedureCondition = \"and all_source.name = ?\\n\"\r\n\t\t\t\t\t+ \"and all_source.TYPE = 'PACKAGE'\\n\"\r\n\t\t\t\t\t+ \"and all_source.line >=\\n\"\r\n\t\t\t\t\t+ \" (select min(all_source1.line)\\n\"\r\n\t\t\t\t\t+ \" from all_source all_source1 where 2=2 \"\r\n\t\t\t\t\t+ ownerInnerCondition\r\n\t\t\t\t\t+ \" and all_source1.name = ?\\n\"\r\n\t\t\t\t\t+ \" and all_source1.TYPE = 'PACKAGE'\\n\"\r\n\t\t\t\t\t+ \" and instr(upper(all_source1.TEXT), ?) > 0)\";\r\n\t\t\t;\r\n\t\t} else {\r\n\t\t\t// Single procedure or function\r\n\t\t\tbeginProcedureCondition = \"and all_source.name = ?\\n\"\r\n\t\t\t\t\t+ \"and all_source.TYPE in ('PROCEDURE','FUNCTION')\";\r\n\t\t}\r\n\t\tselect = select + beginProcedureCondition + \" and all_source.line >= ?\"\r\n\t\t\t\t+ ownerCondition + \" order by all_source.line\";\r\n\r\n\t\treturn select;\r\n\t}", "private void getSelectStatements()\n\t{\n\t\tString[] sqlIn = new String[] {m_sqlOriginal};\n\t\tString[] sqlOut = null;\n\t\ttry\n\t\t{\n\t\t\tsqlOut = getSubSQL (sqlIn);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tlog.log(Level.SEVERE, m_sqlOriginal, e);\n\t\t\tthrow new IllegalArgumentException(m_sqlOriginal);\n\t\t}\n\t\t//\ta sub-query was found\n\t\twhile (sqlIn.length != sqlOut.length)\n\t\t{\n\t\t\tsqlIn = sqlOut;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tsqlOut = getSubSQL (sqlIn);\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tlog.log(Level.SEVERE, m_sqlOriginal, e);\n\t\t\t\tthrow new IllegalArgumentException(sqlOut.length + \": \"+ m_sqlOriginal);\n\t\t\t}\n\t\t}\n\t\tm_sql = sqlOut;\n\t\t/** List & check **\n\t\tfor (int i = 0; i < m_sql.length; i++)\n\t\t{\n\t\t\tif (m_sql[i].indexOf(\"SELECT \",2) != -1)\n\t\t\t\tlog.log(Level.SEVERE, \"#\" + i + \" Has embedded SQL - \" + m_sql[i]);\n\t\t\telse\n\t\t\t\tlog.fine(\"#\" + i + \" - \" + m_sql[i]);\n\t\t}\n\t\t/** **/\n\t}", "public void testKeepStatementWithConnectionPool() throws Exception {\n CountingDataSource ds1 = new CountingDataSource(getConnection());\n\n Configuration c1 =\n create().configuration().derive(new DataSourceConnectionProvider(ds1));\n\n for (int i = 0; i < 5; i++) {\n ResultQuery<Record1<Integer>> query =\n DSL.using(c1)\n .select(TBook_ID())\n .from(TBook())\n .where(TBook_ID().eq(param(\"p\", 0)));\n\n query.bind(\"p\", 1);\n assertEquals(1, (int) query.fetchOne().getValue(TBook_ID()));\n query.bind(\"p\", 2);\n assertEquals(2, (int) query.fetchOne().getValue(TBook_ID()));\n\n assertEquals((i + 1) * 2, ds1.open);\n assertEquals((i + 1) * 2, ds1.close);\n }\n\n assertEquals(10, ds1.open);\n assertEquals(10, ds1.close);\n\n // Keeping an open statement [#3191]\n CountingDataSource ds2 = new CountingDataSource(getConnection());\n\n Configuration c2 =\n create().configuration().derive(new DataSourceConnectionProvider(ds2));\n\n for (int i = 0; i < 5; i++) {\n ResultQuery<Record1<Integer>> query =\n DSL.using(c2)\n .select(TBook_ID())\n .from(TBook())\n .where(TBook_ID().eq(param(\"p\", 0)))\n .keepStatement(true);\n\n query.bind(\"p\", 1);\n assertEquals(1, (int) query.fetchOne().getValue(TBook_ID()));\n query.bind(\"p\", 2);\n assertEquals(2, (int) query.fetchOne().getValue(TBook_ID()));\n\n assertEquals(i + 1, ds2.open);\n assertEquals(i , ds2.close);\n\n query.close();\n\n assertEquals(i + 1, ds2.open);\n assertEquals(i + 1, ds2.close);\n }\n\n assertEquals(5, ds1.open);\n assertEquals(5, ds1.close);\n }", "@Test\n public void testMixedJoin3() throws Exception {\n String sql = \"SELECT * FROM g1, g2 inner join g3 on g2.a=g3.a\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n\n verify(selectNode, Select.SYMBOLS_REF_NAME, MultipleElementSymbol.ID);\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"g1\");\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, 2, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_INNER);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"g2\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"g3\");\n\n Node criteriaNode = verify(jpNode, JoinPredicate.JOIN_CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n\n Node leftExpression = verify(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(leftExpression, Symbol.NAME_PROP_NAME, \"g2.a\");\n\n Node rightExpression = verify(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(rightExpression, Symbol.NAME_PROP_NAME, \"g3.a\");\n \n verifySql(\"SELECT * FROM g1, g2 INNER JOIN g3 ON g2.a = g3.a\", fileNode);\n }", "public QueryCore buildQuery() throws SQLException\n {\n if(l != null)\n {\n for(int i=0;i<l.size();i++)\n {\n prepStm.setObject(i+1,l.get(i));\n }\n }\n return this;\n }", "static DbQuery createValueQuery() {\n DbQuery query = new DbQuery();\n query.order = OrderBy.VALUE;\n return query;\n }", "public QueryExecution createQueryExecution(Query qry);", "public void SQLQueryEnhanced(String databaseName) throws SQLException{\n\t\tdatabaseName = databaseName.toLowerCase();\n\t\tString sql = \"SELECT name,tid,value FROM \"+databaseName;\n\t\tthis.visualComponentList = new VisualComponentList();\n\t\tthis.visualComponentList.setVisualComponentList(new ArrayList<VisualComponent>());\n\t\tSystem.out.println(\"Running SQL Query :\"+sql);\n\t\texecuteSQL(sql, databaseName);\n\t}", "public FromClause createFromClause()\n {\n return null;\n }", "private static SqlScalars generateSqlForPerson(OptionsId options) {\n SqlScalars sqlScalars = new SqlScalars();\n // Make sure to set the alias for the files for the Transformation into the class\n sqlScalars.addToSql(\"SELECT DISTINCT p.id,p.name,\");\n sqlScalars.addToSql(\"p.first_name AS firstName,\");\n sqlScalars.addToSql(\"p.last_name AS lastName,\");\n sqlScalars.addToSql(\"p.birth_day AS birthDay,\");\n sqlScalars.addToSql(\"p.birth_place AS birthPlace,\");\n sqlScalars.addToSql(\"p.birth_name AS birthName,\");\n sqlScalars.addToSql(\"p.death_day AS deathDay,\");\n sqlScalars.addToSql(\"p.death_place AS deathPlace\");\n sqlScalars.addToSql(DataItemTools.addSqlDataItems(options.splitDataItems(), \"p\").toString());\n sqlScalars.addToSql(\"FROM person p\");\n\n if (options.getId() > 0L) {\n sqlScalars.addToSql(\"WHERE p.status\" + SQL_IGNORE_STATUS_SET);\n sqlScalars.addToSql(\"AND id=:id\");\n sqlScalars.addParameter(LITERAL_ID, options.getId());\n } else {\n if (MapUtils.isNotEmpty(options.splitJobs())) {\n sqlScalars.addToSql(\", cast_crew c\");\n }\n sqlScalars.addToSql(\"WHERE p.status\" + SQL_IGNORE_STATUS_SET);\n\n if (MapUtils.isNotEmpty(options.splitJobs())) {\n sqlScalars.addToSql(\"AND p.id=c.person_id\");\n sqlScalars.addToSql(\"AND c.job IN (:jobs)\");\n sqlScalars.addParameter(\"jobs\", options.getJobTypes());\n }\n\n // Add the search string\n sqlScalars.addToSql(options.getSearchString(false));\n // This will default to blank if there's no sort required\n sqlScalars.addToSql(options.getSortString());\n }\n\n sqlScalars.addScalar(LITERAL_ID, LongType.INSTANCE);\n sqlScalars.addScalar(LITERAL_NAME, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_FIRST_NAME, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_LAST_NAME, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_BIRTH_DAY, DateType.INSTANCE);\n sqlScalars.addScalar(LITERAL_BIRTH_PLACE, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_BIRTH_NAME, StringType.INSTANCE);\n sqlScalars.addScalar(LITERAL_DEATH_DAY, DateType.INSTANCE);\n sqlScalars.addScalar(LITERAL_DEATH_PLACE, StringType.INSTANCE);\n\n // add Scalars for additional data item columns\n DataItemTools.addDataItemScalars(sqlScalars, options.splitDataItems());\n\n return sqlScalars;\n }", "@Test\n public void testRightOuterJoinWithAliases() throws Exception {\n String sql = \"Select myG.a myA, myH.b from g myG right outer join h myH on myG.x=myH.x\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n verifyAliasSymbolWithElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 1, \"myA\", \"myG.a\");\n verifyElementSymbol(selectNode, Select.SYMBOLS_REF_NAME, 2, \"myH.b\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n\n Node jpNode = verify(fromNode, From.CLAUSES_REF_NAME, JoinPredicate.ID);\n verifyJoin(jpNode, JoinTypeTypes.JOIN_RIGHT_OUTER);\n\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.LEFT_CLAUSE_REF_NAME, \"myG\", \"g\");\n verifyUnaryFromClauseGroup(jpNode, JoinPredicate.RIGHT_CLAUSE_REF_NAME, \"myH\", \"h\");\n\n Node criteriaNode = verify(jpNode, JoinPredicate.JOIN_CRITERIA_REF_NAME, CompareCriteria.ID);\n verifyProperty(criteriaNode, AbstractCompareCriteria.OPERATOR_PROP_NAME, CriteriaOperator.Operator.EQ.name());\n\n Node leftExpression = verify(criteriaNode, AbstractCompareCriteria.LEFT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(leftExpression, Symbol.NAME_PROP_NAME, \"myG.x\");\n\n Node rightExpression = verify(criteriaNode, CompareCriteria.RIGHT_EXPRESSION_REF_NAME, ElementSymbol.ID);\n verifyProperty(rightExpression, Symbol.NAME_PROP_NAME, \"myH.x\");\n \n verifySql(\"SELECT myG.a AS myA, myH.b FROM g AS myG RIGHT OUTER JOIN h AS myH ON myG.x = myH.x\", fileNode);\n }", "public SQLQuery _buildQuery(E event) throws SQLException, ErrorResponseException {\n withoutIdField = true;\n return buildQuery(event);\n }", "List<MedicalOrdersExecutePlan> selectByExample(MedicalOrdersExecutePlanExample example);" ]
[ "0.598458", "0.59490705", "0.5808424", "0.5266306", "0.5196228", "0.5196002", "0.5188849", "0.5161675", "0.5148545", "0.513405", "0.50437915", "0.5043681", "0.5039633", "0.50248593", "0.50087214", "0.49994987", "0.4968628", "0.4951153", "0.49459863", "0.49439287", "0.49414614", "0.49368837", "0.49270526", "0.491267", "0.48517045", "0.4851346", "0.48403993", "0.48403993", "0.48403993", "0.48243245", "0.48210075", "0.48194504", "0.48119348", "0.48118147", "0.48049197", "0.4793062", "0.47930267", "0.47770038", "0.47739276", "0.4770922", "0.4763967", "0.47620317", "0.47538587", "0.4752744", "0.47485065", "0.47472414", "0.47354448", "0.4726444", "0.47226158", "0.47203317", "0.4710601", "0.4710203", "0.4673991", "0.46731114", "0.46713662", "0.46652108", "0.46556136", "0.46513292", "0.4634998", "0.4630679", "0.46223488", "0.46207562", "0.4617413", "0.46100056", "0.46004283", "0.45959133", "0.45836833", "0.4583251", "0.45792884", "0.45725572", "0.45721027", "0.45719796", "0.45597798", "0.4546983", "0.45452222", "0.45370355", "0.45362157", "0.45358315", "0.4534183", "0.45285285", "0.4519438", "0.4519133", "0.45141646", "0.45098478", "0.45083103", "0.4496112", "0.44941354", "0.44921222", "0.44901222", "0.44892687", "0.4486077", "0.4484953", "0.44785663", "0.44727942", "0.44627646", "0.44610685", "0.44601992", "0.44581354", "0.44568405", "0.44548485" ]
0.6276536
0
TODO: Implement this method
@Override public void onCreate ( Bundle savedInstanceState, PersistableBundle persistentState ) { super.onCreate(savedInstanceState, persistentState); setContentView(R.layout.form_persons); getActionBar().setDisplayHomeAsUpEnabled(true); name = (EditText) findViewById(R.id.eTextNamePerson); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void anular() {\n\n\t}", "private stendhal() {\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "public final void mo51373a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n protected void initialize() {\n\n \n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n protected void prot() {\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "private void strin() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\t\t\tpublic int describeContents() {\n\t\t\t\treturn 0;\n\t\t\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public int describeContents() {\n// ignore for now\n return 0;\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public void identify() {\n\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "private static void iterator() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n void init() {\n }", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "protected boolean func_70814_o() { return true; }", "private void kk12() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n public int describeContents()\n {\n return 0;\n }", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "private void init() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}" ]
[ "0.6146684", "0.5972078", "0.5951665", "0.5893627", "0.5893573", "0.58674604", "0.57714313", "0.57463145", "0.5679119", "0.5679119", "0.56602454", "0.5640005", "0.56188494", "0.5614183", "0.5613904", "0.5604922", "0.55885965", "0.5585748", "0.5544809", "0.5542787", "0.54606813", "0.5445501", "0.54429436", "0.54366755", "0.54366755", "0.543285", "0.54153913", "0.5410616", "0.5407727", "0.5402224", "0.5379201", "0.5379201", "0.5379201", "0.5379201", "0.5379201", "0.5379201", "0.5370941", "0.53531456", "0.535282", "0.535282", "0.5341689", "0.53371406", "0.5327879", "0.53247654", "0.53207964", "0.53207624", "0.53191334", "0.5318712", "0.5315209", "0.5311832", "0.5311832", "0.53108865", "0.53057474", "0.5304683", "0.53020316", "0.5301817", "0.5300179", "0.5299717", "0.5296128", "0.52916133", "0.5288196", "0.52574426", "0.52573764", "0.5253081", "0.52493435", "0.52476543", "0.52466357", "0.52399063", "0.52399063", "0.5239719", "0.5234995", "0.5226865", "0.52235335", "0.5223488", "0.5221877", "0.5221036", "0.5221036", "0.5221036", "0.5221036", "0.5221036", "0.521731", "0.5216318", "0.52158964", "0.5210932", "0.5210247", "0.5200083", "0.5197763", "0.51970756", "0.5196079", "0.5196079", "0.5196079", "0.51960444", "0.51916164", "0.51869774", "0.5186059", "0.5183724", "0.5178901", "0.5177252", "0.5174777", "0.5169102", "0.51684856" ]
0.0
-1
/ Define a constructor which expects two parameters width and height here.
public Rectangle(int w, int h) { this.width = w; this.height = h; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Picture(int width, int height)\n {\n // let the parent class handle this width and height\n super(width,height);\n }", "public Picture(int width, int height)\n {\n // let the parent class handle this width and height\n super(width,height);\n }", "public Size(double width, double height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n }", "public Rectangle(int length, int width) {\n }", "public Player(int width, int height)\n {\n this.width = width;\n this.height = height;\n createImage();\n }", "public Rectangle(double width, double height) {\r\n this.width = width;\r\n this.height = height;\r\n }", "Rectangle(int width, int height){\n area = width * height;\n }", "TwoDShape5(double x) {\n width = height = x;\n }", "public Rectangle() {\n this(50, 40);\n }", "Rectangle()\n {\n this(1.0,1.0);\n }", "public Thumbnail() {\n this(100, 100);\n }", "Rectangle(double newWidth, double newHeight){\n height = newHeight;\n width = newWidth;\n }", "public Paper(double _height, double _width)\n {\n // initialise instance variables\n height = _height;\n width = _width;\n }", "public abstract boolean init(int width, int height);", "public Size(int w, int h) {\n width = w;\n height = h;\n }", "public Unit(int x, int y, int width, int height) {\n super(x, y, width, height);\n LOGGER.log(Level.INFO, this.toString() + \" created at (\" + x + \",\" + y + \")\", this.getClass());\n }", "Rectangle(){\n height = 1;\n width = 1;\n }", "public AbstractImageGenerator(int width, int height) {\n if (width <= 0 || height <= 0) {\n throw new IllegalArgumentException(\"Width and height cannot be negative or zero\");\n }\n image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n }", "public GameBoard (int height, int width)\n {\n mHeight = height;\n mWidth = width;\n }", "public AStar2D(int width, int height) {\n super( new Grid2D(width, height) );\n }", "public Rectangle(int length, int width)\n {\n this.length = length;\n this.width = width;\n\n }", "public Rectangle(double x, double y, double width, double height) {\n super(x, y, width, height);\n }", "public Image( int x, int y, int w, int h )\r\n {\r\n super();\r\n setBounds( x, y, w, h );\r\n }", "public Rectangle(Integer width, Integer height) {\n super(300, 100, \"red\",null);\n this.width = width;\n this.height = height;\n control = new Control(this);\n }", "public RectangleObject(double width, double height) {\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t}", "Rectangle() {\r\n\t\tlength = 1.0;\r\n\t\twidth = 1.0;\r\n\t}", "public Shape(int width, int height) {\r\n\r\n\t\t// Shape width and height should not be greater than the sheet width and height\r\n\t\tif (width > Sheet.SHEET_WIDTH || height > Sheet.SHEET_HEIGHT) {\r\n\t\t\tthrow new IllegalArgumentException(\"Shape width or height is not valid\");\r\n\t\t}\r\n\r\n\t\tthis.sWidth = width;\r\n\t\tthis.sHeight = height;\r\n\t}", "public Square(int w)\n {\n width = w;\n }", "TwoDShape5() {\n width = height = 0.0;\n }", "public abstract void init(int w, int h);", "public DrawingArea(int width, int height) {\n\t\tthis.initialize(width, height);\n\t}", "public MagicTetris(int width, int height)\r\n\t\t{\r\n\t\tsuper(width, height, new BasicGenerator());\r\n\t\t}", "public Shape(int x, int y, int deltaX, int deltaY, int width, int height) {\n\t\t_x = x;\n\t\t_y = y;\n\t\t_deltaX = deltaX;\n\t\t_deltaY = deltaY;\n\t\t_width = width;\n\t\t_height = height;\n\t}", "public Context(int width, int height)\n {\n this.width = width;\n this.height = height;\n this.data = new int[width * height];\n this.image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\n data = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();\n }", "public Picasso(int width, int height) {\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tdebug = new ArrayList<String>();\n\t\tdoDebug = false;\n\t\tcanvas = Discette.toCompatibleImage(new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB));\n\t}", "public Bitmap(int w, int h)\n {\n width = w;\n height = h;\n m_components = new byte[width * height * 4];\n }", "public PongGUI(int width, int height){\r\n\t\tsWidth = width;\r\n\t\tsHeight = height;\r\n\t}", "public MatteIcon(int width, int height) {\r\n this(width, height, null);\r\n }", "Rectangle(int l, int w)\n {\n\tlength = l;\n\twidth = w;\n }", "public Image()\r\n {\r\n super();\r\n setBounds( 0, 0, 10, 10 );\r\n }", "public GameController(int width, int height) {\n\n // YOUR CODE HERE\n }", "public CanvasDims(int x, int y, int width, int height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }", "MyRectangle2D(double x, double y, double width, double height) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.height = height;\r\n\t\tthis.width = width;\r\n\t}", "public GameGridBuilder(int gridWidth, int gridHeight) {\n this.gridWidth = gridWidth;\n this.gridHeight = gridHeight;\n }", "public BufferedCanvas(int width, int height)\n {\n\tthis.width = width;\n\tthis.height = height;\n\tsetSize(width,height);\n }", "public SPIEL() \n {\n this( 800 , 600 , false , false , false );\n }", "public Bounds(double x, double y, double width, double height) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public Rectangle(int x, int y, int w, int h) {\n this.x = x;\n this.y = y;\n this.size = new Dimension(w, h);\n }", "public Screen(int width, int height) {\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tpixels = new int[width * height];\r\n\t}", "public Entity(double x, double y, double width, double height) {\n\t\tsuper(x, y, width, height);\n\t}", "public SquareGrid(int width, int height) {\n this.width = width;\n this.height = height;\n }", "public Stone(int x, int y, int width, int height) {\n\t\tsuper(x, y, width, height);\n\t\t\n\t}", "public Rectangle() {\n\t\twidth = 1;\n\t\theight = 1;\n\t}", "public World(int width, int height)\n {\n this(width, height, AIR_EL);\n }", "public RectangleShape(int xCoord, int yCoord, int widthOfRect, int heightOfRect)\n {\n System.out.println(\"setting x to: \"+ xCoord+\" & setting y to: \"+ yCoord);\n x = xCoord;\n y = yCoord;\n width = widthOfRect;\n height = heightOfRect;\n }", "public Rectangle(float w, float h, float x, float y, float r, float g, float b, String n, int s, int e) {\n super(x, y, r, g, b, n, s, e);\n this.width = w;\n this.height = h;\n }", "Polymorph(int x, int y, int height, int width){\n \t this.x = x;\n \t this.y = y;\n \t this.height = height;\n \t this.width = width;\n }", "public Screen(int width, int height){\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\timage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\t\tpixels = ((DataBufferInt)image.getRaster().getDataBuffer()).getData();\n\t}", "Rectangle(int width, int height){\n area = width * height;\n System.out.println(\"Area of a rectangle = \" +area);\n }", "private Block(Location topLeft, short length, short width) {\n\t\tif (length<=0 || width<=0){\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\telse if (topLeft==null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tthis.topLeft = topLeft;\n\t\tthis.length = length;\n\t\tthis.width = width;\n\t}", "public Rectangle(int x, int y, int width, int height, Color colour) {\n\t\tsuper(x,y,width,height,colour);\n\t}", "public DrawingArea(int width, int height, int cpWidth) {\n super(null);\n this.width = width - cpWidth;\n this.height = height;\n setBounds(cpWidth, 0, this.width, this.height);\n originX = this.width/2;\n originY = this.height/2;\n setBackground(Color.white);\n drawingArea = createImage(this.width, this.height);\n }", "public Paddle(int width, int height) {\r\n \r\n this.width = width;\r\n this.height = height;\r\n \r\n }", "public Framebuffer(int width, int height) {\n\t\tviewWidth = width;\n\t\tviewHeight = height;\n\t\tid = glGenFramebuffers();\n\t}", "public Rectangle() {\n super();\n properties = new HashMap<String, Double>();\n properties.put(\"Width\", null);\n properties.put(\"Length\", null);\n }", "public BattlefieldSpecification(int width, int height) {\n\t\tif (width < 400 || width > 5000) {\n\t\t\tthrow new IllegalArgumentException(\"width must be: 400 <= width <= 5000\");\n\t\t}\n\t\tif (height < 400 || height > 5000) {\n\t\t\tthrow new IllegalArgumentException(\"height must be: 400 <= height <= 5000\");\n\t\t}\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "Box(double len){\r\n Height = Width = Depth = len;\r\n\r\n }", "public Pixmap(int width, int height){\n load(width, height);\n }", "public Display(int height, int width, String title)\n {\n this.width = width; \n this.height = height; \n this.title = title; \n \n createDisplay();\n }", "public Rectangle(double width, double length) {\n\t\tthis.width = width;\n\t\tthis.length = length;\n\t}", "public Road(int x, int y, int width, int height)\n {\n screenWidth = width;\n screenHeight = height;\n xTopLeft = x;\n yTopLeft = y;\n }", "public Rectangle(double newWidth, double newHeight) {\n\t\tif (width >= 0 && height >= 0) {\n\t\t\twidth = newWidth;\n\t\t\theight = newHeight;\n\t\t}\n\t\t\t\n\t}", "MyRectangle(double height, double width, MyColor color) {\n\t\tsuper(color);\n\t\tthis.height=height;\n\t\tthis.width=width;\n\t}", "public ConstRect(final double x, final double y, final double width, final double height)\r\n {\r\n this.x = (int) Math.round(x);\r\n this.y = (int) Math.round(y);\r\n this.width = (int) Math.round(width);\r\n this.height = (int) Math.round(height);\r\n }", "public Property(int xLength, int yWidth, int xLeft, int yTop) {\n this(xLength, yWidth, xLeft, yTop, DEFAULT_REGNUM);\n }", "public Rectangle(int recLength, int recWidth) {\n super(recLength, recWidth);\n System.out.println(\"\\nA rectangle is being created!\\n\");\n }", "public Image(Renderer renderer, int width, int height) throws RenderException {\r\n\t\tthis(renderer, renderer.createEmptyTexture(width, height));\r\n\t}", "Box(Box ob)\n\t{\n\t\t//pass object to constructor\n\t\twidth = ob.width;\n\t\theight = ob.height;\n\t\tdepth = ob.depth;\n\t\t\n\t\t\n\t}", "public Canvas(int width, int height) {\n if(width<=0) {\n throw new IllegalArgumentException(\"Width cannot be less than or equal to zero\");\n } else if(height<=0) {\n throw new IllegalArgumentException(\"Height cannot be less than or equal to zero\");\n }\n this.width = width;\n this.height = height;\n\n drawingArray = new char[height][width];\n for(int i=0; i<height; i++) {\n for(int j=0; j<width; j++) {\n drawingArray[i][j] = ' ';\n }\n }\n undoStack = new DrawingStack();\n redoStack = new DrawingStack();\n }", "@Override\n\tpublic void setWidthAndHeight(int width, int height) {\n\t\t\n\t}", "public RandomPointGenerator(int width, int height) {\n\t\tthis(0, 0, width, height);\n\t}", "Box(double w, double h, double d) {\n\n widgh =w;\n height =h;\n depth =d;\n\n}", "public Rectangle(Point upperLeft, double width, double height) {\n this.upperLeft = upperLeft;\n this.width = width;\n this.height = height;\n }", "public Camera() {\r\n this(1, 1);\r\n }", "public BoundingBox(Coord origin, int width, int height) {\n\t\tsuper();\n\t\tthis.origin = origin;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public Shape() { this(X_DEFAULT, Y_DEFAULT); }", "public ConstRect(final int x, final int y, final int width, final int height)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n }", "void setDimension(double width, double height);", "public CustomRectangle() { }", "Box(Box ob){ //passing object to constructor\n\t\twidth = ob.width;\n\t\theight = ob.height;\n\t\tdepth = ob.depth;\n\t\t}", "Canvas(int width, int height){\n\t\tthis.components = new ArrayList<Component>();\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public Rectangle() {\n x = 0;\n y = 0;\n width = 0;\n height = 0;\n }", "public City(int width, int height) {\r\n\t\tthis.size_w = width;\r\n\t\tthis.size_h = height;\r\n\t\tcity_squares = new Gridpanel[getSize_h()][getSize_w()];\r\n\t}", "public CheckerboardImage(int tileSize, int width, int height)\n throws IllegalArgumentException {\n if (tileSize < 0 || width < 0 || height < 0) {\n throw new IllegalArgumentException(\"Cannot have negative value.\");\n }\n this.tileSize = tileSize;\n this.width = width;\n this.height = height;\n }", "public Rectangle (String aName, int aLength, int aWidth) {\n\t\tname = aName;\n\t\tlength = aLength;\n\t\twidth = aWidth;\n\t}", "public Rectangle () {\n\t\t\n\t}", "public Image(Renderer renderer, TextureReference texture, float texture_x, float texture_y, float texture_w,\r\n\t\t\tfloat texture_h, float width, float height) {\r\n\t\tsuper();\r\n\t\tthis.renderer = renderer;\r\n\t\tthis.texture = texture;\r\n\t\tthis.textureX = texture_x;\r\n\t\tthis.textureY = texture_y;\r\n\t\tthis.textureWidth = texture_w;\r\n\t\tthis.textureHeight = texture_h;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t}", "ImageProcessor(int width, int height) {\n this.width = width;\n this.height = height;\n centroids = new LinkedList<>();\n centroids.add(0);\n foregroundMovement = new LinkedList<>();\n foregroundMovement.add(0);\n foregroundMovement.add(0);\n tempForegroundMovement = new LinkedList<>();\n tempForegroundMovement.add(0);\n tempForegroundMovement.add(0);\n boxMovement = new LinkedList<>();\n boxMovement.add(0);\n boxMovement.add(0);\n\n // Used to communicate with game engine\n change = new PropertyChangeSupport(this);\n }", "public Rectangle(String id, double height, double width) {\n\t\tsuper(id);\n\t\t\n\t\t// Initialized here for local use\n\t\tthis.height = height;\n\t\tthis.width = width;\n\t\t\n\t\t// Adds these variables to the array \"sideLengths\" \n\t\tthis.sideLengths.add(height);\n\t\tthis.sideLengths.add(height);\n\t\tthis.sideLengths.add(width);\n\t\tthis.sideLengths.add(width);\n\t}", "public Tesseract4(int l, int w, int h, int wDim)\n {\n // call superclass\n super(l, w, h);\n\n //Init instance vars\n wDimension = wDim;\n\n }" ]
[ "0.76474863", "0.76474863", "0.74248964", "0.73131216", "0.71495456", "0.70131725", "0.7012864", "0.700418", "0.6930825", "0.6913676", "0.6906826", "0.68476236", "0.6815502", "0.6815362", "0.6809706", "0.6807199", "0.6792909", "0.6762098", "0.6741957", "0.67383784", "0.6722745", "0.67221814", "0.6660365", "0.6597673", "0.6586824", "0.6573119", "0.6560475", "0.6557735", "0.65549946", "0.65314114", "0.6516333", "0.6482648", "0.647601", "0.64494646", "0.6444801", "0.64346075", "0.6424959", "0.64223504", "0.6418624", "0.6412797", "0.6412358", "0.64123076", "0.6404634", "0.6379506", "0.63675666", "0.63460183", "0.63376755", "0.63237965", "0.63230705", "0.63208157", "0.6315774", "0.63126516", "0.6311959", "0.6311837", "0.6309378", "0.629898", "0.62952214", "0.6273665", "0.62680113", "0.6250787", "0.6245049", "0.6223971", "0.62188774", "0.6201143", "0.62011397", "0.6200529", "0.619811", "0.6166895", "0.6157072", "0.61336935", "0.6115715", "0.6112638", "0.6111749", "0.6091868", "0.6074577", "0.60743815", "0.60742486", "0.6067671", "0.60672665", "0.60635287", "0.60561645", "0.6054597", "0.60540944", "0.6037876", "0.60361123", "0.60312355", "0.6019735", "0.6003835", "0.6000385", "0.59927356", "0.5985464", "0.5984272", "0.5982916", "0.59788316", "0.5976706", "0.5967029", "0.59649396", "0.59505844", "0.5948199", "0.59410644" ]
0.64253557
36
/ Define a public method `getArea` which can calculate the area of the rectangle and return.
public int getArea() { return this.height * this.width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Rectangle getArea() {\n return area;\n }", "double getArea();", "double getArea();", "public double getArea();", "public double getArea();", "public double getArea();", "public abstract double getArea();", "public abstract double getArea();", "public abstract double getArea();", "public abstract float getArea();", "double getArea() {\n return width * height;\n }", "public double getArea() {\n\t\treturn this.area;\n\t}", "public abstract int getArea();", "public double getArea()\n {\n return area;\n }", "@Override\n\tpublic double getArea() {\n\t\treturn height * width;\n\t}", "@Override\r\n\tpublic double getArea() {\n\t\treturn (this.base * this.height)/2;\r\n\t}", "double getArea(){\n return height*width;\n }", "public double getArea() {\n return ((this.xR - this.xL) * (this.yT - this.yD));\n }", "double area() {\n System.out.println(\"Inside Area for Rectangle.\");\n return dim1 * dim2;\n }", "public double get_Area() {\n return this.Area;\n }", "public abstract float calArea();", "@Override\r\n\tpublic double getArea() {\n\t\tdouble Area1 = ((super.getLength() * height));\r\n\t\tdouble Area2 = ((super.getWidth() * height));\r\n\t\treturn (Area1 * 2 + Area2 * 2 + super.getArea() * 2);\r\n\t\t\r\n\t}", "@Override\r\n\tpublic double getArea() {\r\n\t\treturn width * height;\r\n\t}", "@Override\r\n\tpublic double getArea() {\r\n\t\treturn width * height;\r\n\t}", "public double getArea() {\n /*\n * area = base (1o lado ou 3o lado) x altura (2o lado ou 4o lado)\n */\n\n return this.getLado(1) * this.getLado(2);\n }", "public int area() {\n \tarea = width()*height();\n }", "public int getArea()\n {\n return area;\n }", "public float getArea() {\n return area;\n }", "public double getArea() {\n\t\treturn super.getArea()*height;\r\n\t}", "@Override\n public double getArea() {\n return (int) this.radiusX * (int) this.radiusY * Math.PI;\n }", "public double getArea(){\n if (getHeight()<0 || getWidth()<0){\n System.out.println(\"Input Invalid\");\n return -1;\n }\n return (getWidth() * getHeight());\n }", "public Integer getArea() {\n\t\treturn this.getX() * this.getY();\n\t}", "@Override\n\tpublic double getArea() {\n\t\tdouble p = getPerimeter() / 2;\n\t\tdouble s = p * ((p - side1) * (p - side2) * (p - side3));\n\t\tdouble Area = Math.sqrt(s);\n\t\treturn Area;\n\t}", "static Double computeArea() {\n // Area is height x width\n Double area = height * width;\n return area;\n }", "public double getArea() {\n\t\treturn height * length;\n\t}", "@Override\n public double obtenerArea(){\n return c.obtenerArea() * 4;\n }", "@Override\n\tpublic double getArea() {\n\t\treturn (this.getPerimetro()*Math.sqrt(Math.pow(getLongitudLado(), 2))-(Math.pow((getLongitudLado()/2), 2)))/2;\n\t}", "@Override\n public double getArea() {\n return this.length*this.width; //To change body of generated methods, choose Tools | Templates.\n }", "public Polygon getArea() {\n\t\treturn area;\n\t}", "public double getArea() {\n\t\treturn 4.0 * Math.PI * this.radius * this.radius;\n\t}", "public double getArea(){\n return 3.14 * radius * radius;\n }", "double calculateArea();", "public double area() {\n\t\treturn width * height;\n\t}", "public double getArea() {\n\t\treturn this.radius * this.radius * Math.PI;\n\t}", "Double getAreaValue();", "@Override\n\tpublic double getArea() {\n\t\treturn (0.5*this.base*this.height);\n\t}", "public abstract double calculateArea();", "public abstract double calculateArea();", "public double area() {\n return (width * height);\n }", "public int getArea() {\n\t\treturn area;\n\t}", "public int getArea() {\n return (getXLength() * getYWidth());\n }", "@Override\n\tpublic double getArea() {\n\t\treturn width * length;\n\t}", "@Override\n public double getArea() {\n double area = this.length*this.width;\n return area;\n }", "public double getArea() {\n\t\tdouble area = Math.round(2 * Math.pow(sideLength, 2) * \n\t\t\t\t(1 + Math.sqrt(2)));\n\t\t\n\t\treturn area;\n\t}", "public double area();", "public int area() {\r\n\t\tint area = (getLength()) * (getBreath());\r\n\t\treturn (area);\r\n\t}", "public double getArea (){\n int area = length * length;\n System.out.println(area);\n return area;\n }", "public float getArea(){\n return area;\n\t}", "public double area(){\n return (base*height) / 2;\n }", "protected double getArea()\r\n {\r\n return ( side * side ) / 2;\r\n }", "public final double getArea() {\n\t\treturn (area < 0) ? computeArea() : area;\n\t}", "public double getArea() {\n return this.length * this.width;\n }", "public double getArea(){\n double p = (side1 + side2 + side3) / 2;\n return Math.sqrt(p * (p - side1) * (p - side2) * (p - side3));\n }", "public void getArea() {\n\t\ts = (double) (a + b + c) / 2;\n\t\tarea = Math.sqrt(s * (s - a) * (s - b) * (s - c));\n\t\tSystem.out.println(\"Area: \" + area);\n\t}", "@Override\n public double getArea() {\n return width * width;\n }", "@Override\r\n public double area() {\n return height*width;\r\n }", "public double area()\n {\n double area = length * width;\n //System.out.println(area);\n return area;\n }", "public double getArea() {\n return Math.PI * Math.pow(radius, 2.0);\n }", "public double area(){\n\t\tdouble area=length*width;\r\n\t\treturn area;\r\n\t}", "public double getArea()\r\n\t{\r\n\t\treturn(super.getHeight()*super.getWidth());\r\n\t}", "@Override\n\tpublic double getArea() {\n\t\treturn width*length;\n\t}", "@Override\n\tpublic double getArea() {\n\t\treturn width*length;\n\t}", "public double areaRectangulo() {\n double area = altura * ancho;\n return area;\n }", "public abstract float area();", "public abstract double computeArea();", "public double getArea()\r\n\t{\r\n\t\tdouble area = Math.PI*(Math.pow(radius, 2));\r\n\t\treturn area;\r\n\t}", "public String getArea() {\n return this.area;\n }", "abstract double area();", "abstract double area();", "abstract double area();", "abstract double area();", "@Override\n\tpublic double getArea() {\n\t\treturn (2 + 2 * (Math.sqrt(2))) * side * side; // JA\n\t}", "public double getArea()\n\t{\n\t\tdouble area = Math.PI * Math.pow(radius, 2); \n\t\treturn area;\n\t}", "@Override\r\n public double calculateArea() {\n double area = 0;\r\n return area;\r\n }", "public double area()\r\n {\r\n float dx = tr.getX() - bl.getX();\r\n float dy = tr.getY() - bl.getY();\r\n return dx*dy;\r\n }", "public double getCircleArea();", "public double getArea() {\n return x * y;\n }", "@Override\n public double getArea() {\n double s = (a + b + c) / 2;\n return Math.sqrt(s * (s - a) * (s - b) * (s - c));\n }", "@Override\n\tpublic double getArea() {\n\t\treturn Math.pow(getSide(), 2) * this.N / 4 * (Math.tan(Math.toRadians(180 / this.N)));\n\t}", "@Override\r\n\tpublic double area() {\r\n\r\n\t\treturn this.sideA*this.sideB;\r\n\t}", "public double area()\r\n {\r\n double area;\r\n \r\n area = mRadius * mRadius * 3.14159;\r\n \r\n return area;\r\n }", "public double rectangleArea(double width, double height)\n\t{\n\t\treturn (width*height);\n\t}", "@Override\n\tpublic double getArea(){\n\t\tdouble ab_ac_area = get_triangle_area(getVector_AB(),getVector_AC());\n\t\t\n\t\t//area of vector ac and ad\n\t\tdouble ac_ad_area = get_triangle_area(getVector_AC(),getVector_AD());\n\t\t\n\t\t//area of vector ab and ad\n\t\tdouble ab_ad_area = get_triangle_area(getVector_AC(),getVector_AD());\n\t\t\n\t\t//area of vector bc and bd\n\t\tdouble bc_ad_area = get_triangle_area(getVector_BC(),getVector_BD());\n\t\t\n\t\t//sum \n\t\treturn ab_ac_area + ac_ad_area + ab_ad_area + bc_ad_area;\n\t}", "double getArea(){\n return 3.14 * raggio * raggio;\n }", "@Override\n\tpublic double getArea()\n\t{\n\t\treturn isAtivado() ? calculaArea(getDiametro()) : 0.0;\n\t}", "public double Area() {\r\n \treturn(getLength() * getWidth());\r\n }", "public int getArea()\n {\n return this.length * this.width;\n }", "public double calcArea() {\r\n\t\tdouble area = length * width;\r\n\t\treturn area;\r\n\t}", "public String getArea() {\n return area;\n }", "public String getArea() {\n return area;\n }" ]
[ "0.86227924", "0.85988116", "0.85988116", "0.8512758", "0.8512758", "0.8512758", "0.83431387", "0.83431387", "0.83431387", "0.816596", "0.8127072", "0.8032444", "0.8002692", "0.79883236", "0.79846734", "0.7958184", "0.7939954", "0.7937622", "0.79369825", "0.79349893", "0.7898119", "0.7867467", "0.78459066", "0.78459066", "0.7843454", "0.78368294", "0.7828634", "0.7828118", "0.7815632", "0.7804794", "0.7803676", "0.77877456", "0.77848655", "0.77811426", "0.77810365", "0.77793074", "0.7774771", "0.77726537", "0.77646375", "0.77450097", "0.7744575", "0.7737872", "0.7731207", "0.77267873", "0.771015", "0.7704952", "0.7673883", "0.7673883", "0.7673043", "0.7672816", "0.76645935", "0.76609546", "0.76574934", "0.7654144", "0.7649166", "0.7645491", "0.76376957", "0.7631696", "0.76266074", "0.7615708", "0.7614141", "0.76130426", "0.76127785", "0.75861347", "0.7583727", "0.7582146", "0.7578885", "0.7559981", "0.7545781", "0.75447977", "0.75340426", "0.75340426", "0.75316626", "0.7529025", "0.7526592", "0.752297", "0.7519195", "0.75164574", "0.75164574", "0.75164574", "0.75164574", "0.7509785", "0.750352", "0.7499493", "0.7492736", "0.74808335", "0.7477612", "0.7468746", "0.7467079", "0.74668527", "0.7466203", "0.746496", "0.74621254", "0.745311", "0.7448934", "0.74453974", "0.7435457", "0.74128646", "0.7410928", "0.7410928" ]
0.79060817
20
no physicsComponent for this entity handleCollision should be associated with PhysicsComponent instead of Entity, but it is not worth extending PhysicsComponent until subclasses can be used more than once
@Override public void handleCollision(Contact contact) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void collide(Entity e) {\n\n\t}", "public abstract void collideWith(Entity entity);", "public void applyEntityCollision(Entity entityIn) {\n }", "@Override\n\tpublic void onCollision(Entity collidedEntity)\n\t{\n\t\t\n\t}", "public void handleCollision(Collision c);", "@Override\r\n\tpublic void Collision(Entity e)\r\n\t{\r\n\t\tthis.isAlive = false;\r\n\t}", "public void collide(Entity entity) throws IllegalArgumentException{\n\t \n \tif (this instanceof Ship && entity instanceof Ship) this.defaultCollide(entity);\n \telse if (this instanceof MinorPlanet && entity instanceof MinorPlanet) this.defaultCollide(entity);\n \telse if (entity instanceof Bullet) {\n \t\tBullet bullet = (Bullet) entity;\n \t\tif (bullet.getBulletSource() == this) bullet.bulletCollideOwnShip((Ship) this);\n \t\telse bullet.bulletCollideSomethingElse(this);\n \t\t}\n \t\n \telse if (this instanceof Bullet) {\n \t\tBullet bullet = (Bullet) this;\n \t\tif (bullet.getBulletSource() == entity) bullet.bulletCollideOwnShip((Ship) entity);\n \t\telse bullet.bulletCollideSomethingElse(entity);\n \t\t}\n \t\n \telse if ((this instanceof Ship && entity instanceof Asteroid) || (entity instanceof Ship && this instanceof Asteroid)){\n \t\tShip ship = null;\n \t\tif (this instanceof Ship){\n \t\t\tship = (Ship) this;\n \t\t} else {\n \t\t\tship = (Ship) entity;\n \t\t}\n \t\tship.terminate();\n \t}\n \t\n \telse if ((this instanceof Ship && entity instanceof Planetoid) || (entity instanceof Ship && this instanceof Planetoid)){\n \t\tShip ship = null;\n \t\tif (this instanceof Ship){\n \t\t\tship = (Ship) this;\n \t\t} else {\n \t\t\tship = (Ship) entity;\n \t\t}\n \t\t\n \t\tWorld world = ship.getSuperWorld();\n \t\tdouble xnew = Helper.randomInBetween(this.getRadius(), world.getWorldWidth());\n \t\tdouble ynew = Helper.randomInBetween(this.getRadius(), world.getWorldHeight());\n \t\tship.setPosition(xnew, ynew);\n \t\t\n \t\twhile (! this.overlapAnyEntity()){\n \t\t\txnew = Helper.randomInBetween(this.getRadius(), world.getWorldWidth());\n \t\t\tynew = Helper.randomInBetween(this.getRadius(), world.getWorldHeight());\n \t\t\tship.setPosition(xnew, ynew);\n \t\t\t}\n \t}\n\t \t\n \t\n }", "public void handleCollision(ISprite collisionSprite, Collision collisionType);", "void checkCollision(Entity other);", "@Override\n\tpublic void doCollision(CollisionResult c) {\n\t\t\n\t}", "public void collideWith(Rigidbody obj) {\n\t\t\r\n\t}", "@Override\n\tpublic boolean checkCollision() {\n\t\treturn true;\n\t}", "private CollisionLogic() {}", "public abstract boolean collide(int x, int y, int z, int dim, Entity entity);", "public abstract void collide(InteractiveObject obj);", "@Override\n\tpublic void onCollision(Model collisionModel, ColBox collisionColbox) {\n\n\t}", "public abstract void collision(SpaceThing thing);", "public void collision(Collidable collider);", "public abstract boolean collisionWith(CollisionObject obj);", "public interface Entity {\n /**\n * Method's purpose it to update any relevant state in the entity.\n * Meant to be called before every render, and allows\n * for entities to move or change over time.\n *\n * @param delta time step from when this was last called.\n */\n void update(float delta);\n\n /**\n * Method's purpose is to draw the entity on the screen.\n * Meant to be called every frame, and allows\n * for entities to show be viewed by humans.\n *\n * @param rendererTool Object with which the entity will use to render itself.\n */\n void render(Object rendererTool);\n\n /**\n * Method's purpose it to allow entities to either be drawn with a\n * ShapeRenderer or SpriteBatch. Must be respected when calling render.\n *\n * @return SHAPE_RENDERER if the Entity must be rendered with a ShapeRenderer\n * SPRITE_BATCH if the Entity must be rendered with a SpriteBatch\n */\n RenderTool getRenderTool();\n\n /**\n * Enum that represents the different render tools entity's can use to render\n * themselves.\n */\n enum RenderTool {\n SHAPE_RENDERER, SPRITE_BATCH\n }\n\n /**\n * Method's purpose is to be able to tell when to entities collide,\n * as this is the most common form of interaction between to entities\n * Currently, what to do when a collision occurs is governed by the\n * Collisions class. Calls Collisions.collided(this, other) if\n * this and other overlap with each other.\n *\n * @param other The entity this one is being checked against.\n */\n void checkCollision(Entity other);\n\n /**\n * Method's purpose is to allow an EntityObserver\n * to get notified when the entity expires.\n *\n * @param observer EntityObserver to add to the list of observers\n * to notify when the entity expires.\n */\n void addObserver(EntityObserver observer);\n\n /**\n * Method's purpose is to allow an EntityObserver\n * to cleanse itself from it's responsibilities to\n * the entity class by ignoring the Entity's expiration.\n *\n * @param observer EntityObserver to remove from the list of observers\n * to notify when the entity expires.\n */\n void removeObserver(EntityObserver observer);\n\n /**\n * Method's purpose is to allow the Entity\n * to tell all of it's observers that it has\n * expired, and thus all references of the\n * Entity should be removed, and the other\n * methods of this interface should not\n * be called.\n */\n @SuppressWarnings(\"unused\")\n void expire();\n\n /**\n * Method's purpose is to allow the Entity\n * to tell all of it's observers that it\n * has spawned a new Entity and to add\n * this new Entity to it's list of entities.\n *\n * @param entity The entity to be spawned.\n */\n @SuppressWarnings(\"unused\")\n void spawn(Entity entity);\n}", "@Override\n public void collide(CollisionEvent e) {\n \n if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof Health) {\n prime.incrementHealthCount();\n healthSound.play();\n e.getReportingBody().destroy();\n \n \n }\n \n else if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof Emerald) {\n prime.incrementEmeraldCount();\n emeraldSound.play();\n e.getReportingBody().destroy();\n }\n \n else if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof DeadZone) {\n e.getReportingBody().destroy();\n System.exit(0);\n } \n \n else if (e.getReportingBody() instanceof Boss && e.getOtherBody() instanceof FireBall){\n e.getOtherBody().destroy();\n System.out.println(\"boss hit\");\n }\n \n else if (e.getReportingBody() instanceof StaticBody && e.getOtherBody() instanceof FireBall){\n e.getOtherBody().destroy();\n System.out.println(\"boss hit\");\n } \n \n }", "public abstract void onCollision();", "public void collisionDetection(){\r\n\t\tif( this.isActiv() ){\r\n\t\t\tif( this.isCollided() ){\r\n\t\t\t\tthis.onCollision();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected abstract boolean doHandleCollision(E movingEntity,\n Entity otherEntity,\n T game)\n throws CollisionException;", "@Override\n public void update(float dt) {\n\n\n for (GameObject g : getGameObjectList()) {\n Collider gameObjectCollider = g.getComponent(Collider.class);\n if (g.getSID() instanceof Map.Block ) {\n continue;\n }\n gameObjectCollider.reduceAvoidTime(dt);\n\n for (GameObject h : getGameObjectList()) {\n Collider gameObjectCollider2 = h.getComponent(Collider.class);\n if (g.equals(h)) {\n continue;\n }\n\n if ((gameObjectCollider.bitmask & gameObjectCollider2.layer) != 0) {\n if (gameObjectCollider2.layer == gameObjectCollider.layer){\n continue;\n }\n\n TransformComponent t = g.getComponent(TransformComponent.class);\n Vector2f pos1 = g.getComponent(Position.class).getPosition();\n FloatRect rect1 = new FloatRect(pos1.x, pos1.y, t.getSize().x, t.getSize().y);\n TransformComponent t2 = g.getComponent(TransformComponent.class);\n Vector2f pos2 = h.getComponent(Position.class).getPosition();\n FloatRect rect2 = new FloatRect(pos2.x, pos2.y, t2.getSize().x, t2.getSize().y);\n FloatRect collision = rect2.intersection(rect1);\n if (collision != null) {\n Collider mainCollider = g.getComponent(Collider.class);\n Collider collidingWith = h.getComponent(Collider.class);\n\n\n if (!(mainCollider.checkGameObject(h)||collidingWith.checkGameObject(g)))\n {\n if (mainCollider.events == true && collidingWith.events == true)\n {\n\n\n if ((g.getBitmask() & BitMasks.produceBitMask(CollisionEvent.class)) == 0)\n {\n g.addComponent(new CollisionEvent());\n\n\n }\n g.getComponent(CollisionEvent.class).getG().add(h);\n if ((h.getBitmask() & BitMasks.produceBitMask(CollisionEvent.class)) == 0) {\n h.addComponent(new CollisionEvent());\n\n }\n h.getComponent(CollisionEvent.class).getG().add(g);\n\n }\n\n\n if (mainCollider.dieOnPhysics == true) {\n EntityManager.getEntityManagerInstance().removeGameObject(g);\n }\n if (mainCollider.physics == true && collidingWith.physics == true) {\n float resolve = 0;\n float xIntersect = (rect1.left + (rect1.width * 0.5f)) - (rect2.left + (rect2.width * 0.5f));\n float yIntersect = (rect1.top + (rect1.height * 0.5f)) - (rect2.top + (rect2.height * 0.5f));\n if (Math.abs(xIntersect) > Math.abs(yIntersect)) {\n if (xIntersect > 0) {\n resolve = (rect2.left + rect2.width) - rect1.left;\n } else {\n resolve = -((rect1.left + rect1.width) - rect2.left);\n }\n g.getComponent(Position.class).addPosition(new Vector2f(resolve, 0));\n } else {\n if (yIntersect > 0) {\n resolve = (rect2.top + rect2.height) - rect1.top;\n\n } else\n {\n resolve = -((rect1.top + rect1.height) - rect2.top);\n }\n g.getComponent(Position.class).addPosition(new Vector2f(0, resolve));\n }\n }\n }\n\n\n }\n }\n }\n }\n }", "public void unitCollision() {\n\t}", "protected void onCollision(Actor other) {\r\n\r\n\t}", "public void start(EntityEntityCollisionEvent event) {\n\n }", "@Override\n\tpublic boolean hasCollide(Entity e) {\n\t\treturn rect.intersects(e.getRectangle());\n\t}", "@Override protected boolean drag_collide(float newX, float newY, Entity e){\n\n\n boolean collides=\n e.collideLine(x, y, newX, newY) ||\n e.collideLine(x + thirdWidth, y, newX+thirdWidth, newY) ||\n e.collideLine(x, y+height, newX, newY+height) ||\n e.collideLine(x + thirdWidth, y+height, newX+thirdWidth, newY+height) ||\n\n e.collideLine(2*thirdWidth + x, y, 2*thirdWidth + newX, newY) ||\n e.collideLine(2*thirdWidth + x + thirdWidth, y, 2*thirdWidth + newX+thirdWidth, newY) ||\n e.collideLine(2*thirdWidth + x, y+height, 2*thirdWidth + newX, newY+height) ||\n e.collideLine(2*thirdWidth + x + thirdWidth, y+height, 2*thirdWidth + newX+thirdWidth, newY+height)\n ;\n return collides;\n }", "void checkHandleContactWithNonPlayerCharacters() {\n if (this.doesAffectNonPlayers) {\n // boundary collision for non-player characters\n for (ACharacter curCharacter : this.mainSketch.getCurrentActiveLevelDrawableCollection().getCharactersList()) {\n if (this.contactWithCharacter(curCharacter)) {\n curCharacter.handleContactWithVerticalBoundary(this.startPoint.x);\n\n } else if (curCharacter instanceof ControllableEnemy) { // this DOES NOT have contact with character AND character is controllable\n ((ControllableEnemy) curCharacter).setAbleToMoveLeft(true);\n ((ControllableEnemy) curCharacter).setAbleToMoveRight(true);\n }\n }\n }\n }", "public void applyEntityCollision(Entity var1)\n {\n if (this.gotMovement)\n {\n if (var1 instanceof EntitySentry || var1 instanceof EntityTrackingGolem || var1 instanceof EntitySliderHostMimic || var1 instanceof EntitySentryGuardian || var1 instanceof EntitySentryGolem || var1 instanceof EntityBattleSentry || var1 instanceof EntitySlider || var1 instanceof EntityMiniSlider)\n {\n return;\n }\n\n boolean var2 = var1.attackEntityFrom(DamageSource.causeMobDamage(this.slider), 6);\n\n if (var2 && var1 instanceof EntityLiving)\n {\n this.worldObj.playSoundAtEntity(this, \"aeboss.slider.collide\", 2.5F, 1.0F / (this.rand.nextFloat() * 0.2F + 0.9F));\n\n if (var1 instanceof EntityCreature || var1 instanceof EntityPlayer)\n {\n EntityLiving var3 = (EntityLiving) var1;\n var3.motionY += 0.35D;\n var3.motionX *= 2.0D;\n var3.motionZ *= 2.0D;\n }\n\n this.stop();\n }\n }\n }", "public void collide(CollisionEvent evt) {\n\t\tthis.colliding = true;\n\t\tif(evt.getEntity().getType().equals(\"PlayerCharacter\") && evt.getDirection().equals(Direction.TOP)){\n\t\t\tthis.addVector2D(new Vector2D(0,2));\n\t\t}\n\t\tif (this.getCollideTypes().contains(evt.getEntity().getType())\n\t\t\t\t&& (evt.getDirection().equals(Direction.BOTTOM))) {\n\t\t}\n\t}", "public abstract void collided(Collision c);", "private void handleObjectCollision() {\n \tGObject obstacle = getCollidingObject();\n \t\n \tif (obstacle == null) return;\n \tif (obstacle == message) return;\n \t\n\t\tvy = -vy;\n\t\t\n\t\tSystem.out.println(\"ball x: \" + ball.getX() + \" - \" + (ball.getX() + BALL_RADIUS * 2) );\n\t\tSystem.out.println(\"paddle x: \" + paddleXPosition + \" - \" + (paddleXPosition + PADDLE_WIDTH) );\n\t\tif (obstacle == paddle) {\n\t\t\tpaddleCollisionCount++;\n\t\t\t\n\t\t\t// if we're hitting the paddle's side, we need to also bounce horizontally\n\t\t\tif (ball.getX() >= (paddleXPosition + PADDLE_WIDTH) || \n\t\t\t\t(ball.getX() + BALL_RADIUS * 2) <= paddleXPosition ) {\n\t\t\t\tvx = -vx;\t\t\t\t\n\t\t\t}\n\t\t} else {\n \t\t// if the object isn't the paddle, it's a brick\n\t\t\tremove(obstacle);\n\t\t\tnBricksRemaining--;\n\t\t}\n\t\t\n\t\tif (paddleCollisionCount == 7) {\n\t\t\tvx *= 1.1;\n\t\t}\n }", "public void tick() {\n if (!isActive || !entities[0].canCollide || !entities[1].canCollide) {\n return;\n }\n\n rectangles[0].x = boundaries[0].x - 1;\n rectangles[1].x = boundaries[1].x - 1;\n rectangles[0].y = boundaries[0].y - 1;\n rectangles[1].y = boundaries[1].y - 1;\n\n isCollided = rectangles[0].intersects(rectangles[1]);\n\n if (isCollided && !firedEvent) {\n lastEvent = new EntityEntityCollisionEvent(this);\n onCollide();\n start(lastEvent);\n firedEvent = true;\n }\n if (!isCollided && firedEvent) {\n onCollisionEnd();\n end(lastEvent);\n firedEvent = false;\n }\n if (previouslyCollided != isCollided) {\n setBoundaryColors();\n }\n\n previouslyCollided = isCollided;\n }", "void onNoCollision();", "public E3DCollisionHandler(E3DEngine engine)\r\n\t{\r\n\t super(engine);\r\n COLLISIONDETECTOR_SEGMENT = new E3DCollisionDetectorSegment(engine);\r\n COLLISIONDETECTOR_TRIANGLE = new E3DCollisionDetectorTriangles(engine);\r\n\t}", "CollisionRule getCollisionRule();", "@Override\r\n\tpublic boolean collides (Entity other)\r\n\t{\r\n\t\tif (other == owner || other instanceof Missile)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn super.collides(other);\r\n\t}", "@Override\n\tpublic void createCollisionShape() {\n\t\t\n\t}", "public void noCollision(){\r\n this.collidingEntity2=null;\r\n this.collidingEntity=null;\r\n collidedTop=false;\r\n collide=false;\r\n }", "public boolean collision(Objet o) {\r\n\t\treturn false;\r\n\t}", "public void collideBoundary() {\n\t\tif (getWorld() == null) return;\n\t\tif (getXCoordinate() < 1.01*getRadius())\n\t\t\tsetXVelocity(-getXVelocity());\n\t\tif (getXCoordinate() > getWorld().getWidth()-1.01*getRadius())\n\t\t\tsetXVelocity(-getXVelocity());\n\t\tif (getYCoordinate() < 1.01 * getRadius())\n\t\t\tsetYVelocity(-getYVelocity());\n\t\tif (getYCoordinate() > getWorld().getHeight()-1.01*getRadius())\n\t\t\tsetYVelocity(-getYVelocity());\n\t}", "@Override\n\tpublic void handleCollision(GameObject otherObject) {\n\t\tif(otherObject instanceof Drone) {\n\t\t\tSystem.out.println(\"PlayerCyborg collided with a Drone cause 1 damage\\n\");\n\t\t\tthis.setDamageLevel(this.getDamageLevel()+1);\n\t\t}\n\t\telse if(otherObject instanceof NonPlayerCyborg) {\n\t\t\tSystem.out.println(\"PlayerCyborg collided with another cyborg cause 2 damage\\n\");\n\t\t\tthis.setDamageLevel(this.getDamageLevel()+2);\n\t\t}\n\t\telse if(otherObject instanceof Base) {\n\t\t\tint BaseID = ((Base) otherObject).getBaseID();\n\t\t\tif(this.getLastBaseReached()+1 == BaseID){\n\t\t\t\tint newBaseID = this.getLastBaseReached()+1;\n\t\t\t\tthis.setLastBaseReached(newBaseID);\n\t\t\t\tif(this.getLastBaseReached()+1 < 4){\n\t\t\t\t\tSystem.out.println(\"PlayerCyborg reach to base \" + newBaseID + \"\\n\");\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Please collide base in sequential!\\n\" + \n\t\t\t\t\t\t \"The next sequential is \" + (this.getLastBaseReached()+1) + \"\\n\");\n\t\t\t}\n\t\t}\n\t\telse if(otherObject instanceof EnergyStation) {\n\t\t\tif(((EnergyStation) otherObject).getCapacity()!=0) {\n\t\t\t\tint beforeRuel = this.getEnergyLevel();\n\t\t\t\tif(this.getEnergyLevel()+((EnergyStation) otherObject).getCapacity()<this.getMaxEnergyLevel()) {\n\t\t\t\t\tthis.setEnergyLevel(this.getEnergyLevel()+((EnergyStation) otherObject).getCapacity());\n\t\t\t\t}else {\n\t\t\t\t\tthis.setEnergyLevel(this.getMaxEnergyLevel()); //over fuel the Energy\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"PlayerCyborg collided with a EnergyStation refuel \" + Math.abs(this.getEnergyLevel()-beforeRuel) + \" Energy\\n\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void onCollision(ICollidableObject collideWith) {\n\t\t\n\t\tif(collideWith != expediteur)\n\t\t{\n\t\t\tif(collideWith instanceof ActiveEntity)\n\t\t\t\tcollideWith.onCollision(this);\n\t\t\t\n\t\t\tMessage m = new Message();\n\t\t\tm.instruction = MessageKey.I_REMOVE_ENTITY;\n\t\t\tm.i_data.put(MessageKey.P_ID, id);\n\t\t\tm.engine = EngineManager.LOGIC_ENGINE;\n\t\t\t\n\t\t\tengineManager.receiveMessage(m);\n\t\t}\n\t}", "public interface Entity {\n /**\n * check whether a collision with another entity happened\n * and perform the relevant action.\n * @param e the other entity\n * @return whether the collision happened\n */\n boolean collidedWith(Entity e);\n\n void draw(Graphics g, DisplayWriter d);\n\n void doLogic(long delta);\n\n void move(long delta);\n\n /**\n * whether or not the entity is out of the currently displayed area.\n * @return true if not visible\n */\n boolean outOfSight();\n}", "@Override\r\n public void collideEffect(Spatial s) {\n }", "private void collide(String typeOfCollision, Entity first, Entity second) {\n switch (typeOfCollision) {\n\n case \"playerWithWall\":\n intersectPlayerWithWall(first);\n break;\n\n case \"playerWithHazard\":\n intersectPlayerWithWall(first);\n break;\n\n case \"bulletWithWall\":\n room.getEntityManager().removeEntity(first);\n ((WeaponComponent) player.getComponent(ComponentType.WEAPON)).getBullets().removeEntity(first);\n break;\n\n case \"enemyWithWall\":\n intersectEnemyWithWall(first, second);\n break;\n\n case \"enemyWithBullet\":\n intersectBulletWithEnemy(first, second);\n break;\n\n case \"enemyWithEnemy\":\n intersectEnemyWithWall(first, second);\n break;\n\n case \"enemyWithPlayer\":\n NinjaEntity ninja = (NinjaEntity) second;\n ninja.setIsHit(true);\n break;\n\n case \"itemWithPlayer\":\n itemIntersectsPlayer(first);\n break;\n\n case \"swordWithEnemy\":\n intersectSwordWithEnemy(first, second);\n break;\n }\n }", "@Override\n public final void handleCollision(final E movingEntity,\n final Entity otherEntity,\n final T game)\n throws CollisionException\n {\n if(movingEntity == null)\n {\n throw new IllegalArgumentException(\"movingEntity cannot be null\");\n }\n if(game == null)\n {\n throw new IllegalArgumentException(\"game cannot be null\");\n }\n if(!doHandleCollision(movingEntity, otherEntity, game))\n {\n throw new CannotCollideWithException(movingEntity, otherEntity);\n }\n }", "@Override\n\tpublic void collision(SimpleObject s) {\n\t\t\n\t}", "void setCollisionRule(CollisionRule collisionRule);", "void collisionHappened(int position);", "@Override\n\tprotected void collideEnd(Node node) {\n\n\t}", "public void collideBoundary(){\n\t \tint bulletBouncer = 0;\n\t \tif ((this.getPosition()[0]-(this.getRadius()) <= 0.0 || (this.getPosition()[0]+(this.getRadius()) >= this.superWorld.getWorldWidth()))){\n\t \t\tif (this instanceof Bullet){\n\t \t\t\tbulletBouncer++;\n\t \t}\n\t \t\tthis.velocity.setXYVelocity( this.velocity.getVelocity()[0] * -1);\n\t \t}\n\t \tif ((this.getPosition()[1]-(this.getRadius()) <= 0.0 || (this.getPosition()[1]+(this.getRadius()) >= this.superWorld.getWorldHeight()))){\n\t \t\tif (this instanceof Bullet){\n\t \t\tbulletBouncer++;\n\t \t}\n\t \t\tthis.velocity.setYVelocity(this.velocity.getVelocity()[1] * -1);\n\t \t} \t\n\t \tif (this instanceof Bullet){\n\t \tBullet bullet = (Bullet) this;\n\t \tfor (int i = 0; i < bulletBouncer; i++){\n\t \t\tif (!bullet.isTerminated())\n\t \t\tbullet.bouncesCounter();\n\t \t}\n\t \t}\n\t }", "@Override\r\n public boolean collision(org.dyn4j.dynamics.Body body1, BodyFixture fixture1, org.dyn4j.dynamics.Body body2, BodyFixture fixture2) {\r\n //Default, keep processing this event\r\n\r\n return true;\r\n }", "public abstract void processCollisions();", "@Override\n public void checkCollision( Sprite obj )\n {\n \n }", "public boolean isCollision(double x, double y) {\n return false;\n }", "@Override\n public boolean collide(Entity e) {\n if (e.isExplosion() || (e.isBomb() && (((Bomb) e).isMissile()))) {\n kill();\n ArrayList<Mob> m = Board.getInstance().getMobsAtExcluding(this.getXTile(), this.getYTile(), this);\n for (Mob mob1 : m) {\n if (mob1.isAlive()) {\n mob1.kill();\n }\n }\n return true;\n }\n return false;\n }", "public abstract void addCollision(Geometry s, Geometry t);", "@Override\n\tpublic boolean collidesWithCircle(Circle circle) {\n\t\treturn false;\n\t}", "public void checkWorldCollisions(Bounds bounds) {\n final boolean atRightBorder = getShape().getLayoutX() >= (bounds.getMaxX() - RADIUS);\n final boolean atLeftBorder = getShape().getLayoutX() <= RADIUS;\n final boolean atBottomBorder = getShape().getLayoutY() >= (bounds.getMaxY() - RADIUS);\n final boolean atTopBorder = getShape().getLayoutY() <= RADIUS;\n final double padding = 1.00;\n\n if (atRightBorder) {\n getShape().setLayoutX(bounds.getMaxX() - (RADIUS * padding));\n velX *= frictionX;\n velX *= -1;\n }\n if (atLeftBorder) {\n getShape().setLayoutX(RADIUS * padding);\n velX *= frictionX;\n velX *= -1;\n }\n if (atBottomBorder) {\n velY *= -1;\n velY *= frictionY;\n getShape().setLayoutY(bounds.getMaxY() - (RADIUS * padding));\n }\n if (atTopBorder) {\n velY *= -1;\n velY *= frictionY;\n getShape().setLayoutY(RADIUS * padding);\n }\n }", "protected void collidesCallback(){\n\t\tphxService.collidingCallback(this);\n\t}", "@Override\n\tpublic boolean collides(Vector3 v) {\n\t\treturn false;\n\t}", "@Override\n\tpublic void handleCollision(ICollider otherObject) {\n\t\tSystem.out.println(\"i hit a flame :(\");\n\t}", "@Override\r\n public CollisionShape getColisionShape() {\n return new BoxCollisionShape(new Vector3f(11,0.3f,11));\r\n }", "public boolean hasCollision(final Entity entity) throws Exception\r\n {\r\n return (getCharacter(entity) != null);\r\n }", "public void checkCollision() {}", "@Override\r\n public boolean collision(org.dyn4j.dynamics.Body body1, BodyFixture fixture1, org.dyn4j.dynamics.Body body2, BodyFixture fixture2, Penetration penetration) {\r\n return true;\r\n }", "@Override\n public void checkCollision( Sprite obj )\n {\n\n }", "public void end(EntityEntityCollisionEvent event) {\n\n }", "public boolean isCollisionDisabled() { return mover.isCollisionDisabled(); }", "private void CheckWorldCollision() {\n\t\tfor(WorldObj obj : World.CurrentWorld.SpawnedObjects) {\n\t\t\tif(bounds.overlaps(obj.bounds))\n\t\t\t\tobj.OnCollision(this);\n\t\t\tif(MapRenderer.CurrentRenderer.ItemAnimation != null) {\n\t\t\t\tif(obj.ai != null) {\n\t\t\t\t\tif(dir == LEFT)\n\t\t\t\t\tAttackBounds.set(pos.x+(dir*1.35f)+0.5f,pos.y,1.35f,1);\n\t\t\t\t\telse\n\t\t\t\t\t\tAttackBounds.set(pos.x+0.5f,pos.y,1.35f,1);\n\t\t\t\t\tif(obj.healthBarTimer > 0.4f)\n\t\t\t\tif(AttackBounds.overlaps(obj.bounds)) {\n\t\t\t\t\tif(!Terrain.CurrentTerrain.isSolid((int)(pos.x+0.5f+(0.3f*dir)), (int)(pos.y+0.5f)))\n\t\t\t\t\tobj.ai.onDamaged(this, UsedItem, GetATK());\n\t\t\t\t\tHitTimer = 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(obj.damageable) {\n\t\t\t\t\tif(AttackBounds.overlaps(obj.bounds)) {\n\t\t\t\t\t\tobj.onDamaged(this, UsedItem, GetATK());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void onCollisionWithBullet() {\n\t\t\r\n\t}", "@Override\r\n public void applyEntityCollision(Entity entity)\r\n {\r\n Vector3 v = Vector3.getNewVector();\r\n Vector3 v1 = Vector3.getNewVector();\r\n\r\n blockBoxes.clear();\r\n\r\n int sizeX = blocks.length;\r\n int sizeY = blocks[0].length;\r\n int sizeZ = blocks[0][0].length;\r\n Set<Double> topY = Sets.newHashSet();\r\n for (int i = 0; i < sizeX; i++)\r\n for (int k = 0; k < sizeY; k++)\r\n for (int j = 0; j < sizeZ; j++)\r\n {\r\n ItemStack stack = blocks[i][k][j];\r\n if (stack == null || stack.getItem() == null) continue;\r\n\r\n Block block = Block.getBlockFromItem(stack.getItem());\r\n AxisAlignedBB box = Matrix3.getAABB(posX + block.getBlockBoundsMinX() - 0.5 + boundMin.x + i,\r\n posY + block.getBlockBoundsMinY() + k,\r\n posZ + block.getBlockBoundsMinZ() - 0.5 + boundMin.z + j,\r\n posX + block.getBlockBoundsMaxX() + 0.5 + boundMin.x + i,\r\n posY + block.getBlockBoundsMaxY() + k,\r\n posZ + block.getBlockBoundsMaxZ() + 0.5 + boundMin.z + j);\r\n blockBoxes.add(box);\r\n topY.add(box.maxY);\r\n }\r\n\r\n v.setToVelocity(entity).subtractFrom(v1.setToVelocity(this));\r\n v1.clear();\r\n Matrix3.doCollision(blockBoxes, entity.getEntityBoundingBox(), entity, 0, v, v1);\r\n for(Double d: topY)\r\n if (entity.posY >= d && entity.posY + entity.motionY <= d && motionY <= 0)\r\n {\r\n double diff = (entity.posY + entity.motionY) - (d + motionY);\r\n double check = Math.max(0.5, Math.abs(entity.motionY + motionY));\r\n if (diff > 0 || diff < -0.5 || Math.abs(diff) > check)\r\n {\r\n entity.motionY = 0;\r\n }\r\n }\r\n\r\n boolean collidedY = false;\r\n if (!v1.isEmpty())\r\n {\r\n if (v1.y >= 0)\r\n {\r\n entity.onGround = true;\r\n entity.fallDistance = 0;\r\n entity.fall(entity.fallDistance, 0);\r\n }\r\n else if (v1.y < 0)\r\n {\r\n boolean below = entity.posY + entity.height - (entity.motionY + motionY) < posY;\r\n if (below)\r\n {\r\n v1.y = 0;\r\n }\r\n }\r\n if (v1.x != 0) entity.motionX = 0;\r\n if (v1.y != 0) entity.motionY = motionY;\r\n if (v1.z != 0) entity.motionZ = 0;\r\n if (v1.y != 0) collidedY = true;\r\n v1.addTo(v.set(entity));\r\n v1.moveEntity(entity);\r\n }\r\n if (entity instanceof EntityPlayer)\r\n {\r\n EntityPlayer player = (EntityPlayer) entity;\r\n if (Math.abs(player.motionY) < 0.1 && !player.capabilities.isFlying)\r\n {\r\n entity.onGround = true;\r\n entity.fallDistance = 0;\r\n }\r\n if (!player.capabilities.isCreativeMode && !player.worldObj.isRemote)\r\n {\r\n EntityPlayerMP entityplayer = (EntityPlayerMP) player;\r\n if (collidedY) entityplayer.playerNetServerHandler.floatingTickCount = 0;\r\n }\r\n }\r\n }", "public static void doCollision(org.bukkit.entity.Entity entity, org.bukkit.entity.Entity with) {\n\t\tCommonNMS.getNative(entity).collide(CommonNMS.getNative(with));\n\t}", "@Override\r\n\tpublic void collisionEffect(AbstractCollidable other, Vector mtv) {\r\n\t\t\r\n\t\tClass<? extends AbstractCollidable> otherClass = other.getClass();\r\n\r\n\t\tif (\t\totherClass.equals(TerrainSection.class)\r\n\t\t\t\t|| otherClass.equals(Obstacle.class)\r\n\t\t\t\t|| (otherClass.equals(Player.class) && owner != other)\r\n\t\t\t\t|| (otherClass.equals(Enemy.class) && owner != other)) {\r\n\t\t\thasCollided = true;\r\n\t\t}\r\n\t\t\r\n\t}", "public abstract void collided(CircleCollider col);", "public interface CollisionListener {\n public void collEnter(ACollider col,GameObject owner);\n public void collExit(ACollider col,GameObject owner);\n public void collStay(ACollider col,GameObject owner);\n}", "@Override\r\n\tpublic void handle(Collidable otherSprite) {\n\t\t\r\n\t}", "public boolean collides(MovingEntity s) {\n\t\tif (_shape != null && s.getShape() != null) \n\t\t\treturn _shape.collides(s.getShape());\n\t\treturn false;\n\t}", "void checkHandleContactWithPlayer() {\n Player curPlayer = this.mainSketch.getCurrentActivePlayer();\n\n if (this.doesAffectPlayer) {\n // boundary collision for player\n if (contactWithCharacter(curPlayer)) { // this has contact with non-player\n if (!this.charactersTouchingThis.contains(curPlayer)) { // new collision detected\n curPlayer.changeNumberOfVerticalBoundaryContacts(1);\n this.charactersTouchingThis.add(curPlayer);\n }\n curPlayer.handleContactWithVerticalBoundary(this.startPoint.x);\n\n } else { // this DOES NOT have contact with player\n if (this.charactersTouchingThis.contains(curPlayer)) {\n curPlayer.setAbleToMoveRight(true);\n curPlayer.setAbleToMoveLeft(true);\n curPlayer.changeNumberOfVerticalBoundaryContacts(-1);\n this.charactersTouchingThis.remove(curPlayer);\n }\n }\n }\n }", "public static boolean getCollision()\r\n\t{\r\n\t\treturn collision;\r\n\t}", "public void updateOptimalCollisionArea();", "@Override\n\tpublic boolean handleCollision(ICollider otherObject, GameWorld gw) {\n\t\tif (otherObject instanceof NPSMissile) return false;\n\t\tif(otherObject instanceof PlayerShip)\n\t\t\tgw.explodePS();\n\t\treturn true;\n\t\t\n\t}", "@Override\n public void move(Entity e) {\n\n if (Collsiontick > 0) {\n Collsiontick--;\n }\n tick++;\n float deltax = x - player.x;\n float deltay = y - player.y;\n float speed = getSpeed();\n if(Math.abs(speed) < 0.1 && Collsiontick/50<=1){\n float theta = (float) (Math.atan(deltay / deltax) + Math.PI);\n xv = (float) ((TOP_SPEED * Math.cos(theta)));\n yv = (float) ((TOP_SPEED * Math.sin(theta)));\n if (deltax < 0) {\n xv = -xv;\n yv = -yv;\n }\n }\n \n xv = Util.doFrictionX(xv, yv, FRICTION);\n yv = Util.doFrictionY(xv, yv, FRICTION);\n \n \n x += xv;\n y += yv;\n\n shape = (Polygon) shape.transform(Transform.createTranslateTransform(xv, yv));\n }", "public double[] getCollisionPosition(Entity otherEntity) throws IllegalArgumentException {\n\t\tif (otherEntity == null) \n\t\t\tthrow new IllegalArgumentException(\"Invalid argument object (null).\");\n\t\t\n\n\t\tif ( this.overlap(otherEntity) ) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif ( this.getTimeToCollision(otherEntity) == Double.POSITIVE_INFINITY)\n\t\t\treturn null;\n\n\t\tdouble collisionXSelf = this.getXCoordinate() + this.getTimeToCollision(otherEntity) * this.getXVelocity();\n\t\tdouble collisionYSelf = this.getYCoordinate() + this.getTimeToCollision(otherEntity) * this.getYVelocity();\n\n\t\tdouble collisionXOther = otherEntity.getXCoordinate() + otherEntity.getTimeToCollision(this) * otherEntity.getXVelocity();\n\t\tdouble collisionYOther = otherEntity.getYCoordinate() + otherEntity.getTimeToCollision(this) * otherEntity.getYVelocity();\n\t\t\n\t\tdouble collisionX;\n\t\tdouble collisionY;\n\t\t\n\t\tif (this.getXCoordinate() > otherEntity.getXCoordinate()) {\n\t\t\tcollisionX = collisionXSelf - Math.cos(Math.atan((collisionYOther - collisionYSelf) / (collisionXOther - collisionXSelf))) * radius;\n\t\t\tcollisionY = collisionYSelf - Math.sin(Math.atan((collisionYOther - collisionYSelf) / (collisionXOther - collisionXSelf))) * radius;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tcollisionX = collisionXSelf + Math.cos(Math.atan((collisionYOther - collisionYSelf) / (collisionXOther - collisionXSelf))) * radius;\n\t\t\tcollisionY = collisionYSelf + Math.sin(Math.atan((collisionYOther - collisionYSelf) / (collisionXOther - collisionXSelf))) * radius;\n\t\t}\n\t\t\n\t\tdouble[] collision = {collisionX, collisionY};\n\t\treturn collision;\n\t\t\n\t}", "public void onCollision(GameObject go){\n\t\t// to be completed later\n\t}", "private Physics (){\n }", "public void detectCollisions(){\n\t\tfor(int i = 0; i < pScene.getNumOf(); i++){\n\t\t\tEntity a = pScene.getObject(i);\n\t\t\tif (!a.isAlive())\n\t\t\t\tcontinue;\n\t\t\tfor(int j = i + 1; j < pScene.getNumOf(); j++){\n\t\t\t\tEntity b = pScene.getObject(j);\n\t\t\t\tif(a.intersects(b)&&(!(a.getStatic()&&b.getStatic()))){\n\t\t\t\t\tsManifolds.add(new Manifold(a,b)); // For regular objects\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void collide(CollisionEvent e) {\n //collision detection that will allow you to unlock a character\n if (e.getOtherBody() instanceof Player) {\n Player p = (Player) e.getOtherBody();\n //if player has not unlocked the 2nd hero for the first level then unlock\n if (!p.getUnlockHero2() && p.getWorld() instanceof Level1){\n p.setUnlockHero2(true);\n }\n //if player has not unlocked the 3rd hero for the second level then unlock\n if (!p.getUnlockHero3() && p.getWorld() instanceof Level2) {\n p.setUnlockHero3(true);\n }\n if (p.getWorld() instanceof Level3) {\n if (p.getHealth()<51){\n p.setHealth(p.getHealth()+50);\n }\n }\n //destroy the chest and acknowledge that it's been picked up\n c.destroy();\n p.getWorld().setPickedUp(true);\n }\n }", "public interface Collidable {\r\n\r\n /**\r\n * Return the \"collision shape\" of the object.\r\n * @return getter for the shape of the collidable.\r\n */\r\n Rectangle getCollisionRectangle();\r\n /**\r\n * Notify the object that we collided with it at collisionPoint with\r\n * given velocity.\r\n * The return is the new velocity expected after the hit (based on\r\n * the force the object inflicted on us).\r\n * @param hitter the hitting ball.\r\n * @param collisionPoint the point where the collision occurs.\r\n * @param currentVelocity the current velocity of the ball.\r\n * @return new velocity of ball, according to the previous data.\r\n */\r\n Velocity hit(Ball hitter, Point collisionPoint, Velocity currentVelocity);\r\n}", "public void collisionPhsysics (Body otherBody) {\n if (this.mass <= otherBody.mass) {\n this.merged = true;\n otherBody.mass += this.mass;\n this.x = 0;\n this.y = 0;\n this.temp_x = 0;\n this.temp_y = 0;\n }\n else {\n otherBody.merged = true;\n this.mass += otherBody.mass;\n otherBody.x = 0;\n otherBody.y = 0;\n otherBody.temp_x = 0;\n otherBody.temp_y = 0;\n }\n\n // momentum transfer\n if (this.mass <= otherBody.mass) {\n otherBody.vx = (this.mass*this.vx + otherBody.mass*otherBody.vx)/(this.mass + otherBody.mass);\n otherBody.vy = (this.mass*this.vy + otherBody.mass*otherBody.vy)/(this.mass + otherBody.mass);\n }\n else {\n this.vx = (this.mass*this.vx + otherBody.mass*otherBody.vx)/(this.mass + otherBody.mass);\n this.vy = (this.mass*this.vy + otherBody.mass*otherBody.vy)/(this.mass + otherBody.mass);\n }\n\n\n }", "abstract public void performCollision(Ball ball);", "private void collisionsCheck() {\n\t\tif(this.fence.collisionTest(\n\t\t\t\tthis.spider.getMovementVector())) \n\t\t{\n\t\t\t// we actually hit something!\n\t\t\t// call collision handlers\n\t\t\tthis.spider.collisionHandler();\n\t\t\tthis.fence.collisionHandler();\n\t\t\t// vibrate!\n\t\t\tvibrator.vibrate(Customization.VIBRATION_PERIOD);\n\t\t\t// lose one life\n\t\t\tthis.data.lostLife();\n\t\t}\n\t}", "public interface CollisionHandler\n{\n public boolean hasCollision(Board board);\n public String getDescription();\n}", "public void collide(GameEntity ge)\n\t{\n\t\tge.collide(this);\n\t}", "private boolean handleCollisionWithAntOrNest()\n {\n ArrayList<GameObject> collisions = this.getCollisions();\n if(!collisions.isEmpty() && (collisions.get(0) instanceof Ant || collisions.get(0) instanceof Nest))\n {\n this.opponent = collisions.get(0);\n return true;\n }\n\n return false;\n }", "private void updatePhysics() {\n long now = System.currentTimeMillis();\n // Do nothing if mLastTime is in the future.\n // This allows the game-start to delay the start of the physics\n // by 100ms or whatever.\n if (mLastTime > now) return;\n int n = particles.length;\n tree.clear();\n for (int i = 0; i < n; i++) {\n tree.insert(particles[i]);\n }\n // Determine if there are any collisions\n // http://www.kirupa.com/developer/actionscript/multiple_collision2.htm\n for (int i = 0; i < n; i++) {\n \tparticles[i].update(now);\n \tparticles[i].disappearsFromEdge(canvasWidth, canvasHeight);\n\t\t\tSet<Particle> nearBy = tree.retrieve(particles[i]);\n\t\t\tfor (Particle particle : nearBy) {\n\t\t\t\tif (particle != particles[i])\n\t\t\t\t\tparticles[i].collidesWith(particle);\n\t\t\t}\n }\n }" ]
[ "0.71062845", "0.70843774", "0.7038629", "0.6964459", "0.6927745", "0.67602766", "0.67225546", "0.66811246", "0.63855517", "0.6380392", "0.63437396", "0.6339132", "0.63268775", "0.63217974", "0.6292759", "0.62703156", "0.6256576", "0.624683", "0.6228343", "0.62248147", "0.62139744", "0.6200033", "0.61833966", "0.61763895", "0.6170956", "0.6137182", "0.60953647", "0.6089753", "0.6067406", "0.6065542", "0.60647887", "0.60595995", "0.60527796", "0.60489255", "0.60278416", "0.59950304", "0.59905976", "0.5973376", "0.5970079", "0.59645", "0.5962975", "0.5958773", "0.5954125", "0.5953018", "0.59272325", "0.592248", "0.589038", "0.587856", "0.5873121", "0.58706886", "0.5870117", "0.5835945", "0.5832122", "0.5824521", "0.5818218", "0.5814592", "0.581398", "0.5804008", "0.5795975", "0.5783845", "0.57729286", "0.57532954", "0.5749306", "0.57489455", "0.57257205", "0.572168", "0.57081586", "0.5705273", "0.5703435", "0.5701766", "0.5697068", "0.5687433", "0.5680517", "0.56754774", "0.5673845", "0.56727594", "0.5665605", "0.56558377", "0.5636016", "0.5626116", "0.5605116", "0.5603422", "0.559786", "0.5589599", "0.55742437", "0.55707365", "0.55702466", "0.55626976", "0.5555788", "0.55501795", "0.5532833", "0.5518626", "0.5517389", "0.5513881", "0.5510918", "0.5510312", "0.54922783", "0.5490932", "0.5483207", "0.54801774" ]
0.7293603
0
Script Name : AddlistviewRow_E2E_Android Generated : Sep 19, 2011 9:21:47 AM Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
public void testMain(Object[] args) { // TODO Insert code here WN.useProject(Cfg.projectName); EE.runSQL(new ScrapbookCP().database("sampledb") .type("Sybase_ASA_12.x").name("My Sample Database"), GlobalConfig.getRFTProjectRoot()+"/testscript/Workflow/Screens/setup/add_a_b.sql"); EE.dnd("Database Connections->My Sample Database->sampledb->Tables->wf_ff_a (dba)"); EE.dnd("Database Connections->My Sample Database->sampledb->Tables->wf_ff_b (dba)"); WN.createRelationship(new Relationship() .startParameter(WN.mboPath(Cfg.projectName, "Wf_ff_a")) .target("Wf_ff_b") .mapping("aid,aid") .composite("true") .type(Relationship.TYPE_OTM)); WN.deployProject(new DeployOption().startParameter(Cfg.projectName) .server("My Unwired Server") .mode(DeployOption.MODE_REPLACE) .serverConnectionMapping("My Sample Database,sampledb")); WN.createWorkFlow(new WorkFlow().startParameter(Cfg.projectName) .name("myWF") .option(WorkFlow.SP_SERVER_INIT) .mbo("Wf_ff_a") .objectQuery("findByPrimaryKey") .subject("dept_id=1") .subjectMatchingRule("dept_id=") .setParameterValue("aid,Subject,dept_id=")); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffa")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("WfffaDetail")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffacreate")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffadeleteinstance")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffaupdateinstance")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffb")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("WfffbDetail")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffbupdateinstance")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffbadd")).performTest(); MainMenu.saveAll(); WFCustomizer.runTest(new WorkFlowPackage() .startParameter(WN.filePath(Cfg.projectName, "myWF")) .unwiredServer("My Unwired Server") .deployToServer("true") .assignToSelectedUser(Cfg.deviceUser), customTestScript(), // "tplan.Workflow.iconcommon.BB.server_dt_icon.Script", new CallBackMethod().receiver(WorkFlowEditor.class) .methodName("sendNotification") .parameter(new Email() .unwiredServer("My Unwired Server") .selectTo(Cfg.deviceUser) .subject("dept_id=1"))); sleep(1); //need to check data the backend DB vpManual("db",1,getDB("select * from Wf_ff_b where bid = 4 and aid = 1 and bname ='Bfour' ")).performTest(); // java.util.List<String> clause = new ArrayList<String>(); // clause.add("bid=4"); // clause.add("aid=1"); // clause.add("bname='Bfour'"); // vpManual("dbresult", 1, CDBUtil.getRecordCount("localhost", "wf1", "Wf_ff_b", clause)).performTest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public native void appendRow(List<TableViewRow> rows) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso\n\t\t\t\t.appendRow(@com.emitrom.ti4j.mobile.client.ui.TableViewRow::fromList(Ljava/util/List;)(rows));\n }-*/;", "public void onGoToListViewClicked(View view) {\n\n // EditText et=(EditText)findViewById(R.id.editText);\n String input = et.getText().toString();\n\n if (input.length() > 0) {\n\n // myDb.insertRow(input,\"Due date to be set\");\n myDb.insertRow(input, \"Due date to be set\");\n populateListViewFromDB();\n et.setText(\"\");\n }\n }", "@Test\n public void lookUpListActivity(){\n ListView lv = (ListView) listActivity.findViewById(R.id.listView);\n Button addItem = (Button) listActivity.findViewById(R.id.addItemButton);\n Button uncheckItem = (Button) listActivity.findViewById(R.id.uncheckItemsButton);\n\n assertNotNull(\"ListView could not be found in ListActivity\", lv);\n assertNotNull(\"Add item button could not be found in ListActivity\", addItem);\n assertNotNull(\"Uncheck item button could not be found in ListActivity\", uncheckItem);\n }", "private void addDeviceItem() throws SQLException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\ttry{\r\n\t\t\tnameDevice = edtNameDevice.getText().toString().trim();\r\n\t\t\tportDevice = Integer.parseInt(edtPortDevice.getText().toString().trim());\r\n\t\t\troomID = getIntent().getExtras().getInt(\"room_id\");\r\n\t\t\t\r\n\t\t\tDeviceItem item = new DeviceItem(roomID, nameDevice, typeDevice, portDevice, statusDevice);\r\n\t\t\tDeviceItemController.getInstance(AddDeviceItemActivity.this).createDeviceItem(item);\r\n\t\t}catch(Exception ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t\tToast.makeText(AddDeviceItemActivity.this, \"Add device item error. Please verify your device infomations!\", Toast.LENGTH_SHORT).show();\r\n\t\t}\r\n\t}", "public static RemoteObject _class_globals(RemoteObject __ref) throws Exception{\nb4i_customlistview._mbase = RemoteObject.createNew (\"B4XViewWrapper\");__ref.setField(\"_mbase\",b4i_customlistview._mbase);\n //BA.debugLineNum = 15;BA.debugLine=\"Public sv As B4XView\";\nb4i_customlistview._sv = RemoteObject.createNew (\"B4XViewWrapper\");__ref.setField(\"_sv\",b4i_customlistview._sv);\n //BA.debugLineNum = 16;BA.debugLine=\"Type CLVItem(Panel As B4XView, Size As Int, Value\";\n;\n //BA.debugLineNum = 18;BA.debugLine=\"Private items As List\";\nb4i_customlistview._items = RemoteObject.createNew (\"B4IList\");__ref.setField(\"_items\",b4i_customlistview._items);\n //BA.debugLineNum = 19;BA.debugLine=\"Private mDividerSize As Float\";\nb4i_customlistview._mdividersize = RemoteObject.createImmutable(0.0f);__ref.setField(\"_mdividersize\",b4i_customlistview._mdividersize);\n //BA.debugLineNum = 20;BA.debugLine=\"Private EventName As String\";\nb4i_customlistview._eventname = RemoteObject.createImmutable(\"\");__ref.setField(\"_eventname\",b4i_customlistview._eventname);\n //BA.debugLineNum = 21;BA.debugLine=\"Private CallBack As Object\";\nb4i_customlistview._callback = RemoteObject.createNew (\"NSObject\");__ref.setField(\"_callback\",b4i_customlistview._callback);\n //BA.debugLineNum = 22;BA.debugLine=\"Public DefaultTextColor As Int\";\nb4i_customlistview._defaulttextcolor = RemoteObject.createImmutable(0);__ref.setField(\"_defaulttextcolor\",b4i_customlistview._defaulttextcolor);\n //BA.debugLineNum = 23;BA.debugLine=\"Public DefaultTextBackgroundColor As Int\";\nb4i_customlistview._defaulttextbackgroundcolor = RemoteObject.createImmutable(0);__ref.setField(\"_defaulttextbackgroundcolor\",b4i_customlistview._defaulttextbackgroundcolor);\n //BA.debugLineNum = 24;BA.debugLine=\"Public AnimationDuration As Int = 300\";\nb4i_customlistview._animationduration = BA.numberCast(int.class, 300);__ref.setField(\"_animationduration\",b4i_customlistview._animationduration);\n //BA.debugLineNum = 25;BA.debugLine=\"Private LastReachEndEvent As Long\";\nb4i_customlistview._lastreachendevent = RemoteObject.createImmutable(0L);__ref.setField(\"_lastreachendevent\",b4i_customlistview._lastreachendevent);\n //BA.debugLineNum = 26;BA.debugLine=\"Public PressedColor As Int\";\nb4i_customlistview._pressedcolor = RemoteObject.createImmutable(0);__ref.setField(\"_pressedcolor\",b4i_customlistview._pressedcolor);\n //BA.debugLineNum = 27;BA.debugLine=\"Private xui As XUI\";\nb4i_customlistview._xui = RemoteObject.createNew (\"B4IXUI\");__ref.setField(\"_xui\",b4i_customlistview._xui);\n //BA.debugLineNum = 28;BA.debugLine=\"Private DesignerLabel As Label\";\nb4i_customlistview._designerlabel = RemoteObject.createNew (\"B4ILabelWrapper\");__ref.setField(\"_designerlabel\",b4i_customlistview._designerlabel);\n //BA.debugLineNum = 29;BA.debugLine=\"Private horizontal As Boolean\";\nb4i_customlistview._horizontal = RemoteObject.createImmutable(false);__ref.setField(\"_horizontal\",b4i_customlistview._horizontal);\n //BA.debugLineNum = 35;BA.debugLine=\"Private FeedbackGenerator As NativeObject\";\nb4i_customlistview._feedbackgenerator = RemoteObject.createNew (\"B4INativeObject\");__ref.setField(\"_feedbackgenerator\",b4i_customlistview._feedbackgenerator);\n //BA.debugLineNum = 37;BA.debugLine=\"Private mFirstVisibleIndex, mLastVisibleIndex As\";\nb4i_customlistview._mfirstvisibleindex = RemoteObject.createImmutable(0);__ref.setField(\"_mfirstvisibleindex\",b4i_customlistview._mfirstvisibleindex);\nb4i_customlistview._mlastvisibleindex = RemoteObject.createImmutable(0);__ref.setField(\"_mlastvisibleindex\",b4i_customlistview._mlastvisibleindex);\n //BA.debugLineNum = 38;BA.debugLine=\"Private MonitorVisibleRange As Boolean\";\nb4i_customlistview._monitorvisiblerange = RemoteObject.createImmutable(false);__ref.setField(\"_monitorvisiblerange\",b4i_customlistview._monitorvisiblerange);\n //BA.debugLineNum = 39;BA.debugLine=\"Private FireScrollChanged As Boolean\";\nb4i_customlistview._firescrollchanged = RemoteObject.createImmutable(false);__ref.setField(\"_firescrollchanged\",b4i_customlistview._firescrollchanged);\n //BA.debugLineNum = 40;BA.debugLine=\"Private ScrollBarsVisible As Boolean\";\nb4i_customlistview._scrollbarsvisible = RemoteObject.createImmutable(false);__ref.setField(\"_scrollbarsvisible\",b4i_customlistview._scrollbarsvisible);\n //BA.debugLineNum = 41;BA.debugLine=\"End Sub\";\nreturn RemoteObject.createImmutable(\"\");\n}", "public void insert_values_in_list_items_local_db(String AgentID, String selected_ln, int list_incr) {\n\n // non_deleted_arraylist\n ArrayList<String> non_deleted_prod_id = get_non_deleted_product_id(selected_ln, AgentID, list_incr);\n\n // define contentvalues object\n ContentValues copy_values_int_list_item = new ContentValues();\n\n // set values of list items\n copy_values_int_list_item.put(GlobalProvider.LI_List_Name, selected_ln);\n copy_values_int_list_item.put(GlobalProvider.LI_Increment,list_incr);\n copy_values_int_list_item.put(GlobalProvider.LI_Login_User_Id,AgentID);\n copy_values_int_list_item.put(GlobalProvider.LI_deleted,\"0\");\n\n // loop on array of prod ids selected by user\n for(String curr_prod_ids : product_ids_for_list){\n\n // set prod ids into contentvalues object\n copy_values_int_list_item.put(GlobalProvider.LI_Product_ID, curr_prod_ids);\n if(!non_deleted_prod_id.contains(curr_prod_ids) || non_deleted_prod_id.isEmpty()) {\n // firing query to insert into local db of list item\n Uri uri = getContentResolver().insert(GlobalProvider.CONTENT_URI_List_Item,\n copy_values_int_list_item);\n Toast.makeText(this,\n \" Added data successfully in \" + selected_ln ,Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(this,\"Product is already exists in \" + selected_ln,Toast.LENGTH_LONG).show();\n }\n }\n }", "@Test\n public void lookUpAddItemActivity(){\n TextView addItemToList = (TextView) addItemActivity.findViewById(R.id.textView5);\n EditText itemName = (EditText) addItemActivity.findViewById(R.id.itemNameEditText);\n EditText itemType = (EditText) addItemActivity.findViewById(R.id.itemTypeEditText);\n EditText itemQty = (EditText) addItemActivity.findViewById(R.id.itemQuantityEditText);\n EditText itemUnit = (EditText) addItemActivity.findViewById(R.id.itemUnitEditText);\n Button add = (Button) addItemActivity.findViewById(R.id.addItemToListButton);\n\n assertNotNull(\"Add Item to List TextView could not be found in AddItemActivity\", addItemToList);\n assertNotNull(\"Item Name EditText could not be found in AddItemActivity\", itemName);\n assertNotNull(\"Item Type EditText could not be found in AddItemActivity\", itemType);\n assertNotNull(\"Item Quantity EditText could not be found in AddItemActivity\", itemQty);\n assertNotNull(\"Item Unit EditText could not be found in AddItemActivity\", itemUnit);\n assertNotNull(\"Add Item to List button could not be found in AddItemActivity\", add);\n }", "public void addToList(View view) {\n Items newItem = new Items();\n EditText ETNew = (EditText) findViewById(R.id.ETNew);\n newItem.todo = ETNew.getText().toString();\n newItem.done = false;\n helper.create(newItem);\n Toast.makeText(this, \"Item added\", Toast.LENGTH_SHORT).show();\n adaptList2();\n ETNew.setText(\"\");\n ETNew.setHint(\"my new to-do\");\n }", "public void addRow(ArrayList<String> stringList) {\n }", "private void addNewListItem() {\n\n View view = LayoutInflater.from(CheckboxNoteActivity.this).inflate(R.layout.cell_item_edit, null);\n final CheckBox checkBox = view.findViewById(R.id.chk_edit_item);\n final EditText mEtListItem = view.findViewById(R.id.et_edit_item);\n final ImageView mIvAddItem = view.findViewById(R.id.iv_add_item);\n\n mEtListItem.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n if (s.length() > 1) {\n mIvAddItem.setVisibility(View.VISIBLE);\n } else {\n mIvAddItem.setVisibility(View.INVISIBLE);\n }\n\n }\n });\n //Successfully insert an item\n mIvAddItem.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n mEtListItem.setEnabled(true);\n mRlAddItem.setEnabled(true);\n mIvAddItem.setVisibility(View.INVISIBLE);\n\n Items cbitem = new Items();\n cbitem.itemId = row;\n cbitem.itemName = mEtListItem.getText().toString();\n cbitem.isChecked = false;\n items.add(cbitem);\n\n Toast.makeText(CheckboxNoteActivity.this, \"Items Size = \" + items.size()\n + \"Retrieved Items = \" + retrievedItems.size(), Toast.LENGTH_SHORT).show();\n }\n });\n\n\n mLlDynamicLayout.addView(view);\n }", "@Test\n public void lookUpMainActivity(){\n ListView lv = (ListView) mainActivity.findViewById(R.id.listView);\n EditText et = (EditText) mainActivity.findViewById(R.id.newListEditText);\n Button addNewList = (Button) mainActivity.findViewById(R.id.addNewListButton);\n\n assertNotNull(\"ListView could not be found in MainActivity\", lv);\n assertNotNull(\"EditText could not be found in MainActivity\", et);\n assertNotNull(\"Add new list button could not be found in MainActivity\", addNewList);\n }", "public void addRow(String itemName, String itemPrice, String username) {\n LinearLayout parentLayout = findViewById(R.id.itemList);\n\n // Create layout for new item\n LinearLayout l = new LinearLayout(this);\n l.setOrientation(LinearLayout.HORIZONTAL);\n LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100);\n layoutParams.bottomMargin = 10;\n l.setBackgroundResource(R.drawable.customborder);\n l.setLayoutParams(layoutParams);\n\n // Create item_name textview\n TextView name_textview = new TextView(this);\n name_textview.setText(itemName);\n name_textview.setTextSize(24);\n LinearLayout.LayoutParams nameParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n nameParams.weight = 1;\n name_textview.setLayoutParams(nameParams);\n\n // Create price textview\n TextView price_textview = new TextView(this);\n price_textview.setText(\"$\"+itemPrice);\n price_textview.setTextSize(24);\n LinearLayout.LayoutParams priceParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n priceParams.weight = 1;\n price_textview.setLayoutParams(priceParams);\n\n // Create username textview\n TextView username_textview = new TextView(this);\n username_textview.setText(username);\n username_textview.setTextSize(24);\n LinearLayout.LayoutParams usernameParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT);\n usernameParams.weight = 1;\n username_textview.setLayoutParams(usernameParams);\n\n // Add views to layout\n l.addView(name_textview);\n l.addView(price_textview);\n l.addView(username_textview);\n parentLayout.addView(l);\n\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n MainDBAdapter newdb = new MainDBAdapter(this);\n newdb.open();\n \n \n DatabaseInterface db = new DatabaseInterface(this);\n List<String> alerttype = new ArrayList<String>();\n alerttype.add(\"alert1\"); alerttype.add(\"alert2\");\n Item item = new Item(\"title test\", \"description test\", \"location test\", \"category test\", \n \t\talerttype, \"priority test\", \"Event\", \"starttime test\", \"endtime test\", \n \t\t\"deadline test\", \"alerttime test\", \"repeat test\", \"completed test\", 1);\n \n \n db.AddItemToDatabase(this, item);\n newdb.close();\n }", "public native void appendRow(List<TableViewRow> rows, TableViewAnimation animation) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso\n\t\t\t\t.appendRow(\n\t\t\t\t\t\[email protected]::fromList(Ljava/util/List;)(rows),\n\t\t\t\t\t\[email protected]::getJsObj()());\n }-*/;", "@Test\n public void lookUpListItemActivity(){\n TextView tv = (TextView) listItemActivity.findViewById(R.id.textView4);\n Spinner spinner = (Spinner) listItemActivity.findViewById(R.id.itemTypeSpinner);\n ListView lv = (ListView) listItemActivity.findViewById(R.id.itemListView);\n EditText et = (EditText) listItemActivity.findViewById(R.id.searchForItemByNameEditTExt);\n Button search = (Button) listItemActivity.findViewById(R.id.searchButton);\n //Button cancel = (Button) listItemActivity.findViewById(R.id.CancelSelectItemButton);\n Button addToDB = (Button) listItemActivity.findViewById(R.id.addToDBButton);\n\n assertNotNull(\"TextView could not be found in ListItemActivity\", tv);\n assertNotNull(\"Spinner could not be found in ListItemActivity\", spinner);\n assertNotNull(\"EditText could not be found in ListItemActivity\", et);\n assertNotNull(\"Search button could not be found in ListItemActivity\", search);\n //assertNotNull(\"Cancel Selected Item button could not be found in ListItemActivity\", cancel);\n assertNotNull(\"Add to DB button could not be found in ListItemActivity\", addToDB);\n }", "public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\tlong arg3) {\n\t\tclickFlag=1;\r\n\t\tToast.makeText(getApplicationContext(), \"Adding to read list\"+titleList.get(arg2), 2).show();\r\n\t\tReadListDatabase rldb=new ReadListDatabase(this);\r\n\t\trldb.open();\r\n\t\trldb.Insert(titleList.get(arg2), urlList.get(arg2));\r\n\t\trldb.close();\r\n\t\t\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public void testAddExistingInfo() {\r\n TAG = \"testAddExistingInfo\";\r\n setUpOpTest();\r\n solo.clickOnActionBarItem(R.id.create_operation);\r\n solo.waitForActivity(OperationEditor.class);\r\n solo.enterText(3, OP_TP);\r\n for (int i = 0; i < OP_AMOUNT.length(); ++i) {\r\n solo.enterText(4, String.valueOf(OP_AMOUNT.charAt(i)));\r\n }\r\n solo.clickOnImageButton(tools.findIndexOfImageButton(R.id.edit_op_third_parties_list));\r\n solo.clickOnButton(solo.getString(R.string.create));\r\n solo.enterText(0, \"Atest\");\r\n solo.clickOnButton(solo.getString(R.string.ok));\r\n solo.waitForView(ListView.class);\r\n assertEquals(1, solo.getCurrentViews(ListView.class).get(0).getCount());\r\n solo.clickOnButton(solo.getString(R.string.create));\r\n solo.enterText(0, \"ATest\");\r\n solo.clickOnButton(solo.getString(R.string.ok));\r\n assertNotNull(solo\r\n .getText(solo.getString(fr.geobert.radis.R.string.item_exists)));\r\n }", "public int addRow(List row) {\n\t\tdata.add(row);\n\t\tfireTableRowsInserted(data.size()-1, data.size()-1);\n\t\treturn(data.size() -1);\n\t}", "@Override\n public void onClick(View v) {\n\n final ListModel LM = new ListModel();\n LM.strMainAsset=\"images/custom/custom_main.png\";\n LM.strListName=((EditText)V.findViewById(R.id.edit_list_create_name)).getText().toString();\n LM.strRowThImage=\"images/custom/custom_th.png\";\n LM.strRowImage=null;\n \n// LM.strRowBGImage=\"images/custom/custom_content.png\";\n\n ListItemRowModel LIM=new ListItemRowModel(AppState.getInstance().CurrentProduct.strId);\n\n LM.items.add(LIM);\n\n //add it to my lists\n AppState.getInstance().myList.items.add(LM);\n\n //set the title\n ((TextView)V.findViewById(R.id.text_list_add_create)).setText(\"List Created!\");\n\n\n\n //show the created layout\n LinearLayout layoutCreated=(LinearLayout)V.findViewById(R.id.layout_add_list_created);\n layoutCreated.setVisibility(View.VISIBLE);\n layoutCreated.setAlpha(0f);\n layoutCreated.animate().alpha(1).setDuration(300);\n\n\n //hide the form\n V.findViewById(R.id.layout_create_form).setVisibility(View.GONE);\n\n //set the propper title\n ((TextView)V.findViewById(R.id.text_list_created)).setText(LM.strListName);\n\n //set public or not\n if(!((CheckBox)V.findViewById(R.id.checkbox_add_list_create)).isChecked())\n ((TextView) V.findViewById(R.id.text_list_created_public)).setText(\"This list is public\");\n else\n ((TextView) V.findViewById(R.id.text_list_created_public)).setText(\"This list is private\");\n\n\n V.findViewById(R.id.btn_view_created).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dismiss();\n\n AppState.getInstance().CurrentList=LM;\n ListViewFragment listViewFragment= new ListViewFragment();\n\n Bundle args = new Bundle();\n args.putInt(ListFragment.ARG_PARAM1, R.layout.layout_list);\n args.putString(ListFragment.ARG_PARAM2, \"list\");\n listViewFragment.setArguments(args);\n\n ((MainActivity)getActivity()).setFragment(listViewFragment, FragmentTransaction.TRANSIT_FRAGMENT_OPEN,false);\n }\n });\n\n\n }", "public void m17237a(java.util.List<java.lang.Integer> r6) {\n /*\n r5 = this;\n r0 = 0;\n if (r6 == 0) goto L_0x0009;\n L_0x0003:\n r1 = r6.size();\n if (r1 != 0) goto L_0x000a;\n L_0x0009:\n return;\n L_0x000a:\n r1 = r5.f20994d;\n r1.lock();\n r2 = r5.m17234d();\n r1 = \"\";\n L_0x0016:\n r3 = r6.size();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n if (r0 >= r3) goto L_0x003b;\n L_0x001c:\n r3 = new java.lang.StringBuilder;\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3.<init>();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r3.append(r1);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = r6.get(r0);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r1.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = \",\";\n r1 = r1.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r1.toString();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r0 + 1;\n goto L_0x0016;\n L_0x003b:\n r0 = r1.length();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n if (r0 <= 0) goto L_0x006e;\n L_0x0041:\n r0 = 0;\n r3 = r1.length();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = r3 + -1;\n r0 = r1.substring(r0, r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = \"result\";\n r3 = new java.lang.StringBuilder;\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3.<init>();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r4 = \"_id in (\";\n r3 = r3.append(r4);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r3.append(r0);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = \")\";\n r0 = r0.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r0.toString();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = 0;\n r2.delete(r1, r0, r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n L_0x006e:\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x0077:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00a0:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00c9:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00f2:\n r0 = move-exception;\n r2.close();\n r1 = r5.f20994d;\n r1.unlock();\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.baidu.tts.e.c.a(java.util.List):void\");\n }", "public void addRow(File photoFile, final Bitmap photoBmp) {\r\n\r\n final PhotoListViewAdapter adapter = (PhotoListViewAdapter) getAdapter();\r\n\r\n /**\r\n * Stores the starting bounds and the corresponding bitmap drawables of\r\n * every cell present in the ListView before the data set change takes\r\n * place.\r\n */\r\n final HashMap<Long, Rect> listViewItemBounds = new HashMap<Long, Rect>();\r\n final HashMap<Long, BitmapDrawable> listViewItemDrawables = new HashMap<Long, BitmapDrawable>();\r\n\r\n int firstVisiblePosition = getFirstVisiblePosition();\r\n for (int i = 0; i < getChildCount(); ++i) {\r\n View child = getChildAt(i);\r\n int position = firstVisiblePosition + i;\r\n long itemID = adapter.getItemId(position);\r\n Rect startRect = new Rect(child.getLeft(), child.getTop(), child.getRight(),\r\n child.getBottom());\r\n listViewItemBounds.put(itemID, startRect);\r\n listViewItemDrawables.put(itemID, getBitmapDrawableFromView(child));\r\n }\r\n\r\n /**\r\n * Adds the new object to the data set, thereby modifying the adapter,\r\n * as well as adding a stable Id for that specified object.\r\n */\r\n // mData.add(0, newObj);\r\n // adapter.addStableIdForDataAtPosition(0);\r\n adapter.addItem(photoFile);\r\n adapter.notifyDataSetChanged();\r\n\r\n final ViewTreeObserver observer = getViewTreeObserver();\r\n observer.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {\r\n public boolean onPreDraw() {\r\n observer.removeOnPreDrawListener(this);\r\n\r\n ArrayList<Animator> animations = new ArrayList<Animator>();\r\n\r\n final View newCell = getChildAt(0);\r\n final ImageView imgView = (ImageView) newCell.findViewById(R.id.bwc_iv_line_frame);\r\n final ImageView copyImgView = new ImageView(mContext);\r\n\r\n int firstVisiblePosition = getFirstVisiblePosition();\r\n final boolean shouldAnimateInNewRow = shouldAnimateInNewRow();\r\n final boolean shouldAnimateInImage = shouldAnimateInNewImage();\r\n\r\n if (shouldAnimateInNewRow) {\r\n /** Fades in the text of the first cell. */\r\n // TextView textView =\r\n // (TextView)newCell.findViewById(R.id.text_view);\r\n // ObjectAnimator textAlphaAnimator =\r\n // ObjectAnimator.ofFloat(textView,\r\n // View.ALPHA, 0.0f, 1.0f);\r\n // animations.add(textAlphaAnimator);\r\n\r\n /**\r\n * Animates in the extra hover view corresponding to the\r\n * image in the top row of the ListView.\r\n */\r\n if (shouldAnimateInImage) {\r\n\r\n int width = imgView.getWidth();\r\n int height = imgView.getHeight();\r\n int realH = height - imgView.getPaddingTop() - imgView.getPaddingBottom();\r\n int realW = width - imgView.getPaddingLeft() - imgView.getPaddingRight();\r\n\r\n Point photoViewLoc = getLocationOnScreen(imgView);\r\n Point layoutLoc = getLocationOnScreen(mLayout);\r\n\r\n Bitmap bitmap = PhotoListViewAdapter.createListImageFromPhoto(photoBmp, 1);\r\n copyImgView.setImageBitmap(bitmap);\r\n int padding = imgView.getPaddingLeft();\r\n copyImgView.setX(photoViewLoc.x - layoutLoc.x + padding);\r\n copyImgView.setY(-realH);\r\n\r\n imgView.setVisibility(View.INVISIBLE);\r\n copyImgView.setScaleType(ImageView.ScaleType.FIT_CENTER);\r\n ObjectAnimator imgViewTranslation = ObjectAnimator.ofFloat(copyImgView,\r\n View.Y, photoViewLoc.y - layoutLoc.y + imgView.getPaddingTop());\r\n\r\n PropertyValuesHolder imgViewScaleY = PropertyValuesHolder.ofFloat(\r\n View.SCALE_Y, 0.5f, 1.0f);\r\n PropertyValuesHolder imgViewScaleX = PropertyValuesHolder.ofFloat(\r\n View.SCALE_X, 0.5f, 1.0f);\r\n ObjectAnimator imgViewScaleAnimator = ObjectAnimator\r\n .ofPropertyValuesHolder(copyImgView, imgViewScaleX, imgViewScaleY);\r\n imgViewScaleAnimator.setInterpolator(sOvershootInterpolator);\r\n animations.add(imgViewTranslation);\r\n animations.add(imgViewScaleAnimator);\r\n\r\n RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(realW,\r\n realH);\r\n\r\n mLayout.addView(copyImgView, params);\r\n }\r\n }\r\n\r\n /**\r\n * Loops through all the current visible cells in the ListView\r\n * and animates all of them into their post layout positions\r\n * from their original positions.\r\n */\r\n for (int i = 0; i < getChildCount(); i++) {\r\n View child = getChildAt(i);\r\n int position = firstVisiblePosition + i;\r\n long itemId = adapter.getItemId(position);\r\n Rect startRect = listViewItemBounds.get(itemId);\r\n int top = child.getTop();\r\n if (startRect != null) {\r\n /**\r\n * If the cell was visible before the data set change\r\n * and after the data set change, then animate the cell\r\n * between the two positions.\r\n */\r\n int startTop = startRect.top;\r\n int delta = startTop - top;\r\n ObjectAnimator animation = ObjectAnimator.ofFloat(child,\r\n View.TRANSLATION_Y, delta, 0);\r\n // animation.setStartDelay(ANIM_PHASE_1_DURATION);\r\n animations.add(animation);\r\n } else {\r\n /**\r\n * If the cell was not visible (or present) before the\r\n * data set change but is visible after the data set\r\n * change, then use its height to determine the delta by\r\n * which it should be animated.\r\n */\r\n int childHeight = child.getHeight() + getDividerHeight();\r\n int startTop = top + (i > 0 ? childHeight : -childHeight);\r\n int delta = startTop - top;\r\n ObjectAnimator animation = ObjectAnimator.ofFloat(child,\r\n View.TRANSLATION_Y, delta, 0);\r\n // animation.setStartDelay(ANIM_PHASE_1_DURATION);\r\n animations.add(animation);\r\n }\r\n listViewItemBounds.remove(itemId);\r\n listViewItemDrawables.remove(itemId);\r\n }\r\n\r\n /**\r\n * Loops through all the cells that were visible before the data\r\n * set changed but not after, and keeps track of their\r\n * corresponding drawables. The bounds of each drawable are then\r\n * animated from the original state to the new one (off the\r\n * screen). By storing all the drawables that meet this\r\n * criteria, they can be redrawn on top of the ListView via\r\n * dispatchDraw as they are animating.\r\n */\r\n for (Long itemId : listViewItemBounds.keySet()) {\r\n BitmapDrawable bitmapDrawable = listViewItemDrawables.get(itemId);\r\n Rect startBounds = listViewItemBounds.get(itemId);\r\n bitmapDrawable.setBounds(startBounds);\r\n\r\n int childHeight = startBounds.bottom - startBounds.top + getDividerHeight();\r\n Rect endBounds = new Rect(startBounds);\r\n endBounds.offset(0, childHeight);\r\n\r\n ObjectAnimator animation = ObjectAnimator.ofObject(bitmapDrawable, \"bounds\",\r\n sBoundsEvaluator, startBounds, endBounds);\r\n animation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\r\n private Rect mLastBound = null;\r\n private Rect mCurrentBound = new Rect();\r\n\r\n @Override\r\n public void onAnimationUpdate(ValueAnimator valueAnimator) {\r\n Rect bounds = (Rect) valueAnimator.getAnimatedValue();\r\n mCurrentBound.set(bounds);\r\n if (mLastBound != null) {\r\n mCurrentBound.union(mLastBound);\r\n }\r\n mLastBound = bounds;\r\n invalidate(mCurrentBound);\r\n }\r\n });\r\n\r\n listViewItemBounds.remove(itemId);\r\n listViewItemDrawables.remove(itemId);\r\n\r\n mCellBitmapDrawables.add(bitmapDrawable);\r\n animations.add(animation);\r\n }\r\n\r\n /**\r\n * Animates all the cells from their old position to their new\r\n * position at the same time.\r\n */\r\n setEnabled(false);\r\n mRowAdditionAnimListener.onRowAdditionAnimationStart();\r\n AnimatorSet set = new AnimatorSet();\r\n set.setDuration(NEW_ROW_DURATION);\r\n set.playTogether(animations);\r\n set.addListener(new AnimatorListenerAdapter() {\r\n @Override\r\n public void onAnimationEnd(Animator animation) {\r\n mCellBitmapDrawables.clear();\r\n imgView.setVisibility(View.VISIBLE);\r\n mLayout.removeView(copyImgView);\r\n mRowAdditionAnimListener.onRowAdditionAnimationEnd();\r\n setEnabled(true);\r\n invalidate();\r\n }\r\n });\r\n set.start();\r\n\r\n listViewItemBounds.clear();\r\n listViewItemDrawables.clear();\r\n return true;\r\n }\r\n });\r\n }", "public void addRow (ArrayList<Object> l, int index)\n\t{\n\t\tm_data.rows.add(index, l);\n\t\tm_data.rowsMeta.add(index, null);\n\t}", "protected ListView<T> createTargetListView() {\n/* 447 */ return createListView();\n/* */ }", "public void btnAddClicked(View view){\n List list = new List(input.getText().toString());\n dbHandler.addProduct(list);\n printDatabase();\n }", "public void addNewItemClicked(View view) {\n// Toast.makeText(CheckboxNoteActivity.this, \"RelativeLayout Clicked Successfully\", Toast.LENGTH_SHORT).show();\n addNewListItem();\n }", "private void addStep(String step) {\n stepView = View.inflate(NewRecipe.this, R.layout.new_step_layout, null);\n\n txtInstruction = stepView.findViewById(R.id.txtInstruction);\n\n //count current item\n int count = stepListLayout.getChildCount();\n LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n param.setMargins(0, 10, 0, 10);\n stepView.setLayoutParams(param);\n stepView.setTag(\"step\" + count);\n\n stepListLayout.setBackgroundColor(Color.TRANSPARENT);\n stepListLayout.addView(stepView);\n\n //// set value after adding new row\n count = stepListLayout.getChildCount();\n stepText = stepView.findViewById(R.id.step);\n\n for (int i = 0; i < count; i++) {\n itemView = stepListLayout.getChildAt(i);\n if (itemView instanceof LinearLayout) {\n\n ImageButton imgDel = stepView.findViewById(R.id.imgDel);\n imgDel.setTag(stepView);\n imgDel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n removeView((View) v.getTag());\n }\n });\n stepText.setText((i + 1) + \":\");\n txtInstruction.setTag(\"Instruction\" + (i + 1));\n if (!step.equals(\"\")) {\n txtInstruction.setText(step);\n }\n }\n }\n\n }", "public void addUpso(String id, String crtfc_upso_mgt_sno, String upso_sno, String upso_nm, String cgg_code,\n String cgg_code_nm, String cob_code_nm, String bizcnd_code_nm, String owner_nm,\n String crtfc_gbn, String crtfc_gbn_nm, String crtfc_chr_nm, String crtfc_chr_id,\n String map_indict_yn, String crtfc_class, String y_dnts, String x_cnts, String tel_no,\n String rdn_detail_addr, String rdn_addr_code, String rdn_code_nm, String bizcnd_code,\n String cob_code, String crtfc_sno, String crt_time, String upd_time, String food_menu,\n String gnt_no, String crtfc_yn) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_ROWID, id);\n values.put(CRTFC_UPSO_MGT_SNO, crtfc_upso_mgt_sno);\n values.put(UPSO_SNO, upso_sno);\n values.put(UPSO_NM, upso_nm);\n values.put(CGG_CODE, cgg_code);\n values.put(CGG_CODE_NM, cgg_code_nm);\n values.put(COB_CODE_NM, cob_code_nm);\n values.put(BIZCND_CODE_NM, bizcnd_code_nm);\n values.put(OWNER_NM, owner_nm);\n values.put(CRTFC_GBN, crtfc_gbn);\n values.put(CRTFC_GBN_NM, crtfc_gbn_nm);\n values.put(CRTFC_CHR_NM, crtfc_chr_nm);\n values.put(CRTFC_CHR_ID, crtfc_chr_id);\n values.put(MAP_INDICT_YN, map_indict_yn);\n values.put(CRTFC_CLASS, crtfc_class);\n values.put(Y_DNTS, y_dnts);\n values.put(X_CNTS, x_cnts);\n values.put(TEL_NO, tel_no);\n values.put(RDN_DETAIL_ADDR, rdn_detail_addr);\n values.put(RDN_ADDR_CODE, rdn_addr_code);\n values.put(RDN_CODE_NM, rdn_code_nm);\n values.put(BIZCND_CODE, bizcnd_code);\n values.put(COB_CODE, cob_code);\n values.put(CRTFC_SNO, crtfc_sno);\n values.put(CRT_TIME, crt_time);\n values.put(UPD_TIME, upd_time);\n values.put(FOOD_MENU, food_menu);\n values.put(GNT_NO, gnt_no);\n values.put(CRTFC_YN, crtfc_yn);\n\n // Inserting Row\n long iid = db.insert(TABLE_UPSO, null, values);\n db.close(); // Closing database connection\n\n Log.d(TAG, \"New upso inserted into sqlite: \" + iid);\n }", "public abstract void executeListView(int pos);", "private void makeListGUI(String list, int index)\n {\n // get a reference to the LayoutInflater service\n LayoutInflater inflater = (LayoutInflater) getSystemService(\n Context.LAYOUT_INFLATER_SERVICE);\n\n // inflate new_list_view.xml to create new list and edit Buttons\n View newListView = inflater.inflate(R.layout.new_list_view, null);\n \n // get newListButton, set its text and register its listener\n Button newListButton = \n (Button) newListView.findViewById(R.id.newListButton);\n newListButton.setText(list); \n newListButton.setOnClickListener(listButtonListener); \n\n // get newEditButton and register its listener\n Button newEditButton = \n (Button) newListView.findViewById(R.id.newEditButton); \n newEditButton.setOnClickListener(editButtonListener);\n\n // add new list and edit buttons to listTableLayout\n listTableLayout.addView(newListView, index);\n }", "public static String _activity_create(boolean _firsttime) throws Exception{\nmostCurrent._activity.LoadLayout(\"regis\",mostCurrent.activityBA);\n //BA.debugLineNum = 31;BA.debugLine=\"Activity.Title = \\\"Register\\\"\";\nmostCurrent._activity.setTitle(BA.ObjectToCharSequence(\"Register\"));\n //BA.debugLineNum = 33;BA.debugLine=\"ImageView1.Visible = False\";\nmostCurrent._imageview1.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 35;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "private long insertRow(){\n // Mukund Inserted New Table here\n mDbHelper = new ClientDbHelper(this);\n SQLiteDatabase db = mDbHelper.getWritableDatabase();\n\n // Create a new map of values, where column names are the keys\n ContentValues values = new ContentValues();\n values.put(ClientEntry.COLUMN_CLIENT_NAME, name);\n values.put(ClientEntry.COLUMN_CLIENT_GENDER, mGender);\n values.put(ClientEntry.COLUMN_CLIENT_SOCIETY, society);\n values.put(ClientEntry.COLUMN_CLIENT_ADDRESS, address);\n values.put(ClientEntry.COLUMN_CLIENT_PHONE, phone);\n //values.put(ClientEntry.COLUMN_CLIENT_EMAIL, emailString);\n\n // Insert the new row, returning the primary key value of the new row\n long newRowId = db.insert(ClientEntry.TABLE_NAME, null, values);\n\n\n Log.v(\"ClientActivity\",\"New Row ID: \"+ newRowId);\n return newRowId;\n }", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t\tString im_records;\r\n\t\tString peerId = getIntent().getExtras().getString(\"peer_row_id\");\r\n\t\tListView lv = (ListView) this.getListView();\r\n\t\tlv.setBackgroundResource(R.drawable.cyan_background);\r\n\t\tall_data = new ArrayList<ArrayList>();\r\n\r\n\t\tString id, message, source, destination, time, length;\r\n\t\tHistoryLog query = new HistoryLog(this);\r\n\t\tquery.open();\r\n\r\n\t\tim_records = query.getImData(peerId);\r\n\t\tStringTokenizer stok = new StringTokenizer(im_records, \"|\");\r\n\r\n\t\twhile (stok.hasMoreTokens()) {\r\n\t\t\tid = stok.nextToken().trim();\r\n\t\t\tif (!id.equals(\"\")) {\r\n\t\t\t\tmessage = stok.nextToken().trim();\r\n\t\t\t\tsource = stok.nextToken();\r\n\t\t\t\tdestination = stok.nextToken();\r\n\t\t\t\ttime = stok.nextToken();\r\n\t\t\t\tlength = stok.nextToken();\r\n\r\n\t\t\t\tmyList = new ArrayList<String>();\r\n\r\n\t\t\t\tmyList.add(id);\r\n\t\t\t\tmyList.add(message);\r\n\t\t\t\tmyList.add(source);\r\n\t\t\t\tmyList.add(destination);\r\n\t\t\t\tmyList.add(time);\r\n\t\t\t\tmyList.add(length);\r\n\r\n\t\t\t\tall_data.add(myList);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tarrayAdapter = new ArrayAdapter<String>(this,\r\n\t\t\t\tandroid.R.layout.simple_list_item_1);\r\n\t\tsetListAdapter(arrayAdapter);\r\n\r\n\t\tfor (int i = 0; i < all_data.size(); i++) {\r\n\t\t\tString list_item = (String) all_data.get(i).get(0) + \": \"\r\n\t\t\t\t\t+ (String) all_data.get(i).get(1);\r\n\t\t\tarrayAdapter.add(list_item);\r\n\t\t}\r\n\r\n\t\tarrayAdapter.notifyDataSetChanged();\r\n\t\tquery.close();\r\n\r\n\t\tlv.setOnItemClickListener(new AdapterView.OnItemClickListener() {\r\n\t\t\tpublic void onItemClick(AdapterView<?> parentView, View childView,\r\n\t\t\t\t\tint position, long id) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tString itemSelected = (((TextView) childView).getText())\r\n\t\t\t\t\t\t.toString();\r\n\t\t\t\tString info1, info2, info3, info4, info5, info6;\r\n\r\n\t\t\t\tArrayList<String> listo = all_data.get(position);\r\n\t\t\t\tinfo1 = listo.get(0);\r\n\t\t\t\tinfo2 = listo.get(1);\r\n\t\t\t\tinfo3 = listo.get(2);\r\n\t\t\t\tinfo4 = listo.get(3);\r\n\t\t\t\tinfo5 = listo.get(4);\r\n\t\t\t\tinfo5 = info5.replace(\"Current Time : \", \"\");\r\n\t\t\t\tinfo6 = listo.get(5);\r\n\r\n\t\t\t\tfinal String items[] = { \"Log #: \" + info1,\r\n\t\t\t\t\t\t\"Message: \" + info2, \"Source: \" + info3,\r\n\t\t\t\t\t\t\"Destination: \" + info4, \"Time: \" + info5,\r\n\t\t\t\t\t\t\"Message Length: \" + info6 };\r\n\r\n\t\t\t\tAlertDialog.Builder ab = new AlertDialog.Builder(\r\n\t\t\t\t\t\tImPeerHistoryList.this);\r\n\t\t\t\tab.setTitle(\"Message Details\");\r\n\t\t\t\tab.setItems(items, null);\r\n\t\t\t\tab.show();\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t}", "public void onAddField(View v) {\r\n dynamicEditTexts = new ArrayList<EditText>();//added this\r\n\r\n LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n final View rowView = inflater.inflate(R.layout.field, null);\r\n // Add the new row before the add field button.\r\n parentLinearLayout.addView(rowView, parentLinearLayout.getChildCount() - 1);\r\n EditText dynamicText = new EditText(this);\r\n dynamicEditTexts.add(dynamicText);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.actionAddTask:\n //set up an Alert Dialog box, so the user can add a list item\n final EditText taskEditText = new EditText(this);\n\n //create a builder for an alert dialog that uses the default alert dialog theme\n AlertDialog dialog = new AlertDialog.Builder(this)\n .setTitle(\"Add a new task\")\n .setMessage(\"What do you want to do next?\")\n\n //incorporated an EditText into the Alert Dialogue\n .setView(taskEditText)\n\n //Provide a cancel button\n .setNegativeButton(\"Cancel\", null)\n\n //Provide an add button\n .setPositiveButton(\"Add\", new AlertDialog.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n //place text from EditText box into database and update UI of ListView\n String task = String.valueOf(taskEditText.getText());\n\n //a read/write database object will be returned\n SQLiteDatabase db = dbHelper.getWritableDatabase();\n\n //used to store a set of values\n ContentValues values = new ContentValues();\n\n //add the task to the set\n values.put(TaskContract.TaskEntry.COL_TASK_TITLE, task);\n\n //general method for inserting a row into the database\n db.insertWithOnConflict(TaskContract.TaskEntry.TABLE,\n null,\n values,\n SQLiteDatabase.CONFLICT_REPLACE);\n db.close(); //close the database object\n updateUI(); //update the look of the ListView\n }\n })\n .create(); //create an Alert Dialog with the arguments supplied to the builder\n dialog.show(); //this will show the Alert Dialogue over the regular view\n return true;\n default:\n return super.onOptionsItemSelected(item); //user can also exit out of the Alert Dialogue if he/she taps anywhere outside the Alert Dialogue box\n }\n }", "private void registerClick() {\n listView = (ListView) findViewById(R.id.listViewPick);\n listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n private AdapterView parent;\n\n @Override\n public void onItemClick(AdapterView<?> parent, View viewClicked, int position, long id) {\n this.parent = parent;\n TextView textView = (TextView) viewClicked;\n //String message = \"You clicked # \" + position + \", which is list: \" + textView.getText().toString();\n //Toast.makeText(PickExisting.this, message, Toast.LENGTH_SHORT).show();\n\n String name = textView.getText().toString();\n Product product = new Product();\n product = myDB.findProdByName(name);\n\n if (FROM.equals(\"UseList\")) {\n myDB.addListProduct(FORWARD, product);\n }else{\n myDB.addInventoryProduct(FORWARD, product);\n }\n }\n });\n }", "int addRow(RowData row_data) throws IOException;", "private void startEditExistingTextActivity(int whichListPosition){\n ArrayList<String> listToExpand = new ArrayList<String>();\n listToExpand = myList.get(whichListPosition);\n Intent intent = new Intent(this, EditExistingText.class);\n Bundle bundle = new Bundle();\n bundle.putStringArrayList(\"theList\", listToExpand);\n bundle.putInt(\"theListPosition\", whichListPosition);\n bundle.putInt(\"theItemPosition\", 0);\n intent.putExtras(bundle);\n startActivityForResult(intent, EDITTEXTRC);\n }", "public boolean onItemLongClick(AdapterView<?> arg0, View v,\n int index, long arg3) {\n\n String str=listview.getItemAtPosition(index).toString();\n Toast.makeText(applicationContext, \"Added to Cart: \" +str, Toast.LENGTH_LONG).show();\n checkout_arrayList.add(str);\n // Log.d(\"long click : \" +str);\n return true;\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n\n String SQL_CREATE_NEW_ITEMS_TABLE = \"CREATE TABLE \" + ListContract.ListContractEntry.ITEMS_TABLE_NAME +\" (\"\n + ListContract.ListContractEntry._ID + \" INTEGER PRIMARY KEY AUTOINCREMENT, \"\n + ListContract.ListContractEntry.COLUMN_ITEM_NAME + \" TEXT NOT NULL, \"\n + ListContract.ListContractEntry.COLUMN_ITEM_DATE + \" INTEGER);\";\n\n db.execSQL(SQL_CREATE_NEW_ITEMS_TABLE);\n\n }", "@Test\n public void lookUpAddToDBActivity(){\n TextView itemType = (TextView) addToDBActivity.findViewById(R.id.textView);\n TextView itemName = (TextView) addToDBActivity.findViewById(R.id.textView2);\n TextView itemUnit = (TextView) addToDBActivity.findViewById(R.id.textView3);\n TextView searchFor = (TextView) addToDBActivity.findViewById(R.id.textView4);\n EditText itemInType = (EditText) addToDBActivity.findViewById(R.id.itemInType);\n EditText itemInName = (EditText) addToDBActivity.findViewById(R.id.itemInName);\n EditText itemInUnit = (EditText) addToDBActivity.findViewById(R.id.itemInUnit);\n EditText searchItemName = (EditText) addToDBActivity.findViewById(R.id.searchItemName);\n EditText queryDisplay = (EditText) addToDBActivity.findViewById(R.id.queryDisplay);\n Button add = (Button) addToDBActivity.findViewById(R.id.button);\n Button query = (Button) addToDBActivity.findViewById(R.id.button2);\n Button search = (Button) addToDBActivity.findViewById(R.id.button4);\n Button retrieve = (Button) addToDBActivity.findViewById(R.id.button5);\n\n assertNotNull(\"Item type TextView could not be found in AddToDBActivity\", itemType);\n assertNotNull(\"Item name TextView could not be found in AddToDBActivity\", itemName);\n assertNotNull(\"Item unit TextView could not be found in AddToDBActivity\", itemUnit);\n assertNotNull(\"Search for TextView could not be found in AddToDBActivity\", searchFor);\n assertNotNull(\"Item in type EditText could not be found in AddToDBActivity\", itemInType);\n assertNotNull(\"Item in name EditText could not be found in AddToDBActivity\", itemInName);\n assertNotNull(\"Item in unit EditText could not be found in AddToDBActivity\", itemInUnit);\n assertNotNull(\"Search item name EditText could not be found in AddToDBActivity\", searchItemName);\n assertNotNull(\"Query display EditText could not be found in AddToDBActivity\", queryDisplay);\n assertNotNull(\"Add button could not be found in AddToDBActivity\", add);\n assertNotNull(\"Query Database button could not be found in AddToDBActivity\", query);\n assertNotNull(\"Search Item button could not be found in AddToDBActivity\", search);\n assertNotNull(\"Retrieve List button could not be found in AddToDBActivity\", retrieve);\n }", "private String getText(TextView textView) {\n return textView.getText().toString().trim();\n>>>>>>> 35b46c96d9bd37f04030b6be59d814a89f45443d\n }\n\n public void reloadingDatabase() {\n taskList= DBhelper.getALLTASK();\n\n if (taskList.size()==0){\n Toast.makeText(this, \" No task in record \", Toast.LENGTH_LONG).show();\n\n }\n\n Adapter adapter = new com.ashishjayan.trash2.ListView)this, R.layout.item_listview, taskList, DBhelper,\n ListView.setAdapter(adapter);\n }\n\n\n // this is for dynamic alert.....\n private void addNewTaskAlertDialog(){\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity. this);\n alertDialog.setTitle (\"Add a course Task\");\n\n\n LinearLayout layout= new LinearLayout(this);\n layout.setPadding(10, 10 , 10, 10);\n layout.setOrientation(LinearLayout.VERTICAL);\n final EditText courseBox= new EditText(this );\n courseBox.setHint(\"Enter course name: \");\n layout.addView(courseBox);\n\n final EditText infoBox= new EditText(this );\n courseBox.setHint(\"Enter the task info: \");\n layout.addView(infoBox);\n\n alertDialog.setView(layout);\n\n\n alertDialog.setPositiveButton(\" ok \", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n Task task= new Task(getText(courseBox), getText(infoBox)));\n }\n });\n }\n\n private String getText(TextView textView) {\n return textView.getText().toString().trim();\n }\n\n}", "@Override\n public void onClick(DialogInterface dialog, int which) {\n String task = String.valueOf(taskEditText.getText());\n\n //a read/write database object will be returned\n SQLiteDatabase db = dbHelper.getWritableDatabase();\n\n //used to store a set of values\n ContentValues values = new ContentValues();\n\n //add the task to the set\n values.put(TaskContract.TaskEntry.COL_TASK_TITLE, task);\n\n //general method for inserting a row into the database\n db.insertWithOnConflict(TaskContract.TaskEntry.TABLE,\n null,\n values,\n SQLiteDatabase.CONFLICT_REPLACE);\n db.close(); //close the database object\n updateUI(); //update the look of the ListView\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n busNameItemAdapter = new BusNameItemAdapter(this.getApplicationContext(), this);\n listView = (ListView) findViewById(R.id.ListView);\n listView.setAdapter(busNameItemAdapter);\n\n editText = (EditText) findViewById(R.id.EditText);\n listView.requestFocus();\n\n\n // Initialize the native part of the sample and connect to remote alljoyn instance\n bus_handler.post(new Runnable() {\n public void run() {\n final int ret = simpleOnCreate(getPackageName());\n if (0 != ret) {\n handler.post(new Runnable() {\n public void run() {\n Toast.makeText(Client.this, \"simpleOnCreate failed with \" + ret, Toast.LENGTH_LONG).show();\n finish();\n }\n });\n }\n }\n });\n }", "private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed\n\n AttlistTableModel tm = (AttlistTableModel) attrTable.getModel();\n tm.addRow();\n int actualIndex = numRows() - 1;\n attrTable.getSelectionModel().setSelectionInterval(actualIndex, actualIndex);\n }", "private void populateListView() {\n Log.d(TAG, \"populateListView: Displaying data in the ListView.\");\n\n Cursor data = mDatabaseHelper.getEventData();\n ArrayList<String> listData = new ArrayList<>();\n while(data.moveToNext()){\n listData.add(data.getString(1));\n }\n\n /* Set list adapter */\n ListAdapter adapter = new ArrayAdapter<>(this, R.layout.event_list_item, listData);\n mListView.setAdapter(adapter);\n\n /* Set onClick Listener to take user to single event and transfer ID and Name intent to new activity */\n mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n String eventName = adapterView.getItemAtPosition(i).toString();\n Log.d(TAG, \"onItemClick: You Clicked on \" + eventName);\n\n Cursor data = mDatabaseHelper.getEventID(eventName);\n int eventID = -1;\n while(data.moveToNext()){\n eventID = data.getInt(0);\n }\n if(eventID > -1){\n Log.d(TAG, \"onItemClick: The ID is: \" + eventID);\n Intent SingleEventIntent = new Intent(calendarAllEvents.this, calendarSingleEvent.class);\n SingleEventIntent.putExtra(\"eventID\",eventID);\n SingleEventIntent.putExtra(\"eventName\",eventName);\n startActivity(SingleEventIntent);\n }\n else{\n toastMessage(getResources().getString(R.string.noID));\n }\n }\n });\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);\n\n setContentView(R.layout.activity_additems);\n activity=this;\n context=this;\n\n LayoutInflater inflater = getLayoutInflater();\n act = AddItems.this;\n /* toolbar = (Toolbar) findViewById(R.id.additem_toolbar);\n toolbar.setTitle(getResources().getString(R.string.additem));\n toolbar.setTitleTextColor(Color.WHITE);\n toolbar.setBackgroundColor(getResources().getColor(R.color.brandColor));\n setSupportActionBar(toolbar);\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);*/\n\n startSale = (Button) findViewById(R.id.additem_startsale);\n lv = (ListView) findViewById(R.id.additem_listview);\n adapter=new CreateProductsListAdapter(inflater, list_pm, this);\n lv.setAdapter(adapter);\n\n View header = inflater.inflate(R.layout.header_garrage_list, lv, false);\n //time = (TextView) header.findViewById(R.id.hgl_clock);\n date = (TextView) header.findViewById(R.id.hgl_date);\n address1 = (TextView) header.findViewById(R.id.hgl_address1);\n terms_conditions=(CheckBox)findViewById(R.id.checkBox);\n termsOfAgreement=(TextView)findViewById(R.id.termsOfAgreement);\n //lv.addHeaderView(header);\n //lv.setHeaderDividersEnabled(true);\n\n String terms=\"I agree to the Terms and Conditions.\";\n SpannableString ss = new SpannableString(\"I agree to the Terms and Conditions.\");\n ss.setSpan(new MyClickableSpan(),0,terms.length()-1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n termsOfAgreement.setText(ss);\n termsOfAgreement.setMovementMethod(LinkMovementMethod.getInstance());\n\n SpannableString ss1 = new SpannableString(\"Already have a account? Sign In\");\n\n ss1.setSpan(new MyClickableSpan(),24,31, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n\n View footer = inflater.inflate(R.layout.footer_garrage_list,lv,false);\n additem = (TextView) footer.findViewById(R.id.fgl_additem);\n lv.addFooterView(footer);\n lv.setFooterDividersEnabled(true);\n\n if(getIntent().hasExtra(AddItems.SALE_DETAILS_KEY))\n sm = (CreateSalesModel) getIntent().getExtras().getSerializable(SALE_DETAILS_KEY);\n\n if(getIntent().hasExtra(AddItems.FROM_KEY))\n tag=getIntent().getIntExtra(AddItems.FROM_KEY,0);\n\n String title;\n if(tag==GlobalVariables.TYPE_MY_SALE){\n title=\"Update Sale\";\n startSale.setText(title);\n additem.setVisibility(View.GONE);\n }else {\n title=\"Publish\";\n\n }\n\n\n /* Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);*/\n\n ActionBar actionBar = getSupportActionBar();\n if (actionBar != null) {\n actionBar.setDisplayHomeAsUpEnabled(true);\n actionBar.setDisplayShowHomeEnabled(true);\n actionBar.setTitle(title);\n actionBar.setDisplayHomeAsUpEnabled(true);\n actionBar.setDisplayShowHomeEnabled(true);\n actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.brandColor)));\n }\n window = getWindow();\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {\n //enable translucent statusbar via flags\n globalFunctions.setTranslucentStatusFlag(window, true);\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n this.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }\n /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n //we don't need the translucent flag this is handled by the theme\n globalFunctions.setTranslucentStatusFlag(window, true);\n //set the statusbarcolor transparent to remove the black shadow\n this.getWindow().setStatusBarColor(Color.TRANSPARENT);\n }*/\n\n if(sm!=null)\n if(sm.getProducts().size()==0)\n callProductDetails(null);\n\n\n startSale.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if(tag==GlobalVariables.TYPE_MY_SALE){\n update_sale(act);\n }else {\n if(!terms_conditions.isChecked()){\n terms_conditions.setError(\"Please Agree for Terms and Conditions\");\n return;\n }else {\n startSale(act);\n }\n\n }\n }\n });\n\n Log.i(TAG,\"name is \"+sm.getName());\n }", "public void addQuickAddPatientPersonalfromLocal(String create_date, String prescriptionImgPath, String added_by, String status, String phnumber, String email, String referedBy, String referedTo) {\n\n SQLiteDatabase db = this.getWritableDatabase();\n try {\n ContentValues values = new ContentValues();\n values.put(PRESCRIPTION, prescriptionImgPath);\n values.put(ADDED_ON, create_date);\n values.put(ADDED_BY, added_by);\n values.put(STATUS, status);\n values.put(PHONE_NUMBER, phnumber);\n values.put(KEY_EMAIL, email);\n values.put(REFERED_BY, referedBy);\n values.put(REFERED_TO, referedTo);\n\n // Inserting Row\n db.insert(\"prescription_queue\", null, values);\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (db != null) {\n db.close();\n }\n }\n }", "void onPrepareListView(ListView listView);", "public void onClick_AddRecord(View v, String task, int status) {\n\t\t\n\t\t// insertRow() returns a long which is the id number\n\t\tlong newId = myDb.insertRow(task, status);\n\t\tpopulateListViewFromDB();\n\t\t\n\t\t\n\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n\n super.onCreate(savedInstanceState);\n \n /* //要获取屏幕的宽和高等参数,首先需要声明一个DisplayMetrics对象,屏幕的宽高等属性存放在这个对象中\n DisplayMetrics DM = new DisplayMetrics();\n //获取窗口管理器,获取当前的窗口,调用getDefaultDisplay()后,其将关于屏幕的一些信息写进DM对象中,最后通过getMetrics(DM)获取\n getWindowManager().getDefaultDisplay().getMetrics(DM);\n //打印获取的宽和高\n int width=DM.widthPixels;\n int height=DM.heightPixels;\n \n ListView lv=(ListView)findViewById(R.layout.listview);\n \n ListView.LayoutParams lp = new ListView.LayoutParams(width, height);\n lv.setLayoutParams(lp);//\n*/ // ListView.LayoutParams lp1=(ListView.LayoutParams)lv.seti.\n // ListView.\t\t\n /* LinearLayout.LayoutParams linearParams0 = (LinearLayout.LayoutParams)table_item_item0.getLayoutParams(); \n linearParams0.width = itemWidth; \n table_item_item0.setLayoutParams(linearParams0);*/\n\n \n \n \n setContentView(R.layout.mainact);\n \n\n list = new ArrayList<HashMap<String,String>>(); \n \n\n /**set alarm list adapter*/\n adapter = new SimpleAdapter(this,list,R.layout.listview,\n \t\tnew String[]{\"ItemName\",\"PersonName\",\"Organization\",\"AlarmTime\",\n \t\t\"Position\",\"IsAllowed\"},\n \t\tnew int[]{R.id.txtItemName,R.id.txtPersonName,R.id.txtOrganization,\n \t\tR.id.txtAlarmTime,R.id.txtPosition, R.id.txtIsAllowed}); \n \n this.getListView().addHeaderView(\n \t\tthis.getLayoutInflater().inflate(R.layout.header_view, null), \n \t\tnull, false); \n setListAdapter(adapter); \n \n //ZYF\n final AlertDialog.Builder builder = new AlertDialog.Builder(this); \n this.getListView().setOnItemClickListener(new OnItemClickListener(){ \n \t @SuppressWarnings(\"unchecked\") \n \t //单击显示告警的详细信息\n \t public void onItemClick(AdapterView<?> parent, View view, int position, long id) { \n \t\t ListView listView = (ListView)parent; \n \t\t HashMap<String, String> map = (HashMap<String, String>) listView.getItemAtPosition(position); \n \t\t String temp = \"物品名称 :\"+map.get(\"ItemName\")+\"\\r\\n\"; \n \t\t temp+=\"责任人 :\"+map.get(\"PersonName\")+\"\\r\\n\";\n \t\t temp+=\"所属部门 :\"+map.get(\"Organization\")+\"\\r\\n\";\n \t\t temp+=\"告警时间 :\"+map.get(\"AlarmTime\")+\"\\r\\n\";\n \t\t temp+=\"检测位置 :\"+map.get(\"Position\")+\"\\r\\n\";\n \t\t temp+=\"是否授权 :\"+map.get(\"IsAllowed\")+\"\\r\\n\";\n \t\t builder.setTitle(\"告警详细信息\");\n \t\t builder.setMessage(temp);\n \t\t builder.show();\n \t\t } \n \t });\n \n /**the Cancel button , set listener**/\n Button btnCancel=(Button)findViewById(R.id.btnQuit);\n btnCancel.setOnClickListener(new Button.OnClickListener()\n {\n \tpublic void onClick(View v)\n \t{\n \t\tshowDialog(QUIT_DLG);\n \t}\n });\n \n /**the Clear button , set listener**/\n Button btnClear=(Button)findViewById(R.id.btnClear);\n btnClear.setOnClickListener(new Button.OnClickListener()\n {\n \tpublic void onClick(View v)\n \t{\n \t\tlist.clear();\n \t\tadapter.notifyDataSetChanged();\n \t\tsetListAdapter(adapter);\n \t}\n });\n \n \n \n /** init Socket*/\n \t\t\ttry\n \t\t { \n \t\t\treceiveSocket = new DatagramSocket(Predefine.PortMonitorData);\t \n \t\t } \n \t\t catch (SocketException e) \n \t\t {\n \t \tToast.makeText(getApplicationContext(), \"无法创建报警接收Socket\\n\"+\n \t \t\t\te.getMessage(),Toast.LENGTH_SHORT).show();\n \t \treturn;\n \t\t }\n\t \t /**start receive thread */\n \t\t\tThreadResult.bStopRec = false;\n\t \t recThread = new Thread(new AlarmRecThread(receiveSocket,list,handler));\n\t \t recThread.start();\n\t \t\n }", "private void insertItem(Hashtable<String, List<Integer>> h, Element e) {\n\t\tString key = e.attribute(\"sourcefilepath\").getValue().replace('/', '\\\\') + e.attribute(\"sourcefile\").getValue();\r\n\t\tint line = Integer.parseInt(e.attribute(\"line\").getValue().trim());\r\n\t\tList<Integer> l = h.get(key);\r\n\t\tif(l==null){\r\n\t\t\tl = new ArrayList<Integer>();\r\n\t\t\th.put(key, l);\r\n\t\t}\r\n\t\tl.add(line);\r\n\t}", "public void addHardwareDeviceToRent()\n {\n try\n {\n String Description=rentDescriptiontxt.getText();\n String Manufacturer=rentManufacturertxt.getText();\n \n int downPayment=Integer.parseInt(downPaymenttxt.getText());\n int dailyRate=Integer.parseInt(dailyRatetxt.getText());\n \n HardwareDeviceToRent HardwareToRent=new HardwareDeviceToRent( Description, Manufacturer, downPayment, dailyRate);\n equipment.add(HardwareToRent);\n \n JOptionPane.showMessageDialog(frame, \"Successfully added GeneratorToRent\",\"Information\", JOptionPane.INFORMATION_MESSAGE);\n }\n catch(NumberFormatException aE)\n {\n JOptionPane.showMessageDialog(frame, aE.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n }\n }", "@Override\r\n\tpublic ListView initListView() {\n\t orderListView = new OrderListView(\"orderListView\",modelMap);\r\n\t orderListView.showQuery(false);\r\n\t orderListView.setMultiSelect(true);\r\n\t orderListView.setViewEditMode(GaConstant.EDITMODE_DISP);\r\n//\t storeOrderListView.getFieldList().remove(20);\r\n//\t storeOrderListView.getFieldList().remove(19);\r\n//\t storeOrderListView.getFieldList().remove(18);\r\n//\t storeOrderListView.getFieldList().remove(17); \r\n\t \r\n//\t ActionButton action = new ActionButton(this.getClass(),\"settle\",\"结算\",this.getSelfUrl(),null);\r\n// action.bindTableMultiSelect(this.storeOrderListView.getViewID());\r\n// SubmitTool.submitMvc(action,this.modelMap.getPreNavInfoStr());\r\n// PageEvent event = this.regPageEvent(action,\"settle\");\r\n// event.addEventRequestParam(this.storeOrderListView,GaConstant.FIXPARAM_MULTISELECT);\r\n// this.storeOrderListView.regAction(action);\r\n \r\n\t\treturn orderListView;\r\n\t}", "public void addData(View view) {\n int numCompanies = companies.length;\n TableLayout tl = view.findViewById(R.id.tableLayout);\n Log.d(\"TableViewFragment\", \"addData() invoked\");\n for (int i = 0; i < numCompanies; i++) {\n Log.d(\"TableViewFragment\", \"addData()\" + (i));\n TableRow tr = new TableRow(getContext());\n tr.setLayoutParams(getLayoutParams());\n tr.addView(getTextView(i + 1, companies[i], Color.WHITE, Typeface.NORMAL, ContextCompat.getColor(getContext(), R.color.colorAccent)));\n tr.addView(getTextView(i + numCompanies, os[i], Color.WHITE, Typeface.NORMAL, ContextCompat.getColor(getContext(), R.color.colorAccent)));\n tl.addView(tr, getTblLayoutParams());\n }\n }", "private void inicializaListView(){\n }", "public abstract void addItems(IconButtonRow iconButtonRow);", "public void bindView(android.view.View r16, android.content.Context r17, android.database.Cursor r18) {\n /*\n r15 = this;\n java.lang.Object r2 = r16.getTag()\n r11 = r2\n com.pccw.mobile.sip.AddCallCallLogFragment$CallLogItemViews r11 = (com.pccw.mobile.sip.AddCallCallLogFragment.CallLogItemViews) r11\n r2 = 1\n r0 = r18\n java.lang.String r2 = r0.getString(r2)\n if (r2 == 0) goto L_0x00d3\n r2 = 1\n r0 = r18\n java.lang.String r3 = r0.getString(r2)\n L_0x0017:\n r9 = 0\n r2 = 5\n r0 = r18\n java.lang.String r5 = r0.getString(r2)\n r2 = 6\n r0 = r18\n int r6 = r0.getInt(r2)\n r2 = 7\n r0 = r18\n java.lang.String r7 = r0.getString(r2)\n java.util.HashMap<java.lang.String, com.pccw.mobile.sip.AddCallCallLogFragment$ContactInfo> r2 = r15.contactHashMap\n java.lang.Object r2 = r2.get(r3)\n r8 = r2\n com.pccw.mobile.sip.AddCallCallLogFragment$ContactInfo r8 = (com.pccw.mobile.sip.AddCallCallLogFragment.ContactInfo) r8\n if (r8 != 0) goto L_0x00d7\n com.pccw.mobile.sip.AddCallCallLogFragment$ContactInfo r8 = com.pccw.mobile.sip.AddCallCallLogFragment.ContactInfo.EMPTY\n java.util.HashMap<java.lang.String, com.pccw.mobile.sip.AddCallCallLogFragment$ContactInfo> r2 = r15.contactHashMap\n r2.put(r3, r8)\n int r4 = r18.getPosition()\n r2 = r15\n r2.enqueueRequest(r3, r4, r5, r6, r7)\n L_0x0047:\n r2 = r9\n L_0x0048:\n java.lang.String r9 = r8.name\n int r4 = r8.type\n java.lang.String r10 = r8.label\n long r12 = r8.personId\n boolean r14 = android.text.TextUtils.isEmpty(r9)\n if (r14 == 0) goto L_0x0227\n boolean r14 = android.text.TextUtils.isEmpty(r5)\n if (r14 != 0) goto L_0x0227\n com.pccw.mobile.sip.AddCallCallLogFragment r2 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n java.lang.String r2 = r2.formatPhoneNumber(r3)\n L_0x0062:\n java.lang.String r4 = \"-2\"\n boolean r4 = r3.equals(r4)\n if (r4 == 0) goto L_0x0109\n com.pccw.mobile.sip.AddCallCallLogFragment r2 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n r4 = 2131165670(0x7f0701e6, float:1.7945564E38)\n java.lang.String r2 = r2.getString(r4)\n android.widget.TextView r4 = r11.line1View\n r4.setText(r2)\n android.widget.TextView r2 = r11.labelView\n r4 = 8\n r2.setVisibility(r4)\n android.widget.TextView r2 = r11.numberView\n r4 = 0\n r2.setVisibility(r4)\n android.widget.TextView r2 = r11.numberView\n java.lang.String r4 = \"\"\n r2.setText(r4)\n android.widget.ImageView r2 = r11.photoView\n r4 = 2130837710(0x7f0200ce, float:1.7280382E38)\n r2.setImageResource(r4)\n L_0x0094:\n com.pccw.mobile.sip.AddCallCallLogFragment r2 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n int r2 = r2.currentQuery\n switch(r2) {\n case 0: goto L_0x01ed;\n default: goto L_0x009d;\n }\n L_0x009d:\n r2 = 2\n r0 = r18\n long r4 = r0.getLong(r2)\n long r6 = java.lang.System.currentTimeMillis()\n r8 = 60000(0xea60, double:2.9644E-319)\n r10 = 262144(0x40000, float:3.67342E-40)\n r3 = r17\n java.lang.CharSequence r2 = com.pccw.mobile.sip.util.RelativeDateUtils.getRelativeTimeSpanString(r3, r4, r6, r8, r10)\n android.widget.TextView r3 = r11.dateView\n r3.setText(r2)\n r2 = 4\n r0 = r18\n int r2 = r0.getInt(r2)\n switch(r2) {\n case 1: goto L_0x0213;\n case 2: goto L_0x0209;\n case 3: goto L_0x01ff;\n case 21: goto L_0x021d;\n default: goto L_0x00c2;\n }\n L_0x00c2:\n android.view.ViewTreeObserver$OnPreDrawListener r2 = r15.mPreDrawListener\n if (r2 != 0) goto L_0x00d2\n r2 = 1\n r15.mFirst = r2\n r15.mPreDrawListener = r15\n android.view.ViewTreeObserver r2 = r16.getViewTreeObserver()\n r2.addOnPreDrawListener(r15)\n L_0x00d2:\n return\n L_0x00d3:\n java.lang.String r3 = \"-1\"\n goto L_0x0017\n L_0x00d7:\n com.pccw.mobile.sip.AddCallCallLogFragment$ContactInfo r2 = com.pccw.mobile.sip.AddCallCallLogFragment.ContactInfo.EMPTY\n if (r8 == r2) goto L_0x0047\n java.lang.String r2 = r8.name\n boolean r2 = android.text.TextUtils.equals(r2, r5)\n if (r2 == 0) goto L_0x00ef\n int r2 = r8.type\n if (r2 != r6) goto L_0x00ef\n java.lang.String r2 = r8.label\n boolean r2 = android.text.TextUtils.equals(r2, r7)\n if (r2 != 0) goto L_0x00f7\n L_0x00ef:\n int r4 = r18.getPosition()\n r2 = r15\n r2.enqueueRequest(r3, r4, r5, r6, r7)\n L_0x00f7:\n java.lang.String r2 = r8.formattedNumber\n if (r2 != 0) goto L_0x0105\n com.pccw.mobile.sip.AddCallCallLogFragment r2 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n java.lang.String r4 = r8.number\n java.lang.String r2 = r2.formatPhoneNumber(r4)\n r8.formattedNumber = r2\n L_0x0105:\n java.lang.String r2 = r8.formattedNumber\n goto L_0x0048\n L_0x0109:\n java.lang.String r4 = \"-1\"\n boolean r4 = r3.equals(r4)\n if (r4 == 0) goto L_0x013d\n com.pccw.mobile.sip.AddCallCallLogFragment r2 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n r4 = 2131165739(0x7f07022b, float:1.7945704E38)\n java.lang.String r2 = r2.getString(r4)\n android.widget.TextView r4 = r11.line1View\n r4.setText(r2)\n android.widget.TextView r2 = r11.labelView\n r4 = 8\n r2.setVisibility(r4)\n android.widget.TextView r2 = r11.numberView\n r4 = 0\n r2.setVisibility(r4)\n android.widget.TextView r2 = r11.numberView\n java.lang.String r4 = \"\"\n r2.setText(r4)\n android.widget.ImageView r2 = r11.photoView\n r4 = 2130837710(0x7f0200ce, float:1.7280382E38)\n r2.setImageResource(r4)\n goto L_0x0094\n L_0x013d:\n boolean r4 = android.text.TextUtils.isEmpty(r5)\n if (r4 != 0) goto L_0x01a0\n android.widget.TextView r4 = r11.line1View\n r4.setText(r5)\n android.widget.TextView r4 = r11.labelView\n r5 = 0\n r4.setVisibility(r5)\n java.lang.String r4 = r8.thumbnailUri\n java.lang.String r5 = java.lang.Long.toString(r12)\n java.lang.String r8 = com.pccw.sms.service.PhoneListService.normalizeContactNumber(r3)\n android.graphics.Bitmap r4 = r15.getUserContactPhoto(r4, r5, r8)\n if (r4 == 0) goto L_0x0183\n android.widget.ImageView r5 = r11.photoView\n r5.setImageBitmap(r4)\n L_0x0163:\n if (r6 != 0) goto L_0x018c\n L_0x0165:\n android.widget.TextView r4 = r11.numberView\n r5 = 0\n r4.setVisibility(r5)\n android.widget.TextView r4 = r11.numberView\n r4.setText(r2)\n boolean r2 = android.text.TextUtils.isEmpty(r7)\n if (r2 != 0) goto L_0x0197\n android.widget.TextView r2 = r11.labelView\n r2.setText(r7)\n android.widget.TextView r2 = r11.labelView\n r4 = 0\n r2.setVisibility(r4)\n goto L_0x0094\n L_0x0183:\n android.widget.ImageView r4 = r11.photoView\n r5 = 2130837710(0x7f0200ce, float:1.7280382E38)\n r4.setImageResource(r5)\n goto L_0x0163\n L_0x018c:\n com.pccw.mobile.sip.AddCallCallLogFragment r4 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n int r5 = android.provider.ContactsContract.CommonDataKinds.Phone.getTypeLabelResource(r6)\n java.lang.String r7 = r4.getString(r5)\n goto L_0x0165\n L_0x0197:\n android.widget.TextView r2 = r11.labelView\n r4 = 8\n r2.setVisibility(r4)\n goto L_0x0094\n L_0x01a0:\n java.lang.String r2 = \"-1\"\n boolean r2 = r3.equals(r2)\n if (r2 == 0) goto L_0x01d4\n com.pccw.mobile.sip.AddCallCallLogFragment r2 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n r4 = 2131165739(0x7f07022b, float:1.7945704E38)\n java.lang.String r2 = r2.getString(r4)\n L_0x01b1:\n android.widget.TextView r4 = r11.line1View\n r4.setText(r2)\n android.widget.TextView r2 = r11.labelView\n r4 = 8\n r2.setVisibility(r4)\n android.widget.TextView r2 = r11.numberView\n r4 = 0\n r2.setVisibility(r4)\n android.widget.TextView r2 = r11.numberView\n java.lang.String r4 = \"\"\n r2.setText(r4)\n android.widget.ImageView r2 = r11.photoView\n r4 = 2130837710(0x7f0200ce, float:1.7280382E38)\n r2.setImageResource(r4)\n goto L_0x0094\n L_0x01d4:\n java.lang.String r2 = \"-2\"\n boolean r2 = r3.equals(r2)\n if (r2 == 0) goto L_0x01e6\n com.pccw.mobile.sip.AddCallCallLogFragment r2 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n r4 = 2131165670(0x7f0701e6, float:1.7945564E38)\n java.lang.String r2 = r2.getString(r4)\n goto L_0x01b1\n L_0x01e6:\n com.pccw.mobile.sip.AddCallCallLogFragment r2 = com.pccw.mobile.sip.AddCallCallLogFragment.this\n java.lang.String r2 = r2.formatPhoneNumber(r3)\n goto L_0x01b1\n L_0x01ed:\n android.view.View r2 = r11.unreadMsgLayout\n r4 = 4\n r2.setVisibility(r4)\n com.pccw.mobile.sip.AddCallCallLogFragment$CallLogAdapter$2 r2 = new com.pccw.mobile.sip.AddCallCallLogFragment$CallLogAdapter$2\n r2.<init>(r3)\n r0 = r16\n r0.setOnClickListener(r2)\n goto L_0x009d\n L_0x01ff:\n android.widget.ImageView r2 = r11.calltypeimageView\n r3 = 2130838591(0x7f02043f, float:1.7282169E38)\n r2.setImageResource(r3)\n goto L_0x00c2\n L_0x0209:\n android.widget.ImageView r2 = r11.calltypeimageView\n r3 = 2130838600(0x7f020448, float:1.7282187E38)\n r2.setImageResource(r3)\n goto L_0x00c2\n L_0x0213:\n android.widget.ImageView r2 = r11.calltypeimageView\n r3 = 2130838580(0x7f020434, float:1.7282146E38)\n r2.setImageResource(r3)\n goto L_0x00c2\n L_0x021d:\n android.widget.ImageView r2 = r11.calltypeimageView\n r3 = 2130838590(0x7f02043e, float:1.7282167E38)\n r2.setImageResource(r3)\n goto L_0x00c2\n L_0x0227:\n r6 = r4\n r5 = r9\n r7 = r10\n goto L_0x0062\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.pccw.mobile.sip.AddCallCallLogFragment.CallLogAdapter.bindView(android.view.View, android.content.Context, android.database.Cursor):void\");\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n \n /* Get the incoming data from the calling activity */\n String itemKey = getIntent().getStringExtra(\"com.gimranov.zandy.client.itemKey\");\n item = Item.load(itemKey);\n \n // When an item in the view has been updated via a sync, the temporary key may have\n // been swapped out, so we fall back on the DB ID\n if (item == null) {\n String itemDbId = getIntent().getStringExtra(\"com.gimranov.zandy.client.itemDbId\");\n \titem = Item.loadDbId(itemDbId);\n }\n \t\n // Set the activity title to the current item's title, if the title works\n if (item.getTitle() != null && !item.getTitle().equals(\"\"))\n \tthis.setTitle(item.getTitle());\n else\n \tthis.setTitle(\"Item Data\");\n \n ArrayList<Bundle> rows = item.toBundleArray();\n \n /* \n * We use the standard ArrayAdapter, passing in our data as a Bundle.\n * Since it's no longer a simple TextView, we need to override getView, but\n * we can do that anonymously.\n */\n setListAdapter(new ArrayAdapter<Bundle>(this, R.layout.list_data, rows) {\n \t@Override\n \tpublic View getView(int position, View convertView, ViewGroup parent) {\n \t\tView row;\n \t\t\n // We are reusing views, but we need to initialize it if null\n \t\tif (null == convertView) {\n LayoutInflater inflater = getLayoutInflater();\n \t\t\trow = inflater.inflate(R.layout.list_data, null);\n \t\t} else {\n \t\t\trow = convertView;\n \t\t}\n \n \t\t/* Our layout has just two fields */\n \t\tTextView tvLabel = (TextView) row.findViewById(R.id.data_label);\n \t\tTextView tvContent = (TextView) row.findViewById(R.id.data_content);\n \t\t\n \t \t/* Since the field names are the API / internal form, we\n \t \t * attempt to get a localized, human-readable version. */\n \t\ttvLabel.setText(Item.localizedStringForString(\n \t\t\t\t\tgetItem(position).getString(\"label\")));\n \t\t\n \t\tString content = getItem(position).getString(\"content\");\n \t\t\n \t\ttvContent.setText(content);\n \n \t\treturn row;\n \t}\n });\n \n ListView lv = getListView();\n lv.setTextFilterEnabled(true);\n lv.setOnItemClickListener(new OnItemClickListener() {\n \t// Warning here because Eclipse can't tell whether my ArrayAdapter is\n \t// being used with the correct parametrization.\n \t@SuppressWarnings(\"unchecked\")\n \t\t\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n \t\t\t// If we have a click on an entry, do something...\n \t\tArrayAdapter<Bundle> adapter = (ArrayAdapter<Bundle>) parent.getAdapter();\n \t\tBundle row = adapter.getItem(position);\n \t\tif (row.getString(\"label\").equals(\"url\")) {\n \t\t\trow.putString(\"url\", row.getString(\"content\"));\n \t\t\tremoveDialog(DIALOG_CONFIRM_NAVIGATE);\n \t\t\tshowDialog(DIALOG_CONFIRM_NAVIGATE, row);\n \t\t\treturn;\n \t\t} else if (row.getString(\"label\").equals(\"DOI\")) {\n \t\t\tString url = \"http://dx.doi.org/\"+Uri.encode(row.getString(\"content\"));\n \t\t\trow.putString(\"url\", url);\n \t\t\tremoveDialog(DIALOG_CONFIRM_NAVIGATE);\n \t\t\tshowDialog(DIALOG_CONFIRM_NAVIGATE, row);\n \t\t\treturn;\n \t\t} else if (row.getString(\"label\").equals(\"creators\")) {\n \t \tLog.d(TAG, \"Trying to start creators activity\");\n \t \tIntent i = new Intent(getBaseContext(), CreatorActivity.class);\n \t\t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \tstartActivity(i);\n \t \treturn;\n \t\t} else if (row.getString(\"label\").equals(\"tags\")) {\n \t \tLog.d(TAG, \"Trying to start tag activity\");\n \t \tIntent i = new Intent(getBaseContext(), TagActivity.class);\n \t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \tstartActivity(i);\n \t\t\treturn;\n \t \t\t} else if (row.getString(\"label\").equals(\"children\")) {\n \t \t \tLog.d(TAG, \"Trying to start attachment activity\");\n \t \t \tIntent i = new Intent(getBaseContext(), AttachmentActivity.class);\n \t \t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \t \tstartActivity(i);\n \t \t\t\treturn;\n \t \t\t}\n \t\t\n \t\t\t\tToast.makeText(getApplicationContext(), row.getString(\"content\"), \n \t\t\t\tToast.LENGTH_SHORT).show();\n \t}\n });\n \n /*\n * On long click, we bring up an edit dialog.\n */\n lv.setOnItemLongClickListener(new OnItemLongClickListener() {\n \t/*\n \t * Same annotation as in onItemClick(..), above.\n \t */\n \t@SuppressWarnings(\"unchecked\")\n \t\t\tpublic boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {\n \t\t\t// If we have a long click on an entry, we'll provide a way of editing it\n \t\tArrayAdapter<Bundle> adapter = (ArrayAdapter<Bundle>) parent.getAdapter();\n \t\tBundle row = adapter.getItem(position);\n \t\t// Show the right type of dialog for the row in question\n \t\tif (row.getString(\"label\").equals(\"itemType\")) {\n \t\t\t// XXX \n \tToast.makeText(getApplicationContext(), \"Item type cannot be changed.\", \n \t\t\t\tToast.LENGTH_SHORT).show();\n \t\t\t//removeDialog(DIALOG_ITEM_TYPE);\n \t\t\t//showDialog(DIALOG_ITEM_TYPE, row);\n \t\t\treturn true;\n \t\t} else if (row.getString(\"label\").equals(\"children\")) {\n \t \tLog.d(TAG, \"Not starting children activity on click-and-hold\");\n \t \treturn true;\n \t\t} else if (row.getString(\"label\").equals(\"creators\")) {\n \t \tLog.d(TAG, \"Trying to start creators activity\");\n \t \tIntent i = new Intent(getBaseContext(), CreatorActivity.class);\n \t\t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \tstartActivity(i);\n \t \treturn true;\n \t\t} else if (row.getString(\"label\").equals(\"tags\")) {\n \t \tLog.d(TAG, \"Trying to start tag activity\");\n \t \tIntent i = new Intent(getBaseContext(), TagActivity.class);\n \t \ti.putExtra(\"com.gimranov.zandy.client.itemKey\", item.getKey());\n \t \tstartActivity(i);\n \t\t\treturn true;\n \t\t}\n \t\t\tremoveDialog(DIALOG_SINGLE_VALUE);\n \t\tshowDialog(DIALOG_SINGLE_VALUE, row);\n \t\treturn true;\n }\n });\n \n }", "public void onclick_add(MouseEvent mouseEvent) {\n\t\tUifEditCmd cmd = new UifEditCmd(\"ssoView\",DialogConstant.DEFAULT_WIDTH, DialogConstant.SIX_ELE_HEIGHT);\n\t\tAppLifeCycleContext.current().getWindowContext().addAppAttribute(\"operate\", \"add\");\n\t\tcmd.execute();\n//\t\tRow row = ds.getEmptyRow();\n//\t\tds.addRow(row);\n//\t\tds.setRowSelectIndex(ds.getRowIndex(row));\n//\t\tds.setEnabled(true);\n//\t\tnew UifUpdateOperatorState(ds, AppLifeCycleContext.current().getViewContext().getView()).execute();\n\t}", "private void registerListClicks(){\n //Gets list element\n ListView list = findViewById(R.id.transaction_list);\n //Sets onclick listener\n list.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n //Gets the relevant view\n TextView text = (TextView) view;\n //Saves the name of the recipient\n chosenName = (String) text.getText();\n //Checks if the button should be enabled\n checkIfEnable();\n }\n });\n }", "private void addNewSpinnerItem7() \n\t{\n\t\tmscust=ecust.getText().toString();\n\t\tCharSequence textHolder = \"\" +mscust; \n\t\tadapterpaw.insert(textHolder, 0);\n\t\tspaw.setAdapter(adapterpaw);\n\t}", "public void addRow(ResultSetRow row) throws SQLException {\n/* 231 */ notSupported();\n/* */ }", "public final void addToWatchList(long j) {\n AuctionSalesListActivity auctionSalesListActivity2 = this.auctionSalesListActivity;\n if (auctionSalesListActivity2 == null) {\n Intrinsics.throwUninitializedPropertyAccessException(\"auctionSalesListActivity\");\n }\n Application application = auctionSalesListActivity2.getApplication();\n Intrinsics.checkExpressionValueIsNotNull(application, \"auctionSalesListActivity.application\");\n String userIdPreferencesMVVM = IAASharedPreference.getUserIdPreferencesMVVM(application.getApplicationContext());\n Intrinsics.checkExpressionValueIsNotNull(userIdPreferencesMVVM, \"IAASharedPreference.getU…ation.applicationContext)\");\n this.userId = userIdPreferencesMVVM;\n String string = getResources().getString(C2723R.string.lbl_watch_action_add);\n Intrinsics.checkExpressionValueIsNotNull(string, \"resources.getString(R.string.lbl_watch_action_add)\");\n this.action = string;\n AuctionSalesListViewModel auctionSalesListViewModel = this.viewModel;\n if (auctionSalesListViewModel == null) {\n Intrinsics.throwUninitializedPropertyAccessException(\"viewModel\");\n }\n StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;\n Object[] objArr = new Object[2];\n SessionManager sessionManager2 = this.sessionManager;\n if (sessionManager2 == null) {\n Intrinsics.throwUninitializedPropertyAccessException(\"sessionManager\");\n }\n objArr[0] = sessionManager2.getCurrentSessionUsername();\n SessionManager sessionManager3 = this.sessionManager;\n if (sessionManager3 == null) {\n Intrinsics.throwUninitializedPropertyAccessException(\"sessionManager\");\n }\n objArr[1] = sessionManager3.getCurrentSessionPassword();\n String format = String.format(\"%s:%s\", Arrays.copyOf(objArr, objArr.length));\n Intrinsics.checkExpressionValueIsNotNull(format, \"java.lang.String.format(format, *args)\");\n auctionSalesListViewModel.updateWatchStatus(format, String.valueOf(j), this.userId, this.action);\n }", "public native String appendItem(String newItem);", "public void addRow(String rowName);", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tsetContentView(R.layout.appmanger);\n\t\ttv = (TextView) findViewById(R.id.app_tv);\n\t\ttvone = (TextView) findViewById(R.id.app_tvone);\n\t\ttvthree = (TextView) findViewById(R.id.app_tvthree);\n\t\tlistview = (ListView) findViewById(R.id.app_list);\n\t\tlayout = (RelativeLayout) findViewById(R.id.app_linear);\n\n\t\tadminData();\n\n\t\tlistview.setOnScrollListener(new OnScrollListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onScrollStateChanged(AbsListView view, int scrollState) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onScroll(AbsListView view, int firstVisibleItem,\n\t\t\t\t\tint visibleItemCount, int totalItemCount) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tdismissWindow();\n\t\t\t\tif (userapp != null && systemapp != null) {\n\t\t\t\t\ttvthree.setVisibility(View.VISIBLE);\n\t\t\t\t\tif (firstVisibleItem > userapp.size()) {\n\t\t\t\t\t\ttvthree.setText(\"系统程序\" + systemapp.size() + \"个\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttvthree.setText(\"用户程序\" + userapp.size() + \"个\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t\tlistview.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tdismissWindow();\n\t\t\t\t// 明确点击事件的位置\n\t\t\t\tif (position == 0 || position == userapp.size() + 1) {\n\t\t\t\t\treturn;\n\t\t\t\t} else if (position <= userapp.size()) {\n\t\t\t\t\tint newposition = position - 1;\n\t\t\t\t\tappinfo = userapp.get(newposition);\n\t\t\t\t} else {\n\t\t\t\t\tint newposition = position - userapp.size() - 1 - 1;\n\t\t\t\t\tappinfo = systemapp.get(newposition);\n\n\t\t\t\t}\n\t\t\t\tSystem.out.println(appinfo.getPackName());\n\t\t\t\tView vw = View.inflate(AppMangerActivity.this,\n\t\t\t\t\t\tR.layout.pop_laoout, null);\n\t\t\t\tlinear = (LinearLayout) vw.findViewById(R.id.pop_linear);\n\t\t\t\tlinearone = (LinearLayout) vw.findViewById(R.id.pop_linearone);\n\t\t\t\tlineartwo = (LinearLayout) vw.findViewById(R.id.pop_lineartwo);\n\t\t\t\tlinear.setOnClickListener(AppMangerActivity.this);\n\t\t\t\tlinearone.setOnClickListener(AppMangerActivity.this);\n\t\t\t\tlineartwo.setOnClickListener(AppMangerActivity.this);\n\t\t\t\t// -2表示窗体包裹内容\n\t\t\t\twindow = new PopupWindow(vw, -2, -2);\n\t\t\t\t// 动画效果的播放必须要求弹出窗体有背景颜色\n\t\t\t\twindow.setBackgroundDrawable(new ColorDrawable(\n\t\t\t\t\t\tColor.TRANSPARENT));\n\t\t\t\tint[] location = new int[2];\n\t\t\t\tview.getLocationInWindow(location);\n\t\t\t\tint dp = DensityUtil.dip2px(AppMangerActivity.this, 50);\n\t\t\t\twindow.showAtLocation(parent, Gravity.LEFT | Gravity.TOP, dp,\n\t\t\t\t\t\tlocation[1]);\n\t\t\t\tScaleAnimation scale = new ScaleAnimation(0.3f, 1.0f, 0.3f,\n\t\t\t\t\t\t1.0f, Animation.RELATIVE_TO_SELF, 0.5f,\n\t\t\t\t\t\tAnimation.RELATIVE_TO_SELF, 0.5f);\n\t\t\t\tscale.setDuration(300);\n\t\t\t\tAlphaAnimation alpha = new AlphaAnimation(0.3f, 1.0f);\n\t\t\t\talpha.setDuration(300);\n\t\t\t\tAnimationSet set = new AnimationSet(false);\n\t\t\t\tset.addAnimation(scale);\n\t\t\t\tset.addAnimation(alpha);\n\t\t\t\tvw.startAnimation(set);\n\n\t\t\t}\n\n\t\t});\n\n\t\tlong l = retriveRoom(Environment.getDataDirectory().getAbsolutePath());\n\t\tlong d = retriveRoom(Environment.getExternalStorageDirectory()\n\t\t\t\t.getAbsolutePath());\n\t\t// 格式化内存大小\n\t\tString ls = Formatter.formatFileSize(this, l);\n\t\ttv.setText(\"内存可用:\" + ls);\n\t\tString ld = Formatter.formatFileSize(this, d);\n\t\ttvone.setText(\"sd卡可用:\" + ld);\n\n\t}", "private void setItemClick() {\n\t\tcontactsListView.setOnTouchListener(new OnTouchListener() {\n\t\t\t@Override\n\t\t\tpublic boolean onTouch(View v, MotionEvent event) {\n\t\t\t\t// TODO Auto-generated method stub\n//\t\t\t\tcurrentPosition = event.getRawY();\n//\t\t\t\treturn false;\n\t\t switch (event.getAction()) {\n\t case MotionEvent.ACTION_UP:\n\t \tresetAddViewPadding(move_up);\n\t break;\n\t case MotionEvent.ACTION_DOWN:\n\t //mLastMotionY = y;\n\t \tcurrentPosition = event.getRawY();\n\t break;\n\t case MotionEvent.ACTION_MOVE:\n\t applyAddViewPadding(event);\n\t break;\n\t\t }\n\t\t return false;\n\t\t\t}\n\t\t private void applyAddViewPadding(MotionEvent ev) {\n\t\t // getHistorySize has been available since API 1\n\t\t int pointerCount = ev.getHistorySize();\n\t\t Log.d(\"zhengye\",\"ev.getHistorySize()=\"+ev.getHistorySize());\n\t\t if(pointerCount>=2){\n\t\t\t int startpointer = (int) ev.getHistoricalY(0);\n\t\t\t int endpointer = (int) ev.getHistoricalY(pointerCount-1);\n\t\t\t move_up=(startpointer-endpointer>=0?true:false);\n\t\t\t Log.d(\"zhengye\",\"startpointer====\"+startpointer);\n\t\t\t Log.d(\"zhengye\",\"endpointer====\"+endpointer);\n\t\t\t Log.d(\"zhengye\",\"move_up=\"+move_up);\n\t\t\t for (int p = 0; p < pointerCount; p++) {\n\t\t\t int historicalY = (int) ev.getHistoricalY(p);\t \n\t\t\t Log.d(\"xiangkang\",\"ev.getHistoricalY()=\"+ev.getHistoricalY(p));\n\t\t\t // Calculate the padding to apply, we divide by 1.7 to\n\t\t\t // simulate a more resistant effect during pull.\n\t\t\t int topPadding = (int) (((historicalY - currentPosition)\n\t\t\t - mRefreshViewHeight) / 2.7);\n\t\t\t int bottomPadding = (int) (((currentPosition - historicalY)\n\t\t\t - mRefreshViewHeight) / 2.7);\n\t\t\t if(move_up){\n\t\t\t \tmRefreshView.setPadding(\n\t\t\t \t\t\tmRefreshView.getPaddingLeft(),\n\t\t\t \t\t\tmRefreshView.getPaddingTop(),\n\t\t\t \t\t\tmRefreshView.getPaddingRight(),\n\t\t\t \t\t\tbottomPadding\n\t\t\t \t\t\t);\n\t\t\t }else{\n\t\t\t \tLog.d(\"zhengye\",\"topPadding=else------------\"+topPadding);\n\t\t\t \tmRefreshView.setPadding(\n\t\t\t \t\t\tmRefreshView.getPaddingLeft(),\n\t\t\t \t\t\ttopPadding,\n\t\t\t \t\t\tmRefreshView.getPaddingRight(),\n\t\t\t \t\t\tmRefreshView.getPaddingBottom()\n\t\t\t \t\t\t);\n\t\t\t }\n\t\t\t elasticTextv.setVisibility(View.VISIBLE);\n\t\t\t }\n\t\t }\n\t\t }\n\n\t\t});\n\t\tcontactsListView.setOnItemClickListener(new OnItemClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tcomposerButtonsWrapper = (ViewGroup) arg1\n\t\t\t\t\t\t.findViewById(R.id.composer_buttons_wrapper);\n\t\t\t\tcomposerButtonsShowHideButtonIcon = (ImageView) arg1\n\t\t\t\t\t\t.findViewById(R.id.composer_buttons_show_hide_button_icon);\n\t\t\t\t// composerButtonsShowHideButtonIcon = (RelativeLayout)\n\t\t\t\t// arg1.findViewById(R.id.composer_buttons_show_hide_button);\n\t\t\t\titem_root_layout = arg1.findViewById(R.id.item_layout);\n\t\t\t\titem_root_layout_params = (LayoutParams) item_root_layout\n\t\t\t\t\t\t.getLayoutParams();\n\t\t\t\talphabetButton.setVisibility(View.GONE);\n\t\t\t\titem_root_layout_params.height = (int) (arg1.getRootView()\n\t\t\t\t\t\t.getWidth() / 1.5);\n\t\t\t\titem_root_layout_params.width = arg1.getRootView().getWidth();\n\t\t\t\titem_root_layout.setLayoutParams(item_root_layout_params);\n\t\t\t\tint totle_width = arg1.getWidth();\n\t\t\t\tint popbtcount = composerButtonsWrapper.getChildCount();\n\t\t\t\tcomposerButtonsShowHideButtonIcon.setVisibility(View.VISIBLE);\n\t\t\t\t//因为加了一个heardview,所以listview的可点击item实际位置需要减一,也就是减去加上的headview所占的位置\n\t\t\t\tint section = indexer.getSectionForPosition(arg2-1);\n\t\t\t\tif ((arg2-1) == indexer.getPositionForSection(section)) {\n\t\t\t\t\ttitleLayout.setVisibility(View.GONE);\n\t\t\t\t\tcontactsListView.smoothScrollBy(arg1.getTop(), 500);\n\t\t\t\t} else {\n\t\t\t\t\t//titleLayout.setVisibility(View.GONE);\n\t\t\t\t\tcontactsListView.smoothScrollBy(arg1.getTop()-27, 500);\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < popbtcount; i++) {\n\t\t\t\t\tImageButton v = (ImageButton) composerButtonsWrapper\n\t\t\t\t\t\t\t.getChildAt(i);\n\t\t\t\t\tMarginLayoutParams popbt = (MarginLayoutParams) v\n\t\t\t\t\t\t\t.getLayoutParams();\n\t\t\t\t\tpopbt.width = popbt.height = totle_width / 7;\n\t\t\t\t\tv.setLayoutParams(popbt);\n\t\t\t\t\t// 计算popbt的半圆形分布位置\n\t\t\t\t\tfloat pi = 3.14f;\n\t\t\t\t\tfloat rootwidth = v.getRootView().getWidth();\n\t\t\t\t\tfloat r = rootwidth / 2 - 40;\n\t\t\t\t\tfloat initangle = (pi / 6);\n\t\t\t\t\tfloat increase_angle = initangle + i\n\t\t\t\t\t\t\t* ((pi - 2 * initangle) / (popbtcount - 1));\n\t\t\t\t\tpopbt.leftMargin = (int) (r - Math.cos(increase_angle) * r);\n\t\t\t\t\tpopbt.topMargin = (int) (Math.sin(increase_angle) * r);\n\t\t\t\t\tLog.d(\"popbtcount\",\"popbt.bottomMargin=\"+popbt.bottomMargin);\n\t\t\t\t\t\n\t\t\t\t\tv.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tPopBtSpecialEffect(v);\n\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\t\t\"composerButtonsWrapper=\" + v.getId(),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tComposerButtonAnimation.startAnimations(composerButtonsWrapper,\n\t\t\t\t\t\tInOutAnimation.Direction.IN);\n\t\t\t\tcomposerButtonsShowHideButtonIcon\n\t\t\t\t\t\t.startAnimation(rotateStoryAddButtonIn);\n\n\t\t\t\tcomposerButtonsShowHideButtonIcon.setFocusable(true);\n\t\t\t\tcomposerButtonsShowHideButtonIcon\n\t\t\t\t\t\t.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\t// 布局\n//\t\t\t\t\t\t\t\tMarginLayoutParams image_layout = (MarginLayoutParams) image\n//\t\t\t\t\t\t\t\t\t\t.getLayoutParams();\n//\t\t\t\t\t\t\t\timage_layout.topMargin = 1;\n//\t\t\t\t\t\t\t\timage.setLayoutParams(image_layout);\n//\t\t\t\t\t\t\t\tandroid.widget.RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(\n//\t\t\t\t\t\t\t\t\t\tLayoutParams.WRAP_CONTENT,\n//\t\t\t\t\t\t\t\t\t\tLayoutParams.WRAP_CONTENT);\n//\t\t\t\t\t\t\t\tparams.addRule(RelativeLayout.CENTER_HORIZONTAL);\n//\t\t\t\t\t\t\t\tparams.addRule(RelativeLayout.ALIGN_PARENT_TOP);\n//\t\t\t\t\t\t\t\tshow_hide_bt.setLayoutParams(params);\n\n\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\t\t\t\"composerButtonsShowHideButtonIcon---\",\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t\tcomposerButtonsShowHideButtonIcon\n\t\t\t\t\t\t\t\t\t\t.startAnimation(rotateStoryAddButtonOut);\n\t\t\t\t\t\t\t\tComposerButtonAnimation.startAnimations(\n\t\t\t\t\t\t\t\t\t\tcomposerButtonsWrapper,\n\t\t\t\t\t\t\t\t\t\tInOutAnimation.Direction.OUT);\n\t\t\t\t\t\t\t\tcomposerButtonsShowHideButtonIcon\n\t\t\t\t\t\t\t\t\t\t.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\titem_root_layout_params.height = LayoutParams.MATCH_PARENT;\n\t\t\t\t\t\t\t\titem_root_layout\n\t\t\t\t\t\t\t\t\t\t.setLayoutParams(item_root_layout_params);\n\t\t\t\t\t\t\t\talphabetButton.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\t\t//sork_layout.setVisibility(View.GONE);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t}\n\n\t\t});\n\n\t}", "private void initView(){\n\n btnBack = (ImageView)findViewById(R.id.btnBack);\n btnQuit = (ImageView)findViewById(R.id.btnQuit);\n btnQuit.setVisibility(View.GONE);\n\n title = (TextView)this.findViewById(R.id.title);\n title.setText(R.string.assetInquire);\n barCode = (EditText)findViewById(R.id.barCode);\n\n loadAssetData = (ListView)findViewById(R.id.loadAssetData);\n\n hs_ledger_hslist = (HorizontalScrollView)findViewById(R.id.hs_ledger_hslist);\n initListViewHead(R.id.tv_list_table_tvhead1, false, rowName[0]);\n initListViewHead(R.id.tv_list_table_tvhead2, false, rowName[1]);\n initListViewHead(R.id.tv_list_table_tvhead3, false, rowName[2]);\n initListViewHead(R.id.tv_list_table_tvhead4, false, rowName[3]);\n initListViewHead(R.id.tv_list_table_tvhead5, false, rowName[4]);\n\n lvx = (ListViewEx)findViewById(R.id.lv_table_lvLedgerList);\n\n lvx.inital(R.layout.list_table_inquire, row, new int[]{\n R.id.tv_list_table_tvhead1,\n R.id.tv_list_table_tvhead2,\n R.id.tv_list_table_tvhead3,\n R.id.tv_list_table_tvhead4,\n R.id.tv_list_table_tvhead5\n });\n\n if (barCodeStr!=null&&!barCodeStr.trim().equals(\"\")){\n barCode.setText(barCodeStr);\n selBarCode();\n }\n }", "protected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\t\t\n\t\tsetContentView(R.layout.track);\n\t\t\n\t\tTlist=new ArrayList<TrackReport>();\n\t\t\n\t\t\n\t\tButton btn = (Button) findViewById(R.id.GetOTP);\n\t td = (EditText) findViewById(R.id.EtRid);\n\t lv=(ListView)findViewById(R.id.listView1);\n\t \n\t adap=new ArrayAdapter<TrackReport>(this, android.R.layout.simple_list_item_1, Tlist);\n\t\t\n\t\t\n\t\tbtn.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tToast.makeText(TrackReportActivity.this, \"Track Report\", 2).show();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tTrackReport tr = (TrackReport)getIntent().getSerializableExtra(\"TrackReport\");\n//\t\t\t\tNGO ngo=(NGO)getIntent().getSerializableExtra(\"NGO\");\n\t\t\t\t\n\t\t\t\tString trid = td.getText().toString();\n\t\t\t\tLog.v(\"Referance ID : \", trid);\n\t\t\t\t//rid.setText(\"rid : \"+tr.getRid());\n\t\t\t\t\n\t\t\t\tif (trid.equals(\"\")) {\n\t\t\t\t\ttd.setError(\"Fill out this Field\");\n\t\t\t\t}else{\n\t\t\t\t\n\t\t\t\tString url=WebResources.TrackReport;\n\t\t\t\tString data =\"rid=\"+trid; \n\t\t\t\tLog.v(\"Base URL : \",url+\"?\"+data);\n\t\t\t\tGetTrackCaseid getTrack= new GetTrackCaseid();\n\t\t\t\tgetTrack.execute(url+\"?\"+data);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tcid.setText(\"cid : \"+ngo.getName());\n//\t\t\t\teddesc.setText(\"About : \"+ngo.getDesc());\n//\t\t\t\tedadd.setText(\"Address : \"+ngo.getAddress());\n//\t\t\t\tedlink.setText(\"Knew More : \"+ngo.getLink());\n\t\t\t}\n\t\t});\n\t}", "public void onLayout(boolean r10, int r11, int r12, int r13, int r14) {\n /*\n r9 = this;\n r6 = r13 - r11;\n r7 = r14 - r12;\n r0 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r0 = r0.listView;\n r0 = r0.getChildCount();\n r1 = 1;\n r8 = 0;\n r2 = -1;\n if (r0 <= 0) goto L_0x003f;\n L_0x0013:\n r0 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r0 = r0.listView;\n r3 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r3 = r3.listView;\n r3 = r3.getChildCount();\n r3 = r3 - r1;\n r0 = r0.getChildAt(r3);\n r3 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r3 = r3.listView;\n r3 = r3.findContainingViewHolder(r0);\n r3 = (org.telegram.p004ui.Components.RecyclerListView.Holder) r3;\n if (r3 == 0) goto L_0x003f;\n L_0x0036:\n r3 = r3.getAdapterPosition();\n r0 = r0.getTop();\n goto L_0x0041;\n L_0x003f:\n r0 = 0;\n r3 = -1;\n L_0x0041:\n if (r3 < 0) goto L_0x0051;\n L_0x0043:\n r4 = r9.lastHeight;\n r5 = r7 - r4;\n if (r5 == 0) goto L_0x0051;\n L_0x0049:\n r0 = r0 + r7;\n r0 = r0 - r4;\n r4 = r9.getPaddingTop();\n r0 = r0 - r4;\n goto L_0x0053;\n L_0x0051:\n r0 = 0;\n r3 = -1;\n L_0x0053:\n super.onLayout(r10, r11, r12, r13, r14);\n if (r3 == r2) goto L_0x0074;\n L_0x0058:\n r2 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r2.ignoreLayout = r1;\n r1 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r1 = r1.layoutManager;\n r1.scrollToPositionWithOffset(r3, r0);\n r1 = 0;\n r0 = r9;\n r2 = r11;\n r3 = r12;\n r4 = r13;\n r5 = r14;\n super.onLayout(r1, r2, r3, r4, r5);\n r0 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r0.ignoreLayout = r8;\n L_0x0074:\n r9.lastHeight = r7;\n r9.lastWidth = r6;\n r0 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r0.updateLayout();\n r0 = org.telegram.p004ui.Components.ChatAttachAlert.this;\n r0.checkCameraViewPosition();\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.telegram.p004ui.Components.ChatAttachAlert$C40922.onLayout(boolean, int, int, int, int):void\");\n }", "@Override\n public void handle(ActionEvent event) {\n String tf1 = txt.getText();\n String tf2 = txt1.getText();\n String tf3 = txt2.getText();\n String tf4 = txt3.getText();\n String Name = \"Compound Interest savings(Without Contributions)\";\n String hisres1 = tf1+\"\";\n String hisres2 = tf2+\"\";\n String hisres3 = tf3+\"\";\n String hisres4 = tf4+\"\";\n\n listView.getItems().addAll(Name,hisres1,hisres2,hisres3,hisres4,\"\\n\");\n listView.scrollTo(listView.getItems().size() - 1);\n }", "private void showListView() {\n Cursor data = mVehicleTypeDao.getData();\n // ArrayList<String> listData = new ArrayList<>();\n ArrayList<String> alVT_ID = new ArrayList<>();\n ArrayList<String> alVT_TYPE = new ArrayList<>();\n\n while (data.moveToNext()) {\n //get the value from the database in column 1\n //then add it to the ArrayList\n // listData.add(data.getString(6) + \" - \" + data.getString(1));\n alVT_ID.add(data.getString(0));\n alVT_TYPE.add(data.getString(1));\n\n\n }\n\n mListView = findViewById(R.id.listView);\n mListView.setAdapter(new ListVehicleTypeAdapter(this, alVT_ID, alVT_TYPE));\n\n //set an onItemClickListener to the ListView\n\n }", "@Override\n public void run() {\n\n // execute query and get result\n try {\n\n // set number of rows taken from MSSQL and show in list view\n int numberOFRowsToShow = 20;\n\n Statement statement = connectionMSSQL.createStatement();\n //ResultSet result = statement.executeQuery(\"SELECT indx WHERE userName='Jan.kowalski'\"); // query for indx,\n //ResultSet result = statement.executeQuery(\"SELECT indx,dateTime,description,picture FROM dbo.androidTest\"); // query to MS SQL for all rows\n ResultSet result = statement.executeQuery(\"SELECT TOP \" + numberOFRowsToShow + \" indx,dateTime,description,miniature FROM dbo.androidTest ORDER BY indx DESC\"); // query to MS SQL for last numberOFRowsToShow rows\n\n // put data to array\n for (int i = 0; i < numberOFRowsToShow; i++) { // number of rows to show - can be more than is in DB - won't be crash - olny thow exception\n result.next(); // start from next line - must be because first line has no data\n String indxFromResult = \"\" + result.getInt(\"indx\"); // take indx from MS SQL\n String dateTimeFromResult = result.getString(\"dateTime\"); // take dateTime from MS SQL\n String descriptionFromResult = result.getString(\"description\"); // take description from MS SQL\n\n // get picture miniature\n byte[] bArrayMiniatureTakenFromMSSQL = result.getBytes(\"miniature\"); // take picture miniature from MS SQL\n // set picture miniature\n Bitmap bitmapFromResultMiniature = null;\n if (bArrayMiniatureTakenFromMSSQL != null) {\n bitmapFromResultMiniature = BitmapFactory.decodeByteArray(bArrayMiniatureTakenFromMSSQL, 0, bArrayMiniatureTakenFromMSSQL.length); // byte[] into bitmap (miniature)\n }\n\n // add element to list view\n listOverView.add(new OverViewItem(bitmapFromResultMiniature, indxFromResult, dateTimeFromResult, descriptionFromResult));\n\n //result\n Log.d(TAG, \"getDataFromServer: RESULT: \" + \"indxFromResult: \" + indxFromResult + \", dateTimeFromResult: \" + dateTimeFromResult + \", descriptionFromResult: \" + descriptionFromResult + \", number of row: \" + i);\n\n Log.d(TAG, \"getDataFromServer: listOverView.size(): \" + listOverView.size());\n }\n\n } catch (SQLException e) { // cath when is set numberOFRowsToShow more than exist - can be - no crash\n Log.d(TAG, \"onCreate: SQLException: \" + e);\n }\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() { //in UI thread\n\n // reverse list if need\n //Collections.reverse(listOverView);\n\n // notyfi adapter\n adapterOverView.notifyDataSetChanged();\n\n // hide progress bar\n progressBarInOverViewWait.setVisibility(View.GONE);\n\n // change var for false if end getting data - can't start new request if old one is not finish\n isGetingDataFromMSSQL = false;\n }\n });\n }", "public void onClick(View v) {\n if (!tablet_type.trim().equalsIgnoreCase(\"\")) {\n if (tablet_type.equalsIgnoreCase(\"TAB\")) {\n AddListItem(1);\n\n } else if (tablet_type.equalsIgnoreCase(\"CAP\")) {\n AddListItem(2);\n } else if (tablet_type.equalsIgnoreCase(\"SYR\")) {\n AddListItemSyrup();\n\n } else if (tablet_type.equalsIgnoreCase(\"OINT\")) {\n AddListItemOINT();\n } else {\n AddListItem(1);\n }\n\n } else {\n AddListItem(1);\n\n }\n\n\n }", "int insert(QtActivitytype record);", "public void createItem(View view) {\n \t\n String[] temp = getCurrentItemTypes();\n \n Intent intent = new Intent(this, CreateItem.class);\n intent.putExtra(EDIT, \"no\");\n intent.putExtra(TYPES, temp);\n startActivityForResult(intent, 1);\n }", "public void AddRow(String Table, String Value)\r\n {\n }", "private void addNewSpinnerItem5() \n\t{\n\t\tmscust=ecust.getText().toString();\n\t\tCharSequence textHolder = \"\" +mscust; \n\t\tadapterorgw.insert(textHolder, 0);\n\t\tsorgw.setAdapter(adapterorgw);\n\t}", "public void updateListViewAndCount() {\n \t\n \t//updating the currentTaskItems then getting a array of the list\n \tListView items = (ListView)findViewById(R.id.showAttachedItems);\n \t\n \tArrayList<ItemListElement> item = formatOutputForList();\n \tItemListElement[] elm = new ItemListElement[item.size()];\n \titem.toArray(elm);\n \t\n \t//updating the list view\n \tItemListAdapter adapter = \n \t new ItemListAdapter(this, R.layout.list_multi, elm);\n items.setAdapter(adapter);\n \t\n \t//update the item count\n \tEditText num = (EditText)findViewById(R.id.showCurrentItemNum);\n \tint value = currentTaskItems.size();\n \tString val = Integer.toString(value);\n \tnum.setText(val);\t\n }", "private void createListView()\n {\n itens = new ArrayList<ItemListViewCarrossel>();\n ItemListViewCarrossel item1 = new ItemListViewCarrossel(\"Guilherme Biff\");\n ItemListViewCarrossel item2 = new ItemListViewCarrossel(\"Lucas Volgarini\");\n ItemListViewCarrossel item3 = new ItemListViewCarrossel(\"Eduardo Ricoldi\");\n\n\n ItemListViewCarrossel item4 = new ItemListViewCarrossel(\"Guilh\");\n ItemListViewCarrossel item5 = new ItemListViewCarrossel(\"Luc\");\n ItemListViewCarrossel item6 = new ItemListViewCarrossel(\"Edu\");\n ItemListViewCarrossel item7 = new ItemListViewCarrossel(\"Fe\");\n\n ItemListViewCarrossel item8 = new ItemListViewCarrossel(\"iff\");\n ItemListViewCarrossel item9 = new ItemListViewCarrossel(\"Lucini\");\n ItemListViewCarrossel item10 = new ItemListViewCarrossel(\"Educoldi\");\n ItemListViewCarrossel item11 = new ItemListViewCarrossel(\"Felgo\");\n\n itens.add(item1);\n itens.add(item2);\n itens.add(item3);\n itens.add(item4);\n\n itens.add(item5);\n itens.add(item6);\n itens.add(item7);\n itens.add(item8);\n\n itens.add(item9);\n itens.add(item10);\n itens.add(item11);\n\n //Cria o adapter\n adapterListView = new AdapterLsitView(this, itens);\n\n //Define o Adapter\n listView.setAdapter(adapterListView);\n //Cor quando a lista é selecionada para ralagem.\n listView.setCacheColorHint(Color.TRANSPARENT);\n }", "public final void mo27568c(int r6) {\n /*\n r5 = this;\n int r0 = com.qiyukf.nim.uikit.common.p424ui.listview.AutoRefreshListView.C5483c.f17667b\n r5.f17648e = r0\n int r0 = r5.f17650g\n int r1 = com.qiyukf.nim.uikit.common.p424ui.listview.AutoRefreshListView.C5481a.f17662a\n r2 = 1\n r3 = 0\n if (r0 != r1) goto L_0x0035\n int r0 = r5.getCount()\n int r1 = r5.getHeaderViewsCount()\n int r1 = r1 + r6\n int r4 = r5.getFooterViewsCount()\n int r1 = r1 + r4\n if (r0 != r1) goto L_0x002e\n r0 = 20\n if (r6 < r0) goto L_0x0022\n r0 = 1\n goto L_0x0023\n L_0x0022:\n r0 = 0\n L_0x0023:\n r5.f17651h = r0\n com.qiyukf.unicorn.api.YSFOptions r0 = com.qiyukf.unicorn.C6029d.m24045e()\n boolean r0 = r0.isDefaultLoadMsg\n if (r0 != 0) goto L_0x003b\n goto L_0x0032\n L_0x002e:\n if (r6 <= 0) goto L_0x0031\n goto L_0x0032\n L_0x0031:\n r2 = 0\n L_0x0032:\n r5.f17651h = r2\n goto L_0x003b\n L_0x0035:\n if (r6 <= 0) goto L_0x0038\n goto L_0x0039\n L_0x0038:\n r2 = 0\n L_0x0039:\n r5.f17652i = r2\n L_0x003b:\n r5.m22356b()\n int r0 = r5.f17650g\n int r1 = com.qiyukf.nim.uikit.common.p424ui.listview.AutoRefreshListView.C5481a.f17662a\n if (r0 != r1) goto L_0x0052\n int r0 = r5.getHeaderViewsCount()\n int r6 = r6 + r0\n boolean r0 = r5.f17651h\n if (r0 == 0) goto L_0x004f\n int r3 = r5.f17655l\n L_0x004f:\n r5.setSelectionFromTop(r6, r3)\n L_0x0052:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.qiyukf.nim.uikit.common.p424ui.listview.AutoRefreshListView.mo27568c(int):void\");\n }", "public long addItem(String locationName, String description, String address, String image, String favorites) {\n ContentValues values = new ContentValues();\n values.put(COL_LOCATION_NAME, locationName);\n values.put(COL_DESCRIPTION, description);\n values.put(COL_ADDRESS, address);\n values.put(COL_FAVORITES,favorites);\n values.put(COL_IMAGE, image);\n\n\n SQLiteDatabase db = this.getWritableDatabase();\n long returnId = db.insert(NEIGHBOURHOOD_TABLE_NAME, null, values);\n db.close();\n return returnId;\n }", "protected ListView<T> createSourceListView() {\n/* 436 */ return createListView();\n/* */ }", "private void addNewSpinnerItem4() \n\t{\n\t\tmscust=ecust.getText().toString();\n\t\tCharSequence textHolder = \"\" +mscust; \n\t\tadapterpah.insert(textHolder, 0);\n\t\tspah.setAdapter(adapterpah);\n\t}", "public void addSyncStatus(String added_on, int patient_nos, int visit_nos, String responseCode, String responseTime) {\n\n SQLiteDatabase db = null;\n try {\n db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n\n values.put(ADDED_ON, added_on);\n values.put(PATIENT_SEND, patient_nos);\n values.put(VISIT_SEND, visit_nos);\n values.put(RESPONSE_CODE, responseCode);\n values.put(RESPONSE_TIME, responseTime);\n\n // Inserting Row\n db.insert(TABLE_SYNC_STATUS, null, values);\n // Log.e(\"Valuesis\",\"\"+id);\n\n } catch (Exception e) {\n e.printStackTrace();\n } /*finally {\n if (db != null) {\n db.close();\n }\n }*/\n }", "public void addData(){\n Typeface mtypeFace = Typeface.createFromAsset(getAssets(),\n \"fonts/Lato-Regular.ttf\");\n if (dummy != 0) {\n dummy--;\n }\n int value = dummy;\n for (int i = value; i < repdataresponselist.size()&&i<(dummy+20); i++)\n\n {\nvalue++;\n /** Create a TableRow dynamically **/\n\n tr = new TableRow(this);\n /*if (i % 2 == 0) {*/\n/*\n } else {\n tr.setBackgroundResource(R.color.grey);\n\n }*/\n ReportsDataResponse reportdataobj=repdataresponselist.get(i);\n ArrayList<String> responsestrarr=new ArrayList<>();\n responsestrarr.add(reportdataobj.getBkRefid());\n\n responsestrarr.add(reportdataobj.getStatus());\n responsestrarr.add(reportdataobj.getSource());\n\n responsestrarr.add(reportdataobj.getBookingtype());\n\n responsestrarr.add(reportdataobj.getBookingdate());\n responsestrarr.add(reportdataobj.getPNR());\n responsestrarr.add(reportdataobj.getName());\n responsestrarr.add(reportdataobj.getAirline());\n responsestrarr.add(reportdataobj.getFrom());\n responsestrarr.add(reportdataobj.getTo());\n responsestrarr.add(reportdataobj.getClasstype());\n responsestrarr.add(reportdataobj.getTriptype());\n responsestrarr.add(reportdataobj.getTotalpax());\n responsestrarr.add(reportdataobj.getTotalfare());\n\n for (int j = 0; j < 14; j++) {\n\ntry {\n\n tr.setLayoutParams(new LayoutParams(\n\n LayoutParams.FILL_PARENT,\n\n LayoutParams.WRAP_CONTENT));\n\n /** Creating a TextView to add to the row **/\n companyTV = new TextView(this);\n\n\n\n\n companyTV.setText(responsestrarr.get(j));\n\n companyTV.setTextColor(Color.parseColor(\"#000000\"));\n\n companyTV.setTypeface(mtypeFace);\n\n companyTV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));\n\n if(j==1)\n {\n\n switch(responsestrarr.get(j)) {\n case \"Confirmed\":\n companyTV.setBackgroundColor(Color.parseColor(\"#fdba52\"));\n\n break;\n case \"Ticketed\":\n companyTV.setBackgroundColor(Color.parseColor(\"#b9eeb9\"));\n\n break;\n case \"Cancelled\":\n companyTV.setBackgroundColor(Color.parseColor(\"#f6bcbc\"));\n\n break;\n case \"Booking Started\":\n companyTV.setBackgroundColor(Color.parseColor(\"#e6c295\"));\n\n break;\n\n }\n }\n\n\n switch (j)\n {\n case 2:\n companyTV.setPadding(40, 30, 5, 30);\n break;\n case 3:\n companyTV.setPadding(50, 30, 5, 30);\n break;\n case 7:\n companyTV.setPadding(40, 30, 5, 30);\n break;\n case 8:\n companyTV.setPadding(25, 30, 5, 30);\n break;\n case 12:\n companyTV.setPadding(70, 30, 5, 30);\n break;\n case 13:\n companyTV.setPadding(40, 30, 5, 30);\n break;\n\n /* case 11:\n companyTV.setPadding(40, 30, 5, 30);\n break;\n case 12:\n companyTV.setPadding(40, 30, 5, 30);\n break;*/\n default:\n companyTV.setPadding(20, 30, 5, 30);\n\n break;\n\n\n\n\n\n\n\n }\n\n\n tr.addView(companyTV); // Adding textView to tablerow.\n\n tl.addView(tr, new TableLayout.LayoutParams(\n\n LayoutParams.FILL_PARENT,\n\n LayoutParams.WRAP_CONTENT));\n}\ncatch (Exception e)\n{\n e.printStackTrace();\n}\n\n\n }\n\n }\n dummy=value;\ntabledata=getHtmlData();\n\n }", "public boolean performItemClick(android.view.View r1, int r2, long r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e3 in method: android.widget.ColorListView.performItemClick(android.view.View, int, long):boolean, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.widget.ColorListView.performItemClick(android.view.View, int, long):boolean\");\n }", "public long insertListApp(int id,String listApp,byte[]image) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n // `id` and `timestamp` will be inserted automatically.\n // no need to add them\n values.put(ListApp.COLUMN_ID,id);\n values.put(ListApp.COLUMN_NAME, listApp);\n values.put(ListApp.COLUMN_IMAGE,image);\n // insert row\n long listInsert = db.insert(ListApp.TABLE_NAME, null, values);\n\n // close db connection\n db.close();\n\n // return newly inserted row id\n return listInsert;\n }", "@Test\n\tpublic void testAddItem() {\n\t\tassertEquals(\"testAddItem(LongTermTest): valid enter failure\", 0, ltsTest.addItem(item4, 10)); //can enter\n\t\tassertEquals(\"testAddItem(LongTermTest): invalid available capacity after adding\", 900, ltsTest.getAvailableCapacity());\n\t\tassertEquals(\"testAddItem(LongTermTest): invalid item count after adding\", 10, ltsTest.getItemCount(item4.getType()));\n\n\t\tassertEquals(\"testAddItem(LongTermTest): invalid enter failure\", -1, ltsTest.addItem(item4, 100)); // can't enter\n\t\tassertEquals(\"testAddItem(LongTermTest): invalid available capacity after adding\", 900, ltsTest.getAvailableCapacity());\n\t\tassertEquals(\"testAddItem(LongTermTest): invalid item count after adding\", 10, ltsTest.getItemCount(item4.getType()));\n\t}", "public AddItem() {\n initComponents();\n loadAllToTable();\n tblItems.getSelectionModel().addListSelectionListener(new ListSelectionListener() {\n @Override\n public void valueChanged(ListSelectionEvent e) {\n if (tblItems.getSelectedRow() == -1) return;\n \n String itemId= tblItems.getValueAt(tblItems.getSelectedRow(), 0).toString();\n \n String des= tblItems.getValueAt(tblItems.getSelectedRow(), 1).toString();\n String qty= tblItems.getValueAt(tblItems.getSelectedRow(), 2).toString();\n String unitPrice= tblItems.getValueAt(tblItems.getSelectedRow(), 3).toString();\n \n txtItemCode.setText(itemId);\n txtDescription.setText(des);\n \n txtQtyOnHand.setText(qty);\n txtUnitPrice.setText(unitPrice);\n \n }\n \n });\n \n \n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.cursor_main);\n\n String[] cols = { \"name\" };\n int[] ids = { R.id.text };\n adapter = new MAdapter(this,\n R.layout.list_item_click_remove, null, cols, ids, 0);\n\n DragSortListView dslv = (DragSortListView) findViewById(android.R.id.list);\n dslv.setAdapter(adapter);\n\n // build a cursor from the String array\n MatrixCursor cursor = new MatrixCursor(new String[] { \"_id\", \"name\" });\n String[] artistNames = getResources().getStringArray(R.array.jazz_artist_names);\n for (int i = 0; i < artistNames.length; i++) {\n cursor.newRow()\n .add(i)\n .add(artistNames[i]);\n }\n adapter.changeCursor(cursor);\n }", "public void addItem(LayoutElementParcelable e) {\n if (mainFrag.IS_LIST && itemsDigested.size() > 0) {\n itemsDigested.add(itemsDigested.size() - 1, new ListItem(e));\n } else if (mainFrag.IS_LIST) {\n itemsDigested.add(new ListItem(e));\n itemsDigested.add(new ListItem(EMPTY_LAST_ITEM));\n } else {\n itemsDigested.add(new ListItem(e));\n }\n\n notifyItemInserted(getItemCount());\n }", "private ArrayList<ListItem> addAdvertisement(ArrayList<ListItem> listItems, ArrayList<RealEstate> realEstateList) {\n Advertisement advert = new Advertisement();\n advert.setTitle(\"\\uD83D\\uDCB8 \\uD83D\\uDCB8 Buy stuff \\uD83D\\uDCB8 \\uD83D\\uDCB8\");\n\n for(int i=0; i<realEstateList.size(); i++) {\n // Every 3rd position in the list\n if(i != 0 && i%2 == 0) {\n listItems.add(advert);\n }\n listItems.add(realEstateList.get(i));\n }\n\n return listItems;\n }", "public native static void jniaddPath(int[] path, float reservation) throws AddDBException;", "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetTitle(\"Phone Book\"); \r\n\t\tsetContentView(R.layout.main3);\r\n\t\t Button b1=(Button) findViewById(R.id.b);\r\n\t b1.setOnClickListener(new View.OnClickListener() {\r\n\t\t\t\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tIntent i=new Intent(View_Contacts1.this,New_contact.class);\r\n\t\t\t\tstartActivity(i);\r\n\t\t\t\tfinish();\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t \r\n\t //get all contacts//\r\n\t db.open();\r\n\t Cursor c=db.getallcontacts();\r\n\t \r\n\t \r\n\t if(c.moveToFirst())\r\n\t {\r\n\t \tdo\r\n\t \t{\r\n\t \t\tHashMap<String,String> temp = new HashMap<String,String>();\t\r\n\t \t\tString name=c.getString(c.getColumnIndex(\"name\"));\r\n\t \t\tString ph_no=c.getString(c.getColumnIndex(\"ph_no\"));\r\n\t \t\tString pu_Id=c.getString(c.getColumnIndex(\"_id\"));\r\n\t \t\ttemp.put(\"name\", name);\r\n\t \t\ttemp.put(\"phone\", ph_no);\r\n\t \t\ttemp.put(\"puId\", pu_Id);\r\n\t \t\tlist.add(temp);\t\r\n\t \t\t\r\n\t \t\t\r\n\t \t}while(c.moveToNext());\r\n\t \tLog.d(\"event\", \"aks2\");\r\n\t }\r\n\t c.close();\r\n\t db.close();\r\n\r\n\t \r\n\t SimpleAdapter adapter = new SimpleAdapter(\r\n\t \t\tthis,\r\n\t \t\tlist,\r\n\t \t\tR.layout.phonebook_row,\r\n\t \t\tnew String[] {\"name\",\"phone\",\"puId\"},\r\n\t \t\tnew int[] {R.id.text1,R.id.text2, R.id.text3}\r\n\t \t\t);\r\n\t setListAdapter(adapter);\r\n\t registerForContextMenu(getListView());\r\n\t\t\r\n\t\t\r\n\t}", "void add(java.lang.CharSequence r1, java.lang.CharSequence r2, long[] r3, int r4) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.icu.impl.coll.CollationDataBuilder.add(java.lang.CharSequence, java.lang.CharSequence, long[], int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.impl.coll.CollationDataBuilder.add(java.lang.CharSequence, java.lang.CharSequence, long[], int):void\");\n }", "private void addDataToTable() {\n\n /* Get the main table from the xml */\n TableLayout mainTable = (TableLayout) findViewById(R.id.mainTable);\n\n /* Retrieve which products need to be displayed */\n int product_type = getIntent().getExtras().getInt(\"product_type\");\n String[] product_types_array = getResources().getStringArray(product_type);\n\n /* Retrieve product images for the above list of products */\n int[] product_images = getIntent().getExtras().getIntArray(\"product_images\");\n\n /* Loop through to add each product details in the table */\n for (int i = 0; i < product_types_array.length; i++) {\n\n TableRow tableRow = new TableRow(this);\n TableRow.LayoutParams tableRowParams =\n new TableRow.LayoutParams\n (TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT);\n tableRow.setLayoutParams(tableRowParams);\n tableRow.setPadding(20, 20, 20, 20);\n\n // Initialize Linearlayout to set product name and images\n LinearLayout product_desc = new LinearLayout(this);\n product_desc.setId(R.id.product_linearlayout);\n product_desc.setOrientation(LinearLayout.VERTICAL);\n product_desc.setGravity(Gravity.START);\n product_desc.setPadding(10,0,10,0);\n\n // initialize string to separate product type\n String[] pn_str = product_types_array[i].split(\";\");\n // initialize string to get product name\n String prod_name_str = pn_str[0];\n // initialize string to get product color\n String prod_color = pn_str[1];\n\n /* Product Name Details */\n TextView textView_PN = new TextView(this);\n textView_PN.setText(prod_name_str);\n textView_PN.setWidth(350);\n textView_PN.setHeight(50);\n textView_PN.setId(R.id.product_name);\n textView_PN.setGravity(Gravity.CENTER_HORIZONTAL);\n textView_PN.setTypeface(null, Typeface.BOLD);\n textView_PN.setTextSize(13);\n textView_PN.setPadding(0, 0, 0, 0);\n product_desc.addView(textView_PN);\n\n /* Product Color */\n TextView textView_PC = new TextView(this);\n textView_PC.setText(\"Color : \" + prod_color);\n textView_PC.setId(R.id.product_color);\n textView_PC.setGravity(Gravity.CENTER_HORIZONTAL);\n textView_PC.setTypeface(null, Typeface.BOLD);\n textView_PC.setTextSize(13);\n textView_PC.setPadding(10, 10, 10, 10);\n product_desc.addView(textView_PC);\n\n /* Product Image Details */\n ImageView imageView = new ImageView(this);\n imageView.setImageResource(product_images[i]);\n imageView.setId(R.id.product_image);\n imageView.setPadding(20, 20, 20, 20);\n product_desc.addView(imageView);\n\n // add row in table\n tableRow.addView(product_desc, new TableRow.LayoutParams\n (TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT, 1.0f));\n\n /* LinearLayout for checkboxes */\n LinearLayout product_types = new LinearLayout(this);\n product_types.setOrientation(LinearLayout.VERTICAL);\n product_types.setGravity(Gravity.CENTER_VERTICAL);\n\n int box_type_value = decide_type(prod_name_str);\n\n /* show all products item with checkbox */\n if( box_type_value != -1){\n\n String[] product_modules_array = getResources().getStringArray(box_type_value);\n\n /* Loop for printing multiple checkboxes */\n for (int j = 0; j < product_modules_array.length; j++) {\n\n CheckBox checkBox = new CheckBox(this);\n checkBox.setTextSize(13);\n checkBox.setText(product_modules_array[j]);\n checkBox.setChecked(false);\n checkBox.setId(count);\n\n /* check condition if particular item name belongs to product hashmap */\n if (to_refer_each_item.containsKey(i)) {\n (to_refer_each_item.get(i)).add(count);\n } else {\n ArrayList<Integer> arrayList = new ArrayList<Integer>();\n arrayList.add(count);\n to_refer_each_item.put(i, arrayList);\n }\n count++;\n product_types.addView(checkBox);\n }\n }\n tableRow.addView(product_types, new TableRow.LayoutParams\n (TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT,1.0f));\n mainTable.addView(tableRow);\n }\n }", "public void insertEntry(String type, String name, String label, String command) {\n try {\n ContentValues newValues = new ContentValues();\n\n // Assign values for each column.\n newValues.put(Constants.MODULE_TYPE, type);\n newValues.put(Constants.MODULE_NAME, name);\n newValues.put(Constants.MODULE_LABEL, label);\n newValues.put(Constants.MODULE_COMMAND, command);\n\n // Insert the row into your table.\n db = dbHelper.getWritableDatabase();\n\n db.insert(Constants.MODULE_TABLE_NAME, null, newValues);\n db.close();\n\n Toast.makeText(context, context.getString(R.string.module_added), Toast.LENGTH_LONG).show();\n }\n catch (Exception e) {\n e.getStackTrace();\n }\n }", "private void setListView() {\n\n ArrayList students = new <String>ArrayList();\n\n SQLiteDatabase database = new DatabaseSQLiteHelper(this).getReadableDatabase();\n\n Cursor cursor = database.rawQuery(\"SELECT * FROM \" + Database.Student.TABLE_NAME,null);\n\n if (cursor.moveToFirst()) {\n while (!cursor.isAfterLast()) {\n String dp = cursor.getString(cursor.getColumnIndex(Database.Student.COL_DP));\n int id = cursor.getInt(cursor.getColumnIndex(Database.Student._ID));\n String fname = cursor.getString(cursor.getColumnIndex(Database.Student.COL_FIRST_NAME));\n String lname = cursor.getString((cursor.getColumnIndex(Database.Student.COL_LAST_NAME)));\n\n String student = Integer.toString(id) +\" \"+fname+\" \"+lname ;\n\n students.add(student);\n cursor.moveToNext();\n }\n }\n\n studentList = (ListView) findViewById(R.id.studentList);\n adapter = new ArrayAdapter<String>(this, R.layout.activity_student_list_view, R.id.textView, students);\n studentList.setAdapter(adapter);\n\n studentList.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n studentList.setVisibility(View.GONE);\n addTable.setVisibility(View.GONE);\n editTable.setVisibility(View.VISIBLE);\n\n\n fillEdit(position);\n }\n });\n\n }", "public static void addView() {\n\t\tListView listview = (ListView) main_detail.findViewById(R.id.listview);\n\t\tbaseAdapter = new BaseAdapter(getActivity(), new ArrayList<Object>()) {\n\t\t\t@Override\n\t\t\tpublic BaseView getView(Context context, Object data) {\n\t\t\t\tfinal ProfileRecommentItemView profileRecommentItemView = new ProfileRecommentItemView(context);\n\t\t\t\treturn profileRecommentItemView;\n\t\t\t}\n\t\t};\n\t\tbaseAdapter.clear();\n\t\tbaseAdapter.addAllItems(baseItemsCreditMain);\n\t\tbaseAdapter.notifyDataSetChanged();\n\t\tlistview.setOnItemClickListener(new OnItemClickListener() {\n\t\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\t\t\t\tBaseItem baseItem = (BaseItem) parent.getItemAtPosition(position);\n//\t\t\t\tfinishEC(baseItem.getString(\"id_card\"));\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tlistview.setAdapter(baseAdapter);\n\t}", "private void addDataForListView() {\n \t\n \tif(loadable)\n \t{\t\n \tloadable = false;\n \tdirection = BACKWARD;\n \tstrUrl = Url.composeHotPageUrl(type_id, class_id, last_id);\n \trequestData();\n \t}\n\t}" ]
[ "0.5620522", "0.5528805", "0.5508734", "0.54759514", "0.54742265", "0.5334922", "0.5334096", "0.53206533", "0.5306363", "0.5261322", "0.5237651", "0.5224749", "0.52095425", "0.52028304", "0.5193556", "0.5147347", "0.5144099", "0.5119734", "0.5076978", "0.501954", "0.5014343", "0.49946558", "0.49749088", "0.49649438", "0.49648994", "0.49422842", "0.49401125", "0.4939759", "0.4933833", "0.4903377", "0.4901121", "0.48920712", "0.48535442", "0.4853161", "0.48517787", "0.48307914", "0.48205152", "0.48193315", "0.48167178", "0.4812805", "0.48037314", "0.48031542", "0.47964588", "0.47952846", "0.4785838", "0.47573656", "0.47541875", "0.4753182", "0.47498453", "0.47458684", "0.4736131", "0.47218144", "0.47206154", "0.47155672", "0.47122955", "0.47021934", "0.46964923", "0.4694319", "0.46935305", "0.46931815", "0.4692775", "0.46910295", "0.46859452", "0.46817982", "0.46804821", "0.46752563", "0.4669299", "0.4669187", "0.46662232", "0.46630237", "0.46618342", "0.46566048", "0.46504927", "0.46458945", "0.46439314", "0.46431124", "0.46389365", "0.46388996", "0.46367812", "0.46332872", "0.46294257", "0.46289268", "0.46187606", "0.46153224", "0.46123615", "0.4605542", "0.46043605", "0.46004313", "0.45991302", "0.45986626", "0.45973054", "0.4592791", "0.4585628", "0.4584743", "0.4581643", "0.4574466", "0.45712242", "0.4570276", "0.45698655", "0.45692787", "0.45641568" ]
0.0
-1
it would be better to left join qfileEntity to fileEntity and look for row where the left part is null, but does not allow to join table in a delete query :/
@Override public Long deleteUnreferenced(String fileType, RelationalPathBase<?> relationalPathBase, NumberPath<Long> column) { return transactionManagerQuerydsl .delete(QFile.file) .where(QFile.file.fileType.eq(fileType)) .where(QFile.file.id.notIn( JPAExpressions .select(column) .from(relationalPathBase) )) .execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void excluir(Filme f) {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Iniciar a transação\r\n gerenciador.getTransaction().begin();\r\n\r\n //Para excluir tem que dar o merge primeiro para \r\n //sincronizar o ator do BD com o ator que foi\r\n //selecionado na tela\r\n f = gerenciador.merge(f);\r\n\r\n //Mandar sincronizar as alterações \r\n gerenciador.remove(f);\r\n\r\n //Commit na transação\r\n gerenciador.getTransaction().commit();\r\n\r\n }", "@Override\n\tpublic String delete(Set<String> filterField) {\n\t\treturn null;\n\t}", "@Override\n\tpublic String deleteByCondition(Familynames con, Model m) throws Exception {\n\t\treturn null;\n\t}", "boolean getForceDeleteNull();", "@Override\n\tpublic void delete(Field entity) {\n\t\t\n\t}", "public void testDeleteFileNullPointerException() throws Exception {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n try {\r\n filePersistence.deleteFile(null, \"valid\");\r\n fail(\"if fileLocation is null, throw NullPointerException\");\r\n } catch (NullPointerException e) {\r\n // good\r\n }\r\n try {\r\n filePersistence.deleteFile(\"valid\", null);\r\n fail(\"if persistenceName is null, throw NullPointerException\");\r\n } catch (NullPointerException e) {\r\n // good\r\n }\r\n }", "@Override\n\tpublic String deleteByCondition(Familybranch con, Model m) throws Exception {\n\t\treturn null;\n\t}", "@Override\n\tpublic void delete(List<Field> entity) {\n\t\t\n\t}", "CustomDeleteQuery deleteFrom(String table) throws JpoException;", "public File delete(File f) throws FileDAOException;", "@Override\n\tpublic Map<String, Object> delete(StoreBase entity) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic void deleteFileData(Long id) {\n\t\t\r\n\t}", "public interface Delable extends Entity {\n\n @PofM(who = P.A)\n default boolean delete() {\n ECCalculator ecc = new ECCalculator(this);\n\n TableId tableId = new TableId(this.getSchemaName(), this.getTableName());\n List<String> whereFields = ecc.getKeyFields();\n Where where = new Where(new Equal(tableId, whereFields.get(0)));\n whereFields.subList(1, whereFields.size()).forEach(f -> where.addExpression(true, new Equal(tableId, f)));\n\n PreparedSQL delete = new Delete(tableId).where(where);\n return DB.instance().preparedExecute(delete.toPreparedSql(), 1, ecc.getValuesInOrder(whereFields));\n }\n\n}", "@Override\n\tprotected String deleteStatement() {\n\t\treturn null;\n\t}", "@Test(timeout = 4000)\n public void test134() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.leftJoin(\"deletesetci\", (String[]) null, \"deletesetci\", \"BouncyCastleProvider\", (String[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.SQLUtil\", e);\n }\n }", "List<FileEntity> findByParentFile(FileEntity parentFile);", "@Override\n public void delete(LineEntity entity) {\n\n }", "@Test\r\n public void deleteCarritoDeComprasTest() {\r\n System.out.println(\"d entra\"+data);\r\n CarritoDeComprasEntity entity = data.get(0);\r\n carritoDeComprasPersistence.delete(entity.getId());\r\n CarritoDeComprasEntity deleted = em.find(CarritoDeComprasEntity.class, entity.getId());\r\n Assert.assertNull(deleted);\r\n System.out.println(\"d voy\"+data);\r\n }", "@Override\n\tpublic void delete(UploadDF entity) {\n\t\tSession session = factory.openSession();\n\t\ttry{\n\t\t\tsession.beginTransaction();\n\t\t\tsession.delete(entity);\n\t\t\tsession.getTransaction().commit();\n\t\t}catch(HibernateException exception){\n\t\t\tsession.getTransaction().rollback();\n\t\t\tthrow exception;\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t}", "@Override\npublic void deleteAll(Iterable<? extends Formation> entities) {\n\t\n}", "@Test\n public void testQueryWithAllSegmentsAreEmpty() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\" [20120101000000_20120102000000]\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\" [20120102000000_20120103000000]\n // val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\" [20120103000000_20120104000000]\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\" [20120104000000_20120105000000]\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\" [20120105000000_20120106000000]\n\n EnhancedUnitOfWork.doInTransactionWithCheckAndRetry(() -> {\n NDataflowManager dfMgr = NDataflowManager.getInstance(getTestConfig(), project);\n NDataflow dataflow = dfMgr.getDataflow(dfId);\n Segments<NDataSegment> segments = dataflow.getSegments();\n // update\n NDataflowUpdate dataflowUpdate = new NDataflowUpdate(dfId);\n dataflowUpdate.setToRemoveSegs(segments.toArray(new NDataSegment[0]));\n dfMgr.updateDataflow(dataflowUpdate);\n return null;\n }, project);\n\n val sql = \"select cal_dt, sum(price), count(*) from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" //\n + \"group by cal_dt\\n\";\n\n MetadataTestUtils.updateProjectConfig(project, \"kylin.query.index-match-rules\", QueryRouter.USE_VACANT_INDEXES);\n try (QueryContext queryContext = QueryContext.current()) {\n OLAPContext olapContext = OlapContextTestUtil.getOlapContexts(project, sql).get(0);\n StorageContext storageContext = olapContext.storageContext;\n Assert.assertEquals(-1L, storageContext.getLayoutId().longValue());\n Assert.assertFalse(queryContext.getQueryTagInfo().isVacant());\n }\n }", "@Test\n public void deletePerroTest() {\n PerroEntity entity = Perrodata.get(2);\n perroLogic.deletePerro(entity.getId());\n PerroEntity deleted = em.find(PerroEntity.class, entity.getId());\n Assert.assertNull(deleted);\n }", "@Override\n\tpublic String deleteBatch(List<Map<String, Object>> entityMap)\n\t\t\tthrows DataAccessException {\n\t\treturn null;\n\t}", "boolean hasForceDelete();", "void clearDeletedItemsTable();", "@Test(timeout = 4000)\n public void test025() throws Throwable {\n String[] stringArray0 = new String[5];\n String string0 = SQLUtil.leftJoin(\"*nT\", stringArray0, \"tYr\", (String) null, stringArray0);\n assertEquals(\"left join tYr as null on *nT.null = null.null and *nT.null = null.null and *nT.null = null.null and *nT.null = null.null and *nT.null = null.null\", string0);\n }", "@Override\n\tpublic ImageEntity delete(Object entity) {\n\t\tDatabaseContext.delete(entity);\n\t\treturn (ImageEntity) entity;\n\t}", "public void delete(){\n if (shx!=null) shx.delete();\n if (shp!=null) shp.delete();\n if (dbf!=null) dbf.delete();\n if (prj!=null) prj.delete();\n }", "@Test\n public void deleteQuejaTest() {\n QuejaEntity entity = data.get(0);\n quejaPersistence.delete(entity.getId());\n QuejaEntity deleted = em.find(QuejaEntity.class, entity.getId());\n Assert.assertNull(deleted);\n }", "@Override\n\tpublic boolean preDelete() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean delete(String sql) {\n\t\treturn false;\n\t}", "@Override\r\n\tprotected boolean beforeDelete() {\r\n\t\t\r\n\t\tString valida = DB.getSQLValueString(null,\"SELECT DocStatus FROM C_Hes WHERE C_Hes_ID=\" + getC_Hes_ID());\r\n if (!valida.contains(\"DR\")){\r\n \t\r\n \tthrow new AdempiereException(\"No se puede Eliminar este documento por motivos de Auditoria\");\r\n\r\n }\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n protected void validaRegrasExcluir(ArquivoLoteVO entity) throws AppException {\n\n }", "@Test\n public void deleteComentarioTest(){\n ComentarioEntity entity = data.get(0);\n comentarioPersistence.delete(entity.getId());\n ComentarioEntity eliminado = em.find(ComentarioEntity.class,entity.getId());\n Assert.assertNull(eliminado);\n }", "@Test\n void testDeleteOnlyReportErrorsIfItAddsNewInformation() {\n\n Setup setup =\n new Setup.Builder()\n .trackedEntity(\"xK7H53f4Hc2\")\n .isNotValid()\n .enrollment(\"t1zaUjKgT3p\")\n .isNotValid()\n .relationship(\"Te3IC6TpnBB\", trackedEntity(\"xK7H53f4Hc2\"), enrollment(\"t1zaUjKgT3p\"))\n .isNotValid()\n .build();\n\n PersistablesFilter.Result persistable =\n filter(setup.bundle, setup.invalidEntities, TrackerImportStrategy.DELETE);\n\n assertAll(\n () -> assertIsEmpty(persistable.get(TrackedEntity.class)),\n () -> assertIsEmpty(persistable.get(Enrollment.class)),\n () -> assertIsEmpty(persistable.get(Relationship.class)),\n () -> assertIsEmpty(persistable.getErrors()));\n }", "@Override\n\tpublic boolean delete(Message entity) throws SQLException {\n\t\treturn false;\n\t}", "public void deleteRecord() {\n try {\n System.out.println(\"Please enter the name of the company you wish to delete\");\n String companyName = HelperFunctions.getInputDataString();\n RandomAccessFile rafData = new RandomAccessFile(this.databaseName + \".data\", \"rws\");\n int deleteLocation = binarySearch(rafData, companyName);\n\n if (deleteLocation != -1) {\n\n deleteLocation = binarySearchToFindClosest(companyName, 0, Integer.parseInt(getNumberOfRecords(\"normal\")));\n rafData.getChannel().position(Constants.NUM_BYTES_LINUX_RECORD * deleteLocation + Constants.NUM_BYTES_RANK);\n\n rafData.write(HelperFunctions.addWhitespacesToEnd(\"MISSING-RECORD\", Constants.NUM_BYTES_COMPANY_NAME).getBytes(), 0, Constants.NUM_BYTES_COMPANY_NAME);\n rafData.close();\n\n System.out.println(\"Deleting Record...\");\n\n // Have to remove the record entirely on a delete, otherwise it will mess up binary search by not being sorted with the rest \n removeDeletedRecord();\n updateNumRecords(\"normal\", Integer.parseInt(getNumberOfRecords(\"normal\")) - 1);\n\n // Check overflow file if not found in normal data file\n } else {\n RandomAccessFile rafOverflow = new RandomAccessFile(this.databaseName + \".overflow\", \"rws\");\n boolean recordInOverflow = false;\n int numOverflowRecords = Integer.parseInt(getNumberOfRecords(\"overflow\"));\n int recordPosition = -1;\n\n for (int i = 0; i < numOverflowRecords; i++) {\n String record = getRecord(\"overflow\", rafOverflow, i);\n String recordName = record.substring(5,45);\n recordName = recordName.trim();\n\n if (companyName.equals(recordName)) {\n recordInOverflow = true;\n recordPosition = i;\n break;\n }\n }\n\n // If found in overflow file, set that company name to MISSING-RECORD\n if (recordInOverflow == true) {\n rafOverflow.getChannel().position(Constants.NUM_BYTES_LINUX_RECORD * recordPosition + Constants.NUM_BYTES_RANK);\n rafOverflow.write(HelperFunctions.addWhitespacesToEnd(\"MISSING-RECORD\", Constants.NUM_BYTES_COMPANY_NAME).getBytes(), 0, Constants.NUM_BYTES_COMPANY_NAME);\n rafOverflow.close();\n System.out.println(\"Deleting Record...\");\n } else {\n System.out.println(\"That record does not exist in this database\");\n }\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "@Override\r\n\tpublic void qnaFileDelete(int qnaFileIdx) {\n\t\t\r\n\t}", "@Test\n public void shouldDeleteIncompleteRestores()\n throws Exception\n {\n givenStoreHasFileOfSize(PNFSID, 17);\n\n // and given the replica meta data indicates the file was\n // being restored from tape and has is supposed to have a\n // different file size,\n StorageInfo info = createStorageInfo(20);\n givenMetaDataStoreHas(PNFSID, FROM_STORE, info);\n\n // when reading the meta data record\n MetaDataRecord record = _consistentStore.get(PNFSID);\n\n // then nothing is returned\n assertThat(record, is(nullValue()));\n\n // and the replica is deleted\n assertThat(_metaDataStore.get(PNFSID), is(nullValue()));\n assertThat(_fileStore.get(PNFSID).exists(), is(false));\n\n // and the location is cleared\n verify(_pnfs).clearCacheLocation(PNFSID);\n\n // and the name space entry is not touched\n verify(_pnfs, never())\n .setFileAttributes(eq(PNFSID), Mockito.any(FileAttributes.class));\n }", "@Test(expectedExceptions = DataAccessException.class)\r\n public void testDeleteNull() {\r\n recordDao.delete(null);\r\n }", "public void execute() throws XMLBuildException {\r\n\t\tResultSet r = null;\r\n\t\tQuery query = (Query) getParent();\r\n\t\tconnection = query.findConnection(connectionString);\r\n\t\t//log.debug(\"connection = \" + this.connection);\r\n\t\tif (connection == null) {\r\n\t\t\tthrow new XMLBuildException(\"connection not found\", this);\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tc = connection.getConnection();\r\n\t\t\tstmt = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\r\n ResultSet.CONCUR_UPDATABLE);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tthrow new XMLBuildException(e.getMessage(), this);\r\n\t\t}\r\n\t\t// Prepare delete query -- don't actually delete anything yet\r\n\r\n\t\tif (printCreateTable)\r\n\t\t\tprintCreateTable();\r\n\t\t//\r\n\t\t// Delete First stuff goes here\r\n\t\t//\r\n\t\tif (deleteFirst != null) {\r\n\t\t\tlog.debug(\"fields = \" + fields);\r\n\t\t\tStringBuffer deleteFirstSelect = new StringBuffer(\"\");\r\n\t\t\tStringBuffer deleteFirstSQL = new StringBuffer(\"delete from \" + table + \" where \");\r\n\t\t\tfor (int i = 0; i < deleteFirst.length; i++) {\r\n\t\t\t\tField f = fields.get(deleteFirst[i]);\r\n\t\t\t\tif (f == null) {\r\n\t\t\t\t\tthrow new XMLBuildException(\"field \" + deleteFirst[i] +\r\n\t\t\t\t\t\t\t\" from deleteFirst does not exist\", this);\r\n\t\t\t\t}\r\n\t\t\t\tdeleteFirstSQL.append(\"[\" + f.getFieldName() + \"] = ? and \");\r\n\t\t\t\tdeleteFirstSelect.append(\", [\" + f.getFieldName() + \"]\");\r\n\t\t\t}\r\n\t\t\tdeleteFirstSQL.setLength(deleteFirstSQL.length()-4);\r\n\t\t\tthis.deleteFirstSQL = deleteFirstSQL.toString();\r\n\t\t\tlog.debug(\"Delete first SQL = \" + this.deleteFirstSQL);\t\r\n\r\n\t\t\tString delFirstQuery = \"select \" + deleteFirstSelect.substring(2) + \r\n\t\t\t\t\" from \" + table + \" where 1=0\";\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tr = stmt.executeQuery(delFirstQuery);\r\n\t\t\t\tResultSetMetaData m = r.getMetaData();\r\n\t\t\t\tfor (int i = 0; i < deleteFirst.length; i++) {\r\n\t\t\t\t\tdeleteFirstTypes.put(m.getColumnName(i+1).toUpperCase(), \r\n\t\t\t\t\t\t\tnew LoadParameter(i+1, m.getColumnType(i+1)));\r\n\t\t\t\t}\r\n\t\t\t\tr.close();\r\n\t\t\t\tlog.debug(\"del first sql = \" + deleteFirstSQL);\r\n\t\t\t\tpstmt = c.prepareStatement(deleteFirstSQL.toString());\r\n\t\t\t}\r\n\t\t\tcatch (SQLException s) {\r\n\t\t\t\tlog.debug(\"query = \" + delFirstQuery);\r\n\t\t\t\tthrow new XMLBuildException(\"deleteFirst does not look like a valid comma separated list of fields in \" + table, this);\r\n\t\t\t}\r\n\t\t}\r\n\t\tlog.debug(\"deleteFirstTypes = \" + deleteFirstTypes);\r\n\t\tif (truncate)\r\n\t\t\ttruncateTable(stmt);\r\n\t\t//parse.execute();\r\n\t\ttry {\r\n\t\t\tr.close();\r\n\t\t} catch (SQLException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tstmt.close();\r\n\t\t} catch (SQLException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tc.close();\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tthrow new XMLBuildException(e.getMessage(), this);\r\n\t\t}\r\n\t}", "@Test\n public void testDeleteGeneratedEmptyFile() throws Throwable {\n String resources = getResourceFolder();\n String outputFile = resources + \"/out/test_deleteGeneratedEmptyFile.csv\";\n LOGGER.debug(\"Test file path: \" + outputFile);\n TFileOutputDelimitedProperties properties = createOutputProperties(outputFile, false);\n List<IndexedRecord> records = new ArrayList<>();\n // Delete generated empty file function not be checked\n doWriteRows(properties, records);\n File outFile = new File(outputFile);\n assertTrue(outFile.exists());\n assertEquals(0, outFile.length());\n assertTrue(outFile.delete());\n // Active delete generated empty file function\n assertFalse(outFile.exists());\n properties.deleteEmptyFile.setValue(true);\n doWriteRows(properties, records);\n assertFalse(outFile.exists());\n\n }", "public String getDeleteContentSql(String table)\r\n \t{\r\n \t\treturn \"delete from \" + table + \" where resource_id = ? \";\r\n \t}", "@Override\n public void delete(Question q) {\n try {\n c = DBConncetion.getConnection();\n String sql = \"Delete From mainquestion where id = ?\";\n PreparedStatement pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.executeUpdate();\n if (q.getType() == FillBlank) {\n pstmt = c.prepareStatement(\"Delete From fill_blank \\n\" +\n \"Where id = ? \");\n } else {\n pstmt = c.prepareStatement(\"Delete From multiplechoice \\n\" +\n \"Where id = ? \");\n }\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.executeUpdate();\n } catch (Exception e) {\n throw new LoadSaveException(\"Delete: \" + e.getMessage());\n }\n }", "public void pullFromHibernate(){\n List<ImageData> deleteList = new ArrayList<>();\n\n USER.getImages()\n .stream()\n .filter(imageData -> {\n File newFile = new File(imageData.getPath());\n if(addFile(newFile)){\n IMAGE_DATA.inverse().forcePut(imageData, newFile);\n return false;\n }else return true;\n }).forEach(deleteList::add);\n\n deleteList.forEach(imageData -> {\n LOGGER.info(\"File: \" + imageData.getPath() + \" not found locally.\\n\" +\n \"Deleting reference from remote SQL.\");\n USER.deleteImage(imageData);\n });\n refreshTagsTree();\n }", "@Test(timeout=180000)\n public void testQuarantineCorruptHFile() throws Exception {\n TableName table = TableName.valueOf(name.getMethodName());\n try {\n setupTable(table);\n assertEquals(ROWKEYS.length, countRows());\n admin.flush(table); // flush is async.\n\n FileSystem fs = FileSystem.get(conf);\n Path hfile = getFlushedHFile(fs, table);\n\n // Mess it up by leaving a hole in the assignment, meta, and hdfs data\n admin.disableTable(table);\n\n // create new corrupt file called deadbeef (valid hfile name)\n Path corrupt = new Path(hfile.getParent(), \"deadbeef\");\n TestHFile.truncateFile(fs, hfile, corrupt);\n LOG.info(\"Created corrupted file \" + corrupt);\n HBaseFsck.debugLsr(conf, FSUtils.getRootDir(conf));\n\n // we cannot enable here because enable never finished due to the corrupt region.\n HBaseFsck res = HbckTestingUtil.doHFileQuarantine(conf, table);\n assertEquals(res.getRetCode(), 0);\n HFileCorruptionChecker hfcc = res.getHFilecorruptionChecker();\n assertEquals(hfcc.getHFilesChecked(), 5);\n assertEquals(hfcc.getCorrupted().size(), 1);\n assertEquals(hfcc.getFailures().size(), 0);\n assertEquals(hfcc.getQuarantined().size(), 1);\n assertEquals(hfcc.getMissing().size(), 0);\n\n // Its been fixed, verify that we can enable.\n admin.enableTable(table);\n } finally {\n cleanupTable(table);\n }\n }", "@Override\n public void delete(Iterable<? extends LineEntity> entities) {\n\n }", "@Test\n public void deleteTarjetaPrepagoTest() throws BusinessLogicException \n {\n TarjetaPrepagoEntity entity = data.get(2);\n tarjetaPrepagoLogic.deleteTarjetaPrepago(entity.getId());\n TarjetaPrepagoEntity deleted = em.find(TarjetaPrepagoEntity.class, entity.getId());\n Assert.assertNull(deleted);\n }", "@Override\n\tpublic Query createQuery(CriteriaDelete deleteQuery) {\n\t\treturn null;\n\t}", "@Override\n\tpublic <T> long delete(Map<String, CustmerCriteria> query, Class<T> entityClass) throws Exception {\n\t\treturn 0;\n\t}", "@Test\n public void testJoinTypeLeftWhenParentEffectiveJoinTypeIsLeftEvenWhenOnlyIdSelected() {\n Person parent = query.from(Person.class);\n Relation relation = query.join(parent.getChildRelations(), JoinType.Left);\n \n query.select(relation.getChild().getId());\n \n validate(\"select hobj3.id from Person hobj1 left join hobj1.childRelations hobj2 left join hobj2.child hobj3\");\n }", "@Override\n\tpublic void delete(FxzfLane entity) {\n\t\t\n\t}", "public void deleteGeominas(Geominas entity) throws Exception;", "@Override\r\n\tpublic int fileDelete(int no) {\n\t\treturn sqlSession.delete(namespace + \"fileDelete\", no);\r\n\t}", "private void deleteIfNecessary(HashMap<String, Blob> allFiles,\n HashMap<String, Blob> filesInCurr) {\n for (String fileName: filesInCurr.keySet()) {\n if (allFiles.get(fileName) == null) {\n File fileInCWD = new File(Main.CWD, fileName);\n if (fileInCWD.exists()) {\n fileInCWD.delete();\n }\n }\n }\n }", "private PQNode removeLastFromFile() throws Exception{\n List<PQNode> nodes = retrieveWholeFile(nodeCount-1);\n if(nodes.size()==0){\n return null;\n }\n PQNode last =nodes.remove(nodes.size()-1);\n\n\n\n int fileId = (last.getPqIndex()-1)/ENTRY_BLOCK_SIZE;\n File file = new File(DIRECTORY + getMapFileName(NAME_PATTERN, fileId));\n\n storeToFile(file,nodes, false);\n\n return last;\n }", "private void deleteFile() {\r\n actionDelete(dataModelArrayList.get(position));\r\n }", "private void clearData() {\n em.createQuery(\"delete from ViajeroEntity\").executeUpdate();\n }", "@Ignore @Test(timeout=180000)\n public void testQuarantineMissingFamdir() throws Exception {\n TableName table = TableName.valueOf(name.getMethodName());\n // inject a fault in the hfcc created.\n final FileSystem fs = FileSystem.get(conf);\n HBaseFsck hbck = new HBaseFsck(conf, hbfsckExecutorService) {\n @Override\n public HFileCorruptionChecker createHFileCorruptionChecker(boolean sidelineCorruptHFiles) throws IOException {\n return new HFileCorruptionChecker(conf, executor, sidelineCorruptHFiles) {\n AtomicBoolean attemptedFirstHFile = new AtomicBoolean(false);\n @Override\n protected void checkColFamDir(Path p) throws IOException {\n if (attemptedFirstHFile.compareAndSet(false, true)) {\n assertTrue(fs.delete(p, true)); // make sure delete happened.\n }\n super.checkColFamDir(p);\n }\n };\n }\n };\n doQuarantineTest(table, hbck, 3, 0, 0, 0, 1);\n hbck.close();\n }", "protected void deleteWithoutCommit() {\n \t\ttry {\n \t\t\tcheckedActivate(3); // TODO: Figure out a suitable depth.\n \t\t\t\n \t\t\tfor(MessageReference ref : getAllMessages(false)) {\n \t\t\t\tref.initializeTransient(mFreetalk);\n \t\t\t\tref.deleteWithoutCommit();\n \t\t\t}\n \n \t\t\tcheckedDelete();\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \n \t}", "@Test(expected = NoResultException.class)\r\n public void deletePost(){\r\n\r\n Post post = entityManager.createNamedQuery(\"Post.fetchAllRecordsByUserId\", Post.class)\r\n .setParameter(\"value1\", 3000l)\r\n .getSingleResult(); \r\n\r\n \r\n assertNotNull(post);\r\n \r\n entityTransaction.begin();\r\n assertTrue(post.getLikes() > 2);\r\n entityManager.remove(post);\r\n entityTransaction.commit();\r\n \r\n post = entityManager.createNamedQuery(\"Post.fetchAllRecordsByUserId\", Post.class)\r\n .setParameter(\"value1\", post.getUserId())\r\n .getSingleResult(); \r\n assertNull(post);\r\n \r\n }", "private void appendTempTableUpdateDeleteJoin(Object source, Attribute[] prototypeAttributes, MithraFastList<Attribute> nullAttributes, int pkAttributeCount, TupleTempContext tempContext, StringBuilder builder)\r\n {\r\n builder.append(\" from \").append(this.getFullyQualifiedTableNameGenericSource(source));\r\n builder.append(\" t0, \");\r\n this.appendTempTableRightSideJoin(source, prototypeAttributes, nullAttributes, pkAttributeCount, tempContext, builder);\r\n }", "public void delete(Object o) throws RNoEntityException{\n\t\tEntity e = ALiteOrmBuilder.getInstance().getEntity(o.getClass());\n\t\tif(e == null)\n\t\t\tthrow new RNoEntityException(\"For : \" + o.getClass().getName());\n\t\te.delete(this, db, new TravelingEntity(o));\n\t}", "private String deleteQuery(String field) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"delete\");\n\t\tsb.append(\" from \");\n\t\tsb.append(type.getSimpleName());\n\t\tsb.append(\" WHERE \" + field + \" =?\");\n\t\treturn sb.toString();\n\t}", "public static boolean removeFile(double fileId) {\n\n String sql = \"DELETE FROM corpus1 WHERE fileId = ?\";\n\n try (Connection conn = DatabaseOperations.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // set the corresponding param\n pstmt.setDouble(1, fileId);\n // execute the delete statement\n pstmt.executeUpdate();\n\n } catch (SQLException e) {\n System.out.println(\"removeSeg: \" + e.getMessage());\n return false;\n }\n \n sql = \"DELETE FROM files WHERE fileID = ?\";\n try (Connection conn = DatabaseOperations.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // set the corresponding param\n pstmt.setDouble(1, fileId);\n // execute the delete statement\n pstmt.executeUpdate();\n return true;\n\n } catch (SQLException e) {\n System.out.println(\"removeSeg: \" + e.getMessage());\n return false;\n }\n }", "public JSONArray listFiles(Connection conn, File cond) throws Exception{\n this.result = new JSONArray();\n PreparedStatement ps = null;\n ResultSet rs = null;\n boolean fileID = false;\n String sql = \"SELECT F.FILE_ID, F.LOGICAL_FILE_NAME LFN, F.IS_FILE_VALID, F.DATASET_ID, F.BLOCK_ID, F.FILE_TYPE_ID, \"\n\t\t +\" F.CHECK_SUM, F.EVENT_COUNT, F.FILE_SIZE, F.BRANCH_HASH_ID, F.ADLER32, F.MD5, F.AUTO_CROSS_SECTION,\"\n\t\t + \" F.CREATION_DATE, F.CREATE_BY, F.LAST_MODIFICATION_DATE, F.LAST_MODIFIED_BY, \"\n\t\t + \" B.BLOCK_NAME, D.DATASET , FT.FILE_TYPE\"\n + \" FROM \" + schemaOwner + \"FILES F \"\n\t\t + \" JOIN \" + schemaOwner + \"FILE_TYPES FT ON FT.FILE_TYPE_ID = F.FILE_TYPE_ID \"\n + \" JOIN \" + schemaOwner + \"DATASETS D ON D.DATASET_ID = F.DATASET_ID \"\n\t\t + \" JOIN \" + schemaOwner + \"BLOCKS B ON B.BLOCK_ID = F.BLOCK_ID\"\n + \" WHERE \";\n\tif(cond.getFileID() != 0){ \n\t sql += \"F.FILE_ID = ? \";\n\t fileID =true;\n\t}\n\n else if ( cond.has(\"LOGICAL_FILE_NAME\")) { \n\t\tif (cond.getLogicalFileName() != null || cond.getLogicalFileName() != \"\"){\n\t \t\tif ( (cond.getLogicalFileName()).indexOf('%') != -1) sql += \" F.LOGICAL_FILE_NAME like ?\";\n\t \t\telse sql += \" F.LOGICAL_FILE_NAME = ?\";\n\t\t}\n\t}\n\telse if ( cond.has(\"DATASET_DO\")) { \n\t\tif( cond.getDatasetDO().getDataset() != null || cond.getDatasetDO().getDataset() != \"\") {\n \t\tif ( (cond.getDatasetDO().getDataset() ).indexOf('%') != -1) sql += \" D.DATASET like ?\";\n \t\telse sql += \" D.DATASET = ?\";\n \t}\n\t}\n\telse if ( cond.has(\"BLOCK_DO\")) {\n\t\tif ( cond.getBlockDO().getBlockName() != null || cond.getBlockDO().getBlockName() != \"\") {\n\t\t\tif ( (cond.getBlockDO().getBlockName()).indexOf('%') != -1) sql += \" B.BLOCK_NAME like ?\";\n\t\t\telse sql += \" B.BLOCK_NAME = ?\";\n\t\t}\n\t}\n else throw new DBSException(\"Input Data Error\", \"File name (LFN) or ID , or BLOCK Name, or DATASET have to be provided. \");\n\n ps = null;\n rs = null;\n try{\n ps = DBManagement.getStatement(conn, sql);\n //prepare statement index starting with 1, but JSONArray index starting with 0.\n\t if(fileID)ps.setInt(1, cond.getFileID());\n\t else if ( cond.has(\"LOGICAL_FILE_NAME\")) ps.setString(1, cond.getLogicalFileName());\n\t else if ( cond.has(\"DATASET_DO\")) ps.setString(1, cond.getDatasetDO().getDataset());\n\t else if ( cond.has(\"BLOCK_DO\")) ps.setString(1, cond.getBlockDO().getBlockName());\n\t //else ps.setString(1, cond.getLogicalFileName());\n //System.out.println(ps.toString());\n rs = ps.executeQuery();\n while(rs.next()){\n String lfn = rs.getString(\"LFN\");\n int fileId = rs.getInt(\"FILE_ID\");\n\t\tint isValid = rs.getInt(\"IS_FILE_VALID\");\n\t\tDataset ds = new Dataset(rs.getInt(\"DATASET_ID\"), rs.getString(\"DATASET\"));\n\t\tBlock bk = new Block(rs.getInt(\"BLOCK_ID\"), rs.getString(\"BLOCK_NAME\"));\n\t\tFileType ftype = new FileType(rs.getInt(\"FILE_TYPE_ID\"), rs.getString(\"FILE_TYPE\"));\n\t\tString cksum = rs.getString(\"CHECK_SUM\");\n\t\tint ecnt = rs.getInt(\"EVENT_COUNT\");\n\t\tint fsize = rs.getInt(\"FILE_SIZE\");\n\t\tBranchHash bh = new BranchHash (rs.getInt(\"BRANCH_HASH_ID\"));\n\t\tdouble xcr = rs.getDouble(\"AUTO_CROSS_SECTION\");\n\t\tString adl = rs.getString(\"ADLER32\");\n\t\tString md = rs.getString(\"MD5\");\n\t\tlong cDate = rs.getLong(\"CREATION_DATE\");\n\t\tString cBy = rs.getString(\"CREATE_BY\");\n\t\tlong lDate = rs.getLong(\"LAST_MODIFICATION_DATE\");\n\t\tString lBy = rs.getString(\"LAST_MODIFIED_BY\");\n \n\t\tthis.result.put(new File(fileId, lfn, isValid, ds, bk, ftype, cksum, ecnt, fsize, bh, \n adl, md, xcr, cDate, cBy, lDate, lBy));\n\t }\n }finally {\n if (rs != null) rs.close();\n if (ps != null) ps.close();\n }\n return this.result;\n }", "@Override\r\n public void deleteEntity(String entityName) {\n\r\n }", "public void preDoDelete(T entity)\n {\n }", "public boolean deleteFile(String inKey) throws NuxeoException;", "@Test\n public void testQueryWithEmptySegment() throws SqlParseException {\n\n val project = \"heterogeneous_segment\";\n val dfId = \"747f864b-9721-4b97-acde-0aa8e8656cba\";\n // val seg1Id = \"8892fa3f-f607-4eec-8159-7c5ae2f16942\" [20120101000000_20120102000000]\n // val seg2Id = \"d75a822c-788a-4592-a500-cf20186dded1\" [20120102000000_20120103000000]\n val seg3Id = \"54eaf96d-6146-45d2-b94e-d5d187f89919\"; // [20120103000000_20120104000000]\n // val seg4Id = \"411f40b9-a80a-4453-90a9-409aac6f7632\" [20120104000000_20120105000000]\n // val seg5Id = \"a8318597-cb75-416f-8eb8-96ea285dd2b4\" [20120105000000_20120106000000]\n\n EnhancedUnitOfWork.doInTransactionWithCheckAndRetry(() -> {\n NDataflowManager dfMgr = NDataflowManager.getInstance(getTestConfig(), project);\n NDataflow dataflow = dfMgr.getDataflow(dfId);\n NDataSegment latestReadySegment = dataflow.getSegment(seg3Id);\n if (latestReadySegment != null) {\n NDataSegDetails segDetails = latestReadySegment.getSegDetails();\n List<NDataLayout> allLayouts = segDetails.getAllLayouts();\n\n // update\n NDataflowUpdate dataflowUpdate = new NDataflowUpdate(dfId);\n NDataLayout[] toRemoveLayouts = allLayouts.stream()\n .filter(dataLayout -> dataLayout.getLayoutId() == 20001).toArray(NDataLayout[]::new);\n dataflowUpdate.setToRemoveLayouts(toRemoveLayouts);\n dfMgr.updateDataflow(dataflowUpdate);\n }\n return null;\n }, project);\n\n val sql = \"select cal_dt, sum(price), count(*) from test_kylin_fact inner join test_account \\n\"\n + \"on test_kylin_fact.seller_id = test_account.account_id \\n\"\n + \"where cal_dt between date'2012-01-01' and date'2012-01-03'\\n\" //\n + \"group by cal_dt\\n\";\n // can not query\n {\n OLAPContext olapContext = OlapContextTestUtil.getOlapContexts(project, sql).get(0);\n StorageContext storageContext = olapContext.storageContext;\n Assert.assertEquals(-1L, storageContext.getLayoutId().longValue());\n }\n\n {\n MetadataTestUtils.updateProjectConfig(project, \"kylin.query.index-match-rules\",\n QueryRouter.USE_VACANT_INDEXES);\n try (QueryContext queryContext = QueryContext.current()) {\n OLAPContext olapContext = OlapContextTestUtil.getOlapContexts(project, sql).get(0);\n StorageContext storageContext = olapContext.storageContext;\n Assert.assertEquals(10001L, storageContext.getLayoutId().longValue());\n Assert.assertFalse(queryContext.getQueryTagInfo().isVacant());\n }\n }\n }", "@Override\r\n public void supprimerFilm(Film f) {\n int idEvent= RetourIdEvent(f);\r\n try {\r\n String sql = \"DELETE FROM `film` where (idEvent ='\"+idEvent+\"');\";\r\n\r\n Statement stl = conn.createStatement();\r\n int rs =stl.executeUpdate(sql);\r\n \r\n String sql2 = \"DELETE FROM `evenement` where (idEvent ='\"+idEvent+\"');\";\r\n\r\n Statement stl2 = conn.createStatement();\r\n int rs1 =stl2.executeUpdate(sql2);\r\n \r\n } catch (SQLException ex) {\r\n System.err.println(\"SQLException: \" + ex.getMessage());\r\n \r\n } }", "ZhuangbeiInfo selectByPrimaryKeyWithLogicalDelete(@Param(\"id\") Integer id, @Param(\"andLogicalDeleted\") boolean andLogicalDeleted);", "@Override\n\t\t\t\t\tpublic void tableChanged(TableModelEvent e) {\n\t\t\t\t\t\tif (currConfig != null) {\n\t\t\t\t\t\t\tif (((CIVLTable) tbl_fileTable).deleting\n\t\t\t\t\t\t\t\t\t&& e.getType() == TableModelEvent.DELETE) {\n\t\t\t\t\t\t\t\tdeleteSelectedFile(e.getLastRow());\n\n\t\t\t\t\t\t\t\tDefaultTableModel inputModel = (DefaultTableModel) tbl_inputTable\n\t\t\t\t\t\t\t\t\t\t.getModel();\n\n\t\t\t\t\t\t\t\tif (inputModel.getRowCount() != 0) {\n\t\t\t\t\t\t\t\t\tinputModel.setRowCount(0);\n\t\t\t\t\t\t\t\t\ttbl_inputTable.clearSelection();\n\t\t\t\t\t\t\t\t\ttbl_inputTable.revalidate();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Override\n\tpublic Result delete(CurriculumVitae entity) {\n\t\treturn null;\n\t}", "@Test(timeout=180000)\n public void testQuarantineMissingHFile() throws Exception {\n TableName table = TableName.valueOf(name.getMethodName());\n\n // inject a fault in the hfcc created.\n final FileSystem fs = FileSystem.get(conf);\n HBaseFsck hbck = new HBaseFsck(conf, hbfsckExecutorService) {\n @Override\n public HFileCorruptionChecker createHFileCorruptionChecker(boolean sidelineCorruptHFiles) throws IOException {\n return new HFileCorruptionChecker(conf, executor, sidelineCorruptHFiles) {\n AtomicBoolean attemptedFirstHFile = new AtomicBoolean(false);\n @Override\n protected void checkHFile(Path p) throws IOException {\n if (attemptedFirstHFile.compareAndSet(false, true)) {\n assertTrue(fs.delete(p, true)); // make sure delete happened.\n }\n super.checkHFile(p);\n }\n };\n }\n };\n doQuarantineTest(table, hbck, 4, 0, 0, 0, 1); // 4 attempted, but 1 missing.\n hbck.close();\n }", "@Override\r\n\tpublic void delete(TQssql sql) {\n\r\n\t}", "@Override\n\tpublic String deleteStatement() throws Exception {\n\t\treturn null;\n\t}", "@Test\n public void deleteBono() {\n BonoEntity entity = data.get(0);\n bonoLogic.deleteBono(entity.getId());\n BonoEntity deleted = em.find(BonoEntity.class, entity.getId());\n Assert.assertNull(deleted);\n }", "List<FileEntity> findBySizeIsNullAndAddingDateIsNotNull();", "@Override\n \t\t\t\tpublic boolean isDeleted() {\n \t\t\t\t\treturn false;\n \t\t\t\t}", "@Override\n\t\tprotected void deleteRelations(EspStatusDTO espStatusDTO) throws SQLException {\n\t\t\t\n\t\t}", "ArrayMap<Integer,DefinedProperty> relDelete( long relId );", "@Override\n public String deleteStatement() throws Exception {\n return null;\n }", "@Override\r\n\tpublic void delete(Plate entity) {\n\t\t\r\n\t}", "int deleteByPrimaryKey(Integer fileId);", "private boolean limpiarTablaDocs(Table t)\n\t{\n\t\tt.removeAll(); //borra todo?\n\t\treturn true;\n\t}", "@Test\n public void deleteEspecieTest() throws BusinessLogicException {\n EspecieEntity entity = especieData.get(1);\n System.out.println(entity.getId());\n System.out.println(entity.getRazas().size());\n especieLogic.deleteEspecie(entity.getId());\n EspecieEntity deleted = em.find(EspecieEntity.class, entity.getId());\n Assert.assertTrue(deleted.getDeleted());\n }", "public static long removeQuads(NodeCentricOperationContext context, String tableName, boolean revisioned, Long timestamp, Resource[] subject, URI[] predicate, Value[] object, URI[] namedGraphUri) throws AnzoException {\n try {\n ArrayList<Long> subjectIds = null;\n ArrayList<Long> predicateIds = null;\n ArrayList<Long> objectIds = null;\n ArrayList<Long> namedGraphIds = null;\n try {\n if (subject != null && subject.length > 0) {\n if (subject.length > 1 || subject[0] != null) {\n subjectIds = new ArrayList<Long>();\n for (Resource subj : subject) {\n Long id = context.getNodeLayout().fetchId(subj, context.getConnection());\n if (id == null && subject.length == 1) {\n return 0; // required node is not even in db\n } else {\n subjectIds.add(id);\n }\n }\n if (subjectIds.size() == 0) {\n return 0; // required node is not even in db\n }\n if (subjectIds.size() >= 100) {\n insertIdsToTempTable(context, SUBJECT_TEMP, subjectIds);\n }\n }\n }\n if (predicate != null && predicate.length > 0) {\n if (predicate.length > 1 || predicate[0] != null) {\n predicateIds = new ArrayList<Long>();\n for (URI pred : predicate) {\n Long id = context.getNodeLayout().fetchId(pred, context.getConnection());\n if (id == null && predicate.length == 1) {\n return 0; // required node is not even in db\n } else {\n predicateIds.add(id);\n }\n }\n if (predicateIds.size() == 0) {\n return 0; // required node is not even in db\n }\n if (predicateIds.size() >= 100) {\n insertIdsToTempTable(context, PREDICATE_TEMP, predicateIds);\n }\n }\n }\n if (object != null && object.length > 0) {\n if (object.length > 1 || object[0] != null) {\n objectIds = new ArrayList<Long>();\n for (Value obj : object) {\n Long id = context.getNodeLayout().fetchId(obj, context.getConnection());\n if (id == null && object.length == 1) {\n return 0; // required node is not even in db\n } else {\n objectIds.add(id);\n }\n }\n if (objectIds.size() == 0) {\n return 0; // required node is not even in db\n }\n if (objectIds.size() >= 100) {\n insertIdsToTempTable(context, OBJECT_TEMP, objectIds);\n }\n }\n }\n if (namedGraphUri != null && namedGraphUri.length > 0) {\n if (namedGraphUri.length > 1 || namedGraphUri[0] != null) {\n namedGraphIds = new ArrayList<Long>();\n for (URI ngURI : namedGraphUri) {\n Long id = context.getNodeLayout().fetchId(ngURI, context.getConnection());\n if (id == null && namedGraphUri.length == 1) {\n return 0; // required node is not even in db\n } else {\n namedGraphIds.add(id);\n }\n }\n if (namedGraphIds.size() == 0) {\n return 0; // required node is not even in db\n }\n if (namedGraphIds.size() >= 100) {\n insertIdsToTempTable(context, NAMEDGRAPH_TEMP, namedGraphIds);\n }\n }\n }\n String sql = generateSQLStatement(context, tableName, revisioned, timestamp, subjectIds, predicateIds, objectIds, namedGraphIds);\n Statement stmt = context.getConnection().createStatement();\n try {\n return stmt.executeUpdate(sql);\n } finally {\n stmt.close();\n }\n } finally {\n try {\n if (subjectIds != null && subjectIds.size() >= 100) {\n BaseSQL.clearTableWithSessionPrefix(context.getStatementProvider(), context.getConnection(), context.getConfiguration().getSessionPrefix(), SUBJECT_TEMP);\n }\n if (predicateIds != null && predicateIds.size() >= 100) {\n BaseSQL.clearTableWithSessionPrefix(context.getStatementProvider(), context.getConnection(), context.getConfiguration().getSessionPrefix(), PREDICATE_TEMP);\n }\n if (objectIds != null && objectIds.size() >= 100) {\n BaseSQL.clearTableWithSessionPrefix(context.getStatementProvider(), context.getConnection(), context.getConfiguration().getSessionPrefix(), OBJECT_TEMP);\n }\n if (namedGraphIds != null && namedGraphIds.size() >= 100) {\n BaseSQL.clearTableWithSessionPrefix(context.getStatementProvider(), context.getConnection(), context.getConfiguration().getSessionPrefix(), NAMEDGRAPH_TEMP);\n }\n } catch (RdbException e) {\n logger.error(LogUtils.RDB_MARKER, \"Error clearing temporary tables\", e);\n }\n }\n } catch (SQLException e) {\n throw new AnzoException(ExceptionConstants.RDB.FAILED_EXECUTING_SQL, e);\n }\n }", "@Override\n public void delete(SideDishEntity entity) {\n\n }", "@Override\n\tpublic void delete(MedioPago entidad) {\n\t\t\n\t}", "@Transactional\n\t@Override\n\tpublic String delete(Detail t) {\n\t\treturn null;\n\t}", "@Test\n public void testDeleteNegativeBillIsNull() throws Exception{\n String name = null;\n itemDao.delete(name);\n }", "@Test\n public void delete() {\n try{\n repo.save(s);\n repot.save(t);\n repon.save(n);\n Tema t2 = new Tema(2, 0, 6, \"GUI\");\n Student s2 = new Student(2,221, \"Pop Ion\",\"[email protected]\",\"prof\");\n Nota n2 = new Nota(2,2,\"prof\", 3, \"cv\");\n repo.save(s2);\n repot.save(t2);\n repon.save(n2);\n repot.delete(2);\n repo.delete(2);\n repon.delete(\"22\");\n assert repo.size() == 1;\n assert repot.size() == 1;\n assert repon.size() == 1;\n }\n catch (ValidationException e){\n }\n }", "private void deleteFieldRows(Connection con,\n IdentifiedRecordTemplate template) throws SQLException {\n PreparedStatement delete = null;\n \n try {\n int internalId = template.getInternalId();\n \n delete = con.prepareStatement(DELETE_TEMPLATE_RECORDS_FIELDS);\n delete.setInt(1, internalId);\n delete.execute();\n } finally {\n DBUtil.close(delete);\n }\n }", "boolean hasDeleteFile();", "public Builder clearForceDeleteNull() {\n \n forceDeleteNull_ = false;\n onChanged();\n return this;\n }", "public void deleteTableRecords()\n {\n coronaRepository.deleteAll();\n }", "@Override\n\tpublic String deleteBatch() throws Exception {\n\t\treturn null;\n\t}", "@Test\n public void testDeleteReference() throws Exception {\n final AtlasEntity dbEntity = TestUtilsV2.createDBEntity();\n\n init();\n EntityMutationResponse dbCreationResponse = entityStore.createOrUpdate(new AtlasEntityStream(dbEntity), false);\n\n final AtlasEntity tableEntity = TestUtilsV2.createTableEntity(dbEntity);\n final AtlasEntity columnEntity = TestUtilsV2.createColumnEntity(tableEntity);\n tableEntity.setAttribute(COLUMNS_ATTR_NAME, Arrays.asList(AtlasTypeUtil.getAtlasObjectId(columnEntity)));\n\n AtlasEntity.AtlasEntityWithExtInfo input = new AtlasEntity.AtlasEntityWithExtInfo(tableEntity);\n input.addReferredEntity(columnEntity);\n\n init();\n EntityMutationResponse tblCreationResponse = entityStore.createOrUpdate(new AtlasEntityStream(input), false);\n final AtlasEntityHeader columnCreated = tblCreationResponse.getFirstCreatedEntityByTypeName(COLUMN_TYPE);\n final AtlasEntityHeader tableCreated = tblCreationResponse.getFirstCreatedEntityByTypeName(TABLE_TYPE);\n\n init();\n EntityMutationResponse deletionResponse = entityStore.deleteById(columnCreated.getGuid());\n assertEquals(deletionResponse.getDeletedEntities().size(), 1);\n assertEquals(deletionResponse.getDeletedEntities().get(0).getGuid(), columnCreated.getGuid());\n assertEquals(deletionResponse.getUpdatedEntities().size(), 1);\n assertEquals(deletionResponse.getUpdatedEntities().get(0).getGuid(), tableCreated.getGuid());\n\n assertEntityDeleted(columnCreated.getGuid());\n\n assertColumnForTestDeleteReference(entityStore.getById(tableCreated.getGuid()));\n\n //Deleting table should update process\n AtlasEntity process = TestUtilsV2.createProcessEntity(null, Arrays.asList(AtlasTypeUtil.getAtlasObjectId(tableCreated)));\n init();\n final EntityMutationResponse processCreationResponse = entityStore.createOrUpdate(new AtlasEntityStream(process), false);\n\n init();\n entityStore.deleteById(tableCreated.getGuid());\n assertEntityDeleted(tableCreated.getGuid());\n\n assertTableForTestDeleteReference(tableCreated.getGuid());\n assertProcessForTestDeleteReference(processCreationResponse.getFirstEntityCreated());\n }", "@Override\n\tpublic void delete(Translator entity) {\n\t\t\n\t}" ]
[ "0.534569", "0.52749735", "0.5262316", "0.52498096", "0.52443844", "0.52227706", "0.5174608", "0.5161461", "0.5104213", "0.5100908", "0.5073581", "0.50029105", "0.49771118", "0.49635103", "0.49566618", "0.4917879", "0.48915514", "0.48864272", "0.48738977", "0.48689118", "0.4855436", "0.48491466", "0.48207617", "0.4811241", "0.47957432", "0.47858447", "0.47812545", "0.47751546", "0.47734883", "0.47584552", "0.47391984", "0.4734833", "0.47277886", "0.47127253", "0.47086683", "0.47038886", "0.4685207", "0.46829465", "0.4681626", "0.46751624", "0.46736306", "0.46711448", "0.46680543", "0.4665186", "0.4648472", "0.4638322", "0.4638233", "0.46360227", "0.46326956", "0.46296814", "0.46286708", "0.46238744", "0.46232235", "0.46227208", "0.4617426", "0.4616207", "0.46092883", "0.46065307", "0.4605639", "0.46045434", "0.45965225", "0.45908153", "0.45897788", "0.4587122", "0.45862827", "0.45862183", "0.45793617", "0.45669788", "0.45664382", "0.45659247", "0.4565873", "0.4562099", "0.45597792", "0.45577574", "0.4557096", "0.45557705", "0.4555253", "0.4554848", "0.45533377", "0.4550711", "0.45489666", "0.45396727", "0.45352384", "0.45335197", "0.453276", "0.45321748", "0.45305243", "0.45276707", "0.45256266", "0.45248103", "0.45130944", "0.45060733", "0.45055026", "0.45032975", "0.45017692", "0.45011964", "0.45002756", "0.44925335", "0.44919285", "0.44909364" ]
0.53296584
1
accessor methods package methods protected methods private methods
private void initializeComponents() throws Exception { // get locale. DfkUserInfo ui = (DfkUserInfo)getUserInfo(); Locale locale = httpRequest.getLocale(); // initialize pul_Area. _pdm_pul_Area = new WmsAreaPullDownModel(pul_Area, locale, ui); // initialize pul_WorkFlag. _pdm_pul_WorkFlag = new DefaultPullDownModel(pul_WorkFlag, locale, ui); // initialize pager control. _pager = new PagerModel(new Pager[]{pgr_U, pgr_D}, locale); // initialize lst_StorageRetrievalResultList. _lcm_lst_StorageRetrievalResultList = new ListCellModel(lst_StorageRetrievalResultList, LST_STORAGERETRIEVALRESULTLIST_KEYS, locale); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_REGIST_DATE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_REGIST_TIME, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_ITEM_CODE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_ITEM_NAME, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_LOT_NO, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_INC_DEC_TYPE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_JOB_TYPE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_AREA_NO, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_LOCATION_NO, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_INC_DEC_QTY, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_STORAGE_DATE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_STORAGE_TIME, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_USER_NAME, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "private Get() {}", "private Get() {}", "protected abstract MethodDescription accessorMethod();", "@Override\n public void get() {}", "private stendhal() {\n\t}", "private PropertyAccess() {\n\t\tsuper();\n\t}", "public void get() {\n }", "@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}", "@Override\n\tprotected void GetDataFromNative() {\n\t\t\n\t}", "@Override\n\tpublic void getData() {\n\t\t\n\t}", "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "public interface DataAccessor {\n}", "final void getData() {\n\t\t//The final method can't be overriden\n\t}", "public abstract IAccessor getAccessor(IContext context);", "public void GetDataBaseData() {\n }", "private MApi() {}", "private AccessorModels() {\n // Private constructor to prevent instantiation\n }", "@Override\n protected void getExras() {\n }", "protected Doodler() {\n\t}", "protected abstract void retrievedata();", "protected abstract Set method_1559();", "protected abstract Actor getAccessor();", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "Object getData() { /* package access */\n\t\treturn data;\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n protected void prot() {\n }", "public interface DataAccessor extends Comparable {\r\n\t\r\n /**\r\n * Reads binary <i>ScecVideo</i> object data from a file.\r\n * \r\n * @return whether operation was successful\r\n */\r\n public boolean readDataFile();\r\n \r\n /**\r\n * Writes binary <i>ScecVideo</i> object data to object library.\r\n * \r\n * @return whether operation was successful\r\n */\r\n public boolean writeDataFile();\r\n \r\n /**\r\n * Reads <i>ScecVideo</i> object attribute data from a file.\r\n * \r\n * @param file to read from\r\n * @return whether operation was successful\r\n */\r\n public boolean readAttributeFile(File file);\r\n \r\n /**\r\n * Writes <i>ScecVideo</i> object attribute data to a file.\r\n * \r\n * @return whether operation was successful\r\n */\r\n public boolean writeAttributeFile();\r\n\r\n /**\r\n * Specifies if a <i>ScecVideo</i> object's data arrays and Java3D graphic\r\n * representations should be filled or cleared.\r\n * \r\n * @param load whether to load or clear data arrays\r\n */\r\n public void setInMemory(boolean load);\r\n \r\n /**\r\n * Returns whether a <i>ScecVideo</i> object's data arrays and Java3D graphic\r\n * representations are loaded or not.\r\n * \r\n * @return whether data loaded or not\r\n */\r\n public boolean isInMemory();\r\n \r\n /**\r\n * Specifies whether a <i>ScecVideo</i> object should be visible or not.\r\n * \r\n * @param show whether to show or hide an object\r\n */\r\n public void setDisplayed(boolean show);\r\n \r\n /**\r\n * Returns if this <i>ScecVideo</i> object is displayed\r\n * \r\n * @return whether visible or hidden\r\n */\r\n public boolean isDisplayed();\r\n \r\n /**\r\n * Returns the display name (not actual file name, although the two may be\r\n * similar) of a <i>ScecVideo</i> object.\r\n * \r\n * @return the object's name\r\n */\r\n public String getDisplayName();\r\n\r\n /**\r\n * Sets the name of this <i>ScecVideo</i> object as it will be displayed in any GUIs.\r\n * \r\n * @param name to set\r\n */\r\n public void setDisplayName(String name);\r\n \r\n /**\r\n * Returns a reference to a <i>ScecVideo</i> object's attribute file. An object's\r\n * attribute file is unique and can be used to test for equality of two objects.\r\n * \r\n * @return attribute file reference\r\n */\r\n public File getAttributeFile();\r\n \r\n /**\r\n * Returns a library-relative path to an object's attribute file.\r\n * \r\n * @return attribute file path\r\n */\r\n public String getAttributeFileLibPath();\r\n \r\n /**\r\n * Returns a reference to a <i>ScecVideo</i> object's data file.\r\n * \r\n * @return data file reference\r\n */\r\n public File getDataFile();\r\n\r\n /**\r\n * Returns the citation-style reference for this <i>ScecVideo</i> object.\r\n * \r\n * @return the object's citation\r\n */\r\n public String getCitation();\r\n \r\n /**\r\n * Sets the citation-style reference of this <i>ScecVideo</i> object.\r\n * \r\n * @param citation to set\r\n */\r\n public void setCitation(String citation);\r\n \r\n /**\r\n * Returns the full reference of this <i>ScecVideo</i> object.\r\n * \r\n * @return the object's reference\r\n */\r\n public String getReference();\r\n\r\n /**\r\n * Sets the full reference of this <i>ScecVideo</i> object.\r\n * \r\n * @param reference to set\r\n */\r\n public void setReference(String reference);\r\n \r\n /**\r\n * Returns any additional notes or comments about this <i>ScecVideo</i> object.\r\n * \r\n * @return the object's notes\r\n */\r\n public String getNotes();\r\n \r\n /**\r\n * Sets any additional notes or comments about this <i>ScecVideo</i> object.\r\n * \r\n * @param notes to set\r\n */\r\n public void setNotes(String notes);\r\n\r\n /**\r\n * Returns whether this object is equivalent to another. Implementors should\r\n * be able to compare <i>ScecVideo</i> data objects as well as files.\r\n * \r\n * @param object\r\n * @return whether objects are equal (have same source)\r\n */\r\n public boolean equals(Object object);\r\n}", "@Override\n\tpublic RacingBike get() {\n\t\tSystem.out.println(\"Inside get method of provider class!!!\");\n\t\treturn new ApacheRR310();\n\t}", "private ReadProperty()\r\n {\r\n\r\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public abstract Object getData();", "@Override\n void init() {\n }", "public abstract Object getCustomData();", "@Override\n\tprotected void getDataFromUCF() {\n\n\t}", "private ContainerElementAccessor() {\n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "protected MetadataUGWD() {/* intentionally empty block */}", "private RefereesInLeagueDBAccess() {\n\n }", "private Dex2JarProxy() {\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n protected void init() {\n }", "public MusicDataAccessor() {\n\t\n\t\t// load the data into the table\n\t\tload();\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private ChainingMethods() {\n // private constructor\n\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "abstract public Object getUserData();", "private FundInfo() {\n initFields();\n }", "public abstract Object mo1771a();", "public int somemethod(){\n return this.data;\n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n }", "private TigerData() {\n initFields();\n }", "private Response() {\n initFields();\n }", "private String getSomePrivateInfo() {\r\n \treturn \"private information of MySubject\";\r\n }", "@Override // Métodos que fazem a anulação\n\tpublic void getBonificação() {\n\t\t\n\t}", "protected Provider() {}", "private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}", "public abstract Member mo23408O();", "private MetallicityUtils() {\n\t\t\n\t}", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "protected int somemethod2(){\n return this.data;\n }", "private ProcessedDynamicData( ) {\r\n super();\r\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "T getData() {\n return this.data;\n }", "protected Player getPlayer() { return player; }", "private TMCourse() {\n\t}", "protected Object doGetValue() {\n\t\treturn value;\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "protected void _init(){}", "public String getNombre()\r\n/* 113: */ {\r\n/* 114:204 */ return this.nombre;\r\n/* 115: */ }", "protected UserWordData() {\n\n\t}", "private Mgr(){\r\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "shared.data.Bank getBank();", "public String getNombre()\r\n/* 60: */ {\r\n/* 61: 67 */ return this.nombre;\r\n/* 62: */ }", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "public ModelAccessException() {\n\t\tsuper();\n\n\t}", "private void readObject() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }" ]
[ "0.64094245", "0.6400707", "0.63424176", "0.63424176", "0.6269189", "0.6267352", "0.6205872", "0.6133806", "0.6047557", "0.6042094", "0.6042094", "0.60241544", "0.6018622", "0.600183", "0.59663707", "0.592365", "0.59089446", "0.5888522", "0.5887451", "0.5879395", "0.585674", "0.58311796", "0.5820117", "0.5818173", "0.57949036", "0.576344", "0.57599145", "0.57546186", "0.5690854", "0.567608", "0.5669342", "0.5655799", "0.5641658", "0.56404036", "0.5639257", "0.5630306", "0.562293", "0.5620752", "0.56202173", "0.5610491", "0.5595609", "0.55938107", "0.55938107", "0.55834556", "0.55834556", "0.5574607", "0.5571442", "0.5569834", "0.55673486", "0.55557823", "0.5553853", "0.5553853", "0.5553853", "0.5553853", "0.5553853", "0.5553853", "0.5549703", "0.5548842", "0.5548842", "0.55380386", "0.55366987", "0.5530754", "0.5527439", "0.55266964", "0.5521314", "0.5520243", "0.55182517", "0.5516392", "0.5513688", "0.5510693", "0.55103076", "0.5507535", "0.5501629", "0.5499213", "0.549815", "0.54953086", "0.54806376", "0.54638916", "0.54577625", "0.5457464", "0.54542595", "0.5448902", "0.5447259", "0.5447259", "0.5447259", "0.5447259", "0.5447259", "0.5447259", "0.54463494", "0.5446027", "0.54442346", "0.54438496", "0.5442659", "0.5441036", "0.5434549", "0.54256195", "0.54218346", "0.54214555", "0.54196835", "0.54196835", "0.5419009" ]
0.0
-1
utility methods Returns current repository info for this class
public static String getVersion() { return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Repository getRepository();", "public String getRepository() {\n return repository;\n }", "public String getRepository() {\n return repository;\n }", "public String getLocalRepository() {\r\n return localRepository;\r\n }", "public Repository getRepository() {\n return mRepository;\n }", "RepositoryPackage getRepositoryPackage();", "public @Nullable String getRepositoryDescription() {\n return this.repositoryDescription;\n }", "public File getRepo() {\n return _repo;\n }", "static Repo getInstance() {\n return RepoSingelton.getRepo(); //todo: refactor\n }", "Git getGit();", "public String getRepositoryName() {\n return this.repositoryName;\n }", "String getRepoType();", "String getRepositoryPath();", "ArtifactRepository getRepository();", "RepositoryConfiguration getRepositoryConfiguration();", "public String getRepoURL() {\n return repoURL;\n }", "protected SVNRepository getRepository() {\n\t\treturn repository;\n\t}", "public String getClientRepository() {\r\n return clientRepository;\r\n }", "protected SlingRepository getRepository() {\n return repository;\n }", "public String getImageRepositoryType() {\n return this.imageRepositoryType;\n }", "public static SubmissionRepository current() {\n return theRepository;\n }", "public @Nullable String getRepositoryName() {\n return this.repositoryName;\n }", "public ProjectInfo getProjectInfo()\n {\n\treturn c_projectInfo;\n }", "String getRepositoryName(URL repositoryUrl);", "String repoUrl();", "public String getBaseRepositoryUrl() {\n\t\treturn baseRepositoryUrl;\n\t}", "@Override\n\tprotected IGenericRepo<Estudiante, Integer> getRepo() {\n\t\treturn repo;\n\t}", "String getSourceRepoUrl();", "public interface IRepo {\r\n\t//current state of the repository\r\n\tPrgState getCurrentState() throws RepoException;\r\n\t\r\n\t//writes log of execution to log file\r\n\tvoid logPrgStateExec() throws FileNotFoundException, IOException;\r\n}", "public interface Repository {\n public void addPrg(PrgState prg);\n public List<PrgState> getAll();\n public void setAll(List<PrgState> _newPrgs);\n public void removeCurrent();\n public void logPrgStateExec() throws FileNotFoundException, UnsupportedEncodingException;\n public void logPrgStateExec(PrgState p) throws FileNotFoundException;\n public void serialize(PrgState prgState,String fname);\n public PrgState deserialize(String fname);\n PrgState getCurrent();\n}", "public String getRepos() {\n return repos;\n }", "public static RepoInfo repoInfo(String fileName, Project project) {\n String fileRel = \"\";\n String remoteURL = \"\";\n String branch = \"\";\n try{\n // Determine repository root directory.\n String fileDir = fileName.substring(0, fileName.lastIndexOf(\"/\"));\n String repoRoot = gitRootDir(fileDir);\n\n // Determine file path, relative to repository root.\n fileRel = fileName.substring(repoRoot.length()+1);\n remoteURL = configuredGitRemoteURL(repoRoot);\n branch = SourcegraphUtil.setDefaultBranch(project)!=null ? SourcegraphUtil.setDefaultBranch(project) : gitBranch(repoRoot);\n\n // If on a branch that does not exist on the remote and no defaultBranch is configured\n // use \"master\" instead.\n // This allows users to check out a branch that does not exist in origin remote by setting defaultBranch\n if (!isRemoteBranch(branch, repoRoot) && SourcegraphUtil.setDefaultBranch(project)==null) {\n branch = \"master\";\n }\n\n // replace remoteURL if config option is not null\n String r = SourcegraphUtil.setRemoteUrlReplacements(project);\n if(r!=null) {\n String[] replacements = r.trim().split(\"\\\\s*,\\\\s*\");\n // Check if the entered values are pairs\n for (int i = 0; i < replacements.length && replacements.length % 2 == 0; i += 2) {\n remoteURL = remoteURL.replace(replacements[i], replacements[i+1]);\n }\n }\n } catch (Exception err) {\n Logger.getInstance(SourcegraphUtil.class).info(err);\n err.printStackTrace();\n }\n return new RepoInfo(fileRel, remoteURL, branch);\n }", "public Gitlet getMyGit(){\n\t\treturn myGit;\n\t}", "public Path getRepositoryBaseDir();", "String getRepositoryPath(String name);", "public RepositoryManager getRepositoryManager() {\n return repositoryManager;\n }", "synchronized Repository getRepository(String name) {\n\t\treturn repositoryMap.get(name);\n\t}", "private Repository getAccountsRepository()\r\n {\r\n RepositoryBuilder repoBuilder = new RepositoryBuilder(\"optionalModules\", \"accounts\", LicenseType.APACHE_LICENSE, BranchType.TRUNK);\r\n return repoBuilder.buildRepository();\r\n }", "public String getRepositoryFileName() {\n return repositoryFileName;\n }", "@Nullable\n public String getRepositoryType() {\n return myRepoType;\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getRepositoryName() != null)\n sb.append(\"RepositoryName: \").append(getRepositoryName()).append(\",\");\n if (getCommitSpecifier() != null)\n sb.append(\"CommitSpecifier: \").append(getCommitSpecifier()).append(\",\");\n if (getFilePath() != null)\n sb.append(\"FilePath: \").append(getFilePath());\n sb.append(\"}\");\n return sb.toString();\n }", "private RepositorySystem getRepositorySystem() {\n\t\tDefaultServiceLocator locator = MavenRepositorySystemUtils\n\t\t\t\t.newServiceLocator();\n\t\tlocator.addService(RepositoryConnectorFactory.class,\n\t\t\t\tBasicRepositoryConnectorFactory.class);\n\t\tlocator.addService(TransporterFactory.class,\n\t\t\t\tFileTransporterFactory.class);\n\t\tlocator.addService(TransporterFactory.class,\n\t\t\t\tHttpTransporterFactory.class);\n\n\t\tlocator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {\n\t\t\t@Override\n\t\t\tpublic void serviceCreationFailed(Class<?> type, Class<?> impl,\n\t\t\t\t\tThrowable exception) {\n\t\t\t\texception.printStackTrace();\n\t\t\t}\n\t\t});\n\n\t\tRepositorySystem system = locator.getService(RepositorySystem.class);\n\t\treturn system;\n\t}", "PrgState getCurrentState() throws RepoException;", "public String getRepoUrl() {\n return \"ssh://git@\" + host() + \":\" + port() + REPO_DIR;\n }", "public Class<?> getRepositoryInterface() {\n return repositoryInterface;\n }", "public interface Repository {\n\n }", "public interface Repository {\n\n }", "public Path getRemoteRepositoryBaseDir();", "public VersionInfo getCurrentInfo() {\n return myVersionInfo;\n }", "static RepositoryConnection getRepositoryConnection(Repository rep)\n {\n RepositoryConnection connection = null;\n \n try\n {\n connection = rep.getConnection();\n }\n catch (RepositoryException e)\n {\n System.err.println(\"Could not obtain repository connection!\");\n System.exit(1);\n }\n \n return connection;\n }", "String getDockerRepositoryName();", "public AccountRepository getAccountRepository() {\n\t\treturn this.accountRepository;\n\t}", "public interface Repo {\n /**\n * Gets the url property: The url to access the repository.\n *\n * @return the url value.\n */\n String url();\n\n /**\n * Gets the fullName property: The name of the repository.\n *\n * @return the fullName value.\n */\n String fullName();\n\n /**\n * Gets the branches property: Array of branches.\n *\n * @return the branches value.\n */\n List<String> branches();\n\n /**\n * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.RepoInner object.\n *\n * @return the inner object.\n */\n RepoInner innerModel();\n}", "public BaseInfo getBaseInfo() {\n return baseInfo;\n }", "public List<String> getRepoNames() throws MetaStoreException {\n return gitSpoonMenuController.getRepoNames();\n }", "Information getInfo();", "public GitRemote getRemote() { return getRemote(\"origin\"); }", "public String getRepositoryPath() \n {\n return \"/atg/portal/gear/discussion/DiscussionRepository\";\n }", "@Override\n public GeneralRepositoryConfig getGeneralRepositoryConfig(){\n outObject = \"getGeneralRepositoryConfig\";\n try {\n out.writeObject(outObject);\n } catch (IOException ex) {\n }\n try {\n inObject = (GeneralRepositoryConfig) in.readObject();\n } catch (IOException | ClassNotFoundException ex) {\n }\n return (GeneralRepositoryConfig) inObject;\n }", "String getRepositoryUUID();", "private RepositoryService getRepositoryService() {\n\t\tif (repositoryService == null && getServletContext() != null) {\n\t\t\tthis.repositoryService = (RepositoryService) getServletContext().getAttribute(\"repositoryService\");\n\t\t}\n\t\treturn this.repositoryService;\n\t}", "TRepo createRepo();", "public String getLastDocRepository() {\n return \"\";\n }", "public interface Repository {}", "public static String getRepositoryName(@NotNull JSONObject jsonObject) {\n return jsonObject.getJSONObject(\"repository\").get(\"name\").toString();\n }", "public interface ProductInfoRepository {\n}", "private String getCodeRepo() throws Exception {\n\t\tObject[] options = { \"Local Git Repository\", \"Github URI\" };\n\n\t\tJFrame frame = new JFrame();\n\t\tint selection = JOptionPane.showOptionDialog(frame,\n\t\t\t\t\"Please select your type of codebase\", \"GalacticTBA\",\n\t\t\t\tJOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,\n\t\t\t\toptions, options[0]);\n\n\t\tif (selection == 1) {\n\t\t\tfolderName = \"cpsc410_\" + new Date().getTime();\n\t\t\tString baseDir = getCodeRoot(true);\n\n\t\t\tString githubURI = (String) JOptionPane.showInputDialog(frame,\n\t\t\t\t\t\"Galactic TBA:\\n\" + \"Please enter Github URI\",\n\t\t\t\t\t\"Galactic TBA\", JOptionPane.PLAIN_MESSAGE, null, null,\n\t\t\t\t\tnull);\n\n\t\t\tString dir = System.getProperty(\"user.dir\");\n\t\t\tProcess p;\n\t\t\tif (isOSWindows) {\n\t\t\t\tp = Runtime.getRuntime().exec(\n\t\t\t\t\t\t\"cmd /C \" + dir + \"\\\\scripts\\\\gitclone.sh \" + githubURI\n\t\t\t\t\t\t\t\t+ \" \" + baseDir + \"\\\\\" + folderName);\n\t\t\t} else {\n\t\t\t\tp = Runtime.getRuntime().exec(\n\t\t\t\t\t\tdir + \"/scripts/gitclone.sh \" + folderName + \"/\"\n\t\t\t\t\t\t\t\t+ baseDir);\n\t\t\t}\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tp.getInputStream()));\n\n\t\t\twhile (in.readLine() != null) {\n\t\t\t\tThread.sleep(1000);\n\t\t\t}\n\t\t\tin.close();\n\t\t\treturn baseDir + \"\\\\\" + folderName;\n\t\t} else if (selection != 0) {\n\t\t\tSystem.exit(0);\n\t\t}\n\n\t\treturn getCodeRoot(false);\n\t}", "public interface INewsInfoRepository {\n}", "String getOwner();", "String getOwner();", "public String getOwner();", "public abstract RepoDao getRepoDao();", "public String getRepositoryDatabaseUsername(){\n \t\treturn getProperty(\"org.sagebionetworks.repository.database.username\");\n \t}", "@Override\n\tpublic GenericRepository<Consulta, Long> getRepository() {\n\t\treturn this.consultaRepository;\n\t}", "public abstract KenaiProject getKenaiProjectForRepository(String repositoryUrl) throws IOException;", "public List<Repo> getRepos() {\n return repos;\n }", "AutoCommittalRepositoryManager getAutoCommittalRepositoryManager();", "@Override\r\n public void read() {\n System.out.println('\\n' + \"DB repo: \");\r\n //Idk, probably search for a person and read data??\r\n\r\n }", "protected NotificationInfo getNotificationInfo() {\n List<NotificationInfo> list = notificationService.storeDigestJCR();\n assertTrue(list.size() > 0);\n return list.get(0);\n }", "private String getRepositoryPath() {\n if (repoPath != null) {\n return repoPath;\n }\n\n final String pathProp = System.getProperty(SYSTEM_PATH_PROPERTY);\n\n if (pathProp == null || pathProp.isEmpty()) {\n repoPath = getWorkingDirectory();\n } else if (pathProp.charAt(0) == '.') {\n // relative path\n repoPath = getWorkingDirectory() + System.getProperty(\"file.separator\") + pathProp;\n } else {\n repoPath = RepoUtils.stripFileProtocol(pathProp);\n }\n\n log.info(\"Using repository path: \" + repoPath);\n return repoPath;\n }", "public interface GitClient {\n\n\t/**\n\t * Instances of the GitClient that are identified by the path of the git\n\t * repository.\n\t */\n\tpublic Map<IPath, GitClient> instances = new HashMap<IPath, GitClient>();\n\n\t/**\n\t * Retrieves an existing GitClient instance or creates a new instance if there\n\t * is no instance for the given path yet.\n\t * \n\t * @return GitClient instance.\n\t */\n\tpublic static GitClient getOrCreate() {\n\t\tIPath path = ConfigPersistenceManager.getPathToGit();\n\t\tString reference = ConfigPersistenceManager.getBranch();\n\t\tString projectKey = ConfigPersistenceManager.getProjectKey();\n\t\treturn getOrCreate(path, reference, projectKey);\n\t}\n\n\t/**\n\t * Retrieves an existing GitClient instance or creates a new instance if there\n\t * is no instance for the given path yet.\n\t * \n\t * @param path\n\t * to the .git folder.\n\t * @param reference\n\t * git object identifier, e.g., HEAD, refs/heads/master or commit id.\n\t * @param projectKey\n\t * of the associated JIRA project.\n\t * @return GitClient instance.\n\t */\n\tpublic static GitClient getOrCreate(IPath path, String reference, String projectKey) {\n\t\tif (instances.containsKey(path)) {\n\t\t\treturn instances.get(path);\n\t\t}\n\t\tGitClient gitClient = new GitClientImpl(path, reference, projectKey);\n\t\tinstances.put(path, gitClient);\n\t\treturn gitClient;\n\t}\n\n\t/**\n\t * Retrieve the commit message for a given line from a blamed file as a\n\t * RevCommit.\n\t * \n\t * @param filePath\n\t * path to the file to be blamed.\n\t * @param line\n\t * the line that is to be analyzed.\n\t * @return {@link GitCommit} object.\n\t */\n\tGitCommit getCommitForLine(IPath filePath, int line);\n\n\t/**\n\t * Retrieve the commit message for a given line from a blamed file.\n\t * \n\t * @param filePath\n\t * path to the file to be blamed.\n\t * @param line\n\t * the line that is to be analyzed.\n\t * @return commit message.\n\t */\n\tString getCommitMessageForLine(IPath filePath, int line);\n\n\t/**\n\t * Retrieves all commits on the current branch.\n\t * \n\t * @return set of all commits on the current branch as a list of\n\t * {@link GitCommit} objects.\n\t */\n\tList<GitCommit> getCommits();\n\n\t/**\n\t * Retrieve the commits with the JIRA issue key in their commit message.\n\t * \n\t * @param jiraIssueKey\n\t * key for which commits are searched.\n\t * @return commits with the JIRA issue key in their commit message as a list of\n\t * {@link GitCommit} objects.\n\t */\n\tList<GitCommit> getCommitsForJiraIssue(String jiraIssueKey);\n\n\t/**\n\t * Get a map of diff entries and the respective edit lists for a commit.\n\t * \n\t * @param commit\n\t * as a {@link GitCommit} object.\n\t * @return map of diff entries and respective edit lists.\n\t */\n\tMap<DiffEntry, EditList> getDiff(GitCommit commit);\n\n\t/**\n\t * Returns a set of changed files for a commit.\n\t * \n\t * @param commit\n\t * as a {@link GitCommit} object\n\t * @return set of {@link ChangedFile} objects.\n\t */\n\tSet<ChangedFile> getChangedFiles(GitCommit commit);\n\n\t/**\n\t * Returns the jgit git object.\n\t * \n\t * @return jgit git object.\n\t */\n\tGit getGit();\n\n\t/**\n\t * Returns the path to the .git folder.\n\t * \n\t * @return path to the .git folder.\n\t */\n\tIPath getPath();\n\n\t/**\n\t * Show what author and revision last modified each line of a file.\n\t * \n\t * @param filePath\n\t * path to the file to be blamed.\n\t * @return git blame result for the given file.\n\t */\n\tBlameResult getGitBlameForFile(IPath filePath);\n\n\t/**\n\t * Get the parent commit for a given commit.\n\t * \n\t * @param commit\n\t * commit as a {@link GitCommit} object.\n\t * @return parent commit as a {@link GitCommit} object.\n\t */\n\tGitCommit getParent(GitCommit commit);\n\n\t/**\n\t * Gets the git object identifier, e.g., HEAD, refs/heads/master or commit id.\n\t * \n\t * @return git object identifier.\n\t */\n\tString getReference();\n\n\t/**\n\t * Get the jgit repository object.\n\t * \n\t * @return jgit repository object\n\t */\n\tRepository getRepository();\n\n\t/**\n\t * Sets the git object identifier, e.g., HEAD, refs/heads/master or commit id.\n\t * \n\t * @param reference\n\t * git object identifier.\n\t */\n\tvoid setReference(String reference);\n}", "public interface IRepository {\n String getUser();\n}", "public Path getRepositoryGroupBaseDir();", "public String getShRepositoryName() {\n\n\t\treturn shRepositoryName;\n\n\t}", "public DocumentInfo getInfo() {\n return new DocumentInfo(this.uri, this.collaborators.stream().map(User::getName).collect(Collectors.toSet()));\n }", "public synchronized Repository getRepository(String currentUser, String name)\n\t\t\tthrows UserAccessException {\n\n\t\tif (!isAnonymousUser(currentUser)) {\n\t\t\tvalidateUser(currentUser);\n\t\t}\n\n\t\tRepository rep = repositoryMap.get(name);\n\t\tif (rep != null) {\n\t\t\trep.validateReadPrivilege(currentUser);\n\t\t}\n\t\treturn rep;\n\t}", "public Collection<AbstractRepository> getRepositories();", "public Repo() {\n //this.app = Init.application;\n }", "public interface Image {\n /**\n * @return the image ID\n */\n String getId();\n\n /**\n * @return the image ID, or null if not present\n */\n String getParentId();\n\n /**\n * @return Image create timestamp\n */\n long getCreated();\n\n /**\n * @return the image size\n */\n long getSize();\n\n /**\n * @return the image virtual size\n */\n long getVirtualSize();\n\n /**\n * @return the labels assigned to the image\n */\n Map<String, String> getLabels();\n\n /**\n * @return the names associated with the image (formatted as repository:tag)\n */\n List<String> getRepoTags();\n\n /**\n * @return the digests associated with the image (formatted as repository:tag@sha256:digest)\n */\n List<String> getRepoDigests();\n}", "public FSArray getRepositoryRec() {\n if (GEDCOMType_Type.featOkTst && ((GEDCOMType_Type)jcasType).casFeat_repositoryRec == null)\n jcasType.jcas.throwFeatMissing(\"repositoryRec\", \"net.myerichsen.gedcom.GEDCOMType\");\n return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((GEDCOMType_Type)jcasType).casFeatCode_repositoryRec)));}", "public abstract URI[] getKnownRepositories();", "public String getTutRepositoryServerName()\n {\n return tutRepositoryServerName;\n }", "String getInfo();", "public interface IRepositoryService {\n\n /**\n * Returns the path to an artifact with the given identifier.\n *\n * @param identifier artifact identifier\n * @return the path to an artifact with the given identifier.\n */\n Path getArtifact(String identifier);\n\n /**\n * Returns the set of paths to the artifacts that the artifact with the given identifier depends on. If the given\n * artifact has no dependencies, returns an empty set.\n *\n * @param identifier artifact identifier\n * @param transitive if {@code false}, returns the immediate dependencies of the artifact; otherwise, returns all\n * dependencies, including dependencies of dependencies\n * @return the set of paths to the dependent artifacts\n */\n Set<Path> getArtifactDependencies(String identifier, boolean transitive);\n\n}", "public interface ItemInfo extends Info, Comparable<ItemInfo> {\n RepoPath getRepoPath();\n\n boolean isFolder();\n\n /**\n * @return The file/folder name of this item\n * @see org.artifactory.repo.RepoPath#getName()\n */\n String getName();\n\n String getRepoKey();\n\n String getRelPath();\n\n long getCreated();\n\n long getLastModified();\n\n String getModifiedBy();\n\n String getCreatedBy();\n\n long getLastUpdated();\n\n boolean isIdentical(ItemInfo info);\n}", "public abstract StoreInfo getInfo();", "@Override\n public GitRepoStats getRepoStatistics(String userName, String repoName , String type) throws GitException, RepoUserNotFoundException {\n GitRepoStats openPr=new GitRepoStats();\n try {\n responseCount=0;\n //based on the strategy gets the api url\n StrategyContext createGitApi=new StrategyContext (new GitStatisticsApi());\n String url=createGitApi.createAPI(userName,repoName,type);\n //call recessive the pr api with open status by reading the headers rel value\n processPrdDetails(url,true);\n openPr.setCount(responseCount);\n } catch (HttpClientErrorException hce) {\n LOGGER.error(\"GitApiImpl :: getRepoStatistics HttpClientErrorException :: \", hce);\n throw new GitException(VALID_REPO);\n }\n return openPr;\n }", "@NonNull\n RepoPackage getPackage();", "public interface MongoRepositoryConfiguration extends\n\t\t\tSingleRepositoryConfigInformation<SimpleMongoRepositoryConfiguration> {\n\n\t\tString getMongoTemplateRef();\n\n\t\tboolean getCreateQueryIndexes();\n\t}", "public String getTechnicalInfo() {\n \t\tFacesContext ctx = FacesContext.getCurrentInstance();\n \t\t// \"git-Revision: \"\n \t\tStringBuffer sb = new StringBuffer();\n \t\tif (StringUtils.isNotBlank(getVersion())) {\n \t\t\tsb.append(JsfUtil.getResourceText(\"technical.info.version\", ctx));\n \t\t\tsb.append(\": \");\n \t\t\tsb.append(getVersion());\n \t\t}\n \t\tif (StringUtils.isNotBlank(getRevision())) {\n \t\t\tsb.append(\", \");\n \t\t\tsb.append(JsfUtil\n \t\t\t\t\t.getResourceText(\"technical.info.version.git\", ctx));\n \t\t\tsb.append(\": \");\n \t\t\tsb.append(getRevision());\n \t\t}\n \t\tif (StringUtils.isNotBlank(getBuildTime())) {\n \t\t\tsb.append(\", \");\n \t\t\tsb.append(JsfUtil.getResourceText(\"technical.info.build.time\", ctx));\n \t\t\tsb.append(\": \");\n \t\t\tsb.append(getBuildTime());\n \t\t}\n \t\treturn sb.toString();\n \t}", "SourceBuilder createRepository();" ]
[ "0.71555", "0.7154877", "0.7154877", "0.7063313", "0.68738824", "0.6668143", "0.66567254", "0.6614322", "0.6581406", "0.6579891", "0.6554382", "0.6511588", "0.6510712", "0.6489127", "0.6402426", "0.63694924", "0.63687754", "0.6332049", "0.6325409", "0.62988627", "0.62966025", "0.6288679", "0.6265658", "0.62536824", "0.62434083", "0.6210992", "0.6206819", "0.6182215", "0.6167253", "0.61395055", "0.61391425", "0.60938317", "0.60854405", "0.6074356", "0.6064593", "0.60588217", "0.6034737", "0.6028106", "0.60194826", "0.59921527", "0.5990115", "0.59786296", "0.5959592", "0.5925061", "0.59168595", "0.5914389", "0.5914389", "0.59034276", "0.5900285", "0.5885179", "0.58804315", "0.5837916", "0.583574", "0.5829736", "0.582746", "0.58197224", "0.58152676", "0.58139956", "0.5798184", "0.57564676", "0.5754222", "0.5753515", "0.57534266", "0.57527095", "0.57522386", "0.5752139", "0.57483244", "0.57464975", "0.5712925", "0.5712925", "0.5705661", "0.56851447", "0.5675643", "0.5667212", "0.56637305", "0.5639125", "0.5630218", "0.5619911", "0.5599691", "0.5595541", "0.5584646", "0.557695", "0.55742896", "0.5563351", "0.5548154", "0.54868287", "0.5483142", "0.54625005", "0.5462347", "0.54615676", "0.5458754", "0.5458049", "0.5450024", "0.5445182", "0.5439334", "0.5428126", "0.54202074", "0.54176706", "0.541366", "0.5411307", "0.54000556" ]
0.0
-1
Este metodo compara los RUT ingresados con los RUT registrados de los clientes. Si el RUT coincide se devuelve un boolean true, si no coincide con ningun RUT se retorna un false.
public boolean compararRut(String dato1, SisCliente sCliente){ for(int i=0; i<sCliente.listaClientes.size(); i++){ if(dato1.equals(sCliente.listaClientes.get(i).getRut())){ System.out.println("RUT encontrado"); existe = true; break; }else{ System.out.println("RUT no encontrado"); existe = false; } } return existe; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean verificarCliente(int cedulaCliente) {\n for (int i = 0; i < posicionActual; i++) { //Recorre hasta la posicon actual en la que se estan agregando datos, osea en la ultima en que se registro.\n if (getCedulaCliente(i) == cedulaCliente) { //Pregunta si la cedula pasada por parametro exite en la posicon que va recorriendo el for actualmente\n return true; //Si la condicion se da, retorna verdadero para informar que si el cliente si se encuentra\n }\n }\n return false; //si al final no encontro ninguna coincidencia retorna falso para avisar que el cliente no se encuentra registrado\n }", "public boolean isCorrigeDatosRetencion()\r\n/* 623: */ {\r\n/* 624:696 */ return this.corrigeDatosRetencion;\r\n/* 625: */ }", "@Test\n public void testIsRut() {\n System.out.println(\"isRut\");\n String rut = \"19.208.616-7\";\n boolean expResult = false;\n boolean result = Entradas.isRut(rut);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n \n }", "public boolean getUsuarioSuscrito(){\n return !(suscribirClientBean.getUsuarioSuscrito(idOferta).length == 0);\r\n }", "private boolean campararCorreo () {\n\t\tlistaUsuarios = UsuarioDAO.readTodos(this.mainApp.getConnection());\n\t\tString correoE = this.campoCorreo.getText();\n\t\tfor (Usuario correo : listaUsuarios) {\n\t\t\tif (correo.getCorreoElectronico().equals(correoE))\n\t\t\t\treturn false;\n\t\t}//FIN FOR\n\t\treturn true;\n\t}", "public boolean isRSU() { return isRSU; }", "public boolean isConnectedToRendezVous() {\r\n return !rendezVous.isEmpty();\r\n }", "private boolean compararNombreUsuario () {\n\t\tlistaUsuarios = UsuarioDAO.readTodos(this.mainApp.getConnection());\n\t\tString nombre = this.campoTextoNombreUsuario.getText();\n\t\tfor (Usuario nombres : listaUsuarios) {\n\t\t\tif (nombres.getUsuario().equals(nombre)) {\n\t\t\t\treturn false;\n\t\t\t}//FIN IF\n\t\t}//FIN FOR\n\t\treturn true;\n\t}", "private static boolean verifTapis(){\n\t\tint compte = 0;\n\t\tfor(int i = 0; i<jeu.getJoueurs().length; i++){\n\t\t\tif(jeu.getJoueurs()[i].getTapisRest()==0 || jeu.getJoueurs()[i].getMonnaie()==0){\n\t\t\t\tcompte++;\n\t\t\t}\n\t\t}\n\t\tif(compte == jeu.getJoueurs().length){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Test\n void registerVeichle() {\n vr.registerVeichle(dieselCar);\n vr.registerVeichle(dieselCar2);\n\n assertTrue(vr.getVeichles().contains(dieselCar) && vr.getVeichles().contains(dieselCar2));\n assertFalse(vr.registerVeichle(dieselCar));\n }", "public boolean checarRespuesta(Opcion[] opciones) {\n boolean correcta = false;\n for (int i = 0; i < radios.size(); i++) {\n if (radios.get(i).isSelected() && opciones[i].isCorrecta()) {\n System.out.println(\"Respuesta correcta\");\n correcta = true;\n break;\n }\n }\n return correcta;\n }", "public boolean checarRespuesta(Opcion[] opciones) {\n boolean correcta = false;\n\n for (int i = 0; i < radios.size(); i++) {\n if (radios.get(i).isSelected() && opciones[i].isCorrecta()) {\n System.out.println(\"Ya le atinaste\");\n correcta = true;\n break;\n }\n }\n\n return correcta;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof RecorridoRutasPK)) {\n return false;\n }\n RecorridoRutasPK other = (RecorridoRutasPK) object;\n if ((this.idRuta == null && other.idRuta != null) || (this.idRuta != null && !this.idRuta.equals(other.idRuta))) {\n return false;\n }\n if (this.idParada != other.idParada) {\n return false;\n }\n if (this.correlativo != other.correlativo) {\n return false;\n }\n return true;\n }", "public boolean jeu() {\n int k;\n\n String compJoueur = \"\";\n String compOrdi = \"\";\n String reponse;\n\n boolean victoireJoueur = false;\n boolean victoireOrdi = false;\n String mystJoueur = challenger.nbMystere(); /**nb que le joueur doit trouver*/\n String mystOrdi = defenseur.nbMystere(); /**nb que l'ordinateur doit trouver*/\n String propOrdi = defenseur.proposition(); /**ordinateur genere un code aleatoire en premiere proposition*/\n log.info(\"Proposition ordinateur : \" + propOrdi); /**afficher proposition ordinateur*/\n String propJoueur = \"\";\n String goodResult = MethodesRepetitives.bonResultat();\n\n\n for (k = 1; !victoireJoueur && !victoireOrdi && k <= nbEssais; k++) { /**si ni le joueur ou l'ordinateur n'ont gagne et si le nombre d'essais n'est pas atteind, relancer*/\n\n compOrdi = MethodesRepetitives.compare(mystOrdi, propOrdi); /**lancer la methode de comparaison du niveau defenseur*/\n log.info(\"Reponse Ordinateur :\" + compOrdi); /**afficher la comparaison*/\n propJoueur = challenger.proposition(); /**demander une saisie au joueur selon le mode challenger*/\n compJoueur = MethodesRepetitives.compare(mystJoueur, propJoueur); /**comparer selon le mode challenger*/\n log.info(\"Reponse Joueur :\" + compJoueur); /**afficher la comparaison*/\n\n if (compOrdi.equals(goodResult)) { /**si l'ordinateur a gagne, changement de la valeur victoireOrdi*/\n victoireOrdi = true;\n }else if(compJoueur.equals(goodResult)) {/**si le joueur a gagne changement de la valeur victoireJoeur*/\n victoireJoueur = true;\n } else if (k < nbEssais) { /**sinon redemander un code a l'ordinateur selon les symboles de comparaison*/\n propOrdi = defenseur.ajuste(propOrdi, compOrdi);\n log.info(\"Proposition Ordinateur :\" + propOrdi);\n }\n }\n\n if (victoireOrdi || !victoireJoueur)/**si l'ordinateur ou le joueur perdent alors perdu sinon gagne*/\n victoireJoueur = false;\n else\n victoireJoueur = true;\n\n return victoireJoueur;\n\n\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof RhUtilidades)) {\n return false;\n }\n RhUtilidades other = (RhUtilidades) object;\n if ((this.utiSecuencial == null && other.utiSecuencial != null) || (this.utiSecuencial != null && !this.utiSecuencial.equals(other.utiSecuencial))) {\n return false;\n }\n return true;\n }", "public boolean registrarCompra(int cedulaCliente, String nombreCliente, String compraRealizada, float valorCompra) {\n if (posicionActual < 100) { // Verifica que la poscion en la que se esta almacenando sea menor que el tamaño del arraglo \n setCedulaCliente(posicionActual, cedulaCliente); //Agrega los valores pasados por parametro al arreglo correspondiente\n setNombreCliente(posicionActual, nombreCliente); //Agrega los valores pasados por parametro al arreglo correspondiente\n setCompraRealizada(posicionActual, compraRealizada); //Agrega los valores pasados por parametro al arreglo correspondiente\n setValorCompra(posicionActual, valorCompra); //Agrega los valores pasados por parametro al arreglo correspondiente\n posicionActual++; //Aumenta el valor de la posicion actual, para registrar el siguiente dato.\n return true;//Si toda la operacion fue correcta retorna verdadero para informar el resultado\n } else {\n return false; //Retorna falso si ya se alcanzo el tamaño maximo del vector.\n }\n }", "public boolean verificaTrasicaoVazia(){\n\n //verifica se dentro das transicoes tem alguma saindo com valor vazio;\n for (int i = 0; i < this.transicoes.size(); i++) {\n if(this.transicoes.get(i).simbolo.equals(Automato_Servico.valorVazio)){\n return true;\n }\n }\n return false;\n }", "public boolean isRegVigente() {\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"isRegVigente() - start\");\n\t\t}\n\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"isRegVigente() - end\");\n\t\t}\n\t\treturn regVigente;\n\t}", "private boolean setPermessiRicevuti(HttpServletRequest request, HttpServletResponse response,\r\n String utente) {\r\n Gruppo g = new Gruppo();\r\n\r\n g.setRuolo(utente);\r\n if (request.getParameter((\"checkbox\").concat(utente)).equals(\"true\")) {\r\n if (!ricevuti.getGruppi().contains(g)) {\r\n ricevuti.getGruppi().add(g);\r\n }\r\n } else if (request.getParameter((\"checkbox\").concat(utente)).equals(\"false\")) {\r\n ricevuti.getGruppi().remove(g);\r\n } else {\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n public void testObtenerControladorUsuario() throws Exception {\n System.out.println(\"obtenerControladorUsuario\");\n Fabrica instance = Fabrica.getInstance();\n IControladorUsuario icu = instance.obtenerControladorUsuario();\n \n //Damos de alta un cliente\n Date date = new Date(1988, 12, 05);\n DataDireccion direccion = new DataDireccion(\"Pedernal\",\"2145\",\"2\");\n icu.CargarDatosUsuario(\"Jose\",\"[email protected]\", \"pepe\", \"pepe123\",direccion,\"Villa\",date, \"/home/jose/d.png\");\n icu.altaUsuario();\n \n boolean existe = true;\n existe = icu.existeUsuario(\"pepe\",\"[email protected]\"); \n assertTrue(existe);\n \n DataDireccion dire = new DataDireccion(\"Rivera\",\"2000\",\"0\");\n String [] rutaImagen = {\"/home/jose/imagenes/a.png\",\"/home/jose/imagenes/b.png\"}; \n icu.seleccionarCategoria(\"Minutas\");\n \n icu.CargarDatosUsuario(\"elrey\",\"[email protected]\", \"El rey de las minutas\", \"elrey123\", dire, rutaImagen);\n icu.altaUsuario();\n existe = icu.existeUsuario(\"elrey\",\"[email protected]\"); \n assertTrue(existe);\n \n /*ArrayList<DataCliente> dcResult = icu.listarClientes();\n ArrayList<DataCliente> dcExpResult = new ArrayList<>();\n \n DataCliente dc = new DataCliente(\"Villa\", date,\"/home/jose/d.png\", \"pepe\", \"[email protected]\",\"Jose\", \"pepe123\", direccion);\n dcExpResult.add(dc);\n for(int x=0; x<dcResult.size(); x++)\n {\n \n assertTrue(dcExpResult.get(x).getApellido().equals(dcResult.get(x).getApellido()));\n assertTrue(dcExpResult.get(x).getMail().equals(dcResult.get(x).getMail()));\n assertTrue(dcExpResult.get(x).getRutaImagen().equals(dcResult.get(x).getRutaImagen()));\n }\n \n boolean exption = false;\n String [] rutaImagen = {\"/home/jose/imagenes/a.png\",\"/home/jose/imagenes/b.png\"}; \n try { \n icu.CargarDatosUsuario(\"elrey\",\"[email protected]\", \"El rey de las minutas\", \"elrey123\", direccion, rutaImagen);\n } catch (Exception ex) { \n exption = true;\n }\n assertTrue(exption);*/\n \n \n \n \n}", "public boolean Registrar() {\n\t\tlabelErrorNombre.setVisible(false);\n\t\tlabelErrorApellido.setVisible(false);\n\t\tlabelErrorCorreo.setVisible(false);\n\t\tlabelErrorContrasena.setVisible(false);\n\t\tif (textNombre.getText().matches(\"^[a-z A-Z]*$\") && !textNombre.getText().isEmpty()\n\t\t\t\t&& textApellido.getText().matches(\"^[a-z A-Z]*$\") && !textApellido.getText().isEmpty()\n\t\t\t\t&& textCorreo.getText()\n\t\t\t\t\t\t.matches(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\"\n\t\t\t\t\t\t\t\t+ \"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\")\n\t\t\t\t&& !textCorreo.getText().isEmpty() && !textContrasena.getText().isEmpty()) {\n\t\t\tString correo_admin = \"\";\n\t\t\tif (textField.getText().isEmpty()) {\n\t\t\t\tcorreo_admin = \"null\";\n\t\t\t} else {\n\t\t\t\tcorreo_admin = textField.getText();\n\t\t\t}\n\t\t\tUsers user = new Users(textNombre.getText(), textApellido.getText(), textCorreo.getText(),\n\t\t\t\t\ttextContrasena.getText(), admin, correo_admin);\n\t\t\tConnect conn = new Connect();\n\t\t\tconn.RegisUser(user);\n\t\t\tVentanaLogin VL = new VentanaLogin();\n\t\t\tVL.setVisible(true);\n\t\t\tConnectFTP Cftp = new ConnectFTP(user);\n\t\t\tCftp.OpenConexion();\n\t\t\tframe.dispose();\n\t\t\treturn true;\n\t\t} else if (!textNombre.getText().matches(\"^[a-z A-Z]*$\") || textNombre.getText().isEmpty()) {\n\t\t\t// nombre mal\n\t\t\tlabelErrorNombre.setVisible(true);\n\t\t\treturn false;\n\t\t} else if (!textApellido.getText().matches(\"^[a-z A-Z]*$\") || textApellido.getText().isEmpty()) {\n\t\t\t// apellido mal\n\t\t\tlabelErrorApellido.setVisible(true);\n\t\t\treturn false;\n\t\t} else if (!textCorreo.getText().matches(\n\t\t\t\t\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\" + \"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\")\n\t\t\t\t|| textCorreo.getText().isEmpty()) {\n\t\t\t// correo mal\n\t\t\tlabelErrorCorreo.setVisible(true);\n\t\t\treturn false;\n\t\t} else if (textContrasena.getText().isEmpty()) {\n\t\t\t// contrasena mal\n\t\t\tlabelErrorContrasena.setVisible(true);\n\t\t\treturn false;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean userIDExists( String idCedulaNit, Connection con ) \n {\n ClassConnection cc = new ClassConnection();\n \n //System.out.println( idCedulaNit );\n //System.out.print( idCedulaNit );\n Boolean presente = (Boolean) cc.execute( \"SELECT idcedulanit FROM usuario WHERE idcedulanit = \" + Long.parseLong( idCedulaNit ) , 2, con);\n \n return presente;\n }", "private boolean hayTorretas(int x1,int x2){\r\n\t\tboolean ret = false;\r\n\t\tint i = 0;\r\n\t\twhile(!ret && i < torretas.size()){\r\n\t\t\tTorreta aux = (Torreta) torretas.get(i);\r\n\t\t\tret = aux.getX() > x1 && aux.getX() < x2;\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public boolean InsererRDV(){\r\n\t\t\r\n\t\tArrayList<Object []>RdvMaj = new ArrayList<Object []>();\r\n\t\tArrayList<Object []>RdvNouveau = new ArrayList<Object []>();\r\n\t\t\r\n\t\tint i;\r\n\t\tfor(i=0; i< listeRdvCrud.size(); i++){\r\n\t\t\tif(listeRdvCrud.get(i)[5].toString().compareTo(\"NEW\") == 0 ){\r\n\t\t\t\tRdvNouveau.add(listeRdvCrud.get(i));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tRdvMaj.add(listeRdvCrud.get(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tboolean ok = MajRDV(RdvMaj);\r\n\t\tboolean ok1 = insererNouveauRDV(RdvNouveau);\r\n\t\t\r\n\t\treturn ok && ok1;\r\n\t}", "private boolean brugerVerificering (String brugerNavn, int kode){\n for (Bruger bruger : databasen.getUsers()) { //Denne for-løkke kører objekt af bruger igennem i arraylisten\n if (bruger.getBrugerNavn().equals(brugerNavn) && bruger.getKode() == kode) {\n this.currentUser = bruger;\n return true;\n }\n //Hvis det matcher bruger fra db, vil currentUser være \"brugeren\" der logger in\n\n }\n return false;\n }", "private boolean isEqual(Roster r2)\n\t{\n\t\tIterator<Player> it1 = iterator();\n\t\twhile(it1.hasNext())\n\t\t{\n\t\t\tPlayer p = it1.next();\n\t\t\tif(!r2.has(p))\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tIterator<Player> it2 = r2.iterator();\n\t\twhile(it2.hasNext())\n\t\t{\n\t\t\tPlayer p = it2.next();\n\t\t\tif(!has(p))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean equals(Object other) {\n\t\t\tif (other instanceof IChatServer) { // make sure that other object is an IUser\n\t\t\t\ttry {\n\t\t\t\t\t// Equality of IUsers is same as equality of UUID's.\n\t\t\t\t\treturn stub.getUser().getId().equals(((IChatServer) other).getUser().getId());\n\t\t\t\t} catch (RemoteException e) {\n\t\t\t\t\t// Deal with the exception without throwing a RemoteException.\n\t\t\t\t\tSystem.err.println(\"ProxyUser.equals(): error getting UUID: \" + e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t// Fall through and return false\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "private boolean estaEnRevista() {\n\t\ttry{\n\t\t String Sjson= Utils.doHttpConnection(\"http://datos.labplc.mx/movilidad/taxis/\"+placa+\".json\");\n\t\t String marca=\"\",submarca=\"\",anio=\"\";\n\t\t \n\t\t JSONObject json= (JSONObject) new JSONTokener(Sjson).nextValue();\n\t\t JSONObject json2 = json.getJSONObject(\"Taxi\");\n\t\t JSONObject jsonResponse = new JSONObject(json2.toString());\n\t\t JSONObject sys = jsonResponse.getJSONObject(\"concesion\");\n\t\t \n\t\t if(sys.length()>0){\n\t\t \n\t\t\t\t\t try {\n\t\t\t\t\t\t marca = (String) sys.getString(\"marca\");\n\t\t\t\t\t\t autoBean.setMarca(marca);\n\t\t\t\t\t\t submarca = (String) sys.getString(\"submarca\");\n\t\t\t\t\t\t autoBean.setSubmarca(submarca);\n\t\t\t\t\t\t anio = (String) sys.getString(\"anio\");\n\t\t\t\t\t\t autoBean.setAnio(anio);\n\t\t\t\t\t\t \n\t\t\t\t\t\t autoBean.setDescripcion_revista(getResources().getString(R.string.con_revista));\n\t\t\t\t\t\t autoBean.setImagen_revista(imagen_verde);\n\t\t\t\t\t\t \n\t\t\t\t\t\t Calendar calendar = Calendar.getInstance();\n\t\t\t\t\t\t int thisYear = calendar.get(Calendar.YEAR);\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(thisYear-Integer.parseInt(anio)<=10){\n\t\t\t\t\t\t\t autoBean.setDescripcion_vehiculo(getResources().getString(R.string.carro_nuevo)+\" \"+getResources().getString(R.string.Anio)+\" \"+anio);\n\t\t\t\t\t\t\t autoBean.setImagen_vehiculo(imagen_verde);\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t autoBean.setDescripcion_vehiculo(getResources().getString(R.string.carro_viejo)+\" \"+getResources().getString(R.string.Anio)+\" \"+anio);\n\t\t\t\t\t\t\t autoBean.setImagen_vehiculo(imagen_rojo);\n\t\t\t\t\t\t\t PUNTOS_APP-=PUNTOS_ANIO_VEHICULO;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t return true;\n\t\t\t\t\t \n\t\t\t\t\t } catch (JSONException e) { return false;}\n\t\t }else{\n\t\t \t return false;\n\t\t }\n\t\t \n\t\t}catch(JSONException e){\n\t\t\tDatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public boolean ValidarValesConORC()\n {\n final Integer contInteger;\n return false;\n\n }", "public boolean czyUstalonyGracz()\n\t{\n\t\treturn (pojazd != null);\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof ClientesMotoristas)) {\n return false;\n }\n ClientesMotoristas other = (ClientesMotoristas) object;\n if ((this.clmtId == null && other.clmtId != null) || (this.clmtId != null && !this.clmtId.equals(other.clmtId))) {\n return false;\n }\n return true;\n }", "public boolean setRacun(Racun racun){ // info da li je racun postavljen uspesno\n if(this.racun!=null){\n System.out.println(\"za osobu \"+this.ime+ \" je vec registrovan racun.\");\n return false;\n }\n this.racun=racun; //this->return\n return true;\n }", "@Test\n\tpublic void verurteilenTest() {\n\t\tR1.verurteilen(Sc1);\n\t\tR2.verurteilen(Sc2);\n\t\tassertEquals(true, Sc1.getIstVerurteilt());\n\t\tassertEquals(false, Sc2.getIstVerurteilt());\n\n\t\tR1.verurteilen(Sc2);\n\t\tR2.verurteilen(Sc1);\n\t\tassertEquals(true, Sc2.getIstVerurteilt());\n\t\tassertEquals(false, Sc1.getIstVerurteilt());\n\n\t}", "public boolean equals(java.lang.Object r3) {\n /*\n r2 = this;\n if (r2 == r3) goto L_0x0033\n boolean r0 = r3 instanceof com.jiayouya.travel.module.common.data.AliUserRsp\n if (r0 == 0) goto L_0x0031\n com.jiayouya.travel.module.common.data.AliUserRsp r3 = (com.jiayouya.travel.module.common.data.AliUserRsp) r3\n java.lang.String r0 = r2.uid\n java.lang.String r1 = r3.uid\n boolean r0 = kotlin.jvm.internal.C8271i.m35384a(r0, r1)\n if (r0 == 0) goto L_0x0031\n java.lang.String r0 = r2.nickname\n java.lang.String r1 = r3.nickname\n boolean r0 = kotlin.jvm.internal.C8271i.m35384a(r0, r1)\n if (r0 == 0) goto L_0x0031\n java.lang.String r0 = r2.city\n java.lang.String r1 = r3.city\n boolean r0 = kotlin.jvm.internal.C8271i.m35384a(r0, r1)\n if (r0 == 0) goto L_0x0031\n java.lang.String r0 = r2.avatar\n java.lang.String r3 = r3.avatar\n boolean r3 = kotlin.jvm.internal.C8271i.m35384a(r0, r3)\n if (r3 == 0) goto L_0x0031\n goto L_0x0033\n L_0x0031:\n r3 = 0\n return r3\n L_0x0033:\n r3 = 1\n return r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.jiayouya.travel.module.common.data.AliUserRsp.equals(java.lang.Object):boolean\");\n }", "public Boolean gerarResultadoTeste(Long cnpjOuCpf, Long idFormulario) {\n\t\tboolean gerouResultadoTeste;\n\t\tList<RespostaTeste> listas = respostaTesteRepository.\n\t\t\t\t\t\t\tfindByCnpjOuCpfAndFormulario(cnpjOuCpf, idFormulario);\n\n\t\tif (listas.isEmpty()) {\n\t\t\tgerouResultadoTeste = false;\n\t\t\treturn gerouResultadoTeste;\n\t\t}\n\t\tList<ResultadoTeste> list = listar(cnpjOuCpf, idFormulario);\n\t\tif (!list.isEmpty()) {\n\t\t\tthrow new DataIntegrityException(\"Já foi gerado Resultado Teste para esse Ciente / formulário \"\n\t\t\t\t\t+ cnpjOuCpf + \" / \" + idFormulario );\n\t\t}\n\n\t\t\n\t\tResultadoTeste resultadoTeste = null;\n\t\t\n\t\tfor (RespostaTeste rt : listas) {\n\t\t\tif (resultadoTeste == null ) {\n\t\t\t\tresultadoTeste = primeiroResultadoTeste(rt);\n\t\t\t\t\t\tSystem.out.println(\"chamou primeiroResultadoTeste(rt);= \" + resultadoTeste);\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"cnpj= \" + rt.getCnpjOuCpf() + \"form= \" + rt.getFormulario().getIdFormulario() + \"cand= \"\n\t\t\t\t\t\t\t\t+ rt.getCandidato().getIdCandidato() + \"nr_perg= \" + rt.getNrPergunta() + \"seq_perg_resp= \"\n\t\t\t\t\t\t\t\t+ rt.getSequPergResp());\n\t\t\t\t\t\tSystem.out.println(\"resultado = \" + resultadoTeste);\n\t\t\tif (rt.getCandidato().getIdCandidato() == resultadoTeste.getIdCandidato()) {\n\t\t\t\tif (rt.getRespostaCerta().equals(\"s\")) {\n\t\t\t\t\tresultadoTeste.setQtdeRespostaCerta(resultadoTeste.getQtdeRespostaCerta() + 1);\n\t\t\t\t}else {\n\t\t\t\t\tresultadoTeste.setQtdeRespostaErrada(resultadoTeste.getQtdeRespostaErrada() + 1);\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tString aprovadoReprovado = calcularAprovados.verificarCandidatoAprovado(resultadoTeste);\n\t\t\t\t\t\tSystem.out.println(\"retorno verificarCandidatoAprovado = \" + aprovadoReprovado );\n\t\t\t\tresultadoTeste.setCandidatoAprovado(aprovadoReprovado);\n\t\t\t\t\n\t\t\t\tDouble percentualAcerto = calcularAprovados.calcularPercentualAcerto(resultadoTeste);\n\t\t\t\tresultadoTeste.setPercentualAcerto(percentualAcerto);\n\t\t\t\t\t\tSystem.out.println(\"RT para incluir = \" + resultadoTeste );\n\t\t\t\t\n\t\t\t\tresultadoTesteRepository.save(resultadoTeste);\n\t\t\t\t\n\t\t\t\tresultadoTeste = novoResultadoTeste(rt);\n\t\t\t\t\t\tSystem.out.println(\"RT Novo = \" + resultadoTeste );\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"======== fim for ============\");\n\t\tString aprovadoReprovado = calcularAprovados.verificarCandidatoAprovado(resultadoTeste);\n\t\t\t\t\t\tSystem.out.println(\"retorno verificarCandidatoAprovado = \" + aprovadoReprovado );\n\t\tresultadoTeste.setCandidatoAprovado(aprovadoReprovado);\n\t\t\n\t\tDouble percentualAcerto = calcularAprovados.calcularPercentualAcerto(resultadoTeste);\n\t\tresultadoTeste.setPercentualAcerto(percentualAcerto);\n\t\t\t\t\t\tSystem.out.println(\"RT para incluir = \" + resultadoTeste );\n\n\t\tresultadoTesteRepository.save(resultadoTeste);\n\t\treturn gerouResultadoTeste = true;\n\t}", "private boolean verificarRaza(String raza){\n //Arreglo de Strings con las razas peligrosas\n String[] razas_peligrosas = {\n \"Pit bull terrier\", \n \"American Staffordshire terrier\", \n \"Tosa Inu\",\n \"Dogo argentino\",\n \"Dogo Guatemalteco\",\n \"Fila brasileño\",\n \"Presa canario\",\n \"Doberman\",\n \"Gran perro japones\", \n \"Mastin napolitano\",\n \"Presa Mallorqui\",\n \"Dogo de burdeos\",\n \"Bullmastiff\",\n \"Bull terrier inglés\",\n \"Bulldog americano\",\n \"Rhodesiano\",\n \"Rottweiler\"\n };\n\n boolean bandera = true;\n\n //Ciclo que recorre todos los elementos del arreglo hasta que encuentra uno y termina el ciclo.\n for (int i = 0; i < razas_peligrosas.length; i++){\n if (raza.equals(razas_peligrosas[i])){\n bandera = false;\n break;\n }\n }\n\n return bandera;\n }", "public boolean verRevelado(){\n\r\n return revelado;\r\n }", "private boolean checkListino() {\n /* variabili e costanti locali di lavoro */\n boolean ok = false;\n Date dataInizio;\n Date dataFine;\n AddebitoFissoPannello panServizi;\n\n try { // prova ad eseguire il codice\n dataInizio = this.getDataInizio();\n dataFine = this.getDataFine();\n panServizi = this.getPanServizi();\n ok = panServizi.checkListino(dataInizio, dataFine);\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n /* valore di ritorno */\n return ok;\n }", "boolean hasDonatie();", "private boolean isContieneLotesDetallePedidos(){\n String pResultado = \"N\";\n try {\n log.info(\"VariablesDelivery.vNumeroPedido_bk:\"+VariablesDelivery.vNumeroPedido_bk);\n log.info(\"VariablesDelivery.vCodLocal_bk:\"+VariablesDelivery.vCodLocal_bk);\n pResultado = DBDelivery.isContienLotesProductos(VariablesDelivery.vCodLocal_bk,\n VariablesDelivery.vNumeroPedido_bk);\n \n log.info(\"isContieneLotesDetallePedidos():\"+pResultado);\n } catch (Exception e) {\n pResultado = \"N\"; \n log.info(\"Error al obtener ind Productos x Lote del Pedido:\"+e.getMessage());\n }\n \n if(pResultado.trim().equalsIgnoreCase(\"N\")){\n return false;\n }\n else{\n FarmaUtility.showMessage(this,\"El pedido ya tiene los Lotes Ingresados\\n\" +\n \"Se procederá a generar el pedido.\\n\" +\n \"Gracias.\" ,tblListaDetallePedido);\n \n return true;\n }\n }", "public boolean registerToServer() throws Exception{\n \t\n\t\t// On crée un objet container pour contenir nos donnée\n\t\t// On y ajoute un AdminStream de type Registration avec comme params le login et le mot de pass\n \tRegistrationRequest regRequest = new RegistrationRequest(login, pass);\n\t\ttry {\n\t\t\t// On tente d'envoyer les données\n\t\t\toos_active.writeObject(regRequest);\n\t\t\t// On tente de recevoir les données\n\t\t\tRegistrationResponse regResponse = (RegistrationResponse)ois_active.readObject();\n\n\t\t\t// On switch sur le type de retour que nous renvoie le serveur\n\t\t\t// !!!Le type enum \"Value\" est sujet à modification et va grandir en fonction de l'avance du projet!!!\n\t\t\tswitch(regResponse.getResponseType()){\n\t\t\tcase REG_ALREADY_EXISTS:\n\t\t\t\topResult = \"Error : User already exist!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_LOGIN_BAD_FORMAT:\n\t\t\t\topResult = \"Error : login bad format!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_PASS_BAD_FORMAT:\n\t\t\t\topResult = \"Error : password bad format!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_SUCCESS:\n\t\t\t\topResult = \"Account registration succeed!\";\n\t\t\t\treturn true;\n\t\t\tcase REG_UNKNOW_ERROR:\n\t\t\t\topResult = \"Error : Unknown error!\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new ClientChatException (ClientChatException.IO_ERREUR, \"ERROR: Communication Error\");\n\t\t}\n\t\treturn false;\n }", "private boolean exeVDTRTP() \n\t{\n\t\ttry{\n\t\t\t\n\t\t\tif(flgDIRFL)\n\t\t\t\tM_strSQLQRY = \"Select CMT_CODCD,CMT_CODDS from CO_CDTRN where CMT_CGMTP='MST' and CMT_CGSTP = 'COXXMKT' and CMT_CODCD='\"+txtTRNTP.getText().toString().trim()+\"'\";\n\t\t\telse\n\t\t\t\tM_strSQLQRY = \"Select CMT_CODCD,CMT_CODDS from CO_CDTRN where CMT_CGMTP='SYS' and CMT_CGSTP = 'FGXXITP' and CMT_CCSVL = '1' and CMT_CODCD='\"+txtTRNTP.getText().toString().trim()+\"'\";\n\t\t\t//System.out.println(M_strSQLQRY);\n\t\t\tM_rstRSSET = cl_dat.exeSQLQRY1(M_strSQLQRY);\n\t\t\tif(M_rstRSSET.next())\n\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\tif(M_rstRSSET !=null)\n\t\t\t\t\tM_rstRSSET.close();\n\t\t}catch(Exception L_EX){\n\t\t\tsetMSG(L_EX,\"exeVDTRTP\");\n\t\t}\n\t\treturn false;\n\t}", "public boolean CompruebaCliente(String nif) throws SQLException{\n\t\t//System.out.println(\"metodo comprueba cliente\");\n\t\t\n\t\tboolean comprobar = false;\n\t\tString sql = \" SELECT * FROM cliente WHERE nifCliente = '\"+nif+\"' \"; // sentencia busqueda cliente\n\t\ttry {\n\t\t\tconn = conexion.getConexion(); // nueva conexion a la bbdd CREARLO EN TODOS LOS METODOS\n\t\t\tst=(Statement) conn.createStatement();\n\t\t\tresultado = st.executeQuery(sql);\n\t\t\t\twhile(resultado.next()) {\n\n\t\t\t\t\tcomprobar=true;\n\t\t\t\t}\n\t\t}\n\t\tcatch(SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn comprobar;\n\t}", "public boolean equals(Object obj){\r\n\t\tif (!(obj instanceof ResumoArrecadacaoCreditoHelper)){\r\n\t\t\treturn false;\t\t\t\r\n\t\t} else {\r\n\t\t\tResumoArrecadacaoCreditoHelper resumoTemp = (ResumoArrecadacaoCreditoHelper) obj;\r\n\t\t \r\n\t\t // Verificamos se todas as propriedades que identificam o objeto sao iguais\r\n\t\t\treturn\r\n\t\t\t\tpropriedadesIguais(this.idCreditoOrigem, resumoTemp.idCreditoOrigem) &&\r\n\t\t\t\tpropriedadesIguais(this.idLancamentoItemContabil, resumoTemp.idLancamentoItemContabil);\r\n\t\t}\t\r\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Usuaris)) {\n return false;\n }\n Usuaris other = (Usuaris) object;\n if ((this.nif == null && other.nif != null) || (this.nif != null && !this.nif.equals(other.nif))) {\n return false;\n }\n return true;\n }", "public boolean checkSeatTaken(int[] RC) {\n return seatPlan[RC[0] - 1][RC[1] - 1].getStatus();\n }", "private boolean correcto() {\r\n return (casillas.size()>numCasillaCarcel); //&&tieneJuez\r\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "public boolean isSetRiu() {\n return this.riu != null;\n }", "boolean hasRt();", "public boolean consultar() {\n consultarReg();\n return true;\n }", "boolean hasDonator();", "public ArrayList<Transaction> isRenting(){\n ArrayList<Transaction> renting= new ArrayList<Transaction>();\n for(int i=0;i< Library.Transactions.size();i++){\n //transaction book title equals the book returning\n if((Library.Transactions.get(i).getUsername().equals(this.getUserName()))&&(Library.Transactions.get(i).getReturndate()==null)){\n renting.add(Library.Transactions.get(i));\n }\n }\n return renting;\n\t}", "@Test\n void riordina() {\n sorgenteList = Arrays.asList(\"luglio\", \"marzo\", \"gennaio\");\n previstoList = Arrays.asList(\"gennaio\", \"marzo\", \"luglio\");\n\n ottenutoList = service.riordina(sorgenteList);\n assertNotNull(ottenutoList);\n assertEquals(previstoList, ottenutoList);\n }", "private boolean getTests() {\n boolean genderTest = genderSpinner.getValue().equals(currentContact.getGender());\n boolean birthdayTest = dateModel.getValue().equals(currentContact.getBirthday());\n boolean emailTest = emailField.getText().equals(currentContact.getEmail());\n boolean mobileTest = mobileField.getText().equals(currentContact.getMobile());\n boolean homeTest = homeField.getText().equals(currentContact.getHome());\n boolean motherTest = motherField.getText().equals(currentContact.getMother());\n boolean fatherTest = fatherField.getText().equals(currentContact.getFather());\n boolean addressTest = addressArea.getText().equals(currentContact.getAddress());\n return genderTest && birthdayTest && emailTest && mobileTest && homeTest && motherTest && fatherTest && addressTest;\n }", "private Boolean precond() {\r\n\t\tcalculoCantidadSacar(grupoPuestosController.getIdConcursoPuestoAgr());\r\n\t\t/**\r\n\t\t * fin incidencia 0001649\r\n\t\t */\r\n\t\tBoolean respuesta = validacionesIteracion();\r\n\t\treturn respuesta;\r\n\t}", "private boolean sendAndCheckResp(byte[] userMessage, String trueResp, String falseResp) {\n\t\tbyte[] srvrResponse = sendServerCoded(userMessage);\n\t\tbyte[] expectedResponse = trueResp.getBytes();\n\t\tbyte[] alternateResponse = falseResp.getBytes();\n\n\t\tboolean truthVal = false;\n\t\tif (Arrays.equals(srvrResponse, expectedResponse)) {\n\t\t\ttruthVal = true;\n\t\t} else if (Arrays.equals(srvrResponse, alternateResponse)) {\n\t\t\t// truthVal = false;\n\t\t} else {\n\t\t\tComMethods.handleBadResp();\n\t\t}\n\t\treturn truthVal;\n\t}", "private boolean validacionesSolicitarReserva(int indice, int CodEmp, int CodLoc, int CodCot, boolean isSol){\n boolean blnRes=true;\n try{\n if(!validaItemsServicio(CodEmp, CodLoc, CodCot)){\n blnRes=false;\n MensajeInf(\"La cotizacion contiene Items de Servicio o Transporte, los cuales no deben ser reservados.\");\n }\n\n if(!validaFechasMAX(indice, tblDat.getValueAt(indice,INT_TBL_DAT_STR_TIP_RES_INV).toString(),isSol)){\n blnRes=false;\n MensajeInf(\"La Fecha solicitada es mayor a la permitida, revise la Fecha y vuelva a intentarlo\");\n }\n \n if(!validaTerminalesLSSegunEmpresaLocal(CodEmp,CodLoc,CodCot)){\n blnRes=false;\n MensajeInf(\"No puede solicitar reserva de codigos L/S en este local, debe reservarlo por el local que puede ser facturado\");\n }\n \n if(!validaFechasPrimerDiaLaboral(indice,isSol,CodEmp,CodLoc)){\n blnRes=false;\n MensajeInf(\"La Fecha solicitada, no corresponde al primer dia laboral registrado\");\n } \n \n if(tblDat.getValueAt(indice,INT_TBL_DAT_STR_TIP_RES_INV).toString().equals(\"R\")){\n if(!validaTerminalesLReservaLocal(CodEmp,CodLoc,CodCot)){\n blnRes=false;\n MensajeInf(\"No puede solicitar Reserva en Empresa de Codigos L \");\n }\n }\n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(null, e);\n blnRes=false;\n }\n return blnRes;\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Usr)) {\r\n return false;\r\n }\r\n Usr other = (Usr) object;\r\n if ((this.idUsr == null && other.idUsr != null) || (this.idUsr != null && !this.idUsr.equals(other.idUsr))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public final boolean checkIsRegistered(L2Clan clan)\n {\n if (clan == null) return false;\n\n if (clan.getHasCastle() > 0) return true;\n \n java.sql.Connection con = null;\n boolean register = false;\n try\n {\n con = L2DatabaseFactory.getInstance().getConnection();\n PreparedStatement statement = con.prepareStatement(\"SELECT clan_id FROM siege_clans where clan_id=?\");\n statement.setInt(1, clan.getClanId());\n ResultSet rs = statement.executeQuery();\n\n while (rs.next())\n {\n register = true;\n break;\n }\n }\n catch (Exception e)\n {\n System.out.println(\"Exception: checkIsRegistered(): \" + e.getMessage());\n e.printStackTrace();\n } \n finally \n {\n try { con.close(); } catch (Exception e) {}\n }\n return register;\n }", "@Override\n\tpublic boolean validare(Client t) {\n\t\tboolean ok = true;\n\t\tif (!this.validareEmail(t))\n\t\t\tok = false;\n\t\tif (!this.validareNume(t))\n\t\t\tok = false;\n\n\t\treturn ok;\n\t}", "private Boolean compararQueries(Configuracion config,Consulta consultaOriginal, Consulta consultaAlternativa, int itemConsultaOriginal, int itemConsultaAlternativa){\n\t\tDatabase database1 = new Database();\n\t\tDatabase database2 = new Database();\n\t\tList<Map<String, Object>> resultadosConsulta1 = database1.ejecutarQuery(config, consultaOriginal, database1);\n\t\tList<Map<String, Object>> resultadosConsulta2 = database2.ejecutarQuery(config, consultaAlternativa, database2);\n\t\tif (resultadosConsulta1.equals(resultadosConsulta2)){\n\t\t\treturn true;\t\t\t\t\t\n\t\t}\n\t\telse\n\t\t\treturn false;\t\t\t\n\t}", "public boolean stupneProOriGraf(){\n\t\tint pom = 0;\n\t\tfor(int i = 0; i < vrchP.length;i++){\n\t\t\tif(vrchP[i].stupenVstup != vrchP[i].stupenVystup)\n\t\t\t\tpom++;\n\t\t}\n\t\tif(pom != 0)\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "public boolean isAccepted_tou();", "public boolean speichereRechnung(Rechnung r) throws IOException {\n try {\n oos.writeObject(r);\n return true;\n } catch (IOException e) {\n return false;\n }\n }", "public boolean reconcilePassword(){\r\n if((signup.getFirstPassword()).equals(signup.getSecondPassword())){\r\n \r\n return true;\r\n \r\n }\r\n else{\r\n \r\n return false;\r\n }\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Tiposusuarios)) {\r\n return false;\r\n }\r\n Tiposusuarios other = (Tiposusuarios) object;\r\n if ((this.codigotipousuario == null && other.codigotipousuario != null) || (this.codigotipousuario != null && !this.codigotipousuario.equals(other.codigotipousuario))) {\r\n return false;\r\n }\r\n return true;\r\n }", "boolean hasTruckid();", "boolean hasTruckid();", "boolean hasTruckid();", "boolean hasTruckid();", "boolean hasTruckid();", "boolean hasTruckid();", "public boolean souvislost(){\n\t\t\n\t\tif(pole.size() != pocetVrcholu){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public static boolean istiBroj(int broj) {\n boolean uslov = false;\n for (int i = 0; i < users.size(); i++) {\n if (users.get(i).getAccountNumber() == broj) {\n uslov = true;\n break;\n }\n else\n uslov = false;\n\n }\n return uslov;\n }", "public boolean inschrijfControle(){\n if(typeField.getText().equals(\"Toernooi\")) {\n try {\n Connection con = Main.getConnection();\n PreparedStatement st = con.prepareStatement(\"SELECT COUNT (*) as aantal FROM Inschrijvingen WHERE speler = ? AND toernooi = ?\");\n st.setInt(1, Integer.parseInt(spelerIDField.getText()));\n st.setInt(2, Integer.parseInt(codeField.getText()));\n ResultSet rs = st.executeQuery();\n if (rs.next()) {\n int id = rs.getInt(\"aantal\");\n if (id < 1) {\n return false;\n }\n }\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"ERROR: er is een probleem met de database(inschrijfControleToernooi)\");\n }\n }else if(typeField.getText().equals(\"Masterclass\")){\n try{\n Connection con = Main.getConnection();\n PreparedStatement st = con.prepareStatement(\"SELECT COUNT (*) as aantal FROM Inschrijvingen WHERE speler = ? AND masterclass = ?\");\n st.setInt(1, Integer.parseInt(spelerIDField.getText()));\n st.setInt(2, Integer.parseInt(codeField.getText()));\n ResultSet rs = st.executeQuery();\n if (rs.next()) {\n int id = rs.getInt(\"aantal\");\n if (id < 1) {\n return false;\n }\n }\n }catch(Exception e){\n System.out.println(e);\n System.out.println(\"ERROR: er is een probleem met de database(inschrijfControleMasterclass)\");\n }\n }\n return true;\n }", "private boolean validarCliente() {\n for (Cliente itemCliente : clienteList){\n if (cliente.getText().toString().equals(itemCliente.getClie_nombre())){\n clienteSeleccionado = itemCliente;\n return true;\n }\n }\n new Mensaje(getApplicationContext()).mensajeToas(\"El cliente no esta registrado\");\n return false;\n }", "private boolean correctUser() {\n // TODO mirar si l'usuari es unic a la base de dades\n return true;\n }", "public Boolean checkIfTumblerRowIsAllTheSame(Tumbler tum) {\n if (tum.getTumbler1() == tum.getTumbler2() && tum.getTumbler1() == tum.getTumbler3() && tum.getTumbler1() == tum.getTumbler4()\n && tum.getTumbler1() == tum.getTumbler5()) {\n return true;\n }\n return false;\n }", "public boolean getAccepted_tou();", "public boolean equals(@org.jetbrains.annotations.Nullable java.lang.Object r3) {\n /*\n r2 = this;\n if (r2 == r3) goto L_0x0047\n boolean r0 = r3 instanceof com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection\n if (r0 == 0) goto L_0x0045\n com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection r3 = (com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection) r3\n com.bitcoin.mwallet.core.models.slp.Slp r0 = r2.token\n com.bitcoin.mwallet.core.models.slp.Slp r1 = r3.token\n boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r1)\n if (r0 == 0) goto L_0x0045\n java.util.List<kotlin.ULong> r0 = r2.quantities\n java.util.List<kotlin.ULong> r1 = r3.quantities\n boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r1)\n if (r0 == 0) goto L_0x0045\n com.bitcoin.bitcoink.tx.Satoshis r0 = r2.fee\n com.bitcoin.bitcoink.tx.Satoshis r1 = r3.fee\n boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r1)\n if (r0 == 0) goto L_0x0045\n com.bitcoin.bitcoink.tx.Satoshis r0 = r2.change\n com.bitcoin.bitcoink.tx.Satoshis r1 = r3.change\n boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r1)\n if (r0 == 0) goto L_0x0045\n java.util.List<com.bitcoin.mwallet.core.models.tx.utxo.Utxo> r0 = r2.utxos\n java.util.List<com.bitcoin.mwallet.core.models.tx.utxo.Utxo> r1 = r3.utxos\n boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r1)\n if (r0 == 0) goto L_0x0045\n com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection$Error r0 = r2.error\n com.bitcoin.mwallet.core.models.tx.slputxo.SlpUtxoSelection$Error r3 = r3.error\n boolean r3 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r3)\n if (r3 == 0) goto L_0x0045\n goto L_0x0047\n L_0x0045:\n r3 = 0\n return r3\n L_0x0047:\n r3 = 1\n return r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.bitcoin.mwallet.core.models.p009tx.slputxo.SlpUtxoSelection.equals(java.lang.Object):boolean\");\n }", "public static boolean testGuset() {\n // Reset the guest index\n Guest.resetNextGuestIndex();\n // Create two new guests, one is with a dietary restriction\n Guest shihan = new Guest();\n Guest cheng = new Guest(\"no milk\");\n\n // Check the guest's information\n if (!shihan.toString().equals(\"#1\")) {\n System.out.println(\"Return value is \" + shihan.toString());\n return false;\n }\n // Check if the dietary restriction implement\n if (cheng.hasDietaryRestriction() != true) {\n return false;\n }\n if (!cheng.toString().equals(\"#2(no milk)\")) {\n System.out.println(\"Return value is \" + cheng.toString());\n return false;\n }\n // Reset the guest index again\n Guest.resetNextGuestIndex();\n // Create two new guests again, the index should be 1 and 2\n Guest ruoxi = new Guest();\n Guest shen = new Guest(\"no cookie\");\n // Check the new guests' information with new indices\n if (!ruoxi.toString().equals(\"#1\")) {\n System.out.println(\"Return value is \" + ruoxi.toString());\n return false;\n }\n if (!shen.toString().equals(\"#2(no cookie)\")) {\n System.out.println(\"Return value is \" + shen.toString());\n return false;\n }\n // Reset the guest index for next time or other classes' call\n Guest.resetNextGuestIndex();\n // No bug, return true\n return true;\n }", "public boolean Wygrana() {\n\t\tSystem.out.println(\"Wygrana\");\n\t\tif(SprawdzanieWygranej.WygranaNiewolnikow()) {\n\t\t\tZapisOdczyt.setWygranaKlasa(Plansza.getNiewolnikNaPLanszy());\n\t\t\tZapisOdczyt.setWygranaKlasaPopulacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t\n\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getPopulacja() >= Plansza.getArystokrataNaPlanszy().getPopulacja()) {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getRzemieslnikNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getArystokrataNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getArystokrataNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getRzemieslnikNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\tif(SprawdzanieWygranej.WygranaRzemieslnikow()) {\n\t\t\tZapisOdczyt.setWygranaKlasa(Plansza.getRzemieslnikNaPlanszy());\n\t\t\tZapisOdczyt.setWygranaKlasaPopulacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t\n\t\t\tif(Plansza.getNiewolnikNaPLanszy().getPopulacja() >= Plansza.getArystokrataNaPlanszy().getPopulacja()) {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getNiewolnikNaPLanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getArystokrataNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getArystokrataNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getNiewolnikNaPLanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\tif(SprawdzanieWygranej.WygranaArystokracji()) {\n\t\t\tZapisOdczyt.setWygranaKlasa(Plansza.getArystokrataNaPlanszy());\n\t\t\tZapisOdczyt.setWygranaKlasaPopulacja(Plansza.getArystokrataNaPlanszy().getPopulacja());\n\t\t\t\n\t\t\tif(Plansza.getNiewolnikNaPLanszy().getPopulacja() >= Plansza.getRzemieslnikNaPlanszy().getPopulacja()) {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getNiewolnikNaPLanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getRzemieslnikNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tZapisOdczyt.setMiejsce2(Plansza.getRzemieslnikNaPlanszy());\n\t\t\t\tZapisOdczyt.setMiejsce2Populacja(Plansza.getRzemieslnikNaPlanszy().getPopulacja());\n\t\t\t\tZapisOdczyt.setMiejsce3(Plansza.getNiewolnikNaPLanszy());\n\t\t\t\tZapisOdczyt.setMiejsce3Populacja(Plansza.getNiewolnikNaPLanszy().getPopulacja());\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean equals(Object objetox) {\n\t\t//con el instanceof nos permite averiguar si el objeto pasado por parametro es una instancia de \n\t\t//la clase Cliente.\n\t\tif(objetox instanceof Cliente) {\n\t\t\tCliente aComparar = (Cliente)objetox;\n\t\t\tif(this.saldo == aComparar.saldo) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean czyJestWykolejenie(){\r\n int losowy = (int) (Math.random() * 130) ;\r\n if (losowy <= szansaWykolejenia){\r\n System.out.println(\"Nastapilo wykolejenie tramwaju!\");\r\n return true;\r\n }\r\n else {\r\n System.out.println(\"Brak wykolejenia\");\r\n return false;\r\n }\r\n }", "public boolean kontrolEt(){\n \n for (Ates ateskontrolAtes : atesler) {\n \n if (new Rectangle(ateskontrolAtes.getX(),ateskontrolAtes.getY(),10,20).intersects(new Rectangle(topX,0,20,20))) {\n \n return true;\n \n }\n \n }\n return false;\n \n }", "public int check_both()\r\n {\r\n if(((check_passwrd.compareTo(conf_password))==0) && (Email_id.compareTo(Email))==0 && check_email()==0)\r\n {\r\n return 0;\r\n }\r\n else\r\n {\r\n return 1;\r\n }\r\n }", "public boolean comprobarReservaSimultaneaUsuario(String id_usuario, Timestamp horaInicio) {\r\n\t\ttry {\r\n\t\t\tConnection con = conectar();\r\n\t\t\tPreparedStatement ps = con.prepareStatement(\r\n\t\t\t\t\t\"SELECT R.ID_RESERVA FROM RESERVA r WHERE r.ID_USUARIO = ? AND r.HORA_INICIO = ?\");\r\n\t\t\tps.setString(1, id_usuario);\r\n\t\t\tps.setTimestamp(2, horaInicio);\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\trs.close();\r\n\t\t\t\tps.close();\r\n\t\t\t\tcon.close();\r\n\t\t\t\treturn false;\r\n\t\t\t} else {\r\n\t\t\t\trs.close();\r\n\t\t\t\tps.close();\r\n\t\t\t\tcon.close();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof JuezDeTunoControlNombre)) {\r\n return false;\r\n }\r\n JuezDeTunoControlNombre other = (JuezDeTunoControlNombre) object;\r\n if ((this.idNombreJuezControlTurno == null && other.idNombreJuezControlTurno != null) || (this.idNombreJuezControlTurno != null && !this.idNombreJuezControlTurno.equals(other.idNombreJuezControlTurno))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic Boolean vota(String listaElettorale) {\n\t\t//definisco utente registato in questo momento\n\t\tString userVotante = autenticazioneServizio.getUsername();\n\t\tVoto voto = new Voto(userVotante, listaElettorale);\n\t\taggiungiVoto(voto);\n\t\t//controlla se l'user ha già votato\n\t\taggiungiVoto(voto);\n\t\treturn true;\n//\t\tif (verificaVotoValido(userVotante)) {\n//\t\t\t//vota\n//\t\t\taggiungiVoto(voto);\n//\t\t\t\n//\t\t\treturn true;\n//\t\t} else {\n//\t\t\treturn false;\n//\t\t}\n\t}", "boolean isUnique();" ]
[ "0.6164433", "0.60459006", "0.5978634", "0.58812094", "0.58024484", "0.5777989", "0.5769511", "0.57445097", "0.571856", "0.5554237", "0.5537599", "0.5532346", "0.5510153", "0.5475851", "0.54632145", "0.54622984", "0.54596406", "0.5457807", "0.5436019", "0.5423242", "0.54065377", "0.5398408", "0.53968906", "0.5379868", "0.53580487", "0.5346271", "0.5343443", "0.53363794", "0.53335536", "0.53082305", "0.5303738", "0.52873075", "0.5280773", "0.5274608", "0.5272476", "0.5269228", "0.52659255", "0.5265917", "0.5264968", "0.525797", "0.52506065", "0.5242249", "0.5237496", "0.52145433", "0.5214367", "0.5212977", "0.5207341", "0.5200454", "0.5200454", "0.5200454", "0.5200454", "0.5200454", "0.5200454", "0.5200454", "0.5200454", "0.5200454", "0.5200454", "0.5200454", "0.5200364", "0.5197231", "0.5196631", "0.5186686", "0.51839244", "0.5182161", "0.51752496", "0.5170937", "0.51634175", "0.51629466", "0.51621664", "0.5155386", "0.51475805", "0.51467955", "0.51464975", "0.51452684", "0.5138503", "0.51376927", "0.5133308", "0.5133308", "0.5133308", "0.5133308", "0.5133308", "0.5133308", "0.51308554", "0.51306945", "0.5118305", "0.5115293", "0.5113083", "0.5106449", "0.5096244", "0.5092757", "0.5089965", "0.5086088", "0.5085234", "0.50827414", "0.50791836", "0.50788414", "0.5076853", "0.50768507", "0.50751346", "0.50740576" ]
0.73634744
0
Este metodo separa el RUT del cliente a formato xx.xxx.xxxx.
public ArrayList separarRut(String rut){ this.lista = new ArrayList<>(); if(rut.length()==12 || rut.length()==11){ if(rut.length()==12){ this.lista.add(Character.toString(rut.charAt(0))+Character.toString(rut.charAt(1))); this.lista.add(Character.toString(rut.charAt(3))+Character.toString(rut.charAt(4))+Character.toString(rut.charAt(5))); this.lista.add(Character.toString(rut.charAt(7))+Character.toString(rut.charAt(8))+Character.toString(rut.charAt(9))); this.lista.add(Character.toString(rut.charAt(11))); }else{ this.lista.add(Character.toString(rut.charAt(0))); this.lista.add(Character.toString(rut.charAt(2))+Character.toString(rut.charAt(3))+Character.toString(rut.charAt(4))); this.lista.add(Character.toString(rut.charAt(6))+Character.toString(rut.charAt(7))+Character.toString(rut.charAt(8))); this.lista.add(Character.toString(rut.charAt(10))); } } return this.lista; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getIPCliente(){//192.168, 172.16. o 10.0.\n\t\tString ipAddress=\"\";\n\t\ttry{\n\t\t\tHttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n\t\t\tipAddress = request.getHeader(\"X-FORWARDED-FOR\");\n\t\t\tif ( ipAddress == null ) {\n\t\t\t\tipAddress = request.getRemoteAddr();\n\t\t\t\tif(ipAddress.equals(\"127.0.0.1\")){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tipAddress = InetAddress.getLocalHost().getHostAddress();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tipAddress = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] ips = ipAddress.split(\",\");\n\t\t\tfor(String ip : ips){\n\t\t\t\tif(!ip.trim().startsWith(\"127.0.\")){\n\t\t\t\t\tipAddress = ip;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn ipAddress;\n\t}", "public static String getPcNombreCliente(){\n\t\tString host=\"\";\n\t\ttry{\n\t\t\tString ips[] = getIPCliente().split(\"\\\\.\");\n\t\t\tbyte[] ipAddr = new byte[]{(byte)Integer.parseInt(ips[0]),\n\t\t\t\t\t(byte)Integer.parseInt(ips[1]),\n\t\t\t\t\t(byte)Integer.parseInt(ips[2]),\n\t\t\t\t\t(byte)Integer.parseInt(ips[3])};\n\t\t\tInetAddress inet = InetAddress.getByAddress(ipAddr);\n\t\t\thost = inet.getHostName();\n\t\t}catch(Exception ex){\n\t\t\t//Log.error(ex, \"Utiles :: getPcNombreCliente :: controlado\");\n\t\t}\n\t\treturn host;\n\t}", "String getIp();", "String getIp();", "private String getIP() {\n\t\treturn getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE) + Constants.DOT\n\t\t\t\t+ getRandomArbitrary(Constants.MIN_IP_VALUE, Constants.MAX_IP_VALUE);\n\n\t}", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "java.lang.String getIp();", "String getRemoteIpAddress();", "abstract String getRemoteAddress();", "String getRemoteAddr();", "java.lang.String getSnIp();", "java.lang.String getSnIp();", "java.lang.String getIpv4();", "String getAddr();", "public static String ip(boolean useIPv4) {\n\t try {\n\t List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n\t for (NetworkInterface intf : interfaces) {\n\t List<InetAddress> addrs = Collections.list(intf.getInetAddresses());\n\t for (InetAddress addr : addrs) {\n\t if (!addr.isLoopbackAddress()) {\n\t String sAddr = addr.getHostAddress().toUpperCase();\n\t boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr); \n\t if (useIPv4) {\n\t if (isIPv4) \n\t return sAddr;\n\t } else {\n\t if (!isIPv4) {\n\t int delim = sAddr.indexOf('%'); // drop ip6 port suffix\n\t return delim<0 ? sAddr : sAddr.substring(0, delim);\n\t }\n\t }\n\t }\n\t }\n\t }\n\t } catch (Exception ex) { } // for now eat exceptions\n\t return \"\";\n\t }", "int getClientIpV4();", "public String getIp();", "public static String Ipconfig(){\n StringBuilder sbuf = new StringBuilder();\n InetAddress ip;\n String hostname;\n // Inet6Address ipv6; *add a ipv6 to get the ipv6 address\n try {\n ip = InetAddress.getLocalHost();\n hostname = ip.getHostName();\n\n //NetworkInterface network = NetworkInterface.getByInetAddress(ip);\n NetworkInterface nif = NetworkInterface.getByName(\"localhost\");\n //InetAddress[] inet = InetAddress.getAllByName(ip.getHostName());\n //String address = getAddress(inet).getHostAddress();\n\n sbuf.append(\"Default gateway: \"+ip.getLocalHost());\n //fmt.format(\"MAc address:\" + nif.getHardwareAddress());\n sbuf.append(\"\\nCurrent Name : \" + ip.getHostName());\n sbuf.append(\"\\nCurrent IP address : \" + ip.getHostAddress());\n //System.out.println(\"Current IPv6 address : \"+ getByAddress(hostname,inet,nets));// + ipv6.getHostAddress());\n //System.out.println(\"Current IPv6 Temp address : \");// + ipv6.getHostAddress());\n sbuf.append(\"\\nCurrent IPv6 Local : \");// + ipv6.getHostAddress());\n \n } catch(Throwable se){\n se.printStackTrace();\n }\n return sbuf.toString();\n }", "public static String parseHostPort(String fullName){\n\t\t\n\t\tString newName = fullName.trim();\n\t\tString name = \"\";\n\t\tint indexOfSlash1 = newName.indexOf(\"/\");\n\t\tint indexOfColon = newName.indexOf(\":\",indexOfSlash1);\n\t\tint indexOfSlash2 = newName.indexOf(\"/\", indexOfColon);\n\t\tString host = newName.substring(indexOfSlash1+2, indexOfColon);\n\t\tString port = newName.substring(indexOfColon+1,indexOfSlash2);\n\t\tif(indexOfSlash2 +1 < fullName.length())\n\t\t\t name = newName.substring(indexOfSlash2+1);\n\t\tString finalString = host+\" \"+port+\" \"+name;\n\t\treturn finalString;\n\t}", "public static String getIPAddress(boolean useIPv4) throws SocketException{\n List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface netInterface : interfaces) {\n List<InetAddress> addressList = Collections.list(netInterface.getInetAddresses());\n for (InetAddress address : addressList) {\n if (!address.isLoopbackAddress()) {\n String addressString = address.getHostAddress();\n boolean isIPv4 = addressString.indexOf(':') < 0;\n if (useIPv4) {\n if (isIPv4)\n return addressString;\n } else {\n if (!isIPv4) {\n int delim = addressString.indexOf('%'); // drop ip6 zone suffix\n return delim < 0 ? addressString.toUpperCase() : addressString.substring(0, delim).toUpperCase();\n }\n }\n }\n }\n }\n return \"\";\n }", "public static String getServerIP() { return tfJoinIP.getText(); }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "public java.lang.String getIp(){\r\n return localIp;\r\n }", "String getNetzanbieter();", "int getS1Ip();", "public static String getIPAddress(boolean useIPv4) {\r\n\t\ttry {\r\n\t\t\tList<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\r\n\t\t\tfor (NetworkInterface intf : interfaces) {\r\n\t\t\t\tList<InetAddress> addrs = Collections.list(intf.getInetAddresses());\r\n\t\t\t\tfor (InetAddress addr : addrs) {\r\n\t\t\t\t\tif (!addr.isLoopbackAddress()) {\r\n\t\t\t\t\t\tString sAddr = addr.getHostAddress();\r\n\t\t\t\t\t\t//boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr);\r\n\t\t\t\t\t\tboolean isIPv4 = sAddr.indexOf(':')<0;\r\n\r\n\t\t\t\t\t\tif (useIPv4) {\r\n\t\t\t\t\t\t\tif (isIPv4)\r\n\t\t\t\t\t\t\t\treturn sAddr;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (!isIPv4) {\r\n\t\t\t\t\t\t\t\tint delim = sAddr.indexOf('%'); // drop ip6 zone suffix\r\n\t\t\t\t\t\t\t\treturn delim<0 ? sAddr.toUpperCase() : sAddr.substring(0, delim).toUpperCase();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception ex) { } // for now eat exceptions\r\n\t\treturn \"\";\r\n\t}", "public static String getIPAddress(boolean useIPv4) {\n\t\ttry {\n\t\t\tList<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n\t\t\tfor (NetworkInterface intf : interfaces) {\n\t\t\t\tList<InetAddress> addrs = Collections.list(intf.getInetAddresses());\n\t\t\t\tfor (InetAddress addr : addrs) {\n\t\t\t\t\tif (!addr.isLoopbackAddress()) {\n\t\t\t\t\t\tString sAddr = addr.getHostAddress();\n\t\t\t\t\t\t//boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr);\n\t\t\t\t\t\tboolean isIPv4 = sAddr.indexOf(':')<0;\n\n\t\t\t\t\t\tif (useIPv4) {\n\t\t\t\t\t\t\tif (isIPv4)\n\t\t\t\t\t\t\t\treturn sAddr;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!isIPv4) {\n\t\t\t\t\t\t\t\tint delim = sAddr.indexOf('%'); // drop ip6 zone suffix\n\t\t\t\t\t\t\t\treturn delim<0 ? sAddr.toUpperCase() : sAddr.substring(0, delim).toUpperCase();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t} // for now eat exceptions\n\t\treturn \"\";\n\t}", "String getHost();", "@Test\n public void testClient() throws Exception {\n final CandidateProvider<InetSocketAddress> stunCandidateProvider = \n new DnsSrvCandidateProvider(\"_stun._udp.littleshoot.org\");\n /*\n new SrvCandidateProvider(srv, \"_stun._udp.littleshoot.org\", \n new InetSocketAddress(\"stun.littleshoot.org\", StunConstants.STUN_PORT));\n */\n // We do this a bunch of times because the server selection is random.\n for (int i = 0; i < 20; i++) {\n final UdpStunClient client = new UdpStunClient(\n stunCandidateProvider);\n final InetSocketAddress srflx = client.getServerReflexiveAddress();\n // System.out.println(\"Got address: \"+srflx);\n assertNotNull(\"Did not get server reflexive address\", srflx);\n }\n }", "public static String getIPAddress(boolean useIPv4) {\n try {\n List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface intf : interfaces) {\n List<InetAddress> addrs = Collections.list(intf.getInetAddresses());\n for (InetAddress addr : addrs) {\n if (!addr.isLoopbackAddress()) {\n String sAddr = addr.getHostAddress();\n boolean isIPv4 = sAddr.indexOf(':') < 0;\n\n if (useIPv4) {\n if (isIPv4)\n return sAddr;\n } else {\n if (!isIPv4) {\n int delim = sAddr.indexOf('%'); // drop ip6 zone suffix\n return delim < 0 ? sAddr.toUpperCase() : sAddr.substring(0, delim).toUpperCase();\n }\n }\n }\n }\n }\n } catch (Exception ignored) {\n } // for now eat exceptions\n return \"\";\n }", "private String getDomain(String host){\n StringBuffer sb = new StringBuffer(\"\");\r\n try{\r\n StringTokenizer stk = new StringTokenizer(host, \".\");\r\n sb.append(stk.nextToken());\r\n sb.append(\".\");\r\n sb.append(stk.nextToken());\r\n sb.append(\".\");\r\n sb.append(stk.nextToken());\r\n sb.append(\".\");\r\n sb.append(\"*\");\r\n }catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n return sb.toString();\r\n }", "public static String getMacCliente(){\n\t\tInetAddress ip;\n\t\tbyte[] mac = null;\n\t\tStringBuilder sb = new StringBuilder();\n\t\ttry {\n\t\t\tip = InetAddress.getLocalHost();\n\t\t\tNetworkInterface network = NetworkInterface.getByInetAddress(ip);\n\n\t\t\tmac = network.getHardwareAddress();\n\t\t\tfor (int i = 0; i < mac.length; i++) {\n\t\t\t\tsb.append(String.format(\"%02X%s\", mac[i],(i < mac.length - 1) ? \"-\" : \"\"));\n\t\t\t}\n\t\t} catch (UnknownHostException e) {\n\t\t\t//Log.error(e, \"Utiles :: getMacCliente :: controlado\");\n\t\t} catch (SocketException e) {\n\t\t\t//Log.error(e, \"Utiles :: getMacCliente :: controlado\");\n\t\t} catch (NullPointerException e){\n\t\t\t//Log.error(e, \"Utiles :: getMacCliente :: controlado\");\n\t\t}\n\t\treturn sb.toString();\n\t}", "private String cleanHostHeader(String header) {\n String[] hostPieces = header.split(\":\")[1].split(\"\\\\.\");\n if(hostPieces.length > 2) {\n return \"Host: \"+(\"redacted.\"+hostPieces[hostPieces.length-2]+\".\"+hostPieces[hostPieces.length-1]);\n } else {\n return \"Host: \"+(\"redacted.\"+hostPieces[hostPieces.length-1]);\n }\n }", "String getRemoteHostName();", "public String rmvIprt(){\n return \"RMV IPRT:SRN=\"+iprt.getSrn()+\n \",SN=\"+iprt.getSn()+\n \",DSTIP=\\\"\"+iprt.getDstip()+\"\\\"\"+\n \",DSTMASK=\\\"\"+iprt.getDstmask()+\"\\\"\"+\n \",NEXTHOP=\\\"\"+iprt.getNexthop()+\"\\\"\"+\n \",FORCEEXECUTE=YES; {\"+rncName+\"}\"; \n }", "private ZapTextField getTxtProxyIp() {\n \t\tif (txtProxyIp == null) {\n \t\t\ttxtProxyIp = new ZapTextField(\"\");\n \t\t}\n \t\treturn txtProxyIp;\n \t}", "private static String m21403f() {\n String str;\n String str2 = \"\";\n try {\n Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces();\n while (networkInterfaces.hasMoreElements()) {\n Enumeration inetAddresses = ((NetworkInterface) networkInterfaces.nextElement()).getInetAddresses();\n while (inetAddresses.hasMoreElements()) {\n InetAddress inetAddress = (InetAddress) inetAddresses.nextElement();\n if (!inetAddress.isLoopbackAddress()) {\n str2 = inetAddress.getHostAddress();\n }\n }\n }\n } catch (Throwable th) {\n C5205o.m21464a(th);\n }\n return str;\n }", "java.lang.String getServerAddress();", "@Override\n\t\tpublic String buildBasicIp() {\n\t\t\treturn buildIp();\n\t\t}", "public static String getIPAddress(boolean useIPv4) {\n try {\n List<NetworkInterface> interfaces = Collections\n .list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface intf : interfaces) {\n List<InetAddress> addrs = Collections.list(intf\n .getInetAddresses());\n for (InetAddress addr : addrs) {\n if (!addr.isLoopbackAddress()) {\n String sAddr = addr.getHostAddress().toUpperCase();\n//\t\t\t\t\t\tboolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr);\n boolean isIPv4 = (addr instanceof Inet4Address) ? true : false;\n if (useIPv4) {\n\n if (isIPv4)\n return sAddr;\n } else {\n if (!isIPv4) {\n int delim = sAddr.indexOf('%'); // drop ip6 port\n // suffix\n return delim < 0 ? sAddr : sAddr.substring(0,\n delim);\n }\n }\n }\n }\n }\n } catch (Exception ex) {\n } // for now eat exceptions\n return \"\";\n }", "java.lang.String getAgentIP();", "public String getUpnpExternalIpaddress();", "java.lang.String getHost();", "java.lang.String getHost();", "java.lang.String getSubnet();", "String host();", "private String getIPAddress() throws Exception {\n //Don't need the line of code below, TODO: delete it!\n InetAddress getIP = InetAddress.getLocalHost();\n String thisSystemAddress = \"\";\n try{\n URL thisUrl = new URL(\"http://bot.whatismyipaddress.com\");\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(thisUrl.openStream()));\n thisSystemAddress = bufferedReader.readLine().trim();\n } catch (Exception e){\n e.printStackTrace();\n e.getCause();\n }\n\n return thisSystemAddress;\n }", "public String getNiceServerIP(){\n\t\treturn(niceServerAddress);\n\t}", "public static String getIPAddress(boolean useIPv4) {\n try {\n List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());\n for (NetworkInterface intf : interfaces) {\n List<InetAddress> addrs = Collections.list(intf.getInetAddresses());\n for (InetAddress addr : addrs) {\n if (!addr.isLoopbackAddress()) {\n String sAddr = addr.getHostAddress().toUpperCase();\n boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr);\n if (useIPv4) {\n if (isIPv4)\n return sAddr;\n } else {\n if (!isIPv4) {\n int delim = sAddr.indexOf('%'); // drop ip6 port suffix\n return delim<0 ? sAddr : sAddr.substring(0, delim);\n }\n }\n }\n }\n }\n } catch (Exception ex) { } // for now eat exceptions\n return \"\";\n }", "int getIp();", "int getIp();", "int getIp();", "public static String getIPAddress(boolean useIPv4) {\r\n\t\ttry {\r\n\t\t\tList<NetworkInterface> interfaces = Collections\r\n\t\t\t\t\t.list(NetworkInterface.getNetworkInterfaces());\r\n\t\t\tfor (NetworkInterface intf : interfaces) {\r\n\t\t\t\tList<InetAddress> addrs = Collections.list(intf\r\n\t\t\t\t\t\t.getInetAddresses());\r\n\t\t\t\tfor (InetAddress addr : addrs) {\r\n\t\t\t\t\tif (!addr.isLoopbackAddress()) {\r\n\t\t\t\t\t\tString sAddr = addr.getHostAddress();\r\n\t\t\t\t\t\t// boolean isIPv4 =\r\n\t\t\t\t\t\t// InetAddressUtils.isIPv4Address(sAddr);\r\n\t\t\t\t\t\tboolean isIPv4 = sAddr.indexOf(':') < 0;\r\n\r\n\t\t\t\t\t\tif (useIPv4) {\r\n\t\t\t\t\t\t\tif (isIPv4)\r\n\t\t\t\t\t\t\t\treturn sAddr;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (!isIPv4) {\r\n\t\t\t\t\t\t\t\tint delim = sAddr.indexOf('%'); // drop ip6 zone\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// suffix\r\n\t\t\t\t\t\t\t\treturn delim < 0 ? sAddr.toUpperCase() : sAddr\r\n\t\t\t\t\t\t\t\t\t\t.substring(0, delim).toUpperCase();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t} // for now eat exceptions\r\n\t\treturn \"\";\r\n\t}", "public String getURL(){\r\n\t\tString url = \"rmi://\";\r\n\t\turl += this.getAddress()+\":\"+this.getPort()+\"/\";\r\n\t\treturn url;\r\n\t}", "java.lang.String getTelefon();", "@Override\r\n public String getIPAddress() {\r\n return address;\r\n }", "public void getNetworkIPs(String subRed)\n {\n //ArrayList<String> disponibles = new ArrayList<String>();\n //InetAddress servidor = null;\n for (int i = 1; i < 255; i++) \n {\n final int j = i;\n new Thread(() -> {\n try {\n String ser = subRed + \".\" + j;\n //System.out.println(\"Entre en el servidor: \" + ser);\n InetAddress servidor = InetAddress.getByName(subRed + \".\" + j);\n if(servidor.isReachable(2000))\n {\n //System.out.println(\"PPPPADDDDAAAAAAAAAAA\");\n if(this.isReachable(ser, 9020))\n {\n System.out.println(\"Disponible: \" + ser);\n this.conectados.add(servidor);\n } \n }\n else\n System.out.println(\"No disponible \" + ser);\n } catch (IOException e) \n {\n System.out.println(\"Error buscando ips\");\n }\n \n }).start(); \n }\n \n //return disponibles;\n }", "private String getIp(){\n\t\tStringBuilder ip=new StringBuilder(20);\n\t\t\n\t\tEditText ip1=(EditText) findViewById(R.id.ipaddress_text_1);\n\t\tEditText ip2=(EditText) findViewById(R.id.ipaddress_text_2);\n\t\tEditText ip3=(EditText) findViewById(R.id.ipaddress_text_3);\n\t\tEditText ip4=(EditText) findViewById(R.id.ipaddress_text_4);\n\t\tEditText ip5=(EditText) findViewById(R.id.ipaddress_text_5);\n\t\t\n\t\tip.append(ip1.getText());\n\t\tip.append('.');\n\t\tip.append(ip2.getText());\n\t\tip.append('.');\n\t\tip.append(ip3.getText());\n\t\tip.append('.');\n\t\tip.append(ip4.getText());\n\t\tif(!(ip5.getText().toString().equals(\"\"))){\n\t\t\tip.append(':');\n\t\t\tip.append(ip5.getText());\n\t\t}\n\t\t\n\t\treturn ip.toString();\n\t}", "String getIntegHost();", "java.lang.String getBitcoinAddress();", "public void getIP(){\n String requestIP = DomainTextField.getText();\n\n Connection conn = new Connection();\n\n String domain = conn.getIP(requestIP);\n\n output.writeln(requestIP + \" --> \" + domain);\n }", "java.lang.String getRemoteHost();", "@Test\n public void testToStringIPv4() {\n Ip4Address ipAddress;\n\n ipAddress = Ip4Address.valueOf(\"1.2.3.4\");\n assertThat(ipAddress.toString(), is(\"1.2.3.4\"));\n\n ipAddress = Ip4Address.valueOf(\"0.0.0.0\");\n assertThat(ipAddress.toString(), is(\"0.0.0.0\"));\n\n ipAddress = Ip4Address.valueOf(\"255.255.255.255\");\n assertThat(ipAddress.toString(), is(\"255.255.255.255\"));\n }", "public String getNetwork() {\n String[] ipOctets = ipAddress.split(\"\\\\.\");\n String[] subnetOctets = subnetMask.split(\"\\\\.\");\n String[] result = ipOctets;\n\n for (int i = 0; i < 4; i++) {\n if (!\"255\".equals(subnetOctets[i])) {\n int sub = Integer.parseInt(subnetOctets[i]);\n int ip = Integer.parseInt(ipOctets[i]);\n result[i] = String.format(\"%s\", (ip & sub));\n }\n }\n\n return String.join(\".\", result);\n }", "private String getLocalNameSpaceURI() {\n String localNameSpace = \"\";\n\n try {\n URL locator = new URL(IP_SERVICE_URL);\n URLConnection connection = locator.openConnection();\n InputStream is = connection.getInputStream();\n InputStreamReader isr = new InputStreamReader(is);\n BufferedReader reader = new BufferedReader(isr);\n String str = reader.readLine();\n if (null == str) {\n str = \"127.0.0.1\";\n }\n localNameSpace = InetAddress.getLocalHost().getHostName() + \"@\" + str + \"#\";\n } catch (IOException e) {\n try {\n localNameSpace = InetAddress.getLocalHost().getHostName() + \"@\"\n + InetAddress.getLoopbackAddress() + \"#\";\n } catch (UnknownHostException ex) {\n localNameSpace = \"[email protected]#\";\n }\n }\n\n return localNameSpace;\n }", "public String getIP() throws Exception {\n this.IPAddress = \"http://192.168.1.15\";\n return this.IPAddress;\n }", "public static String formatearRut(String rut){\r\n int cont = 0;\r\n String format;\r\n rut= rut.replace(\".\", \"\");\r\n rut = rut.replace(\"-\", \"\");\r\n format= \"-\" + rut.substring(rut.length()-1);\r\n for(int i = rut.length()-2; i>=0;i--){\r\n format=rut.substring(i,i+1)+format;\r\n cont++;\r\n if(cont==3 && i!=0){\r\n format= \".\"+format;\r\n cont=0;\r\n }\r\n }\r\n return format;\r\n }", "public String getBoxNetHost();", "public String buildAddressString() {\n StringBuilder builder =\n ThreadLocalStringBuilder.get().append(ipAddress).append(COLON).append(port);\n return builder.toString();\n }", "public String getHost();", "public String getHost();", "@SuppressLint(\"DefaultLocale\")\n private String formatIP(int ip) {\n return String.format(\n \"%d.%d.%d.%d\",\n (ip & 0xff),\n (ip >> 8 & 0xff),\n (ip >> 16 & 0xff),\n (ip >> 24 & 0xff)\n );\n }", "private String sprawdzRozszerzenie(String adresPliku) {\r\n\t\tString[] tablica = adresPliku.split(\"\\\\.\");\r\n\r\n\t\treturn tablica[tablica.length - 1];\r\n\t}", "public static String decodeIp(int ip) {\r\n return (ip >> 24 & 0xff) + \".\" + (ip >> 16 & 0xff) + \".\" + (ip >> 8 & 0xff) + \".\" + (ip & 0xff);\r\n }", "public static String getGateWayIp() {\n try {\n for (Enumeration<NetworkInterface> en = NetworkInterface\n .getNetworkInterfaces(); en.hasMoreElements();) {\n NetworkInterface intf = en.nextElement();\n for (Enumeration<InetAddress> ipAddr = intf.getInetAddresses(); ipAddr\n .hasMoreElements();) {\n InetAddress inetAddress = ipAddr.nextElement();\n if (!inetAddress.isLoopbackAddress()) {\n if (inetAddress.getHostAddress().length() <= 16) {\n return inetAddress.getHostAddress();\n }\n }\n }\n }\n } catch (SocketException ex) {\n ex.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return \"\";\n }", "public String getIP() throws UnknownHostException{\n\t\tInetAddress addr = InetAddress.getLocalHost();//Get local IP\n \t String ip = addr.toString().split(\"\\\\/\")[1];//local IP\n \t //ip = ip.indexOf('\\\\');\n \t if(!getIsLocal()){\n\t \ttry{\n\t\t \tURL whatismyip = new URL(\"http://automation.whatismyip.com/n09230945.asp\");\n\t\t \tBufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t \t whatismyip.openStream()));\n\t\t \tip = in.readLine(); //you get the IP as a String\n\t\t \t//System.out.println(ip);\n\t\t \tin.close();\n\t\t \treturn ip;\n\n\t \t}\n\t \tcatch(IOException e){\n\t \t\te.printStackTrace();\n\t \t}\n\t \treturn null;\n \t }\n\t\treturn ip;\n\t }", "String endpoint();", "public static String getDotUrl()\n {\n return \"http://log.tusumobi.com/dot\";\n }", "java.lang.String getUserDN();", "public static void main(String[] args) {\n\t\t\n//\t String url=\"http://123.124.236.149\";\n//\t\tInteger port=8078;\n\t\t\n//\t\tString url=\"http://192.168.1.199\";\n//\t\tInteger port=8078;\n\t\t\n\t\tString url=\"http://gw2.gosmarthome.cn\";\n\t\tInteger port=8079;\n\t\t\n//\t\tString url=\"http://119.40.24.25\";\n//\t\tInteger port=8079;\n\t\t\n//\t\tString url=\"http://10.41.1.29\"; \n//\t\tInteger port=8086;\n\t\t\n//\t\t10.32.2.57 8078\n//\t\tString url=\"http://10.32.2.232\"; \n//\t\tInteger port=8078;\n\n\t\t\n\t\tString factoryId=\"gptest2015\";\n\t UDPClientDemo client=new UDPClientDemo(url,factoryId,port);\n\t try {\n\t\t\tclient.login();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "String getHostName();", "String getHostName();", "public static String[] Lectura(Socket Entrada){\n String[] retorno=null;\n try {\n BufferedReader Lector = new BufferedReader(new InputStreamReader(Entrada.getInputStream()));\n String Texto = Lector.readLine();\n if (RevisionFormato.Format(Texto, \"~\")) {\n retorno = Texto.split(\"~\");\n }\n else{\n }\n }\n catch (Exception e){\n\n }\n return retorno;\n }", "private static String getBaseUrl() {\n StringBuilder url = new StringBuilder();\n url.append(getProtocol());\n url.append(getHost());\n url.append(getPort());\n url.append(getVersion());\n url.append(getService());\n Log.d(TAG, \"url_base: \" + url.toString());\n return url.toString();\n }", "private static void selectCordinator() throws NumberFormatException, UnknownHostException, IOException {\n\t\t// TODO Auto-generated method stub\n\t\tRandom randomGen = new Random();\n\t\tSystem.out.println(\"Size: \"+allReplicaAddrs.size());\n\t\tint index = randomGen.nextInt(allReplicaAddrs.size());\n\t\tString arrayItem = allReplicaAddrs.get(index);\n\t\tString[] ipPort = arrayItem.split(\" \");\n\t\tcoordIp = ipPort[0];\n\t\tcoordPort = Integer.parseInt(ipPort[1]);\n\t\t//socket = new Socket(coordIp,coordPort);\n\t}", "int getInIp();", "int getInIp();", "@Override\n public int getClientIpV4() {\n return clientIpV4_;\n }", "public java.lang.String getport_SimpleProvisioningAddress();", "public static String restoreIP(Context context)\n {\n SharedPreferences settings = context.getSharedPreferences(\"chihlee\", 0);\n //取出name屬性的字串\n return settings.getString(\"ip\", \"127.0.0.1\");\n }", "public String getHostName();", "private String longToIpv4(long Ipv4long){\n\t\tString IpStr = \"\";\n\t\tfinal long mask = 0xff;\n\t\t\n\t\tIpStr = Long.toString(Ipv4long & mask);\n\t\tfor (int i = 1; i < 4; ++i){\n\t\t\tIpv4long = Ipv4long >> 8;\n\t\t\tIpStr = (Ipv4long & mask) + \".\" + IpStr;\n\t\t}\n\t\treturn IpStr;\n\t}", "java.lang.String getIpv6();", "public static String getZookeeperConnectString(String zookeepers, int zkPort) {\r\n StringTokenizer tokens = new StringTokenizer(zookeepers, \",\");\r\n List<String> hosts = new ArrayList<String>();\r\n while (tokens.hasMoreTokens()) {\r\n hosts.add(tokens.nextToken());\r\n }\r\n Collections.shuffle(hosts); // try addressing different zookeepers as first\r\n StringBuffer result = new StringBuffer();\r\n Iterator<String> iter = hosts.iterator();\r\n while (iter.hasNext()) {\r\n result.append(iter.next());\r\n result.append(\":\");\r\n result.append(zkPort);\r\n if (iter.hasNext()) {\r\n result.append(\",\");\r\n }\r\n }\r\n return result.toString();\r\n }", "@Override\n public int getClientIpV4() {\n return clientIpV4_;\n }" ]
[ "0.65344054", "0.58736557", "0.5787115", "0.5787115", "0.5772045", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.57436585", "0.57093346", "0.5690034", "0.567917", "0.567917", "0.5607276", "0.560507", "0.54845285", "0.54773605", "0.54701823", "0.5453112", "0.5447229", "0.54397625", "0.54335916", "0.54210925", "0.54210925", "0.5406045", "0.5382795", "0.5373719", "0.53652406", "0.53616893", "0.53573275", "0.53504586", "0.53480333", "0.53305006", "0.5326402", "0.5302485", "0.529872", "0.52975744", "0.5293528", "0.5285436", "0.5274845", "0.5271109", "0.52692205", "0.5261871", "0.52531147", "0.52531147", "0.52510846", "0.5240692", "0.52342963", "0.52292114", "0.52258277", "0.5218913", "0.5218913", "0.5218913", "0.5213133", "0.5188394", "0.51835805", "0.51734567", "0.5164117", "0.5162887", "0.513615", "0.51357865", "0.51347387", "0.5119524", "0.5118406", "0.5112633", "0.51093274", "0.510871", "0.5107944", "0.5098173", "0.5095674", "0.508644", "0.508644", "0.50813836", "0.50757074", "0.50660926", "0.50648", "0.5063601", "0.5058179", "0.50566477", "0.5036052", "0.5035403", "0.50331855", "0.50331855", "0.50233483", "0.50217474", "0.50203973", "0.50167745", "0.50167745", "0.501282", "0.5002696", "0.4996066", "0.4980638", "0.4976981", "0.49722573", "0.49622375", "0.49606663" ]
0.0
-1
Este metodo limita el numero de caracteres ingresados en los JTextfields.
public void limitarCaracteres(JTextField l, int nmax){ l.addKeyListener(new KeyAdapter(){ @Override public void keyTyped(KeyEvent e){ if (l.getText().length()==nmax){ e.consume();} } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setCharLimitOnFields() {\n Common.setCharLimit(nameField, Constants.CHAR_LIMIT_NORMAL);\n Common.setCharLimit(addressField, Constants.CHAR_LIMIT_LARGE);\n Common.setCharLimit(postalField, Constants.CHAR_LIMIT_NORMAL);\n Common.setCharLimit(phoneField, Constants.CHAR_LIMIT_NORMAL);\n }", "void setMaxCharSize(int value);", "private void txt_observacionesKeyTyped(java.awt.event.KeyEvent evt) {\n if (txt_observaciones.getText().length()>= 500){\n\n evt.consume();\n JOptionPane.showMessageDialog(rootPane,\"Alcanzo el maximo de caracteres (500 caracteres)\");\n }\n }", "private void maxPepLengthTxtKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_maxPepLengthTxtKeyReleased\n validateInput(false);\n }", "private void minPepLengthTxtKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_minPepLengthTxtKeyReleased\n validateInput(false);\n }", "public int getTextLength();", "public InstrutorCadastrarTela() {\n initComponents();\n //Limite de caracateres e apenas caracteres permitidos\n jTextFieldNome.setDocument(new classesBasicas.CaracterLimitePermitido(60));\n //Limitando os caracteres para (N), independende de ser numero ou letras\n jTextFieldRg.setDocument(new classesBasicas.JTextFieldLimite(20)); \n }", "public void letras() {\n caracteres = 32 - txtMensaje.getText().length(); //Indica la catidad de carcteres\n //disponibles. En el LCD solo se permite imprimir 32 caracteres.\n\n if (caracteres <= 0) { //Si la cantidad de caracteres se ha agotado... \n lbCaracteres.setText(\"Caracteres disponibles: 0\"); //Se imprime que la cantidad de \n //caracteres disponibles es 0\n String cadena = \"\"; //Se declara la variable que guardará el mensaje a enviar\n cadena = txtMensaje.getText(); //Se asigna el texto del TextField a la variable cadena\n cadena = cadena.substring(0, 32); //Se evita que por alguna razón la variable contenga\n //más de 32 caracteres, utilizando el substring que crea un string a partir de uno mayor.\n txtMensaje.setText(cadena); //se regresa la cadena con 32 caracteres al TextField\n } else {\n //Si la cantidad de caracteres disponibles es ayor a 0 solamente se imprimirá la cantidad\n //de caracteres disponibles\n lbCaracteres.setText(\"Caracteres disponibles: \" + (caracteres));\n }\n }", "public static void campoTextoTipoNumero(javax.swing.JTextField campo) {\n campo.addKeyListener(new java.awt.event.KeyAdapter() {\n @Override\n public void keyReleased(java.awt.event.KeyEvent e) {\n }\n\n @Override\n public void keyTyped(java.awt.event.KeyEvent e) {\n char caracter = e.getKeyChar();\n // Verificar si la tecla pulsada no es un digito\n if (((caracter < '0') || (caracter > '9')) && (caracter != '\\b' /*corresponde a BACK_SPACE*/)) {\n e.consume(); // ignorar el evento de teclado\n }\n }\n\n @Override\n public void keyPressed(java.awt.event.KeyEvent e) {\n }\n });\n }", "void setMaxStringLiteralSize(int value);", "int getTextLength();", "public void report_number_zone(){\n\n JLabel lbl_num = new JLabel(\"Num\\u00E9ro du Rapport :\");\n lbl_num.setBounds(40, 10, 129, 16);\n add(lbl_num);\n\n num_content = new JTextField();\n num_content.setHorizontalAlignment(SwingConstants.RIGHT);\n num_content.setEditable(false);\n num_content.setBounds(200, 7, 116, 22);\n num_content.setColumns(10);\n num_content.setText(rapport_visite.elementAt(DAO_Rapport.indice)[0]);\n add(num_content);\n\n\n\n\n }", "private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {\n String cadena;\n cadena = campoDeNumeros.getText();\n \n if(cadena.length() >0) {\n cadena = cadena.substring( 0, cadena.length() -1);\n campoDeNumeros.setText(cadena);\n }\n }", "private void makeFormattedTextField(){\n textField = new JTextField(\"\"+ShapeFactory.getRoundness(), 3);\n //add listener that happens after each type and make the field accept only numbers between 0 to 100\n textField.addKeyListener(new KeyAdapter() {\n @Override\n public void keyTyped(KeyEvent e) {\n super.keyTyped(e);\n typeEvent(e);\n }\n });\n }", "private JTextField getJTextField6() {\r\n\t\tif (jTextField6 == null) {\r\n\t\t\tjTextField6 = new JTextField();\r\n\t\t\tjTextField6.setBounds(new Rectangle(243, 217, 282, 19));\r\n\t\t\tjTextField6.addKeyListener(new KeyAdapter()\r\n\t\t\t{\r\n\t\t\t\t public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\r\n\t\t\t\t\t //Controlar el largo del text\r\n\t\t\t\t String s = jTextField3.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 50){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t});\r\n\t\t}\r\n\t\treturn jTextField6;\r\n\t}", "public void setTextLength(short field_6_textLength)\n {\n this.field_6_textLength = field_6_textLength;\n }", "private void allowOnlyNumbers(JTextField txtField) {\r\n txtField.addKeyListener(new KeyAdapter() {\r\n public void keyPressed(KeyEvent ke) {\r\n if (ke.getKeyChar() >= '0' && ke.getKeyChar() <= '9'\r\n || ke.getKeyCode() == KeyEvent.VK_BACK_SPACE\r\n ) {\r\n txtField.setEditable(true);\r\n } else {\r\n txtField.setEditable(false);\r\n msgDialog.showWarningMsg(null, \"Bitte geben Sie nur Zahlen an.\");\r\n txtField.setEditable(true);\r\n }\r\n }\r\n });\r\n }", "java.lang.String getField1022();", "public FormCliente() {\n initComponents();\n txtLimiteDeCredito.addKeyListener(new KeyAdapter() {\n @Override\n public void keyTyped(KeyEvent e) {\n System.out.println(txtLimiteDeCredito.getText() );\n \n if((int)e.getKeyChar() == KeyEvent.VK_PERIOD && !txtLimiteDeCredito.getText().contains(\".\")){\n return;\n }\n \n if((int)e.getKeyChar() < KeyEvent.VK_0 || (int)e.getKeyChar() > KeyEvent.VK_9) { \n e.consume();\n }\n }\n \n });\n \n setLocationRelativeTo(null);\n \n campos = new JTextField[]{txtCedula, txtNombre, txtApellido, txtDireccion, txtTelefono, txtLimiteDeCredito};\n }", "private JTextField getJTextField4() {\r\n\t\tif (jTextField4 == null) {\r\n\t\t\tjTextField4 = new JTextField();\r\n\t\t\tjTextField4.setBounds(new Rectangle(243, 243, 282, 19));\r\n\t\t\tjTextField4.addKeyListener(new KeyAdapter()\r\n\t\t\t{\r\n\t\t\t\t public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\r\n\t\t\t\t\t //Controlar el largo del text\r\n\t\t\t\t String s = jTextField4.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 50){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t});\r\n\t\t}\r\n\t\treturn jTextField4;\r\n\t}", "public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\n\t\t\t\t\t char caracter = e.getKeyChar();\r\n\t\t\t\t\t if(((caracter < '0') ||\r\n\t\t\t\t\t\t\t (caracter > '9')) &&\r\n\t\t\t\t\t\t\t (caracter != KeyEvent.VK_BACK_SPACE))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t\t }\r\n\r\n\t\t\t\t //Controlar el largo del text\r\n\t\t\t\t String s = jTextField1.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 10){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }", "@Override\n public void afterTextChanged(Editable s) {\n editStart = edRoomIntroduce.getSelectionStart();\n editEnd = edRoomIntroduce.getSelectionEnd();\n tvRoomIntroduceLength.setText(\"\" + temp.length());\n if (temp.length() > 15) {\n Toast.makeText(mContext,\n \"你输入的字数已经超过了限制!\", Toast.LENGTH_SHORT)\n .show();\n s.delete(editStart-1, editEnd);\n int tempSelection = editStart;\n edRoomIntroduce.setText(s);\n edRoomIntroduce.setSelection(tempSelection);\n }\n }", "@Override\n public void afterTextChanged(Editable s) {\n editStart = edRoomName.getSelectionStart();\n editEnd = edRoomName.getSelectionEnd();\n tvRoomLength.setText(\"\" + temp.length());\n if (temp.length() > 15) {\n Toast.makeText(mContext,\n \"你输入的字数已经超过了限制!\", Toast.LENGTH_SHORT)\n .show();\n s.delete(editStart-1, editEnd);\n int tempSelection = editStart;\n edRoomName.setText(s);\n edRoomName.setSelection(tempSelection);\n }\n }", "private JTextField getMaxTextField() {\r\n\t\tif (maxTextField == null) {\r\n\t\t\tmaxTextField = new JTextField();\r\n\t\t\tif (mode == RULES_BASIS_SUPPORT_MODE) {\r\n\t\t\t\tmaxTextField.setText(\"\"+rulesBasis.getMaxSupport());\r\n\t\t\t} else if (mode == RULES_BASIS_CONFIDENCE_MODE) {\r\n\t\t\t\tmaxTextField.setText(\"\"+rulesBasis.getMaxConfidence());\r\n\t\t\t} else if (mode == INTENTS_BASIS_SUPPORT_MODE) {\r\n\t\t\t\tmaxTextField.setText(\"\"+intentsBasis.getMaxSupport());\r\n\t\t\t}\r\n\t\t\tmaxTextField.setPreferredSize(new java.awt.Dimension(30,20));\r\n\t\t}\r\n\t\treturn maxTextField;\r\n\t}", "public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\n\t\t\t\t String s = jTextField4.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 50){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }", "private RTextField getLicenseProcessElementsLimitTextField() {\n if (licenseProcessElementsLimitTextField == null) {\n licenseProcessElementsLimitTextField = new RTextField();\n licenseProcessElementsLimitTextField.setText(\"\");\n licenseProcessElementsLimitTextField.setEditable(false);\n licenseProcessElementsLimitTextField.setName(\"licenseProcessElementsLimitTextField\");\n }\n return licenseProcessElementsLimitTextField;\n }", "public int getMinimumCharacters() {\n checkWidget();\n return minChars;\n }", "public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\n\t\t\t\t String s = jTextField.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 20){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }", "java.lang.String getField1072();", "public void textBoxRestrictions(){\r\n\r\n /***************** channel textbox input checker(allows integers only) *****************/\r\n channel.setTextFormatter(new TextFormatter<>((change) -> {\r\n String text = change.getControlNewText();\r\n if (text.matches(\"\\\\d*\")) {\r\n return change;\r\n } else {\r\n return null;\r\n }\r\n }));\r\n\r\n /***************** tpo textbox input checker(allows decimal numbers and integers) *****************/\r\n tpo.setTextFormatter(new TextFormatter<>((change) -> {\r\n String text = change.getControlNewText();\r\n if (text.matches(\"\\\\d*\\\\.?\\\\d*\")) {\r\n return change;\r\n } else {\r\n return null;\r\n }\r\n }));\r\n\r\n }", "public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\n\t\t\t\t\t char caracter = e.getKeyChar();\r\n\t\t\t\t\t if(((caracter < '0') ||\r\n\t\t\t\t\t\t\t (caracter > '9')) &&\r\n\t\t\t\t\t\t\t (caracter != KeyEvent.VK_BACK_SPACE))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t\t }\r\n\r\n\t\t\t\t //Controlar el largo del text\r\n\t\t\t\t String s = jTextField3.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 8){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }", "@Override\r\n\t\t\tpublic void afterTextChanged(Editable s) {\n\t\t\t\tif(et.getText().length() >= 100){\r\n\t\t\t\t\tCommonUtil.ShowToast(ThirdCommentPageActivity.this, \"主人,您写那么多字做咩?\");\r\n\t\t\t\t}\r\n\t\t\t\tinput_cur = 100-et.getText().length();\r\n\t\t\t\tinput_num.setText(\"您还可输入\"+input_cur+\"字\");\r\n\t\t\t}", "public Builder setField1072(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n field1072_ = value;\n onChanged();\n return this;\n }", "public int getMaxLength();", "public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\n\t\t\t\t String s = jTextField5.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 50){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }", "public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\n\t\t\t\t String s = jTextField2.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 20){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }", "public FrmTelefone() {\n initComponents();\n // preencherTabela(\"\\\"select * from telefone order by id_telefone\\\")\");\n try {\n MaskFormatter form = new MaskFormatter(\"(##)####-####\");\n jFormattedTextFieldNum.setFormatterFactory(new DefaultFormatterFactory(form));\n \n \n \n } catch (ParseException ex) {\n JOptionPane.showMessageDialog(null, \"erros ao mostrar dados\" + ex); \n \n }\n }", "public static int getFieldWidth() {\n return FIELD_WIDTH;\n }", "private JTextField getJTextField5() {\r\n\t\tif (jTextField5 == null) {\r\n\t\t\tjTextField5 = new JTextField();\r\n\t\t\tjTextField5.setBounds(new Rectangle(243, 191, 282, 19));\r\n\t\t\tjTextField5.addKeyListener(new KeyAdapter()\r\n\t\t\t{\r\n\t\t\t\t public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\r\n\t\t\t\t\t //Controlar el largo del text\r\n\t\t\t\t String s = jTextField5.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 50){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t});\r\n\t\t}\r\n\t\treturn jTextField5;\r\n\t}", "int getMaxCharSize();", "public abstract int getMaxLength();", "private void event(KeyEvent e ,JTextField textField) {\n\t\tchar n = e.getKeyChar();\r\n\t\tif (!Character.isDigit(n) && n != 8 && n != 46)\r\n\t\t{\r\n\t\t\tlogp(INFO, getClassName(GraphicalUserInterface.class), \"event\", \"Вы ввели не числовое значение\".concat(textField.getText()));\r\n\t\t\ttextField.setEditable(false);\r\n\t\t}else {\r\n\t\t\tlogp(INFO, getClassName(GraphicalUserInterface.class), \"event\", \"Вы ввели числовое значение\".concat(textField.getText()));\r\n\t\t\ttextField.setEditable(true);\r\n\t\t}\r\n\t}", "public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\n\t\t\t\t String s = jTextField3.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 50){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }", "public void setMinimumCharacters( final int minimumCharacters ) {\n checkWidget();\n if( minimumCharacters < 0 ) {\n SWT.error( SWT.ERROR_INVALID_RANGE );\n }\n if( this.minChars != minimumCharacters ) {\n this.minChars = minimumCharacters;\n updateItems();\n }\n }", "private void jTextFieldPrecioKeyTyped(java.awt.event.KeyEvent evt) {\n char car = evt.getKeyChar();\n if (jTextFieldPrecio.getText().length() >= 9) {\n evt.consume();\n }\n if ((car < '0' || car > '9')) {\n evt.consume();\n }\n }", "public void maximo(java.awt.event.KeyEvent evt, int tamanio, String txt){\n if (txt.length()== tamanio){\r\n evt.consume();\r\n JOptionPane.showMessageDialog(null,\"¡Sólo puede ingresar \"+ tamanio +\" carácteres!\",\"Mensaje del Sistema\",JOptionPane.ERROR_MESSAGE);\r\n }\r\n }", "java.lang.String getField1616();", "public JTextField addFocusMaxStudentsTxtField() {\n JTextField maxStudentsTxtField = new JTextField(\"Seat Limit\", 10);\n maxStudentsTxtField.addFocusListener(new FocusListener() {\n public void focusGained(FocusEvent e) {\n maxStudentsTxtField.setText(\"\");\n }\n\n public void focusLost(FocusEvent e) {\n if (maxStudentsTxtField.getText().equals(\"\")) {\n maxStudentsTxtField.setText(\"Seat Limit\");\n }\n }\n });\n return maxStudentsTxtField;\n }", "private JTextField getJTextField1() {\r\n\t\tif (jTextField1 == null) {\r\n\t\t\tjTextField1 = new JTextField();\r\n\t\t\tjTextField1.setBounds(new Rectangle(243, 84, 143, 19));\r\n\t\t\tjTextField1.addKeyListener(new KeyAdapter()\r\n\t\t\t{\r\n\t\t\t\t public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\r\n\t\t\t\t\t // Verificar si la tecla pulsada no es un digito\r\n\t\t\t\t\t char caracter = e.getKeyChar();\r\n\t\t\t\t\t if(((caracter < '0') ||\r\n\t\t\t\t\t\t\t (caracter > '9')) &&\r\n\t\t\t\t\t\t\t (caracter != KeyEvent.VK_BACK_SPACE))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t\t }\r\n\r\n\t\t\t\t //Controlar el largo del text\r\n\t\t\t\t String s = jTextField1.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 10){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t});\r\n\t\t}\r\n\t\treturn jTextField1;\r\n\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent arg0) {\n\t\t\t\tif (arg0.isActionKey() || arg0.getKeyCode() == KeyEvent.VK_ENTER\n\t\t\t\t\t\t|| arg0.getKeyCode() == KeyEvent.VK_BACK_SPACE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tJTextField txt = (JTextField) arg0.getComponent();\n\t\t\t\tif (txt.getText().length() == 9) {\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Možete uneti maksimalno 9 karaktera!\");\n\t\t\t\t\ttxt.setText(txt.getText().substring(0, 9));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "public void setMaxLength(int max) {\n GtkEntry.setMaxLength(this, max);\n }", "public void setMaxLength(int maxLength){\n mMaxLengthOfString = maxLength;\n }", "public void setMaxTextLength(int max) {\n/* 520 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Override\n public void setVisibleLength(int length) {}", "public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (edtCodeNumber5.getText().toString().length() == 1) //size as per your requirement\n {\n edtCodeNumber6.requestFocus();\n }\n }", "public int getMaxLength() {\n return GtkEntry.getMaxLength(this);\n }", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\tString content = ta_content.getText().toString();\r\n\r\n\t\t\t\t\tcontent = content.replaceAll(\"\\\\p{Z}\", \"\");\r\n\r\n\t\t\t\t\tcontent = content.replaceAll(\"(^\\\\p{Z}+|\\\\p{Z}+$)\", \"\");\r\n\t\t\t\t\tfor (String str : special_characters) {\r\n\t\t\t\t\t\tcontent = content.replaceAll(str, \"\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcontent = content.trim();\r\n\t\t\t\t\tint cnt = 0;\r\n\t\t\t\t\tBreakIterator it = BreakIterator.getCharacterInstance();\r\n\t\t\t\t\tit.setText(content);\r\n\r\n\t\t\t\t\twhile (it.next() != BreakIterator.DONE) {\r\n\t\t\t\t\t\tcnt++;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttextField.setText(\"\" + cnt);\r\n\t\t\t\t}", "@Override\n public void afterTextChanged(Editable s) {\n editStart = edRoomNotice.getSelectionStart();\n editEnd = edRoomNotice.getSelectionEnd();\n tvRoomNoticeLength.setText(\"\" + temp.length());\n if (temp.length() > 50) {\n Toast.makeText(mContext,\n \"你输入的字数已经超过了限制!\", Toast.LENGTH_SHORT)\n .show();\n s.delete(editStart-1, editEnd);\n int tempSelection = editStart;\n edRoomNotice.setText(s);\n edRoomNotice.setSelection(tempSelection);\n }\n }", "public void setFieldLength(int fieldLength)\n\t{\n\t\tthis.fieldLength = fieldLength;\n\t}", "@Override\n public void afterTextChanged(Editable s) {\n mContactNumberCounter.setText(10 - s.toString().length() + \"\");\n }", "void setMaxVarcharSize(int value);", "private void aplicaMascara(JFormattedTextField campo) {\n\n DecimalFormat decimal = new DecimalFormat(\"##,###,###.00\");\n decimal.setMaximumIntegerDigits(7);\n decimal.setMinimumIntegerDigits(1);\n NumberFormatter numFormatter = new NumberFormatter(decimal);\n numFormatter.setFormat(decimal);\n numFormatter.setAllowsInvalid(false);\n DefaultFormatterFactory dfFactory = new DefaultFormatterFactory(numFormatter);\n campo.setFormatterFactory(dfFactory);\n }", "public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (edtCodeNumber4.getText().toString().length() == 1) //size as per your requirement\n {\n edtCodeNumber5.requestFocus();\n }\n }", "public void Sletras(JTextField a){\n a.addKeyListener(new KeyAdapter() {\n public void keyTyped(KeyEvent e){\n char c=e.getKeyChar();\n if(Character.isDigit(c)){\n getToolkit().beep();\n e.consume();\n }\n }\n \n });\n }", "int getMaxVarcharSize();", "private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.setResizable(false);\r\n\t\tframe.setBounds(100, 100, 473, 710);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tJPanel panel = new JPanel();\r\n\t\tpanel.setBackground(Color.GRAY);\r\n\t\tpanel.setBounds(0, 0, 468, 710);\r\n\t\tframe.getContentPane().add(panel);\r\n\t\tpanel.setLayout(null);\r\n\t\t\r\n\t\ttfTc = new JTextField();\r\n\t\ttfTc.getDocument().addDocumentListener(new DocumentListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvoid regexKontrol() {\r\n\t\t\t\tString kimlik = tfTc.getText();\r\n\t\t\t\tif (kimlik.matches(\"[0-9]{11}\")==true) {\r\n\t\t\t\t\tbkimlik = true;\r\n\t\t\t\t\ttfTc.setBorder(BorderFactory.createLineBorder(Color.green,3));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbkimlik = false;\r\n\t\t\t\t\ttfTc.setBorder(BorderFactory.createLineBorder(Color.red,3));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\ttfTc.setBounds(150, 150, 236, 39);\r\n\t\tpanel.add(tfTc);\r\n\t\ttfTc.setColumns(10);\r\n\t\t\r\n\t\ttfAdi = new JTextField();\r\n\t\ttfAdi.getDocument().addDocumentListener(new DocumentListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvoid regexKontrol() {\r\n\t\t\t\tString isim = tfAdi.getText();\r\n\t\t\t\tif (isim.matches(\"[a-zA-Z ]{3,20}\")==true) {\r\n\t\t\t\t\ttfAdi.setBorder(BorderFactory.createLineBorder(Color.green,3));\r\n\t\t\t\t\tbadi = true;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tbadi = false;\r\n\t\t\t\t\ttfAdi.setBorder(BorderFactory.createLineBorder(Color.red,3));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\ttfAdi.setColumns(10);\r\n\t\ttfAdi.setBounds(150, 203, 236, 39);\r\n\t\tpanel.add(tfAdi);\r\n\t\t\r\n\t\ttfSoyadi = new JTextField();\r\n\t\ttfSoyadi.getDocument().addDocumentListener(new DocumentListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvoid regexKontrol() {\r\n\t\t\t\tString soyisim = tfSoyadi.getText();\r\n\t\t\t\tif (soyisim.matches(\"[a-zA-Z ]{3,20}\")==true) {\r\n\t\t\t\t\ttfSoyadi.setBorder(BorderFactory.createLineBorder(Color.green,3));\r\n\t\t\t\t\tbsoyadi = true;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttfSoyadi.setBorder(BorderFactory.createLineBorder(Color.red,3));\r\n\t\t\t\t\tbsoyadi = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\ttfSoyadi.setColumns(10);\r\n\t\ttfSoyadi.setBounds(150, 254, 236, 39);\r\n\t\tpanel.add(tfSoyadi);\r\n\t\t\r\n\t\ttfMail = new JTextField();\r\n\t\ttfMail.getDocument().addDocumentListener(new DocumentListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvoid regexKontrol() {\r\n\t\t\t\tString mail = tfMail.getText();\r\n\t\t\t\tif (mail.matches(\"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\"\r\n\t\t\t\t\t\t+ \"\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.\"\r\n\t\t\t\t\t\t+ \")+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]\"\r\n\t\t\t\t\t\t+ \"[0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\"\r\n\t\t\t\t\t\t+ \"\\\\x0e-\\\\x7f])+)\\\\])\")==true) {\r\n\t\t\t\t\ttfMail.setBorder(BorderFactory.createLineBorder(Color.green,3));\r\n\t\t\t\t\tbmail = true;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttfMail.setBorder(BorderFactory.createLineBorder(Color.red,3));\r\n\t\t\t\t\tbmail = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\ttfMail.setColumns(10);\r\n\t\ttfMail.setBounds(150, 306, 236, 39);\r\n\t\tpanel.add(tfMail);\r\n\t\t\r\n\t\tJButton btnTamamla = new JButton(\"Tamamla\");\r\n\t\tbtnTamamla.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t JOptionPane.showMessageDialog(new JFrame(), \"Kayıt başarıyla oluşturuldu.\", \"Bilgi\", JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnTamamla.setBackground(Color.YELLOW);\r\n\t\tbtnTamamla.setBorder(null);\r\n\t\tbtnTamamla.setBounds(150, 454, 180, 55);\r\n\t\tpanel.add(btnTamamla);\r\n\t\t\r\n\t\tJLabel lblTc = new JLabel(\"TC Kimlik:\");\r\n\t\tlblTc.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\tlblTc.setFont(new Font(\"Tahoma\", Font.PLAIN, 19));\r\n\t\tlblTc.setBounds(46, 153, 90, 33);\r\n\t\tpanel.add(lblTc);\r\n\t\t\r\n\t\tJLabel lblAdi = new JLabel(\"\\u0130sim:\");\r\n\t\tlblAdi.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\tlblAdi.setFont(new Font(\"Tahoma\", Font.PLAIN, 19));\r\n\t\tlblAdi.setBounds(46, 206, 90, 33);\r\n\t\tpanel.add(lblAdi);\r\n\t\t\r\n\t\tlblSoyadi = new JLabel(\"Soyisim:\");\r\n\t\tlblSoyadi.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\tlblSoyadi.setFont(new Font(\"Tahoma\", Font.PLAIN, 19));\r\n\t\tlblSoyadi.setBounds(46, 257, 90, 33);\r\n\t\tpanel.add(lblSoyadi);\r\n\t\t\r\n\t\tlblEposta = new JLabel(\"E-Posta:\");\r\n\t\tlblEposta.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\tlblEposta.setFont(new Font(\"Tahoma\", Font.PLAIN, 19));\r\n\t\tlblEposta.setBounds(46, 309, 90, 33);\r\n\t\tpanel.add(lblEposta);\r\n\t\t\r\n\t\tlblTelefon = new JLabel(\"Cep Tel. :\");\r\n\t\tlblTelefon.setHorizontalAlignment(SwingConstants.RIGHT);\r\n\t\tlblTelefon.setFont(new Font(\"Tahoma\", Font.PLAIN, 19));\r\n\t\tlblTelefon.setBounds(46, 359, 90, 33);\r\n\t\tpanel.add(lblTelefon);\r\n\t\t\r\n\t\tJFormattedTextField tfTelefon = new JFormattedTextField();\r\n\t\ttfTelefon.getDocument().addDocumentListener(new DocumentListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\r\n\t\t\t\tregexKontrol();\r\n\t\t\t}\r\n\t\t\tvoid regexKontrol() {\r\n\t\t\t\tString telefon = tfTelefon.getText();\r\n\t\t\t\tif (telefon.matches(\"[0-9]{10}\")==true) {\r\n\t\t\t\t\ttfTelefon.setBorder(BorderFactory.createLineBorder(Color.green,3));\r\n\t\t\t\t\tbtelefon = true;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttfTelefon.setBorder(BorderFactory.createLineBorder(Color.red,3));\r\n\t\t\t\t\tbtelefon = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\ttfTelefon.setDisabledTextColor(Color.RED);\r\n\t\ttfTelefon.setBounds(150, 353, 236, 39);\r\n\t\t\r\n\t\tpanel.add(tfTelefon);\r\n\t\t\r\n\t\tJLabel lblBackground = new JLabel(\"\");\r\n\t\tlblBackground.setBorder(null);\r\n\t\tlblBackground.setFont(new Font(\"Tahoma\", Font.PLAIN, 25));\r\n\t\tlblBackground.setIcon(new ImageIcon(Gui.class.getResource(\"/simpleregister/automataregex.png\")));\r\n\t\tlblBackground.setBackground(Color.LIGHT_GRAY);\r\n\t\tlblBackground.setBounds(36, 28, 416, 575);\r\n\t\tpanel.add(lblBackground);\r\n\t\t\r\n\t\tThread thread = new Thread() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\r\n\t\t\t\t\tSystem.out.println(\"Thread içindeyim:\"+bkimlik+\" \"+badi+\" \"+bsoyadi+\" \"+bmail+\" \"+btelefon);//SORULACAK!!! bu satırı kapatınca buton aktif olmuyor!\r\n\t\t\t\t\tif (bkimlik == true && badi==true && bsoyadi == true && bmail == true && btelefon ==true ) {\r\n\t\t\t\t\t\tbtnTamamla.setEnabled(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tbtnTamamla.setEnabled(false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\t};\r\n\t\t\tthread.start();\r\n\t\t\r\n\t}", "public void setwoorden()\n {\n String[] woorden = taInput.getText().split(\" |\\n\");\n \n for (int i = 0; i < woorden.length; i++) {\n if(!woorden[i].isEmpty())\n {\n AllText.add(woorden[i]); \n }\n } \n }", "public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (edtCodeNumber6.getText().toString().length() == 1) //size as per your requirement\n {\n\n }\n }", "private JTextField getJTextField3() {\r\n\t\tif (jTextField3 == null) {\r\n\t\t\tjTextField3 = new JTextField();\r\n\t\t\tjTextField3.setBounds(new Rectangle(243, 166, 143, 19));\r\n\t\t\tjTextField3.addKeyListener(new KeyAdapter()\r\n\t\t\t{\r\n\t\t\t\t public void keyTyped(KeyEvent e)\r\n\t\t\t\t {\r\n\t\t\t\t\t // Verificar si la tecla pulsada no es un digito\r\n\t\t\t\t\t char caracter = e.getKeyChar();\r\n\t\t\t\t\t if(((caracter < '0') ||\r\n\t\t\t\t\t\t\t (caracter > '9')) &&\r\n\t\t\t\t\t\t\t (caracter != KeyEvent.VK_BACK_SPACE))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t\t }\r\n\r\n\t\t\t\t //Controlar el largo del text\r\n\t\t\t\t String s = jTextField3.getText();\r\n\t\t\t\t int n=s.length();\r\n\t\t\t\t if(n >= 8){\r\n\t\t\t\t \t e.consume(); // ignorar el evento de teclado\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t});\r\n\t\t}\r\n\t\treturn jTextField3;\r\n\t}", "public NumericTextController createTextLimit(ControllerCore genCode) {\n\t\ttextLimitNTXT = new NumericTextController(\"textLimit\", getParentController(controlItemSCSCLC), genCode) {\n\t\t\t@Override\n\t\t\tpublic void initialize() {\n\t\t\t\tsetLinkedController(textLimit$1LBL);\n\t\t\t\tsetProperty(\"textLimit\");\n\t\t\t\tsuper.initialize();\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void createControl() {\n\t\t\t\tsuper.createControl();\n\t\t\t\tif (isValid()) {\n\t\t\t\t\tgetNumericText().setFormatter(\"######\");\n\t\t\t\t\tsetStyle(SWT.BORDER | SWT.SINGLE | SWT.RIGHT);\n\t\t\t\t\tgetControl().setLayoutData(\"width min:100:150, growx\");\n\t\t\t\t\tif (null != fieldBindManager)\n\t\t\t\t\t\tfieldBindManager = new XjcFieldBindingManager(this);\n\t\t\t\t\tgetControl().addFocusListener(new XjcFocusListener(this));\n\t\t\t\t}\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic Object convertTargetToModel(Object fromObject) {\n\t\t\t\tif (fromObject instanceof Number)\n\t\t\t\t\treturn ((BigDecimal) fromObject).intValue();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\t\treturn textLimitNTXT;\n\t}", "public void onTextChanged(CharSequence s, int start,int before, int count)\n {\n if(ett9.getText().toString().length()==1) //size as per your requirement\n {\n ett10.requestFocus();\n }\n }", "public int getMaxLength() {\r\n\t\treturn fieldMaxLength;\r\n\t}", "@Override\r\n\t\t\tpublic void onTextChanged(CharSequence s, int start, int before,\r\n\t\t\t\t\tint count) {\n\t\t\t\tmText = mEdit.getText().toString();\r\n\t\t\t\tint len = mText.length();\r\n\t\t\t\tif (len <= 140) {\r\n\t\t\t\t\tlen = 140 - len;\r\n\t\t\t\t\tmTextNum.setTextColor(R.color.dark_blue);\r\n\t\t\t\t\tif (!mSend.isEnabled())\r\n\t\t\t\t\t\tmSend.setEnabled(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlen = len - 140;\r\n\t\t\t\t\tmTextNum.setTextColor(Color.RED);\r\n\t\t\t\t\tif (mSend.isEnabled())\r\n\t\t\t\t\t\tmSend.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t\tmTextNum.setText(String.valueOf(len));\r\n\t\t\t}", "java.lang.String getField1341();", "@Override\r\n\tpublic void keyReleased(KeyEvent e) {\n\t\tString text = area.getText();\r\n\t\tString words[]= text.split(\"\\\\s\");\r\n\t\tl.setText(\"Words:\"+words.length+\"Characters:\"+text.length());\r\n\t}", "private void initFields(){\r\n \tintDocumentFilter = new IntegerDocumentFilter();\r\n \tJLabel label;\r\n \r\n \tlabel=new JLabel(\"Gen Chain Length\");\r\n \r\n \tgenChainLengthField = new JTextField(5);\r\n \tdoc = (PlainDocument)genChainLengthField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(genChainLengthField);\r\n \r\n \tlabel=new JLabel(\"Gen Chain Length Flux\");\r\n \r\n \tgenChainLengthFluxField = new JTextField(5);\r\n \tdoc = (PlainDocument)genChainLengthFluxField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(genChainLengthFluxField);\r\n \r\n \tlabel=new JLabel(\"Step Gen Distance\");\r\n \r\n \tstepGenDistanceField = new JTextField(5);\r\n \tdoc = (PlainDocument)stepGenDistanceField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(stepGenDistanceField);\r\n \r\n \tlabel=new JLabel(\"Rows\");\r\n \r\n \trowsField = new JTextField(5);\r\n \tlabel.setToolTipText(\"Number of total rows in maze\");\r\n \tdoc = (PlainDocument)rowsField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(rowsField);\r\n \r\n \tlabel=new JLabel(\"Columns\");\r\n \r\n \tcolsField = new JTextField(5);\r\n \tlabel.setToolTipText(\"Number of total columns in maze.\");\r\n \tdoc = (PlainDocument)colsField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(colsField);\r\n \r\n \tlabel=new JLabel(\"Start Row\");\r\n \r\n \tstartRowField = new JTextField(5);\r\n \tlabel.setToolTipText(\"Row of starting position (0,0 is top left)\");\r\n \tdoc = (PlainDocument)startRowField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(startRowField);\r\n \r\n \tlabel=new JLabel(\"Start Column\");\r\n \r\n \tstartColField = new JTextField(5);\r\n \tlabel.setToolTipText(\"Column of starting position (0,0 is top left)\");\r\n \tdoc = (PlainDocument)startColField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(startColField);\r\n \r\n \tlabel=new JLabel(\"End Row\");\r\n \r\n \tendRowField = new JTextField(5);\r\n \tlabel.setToolTipText(\"Row of ending (goal) position (0,0 is top left)\");\r\n \tdoc = (PlainDocument)endRowField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(endRowField);\r\n \r\n \tlabel=new JLabel(\"End Column\");\r\n \r\n \tendColField = new JTextField(5);\r\n \tlabel.setToolTipText(\"Column of ending (goal) position (0,0 is top left)\");\r\n \tdoc = (PlainDocument)endColField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(endColField);\r\n \r\n \tlabel=new JLabel(\"Cell Width\");\r\n \r\n \tcellWidthField = new JTextField(5);\r\n \tlabel.setToolTipText(\"Width of a single cell in pixels\");\r\n \tdoc = (PlainDocument)cellWidthField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(cellWidthField);\r\n \r\n \tlabel=new JLabel(\"Progressive Reveal Radius\");\r\n \r\n \tprogRevealRadiusField = new JTextField(5);\r\n \tdoc = (PlainDocument)progRevealRadiusField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(progRevealRadiusField);\r\n \r\n \tlabel=new JLabel(\"Progressive Draw\");\r\n \r\n \tprogDrawCB = new JCheckBox();\r\n \tlabel.setToolTipText(\"Whether maze should be drawn progressively or not (immediately)\");\r\n \tthis.add(label);\r\n \tthis.add(progDrawCB);\r\n \r\n \tlabel=new JLabel(\"Progressive Draw Speed\");\r\n \r\n \tprogDrawSpeedField = new JTextField(5);\r\n \tlabel.setToolTipText(\"Size of chunks in which maze should be drawn progressively (larger is faster)\");\r\n \tdoc = (PlainDocument)progDrawSpeedField.getDocument();\r\n \tdoc.setDocumentFilter(intDocumentFilter);\r\n \tthis.add(label);\r\n \tthis.add(progDrawSpeedField);\r\n \r\n \r\n \r\n \r\n \tokButton = new JButton(\"OK\");\r\n \tokButton.addActionListener(new ActionListener(){\r\n \t\tpublic void actionPerformed(ActionEvent e){\r\n \t\t writeback();\r\n \t\t JDialog parentDialog = (JDialog)(getRootPane().getParent());\r\n \t\t parentDialog.setVisible(false);\r\n \t\t}\r\n \t });\r\n \tthis.add(okButton);\r\n \r\n \tcancelButton = new JButton(\"Cancel\");\r\n \tcancelButton.addActionListener(new ActionListener(){\r\n \t\tpublic void actionPerformed(ActionEvent e){\r\n \t\t JDialog parentDialog = (JDialog)(getRootPane().getParent());\r\n \t\t parentDialog.setVisible(false);\r\n \t\t}\r\n \t });\r\n \tthis.add(cancelButton);\r\n }", "java.lang.String getField1040();", "public int getNumberOfCharactersInThisText(){\n\t\treturn this.number;\n\t}", "java.lang.String getField1824();", "public void limparCampos() {\n\t\tcodigoField.setText(\"\");\n\t\tdescricaoField.setText(\"\");\n\t\tcodigoField.setEditable(true);\n\t\tBorder border = BorderFactory.createLineBorder(Color.RED);\n\t\tcodigoField.setBorder(border);\n\t\tcodigoField.requestFocus();\n\t\tBorder border1 = BorderFactory.createLineBorder(Color.BLACK);\n\t\tdescricaoField.setBorder(border1);\n\t\t\n\t\t\n\t}", "private void setTokenLength() {\n\t\tfor (Token ts : Token.values()) {\n\t\t\tif (ts.getValue().length() == 1) ts.setOneChar(true);\n\t\t\telse ts.setOneChar(false);\n\t\t}\n\t}", "ReadOnlyStringProperty labelMaximumProperty();", "public JTextField addFocusLongCourseNameTxtField() {\n JTextField courseNameTxtField = new JTextField(\"e.g.'CPSC-210'\", 22);\n courseNameTxtField.addFocusListener(new FocusListener() {\n public void focusGained(FocusEvent e) {\n courseNameTxtField.setText(\"\");\n }\n\n public void focusLost(FocusEvent e) {\n if (courseNameTxtField.getText().equals(\"\")) {\n courseNameTxtField.setText(\"e.g.'CPSC-210'\");\n }\n }\n });\n return courseNameTxtField;\n }", "public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (edtCodeNumber2.getText().toString().length() == 1) //size as per your requirement\n {\n edtCodeNumber3.requestFocus();\n }\n }", "public void MaxlengthPhoneNumber() {\n\t\tCommonFunctions.elementAttributeContainsValue(PhoneNumber, \"maxlength\", \"10\");\n\t}", "private boolean select(JFormattedTextField ftf, AttributedCharacterIterator iterator, DateFormat.Field field) {\n/* 231 */ int max = ftf.getDocument().getLength();\n/* */ \n/* 233 */ iterator.first();\n/* */ \n/* */ do {\n/* 236 */ Map attrs = iterator.getAttributes();\n/* */ \n/* 238 */ if (attrs != null && attrs.containsKey(field)) {\n/* */ \n/* 240 */ int start = iterator.getRunStart(field);\n/* 241 */ int end = iterator.getRunLimit(field);\n/* */ \n/* 243 */ if (start != -1 && end != -1 && start <= max && end <= max)\n/* */ {\n/* 245 */ ftf.select(start, end);\n/* */ }\n/* 247 */ return true;\n/* */ } \n/* 249 */ } while (iterator.next() != Character.MAX_VALUE);\n/* 250 */ return false;\n/* */ }", "public void limpaTextFields() {\n tfMatricula.setText(\"\");\n tfNome.setText(\"\");\n tfDataNascimento.setText(\"\");\n tfTelefone.setText(\"\");\n tfSalario.setText(\"\");\n }", "public int getNumberOfCharacters() {\n return numberOfCharacters;\n }", "protected int handlePlainField(String s, StringBuffer sb, int i)\n {\n int j = s.indexOf(fieldSeparator, i); // look for separator\n if (j == -1)\n {\n // none found\n sb.append(s.substring(i));\n return s.length();\n }\n else\n {\n sb.append(s.substring(i, j));\n return j;\n }\n }", "@Override\n public void afterTextChanged(Editable s) {\n mEmergencyNumberCounter.setText(10 - s.toString().length() + \"\");\n }", "public void setOnlyInteger() {\r\n\t\tPlatform.runLater(() -> {\r\n\t\t\ttextfield.textProperty().addListener(new ChangeListener<String>() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {\r\n\t\t\t\t\tif (!newValue.matches(\"^\\\\d*\\\\d\") && !newValue.isEmpty()) {\r\n\t\t\t\t\t\ttextfield.setText(oldValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t}", "public int getDisplayingFieldWidth() {\n return 1;\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\n String newMxCharsToOutput = JOptionPane.showInputDialog(GlobalValues.myGEdit, \"Controls max chars to display\",GlobalValues.mxLenToDisplay );\r\n GlobalValues.mxLenToDisplay = Integer.valueOf(newMxCharsToOutput);\r\n }", "private void Mostra() {\n mat = matriz.getMatriz();\n\n for (int lin = 0; lin < 9; lin++) {\n for (int col = 0; col < 9; col++) {\n array_texto[lin][col].setEditable(true);\n array_texto[lin][col].setText(mat[lin][col]);\n array_texto[lin][col].setBackground(Color.white);\n\n for (char letra : array_texto[lin][col].getText().toCharArray()) {\n if ((letra < 1 || letra > 9)) {\n array_texto[lin][col].setEditable(false);\n array_texto[lin][col].setBackground(Color.LIGHT_GRAY);\n }\n }\n }\n }\n }", "public Builder setField1022(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n field1022_ = value;\n onChanged();\n return this;\n }", "java.lang.String getField1515();", "public void onTextChanged(CharSequence s, int start,int before, int count)\n {\n if(ett8.getText().toString().length()==1) //size as per your requirement\n {\n ett9.requestFocus();\n }\n }", "java.lang.String getField1307();", "private void checkLength(String value, int maxLength) throws WikiException {\r\n\t\tif (value != null && value.length() > maxLength) {\r\n\t\t\tthrow new WikiException(new WikiMessage(\"error.fieldlength\", value, Integer.valueOf(maxLength).toString()));\r\n\t\t}\r\n\t}", "private void createTextField(int i){\n\t\tint x = 10, y = 10, width = 100, height = 100;\n\t\tint temp = 0;\n\t\t\n\t\ttextFields.add(new JTextField());\n\t\ttextFields.get(i).setVisible(false);\n\t\ttextFields.get(i).addActionListener(this);\n\t\t\n\t\tfor (int a = 0; a<i; a++){\n\t\t\tx += 110;\n\t\t\ttemp++;\n\t\t\tif(temp >= Integer.parseInt(askColumns.getText())){\n\t\t\t\ty += 140;\n\t\t\t\tx = 10;\n\t\t\t\ttemp = 0;\n\t\t\t}\t\n\n\t\t}\n\t\t\n\t\t\n\t\ttextFields.get(i).setBounds(x, y, width, height);\n\t\tthis.add(textFields.get(i));\t\n\t\ttextFields.get(i).revalidate();\n\t\ttextFields.get(i).repaint();\n\t\t\n\t}" ]
[ "0.6850491", "0.63665223", "0.6061864", "0.5951577", "0.58666635", "0.5833398", "0.57716674", "0.57375383", "0.5727599", "0.5723752", "0.5710528", "0.5665955", "0.5653749", "0.56394434", "0.56297976", "0.5608447", "0.5568516", "0.5542471", "0.553556", "0.55289686", "0.55148643", "0.5508652", "0.5506776", "0.5489832", "0.54874307", "0.5480152", "0.5479305", "0.54615945", "0.54548365", "0.54503983", "0.54494894", "0.5448955", "0.54476273", "0.5446917", "0.54413927", "0.54354465", "0.54315907", "0.54311347", "0.542613", "0.5418768", "0.54095685", "0.54000586", "0.53989947", "0.53945667", "0.5389717", "0.5380425", "0.53775537", "0.5373679", "0.53732914", "0.5361494", "0.5360829", "0.53511965", "0.5350611", "0.5349645", "0.53428197", "0.5340182", "0.5337915", "0.53267956", "0.5325342", "0.5320904", "0.5306391", "0.5288644", "0.52882385", "0.528628", "0.52803916", "0.52786183", "0.52776945", "0.5274916", "0.5272638", "0.52553606", "0.52535474", "0.52507013", "0.5249055", "0.524546", "0.52416027", "0.5239874", "0.52335685", "0.5229542", "0.5228697", "0.52272564", "0.52177995", "0.5200053", "0.5196647", "0.519077", "0.51906484", "0.5187658", "0.5187305", "0.51817656", "0.5169509", "0.516151", "0.5161507", "0.51583207", "0.5154307", "0.51470214", "0.5146177", "0.5144594", "0.51363766", "0.51322764", "0.5130228", "0.5115318" ]
0.7250425
0
Returns an iterator over all noncleared values.
public Iterator<T> iterator() { return new ReferentIterator(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic Iterator<Value> iterator() {\n\t\treturn null;\n\t}", "final Iterator<T> iterateAndClear() {\n\t\t// Iteration is atomically destructive.\n\t\tObject iteratedValue = value.getAndSet(null);\n\t\treturn new IteratorImpl<>(iteratedValue);\n\t}", "public Iterator getValues() {\n synchronized (values) {\n return Collections.unmodifiableList(new ArrayList(values)).iterator();\n }\n }", "@Override\n public Iterator<Value> iterator()\n {\n return values.iterator();\n }", "@Override\r\n public Iterator<ValueType> iterator() {\r\n // TODO\r\n return null;\r\n }", "@Override\n\tpublic Iterator<E> iterator() {\n\t\treturn Iterators.emptyIterator();\n\t}", "public Iterator<? extends TableValue> iterator() {\n\treturn null;\n }", "@Override\n\tpublic Iterator<Integer> iterator() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Iterable<K> values() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Iterator<V> getValueIterator() {\n\t\treturn null;\n\t}", "public native IterableIterator<V> values();", "public Iterator<V> values();", "public Iterator<V> values();", "@Override\n\tpublic Iterator<K> iterator() {\n\t\treturn null;\n\t}", "public Iterator<V> Values(){\n\treturn new Iterator<V>() {\n\t int iteratorbucket = 0;\n\t Iterator<MyEntry> itr = table[iteratorbucket].iterator();\n\t int nextCount = 0;\n\n\t public boolean hasNext() {\n\t // can just check nextCount and size\n\t if(nextCount>=size) {\n\t \treturn false;\n\t }\n\t return true;\n\t }\n\n\t public V next() {\n\t // if my hasNext() is false, I should throw a NoSuchElementException\n\t if(hasNext()==false) {\n\t \tthrow new NoSuchElementException();\n\t }\n\t // while itr.hasNext() is false, increment bucket and get the next iterator\n\t while(itr.hasNext()==false) {\n\t \titeratorbucket++;\n\t \titr=table[iteratorbucket].iterator();\n\t }\n\t // now increment nextCount and return the key from the item itr.next() returns\n\t \tnextCount++;\n\t \treturn itr.next().value;\n\t \n\t }\n\n\t public void remove() {\n\t // just ask itr to remove, but I need to update my size and nextCount\n\t itr.remove();\n\t size--;\n\t nextCount--;\n\t }\n\t };\n }", "@Override\n public Iterator<Integer> iterator() {\n return new Iterator<>() {\n int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < Set.this.count;\n }\n\n @Override\n public Integer next() {\n return Set.this.arr[i++];\n }\n };\n }", "public UnmodifiableIterator<Entry<K, V>> iterator() {\n return mo8403b().iterator();\n }", "@Override\n\tpublic Iterator iterator() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Iterator<Item> iterator() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn null;\n\t}", "public UnmodifiableIterator<K> iterator() {\n return mo8403b().iterator();\n }", "@Override\r\n\tpublic Iterator<E> iterator() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic final Iterator<T> iterator() {\n\t\treturn new IteratorImpl<>(value.get());\n\t}", "@Override\n\tpublic Iterator<E> iterator() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Iterator<E> iterator() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Iterator getValueIterator() {\n\t\treturn new ValueIterator();\n\t}", "public Iterator<Item> iterator() {\n return new Iterator<Item>() {\n public boolean hasNext() {\n return false;\n }\n\n public Item next() {\n return null;\n }\n };\n }", "public Iterator iterator()\n {\n // optimization\n if (OldOldCache.this.isEmpty())\n {\n return NullImplementation.getIterator();\n }\n\n // complete entry set iterator\n Iterator iter = instantiateIterator();\n\n // filter to get rid of expired objects\n Filter filter = new Filter()\n {\n public boolean evaluate(Object o)\n {\n Entry entry = (Entry) o;\n boolean fExpired = entry.isExpired();\n if (fExpired)\n {\n OldOldCache.this.removeExpired(entry, true);\n }\n return !fExpired;\n }\n };\n\n return new FilterEnumerator(iter, filter);\n }", "@Override\npublic Iterator<Key> iterator() {\n\treturn null;\n}", "public Iterator<Key> iterator() {\n\t\treturn null;\n\t}", "public Iterator<E> iterator() {\r\n return this.map.values().iterator();\r\n }", "@Override\r\n\tpublic Iterator<T> iterator() {\n\t\treturn new Iterator<T>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic boolean hasNext() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tnodo<T> sig = sentinel;\r\n\t\t\t\tsentinel = sentinel.getNext();\r\n\t\t\t\treturn (sentinel != null) ? true : false;\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic T next() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn sentinel.getValue();\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t}", "public Stream<Integer> streamAllValuesOfby() {\n return rawStreamAllValuesOfby(emptyArray());\n }", "@Override\n\tpublic Iterator<ItemT> iterator() {\n\t\treturn null;\n\t}", "@Override\n public Iterator<Long> iterator() {\n Collection<Long> c = new ArrayList<>();\n synchronized (data) {\n for (int i=0; i<data.length; i++)\n c.add(get(i));\n }\n return c.iterator();\n }", "public Iterator iterator()\n {\n return new HashSetIterator();\n }", "public Iterator iterator() {\n\t return new EntryIterator(set.iterator());\n\t}", "public Iterator<JacksonJrValue> elements() {\n return _values.iterator();\n }", "public Set<Integer> getAllValuesOfby() {\n return rawStreamAllValuesOfby(emptyArray()).collect(Collectors.toSet());\n }", "@Override\r\n\tpublic Iterator<String> iterator() {\n\t\treturn null;\r\n\t}", "public synchronized Iterator<E> iterator()\n {\n return iteratorUpAll();\n }", "public Iterator<S> iterator() {\n\t\t// ..\n\t\treturn null;\n\t}", "@Override\n public Iterator<Object> iterator() {\n return new Iterator<Object>() {\n\n private int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < data.length;\n }\n\n @Override\n public Object next() {\n Object result = data[i];\n i = i + 1;\n return result;\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException(\"Tuples are immutable\");\n }\n };\n }", "public Collection<T> values(){\n\t\treturn null;\r\n\t\t//TODO\r\n\t}", "public Iterator<V> getValueIterator()\n {\n Iterator<V> myIterator = new ValueIterator(this);\n return myIterator; \n }", "@Override\n public Iterator<Range> iterator() {\n return iterator(defaultValueMapper);\n }", "private Iterator getEntries(){\r\n\t\tSet entries = items.entrySet();\r\n\t\treturn entries.iterator();\r\n\t}", "private ValueIterator()\n {\n currentIndex = 0;\n numberLeft = numberOfEntries;\n }", "private static Stream<?> all(Iterator<Object> i) {\n requireNonNull(i);\n final Iterable<Object> it = () -> i;\n return StreamSupport.stream(it.spliterator(), false);\n }", "public Iterator<K> iterator()\n {\n return (new HashSet<K>(verts)).iterator();\n }", "@Override\n public Iterator<E> iterator(){\n return null;\n }", "@Override\n public Iterator<Map.Entry<K, V>> iterator() {\n return new SetIterator();\n }", "public Iterable<V> values();", "@Override\n\tpublic Iterator<Coffee> iterator() {\n\t\treturn null;\n\t}", "public Iterator getIterator() {\n return myElements.iterator();\n }", "@Override\r\n public Iterator<TensorScalar> iterator() {\n return null;\r\n }", "@Override\r\n public Iterator<TensorScalar> iterator() {\n return null;\r\n }", "@Override\n public Iterator<NFetchMode> iterator() {\n return Arrays.asList(all).iterator();\n }", "public ValueCollectionIterator() {\r\n last_entry = 0;\r\n current_entry = -1;\r\n next_ok = false;\r\n expected_modCount = TSB_OAHashtable.this.modCount;\r\n }", "@Override\n\t\t\tpublic Iterator<Integer> iterator() {\n\t\t\t\treturn new Iterator<Integer>() {\n\n\t\t\t\t\tint index = -1;\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void remove() {\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic Integer next() {\n\t\t\t\t\t\tif (index >= length)\n\t\t\t\t\t\t\tthrow new RuntimeException();\n\t\t\t\t\t\treturn offset + index * delta;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean hasNext() {\n\t\t\t\t\t\treturn ++index < length;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}", "public Set<T> getAllPossibleValuesSet() throws InfiniteValuesException\n {\n throw new InfiniteValuesException(\"JavaType has infinite values.\", null);\n }", "public Iterator<V> iterator()\n {\n return new Iterator<V>()\n {\n public boolean hasNext()\n {\n // STUB\n return false;\n } // hasNext()\n\n public V next()\n {\n // STUB\n return null;\n } // next()\n\n public void remove()\n throws UnsupportedOperationException\n {\n throw new UnsupportedOperationException();\n } // remove()\n }; // new Iterator<V>\n }", "public Iterator<K> iterator()\n {\n\treturn (new HashSet<K>(verts)).iterator();\n }", "public Iterable<MapElement> elements() {\n return new MapIterator() {\n\n @Override\n public MapElement next() {\n return findNext(true);\n }\n \n };\n }", "public Iterator<Object[]> getMetricValueIterator()\n\t{\n\t\tinit();\n\t\t\n\t\treturn new MetricValueIterator();\n\t}", "public Iterator<Integer> iterator() {\n\t\treturn new WrappedIntIterator(intIterator());\n\t}", "@Override\n public Iterator<String> iterator() {\n return null;\n }", "@Override\n public Collection<V> values() {\n Collection<V> values = new HashSet<V>(size());\n for (LinkedList<Entry<K,V>> list : table) {\n for (Entry<K,V> entry : list) {\n if (entry != null) {\n values.add(entry.getValue());\n }\n }\n }\n return values;\n }", "public Set<T> values() {\n\t\t// This is immutable to prevent add/remove operation by 3rd party developers.\n\t\treturn Collections.unmodifiableSet(values);\n\t}", "@Override\n public Iterator<E> iterator() {\n return new Iterator<E>() {\n private int nextIndex = 0;\n private int lastNextIndex = -1;\n private int rest = size();\n\n @Override\n public boolean hasNext() {\n return rest > 0;\n }\n\n @Override\n public E next() {\n if(!hasNext()){\n throw new NoSuchElementException();\n }\n rest--;\n lastNextIndex = nextIndex++;\n siftDown(nextIndex);\n\n return (E) array[lastNextIndex];\n }\n\n @Override\n public void remove() {\n if (lastNextIndex == -1) {\n throw new IllegalStateException();\n }\n removeElement(lastNextIndex);\n nextIndex--;\n lastNextIndex = -1;\n }\n };\n }", "public Iterator iterator() {\n maintain();\n return new MyIterator(collection.iterator());\n }", "@Override\n public Iterator<T> impNiveles(){\n return (super.impNiveles());\n }", "@Override\r\n\tpublic Iterator<K> iterator() {\n\t\treturn keys.iterator();\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public Iterator<Tuple<T>> iterator() {\n Iterator<Tuple<T>> fi = (Iterator<Tuple<T>>) new FilteredIterator<T>(resultTable.iterator(), filterOn);\r\n return fi;\r\n }", "public Collection<V> values() {\n\t\treturn null;\r\n\t}", "public Iterator<E> iterator() {\n\t\treturn new Itr();\n\t}", "public Iterator<X> iterator() {\n return map.keySet().iterator();\n }", "public Iterator ids () {\n\t\topen();\n\t\treturn new Iterator () {\n\t\t\tLong id = new Long(-blockSize), nextId;\n\t\t\tboolean removeable = false;\n\n\t\t\tpublic boolean hasNext () {\n\t\t\t\ttry {\n\t\t\t\t\tfor (removeable = false; !isUsed(nextId = new Long(id.longValue()+blockSize)); id = nextId)\n\t\t\t\t\t\tif (nextId.longValue()+blockSize>container.length())\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tcatch (IOException ie) {\n\t\t\t\t\tthrow new WrappingRuntimeException(ie);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic Object next () throws NoSuchElementException {\n\t\t\t\tif (!hasNext())\n\t\t\t\t\tthrow new NoSuchElementException();\n\t\t\t\tremoveable = true;\n\t\t\t\treturn id = nextId;\n\t\t\t}\n\n\t\t\tpublic void remove () throws IllegalStateException {\n\t\t\t\tif (!removeable)\n\t\t\t\t\tthrow new IllegalStateException();\n\t\t\t\tBlockFileContainer.this.remove(id);\n\t\t\t\tremoveable = false;\n\t\t\t}\n\t\t};\n\t}", "public Iterator iterator() {\n\n return new EnumerationIterator(elements.keys());\n }", "Iterator<T> iterator();", "public Iterator<T> iterator() {\n if (this.nrOfElements == 0) {\n return Collections.<T>emptyList().iterator();\n }\n return new Iterator<T>() {\n private Node walker = null;\n\n @Override\n public boolean hasNext() {\n return walker != last;\n }\n\n @Override\n public T next() {\n if (this.walker == null) {\n this.walker = first;\n return this.walker.getData();\n }\n\n if (this.walker.getNext() == null) {\n throw new NoSuchElementException();\n }\n\n this.walker = this.walker.getNext();\n return this.walker.getData();\n }\n };\n }", "public Iterator <item_t> iterator () {\n return new itor ();\n }", "public Iterator<Hex> iterator() {\n return new Iterator<Hex>() {\n private int g = 0;\n private int h = 0;\n @Override\n public boolean hasNext() {\n return g < hexWidth && h < hexHeight;\n }\n @Override\n public Hex next() {\n Hex result = hexes[g][h];\n if (++g == hexWidth) {\n g = 0;\n h++;\n }\n return result;\n }\n @Override\n public void remove() {\n throw new UnsupportedOperationException();\n }\n };\n }", "protected EmptyIterator() {\n\t\t\tsuper();\n\t\t}", "public Iterator<BigInteger> iterator() {\n // return new FibIterator();\n return new Iterator<BigInteger>() {\n private BigInteger previous = BigInteger.valueOf(-1);\n private BigInteger current = BigInteger.ONE;\n private int index = 0;\n \n \n @Override\n //if either true will stop, evaluates upper < 0 first (short circuit)\n public boolean hasNext() {\n return upper < 0 || index < upper;\n }\n\n @Override\n //Creating a new value called next\n public BigInteger next() {\n BigInteger next = previous.add(current);\n previous = current;\n current = next;\n index++;\n return current;\n }\n \n };\n }", "@Override\r\n\tpublic Iterator<V> iterator() {\r\n\t\treturn store.iterator();\r\n\t}", "public Iterator<E> elementIterator() {\n return new EnumMultiset<E>.Itr<E>() {\n /* access modifiers changed from: package-private */\n public E output(int i) {\n return EnumMultiset.this.enumConstants[i];\n }\n };\n }", "public Iterator iterator() {\n\t\treturn map.keySet().iterator();\n\t}", "Iterator<IntFloatEntry> iterator();", "@Override\n public Iterator<T> iterator() {\n return forwardIterator();\n }", "Iterator<E> iterator();", "Iterator<E> iterator();", "Iterator<Entry<String, Var>> getIterator() {\n\t\treturn iter;\n\t}", "public Iterable<M> iterateAll();", "public ListIterator<T> getAllByColumnsIterator() {\n\t\tAllByColumnsIterator it = new AllByColumnsIterator();\n\t\treturn it;\n\t}", "public Collection<SingleValue> values() {\n return Collections.unmodifiableCollection(container.values());\n }", "@Override\n public Iterator<T> iterator() {\n return items.iterator();\n }", "@Override\n public Iterator<T> iterator() {\n return new Itr();\n }", "@Override\n public Iterator<T> iterator() {\n return new Itr();\n }" ]
[ "0.73889536", "0.729965", "0.70907706", "0.7082149", "0.6993631", "0.6827973", "0.68039465", "0.6775363", "0.6738598", "0.67060715", "0.6654691", "0.65793693", "0.65793693", "0.6492075", "0.6472839", "0.64588976", "0.6443766", "0.63897794", "0.6369789", "0.6367422", "0.6367422", "0.6367422", "0.63669497", "0.6366838", "0.63452804", "0.6325063", "0.6325063", "0.6310222", "0.6307791", "0.6299743", "0.6294788", "0.62685", "0.6255486", "0.62507993", "0.6245419", "0.6231299", "0.62293154", "0.62138814", "0.62094885", "0.61935604", "0.61499864", "0.6149091", "0.6142381", "0.61024183", "0.6094042", "0.6092426", "0.609148", "0.60856205", "0.6076728", "0.6054192", "0.6026968", "0.602498", "0.60244304", "0.60184515", "0.6013638", "0.6012472", "0.59877574", "0.59798604", "0.59798604", "0.5976893", "0.59729314", "0.59500045", "0.5945771", "0.5942384", "0.59374654", "0.59291625", "0.59249806", "0.5907201", "0.5893948", "0.5875969", "0.58757806", "0.58727616", "0.5871574", "0.5867742", "0.5864272", "0.58621776", "0.58493686", "0.5824412", "0.5820734", "0.58010656", "0.57972175", "0.57817733", "0.5769158", "0.57632035", "0.5755758", "0.5753377", "0.57478124", "0.5744821", "0.5741638", "0.57394516", "0.57388985", "0.5735145", "0.5719482", "0.5719482", "0.5701379", "0.5700335", "0.5693689", "0.56897205", "0.5675592", "0.5669973", "0.5669973" ]
0.0
-1
Removes all cleared references from the internal collection.
public void purge() { Iterator<T> it = iterator(); while (it.hasNext()) { it.next(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void clear() {\n collected.clear();\n }", "public void clear() {\n while (refqueue.poll() != null) {\n ;\n }\n\n for (int i = 0; i < entries.length; ++i) {\n entries[i] = null;\n }\n size = 0;\n\n while (refqueue.poll() != null) {\n ;\n }\n }", "public void clear() {\n\t\tcollection.clear();\n\t}", "public synchronized void clear() {\n _transient.clear();\n _persistent.clear();\n _references.clear();\n }", "public void removeAll() {\n _hash = new Hashtable();\n _first = null;\n _last = null;\n }", "public void clear() {collection.clear();}", "public void clear() {\n\t\tthis._cooccurenceMatrix = null;\n\t\tthis._modules.clear();\n\t\tthis._vertices.clear();\n\t}", "public void clear()\r\n {\r\n first = null;\r\n last = null;\r\n count = 0;\r\n }", "public void clear() {\n this.collection.clear();\n }", "public void clear() {\n\t\tthis.set.clear();\n\t\tthis.size = 0;\n\t}", "public void clear() {\n allDependenciesModificationStamp = -2;\n }", "public final void clear() {\r\n\t\t// Let gc do its work\r\n\t\tfor (int i = this.size - 1; i >= 0; --i) {\r\n\t\t\tthis.elementData[i] = null;\r\n\t\t}\r\n\t\tthis.size = 0;\r\n\t}", "public synchronized void resetCollections() {\n collections = null;\n }", "@Override\n public void clear() {\n size = 0;\n first = null;\n last = null;\n }", "public void clear() {\n duplicates.clear();\n }", "private void clean() {\n nodesToRemove.clear();\n edgesToRemove.clear();\n }", "private void clear() {\n\t\t\tkeySet.clear();\n\t\t\tvalueSet.clear();\n\t\t\tsize = 0;\n\t\t}", "public synchronized void clear()\n {\n clear(false);\n }", "public void removeAll() {\n start = null;\n _size = 0;\n }", "public void clear() {\n\t\tlocation.clear();\n\t\theap.clear();\n\t}", "public void clear()\n {\n pages.stream().forEach((page) -> {\n page.clearCache();\n });\n\n pages.clear();\n listeners.clear();\n occupiedEntries.clear();\n }", "public void clear() {\n synchronized (unchecked) {\n unchecked.clear();\n }\n }", "public void clear() {\n \tIterator<E> iterateSet = this.iterator();\n \t\n \twhile(iterateSet.hasNext()) {\n \t\t// iterate through and remove all elements\n \t\titerateSet.next();\n \t\titerateSet.remove();\n \t}\n }", "public void clear() {\n counters.clear();\n }", "public void clear() {\n\t\tthis.boundObjects.clear();\n\t}", "public void removeAll() {\n this.arrayList = null;\n this.arrayList = new ArrayList<>();\n }", "@Override\n\tpublic void clear() {\n\t\tthis.first=null;\n\t\tthis.last=null;\n\t\tthis.size=0;\n\t\tthis.modificationCount++;\n\t}", "public void clear(){\n this.collected.clear();\n }", "public void clear()\n\t{\n\t\tobjectToId.clear();\n\t\tidToObject.clear();\n\t}", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void clearAll() {\n\t\t\r\n\t}", "public void clear() {\n\t\tvisited = false;\n\t}", "protected void clearResolvedObjects() {\n\t\ttype = null;\n\t\tmanagedType = null;\n\t\ttypeDeclaration = null;\n\t}", "public void removeAll()\n {\n this.front = null;\n this.rear = null;\n }", "public void clear() {\n\t\troot = null;\n\t\tcount = 0;\n\t}", "public void clear()\r\n {\r\n this.boundObjects.clear();\r\n }", "@Override\n public void clear() {\n for (E e : this) {\n remove(e);\n }\n }", "public void clear() {\n root = null;\n size = 0;\n }", "public void clear() {\n root = null;\n size = 0;\n }", "public final void clear() {\n clear(true);\n }", "public void clear()\n {\n current = null;\n size = 0;\n }", "private void clearCollection() {\n \n collection_ = getDefaultInstance().getCollection();\n }", "@Override\r\n\tpublic void clear() {\n\t\tset.clear();\r\n\t}", "public void clear() {\n this.entries = new Empty<>();\n }", "public void clear() {\r\n\t\tbitset.clear();\r\n\t\tnumberOfAddedElements = 0;\r\n\t}", "@Override\n public synchronized void clear() {\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "@Override\n public void clear() {\n root = null;\n size = 0;\n }", "public void clear() {\n\t\tfor (int i = 0; i < buckets.length; i++) {\n\t\t\tbuckets[i] = null;\n\t\t}\n\t}", "public void clear() {\n\n\t\thead = null;\n\t\ttail = null;\n\t\telements = 0;\n\t}", "public void clear() {\n this.first = null;\n this.last = null;\n this.nrOfElements = 0;\n }", "public void clear() {\r\n\t\troot = null;\r\n\t\tsize = 0;\r\n\t}", "@Override\n public void clear() {\n elements.clear();\n indexByElement.clear();\n }", "public void clear() {\n\t\tentries.clear();\n\t}", "@Override\n\tpublic void clearAll() {\n\t\t\n\t}", "public void clear() {\n count = 0;\n root = null;\n }", "public void clear() {\n\t\tIterator<E> iterator = this.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\titerator.next();\n\t\t\titerator.remove();\n\t\t}\n\t}", "@Override\n public void clear() {\n size = 0;\n root = null;\n }", "public void clear() {\n\t\t//Kill all entities\n\t\tentities.parallelStream().forEach(e -> e.kill());\n\n\t\t//Clear the lists\n\t\tentities.clear();\n\t\tdrawables.clear();\n\t\tcollidables.clear();\n\t}", "public void clear()\t{nodes.clear(); allLinks.clear();}", "void clear()\n\t{\n\t\tfront = null;\n\t\tback = null;\n\t\tcursor = null;\n\t\tlength = 0;\n\t\tindex = -1;\n\t}", "@Override\n\tpublic void clear() {\n\t\tsize = 0;\n\t\troot = null;\n\t}", "public void clear(){\n\t\tclear(0);\n\t}", "public void supprimerCollection(){\r\n collection.clear();\r\n }", "public void clear() {\r\n // synchronization is not a problem here\r\n // if this code were to be called while someone was getting or setting data\r\n // in the buckets, it would still work\r\n // in the case of someone setting a value in the buckets, then this coming along\r\n // and resetting the buckets-entry to null is fine, because the client still has the data reference\r\n // in the case of someone getting a value from the buckets while this is being reset\r\n // is fine as well because, if they get the data before it's set, they got it\r\n // if they as for it after it gets set to null, that's fine as well it's null and\r\n // that's a normal expected condition\r\n for (int i = 0, tot = buckets.length; i < tot; i++) {\r\n buckets[i] = new AtomicReference<CacheData<K, V>>(null);\r\n }\r\n }", "public void clearCollected(){\n\t\tcollected.clear();\n\t}", "public void clearAll();", "public void clearAll();", "public void clear() {\n mSize = 0;\n mRoot = null;\n }", "public void clear() {\n\t\tnegatedConcepts.clear();\n\t\tnegex.clear();\n\t\tconcepts.clear();\n\t}", "public void clear() {\r\n items.clear();\r\n keys.clear();\r\n }", "public void clear () {\n\t\treset();\n\t}", "public void clear() {\n\t\thead = tail = null;\n\t}", "public void clear() {\n doClear( false );\n }", "public void clear() {\n doClear();\n }", "private void clearAll( )\n {\n for( Vertex v : vertexMap.values( ) )\n v.reset( );\n }", "public void clear(){\n root = null;\n count = 0;\n }", "public void clear() {\n helpers.clear();\n islandKeysCache.clear();\n setDirty();\n }", "public void clearLookups() {\n diseaseMap = null;\n feedMap = null;\n healthMapProvenance = null;\n }", "private void clear() {\n }", "public void clear() {\n buckets = new ArrayList<>();\n for (int i = 0; i < numBuckets; i++) {\n buckets.add(new ArrayList<>());\n }\n keySet = new HashSet<>();\n numEntries = 0;\n }", "public void clear()\n {\n int llSize = ll.getSize();\n for(int i=0; i<llSize; i++){\n ll.remove(0);\n }\n }", "public void clear() {\n\t\t//System.err.println(\"FCache::clear() dont know how to clear m_leafCache\");\n\t\tfor (int i = 0; i < m_TopOfBranche.size(); i++) {\n\t\t\tCacheObject o = m_TopOfBranche.elementAt(i);\n\t\t\tif (o != null) {\n\t\t\t\to.m_F = null;\n\t\t\t}\n\t\t}\n\t\t//m_TopOfBranche.removeAllElements();\n\t\tfor (int iNode = 0; iNode < m_BottomOfBrancheID.length; iNode++) {\n\t\t\tclearNode(iNode);\n\t\t}\n\t\tg_nID = 0;\n\t}", "protected void clear() { backing.clear(); }", "public void clear() {\n this.layers.clear();\n list.clear();\n }", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();", "public void clear();" ]
[ "0.77582484", "0.77442646", "0.756711", "0.7560952", "0.75388986", "0.75304013", "0.74919575", "0.7444603", "0.74019647", "0.739601", "0.73880595", "0.73773044", "0.73653007", "0.7363943", "0.7316898", "0.7304284", "0.7292913", "0.72896785", "0.7287348", "0.7262513", "0.7253328", "0.7249086", "0.72319746", "0.72264796", "0.7216834", "0.7191068", "0.7190382", "0.7189031", "0.7186886", "0.7184394", "0.7184394", "0.7183441", "0.7179756", "0.71747625", "0.7170611", "0.7156526", "0.7155624", "0.71540964", "0.71540964", "0.7152858", "0.71471775", "0.7142577", "0.7138187", "0.7137551", "0.7135413", "0.7134798", "0.7130199", "0.7130199", "0.7130199", "0.7129254", "0.71286446", "0.71242684", "0.7119227", "0.71183246", "0.71176785", "0.7116614", "0.71136945", "0.7105978", "0.70991164", "0.70976615", "0.70942855", "0.7092688", "0.70696235", "0.7068877", "0.70666796", "0.7041961", "0.70343804", "0.70330876", "0.70330876", "0.7030157", "0.702845", "0.70156413", "0.6999575", "0.6998951", "0.69922954", "0.69861007", "0.69824165", "0.6967758", "0.69598395", "0.6957702", "0.6957316", "0.6952133", "0.69502413", "0.69440514", "0.69432443", "0.69424343", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686", "0.69347686" ]
0.0
-1
Get the "root location" by location context name.
public static Location getLocationContext(String name) { return Location.contextNames.get(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getBundleLocation(String location) {\n\t\tint index = location.lastIndexOf(PREFIX_DELIMITER);\r\n\t\tString path = ((index > 0) ? location.substring(index + 1) : location);\r\n\t\t// clean up the path\r\n\t\tpath = StringUtils.cleanPath(path);\r\n\t\t// check if it's a folder\r\n\t\tif (path.endsWith(SLASH)) {\r\n\t\t\t// remove trailing slash\r\n\t\t\tpath = path.substring(0, path.length() - 1);\r\n\t\t\tint separatorIndex = path.lastIndexOf(SLASH);\r\n\r\n\t\t\t// if there is no other slash, consider the whole location, otherwise detect the folder\r\n\t\t\tpath = (separatorIndex > -1 ? path.substring(separatorIndex + 1) : path);\r\n\t\t}\r\n\t\tpath = StringUtils.getFilename(path);\r\n\t\t// remove file extension\r\n\t\tpath = StringUtils.stripFilenameExtension(path);\r\n\r\n\t\tif (log.isTraceEnabled())\r\n\t\t\tlog.trace(\"Bundle location [\" + location + \"] resulted in context path [\" + path + \"]\");\r\n\r\n\t\treturn path;\r\n\t}", "java.lang.String getLocation();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "public String getLocationName(Context context){\n // just return the location name if it has already been set, either auto-generated or custom-set\n if (!locationName.equals(\"\") || isCustomLocationName) {\n return locationName;\n }\n\n Geocoder geocoder = new Geocoder(context);\n try {\n // extract the location name using the Address created from the latitude and longitude coordinates\n List<Address> addressName = geocoder.getFromLocation(getLatitude(), getLongitude(), 1);\n locationName = buildLocationName(addressName.listIterator().next());\n }\n catch (Exception e) {\n // set location name to null if there was an error\n locationName = \"\";\n }\n return locationName;\n }", "URI location() {\n if (module.isNamed() && module.getLayer() != null) {\n Configuration cf = module.getLayer().configuration();\n ModuleReference mref\n = cf.findModule(module.getName()).get().reference();\n return mref.location().orElse(null);\n }\n return null;\n }", "String getRootAlias();", "public static Object getRoot(Map context) {\n return context.get(OgnlContext.ROOT_CONTEXT_KEY);\n }", "Location getLocation();", "Location getLocation();", "Location getLocation();", "Location getLocation();", "String getLocation();", "String getLocation();", "String getLocation();", "public String getRoot();", "public Location getCurrentLocation();", "public static int getInnerLocation(int location) {\n switch (location) {\n case Mech.LOC_RT:\n case Mech.LOC_LT:\n return Mech.LOC_CT;\n case Mech.LOC_LLEG:\n case Mech.LOC_LARM:\n return Mech.LOC_LT;\n case Mech.LOC_RLEG:\n case Mech.LOC_RARM:\n return Mech.LOC_RT;\n default:\n return location;\n }\n }", "Path getRootPath();", "public Location getLocation() {\n return name.getLocation();\n }", "public Location getLocation() {\n return getLocation(null);\n }", "protected String getRootName() {\r\n\t\treturn ROOT_NAME;\r\n\t}", "public interface Location {\n\t/**\n\t * Returns the current path such as <code>/app/settings</code>.\n\t * \n\t * @return Path\n\t */\n\tString getPath();\n}", "IServiceContext getRoot();", "public static File getRootPackageDir(File location, String longPackageName) {\r\n\t\tfinal StringTokenizer tk = new StringTokenizer(longPackageName, \".\");\r\n\t\tFile back = location;\r\n\t\twhile (tk.hasMoreTokens()) {\r\n\t\t\ttk.nextToken();\r\n\t\t\tback = back.getParentFile();\r\n\t\t}\r\n\t\treturn back;\r\n\t}", "java.lang.String getRoot();", "Path getLocation();", "public native final String location() /*-{\n\t\treturn this[\"location\"];\n\t}-*/;", "String rootPath();", "String getContextPath();", "String getContextPath();", "String getContextPath();", "public URI getLocation()\r\n/* 293: */ {\r\n/* 294:441 */ String value = getFirst(\"Location\");\r\n/* 295:442 */ return value != null ? URI.create(value) : null;\r\n/* 296: */ }", "public String getRootName() {\n\t\treturn rootName;\n\t}", "public String getLocation() throws ServiceLocalException {\n\t\treturn (String) this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.Location);\n\t}", "protected <T> Location getLocation(FormElement<T> element) {\n\t\tLocation a = null;\n\t\tif (location != null) {\n\t\t\ta = location;\n\t\t} else {\n\t\t\tif (element.getConfig() != null) {\n\t\t\t\ta = element.getConfig().getLocation();\n\t\t\t} else {\n\t\t\t\ta = DEFAULT_LOCATION;\n\t\t\t}\n\t\t}\n\t\treturn a;\n\t}", "public String getLocationPath();", "public static String getWorldConfigLocation(String sName) {\n\n\t\treturn DataStore.dataLayerFolderPath + File.separator + \"WorldConfigs/\" + sName + \".cfg\";\n\t}", "public int getLocation() {\n\t\tint location=super.getLocation();\n\t\treturn location;\n\t}", "@SuppressWarnings(\"unused\")\n Location getCurrentLocation();", "public String getRoot() {\n\t\treturn null;\n\t}", "public String getRootPath() {\n return root.getPath();\n }", "public int getCurrentLocation() {\n\t\treturn currentLocation;\n\t}", "public java.lang.String getLocation() {\n return location;\n }", "public Path getMainPath(String location)\n\tthrows IOException, InvalidPathException {\n\tassertMainLocation(location);\n\tPath localPath = Paths.get(location);\n\tPath path = baseDir.resolve(localPath);\n\tif (localPath.isAbsolute() || ! path.equals(path.normalize())) {\n\t throw new InvalidPathException(location, \"invalid location\");\n\t}\n\tStoragePath.checkName(path.getFileName().toString());\n\treturn path;\n }", "SiteLocation getLocatedAt();", "URI getLocation();", "public String getLocationName() {\n\n\t\treturn this.locationName;\n\n\t}", "public L getDocumentLocation();", "public java.lang.String getLocation() {\n return location;\n }", "public Location getLocationByName(String name) {\n\t\tfor (Location x : locations) {\n\t\t\tif (x.getName().equals(name))\n\t\t\t\treturn x;\n\t\t}\n\t\treturn null; \n\t}", "public Location getLocation(String name) {\n String world = cfg.getString(name + \".World\");\n double x = cfg.getDouble(name + \".X\");\n double y = cfg.getDouble(name + \".Y\");\n double z = cfg.getDouble(name + \".Z\");\n float yaw = (float) cfg.getDouble(name + \".Yaw\");\n float pitch = (float) cfg.getDouble(name + \".Pitch\");\n\n return new Location(getWorld(name), x, y, z, yaw, pitch);\n }", "public RTWLocation parent();", "public String getCurrentLocation() {\n return currentLocation;\n }", "public int getLocation() {\n\t\treturn 0;\n\t}", "public BwLocation getLocation() {\n if (location == null) {\n location = BwLocation.makeLocation();\n }\n\n return location;\n }", "private String getDefaultTabletLocation(String fulltable)\n {\n try {\n // Get the table ID\n String tableId = conn.tableOperations().tableIdMap().get(fulltable);\n\n // Create a scanner over the metadata table, fetching the 'loc' column of the default\n // tablet row\n Scanner scan = conn.createScanner(\"accumulo.metadata\",\n conn.securityOperations().getUserAuthorizations(conf.getUsername()));\n scan.fetchColumnFamily(new Text(\"loc\"));\n scan.setRange(new Range(tableId + '<'));\n\n // scan the entry\n String location = null;\n for (Entry<Key, Value> kvp : scan) {\n if (location != null) {\n throw new PrestoException(INTERNAL_ERROR,\n \"Scan for default tablet returned more than one entry\");\n }\n\n location = kvp.getValue().toString();\n }\n\n scan.close();\n return location != null ? location : DUMMY_LOCATION;\n }\n catch (Exception e) {\n // Swallow this exception so the query does not fail due to being unable\n // to locate the tablet server for the default tablet.\n // This is purely an optimization, but we will want to log the error.\n LOG.error(\"Failed to get tablet location, returning dummy location\", e);\n e.printStackTrace();\n return DUMMY_LOCATION;\n }\n }", "public Rectangle getLocationRectangle(String name)throws UnknownLocationException {\n\t\tif(rootEndpointSet.contains(name)) {\n\t\t\treturn root.getRectangle();\n\t\t}\n\t\telse if(subEndpointTable.containsKey(name)) {\n\t\t\treturn ((DeviceMover)\n\t\t\t\t(subEndpointTable.get(name))).getRectangle();\n\t\t}\n\t\telse {\n\t\t\tthrow new UnknownLocationException(\"the location '\" + name +\n\t\t\t\t\"' does not exist.\");\n\t\t}\t\n\t}", "public static MapLocation myLocation() {\n return RC.getLocation();\n }", "public static String rootDir()\n {\n read_if_needed_();\n \n return _root;\n }", "private static String getNoteLocation(String noteName) {\n return NoteConstants.NOTE_LOCATION + RegistryConstants.PATH_SEPARATOR + noteName +\n NoteConstants.NOTE_FILE_EXTENSION_SEPARATOR + NoteConstants.NOTE_FILE_EXTENSION;\n }", "public abstract String getLocation();", "public final String getLocation() {\n return location;\n }", "@Override\n\tpublic String getLocation() {\n\t\treturn location;\n\t}", "public Location getLocation ( ) {\n\t\treturn extract ( handle -> handle.getLocation ( ) );\n\t}", "public String getLocation() {\r\n\t\treturn location; \r\n\t}", "void getCurrentCourseLocalPathRoot(String phoneGapCallback, GetCourseLocalPathRootCompleted callback);", "@Override\n\tpublic String getLocation() {\n\t\treturn this.location;\n\t}", "public String getLocation() {\r\n\t\treturn location;\r\n\t}", "@Override\n\tpublic int getLocationId() {\n\t\treturn _locMstLocation.getLocationId();\n\t}", "public int getLocation()\r\n {\n }", "@Override\r\n public String getRootURI() {\r\n if (rootUri == null) {\r\n final StringBuilder buffer = new StringBuilder();\r\n appendRootUri(buffer, true);\r\n buffer.append(SEPARATOR_CHAR);\r\n rootUri = buffer.toString().intern();\r\n }\r\n return rootUri;\r\n }", "@Override\n\tpublic String getLocation() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getLocation() {\n\t\treturn null;\n\t}", "public static Locations getLocations(WebElement root) {\n Preconditions.checkNotNull(root, \"The element cannot be null.\");\n Point topLeft = root.getLocation();\n Dimension dimension = root.getSize();\n Point topRight = topLeft.moveBy(dimension.getWidth(), 0);\n Point bottomRight = topRight.moveBy(0, dimension.getHeight());\n Point bottomLeft = topLeft.moveBy(0, dimension.getHeight());\n return new Locations(topLeft, topRight, bottomLeft, bottomRight);\n }", "public String getLocation() {\n\t\treturn location;\n\t}", "public Location getLocation() {\n try {\n initLocation();\n Location location = locationManager.getLastKnownLocation(locationProviderName);\n if (location == null) {\n Logger.e(\"Cannot obtain location from provider \" + locationProviderName);\n return new Location(\"unknown\");\n }\n return location;\n } catch (IllegalArgumentException e) {\n Logger.e(\"Cannot obtain location\", e);\n return new Location(\"unknown\");\n }\n }", "public String getLocation() {\r\n return location;\r\n }", "public URI getCurrentContext();", "public String getLocatorCurrent() {\n\t\treturn null;\r\n\t}", "com.google.ads.googleads.v14.common.LocationInfo getLocation();", "Place resolveLocation( Place place );", "public String getLocation() {\n return location;\n }", "public String getRootPath() {\r\n return rootPath;\r\n }", "public Location getCurrentLocation()\n\t{\n\t\treturn currentLocation;\n\t}", "@HippoEssentialsGenerated(internalName = \"katharsisexampleshippo:location\")\n public String getLocation() {\n return getProperty(LOCATION);\n }", "public String getApplicationContext()\n {\n return configfile.getApplicationPath(getASPManager().getCurrentHostIndex());\n }", "public String getLocation() { return location; }", "public String getLocation() { return location; }", "public String[] findTreeLocation(String s){\n for (TreeInfo t : TreeInfo.values()){\n if(t.getTreeType().contains(s)){\n return t.getTreeLocation();\n }\n }\n return null;\n }", "public String getLocation() {\n\t\t\treturn location;\n\t\t}", "protected String getLocationInfo() {\n\t\tString locInfo = \"\";\n\t\tif (currParseLocation != null) {\n\t\t\tlocInfo = StreamsResources.getStringFormatted(StreamsResources.RESOURCE_BUNDLE_NAME,\n\t\t\t\t\t\"ConfigParserHandler.at.line\", currParseLocation.getLineNumber());\n\t\t}\n\t\treturn locInfo;\n\t}", "@Override\r\n\tpublic Store getStore(String name, String location){\r\n\t\tif (name != null && location != null) {\r\n\t\t\ttry {\r\n\t\t\t\tIData data = DataFactory.getInstance(emf);\r\n\t\t\t\tIPersistence pm = data.getPersistenceManager();\r\n\t\t\t\tIPersistenceContext pctx = pm.getPersistenceContext();\r\n\t\t\t\tStore store = data.getStoreQuery().queryStore(name, location, pctx);\r\n\t\t\t\treturn store;\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tif (LoggerConfig.ON) {\r\n\t\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public String getLocation() {\r\n return location;\r\n }" ]
[ "0.6137372", "0.59186673", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5846729", "0.58462304", "0.5842318", "0.58355874", "0.582467", "0.582467", "0.582467", "0.582467", "0.58060133", "0.58060133", "0.58060133", "0.5741696", "0.5704852", "0.5679449", "0.56629646", "0.5591111", "0.5579387", "0.556028", "0.55564797", "0.55418295", "0.55372036", "0.55317265", "0.548599", "0.5474528", "0.5468788", "0.5449622", "0.5449622", "0.5449622", "0.54370224", "0.5408736", "0.5406346", "0.5362365", "0.5342626", "0.53320366", "0.5323669", "0.53151023", "0.5293682", "0.5293272", "0.52826583", "0.52775896", "0.52767897", "0.5275365", "0.52714944", "0.5270055", "0.52605647", "0.5257825", "0.5245577", "0.5240162", "0.5232514", "0.5220695", "0.52115965", "0.5209924", "0.52015716", "0.51967126", "0.519485", "0.51588553", "0.5156261", "0.51534706", "0.514929", "0.51487035", "0.51453066", "0.51432234", "0.51427346", "0.5137528", "0.51354873", "0.5134244", "0.51311386", "0.5125001", "0.5120884", "0.5120884", "0.5103903", "0.5085841", "0.50855243", "0.5083158", "0.508259", "0.5063189", "0.5061553", "0.50564164", "0.5054173", "0.5052965", "0.50510544", "0.50455976", "0.50443465", "0.50394106", "0.50394106", "0.5036298", "0.50336176", "0.50302064", "0.50293404", "0.5026544" ]
0.6708846
0
TOTAL COUNT: 10, for now!
public Executor(){ errorsMade = 0; decisionsMade = 0; //total number of decisions made accross all days // dailyBenchmark = 4; //number of apps that you shld get right disads = 0; numApps = 7; //number of apps in one day numDay = 1; errorThreshold = 3; //number of errors for one disadulation. threshold of 3 = 2 errors allowed. 3rd one is a disad. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getTotalCount();", "Long getAllCount();", "public int getTotalCount() {\n return totalCount;\n }", "int getResultsCount();", "int getResultsCount();", "public int getTotRuptures();", "@Override\n public long count() {\n return super.doCountAll();\n }", "@Override\n public long count() {\n return super.doCountAll();\n }", "@Override\n public long count() {\n return super.doCountAll();\n }", "public int get_count();", "public void count() {\n APIlib.getInstance().addJSLine(jsBase + \".count();\");\n }", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "int getNumberOfResults();", "public int countResults() \n {\n return itsResults_size;\n }", "int findAllCount() ;", "public int getTotalCount() {\r\n return root.getTotalCount();\r\n }", "long getTotalProductsCount();", "@Override\r\n\tpublic int totalCount() {\n\t\treturn sqlSession.selectOne(namespace + \".totalCount\");\r\n\t}", "@Override\r\n\tpublic int totalCount() {\n\t\treturn sqlSession.selectOne(namespace + \".totalCount\");\r\n\t}", "public long getTotalCount() {\n return _totalCount;\n }", "long countAll();", "long countAll();", "@Override\r\n\tpublic void iterateCount() {\n\t\t\r\n\t}", "public synchronized int getCount()\n\t{\n\t\treturn count;\n\t}", "public static int getCount() {\r\n\t\treturn count;\r\n\t}", "public static int getCount() {\r\n\t\treturn count;\r\n\t}", "public static int getCount() {\r\n\t\treturn count;\r\n\t}", "@Override\r\n\tprotected int count() {\n\t\treturn service.count();\r\n\t}", "public int totalNum(){\n return wp.size();\n }", "public long countAll();", "int getTotalElements();", "public Integer countAll();", "int getReaultCount();", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();", "public int totalRowsCount();", "@Override\r\n\tpublic int getCountByAll() throws Exception {\n\t\treturn 0;\r\n\t}", "public int getCount() {\n return definition.getInteger(COUNT, 1);\n }", "@Override\r\n\tpublic Long getTotalCount() {\n\t\treturn null;\r\n\t}", "long getCount();", "long getCount();", "public long getCount()\n\t{\n\t\treturn count;\n\t}", "@Override\n\tpublic void count() {\n\t\t\n\t}", "@Override\r\n\tpublic int getTotal() {\n\t\treturn mapper.count();\r\n\t}", "public Long getTotalCount() {\r\n return totalCount;\r\n }", "public int getCount() {\n\t\treturn Dispatch.get(object, \"Count\").getInt();\n\t}", "public int listAmount() {\n return count;\n }", "public long countAll() {\n\t\treturn super.doCountAll();\n\t}", "public int getCount(){\n int c = 0;\n for(String s : this.counts){\n c += Integer.parseInt(s);\n }\n return c;\n }", "@Override\r\n\t\tpublic int count() {\n\t\t\treturn 0;\r\n\t\t}", "int getInCount();", "@Override\npublic long count() {\n\treturn super.count();\n}", "int getActAmountCount();", "int getDataCount();", "int getDataCount();", "int getDataCount();", "int getDataCount();", "int getDataCount();", "int getCazuriCount();", "public abstract int getCount();", "public void addCount()\n {\n \tcount++;\n }", "Integer countAll();", "@Override\n\tpublic int count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int count() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int count() {\n\t\treturn 0;\n\t}", "public long count() ;", "public int getCount()\r\n {\r\n return counts.peekFirst();\r\n }", "@Override\r\n\tpublic long count() {\n\t\treturn 0;\r\n\t}", "public int numberOfOccorrence();", "public int count() {\r\n return count;\r\n }", "int getListCount();", "int getCountOfAllBooks();", "public long count() {\n\t\treturn 0;\n\t}", "public long count() {\n\t\treturn 0;\n\t}", "public static int getCount() {\n\t\treturn count;\n\t}", "public int count();", "public int count();", "public int count();", "public int count();", "public int count() {\n\t\treturn count;\n\t}", "public static int getCount(){\n\t\treturn countFor;\n\t}", "public int getCount()\r\n {\r\n int answer=0;\r\n answer+=recCount(root);\r\n return answer;\r\n }", "private void updateTotalPageNumbers() {\n totalPageNumbers = rows.size() / NUM_ROWS_PER_PAGE;\n }", "@Override\n public long count();", "int getItemsCount();", "int getItemsCount();", "public Long getTotalCount() {\n\t\treturn this.totalCount;\n\t}", "public int count() {\n return count;\n }", "public Integer getCount() {\n\t\treturn count;\n\t}" ]
[ "0.7915168", "0.75063235", "0.7253009", "0.7151748", "0.7151748", "0.71307576", "0.71072155", "0.71072155", "0.71072155", "0.7090294", "0.7061855", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70175815", "0.70140797", "0.7011373", "0.70056796", "0.6998222", "0.69933635", "0.69933635", "0.6958704", "0.69459456", "0.69459456", "0.69184077", "0.69037986", "0.68998647", "0.68998647", "0.68998647", "0.6897404", "0.6869707", "0.685476", "0.6852823", "0.6842604", "0.6836614", "0.6836361", "0.6836361", "0.6836361", "0.6830966", "0.6827389", "0.68227524", "0.681652", "0.68138516", "0.68138516", "0.6810184", "0.6809449", "0.68013024", "0.6792791", "0.6789222", "0.67883545", "0.67814916", "0.6776685", "0.67762303", "0.6762491", "0.67598295", "0.67269844", "0.6717383", "0.6717383", "0.6717383", "0.6717383", "0.6717383", "0.6712538", "0.6701057", "0.6694802", "0.6687743", "0.6685997", "0.6685997", "0.6685997", "0.6685997", "0.6685086", "0.6679761", "0.6679212", "0.66777396", "0.6675182", "0.667324", "0.6647383", "0.66417235", "0.66417235", "0.6638858", "0.6632", "0.6632", "0.6632", "0.6632", "0.66286725", "0.6626111", "0.6621043", "0.6602386", "0.65923154", "0.6591497", "0.6591497", "0.65807694", "0.6579048", "0.6576867" ]
0.0
-1
this will be rewritten once we're in processing!
public void compare(Application app, String userDecision){ int intDecision = -1; String decision = userDecision.toLowerCase(); if (decision.contains("harvard")){ // decision making will be replaced by BUTTONS in processing intDecision = 1; } if (decision.contains("greendale")){ intDecision = 0; } if (decision.contains("mit")){ intDecision = 2; } //catches bad user input in which they try to submit multiple colleges to cheat the system... nice try. if ((decision.contains("harvard") && decision.contains("mit")) || (decision.contains("harvard") && decision.contains("greendale")) || (decision.contains("mit") && decision.contains("greendale"))) { intDecision = -1; } if (intDecision == -1){ // catches bad user input, technically unnecessary but i like dissing people System.out.println("How can you call yourself an admissions officer when you can't even choose correctly?"); errorMade(); // runs failure }else if (intDecision == app.getCollege()){ System.out.println(printAcceptance(intDecision)); } else{ errorMade(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n\tpublic void processing() {\n\n\t}", "protected void additionalProcessing() {\n\t}", "@Override\n public void preprocess() {\n }", "@Override\n public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "@Override\n\tpublic void startProcessing() {\n\n\t}", "public void processing();", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "public void process() {\n\t}", "@Override\n public Object preProcess() {\n return null;\n }", "public void intermediateProcessing() {\n //empty\n }", "@Override\r\n\tprotected void processExecute() {\n\r\n\t}", "private void processUnprocessed()\n {\n List<Geometry> unprocAdds;\n myUnprocessedGeometryLock.lock();\n try\n {\n // Processing the unprocessed geometries may result in them being\n // added back to one of the unprocessed maps, so create a clean set\n // of maps for them to be added to.\n if (myUnprocessedAdds.isEmpty())\n {\n unprocAdds = null;\n }\n else\n {\n unprocAdds = myUnprocessedAdds;\n myUnprocessedAdds = New.list();\n }\n }\n finally\n {\n myUnprocessedGeometryLock.unlock();\n }\n\n if (unprocAdds != null)\n {\n distributeGeometries(unprocAdds, Collections.<Geometry>emptyList());\n }\n }", "@Override\r\n\tprotected void processTarget() {\n\r\n\t}", "@Override\r\n\tprotected void processTarget() {\n\r\n\t}", "@Override\r\n\tprotected void processCost() {\n\r\n\t}", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}", "void preProcess();", "@Override\n\tpublic void processingInstruction() {\n\t\t\n\t}", "@Override\n\tprotected void processInput() {\n\t}", "public void postProcessing() {\n //empty\n }", "protected void runBeforeIteration() {}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void process() throws Exception {\n\n\t}", "@Override\r\n\tprotected void doPre() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "public void prepareForDeferredProcessing() {\n\n }", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "public void redibujarAlgoformers() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "public boolean process() /// Returns true if it has finished processing\r\n {\r\n return true;\r\n }", "public void process() {\n\n }", "@Override\n\tpublic Result doProcessing() {\n\t\treturn doProcessing1();\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "private void parseData() {\n\t\t\r\n\t}", "@Override\n\tpublic String process() {\n\t\treturn null;\n\t}", "String processing();", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "@Override\r\n\tprotected void processCost() throws SGSException {\n\r\n\t}", "@Override\n\tpublic Map<String, Object> preProccess() {\n\t\treturn null;\n\t}", "private static void iterator() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public void process()\n\t{\n\t\tthis.layers = new ArrayList<Layer>();\n\t\t\n\t\t/**\n\t\t * list of layers to remove\n\t\t */\n\t\tthis.layersToRemove = new ArrayList<Layer>();\n\t\t\n\t\t/**\n\t\t * find all layers we need to process in the document\n\t\t */\n\t\tthis.allLayers();\n\t\t\n\t\t/**\n\t\t * we'll remove all layers which are unused in psd\n\t\t */\n\t\tthis.removeUnusedLayers();\n\t\t\n//\t\tthis.discoverMaximumLayerDepth();\n\t\t\n\t\t/*this.showLayersInformation(this.layers);\n\t\tSystem.exit(0)*/;\n\t}", "@Override\r\n\tpublic void compute() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void onReduceMp()\r\n\t{\n\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t}", "@Override\r\n\tprotected void processTarget() throws SGSException {\n\r\n\t}", "@Override\r\n\tpublic void process() {\n\t\tSystem.out.println(\"this is singleBOx \" + this.toString());\r\n\t}", "void transform() {\n\t\tint oldline, newline;\n\t\tint oldmax = oldinfo.maxLine + 2; /* Count pseudolines at */\n\t\tint newmax = newinfo.maxLine + 2; /* ..front and rear of file */\n\n\t\tfor (oldline = 0; oldline < oldmax; oldline++)\n\t\t\toldinfo.other[oldline] = -1;\n\t\tfor (newline = 0; newline < newmax; newline++)\n\t\t\tnewinfo.other[newline] = -1;\n\n\t\tscanunique(); /* scan for lines used once in both files */\n\t\tscanafter(); /* scan past sure-matches for non-unique blocks */\n\t\tscanbefore(); /* scan backwards from sure-matches */\n\t\tscanblocks(); /* find the fronts and lengths of blocks */\n\t}", "@Override\n\tprotected void postRun() {\n\n\t}", "@Override\n protected void postProcessEngineInitialisation() {\n }", "static public void falsifyProcessingJobs()\n {\n processingJobs = false;\n }", "@Override\n\tpublic void process(Page page) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void process() {\n getTelemetry().addData(\" start move\", \"BaseColor %s relic side %s\", baseColor.name(), (relicSide)?\"true\" :\"false\" );\n getTelemetry().update();\n if (JewelSensorAutoArmProcessor.JewelColor.RED.equals(baseColor)){\n if (relicSide) {\n RedRelicCorner();\n } else{\n RedNonRelicCorner();\n }\n }else{\n if (relicSide) {\n BlueRelicCorner();\n } else{\n BlueNonRelicCorner();\n }\n }\n releaseGlyph();\n }", "public void process() {\n\tprocessing = true;\r\n\tCollections.sort(imageRequest, new Comparator<ImageRequest>() {\r\n\t @Override\r\n\t public int compare(ImageRequest i0, ImageRequest i1) {\r\n\t\tif (i0.zDepth < i1.zDepth)\r\n\t\t return -1;\r\n\t\tif (i0.zDepth > i1.zDepth)\r\n\t\t return 1;\r\n\t\treturn 0;\r\n\t }\r\n\r\n\t});\r\n\r\n\t// Draw alpha things\r\n\tfor (int i = 0; i < imageRequest.size(); i++) {\r\n\t ImageRequest ir = imageRequest.get(i);\r\n\t setzDepth(ir.zDepth);\r\n\t drawSprite(ir.sprite, ir.offX, ir.offY, false, false);\r\n\t}\r\n\r\n\t// Draw lighting\r\n\tfor (int i = 0; i < lightRequest.size(); i++) {\r\n\t LightRequest lr = lightRequest.get(i);\r\n\t drawLightRequest(lr.light, lr.x, lr.y);\r\n\t}\r\n\r\n\tfor (int i = 0; i < pixels.length; i++) {\r\n\t float r = ((lightMap[i] >> 16) & 0xff) / 255f;\r\n\t float g = ((lightMap[i] >> 8) & 0xff) / 255f;\r\n\t float b = (lightMap[i] & 0xff) / 255f;\r\n\r\n\t pixels[i] = ((int) (((pixels[i] >> 16) & 0xff) * r) << 16 | (int) (((pixels[i] >> 8) & 0xff) * g) << 8\r\n\t\t | (int) ((pixels[i] & 0xff) * b));\r\n\t}\r\n\r\n\timageRequest.clear();\r\n\tlightRequest.clear();\r\n\tprocessing = false;\r\n }", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "public void process() {\n cycleID.incrementAndGet();\r\n List<ChunkBB> chunkbbs;\r\n synchronized (loadedChunks) {\r\n chunkbbs = new LinkedList<>(loadedChunks);\r\n }\r\n\r\n Condition cond = chunkbbs.stream().map(\r\n b -> GAIA_STATES.WORLD_UUID.eq(b.getWorld())\r\n .and(GAIA_STATES.X.gt(b.getX() * 16))\r\n .and(GAIA_STATES.Z.gt(b.getZ() * 16))\r\n .and(GAIA_STATES.X.le(b.getX() * 16 + 16))\r\n .and(GAIA_STATES.Z.le(b.getZ() * 16 + 16))\r\n ).reduce(DSL.falseCondition(), (a, b) -> a.or(b));\r\n\r\n Gaia.DBI().submit((conf) -> {\r\n DSLContext ctx = DSL.using(conf);\r\n ctxref.set(ctx);\r\n ReturnContainer rec;\r\n\r\n while ((rec = input.poll()) != null) {\r\n switch (rec.getState()) {\r\n case DELETE:\r\n LOG.fine(\"[\" + cycleID + \"]Deleting:\\n\" + rec);\r\n ctx.executeDelete(rec.getRec());\r\n break;\r\n case UPDATE:\r\n try {\r\n LOG.fine(\"[\" + cycleID + \"]Updating:\\n\" + rec);\r\n ctx.executeUpdate(rec.getRec());\r\n } catch (Exception e) {\r\n LOG.log(Level.SEVERE, \"[\" + cycleID + \"]Failed to update record.\\n\" + rec.getRec(), e);\r\n }\r\n break;\r\n default:\r\n LOG.severe(\"[\" + cycleID + \"]Failed to process record.\\n\" + rec.getRec() + \"\\nUnknown state: \" + rec.getState());\r\n }\r\n }\r\n if (output.isEmpty()) {\r\n List<GaiaStatesRecord> recs = ctx\r\n .selectFrom(GAIA_STATES)\r\n .where(GAIA_STATES.TRANSITION_TIME.lt(new Timestamp(System.currentTimeMillis())))\r\n .and(cond)\r\n .fetch();\r\n if (!recs.isEmpty()) {\r\n LOG.fine(\"Adding \" + recs.size() + \" records to output queue.\");\r\n output.addAll(recs);\r\n }\r\n }\r\n ctxref.set(null);\r\n });\r\n }", "@Override\n public void run() {\n\tprocess();\n }", "@Override\n\tpublic void preUpdate() {\n\n\t}", "private ProcessedDynamicData( ) {\r\n super();\r\n }", "@Override\n\tpublic void pre()\n\t{\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public void smell() {\n\t\t\n\t}", "private void optimiseEVProfile()\n\t{\n\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n public void prerender() {\n }" ]
[ "0.71847457", "0.7160415", "0.6990437", "0.6663253", "0.6603203", "0.6421452", "0.6421452", "0.6421452", "0.6421452", "0.6400366", "0.6362756", "0.632073", "0.632073", "0.632073", "0.6317286", "0.61910623", "0.6126668", "0.6113758", "0.5982054", "0.5965684", "0.5941143", "0.5941143", "0.5919093", "0.5916333", "0.58929604", "0.58880806", "0.58597374", "0.57954174", "0.57919586", "0.57730806", "0.57170826", "0.5696814", "0.56676036", "0.5628132", "0.56246805", "0.5619563", "0.56070083", "0.5604822", "0.55981785", "0.55873364", "0.5579068", "0.55622274", "0.555429", "0.5550201", "0.55464", "0.5539122", "0.55387247", "0.55387247", "0.55387247", "0.55387247", "0.55387247", "0.5529847", "0.5523504", "0.5512698", "0.54979974", "0.54979974", "0.5492783", "0.5490731", "0.5478796", "0.5469311", "0.54643464", "0.54640794", "0.5463909", "0.5456746", "0.5422321", "0.5408941", "0.54014164", "0.5399483", "0.5399483", "0.53984535", "0.53984535", "0.5392735", "0.53775483", "0.5376186", "0.53758234", "0.53676975", "0.5367322", "0.53624743", "0.53568196", "0.53568196", "0.53517485", "0.53440696", "0.53422266", "0.5338742", "0.53370017", "0.53319377", "0.5322512", "0.53189695", "0.5318637", "0.5316062", "0.53072363", "0.53014296", "0.53014296", "0.53002554", "0.52982795", "0.5294812", "0.5294812", "0.5294812", "0.5294141", "0.5294141", "0.5291757" ]
0.0
-1
more complex in processing yada yada
public String printAcceptance(int school){ int letterPicker = (int) (Math.random()*10); String accLetter = acceptanceLetter[letterPicker]; if (school == 0){ accLetter += "Greendale..?"; } if (school == 1){ accLetter += "Harvard!"; } if (school == 2){ accLetter += "MIT!"; } return accLetter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void processing();", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n\tpublic void processing() {\n\n\t}", "private void processData() {\n\t\tfloat S, M, VPR, VM;\n\t\tgetCal();\n\t\tgetTimestamps();\n\t\t\n \n\t\tfor(int i = 0; i < r.length; i++) {\n\t\t\t//get lux\n\t\t\tlux[i] = RGBcal[0]*vlam[0]*r[i] + RGBcal[1]*vlam[1]*g[i] + RGBcal[2]*vlam[2]*b[i];\n \n\t\t\t//get CLA\n\t\t\tS = RGBcal[0]*smac[0]*r[i] + RGBcal[1]*smac[1]*g[i] + RGBcal[2]*smac[2]*b[i];\n\t\t\tM = RGBcal[0]*mel[0]*r[i] + RGBcal[1]*mel[1]*g[i] + RGBcal[2]*mel[2]*b[i];\n\t\t\tVPR = RGBcal[0]*vp[0]*r[i] + RGBcal[1]*vp[1]*g[i] + RGBcal[2]*vp[2]*b[i];\n\t\t\tVM = RGBcal[0]*vmac[0]*r[i] + RGBcal[1]*vmac[1]*g[i] + RGBcal[2]*vmac[2]*b[i];\n \n\t\t\tif(S > CLAcal[2]*VM) {\n\t\t\t\tCLA[i] = M + CLAcal[0]*(S - CLAcal[2]*VM) - CLAcal[1]*683*(1 - pow((float)2.71, (float)(-VPR/4439.5)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCLA[i] = M;\n\t\t\t}\n\t\t\tCLA[i] = CLA[i]*CLAcal[3];\n\t\t\tif(CLA[i] < 0) {\n\t\t\t\tCLA[i] = 0;\n\t\t\t}\n \n\t\t\t//get CS\n\t\t\tCS[i] = (float) (.7*(1 - (1/(1 + pow((float)(CLA[i]/355.7), (float)1.1026)))));\n \n\t\t\t//get activity\n\t\t\ta[i] = (float) (pow(a[i], (float).5) * .0039 * 4);\n\t\t}\n\t}", "String processing();", "private void parseData() {\n\t\t\r\n\t}", "public static void processData() {\n\t\tString dirName = \"C:\\\\research_data\\\\mouse_human\\\\homo_b47_data\\\\\";\r\n\t//\tString GNF1H_fName = \"GNF1H_genes_chopped\";\r\n\t//\tString GNF1M_fName = \"GNF1M_genes_chopped\";\r\n\t\tString GNF1H_fName = \"GNF1H\";\r\n\t\tString GNF1M_fName = \"GNF1M\";\r\n\t\tString mergedValues_fName = \"GNF1_merged_expression.txt\";\r\n\t\tString mergedPMA_fName = \"GNF1_merged_PMA.txt\";\r\n\t\tString discretizedMI_fName = \"GNF1_discretized_MI.txt\";\r\n\t\tString discretizedLevels_fName = \"GNF1_discretized_levels.txt\";\r\n\t\tString discretizedData_fName = \"GNF1_discretized_data.txt\";\r\n\t\t\r\n\t\tboolean useMotifs = false;\r\n\t\tMicroArrayData humanMotifs = null;\r\n\t\tMicroArrayData mouseMotifs = null;\r\n\t\t\r\n\t\tMicroArrayData GNF1H_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1H_PMA = new MicroArrayData();\r\n\t\tGNF1H_PMA.setDiscrete();\r\n\t\tMicroArrayData GNF1M_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1M_PMA = new MicroArrayData();\r\n\t\tGNF1M_PMA.setDiscrete();\r\n\t\t\r\n\t\ttry {\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma\"); */\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.txt.homob44\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.txt.homob44\"); */\r\n\t\t\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.sn.txt\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.sn.txt\");\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\tif (useMotifs) {\r\n\t\t\thumanMotifs = new MicroArrayData();\r\n\t\t\tmouseMotifs = new MicroArrayData();\r\n\t\t\tloadMotifs(humanMotifs,GNF1H_value.geneNames,mouseMotifs,GNF1M_value.geneNames);\r\n\t\t}\r\n\t\t\r\n\t\t// combine replicates in PMA values\r\n\t\tint[][] H_PMA = new int[GNF1H_PMA.numRows][GNF1H_PMA.numCols/2];\r\n\t\tint[][] M_PMA = new int[GNF1M_PMA.numRows][GNF1M_PMA.numCols/2];\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tint k = 0;\r\n\t\tint v = 0;\r\n\t\tk = 0;\r\n\t\tj = 0;\r\n\t\twhile (j<GNF1H_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<H_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1H_PMA.dvalues[i][j] > 0 & GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0 | GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tH_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tj = 0;\r\n\t\tk = 0;\r\n\t\twhile (j<GNF1M_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<M_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1M_PMA.dvalues[i][j] > 0 & GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0 | GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tM_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tint numMatched = 31;\r\n\t\t\r\n\t/*\tGNF1H_value.numCols = numMatched;\r\n\t\tGNF1M_value.numCols = numMatched; */\r\n\t\t\r\n\t\tint[][] matchPairs = new int[numMatched][2];\r\n\t\tfor(i=0;i<numMatched;i++) {\r\n\t\t\tmatchPairs[i][0] = i;\r\n\t\t\tmatchPairs[i][1] = i + GNF1H_value.numCols;\r\n\t\t}\r\n\t\t\r\n\t//\tDiscretizeAffyData H_discretizer = new DiscretizeAffyData(GNF1H_value.values,H_PMA,0);\r\n\t//\tH_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1H_value.values,H_PMA,GNF1H_value.numCols);\r\n\t\t\r\n\t//\tDiscretizeAffyData M_discretizer = new DiscretizeAffyData(GNF1M_value.values,M_PMA,0);\r\n\t//\tM_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1M_value.values,M_PMA,GNF1M_value.numCols);\r\n\t\t\r\n\t\tdouble[][] mergedExpression = new double[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[][] mergedPMA = new int[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[] species = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1H_value.values[i],0,mergedExpression[i],0,GNF1H_value.numCols);\r\n\t\t\tSystem.arraycopy(H_PMA[i],0,mergedPMA[i],0,GNF1H_value.numCols);\t\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1M_value.values[i],0,mergedExpression[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t\tSystem.arraycopy(M_PMA[i],0,mergedPMA[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t}\r\n\t\t\r\n\t\t// concatenate experiment and gene names\r\n\t\tfor (i=0;i<GNF1H_value.numCols;i++) {\r\n\t\t\tGNF1H_value.experimentNames[i] = \"h_\" + GNF1H_value.experimentNames[i];\r\n\t\t\tspecies[i] = 1;\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numCols;i++) {\r\n\t\t\tGNF1M_value.experimentNames[i] = \"m_\" + GNF1M_value.experimentNames[i];\r\n\t\t\tspecies[i+GNF1H_value.numCols] = 2;\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedExperimentNames = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\tSystem.arraycopy(GNF1H_value.experimentNames,0,mergedExperimentNames,0,GNF1H_value.numCols);\r\n\t\tSystem.arraycopy(GNF1M_value.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\tif (useMotifs) {\r\n\t\t\tSystem.arraycopy(humanMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols,humanMotifs.numCols);\r\n\t\t\tSystem.arraycopy(mouseMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols+humanMotifs.numCols,mouseMotifs.numCols);\r\n\t\t\tfor (i=0;i<humanMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols] = 3;\r\n\t\t\t}\r\n\t\t\tfor (i=0;i<mouseMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols] = 4;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedGeneNames = new String[GNF1H_value.numRows];\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tmergedGeneNames[i] = GNF1H_value.geneNames[i] + \"|\" + GNF1M_value.geneNames[i];\r\n\t\t}\r\n\t\t\r\n\t\tint[] filterList = new int[GNF1M_value.numRows];\r\n\t\tint numFiltered = 0;\r\n\t\tdouble maxExpressedPercent = 1.25;\r\n\t\tint maxExpressed_H = (int) Math.floor(maxExpressedPercent*((double) GNF1H_value.numCols));\r\n\t\tint maxExpressed_M = (int) Math.floor(maxExpressedPercent*((double) GNF1M_value.numCols));\r\n\t\tint numExpressed_H = 0;\r\n\t\tint numExpressed_M = 0;\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tnumExpressed_H = 0;\r\n\t\t\tfor (j=0;j<GNF1H_value.numCols;j++) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1H_value.values[i][j])) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t\t\tnumExpressed_H++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tnumExpressed_M = 0;\r\n\t\t\tfor (j=0;j<GNF1M_value.numCols;j++) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1M_value.values[i][j])) {\r\n\t\t\t\t\tnumExpressed_M++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (numExpressed_M >= maxExpressed_M | numExpressed_H >= maxExpressed_H) {\r\n\t\t\t\tfilterList[i] = 1;\r\n\t\t\t\tnumFiltered++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tGNF1H_value = null;\r\n\t\tGNF1H_PMA = null;\r\n\t\tGNF1M_value = null;\r\n\t\tGNF1M_PMA = null;\r\n\t\t\r\n\t\tdouble[][] mergedExpression2 = null;\r\n\t\tif (numFiltered > 0) {\r\n\t\t\tk = 0;\r\n\t\t\tint[][] mergedPMA2 = new int[mergedPMA.length-numFiltered][mergedPMA[0].length];\r\n\t\t\tif (!useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length];\r\n\t\t\t} else {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t}\r\n\t\t\tString[] mergedGeneNames2 = new String[mergedGeneNames.length-numFiltered];\r\n\t\t\tfor (i=0;i<filterList.length;i++) {\r\n\t\t\t\tif (filterList[i] == 0) {\r\n\t\t\t\t\tmergedPMA2[k] = mergedPMA[i];\r\n\t\t\t\t\tif (!useMotifs) {\r\n\t\t\t\t\t\tmergedExpression2[k] = mergedExpression[i];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[k],0,mergedExpression[i].length);\r\n\t\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[k],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[k],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmergedGeneNames2[k] = mergedGeneNames[i];\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmergedPMA = mergedPMA2;\r\n\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\tmergedGeneNames = mergedGeneNames2;\r\n\t\t} else {\r\n\t\t\tif (useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t\tfor (i=0;i<mergedExpression.length;i++) {\r\n\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[i],0,mergedExpression[i].length);\r\n\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[i],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[i],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t}\r\n\t\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tDiscretizeAffyPairedData discretizer = new DiscretizeAffyPairedData(mergedExpression,mergedPMA,matchPairs,20);\r\n\t\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = discretizer.expression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = discretizer.numExperiments;\r\n\t\tmergedData.numRows = discretizer.numGenes;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tdiscretizer.discretizeDownTree(dirName+discretizedMI_fName);\r\n\t\t\tdiscretizer.mergeDownLevels(3,dirName+discretizedLevels_fName);\r\n\t\t\tdiscretizer.transposeDExpression();\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t\tmergedData.dvalues = discretizer.dExpression;\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t/*\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = mergedExpression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = mergedExpression[0].length;\r\n\t\tmergedData.numRows = mergedExpression.length;\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t//\tmergedData.dvalues = simpleDiscretization(mergedExpression,mergedPMA);\r\n\t\t\tmergedData.dvalues = simpleDiscretization2(mergedExpression,species);\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} */\r\n\t\t\r\n\t}", "protected void additionalProcessing() {\n\t}", "public void getJobMixAndMakeProcesses(){\n if(jobType == 1){\n //type 1: there is only one process, with A=1 and B=C=0\n //since there is only one process, no the currentWord is 111%processSize\n processes.add(new process(1, 1, 0, 0, 111 % processSize));\n\n }else if(jobType ==2){\n //type 2: there are four processes, each with A=1, B=C=0\n for(int i=1; i<5; i++){\n processes.add(new process(i, 1, 0, 0, (111*i) % processSize));\n }\n\n\n }else if(jobType ==3){\n //type 3: there are four processes, each with A=B=C=0\n for(int i=1; i<5; i++){\n processes.add(new process(i,0, 0, 0, (111*i) % processSize));\n }\n\n }else{\n System.out.println(\"job type 4!!\");\n //process 1 with A=0.75, B=0.25, C=0\n processes.add(new process(1, 0.75, 0.25, 0, (111) % processSize));\n //process 2 with A=0.75, B= 0, C=0.25\n processes.add(new process(2, 0.75, 0, 0.25, (111*2) % processSize));\n //process 3 with A=0.75, B=0.125, C=0.125\n processes.add(new process(3, 0.75, 0.125, 0.125, (111*3) % processSize));\n //process 4 with A=0.5, B=0.125, C=0.125\n processes.add(new process(4, 0.5, 0.125, 0.125, (111*4) % processSize));\n\n }\n\n }", "private void processCalculation(String line) {\n\t\t//TODO: fill\n\t}", "public static void processGraphInformation () {\n\n for (int i = 0; i < data.length(); i++) {\n if (data.charAt(i) == ',')\n cutPoints.add(i);\n }\n if(isNumeric(data.substring(1, cutPoints.get(0))))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(1, cutPoints.get(0))));\n for (int j = 0; j < cutPoints.size(); j++) {\n\n if (j==cutPoints.size()-1){\n if(isNumeric(data.substring(cutPoints.get(j)+1,endOfLineIndex )))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(cutPoints.get(j)+1,endOfLineIndex )));\n } else{\n if(isNumeric(data.substring(cutPoints.get(j) + 1, cutPoints.get(j+1))))\n tempPPGWaveBuffer.add(Double.parseDouble(data.substring(cutPoints.get(j) + 1, cutPoints.get(j+1))));\n }\n\n }\n graphIn.obtainMessage(handlerState4, Integer.toString(tempSampleTime)).sendToTarget(); //Comment this part to run junit tests\n if (tempSampleTime != 0) {\n tempReceived = true;\n graphIn.obtainMessage(handlerState2, Boolean.toString(tempReceived)).sendToTarget(); //Comment this part to run junit tests\n graphIn.obtainMessage(handlerState1, tempPPGWaveBuffer).sendToTarget(); //Comment this part to run junit tests\n } else {\n tempReceived = false;\n graphIn.obtainMessage(handlerState2, Boolean.toString(tempReceived)).sendToTarget(); //Comment this part to run junit tests\n }\n }", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "@Override\r\n\tprotected void processCost() {\n\r\n\t}", "private void inzsr() {\n\t\tid1Ctdta = 1;\n\t\tstrCtdta = \"Each KGS \";\n\t\tfor (int idxCtdta = 1; idxCtdta <= 1; idxCtdta++) {\n\t\t\tum[idxCtdta] = subString(strCtdta, id1Ctdta, 11);\n\t\t\tid1Ctdta = Integer.valueOf(id1Ctdta + 11);\n\t\t}\n\t\t// Initialise message subfile\n\t\tnmfkpinds.setPgmInd32(true);\n\t\tstateVariable.setZzpgm(replaceStr(stateVariable.getZzpgm(), 1, 8, \"WWCONDET\"));\n\t\t// - Set date\n\t\tstateVariable.setZzdate(getDate().toInt());\n\t\t// -\n\t\t// - CONTRACT\n\t\tcontractHeader.retrieve(stateVariable.getXwordn());\n\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t// - CUSTOMER\n\t\tpurchases.retrieve(stateVariable.getXwbccd());\n\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t// BR00012 Debtor not found on Purchases\n\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\tstateVariable.setXwg4tx(all(\"-\", 40));\n\t\t}\n\t\t// - REPRESENTATIVE\n\t\tsalespersons.retrieve(stateVariable.getPerson());\n\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t// BR00013 Rep not found on Salespersons\n\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\tstateVariable.setPname(all(\"-\", 34));\n\t\t}\n\t\t// - STATUS\n\t\torderStatusDescription.retrieve(stateVariable.getXwstat());\n\t\tnmfkpinds.setPgmInd99(! lastIO.isFound());\n\t\t// BR00014 Status not found on Order_status_description\n\t\tif (nmfkpinds.pgmInd99()) {\n\t\t\tstateVariable.setXwsdsc(all(\"-\", 20));\n\t\t}\n\t}", "public void processImpactResults(Object o)\r\n/* 259: */ {\r\n/* 260:220 */ if ((o instanceof BetterSignal))\r\n/* 261: */ {\r\n/* 262:221 */ BetterSignal signal = (BetterSignal)o;\r\n/* 263:222 */ String input = (String)signal.get(0, String.class);\r\n/* 264:223 */ Connections.getPorts(this).transmit(TO_TEXT_VIEWER, new BetterSignal(new Object[] { \"Commentary\", \"clear\" }));\r\n/* 265:224 */ translate(input);\r\n/* 266: */ }\r\n/* 267: */ }", "public void bft() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static void m148172a(EditPreviewInfo editPreviewInfo, String[] strArr, long[] jArr, long[] jArr2, float[] fArr, long[] jArr3) {\n for (int i = 0; i < editPreviewInfo.getVideoList().size(); i++) {\n EditVideoSegment editVideoSegment = (EditVideoSegment) editPreviewInfo.getVideoList().get(i);\n strArr[i] = editVideoSegment.getVideoPath();\n if (editVideoSegment.getVideoCutInfo() != null) {\n VideoCutInfo videoCutInfo = editVideoSegment.getVideoCutInfo();\n jArr[i] = videoCutInfo.getStart();\n jArr2[i] = videoCutInfo.getEnd();\n fArr[i] = videoCutInfo.getSpeed();\n } else {\n jArr[i] = -1;\n jArr2[i] = -1;\n fArr[i] = 1.0f;\n }\n }\n if (editPreviewInfo.getSceneIn() > 0 || editPreviewInfo.getSceneOut() > 0) {\n jArr3[0] = editPreviewInfo.getSceneIn();\n jArr3[1] = editPreviewInfo.getSceneOut();\n return;\n }\n jArr3[0] = -1;\n jArr3[1] = -1;\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}", "public void processData() {\n\t\t SamReader sfr = SamReaderFactory.makeDefault().validationStringency(ValidationStringency.LENIENT).open(this.inputFile);\n\t\t \n\t\t\t\n\t\t\t//Set up file writer\n\t\t SAMFileWriterFactory sfwf = new SAMFileWriterFactory();\n\t\t sfwf.setCreateIndex(true);\n\t\t SAMFileWriter sfw = sfwf.makeSAMOrBAMWriter(sfr.getFileHeader(), false, this.outputFile);\n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t\t//counters\n\t\t\tint totalReads = 0;\n\t\t\tint trimmedReads = 0;\n\t\t\tint droppedReads = 0;\n\t\t\tint dropTrimReads = 0;\n\t\t\tint dropMmReads = 0;\n\t\t\t\n\t\t\t//Containers\n\t\t\tHashSet<String> notFound = new HashSet<String>();\n\t\t\tHashMap<String, SAMRecord> mateList = new HashMap<String,SAMRecord>();\n\t\t\tHashSet<String> removedList = new HashSet<String>();\n\t\t\tHashMap<String,SAMRecord> editedList = new HashMap<String,SAMRecord>();\n\t\t\t\n\t\t\tfor (SAMRecord sr: sfr) {\n\t\t\t\t//Messaging\n\t\t\t\tif (totalReads % 1000000 == 0 && totalReads != 0) {\n\t\t\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Currently storing mates for %d reads.\",totalReads,trimmedReads,droppedReads,mateList.size()));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ttotalReads += 1;\n\t\t\t\t\n\t\t\t\tString keyToCheck = sr.getReadName() + \":\" + String.valueOf(sr.getIntegerAttribute(\"HI\"));\n\t\t\t\n\t\t\t\t//Make sure chromsome is available\n\t\t\t\tString chrom = sr.getReferenceName();\n\t\t\t\tif (!this.refHash.containsKey(chrom)) {\n\t\t\t\t\tif (!notFound.contains(chrom)) {\n\t\t\t\t\t\tnotFound.add(chrom);\n\t\t\t\t\t\tMisc.printErrAndExit(String.format(\"Chromosome %s not found in reference file, skipping trimming step\", chrom));\n\t\t\t\t\t}\n\t\t\t\t} else if (!sr.getReadUnmappedFlag()) {\n\t\t\t\t\tString refSeq = null;\n\t\t\t\t\tString obsSeq = null;\n\t\t\t\t\tList<CigarElement> cigar = null;\n\t\t\t\t\t\n\t\t\t\t\t//Get necessary sequence information depending on orientation\n\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\trefSeq = this.revComp(this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd()));\n\t\t\t\t\t\tobsSeq = this.revComp(sr.getReadString());\n\t\t\t\t\t\tcigar = this.reverseCigar(sr.getCigar().getCigarElements());\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\trefSeq = this.refHash.get(chrom).substring(sr.getAlignmentStart()-1,sr.getAlignmentEnd());\n\t\t\t\t\t\tobsSeq = sr.getReadString();\n\t\t\t\t\t\tcigar = sr.getCigar().getCigarElements();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Get alignments\n\t\t\t\t\tString[] alns = this.createAlignmentStrings(cigar, refSeq, obsSeq, totalReads);\n\t\t\t\t\t\n\t\t\t\t\t//Identify Trim Point\n\t\t\t\t\tint idx = this.identifyTrimPoint(alns,sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\n\t\t\t\t\t//Check error rate\n\t\t\t\t\tboolean mmPassed = false;\n\t\t\t\t\tif (mmMode) {\n\t\t\t\t\t\tmmPassed = this.isPoorQuality(alns, sr.getReadNegativeStrandFlag(), idx);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Create new cigar string\n\t\t\t\t\tif (idx < minLength || mmPassed) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tsr.setAlignmentStart(0);\n\t\t\t\t\t\tsr.setReadUnmappedFlag(true);\n\t\t\t\t\t\tsr.setProperPairFlag(false);\n\t\t\t\t\t\tsr.setReferenceIndex(-1);\n\t\t\t\t\t\tsr.setMappingQuality(0);\n\t\t\t\t\t\tsr.setNotPrimaryAlignmentFlag(false);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMateUnmapped(mateList.get(keyToCheck)));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tremovedList.add(keyToCheck);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} \n\t\t\t\t\t\tdroppedReads += 1;\n\t\t\t\t\t\tif (idx < minLength) {\n\t\t\t\t\t\t\tdropTrimReads += 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdropMmReads += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (idx+1 != alns[0].length()) {\n\t\t\t\t\t\ttrimmedReads++;\n\t\t\t\t\t\tCigar oldCig = sr.getCigar();\n\t\t\t\t\t\tCigar newCig = this.createNewCigar(alns, cigar, idx, sr.getReadNegativeStrandFlag());\n\t\t\t\t\t\tsr.setCigar(newCig);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadNegativeStrandFlag()) {\n\t\t\t\t\t\t\tint newStart = this.determineStart(oldCig, newCig, sr.getAlignmentStart());\n\t\t\t\t\t\t\tsr.setAlignmentStart(newStart);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (this.verbose) {\n\t\t\t\t\t\t\tthis.printAlignments(sr, oldCig, alns, idx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\t\tmateList.put(keyToCheck, this.changeMatePos(mateList.get(keyToCheck),sr.getAlignmentStart()));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\teditedList.put(keyToCheck,sr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(sr.getReadName());\n\t\t\t\tif (sr.getReadPairedFlag() && !sr.getMateUnmappedFlag()) {\n\t\t\t\t\t//String rn = sr.getReadName();\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tif (editedList.containsKey(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMatePos(sr,editedList.get(keyToCheck).getAlignmentStart());\n\t\t\t\t\t\t\teditedList.remove(keyToCheck);\n\t\t\t\t\t\t} else if (removedList.contains(keyToCheck)) {\n\t\t\t\t\t\t\tsr = this.changeMateUnmapped(sr);\n\t\t\t\t\t\t\tremovedList.remove(keyToCheck);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\t\tsfw.addAlignment(mateList.get(keyToCheck));\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmateList.put(keyToCheck, sr);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsfw.addAlignment(sr);\n\t\t\t\t\tif (mateList.containsKey(keyToCheck)) {\n\t\t\t\t\t\tmateList.remove(keyToCheck);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(String.format(\"Finished processing %d reads. %d were trimmed, %d were set as unmapped. Of the unmapped, %d were too short and %d had too many mismatches. Currently storing mates for %d reads.\",\n\t\t\t\t\ttotalReads,trimmedReads,droppedReads,dropTrimReads, dropMmReads, mateList.size()));\n\t\t\tSystem.out.println(String.format(\"Reads left in hash: %d. Writing to disk.\",mateList.size()));\n\t\t\tfor (SAMRecord sr2: mateList.values()) {\n\t\t\t\tsfw.addAlignment(sr2);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tsfw.close();\n\t\t\ttry {\n\t\t\t\tsfr.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\n\t}", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "private void process() {\n\tint i = 0;\n\tIOUtils.log(\"In process\");\n\tfor (Map.Entry<Integer, double[]> entry : vecSpaceMap.entrySet()) {\n\t i++;\n\t if (i % 1000 == 0)\n\t\tIOUtils.log(this.getName() + \" : \" + i + \" : \" + entry.getKey()\n\t\t\t+ \" : \" + this.getId());\n\t double[] cent = null;\n\t double sim = 0;\n\t for (double[] c : clusters.keySet()) {\n\t\t// IOUtils.log(\"before\" + c);\n\t\tdouble csim = cosSim(entry.getValue(), c);\n\t\tif (csim > sim) {\n\t\t sim = csim;\n\t\t cent = c;\n\t\t}\n\t }\n\t if (cent != null && entry.getKey() != null) {\n\t\ttry {\n\t\t clusters.get(cent).add(entry.getKey());\n\t\t} catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t}\n\t }\n\t}\n }", "public void process() {\n\t}", "public void process(){\n\n for(int i = 0; i < STEP_SIZE; i++){\n String tmp = \"\" + accData[i][0] + \",\" + accData[i][1] + \",\"+accData[i][2] +\n \",\" + gyData[i][0] + \",\" + gyData[i][1] + \",\" + gyData[i][2] + \"\\n\";\n try{\n stream.write(tmp.getBytes());\n }catch(Exception e){\n //Log.d(TAG,\"!!!\");\n }\n\n }\n\n /**\n * currently we don't apply zero-mean, unit-variance operation\n * to the data\n */\n // only accelerator's data is using, currently 200 * 3 floats\n // parse the 1D-array to 2D\n\n if(recognizer.isInRecognitionState() &&\n recognizer.getGlobalRecognitionTimes() >= Constants.MAX_GLOBAL_RECOGNITIOME_TIMES){\n recognizer.resetRecognitionState();\n }\n if(recognizer.isInRecognitionState()){\n recognizer.removeOutliers(accData);\n recognizer.removeOutliers(gyData);\n\n double [] feature = new double [FEATURE_SIZE];\n recognizer.extractFeatures(feature, accData, gyData);\n\n int result = recognizer.runModel(feature);\n String ret = \"@@@\";\n if(result != Constants.UNDEF_RET){\n if(result == Constants.FINISH_RET){\n mUserWarningService.playSpeech(\"Step\" + Integer.toString(recognizer.getLastGesture()) + Constants.RIGHT_GESTURE_INFO);\n waitForPlayout(2000);\n mUserWarningService.playSpeech(Constants.FINISH_INFO);\n waitForPlayout(1);\n recognizer.resetLastGesutre();\n recognizer.resetRecognitionState();\n ret += \"1\";\n }else if(result == Constants.RIGHT_RET){\n mUserWarningService.playSpeech(\"Step\" + Integer.toString(recognizer.getLastGesture()) + Constants.RIGHT_GESTURE_INFO);\n waitForPlayout(2000);\n mUserWarningService.playSpeech(\"Now please do Step \" + Integer.toString(recognizer.getExpectedGesture()));\n waitForPlayout(1);\n ret += \"1\";\n }else if(result == Constants.ERROR_RET){\n mUserWarningService.playSpeech(Constants.WRONG_GESTURE_WARNING + recognizer.getExpectedGesture());\n waitForPlayout(1);\n ret += \"0\";\n }else if(result == Constants.ERROR_AND_FORWARD_RET){\n mUserWarningService.playSpeech(Constants.WRONG_GESTURE_WARNING + recognizer.getLastGesture());\n waitForPlayout(1);\n if(recognizer.getExpectedGesture() <= Constants.STATE_SPACE){\n mUserWarningService.playSpeech(\n \"Step \" + recognizer.getLastGesture() + \"missing \" +\n \". Now please do Step\" + Integer.toString(recognizer.getExpectedGesture()));\n waitForPlayout(1);\n }else{\n recognizer.resetRecognitionState();\n mUserWarningService.playSpeech(\"Recognition finished.\");\n waitForPlayout(1);\n }\n\n\n ret += \"0\";\n }\n ret += \",\" + Integer.toString(result) + \"@@@\";\n\n Log.d(TAG, ret);\n Message msg = new Message();\n msg.obj = ret;\n mWriteThread.writeHandler.sendMessage(msg);\n }\n }\n\n }", "protected void processBlock() {\n\t\t// expand 16 word block into 64 word blocks.\n\t\t//\n\t\tfor (int t = 16; t <= 63; t++) {\n\t\t\tX[t] = Theta1(X[t - 2]) + X[t - 7] + Theta0(X[t - 15]) + X[t - 16];\n\t\t}\n\n\t\t//\n\t\t// set up working variables.\n\t\t//\n\t\tint a = H1;\n\t\tint b = H2;\n\t\tint c = H3;\n\t\tint d = H4;\n\t\tint e = H5;\n\t\tint f = H6;\n\t\tint g = H7;\n\t\tint h = H8;\n\n\t\tint t = 0;\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\t// t = 8 * i\n\t\t\th += Sum1(e) + Ch(e, f, g) + K[t] + X[t];\n\t\t\td += h;\n\t\t\th += Sum0(a) + Maj(a, b, c);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 1\n\t\t\tg += Sum1(d) + Ch(d, e, f) + K[t] + X[t];\n\t\t\tc += g;\n\t\t\tg += Sum0(h) + Maj(h, a, b);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 2\n\t\t\tf += Sum1(c) + Ch(c, d, e) + K[t] + X[t];\n\t\t\tb += f;\n\t\t\tf += Sum0(g) + Maj(g, h, a);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 3\n\t\t\te += Sum1(b) + Ch(b, c, d) + K[t] + X[t];\n\t\t\ta += e;\n\t\t\te += Sum0(f) + Maj(f, g, h);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 4\n\t\t\td += Sum1(a) + Ch(a, b, c) + K[t] + X[t];\n\t\t\th += d;\n\t\t\td += Sum0(e) + Maj(e, f, g);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 5\n\t\t\tc += Sum1(h) + Ch(h, a, b) + K[t] + X[t];\n\t\t\tg += c;\n\t\t\tc += Sum0(d) + Maj(d, e, f);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 6\n\t\t\tb += Sum1(g) + Ch(g, h, a) + K[t] + X[t];\n\t\t\tf += b;\n\t\t\tb += Sum0(c) + Maj(c, d, e);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 7\n\t\t\ta += Sum1(f) + Ch(f, g, h) + K[t] + X[t];\n\t\t\te += a;\n\t\t\ta += Sum0(b) + Maj(b, c, d);\n\t\t\t++t;\n\t\t}\n\n\t\tH1 += a;\n\t\tH2 += b;\n\t\tH3 += c;\n\t\tH4 += d;\n\t\tH5 += e;\n\t\tH6 += f;\n\t\tH7 += g;\n\t\tH8 += h;\n\n\t\t//\n\t\t// reset the offset and clean out the word buffer.\n\t\t//\n\t\txOff = 0;\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tX[i] = 0;\n\t\t}\n\t}", "@Override\n public void preprocess() {\n }", "void aprovarAnalise();", "private void analyzeData(){\n input1 = ihd1.getOutput();\n input2 = ihd2.getOutput();\n\n output1 = (input1 > IHD_limit);\n output2 = (input2 > IHD_limit);\n }", "@Override\n\tpublic void startProcessing() {\n\n\t}", "@Override\n protected void inputObjects() {\n alpha1 = Utils.computeRandomNumber(Modulus, sp);\n alpha2 = Utils.computeRandomNumber(Modulus, sp);\n gamma = Utils.computeRandomNumber(Modulus, sp);\n gammaTilde = Utils.computeRandomNumber(Modulus, sp);\n\n capC = g2.modPow(gamma, Modulus);\n capCTilde = g2.modPow(gammaTilde, Modulus);\n\n beta1 = alpha1.multiply(x);\n beta2 = alpha2.multiply(x);\n BigInteger capU1 = t_i.modPow(alpha1, Modulus).multiply(b_i.modPow(beta1.negate(), Modulus))\n .mod(Modulus);\n BigInteger capU2 = g1.modPow(alpha1, Modulus).multiply(g2.modPow(alpha2, Modulus)).mod(Modulus);\n\n objects.put(\"tInverse\", t.modInverse(Modulus));\n objects.put(\"b\", b);\n objects.put(\"g1\", g1);\n objects.put(\"g2\", g2);\n objects.put(\"U1Inverse\", capU1.modInverse(Modulus));\n objects.put(\"U2Inverse\", capU2.modInverse(Modulus));\n objects.put(\"CInverse\", capC.modInverse(Modulus));\n objects.put(\"CTildeInverse\", capCTilde.modInverse(Modulus));\n objects.put(\"t_i\", t_i);\n objects.put(\"b_iInverse\", b_i.modInverse(Modulus));\n }", "private void processImage(Mat image) {\t\t\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//vvvvvvvvvvvvvvvvvvv FUTURE YEARS LOOK HERE, THIS IS WHAT YOU WILL WANT TO REPLACE vvvvvvvvvvvvvvvvvvv//\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\tif (processingForPeg)\r\n\t\t{\r\n\t\t\tTargetInformation targetInfo;\r\n\t\t\tMat cleanedImage = getHSVThreshold(image);\r\n\t\t\ttargetInfo = findPeg(cleanedImage);\r\n\t\t\tinfoList.add(targetInfo);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tframesToProcess = 100; // So that the processing is continuous until found\r\n\t\t\tlookingAtGear = lookForGear(image);\r\n\t\t}\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//^^^^^^^^^^^^^^^^^^^ FUTURE YEARS LOOK HERE, THIS IS WHAT YOU WILL WANT TO REPLACE ^^^^^^^^^^^^^^^^^^^//\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t\r\n\t\treturn;\r\n }", "void preProcess();", "private int readObjectDataValues(final PdfObject pdfObject, int i, final byte[] raw, final int length) {\n \n int level=0;\n //allow for no << at start\n if(isInlineImage) {\n level = 1;\n }\n \n while(true){\n \n if(i<length && raw[i]==37) //allow for comment and ignore\n {\n i = stripComment(length, i, raw);\n }\n \n /**\n * exit conditions\n */\n if ((i>=length ||\n (endPt !=-1 && i>= endPt))||\n (raw[i] == 101 && raw[i + 1] == 110 && raw[i + 2] == 100 && raw[i + 3] == 111)||\n (raw[i]=='s' && raw[i+1]=='t' && raw[i+2]=='r' && raw[i+3]=='e' && raw[i+4]=='a' && raw[i+5]=='m')) {\n break;\n }\n \n /**\n * process value\n */\n if(raw[i]==60 && raw[i+1]==60){\n i++;\n level++;\n }else if(raw[i]==62 && i+1!=length && raw[i+1]==62 && raw[i-1]!=62){\n i++;\n level--;\n \n if(level==0) {\n break;\n }\n }else if (raw[i] == 47 && (raw[i+1] == 47 || raw[i+1]==32)) { //allow for oddity of //DeviceGray and / /DeviceGray in colorspace\n i++;\n }else if (raw[i] == 47) { //everything from /\n \n i++; //skip /\n \n final int keyStart=i;\n final int keyLength= Dictionary.findDictionaryEnd(i, raw, length);\n i += keyLength;\n \n if(i==length) {\n break;\n }\n \n //if BDC see if string\n boolean isStringPair=false;\n if(pdfObject.getID()== PdfDictionary.BDC) {\n isStringPair = Dictionary.isStringPair(i, raw, isStringPair);\n }\n \n final int type=pdfObject.getObjectType();\n \n if(debugFastCode) {\n System.out.println(\"type=\" + type + ' ' + ' ' + pdfObject.getID() + \" chars=\" + (char) raw[i - 1] + (char) raw[i] + (char) raw[i + 1] + ' ' + pdfObject + \" i=\" + i + ' ' + isStringPair);\n }\n \n //see if map of objects\n final boolean isMap = isMapObject(pdfObject, i, raw, length, keyStart, keyLength, isStringPair, type);\n \n if(raw[i]==47 || raw[i]==40 || (raw[i] == 91 && raw[i+1]!=']')) //move back cursor\n {\n i--;\n }\n \n //check for unknown value and ignore\n if(pdfKeyType==-1) {\n i = ObjectUtils.handleUnknownType(i, raw, length);\n }\n \n /**\n * now read value\n */\n if(PDFkeyInt==-1 || pdfKeyType==-1){\n if(debugFastCode) {\n System.out.println(padding + pdfObject.getObjectRefAsString() + \" =================Not implemented=\" + PDFkey + \" pdfKeyType=\" + pdfKeyType);\n }\n }else{\n i = setValue(pdfObject, i, raw, length, isMap);\n }\n \n //special case if Dest defined as names object and indirect\n }else if(raw[i]=='[' && level==0 && pdfObject.getObjectType()==PdfDictionary.Outlines){\n \n final Array objDecoder=new Array(objectReader,i, raw.length, PdfDictionary.VALUE_IS_MIXED_ARRAY,null, PdfDictionary.Names);\n objDecoder.readArray(false, raw, pdfObject, PdfDictionary.Dest);\n \n }\n \n i++;\n \n }\n \n return i;\n }", "@SuppressWarnings(\"unused\")\r\n private void findAbdomenVOI() {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 39; angle < 45; angle += 3) {\r\n int x, y, yOffset;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n scaleFactor = Math.tan(angleRad);\r\n x = xDim;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x > xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x--;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n x = xcm;\r\n y = 0;\r\n yOffset = y * xDim;\r\n while (y < ycm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n y++;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n x = 0;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x < xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x++;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 225 && angle <= 315) {\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n x = xcm;\r\n y = yDim;\r\n yOffset = y * xDim;\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n y--;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n }\r\n } // end for (angle = 0; ...\r\n \r\n int[] x1 = new int[xValsAbdomenVOI.size()];\r\n int[] y1 = new int[xValsAbdomenVOI.size()];\r\n int[] z1 = new int[xValsAbdomenVOI.size()];\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n x1[idx] = xValsAbdomenVOI.get(idx);\r\n y1[idx] = xValsAbdomenVOI.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n\r\n\r\n }", "public void redibujarAlgoformers() {\n\t\t\n\t}", "private void iterativeDataPropertyMetrics() {\n\t}", "public static void main(String[] args) {\n DGIM[] dgim = new DGIM[5];\n //从0到4分别代表2^4到2^0的位\n for (int i = 0; i < 5; i++) {\n dgim[i] = new DGIM(1000);\n }\n try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(\"cmsc5741_stream_data2.txt\")));) {\n while (true) {\n boolean isEnd = false;\n StringBuilder builder = new StringBuilder();\n int c1 = reader.read();\n builder.append((char) c1);\n while (true) {\n int c2 = reader.read();\n if ((char) c2 == ' ') {\n break;\n }\n if (c2 == -1) {\n isEnd = true;\n break;\n }\n builder.append((char) c2);\n }\n if (isEnd) {\n break;\n }\n char[] binary = Integer.toBinaryString(Integer.parseInt(builder.toString())).toCharArray();\n //寻找开始的位\n int start = 5 - binary.length;\n DGIM.number++;\n for (int i = 0; i < binary.length; i++) {\n if (binary[i] == '1') {\n dgim[start].add();\n }\n start++;\n }\n }\n Iterator<Bucket> iterator_16 = dgim[0].getQueue().iterator();\n Iterator<Bucket> iterator_8 = dgim[1].getQueue().iterator();\n Iterator<Bucket> iterator_4 = dgim[2].getQueue().iterator();\n Iterator<Bucket> iterator_2 = dgim[3].getQueue().iterator();\n Iterator<Bucket> iterator_1 = dgim[4].getQueue().iterator();\n\n\n while(iterator_16.hasNext()){\n System.out.println(\"Buckets for 16 :\"+iterator_16.next());\n }\n System.out.println(\"There are \"+dgim[0].getContent()+\" count of 16\");\n while(iterator_8.hasNext()){\n System.out.println(\"Buckets for 8 :\"+iterator_8.next());\n }\n System.out.println(\"There are \"+dgim[1].getContent()+\" count of 8\");\n while(iterator_4.hasNext()){\n System.out.println(\"Buckets for 4 :\"+iterator_4.next());\n }\n System.out.println(\"There are \"+dgim[2].getContent()+\" count of 4\");\n while(iterator_2.hasNext()){\n System.out.println(\"Buckets for 2 :\"+iterator_2.next());\n }\n System.out.println(\"There are \"+dgim[3].getContent()+\" count 2\");\n\n while(iterator_1.hasNext()){\n System.out.println(\"Buckets for 1 :\"+iterator_1.next());\n }\n System.out.println(\"There are \"+dgim[4].getContent()+\" times 1\");\n\n int result = (dgim[0].getContent()*16 + dgim[1].getContent()*8\n + dgim[2].getContent()*4 + dgim[3].getContent()*2 + dgim[4].getContent())/1000;\n System.out.println(\"The average price: \"+result);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n public void preprocess() {\n }", "public void intermediateProcessing() {\n //empty\n }", "private void operate(){//DONT EDIT\n\t\tholo=getHologramProcessor();\n\t\tref=getReferenceProcessor();\n dx=getDouble(dxTF);\n dy=getDouble(dyTF);\n Tolerance=getDouble(toleranceTF);\n wavelength=getDouble(wavelengthTF);\n distance=getDouble(distanceTF);\n Sigma=getInteger(sigmaTF);\n Iterations=getInteger(iterationsTF);\n \n if (holo == null) \n throw new ArrayStoreException(\"reconstruct: No hologram selected.\");\n else \n\t\t{\n\n\t\t\t//rec = HoloJUtils.reconstruct(holo.getWidth(),1,sideCenter,holo,butterworth);\n rec = HoloJUtils.reconstruct(holo,ref,distance,wavelength,Iterations,Tolerance,Sigma);\n// if (ref != null)\n//\t\t\t{\n//\t\t\t Point p = new Point();\n//\t\t\t p.x = holo.getWidth()/2;\n// p.y = holo.getHeight()/2;\n//\t\t\t\trec = HoloJUtils.reconstruct(radius,ratio,p,ref,holo,butterworth);\n// }\n//\t\t\trec.setCalibration(imageCal);\n rec.setTitle(\"\"+title);\n\t\t\trec.showHolo(\"Hologram : \"+rec.getTitle()+\" :\");\n\t\t\trec.showAmplitude(\"Amplitude\");\n\t\t}\n }", "protected void calculaterVSMforAllQuery(String type)\n {\n ArrayList<String> resultAll=new ArrayList<>();\n for(String qid: this.queryTFscore.keySet())\n {\n //System.out.println(qid+\"----------------------------------------------------------------------------------------------\"+this.maxLength+\" \"+this.minLength);\n HashMap<String, Double> queryInfo=this.queryTFscore.get(qid);\n System.out.println(qid+\" \"+queryInfo);\n HashMap <String, Double> finalResult=new HashMap<>();\n for(String docID:this.corpusTFscore.keySet())\n {\n HashMap<String, Double> docInfo=this.corpusTFscore.get(docID);\n double upperscore=this.calculateUpperPart(queryInfo, docInfo, docID);\n double lowerscore=this.calculateLowerPart(queryInfo, docInfo, docID);\n double score=0.0;\n \n //Calculate gTerms\n //Calculate Nx\n double Nx=0.0;\n if(this.LengthInfoMap.containsKey(docID)){\n Nx=(this.LengthInfoMap.get(docID)-this.minLength)/(this.maxLength-this.minLength);\n }\n \n //Calculate gTerms\n double gTerms=1/(1+Math.exp(-Nx));\n if(upperscore!=0&&lowerscore!=0) score=gTerms*(upperscore)/lowerscore;\n //if(upperscore!=0&&lowerscore!=0) score=(upperscore)/lowerscore;\n if(score>0) {\n //System.out.println(docID+\" = \"+score);\n finalResult.put(docID, score);\n }\n \n }\n HashMap<String, Double> normalizedAndSortedResult=doNormalization(finalResult);\n //HashMap<String, Double> sortedResult=MiscUtility.sortByValues(finalResult);\n //System.out.println(normalizedAndSortedResult);\n int count=0;\n for(String docID:normalizedAndSortedResult.keySet())\n {\n if(count>9) break;\n String fullPath=this.corpusMap.get(docID);\n resultAll.add(qid+\",\"+fullPath+\",\"+normalizedAndSortedResult.get(docID));\n count++;\n }\n }\n ContentWriter.writeContent(this.base+\"\\\\Result\\\\\"+this.corpus+\"_result\"+type+\".txt\", resultAll);\n }", "public void method_6337(ahb var1, long var2, boolean var4, String var5) {\r\n super();\r\n String[] var6 = class_752.method_4253();\r\n this.field_5909 = new aji[256];\r\n this.field_5910 = new byte[256];\r\n this.field_5912 = new ArrayList();\r\n this.field_5907 = var1;\r\n this.field_5908 = new Random(var2);\r\n this.field_5911 = class_1198.method_6444(var5);\r\n boolean var10000 = var4;\r\n String[] var10;\r\n Map var19;\r\n if(var6 != null) {\r\n label91: {\r\n if(var4) {\r\n Map var7 = this.field_5911.method_6439();\r\n var10 = field_5917;\r\n var10000 = var7.containsKey(\"village\");\r\n List var15;\r\n if(var6 != null) {\r\n if(var10000) {\r\n Map var8 = (Map)var7.get(\"village\");\r\n var10000 = var8.containsKey(\"size\");\r\n if(var6 != null) {\r\n if(!var10000) {\r\n var8.put(\"size\", \"1\");\r\n }\r\n\r\n var15 = this.field_5912;\r\n class_1053 var10001 = new class_1053;\r\n var10001.method_5976(var8);\r\n var15.add(var10001);\r\n }\r\n }\r\n\r\n var10 = field_5917;\r\n var10000 = var7.containsKey(\"biome_1\");\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000) {\r\n var15 = this.field_5912;\r\n class_1055 var16 = new class_1055;\r\n var10 = field_5917;\r\n var16.method_5978((Map)var7.get(\"biome_1\"));\r\n var15.add(var16);\r\n }\r\n\r\n var10 = field_5917;\r\n var10000 = var7.containsKey(\"mineshaft\");\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000) {\r\n var15 = this.field_5912;\r\n class_1057 var17 = new class_1057;\r\n var10 = field_5917;\r\n var17.method_5982((Map)var7.get(\"mineshaft\"));\r\n var15.add(var17);\r\n }\r\n\r\n var10 = field_5917;\r\n var10000 = var7.containsKey(\"stronghold\");\r\n }\r\n\r\n if(var6 == null) {\r\n break label91;\r\n }\r\n\r\n if(var10000) {\r\n var15 = this.field_5912;\r\n class_1054 var18 = new class_1054;\r\n var10 = field_5917;\r\n var18.method_5977((Map)var7.get(\"stronghold\"));\r\n var15.add(var18);\r\n }\r\n }\r\n\r\n var19 = this.field_5911.method_6439();\r\n var10 = field_5917;\r\n this.field_5913 = var19.containsKey(\"decoration\");\r\n var10000 = this.field_5911.method_6439().containsKey(\"lake\");\r\n }\r\n }\r\n\r\n class_1198 var11;\r\n label97: {\r\n class_1187 var20;\r\n if(var6 != null) {\r\n if(var10000) {\r\n var20 = new class_1187;\r\n var20.method_6406(class_1192.field_6034);\r\n this.field_5915 = var20;\r\n }\r\n\r\n var11 = this.field_5911;\r\n if(var6 == null) {\r\n break label97;\r\n }\r\n\r\n Map var12 = this.field_5911.method_6439();\r\n var10 = field_5917;\r\n var10000 = var12.containsKey(\"lava_lake\");\r\n }\r\n\r\n if(var10000) {\r\n var20 = new class_1187;\r\n var20.method_6406(class_1192.field_6036);\r\n this.field_5916 = var20;\r\n }\r\n\r\n var19 = this.field_5911.method_6439();\r\n String[] var10002 = field_5917;\r\n this.field_5914 = var19.containsKey(\"dungeon\");\r\n var11 = this.field_5911;\r\n }\r\n\r\n Iterator var13 = var11.method_6440().iterator();\r\n\r\n label71:\r\n while(var13.hasNext()) {\r\n class_1205 var14 = (class_1205)var13.next();\r\n int var9 = var14.method_6474();\r\n\r\n while(var9 < var14.method_6474() + var14.method_6471()) {\r\n this.field_5909[var9] = var14.method_6472();\r\n this.field_5910[var9] = (byte)var14.method_6473();\r\n ++var9;\r\n if(var6 == null) {\r\n continue label71;\r\n }\r\n\r\n if(var6 == null) {\r\n break;\r\n }\r\n }\r\n\r\n if(var6 == null) {\r\n break;\r\n }\r\n }\r\n\r\n }", "void processRecords(Vector in, SummitFileWriter out) { \n\n\t\t// Create array for storing a set of summit records\n\t\tSummitRecord[] recs = new SummitRecord[in.size()];\n\n\t\ttry {\n\t\t\t// Loop on i, j, marget segment, and inputfile \n\t\t\tfor (int iz = 1; iz <= mZones; iz++) {\n\t\t\t\tfor (int jz = 1; jz <= mZones; jz++) {\n\t\t\t\t\tfor (int sg = 1; sg <= mSegments; sg++) {\n\t\t\t\t\t\tfor (int i=0; i<in.size(); i++) {\n\t\t\t\t\t\t\trecs[i] = ((SummitFileReader)in.elementAt(i)).getSpecificRecord(iz,jz,sg);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSummitRecord mrgRec = mergeRecords(recs);\n\t\t\t\t\t\tif (mrgRec != null) {\n//\t\t\t\t\t\t\tif (iz==756 && jz==57) {\n//\t\t\t\t\t\t\t\tSystem.out.println(\"Found it\");\n//\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmrgRec.setPtaz((short)iz);\n\t\t\t\t\t\t\tmrgRec.setAtaz((short)jz);\n\t\t\t\t\t\t\tmrgRec.setMarket((short)sg);\n\t\n\t\t\t\t\t\t\tout.writeRecord(mrgRec);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \"+iz);\n\t\t\t\tif (iz % 19 == 18) System.out.println();\n\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nDone.\");\n\n\t\t} catch (IOException ioe) {\n\t\t System.err.println(\"\\n Trouble!\\n\");\n\t\t ioe.printStackTrace();\n\t\t System.exit(1);\n\t\t}\n\t}", "public void calculateStastics() {\t\t\n\t\t\n\t\t/* remove verboten spectra */\n\t\tArrayList<String> verbotenSpectra = new ArrayList<String>();\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.7436.7436.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5161.5161.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4294.4294.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4199.4199.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5085.5085.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4129.4129.2.dta\");\n\t\tfor (int i = 0; i < positiveMatches.size(); i++) {\n\t\t\tMatch match = positiveMatches.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(match.getSpectrum().getFile().getName())) {\n\t\t\t\t\tpositiveMatches.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < spectra.size(); i++) {\n\t\t\tSpectrum spectrum = spectra.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(spectrum.getFile().getName())) {\n\t\t\t\t\tspectra.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* finding how much time per spectrum */\n\t\tmilisecondsPerSpectrum = (double) timeElapsed / spectra.size();\n\n\n\t\tMatch.setSortParameter(Match.SORT_BY_SCORE);\n\t\tCollections.sort(positiveMatches);\n\t\t\n\t\t\n\t\t/* Identify if each match is true or false */\n\t\ttestedMatches = new ArrayList<MatchContainer>(positiveMatches.size());\n\t\tfor (Match match: positiveMatches) {\n\t\t\tMatchContainer testedMatch = new MatchContainer(match);\n\t\t\ttestedMatches.add(testedMatch);\n\t\t}\n\t\t\n\t\t/* sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\t\n\t\t\n\n\t\t/*account for the fact that these results might have the wrong spectrum ID due to\n\t\t * Mascot having sorted the spectra by mass\n\t\t */\n\t\tif (Properties.scoringMethodName.equals(\"Mascot\")){\n\t\t\t\n\t\t\t/* hash of true peptides */\n\t\t\tHashtable<String, Peptide> truePeptides = new Hashtable<String, Peptide>();\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tString truePeptide = mc.getCorrectAcidSequence();\n\t\t\t\ttruePeptides.put(truePeptide, mc.getTrueMatch().getPeptide());\n\t\t\t}\n\t\t\t\n\t\t\t/* making a hash of the best matches */\n\t\t\tHashtable<Integer, MatchContainer> bestMascotMatches = new Hashtable<Integer, MatchContainer>(); \n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tMatchContainer best = bestMascotMatches.get(mc.getMatch().getSpectrum().getId());\n\t\t\t\tif (best == null) {\n\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t} else {\n\t\t\t\t\tif (truePeptides.get(mc.getMatch().getPeptide().getAcidSequenceString()) != null) {\n\t\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* need to set the peptide, because though it may have found a correct peptide, it might not be the right peptide for this particular spectrum */\n\t\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\t\tmc.validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestedMatches = new ArrayList<MatchContainer>(bestMascotMatches.values());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/* reduce the tested matches to one per spectrum, keeping the one that is correct if there is a correct one \n\t\t * else keep the match with the best score */\n\t\tArrayList<MatchContainer> reducedTestedMatches = new ArrayList<MatchContainer>(testedMatches.size());\n\t\tfor (Spectrum spectrum: spectra) {\n\t\t\tMatchContainer toAdd = null;\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getSpectrum().getId() == spectrum.getId()) {\n\t\t\t\t\tif (toAdd == null) {\n\t\t\t\t\t\ttoAdd = mc; \n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() < mc.getMatch().getScore()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() == mc.getMatch().getScore() && mc.isTrue()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (toAdd != null) {\n\t\t\t\treducedTestedMatches.add(toAdd);\n\t\t\t}\n\t\t}\n\t\ttestedMatches = reducedTestedMatches;\n\t\t\n\t\t/* ensure the testedMatches are considering the correct peptide */\n\t\tif (Properties.scoringMethodName.equals(\"Peppy.Match_IMP\")){\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getScore() < mc.getTrueMatch().getScore()) {\n\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\tmc.getMatch().calculateScore();\n\t\t\t\t\tmc.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/* again sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\n\t\t\n\t\t//count total true;\n\t\tfor (MatchContainer match: testedMatches) {\n\t\t\tif (match.isTrue()) {\n\t\t\t\ttrueTally++;\n\t\t\t} else {\n\t\t\t\tfalseTally++;\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.01) {\n\t\t\t\ttrueTallyAtOnePercentError = trueTally;\n\t\t\t\tpercentAtOnePercentError = (double) trueTallyAtOnePercentError / spectra.size();\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.05) {\n\t\t\t\ttrueTallyAtFivePercentError = trueTally;\n\t\t\t\tpercentAtFivePercentError = (double) trueTallyAtFivePercentError / spectra.size();\n\t\t\t}\n\t\t}\n\t\t\n\t\tgeneratePrecisionRecallCurve();\n\t}", "private void runFilters() {\n \tif (currentPoint * itp < time1) {\r\n \t\t//Accelerating filter 1\r\n \t\tfilterSum1 = currentPoint / filterLength1;\r\n \t}\r\n \telse if (currentPoint >= totalPoints - filterLength2) {\r\n \t\tfilterSum1 = 0;\r\n \t}\r\n \telse if (currentPoint * itp >= timeToDeccel) {\r\n \t\t//Deccelerating filter 1\r\n \t\tfilterSum1 = (totalPoints - filterLength2 - currentPoint) / filterLength1;\r\n \t}\r\n \telse {\r\n \t\tfilterSum1 = 1;\r\n \t}\r\n \t\r\n \t//Creating filterSum2 from the sum of the last filterLength2 values of filterSum1(Boxcar filter)\r\n \tfilterSums1[currentPoint] = filterSum1;\r\n \tint filter2Start = (int) ((currentPoint > filterLength2) ? currentPoint - filterLength2 + 1 : 0);\r\n \tfilterSum2 = 0;\r\n \tfor(int i = filter2Start; i <= currentPoint; i++) {\r\n \t\tfilterSum2 += filterSums1[i];\r\n \t}\r\n \t\r\n\t}", "public synchronized void process() \n\t{\n\t\t// for each word in a line, tally-up its frequency.\n\t\t// do sentence-segmentation first.\n\t\tCopyOnWriteArrayList<String> result = textProcessor.sentenceSegmementation(content.get());\n\t\t\n\t\t// then do tokenize each word and count the terms.\n\t\ttextProcessor.tokenizeAndCount(result);\n\t}", "public void process() {\n cycleID.incrementAndGet();\r\n List<ChunkBB> chunkbbs;\r\n synchronized (loadedChunks) {\r\n chunkbbs = new LinkedList<>(loadedChunks);\r\n }\r\n\r\n Condition cond = chunkbbs.stream().map(\r\n b -> GAIA_STATES.WORLD_UUID.eq(b.getWorld())\r\n .and(GAIA_STATES.X.gt(b.getX() * 16))\r\n .and(GAIA_STATES.Z.gt(b.getZ() * 16))\r\n .and(GAIA_STATES.X.le(b.getX() * 16 + 16))\r\n .and(GAIA_STATES.Z.le(b.getZ() * 16 + 16))\r\n ).reduce(DSL.falseCondition(), (a, b) -> a.or(b));\r\n\r\n Gaia.DBI().submit((conf) -> {\r\n DSLContext ctx = DSL.using(conf);\r\n ctxref.set(ctx);\r\n ReturnContainer rec;\r\n\r\n while ((rec = input.poll()) != null) {\r\n switch (rec.getState()) {\r\n case DELETE:\r\n LOG.fine(\"[\" + cycleID + \"]Deleting:\\n\" + rec);\r\n ctx.executeDelete(rec.getRec());\r\n break;\r\n case UPDATE:\r\n try {\r\n LOG.fine(\"[\" + cycleID + \"]Updating:\\n\" + rec);\r\n ctx.executeUpdate(rec.getRec());\r\n } catch (Exception e) {\r\n LOG.log(Level.SEVERE, \"[\" + cycleID + \"]Failed to update record.\\n\" + rec.getRec(), e);\r\n }\r\n break;\r\n default:\r\n LOG.severe(\"[\" + cycleID + \"]Failed to process record.\\n\" + rec.getRec() + \"\\nUnknown state: \" + rec.getState());\r\n }\r\n }\r\n if (output.isEmpty()) {\r\n List<GaiaStatesRecord> recs = ctx\r\n .selectFrom(GAIA_STATES)\r\n .where(GAIA_STATES.TRANSITION_TIME.lt(new Timestamp(System.currentTimeMillis())))\r\n .and(cond)\r\n .fetch();\r\n if (!recs.isEmpty()) {\r\n LOG.fine(\"Adding \" + recs.size() + \" records to output queue.\");\r\n output.addAll(recs);\r\n }\r\n }\r\n ctxref.set(null);\r\n });\r\n }", "Operations operations();", "protected void processLine(String aLine){\n\t\t \t\t String temp=aLine.substring(0, 7);\n\t\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t\t \t\t int ID=Integer.parseInt(temp);\n\t \t\t String name=aLine.substring(7, 12);\n\t \t\t //int forget=;//epoch\n\t \t\t temp=aLine.substring(31, 42);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t double a=Double.parseDouble(temp);//TODO determine what the scale of simulation should be\n\t \t\t temp=aLine.substring(42, 53);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t double e=Double.parseDouble(temp);\n\t \t\t \n\t \t\t asteriod newBody=new asteriod(a,e);//TODO find asteriodal angular shit\n\t \t\t \n\t \t\t double temp2;\n\t \t\t //54 to 63 for inclination\n\t \t\t temp=aLine.substring(54,63);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.Inclination=Math.toRadians(temp2);\n\t \t\t //64 for argument of periapsis\n\t \t\t temp=aLine.substring(63, 74);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.ArgPeriapsis=Math.toRadians(temp2);\n\t \t\t //Longitude of ascending node\n\t \t\t temp=aLine.substring(73, 84);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.LongAscenNode=Math.toRadians(temp2);\n\t \t\t //Mean Anommally/PHI\n\t \t\t temp=aLine.substring(83,96);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t temp2=Math.toRadians(temp2);\n\t \t\t newBody.meanAnomaly0=temp2;\n\t \t\t \n\t \t\t temp=aLine.substring(95,100);\n\t \t\t temp=temp.replaceAll(\"[^\\\\d.]\", \"\");\n\t \t\t temp2=Double.parseDouble(temp);\n\t \t\t newBody.H=temp2;\n\t \t\t \n\t \t\t newBody.ID=ID;\n\t \t\t newBody.name=name;\n\t \t\t newBody.setType();\n\t \t\t runnerMain.bodies.add(newBody);\n\t \t\t System.out.println(\"e:\"+newBody.eccentricity+\" ID:\"+ID+\" name: \"+name+\" LongAsnNd: \"+newBody.LongAscenNode+\" Peri: \"+newBody.ArgPeriapsis+\" MeanAn0: \"+newBody.meanAnomaly0);\n\t\t }", "public static void main(String[] args) throws IOException {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(UFTest.class.getResource(\"/\").getPath()+\"1.5/largeUF.txt\"));\n String str = bufferedReader.readLine();\n UFLJWQU uf = new UFLJWQU(Integer.parseInt(str));\n long beginTime =System.currentTimeMillis();\n while ((str = bufferedReader.readLine())!=null){\n String[] array = str.split(\" \");\n int p = Integer.parseInt(array[0]);\n int q = Integer.parseInt(array[1]);\n if(uf.connected(p,q)) continue;\n uf.union(p,q);\n// System.out.println(p+\" -- \"+q);\n }\n System.out.println(uf.count());\n System.out.println(\"cost time :\"+(System.currentTimeMillis() - beginTime));\n }", "private void analyze() {\n\t\tdouble org = 0;\n\t\tdouble avgIndPerDoc = 0;\n\t\tdouble avgTotalPerDoc = 0;\n\n\t\tfor (Instance instance : instanceProvider.getInstances()) {\n\n\t\t\tint g = 0;\n\t\t\tSet<AbstractAnnotation> orgM = new HashSet<>();\n\n//\t\t\torgM.addAll(instance.getGoldAnnotations().getAnnotations());\n//\t\t\tg += instance.getGoldAnnotations().getAnnotations().size();\n\n\t\t\tfor (AbstractAnnotation instance2 : instance.getGoldAnnotations().getAnnotations()) {\n\n\t\t\t\tResult r = new Result(instance2);\n\n\t\t\t\t{\n////\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getTrend());\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getInvestigationMethod());\n////\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(\n////\t\t\t\t\t\t\tr.getDefinedExperimentalGroups().stream().map(a -> a.get()).collect(Collectors.toList()));\n//\n//\t\t\t\t\torgM.addAll(aa);\n//\t\t\t\t\tg += aa.size();\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * props of exp\n\t\t\t\t\t */\n\t\t\t\t\tfor (DefinedExperimentalGroup instance3 : r.getDefinedExperimentalGroups()) {\n\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getOrganismModel());\n//\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(instance3.getTreatments());\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> ab = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getDeliveryMethods().stream())\n\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n\t\t\t\t\t\taa.addAll(instance3.getTreatments().stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Treatment(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getDeliveryMethod()).filter(i -> i != null)\n\t\t\t\t\t\t\t\t.collect(Collectors.toList()));\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getAnaesthetics().stream())\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryDevice()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\t// List<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryLocation()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\torgM.addAll(aa);\n\t\t\t\t\t\tg += aa.size();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tavgIndPerDoc += orgM.size();\n\t\t\tavgTotalPerDoc += g;\n\n\t\t\torg += ((double) orgM.size()) / (g == 0 ? 1 : g);\n//\t\t\tSystem.out.println(((double) orgM.size()) / g);\n\n\t\t}\n\t\tSystem.out.println(\"avgTotalPerDoc = \" + avgTotalPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"avgIndPerDoc = \" + avgIndPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"org = \" + org);\n\t\tSystem.out.println(\"avg. org = \" + (org / instanceProvider.getInstances().size()));\n\t\tSystem.out.println(new DecimalFormat(\"0.00\").format(avgTotalPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(avgIndPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(org / instanceProvider.getInstances().size()));\n\t\tSystem.exit(1);\n\n\t\tStats.countVariables(0, instanceProvider.getInstances());\n\n\t\tint count = 0;\n\t\tfor (SlotType slotType : EntityType.get(\"Result\").getSlots()) {\n\n\t\t\tif (slotType.isExcluded())\n\t\t\t\tcontinue;\n\t\t\tcount++;\n\t\t\tSystem.out.println(slotType.name);\n\n\t\t}\n\t\tSystem.out.println(count);\n\t\tSystem.exit(1);\n\t}", "public Object doProcess() {\n List<Result> retv = new ArrayList<Result>();\n try {\n current_time = NTPDate.currentTimeMillis();\n current_time_nano = Utils.nanoNow();\n\n try {\n currentProcs = ProcFSUtil.getCurrentProcsHash();\n } catch (Throwable t) {\n if (logger.isLoggable(Level.FINER)) {\n logger.log(Level.FINER, \" [ myMon ] ProcFSUtil.getCurrentProcsHash exc\", t);\n }\n }\n final Result result = getResult();\n if(result != null) {\n result.addSet(\"Max Memory\", Runtime.getRuntime().maxMemory() / MEGABYTE_FACTOR);\n result.addSet(\"Memory\", Runtime.getRuntime().totalMemory() / MEGABYTE_FACTOR);\n result.addSet(\"Free Memory\", Runtime.getRuntime().freeMemory() / MEGABYTE_FACTOR);\n retv.add(result);\n }\n\n Result r = fillMLCPUTimeStats();\n if (r != null)\n retv.add(r);\n\n r = fillParamStats();\n if (r != null)\n retv.add(r);\n\n r = fillProcsStats();\n if (r != null)\n retv.add(r);\n\n if (currentProcs != null && currentProcs.size() > 0) {\n prevProcs = currentProcs;\n }\n\n r = fillPMSStats();\n if (r != null)\n retv.add(r);\n\n r = fillMLLUSHelperStats();\n if (r != null)\n retv.add(r);\n\n r = fillPWStats();\n if (r != null)\n retv.add(r);\n\n r = fillTCWStats();\n if (r != null)\n retv.add(r);\n\n if (IS_MAC) {\n r = fillFromMAC();\n if (r != null)\n retv.add(r);\n }\n } catch (Throwable t) {\n if (logger.isLoggable(Level.FINER)) {\n logger.log(Level.FINER, \"[ myMon ] [ HANDLED ] got ex main loop ... \", t);\n }\n return null;\n } finally {\n last_time_nano = current_time_nano;\n }\n\n currentProcs = null;\n if (logger.isLoggable(Level.FINEST)) {\n logger.log(Level.FINEST, \" [ myMon ] Returning ... \\n\" + retv);\n }\n return retv;\n }", "@Override\n protected final void process() throws OutOfMemoryError {\n if(!caching()) return;\n \n // get station density\n Vector<EvaluationResult> stationSpeed = Evaluation.getResult(StationSpeed.class, this.opts); \n \n // get section that selected from TICAS GUI\n Section section = this.opts.getSection();\n \n // get stations including the section\n Station[] stations = section.getStations(this.detectorChecker); \n \n Period[] periods = this.opts.getPeriods();\n \n int idx = 0; \n int startIdx = 0;\n if(stationSpeed.size() > 1) startIdx = 1;\n for(int i=startIdx; i<stationSpeed.size(); i++)\n {\n if(printDebug && idx < periods.length) System.out.println(\" - \" + periods[idx++].getPeriodString()); \n \n EvaluationResult res = EvaluationResult.copy(stationSpeed.get(i));\n res = this.removeVirtualStationFromResult(res);\n EvaluationResult accelRes = EvaluationResult.copy(stationSpeed.get(i));\n accelRes = this.removeVirtualStationFromResult(accelRes);\n \n // add first station data (all of data are 0)\n for(int r=accelRes.ROW_DATA_START(); r<res.getRowSize(0); r++) {\n accelRes.set(accelRes.COL_DATA_START(), r, 0D);\n }\n \n for(int c=res.COL_DATA_START()+1; c<res.getColumnSize(); c++)\n {\n int stationIdx = c-res.COL_DATA_START();\n for(int r=res.ROW_DATA_START(); r<res.getRowSize(c); r++)\n {\n double u1 = Double.parseDouble(res.get(c-1, r).toString());\n double u2 = Double.parseDouble(res.get(c, r).toString());\n double distance = TMO.getDistanceInMile(stations[stationIdx-1], stations[stationIdx]);\n double accel = getAcceleration(u1, u2, distance);\n accelRes.set(c, r, accel);\n }\n }\n this.results.add(accelRes);\n } \n hasResult = true;\n }", "private void processExtractData_N() {\n\n this.normalCollection = new VertexCollection();\n\n Map<Integer, float[]> definedNormals = new HashMap<>();\n\n int n = 0;int count = 1;\n while(n < extract.getNormals().size()){\n\n float thisNormValues[] = {extract.getNormals().get(n),\n extract.getNormals().get(n+1),\n extract.getNormals().get(n+2)};\n\n definedNormals.put(count, thisNormValues);\n\n n = n+3;\n count++;\n }\n\n for(Integer nId : extract.getDrawNormalOrder()){\n float[] pushThese = definedNormals.get(nId);\n this.normalCollection.push(pushThese[0], pushThese[1], pushThese[2]);\n }\n }", "protected boolean transformIncomingData() {\r\n\t\tboolean rB=false;\r\n\t\tArrayList<String> targetStruc ;\r\n\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (transformationModelImported == false){\r\n\t\t\t\testablishTransformationModel();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// soappTransform.requiredVariables\r\n\t\t\tif (transformationsExecuted == false){\r\n\t\t\t\texecuteTransformationModel();\r\n\t\t\t}\r\n\t\t\trB = transformationModelImported && transformationsExecuted ;\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn rB;\r\n\t}", "public void processingTotal(int i);", "public void dft() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> stack = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tstack.addFirst(rootpair);\r\n\t\t\twhile (stack.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = stack.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tstack.addFirst(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] a){\n\n try {\n log.info(\"loading..\");\n\n //ExonQuantSource qs = new ExonQuantSource(new FileInputStream(System.getProperty(\"exon.quant.source\")));\n //ExonEQTLSource es = new ExonEQTLSource(new FileInputStream(System.getProperty(\"exon.eqtl.source\")), qs);\n\n TransQuantSource qs = new TransQuantSource(new FileInputStream(System.getProperty(\"exon.quant.source\")));\n TransEQTLSource es = new TransEQTLSource(new FileInputStream(System.getProperty(\"exon.eqtl.source\")), qs);\n\n\n AggregatedDataSource aggregatedSource = new AggregatedDataSource(qs, es);\n\n log.info(\"loaded\");\n\n log.info(\" \" + ((GenericQuantDataSource)aggregatedSource.quantSource).getStats());\n log.info(\" \" + ((GenericEQTLDataSource)aggregatedSource.eQTLSource).getStats());\n\n String chr = \"1\";\n int start = 1628906;\n int stop = 1629906;\n\n log.info(\"selecting \" + chr + \":\" + start + \"-\" + stop);\n\n ArrayList<DataFeature> quantResult = null;\n ArrayList<DataFeature> eQTLResult = null;\n\n long startTime = System.currentTimeMillis();\n\n quantResult = aggregatedSource.locateQuantFeatures(chr, start, stop);\n eQTLResult = aggregatedSource.locateEQTLFeatures(chr, start, stop);\n\n //for(int i=9;i<1000;i++) {\n //}\n\n long estimatedTime = System.currentTimeMillis() - startTime;\n\n log.info(\"Estimated run time:\" + estimatedTime + \" Millis\");\n\n log.info(\"quantResult.size() = \" + quantResult.size());\n log.info(\"eQTLResult.size() = \" + eQTLResult.size());\n\n for (DataFeature f : quantResult) {\n log.info(\"1 f = \" + f.getId() + \" start:\" + f.getStart() +\n \" end:\" + f.getEnd() + \" score:\" + f.getScore() );\n }\n\n for (DataFeature f : eQTLResult) {\n log.info(\"f = \" + f.getId() + \" start:\" + f.getStart() +\n \" end:\" + f.getEnd() + \" score:\" + f.getScore());\n\n log.info(\"linked to :\");\n\n for (LinkedFeature l0 : f.getLinked()) {\n log.info(\" linked = \" + l0.getFeature().getId() + \" start:\" + l0.getFeature().getStart() +\n \" end:\" + l0.getFeature().getEnd() + \" link score:\" + l0.getLinkScore());\n }\n }\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// Auto-generated catch block\n\t\t\tlog.error(\"Error!\", e);\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n log.error(\"Error!\", e);\n\t\t}\n\t}", "public void exechbase(List<String> hilbertresults, double lon1,double lon2,double lat1,double lat2) throws IOException {\n\t\tScan scan = new Scan();\r\n Table table = con.getTable(TableName.valueOf(tname));\r\n FilterList allFilters = new FilterList(FilterList.Operator.MUST_PASS_ALL);\r\n\t\t//String[] hilbertresultsindex = hilbertresults.split(\",\");\r\n\t\t\r\n\t\tfor(int i =0;i<(hilbertresults.size());i++) {\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"hilbertindex\"), CompareOperator.EQUAL,Bytes.toBytes(hilbertresults.get(i))));\r\n }\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"lon\"), CompareOperator.GREATER_OR_EQUAL,Bytes.toBytes(lon1)));\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"lon\"), CompareOperator.LESS_OR_EQUAL,Bytes.toBytes(lon2)));\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"lat\"), CompareOperator.LESS_OR_EQUAL,Bytes.toBytes(lat1)));\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"lat\"), CompareOperator.GREATER_OR_EQUAL,Bytes.toBytes(lon2)));\r\n //allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"groupid\"), CompareOperator.LESS_OR_EQUAL,Bytes.toBytes(30000)));\r\n\r\n\t\tscan.setFilter(allFilters);\r\n //scan.addFamily(Bytes.toBytes(\"data\"));\r\n \r\n ResultScanner scanner = table.getScanner(scan);\r\n int c=0;\r\n long t1 = System.currentTimeMillis();\r\n for (Result result = scanner.next(); result != null; result = scanner.next()) {\r\n //System.out.println(\"Found row : \" + result);\r\n c++;\r\n }\r\n System.out.println(\"Number of rows : \" + c);\r\n System.out.println(\"Calculation Time: \" + (System.currentTimeMillis() - t1));\r\n scanner.close();\r\n table.close();\r\n con.close();\r\n\t\t\r\n\t}", "private void preprocess(ArrayList<Point>[] dsg) {\n preprocessGroup = new ArrayList<>();\n for(ArrayList<Point> l:dsg){\n \tfor(Point p:l){\n \t\tif(p.layer<=constructor.k_point_GSkyline_groups&&p.getUnitGroupSize()<=constructor.k_point_GSkyline_groups){\n \t\t\tpreprocessGroup.add(p);\n \t\t}\n \t}\n }\n for(int i=0;i<preprocessGroup.size();i++){\n \tpreprocessGroup.get(i).index=i;\n }\n }", "private ExtList makeGraph(ExtList criteria, Object process, ExtList tuples, int aeth, ExtList result) {\n//\t\tSystem.out.println(\"propa\"+System.getProperty(\"java.library.path\"));\n\t\tLog.out(\"criteria \" + criteria);\n\t\tLog.out(\"process \" + process);\n\t\tLog.out(\"tuples \" + tuples);\n\t\tLog.out(\"aeth \" + aeth);\n\t\tLog.out(\"result \" + result);\n\t\t\n\t\tExtList buffer = new ExtList();\n\t\tExtList tuples_buffer = new ExtList();\n\t\tExtList tmp = new ExtList();\n\n\t\tExtList x;\n\t\tExtList y;\n\t\tboolean flag = true;\n\n\t\tString target_x;\n\t\tString target_y;\n\t\tString aeth_type = \"\";\n\n\n\n\t\tRengine engine;\n\n\t\tresult.clear();\n\n\t\tif (!Preprocessor.isR()) {\n\t\t\tengine = new Rengine(new String[]{\"--vanilla\"}, false, null);\n\t\t\tnew Preprocessor().setR();\n\n\t\t} else {\n\t\t\tengine = Rengine.getMainEngine();\n\t\t}\n\t\tengine.eval(\"setwd(\\\"\" + GlobalEnv.getOutputDirPath() + \"\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"\" + path + \"/lib/site-library\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"/Users/otawa/Documents/workspace/NewSSQL/lib/site-library\\\")\");\n//\t\tengine.eval(\".libPaths(\\\"/usr/local/lib/R/4.0/site-library\\\")\");\t\t\t//TODO_old -> おそらく無しでOK\n\t\tengine.eval(\"library(tidyverse)\");\n\t\tengine.eval(\"library(plotly)\");\n\t\tengine.eval(\"Sys.setlocale(\\\"LC_CTYPE\\\", \\\"ja_JP.UTF-8\\\")\");\n\n\t\ttarget_x = process.toString().split(\" \")[0];\n\t\ttarget_y = process.toString().split(\" \")[1];\n\t\tLog.info(\"process: \" + process.toString());\n\t\twhile (tuples.size() > 0) {\n\n\t\t\t/* find tuples with the same criteria */\n\n\t\t\tx = (ExtList)(tuples.get(0));\n\t\t\t//System.out.println(x+\" \"+x.size()+\" \"+tuples.size());\n//\t\t\tif (x.size()<2) {\n//\t\t\t\tbreak;\n//\t\t\t}\n\t\t\tfor (int i = 1; i < tuples.size(); i++) {\n\t\t\t\ty = (ExtList)(tuples.get(i));\n\t\t\t\t//Log.out(\"criteria: \" + criteria);\n\t\t\t\t//Log.out(\"criteria_size: \" + criteria.size());\n\t\t\t\t//Log.out(\"break x: \" + x + \" size: \" + x.size() + \" tuples.size\" + tuples.size());\n\t\t\t\t//Log.out(\"break y: \" + y + \" size: \" + y.size() + \" tuples.size\" + tuples.size());\n\t\t\t\t\n\t\t\t\tfor (int k = 0; k < criteria.size(); k++) {\n\t\t\t\t\t\n\t\t\t\t\tif (!(x.get(Integer.parseInt(criteria.get(k).toString())).equals\n\t\t\t\t\t (y.get(Integer.parseInt(criteria.get(k).toString()))))) {\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (flag) {\n\t\t\t\t\tbuffer.add(y);\n\t\t\t\t\ttuples.remove(i--);\n\t\t\t\t} else {\n\t\t\t\t\tflag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuffer.add(x);\n//\t\t\tSystem.out.println(\"buffer:\"+buffer);\n\t\t\ttuples.remove(0);\n\n\n\t\t\tList<String> buffer_x = new ArrayList<String>();\n\t\t\tList<String> buffer_y = new ArrayList<String>();\n\t\t\tList<String> buffer_aeth = new ArrayList<String>();\n\n\t\t\tfor (int i = 0; i < buffer.size(); i++) {\n\t\t\t\t//Log.out(\"2.break i: \" + i + \" target_x: \" + target_x);\n\t\t\t\t//Log.out(\"2.break i: \" + i + \" target_y: \" + target_y);\n\t\t\t\t//Log.out(\"2.break size of buffer \" + buffer.size());\n\t\t\t\tbuffer_x.add(buffer.getExtListString(i, Integer.parseInt(target_x)));\n\t\t\t\tbuffer_y.add(buffer.getExtListString(i, Integer.parseInt(target_y)));\n\t\t\t\tif (aeth > 0)\n\t\t\t\t\tbuffer_aeth.add(buffer.getExtListString(i, aeth));\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tint result_x[] = new int[buffer_x.size()];\n\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\tresult_x[i] = Integer.parseInt(buffer_x.get(i));\n\t\t\t\t\tLog.out(\"result_x(int): \" + result_x);\n\t\t\t\t}\n\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t} catch(NumberFormatException e) {\n\t\t\t\ttry {\n\t\t\t\t\tdouble result_x[] = new double[buffer_x.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\tresult_x[i] = Double.parseDouble(buffer_x.get(i));\n\t\t\t\t\t\tLog.out(\"result_x(double): \" + result_x);\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\tString result_x[] = new String[buffer_x.size()];\n\t\t\t\t\t\n\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\tresult_x[i] = buffer_x.get(i);\n\t\t\t\t\t}\n\t\t\t\t\t//Log.out(\"result_x(string): \" + Arrays.toString(result_x));\n\t\t\t\t\t//added by li to check date\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSimpleDateFormat sdFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\t\tresult_x[i] = buffer_x.get(i);\n\t\t\t\t\t\t\tDate date = sdFormat.parse(result_x[i]);\n\t\t\t\t\t\t\tLog.out(\"Is Date :\" + date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t\t\t//added by li\n\t\t\t\t\t\tengine.eval(\"result_x <- as.Date(result_x)\");\n\t\t\t\t\t} catch(ParseException e2) {\n\t\t\t\t\t\t//Log.out(\"Result_x is not a date.\");\n\t\t\t\t\t\tengine.assign(\"result_x\", result_x);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tint result_y[] = new int[buffer_y.size()];\n\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\tresult_y[i] = Integer.parseInt(buffer_y.get(i));\n\t\t\t\t}\n\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t//Log.out(\"result_y: \" + result_y);\n\t\t\t} catch(NumberFormatException e) {\n\t\t\t\ttry {\n\t\t\t\t\tdouble result_y[] = new double[buffer_y.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\t\tresult_y[i] = Double.parseDouble(buffer_y.get(i));\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t\n\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\tString result_y[] = new String[buffer_y.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_y.size(); i++) {\n\t\t\t\t\t\tresult_y[i] = buffer_y.get(i);\n\t\t\t\t\t}\n\t\t\t\t\t//added by li to check date\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSimpleDateFormat sdFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\t\tfor (int i = 0; i < buffer_x.size(); i++) {\n\t\t\t\t\t\t\tresult_y[i] = buffer_x.get(i);\n\t\t\t\t\t\t\tDate date = sdFormat.parse(result_y[i]);\n\t\t\t\t\t\t\tLog.out(\"Is Date :\" + date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t\t//added by li\n\t\t\t\t\t\tengine.eval(\"result_y <- as.Date(result_y)\");\n\t\t\t\t\t} catch(ParseException e2) {\n\t\t\t\t\t\tLog.out(\"Error!Result_y is not a date.\");\n\t\t\t\t\t\tengine.assign(\"result_y\", result_y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (aeth > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tint result_aeth[] = new int[buffer_aeth.size()];\n\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\tresult_aeth[i] = Integer.parseInt(buffer_aeth.get(i));\n\t\t\t\t\t}\n\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t} catch(NumberFormatException e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdouble result_aeth[] = new double[buffer_aeth.size()];\n\t\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\t\tresult_aeth[i] = Double.parseDouble(buffer_aeth.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\t\tString result_aeth[] = new String[buffer_aeth.size()];\n\t\t\t\t\t\tfor (int i = 0; i < buffer_aeth.size(); i++) {\n\t\t\t\t\t\t\tresult_aeth[i] = buffer_aeth.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tengine.assign(\"result_aeth\", result_aeth);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tString r_html_filename = GlobalEnv.getfilename3()+\"_graph\";\n\t\t\ttry {\n\t\t\t\tr_html_filename += \"_\" + buffer.getExtListString(0, Integer.parseInt(criteria.getExtListString(0)));\n\t\t\t\tfor (int i = 1; i < criteria.size(); i++) {\n\t\t\t\t\tr_html_filename += \"_\" + buffer.getExtListString(0, Integer.parseInt(criteria.getExtListString(i)));\n\t\t\t\t}\n\t\t\t} catch (Exception e) { }\n\n\n//\t\t\tSystem.out.println(process);\n\t\t\tint n = process.toString().split(\":\").length;\n\n\n\n\t\t\tif (aeth > 0) {\n\t\t\t\tengine.eval(\"frame <- data.frame(X=result_x, Y=result_y, AETH=result_aeth)\");\n\t\t\t\tfor (int i = 1; i < n; i++) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"color\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"fill\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"size\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"group\") && !process.toString().split(\":\")[i].contains(\"\\\"\") ) {\n\t\t\t\t\t\taeth_type = process.toString().split(\":\")[i].substring(0, process.toString().split(\":\")[i].indexOf(\"=\") + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tengine.eval(\"graph <- ggplot(data = frame, aes(x = X, y = Y, \" + aeth_type +\"AETH))\");\n\t\t\t\t//engine.eval(\"graph <- ggplot(subset(data = frame, !is.na(x,y)), aes(x = X, y = Y, \" + aeth_type +\"AETH))\");\n\t\t\t} else {\n\t\t\t\tengine.eval(\"frame <- data.frame(X=result_x, Y=result_y)\");\n\t\t\t\t//engine.eval(\"frame <- subset(data.frame(X=result_x, Y=result_y), !is.na(x,y))\");\n\t\t\t\tengine.eval(\"graph <- ggplot(data = frame, aes(x = X, y = Y))\");\n\t\t\t\t//engine.eval(\"graph <- ggplot(data = subset(frame, !is.na(X), !is.na(Y)), aes(x = X, y = Y))\");\n\t\t\t}\n\n\t\t\tfor (int i = 1; i < n; i++) {\n\t\t\t\tif((process.toString().split(\":\")[i].contains(\"color\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"fill\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"size\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"group\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"width\") ||\n\t\t\t\t\tprocess.toString().split(\":\")[i].contains(\"height\"))\n\t\t\t\t\t&& !process.toString().split(\":\")[i].contains(\"\\\"\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_bar\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity', \" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity')\");\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\tengine.eval(\" graph <- graph + \" + process.toString().split(\":\")[i].split(\"=\")[0] + \"(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tengine.eval(\" graph <- graph + \" + process.toString().split(\":\")[i] + \"()\");\n\t\t\t\t}\n\n\n\n\t\t\t/*\tif (process.toString().split(\":\")[i].contains(\"geom_point\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_point(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_point()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_line\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_line(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_line()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_smooth\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_smooth(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_smooth()\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"geom_bar\") ) {\n\t\t\t\t\tif (process.toString().split(\":\")[i].contains(\"=\")) {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity', \" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tengine.eval(\" graph <- graph + geom_bar(stat = 'identity')\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"coord_flip\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + coord_flip()\");\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"coord_polar\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + coord_polar()\");\n\t\t\t\t}\n\n\t\t\t\tif (process.toString().split(\":\")[i].contains(\"labs\") ) {\n\t\t\t\t\tengine.eval(\" graph <- graph + labs(\" + process.toString().split(\":\")[i].split(\"\\\"\")[1] + \")\");\n\t\t\t\t}\n\n////\t\t\t\tif (process.toString().split(\" \")[i].contains(\"errorbar\") ) {\n////\t\t\t\t\tengine.eval(\" graph <- graph + geom_errorbar()\");\n//\t\t\t\t} */\n\t\t\t}\n\n\t\t\tengine.eval(\"graph <- ggplotly(graph)\");\n\t\t\tLog.out(\"r: r_html_filename = \"+r_html_filename + \"_\" + count + \".html\");\n\t\t\t//engine.eval(\"htmlwidgets::saveWidget(as_widget(graph), \\\"\" + r_html_filename + \"_\" + count + \".html\\\")\");\n\t\t\tengine.eval(\"htmlwidgets::saveWidget(as_widget(graph), \\\"\" + r_html_filename + \"_\" + count + \".html\\\", selfcontained=FALSE)\");\n\t engine.end();\n\n//\t tmp = buffer.getExtList(0);\n//\t tmp.set(Integer.parseInt(target_x), \"ggplot\" + name + \".html\");\n//\t tmp.set(Integer.parseInt(target_y), name);\n//\t tuples_buffer.add(tmp);\n\n\t for (int i = 0; i < buffer.size(); i++) {\n\t \t\tbuffer.getExtList(i).set(Integer.parseInt(target_x), \"ggplot\" + r_html_filename + \"_\" + count + \".html\");\n\t \t\t//buffer.getExtList(i).set(Integer.parseInt(target_y), r_html_filename);\n\t \t\tbuffer.getExtList(i).set(Integer.parseInt(target_y), \"\");\n//\t \t\tSystem.out.println(buffer.getExtListString(i, Integer.parseInt(target_x)));\n//\t \t\tSystem.out.println(buffer.getExtListString(i, Integer.parseInt(target_y)));\n\t }\n//\t buffer.getExtList(0).set(Integer.parseInt(target_x), \"ggplot\" + name + \".html\");\n//\t buffer.getExtList(0).set(Integer.parseInt(target_y), name);\n\t tuples_buffer.addAll(buffer);\n\n\t result.add(buffer.getExtList(0));\n\t\t\tbuffer.clear();\n\n//\t\t\tcount++;\n//\t\t\tSystem.out.println(count);\n\n\t\t}\n\t\tcount++;\n\t\treturn tuples_buffer;\n\n\t}", "public void processRun(int nr, boolean logAtomics) throws IOException {\r\n\t\tString out =\"\";\r\n\t\t\r\n\t\tif(logAtomics) {\r\n\t\t\tout = \"\"+data.getName()+\" run \"+nr;\r\n\t\t\twriter.write(out);\r\n\t\t\twriter.write(System.getProperty(\"line.separator\"));\r\n\t\t\tout = \"gen\"+SEP+\"fitness\"+SEP+\"pfm\"+SEP+\"f_full\"+SEP+\"f_1to1\"+SEP+\"dur\"+SEP+\"AUC_full\"+SEP+\"AUC_1to1\"+SEP+\"AUC_pfm\"+SEP+\"metric\"+SEP+\"prec\"+SEP+\"recall\";\r\n\t\t\twriter.write(out);\r\n\t\t\twriter.write(System.getProperty(\"line.separator\"));\r\n\t\t\t// write to file\r\n\t\t\twriter.flush();\r\n\t\t}\r\n\t\tdouble xBefore = 0;\r\n\t\t\r\n\t\tdouble aucFull = 0; double yFullBefore = 0;\r\n\t\t\r\n\t\tdouble auc1to1 = 0; double y1to1Before = 0;\r\n\t\t\r\n\t\tdouble aucpfm = 0; double ypfmBefore = 0;\r\n\t\t\r\n\t\tMapping reference = data.getReferenceMapping();\r\n\t\tfor(int i = 0; i<perRunAndDataSet.size(); i++) {\r\n\t\t\tEvaluationPseudoMemory mem = perRunAndDataSet.get(i);\r\n\t\t\tMapping map = fitness.getMapping(mem.metric.getExpression(), mem.metric.getThreshold(), true);\r\n\t\t\t// For real F-measures use best 1-to-1 mapping\r\n\t\t\tMapping map_1to1 = Mapping.getBestOneToOneMappings(map);\r\n\t\t\tdouble prec, recall, fMeasure, prec_1to1, recall_1to1, fMeasure_1to1;\r\n\t\t\tPRFCalculator prf = new PRFCalculator();\r\n\t\t\tprec = prf.precision(map, reference);\r\n\t\t\trecall = prf.recall(map, reference);\r\n\t\t\tfMeasure = prf.fScore(map, reference);\r\n\t\t\t\r\n\t\t\tif(Double.isNaN(fMeasure) || Double.isInfinite(fMeasure)) {\r\n\t\t\t\tSystem.err.println(\"NaN computation on Fmeasure, setting it to 0\");\r\n\t\t\t\tfMeasure = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmem.precision=prec;\r\n\t\t\tmem.recall=recall;\r\n\t\t\tmem.fmeasue=fMeasure;\r\n\t\t\t\r\n\t\t\tprec_1to1 = prf.precision(map_1to1, reference);\r\n\t\t\trecall_1to1 = prf.recall(map_1to1, reference);\r\n\t\t\tfMeasure_1to1 = prf.fScore(map_1to1, reference);\r\n\t\t\t\r\n\t\t\tif(Double.isNaN(fMeasure_1to1) || Double.isInfinite(fMeasure_1to1)) {\r\n\t\t\t\tSystem.err.println(\"NaN computation on Fmeasure 1-to-1, setting it to 0\");\r\n\t\t\t\tfMeasure_1to1 = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmem.precision_1to1=prec_1to1;\r\n\t\t\tmem.recall_1to1=recall_1to1;\r\n\t\t\tmem.fmeasue_1to1=fMeasure_1to1;\r\n\t\t\t// compute auc values\r\n\t\t\tdouble xNow=mem.generation;\r\n\t\t\taucFull += computeAUCSummand(xBefore, xNow, yFullBefore, fMeasure);\r\n\t\t\tauc1to1 += computeAUCSummand(xBefore, xNow, y1to1Before, fMeasure_1to1);\r\n\t\t\taucpfm += computeAUCSummand(xBefore, xNow, ypfmBefore, mem.pseudoFMeasure);\r\n\t\t\t//log\r\n\t\t\tif(logAtomics) {\r\n\t\t\t\tlogAtomic(mem, aucFull, auc1to1, aucpfm);\r\n\t\t\t}\r\n\t\t\txBefore = xNow;\r\n\t\t\tyFullBefore = fMeasure;\r\n\t\t\ty1to1Before = fMeasure_1to1;\t\r\n\t\t\typfmBefore = mem.pseudoFMeasure;\r\n\t\t}\r\n\t\t// log to statistics final fs,auc\r\n\t\tF_full.add(yFullBefore);\r\n\t\tF_1to1.add(y1to1Before);\r\n\t\tPFM.add(ypfmBefore);\r\n\t\tAUC_full.add(aucFull);\r\n\t\tAUC_1to1.add(auc1to1);\r\n\t\tAUC_pfm.add(aucpfm);\r\n\t\t\r\n\t\tout = data.getName()+\" run:\"+nr+\"\\n\"+\"gens\"+SEP+\"fit\"+SEP+\"pfm\"+SEP+\"f\"+SEP+\"f_1to1\"+SEP+\"dur\"+SEP+\"AUC\"+SEP+\"AUC_1to1\"+SEP+\"AUC_pfm\";\r\n\t\twriter.write(out);\r\n\t\twriter.write(System.getProperty(\"line.separator\"));\r\n\t\tlogAtomic(perRunAndDataSet.getLast(),aucFull,auc1to1,aucpfm);\r\n\t}", "@Override\n\t\tprotected void process() throws Exception {\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing - Initializing Models...\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tGlobalVars.initialize();\n\n\t\t\t// Processing Step 1. - CoreNLP\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing CoreNLP.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tString processed_text = Filter\n\t\t\t\t\t.filterdata(GlobalVars.pipeline, text);\n\n\t\t\t// Processing Step 2. - Openie\"\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Openie.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\tStringBuilder openIEOutput = new StringBuilder();\n\t\t\tString temp = \"\";\n\t\t\tfor (String sentence : processed_text.split(\"\\\\. \")) {\n\n\t\t\t\tSeq<Instance> extractions = GlobalVars.openIE.extract(sentence);\n\n\t\t\t\tInstance[] arr = new Instance[extractions.length()];\n\t\t\t\textractions.copyToArray(arr);\n\n\t\t\t\tfor (Instance inst : arr) {\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tsb.append(inst.sentence() + \"\\n\");\n\t\t\t\t\tDouble conf = inst.confidence();\n\t\t\t\t\tString stringConf = conf.toString().substring(0, 4);\n\t\t\t\t\tsb.append(stringConf).append(\" (\")\n\t\t\t\t\t\t\t.append(inst.extr().arg1().text()).append(\"; \")\n\t\t\t\t\t\t\t.append(inst.extr().rel().text()).append(\"; \");\n\n\t\t\t\t\ttemp += inst.extr().arg1().text() + \"\\n\"\n\t\t\t\t\t\t\t+ inst.extr().rel().text() + \"\\n\";\n\n\t\t\t\t\tPart[] arr2 = new Part[inst.extr().arg2s().length()];\n\t\t\t\t\tinst.extr().arg2s().copyToArray(arr2);\n\t\t\t\t\t/*\n\t\t\t\t\t * for (Part arg : arr2) { sb.append(arg.text()).append(\"\");\n\t\t\t\t\t * System.out.println(\"%\" + arg.text() + \"%\"); }\n\t\t\t\t\t */\n\t\t\t\t\tif (arr2.length != 0) {\n\t\t\t\t\t\tSystem.out.println(\"Hats: \" + arr2[0]);\n\t\t\t\t\t\ttemp += arr2[0] + \"\\n\";\n\t\t\t\t\t\tsb.append(arr2[0]);\n\t\t\t\t\t\tsb.append(\")\\n\\n\");\n\t\t\t\t\t\topenIEOutput.append(sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Processing Step 3. - Rewrite\n\t\t\tthis.status = \"{\\\"status\\\":\\\"Now processing Rewrite.\\\",\\\"starttime\\\":\"\n\t\t\t\t\t+ start_time + \",\\\"uuid\\\":\\\"\" + this.uuid + \"\\\"}\";\n\t\t\t// Load load = new Load();\n\t\t\t// result = load.Loadfilter(openIEOutput.toString());\n\t\t\tresult = temp;\n\t\t}", "@Override\n public void process(AS3Parser context) {\n\n String[] result = context.findFileByString(\"init ship manager\");\n if(result.length == 0)\n System.out.println(\"FIX ME: cant find ship manager.\");\n else if(result.length > 1)\n System.out.println(\"FIX ME: multiply results for: ship manager.\");\n else{\n mShipManagerSrc = result[0];\n int moveFuncIndex = mShipManagerSrc.indexOf(\"_.x\");\n if(moveFuncIndex != -1){\n //System.out.println(\"Found player move command.\");\n String xLine = context.findLineByString(mShipManagerSrc,\"_.x\")[0];\n String yLine = context.findLineByString(mShipManagerSrc,\"_.y\")[0];\n\n String var_x = RegexHelper.match(xLine,\"var (.*?):\")[1];\n String var_y = RegexHelper.match(yLine,\"var (.*?):\")[1];\n\n String moveSubSrc = context.findLineByString(mShipManagerSrc,\"(\" + var_x + \",\" + var_y + \");\")[1];\n String moveMessageClass = RegexHelper.match(moveSubSrc,\".(.*?)\\\\.\")[1];\n moveMessageClass = moveMessageClass.trim();\n\n String proxyClassSrc = context.findFileByString(\"class \" + moveMessageClass + \" \")[0];\n String moveMessageClass2 = RegexHelper.match(proxyClassSrc,\"var_.*?\\\\.method_.*?\\\\((class_.*?)\\\\..*?\\\\);\")[1];\n String moveMessageSrc = context.findFileByString(\"class \" + moveMessageClass2 + \" \")[0];\n\n\n //getting infos\n packetId = Integer.parseInt(RegexHelper.match(RegexHelper.getStringBetween(moveMessageSrc,\"method_16()\",\"}\"),\"return (.*?);\")[1]);\n findWrite(moveMessageSrc);\n }else{\n System.out.println(\"FIX ME: cant find player move command.\");\n }\n }\n\n\n\n }", "public static void doit(String fileName) {\n\t\tSystem.out.println(\"****矩阵形式-正域(减)******\"+fileName+\"上POSD的运行时间\"+\"***********\");\r\n\t\tlong time[]=new long[8];\r\n\t\tint t=0;//time下标\r\n\t\t\r\n\t\tList<Integer> preRED=null;\r\n\t List<Integer> nowRED = null;\r\n\r\n\t // 创建DataPreprocess对象data1 \r\n\t DataPreprocess data1=new DataPreprocess(fileName);\r\n\t \r\n\t int k=0,sn=data1.get_origDSNum();\r\n\t int m1=sn/10,m=m1>0?m1:1;\r\n\t int count=sn-(int)(0.2*sn);//保持与增加对象的约简结果一致\r\n\t data1.dataRatioSelect(0.2);\r\n\t \r\n\t preRED=new ArrayList<Integer>();\r\n\t nowRED=new ArrayList<Integer>();\r\n\t \r\n\t ArrayList<ArrayList<Integer>> addData=data1.get_origDS();//交换位置,把原数据前面20%放置到后面,为了保持与对象增加一致\r\n\t ArrayList<ArrayList<Integer>> origData=data1.get_addDS();\r\n\t origData.addAll(addData);\t \t \r\n\t \r\n\t data1=null;\r\n\t\t \r\n\t Iterator<ArrayList<Integer>> value = origData.iterator();\r\n\t \r\n\t ArrayList<ArrayList<Integer>> result_POS=new ArrayList<ArrayList<Integer>>();\r\n\t ArrayList<Integer> POS_Reduct=new ArrayList<Integer>();\r\n\t ArrayList<Integer> original_POS=new ArrayList<Integer>();\r\n\t ArrayList<Integer> original_reduct=new ArrayList<Integer>();\r\n\t int[][] original_sys;\r\n\t ArrayList<Integer> P=new ArrayList<Integer>();\r\n\t IDS_POSD im1=new IDS_POSD(origData);\r\n\t \r\n\t POS_Reduct=im1.getPOS_Reduct(im1.getUn());\t \r\n\t original_POS=im1.getPOS(im1.getUn(),POS_Reduct);\r\n\t \r\n\t original_reduct.addAll(POS_Reduct);\r\n\t \t \r\n\t //original_sys=im1.getUn();\r\n\t int n1=im1.getUn().length;//原决策系统Un包含n个对象\r\n\t int s1=im1.getUn()[0].length;//m个属性,包含决策属性\t\r\n\t original_sys=new int[n1][s1];\r\n\t for(int i=0;i<n1;i++)\r\n\t \t for(int j=0;j<s1;j++)\r\n\t \t\t original_sys[i][j]=im1.getUn()[i][j];\r\n\r\n\t IDS_POSD im2=new IDS_POSD();\r\n\t \r\n\t ArrayList<Integer> temp=new ArrayList<Integer>();\r\n\t long startTime = System.currentTimeMillis(); //获取开始时间\r\n\t\t while (value.hasNext()) {\r\n\t\t\t \t\r\n\t\t\t temp.addAll(value.next());//System.out.println(temp);\r\n\t\t\t\tim2.setUn(origData);\r\n\t\t\t\tim2.setUx(temp);\t\r\n\t\t\t\tresult_POS=im2.SHU_IARS(im2.getUn(),original_reduct,original_POS,im2.getUx());\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t original_reduct=result_POS.get(0);\r\n\t\t\t original_POS=result_POS.get(1);\r\n\t\t\t \r\n\t\t\t\tk++;\r\n\t\t\t\tcount--;\r\n\t\t\t\tif(k%m==0){\r\n\t\t\t\t\t\r\n\t\t\t\t\tlong endTime=System.currentTimeMillis(); //获取结束时间 \r\n\t\t\t\t\ttime[t++]=endTime-startTime;//输出每添加10%数据求约简的时间\r\n\t\t\t\t\tif(t==8)\r\n\t\t\t\t\t\tt--;\r\n\t\t\t\t}\r\n\t\t\t\tvalue.remove();\r\n\t\t\t\ttemp=new ArrayList<Integer>();//.clear();\r\n\t\t\t\tif (count==0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t \r\n\t\t for(int i=0;i<8;i++)\t\t\t\t\r\n\t\t\t System.out.print((double)time[i]/1000+\" \"); \r\n\r\n\t\t System.out.println(\"\\n\"+fileName+\"上POSD的约简为:\"+result_POS.get(0)+\"\\n\");\t\t\r\n\t}", "public String[] ProcessLine(int phraseId, int\tsentenceId, String[] parts,int\tsentimentS){\n int sentiment=sentimentS;\n //phraseStat=new StringStat(phraseS);\n\n\n\n //Count words (uni-grams)\n HashMap<String,Integer> wordcounts=new HashMap<String,Integer>();\n for (int i = 0; i < parts.length; i++) {\n Integer count=wordcounts.get(parts[i]);\n if(count==null){\n wordcounts.put(parts[i],1);\n }\n else{\n count++;\n wordcounts.put(parts[i],count);\n }\n }\n\n /* //Count words (bi-grams)\n for (int i = 0; i < parts.length-1; i++) {\n String bigram=parts[i]+\" \"+parts[i+1];\n Integer count=wordcounts.get(bigram);\n if(count==null){\n wordcounts.put(bigram,1);\n }\n else{\n count++;\n wordcounts.put(bigram,count);\n }\n }*/\n\n //Calculate the frequency for each word\n HashMap<String,Double> wordfequncies=new HashMap<String,Double>();\n Double maxFrequncy=0.0;\n Iterator<String> itr=wordcounts.keySet().iterator();\n while(itr.hasNext()){\n String word=itr.next();\n Double fr=((double)(wordcounts.get(word))/(double)parts.length);\n maxFrequncy=Math.max(maxFrequncy,fr);\n wordfequncies.put(word,fr);\n }\n\n //Add to the word frequency\n itr=wordfequncies.keySet().iterator();\n while(itr.hasNext()) {\n String word = itr.next();\n WordStat ws=wordStats.get(word);\n if(ws==null){\n ws=new WordStat(word);\n }\n else{\n wordStats.remove(word);\n }\n ws.updateStat(sentiment,(0.5*wordfequncies.get(word))/maxFrequncy);\n wordStats.put(word,ws);\n }\n return parts;\n\n }", "public static void main(String[] args) {\n\t\t\n\t\t List<Result> outputK = new ArrayList<Result>();\n\n\t\t\t\n\t\t\tint alignment_type = Integer.parseInt(args[0]);\n\t\t\t\n\t\t\tif(alignment_type==1){\n\t\t\t\t\n\t\t\t\tGlobalAlignment gb = new GlobalAlignment();\n\n\t\t\t\toutputK = \tgb.PerformGlobalAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(r.score);\n \tSystem.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n//\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else if(alignment_type==2){\n\t\t\t\t\n\t\t\t\tLocalAlignment loc = new LocalAlignment();\n\t\t\t\toutputK = \tloc.PerformLocalAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\n\t\t\t\t\tSystem.out.println(r.score);\n System.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else if(alignment_type==3){\n\t\t\t\t\n\t\t \tDoveTail dt = new DoveTail();\t\t\n\t\t\t\toutputK = \tdt.PerformDoveTailAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\n\t\t\t\t\tSystem.out.println(r.score);\n System.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"Enter 1,2 or 3\");\n\t\t\t}\n\t\t\n\t\n\t}", "private void processUnprocessed()\n {\n List<Geometry> unprocAdds;\n myUnprocessedGeometryLock.lock();\n try\n {\n // Processing the unprocessed geometries may result in them being\n // added back to one of the unprocessed maps, so create a clean set\n // of maps for them to be added to.\n if (myUnprocessedAdds.isEmpty())\n {\n unprocAdds = null;\n }\n else\n {\n unprocAdds = myUnprocessedAdds;\n myUnprocessedAdds = New.list();\n }\n }\n finally\n {\n myUnprocessedGeometryLock.unlock();\n }\n\n if (unprocAdds != null)\n {\n distributeGeometries(unprocAdds, Collections.<Geometry>emptyList());\n }\n }", "public void run(){\n\n for (int locIdx = begN; locIdx < endN; locIdx++) {\n\n // do mean-shift for profiles at these locations\n\n for (int profileIdx=0; profileIdx<profiles.get(locIdx).size(); profileIdx++) {\n\n // access the detection\n// int profileLength = profiles.get(locIdx).get(profileIdx).length;\n\n // calculate peaks for the ring 'profileIdx'\n ArrayList<Float> currPeaks = extractPeakIdxsList(profiles.get(locIdx).get(profileIdx), startIdx.get(profileIdx), finishIdx.get(locIdx).get(profileIdx));\n\n //if (currPeaks.size()<3) {\n // // it is not a bifurcation according to MS for this ring, don't calculate further, leave empty fields of peakIdx at this location\n // break;\n //}\n //else {\n // add those points\n for (int pp=0; pp<currPeaks.size(); pp++){\n peakIdx.get(locIdx).get(profileIdx).add(pp, currPeaks.get(pp));\n }\n //}\n\n/*\n\t\t\t\tfor (int k=0; k<nrPoints; k++) {\n start[k] = ((float) k / nrPoints) * profileLength;\n }\n\n\t\t\t\tTools.runMS( \tstart,\n \tprofiles.get(locIdx).get(profileIdx),\n \tmaxIter,\n \tepsilon,\n \th,\n\t\t\t\t\t\t\t\tmsFinish);\n*/\n\n /*\n for (int i1=0; i1<nrPoints; i1++) {\n convIdx.get(locIdx).get(profileIdx)[i1] = (float) msFinish[i1];\n }\n*/\n/*\n int inputProfileLength = profiles.get(locIdx).get(profileIdx).length;\n Vector<float[]> cls = Tools.extractClusters1(msFinish, minD, M, inputProfileLength);\n\t\t\t\textractPeakIdx(cls, locIdx, profileIdx); // to extract 3 major ones (if there are three)\n*/\n\n }\n\n }\n\n }", "public void process() {\n\tprocessing = true;\r\n\tCollections.sort(imageRequest, new Comparator<ImageRequest>() {\r\n\t @Override\r\n\t public int compare(ImageRequest i0, ImageRequest i1) {\r\n\t\tif (i0.zDepth < i1.zDepth)\r\n\t\t return -1;\r\n\t\tif (i0.zDepth > i1.zDepth)\r\n\t\t return 1;\r\n\t\treturn 0;\r\n\t }\r\n\r\n\t});\r\n\r\n\t// Draw alpha things\r\n\tfor (int i = 0; i < imageRequest.size(); i++) {\r\n\t ImageRequest ir = imageRequest.get(i);\r\n\t setzDepth(ir.zDepth);\r\n\t drawSprite(ir.sprite, ir.offX, ir.offY, false, false);\r\n\t}\r\n\r\n\t// Draw lighting\r\n\tfor (int i = 0; i < lightRequest.size(); i++) {\r\n\t LightRequest lr = lightRequest.get(i);\r\n\t drawLightRequest(lr.light, lr.x, lr.y);\r\n\t}\r\n\r\n\tfor (int i = 0; i < pixels.length; i++) {\r\n\t float r = ((lightMap[i] >> 16) & 0xff) / 255f;\r\n\t float g = ((lightMap[i] >> 8) & 0xff) / 255f;\r\n\t float b = (lightMap[i] & 0xff) / 255f;\r\n\r\n\t pixels[i] = ((int) (((pixels[i] >> 16) & 0xff) * r) << 16 | (int) (((pixels[i] >> 8) & 0xff) * g) << 8\r\n\t\t | (int) ((pixels[i] & 0xff) * b));\r\n\t}\r\n\r\n\timageRequest.clear();\r\n\tlightRequest.clear();\r\n\tprocessing = false;\r\n }", "private void calculations() {\n\t\tSystem.out.println(\"Starting calculations\\n\");\n\t\tcalcMedian(myProt.getChain(requestedChain));\n\t\tcalcZvalue(myProt.getChain(requestedChain));\n\t\tcalcSVMweightedZvalue(myProt.getChain(requestedChain));\n\t}", "public void testF() {\n\t\tfor (int k = 0; k < usedSS; k++) {\n\t\t\tList<Integer> subStr = vals.subList(k*compSize, (k+1)*compSize);\n\t\t\tint sum = (int) subStr.stream().filter(i -> i != BipartiteMatching.FREE).count();\n\t\t\tfData.add(sum);\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic Result doProcessing() {\n\t\treturn doProcessing1();\n\t}", "protected void method_4160() {\r\n String[] var10000 = class_752.method_4253();\r\n ++this.field_3416;\r\n String[] var1 = var10000;\r\n int var7 = this.field_3416;\r\n if(var1 != null) {\r\n label96: {\r\n if(this.field_3416 >= 180) {\r\n var7 = this.field_3416;\r\n if(var1 == null) {\r\n break label96;\r\n }\r\n\r\n if(this.field_3416 <= 200) {\r\n float var2 = (this.field_3028.nextFloat() - 0.5F) * 8.0F;\r\n float var3 = (this.field_3028.nextFloat() - 0.5F) * 4.0F;\r\n float var4 = (this.field_3028.nextFloat() - 0.5F) * 8.0F;\r\n String[] var10001 = field_3418;\r\n this.field_2990.method_2087(\"hugeexplosion\", this.field_2994 + (double)var2, this.field_2995 + 2.0D + (double)var3, this.field_2996 + (double)var4, 0.0D, 0.0D, 0.0D);\r\n }\r\n }\r\n\r\n var7 = this.field_2990.field_1832;\r\n }\r\n }\r\n\r\n int var5;\r\n int var6;\r\n class_715 var9;\r\n ahb var10;\r\n label101: {\r\n short var8;\r\n label102: {\r\n if(var1 != null) {\r\n label85: {\r\n if(var7 == 0) {\r\n var7 = this.field_3416;\r\n var8 = 150;\r\n if(var1 != null) {\r\n label80: {\r\n if(this.field_3416 > 150) {\r\n var7 = this.field_3416 % 5;\r\n if(var1 == null) {\r\n break label80;\r\n }\r\n\r\n if(var7 == 0) {\r\n var5 = 1000;\r\n\r\n while(var5 > 0) {\r\n var6 = class_715.method_4090(var5);\r\n var5 -= var6;\r\n var10 = this.field_2990;\r\n var9 = new class_715;\r\n var9.method_4087(this.field_2990, this.field_2994, this.field_2995, this.field_2996, var6);\r\n var10.method_2089(var9);\r\n if(var1 == null) {\r\n break label85;\r\n }\r\n\r\n if(var1 == null) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n var7 = this.field_3416;\r\n }\r\n\r\n var8 = 1;\r\n }\r\n\r\n if(var1 == null) {\r\n break label102;\r\n }\r\n\r\n if(var7 == var8) {\r\n this.field_2990.method_2209(1018, (int)this.field_2994, (int)this.field_2995, (int)this.field_2996, 0);\r\n }\r\n }\r\n\r\n this.method_3864(0.0D, 0.10000000149011612D, 0.0D);\r\n this.field_3330 = this.field_3000 += 20.0F;\r\n }\r\n\r\n var7 = this.field_3416;\r\n }\r\n\r\n if(var1 == null) {\r\n break label101;\r\n }\r\n\r\n var8 = 200;\r\n }\r\n\r\n if(var7 != var8) {\r\n return;\r\n }\r\n\r\n var7 = this.field_2990.field_1832;\r\n }\r\n\r\n if(var1 != null) {\r\n if(var7 != 0) {\r\n return;\r\n }\r\n\r\n var7 = 2000;\r\n }\r\n\r\n var5 = var7;\r\n\r\n while(true) {\r\n if(var5 > 0) {\r\n var6 = class_715.method_4090(var5);\r\n var5 -= var6;\r\n var10 = this.field_2990;\r\n var9 = new class_715;\r\n var9.method_4087(this.field_2990, this.field_2994, this.field_2995, this.field_2996, var6);\r\n var10.method_2089(var9);\r\n if(var1 == null) {\r\n break;\r\n }\r\n\r\n if(var1 != null) {\r\n continue;\r\n }\r\n }\r\n\r\n this.method_4325(class_1715.method_9561(this.field_2994), class_1715.method_9561(this.field_2996));\r\n break;\r\n }\r\n\r\n this.method_3851();\r\n }", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "protected void processVertex(Vertex w){\n\t}", "public void runSRJF() {\n //init\n ArrayList<Processus> localProcess = new ArrayList<>(); //Creation of a local list of process\n //localProcess = (ArrayList<Processus>) listOfProcess.clone();\n for (Processus cpy : listOfProcess) { //Copy the list of process in the local list with new instances of process\n Processus tmp = new Processus(cpy.getName(), cpy.getTime(), (HashMap<Integer, Integer>) cpy.getListOfInOut().clone(), (HashMap<Integer, Integer>) cpy.getlistOfResource().clone());\n localProcess.add(tmp);\n }\n int size = listOfProcess.size(); //variable used to save the initial size of the list of process\n\n Processus executedProc = null; //ExecutedProc is the current process that is being execute\n Processus tmpProc = localProcess.get(0); //The tmpProc is the previous process executed\n\n //Variable we need to calcul\n double occupancyRate = 0;\n double averageWaitingTime = 0;\n double averageReturnTime = 0;\n int currentTime = 0;\n int occupancyTime = 0;\n\n //beginning of the algo\n while (!localProcess.isEmpty()) {\n tmpProc = null;\n if (executedProc != null && executedProc.getTime() <= currentTime) {//test if the current executed process is the smallest and is not in in/out operation\n for (Processus proc : localProcess) {//chose the process to execute (the shortest)\n if (proc.getTime() <= currentTime) {\n if (proc.getRessource(proc.getCurrentStep()) < executedProc.getRessource(executedProc.getCurrentStep())) {//shortest process selected\n executedProc = proc;\n }\n }\n }\n } else {//same tests but if there is no current process on the UC\n for (Processus proc : localProcess) {\n if (proc.getTime() <= currentTime) {\n if (localProcess.size() == 1 || tmpProc == null) {//if there is only only one process left in the list\n executedProc = proc;\n tmpProc = proc;\n } else if (proc.getRessource(proc.getCurrentStep()) <= tmpProc.getRessource(tmpProc.getCurrentStep())) {//shortest process selected\n executedProc = proc;\n tmpProc = proc;\n }\n }\n }\n }\n if (executedProc != null) {//if there is a process\n //execution of the process over 1 unity of time and then verifying again it's steel the smallest\n for (Processus proc : localProcess) {\n if (proc.getTime() <= currentTime && !proc.equals(executedProc)) {\n proc.setWaitingTime(1);//set th waiting time of the others process that could be executed\n }\n }\n occupancyTime++;\n currentTime++;\n executedProc.setTime(executedProc.getTime() + 1);\n executedProc.setRessource(executedProc.getCurrentStep(), executedProc.getRessource(executedProc.getCurrentStep()) - 1);\n if (executedProc.getRessource(executedProc.getCurrentStep()) <= 0) {\n if (executedProc.getCurrentStep() < executedProc.getListOfInOut().size()) {\n executedProc.setTime(currentTime + executedProc.getInOut(executedProc.getCurrentStep()));\n executedProc.setCurrentStep(executedProc.getCurrentStep() + 1);\n if (executedProc.getCurrentStep() > executedProc.getlistOfResource().size()) {\n averageReturnTime += executedProc.getExecutedTime(); //update the average return time by adding the time that the process took\n averageWaitingTime += executedProc.getWaitingTime();\n localProcess.remove(executedProc);\n }\n } else {\n averageReturnTime += executedProc.getExecutedTime(); //update the average return time by adding the time that the process took\n averageWaitingTime += executedProc.getWaitingTime();\n localProcess.remove(executedProc);\n }\n executedProc = null;\n }\n } else {\n currentTime++;\n }\n }\n //Calculation of the variables\n occupancyRate = ((double) occupancyTime / (double) currentTime) * 100;\n\n averageWaitingTime = averageWaitingTime / size;\n averageReturnTime = averageReturnTime / size;\n\n //Updating the global variables\n currentAverageReturnTime = averageReturnTime;\n logger.trace(\"Current average return time : \" + currentAverageReturnTime);\n currentAverageWaitingTime = averageWaitingTime;\n logger.trace(\"Current average waiting time : \" + currentAverageWaitingTime);\n currentOccupancyRate = occupancyRate;\n logger.trace(\"Current occupancy rate : \" + currentOccupancyRate);\n currentOccupancyTime = occupancyTime;\n logger.trace(\"Current occupancy time : \" + currentOccupancyTime);\n\n restList(); //reset the list to the origin values so the user can test another algo\n\n }", "public void processData(){\n try{\n\t\t resultTxt.setText(\"Man has been dropped.\\n\\n\");\n String line = input.readLine();\n while(line != null){ //not end of file\n String[] words = line.split(\"\\\\s\");\n\n if (isAMan(words)==true){\n \t\t\t output1.write(line+\"\\n\");\n \t\t }\n \t\t else if(isAWoman(words)==true) {\n \t\t\t output2.write(line+\"\\n\");\n\t\t\t resultTxt.append(line+\"\\n\");\n \t\t }\n line = input.readLine();\n }\n\n if (input != null){\n \t\t input.close();\n \t\t }\n \t\t if (output1 != null){\n \t\t output1.close();\n }\n if (output2 != null){\n \t\t output2.close();\n }\n }\n catch(IOException exc){\n exc.printStackTrace();\n System.err.println(\"Error: failed Fork input processor\");\n System.exit(1);\n }\n }", "void genPromote(Collection ret, int from, int to, int bits) {\n\tfor (char i = KNIGHT; i <= QUEEN; ++i) {\n\tBouger g = new Bouger(from, to, i, (bits | 32), 'P');\n\tg.setScore(1000000 + (i * 10));\n\tret.add(g);\n\t}\n\t}", "private void findVOIs(short[] cm, ArrayList<Integer> xValsAbdomenVOI, ArrayList<Integer> yValsAbdomenVOI, short[] srcBuffer, ArrayList<Integer> xValsVisceralVOI, ArrayList<Integer> yValsVisceralVOI) {\r\n \r\n // angle in radians\r\n double angleRad;\r\n \r\n // the intensity profile along a radial line for a given angle\r\n short[] profile;\r\n \r\n // the x, y location of all the pixels along a radial line for a given angle\r\n int[] xLocs;\r\n int[] yLocs;\r\n try {\r\n profile = new short[xDim];\r\n xLocs = new int[xDim];\r\n yLocs = new int[xDim];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT allocate profile\");\r\n return;\r\n }\r\n \r\n // the number of pixels along the radial line for a given angle\r\n int count;\r\n \r\n // The threshold value for muscle as specified in the JCAT paper\r\n int muscleThresholdHU = 16;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n count = 0;\r\n int x = cm[0];\r\n int y = cm[1];\r\n int yOffset = y * xDim;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = cm[1] - (int)((x - cm[0]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // x, y is a candidate abdomen VOI point\r\n // if there are more abdomenTissueLabel pixels along the radial line,\r\n // then we stopped prematurely\r\n \r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends and the muscle starts\r\n \r\n // start at the end of the profile array since its order is from the\r\n // center-of-mass to the abdomen voi point\r\n \r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx <= 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n break;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = cm[0] + (int)((cm[1] - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n x--;\r\n y = cm[1] - (int)((cm[0] - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n y++;\r\n x = cm[0] - (int)((y - cm[1]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n }\r\n } // end for (angle = 0; ...\r\n\r\n }", "public boolean process(byte[] var1_1, int var2_2, int var3_3, boolean var4_4) {\n block33: {\n block36: {\n block34: {\n block35: {\n var5_5 = this;\n var6_6 = this.state;\n var7_7 = 0;\n var8_8 = 6;\n if (var6_6 == var8_8) {\n return false;\n }\n var9_9 = var3_3 + var2_2;\n var10_10 = this.value;\n var11_11 = this.output;\n var12_12 = this.alphabet;\n var13_13 = 0;\n var14_14 = var10_10;\n var10_10 = var6_6;\n var6_6 = var2_2;\n while (true) {\n block30: {\n block27: {\n block32: {\n block31: {\n block28: {\n block29: {\n var15_15 = 3;\n var16_16 = 4;\n var17_17 = 2;\n var18_18 = 1;\n if (var6_6 >= var9_9) break;\n if (var10_10 == 0) {\n while ((var19_19 = var6_6 + 4) <= var9_9) {\n var14_14 = var1_1[var6_6] & 255;\n var14_14 = var12_12[var14_14] << 18;\n var20_20 = var6_6 + 1;\n var20_20 = var1_1[var20_20] & 255;\n var20_20 = var12_12[var20_20] << 12;\n var14_14 |= var20_20;\n var20_20 = var6_6 + 2;\n var20_20 = var1_1[var20_20] & 255;\n var20_20 = var12_12[var20_20] << var8_8;\n var14_14 |= var20_20;\n var20_20 = var6_6 + 3;\n var20_20 = var1_1[var20_20] & 255;\n if ((var14_14 |= (var20_20 = var12_12[var20_20])) < 0) break;\n var6_6 = var13_13 + 2;\n var11_11[var6_6] = var20_20 = (int)((byte)var14_14);\n var6_6 = var13_13 + 1;\n var11_11[var6_6] = var20_20 = (int)((byte)(var14_14 >> 8));\n var11_11[var13_13] = var6_6 = (int)((byte)(var14_14 >> 16));\n var13_13 += 3;\n var6_6 = var19_19;\n }\n if (var6_6 >= var9_9) break;\n }\n var19_19 = var6_6 + 1;\n var6_6 = var1_1[var6_6] & 255;\n var6_6 = var12_12[var6_6];\n var20_20 = 5;\n var7_7 = (byte)-1;\n if (var10_10 == 0) break block27;\n if (var10_10 == var18_18) break block28;\n var18_18 = -2;\n if (var10_10 == var17_17) break block29;\n if (var10_10 != var15_15) {\n if (var10_10 != var16_16) {\n if (var10_10 == var20_20 && var6_6 != var7_7) {\n var5_5.state = var8_8;\nlbl58:\n // 2 sources\n\n return false;\n }\n } else {\n var15_15 = 0;\n if (var6_6 == var18_18) {\n ++var10_10;\n } else if (var6_6 != var7_7) {\n var5_5.state = var8_8;\n return false;\n }\n }\n } else if (var6_6 >= 0) {\n var7_7 = (byte)(var14_14 << 6);\n var6_6 |= var7_7;\n var7_7 = (byte)(var13_13 + 2);\n var11_11[var7_7] = var10_10 = (int)((byte)var6_6);\n var7_7 = (byte)(var13_13 + 1);\n var11_11[var7_7] = var10_10 = (int)((byte)(var6_6 >> 8));\n var11_11[var13_13] = var7_7 = (byte)(var6_6 >> 16);\n var13_13 += 3;\n var14_14 = var6_6;\n var10_10 = 0;\n } else if (var6_6 == var18_18) {\n var6_6 = var13_13 + 1;\n var11_11[var6_6] = var7_7 = (byte)(var14_14 >> 2);\n var11_11[var13_13] = var6_6 = (int)((byte)(var14_14 >> 10));\n var13_13 += 2;\n var10_10 = var20_20;\n } else if (var6_6 != var7_7) {\n var5_5.state = var8_8;\nlbl90:\n // 3 sources\n\n return false;\n }\n break block30;\n }\n if (var6_6 >= 0) break block31;\n if (var6_6 == var18_18) {\n var6_6 = var13_13 + 1;\n var11_11[var13_13] = var7_7 = (byte)(var14_14 >> 4);\n var13_13 = var6_6;\n var10_10 = var16_16;\n } else if (var6_6 != var7_7) {\n var5_5.state = var8_8;\n ** continue;\n }\n break block30;\n }\n var15_15 = 0;\n if (var6_6 < 0) break block32;\n }\n var7_7 = (byte)(var14_14 << 6);\n var6_6 |= var7_7;\n ** GOTO lbl-1000\n }\n if (var6_6 != var7_7) {\n var5_5.state = var8_8;\n return false;\n }\n break block30;\n }\n var15_15 = 0;\n if (var6_6 >= 0) lbl-1000:\n // 2 sources\n\n {\n ++var10_10;\n var14_14 = var6_6;\n } else if (var6_6 != var7_7) {\n var5_5.state = var8_8;\n return false;\n }\n }\n var6_6 = var19_19;\n var7_7 = 0;\n }\n if (!var4_4) {\n var5_5.state = var10_10;\n var5_5.value = var14_14;\n var5_5.op = var13_13;\n return (boolean)var18_18;\n }\n if (var10_10 == var18_18) break block33;\n if (var10_10 == var17_17) break block34;\n if (var10_10 == var15_15) break block35;\n if (var10_10 != var16_16) break block36;\n var5_5.state = var8_8;\n ** GOTO lbl90\n }\n var6_6 = var13_13 + 1;\n var11_11[var13_13] = var7_7 = (byte)(var14_14 >> 10);\n var13_13 = var6_6 + 1;\n var11_11[var6_6] = var7_7 = (byte)(var14_14 >> 2);\n break block36;\n }\n var6_6 = var13_13 + 1;\n var11_11[var13_13] = var7_7 = (byte)(var14_14 >> 4);\n var13_13 = var6_6;\n }\n var5_5.state = var10_10;\n var5_5.op = var13_13;\n return (boolean)var18_18;\n }\n var5_5.state = var8_8;\n ** while (true)\n }\n}", "private void m1do() {\n for (int i = 0; i < 2; i++) {\n this.my[i] = null;\n }\n for (int i2 = 0; i2 < 2; i2++) {\n this.mz[i2] = 0;\n }\n this.mC = 0.0d;\n this.lf = 0;\n }", "private void method_4318() {\r\n String[] var1;\r\n int var11;\r\n label68: {\r\n var1 = class_752.method_4253();\r\n class_758 var10000 = this;\r\n if(var1 != null) {\r\n if(this.field_3417 != null) {\r\n label71: {\r\n var11 = this.field_3417.field_3012;\r\n if(var1 != null) {\r\n if(this.field_3417.field_3012) {\r\n var10000 = this;\r\n if(var1 != null) {\r\n if(!this.field_2990.field_1832) {\r\n this.method_409(this.field_3404, class_1691.method_9334((class_1036)null), 10.0F);\r\n }\r\n\r\n var10000 = this;\r\n }\r\n\r\n var10000.field_3417 = null;\r\n if(var1 != null) {\r\n break label71;\r\n }\r\n }\r\n\r\n var11 = this.field_3029 % 10;\r\n }\r\n\r\n if(var1 == null) {\r\n break label68;\r\n }\r\n\r\n if(var11 == 0) {\r\n float var13;\r\n var11 = (var13 = this.method_406() - this.method_405()) == 0.0F?0:(var13 < 0.0F?-1:1);\r\n if(var1 == null) {\r\n break label68;\r\n }\r\n\r\n if(var11 < 0) {\r\n this.method_4188(this.method_406() + 1.0F);\r\n }\r\n }\r\n }\r\n }\r\n\r\n var10000 = this;\r\n }\r\n\r\n var11 = var10000.field_3028.nextInt(10);\r\n }\r\n\r\n if(var11 == 0) {\r\n float var2 = 32.0F;\r\n List var3 = this.field_2990.method_2157(class_705.class, this.field_3004.method_7097((double)var2, (double)var2, (double)var2));\r\n class_705 var4 = null;\r\n double var5 = Double.MAX_VALUE;\r\n Iterator var7 = var3.iterator();\r\n\r\n while(true) {\r\n if(var7.hasNext()) {\r\n class_705 var8 = (class_705)var7.next();\r\n double var9 = var8.method_3891(this);\r\n if(var1 == null) {\r\n break;\r\n }\r\n\r\n label43: {\r\n double var12 = var9;\r\n if(var1 != null) {\r\n if(var9 >= var5) {\r\n break label43;\r\n }\r\n\r\n var12 = var9;\r\n }\r\n\r\n var5 = var12;\r\n var4 = var8;\r\n }\r\n\r\n if(var1 != null) {\r\n continue;\r\n }\r\n }\r\n\r\n this.field_3417 = var4;\r\n break;\r\n }\r\n }\r\n\r\n }", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "private static void getStat(){\n\t\tfor(int key : Initial_sequences.keySet()){\n\t\t\tint tmNo = Initial_sequences.get(key);\n\t\t\tif (tmNo > 13){\n\t\t\t\ttmInitLarge ++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(tmInit.containsKey(tmNo)){\n\t\t\t\t\tint temp = tmInit.get(tmNo);\n\t\t\t\t\ttemp++;\n\t\t\t\t\ttmInit.put(tmNo, temp);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttmInit.put(tmNo, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Go through all the proteins in SC\n\t\tfor(int key : SC_sequences.keySet()){\n\t\t\tint tmNo = SC_sequences.get(key);\n\t\t\t\n\t\t\tint loop = Loop_lengths.get(key);\n\t\t\tint tmLen = TM_lengths.get(key);\n\t\t\t\n\t\t\tLoopTotalLen = LoopTotalLen + loop;\n\t\t\tTMTotalLen = TMTotalLen + tmLen;\n\t\t\t\n\t\t\t\n\t\t\tif (tmNo > 13){\n\t\t\t\ttmSCLarge ++;\n\t\t\t\tLoopLargeLen = LoopLargeLen + loop;\n\t\t\t\tTMLargeLen = TMLargeLen + tmLen;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(tmSC.containsKey(tmNo)){\n\t\t\t\t\tint temp = tmSC.get(tmNo);\n\t\t\t\t\ttemp++;\n\t\t\t\t\ttmSC.put(tmNo, temp);\n\t\t\t\t\t\n\t\t\t\t\tint looptemp = Loop_SC.get(tmNo);\n\t\t\t\t\tlooptemp = looptemp + loop;\n\t\t\t\t\tLoop_SC.put(tmNo, looptemp);\n\t\t\t\t\t\n\t\t\t\t\tint tmlenTemp = TM_len_SC.get(tmNo);\n\t\t\t\t\ttmlenTemp = tmlenTemp + tmLen;\n\t\t\t\t\tTM_len_SC.put(tmNo, tmlenTemp);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttmSC.put(tmNo, 1);\n\t\t\t\t\t\n\t\t\t\t\tLoop_SC.put(tmNo, 1);\n\t\t\t\t\tTM_len_SC.put(tmNo, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void postProcessing() {\n // create the element for erode\n Mat erodeElement = Imgproc.getStructuringElement(Imgproc.CV_SHAPE_RECT,\n new Size(2 * KERNELSIZE_ERODE + 1,2 * KERNELSIZE_ERODE + 1 ),\n new Point(KERNELSIZE_ERODE, KERNELSIZE_ERODE));\n // create the element for dialte\n Mat dialElement = Imgproc.getStructuringElement(Imgproc.CV_SHAPE_RECT,\n new Size(2 * KERNELSIZE_DILATE + 1,2 * KERNELSIZE_DILATE + 1 ),\n new Point(KERNELSIZE_DILATE, KERNELSIZE_DILATE));\n\n // erode image to remove small noise\n Imgproc.erode(binary, binary, erodeElement);\n\n // dilate the image DILATETIMES to increase what we see\n for (int i = 0; i < DILATETIMES; i++)\n Imgproc.dilate(binary, binary, dialElement);\n }", "private static java.lang.String[] a(android.content.Context r3, com.xiaomi.xmpush.thrift.u r4) {\n /*\n java.lang.String r0 = r4.h()\n java.lang.String r1 = r4.j()\n java.util.Map r4 = r4.s()\n if (r4 == 0) goto L_0x0073\n android.content.res.Resources r2 = r3.getResources()\n android.util.DisplayMetrics r2 = r2.getDisplayMetrics()\n int r2 = r2.widthPixels\n android.content.res.Resources r3 = r3.getResources()\n android.util.DisplayMetrics r3 = r3.getDisplayMetrics()\n float r3 = r3.density\n float r2 = (float) r2\n float r2 = r2 / r3\n r3 = 1056964608(0x3f000000, float:0.5)\n float r2 = r2 + r3\n java.lang.Float r3 = java.lang.Float.valueOf(r2)\n int r3 = r3.intValue()\n r2 = 320(0x140, float:4.48E-43)\n if (r3 > r2) goto L_0x0051\n java.lang.String r3 = \"title_short\"\n java.lang.Object r3 = r4.get(r3)\n java.lang.String r3 = (java.lang.String) r3\n boolean r2 = android.text.TextUtils.isEmpty(r3)\n if (r2 != 0) goto L_0x0042\n r0 = r3\n L_0x0042:\n java.lang.String r3 = \"description_short\"\n java.lang.Object r3 = r4.get(r3)\n java.lang.String r3 = (java.lang.String) r3\n boolean r4 = android.text.TextUtils.isEmpty(r3)\n if (r4 != 0) goto L_0x0073\n goto L_0x0072\n L_0x0051:\n r2 = 360(0x168, float:5.04E-43)\n if (r3 <= r2) goto L_0x0073\n java.lang.String r3 = \"title_long\"\n java.lang.Object r3 = r4.get(r3)\n java.lang.String r3 = (java.lang.String) r3\n boolean r2 = android.text.TextUtils.isEmpty(r3)\n if (r2 != 0) goto L_0x0064\n r0 = r3\n L_0x0064:\n java.lang.String r3 = \"description_long\"\n java.lang.Object r3 = r4.get(r3)\n java.lang.String r3 = (java.lang.String) r3\n boolean r4 = android.text.TextUtils.isEmpty(r3)\n if (r4 != 0) goto L_0x0073\n L_0x0072:\n r1 = r3\n L_0x0073:\n r3 = 2\n java.lang.String[] r3 = new java.lang.String[r3]\n r4 = 0\n r3[r4] = r0\n r4 = 1\n r3[r4] = r1\n return r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.xiaomi.push.service.ah.a(android.content.Context, com.xiaomi.xmpush.thrift.u):java.lang.String[]\");\n }", "private void c() {\n /*\n r14 = this;\n r12 = android.os.SystemClock.elapsedRealtime();\n r8 = r14.d();\n r0 = r14.t;\n if (r0 == 0) goto L_0x007a;\n L_0x000c:\n r0 = 1;\n r7 = r0;\n L_0x000e:\n r0 = r14.r;\n r0 = r0.a();\n if (r0 != 0) goto L_0x0018;\n L_0x0016:\n if (r7 == 0) goto L_0x007d;\n L_0x0018:\n r0 = 1;\n r10 = r0;\n L_0x001a:\n if (r10 != 0) goto L_0x0095;\n L_0x001c:\n r0 = r14.d;\n r0 = r0.b;\n if (r0 != 0) goto L_0x0028;\n L_0x0022:\n r0 = -1;\n r0 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1));\n if (r0 != 0) goto L_0x0032;\n L_0x0028:\n r0 = r14.p;\n r0 = r12 - r0;\n r2 = 2000; // 0x7d0 float:2.803E-42 double:9.88E-321;\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 <= 0) goto L_0x0095;\n L_0x0032:\n r14.p = r12;\n r0 = r14.d;\n r1 = r14.f;\n r1 = r1.size();\n r0.a = r1;\n r0 = r14.c;\n r1 = r14.f;\n r2 = r14.o;\n r4 = r14.m;\n r6 = r14.d;\n r0.getChunkOperation(r1, r2, r4, r6);\n r0 = r14.d;\n r0 = r0.a;\n r0 = r14.a(r0);\n r1 = r14.d;\n r1 = r1.b;\n if (r1 != 0) goto L_0x0080;\n L_0x0059:\n r4 = -1;\n L_0x005b:\n r0 = r14.b;\n r2 = r14.m;\n r1 = r14;\n r6 = r10;\n r0 = r0.update(r1, r2, r4, r6);\n if (r7 == 0) goto L_0x0087;\n L_0x0067:\n r0 = r14.v;\n r0 = r12 - r0;\n r2 = r14.u;\n r2 = (long) r2;\n r2 = r14.c(r2);\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 < 0) goto L_0x0079;\n L_0x0076:\n r14.e();\n L_0x0079:\n return;\n L_0x007a:\n r0 = 0;\n r7 = r0;\n goto L_0x000e;\n L_0x007d:\n r0 = 0;\n r10 = r0;\n goto L_0x001a;\n L_0x0080:\n if (r0 == 0) goto L_0x0095;\n L_0x0082:\n r4 = r14.d();\n goto L_0x005b;\n L_0x0087:\n r1 = r14.r;\n r1 = r1.a();\n if (r1 != 0) goto L_0x0079;\n L_0x008f:\n if (r0 == 0) goto L_0x0079;\n L_0x0091:\n r14.f();\n goto L_0x0079;\n L_0x0095:\n r4 = r8;\n goto L_0x005b;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.exoplayer.chunk.ChunkSampleSource.c():void\");\n }", "void transform() {\n\t\tint oldline, newline;\n\t\tint oldmax = oldinfo.maxLine + 2; /* Count pseudolines at */\n\t\tint newmax = newinfo.maxLine + 2; /* ..front and rear of file */\n\n\t\tfor (oldline = 0; oldline < oldmax; oldline++)\n\t\t\toldinfo.other[oldline] = -1;\n\t\tfor (newline = 0; newline < newmax; newline++)\n\t\t\tnewinfo.other[newline] = -1;\n\n\t\tscanunique(); /* scan for lines used once in both files */\n\t\tscanafter(); /* scan past sure-matches for non-unique blocks */\n\t\tscanbefore(); /* scan backwards from sure-matches */\n\t\tscanblocks(); /* find the fronts and lengths of blocks */\n\t}", "public void filterImage() {\n\n if (opIndex == lastOp) {\n return;\n }\n\n lastOp = opIndex;\n switch (opIndex) {\n case 0:\n biFiltered = bi; /* original */\n return;\n case 1:\n biFiltered = ImageNegative(bi); /* Image Negative */\n return;\n\n case 2:\n biFiltered = RescaleImage(bi);\n return;\n\n case 3:\n biFiltered = ShiftImage(bi);\n return;\n\n case 4:\n biFiltered = RescaleShiftImage(bi);\n return;\n\n case 5:\n biFiltered = Add(bi, bi1);\n return;\n\n case 6:\n biFiltered = Subtract(bi, bi1);\n return;\n\n case 7:\n biFiltered = Multiply(bi, bi1);\n return;\n\n case 8:\n biFiltered = Divide(bi, bi1);\n return;\n\n case 9:\n biFiltered = NOT(bi);\n return;\n\n case 10:\n biFiltered = AND(bi, bi1);\n return;\n\n case 11:\n biFiltered = OR(bi, bi1);\n return;\n\n case 12:\n biFiltered = XOR(bi, bi1);\n return;\n\n case 13:\n biFiltered = ROI(bi);\n return;\n\n case 14:\n biFiltered = Negative_Linear(bi);\n return;\n\n case 15:\n biFiltered= Logarithmic_function(bi);\n return;\n\n case 16:\n biFiltered = Power_Law(bi);\n return;\n\n case 17:\n biFiltered = LUT(bi);\n return;\n\n case 18:\n biFiltered = Bit_planeSlicing(bi);\n return;\n\n case 19:\n biFiltered = Histogram(bi1,bi2);\n return;\n\n case 20:\n biFiltered = HistogramEqualisation(bi,bi3);\n return;\n\n case 21:\n biFiltered = Averaging(bi1);\n return;\n\n case 22:\n biFiltered = WeightedAveraging(bi1);\n return;\n\n case 23:\n biFiltered = fourNeighbourLaplacian(bi1);\n return;\n\n case 24:\n biFiltered= eightNeighbourLaplacian(bi1);\n return;\n\n case 25:\n biFiltered = fourNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 26:\n biFiltered = eightNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 27:\n biFiltered = Roberts(bi1);\n return;\n\n case 28:\n biFiltered = SobelX(bi1);\n return;\n\n case 29:\n biFiltered = SobelY(bi1);\n return;\n\n case 30:\n biFiltered = Gaussian(bi1);\n return;\n\n case 31:\n biFiltered = LoG (bi1);\n return;\n\n case 32:\n biFiltered = saltnpepper(bi4);\n return;\n\n case 33:\n biFiltered = minFiltering(bi4);\n return;\n\n case 34:\n biFiltered = maxFiltering(bi4);\n return;\n\n case 35:\n biFiltered = maidpointFiltering(bi4);\n return;\n\n case 36:\n biFiltered = medianFiltering(bi4);\n return;\n\n case 37:\n biFiltered = simpleThresholding(bi5);\n return;\n\n case 38:\n biFiltered = automatedThresholding(bi6);\n return;\n\n case 39:\n biFiltered = adaptiveThresholding(bi7);\n return;\n }\n }", "@Override\r\n\tprotected void onReduceMp()\r\n\t{\n\t}", "public static String process() {\n\n\t\tSet<Point> myPoint;\n\t\tSet<Point> oppPoint;\n\t\t\n\t\tint oppenentID = (myID == 0? 1: 0);\n\t\t\n\t\tif (map.containsKey(myID)) {\n\t\t\tmyPoint = map.get(myID);\n\t\t}else\n\t\t{\n\t\t\tmyPoint = new TreeSet<Point>();\n\t\t}\n\t\tif (map.containsKey(oppenentID)) {\n\t\t\toppPoint = map.get(oppenentID);\n\t\t}else\n\t\t{\n\t\t\toppPoint = new TreeSet<Point>();\n\t\t}\n\t\t\n\t\tPoint decdesion = strategy.choosePoint(myPoint, oppPoint, 1000, 1000);\n\t\tmyPoint.add(decdesion);\n\t\tmap.put(myID, myPoint);\n\t\t\n\t\treturn decdesion.x + \" \" + decdesion.y;\n\t\t\n\t}", "private void m18357t() {\n AudioProcessor[] k;\n ArrayList<AudioProcessor> newAudioProcessors = new ArrayList<>();\n for (AudioProcessor audioProcessor : m18348k()) {\n if (audioProcessor.mo25036a()) {\n newAudioProcessors.add(audioProcessor);\n } else {\n audioProcessor.flush();\n }\n }\n int count = newAudioProcessors.size();\n this.f16596P = (AudioProcessor[]) newAudioProcessors.toArray(new AudioProcessor[count]);\n this.f16597Q = new ByteBuffer[count];\n m18347j();\n }", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "void decodeAndAnalyzeData(Intent x)\n {\n if(x.getExtras()==null)\n return;\n N=x.getIntExtra(\"N\",0);\n if(N==0)\n return;\n Names=new String[6];\n for(int i=0;i<N;i++)\n Names[i]=x.getStringExtra(Integer.toString(i));\n int n=x.getIntExtra(\"n\",0);\n if(n==0)\n return;\n Paid=new Double[6];\n Used=new Double[6];\n Balance=new Double[6];\n for(int i=0;i<6;i++)\n {\n Paid[i]=0d;\n Used[i]=0d;\n Balance[i]=0d;\n }\n for(int i=0;i<n;i++)\n {\n double _price = x.getDoubleExtra(\"iP\"+String.format(\"%03d\", i),0);\n if(_price==-0.01)\n _price=0;\n int _users = x.getIntExtra(\"iU\"+String.format(\"%03d\", i),0);\n String _buyer = x.getStringExtra(\"iB\"+String.format(\"%03d\", i));\n String _name = x.getStringExtra(\"iN\"+String.format(\"%03d\", i));\n int uid=findUserId(_buyer);\n if(uid==-1)\n continue;\n Paid[uid]+=_price;\n boolean[] c = new boolean[6];\n for (int j = 0; j < 6; j++)\n c[j] = (_users % Math.pow(2, j + 1)) >= Math.pow(2, j);\n int m=0;\n for(int j=0;j<6;j++)\n if(c[j])\n m++;\n if(m==0)\n {\n m=1;\n c[uid]=true;\n }\n double up=_price/m;\n for(int j=0;j<6;j++)\n if(c[j])\n Used[j]+=up;\n\n }\n for(int j=0;j<6;j++)\n Balance[j]=Paid[j]-Used[j];\n// //Checksum TODO\n }", "private void process() {\n\n Cluster current=_clusters.get(0);\n while (!current.isValid()) {\n KMeans kmeans=new KMeans(K,current);\n for (Cluster cluster : kmeans.getResult())\n if (cluster.getId()!=current.getId())\n _clusters.add(cluster);\n for (; current.isValid() && current.getId()+1<_clusters.size(); current=_clusters.get(current.getId()+1));\n }\n }", "@Override\r\n\tpublic void compute() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void processCost() throws SGSException {\n\r\n\t}" ]
[ "0.5932722", "0.5830406", "0.58236116", "0.57979345", "0.5783375", "0.5644619", "0.5632119", "0.562075", "0.54783463", "0.54061776", "0.53511024", "0.5345127", "0.5329498", "0.5236988", "0.5232481", "0.5224075", "0.52178365", "0.5217408", "0.5217408", "0.5217408", "0.5217408", "0.52018374", "0.51951414", "0.5185027", "0.5179555", "0.5178273", "0.51730007", "0.5151572", "0.51511586", "0.5140537", "0.5138266", "0.51309335", "0.5128714", "0.5119327", "0.51162153", "0.5111655", "0.5104018", "0.5098444", "0.5097305", "0.5091504", "0.5088438", "0.50699335", "0.5064185", "0.50423276", "0.50356454", "0.503537", "0.5026251", "0.5024905", "0.5022903", "0.5016707", "0.5014687", "0.50108755", "0.50081503", "0.50051904", "0.5003896", "0.49988985", "0.49919072", "0.49901316", "0.49884266", "0.49851653", "0.49807853", "0.49754024", "0.4975126", "0.49746057", "0.49720374", "0.4968696", "0.49677175", "0.49670553", "0.4964629", "0.4963028", "0.4960497", "0.49594536", "0.4958418", "0.49559712", "0.495007", "0.4948832", "0.49479666", "0.4942465", "0.49389783", "0.49335268", "0.49332473", "0.49331722", "0.49311295", "0.49289468", "0.49229175", "0.48904964", "0.4884571", "0.48762658", "0.48722968", "0.48684072", "0.48646867", "0.48608312", "0.48597518", "0.48592559", "0.48585248", "0.48564053", "0.4856224", "0.48547164", "0.48511583", "0.48503762", "0.48501" ]
0.0
-1
will be slightly more complex in processing
public void showRules(Application app){ System.out.println("Here are your rules: \n • GPA >= " + app.getStand().getReqGPA() + "\n • SAT >= " + app.getStand().getReqSAT() + "\n • A valid intended major, either aligned towards STEM or Humanities." + "\n • Three valid extracurriculars. \n \t • A valid extracurricular is defined as a productive use of time and/or a standout accomplishment. \n \t • It must align with the student's STEM or Humanities focus. \n \t • All three extracurriculars must be valid. \n • A statement of purpose without spelling errors."); System.out.println(" • Students admitted to Harvard must have a passion for Humanities. Students admitted to MIT must have a passion for STEM. This can be determined through their intended major and extracurriculars, assuming both are valid."); System.out.println(" • All students with errors in their applications should be admitted to Greendale Community College."); System.out.println(); System.out.println("Good luck!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\r\n private void findAbdomenVOI() {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 39; angle < 45; angle += 3) {\r\n int x, y, yOffset;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n scaleFactor = Math.tan(angleRad);\r\n x = xDim;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x > xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x--;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n x = xcm;\r\n y = 0;\r\n yOffset = y * xDim;\r\n while (y < ycm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n y++;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n x = 0;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x < xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x++;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 225 && angle <= 315) {\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n x = xcm;\r\n y = yDim;\r\n yOffset = y * xDim;\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n y--;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n }\r\n } // end for (angle = 0; ...\r\n \r\n int[] x1 = new int[xValsAbdomenVOI.size()];\r\n int[] y1 = new int[xValsAbdomenVOI.size()];\r\n int[] z1 = new int[xValsAbdomenVOI.size()];\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n x1[idx] = xValsAbdomenVOI.get(idx);\r\n y1[idx] = xValsAbdomenVOI.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n\r\n\r\n }", "private static void m148172a(EditPreviewInfo editPreviewInfo, String[] strArr, long[] jArr, long[] jArr2, float[] fArr, long[] jArr3) {\n for (int i = 0; i < editPreviewInfo.getVideoList().size(); i++) {\n EditVideoSegment editVideoSegment = (EditVideoSegment) editPreviewInfo.getVideoList().get(i);\n strArr[i] = editVideoSegment.getVideoPath();\n if (editVideoSegment.getVideoCutInfo() != null) {\n VideoCutInfo videoCutInfo = editVideoSegment.getVideoCutInfo();\n jArr[i] = videoCutInfo.getStart();\n jArr2[i] = videoCutInfo.getEnd();\n fArr[i] = videoCutInfo.getSpeed();\n } else {\n jArr[i] = -1;\n jArr2[i] = -1;\n fArr[i] = 1.0f;\n }\n }\n if (editPreviewInfo.getSceneIn() > 0 || editPreviewInfo.getSceneOut() > 0) {\n jArr3[0] = editPreviewInfo.getSceneIn();\n jArr3[1] = editPreviewInfo.getSceneOut();\n return;\n }\n jArr3[0] = -1;\n jArr3[1] = -1;\n }", "String processing();", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}", "private static byte[] m17790a(Bitmap bitmap) {\n int i;\n int i2;\n int i3;\n int width = bitmap.getWidth();\n int height = bitmap.getHeight();\n OutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n for (i = 0; i < 32; i++) {\n byteArrayOutputStream.write(0);\n }\n int[] iArr = new int[(width - 2)];\n bitmap.getPixels(iArr, 0, width, 1, 0, width - 2, 1);\n Object obj = iArr[0] == -16777216 ? 1 : null;\n Object obj2 = iArr[iArr.length + -1] == -16777216 ? 1 : null;\n int length = iArr.length;\n width = 0;\n int i4 = 0;\n for (i2 = 0; i2 < length; i2++) {\n if (width != iArr[i2]) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, i2);\n width = iArr[i2];\n }\n }\n if (obj2 != null) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, length);\n }\n int i5 = i4;\n int i6 = i5 + 1;\n if (obj != null) {\n i = i6 - 1;\n } else {\n i = i6;\n }\n if (obj2 != null) {\n i3 = i - 1;\n } else {\n i3 = i;\n }\n iArr = new int[(height - 2)];\n bitmap.getPixels(iArr, 0, 1, 0, 1, 1, height - 2);\n obj = iArr[0] == -16777216 ? 1 : null;\n obj2 = iArr[iArr.length + -1] == -16777216 ? 1 : null;\n length = iArr.length;\n width = 0;\n i4 = 0;\n for (i2 = 0; i2 < length; i2++) {\n if (width != iArr[i2]) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, i2);\n width = iArr[i2];\n }\n }\n if (obj2 != null) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, length);\n }\n i6 = i4 + 1;\n if (obj != null) {\n i = i6 - 1;\n } else {\n i = i6;\n }\n if (obj2 != null) {\n i--;\n }\n for (i6 = 0; i6 < i3 * i; i6++) {\n C5225r.m17788a(byteArrayOutputStream, 1);\n }\n byte[] toByteArray = byteArrayOutputStream.toByteArray();\n toByteArray[0] = (byte) 1;\n toByteArray[1] = (byte) i5;\n toByteArray[2] = (byte) i4;\n toByteArray[3] = (byte) (i * i3);\n C5225r.m17787a(bitmap, toByteArray);\n return toByteArray;\n }", "public static void main(String[] args) {\n DGIM[] dgim = new DGIM[5];\n //从0到4分别代表2^4到2^0的位\n for (int i = 0; i < 5; i++) {\n dgim[i] = new DGIM(1000);\n }\n try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(\"cmsc5741_stream_data2.txt\")));) {\n while (true) {\n boolean isEnd = false;\n StringBuilder builder = new StringBuilder();\n int c1 = reader.read();\n builder.append((char) c1);\n while (true) {\n int c2 = reader.read();\n if ((char) c2 == ' ') {\n break;\n }\n if (c2 == -1) {\n isEnd = true;\n break;\n }\n builder.append((char) c2);\n }\n if (isEnd) {\n break;\n }\n char[] binary = Integer.toBinaryString(Integer.parseInt(builder.toString())).toCharArray();\n //寻找开始的位\n int start = 5 - binary.length;\n DGIM.number++;\n for (int i = 0; i < binary.length; i++) {\n if (binary[i] == '1') {\n dgim[start].add();\n }\n start++;\n }\n }\n Iterator<Bucket> iterator_16 = dgim[0].getQueue().iterator();\n Iterator<Bucket> iterator_8 = dgim[1].getQueue().iterator();\n Iterator<Bucket> iterator_4 = dgim[2].getQueue().iterator();\n Iterator<Bucket> iterator_2 = dgim[3].getQueue().iterator();\n Iterator<Bucket> iterator_1 = dgim[4].getQueue().iterator();\n\n\n while(iterator_16.hasNext()){\n System.out.println(\"Buckets for 16 :\"+iterator_16.next());\n }\n System.out.println(\"There are \"+dgim[0].getContent()+\" count of 16\");\n while(iterator_8.hasNext()){\n System.out.println(\"Buckets for 8 :\"+iterator_8.next());\n }\n System.out.println(\"There are \"+dgim[1].getContent()+\" count of 8\");\n while(iterator_4.hasNext()){\n System.out.println(\"Buckets for 4 :\"+iterator_4.next());\n }\n System.out.println(\"There are \"+dgim[2].getContent()+\" count of 4\");\n while(iterator_2.hasNext()){\n System.out.println(\"Buckets for 2 :\"+iterator_2.next());\n }\n System.out.println(\"There are \"+dgim[3].getContent()+\" count 2\");\n\n while(iterator_1.hasNext()){\n System.out.println(\"Buckets for 1 :\"+iterator_1.next());\n }\n System.out.println(\"There are \"+dgim[4].getContent()+\" times 1\");\n\n int result = (dgim[0].getContent()*16 + dgim[1].getContent()*8\n + dgim[2].getContent()*4 + dgim[3].getContent()*2 + dgim[4].getContent())/1000;\n System.out.println(\"The average price: \"+result);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "private ArrayList<Point> extractCC(Point r, Image img)\r\n/* 55: */ {\r\n/* 56: 58 */ this.s.clear();\r\n/* 57: 59 */ this.s.add(r);\r\n/* 58: 60 */ this.temp.setXYBoolean(r.x, r.y, true);\r\n/* 59: 61 */ this.list2.add(r);\r\n/* 60: */ \r\n/* 61: 63 */ Point[] N = { new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1), \r\n/* 62: 64 */ new Point(1, 1), new Point(-1, -1), new Point(-1, 1), new Point(1, -1) };\r\n/* 63: */ \r\n/* 64: 66 */ ArrayList<Point> pixels = new ArrayList();\r\n/* 65: */ int x;\r\n/* 66: */ int i;\r\n/* 67: 68 */ for (; !this.s.isEmpty(); i < N.length)\r\n/* 68: */ {\r\n/* 69: 70 */ Point tmp = (Point)this.s.pop();\r\n/* 70: */ \r\n/* 71: 72 */ x = tmp.x;\r\n/* 72: 73 */ int y = tmp.y;\r\n/* 73: 74 */ pixels.add(tmp);\r\n/* 74: */ \r\n/* 75: 76 */ this.temp2.setXYBoolean(x, y, true);\r\n/* 76: */ \r\n/* 77: 78 */ i = 0; continue;\r\n/* 78: 79 */ int _x = x + N[i].x;\r\n/* 79: 80 */ int _y = y + N[i].y;\r\n/* 80: 82 */ if ((_x >= 0) && (_x < this.xdim) && (_y >= 0) && (_y < this.ydim)) {\r\n/* 81: 84 */ if (!this.temp.getXYBoolean(_x, _y))\r\n/* 82: */ {\r\n/* 83: 86 */ boolean q = img.getXYBoolean(_x, _y);\r\n/* 84: 88 */ if (q)\r\n/* 85: */ {\r\n/* 86: 90 */ Point t = new Point(_x, _y);\r\n/* 87: 91 */ this.s.add(t);\r\n/* 88: */ \r\n/* 89: 93 */ this.temp.setXYBoolean(t.x, t.y, true);\r\n/* 90: 94 */ this.list2.add(t);\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94: 78 */ i++;\r\n/* 95: */ }\r\n/* 96: 99 */ for (Point t : this.list2) {\r\n/* 97:100 */ this.temp.setXYBoolean(t.x, t.y, false);\r\n/* 98: */ }\r\n/* 99:101 */ this.list2.clear();\r\n/* 100: */ \r\n/* 101:103 */ return pixels;\r\n/* 102: */ }", "public static void main(String[] args) throws IOException {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(UFTest.class.getResource(\"/\").getPath()+\"1.5/largeUF.txt\"));\n String str = bufferedReader.readLine();\n UFLJWQU uf = new UFLJWQU(Integer.parseInt(str));\n long beginTime =System.currentTimeMillis();\n while ((str = bufferedReader.readLine())!=null){\n String[] array = str.split(\" \");\n int p = Integer.parseInt(array[0]);\n int q = Integer.parseInt(array[1]);\n if(uf.connected(p,q)) continue;\n uf.union(p,q);\n// System.out.println(p+\" -- \"+q);\n }\n System.out.println(uf.count());\n System.out.println(\"cost time :\"+(System.currentTimeMillis() - beginTime));\n }", "private int readObjectDataValues(final PdfObject pdfObject, int i, final byte[] raw, final int length) {\n \n int level=0;\n //allow for no << at start\n if(isInlineImage) {\n level = 1;\n }\n \n while(true){\n \n if(i<length && raw[i]==37) //allow for comment and ignore\n {\n i = stripComment(length, i, raw);\n }\n \n /**\n * exit conditions\n */\n if ((i>=length ||\n (endPt !=-1 && i>= endPt))||\n (raw[i] == 101 && raw[i + 1] == 110 && raw[i + 2] == 100 && raw[i + 3] == 111)||\n (raw[i]=='s' && raw[i+1]=='t' && raw[i+2]=='r' && raw[i+3]=='e' && raw[i+4]=='a' && raw[i+5]=='m')) {\n break;\n }\n \n /**\n * process value\n */\n if(raw[i]==60 && raw[i+1]==60){\n i++;\n level++;\n }else if(raw[i]==62 && i+1!=length && raw[i+1]==62 && raw[i-1]!=62){\n i++;\n level--;\n \n if(level==0) {\n break;\n }\n }else if (raw[i] == 47 && (raw[i+1] == 47 || raw[i+1]==32)) { //allow for oddity of //DeviceGray and / /DeviceGray in colorspace\n i++;\n }else if (raw[i] == 47) { //everything from /\n \n i++; //skip /\n \n final int keyStart=i;\n final int keyLength= Dictionary.findDictionaryEnd(i, raw, length);\n i += keyLength;\n \n if(i==length) {\n break;\n }\n \n //if BDC see if string\n boolean isStringPair=false;\n if(pdfObject.getID()== PdfDictionary.BDC) {\n isStringPair = Dictionary.isStringPair(i, raw, isStringPair);\n }\n \n final int type=pdfObject.getObjectType();\n \n if(debugFastCode) {\n System.out.println(\"type=\" + type + ' ' + ' ' + pdfObject.getID() + \" chars=\" + (char) raw[i - 1] + (char) raw[i] + (char) raw[i + 1] + ' ' + pdfObject + \" i=\" + i + ' ' + isStringPair);\n }\n \n //see if map of objects\n final boolean isMap = isMapObject(pdfObject, i, raw, length, keyStart, keyLength, isStringPair, type);\n \n if(raw[i]==47 || raw[i]==40 || (raw[i] == 91 && raw[i+1]!=']')) //move back cursor\n {\n i--;\n }\n \n //check for unknown value and ignore\n if(pdfKeyType==-1) {\n i = ObjectUtils.handleUnknownType(i, raw, length);\n }\n \n /**\n * now read value\n */\n if(PDFkeyInt==-1 || pdfKeyType==-1){\n if(debugFastCode) {\n System.out.println(padding + pdfObject.getObjectRefAsString() + \" =================Not implemented=\" + PDFkey + \" pdfKeyType=\" + pdfKeyType);\n }\n }else{\n i = setValue(pdfObject, i, raw, length, isMap);\n }\n \n //special case if Dest defined as names object and indirect\n }else if(raw[i]=='[' && level==0 && pdfObject.getObjectType()==PdfDictionary.Outlines){\n \n final Array objDecoder=new Array(objectReader,i, raw.length, PdfDictionary.VALUE_IS_MIXED_ARRAY,null, PdfDictionary.Names);\n objDecoder.readArray(false, raw, pdfObject, PdfDictionary.Dest);\n \n }\n \n i++;\n \n }\n \n return i;\n }", "private void processData() {\n\t\tfloat S, M, VPR, VM;\n\t\tgetCal();\n\t\tgetTimestamps();\n\t\t\n \n\t\tfor(int i = 0; i < r.length; i++) {\n\t\t\t//get lux\n\t\t\tlux[i] = RGBcal[0]*vlam[0]*r[i] + RGBcal[1]*vlam[1]*g[i] + RGBcal[2]*vlam[2]*b[i];\n \n\t\t\t//get CLA\n\t\t\tS = RGBcal[0]*smac[0]*r[i] + RGBcal[1]*smac[1]*g[i] + RGBcal[2]*smac[2]*b[i];\n\t\t\tM = RGBcal[0]*mel[0]*r[i] + RGBcal[1]*mel[1]*g[i] + RGBcal[2]*mel[2]*b[i];\n\t\t\tVPR = RGBcal[0]*vp[0]*r[i] + RGBcal[1]*vp[1]*g[i] + RGBcal[2]*vp[2]*b[i];\n\t\t\tVM = RGBcal[0]*vmac[0]*r[i] + RGBcal[1]*vmac[1]*g[i] + RGBcal[2]*vmac[2]*b[i];\n \n\t\t\tif(S > CLAcal[2]*VM) {\n\t\t\t\tCLA[i] = M + CLAcal[0]*(S - CLAcal[2]*VM) - CLAcal[1]*683*(1 - pow((float)2.71, (float)(-VPR/4439.5)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCLA[i] = M;\n\t\t\t}\n\t\t\tCLA[i] = CLA[i]*CLAcal[3];\n\t\t\tif(CLA[i] < 0) {\n\t\t\t\tCLA[i] = 0;\n\t\t\t}\n \n\t\t\t//get CS\n\t\t\tCS[i] = (float) (.7*(1 - (1/(1 + pow((float)(CLA[i]/355.7), (float)1.1026)))));\n \n\t\t\t//get activity\n\t\t\ta[i] = (float) (pow(a[i], (float).5) * .0039 * 4);\n\t\t}\n\t}", "public static void main(String[] args) {\n float[] fb=new float[9];\n fb[0]=(int)12;\n fb[1]=(byte)13;\n fb[2]=(short)8;\n fb[3]=12.021f;\n // fb[4]=23443.43d;\n// fb[4]='a';\n// for(int i=0;i<=4;i++) {\n// \t System.out.println(fb[i]);\n// }\n List<Integer> lis1=new ArrayList<>();\n List<Integer> lis2=new ArrayList<>();\n lis1.add(2);\n lis1.add(4);\n lis1.add(16);\n lis1.add(32);\n lis1.add(96);\n lis1.add(123);\n lis1.add(435);\n lis1.add(234);\n lis1.add(100);\n lis1.add(122);\n lis1.add(240);\n lis1.add(350);\n java.util.Iterator<Integer> itr= lis1.iterator();\n //while(itr.hasNext()) {\n // itr.remove();\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n \t System.out.println(itr.next());\n\n \t System.out.println(lis1);\n // \n// long startTime = System.currentTimeMillis();\n// getTotalX(lis1,lis2);\n// System.out.println(\"Time taken by 2 * o(n^2) \" + (System.currentTimeMillis() - startTime) + \"ms\"); \n// \n \t\t \n\t}", "protected java.util.List x (java.lang.String r19){\n /*\n r18 = this;\n r0 = r18;\n r2 = r0.K;\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\n r2 = (java.util.List) r2;\n if (r2 == 0) goto L_0x000f;\n L_0x000e:\n return r2;\n L_0x000f:\n r12 = java.util.Collections.emptyList();\n r2 = r18.bp();\n r3 = r18.TaskHandler(r19);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r4 = r2.setDrawable(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n if (r4 != 0) goto L_0x0026;\n L_0x0021:\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0026:\n r13 = r2.getScaledMaximumFlingVelocity(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r14 = new java.io.ByteArrayOutputStream;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r2 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;\n r14.<creatCallTask>(r2);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13, r14);\t Catch:{ all -> 0x00f2 }\n r2 = r14.toByteArray();\t Catch:{ all -> 0x00f2 }\n r2 = com.duokan.kernel.DkUtils.decodeSimpleDrm(r2);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r4 = \"UTF-8\";\n r3.<creatCallTask>(r2, r4);\t Catch:{ all -> 0x00f2 }\n r2 = new org.json.JSONObject;\t Catch:{ all -> 0x00f2 }\n r2.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n if (r2 != 0) goto L_0x0055;\n L_0x004a:\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0055:\n r3 = \"pictures\";\n r15 = com.duokan.reader.common.getPhysicalYPixels.setDrawable(r2, r3);\t Catch:{ all -> 0x00f2 }\n r16 = new java.util.ArrayList;\t Catch:{ all -> 0x00f2 }\n r2 = r15.length();\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.<creatCallTask>(r2);\t Catch:{ all -> 0x00f2 }\n r2 = 0;\n L_0x0067:\n r3 = r15.length();\t Catch:{ all -> 0x00f2 }\n if (r2 >= r3) goto L_0x00d0;\n L_0x006d:\n r3 = r15.getJSONObject(r2);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_md5\";\n r7 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_url\";\n r6 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_size\";\n r8 = r3.getLong(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"width\";\n r10 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"height\";\n r11 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r4 = \".\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r2);\t Catch:{ all -> 0x00f2 }\n r4 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r17 = \"file:///stuffs/\";\n r0 = r17;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r7);\t Catch:{ all -> 0x00f2 }\n r3 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n r3 = r18;\n r3 = r3.setDrawable(r4, r5, r6, r7, r8, r10, r11);\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.add(r3);\t Catch:{ all -> 0x00f2 }\n r2 = r2 + 1;\n goto L_0x0067;\n L_0x00d0:\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r1 = r16;\n r2.putIfAbsent(r0, r1);\t Catch:{ all -> 0x00f2 }\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\t Catch:{ all -> 0x00f2 }\n r2 = (java.util.List) r2;\t Catch:{ all -> 0x00f2 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n r18.bq();\n goto L_0x000e;\n L_0x00f2:\n r2 = move-exception;\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n throw r2;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n L_0x00fa:\n r2 = move-exception;\n r2 = r12;\n L_0x00fc:\n r18.bq();\n goto L_0x000e;\n L_0x0101:\n r2 = move-exception;\n r18.bq();\n throw r2;\n L_0x0106:\n r3 = move-exception;\n goto L_0x00fc;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.duokan.reader.domain.bookshelf.jv.MyContextWrapper(java.lang.String):java.util.List\");\n }", "public static void processData() {\n\t\tString dirName = \"C:\\\\research_data\\\\mouse_human\\\\homo_b47_data\\\\\";\r\n\t//\tString GNF1H_fName = \"GNF1H_genes_chopped\";\r\n\t//\tString GNF1M_fName = \"GNF1M_genes_chopped\";\r\n\t\tString GNF1H_fName = \"GNF1H\";\r\n\t\tString GNF1M_fName = \"GNF1M\";\r\n\t\tString mergedValues_fName = \"GNF1_merged_expression.txt\";\r\n\t\tString mergedPMA_fName = \"GNF1_merged_PMA.txt\";\r\n\t\tString discretizedMI_fName = \"GNF1_discretized_MI.txt\";\r\n\t\tString discretizedLevels_fName = \"GNF1_discretized_levels.txt\";\r\n\t\tString discretizedData_fName = \"GNF1_discretized_data.txt\";\r\n\t\t\r\n\t\tboolean useMotifs = false;\r\n\t\tMicroArrayData humanMotifs = null;\r\n\t\tMicroArrayData mouseMotifs = null;\r\n\t\t\r\n\t\tMicroArrayData GNF1H_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1H_PMA = new MicroArrayData();\r\n\t\tGNF1H_PMA.setDiscrete();\r\n\t\tMicroArrayData GNF1M_value = new MicroArrayData();\r\n\t\tMicroArrayData GNF1M_PMA = new MicroArrayData();\r\n\t\tGNF1M_PMA.setDiscrete();\r\n\t\t\r\n\t\ttry {\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma\"); */\r\n\t\t/*\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.txt.homob44\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.txt.homob44\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.txt.homob44\"); */\r\n\t\t\tGNF1H_value.readFile(dirName+GNF1H_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1H_PMA.readFile(dirName+GNF1H_fName+\".pma.sn.txt\");\r\n\t\t\tGNF1M_value.readFile(dirName+GNF1M_fName+\".gcrma.snco.txt\");\r\n\t\t\tGNF1M_PMA.readFile(dirName+GNF1M_fName+\".pma.sn.txt\");\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\tif (useMotifs) {\r\n\t\t\thumanMotifs = new MicroArrayData();\r\n\t\t\tmouseMotifs = new MicroArrayData();\r\n\t\t\tloadMotifs(humanMotifs,GNF1H_value.geneNames,mouseMotifs,GNF1M_value.geneNames);\r\n\t\t}\r\n\t\t\r\n\t\t// combine replicates in PMA values\r\n\t\tint[][] H_PMA = new int[GNF1H_PMA.numRows][GNF1H_PMA.numCols/2];\r\n\t\tint[][] M_PMA = new int[GNF1M_PMA.numRows][GNF1M_PMA.numCols/2];\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tint j = 0;\r\n\t\tint k = 0;\r\n\t\tint v = 0;\r\n\t\tk = 0;\r\n\t\tj = 0;\r\n\t\twhile (j<GNF1H_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<H_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1H_PMA.dvalues[i][j] > 0 & GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0 | GNF1H_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tH_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tj = 0;\r\n\t\tk = 0;\r\n\t\twhile (j<GNF1M_PMA.numCols-1) {\r\n\t\t\tfor (i=0;i<M_PMA.length;i++) {\r\n\t\t\t\tv = 0;\r\n\t\t\t//\tif (GNF1M_PMA.dvalues[i][j] > 0 & GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0 | GNF1M_PMA.dvalues[i][j+1] > 0) {\r\n\t\t\t\t\tv = 1;\r\n\t\t\t\t}\r\n\t\t\t\tM_PMA[i][k] = v;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t\tj = j + 2;\r\n\t\t}\r\n\t\t\r\n\t\tint numMatched = 31;\r\n\t\t\r\n\t/*\tGNF1H_value.numCols = numMatched;\r\n\t\tGNF1M_value.numCols = numMatched; */\r\n\t\t\r\n\t\tint[][] matchPairs = new int[numMatched][2];\r\n\t\tfor(i=0;i<numMatched;i++) {\r\n\t\t\tmatchPairs[i][0] = i;\r\n\t\t\tmatchPairs[i][1] = i + GNF1H_value.numCols;\r\n\t\t}\r\n\t\t\r\n\t//\tDiscretizeAffyData H_discretizer = new DiscretizeAffyData(GNF1H_value.values,H_PMA,0);\r\n\t//\tH_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1H_value.values,H_PMA,GNF1H_value.numCols);\r\n\t\t\r\n\t//\tDiscretizeAffyData M_discretizer = new DiscretizeAffyData(GNF1M_value.values,M_PMA,0);\r\n\t//\tM_discretizer.adjustIntensities();\r\n\t\ttransformRelativeAbundance(GNF1M_value.values,M_PMA,GNF1M_value.numCols);\r\n\t\t\r\n\t\tdouble[][] mergedExpression = new double[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[][] mergedPMA = new int[GNF1H_value.numRows][GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\tint[] species = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tspecies = new int[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1H_value.values[i],0,mergedExpression[i],0,GNF1H_value.numCols);\r\n\t\t\tSystem.arraycopy(H_PMA[i],0,mergedPMA[i],0,GNF1H_value.numCols);\t\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tSystem.arraycopy(GNF1M_value.values[i],0,mergedExpression[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t\tSystem.arraycopy(M_PMA[i],0,mergedPMA[i],GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\t}\r\n\t\t\r\n\t\t// concatenate experiment and gene names\r\n\t\tfor (i=0;i<GNF1H_value.numCols;i++) {\r\n\t\t\tGNF1H_value.experimentNames[i] = \"h_\" + GNF1H_value.experimentNames[i];\r\n\t\t\tspecies[i] = 1;\r\n\t\t}\r\n\t\tfor (i=0;i<GNF1M_value.numCols;i++) {\r\n\t\t\tGNF1M_value.experimentNames[i] = \"m_\" + GNF1M_value.experimentNames[i];\r\n\t\t\tspecies[i+GNF1H_value.numCols] = 2;\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedExperimentNames = null;\r\n\t\tif (!useMotifs) {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols];\r\n\t\t} else {\r\n\t\t\tmergedExperimentNames = new String[GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t}\r\n\t\tSystem.arraycopy(GNF1H_value.experimentNames,0,mergedExperimentNames,0,GNF1H_value.numCols);\r\n\t\tSystem.arraycopy(GNF1M_value.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols,GNF1M_value.numCols);\r\n\t\tif (useMotifs) {\r\n\t\t\tSystem.arraycopy(humanMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols,humanMotifs.numCols);\r\n\t\t\tSystem.arraycopy(mouseMotifs.experimentNames,0,mergedExperimentNames,GNF1H_value.numCols+GNF1M_value.numCols+humanMotifs.numCols,mouseMotifs.numCols);\r\n\t\t\tfor (i=0;i<humanMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols] = 3;\r\n\t\t\t}\r\n\t\t\tfor (i=0;i<mouseMotifs.numCols;i++) {\r\n\t\t\t\tspecies[i + GNF1H_value.numCols+GNF1M_value.numCols + humanMotifs.numCols] = 4;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString[] mergedGeneNames = new String[GNF1H_value.numRows];\r\n\t\tfor (i=0;i<GNF1M_value.numRows;i++) {\r\n\t\t\tmergedGeneNames[i] = GNF1H_value.geneNames[i] + \"|\" + GNF1M_value.geneNames[i];\r\n\t\t}\r\n\t\t\r\n\t\tint[] filterList = new int[GNF1M_value.numRows];\r\n\t\tint numFiltered = 0;\r\n\t\tdouble maxExpressedPercent = 1.25;\r\n\t\tint maxExpressed_H = (int) Math.floor(maxExpressedPercent*((double) GNF1H_value.numCols));\r\n\t\tint maxExpressed_M = (int) Math.floor(maxExpressedPercent*((double) GNF1M_value.numCols));\r\n\t\tint numExpressed_H = 0;\r\n\t\tint numExpressed_M = 0;\r\n\t\t\r\n\t\tfor (i=0;i<GNF1H_value.numRows;i++) {\r\n\t\t\tnumExpressed_H = 0;\r\n\t\t\tfor (j=0;j<GNF1H_value.numCols;j++) {\r\n\t\t\t\tif (GNF1H_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1H_value.values[i][j])) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t\t\tnumExpressed_H++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tnumExpressed_M = 0;\r\n\t\t\tfor (j=0;j<GNF1M_value.numCols;j++) {\r\n\t\t\t\tif (GNF1M_PMA.dvalues[i][j] > 0) {\r\n\t\t\t//\tif (GNF1H_value.values[i][j] > 1.5) {\r\n\t\t\t//\tif (!Double.isNaN(GNF1M_value.values[i][j])) {\r\n\t\t\t\t\tnumExpressed_M++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (numExpressed_M >= maxExpressed_M | numExpressed_H >= maxExpressed_H) {\r\n\t\t\t\tfilterList[i] = 1;\r\n\t\t\t\tnumFiltered++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tGNF1H_value = null;\r\n\t\tGNF1H_PMA = null;\r\n\t\tGNF1M_value = null;\r\n\t\tGNF1M_PMA = null;\r\n\t\t\r\n\t\tdouble[][] mergedExpression2 = null;\r\n\t\tif (numFiltered > 0) {\r\n\t\t\tk = 0;\r\n\t\t\tint[][] mergedPMA2 = new int[mergedPMA.length-numFiltered][mergedPMA[0].length];\r\n\t\t\tif (!useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length];\r\n\t\t\t} else {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length-numFiltered][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t}\r\n\t\t\tString[] mergedGeneNames2 = new String[mergedGeneNames.length-numFiltered];\r\n\t\t\tfor (i=0;i<filterList.length;i++) {\r\n\t\t\t\tif (filterList[i] == 0) {\r\n\t\t\t\t\tmergedPMA2[k] = mergedPMA[i];\r\n\t\t\t\t\tif (!useMotifs) {\r\n\t\t\t\t\t\tmergedExpression2[k] = mergedExpression[i];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[k],0,mergedExpression[i].length);\r\n\t\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[k],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[k],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmergedGeneNames2[k] = mergedGeneNames[i];\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmergedPMA = mergedPMA2;\r\n\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\tmergedGeneNames = mergedGeneNames2;\r\n\t\t} else {\r\n\t\t\tif (useMotifs) {\r\n\t\t\t\tmergedExpression2 = new double[mergedExpression.length][mergedExpression[0].length + humanMotifs.numCols + mouseMotifs.numCols];\r\n\t\t\t\tfor (i=0;i<mergedExpression.length;i++) {\r\n\t\t\t\t\tSystem.arraycopy(mergedExpression[i],0,mergedExpression2[i],0,mergedExpression[i].length);\r\n\t\t\t\t\tSystem.arraycopy(humanMotifs.values[i],0,mergedExpression2[i],mergedExpression[i].length,humanMotifs.numCols);\r\n\t\t\t\t\tSystem.arraycopy(mouseMotifs.values[i],0,mergedExpression2[i],humanMotifs.numCols+mergedExpression[i].length,mouseMotifs.numCols);\r\n\t\t\t\t}\r\n\t\t\t\tmergedExpression = mergedExpression2;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tDiscretizeAffyPairedData discretizer = new DiscretizeAffyPairedData(mergedExpression,mergedPMA,matchPairs,20);\r\n\t\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = discretizer.expression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = discretizer.numExperiments;\r\n\t\tmergedData.numRows = discretizer.numGenes;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tdiscretizer.discretizeDownTree(dirName+discretizedMI_fName);\r\n\t\t\tdiscretizer.mergeDownLevels(3,dirName+discretizedLevels_fName);\r\n\t\t\tdiscretizer.transposeDExpression();\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t\tmergedData.dvalues = discretizer.dExpression;\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t/*\tMicroArrayData mergedData = new MicroArrayData();\r\n\t\tmergedData.values = mergedExpression;\r\n\t\tmergedData.geneNames = mergedGeneNames;\r\n\t\tmergedData.experimentNames = mergedExperimentNames;\r\n\t\tmergedData.experimentCode = species;\r\n\t\tmergedData.numCols = mergedExpression[0].length;\r\n\t\tmergedData.numRows = mergedExpression.length;\r\n\t\ttry {\r\n\t\t\tmergedData.writeFile(dirName+mergedValues_fName);\r\n\t\t\tmergedData.setDiscrete();\r\n\t\t\tmergedData.values = null;\r\n\t\t//\tmergedData.dvalues = simpleDiscretization(mergedExpression,mergedPMA);\r\n\t\t\tmergedData.dvalues = simpleDiscretization2(mergedExpression,species);\r\n\t\t\tmergedData.writeFile(dirName+discretizedData_fName);\r\n\t\r\n\t\t\tmergedData.dvalues = mergedPMA;\r\n\t\t\tmergedData.numCols = mergedPMA[0].length;\r\n\t\t\tmergedData.writeFile(dirName+mergedPMA_fName);\r\n\t\t} catch(IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t} */\r\n\t\t\r\n\t}", "public void copiedMeasureDecoder(Integer chordNote,Integer[]previousChord, Integer[] playedChord){\n /* int c=0;\n int a=0;\n int b=0;\n int x0=0;\n int x1=0;*/\n int d1=0;\n int d2=0;\n\n\n\n for (int i=0;i<melodyNotes.length;i++){\n if(melodyNotes[i]==chordNote)\n d1=i;\n }\n for (int i=0;i<melodyNotes.length;i++){\n if(melodyNotes[i]==melody.get(melodyCounter))\n d2=i;\n /* if(melodyNotes[i]==playedChord[1])\n a=i;\n if(melodyNotes[i]==previousChord[1])\n b=i;*/\n }\n /*if(a<b){\n x0=a-b;\n x1=7+x1;\n }else{\n x0=a-b;\n x1=x0-7;\n }*/\n if(d1>d2) {\n binaryOutput += \"0\";\n }else {\n binaryOutput += \"1\";\n }\n for(int i = 0;i<4;i++){\n for(int j =0; j < rhytm.get(beatCounter).length;j++){\n if(rhytm.get(beatCounter)[j]!=null)\n if ((!rhytm.get(beatCounter)[j].equals(\"Ri\")) && (!rhytm.get(beatCounter)[j].equals(\"Rs\"))) {\n melodyCounter++;\n }\n }\n beatCounter++;\n }\n\n\n}", "private static java.lang.String[] a(android.content.Context r3, com.xiaomi.xmpush.thrift.u r4) {\n /*\n java.lang.String r0 = r4.h()\n java.lang.String r1 = r4.j()\n java.util.Map r4 = r4.s()\n if (r4 == 0) goto L_0x0073\n android.content.res.Resources r2 = r3.getResources()\n android.util.DisplayMetrics r2 = r2.getDisplayMetrics()\n int r2 = r2.widthPixels\n android.content.res.Resources r3 = r3.getResources()\n android.util.DisplayMetrics r3 = r3.getDisplayMetrics()\n float r3 = r3.density\n float r2 = (float) r2\n float r2 = r2 / r3\n r3 = 1056964608(0x3f000000, float:0.5)\n float r2 = r2 + r3\n java.lang.Float r3 = java.lang.Float.valueOf(r2)\n int r3 = r3.intValue()\n r2 = 320(0x140, float:4.48E-43)\n if (r3 > r2) goto L_0x0051\n java.lang.String r3 = \"title_short\"\n java.lang.Object r3 = r4.get(r3)\n java.lang.String r3 = (java.lang.String) r3\n boolean r2 = android.text.TextUtils.isEmpty(r3)\n if (r2 != 0) goto L_0x0042\n r0 = r3\n L_0x0042:\n java.lang.String r3 = \"description_short\"\n java.lang.Object r3 = r4.get(r3)\n java.lang.String r3 = (java.lang.String) r3\n boolean r4 = android.text.TextUtils.isEmpty(r3)\n if (r4 != 0) goto L_0x0073\n goto L_0x0072\n L_0x0051:\n r2 = 360(0x168, float:5.04E-43)\n if (r3 <= r2) goto L_0x0073\n java.lang.String r3 = \"title_long\"\n java.lang.Object r3 = r4.get(r3)\n java.lang.String r3 = (java.lang.String) r3\n boolean r2 = android.text.TextUtils.isEmpty(r3)\n if (r2 != 0) goto L_0x0064\n r0 = r3\n L_0x0064:\n java.lang.String r3 = \"description_long\"\n java.lang.Object r3 = r4.get(r3)\n java.lang.String r3 = (java.lang.String) r3\n boolean r4 = android.text.TextUtils.isEmpty(r3)\n if (r4 != 0) goto L_0x0073\n L_0x0072:\n r1 = r3\n L_0x0073:\n r3 = 2\n java.lang.String[] r3 = new java.lang.String[r3]\n r4 = 0\n r3[r4] = r0\n r4 = 1\n r3[r4] = r1\n return r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.xiaomi.push.service.ah.a(android.content.Context, com.xiaomi.xmpush.thrift.u):java.lang.String[]\");\n }", "private void c() {\n /*\n r14 = this;\n r12 = android.os.SystemClock.elapsedRealtime();\n r8 = r14.d();\n r0 = r14.t;\n if (r0 == 0) goto L_0x007a;\n L_0x000c:\n r0 = 1;\n r7 = r0;\n L_0x000e:\n r0 = r14.r;\n r0 = r0.a();\n if (r0 != 0) goto L_0x0018;\n L_0x0016:\n if (r7 == 0) goto L_0x007d;\n L_0x0018:\n r0 = 1;\n r10 = r0;\n L_0x001a:\n if (r10 != 0) goto L_0x0095;\n L_0x001c:\n r0 = r14.d;\n r0 = r0.b;\n if (r0 != 0) goto L_0x0028;\n L_0x0022:\n r0 = -1;\n r0 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1));\n if (r0 != 0) goto L_0x0032;\n L_0x0028:\n r0 = r14.p;\n r0 = r12 - r0;\n r2 = 2000; // 0x7d0 float:2.803E-42 double:9.88E-321;\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 <= 0) goto L_0x0095;\n L_0x0032:\n r14.p = r12;\n r0 = r14.d;\n r1 = r14.f;\n r1 = r1.size();\n r0.a = r1;\n r0 = r14.c;\n r1 = r14.f;\n r2 = r14.o;\n r4 = r14.m;\n r6 = r14.d;\n r0.getChunkOperation(r1, r2, r4, r6);\n r0 = r14.d;\n r0 = r0.a;\n r0 = r14.a(r0);\n r1 = r14.d;\n r1 = r1.b;\n if (r1 != 0) goto L_0x0080;\n L_0x0059:\n r4 = -1;\n L_0x005b:\n r0 = r14.b;\n r2 = r14.m;\n r1 = r14;\n r6 = r10;\n r0 = r0.update(r1, r2, r4, r6);\n if (r7 == 0) goto L_0x0087;\n L_0x0067:\n r0 = r14.v;\n r0 = r12 - r0;\n r2 = r14.u;\n r2 = (long) r2;\n r2 = r14.c(r2);\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 < 0) goto L_0x0079;\n L_0x0076:\n r14.e();\n L_0x0079:\n return;\n L_0x007a:\n r0 = 0;\n r7 = r0;\n goto L_0x000e;\n L_0x007d:\n r0 = 0;\n r10 = r0;\n goto L_0x001a;\n L_0x0080:\n if (r0 == 0) goto L_0x0095;\n L_0x0082:\n r4 = r14.d();\n goto L_0x005b;\n L_0x0087:\n r1 = r14.r;\n r1 = r1.a();\n if (r1 != 0) goto L_0x0079;\n L_0x008f:\n if (r0 == 0) goto L_0x0079;\n L_0x0091:\n r14.f();\n goto L_0x0079;\n L_0x0095:\n r4 = r8;\n goto L_0x005b;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.exoplayer.chunk.ChunkSampleSource.c():void\");\n }", "@Override\r\n\tprotected void processCost() {\n\r\n\t}", "@Override\n\tpublic void processing() {\n\n\t}", "public void testF() {\n\t\tfor (int k = 0; k < usedSS; k++) {\n\t\t\tList<Integer> subStr = vals.subList(k*compSize, (k+1)*compSize);\n\t\t\tint sum = (int) subStr.stream().filter(i -> i != BipartiteMatching.FREE).count();\n\t\t\tfData.add(sum);\t\t\t\n\t\t}\n\t}", "public static void doit(String fileName) {\n\t\tSystem.out.println(\"****矩阵形式-正域(减)******\"+fileName+\"上POSD的运行时间\"+\"***********\");\r\n\t\tlong time[]=new long[8];\r\n\t\tint t=0;//time下标\r\n\t\t\r\n\t\tList<Integer> preRED=null;\r\n\t List<Integer> nowRED = null;\r\n\r\n\t // 创建DataPreprocess对象data1 \r\n\t DataPreprocess data1=new DataPreprocess(fileName);\r\n\t \r\n\t int k=0,sn=data1.get_origDSNum();\r\n\t int m1=sn/10,m=m1>0?m1:1;\r\n\t int count=sn-(int)(0.2*sn);//保持与增加对象的约简结果一致\r\n\t data1.dataRatioSelect(0.2);\r\n\t \r\n\t preRED=new ArrayList<Integer>();\r\n\t nowRED=new ArrayList<Integer>();\r\n\t \r\n\t ArrayList<ArrayList<Integer>> addData=data1.get_origDS();//交换位置,把原数据前面20%放置到后面,为了保持与对象增加一致\r\n\t ArrayList<ArrayList<Integer>> origData=data1.get_addDS();\r\n\t origData.addAll(addData);\t \t \r\n\t \r\n\t data1=null;\r\n\t\t \r\n\t Iterator<ArrayList<Integer>> value = origData.iterator();\r\n\t \r\n\t ArrayList<ArrayList<Integer>> result_POS=new ArrayList<ArrayList<Integer>>();\r\n\t ArrayList<Integer> POS_Reduct=new ArrayList<Integer>();\r\n\t ArrayList<Integer> original_POS=new ArrayList<Integer>();\r\n\t ArrayList<Integer> original_reduct=new ArrayList<Integer>();\r\n\t int[][] original_sys;\r\n\t ArrayList<Integer> P=new ArrayList<Integer>();\r\n\t IDS_POSD im1=new IDS_POSD(origData);\r\n\t \r\n\t POS_Reduct=im1.getPOS_Reduct(im1.getUn());\t \r\n\t original_POS=im1.getPOS(im1.getUn(),POS_Reduct);\r\n\t \r\n\t original_reduct.addAll(POS_Reduct);\r\n\t \t \r\n\t //original_sys=im1.getUn();\r\n\t int n1=im1.getUn().length;//原决策系统Un包含n个对象\r\n\t int s1=im1.getUn()[0].length;//m个属性,包含决策属性\t\r\n\t original_sys=new int[n1][s1];\r\n\t for(int i=0;i<n1;i++)\r\n\t \t for(int j=0;j<s1;j++)\r\n\t \t\t original_sys[i][j]=im1.getUn()[i][j];\r\n\r\n\t IDS_POSD im2=new IDS_POSD();\r\n\t \r\n\t ArrayList<Integer> temp=new ArrayList<Integer>();\r\n\t long startTime = System.currentTimeMillis(); //获取开始时间\r\n\t\t while (value.hasNext()) {\r\n\t\t\t \t\r\n\t\t\t temp.addAll(value.next());//System.out.println(temp);\r\n\t\t\t\tim2.setUn(origData);\r\n\t\t\t\tim2.setUx(temp);\t\r\n\t\t\t\tresult_POS=im2.SHU_IARS(im2.getUn(),original_reduct,original_POS,im2.getUx());\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t original_reduct=result_POS.get(0);\r\n\t\t\t original_POS=result_POS.get(1);\r\n\t\t\t \r\n\t\t\t\tk++;\r\n\t\t\t\tcount--;\r\n\t\t\t\tif(k%m==0){\r\n\t\t\t\t\t\r\n\t\t\t\t\tlong endTime=System.currentTimeMillis(); //获取结束时间 \r\n\t\t\t\t\ttime[t++]=endTime-startTime;//输出每添加10%数据求约简的时间\r\n\t\t\t\t\tif(t==8)\r\n\t\t\t\t\t\tt--;\r\n\t\t\t\t}\r\n\t\t\t\tvalue.remove();\r\n\t\t\t\ttemp=new ArrayList<Integer>();//.clear();\r\n\t\t\t\tif (count==0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t \r\n\t\t for(int i=0;i<8;i++)\t\t\t\t\r\n\t\t\t System.out.print((double)time[i]/1000+\" \"); \r\n\r\n\t\t System.out.println(\"\\n\"+fileName+\"上POSD的约简为:\"+result_POS.get(0)+\"\\n\");\t\t\r\n\t}", "public void detect_lines(float[] image,long width, long height, Lines contours, MutableLong num_result, double sigma, double low, double high, long mode, boolean compute_width, boolean correct_pos,boolean extend_lines, Junctions junctions)\r\n\t{\r\n\t byte[] ismax;\r\n\t float[] ev, n1, n2, p1, p2;\r\n\t float[][] k = new float[5][(int) (width*height)];\r\n\t \r\n\t// for (i=0;i<5;i++)\r\n\t// k[i] = xcalloc(width*height,sizeof(float));\r\n\t Convol convol = new Convol();\r\n\t convol.convolve_gauss(image,k[0],width,height,sigma,LinesUtil.DERIV_R);\r\n\t convol.convolve_gauss(image,k[1],width,height,sigma,LinesUtil.DERIV_C);\r\n\t convol.convolve_gauss(image,k[2],width,height,sigma,LinesUtil.DERIV_RR);\r\n\t convol.convolve_gauss(image,k[3],width,height,sigma,LinesUtil.DERIV_RC);\r\n\t \r\n\t convol.convolve_gauss(image,k[4],width,height,sigma,LinesUtil.DERIV_CC);\r\n\t\r\n\t ismax = new byte[(int) (width*height)];\r\n\t ev = new float[(int) (width*height)];\r\n\t n1 = new float[(int) (width*height)];\r\n\t n2 = new float[(int) (width*height)];\r\n\t p1 = new float[(int) (width*height)];\r\n\t p2 = new float[(int) (width*height)];\r\n\t /*\r\n\t * The C library function void *memset(void *str, int c, size_t n) \r\n\t * copies the character c (an unsigned char) to the first n characters \r\n\t * of the string pointed to by the argument str.\r\n\t */\r\n\t // memset(ismax,0,width*height*sizeof(*ismax));\r\n\t // memset(ev,0,width*height*sizeof(*ev));\r\n\t for(int j = 0; j < ismax.length; j++){\r\n\t\t ev[j] = 0;\r\n\t\t ismax[j] = 0;\r\n\t }\r\n\r\n\t compute_line_points(k,ismax,ev,n1,n2,p1,p2,width,height,low,high,mode);\r\n\t \r\n\t Link l = new Link();\r\n\t l.compute_contours(ismax,ev,n1,n2,p1,p2,k[0],k[1],contours,num_result,sigma,\r\n\t extend_lines,(int)mode,low,high,width,height,junctions);\r\n\t Width w = new Width();\r\n\t if (compute_width)\r\n\t w.compute_line_width(k[0],k[1],width,height,sigma,mode,correct_pos,contours,\r\n\t num_result);\r\n\r\n\t}", "private void iterativeDataPropertyMetrics() {\n\t}", "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }", "private static void cajas() {\n\t\t\n\t}", "public void a()\r\n/* 49: */ {\r\n/* 50: 64 */ HashSet<BlockPosition> localHashSet = Sets.newHashSet();\r\n/* 51: */ \r\n/* 52: 66 */ int m = 16;\r\n/* 53: 67 */ for (int n = 0; n < 16; n++) {\r\n/* 54: 68 */ for (int i1 = 0; i1 < 16; i1++) {\r\n/* 55: 69 */ for (int i2 = 0; i2 < 16; i2++) {\r\n/* 56: 70 */ if ((n == 0) || (n == 15) || (i1 == 0) || (i1 == 15) || (i2 == 0) || (i2 == 15))\r\n/* 57: */ {\r\n/* 58: 74 */ double d1 = n / 15.0F * 2.0F - 1.0F;\r\n/* 59: 75 */ double d2 = i1 / 15.0F * 2.0F - 1.0F;\r\n/* 60: 76 */ double d3 = i2 / 15.0F * 2.0F - 1.0F;\r\n/* 61: 77 */ double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);\r\n/* 62: */ \r\n/* 63: 79 */ d1 /= d4;\r\n/* 64: 80 */ d2 /= d4;\r\n/* 65: 81 */ d3 /= d4;\r\n/* 66: */ \r\n/* 67: 83 */ float f2 = this.i * (0.7F + this.d.rng.nextFloat() * 0.6F);\r\n/* 68: 84 */ double d6 = this.e;\r\n/* 69: 85 */ double d8 = this.f;\r\n/* 70: 86 */ double d10 = this.g;\r\n/* 71: */ \r\n/* 72: 88 */ float f3 = 0.3F;\r\n/* 73: 89 */ while (f2 > 0.0F)\r\n/* 74: */ {\r\n/* 75: 90 */ BlockPosition localdt = new BlockPosition(d6, d8, d10);\r\n/* 76: 91 */ Block localbec = this.d.getBlock(localdt);\r\n/* 77: 93 */ if (localbec.getType().getMaterial() != Material.air)\r\n/* 78: */ {\r\n/* 79: 94 */ float f4 = this.h != null ? this.h.a(this, this.d, localdt, localbec) : localbec.getType().a((Entity)null);\r\n/* 80: 95 */ f2 -= (f4 + 0.3F) * 0.3F;\r\n/* 81: */ }\r\n/* 82: 98 */ if ((f2 > 0.0F) && ((this.h == null) || (this.h.a(this, this.d, localdt, localbec, f2)))) {\r\n/* 83: 99 */ localHashSet.add(localdt);\r\n/* 84: */ }\r\n/* 85:102 */ d6 += d1 * 0.300000011920929D;\r\n/* 86:103 */ d8 += d2 * 0.300000011920929D;\r\n/* 87:104 */ d10 += d3 * 0.300000011920929D;\r\n/* 88:105 */ f2 -= 0.225F;\r\n/* 89: */ }\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94:111 */ this.j.addAll(localHashSet);\r\n/* 95: */ \r\n/* 96:113 */ float f1 = this.i * 2.0F;\r\n/* 97: */ \r\n/* 98:115 */ int i1 = MathUtils.floor(this.e - f1 - 1.0D);\r\n/* 99:116 */ int i2 = MathUtils.floor(this.e + f1 + 1.0D);\r\n/* 100:117 */ int i3 = MathUtils.floor(this.f - f1 - 1.0D);\r\n/* 101:118 */ int i4 = MathUtils.floor(this.f + f1 + 1.0D);\r\n/* 102:119 */ int i5 = MathUtils.floor(this.g - f1 - 1.0D);\r\n/* 103:120 */ int i6 = MathUtils.floor(this.g + f1 + 1.0D);\r\n/* 104:121 */ List<Entity> localList = this.d.b(this.h, new AABB(i1, i3, i5, i2, i4, i6));\r\n/* 105:122 */ Vec3 localbrw = new Vec3(this.e, this.f, this.g);\r\n/* 106:124 */ for (int i7 = 0; i7 < localList.size(); i7++)\r\n/* 107: */ {\r\n/* 108:125 */ Entity localwv = (Entity)localList.get(i7);\r\n/* 109:126 */ if (!localwv.aV())\r\n/* 110: */ {\r\n/* 111:129 */ double d5 = localwv.f(this.e, this.f, this.g) / f1;\r\n/* 112:131 */ if (d5 <= 1.0D)\r\n/* 113: */ {\r\n/* 114:132 */ double d7 = localwv.xPos - this.e;\r\n/* 115:133 */ double d9 = localwv.yPos + localwv.getEyeHeight() - this.f;\r\n/* 116:134 */ double d11 = localwv.zPos - this.g;\r\n/* 117: */ \r\n/* 118:136 */ double d12 = MathUtils.sqrt(d7 * d7 + d9 * d9 + d11 * d11);\r\n/* 119:137 */ if (d12 != 0.0D)\r\n/* 120: */ {\r\n/* 121:141 */ d7 /= d12;\r\n/* 122:142 */ d9 /= d12;\r\n/* 123:143 */ d11 /= d12;\r\n/* 124: */ \r\n/* 125:145 */ double d13 = this.d.a(localbrw, localwv.getAABB());\r\n/* 126:146 */ double d14 = (1.0D - d5) * d13;\r\n/* 127:147 */ localwv.receiveDamage(DamageSource.a(this), (int)((d14 * d14 + d14) / 2.0D * 8.0D * f1 + 1.0D));\r\n/* 128: */ \r\n/* 129:149 */ double d15 = EnchantmentProtection.a(localwv, d14);\r\n/* 130:150 */ localwv.xVelocity += d7 * d15;\r\n/* 131:151 */ localwv.yVelocity += d9 * d15;\r\n/* 132:152 */ localwv.zVelocity += d11 * d15;\r\n/* 133:154 */ if ((localwv instanceof EntityPlayer)) {\r\n/* 134:155 */ this.k.put((EntityPlayer)localwv, new Vec3(d7 * d14, d9 * d14, d11 * d14));\r\n/* 135: */ }\r\n/* 136: */ }\r\n/* 137: */ }\r\n/* 138: */ }\r\n/* 139: */ }\r\n/* 140: */ }", "private void a(String paramString, boolean paramBoolean)\r\n/* 282: */ {\r\n/* 283:293 */ for (int i1 = 0; i1 < paramString.length(); i1++)\r\n/* 284: */ {\r\n/* 285:294 */ char c1 = paramString.charAt(i1);\r\n/* 286: */ int i2;\r\n/* 287: */ int i3;\r\n/* 288:296 */ if ((c1 == '§') && (i1 + 1 < paramString.length()))\r\n/* 289: */ {\r\n/* 290:297 */ i2 = \"0123456789abcdefklmnor\".indexOf(paramString.toLowerCase().charAt(i1 + 1));\r\n/* 291:299 */ if (i2 < 16)\r\n/* 292: */ {\r\n/* 293:300 */ this.r = false;\r\n/* 294:301 */ this.s = false;\r\n/* 295:302 */ this.v = false;\r\n/* 296:303 */ this.u = false;\r\n/* 297:304 */ this.t = false;\r\n/* 298:305 */ if ((i2 < 0) || (i2 > 15)) {\r\n/* 299:306 */ i2 = 15;\r\n/* 300: */ }\r\n/* 301:309 */ if (paramBoolean) {\r\n/* 302:310 */ i2 += 16;\r\n/* 303: */ }\r\n/* 304:313 */ i3 = this.f[i2];\r\n/* 305:314 */ this.q = i3;\r\n/* 306:315 */ cjm.c((i3 >> 16) / 255.0F, (i3 >> 8 & 0xFF) / 255.0F, (i3 & 0xFF) / 255.0F, this.p);\r\n/* 307: */ }\r\n/* 308:316 */ else if (i2 == 16)\r\n/* 309: */ {\r\n/* 310:317 */ this.r = true;\r\n/* 311: */ }\r\n/* 312:318 */ else if (i2 == 17)\r\n/* 313: */ {\r\n/* 314:319 */ this.s = true;\r\n/* 315: */ }\r\n/* 316:320 */ else if (i2 == 18)\r\n/* 317: */ {\r\n/* 318:321 */ this.v = true;\r\n/* 319: */ }\r\n/* 320:322 */ else if (i2 == 19)\r\n/* 321: */ {\r\n/* 322:323 */ this.u = true;\r\n/* 323: */ }\r\n/* 324:324 */ else if (i2 == 20)\r\n/* 325: */ {\r\n/* 326:325 */ this.t = true;\r\n/* 327: */ }\r\n/* 328:326 */ else if (i2 == 21)\r\n/* 329: */ {\r\n/* 330:327 */ this.r = false;\r\n/* 331:328 */ this.s = false;\r\n/* 332:329 */ this.v = false;\r\n/* 333:330 */ this.u = false;\r\n/* 334:331 */ this.t = false;\r\n/* 335: */ \r\n/* 336:333 */ cjm.c(this.m, this.n, this.o, this.p);\r\n/* 337: */ }\r\n/* 338:336 */ i1++;\r\n/* 339: */ }\r\n/* 340: */ else\r\n/* 341: */ {\r\n/* 342:340 */ i2 = \"\".indexOf(c1);\r\n/* 343:342 */ if ((this.r) && (i2 != -1))\r\n/* 344: */ {\r\n/* 345: */ do\r\n/* 346: */ {\r\n/* 347:345 */ i3 = this.b.nextInt(this.d.length);\r\n/* 348:346 */ } while (this.d[i2] != this.d[i3]);\r\n/* 349:347 */ i2 = i3;\r\n/* 350: */ }\r\n/* 351:353 */ float f1 = this.k ? 0.5F : 1.0F;\r\n/* 352:354 */ int i4 = ((c1 == 0) || (i2 == -1) || (this.k)) && (paramBoolean) ? 1 : 0;\r\n/* 353:356 */ if (i4 != 0)\r\n/* 354: */ {\r\n/* 355:357 */ this.i -= f1;\r\n/* 356:358 */ this.j -= f1;\r\n/* 357: */ }\r\n/* 358:360 */ float f2 = a(i2, c1, this.t);\r\n/* 359:361 */ if (i4 != 0)\r\n/* 360: */ {\r\n/* 361:362 */ this.i += f1;\r\n/* 362:363 */ this.j += f1;\r\n/* 363: */ }\r\n/* 364:366 */ if (this.s)\r\n/* 365: */ {\r\n/* 366:367 */ this.i += f1;\r\n/* 367:368 */ if (i4 != 0)\r\n/* 368: */ {\r\n/* 369:369 */ this.i -= f1;\r\n/* 370:370 */ this.j -= f1;\r\n/* 371: */ }\r\n/* 372:372 */ a(i2, c1, this.t);\r\n/* 373:373 */ this.i -= f1;\r\n/* 374:374 */ if (i4 != 0)\r\n/* 375: */ {\r\n/* 376:375 */ this.i += f1;\r\n/* 377:376 */ this.j += f1;\r\n/* 378: */ }\r\n/* 379:378 */ f2 += 1.0F;\r\n/* 380: */ }\r\n/* 381: */ ckx localckx;\r\n/* 382: */ VertexBuffer localciv;\r\n/* 383:381 */ if (this.v)\r\n/* 384: */ {\r\n/* 385:382 */ localckx = ckx.getInstance();\r\n/* 386:383 */ localciv = localckx.getBuffer();\r\n/* 387:384 */ cjm.x();\r\n/* 388:385 */ localciv.begin();\r\n/* 389:386 */ localciv.addVertex(this.i, this.j + this.a / 2, 0.0D);\r\n/* 390:387 */ localciv.addVertex(this.i + f2, this.j + this.a / 2, 0.0D);\r\n/* 391:388 */ localciv.addVertex(this.i + f2, this.j + this.a / 2 - 1.0F, 0.0D);\r\n/* 392:389 */ localciv.addVertex(this.i, this.j + this.a / 2 - 1.0F, 0.0D);\r\n/* 393:390 */ localckx.draw();\r\n/* 394:391 */ cjm.w();\r\n/* 395: */ }\r\n/* 396:394 */ if (this.u)\r\n/* 397: */ {\r\n/* 398:395 */ localckx = ckx.getInstance();\r\n/* 399:396 */ localciv = localckx.getBuffer();\r\n/* 400:397 */ cjm.x();\r\n/* 401:398 */ localciv.begin();\r\n/* 402:399 */ int i5 = this.u ? -1 : 0;\r\n/* 403:400 */ localciv.addVertex(this.i + i5, this.j + this.a, 0.0D);\r\n/* 404:401 */ localciv.addVertex(this.i + f2, this.j + this.a, 0.0D);\r\n/* 405:402 */ localciv.addVertex(this.i + f2, this.j + this.a - 1.0F, 0.0D);\r\n/* 406:403 */ localciv.addVertex(this.i + i5, this.j + this.a - 1.0F, 0.0D);\r\n/* 407:404 */ localckx.draw();\r\n/* 408:405 */ cjm.w();\r\n/* 409: */ }\r\n/* 410:408 */ this.i += (int)f2;\r\n/* 411: */ }\r\n/* 412: */ }\r\n/* 413: */ }", "public void exechbase(List<String> hilbertresults, double lon1,double lon2,double lat1,double lat2) throws IOException {\n\t\tScan scan = new Scan();\r\n Table table = con.getTable(TableName.valueOf(tname));\r\n FilterList allFilters = new FilterList(FilterList.Operator.MUST_PASS_ALL);\r\n\t\t//String[] hilbertresultsindex = hilbertresults.split(\",\");\r\n\t\t\r\n\t\tfor(int i =0;i<(hilbertresults.size());i++) {\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"hilbertindex\"), CompareOperator.EQUAL,Bytes.toBytes(hilbertresults.get(i))));\r\n }\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"lon\"), CompareOperator.GREATER_OR_EQUAL,Bytes.toBytes(lon1)));\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"lon\"), CompareOperator.LESS_OR_EQUAL,Bytes.toBytes(lon2)));\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"lat\"), CompareOperator.LESS_OR_EQUAL,Bytes.toBytes(lat1)));\r\n allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"lat\"), CompareOperator.GREATER_OR_EQUAL,Bytes.toBytes(lon2)));\r\n //allFilters.addFilter(new SingleColumnValueFilter(Bytes.toBytes(\"data\"), Bytes.toBytes(\"groupid\"), CompareOperator.LESS_OR_EQUAL,Bytes.toBytes(30000)));\r\n\r\n\t\tscan.setFilter(allFilters);\r\n //scan.addFamily(Bytes.toBytes(\"data\"));\r\n \r\n ResultScanner scanner = table.getScanner(scan);\r\n int c=0;\r\n long t1 = System.currentTimeMillis();\r\n for (Result result = scanner.next(); result != null; result = scanner.next()) {\r\n //System.out.println(\"Found row : \" + result);\r\n c++;\r\n }\r\n System.out.println(\"Number of rows : \" + c);\r\n System.out.println(\"Calculation Time: \" + (System.currentTimeMillis() - t1));\r\n scanner.close();\r\n table.close();\r\n con.close();\r\n\t\t\r\n\t}", "private c b(c blk, int i) {\n/* 585 */ int w = blk.g;\n/* 586 */ int h = blk.h;\n/* */ \n/* */ \n/* 589 */ if (blk.a() != 4) {\n/* 590 */ if (this.j == null || this.j.a() != 4) {\n/* 591 */ this.j = (c)new d();\n/* */ }\n/* 593 */ this.j.g = w;\n/* 594 */ this.j.h = h;\n/* 595 */ this.j.e = blk.e;\n/* 596 */ this.j.f = blk.f;\n/* 597 */ blk = this.j;\n/* */ } \n/* */ \n/* */ \n/* 601 */ float[] outdata = (float[])blk.b();\n/* */ \n/* */ \n/* 604 */ if (outdata == null || outdata.length < w * h) {\n/* 605 */ outdata = new float[h * w];\n/* 606 */ blk.a(outdata);\n/* */ } \n/* */ \n/* */ \n/* 610 */ if (i >= 0 && i <= 2) {\n/* */ int j;\n/* */ \n/* */ \n/* 614 */ if (this.m == null)\n/* 615 */ this.m = new e(); \n/* 616 */ if (this.n == null)\n/* 617 */ this.n = new e(); \n/* 618 */ if (this.o == null)\n/* 619 */ this.o = new e(); \n/* 620 */ this.o.g = blk.g;\n/* 621 */ this.o.h = blk.h;\n/* 622 */ this.o.e = blk.e;\n/* 623 */ this.o.f = blk.f;\n/* */ \n/* */ \n/* 626 */ this.m = (e)this.e.getInternCompData((c)this.m, 0);\n/* 627 */ int[] data0 = (int[])this.m.b();\n/* 628 */ this.n = (e)this.e.getInternCompData((c)this.n, 1);\n/* 629 */ int[] data1 = (int[])this.n.b();\n/* 630 */ this.o = (e)this.e.getInternCompData((c)this.o, 2);\n/* 631 */ int[] data2 = (int[])this.o.b();\n/* */ \n/* */ \n/* 634 */ blk.k = (this.m.k || this.n.k || this.o.k);\n/* */ \n/* 636 */ blk.i = 0;\n/* 637 */ blk.j = w;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 642 */ int k = w * h - 1;\n/* 643 */ int k0 = this.m.i + (h - 1) * this.m.j + w - 1;\n/* 644 */ int k1 = this.n.i + (h - 1) * this.n.j + w - 1;\n/* 645 */ int k2 = this.o.i + (h - 1) * this.o.j + w - 1;\n/* */ \n/* 647 */ switch (i) {\n/* */ \n/* */ case 0:\n/* 650 */ for (j = h - 1; j >= 0; j--) {\n/* 651 */ for (int mink = k - w; k > mink; k--, k0--, k1--, k2--) {\n/* 652 */ outdata[k] = 0.299F * data0[k0] + 0.587F * data1[k1] + 0.114F * data2[k2];\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 658 */ k0 -= this.m.j - w;\n/* 659 */ k1 -= this.n.j - w;\n/* 660 */ k2 -= this.o.j - w;\n/* */ } \n/* */ break;\n/* */ \n/* */ \n/* */ case 1:\n/* 666 */ for (j = h - 1; j >= 0; j--) {\n/* 667 */ for (int mink = k - w; k > mink; k--, k0--, k1--, k2--) {\n/* 668 */ outdata[k] = -0.16875F * data0[k0] - 0.33126F * data1[k1] + 0.5F * data2[k2];\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 674 */ k0 -= this.m.j - w;\n/* 675 */ k1 -= this.n.j - w;\n/* 676 */ k2 -= this.o.j - w;\n/* */ } \n/* */ break;\n/* */ \n/* */ \n/* */ case 2:\n/* 682 */ for (j = h - 1; j >= 0; j--) {\n/* 683 */ for (int mink = k - w; k > mink; k--, k0--, k1--, k2--) {\n/* 684 */ outdata[k] = 0.5F * data0[k0] - 0.41869F * data1[k1] - 0.08131F * data2[k2];\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 690 */ k0 -= this.m.j - w;\n/* 691 */ k1 -= this.n.j - w;\n/* 692 */ k2 -= this.o.j - w;\n/* */ } \n/* */ break;\n/* */ } \n/* */ } else {\n/* 697 */ if (i >= 3) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 702 */ e indb = new e(blk.e, blk.f, w, h);\n/* */ \n/* */ \n/* */ \n/* */ \n/* 707 */ this.e.getInternCompData((c)indb, i);\n/* 708 */ int[] indata = (int[])indb.b();\n/* */ \n/* */ \n/* 711 */ int k = w * h - 1;\n/* 712 */ int k0 = indb.i + (h - 1) * indb.j + w - 1;\n/* 713 */ for (int j = h - 1; j >= 0; j--) {\n/* 714 */ for (int mink = k - w; k > mink; k--, k0--) {\n/* 715 */ outdata[k] = indata[k0];\n/* */ }\n/* */ \n/* 718 */ k0 += indb.g - w;\n/* */ } \n/* */ \n/* */ \n/* 722 */ blk.k = indb.k;\n/* 723 */ blk.i = 0;\n/* 724 */ blk.j = w;\n/* 725 */ return blk;\n/* */ } \n/* */ \n/* */ \n/* 729 */ throw new IllegalArgumentException();\n/* */ } \n/* 731 */ return blk;\n/* */ }", "private void c()\r\n/* 81: */ {\r\n/* 82: */ BufferedImage localBufferedImage;\r\n/* 83: */ try\r\n/* 84: */ {\r\n/* 85:102 */ localBufferedImage = cuj.a(bsu.z().O().a(this.g).b());\r\n/* 86: */ }\r\n/* 87: */ catch (IOException localIOException)\r\n/* 88: */ {\r\n/* 89:104 */ throw new RuntimeException(localIOException);\r\n/* 90: */ }\r\n/* 91:107 */ int i1 = localBufferedImage.getWidth();\r\n/* 92:108 */ int i2 = localBufferedImage.getHeight();\r\n/* 93:109 */ int[] arrayOfInt = new int[i1 * i2];\r\n/* 94:110 */ localBufferedImage.getRGB(0, 0, i1, i2, arrayOfInt, 0, i1);\r\n/* 95: */ \r\n/* 96:112 */ int i3 = i2 / 16;\r\n/* 97:113 */ int i4 = i1 / 16;\r\n/* 98: */ \r\n/* 99:115 */ int i5 = 1;\r\n/* 100: */ \r\n/* 101:117 */ float f1 = 8.0F / i4;\r\n/* 102:119 */ for (int i6 = 0; i6 < 256; i6++)\r\n/* 103: */ {\r\n/* 104:120 */ int i7 = i6 % 16;\r\n/* 105:121 */ int i8 = i6 / 16;\r\n/* 106:123 */ if (i6 == 32) {\r\n/* 107:124 */ this.d[i6] = (3 + i5);\r\n/* 108: */ }\r\n\t\t\t\t\tint i9;\r\n/* 109:127 */ for (i9 = i4 - 1; i9 >= 0; i9--)\r\n/* 110: */ {\r\n/* 111:129 */ int i10 = i7 * i4 + i9;\r\n/* 112:130 */ int i11 = 1;\r\n/* 113:131 */ for (int i12 = 0; (i12 < i3) && (i11 != 0); i12++)\r\n/* 114: */ {\r\n/* 115:132 */ int i13 = (i8 * i4 + i12) * i1;\r\n/* 116:134 */ if ((arrayOfInt[(i10 + i13)] >> 24 & 0xFF) != 0) {\r\n/* 117:135 */ i11 = 0;\r\n/* 118: */ }\r\n/* 119: */ }\r\n/* 120:138 */ if (i11 == 0) {\r\n/* 121: */ break;\r\n/* 122: */ }\r\n/* 123: */ }\r\n/* 124:142 */ i9++;\r\n/* 125: */ \r\n/* 126: */ \r\n/* 127:145 */ this.d[i6] = ((int)(0.5D + i9 * f1) + i5);\r\n/* 128: */ }\r\n/* 129: */ }", "private void findVOIs(short[] cm, ArrayList<Integer> xValsAbdomenVOI, ArrayList<Integer> yValsAbdomenVOI, short[] srcBuffer, ArrayList<Integer> xValsVisceralVOI, ArrayList<Integer> yValsVisceralVOI) {\r\n \r\n // angle in radians\r\n double angleRad;\r\n \r\n // the intensity profile along a radial line for a given angle\r\n short[] profile;\r\n \r\n // the x, y location of all the pixels along a radial line for a given angle\r\n int[] xLocs;\r\n int[] yLocs;\r\n try {\r\n profile = new short[xDim];\r\n xLocs = new int[xDim];\r\n yLocs = new int[xDim];\r\n } catch (OutOfMemoryError error) {\r\n System.gc();\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT allocate profile\");\r\n return;\r\n }\r\n \r\n // the number of pixels along the radial line for a given angle\r\n int count;\r\n \r\n // The threshold value for muscle as specified in the JCAT paper\r\n int muscleThresholdHU = 16;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n count = 0;\r\n int x = cm[0];\r\n int y = cm[1];\r\n int yOffset = y * xDim;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = cm[1] - (int)((x - cm[0]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n \r\n // x, y is a candidate abdomen VOI point\r\n // if there are more abdomenTissueLabel pixels along the radial line,\r\n // then we stopped prematurely\r\n \r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends and the muscle starts\r\n \r\n // start at the end of the profile array since its order is from the\r\n // center-of-mass to the abdomen voi point\r\n \r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx <= 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n break;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = cm[0] + (int)((cm[1] - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n x--;\r\n y = cm[1] - (int)((cm[0] - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n // store the intensity and location of each point along the radial line\r\n profile[count] = srcBuffer[yOffset + x];\r\n xLocs[count] = x;\r\n yLocs[count] = y;\r\n count++;\r\n \r\n y++;\r\n x = cm[0] - (int)((y - cm[1]) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n // profile contains all the source image intensity values along the line from\r\n // the center-of-mass to the newly computed abdomen VOI point\r\n // Find where the subcutaneous fat ends\r\n int idx = count - 5; // skip over the skin\r\n while (idx >= 0 && profile[idx] < muscleThresholdHU) {\r\n idx--;\r\n }\r\n if (idx == 0) {\r\n MipavUtil.displayError(\"findAbdomenVOI(): Can NOT find visceral cavity in the intensity profile\");\r\n return;\r\n }\r\n xValsVisceralVOI.add(xLocs[idx]);\r\n yValsVisceralVOI.add(yLocs[idx]);\r\n\r\n }\r\n } // end for (angle = 0; ...\r\n\r\n }", "private static void findBigramCountsTuring() {\n\n\t\tbigramCountTI= new HashMap<Integer,Double>();\n\t\tdouble value;\n\t\tfor(int i:bucketCountT.keySet()){\n\t\t\tif(i==0)\n\t\t\t\tcontinue;\n\t\t\tvalue= ((i+1)*bucketCountT.getOrDefault(i+1, 0.0))/bucketCountT.get(i);\n\t\t\tbigramCountTI.put(i,value);\n\t\t}\n\t}", "private void resampleAbdomenVOI() {\r\n VOIVector vois = abdomenImage.getVOIs();\r\n VOI theVOI = vois.get(0);\r\n\r\n VOIContour curve = ((VOIContour)theVOI.getCurves().get(0));\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n// ViewUserInterface.getReference().getMessageFrame().append(\"Xcm: \" +xcm +\" Ycm: \" +ycm);\r\n \r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 0; angle < 360; angle += angularResolution) {\r\n int x = xcm;\r\n int y = ycm;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n // increment x each step\r\n scaleFactor = Math.tan(angleRad);\r\n while (x < xDim && curve.contains(x, y)) {\r\n \r\n // walk out in x and compute the value of y for the given radial line\r\n x++;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n // decrement y each step\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n while (y > 0 && curve.contains(x, y)) {\r\n\r\n // walk to the top of the image and compute values of x for the given radial line\r\n y--;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n // decrement x each step\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n while (x > 0 && curve.contains(x, y)) {\r\n \r\n x--;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n\r\n } else if (angle > 225 && angle <= 315) {\r\n // increment y each step\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n while (y < yDim && curve.contains(x, y)) {\r\n \r\n y++;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n }\r\n } // end for (angle = 0; ...\r\n \r\n// ViewUserInterface.getReference().getMessageFrame().append(\"resample VOI number of points: \" +xValsAbdomenVOI.size());\r\n curve.clear();\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n curve.add( new Vector3f( xValsAbdomenVOI.get(idx), yValsAbdomenVOI.get(idx), 0 ) );\r\n }\r\n }", "public void processing();", "public void redibujarAlgoformers() {\n\t\t\n\t}", "private void parseData() {\n\t\t\r\n\t}", "private void kk12() {\n\n\t}", "protected void processBlock() {\n\t\t// expand 16 word block into 64 word blocks.\n\t\t//\n\t\tfor (int t = 16; t <= 63; t++) {\n\t\t\tX[t] = Theta1(X[t - 2]) + X[t - 7] + Theta0(X[t - 15]) + X[t - 16];\n\t\t}\n\n\t\t//\n\t\t// set up working variables.\n\t\t//\n\t\tint a = H1;\n\t\tint b = H2;\n\t\tint c = H3;\n\t\tint d = H4;\n\t\tint e = H5;\n\t\tint f = H6;\n\t\tint g = H7;\n\t\tint h = H8;\n\n\t\tint t = 0;\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\t// t = 8 * i\n\t\t\th += Sum1(e) + Ch(e, f, g) + K[t] + X[t];\n\t\t\td += h;\n\t\t\th += Sum0(a) + Maj(a, b, c);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 1\n\t\t\tg += Sum1(d) + Ch(d, e, f) + K[t] + X[t];\n\t\t\tc += g;\n\t\t\tg += Sum0(h) + Maj(h, a, b);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 2\n\t\t\tf += Sum1(c) + Ch(c, d, e) + K[t] + X[t];\n\t\t\tb += f;\n\t\t\tf += Sum0(g) + Maj(g, h, a);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 3\n\t\t\te += Sum1(b) + Ch(b, c, d) + K[t] + X[t];\n\t\t\ta += e;\n\t\t\te += Sum0(f) + Maj(f, g, h);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 4\n\t\t\td += Sum1(a) + Ch(a, b, c) + K[t] + X[t];\n\t\t\th += d;\n\t\t\td += Sum0(e) + Maj(e, f, g);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 5\n\t\t\tc += Sum1(h) + Ch(h, a, b) + K[t] + X[t];\n\t\t\tg += c;\n\t\t\tc += Sum0(d) + Maj(d, e, f);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 6\n\t\t\tb += Sum1(g) + Ch(g, h, a) + K[t] + X[t];\n\t\t\tf += b;\n\t\t\tb += Sum0(c) + Maj(c, d, e);\n\t\t\t++t;\n\n\t\t\t// t = 8 * i + 7\n\t\t\ta += Sum1(f) + Ch(f, g, h) + K[t] + X[t];\n\t\t\te += a;\n\t\t\ta += Sum0(b) + Maj(b, c, d);\n\t\t\t++t;\n\t\t}\n\n\t\tH1 += a;\n\t\tH2 += b;\n\t\tH3 += c;\n\t\tH4 += d;\n\t\tH5 += e;\n\t\tH6 += f;\n\t\tH7 += g;\n\t\tH8 += h;\n\n\t\t//\n\t\t// reset the offset and clean out the word buffer.\n\t\t//\n\t\txOff = 0;\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tX[i] = 0;\n\t\t}\n\t}", "private void method_4318() {\r\n String[] var1;\r\n int var11;\r\n label68: {\r\n var1 = class_752.method_4253();\r\n class_758 var10000 = this;\r\n if(var1 != null) {\r\n if(this.field_3417 != null) {\r\n label71: {\r\n var11 = this.field_3417.field_3012;\r\n if(var1 != null) {\r\n if(this.field_3417.field_3012) {\r\n var10000 = this;\r\n if(var1 != null) {\r\n if(!this.field_2990.field_1832) {\r\n this.method_409(this.field_3404, class_1691.method_9334((class_1036)null), 10.0F);\r\n }\r\n\r\n var10000 = this;\r\n }\r\n\r\n var10000.field_3417 = null;\r\n if(var1 != null) {\r\n break label71;\r\n }\r\n }\r\n\r\n var11 = this.field_3029 % 10;\r\n }\r\n\r\n if(var1 == null) {\r\n break label68;\r\n }\r\n\r\n if(var11 == 0) {\r\n float var13;\r\n var11 = (var13 = this.method_406() - this.method_405()) == 0.0F?0:(var13 < 0.0F?-1:1);\r\n if(var1 == null) {\r\n break label68;\r\n }\r\n\r\n if(var11 < 0) {\r\n this.method_4188(this.method_406() + 1.0F);\r\n }\r\n }\r\n }\r\n }\r\n\r\n var10000 = this;\r\n }\r\n\r\n var11 = var10000.field_3028.nextInt(10);\r\n }\r\n\r\n if(var11 == 0) {\r\n float var2 = 32.0F;\r\n List var3 = this.field_2990.method_2157(class_705.class, this.field_3004.method_7097((double)var2, (double)var2, (double)var2));\r\n class_705 var4 = null;\r\n double var5 = Double.MAX_VALUE;\r\n Iterator var7 = var3.iterator();\r\n\r\n while(true) {\r\n if(var7.hasNext()) {\r\n class_705 var8 = (class_705)var7.next();\r\n double var9 = var8.method_3891(this);\r\n if(var1 == null) {\r\n break;\r\n }\r\n\r\n label43: {\r\n double var12 = var9;\r\n if(var1 != null) {\r\n if(var9 >= var5) {\r\n break label43;\r\n }\r\n\r\n var12 = var9;\r\n }\r\n\r\n var5 = var12;\r\n var4 = var8;\r\n }\r\n\r\n if(var1 != null) {\r\n continue;\r\n }\r\n }\r\n\r\n this.field_3417 = var4;\r\n break;\r\n }\r\n }\r\n\r\n }", "@Override\r\n\tpublic void compute() {\n\t\t\r\n\t}", "private void test() {\n\t\tCoordinate[] polyPts = new Coordinate[]{ \n\t\t\t\t new Coordinate(-98.50165524249245,45.216163960194365), \n\t\t\t\t new Coordinate(-96.07562805826798,39.725652270504796), \t\n\t\t\t\t new Coordinate(-88.95179971518155,39.08088689505274), \t\n\t\t\t\t new Coordinate(-87.96893561066132,44.647653935023214),\n\t\t \t\t new Coordinate(-89.72876449996915,41.54448973482366)\n\t\t\t\t };\n Coordinate[] seg = new Coordinate[2]; \n \n \tCoordinate midPt = new Coordinate();\n \tmidPt.x = ( polyPts[ 0 ].x + polyPts[ 2 ].x ) / 2.0 - 1.0;\n \tmidPt.y = ( polyPts[ 0 ].y + polyPts[ 2 ].y ) / 2.0 - 1.0;\n seg[0] = polyPts[ 0 ];\n seg[1] = midPt; \n \n \n\t\tfor ( int ii = 0; ii < (polyPts.length - 2); ii++ ) {\n\t\t\tfor ( int jj = ii + 2; jj < (polyPts.length); jj ++ ) {\n\t\t seg[0] = polyPts[ii];\n\t\t seg[1] = polyPts[jj]; \n\t\t \n\t\t\t boolean good = polysegIntPoly( seg, polyPts );\n\t String s;\n\t\t\t if ( good ) {\n\t\t\t\t\ts = \"Qualify!\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ts = \"Not qualify\";\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t System.out.println( \"\\npoint \" + ii + \"\\t<Point Lat=\\\"\" + \n\t\t\t\t\t polyPts[ii].y + \"\\\" Lon=\\\"\" + polyPts[ii].x + \"\\\"/>\" \n\t\t\t\t\t + \"\\t=>\\t\" + \"point \" + jj+ \"\\t<Point Lat=\\\"\" + \n polyPts[jj].y + \"\\\" Lon=\\\"\" + polyPts[jj].x + \"\\\"/>\"\n + \"\\t\" + s );\n \n\t\t\t}\n\t }\n\n\t}", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "protected void method_4160() {\r\n String[] var10000 = class_752.method_4253();\r\n ++this.field_3416;\r\n String[] var1 = var10000;\r\n int var7 = this.field_3416;\r\n if(var1 != null) {\r\n label96: {\r\n if(this.field_3416 >= 180) {\r\n var7 = this.field_3416;\r\n if(var1 == null) {\r\n break label96;\r\n }\r\n\r\n if(this.field_3416 <= 200) {\r\n float var2 = (this.field_3028.nextFloat() - 0.5F) * 8.0F;\r\n float var3 = (this.field_3028.nextFloat() - 0.5F) * 4.0F;\r\n float var4 = (this.field_3028.nextFloat() - 0.5F) * 8.0F;\r\n String[] var10001 = field_3418;\r\n this.field_2990.method_2087(\"hugeexplosion\", this.field_2994 + (double)var2, this.field_2995 + 2.0D + (double)var3, this.field_2996 + (double)var4, 0.0D, 0.0D, 0.0D);\r\n }\r\n }\r\n\r\n var7 = this.field_2990.field_1832;\r\n }\r\n }\r\n\r\n int var5;\r\n int var6;\r\n class_715 var9;\r\n ahb var10;\r\n label101: {\r\n short var8;\r\n label102: {\r\n if(var1 != null) {\r\n label85: {\r\n if(var7 == 0) {\r\n var7 = this.field_3416;\r\n var8 = 150;\r\n if(var1 != null) {\r\n label80: {\r\n if(this.field_3416 > 150) {\r\n var7 = this.field_3416 % 5;\r\n if(var1 == null) {\r\n break label80;\r\n }\r\n\r\n if(var7 == 0) {\r\n var5 = 1000;\r\n\r\n while(var5 > 0) {\r\n var6 = class_715.method_4090(var5);\r\n var5 -= var6;\r\n var10 = this.field_2990;\r\n var9 = new class_715;\r\n var9.method_4087(this.field_2990, this.field_2994, this.field_2995, this.field_2996, var6);\r\n var10.method_2089(var9);\r\n if(var1 == null) {\r\n break label85;\r\n }\r\n\r\n if(var1 == null) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n var7 = this.field_3416;\r\n }\r\n\r\n var8 = 1;\r\n }\r\n\r\n if(var1 == null) {\r\n break label102;\r\n }\r\n\r\n if(var7 == var8) {\r\n this.field_2990.method_2209(1018, (int)this.field_2994, (int)this.field_2995, (int)this.field_2996, 0);\r\n }\r\n }\r\n\r\n this.method_3864(0.0D, 0.10000000149011612D, 0.0D);\r\n this.field_3330 = this.field_3000 += 20.0F;\r\n }\r\n\r\n var7 = this.field_3416;\r\n }\r\n\r\n if(var1 == null) {\r\n break label101;\r\n }\r\n\r\n var8 = 200;\r\n }\r\n\r\n if(var7 != var8) {\r\n return;\r\n }\r\n\r\n var7 = this.field_2990.field_1832;\r\n }\r\n\r\n if(var1 != null) {\r\n if(var7 != 0) {\r\n return;\r\n }\r\n\r\n var7 = 2000;\r\n }\r\n\r\n var5 = var7;\r\n\r\n while(true) {\r\n if(var5 > 0) {\r\n var6 = class_715.method_4090(var5);\r\n var5 -= var6;\r\n var10 = this.field_2990;\r\n var9 = new class_715;\r\n var9.method_4087(this.field_2990, this.field_2994, this.field_2995, this.field_2996, var6);\r\n var10.method_2089(var9);\r\n if(var1 == null) {\r\n break;\r\n }\r\n\r\n if(var1 != null) {\r\n continue;\r\n }\r\n }\r\n\r\n this.method_4325(class_1715.method_9561(this.field_2994), class_1715.method_9561(this.field_2996));\r\n break;\r\n }\r\n\r\n this.method_3851();\r\n }", "@Override\n public void preprocess() {\n }", "public void getJobMixAndMakeProcesses(){\n if(jobType == 1){\n //type 1: there is only one process, with A=1 and B=C=0\n //since there is only one process, no the currentWord is 111%processSize\n processes.add(new process(1, 1, 0, 0, 111 % processSize));\n\n }else if(jobType ==2){\n //type 2: there are four processes, each with A=1, B=C=0\n for(int i=1; i<5; i++){\n processes.add(new process(i, 1, 0, 0, (111*i) % processSize));\n }\n\n\n }else if(jobType ==3){\n //type 3: there are four processes, each with A=B=C=0\n for(int i=1; i<5; i++){\n processes.add(new process(i,0, 0, 0, (111*i) % processSize));\n }\n\n }else{\n System.out.println(\"job type 4!!\");\n //process 1 with A=0.75, B=0.25, C=0\n processes.add(new process(1, 0.75, 0.25, 0, (111) % processSize));\n //process 2 with A=0.75, B= 0, C=0.25\n processes.add(new process(2, 0.75, 0, 0.25, (111*2) % processSize));\n //process 3 with A=0.75, B=0.125, C=0.125\n processes.add(new process(3, 0.75, 0.125, 0.125, (111*3) % processSize));\n //process 4 with A=0.5, B=0.125, C=0.125\n processes.add(new process(4, 0.5, 0.125, 0.125, (111*4) % processSize));\n\n }\n\n }", "private c a(c blk, int i) {\n/* 450 */ int w = blk.g;\n/* 451 */ int h = blk.h;\n/* */ \n/* */ \n/* */ \n/* 455 */ if (i >= 0 && i <= 2) {\n/* */ int j;\n/* 457 */ if (blk.a() != 3) {\n/* 458 */ if (this.j == null || this.j.a() != 3) {\n/* 459 */ this.j = (c)new e();\n/* */ }\n/* 461 */ this.j.g = w;\n/* 462 */ this.j.h = h;\n/* 463 */ this.j.e = blk.e;\n/* 464 */ this.j.f = blk.f;\n/* 465 */ blk = this.j;\n/* */ } \n/* */ \n/* */ \n/* 469 */ int[] outdata = (int[])blk.b();\n/* */ \n/* */ \n/* 472 */ if (outdata == null || outdata.length < h * w) {\n/* 473 */ outdata = new int[h * w];\n/* 474 */ blk.a(outdata);\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* 480 */ if (this.m == null)\n/* 481 */ this.m = new e(); \n/* 482 */ if (this.n == null)\n/* 483 */ this.n = new e(); \n/* 484 */ if (this.o == null)\n/* 485 */ this.o = new e(); \n/* 486 */ this.o.g = blk.g;\n/* 487 */ this.o.h = blk.h;\n/* 488 */ this.o.e = blk.e;\n/* 489 */ this.o.f = blk.f;\n/* */ \n/* */ \n/* */ \n/* 493 */ this.m = (e)this.e.getInternCompData((c)this.m, 0);\n/* 494 */ int[] data0 = (int[])this.m.b();\n/* 495 */ this.n = (e)this.e.getInternCompData((c)this.n, 1);\n/* 496 */ int[] data1 = (int[])this.n.b();\n/* 497 */ this.o = (e)this.e.getInternCompData((c)this.o, 2);\n/* 498 */ int[] bdata = (int[])this.o.b();\n/* */ \n/* */ \n/* 501 */ blk.k = (this.m.k || this.n.k || this.o.k);\n/* */ \n/* 503 */ blk.i = 0;\n/* 504 */ blk.j = w;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 509 */ int k = w * h - 1;\n/* 510 */ int k0 = this.m.i + (h - 1) * this.m.j + w - 1;\n/* 511 */ int k1 = this.n.i + (h - 1) * this.n.j + w - 1;\n/* 512 */ int k2 = this.o.i + (h - 1) * this.o.j + w - 1;\n/* */ \n/* 514 */ switch (i) {\n/* */ case 0:\n/* 516 */ for (j = h - 1; j >= 0; j--) {\n/* 517 */ for (int mink = k - w; k > mink; k--, k0--, k1--, k2--)\n/* */ {\n/* */ \n/* 520 */ outdata[k] = data0[k] + 2 * data1[k] + bdata[k] >> 2;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 525 */ k0 -= this.m.j - w;\n/* 526 */ k1 -= this.n.j - w;\n/* 527 */ k2 -= this.o.j - w;\n/* */ } \n/* */ break;\n/* */ \n/* */ case 1:\n/* 532 */ for (j = h - 1; j >= 0; j--) {\n/* 533 */ for (int mink = k - w; k > mink; k--, k1--, k2--)\n/* */ {\n/* */ \n/* 536 */ outdata[k] = bdata[k2] - data1[k1];\n/* */ }\n/* */ \n/* 539 */ k1 -= this.n.j - w;\n/* 540 */ k2 -= this.o.j - w;\n/* */ } \n/* */ break;\n/* */ \n/* */ case 2:\n/* 545 */ for (j = h - 1; j >= 0; j--) {\n/* 546 */ for (int mink = k - w; k > mink; k--, k0--, k1--)\n/* */ {\n/* */ \n/* 549 */ outdata[k] = data0[k0] - data1[k1];\n/* */ }\n/* */ \n/* 552 */ k0 -= this.m.j - w;\n/* 553 */ k1 -= this.n.j - w;\n/* */ } \n/* */ break;\n/* */ } \n/* */ \n/* */ } else {\n/* 559 */ if (i >= 3)\n/* */ {\n/* */ \n/* 562 */ return this.e.getInternCompData(blk, i);\n/* */ }\n/* */ \n/* */ \n/* 566 */ throw new IllegalArgumentException();\n/* */ } \n/* 568 */ return blk;\n/* */ }", "public void normalize() {\n // YOUR CODE HERE\n String w1, w2;\n for (int i = 0; i < row; i++) {\n w1 = NDTokens.get(i);\n for (int j = 0; j < column; j++) {\n w2 = NDTokens.get(j);\n if(smooth) {\n bi_grams_normalized[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)] = (getCount(w1, w2))/(uni_grams[NDTokens.indexOf(w1)] + NDTokens_size);\n }else {\n bi_grams_normalized[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)] = getCount(w1, w2)/(uni_grams[NDTokens.indexOf(w1)]);\n }\n }\n }\n }", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "public static void main(String args[]) {\n\t\tString destination = \"C:\\\\Users\\\\VIIPL02\\\\Desktop\\\\hii\\\\kk_(1).jpg\";\n\t\t//System.out.println(destination);\n\t\t int index1= destination.lastIndexOf(\"_(\");\n \t int index2= destination.lastIndexOf(\")\");\n \t String rig_val=\"\";\n\t\t for(int k=2;k<(index2-index1);k++)\n \t\t rig_val=rig_val+destination.charAt(index1+k)+\"\";\n\t\t \n\t\t \n\t\t //System.out.println(rig_val);\n\t\tfor(int i=0;i<10000000;i++) {\n//\t\tdestination= destination.replace(\"_(\"+(destination.charAt((destination.lastIndexOf(\"(\")+1)))+\")\",\"_(\"+((Integer.parseInt((destination.charAt((destination.lastIndexOf(\"(\")+1)))+\"\" ))+1)+\")\").replace(\"_(\"+(destination.charAt((destination.lastIndexOf(\"(\")+1)))+\")\",\"_(\"+((Integer.parseInt((destination.charAt((destination.lastIndexOf(\"(\")+1)))+\"\" ))+1)+\")\");\n\t\t\t\n\t\t\n\t\t\tdestination=destination.replace(\"_(\"+rig_val+\")\",\"_(\"+(Integer.parseInt(rig_val)+1)+\")\");\n\t\t\trig_val=\"\"+(Integer.parseInt(rig_val)+1);\n\t\t\t//System.out.println(destination);\n\t\t}\n//\t\t //System.out.println( destination.replace(\"_(\"+(destination.charAt((destination.lastIndexOf(\"(\")+1)))+\")\",\"_(\"+((Integer.parseInt((destination.charAt((destination.lastIndexOf(\"(\")+1)))+\"\" ))+1)+\")\"));\n\n\t\t//System.out.println(\"completed\");\n\t}", "@Override\n public void preprocess() {\n }", "public int zzz() {\n int i;\n int i2 = 0;\n int zzz = super.zzz();\n if (this.zzbuR != 0) {\n zzz += zzsn.zzd(1, this.zzbuR);\n }\n if (!this.tag.equals(\"\")) {\n zzz += zzsn.zzo(2, this.tag);\n }\n if (this.zzbuW != null && this.zzbuW.length > 0) {\n i = zzz;\n for (zzsu zzsu : this.zzbuW) {\n if (zzsu != null) {\n i += zzsn.zzc(3, zzsu);\n }\n }\n zzz = i;\n }\n if (!Arrays.equals(this.zzbuY, zzsx.zzbuD)) {\n zzz += zzsn.zzb(6, this.zzbuY);\n }\n if (this.zzbvb != null) {\n zzz += zzsn.zzc(7, this.zzbvb);\n }\n if (!Arrays.equals(this.zzbuZ, zzsx.zzbuD)) {\n zzz += zzsn.zzb(8, this.zzbuZ);\n }\n if (this.zzbuX != null) {\n zzz += zzsn.zzc(9, this.zzbuX);\n }\n if (this.zzbuV) {\n zzz += zzsn.zzf(10, this.zzbuV);\n }\n if (this.zzbuU != 0) {\n zzz += zzsn.zzC(11, this.zzbuU);\n }\n if (this.zzob != 0) {\n zzz += zzsn.zzC(12, this.zzob);\n }\n if (!Arrays.equals(this.zzbva, zzsx.zzbuD)) {\n zzz += zzsn.zzb(13, this.zzbva);\n }\n if (!this.zzbvc.equals(\"\")) {\n zzz += zzsn.zzo(14, this.zzbvc);\n }\n if (this.zzbvd != 180000) {\n zzz += zzsn.zze(15, this.zzbvd);\n }\n if (this.zzbve != null) {\n zzz += zzsn.zzc(16, this.zzbve);\n }\n if (this.zzbuS != 0) {\n zzz += zzsn.zzd(17, this.zzbuS);\n }\n if (!Arrays.equals(this.zzbvf, zzsx.zzbuD)) {\n zzz += zzsn.zzb(18, this.zzbvf);\n }\n if (this.zzbvg != 0) {\n zzz += zzsn.zzC(19, this.zzbvg);\n }\n if (this.zzbvh != null && this.zzbvh.length > 0) {\n i = 0;\n while (i2 < this.zzbvh.length) {\n i += zzsn.zzmx(this.zzbvh[i2]);\n i2++;\n }\n zzz = (zzz + i) + (this.zzbvh.length * 2);\n }\n if (this.zzbuT != 0) {\n zzz += zzsn.zzd(21, this.zzbuT);\n }\n return this.zzbvi != 0 ? zzz + zzsn.zzd(22, this.zzbvi) : zzz;\n }", "void genPromote(Collection ret, int from, int to, int bits) {\n\tfor (char i = KNIGHT; i <= QUEEN; ++i) {\n\tBouger g = new Bouger(from, to, i, (bits | 32), 'P');\n\tg.setScore(1000000 + (i * 10));\n\tret.add(g);\n\t}\n\t}", "private static java.lang.String m586k() {\r\n /*\r\n r6 = 1;\r\n r0 = 0;\r\n r1 = \"/proc/cpuinfo\";\r\n r2 = new java.io.FileReader;\t Catch:{ IOException -> 0x0040, all -> 0x0050 }\r\n r2.<init>(r1);\t Catch:{ IOException -> 0x0040, all -> 0x0050 }\r\n r1 = new java.io.BufferedReader;\t Catch:{ IOException -> 0x0071, all -> 0x006a }\r\n r3 = 8192; // 0x2000 float:1.14794E-41 double:4.0474E-320;\r\n r1.<init>(r2, r3);\t Catch:{ IOException -> 0x0071, all -> 0x006a }\r\n L_0x0010:\r\n r3 = r1.readLine();\t Catch:{ IOException -> 0x0074, all -> 0x006f }\r\n if (r3 == 0) goto L_0x0039;\r\n L_0x0016:\r\n r4 = com.alipay.security.mobile.module.p010a.C0159a.m556a(r3);\t Catch:{ IOException -> 0x0074, all -> 0x006f }\r\n if (r4 != 0) goto L_0x0010;\r\n L_0x001c:\r\n r4 = \":\";\r\n r3 = r3.split(r4);\t Catch:{ IOException -> 0x0074, all -> 0x006f }\r\n if (r3 == 0) goto L_0x0010;\r\n L_0x0024:\r\n r4 = r3.length;\t Catch:{ IOException -> 0x0074, all -> 0x006f }\r\n if (r4 <= r6) goto L_0x0010;\r\n L_0x0027:\r\n r4 = 0;\r\n r4 = r3[r4];\t Catch:{ IOException -> 0x0074, all -> 0x006f }\r\n r5 = \"BogoMIPS\";\r\n r4 = r4.contains(r5);\t Catch:{ IOException -> 0x0074, all -> 0x006f }\r\n if (r4 == 0) goto L_0x0010;\r\n L_0x0032:\r\n r4 = 1;\r\n r3 = r3[r4];\t Catch:{ IOException -> 0x0074, all -> 0x006f }\r\n r0 = r3.trim();\t Catch:{ IOException -> 0x0074, all -> 0x006f }\r\n L_0x0039:\r\n r2.close();\t Catch:{ IOException -> 0x0060 }\r\n L_0x003c:\r\n r1.close();\t Catch:{ IOException -> 0x0062 }\r\n L_0x003f:\r\n return r0;\r\n L_0x0040:\r\n r1 = move-exception;\r\n r1 = r0;\r\n r2 = r0;\r\n L_0x0043:\r\n if (r2 == 0) goto L_0x0048;\r\n L_0x0045:\r\n r2.close();\t Catch:{ IOException -> 0x0064 }\r\n L_0x0048:\r\n if (r1 == 0) goto L_0x003f;\r\n L_0x004a:\r\n r1.close();\t Catch:{ IOException -> 0x004e }\r\n goto L_0x003f;\r\n L_0x004e:\r\n r1 = move-exception;\r\n goto L_0x003f;\r\n L_0x0050:\r\n r1 = move-exception;\r\n r2 = r0;\r\n r7 = r0;\r\n r0 = r1;\r\n r1 = r7;\r\n L_0x0055:\r\n if (r2 == 0) goto L_0x005a;\r\n L_0x0057:\r\n r2.close();\t Catch:{ IOException -> 0x0066 }\r\n L_0x005a:\r\n if (r1 == 0) goto L_0x005f;\r\n L_0x005c:\r\n r1.close();\t Catch:{ IOException -> 0x0068 }\r\n L_0x005f:\r\n throw r0;\r\n L_0x0060:\r\n r2 = move-exception;\r\n goto L_0x003c;\r\n L_0x0062:\r\n r1 = move-exception;\r\n goto L_0x003f;\r\n L_0x0064:\r\n r2 = move-exception;\r\n goto L_0x0048;\r\n L_0x0066:\r\n r2 = move-exception;\r\n goto L_0x005a;\r\n L_0x0068:\r\n r1 = move-exception;\r\n goto L_0x005f;\r\n L_0x006a:\r\n r1 = move-exception;\r\n r7 = r1;\r\n r1 = r0;\r\n r0 = r7;\r\n goto L_0x0055;\r\n L_0x006f:\r\n r0 = move-exception;\r\n goto L_0x0055;\r\n L_0x0071:\r\n r1 = move-exception;\r\n r1 = r0;\r\n goto L_0x0043;\r\n L_0x0074:\r\n r3 = move-exception;\r\n goto L_0x0043;\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: com.alipay.security.mobile.module.b.a.k():java.lang.String\");\r\n }", "static com.qiyukf.nimlib.p470f.p471a.C5826a m23369a(android.os.Parcel r4) {\n /*\n com.qiyukf.nimlib.f.a.a r0 = new com.qiyukf.nimlib.f.a.a\n r1 = 0\n r0.m50001init(r1)\n int r2 = r4.readInt()\n r0.f18499a = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x001d\n byte[] r2 = r4.createByteArray()\n java.nio.ByteBuffer r2 = java.nio.ByteBuffer.wrap(r2)\n r0.f18501c = r2\n L_0x001d:\n int r2 = r4.readInt()\n r0.f18500b = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x0061\n byte[] r4 = r4.createByteArray()\n int r3 = r0.f18500b\n if (r3 <= 0) goto L_0x005c\n int r1 = r0.f18500b\n if (r1 != r2) goto L_0x0049\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4)\n r0.f18502d = r4\n java.nio.ByteBuffer r4 = r0.f18502d\n r4.position(r2)\n goto L_0x0068\n L_0x0049:\n int r1 = r0.f18500b\n java.nio.ByteBuffer r1 = java.nio.ByteBuffer.allocate(r1)\n r0.f18502d = r1\n java.nio.ByteBuffer r1 = r0.f18502d\n r1.put(r4)\n goto L_0x0068\n L_0x005c:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4, r1, r2)\n goto L_0x0065\n L_0x0061:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.allocate(r1)\n L_0x0065:\n r0.f18502d = r4\n L_0x0068:\n boolean r4 = m23372b(r0)\n if (r4 == 0) goto L_0x006f\n return r0\n L_0x006f:\n int r4 = r0.f18500b\n if (r4 <= 0) goto L_0x007d\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n r4.put(r1, r0)\n goto L_0x00a2\n L_0x007d:\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n java.lang.Object r4 = r4.get(r1)\n com.qiyukf.nimlib.f.a.a r4 = (com.qiyukf.nimlib.p470f.p471a.C5826a) r4\n if (r4 == 0) goto L_0x00a2\n java.nio.ByteBuffer r1 = r4.f18502d\n java.nio.ByteBuffer r0 = r0.f18502d\n r1.put(r0)\n boolean r0 = m23372b(r4)\n if (r0 == 0) goto L_0x00a2\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r0 = f18504a\n int r1 = r4.f18499a\n r0.remove(r1)\n return r4\n L_0x00a2:\n r4 = 0\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.qiyukf.nimlib.p470f.p471a.C5826a.C5829b.m23369a(android.os.Parcel):com.qiyukf.nimlib.f.a.a\");\n }", "private void method_259(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15) {\n boolean var28 = field_759;\n int var19 = var12 >> 16 & 255;\n int var20 = var12 >> 8 & 255;\n int var21 = var12 & 255;\n\n try {\n int var22 = var4;\n int var23 = -var8;\n if(var28 || var23 < 0) {\n do {\n int var24 = (var5 >> 16) * var11;\n int var25 = var13 >> 16;\n int var26 = var7;\n int var27;\n if(var25 < this.field_745) {\n var27 = this.field_745 - var25;\n var26 = var7 - var27;\n var25 = this.field_745;\n var4 += var9 * var27;\n }\n\n if(var25 + var26 >= this.field_746) {\n var27 = var25 + var26 - this.field_746;\n var26 -= var27;\n }\n\n var15 = 1 - var15;\n if(var15 != 0) {\n var27 = var25;\n if(var28 || var25 < var25 + var26) {\n do {\n var3 = var2[(var4 >> 16) + var24];\n if(var3 != 0) {\n label33: {\n int var16 = var3 >> 16 & 255;\n int var17 = var3 >> 8 & 255;\n int var18 = var3 & 255;\n if(var16 == var17 && var17 == var18) {\n var1[var27 + var6] = (var16 * var19 >> 8 << 16) + (var17 * var20 >> 8 << 8) + (var18 * var21 >> 8);\n if(!var28) {\n break label33;\n }\n }\n\n var1[var27 + var6] = var3;\n }\n }\n\n var4 += var9;\n ++var27;\n } while(var27 < var25 + var26);\n }\n }\n\n var5 += var10;\n var4 = var22;\n var6 += this.field_723;\n var13 += var14;\n ++var23;\n } while(var23 < 0);\n\n }\n } catch (Exception var29) {\n System.out.println(\"error in transparent sprite plot routine\"); // authentic System.out.println\n }\n }", "public RunLengthEncoding(PixImage image) {\n // Your solution here, but you should probably leave the following line\n // at the end.\n\t this.width=image.getWidth();\n\t this.height=image.getHeight();\n\t runs = new DList<int[]>(); \n\t \n\t int length_count=0;\n\t int cur_Color=-1;\n\t int prev_Color=-1;\n\t \n\t for(int j=0;j<image.getHeight();j++) {\t \n\t\t\t for(int i=0;i<image.getWidth();i++) {\n\t\t\t\tcur_Color=image.getRed(i, j); \n\t\t\t\tif (cur_Color!=prev_Color) {\n\t\t\t\t\tlength_count++;\n\t\t\t\t\tprev_Color=cur_Color;\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t }\n\t\t\t \n\t }\n\t int count=1;\n\t int[] red = new int[length_count];\n\t int[] green = new int[length_count];\n\t int[] blue = new int[length_count];\n\t int[] runLengths =new int[length_count];\n\t int t=0;\n\t red[0]=image.getRed(0, 0);\n\t green[0]=image.getGreen(0, 0);\n\t blue[0]=image.getBlue(0, 0);\n\t \n\t int passed_counter = 0;\n\t for(int j=0;j<image.getHeight();j++) {\n\t\t\t for(int i=0;i<image.getWidth();i++) {\n\t\t\t\t passed_counter++;\n\t\t\t\t if(i>0 || j>0) { // do not do anything for the first element\n\t\t\t\t\t if(image.getRed(i, j)!=red[t]) {\n\t\t\t\t\t\t runLengths[t]=count;\n\t\t\t\t\t\t count = 1;\n\t\t\t\t\t\t t++;\n\t\t\t\t\t\t runLengths[t]=image.getWidth()*image.getHeight() -passed_counter+1;\n\t\t\t\t\t\t red[t]=image.getRed(i, j);\n\t\t\t\t\t\t green[t]=image.getGreen(i, j);\n\t\t\t\t\t\tblue[t]=image.getBlue(i, j);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t }\n\t\t\t\t\t else {\n\t\t\t\t\t\t count++;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t red[t]=image.getRed(i, j);\n\t\t\t\t\t green[t]=image.getGreen(i, j);\n\t\t\t\t\tblue[t]=image.getBlue(i, j);\n\t\t\t\t\t \n\t\t\t\t\n\t\t\t }\n\t }\t\n\t for(int i=0;i<red.length;i++) {\n\t\t\tint[] run= {runLengths[i],red[i],green[i],blue[i]};\n\t\t\t\n\t\t\tif(runs.isEmpty())\n\t\t\t{\n\t\t\t\t\n\t\t\t\truns.addFirst(run);\n\t\t\t}else {\n\t\t\t\tDListNode<int[]> v=runs.getLast();\n\t\t\t\truns.addAfter(v, run);\n\t\t\t} \n\t \n \n }\n\t check();\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "private void m24355f() {\n String[] strArr = this.f19529f;\n int length = strArr.length;\n int i = length + length;\n if (i > 65536) {\n this.f19531h = 0;\n this.f19528e = false;\n this.f19529f = new String[64];\n this.f19530g = new C4216a[32];\n this.f19533j = 63;\n this.f19535l = false;\n return;\n }\n C4216a[] aVarArr = this.f19530g;\n this.f19529f = new String[i];\n this.f19530g = new C4216a[(i >> 1)];\n this.f19533j = i - 1;\n this.f19532i = m24353e(i);\n int i2 = 0;\n int i3 = 0;\n for (String str : strArr) {\n if (str != null) {\n i2++;\n int c = mo29675c(mo29670a(str));\n String[] strArr2 = this.f19529f;\n if (strArr2[c] == null) {\n strArr2[c] = str;\n } else {\n int i4 = c >> 1;\n C4216a aVar = new C4216a(str, this.f19530g[i4]);\n this.f19530g[i4] = aVar;\n i3 = Math.max(i3, aVar.f19539c);\n }\n }\n }\n int i5 = length >> 1;\n for (int i6 = 0; i6 < i5; i6++) {\n for (C4216a aVar2 = aVarArr[i6]; aVar2 != null; aVar2 = aVar2.f19538b) {\n i2++;\n String str2 = aVar2.f19537a;\n int c2 = mo29675c(mo29670a(str2));\n String[] strArr3 = this.f19529f;\n if (strArr3[c2] == null) {\n strArr3[c2] = str2;\n } else {\n int i7 = c2 >> 1;\n C4216a aVar3 = new C4216a(str2, this.f19530g[i7]);\n this.f19530g[i7] = aVar3;\n i3 = Math.max(i3, aVar3.f19539c);\n }\n }\n }\n this.f19534k = i3;\n this.f19536m = null;\n int i8 = this.f19531h;\n if (i2 != i8) {\n throw new IllegalStateException(String.format(\"Internal error on SymbolTable.rehash(): had %d entries; now have %d\", Integer.valueOf(i8), Integer.valueOf(i2)));\n }\n }", "@SuppressWarnings(\"unlikely-arg-type\")\r\n\tpublic static void main(String[] args) throws InterruptedException, ExecutionException, IOException {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t\t// System.out.println(\"what\");\r\n\t\tint k = 7;\r\n\r\n\t\tchar[] set = { 'a', 'b', 'c' };\r\n\t\tchar[] str = new char[k];\r\n \r\n\t\tenumeratePaths(k, set, str, 0); // call function to generate the paths\r\n\t back_Up();// function to back up set of paths\r\n\t\t\t\t\t\t// information\r\n\t\t \r\n\r\n\t\tint[] lb = new int[R];// lower bound\r\n\t\tint[] ub = new int[R];// upper bound\r\n\r\n\t\tfor (int j = 0; j < R; j++) { // the sample range of integers is between 1 and 100\r\n\t\t\tlb[j] = -1000; // lower bound\r\n\t\t\tub[j] = 1000; // upper bound\r\n\r\n\t\t}\r\n\r\n\t\tfor (int run = 0; run < RUN; run++) {\r\n\r\n\t\t\tint[][] x = new int[pop_num][R];\r\n\t\t\tint[][] v = new int[pop_num][R];\r\n\t\t\t //id = 0;\r\n\t\t\t\r\n\t\t\t//paths.put(new String(str) , false);\r\n\t\t\tobj_total = 0;\r\n\t\t\t group_1_count = 0;\r\n\t\t group_2_count = 0;\r\n\t\t\t group_3_count = 0;\r\n\t\t\t group_4_count = 0;\r\n\t\t\t group_5_count = 0;\r\n\t\t\t group_6_count = 0;\r\n\t\t\t group_7_count = 0;\r\n\t\t\t group_8_count = 0;\r\n\t\t\t group_9_count = 0;\r\n\t\t\t\r\n\t\t\t group_10_count = 0;\r\n\t\t\t group_11_count = 0;\r\n\t\t\t group_12_count = 0;\r\n\t\t\t group_13_count = 0;\r\n\t\t\t group_14_count = 0;\r\n\t\t\t group_15_count = 0;\r\n\t\t\t group_16_count = 0;\r\n\t\t\t group_17_count = 0;\r\n\t\t\t group_18_count = 0;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// pick_counter_1 = 0;\r\n\t\t\t \r\n\t\t\t group_19_count = 0;\r\n\t\t\t group_20_count = 0;\r\n\t\t\t group_21_count = 0;\r\n\t\t\t group_22_count = 0;\r\n\t\t\t group_23_count = 0;\r\n\t\t\t group_24_count = 0;\r\n\t\t\t group_25_count = 0;\r\n\t\t\t group_26_count = 0;\r\n\t\t\t group_27_count = 0;\r\n\t\t\t\r\n\t\t\t group_28_count = 0;\r\n\t\t\t group_29_count = 0;\r\n\t\t\t group_30_count = 0;\r\n\t\t\t group_31_count = 0;\r\n\t\t\t group_32_count = 0;\r\n\t\t\t group_33_count = 0;\r\n\t\t\t group_34_count = 0;\r\n\t\t\t group_35_count = 0;\r\n\t\t\t group_36_count = 0;\r\n\t\t\t\r\n\t\t\t group_37_count = 0;\r\n\t group_38_count = 0;\r\n\t\t\t group_39_count = 0;\r\n\t\t\t group_40_count = 0;\r\n\t\t\t group_41_count = 0;\r\n\t\t\t group_42_count = 0;\r\n\t\t\t group_43_count = 0;\r\n\t\t\t group_44_count = 0;\r\n\t\t\t group_45_count = 0;\r\n\t\t\t\r\n\t\t group_46_count = 0;\r\n\t\t\t group_47_count = 0;\r\n\t\t\t group_48_count = 0;\r\n\t\t\t group_49_count = 0;\r\n\t\t\t group_50_count = 0;\r\n\t\t group_51_count = 0;\r\n\t\t\t group_52_count = 0;\r\n\t\t\t group_53_count = 0;\r\n\t\t\t group_54_count = 0;\r\n\t\t\t\r\n\t\t\t group_55_count = 0;\r\n\t\t\t group_56_count = 0;\r\n\t\t\t group_57_count = 0;\r\n\t\t\t group_58_count = 0;\r\n\t\t\t group_59_count = 0;\r\n\t\t\t group_60_count = 0;\r\n\t\t\t group_61_count = 0;\r\n\t\t group_62_count = 0;\r\n\t\t\t group_63_count = 0;\r\n\t\t group_64_count = 0;\r\n\t\t\t\r\n\t\t solution_1 = new int[500][R];\r\n\t\t\t\tsolution_2 = new int[500][R];\r\n\t\t\t\tsolution_3 = new int[500][R];\r\n\t\t\t\tsolution_4 = new int[500][R];\r\n\t\t\t\tsolution_5 = new int[500][R];\r\n\t\t\t\tsolution_6 = new int[500][R];\r\n\t\t\t\tsolution_7 = new int[500][R];\r\n\t\t\t\tsolution_8 = new int[500][R];\r\n\t\t\t\tsolution_9 = new int[500][R];\r\n\t\t\t\tsolution_10 = new int[500][R];\r\n\t\t\t\tsolution_11 = new int[500][R];\r\n\t\t\t\tsolution_12 = new int[500][R];\r\n\t\t\t\tsolution_13 = new int[500][R];\r\n\t\t\t\tsolution_14 = new int[500][R];\r\n\t\t\t\tsolution_15 = new int[500][R];\r\n\t\t\t\tsolution_16 = new int[500][R];\r\n\t\t\t\tsolution_17 = new int[500][R];\r\n\t\t\t\tsolution_18 = new int[500][R];\r\n\t\t\t\tsolution_19 = new int[500][R];\r\n\t\t\t\tsolution_20 = new int[500][R];\r\n\t\t\t\tsolution_21 = new int[500][R];\r\n\t\t\t\tsolution_22 = new int[500][R];\r\n\t\t\t\tsolution_23 = new int[500][R];\r\n\t\t\t\tsolution_24 = new int[500][R];\r\n\t\t\t\tsolution_25 = new int[500][R];\r\n\t\t\t\tsolution_26 = new int[500][R];\r\n\t\t\t\tsolution_27 = new int[500][R];\r\n\t\t\t\tsolution_28 = new int[500][R];\r\n\t\t\t\tsolution_29 = new int[500][R];\r\n\t\t\t\tsolution_30 = new int[500][R];\r\n\t\t\t\tsolution_31 = new int[500][R];\r\n\t\t\t\tsolution_32 = new int[500][R];\r\n\t\t\t\tsolution_33 = new int[500][R];\r\n\r\n\t\t\t\tsolution_34 = new int[500][R];\r\n\t\t\t\tsolution_35 = new int[500][R];\r\n\t\t\t\tsolution_36 = new int[500][R];\r\n\t\t\t\tsolution_37 = new int[500][R];\r\n\t\t\t\tsolution_38 = new int[500][R];\r\n\t\t\t\tsolution_39 = new int[500][R];\r\n\t\t\t\tsolution_40 = new int[500][R];\r\n\t\t\t\tsolution_41 = new int[500][R];\r\n\t\t\t\tsolution_42 = new int[500][R];\r\n\t\t\t\tsolution_43 = new int[500][R];\r\n\t\t\t\tsolution_44 = new int[500][R];\r\n\t\t\t\tsolution_45 = new int[500][R];\r\n\t\t\t\tsolution_46 = new int[500][R];\r\n\t\t\t\tsolution_47 = new int[500][R];\r\n\t\t\t\tsolution_48 = new int[500][R];\r\n\t\t\t\tsolution_49 = new int[500][R];\r\n\t\t\t\tsolution_50 = new int[500][R];\r\n\t\t\t\tsolution_51 = new int[500][R];\r\n\t\t\t\tsolution_52 = new int[500][R];\r\n\t\t\t\tsolution_53 = new int[500][R];\r\n\t\t\t\tsolution_54 = new int[500][R];\r\n\t\t\t\tsolution_55 = new int[500][R];\r\n\t\t\t\tsolution_56 = new int[500][R];\r\n\t\t\t\tsolution_57 = new int[500][R];\r\n\t\t\t\tsolution_58 = new int[500][R];\r\n\t\t\t\tsolution_59 = new int[500][R];\r\n\t\t\t\tsolution_60 = new int[500][R];\r\n\t\t\t\tsolution_61 = new int[500][R];\r\n\t\t\t\tsolution_62 = new int[500][R];\r\n\t\t\t\tsolution_63 = new int[500][R];\r\n\t\t\t\tsolution_64 = new int[500][R];\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t crossover_count = 0;\r\n boolean statusChecker =false;\r\n\t\t\tLinkedHashMap<String, List<Double>> parent_maps = new LinkedHashMap<String, List<Double>>();\r\n\t\t\t\r\n\t\t\tLinkedHashMap<String, List<Double>> offspring_maps = new LinkedHashMap<String, List<Double>>();\r\n\t\t\t\r\n\t\t\tLinkedHashMap<String, List<Double>> combined_maps = new LinkedHashMap<String, List<Double>>();\r\n\t\t//\tLinkedHashMap<String, List<Double>> fitnessmaps = new LinkedHashMap<String, List<Double>>();\r\n\r\n\t\t\tLinkedHashMap<String, Integer> setrank1 = new LinkedHashMap<String, Integer>();\r\n\t\t\r\n\r\n\t\t\tList<String> updated_population = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tList<String> combined_population = new ArrayList<String>();\r\n\t\t\tList<String> offspring_population = new ArrayList<String>();\r\n\t\t\t//List<String> parent_population = new ArrayList<String>();\r\n\t\t\tList<String> single_population = new ArrayList<String>();\r\n\r\n\t\t\tList<String> combined_population_list = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tList<String> temporary_path_holder = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tList<String> parents_population = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tList<String> parents_population_copy = new ArrayList<String>();\r\n\t\t\t\r\n\t\t//\tString traverse_template;\r\n\r\n\t\t\t// the 2d arrays below hold the solutions to each respective group\r\n\t\t\tint [][] solution = new int[500][R];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t//\tboolean [] statu = new boolean [PATHNUM];\r\n\t\t\t\t\r\n\r\n\t\t\tint totalpathcounter = 0;\r\n\r\n\t\t\tint obj_total = 0;\r\n\r\n\t\t\tString getfinalpath = null;\r\n\t\t\t//String getfinalpath;\r\n\r\n\t\t\tif (run > 0) { // in each run reset the number counter of the paths covered in each group\r\n\r\n\t\t\t\treset_All();\r\n\t\t\t\tpaths.clear();\r\n\t\t\t\tupdated_population.clear();\r\n\t\t\t\tcombined_population.clear();\r\n\t\t\t\toffspring_population.clear();\r\n\t\t\t\tsingle_population.clear();\r\n\t\t\t\toffspring_maps.clear();\r\n\t\t\t\tsetrank1.clear();\r\n\t\t\t\t//setrank2.clear();\r\n\t\t\t\t//offspring_maps.clear();\r\n\t\t\t\tparents_population_copy.clear();\r\n\t\t\t\tcombined_maps.clear();\r\n\t\t\t\tparent_maps.clear();\r\n\t\t\t\tpaths.putAll(temporay_paths); \r\n\t\t\t}\r\n\r\n\t\t\tfor (int i = 0; i < pop_num; i++) // initialize the population with the dimension of R values/inputs\r\n\t\t\t{\r\n\r\n\t\t\t\tfor (int j = 0; j < R; j++) {\r\n\t\t\t\t\r\n\t\t\t\t\tx[i][j] = (int)(Math.random()*((ub[j] - lb[j])+1))+ lb[j];\r\n\r\n\t\t\t\t} //initial random population\r\n\r\n\t\t\t\tgetfinalpath = pathnum(x[i]); \r\n\t\t\t\t//archiving( String check_path_group , int num, int[][] offspring)\r\n int pickPaths= 0;\r\n\t\t\t\t\r\n\t\t\t\tSet<String> keyz = paths.keySet();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tfor (String key : keyz) {\r\n\r\n\t\t\t\t\tif (pickPaths < 50) { //pick subset of N paths\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttarget_subset.put(key + \" \" + \"new\", false);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tpickPaths++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\tparents_population.add(\"parent\" + \" \" + i);\r\n\t\t\t\t//record covered path and find group where it belongs\r\n\t\t\t\t//save test case in corresponding path group\r\n\t\t\t\tarchiving( getfinalpath , i, x);\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tparents_population_copy.addAll(parents_population);\r\n\t\t\t\r\n\t\t\tcombined_population_list.addAll(parents_population_copy);\t\r\n\t\t\t///offspring_population.addAll(parents_population_copy);\r\n\t\t\t//Cycle[run] = 1;\r\n\r\n\t\t\t\tlong start_time = System.currentTimeMillis();\r\n\t\t\t\tlong wait_time = 1518750;\r\n\t\t\t\tlong end_time = start_time + wait_time;\r\n\t\t\t\tList<Double> temp_2 = new ArrayList<Double>();\r\n\t\t\t\t\r\n\t\t\t // int generation = 0;\r\n\t\t\t\t\r\n\t\t\t\twhile ((System.currentTimeMillis() < end_time) && obj_total < PATHNUM_NUMBER) // not exceeded the set\r\n\r\n\t\t\t\t{\r\n\t\t\t\t//LinkedHashMap<String, List<Double>> parent_maps_init = new LinkedHashMap<String, List<Double>>(); \r\n\t\t\t\t//initial random population tournament selection\r\n\t\t\t\r\n\t\t\t\t\t//List<Double> temp = new ArrayList<Double>();\r\n\t\t\t\t\tif (crossover_count == 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tRandom random = new Random();\r\n\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i = 0; i < 25; i++) {\r\n\t\t\t\t\r\n\t\t\t\t\t\t//pick two parents to cross\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString randomKey_1 = parents_population_copy.get( random.nextInt(parents_population_copy.size())) ;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tparents_population_copy.remove(randomKey_1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString randomKey_2 = parents_population_copy.get( random.nextInt(parents_population_copy.size())) ;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tparents_population_copy.remove(randomKey_2);\r\n\t\t\t\t\t\t//access parent via parent_maps_init\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//split the string\r\n\t\t\t\t\t\t//parents_population.add(\"parent\" + \" \" + i);\r\n\t\t\t\t\t\tString [] parent_1_string = randomKey_1.split(\" \");\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString par_1;\r\n\r\n\t\t\t\t\t\tint pos_1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tpar_1 = parent_1_string[0];\r\n\t\t\t\t\t\tpos_1 = Integer.parseInt(parent_1_string[1]);\r\n\t\t\t\t\t\t\r\n // String [] parent_2_string = randomKey_2.split(\" \");\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString [] parent_2_string = randomKey_1.split(\" \");\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString par_2;\r\n\r\n\t\t\t\t\t\tint pos_2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tpar_2 = parent_2_string[0];\r\n\t\t\t\t\t\tpos_2 = Integer.parseInt(parent_2_string[1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t //System.out.println(\"Random number 1 : \"+Math.random()\r\n\t\t\t\t\t\t//crossover nbased on probability\r\n\t\t\t\t \tRandom rand = new Random();\r\n\t\t\t\t\t//\tdouble rdm = rand.nextDouble();\t\t \r\n\t\t\t\t\t\tdouble rdm = Math.random();\r\n\t\t\t\t\t\t if(rdm < 0.75) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//single-point crossover\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \t//randomly find a position and exchange the tails\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\tint parent_1_random = rand.nextInt(R);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t int new_point = parent_1_random; \r\n\t\t\t\t\t\t //exchange elements with parent_2\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t //\tint[][] temporal = new int[pop_num][R];\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t for (int j = 0 ; j < R; j++) {\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t \tv[pos_1][j] = x[pos_1][j];\r\n\t\t\t\t\t\t \tv[pos_2][j] = x[pos_2][j];\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t\t int g = new_point;\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t // for (int g = new_point ; new_point < R; new_point++) {\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \twhile (g <= R){\t\r\n\t\t\t\t\t \t\t//switch the tails of parent one and parent two\r\n\t\t\t\t\t\t \tv[pos_1][g] = x[pos_2][g];\r\n\t\t\t\t\t\t \tv[pos_2][g] = x[pos_1][g];\r\n\r\n\t\t\t\t\t \t g++;\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdouble mutate = Math.random();\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t if(mutate < (1/R)) { \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t int child_1 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \tint child_2 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \tv[pos_1][child_1] = (int)(Math.random()*((ub[child_1] - lb[child_1])+1))+ lb[child_1];\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \tv[pos_2][child_2] = (int)(Math.random()*((ub[child_2] - lb[child_2])+1))+ lb[child_2]; \r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t else {\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t offspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t offspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t \t\r\n\t\t\t\t\t \t\tfor (int j = 0 ; j < R; j++) {\r\n\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t \t\tv[pos_1][j] = x[pos_1][j];\r\n\t\t\t\t\t\t \t\tv[pos_2][j] = x[pos_2][j];\r\n\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\t//mutate\r\n\t\t\t\t\t \t\t\r\n\r\n\t\t\t\t\t \t// Random mut = new Random();\r\n\t\t\t\t\t\t\t\tdouble mutate = Math.random();\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t if(mutate < (1/R)) { \r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t int child_1 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \tint child_2 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \tv[pos_1][child_1] = (int)(Math.random()*((ub[child_1] - lb[child_1])+1))+ lb[child_1];\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \tv[pos_2][child_2] = (int)(Math.random()*((ub[child_2] - lb[child_2])+1))+ lb[child_2]; \r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n //mutation (1/size of test case input vector)\r\n\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//get path traversed by offsprings\r\n\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i = 0; i < offspring_population.size(); i++) {// initialize the population with the dimension of R values/inputs\r\n\t\t\t\t\r\n\t\t\t\t String [] get_index = offspring_population.get(i).split(\" \");\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t String off_1;\r\n\r\n\t\t\t\t\tint index_1;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\toff_1 = get_index[0];\r\n\t\t\t\t\tindex_1 = Integer.parseInt(get_index[1]);\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tgetfinalpath = pathnum(v[index_1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\tarchiving( getfinalpath , index_1, v);\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t\t\t // if ()\r\n\t\t\t\t\t\r\n\t\t\t\t \t\tRandom random = new Random();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//\tLinkedHashMap<String, Boolean> changed_status = new LinkedHashMap<String, Boolean>();\r\n\t\t\t\t\t\t\t//\tLinkedHashMap<String, Boolean> child_status = new LinkedHashMap<String, Boolean>();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t \t\tparents_population_copy.clear();\r\n\t\t\t\t \t\tfor (int i = 0; i < 50; i++) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tparents_population_copy.add( \"parent\" + \" \" + i);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t \t\t\r\n\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < 25; i++) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString randomKey_1 = parents_population_copy.get( random.nextInt(parents_population_copy.size())) ;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tparents_population_copy.remove(randomKey_1);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString randomKey_2 = parents_population_copy.get( random.nextInt(parents_population_copy.size())) ;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tparents_population_copy.remove(randomKey_2);\r\n\t\t\t\t\t\t\t\t\t//access parent via parent_maps_init\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//split the string\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString [] parent_1_string = randomKey_1.split(\" \");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString par_1;\r\n\r\n\t\t\t\t\t\t\t\t\tint pos_1;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tpar_1 = parent_1_string[0];\r\n\t\t\t\t\t\t\t\t\tpos_1 = Integer.parseInt(parent_1_string[1]);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t // String [] parent_2_string = randomKey_2.split(\" \");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString par_2;\r\n\r\n\t\t\t\t\t\t\t\t\tint pos_2;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString [] parent_2_string = randomKey_2.split(\" \");\r\n\t\t\t\t\t\t\t\t\tpar_2 = parent_2_string[0];\r\n\t\t\t\t\t\t\t\t\tpos_2 = Integer.parseInt(parent_2_string[1]);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//crossover nbased on probability\r\n\t\t\t\t\t\t\t\t\tRandom rand = new Random();\r\n\t\t\t\t\t\t\t\t\tdouble rdm = Math.random();\t\t \r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t if(rdm < 0.75) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t//single-point crossover\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \t//randomly find a position nad exchange the tails\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\tint parent_1_random = rand.nextInt(R);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t int single_point = parent_1_random; \r\n\t\t\t\t\t\t\t\t\t //exchange elements with parent_2\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t //\tint[][] temporal = new int[pop_num][R];\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t for (int j = 0 ; j < R; j++) {\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t\t \tv[pos_1][j] = x[pos_1][j];\r\n\t\t\t\t\t\t\t\t\t \tv[pos_2][j] = x[pos_2][j];\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t int s = single_point;\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t while (s <= R) {\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t\t//switch the tails of parent one and parent two\r\n\t\t\t\t\t\t\t\t\t \tv[pos_1][s] = x[pos_2][s];\r\n\t\t\t\t\t\t\t\t\t \tv[pos_2][s] = x[pos_1][s];\r\n\r\n\t\t\t\t\t\t\t\t \t s++;\r\n\t\t\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t \t Random mut = new Random();\r\n\t\t\t\t\t\t\t\t\t\tdouble mutate = Math.random();\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t if(mutate < (1/R)) { \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t int child_1 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \tint child_2 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \tv[pos_1][child_1] = (int)(Math.random()*((ub[child_1] - lb[child_1])+1))+ lb[child_1];\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \tv[pos_2][child_2] = (int)(Math.random()*((ub[child_2] - lb[child_2])+1))+ lb[child_2]; \r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t else {\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t offspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t offspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t \t\tfor (int j = 0 ; j < R; j++) {\r\n\t\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t\t \t\tv[pos_1][j] = x[pos_1][j];\r\n\t\t\t\t\t\t\t\t\t \t\tv[pos_2][j] = x[pos_2][j];\r\n\t\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t\tdouble mutate = Math.random();\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t if(mutate < (1/R)) { \r\n\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t int child_1 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \tint child_2 = (int) (Math.random() * R);\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \tv[pos_1][child_1] = (int)(Math.random()*((ub[child_1] - lb[child_1])+1))+ lb[child_1];\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_1);\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \tv[pos_2][child_2] = (int)(Math.random()*((ub[child_2] - lb[child_2])+1))+ lb[child_2]; \r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \toffspring_population.add(\"child\" + \" \" + pos_2);\r\n\t\t\t\t\t\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t \t}\r\n\t\t\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int i_ = 0; i_ < offspring_population.size(); i_++) {// initialize the population with the dimension of R values/inputs\r\n\t\t\t\t\t\r\n\t\t\t\t\t String [] get_index = offspring_population.get(i_).split(\"\");\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t String off_1;\r\n\r\n\t\t\t\t\t\tint index_1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toff_1 = get_index[0];\r\n\t\t\t\t\t\tindex_1 = Integer.parseInt(get_index[1]);\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t\tgetfinalpath = pathnum(v[index_1]); //get path traversed by offspring test case \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tarchiving( getfinalpath , i_, v);//add test case to archive\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t //match the paths traversed\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t\t\tcrossover_count++;\r\n\t\t\t\t\r\n\t\t\t\t\t//combined_population_list.addAll(parents_population_copy);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i = 0; i < offspring_population.size(); i++) // add all offpsings to parent and form final combined population\r\n\t\t\t\t\t{\r\n\t\t\t\r\n\t\t\t\t\t\t\tcombined_population_list.add(offspring_population.get(i));\r\n\t\t\t\t }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tList<String> final_combined_population = new ArrayList<String>();\r\n\r\n\t\t\t\t\t// temp.clear();\r\n\r\n\t\t\t\t\tfinal_combined_population.addAll(combined_population_list);\t\r\n\t\t\t\t\t\r\n\t\t\t\t//fit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t//evaluate parent and child population\r\n\t\t\t\t\tArrayList <String> offspring_fitness = new ArrayList<String>();\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i = 0; i < final_combined_population.size(); i++) // contains both parent and offspring test cases\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\r\n String checkString = final_combined_population.get(i);\t\r\n \r\n String [] getType = checkString.split(\" \");\r\n \r\n\t\t\t\t\t\tString typeName = getType[0];\r\n\r\n\t\t\t\t\t\tint typeId = Integer.parseInt(getType[1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//\tfit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (typeName.equals(\"parent\")) {\r\n\r\n\t\t\t\t\t \toffspring_fitness = benchmarkfunction(x[typeId]);\r\n\t\t\t\t\t \t//extract path and fitness\r\n\t\t\t\t\t \tcheck_fitness.put( \"parent\" + \" \" + typeId , offspring_fitness);\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \t//static LinkedHashMap<String, ArrayList<String>> check_fitness = new LinkedHashMap<String, ArrayList<String>>();\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t \r\n\t\t\t\t\t\telse {\r\n//\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//fit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\toffspring_fitness = benchmarkfunction(v[typeId]);\r\n\t\t\t\t\t\t\tcheck_fitness.put( \"child\" + \" \" + typeId , offspring_fitness);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tint colum_sizes = 0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor ( String get_keys : check_fitness.keySet() ) {\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcolum_sizes = ( check_fitness.get(get_keys).size());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//process remove_objective_routine\r\n\t\t\t\t\t//process map first\r\n\t\t\t\t\t//static LinkedHashMap<String, ArrayList<String>> check_fitness = new LinkedHashMap<String, ArrayList<String>>();\r\n\t\t\t\t\tList<String> average_calculator = new ArrayList<String>();\r\n\t\t\t\t\t\r\n\t\t\t\t//\tint offspring_fitness_size = offspring_fitness.size();\r\n\t\t\t\t\r\n\t\t\t\t//\tIterator<Map.Entry<String, ArrayList<String>>> iteration_ = check_fitness.entrySet()\r\n\t\t\t\t\t\t\t//.iterator();\r\n\t\t\t\t\tString actualpath = \"\";\r\n\t\t\t\t\tString process_1 = \"\";\r\n\t\t\t\t\tString process_2 = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t//String updated_value_2 = \"\";\r\n\t\t\t\t\t//\"child\" + \" \" + typeId , offspring_fitness\r\n\t\t\t\t\t//String updated_value = \"\";\r\n\t\t\t\t\t\r\n//\t\t\t\t\tfit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\tint pid = 0;\t\t\r\n\t\t\t\t\t\r\n\t\t\tfor (int i = 0 ; i < colum_sizes; i++ )\t{\r\n\t\t\t\t\t\r\n\t\t\t\tdouble add_objective_scores = 0.0;\r\n\t\t\t\tdouble sum_at_column = 0.0;\r\n\r\n\t\t\t\tfor ( String get_keys : check_fitness.keySet() ) {\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n // int pid = 0;\r\n \r\n\t\t\t\t\t\t//Map.Entry<String, ArrayList<String>> entry = iteration_.next();\r\n\r\n\t\t\t\t\t\taverage_calculator = check_fitness.get(get_keys);\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//entry.getValue();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString get_objective_score = average_calculator.get(i);\r\n\t\t\t \r\n\t\t\t //calculate average fitness\r\n\t\t\t \r\n\t\t\t\t\t\t//\tupdated_population.add(entry.getKey());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//50 is the number of test cases\r\n\t\t\t\t\t\t//while (pid < 50) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t///String checkString = final_combined_population.get(i);\t\r\n\t \r\n\t String [] getDetails = get_objective_score.split(\" \");\r\n\t\t\t\t\t\t actualpath = getDetails[0];\r\n double objective_scores = Double.parseDouble(getDetails[1]);\r\n \r\n add_objective_scores = add_objective_scores + objective_scores ;\r\n \r\n //total fitness at colum i\r\n sum_at_column = (add_objective_scores / check_fitness.size());\r\n //get total fitness \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//int old_value = remove_objective[actualpath]\r\n\t\t\t\t\t//if(remove_objective.contiansKey(actualpath))\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\tfor ( String entry_1 : target_subset.keySet() ) {\t//update path status\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif (entry_1.equals(actualpath)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t String [] processPath = actualpath.split(\" \");\r\n\t\t\t\t\t\t\t process_1 = processPath[0];\r\n\t\t\t\t\t\t\t process_2 = processPath[1];\r\n\t\t\t\t\t\t\t \r\n\t //Double objective_scores = Double.parseDouble(getDetails[1]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (process_2.equals(\"new\")) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\ttarget_subset.put(process_1 + \" \" + \"old\" , false );\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tremove_objective.put( actualpath, sum_at_column);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//remove_objective.put( actualpath, max_1 + \" \" + add_objective_scores );\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble previous_value = remove_objective.get(actualpath);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//double get_First = Double.parseDouble(get_Path[0]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//double get_Second = Double.parseDouble(get_Path[1]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ( previous_value > sum_at_column ) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tremove_objective.put( actualpath, sum_at_column);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// Update status to true\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\ttemporary_path_holder.add(actualpath); \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tpaths.put(actualpath, true);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\ttarget_subset.remove(actualpath);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tArrayList<String> remove_objectives_1 = new ArrayList<String>();\r\n\t\t\t\r\n\t\t\tfor ( String entry_2 : check_fitness.keySet() ) {\t//process test case // update their fitness vectors by deleting the removed objectives\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tString [] process_to_remove = entry_2.split(\" \");\r\n\t\t\t\t\r\n\t\t\t\tString processes_1 = process_to_remove[0];\r\n\t\t\t\tint index_2 = Integer.parseInt(process_to_remove[1]);\r\n\t\t\t\t\r\n\t\t\t\tremove_objectives_1 = check_fitness.get(entry_2);\r\n\t\t\t\t\r\n\t\t\t\tfor (int i = 0; i < remove_objectives_1.size(); i++) // process the fitness vector and delete the worst values\r\n\t\t\t\t{\r\n\t\t\t\t\t//fit.add(target_path_+ \" \" + path_status +\" \" + nonsimple_unmatched2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//target_subset.remove(actualpath);\r\n\t\t\t\t\t//temporary_path_holder.add(actualpath); \r\n\t\t\t\t\t\r\n\t\t\t\t\tString [] process_paths_to_remove = remove_objectives_1.get(i).split(\" \");\r\n\t\t\t\t\t\r\n\t\t\t\t\tString process_path_1 = process_paths_to_remove[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (temporary_path_holder.contains(process_path_1) ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tremove_objectives_1.remove(process_path_1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcheck_fitness.put( processes_1 + \" \" + index_2, remove_objectives_1);\r\n\t\t\t\t\r\n\t\t\t\tremove_objectives_1.clear( );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//target_subset.put(process_1 + \" \" + \"old\" , false );\r\n\t\t\t\r\n\t\t\t Set<String> remainingPath = target_subset.keySet();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\tfor (String keyss : remainingPath) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t String [] get_Remaining = keyss.split(\" \");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t String remaining_1 = get_Remaining[0];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t still_remaining_targets.add(remaining_1); //back-up set of remaining targets\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t \r\n\t\t\t\t\t\r\n\t\t\t\tif (target_subset.size()!=0)\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tif ((obj_total) == PATHNUM_NUMBER ) { // if all paths covered break out of while loop\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t if ((obj_total) < PATHNUM_NUMBER ) { // if not all paths covered perform\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t if ((target_subset.size() == 1)) { \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t \t\r\n\t\t\t\t \t LinkedHashMap<String, ArrayList<Double>> updated_maps_ = new LinkedHashMap<String, ArrayList<Double>>();\r\n\t\t\t\t \t\r\n\t\t\t\t\t ArrayList<String> updated_fit_ = new ArrayList<String>();\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t ArrayList<Double> updated_1 = new ArrayList<Double>();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \tfor ( String key_10 : check_fitness.keySet() ) {\r\n\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_fit_ = check_fitness.get(key_10);\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tfor (int r= 0; r < updated_fit_.size(); r++) {\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t String [] get_list = updated_fit_.get(r).split(\" \");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t double objective_score = Double.parseDouble(get_list[2]);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t updated_1.add(objective_score);\r\n\t\t\t\t\t \t\t}\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_maps_.put(key_10, updated_1);\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_fit_.clear();\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_1.clear();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t \t\r\n\t\t\t\t \t\r\n\t\t\t\t \tint counter = 0;\r\n\t\t\t\t\t\t\twhile (counter < 50) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t List<Double> value_holder = new ArrayList<Double>();\r\n\t\t\t\t\t\t\t\t List<String> keys = new ArrayList<String>(updated_maps_.keySet());\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t Random rand = new Random();\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t String key_ss = keys.get(rand.nextInt(keys.size()));\r\n\t\t\t\t\t\t\t\t String key_holder = null;\r\n\t\t\t\t\t\t\t\t value_holder.addAll(updated_maps_.get(key_ss));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t double min = value_holder.get(0);\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t value_holder.clear();\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t for (int i = 1 ; i < 10; i++) {\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t String key = keys.get(rand.nextInt(keys.size()));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t value_holder.addAll(updated_maps_.get(key));\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t double checker = value_holder.get(0);\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t if (checker < min) {\r\n\t\t\t\t\t\t min = checker;\r\n\t\t\t\t\t\t key_holder = key;\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t value_holder.clear();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t parents_population_copy.add(key_holder);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t \t\r\n\t\t\t\t \t\r\n\t\t\t\t\t\r\n\t\t\t\t\t statusChecker = true;\r\n\t\t\t\t }//if only one uncovered path\r\n\t\t\t\t\t\t\r\n\t\t\t\t else { \r\n\t\t\t\t\t if (target_subset.size() > 1) { //if many remaining uncovered paths\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t LinkedHashMap<String, ArrayList<Double>> updated_maps = new LinkedHashMap<String, ArrayList<Double>>();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t ArrayList<String> updated_fit = new ArrayList<String>();\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t ArrayList<Double> updated_ = new ArrayList<Double>();\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \tfor ( String key_10 : check_fitness.keySet() ) {\r\n\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_fit = check_fitness.get(key_10);\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tfor (int r= 0; r < updated_fit.size(); r++) {\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t\t\t\t\t String [] get_list = updated_fit.get(r).split(\" \");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t double objective_score = Double.parseDouble(get_list[2]);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t updated_.add(objective_score);\r\n\t\t\t\t\t \t\t}\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_maps.put(key_10, updated_);\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_fit.clear();\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\tupdated_.clear();\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t //updated_maps.put(key_10, updated_); perform preference sorting on this map\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t \tint updated_sizes = 0;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor ( String get_keys : updated_maps.keySet() ) {\t\r\n\t\t\t\t\t\t\t\t\t updated_sizes = ( updated_maps.get(get_keys).size());\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t} \t\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tDouble[][] offspring_fitness_full = new Double[final_combined_population\r\n\t\t\t\t\t\t\t\t\t.size()][updated_sizes]; // n x m matrix of combined parents and offspring test cases\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint updates = 0;\r\n\r\n\t\t\t\t\t\t\t// List<String> traverse_group = new ArrayList<String>();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//List<String> best_column = new ArrayList<String>();\r\n\t\t\t\t\t\t\tint fitss = 0;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile (updates < final_combined_population.size()) {\r\n\r\n\t\t\t\t\t\t\t\tList<Double> fitness_objectives_updated = new ArrayList<Double>();\r\n\t\t\t\t\t\t\t\t// fitness_objectives_updated.clear();\r\n\r\n\t\t\t\t\t\t\t\tfitness_objectives_updated = (updated_maps.get(final_combined_population.get(updates)));\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\tList<Double> temp_3 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t// temp.clear();\r\n\r\n\t\t\t\t\t\t\t\ttemp_3.addAll(fitness_objectives_updated);\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor (int ups = 0; ups < temp_3.size(); ups++) {\r\n\r\n\t\t\t\t\t\t\t\t\toffspring_fitness_full[updates][ups] = fitness_objectives_updated.get(ups);\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tfitness_objectives_updated.clear();\r\n\t\t\t\t\t\t\t\tupdates++;\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t \t//check if paths is covered , plus check replaced status\r\n\t\t\t \t// average objective score calculation.....\r\n\t\t\t\t\t\t\t// removing objectives\r\n\t\t\t\t\t\t\t// check current generation vs previous generation\r\n\t\t\t \t// update replaced status in main set of uncovered paths\r\n\t\t\t \r\n\t\t\t \t\r\n\t\t\t \t// update population by replacing the other targets\r\n\t\t\t \t\r\n\t\t\t \t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tList<String> best_column = new ArrayList<String>();\r\n\t\t\t\t\r\n\t\t\t\t\t\t\tint sizes = temp_2.size();\r\n\r\n\t\t\t\t\t\t\t//double row_fit;\r\n\t\t\t\t\t\t\tint colums = 0;\r\n\t\t\t\t\t\t\tString test_case;\r\n\t\t\t\t\t\t\tdouble fit_rowfit;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\tLinkedHashMap<String, Double> row_getter = new LinkedHashMap<String, Double>();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile (colums < sizes) {\r\n\r\n\t\t\t\t\t\t\t\tfor (int get_row = 0; get_row < (final_combined_population.size()); get_row++) {\r\n\r\n\t\t\t\t\t\t\t\t\tfit_rowfit = (offspring_fitness_full[get_row][colums]);\r\n\r\n\t\t\t\t\t\t\t\t\tdouble row_fitter = fit_rowfit;\r\n\r\n\t\t\t\t\t\t\t\t\trow_getter.put(final_combined_population.get(get_row), row_fitter);\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tMap<String, Double> result = row_getter.entrySet().stream() //get test case with minimum objective score for each objective\r\n\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.comparingByValue())\r\n\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t(oldValue, newValue) -> oldValue, LinkedHashMap::new));\r\n\t\t\t\t\t\t\t\t// System.out.println(\"Map yino\" +result );\r\n\r\n\t\t\t\t\t\t\t\tIterator<Map.Entry<String, Double>> best_col = result.entrySet().iterator();\r\n\r\n\t\t\t\t\t\t\t\twhile (best_col.hasNext()) {\r\n\r\n\t\t\t\t\t\t\t\t\tMap.Entry<String, Double> entry = best_col.next();\r\n\r\n\t\t\t\t\t\t\t\t\ttest_case = entry.getKey();\r\n\r\n\t\t\t\t\t\t\t\t\tif (!best_column.contains(test_case)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tbest_column.add(test_case);\r\n\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tresult.clear();\r\n\t\t\t\t\t\t\t\trow_getter.clear();\r\n\t\t\t\t\t\t\t\tcolums++;\r\n\r\n\t\t\t\t\t\t\t}\r\n \r\n\t\t\t\t\t\t\t//Go straight to computing crowding distance for Font 0\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint distance_zero;\r\n\r\n\t\t\t\t\t\t\t/************************************************************************************************************************************************************/\r\n\r\n\t\t\t\t\t\t\tdouble[][] distance_matrix_zero = new double[best_column.size()][best_column.size()];\r\n\r\n\t\t\t\t\t\t\tif ((best_column.size()) > 1) {\r\n\r\n\t\t\t\t\t\t\t\tfor (int best = 0; best < (best_column.size()); best++) {\r\n\r\n\t\t\t\t\t\t\t\t\tList<Double> front_0_1 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\tfront_0_1 = updated_maps.get(best_column.get(best));\r\n\r\n\t\t\t\t\t\t\t\t\tfor (int ind_d = 0; ind_d < best_column.size(); ind_d++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (!((best_column.get(best).equals(best_column.get(ind_d))))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tList<Double> front_0_2 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfront_0_2 = updated_maps.get(best_column.get(ind_d));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tdistance_zero = get_count(front_0_1, front_0_2);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tint temp_dis = distance_zero;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tdistance_matrix_zero[best][ind_d] = temp_dis;\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tLinkedHashMap<String, Double> setdistance_zero_2 = new LinkedHashMap<String, Double>();\r\n\r\n\t\t\t\t\t\t\t\tfor (int font_ = 0; font_ < best_column.size(); font_++) {\r\n\r\n\t\t\t\t\t\t\t\t\tdouble zeros = 0.0;\r\n\r\n\t\t\t\t\t\t\t\t\tsetdistance_zero_2.put(best_column.get(font_), zeros);\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tfor (int font_i = 0; font_i < (best_column.size()); font_i++) {\r\n\r\n\t\t\t\t\t\t\t\t\tfor (int font_j = 0; font_j < best_column.size(); font_j++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (!((best_column.get(font_i).equals(best_column.get(font_j))))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (setdistance_zero_2.get(best_column\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.get(font_i)) < distance_matrix_zero[font_i][font_j]) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tdouble dis = (distance_matrix_zero[font_i][font_j]);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetdistance_zero_2.put(best_column.get(font_i), dis);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tMap<String, Double> result = setdistance_zero_2.entrySet().stream()\r\n\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.comparingByValue())\r\n\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t(oldValue, newValue) -> oldValue, LinkedHashMap::new));\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor (Map.Entry<String, Double> entry : result.entrySet()) {\r\n\r\n\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) { //updated_population holds the selected population for next generation\r\n\t\t\t\t\t\t\t\t\t\tupdated_population.add(entry.getKey());\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tresult.clear();\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//updated population has best performing test cases sorted in descending order\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\telse { // process the only item in the best set\r\n\r\n\t\t\t\t\t\t\t\tif (!best_column.isEmpty()) {\r\n\r\n\t\t\t\t\t\t\t\t\tString item_one = best_column.get(0);\r\n\r\n\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tupdated_population.add(item_one);\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t//Establish other fonts\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tList<String> fitness_objectives_comparator = new ArrayList<String>();\r\n\t\t\t\t\t\t\t// List<Double> fitness_objectives_p = new ArrayList<Double>();\r\n\t\t\t\t\t\t\t// List<Double> fitness_objectives_q= new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\tfor (int next_front = 0; next_front < final_combined_population.size(); next_front++) {\r\n\r\n\t\t\t\t\t\t\t\tif (!best_column.contains(final_combined_population.get(next_front))) {\r\n\r\n\t\t\t\t\t\t\t\t\tfitness_objectives_comparator.add(final_combined_population.get(next_front));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ((fitness_objectives_comparator.size()) > 1) {\r\n\r\n\t\t\t\t\t\t\t\tint[] dominateMe = new int[fitness_objectives_comparator.size()];\r\n\r\n\t\t\t\t\t\t\t\t// front[i] contains the list of individuals belonging to the front i\r\n\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\t\tList<Integer>[] front = new List[(fitness_objectives_comparator.size() + 1)];\r\n\r\n\t\t\t\t\t\t\t\t// iDominate[k] contains the list of solutions dominated by k\r\n\r\n\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\t\tList<Integer>[] iDominate = new List[fitness_objectives_comparator.size()];\r\n\r\n\t\t\t\t\t\t\t\tint flagDominate;\r\n\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < ((front.length)); i++) {\r\n\t\t\t\t\t\t\t\t\tfront[i] = new LinkedList<Integer>();\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tfor (int p = 0; p < fitness_objectives_comparator.size(); p++) {\r\n\t\t\t\t\t\t\t\t\t// Initialize the list of individuals that i dominate and the number\r\n\t\t\t\t\t\t\t\t\t// of individuals that dominate me\r\n\t\t\t\t\t\t\t\t\tiDominate[p] = new LinkedList<Integer>();\r\n\t\t\t\t\t\t\t\t\tdominateMe[p] = 0;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// int secondary_size =0 ;\r\n\t\t\t\t\t\t\t\tint N = fitness_objectives_comparator.size();\r\n\t\t\t\t\t\t\t\t// int[][] dominanceChecks = new int[N][N];\r\n\r\n\t\t\t\t\t\t\t\tfor (int p = 0; p < (N - 1); p++) {\r\n\r\n\t\t\t\t\t\t\t\t\tList<Double> fitness_temporary_p = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\tfitness_temporary_p = updated_maps.get((fitness_objectives_comparator.get(p)));\r\n\r\n\t\t\t\t\t\t\t\t\t// secondary_size = fitness_temporary_p.size();\r\n\r\n\t\t\t\t\t\t\t\t\tfor (int q = p + 1; q < N; q++) {\r\n\t\t\t\t\t\t\t\t\t\t// if (p != q) {\r\n\t\t\t\t\t\t\t\t\t\tList<Double> fitness_temporary_q = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\tfitness_temporary_q = updated_maps\r\n\t\t\t\t\t\t\t\t\t\t\t\t.get((fitness_objectives_comparator.get(q)));\r\n\r\n\t\t\t\t\t\t\t\t\t\tflagDominate = frontdominace_Comparison(fitness_temporary_p,\r\n\t\t\t\t\t\t\t\t\t\t\t\tfitness_temporary_q);\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (flagDominate == -1) {\r\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"p---dominates>>>>>\" );\r\n\t\t\t\t\t\t\t\t\t\t\tiDominate[p].add(q);\r\n\t\t\t\t\t\t\t\t\t\t\tdominateMe[q]++;\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\telse if (flagDominate == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"q---dominates>>>>>\" );\r\n\t\t\t\t\t\t\t\t\t\t\tiDominate[q].add(p);\r\n\t\t\t\t\t\t\t\t\t\t\tdominateMe[p]++;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tList<Double> fitness_temporary_qq = new ArrayList<Double>();\r\n\t\t\t\t\t\t\t\t\t\t\tList<Double> fitness_temporary_pp = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tCollections.sort(fitness_temporary_p);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfitness_temporary_pp.addAll(fitness_temporary_p);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tCollections.sort(fitness_temporary_q);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfitness_temporary_qq.addAll(fitness_temporary_q);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (fitness_temporary_pp.get(0) < fitness_temporary_qq.get(0)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"p---dominates>>>>>\" );\r\n\t\t\t\t\t\t\t\t\t\t\t\tiDominate[p].add(q);\r\n\t\t\t\t\t\t\t\t\t\t\t\tdominateMe[q]++;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\telse if (fitness_temporary_qq.get(0) < fitness_temporary_pp.get(0)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"q---dominates>>>>>\" );\r\n\t\t\t\t\t\t\t\t\t\t\t\tiDominate[q].add(p);\r\n\t\t\t\t\t\t\t\t\t\t\t\tdominateMe[p]++;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tfor (int p = 0; p < ((fitness_objectives_comparator.size())); p++) {\r\n\r\n\t\t\t\t\t\t\t\t\tif (dominateMe[p] == 0) {\r\n\t\t\t\t\t\t\t\t\t\tfront[0].add(p);\r\n\r\n\t\t\t\t\t\t\t\t\t\t// setrank.put(Integer.parseInt(fitness_objectives_comparator.get(p)), 1);\r\n\t\t\t\t\t\t\t\t\t\tint val = 0;\r\n\t\t\t\t\t\t\t\t\t\tsetrank1.put(fitness_objectives_comparator.get(p), val);\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n/*****************************************************************************************************************************************************************************************/\r\n\r\n\t\t\t\t\t\t\t\tint font_s = 0;\r\n\t\t\t\t\t\t\t\t// if((front[font_s].size() != 0)) {\r\n\r\n\t\t\t\t\t\t\t\tIterator<Integer> it1, it2; // Iterators\r\n\t\t\t\t\t\t\t\twhile (front[font_s].size() != 0) {\r\n\t\t\t\t\t\t\t\t\t/// System.out.println(\"we got here\" + front[font_s]);\r\n\t\t\t\t\t\t\t\t\tfont_s++;\r\n\t\t\t\t\t\t\t\t\tit1 = front[font_s - 1].iterator();\r\n\t\t\t\t\t\t\t\t\twhile (it1.hasNext()) {\r\n\t\t\t\t\t\t\t\t\t\tit2 = iDominate[(it1.next())].iterator();\r\n\t\t\t\t\t\t\t\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\t\t\t\t\t\t\t\tint index = it2.next();\r\n\t\t\t\t\t\t\t\t\t\t\tdominateMe[index]--;\r\n\t\t\t\t\t\t\t\t\t\t\tif (dominateMe[index] == 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tfront[font_s].add(index);\r\n\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"Block_1: \" +front[font_s]);\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetrank1.put(fitness_objectives_comparator.get(index), font_s);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tLinkedHashMap<String, Double> setdistance = new LinkedHashMap<String, Double>();\r\n\r\n\t\t\t\t\t\t\t\tLinkedHashMap<String, Double> setdistance_one = new LinkedHashMap<String, Double>();\r\n\r\n\t\t\t\t\t\t\t\tMap<Integer, ArrayList<String>> reverseMap = new HashMap<>();\r\n\r\n\t\t\t\t\t\t\t\tfor (Map.Entry<String, Integer> entry : setrank1.entrySet()) {\r\n\t\t\t\t\t\t\t\t\tif (!reverseMap.containsKey(entry.getValue())) {\r\n\t\t\t\t\t\t\t\t\t\treverseMap.put(entry.getValue(), new ArrayList<>());\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tArrayList<String> keys = reverseMap.get(entry.getValue());\r\n\t\t\t\t\t\t\t\t\tkeys.add(entry.getKey());\r\n\t\t\t\t\t\t\t\t\treverseMap.put(entry.getValue(), keys);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t// process fonts\r\n\r\n\t\t\t\t\t\t\t\tint smaller;\r\n\t\t\t\t\t\t\t\tint smaller_one;\r\n\t\t\t\t\t\t\t//\tint remaining;\r\n\t\t\t\t\t\t\t\t// int smaller_two;\r\n\r\n\t\t\t\t\t\t\t\tint fronts = 0;\r\n\t\t\t\t\t\t\t\t// System.out.println(\"map's size\" + reverseMap.size());\r\n\t\t\t\t\t\t\t\twhile (fronts < (reverseMap.size())) {\r\n\r\n\t\t\t\t\t\t\t\t\t// if (updated_population.size()== pop_num) {\r\n\t\t\t\t\t\t\t\t\t// break;\r\n\t\t\t\t\t\t\t\t\t// }\r\n\r\n\t\t\t\t\t\t\t\t\tif (fronts != (reverseMap.size() - 1)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tList<String> front_list = new ArrayList<String>();\r\n\r\n\t\t\t\t\t\t\t\t\t\tfront_list = reverseMap.get(fronts);\r\n\r\n\t\t\t\t\t\t\t\t\t\tif ((front_list.size()) > 1) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tdouble[][] distance_matrix = new double[front_list.size()][front_list\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.size()];\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int ind_d = 0; ind_d < (front_list.size()); ind_d++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tList<Double> front_getter1 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tfront_getter1 = updated_maps.get((front_list.get(ind_d)));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int d = 0; d < front_list.size(); d++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!(front_list.get(ind_d).equals(front_list.get(d)))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tList<Double> front_getter2 = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfront_getter2 = updated_maps.get((front_list.get(d)));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsmaller = get_count(front_getter1, front_getter2);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tint sma = smaller;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdistance_matrix[ind_d][d] = sma;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int font_ = 0; font_ < front_list.size(); font_++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tdouble valz = 0.0;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetdistance.put(front_list.get(font_), valz);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// all distances set\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int font_i = 0; font_i < (front_list.size()); font_i++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// distance_matrix\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int font_j = 0; font_j < front_list.size(); font_j++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!(front_list.get(font_i).equals(front_list.get(font_j)))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (setdistance.get(front_list\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(font_i)) < distance_matrix[font_i][font_j]) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdouble dist = (distance_matrix[font_i][font_j]);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetdistance.put(front_list.get(font_i), dist);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tMap<String, Double> result = setdistance.entrySet().stream()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.comparingByValue())\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(oldValue, newValue) -> oldValue, LinkedHashMap::new));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tIterator<Map.Entry<String, Double>> iteration = result.entrySet()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.iterator();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\twhile (iteration.hasNext()) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tMap.Entry<String, Double> entry = iteration.next();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tupdated_population.add(entry.getKey());\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tresult.clear();\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tString best_1;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tbest_1 = front_list.get(0);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (updated_population.size() < (pop_num)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tupdated_population.add(best_1);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif (fronts == (reverseMap.size() - 1)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tList<String> front_list_one = new ArrayList<String>();\r\n\r\n\t\t\t\t\t\t\t\t\t\tfront_list_one = reverseMap.get(reverseMap.size() - 1);\r\n\r\n\t\t\t\t\t\t\t\t\t\t// System.out.println(\"hahahq\" +front_list_one);\r\n\r\n\t\t\t\t\t\t\t\t\t\tdouble[][] distance_matrix_one = new double[front_list_one\r\n\t\t\t\t\t\t\t\t\t\t\t\t.size()][front_list_one.size()];\r\n\r\n\t\t\t\t\t\t\t\t\t\tfor (int ind_w = 0; ind_w < (front_list_one.size()); ind_w++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tList<Double> front_getter_one = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfront_getter_one = updated_maps.get((front_list_one.get(ind_w)));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int dw = 0; dw < front_list_one.size(); dw++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!(front_list_one.get(ind_w).equals(front_list_one.get(dw)))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tList<Double> front_getter_two = new ArrayList<Double>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfront_getter_two = updated_maps.get((front_list_one.get(dw)));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsmaller_one = get_count(front_getter_one, front_getter_two);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tint sm = smaller_one;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdistance_matrix_one[ind_w][dw] = sm;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tfor (int font_ = 0; font_ < front_list_one.size(); font_++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tdouble dit = 0.0;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tsetdistance_one.put(front_list_one.get(font_), dit);\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// all distances set\r\n\r\n\t\t\t\t\t\t\t\t\t\tfor (int font_i = 0; font_i < (front_list_one.size()); font_i++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int font_j = 0; font_j < front_list_one.size(); font_j++) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!(front_list_one.get(font_i)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.equals(front_list_one.get(font_j)))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (setdistance_one.get(front_list_one\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.get(font_i)) < distance_matrix_one[font_i][font_j]) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdouble dst = (distance_matrix_one[font_i][font_j]);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetdistance_one.put(front_list_one.get(font_i), dst);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\tint remaining_ = (pop_num - updated_population.size());\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (setdistance_one.size() <= remaining_) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tMap<String, Double> result = setdistance_one.entrySet().stream()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.comparingByValue())\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(oldValue, newValue) -> oldValue, LinkedHashMap::new));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tIterator<Map.Entry<String, Double>> iteration = result.entrySet()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.iterator();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\twhile (iteration.hasNext()) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tMap.Entry<String, Double> entry = iteration.next();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tupdated_population.add(entry.getKey());\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t// System.out.println( \"remaining---\" +remaining);\r\n\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tMap<String, Double> sortedByValueDesc = setdistance_one.entrySet()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.stream()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.sorted(Map.Entry.<String, Double>comparingByValue().reversed())\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.collect(toMap(Map.Entry::getKey, Map.Entry::getValue,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(e1, e2) -> e1, LinkedHashMap::new));\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tList<String> front_remove = new ArrayList<String>();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tSet<String> keytest = sortedByValueDesc.keySet();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tint final_size = sortedByValueDesc.size();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// while(sortedByValueDesc.size() > remaining) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (String keysss : keytest) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (final_size > remaining_) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfront_remove.add(keysss);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\tfinal_size--;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println( \"sorted map after---\" +sortedByValueDesc.size());\r\n\t\t\t\t\t\t\t\t\t\t\tSet<String> keytests = sortedByValueDesc.keySet();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tfor (String key_sss : keytests) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!front_remove.contains(key_sss)) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdated_population.add(key_sss);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tsetdistance.clear();\r\n\t\t\t\t\t\t\t\t\tsetdistance_one.clear();\r\n\r\n\t\t\t\t\t\t\t\t\tfronts++;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tif (!fitness_objectives_comparator.isEmpty()) {\r\n\r\n\t\t\t\t\t\t\t\t\tif (updated_population.size() < pop_num) {\r\n\r\n\t\t\t\t\t\t\t\t\t\tString get_item = (fitness_objectives_comparator.get(0));\r\n\r\n\t\t\t\t\t\t\t\t\t\tupdated_population.add(get_item);\r\n\r\n\t\t\t\t\t\t\t\t\t}\r\n}\r\n}\r\n}}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcatch(IndexOutOfBoundsException e) {}\r\n\r\n\t\t\t\t\t\t\t//updated_population.clear();\r\n\t\t\t\t\t\t\tcombined_population.clear();\r\n\t\t\t\t\t\t\t//combined_population2.clear();\r\n\t\t\t\t\t\t\tsetrank1.clear();\r\n\t\t\t\t\t\t\t//setrank2.clear();\r\n\t\t\t\t\t\t\t//setrank3.clear();\r\n\t\t\t\t\t\t\tcombined_maps.clear();\r\n\t\t\t\t\t\t\t//child_maps.clear();\r\n\r\n\t\t\t\t\t\t\r\n Set<String> add_target = paths.keySet();\r\n\t \t\r\n\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t \tint true_count = 0;\r\n\t \t// get status of removal\r\n\t \tfor (String key_ss : add_target) { \r\n\t \t\r\n\t \t//pick path whose status is false\r\n\t \t\tif ( paths.get(key_ss) ){\r\n\t \t\t\t\r\n\t \t\t\t true_count++;\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\telse {\r\n\t \t\t\t\r\n\t \t\t\tbreak;\r\n\t \t\t}\r\n\t \t \t \r\n\t \t} \r\n\t \t\r\n\t \tif ( true_count == paths.size() ) {\r\n\t \t\t\r\n\t \t\t//if all paths have true as replaced status\r\n\t \t\t\r\n\t \t\t//set them to false\r\n\t \t\t\r\n\t \t\t//pick subset of paths not previously removed at previous generation\r\n\t \t\r\n\t \t\tSet<String> add_new_entry = paths.keySet();\r\n\t \t \t\r\n\t \t \t//replaced_status_2.put(id + new String(str), false);\r\n\t \t \tint entry_count = 0;\r\n\t \t \t// get status of removal\r\n\t \t \tfor (String enrty_ss : add_new_entry ) { \r\n\t \t\t\r\n\t \t \t\t paths.put(enrty_ss , false);\r\n\t \t \t\t\r\n\t \t \t}\r\n\t \t \t\r\n\t \t \tif (paths.size() > 50) {\r\n\t \t \t\r\n\t \t \tint counter_add_paths = 0;\r\n\t \t \t\t\r\n Set<String> add_target_from_Path_1 = paths.keySet();\r\n\t\t \t\r\n\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t \t\r\n\t\t \t// get status of removal\r\n\t\t \t for (String from_Path_1: add_target_from_Path_1) {\r\n\t \t \t\r\n\t \t \t\r\n\t \t \t\r\n\t \t\t if (still_remaining_targets.contains(from_Path_1) ) {\r\n\t \t \t\t\r\n\t \t \t\t continue;\r\n\t \t \t }\r\n\t \t\t\r\n\t \t\t else {\r\n\t \t\t\t \r\n\t \t\t\t \r\n\t \t\t\t if (counter_add_paths < 50) {\r\n\t \t\t\t\r\n\t \t\t\t if ( !temporary_path_holder.contains(from_Path_1) ){\r\n\t \t \t \t\t\r\n\t \t\t\t\t target_subset.put(from_Path_1 + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t \t\t\t\t counter_add_paths++;\r\n\t \t\t\t\t \r\n\t \t\t\t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path_1)..//return test case not previously added to temporary population\r\n\t \t\t\t\t \r\n\t\t \t \t\t}\r\n\t \t\t\t\r\n\t \t\t\t }\r\n\t \t\t\r\n\t \t\t\t\r\n\t \t\t\t\r\n\t \t\t }\r\n\t \t\t \r\n\t\t \t \r\n\t\t \t }\r\n\t \t \t}\r\n\t\t \t \r\n\t\t \t else {\r\n\t\t \t \t \r\n\t\t \t \t \r\n\t\t \t \tSet<String> add_target_from_Path_7 = paths.keySet();\r\n\t\t\t \t\r\n\t\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t\t \t\r\n\t\t\t \t// get status of removal\r\n\t\t\t \t for (String from_Path_7: add_target_from_Path_7) { // contains(Object)\r\n\t\t\t \t\r\n\t\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t\t \t\t\r\n\t\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t\t \t \t\r\n\t\t\t if (still_remaining_targets.contains(from_Path_7) ) {\r\n\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t\t \t \t}\r\n\t\t\t else { \r\n\t \t \t\tif ( !temporary_path_holder.contains(from_Path_7) ){\r\n\t \t \t\t\t\r\n\t \t \t\t\ttarget_subset.put(from_Path_7 + \" \" + \"new\", false);\r\n\t \t \t\t\t\r\n\t \t \t\t\t// retrieve test case from archive\r\n\t \t \t\t// retrieve test case from archive\r\n\t \t \t\t\t//updatePopulation(from_Path_7)..//return test case not previously added to temporary population\r\n\t \t \t\t}}\r\n\t\t \t \t \r\n\t\t\t \t }\t \r\n\t\t \t \t \r\n\t\t \t \t \r\n\t\t \t }\r\n\t }\r\n\t \t\t\r\n\t \telse {\r\n\t \t\t\r\n\t \t\t// pick paths with false status and add them to subset of targets\r\n\t \t\t\r\n\t \t\tint path_to_add_counter = 0;\r\n\t \t\t\r\n\t \tif (paths.size() > 50) {\r\n\t \t\tSet<String> add_target_from_Path = paths.keySet();\r\n\t\t \t\r\n\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t \t\r\n\t\t \t// get status of removal\r\n\t\t \t for (String from_Path: add_target_from_Path) { // contains(Object)\r\n\t\t \t\r\n\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t \t\t\r\n\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t \t \t\r\n\t\t \t \t\tif (still_remaining_targets.contains(from_Path) ) {\r\n\t\t\t\t \t \t\t\r\n\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t \t \t}\r\n\t\t \t \t\t\telse {\t\r\n\t\t \t \t\t\r\n\t\t \t \t\t if (path_to_add_counter < 50) {\r\n\t\t \t \t\t \r\n\t\t \t \t if ( !paths.get(from_Path) && (!temporary_path_holder.contains(from_Path) ) ){\r\n\t\t \t \t\t\r\n\t\t \t \t\t target_subset.put(from_Path + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\tpath_to_add_counter++;\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t// retrieve test case from archive\r\n\t\t \t \t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path)..//return test case not previously added to temporary population\r\n\t\t \t \t\t }\r\n\t\t \t \t\t \r\n\t\t \t \t\t \r\n\t\t \t \t\t}\r\n\t\t \t \t\t\t}\r\n\t\t \t \t}\r\n\t \t}\r\n\t \t\r\n\t \t\r\n\t\t \t else {\r\n\t\t \t \t\t \r\n\t\t \t \t\tSet<String> add_target_from_Path_4 = paths.keySet();\r\n\t\t\t\t \t\r\n\t\t\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t\t\t \t\r\n\t\t\t\t \t// get status of removal\r\n\t\t\t\t \t for (String from_Path_4: add_target_from_Path_4) { // contains(Object)\r\n\t\t\t\t \t\r\n\t\t\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t\t\t \t\t\r\n\t\t\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t\t\t \t \t\r\n\t\t\t\t \r\n\t\t\t\t \t \t\t\tif (still_remaining_targets.contains(from_Path_4) ) {\r\n\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t\t\t \t \t}\r\n\t\t \t \t\t \r\n\t\t\t\t \t \t\t\telse {\r\n\t\t \t \t\t\t\r\n\t\t \t \t\tif ( !paths.get(from_Path_4) && (!temporary_path_holder.contains(from_Path_4) ) ){\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\ttarget_subset.put(from_Path_4 + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path_4)..//return test case not previously added to temporary population\r\n\t\t \t \t\t}}\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t}\r\n\t\t \t \t}\r\n\t\t \t\r\n\t \t}\r\n\t \t\r\n\t \t\r\n\t \tparents_population_copy.clear();\r\n\t \t\r\n\t \tfor (int i = 0; i < 50 ; i++) // updated population \r\n\t \t\t\t{\r\n\r\n\t \t\t\t\t//for (int j = 0; j < R; j++) {\r\n\t \t\t\t\t\r\n\t \t\t\t\t//\tx[i][j] = (int)(Math.random()*((ub[j] - lb[j])+1))+ lb[j];\r\n\r\n\t \t\t\t\t//update set x\r\n\t \t\t\t\tparents_population_copy.add(\"parent\" + \" \" + i);\r\n\t \t\r\n\t \t\r\n\t \t\r\n\t \t\r\n\t\t\t\t}\r\n\t \t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse { //proceed to add paths if subset of target objectives is empty\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n Set<String> add_target = paths.keySet();\r\n\t \t\r\n\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t \tint true_count = 0;\r\n\t \t// get status of removal\r\n\t \tfor (String key_ss : add_target) { \r\n\t \t\r\n\t \t//pick path whose status is false\r\n\t \t\tif ( paths.get(key_ss) ){\r\n\t \t\t\t\r\n\t \t\t\t true_count++;\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\telse {\r\n\t \t\t\t\r\n\t \t\t\tbreak;\r\n\t \t\t}\r\n\t \t \t \r\n\t \t} \r\n\t \t\r\n\t \tif ( true_count == paths.size() ) {\r\n\t \t\t\r\n\t \t\t//if all paths have true as replaced status\r\n\t \t\t\r\n\t \t\t//set them to false\r\n\t \t\t\r\n\t \t\t//pick subset of paths not previously removed at previous generation\r\n\t \t\r\n\t \t\tSet<String> add_new_entry = paths.keySet();\r\n\t \t \t\r\n\t \t \t//replaced_status_2.put(id + new String(str), false);\r\n\t \t \tint entry_count = 0;\r\n\t \t \t// get status of removal\r\n\t \t \tfor (String enrty_ss : add_new_entry ) { \r\n\t \t\t\r\n\t \t \t\t paths.put(enrty_ss , false);\r\n\t \t \t\t\r\n\t \t \t}\r\n\t \t \t\r\n\t \t \tif (paths.size() > 50) {\r\n\t \t \t\r\n\t \t \tint counter_add_paths = 0;\r\n\t \t \t\t\r\n Set<String> add_target_from_Path_1 = paths.keySet();\r\n\t\t \t\r\n\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t \t\r\n\t\t \t// get status of removal\r\n\t\t \t for (String from_Path_1: add_target_from_Path_1) {\r\n\t \t \t\r\n\t \t \t\r\n\t \t \t\r\n\t \t\t if (still_remaining_targets.contains(from_Path_1) ) {\r\n\t \t \t\t\r\n\t \t \t\t continue;\r\n\t \t \t }\r\n\t \t\t\r\n\t \t\t else {\r\n\t \t\t\t \r\n\t \t\t\t \r\n\t \t\t\t if (counter_add_paths < 50) {\r\n\t \t\t\t\r\n\t \t\t\t if ( !temporary_path_holder.contains(from_Path_1) ){\r\n\t \t \t \t\t\r\n\t \t\t\t\t target_subset.put(from_Path_1 + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t \t\t\t\t counter_add_paths++;\r\n\t \t\t\t\t \r\n\t \t\t\t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path_1)..//return test case not previously added to temporary population\r\n\t \t\t\t\t \r\n\t\t \t \t\t}\r\n\t \t\t\t\r\n\t \t\t\t }\r\n\t \t\t\r\n\t \t\t\t\r\n\t \t\t\t\r\n\t \t\t }\r\n\t \t\t \r\n\t\t \t \r\n\t\t \t }\r\n\t \t \t}\r\n\t\t \t \r\n\t\t \t else {\r\n\t\t \t \t \r\n\t\t \t \t \r\n\t\t \t \tSet<String> add_target_from_Path_7 = paths.keySet();\r\n\t\t\t \t\r\n\t\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t\t \t\r\n\t\t\t \t// get status of removal\r\n\t\t\t \t for (String from_Path_7: add_target_from_Path_7) { // contains(Object)\r\n\t\t\t \t\r\n\t\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t\t \t\t\r\n\t\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t\t \t \t\r\n\t\t\t if (still_remaining_targets.contains(from_Path_7) ) {\r\n\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t\t \t \t}\r\n\t\t\t else { \r\n\t \t \t\tif ( !temporary_path_holder.contains(from_Path_7) ){\r\n\t \t \t\t\t\r\n\t \t \t\t\ttarget_subset.put(from_Path_7 + \" \" + \"new\", false);\r\n\t \t \t\t\t\r\n\t \t \t\t\t// retrieve test case from archive\r\n\t \t \t\t// retrieve test case from archive\r\n\t \t \t\t\t//updatePopulation(from_Path_7)..//return test case not previously added to temporary population\r\n\t \t \t\t}}\r\n\t\t \t \t \r\n\t\t\t \t }\t \r\n\t\t \t \t \r\n\t\t \t \t \r\n\t\t \t }\r\n\t }\r\n\t \t\t\r\n\t \telse {\r\n\t \t\t\r\n\t \t\t// pick paths with false status and add them to subset of targets\r\n\t \t\t\r\n\t \t\tint path_to_add_counter = 0;\r\n\t \t\t\r\n\t \tif (paths.size() > 50) {\r\n\t \t\tSet<String> add_target_from_Path = paths.keySet();\r\n\t\t \t\r\n\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t \t\r\n\t\t \t// get status of removal\r\n\t\t \t for (String from_Path: add_target_from_Path) { // contains(Object)\r\n\t\t \t\r\n\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t \t\t\r\n\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t \t \t\r\n\t\t \t \t\tif (still_remaining_targets.contains(from_Path) ) {\r\n\t\t\t\t \t \t\t\r\n\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t \t \t}\r\n\t\t \t \t\t\telse {\t\r\n\t\t \t \t\t\r\n\t\t \t \t\t if (path_to_add_counter < 50) {\r\n\t\t \t \t\t \r\n\t\t \t \t if ( !paths.get(from_Path) && (!temporary_path_holder.contains(from_Path) ) ){\r\n\t\t \t \t\t\r\n\t\t \t \t\t target_subset.put(from_Path + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\tpath_to_add_counter++;\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t// retrieve test case from archive\r\n\t\t \t \t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path)..//return test case not previously added to temporary population\r\n\t\t \t \t\t }\r\n\t\t \t \t\t \r\n\t\t \t \t\t \r\n\t\t \t \t\t}\r\n\t\t \t \t\t\t}\r\n\t\t \t \t}\r\n\t \t}\r\n\t \t\r\n\t \t\r\n\t\t \t else {\r\n\t\t \t \t\t \r\n\t\t \t \t\tSet<String> add_target_from_Path_4 = paths.keySet();\r\n\t\t\t\t \t\r\n\t\t\t\t \t//replaced_status_2.put(id + new String(str), false);\r\n\t\t\t\t \t\r\n\t\t\t\t \t// get status of removal\r\n\t\t\t\t \t for (String from_Path_4: add_target_from_Path_4) { // contains(Object)\r\n\t\t\t\t \t\r\n\t\t\t\t \t //get current path set..the paths already in subset should not be picked again....\r\n\t\t\t\t \t\t\r\n\t\t\t\t \t \t//\ttarget_subset.put(key + \" \" + \"new\", false);\t\r\n\t\t\t\t \t \t\r\n\t\t\t\t \r\n\t\t\t\t \t \t\t\tif (still_remaining_targets.contains(from_Path_4) ) {\r\n\t\t\t\t\t\t \t \t\t\r\n\t\t\t\t\t\t \t \t\tcontinue;\r\n\t\t\t\t\t\t \t \t}\r\n\t\t \t \t\t \r\n\t\t\t\t \t \t\t\telse {\r\n\t\t \t \t\t\t\r\n\t\t \t \t\tif ( !paths.get(from_Path_4) && (!temporary_path_holder.contains(from_Path_4) ) ){\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\ttarget_subset.put(from_Path_4 + \" \" + \"new\", false);\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t// retrieve test case from archive\r\n\t\t \t \t\t\t//updatePopulation(from_Path_4)..//return test case not previously added to temporary population\r\n\t\t \t \t\t}}\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t\t\r\n\t\t \t \t\t}\r\n\t\t \t \t}\r\n\t\t \t\r\n\t \t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t \t\r\n\t \t\r\n\t\t\t\tString updated_id;\r\n\r\n\t\t\t\tint updated_val;\r\n\r\n\t\t\t\t// int rem;\r\n\r\n\t\t\t\tfor (int pop = 0; pop < updated_population.size(); pop++) {\r\n\r\n\t\t\t\t\tif (pop == 50) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tString[] updated_pop = (updated_population.get(pop).split(\" \"));\r\n\t\t\t\t\tupdated_id = updated_pop[0];\r\n\t\t\t\t\tupdated_val = Integer.parseInt(updated_pop[1]);\r\n\r\n\t\t\t\t\tif (updated_id.equals(\"parent\")) {\r\n\t\t\t\t\t\tfor (int update_parent = 0; update_parent < R; update_parent++) {\r\n\t\t\t\t\t\t\t// x[i][j] = v[i][j] ;\r\n\r\n\t\t\t\t\t\t\tx[pop][update_parent] = x[updated_val][update_parent];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (updated_id.equals(\"child\")) {\r\n\t\t\t\t\t\tfor (int update_child = 0; update_child < R; update_child++) {\r\n\t\t\t\t\t\t\t// x[i][j] = v[i][j] ;\r\n\r\n\t\t\t\t\t\t\tx[pop][update_child] = v[updated_val][update_child];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t \t\r\n\t \t\r\n\t\t\t\t} \t\r\n\t // \tremoved_at_previous_iteration.clear();\r\n\t\t\t\t//}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t//\tfor (Map.Entry<String, ArrayList<String>> entry : names.entrySet()) {\r\n\t\t\t\t//\tString key = entry.getKey();\r\n\t\t\t\t//\tArrayList<String> value = entry.getValue();\r\n\t\t\t\t//\t}\r\n\r\n\t\t\t\r\n\t\t//\tSystem.out.println(\"NO. of cycles=\" + (Cycle[run] - 1)); // ���Number of Cycle\r\n\t\t\tcoverage[run] = obj_total * 100 / PATHNUM_NUMBER ; // percentage of paths covered per run\r\n\t\t\tSystem.out.println(\"Path coverage=\" + coverage[run] + \"%\");\r\n\t\t\tSystem.out.println(\"The optimal solution is\");\r\n\t\t\tSystem.out.println(\"template 1(bbbb): \");\r\n\t\t\t/*for (int a = 0; a < PATHNUM; a++) // Output the result\r\n\t\t {\r\n\t\t\t\tif (statu[a]) {\r\n\t\t\t\t\tSystem.out.print(\"path\" + a + \":\");\r\n\t\t\t\t\tfor (int j = 0; j < R; j++)\r\n\t\t\t\t\t\tSystem.out.print(solution[a][j] + \" \");\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"path\" + a + \"Not covered.\");\r\n\t\t\t}*/\r\n\r\n\t\t\t \r\n\r\n\t\t} \r\n\r\n\t\tdouble time_sum = 0, time_average;\r\n\t\tfloat coverage_sum = 0, coverage_average, cycle_sum = 0, cycle_average, case_average;\r\n\t\tint case_sum = 0;\r\n\t\tfor (int run = 0; run < RUN; run++) {\r\n\t\t\ttime_sum = time_sum + runtime[run];\r\n\t\t//\tcycle_sum = cycle_sum + (Cycle[run] - 1);\r\n\t\t//\tcase_sum = case_sum + total_case_num[run];\r\n\t\t\tcoverage_sum = coverage_sum + coverage[run];\r\n\t\t }\r\n\t\t\r\n\t\ttime_average = time_sum / RUN;\r\n\t\tcycle_average = cycle_sum / RUN;\r\n\t\tcase_average = case_sum / RUN;\r\n\t\tcoverage_average = coverage_sum / RUN;\r\n\r\n\t\tSystem.out.println(\"time_sum = \" + time_sum + \"ms\");\r\n\t\tSystem.out.println(\"time_average = \" + time_average + \"ms\");\r\n\t\tSystem.out.println(\"cycle_sum = \" + cycle_sum);\r\n\t\tSystem.out.println(\"cycle_average = \" + cycle_average);\r\n\t\tSystem.out.println(\"case_sum = \" + case_sum);\r\n\t\tSystem.out.println(\"case_average = \" + case_average);\r\n\t\tSystem.out.println(\"coverage_sum = \" + coverage_sum + \"%\");\r\n\t\tSystem.out.println(\"coverage_average = \" + coverage_average + \"%\");\r\n\r\n\t\r\n\t\t\r\n\t\t//test case number statistics\r\n\t\ttry \r\n\t\t{ \r\n//\t\t\tWritableWorkbook wbook= \r\n//\t\t\tWorkbook.createWorkbook(new File(\"E:/result0106.xls\")); \r\n//\t\t\t//生成名为“Ramdom”的工作表,参数0表示这是第一页 \r\n//\t\t\tWritableSheet sheet=wbook.createSheet(\"DE1\",0); \r\n\t\t\t\r\n\t\t\tFile file = new java.io.File(\"C:/Users/scybe/eclipse-workspace/TestData/Test_whole.xls\"); \r\n\t\t\tWorkbook book = Workbook.getWorkbook(file); \r\n\t\t\tWritableWorkbook wbook = Workbook.createWorkbook(file, book); \r\n \t WritableSheet sheet = wbook.getSheet(0); // 写入数据 sheet \r\n\t\t\t\r\n\t\t\tfor(int run=0 ; run<RUN; run++)\r\n\t\t\t{\r\n\t\t\t\tint q = run;\r\n\t\t\t\tjxl.write.Number number = new jxl.write.Number(col, q,total_case_num[run]); \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tsheet.addCell(number); \r\n\t\t\t\tSystem.out.println(total_case_num[run]);\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//total_case_num[run]\r\n\t\t\t\r\n\t\t \tdouble case_ave = getAverage(total_case_num , RUN);\r\n\t\t\tjxl.write.Number number1 = new jxl.write.Number(col, 25 ,case_ave); \r\n\t\t\tsheet.addCell(number1);\r\n\t\t\t\r\n\t\t\t \t\t\r\n\t\t\twbook.write(); \t\r\n\t\t\twbook.close();\r\n\t\t\t \r\n\t\t}catch(Exception e) \r\n\t\t{ \r\n\t\tSystem.out.println(e); \r\n\t\t} \r\n\t\t\t\t\t\t\r\n\t\t\r\n\t\t//coverage statistics \r\n\t\t\r\n\t\t//test case number statistics\r\n\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t\ttry \r\n\t\t\t{ \r\n//\t\t\t\t\t\r\n\t\t\t\t\tFile file = new java.io.File(\"C:/Users/scybe/eclipse-workspace/TestData/Coverage_whole.xls\"); \r\n\t\t\t\t\tWorkbook book = Workbook.getWorkbook(file); \r\n\t\t\t\t\tWritableWorkbook wbook = Workbook.createWorkbook(file, book); \r\n\t\t \t WritableSheet sheet = wbook.getSheet(0); // 写入数据 sheet \r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(int run=0 ; run<RUN; run++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint q=run;\r\n\t\t\t\t\t\tjxl.write.Number number = new jxl.write.Number(col, q,coverage[run]); \r\n\t\t\t\t\t\tsheet.addCell(number); \r\n\t\t\t\t\t\t\r\n \r\n\t\t\t\t\t\t//写入数据并关闭文件 \t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//total_case_num[run]\r\n\t\t\t\t\t\r\n\t\t\t\t\tdouble case_ave = getAverages(coverage , RUN);\r\n\t\t\t\t\tjxl.write.Number number1 = new jxl.write.Number(col,25,case_ave); \r\n\t\t\t\t\tsheet.addCell(number1);\r\n\t\t\t\t\t\r\n\t\t\t\t\twbook.write(); \t\r\n\t\t\t\t\twbook.close();\r\n\t\t\t\t\t \r\n\t\t\t\t}catch(Exception e) \r\n\t\t\t\t{ \r\n\t\t\t\tSystem.out.println(e); \r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\r\n\r\n\t}", "public void method_246(int var1, int var2, int var3, int var4, int var5, int var6) {\n try {\n int var7 = this.field_736[var5];\n int var8 = this.field_737[var5];\n int var9 = 0;\n int var10 = 0;\n int var11 = (var7 << 16) / var3;\n int var12 = (var8 << 16) / var4;\n int var13;\n int var14;\n if(this.field_742[var5]) {\n var13 = this.spriteWidthFull[var5];\n var14 = this.field_741[var5];\n var11 = (var13 << 16) / var3;\n var12 = (var14 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var13 - 1) / var13;\n var2 += (this.field_739[var5] * var4 + var14 - 1) / var14;\n if(this.field_738[var5] * var3 % var13 != 0) {\n var9 = (var13 - this.field_738[var5] * var3 % var13 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var14 != 0) {\n var10 = (var14 - this.field_739[var5] * var4 % var14 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var9 >> 16)) / var13;\n var4 = var4 * (this.field_737[var5] - (var10 >> 16)) / var14;\n }\n\n var13 = var1 + var2 * this.field_723;\n var14 = this.field_723 - var3;\n int var15;\n if(var2 < this.field_743) {\n var15 = this.field_743 - var2;\n var4 -= var15;\n var2 = 0;\n var13 += var15 * this.field_723;\n var10 += var12 * var15;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var15 = this.field_745 - var1;\n var3 -= var15;\n var1 = 0;\n var13 += var15;\n var9 += var11 * var15;\n var14 += var15;\n }\n\n if(var1 + var3 >= this.field_746) {\n var15 = var1 + var3 - this.field_746 + 1;\n var3 -= var15;\n var14 += var15;\n }\n\n byte var17 = 1;\n if(this.interlace) {\n var17 = 2;\n var14 += this.field_723;\n var12 += var12;\n if((var2 & 1) != 0) {\n var13 += this.field_723;\n --var4;\n }\n }\n\n this.method_253(this.pixels, this.spritePixels[var5], 0, var9, var10, var13, var14, var3, var4, var11, var12, var7, var17, var6);\n } catch (Exception var16) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "protected int b(i var1_1, y.c.q var2_2, y.c.q var3_3, h var4_4, h var5_5, int var6_6, ArrayList var7_7, ArrayList var8_8, h var9_9, h var10_10) {\n block26 : {\n block25 : {\n var24_11 = o.p;\n this.c = var6_6;\n this.d = var2_2;\n this.e = var3_3;\n this.n = var1_1.h();\n this.o = var1_1.f();\n this.h = var1_1;\n this.i = new int[this.n];\n this.j = new int[this.n];\n this.k = new int[this.o];\n this.l = new int[this.o];\n this.m = new int[this.n];\n this.b = new Object[this.o];\n this.t = new int[this.n];\n this.r = new d[this.n];\n this.s = new d[this.n];\n this.f = var4_4;\n this.a = new a[this.n];\n this.q = new ArrayList<E>(var1_1.f());\n this.p = new I(this.o);\n var11_12 = 0;\n block0 : do {\n v0 = var11_12;\n block1 : while (v0 < var7_7.size()) {\n var12_15 = (a)var7_7.get(var11_12);\n v1 /* !! */ = var12_15.b();\n if (var24_11) break block25;\n var13_17 = v1 /* !! */ ;\n while (var13_17.f()) {\n var14_20 = var13_17.a();\n var15_23 = var14_20.b();\n this.a[var14_20.b()] = var12_15;\n this.i[var15_23] = var12_15.a();\n v0 = this.i[var15_23];\n if (var24_11) continue block1;\n if (v0 < 0) {\n throw new B(\"found negative capacity\");\n }\n var13_17.g();\n if (!var24_11) continue;\n }\n ++var11_12;\n if (!var24_11) continue block0;\n }\n break block0;\n break;\n } while (true);\n v1 /* !! */ = var11_13 = this.h.p();\n }\n while (var11_13.f()) {\n var12_15 = var11_13.a();\n this.r[var12_15.b()] = (d)var10_10.b(var12_15);\n this.s[var12_15.b()] = (d)var9_9.b(var12_15);\n var11_13.g();\n if (!var24_11) {\n if (!var24_11) continue;\n }\n break block26;\n }\n this.g = new u[this.o];\n }\n var11_13 = var1_1.o();\n while (var11_13.f()) {\n var12_15 = var11_13.e();\n v2 = this;\n if (!var24_11) {\n v2.g[var12_15.d()] = new u((y.c.q)var12_15, var12_15.d());\n var11_13.g();\n if (!var24_11) continue;\n }\n ** GOTO lbl65\n }\n block5 : do {\n v2 = this;\nlbl65: // 2 sources:\n var11_14 = var13_18 = v2.a();\n var12_16 = 0;\n var14_21 = 0;\n block6 : do {\n v3 = var14_21;\n v4 = var8_8.size();\n block7 : while (v3 < v4) {\n v5 = var8_8.get(var14_21);\n do {\n var15_24 = (ArrayList)v5;\n var16_26 = false;\n var17_27 = 0;\n var18_28 = 0;\n v6 = 0;\n if (!var24_11) {\n for (var19_29 = v1574606; var19_29 < var15_24.size(); ++var19_29) {\n block28 : {\n block27 : {\n var20_30 = (a)var15_24.get(var19_29);\n v3 = this.m[var20_30.b[0].b()];\n v4 = 1;\n if (var24_11) continue block7;\n if (v3 != v4 || this.m[var20_30.b[1].b()] != 1) continue;\n ++var12_16;\n var21_31 = this.s[var20_30.b[0].b()];\n var22_32 = 0;\n while (this.m[var21_31.b()] == 1) {\n var22_32 += var4_4.a(this.a[var21_31.b()].b(var21_31));\n var21_31 = this.s[var21_31.b()];\n if (!var24_11) {\n if (!var24_11) continue;\n }\n break block27;\n }\n var22_32 += var4_4.a(this.a[var21_31.b()].b(var21_31));\n }\n var23_33 = 0;\n var21_31 = this.s[var20_30.b[1].b()];\n while (this.m[var21_31.b()] == 1) {\n var23_33 += var4_4.a(this.a[var21_31.b()].b(var21_31));\n var21_31 = this.s[var21_31.b()];\n if (!var24_11) {\n if (!var24_11) continue;\n }\n break block28;\n }\n var23_33 += var4_4.a(this.a[var21_31.b()].b(var21_31));\n }\n if (var23_33 > 400 || var22_32 > 400) {\n block29 : {\n if (var23_33 < var22_32) {\n this.a(var20_30);\n if (!var24_11) break block29;\n }\n this.b(var20_30);\n }\n var16_26 = true;\n }\n var18_28 += var23_33;\n var17_27 += var22_32;\n if (!var24_11) continue;\n }\n if (!var16_26) {\n for (var19_29 = 0; var19_29 < var15_24.size(); ++var19_29) {\n var20_30 = (a)var15_24.get(var19_29);\n v3 = this.m[var20_30.b[0].b()];\n v4 = 1;\n if (var24_11) continue block7;\n if (v3 != v4 || this.m[var20_30.b[1].b()] != 1) continue;\n if (var18_28 < var17_27) {\n this.a(var20_30);\n if (!var24_11) continue;\n }\n this.b(var20_30);\n if (!var24_11) continue;\n }\n }\n ++var14_21;\n if (!var24_11) continue block6;\n }\n ** GOTO lbl133\n v6 = var12_16;\nlbl133: // 2 sources:\n if (v6 > 0) continue block5;\n v5 = this.h.p();\n } while (var24_11);\n }\n break;\n } while (true);\n break;\n } while (true);\n var13_19 = v5;\n while (var13_19.f()) {\n var14_22 = var13_19.a();\n v7 = var14_22.b();\n if (var24_11 != false) return v7;\n var15_25 = v7;\n var5_5.a((Object)var14_22, this.m[var15_25]);\n var13_19.g();\n if (!var24_11) continue;\n }\n v7 = var11_14;\n return v7;\n }", "public void method_245(int var1, int var2, int var3, int var4, int var5, int var6) {\n try {\n int var7 = this.field_736[var5];\n int var8 = this.field_737[var5];\n int var9 = 0;\n int var10 = 0;\n int var11 = (var7 << 16) / var3;\n int var12 = (var8 << 16) / var4;\n int var13;\n int var14;\n if(this.field_742[var5]) {\n var13 = this.spriteWidthFull[var5];\n var14 = this.field_741[var5];\n var11 = (var13 << 16) / var3;\n var12 = (var14 << 16) / var4;\n var1 += (this.field_738[var5] * var3 + var13 - 1) / var13;\n var2 += (this.field_739[var5] * var4 + var14 - 1) / var14;\n if(this.field_738[var5] * var3 % var13 != 0) {\n var9 = (var13 - this.field_738[var5] * var3 % var13 << 16) / var3;\n }\n\n if(this.field_739[var5] * var4 % var14 != 0) {\n var10 = (var14 - this.field_739[var5] * var4 % var14 << 16) / var4;\n }\n\n var3 = var3 * (this.field_736[var5] - (var9 >> 16)) / var13;\n var4 = var4 * (this.field_737[var5] - (var10 >> 16)) / var14;\n }\n\n var13 = var1 + var2 * this.field_723;\n var14 = this.field_723 - var3;\n int var15;\n if(var2 < this.field_743) {\n var15 = this.field_743 - var2;\n var4 -= var15;\n var2 = 0;\n var13 += var15 * this.field_723;\n var10 += var12 * var15;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n if(var1 < this.field_745) {\n var15 = this.field_745 - var1;\n var3 -= var15;\n var1 = 0;\n var13 += var15;\n var9 += var11 * var15;\n var14 += var15;\n }\n\n if(var1 + var3 >= this.field_746) {\n var15 = var1 + var3 - this.field_746 + 1;\n var3 -= var15;\n var14 += var15;\n }\n\n byte var17 = 1;\n if(this.interlace) {\n var17 = 2;\n var14 += this.field_723;\n var12 += var12;\n if((var2 & 1) != 0) {\n var13 += this.field_723;\n --var4;\n }\n }\n\n this.method_252(this.pixels, this.spritePixels[var5], 0, var9, var10, var13, var14, var3, var4, var11, var12, var7, var17, var6);\n } catch (Exception var16) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "private SBomCombiner()\n\t{}", "private void method_261(int[] var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15, int var16) {\n boolean var29 = field_759;\n int var20 = var13 >> 16 & 255;\n int var21 = var13 >> 8 & 255;\n int var22 = var13 & 255;\n\n try {\n int var23 = var5;\n int var24 = -var9;\n if(var29 || var24 < 0) {\n do {\n int var25 = (var6 >> 16) * var12;\n int var26 = var14 >> 16;\n int var27 = var8;\n int var28;\n if(var26 < this.field_745) {\n var28 = this.field_745 - var26;\n var27 = var8 - var28;\n var26 = this.field_745;\n var5 += var10 * var28;\n }\n\n if(var26 + var27 >= this.field_746) {\n var28 = var26 + var27 - this.field_746;\n var27 -= var28;\n }\n\n var16 = 1 - var16;\n if(var16 != 0) {\n var28 = var26;\n if(var29 || var26 < var26 + var27) {\n do {\n var4 = var2[(var5 >> 16) + var25] & 255;\n if(var4 != 0) {\n label33: {\n var4 = var3[var4];\n int var17 = var4 >> 16 & 255;\n int var18 = var4 >> 8 & 255;\n int var19 = var4 & 255;\n if(var17 == var18 && var18 == var19) {\n var1[var28 + var7] = (var17 * var20 >> 8 << 16) + (var18 * var21 >> 8 << 8) + (var19 * var22 >> 8);\n if(!var29) {\n break label33;\n }\n }\n\n var1[var28 + var7] = var4;\n }\n }\n\n var5 += var10;\n ++var28;\n } while(var28 < var26 + var27);\n }\n }\n\n var6 += var11;\n var5 = var23;\n var7 += this.field_723;\n var14 += var15;\n ++var24;\n } while(var24 < 0);\n\n }\n } catch (Exception var30) {\n System.out.println(\"error in transparent sprite plot routine\"); // authentic System.out.println\n }\n }", "@Override\r\n\tprotected void onReduceMp()\r\n\t{\n\t}", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "public void preprocess() {\n }", "private void m1do() {\n for (int i = 0; i < 2; i++) {\n this.my[i] = null;\n }\n for (int i2 = 0; i2 < 2; i2++) {\n this.mz[i2] = 0;\n }\n this.mC = 0.0d;\n this.lf = 0;\n }", "private static String m2380a(byte[] bArr, byte[] bArr2) {\n byte[] bArr3 = new byte[(((bArr.length + 2) / 3) * 4)];\n int length = bArr.length - (bArr.length % 3);\n int i = 0;\n for (int i2 = 0; i2 < length; i2 += 3) {\n int i3 = i + 1;\n bArr3[i] = bArr2[(bArr[i2] & 255) >> 2];\n int i4 = i3 + 1;\n int i5 = i2 + 1;\n bArr3[i3] = bArr2[((bArr[i2] & 3) << 4) | ((bArr[i5] & 255) >> 4)];\n int i6 = i4 + 1;\n int i7 = i2 + 2;\n bArr3[i4] = bArr2[((bArr[i5] & 15) << 2) | ((bArr[i7] & 255) >> 6)];\n i = i6 + 1;\n bArr3[i6] = bArr2[bArr[i7] & 63];\n }\n switch (bArr.length % 3) {\n case 1:\n int i8 = i + 1;\n bArr3[i] = bArr2[(bArr[length] & 255) >> 2];\n int i9 = i8 + 1;\n bArr3[i8] = bArr2[(bArr[length] & 3) << 4];\n int i10 = i9 + 1;\n bArr3[i9] = 61;\n bArr3[i10] = 61;\n break;\n case 2:\n int i11 = i + 1;\n bArr3[i] = bArr2[(bArr[length] & 255) >> 2];\n int i12 = i11 + 1;\n int i13 = length + 1;\n bArr3[i11] = bArr2[((bArr[length] & 3) << 4) | ((bArr[i13] & 255) >> 4)];\n int i14 = i12 + 1;\n bArr3[i12] = bArr2[(bArr[i13] & 15) << 2];\n bArr3[i14] = 61;\n break;\n }\n try {\n return new String(bArr3, \"US-ASCII\");\n } catch (UnsupportedEncodingException e) {\n throw new AssertionError(e);\n }\n }", "private void optimiseEVProfile()\n\t{\n\t}", "float compress(){\n float lower = mp.get(sequence.charAt(0)).lowRange;\n float upper = mp.get(sequence.charAt(0)).upperRange;\n for (int i = 1; i < sequence.length(); i++) {\n float newLower = lower + (upper - lower)*mp.get(sequence.charAt(i)).lowRange;\n float newUpper = lower + (upper - lower)*mp.get(sequence.charAt(i)).upperRange;\n lower = newLower;\n upper = newUpper;\n }\n ///picking value between final lower and upper\n float compressionCode = (float)(Math.floor(upper * 1000.0) / 1000.0);\n return compressionCode;\n }", "private void preprocess(ArrayList<Point>[] dsg) {\n preprocessGroup = new ArrayList<>();\n for(ArrayList<Point> l:dsg){\n \tfor(Point p:l){\n \t\tif(p.layer<=constructor.k_point_GSkyline_groups&&p.getUnitGroupSize()<=constructor.k_point_GSkyline_groups){\n \t\t\tpreprocessGroup.add(p);\n \t\t}\n \t}\n }\n for(int i=0;i<preprocessGroup.size();i++){\n \tpreprocessGroup.get(i).index=i;\n }\n }", "public void s_()\r\n/* 117: */ {\r\n/* 118:128 */ this.P = this.s;\r\n/* 119:129 */ this.Q = this.t;\r\n/* 120:130 */ this.R = this.u;\r\n/* 121:131 */ super.s_();\r\n/* 122:133 */ if (this.b > 0) {\r\n/* 123:134 */ this.b -= 1;\r\n/* 124: */ }\r\n/* 125:137 */ if (this.a)\r\n/* 126: */ {\r\n/* 127:138 */ if (this.o.p(new dt(this.c, this.d, this.e)).c() == this.f)\r\n/* 128: */ {\r\n/* 129:139 */ this.i += 1;\r\n/* 130:140 */ if (this.i == 1200) {\r\n/* 131:141 */ J();\r\n/* 132: */ }\r\n/* 133:143 */ return;\r\n/* 134: */ }\r\n/* 135:145 */ this.a = false;\r\n/* 136: */ \r\n/* 137:147 */ this.v *= this.V.nextFloat() * 0.2F;\r\n/* 138:148 */ this.w *= this.V.nextFloat() * 0.2F;\r\n/* 139:149 */ this.x *= this.V.nextFloat() * 0.2F;\r\n/* 140:150 */ this.i = 0;\r\n/* 141:151 */ this.ap = 0;\r\n/* 142: */ }\r\n/* 143: */ else\r\n/* 144: */ {\r\n/* 145:154 */ this.ap += 1;\r\n/* 146: */ }\r\n/* 147:157 */ brw localbrw1 = new brw(this.s, this.t, this.u);\r\n/* 148:158 */ brw localbrw2 = new brw(this.s + this.v, this.t + this.w, this.u + this.x);\r\n/* 149:159 */ bru localbru1 = this.o.a(localbrw1, localbrw2);\r\n/* 150: */ \r\n/* 151:161 */ localbrw1 = new brw(this.s, this.t, this.u);\r\n/* 152:162 */ localbrw2 = new brw(this.s + this.v, this.t + this.w, this.u + this.x);\r\n/* 153:163 */ if (localbru1 != null) {\r\n/* 154:164 */ localbrw2 = new brw(localbru1.c.a, localbru1.c.b, localbru1.c.c);\r\n/* 155: */ }\r\n/* 156:167 */ if (!this.o.D)\r\n/* 157: */ {\r\n/* 158:168 */ Object localObject = null;\r\n/* 159:169 */ List localList = this.o.b(this, aQ().a(this.v, this.w, this.x).b(1.0D, 1.0D, 1.0D));\r\n/* 160:170 */ double d1 = 0.0D;\r\n/* 161:171 */ xm localxm = n();\r\n/* 162:172 */ for (int k = 0; k < localList.size(); k++)\r\n/* 163: */ {\r\n/* 164:173 */ wv localwv = (wv)localList.get(k);\r\n/* 165:174 */ if ((localwv.ad()) && ((localwv != localxm) || (this.ap >= 5)))\r\n/* 166: */ {\r\n/* 167:178 */ float f5 = 0.3F;\r\n/* 168:179 */ brt localbrt = localwv.aQ().b(f5, f5, f5);\r\n/* 169:180 */ bru localbru2 = localbrt.a(localbrw1, localbrw2);\r\n/* 170:181 */ if (localbru2 != null)\r\n/* 171: */ {\r\n/* 172:182 */ double d2 = localbrw1.f(localbru2.c);\r\n/* 173:183 */ if ((d2 < d1) || (d1 == 0.0D))\r\n/* 174: */ {\r\n/* 175:184 */ localObject = localwv;\r\n/* 176:185 */ d1 = d2;\r\n/* 177: */ }\r\n/* 178: */ }\r\n/* 179: */ }\r\n/* 180: */ }\r\n/* 181:190 */ if (localObject != null) {\r\n/* 182:191 */ localbru1 = new bru(localObject);\r\n/* 183: */ }\r\n/* 184: */ }\r\n/* 185:195 */ if (localbru1 != null) {\r\n/* 186:196 */ if ((localbru1.a == brv.b) && (this.o.p(localbru1.a()).c() == aty.aY)) {\r\n/* 187:197 */ aq();\r\n/* 188: */ } else {\r\n/* 189:199 */ a(localbru1);\r\n/* 190: */ }\r\n/* 191: */ }\r\n/* 192:202 */ this.s += this.v;\r\n/* 193:203 */ this.t += this.w;\r\n/* 194:204 */ this.u += this.x;\r\n/* 195: */ \r\n/* 196:206 */ float f1 = uv.a(this.v * this.v + this.x * this.x);\r\n/* 197:207 */ this.y = ((float)(Math.atan2(this.v, this.x) * 180.0D / 3.141592741012573D));\r\n/* 198:208 */ this.z = ((float)(Math.atan2(this.w, f1) * 180.0D / 3.141592741012573D));\r\n/* 199:210 */ while (this.z - this.B < -180.0F) {\r\n/* 200:211 */ this.B -= 360.0F;\r\n/* 201: */ }\r\n/* 202:213 */ while (this.z - this.B >= 180.0F) {\r\n/* 203:214 */ this.B += 360.0F;\r\n/* 204: */ }\r\n/* 205:217 */ while (this.y - this.A < -180.0F) {\r\n/* 206:218 */ this.A -= 360.0F;\r\n/* 207: */ }\r\n/* 208:220 */ while (this.y - this.A >= 180.0F) {\r\n/* 209:221 */ this.A += 360.0F;\r\n/* 210: */ }\r\n/* 211:224 */ this.z = (this.B + (this.z - this.B) * 0.2F);\r\n/* 212:225 */ this.y = (this.A + (this.y - this.A) * 0.2F);\r\n/* 213: */ \r\n/* 214:227 */ float f2 = 0.99F;\r\n/* 215:228 */ float f3 = m();\r\n/* 216:230 */ if (V())\r\n/* 217: */ {\r\n/* 218:231 */ for (int j = 0; j < 4; j++)\r\n/* 219: */ {\r\n/* 220:232 */ float f4 = 0.25F;\r\n/* 221:233 */ this.o.a(ew.e, this.s - this.v * f4, this.t - this.w * f4, this.u - this.x * f4, this.v, this.w, this.x, new int[0]);\r\n/* 222: */ }\r\n/* 223:235 */ f2 = 0.8F;\r\n/* 224: */ }\r\n/* 225:238 */ this.v *= f2;\r\n/* 226:239 */ this.w *= f2;\r\n/* 227:240 */ this.x *= f2;\r\n/* 228:241 */ this.w -= f3;\r\n/* 229: */ \r\n/* 230:243 */ b(this.s, this.t, this.u);\r\n/* 231: */ }", "public void frameNoteDecoder(Integer[] frameNotes){\n //for(int i = 0;i<1;i++){\n for(int j =0; j < rhytm.get(beatCounter).length;j++){\n if(rhytm.get(beatCounter)[j]!=null)\n if ((!rhytm.get(beatCounter)[j].equals(\"Ri\")) && (!rhytm.get(beatCounter)[j].equals(\"Rs\"))) {\n melodyCounter++;\n }\n }\n beatCounter++;\n //}\n\n if(beatCounter==15) {\n for (int i = 0; i < frameNotes.length; i++) {\n if (melody.get(melodyCounter) == frameNotes[i]) {\n if (i < 2) {\n binaryOutput += \"0\";\n binaryOutput += Integer.toBinaryString(i);\n } else {\n binaryOutput += Integer.toBinaryString(i);\n }\n }\n }\n }\n if(beatCounter==31) {\n for (int i = 0; i < frameNotes.length; i++) {\n if (melody.get(melodyCounter) == frameNotes[i]) {\n binaryOutput += Integer.toBinaryString(i);\n }\n }\n }\n beatCounter++;\n melodyCounter++;\n\n\n}", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "private int Huffmancodebits( int [] ix, EChannel gi ) {\n\t\tint region1Start;\n\t\tint region2Start;\n\t\tint count1End;\n\t\tint bits, stuffingBits;\n\t\tint bvbits, c1bits, tablezeros, r0, r1, r2;//, rt, pr;\n\t\tint bitsWritten = 0;\n\t\tint idx = 0;\n\t\ttablezeros = 0;\n\t\tr0 = r1 = r2 = 0;\n\n\t\tint bigv = gi.big_values * 2;\n\t\tint count1 = gi.count1 * 4;\n\n\n\t\t/* 1: Write the bigvalues */\n\n\t\tif ( bigv!= 0 ) {\n\t\t\tif ( (gi.mixed_block_flag) == 0 && gi.window_switching_flag != 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t// if ( (gi.mixed_block_flag) == 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t/*\n Within each scalefactor band, data is given for successive\n time windows, beginning with window 0 and ending with window 2.\n Within each window, the quantized values are then arranged in\n order of increasing frequency...\n\t\t\t\t */\n\n\t\t\t\tint sfb, window, line, start, end;\n\n\t\t\t\t//int [] scalefac = scalefac_band_short; //da modificare nel caso si convertano mp3 con fs diversi\n\n\t\t\t\tregion1Start = 12;\n\t\t\t\tregion2Start = 576;\n\n\t\t\t\tfor ( sfb = 0; sfb < 13; sfb++ ) {\n\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\tstart = scalefac_band_short[ sfb ];\n\t\t\t\t\tend = scalefac_band_short[ sfb+1 ];\n\n\t\t\t\t\tif ( start < region1Start )\n\t\t\t\t\t\ttableindex = gi.table_select[ 0 ];\n\t\t\t\t\telse\n\t\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tif ( gi.mixed_block_flag!= 0 && gi.block_type == 2 ) { /* Mixed blocks long, short */\n\t\t\t\t\tint sfb, window, line, start, end;\n\t\t\t\t\tint tableindex;\n\t\t\t\t\t//scalefac_band_long;\n\n\t\t\t\t\t/* Write the long block region */\n\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\tif ( tableindex != 0 )\n\t\t\t\t\t\tfor (int i = 0; i < 36; i += 2 ) {\n\t\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\t\t\t\t\t/* Write the short block region */\n\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( sfb = 3; sfb < 13; sfb++ ) {\n\t\t\t\t\t\tstart = scalefac_band_long[ sfb ];\n\t\t\t\t\t\tend = scalefac_band_long[ sfb+1 ];\n\n\t\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\t\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else { /* Long blocks */\n\t\t\t\t\tint scalefac_index = 100;\n\n\t\t\t\t\tif ( gi.mixed_block_flag != 0 ) {\n\t\t\t\t\t\tregion1Start = 36;\n\t\t\t\t\t\tregion2Start = 576;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscalefac_index = gi.region0_count + 1;\n\t\t\t\t\t\tregion1Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t\tscalefac_index += gi.region1_count + 1;\n\t\t\t\t\t\tregion2Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < bigv; i += 2 ) {\n\t\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\t\tif ( i < region1Start ) {\n\t\t\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tif ( i < region2Start ) {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[1];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[2];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* get huffman code */\n\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\tif ( tableindex!= 0 ) {\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttablezeros += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t}\n\t\tbvbits = bitsWritten;\n\n\t\t/* 2: Write count1 area */\n\t\tint tableindex = gi.count1table_select + 32;\n\n\t\tcount1End = bigv + count1;\n\t\tfor (int i = bigv; i < count1End; i += 4 ) {\n\t\t\tv = ix[i];\n\t\t\tw = ix[i+1];\n\t\t\tx = ix[i+2];\n\t\t\ty = ix[i+3];\n\t\t\tbitsWritten += huffman_coder_count1(tableindex);\n\t\t}\n\n\t\t// c1bits = bitsWritten - bvbits;\n\t\t// if ( (stuffingBits = gi.part2_3_length - gi.part2_length - bitsWritten) != 0 ) {\n\t\t// int stuffingWords = stuffingBits / 32;\n\t\t// int remainingBits = stuffingBits % 32;\n\t\t//\n\t\t// /*\n\t\t// Due to the nature of the Huffman code\n\t\t// tables, we will pad with ones\n\t\t// */\n\t\t// while ( stuffingWords-- != 0){\n\t\t// mn.add_entry( -1, 32 );\n\t\t// }\n\t\t// if ( remainingBits!=0 )\n\t\t// mn.add_entry( -1, remainingBits );\n\t\t// bitsWritten += stuffingBits;\n\t\t//\n\t\t// }\n\t\treturn bitsWritten;\n\t}", "double passer();", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "public void method_258(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, boolean var9) {\n try {\n if(var6 == 0) {\n var6 = 16777215;\n }\n\n if(var7 == 0) {\n var7 = 16777215;\n }\n\n int var10 = this.field_736[var5];\n int var11 = this.field_737[var5];\n int var12 = 0;\n int var13 = 0;\n int var14 = var8 << 16;\n int var15 = (var10 << 16) / var3;\n int var16 = (var11 << 16) / var4;\n int var17 = -(var8 << 16) / var4;\n int var18;\n int var19;\n if(this.field_742[var5]) {\n var18 = this.spriteWidthFull[var5];\n var19 = this.field_741[var5];\n var15 = (var18 << 16) / var3;\n var16 = (var19 << 16) / var4;\n int var20 = this.field_738[var5];\n int var21 = this.field_739[var5];\n if(var9) {\n var20 = var18 - this.field_736[var5] - var20;\n }\n\n var1 += (var20 * var3 + var18 - 1) / var18;\n int var22 = (var21 * var4 + var19 - 1) / var19;\n var2 += var22;\n var14 += var22 * var17;\n if(var20 * var3 % var18 != 0) {\n var12 = (var18 - var20 * var3 % var18 << 16) / var3;\n }\n\n if(var21 * var4 % var19 != 0) {\n var13 = (var19 - var21 * var4 % var19 << 16) / var4;\n }\n\n var3 = ((this.field_736[var5] << 16) - var12 + var15 - 1) / var15;\n var4 = ((this.field_737[var5] << 16) - var13 + var16 - 1) / var16;\n }\n\n var18 = var2 * this.field_723;\n var14 += var1 << 16;\n if(var2 < this.field_743) {\n var19 = this.field_743 - var2;\n var4 -= var19;\n var2 = this.field_743;\n var18 += var19 * this.field_723;\n var13 += var16 * var19;\n var14 += var17 * var19;\n }\n\n if(var2 + var4 >= this.field_744) {\n var4 -= var2 + var4 - this.field_744 + 1;\n }\n\n var19 = var18 / this.field_723 & 1;\n if(!this.interlace) {\n var19 = 2;\n }\n\n if(var7 == 16777215) {\n if(this.spritePixels[var5] != null) {\n if(!var9) {\n this.method_259(this.pixels, this.spritePixels[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var14, var17, var19);\n } else {\n this.method_259(this.pixels, this.spritePixels[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var14, var17, var19);\n }\n } else if(!var9) {\n this.method_261(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var14, var17, var19);\n } else {\n this.method_261(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var14, var17, var19);\n }\n } else if(this.spritePixels[var5] != null) {\n if(!var9) {\n this.method_260(this.pixels, this.spritePixels[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var7, var14, var17, var19);\n } else {\n this.method_260(this.pixels, this.spritePixels[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var7, var14, var17, var19);\n }\n } else if(!var9) {\n this.method_262(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, var12, var13, var18, var3, var4, var15, var16, var10, var6, var7, var14, var17, var19);\n } else {\n this.method_262(this.pixels, this.spriteColoursUsed[var5], this.spriteColourList[var5], 0, (this.field_736[var5] << 16) - var12 - 1, var13, var18, var3, var4, -var15, var16, var10, var6, var7, var14, var17, var19);\n }\n } catch (Exception var23) {\n System.out.println(\"error in sprite clipping routine\"); // authentic System.out.println\n }\n }", "public void method_6337(ahb var1, long var2, boolean var4, String var5) {\r\n super();\r\n String[] var6 = class_752.method_4253();\r\n this.field_5909 = new aji[256];\r\n this.field_5910 = new byte[256];\r\n this.field_5912 = new ArrayList();\r\n this.field_5907 = var1;\r\n this.field_5908 = new Random(var2);\r\n this.field_5911 = class_1198.method_6444(var5);\r\n boolean var10000 = var4;\r\n String[] var10;\r\n Map var19;\r\n if(var6 != null) {\r\n label91: {\r\n if(var4) {\r\n Map var7 = this.field_5911.method_6439();\r\n var10 = field_5917;\r\n var10000 = var7.containsKey(\"village\");\r\n List var15;\r\n if(var6 != null) {\r\n if(var10000) {\r\n Map var8 = (Map)var7.get(\"village\");\r\n var10000 = var8.containsKey(\"size\");\r\n if(var6 != null) {\r\n if(!var10000) {\r\n var8.put(\"size\", \"1\");\r\n }\r\n\r\n var15 = this.field_5912;\r\n class_1053 var10001 = new class_1053;\r\n var10001.method_5976(var8);\r\n var15.add(var10001);\r\n }\r\n }\r\n\r\n var10 = field_5917;\r\n var10000 = var7.containsKey(\"biome_1\");\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000) {\r\n var15 = this.field_5912;\r\n class_1055 var16 = new class_1055;\r\n var10 = field_5917;\r\n var16.method_5978((Map)var7.get(\"biome_1\"));\r\n var15.add(var16);\r\n }\r\n\r\n var10 = field_5917;\r\n var10000 = var7.containsKey(\"mineshaft\");\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000) {\r\n var15 = this.field_5912;\r\n class_1057 var17 = new class_1057;\r\n var10 = field_5917;\r\n var17.method_5982((Map)var7.get(\"mineshaft\"));\r\n var15.add(var17);\r\n }\r\n\r\n var10 = field_5917;\r\n var10000 = var7.containsKey(\"stronghold\");\r\n }\r\n\r\n if(var6 == null) {\r\n break label91;\r\n }\r\n\r\n if(var10000) {\r\n var15 = this.field_5912;\r\n class_1054 var18 = new class_1054;\r\n var10 = field_5917;\r\n var18.method_5977((Map)var7.get(\"stronghold\"));\r\n var15.add(var18);\r\n }\r\n }\r\n\r\n var19 = this.field_5911.method_6439();\r\n var10 = field_5917;\r\n this.field_5913 = var19.containsKey(\"decoration\");\r\n var10000 = this.field_5911.method_6439().containsKey(\"lake\");\r\n }\r\n }\r\n\r\n class_1198 var11;\r\n label97: {\r\n class_1187 var20;\r\n if(var6 != null) {\r\n if(var10000) {\r\n var20 = new class_1187;\r\n var20.method_6406(class_1192.field_6034);\r\n this.field_5915 = var20;\r\n }\r\n\r\n var11 = this.field_5911;\r\n if(var6 == null) {\r\n break label97;\r\n }\r\n\r\n Map var12 = this.field_5911.method_6439();\r\n var10 = field_5917;\r\n var10000 = var12.containsKey(\"lava_lake\");\r\n }\r\n\r\n if(var10000) {\r\n var20 = new class_1187;\r\n var20.method_6406(class_1192.field_6036);\r\n this.field_5916 = var20;\r\n }\r\n\r\n var19 = this.field_5911.method_6439();\r\n String[] var10002 = field_5917;\r\n this.field_5914 = var19.containsKey(\"dungeon\");\r\n var11 = this.field_5911;\r\n }\r\n\r\n Iterator var13 = var11.method_6440().iterator();\r\n\r\n label71:\r\n while(var13.hasNext()) {\r\n class_1205 var14 = (class_1205)var13.next();\r\n int var9 = var14.method_6474();\r\n\r\n while(var9 < var14.method_6474() + var14.method_6471()) {\r\n this.field_5909[var9] = var14.method_6472();\r\n this.field_5910[var9] = (byte)var14.method_6473();\r\n ++var9;\r\n if(var6 == null) {\r\n continue label71;\r\n }\r\n\r\n if(var6 == null) {\r\n break;\r\n }\r\n }\r\n\r\n if(var6 == null) {\r\n break;\r\n }\r\n }\r\n\r\n }", "private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint i, x=4,w=9,q;\r\n\t\tfor(i=-1;i<20;i+=3) {\r\n\t\t\tx++;\r\n\t\t\tfor(q=4;q<11;q++) {\r\n\t\t\t\tdo {\r\n\t\t\t\t\ti=+3;\r\n\t\t\t\t\tw=sizeof(i);\r\n\t\t\t\t\ti=x+w;\r\n\t\t\t\t\tx=w+i;\r\n\t\t\t\t\t\t\r\n\t\t\t\t} while (x<15);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"x:\"+x+\"i:\"+i);\r\n\r\n\t}", "private static short[][] translateResult(String[] exactCoverPartition) {\r\n\t\t\r\n\t\tshort[][] retVal = new short[9][9];\r\n\t\t\r\n\t\tfor(int i =0; i < exactCoverPartition.length;i++){\r\n\r\n\t\t\tString[] result = exactCoverPartition[i].split(\",\");\r\n\t\t\tint xCoord = Integer.parseInt(result[0]);\r\n\t\t\tint yCoord = Integer.parseInt(result[1]);\r\n\t\t\tshort value = Short.parseShort(result[2]);\r\n\t\t\t\r\n\t\t\tretVal[yCoord][xCoord] = (short)(value+1);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn retVal;\r\n\t}", "private final com.google.android.play.p179a.p352a.ae m28545b(com.google.protobuf.nano.a r8) {\n /*\n r7 = this;\n r6 = 1048576; // 0x100000 float:1.469368E-39 double:5.180654E-318;\n L_0x0002:\n r0 = r8.a();\n switch(r0) {\n case 0: goto L_0x000f;\n case 8: goto L_0x0010;\n case 18: goto L_0x001d;\n case 24: goto L_0x002a;\n case 34: goto L_0x0037;\n case 42: goto L_0x0044;\n case 50: goto L_0x0051;\n case 58: goto L_0x005e;\n case 66: goto L_0x006b;\n case 74: goto L_0x0078;\n case 82: goto L_0x0086;\n case 90: goto L_0x0094;\n case 98: goto L_0x00a2;\n case 106: goto L_0x00b0;\n case 114: goto L_0x00be;\n case 122: goto L_0x00cc;\n case 130: goto L_0x00dc;\n case 138: goto L_0x00eb;\n case 144: goto L_0x00fa;\n case 152: goto L_0x0108;\n case 160: goto L_0x0117;\n case 168: goto L_0x0126;\n default: goto L_0x0009;\n };\n L_0x0009:\n r0 = super.m4918a(r8, r0);\n if (r0 != 0) goto L_0x0002;\n L_0x000f:\n return r7;\n L_0x0010:\n r0 = r8.j();\n r7.f30754b = r0;\n r0 = r7.f30753a;\n r0 = r0 | 1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x001d:\n r0 = r8.f();\n r7.f30755c = r0;\n r0 = r7.f30753a;\n r0 = r0 | 2;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x002a:\n r0 = r8.i();\n r7.f30757e = r0;\n r0 = r7.f30753a;\n r0 = r0 | 8;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0037:\n r0 = r8.f();\n r7.f30758f = r0;\n r0 = r7.f30753a;\n r0 = r0 | 16;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0044:\n r0 = r8.f();\n r7.f30759g = r0;\n r0 = r7.f30753a;\n r0 = r0 | 32;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0051:\n r0 = r8.f();\n r7.f30762j = r0;\n r0 = r7.f30753a;\n r0 = r0 | 256;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x005e:\n r0 = r8.f();\n r7.f30763k = r0;\n r0 = r7.f30753a;\n r0 = r0 | 512;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x006b:\n r0 = r8.f();\n r7.f30760h = r0;\n r0 = r7.f30753a;\n r0 = r0 | 64;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0078:\n r0 = r8.f();\n r7.f30761i = r0;\n r0 = r7.f30753a;\n r0 = r0 | 128;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0086:\n r0 = r8.f();\n r7.f30764l = r0;\n r0 = r7.f30753a;\n r0 = r0 | 1024;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0094:\n r0 = r8.f();\n r7.f30765m = r0;\n r0 = r7.f30753a;\n r0 = r0 | 2048;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00a2:\n r0 = r8.f();\n r7.f30766n = r0;\n r0 = r7.f30753a;\n r0 = r0 | 4096;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00b0:\n r0 = r8.f();\n r7.f30767o = r0;\n r0 = r7.f30753a;\n r0 = r0 | 8192;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00be:\n r0 = r8.f();\n r7.f30768p = r0;\n r0 = r7.f30753a;\n r0 = r0 | 16384;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00cc:\n r0 = r8.f();\n r7.f30769q = r0;\n r0 = r7.f30753a;\n r1 = 32768; // 0x8000 float:4.5918E-41 double:1.61895E-319;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00dc:\n r0 = r8.f();\n r7.f30770r = r0;\n r0 = r7.f30753a;\n r1 = 65536; // 0x10000 float:9.18355E-41 double:3.2379E-319;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00eb:\n r0 = r8.f();\n r7.f30771s = r0;\n r0 = r7.f30753a;\n r1 = 131072; // 0x20000 float:1.83671E-40 double:6.47582E-319;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x00fa:\n r0 = r8.j();\n r7.f30756d = r0;\n r0 = r7.f30753a;\n r0 = r0 | 4;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0108:\n r0 = r8.i();\n r7.f30772t = r0;\n r0 = r7.f30753a;\n r1 = 262144; // 0x40000 float:3.67342E-40 double:1.295163E-318;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0117:\n r0 = r8.e();\n r7.f30773u = r0;\n r0 = r7.f30753a;\n r1 = 524288; // 0x80000 float:7.34684E-40 double:2.590327E-318;\n r0 = r0 | r1;\n r7.f30753a = r0;\n goto L_0x0002;\n L_0x0126:\n r1 = r7.f30753a;\n r1 = r1 | r6;\n r7.f30753a = r1;\n r1 = r8.o();\n r2 = r8.i();\t Catch:{ IllegalArgumentException -> 0x0151 }\n switch(r2) {\n case 0: goto L_0x015a;\n case 1: goto L_0x015a;\n case 2: goto L_0x015a;\n default: goto L_0x0136;\n };\t Catch:{ IllegalArgumentException -> 0x0151 }\n L_0x0136:\n r3 = new java.lang.IllegalArgumentException;\t Catch:{ IllegalArgumentException -> 0x0151 }\n r4 = 48;\n r5 = new java.lang.StringBuilder;\t Catch:{ IllegalArgumentException -> 0x0151 }\n r5.<init>(r4);\t Catch:{ IllegalArgumentException -> 0x0151 }\n r2 = r5.append(r2);\t Catch:{ IllegalArgumentException -> 0x0151 }\n r4 = \" is not a valid enum PairedDeviceType\";\n r2 = r2.append(r4);\t Catch:{ IllegalArgumentException -> 0x0151 }\n r2 = r2.toString();\t Catch:{ IllegalArgumentException -> 0x0151 }\n r3.<init>(r2);\t Catch:{ IllegalArgumentException -> 0x0151 }\n throw r3;\t Catch:{ IllegalArgumentException -> 0x0151 }\n L_0x0151:\n r2 = move-exception;\n r8.e(r1);\n r7.m4918a(r8, r0);\n goto L_0x0002;\n L_0x015a:\n r7.f30774v = r2;\t Catch:{ IllegalArgumentException -> 0x0151 }\n r2 = r7.f30753a;\t Catch:{ IllegalArgumentException -> 0x0151 }\n r2 = r2 | r6;\n r7.f30753a = r2;\t Catch:{ IllegalArgumentException -> 0x0151 }\n goto L_0x0002;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.play.a.a.ae.b(com.google.protobuf.nano.a):com.google.android.play.a.a.ae\");\n }", "public static void main(String[] args) {\n\t\t/*Tuple[] tuples = new Tuple[]{\n\t\t\tnew Tuple(\"0 0 1 0 0\", \"1 3\", ' '),\n\t\t\tnew Tuple(\"1 0 0 1 1\", \"1 2\", ' '),\n\t\t\tnew Tuple(\"0 0 0 1 1\", \"1 1\", ' '),\n\t\t\tnew Tuple(\"1 1 0 0 1\", \"2 1\", ' '),\n\t\t\tnew Tuple(\"1 1 0 0 1\", \"3 1\", ' '),\n\t\t\tnew Tuple(\"1 1 0 0 1\", \"3 2\", ' '),\n\t\t\tnew Tuple(\"0 0 0 1 0\", \"3 3\", ' '),\n\t\t\tnew Tuple(\"0 1 0 1 1\", \"2 3\", ' ')\n\t\t};\n\t\tdata = new DataSet(tuples);*/\n\t\t\n\t\t//data = Parser.parseAttributes(\"Corel5k-train.arff\", 374);\n\t\tdata = Parser.parseShortNotation(\"diabetes.txt\", 1, new NumericalItemSet(new int[]{}));\n\t\ts = data.s();\n\t\tn = data.getTuples().length;\n\t\tm = data.getTuples()[0].getClassValues().length;\n\t\t\n\t\t/*double u = 0;\n\t\tlong l = 0;\n\t\tfor(int j = 0; j < 10; j++) {\n\t\t\tdouble t = System.currentTimeMillis();\n\t\t\tfor(int i = 0; i < 10000; i++)\n\t\t\t\tu = data.getBluePrint().getOneItemSet(2, 48).ub();\n\t\t\tl += (System.currentTimeMillis() - t);\n\t\t}\n\t\tSystem.out.println(((double)l/10));*/\n\t\n\t\t\n\t\tSystem.out.println(\"Data loaded, \"+data.getTuples().length+\" tuples, \"+\n\t\t\t\tdata.getTuples()[0].getItemSet().getLength()+\" items, \"+\n\t\t\t\tdata.getTuples()[0].getClassValues().length+\" class values\");\n\t\t\t\t\n\t\tStopWatch.tic(\"Full time\");\n\t\tSystem.out.println(icc());\n\t\tStopWatch.printToc(\"Full time\");\n\t}", "private void poetries() {\n\n\t}", "private void arretes_fY(){\n\t\tthis.cube[49] = this.cube[46]; \n\t\tthis.cube[46] = this.cube[48];\n\t\tthis.cube[48] = this.cube[52];\n\t\tthis.cube[52] = this.cube[50];\n\t\tthis.cube[50] = this.cube[49];\n\t}", "private void aretes_aR(){\n\t\tthis.cube[13] = this.cube[52]; \n\t\tthis.cube[52] = this.cube[19];\n\t\tthis.cube[19] = this.cube[1];\n\t\tthis.cube[1] = this.cube[28];\n\t\tthis.cube[28] = this.cube[13];\n\t}", "private final void m710e() {\n /*\n r12 = this;\n akn r0 = r12.f531p\n akl r0 = r0.f601d\n if (r0 == 0) goto L_0x0155\n boolean r1 = r0.f580d\n r2 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)\n if (r1 == 0) goto L_0x0017\n aws r1 = r0.f577a\n long r4 = r1.mo1486c()\n r8 = r4\n goto L_0x0019\n L_0x0017:\n r8 = r2\n L_0x0019:\n int r1 = (r8 > r2 ? 1 : (r8 == r2 ? 0 : -1))\n if (r1 != 0) goto L_0x0122\n ajf r1 = r12.f528m\n akn r2 = r12.f531p\n akl r2 = r2.f602e\n akx r3 = r1.f445c\n r4 = 0\n if (r3 == 0) goto L_0x008a\n boolean r3 = r3.mo486w()\n if (r3 != 0) goto L_0x008a\n akx r3 = r1.f445c\n boolean r3 = r3.mo485v()\n if (r3 == 0) goto L_0x0037\n goto L_0x0042\n L_0x0037:\n if (r0 != r2) goto L_0x008a\n akx r2 = r1.f445c\n boolean r2 = r2.mo359g()\n if (r2 == 0) goto L_0x0042\n goto L_0x008a\n L_0x0042:\n bkr r2 = r1.f446d\n long r2 = r2.mo379b()\n boolean r5 = r1.f447e\n if (r5 == 0) goto L_0x0068\n blf r5 = r1.f443a\n long r5 = r5.mo379b()\n int r7 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1))\n if (r7 >= 0) goto L_0x005c\n blf r2 = r1.f443a\n r2.mo2109d()\n goto L_0x0096\n L_0x005c:\n r1.f447e = r4\n boolean r5 = r1.f448f\n if (r5 == 0) goto L_0x0068\n blf r5 = r1.f443a\n r5.mo2107a()\n L_0x0068:\n blf r5 = r1.f443a\n r5.mo2108a(r2)\n bkr r2 = r1.f446d\n akq r2 = r2.mo376Q()\n blf r3 = r1.f443a\n akq r3 = r3.f4280a\n boolean r3 = r2.equals(r3)\n if (r3 != 0) goto L_0x0096\n blf r3 = r1.f443a\n r3.mo378a(r2)\n aje r3 = r1.f444b\n ake r3 = (p000.ake) r3\n r3.m694a(r2, r4)\n goto L_0x0096\n L_0x008a:\n r2 = 1\n r1.f447e = r2\n boolean r2 = r1.f448f\n if (r2 == 0) goto L_0x0096\n blf r2 = r1.f443a\n r2.mo2107a()\n L_0x0096:\n long r1 = r1.mo379b()\n r12.f513D = r1\n long r0 = r0.mo440b(r1)\n akp r2 = r12.f533r\n long r2 = r2.f623m\n java.util.ArrayList r5 = r12.f530o\n boolean r5 = r5.isEmpty()\n if (r5 != 0) goto L_0x011d\n akp r5 = r12.f533r\n awt r5 = r5.f612b\n boolean r5 = r5.mo1504a()\n if (r5 != 0) goto L_0x011d\n akp r5 = r12.f533r\n long r6 = r5.f613c\n int r8 = (r6 > r2 ? 1 : (r6 == r2 ? 0 : -1))\n if (r8 != 0) goto L_0x00c5\n boolean r6 = r12.f515F\n if (r6 == 0) goto L_0x00c5\n r6 = -1\n long r2 = r2 + r6\n L_0x00c5:\n r12.f515F = r4\n alh r4 = r5.f611a\n awt r5 = r5.f612b\n java.lang.Object r5 = r5.f2566a\n int r4 = r4.mo525a(r5)\n int r5 = r12.f514E\n r6 = 0\n if (r5 <= 0) goto L_0x00e1\n java.util.ArrayList r7 = r12.f530o\n int r5 = r5 + -1\n java.lang.Object r5 = r7.get(r5)\n akb r5 = (p000.akb) r5\n goto L_0x00e3\n L_0x00e1:\n L_0x00e2:\n r5 = r6\n L_0x00e3:\n if (r5 != 0) goto L_0x00e6\n goto L_0x0109\n L_0x00e6:\n int r5 = r5.f502a\n if (r4 >= 0) goto L_0x00eb\n L_0x00ea:\n goto L_0x00f4\n L_0x00eb:\n if (r4 != 0) goto L_0x0109\n r7 = 0\n int r5 = (r2 > r7 ? 1 : (r2 == r7 ? 0 : -1))\n if (r5 >= 0) goto L_0x0109\n goto L_0x00ea\n L_0x00f4:\n int r5 = r12.f514E\n int r5 = r5 + -1\n r12.f514E = r5\n if (r5 <= 0) goto L_0x0108\n java.util.ArrayList r7 = r12.f530o\n int r5 = r5 + -1\n java.lang.Object r5 = r7.get(r5)\n akb r5 = (p000.akb) r5\n goto L_0x00e3\n L_0x0108:\n goto L_0x00e2\n L_0x0109:\n int r2 = r12.f514E\n java.util.ArrayList r3 = r12.f530o\n int r3 = r3.size()\n if (r2 >= r3) goto L_0x011d\n java.util.ArrayList r2 = r12.f530o\n int r3 = r12.f514E\n java.lang.Object r2 = r2.get(r3)\n akb r2 = (p000.akb) r2\n L_0x011d:\n akp r2 = r12.f533r\n r2.f623m = r0\n goto L_0x0140\n L_0x0122:\n r12.m691a(r8)\n akp r0 = r12.f533r\n long r0 = r0.f623m\n int r2 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1))\n if (r2 == 0) goto L_0x0140\n akp r0 = r12.f533r\n awt r7 = r0.f612b\n long r10 = r0.f614d\n r6 = r12\n akp r0 = r6.m686a(r7, r8, r10)\n r12.f533r = r0\n akc r0 = r12.f529n\n r1 = 4\n r0.mo409b(r1)\n L_0x0140:\n akn r0 = r12.f531p\n akl r0 = r0.f603f\n akp r1 = r12.f533r\n long r2 = r0.mo442c()\n r1.f621k = r2\n akp r0 = r12.f533r\n long r1 = r12.m719n()\n r0.f622l = r1\n return\n L_0x0155:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p000.ake.m710e():void\");\n }", "protected abstract void fromSpace( float[] abc );", "public void skystonePos4() {\n }", "public static void enrichmentMaxLowMem(String szinputsegment,String szinputcoorddir,String szinputcoordlist,\n\t\t\t\t int noffsetleft, int noffsetright,\n int nbinsize, boolean bcenter,boolean bunique, boolean busesignal,String szcolfields,\n\t\t\t\t boolean bbaseres, String szoutfile,boolean bcolscaleheat,Color theColor,String sztitle, \n\t\t\t\t\t String szlabelmapping, boolean bprintimage, boolean bstringlabels, boolean bbrowser) throws IOException\n {\n\n\n //for each enrichment category and state label gives a count of how often\n //overlapped by a segment optionally with signal\n\n String szLine;\n String[] files;\n\n if (szinputcoordlist == null)\n {\n File dir = new File(szinputcoorddir);\n\t //we don't have a specific list of files to include\n\t //will use all files in the directory\n\t if (dir.isDirectory())\t \n\t {\n\t //throw new IllegalArgumentException(szinputcoorddir+\" is not a directory!\");\n\t //added in v1.11 to skip hidden files\n\t String[] filesWithHidden = dir.list();\n\t int nnonhiddencount = 0;\n\t for (int nfile = 0; nfile < filesWithHidden.length; nfile++)\n\t {\n\t if (!(new File(filesWithHidden[nfile])).isHidden())\n\t\t{\n\t\t nnonhiddencount++;\n\t\t}\n\t }\t \n\n\t int nactualindex = 0;\n\t files = new String[nnonhiddencount];// dir.list(); \n\t if (nnonhiddencount == 0)\n\t {\n\t throw new IllegalArgumentException(\"No files found in \"+szinputcoorddir);\n\t }\n\n for (int nfile = 0; nfile < filesWithHidden.length; nfile++)\n\t {\n\t if (!(new File(filesWithHidden[nfile])).isHidden())\n\t {\n\t files[nactualindex] = filesWithHidden[nfile];\n\t\t nactualindex++;\n\t }\n\t }\n\t Arrays.sort(files);\n\t szinputcoorddir += \"/\";\n\t }\n\t else\n\t {\n\t files = new String[1];\n\t files[0] = szinputcoorddir;\n\t szinputcoorddir = \"\";\n\t }\n }\n else\n {\n szinputcoorddir += \"/\";\n\t //store in files all file names given in szinputcoordlist\n\t BufferedReader brfiles = Util.getBufferedReader(szinputcoordlist);\n\t ArrayList alfiles = new ArrayList();\n\t while ((szLine = brfiles.readLine())!=null)\n\t {\n\t alfiles.add(szLine);\n\t }\n\t brfiles.close(); \n\t files = new String[alfiles.size()];\n\t for (int nfile = 0; nfile < files.length; nfile++)\n\t {\n\t files[nfile] = (String) alfiles.get(nfile);\n\t }\n }\n\t\n ArrayList alchromindex = new ArrayList(); //stores the index of the chromosome\n\t\n if (busesignal)\n {\n bunique = false;\n }\n\n HashMap hmchromMax = new HashMap(); //maps chromosome to the maximum index\n HashMap hmchromToIndex = new HashMap(); //maps chromosome to an index\n HashMap hmLabelToIndex = new HashMap(); //maps label to an index\n HashMap hmIndexToLabel = new HashMap(); //maps index string to label\n int nmaxlabel=0; // the maximum label found\n String szlabel=\"\";\n boolean busedunderscore = false;\n //reads in the segmentation recording maximum position for each chromosome and\n //maximum label\n BufferedReader brinputsegment = Util.getBufferedReader(szinputsegment);\n while ((szLine = brinputsegment.readLine())!=null)\n {\n\n\t //added v1.24\n\t if (bbrowser)\n\t {\n\t if ((szLine.toLowerCase(Locale.ENGLISH).startsWith(\"browser\"))||(szLine.toLowerCase(Locale.ENGLISH).startsWith(\"track\")))\n\t {\n\t continue;\n\t }\n\t }\n\n\t StringTokenizer st;\n\t if (bstringlabels)\n\t {\n st = new StringTokenizer(szLine,\"\\t\");\n\t }\n\t else\n\t {\n\t st = new StringTokenizer(szLine,\"\\t \");\n }\n\n\t //added in v1.24\n\t int numtokens = st.countTokens();\n\t if (numtokens == 0)\n\t {\n\t //skip blank lines\n\t continue;\n\t }\n\t else if (numtokens < 4)\n\t {\n\t throw new IllegalArgumentException(\"Line \"+szLine+\" in \"+szinputsegment+\" only had \"+numtokens+\" token(s). Expecting at least 4\");\n\t }\n\n\t String szchrom = st.nextToken().trim();\n\t int nbegincoord = Integer.parseInt(st.nextToken().trim());\n\t int nendcoord = Integer.parseInt(st.nextToken().trim());\n\t if (nbegincoord % nbinsize != 0)\n\t {\n\t\tthrow new IllegalArgumentException(\"Binsize of \"+nbinsize+\" does not agree with coordinates in input segment \"+szLine+\". -b binsize should match parameter value to LearnModel or \"+\n \"MakeSegmentation used to produce segmentation. If segmentation is derived from a lift over from another assembly, then the '-b 1' option should be used\");\n\t }\n //int nbegin = nbegincoord/nbinsize;\n\t int nend = (nendcoord-1)/nbinsize;\n szlabel = st.nextToken().trim();\n\t short slabel;\n\n\n if (bstringlabels)\n\t {\n\n\t int nunderscoreindex = szlabel.indexOf(\"_\");\n\n\t if (nunderscoreindex >=0)\n\t {\n\t String szprefix = szlabel.substring(0,nunderscoreindex);\n\n try\n\t {\n\t\t slabel = (short) (Short.parseShort(szprefix));\n\t\t if (slabel > nmaxlabel)\n\t {\n\t nmaxlabel = slabel;\n\t }\n\t\t busedunderscore = true;\n\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+slabel, szlabel);\n\t\t}\n catch (NumberFormatException ex)\n\t\t{\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix.substring(1)));\n\t\t if (slabel > nmaxlabel)\n\t\t {\n\t\t nmaxlabel = slabel;\n\t\t }\n\t\t busedunderscore = true;\n\t\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n\t\t hmIndexToLabel.put(\"\"+slabel, szlabel);\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t if (busedunderscore)\n\t\t {\n\t throw new IllegalArgumentException(\"Not a valid ID before '_' in \"+szlabel+\", while valid ID found for other entries\");\n\t\t }\n\t\t }\n\t\t}\n\t }\n\n\t if (!busedunderscore)\n\t {\n //handle string labels\n\t Short objshort = (Short) hmLabelToIndex.get(szlabel);\n\n\t if (objshort == null)\n\t {\n\t nmaxlabel = hmLabelToIndex.size()+1;\n\t slabel = (short) nmaxlabel;\n\t hmLabelToIndex.put(szlabel, Short.valueOf(slabel));\n \t hmIndexToLabel.put(\"\"+nmaxlabel, szlabel);\n\t }\n\t //else\n\t //{\n\t // slabel = ((Short) objshort).shortValue();\n\t //}\n\t }\n\t }\n\t else\n\t {\n try\n\t {\n slabel = (short) (Short.parseShort(szlabel));\n\t }\n\t catch (NumberFormatException ex)\n\t {\n try\n\t\t{\n slabel = (short) (Short.parseShort(szlabel.substring(1)));\n\t\t}\n\t catch (NumberFormatException ex2)\n\t {\n throw new IllegalArgumentException(\"In fourth column neither state number or ID found in segmentation file. Use '-labels' option to run overlap enrichment treating fourth column as labels\");\n\t\t}\n\t }\n\n\t //alsegments.add(new SegmentRec(szchrom,nbegin,nend,slabel));\n\t if (slabel > nmaxlabel)\n\t {\n\t nmaxlabel = slabel;\n\t }\n\t }\n\n\t Integer objMax = (Integer) hmchromMax.get(szchrom);\n\t if (objMax == null)\n\t {\n\t //System.out.println(\"on chrom \"+szchrom);\n\t hmchromMax.put(szchrom,Integer.valueOf(nend));\n\t hmchromToIndex.put(szchrom, Integer.valueOf(hmchromToIndex.size()));\n\t alchromindex.add(szchrom);\n\t }\n\t else\n\t {\n\t int ncurrmax = objMax.intValue();\n\t if (ncurrmax < nend)\n\t {\n\t hmchromMax.put(szchrom, Integer.valueOf(nend));\t\t \n\t }\n\t }\n }\n brinputsegment.close();\n\n double[][] tallyoverlaplabel = new double[files.length][nmaxlabel+1];\n double[] dsumoverlaplabel = new double[files.length];\n double[] tallylabel = new double[nmaxlabel+1];\n\n int numchroms = alchromindex.size();\n\n for (int nchrom = 0; nchrom < numchroms; nchrom++)\n {\n //ArrayList alsegments = new ArrayList(); //stores all the segments\n\t String szchromwant = (String) alchromindex.get(nchrom);\n\t //System.out.println(\"processing \"+szchromwant);\n\t int nsize = ((Integer) hmchromMax.get(szchromwant)).intValue()+1;\n\t short[] labels = new short[nsize]; //stores the hard label assignments\n\n\t //sets to -1 so missing segments not counted as label 0\n\t for (int npos = 0; npos < nsize; npos++)\n\t {\n labels[npos] = -1;\n\t }\n\n\t brinputsegment = Util.getBufferedReader(szinputsegment);\n\t while ((szLine = brinputsegment.readLine())!=null)\n\t {\n\t StringTokenizer st;\n\t if (bstringlabels)\n\t {\n\t st = new StringTokenizer(szLine,\"\\t\");\n\t }\n\t else\n\t {\n\t st = new StringTokenizer(szLine,\"\\t \");\n\t }\n\n\t String szchrom = st.nextToken().trim();\n\t if (!szchrom.equals(szchromwant)) \n\t continue;\n\n\t int nbegincoord = Integer.parseInt(st.nextToken().trim());\n\t int nendcoord = Integer.parseInt(st.nextToken().trim());\n\n\t //if (nbegincoord % nbinsize != 0)\n\t // {\n\t //\t throw new IllegalArgumentException(\"Binsize of \"+nbinsize+\" does not agree with input segment \"+szLine);\n\t //}\n\t int nbegin = nbegincoord/nbinsize;\n\t int nend = (nendcoord-1)/nbinsize;\n\t szlabel = st.nextToken().trim();\n\t short slabel = -1;\n\n\t if (bstringlabels)\n\t {\n\t\tint nunderscoreindex = szlabel.indexOf(\"_\");\n\n\t\tif (nunderscoreindex >=0)\n\t\t{\n\t\t String szprefix = szlabel.substring(0,nunderscoreindex);\n\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix));\n\t\t busedunderscore = true;\n\t\t }\n catch (NumberFormatException ex)\n\t\t {\n try\n\t\t {\n\t\t slabel = (short) (Short.parseShort(szprefix.substring(1)));\n\t\t\t busedunderscore = true;\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t\t if (busedunderscore)\n\t\t\t {\n\t\t\t throw new IllegalArgumentException(\"Not a valid ID before '_' in \"+szlabel+\", while valid ID found for other entries\");\n\t\t\t }\n\t\t }\n\t\t }\n\t\t}\n\n\t\tif (!busedunderscore)\n\t\t{\n\t //handle string labels\n\t\t Short objshort = (Short) hmLabelToIndex.get(szlabel);\n\t\t slabel = ((Short) objshort).shortValue();\n\t\t}\n\t }\n\t else\n\t {\n try\n\t {\n\t slabel = (short) (Short.parseShort(szlabel));\n\t }\n\t catch (NumberFormatException ex)\n\t {\n try\n\t\t {\n slabel = (short) (Short.parseShort(szlabel.substring(1)));\n\t\t }\n\t\t catch (NumberFormatException ex2)\n\t\t {\n\t\t throw new IllegalArgumentException(\"In fourth column neither state number or ID found in segmentation file. Use '-labels' option to run overlap enrichment treating fourth column as labels\");\n\t }\n\t\t}\n\t }\n\n\t if (nbegin < 0)\n\t {\n\t nbegin = 0;\n\t }\n\n\t if (nend >= labels.length)\n\t {\n\t nend = labels.length - 1;\n\t }\n\n\t //SegmentRec theSegmentRec = (SegmentRec) alsegments.get(nindex);\n\t //int nbegin = theSegmentRec.nbegin;\n\t //int nend = theSegmentRec.nend;\n\t //short slabel = theSegmentRec.slabel;\n\t //int nchrom = ((Integer) hmchromToIndex.get(theSegmentRec.szchrom)).intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\t //stores each label position in the genome\n\t for (int npos = nbegin; npos <= nend; npos++)\n\t {\n\t labels[npos] = slabel;\n\t //tallylabel[slabel]++; \n\t }\n\t tallylabel[slabel] += (nend-nbegin)+1;\n\t }\n\n\n\t for (int nfile = 0; nfile < files.length; nfile++)\n\t {\n\t double[] tallyoverlaplabel_nfile = tallyoverlaplabel[nfile];\n\n\t int nchromindex = 0;\n\t int nstartindex = 1;\n\t int nendindex = 2;\n\t int nsignalindex = 3;\n\n\t if (szcolfields != null)\n\t {\n\t StringTokenizer stcolfields = new StringTokenizer(szcolfields,\",\");\n\t\tnchromindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t\tnstartindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t\tnendindex = Integer.parseInt(stcolfields.nextToken().trim());\n\n\t if (busesignal)\n\t {\n\t nsignalindex = Integer.parseInt(stcolfields.nextToken().trim());\n\t }\n\t }\n\n \t \n if (bunique)\n\t {\n\t //Iterator itrChroms = hmchromToIndex.entrySet().iterator();\n\t //while (itrChroms.hasNext())\n\t //{\n\t //Map.Entry pairs = (Map.Entry) itrChroms.next();\n\t //String szchrom =(String) pairs.getKey();\n\t //int nchrom = ((Integer) pairs.getValue()).intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\n\t //reading in the coordinates to overlap with\n BufferedReader brcoords = Util.getBufferedReader(szinputcoorddir +files[nfile]);\n\t ArrayList alrecs = new ArrayList();\n\t while ((szLine = brcoords.readLine())!=null)\n\t {\n\t if (szLine.trim().equals(\"\")) continue;\n\t String[] szLineA = szLine.split(\"\\\\s+\");\n\t\t if (nstartindex >= szLineA.length)\n\t\t {\n\t\t throw new IllegalArgumentException(nstartindex+\" is an invalid column index for \"+szLine+\" in \"+szinputcoorddir+files[nfile]);\n\t\t }\n\n if (nendindex >= szLineA.length)\n\t\t {\n\t\t throw new IllegalArgumentException(nendindex+\" is an invalid column index for \"+szLine+\" in \"+szinputcoorddir+files[nfile]);\n\t\t }\n\n\t String szcurrchrom = szLineA[nchromindex];\n\t \t if (szchromwant.equals(szcurrchrom))\n\t\t {\n\t\t int nbeginactual =Integer.parseInt(szLineA[nstartindex])-noffsetleft;\n\t\t int nendactual =Integer.parseInt(szLineA[nendindex])-noffsetright;\n\t\t if (bcenter)\n\t\t {\n\t\t nbeginactual = (nbeginactual+nendactual)/2;\n\t\t nendactual = nbeginactual;\n\t\t }\n\t\t alrecs.add(new Interval(nbeginactual,nendactual));\n\t\t }\n\t\t}\n\t brcoords.close();\n\n\t\tObject[] alrecA = alrecs.toArray();\n\t\tArrays.sort(alrecA,new IntervalCompare());\n\n\t\tboolean bclosed = true;\n\t int nintervalstart = -1;\n\t\tint nintervalend = -1;\n\t\tboolean bdone = false;\n\n\t\tfor (int nindex = 0; (nindex <= alrecA.length&&(alrecA.length>0)); nindex++)\n\t\t{\n\t\t int ncurrstart = -1;\n\t\t int ncurrend = -1;\n\n\t\t if (nindex == alrecA.length)\n\t\t {\n\t\t bdone = true;\n\t\t }\n\t\t else \n\t\t {\n\t\t ncurrstart = ((Interval) alrecA[nindex]).nstart;\n\t\t ncurrend = ((Interval) alrecA[nindex]).nend;\n if (nindex == 0)\n\t\t {\n\t\t nintervalstart = ncurrstart;\n\t\t\t nintervalend = ncurrend;\n\t\t }\n\t\t else if (ncurrstart <= nintervalend)\n\t\t {\n\t\t //this read is still in the active interval\n\t\t //extending the current active interval \n\t\t if (ncurrend > nintervalend)\n\t\t {\n\t\t nintervalend = ncurrend;\n\t\t }\n\t\t }\t\t \n\t\t else \n\t\t {\n\t\t //just finished the current active interval\n\t\t bdone = true;\n\t\t }\n\t\t }\n\n\t\t if (bdone)\n\t {\t\t \t\t\t\t\t\t\n\t int nbegin = nintervalstart/nbinsize;\n\t\t int nend = nintervalend/nbinsize;\n\n\t\t if (nbegin < 0)\n\t\t {\n\t\t nbegin = 0;\n\t\t }\n\n\t\t if (nend >= labels.length)\n\t\t {\n\t\t nend = labels.length - 1;\n\t\t }\n\n\t for (int nbin = nbegin; nbin <= nend; nbin++)\n\t {\n\t\t if (labels[nbin]>=0)\n\t\t {\n\t\t tallyoverlaplabel_nfile[labels[nbin]]++;\n\t\t }\n\t\t }\n\n\t\t if (bbaseres)\n\t\t { \n\t\t //dbeginfrac represents the fraction of bases the nbegin interval\n\t\t //which came after the actual nbeginactual\n\t double dbeginfrac = (nintervalstart - nbegin*nbinsize)/(double) nbinsize;\n\t\t\t \n\t\t\t //dendfrac represents the fraction of bases after the end position in the interval\n\t double dendfrac = ((nend+1)*nbinsize-nintervalend-1)/(double) nbinsize;\n\t\t\t \n\t\t\t if ((nbegin < labels.length)&&(labels[nbegin]>=0)&&(dbeginfrac>0))\n\t\t { \t\t\t \n\t\t //only counted the bases if nbegin was less than labels.length \n\t\t tallyoverlaplabel_nfile[labels[nbegin]]-=dbeginfrac;\n\t\t\t }\n\n if ((nend < labels.length)&&(labels[nend]>=0)&&(dendfrac>0))\n\t\t {\n\t\t //only counted the bases if nend was less than labels.length \n\t\t tallyoverlaplabel_nfile[labels[nend]]-=dendfrac;\n\t\t\t }\n\t\t }\t\t\t \n\n\t\t nintervalstart = ncurrstart; \n\t\t nintervalend = ncurrend;\n\t\t bdone = false;\n\t\t }\t \n\t\t}\n\t\t //}\n\t }\n\t else\n\t {\n\t BufferedReader brcoords = Util.getBufferedReader(szinputcoorddir +files[nfile]);\n\t while ((szLine = brcoords.readLine())!=null)\n\t {\n\t if (szLine.trim().equals(\"\")) continue;\n\t String[] szLineA = szLine.split(\"\\\\s+\");\n\n\t String szchrom = szLineA[nchromindex];\n\t\t if (!szchromwant.equals(szchrom))\n\t\t continue;\n\n\t int nbeginactual =Integer.parseInt(szLineA[nstartindex])-noffsetleft;\n\t int nbegin = nbeginactual/nbinsize;\n\n\t\t int nendactual =Integer.parseInt(szLineA[nendindex])-noffsetright;\n\t int nend = nendactual/nbinsize;\n\n\t\t double damount;\n\t if ((busesignal)&&(nsignalindex < szLineA.length))\n\t {\n\t \t damount = Double.parseDouble(szLineA[nsignalindex]);\n\t\t }\n\t else\n\t {\n\t damount = 1;\n\t\t }\n\n\t //Integer objChrom = (Integer) hmchromToIndex.get(szchrom);\n\t //if (objChrom != null)\n\t\t //{\n\t\t //we have the chromosome corresponding to this read\n\t //int nchrom = objChrom.intValue();\n\t //short[] labels_nchrom = labels[nchrom];\n\n\t\t if (bcenter)\n\t {\n\t //using the center position of the interval only\n\t\t int ncenter = (nbeginactual+nendactual)/(2*nbinsize);\n\t\t if ((ncenter < labels.length)&&(labels[ncenter]>=0))\n\t\t {\n\t tallyoverlaplabel_nfile[labels[ncenter]]+=damount;\t\t\t \n\t\t }\n\t\t }\n\t else\n\t {\n\t\t if (nbegin < 0)\n\t\t {\n\t\t nbegin = 0;\n\t\t }\n\t\t //using the full interval range\n\t\t //no requirement on uniqueness\n\t\t if (nend >= labels.length)\n\t\t {\n\t\t nend = labels.length - 1;\n\t\t }\n\t\t\t\n\t for (int nindex = nbegin; nindex <= nend; nindex++)\n\t {\n\t\t if (labels[nindex]>=0)\n\t\t {\n\t\t //increment overlap tally not checking for uniqueness\n \t tallyoverlaplabel_nfile[labels[nindex]]+=damount;\n\t\t\t }\n\t\t }\t \n\n\t\t if (bbaseres)\n\t\t { \n\t\t //dbeginfrac represents the fraction of bases the nbegin interval\n\t\t\t //which came after the actual nbeginactual\n\t double dbeginfrac = (nbeginactual - nbegin*nbinsize)/(double) nbinsize;\n\t\t\t \n\t\t\t //dendfrac represents the fraction of bases after the end position in the interval\n\t double dendfrac = ((nend+1)*nbinsize-nendactual-1)/(double) nbinsize;\n\n\t\t\t if ((nbegin < labels.length)&&(labels[nbegin]>=0)&&(dbeginfrac>0))\n\t\t\t { \n\t\t\t //only counted the bases if nbegin was less than labels.length \n\t\t\t tallyoverlaplabel_nfile[labels[nbegin]]-=damount*dbeginfrac;\n\t\t\t }\n\n if ((nend < labels.length)&&(labels[nend]>=0)&&(dendfrac>0))\n\t\t {\n\t\t //only counted the bases if nend was less than labels.length \n\t\t\t tallyoverlaplabel_nfile[labels[nend]]-=damount*dendfrac;\n\t\t\t }\t\t\t \n\t\t }\n\t\t }\n\t\t}\t \n\t\tbrcoords.close();\n\t }\n\t }\n }\n\n\n for (int nfile = 0; nfile < files.length; nfile++)\n {\n\t double[] tallyoverlaplabel_nfile = tallyoverlaplabel[nfile];\n\n\t for (int nindex = 0; nindex < tallyoverlaplabel_nfile.length; nindex++)\n {\n dsumoverlaplabel[nfile] += tallyoverlaplabel_nfile[nindex];\n }\n\t\t\n if (dsumoverlaplabel[nfile] < EPSILONOVERLAP) // 0.00000001)\n {\n\t throw new IllegalArgumentException(\"Coordinates in \"+files[nfile]+\" not assigned to any state. Check if chromosome naming in \"+files[nfile]+\n\t\t\t\t\t\t \" match those in the segmentation file.\");\n\t }\n\t}\n\n\toutputenrichment(szoutfile, files,tallyoverlaplabel, tallylabel, dsumoverlaplabel,theColor,\n\t\t\t bcolscaleheat,ChromHMM.convertCharOrderToStringOrder(szlabel.charAt(0)),sztitle,0,szlabelmapping,szlabel.charAt(0), bprintimage, bstringlabels, hmIndexToLabel);\n }", "private void mo3747b() {\n this.f1427B.add(this.f1490s);\n this.f1427B.add(this.f1491t);\n this.f1427B.add(this.f1492u);\n this.f1427B.add(this.f1493v);\n this.f1427B.add(this.f1495x);\n this.f1427B.add(this.f1496y);\n this.f1427B.add(this.f1497z);\n this.f1427B.add(this.f1494w);\n }", "private final void zaa(java.lang.StringBuilder r10, java.util.Map<java.lang.String, com.google.android.gms.common.server.response.FastJsonResponse.Field<?, ?>> r11, android.os.Parcel r12) {\n /*\n r9 = this;\n android.util.SparseArray r0 = new android.util.SparseArray\n r0.<init>()\n java.util.Set r11 = r11.entrySet()\n java.util.Iterator r11 = r11.iterator()\n L_0x000d:\n boolean r1 = r11.hasNext()\n if (r1 == 0) goto L_0x0027\n java.lang.Object r1 = r11.next()\n java.util.Map$Entry r1 = (java.util.Map.Entry) r1\n java.lang.Object r2 = r1.getValue()\n com.google.android.gms.common.server.response.FastJsonResponse$Field r2 = (com.google.android.gms.common.server.response.FastJsonResponse.Field) r2\n int r2 = r2.getSafeParcelableFieldId()\n r0.put(r2, r1)\n goto L_0x000d\n L_0x0027:\n r11 = 123(0x7b, float:1.72E-43)\n r10.append(r11)\n int r11 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.validateObjectHeader(r12)\n r1 = 1\n r2 = 0\n r3 = 0\n L_0x0033:\n int r4 = r12.dataPosition()\n if (r4 >= r11) goto L_0x0262\n int r4 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readHeader(r12)\n int r5 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.getFieldId(r4)\n java.lang.Object r5 = r0.get(r5)\n java.util.Map$Entry r5 = (java.util.Map.Entry) r5\n if (r5 == 0) goto L_0x0033\n if (r3 == 0) goto L_0x0050\n java.lang.String r3 = \",\"\n r10.append(r3)\n L_0x0050:\n java.lang.Object r3 = r5.getKey()\n java.lang.String r3 = (java.lang.String) r3\n java.lang.Object r5 = r5.getValue()\n com.google.android.gms.common.server.response.FastJsonResponse$Field r5 = (com.google.android.gms.common.server.response.FastJsonResponse.Field) r5\n java.lang.String r6 = \"\\\"\"\n r10.append(r6)\n r10.append(r3)\n java.lang.String r3 = \"\\\":\"\n r10.append(r3)\n boolean r3 = r5.zacn()\n if (r3 == 0) goto L_0x010a\n int r3 = r5.zapt\n switch(r3) {\n case 0: goto L_0x00f9;\n case 1: goto L_0x00f4;\n case 2: goto L_0x00eb;\n case 3: goto L_0x00e2;\n case 4: goto L_0x00d9;\n case 5: goto L_0x00d4;\n case 6: goto L_0x00cb;\n case 7: goto L_0x00c6;\n case 8: goto L_0x00c1;\n case 9: goto L_0x00c1;\n case 10: goto L_0x0097;\n case 11: goto L_0x008f;\n default: goto L_0x0074;\n }\n L_0x0074:\n java.lang.IllegalArgumentException r10 = new java.lang.IllegalArgumentException\n int r11 = r5.zapt\n r12 = 36\n java.lang.StringBuilder r0 = new java.lang.StringBuilder\n r0.<init>(r12)\n java.lang.String r12 = \"Unknown field out type = \"\n r0.append(r12)\n r0.append(r11)\n java.lang.String r11 = r0.toString()\n r10.<init>(r11)\n throw r10\n L_0x008f:\n java.lang.IllegalArgumentException r10 = new java.lang.IllegalArgumentException\n java.lang.String r11 = \"Method does not accept concrete type.\"\n r10.<init>(r11)\n throw r10\n L_0x0097:\n android.os.Bundle r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBundle(r12, r4)\n java.util.HashMap r4 = new java.util.HashMap\n r4.<init>()\n java.util.Set r6 = r3.keySet()\n java.util.Iterator r6 = r6.iterator()\n L_0x00a8:\n boolean r7 = r6.hasNext()\n if (r7 == 0) goto L_0x00bc\n java.lang.Object r7 = r6.next()\n java.lang.String r7 = (java.lang.String) r7\n java.lang.String r8 = r3.getString(r7)\n r4.put(r7, r8)\n goto L_0x00a8\n L_0x00bc:\n java.lang.Object r3 = zab(r5, (java.lang.Object) r4)\n goto L_0x0105\n L_0x00c1:\n byte[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createByteArray(r12, r4)\n goto L_0x0101\n L_0x00c6:\n java.lang.String r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createString(r12, r4)\n goto L_0x0101\n L_0x00cb:\n boolean r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readBoolean(r12, r4)\n java.lang.Boolean r3 = java.lang.Boolean.valueOf(r3)\n goto L_0x0101\n L_0x00d4:\n java.math.BigDecimal r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBigDecimal(r12, r4)\n goto L_0x0101\n L_0x00d9:\n double r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readDouble(r12, r4)\n java.lang.Double r3 = java.lang.Double.valueOf(r3)\n goto L_0x0101\n L_0x00e2:\n float r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readFloat(r12, r4)\n java.lang.Float r3 = java.lang.Float.valueOf(r3)\n goto L_0x0101\n L_0x00eb:\n long r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readLong(r12, r4)\n java.lang.Long r3 = java.lang.Long.valueOf(r3)\n goto L_0x0101\n L_0x00f4:\n java.math.BigInteger r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBigInteger(r12, r4)\n goto L_0x0101\n L_0x00f9:\n int r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readInt(r12, r4)\n java.lang.Integer r3 = java.lang.Integer.valueOf(r3)\n L_0x0101:\n java.lang.Object r3 = zab(r5, (java.lang.Object) r3)\n L_0x0105:\n r9.zab((java.lang.StringBuilder) r10, (com.google.android.gms.common.server.response.FastJsonResponse.Field<?, ?>) r5, (java.lang.Object) r3)\n goto L_0x025f\n L_0x010a:\n boolean r3 = r5.zapu\n if (r3 == 0) goto L_0x0188\n java.lang.String r3 = \"[\"\n r10.append(r3)\n int r3 = r5.zapt\n switch(r3) {\n case 0: goto L_0x017d;\n case 1: goto L_0x0175;\n case 2: goto L_0x016d;\n case 3: goto L_0x0165;\n case 4: goto L_0x015d;\n case 5: goto L_0x0158;\n case 6: goto L_0x0150;\n case 7: goto L_0x0148;\n case 8: goto L_0x0140;\n case 9: goto L_0x0140;\n case 10: goto L_0x0140;\n case 11: goto L_0x0120;\n default: goto L_0x0118;\n }\n L_0x0118:\n java.lang.IllegalStateException r10 = new java.lang.IllegalStateException\n java.lang.String r11 = \"Unknown field type out.\"\n r10.<init>(r11)\n throw r10\n L_0x0120:\n android.os.Parcel[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createParcelArray(r12, r4)\n int r4 = r3.length\n r6 = 0\n L_0x0126:\n if (r6 >= r4) goto L_0x0184\n if (r6 <= 0) goto L_0x012f\n java.lang.String r7 = \",\"\n r10.append(r7)\n L_0x012f:\n r7 = r3[r6]\n r7.setDataPosition(r2)\n java.util.Map r7 = r5.zacq()\n r8 = r3[r6]\n r9.zaa((java.lang.StringBuilder) r10, (java.util.Map<java.lang.String, com.google.android.gms.common.server.response.FastJsonResponse.Field<?, ?>>) r7, (android.os.Parcel) r8)\n int r6 = r6 + 1\n goto L_0x0126\n L_0x0140:\n java.lang.UnsupportedOperationException r10 = new java.lang.UnsupportedOperationException\n java.lang.String r11 = \"List of type BASE64, BASE64_URL_SAFE, or STRING_MAP is not supported\"\n r10.<init>(r11)\n throw r10\n L_0x0148:\n java.lang.String[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createStringArray(r12, r4)\n com.google.android.gms.common.util.ArrayUtils.writeStringArray(r10, r3)\n goto L_0x0184\n L_0x0150:\n boolean[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBooleanArray(r12, r4)\n com.google.android.gms.common.util.ArrayUtils.writeArray((java.lang.StringBuilder) r10, (boolean[]) r3)\n goto L_0x0184\n L_0x0158:\n java.math.BigDecimal[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBigDecimalArray(r12, r4)\n goto L_0x0179\n L_0x015d:\n double[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createDoubleArray(r12, r4)\n com.google.android.gms.common.util.ArrayUtils.writeArray((java.lang.StringBuilder) r10, (double[]) r3)\n goto L_0x0184\n L_0x0165:\n float[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createFloatArray(r12, r4)\n com.google.android.gms.common.util.ArrayUtils.writeArray((java.lang.StringBuilder) r10, (float[]) r3)\n goto L_0x0184\n L_0x016d:\n long[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createLongArray(r12, r4)\n com.google.android.gms.common.util.ArrayUtils.writeArray((java.lang.StringBuilder) r10, (long[]) r3)\n goto L_0x0184\n L_0x0175:\n java.math.BigInteger[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBigIntegerArray(r12, r4)\n L_0x0179:\n com.google.android.gms.common.util.ArrayUtils.writeArray((java.lang.StringBuilder) r10, (T[]) r3)\n goto L_0x0184\n L_0x017d:\n int[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createIntArray(r12, r4)\n com.google.android.gms.common.util.ArrayUtils.writeArray((java.lang.StringBuilder) r10, (int[]) r3)\n L_0x0184:\n java.lang.String r3 = \"]\"\n goto L_0x0227\n L_0x0188:\n int r3 = r5.zapt\n switch(r3) {\n case 0: goto L_0x0258;\n case 1: goto L_0x0250;\n case 2: goto L_0x0248;\n case 3: goto L_0x0240;\n case 4: goto L_0x0238;\n case 5: goto L_0x0233;\n case 6: goto L_0x022b;\n case 7: goto L_0x0215;\n case 8: goto L_0x0207;\n case 9: goto L_0x01f9;\n case 10: goto L_0x01a5;\n case 11: goto L_0x0195;\n default: goto L_0x018d;\n }\n L_0x018d:\n java.lang.IllegalStateException r10 = new java.lang.IllegalStateException\n java.lang.String r11 = \"Unknown field type out\"\n r10.<init>(r11)\n throw r10\n L_0x0195:\n android.os.Parcel r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createParcel(r12, r4)\n r3.setDataPosition(r2)\n java.util.Map r4 = r5.zacq()\n r9.zaa((java.lang.StringBuilder) r10, (java.util.Map<java.lang.String, com.google.android.gms.common.server.response.FastJsonResponse.Field<?, ?>>) r4, (android.os.Parcel) r3)\n goto L_0x025f\n L_0x01a5:\n android.os.Bundle r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBundle(r12, r4)\n java.util.Set r4 = r3.keySet()\n r4.size()\n java.lang.String r5 = \"{\"\n r10.append(r5)\n java.util.Iterator r4 = r4.iterator()\n r5 = 1\n L_0x01ba:\n boolean r6 = r4.hasNext()\n if (r6 == 0) goto L_0x01f6\n java.lang.Object r6 = r4.next()\n java.lang.String r6 = (java.lang.String) r6\n if (r5 != 0) goto L_0x01cd\n java.lang.String r5 = \",\"\n r10.append(r5)\n L_0x01cd:\n java.lang.String r5 = \"\\\"\"\n r10.append(r5)\n r10.append(r6)\n java.lang.String r5 = \"\\\"\"\n r10.append(r5)\n java.lang.String r5 = \":\"\n r10.append(r5)\n java.lang.String r5 = \"\\\"\"\n r10.append(r5)\n java.lang.String r5 = r3.getString(r6)\n java.lang.String r5 = com.google.android.gms.common.util.JsonUtils.escapeString(r5)\n r10.append(r5)\n java.lang.String r5 = \"\\\"\"\n r10.append(r5)\n r5 = 0\n goto L_0x01ba\n L_0x01f6:\n java.lang.String r3 = \"}\"\n goto L_0x0227\n L_0x01f9:\n byte[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createByteArray(r12, r4)\n java.lang.String r4 = \"\\\"\"\n r10.append(r4)\n java.lang.String r3 = com.google.android.gms.common.util.Base64Utils.encodeUrlSafe(r3)\n goto L_0x0222\n L_0x0207:\n byte[] r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createByteArray(r12, r4)\n java.lang.String r4 = \"\\\"\"\n r10.append(r4)\n java.lang.String r3 = com.google.android.gms.common.util.Base64Utils.encode(r3)\n goto L_0x0222\n L_0x0215:\n java.lang.String r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createString(r12, r4)\n java.lang.String r4 = \"\\\"\"\n r10.append(r4)\n java.lang.String r3 = com.google.android.gms.common.util.JsonUtils.escapeString(r3)\n L_0x0222:\n r10.append(r3)\n java.lang.String r3 = \"\\\"\"\n L_0x0227:\n r10.append(r3)\n goto L_0x025f\n L_0x022b:\n boolean r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readBoolean(r12, r4)\n r10.append(r3)\n goto L_0x025f\n L_0x0233:\n java.math.BigDecimal r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBigDecimal(r12, r4)\n goto L_0x0254\n L_0x0238:\n double r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readDouble(r12, r4)\n r10.append(r3)\n goto L_0x025f\n L_0x0240:\n float r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readFloat(r12, r4)\n r10.append(r3)\n goto L_0x025f\n L_0x0248:\n long r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readLong(r12, r4)\n r10.append(r3)\n goto L_0x025f\n L_0x0250:\n java.math.BigInteger r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.createBigInteger(r12, r4)\n L_0x0254:\n r10.append(r3)\n goto L_0x025f\n L_0x0258:\n int r3 = com.google.android.gms.common.internal.safeparcel.SafeParcelReader.readInt(r12, r4)\n r10.append(r3)\n L_0x025f:\n r3 = 1\n goto L_0x0033\n L_0x0262:\n int r0 = r12.dataPosition()\n if (r0 != r11) goto L_0x026e\n r11 = 125(0x7d, float:1.75E-43)\n r10.append(r11)\n return\n L_0x026e:\n com.google.android.gms.common.internal.safeparcel.SafeParcelReader$ParseException r10 = new com.google.android.gms.common.internal.safeparcel.SafeParcelReader$ParseException\n r0 = 37\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>(r0)\n java.lang.String r0 = \"Overread allowed size end=\"\n r1.append(r0)\n r1.append(r11)\n java.lang.String r11 = r1.toString()\n r10.<init>(r11, r12)\n throw r10\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.common.server.response.SafeParcelResponse.zaa(java.lang.StringBuilder, java.util.Map, android.os.Parcel):void\");\n }", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "public void mo3863o() {\n /*\n r46 = this;\n r1 = r46\n android.content.Context r0 = r1.f3510a\n boolean r0 = p000.C0432eo.m1606a(r0)\n r6 = -26206573778092(0xffffe82a4e7aab54, double:NaN)\n r2 = -26137854301356(0xffffe83a4e7aab54, double:NaN)\n r8 = -26107789530284(0xffffe8414e7aab54, double:NaN)\n r18 = -27091337041068(0xffffe75c4e7aab54, double:NaN)\n r20 = 2\n r21 = -26726264820908(0xffffe7b14e7aab54, double:NaN)\n r30 = -26756329591980(0xffffe7aa4e7aab54, double:NaN)\n r32 = -26919538349228(0xffffe7844e7aab54, double:NaN)\n r15 = 4\n r14 = 28\n r44 = -27061272269996(0xffffe7634e7aab54, double:NaN)\n r10 = 0\n java.lang.Integer r11 = java.lang.Integer.valueOf(r10)\n r12 = 1\n java.lang.Integer r13 = java.lang.Integer.valueOf(r12)\n if (r0 == 0) goto L_0x0246\n fo r0 = p000.C0489fo.USB\n go r4 = p000.C0544go.f2400t\n r1.mo3857e(r12, r0, r4)\n go r4 = p000.C0544go.f2344F\n r1.mo3857e(r10, r0, r4)\n ko r5 = r1.f3511b\n java.lang.Boolean r40 = java.lang.Boolean.TRUE\n r5.getClass()\n java.lang.String r0 = p000.C0432eo.m1607b(r0)\n if (r0 == 0) goto L_0x005d\n L_0x005a:\n r43 = r0\n goto L_0x0067\n L_0x005d:\n r25 = -22512901903532(0xffffeb864e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r25)\n goto L_0x005a\n L_0x0067:\n boolean r0 = r43.isEmpty()\n if (r0 == 0) goto L_0x0091\n boolean r0 = r4.mo2961a()\n if (r0 != 0) goto L_0x0091\n java.lang.String r0 = p000.C0200av.m970a(r8)\n java.lang.StringBuilder r13 = new java.lang.StringBuilder\n r13.<init>()\n r8 = -26949603120300(0xffffe77d4e7aab54, double:NaN)\n r4 = r13\n r5 = r14\n p000.C0279ch.m1112i(r2, r4, r5, r6)\n r2 = 4\n r3 = 1\n r4 = 28\n r6 = -26979667891372(0xffffe7764e7aab54, double:NaN)\n goto L_0x0438\n L_0x0091:\n r8 = -26949603120300(0xffffe77d4e7aab54, double:NaN)\n int r0 = android.os.Build.VERSION.SDK_INT\n if (r0 >= r14) goto L_0x0164\n java.lang.String r0 = r4.f2410c\n go r2 = p000.C0544go.f2374g\n if (r4 == r2) goto L_0x00ab\n go r2 = p000.C0544go.f2376h\n if (r4 == r2) goto L_0x00ab\n go r2 = p000.C0544go.f2352N\n if (r4 != r2) goto L_0x00a9\n goto L_0x00ab\n L_0x00a9:\n r2 = 0\n goto L_0x00ac\n L_0x00ab:\n r2 = 1\n L_0x00ac:\n if (r2 == 0) goto L_0x00b7\n r2 = -25996120380588(0xffffe85b4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r2)\n L_0x00b7:\n java.lang.reflect.Method r2 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x00da }\n java.lang.Class[] r2 = r2.getParameterTypes() // Catch:{ Exception -> 0x00da }\n int r2 = r2.length // Catch:{ Exception -> 0x00da }\n if (r2 != r15) goto L_0x00dc\n java.lang.reflect.Method r2 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x00da }\n java.lang.Class<?> r3 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x00da }\n java.lang.Object[] r5 = new java.lang.Object[r15] // Catch:{ Exception -> 0x00da }\n int r4 = r4.f2409b // Catch:{ Exception -> 0x00da }\n java.lang.Integer r4 = java.lang.Integer.valueOf(r4) // Catch:{ Exception -> 0x00da }\n r5[r10] = r4 // Catch:{ Exception -> 0x00da }\n r5[r12] = r13 // Catch:{ Exception -> 0x00da }\n r5[r20] = r43 // Catch:{ Exception -> 0x00da }\n r4 = 3\n r5[r4] = r0 // Catch:{ Exception -> 0x00da }\n java.lang.Object r0 = r2.invoke(r3, r5) // Catch:{ Exception -> 0x00da }\n goto L_0x00f3\n L_0x00da:\n r0 = move-exception\n goto L_0x0104\n L_0x00dc:\n java.lang.reflect.Method r0 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x00da }\n java.lang.Class<?> r2 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x00da }\n r3 = 3\n java.lang.Object[] r3 = new java.lang.Object[r3] // Catch:{ Exception -> 0x00da }\n int r4 = r4.f2409b // Catch:{ Exception -> 0x00da }\n java.lang.Integer r4 = java.lang.Integer.valueOf(r4) // Catch:{ Exception -> 0x00da }\n r3[r10] = r4 // Catch:{ Exception -> 0x00da }\n r3[r12] = r13 // Catch:{ Exception -> 0x00da }\n r3[r20] = r43 // Catch:{ Exception -> 0x00da }\n java.lang.Object r0 = r0.invoke(r2, r3) // Catch:{ Exception -> 0x00da }\n L_0x00f3:\n java.lang.Integer r0 = (java.lang.Integer) r0 // Catch:{ Exception -> 0x00da }\n int r0 = r0.intValue() // Catch:{ Exception -> 0x00da }\n r2 = 4\n r3 = 1\n r4 = 28\n r6 = -26979667891372(0xffffe7764e7aab54, double:NaN)\n goto L_0x0223\n L_0x0104:\n r2 = -26077724759212(0xffffe8484e7aab54, double:NaN)\n java.lang.String r2 = p000.C0200av.m970a(r2)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r2)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r2 = p000.C0279ch.m1104a(r23, r25, r26, r27, r28)\n java.lang.String r2 = p000.C0279ch.m1118o(r0, r2, r8)\n r3 = -26979667891372(0xffffe7764e7aab54, double:NaN)\n java.lang.Throwable r17 = p000.C0279ch.m1107d(r3, r2, r0)\n if (r17 == 0) goto L_0x0145\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n r6 = r3\n r3 = 1\n r12 = r18\n r4 = 28\n r14 = r2\n r2 = 4\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x015f\n L_0x0145:\n r6 = r3\n r2 = 4\n r3 = 1\n r4 = 28\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x015f:\n p000.C0550gu.m1821c(r0)\n goto L_0x0221\n L_0x0164:\n r2 = 4\n r3 = 1\n r6 = -26979667891372(0xffffe7764e7aab54, double:NaN)\n r15 = 28\n android.media.AudioManager r0 = r5.f3020a\n if (r0 != 0) goto L_0x018b\n r4 = -24411277448364(0xffffe9cc4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r4)\n r4 = -24441342219436(0xffffe9c54e7aab54, double:NaN)\n java.lang.String r4 = p000.C0200av.m970a(r4)\n p000.C0550gu.m1819a(r0, r4)\n r0 = 1\n L_0x0187:\n r4 = 28\n goto L_0x0223\n L_0x018b:\n r16 = -24518651630764(0xffffe9b34e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r16)\n java.lang.reflect.Method r12 = p000.C0735ko.f3017f // Catch:{ all -> 0x01ce }\n java.lang.Class[] r12 = r12.getParameterTypes() // Catch:{ all -> 0x01ce }\n int r12 = r12.length // Catch:{ all -> 0x01ce }\n r14 = 3\n if (r12 != r14) goto L_0x01b4\n java.lang.reflect.Method r12 = p000.C0735ko.f3017f // Catch:{ all -> 0x01ce }\n android.media.AudioManager r5 = r5.f3020a // Catch:{ all -> 0x01ce }\n java.lang.Object[] r14 = new java.lang.Object[r14] // Catch:{ all -> 0x01ce }\n int r4 = r4.f2409b // Catch:{ all -> 0x01ce }\n java.lang.Integer r4 = java.lang.Integer.valueOf(r4) // Catch:{ all -> 0x01ce }\n r14[r10] = r4 // Catch:{ all -> 0x01ce }\n r14[r3] = r13 // Catch:{ all -> 0x01ce }\n r14[r20] = r0 // Catch:{ all -> 0x01ce }\n r12.invoke(r5, r14) // Catch:{ all -> 0x01ce }\n goto L_0x01cc\n L_0x01b4:\n java.lang.reflect.Method r12 = p000.C0735ko.f3017f // Catch:{ all -> 0x01ce }\n android.media.AudioManager r5 = r5.f3020a // Catch:{ all -> 0x01ce }\n java.lang.Object[] r14 = new java.lang.Object[r2] // Catch:{ all -> 0x01ce }\n int r4 = r4.f2409b // Catch:{ all -> 0x01ce }\n java.lang.Integer r4 = java.lang.Integer.valueOf(r4) // Catch:{ all -> 0x01ce }\n r14[r10] = r4 // Catch:{ all -> 0x01ce }\n r14[r3] = r13 // Catch:{ all -> 0x01ce }\n r14[r20] = r43 // Catch:{ all -> 0x01ce }\n r4 = 3\n r14[r4] = r0 // Catch:{ all -> 0x01ce }\n r12.invoke(r5, r14) // Catch:{ all -> 0x01ce }\n L_0x01cc:\n r0 = 0\n goto L_0x0187\n L_0x01ce:\n r0 = move-exception\n r4 = -24600256009388(0xffffe9a04e7aab54, double:NaN)\n java.lang.String r4 = p000.C0200av.m970a(r4)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r4)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r4 = p000.C0279ch.m1105b(r23, r25, r26, r27, r28)\n java.lang.String r4 = p000.C0279ch.m1123t(r0, r4, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1108e(r6, r4, r0)\n if (r17 == 0) goto L_0x0207\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r4 = 28\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x021e\n L_0x0207:\n r4 = 28\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x021e:\n p000.C0550gu.m1821c(r0)\n L_0x0221:\n r0 = -999(0xfffffffffffffc19, float:NaN)\n L_0x0223:\n r12 = -26322537895084(0xffffe80f4e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.StringBuilder r13 = new java.lang.StringBuilder\n r13.<init>()\n r34 = -26352602666156(0xffffe8084e7aab54, double:NaN)\n r38 = -26374077502636(0xffffe8034e7aab54, double:NaN)\n r41 = -26386962404524(0xffffe8004e7aab54, double:NaN)\n r36 = r13\n r37 = r4\n goto L_0x042c\n L_0x0246:\n r2 = 4\n r3 = 1\n r4 = 28\n r6 = -26979667891372(0xffffe7764e7aab54, double:NaN)\n r8 = -26949603120300(0xffffe77d4e7aab54, double:NaN)\n fo r0 = p000.C0489fo.USB\n go r5 = p000.C0544go.f2400t\n r1.mo3857e(r10, r0, r5)\n go r12 = p000.C0544go.f2344F\n r1.mo3857e(r3, r0, r12)\n ko r12 = r1.f3511b\n java.lang.Boolean r40 = java.lang.Boolean.TRUE\n r12.getClass()\n java.lang.String r0 = p000.C0432eo.m1607b(r0)\n if (r0 == 0) goto L_0x0270\n L_0x026d:\n r43 = r0\n goto L_0x027a\n L_0x0270:\n r14 = -22512901903532(0xffffeb864e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r14)\n goto L_0x026d\n L_0x027a:\n boolean r0 = r43.isEmpty()\n if (r0 == 0) goto L_0x02a7\n boolean r0 = r5.mo2961a()\n if (r0 != 0) goto L_0x02a7\n r14 = -26107789530284(0xffffe8414e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r14)\n java.lang.StringBuilder r13 = new java.lang.StringBuilder\n r13.<init>()\n r23 = -26137854301356(0xffffe83a4e7aab54, double:NaN)\n r26 = 16\n r27 = -26206573778092(0xffffe82a4e7aab54, double:NaN)\n r25 = r13\n p000.C0279ch.m1112i(r23, r25, r26, r27)\n goto L_0x0438\n L_0x02a7:\n int r0 = android.os.Build.VERSION.SDK_INT\n if (r0 >= r4) goto L_0x035b\n java.lang.String r0 = r5.f2410c\n go r12 = p000.C0544go.f2374g\n if (r5 == r12) goto L_0x02bc\n go r12 = p000.C0544go.f2376h\n if (r5 == r12) goto L_0x02bc\n go r12 = p000.C0544go.f2352N\n if (r5 != r12) goto L_0x02ba\n goto L_0x02bc\n L_0x02ba:\n r12 = 0\n goto L_0x02bd\n L_0x02bc:\n r12 = 1\n L_0x02bd:\n if (r12 == 0) goto L_0x02c8\n r14 = -25996120380588(0xffffe85b4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r14)\n L_0x02c8:\n java.lang.reflect.Method r12 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x030a }\n java.lang.Class[] r12 = r12.getParameterTypes() // Catch:{ Exception -> 0x030a }\n int r12 = r12.length // Catch:{ Exception -> 0x030a }\n if (r12 != r2) goto L_0x02eb\n java.lang.reflect.Method r12 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x030a }\n java.lang.Class<?> r14 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x030a }\n java.lang.Object[] r15 = new java.lang.Object[r2] // Catch:{ Exception -> 0x030a }\n int r5 = r5.f2409b // Catch:{ Exception -> 0x030a }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ Exception -> 0x030a }\n r15[r10] = r5 // Catch:{ Exception -> 0x030a }\n r15[r3] = r13 // Catch:{ Exception -> 0x030a }\n r15[r20] = r43 // Catch:{ Exception -> 0x030a }\n r5 = 3\n r15[r5] = r0 // Catch:{ Exception -> 0x030a }\n java.lang.Object r0 = r12.invoke(r14, r15) // Catch:{ Exception -> 0x030a }\n goto L_0x0302\n L_0x02eb:\n java.lang.reflect.Method r0 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x030a }\n java.lang.Class<?> r12 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x030a }\n r14 = 3\n java.lang.Object[] r14 = new java.lang.Object[r14] // Catch:{ Exception -> 0x030a }\n int r5 = r5.f2409b // Catch:{ Exception -> 0x030a }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ Exception -> 0x030a }\n r14[r10] = r5 // Catch:{ Exception -> 0x030a }\n r14[r3] = r13 // Catch:{ Exception -> 0x030a }\n r14[r20] = r43 // Catch:{ Exception -> 0x030a }\n java.lang.Object r0 = r0.invoke(r12, r14) // Catch:{ Exception -> 0x030a }\n L_0x0302:\n java.lang.Integer r0 = (java.lang.Integer) r0 // Catch:{ Exception -> 0x030a }\n int r0 = r0.intValue() // Catch:{ Exception -> 0x030a }\n goto L_0x040b\n L_0x030a:\n r0 = move-exception\n r12 = -26077724759212(0xffffe8484e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r5)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r5 = p000.C0279ch.m1104a(r23, r25, r26, r27, r28)\n java.lang.String r5 = p000.C0279ch.m1118o(r0, r5, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1107d(r6, r5, r0)\n if (r17 == 0) goto L_0x0341\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x0356\n L_0x0341:\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x0356:\n p000.C0550gu.m1821c(r0)\n goto L_0x0409\n L_0x035b:\n android.media.AudioManager r0 = r12.f3020a\n if (r0 != 0) goto L_0x0377\n r12 = -24411277448364(0xffffe9cc4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n r12 = -24441342219436(0xffffe9c54e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r0, r5)\n r0 = 1\n goto L_0x040b\n L_0x0377:\n r14 = -24518651630764(0xffffe9b34e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r14)\n java.lang.reflect.Method r14 = p000.C0735ko.f3017f // Catch:{ all -> 0x03ba }\n java.lang.Class[] r14 = r14.getParameterTypes() // Catch:{ all -> 0x03ba }\n int r14 = r14.length // Catch:{ all -> 0x03ba }\n r15 = 3\n if (r14 != r15) goto L_0x03a0\n java.lang.reflect.Method r14 = p000.C0735ko.f3017f // Catch:{ all -> 0x03ba }\n android.media.AudioManager r12 = r12.f3020a // Catch:{ all -> 0x03ba }\n java.lang.Object[] r15 = new java.lang.Object[r15] // Catch:{ all -> 0x03ba }\n int r5 = r5.f2409b // Catch:{ all -> 0x03ba }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x03ba }\n r15[r10] = r5 // Catch:{ all -> 0x03ba }\n r15[r3] = r13 // Catch:{ all -> 0x03ba }\n r15[r20] = r0 // Catch:{ all -> 0x03ba }\n r14.invoke(r12, r15) // Catch:{ all -> 0x03ba }\n goto L_0x03b8\n L_0x03a0:\n java.lang.reflect.Method r14 = p000.C0735ko.f3017f // Catch:{ all -> 0x03ba }\n android.media.AudioManager r12 = r12.f3020a // Catch:{ all -> 0x03ba }\n java.lang.Object[] r15 = new java.lang.Object[r2] // Catch:{ all -> 0x03ba }\n int r5 = r5.f2409b // Catch:{ all -> 0x03ba }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x03ba }\n r15[r10] = r5 // Catch:{ all -> 0x03ba }\n r15[r3] = r13 // Catch:{ all -> 0x03ba }\n r15[r20] = r43 // Catch:{ all -> 0x03ba }\n r5 = 3\n r15[r5] = r0 // Catch:{ all -> 0x03ba }\n r14.invoke(r12, r15) // Catch:{ all -> 0x03ba }\n L_0x03b8:\n r0 = 0\n goto L_0x040b\n L_0x03ba:\n r0 = move-exception\n r12 = -24600256009388(0xffffe9a04e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r5)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r5 = p000.C0279ch.m1105b(r23, r25, r26, r27, r28)\n java.lang.String r5 = p000.C0279ch.m1123t(r0, r5, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1108e(r6, r5, r0)\n if (r17 == 0) goto L_0x03f1\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x0406\n L_0x03f1:\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x0406:\n p000.C0550gu.m1821c(r0)\n L_0x0409:\n r0 = -999(0xfffffffffffffc19, float:NaN)\n L_0x040b:\n r12 = -26322537895084(0xffffe80f4e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.StringBuilder r13 = new java.lang.StringBuilder\n r13.<init>()\n r34 = -26352602666156(0xffffe8084e7aab54, double:NaN)\n r37 = 16\n r38 = -26374077502636(0xffffe8034e7aab54, double:NaN)\n r41 = -26386962404524(0xffffe8004e7aab54, double:NaN)\n r36 = r13\n L_0x042c:\n p000.C0279ch.m1113j(r34, r36, r37, r38, r40, r41, r43)\n r14 = -26412732208300(0xffffe7fa4e7aab54, double:NaN)\n p000.C0279ch.m1111h(r14, r13, r0)\n r0 = r5\n L_0x0438:\n java.lang.String r5 = r13.toString()\n p000.C0550gu.m1820b(r0, r5)\n r12 = 100\n java.lang.Thread.sleep(r12)\n fo r0 = p000.C0489fo.WIRED_HEADPHONE\n go r5 = p000.C0544go.f2374g\n go[] r12 = new p000.C0544go[r3]\n go r13 = p000.C0544go.f2376h\n r12[r10] = r13\n r1.mo3858f(r3, r0, r5, r12)\n ko r0 = r1.f3511b\n go r12 = p000.C0544go.f2405w\n java.lang.Boolean r40 = java.lang.Boolean.FALSE\n r0.getClass()\n r14 = -22762010006700(0xffffeb4c4e7aab54, double:NaN)\n java.lang.String r43 = p000.C0200av.m970a(r14)\n boolean r14 = r43.isEmpty()\n if (r14 == 0) goto L_0x0490\n boolean r14 = r12.mo2961a()\n if (r14 != 0) goto L_0x0490\n r14 = -26107789530284(0xffffe8414e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r14)\n java.lang.StringBuilder r5 = new java.lang.StringBuilder\n r5.<init>()\n r23 = -26137854301356(0xffffe83a4e7aab54, double:NaN)\n r26 = 19\n r27 = -26206573778092(0xffffe82a4e7aab54, double:NaN)\n r25 = r5\n p000.C0279ch.m1112i(r23, r25, r26, r27)\n goto L_0x061e\n L_0x0490:\n int r14 = android.os.Build.VERSION.SDK_INT\n if (r14 >= r4) goto L_0x0540\n java.lang.String r0 = r12.f2410c\n if (r12 == r5) goto L_0x04a1\n if (r12 == r13) goto L_0x04a1\n go r5 = p000.C0544go.f2352N\n if (r12 != r5) goto L_0x049f\n goto L_0x04a1\n L_0x049f:\n r5 = 0\n goto L_0x04a2\n L_0x04a1:\n r5 = 1\n L_0x04a2:\n if (r5 == 0) goto L_0x04ad\n r13 = -25996120380588(0xffffe85b4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r13)\n L_0x04ad:\n java.lang.reflect.Method r5 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x04ef }\n java.lang.Class[] r5 = r5.getParameterTypes() // Catch:{ Exception -> 0x04ef }\n int r5 = r5.length // Catch:{ Exception -> 0x04ef }\n if (r5 != r2) goto L_0x04d0\n java.lang.reflect.Method r5 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x04ef }\n java.lang.Class<?> r13 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x04ef }\n java.lang.Object[] r14 = new java.lang.Object[r2] // Catch:{ Exception -> 0x04ef }\n int r12 = r12.f2409b // Catch:{ Exception -> 0x04ef }\n java.lang.Integer r12 = java.lang.Integer.valueOf(r12) // Catch:{ Exception -> 0x04ef }\n r14[r10] = r12 // Catch:{ Exception -> 0x04ef }\n r14[r3] = r11 // Catch:{ Exception -> 0x04ef }\n r14[r20] = r43 // Catch:{ Exception -> 0x04ef }\n r12 = 3\n r14[r12] = r0 // Catch:{ Exception -> 0x04ef }\n java.lang.Object r0 = r5.invoke(r13, r14) // Catch:{ Exception -> 0x04ef }\n goto L_0x04e7\n L_0x04d0:\n java.lang.reflect.Method r0 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x04ef }\n java.lang.Class<?> r5 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x04ef }\n r13 = 3\n java.lang.Object[] r13 = new java.lang.Object[r13] // Catch:{ Exception -> 0x04ef }\n int r12 = r12.f2409b // Catch:{ Exception -> 0x04ef }\n java.lang.Integer r12 = java.lang.Integer.valueOf(r12) // Catch:{ Exception -> 0x04ef }\n r13[r10] = r12 // Catch:{ Exception -> 0x04ef }\n r13[r3] = r11 // Catch:{ Exception -> 0x04ef }\n r13[r20] = r43 // Catch:{ Exception -> 0x04ef }\n java.lang.Object r0 = r0.invoke(r5, r13) // Catch:{ Exception -> 0x04ef }\n L_0x04e7:\n java.lang.Integer r0 = (java.lang.Integer) r0 // Catch:{ Exception -> 0x04ef }\n int r0 = r0.intValue() // Catch:{ Exception -> 0x04ef }\n goto L_0x05f0\n L_0x04ef:\n r0 = move-exception\n r12 = -26077724759212(0xffffe8484e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r5)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r5 = p000.C0279ch.m1104a(r23, r25, r26, r27, r28)\n java.lang.String r5 = p000.C0279ch.m1118o(r0, r5, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1107d(r6, r5, r0)\n if (r17 == 0) goto L_0x0526\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x053b\n L_0x0526:\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x053b:\n p000.C0550gu.m1821c(r0)\n goto L_0x05ee\n L_0x0540:\n android.media.AudioManager r5 = r0.f3020a\n if (r5 != 0) goto L_0x055c\n r12 = -24411277448364(0xffffe9cc4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n r12 = -24441342219436(0xffffe9c54e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r0, r5)\n r0 = 1\n goto L_0x05f0\n L_0x055c:\n r13 = -24518651630764(0xffffe9b34e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r13)\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x059f }\n java.lang.Class[] r13 = r13.getParameterTypes() // Catch:{ all -> 0x059f }\n int r13 = r13.length // Catch:{ all -> 0x059f }\n r14 = 3\n if (r13 != r14) goto L_0x0585\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x059f }\n android.media.AudioManager r0 = r0.f3020a // Catch:{ all -> 0x059f }\n java.lang.Object[] r14 = new java.lang.Object[r14] // Catch:{ all -> 0x059f }\n int r12 = r12.f2409b // Catch:{ all -> 0x059f }\n java.lang.Integer r12 = java.lang.Integer.valueOf(r12) // Catch:{ all -> 0x059f }\n r14[r10] = r12 // Catch:{ all -> 0x059f }\n r14[r3] = r11 // Catch:{ all -> 0x059f }\n r14[r20] = r5 // Catch:{ all -> 0x059f }\n r13.invoke(r0, r14) // Catch:{ all -> 0x059f }\n goto L_0x059d\n L_0x0585:\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x059f }\n android.media.AudioManager r0 = r0.f3020a // Catch:{ all -> 0x059f }\n java.lang.Object[] r14 = new java.lang.Object[r2] // Catch:{ all -> 0x059f }\n int r12 = r12.f2409b // Catch:{ all -> 0x059f }\n java.lang.Integer r12 = java.lang.Integer.valueOf(r12) // Catch:{ all -> 0x059f }\n r14[r10] = r12 // Catch:{ all -> 0x059f }\n r14[r3] = r11 // Catch:{ all -> 0x059f }\n r14[r20] = r43 // Catch:{ all -> 0x059f }\n r12 = 3\n r14[r12] = r5 // Catch:{ all -> 0x059f }\n r13.invoke(r0, r14) // Catch:{ all -> 0x059f }\n L_0x059d:\n r0 = 0\n goto L_0x05f0\n L_0x059f:\n r0 = move-exception\n r12 = -24600256009388(0xffffe9a04e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r5)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r5 = p000.C0279ch.m1105b(r23, r25, r26, r27, r28)\n java.lang.String r5 = p000.C0279ch.m1123t(r0, r5, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1108e(r6, r5, r0)\n if (r17 == 0) goto L_0x05d6\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x05eb\n L_0x05d6:\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x05eb:\n p000.C0550gu.m1821c(r0)\n L_0x05ee:\n r0 = -999(0xfffffffffffffc19, float:NaN)\n L_0x05f0:\n r12 = -26322537895084(0xffffe80f4e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.StringBuilder r12 = new java.lang.StringBuilder\n r12.<init>()\n r34 = -26352602666156(0xffffe8084e7aab54, double:NaN)\n r37 = 19\n r38 = -26374077502636(0xffffe8034e7aab54, double:NaN)\n r41 = -26386962404524(0xffffe8004e7aab54, double:NaN)\n r36 = r12\n p000.C0279ch.m1113j(r34, r36, r37, r38, r40, r41, r43)\n r13 = -26412732208300(0xffffe7fa4e7aab54, double:NaN)\n p000.C0279ch.m1111h(r13, r12, r0)\n r0 = r5\n r5 = r12\n L_0x061e:\n java.lang.String r5 = r5.toString()\n p000.C0550gu.m1820b(r0, r5)\n ko r0 = r1.f3511b\n go r5 = p000.C0544go.f2339A\n java.lang.Boolean r40 = java.lang.Boolean.FALSE\n r0.getClass()\n r12 = -22762010006700(0xffffeb4c4e7aab54, double:NaN)\n java.lang.String r43 = p000.C0200av.m970a(r12)\n boolean r12 = r43.isEmpty()\n if (r12 == 0) goto L_0x0664\n boolean r12 = r5.mo2961a()\n if (r12 != 0) goto L_0x0664\n r12 = -26107789530284(0xffffe8414e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n java.lang.StringBuilder r5 = new java.lang.StringBuilder\n r5.<init>()\n r23 = -26137854301356(0xffffe83a4e7aab54, double:NaN)\n r26 = 23\n r27 = -26206573778092(0xffffe82a4e7aab54, double:NaN)\n r25 = r5\n p000.C0279ch.m1112i(r23, r25, r26, r27)\n goto L_0x07f6\n L_0x0664:\n int r12 = android.os.Build.VERSION.SDK_INT\n if (r12 >= r4) goto L_0x0718\n java.lang.String r0 = r5.f2410c\n go r12 = p000.C0544go.f2374g\n if (r5 == r12) goto L_0x0679\n go r12 = p000.C0544go.f2376h\n if (r5 == r12) goto L_0x0679\n go r12 = p000.C0544go.f2352N\n if (r5 != r12) goto L_0x0677\n goto L_0x0679\n L_0x0677:\n r12 = 0\n goto L_0x067a\n L_0x0679:\n r12 = 1\n L_0x067a:\n if (r12 == 0) goto L_0x0685\n r12 = -25996120380588(0xffffe85b4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n L_0x0685:\n java.lang.reflect.Method r12 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x06c7 }\n java.lang.Class[] r12 = r12.getParameterTypes() // Catch:{ Exception -> 0x06c7 }\n int r12 = r12.length // Catch:{ Exception -> 0x06c7 }\n if (r12 != r2) goto L_0x06a8\n java.lang.reflect.Method r12 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x06c7 }\n java.lang.Class<?> r13 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x06c7 }\n java.lang.Object[] r14 = new java.lang.Object[r2] // Catch:{ Exception -> 0x06c7 }\n int r5 = r5.f2409b // Catch:{ Exception -> 0x06c7 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ Exception -> 0x06c7 }\n r14[r10] = r5 // Catch:{ Exception -> 0x06c7 }\n r14[r3] = r11 // Catch:{ Exception -> 0x06c7 }\n r14[r20] = r43 // Catch:{ Exception -> 0x06c7 }\n r5 = 3\n r14[r5] = r0 // Catch:{ Exception -> 0x06c7 }\n java.lang.Object r0 = r12.invoke(r13, r14) // Catch:{ Exception -> 0x06c7 }\n goto L_0x06bf\n L_0x06a8:\n java.lang.reflect.Method r0 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x06c7 }\n java.lang.Class<?> r12 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x06c7 }\n r13 = 3\n java.lang.Object[] r13 = new java.lang.Object[r13] // Catch:{ Exception -> 0x06c7 }\n int r5 = r5.f2409b // Catch:{ Exception -> 0x06c7 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ Exception -> 0x06c7 }\n r13[r10] = r5 // Catch:{ Exception -> 0x06c7 }\n r13[r3] = r11 // Catch:{ Exception -> 0x06c7 }\n r13[r20] = r43 // Catch:{ Exception -> 0x06c7 }\n java.lang.Object r0 = r0.invoke(r12, r13) // Catch:{ Exception -> 0x06c7 }\n L_0x06bf:\n java.lang.Integer r0 = (java.lang.Integer) r0 // Catch:{ Exception -> 0x06c7 }\n int r0 = r0.intValue() // Catch:{ Exception -> 0x06c7 }\n goto L_0x07c8\n L_0x06c7:\n r0 = move-exception\n r12 = -26077724759212(0xffffe8484e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r5)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r5 = p000.C0279ch.m1104a(r23, r25, r26, r27, r28)\n java.lang.String r5 = p000.C0279ch.m1118o(r0, r5, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1107d(r6, r5, r0)\n if (r17 == 0) goto L_0x06fe\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x0713\n L_0x06fe:\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x0713:\n p000.C0550gu.m1821c(r0)\n goto L_0x07c6\n L_0x0718:\n android.media.AudioManager r12 = r0.f3020a\n if (r12 != 0) goto L_0x0734\n r12 = -24411277448364(0xffffe9cc4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n r12 = -24441342219436(0xffffe9c54e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r0, r5)\n r0 = 1\n goto L_0x07c8\n L_0x0734:\n r12 = -24518651630764(0xffffe9b34e7aab54, double:NaN)\n java.lang.String r12 = p000.C0200av.m970a(r12)\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x0777 }\n java.lang.Class[] r13 = r13.getParameterTypes() // Catch:{ all -> 0x0777 }\n int r13 = r13.length // Catch:{ all -> 0x0777 }\n r14 = 3\n if (r13 != r14) goto L_0x075d\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x0777 }\n android.media.AudioManager r0 = r0.f3020a // Catch:{ all -> 0x0777 }\n java.lang.Object[] r14 = new java.lang.Object[r14] // Catch:{ all -> 0x0777 }\n int r5 = r5.f2409b // Catch:{ all -> 0x0777 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x0777 }\n r14[r10] = r5 // Catch:{ all -> 0x0777 }\n r14[r3] = r11 // Catch:{ all -> 0x0777 }\n r14[r20] = r12 // Catch:{ all -> 0x0777 }\n r13.invoke(r0, r14) // Catch:{ all -> 0x0777 }\n goto L_0x0775\n L_0x075d:\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x0777 }\n android.media.AudioManager r0 = r0.f3020a // Catch:{ all -> 0x0777 }\n java.lang.Object[] r14 = new java.lang.Object[r2] // Catch:{ all -> 0x0777 }\n int r5 = r5.f2409b // Catch:{ all -> 0x0777 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x0777 }\n r14[r10] = r5 // Catch:{ all -> 0x0777 }\n r14[r3] = r11 // Catch:{ all -> 0x0777 }\n r14[r20] = r43 // Catch:{ all -> 0x0777 }\n r5 = 3\n r14[r5] = r12 // Catch:{ all -> 0x0777 }\n r13.invoke(r0, r14) // Catch:{ all -> 0x0777 }\n L_0x0775:\n r0 = 0\n goto L_0x07c8\n L_0x0777:\n r0 = move-exception\n r12 = -24600256009388(0xffffe9a04e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r5)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r5 = p000.C0279ch.m1105b(r23, r25, r26, r27, r28)\n java.lang.String r5 = p000.C0279ch.m1123t(r0, r5, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1108e(r6, r5, r0)\n if (r17 == 0) goto L_0x07ae\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x07c3\n L_0x07ae:\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x07c3:\n p000.C0550gu.m1821c(r0)\n L_0x07c6:\n r0 = -999(0xfffffffffffffc19, float:NaN)\n L_0x07c8:\n r12 = -26322537895084(0xffffe80f4e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.StringBuilder r12 = new java.lang.StringBuilder\n r12.<init>()\n r34 = -26352602666156(0xffffe8084e7aab54, double:NaN)\n r37 = 23\n r38 = -26374077502636(0xffffe8034e7aab54, double:NaN)\n r41 = -26386962404524(0xffffe8004e7aab54, double:NaN)\n r36 = r12\n p000.C0279ch.m1113j(r34, r36, r37, r38, r40, r41, r43)\n r13 = -26412732208300(0xffffe7fa4e7aab54, double:NaN)\n p000.C0279ch.m1111h(r13, r12, r0)\n r0 = r5\n r5 = r12\n L_0x07f6:\n java.lang.String r5 = r5.toString()\n p000.C0550gu.m1820b(r0, r5)\n ko r0 = r1.f3511b\n go r5 = p000.C0544go.f2370e\n android.content.Context r12 = r1.f3510a\n boolean r12 = p000.C0697ju.m2194q(r12)\n r12 = r12 ^ r3\n java.lang.Boolean r40 = java.lang.Boolean.valueOf(r12)\n r0.getClass()\n r12 = -22762010006700(0xffffeb4c4e7aab54, double:NaN)\n java.lang.String r43 = p000.C0200av.m970a(r12)\n boolean r12 = r43.isEmpty()\n if (r12 == 0) goto L_0x0845\n boolean r12 = r5.mo2961a()\n if (r12 != 0) goto L_0x0845\n r12 = -26107789530284(0xffffe8414e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n java.lang.StringBuilder r5 = new java.lang.StringBuilder\n r5.<init>()\n r23 = -26137854301356(0xffffe83a4e7aab54, double:NaN)\n r27 = -26206573778092(0xffffe82a4e7aab54, double:NaN)\n r25 = r5\n r26 = r3\n p000.C0279ch.m1112i(r23, r25, r26, r27)\n goto L_0x09f6\n L_0x0845:\n int r12 = android.os.Build.VERSION.SDK_INT\n if (r12 >= r4) goto L_0x0905\n boolean r0 = r40.booleanValue()\n java.lang.String r12 = r5.f2410c\n go r13 = p000.C0544go.f2374g\n if (r5 == r13) goto L_0x085e\n go r13 = p000.C0544go.f2376h\n if (r5 == r13) goto L_0x085e\n go r13 = p000.C0544go.f2352N\n if (r5 != r13) goto L_0x085c\n goto L_0x085e\n L_0x085c:\n r13 = 0\n goto L_0x085f\n L_0x085e:\n r13 = 1\n L_0x085f:\n if (r13 == 0) goto L_0x086a\n r12 = -25996120380588(0xffffe85b4e7aab54, double:NaN)\n java.lang.String r12 = p000.C0200av.m970a(r12)\n L_0x086a:\n java.lang.reflect.Method r13 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x08b4 }\n java.lang.Class[] r13 = r13.getParameterTypes() // Catch:{ Exception -> 0x08b4 }\n int r13 = r13.length // Catch:{ Exception -> 0x08b4 }\n if (r13 != r2) goto L_0x0891\n java.lang.reflect.Method r13 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x08b4 }\n java.lang.Class<?> r14 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x08b4 }\n java.lang.Object[] r15 = new java.lang.Object[r2] // Catch:{ Exception -> 0x08b4 }\n int r5 = r5.f2409b // Catch:{ Exception -> 0x08b4 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ Exception -> 0x08b4 }\n r15[r10] = r5 // Catch:{ Exception -> 0x08b4 }\n java.lang.Integer r0 = java.lang.Integer.valueOf(r0) // Catch:{ Exception -> 0x08b4 }\n r15[r3] = r0 // Catch:{ Exception -> 0x08b4 }\n r15[r20] = r43 // Catch:{ Exception -> 0x08b4 }\n r0 = 3\n r15[r0] = r12 // Catch:{ Exception -> 0x08b4 }\n java.lang.Object r0 = r13.invoke(r14, r15) // Catch:{ Exception -> 0x08b4 }\n goto L_0x08ac\n L_0x0891:\n java.lang.reflect.Method r12 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x08b4 }\n java.lang.Class<?> r13 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x08b4 }\n r14 = 3\n java.lang.Object[] r14 = new java.lang.Object[r14] // Catch:{ Exception -> 0x08b4 }\n int r5 = r5.f2409b // Catch:{ Exception -> 0x08b4 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ Exception -> 0x08b4 }\n r14[r10] = r5 // Catch:{ Exception -> 0x08b4 }\n java.lang.Integer r0 = java.lang.Integer.valueOf(r0) // Catch:{ Exception -> 0x08b4 }\n r14[r3] = r0 // Catch:{ Exception -> 0x08b4 }\n r14[r20] = r43 // Catch:{ Exception -> 0x08b4 }\n java.lang.Object r0 = r12.invoke(r13, r14) // Catch:{ Exception -> 0x08b4 }\n L_0x08ac:\n java.lang.Integer r0 = (java.lang.Integer) r0 // Catch:{ Exception -> 0x08b4 }\n int r0 = r0.intValue() // Catch:{ Exception -> 0x08b4 }\n goto L_0x09c8\n L_0x08b4:\n r0 = move-exception\n r12 = -26077724759212(0xffffe8484e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r5)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r5 = p000.C0279ch.m1104a(r23, r25, r26, r27, r28)\n java.lang.String r5 = p000.C0279ch.m1118o(r0, r5, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1107d(r6, r5, r0)\n if (r17 == 0) goto L_0x08eb\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x0900\n L_0x08eb:\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x0900:\n p000.C0550gu.m1821c(r0)\n goto L_0x09c6\n L_0x0905:\n android.media.AudioManager r12 = r0.f3020a\n if (r12 != 0) goto L_0x0921\n r12 = -24411277448364(0xffffe9cc4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n r12 = -24441342219436(0xffffe9c54e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r0, r5)\n r0 = 1\n goto L_0x09c8\n L_0x0921:\n java.lang.String r12 = r5.f2410c\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x0977 }\n java.lang.Class[] r13 = r13.getParameterTypes() // Catch:{ all -> 0x0977 }\n int r13 = r13.length // Catch:{ all -> 0x0977 }\n r14 = 3\n if (r13 != r14) goto L_0x0950\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x0977 }\n android.media.AudioManager r0 = r0.f3020a // Catch:{ all -> 0x0977 }\n java.lang.Object[] r14 = new java.lang.Object[r14] // Catch:{ all -> 0x0977 }\n int r5 = r5.f2409b // Catch:{ all -> 0x0977 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x0977 }\n r14[r10] = r5 // Catch:{ all -> 0x0977 }\n boolean r5 = r40.booleanValue() // Catch:{ all -> 0x0977 }\n if (r5 == 0) goto L_0x0943\n r5 = 1\n goto L_0x0944\n L_0x0943:\n r5 = 0\n L_0x0944:\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x0977 }\n r14[r3] = r5 // Catch:{ all -> 0x0977 }\n r14[r20] = r12 // Catch:{ all -> 0x0977 }\n r13.invoke(r0, r14) // Catch:{ all -> 0x0977 }\n goto L_0x0975\n L_0x0950:\n java.lang.reflect.Method r13 = p000.C0735ko.f3017f // Catch:{ all -> 0x0977 }\n android.media.AudioManager r0 = r0.f3020a // Catch:{ all -> 0x0977 }\n java.lang.Object[] r14 = new java.lang.Object[r2] // Catch:{ all -> 0x0977 }\n int r5 = r5.f2409b // Catch:{ all -> 0x0977 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x0977 }\n r14[r10] = r5 // Catch:{ all -> 0x0977 }\n boolean r5 = r40.booleanValue() // Catch:{ all -> 0x0977 }\n if (r5 == 0) goto L_0x0966\n r5 = 1\n goto L_0x0967\n L_0x0966:\n r5 = 0\n L_0x0967:\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x0977 }\n r14[r3] = r5 // Catch:{ all -> 0x0977 }\n r14[r20] = r43 // Catch:{ all -> 0x0977 }\n r5 = 3\n r14[r5] = r12 // Catch:{ all -> 0x0977 }\n r13.invoke(r0, r14) // Catch:{ all -> 0x0977 }\n L_0x0975:\n r0 = 0\n goto L_0x09c8\n L_0x0977:\n r0 = move-exception\n r12 = -24600256009388(0xffffe9a04e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r5)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r5 = p000.C0279ch.m1105b(r23, r25, r26, r27, r28)\n java.lang.String r5 = p000.C0279ch.m1123t(r0, r5, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1108e(r6, r5, r0)\n if (r17 == 0) goto L_0x09ae\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x09c3\n L_0x09ae:\n r12 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n r12 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r14 = p000.C0200av.m970a(r12)\n p000.C0550gu.m1819a(r5, r14)\n L_0x09c3:\n p000.C0550gu.m1821c(r0)\n L_0x09c6:\n r0 = -999(0xfffffffffffffc19, float:NaN)\n L_0x09c8:\n r12 = -26322537895084(0xffffe80f4e7aab54, double:NaN)\n java.lang.String r5 = p000.C0200av.m970a(r12)\n java.lang.StringBuilder r12 = new java.lang.StringBuilder\n r12.<init>()\n r34 = -26352602666156(0xffffe8084e7aab54, double:NaN)\n r38 = -26374077502636(0xffffe8034e7aab54, double:NaN)\n r41 = -26386962404524(0xffffe8004e7aab54, double:NaN)\n r36 = r12\n r37 = r3\n p000.C0279ch.m1113j(r34, r36, r37, r38, r40, r41, r43)\n r13 = -26412732208300(0xffffe7fa4e7aab54, double:NaN)\n p000.C0279ch.m1111h(r13, r12, r0)\n r0 = r5\n r5 = r12\n L_0x09f6:\n java.lang.String r5 = r5.toString()\n p000.C0550gu.m1820b(r0, r5)\n android.content.Context r0 = r1.f3510a\n boolean r0 = p000.C0697ju.m2181d(r0)\n if (r0 == 0) goto L_0x0be7\n ko r0 = r1.f3511b\n go r5 = p000.C0544go.f2402u\n java.lang.Boolean r40 = java.lang.Boolean.FALSE\n r0.getClass()\n r12 = -22762010006700(0xffffeb4c4e7aab54, double:NaN)\n java.lang.String r43 = p000.C0200av.m970a(r12)\n boolean r12 = r43.isEmpty()\n if (r12 == 0) goto L_0x0a43\n boolean r12 = r5.mo2961a()\n if (r12 != 0) goto L_0x0a43\n r12 = -26107789530284(0xffffe8414e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n java.lang.StringBuilder r8 = new java.lang.StringBuilder\n r8.<init>()\n r2 = -26137854301356(0xffffe83a4e7aab54, double:NaN)\n r5 = 17\n r6 = -26206573778092(0xffffe82a4e7aab54, double:NaN)\n r4 = r8\n p000.C0279ch.m1112i(r2, r4, r5, r6)\n goto L_0x0be0\n L_0x0a43:\n int r12 = android.os.Build.VERSION.SDK_INT\n if (r12 >= r4) goto L_0x0afe\n java.lang.String r0 = r5.f2410c\n go r4 = p000.C0544go.f2374g\n if (r5 == r4) goto L_0x0a58\n go r4 = p000.C0544go.f2376h\n if (r5 == r4) goto L_0x0a58\n go r4 = p000.C0544go.f2352N\n if (r5 != r4) goto L_0x0a56\n goto L_0x0a58\n L_0x0a56:\n r4 = 0\n goto L_0x0a59\n L_0x0a58:\n r4 = 1\n L_0x0a59:\n if (r4 == 0) goto L_0x0a64\n r12 = -25996120380588(0xffffe85b4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r12)\n L_0x0a64:\n java.lang.reflect.Method r4 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x0aa6 }\n java.lang.Class[] r4 = r4.getParameterTypes() // Catch:{ Exception -> 0x0aa6 }\n int r4 = r4.length // Catch:{ Exception -> 0x0aa6 }\n if (r4 != r2) goto L_0x0a87\n java.lang.reflect.Method r4 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x0aa6 }\n java.lang.Class<?> r12 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x0aa6 }\n java.lang.Object[] r2 = new java.lang.Object[r2] // Catch:{ Exception -> 0x0aa6 }\n int r5 = r5.f2409b // Catch:{ Exception -> 0x0aa6 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ Exception -> 0x0aa6 }\n r2[r10] = r5 // Catch:{ Exception -> 0x0aa6 }\n r2[r3] = r11 // Catch:{ Exception -> 0x0aa6 }\n r2[r20] = r43 // Catch:{ Exception -> 0x0aa6 }\n r3 = 3\n r2[r3] = r0 // Catch:{ Exception -> 0x0aa6 }\n java.lang.Object r0 = r4.invoke(r12, r2) // Catch:{ Exception -> 0x0aa6 }\n goto L_0x0a9e\n L_0x0a87:\n java.lang.reflect.Method r0 = p000.C0735ko.f3016e // Catch:{ Exception -> 0x0aa6 }\n java.lang.Class<?> r2 = p000.C0735ko.f3015d // Catch:{ Exception -> 0x0aa6 }\n r4 = 3\n java.lang.Object[] r4 = new java.lang.Object[r4] // Catch:{ Exception -> 0x0aa6 }\n int r5 = r5.f2409b // Catch:{ Exception -> 0x0aa6 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ Exception -> 0x0aa6 }\n r4[r10] = r5 // Catch:{ Exception -> 0x0aa6 }\n r4[r3] = r11 // Catch:{ Exception -> 0x0aa6 }\n r4[r20] = r43 // Catch:{ Exception -> 0x0aa6 }\n java.lang.Object r0 = r0.invoke(r2, r4) // Catch:{ Exception -> 0x0aa6 }\n L_0x0a9e:\n java.lang.Integer r0 = (java.lang.Integer) r0 // Catch:{ Exception -> 0x0aa6 }\n int r10 = r0.intValue() // Catch:{ Exception -> 0x0aa6 }\n goto L_0x0bb2\n L_0x0aa6:\n r0 = move-exception\n r2 = -26077724759212(0xffffe8484e7aab54, double:NaN)\n java.lang.String r2 = p000.C0200av.m970a(r2)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r2)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r2 = p000.C0279ch.m1104a(r23, r25, r26, r27, r28)\n java.lang.String r2 = p000.C0279ch.m1118o(r0, r2, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1107d(r6, r2, r0)\n if (r17 == 0) goto L_0x0add\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x0af2\n L_0x0add:\n r2 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r2 = p000.C0200av.m970a(r2)\n r3 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r3 = p000.C0200av.m970a(r3)\n p000.C0550gu.m1819a(r2, r3)\n L_0x0af2:\n p000.C0550gu.m1821c(r0)\n r2 = -26322537895084(0xffffe80f4e7aab54, double:NaN)\n r0 = -999(0xfffffffffffffc19, float:NaN)\n goto L_0x0bb8\n L_0x0afe:\n android.media.AudioManager r4 = r0.f3020a\n if (r4 != 0) goto L_0x0b1f\n r2 = -24411277448364(0xffffe9cc4e7aab54, double:NaN)\n java.lang.String r0 = p000.C0200av.m970a(r2)\n r2 = -24441342219436(0xffffe9c54e7aab54, double:NaN)\n java.lang.String r2 = p000.C0200av.m970a(r2)\n p000.C0550gu.m1819a(r0, r2)\n r2 = -26322537895084(0xffffe80f4e7aab54, double:NaN)\n r0 = 1\n goto L_0x0bb8\n L_0x0b1f:\n r12 = -24518651630764(0xffffe9b34e7aab54, double:NaN)\n java.lang.String r4 = p000.C0200av.m970a(r12)\n java.lang.reflect.Method r12 = p000.C0735ko.f3017f // Catch:{ all -> 0x0b61 }\n java.lang.Class[] r12 = r12.getParameterTypes() // Catch:{ all -> 0x0b61 }\n int r12 = r12.length // Catch:{ all -> 0x0b61 }\n r13 = 3\n if (r12 != r13) goto L_0x0b48\n java.lang.reflect.Method r2 = p000.C0735ko.f3017f // Catch:{ all -> 0x0b61 }\n android.media.AudioManager r0 = r0.f3020a // Catch:{ all -> 0x0b61 }\n java.lang.Object[] r12 = new java.lang.Object[r13] // Catch:{ all -> 0x0b61 }\n int r5 = r5.f2409b // Catch:{ all -> 0x0b61 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x0b61 }\n r12[r10] = r5 // Catch:{ all -> 0x0b61 }\n r12[r3] = r11 // Catch:{ all -> 0x0b61 }\n r12[r20] = r4 // Catch:{ all -> 0x0b61 }\n r2.invoke(r0, r12) // Catch:{ all -> 0x0b61 }\n goto L_0x0bb2\n L_0x0b48:\n java.lang.reflect.Method r12 = p000.C0735ko.f3017f // Catch:{ all -> 0x0b61 }\n android.media.AudioManager r0 = r0.f3020a // Catch:{ all -> 0x0b61 }\n java.lang.Object[] r2 = new java.lang.Object[r2] // Catch:{ all -> 0x0b61 }\n int r5 = r5.f2409b // Catch:{ all -> 0x0b61 }\n java.lang.Integer r5 = java.lang.Integer.valueOf(r5) // Catch:{ all -> 0x0b61 }\n r2[r10] = r5 // Catch:{ all -> 0x0b61 }\n r2[r3] = r11 // Catch:{ all -> 0x0b61 }\n r2[r20] = r43 // Catch:{ all -> 0x0b61 }\n r3 = 3\n r2[r3] = r4 // Catch:{ all -> 0x0b61 }\n r12.invoke(r0, r2) // Catch:{ all -> 0x0b61 }\n goto L_0x0bb2\n L_0x0b61:\n r0 = move-exception\n r2 = -24600256009388(0xffffe9a04e7aab54, double:NaN)\n java.lang.String r2 = p000.C0200av.m970a(r2)\n java.lang.String r27 = p000.C0200av.m970a(r21)\n java.lang.StringBuilder r25 = p000.C0279ch.m1106c(r2)\n r23 = r30\n r26 = r0\n r28 = r32\n java.lang.String r2 = p000.C0279ch.m1105b(r23, r25, r26, r27, r28)\n java.lang.String r2 = p000.C0279ch.m1123t(r0, r2, r8)\n java.lang.Throwable r17 = p000.C0279ch.m1108e(r6, r2, r0)\n if (r17 == 0) goto L_0x0b98\n java.lang.String r16 = p000.C0200av.m970a(r44)\n java.lang.StringBuilder r14 = new java.lang.StringBuilder\n r14.<init>()\n r12 = r18\n r15 = r17\n p000.C0279ch.m1115l(r12, r14, r15, r16, r17)\n goto L_0x0bad\n L_0x0b98:\n r2 = -27125696779436(0xffffe7544e7aab54, double:NaN)\n java.lang.String r2 = p000.C0200av.m970a(r2)\n r3 = -27155761550508(0xffffe74d4e7aab54, double:NaN)\n java.lang.String r3 = p000.C0200av.m970a(r3)\n p000.C0550gu.m1819a(r2, r3)\n L_0x0bad:\n p000.C0550gu.m1821c(r0)\n r10 = -999(0xfffffffffffffc19, float:NaN)\n L_0x0bb2:\n r2 = -26322537895084(0xffffe80f4e7aab54, double:NaN)\n r0 = r10\n L_0x0bb8:\n java.lang.String r2 = p000.C0200av.m970a(r2)\n java.lang.StringBuilder r8 = new java.lang.StringBuilder\n r8.<init>()\n r34 = -26352602666156(0xffffe8084e7aab54, double:NaN)\n r37 = 17\n r38 = -26374077502636(0xffffe8034e7aab54, double:NaN)\n r41 = -26386962404524(0xffffe8004e7aab54, double:NaN)\n r36 = r8\n p000.C0279ch.m1113j(r34, r36, r37, r38, r40, r41, r43)\n r3 = -26412732208300(0xffffe7fa4e7aab54, double:NaN)\n p000.C0279ch.m1111h(r3, r8, r0)\n r0 = r2\n L_0x0be0:\n java.lang.String r2 = r8.toString()\n p000.C0550gu.m1820b(r0, r2)\n L_0x0be7:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p000.C0936oo.mo3863o():void\");\n }", "public static int calculateOpjectiveFunction(char[][] matrix ) {\n\n\n\n return (int)countNumberOfEmptyPosition(matrix)+countNmberOfCameras( matrix); \n\n}", "public void calculateStastics() {\t\t\n\t\t\n\t\t/* remove verboten spectra */\n\t\tArrayList<String> verbotenSpectra = new ArrayList<String>();\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.7436.7436.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5161.5161.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4294.4294.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4199.4199.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.5085.5085.2.dta\");\n\t\tverbotenSpectra.add(\"USP_std_run1_100504135936.4129.4129.2.dta\");\n\t\tfor (int i = 0; i < positiveMatches.size(); i++) {\n\t\t\tMatch match = positiveMatches.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(match.getSpectrum().getFile().getName())) {\n\t\t\t\t\tpositiveMatches.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < spectra.size(); i++) {\n\t\t\tSpectrum spectrum = spectra.get(i);\n\t\t\tfor (String name: verbotenSpectra) {\n\t\t\t\tif (name.equals(spectrum.getFile().getName())) {\n\t\t\t\t\tspectra.remove(i);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* finding how much time per spectrum */\n\t\tmilisecondsPerSpectrum = (double) timeElapsed / spectra.size();\n\n\n\t\tMatch.setSortParameter(Match.SORT_BY_SCORE);\n\t\tCollections.sort(positiveMatches);\n\t\t\n\t\t\n\t\t/* Identify if each match is true or false */\n\t\ttestedMatches = new ArrayList<MatchContainer>(positiveMatches.size());\n\t\tfor (Match match: positiveMatches) {\n\t\t\tMatchContainer testedMatch = new MatchContainer(match);\n\t\t\ttestedMatches.add(testedMatch);\n\t\t}\n\t\t\n\t\t/* sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\t\n\t\t\n\n\t\t/*account for the fact that these results might have the wrong spectrum ID due to\n\t\t * Mascot having sorted the spectra by mass\n\t\t */\n\t\tif (Properties.scoringMethodName.equals(\"Mascot\")){\n\t\t\t\n\t\t\t/* hash of true peptides */\n\t\t\tHashtable<String, Peptide> truePeptides = new Hashtable<String, Peptide>();\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tString truePeptide = mc.getCorrectAcidSequence();\n\t\t\t\ttruePeptides.put(truePeptide, mc.getTrueMatch().getPeptide());\n\t\t\t}\n\t\t\t\n\t\t\t/* making a hash of the best matches */\n\t\t\tHashtable<Integer, MatchContainer> bestMascotMatches = new Hashtable<Integer, MatchContainer>(); \n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tMatchContainer best = bestMascotMatches.get(mc.getMatch().getSpectrum().getId());\n\t\t\t\tif (best == null) {\n\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t} else {\n\t\t\t\t\tif (truePeptides.get(mc.getMatch().getPeptide().getAcidSequenceString()) != null) {\n\t\t\t\t\t\tbestMascotMatches.put(mc.getMatch().getSpectrum().getId(), mc);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* need to set the peptide, because though it may have found a correct peptide, it might not be the right peptide for this particular spectrum */\n\t\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\t\tmc.validate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttestedMatches = new ArrayList<MatchContainer>(bestMascotMatches.values());\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/* reduce the tested matches to one per spectrum, keeping the one that is correct if there is a correct one \n\t\t * else keep the match with the best score */\n\t\tArrayList<MatchContainer> reducedTestedMatches = new ArrayList<MatchContainer>(testedMatches.size());\n\t\tfor (Spectrum spectrum: spectra) {\n\t\t\tMatchContainer toAdd = null;\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getSpectrum().getId() == spectrum.getId()) {\n\t\t\t\t\tif (toAdd == null) {\n\t\t\t\t\t\ttoAdd = mc; \n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() < mc.getMatch().getScore()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t\tif (toAdd.getMatch().getScore() == mc.getMatch().getScore() && mc.isTrue()) {\n\t\t\t\t\t\ttoAdd = mc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (toAdd != null) {\n\t\t\t\treducedTestedMatches.add(toAdd);\n\t\t\t}\n\t\t}\n\t\ttestedMatches = reducedTestedMatches;\n\t\t\n\t\t/* ensure the testedMatches are considering the correct peptide */\n\t\tif (Properties.scoringMethodName.equals(\"Peppy.Match_IMP\")){\n\t\t\tfor (MatchContainer mc: testedMatches) {\n\t\t\t\tif (mc.getMatch().getScore() < mc.getTrueMatch().getScore()) {\n\t\t\t\t\tmc.getMatch().setPeptide(mc.getTrueMatch().getPeptide());\n\t\t\t\t\tmc.getMatch().calculateScore();\n\t\t\t\t\tmc.validate();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/* again sort the tested matches */\n\t\tCollections.sort(testedMatches);\n\t\n\t\t\n\t\t//count total true;\n\t\tfor (MatchContainer match: testedMatches) {\n\t\t\tif (match.isTrue()) {\n\t\t\t\ttrueTally++;\n\t\t\t} else {\n\t\t\t\tfalseTally++;\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.01) {\n\t\t\t\ttrueTallyAtOnePercentError = trueTally;\n\t\t\t\tpercentAtOnePercentError = (double) trueTallyAtOnePercentError / spectra.size();\n\t\t\t}\n\t\t\tif ((double) falseTally / (trueTally + falseTally) <= 0.05) {\n\t\t\t\ttrueTallyAtFivePercentError = trueTally;\n\t\t\t\tpercentAtFivePercentError = (double) trueTallyAtFivePercentError / spectra.size();\n\t\t\t}\n\t\t}\n\t\t\n\t\tgeneratePrecisionRecallCurve();\n\t}", "private void ncpStep(double height) {\n/* 56 */ double posX = mc.field_71439_g.field_70165_t;\n/* 57 */ double posZ = mc.field_71439_g.field_70161_v;\n/* 58 */ double y = mc.field_71439_g.field_70163_u;\n/* 59 */ if (height >= 1.1D) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 80 */ if (height < 1.6D) {\n/* */ double[] offset;\n/* 82 */ for (double off : offset = new double[] { 0.42D, 0.33D, 0.24D, 0.083D, -0.078D }) {\n/* 83 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y += off, posZ, false));\n/* */ }\n/* 85 */ } else if (height < 2.1D) {\n/* */ double[] heights;\n/* 87 */ for (double off : heights = new double[] { 0.425D, 0.821D, 0.699D, 0.599D, 1.022D, 1.372D, 1.652D, 1.869D }) {\n/* 88 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + off, posZ, false));\n/* */ }\n/* */ } else {\n/* */ double[] heights;\n/* 92 */ for (double off : heights = new double[] { 0.425D, 0.821D, 0.699D, 0.599D, 1.022D, 1.372D, 1.652D, 1.869D, 2.019D, 1.907D })\n/* 93 */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + off, posZ, false)); \n/* */ } \n/* */ return;\n/* */ } \n/* */ double first = 0.42D;\n/* */ double d1 = 0.75D;\n/* */ if (height != 1.0D) {\n/* */ first *= height;\n/* */ d1 *= height;\n/* */ if (first > 0.425D)\n/* */ first = 0.425D; \n/* */ if (d1 > 0.78D)\n/* */ d1 = 0.78D; \n/* */ if (d1 < 0.49D)\n/* */ d1 = 0.49D; \n/* */ } \n/* */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + first, posZ, false));\n/* */ if (y + d1 < y + height)\n/* */ mc.field_71439_g.field_71174_a.func_147297_a((Packet)new CPacketPlayer.Position(posX, y + d1, posZ, false)); \n/* */ }" ]
[ "0.54915345", "0.540406", "0.53858006", "0.53498703", "0.52877605", "0.5259809", "0.52222455", "0.52173066", "0.5217249", "0.5213142", "0.5183625", "0.51789826", "0.5160655", "0.51563305", "0.5154238", "0.5152134", "0.5145496", "0.51405036", "0.51327765", "0.5128358", "0.51256883", "0.51183724", "0.50971866", "0.5095232", "0.50949645", "0.506791", "0.506731", "0.5052821", "0.5037903", "0.50367266", "0.50300163", "0.50287557", "0.50171846", "0.5007957", "0.49999136", "0.49994907", "0.49826282", "0.49794644", "0.4977172", "0.49761632", "0.4975349", "0.49703473", "0.49693763", "0.49646467", "0.4963075", "0.49628448", "0.4960795", "0.4947888", "0.49306622", "0.4926234", "0.4925338", "0.492162", "0.4918769", "0.49145168", "0.4905077", "0.49048394", "0.48964134", "0.48913988", "0.48870066", "0.4883847", "0.48820782", "0.48803467", "0.48783436", "0.4873425", "0.4872887", "0.48713863", "0.48713863", "0.48713863", "0.48713863", "0.48691574", "0.48639655", "0.48620382", "0.4858082", "0.48508573", "0.48486412", "0.48483357", "0.48481292", "0.48478615", "0.4841491", "0.48408157", "0.4840442", "0.48404106", "0.48399124", "0.48398274", "0.48382854", "0.48361978", "0.48323965", "0.48293602", "0.4829098", "0.4828037", "0.4827184", "0.4825591", "0.48235583", "0.4820213", "0.48157182", "0.48141122", "0.48126578", "0.4811836", "0.4810257", "0.48077077", "0.4806444" ]
0.0
-1
might want to rewrite/rework this
public void gameOver(){ // will be more complex in processing (like a fadey screen or whatever, more dramatic) System.out.println(); System.out.println("Three strikes and you're out! You're FIRED!"); gameOver = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected boolean func_70814_o() { return true; }", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private void poetries() {\n\n\t}", "private void kk12() {\n\n\t}", "public void method_4270() {}", "private static void cajas() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private void strin() {\n\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "protected abstract Set method_1559();", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void parseData() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "private void m50366E() {\n }", "public abstract void mo70713b();", "public void skystonePos4() {\n }", "public void mo38117a() {\n }", "@Override\n protected void getExras() {\n }", "protected boolean func_70041_e_() { return false; }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "protected java.util.List x (java.lang.String r19){\n /*\n r18 = this;\n r0 = r18;\n r2 = r0.K;\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\n r2 = (java.util.List) r2;\n if (r2 == 0) goto L_0x000f;\n L_0x000e:\n return r2;\n L_0x000f:\n r12 = java.util.Collections.emptyList();\n r2 = r18.bp();\n r3 = r18.TaskHandler(r19);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r4 = r2.setDrawable(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n if (r4 != 0) goto L_0x0026;\n L_0x0021:\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0026:\n r13 = r2.getScaledMaximumFlingVelocity(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r14 = new java.io.ByteArrayOutputStream;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r2 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;\n r14.<creatCallTask>(r2);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13, r14);\t Catch:{ all -> 0x00f2 }\n r2 = r14.toByteArray();\t Catch:{ all -> 0x00f2 }\n r2 = com.duokan.kernel.DkUtils.decodeSimpleDrm(r2);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r4 = \"UTF-8\";\n r3.<creatCallTask>(r2, r4);\t Catch:{ all -> 0x00f2 }\n r2 = new org.json.JSONObject;\t Catch:{ all -> 0x00f2 }\n r2.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n if (r2 != 0) goto L_0x0055;\n L_0x004a:\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0055:\n r3 = \"pictures\";\n r15 = com.duokan.reader.common.getPhysicalYPixels.setDrawable(r2, r3);\t Catch:{ all -> 0x00f2 }\n r16 = new java.util.ArrayList;\t Catch:{ all -> 0x00f2 }\n r2 = r15.length();\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.<creatCallTask>(r2);\t Catch:{ all -> 0x00f2 }\n r2 = 0;\n L_0x0067:\n r3 = r15.length();\t Catch:{ all -> 0x00f2 }\n if (r2 >= r3) goto L_0x00d0;\n L_0x006d:\n r3 = r15.getJSONObject(r2);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_md5\";\n r7 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_url\";\n r6 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_size\";\n r8 = r3.getLong(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"width\";\n r10 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"height\";\n r11 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r4 = \".\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r2);\t Catch:{ all -> 0x00f2 }\n r4 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r17 = \"file:///stuffs/\";\n r0 = r17;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r7);\t Catch:{ all -> 0x00f2 }\n r3 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n r3 = r18;\n r3 = r3.setDrawable(r4, r5, r6, r7, r8, r10, r11);\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.add(r3);\t Catch:{ all -> 0x00f2 }\n r2 = r2 + 1;\n goto L_0x0067;\n L_0x00d0:\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r1 = r16;\n r2.putIfAbsent(r0, r1);\t Catch:{ all -> 0x00f2 }\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\t Catch:{ all -> 0x00f2 }\n r2 = (java.util.List) r2;\t Catch:{ all -> 0x00f2 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n r18.bq();\n goto L_0x000e;\n L_0x00f2:\n r2 = move-exception;\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n throw r2;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n L_0x00fa:\n r2 = move-exception;\n r2 = r12;\n L_0x00fc:\n r18.bq();\n goto L_0x000e;\n L_0x0101:\n r2 = move-exception;\n r18.bq();\n throw r2;\n L_0x0106:\n r3 = move-exception;\n goto L_0x00fc;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.duokan.reader.domain.bookshelf.jv.MyContextWrapper(java.lang.String):java.util.List\");\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void skystonePos6() {\n }", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "public void mo12628c() {\n }", "private void level7() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public abstract void mo27385c();", "protected void mo6255a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "protected void method_2665() {\r\n super.method_2427(awt.field_4171);\r\n this.method_2440(true);\r\n this.method_2521(class_872.field_4244);\r\n }", "public void mo4359a() {\n }", "private static void iterator() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public abstract void mo6549b();", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public abstract void mo56925d();", "public void redibujarAlgoformers() {\n\t\t\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public void skystonePos2() {\n }", "public abstract void mo27386d();", "public void skystonePos3() {\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "public void mo21877s() {\n }", "@Override\n\tpublic void accept(Visitor visitor) {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n public void preprocess() {\n }", "@Override\n public void preprocess() {\n }", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "public abstract int mo9754s();", "public void verliesLeven() {\r\n\t\t\r\n\t}", "String processing();", "StackManipulation cached();", "public void skystonePos5() {\n }", "private void level6() {\n }", "private void searchFunction() {\n\t\t\r\n\t}", "@Override\n\tpublic void visitXmatch(Xmatch p) {\n\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "private void m50367F() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "public static void listing5_14() {\n }", "public abstract void mo2624j();", "@Override\r\n\tpublic void func01() {\n\t\t\r\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "public void mo21793R() {\n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}" ]
[ "0.549792", "0.5496047", "0.5480973", "0.54556537", "0.5447211", "0.5421305", "0.53785974", "0.5366508", "0.5366195", "0.53650194", "0.52914476", "0.52033865", "0.5187824", "0.5181645", "0.5174026", "0.51501405", "0.51469177", "0.5141178", "0.5140477", "0.5140477", "0.51402235", "0.51390076", "0.5109745", "0.51020133", "0.5097888", "0.5090944", "0.50811774", "0.50726074", "0.50670356", "0.50581175", "0.5056659", "0.5051529", "0.50486964", "0.504153", "0.5036277", "0.5030085", "0.5017117", "0.5012271", "0.50085324", "0.4980573", "0.49788988", "0.4957335", "0.4952533", "0.49416938", "0.493214", "0.49316695", "0.49316695", "0.4926761", "0.49154675", "0.49152792", "0.49139628", "0.49017498", "0.48929006", "0.4873132", "0.48715076", "0.48358807", "0.48355165", "0.4831952", "0.48299843", "0.4817134", "0.48069948", "0.4804513", "0.4800845", "0.47866338", "0.4783989", "0.4781105", "0.47781464", "0.47748888", "0.4773032", "0.4767029", "0.47668496", "0.47595885", "0.47466117", "0.4735775", "0.4727888", "0.4727601", "0.47269168", "0.4719389", "0.47134423", "0.47086966", "0.4708341", "0.47023264", "0.46982136", "0.4694716", "0.46939558", "0.46934983", "0.46925554", "0.4688468", "0.46884468", "0.46844074", "0.4676909", "0.4673898", "0.46698096", "0.46698096", "0.46698096", "0.46698096", "0.46698096", "0.46698096", "0.46698096", "0.46686175", "0.46643448" ]
0.0
-1
PURELY A JAVA THING!
public static void wait(int ms){ try { Thread.sleep(ms); } catch(InterruptedException ex) { Thread.currentThread().interrupt(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void cajas() {\n\t\t\n\t}", "private void kk12() {\n\n\t}", "private stendhal() {\n\t}", "public void method_4270() {}", "zzafe mo29840Y() throws RemoteException;", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main(String[] args)\r\t{", "public void gored() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "zzang mo29839S() throws RemoteException;", "public void mo21877s() {\n }", "void mo57277b();", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "public static void main(String[]args) {\n\t\n\t\t\n\n}", "public void mo38117a() {\n }", "public void mo21785J() {\n }", "private void strin() {\n\n\t}", "private JacobUtils() {}", "void mo57278c();", "public abstract String mo9239aw();", "public abstract void mo70713b();", "public void mo4359a() {\n }", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n \r\n\t}", "void mo60893b();", "void mo41086b();", "zzana mo29855eb() throws RemoteException;", "void mo41083a();", "public static void main(String[] args) {\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public abstract void mo2624j();", "public abstract Object mo26777y();", "private Util() { }", "public static void main(String[] args) {\n \n \n \n\t}", "public final void mo51373a() {\n }", "protected void h() {}", "public void mo21878t() {\n }", "private void test() {\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "protected java.util.List x (java.lang.String r19){\n /*\n r18 = this;\n r0 = r18;\n r2 = r0.K;\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\n r2 = (java.util.List) r2;\n if (r2 == 0) goto L_0x000f;\n L_0x000e:\n return r2;\n L_0x000f:\n r12 = java.util.Collections.emptyList();\n r2 = r18.bp();\n r3 = r18.TaskHandler(r19);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r4 = r2.setDrawable(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n if (r4 != 0) goto L_0x0026;\n L_0x0021:\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0026:\n r13 = r2.getScaledMaximumFlingVelocity(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r14 = new java.io.ByteArrayOutputStream;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r2 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;\n r14.<creatCallTask>(r2);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13, r14);\t Catch:{ all -> 0x00f2 }\n r2 = r14.toByteArray();\t Catch:{ all -> 0x00f2 }\n r2 = com.duokan.kernel.DkUtils.decodeSimpleDrm(r2);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r4 = \"UTF-8\";\n r3.<creatCallTask>(r2, r4);\t Catch:{ all -> 0x00f2 }\n r2 = new org.json.JSONObject;\t Catch:{ all -> 0x00f2 }\n r2.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n if (r2 != 0) goto L_0x0055;\n L_0x004a:\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0055:\n r3 = \"pictures\";\n r15 = com.duokan.reader.common.getPhysicalYPixels.setDrawable(r2, r3);\t Catch:{ all -> 0x00f2 }\n r16 = new java.util.ArrayList;\t Catch:{ all -> 0x00f2 }\n r2 = r15.length();\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.<creatCallTask>(r2);\t Catch:{ all -> 0x00f2 }\n r2 = 0;\n L_0x0067:\n r3 = r15.length();\t Catch:{ all -> 0x00f2 }\n if (r2 >= r3) goto L_0x00d0;\n L_0x006d:\n r3 = r15.getJSONObject(r2);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_md5\";\n r7 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_url\";\n r6 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_size\";\n r8 = r3.getLong(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"width\";\n r10 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"height\";\n r11 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r4 = \".\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r2);\t Catch:{ all -> 0x00f2 }\n r4 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r17 = \"file:///stuffs/\";\n r0 = r17;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r7);\t Catch:{ all -> 0x00f2 }\n r3 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n r3 = r18;\n r3 = r3.setDrawable(r4, r5, r6, r7, r8, r10, r11);\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.add(r3);\t Catch:{ all -> 0x00f2 }\n r2 = r2 + 1;\n goto L_0x0067;\n L_0x00d0:\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r1 = r16;\n r2.putIfAbsent(r0, r1);\t Catch:{ all -> 0x00f2 }\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\t Catch:{ all -> 0x00f2 }\n r2 = (java.util.List) r2;\t Catch:{ all -> 0x00f2 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n r18.bq();\n goto L_0x000e;\n L_0x00f2:\n r2 = move-exception;\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n throw r2;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n L_0x00fa:\n r2 = move-exception;\n r2 = r12;\n L_0x00fc:\n r18.bq();\n goto L_0x000e;\n L_0x0101:\n r2 = move-exception;\n r18.bq();\n throw r2;\n L_0x0106:\n r3 = move-exception;\n goto L_0x00fc;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.duokan.reader.domain.bookshelf.jv.MyContextWrapper(java.lang.String):java.util.List\");\n }", "void mo72113b();", "public void miseAJour();", "public void mo21787L() {\n }", "public void furyo ()\t{\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "public static void main(String[] arg) throws Exception{\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public abstract void mo56925d();", "void mo119582b();", "public abstract void mo27385c();", "public void mo21795T() {\n }", "String processing();", "@Override\n\tpublic void jugar() {}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "zzand mo29852bb() throws RemoteException;", "public void mo21793R() {\n }", "public void mo21794S() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public abstract void mo6549b();", "private final void i() {\n }", "@Override\n public void perish() {\n \n }", "public abstract int mo9745j();", "public abstract String mo41079d();", "public static void main(String[] args) {\n\t \t\n\t \t\n\t }" ]
[ "0.62576336", "0.5752865", "0.5695815", "0.5679847", "0.565246", "0.5631891", "0.5571657", "0.55077386", "0.54996836", "0.54825145", "0.54823947", "0.54749167", "0.5466756", "0.54601514", "0.54404974", "0.54381454", "0.5417832", "0.5399428", "0.5378559", "0.53577995", "0.53337497", "0.5323277", "0.52966666", "0.52883416", "0.5283977", "0.52839047", "0.526835", "0.52670544", "0.52667457", "0.52644956", "0.52550614", "0.52531844", "0.52531844", "0.5253064", "0.52489126", "0.5245124", "0.52443343", "0.5244034", "0.5240405", "0.52184594", "0.52167547", "0.52135086", "0.52135086", "0.52135086", "0.52135086", "0.5211957", "0.5206316", "0.52034205", "0.5198308", "0.5197169", "0.51961964", "0.51922584", "0.51922584", "0.51922005", "0.51916754", "0.5188736", "0.5186068", "0.51859826", "0.5183878", "0.51829594", "0.51822233", "0.5179582", "0.51775616", "0.5175347", "0.5173013", "0.51688415", "0.51639074", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5163334", "0.5162507", "0.51623386", "0.5161485", "0.5161077", "0.51598924", "0.51594865" ]
0.0
-1
loop through days, actually runs the thing
public static void main(String[] args){ Executor game = new Executor(); System.out.println(); System.out.println(); game.introduction(); while (! game.gameOver){ game.day(); if (! game.gameOver){ wait(2000); game.endOfDay(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void runEachDay() {\n \n }", "public void setupDays() {\n\n //if(days.isEmpty()) {\n days.clear();\n int day_number = today.getActualMaximum(Calendar.DAY_OF_MONTH);\n SimpleDateFormat sdf = new SimpleDateFormat(\"EEEE\");\n SimpleDateFormat sdfMonth = new SimpleDateFormat(\"MMM\");\n today.set(Calendar.DATE, 1);\n for (int i = 1; i <= day_number; i++) {\n OrariAttivita data = new OrariAttivita();\n data.setId_utente(mActualUser.getID());\n\n //Trasformare in sql date\n java.sql.Date sqldate = new java.sql.Date(today.getTimeInMillis());\n data.setGiorno(sqldate.toString());\n\n data.setDay(i);\n data.setMonth(today.get(Calendar.MONTH) + 1);\n\n data.setDay_of_week(today.get(Calendar.DAY_OF_WEEK));\n Date date = today.getTime();\n String day_name = sdf.format(date);\n data.setDay_name(day_name);\n data.setMonth_name(sdfMonth.format(date));\n\n int indice;\n\n if (!attivitaMensili.isEmpty()) {\n if ((indice = attivitaMensili.indexOf(data)) > -1) {\n OrariAttivita temp = attivitaMensili.get(indice);\n if (temp.getOre_totali() == 0.5) {\n int occurence = Collections.frequency(attivitaMensili, temp);\n if (occurence == 2) {\n for (OrariAttivita other : attivitaMensili) {\n if (other.equals(temp) && other.getCommessa() != temp.getCommessa()) {\n data.setOtherHalf(other);\n data.getOtherHalf().setModifica(true);\n }\n }\n\n }\n }\n data.setFromOld(temp);\n data.setModifica(true);\n }\n }\n isFerie(data);\n\n\n //Aggiungi la data alla lista\n days.add(data);\n\n //Aggiugni un giorno alla data attuale\n today.add(Calendar.DATE, 1);\n }\n\n today.setTime(actualDate);\n\n mCalendarAdapter.notifyDataSetChanged();\n mCalendarList.setAdapter(mCalendarAdapter);\n showProgress(false);\n }", "private void dayLoop(Player p){\r\n\t\t//Loop for every day.\r\n\t\tSystem.out.println(\"*******************\");\r\n\t\tSystem.out.println(\"It is now \" + p.getName() + \"'s turn on this day.\");\r\n\t\twhile(p.getActions() > 0){\r\n\t\t\tSystem.out.println(\"Choose what you're going to do with the day.\");\r\n\t\t\tSystem.out.println(p.getName() + \" has \" + p.getActions() + \" actions left for the day.\");\r\n\t\t\tSystem.out.println(\"1. Play with a pet.\");\r\n\t\t\tSystem.out.println(\"2. Feed a pet.\");\r\n\t\t\tSystem.out.println(\"3. Go to the store.\");\r\n\t\t\tSystem.out.println(\"4. Print out pet status.\");\r\n\t\t\tSystem.out.println(\"5. End the day early.\");\r\n\t\t\tint selected = getNumber(1,5);\r\n\t\t\tswitch(selected){\r\n\t\t\t//Playing with a pet.\r\n\t\t\tcase 1:\r\n\t\t\t\tplay(p);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t//Feeding a pet.\r\n\t\t\tcase 2:\r\n\t\t\t\tfeed(p);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t//Code for the store.\r\n\t\t\tcase 3:\r\n\t\t\t\tstoreTrip(p);\r\n\t\t\t\tbreak;\r\n\t\t\t\t//Print Pet Status\r\n\t\t\tcase 4:\r\n\t\t\t\tfor(Pet pet : p.getPets()){\r\n\t\t\t\t\tSystem.out.println(pet.printStatus());\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t//Print Player inventory.\r\n\t\t\tcase 5:\r\n\t\t\t\tp.printInventory();\r\n\t\t\t\t//Finish the day early.\r\n\t\t\tcase 6:\r\n\t\t\t\tp.setActions(0);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"Fatal Error.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tendDay(p);\r\n\t}", "public void cycleDay() {\r\n player.gametick();\r\n }", "public void processForDays(){\r\n\t\tboolean inDaySection = false;\r\n\t\tint dataSize;\r\n\t\tfor(int i=0; i<Constant.dataList.size(); i++){\r\n\t\t\tString line = Constant.dataList.get(i);\r\n\t\t\tString[] linesplit = line.split(\",\");\r\n\t\t\tdataSize = linesplit.length;\r\n\t\t\t\r\n\t\t\tif (i==0) {\r\n//\t\t\t\tConstant.dataList.set(i, \"Days,Dummy,\" + line);\r\n\t\t\t\tConstant.dayDataList.add(\"Days,Dummy,\"+linesplit[0]+\",\"+linesplit[1]+\",\"+\"Day00\");\r\n\t\t\t}\r\n\t\t\telse if(linesplit[1].equals(\"PM10\")){\r\n\t\t\t\tString m,a,e,n;\r\n//\t\t\t\tm = \"M,1000,\"+linesplit[0]+\"m,\"+linesplit[1];\r\n//\t\t\t\ta = \"A,1000,\"+linesplit[0]+\"a,\"+linesplit[1];\r\n//\t\t\t\te = \"E,1000,\"+linesplit[0]+\"e,\"+linesplit[1];\r\n//\t\t\t\tn = \"N,1000,\"+linesplit[0]+\"n,\"+linesplit[1];\r\n\t\t\t\t//morning,afternoon,evening\r\n\t\t\t\tfor(int j=0; j<4; j++){\r\n\t\t\t\t\tfor(int k=0; k<2; k++){\r\n\t\t\t\t\t\tif(j==0){\r\n\t\t\t\t\t\t\tif(k+7<dataSize){\r\n//\t\t\t\t\t\t\t\tm = m + \",\" + linesplit[k+7];\r\n\t\t\t\t\t\t\t\tm = \"Morning,1000,\"+linesplit[0]+\"m-\"+k+\",\"+linesplit[1]+\",\"+linesplit[k+7];\r\n\t\t\t\t\t\t\t\tConstant.dayDataList.add(m);\r\n\t\t\t\t\t\t\t}\r\n//\t\t\t\t\t\t\telse{\r\n//\t\t\t\t\t\t\t\tm = m + \",\";\r\n//\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(j==1){\r\n\t\t\t\t\t\t\tif(k+13<dataSize){\r\n//\t\t\t\t\t\t\t\ta = a + \",\" + linesplit[k+13];\r\n\t\t\t\t\t\t\t\ta = \"Afternoon,1000,\"+linesplit[0]+\"a-\"+k+\",\"+linesplit[1]+\",\"+linesplit[k+13];\r\n\t\t\t\t\t\t\t\tConstant.dayDataList.add(a);\r\n\t\t\t\t\t\t\t}\r\n//\t\t\t\t\t\t\telse{\r\n//\t\t\t\t\t\t\t\ta = a + \",\";\r\n//\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(j==2){\r\n\t\t\t\t\t\t\tif(k+19<dataSize){\r\n//\t\t\t\t\t\t\t\te = e + \",\" + linesplit[k+19];\r\n\t\t\t\t\t\t\t\te = \"Evening,1000,\"+linesplit[0]+\"e-\"+k+\",\"+linesplit[1]+\",\"+linesplit[k+19];\r\n\t\t\t\t\t\t\t\tConstant.dayDataList.add(e);\r\n\t\t\t\t\t\t\t}\r\n//\t\t\t\t\t\t\telse{\r\n//\t\t\t\t\t\t\t\te = e + \",\";\r\n//\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tif(k<1){\r\n\t\t\t\t\t\t\t\tif(k+25<dataSize){\r\n//\t\t\t\t\t\t\t\t\tn = n + \",\" +linesplit[k+25];\r\n\t\t\t\t\t\t\t\t\tn = \"Night,1000,\"+linesplit[0]+\"n-\"+k+\",\"+linesplit[1]+\",\"+linesplit[k+25];\r\n\t\t\t\t\t\t\t\t\tConstant.dayDataList.add(n);\r\n\t\t\t\t\t\t\t\t}\r\n//\t\t\t\t\t\t\t\telse{\r\n//\t\t\t\t\t\t\t\t\tn = n + \",\";\r\n//\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\tif(k+1<dataSize){\r\n//\t\t\t\t\t\t\t\t\tn = n + \",\" +linesplit[k+1];\r\n\t\t\t\t\t\t\t\t\tn = \"Night,1000,\"+linesplit[0]+\"n-\"+k+\",\"+linesplit[1]+\",\"+linesplit[k+1];\r\n\t\t\t\t\t\t\t\t\tConstant.dayDataList.add(n);\r\n\t\t\t\t\t\t\t\t}\r\n//\t\t\t\t\t\t\t\telse{\r\n//\t\t\t\t\t\t\t\t\tn = n + \",\";\r\n//\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n//\t\t\t\t\tif(j==0){\r\n//\t\t\t\t\t\tConstant.dayDataList.add(m);\r\n//\t\t\t\t\t}\r\n//\t\t\t\t\telse if(j==1){\r\n//\t\t\t\t\t\tConstant.dayDataList.add(a);\r\n//\t\t\t\t\t}\r\n//\t\t\t\t\telse if(j==2){\r\n//\t\t\t\t\t\tConstant.dayDataList.add(e);\r\n//\t\t\t\t\t}\r\n//\t\t\t\t\telse{\r\n//\t\t\t\t\t\tConstant.dayDataList.add(n);\r\n//\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "private void printDays() {\n for (int dayOfMonth = 1; dayOfMonth <= daysInMonth; ) {\n for (int j = ((dayOfMonth == 1) ? dayOfWeek - 1 : 0); j < 7 && (dayOfMonth <= daysInMonth); j++) {\n if (this.isDateChosen == true && date.getDate() == dayOfMonth) {\n String space = date.getDate() >= 10 ? \" \" : \" \";\n System.out.print(space + ANSI_GREEN + dayOfMonth + ANSI_RESET + \" \");\n } else {\n System.out.printf(\"%4d \", dayOfMonth);\n }\n dayOfMonth++;\n }\n System.out.println();\n }\n }", "private RepeatWeekdays() {}", "protected void runEachHour() {\n \n }", "public static void main(String[] args) {\n LocalDate[] dates=new LocalDate[10];\n\n for (int i = 0; i <dates.length ; i++) {\n dates[i] = LocalDate.now().plusDays(i+1);\n }\n System.out.println(Arrays.toString(dates));\n for (LocalDate each:dates){\n System.out.println(each.format(DateTimeFormatter.ofPattern(\"MMMM/dd, EEEE\")));\n }\n\n\n }", "public void daysInCycle()\n {\n for(int j = 0; j < 11; j++)\n {\n for(int k = 0; k < 30; k++)\n {\n if(dates[j][k] > 0)\n {\n System.out.println(monthsArray[j-1] + \" \" + k + \" - \" + dates[j][k]);\n }\n }\n }\n }", "public void run() {\n\t\tfor(int Index=0;Index<pac.getPath().size();Index++) { //run on the path arraylist of every pacman\n\t\t\tfullGamePath(pac, pac.getPath().get(Index).getFruit(),Index); //call the function\n\t\t\tpac.getPath().get(Index).setTime();\n\t\t}\n\t\t\n\t}", "public void incrementDay(){\n //Step 1\n this.currentDate.incrementDay();\n //step2\n if (this.getSavingsAccount() != null)\n this.getSavingsAccount().incrementDay();\n if (this.getCheckingAccount() != null)\n this.getCheckingAccount().incrementDay();\n if (this.getMoneyMarketAccount() != null)\n this.getMoneyMarketAccount().incrementDay();\n if (this.getCreditCardAccount() != null)\n this.getCreditCardAccount().incrementDay();\n //step 3\n if (this.getDate().getDay() == 1) {\n \n if (this.getSavingsAccount() != null)\n this.getSavingsAccount().incrementMonth();\n if (this.getCheckingAccount() != null)\n this.getCheckingAccount().incrementMonth();\n if (this.getMoneyMarketAccount() != null)\n this.getMoneyMarketAccount().incrementMonth();\n if (this.getCreditCardAccount() != null)\n this.getCreditCardAccount().incrementMonth();\n }\n \n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint[] arr = {31,28,31,30,31,30,31,31,30,31,30,31};\n\t\tString[] day = {\"SUN\",\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\",\"SAT\"};\n\t\tint month = sc.nextInt();\n\t\tint date = sc.nextInt();\n\t\tint result = date;\n\t\tfor(int i=0; i<month-1;i++) {\n\t\t\tresult += arr[i];\n\t\t}\n\t\tSystem.out.println(day[result % 7]);\n\t}", "private void nextDay() {\r\n tmp.setDay(tmp.getDay() + 1);\r\n int nd = tmp.getDayOfWeek();\r\n nd++;\r\n if (nd > daysInWeek) nd -= daysInWeek;\r\n tmp.setDayOfWeek(nd);\r\n upDMYcountDMYcount();\r\n }", "public static void main ( String [] args ) {\r\n long[] argsLong = new long[6];\r\n\r\n for (int i = 0; i < argsLong.length; i++)\r\n argsLong[i] = Long.parseLong(args[i]);\r\n\r\n long count = CalendarStuff.daysBetween(argsLong[0], argsLong[1], argsLong[2], argsLong[3], argsLong[4], argsLong[5]);\r\n\r\n if (1 == count)\r\n System.out.println(\"\\n\" + count + \" day\");\r\n else\r\n System.out.println(\"\\n\" + count + \" days\");\r\n\r\n }", "public void step() {\n\t\tfor (SimObject o : simObjects) {\n\t\t\to.step(timeScale);\n\t\t}\n\n\t\t// increment time elasped\n\t\tdaysElapsed += ((double) (timeScale)) / 86400.0;\n\n\t\t// if more than 30.42 days have elapsed, increment months\n\t\tif (daysElapsed >= 30.42) {\n\t\t\tmonthsElapsed++;\n\t\t\tdaysElapsed -= 30.42;\n\t\t}\n\n\t\t// if more than 12 months have elapsed, increment years\n\t\tif (monthsElapsed >= 12) {\n\t\t\tyearsElapsed++;\n\t\t\tmonthsElapsed -= 12;\n\t\t}\n\t}", "public static void main(String[] args) throws InterruptedException {should know before hand\n\t\t//target day,month,year\n\t\t//current day,month,year\n\t\t//jump to the month\n\t\t//increment or decrement\n\t\t//\n\t\t\n\t\tgettargetdate(targetdate);\n\t\t getcurrentdate();\n\t\t howmanymonthstojump();\n\t\t WebDriver d = new FirefoxDriver();\n\t\td.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);\n\t\t d.get(\"https://jqueryui.com/datepicker/\");\n\t\t System.out.println((d.findElements(By.tagName(\"iframe\")).size()));\n\t\t\td.switchTo().frame(d.findElements(By.tagName(\"iframe\")).get(0));\n\t\t\t\n\t\t d.findElement(By.xpath(\".//*[@id='datepicker']\")).click();\n\t\t// Thread.sleep(1000L);\n\t\t \n\t\t \n\t\t WebElement left= d.findElement(By.xpath(\".//*[@id='ui-datepicker-div']/div/a[1]\"));//left\n\t\t WebElement right= d.findElement(By.xpath(\".//*[@id='ui-datepicker-div']/div/a[2]\"));//right\n\t\t \n\t\t for (int i=0;i<monthstojump;i++)\n\t\t {\n\t\t\t if(increment == true)\n\t\t\t {\n\t\t\t\t left.click();\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t right.click();\n\t\t\t }\n\t\t\t Thread.sleep(1000L);\n\t\t\t \n\t\t\t \n\t\t }\n\t\t d.findElement(By.linkText(Integer.toString(targetday))).click();\n\t\t Thread.sleep(1000L);\n\n\t}", "@Override\n public void run() {\n\n\n\n System.out.println(\"run scheduled jobs.\");\n\n\n checkBlackOutPeriod();\n\n\n\n checkOfficeActionPeriod1();\n\n checkAcceptedFilings();\n\n checkNOAPeriod();\n checkFilingExtensions();\n\n\n\n }", "private static void incrementDate() {\n\t\ttry {\r\n\t\t\tint days = Integer.valueOf(input(\"Enter number of days: \")).intValue();\r\n\t\t\tcalculator.incrementDate(days); // variable name changes CAL to calculator\r\n\t\t\tlibrary.checkCurrentLoans(); // variable name changes LIB to library\r\n\t\t\toutput(sdf.format(cal.date())); // variable name changes SDF to sdf , CAL to cal , method changes Date() to date()\r\n\t\t\t\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\t output(\"\\nInvalid number of days\\n\");\r\n\t\t}\r\n\t}", "private void setDay() {\n Boolean result = false;\n for (int i = 0; i < 7; ++i) {\n if(mAlarmDetails.getRepeatingDay(i))\n result = true;\n mAlarmDetails.setRepeatingDay(i, mAlarmDetails.getRepeatingDay(i));\n }\n if(!result)\n mAlarmDetails.setRepeatingDay((Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1), true);\n }", "void aDayPasses(){\n\t\t\n\t\t/**\n\t\t * Modify wait time if still exists\n\t\t */\n\t\tif(!daysUntilStarts.equals(0)){\n\t\t\tdaysUntilStarts--;\n\t\t\tif((!hasInstructor() || getSize() == 0) && daysUntilStarts.equals(0)){\n\t\t\t\tif(hasInstructor())\n\t\t\t\t\tinstructor.unassignCourse();\n\t\t\t\tfor(Student student : enrolled){\n\t\t\t\t\tstudent.dropCourse();\n\t\t\t\t}\n\t\t\t\tsubject.unassign();\n\t\t\t\tinstructor = null;\n\t\t\t\tenrolled = new ArrayList<Student>();\n\t\t\t\tcancelled = true;\n\t\t\t} else if (daysUntilStarts.equals(0)) {\n\t\t\t\tsubject.unassign();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Modify run time if still exists\n\t\t */\n\t\tif(!daysToRun.equals(0)){\n\t\t\tdaysToRun--;\n\t\t}\n\t\t/**\n\t\t * If couse finished un-assigned people from it\n\t\t */\n\t\tif(daysToRun.equals(0) && !finished){\n\t\t\tfor(Student student : enrolled){\n\t\t\t\tstudent.graduate(subject);\n\n\t\t\t}\n\t\t\tinstructor.unassignCourse();\n\t\t\tinstructor = null;\n\t\t\tfinished = true;\n\t\t}\n\t}", "void dailyLife() {\n\t\tString action = inputPrompt.dailyOptions(dailyTime).toLowerCase();\r\n\t\tswitch(action) {\r\n\t\tcase \"exercise\":\tthis.exercise();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"study\":\t\tthis.study();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"rocket\":\t\tthis.buildRocket();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"eat\":\t\t\tthis.eat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"meds\":\t\tthis.getEnergised();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tcase \"fun\":\t\t\tthis.haveFun();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\tdefault:\t\t\tdailyLife();\r\n\t\t}\t\r\n\t}", "@Override\n public void run() {\n\n try {\n LocalDateTime now = LocalDateTime.now();\n voda bot = new voda();\n\n List<Integer> notifyTime = Arrays.asList(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23);\n int currentHour = now.getHour();\n\n ArrayList<Integer> consulted = dbmodel.MysqlCon.getFollowers();\n\n for (Integer ntime : notifyTime) {\n if (ntime == currentHour) {\n for (Integer consultedUser : consulted) {\n bot.sendTextToIdMessage(consultedUser, dbmodel.MysqlCon.getEveryDayWaterUserWaterCountView(consultedUser));\n }\n }\n }\n\n\n } catch (Exception e) {\n System.out.println();\n }\n }", "public static void main(String[] args) {\n\n\t\tint time=8;\n\t\tif (time<12) {\n\t\t\tSystem.out.println(\"Good morning\"); // code executes\n\t\t\t\n\t\t}\n\t\twhile (time<12) {\n\t\t\t\n\t\t\tSystem.out.println(\"Good morning\");// if condition is ture\n\t\t\ttime++;\n\t\t\t\n\t\t\t// i want to print Good Morning 5 times\n\t\t\t\n\t\t\tint i=1;\n\t\t\t\n\t\t\twhile (i<5) {\n\t\t\t\tSystem.out.println(\" Good Afternoon\");\n\t\t\t\ti++;\n\t\t\t\t\n\t\t\t}\n\t}\n\t}", "public void run() {\n while (true) {\n Date d = new Date();\n //lbldate.setText(d.toString());\n String date = d.toString();\n String arr[] = date.split(\" \");\n String dd = arr[5] + \" / \" + arr[1] + \" / \" + arr[2];\n lbldate.setText(dd);\n\n lbltime.setText(arr[3]);\n }\n }", "public void run() {\n while (true) {\n Date d = new Date();\n //lbldate.setText(d.toString());\n String date = d.toString();\n String arr[] = date.split(\" \");\n String dd = arr[5] + \" / \" + arr[1] + \" / \" + arr[2];\n lbldate.setText(dd);\n\n lbltime.setText(arr[3]);\n }\n }", "private void incrementeDate() {\n dateSimulation++;\n }", "public static void main(String args[]){\n\t\tTimeUtil.getBetweenDays(\"2019-01-01\",TimeUtil.dateToStr(new Date(), \"-\"));\n\t\t\n\t\t/*\tTimeUtil tu=new TimeUtil();\n\t\t\tString r=tu.ADD_DAY(\"2009-12-20\", 20);\n\t\t\tSystem.err.println(r);\n\t\t\tString [] a= TimeUtil.getPerNyyMMdd(\"20080808\", \"4\",9);\n\t\t\tfor(int i=0;i<a.length;i++){\n\t\t\t\tSystem.out.println(a[i]);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(TimeUtil.getPerNyyMMdd(\"20080808\", \"1\",9));\n\t\t\tSystem.out.println(TimeUtil.getPerNyyMMdd(\"20080808\", \"2\",3));\n\t\t\tSystem.out.println(TimeUtil.getPerNyyMMdd(\"20080808\", \"3\",3));\n\t\t\tSystem.out.println(TimeUtil.getPerNyyMMdd(\"20080808\", \"4\",3));\n\t*/\n\t\tTimeUtil tu=new TimeUtil();\n\t//\tString newDate = TimeUtil.getDateOfCountMonth(\"2011-03-31\", 6);\n\t//\tSystem.out.println(newDate);\n//\t\tSystem.err.println(tu.getDateTime(\"\")+\"|\");\n\t\t\n\t\t}", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tlong diff = ConstantUtil.setThreadStartTimer(\"01\",\"30\",null);\n\t\t\t\n\t\t\tif(diff<0){//凌晨1点30分之前则等待\n\t\t\t\tThread.sleep(0-diff);\n\t\t\t\tupdateMonthKline();\n\t\t\t}else{//凌晨1点30分后则立即启动\n\t\t\t\tupdateMonthKline();\n\t\t\t}\n\t\t\n\t\t\twhile (true){\n\t\t\t\tlong diff11 = ConstantUtil.setThreadStartTimer(\"01\",\"30\",null);\n\t\t\t\tThread.sleep(1000l*60*60*24-diff11);\n\t\t\t\tupdateMonthKline();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void updateSpecificDay(int i){\n String[] weekArray = {\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\",\"SAT\",\"SUN\"};\n int weekday2=i;\n weekday2=weekday2%7;\n String weekday2string=weekArray[weekday2];\n TextView TVweekday2=(TextView)this.findViewById(R.id.weekday2);\n TVweekday2.setText(weekday2string);\n\n int weekday3=i+1;\n weekday3=weekday3%7;\n String weekday3string=weekArray[weekday3];\n TextView TVweekday3=(TextView)this.findViewById(R.id.weekday3);\n TVweekday3.setText(weekday3string);\n\n int weekday4=i+2;\n weekday4=weekday4%7;\n String weekday4string=weekArray[weekday4];\n TextView TVweekday4=(TextView)this.findViewById(R.id.weekday4);\n TVweekday4.setText(weekday4string);\n\n int weekday5=i+3;\n weekday5=weekday5%7;\n String weekday5string=weekArray[weekday5];\n TextView TVweekday5=(TextView)this.findViewById(R.id.weekday5);\n TVweekday5.setText(weekday5string);\n }", "public void addDailySteps(int steps) {\n totalSteps+=steps;day++;\n if (steps>=STEPS) activeDay++;\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile(true) {\n\t\t\t\tDate ti = new Date();\n\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n//\t\t\t\tSystem.out.println(sdf.format(ti));\n\t\t\t\tt.setText(sdf.format(ti));\n\t\t\t\t}\n\t\t}", "public static void main(String[] args) {\n // TODO code application logic here\n //Percipitation p = new Percipitation(\"cm(s)\", 10);\n //Random rand = new Random();\n //System.out.println(rand.nextInt(2));\n System.out.println(\"Welcome to Weather-Tron. Here's your report: \");\n for(int i = 1 ; i <= 10; i++){\n System.out.println(\"Day \" + i + \" :\");\n Day day = new Day(); \n }\n \n }", "public void run() {\r\n\t\tboolean repeat = true;\r\n\t\tint count = 0;\r\n\t\twhile(repeat){\r\n\t\t\tcount ++;\r\n\t\t\t//updates currency rates every hour (count>60)\r\n\t\t\tif(count > 60){\r\n\t\t\t\tcurrencies.updateRates();\r\n\t\t\t\tcount = 1;\r\n\t\t\t}\r\n\t\t\tprintStatus();\r\n\t\t\ttry{\r\n\t\t\t\tThread.sleep(60000);\r\n\t\t\t}catch(InterruptedException ex){\r\n\t\t\t\trepeat = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String... args){\n Calendar cal = new Calendar(123456789101112L, 1314151617181920L);\n// cal.iterateYears();\n// cal.displayStats();\n\n cal.alternateIterateYears(123456789101112L, 1314151617181920L);\n //cal.alternateIterateYears(1234, 5678);\n\n cal.displayStats();\n }", "public void refreshAllRepeatReminderDates(){\n for(int position=0;position<reminderItems.size();position++){\n refreshRepeatReminder(position);\n }\n }", "public void run() {\t\t\n\t\tArrayList<String> foodArray = null;\n\t\t\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"MM_dd_yyyy\");\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);\n\t\tString date = dateFormat.format(calendar.getTime());\n\t\t\n\t\tString url = buildURL(new String[]{location, date, time});\n\t\t\n\t\t//Document object to retreive to\n\t\tDocument doc = null;\n\t\t//Number of attempts to connect to page\n\t\tint count = 5;\n\t\t\n\t\twhile (count > 0) {\n\t\t\tcount--;\n\t\t\ttry {\n\t\t\t\tdoc = Jsoup.connect(url).get();\n\t\t\t\tbreak;\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.w(\"debug\", \"Failed to get document. Retrying...\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (doc == null) {\n\t\t\tLog.e(\"debug\", \"Error retreiving document.\");\n\t\t\treturn; //TODO: Exit with message\n\t\t}\n\t\t\n\t String output = doc.outerHtml(); \n\t \n\t //System.out.println(output);\n BufferedReader bufReader = new BufferedReader(new StringReader(output));\n String line=null;\n \n // array with 7 spaces that will store the daily menus\n ArrayList<ArrayList<String>> days = new ArrayList<ArrayList<String>>();\n for(int i = 0; i < 7; i++){\n \tdays.add(new ArrayList<String>());\n }\n //Represents the current day (0 = Sunday, 1 = Monday, ... , 6 = Saturday)\n int current = -1;\n //FileWriter fstreamOrig = new FileWriter(\"src/us/fabianism/MenuScraper/htmlout.txt\");\n\t\t//BufferedWriter htmlout = new BufferedWriter(fstreamOrig);\n \tString substring;\n // Continues until there are no more lines to read\n try {\n\t\t\twhile( (line=bufReader.readLine()) != null )\n\t\t\t{\n\t\t\t\t// Removes spaces and quotations, for ease of use.\n\t\t\t\tline = line.replaceAll(\"\\\"\",\"&\");\n\t\t\t\tline = line.replaceAll(\"\\\\s\",\"\");\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tif(line.length() >= 43){\n\t\t\t\t\tsubstring = line.substring(0, 42);\n\t\t\t\t}\n\t\t\t\t// iterates through the days so that items are added to the correct menu\n\t\t\t\n\t\t\t\tif (line.equals(\"<tdvalign=&top&class=&menuBorder&>\") || (line.equals(\"<tdvalign=&top&class=&menuBorder&><imgsrc=&../../images/spacer.gif&width=&1&height=&1&alt=&&border=&0&/></td>\"))){\n\t\t\t\t\tif(current == 7){\n\t\t\t\t\t\tcurrent = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Finds the menu item and appends it to the string for the given day\n\t\t\t\telse if (line.equals(\"<divclass=&menuTxt&>\")){\n\t\t\t\t\tbufReader.readLine();\n\t\t\t\t\tbufReader.readLine();\n\t\t\t\t\tbufReader.readLine();\n\t\t\t\t\tline = bufReader.readLine();\n\t\t\t\t\t\n\t\t\t\t\tDocument tempdoc = Jsoup.parse(line);\n\t\t\t\t\tdays.get(current).add(tempdoc.body().text());\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// checks to see if a new table is beginning. Sets the day back to sunday if one is\n\t\t\t\telse if(line.length() >= 44){\n\t\t\t\t\tsubstring = line.substring(0, 43);\n\t\t\t\t\tif(substring.equals(\"<tdbgcolor=&#cccccc&class=&ConceptTabText&>\")){\n\t\t\t\t\t\tcurrent = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n //TODO: On the off chance that the array doesn't fill up with menu items, need to restart thread until it is filled.\n foodArray = days.get(day);\n \tIntent intent = new Intent(this, FoodListDisplay.class);\n \tintent.putStringArrayListExtra(\"foodarray\", foodArray);\n \tstartActivity(intent); \n \n finish();\n\t\t\n\t}", "protected void runEachSecond() {\n \n }", "public void lookUpNextDay(int i) throws IllegalCommandArgumentException {\n containsStartDate = true;\n index = tpsIndex > i ? i : tpsIndex ;\n \n if (wordsOfInput[i+1].toLowerCase().matches(Constants.DAYS)) {\n // by (day)\n produceDateFromDay(wordsOfInput[i+1], 0);\n } else if (wordsOfInput[i+1].toLowerCase().matches(\"today|tdy\")) {\n // by today\n produceDateFromDay(null, 5);\n } else if (wordsOfInput[i+1].toLowerCase().matches(\"tomorrow|tmr\")) {\n // by tomorrow\n produceDateFromDay(null, 6);\n }\n \n if (i < wordsOfInput.length-2 && wordsOfInput[i+2].toLowerCase().matches(timePattern)) {\n containsStartTime = true;\n startTime = wordsOfInput[i+2];\n \n if (i < wordsOfInput.length - 4 && \n wordsOfInput[i+3].toLowerCase().matches(Constants.DATE_END_PREPOSITION)) {\n checkForEndTimeInput(i+4);\n }\n \n }\n }", "public void stepPopulation(int day){\r\n\t\tthis.resetComps();\r\n\t\tthis.resetPool();\r\n\t\tfor(int i = 0; i < this.getnVillages(); i++){\r\n\t\t\tVillage curr = this.vVillages[i];\r\n\t\t\tcurr.stepVillage(day);\r\n\t\t\tthis.incrementComps(curr.getComps());\r\n\t\t\tthis.updatePool(curr.getMarketPool());\r\n\t\t}\t\t\r\n\t}", "public static void SwipeUp_Counter_Daily_submodule() throws Exception{\n\n\t\tfor(int i=1;i<=7 ;i++){\n\n\t\t\tSwipe();\n\n\t\t\tBoolean b=verifyElement(By.id(\"com.weather.Weather:id/daily_more\"));\n\t\t\tif(b==true)\n\t\t\t{\n\t\t\t\tlogStep(\"Daily page is presented on the screen\");\n\t\t\t\tAd.findElementById(\"com.weather.Weather:id/daily_more\").click();\n\t\t\t\tlogStep(\"clicked the Daily page link\");\n\t\t\t\tAd.findElementByClassName(\"android.widget.ImageButton\").click();\n\t\t\t\tThread.sleep(5000);\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Module is not present scroll down\");\n\t\t\t}\n\n\n\t\t}\n\t}", "public void processDays() {\n String procDirtyMessage = \"\\n\\nОшибки обработки:\\n\";\n Boolean procIsDirty = false;\n JTVProg.logPrint(this, 3, \"начата обработка каналов\");\n for (Integer currFileIndex = 0; currFileIndex < this.outDays.length; currFileIndex++) {\n this.outDays[currFileIndex] = new java.io.File(this.DAY_PATH + this.daysHeaders[currFileIndex].replaceAll(\",\", \"\").trim() + \".txt\");\n String dayContent = this.daysHeaders[currFileIndex];\n JTVProg.procWindow.procLabel.setText(this.daysHeaders[currFileIndex]);\n JTVProg.procWindow.procProgres.setValue(((currFileIndex + 1) / 7) * 100);\n for (Integer currChannelIndex = 0; currChannelIndex < this.getSetSize(); currChannelIndex++) {\n String channelBlock = dayMatrix[currFileIndex][currChannelIndex];\n if (channelBlock == null) {\n JTVProg.logPrint(this, 1, \"блок канала пуст! [\" + currFileIndex + \",\" + currChannelIndex + \"]\");\n channelBlock = \"ПУСТОЙ БЛОК!!! [\" + currFileIndex + \",\" + currChannelIndex + \"]\";\n procDirtyMessage += dayContent + \": пустой блок в канале (\" + JTVProg.configer.Channels.getChannelByROrder(currChannelIndex + 1) + \");\\n\";\n procIsDirty = true;\n }\n dayContent = dayContent + lineSeparator + lineSeparator + channelBlock;\n }\n try {\n java.io.FileWriter dayWriter = new java.io.FileWriter(this.outDays[currFileIndex]);\n dayWriter.write(dayContent);\n dayWriter.close();\n JTVProg.logPrint(this, 3, \"файл дня [\" + this.daysHeaders[currFileIndex] + \"] успешно сохранен\");\n } catch (IOException ex) {\n JTVProg.logPrint(this, 0, \"ошибка записи файла дня [\" + this.daysHeaders[currFileIndex] + \"]\");\n }\n }\n if (procIsDirty == true) {\n JTVProg.logPrint(this, 0, \"Обработка телепрограммы не удалась!\");\n JTVProg.warningMessage(\"Обработка телепрограммы не удалась из-за повреждения данных!\\n\"+ procDirtyMessage + \"Свяжитесь с разработчиком!\");\n }\n }", "protected void runEachMinute() {\n \n }", "public static void main(String[] args) {\n\t\t\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Users\\\\alahiri\\\\Downloads\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t\tWebDriver w = new ChromeDriver();\n\t\tw.manage().window().maximize();\n\t\tw.get(\"https://www.path2usa.com/travel-companions\");\n\t\tw.findElement(By.id(\"travel_date\")).click();\n\t\t/*while(!w.findElement(By.cssSelector(\"[class='datepicker-days'] [class='datepicker-switch']\")).getText().contains(\"May\"))\n\t\t{\n\t\t\tw.findElement(By.className(\"next\")).click();\n\t\t}*/\n\tList<WebElement> dates = w.findElements(By.cssSelector(\".day\"));\n\tint count = dates.size();\n\t\n\tfor(int i=0 ; i<count ; i++) {\n\t\t\n\t\tString s = w.findElements(By.className(\"day\")).get(i).getText();\n\t\t\n\t\tif(s.equalsIgnoreCase(\"23\"))\n\t\t{\n\t\t\tw.findElements(By.className(\"day\")).get(i).click();\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t}", "public static void main(String[] args) throws InterruptedException {\n\n\t\tString url = \"https://www.path2usa.com/travel-companions\";\n\t\tsetUpDriver(\"chrome\", url);\n\t\t// April 14\n\t\tdriver.findElement(By.id(\"travel_date\")).click();\n\t\t\n\t\t//WebElement month=driver.findElement(By.cssSelector(\"[class='datepicker-days'] [class='datepicker-switch']\"));\n\t\t\n\t\t\n\t\twhile(!driver.findElement(By.cssSelector(\"[class='datepicker-days'] [class='datepicker-switch']\")).getText().contains(\"May\")) {\n\t\t\tdriver.findElement(By.cssSelector(\"[class='datepicker-days'] [class='next']\")).click();\n\t\t\t\n\t\t}\t \n\t\t\n\t\tList<WebElement> dates = driver.findElements(By.cssSelector(\".day\"));\n\t\tint count = dates.size();\n\t\tSystem.out.println(count);\n\t\t\n\t\tfor(int i=0; i<count; i++) {\n\t\t\tWebElement date=dates.get(i);\n\t\t\tThread.sleep(2000);\n\t\t\tString text=date.getText();\n\t\t\tif(text.equalsIgnoreCase(\"29\")) {\n\t\t\t\tdate.click();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//driver.quit();\n//\t\tString url=\"https://www.path2usa.com/travel-companions\";\n// setUpDriver(\"chrome\",url);\n// //April 14\n// driver.findElement(By.id(\"travel_date\")).click();\n// WebElement month=driver.findElement(By.cssSelector(\"[class='datepicker-days'] [class='datepicker-switch']\"));\n// \n// while(!month.getText().contains(\"June\")) {\n// driver.findElement(By.xpath(\"//div[@class='datepicker-days']//th[@class='next']\")).click();\n// \n// }\n// \n// \n// List<WebElement >dates=driver.findElements(By.cssSelector(\".day\"));\n// int count=dates.size();\n// \n// for(int i=0; i<count; i++) {\n// WebElement date=dates.get(i);\n// \n// String text=date.getText();\n// \n// if(text.equalsIgnoreCase(\"30\")) {\n// date.click();\n// System.out.println(text);\n// break;\n// }\n// }\n\n\t}", "public static void main(String[] args) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\chromedriver.exe\");\n\t\tWebDriver driver=new ChromeDriver();\n\t\tdriver.get(\"https://www.path2usa.com/travel-companions\");\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"travel_date\\\"]\")).click();\n\t\twhile(!driver.findElement(By.xpath(\"//div[@class='datepicker-days']//th[@class='datepicker-switch']\")).getText().contains(\"May\"))//while loop keep on executing until it becomes false\n\t\t{\n\t\t\tdriver.findElement(By.xpath(\"//div[@class='datepicker-days']//th[@class='next']\")).click();\n\t\t\n\t\t}\n\t\t/*while(!driver.findElement(By.xpath(\"//div[@class='datepicker-months']//th[@class='datepicker-switch']\")).getText().contains(\"2020\"))\n\t\t{\n\t\t\tdriver.findElement(By.xpath(\"//div[@class='datepicker-months']//th[@class='next']\")).click();\n\t\t}*/\n\t\t\n\t\tList<WebElement> dates= driver.findElements(By.className(\"day\"));\n\t\tint count=driver.findElements(By.className(\"day\")).size();\n\t\tfor(int i= 0; i<count; i++) {\n\t\t\tString text= driver.findElements(By.className(\"day\")).get(i).getText();\n\t\t\tif(text.equalsIgnoreCase(\"23\"))\n\t\t\t{\n\t\t\t\tdriver.findElements(By.className(\"day\")).get(i).click();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\n\t}", "public void run() {\n printMonthNameByNumber();\n }", "public static void main(String[] args) {\n int[][] days = new int[2][2];\n\n days[0][0] = 30;\n days[0][1] = 31;\n days[1][0] = 29;\n days[1][1] = 28;\n // Iterating through multi-dimension arrays takes two loops\n for(int i = 0; i < days.length; i++) {\n for(int j = 0; j < days[i].length; j++) {\n System.out.println(days[i][j]);\n }\n }\n\n // Foreach version\n for(int[] ref: days) {\n for(int dia : ref) {\n System.out.println(dia);\n }\n }\n }", "private void nextRunning(Date date) {\n for (int page = 1; page < 10; page++) {\n vacancies.addAll(parser.parseHtml(URL + page, date));\n }\n LOG.info(vacancies.size());\n try (VacancyDao vacancyDao = new VacancyDao(properties)) {\n vacancyDao.insertSet(vacancies);\n vacancyDao.updateLastUpdateDate(new Date().getTime());\n } catch (Exception e) {\n LOG.error(e.getMessage(), e);\n }\n }", "public static void main(String[] args) {\n\t\tLocalDate now=LocalDate.now();\r\n\t\tPeriod p=Period.ofDays(10);\r\n\t\tLocalDate before=now.minus(p);\r\n\t\tLocalDate then=now.plus(p);\r\n\t\tSystem.out.printf(\"Ten days from %s is %s%n\",now,then);\r\n\t\tSystem.out.printf(\"Ten days before %s is %s%n\",now,before);\r\n\r\n\t}", "protected void runEach10Minutes() {\n try {\n saveHistoryData();\n if (isEnabledScheduler()) {\n boolean action = getLightSchedule().getCurrentSchedule();\n if (action) {\n if (!currentState) switchOn();\n } else {\n if (currentState) switchOff();\n }\n }\n } catch (RemoteHomeManagerException e) {\n RemoteHomeManager.log.error(44,e);\n } catch (RemoteHomeConnectionException e) {\n RemoteHomeManager.log.error(45,e);\n }\n }", "public void fillDays(int days){\n\t\tnumberDate.removeAllItems();\n\t\tfor(int i = 0; i< days; i++){\n\t\t\t//daylist[i] = \"\" + (i+1);\n\t\t\tnumberDate.addItem((i+1));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\tfor (int c=1; c<6; c++) {\n\t\tSystem.out.println(\"Good morning\");\n\t}\n}", "public void letWorldRun(int numberCycles) {\n for (int i = 0; i < numberCycles; i++) {\n System.out.println(\"~~~~~~~~DAY \" + (i + 1)\n + \" of simulation~~~~~~~\\nThe environment of\"\n + \" this cycle is \"\n + time.getEnvironment().getLanguage().toString().toLowerCase()\n + \" and it is day time.\");\n time.runCycle(world.getTrainers());\n time = night;\n System.out.println(\"\\n~~~~It is now night time, and the environment of this cycle is \"\n + time.getEnvironment().getLanguage().toString().toLowerCase());\n night.runCycle(world.getTrainers());\n nextDay();\n }\n System.out.println(\"~~~~The simulation is over, calculating trainer stats~~~~\");\n for (Trainer trainer : trainers) {\n trainer.printDetails();\n }\n }", "@Override\n\tpublic void run() {\n\t\t\n\t\t// create array of values to add, before we start the timer\n\t\tBigDecimal[] values = new BigDecimal[ARRAY_SIZE];\n\t\tfor(int i=0; i<ARRAY_SIZE; i++) values[i] = new BigDecimal(i+1);\n\n\t\tsum = new BigDecimal(0.0);\n\t\tfor(int count=0, i=0; count<this.count; count++, i++) {\n\t\t\tif (i >= values.length) i = 0;\n\t\t\tsum = sum.add( values[i] );\n\t\t}\n\t\t\n\t\n\t}", "@Override\r\n\t\t public void run() {\r\n\t\t\tdayElimVoteTimeout(); // this might need a catch\r\n\r\n\t\t }", "public void nextDay() {\r\n\t\tif (day >= daysPerMonth[month] && !(month == 2 && day == 28) && !(month == 12 && day == 31)) {\r\n\t\t\tthis.month++;\r\n\t\t\tthis.day = 1;\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t\telse if (month == 2 && day == 28 && !(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))) {\r\n\t\t\tthis.month++;\r\n\t\t\tthis.day = 1;\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t\telse if (month == 12 && day == 31) {\r\n\t\t\tthis.year++;\r\n\t\t\tthis.month = 1;\r\n\t\t\tthis.day = 1;\r\n\t\t\tSystem.out.println(\"\\nhappy new year!!!\\n\");\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\tthis.day++;\r\n\t}", "private void changeNextDay(){\n\t\tplanet.getClimate().nextDay();\n\t}", "public void cascadeDay(int days) {\n HashMap<String, Integer> cascadeReminders = new HashMap<>();\n HashMap<String, Integer> cascadeFollowups = new HashMap<>();\n Iterator it = reminders.entrySet().iterator();\n while (it.hasNext()) {\n HashMap.Entry pair = (HashMap.Entry) it.next();\n String key = pair.getKey().toString();\n int value = Integer.parseInt(pair.getValue().toString()) - days;\n if (value >= 0) {\n cascadeReminders.put(key, value);\n }\n it.remove();\n }\n reminders = cascadeReminders;\n\n it = followup.entrySet().iterator();\n while (it.hasNext()) {\n HashMap.Entry pair = (HashMap.Entry) it.next();\n String key = pair.getKey().toString();\n int value = Integer.parseInt(pair.getValue().toString()) - days;\n if (value >= 0) {\n cascadeFollowups.put(key, value);\n }\n it.remove();\n }\n followup = cascadeFollowups;\n }", "public static void main(String[] args) {\n\t\tint day=Integer.parseInt(args[0]);\n\t\tint month=Integer.parseInt(args[1]);\n\t\tint year=Integer.parseInt(args[2]);\n\t\tint arr[]=dayOfWeek(day, month, year);\n\t\tSystem.out.print(\"It is : \"+arr[0]+\" : \");\n\t\tswitch(arr[0]) {\n\t\tcase 1: System.out.println(\"January\");break;\n\t\tcase 2: System.out.println(\"February\");break;\n\t\tcase 3: System.out.println(\"March\");break;\n\t\tcase 4: System.out.println(\"April\");break;\n\t\tcase 5: System.out.println(\"May\");break;\n\t\tcase 6: System.out.println(\"June\");break;\n\t\tcase 7: System.out.println(\"July\");break;\n\t\tcase 8: System.out.println(\"August\");break;\n\t\tcase 9: System.out.println(\"September\");break;\n\t\tcase 10: System.out.println(\"October\");break;\n\t\tcase 11: System.out.println(\"November\");break;\n\t\tcase 12: System.out.println(\"December\");break;\n\t\tdefault:System.out.println(\"Error In Month\");\n\t\t}\n\t\tSystem.out.print(\"It is : \"+arr[1]+\" : \");\n\t\tswitch(arr[1]) {\n\t\tcase 0: System.out.println(\"Sunday\");break;\n\t\tcase 1: System.out.println(\"Monday\");break;\n\t\tcase 2: System.out.println(\"Tuesday\");break;\n\t\tcase 3: System.out.println(\"Wednesday\");break;\n\t\tcase 4: System.out.println(\"Thursday\");break;\n\t\tcase 5: System.out.println(\"Friday\");break;\n\t\tcase 6: System.out.println(\"Saturday\");break;\n\t\tdefault:System.out.println(\"Error In Month\");\n\t\t}\n\t}", "@Override\n public void run() {\n schedule();\n }", "public void run() {\r\n\t\twhile(!quit) {\r\n\t\t\ttry {\r\n\t\t\t\tArrayList<Coupon>allCoupons = (ArrayList<Coupon>) couponDaoDB.getAllCoupons();\r\n\t\t\t\tfor (Coupon c : allCoupons) {\r\n\t\t\t\t\tif(couponDaoDB.expiriedCoupon(c)){\r\n\t\t\t\t\t\tcouponDaoDB.removeCoupon(c);\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"**Daily Job have been Activated**\");\r\n\t\t\t\tSystem.out.println(\"**All exipired Coupons have been Deleted**\");\r\n\t\t\t\tSystem.out.println(\"**going into Sleep of: \"+ sleepTime +\" hours**\");\r\n\t\t\t\tTimeUnit.HOURS.sleep(sleepTime);\r\n\t\t\t//\tTimeUnit.MINUTES.sleep(2); //for Testing\r\n\r\n\t\t\t} catch (InterruptedException | CouponSystemException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void run() {\n\t\t\t\t\t\t\tcal.set(year, month, day, hour, minute);\r\n\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tsysTime.setText(String.format(\"%02d\", cal.get(Calendar.HOUR_OF_DAY)) + \":\"\r\n\t\t\t\t\t\t\t\t\t\t+ String.format(\"%02d\", cal.get(Calendar.MINUTE)));\r\n\t\t\t\t\t\t\t\tsysDate.setText(String.format(\"%02d\", cal.get(Calendar.DAY_OF_MONTH)) + \"/\"\r\n\t\t\t\t\t\t\t\t\t\t+ String.format(\"%02d\", (cal.get(Calendar.MONTH) + 1)) + \"/\"\r\n\t\t\t\t\t\t\t\t\t\t+ String.format(\"%02d\", cal.get(Calendar.YEAR)));\r\n\t\t\t\t\t\t\t\tsysWeekday.setText(\r\n\t\t\t\t\t\t\t\t\t\tcal.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.ENGLISH));\r\n\t\t\t\t\t\t\t\t// in this for loop, every flight is checked whether it's their flight time or\r\n\t\t\t\t\t\t\t\t// not in every second\r\n\t\t\t\t\t\t\t\tfor (c = 0; c < DataFlight.sizeData; c++) {\r\n\t\t\t\t\t\t\t\t\t// timeDepartureDelayCheck and timeArrivalDelayCheck are the times of flight\r\n\t\t\t\t\t\t\t\t\t// with the addition of delay\r\n\r\n\t\t\t\t\t\t\t\t\ttimeDepartureDelayCheck = LocalTime.parse(DataFlight.data[c][6])\r\n\t\t\t\t\t\t\t\t\t\t\t.plusMinutes(Integer.parseInt(DataFlight.data[c][8]));\r\n\t\t\t\t\t\t\t\t\ttimeArrivalDelayCheck = LocalTime.parse(DataFlight.data[c][7])\r\n\t\t\t\t\t\t\t\t\t\t\t.plusMinutes(Integer.parseInt(DataFlight.data[c][8]));\r\n\r\n\t\t\t\t\t\t\t\t\t// if it's time for departure, new thread of flight is started directly with\r\n\t\t\t\t\t\t\t\t\t// creating FlightThread object, but without\r\n\t\t\t\t\t\t\t\t\t// saving to any object variable. Number of current flights (rowCurrent) is\r\n\t\t\t\t\t\t\t\t\t// increased by 1\r\n\t\t\t\t\t\t\t\t\tif (timeDepartureDelayCheck.equals(LocalTime.parse(sysTime.getText()))) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t(new FlightThread(c, cal, timeDepartureDelayCheck, timeArrivalDelayCheck,\r\n\t\t\t\t\t\t\t\t\t\t\t\trowCurrent)).start();\r\n\t\t\t\t\t\t\t\t\t\trowCurrent++;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\ttry { // thread waits for 1 second (1000 ms)\r\n\t\t\t\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tcal.add(Calendar.MINUTE, 1); // and in every turn, minute is added by 1\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "public static void main(String[] args) {\n Dog testDog = new Dog(\"Molly\", \"123 Main St.\");\n int exampleWalks[] = { 1, 1, 2, 1, 1, 0, 0};\n testDog.setWalksPerDay(exampleWalks);\n\n Dog testDog2 = new Dog(\"Bob\", \"456 Hennepin Ave.\");\n int exampleWalks2[] = {0, 1, 1, 1, 0, 1, 1};\n testDog2.setWalksPerDay(exampleWalks2);\n \n \n //TODO put all Dogs in ArrayList\n\n for (int day = 0 ; day < 7 ; day++) {\n\n //TODO instead of working with each Dog individually, get dog information from your list of Dog objects.\n //So you'll need another loop here, to loop over the Dogs list\n System.out.println(testDog.getName());\n //String nameOfDay = dayLookup.get(day); ///get name of day from HashMap.\n System.out.println(\"On day \" + nameOfDay + \" walk dog this many times \"+ testDog.getNumberOfWalksForDay(day));\n\n\n }\n\n\n\n\n\n\n }", "@Override\n\tpublic void run() {\n\t\t\n\t\tfor(int i = 0 ;i<10;i++){\n\t\t\tSystem.out.println(\"Runner \"+i);\n\t\t}\n\t}", "public void run(){\n SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\"); \n Date date = new Date(); \n \n String formatted_date = formatter.format((date)); \n \n if(TimeInRange(formatted_date)){\n \n String DailyReport = BuildDailyReport();\n String InventoryReport = BuildInventoryReport();\n \n sprinter.PrintDailyReport(DailyReport);\n sprinter.PrintInventoryReport(InventoryReport);\n \n } \n \n //Cancel current.\n timer.cancel();\n \n //Start a newone.\n TimerDevice t = new TimerDevice();\n \n }", "private void getData(int day){\n try {\n String today = DateUtilities.getCurrentDateInString();\n DateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date currentDate = dateFormat.parse(today);\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(currentDate);\n calendar.add(Calendar.DAY_OF_YEAR,-day);\n Date datebefore = calendar.getTime();\n String dateBeforeStr = dateFormat.format(datebefore);\n\n stepsTakenModels = db.stepsTakenDao().getStepsTakenInrange(dateBeforeStr,today);\n// stepsTakenModels.addAll(db.stepsTakenDao().getStepsTakenInrange(\"01-10-2019\",today));\n\n for(int i = 0 ; i < 7 ; i++){\n stepsTakenModelsLastWeek.add(stepsTakenModels.get(i));\n }\n\n for(int i = 7 ; i<stepsTakenModels.size() ; i++){\n stepsTakenModelsThisWeek.add(stepsTakenModels.get(i));\n }\n// if(stepsTakenModelsThisWeek.size()==0){\n// StepsTakenModel stepsTakenModel = new StepsTakenModel();\n// stepsTakenModel.setSteps(659);\n// stepsTakenModel.setDate(today);\n// stepsTakenModelsThisWeek.add(stepsTakenModel);\n// }\n\n }catch (Exception e){\n Log.d(\"TAG\",e.getMessage());\n }\n }", "private void processAccounts(){\r\n for (Account aAccount: theAccounts) {\r\n aAccount.runYear();\r\n }\r\n\r\n }", "public void findEasterDay()\n {\n while(year <= endYear)\n {\n EasterMath(year);\n for(int j = 0; j < 11; j++)\n {\n for(int k = 0; k < 30; k++)\n {\n if(month == j && day == k)\n {\n dates[j][k]++;\n }\n }\n }\n year++;\n }\n }", "public void toPunish() {\n\n //// TODO: 24/03/2017 delete the following lines\n// dalDynamic.addRowToTable2(\"23/03/2017\",\"Thursday\",4,walkingLength,deviation)\n\n\n\n int dev,sum=0;\n long id;\n id=dalDynamic.getRecordIdAccordingToRecordName(\"minutesWalkTillEvening\");\n Calendar now = Calendar.getInstance();//today\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat dateFormat=new SimpleDateFormat(\"dd/MM/yyyy\");\n String date;\n for (int i = 0; i <DAYS_DEVIATION ; i++) {\n date=dateFormat.format(calendar.getTime());\n Log.v(\"Statistic\",\"date \"+date);\n dev = dalDynamic.getDeviationAccordingToeventTypeIdAnddate(id,date);\n sum+=dev;\n calendar.add(Calendar.DATE,-1);//// TODO: -1-i????\n }\n if(sum==DAYS_DEVIATION){\n Intent intent = new Intent(context,BlankActivity.class);\n context.startActivity(intent);\n //todo:punishment\n }\n\n }", "public void run() {\n\t\t\t\tIMSScheduleManager.super.startCron();\r\n\t\t\t\t\r\n\t\t\t}", "@SuppressWarnings(\"unchecked\")\n\tprotected void genObjects(GenCtx ctx, Date day)\n\t throws GenesisError\n\t{\n\t\tEntry[] entries = selectEntries(ctx, genObjsNumber(ctx));\n\t\tMap inds = new IdentityHashMap(getEntries().length);\n\n\t\t//~: put initial in-day indices\n\t\tfor(Entry e : getEntries())\n\t\t\tinds.put(e, 0);\n\n\t\t//c: for all the objects number of the day\n\t\tfor(int ei = 0;(ei < entries.length);ei++)\n\t\t{\n\t\t\t//~: find present per-day index\n\t\t\tint i = (Integer)inds.get(entries[ei]);\n\n\t\t\t//~: and store it in the context\n\t\t\tctx.set(DAYI, i + 1); //<-- starting from 1, not 0\n\n\t\t\t//~: generate the in-day time\n\t\t\tctx.set(TIME, genDayTime(ctx, day, ei + 1, entries.length));\n\n\t\t\t//!: call the genesis unit\n\t\t\tif(callGenesis(ctx, entries[ei]))\n\t\t\t{\n\t\t\t\t//~: update per-day counter\n\t\t\t\tinds.put(entries[ei], i + 1);\n\n\t\t\t\t//~: update total counter\n\t\t\t\tif(total.containsKey(entries[ei]))\n\t\t\t\t\ttotal.put(entries[ei], 1 + total.get(entries[ei]));\n\t\t\t\telse\n\t\t\t\t\ttotal.put(entries[ei], 1);\n\t\t\t}\n\n\t\t\tctx.set(TIME, null);\n\t\t}\n\n\t\t//~: write to the log\n\t\tlogGen(ctx, day, inds);\n\t}", "public void dayNightCycle(boolean debug) {\r\n float distance;\r\n int timeUnit;\r\n float max;\r\n if (debug) {\r\n timeUnit = seconds - 5;\r\n max = 60 / 2f;\r\n } else {\r\n timeUnit = hours - 2;\r\n max = 24 / 2f;\r\n }\r\n\r\n if (timeUnit <= max) {\r\n distance = timeUnit;\r\n } else {\r\n distance = max - (timeUnit - max);\r\n }\r\n\r\n dayOpacity = distance / max;\r\n }", "@Override\n public void run() {\n createScheduleFile();\n createWinnerScheduleFile();\n }", "@Override\n public void run() {\n isRunning = true;\n try {\n while (true) {\n String execTime = taskConfigService.getParTaskExecTime();\n String now = DateFormatUtils.format(new Date(), DateFormatUtils.FORMAT_DATE);\n Date execDate = DateFormatUtils.parse(execTime, DateFormatUtils.FORMAT_DATE);\n Date nowDate = DateFormatUtils.parse(now, DateFormatUtils.FORMAT_DATE);\n if (execDate.compareTo(nowDate) < 0) {\n List<Par> pars = CalculatePar.calculate(execTime);\n List<ParByDoctor> parByDoctors = CalculatePar.calculateByDoctor(execTime);\n if (pars.size() > 0) {\n parService.addParBatch(pars);\n }\n if (parByDoctors.size() > 0) {\n parService.addParByDoctorBatch(parByDoctors);\n }\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(execDate);\n calendar.add(Calendar.DAY_OF_MONTH, 1);\n taskConfigService.updateParTaskExecTime(DateFormatUtils.format(calendar.getTime(), DateFormatUtils.FORMAT_DATE));\n logger.info(execTime + \":完成处方金额排名统计\");\n } else {\n break;\n }\n }\n } catch (Exception e) {\n logger.error(\"处方金额排名统计出错:\" + e.getMessage());\n e.printStackTrace();\n } finally {\n isRunning = false;\n }\n }", "public static void main(String[] args) {\n\t\tint[] a = {3,5,-1,2,-1,-11,1,-2,4};\n//\t\tint[] a = {1,0,-1};\n//\t\trearrange(a);\n//\t\tfor(int i = 0; i < a.length; i++)\n//\t\t\tSystem.out.print(a[i] + \" \");\n//\t\tSystem.out.println();\n\t\t\n\t\tString d = \"01/01/2015\";\n\t\tString[] date = d.split(\"/\");\n//\t\tSystem.out.println(date);\n//\t\tCalendar c = Calendar.getInstance();\n//\t\tint startYear = Integer.parseInt(date[2]);\n//\t\tint startMonth = Integer.parseInt(date[1]);\n//\t\tint startDate = Integer.parseInt(date[0]);\n//\t\tc.set(startYear, startMonth, startDate);\n//\t\tString[] days = {\"Monday\",\"Thursday\"};\n//\t\tString[] res = recurringTask(d, 2, days, 4);\n//\t\tfor(int i = 0; i < res.length; i++)\n//\t\t\tSystem.out.println(res[i]);\n//\t\t System.out.println(c.get(Calendar.DAY_OF_MONTH));\n//\t\t System.out.println(c.get(Calendar.DAY_OF_WEEK));\n//\t\t System.out.println(c.get(Calendar.DATE));\n\t\t \n\t\tSystem.out.println(Math.floor(2.4)); \n\t\tdouble[] departures = {2.4,1};\n\t\tdouble[] dest = {5,7.3};\n\t\t \n\t \n\t\t\t\t\n\t\t\t\t\n\t\n\t\t\n\t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\n\t}", "private static void checkDay(Calendar calendar, int days, int daysPerWeek) {\r\n\r\n\t\tint day = calendar.get(Calendar.DAY_OF_WEEK) - 1;\r\n\r\n\t\tswitch (daysPerWeek) {\r\n\r\n\t\tcase 1:\r\n\t\t\tif (day == 1)\r\n\t\t\t\tcalendar.add(Calendar.DAY_OF_WEEK, 7);\r\n\t\t\telse\r\n\t\t\t\tcalendar.add(Calendar.DAY_OF_WEEK, (getRestDaysOfWeek(day) + 1));\r\n\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tcalendar.add(Calendar.DAY_OF_MONTH, days);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tcheckDayHelper(calendar, days, daysPerWeek, day);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "@Override\n public void execute(LazyWorkerExchangeInfo lazyWorkerExchangeInfo) {\n int i = 1;\n StringBuilder sb = new StringBuilder();\n List<BagItems> bagItemsList = lazyWorkerExchangeInfo.getWorkDaysList();\n for (BagItems bagItem : bagItemsList) {\n bagItem.getItems().sort((a,b)-> a.compareTo(b));\n\n Integer[] w = bagItem.getItems().toArray(new Integer[bagItem.getItems().size()]);\n int N = bagItem.getItems().size();\n\n int cnt = 0;\n int step = 0;\n int end = N - 1;\n while (step <= end) {\n int top = w[end--];\n int mult = 1;\n while (step <= end && top * mult < 50) {\n step++;\n mult++;\n }\n if (top * mult >= 50) cnt++;\n }\n sb.append(\"Case #\").append(i).append(\":\").append(cnt).append(\"<br/>\");\n }\n lazyWorkerExchangeInfo.setOutputResult(sb.toString());\n }", "private void makeDayButtons() \n\t{\n\t\t\n\t\tSystem.out.println(monthMaxDays);\n\t\tfor (int i = 1; i <= monthMaxDays; i++) \n\t\t{\n\t\t\t//the first day starts from 1\n\t\t\tfinal int dayNumber = i;\n\t\t\t\n\t\t\t//create new button\n\t\t\tJButton day = new JButton(Integer.toString(dayNumber));\n\t\t\tday.setBackground(Color.WHITE);\n\t\n\t\t\t//attach a listener\n\t\t\tday.addActionListener(new \n\t\t\t\t\tActionListener() \n\t\t\t\t\t{\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent arg0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if button is pressed, highlight it \n\t\t\t\t\t\t\tborderSelected(dayNumber -1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//show the event items in the box on the right\n\t\t\t\t\t\t\twriteEvents(dayNumber);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchangeDateLabel(dayNumber);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//make these buttons available for use\n\t\t\t\t\t\t\tnextDay.setEnabled(true);\n\t\t\t\t\t\t\tprevDay.setEnabled(true);\n\t\t\t\t\t\t\tcreateButton.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\n\t\t\t//add this button to the day button ArrayList\n\t\t\tbuttonArray.add(day);\n\t\t}\n\t}", "public void goToToday() {\n goToDate(today());\n }", "public void reviewExtractorPeriodicity() {\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"YYYY-MM-dd hh:mm:ss\");\r\n Iterator<String> it = ExtractorManager.hmExtractor.keySet().iterator();\r\n while (it.hasNext()) { //\r\n String next = it.next();\r\n DataObject dobj = null;\r\n\r\n try {\r\n \tdobj = ExtractorManager.datasource.fetchObjById(next);\r\n } catch (IOException ioex) {\r\n \tlog.severe(\"Error getting extractor definition\");\r\n }\r\n\r\n if (null == dobj) {\r\n \tExtractorManager.hmExtractor.remove(next);\r\n } else {\r\n \tPMExtractor extractor = ExtractorManager.hmExtractor.get(next);\r\n\r\n \tif (null != extractor && extractor.canStart()) {\r\n\t String lastExec = dobj.getString(\"lastExecution\");\r\n\t Date nextExecution = null;\r\n\t boolean extractorStarted = false;\r\n\r\n\t // Revisando si tiene periodicidad\r\n\t if (dobj.getBoolean(\"periodic\")) {\r\n\t \t\ttry {\r\n\t \t\t\tif (null != lastExec && !lastExec.isEmpty()) nextExecution = sdf.parse(lastExec);\r\n\t\t } catch (ParseException psex) {\r\n\t\t \t\tlog.severe(\"Error parsing execution date\");\r\n\t\t }\r\n\t\t \t\r\n\t\t \tif (null == nextExecution) {\r\n\t\t \t\textractor.start();\r\n\t\t \t\textractorStarted = true;\r\n\t\t \t} else {\r\n\t\t \t\ttry {\r\n\t\t\t \t\tlong tiempo = dobj.getLong(\"timer\");\r\n\t\t\t \tString unidad = dobj.getString(\"unit\");\r\n\t\t\t \tlong unitmilis = 0l;\r\n\t\r\n\t\t\t \tswitch(unidad) {\r\n\t\t\t \t\tcase \"min\":\r\n\t\t\t \t\t\tunitmilis = tiempo * 60 * 1000;\r\n\t\t\t \t\t\tbreak;\r\n\t\t\t \t\tcase \"h\":\r\n\t\t\t \t\t\tunitmilis = tiempo * 60 * 60 * 1000;\r\n\t\t\t \t\t\tbreak;\r\n\t\t\t \t\tcase \"d\":\r\n\t\t\t \t\t\tunitmilis = tiempo * 24 * 60 * 60 * 1000;\r\n\t\t\t \t\t\tbreak;\r\n\t\t\t \t\tcase \"m\":\r\n\t\t\t \t\t\tunitmilis = tiempo * 30 * 24 * 60 * 60 * 1000;\r\n\t\t\t \t\t\tbreak;\r\n\t\t\t \t}\r\n\t\r\n\t\t\t \tif (unitmilis > 0) {\r\n\t\t\t \t\tunitmilis = unitmilis + nextExecution.getTime();\r\n\t\t\t \t\tif(new Date().getTime() > unitmilis) {\r\n\t\t\t extractor.start();\r\n\t\t\t extractorStarted = true;\r\n\t\t\t }\r\n\t\t\t \t}\r\n\t\t \t\t} catch (Exception ex) { //NFE\r\n\t\t \t\t\tlog.severe(\"Error getting extractor config data\");\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\r\n\t\t \tif (extractorStarted) {\r\n\t\t \t\tdobj.put(\"lastExecution\", sdf.format(new Date()));\r\n\t\t \t\ttry {\r\n\t\t \t\t\tExtractorManager.datasource.updateObj(dobj);\r\n\t\t \t\t} catch(IOException ioex) {\r\n\t\t \t\t\tlog.severe(\"Error trying to update last execution date\");\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t }\r\n\t }\r\n\t }\r\n }\r\n }", "public void run() {\n if (!this.DATA_STORE.isShutdown()) {\n switch(clockAction) {\n case \"plusHour\":\n do {\n DATA_STORE.setHourValue(DATA_STORE.getHourValue() + 1);\n defaultStatementsInCase();\n } while(DATA_STORE.isButtonPressed());\n break;\n case \"plusMinute\":\n do {\n DATA_STORE.setMinuteValue(DATA_STORE.getMinuteValue() + 1);\n defaultStatementsInCase();\n } while(DATA_STORE.isButtonPressed());\n break;\n case \"plusSecond\":\n do {\n DATA_STORE.setSecondValue(DATA_STORE.getSecondValue() + 1);\n defaultStatementsInCase();\n } while(DATA_STORE.isButtonPressed());\n break;\n case \"minusHour\":\n do {\n DATA_STORE.setHourValue(DATA_STORE.getHourValue() - 1);\n defaultStatementsInCase();\n } while(DATA_STORE.isButtonPressed());\n break;\n case \"minusMinute\":\n do {\n DATA_STORE.setMinuteValue(DATA_STORE.getMinuteValue() - 1);\n defaultStatementsInCase();\n } while(DATA_STORE.isButtonPressed());\n break;\n case \"minusSecond\":\n do {\n DATA_STORE.setSecondValue(DATA_STORE.getSecondValue() - 1);\n defaultStatementsInCase();\n } while(DATA_STORE.isButtonPressed());\n }\n }\n }", "public void print() {\n\tfor (int i = 0; i &lt; mCalendarMarkings.sizeCalendarMarkingList(); i++) {\n\t CalendarMarking marking = mCalendarMarkings.getCalendarMarking(i);\n\t // get first occurrence:\n\t Calendar firstDay = Calendar.getInstance();\n\t firstDay.setTimeInMillis(marking.getStartDate());\n\t RepetitionHandler handler = sHandlerMap.get(marking.getRepeatType());\n\t firstDay = handler.getFirst(firstDay, marking);\n\t printDate(firstDay);\n\t while (firstDay != null) {\n\t\tfirstDay = handler.getNext(firstDay, marking);\n\t\tprintDate(firstDay);\n\t }\n\t}\n }", "@Override\n\tpublic void run() {\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t\tSystem.out.println(\"uzay \" + i);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public static void boarDay (Grid grid) {\n grid.weekday = dateArray[(int) (Math.random() * 7)];\n }", "public void PopulateDays(TextView[] Days){\n for(int i=0;i<Days.length;++i){\n TextView day=Days[i];\n String info[]=day.getText().toString().split(\"\\n\");\n String line=info[0];\n String line2=info[1];\n PopulateHours(line,line2);\n }\n\n }", "public void calculateVacationDays(){\n }", "public void run() {\r\n\t\tDate fechaActual = new Date();\r\n\t\ttry {\r\n\t\t\t// Actual\r\n\t\t\tint horaActual = Integer.parseInt(ManipulacionFechas\r\n\t\t\t\t\t.getHora(fechaActual));\r\n\t\t\tint minutosActual = Integer.parseInt(ManipulacionFechas\r\n\t\t\t\t\t.getMinutos(fechaActual));\r\n\r\n\t\t\tint horaInicialRangoEjecucion = Integer\r\n\t\t\t\t\t.parseInt(Util\r\n\t\t\t\t\t\t\t.loadParametersValue(\"HORA_INICIAL_RANGO_EJECUCION_COBRO_CIAT_CASA_CIAT\"));\r\n\t\t\tint minutosInicialRangoEjecucion = Integer\r\n\t\t\t\t\t.parseInt(Util\r\n\t\t\t\t\t\t\t.loadParametersValue(\"MINUTOS_INICIAL_RANGO_EJECUCION_COBRO_CIAT_CASA_CIAT\"));\r\n\r\n\t\t\tint horaFinalRangoEjecucion = Integer\r\n\t\t\t\t\t.parseInt(Util\r\n\t\t\t\t\t\t\t.loadParametersValue(\"HORA_FINAL_RANGO_EJECUCION_COBRO_CIAT_CASA_CIAT\"));\r\n\t\t\tint minutosFinalRangoEjecucion = Integer\r\n\t\t\t\t\t.parseInt(Util\r\n\t\t\t\t\t\t\t.loadParametersValue(\"MINUTOS_FINAL_RANGO_EJECUCION_COBRO_CIAT_CASA_CIAT\"));\r\n\r\n\t\t\t// Tiempo Actual en Minutos\r\n\t\t\tint tiempoActual = (horaActual * 60) + minutosActual;\r\n\r\n\t\t\t// Tiempos de Rango de Ejecucion en Minutos\r\n\t\t\tint rangoInicial = (horaInicialRangoEjecucion * 60)\r\n\t\t\t\t\t+ minutosInicialRangoEjecucion;\r\n\t\t\tint rangoFinal = (horaFinalRangoEjecucion * 60)\r\n\t\t\t\t\t+ minutosFinalRangoEjecucion;\r\n\r\n\t\t\t// Pregunta si la hora actual esta dentro del rango de ejecucion de\r\n\t\t\t// la tarea\r\n\t\t\tif ((tiempoActual >= rangoInicial) && (tiempoActual <= rangoFinal)) {\r\n\t\t\t\tDate start = new Date();\r\n\t\t\t\tlog\r\n\t\t\t\t\t\t.info(\"--- Corriendo proceso automatico Cobro de Ciat Casa Ciat : \"\r\n\t\t\t\t\t\t\t\t+ start + \"----\");\r\n\t\t\t\tnew BillingAccountServiceImpl().CobroCiatCasaCiat();\r\n\r\n\t\t\t\tDate end = new Date();\r\n\t\t\t\tlog\r\n\t\t\t\t\t\t.info(\"--- Termina proceso Envio de notificaciones automaticas Cobro de Ciat Casa Ciat \"\r\n\t\t\t\t\t\t\t\t+ start + \"----\");\r\n\t\t\t\tlog\r\n\t\t\t\t\t\t.info(end.getTime()\r\n\t\t\t\t\t\t\t\t- start.getTime()\r\n\t\t\t\t\t\t\t\t+ \" total milliseconds en realizar tarea automatica Cobro de Ciat Casa Ciat : \");\r\n\r\n\t\t\t}// Fin if\r\n\t\t\telse {\r\n\t\t\t\tlog\r\n\t\t\t\t\t\t.info(\"--- Tarea Automatica de notificacion Cobro de Ciat Casa Ciat en espera... \"\r\n\t\t\t\t\t\t\t\t+ new Date() + \" ----\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog\r\n\t\t\t\t\t.error(\"Error RUN Tarea Automatica de notificacion Cobro de Ciat Casa Ciat: \"\r\n\t\t\t\t\t\t\t+ e.getMessage());\r\n\t\t}\r\n\r\n\t\tfechaActual = null;\r\n\r\n\t}", "public void run() {\n\t\t\tCalendar c = new GregorianCalendar();\n\t\t\tcurrHour = c.get(Calendar.HOUR);\n\t\t\tcurrMin = String.valueOf(c.get(Calendar.MINUTE));\n\t\t\tif(currMin.length()==1) {\n\t\t\t\tcurrMin = \"0\"+currMin;\n\t\t\t}\n\t\t\tcheckAlarm();\n\t\t}", "private void setCheckedDays(List<Boolean> repeatedDays){\n for(int i = 0; i < DateTime.DAYS_IN_WEEK; i++){\n mWeekCheckBoxes[i].setChecked(repeatedDays.get(i));\n }\n }", "private void fletcher_loop(){\r\n\t\tfor(; i.getPosition() < array1.getLength(); i.increment(null, duration)){\r\n\t\t\tlang.nextStep();\r\n\t\t\t\r\n\t\t\tsc.toggleHighlight(2,3);\r\n\t\t\tshowCalc_1(sum1.get(), array1.getData(i.getPosition()));\r\n\t\t\t\r\n\t\t\tsc_calc.hide();\r\n\t\t\tsum1.add(array1.getData(i.getPosition())); sum1.mod(255); sum1.switchHighlight(); op_counter.add(2);\r\n\t\t\tlang.nextStep();\r\n\t\t\t\r\n\t\t\tsc.toggleHighlight(3,4);\r\n\t\t\tsum1.switchHighlight(); \r\n\t\t\tshowCalc_1(sum2.get(), sum1.get());\r\n\t\t\t\r\n\t\t\tsc_calc.hide();\r\n\t\t\tsum2.add(sum1.get()); sum2.mod(255); sum2.switchHighlight(); op_counter.add(2);\r\n\t\t\tlang.nextStep();\r\n\t\t\t\r\n\t\t\tsum2.switchHighlight();\r\n\t\t\tsc.toggleHighlight(4,2);\r\n\t\t}\r\n\t}", "public void setDays(){\n\n CalendarDay Day=DropDownCalendar.getSelectedDate();\n Date selectedDate=Day.getDate();\n String LongDate=\"\"+selectedDate;\n String DayOfWeek=LongDate.substring(0,3);\n Calendar calendar=Calendar.getInstance();\n calendar.setTime(selectedDate);\n int compare=Integer.parseInt(CurrenDate.substring(6,8).trim());\n int comparemonth=Integer.parseInt(CurrenDate.substring(4,6));\n int startNumber=Integer.parseInt(CheckedDate.substring(6,8).trim())-Offset(DayOfWeek);\n int max=calendar.getActualMaximum(Calendar.DAY_OF_MONTH);\n\n GregorianCalendar date= (GregorianCalendar) GregorianCalendar.getInstance();\n date.set(selectedDate.getYear(),1,1);\n\n boolean Feb=false;\n int priormax=30;\n\n if(max==30){\n priormax=31;\n }\n else if( max==31){\n priormax=30;\n }\n\n if(selectedDate.getMonth()==2){\n if(date.isLeapYear(selectedDate.getYear())){\n priormax=29;\n }\n\n else{\n priormax=28;\n }\n Feb=true;\n }\n for(int i=0;i<WeekDays.length;++i){\n String line=WeekDays[i].getText().toString().substring(0,3);\n\n if(startNumber<=max){\n if(startNumber==compare && comparemonth==Day.getMonth()+1){\n WeekDays[i].setTextColor(Color.BLUE);\n }\n else{\n WeekDays[i].setTextColor(Color.BLACK);\n }\n if(startNumber<=0){\n int val=startNumber+priormax;\n if(Feb){\n if(val==priormax){\n startNumber=max;\n }\n }\n\n WeekDays[i].setText(line+\"\\n\"+val);}\n\n else{\n WeekDays[i].setText(line+\"\\n\"+startNumber);\n }\n\n }\n else{\n startNumber=1;\n WeekDays[i].setText(line+\"\\n\"+startNumber);\n }\n\n MaskWeekdays[i].setText(line+\"\\n\"+startNumber);\n ++startNumber;\n }\n DropDownCalendar.setDateSelected(Calendar.getInstance().getTime(), true);\n }", "public void refreshAllDateDescriptions(){\n for(int position=0;position<reminderItems.size();position++){\n refreshDateDescription(position);\n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint []month_Days={31,28 ,31,30,31,30,31,31,30,31,30,31};\r\n\t\t\r\n\t\t System.out.println(\"enter the year month date\");\r\n\t\t Scanner scan=new Scanner(System.in);\r\n\t\t int year=scan.nextInt();\r\n\t\t int month1=scan.nextInt();\r\n\t\t int date1=scan.nextInt();\r\n\t\t \r\n\t\t int new_year=year%400;\r\n\t\t int odd_days=(new_year/100)*5;\r\n\t\t new_year=(new_year-1)%100;\r\n\t\t int normal_year=new_year-new_year/4;\r\n\t\t odd_days=odd_days+(new_year/4)*2+normal_year;\r\n\t\t odd_days=odd_days%7;\r\n\t\t \r\n\t\t \r\n\t\t int sum_of_days=0;\r\n\t\t for(int i=0;i<(month1-1);i++){\r\n\t\t \tsum_of_days=sum_of_days+month_Days[i];\r\n\t\t }\r\n\t\t if(year%4==0&&year%100!=0||year%400==0&&month1>2){\r\n\t\t \tsum_of_days=sum_of_days+1;\r\n\t\t }\r\n\t\t sum_of_days=sum_of_days+date1;\r\n\t\t odd_days=(odd_days+sum_of_days%7)%7;\r\n\t\t String day=\"\";\r\n\t\t switch(odd_days){\r\n\t\t case 0:\r\n\t\t\t day=\"Sunday\";\r\n\t\t\t break;\r\n\t\t case 1:\r\n\t\t\t day=\"Monday\";\r\n\t\t\t break;\r\n\t\t case 2:\r\n\t\t\t day=\"Tuesday\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t case 3:\r\n\t\t\t day=\"WednesDay\";\r\n\t\t\t break;\r\n\t\t case 4:\r\n\t\t\t day=\"Thursday\";\r\n\t\t\t break;\r\n\t\t case 5:\r\n\t\t\t day=\"Friday\";\r\n\t\t\t break;\r\n\t\t case 6:\r\n\t\t\t day=\"Saturday\";\r\n\t\t\t break;\r\n\t\t \r\n\t\t }\r\n\t\t System.out.println(day);\r\n\t}", "public static void goTo() {\n\t\tMONTHS[] arrayOfMonths = MONTHS.values();\n\t\tLONGDAYS[] arrayOfLongDays = LONGDAYS.values();\n\t\tScanner sc = new Scanner(System.in);\n\t\tString date = \"\";\n\t\tSystem.out.println(\"Enter a date on MM/DD/YYYY format: \");\n\t\tif (sc.hasNextLine()) {\n\t\t\tdate = sc.nextLine().toLowerCase();\n\t\t}\n\t\tint month = Integer.parseInt(date.substring(0, 2));\n\t\tint day = Integer.parseInt(date.substring(3, 5));\n\t\tint year = Integer.parseInt(date.substring(6, 10));\n\t\tGregorianCalendar toDisplay = new GregorianCalendar(year, month, day);\n\t\tString value = getValues(toDisplay);\n\t\tif (value != \"\") {\n\t\t\tSystem.out.println(value);\n\t\t} else {\n\t\t\tSystem.out.println(\"There are no events at this day\");\n\t\t}\n\t}", "@Override\n\tpublic void run() {\n\n\t\tint loop = 0;\n\n\t\tdo {\n\t\t\tthis.onCallTeam.setCountTimer(loop);\n\t\t\tloop++;\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException ex) {\n\t\t\t\tSystem.out.println(\"Interrupted\");\n\t\t\t}\n\t\t} while (loop != 900);// 15 minutes\n\n\t}", "public static void main(String[] args) {\n\t\tfor(int i=0; i<5; i++)\n\t\t{\n\t\t\tnew Thread(new DaytimeClientMulti(args)).start();\n\t\t}\n\n\t}", "private int[] nextDay(int[] cells){\n int[] tmp = new int[cells.length];\n \n for(int i=1;i<cells.length-1;i++){\n tmp[i]=cells[i-1]==cells[i+1]?1:0;\n }\n return tmp;\n }", "public void run()\r\n\t{\r\n\t\ttimer.scheduleAtFixedRate(this.getTimerTask(), 0, repeat * 60 * 1000);\r\n\t}", "public static void main(String[] args) {\n\n System.out.println(DateUtil.getDay());\n System.out.println(DateUtil.getDays());\n }" ]
[ "0.8416838", "0.64887184", "0.64507014", "0.637882", "0.6345973", "0.6304365", "0.6279529", "0.62520236", "0.61495286", "0.6113016", "0.60502464", "0.6020753", "0.59945357", "0.5982248", "0.5967224", "0.5963433", "0.5935323", "0.5899049", "0.58803177", "0.5876353", "0.5864902", "0.5837374", "0.5827388", "0.5816974", "0.58120257", "0.58120257", "0.5808882", "0.5806657", "0.5799598", "0.5790253", "0.5763661", "0.5761323", "0.5757796", "0.57435155", "0.5743282", "0.5740439", "0.57321477", "0.5725992", "0.572472", "0.5710433", "0.5703933", "0.57015824", "0.569646", "0.5687", "0.5676179", "0.567202", "0.5667637", "0.5667412", "0.5663888", "0.5662252", "0.56608975", "0.56583667", "0.5639351", "0.56390965", "0.563116", "0.56253195", "0.56233466", "0.56216764", "0.56146616", "0.56125426", "0.5608298", "0.56081086", "0.5600468", "0.55879074", "0.55831385", "0.5576784", "0.5570602", "0.55687165", "0.5565374", "0.55634254", "0.556319", "0.5538469", "0.5532047", "0.5528694", "0.55282843", "0.5527819", "0.5526859", "0.5517588", "0.5514798", "0.5506578", "0.5503736", "0.5503412", "0.5498993", "0.54820967", "0.54802996", "0.5475215", "0.54738617", "0.5469716", "0.5467773", "0.5443933", "0.54437935", "0.5443652", "0.54414165", "0.5438592", "0.5438041", "0.5431543", "0.5428884", "0.54237366", "0.54234624", "0.54179335" ]
0.54331636
95
Initiates a data transfer process on the consumer.
TransferInitiateResponse initiateConsumerRequest(DataRequest dataRequest);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onStart() {\n this.dataGenerator = new DataGenerator(this.dataSize, this.dataValues, this.dataValuesBalancing);\n this.dataStream = new DataStream();\n if (this.flowRate != 0)\n this.sleepTime = dataStream.convertToInterval(this.flowRate);\n this.count = 0L;\n// this.me = this.me + \"_\" + getRuntimeContext().getIndexOfThisSubtask();\n new Thread(this::receive).start();\n }", "public void receiveDataThInitialization(){\r\n\t\treceiveMsg = new ReceiveDataModel(in, userModel.ID);\r\n\t\tThread receiveDataProcess = new Thread (receiveMsg);\r\n\t\treceiveDataProcess.start();\r\n\t}", "public EventHandleThread(){\n gson = new Gson();\n producer = KafkaProducerCreator.createProducer();\n this.paymentController = new PaymentController();\n }", "public void onStart() {\n\t\tnew Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tinitConnection();\n\t\t\t\treceive();\n\t\t\t}\n\t\t}.start();\n\t}", "public void startReceiving() {\n\t\tHandlerThread handlerThread = new HandlerThread(\n\t\t\t\t\"DataExportationReceiverThread\");\n\t\thandlerThread.start();\n\t\tcallerContext.registerReceiver(this, new IntentFilter(\n\t\t\t\tDataExportationService.BROADCAST_ACTION), null, new Handler(\n\t\t\t\thandlerThread.getLooper()));\n\t}", "public void init() {\n initiateConfig();\n initiateKafkaStuffs();\n log.info(\"Kafka consumer and producer for topic [{}] started.\", topic);\n\n service.submit(() -> {\n while (true) {\n try {\n ConsumerRecords<String, byte[]> records = consumer.poll(3000);\n for (ConsumerRecord<String, byte[]> record : records) {\n log.info(\"Reveive kafka message from topic [{}] with key [{}]\", topic, record.key());\n repository.get(record.key()).offer(record.value());\n accounter.incrementAndGet();\n }\n while (accounter.get() != 0) {\n Thread.sleep(5);\n }\n consumer.commitSync();\n } catch (Exception e) {\n log.warn(\"Something wrong happened during message pulling process\", e);\n consumer.close();\n consumer = null;\n initiateConsumer();\n }\n }\n });\n }", "public void onStart() {\n\t new Thread() {\n\t @Override public void run() {\n\t receive();\n\t }\n\t }.start();\n\t }", "public void startData()\n\t\t\t{\n\t\t\t\tsend(\"<data>\", false);\n\t\t\t}", "TransferInitiateResponse initiateProviderRequest(DataRequest dataRequest);", "private static void performInitialSync() throws IOException,ConfigurationException {\n\n LOGGER.info(\"Starting to perform initial sync\");\n //tapDump is basically that -- a dump of all data currently in CB.\n TapStream tapStream = tapClient.tapDump(tapName);\n SolrBatchImportEventHandler couchbaseToSolrEventHandler = new SolrBatchImportEventHandler();\n startupBatchDisruptor(couchbaseToSolrEventHandler);\n RingBuffer<CouchbaseEvent> ringBuffer = disruptor.getRingBuffer();\n\n CouchbaseEventProducer producer = new CouchbaseEventProducer(ringBuffer);\n //While there is data keep reading and producing\n while (!tapStream.isCompleted()) {\n while (tapClient.hasMoreMessages()) {\n ResponseMessage responseMessage;\n responseMessage = tapClient.getNextMessage();\n if (null != responseMessage) {\n String key = responseMessage.getKey();\n String value = new String(responseMessage.getValue());\n producer.onData(new String[] {key, value}, responseMessage.getOpcode());\n\n }\n }\n }\n LOGGER.info(\"Finished initial sync\");\n shutdownBatchDisruptor();\n //Since this event handler is batch based, we need to let it know we are done and it could flush the remaining data.\n couchbaseToSolrEventHandler.flush();\n\n }", "@Before\n\tpublic void setup() {\n\t\tthis.messaging.receive(\"output\", 100, TimeUnit.MILLISECONDS);\n\t}", "@Test(timeout = 10000)\r\n public void slowConsumer() throws Exception {\r\n ModuleURN instanceURN = new ModuleURN(PROVIDER_URN, \"mymodule\");\r\n Object [] data = {\"item1\", \"item2\", \"item3\", \"item4\"};\r\n DataFlowID flowID = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(CopierModuleFactory.INSTANCE_URN, data),\r\n new DataRequest(instanceURN),\r\n new DataRequest(BlockingModuleFactory.INSTANCE_URN)\r\n });\r\n //wait until copier is done emitting all the data\r\n DataFlowInfo flowInfo;\r\n do {\r\n Thread.sleep(100);\r\n flowInfo = mManager.getDataFlowInfo(flowID);\r\n } while(flowInfo.getFlowSteps()[0].getNumEmitted() < 4);\r\n \r\n for(int i = 0; i < data.length; i++) {\r\n //wait for the data to get delivered\r\n BlockingModuleFactory.getLastInstance().getSemaphore().acquire();\r\n //verify the flow info for the last step\r\n flowInfo = mManager.getDataFlowInfo(flowID);\r\n assertFlowStep(flowInfo.getFlowSteps()[2], BlockingModuleFactory.INSTANCE_URN,\r\n false, 0, 0, null, true, i + 1, 0, null, BlockingModuleFactory.INSTANCE_URN, null);\r\n //verify the jmx flow queue size attribute value\r\n if(i < data.length - 1) {\r\n assertEquals(data.length - 1 - i,\r\n getMBeanServer().getAttribute(instanceURN.toObjectName(),\r\n SimpleAsyncProcessor.ATTRIB_PREFIX + flowID));\r\n }\r\n //consume the data\r\n assertEquals(data[i], BlockingModuleFactory.getLastInstance().getNextData());\r\n }\r\n //verify that the queue size is now zero.\r\n assertEquals(0, getMBeanServer().getAttribute(\r\n instanceURN.toObjectName(),\r\n SimpleAsyncProcessor.ATTRIB_PREFIX + flowID));\r\n //cancel data flow\r\n mManager.cancel(flowID);\r\n }", "public void start() {\n\t\tconnection.start((sender, message) -> message.accept(new Visitor(sender)));\n\t\tloadData();\n\t}", "public void initTransport() {\n JDE.signal(procID, MESSAGE, \"Debugger connected to standard I/O socket.\", QUOTE);\n\n final Process process = m_debugger.getVM().process();\n standardInputProcessor = new StandardInputProcessor(process.getOutputStream());\n standardInputProcessor.start();\n\n standardOutputWriter = new StandardOutputWriter(m_sioSocket);\n standardOutputWriter.println(\"*** Process Standard I/O ***\");\n\n standardOutputProcessor = new StandardOutputProcessor(process.getInputStream());\n standardOutputProcessor.start();\n\n standardErrorProcessor = new StandardErrorProcessor(process.getErrorStream());\n standardErrorProcessor.start();\n\n }", "public void processStart(){\n initWorkerQueue();\n DataBean serverArgs = new DataBean();\n serverArgs.setValue(\"mode\",\"server\");\n serverArgs.setValue(\"messagekey\",\"72999\");\n serverArgs.setValue(\"user\",\"auth\");\n serverArgs.setValue(\"messagechannel\",\"/esb/system\");\n messageClient = new MessageClient(this,serverArgs);\n Helper.writeLog(1,\"starting message server\");\n messageClient.addHandler(this);\n \n }", "private static void startConsumer() throws Exception {\n\t\tProperties jndiProps = new Properties();\n\t\tjndiProps.put(\"java.naming.factory.initial\", \"com.sun.jndi.fscontext.RefFSContextFactory\");\n\t\tjndiProps.put(\"java.naming.provider.url\", \"file:///C:/Temp\");\n\t\t\n\t\tInitialContext ctx = null;\n\t\n\t\tctx = new InitialContext(jndiProps);\n\t\tcom.sun.messaging.ConnectionFactory tcf = (com.sun.messaging.ConnectionFactory) ctx.lookup(\"Factory\");\n\t Topic topic = (com.sun.messaging.Topic) ctx.lookup(\"uav topic\");\n\t TopicConnection conn = (TopicConnection) tcf.createTopicConnection();\n\t Session session = (Session) conn.createSession(false, Session.AUTO_ACKNOWLEDGE);\n\t \n\t MessageConsumer consumer = session.createConsumer(topic);\n\t conn.start();\n\n Message msg = consumer.receive();\n\n if (msg instanceof TextMessageImpl) {\n TextMessage txtMsg = (TextMessage) msg;\n System.out.println(\"\\n===Read Message:===\" + txtMsg.toString());\n }\n \n //Close the session and connection resources.\n session.close();\n conn.close();\n\t \n\t}", "public void run() {\n LOG.info(\"Starting DataNode in: \"+data);\n \n // start dataXceiveServer\n dataXceiveServer.start();\n \n while (shouldRun) {\n try {\n offerService();\n } catch (Exception ex) {\n LOG.error(\"Exception: \" + StringUtils.stringifyException(ex));\n if (shouldRun) {\n try {\n Thread.sleep(5000);\n } catch (InterruptedException ie) {\n }\n }\n }\n }\n \n // wait for dataXceiveServer to terminate\n try {\n this.dataXceiveServer.join();\n } catch (InterruptedException ie) {\n }\n \n LOG.info(\"Finishing DataNode in: \"+data);\n }", "public void enqueueTransfer(\n @Code int code, TransferConfiguration configuration) throws InterruptedException {\n TransferRequest request = TransferRequest.create(code, configuration);\n mRequestSemaphore.acquire();\n try {\n Optional<TransferManagerService> service = checkNotNull(mLiveService.getValue());\n if (service.isPresent()) {\n int startId = mNextStartId.getAndIncrement();\n service.get().request(request, startId);\n return;\n }\n } finally {\n mRequestSemaphore.release();\n }\n mContext.startForegroundService(request.getIntent(mContext));\n }", "@Override\n\t\t\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tinitBroadCastClient();\n\t\t\t\t\t\t\t\t\tReceivePublicKey();\n\t\t\t\t\t\t\t\t\tReceiveEncryptPrice();\n\t\t\t\t\t\t\t\t\tgenerateEProduct();\n\t\t\t\t\t\t\t\t\tsendEProduct();\n\t\t\t\t\t\t\t\t\tGarbleCircuits();\n\t\t\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}", "public OutTransfer send(int dataLength, DataProvider dataProvider) {\n\t\treturn this.transferProcessor.startTransfer(dataLength, dataProvider);\n\t}", "void externalProcessStarted(String command, String consumer);", "@Override\n\tprotected void doStart() {\n\t\tAssert.state(!this.consumerBatchEnabled || getMessageListener() instanceof BatchMessageListener\n\t\t\t\t|| getMessageListener() instanceof ChannelAwareBatchMessageListener,\n\t\t\t\t\"When setting 'consumerBatchEnabled' to true, the listener must support batching\");\n\t\tcheckListenerContainerAware();\n\t\tsuper.doStart();\n\t\tsynchronized (this.consumersMonitor) {\n\t\t\tif (this.consumers != null) {\n\t\t\t\tthrow new IllegalStateException(\"A stopped container should not have consumers\");\n\t\t\t}\n\t\t\tint newConsumers = initializeConsumers();\n\t\t\tif (this.consumers == null) {\n\t\t\t\tlogger.info(\"Consumers were initialized and then cleared \" +\n\t\t\t\t\t\t\"(presumably the container was stopped concurrently)\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (newConsumers <= 0) {\n\t\t\t\tif (logger.isInfoEnabled()) {\n\t\t\t\t\tlogger.info(\"Consumers are already running\");\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tSet<AsyncMessageProcessingConsumer> processors = new HashSet<AsyncMessageProcessingConsumer>();\n\t\t\tfor (BlockingQueueConsumer consumer : this.consumers) {\n\t\t\t\tAsyncMessageProcessingConsumer processor = new AsyncMessageProcessingConsumer(consumer);\n\t\t\t\tprocessors.add(processor);\n\t\t\t\tgetTaskExecutor().execute(processor);\n\t\t\t\tif (getApplicationEventPublisher() != null) {\n\t\t\t\t\tgetApplicationEventPublisher().publishEvent(new AsyncConsumerStartedEvent(this, consumer));\n\t\t\t\t}\n\t\t\t}\n\t\t\twaitForConsumersToStart(processors);\n\t\t}\n\t}", "private DataConnection() {\n \tperformConnection();\n }", "@Override\r\n\tprotected void setup() {\n\t\tgetContentManager().registerLanguage(codec);\r\n\t\tgetContentManager().registerOntology(ontology);\r\n\t\t\r\n\t\tObject[] args = getArguments();\r\n\t\tif(args != null && args.length > 0) {\r\n\t\t\tbroker = (Broker)args[0];\r\n\t\t} else {\r\n\t\t\tbroker = new Broker(\"Broker\");\r\n\t\t}\r\n\t\t\r\n\t\tProgramGUI.getInstance().printToLog(broker.hashCode(), getLocalName(), \"created\", Color.GREEN.darker());\r\n\t\t\r\n\t\t// Register in the DF\r\n\t\tDFRegistry.register(this, BROKER_AGENT);\r\n\t\t\r\n\t\tsubscribeToRetailers();\r\n\t\tquery();\r\n\t\tpurchase();\r\n\t}", "@Override\n public void execute() {\n Task<Void> task = new Task<Void>() {\n @Override\n protected Void call() throws Exception {\n exportData();\n return null;\n }\n\n @Override\n protected void succeeded(){\n callback.onSuccess();\n super.succeeded();\n }\n\n @Override\n protected void failed(){\n callback.onFail(this.getException());\n super.failed();\n }\n };\n new Thread(task).start();\n }", "public void start() {\n try {\n consumer.start();\n } catch (MQClientException e) {\n e.printStackTrace();\n }\n System.out.println(\"Consumer Started.\");\n }", "void consumeWorkUnit();", "@Override\n public void run() {\n transmit_set();\n }", "@Override\n\tpublic void initParameters() {\n\t\ttransferDbData = new TransferDbData();\n\t}", "public void run() {\n\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"准备。。。\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tp.await();//等待\n\t\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"已接受。。。\");\n\t\t\t\t\t\tThread.sleep((long)(Math.random()*10000));\n\t\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"完成。。。\");\n\t\t\t\t\t\ts.countDown();//三次后为0 释放主线程中的等待\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}", "private void execute() {\n\n\t\tPropertiesParser propertiesParser = new PropertiesParser();\n\t\t\n\t\tsetupServer(propertiesParser);\n\t\ttry {\n\t\t\t\n\t\t\tThread.sleep(SERVER_AFTER_RUN_DELAY);\n\t\t\t\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint i=0;\n\t\tfor( ; i < propertiesParser.getReadersNum() ; i++){\n\t\t\t\n\t\t\tsetupClient(propertiesParser , i,true);\n\t\t\t\n\t\t}\n\t\tfor(; i < propertiesParser.getReadersNum()+ propertiesParser.getWritersNum() ; i++){\n\t\t\t\n\t\t\tsetupClient(propertiesParser , i,false);\n\t\t\t\n\t\t}\n\t\t\n\t}", "private TransferDispatcher() {\n taskList=new Vector();\n }", "public synchronized void consume() {\n\t\t// We only want one consumer thread running...\n\t\tif (consumerThread == null) {\n\t\t\tconsumerThread = new ConsumerThread();\n\t\t\t(new Thread(consumerThread)).start();\n\t\t}\n\t}", "FlowControlledDataChannel(@NonNull final DataChannel dc) {\n this(dc, 256 * 1024, 1024 * 1024);\n }", "private void receive() {\n\t\t\ttry{\n\t\t\t\twhile(true){\n\t\t\t\t\tsuper.store(generateSimulateData());\n\t\t\t\t\tSystem.out.println(\"模拟接收数据\");\n\t\t\t\t\tThread.sleep(10000);\n\t\t\t\t}\n\t\t\t}catch(Exception ex){\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t }", "public void readTaskInititate() {\n\t\tiStream = new ByteArrayInputStream(marshalledBytes);\t\n\t\tdin = new DataInputStream(new BufferedInputStream(iStream));\n\t\ttry {\n\t\t\tint rounds = din.readInt();\n\t\t\tfor(int i = 0; i<5; i++) {\n\t\t\t\t//Select random node from list of nodes to send a message to \n\t\t\t\tVertex randomNode = node.getRandomNode();\n\t\t\t\tStack<String> nxt= node.getNextNodesToReach(randomNode.ip,randomNode.port);\n\t\t\t\tString firstStop = nxt.pop();\n\t\t\t\tArrayList<String> nextSteps = new ArrayList<String>();\n\t\t\t\tfor(String x : nxt) {\n\t\t\t\t\tnextSteps.add(x);\n\t\t\t\t}\n\t\t\n\t\t\t\tMessage message = new ForwardMessage(nextSteps);\n\t\t\t\tSocket senderSocket = node.getConnections().getSocketWithName(firstStop);\n\t\t\t\tnew TCPSender(senderSocket, message);\n\t\t\t\tnode.addToSendSum(message.getPayload());\n\t\t\t\tnode.incrementSendTracker();\n\t\t\t}\n\t\t\trounds = rounds -1;\n\t\t\tif (rounds == 0) {\t\t\t\t// Send task Complete message if we have finished all of our rounds \n\t\t\t\tMessage completeMessage = new TaskComplete(node.ipAddr,node.portNum);\n\t\t\t\tSocket socketReturn = node.getConnections().getSocketWithName(node.getRegistryName());\n\t\t\t\tnew TCPSender (socketReturn, completeMessage);\n\t\t\t} else {\n\t\t\t\t//Else put a new event with a taskInitiate method into the queue\n\t\t\t\tMessage rerun = new TaskInitiate(rounds);\n\t\t\t\tbyte[] newData = rerun.getByteArray();\n\t\t\t\tEventFactory eventFactory = EventFactory.getInstance();\n\t\t\t\teventFactory.insert(messageType, newData, node, originSocket);\n\t\t\t}\n\t\t} catch (IOException e) { System.out.println(\"Failed to read message. \"); }\n\t}", "public void run() {\n\t\t\t\tMessage msg = new Message();\n\t\t\t\tmsg.what = Msg_SetProgress;\n\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t}", "SendToDataLayerThread(String p, String msg) {\n path = p;\n message = msg;\n }", "private void sendData() {\n\n Thread update = new Thread() {\n public void run() {\n while (opModeIsActive() && (tfod != null)) {\n path.updateTFODData(recognize());\n path.updateHeading();\n try {\n Thread.sleep(500);\n } catch (Exception e) {\n }\n if (isStopRequested() && tfod != null)\n tfod.shutdown();\n }\n }\n };\n update.start();\n }", "@Override\n public void doDataReceived(ResourceDataMessage dataMessage) {\n if(outputStream == null) return;\n if(startTime == 0) startTime = System.nanoTime();\n if (this.getTunnel() == null)\n this.setTunnel(dataMessage.getNetworkMessage().getTunnel());\n\n EventManager.callEvent(new ResourceTransferDataReceivedEvent(this, dataMessage));\n\n try {\n if (dataMessage.getResourceData().length != 0) {\n //Saving received chunks\n byte[] chunk = dataMessage.getResourceData();\n written += chunk.length;\n double speedInMBps = NANOS_PER_SECOND / BYTES_PER_MIB * written / (System.nanoTime() - startTime + 1);\n System.out.println();\n logger.info(\"Receiving file: {} | {}% ({}MB/s)\", this.getResource().attributes.get(1), ((float) written / (float) fileLength) * 100f, speedInMBps);\n\n //add to 4mb buffer\n System.arraycopy(chunk, 0, buffer, saved, chunk.length);\n saved += chunk.length;\n if (buffer.length - saved < BUFFER_SIZE || written >= fileLength) {\n //save and clear buffer\n outputStream.write(buffer, 0, saved);\n saved = 0;\n }\n\n\n if (written >= fileLength) {\n this.close();\n }\n } else {\n //Empty chunk, ending the transfer and closing the file.\n logger.info(\"Empty chunk received for: {}, ending the transfer...\", this.getResource().attributes.get(1));\n\n //File fully received.\n this.close();\n }\n } catch (Exception e) {\n callError(e);\n }\n }", "private void run() throws InterruptedException, IOException {\n endpoint.getWcEvents().take();\n\n //process received data\n processRecv();\n\n for (int i=0; i < 1000000; i++) {\n //change data in remote memory\n writeData(i);\n\n //wait for writing remote memory to complete\n endpoint.getWcEvents().take();\n }\n System.out.println(\"ClientWrite::finished!\");\n }", "protected void mainTask() {\n\t logger.log(1, CLASS, \"-\", \"impl\",\n\t\t \"About to read command\");\n\t try { \n\t\tcommand = (COMMAND)connection.receive();\n\t\tlogger.log(1,CLASS, \"-\", \"impl\",\n\t\t\t \"Received command: \"+(command == null ? \"no-command\" : command.getClass().getName()));\n\t } catch (IOException e) {\n\t\tinitError(\"I/O error while reading command:[\"+e+\"]\",command);\n\t\treturn;\n\t } catch (ClassCastException ce) {\n\t\tinitError(\"Garbled command:[\"+ce+\"]\", command);\n\t\treturn;\n\t } \n\t \n\t // 2. Create a handler.\n\t if (command == null) {\n\t\tinitError(\"No command set\", null);\n\t\treturn;\n\t }\n\n\t if (handlerFactory != null) {\n\t\thandler = handlerFactory.createHandler(connection, command);\n\t\tif (handler == null) {\n\t\t initError(\"Unable to process command [\"+command.getClass().getName()+\"]: No known handler\", command);\n\t\t return;\n\t\t}\n\t \n\t\t// 3. Handle the request - handler may send multiple updates to client over long period\n\t\thandler.handleRequest();\n\t }\t \n\t}", "private synchronized void initializeData() {\n\n System.out.println(\"En inicializar datos\");\n // Only perform initialization once per app lifetime. If initialization has already been\n // performed, we have nothing to do in this method.\n if (mInitialized) return;\n mInitialized = true;\n\n mExecutors.diskIO().execute(() -> {\n if (isFetchNeeded()) {\n System.out.println(\"Se necesita actualizar, fetch is needed\");\n startFetchPublicacionService();\n }\n });\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tpartnerConn.receive();\n\t\t\t\tString message = partnerConn.getConnBuffer();\n\t\t\t\tif (isCompleteMessage(message)) {\n\t\t\t\t\tsynchronized (completedProcs) {\n\t\t\t\t\t\tcompletedProcs.add(partnerPid);\n\t\t\t\t\t\tcompletedProcs.notifyAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsynchronized (completedProcs) {\n\t\t\t\t\twhile (completedProcs.size() != nProc)\n\t\t\t\t\t\tcompletedProcs.wait();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpartnerConn.send(\"SEND_STATS\");\n\t\t\t\tpartnerConn.receiveObject();\n\t\t\t\tProcStats partnerStats = (ProcStats)partnerConn.getConnObjBuffer();\n\t\t\t\tsynchronized (procStats) {\n\t\t\t\t\tprocStats.put(partnerPid, partnerStats);\n\t\t\t\t\tprocStats.notifyAll();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public void start(){\n\t\tdo{\n\t\t\tMessage<T> msg= input.read();\n\t\t\tif (!msg.getQuit() && !msg.getFail() ){\n\t\t\t\tconsume(msg.getContent());\n\t\t\t}\n\t\t\tif (msg.getQuit()){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}while(true);\n\t\t\n\t}", "CompletableFuture<DataDestination> provision(String topicName);", "public void postData()\n\t{\n\t\tnew NetworkingTask().execute(message);\n\t}", "private IOHandler(){\n download_queue = new ArrayList<>(); \n initialize();\n }", "protected void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline().addLast(\"FileServerHandler\", new FileServerHandler(transferFile));\n }", "public void init() {\n\t\ttry {\n\t\t\tthis.is = new ObjectInputStream(clientSocket.getInputStream());\n\t\t\tthis.os = new ObjectOutputStream(clientSocket.getOutputStream());\n\t\t\twhile (this.readCommand()) {}\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public FileTransfer(int myPort){ //Receiver\n socket = new MySocket(ProtocolStack.getLocalhost().getLogicalID(),myPort);\n socket.bindServer();\n socket.accept();\n step = STEP_WAITING_TO_RECEIVE;\n }", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t\ttry {\n\t\t\tSystem.out.println(\"run\");\n\t\t\tsleep(2000);\n\t\t\tcontrol_device.publish(\"nct_control_\"+this.did, (this.msg).getBytes(), 0, true);\n\t\t\tSystem.out.println(\"done\");\n\t\t} catch (MqttPersistenceException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (MqttException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void run() {\n readFromClient();\n }", "public void processStreamInput() {\n }", "@Override\r\n public void initialize() {\n Properties props = new Properties();\r\n props.put(\"bootstrap.servers\", bootstrapServers);\r\n props.put(\"group.id\", groupId);\r\n props.put(\"enable.auto.commit\", \"false\");\r\n props.put(\"key.deserializer\", keyDeserializer);\r\n props.put(\"value.deserializer\", valueDeserializer);\r\n consumer = new KafkaConsumer<>(props);\r\n consumer.subscribe(topics);\r\n while (isCrawling) {\r\n ConsumerRecords<String, String> records = consumer.poll(pollInterval);\r\n for (ConsumerRecord<String, String> record : records) {\r\n Document d = new Document(record.key());\r\n d.setField(\"data\", record.value());\r\n d.setField(\"topic\", record.topic());\r\n d.setField(\"offset\",record.offset());\r\n d.setField(\"partition\",record.partition());\r\n d.setField(\"timestamp\",record.timestamp());\r\n feed(d);\r\n }\r\n }\r\n }", "@Override\n\tpublic void execute() {\n\t\tcmdReceiver.send();\n\t}", "@Override public final void dinvoke(H2ONode sender) {\n setupLocal0(); // Local setup\n compute2(); // Do The Main Work\n // nothing here... must do any post-work-cleanup in onCompletion\n }", "public void init() {\r\n\t\ttry {\r\n\t\t\tmessages = new ConcurrentLinkedDeque<>();\r\n\t\t\tout = sock.getOutputStream();\r\n\t\t\tin = sock.getInputStream();\t\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tstartMessageThread();\r\n\t}", "@Override\n\t\t\tpublic void start() {\n\t\t\t\tinitResource();\n\t\t\t\t//获取通讯录信息\n\t\t\t\tinitContactsData();\n\t\t\t\t//同步通讯录\n\t\t\t\tupLoadPhones();\n\t\t\t}", "@Override\n public void prepare() {\n //Caching as file resource.\n File file = this.getResource().file;\n logger.info(\"Preparing {} streams for file: {}\", this.getTransferType(), file.getName());\n\n if (this.getTransferType() == ResourceTransferType.OUTBOUND) {\n //Sending\n try {\n buffer = new byte[BUFFER_SIZE];\n sent = 0;\n inputChannel = new FileInputStream(file).getChannel();\n inputBuffer = inputChannel.map(FileChannel.MapMode.READ_ONLY, 0, inputChannel.size());\n } catch (FileNotFoundException e) { //File doesn't exist.\n //Calling a transfer error.\n callError(e);\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n //Receiving\n //Checking if file already exists.\n written = 0;\n saved = 0;\n if (getResource().isLocal()) {\n getResource().calcNetworkId();\n if (getResource().getNetworkID().equals(getTunnel().getDestination())) {\n //The file is already stored locally.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), -2));\n this.close();\n return;\n }\n }\n\n //Creating or replacing the file.\n buffer = new byte[BUFFER_SIZE * 16];\n if (file.exists()) {\n file.delete();\n }\n try { //Creating new file.\n file.createNewFile();\n outputStream = new FileOutputStream(file);\n } catch (IOException e) {\n //Calling a transfer error.\n callError(e);\n return;\n }\n\n //Requesting the first chunk.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), 0));\n }\n }", "@Override public final void dinvoke(H2ONode sender) {\n setupLocal(); // Local setup\n compute2(); // Do The Main Work\n // nothing here... must do any post-work-cleanup in onCompletion\n }", "@Override\n\tpublic void run() {\n\t\tString request;\n\t\ttry {\n\t\t\tSocketBuilder socketBuilder = new SocketBuilder(this.IP);\n\n\t\t\tSocket clientSocketStrings = socketBuilder.createStringSocket();\n\t\t\tSocket clientSocketBytes = socketBuilder.createByteSocket();\n\n\t\t\tDataOutputStream outToServer = new DataOutputStream(clientSocketStrings.getOutputStream());\n\n\t\t\tDataInputStream bytesStream = new DataInputStream(clientSocketBytes.getInputStream());\n\n\t\t\tBufferedReader inFromServer = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(clientSocketStrings.getInputStream(), StandardCharsets.UTF_8));\n\t\t\t\n\t\t\tMessage requestMessage = new Message();\n\t\t\trequestMessage.createDownloadMessage(path);\n\n\t\t\trequest = JsonParser.messageToJson(requestMessage);\n\n\t\t\toutToServer.write(request.getBytes(\"UTF-8\"));\n\t\t\toutToServer.writeByte('\\n');\n\n\t\t\tMessage responseMessage = JsonParser.jsonToMessage(inFromServer.readLine());\n\n\t\t\t// check if operation is possible\n\t\t\tif (responseMessage.isERRORMessage()) {\n\t\t\t\t/*\n\t\t\t\t * Handle Error Here\n\t\t\t\t */\n\t\t\t} else {\n\n\t\t\t\tFileTransfer fileTransfer = new FileTransfer();\n\n\t\t\t\tlong size = Long.parseLong(inFromServer.readLine());\n\n\t\t\t\tEstimationViewManagementThread manage = new EstimationViewManagementThread(size, \n\t\t\t\t\t\tfileTransfer, clientSocketStrings, clientSocketBytes);\n\t\t\t\tmanage.start();\n\t\t\t\tfileTransfer.receiveFiles(bytesStream, inFromServer, locationToSave);\n\t\t\t}\n\t\t\t\n\t\t\toutToServer.close();\n\t\t\tbytesStream.close();\n\t\t\tinFromServer.close();\n\t\t\tclientSocketBytes.close();\n\t\t\tclientSocketStrings.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void stream(T data) {\n channel.write(new DataMessage<>(data));\n }", "public void publishDataFromAdapter(RoutingContext routingContext) {\n LOGGER.debug(\"Info: publishDataFromAdapter method started;\");\n JsonObject requestJson = routingContext.getBodyAsJson();\n HttpServerRequest request = routingContext.request();\n HttpServerResponse response = routingContext.response();\n String instanceID = request.getHeader(HEADER_HOST);\n JsonObject authenticationInfo = new JsonObject();\n authenticationInfo.put(API_ENDPOINT, \"/iudx/v1/adapter\");\n requestJson.put(JSON_INSTANCEID, instanceID);\n if (request.headers().contains(HEADER_TOKEN)) {\n authenticationInfo.put(HEADER_TOKEN, request.getHeader(HEADER_TOKEN));\n authenticator.tokenInterospect(requestJson.copy(), authenticationInfo, authHandler -> {\n if (authHandler.succeeded()) {\n Future<JsonObject> brokerResult =\n managementApi.publishDataFromAdapter(requestJson, databroker);\n brokerResult.onComplete(brokerResultHandler -> {\n if (brokerResultHandler.succeeded()) {\n LOGGER.debug(\"Success: publishing data from adapter\");\n handleSuccessResponse(response, ResponseType.Ok.getCode(),\n brokerResultHandler.result().toString());\n } else {\n LOGGER.debug(\"Fail: Bad request;\" + brokerResultHandler.cause().getMessage());\n processBackendResponse(response, brokerResultHandler.cause().getMessage());\n }\n });\n } else {\n LOGGER.debug(\"Fail: Unauthorized;\" + authHandler.cause().getMessage());\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n });\n } else {\n LOGGER.debug(\"Fail: Unauthorized\");\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n }", "private void startSenderThread(DataOutputStream dataOutputStream) {\r\n\t\tsenderThread = new SenderThread(dataOutputStream, messageRate, clientStatistics);\r\n\t\tnew Thread(senderThread).start();\r\n\t}", "public void run() {\n try {\n peerBootstrap = createPeerBootStrap();\n\n peerBootstrap.setOption(\"reuseAddr\", true);\n peerBootstrap.setOption(\"child.keepAlive\", true);\n peerBootstrap.setOption(\"child.tcpNoDelay\", true);\n peerBootstrap.setOption(\"child.sendBufferSize\", Controller.SEND_BUFFER_SIZE);\n\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public static void initCommunicationClientThread(){\r\n new CommunicationClientThread();\r\n }", "public void initReceiver() {\n }", "public void run() {\n \t\ttry {\n \t\t\tout.setHeader(init(in.getHeader()));\n \t\t\tsetSampleProcessed(0); // set the number of samples being processed\n \t\t\t\t\t\t\t\t\t// as zero\n \t\t\twhile (true) {\n \t\t\t\tStreamFrame sf = process(in.recvFrame());\n \t\t\t\tif (sf != null)\n \t\t\t\t\tout.sendFrame(sf);\n \t\t\t}\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "@Override\r\n\tpublic void start() throws Exception {\r\n\t\tserialPort.notifyOnDataAvailable(true);\r\n\t\tserialPort.disableReceiveTimeout();\r\n\t\tserialPort.enableReceiveThreshold(1);\r\n\r\n\t\tserialPort.addEventListener(new SerialPortEventListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void serialEvent(SerialPortEvent event) {\r\n\t\t\t\tswitch (event.getEventType()) {\r\n\t\t\t\tcase SerialPortEvent.DATA_AVAILABLE:\r\n\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\tString trame = ComConnexion.this.reader.readLine();\r\n\t\t\t\t\t\tfloat value = TrameDecoder.valeur(trame);\r\n\t\t\t\t\t\tMeteoEventType_E type = TrameDecoder.dataType(trame);\r\n\r\n\t\t\t\t\t\tswitch (type) {\r\n\t\t\t\t\t\tcase ALTITUDE:\r\n\t\t\t\t\t\t\tmeteoServiceCallback.altitudePerformed(value);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase PRESSION:\r\n\t\t\t\t\t\t\tmeteoServiceCallback.pressionPerformed(value);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase TEMPERATURE:\r\n\t\t\t\t\t\t\tmeteoServiceCallback.temperaturePerformed(value);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@Override\r\n public void onReceivedData(byte[] arg0) {\r\n dataManager.onReceivedData(arg0);\r\n }", "@Override\r\n\tprotected void setup() {\n\t\tgetContentManager().registerLanguage(codec);\r\n\t\tgetContentManager().registerOntology(ontology);\r\n\t\t\r\n\t\t// Register in the DF\r\n\t\tDFRegistry.register(this, BROKER_AGENT);\r\n\t\t\r\n\t\t// Find retailers\r\n\t\tsubscribeToRetailers();\r\n\t\t\r\n\t\t// Run agent\r\n\t\tquery();\r\n\t\tpurchase();\r\n\t}", "@Override\n public void setup ()\n {\n DomainObjectReader dor;\n\n dor = (DomainObjectReader) SpringApplicationContext.getBean(\"reader\");\n brokerRepo = (BrokerRepo) SpringApplicationContext.getBean(\"brokerRepo\");\n ttx = new ArrayList<>();\n\n dor.registerNewObjectListener(new TimeslotUpdateHandler(),\n TimeslotUpdate.class);\n dor.registerNewObjectListener(new TariffTxHandler(),\n TariffTransaction.class);\n dor.registerNewObjectListener(new CustomerInfoHandler(), CustomerInfo.class);\n\n try {\n data = new PrintWriter(new File(dataFilename));\n }\n catch (FileNotFoundException e) {\n log.error(\"Cannot open file \" + dataFilename);\n }\n\n powerTypes = preparePowerTypes();\n customerByType = new HashMap<>();\n for (PowerType type : powerTypes)\n customerByType.put(type, 0);\n }", "private void initData() {\n\n MyLog.log(\"调用录音上传接口\");\n MosHelper.startCheck(new MosHelper.mosSourceListener() {\n\n @Override\n public void getMosSource(String testTest, ArrayList<String> source) {\n // TODO Auto-generated method stub\n\n }\n\n @Override\n public void getMosIMEIAndId(String IMEI,\n String sourceId) {\n // TODO Auto-generated method stub\n MyLog.log(\"IMEI::\" + IMEI);\n Message message = handler.obtainMessage();\n message.obj = \"IMEI::\" + IMEI + \"\\n\" + \"sourceID:\\n\" + sourceId;\n message.what = 8;\n handler.sendMessage(message);\n\n }\n });\n }", "public void run() {\r\n Thread.currentThread().setContextClassLoader(m_loader);\r\n try {\r\n m_socket.setTcpNoDelay(true);\r\n m_socket.setSoTimeout(m_timeout);\r\n m_in = new ObjectInputStream(m_socket.getInputStream());\r\n m_out = new ObjectOutputStream(m_socket.getOutputStream());\r\n } catch (IOException e) {\r\n throw new WrappedRuntimeException(e);\r\n }\r\n while (m_running) {\r\n try {\r\n switch (m_in.read()) {\r\n case Command.CREATE:\r\n handleCreateCommand();\r\n break;\r\n case Command.INVOKE:\r\n handleInvocationCommand();\r\n break;\r\n case Command.CLOSE:\r\n m_running = false;\r\n break;\r\n default:\r\n break;\r\n }\r\n } catch (Exception e) {\r\n close();\r\n throw new WrappedRuntimeException(e);\r\n }\r\n }\r\n close();\r\n }", "@Override\n public void run() {\n load_remote_data();\n }", "public void run() {\n try {\n // accepts the connection request.\n SelectableChannel peerHandle = this._handle.accept();\n if (peerHandle != null) {\n // now, create a service handler object to serve the\n // the client.\n ServiceHandler handler =\n this._factory.createServiceHandler(\n this._reactor,\n peerHandle);\n if (handler != null)\n // give the service handler object a chance to initialize itself.\n handler.open();\n }\n } catch (IOException ex) {\n MDMS.ERROR(ex.getMessage());\n }\n }", "@Test\n public void testPassingFootstepData() throws IOException\n {\n Random random = new Random(5642769L);\n\n // setup comms\n NetworkPorts port = NetworkPorts.createRandomTestPort(random);\n // QueueBasedStreamingDataProducer<FootstepData> queueBasedStreamingDataProducer = new QueueBasedStreamingDataProducer<FootstepData>(\"FootstepData\");\n PacketCommunicator tcpServer = createAndStartStreamingDataTCPServer(port);\n FootstepDataConsumer footstepDataConsumer = new FootstepDataConsumer();\n PacketCommunicator tcpClient = createStreamingDataConsumer(FootstepDataMessage.class, footstepDataConsumer, port);\n ThreadTools.sleep(SLEEP_TIME);\n // queueBasedStreamingDataProducer.startProducingData();\n\n // create test footsteps\n ArrayList<Footstep> sentFootsteps = createRandomFootsteps(50);\n for (Footstep footstep : sentFootsteps)\n {\n FootstepDataMessage footstepData = HumanoidMessageTools.createFootstepDataMessage(footstep);\n tcpServer.send(footstepData);\n // queueBasedStreamingDataProducer.queueDataToSend(footstepData);\n }\n\n ThreadTools.sleep(SLEEP_TIME);\n\n tcpClient.disconnect();\n tcpServer.disconnect();\n\n // verify received correctly\n ArrayList<Footstep> receivedFootsteps = footstepDataConsumer.getReconstructedFootsteps();\n\n compareFootstepsSentWithReceived(sentFootsteps, receivedFootsteps);\n }", "@Inject\n public ParentTaskTransferService(TransfersService transfersService1,\n FileTransfersDAO dao1,\n FileOpsService fileOpsService1,\n FilePermsService permsService1,\n RemoteDataClientFactory remoteDataClientFactory1,\n SystemsCache systemsCache1)\n {\n transfersService = transfersService1;\n dao = dao1;\n fileOpsService = fileOpsService1;\n systemsCache = systemsCache1;\n remoteDataClientFactory = remoteDataClientFactory1;\n permsService = permsService1;\n }", "private void transfer(Transfer associatedUpload) throws IOException {\n \t\ttry {\n \t\t\t_started = System.currentTimeMillis();\n \t\t\tif (_mode == 'A') {\n \t\t\t\t_out = new AddAsciiOutputStream(_out);\n \t\t\t}\n \n \t\t\tbyte[] buff = new byte[Math.max(_slave.getBufferSize(), 65535)];\n \t\t\tint count;\n \t\t\tlong currentTime = System.currentTimeMillis();\n \n \t\t\ttry {\n \t\t\t\twhile (true) {\n \t\t\t\t\tif (_abortReason != null) {\n \t\t\t\t\t\tthrow new TransferFailedException(\n \t\t\t\t\t\t\t\t\"Transfer was aborted - \" + _abortReason,\n \t\t\t\t\t\t\t\tgetTransferStatus());\n \t\t\t\t\t}\n \t\t\t\t\tcount = _in.read(buff);\n \t\t\t\t\tif (count == -1) {\n \t\t\t\t\t\tif (associatedUpload == null) {\n \t\t\t\t\t\t\tbreak; // done transferring\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (associatedUpload.getTransferStatus().isFinished()) {\n \t\t\t\t\t\t\tbreak; // done transferring\n \t\t\t\t\t\t}\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t}\n \t\t\t\t\t\tcontinue; // waiting for upload to catch up\n \t\t\t\t\t}\n \t\t\t\t\t// count != -1\n \t\t\t\t\tif ((System.currentTimeMillis() - currentTime) >= 1000) {\n \t\t\t\t\t\tTransferStatus ts = getTransferStatus();\n \t\t\t\t\t\tif (ts.isFinished()) {\n \t\t\t\t\t\t\tthrow new TransferFailedException(\n \t\t\t\t\t\t\t\t\t\"Transfer was aborted - \" + _abortReason,\n \t\t\t\t\t\t\t\t\tts);\n \t\t\t\t\t\t}\n \t\t\t\t\t\t_slave\n \t\t\t\t\t\t\t\t.sendResponse(new AsyncResponseTransferStatus(\n \t\t\t\t\t\t\t\t\t\tts));\n \t\t\t\t\t\tcurrentTime = System.currentTimeMillis();\n \t\t\t\t\t}\n \t\t\t\t\t_transfered += count;\n \t\t\t\t\t_out.write(buff, 0, count);\n \t\t\t\t}\n \n \t\t\t\t_out.flush();\n \t\t\t} catch (IOException e) {\n \t\t\t\tthrow new TransferFailedException(e, getTransferStatus());\n \t\t\t}\n \t\t} finally {\n \t\t\t_finished = System.currentTimeMillis();\n \t\t\t_slave.removeTransfer(this); // transfers are added in setting up\n \t\t\t\t\t\t\t\t\t\t\t// the transfer,\n \t\t\t\t\t\t\t\t\t\t\t// issueListenToSlave()/issueConnectToSlave()\n \t\t}\n \t}", "public void startCollectSysTrafficTask() {\n\t\tsubmitCollectSysTrafficTask();\n\t}", "Producer(final Consumer<String, Integer> obj, final T1 msg, final int time) {\n cons = obj;\n message = msg;\n this.time = time;\n }", "public void teleopInit() {\n\t\tauto.cancel();\r\n\t\t// Create the teleop command and start it.\r\n\t\tteleop.start();\r\n\t\t// Reset the drivetrain encoders\r\n\t\tDriveTrain.getInstance().resetEncoders();\r\n\t\t// Start pushing sensor readings to the SD.\r\n\t\treadings.start();\r\n\t}", "public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }", "@Override\n public void run()\n {\n try\n {\n InputStream fis = new FileInputStream(transferFile);\n OutputStream sos = socket.getOutputStream();\n\n logWriter.println(\"Sending the file...\");\n\n byte [] buffer = new byte[1024];\n int readBytes;\n while((readBytes = fis.read(buffer)) > -1) {\n sos.write(buffer, 0, readBytes);\n sos.flush();\n }\n\n fis.close();\n sos.close();\n socket.close();\n\n logWriter.println(\"File: \" + transferFile.getName());\n logWriter.println(transferFile.length() + \" bytes sent.\");\n logWriter.println(\"Data Connection Closed.\");\n\n } catch (IOException e)\n {\n e.printStackTrace(logWriter);\n }\n }", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tproduce();\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected void setup() {\n\t\tSystem.out.println(\"Broker Agent \"+getAID().getName()+\" is ready.\");\r\n\t\tthis.getContentManager().registerLanguage(new SLCodec());\r\n\t\tthis.getContentManager().registerOntology(RequestOntology.getInstance());\r\n\t\t\r\n\t\tObject[] args = getArguments();\r\n\t\tif (args != null && args.length > 0) {\r\n\t\t\tprice = (String) args[0];\r\n\t\t\tvolume= (String) args[1];\r\n\t\t\t\r\n\t\t\tDFAgentDescription dfd = new DFAgentDescription();\r\n\t\t\tdfd.setName(getAID());\r\n\t\t\tServiceDescription sd = new ServiceDescription();\r\n\t\t\tsd.setType(\"energy-selling\");\r\n\t\t\tsd.setName(\"Energy-Broker\");\r\n\t\t\tdfd.addServices(sd);\r\n\t\t\ttry {\r\n\t\t\t\tDFService.register(this, dfd);\r\n\t\t\t}\r\n\t\t\tcatch (FIPAException fe) {\r\n\t\t\t\tfe.printStackTrace();\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.println(getAID().getName()+\" No available arguments\");\r\n\t\t\tdoDelete();\r\n\t\t}\r\n\t\taddBehaviour(new BOReply(this));\r\n\t}", "@Override\n\tpublic void prepare(Map arg0, TopologyContext arg1, OutputCollector arg2) {\n\t\tthis.outputCollector = arg2;\n\n\n\t\tvertx = Vertx.vertx();\n\t\tbroker_config = new RabbitMQOptions();\n\t\tbroker_config.setHost(\"localhost\");\n// broker_config.setPort(broker_port);\n// broker_config.setVirtualHost(broker_vhost);\n// broker_config.setUser(username);\n// broker_config.setPassword(password);\n\t\tbroker_config.setConnectionTimeout(6000);\n\t\tbroker_config.setRequestedHeartbeat(60);\n\t\tbroker_config.setHandshakeTimeout(6000);\n\t\tbroker_config.setRequestedChannelMax(5);\n\t\tbroker_config.setNetworkRecoveryInterval(500);\n\n\t\tclient = RabbitMQClient.create(vertx, broker_config);\n\t\tclient.start(start_handler -> {\n\t\t\tif (start_handler.succeeded()) {\n\n\t\t\t\tLog.info(\"vertx RabbitMQ client started successfully!\");\n\t\t\t}\n\t\t});\n\n//\t\tthis.invalidMessageCounter=new HashMap<>();\n\t}", "void subscribe (DataminingProcessingListener _dataminingProcessingListener) {\r\n if (dataminingProcessingListener == null) {\r\n dataminingProcessingListener = _dataminingProcessingListener;\r\n }\r\n }", "public void processConnection(DataInputStream dis, DataOutputStream dos);", "public void startMessage(DecodedMessage msg) \n\t\tthrows DataConsumerException\n\t{\n\t\tPlatform platform;\n\n\t\ttry\n\t\t{\n\t\t\tRawMessage rawmsg = msg.getRawMessage();\n\t\t\tTransportMedium tm = rawmsg.getTransportMedium();\n\t\t\tplatform = rawmsg.getPlatform();\n\t\t\tmediumId = tm.getMediumId();\n\t\t}\n\t\tcatch (UnknownPlatformException ex)\n\t\t{\n\t\t\tLogger.instance().warning(\n\t\t\t\t\"Skipping HDB ingest for data from \" + \"unknown platform: \"\n\t\t\t\t\t+ ex);\n\t\t\treturn;\n\t\t}\n\t\tSite platformSite = platform.getSite();\n\t\tif (platformSite == null)\n\t\t{\n\t\t\twarning(\n\t\t\t\t\"Skipping HDB ingest for data from \"\n\t\t\t\t+ \"unknown site, DCP Address=\" + mediumId);\n\t\t\treturn;\n\t\t}\n\n\t\tTimeSeriesDAI timeSeriesDAO = hdbTsDb.makeTimeSeriesDAO();\n\t\ttry\n\t\t{\n\t\t\tfor (Iterator<TimeSeries> it = msg.getAllTimeSeries(); it.hasNext();)\n\t\t\t{\n\t\t\t\tTimeSeries ts = it.next();\n\t\n\t\t\t\t// Only process time series that have data.\n\t\t\t\tif (ts.size() == 0)\n\t\t\t\t\tcontinue;\n\t\n\t\t\t\tSensor sensor = ts.getSensor();\n\t\t\t\t\n\t\t\t\tHdbTsId hdbTsId = null;\n\t\t\t\t\n\t\t\t\ttry { hdbTsId = resolveTsId(sensor, platform); }\n\t\t\t\tcatch (NoSuchObjectException ex)\n\t\t\t\t{\n\t\t\t\t\twarning(\"Skipping sensor \" + sensor.getNumber() + \" '\"\n\t\t\t\t\t\t+ sensor.getName() + \"': \" + ex);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tCTimeSeries cts = TSUtil.convert2CTimeSeries(\n\t\t\t\t\tts, // the DECODES Time Series\n\t\t\t\t\thdbTsId.getSdi(), // unique Time Series key\n\t\t\t\t\thdbTsId.getPart(HdbTsId.TABSEL_PART), // \"R_\" or \"M_\"\n\t\t\t\t\thdbTsId.getInterval(), \n\t\t\t\t\ttrue, // mustWrite flag (we want to write all values in the TS\n\t\t\t\t\tDbKey.NullKey); // sourceId not used in HDB\n\t\t\t\tcts.setTimeSeriesIdentifier(hdbTsId);\n\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\ttimeSeriesDAO.saveTimeSeries(cts);\n\t\t\t\t}\n\t\t\t\tcatch (BadTimeSeriesException ex)\n\t\t\t\t{\n\t\t\t\t\tLogger.instance().failure(module + \" Cannot save time series for '\"\n\t\t\t\t\t\t+ hdbTsId.getUniqueString() + \"': \" + ex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(DbIoException ex)\n\t\t{\n\t\t\tString emsg = \"Error writing message: \" + ex;\n\t\t\tfailure(emsg);\n\t\t\tthrow new DataConsumerException(emsg);\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\ttimeSeriesDAO.close();\n\t\t}\n\t}", "protected void syncConsumeLoop(MessageConsumer requestConsumer) {\n try {\n Message message = requestConsumer.receive(5000);\n if (message != null) {\n onMessage(message);\n } else {\n System.err.println(\"No message received\");\n }\n } catch (JMSException e) {\n onException(e);\n }\n }", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "@Override\r\n protected void onPreExecute() {\r\n super.onPreExecute();\r\n System.out.println(\"Starting download\");\r\n }", "public EventMapper onTransfer(final BiConsumer<Duty, Serializable> biconsumer) {\n\t\tinitConsumerDelegate();\n\t\t((ConsumerDelegate)getDepPlaceholder().getDelegate()).setBiConsumerTransfer(biconsumer);\n\t\treturn this;\n\t}", "public Intermediary()\r\n\t{\r\n\t\ttry {\r\n\t\t\treceiveSocket = new DatagramSocket(68);\r\n\t\t\tsendReceiveSocket = new DatagramSocket();\t\t\t\r\n\t\t\t\r\n\t\t} catch (SocketException se) {\r\n\t\t\tse.printStackTrace();\r\n\t\t\tSystem.exit(1);\r\n\t\t} \r\n\t\t\r\n\t\treqID = 1;\r\n\t\tSystem.out.println(\"===== INTERMEDIATE HOST STARTED =====\\n\");\r\n\t}", "@Override\n public void execute() {\n pickUp.collect();\n \n }", "@Override\n\tpublic void run( ) {\n\t\tConnect();\n\t\tSendFile( filePath );\n\t\tDisconnect();\n\t}", "@Override\n public void run() {\n System.out.println(\"Starting producer\");\n File file = new File(dirPath + \"/studentVle.csv\");\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new FileReader(file));\n String tempString = null;\n tempString = reader.readLine();\n while ((tempString = reader.readLine()) != null) {\n this.buffer.put(tempString);\n }\n reader.close();\n } catch (IOException | InterruptedException e) {\n e.printStackTrace();\n }\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pd.setMessage(\"Receiving.....\");\n pd.show();\n pd.setCancelable(false);\n }" ]
[ "0.6789154", "0.59981936", "0.5781974", "0.56658334", "0.5634414", "0.56334186", "0.5574141", "0.5501442", "0.54959804", "0.5494307", "0.5422763", "0.53978324", "0.53685236", "0.5320976", "0.5313904", "0.5300449", "0.5293145", "0.5292819", "0.52878946", "0.52525574", "0.5246985", "0.5212282", "0.51979685", "0.51944625", "0.5188699", "0.51826066", "0.5177997", "0.5154382", "0.51539975", "0.51429677", "0.5131465", "0.51151824", "0.51024383", "0.5063801", "0.50612587", "0.50590855", "0.5046334", "0.50382626", "0.50276226", "0.50252783", "0.5016165", "0.5005626", "0.5004476", "0.4999631", "0.4998343", "0.4991619", "0.49862313", "0.49833104", "0.49825066", "0.49782923", "0.49738938", "0.49624845", "0.49435368", "0.4942677", "0.49388924", "0.49326205", "0.49298006", "0.4928661", "0.4927433", "0.49264657", "0.4922768", "0.49159336", "0.49098495", "0.49030167", "0.48998985", "0.48968777", "0.48962212", "0.48896074", "0.48886347", "0.48837742", "0.48783404", "0.48757118", "0.48742178", "0.48731136", "0.48700428", "0.4864331", "0.48616463", "0.48610172", "0.4857825", "0.48533565", "0.4853313", "0.48521608", "0.48494998", "0.48443645", "0.4844356", "0.4843325", "0.48430127", "0.48338154", "0.4832178", "0.4831433", "0.48275623", "0.48262808", "0.48255286", "0.48217425", "0.4819013", "0.481831", "0.4816971", "0.4812882", "0.48126894", "0.4801136" ]
0.6824806
0
Initiates a data transfer process on the provider.
TransferInitiateResponse initiateProviderRequest(DataRequest dataRequest);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TransferInitiateResponse initiateConsumerRequest(DataRequest dataRequest);", "@Override\n public void onStart() {\n this.dataGenerator = new DataGenerator(this.dataSize, this.dataValues, this.dataValuesBalancing);\n this.dataStream = new DataStream();\n if (this.flowRate != 0)\n this.sleepTime = dataStream.convertToInterval(this.flowRate);\n this.count = 0L;\n// this.me = this.me + \"_\" + getRuntimeContext().getIndexOfThisSubtask();\n new Thread(this::receive).start();\n }", "@Override\n\tpublic void initParameters() {\n\t\ttransferDbData = new TransferDbData();\n\t}", "public OutTransfer send(int dataLength, DataProvider dataProvider) {\n\t\treturn this.transferProcessor.startTransfer(dataLength, dataProvider);\n\t}", "@Override\n\t\t\tpublic void start() {\n\t\t\t\tinitResource();\n\t\t\t\t//获取通讯录信息\n\t\t\t\tinitContactsData();\n\t\t\t\t//同步通讯录\n\t\t\t\tupLoadPhones();\n\t\t\t}", "@Override\n public void execute() {\n Task<Void> task = new Task<Void>() {\n @Override\n protected Void call() throws Exception {\n exportData();\n return null;\n }\n\n @Override\n protected void succeeded(){\n callback.onSuccess();\n super.succeeded();\n }\n\n @Override\n protected void failed(){\n callback.onFail(this.getException());\n super.failed();\n }\n };\n new Thread(task).start();\n }", "public void receiveDataThInitialization(){\r\n\t\treceiveMsg = new ReceiveDataModel(in, userModel.ID);\r\n\t\tThread receiveDataProcess = new Thread (receiveMsg);\r\n\t\treceiveDataProcess.start();\r\n\t}", "private static void performInitialSync() throws IOException,ConfigurationException {\n\n LOGGER.info(\"Starting to perform initial sync\");\n //tapDump is basically that -- a dump of all data currently in CB.\n TapStream tapStream = tapClient.tapDump(tapName);\n SolrBatchImportEventHandler couchbaseToSolrEventHandler = new SolrBatchImportEventHandler();\n startupBatchDisruptor(couchbaseToSolrEventHandler);\n RingBuffer<CouchbaseEvent> ringBuffer = disruptor.getRingBuffer();\n\n CouchbaseEventProducer producer = new CouchbaseEventProducer(ringBuffer);\n //While there is data keep reading and producing\n while (!tapStream.isCompleted()) {\n while (tapClient.hasMoreMessages()) {\n ResponseMessage responseMessage;\n responseMessage = tapClient.getNextMessage();\n if (null != responseMessage) {\n String key = responseMessage.getKey();\n String value = new String(responseMessage.getValue());\n producer.onData(new String[] {key, value}, responseMessage.getOpcode());\n\n }\n }\n }\n LOGGER.info(\"Finished initial sync\");\n shutdownBatchDisruptor();\n //Since this event handler is batch based, we need to let it know we are done and it could flush the remaining data.\n couchbaseToSolrEventHandler.flush();\n\n }", "@Override\r\n\tprotected void process() {\n\t\tconsultarSustentoProxy.setCodigoActvidad(codigo_actividad);\r\n\t\tconsultarSustentoProxy.setCodigoCliente(codigo_cliente);\r\n\t\tconsultarSustentoProxy.setCodigoPLan(codigo_plan);\r\n\t\tconsultarSustentoProxy.execute();\r\n\t}", "public void startData()\n\t\t\t{\n\t\t\t\tsend(\"<data>\", false);\n\t\t\t}", "private DataConnection() {\n \tperformConnection();\n }", "private void initData() {\n\n MyLog.log(\"调用录音上传接口\");\n MosHelper.startCheck(new MosHelper.mosSourceListener() {\n\n @Override\n public void getMosSource(String testTest, ArrayList<String> source) {\n // TODO Auto-generated method stub\n\n }\n\n @Override\n public void getMosIMEIAndId(String IMEI,\n String sourceId) {\n // TODO Auto-generated method stub\n MyLog.log(\"IMEI::\" + IMEI);\n Message message = handler.obtainMessage();\n message.obj = \"IMEI::\" + IMEI + \"\\n\" + \"sourceID:\\n\" + sourceId;\n message.what = 8;\n handler.sendMessage(message);\n\n }\n });\n }", "private void initData() {\n requestServerToGetInformation();\n }", "public void initTransport() {\n JDE.signal(procID, MESSAGE, \"Debugger connected to standard I/O socket.\", QUOTE);\n\n final Process process = m_debugger.getVM().process();\n standardInputProcessor = new StandardInputProcessor(process.getOutputStream());\n standardInputProcessor.start();\n\n standardOutputWriter = new StandardOutputWriter(m_sioSocket);\n standardOutputWriter.println(\"*** Process Standard I/O ***\");\n\n standardOutputProcessor = new StandardOutputProcessor(process.getInputStream());\n standardOutputProcessor.start();\n\n standardErrorProcessor = new StandardErrorProcessor(process.getErrorStream());\n standardErrorProcessor.start();\n\n }", "@Override\n\tpublic void initData() {\n\t\tsuper.initData();\n\t\tgetSynCourseTask(courseType, pageIndex);\n\t}", "private void uploadFromDataStorage() {\n }", "private synchronized void initializeData() {\n\n System.out.println(\"En inicializar datos\");\n // Only perform initialization once per app lifetime. If initialization has already been\n // performed, we have nothing to do in this method.\n if (mInitialized) return;\n mInitialized = true;\n\n mExecutors.diskIO().execute(() -> {\n if (isFetchNeeded()) {\n System.out.println(\"Se necesita actualizar, fetch is needed\");\n startFetchPublicacionService();\n }\n });\n }", "public void onStart() {\n\t\tnew Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tinitConnection();\n\t\t\t\treceive();\n\t\t\t}\n\t\t}.start();\n\t}", "public void enqueueTransfer(\n @Code int code, TransferConfiguration configuration) throws InterruptedException {\n TransferRequest request = TransferRequest.create(code, configuration);\n mRequestSemaphore.acquire();\n try {\n Optional<TransferManagerService> service = checkNotNull(mLiveService.getValue());\n if (service.isPresent()) {\n int startId = mNextStartId.getAndIncrement();\n service.get().request(request, startId);\n return;\n }\n } finally {\n mRequestSemaphore.release();\n }\n mContext.startForegroundService(request.getIntent(mContext));\n }", "private void execute() {\n\n\t\tPropertiesParser propertiesParser = new PropertiesParser();\n\t\t\n\t\tsetupServer(propertiesParser);\n\t\ttry {\n\t\t\t\n\t\t\tThread.sleep(SERVER_AFTER_RUN_DELAY);\n\t\t\t\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint i=0;\n\t\tfor( ; i < propertiesParser.getReadersNum() ; i++){\n\t\t\t\n\t\t\tsetupClient(propertiesParser , i,true);\n\t\t\t\n\t\t}\n\t\tfor(; i < propertiesParser.getReadersNum()+ propertiesParser.getWritersNum() ; i++){\n\t\t\t\n\t\t\tsetupClient(propertiesParser , i,false);\n\t\t\t\n\t\t}\n\t\t\n\t}", "public EventHandleThread(){\n gson = new Gson();\n producer = KafkaProducerCreator.createProducer();\n this.paymentController = new PaymentController();\n }", "public void start() {\n\t\tconnection.start((sender, message) -> message.accept(new Visitor(sender)));\n\t\tloadData();\n\t}", "private void sendData() {\n\n Thread update = new Thread() {\n public void run() {\n while (opModeIsActive() && (tfod != null)) {\n path.updateTFODData(recognize());\n path.updateHeading();\n try {\n Thread.sleep(500);\n } catch (Exception e) {\n }\n if (isStopRequested() && tfod != null)\n tfod.shutdown();\n }\n }\n };\n update.start();\n }", "@Override\r\n\tpublic void initData() {\n\t\tThreadUtils.getSinglePool().execute(new Runnable() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(2000);\r\n\t\t\t\t\tIntent intent =null;\r\n\t\t\t\t\tChainApplication application = (ChainApplication) getApplicationContext();\r\n\t\t\t\t\tUser user = application.getUserInfo();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(StringUtils.isEmpty(user.getUser_Name()) && StringUtils.isEmpty(HttpManager.getInstance().getToken(HttpManager.KEY_TOKEN))){\r\n\t\t\t\t\t\tintent = new Intent(getActivity(),LoginActivity.class);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tintent = new Intent(getActivity(), MainActivity.class);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\tfinish();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@Override\n public void run() {\n load_remote_data();\n }", "public void startCollectSysTrafficTask() {\n\t\tsubmitCollectSysTrafficTask();\n\t}", "@Override\n\t\t\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tinitBroadCastClient();\n\t\t\t\t\t\t\t\t\tReceivePublicKey();\n\t\t\t\t\t\t\t\t\tReceiveEncryptPrice();\n\t\t\t\t\t\t\t\t\tgenerateEProduct();\n\t\t\t\t\t\t\t\t\tsendEProduct();\n\t\t\t\t\t\t\t\t\tGarbleCircuits();\n\t\t\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}", "@Override\r\n\tprotected void setup() {\n\t\tgetContentManager().registerLanguage(codec);\r\n\t\tgetContentManager().registerOntology(ontology);\r\n\t\t\r\n\t\tObject[] args = getArguments();\r\n\t\tif(args != null && args.length > 0) {\r\n\t\t\tbroker = (Broker)args[0];\r\n\t\t} else {\r\n\t\t\tbroker = new Broker(\"Broker\");\r\n\t\t}\r\n\t\t\r\n\t\tProgramGUI.getInstance().printToLog(broker.hashCode(), getLocalName(), \"created\", Color.GREEN.darker());\r\n\t\t\r\n\t\t// Register in the DF\r\n\t\tDFRegistry.register(this, BROKER_AGENT);\r\n\t\t\r\n\t\tsubscribeToRetailers();\r\n\t\tquery();\r\n\t\tpurchase();\r\n\t}", "public void run() {\n LOG.info(\"Starting DataNode in: \"+data);\n \n // start dataXceiveServer\n dataXceiveServer.start();\n \n while (shouldRun) {\n try {\n offerService();\n } catch (Exception ex) {\n LOG.error(\"Exception: \" + StringUtils.stringifyException(ex));\n if (shouldRun) {\n try {\n Thread.sleep(5000);\n } catch (InterruptedException ie) {\n }\n }\n }\n }\n \n // wait for dataXceiveServer to terminate\n try {\n this.dataXceiveServer.join();\n } catch (InterruptedException ie) {\n }\n \n LOG.info(\"Finishing DataNode in: \"+data);\n }", "@Override\r\n\tprotected void setup() {\n\t\tgetContentManager().registerLanguage(codec);\r\n\t\tgetContentManager().registerOntology(ontology);\r\n\t\t\r\n\t\t// Register in the DF\r\n\t\tDFRegistry.register(this, BROKER_AGENT);\r\n\t\t\r\n\t\t// Find retailers\r\n\t\tsubscribeToRetailers();\r\n\t\t\r\n\t\t// Run agent\r\n\t\tquery();\r\n\t\tpurchase();\r\n\t}", "public void publishDataFromAdapter(RoutingContext routingContext) {\n LOGGER.debug(\"Info: publishDataFromAdapter method started;\");\n JsonObject requestJson = routingContext.getBodyAsJson();\n HttpServerRequest request = routingContext.request();\n HttpServerResponse response = routingContext.response();\n String instanceID = request.getHeader(HEADER_HOST);\n JsonObject authenticationInfo = new JsonObject();\n authenticationInfo.put(API_ENDPOINT, \"/iudx/v1/adapter\");\n requestJson.put(JSON_INSTANCEID, instanceID);\n if (request.headers().contains(HEADER_TOKEN)) {\n authenticationInfo.put(HEADER_TOKEN, request.getHeader(HEADER_TOKEN));\n authenticator.tokenInterospect(requestJson.copy(), authenticationInfo, authHandler -> {\n if (authHandler.succeeded()) {\n Future<JsonObject> brokerResult =\n managementApi.publishDataFromAdapter(requestJson, databroker);\n brokerResult.onComplete(brokerResultHandler -> {\n if (brokerResultHandler.succeeded()) {\n LOGGER.debug(\"Success: publishing data from adapter\");\n handleSuccessResponse(response, ResponseType.Ok.getCode(),\n brokerResultHandler.result().toString());\n } else {\n LOGGER.debug(\"Fail: Bad request;\" + brokerResultHandler.cause().getMessage());\n processBackendResponse(response, brokerResultHandler.cause().getMessage());\n }\n });\n } else {\n LOGGER.debug(\"Fail: Unauthorized;\" + authHandler.cause().getMessage());\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n });\n } else {\n LOGGER.debug(\"Fail: Unauthorized\");\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n }", "@Override\n\tpublic void run() {\n\t\tthis.originateAction = new OriginateAction();\n\t\tthis.originateAction.setChannel(this.destination); // SIP/1083484/01703846797\n\t\tthis.originateAction.setContext(EPursuit.properties.getProperty(\"context\"));\n\t\tthis.originateAction.setExten(this.agi.getExtension());\n\t\tthis.originateAction.setPriority(new Integer(1));\n\t\t// TODO: Which timeout to use? Occurs sometimes when the phone is down\n\t\t// or never receives an event (for some reason)\n\t\tthis.originateAction.setTimeout(new Long(EPursuit.properties.getProperty(\"callTime\"))+new Long(EPursuit.properties.getProperty(\"dialTime\")));\n\t\tthis.originateAction.setAsync(true);\n\n\t\t// make initial call\n\t\tthis.makeCall();\n\t}", "public void fireTransferInitiated(Resource resource, int requestType) {\n TransferEvent event = new TransferEvent(wagon, resource, TransferEvent.TRANSFER_INITIATED, requestType);\n for (TransferListener listener : listeners) {\n listener.transferInitiated(event);\n }\n }", "SendToDataLayerThread(String p, String msg) {\n path = p;\n message = msg;\n }", "@Inject\n public ParentTaskTransferService(TransfersService transfersService1,\n FileTransfersDAO dao1,\n FileOpsService fileOpsService1,\n FilePermsService permsService1,\n RemoteDataClientFactory remoteDataClientFactory1,\n SystemsCache systemsCache1)\n {\n transfersService = transfersService1;\n dao = dao1;\n fileOpsService = fileOpsService1;\n systemsCache = systemsCache1;\n remoteDataClientFactory = remoteDataClientFactory1;\n permsService = permsService1;\n }", "protected void initialize() { \n param1 = SmartDashboard.getNumber(\"param1\");\n param2 = SmartDashboard.getNumber(\"param2\");\n param3 = SmartDashboard.getNumber(\"param3\");\n param4 = SmartDashboard.getNumber(\"param4\");\n command = new C_DriveBasedOnEncoderWithTwist(param1, param2, param3);\n }", "@Override\n public void prepare() {\n //Caching as file resource.\n File file = this.getResource().file;\n logger.info(\"Preparing {} streams for file: {}\", this.getTransferType(), file.getName());\n\n if (this.getTransferType() == ResourceTransferType.OUTBOUND) {\n //Sending\n try {\n buffer = new byte[BUFFER_SIZE];\n sent = 0;\n inputChannel = new FileInputStream(file).getChannel();\n inputBuffer = inputChannel.map(FileChannel.MapMode.READ_ONLY, 0, inputChannel.size());\n } catch (FileNotFoundException e) { //File doesn't exist.\n //Calling a transfer error.\n callError(e);\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n //Receiving\n //Checking if file already exists.\n written = 0;\n saved = 0;\n if (getResource().isLocal()) {\n getResource().calcNetworkId();\n if (getResource().getNetworkID().equals(getTunnel().getDestination())) {\n //The file is already stored locally.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), -2));\n this.close();\n return;\n }\n }\n\n //Creating or replacing the file.\n buffer = new byte[BUFFER_SIZE * 16];\n if (file.exists()) {\n file.delete();\n }\n try { //Creating new file.\n file.createNewFile();\n outputStream = new FileOutputStream(file);\n } catch (IOException e) {\n //Calling a transfer error.\n callError(e);\n return;\n }\n\n //Requesting the first chunk.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), 0));\n }\n }", "public void postData()\n\t{\n\t\tnew NetworkingTask().execute(message);\n\t}", "@Override\r\n\tpublic void start() throws Exception {\r\n\t\tserialPort.notifyOnDataAvailable(true);\r\n\t\tserialPort.disableReceiveTimeout();\r\n\t\tserialPort.enableReceiveThreshold(1);\r\n\r\n\t\tserialPort.addEventListener(new SerialPortEventListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void serialEvent(SerialPortEvent event) {\r\n\t\t\t\tswitch (event.getEventType()) {\r\n\t\t\t\tcase SerialPortEvent.DATA_AVAILABLE:\r\n\t\t\t\t\ttry {\r\n\r\n\t\t\t\t\t\tString trame = ComConnexion.this.reader.readLine();\r\n\t\t\t\t\t\tfloat value = TrameDecoder.valeur(trame);\r\n\t\t\t\t\t\tMeteoEventType_E type = TrameDecoder.dataType(trame);\r\n\r\n\t\t\t\t\t\tswitch (type) {\r\n\t\t\t\t\t\tcase ALTITUDE:\r\n\t\t\t\t\t\t\tmeteoServiceCallback.altitudePerformed(value);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase PRESSION:\r\n\t\t\t\t\t\t\tmeteoServiceCallback.pressionPerformed(value);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase TEMPERATURE:\r\n\t\t\t\t\t\t\tmeteoServiceCallback.temperaturePerformed(value);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public void start() {\n\t\tinstanceConfigUpdated();\n\n\t\tnew Thread(getUsageData, \"ResourceConsumptionManager : GetUsageData\").start();\n\n\t\tLoggingService.logInfo(MODULE_NAME, \"started\");\n\t}", "@Override\n\tpublic void teleopInit() {\n\t\tif (autonomousCommand != null)\n\t\t\tautonomousCommand.cancel();\n\t\tisAutonomous = false;\n\t\tisTeleoperated = true;\n\t\tisEnabled = true;\n\t\ttry {\n\t\t\tdrivebase.initDriveBase(1);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tRobot.numToSend = 3;\n\t}", "public void submitSyncDeviceTrafficTask() {\n\t\tL.i(this.getClass(), \"SyncDeviceTrafficTask()...\");\n\t\taddTask(new SyncDeviceTrafficTask());\n\t}", "public PSO() {\r\n initialiseNetwork();\r\n initialisePSO();\r\n }", "@Override public final void dinvoke(H2ONode sender) {\n setupLocal0(); // Local setup\n compute2(); // Do The Main Work\n // nothing here... must do any post-work-cleanup in onCompletion\n }", "@Override public final void dinvoke(H2ONode sender) {\n setupLocal(); // Local setup\n compute2(); // Do The Main Work\n // nothing here... must do any post-work-cleanup in onCompletion\n }", "@Override\n public void runTask() {\n PortugueseDistrictImportAuxiliaryServices aux = PortugueseDistrictImportAuxiliaryServices.getInstance();\n aux.executeTask(this);\n }", "public void initialize() {\n\tMain.getPartida().recuperarData();\n\taction();\n\t\n\t}", "@Override\n public void setup ()\n {\n DomainObjectReader dor;\n\n dor = (DomainObjectReader) SpringApplicationContext.getBean(\"reader\");\n brokerRepo = (BrokerRepo) SpringApplicationContext.getBean(\"brokerRepo\");\n ttx = new ArrayList<>();\n\n dor.registerNewObjectListener(new TimeslotUpdateHandler(),\n TimeslotUpdate.class);\n dor.registerNewObjectListener(new TariffTxHandler(),\n TariffTransaction.class);\n dor.registerNewObjectListener(new CustomerInfoHandler(), CustomerInfo.class);\n\n try {\n data = new PrintWriter(new File(dataFilename));\n }\n catch (FileNotFoundException e) {\n log.error(\"Cannot open file \" + dataFilename);\n }\n\n powerTypes = preparePowerTypes();\n customerByType = new HashMap<>();\n for (PowerType type : powerTypes)\n customerByType.put(type, 0);\n }", "@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "public void init() {\n\t\ttry {\n\t\t\tthis.is = new ObjectInputStream(clientSocket.getInputStream());\n\t\t\tthis.os = new ObjectOutputStream(clientSocket.getOutputStream());\n\t\t\twhile (this.readCommand()) {}\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void migrateData() throws Throwable\r\n\t{\r\n\t\tthis.createStagingPrivateInstance();\r\n\t\tthis.maskData();\r\n\t\tthis.importDataInPublicInstance();\r\n\t}", "public void teleopInit() {\n\t\tauto.cancel();\r\n\t\t// Create the teleop command and start it.\r\n\t\tteleop.start();\r\n\t\t// Reset the drivetrain encoders\r\n\t\tDriveTrain.getInstance().resetEncoders();\r\n\t\t// Start pushing sensor readings to the SD.\r\n\t\treadings.start();\r\n\t}", "private void bankSetup() throws IOException {\n bankProtocol = new BankProtocol(this);\n notificationServer = new NotificationServer(portNumber, bankProtocol);\n Thread serverThread = new Thread(notificationServer);\n serverThread.start();\n }", "public abstract void initializeProcess();", "public void execute() {\n\n try {\n int source = data_path.IR.decimal(15, 0);\n int destination = data_path.IR.decimal(23, 16);\n\n System.out.println(\"Source: \" + source);\n data_path.master_bus.store(source);\n data_path.bank.load(destination);\n\n } catch (Exception e) {\n System.err.println(\"In Controler:LOADI0:increment_clock\");\n System.err.println(e);\n }\n }", "private void init() {\n\t\tinitProtocol();\n\t\tinitResultStorage();\n\t}", "CompletableFuture<DataDestination> provision(String topicName);", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t}", "private void InitiatePassiveTransaction() {\n if (!ReceiveDiscoveryMessage()) //if query message reception was unsuccessful.\n return;\n }", "protected void setup(){\n this.setEnabledO2ACommunication(true, 0);\n \n showMessage(\"Agent (\" + getLocalName() + \") .... [OK]\");\n \n // Register the agent to the DF\n ServiceDescription sd1 = new ServiceDescription();\n sd1.setType(UtilsAgents.BOAT_COORDINATOR);\n sd1.setName(getLocalName());\n sd1.setOwnership(UtilsAgents.OWNER);\n DFAgentDescription dfd = new DFAgentDescription();\n dfd.addServices(sd1);\n dfd.setName(getAID());\n try {\n DFService.register(this, dfd);\n showMessage(\"Registered to the DF\");\n }catch (FIPAException e) {\n System.err.println(getLocalName() + \" registration with DF \" + \"unsucceeded. Reason: \" + e.getMessage());\n doDelete();\n }\n \n //Search for the CentralAgent\n ServiceDescription searchBoatCoordCriteria = new ServiceDescription();\n searchBoatCoordCriteria.setType(UtilsAgents.COORDINATOR_AGENT);\n this.coordinatorAgent = UtilsAgents.searchAgent(this, searchBoatCoordCriteria);\n\n // Register response behaviours\n //TODO canviar i posar l'altra content\n MessageTemplate mt = MessageTemplate.MatchContent(\"Movement request\");\n this.addBehaviour(new RequestResponseBehaviour(this,mt ));\n }", "public void readTaskInititate() {\n\t\tiStream = new ByteArrayInputStream(marshalledBytes);\t\n\t\tdin = new DataInputStream(new BufferedInputStream(iStream));\n\t\ttry {\n\t\t\tint rounds = din.readInt();\n\t\t\tfor(int i = 0; i<5; i++) {\n\t\t\t\t//Select random node from list of nodes to send a message to \n\t\t\t\tVertex randomNode = node.getRandomNode();\n\t\t\t\tStack<String> nxt= node.getNextNodesToReach(randomNode.ip,randomNode.port);\n\t\t\t\tString firstStop = nxt.pop();\n\t\t\t\tArrayList<String> nextSteps = new ArrayList<String>();\n\t\t\t\tfor(String x : nxt) {\n\t\t\t\t\tnextSteps.add(x);\n\t\t\t\t}\n\t\t\n\t\t\t\tMessage message = new ForwardMessage(nextSteps);\n\t\t\t\tSocket senderSocket = node.getConnections().getSocketWithName(firstStop);\n\t\t\t\tnew TCPSender(senderSocket, message);\n\t\t\t\tnode.addToSendSum(message.getPayload());\n\t\t\t\tnode.incrementSendTracker();\n\t\t\t}\n\t\t\trounds = rounds -1;\n\t\t\tif (rounds == 0) {\t\t\t\t// Send task Complete message if we have finished all of our rounds \n\t\t\t\tMessage completeMessage = new TaskComplete(node.ipAddr,node.portNum);\n\t\t\t\tSocket socketReturn = node.getConnections().getSocketWithName(node.getRegistryName());\n\t\t\t\tnew TCPSender (socketReturn, completeMessage);\n\t\t\t} else {\n\t\t\t\t//Else put a new event with a taskInitiate method into the queue\n\t\t\t\tMessage rerun = new TaskInitiate(rounds);\n\t\t\t\tbyte[] newData = rerun.getByteArray();\n\t\t\t\tEventFactory eventFactory = EventFactory.getInstance();\n\t\t\t\teventFactory.insert(messageType, newData, node, originSocket);\n\t\t\t}\n\t\t} catch (IOException e) { System.out.println(\"Failed to read message. \"); }\n\t}", "private void InitiateRelevantActiveTransaction() {\n try {\n /**\n * Create a client socket with the host,\n * port, and timeout information.\n */\n mSocket = new Socket();\n mSocket.bind(null);\n mSocket.connect((new InetSocketAddress(mPeer.mIPAddr, Constants.WELCOME_SOCKET_PORT)), 3000);\n } catch (UnknownHostException e) {\n e.printStackTrace();\n return;\n } catch (IOException e) {\n e.printStackTrace();\n return;\n }\n\n if (mSocket == null) {\n return;\n }\n\n switch (mQueryCode) {\n case Constants.CONNECTION_CODE_DISCOVER: {\n ActiveDiscoveryProcedure();\n break;\n }\n }\n\n }", "public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }", "public void startReceiving() {\n\t\tHandlerThread handlerThread = new HandlerThread(\n\t\t\t\t\"DataExportationReceiverThread\");\n\t\thandlerThread.start();\n\t\tcallerContext.registerReceiver(this, new IntentFilter(\n\t\t\t\tDataExportationService.BROADCAST_ACTION), null, new Handler(\n\t\t\t\thandlerThread.getLooper()));\n\t}", "public void run()\n\t{\n\t\tMSetup ms = new MSetup(Env.getCtx(), m_WindowNo);\n\t\tm_frame.setBusyTimer(45);\n\t\t// Step 1\n\t\tboolean ok = ms.createClient(fClientName.getText(), fOrgName.getText(),\n\t\t\tfUserClient.getText(), fUserOrg.getText());\n\t\tString info = ms.getInfo();\n\n\t\tif (ok)\n\t\t{\n\t\t\t// Generate Accounting\n\t\t\tKeyNamePair currency = (KeyNamePair)fCurrency.getSelectedItem();\n\t\t\tif (!ms.createAccounting(currency,\n\t\t\t\tfProduct.isSelected(), fBPartner.isSelected(), fProject.isSelected(),\n\t\t\t\tfMCampaign.isSelected(), fSRegion.isSelected(),\n\t\t\t\tm_file))\n\t\t\t{\n\t\t\t\tADialog.error(m_WindowNo, this, \"AccountSetupError\");\n\t\t\t\tdispose();\n\t\t\t}\n\t\t\t// Generate Entities\n\t\t\tKeyNamePair p = (KeyNamePair)fCountry.getSelectedItem();\n\t\t\tint C_Country_ID = p.getKey();\n\t\t\tp = (KeyNamePair)fRegion.getSelectedItem();\n\t\t\tint C_Region_ID = p.getKey();\n\t\t\tms.createEntities(C_Country_ID, fCity.getText(), C_Region_ID, currency.getKey());\n\t\t\tinfo += ms.getInfo();\n\t\t\t//\tCreate Print Documents\n\t\t\tPrintUtil.setupPrintForm(ms.getAD_Client_ID());\n\t\t}\n\n\t\tADialog.info(m_WindowNo, this, \"VSetup\", info);\n\t\tdispose();\n\t}", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "@Override\n\tpublic void teleopInit() {\n\t\tif (driveTrainCommand != null) {\n\t\t\tdriveTrainCommand.start();\n\t\t}\n\t\tif (colorCommand != null) {\n\t\t\tcolorCommand.start();\n\t\t}\n\t\tif (intakeCommand != null) {\n\t\t\tintakeCommand.start();\n\t\t}\n\t\tif (outtakeCommand != null) {\n\t\t\touttakeCommand.start();\n\t\t}\n\t}", "public void onStart() {\n\t new Thread() {\n\t @Override public void run() {\n\t receive();\n\t }\n\t }.start();\n\t }", "public FileTransfer(int myPort){ //Receiver\n socket = new MySocket(ProtocolStack.getLocalhost().getLogicalID(),myPort);\n socket.bindServer();\n socket.accept();\n step = STEP_WAITING_TO_RECEIVE;\n }", "private void initDataTransferAccountsData() throws HpcException {\n for (HpcDataTransferType dataTransferType : HpcDataTransferType.values()) {\n // Get the data transfer system account.\n final List<HpcIntegratedSystemAccount> accounts =\n systemAccountDAO.getSystemAccount(dataTransferType);\n if (accounts != null && accounts.size() == 1) {\n singularDataTransferAccounts.put(dataTransferType, accounts.get(0));\n } else if (accounts != null && accounts.size() > 1) {\n initMultiDataTransferAccountsMap(dataTransferType, accounts);\n }\n }\n }", "public void processStart(){\n initWorkerQueue();\n DataBean serverArgs = new DataBean();\n serverArgs.setValue(\"mode\",\"server\");\n serverArgs.setValue(\"messagekey\",\"72999\");\n serverArgs.setValue(\"user\",\"auth\");\n serverArgs.setValue(\"messagechannel\",\"/esb/system\");\n messageClient = new MessageClient(this,serverArgs);\n Helper.writeLog(1,\"starting message server\");\n messageClient.addHandler(this);\n \n }", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "public void InitData() {\n }", "@Override\n public void execute() {\n var swerveModuleStates = calcDrive(//\n xSmooth.calc(xSpd.get() * DriveConstants.kTeleDriveMaxSpeedMetersPerSecond), //\n ySmooth.calc(ySpd.get() * DriveConstants.kTeleDriveMaxSpeedMetersPerSecond), //\n rotSmooth.calc(rotSpd.get() * DriveConstants.kTeleDriveMaxAngularSpeedRadiansPerSecond), //\n fieldOriented);\n swerveDrivetrain.setModuleStates(swerveModuleStates);\n }", "@Override\n public void run() {\n ArticleHeaders.loadData(getApplicationContext());\n CustomerHeaders.loadData(getApplicationContext());\n OrderReasons.loadData(getApplicationContext());\n }", "@Override\n\tpublic void run() {\n\t\tString request;\n\t\ttry {\n\t\t\tSocketBuilder socketBuilder = new SocketBuilder(this.IP);\n\n\t\t\tSocket clientSocketStrings = socketBuilder.createStringSocket();\n\t\t\tSocket clientSocketBytes = socketBuilder.createByteSocket();\n\n\t\t\tDataOutputStream outToServer = new DataOutputStream(clientSocketStrings.getOutputStream());\n\n\t\t\tDataInputStream bytesStream = new DataInputStream(clientSocketBytes.getInputStream());\n\n\t\t\tBufferedReader inFromServer = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(clientSocketStrings.getInputStream(), StandardCharsets.UTF_8));\n\t\t\t\n\t\t\tMessage requestMessage = new Message();\n\t\t\trequestMessage.createDownloadMessage(path);\n\n\t\t\trequest = JsonParser.messageToJson(requestMessage);\n\n\t\t\toutToServer.write(request.getBytes(\"UTF-8\"));\n\t\t\toutToServer.writeByte('\\n');\n\n\t\t\tMessage responseMessage = JsonParser.jsonToMessage(inFromServer.readLine());\n\n\t\t\t// check if operation is possible\n\t\t\tif (responseMessage.isERRORMessage()) {\n\t\t\t\t/*\n\t\t\t\t * Handle Error Here\n\t\t\t\t */\n\t\t\t} else {\n\n\t\t\t\tFileTransfer fileTransfer = new FileTransfer();\n\n\t\t\t\tlong size = Long.parseLong(inFromServer.readLine());\n\n\t\t\t\tEstimationViewManagementThread manage = new EstimationViewManagementThread(size, \n\t\t\t\t\t\tfileTransfer, clientSocketStrings, clientSocketBytes);\n\t\t\t\tmanage.start();\n\t\t\t\tfileTransfer.receiveFiles(bytesStream, inFromServer, locationToSave);\n\t\t\t}\n\t\t\t\n\t\t\toutToServer.close();\n\t\t\tbytesStream.close();\n\t\t\tinFromServer.close();\n\t\t\tclientSocketBytes.close();\n\t\t\tclientSocketStrings.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tprotected void initData() {\n\t\trequestUserInfo();\n\t}", "@Override\n protected void onStart() {\n\n try {\n\n executorService = Executors.newFixedThreadPool(1);\n\n cryptoAddressesNetworkServiceDatabaseFactory = new CryptoAddressesNetworkServiceDeveloperDatabaseFactory(pluginDatabaseSystem,pluginId);\n try {\n cryptoAddressesNetworkServiceDatabaseFactory.initializeDatabase();\n } catch (CantInitializeCryptoAddressesNetworkServiceDatabaseException e) {\n e.printStackTrace();\n }\n\n //DAO\n cryptoAddressesNetworkServiceDao = new CryptoAddressesNetworkServiceDao(pluginDatabaseSystem, pluginId);\n\n try {\n cryptoAddressesNetworkServiceDao.initialize();\n } catch (CantInitializeCryptoAddressesNetworkServiceDatabaseException e) {\n e.printStackTrace();\n }\n\n\n\n // change message state to process again first time\n reprocessPendingMessage();\n\n //declare a schedule to process waiting request message\n startTimer();\n\n }catch (Exception e){\n\n System.out.println(\" -- CRYPTO ADDRESS NS START ERROR \" + e.getMessage());\n e.printStackTrace();\n }\n\n\n\n\n }", "private void InitData() {\n\t}", "protected abstract void instantiateDataForAddNewTemplate (AsyncCallback<DATA> callbackOnSampleCreated) ;", "public void run() {\r\n Thread.currentThread().setContextClassLoader(m_loader);\r\n try {\r\n m_socket.setTcpNoDelay(true);\r\n m_socket.setSoTimeout(m_timeout);\r\n m_in = new ObjectInputStream(m_socket.getInputStream());\r\n m_out = new ObjectOutputStream(m_socket.getOutputStream());\r\n } catch (IOException e) {\r\n throw new WrappedRuntimeException(e);\r\n }\r\n while (m_running) {\r\n try {\r\n switch (m_in.read()) {\r\n case Command.CREATE:\r\n handleCreateCommand();\r\n break;\r\n case Command.INVOKE:\r\n handleInvocationCommand();\r\n break;\r\n case Command.CLOSE:\r\n m_running = false;\r\n break;\r\n default:\r\n break;\r\n }\r\n } catch (Exception e) {\r\n close();\r\n throw new WrappedRuntimeException(e);\r\n }\r\n }\r\n close();\r\n }", "@Override\n public void run() {\n ImageService.uploadProductImage(sequentialClient, gtin, imagePath, new\n PLYCompletion<ProductImage>() {\n @Override\n public void onSuccess(ProductImage result) {\n Log.d(\"UploadPImageCallback\", \"New image for product with GTIN \" + gtin + \" \" +\n \"uploaded\");\n LoadingIndicator.hide();\n if (isNewProduct) {\n SnackbarUtil.make(getActivity(), getView(), R.string.image_uploaded_more_info,\n Snackbar.LENGTH_LONG).show();\n } else {\n SnackbarUtil.make(getActivity(), getView(), R.string.image_uploaded, Snackbar\n .LENGTH_LONG).show();\n }\n DataChangeListener.imageCreate(result);\n }\n\n @Override\n public void onPostSuccess(ProductImage result) {\n loadProductImage(imagePath, productImage);\n }\n\n @Override\n public void onError(PLYAndroid.QueryError error) {\n Log.d(\"UploadPImageCallback\", error.getMessage());\n LoadingIndicator.hide();\n SnackbarUtil.make(getActivity(), getView(), error.getMessage(), Snackbar\n .LENGTH_LONG).show();\n }\n });\n }", "SerialResponse transfer(PinTransferPost pinTransferPost);", "public void initRequest() {\n repo.getData();\n }", "@Override\n public void start() throws SyncProcessException {\n }", "public Transportation(NetworkLayers.LAYER_DIRECTION layerDirection) {\n frame = MinT.getInstance();\n this.networkManager = frame.getNetworkManager();\n this.scheduler = frame.getSystemScheduler();\n \n if (layerDirection == NetworkLayers.LAYER_DIRECTION.RECEIVE) {\n syshandle = new SystemHandler();\n routing = networkManager.getRoutingProtocol();\n sharing = networkManager.getSharing();\n }\n\n if (layerDirection == NetworkLayers.LAYER_DIRECTION.SEND) {\n serialization = new MatcherAndSerialization(layerDirection);\n// if(frame.isBenchMode()){\n// bench_send = new PacketPerform(\"Trans-sender\");\n// frame.addPerformance(MinT.PERFORM_METHOD.Trans_Sender, bench_send);\n// }\n }\n }", "@Override\n\tpublic void run() {\n\t\t\n\t\ttry {\n\n\t\t\t// Eclipse doesn't support System.console()\n\t\t\tBufferedReader console = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tConfigManager config = NetBase.theNetBase().config();\n\t\t\tString server = config.getProperty(\"dataxferraw.server\");\n\t\t\tif ( server == null ) {\n\t\t\t\tSystem.out.print(\"Enter a host ip, or exit to exit: \");\n\t\t\t\tserver = console.readLine();\n\t\t\t\tif ( server == null ) return;\n\t\t\t\tif ( server.equals(\"exit\")) return;\n\t\t\t}\n\n\t\t\tint basePort = config.getAsInt(\"dataxferraw.baseport\", -1, TAG);\n\t\t\tif ( basePort == -1 ) {\n\t\t\t\tSystem.out.print(\"Enter port number, or empty line to exit: \");\n\t\t\t\tString portStr = console.readLine();\n\t\t\t\tif ( portStr == null || portStr.trim().isEmpty() ) return;\n\t\t\t\tbasePort = Integer.parseInt(portStr);\n\t\t\t}\n\t\t\t\n\t\t\tint socketTimeout = config.getAsInt(\"dataxferraw.sockettimeout\", -1, TAG);\n\t\t\tif ( socketTimeout < 0 ) {\n\t\t\t\tSystem.out.print(\"Enter socket timeout (in msec.): \");\n\t\t\t\tString timeoutStr = console.readLine();\n\t\t\t\tsocketTimeout = Integer.parseInt(timeoutStr);\n\t\t\t\t\n\t\t\t}\n\n\t\t\tint nTrials = config.getAsInt(\"dataxferraw.ntrials\", -1, TAG);\n\t\t\tif ( nTrials == -1 ) {\n\t\t\t\tSystem.out.print(\"Enter number of trials: \");\n\t\t\t\tString trialStr = console.readLine();\n\t\t\t\tnTrials = Integer.parseInt(trialStr);\n\t\t\t}\n\n\t\t\tfor ( int index=0; index<DataXferRawService.NPORTS; index++ ) {\n\n\t\t\t\tTransferRate.clear();\n\t\t\t\t\n\t\t\t\tint port = basePort + index;\n\t\t\t\tint xferLength = DataXferRawService.XFERSIZE[index];\n\n\t\t\t\tSystem.out.println(\"\\n\" + xferLength + \" bytes\");\n\n\t\t\t\t//-----------------------------------------------------\n\t\t\t\t// UDP transfer\n\t\t\t\t//-----------------------------------------------------\n\n\t\t\t\tTransferRateInterval udpStats = udpDataXfer(server, port, socketTimeout, xferLength, nTrials);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"UDP: xfer rate = \" + String.format(\"%9.0f\", udpStats.mean() * 1000.0) + \" bytes/sec.\");\n\t\t\t\tSystem.out.println(\"UDP: failure rate = \" + String.format(\"%5.1f\", udpStats.failureRate()) +\n\t\t\t\t\t\t \" [\" + udpStats.nAborted() + \"/\" + udpStats.nTrials() + \"]\");\n\n\t\t\t\t//-----------------------------------------------------\n\t\t\t\t// TCP transfer\n\t\t\t\t//-----------------------------------------------------\n\n\t\t\t\tTransferRateInterval tcpStats = tcpDataXfer(server, port, socketTimeout, xferLength, nTrials);\n\n\t\t\t\tSystem.out.println(\"\\nTCP: xfer rate = \" + String.format(\"%9.0f\", tcpStats.mean() * 1000.0) + \" bytes/sec.\");\n\t\t\t\tSystem.out.println(\"TCP: failure rate = \" + String.format(\"%5.1f\", tcpStats.failureRate()) +\n\t\t\t\t\t\t \" [\" + tcpStats.nAborted()+ \"/\" + tcpStats.nTrials() + \"]\");\n\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Unanticipated exception: \" + e.getMessage());\n\t\t}\n\t}", "DataFlow createDataFlow();", "@Override\n\tpublic void execute() {\n\t\tcmdReceiver.send();\n\t}", "public void execute() {\n if (hasError())\n return;\n\n runLocally();\n runRemotely();\n }", "public void doCall(){\n CalculatorPayload operation = newContent();\n\n ((PBFTClient)getProtocol()).syncCall(operation);\n }", "@Override\n public void run() {\n new ConnectBT().execute();\n }", "private void deferredInitialization() {\n HostInfo hostInfo = new HostInfo(repoInfo.host, repoInfo.namespace, repoInfo.secure);\n connection = ctx.newPersistentConnection(hostInfo, this);\n\n this.ctx\n .getAuthTokenProvider()\n .addTokenChangeListener(\n ((DefaultRunLoop) ctx.getRunLoop()).getExecutorService(),\n new TokenProvider.TokenChangeListener() {\n @Override\n public void onTokenChange() {\n operationLogger.debug(\"Auth token changed, triggering auth token refresh\");\n connection.refreshAuthToken();\n }\n\n @Override\n public void onTokenChange(String token) {\n operationLogger.debug(\"Auth token changed, triggering auth token refresh\");\n connection.refreshAuthToken(token);\n }\n });\n\n this.ctx\n .getAppCheckTokenProvider()\n .addTokenChangeListener(\n ((DefaultRunLoop) ctx.getRunLoop()).getExecutorService(),\n new TokenProvider.TokenChangeListener() {\n @Override\n public void onTokenChange() {\n operationLogger.debug(\n \"App check token changed, triggering app check token refresh\");\n connection.refreshAppCheckToken();\n }\n\n @Override\n public void onTokenChange(String token) {\n operationLogger.debug(\n \"App check token changed, triggering app check token refresh\");\n connection.refreshAppCheckToken(token);\n }\n });\n\n // Open connection now so that by the time we are connected the deferred init has run\n // This relies on the fact that all callbacks run on repo's runloop.\n connection.initialize();\n\n PersistenceManager persistenceManager = ctx.getPersistenceManager(repoInfo.host);\n\n infoData = new SnapshotHolder();\n onDisconnect = new SparseSnapshotTree();\n\n transactionQueueTree = new Tree<List<TransactionData>>();\n\n infoSyncTree =\n new SyncTree(\n ctx,\n new NoopPersistenceManager(),\n new SyncTree.ListenProvider() {\n @Override\n public void startListening(\n final QuerySpec query,\n Tag tag,\n final ListenHashProvider hash,\n final SyncTree.CompletionListener onComplete) {\n scheduleNow(\n new Runnable() {\n @Override\n public void run() {\n // This is possibly a hack, but we have different semantics for .info\n // endpoints. We don't raise null events on initial data...\n final Node node = infoData.getNode(query.getPath());\n if (!node.isEmpty()) {\n List<? extends Event> infoEvents =\n infoSyncTree.applyServerOverwrite(query.getPath(), node);\n postEvents(infoEvents);\n onComplete.onListenComplete(null);\n }\n }\n });\n }\n\n @Override\n public void stopListening(QuerySpec query, Tag tag) {}\n });\n\n serverSyncTree =\n new SyncTree(\n ctx,\n persistenceManager,\n new SyncTree.ListenProvider() {\n @Override\n public void startListening(\n QuerySpec query,\n Tag tag,\n ListenHashProvider hash,\n final SyncTree.CompletionListener onListenComplete) {\n connection.listen(\n query.getPath().asList(),\n query.getParams().getWireProtocolParams(),\n hash,\n tag != null ? tag.getTagNumber() : null,\n new RequestResultCallback() {\n @Override\n public void onRequestResult(String optErrorCode, String optErrorMessage) {\n DatabaseError error = fromErrorCode(optErrorCode, optErrorMessage);\n List<? extends Event> events = onListenComplete.onListenComplete(error);\n postEvents(events);\n }\n });\n }\n\n @Override\n public void stopListening(QuerySpec query, Tag tag) {\n connection.unlisten(\n query.getPath().asList(), query.getParams().getWireProtocolParams());\n }\n });\n\n restoreWrites(persistenceManager);\n\n updateInfo(Constants.DOT_INFO_AUTHENTICATED, false);\n updateInfo(Constants.DOT_INFO_CONNECTED, false);\n }", "private void importDataInPublicInstance() throws Exception\r\n\t{\r\n\t\tfinal String dropPrivateDBCmd = ApplicationProperties.getValue(\"createStagingDump\");\r\n\t\tthis.executeCommand(dropPrivateDBCmd);\r\n\r\n\t\tfinal String createPrivateDumpCmd = ApplicationProperties.getValue(\"dropPublicDB\");\r\n\t\tthis.executeCommand(createPrivateDumpCmd);\r\n\r\n\t\tfinal String createPrivateDB = ApplicationProperties.getValue(\"createPublicDB\");\r\n\t\tthis.executeCommand(createPrivateDB);\r\n\t}", "@Override\r\n\tprotected void processControlPort(StreamingInput<Tuple> stream, Tuple tuple) throws Exception {\r\n\t\tsuper.processControlPort(stream, tuple);\r\n\t\t// Initiate PreparedStatement\r\n\t\tinitPreparedStatement();\r\n\t}" ]
[ "0.6282128", "0.61552674", "0.59375083", "0.5685262", "0.5530422", "0.55089927", "0.5496831", "0.54513377", "0.54509497", "0.5443855", "0.54166096", "0.53875345", "0.5360906", "0.5355025", "0.5340727", "0.53284216", "0.5295845", "0.52679574", "0.5232787", "0.52158564", "0.5181501", "0.51775956", "0.5177403", "0.51621956", "0.51540667", "0.5153134", "0.5141324", "0.5128473", "0.5103657", "0.5099791", "0.5089549", "0.50773257", "0.50719935", "0.5071211", "0.50613356", "0.5055966", "0.50373596", "0.503083", "0.501508", "0.50131476", "0.49865136", "0.49843338", "0.4979147", "0.4966272", "0.49447873", "0.49379012", "0.4932937", "0.49205118", "0.49198776", "0.49198776", "0.49138367", "0.49137312", "0.49041075", "0.49000278", "0.4893301", "0.48888388", "0.48753515", "0.48700517", "0.4869845", "0.48649937", "0.4863849", "0.48611632", "0.48562518", "0.48552424", "0.485479", "0.4844471", "0.4842813", "0.4838827", "0.48335356", "0.4831208", "0.4830594", "0.48264477", "0.48253426", "0.48253426", "0.48253426", "0.48253426", "0.48253426", "0.4823682", "0.48186108", "0.48183808", "0.48179567", "0.48167974", "0.48128718", "0.48106763", "0.48061848", "0.48000202", "0.47992364", "0.47923008", "0.47872669", "0.47868583", "0.4778866", "0.47777468", "0.47716513", "0.47651362", "0.47649384", "0.47623175", "0.47595033", "0.47591653", "0.47591317", "0.4758449" ]
0.66066766
0
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_stats_detail, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.68621665", "0.68621665", "0.68621665", "0.68515885", "0.68467957", "0.68194443", "0.6817494", "0.6813087", "0.6813087", "0.6812847", "0.6805774", "0.6801204", "0.6797914", "0.6791314", "0.6789091", "0.67883503", "0.6783642", "0.6759701", "0.6757412", "0.67478645", "0.6744127", "0.6744127", "0.67411774", "0.6740183", "0.6726017", "0.6723245", "0.67226785", "0.67226785", "0.67208904", "0.67113477", "0.67079866", "0.6704564", "0.6699229", "0.66989094", "0.6696622", "0.66952467", "0.66865396", "0.6683476", "0.6683476", "0.6682188", "0.6681209", "0.6678941", "0.66772443", "0.6667702", "0.66673946", "0.666246", "0.6657578", "0.6657578", "0.6657578", "0.6656586", "0.66544783", "0.66544783", "0.66544783", "0.66524047", "0.6651954", "0.6650132", "0.66487855", "0.6647077", "0.66467404", "0.6646615", "0.66464466", "0.66449624", "0.6644209", "0.6643461", "0.6643005", "0.66421187", "0.6638628", "0.6634786", "0.6633529", "0.6632049", "0.6632049", "0.6632049", "0.66315657", "0.6628954", "0.66281766", "0.6627182", "0.6626297", "0.6624309", "0.6619582", "0.6618876", "0.6618876" ]
0.0
-1
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.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.7904975", "0.78056985", "0.77671826", "0.77275974", "0.7632173", "0.7622138", "0.75856143", "0.7531176", "0.7488386", "0.74576557", "0.74576557", "0.74391466", "0.7422802", "0.7403698", "0.7392229", "0.73873955", "0.73796785", "0.737091", "0.73627585", "0.7356357", "0.73460615", "0.73415256", "0.73305213", "0.7329754", "0.7326127", "0.731949", "0.73171073", "0.7314056", "0.7304481", "0.7304481", "0.73022866", "0.72986156", "0.7293808", "0.7287263", "0.72836643", "0.72815806", "0.72789687", "0.72602886", "0.72602886", "0.72602886", "0.7259816", "0.7259814", "0.72502047", "0.7225156", "0.7219905", "0.7217096", "0.72046524", "0.72012514", "0.7201042", "0.71939653", "0.71857035", "0.71786326", "0.7169012", "0.7167622", "0.7154164", "0.71538347", "0.7136608", "0.7135137", "0.7135137", "0.7129952", "0.7129347", "0.71241516", "0.7123588", "0.7123425", "0.71223265", "0.71175927", "0.71175927", "0.71175927", "0.71175927", "0.71171945", "0.71171755", "0.71165764", "0.7114952", "0.71124375", "0.7109778", "0.7109144", "0.7105842", "0.71002746", "0.70984215", "0.7096018", "0.709392", "0.709392", "0.70864546", "0.7083677", "0.708144", "0.70804363", "0.70738995", "0.7068429", "0.7061805", "0.7060801", "0.7060423", "0.7051581", "0.7037953", "0.7037953", "0.70359737", "0.7035605", "0.7035605", "0.7033388", "0.70312315", "0.7029681", "0.70192695" ]
0.0
-1
private ChannelFuture cf; EventLoopGroup workerGroup = new NioEventLoopGroup();
public void sendMsg(Msg msg) throws Exception { sendMsg(msg, host, port); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) throws Exception {\n EventLoopGroup bossGroup = new NioEventLoopGroup(1);\n EventLoopGroup workerGroup = new NioEventLoopGroup(8);\n\n //\n ServerBootstrap bootstrap = new ServerBootstrap();\n\n try {\n //\n bootstrap.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class) // use this as channel in boss group\n .option(ChannelOption.SO_BACKLOG, 128) // set initial queue connection count\n .childOption(ChannelOption.SO_KEEPALIVE, true) // set connection type, keep alive\n // set handler to the workerGroup, handler() will set to the BossGroup\n .childHandler(new ChannelInitializer<SocketChannel>() {\n // define actions along with channel creation (getting SocketChannel from ServeSocketChannel in nio\n // add handler to the pipeline\n @Override\n protected void initChannel (SocketChannel ch) throws Exception {\n // can utilize channel to push message to different client since one channel correspond to one client\n System.out.println(\"client socket channel hashcode = \" + ch.hashCode());\n ch.pipeline().addLast(new NettyServerHandler());\n }\n }); // set worker group handler\n\n System.out.println(\"...Server instance is ready\");\n\n // bind to a port (non-blocking)\n // start the server\n // sync = block until future ready\n ChannelFuture channelFuture = bootstrap.bind(6668).sync();\n System.out.println(\"After future sync\");\n\n // You can add listener to ChannelFuture\n channelFuture.addListener(new ChannelFutureListener() {\n @Override\n public void operationComplete(ChannelFuture channelFuture) throws Exception {\n if (channelFuture.isSuccess()) {\n System.out.println(\"connect success\");\n } else {\n System.out.println(\"connect fail\");\n }\n }\n });\n\n //\n channelFuture.channel().closeFuture().sync();\n\n\n\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }", "@Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n ctx.write(buf.duplicate()).addListener(ChannelFutureListener.CLOSE);\n }", "public ChannelFuture getChannelFuture() {\n return channelFuture;\n }", "public final static void main(String[] args) throws Exception {\n \n ThreadFactory threadFactory =\n new VerboseThreadFactory(log, Executors.defaultThreadFactory());\n \n ThreadPoolExecutor executor = (ThreadPoolExecutor)\n (MAX_THREADS == Integer.MAX_VALUE\n ? Executors.newCachedThreadPool(threadFactory)\n : Executors.newFixedThreadPool(MAX_THREADS, threadFactory));\n \n AsynchronousChannelProvider provider =\n AsynchronousChannelProvider.provider();\n \n AsynchronousChannelGroup group =\n provider.openAsynchronousChannelGroup(executor);\n \n log.log(Level.INFO, \"ChannelGroup is a {0}\", group.getClass());\n \n startSignal = new CountDownLatch(NUM_CLIENTS);\n doneSignal = new CountDownLatch(NUM_CLIENTS);\n \n log.log(Level.INFO,\n \"Prestarting {0,number,integer} threads\", NUM_THREADS);\n \n executor.setCorePoolSize(NUM_THREADS);\n executor.prestartAllCoreThreads();\n \n log.log(Level.INFO,\n \"Connecting {0,number,integer} clients\", NUM_CLIENTS);\n \n Set<EchoClient> clients = new HashSet<EchoClient>(NUM_CLIENTS);\n \n for (int i = 0; i < NUM_CLIENTS; ++i) {\n EchoClient client = new EchoClient(group);\n clients.add(client);\n client.connect();\n }\n \n startSignal.await();\n \n log.info(\"Starting test\");\n startTime = System.nanoTime();\n \n for (EchoClient client : clients)\n client.start();\n \n doneSignal.await();\n \n long ops = NUM_CLIENTS * NUM_MSGS * 2;\n long elapsed = System.nanoTime() - startTime;\n log.log(Level.INFO, \"Bytes read: {0} written:{1}\",\n new Object[] {\n totalBytesRead.get(),\n totalBytesWritten.get()\n });\n log.log(Level.INFO, \"{0} ops in {1} seconds = {2} ops/sec\",\n new Object[] {\n ops,\n TimeUnit.NANOSECONDS.toSeconds(elapsed),\n TimeUnit.SECONDS.toNanos(ops) / elapsed\n });\n \n group.shutdown();\n log.info(\"Awaiting group termination\"); \n if (! group.awaitTermination(5, TimeUnit.SECONDS)) {\n log.warning(\"Forcing group termination\");\n group.shutdownNow();\n if (! group.awaitTermination(5, TimeUnit.SECONDS)) {\n log.warning(\"Group could not be forcibly terminated\");\n }\n }\n if (group.isTerminated())\n log.info(\"Group terminated\");\n \n log.info(\"Terminating executor\");\n executor.shutdown();\n log.info(\"Awaiting executor termination\"); \n if (! executor.awaitTermination(5, TimeUnit.SECONDS)) {\n log.warning(\"Forcing executor termination\");\n executor.shutdownNow();\n if (! executor.awaitTermination(5, TimeUnit.SECONDS)) {\n log.warning(\"Executor could not be forcibly terminated\");\n }\n }\n if (executor.isTerminated())\n log.info(\"Executor terminated\");\n }", "@Override\n public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {\n }", "static void registerDone(ChannelFuture future) {\n/* 135 */ if (!future.isSuccess()) {\n/* 136 */ Channel childChannel = future.channel();\n/* 137 */ if (childChannel.isRegistered()) {\n/* 138 */ childChannel.close();\n/* */ } else {\n/* 140 */ childChannel.unsafe().closeForcibly();\n/* */ } \n/* */ } \n/* */ }", "@Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n ctx.fireChannelActive();\n\n ctx.executor().scheduleAtFixedRate(new Runnable() {\n @Override\n public void run() {\n log.info(\"send heart beat\");\n HeartBeat heartBeat = new HeartBeat();\n ctx.writeAndFlush(heartBeat);\n }\n }, 0, 5, TimeUnit.SECONDS);\n }", "protected EventExecutor executor()\r\n/* 27: */ {\r\n/* 28: 58 */ EventExecutor e = super.executor();\r\n/* 29: 59 */ if (e == null) {\r\n/* 30: 60 */ return channel().eventLoop();\r\n/* 31: */ }\r\n/* 32: 62 */ return e;\r\n/* 33: */ }", "@Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n }", "@Override\n\t\tpublic void operationComplete(ChannelFuture arg0) throws Exception {\n\t\t\t\n\t\t}", "public static void main(String[] args) throws Exception {\r\n\r\n EventLoopGroup group = new NioEventLoopGroup();\r\n try {\r\n Bootstrap b = new Bootstrap();\r\n b.group(group)\r\n .channel(NioSocketChannel.class)\r\n .handler(new ClientInitializer());\r\n\r\n // Start the connection attempt.\r\n Channel ch = b.connect(HOST, PORT).sync().channel();\r\n\r\n // Read commands from the stdin.\r\n ChannelFuture lastWriteFuture = null;\r\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\r\n RandomString gen = new RandomString(10);\r\n \t\tint k=3;\r\n \t\tSystem.out.println(\"Prime number: \");\r\n \t\tint temp = Integer.parseInt(in.readLine());\r\n int N=2*temp+1;\r\n String s = gen.nextString();\r\n System.out.println(\"Username: \");\r\n String I=in.readLine();\r\n System.out.println(\"Password: \");\r\n String p=in.readLine();\r\n int g = 11;\r\n System.out.println(\"Generator g = \" + g);\r\n double x = hash(s+p);\r\n System.out.println(\"x=\"+x);\r\n double v = (Math.pow(g, x))%N;\r\n System.out.println(\"v=\"+v);\r\n //FirstPhase\r\n System.out.println(\"Sending to server I,s,v,N\");\r\n lastWriteFuture = ch.writeAndFlush(\"fi,\"+I+\",\"+s+\",\"+Double.toString(v)+\",\"+Integer.toString(N)+\"\\r\\n\");\r\n lastWriteFuture.sync();\r\n System.out.println(\"Data send\");\r\n int a= (int)Math.random()*1000;\r\n System.out.println(\"Generating a=\"+a);\r\n int A = (int) (Math.pow(g,a)%N);\r\n System.out.println(\"Calculating A=g^a mod N=\"+A);\r\n System.out.println(\"Sending to server I,A\");\r\n lastWriteFuture = ch.writeAndFlush(\"ft,\"+I+\",\"+A+\"\\r\\n\");\r\n lastWriteFuture.sync();\r\n System.out.println(\"Waiting server to respond...\");\r\n while(!ClientHandler.gotb){\r\n \t\r\n }\r\n \r\n double B = ClientHandler.B;\r\n double K =0.0;\r\n System.out.println(\"Recieving from server B=\"+B);\r\n double u = hash(Integer.toString(A)+Double.toString(B));\r\n System.out.println(\"Calculating U=h(A,B)=\"+u);\r\n System.out.println(\"Waiting server to respond...\");\r\n lastWriteFuture = ch.writeAndFlush(\"neddK\"+\"\\r\\n\");\r\n lastWriteFuture.sync();\r\n while(!ClientHandler.gotk){\r\n \t\r\n }\r\n if (u!=0.0){\r\n double servK = ClientHandler.K;\r\n double S=(Math.pow((B-k*((Math.pow(g,x))%N)),(a+u*x)))%N;\r\n K=hash(Double.toString(S));\r\n System.out.println(\"Calculating K=h(((B-k*(g^x mod N))^a+u*x) mod N = \"+K);\r\n if(servK==K){\r\n \t System.out.println(\"OK!\");\r\n }\r\n }\r\n //SecondPhase\r\n double M = hash((((int)hash(Integer.toString(N))^(int)hash(Integer.toString(g))))+Double.toString(hash(I))+s+Integer.toString(A)+Double.toString(B)+Double.toString(K));\r\n System.out.println(\"Calculating M=\"+M);\r\n System.out.println(\"Waiting server to respond...\");\r\n lastWriteFuture = ch.writeAndFlush(\"neddR\"+\"\\r\\n\");\r\n lastWriteFuture.sync();\r\n while(!ClientHandler.gotr){\r\n \t\r\n }\r\n if(hash(Integer.toString(A)+Double.toString(M)+Double.toString(K))==ClientHandler.R)\r\n \tSystem.out.println(\"Sucsess!\");\r\n else\r\n \tSystem.out.println(\"Error!\");\r\n lastWriteFuture = ch.writeAndFlush(\"bye\");\r\n lastWriteFuture.sync();\r\n /*for (;;) {\r\n String line = in.readLine();\r\n if (line == null) {\r\n break;\r\n }\r\n\r\n // Sends the received line to the server.\r\n lastWriteFuture = ch.writeAndFlush(line + \"\\r\\n\");\r\n\r\n // If user typed the 'bye' command, wait until the server closes\r\n // the connection.\r\n if (\"bye\".equals(line.toLowerCase())) {\r\n ch.closeFuture().sync();\r\n break;\r\n }\r\n }*/\r\n\r\n // Wait until all messages are flushed before closing the channel.\r\n if (lastWriteFuture != null) {\r\n lastWriteFuture.sync();\r\n }\r\n } finally {\r\n // The connection is closed automatically on shutdown.\r\n group.shutdownGracefully();\r\n }\r\n }", "@Override\n\tpublic void channelReadComplete(ChannelHandlerContext ctx) throws Exception {\n\t}", "@Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n super.channelActive(ctx);\n \n }", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n //4. Add ChannelHandler to intercept events and allow to react on them\n ch.pipeline().addLast(new ChannelHandlerAdapter() {\n @Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n //5. Write message to client and add ChannelFutureListener to close connection once message written\n ctx.write(buf.duplicate()).addListener(ChannelFutureListener.CLOSE);\n }\n });\n }", "public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {\n/* 313 */ processPendingReadCompleteQueue();\n/* 314 */ ctx.fireChannelReadComplete();\n/* */ }", "public ChannelFuture method_4097() {\n return null;\n }", "Channel channel() {\n return channel;\n }", "protected EventExecutor newChild(ThreadFactory threadFactory, Object... args) throws Exception {\n/* 57 */ return (EventExecutor)new LocalEventLoop(this, threadFactory);\n/* */ }", "@Override\n public void operationComplete(ChannelFuture future) {\n logger.info(\"channel close!\");\n future.channel().disconnect();\n future.channel().close();\n }", "public LocalEventLoopGroup(int nThreads, ThreadFactory threadFactory) {\n/* 51 */ super(nThreads, threadFactory, new Object[0]);\n/* */ }", "public ClientWorker(ServerSocketChannel serverChannel){\n this.serverChannel = serverChannel;\n }", "public ChannelFuture method_4130() {\n return null;\n }", "public ChannelFuture method_4126() {\n return null;\n }", "public ChannelFuture method_4092() {\n return null;\n }", "public ChannelFuture method_4120() {\n return null;\n }", "SocketChannel getChannel();", "@Override\n protected void initChannel(NioSocketChannel nioSocketChannel) throws Exception {\n nioSocketChannel.pipeline().addLast(new FirstClientHandler());\n }", "@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, WsClientMessage msg) throws Exception {\n\t}", "@Override\r\n\t\tpublic void operationComplete(ChannelProgressiveFuture future) {\n }", "@Override\r\n\tpublic void doStart() {\n\t\tbootstrap.group(this.bossEventLoopGroup, this.workerEventLoopGroup)\r\n\t\t\t\t .channel(NioServerSocketChannel.class)\r\n\t\t\t\t //允许在同一端口上启动同一服务器的多个实例,只要每个实例捆绑一个不同的本地IP地址即可\r\n .option(ChannelOption.SO_REUSEADDR, true)\r\n //用于构造服务端套接字ServerSocket对象,标识当服务器请求处理线程全满时,用于临时存放已完成三次握手的请求的队列的最大长度\r\n// .option(ChannelOption.SO_BACKLOG, 1024) // determining the number of connections queued\r\n\r\n //禁用Nagle算法,即数据包立即发送出去 (在TCP_NODELAY模式下,假设有3个小包要发送,第一个小包发出后,接下来的小包需要等待之前的小包被ack,在这期间小包会合并,直到接收到之前包的ack后才会发生)\r\n .childOption(ChannelOption.TCP_NODELAY, true)\r\n //开启TCP/IP协议实现的心跳机制\r\n .childOption(ChannelOption.SO_KEEPALIVE, true)\r\n .childHandler(newInitializerChannelHandler());\r\n\t\ttry {\r\n\t\t\tInetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(),getPort());\r\n\t\t\tchannelFuture = bootstrap.bind(getPort());\r\n//\t\t\tchannelFuture = bootstrap.bind(serverAddress).sync();\r\n\t\t\tLOGGER.info(\"connector {} started at port {},protocal is {}\",getName(),getPort(),getSchema());\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tLOGGER.error(\"error happen when connector {} starting\",getName());\r\n\t\t}\r\n\t}", "@Override\n public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {\n cause.printStackTrace();\n ChannelFuture close = ctx.close();\n close.addListener((ChannelFutureListener) future -> System.out.println(\"server channel closed!!!\"));\n }", "private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}", "private Channel connect(ChannelInitializer<SocketChannel> handler) {\n // Configure worker pools and buffer allocator\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n Bootstrap b = new Bootstrap();\n b.group(workerGroup);\n b.channel(NioSocketChannel.class);\n b.option(ChannelOption.SO_KEEPALIVE, true);\n // TODO(user): Evaluate use of pooled allocator\n b.option(ChannelOption.ALLOCATOR, UnpooledByteBufAllocator.DEFAULT);\n\n // Install the handler\n b.handler(handler);\n\n // Connect and wait for connection to be available\n ChannelFuture channelFuture = b.connect(host, port);\n try {\n // Wait for the connection\n channelFuture.get(5, TimeUnit.SECONDS);\n channel = channelFuture.channel();\n ChannelFuture closeFuture = channel.closeFuture();\n closeFuture.addListener(new WorkerCleanupListener(b.group()));\n return channel;\n } catch (TimeoutException te) {\n throw new IllegalStateException(\"Timeout waiting for connection to \" + host + \":\" + port, te);\n } catch (Throwable t) {\n throw new IllegalStateException(\"Error connecting to \" + host + \":\" + port, t);\n }\n }", "public LocalEventLoopGroup(int nThreads) {\n/* 41 */ this(nThreads, null);\n/* */ }", "public void setChannelFuture(ChannelFuture channelFuture) {\n this.channelFuture = channelFuture;\n }", "public DefaultChannelProgressivePromise(Channel channel)\r\n/* 16: */ {\r\n/* 17: 42 */ this.channel = channel;\r\n/* 18: */ }", "public NioDatagramChannel() {\n/* 116 */ this(newSocket(DEFAULT_SELECTOR_PROVIDER));\n/* */ }", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n NettyCodecAdapter adapter = new NettyCodecAdapter();\n\n ch.pipeline()\n .addLast(\"logging\", new LoggingHandler(LogLevel.INFO))//for debug\n .addLast(\"decoder\", adapter.getDecoder())\n// .addLast(\"http-aggregator\", new HttpObjectAggregator(65536))\n .addLast(\"encoder\", adapter.getEncoder())\n// .addLast(\"http-chunked\", new ChunkedWriteHandler())\n// .addLast(\"server-idle-handler\", new IdleStateHandler(0, 0, 60 * 1000, MILLISECONDS))\n .addLast(\"handler\", nettyServerHandler);\n }", "@Override\n\t\tpublic void operationComplete(ChannelFuture future) throws Exception {\n\t\t\tSystem.out.println(\"Channel closed\");\n\t\t\t// @TODO if lost, try to re-establish the connection\n\t\t}", "@Override\n protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception { // (4)\n Channel incoming = ctx.channel();\n\n String remoteAddress = incoming.remoteAddress().toString();\n logger.info(\"[BudsRpc ][Registry-server] receive data=[{}] from {}\", msg, remoteAddress);\n\n String[] cmd = msg.split(\"\\r\\n\");\n ActionEnum action = ActionEnum.getAction(cmd[0]);\n String service = cmd[1];\n String address = cmd[2];\n String port = cmd[3];\n\n switch (action) {\n case ACTION_REGISTRY:\n Set<Channel> channelSet = registryMap.get(service);\n if (channelSet == null) {\n channelSet = new HashSet<>();\n registryMap.put(service, channelSet);\n }\n channelSet.add(incoming);\n\n Set<String> serviceSet = providerMap.get(remoteAddress);\n if (serviceSet == null) {\n serviceSet = new HashSet<>();\n providerMap.put(remoteAddress, serviceSet);\n }\n serviceSet.add(service);\n\n // 通知订阅者\n notify(service);\n\n case ACTION_SUBSCRIBE:\n ChannelGroup channelGroup = subscribMap.get(service);\n if (channelGroup == null) {\n channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);\n subscribMap.put(service, channelGroup);\n }\n channelGroup.add(incoming);\n break;\n\n }\n\n for (Channel channel : channels) {\n if (channel != incoming) {\n channel.writeAndFlush(\"[\" + incoming.remoteAddress() + \"]\" + msg + \"\\n\");\n } else {\n channel.writeAndFlush(\"[you]\" + msg + \"\\n\");\n }\n }\n }", "@Override\n public void completed(Integer result, AsynchronousSocketChannel channel ) {\n }", "public SocketChannel getChannel() { return null; }", "public void initChannel() {\n //or channelFactory\n bootstrap().channel(NioServerSocketChannel.class);\n }", "@Override\n\tpublic void channelReadComplete(ChannelHandlerContext ctx) throws Exception {\n\t\tsuper.channelReadComplete(ctx);\n\t}", "@Override\n public int getChannel()\n {\n return channel;\n }", "@Override\n\tpublic void channelRead(ChannelHandlerContext ctx, Object msg)\n\t\t\tthrows Exception {\n\t\thandleRequestWithsingleThread(ctx, msg);\n\t}", "public static void main(String[] args){ new ThreadPoolBlockingServer().processRequests(); }", "@Override\n\tprotected void initInternal() throws LifecycleException {\n bootstrap = new ServerBootstrap();\n //初始化\n bootstrap.group(bossGroup, workGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>(){\n\n\t @Override\n\t protected void initChannel(SocketChannel ch) throws Exception {\n\t // TODO Auto-generated method stub\n\t //目前是每次new出来 由于4.0不允许加入加入一个ChannelHandler超过一次,除非它由@Sharable注解,或者每次new出来\n\t //ch.pipeline().addLast(\"idleChannelTester\", new IdleStateHandler(10, 5, 30));\n\t //ch.pipeline().addLast(\"keepaliveTimeoutHandler\", keepaliveTimeoutHandler);\n\t \t \n\t // server端接收到的是httpRequest,所以要使用HttpRequestDecoder进行解码\n\t ch.pipeline().addLast(\"http-encoder\", new HttpRequestDecoder()); \n\t //将解析出来的http报文的数据组装成为封装好的httpRequest对象 \n\t ch.pipeline().addLast(\"http-aggregator\", new HttpObjectAggregator(1024 * 1024));\n\t // server端发送的是httpResponse,所以要使用HttpResponseEncoder进行编码\n\t ch.pipeline().addLast(\"http-decoder\", new HttpResponseEncoder());\n\t //主要用于处理大数据流\n\t ch.pipeline().addLast(\"http-chunkedWriter\", new ChunkedWriteHandler()); \n\t //加强业务逻辑处理效率\n\t if(null == eventExecutor){\n\t \tch.pipeline().addLast(\"http-processor\",new HttpHandler()); \n\t }else {\n\t\t ch.pipeline().addLast(eventExecutor,\"http-processor\",new HttpHandler()); \n\t }\n\t \n\t /**\n\t // 这里只允许增加无状态允许共享的ChannelHandler,对于有状态的channelHandler需要重写\n\t // getPipelineFactory()方法\n\t for (Entry<String, ChannelHandler> channelHandler : channelHandlers.entrySet()) {\n\t ch.pipeline().addLast(channelHandler.getKey(), channelHandler.getValue());\n\t }\n\t \n\t **/\n\t }\n \n }) \n .option(ChannelOption.SO_BACKLOG, 1024000)\n .option(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.TCP_NODELAY, true) //tcp\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\t}", "public static void main(String[] args) throws Exception {\n EventLoopGroup group = new NioEventLoopGroup();\n\n try {\n\n // client use Bootstrap instead of ServerBootstrap\n Bootstrap bootstrap = new Bootstrap();\n\n bootstrap.group(group)\n .channel(NioSocketChannel.class)\n .handler(new ChannelInitializer<SocketChannel>() {\n @Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline()\n .addLast(new ProtobufEncoder())\n .addLast(new NettyClientHandler());\n }\n });\n\n System.out.println(\"...client server ok\");\n\n // netty async model\n // connect to server\n ChannelFuture channelFuture = bootstrap.connect(\"127.0.0.1\", 6668).sync();\n\n channelFuture.channel().closeFuture().sync();\n\n } finally {\n group.shutdownGracefully();\n }\n\n }", "public final ChannelFuture close(ChannelPromise promise) {\n/* 549 */ runPendingTasks();\n/* 550 */ ChannelFuture future = super.close(promise);\n/* */ \n/* */ \n/* 553 */ finishPendingTasks(true);\n/* 554 */ return future;\n/* */ }", "public void run() throws InterruptedException {\n final NioEventLoopGroup bossGroup = new NioEventLoopGroup(serverConfig.bossGroupSize);\n final NioEventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n ServerBootstrap bootStrap = new ServerBootstrap();\n bootStrap.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .handler(new LoggingHandler(LogLevel.INFO))\n // SO_BACKLOG : The maximum queue length for incoming connections.\n .option(ChannelOption.SO_BACKLOG, serverConfig.backlogSize)\n // TCP_NODELAY: option to disable Nagle's algorithm to achieve lower latency on every packet sent\n .option(ChannelOption.TCP_NODELAY, serverConfig.tcpNodelay)\n // SO_KEEPALIVE: option to enable keep-alive packets for a socket connection\n .childOption(ChannelOption.SO_KEEPALIVE, serverConfig.keepAlive)\n .childHandler(new HttpServerChannelInitializer(serverConfig, handlerFactory));\n\n // bind to port\n final ChannelFuture channelFuture = bootStrap.bind(serverConfig.port)\n .sync();\n\n // Wait until the server socket is closed.\n channelFuture.channel()\n .closeFuture()\n .sync();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }", "public static void main(String[] args) throws InterruptedException {\n\r\n FutureService futureService = new FutureService();\r\n Future<String> future = futureService.submit(() -> {\r\n try {\r\n Thread.sleep(10_000);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n return \"FINISH\";\r\n }, System.out::println);\r\n System.out.println(\"================\");\r\n System.out.println(\"do other thing.\");\r\n Thread.sleep(1_000L);\r\n System.out.println(\"================\");\r\n\r\n// System.out.println(future.get());\r\n }", "protected EventExecutor executor()\r\n/* 49: */ {\r\n/* 50: 87 */ return this.executor;\r\n/* 51: */ }", "@Override\n protected void initChannel (SocketChannel ch) throws Exception {\n // can utilize channel to push message to different client since one channel correspond to one client\n System.out.println(\"client socket channel hashcode = \" + ch.hashCode());\n ch.pipeline().addLast(new NettyServerHandler());\n }", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n String body = (String) msg;\n System.out.println(body);\n System.out.println(\"第\"+ ++count + \"次收到服务器回应\");\n }", "void handleSubchannelTerminated() {\n executorPool.returnObject(executor);\n terminatedLatch.countDown();\n }", "@Service\npublic interface BugFetch {\n @Async\n void fetch(BugzillaConnector conn) throws InterruptedException;\n}", "public static void main(String[] args) throws Exception {\n FutureTask<String> futureTask = new FutureTask<String>(new Callable<String>() {\n @Override\n public String call() throws Exception {\n Thread.sleep(10000);\n System.out.println(\"thread done ...\");\n return \"hello world\";\n }\n });\n futureTask.run();\n// executorService.submit(futureTask);\n System.out.println(futureTask.get());\n// executorService.shutdown();\n }", "@Override\n public ScheduledExecutorService getSchedExecService() {\n return channelExecutor;\n }", "public ChannelPipeline method_4119() {\n return null;\n }", "private TestAcceptFactory() {\n this._pool = new DirectExecutor();\n }", "public JsonHttpChannel() {\n this.defaultConstructor = new JsonHttpEventFactory();\n }", "public void run() throws Exception {\n InputStream certChainFile = this.getClass().getResourceAsStream(\"/ssl/server.crt\");\n InputStream keyFile = this.getClass().getResourceAsStream(\"/ssl/pkcs8_server.key\");\n InputStream rootFile = this.getClass().getResourceAsStream(\"/ssl/ca.crt\");\n SslContext sslCtx = SslContextBuilder.forServer(certChainFile, keyFile).trustManager(rootFile).clientAuth(ClientAuth.REQUIRE).build();\n //主线程(获取连接,分配给工作线程)\n EventLoopGroup bossGroup = new NioEventLoopGroup(1);\n //工作线程,负责收发消息\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n try {\n //netty封装的启动类\n ServerBootstrap b = new ServerBootstrap();\n //设置线程组,主线程和子线程\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .handler(new LoggingHandler(LogLevel.INFO))\n //初始化处理器\n .childHandler(new Initializer(sslCtx));\n ChannelFuture f = b.bind(m_port).sync();\n f.channel().closeFuture().sync();\n } finally {\n //出现异常以后,优雅关闭线程组\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n }", "@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, RpcRequest msg) throws Exception {\n\t\tRpcResponse response = new RpcResponse();\n\t\tresponse.setRequestId(msg.getRequestId());\n\t\ttry {\n\t\t\tObject result = handle(msg);\n\t\t\tresponse.setResult(result);\n\t\t} catch (Throwable t) {\n\t\t\tLOGGER.debug(\"handle ocurred error ==> {}\", t);\n\t\t\tresponse.setError(t);\n\t\t}\n\t\tctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);//写完然后关闭channel\n\t}", "public interface AsyncChannelEventHandler {\n\tstatic final int CHANNEL_CLOSED = 0xFFFFFFFF;\n\tDisruptedReactor getReactor();\n\tdefault int processRead(SelectionKey key) throws IOException { return 0; }\n\tdefault int processWrite(SelectionKey key) throws IOException { return 0; }\n\tdefault int processAccept(SelectionKey key) throws IOException { return 0; }\n\tdefault int processConnect(SelectionKey key) throws IOException { return 0; }\n\t// called before actual key.channel().close()\n\tdefault void onClose(SelectionKey key) {};\n}", "@Override\n\tpublic void channelReadComplete(ChannelHandlerContext ctx) throws Exception {\n\t\tLog.i(\"MySocketHandler\", \"channelReadComplete\");\n\t\tsuper.channelReadComplete(ctx);\n\t}", "@Override\n public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {\n// If the event indicates that\n// the handshake was successful removes the HttpRequestHandler from the\n// ChannelPipeline because no further HTTP messages will be received\n if (evt instanceof WebSocketServerProtocolHandler.HandshakeComplete) {\n ctx.pipeline().remove(HttpRequestHandler.class);\n //通道组的所有通道的写操作,简化了一个通道组里面所有通道的写操作,然后把当前通道也加入通道组\n group.writeAndFlush(\"clent \" + ctx.channel() + \"joined!\");\n group.add(ctx.channel());\n } else {\n super.userEventTriggered(ctx, evt);\n }\n }", "@Override\n\tprotected void initChannel(SocketChannel ch) throws Exception {\n\t\tch.pipeline().addLast(new DisardServerHandle());\n\t}", "@Override\n protected void initChannel(SocketChannel ch){\n ch.pipeline().addLast(new IdleStateHandler(3,5,7, TimeUnit.SECONDS));\n ch.pipeline().addLast(new ServerHandler());\n }", "public SocketChannel getChannel() {\n return channel;\n }", "@Override\n\t\t\t\t\t\tpublic void channelActive(ChannelHandlerContext ctx) {\n\t\t\t\t\t\t\tSystem.out.println(RestResult.success(\"channel active!\"));\n\t\t\t\t\t\t}", "public DefaultChannelProgressivePromise(Channel channel, EventExecutor executor)\r\n/* 21: */ {\r\n/* 22: 52 */ super(executor);\r\n/* 23: 53 */ this.channel = channel;\r\n/* 24: */ }", "@Override\n public void run() {\n handleClientRequest();\n }", "public Channel(String name) {\n this.name = name;\n q = new ArrayBlockingQueue(1);\n senderMonitor = new Object();\n\n }", "@Override\n\tpublic void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {\n\t\tLog.i(\"MySocketHandler\", \"close\");\n\t\tsuper.close(ctx, promise);\n\t}", "@Override\n public void completed(IoFuture<AsynchronousSocketChannel, Void> result)\n {\n try {\n try {\n AsynchronousSocketChannel newChannel = result.getNow();\n logger.log(Level.FINER, \"Accepted {0}\", newChannel);\n \n handler.newConnection(newChannel, descriptor);\n \n // Resume accepting connections\n acceptFuture = acceptor.accept(this);\n \n } catch (ExecutionException e) {\n throw (e.getCause() == null) ? e : e.getCause();\n }\n } catch (CancellationException e) { \n logger.logThrow(Level.FINE, e, \"acceptor cancelled\"); \n //ignore\n } catch (Throwable e) {\n SocketAddress addr = null;\n try {\n addr = acceptor.getLocalAddress();\n } catch (IOException ioe) {\n // ignore\n }\n logger.logThrow(\n \t\t Level.SEVERE, e, \"acceptor error on {0}\", addr);\n \n // TBD: take other actions, such as restarting acceptor?\n }\n \t}", "public void run()\n {\n // open selector\n try\n {\n _selector = Selector.open();\n }\n catch (Exception exception)\n {\n System.out.println(\"selector open \");\n System.exit(-1);\n }\n \n // create reactor\n if (ProviderPerfConfig.useReactor()) // use UPA VA Reactor\n {\n _reactorOptions.clear();\n if ((_reactor = ReactorFactory.createReactor(_reactorOptions, _errorInfo)) == null)\n {\n System.out.printf(\"Reactor creation failed: %s\\n\", _errorInfo.error().text());\n System.exit(ReactorReturnCodes.FAILURE);\n }\n \n // register selector with reactor's reactorChannel.\n try\n {\n _reactor.reactorChannel().selectableChannel().register(_selector,\n SelectionKey.OP_READ,\n _reactor.reactorChannel());\n }\n catch (ClosedChannelException e)\n {\n System.out.println(\"selector register failed: \" + e.getLocalizedMessage());\n System.exit(ReactorReturnCodes.FAILURE);\n }\n }\n \n _directoryProvider.serviceName(ProviderPerfConfig.serviceName());\n _directoryProvider.serviceId(ProviderPerfConfig.serviceId());\n _directoryProvider.openLimit(ProviderPerfConfig.openLimit());\n _directoryProvider.initService(_xmlMsgData);\n\n _loginProvider.initDefaultPosition();\n _loginProvider.applicationId(applicationId);\n _loginProvider.applicationName(applicationName);\n\n if (!_dictionaryProvider.loadDictionary(_error))\n {\n System.out.println(\"Error loading dictionary: \" + _error.text());\n System.exit(CodecReturnCodes.FAILURE);\n }\n \n getProvThreadInfo().dictionary(_dictionaryProvider.dictionary());\n \n _reactorInitialized = true;\n\n // Determine update rates on per-tick basis\n long nextTickTime = initNextTickTime();\n \n // this is the main loop\n while (!shutdown())\n {\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n \tif (nextTickTime <= currentTime())\n \t{\n \t nextTickTime = nextTickTime(nextTickTime);\n \t\tsendMsgBurst(nextTickTime);\n \t\t_channelHandler.processNewChannels();\n \t}\n\t \t_channelHandler.readChannels(nextTickTime, _error);\n\t \t_channelHandler.checkPings();\n }\n else // use UPA VA Reactor\n {\n if (nextTickTime <= currentTime())\n {\n nextTickTime = nextTickTime(nextTickTime);\n sendMsgBurst(nextTickTime);\n }\n\n Set<SelectionKey> keySet = null;\n\n // set select time \n try\n {\n int selectRetVal;\n long selTime = (long)(selectTime(nextTickTime) / _divisor);\n \n if (selTime <= 0)\n selectRetVal = _selector.selectNow();\n else\n selectRetVal = _selector.select(selTime);\n \n if (selectRetVal > 0)\n {\n keySet = _selector.selectedKeys();\n }\n }\n catch (IOException e1)\n {\n System.exit(CodecReturnCodes.FAILURE);\n }\n\n // nothing to read or write\n if (keySet == null)\n continue;\n\n Iterator<SelectionKey> iter = keySet.iterator();\n while (iter.hasNext())\n {\n SelectionKey key = iter.next();\n iter.remove();\n if(!key.isValid())\n continue;\n if (key.isReadable())\n {\n int ret;\n \n // retrieve associated reactor channel and dispatch on that channel \n ReactorChannel reactorChnl = (ReactorChannel)key.attachment();\n \n /* read until no more to read */\n while ((ret = reactorChnl.dispatch(_dispatchOptions, _errorInfo)) > 0 && !shutdown()) {}\n if (ret == ReactorReturnCodes.FAILURE)\n {\n if (reactorChnl.state() != ReactorChannel.State.CLOSED &&\n reactorChnl.state() != ReactorChannel.State.DOWN_RECONNECTING)\n {\n System.out.println(\"ReactorChannel dispatch failed\");\n reactorChnl.close(_errorInfo);\n System.exit(CodecReturnCodes.FAILURE);\n }\n }\n }\n }\n }\n }\n\n shutdownAck(true);\n }", "public interface SocketControl {\n\n /**\n * 获取服务的IP和端口\n * @return 格式:ip:port,如127.0.0.1:8080\n */\n String getIpPort();\n\n /**\n * 获取服务的ServiceId\n * @return 服务的ServiceId\n */\n String getServiceId();\n\n /**\n * 获取服务的InstanceId\n * @return 服务的InstanceId\n */\n String getInstanceId();\n\n\n /**\n * 获取模块名称,也可以直接调用getIpPort()\n * @return 模块名称\n */\n String getModelName();\n\n\n /**\n * 模块下连接的标示\n * @param channel 管道对象\n * @return uk\n */\n String getUniqueKey(Channel channel);\n\n\n /**\n * 模块下连接的标示\n * @param ctx 管道对象\n * @return uk\n */\n String getUniqueKey(ChannelHandlerContext ctx);\n\n\n /**\n * 绑定key\n * @param ctx 当前连接对象\n * @param key key\n */\n void bindKey(ChannelHandlerContext ctx,String key);\n\n /**\n * 绑定key\n * @param ctx 当前连接对象\n * @param key key\n */\n void bindKey(Channel ctx,String key);\n\n /**\n * 获取key\n * @param ctx 当前链接对象\n * @return key\n */\n String getKey(Channel ctx);\n\n /**\n * 获取key\n * @param ctx 当前链接对象\n * @return key\n */\n String getKey(ChannelHandlerContext ctx);\n\n\n /**\n * 重置心跳时间\n * @param ctx 当前连接对象\n * @param heartTime 心跳时间(秒)\n */\n void resetHeartTime(Channel ctx,int heartTime);\n\n\n\n}", "public ChannelProgressivePromise await()\r\n/* 106: */ throws InterruptedException\r\n/* 107: */ {\r\n/* 108:138 */ super.await();\r\n/* 109:139 */ return this;\r\n/* 110: */ }", "@Override\n public void operationComplete(ChannelFuture future) throws Exception {\n if (!future.isSuccess()) {\n Throwable cause = future.cause();\n // Do something\n }\n }", "public static void startServer() throws InterruptedException {\n\t\tEventLoopGroup bossGroup = new NioEventLoopGroup();\n\n\t\t// Accept Channel Worker Thread Group\n\t\tNioEventLoopGroup workerGroup = new NioEventLoopGroup();\n\n\t\t// Set I/O percentage\n\t\tworkerGroup.setIoRatio(50);\n\n\t\ttry {\n\t\t\tServerBootstrap bootstrap = new ServerBootstrap();\n\n\t\t\t// Set Time Loop Object, BossGroup for Accept Event, WorkerGroup for Connected I/O\n\t\t\tbootstrap.group(bossGroup, workerGroup);\n\n\t\t\t// for Create new Connect and create serverSocketChannel Factory\n\t\t\tbootstrap.channel(NioServerSocketChannel.class);\n\n\t\t\t// pre Add inboundHandler for Accept channel pipeline\n\t\t\tbootstrap.childHandler(new ChannelInitializer<SocketChannel>() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void initChannel(SocketChannel channel) {\n\t\t\t\t\t\t\tSystem.err.println(\"******** GBT BOSS Server Start **********\");\n\t\t\t\t\t\t\tchannel.config().setAutoRead(true);\n\t\t\t\t\t\t\t// explain http request message handler\n\t\t\t\t\t\t\tchannel.pipeline().addLast(new HttpRequestDecoder());\n\n\t\t\t\t\t\t\t// encode response into http response message sending\n\t\t\t\t\t\t\tchannel.pipeline().addLast(new HttpResponseEncoder());\n\n\t\t\t\t\t\t\t// custom define Http handler\n\t\t\t\t\t\t\tchannel.pipeline().addLast(new GbtBossHttpServerHandler());\n\t\t\t\t\t\t}\n\t\t\t\t\t}).option(ChannelOption.SO_BACKLOG, 128) // 流控\n\t\t\t\t\t.childOption(ChannelOption.SO_KEEPALIVE, true)\t;\n\n\t\t\t// bind method will created serverChannel, and register current channel to EventLoop\n\t\t\tChannelFuture future = bootstrap.bind(serverPort).sync();\n\n\t\t\tSystem.err.println(\"******** GBT BOSS Server run ********\");\n\t\t\t// block util close serverChannel\n\t\t\tfuture.channel().closeFuture().sync();\n\t\t} finally {\n\t\t\tworkerGroup.shutdownGracefully();\n\t\t\tbossGroup.shutdownGracefully();\n\t\t}\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "private GDMThreadFactory(){}", "@Override\n public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {\n cause.printStackTrace();\n ctx.close();\n }", "@Override\n public void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline().addLast(new OutMessageHandler());\n\n }", "public DisruptorMux() {\r\n\r\n\t\t_executor = Executors.newFixedThreadPool(NUM_EVENT_PROCESSORS);\r\n\r\n\t\t_disruptor = new Disruptor<BundleEvent>(BundleEvent.EVENT_FACTORY,\r\n\t\t\t\t_executor, new SingleThreadedClaimStrategy(RING_SIZE),\r\n\t\t\t\tnew BlockingWaitStrategy());\r\n\r\n\t}", "public void run() {\n clientLogger.info(\"Client \" + name + \" started working\");\n EventLoopGroup group = new NioEventLoopGroup();\n try {\n Bootstrap bootstrap = new Bootstrap()\n .group(group)\n .channel(NioSocketChannel.class)\n .handler(new ClientInitializer());\n Channel channel = bootstrap.connect(host, port).sync().channel();\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\n while (true) {\n channel.write(in.readLine() + \"\\r\\n\");\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n group.shutdownGracefully();\n }\n clientLogger.info(\"Client \" + name + \" finished working\");\n }", "@Override\n public void run() {\n\n }", "public Channel getChannel() {\n return channel;\n }", "public NioDatagramChannel(InternetProtocolFamily ipFamily) {\n/* 132 */ this(newSocket(DEFAULT_SELECTOR_PROVIDER, ipFamily));\n/* */ }", "@Override\r\n public void run() {\n\r\n }", "@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline().addLast(new TimeServerHandler());\n }", "public ChannelProgressivePromise awaitUninterruptibly()\r\n/* 113: */ {\r\n/* 114:144 */ super.awaitUninterruptibly();\r\n/* 115:145 */ return this;\r\n/* 116: */ }", "@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n\n log.info( ctx.channel().id().asLongText()+\"-> channelRead , msg={}\" , msg.getClass().getName());\n\n ctx.fireChannelRead( msg ) ;\n }", "public Channel getChannel()\n {\n return channel;\n }" ]
[ "0.67186415", "0.6465836", "0.6453094", "0.6293637", "0.62570405", "0.6248594", "0.6229412", "0.6219548", "0.6174287", "0.61616224", "0.61444235", "0.61223567", "0.6105966", "0.60558844", "0.60316944", "0.6002795", "0.597009", "0.5966231", "0.59539104", "0.58803564", "0.5878232", "0.5874738", "0.58740956", "0.5870059", "0.58633614", "0.5838775", "0.5800693", "0.57949746", "0.5794555", "0.57763326", "0.5722064", "0.5708153", "0.5707742", "0.56825686", "0.5677807", "0.5673564", "0.56566167", "0.5656116", "0.56552005", "0.5650589", "0.5638221", "0.56379133", "0.56302804", "0.5625545", "0.56108826", "0.56016296", "0.5600985", "0.55940646", "0.55930156", "0.5572066", "0.55691993", "0.55557376", "0.5545391", "0.5541817", "0.55400145", "0.5535395", "0.5532514", "0.5510075", "0.550932", "0.550743", "0.54981947", "0.5496178", "0.5493517", "0.54780316", "0.54768926", "0.5467776", "0.5452449", "0.5412139", "0.5404488", "0.5404149", "0.5388713", "0.5379132", "0.53788084", "0.5377289", "0.5356731", "0.53546447", "0.5345846", "0.5342758", "0.53410316", "0.53379375", "0.5333617", "0.53309226", "0.53309226", "0.53309226", "0.53309226", "0.53309226", "0.53309226", "0.53309226", "0.532972", "0.53274095", "0.5326521", "0.5325549", "0.53152686", "0.5312835", "0.5309663", "0.530742", "0.53047013", "0.53006786", "0.52931684", "0.5285774", "0.52843577" ]
0.0
-1
Base for everything being placed on the board
public interface GameEntity { int getSize(); void update(Board board); boolean isRemoved(); void setRemoved(boolean removed); Command remove(); ThemeableType getType(); Point getPosition(); void setPosition(double x, double y); void setPosition(Point position); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void createBoard();", "Board() {\r\n init();\r\n }", "public abstract void buildMoveData(ChessBoard board);", "public void boardSetUp(){\n\t}", "public Board(String boardName) {\n\n /*\n * Created according to the specs online.\n */\n if (boardName.equals(\"default\")) {\n Ball ball1 = new Ball(new Vect(0, 0), new Geometry.DoublePair(1.25,\n 1.25));\n Gadget circle = new CircleBumper(1, 10, new Gadget[] {});\n Gadget triangle = new TriangleBumper(12, 15, 180, new Gadget[] {});\n Gadget square1 = new SquareBumper(0, 17, new Gadget[] {});\n Gadget square2 = new SquareBumper(1, 17, new Gadget[] {});\n Gadget square3 = new SquareBumper(2, 17, new Gadget[] {});\n Gadget circle1 = new CircleBumper(7, 18, new Gadget[] {});\n Gadget circle2 = new CircleBumper(8, 18, new Gadget[] {});\n Gadget circle3 = new CircleBumper(9, 18, new Gadget[] {});\n this.balls = new Ball[] { ball1 };\n this.gadgets = new Gadget[] { circle, triangle, square1, square2,\n square3, circle1, circle2, circle3, top, bottom, left,\n right };\n\n } else if (boardName.equals(\"absorber\")) {\n Ball ball1 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 10.25, 15.25));\n Ball ball2 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 19.25, 3.25));\n Ball ball3 = new Ball(new Vect(0, 0), new Geometry.DoublePair(1.25,\n 5.25));\n Gadget absorber = new Absorber(0, 18, 20, 2, new Gadget[] {});\n Gadget triangle = new TriangleBumper(19, 0, 90, new Gadget[] {});\n Gadget circle1 = new CircleBumper(1, 10, new Gadget[] { absorber });\n Gadget circle2 = new CircleBumper(2, 10, new Gadget[] { absorber });\n Gadget circle3 = new CircleBumper(3, 10, new Gadget[] { absorber });\n Gadget circle4 = new CircleBumper(4, 10, new Gadget[] { absorber });\n Gadget circle5 = new CircleBumper(5, 10, new Gadget[] { absorber });\n this.balls = new Ball[] { ball1, ball2, ball3 };\n this.gadgets = new Gadget[] { absorber, triangle, circle1, circle2,\n circle3, circle4, circle5, top, left, right, bottom };\n }\n\n else if (boardName.equals(\"flippers\")) {\n Ball ball1 = new Ball(new Vect(0, 0), new Geometry.DoublePair(.25,\n 3.25));\n Ball ball2 = new Ball(new Vect(0, 0), new Geometry.DoublePair(5.25,\n 3.25));\n Ball ball3 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 10.25, 3.25));\n Ball ball4 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 15.25, 3.25));\n Ball ball5 = new Ball(new Vect(0, 0), new Geometry.DoublePair(\n 19.25, 3.25));\n Gadget left1 = new LeftFlipper(0, 8, 90, new Gadget[] {});\n Gadget left2 = new LeftFlipper(4, 10, 90, new Gadget[] {});\n Gadget left3 = new LeftFlipper(9, 8, 90, new Gadget[] {});\n Gadget left4 = new LeftFlipper(15, 8, 90, new Gadget[] {});\n Gadget circle1 = new CircleBumper(5, 18, new Gadget[] {});\n Gadget circle2 = new CircleBumper(7, 13, new Gadget[] {});\n Gadget circle3 = new CircleBumper(0, 5, new Gadget[] { left1 });\n Gadget circle4 = new CircleBumper(5, 5, new Gadget[] {});\n Gadget circle5 = new CircleBumper(10, 5, new Gadget[] { left3 });\n Gadget circle6 = new CircleBumper(15, 5, new Gadget[] { left4 });\n Gadget triangle1 = new TriangleBumper(19, 0, 90, new Gadget[] {});\n Gadget triangle2 = new TriangleBumper(10, 18, 180, new Gadget[] {});\n Gadget right1 = new RightFlipper(2, 15, 0, new Gadget[] {});\n Gadget right2 = new RightFlipper(17, 15, 0, new Gadget[] {});\n Gadget absorber = new Absorber(0, 19, 20, 1, new Gadget[] { right1,\n right2, new Absorber(0, 19, 20, 1, new Gadget[] {}) });\n this.balls = new Ball[] { ball1, ball2, ball3, ball4, ball5 };\n this.gadgets = new Gadget[] { left1, left2, left3, left4, circle1,\n circle2, circle3, circle4, circle5, circle6, triangle1,\n triangle2, right1, right2, absorber, top, bottom, left,\n right };\n } else {\n this.gadgets = new Gadget[] {};\n this.balls = new Ball[] {};\n }\n\n checkRep();\n }", "private void initialiseBoard() {\r\n\t\t//Set all squares to EMPTY\r\n\t\tfor(int x = 0; x < board.getWidth(); x++) {\r\n\t\t\tfor(int y = 0; y < board.getHeight(); y++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(GridSquare.Type.EMPTY), x, y);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Assign player tiles\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_ONE_TILE), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_TWO_TILE), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y);\r\n\t\t\r\n\t\t//Assign Creation tiles\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_ONE_POSITION_X+3, Board.PLAYER_ONE_POSITION_Y+3);\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_TWO_POSITION_X-3, Board.PLAYER_TWO_POSITION_Y-3);\r\n\t\t\r\n\t\t//Assign Out of Bounds tiles\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\t\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\t\r\n\t\t\r\n\t}", "public interface Board {\n\n void setupBoard(int gridSize); //create the initial board\n\n String displayShotsTaken(); //return the board to print to screen showing shots taken, not boat location\n\n String displayMyBoard(); //return players board with ships;\n\n boolean takeShot(Point shot); //take a shot against this board\n\n boolean isGameOver(); //check if game is over.\n}", "@Override\n\tpublic void placementcell() {\n\t\t\n\t}", "private void generateBoard(){\n\t}", "public XOBoard() {\n\t\t// initialise the boards\n\t\tboard = new int[4][4];\n\t\trenders = new XOPiece[4][4];\n\t\tfor (int i = 0; i < 4; i++)\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tboard[i][j] = EMPTY;\n\t\t\t\trenders[i][j] = null;\n\t\t\t}\n\t\tcurrent_player = XPIECE;\n\n\t\t// initialise the rectangle and lines\n\t\tback = new Rectangle();\n\t\tback.setFill(Color.GREEN);\n\t\th1 = new Line();\n\t\th2 = new Line();\n\t\th3 = new Line();\n\t\tv1 = new Line();\n\t\tv2 = new Line();\n\t\tv3 = new Line();\n\t\th1.setStroke(Color.WHITE);\n\t\th2.setStroke(Color.WHITE);\n\t\th3.setStroke(Color.WHITE);\n\t\tv1.setStroke(Color.WHITE);\n\t\tv2.setStroke(Color.WHITE);\n\t\tv3.setStroke(Color.WHITE);\n\n\t\t// the horizontal lines only need the endx value modified the rest of //\n\t\t// the values can be zero\n\t\th1.setStartX(0);\n\t\th1.setStartY(0);\n\t\th1.setEndY(0);\n\t\th2.setStartX(0);\n\t\th2.setStartY(0);\n\t\th2.setEndY(0);\n\t\th3.setStartX(0);\n\t\th3.setStartY(0);\n\t\th3.setEndY(0);\n\n\t\t// the vertical lines only need the endy value modified the rest of the\n\t\t// values can be zero\n\t\tv1.setStartX(0);\n\t\tv1.setStartY(0);\n\t\tv1.setEndX(0);\n\t\tv2.setStartX(0);\n\t\tv2.setStartY(0);\n\t\tv2.setEndX(0);\n\t\tv3.setStartX(0);\n\t\tv3.setStartY(0);\n\t\tv3.setEndX(0);\n\n\t\t// setup the translation of one cell height and two cell heights\n\t\tch_one = new Translate(0, 0);\n\t\tch_two = new Translate(0, 0);\n\t\tch_three = new Translate(0, 0);\n\t\th1.getTransforms().add(ch_one);\n\t\th2.getTransforms().add(ch_two);\n\t\th3.getTransforms().add(ch_three);\n\n\t\t// setup the translation of one cell width and two cell widths\n\t\tcw_one = new Translate(0, 0);\n\t\tcw_two = new Translate(0, 0);\n\t\tcw_three = new Translate(0, 0);\n\t\tv1.getTransforms().add(cw_one);\n\t\tv2.getTransforms().add(cw_two);\n\t\tv3.getTransforms().add(cw_three);\n\n\t\t// add the rectangles and lines to this group\n\t\tgetChildren().addAll(back, h1, h2, h3, v1, v2, v3);\n\n\t}", "public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }", "private void initialSetup() {\n\t\tplaceNewPiece('a', 1, new Rook(board, Color.WHITE));\n placeNewPiece('b', 1, new Knight(board, Color.WHITE));\n placeNewPiece('c', 1, new Bishop(board, Color.WHITE));\n placeNewPiece('d', 1, new Queen(board, Color.WHITE));\n placeNewPiece('e', 1, new King(board, Color.WHITE, this)); // 'this' refere-se a esta jogada\n placeNewPiece('f', 1, new Bishop(board, Color.WHITE));\n placeNewPiece('g', 1, new Knight(board, Color.WHITE));\n placeNewPiece('h', 1, new Rook(board, Color.WHITE));\n placeNewPiece('a', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('b', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('c', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('d', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('e', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('f', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('g', 2, new Pawn(board, Color.WHITE, this));\n placeNewPiece('h', 2, new Pawn(board, Color.WHITE, this));\n\n placeNewPiece('a', 8, new Rook(board, Color.BLACK));\n placeNewPiece('b', 8, new Knight(board, Color.BLACK));\n placeNewPiece('c', 8, new Bishop(board, Color.BLACK));\n placeNewPiece('d', 8, new Queen(board, Color.BLACK));\n placeNewPiece('e', 8, new King(board, Color.BLACK, this));\n placeNewPiece('f', 8, new Bishop(board, Color.BLACK));\n placeNewPiece('g', 8, new Knight(board, Color.BLACK));\n placeNewPiece('h', 8, new Rook(board, Color.BLACK));\n placeNewPiece('a', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('b', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('c', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('d', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('e', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('f', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('g', 7, new Pawn(board, Color.BLACK, this));\n placeNewPiece('h', 7, new Pawn(board, Color.BLACK, this));\n\t}", "public BoardInterface(){\n\t\tsetupLayouts();\n\t\tsetPlayerChoice();\n\t}", "Board createLayout();", "private void initializeBoard() {\n\t\t\n\t}", "public void initBasicBoardTiles() {\n\t\ttry {\n\t\t\tfor(int i = 1 ; i <= BOARD_SIZE ; i+=2) {\n\t\t\t\tfor(char c = getColumnLowerBound() ; c <= getColumnUpperBound() ; c+=2) {\n\n\t\t\t\t\taddTile(new Tile.Builder(new Location(i, c), PrimaryColor.BLACK).build());\n\t\t\t\t\taddTile(new Tile.Builder(new Location(i, (char) ( c + 1)), PrimaryColor.WHITE).build());\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 2 ; i <= BOARD_SIZE ; i+=2) {\n\t\t\t\tfor(char c = getColumnLowerBound() ; c <= getColumnUpperBound() ; c+=2) {\n\n\t\t\t\t\taddTile(new Tile.Builder(new Location(i, c), PrimaryColor.WHITE).build());\n\t\t\t\t\taddTile(new Tile.Builder(new Location(i, (char) ( c + 1)), PrimaryColor.BLACK).build());\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(LocationException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public GridMapCompassMoves() {\n super();\n }", "void placePowerStation() {\n this.board.get(powerRow).get(powerCol).placePowerStation();\n }", "MainBoard createMainBoard();", "protected abstract void paintBoard() throws TilePixelOutOfRangeException;", "int occupationHelper(int xPos, int yPos, Board b, char myColor);", "private void initBoard() {\n initCommands();\n setBackground(Color.BLACK);\n setPreferredSize(new Dimension((int) (W * Application.scale), (int) (H * Application.scale)));\n\n commandClasses.forEach((cmdstr) -> {\n try {\n Object obj = Class.forName(cmdstr).getDeclaredConstructor().newInstance();\n Command cmd = (Command) obj;\n connectCommand(cmd);\n System.out.println(\"Loaded \" + cmdstr);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n });\n\n Particle.heatmap.addColor(0, Color.GREEN);\n Particle.heatmap.addColor(50, Color.YELLOW);\n Particle.heatmap.addColor(100, Color.RED);\n\n Particle.slopemap.addColor(-5, Color.RED);\n Particle.slopemap.addColor(0, Color.WHITE);\n Particle.slopemap.addColor(5, Color.GREEN);\n\n setFocusable(true);\n }", "public abstract void buildMoveData(HexagonalBoard board);", "void prepareBoardBeforePlacement( Board board );", "private void prepareBoard(){\n gameBoard.arrangeShips();\n }", "public BitBoardImpl() {\n\tinitialPosition();\n }", "public void setInitialPosition()\n {\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.a2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.b2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.c2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.d2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.e2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.f2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.g2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.h2);\n //Se colocan los peones negros en la séptima fila\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.a7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.b7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.c7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.d7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.e7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.f7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.g7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.h7);\n //Se colocan las torres blancas en a1 y h1\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.a1);\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.h1);\n //Se colocan las torres negras en a8 y h9\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.a8);\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.h8);\n //Se colocan los caballos blancos en b1 y g1\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.b1);\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.g1);\n //Se colocan los caballos negros en b8 y g8\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.b8);\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.g8);\n //Se colocan los alfiles blancos en c1 y f1\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.c1);\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.f1);\n //Se colocan los alfiles negros en c8 y f8\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.c8);\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.f8);\n //Se coloca la dama blanca en d1\n putGenericPiece(GenericPiece.QUEEN,Colour.WHITE,Square.d1);\n //Se coloca la dama negra en d8\n putGenericPiece(GenericPiece.QUEEN,Colour.BLACK,Square.d8);\n //Se coloca el rey blanco en e1\n putGenericPiece(GenericPiece.KING,Colour.WHITE,Square.e1);\n //Se coloca el rey negro en e8\n putGenericPiece(GenericPiece.KING,Colour.BLACK,Square.e8);\n \n //Se permiten los enroques para ambos jugadores\n setCastlingShort(Colour.WHITE,true);\n setCastlingShort(Colour.BLACK,true);\n setCastlingLong(Colour.WHITE,true);\n setCastlingLong(Colour.BLACK,true);\n \n //Se da el turno a las blancas\n setTurn(Colour.WHITE);\n \n gamePositionsHash.clear();\n gamePositionsHash.put(zobristKey.getKey(), 1);\n }", "@Override\n protected void generateTiles() {\n }", "public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }", "public UIBoard()\r\n\t{\r\n\t\t//Creates a 10x10 \"Board\" object\r\n\t\tsuper(10,10);\r\n\t\tgrid = new int[getLength()][getWidth()];\r\n\t\t\r\n\t\t//Sets all coordinates to the value 0, which corresponds to \"not hit yet\"\r\n\t\tfor(int i=0; i<grid.length; i++)\r\n\t\t\tfor(int j=0; j<grid[i].length; j++)\r\n\t\t\t\tgrid[i][j] = 0;\t\t\r\n\t}", "public Board()\r\n\t{\r\n\t\tsuper(8, 8);\r\n\t}", "private Board() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// A private board constructor to ensure only one is created\n\t\tsuper();\n\t}", "private void setUpCorrect() {\n List<Tile> tiles = makeTiles();\n Board board = new Board(tiles, 4, 4);\n boardManager = new BoardManager(board);\n }", "public int getBoardLocation() {return boardLocation;}", "public Bot12()\r\n {\r\n super();\r\n includeY = true;\r\n initPieces();\r\n }", "@Override\n\tprotected void generateTiles() {\n\t}", "public GridCell(int xPosition, int yPosition, char actor) // Based on the actor we are creating respective object.\n {\n\t xPos = xPosition;\n\t yPos = yPosition;\n\t if(actor == Constants.PATH)\n\t {\n\t\t a = new Actor();\n\t }\n\t if( actor == Constants.ROBOT)\n\t {\n\t\t a = new PlayerRobotManual();// creating PlayerRobotManual object.\n\t }\n\t if(actor == 'x' || actor == Constants.WALL)\n\t {\n\t\t a = new Wall();// wall object.\n\t }\n\t if(actor == 'b' || actor == Constants.BOMB)\n\t {\n\t\t a = new Bomb(); // Bomb objection.\n\t }\n\t if(actor == Constants.SMALL_CANDY ) \n\t {\n\t\t a = new Candy(Constants.SMALL_CANDY); // candy object of type small.\n\t }\n\t if(actor == Constants.SMALL_CANDY ) \n\t {\n\t\t a = new Candy(Constants.SMALL_CANDY);\n\t }\n\t if(actor == Constants.BIG_CANDY)\n\t {\n\t\t a = new Candy(Constants.BIG_CANDY);// candy object of type Big.\n\t }\n\t if(actor == Constants.DUMB_ENEMY)\n\t {\n\t\t a = new DumbEnemy(); // object of dumb enemy which moves in random direction.\n\t }\n\t if(actor == Constants.SENTINEL_ENEMY)\n\t {\n\t\t a = new SentinelEnemy();// THis will be at one fixed postion and will kill the robot if its in neighbour cell.\n\t }\n\t if(actor == Constants.WALKING_SENTINEL)\n\t {\n\t\t a = new WalkingSentinelEnemy();// object for walking sentinel enemy.\n\t }\n\t if(actor == Constants.PLAYER_CHASER)\n\t {\n\t\t a = new SmartEnemy();// object for player chaser enemy.\n\t }\n\t if(actor == Constants.CANDY_CHASER)\n\t {\n\t\t a = new WatcherEnemy();// object for candy chaser enemy.\n\t }\n\t if(actor == Constants.ROBOT_HOLDING_BOMB)\n\t {\n\t\t a = new PlayerRobotHoldingBomb();// object used to repersent the player holding bomb.\n\t }\n\t if(actor == Constants.FLYING_BOMB)\n\t {\n\t\t a = new FlyingBomb(); // Object used to represent the flying bomb.\n\t }\n\t if((int)actor >= 49 && (int)actor <=57)\n\t {\n\t\t a = new WarpZone(actor);\n\t }\n\t if(actor == 'i')\n\t {\n\t\t a = new InvisibleCloak();\n\t\t\t\t \n\t }\n\t}", "public static void makeBoardChess() {\r\n \r\n white = new AllPiece(\"White\");\r\n black = new AllPiece(\"Black\");\r\n \r\n }", "public void create(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\t\tthis.position[1][1] = 1;//putting player in this position\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[9][13] = 1;//puts the door here \n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 7; i< 8 ; i++){\n\t\t\tfor(int p = 2; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 17; i< 18 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\t\n\t\t}\n\t\tfor(int i = 14; i< 15 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\t\n\t\t}\t\n\t\tfor(int i = 11; i< 12 ; i++){\n\t\t\tfor(int p = 10; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 3; p < 6; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 16; i< 17 ; i++){\n\t\t\tfor(int p = 6; p < 13; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 5; p < 10; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\t\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes \n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{ \n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "private Board()\r\n {\r\n this.grid = new Box[Config.GRID_SIZE][Config.GRID_SIZE];\r\n \r\n for(int i = 0; i < Config.NB_WALLS; i++)\r\n {\r\n this.initBoxes(Wall.ID);\r\n }\r\n \r\n for(int i = 0; i < Config.NB_CHAIR; i++)\r\n {\r\n this.initBoxes(Chair.ID);\r\n }\r\n \r\n for(int i = 0; i < Config.NB_PLAYER; i++)\r\n {\r\n this.initBoxes(Chair.ID);\r\n }\r\n }", "@Override\n public void mouseReleased(MouseEvent arg0) {\n yourBoardPanel[xx][yy].setBackground(updateYourBoardHelper(xx, yy));\n //potential problem here during initialization of ships?\n \n }", "public BoardSetup() {\n\t\tthis.theBoard = Board.getInstance();\n\t}", "private void getBoard() {\n gameBoard = BoardFactory.makeBoard();\n }", "private GameBoard() {}", "public void setPieces(){\r\n Pawn[] arrwPawn = new Pawn[8];\r\n for (int i=0 ; i<8 ; i++){\r\n pos.setPosition(6,i);\r\n arrwPawn[i] = new Pawn (pos , piece.Colour.WHITE);\r\n GameBoard.putPiece(arrwPawn[i]);\r\n }\r\n\r\n Pawn[] arrbPawn = new Pawn[8];\r\n for(int i=0 ; i<8 ; i++){\r\n pos.setPosition(0,i);\r\n arrbPawn[i] = new Pawn(pos , piece.Colour.BLACK);\r\n GameBoard.putPiece(arrbPawn[i]);\r\n }\r\n\r\n\r\n //set black pieces in the board\r\n\r\n pos.setPosition(0,0);\r\n Rook bRook1 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook1);;\r\n\r\n pos.setPosition(0,7);\r\n Rook bRook2 = new Rook(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bRook2);\r\n\r\n\r\n pos.setPosition(0,1);\r\n Knight bKnight1 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,6);\r\n Knight bKnight2 = new Knight(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKnight1);\r\n\r\n pos.setPosition(0,2);\r\n Bishop bBishop1 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop1);\r\n\r\n pos.setPosition(0,5);\r\n Bishop bBishop2 = new Bishop(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bBishop2);\r\n\r\n pos.setPosition(0,3);\r\n Queen bQueen = new Queen(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bQueen);\r\n\r\n pos.setPosition(0,4);\r\n King bKing = new King(pos, piece.Colour.BLACK);\r\n GameBoard.putPiece(bKing);\r\n\r\n //set white pieces in the board\r\n\r\n pos.setPosition(7,0);\r\n Rook wRook1 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook1);\r\n\r\n pos.setPosition(7,7);\r\n Rook wRook2 = new Rook(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wRook2);\r\n\r\n pos.setPosition(7,1);\r\n Knight wKnight1 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,6);\r\n Knight wKnight2 = new Knight(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKnight1);\r\n\r\n pos.setPosition(7,2);\r\n Bishop wBishop1 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop1);\r\n\r\n pos.setPosition(7,5);\r\n Bishop wBishop2 = new Bishop(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wBishop2);\r\n\r\n pos.setPosition(7,3);\r\n Queen wQueen = new Queen(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wQueen);\r\n\r\n pos.setPosition(7,4);\r\n King wKing = new King(pos, piece.Colour.WHITE);\r\n GameBoard.putPiece(wKing);\r\n\r\n\r\n\r\n Rook arrwRook[] = {wRook1,wRook2};\r\n Rook arrbRook[] = {bRook1,bRook2};\r\n Queen arrwQueen[] = {wQueen};\r\n Queen arrbQueen[] = {bQueen};\r\n Knight arrwKnight[] = {wKnight1,wKnight2};\r\n Knight arrbKnight[] = {bKnight1,bKnight2};\r\n King arrwKing[] = {wKing};\r\n King arrbKing[] = {bKing};\r\n Bishop arrwBishop[] = {wBishop1,wBishop2};\r\n Bishop arrbBishop[] = {bBishop1,bBishop2};\r\n }", "protected abstract void position(int[][] gameboard, int col, int row);", "Board() {\n this.cardFactory = new CardFactory(this);\n }", "public GameWon()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(550, 600, 1); \n addObject(b1,275,250);\n addObject(b2,275,380);\n }", "private void easyMove(Board board) {\n\t\t\r\n\t}", "public Board() {\n this.actionField = new ActionField();\n this.buyField = new BuyField();\n }", "public OthelloBoard (int height, int width){\n super(height, width);\n m_Pieces = new OthelloPiece[WIDTH][HEIGHT];\n m_PieceCount+=4;\n \n }", "public interface BoardLayout {\n /**\n * In this method the application programmer defines the Layout of the board and the accessories.\n *\n * @return the custom layout\n */\n Board createLayout();\n\n}", "void placeTower();", "Board() {\n\t\tswitch (Board.boardType) {\n\t\tcase Tiny:\n\t\t\tthis.dimensions = TinyBoard; break;\n\t\tcase Giant:\n\t\t\tthis.dimensions = GiantBoard; break;\n\t\tdefault:\n\t\t\tthis.dimensions = StandardBoard; break;\n\t\t}\n\t\tboard = new Square[dimensions.x][dimensions.y];\n\t\tinit();\n\t}", "public void create3(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\n\n\t\t//creating stairs to connect rooms\n\t\tfor(int i = 0; i <this.Stairs.length; i++){\n\t\t\tfor(int p = 0; p < this.Stairs.length; p++){\n\t\t\t\tthis.Stairs[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}\n\t\tthis.Stairs[1][1] = 1;\n\n\t\t//creating board to keep track of garret\n\t\tfor(int i = 0; i <this.Garret.length; i++){\n\t\t\tfor(int p = 0; p < this.Garret.length; p++){\n\t\t\t\tthis.Garret[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of garret board\n\t\tthis.Garret[18][10] = 1;//putts garret there\n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 1; i< 6 ; i++){\n\t\t\tfor(int p = 7; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 7 ; i++){\n\t\t\tfor(int p = 7; p > 4; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 11 ; i++){\n\t\t\tfor(int p = 4; p < 5; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 10; i< 11 ; i++){\n\t\t\tfor(int p = 5; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 11; i< 15 ; i++){\n\t\t\tfor(int p = 7; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 7; p > 3; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 14 ; i++){\n\t\t\tfor(int p = 1; p < 4; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 12; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 5; i< 9 ; i++){\n\t\t\tfor(int p = 12; p < 13; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 14 ; i++){\n\t\t\tfor(int p = 7; p < 12; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 16 ; i++){\n\t\t\tfor(int p = 12; p < 13; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 9; i< 10 ; i++){\n\t\t\tfor(int p = 12; p < 19; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes\n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{\n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "public void drawTile() {\n\n }", "public WorldImage drawBoard() {\r\n return new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(this.currTurn) + \"/\"\r\n + Integer.toString(this.maxTurn), Cnst.textHeight, Color.BLACK),\r\n this.indexHelp(0,0).drawBoard(this.blocks)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2);\r\n }", "public Board() {\n this.x = 0;\n this.o = 0;\n }", "@Override\r\n\tpublic void init() \r\n\t{\r\n\t\tthis.board = new GameBoard();\r\n\t}", "public zombie_bg()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1010,900, 1); \n setPaintOrder(ScoreBoard.class, player.class, zomb_gen.class, options.class);\n populate();\n \n }", "public void initChessBoardAutomaticly() {\r\n\t\tthis.initPieces();\r\n\t\tthis.clearBoard();\r\n\t\tfor (int i=0; i<board.size(); i++) {\r\n\t\t\tChessBoardBlock b = board.get(order[i]);\r\n\t\t\tb.setBorderPainted(false);\r\n\t\t}\r\n\t\tfor (int i = 0, w = 0, b = 0, s = 0; i < 8 * 8; i++) {\r\n\r\n\t\t\t// Assign1, Disable board clickable\r\n\t\t\tChessBoardBlock block = board.get(order[i]);\r\n\t\t\tblock.setEnabled(false);\r\n\r\n\t\t\t// Assign1, Put black pieces and record the position\r\n\t\t\tif (i % 2 != 1 && i >= 8 && i < 16) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t} else if (i % 2 != 0 && (i < 8 || (i > 16 && i < 24))) {\r\n\t\t\t\tChessPiece blackPiece = blackPieces[b];\r\n\t\t\t\tblackPiece.position = order[i];\r\n\r\n\t\t\t\tpiece.put(order[i], blackPiece);\r\n\t\t\t\tbody.add(blackPiece);\r\n\t\t\t\tb++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Assign1, Put white pieces and record the position\r\n\t\t\telse if (i % 2 != 0 && i > 48 && i < 56) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t} else if (i % 2 != 1\r\n\t\t\t\t\t&& ((i >= 40 && i < 48) || (i >= 56 && i < 64))) {\r\n\t\t\t\tChessPiece whitePiece = whitePieces[w];\r\n\t\t\t\twhitePiece.position = order[i];\r\n\t\t\t\t\r\n\t\t\t\tpiece.put(order[i], whitePiece);\r\n\t\t\t\tbody.add(whitePiece);\r\n\t\t\t\tw++;\r\n\t\t\t}\r\n\r\n\t\t\t// Assign1, Put empty pieces on the board\r\n\t\t\t// Actually, empty pieces will not display on the board, they are\r\n\t\t\t// not existing\r\n\t\t\t// to chess players, just for calculation\r\n\t\t\telse {\r\n\t\t\t\tChessPiece spacePiece = spacePieces[s];\r\n\t\t\t\tspacePiece.position = order[i];\r\n\t\t\t\tbody.add(spacePiece);\r\n\t\t\t\tpiece.put(order[i], spacePiece);\r\n\t\t\t\tspacePiece.setVisible(false);\r\n\t\t\t\ts++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tt.setText(\"Chess Board has been initialized automatically\");\r\n\t\tthis.startGame();\r\n\t}", "interface Cnst {\r\n\r\n /////////////////////////////////////////////////////////////\r\n // These constants can be changed to edit the big bang ran //\r\n /////////////////////////////////////////////////////////////\r\n\r\n //full size is eight, scales the size of the board\r\n int scale = 8;\r\n\r\n //numbers of blocks in a row and a column\r\n int blocks = 10;\r\n\r\n //number of colors the game will use, between 2-8 inclusive\r\n int numOfColors = 8;\r\n\r\n //the number of turns you have to win the game\r\n int maxTurns = 25;\r\n\r\n\r\n ////////////////////////////////////////\r\n // Please do not edit these constants //\r\n ////////////////////////////////////////\r\n\r\n //the visible board width, scales with scale\r\n int boardWidth = 70 * scale;\r\n\r\n //the visible board height, scales with scale\r\n int boardHeight = 70 * scale;\r\n\r\n //cell width scales with the board and scale\r\n int cellWidth = boardWidth / blocks;\r\n\r\n //cell height scales with board and scale\r\n int cellHeight = boardHeight / blocks;\r\n\r\n //new constant for text on the board\r\n int textHeight = boardWidth / 12;\r\n\r\n //the 8 colors that can be selected by the user\r\n ArrayList<Color> colorsToChoose =\r\n new ArrayList<Color>(Arrays.asList(\r\n Color.CYAN, Color.PINK, Color.ORANGE,\r\n Color.BLUE, Color.RED, Color.GREEN,\r\n Color.MAGENTA, Color.YELLOW));\r\n}", "public abstract interface Board {\n\n\t/**\n\t * Returns the number of Tiles along a side of the board.\n\t * All boards should be square.\n\t * \n\t * @return int - the size of the board.\n\t */\n\tpublic abstract int getSize();\n\t\n\t/**\n\t * Returns the Tile located at the board location specified by\n\t * the x and y coordinates.\n\t * \n\t * @param x\n\t * @param y\n\t * @return Tile \n\t */\n\tpublic abstract Tile getTileAt(int x, int y);\n\t\n\t/**\n\t * Returns a Set of the Tile neighboring the specific Tile.\n\t * The set should have a size of no fewer than 4 and no more than 6.\n\t * \n\t * @param tile\n\t * @return Set<Tile>\n\t */\n\tpublic abstract Set<Tile> getNeighbors(Tile tile);\n\t\n\t/**\n\t * Sets the boards[x][y] Tile to the PlayerColor specified.\n\t * \n\t * @param move\n\t * @param playerColor\n\t */\n\tpublic abstract void makeMove(Move move, PlayerColor playerColor);\n\t\n\t/**\n\t * This method exists in the Observable class.\n\t * By making any implementor of this interface also extend Observable,\n\t * we can pass around and add observers to anything that implements Board.\n\t */\n\tpublic abstract void addObserver(Observer observer);\n}", "public void setBoardLocation(int boardLocation) {this.boardLocation = boardLocation;}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void onMove() {\n\t\t\r\n\t}", "protected Board(){\n\t\tpool = 0;\n\t\tsquares = new Square[3][61];\n\t\tcommunityCards = new LinkedList<CommunityCard>();\n\t\tchanceCards = new LinkedList<ChanceCard>();\n\t\tmap = new HashMap<String, Integer>();\n\t\tcompanyArray = new Company[6];\n\t\tcreateBoard();\n\t\tfillHashMap();\t\t\t\n\t\tfillChanceCards();\n\t\tfillCommunityChestCards();\n\t\tfillCompanyArray();\n\t\tshuffleChanceCards();\n\t\tshuffleCommunityCards();\n\t}", "Board() {\n clear();\n }", "Board() {\n clear();\n }", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "public void DisplayBoard(Board bord);", "public AbstractBoardView() {\n\n }", "@Override\n public BlockGrid getBoard() {\n return checkersBoard;\n }", "public void create2(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[1][1] = 1;\n\n\t\t//creating stairs to transport to room3\n\t\tfor(int i = 0; i <this.Stairs.length; i++){\n\t\t\tfor(int p = 0; p < this.Stairs.length; p++){\n\t\t\t\tthis.Stairs[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Stairs[18][18] = 1;\n\n\t\t//creating board to keep track of ari\n\t\tfor(int i = 0; i <this.Ari.length; i++){\n\t\t\tfor(int p = 0; p < this.Ari.length; p++){\n\t\t\t\tthis.Ari[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}\n\t\tthis.Ari[7][11] = 1;//putts ari there\n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 3; i< 4 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 7 ; i++){\n\t\t\tfor(int p = 19; p > 1; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 9; i< 10 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 19; p > 1; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes\n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{\n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "public void initBoard() {\n board = new Board();\n\n // initilaisation des groupes\n Group violet = new Group();\n Group bleu = new Group();\n Group orange = new Group();\n Group vert = new Group();\n Group rouge = new Group();\n Group jaune = new Group();\n Group rose = new Group();\n Group marine = new Group();\n Group gare = new Group();\n Group compagnie = new Group();\n\n // ajout des cases\n board.addCaseBoard(new StartCase());\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd Belleville\", 60, 2, 10,30, 90, 160,250, 30,violet, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de caumunauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue lecourbe\", 60, 4,20,60,180,320,450, 30,violet, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Taxes\"));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare Monparnasse\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Vaugirard\", 100, 6,30,90,270,400,550, 50, bleu, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Courcelles\", 100, 6,30,90,270,400,550, 50, bleu, 50));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de la Republique\", 120, 8,40,100,300,450,600, 60, bleu, 50));\n board.addCaseBoard(new CaseBoardImpl(\"Prison\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd de la villette\", 140, 10,50,150,450,625,750, 70, orange, 100));\n board.addCaseBoard(new BuyableCaseImpl(\"Compagnie de distribution d'electricité\",150, 0, 75, compagnie));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Neuilly\", 140, 10,50,150,450,625,750, 70, orange, 100));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de Paradis\", 160, 12,60,180,500,700,900, 80, orange, 100));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare de Lyon\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Mozart\", 180, 14,70,200,550,700,900, 90, vert, 100));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd Saint Michel\", 180, 14,70,200,550,700,900, 90, vert, 100));\n board.addCaseBoard(new BuildingCaseImpl(\"Place Pigalle\", 200, 16,80,220,600,800,950, 100, vert, 100));\n board.addCaseBoard(new CaseBoardImpl(\"Park Gratuit\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Matignon\", 220, 18,90,250,700,875,1050, 110, rouge, 150));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd MalesHerbes\", 220, 18,90,250,700,875,1050, 110, rouge, 150));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Henri-Martin\", 240, 20,100,300,750,925,1100, 120, rouge, 150));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare du Nord\", 200, 2, 100,gare));\n board.addCaseBoard(new BuildingCaseImpl(\"Fb Saint Honoré\", 260, 22,110,330,800,975,1150, 130, jaune, 150));\n board.addCaseBoard(new BuildingCaseImpl(\"Place de la Bourse\", 260, 22,110,330,800,975,1150, 130, jaune, 150));\n board.addCaseBoard(new BuyableCaseImpl(\"Compagnie de distribution des eaux\",150, 0, 75, compagnie));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue lafayette\", 280, 24,120,360,850,1025,1200, 140, jaune, 150));\n board.addCaseBoard(new CaseBoardImpl(\"Aller en Prison\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av de Breteuil\", 300, 26,130,390,900,1100,1275, 150, rose, 200));\n board.addCaseBoard(new BuildingCaseImpl(\"Av Foch\", 300, 26,130,390,900,1100,1275, 150, rose, 200));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Bvd des Capucines\", 320, 28,150,450,1000,1200,1400, 160, rose, 200));\n board.addCaseBoard(new BuyableCaseImpl(\"Gare Saint-Lazarre\", 200, 2, 100,gare));\n board.addCaseBoard(new CaseBoardImpl(\"Chance\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Av des Champs Elysées\", 350, 35,175,500,1100,1300,1500, 175, marine, 200));\n board.addCaseBoard(new CaseBoardImpl(\"Caisse de Communauté\"));\n board.addCaseBoard(new BuildingCaseImpl(\"Rue de la Paix\", 400, 50,200,600,1400,1700,2000, 200, marine, 200));\n }", "private void testBoardCreation() {\n for (int r = 0; r < Constants.BOARD_GRID_ROWS; r++) {\n for (int c = 0; c < Constants.BOARD_GRID_COLUMNS; c++) {\n Vector2 tokenLocation = this.mBoardLevel.getCenterOfLocation(r, c);\n Image tokenImage = new Image(this.mResources.getToken(PlayerType.RED));\n tokenImage.setPosition(tokenLocation.x, tokenLocation.y);\n this.mStage.addActor(tokenImage);\n }\n }\n }", "public ChessRunner(){\n\t\taddMouseListener(this);\n\t\tfor(int i=0;i<8;i++){\n\t\t\tfor (int j=1;j<7;j++)\n\t\t\t\tif(j==1)\n\t\t\t\t\tboard[i][j] = new BlackPawn();\n\t\t\t\telse if(j==6)\n\t\t\t\t\tboard[i][j] = new WhitePawn();\n\t\t\t\telse\n\t\t\t\t\tboard[i][j]= new BlankPiece();\n\t\t}\n\t\tboard[1][0] = new BlackKnight();\n\t\tboard[6][0] = new BlackKnight();\n\t\tboard[0][0] = new BlackRook();\n\t\tboard[7][0] = new BlackRook();\n\t\tboard[2][0] = new BlackBishop();\n\t\tboard[5][0] = new BlackBishop();\n\t\tboard[4][0] = new BlackKing();\n\t\tboard[3][0] = new BlackQueen();\n\t\t\n\t\tboard[1][7] = new WhiteKnight();\n\t\tboard[6][7] = new WhiteKnight();\n\t\tboard[0][7] = new WhiteRook();\n\t\tboard[7][7] = new WhiteRook();\n\t\tboard[2][7] = new WhiteBishop();\n\t\tboard[5][7] = new WhiteBishop();\n\t\tboard[4][7] = new WhiteKing();\n\t\tboard[3][7] = new WhiteQueen();\n\t\t\n\t}", "public Board getBoard ();", "TetrisBoard() {\n\t\t// create new board \n\t\tblockMatrix = new boolean[NUM_ROWS][NUM_COLS];\n\t\t\n\t\t// fill in values for board\n\t\tinitBoard();\n\t\t\n\t\t// add new piece to fall\n\t\taddNewPiece();\n\t\t\n\t\t// start scores at 0\n\t\tnumLines = 0;\n\t\tnumTetrises = 0;\n\t}", "public SlideChromosome() {\n\t\tsuper();\n\t\tthis.moves = new ArrayList<MoveElement>();\n\t\tthis.board = null;\n\t}", "protected MancalaBoardRenderer(){\n pieceRenderer_ = MancalaBinRenderer.getRenderer();\n }", "void doPlaceObject() {\r\n\t\tif (renderer.surface == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (currentBaseTile != null) {\r\n\t\t\tUndoableMapEdit undo = new UndoableMapEdit(renderer.surface);\r\n\t\t\tdeleteEntitiesOf(renderer.surface.basemap, renderer.placementRectangle, false);\r\n\t\t\tSurfaceFeature sf = new SurfaceFeature();\r\n\t\t\tsf.id = currentBaseTile.id;\r\n\t\t\tsf.type = currentBaseTile.type;\r\n\t\t\tsf.tile = currentBaseTile.tile;\r\n\t\t\tsf.location = Location.of(renderer.placementRectangle.x, renderer.placementRectangle.y);\r\n\t\t\trenderer.surface.features.add(sf);\r\n\t\t\t\r\n\t\t\tplaceTile(currentBaseTile.tile, renderer.placementRectangle.x, renderer.placementRectangle.y, SurfaceEntityType.BASE, null);\r\n\t\t\t\r\n\t\t\tundo.setAfter();\r\n\t\t\taddUndo(undo);\r\n\t\t\trenderer.repaint();\r\n\t\t} else\r\n\t\tif (currentBuildingType != null && renderer.canPlaceBuilding(renderer.placementRectangle) && renderer.placementRectangle.width > 0) {\r\n\t\t\tUndoableMapEdit undo = new UndoableMapEdit(renderer.surface);\r\n\t\t\tBuilding bld = new Building(currentBuildingType, currentBuildingRace);\r\n\t\t\tbld.makeFullyBuilt();\r\n\t\t\tbld.location = Location.of(renderer.placementRectangle.x + 1, renderer.placementRectangle.y - 1); // leave room for the roads!\r\n\t\t\trenderer.surface.buildings.add(bld);\r\n\t\t\t\r\n\t\t\tplaceTile(bld.tileset.normal, bld.location.x, bld.location.y, SurfaceEntityType.BUILDING, bld);\r\n\t\t\tplaceRoads(currentBuildingRace);\r\n\t\t\t\r\n\t\t\tundo.setAfter();\r\n\t\t\taddUndo(undo);\r\n\t\t\trenderer.repaint();\r\n\t\t}\r\n\t}", "public void showBoard(){\n }", "public void initializeDebugBoard() {\n\t\tboolean hasNotMoved = false;\n\t\tboolean hasMoved = true;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set empty rows\n\t\tfor (int row = 0; row < 8; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\tboard[5][4] = new Piece('k', white, hasMoved, 5, 4, PieceArray.E_kingId);\n//\t\tboard[1][4] = new Piece(\"rook\", white, hasMoved, 1, 4);\n\t\tboard[2][2] = new Piece('q', black, hasMoved, 2, 2, PieceArray.A_rookId);\n//\t\tboard[3][2] = new Piece('q', black, hasMoved, 3, 2, PieceArray.H_rookId);\n\t\t\n\n\t\tboard[0][0] = new Piece('k', black, hasMoved, 0, 0, PieceArray.E_kingId);\n//\t\tboard[7][7] = new Piece('r', black, hasNotMoved, 7, 7, PieceArray.A_rookId);\n//\t\tboard[6][7] = new Piece('p', black, hasNotMoved, 6, 7, PieceArray.A_pawnId);\n//\t\tboard[6][6] = new Piece('p', black, hasNotMoved, 6, 6, PieceArray.B_pawnId);\n//\t\tboard[6][5] = new Piece('p', black, hasNotMoved, 6, 5, PieceArray.C_pawnId);\n//\t\tboard[6][4] = new Piece('p', black, hasNotMoved, 6, 4, PieceArray.D_pawnId);\n\t\n//\t\tboard[6][6] = new Piece(\"pawn\", black, hasMoved, 6, 6);\n//\t\tboard[6][7] = new Piece(\"pawn\", black, hasMoved, 6, 7);\n//\t\tboard[6][4] = new Piece(\"pawn\", black, hasMoved, 6, 4);\n//\t\t\t\n//\t\t\n//\t\tboard[4][4] = new Piece(\"pawn\", black, hasMoved, 4,4);\n//\t\tboard[3][5] = new Piece(\"rook\", white,hasMoved,3,5);\n//\t\tboard[1][7] = new Piece(\"pawn\",black,hasMoved,1,7);\n\n\t}", "public BigGameBoard(MainActivity m){\n super(m);\n createSmallBoards();\n createBoard(bigRowHeightWeight, vertBarWidthWeight);\n currentLetter = \"o\";\n setPadding(0,0,0,0);\n int z = 0;\n for (SmallGameBoard g: games){\n for(ButtonClass b:g.getAllButtons()){\n allButtons[z] = b;\n z++;\n }\n }\n }", "public void define(){\n\n noOfCredits = Game.level.getCredits();\n unitsToWin = Game.level.getUnitsToWin();\n\n for (int i = 0; i <buttons.length ; i++) {\n buttons[i] = new ShopButton((Game.width/2) -\n ((noOfButtons*buttonsize)/2) -((smallSpace*\n (buttons.length-1)) /2) + ((buttonsize + smallSpace)*i),\n ((GameContainer.rowCount * GameContainer.squareSize )\n + largeSpace), buttonsize , buttonsize, i);\n }\n\n for (int i = 0; i < statsElements.length ; i++) {\n //define where the statselement should be placed.\n statsElements[i] = new ShopButton(((Game.width/2)\n - (GameContainer.columnCount*\n GameContainer.squareSize )/2 + (((GameContainer.columnCount\n *GameContainer.squareSize)/7)*3)*i ),\n (GameContainer.rowCount * GameContainer.squareSize\n ), buttonsize , buttonsize, i);\n }\n }", "public void setBoard(Board board){this.board = board;}", "public abstract boolean actualPlace(int row, int col);", "private void mediumMove(Board board) {\n\t}", "public void place(GamePiece teil, QPosition pos) { // old German method name: platziere\n for (int x = teil.getMinX(); x <= teil.getMaxX(); x++) {\n for (int y = teil.getMinY(); y <= teil.getMaxY(); y++) {\n if (teil.filled(x, y)) {\n int ax = pos.getX() + x - teil.getMinX();\n int ay = pos.getY() + y - teil.getMinY();\n set(ax, ay, teil.getBlockType(x, y));\n }\n }\n }\n view.draw();\n }", "private void setLocations(){\n\t\tbuttonArea.setSize(FRAME_WIDTH, 50);\n\t\tbuttonArea.setLocation(0, 0);\n\t\tboardOne.setSize(600,600);\n\t\tboardOne.setLocation(0,buttonArea.getHeight());\n\t\tboardTwo.setSize(600,600);\n\t\tboardTwo.setLocation(boardOne.getWidth() + 10,buttonArea.getHeight());\n\t\tboardOne.setIcon(background);\n\t\tboardTwo.setIcon(background);\n\t\tnewGame.setSize(100,20);\n\t\tnewGame.setLocation(5,5);\n\t\tcp1shipLabel.setSize(200,15);\n\t\tcp1shipLabel.setLocation((boardOne.getWidth() / 2) - (cp1shipLabel.getWidth() / 2),buttonArea.getHeight() - cp1shipLabel.getHeight() - 5);\n\t\tcp1shipLabel.setVisible(false);\n\t\tcp2shipLabel.setSize(200,15);\n\t\tcp2shipLabel.setLocation(boardTwo.getX() + (boardTwo.getWidth() / 2) - (cp2shipLabel.getWidth() / 2),buttonArea.getHeight() - cp2shipLabel.getHeight() - 5);\n\t\tcp2shipLabel.setVisible(false);\n\t}", "public static void boardInit() {\n ArrayList<Piece> white_piece_list = new ArrayList<>();\n ArrayList<Piece> black_piece_list = new ArrayList<>();\n ArrayList<Piece> piece_array = PieceFactory.createPieces();\n for(Piece p : piece_array)\n {\n if(p.getColor())\n {\n black_piece_list.add(p);\n }\n else\n {\n white_piece_list.add(p);\n }\n }\n white_player.setpieceList(white_piece_list);\n white_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER);\n black_player.setpieceList(black_piece_list);\n black_player.setKingXYCoords(PieceFactory.KING_INITIAL_X, PieceFactory.INITAL_Y_COORD_WHITE_PLAYER_OTHER + PieceFactory.DIST_BETWEEN_PIECES);\n }", "public PersonalBoard(int width, int height){\n super(width, height);\n this.rand = new Random();\n }", "private void setupBoard() {\n setBackground(Color.BLACK);\n setPreferredSize(new Dimension(myWidth, myHeight));\n myBoard.addObserver(this);\n enableStartupKeys();\n }", "public interface Place {\n\n public boolean canMoveAbove();\n public boolean canMoveBelow();\n public boolean canMoveLeft();\n public boolean canMoveRight();\n public boolean canMoveDiagonal();\n\n public void setAbove(Place h);\n public void setBelow(Place h);\n public void setLeft(Place h);\n public void setRight(Place h);\n public void setDiagonal(Place h);\n\n public void setPixel(int x, int y);\n public int getX();\n public int getY();\n public void setLabel(String l);\n public String getLabel();\n public Place getAbove();\n public Place getBelow();\n public Place getLeft();\n public Place getRight();\n public Room getDiagonal();\n\n public void setPlayer(Player p);\n public boolean occupiedByPlayer();\n public void removePlayer();\n}", "private void prepare()\n {\n Block block = new Block(10);\n addObject(block,372,150);\n Wall wall = new Wall();\n addObject(wall,52,167);\n Wall wall2 = new Wall();\n addObject(wall2,160,167);\n Wall wall3 = new Wall();\n addObject(wall3,550,167);\n Wall wall4 = new Wall();\n addObject(wall4,650,167);\n Wall wall5 = new Wall();\n addObject(wall5,750,167);\n block.setLocation(306,171);\n Robot robot = new Robot();\n addObject(robot,48,51);\n Pizza pizza = new Pizza();\n addObject(pizza,550,60);\n Pizza pizza2 = new Pizza();\n addObject(pizza2,727,53);\n Pizza pizza3 = new Pizza();\n addObject(pizza3,364,303);\n Pizza pizza4 = new Pizza();\n addObject(pizza4,224,400);\n Pizza pizza5 = new Pizza();\n addObject(pizza5,622,395);\n ScorePanel scorePanel = new ScorePanel();\n addObject(scorePanel,106,525);\n Home home = new Home();\n addObject(home,717,521);\n\n block.setLocation(344,173);\n pizza3.setLocation(394,297);\n Pizza pizza6 = new Pizza();\n addObject(pizza6,711,265);\n Pizza pizza7 = new Pizza();\n addObject(pizza7,68,276);\n\n }", "public Board() {\n\t\tintializeBoard(_RowCountDefault, _ColumnCountDefault, _CountToWinDefault);\n\t}", "public final void initialPosition() {\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.RED, Type.PAWN), new PositionImpl( 38 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.BLACK, Type.PAWN), new PositionImpl( 12 + i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.YELLOW, Type.PAWN), new PositionImpl( 1 + 8*i));\n\t\t}\n\t\tfor( int i = 0; i < 4; i++) {\n\t\t setPiece( new PieceImpl( Color.GREEN, Type.PAWN), new PositionImpl( 48 + i));\n\t\t}\n\t\t\n\t\tsetPiece( new PieceImpl( Color.RED, Type.BOAT), new PositionImpl( 63 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KNIGHT), new PositionImpl( 55 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.ELEPHANT), new PositionImpl( 47 ));\n\t\tsetPiece( new PieceImpl( Color.RED, Type.KING), new PositionImpl( 39 ));\n\t\t\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.BOAT), new PositionImpl( 7 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KNIGHT), new PositionImpl( 6 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.ELEPHANT), new PositionImpl( 5 ));\n\t\tsetPiece( new PieceImpl( Color.BLACK, Type.KING), new PositionImpl( 4 ));\n\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.BOAT), new PositionImpl( 0 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KNIGHT), new PositionImpl( 8 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.ELEPHANT), new PositionImpl( 16 ));\n\t\tsetPiece( new PieceImpl( Color.YELLOW, Type.KING), new PositionImpl( 24 ));\n\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.BOAT), new PositionImpl( 56 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KNIGHT), new PositionImpl( 57 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.ELEPHANT), new PositionImpl( 58 ));\n\t\tsetPiece( new PieceImpl( Color.GREEN, Type.KING), new PositionImpl( 59 ));\n\t\t\n }", "private void initBackGround() {\n Entity walls = Entities.makeScreenBounds(100);\n walls.setType(PinballTypes.WALL);\n walls.addComponent(new CollidableComponent(true));\n getGameWorld().addEntity(walls);\n\n Entities.builder()\n .viewFromTexture(\"piñi.jpg\")\n .buildAndAttach();\n\n// adds bottom part of table, shared with all tables\n// getGameWorld().addEntity(factory.bottomLeft());\n// getGameWorld().addEntity(factory.bottomRight());\n }", "public static void main(String[] args) {\n\n Board myboard = new Board(8,8);\n System.out.println(myboard.drawBoard());\n myboard.boardToLetters();\n //System.out.println(myboard.drawBoard());\n // myboard.boardToFigures();\n // System.out.println(myboard.drawBoard());\n\n System.out.println(\"------------------- Movimientos Posibles\");\n //myboard.obtenerPiezasPorColor();\n\n Coordinate coordinate = new Coordinate(4,3);\n Piece pieza = myboard.obtenerPiezaCoordenadas(coordinate);\n Movimientos movimientos = new Movimientos(pieza, myboard);\n ArrayList<Coordinate> listaMovimientos = new ArrayList<>(movimientos.obtenerMovimientos());\n\n //System.out.println(piece.toString());\n for(Coordinate coordenadas : listaMovimientos)\n {\n System.out.println(coordenadas.toString());\n }\n\n if(listaMovimientos.isEmpty())\n {\n System.out.println(\"Esta vacia\");\n }\n }", "public abstract void gameLogic(Cell currentCell);" ]
[ "0.6790752", "0.6461386", "0.6375507", "0.63660324", "0.6359709", "0.6337701", "0.63307416", "0.63204426", "0.6307523", "0.6260508", "0.6229936", "0.62271696", "0.6205758", "0.6190841", "0.61756986", "0.6163486", "0.6118671", "0.6115042", "0.61060315", "0.60936433", "0.6076354", "0.60712075", "0.6069764", "0.6063796", "0.60559016", "0.6049882", "0.6048085", "0.60326505", "0.602893", "0.5996169", "0.59959906", "0.59894115", "0.59889174", "0.59790194", "0.5970379", "0.59502965", "0.5949545", "0.5944224", "0.5934555", "0.5912619", "0.58824277", "0.58725", "0.58624846", "0.5860818", "0.585868", "0.58555514", "0.58538806", "0.5853776", "0.5847286", "0.5841103", "0.5833754", "0.58233285", "0.58228683", "0.5821301", "0.5818907", "0.58182263", "0.581732", "0.57865405", "0.5786032", "0.57857734", "0.5780631", "0.57795745", "0.57768965", "0.57742053", "0.5768692", "0.5767672", "0.57638675", "0.576113", "0.576113", "0.57576656", "0.5756026", "0.5746985", "0.5746832", "0.57411706", "0.5736172", "0.57342845", "0.57247424", "0.5722616", "0.5718695", "0.5717692", "0.57043266", "0.5701817", "0.5699625", "0.56996065", "0.56990874", "0.5697794", "0.569567", "0.5680915", "0.56805", "0.56789327", "0.5678509", "0.56729513", "0.56659704", "0.56575894", "0.5650734", "0.56491333", "0.5648468", "0.5643177", "0.5640968", "0.5640026", "0.5639668" ]
0.0
-1
I have assumed that there are no duplicate characters in the string.
public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str; System.out.print("Enter the string : "); str = scan.next(); int len = str.length(); Assignment obj = new Assignment(); obj.recursiveCall(str, 0, len); for (int i = 0; i <= lst.size() - 1; i++) { System.out.println(lst.get(i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean uniqueCharStringNoDS(String s){\r\n for (int i = 0; i < s.length(); i++){\r\n for (int j = i+1; j < s.length(); j++){\r\n char temp = s.charAt(i);\r\n if (temp == s.charAt(j)){\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public void nonRepeatingCharacter(String s)\n\t{\n\t\tMap<Character, Integer> charMap = new LinkedHashMap<>();\n\t\tCharacter unique = null;\n\t\tchar[] stringArray = s.toCharArray();\n\t\tint repeat =0;\n\t\tfor(int i=0; i< stringArray.length; i++ )\n\t\t{\n\t\t\tif(!charMap.keySet().contains(stringArray[i]))\n\t\t\t{\n\t\t\t\tcharMap.put(stringArray[i], 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tInteger value = charMap.get(stringArray[i]);\n\t\t\t\tvalue++;\n\t\t\t\tcharMap.put(stringArray[i], value);\n\t\t\t}\n\t\t}\n\t\t//System.out.println(charMap.toString());\n\t\tfor(Character i : charMap.keySet())\n\t\t{\n\t\t\tint value = charMap.get(i);\n\t\t\tif(value == 1)\n\t\t\t{\n\t\t\t\tunique = i;\n\t\t\t\t//System.out.println(\"found unique \"+ unique);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i< stringArray.length; i++ )\n\t\t{\n\t\t\tif(unique!= null && stringArray[i] == unique)\n\t\t\t{\n\t\t\t\tSystem.out.println(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void firstNonRepeated(String str){\n Map<Character, Integer> map = new LinkedHashMap<Character, Integer>();\n\n /*Input string convert to array of char*/\n char[] charArray = str.toCharArray();\n\n\n /*Iterating through array, count and put in hashmap */\n for(char c:charArray) {\n if (map.get(c) != null)\n map.put(c, map.get(c) + 1);\n else\n map.put(c, new Integer(1));\n }\n\n\n /*Iterating through map and check if there is character with just one occurrence*/\n Set<Character> keySet = map.keySet();\n for(Character key : keySet){\n if (map.get(key) == 1){\n System.out.println(\"Character is: \"+ key);\n System.exit(0);\n }\n }\n System.out.println(\"There are no characters with just one occurrence!\");\n }", "public static boolean uniqueCharString(String s){\r\n HashMap<Character, Integer> map = new HashMap<Character, Integer>();\r\n for (int i = 0; i < s.length(); i++){\r\n if (map.get(s.charAt(i)) == null){\r\n map.put(s.charAt(i), 1);\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "static int twoCharaters(String s) {\n\t\tList<String> list = Arrays.asList(s.split(\"\"));\n\t\tHashSet<String> uniqueValues = new HashSet<>(list);\n\t\tSystem.out.println(uniqueValues);\n\t\tString result;\n\t\twhile(check(list,1,list.get(0))) {\n\t\t\tresult = replace(list,1,list.get(0));\n\t\t\tif(result != null) {\n\t\t\t\tSystem.out.println(result);\n\t\t\t\ts = s.replaceAll(result,\"\");\n\t\t\t\tlist = Arrays.asList(s.split(\"\"));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t\treturn 5;\n }", "private static char firstNonRepeatingCharacterV2(String str) {\n if(str == null) return '_';\n Map<Character, Integer> charCountMap = new HashMap<>();\n Set<Character> linkedHashSet = new LinkedHashSet<>();\n\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.containsKey(ch)) {\n charCountMap.put(ch, charCountMap.get(ch) + 1); // do not need this step\n linkedHashSet.remove(ch);\n } else {\n charCountMap.put(ch, 1);\n linkedHashSet.add(ch);\n }\n }\n //The first character in the linkedHashSet will be the firstNonRepeatingCharacter.\n Iterator<Character> itr = linkedHashSet.iterator();\n if(itr.hasNext()){\n return itr.next();\n } else {\n return '_';\n }\n }", "private static boolean hasUniqueChars(String str) {\n\t\tfor(int i = 0; i < str.length(); i++) {\n\t\t\tfor(int j = i+1; j < str.length(); j++) {\n\t\t\t\tif( str.charAt(i) == str.charAt(j) )\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private static char firstNonRepeatingCharacterV1(String str) {\n if(str == null) return '_';\n Map<Character, Integer> charCountMap = new HashMap<>();\n Set<Character> linkedHashSet = new LinkedHashSet<>();\n\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.containsKey(ch)) {\n charCountMap.put(ch, charCountMap.get(ch) + 1); // do not need this step\n } else {\n charCountMap.put(ch, 1);\n }\n }\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.get(ch) == 1) {\n return ch;\n }\n }\n return '_';\n }", "public static boolean hasAllUniqueChars1(String string) {\n for(int i = 0; i < string.length(); i++) {\n for(int j = i + 1; j < string.length(); j++) {\n if(string.charAt(i) == string.charAt(j)) return false;\n }\n }\n\n return true;\n }", "public static boolean isUnique1(String str) {\n HashSet<Character> set = new HashSet<>();\n for (int i = 0; i < str.length(); i++) {\n if (set.contains(str.charAt(i)))\n return false;\n set.add(str.charAt(i));\n }\n return true;\n }", "private static boolean isUnique(String str) {\n\t\tif(str.length() > 256)\n\t\t\treturn false;\n\t\tboolean [] char_set = new boolean[256];\n\t\tfor(int i =0; i<str.length();i++) {\n\t\t\tint value = str.charAt(i);\n\t\t\tif(char_set[value])\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tchar_set[value] = true;\n\t\t}\n\t\treturn true;\n\t}", "public static int firstUniqChar(String s) {\n\n HashMap<String, Integer> hm = new HashMap<>();\n\n for(int i = 0; i < s.length(); i++) {\n if(hm.containsKey(s.substring(i, i+1))) {\n hm.put(s.substring(i,i+1), hm.get(s.substring(i,i+1))+1);\n }\n else {\n hm.put(s.substring(i,i+1), 1);\n }\n }\n\n for(int i = 0; i< s.length(); i++) {\n if(hm.get(s.substring(i,i+1)) == 1) {\n return i;\n }\n }\n //this means all the string is repeating\n return -1;\n }", "public static boolean isUnique(String s) {\n if (s.length() > 128) return false;\n\n // we dont need to check the last element\n for (int i = 0; i < s.length() - 1; i++){\n String current = \"\";\n current += s.charAt(i);\n// System.out.println(current);\n if (s.substring(i + 1).contains(current))\n return false;\n }\n return true;\n }", "private static boolean isUniqueM1(String str) {\n boolean isUnique = true;\n\n for (int i = 0; i < str.length(); i++) {\n\n for (int j = i + 1; j < str.length(); j++) {\n if (str.charAt(i) == str.charAt(j)) {\n isUnique = false;\n }\n }\n }\n return isUnique;\n }", "public static String uniqueChar(String str){\n\n char[] ch=str.toCharArray();\n str=\"\";\n HashMap<Character,Integer> map=new HashMap<>();\n for(int i=0;i<ch.length;i++)\n {\n if(map.containsKey(ch[i]));\n else\n {\n str+=ch[i];\n map.put(ch[i],1);\n }\n }\n \n return str;\n\t}", "private static boolean isUniqueM2(String str) {\n\n if (str.length() > 128) return false;\n\n boolean[] char_set = new boolean[128];\n for (int i = 0; i < str.length(); i++) {\n int val = str.charAt(i);\n System.out.println(\"str.charAt(i): \" + val);\n if (char_set[val]) {\n return false;\n }\n char_set[val] = true;\n }\n return true;\n }", "void ifUnique(char inputCharArray[])\n\t{\n\t\tint count=0;\n\t\t\n\t\tfor(int i=0; i<inputCharArray.length; i++)\n\t\t{\n\t\t\t//int ab = (int)inputCharArray[i]; \n\t\t\tchar ab = inputCharArray[i];\n\t\t\tfor (int j=0; j<i; j++)\n\t\t\t{\n\t\t\t\tif(ab==inputCharArray[j])\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"String not unique!\");\n\t\t\t\t\tcount = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor (int j=i+1; j<inputCharArray.length; j++)\n\t\t\t{\n\t\t\t\tif(ab==inputCharArray[j])\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"String not unique!\");\n\t\t\t\t\tcount = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (count==1)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif (count==0)\n\t\t{\n\t\t\tSystem.out.print(\"String unique!\");\n\t\t}\n\t}", "boolean isUniqueUsingBruteForce(String str) {\n\t\t// If at any time we encounter 2 same\n\t\t// characters, return false\n\t\tfor (int i = 0; i < str.length(); i++)\n\t\t\tfor (int j = i + 1; j < str.length(); j++)\n\t\t\t\tif (str.charAt(i) == str.charAt(j))\n\t\t\t\t\treturn false;\n\t\t// If no duplicate characters encountered,\n\t\t// return true\n\t\treturn true;\n\t}", "public static String removeDuplicates(String s)\n {\n if (s==null||s.isEmpty()) return s;\n Set<Character> charSet = new HashSet<Character>(s.length());//maximum possible capacity\n //Set.add will only add characters not already in the list\n for (char c : s.toCharArray())\n {\n charSet.add(c);\n }\n StringBuilder sb = new StringBuilder(charSet.size());\n for (Character c : charSet)\n {\n sb.append(c);\n }\n return sb.toString();\n }", "public static char findFirstDuplicates(String str){\n //a green apple\n // ^ now set contains 'e'\n Set<Character> set = new HashSet<>();\n\n for(Character ch:str.toCharArray()){\n if(set.contains(ch)) return ch;\n\n set.add(ch);\n }\n return Character.MIN_VALUE;\n\n }", "boolean hasUniqueCharactersTimeEfficient(String s) {\n Set<Character> characterSet = new HashSet<Character>();\n for(int i=0; i < s.length();i++) {\n if(characterSet.contains(s.charAt(i))) {\n return false;\n } else {\n characterSet.add(s.charAt(i));\n }\n }\n return true;\n }", "public static boolean isUniqueChars(String str) {\n\t if(str.length() > 128) return false;\n\t \n\t //created hash table boolean to flag duplicate characters\n\t boolean [] check = new boolean [128];\n\t \n\t //run a for look in order to iterate through the string.\n for(int i = 0; i < str.length(); i++){\n //convert the characters of the string array into integers\n int val = str.charAt(i);\n //check the hash table for past characters seen, there are 128 ascii codes\n\t if(check[val]) return false;\n\t //turn on the true flag for characters you are seeing\n\t check[val] = true;\n\t }\n\t \n\t //pass the hash table therefore it is unique and true;\n\t return true;\n\n\t}", "public static String uniques(String str){\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n return uniques;\n\n }", "public static boolean isUnique(String input) {\r\n // Create a Set to insert characters\r\n Set<Character> set = new HashSet<>();\r\n\r\n // get all characters form String\r\n char[] characters = input.toCharArray();\r\n\r\n for (Character c : characters) {\r\n if (!set.add(c)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static String removeDuplicateLetters(String s) {\r\n\t\t\r\n\t\tStringBuilder output = new StringBuilder();\r\n\t\t\r\n\t\tSet<Character> letters = new HashSet<>();\r\n\t\t\r\n\t\tfor (Character c : s.toCharArray()) {\r\n\t\t\tif (!letters.contains(c) || c.equals(' ')) {\r\n\t\t\t\tletters.add(c);\r\n\t\t\t\toutput.append(c);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn output.toString();\r\n\t}", "private static int firstUniqChar2(String s) {\n Map<Character, Integer> seen = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n seen.put(c, seen.getOrDefault(c, 0) + 1);\n }\n\n int uniqueIdx = -1;\n for (int i = 0; i < s.length(); i++) {\n if (seen.get(s.charAt(i)) == 1) {\n uniqueIdx = i;\n break;\n }\n }\n\n return uniqueIdx;\n }", "public static void main(String[] args) {\n\t\t\t\n\tString str = \"aaabbbddddcccaabd\";\n\t\n\tString RemoveDup = \"\";//to store non-duplicate values of the str\n\t\n\t\n\t\n\tfor(int i = 0; i < str.length(); i++) {\n\t\tif (!RemoveDup.contains(str.substring(i, i+1))) {\n\t\t\tRemoveDup += str.substring(i, i+1);//will concat character from str to RemoveDup\n\t\t}\n\t\t\n\t}\n\tSystem.out.println(RemoveDup);\t\n\t\t\n\t\t\n\t// str = \"aaabbbddddcccaabd\"; RemoveDup = \"abcd\"\n\t//\t\t\t\t\t\t\t\t\t\t j, j+1\n\t\t// result = a5b4c3d5\n\t\t\n\t\tString result = \"\";//store expected result\n\t\t int count = 0;//count the numbers occurred characters\n\t\t\n\t\tfor(int j=0; j < RemoveDup.length(); j++) {\n\t\t for(int i=0; i <str.length(); i++) {\n\t\t\t if(str.substring(i, i+1).equals(RemoveDup.substring(j, j+1))) {\n\t\t\t\t count++;\n\t\t\t }\n\t\t }\n\t\t result += RemoveDup.substring(j, j+1)+count;\n\t\t\n\t\t}\n\t\t System.out.println(result);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static String evensOnlyNoDupes( String s ) {\n Set<Character> h = new LinkedHashSet<Character>(); //--initializing the hashset\n String s2 = \"\"; //tkaing pieces of the string --> put it into s2 ean empty string\n\n for (int i = 0; i < s.length(); i++) {\n if ((int)s.charAt(i) % 2 == 0) {\n if (!h.contains(s.charAt(i))) {\n s2 += s.charAt(i); // a += b means a + b so youre adding the chracter to the s2 string\n h.add(s.charAt(i)); // a set contains a bunch of characters and you need to add the character to the set so that it can tell you if it has showed up or not yet in the set\n }\n }\n }\n return s2;\n }", "private static boolean isUnique(String str) {\n\t\tfor(char c: str.toCharArray()) {\n\t\t\tif(str.indexOf(c) == str.lastIndexOf(c))\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static void main(String[] args) {\n\n String str = \"aabccdddd\";\n String removeDup= \"\"; //a b c d\n //1 2 3 4\n int count = 0;\n for (int i = 0; i <str.length() ; i++) {\n char each = str.charAt(i);\n\n if (removeDup.contains(\"\"+each)){ //if the character is already contained in removeDup\n continue; //skip it\n }\n\n\n\n\n\n\n }\n System.out.println(removeDup);\n\n\n }", "static char nonrepeatingCharacter(String S)\n {\n int arr[]=new int[256];\n for(int i=0;i<S.length();i++){\n arr[S.charAt(i)]++;\n }\n for(int i=0;i<S.length();i++){\n if(arr[S.charAt(i)]==1)\n return S.charAt(i);\n }\n return '$';\n }", "public static Character findFirstNonRepetedCharacter(String str){\n Map<Character,Integer> map = new HashMap<>();\n\n char[] chars = str.toCharArray();\n for(Character ch: chars){\n //Terinery operator if chracter contains value increment by one\n var count = map.containsKey(ch) ? map.get(ch) : 0;\n map.put(ch,count +1);\n }\n\n //due to hashfunction map store these values in different places in memory( not sequentially)\n //now match the character in String from first to end corresponding to Map values\n for(Character ch: chars){\n //first non repeated value a green apple in string | in { =2, p=2, a=2, r=1, e=3, g=1, l=1, n=1}\n if(map.get(ch)==1) return ch; // ^\n }\n\n return Character.MIN_VALUE; // a default value when cant find any 1st repeated\n }", "private static int firstUniqChar1(String s) {\n int[] counts = new int[128];\n for (int i = 0; i < s.length(); i++) {\n int c = s.charAt(i);\n counts[c] = counts[c] + 1;\n }\n\n int uniqueIdx = -1;\n for (int i = 0; i < s.length(); i++) {\n if (counts[(int) s.charAt(i)] == 1) {\n uniqueIdx = i;\n break;\n }\n }\n\n return uniqueIdx;\n }", "public static void main(String[] args) {\n String str = \"abcDaaafmOO\";\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n System.out.println(\"unique values are: \"+uniques);\n System.out.println(\"========================\");\n String str2 = \"ppppoifugggggsxL\";\n String uniques2 = uniques(str2);\n System.out.println(\"unique values are: \"+uniques2);\n }", "private static boolean isUnique(String str) {\n if (str.length() > 128) {\n return false;\n }\n boolean[] boolArray = new boolean[128];\n for (int i = 0; i < str.length(); i++) {\n int val = str.charAt(i);\n if (boolArray[val]) {\n return false;\n }\n boolArray[val] = true;\n }\n return true;\n }", "public boolean isStringMadeofAllUniqueChars(String word) {\n if (word.length() > 128) {\n return false;\n }\n boolean[] char_set = new boolean[128];\n for (int i = 0; i < word.length(); i++) {\n int val = word.charAt(i);\n System.out.println(val);\n if (char_set[val]) {\n return false;\n }\n char_set[val] = true;\n }\n return true;\n }", "public boolean uniqueCharacters(String st) {\n\t\tif(st.length() > 256) return false;\n\t\t\n\t\tboolean[] char_set = new boolean[256];\n\t\tfor(int i=0; i < st.length(); i++) {\n\t\t\tint val = st.charAt(i);\n\t\t\tif(char_set[val])\n\t\t\t\treturn false;\n\t\t\tchar_set[val] = true;\n\t\t}\n\t\treturn true;\n\t}", "public static Map<Character, Integer> findDuplicateCharactersInAString(final String input){\n\n Map<Character, Integer> charCountMap= null;\n if(input !=null && input.length() > 0)\n {\n if(input.length() ==1){\n return charCountMap;\n }\n charCountMap = new LinkedHashMap<Character, Integer>();\n String inputString = input;\n // In case if the program need not consider capital and small letters,\n // if want to consider comment out below line\n inputString = inputString.toLowerCase();\n char [] inputChars = inputString.toCharArray();\n\n for(Character c : inputChars) {\n\n if (charCountMap.containsKey(c)) {\n charCountMap.put(c, charCountMap.get(c) + 1);\n } else {\n charCountMap.put(c, 1);\n }\n }\n }\n else{\n throw new IllegalArgumentException(\"Invalid input\");\n }\n return charCountMap;\n }", "static void stringConstruction(String s) {\n\n StringBuilder buildUniq = new StringBuilder();\n boolean[] uniqCheck = new boolean[128];\n\n for (int i = 0; i < s.length(); i++) {\n if (!uniqCheck[s.charAt(i)]) {\n uniqCheck[s.charAt(i)] = true;\n if (uniqCheck[s.charAt(i)]){\n buildUniq.append(s.charAt(i));\n }\n }\n }\n String unique=buildUniq.toString();\n int n = unique.length();\n System.out.println(n);\n }", "@Test\n public void repeatedSubstringPattern() {\n assertTrue(new Solution1().repeatedSubstringPattern(\"abcabcabcabc\"));\n }", "public static boolean isUniqueChars2(String str) {\n\t\tboolean[] char_set = new boolean[256];\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tint val = str.charAt(i);\n\t\t\tSystem.out.println(\"Value at i = \"+i +\" is \"+val);\n\t\t\tif (char_set[val]) return false;\n\t\t\tchar_set[val] = true;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean hasAllUniqueChars2(String string) {\n HashSet<Character> characters = new HashSet<>();\n\n for(Character character : string.toCharArray()) {\n if (characters.contains(character)) return false;\n else characters.add(character);\n }\n\n return true;\n }", "public static void findUniqueOptimalSolution(String inputString) {\n boolean[] charArray = new boolean[128];\n for (int i = 0; i < inputString.length(); i++) {\n int val = inputString.charAt(i);\n if (charArray[val]) {\n System.out.println(\"Input String dont have unique characters:\" + inputString);\n return;\n }\n charArray[val] = true;\n }\n System.out.println(\"Input String has unique characters \" + inputString);\n }", "public static void findUniqueUsingHashMap(String inputString) {\n\n HashMap<Character, Integer> stringHashMap = new HashMap<>();\n for (int i = 0; i < inputString.length(); i++) {\n if (stringHashMap.containsKey(inputString.charAt(i))) {\n System.out.println(\"Input String dont have unique characters:\" + inputString);\n return;\n }\n stringHashMap.put(inputString.charAt(i), i);\n }\n System.out.println(\"Input String has unique characters \" + inputString);\n }", "public static String removeAdjacentDuplicateChars(String s) {\r\n \tif (s.length() == 0) {\r\n \t\treturn \"\";\r\n \t}\r\n \telse {\r\n \t\tint len = s.length();\r\n \t\tString result = removeHelper(s, len - 1);\r\n \t\treturn result;\r\n \t}\r\n }", "public static String uniqueChars(String str) {\n String result = \"\";\n char[] ch = str.toCharArray();\n\n for (int i = 0; i < ch.length; i++) {\n if(!result.contains(\"\" + ch[i])){\n result+=\"\" + ch[i];\n }\n\n }\n\n return result;\n }", "public static boolean checkUnique(String s) {\n\t\tif (s == null || s.length() == 0)\n\t\t\treturn true;\n\t\tHashMap<Character, Integer> map = new HashMap<Character, Integer>();\n\t\tchar[] arr = new char[s.length()];\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\tif (!map.containsKey(s.charAt(i)))\n\t\t\t\tmap.put(s.charAt(i), 1);\n\t\t\telse if (map.containsKey(s.charAt(i))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static String removeDuplicatesMaintainOrder(String str) {\n\t\tboolean seen[] = new boolean[256];\n\t\tStringBuilder sb = new StringBuilder(seen.length);\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tchar ch = str.charAt(i);\n\t\t\t// System.out.println((int)ch);\n\t\t\tif (!seen[ch]) {\n\t\t\t\tseen[ch] = true;\n\t\t\t\tsb.append(ch);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}", "public static boolean uniqueString(String s) {\n java.util.HashSet<Character> hash = new java.util.HashSet<>();\n\n for (Character c : s.toCharArray()) {\n if (!hash.add(c)) return false;\n }\n return true;\n }", "public static void removeDuplicates(char [] str)\n{\n\tif(str.length <2) return;\n\tif(str == null) return;\n\tint j, tail=1;\n\tfor(int i=1; i<str.length; i++)\n\t{\n\t\tfor(j=0; j<tail; j++)\n\t\t{\n\t\t\tif(str[i] == str[j])\n\t\t\t\tbreak;\n\t\t}\n\t\tif(j==tail)\n\t\t{\n\t\t\tstr[tail++] = str[i];\n\t\t\t\n\t\t}\n\t}\n\tstr[tail] = '\\0';\t\n}", "public boolean testAllUniqueInplace(String string) {\n\t\tif (string.length() > 128) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < string.length(); i++) {\n\t\t\tfor (int j = i + 1; j < string.length(); j++) {\n\t\t\t\tchar ith = string.charAt(i);\n\t\t\t\tchar jth = string.charAt(j);\n\n\t\t\t\tif (ith == jth) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static void main(String[] args) {\nString word = \"aabbaaaccbbaacc\";\n String result = \"\";\n\n for (int i = 0; i <=word.length()-1 ; i++) {\n\n if(!result.contains(\"\"+word.charAt(i))){ //if the character is not contained in the result yet\n result+=word.charAt(i); //then add the character to the result\n }\n\n }\n System.out.println(result);\n\n\n\n }", "public static boolean hasAllUniqueChars3(String string) {\n String sorted = Stream.of(string.split(\"\")).sorted().collect(Collectors.joining());\n\n for(int i = 1; i < sorted.length(); i++) {\n if(sorted.charAt(i - 1) == sorted.charAt(i)) return false;\n }\n\n return true;\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString s = scan.nextLine();\r\n\t\tString st[] = s.split(\" \");\r\n\t\tString output =\"\";\r\n\t\t\r\n\t\tfor (int i = 0; i < st.length; i++) {\r\n\t\t\tString s1 = st[i];\r\n\t\t\tString dup =\"\";\r\n\t\t\tfor (int j = 0; j < s.length(); j++) {\r\n\t\t\tif(!(dup.contains(s.charAt(j)+\"\"))){\r\n\t\t\tdup+=s.charAt(j);\r\n\t\t}\r\n\t\t}\r\n\t\t\tif(!(output.contains(dup))){\r\n\t\t\t\toutput+=dup+\" \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t}\r\n\t\tSystem.out.println(output);\r\n}", "public static void main(String[] args) {\n\t\t\r\n\t\tString str1 = \"garima\";\r\n\t\t\r\n\t\tSystem.out.println(\"The given string is:\"+str1);\r\n\t\t\r\n\t\tfor(int i = 0; i < str1.length(); i++)\r\n\t\t{\r\n\t\t\tboolean unique = true;\r\n\t\t\t\r\n\t\t\tfor(int j = 0; j < str1.length(); j++)\r\n\t\t\t{\r\n\t\t\t\tif(i != j && str1.charAt(i) == str1.charAt(j)) {\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(unique)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"The first non-repeating character in String:\"+str1.charAt(i));\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static String RemoveDublicates(String str) {\n String result = \"\"; //storing result of the loop\n for (int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if (!result.contains(\"\" + ch)) { // this is char so we need convert comcating to empty string\n result += ch;\n }\n\n }\n return result;\n }", "public static boolean isUnique(String str)\n\t{\n\t\tif(str.length()>128)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tboolean [] char_set= new boolean [128];\n\t\t\n\t\tfor(int i=0;i<str.length();i++)\n\t\t{\n\t\t\tint val = str.charAt(i);\n\t\t\tif(char_set[val])\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tchar_set[val]=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "boolean checkUnique(String str){\r\n\t\tif(str.length()>128){\r\n\t\t\treturn false;\r\n\t\t\t}\r\n\t\tboolean[] arr = new boolean[128];\r\n\t\tfor(int i=0; i< str.length(); i++){\r\n\t\t\tint val = str.charAt(i);\r\n\t\t\tif(arr[val])\r\n\t\t\t\treturn false;\r\n\t\t\tarr[val]=true;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public boolean isUniqueChars(String str) {\n\t\tif (str.length() > 128) return false;\n\t\tboolean[] char_set = new boolean[128];\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tint val = str.charAt(i);\n\t\t\tif (char_set[val]) return false;\n\t\t\tchar_set[val] = true;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isUniqueUsingHashing(String str) {\n\t\tSet<Character> set = new HashSet<>();\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tchar c = str.charAt(i);\n\t\t\t// Checks if set already contains given character. If yes return false else add\n\t\t\t// to the set.\n\t\t\tif (set.contains(c)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tset.add(c);\n\t\t}\n\t\treturn true;\n\t}", "public int firstUniqChar(String s) {\r\n int res = s.length();\r\n for (char c = 'a'; c <= 'z'; c++) {\r\n int index = s.indexOf(c);\r\n if (index != -1 && index == s.lastIndexOf(c)) res = Math.min(res, index);\r\n }\r\n\r\n return res == s.length() ? -1 : res;\r\n }", "private static int firstUniqChar3(String s) {\n if (s == null || s.isEmpty()) {\n return -1;\n }\n\n int idx = Integer.MAX_VALUE;\n for (char c = 'a'; c <= 'z'; c++) {\n int first = s.indexOf(c);\n int last = s.lastIndexOf(c);\n\n if (first != -1 && first == last) {\n idx = Math.min(idx, first);\n }\n }\n\n return idx == Integer.MAX_VALUE ? -1 : idx;\n }", "public static void main(String[] args) {\n\t\tString myString = \"abcdea\";\n\t\tint flag = 1;\n\t\t\n\t\tfor (int i=0; i < myString.length(); i++) {\n\t\t\tfor (int j=0; j < myString.length(); j++) {\n\t\t\t\tif(myString.charAt(i)==myString.charAt(j) && i!=j) {\n\t\t\t\t\tflag = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tif(flag==1) {\n\t\t\tSystem.out.println(\"The string has unique characters\");\n\t\t}else {\n\t\t\tSystem.out.println(\"The string does not have unique characters\");\n\t\t}\n\n\t}", "static boolean possibleSameCharFreqByOneRemoval(String str)\n {\n int l = str.length();\n\n // fill frequency array\n int[] freq = new int[M];\n\n for (int i = 0; i < l; i++)\n freq[getIdx(str.charAt(i))]++;\n\n // if all frequencies are same, then return true\n if (allSame(freq, M))\n return true;\n\n /* Try decreasing frequency of all character\n by one and then check all equality of all\n non-zero frequencies */\n for (char c = 'a'; c <= 'z'; c++) {\n int i = getIdx(c);\n\n // Check character only if it occurs in str\n if (freq[i] > 0) {\n freq[i]--;\n\n if (allSame(freq, M))\n return true;\n freq[i]++;\n }\n }\n\n return false;\n }", "public static Character nonRepeating(String s) {\n Map<Character, Integer> charCount = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (charCount.containsKey(c)) {\n charCount.put(c, charCount.get(c) + 1);\n } else {\n charCount.put(c, 1);\n }\n }\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (charCount.get(c) == 1) {\n return c;\n }\n }\n return null;\n }", "public static String removeConsecutiveDuplicates(String str){\n\n Stack<Character> st = null;\n String abc = \"\";\n char c = '0';\n int size = str.length();\n int x= 0;\n while(x+1<=size){\n char z = str.charAt(x);\n if(x+1==size){\n break;\n }\n else {\n c = str.charAt(x + 1);\n }\n if(abc==\"\") {\n abc = abc + z;\n }\n if(z==c){\n x++;\n }\n else{\n abc = abc + c;\n x++;\n }\n }\n return abc;\n // Your code here\n }", "static String superReducedString(String s) {\n StringBuffer buff = new StringBuffer(s);\n for(int i = buff.length() - 1; i >= 0; i--){\n int j = i + 1;\n if(j >= buff.length()) continue;\n\n if(buff.charAt(i) == buff.charAt(j)) {\n buff.delete(i, j + 1);\n }\n }\n\n if(buff.length() == 0) return \"Empty String\";\n return String.valueOf(buff);\n }", "public static boolean isAllUnique(String string) {\n\n // Let's create a new HashSet to cache the characters.\n HashSet<Character> set = new HashSet<>();\n\n for (char c : string.toCharArray()) {\n if (set.contains(c)) {\n return false;\n } else {\n set.add(c);\n }\n }\n\n return true;\n }", "public boolean isUnique(String input) {\n if (input == null || input.length() == 0) {\n return false;\n }\n\n char[] chars = input.toCharArray();\n Arrays.sort(chars);\n for (int i = 0; i < chars.length - 1; i += 1) {\n if (chars[i+1] == chars[i]) {\n return false;\n }\n }\n return true;\n }", "public static boolean allUnique2(String s ){\n\t\tint value = 0;\n\t\tchar[] chars = s.toCharArray();\n\t\tfor(char c : chars) \n\t\t{\t\n\t\t\tint i = c -'a';\n\t\t\tif(((1<<i+1)&value)>0)\n\t\t\t\treturn false;\n\t\t\tvalue = value | (1<<i+1);\n\t\t}\n\t\treturn true;\n\t}", "public String removeDuplicates(String S) {\n if(S==null||S.length()==0){\n return S;\n }\n Deque<Character> stack=new LinkedList<>();\n for(int i=0,length=S.length();i<length;i++){\n if(stack.size()!=0&&(stack.peekFirst()==S.charAt(i))){\n stack.removeFirst();\n }\n else{\n stack.addFirst(S.charAt(i));\n }\n }\n StringBuilder builder=new StringBuilder();\n while(stack.size()!=0){\n builder.insert(0,stack.removeFirst());\n }\n return builder.toString();\n }", "static int alternate(String s) {\n\n \n char[] charArr = s.toCharArray();\n\n int[] arrCount=new int[((byte)'z')+1];\n\n for(char ch:s.toCharArray()){ \n arrCount[(byte)ch]+=1;\n }\n \n int maxLen=0;\n for(int i1=0;i1<charArr.length;++i1)\n {\n char ch1= charArr[i1];\n for(int i2=i1+1;i2<charArr.length;++i2)\n {\n char ch2 = charArr[i2];\n if(ch1 == ch2)\n break;\n\n //validate possible result\n boolean ok=true;\n {\n char prev = ' ';\n for(char x:charArr){\n if(x == ch1 || x == ch2){\n if(prev == x){\n ok=false;\n break;\n }\n prev = x;\n }\n }\n\n }\n if(ok)\n maxLen = Math.max(maxLen,arrCount[(byte)ch1]+arrCount[(byte)ch2]);\n }\n }\n\n return maxLen;\n\n }", "public static void main(String[] args) {\n\t\n\tString a = \"aabbbc\", b= \"cabbbac\";\n\t// a = abc, b=cab\n\t//we will remove all dublicated values from \"a\"\n\tString a1 = \"\"; //store all the non duplicated values from \"a\"\n\t\n\tfor (int j=0; j<a.length();j++) //this method is with nested loop\n\tfor (int i=0; i<a.length();i++) {\n\t\tif (!a1.contains(a.substring(j, j+1))) {\n\t\t\ta1 += a.substring(j, j+1);\n\t\t}\n\t\t\t\n\t}\n\tSystem.out.println(a1);\n\t//we will remove all duplicated values from \"b\"\n\tString b1 = \"\"; //store all the non duplicated values from \"b\"\n\tfor(int i=0; i<b.length();i++) { //this is with simple loop\n\t\tif(!b1.contains(b.substring(i, i+1))) {\n\t\t\t // \"\"+b.charAt(i)\n\t\t\tb1 += b.substring(i, i+1);\n\t\t\t// \"\"+b.charAt(i);\n\t\t}\n\t}\n\tSystem.out.println(b1);\n\t\n\t\n\t//a1 = \"acb\", b1 = \"cab\"\n\tchar[] ch1 = a1.toCharArray();\n\tSystem.out.println(Arrays.toString(ch1));\n\t\n\tchar[] ch2 = b1.toCharArray();\n\tSystem.out.println(Arrays.toString(ch2));\n\t\n\tArrays.sort(ch1);\n\tArrays.sort(ch2);\n\t\n\tSystem.out.println(\"========================\");\n\tSystem.out.println(Arrays.toString(ch1));\n\tSystem.out.println(Arrays.toString(ch2));\n\t\n\t\n\tString str1 = Arrays.toString(ch1);\n\tString str2 = Arrays.toString(ch2);\n\t\n\tif(str1.equals(str2)) {\n\t\tSystem.out.println(\"true, they are same letters\");\n\t}else {\n\t\tSystem.out.println(\"false, they are contain different letters\");\n\t}\n\t\n\t\n\t// solution 2:\n\t\t\t String Str1 = \"cccccaaaabbbbccc\" , Str2 = \"cccaaabbb\";\n\t\t\t \n\t\t\t Str1 = new TreeSet<String>( Arrays.asList( Str1.split(\"\"))).toString();\n\t\t\t Str2 = new TreeSet<String>( Arrays.asList( Str2.split(\"\"))).toString();\n\t\t\t \n\t\t\t System.out.println(Str1.equals(Str2));\n\t\t\t\t \n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n}", "static String super_reduced_string(String s) {\n if (s.equals(\"\")) return \"Empty String\";\n\n StringBuffer buffer = new StringBuffer(s);\n for (int i = 1; i < buffer.length(); i++) {\n if (buffer.charAt(i) == buffer.charAt(i - 1)) {\n // Delete both if they are the same\n buffer.delete(i - 1, i + 1);\n i = 0;\n }\n\n if (buffer.length() == 0) {\n return \"Empty String\";\n }\n }\n\n return buffer.toString();\n }", "@Test\n public void removeDuplicatesFromString() {\n\n assertEquals(\"IAMDREW\", Computation.removeDuplicates(\"IIIAAAAMDREEEWW\"));\n }", "private static int solution3(String s) {\r\n int n = s.length();\r\n Set<Character> set = new HashSet<>();\r\n int ans = 0, i = 0, j = 0;\r\n while (i < n && j < n) {\r\n if (!set.contains(s.charAt(j))) {\r\n set.add(s.charAt(j++));\r\n ans = Math.max(ans, j - i);\r\n } else {\r\n set.remove(s.charAt(i++));\r\n }\r\n }\r\n return ans;\r\n }", "public static boolean isAllCharacterUnique(String sIn) {\n if (sIn.length() > 32768) {\n return false;\n }\n for (char c : sIn.toCharArray()) {\n if (sIn.indexOf(c) != sIn.lastIndexOf(c)) return false;\n }\n return true;\n }", "public static void hashMapEx() {\n\t\tString str = \"habiletechE\";\n\t\tstr = str.toLowerCase();\n\t\tchar[] ch = str.toCharArray();\n\t\tint size = ch.length;\n\n\t\tHashMap<Character, Integer> hmap = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (!hmap.containsKey(ch[i]))\n\t\t\t\thmap.put(ch[i], 1);\n\t\t\telse {\n\t\t\t\tint val = hmap.get(ch[i]) + 1;\n\t\t\t\thmap.put(ch[i], val);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Duplicate Charaacters :\");\n\t\tfor (Map.Entry<Character, Integer> hm : hmap.entrySet()) {\n\t\t\tif (hm.getValue() > 1)\n\t\t\t\tSystem.out.println(hm.getKey() + \" \" + hm.getValue());\n\t\t}\n\t}", "public static String oddsOnlyNoDupes( String s ) {\n Set<Character> h = new LinkedHashSet<Character>(); //--initializing the hashset\n String s2 = \"\"; //tkaing pieces of the string --> put it into s2 ean empty string\n\n for (int i = 0; i < s.length(); i++) {\n if ((int)s.charAt(i) % 2 == 1) {\n if (!h.contains(s.charAt(i))) {\n s2 += s.charAt(i); // a += b means a + b so youre adding the chracter to the s2 string\n h.add(s.charAt(i)); // a set contains a bunch of characters and you need to add the character to the set so that it can tell you if it has showed up or not yet in the set\n }\n }\n }\n return s2;\n }", "public int firstUniqChar2(String s) {\r\n \r\n char[] arr= s.toCharArray();\r\n int index = -1;\r\n HashMap<Character, Integer> map = new HashMap<>();\r\n \r\n for (int i=0;i<arr.length;i++){\r\n if (map.containsKey(arr[i])){\r\n map.put(arr[i], -1);\r\n } else {\r\n map.put(arr[i],i);\r\n }\r\n }\r\n \r\n for (int i : map.values()){\r\n if (i >-1){\r\n if (index == -1){\r\n index = i;\r\n } else if (i<index) {\r\n index = i; \r\n }\r\n \r\n }\r\n }\r\n \r\n return index;\r\n }", "public static boolean isUniqueChars2(String str) {\n int checker = 0;\n for (int i = 0; i < str.length(); i++) {\n int val = str.charAt(i) - 'a';\n if ((checker & (1 << val)) > 0) return false;\n checker |= 1 << val;\n }\n return true;\n }", "public int firstUniqChar(String s) {\n int n = s.length();\n int[] cnt = new int[26];\n int[] index = new int[26];\n Arrays.fill(index, n+1);\n \n // Keep the index \n for(int i=0; i<n; i++){\n cnt[s.charAt(i) - 'a']++;\n index[s.charAt(i) - 'a'] = i;\n }\n \n int minIndex = n+1;\n for(int i=0; i<26; ++i){\n if(cnt[i] > 1)\n continue;\n minIndex = Math.min(minIndex, index[i]);\n }\n return minIndex == n+1 ? -1 : minIndex;\n }", "public char findFirstUniqueCharacter (String string) { // O(n*n)\n for (int i = 0; i < string.length(); i++) {\n char currentChar = string.charAt(i);\n\n if (i == string.lastIndexOf(currentChar)) {\n return currentChar;\n }\n }\n\n return '\\n';\n }", "public int firstUniqChar(String s) {\n int[] freq = new int[26];\n \n for (char c : s.toCharArray())\n freq[c - 'a']++;\n \n for (int i = 0; i < s.length(); i++)\n if (freq[s.charAt(i) - 'a'] == 1) return i;\n \n return -1;\n }", "public static String removeConsecutiveDuplicates(String input) {\n String ans =\"\";\n \n \n\t\n\t\n\tchar start = input.charAt(0);\n ans= ans + input.charAt(0);\n\tfor(int i = 1;i<input.length();i++){\n\t\t\n\t\tchar compare = input.charAt(i);\n\t\t\n\t\tif(compare != start){\n\t\t\tans = ans + input.charAt(i);\n\t\t\tstart = input.charAt(i);\n\t\t} \n }\n return ans;\n \n\t}", "public static int firstUniqChar(String s) {\n Map<Character, Integer> map = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (map.containsKey(c)) {\n map.put(c, map.get(c) + 1);\n } else {\n map.put(c, 1);\n }\n }\n\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (map.get(c) == 1) {\n return i;\n }\n }\n return -1;\n\n }", "public String[] findDuplicates(String string) {\n String[] temp = string.toLowerCase().replaceAll(\"[^a-zA-Z]\", \"\").split(\"\");\n List<String> output = new ArrayList<String>();\n\n for (int i = 0; i < temp.length; i++) {\n int nextElement = i + 1;\n int prevElement = i - 1;\n\n if (nextElement >= temp.length) {\n break;\n }\n\n if (temp[i].equals(temp[nextElement])) {\n if (prevElement != i && !temp[i].equals(temp[prevElement])) {\n output.add(temp[i]);\n }\n }\n }\n\n // Convert the ListString to a traditional array for output\n duplicates = new String[output.size()];\n output.toArray(duplicates);\n\n System.out.println(\"The duplicate chars found are: \" + Arrays.toString(duplicates));\n return duplicates;\n }", "public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n\n // Taking the input string from the user\n System.out.println(\"Enter the string to be evaluated : \");\n String inputString = sc.nextLine();\n\n char previousChar = inputString.charAt(0);\n String finalString = \"\" + inputString.charAt(0);\n\n // Iterating through the string and identification of duplicate characters\n for(int i = 1; i < inputString.length(); i++){\n char currentChar = inputString.charAt(i);\n\n // Checking the duplication of characters in the string\n if(currentChar == previousChar){\n int ascValue = currentChar;\n currentChar = (char)(ascValue + 1);\n }\n\n // Adding to the final output string\n finalString += currentChar;\n previousChar = currentChar;\n }\n\n // Output the final string\n System.out.println(\"Here is the final string : \" + finalString);\n }", "public static boolean isUnique(String str) {\n boolean[] char_set = new boolean[256];\n for (int i = 0; i < str.length(); i++) {\n //get ASCII value of characters\n int val = str.charAt(i);\n //Check in the boolean array if it is unique then set the value to true at corresponding index position\n //if value is already set at the required index position then return false\n if (char_set[val]) {\n return false;\n }\n char_set[val] = true;\n }\n return true;\n }", "public static boolean hasDuplicates(String s) {\n\t\tif (StringUtils.isEmpty(s)) {\n\t\t\treturn false;\n\t\t}\n\t\tchar[] c = s.toCharArray();\n\t\tArrays.sort(c);\n\t\tfor (int i = 0; i < c.length - 1; i++) {\n\t\t\tif (c[i] == c[i+1]) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public char findFirstNonRepeatingCharacter(String str) {\n\t\tchar nonRepeated = ' ';\n\t\tif (null == str || str.isEmpty())\n\t\t\treturn nonRepeated;\n\t\tint count[] = new int[256];\n\t\tfor (char ch : str.toCharArray()) {\n\t\t\tcount[ch]++;\n\t\t}\n\n\t\tfor (char ch : str.toCharArray()) {\n\t\t\tif (count[ch] == 1) {\n\t\t\t\treturn ch;\n\t\t\t}\n\t\t}\n\n\t\treturn nonRepeated;\n\t}", "public int firstUniqChar2(String s) {\n char[] chars = s.toCharArray();\n \n for (int i = 0; i < chars.length; i++) {\n char c = chars[i];\n if (s.indexOf(c) == s.lastIndexOf(c)) return i;\n }\n \n return -1;\n }", "public static boolean isUniqueChars(String str) {\n if (str.length() > 128) return false;\n\n boolean[] charSet = new boolean[128];\n for (char c : str.toCharArray()) {\n if (charSet[c]) return false;\n charSet[c] = true;\n }\n\n return true;\n }", "boolean isUniqueUsingSorting(String str) {\n\t\tchar[] array = str.toCharArray();\n\t\t// Sorting the char array take NlogN time\n\t\tArrays.sort(array);\n\t\tfor (int i = 0; i < array.length - 1; i++) {\n\t\t\t// If adjacent characters are equal, return false\n\t\t\tif (array[i] == array[i + 1]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "static int alternate(String s) {\n HashMap<Character,Integer>mapCharacter = new HashMap<>();\n LinkedList<String>twoChar=new LinkedList<>();\n LinkedList<Character>arr=new LinkedList<>();\n Stack<String>stack=new Stack<>();\n int largest=0;\n int counter=0;\n if (s.length()==1){\n return 0;\n }\n\n for (int i =0; i<s.length();i++){\n if (mapCharacter.get(s.charAt(i))==null)\n {\n mapCharacter.put(s.charAt(i),1);\n }\n }\n\n Iterator iterator=mapCharacter.entrySet().iterator();\n while (iterator.hasNext()){\n counter++;\n Map.Entry entry=(Map.Entry)iterator.next();\n arr.addFirst((Character) entry.getKey());\n }\n\n for (int i=0;i<arr.size();i++){\n for (int j=i;j<arr.size();j++){\n StringBuilder sb =new StringBuilder();\n for (int k=0;k<s.length();k++){\n if (s.charAt(k)==arr.get(i)||s.charAt(k)==arr.get(j)){\n sb.append(s.charAt(k));\n }\n }\n twoChar.addFirst(sb.toString());\n }\n }\n\n\n for (int b=0;b<twoChar.size();b++){\n String elementIn=twoChar.get(b);\n stack.push(elementIn);\n\n for (int i=0;i<elementIn.length()-1;i++){\n\n if (elementIn.charAt(i)==elementIn.charAt(i+1)){\n stack.pop();\n break;\n }\n }\n }\n\n int stackSize=stack.size();\n\n for (int j=0;j<stackSize;j++){\n String s1=stack.pop();\n int length=s1.length();\n if (length>largest){\n largest=length;\n\n }\n }\n return largest;\n\n\n\n\n }", "public static boolean isUnique2(String str) {\n boolean[] arr = new boolean[128];\n for (int i = 0; i < str.length(); i++) {\n char temp = str.charAt(i);\n int index = temp;\n if (arr[index])\n return false;\n arr[index] = true;\n }\n return true;\n }", "public char[] eliminateDuplicate(String str){\n\t\tTaskB taskB = new TaskB();\n\t\tchar[] sortArr = taskB.sortUnicodeCharacter(str);\t\n\t\tchar[] temp = new char[sortArr.length];\n\t\tint m = 0;\n\t\tint count = 0;\n\t\t\n\t\t// save unique char in temp array\n\t\tfor(int i = 0; i < sortArr.length; i++){\n\t\t\tif((i + 1) <= sortArr.length - 1){\n\t\t\t\tif(sortArr[i] != sortArr[i + 1]){\n\t\t\t\t\ttemp[m] = sortArr[i];\n\t\t\t\t\tm++;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\ttemp[m] = sortArr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// count actual char in temp array\n\t\tfor(int j = 0; j < temp.length; j++){\n\t\t\tif(temp[j] != 0){\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// save chars in temp array to temp2 array\n\t\tchar[] temp2 = new char[count];\n\t\tfor(int k = 0; k < temp2.length; k++){\n\t\t\ttemp2[k] = temp[k];\n\t\t}\n\t\t\n\t\treturn temp2;\n\t}", "public static boolean isUnique(String st) {\n\t\tif(st == null || st==\"\") {\n\t\t\treturn true;\n\t\t}\n\t\tfor(int i=0; i< st.length()-1; i++) {\n\t\t\tif(st.substring(i+1).indexOf(st.substring(i,i+1)) !=-1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "String checkString(String str) {\n\t\tString output = \"\";\n\t\tfor (int index = str.length() - 1; index >= 0; index--) {\n\t\t\toutput = output + str.charAt(index);\n\t\t}\n\t\treturn output;\n\t}", "private static String compressString(String str){\n\t\t\n\t\tint sizeComStr = sizeOfCompressedStr(str);\n\t\tint orgLen = str.length();\n\t\tif(sizeComStr>= orgLen)\n\t\t\treturn str;\n\t\t\n\t\tStringBuffer myStr = new StringBuffer();\n\t\tint i=0,j=i+1;\n\t\tint count =1;\n\t\t\n\t\twhile(i<orgLen && j<orgLen){\n\t\t\n\t\t\tif(str.charAt(i) == str.charAt(j)){\n\t\t\t\tcount++;\n\t\t\t\tj++;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tmyStr.append(str.charAt(i));\n\t\t\t\tmyStr.append(count);\n\t\t\t\ti=j;\n\t\t\t\tcount = 1;\t\n\t\t\t\tj++;\n\t\t\t\tif(j>=orgLen)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tmyStr.append(str.charAt(i));\n\t\tmyStr.append(count);\n\t\t\n\t\treturn myStr.toString();\t\n\t\t\n\t}", "public static void main(String[] args){\n\t\tString str=\"Automation\";\r\n\t\tint count=0;\r\n\t\tchar[] ch=str.toCharArray();//ch={w,3,S,c,h,o,o,l,s}\r\n\t\tSystem.out.println(ch);\r\n\t\tfor(int i=0; i<ch.length-1; i++){\r\n\t\tfor(int j=i+1; j<=ch.length-1; j++){\r\n\t\t\tif(ch[i]==ch[j]){\r\n\t\t\t\tSystem.out.print(\"Duplicate chars are : \" +ch[i]);\r\n\t\t\t\tSystem.out.println();\r\n\t\t\r\n\t\tcount++;\r\n\t\t\r\n\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\t\r\n\t\tSystem.out.println(\"The no of duplicate chars are: \" +count);\r\n\t}" ]
[ "0.74256855", "0.7381893", "0.7379483", "0.7269708", "0.72589207", "0.72372943", "0.7236145", "0.7231809", "0.7166506", "0.7149725", "0.71457994", "0.7110613", "0.7109908", "0.70977837", "0.7081422", "0.7079397", "0.70337", "0.7020245", "0.7013417", "0.7013122", "0.70070916", "0.69979703", "0.69841415", "0.69810027", "0.6975018", "0.696709", "0.6964858", "0.6960205", "0.695859", "0.69070804", "0.690228", "0.6880068", "0.68689877", "0.6860169", "0.6859552", "0.68448794", "0.68241966", "0.68130153", "0.6812918", "0.6801101", "0.6785886", "0.6783473", "0.6770848", "0.67701405", "0.67672944", "0.6765076", "0.6750294", "0.67448527", "0.6744266", "0.67417395", "0.6740658", "0.6740622", "0.6733225", "0.6732554", "0.6728075", "0.6709931", "0.6700879", "0.6694827", "0.6694062", "0.66841805", "0.6674245", "0.66624206", "0.66549075", "0.6653471", "0.664873", "0.66340977", "0.6633475", "0.66225904", "0.6612846", "0.66004944", "0.6595937", "0.6593884", "0.6574788", "0.6571585", "0.6567484", "0.65617055", "0.65568906", "0.65556514", "0.65516603", "0.65430015", "0.65410554", "0.6530402", "0.65247476", "0.65245897", "0.6512583", "0.65108657", "0.6510771", "0.65099025", "0.6503745", "0.6502725", "0.6497376", "0.64887846", "0.6488179", "0.64844847", "0.64835364", "0.64825636", "0.6481874", "0.64717174", "0.6464321", "0.6460061", "0.64590365" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) throws Exception { if(args.length!=2){ System.console().printf("Usage:<file.yml> log_suffix"); return; } System.setProperty("suffix",String.valueOf(args[1])); String configFile = "--Spring.config.location=file:"+args[0]; SpringApplication app = new SpringApplication(AuthSpringConfig.class); app.setBannerMode(Banner.Mode.OFF); app.run(configFile); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub4
public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("please enter any String"); String str=sc.next(); String org_str=str; String rev=" "; int len=str.length(); for(int i=len-1;i>=0;i--){ rev=rev+str.charAt(i); } System.out.println("reverse string is :" +rev); if(org_str.equals(rev)){ System.out.println(org_str+ "is palindrom"); } else{ System.out.println(org_str+ "is not palindrom"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void mo4359a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tprotected void initdata() {\n\n\t}", "public void mo55254a() {\n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void nefesAl() {\n\n\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "protected void mo6255a() {\n }", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "public void mo21793R() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo3376r() {\n }", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "public void mo9848a() {\n }", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "public void mo1531a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n protected void prot() {\n }", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public void mo115190b() {\n }", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n public void init() {\n\n }", "public void mo12930a() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void mo12628c() {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "public void mo21791P() {\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}" ]
[ "0.6587409", "0.6522317", "0.6450984", "0.6405692", "0.63972616", "0.6301175", "0.628741", "0.62550014", "0.6251908", "0.6241692", "0.62307465", "0.6199742", "0.61923385", "0.61923385", "0.6187377", "0.61755323", "0.61683935", "0.6164061", "0.61493236", "0.61285615", "0.61012214", "0.60724676", "0.60663193", "0.605769", "0.605769", "0.605769", "0.605769", "0.605769", "0.605769", "0.605769", "0.6050017", "0.6021078", "0.6017449", "0.6014339", "0.6010143", "0.6009846", "0.6009846", "0.59654224", "0.59553164", "0.59521496", "0.5949369", "0.59485507", "0.5945614", "0.59216386", "0.59179735", "0.5913276", "0.5899941", "0.58776736", "0.58749634", "0.5871773", "0.58608127", "0.58525956", "0.5850275", "0.5846858", "0.5846858", "0.58464843", "0.5841142", "0.58382493", "0.5831943", "0.58306247", "0.58306247", "0.5825798", "0.58188933", "0.58188933", "0.58188933", "0.58188933", "0.58188933", "0.58188933", "0.58151716", "0.58130765", "0.5808169", "0.5806197", "0.58053184", "0.57978356", "0.5796089", "0.5796089", "0.5790394", "0.5789069", "0.57835203", "0.57809263", "0.5769281", "0.57682693", "0.57585895", "0.57583654", "0.57583654", "0.57583654", "0.57583654", "0.57583654", "0.5752099", "0.5743998", "0.5743998", "0.5743998", "0.5732573", "0.5731125", "0.57235354", "0.571625", "0.5711", "0.57108486", "0.57095724", "0.5705591", "0.5705591" ]
0.0
-1
TODO Ahora vamos a ver que hay motos disponibles
public void asignarPedido(Pedido pedido){ double costeMin=100000; int pos=0; if (pedido.getPeso()<PESOMAXMOTO) { if(motosDisponibles.size()!=0){ pos=0; //Damos como primer valor el de primera posición costeMin=pedido.coste(motosDisponibles.get(0)); //Ahora vamos a calcular el min yendo uno por uno for(int i=0; i<motosDisponibles.size(); i++){ if(costeMin>pedido.coste(motosDisponibles.get(i))){ costeMin=pedido.coste(motosDisponibles.get(i)); pos=i; } } //Una vez hallada la moto de menor coste la asignamos pedido.setTransporte(motosDisponibles.get(pos)); motosDisponibles.removeElementAt(pos); } else { pedidosEsperandoMoto.add(pedidosEsperandoMoto.size(),pedido); } } else { if (furgonetasDisponibles.size()!=0){ costeMin = pedido.coste(furgonetasDisponibles.get(0)); for(int i=0; i<furgonetasDisponibles.size(); i++){ if(costeMin>pedido.coste(furgonetasDisponibles.get(i))){ costeMin=pedido.coste(furgonetasDisponibles.get(i)); pos=i; } } pedido.setTransporte(furgonetasDisponibles.get(pos)); furgonetasDisponibles.removeElementAt(pos); } else{ pedidosEsperandoFurgoneta.add(pedidosEsperandoFurgoneta.size(),pedido); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fotos(){}", "public ArrayList<Moto> getMotos()\r\n {\r\n return motos;\r\n }", "public void getListaArchivos() {\n\n File rutaAudio = new File(Environment.getExternalStorageDirectory() + \"/RecordedAudio/\");\n File[] archivosAudio = rutaAudio.listFiles();\n\n for (int i = 0; i < archivosAudio.length; i++) {\n File file = archivosAudio[i];\n listadoArchivos.add(new Archivo(file.getName()));\n }\n\n File rutaVideos = new File(Environment.getExternalStorageDirectory() + \"/RecordedVideo/\");\n File[] archivosVideo = rutaVideos.listFiles();\n\n for (int i = 0; i < archivosVideo.length; i++) {\n File file = archivosVideo[i];\n listadoArchivos.add(new Archivo(file.getName()));\n }\n }", "protected void exibirMedicos(){\n System.out.println(\"--- MEDICOS CADASTRADOS ----\");\r\n String comando = \"select * from medico order by id\";\r\n ResultSet rs = cb.buscaDados(comando);\r\n try{\r\n while(rs.next()){\r\n int id = rs.getInt(\"id\");\r\n String nome = rs.getString(\"nome\");\r\n System.out.println(\"[\"+id+\"] \"+nome);\r\n }\r\n }\r\n catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "private void getMall(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "private void cargarRegistroMedicamentos() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"admision_seleccionada\", admision_seleccionada);\r\n\t\tparametros.put(\"rol_medico\", \"S\");\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\"/pages/registro_medicamentos.zul\", \"REGISTRO DE MEDICAMENTOS\",\r\n\t\t\t\tparametros);\r\n\t}", "public static void Auslesen()\r\n\t{\n\t\tLargeObjectManager lobj;\r\n\t\ttry {\r\n\t\t\tconn= DriverManager.getConnection(DB_URL,USER,PASS);\r\n\t\t\tlobj = ((org.postgresql.PGConnection)conn).getLargeObjectAPI();\r\n\t\t\tPreparedStatement ps = conn.prepareStatement(\"SELECT bild FROM bilder WHERE bild = ?\");\r\n\t\t\tps.setString(1, \"bild2.jpg\");\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t // Open the large object for reading\r\n\t\t\t\tString name = rs.getString(1);\r\n\t\t\t int oid = rs.getInt(2);\r\n\t\t\t LargeObject obj = lobj.open(oid, LargeObjectManager.READ);\r\n\r\n\t\t\t // Read the data\r\n\t\t\t byte buf[] = new byte[obj.size()];\r\n\t\t\t obj.read(buf, 0, obj.size());\r\n\t\t\t // Do something with the data read here\r\n\t\t\t \r\n\t\t\t String pfad = \"C:/Temp\";\r\n\t\t\t\tFile file = createFile(pfad, \"bild2.jpg\");\r\n\t\t\t\tFiles.copy(obj.getInputStream(), file.toPath());\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t // Close the object\r\n\t\t\t obj.close();\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\tps.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t\r\n\t}", "private void getPinchazos(){\n mPinchazos = estudioAdapter.getListaPinchazosSinEnviar();\n //ca.close();\n }", "@Test\n public void cargarMateria_Materias(){\n List<Materia> materias;\n Materia materia;\n \n mt=contAgre.AgregarMateria(imagen, puntos, materiaNombre); \n \n materias= contCons.cargarMateria();\n materia=materias.get(materias.size()-1);\n assertNotNull(materia);\n \n assertEquals(mt.getHijoURL(),materia.getHijoURL());\n assertEquals(mt.getImagenURL(),materia.getImagenURL());\n assertEquals(mt.getNivel(),materia.getNivel());\n assertEquals(mt.getNombre(),materia.getNombre());\n assertEquals(mt.getRepaso(),materia.getRepaso());\n assertEquals(mt.getAsignaturas(),materia.getAsignaturas());\n \n }", "public void findImages() {\n \t\tthis.mNoteItemModel.findImages(this.mNoteItemModel.getContent());\n \t}", "public static ArrayList<Media> getMedia() {\n File titleFile = new File(\"./data/titles.csv\");\n\n Scanner titleScan;\n try {\n titleScan = new Scanner(titleFile);\n } catch (IOException e) {\n throw new Error(\"Could not open titles file\");\n }\n\n titleScan.nextLine();\n\n // Read File to build medias without directors\n ArrayList<Media> medias = new ArrayList<Media>();\n while (titleScan.hasNextLine()) {\n String line = titleScan.nextLine();\n String[] ratingParts = line.split(\"\\t\");\n int mediaIndex = indexOfMedia(medias, ratingParts[1]);\n if (mediaIndex == -1) {\n String[] genreList = ratingParts[7].split(\",\");\n if (ratingParts[6].isEmpty()) {\n continue;\n }\n int runtime = Integer.parseInt(ratingParts[6]);\n int releaseYear = ratingParts[4].isEmpty() ? Integer.parseInt(ratingParts[8])\n : Integer.parseInt(ratingParts[4]);\n Media newMedia = new Media(ratingParts[1], ratingParts[3], genreList, runtime, releaseYear);\n medias.add(newMedia);\n } else {\n updateReleaseDate(medias.get(mediaIndex), Integer.parseInt(ratingParts[4]));\n }\n }\n\n // Close Title Scanner\n titleScan.close();\n\n // Open Principals Scanner\n File principalFile = new File(\"./data/principals.csv\");\n FileReader principaFileReader;\n Scanner principalScan;\n\n try {\n principaFileReader = new FileReader(principalFile);\n } catch (IOException e) {\n throw new Error(\"Could not open principals file reader\");\n }\n principalScan = new Scanner(principaFileReader);\n principalScan.nextLine();\n\n // Get directorID for the media\n // int count = 0;\n while (principalScan.hasNextLine()) {\n String line = principalScan.nextLine();\n String[] principalParts = line.split(\"\\t\");\n int mediaIndex = indexOfMedia(medias, principalParts[1]);\n\n if (mediaIndex != -1 && isDirector(principalParts[3])) {\n medias.get(mediaIndex).directorId = principalParts[2];\n }\n }\n\n // Close Scanners\n principalScan.close();\n\n // Return Media List\n return medias;\n }", "public boolean pagarMedicos() throws Exception {\n //Se obtiene una lista con la especialidad \"Medico\" de la cual solo se saca el primer registro [0]\n Especialidad especialidad = obtenerEspecialidadPorNombre(\"Medico\");\n //Se obtiene una lista con el personal medico con la especialidad \"Medico\"\n ArrayList<PersMedico> medicos = obtenerPersonalMedicoPorEspecialidad(especialidad);\n try {\n for (PersMedico medico : medicos) {\n pagarMedico(medico);\n }\n } catch (Exception e) {\n System.out.println(e.getMessage());\n return false;\n }\n\n return true;\n }", "private void aumentarPilha() {\n this.pilhaMovimentos++;\n }", "public void grabarMetaDato (Vector c) throws IOException\r\n {\r\n // se supone que el archivo está recién creado y abierto\r\n \r\n // grabamos la cantidad de campos al inicio del archivo\r\n maestro.writeInt(c.size());\r\n \r\n // ahora grabamos los metadatos propiamente dichos\r\n for(int i = 0; i<c.size(); i++)\r\n {\r\n grabarMetaDato((Campo)c.get(i));\r\n }\r\n \r\n iniDatos = maestro.getFilePointer();\r\n }", "public void listadoNotaMediaAlumnos() {\r\n\t\tint acumulador;\r\n\t\tfor(int i=0; i<notasAlumnos.length; i++) {\r\n\t\t\tacumulador = 0;\r\n\t\t\tfor(int j=0; j<notasAlumnos[i].length; j++) {\r\n\t\t\t\tacumulador += notasAlumnos[i][j];\r\n\t\t\t}\r\n\t\t\tSystem.out.println(alumnos[i] + \": \" + acumulador + \" de Nota Media.\");\r\n\t\t}\r\n\t}", "List<MediaMetadata> getAll();", "@Override\n public void memoria() {\n \n }", "public void inicializarListaMascotas()\n {\n //creamos un arreglo de objetos y le cargamos datos\n mascotas = new ArrayList<>();\n mascotas.add(new Mascota(R.drawable.elefante,\"Elefantin\",0));\n mascotas.add(new Mascota(R.drawable.conejo,\"Conejo\",0));\n mascotas.add(new Mascota(R.drawable.tortuga,\"Tortuga\",0));\n mascotas.add(new Mascota(R.drawable.caballo,\"Caballo\",0));\n mascotas.add(new Mascota(R.drawable.rana,\"Rana\",0));\n }", "private static void grabarYleerMedico() {\r\n\r\n\t\tMedico medico = new Medico(\"Manolo\", \"Garcia\", \"62\", \"casa\", \"2\", null);\r\n\t\tDTO<Medico> dtoMedico = new DTO<>(\"src/Almacen/medico.dat\");\r\n\t\tif (dtoMedico.grabar(medico) == true) {\r\n\t\t\tSystem.out.println(medico.getNombre());\r\n\t\t\tSystem.out.println(medico.getDireccion());\r\n\t\t\tSystem.out.println(\"Medico grabado\");\r\n\t\t}\r\n\t\t;\r\n\t\tMedico medicoLeer = dtoMedico.leer();\r\n\t\tSystem.out.println(medicoLeer);\r\n\t\tSystem.out.println(medicoLeer.getNombre());\r\n\t}", "private void getMetadata() {\n masterRoot = AbstractMetadata.getAbstractedMetadata(sourceProduct);\n masterMetadata = new MetadataDoris(masterRoot);\n masterOrbit = new OrbitsDoris();\n masterOrbit.setOrbit(masterRoot);\n \n // SLAVE METADATA\n // hash table or just map for slaves - now it supports only a single sourceSlave image\n slaveRoot = sourceProduct.getMetadataRoot().getElement(AbstractMetadata.SLAVE_METADATA_ROOT).getElementAt(0);\n slaveMetadata = new MetadataDoris(slaveRoot);\n slaveOrbit = new OrbitsDoris();\n slaveOrbit.setOrbit(slaveRoot);\n }", "public String getAnoFilmagem();", "@Test\r\n\tpublic void test1() {\n\t\tFile jpegFile = new File(\"C:\\\\Users\\\\lefto\\\\Downloads\\\\flickr\\\\test2\\\\20170814-150511-6_36561788895_o_EDIT.jpg\");\r\n\t\tMetadata metadata;\r\n\t\ttry {\r\n\t\t\tmetadata = ImageMetadataReader.readMetadata(jpegFile);\r\n\t\t\tfor (Directory directory : metadata.getDirectories()) {\r\n\t\t\t\tfor (Tag tag : directory.getTags()) {\r\n\t\t\t\t\tSystem.out.println(tag);\r\n//\t\t\t\t\tSystem.out.println(tag.getDirectoryName() + \", \" + tag.getTagName() + \", \" + tag.getDescription());\r\n//\t\t\t\t\tif (tag.getTagType() == ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL)\r\n//\t\t\t\t\t\tSystem.out.println(tag);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (ImageProcessingException | IOException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\t}", "@Test\n public void testGetAllMedia() throws ODSKartException, FileNotFoundException {\n System.out.println(\"getAllMedia\");\n DBManager instance = new ODSDBManager(\"long.ods\");\n List<Medium> result = instance.getAllMedia();\n assertEquals(expResultAll, result);\n // TODO review the generated test code and remove the default call to fail.\n // fail(\"The test case is a prototype.\");\n }", "private void getMuestras(){\n mMuestras = estudioAdapter.getListaMuestrasSinEnviar();\n //ca.close();\n }", "void loadAlbums();", "private void getLactanciasMaternas() {\n mLactanciasMaternas = estudioAdapter.getListaLactanciaMaternasSinEnviar();\n //ca.close();\n }", "private void getImagesFromDatabase() {\n try {\n mCursor = mDbAccess.getPuzzleImages();\n\n if (mCursor.moveToNext()) {\n for (int i = 0; i < mCursor.getCount(); i++) {\n String imagetitle = mCursor.getString(mCursor.getColumnIndex(\"imagetitle\"));\n String imageurl = mCursor.getString(mCursor.getColumnIndex(\"imageurl\"));\n mImageModel.add(new CustomImageModel(imagetitle, imageurl));\n mCursor.moveToNext();\n }\n } else {\n Toast.makeText(getActivity(), \"databse not created...\", Toast.LENGTH_LONG).show();\n }\n } catch (Exception e) {\n e.printStackTrace();\n\n }\n\n }", "private void findScanMold(String contents) {\n getData(1,contents,false);\n Log.e(\"Link\",webUrl + \"ActualWO/MoldMgtData?page=\" + 1 + \"&rows=50&sidx=&sord=asc&md_no=\" + contents + \"&md_nm=&_search=false\");\n Log.e(\"Link\",webUrl + \"ActualWO/MoldMgtData?page=\" + page + \"&rows=50&sidx=&sord=asc&md_no=&md_nm=&_search=false\");\n\n }", "public List<MedioDePagoEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todos los medios de pago\");\n TypedQuery query = em.createQuery(\"select u from MedioDePagoEntity u\", MedioDePagoEntity.class);\n return query.getResultList();\n }", "public void cargarImagenes() {\n try {\n\n variedad = sp.getString(\"variedad\", \"\");\n gDia = sp.getFloat(\"gDia\", 0);\n dia = sp.getInt(\"dia\", 0);\n idVariedad = sp.getLong(\"IdVariedad\", 0);\n idFinca = sp.getLong(\"IdFinca\",0);\n\n\n\n imageAdmin iA = new imageAdmin();\n List<fenologiaTab> fi = forGradoloc(dia, gDia, idVariedad);\n\n path = getExternalFilesDir(null) + File.separator;\n String path2 = \"/storage/emulated/0/Pictures/fenologias/\"+idFinca+\"/\";\n\n iA.getImage(path2,jpgView1, idVariedad, fi.get(0).getImagen());\n datos(txt1, fi.get(0).getDiametro_boton(), fi.get(0).getLargo_boton(), fi.get(0).getGrados_dia(), fi.get(0).getImagen());\n\n iA.getImage(path2,jpgView2, idVariedad, fi.get(1).getImagen());\n datos(txt2, fi.get(1).getDiametro_boton(), fi.get(1).getLargo_boton(), fi.get(1).getGrados_dia(), fi.get(1).getImagen());\n\n iA.getImage(path2,jpgView3, idVariedad, fi.get(2).getImagen());\n datos(txt3, fi.get(2).getDiametro_boton(), fi.get(2).getLargo_boton(), fi.get(2).getGrados_dia(), fi.get(2).getImagen());\n\n iA.getImage(path2,jpgView4, idVariedad, fi.get(3).getImagen());\n datos(txt4, fi.get(3).getDiametro_boton(), fi.get(3).getLargo_boton(), fi.get(3).getGrados_dia(), fi.get(3).getImagen());\n } catch (Exception e) {\n Toast.makeText(getApplicationContext(), \"Error \\n\" + e, Toast.LENGTH_LONG).show();\n }\n }", "public ArrayList<Group> GetImageStorageMelanoma() {\n\t\tExListViewController selImagens = new ExListViewController();\n\t\treturn selImagens.SelectPicsOnMelanomaDirectory(CreateListFiles());\n\t}", "private void getPhotos(){\n Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);\n if(isSDPresent)\n new GetAllImagesAsync().execute(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n else\n Toast.makeText(this,\"There is no external storage present\", Toast.LENGTH_SHORT).show();\n }", "private void limpiarDatos() {\n\t\t\n\t}", "@Test\n public void testGetAllFilesOfMetsDocumentWithUse() throws Exception {\n System.out.println(\"getAllFilesOfMetsDocument\");\n String resourceId = \"id_0015\";\n String use = \"OCR-D-GT-IMG-CROP\";\n\n this.mockMvc.perform(get(\"/api/v1/metastore/mets/\" + resourceId + \"/files\")\n .param(\"use\", use))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(MockMvcResultMatchers.jsonPath(\"$\", Matchers.hasSize(2)))\n .andExpect(MockMvcResultMatchers.jsonPath(\"$.[*].resourceId\", Matchers.hasItem(resourceId)))\n .andExpect(MockMvcResultMatchers.jsonPath(\"$.[*].use\", Matchers.hasItem(use)))\n .andReturn();\n }", "public static List getAllImgs() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT imgUrl FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n String imgUrl = result.getString(\"imgUrl\");\n polovniautomobili.add(imgUrl);\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }", "public ArrayList<DeviceMediaItem> getAllImages(Context contx) {\n ArrayList<DeviceMediaItem> images = new ArrayList<>();\n Uri allImagesuri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n String[] projection = {MediaStore.Images.ImageColumns.DATA, MediaStore.Images.Media.DISPLAY_NAME,\n MediaStore.Images.Media.SIZE, MediaStore.Images.Media.DATE_ADDED};\n Cursor cursor = contx.getContentResolver().query(allImagesuri, projection, null, null, null);\n try {\n cursor.moveToFirst();\n do {\n DeviceMediaItem pic = new DeviceMediaItem();\n\n pic.setName(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DISPLAY_NAME)));\n pic.setPath(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA)));\n String date = getDate(cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_ADDED)));\n pic.setDate(date);\n\n images.add(pic);\n } while (cursor.moveToNext());\n cursor.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n Uri allVideosuri = android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI;\n String[] vidProjection = {MediaStore.Video.VideoColumns.DATA, MediaStore.Video.Media.DISPLAY_NAME,\n MediaStore.Video.Media.SIZE, MediaStore.Video.Media.DATE_ADDED};\n Cursor vidCursor = contx.getContentResolver().query(allVideosuri, vidProjection, null, null, null);\n try {\n vidCursor.moveToFirst();\n do {\n DeviceMediaItem pic = new DeviceMediaItem();\n\n pic.setName(vidCursor.getString(vidCursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME)));\n pic.setPath(vidCursor.getString(vidCursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA)));\n String date = getDate(vidCursor.getLong(vidCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_ADDED)));\n pic.setDate(date);\n\n images.add(pic);\n } while (vidCursor.moveToNext());\n vidCursor.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return images;\n }", "public void loadMedia() {\n MediaDBMapper mapper = new MediaDBMapper(ctx);\n\n String[] fileNames = {\n \"medved.jpg\",\n \"medved 2.jpg\",\n \"medved hnedy.jpg\",\n \"grizzly.jpg\",\n \"buk.jpg\",\n \"jedle.jpg\",\n \"jedle 2.jpg\"\n };\n\n File file = null;\n\n try {\n boolean autoCommit = getConnection().getAutoCommit();\n getConnection().setAutoCommit(false);\n\n try {\n\n for (String fileName : fileNames) {\n try {\n file = new File(\"resources\\\\\" + fileName);\n\n System.out.println(\"Opening: \" + file.getPath() + \".\");\n\n MediaEntity e = mapper.create();\n e.setName(file.getName().substring(0, file.getName().lastIndexOf('.')));\n\n mapper.loadImageFromFile(e, file.getPath());\n\n mapper.save(e);\n } catch (NullPointerException ex) {\n ex.printStackTrace();\n }\n\n// getConnection().commit();\n }\n\n } finally {\n getConnection().setAutoCommit(autoCommit);\n }\n } catch (SQLException ex) {\n ex.printStackTrace();\n// throw new RuntimeException(ex);\n }\n }", "List<Photo> homePagePhotos();", "Map getAspectDatas();", "@Override\n protected void findBootLayerAtomosContents(Set<AtomosContentBase> result)\n {\n }", "@SuppressLint(\"Recycle\")\n private synchronized ArrayList<String> retriveSavedImages(Context activity) {\n Uri uri;\n Cursor cursor;\n int column_index_data, column_index_folder_name, column_index_file_name;\n ArrayList<String> listOfAllImages = new ArrayList<>();\n uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n String[] projection = {MediaStore.MediaColumns.DATA,\n MediaStore.Images.Media.BUCKET_DISPLAY_NAME,\n MediaStore.MediaColumns.DISPLAY_NAME};\n\n cursor = activity.getApplicationContext().getContentResolver().query(uri, projection, null,\n null, MediaStore.Images.Media.DATE_ADDED);//\n\n assert cursor != null;\n column_index_data = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);\n column_index_folder_name = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.BUCKET_DISPLAY_NAME);\n column_index_file_name = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DISPLAY_NAME);\n\n while (cursor.moveToNext()) {\n\n /*Images from CustomCalender folder only*/\n if (cursor.getString(column_index_folder_name).contains(\"CustomCalender\")) {\n listOfAllImages.add(cursor.getString(column_index_data));\n// Log.v(\"Images: \", cursor.getString(column_index_file_name));\n }\n }\n\n /*Testing Glide cache by making duplicates total 768 images*/\n /*listOfAllImages.addAll(listOfAllImages); //24\n listOfAllImages.addAll(listOfAllImages); //48\n listOfAllImages.addAll(listOfAllImages); //96\n listOfAllImages.addAll(listOfAllImages); //192\n listOfAllImages.addAll(listOfAllImages); //384\n listOfAllImages.addAll(listOfAllImages); //768*/\n\n return listOfAllImages;\n }", "private void remplirMaterielData() {\n\t}", "@Override\n\tpublic void readImages() {\n\t\t\n\t}", "private void fetchCameras() {\n\n mCameraManager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);\n String[] cameraInfo = null;\n try {\n cameraInfo = mCameraManager.getCameraIdList();\n if (cameraInfo != null) {\n if (cameraInfo[0] != null) {\n backCamera = Integer.valueOf(cameraInfo[0]);\n isBackCameraSelected = true;\n imgviewCameraSelect.setTag(\"backCamera\");\n mCameraCharactersticsBack = fetchCameraCharacteristics(backCamera);\n hasBackCamera = true;\n }\n if (cameraInfo[1] != null) {\n frontCamera = Integer.valueOf(cameraInfo[1]);\n mCameraCharactersticsFront = fetchCameraCharacteristics(frontCamera);\n hasFrontCamera = true;\n }\n\n }\n } catch (CameraAccessException e) {\n Log.e(TAG, \"CameraAccessException\" + e.getMessage());\n }\n }", "public void searchAllFiles() {\n\t\t/**\n\t\t * Realizamos un pequeño algoritmo de recorrido de árboles en preorden para listar todos los\n\t\t * ebooks con un coste de 2n+1 donde n es el número de nodos.\n\t\t */\n\t\tArrayList<Entry> booksEntry = null;\n\t\ttry {\n\t\t\tString auxPath;\n\t\t\tbooksEntry = new ArrayList<DropboxAPI.Entry>();\n\t\t\tLinkedList<Entry> fifo = new LinkedList<DropboxAPI.Entry>();\n\t\t\tEntry nodo = _mApi.metadata(\"/\", 0, null, true, null);\n\t\t\tfifo.addAll(nodo.contents);\n\t\t\twhile (!fifo.isEmpty()) {\n\t\t\t\tSystem.out.println(fifo);\n\t\t\t\tnodo = fifo.getFirst();\n\t\t\t\tfifo.removeFirst();\n\t\t\t\tauxPath = nodo.path;\n\t\t\t\tif (nodo.isDir) {\n\t\t\t\t\tfifo.addAll(_mApi.metadata(auxPath, 0, null, true, null).contents);\n\t\t\t\t} else {\n\t\t\t\t\tif (isEbook(nodo))\n\t\t\t\t\t\tbooksEntry.add(nodo);\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"parar\");\n\t\t} catch (DropboxUnlinkedException e) {\n\t\t\t// The AuthSession wasn't properly authenticated or user unlinked.\n\t\t} catch (DropboxPartialFileException e) {\n\t\t\t// We canceled the operation\n\t\t\t_mErrorMsg = \"Download canceled\";\n\t\t} catch (DropboxServerException e) {\n\t\t\t// Server-side exception. These are examples of what could happen,\n\t\t\t// but we don't do anything special with them here.\n\t\t\tif (e.error == DropboxServerException._304_NOT_MODIFIED) {\n\t\t\t\t// won't happen since we don't pass in revision with metadata\n\t\t\t} else if (e.error == DropboxServerException._401_UNAUTHORIZED) {\n\t\t\t\t// Unauthorized, so we should unlink them. You may want to\n\t\t\t\t// automatically log the user out in this case.\n\t\t\t} else if (e.error == DropboxServerException._403_FORBIDDEN) {\n\t\t\t\t// Not allowed to access this\n\t\t\t} else if (e.error == DropboxServerException._404_NOT_FOUND) {\n\t\t\t\t// path not found (or if it was the thumbnail, can't be\n\t\t\t\t// thumbnailed)\n\t\t\t} else if (e.error == DropboxServerException._406_NOT_ACCEPTABLE) {\n\t\t\t\t// too many entries to return\n\t\t\t} else if (e.error == DropboxServerException._415_UNSUPPORTED_MEDIA) {\n\t\t\t\t// can't be thumbnailed\n\t\t\t} else if (e.error == DropboxServerException._507_INSUFFICIENT_STORAGE) {\n\t\t\t\t// user is over quota\n\t\t\t} else {\n\t\t\t\t// Something else\n\t\t\t}\n\t\t\t// This gets the Dropbox error, translated into the user's language\n\t\t\t_mErrorMsg = e.body.userError;\n\t\t\tif (_mErrorMsg == null) {\n\t\t\t\t_mErrorMsg = e.body.error;\n\t\t\t}\n\t\t} catch (DropboxIOException e) {\n\t\t\t// Happens all the time, probably want to retry automatically.\n\t\t\t_mErrorMsg = \"Network error. Try again.\";\n\t\t} catch (DropboxParseException e) {\n\t\t\t// Probably due to Dropbox server restarting, should retry\n\t\t\t_mErrorMsg = \"Dropbox error. Try again.\";\n\t\t} catch (DropboxException e) {\n\t\t\t// Unknown error\n\t\t\t_mErrorMsg = \"Unknown error. Try again.\";\n\t\t}\n\t\t_booksListEntry = booksEntry;\n\t\tcreateListBooks();\n\t}", "@Test\r\n public void testGetPersonImages() throws MovieDbException {\r\n LOG.info(\"getPersonImages\");\r\n \r\n List<Artwork> artwork = tmdb.getPersonImages(ID_PERSON_BRUCE_WILLIS);\r\n assertTrue(\"No cast information\", artwork.size() > 0);\r\n }", "public void listPictures()\r\n {\r\n int index = 0;\r\n while(index >=0 && index < pictures.size()) \r\n {\r\n String filename = pictures.get(index);\r\n System.out.println(index + \": \"+ filename);\r\n index++;\r\n }\r\n }", "@Override\r\n\tpublic List<Mlid> downloadMlid(String service) {\n\t\tSystem.out.println(\"serv:\"+service);\r\n\t\tList<Mlid> mlidlist = mlidRepository.downloadMlid(service);\r\n\t\tSystem.out.println(\"size:\"+mlidlist.size());\r\n\t\t\r\n\t\treturn mlidlist;\r\n\t}", "public void index() {\n\t\t\n\t\tList<Filme> preferencias = new ArrayList<Filme>();\n\t\tfor( Map.Entry<Key, Integer> entry : session.getUsuario().getPreferencias().entrySet()){\n\t\t\tFilme tmp = filmeDao.getById(entry.getKey());\n\t\t\ttmp.setVotos(entry.getValue());\n\t\t\tpreferencias.add(tmp);\n\t\t}\n\t\t\n\t\t// passando todos os filmes, o usuário e as preferencias dele\n\t\tresult.include(\"filmes\", filmeDao.getAllInOrder() );\n\t\tresult.include(\"usuario\", session.getUsuario() );\n\t\tresult.include(\"preferencias\", preferencias);\n\t}", "private void InicializarListaAlbums() {\n\n GestorAlbums gestorAlbums = new GestorAlbums(this.getActivity());\n albums = gestorAlbums.AsignarAlbum();\n }", "private final boolean m123457a(Bundle bundle) {\n List list;\n if (bundle == null) {\n Bundle bundle2 = new Bundle();\n ArrayList arrayList = new ArrayList();\n C33153d a = C33153d.m106972a();\n if (a != null) {\n list = a.mo84910c();\n } else {\n list = null;\n }\n if (list != null) {\n C33153d a2 = C33153d.m106972a();\n C7573i.m23582a((Object) a2, \"MediaManager.instance()\");\n arrayList = (ArrayList) a2.mo84910c();\n }\n String stringExtra = getIntent().getStringExtra(\"file_path\");\n if (getIntent().hasExtra(\"open_sdk_import_media_list\")) {\n arrayList = getIntent().getParcelableArrayListExtra(\"open_sdk_import_media_list\");\n C7573i.m23582a((Object) arrayList, \"intent.getParcelableArra…PEN_SDK_IMPORT_MEDIALIST)\");\n }\n boolean z = false;\n if (!TextUtils.isEmpty(stringExtra) || !arrayList.isEmpty()) {\n String str = \"is_multi_mode\";\n if (arrayList.size() > 1) {\n z = true;\n }\n bundle2.putBoolean(str, z);\n bundle2.putString(\"single_video_path\", stringExtra);\n bundle2.putParcelableArrayList(\"multi_video_path_list\", arrayList);\n bundle2.putParcelable(\"page_intent_data\", getIntent());\n getSupportFragmentManager().mo2645a().mo2585a((int) R.id.cuv, (Fragment) C38650a.m123512a(bundle2)).mo2604c();\n } else {\n finish();\n return false;\n }\n }\n return true;\n }", "List<Medicine> getAllMedicines();", "public void getPhotoLinks() {\n try {\n image = Jsoup.connect(link + \"/+images/\").get();\n } catch (IOException e) {\n e.printStackTrace();\n }\n Elements elements = image.getElementsByClass(\"image-list-item\");\n photosLinks = new String[elements.size()];\n for (int i = 0; i < elements.size(); i++) {\n String element = elements.get(i).attr(\"href\");\n photosLinks[i] = element;\n }\n }", "private Collection<MetaMember> getAllMetaMembers() throws XavaException { \n\t\tif (!hasSections()) return getMetaMembers();\n\t\tif (allMetaMembers == null) {\t\t\n\t\t\tallMetaMembers = new ArrayList();\n\t\t\tallMetaMembers.addAll(getMetaMembers());\n\t\t\tIterator it = getSections().iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tMetaView section = (MetaView) it.next();\n\t\t\t\tallMetaMembers.addAll(section.getAllMetaMembers());\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn allMetaMembers;\n\t}", "private void loadMedia() {\n\t\tmt = new MediaTracker(this);\n\t\timage_topbar = getToolkit().getImage(str_topbar);\n\t\timage_return = getToolkit().getImage(str_return);\n\t\timage_select = getToolkit().getImage(str_select);\n\t\timage_free = getToolkit().getImage(str_free);\n\t\timage_message = getToolkit().getImage(str_message);\n\t\timage_tradition = getToolkit().getImage(str_tradition);\n\t\timage_laizi = getToolkit().getImage(str_laizi);\n\t\timage_head = getToolkit().getImage(str_head);\n\t\timage_headframe = getToolkit().getImage(str_headframe);\n\t\timage_headmessage = getToolkit().getImage(str_headmessage);\n\t\timage_help = getToolkit().getImage(str_help);\n\t\timage_honor = getToolkit().getImage(str_honor);\n\t\timage_beans = getToolkit().getImage(str_beans);\n\t\t\n\t\t\n\t\tmt.addImage(image_free, 0);\n\t\tmt.addImage(image_head, 0);\n\t\tmt.addImage(image_headframe, 0);\n\t\tmt.addImage(image_headmessage, 0);\n\t\tmt.addImage(image_help, 0);\n\t\tmt.addImage(image_honor, 0);\n\t\tmt.addImage(image_laizi, 0);\n\t\tmt.addImage(image_message, 0);\n\t\tmt.addImage(image_return, 0);\n\t\tmt.addImage(image_select, 0);\n\t\tmt.addImage(image_topbar, 0);\n\t\tmt.addImage(image_tradition, 0);\n\t\tmt.addImage(image_beans, 0);\n\t\t\n\t\t\n\t\ttry {\n\t\t\tmt.waitForAll();\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void testLoadMovies () {\n ArrayList<Movie> movies = loadMovies(\"ratedmoviesfull\"); \n System.out.println(\"Numero de peliculas: \" + movies.size()); \n String countInGenre = \"Comedy\"; // variable\n int countComedies = 0; \n int minutes = 150; // variable\n int countMinutes = 0;\n \n for (Movie movie : movies) {\n if (movie.getGenres().contains(countInGenre)) {\n countComedies +=1;\n }\n \n if (movie.getMinutes() > minutes) {\n countMinutes +=1;\n }\n }\n \n System.out.println(\"Hay \" + countComedies + \" comedias en la lista \");\n System.out.println(\"Hay \" + countMinutes + \" películas con más de \" + minutes + \" minutos en la lista \");\n \n // Cree un HashMap con el recuento de cuántas películas filmó cada director en particular\n HashMap<String,Integer> countMoviesByDirector = new HashMap<String,Integer> ();\n for (Movie movie : movies) {\n String[] directors = movie.getDirector().split(\",\"); \n for (String director : directors ) {\n director = director.trim();\n if (! countMoviesByDirector.containsKey(director)) {\n countMoviesByDirector.put(director, 1); \n } else {\n countMoviesByDirector.put(director, countMoviesByDirector.get(director) + 1);\n }\n }\n }\n \n // Contar el número máximo de películas dirigidas por un director en particular\n int maxNumOfMovies = 0;\n for (String director : countMoviesByDirector.keySet()) {\n if (countMoviesByDirector.get(director) > maxNumOfMovies) {\n maxNumOfMovies = countMoviesByDirector.get(director);\n }\n }\n \n // Cree una ArrayList con directores de la lista que dirigieron el número máximo de películas\n ArrayList<String> directorsList = new ArrayList<String> ();\n for (String director : countMoviesByDirector.keySet()) {\n if (countMoviesByDirector.get(director) == maxNumOfMovies) {\n directorsList.add(director);\n }\n }\n \n System.out.println(\"Número máximo de películas dirigidas por un director: \" + maxNumOfMovies);\n System.out.println(\"Los directores que dirigieron mas películas son \" + directorsList);\n }", "@GetMapping()\n\tpublic @ResponseBody ProccessMagazineDTO getMagazines() {\n\t\tString username = this.tokenUtils.getUsernameFromToken(this.httpServletRequest.getHeader(\"X-Auth-Token\"));\n\t\tSystem.out.println(\"dobavljam casopise za korisnika: \" + username);\n\t\tCollection<MagazineDTO> magazines = magazineService.getAll(username);\n\t\tProccessMagazineDTO pmd = new ProccessMagazineDTO(magazines);\n\t\treturn pmd;\n\n\t}", "private void loadBasePaths() {\n\n Log.d(TAG, \"****loadBasePaths*****\");\n List<FileInfo> paths = BaseMediaPaths.getInstance().getBasePaths();\n for (FileInfo path : paths) {\n\n }\n }", "@Test()\n public void testGetMedia() {\n System.out.println(\"getMedia\");\n String type = \"b\";\n DBManager instance=null;\n try {\n instance = new ODSDBManager(\"test.ods\");\n } catch (ODSKartException ex) {\n fail(\"Neocekavana vyjimka \" +ex);\n } catch (FileNotFoundException ex) {\n fail(\"Neocekavana vyjimka \" + ex);\n }\n \n List<Medium> expResult = new ArrayList<Medium>();\n Medium medium = new MediumImpl();\n medium.addTitle(\"ba\");\n medium.addTitle(\"bb\");\n expResult.add(medium);\n List<Medium> result = instance.getMedia(type);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n // fail(\"The test case is a prototype.\");\n }", "@Test\n public void testGetAllUsesOfMetsDocument() throws Exception {\n System.out.println(\"getAllUsesOfMetsDocument\");\n String resourceId = \"id_0015\";\n String items[] = {\"OCR-D-GT-IMG-BIN\", \"OCR-D-GT-IMG-CROP\", \"OCR-D-GT-IMG-DESPEC\", \"OCR-D-GT-IMG-DEWARP\"};\n\n this.mockMvc.perform(get(\"/api/v1/metastore/mets/\" + resourceId + \"/use\"))\n .andDo(print())\n .andExpect(status().isOk())\n .andExpect(MockMvcResultMatchers.jsonPath(\"$\", Matchers.hasSize(4)))\n .andExpect(MockMvcResultMatchers.jsonPath(\"$.[*]\", Matchers.hasItems(items)))\n .andReturn();\n }", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:33:59.900 -0500\", hash_original_method = \"BDD10C58ECCC962A5941D61E3DCCB1CC\", hash_generated_method = \"CC96DF6BBA141BCD4483A4EED9B38592\")\n \nprivate Photos() {}", "public void llenarListaArchivos(int op) {\n String[] archivosPermitidos = {\".HA\", \".HE\"};\n if (op == 1) {\n archivos_directorio.removeAllItems();\n } else {\n archivos_directorio2.removeAllItems();\n }\n File directorio = new File(\"./\");\n File[] archivos = null;\n if (directorio.exists()) {\n archivos = directorio.listFiles();\n }\n int i;\n\n for (i = 0; i < archivos.length; i++) {\n if (op == 1 && (\"\" + archivos[i]).contains(\".txt\")) {\n archivos_directorio.addItem(\"\" + archivos[i]);\n } else {\n int j;\n for (j = 0; j < archivosPermitidos.length; j++) {\n if ((\"\" + archivos[i]).contains(archivosPermitidos[j])) {\n archivos_directorio2.addItem(\"\" + archivos[i]);\n break;\n }\n }\n }\n }\n\n }", "private void adicionaMusicasVaziasCD () {\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tfaixasCD.add(i, \"\");\n\t\t}\n\t}", "private void cargarRemisiones() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\tparametros.put(\"nro_ingreso\", admision_seleccionada.getNro_ingreso());\r\n\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\tparametros.put(\"tipo_hc\", \"\");\r\n\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE, admision_seleccionada);\r\n\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\tIRutas_historia.PAGINA_REMISIONES, \"REMISIONES\", parametros);\r\n\t}", "public void cargarGaleriaImgs(View view) {\n//Comprobamos el estado de la memoria externa (tarjeta SD)\n String estado = Environment.getExternalStorageState();\n//indica que la memoria externa está disponible y podemos tanto leer como escribir en ella.\n if (estado.equals(Environment.MEDIA_MOUNTED))\n {\n System.out.println(\"Podemos leer y escribir\");\n sdDisponible = true;\n sdAccesoEscritura = true;\n crearIntentGallery();\n }\n else if (estado.equals(Environment.MEDIA_MOUNTED_READ_ONLY))\n {\n System.out.println(\"Podemos SOLO leer\");\n sdDisponible = true;\n sdAccesoEscritura = false;\n }\n else\n {\n System.out.println(\"No Podemos hacer nada\");\n sdDisponible = false;\n sdAccesoEscritura = false;\n }\n }", "private void setupAllMafiosis()\n {\n }", "public static void inicializaMedicosText() {\n \n try (BufferedWriter bw = new BufferedWriter(new FileWriter(\"medicos.txt\"))) {\n for (Medico m : medicos) {\n if(m.getPuesto()==null)\n bw.write(m.getCedula() + \",\" + m.getNombres() + \",\" + m.getApellidos() + \",\" + m.getEdad() + \",0\");\n else\n bw.write(m.getCedula() + \",\" + m.getNombres() + \",\" + m.getApellidos() + \",\" + m.getEdad() + \",\" + m.getPuesto().getId());\n bw.newLine();\n }\n }\n catch (IOException ex) {\n Logger.getLogger(StageAdmin.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void initAreaImageFilm() {\n\n }", "public List<Medico> getAllMedicos() {\n List<Medico> medicos = new ArrayList<Medico>();\n try {\n PreparedStatement pstm = null;\n ResultSet rs = null;\n String query = \"SELECT *FROM medico\";\n pstm = con.prepareStatement(query);\n rs = pstm.executeQuery();\n while (rs.next()) {\n Medico medico = new Medico();\n medico.setId(rs.getInt(\"id_medico\"));\n medico.setArea(rs.getString(\"area\"));\n medico.setNombre(rs.getString(\"nombre\"));\n medico.setAp_pat(rs.getString(\"apell_pat\"));\n medico.setAp_mat(rs.getString(\"apell_mat\"));\n medico.setDireccion(rs.getString(\"direccion\"));\n medico.setEmail(rs.getString(\"email\"));\n medico.setTel(rs.getString(\"tel\"));\n medico.setHora_inc(rs.getString(\"hora_inic\"));\n medico.setHora_fin(rs.getString(\"hora_fin\"));\n medicos.add(medico);\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return medicos;\n }", "public ArrayList<DeviceMediaItem> getAllImagesByFolder(String path, Context contx) {\n ArrayList<DeviceMediaItem> media = new ArrayList<>();\n Uri allImagesuri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n String[] projection = {MediaStore.Images.ImageColumns.DATA, MediaStore.Images.Media.DISPLAY_NAME,\n MediaStore.Images.Media.SIZE, MediaStore.Images.Media.DATE_ADDED};\n Cursor cursor = contx.getContentResolver().query(allImagesuri, projection, MediaStore.Images.Media.DATA + \" like ? \", new String[]{\"%\" + path + \"%\"}, null);\n try {\n cursor.moveToFirst();\n do {\n DeviceMediaItem pic = new DeviceMediaItem();\n\n pic.setName(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DISPLAY_NAME)));\n pic.setPath(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA)));\n String date = getDate(cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_ADDED)));\n pic.setDate(date);\n\n media.add(pic);\n } while (cursor.moveToNext());\n cursor.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n Uri allVideosuri = android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI;\n String[] vidProjection = {MediaStore.Video.VideoColumns.DATA, MediaStore.Video.Media.DISPLAY_NAME,\n MediaStore.Video.Media.SIZE, MediaStore.Video.Media.DATE_ADDED};\n Cursor vidCursor = contx.getContentResolver().query(allVideosuri, vidProjection, MediaStore.Images.Media.DATA + \" like ? \", new String[]{\"%\" + path + \"%\"}, null);\n try {\n vidCursor.moveToFirst();\n do {\n DeviceMediaItem pic = new DeviceMediaItem();\n\n pic.setName(vidCursor.getString(vidCursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME)));\n pic.setPath(vidCursor.getString(vidCursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA)));\n String date = getDate(vidCursor.getLong(vidCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATE_ADDED)));\n pic.setDate(date);\n\n media.add(pic);\n } while (vidCursor.moveToNext());\n vidCursor.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n return media;\n }", "private void getDemographicFiles(Uin uinObject, List<DocumentsDTO> documents) {\n\t\tuinObject.getDocuments().stream().forEach(demo -> {\n\t\t\ttry {\n\t\t\t\tString fileName = DEMOGRAPHICS + SLASH + demo.getDocId();\n\t\t\t\tLocalDateTime startTime = DateUtils.getUTCCurrentDateTime();\n\t\t\t\tbyte[] data = securityManager\n\t\t\t\t\t\t.decrypt(IOUtils.toByteArray(fsAdapter.getFile(uinObject.getUinHash(), fileName)));\n\t\t\t\tmosipLogger.debug(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES,\n\t\t\t\t\t\t\"time taken to get file in millis: \" + fileName + \" - \"\n\t\t\t\t\t\t\t\t+ Duration.between(startTime, DateUtils.getUTCCurrentDateTime()).toMillis() + \" \"\n\t\t\t\t\t\t\t\t+ \"Start time : \" + startTime + \" \" + \"end time : \"\n\t\t\t\t\t\t\t\t+ DateUtils.getUTCCurrentDateTime());\n\t\t\t\tif (demo.getDocHash().equals(securityManager.hash(data))) {\n\t\t\t\t\tdocuments.add(new DocumentsDTO(demo.getDoccatCode(), CryptoUtil.encodeBase64(data)));\n\t\t\t\t} else {\n\t\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES,\n\t\t\t\t\t\t\tIdRepoErrorConstants.DOCUMENT_HASH_MISMATCH.getErrorMessage());\n\t\t\t\t\tthrow new IdRepoAppException(IdRepoErrorConstants.DOCUMENT_HASH_MISMATCH);\n\t\t\t\t}\n\t\t\t} catch (IdRepoAppException e) {\n\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, \"\\n\" + e.getMessage());\n\t\t\t\tthrow new IdRepoAppUncheckedException(e.getErrorCode(), e.getErrorText(), e);\n\t\t\t} catch (FSAdapterException e) {\n\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, \"\\n\" + e.getMessage());\n\t\t\t\tthrow new IdRepoAppUncheckedException(\n\t\t\t\t\t\te.getErrorCode().equals(HDFSAdapterErrorCode.FILE_NOT_FOUND_EXCEPTION.getErrorCode())\n\t\t\t\t\t\t\t\t? IdRepoErrorConstants.FILE_NOT_FOUND\n\t\t\t\t\t\t\t\t: IdRepoErrorConstants.FILE_STORAGE_ACCESS_ERROR,\n\t\t\t\t\t\te);\n\t\t\t} catch (IOException e) {\n\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, \"\\n\" + e.getMessage());\n\t\t\t\tthrow new IdRepoAppUncheckedException(IdRepoErrorConstants.FILE_STORAGE_ACCESS_ERROR, e);\n\t\t\t}\n\t\t});\n\t}", "public static void cargarMedicos() {\n medicos = new LinkedList<>();\n try {\n File f = new File(\"medicos.txt\");\n Scanner s = new Scanner(f);\n while (s.hasNextLine()) {\n String line = s.nextLine();\n String[] texto = line.split(\",\");\n Medico m = new Medico(texto[0], texto[1], texto[2], Integer.parseInt(texto[3]));\n int idPuesto = Integer.valueOf(texto[4].trim());\n if (idPuesto!=0) {\n Puesto pt = puestoPorId(idPuesto);\n if(pt == null){\n pt = new Puesto();\n puestos.add(pt);\n }\n m.setPuesto(pt);\n pt.setMedico(m);\n }\n else{\n m.setPuesto(null);\n }\n medicos.add(m);\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"El archivo no existe...\");\n }\n }", "private void getImagesFromServer() {\n trObtainAllPetImages.setUser(user);\n trObtainAllPetImages.execute();\n Map<String, byte[]> petImages = trObtainAllPetImages.getResult();\n Set<String> names = petImages.keySet();\n\n for (String petName : names) {\n byte[] bytes = petImages.get(petName);\n Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, Objects.requireNonNull(bytes).length);\n int index = user.getPets().indexOf(new Pet(petName));\n user.getPets().get(index).setProfileImage(bitmap);\n ImageManager.writeImage(ImageManager.PET_PROFILE_IMAGES_PATH, user.getUsername() + '_' + petName, bytes);\n }\n }", "private void getPhotos(final View view ) {\r\n final String placeId = Detail.getInstance().getPlaceId();\r\n final Task<PlacePhotoMetadataResponse> photoMetadataResponse = mGeoDataClient.getPlacePhotos(placeId);\r\n photoMetadataResponse.addOnCompleteListener(new OnCompleteListener<PlacePhotoMetadataResponse>() {\r\n @Override\r\n public void onComplete(@NonNull Task<PlacePhotoMetadataResponse> task) {\r\n try {\r\n // Get the list of photos.\r\n PlacePhotoMetadataResponse photos = task.getResult();\r\n // Get the PlacePhotoMetadataBuffer (metadata for all of the photos).\r\n PlacePhotoMetadataBuffer photoMetadataBuffer = photos.getPhotoMetadata();\r\n // Get the first photo in the list.\r\n final LinearLayout ll = (LinearLayout) view.findViewById(R.id.photos_table);\r\n if (photoMetadataBuffer == null) {\r\n Toast.makeText(mContext, \"No photos found\", Toast.LENGTH_SHORT);\r\n\r\n pm.setText(\"No photos found!\");\r\n return;\r\n }\r\n\r\n for ( int i=0; i < photoMetadataBuffer.getCount(); i++ ){\r\n PlacePhotoMetadata photoMetadata = photoMetadataBuffer.get(i).freeze();\r\n // Get the attribution text.\r\n CharSequence attribution = photoMetadata.getAttributions();\r\n // Get a full-size bitmap for the photo.\r\n Task<PlacePhotoResponse> photoResponse = mGeoDataClient.getPhoto(photoMetadata);\r\n photoResponse.addOnCompleteListener(new OnCompleteListener<PlacePhotoResponse>() {\r\n @Override\r\n public void onComplete(@NonNull Task<PlacePhotoResponse> task) {\r\n PlacePhotoResponse photo = task.getResult();\r\n Bitmap bitmap = photo.getBitmap();\r\n System.out.println(\"Photo url: \" + bitmap);\r\n photoURLs.add(bitmap);\r\n ImageView img = new ImageView(mContext);\r\n LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(1000, 1000);\r\n\r\n lp.setMargins(10, 5, 10, 5);\r\n img.setLayoutParams(lp);\r\n img.setImageBitmap(bitmap);\r\n //img.getLayoutParams().width = 1000;\r\n //img.setMaxWidth(1000);\r\n ll.addView(img);\r\n }\r\n });\r\n\r\n }\r\n\r\n\r\n System.out.println(\"Total number of photos: \"+ photoURLs.size());\r\n photoMetadataBuffer.release();\r\n pm.setText(\"No photos found!\");\r\n\r\n } catch ( Exception e) {\r\n pm.setText(\"No photos found!\");\r\n }\r\n }\r\n });\r\n }", "private void getBiometricFiles(Uin uinObject, List<DocumentsDTO> documents) {\n\t\tuinObject.getBiometrics().stream().forEach(bio -> {\n\t\t\tif (allowedBioAttributes.contains(bio.getBiometricFileType())) {\n\t\t\t\ttry {\n\t\t\t\t\tString fileName = BIOMETRICS + SLASH + bio.getBioFileId();\n\t\t\t\t\tLocalDateTime startTime = DateUtils.getUTCCurrentDateTime();\n\t\t\t\t\tbyte[] data = securityManager\n\t\t\t\t\t\t\t.decrypt(IOUtils.toByteArray(fsAdapter.getFile(uinObject.getUinHash(), fileName)));\n\t\t\t\t\tmosipLogger.debug(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES,\n\t\t\t\t\t\t\t\"time taken to get file in millis: \" + fileName + \" - \"\n\t\t\t\t\t\t\t\t\t+ Duration.between(startTime, DateUtils.getUTCCurrentDateTime()).toMillis() + \" \"\n\t\t\t\t\t\t\t\t\t+ \"Start time : \" + startTime + \" \" + \"end time : \"\n\t\t\t\t\t\t\t\t\t+ DateUtils.getUTCCurrentDateTime());\n\t\t\t\t\tif (Objects.nonNull(data)) {\n\t\t\t\t\t\tif (StringUtils.equals(bio.getBiometricFileHash(), securityManager.hash(data))) {\n\t\t\t\t\t\t\tdocuments.add(new DocumentsDTO(bio.getBiometricFileType(), CryptoUtil.encodeBase64(data)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES,\n\t\t\t\t\t\t\t\t\tIdRepoErrorConstants.DOCUMENT_HASH_MISMATCH.getErrorMessage());\n\t\t\t\t\t\t\tthrow new IdRepoAppException(IdRepoErrorConstants.DOCUMENT_HASH_MISMATCH);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (IdRepoAppException e) {\n\t\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, e.getMessage());\n\t\t\t\t\tthrow new IdRepoAppUncheckedException(e.getErrorCode(), e.getErrorText(), e);\n\t\t\t\t} catch (FSAdapterException e) {\n\t\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, e.getMessage());\n\t\t\t\t\tthrow new IdRepoAppUncheckedException(\n\t\t\t\t\t\t\te.getErrorCode().equals(HDFSAdapterErrorCode.FILE_NOT_FOUND_EXCEPTION.getErrorCode())\n\t\t\t\t\t\t\t\t\t? IdRepoErrorConstants.FILE_NOT_FOUND\n\t\t\t\t\t\t\t\t\t: IdRepoErrorConstants.FILE_STORAGE_ACCESS_ERROR,\n\t\t\t\t\t\t\te);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tmosipLogger.error(IdRepoSecurityManager.getUser(), ID_REPO_SERVICE_IMPL, GET_FILES, e.getMessage());\n\t\t\t\t\tthrow new IdRepoAppUncheckedException(IdRepoErrorConstants.FILE_STORAGE_ACCESS_ERROR, e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public List<String> getManga(long id) {\n /* SELECT\n Chapter.file_path\n FROM\n Chapter\n WHERE\n Chapter.idManga = id */\n throw new UnsupportedOperationException(\"Not supported yet.\");\n }", "public void dumpImageMetaData(Uri uri) {\n // BEGIN_INCLUDE (dump_metadata)\n\n // The query, since it only applies to a single document, will only return one row.\n // no need to filter, sort, or select fields, since we want all fields for one\n // document.\n Cursor cursor = getActivity().getContentResolver()\n .query(uri, null, null, null, null, null);\n\n try {\n // moveToFirst() returns false if the cursor has 0 rows. Very handy for\n // \"if there's anything to look at, look at it\" conditionals.\n if (cursor != null && cursor.moveToFirst()) {\n\n // Note it's called \"Display Name\". This is provider-specific, and\n // might not necessarily be the file name.\n String displayName = cursor.getString(\n cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));\n //Toast.makeText(getActivity(),\"Display Name: \"+ displayName, Toast.LENGTH_SHORT).show();\n imageInfo += \"Name:\" + displayName;\n int sizeIndex = cursor.getColumnIndex(OpenableColumns.SIZE);\n // If the size is unknown, the value stored is null. But since an int can't be\n // null in java, the behavior is implementation-specific, which is just a fancy\n // term for \"unpredictable\". So as a rule, check if it's null before assigning\n // to an int. This will happen often: The storage API allows for remote\n // files, whose size might not be locally known.\n String size = null;\n if (!cursor.isNull(sizeIndex)) {\n // Technically the column stores an int, but cursor.getString will do the\n // conversion automatically.\n size = cursor.getString(sizeIndex);\n } else {\n size = \"Unknown\";\n }\n imageInfo += \"Size: \" + size;\n //Toast.makeText(getActivity(),\"Size: \"+size,Toast.LENGTH_SHORT).show();\n }\n } finally {\n if (cursor != null) {\n cursor.close();\n }\n }\n // END_INCLUDE (dump_metadata)\n }", "@Override\n protected void elaboraMappaBiografie() {\n if (mappaCognomi == null) {\n mappaCognomi = Cognome.findMappaTaglioListe();\n }// end of if cycle\n }", "private void setPhotoAttcher() {\n\n }", "public void importMedia(){\r\n \r\n }", "public List<String> getimagenames() {\n List<String> arrimg=new ArrayList<String>();\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(\"select * from \" + TABLE_NAME +\" ORDER BY \" + POSITIONNO + \" ASC\" ,null);\n if (cursor.moveToFirst()) {\n while (!cursor.isAfterLast()) {\n String name = cursor.getString(cursor.getColumnIndex(IMGNAME));\n\n arrimg.add(name);\n cursor.moveToNext();\n }\n }\n\n return arrimg;\n }", "private void getGalleryData() {\n\n // Get relevant columns for use later.\n String[] projection = {\n MediaStore.Files.FileColumns._ID,\n MediaStore.Files.FileColumns.DATA,\n MediaStore.Files.FileColumns.DATE_ADDED,\n MediaStore.Files.FileColumns.MEDIA_TYPE,\n MediaStore.Files.FileColumns.MIME_TYPE,\n MediaStore.Files.FileColumns.TITLE\n };\n\n // Return only video and image metadata.\n String selection = MediaStore.Files.FileColumns.MEDIA_TYPE + \"=\"\n + MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE\n + Constants.OR_TXT\n + MediaStore.Files.FileColumns.MEDIA_TYPE + \"=\"\n + MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO;\n\n Uri queryUri = MediaStore.Files.getContentUri(Constants.EXTERNAL_MEMORY);\n\n CursorLoader cursorLoader = new CursorLoader(\n this,\n queryUri,\n projection,\n selection,\n null, // Selection args (none).\n MediaStore.Files.FileColumns.DATE_ADDED + Constants.SORTING_ORDER // Sort order.\n );\n\n Cursor cursor = cursorLoader.loadInBackground();\n //int columnIndex = cursor.getColumnIndex(MediaStore.Video.Thumbnails.DATA);\n\n if (cursor.moveToFirst()) {\n do {\n // String data = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Thumbnails.DATA));\n String image = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA));\n //String video = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Media.DATA));\n mGalleryData.add(image);\n\n // String uri = cursor.getString(columnIndex);\n } while (cursor.moveToNext());\n }\n cursor.close();\n mGalleryData.size();\n // add gallery fragment\n addGalleryFragment();\n }", "public void limpiarMemoria();", "public void listarCarpetas() {\n\t\tFile ruta = new File(\"C:\" + File.separator + \"Users\" + File.separator + \"ram\" + File.separator + \"Desktop\" + File.separator+\"leyendo_creando\");\n\t\t\n\t\t\n\t\tSystem.out.println(ruta.getAbsolutePath());\n\t\t\n\t\tString[] nombre_archivos = ruta.list();\n\t\t\n\t\tfor (int i=0; i<nombre_archivos.length;i++) {\n\t\t\t\n\t\t\tSystem.out.println(nombre_archivos[i]);\n\t\t\t\n\t\t\tFile f = new File (ruta.getAbsoluteFile(), nombre_archivos[i]);//SE ALMACENA LA RUTA ABSOLUTA DE LOS ARCHIVOS QUE HAY DENTRO DE LA CARPTEA\n\t\t\t\n\t\t\tif(f.isDirectory()) {\n\t\t\t\tString[] archivos_subcarpeta = f.list();\n\t\t\t\tfor (int j=0; j<archivos_subcarpeta.length;j++) {\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(archivos_subcarpeta[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public interface MediaMapper {\n List<MediaUtil> selectMediaReportCount(MediaUtil mediaUtil);\n}", "private void esvaziaMensageiro() {\n\t\tMensageiro.arquivo=null;\n\t\tMensageiro.lingua = linguas.indexOf(lingua);\n\t\tMensageiro.linguas=linguas;\n\t\tMensageiro.nomeArquivo=null;\n\t}", "public Set<Medicine> loadMedicines();", "public List<ProLogo> findAllLogo(){\n \tString consulta=\"SELECT p FROM ProLogo p\";\n \tQuery q=em.createQuery(consulta, ProLogo.class);\n \treturn q.getResultList();\n }", "@Override\n\tpublic DAOIncidencias CrearInformesMedicos() {\n\t\treturn null;\n\t}", "public interface MetaInfo {\n\n String DIR_EMPTY = \"empty\";\n\n\n //===========================\n float WEIGHT_CAMERA_MOTION = 1;\n float WEIGHT_LOCATION = 1;\n float WEIGHT_MEDIA_TYPE = 1;\n float WEIGHT_SHORT_TYPE = 1;\n\n float WEIGHT_MEDIA_DIR = 3f;\n float WEIGHT_TIME = 3;\n float WEIGHT_VIDEO_TAG = 2.5f;\n float WEIGHT_SHOT_KEY = 5f;\n float WEIGHT_SHOT_CATEGORY = 2.5f;\n\n int FLAG_TIME = 0x0001;\n int FLAG_LOCATION = 0x0002;\n int FLAG_MEDIA_TYPE = 0x0004;\n int FLAG_MEDIA_DIR = 0x0008;\n int FLAG_SHOT_TYPE = 0x0010;\n int FLAG_CAMERA_MOTION = 0x0020;\n int FLAG_VIDEO_TAG = 0x0040;\n int FLAG_SHOT_KEY = 0x0080;\n int FLAG_SHOT_CATEGORY = 0x0100;\n\n //================= location ==================\n int LOCATION_NEAR_GPS = 1;\n int LOCATION_SAME_COUNTRY = 2;\n int LOCATION_SAME_PROVINCE = 3; //省,市,区\n int LOCATION_SAME_CITY = 4;\n int LOCATION_SAME_REGION = 5;\n\n //=================== for camera motion ====================\n int STILL = 0; // 静止, class 0\n int ZOOM = 3; // 前后移动(zoomIn or zoomOut), class 1\n int ZOOM_IN = 4;\n int ZOOM_OUT = 5;\n int PAN = 6; // 横向移动(leftRight or rightLeft), class 2\n int PAN_LEFT_RIGHT = 7;\n int PAN_RIGHT_LEFT = 8;\n int TILT = 9; // 纵向移动(upDown or downUp), class 3\n int TILT_UP_DOWN = 10;\n int TILT_DOWN_UP = 11;\n int CATEGORY_STILL = 1;\n int CATEGORY_ZOOM = 2;\n int CATEGORY_PAN = 3;\n int CATEGORY_TILT = 4;\n\n //图像类型。视频,图片。 已有\n\n //============== shooting device =================\n /**\n * the shoot device: cell phone\n */\n int SHOOTING_DEVICE_CELLPHONE = 1;\n /**\n * the shoot device: camera\n */\n int SHOOTING_DEVICE_CAMERA = 2;\n\n /**\n * the shoot device: drone\n */\n int SHOOTING_DEVICE_DRONE = 3; //无人机\n\n\n //====================== shooting mode ===========================\n /**\n * shooting mode: normal\n */\n int SHOOTING_MODE_NORMAL = 1;\n /**\n * shooting mode: slow motion\n */\n int SHOOTING_MODE_SLOW_MOTION = 2;\n /**\n * shooting mode: time lapse\n */\n int SHOOTING_MODE_TIME_LAPSE = 3;\n\n //=========================== shot type =======================\n /**\n * shot type: big - long- short ( 大远景)\n */\n int SHOT_TYPE_BIG_LONG_SHORT = 5;\n /**\n * shot type: long short ( 远景)\n */\n int SHOT_TYPE_LONG_SHORT = 4;\n\n /** medium long shot. (中远景) */\n int SHOT_TYPE_MEDIUM_LONG_SHOT = 3;\n /**\n * shot type: medium shot(中景)\n */\n int SHOT_TYPE_MEDIUM_SHOT = 2;\n /**\n * shot type: close up - chest ( 特写-胸)\n */\n int SHOT_TYPE_MEDIUM_CLOSE_UP = 1;\n\n /**\n * shot type: close up -head ( 特写-头)\n */\n int SHOT_TYPE_CLOSE_UP = 0;\n\n int SHOT_TYPE_NONE = -1;\n\n int CATEGORY_CLOSE_UP = 12; //特写/近景\n int CATEGORY_MIDDLE_VIEW = 11; //中景\n int CATEGORY_VISION = 10; //远景\n\n //========================== time ==========================\n int[] MORNING_HOURS = {7, 8, 9, 10, 11};\n int[] AFTERNOON_HOURS = {12, 13, 14, 15, 16, 17};\n //int[] NIGHT_HOURS = {18, 19, 20, 21, 22, 24, 1, 2, 3, 4, 5, 6};\n int TIME_SAME_DAY = 1;\n int TIME_SAME_PERIOD_IN_DAY = 2; //timeSamePeriodInDay\n\n class LocationMeta {\n private double longitude, latitude;\n /**\n * 高程精度比水平精度低原因,主要是GPS测出的是WGS-84坐标系下的大地高,而我们工程上,也就是电子地图上采用的高程一般是正常高,\n * 它们之间的转化受到高程异常和大地水准面等误差的制约。\n * 卫星在径向的定轨精度较差,也限制了GPS垂直方向的精度。\n */\n private int gpsHeight; //精度不高\n private String country, province, city, region; //国家, 省, 市, 区\n\n public double getLongitude() {\n return longitude;\n }\n\n public void setLongitude(double longitude) {\n this.longitude = longitude;\n }\n\n public double getLatitude() {\n return latitude;\n }\n\n public void setLatitude(double latitude) {\n this.latitude = latitude;\n }\n\n public String getCountry() {\n return country;\n }\n\n public void setCountry(String country) {\n this.country = country;\n }\n\n public String getProvince() {\n return province;\n }\n\n public void setProvince(String province) {\n this.province = province;\n }\n\n public String getCity() {\n return city;\n }\n\n public void setCity(String city) {\n this.city = city;\n }\n\n public String getRegion() {\n return region;\n }\n\n public void setRegion(String region) {\n this.region = region;\n }\n\n public int getGpsHeight() {\n return gpsHeight;\n }\n\n public void setGpsHeight(int gpsHeight) {\n this.gpsHeight = gpsHeight;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n LocationMeta that = (LocationMeta) o;\n\n if (Double.compare(that.longitude, longitude) != 0) return false;\n if (Double.compare(that.latitude, latitude) != 0) return false;\n if (gpsHeight != that.gpsHeight) return false;\n if (country != null ? !country.equals(that.country) : that.country != null)\n return false;\n if (province != null ? !province.equals(that.province) : that.province != null)\n return false;\n if (city != null ? !city.equals(that.city) : that.city != null) return false;\n return region != null ? region.equals(that.region) : that.region == null;\n }\n }\n\n /**\n * the meta data of image/video ,something may from 'AI'.\n */\n class ImageMeta extends SimpleCopyDelegate{\n private String path;\n private int mediaType;\n /** in mills */\n private long date;\n\n /** in mill-seconds */\n private long duration;\n private int width, height;\n\n private LocationMeta location;\n\n /**\n * frames/second\n */\n private int fps = 30;\n /** see {@linkplain IShotRecognizer#CATEGORY_ENV} and etc. */\n private int shotCategory;\n /**\n * the shot type\n */\n private String shotType;\n\n /** shot key */\n private String shotKey;\n /**\n * 相机运动\n */\n private String cameraMotion;\n /** video tags */\n private List<List<Integer>> tags;\n\n /** the whole frame data of video(from analyse , like AI. ), after read should not change */\n private SparseArray<VideoDataLoadUtils.FrameData> frameDataMap;\n /** the high light data. key is the time in seconds. */\n private SparseArray<List<? extends IHighLightData>> highLightMap;\n private HighLightHelper mHighLightHelper;\n\n /** 主人脸个数 */\n private int mainFaceCount = -1;\n private int mBodyCount = -1;\n\n /** 通用tag信息 */\n private List<FrameTags> rawVideoTags;\n /** 人脸框信息 */\n private List<FrameFaceRects> rawFaceRects;\n\n //tag indexes\n private List<Integer> nounTags;\n private List<Integer> domainTags;\n private List<Integer> adjTags;\n\n private Location subjectLocation;\n\n //-------------------------- start High-Light ----------------------------\n /** set metadata for high light data. (from load high light) */\n public void setMediaData(MediaData mediaData) {\n List<MediaData.HighLightPair> hlMap = mediaData.getHighLightDataMap();\n if(!Predicates.isEmpty(hlMap)) {\n highLightMap = new SparseArray<>();\n VisitServices.from(hlMap).fire(new FireVisitor<MediaData.HighLightPair>() {\n @Override\n public Boolean visit(MediaData.HighLightPair pair, Object param) {\n List<MediaData.HighLightData> highLightData = VEGapUtils.filterHighLightByScore(pair.getDatas());\n if(!Predicates.isEmpty(highLightData)){\n highLightMap.put(pair.getTime(), highLightData);\n }\n return null;\n }\n });\n }\n mHighLightHelper = new HighLightHelper(highLightMap, mediaType == IPathTimeTraveller.TYPE_IMAGE);\n }\n @SuppressWarnings(\"unchecked\")\n public KeyValuePair<Integer, List<IHighLightData>> getHighLight(int time){\n return mHighLightHelper.getHighLight(time);\n }\n @SuppressWarnings(\"unchecked\")\n public KeyValuePair<Integer, List<IHighLightData>> getHighLight(ColorGapContext context, ITimeTraveller tt){\n return mHighLightHelper.getHighLight(context, tt);\n }\n\n public List<KeyValuePair<Integer, List<IHighLightData>>> getHighLights(ColorGapContext context, ITimeTraveller tt){\n return mHighLightHelper.getHighLights(context, tt);\n }\n @SuppressWarnings(\"unchecked\")\n public HighLightArea getHighLightArea(ColorGapContext context, ITimeTraveller tt){\n return mHighLightHelper.getHighLightArea(context, tt);\n }\n\n public void setHighLightMap(SparseArray<List<? extends IHighLightData>> highLightMap) {\n this.highLightMap = highLightMap;\n this.mHighLightHelper = new HighLightHelper(highLightMap, mediaType == IPathTimeTraveller.TYPE_IMAGE);\n }\n\n //-------------------------- end High-Light ----------------------------\n public SparseArray<VideoDataLoadUtils.FrameData> getFrameDataMap() {\n if(frameDataMap == null){\n frameDataMap = new SparseArray<>();\n }\n return frameDataMap;\n }\n public void setFrameDataMap(SparseArray<VideoDataLoadUtils.FrameData> frameDataMap) {\n this.frameDataMap = frameDataMap;\n }\n public void travelAllFrameDatas(Map.MapTravelCallback<Integer, VideoDataLoadUtils.FrameData> traveller){\n Throwables.checkNull(frameDataMap);\n CollectionUtils.travel(frameDataMap, traveller);\n }\n\n public List<Integer> getNounTags() {\n return nounTags != null ? nounTags : Collections.emptyList();\n }\n public void setNounTags(List<Integer> nounTags) {\n this.nounTags = nounTags;\n }\n\n public List<Integer> getDomainTags() {\n return domainTags != null ? domainTags : Collections.emptyList();\n }\n public void setDomainTags(List<Integer> domainTags) {\n this.domainTags = domainTags;\n }\n\n public List<Integer> getAdjTags() {\n return adjTags != null ? adjTags : Collections.emptyList();\n }\n public void setAdjTags(List<Integer> adjTags) {\n this.adjTags = adjTags;\n }\n public void setShotCategory(int shotCategory) {\n this.shotCategory = shotCategory;\n }\n\n public int getShotCategory() {\n return shotCategory;\n }\n public String getShotKey() {\n return shotKey;\n }\n public void setShotKey(String shotKey) {\n this.shotKey = shotKey;\n }\n\n public int getMainFaceCount() {\n return mainFaceCount;\n }\n public void setMainFaceCount(int mainFaceCount) {\n this.mainFaceCount = mainFaceCount;\n }\n public int getMediaType() {\n return mediaType;\n }\n public void setMediaType(int mediaType) {\n this.mediaType = mediaType;\n }\n\n public String getPath() {\n return path;\n }\n\n public void setPath(String path) {\n this.path = path;\n }\n\n /** date in mills */\n public long getDate() {\n return date;\n }\n /** date in mills */\n public void setDate(long date) {\n this.date = date;\n }\n\n public long getDuration() {\n return duration;\n }\n\n /** set duration in mill-seconds */\n public void setDuration(long duration) {\n this.duration = duration;\n }\n\n public int getWidth() {\n return width;\n }\n\n public void setWidth(int width) {\n this.width = width;\n }\n\n public int getHeight() {\n return height;\n }\n\n public void setHeight(int height) {\n this.height = height;\n }\n\n public int getFps() {\n return fps;\n }\n\n public void setFps(int fps) {\n this.fps = fps;\n }\n\n public String getShotType() {\n return shotType;\n }\n\n public void setShotType(String shotType) {\n this.shotType = shotType;\n }\n\n public String getCameraMotion() {\n return cameraMotion;\n }\n\n public void setCameraMotion(String cameraMotion) {\n this.cameraMotion = cameraMotion;\n }\n\n public List<List<Integer>> getTags() {\n return tags;\n }\n public void setTags(List<List<Integer>> tags) {\n this.tags = tags;\n }\n public LocationMeta getLocation() {\n return location;\n }\n public void setLocation(LocationMeta location) {\n this.location = location;\n }\n public void setBodyCount(int size) {\n this.mBodyCount = size;\n }\n public int getBodyCount(){\n return mBodyCount;\n }\n public int getPersonCount() {\n return Math.max(mBodyCount, mainFaceCount);\n }\n\n public Location getSubjectLocation() {\n return subjectLocation;\n }\n public void setSubjectLocation(Location subjectLocation) {\n this.subjectLocation = subjectLocation;\n }\n\n //============================================================\n public List<FrameFaceRects> getAllFaceRects() {\n if(frameDataMap == null){\n return Collections.emptyList();\n }\n List<FrameFaceRects> result = new ArrayList<>();\n final int size = frameDataMap.size();\n for (int i = 0; i < size ; i++) {\n FrameFaceRects faceRects = frameDataMap.valueAt(i).getFaceRects();\n if(faceRects != null) {\n result.add(faceRects);\n }else{\n //no face we just add a mock\n }\n }\n return result;\n }\n public List<FrameTags> getVideoTags(ITimeTraveller part) {\n return getVideoTags(part.getStartTime(), part.getEndTime());\n }\n\n /** get all video tags. startTime and endTime in frames */\n public List<FrameTags> getVideoTags(long startTime, long endTime) {\n if(frameDataMap == null){\n return Collections.emptyList();\n }\n List<FrameTags> result = new ArrayList<>();\n final int size = frameDataMap.size();\n for (int i = 0; i < size ; i++) {\n long key = CommonUtils.timeToFrame(frameDataMap.keyAt(i), TimeUnit.SECONDS);\n if(key >= startTime && key <= endTime){\n FrameTags tag = frameDataMap.valueAt(i).getTag();\n if(tag != null) {\n result.add(tag);\n }\n }\n }\n return result;\n }\n public List<FrameTags> getAllVideoTags() {\n if(frameDataMap == null){\n return Collections.emptyList();\n }\n List<FrameTags> result = new ArrayList<>();\n final int size = frameDataMap.size();\n for (int i = 0; i < size ; i++) {\n //long key = CommonUtils.timeToFrame(frameDataMap.keyAt(i), TimeUnit.SECONDS);\n FrameTags tag = frameDataMap.valueAt(i).getTag();\n if(tag != null) {\n result.add(tag);\n }\n }\n return result;\n }\n public List<FrameFaceRects> getFaceRects(ITimeTraveller part) {\n return getFaceRects(part.getStartTime(), part.getEndTime());\n }\n /** get all face rects. startTime and endTime in frames */\n public List<FrameFaceRects> getFaceRects(long startTime, long endTime) {\n if(frameDataMap == null){\n return Collections.emptyList();\n }\n List<FrameFaceRects> result = new ArrayList<>();\n final int size = frameDataMap.size();\n for (int i = 0; i < size ; i++) {\n long key = CommonUtils.timeToFrame(frameDataMap.keyAt(i), TimeUnit.SECONDS);\n if(key >= startTime && key <= endTime){\n FrameFaceRects faceRects = frameDataMap.valueAt(i).getFaceRects();\n if(faceRects != null) {\n result.add(faceRects);\n }\n }\n }\n return result;\n }\n\n public void setRawVideoTags(List<FrameTags> tags) {\n rawVideoTags = tags;\n }\n public List<FrameTags> getRawVideoTags() {\n return rawVideoTags;\n }\n\n public List<FrameFaceRects> getRawFaceRects() {\n return rawFaceRects;\n }\n public void setRawFaceRects(List<FrameFaceRects> rawFaceRects) {\n this.rawFaceRects = rawFaceRects;\n }\n /** 判断这段原始视频内容是否是“人脸为主”. work before cut */\n public boolean containsFaces(){\n if(rawFaceRects == null){\n if(frameDataMap == null){\n return false;\n }\n rawFaceRects = getAllFaceRects();\n }\n if(Predicates.isEmpty(rawFaceRects)){\n return false;\n }\n List<FrameFaceRects> tempList = new ArrayList<>();\n VisitServices.from(rawFaceRects).visitForQueryList((ffr, param) -> ffr.hasRect(), tempList);\n float result = tempList.size() * 1f / rawFaceRects.size();\n Logger.d(\"ImageMeta\", \"isHumanContent\", \"human.percent = \"\n + result + \" ,path = \" + path);\n return result > 0.55f;\n }\n\n /** 判断这段原始视频是否被标记原始tag(人脸 or 通用) . work before cut */\n public boolean hasRawTags(){\n return frameDataMap != null && frameDataMap.size() > 0;\n }\n\n @Override\n public void setFrom(SimpleCopyDelegate sc) {\n if(sc instanceof ImageMeta){\n ImageMeta src = (ImageMeta) sc;\n setShotType(src.getShotType());\n setShotCategory(src.getShotCategory());\n setShotKey(src.getShotKey());\n\n setMainFaceCount(src.getMainFaceCount());\n setDuration(src.getDuration());\n setMediaType(src.getMediaType());\n setPath(src.getPath());\n setCameraMotion(src.getCameraMotion());\n setDate(src.getDate());\n setFps(src.getFps());\n setHeight(src.getHeight());\n setWidth(src.getWidth());\n //not deep copy\n setTags(src.tags);\n setAdjTags(src.adjTags);\n setNounTags(src.nounTags);\n setDomainTags(src.domainTags);\n\n setLocation(src.getLocation());\n setRawFaceRects(src.getRawFaceRects());\n setRawVideoTags(src.getRawVideoTags());\n setFrameDataMap(src.frameDataMap);\n setHighLightMap(src.highLightMap);\n }\n }\n }\n\n}", "public List<Mobibus> darMobibus();", "public void grabarMetaDato (Campo cm) throws IOException\r\n {\r\n cm.fWrite(maestro); \r\n }", "private static byte[] m2539e(Context context) {\n Throwable th;\n int i = 0;\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n byte[] bArr = new byte[0];\n String a = Log.m2547a(context, Log.f1857e);\n DiskLruCache diskLruCache = null;\n try {\n diskLruCache = DiskLruCache.m2767a(new File(a), 1, 1, 10240);\n File file = new File(a);\n if (file != null && file.exists()) {\n String[] list = file.list();\n int length = list.length;\n while (i < length) {\n String str = list[i];\n if (str.contains(\".0\")) {\n byteArrayOutputStream.write(StatisticsManager.m2535a(diskLruCache, str.split(\"\\\\.\")[0]));\n }\n i++;\n }\n }\n bArr = byteArrayOutputStream.toByteArray();\n if (byteArrayOutputStream != null) {\n try {\n byteArrayOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (diskLruCache != null) {\n try {\n diskLruCache.close();\n } catch (Throwable th2) {\n th = th2;\n }\n }\n } catch (IOException th3) {\n BasicLogHandler.m2542a(th3, \"StatisticsManager\", \"getContent\");\n if (byteArrayOutputStream != null) {\n try {\n byteArrayOutputStream.close();\n } catch (IOException e2) {\n e2.printStackTrace();\n }\n }\n if (diskLruCache != null) {\n diskLruCache.close();\n }\n } catch (Throwable th4) {\n th3 = th4;\n }\n return bArr;\n th3.printStackTrace();\n return bArr;\n }", "private void collectPersistedScreenshotMetadata(Map<String, ScreenshotImportMetadatas> data) {\n data.forEach((k, v) -> {\n if (!v.isNotFound()) {\n ObjectContext context = serverRuntime.newContext();\n Pkg pkg = Pkg.getByName(context, k);\n pkg.getPkgSupplement().getPkgScreenshots().forEach((ps) -> v.add(createPersistedScreenshotMetadata(ps)));\n }\n });\n }", "private void cargarJugadoresEnMesa() {\n\n\t\tString nombreFichero = String.format(\"jugadoresEnMesa%d.csv\", id);\n\n\t\tthis.jugadoresEnMesa = GestionCSV.obtenerJugadores(nombreFichero);\n\n\t}", "com.yahoo.xpathproto.TransformTestProtos.ContentImage getImagesByHandler(int index);", "@Override\n\tpublic List<MedioPago> getall() {\n\t\treturn (List<MedioPago>) iMedioPagoDao.findAll();\t\t\n\t}", "@RequestMapping(value = \"/museum/{id}\", method = RequestMethod.GET)\n\tpublic List<Photo> getMuseumById(@PathVariable int id) {\n\t\treturn this.pr.findByMuseumIdmuseum(id);\n\n\t}", "public static Map<String, ArrayList<ImageDataModel>> getImageFolderMap(Activity activity) {\r\n imageFolderMap.clear();\r\n keyList.clear();\r\n imageDataModelList.clear();\r\n String BUCKET_ORDER_BY;\r\n Uri uri;\r\n Cursor cursor;\r\n int columnIndexDataPath, columnIndexFolderName, columnIndexTitleName,\r\n columnIndexDate, columnIndexSize, columnIndexBucketId, columnIndexAlbumId, columnIndexDuration;\r\n String absolutePathOfImage, folderName, imageTitle, fileDate, bucketId, AlbumId, fileSize, duration;\r\n\r\n /**\r\n * Fetching Audio type of files through content provider\r\n */\r\n /**\r\n * Fetching audio type of files through content provider\r\n */\r\n uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\r\n BUCKET_ORDER_BY = MediaStore.Audio.Media.DATE_MODIFIED + \" DESC\";\r\n String selection = MediaStore.Audio.Media.IS_MUSIC + \" != 0\";\r\n String[] projection1 = new String[]{MediaStore.Audio.AudioColumns.ALBUM,\r\n MediaStore.Audio.AudioColumns.ALBUM_ID,\r\n MediaStore.Audio.AudioColumns.DISPLAY_NAME,\r\n MediaStore.Audio.AudioColumns.DATA,\r\n MediaStore.Audio.AudioColumns.SIZE,\r\n MediaStore.Audio.AudioColumns.DATE_MODIFIED,\r\n\r\n MediaStore.Audio.AudioColumns.DURATION};\r\n\r\n cursor = activity.getContentResolver().query(uri, projection1, selection, null, BUCKET_ORDER_BY);\r\n if (cursor != null) {\r\n columnIndexFolderName = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.ALBUM);\r\n columnIndexAlbumId = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.ALBUM_ID);\r\n columnIndexTitleName = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.DISPLAY_NAME);\r\n\r\n columnIndexDataPath = cursor.getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.DATA);\r\n while (cursor.moveToNext()) {\r\n absolutePathOfImage = cursor.getString(columnIndexDataPath);\r\n folderName = Constant.AUDIO_FOLDER_NAME;\r\n imageTitle = cursor.getString(columnIndexTitleName);\r\n\r\n ImageDataModel imageDataModel = new ImageDataModel();\r\n imageDataModel.setFile(new File(absolutePathOfImage));\r\n imageDataModel.setFolderName(folderName);\r\n imageDataModel.setPath(absolutePathOfImage);\r\n imageDataModel.setImageTitle(imageTitle);\r\n imageDataModel.setBucketId(\"1\");\r\n imageDataModel.setTimeDuration(\"0\");\r\n imageDataModel.setSelected(false);\r\n if (FileUtils.isImageFile(absolutePathOfImage)) {\r\n imageDataModel.setImage(true);\r\n } else if (FileUtils.isVideoFile(absolutePathOfImage)) {\r\n imageDataModel.setVideo(true);\r\n } else if (FileUtils.isAudioFile(absolutePathOfImage)) {\r\n imageDataModel.setAudio(true);\r\n }\r\n if (imageDataModel.getFile().length() > 0) {\r\n imageDataModelList.add(imageDataModel);\r\n if (imageFolderMap.containsKey(folderName)) {\r\n imageFolderMap.get(folderName).add(imageDataModel);\r\n } else {\r\n ArrayList<ImageDataModel> listOfAllImages = new ArrayList<ImageDataModel>();\r\n listOfAllImages.add(imageDataModel);\r\n imageFolderMap.put(folderName, listOfAllImages);\r\n }\r\n }\r\n }\r\n cursor.close();\r\n }\r\n keyList.addAll(imageFolderMap.keySet());\r\n //Send notification through main thread\r\n new Handler(Looper.getMainLooper()).post(new Runnable() {\r\n @Override\r\n public void run() {\r\n GlobalBus.getBus().post(new LandingFragmentNotification(Constant.UPDATE_UI));\r\n }\r\n });\r\n return imageFolderMap;\r\n }", "private void prepararImagenYStorage() {\n mImageBitmap = null;\n\n //this.capturarFotoButton = (Button) findViewById(R.id.capturarFotoButton);\n// setBtnListenerOrDisable(\n// this.capturarFotoButton,\n// mTakePicSOnClickListener,\n// MediaStore.ACTION_IMAGE_CAPTURE\n// );\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {\n mAlbumStorageDirFactory = new FroyoAlbumDirFactory();\n } else {\n mAlbumStorageDirFactory = new BaseAlbumDirFactory();\n }\n }", "Map<String, Object> getAllMetadata();" ]
[ "0.63093364", "0.57212687", "0.570804", "0.56451666", "0.5602815", "0.55436605", "0.55010366", "0.5452672", "0.5424493", "0.54170996", "0.5387014", "0.53826874", "0.53745496", "0.53361017", "0.532896", "0.53250325", "0.5300517", "0.52797437", "0.5274516", "0.52700686", "0.52589935", "0.5251402", "0.52495927", "0.5246845", "0.5237813", "0.52207196", "0.5216516", "0.5207019", "0.52032834", "0.5199988", "0.51977044", "0.5196245", "0.51866305", "0.5175096", "0.51708823", "0.5157016", "0.5153518", "0.51489884", "0.5147647", "0.51376146", "0.513159", "0.5129741", "0.512262", "0.51215464", "0.51172674", "0.511585", "0.51125115", "0.51012516", "0.50980675", "0.50911987", "0.50903916", "0.50880486", "0.5086399", "0.5085169", "0.50846773", "0.5084364", "0.50825524", "0.50791484", "0.5075774", "0.50698864", "0.5068766", "0.5066341", "0.5065129", "0.50636595", "0.5061279", "0.5060236", "0.50582796", "0.5056297", "0.50559056", "0.5051852", "0.50428724", "0.5039366", "0.50349665", "0.5030654", "0.5026563", "0.50245154", "0.50227153", "0.501892", "0.5017009", "0.5015149", "0.5014922", "0.5013266", "0.50043803", "0.50013983", "0.49963516", "0.49951035", "0.49933237", "0.49904704", "0.49858144", "0.4984644", "0.49845216", "0.4982748", "0.49782103", "0.49746713", "0.4970136", "0.49678028", "0.49653664", "0.49644235", "0.4964389", "0.49633333", "0.49589282" ]
0.0
-1
Will retrieve a BankThing.
public BankThing retrieve(String id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Bank getBank() {\n return Bank;\n }", "public Bank getBank() {\r\n return bank;\r\n }", "Optional<BankBranch> getByName(String name) throws ObjectNotFoundException;", "shared.data.Bank getBank();", "IBank getBank(int rekeningNr) throws RemoteException;", "Databank getBank();", "IBank getBankFromName(String bankName) throws RemoteException;", "public BankAccount getBankAccount (int secretKey) {\n // using a secretKey to obtain a BankAccount means/assumes that\n // the BankAccount belongs to an Agent that has been involved in\n // an AuctionHouse-linked transaction\n\n int theBankAccountNumber;\n // use the secretKey to get associated AccountLink\n AccountLink theAccountLink = hashMapOfSecretKeys.get(secretKey);\n\n if (theAccountLink != null) { // i.e. secret key was valid\n theBankAccountNumber = theAccountLink.getAGENT_ACCOUNT_NUMBER();\n } else {\n // secretKey appears to be invalid, return generic BankAccount\n return new BankAccount();\n }\n\n // return the associated BankAccount\n return hashMapOfAllAccts.get(theBankAccountNumber);\n\n }", "public BankThing save(BankThing thing);", "public String getBank() {\r\n return bank;\r\n }", "public String getBank() {\r\n return bank;\r\n }", "public String getBank() {\n return bank;\n }", "public Entity getBorrower();", "@Override\n\tpublic Bank getBank(int bankID) {\n\t\tfor (Bank bankInSet : cache.retrieveAllItems()) {\n\t\t\tif (bankInSet.getBankID() == bankID){\n\t\t\t\treturn bankInSet;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Bank find(Integer id) {\n return em.find(Bank.class, id);\n }", "public static Bank getInstance() {\r\n\t\treturn instance;\r\n\t}", "public ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyAddressDescription getBank()\n {\n synchronized (monitor())\n {\n check_orphaned();\n ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyAddressDescription target = null;\n target = (ch.crif_online.www.webservices.crifsoapservice.v1_00.CompanyAddressDescription)get_store().find_element_user(BANK$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public BankAccount findAccountById(int currentBankID) throws SQLException;", "public ClanBank getClanBank() {\n return clanBank;\n }", "public String getBank() {\n\t\tthis.setBank(this.bank);\n\t\treturn this.bank;\n\t}", "@Override\n\tpublic BnsCash get(String arg0) {\n\t\treturn cashRepository.findOne(arg0);\n\t}", "public Bike getBike(int bikeId){\n \n try(Connection con = DatabaseConnector.getConnection();\n PreparedStatement ps = con.prepareStatement(BIKE_BY_ID + bikeId);\n ResultSet rs = ps.executeQuery()){\n \n if(rs.next()){\n Bike bike = getBikeFromRS(rs);\n return bike;\n }\n }catch(Exception e){\n System.out.println(\"Exception\" + e);\n }\n return null;\n }", "@Override\r\n\tpublic List<Buss> findbid() {\n\t\treturn dao.findbid();\r\n\t}", "BillingAccount getBillingAccount();", "Optional<BankBranch> getByCode(String code) throws ObjectNotFoundException;", "public int getBankAccount() {\n return bankAccount;\n }", "public BankAccount getBankAccount(int accountNumber) {\n\t\tString sql = \"SELECT id, name, balance, balance_saving FROM accounts WHERE id = ?\";\n\n\t\ttry (PreparedStatement pstmt = dbConnection.prepareStatement(sql)) {\n\t\t\tpstmt.setInt(1, accountNumber);\n\t\t\tResultSet rs = pstmt.executeQuery();\n\n\t\t\t// loop through the result set\n\t\t\tif (rs.next()) {\n\t\t\t\tint id = rs.getInt(\"id\");\n\t\t\t\tString name = rs.getString(\"name\");\n\t\t\t\tint checking_balance = rs.getInt(\"balance\");\n\t\t\t\tint saving_balance = rs.getInt(\"balance_saving\");\n\t\t\t\treturn new BankAccount(id, name, checking_balance, saving_balance);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\n\t\treturn null;\n\t}", "Booking getBookingById(BookingKey bookingKey);", "Client findClientByName(Bank bank, String name) throws ClientNotFoundException;", "Account getAccount();", "public BankAccount getCheckingAccount() {\n return checkingAccount;\n }", "Account getAccount(int id);", "BInformation findOne(Long id);", "public double getAmountBank() {\n return this.amountBank;\n }", "public Bill getBill() {\n return bill;\n }", "public Object getThing() {\r\n\t\treturn myThing;\r\n\t}", "public Bank findByBankId(Integer id) {\n return (Bank) (em.find(Bank.class, id));\n\n }", "public BookBean retrieveBook(String bid) throws SQLException {\r\n\t\tString query = \"select * from BOOK where bid='\" + bid + \"'\";\t\t\r\n\t\tBookBean book = null;\r\n\t\tPreparedStatement p = con.prepareStatement(query);\t\t\r\n\t\tResultSet r = p.executeQuery();\r\n\t\t\r\n\t\twhile(r.next()){\r\n\t\t\tString bookID = r.getString(\"BID\");\r\n\t\t\tString title = r.getString(\"TITLE\");\r\n\t\t\tint price = r.getInt(\"PRICE\");\r\n\t\t\tString bookCategory = r.getString(\"CATEGORY\");\t\t\t\r\n\t\t\tbook = new BookBean(bookID, title, price,bookCategory);\r\n\t\t}\r\n\t\tr.close();\r\n\t\tp.close();\r\n\t\treturn book;\r\n\t}", "@Override\n\tpublic Account getAccount(Bank bank, String username) {\n\t\tif (cache.contains(bank)){\n\t\t\tfor (Account accountInBank : bank.getAccounts()) {\n\t\t\t\tif (accountInBank.getUsername().equals(username)) {\n\t\t\t\t\treturn accountInBank;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public BankAccount getSavingsAccount() {\n return this.savings;\n }", "@Test\n public void getHouseholdUsingGetTest() throws ApiException {\n UUID householdId = null;\n Household response = api.getHouseholdUsingGet(householdId);\n\n // TODO: test validations\n }", "Bond investmentGetBond(String bondName) throws BankException, BondException {\n throw new BankException(\"This account does not support this feature\");\n }", "@Override\n\tpublic Brand get(int id) {\n\t\t\n \ttry {\n \t\tsql=\"select * from brands where id=?\";\n\t\t\tquery=connection.prepareStatement(sql);\n \t\tquery.setInt(1, id);\n\t\t\t\n\t\t\tResultSet result=query.executeQuery();\n\t\t\tresult.next();\n\t\t\t\n\t\t\tBrand brand=new Brand(result.getInt(\"Id\"),result.getString(\"Name\"));\n\t\t\t\n\t\t\treturn brand;\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tnew Exception(e.getMessage());\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public String getBankID() {\n return bankID;\n }", "WayBill getWayBillById(Long id_wayBill) throws WayBillNotFoundException;", "public void testNewBid(){\n\n Thing thing = new Thing(new User());\n User borrower = new User();\n\n Bid bid = null;\n try {\n bid = new Bid(thing, borrower, 800);\n }catch(Exception e){\n fail();\n }\n assertEquals(800, bid.getAmount());\n assertEquals(Bid.Per.FLAT, bid.getPer());\n assertEquals(\"8.00\", bid.valueOf());\n assertEquals(\"$8.00\", bid.toString());\n\n }", "public static Bluetooth getBT(){\n return BT;\n }", "java.lang.String getBankName();", "public DataBank getDataBank() {\n return dataBank;\n }", "public Banking addFundsToAccount(Banking banking){\n return client.addBanking(banking);\n }", "public String getBankAccountType();", "public BankAccount getBalance (IDRecord idRecord) {\n\n BankAccount currentBankAccount;\n // extract the bank account number\n int theAcctNum = idRecord.getNumericalID();\n\n // find BankAccount from account -> BankAccount HashMap\n currentBankAccount = hashMapOfAllAccts.get(theAcctNum);\n\n if ( currentBankAccount == null) {\n // if no account was found, generate a generic empty account\n currentBankAccount = new BankAccount();\n\n }\n\n return currentBankAccount;\n }", "CusBankAccount selectByPrimaryKey(Integer id);", "public long getBankId() {\n return bankId;\n }", "public String getBankName() {\n return bankName;\n }", "com.google.ads.googleads.v6.resources.AccountBudget getAccountBudget();", "@Override\n\tpublic Budget getBudget() {\n\t\treturn budget;\n\t}", "@Override\r\n\tpublic Book getBook(long bookId) {\n\t\treturn bd.getOne(bookId);\r\n\t}", "com.google.openrtb.OpenRtb.BidResponse getBidresponse();", "public BankAccountInterface getAccount(String accountID){\n BankAccountInterface account = null;\n for(int i = 0; i < accounts.size(); i++){\n if(accounts.get(i).getAccountID().equals(accountID)){\n account = accounts.get(i);\n break;\n } \n }\n return account;\n }", "@Override\n\tpublic BikeAdvert getBikeAdvert(int theId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t//now retrive /read from db using the primary key\n\t\tBikeAdvert theBikeAdvert = currentSession.get(BikeAdvert.class,theId);\n\t\t\n\t\treturn theBikeAdvert;\n\t}", "@Override\r\n\tpublic BankAccountVO getBankAccountVO(String name) {\n\t\treturn null;\r\n\t}", "Account getAccount(Integer accountNumber);", "public Bill findBill(int cusID) {\n\t\treturn ab.get(cusID);\n\t}", "public T get(int objectId) throws SQLException;", "@Override\n\tpublic BankTransaction retrieveTransaction(int account_id) throws BusinessException {\n\t\tBankTransaction transaction = null;\n\t\tConnection connection;\n\t\ttry {\n\t\t\tconnection = PostgresqlConnection.getConnection();\n\t\t\tString sql = \"select transaction_id, account_id, transaction_type, amount, transaction_date from dutybank.transactions where account_id=?\";\n\t\t\t\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\t\t\tpreparedStatement.setInt(1, account_id);\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\t\n\t\t\tif (resultSet.next()) {\n\t\t\t\ttransaction = new BankTransaction();\n\t\t\t\ttransaction.setTransactionid(resultSet.getInt(\"transaction_id\"));\n\t\t\t\ttransaction.setAccountid(resultSet.getInt(\"account_id\"));\n\t\t\t\ttransaction.setTransactiontype(resultSet.getString(\"transaction_type\"));\n\t\t\t\ttransaction.setTransactionamount(resultSet.getDouble(\"amount\"));\n\t\t\t\ttransaction.setTransactiondate(resultSet.getDate(\"transaction_date\"));\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tthrow new BusinessException(\"Some Internal Error Occurred!\");\n\t\t\t}\n\t\t\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tthrow new BusinessException(\"Some exception has occurred while fetching transactions\");\n\t\t}\n\t\treturn transaction;\n\t}", "@Override\n\tpublic Besoin getBesion(int idBesion) {\n\t\treturn dao.getBesion(idBesion);\n\t}", "public String getBankID() {\n return bankID;\n }", "public abstract Company get(int id);", "IBooking getSeatonHold(String seatHoldId, String customerEmail) throws BookingNotAvailableException;", "public Borrow getBorrow(int rdID, int c) {\n\t\treturn ((BorrowDAL)dal).getBorrow(rdID,c);\r\n\t}", "BankAccountDTO getCustomerBankAccountDetails(Long slNo);", "@Nullable\n public String getBankBic() {\n return bankBic;\n }", "public LoanAccounting getAccounting();", "RiceCooker getById(long id);", "@Override\n public Building get(long id) {\n return dao.get(Building.class, id);\n }", "private Bike getBikeFromRS(ResultSet rs){ //Help method to get a bike from a ResultSet query\n try{\n int bID = rs.getInt(cBikeID);\n LocalDate date = rs.getDate(cDate).toLocalDate();\n Double price = rs.getDouble(cPrice);\n String make = rs.getString(cMake);\n int typeId = rs.getInt(cTypeId);\n String typeName = rs.getString(cTypeName);\n double rentalPrice = rs.getDouble(cRentalPrice);\n int stationId = rs.getInt(cStationId);\n LocalDateTime dateTime = rs.getTimestamp(cDateTime).toLocalDateTime();\n double lat = rs.getDouble(cLatitude);\n double lng = rs.getDouble(cLongitude);\n double chargingLvl = rs.getDouble(cChargingLevel);\n\n BikeData bd = new BikeData(bID, dateTime, lat, lng, chargingLvl);\n BikeType t = new BikeType(typeName,rentalPrice);\n t.setTypeId(typeId);\n Bike bike = new Bike(date, price, make, t, stationId);\n bike.setBikeId(bID);\n bike.setBikeData(bd);\n return bike;\n }catch(Exception e){\n System.out.println(\"Exception \" + e);\n }\n return null;\n }", "BPlayer getPlayer(Player player);", "public Bidding getBiddingById(long id) {\r\n\t\treturn biddingPersistence.getBiddingById(id);\r\n\t}", "public Budget getBudget() {\n\t\treturn budget;\n\t}", "Clothes getById(int id);", "@Query(value = \"from BankAccount where dtype = 'BankAccount' and user_id = :id\")\n Optional<BankAccount> findBankAccountByUserAndType(Long id);", "@ApiMethod(name=\"beers.get\")\n public Beer getBeer(@Named(\"id\") Long id) {\n PersistenceManager mgr = getPersistenceManager();\n Beer beer = null;\n try {\n beer = mgr.getObjectById(Beer.class, id);\n } finally {\n mgr.close();\n }\n return beer;\n }", "public LoanEntity getLoan(String personName, String bankName) {\n return loanEntityMap.get(personName + \"_\" + bankName);\n }", "public String getBankName()\n\t{\n\t\tif(response.containsKey(\"BANK_NAME\")) {\n\t\t\treturn response.get(\"BANK_NAME\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public WebElement selectingBank(String bank) {\n\t\treturn findElement(modifyPageElement(repositoryParser, PAGE_NAME,\n\t\t\t\t\"selectingBank\", bank));\n\t}", "public Book load(String bid) {\n\t\treturn bookDao.load(bid);\r\n\t}", "@Override\r\n\tpublic Bankcard findById(Integer bankcardid) {\n\t\treturn bankcardMapper.selectByPrimaryKey(bankcardid);\r\n\t}", "public static Object getThingByName (String name) {\n \n Object thing = Item.getByNameOrId(name);\n \n if (thing != null)\n return thing;\n \n thing = Block.getBlockFromName(name);\n \n if (thing != null)\n return thing;\n \n return null;\n }", "@Override\n\tpublic CreditAppBankReference fetchByPrimaryKey(long bankReferenceId)\n\t\tthrows SystemException {\n\t\treturn fetchByPrimaryKey((Serializable)bankReferenceId);\n\t}", "BankTellers getBankTeller(String userName);", "List<BankWallet> findByUser(User user);", "public BankAccount getMoneyMarketAccount() {\n return this.moneyMarket;\n }", "@Test\n\tpublic void getBookingTest() {\n\n\t\tBooking outputBooking = bookingDao.getBooking(booking.getBookingId());\n\n\t\tAssert.assertEquals(2, outputBooking.getFlightId());\n\n\t}", "AccountDetail getAccount(String number) throws Exception;", "@Override\n\tpublic BusinessconfigStuff getObjectById(long id) {\n\t\treturn businessconfigStuffDao.getObjectById(id);\n\t}", "public\n Account\n getAccount()\n {\n return itsAccount;\n }", "Optional<BalanceDTO> findOne(Long id);", "@SuppressWarnings(\"unchecked\")\n public <K extends Serializable, E extends EntityWithId<K>, D extends DtoFromEntity<E>> BaseBo<K, E, D> findBo(\n ObjectEntity object) {\n String repositoryName = ProxyUtil.resolveProxy(findRepository(object)).getName();\n String[] repositoryNameParts = repositoryName.split(\"\\\\.\");\n repositoryNameParts[3] = \"business\";\n repositoryNameParts[4] = repositoryNameParts[4].replaceFirst(\"Repository\", \"Bo\");\n String boName = String.join(\".\", repositoryNameParts);\n try {\n Class<? extends BaseBo<K, E, D>> clazz = (Class<? extends BaseBo<K, E, D>>) Class.forName(boName);\n return beanFactory.getBean(clazz);\n } catch (ClassNotFoundException e) {\n throw new ProgrammingException(\n \"While the repository \" + repositoryName + \" exists, there is no a Bo with name \" + boName\n + \" which means you are not following the package or class name convention\");\n }\n }", "@Override\n\tpublic CreditAppBankReference fetchByPrimaryKey(Serializable primaryKey)\n\t\tthrows SystemException {\n\t\tCreditAppBankReference creditAppBankReference = (CreditAppBankReference)EntityCacheUtil.getResult(CreditAppBankReferenceModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\tCreditAppBankReferenceImpl.class, primaryKey);\n\n\t\tif (creditAppBankReference == _nullCreditAppBankReference) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (creditAppBankReference == null) {\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\tcreditAppBankReference = (CreditAppBankReference)session.get(CreditAppBankReferenceImpl.class,\n\t\t\t\t\t\tprimaryKey);\n\n\t\t\t\tif (creditAppBankReference != null) {\n\t\t\t\t\tcacheResult(creditAppBankReference);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tEntityCacheUtil.putResult(CreditAppBankReferenceModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tCreditAppBankReferenceImpl.class, primaryKey,\n\t\t\t\t\t\t_nullCreditAppBankReference);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tEntityCacheUtil.removeResult(CreditAppBankReferenceModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\tCreditAppBankReferenceImpl.class, primaryKey);\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn creditAppBankReference;\n\t}" ]
[ "0.66192895", "0.6453765", "0.6350455", "0.6288944", "0.622146", "0.62195086", "0.61301184", "0.6044638", "0.5981973", "0.5853764", "0.5853764", "0.5851994", "0.58435225", "0.58002305", "0.57914877", "0.5791348", "0.57818335", "0.5756963", "0.56227714", "0.5619003", "0.56180394", "0.5558485", "0.55251735", "0.5513874", "0.55075103", "0.5504795", "0.54905117", "0.5485463", "0.547728", "0.5475092", "0.54713005", "0.54668117", "0.5454091", "0.5438943", "0.5438579", "0.5432909", "0.54098296", "0.5400136", "0.53937876", "0.53856146", "0.537373", "0.5365995", "0.5365564", "0.53639", "0.53432846", "0.530833", "0.52974087", "0.5282095", "0.52771413", "0.52758944", "0.5266269", "0.52603173", "0.5247786", "0.52471954", "0.5245202", "0.52395296", "0.52321786", "0.52277553", "0.52276444", "0.52274877", "0.5218696", "0.52053165", "0.5201553", "0.5199429", "0.51962715", "0.5195086", "0.5191633", "0.5187939", "0.51847917", "0.51811373", "0.517981", "0.51784503", "0.51746744", "0.51743156", "0.517116", "0.5170207", "0.51652473", "0.5163519", "0.51573825", "0.515042", "0.5140008", "0.51330733", "0.5130452", "0.5121124", "0.51200736", "0.51189166", "0.5117021", "0.51111", "0.5103928", "0.5103275", "0.5102123", "0.5097349", "0.50904113", "0.50755125", "0.50752145", "0.50750124", "0.50654405", "0.5063804", "0.50596863", "0.5056205" ]
0.8226009
0
Will delete a BankThing.
public void delete(String id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void deleteHouseholdUsingDeleteTest() throws ApiException {\n UUID householdId = null;\n api.deleteHouseholdUsingDelete(householdId);\n\n // TODO: test validations\n }", "@Override\r\n\tpublic void deleteBankAccount(String name) {\n\t\t\r\n\t}", "void deleteBet(Account account, int id, BigDecimal amount) throws DAOException;", "public void delete(Object bo) {\r\n getPersistenceBrokerTemplate().delete(bo);\r\n }", "@Override\n\tpublic void delete(BatimentoCardiaco t) {\n\t\t\n\t}", "void delete(SecretIdentifier secretIdentifier);", "public void delete(HrJBorrowcontract entity);", "@Transactional\r\n\tpublic void delete(int billingid) {\n\t\t\r\n\t}", "int delWayBillById(Long id_wayBill) throws WayBillNotFoundException;", "@Override\n\tpublic void deleteBikeAd(int theId) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\t\t//delete the object with the primary key\n\t Query theQuery = currentSession.createQuery(\"delete from BikeAdvert where id=:BikeAdvertId\");\n\t\ttheQuery.setParameter(\"BikeAdvertId\",theId);\n\t\ttheQuery.executeUpdate();\n\t}", "@Override\n\tpublic int deleteTicket(Booking_ticket bt) {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void delete(Plate entity) {\n\t\t\r\n\t}", "public void deleteCompany(Company obj);", "@Test\r\n public void testDelete() throws Exception {\r\n bank.removePerson(p2);\r\n assertEquals(bank.viewAllPersons().size(), 1);\r\n assertEquals(bank.viewAllAccounts().size(), 1);\r\n }", "@Override\n\tpublic Object delete(Map<String, Object> params) throws Exception {\n\t\treturn bankService.delete(params);\n\t}", "public void deleteDrinkBills(Bill deleteDrink) {\n\tString sql =\"DELETE FROM bills WHERE Id_drink = ?\";\n\t\n\ttry {\n\t\tPreparedStatement preparedStatement = ConnectionToTheBase.getConnectionToTheBase().getConnection().prepareStatement(sql);\n\t\tpreparedStatement.setInt(1, deleteDrink.getId());\n\t\tpreparedStatement.execute();\n\t} catch (SQLException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\n}", "void deleteRecipe(RecipeObject recipe);", "public void delete(Contract entity) {\n\r\n\t}", "void delete(Object entity);", "@Override\r\n\tpublic void delete(PartyType entity) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void delete(Person person) {\n\r\n\t}", "public void deleteBidding(Bidding bidding) throws IOException {\r\n\t\tbiddingPersistence.deleteBidding(bidding);\r\n\t}", "@Override\n\t@Transactional\n\tpublic void deleteBill(Long id) {\n\t\tbillDAO.deleteById(id);\n\t}", "@Delete\n void delete(WellbeingQuestion wellbeingQuestion);", "@Override\n\tpublic void delete(Brand brand) {\n \tsql=\"delete from brands where id=?\";\n \ttry {\n\t\t\tquery=connection.prepareStatement(sql);\n\t\t\tquery.setInt(1, brand.getId());\n\t\t\tquery.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tnew Exception(e);\n\t\t}\n\t}", "public void delete(Address entity);", "@Override\r\n\tpublic void delete(TAdAddress account) {\n\r\n\t}", "int deleteByExample(BankUserInfoExample example);", "public void deleteBoat(Boat boat) {\n boats.remove(boat);\n }", "public void doDelete(T objectToDelete) throws SQLException;", "@Override\n public void delete(SideDishEntity entity) {\n\n }", "void delete(Entity entity);", "public void delete(SgfensBancoPk pk) throws SgfensBancoDaoException;", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "int deleteByExample(CusBankAccountExample example);", "public void delete() {\n\n }", "public void delete()\n {\n call(\"Delete\");\n }", "@Override\r\n\tpublic void delete(ObjectWithId objectToDelete) {\n\r\n\t}", "<T> void delete(T persistentObject);", "boolean delete(Account account);", "public void delete() {\n\n\t}", "public void deleteFoodBill(Bill deleteFood) {\nString sql =\"DELETE FROM bills WHERE Id_food = ?\";\n\t\n\ttry {\n\t\tPreparedStatement preparedStatement = ConnectionToTheBase.getConnectionToTheBase().getConnection().prepareStatement(sql);\n\t\tpreparedStatement.setInt(1, deleteFood.getId());\n\t\tpreparedStatement.execute();\n\t} catch (SQLException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\n}", "@Override\n\tpublic void delete(Facture y) {\n\t\t\n\t}", "void delete(int entityId);", "@Override\n\tpublic void delete(int ShopLoyaltyCardId) {\n\t\t\n\t}", "public void delete(T ob) throws ToDoListException;", "@Override\n\tpublic void delete(Recipe entity) {\n\t\t\n\t}", "@Override\n\tpublic void delete(Object entidade) {\n\t\t\n\t}", "public abstract void delete();", "public abstract void delete();", "public void delete(){\r\n\r\n }", "int deleteByExample(DashboardGoodsExample example);", "void deleteRecipe(Recipe recipe) throws ServiceFailureException;", "@DELETE\n @Path(\"/{id}\")\n public Response deleteBike(@PathParam(\"id\") int id) {\n return Response.ok()\n .entity(dao.deleteBike(id))\n .build();\n }", "private void delete() {\n\n\t}", "@Override\r\n\tpublic void delete(Person p) \r\n\t{\n\t\t\r\n\t}", "public Order delete(Order order);", "@Override\r\n\tpublic int delete(Integer bankcardid) {\n\t\treturn bankcardMapper.deleteByPrimaryKey(bankcardid);\r\n\t}", "void delete(T persistentObject);", "public int deleteBike(Bike bike){\n final int DELETED = 0;\n final int NOT_DELETED = 1;\n final int NOT_FOUND = 2;\n final boolean NOT_ACTIVE = false;\n \n if(!findBike(bike.getBikeId())){//BikeId not in database\n return NOT_FOUND; //\n }else{\n try(Connection con = DatabaseConnector.getConnection();\n PreparedStatement ps = con.prepareStatement(DELETE)){\n \n ps.setBoolean(1, NOT_ACTIVE);\n ps.setInt(2, bike.getBikeId());\n ps.executeUpdate();\n return DELETED;\n }catch(Exception e){\n System.out.println(\"Exception: \" + e);\n }\n }\n return NOT_DELETED;\n }", "@Override\r\n public void delete(Vehicle vehicle) {\n }", "void deleteBookingById(BookingKey bookingKey);", "int deleteByExample(TDwBzzxBzflbExample example);", "int deleteByPrimaryKey(String bankUserId);", "public void delete(int id);", "void delete(T entity);", "void delete(T entity);", "void deleteAveria(Long idAveria) throws BusinessException;", "void deleteById(String accountNumber) throws AccountException;", "void delete(T obj) throws PersistException;", "public abstract void deleteContract(String contractNumber);", "void delete(ShoppingBasket shoppingBasket);", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Fund : {}\", id);\n fundRepository.delete(id);\n }", "public void delete() throws SQLException {\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n int safeCheck = BusinessFacade.getInstance().checkIDinDB(this.goodID,\n \"orders\", \"goods_id\");\n if (safeCheck == -1) {\n stmtIn.executeUpdate(\"DELETE FROM ngaccount.goods WHERE goods.goods_id = \" +\n this.goodID + \" LIMIT 1;\");\n }\n }", "public abstract boolean delete(Object obj) ;", "@Override\n\tpublic void deletePerson(Person p) {\n\n\t}", "@Test\n public void deleteBrandTest() throws ApiException {\n Integer brandId = null;\n api.deleteBrand(brandId);\n // TODO: test validations\n }", "@Override\n\tpublic void delete(Unidade obj) {\n\n\t}", "@Override\n\tpublic void delete(Audit entity) {\n\t\t\n\t}", "protected abstract void doDelete();", "void delete(Customer customer);", "@Override\n\tpublic void delete(long orderId) {\n\t\t\n\t}", "@Override\n\tpublic void delete(T entity) {\n\t}", "void delete(int id) throws Exception;", "@Override\n\tpublic void deleteBanque(Banque b) {\n\t\t\n\t}", "public void delete(DatiBancariPk pk) throws DatiBancariDaoException;", "@Override\n\tpublic void delete(T obj) throws Exception {\n\t\t\n\t}", "@Override\r\n\tpublic void delete(String did) {\n\t\tdao.delete(did);\r\n\t}", "@DELETE\n public void delete() {\n }", "@DELETE\n public void delete() {\n }", "void delete( Long id );", "public void deleteById(int theId);", "public void delete() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.delete(this);\r\n\t}", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"no goin\");\n\t\t\n\t}", "public void delete(String so_cd);", "int deleteByPrimaryKey(String bid);" ]
[ "0.67934835", "0.6650266", "0.6625948", "0.6610784", "0.64936113", "0.64879084", "0.6457224", "0.6406962", "0.63761854", "0.634295", "0.63401484", "0.6339789", "0.6333321", "0.6332378", "0.63322914", "0.63301", "0.63194627", "0.63093805", "0.62909174", "0.62764895", "0.6267531", "0.6255811", "0.6252149", "0.6246319", "0.6233644", "0.62210286", "0.6217642", "0.6217039", "0.62152886", "0.6212517", "0.6207343", "0.62057406", "0.6202124", "0.6199183", "0.6199183", "0.6199183", "0.6199183", "0.6199183", "0.6199183", "0.619767", "0.61955565", "0.61869586", "0.6177203", "0.6173891", "0.617318", "0.6171813", "0.6170895", "0.6159875", "0.6159329", "0.6141839", "0.6137817", "0.6135128", "0.61317366", "0.61301595", "0.61301595", "0.6126986", "0.61257136", "0.6116422", "0.6114514", "0.6110868", "0.6110787", "0.6100985", "0.6100781", "0.60921735", "0.6088144", "0.6073781", "0.60675144", "0.60663027", "0.6063938", "0.60570914", "0.60552067", "0.60552067", "0.6053306", "0.60489833", "0.6038048", "0.60323054", "0.6028118", "0.6027527", "0.6023537", "0.60203165", "0.6020132", "0.6017724", "0.60122085", "0.6009089", "0.5999542", "0.59923273", "0.59881043", "0.59698313", "0.5964389", "0.59611857", "0.5953378", "0.59517133", "0.5951626", "0.5943462", "0.5943462", "0.5942522", "0.59341526", "0.59311324", "0.5928972", "0.5924877", "0.5922862" ]
0.0
-1
Will update a BankThing.
public BankThing save(BankThing thing);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void updateWaybill(WaybillEntity waybill) {\n\t\t\n\t}", "public void updateBid(Bid b) {\r\n this.edit(b);\r\n }", "int updWayBillById(WayBill record) throws WayBillNotFoundException;", "@Override\n\tpublic Besoin updateBesoin(Besoin besoin) {\n\t\treturn dao.updateBesoin(besoin);\n\t}", "@Override\r\n\tpublic void update(Botany botany) {\n\t\tdao.update(botany);\r\n\t}", "public void updateBidding(Bidding bidding) throws IOException {\r\n\t\tbiddingPersistence.updateBidding(bidding);\r\n\t}", "void setBank(shared.data.Bank bank);", "public void updateBiddings(SimpleList<Bidding> biddings) throws IOException {\r\n\t\tbiddingPersistence.updateBiddings(biddings);\r\n\t}", "@Override\n\tpublic void update(StockDataRecord bo) throws SQLException {\n\t\t\n\t}", "public void updateBank(Bank bank) {\n\n em.merge(bank);\n }", "void updateAccount(Account account);", "@Override\n\tpublic Integer update(Map<String, Object> params) throws Exception {\n\t\treturn bankService.update(params);\n\t}", "@Override\r\n\tpublic void update(Bankcard bankcard) {\n\t\tbankcardMapper.updateByPrimaryKey(bankcard);\r\n\t}", "public Bank updateBankInfo(Bank bank) {\n\t\treturn bankDAOImpl.updateBankInfo(bank);\n\t}", "public void Update(StokContract entity) {\n\t\t\n\t}", "public HrJBorrowcontract update(HrJBorrowcontract entity);", "@Override\n\tpublic void update(BusinessconfigStuff businessconfigStuff) {\n\t\tbusinessconfigStuffDao.update(businessconfigStuff);\n\t}", "@Override\n\tpublic int updateTicket(Booking_ticket bt) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void update(BillDTO billDTO) {\n\t\tBill bill = billDao.get(billDTO.getId());\n\t\tif(bill != null) {\n\t\t\tbill.setPriceTotal(billDTO.getPriceTotal());\n\t\t\tbill.setDiscountPersent(billDTO.getDiscountPercent());\n\t\t\tbill.setStatus(billDTO.getStatus());\n\t\t\tbill.setPay(billDTO.getPay());\n\t\t\t\n\t\t\tbillDao.update(bill);\n\t\t}\n\t}", "@Override\n\tpublic Bill updateBill(Bill bill) {\n\t\tOptional<Bill> opt = billDao.findById(bill.getBillId());\n\t\tif(opt.isPresent())\n\t\t{\n\t\t\tBill dbBill = opt.get();\n\t\t\tdbBill.setBillDate(bill.getBillDate());\n\t\t\tdbBill.setTotalItem(bill.getTotalItem());\n\t\t\tdbBill.setTotalCost(bill.getTotalCost());\n\t\t\t\n\t\t\tbillDao.save(dbBill);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new BillNotFoundException(\"Bill with given id not found : \" + bill.getBillId());\n\t\t}\n\t\treturn bill;\n\t}", "public void update(Object obj) throws HibException;", "void updateAccount();", "public void update(Account account) {\n\t\t\n\t}", "@Override\n\tpublic void update(Brand brand) {\n\t\tsql=\"update brands set Name=? where Id=?\";\n \ttry {\n\t\t\tquery=connection.prepareStatement(sql);\n\t\t\tquery.setString(1, brand.getName());\n\t\t\tquery.setInt(2, brand.getId());\n\t\t\tquery.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tnew Exception(e);\n\t\t}\n\t}", "public void testUpdateAccount(){\n\t\tint id = 10 ;\n\t\tAccount acc = this.bean.findAccountById(id ) ;\n\t\tacc.setDatetime(CommUtil.getNowDate()) ;\n\t\tint r = this.bean.updateAccount(acc) ;\n\t\tAssert.assertEquals(r, 1) ;\n\t}", "public void updateByObject()\r\n\t{\n\t}", "@Override\r\n\tpublic void update(BbsDto dto) {\n\t\t\r\n\t}", "public void update(TdiaryArticle obj) throws SQLException {\n\r\n\t}", "@Override\r\n\tpublic void update(PartyType entity) {\n\t\t\r\n\t}", "@Override\n\tpublic void updatePengdingWaybill(WaybillPendingEntity entity) {\n\t\t\n\t}", "void updateBalance(int amount){ \n\t\tbalance = amount;\n\t}", "public void updateBalance(UUID accountId, double amount) {\n Account account = repository.getAccount(accountId);\n account.updateBalance(amount);\n repository.save(account);\n }", "public void doUpdate(T objectToUpdate) throws SQLException;", "int updateByPrimaryKey(BankUserInfo record);", "int updateByPrimaryKey(BankUserInfo record);", "@Override\n\tpublic void updatePerson(Person person) {\n\t\tsessionFactory.getCurrentSession().update(person);\n\t}", "public Account update(Account user);", "@Test\n public void updateHouseholdUsingPutTest() throws ApiException {\n Object household = null;\n UUID householdId = null;\n Household response = api.updateHouseholdUsingPut(household, householdId);\n\n // TODO: test validations\n }", "int updateByExample(CusBankAccount record, CusBankAccountExample example);", "public void updateOwner(String number, String owner) throws SQLException {\r\n\t\tConnection connection = dbAdministration.getConnection();\r\n\t\tStatement statement = connection.createStatement();\r\n\t\tString sql = \"UPDATE account SET owner = '\" + owner + \"' WHERE number = '\" + number + \"'\";\r\n\t\t// Der Datensatz wird auf der Datenbank aktualisiert\r\n\t\tstatement.executeUpdate(sql);\r\n\t\tlogger.info(\"SQL-Statement ausgeführt: \" + sql);\r\n\t\tlogger.info(\"Der Besitzer des Kontos \" + number + \" wurde durch \\\"\" + owner + \"\\\" ersetzt.\");\r\n\t\tstatement.close();\r\n\t\tconnection.close();\r\n\t}", "public void editHouse() {\n System.out.println(\"-----Update House-----\");\n System.out.println(\"enter id(-1 cancel): \");\n int updateId = Utility.readInt();\n if (updateId == -1) {\n System.out.println(\"cancel update program\");\n return;\n }\n House h = houseService.searchHouse(updateId);\n if(h == null) {\n System.out.println(\"no house you needed found\");\n return;\n }\n //update owner name\n System.out.print(\"owner = \" + h.getOwner() + \": \");\n String owner = Utility.readString(10, \"\");\n if(!\"\".equals(owner)) {\n h.setOwner(owner);\n }\n\n //update phone\n System.out.print(\"phone = \" + h.getPhone() + \": \");\n String phone = Utility.readString(10, \"\");\n if(!\"\".equals(phone)) {\n h.setPhone(phone);\n }\n\n //update address\n System.out.print(\"address = \" + h.getAddress() + \": \");\n String address = Utility.readString(20, \"\");\n if(!\"\".equals(address)) {\n h.setAddress(address);\n }\n\n //update rent\n System.out.print(\"rent = \" + h.getRent() + \": \");\n int rent = Utility.readInt(-1);\n if(! (-1 == rent)) {\n h.setRent(rent);\n }\n\n //update state\n System.out.print(\"state = \" + h.getState() + \": \");\n String state = Utility.readString(10, \"\");\n if(!\"\".equals(state)) {\n h.setState(state);\n }\n\n System.out.println(\"update successful\");\n }", "public void update(T obj) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tsession.update(obj);\n\t\t\n\t}", "int updateByPrimaryKey(ResPartnerBankEntity record);", "int updateByPrimaryKey(CusBankAccount record);", "void update(Seller obj);", "void update(Seller obj);", "Account.Update update();", "public abstract void updateBalance(Balance balance, LedgerEntry.Subtype subtype, long amount) throws TransactionException;", "int updateByPrimaryKey(SsPaymentBillPerson record);", "public abstract void updateAccount(JSONObject account);", "public boolean editBike(Bike bike){//Edits the desired bike with matching bikeId\n if(!findBike(bike.getBikeId())){\n return false;\n //Bike_ID not registered in database, can't edit what's not there\n }else{\n try(Connection con = DatabaseConnector.getConnection();\n PreparedStatement ps = con.prepareStatement(EDIT)){\n \n ps.setDate(1, bike.getSqlDate());\n ps.setDouble(2, bike.getPrice());\n ps.setString(3, bike.getMake());\n ps.setInt(4,bike.getTypeId());\n if(bike.getStationId() == 0){\n ps.setNull(5, INTEGER);\n }else{\n ps.setInt(5, bike.getStationId());\n }\n ps.setInt(6, bike.getBikeId());\n ps.executeUpdate();\n return true;\n }catch(Exception e){\n System.out.println(\"Exception: \" + e);\n }\n }\n return false;\n }", "public void update(T obj) {\n\t\tSession session = this.sessionFactory.getCurrentSession();\n\t\tsession.update(obj);\n\t}", "@Override\r\n\tpublic void updatebook(BookDto book) {\n\t\tsqlSession.update(ns + \"updatebook\", book);\r\n\t}", "@Then(\"^: proceed to checkout$\")\r\n\tpublic void proceed_to_checkout() throws Throwable {\n\t\tobj.update();\r\n\t}", "@Override\n\tpublic int updateBankInfo(TBankInfo bankInfo) {\n\t\treturn tBankInfoMapper.updateBankInfo(bankInfo);\n\t}", "public void update(T ob) throws ToDoListException;", "public void updateEntity();", "@Override\r\n\tpublic void update(Person p) \r\n\t{\n\t\t\r\n\t}", "public boolean updateSickPerson(SickPerson sickPerson) throws SQLException;", "public Bank update(Bank bank) {\n return em.merge(bank);\n }", "private void updateDatabaseAccountBalance() {\n\t\tString sql = \"UPDATE account SET balance = \" + this.balance + \" \";\n\t\tsql += \"WHERE accountID = '\" + this.accountID + \"';\";\n\n\t\tDbUtilities db = new MySqlUtilities();\n\t\tdb.executeQuery(sql);\n\t}", "public Address update(Address entity);", "Transfer updateChargeBack(Transfer transfer, Transfer chargeback);", "public void update(Person person) {\n\t\tpersonRepository.save(person);\n\t}", "public void update(Book entity)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tbookdao.openCurrentSessionwithTransation();\r\n\t\t\tbookdao.update(entity);\r\n\t\t\tbookdao.closeSessionwithTransaction();\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void update(Branch branch) {\n branch_dao.update(branch);\n }", "<T> void update(T persistentObject);", "void update(Order order);", "void update(ObjectType object)\n throws GuacamoleException;", "@Override\n\tpublic int updateBookshelfinfo(BookshelfinfoEntity bookshelfinfoEntity) {\n\t\treturn this.sqlSessionTemplate.update(\"bookshelfinfo.update\", bookshelfinfoEntity);\n\t}", "public void performUpdate(ONDEXAssociable o) {\r\n\t\tif (o instanceof BerkeleyConcept) {\r\n\t\t\tBerkeleyConcept c = (BerkeleyConcept) o;\r\n\r\n\t\t\t// delete old serialisation of concept\r\n\t\t\tberkeley.deleteFromDatabase(BerkeleyConcept.class, c.getId());\r\n\r\n\t\t\t// insert new serialisation of concept\r\n\t\t\tberkeley.insertIntoDatabase(BerkeleyConcept.class, c.getId(),\r\n\t\t\t\t\tc.serialise());\r\n\t\t} else if (o instanceof BerkeleyRelation) {\r\n\t\t\tBerkeleyRelation r = (BerkeleyRelation) o;\r\n\r\n\t\t\t// delete old serialisation of relation\r\n\t\t\tberkeley.deleteFromDatabase(BerkeleyRelation.class, r.getKey());\r\n\t\t\tberkeley.deleteFromDatabase(Integer.class, r.getId());\r\n\r\n\t\t\t// insert new serialisation of relation\r\n\t\t\tbyte[] array = r.serialise();\r\n\t\t\tberkeley.insertIntoDatabase(BerkeleyRelation.class, r.getKey(),\r\n\t\t\t\t\tarray);\r\n\t\t\tberkeley.insertIntoDatabase(Integer.class, r.getId(), array);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void updateStockAccountInfo(StockAccount account) {\n\t\t\n\t}", "@Override\n public void updateOne(int id, Booking itemToUpdate) {\n String sql = \"UPDATE bookings SET customer_phone_number = ? WHERE id = ?\";\n jdbc.update(sql, itemToUpdate.getCustomerPhoneNumber(), id);\n }", "public void updateBalance(int account_id, int final_amount){\n dbUpdate(\"update ACCOUNTS set BALANCE = \"+ final_amount + \" where ACCOUNT_ID = \" + account_id);\n cache.add(new Account(account_id, final_amount));\n }", "@Test\n public void updateBaasBusinessUsingPutTest() throws ApiException {\n UUID nucleusBusinessId = null;\n UpdateBaasBusinessCO baasBusinessCO = null;\n BaasBusinessVO response = api.updateBaasBusinessUsingPut(nucleusBusinessId, baasBusinessCO);\n\n // TODO: test validations\n }", "void update(T obj) throws PersistException;", "@Override\r\n\tpublic void update(Person person) {\n\r\n\t}", "public void updateBal(int value) {\r\n bal = bal + value;\r\n }", "@Override\n\tpublic void update(Unidade obj) {\n\n\t}", "int updateByPrimaryKey(BusinessRepayment record);", "Update withBranch(String branch);", "public static void updateKitchen(KitchenModel kitchen) {\n //Creating session\n Session session = SetupPersistence.getSession();\n //Updating object in database\n session.update(kitchen);\n //Closing session\n SetupPersistence.closeSession(session);\n }", "public int balup(double newbalance, Long accountno, Long broaccno, Double bramt) throws Exception{\n\tint j=DbConnect.getStatement().executeUpdate(\"update account set balance=\"+newbalance+\" where accno=\"+accountno+\"\");\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update account set balance=balance+\"+bramt+\" where accno=\"+broaccno+\"\");\r\n\treturn i;\r\n}", "@Override\n\tpublic void update(HongXunWorkItem hongXunWorkItem) {\n\t\tgetHibernateTemplate().update(hongXunWorkItem);\n\t}", "@Override\n @Transactional\n public void update(Surname changedSurname) {\n \n }", "public void updateCoupon(Coupon coupon) throws DbException;", "public void update(SgfensBancoPk pk, SgfensBanco dto) throws SgfensBancoDaoException;", "int updateBalance(CardVO cv) throws RemoteException;", "public void update() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.update(this);\n\t\tsession.getTransaction().commit();\n\t}", "public void update(AuctionVO auctionVO) {\n\t\tSession session = null;\n\t\t\n\t\t try{\n\t\t \n\t\t\t session = MyUtility.getSession();// Static Method which makes only one object as method is static\n\t\t\n\t\t\t Transaction tr = session.beginTransaction();\n\t\t \n\t\t\t session.update(auctionVO);\n\t\t \n\t\t\t tr.commit();\n\t\t \n\t\t }catch(Exception e)\n\t\t { \t\t\t\t\n\t\t\tSystem.out.println(e.getMessage());\n\t\t }\n\t\t finally\n\t\t {\n\t\t session.close();\n\t\t }\n\t\n\t}", "@Override\n\tpublic void updateAccountBalance(double newBalance, int id) throws SQLException {\n\t\tConnection connect = db.getConnection();\n\t\tString updateQuery = \"update accounts set balance=? where id=?\";\n\t\tPreparedStatement prepStmt = connect.prepareStatement(updateQuery);\n\t\t\tprepStmt.setDouble(1, newBalance);\n\t\t\tprepStmt.setInt(2, id);\n\t\t\tprepStmt.executeUpdate();\n\t}", "void update(T objectToUpdate);", "@Override\n\tpublic void update(Factura t) {\n\t\tfacturaRepository.save(t);\n\t\t\n\t}", "public void setBank(Bank bank) {\r\n this.bank = bank;\r\n }", "@Override\npublic void update(Account account) {\n\taccountdao.update(account);\n}", "public void update(T object) throws SQLException;", "private void updateMoney() {\n balance = mysql.getMoney(customerNumber);\n balanceConverted = (float) balance / 100.00;\n }", "@Override\r\n\tpublic Borne update(Borne obj) {\n\t\tStatement st =null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tst = this.connect.createStatement();\r\n\t\t\tString sql = \"UPDATE Borne SET idZone = '\"+obj.getZone().getId()+\"' WHERE id =\"+obj.getId();\r\n\t\t\tSystem.out.println(sql);\r\n\t\t\tst.executeUpdate(sql);\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn obj;\r\n\t}", "@Override\r\n\tpublic void update(Account account) throws ServiceException {\n\r\n\t}", "private void updateObject(Object object) {\n Connection connection = ConnectionPoll.getConnection();\n CRUDService crudService = new CRUDService(connection, object.getClass());\n\n try {\n crudService.update((SimpleORMInterface) object);\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n ConnectionPoll.releaseConnection(connection);\n\n try {\n connection.close();\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n }" ]
[ "0.6999", "0.6740015", "0.6420185", "0.6401678", "0.63638836", "0.62979656", "0.62560844", "0.62012434", "0.6169537", "0.6167391", "0.616102", "0.61435956", "0.60919523", "0.6086381", "0.60740393", "0.60607874", "0.60175747", "0.6012173", "0.5997083", "0.59722424", "0.5967765", "0.59555596", "0.59458214", "0.5933874", "0.59257007", "0.5914406", "0.5900031", "0.5895384", "0.5883874", "0.588241", "0.58744323", "0.5873823", "0.5825552", "0.58246964", "0.58246964", "0.58225715", "0.5818045", "0.5816515", "0.5804822", "0.57989085", "0.57978785", "0.57920265", "0.5783172", "0.57637036", "0.5755964", "0.5755964", "0.57495075", "0.57467175", "0.57459307", "0.57352173", "0.57281035", "0.5714238", "0.5713179", "0.57065445", "0.56952196", "0.5673275", "0.56718254", "0.5658685", "0.56571466", "0.56559426", "0.56478107", "0.5646077", "0.5645272", "0.5643296", "0.5636571", "0.56358117", "0.5630792", "0.56244034", "0.5621705", "0.56147283", "0.56138504", "0.56093156", "0.5590264", "0.558067", "0.557595", "0.55747217", "0.5569134", "0.5566489", "0.5563034", "0.5558849", "0.5554126", "0.55531985", "0.5553131", "0.5552551", "0.55518866", "0.5551428", "0.5546809", "0.55409724", "0.5531295", "0.5527594", "0.55256337", "0.5525037", "0.5521942", "0.5517166", "0.5514787", "0.5504685", "0.54981506", "0.5486315", "0.5481972", "0.5470598" ]
0.63287216
5
Constructor for the CourseCalendar class
public CourseCalendar(List<Course> courses, String pattern, boolean recurring, boolean rounded) { this.mClasses = courses; this.mPattern = pattern; this.mRecurring = recurring; this.mRounded = rounded; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CourseCalendar(List<Course> courses) {\n this(courses, \"C-TY\", true, false);\n }", "public Calendar() {\n }", "public Calendar() {\n initComponents();\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public Course(String courseName, String cid, LocalDate start, LocalDate end) {\r\n \tthis.courseName = courseName;\r\n \tthis.cid = cid;\r\n \tthis.start = start;\r\n \tthis.end = end;\r\n \tthis.modules = new ArrayList<Module>();\r\n }", "public Course() {\n super();\n }", "private QaCalendar() {\n }", "public Schedule() {\n\t\tcourses = new ArrayList<Course>();\n\t}", "public Course() {\n\n\t}", "public Course() {}", "public Course(String title,String stream, String type, LocalDate start_date,LocalDate end_date){\n this.title = title;\n this.stream = stream;\n this.type = type;\n this.start_date = start_date;\n this.end_date = end_date;\n }", "public Course() {\n }", "public Course() {\n }", "RollingCalendar()\r\n\t{\r\n\t\tsuper();\r\n\t}", "public Course() {\n this(\"course\", null);\n }", "public JCalendar() {\r\n init();\r\n resetToDefaults();\r\n }", "public MCalendarEventView()\r\n {\r\n }", "Course() {\r\n\t\tsetValidDays(true);\r\n\t\tsetName(null);\r\n\t\tsetNumberOfDays(0);\r\n\t\tsetPrice(0.0);\r\n\t}", "public StudentCourse() {\n this(\"student_course\", null);\n }", "public CinemaDate() {\n }", "public Calendar (String name) {\n this.calendarName = name;\n this.events = new ArrayList<>();\n this.alerts = new ArrayList<>();\n }", "public SelectCourse() {\n super();\n }", "public EventsCalendarYear() {\n initYear();\n }", "private CalendarModel() {\n events = new ArrayList<>();\n }", "public Course() {\n term = \"\";\n subject = \"\";\n number = 0;\n newRoom = 0;\n oldRoomLetter = \"\";\n section = new String();\n crossList = new String();\n title = new String();\n faculty = new String();\n building = new String();\n room = \"\";\n startDate = \"\";\n dayTime = new String();\n\n }", "public CtrlCalendario(Calendario C) {\r\n\t\tcalendar = C;\r\n\t}", "public MyCalender() {\n initComponents();\n }", "public Course(int courseID) {\n this.courseID = courseID;\n morningRoster = new Vector<Student>();\n waitlist = new LinkedList<Student>();\n eveningRoster = new Vector<Student>();\n }", "public Appointment()\r\n {\r\n // cView = new CalendarEventView(\"appointmentView\");\r\n }", "public Course()\n\t{\n\t\tstudents = new Student[30];\n\t\tnumStudents = 0;\n\t}", "public Course(String subject, int courseCode, int section, int crn,\n\t\t\tint creditHours, int capacity, int waitListCapacity,\n\t\t\tint waitListCount, String building, int room, String courseDays,\n\t\t\tString courseTime, String fullTermEndDate, String partTermEndDate,\n\t\t\tString instructor) {\n\t\tthis.subject = subject;\n\t\tthis.courseCode = courseCode;\n\t\tthis.section = section;\n\t\tthis.crn = crn;\n\t\tthis.creditHours = creditHours;\n\t\tthis.capacity = capacity;\n\t\tthis.waitListCapacity = waitListCapacity;\n\t\tthis.waitListCount = waitListCount;\n\t\tthis.building = building;\n\t\tthis.room = room;\n\t\tthis.courseDays = courseDays;\n\t\tthis.courseTime = courseTime;\n\t\tthis.fullTermEndDate = fullTermEndDate;\n\t\tthis.partTermEndDate = partTermEndDate;\n\t\tthis.instructor = instructor;\n\t}", "public Coursetime() {\n\t}", "public Entry(Calendar date){\n this.date = date; \n }", "public Course (double creditHours) {\r\n\t\tname = \"A New Course\";\r\n\t\tnumGrade = 0;\r\n\t\tcredithours = creditHours;\r\n\t\tletterGrade = \"\";\r\n\t}", "public MyCalendarModel() {\n\t\tcalendarToEvent = new TreeMap<Calendar, TreeSet<Event>>();\n\t}", "public Course(String courseName) {\n this.courseName = courseName;\n }", "public OrgDay() {\n events = new LinkedList<>();\n }", "public CSCourses() {\n courseList = new LinkedList<Course>(); \n numOfCourses = 0;\n }", "public Schedule() {\r\n }", "public CashBookDaily() {\n initComponents();\n }", "public Course(String n, String i, int m, String in, int s, String l) {\n\t\tname = n;\n\t\tid = i;\n\t\tmaxstudents = m;\n\t\tinstructor = in;\n\t\tsection = s;\n\t\tlocation = l;\n\t}", "public Course(String mandatoryElective, String name, String code, String instructor, String credits, String acronym, String monday, String tuesday, String wednesday, String thurdsday, String friday, String tut, String lab, String preConditions, String postConditions) {\r\n this.name = name;\r\n this.acronym = acronym;\r\n this.instructor = instructor;\r\n this.mandatoryElective = mandatoryElective;\r\n this.credits = credits;\r\n this.code = code;\r\n this.monday = monday;\r\n this.tuesday = tuesday;\r\n this.wednesday = wednesday;\r\n this.thurdsday = thurdsday;\r\n this.friday = friday;\r\n this.tut = tut;\r\n this.lab = lab;\r\n this.preConditions = preConditions;\r\n this.postConditions = postConditions;\r\n }", "private UserCourseCourse() {\n\t}", "public ScheduleEvent()\n\t{\n\n\t}", "public Calendar() {\n\t\tthis(() -> LocalDateTime.now());\n\t}", "public DateTime(Calendar c) {\n setCharacteristic(null);\n if (c == null) {\n setCharacteristic(null);\n setYear(YEAR_IS_NOT_KNOWN);\n setMonth(MONTH_IS_NOT_KNOWN);\n setDay(DAY_OF_MONTH_IS_NOT_KNOWN);\n setHours(0);\n setMinutes(0);\n setSeconds(0);\n } else {\n setYear(c.get(Calendar.YEAR));\n setMonth(c.get(Calendar.MONTH) + 1);\n setDay(c.get(Calendar.DAY_OF_MONTH));\n setHours(c.get(Calendar.HOUR_OF_DAY));\n setMinutes(c.get(Calendar.MINUTE));\n setSeconds(c.get(Calendar.SECOND));\n }\n }", "Calendar getCalendar();", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "public Course(String courseName) {\n studentList = new ArrayList<Student>(MAXSTUDENT);\n this.courseName = courseName;\n studentCount = 0;\n }", "public CTime() {\n\t\n}", "public YearPanel(CalendarEx calendar) {\n initComponents();\n cal = calendar;\n year = CalendarEx.getCurrentYear();\n \n ListAppointMents();\n }", "public CalendarBasi()\n {\n dia = new DisplayDosDigitos(31);\n mes = new DisplayDosDigitos(13);\n anio = new DisplayDosDigitos(100);\n }", "public EventsCalendarYear(Integer year) {\n initYear(year);\n }", "public ADateDemo() {\n\n\n initComponents();\n\n\n }", "public CrlSeries()\n {\n super();\n }", "public CoursesManagement() {\n initComponents();\n }", "public Course(String alias) {\n this(alias, COURSE);\n }", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "Appointment(){\n this.description =\" \";\n this.beginTime=null;\n this.endTime = null;\n }", "public ScheduleExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "public Schedule() {\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Course(int ID, String name, Time time1, Time time2){\n\t\tthis.ID = ID;\n\t\tthis.name = name;\n\t\tthis.section1 = new Section(time1,name,ID,this,1);\n\t\tthis.section2 = new Section(time2,name,ID,this,2);\n\t}", "public Appointment() {\r\n\t\t\t\r\n\t\t}", "VTClass(String crn, String course, String title, String type, \n\t\t\tString cHrs, String size, String instructor, String days, String beginTime,\n\t\t\tString endTime, String location){\n\t\n\t\tthis.CRN = crn;\n\t\tthis.course = course;\n\t\tthis.title = title;\n\t\tthis.type = type;\n\t\tthis.creditHours = cHrs;\n\t\tthis.capacity = size;\n\t\tthis.instructor = instructor;\n\t\tthis.days = days;\n\t\tthis.additionalDay = \"\";\n\t\tthis.beginTime = beginTime;\n\t\tthis.additionalBeginTime = \"\";\n\t\tthis.endTime = endTime;\n\t\tthis.additionalEndTime = \"\";\n\t\tthis.location = location;\n\t\tthis.additionalLocation = \"\";\n\t}", "public AvailabilityCalendar(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n }", "public Course(String courseName, String courseID, Course[] prerequisites, Textbook[] textbooks) {\r\n COURSE_NAME = courseName;\r\n COURSE_ID = courseID;\r\n PREREQUISITE_COURSES = prerequisites;\r\n TEXTBOOKS = textbooks;\r\n }", "public CalendarPage() {\n\t\t\n\t\tPageFactory.initElements(driver, this);\n\t}", "public Course(String title, String codeNumber)\n {\n this.title = title;\n this.codeNumber = codeNumber;\n\n this.credits = 0;\n this.finalGrade = finalGrade;\n\n module1 = new Module(\"Application Development\", \"AD200\");\n module2 = new Module(\"Programming Concepts\", \"PC452\");\n module3 = new Module(\"Data Analysis\", \"DA101\");\n module4 = new Module(\"Web Design\", \"WD953\");\n }", "public Course (String courseName, double creditHours, double courseGrade) {\r\n\t\tname = courseName;\r\n\t\tcredithours = creditHours;\r\n\t\tnumGrade = courseGrade;\r\n\t\tletterGrade = \"\";\r\n\t}", "public Kendaraan() {\n }", "Course(Subject subject){\n \t\tthis.subject = subject;\n\t\tdaysToRun = subject.getDuration();\n\t\tenrolled = new ArrayList<Student>();\n\t\tcancelled = false;\n\t\tfinished = false;\n \t}", "public Rates() {\n }", "private Course dummyCourse(int crn)\n\t{\n\t\tCourse rVal = new Course(null, null, crn, 0, null, 0, 0, 0, 1);\n\t\treturn rVal;\n\t}", "public CourseImage() {\n }", "VTClass(String crn, String course, String title, String type, \n\t\t\tString cHrs, String size, String instructor, String days, \n\t\t\tString additionalDay, String beginTime, String additionalBeginTime,\n\t\t\tString endTime, String additionalEndTime, String location, String additionalLocation){\n\t\n\t\tthis.CRN = crn;\n\t\tthis.course = course;\n\t\tthis.title = title;\n\t\tthis.type = type;\n\t\tthis.creditHours = cHrs;\n\t\tthis.capacity = size;\n\t\tthis.instructor = instructor;\n\t\tthis.days = days;\n\t\tthis.additionalDay = additionalDay;\n\t\tthis.beginTime = beginTime;\n\t\tthis.additionalBeginTime = additionalBeginTime;\n\t\tthis.endTime = endTime;\n\t\tthis.additionalEndTime = additionalEndTime;\n\t\tthis.location = location;\n\t\tthis.additionalLocation = additionalLocation;\n\t}", "public MyDate(int inYear, int inDay, int inMonth)\n {\n year = inYear;\n day = inDay;\n month = inMonth;\n }", "public ObjectFactoryModuleCalendar() {\n }", "protected StartOfDay() {\n super();\n\n }", "public CalendarUtils(Calendar baseCalendar) {\r\n\t\tthis(baseCalendar.getTime(), baseCalendar.getTimeZone());\r\n\t}", "public Event(String title, String location, String description, String date, String courseRelation, int scheduledTime) {\n\t\t\n\t\tthis.title = title;\n\t\tthis.location = location;\n\t\tthis.description = description;\n\t\tthis.date = date;\n\t\tthis.courseRelation = courseRelation;\n\t\tthis.scheduledTime = scheduledTime;\n\t}", "public Courses(String x1, String x2, String x3, String x4, String x5, String x6) {\n\t\tcourse_name=x1;\n\t\tcourse_id=x2;\n\t\tcourse_max=x3;\n\t\tcourse_current_num=\"0\";\n\t\tlist.clear();\n\t\tcourse_instructor=x4;\n\t\tcourse_section=x5;\n\t\tcourse_location=x6;\n\t\t\n\t}", "public CalMonitor() {\r\n }", "public Course(int id, String title) {\n this.id = id;\n this.title = title;\n }", "public StudentCourse(String alias) {\n this(alias, STUDENT_COURSE);\n }", "private Calendar setAssignmentDeadlineCalendar() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HHmm\");\n Date date = null;\n try {\n date = sdf.parse(assignmentDeadline);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n Calendar assignmentDeadlineCalendar = Calendar.getInstance();\n assignmentDeadlineCalendar.setTime(date);\n return assignmentDeadlineCalendar;\n }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "public Timeslot() {\n }", "public Course(String codeNo, String title)\n {\n // initialise variables\n this.codeNo = codeNo;\n this.title = title;\n \n // Setup the four individual modules\n // I did it this way as I couldn't bear pointing-and-clicking to add modules!\n moduleProgramming = new Module(\"Programming\", \"ABC001\");\n moduleWeb = new Module(\"Web Design\", \"ABC002\");\n moduleDigitalTech = new Module(\"Digital Technology\", \"ABC003\");\n moduleCompArchitecture = new Module(\"Computer Architecture\", \"ABC004\");\n \n complete = false;\n totalCredits = 0;\n totalMark = 0;\n }", "public Calendar() throws RemoteException {\n\t\tthis.sentinel = -1;\n\t\tthis.sentinelC = -1;\n\t\tthis.ownerTracker = 0;\n\t\tthis.chatClients = new ArrayList<RemCalendar>();\n\t\tthis.loggedIn = new ArrayList<>();\n\t}", "private ARXDate() {\r\n this(\"Default\");\r\n }", "public EventTimeline() {\n this(0, 0, 91, 9);\n }", "public Calendario getCalendar(){\r\n\t\treturn calendar;\r\n\t}", "@BeforeEach\r\n void createCourse() {\r\n date = new Date(1220227200L * 1000);\r\n lecture = new Lecture();\r\n lecture.setCourseId(\"CSE1230\");\r\n lecture.setDuration(50);\r\n lecture.setLectureId(9);\r\n lecture.setScheduledDate(date);\r\n }", "public CourseSearch() {\n\n String json = null;\n\n try {\n json = new JsonReader(\"http://api.umd.io/v0/courses/list\")\n .readUrl();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n ArrayList<Course> allCourses = new Gson().fromJson(json, new\n TypeToken<ArrayList<Course>>(){}.getType());\n\n courses = new TreeMap<>();\n\n for (Course c : allCourses) {\n courses.put(c.getCourseId(), c);\n }\n }", "public ClassRoom (String course, String teacher)\r\n {\r\n this.course = course;\r\n this.teacher = teacher;\r\n }", "public Webinar() {\n\t\t\n\t}", "public Computus(int x){\n year = x;\n }", "public Clock()\n {\n hour = 11;\n min = 28;\n sec = 12;\n }", "public LecturaPorEvento() \r\n {\r\n }", "public Course(String courseId, String courseIdSchool, String teacherId, String courseName, String courseType, String courseAcademy, Float courseCredit, String courseArea, String courseTeacher) {\n this.courseId = courseId;\n this.courseIdSchool = courseIdSchool;\n this.teacherId = teacherId;\n this.courseName = courseName;\n this.courseType = courseType;\n this.courseAcademy = courseAcademy;\n this.courseCredit = courseCredit;\n this.courseArea = courseArea;\n this.courseTeacher = courseTeacher;\n }" ]
[ "0.82507426", "0.77475417", "0.746025", "0.73486465", "0.7171342", "0.7142317", "0.7129383", "0.7076167", "0.70034903", "0.6984693", "0.69649667", "0.686833", "0.686833", "0.6823989", "0.6815624", "0.68091416", "0.669629", "0.6686609", "0.6682199", "0.66376626", "0.66090715", "0.6600027", "0.6594553", "0.65707153", "0.65700537", "0.650978", "0.6483785", "0.6432002", "0.639714", "0.6392796", "0.63831687", "0.6360773", "0.6355254", "0.63174367", "0.6303684", "0.627576", "0.6258297", "0.62333715", "0.6226878", "0.6209164", "0.6194449", "0.6193875", "0.6192499", "0.6187359", "0.6170579", "0.6154582", "0.60514736", "0.6042364", "0.6029188", "0.602804", "0.6011638", "0.597567", "0.59661853", "0.5963528", "0.59531176", "0.5949634", "0.5921491", "0.5909618", "0.5892214", "0.5890119", "0.5886246", "0.58771324", "0.58648604", "0.5855232", "0.5848326", "0.5843462", "0.5820169", "0.5811047", "0.57950515", "0.57926255", "0.57904357", "0.5783063", "0.5780302", "0.5761749", "0.5758532", "0.57500374", "0.57491696", "0.5745638", "0.57447004", "0.57361114", "0.57348675", "0.5729552", "0.5725583", "0.5724868", "0.57193947", "0.5715816", "0.57148147", "0.57091254", "0.56997544", "0.5693467", "0.5684571", "0.56801134", "0.56589496", "0.5657632", "0.5655829", "0.5651925", "0.56444365", "0.5643275", "0.5623402", "0.5620446" ]
0.6899739
11