blob_id
stringlengths
40
40
__id__
int64
225
39,780B
directory_id
stringlengths
40
40
path
stringlengths
6
313
content_id
stringlengths
40
40
detected_licenses
sequence
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
repo_url
stringlengths
25
151
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
70
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
7.28k
689M
star_events_count
int64
0
131k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
23 values
gha_fork
bool
2 classes
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_updated_at
timestamp[ns]
gha_pushed_at
timestamp[ns]
gha_size
int64
0
40.4M
gha_stargazers_count
int32
0
112k
gha_forks_count
int32
0
39.4k
gha_open_issues_count
int32
0
11k
gha_language
stringlengths
1
21
gha_archived
bool
2 classes
gha_disabled
bool
1 class
content
stringlengths
7
4.37M
src_encoding
stringlengths
3
16
language
stringclasses
1 value
length_bytes
int64
7
4.37M
extension
stringclasses
24 values
filename
stringlengths
4
174
language_id
stringclasses
1 value
entities
list
contaminating_dataset
stringclasses
0 values
malware_signatures
sequence
redacted_content
stringlengths
7
4.37M
redacted_length_bytes
int64
7
4.37M
alphanum_fraction
float32
0.25
0.94
alpha_fraction
float32
0.25
0.94
num_lines
int32
1
84k
avg_line_length
float32
0.76
99.9
std_line_length
float32
0
220
max_line_length
int32
5
998
is_vendor
bool
2 classes
is_generated
bool
1 class
max_hex_length
int32
0
319
hex_fraction
float32
0
0.38
max_unicode_length
int32
0
408
unicode_fraction
float32
0
0.36
max_base64_length
int32
0
506
base64_fraction
float32
0
0.5
avg_csv_sep_count
float32
0
4
is_autogen_header
bool
1 class
is_empty_html
bool
1 class
shard
stringclasses
16 values
d59fb928f63a812e244e405c24ed9107a81290b5
23,794,118,858,293
a4f057c976e7157161a7036e0cfc232a355161a9
/04-micro-service/2-spring-cloud/3-service-discovery-zk/src/main/java/com/xxx/micro/zk/ZkServerApplication.java
57c4e7f4390603b512401b2a2c07247c54d0200d
[]
no_license
oldersheep/2018-homework
https://github.com/oldersheep/2018-homework
e740cde3e3b84a17672abd5efe173c69a2f15a7a
9bd9b1373cd69991fafe31286e38ccc7c4341bf4
refs/heads/master
2022-12-23T07:50:39.457000
2019-12-30T13:26:29
2019-12-30T13:26:29
127,836,975
0
0
null
false
2022-12-15T23:42:50
2018-04-03T02:05:21
2019-12-30T13:27:20
2022-12-15T23:42:48
2,993
0
0
27
Java
false
false
package com.xxx.micro.zk; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @Description zookeeper作为服务发现服务端启动类 * @Date 2019/7/24 20:19 * @Version 1.0 */ @SpringBootApplication public class ZkServerApplication { public static void main(String[] args) { SpringApplication.run(ZkServerApplication.class, args); } }
UTF-8
Java
435
java
ZkServerApplication.java
Java
[]
null
[]
package com.xxx.micro.zk; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @Description zookeeper作为服务发现服务端启动类 * @Date 2019/7/24 20:19 * @Version 1.0 */ @SpringBootApplication public class ZkServerApplication { public static void main(String[] args) { SpringApplication.run(ZkServerApplication.class, args); } }
435
0.759124
0.727494
17
23.17647
22.197603
68
false
false
0
0
0
0
0
0
0.294118
false
false
4
df9efe161380e7906f70d88c168aa74a6ce7d26c
23,794,118,858,475
7dcfdc797f2b6f55504c4dcc1cace73685bebb99
/src/main/java/org/example/FieldNameConstantsExample.java
7a21e93aa95a543d20f50f2e66da0a3a05024573
[]
no_license
ztlevi/lombok-demo
https://github.com/ztlevi/lombok-demo
7c8eb819f5644e834ab14d0ac116017f8ba1f3bd
4826067321f2bd9f78f6e5cba61dd8374705ccf6
refs/heads/main
2023-06-26T19:27:10.345000
2021-07-30T02:57:45
2021-07-30T02:57:45
372,693,690
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.example; import lombok.experimental.FieldNameConstants; import lombok.AccessLevel; // Configuration is set in lombok.config // lombok.fieldNameConstants.uppercase = true @FieldNameConstants public class FieldNameConstantsExample { private String iAmAField; private int andSoAmI; @FieldNameConstants.Exclude private int asAmI; }
UTF-8
Java
348
java
FieldNameConstantsExample.java
Java
[]
null
[]
package org.example; import lombok.experimental.FieldNameConstants; import lombok.AccessLevel; // Configuration is set in lombok.config // lombok.fieldNameConstants.uppercase = true @FieldNameConstants public class FieldNameConstantsExample { private String iAmAField; private int andSoAmI; @FieldNameConstants.Exclude private int asAmI; }
348
0.818965
0.818965
13
25.76923
16.889477
48
false
false
0
0
0
0
0
0
0.461538
false
false
4
70750b801f0465443d4cf67b3c416da5afa72f85
16,252,156,308,690
f49b3db7bf3a540867af4bcd411d4f255996a0ec
/cmdao/src/main/java/mobi/cangol/web/dao/user/UserAuthDao.java
29ea53923371ae99fd6e235545a763f6ab987df4
[]
no_license
Cangol/CangolManager
https://github.com/Cangol/CangolManager
752376538a24ff311c431ba099d504f1e083cfc8
856676118b391dfaa0204a4f47dbb16f2323c0f9
refs/heads/master
2015-08-15T00:19:39.887000
2015-02-11T08:05:51
2015-02-11T08:05:51
26,859,709
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package mobi.cangol.web.dao.user; import mobi.cangol.web.dao.GenericHibernateDao; import mobi.cangol.web.domain.user.UserAuth; import org.springframework.stereotype.Repository; @Repository public class UserAuthDao extends GenericHibernateDao<UserAuth>{ }
UTF-8
Java
268
java
UserAuthDao.java
Java
[]
null
[]
package mobi.cangol.web.dao.user; import mobi.cangol.web.dao.GenericHibernateDao; import mobi.cangol.web.domain.user.UserAuth; import org.springframework.stereotype.Repository; @Repository public class UserAuthDao extends GenericHibernateDao<UserAuth>{ }
268
0.802239
0.802239
10
24.799999
23.612709
63
false
false
0
0
0
0
0
0
0.4
false
false
4
961e21d706f2824201eb01e0ff560c00e3fdbf54
2,422,361,614,726
013f5afecfbcb57b50ec044a87e52a0dec724414
/app/src/main/java/com/avorobyev/poorchild/Networking/RequestResultListener.java
676790f69644c0404b91cdb4af13425616895985
[]
no_license
Vandre1/PoorChildClient
https://github.com/Vandre1/PoorChildClient
40f89cab6a29c29ce9b7506a28ab060ab611fd68
b1cc81b669c0a53066f1272bc0267d67b98d1462
refs/heads/master
2020-03-28T12:42:41.718000
2019-08-27T19:35:57
2019-08-27T19:35:57
148,326,693
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.avorobyev.poorchild.Networking; import java.util.ArrayList; public interface RequestResultListener { void RequestSuccess(); void RequestNotFound(); void RequestError(Exception exception); void RequestCompleted(); }
UTF-8
Java
244
java
RequestResultListener.java
Java
[]
null
[]
package com.avorobyev.poorchild.Networking; import java.util.ArrayList; public interface RequestResultListener { void RequestSuccess(); void RequestNotFound(); void RequestError(Exception exception); void RequestCompleted(); }
244
0.770492
0.770492
10
23.5
16.414932
43
false
false
0
0
0
0
0
0
0.6
false
false
4
22082a22d764a8c772339a808b71c1901933004f
15,625,091,069,397
d1a19f737bc09588fca7f650eaa18f36ab37e960
/src/main/java/kea/design/exam/imdb/models/Favorite/FavoriteTrack.java
79646ce2f7e359b1c1a6d4c9cbadf73b1d5c1a14
[]
no_license
carlcrede/imdb
https://github.com/carlcrede/imdb
ad03656a610e241178d758bb9065ebe54af51ebc
d5d0177ac216403bb70cb5fef33fe5b350d0ce5c
refs/heads/master
2023-03-02T12:28:30.835000
2021-01-28T07:34:49
2021-01-28T07:34:49
310,610,258
0
0
null
false
2021-07-05T16:19:37
2020-11-06T13:51:29
2021-01-28T07:38:19
2021-01-28T07:38:17
751
0
0
0
HTML
false
false
package kea.design.exam.imdb.models.Favorite; import kea.design.exam.imdb.models.Track; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.ManyToOne; @Entity(name = "FavoriteTrack") @DiscriminatorValue("Track") public class FavoriteTrack extends Favorite { @ManyToOne private Track track; public Track getTrack() { return track; } public void setTrack(Track track) { this.track = track; } }
UTF-8
Java
489
java
FavoriteTrack.java
Java
[]
null
[]
package kea.design.exam.imdb.models.Favorite; import kea.design.exam.imdb.models.Track; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.ManyToOne; @Entity(name = "FavoriteTrack") @DiscriminatorValue("Track") public class FavoriteTrack extends Favorite { @ManyToOne private Track track; public Track getTrack() { return track; } public void setTrack(Track track) { this.track = track; } }
489
0.723926
0.723926
23
20.26087
16.906952
45
false
false
0
0
0
0
0
0
0.347826
false
false
4
c0673846333c8f3da899aaf6d6848cc9d8ae929b
12,369,505,857,975
fdf7bcc7a580e5bfed206679e6940ecccf5d7511
/src/main/java/app/server/dao/CourseDAO.java
889f2771bfb1bc4a46d5fa348c11db4255bf4262
[]
no_license
Vendredimatin/server
https://github.com/Vendredimatin/server
dd51b7c56a7e5cb803403a9987b39ac401c59a68
0cd479dd179942d9282fc5c68aeea455ec931f37
refs/heads/master
2022-06-26T05:23:19.781000
2019-05-27T10:10:00
2019-05-27T10:10:00
188,631,080
0
0
null
false
2022-06-17T02:08:35
2019-05-26T02:16:45
2019-05-27T10:10:42
2022-06-17T02:08:34
2,535
0
0
1
Java
false
false
package app.server.dao; import app.server.bean.Course; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; public interface CourseDAO extends JpaRepository<Course,String> { List<Course> findAllByAlive(boolean alive); }
UTF-8
Java
259
java
CourseDAO.java
Java
[]
null
[]
package app.server.dao; import app.server.bean.Course; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; public interface CourseDAO extends JpaRepository<Course,String> { List<Course> findAllByAlive(boolean alive); }
259
0.803089
0.803089
10
24.9
24.225813
65
false
false
0
0
0
0
0
0
0.6
false
false
4
90cb758649e74870196aa734f05148023e33f76b
28,140,625,771,497
3029969ac8c6583b4c58509f995e866b2114bc71
/bachelor_ip/bachelor-auth/src/main/java/org/bachelor/auth/service/ILoginService.java
815231a8ac9c22f526dce04965f92509abc82307
[ "Apache-2.0" ]
permissive
alexguo1980/bachelor
https://github.com/alexguo1980/bachelor
746b6644ad31ef254d757336a46a372e4538ff83
7aa4f57fdf70be2e1bfb80c8f73689d619abd22c
refs/heads/master
2020-12-28T17:24:27.976000
2016-03-30T09:52:29
2016-03-30T09:52:29
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * @(#)ILoginService.java Apr 24, 2013 * * Copyright (c) 2013, Team Bachelor. All rights reserved. */ package org.bachelor.auth.service; import org.bachelor.auth.domain.LoginResult; /** * 用户认证服务接口 * * @author Team Bachelor * */ public interface ILoginService { /** * 根据传入的用户名和密码进行用户身份认证 * * @param userId 用户id * @param pwd 用户密码 * @param authed 是否已经通过认证 * @return 登陆结果信息 */ public LoginResult login(String userId, String pwd, boolean authed); /** * 根据传入的用户名和密码进行用户身份认证 * * @param userId 用户id * @param pwd 用户密码 * @return 登陆结果信息 */ public LoginResult login(String userId, String pwd); /** * 根据传入的用户名和密码进行用户身份认证 * * @param userId 用户id * @param pwd 用户密码 * @param callback 登陆回掉接口 * @return 登陆结果信息 */ public LoginResult login(String userId, String pwd, ILoginCallback callback); }
UTF-8
Java
1,075
java
ILoginService.java
Java
[ { "context": "身份认证\n\t * \n\t * @param userId 用户id\n\t * @param pwd 用户密码\n\t * @param authed 是否已经通过认证\n\t * @return 登陆结果信息\n\t *", "end": 352, "score": 0.9181919097900391, "start": 350, "tag": "PASSWORD", "value": "密码" }, { "context": "行用户身份认证\n\t * \n\t * @param userId 用户id\n\t * @param pwd 用户密码\n\t * @return 登陆结果信息\n\t */\n\tpublic LoginResult login", "end": 552, "score": 0.9780129194259644, "start": 548, "tag": "PASSWORD", "value": "用户密码" }, { "context": "行用户身份认证\n\t * \n\t * @param userId 用户id\n\t * @param pwd 用户密码\n\t * @param callback 登陆回掉接口\n\t * @return 登陆结果信息\n\t *", "end": 709, "score": 0.986866295337677, "start": 705, "tag": "PASSWORD", "value": "用户密码" } ]
null
[]
/* * @(#)ILoginService.java Apr 24, 2013 * * Copyright (c) 2013, Team Bachelor. All rights reserved. */ package org.bachelor.auth.service; import org.bachelor.auth.domain.LoginResult; /** * 用户认证服务接口 * * @author Team Bachelor * */ public interface ILoginService { /** * 根据传入的用户名和密码进行用户身份认证 * * @param userId 用户id * @param pwd 用户密码 * @param authed 是否已经通过认证 * @return 登陆结果信息 */ public LoginResult login(String userId, String pwd, boolean authed); /** * 根据传入的用户名和密码进行用户身份认证 * * @param userId 用户id * @param pwd <PASSWORD> * @return 登陆结果信息 */ public LoginResult login(String userId, String pwd); /** * 根据传入的用户名和密码进行用户身份认证 * * @param userId 用户id * @param pwd <PASSWORD> * @param callback 登陆回掉接口 * @return 登陆结果信息 */ public LoginResult login(String userId, String pwd, ILoginCallback callback); }
1,071
0.669823
0.657988
48
16.604166
18.643295
78
false
false
0
0
0
0
0
0
0.875
false
false
4
24e3baa8192d24bd7412ba018134694f548c9000
6,055,903,918,953
345d631b600de9e9a3553ae6b1a8637fd2141251
/app/src/main/java/com/shivam/uber/Activity/MapActivity.java
0f80b54a4efe96e44ca9c241d91b3d3961eae72c
[]
no_license
shivam0831/UberClone
https://github.com/shivam0831/UberClone
df9368b11cb0e26550a2b16e90b351fd17caf550
cf8aa7e1286dfc28a34c5f6ec055903de8cee036
refs/heads/master
2021-10-10T21:09:11.796000
2019-01-17T12:55:56
2019-01-17T12:55:56
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.shivam.uber.Activity; import android.Manifest; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.location.Location; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.AutoCompleteTextView; import android.widget.ImageView; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.FusedLocationProviderClient; import com.google.android.gms.location.LocationServices; import com.google.android.gms.location.places.Places; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.shivam.uber.R; import java.text.DecimalFormat; import uk.co.chrisjenx.calligraphy.CalligraphyConfig; import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper; public class MapActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleApiClient.OnConnectionFailedListener { private static final String TAG = "MapActivity"; private static final String FINE_LOCATION = Manifest.permission.ACCESS_FINE_LOCATION; private static final String COURSE_LOCATION = Manifest.permission.ACCESS_COARSE_LOCATION; private static final int LOCATION_PERMISSION_REQUEST_CODE = 1234; private static final float DEFAULT_ZOOM = 15f; private static final int PLACE_PICKER_REQUEST = 1; private static final LatLngBounds LAT_LNG_BOUNDS = new LatLngBounds( new LatLng(-40, -168), new LatLng(71, 136)); private AutoCompleteTextView mSearchText; private ImageView mGps, mInfo, mPlacePicker, back; //vars private Boolean mLocationPermissionsGranted = false; private GoogleMap mMap; private FusedLocationProviderClient mFusedLocationProviderClient; private GoogleApiClient mGoogleApiClient; @Override protected void attachBaseContext(Context newBase) { super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase)); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() .setDefaultFontPath("fonts/Montserrat-Light.ttf") .setFontAttrId(R.attr.fontPath) .build()); setContentView(R.layout.activity_map); mGps = (ImageView) findViewById(R.id.ic_gps); back = (ImageView) findViewById(R.id.back); getLocationPermission(); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(MapActivity.this, Home.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(i); } }); } @Override public void onMapReady(GoogleMap googleMap) { // Toast.makeText(this, "Map is Ready", Toast.LENGTH_SHORT).show(); Log.d(TAG, "onMapReady: map is ready"); mMap = googleMap; if (mLocationPermissionsGranted) { getDeviceLocation(); if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return; } mMap.setMyLocationEnabled(true); mMap.getUiSettings().setMyLocationButtonEnabled(false); init(); googleMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() { @Override public void onMapClick(LatLng latLng) { // Creating a marker MarkerOptions markerOptions = new MarkerOptions(); // Setting the position for the marker markerOptions.position(latLng); // Setting the title for the marker. // This will be displayed on taping the marker markerOptions.title(latLng.latitude + " : " + latLng.longitude); // Clears the previously touched position mMap.clear(); // Animating to the touched position mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng)); // Placing a marker on the touched position mMap.addMarker(markerOptions); } }); } } private void init() { Log.d(TAG, "init: initializing"); mGoogleApiClient = new GoogleApiClient .Builder(this) .addApi(Places.GEO_DATA_API) .addApi(Places.PLACE_DETECTION_API) .enableAutoManage(this, this) .build(); mGps.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d(TAG, "onClick: clicked gps icon"); getDeviceLocation(); } }); } private void getDeviceLocation() { Log.d(TAG, "getDeviceLocation: getting the devices current location"); mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this); try { if (mLocationPermissionsGranted) { final Task location = mFusedLocationProviderClient.getLastLocation(); location.addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { if (task.isSuccessful()) { Log.d(TAG, "onComplete: found location!"); Location currentLocation = (Location) task.getResult(); moveCamera(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()), DEFAULT_ZOOM, "My Location"); } else { Log.d(TAG, "onComplete: current location is null"); Toast.makeText(MapActivity.this, "unable to get current location", Toast.LENGTH_SHORT).show(); } } }); } } catch (SecurityException e) { Log.e(TAG, "getDeviceLocation: SecurityException: " + e.getMessage()); } } private void moveCamera(LatLng latLng, float zoom, String title) { Log.d(TAG, "moveCamera: moving the camera to: lat: " + latLng.latitude + ", lng: " + latLng.longitude); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom)); if (!title.equals("My Location")) { MarkerOptions options = new MarkerOptions() .position(latLng) .title(title); mMap.addMarker(options); } } private void getLocationPermission() { Log.d(TAG, "getLocationPermission: getting location permissions"); String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}; if (ContextCompat.checkSelfPermission(this.getApplicationContext(), FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { if (ContextCompat.checkSelfPermission(this.getApplicationContext(), COURSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { mLocationPermissionsGranted = true; initMap(); } else { ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE); } } else { ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE); } } private void initMap() { Log.d(TAG, "initMap: initializing map"); SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); mapFragment.getMapAsync(MapActivity.this); } @Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { } public double CalculationByDistance(LatLng StartP, LatLng EndP) { int Radius = 6371;// radius of earth in Km double lat1 = StartP.latitude; double lat2 = EndP.latitude; double lon1 = StartP.longitude; double lon2 = EndP.longitude; double dLat = Math.toRadians(lat2 - lat1); double dLon = Math.toRadians(lon2 - lon1); double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2); double c = 2 * Math.asin(Math.sqrt(a)); double valueResult = Radius * c; double km = valueResult / 1; DecimalFormat newFormat = new DecimalFormat("####"); int kmInDec = Integer.valueOf(newFormat.format(km)); double meter = valueResult % 1000; int meterInDec = Integer.valueOf(newFormat.format(meter)); Log.i("Radius Value", "" + valueResult + " KM " + kmInDec + " Meter " + meterInDec); return Radius * c; } }
UTF-8
Java
10,219
java
MapActivity.java
Java
[]
null
[]
package com.shivam.uber.Activity; import android.Manifest; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.location.Location; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.AutoCompleteTextView; import android.widget.ImageView; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.FusedLocationProviderClient; import com.google.android.gms.location.LocationServices; import com.google.android.gms.location.places.Places; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.shivam.uber.R; import java.text.DecimalFormat; import uk.co.chrisjenx.calligraphy.CalligraphyConfig; import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper; public class MapActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleApiClient.OnConnectionFailedListener { private static final String TAG = "MapActivity"; private static final String FINE_LOCATION = Manifest.permission.ACCESS_FINE_LOCATION; private static final String COURSE_LOCATION = Manifest.permission.ACCESS_COARSE_LOCATION; private static final int LOCATION_PERMISSION_REQUEST_CODE = 1234; private static final float DEFAULT_ZOOM = 15f; private static final int PLACE_PICKER_REQUEST = 1; private static final LatLngBounds LAT_LNG_BOUNDS = new LatLngBounds( new LatLng(-40, -168), new LatLng(71, 136)); private AutoCompleteTextView mSearchText; private ImageView mGps, mInfo, mPlacePicker, back; //vars private Boolean mLocationPermissionsGranted = false; private GoogleMap mMap; private FusedLocationProviderClient mFusedLocationProviderClient; private GoogleApiClient mGoogleApiClient; @Override protected void attachBaseContext(Context newBase) { super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase)); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() .setDefaultFontPath("fonts/Montserrat-Light.ttf") .setFontAttrId(R.attr.fontPath) .build()); setContentView(R.layout.activity_map); mGps = (ImageView) findViewById(R.id.ic_gps); back = (ImageView) findViewById(R.id.back); getLocationPermission(); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(MapActivity.this, Home.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(i); } }); } @Override public void onMapReady(GoogleMap googleMap) { // Toast.makeText(this, "Map is Ready", Toast.LENGTH_SHORT).show(); Log.d(TAG, "onMapReady: map is ready"); mMap = googleMap; if (mLocationPermissionsGranted) { getDeviceLocation(); if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return; } mMap.setMyLocationEnabled(true); mMap.getUiSettings().setMyLocationButtonEnabled(false); init(); googleMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() { @Override public void onMapClick(LatLng latLng) { // Creating a marker MarkerOptions markerOptions = new MarkerOptions(); // Setting the position for the marker markerOptions.position(latLng); // Setting the title for the marker. // This will be displayed on taping the marker markerOptions.title(latLng.latitude + " : " + latLng.longitude); // Clears the previously touched position mMap.clear(); // Animating to the touched position mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng)); // Placing a marker on the touched position mMap.addMarker(markerOptions); } }); } } private void init() { Log.d(TAG, "init: initializing"); mGoogleApiClient = new GoogleApiClient .Builder(this) .addApi(Places.GEO_DATA_API) .addApi(Places.PLACE_DETECTION_API) .enableAutoManage(this, this) .build(); mGps.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.d(TAG, "onClick: clicked gps icon"); getDeviceLocation(); } }); } private void getDeviceLocation() { Log.d(TAG, "getDeviceLocation: getting the devices current location"); mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this); try { if (mLocationPermissionsGranted) { final Task location = mFusedLocationProviderClient.getLastLocation(); location.addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { if (task.isSuccessful()) { Log.d(TAG, "onComplete: found location!"); Location currentLocation = (Location) task.getResult(); moveCamera(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()), DEFAULT_ZOOM, "My Location"); } else { Log.d(TAG, "onComplete: current location is null"); Toast.makeText(MapActivity.this, "unable to get current location", Toast.LENGTH_SHORT).show(); } } }); } } catch (SecurityException e) { Log.e(TAG, "getDeviceLocation: SecurityException: " + e.getMessage()); } } private void moveCamera(LatLng latLng, float zoom, String title) { Log.d(TAG, "moveCamera: moving the camera to: lat: " + latLng.latitude + ", lng: " + latLng.longitude); mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom)); if (!title.equals("My Location")) { MarkerOptions options = new MarkerOptions() .position(latLng) .title(title); mMap.addMarker(options); } } private void getLocationPermission() { Log.d(TAG, "getLocationPermission: getting location permissions"); String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}; if (ContextCompat.checkSelfPermission(this.getApplicationContext(), FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { if (ContextCompat.checkSelfPermission(this.getApplicationContext(), COURSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { mLocationPermissionsGranted = true; initMap(); } else { ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE); } } else { ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE); } } private void initMap() { Log.d(TAG, "initMap: initializing map"); SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); mapFragment.getMapAsync(MapActivity.this); } @Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { } public double CalculationByDistance(LatLng StartP, LatLng EndP) { int Radius = 6371;// radius of earth in Km double lat1 = StartP.latitude; double lat2 = EndP.latitude; double lon1 = StartP.longitude; double lon2 = EndP.longitude; double dLat = Math.toRadians(lat2 - lat1); double dLon = Math.toRadians(lon2 - lon1); double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2); double c = 2 * Math.asin(Math.sqrt(a)); double valueResult = Radius * c; double km = valueResult / 1; DecimalFormat newFormat = new DecimalFormat("####"); int kmInDec = Integer.valueOf(newFormat.format(km)); double meter = valueResult % 1000; int meterInDec = Integer.valueOf(newFormat.format(meter)); Log.i("Radius Value", "" + valueResult + " KM " + kmInDec + " Meter " + meterInDec); return Radius * c; } }
10,219
0.626872
0.622566
263
37.855515
28.818464
126
false
false
0
0
0
0
0
0
0.608365
false
false
4
2796376ccdb6995e72b5f781b2e1ed6cd0059a23
23,321,672,475,408
2ae813f7cce574af239853ac2ac3fc6caf611665
/CodeInFigures/TwelveInts.java
0ce5a9f4f116f9dd0047cd2a028d8fcb2e3d1678
[]
no_license
RandhirKaushik0908/cp2406_farrell8_ch08
https://github.com/RandhirKaushik0908/cp2406_farrell8_ch08
53a43bd4393e014bf188e8046e77392d226b028f
a403d6ea2dff56597f1860a454ef81eba39ccbdc
refs/heads/master
2022-12-07T03:29:30.603000
2020-08-31T12:19:27
2020-08-31T12:19:27
291,694,927
0
0
null
true
2020-08-31T11:20:03
2020-08-31T11:20:03
2015-11-13T03:56:17
2015-11-13T03:56:16
0
0
0
0
null
false
false
public class TwelveInts { public static void main (String[] args) { int[] numbers = {54, 9, 11, 100, 99, 87, 112, 32, 16, 90, 73, 42}; int i; for (i = 0; i < numbers.length; i++) System.out.print(numbers[i] + " "); System.out.println(); for (i = numbers.length - 1; i >= 0; i--) System.out.print("" + numbers[i] + " "); System.out.println(); } }
UTF-8
Java
431
java
TwelveInts.java
Java
[]
null
[]
public class TwelveInts { public static void main (String[] args) { int[] numbers = {54, 9, 11, 100, 99, 87, 112, 32, 16, 90, 73, 42}; int i; for (i = 0; i < numbers.length; i++) System.out.print(numbers[i] + " "); System.out.println(); for (i = numbers.length - 1; i >= 0; i--) System.out.print("" + numbers[i] + " "); System.out.println(); } }
431
0.480278
0.415313
14
29.857143
21.963793
74
false
false
0
0
0
0
0
0
1.5
false
false
4
f3f331935175c42477364868e3c6d69e040e17b8
29,970,281,844,208
d3b84548351fb2cd51a9881b7424b0f3bf8a0fe3
/src/main/java/com/github/gkttk/epam/dao/mappers/UserInfoRowMapper.java
0175a896f9c1b2d91a6b68ae8daf730e0e355219
[]
no_license
gkttk/Cafe
https://github.com/gkttk/Cafe
571da0829a1c3789f83f045813319e5b5fa921c7
cefd3f5ff9da3c526ba47366e74c8ef778acdebf
refs/heads/master
2023-03-03T14:14:02.417000
2021-02-08T09:57:45
2021-02-08T09:57:45
317,451,943
0
0
null
false
2021-02-08T09:57:47
2020-12-01T06:55:41
2021-01-12T14:20:31
2021-02-08T09:57:46
2,604
0
0
0
Java
false
false
package com.github.gkttk.epam.dao.mappers; import com.github.gkttk.epam.model.dto.UserInfo; import com.github.gkttk.epam.model.enums.UserRole; import java.sql.ResultSet; import java.sql.SQLException; public class UserInfoRowMapper implements RowMapper<UserInfo> { private final static String ID_KEY = "id"; private final static String LOGIN_KEY = "login"; private final static String POINTS_KEY = "points"; private final static String ROLE_KEY = "role"; private final static String BLOCKED_KEY = "blocked"; @Override public UserInfo map(ResultSet resultSet) throws SQLException { long id = resultSet.getLong(ID_KEY); String login = resultSet.getString(LOGIN_KEY); String roleName = resultSet.getString(ROLE_KEY); UserRole role = UserRole.valueOf(roleName); int points = resultSet.getInt(POINTS_KEY); boolean isBlocked = resultSet.getBoolean(BLOCKED_KEY); return new UserInfo(id, login, role, points, isBlocked); } }
UTF-8
Java
1,014
java
UserInfoRowMapper.java
Java
[ { "context": "nts\";\n private final static String ROLE_KEY = \"role\";\n private final static String BLOCKED_KEY = \"", "end": 471, "score": 0.7310897707939148, "start": 467, "tag": "KEY", "value": "role" } ]
null
[]
package com.github.gkttk.epam.dao.mappers; import com.github.gkttk.epam.model.dto.UserInfo; import com.github.gkttk.epam.model.enums.UserRole; import java.sql.ResultSet; import java.sql.SQLException; public class UserInfoRowMapper implements RowMapper<UserInfo> { private final static String ID_KEY = "id"; private final static String LOGIN_KEY = "login"; private final static String POINTS_KEY = "points"; private final static String ROLE_KEY = "role"; private final static String BLOCKED_KEY = "blocked"; @Override public UserInfo map(ResultSet resultSet) throws SQLException { long id = resultSet.getLong(ID_KEY); String login = resultSet.getString(LOGIN_KEY); String roleName = resultSet.getString(ROLE_KEY); UserRole role = UserRole.valueOf(roleName); int points = resultSet.getInt(POINTS_KEY); boolean isBlocked = resultSet.getBoolean(BLOCKED_KEY); return new UserInfo(id, login, role, points, isBlocked); } }
1,014
0.712032
0.712032
32
30.6875
25.538498
66
false
false
0
0
0
0
0
0
0.65625
false
false
4
dcc69a6e5ad640235e00b1d7b419bb1a4320dd10
2,886,218,054,143
89ce55b4ac3fe3c1dc3de86ef433352eb8ce5252
/app/src/main/java/es/jcyl/cee/cylford/app/cyldigital/ui/ActividadesFormativasActivity.java
a41f4bccd94a0ad26c9f93316fc6cbddd5659fce
[]
no_license
JoseCDB/CyLDigital
https://github.com/JoseCDB/CyLDigital
6442e083c64ccc63cc33217502989bdd1076438f
7a6ad965a7a85a9648554e33e62c23abc35c7a55
refs/heads/master
2021-01-22T03:58:07.573000
2017-02-09T19:28:38
2017-02-09T19:28:38
81,486,158
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package es.jcyl.cee.cylford.app.cyldigital.ui; import android.app.DatePickerDialog; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.text.Editable; import android.text.TextWatcher; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.DatePicker; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.Spinner; import android.widget.TextView; import es.jcyl.cee.cylford.app.cyldigital.MainActivity; import es.jcyl.cee.cylford.app.cyldigital.utils.Utils; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.Locale; import es.jcyl.cee.cylford.app.cyldigital.Constants; import es.jcyl.cee.cylford.app.cyldigital.R; import es.jcyl.cee.cylford.app.cyldigital.backend.handler.CyLDFormacionHandler; import es.jcyl.cee.cylford.app.cyldigital.backend.handler.CyLDFormacionHandlerListener; import es.jcyl.cee.cylford.app.cyldigital.model.Family; import es.jcyl.cee.cylford.app.cyldigital.parser.dto.CyLDFormacion; import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener; import com.handmark.pulltorefresh.library.PullToRefreshListView; import com.navdrawer.SimpleSideDrawer; /* * La Interfaz OnItemSelectedListener me obliga a implementar métodos: onItemSelected, onNothingSelected * La Interfaz OnClickListener me obliga a implementar métodos: onClick, OnClickListener * La Interfaz CyLDFormacionHandlerListener me obliga a implementar los métodos: onResults * */ public class ActividadesFormativasActivity extends MainActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener, CyLDFormacionHandlerListener<CyLDFormacion>, OnRefreshListener<ListView> { //Retraso para mostrar los resultados en onResults() private static final int LOADING_DELAY = 3000; private BoardAdapter adapter; private ArrayList<CyLDFormacion> data = new ArrayList<CyLDFormacion>(); private ArrayList<CyLDFormacion> datosFuturos = new ArrayList<CyLDFormacion>(); //Da formato a la fecha de las actividades mostradas en BoardAdapter. private SimpleDateFormat sdf = new SimpleDateFormat("'Comienza el' d 'de' MMMM 'de' yyyy", Locale.getDefault()); //Si el origen es una consulta tipo Online o Presencial private String origen; //Combos localidad y tipo de actividad private Spinner localidad, tipo; //Texto de valores seleccionados en los combos private String centroVal, tipoVal, fechaInicioAct, fechaFinAct = ""; //Campo buscar private EditText search; //Campo que muestra el número de resutlados de la búsqueda. private TextView count; //Contiene "fecha + nombre" de la llamada actual al Servicio Web. private String currentCallId = ""; //Fecha en long de la llamada actual al Servicio Web long currentCallTime = 0; //Nueva lista Pull to refresh para mostrar los resultados devueltos. private PullToRefreshListView list;; //Botón de prueba que no se muestra en la versión final. private Button botonPrueba; private ImageView back, btnMenuRight; //Botones volver y menú lateral private SimpleSideDrawer slide_me; //Layout para los spinners de selección de centro y tipo de actividad //Layout para los botones de fecha de inicio y fecha de fin private LinearLayout layoutSpinners, layoutCalendars; //Fechas private Calendar cal; private int day, month, year; //F. Inicio private ImageButton imageButtonFechaInicio; private TextView editTextFechaInicio; //F. Fin private ImageButton imageButtonFechaFin; private TextView editTextFechaFin; private View itemPresentacion, itemFormativas, itemAcerca; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_actformativas); //getSupportActionBar().hide(); // Ya no estoy quitando en el Manifest con el style AppTheme origen = getIntent().getStringExtra("origen"); //1 SPINNER LOCALIDAD localidad = (Spinner) this.findViewById(R.id.localidad); //Para que cuando se selecciona un valor en el Spinner, el contexto recoja el escuchador localidad.setOnItemSelectedListener(this);//Para esto tengo que implementar interfaz OnItemSelectedListener //Se crea el adaptador FamilyAdapter adapterL = new FamilyAdapter(this, android.R.layout.simple_spinner_item, Constants.provincias); //Se añade el layout para el menú adapterL.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //Se indica al spinner el adaptador a usar localidad.setAdapter(adapterL); //2 SPINNER TIPO ACTIVIDAD tipo = (Spinner) this.findViewById(R.id.tipo); tipo.setOnItemSelectedListener(this); FamilyAdapter adapterT = new FamilyAdapter(this, android.R.layout.simple_spinner_item, Constants.tiposActividad); adapterT.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); tipo.setAdapter(adapterT); //3 CAMPO DE TEXTO BUSCAR search = (EditText) this.findViewById(R.id.search); //La acción de cuando se pulsa la lupa del teclado search.setOnEditorActionListener(new TextView.OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEARCH) { // String s = search.getText().toString(); // requestData(false, s, provinceVal, familyVal); list.setRefreshing(); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(search.getWindowToken(), 0); return true; } return false; } }); //4 BOTÓN VOLVER back = (ImageView) this.findViewById(R.id.back); back.setOnClickListener(this); //5 BOTÓN PRUEBA botonPrueba = (Button) this.findViewById(R.id.btnPrueba); //botonPrueba.setTextColor(getResources().getColor(R.color.background)); //botonPrueba.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.board_icon_selected_selector, 0, 0); botonPrueba.setOnClickListener(this); //6 CONTADOR Nº ACTIVIDADES count = (TextView) this.findViewById(R.id.count); count.setVisibility(View.GONE); //7 LISTA ITEMS ACTIVIDADES list = (PullToRefreshListView) findViewById(R.id.list); list.setOnRefreshListener(this); adapter = new BoardAdapter(); list.setAdapter(adapter); list.setOnScrollListener(adapter); list.setOnItemClickListener(adapter); list.setMode(Mode.PULL_FROM_START); list.setScrollingWhileRefreshingEnabled(false); list.setRefreshingLabel(getString(R.string.update)); //8 LAYOUTS layoutSpinners = (LinearLayout) this.findViewById(R.id.layoutSpinners); layoutCalendars = (LinearLayout) this.findViewById(R.id.layoutFechas); //9 BOTONES CALENDARIOS cal = Calendar.getInstance(); day = cal.get(Calendar.DAY_OF_MONTH); month = cal.get(Calendar.MONTH); year = cal.get(Calendar.YEAR); //10 BOTÓN FECHA INICIO imageButtonFechaInicio = (ImageButton) findViewById(R.id.imagenCalendarFI); editTextFechaInicio = (TextView) findViewById(R.id.fechaInicio); imageButtonFechaInicio.setOnClickListener(this); //Escuchador para realizar la búsqueda trás la actualización de la fecha. editTextFechaInicio.addTextChangedListener((new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { fechaInicioAct = editTextFechaInicio.getText().toString().replaceAll("\\s", ""); fechaFinAct = editTextFechaFin.getText().toString().replaceAll("\\s", ""); new Handler().postDelayed(new Runnable() { public void run() { list.setRefreshing(); } }, 250); } })); //11 BOTÓN FECHA FIN imageButtonFechaFin = (ImageButton) findViewById(R.id.imagenCalendarFF); editTextFechaFin = (TextView) findViewById(R.id.fechaFin); imageButtonFechaFin.setOnClickListener(this); //12 slide_me = new SimpleSideDrawer(this); slide_me.setRightBehindContentView(R.layout.menu_right); //13 BOTÓN MENÚ LATERAL btnMenuRight = (ImageView) this.findViewById(R.id.btnrightmenu); btnMenuRight.setOnClickListener(this); //14 MENÚ itemPresentacion = this.findViewById(R.id.presentacion); itemPresentacion.setOnClickListener(this); itemFormativas = this.findViewById(R.id.formativas); itemFormativas.setOnClickListener(this); itemAcerca = this.findViewById(R.id.acerca); itemAcerca.setOnClickListener(this); //A mostrar/ocultar en dependencia del tipo de formación if (origen.equals(Constants.TIPO_ONLINE)) { layoutSpinners.setVisibility(View.GONE); //Se cambia el título TextView tv = (TextView) this.findViewById(R.id.title); tv.setText(""); tv = (TextView) findViewById(R.id.title); tv.setText(R.string.title_onlines); //Búsqueda automática new Handler().postDelayed(new Runnable() { public void run() { list.setRefreshing(); } }, 250); } else if(origen.equals(Constants.TIPO_PRESENCIAL)) { layoutCalendars.setVisibility(View.GONE); //Se cambia el título TextView tv = (TextView) this.findViewById(R.id.title); tv.setText(""); tv = (TextView) findViewById(R.id.title); tv.setText(R.string.title_presenciales); //Mensaje de aviso preencial Utils.showSimpleDialog(ActividadesFormativasActivity.this, null, getString(R.string.presenciales_error), null); } } /** * Método que se lanza al seleccionar un valor en un spinner. * * @param adapter * @param arg1 * @param index * @param arg3 */ @Override public void onItemSelected(AdapterView<?> adapter, View arg1, int index, long arg3) { if (adapter == localidad) { if (index == 0) { centroVal = ""; } else { centroVal = ((Family) localidad.getSelectedItem()).getCode(); if(!tipoVal.isEmpty() && !tipoVal.equals("")){ list.setRefreshing(); } } } else if (adapter == tipo) { if (index == 0) { tipoVal = ""; } else { tipoVal = ((Family) tipo.getSelectedItem()).getCode(); if(!centroVal.isEmpty() && !centroVal.equals("")){ list.setRefreshing(); } } } //Se lanza de forma automática mostrando en la lista //la consulta de actividades online if (origen.equals(Constants.TIPO_ONLINE)) { new Handler().postDelayed(new Runnable() { public void run() { list.setRefreshing(); } }, 250); } } /** * Se lanza cuando se arrastra en la lista. * @param refreshView */ @Override public void onRefresh(PullToRefreshBase<ListView> refreshView) { //search-> valor del campo de texto de búsqueda //provinciaVal -> valor del spinner de provincias //tipoVal -> valor del spinner de tipo de actividad requestData(true, search.getText().toString()); } //@Override protected void onScrollNext() { requestData(false, search.getText().toString()); } /** * @param clear * @param search */ private void requestData(boolean clear, String search) { // To prevent another scrolling event adapter.lock(); //Objeto de tipo BoardAdapter // if (!clear && data != null // && (data.size() == 0 || data.get(data.size() - 1) != null)) { // data.add(null); // adapter.notifyDataSetChanged(); // } if (currentCallId != null) { CyLDFormacionHandler.cancelCall(currentCallId); } //Se limpia el ArrayList de nuevos datos de Actividades datosFuturos.clear(); currentCallId = "education" + new Date().getTime(); currentCallTime = new Date().getTime(); //Si no hay valor en ninguno de los campos if (origen.equals(Constants.TIPO_ONLINE)) { CyLDFormacionHandler.listActivitiesOnline(currentCallId, ActividadesFormativasActivity.this, fechaInicioAct, fechaFinAct); // Parámetro this válido porque se implementa CyLDFormacionHandlerListener } else if (origen.equals(Constants.TIPO_PRESENCIAL)) { CyLDFormacionHandler.listActivitiesPresencial(0, null, null, search, tipoVal, centroVal, currentCallId, ActividadesFormativasActivity.this); } }// requestData @Override public void onNothingSelected(AdapterView<?> adapter) { if (adapter == localidad) { centroVal = ""; } else if (adapter == tipo) { tipoVal = ""; } list.setRefreshing();//Se vió la razón de esto.TODO } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_online, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @Override public void onClick(View v) { if (v == back) { Intent i = new Intent(this, MenuFormacionActivity.class); startActivity(i); finish(); }else if (v == btnMenuRight) { slide_me.toggleRightDrawer(); } else if (v == botonPrueba) { requestData(false, search.getText().toString()); } else if (v == imageButtonFechaInicio) { showDialog(0); } else if (v == imageButtonFechaFin) { showDialog(1); } else if (v == itemPresentacion) { slide_me.closeRightSide(); Intent i = new Intent(this, PresentacionActivity.class); startActivity(i); finish(); } else if (v == itemFormativas) { slide_me.closeRightSide(); Intent i = new Intent(this, MenuFormacionActivity.class); startActivity(i); finish(); } else if (v == itemAcerca) { slide_me.closeRightSide(); Intent i = new Intent(this, AcercaActivity.class); startActivity(i); //finish(); } } @Override @Deprecated protected Dialog onCreateDialog(int id) { if (id == 0) { return new DatePickerDialog(this, datePickerListenerI, year, month, day); } else if (id == 1) { return new DatePickerDialog(this, datePickerListenerF, year, month, day); } return null; } private DatePickerDialog.OnDateSetListener datePickerListenerI = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int selectedYear, int selectedMonth, int selectedDay) { editTextFechaInicio.setText(selectedDay + " / " + (selectedMonth + 1) + " / " + selectedYear); } }; private DatePickerDialog.OnDateSetListener datePickerListenerF = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int selectedYear, int selectedMonth, int selectedDay) { editTextFechaFin.setText(selectedDay + " / " + (selectedMonth + 1) + " / " + selectedYear); } }; @Override public void onResults(String callId, Collection<CyLDFormacion> res, final boolean expectRefresh){ if (callId.equalsIgnoreCase(currentCallId)) { datosFuturos.clear(); datosFuturos.addAll(res); if (!expectRefresh) { long dif = currentCallTime - new Date().getTime(); dif = dif + LOADING_DELAY; if (dif < 0) dif = 0; list.postDelayed(new Runnable() { public void run() { data.clear(); data.addAll(datosFuturos); list.onRefreshComplete(); list.setScrollingWhileRefreshingEnabled(true); adapter.unlock(); adapter.notifyDataSetChanged(); count.setText(String.format(getString(R.string.cuenta_actividades), data.size())); count.setVisibility(View.VISIBLE); if (data.size() == 0) { Utils.showSimpleDialog(ActividadesFormativasActivity.this, null, getString(R.string.no_results), null); } } }, dif); } }// if currentCallId } @Override public void onError(String callId, Exception e, boolean expectRefresh) { e.printStackTrace(); if (!expectRefresh) { data.clear(); data.addAll(datosFuturos); list.onRefreshComplete(); adapter.unlock(); adapter.notifyDataSetChanged(); count.setVisibility(View.VISIBLE); if (data.size() == 0) { count.setText(getString(R.string.server_error_short)); Utils.showSimpleDialog(this, null, getString(R.string.server_error), null); }else{ count.setText(String.format(getString(R.string.cuenta_actividades), data.size())); } } } //onError /** * Clase que extiende de ArrayAdapter a la cual se le pasa en el constructor * Los objetos en un Array de tipo Family * El contexto (this) * La vista, un TextView para contener el valor del objeto de tipo Family * */ private class FamilyAdapter extends ArrayAdapter<Family> { LayoutInflater inflater; /** * Constructor con el que se crea un objeto LayoutInflater. */ public FamilyAdapter(Context context, int textViewResourceId, Family[] objects) { super(context, textViewResourceId, objects); inflater = LayoutInflater.from(context); } @Override /*Devuelve/rellena en pantalla los elementos del combo*/ public View getDropDownView(final int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = inflater.inflate(android.R.layout.simple_spinner_dropdown_item, parent, false);//con false no da error } TextView item = (TextView) convertView; item.setText(getItem(position).getName()); final TextView finalItem = item; item.post(new Runnable() { @Override public void run() { finalItem.setSingleLine(false); } }); return item; } }// FamilyAdapter /** * Extiende de AutoPagingListAdapter * Implementa interfaz OnItemClickListener: implementar onItemClick() * Extiende AutoPagingListAdapter: implementar getView() * Rellena la lista de items * */ private class BoardAdapter extends AutoPagingListAdapter<CyLDFormacion> implements AdapterView.OnItemClickListener { public BoardAdapter() { super(ActividadesFormativasActivity.this, R.layout.item_actividad, data); } /** * * @param position * @param convertView * @param parent * @return */ public View getView(int position, View convertView, ViewGroup parent) { int type = getItemViewType(position); if (convertView == null) { if (type == TYPE_ITEM) { convertView = getLayoutInflater().inflate( R.layout.item_actividad, null); //Pillo el Layout item_actividad } else if (type == TYPE_LOADING) { convertView = getLayoutInflater().inflate( R.layout.item_menu, null); } } if (type == TYPE_ITEM) { CyLDFormacion it = getItem(position); //Objeto CyLDFormacion TextView tv = (TextView) convertView.findViewById(R.id.titulo_actividad); //textView titulo_actividad de item_actividad tv.setText(it.nombre); //Le paso el valor del nombre //Centro. Solo si es presencial tv = (TextView) convertView.findViewById(R.id.centro_realizacion); if (it.centro != null && !it.centro.equals("")) { tv.setText(it.centro); } //Fecha de Inicio tv = (TextView) convertView.findViewById(R.id.fecha_realizacion); if (it.fechaInicio != null) { try { Date date = new SimpleDateFormat("yyyy-MM-dd").parse(it.fechaInicio);//M may. para obtener el mes correcto tv.setText(sdf.format(date)); }catch (ParseException pe) { System.err.println("Problemas parseando fecha de inicio actividad formativa"); } } else { tv.setText(""); } //Duración en horas tv = (TextView) convertView.findViewById(R.id.total_horas); tv.setText(Float.toString(it.numeroHoras) + " horas"); } else if (type == TYPE_LOADING) { TextView tv = (TextView) convertView.findViewById(R.id.text); tv.setText("Cargando..."); } return convertView; } @Override protected void onScrollNext() { requestData(false, search.getText().toString()); } /** * Evento que se ejecuta cuando se selecciona una de las actividades de la lista. * * @param arg0 * @param arg1 * @param position * @param arg3 */ @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { CyLDFormacion it = getItem(position - 1); if (it != null) { //Globals.selectedItem = it; Intent i = new Intent(ActividadesFormativasActivity.this, DetalleActividadActivity.class); i.putExtra("SELECTED_ITEM", it); startActivity(i); } } }//BoardAdapter }
UTF-8
Java
25,102
java
ActividadesFormativasActivity.java
Java
[]
null
[]
package es.jcyl.cee.cylford.app.cyldigital.ui; import android.app.DatePickerDialog; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.text.Editable; import android.text.TextWatcher; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.DatePicker; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.Spinner; import android.widget.TextView; import es.jcyl.cee.cylford.app.cyldigital.MainActivity; import es.jcyl.cee.cylford.app.cyldigital.utils.Utils; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.Locale; import es.jcyl.cee.cylford.app.cyldigital.Constants; import es.jcyl.cee.cylford.app.cyldigital.R; import es.jcyl.cee.cylford.app.cyldigital.backend.handler.CyLDFormacionHandler; import es.jcyl.cee.cylford.app.cyldigital.backend.handler.CyLDFormacionHandlerListener; import es.jcyl.cee.cylford.app.cyldigital.model.Family; import es.jcyl.cee.cylford.app.cyldigital.parser.dto.CyLDFormacion; import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode; import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener; import com.handmark.pulltorefresh.library.PullToRefreshListView; import com.navdrawer.SimpleSideDrawer; /* * La Interfaz OnItemSelectedListener me obliga a implementar métodos: onItemSelected, onNothingSelected * La Interfaz OnClickListener me obliga a implementar métodos: onClick, OnClickListener * La Interfaz CyLDFormacionHandlerListener me obliga a implementar los métodos: onResults * */ public class ActividadesFormativasActivity extends MainActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener, CyLDFormacionHandlerListener<CyLDFormacion>, OnRefreshListener<ListView> { //Retraso para mostrar los resultados en onResults() private static final int LOADING_DELAY = 3000; private BoardAdapter adapter; private ArrayList<CyLDFormacion> data = new ArrayList<CyLDFormacion>(); private ArrayList<CyLDFormacion> datosFuturos = new ArrayList<CyLDFormacion>(); //Da formato a la fecha de las actividades mostradas en BoardAdapter. private SimpleDateFormat sdf = new SimpleDateFormat("'Comienza el' d 'de' MMMM 'de' yyyy", Locale.getDefault()); //Si el origen es una consulta tipo Online o Presencial private String origen; //Combos localidad y tipo de actividad private Spinner localidad, tipo; //Texto de valores seleccionados en los combos private String centroVal, tipoVal, fechaInicioAct, fechaFinAct = ""; //Campo buscar private EditText search; //Campo que muestra el número de resutlados de la búsqueda. private TextView count; //Contiene "fecha + nombre" de la llamada actual al Servicio Web. private String currentCallId = ""; //Fecha en long de la llamada actual al Servicio Web long currentCallTime = 0; //Nueva lista Pull to refresh para mostrar los resultados devueltos. private PullToRefreshListView list;; //Botón de prueba que no se muestra en la versión final. private Button botonPrueba; private ImageView back, btnMenuRight; //Botones volver y menú lateral private SimpleSideDrawer slide_me; //Layout para los spinners de selección de centro y tipo de actividad //Layout para los botones de fecha de inicio y fecha de fin private LinearLayout layoutSpinners, layoutCalendars; //Fechas private Calendar cal; private int day, month, year; //F. Inicio private ImageButton imageButtonFechaInicio; private TextView editTextFechaInicio; //F. Fin private ImageButton imageButtonFechaFin; private TextView editTextFechaFin; private View itemPresentacion, itemFormativas, itemAcerca; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_actformativas); //getSupportActionBar().hide(); // Ya no estoy quitando en el Manifest con el style AppTheme origen = getIntent().getStringExtra("origen"); //1 SPINNER LOCALIDAD localidad = (Spinner) this.findViewById(R.id.localidad); //Para que cuando se selecciona un valor en el Spinner, el contexto recoja el escuchador localidad.setOnItemSelectedListener(this);//Para esto tengo que implementar interfaz OnItemSelectedListener //Se crea el adaptador FamilyAdapter adapterL = new FamilyAdapter(this, android.R.layout.simple_spinner_item, Constants.provincias); //Se añade el layout para el menú adapterL.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //Se indica al spinner el adaptador a usar localidad.setAdapter(adapterL); //2 SPINNER TIPO ACTIVIDAD tipo = (Spinner) this.findViewById(R.id.tipo); tipo.setOnItemSelectedListener(this); FamilyAdapter adapterT = new FamilyAdapter(this, android.R.layout.simple_spinner_item, Constants.tiposActividad); adapterT.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); tipo.setAdapter(adapterT); //3 CAMPO DE TEXTO BUSCAR search = (EditText) this.findViewById(R.id.search); //La acción de cuando se pulsa la lupa del teclado search.setOnEditorActionListener(new TextView.OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEARCH) { // String s = search.getText().toString(); // requestData(false, s, provinceVal, familyVal); list.setRefreshing(); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(search.getWindowToken(), 0); return true; } return false; } }); //4 BOTÓN VOLVER back = (ImageView) this.findViewById(R.id.back); back.setOnClickListener(this); //5 BOTÓN PRUEBA botonPrueba = (Button) this.findViewById(R.id.btnPrueba); //botonPrueba.setTextColor(getResources().getColor(R.color.background)); //botonPrueba.setCompoundDrawablesWithIntrinsicBounds(0,R.drawable.board_icon_selected_selector, 0, 0); botonPrueba.setOnClickListener(this); //6 CONTADOR Nº ACTIVIDADES count = (TextView) this.findViewById(R.id.count); count.setVisibility(View.GONE); //7 LISTA ITEMS ACTIVIDADES list = (PullToRefreshListView) findViewById(R.id.list); list.setOnRefreshListener(this); adapter = new BoardAdapter(); list.setAdapter(adapter); list.setOnScrollListener(adapter); list.setOnItemClickListener(adapter); list.setMode(Mode.PULL_FROM_START); list.setScrollingWhileRefreshingEnabled(false); list.setRefreshingLabel(getString(R.string.update)); //8 LAYOUTS layoutSpinners = (LinearLayout) this.findViewById(R.id.layoutSpinners); layoutCalendars = (LinearLayout) this.findViewById(R.id.layoutFechas); //9 BOTONES CALENDARIOS cal = Calendar.getInstance(); day = cal.get(Calendar.DAY_OF_MONTH); month = cal.get(Calendar.MONTH); year = cal.get(Calendar.YEAR); //10 BOTÓN FECHA INICIO imageButtonFechaInicio = (ImageButton) findViewById(R.id.imagenCalendarFI); editTextFechaInicio = (TextView) findViewById(R.id.fechaInicio); imageButtonFechaInicio.setOnClickListener(this); //Escuchador para realizar la búsqueda trás la actualización de la fecha. editTextFechaInicio.addTextChangedListener((new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { fechaInicioAct = editTextFechaInicio.getText().toString().replaceAll("\\s", ""); fechaFinAct = editTextFechaFin.getText().toString().replaceAll("\\s", ""); new Handler().postDelayed(new Runnable() { public void run() { list.setRefreshing(); } }, 250); } })); //11 BOTÓN FECHA FIN imageButtonFechaFin = (ImageButton) findViewById(R.id.imagenCalendarFF); editTextFechaFin = (TextView) findViewById(R.id.fechaFin); imageButtonFechaFin.setOnClickListener(this); //12 slide_me = new SimpleSideDrawer(this); slide_me.setRightBehindContentView(R.layout.menu_right); //13 BOTÓN MENÚ LATERAL btnMenuRight = (ImageView) this.findViewById(R.id.btnrightmenu); btnMenuRight.setOnClickListener(this); //14 MENÚ itemPresentacion = this.findViewById(R.id.presentacion); itemPresentacion.setOnClickListener(this); itemFormativas = this.findViewById(R.id.formativas); itemFormativas.setOnClickListener(this); itemAcerca = this.findViewById(R.id.acerca); itemAcerca.setOnClickListener(this); //A mostrar/ocultar en dependencia del tipo de formación if (origen.equals(Constants.TIPO_ONLINE)) { layoutSpinners.setVisibility(View.GONE); //Se cambia el título TextView tv = (TextView) this.findViewById(R.id.title); tv.setText(""); tv = (TextView) findViewById(R.id.title); tv.setText(R.string.title_onlines); //Búsqueda automática new Handler().postDelayed(new Runnable() { public void run() { list.setRefreshing(); } }, 250); } else if(origen.equals(Constants.TIPO_PRESENCIAL)) { layoutCalendars.setVisibility(View.GONE); //Se cambia el título TextView tv = (TextView) this.findViewById(R.id.title); tv.setText(""); tv = (TextView) findViewById(R.id.title); tv.setText(R.string.title_presenciales); //Mensaje de aviso preencial Utils.showSimpleDialog(ActividadesFormativasActivity.this, null, getString(R.string.presenciales_error), null); } } /** * Método que se lanza al seleccionar un valor en un spinner. * * @param adapter * @param arg1 * @param index * @param arg3 */ @Override public void onItemSelected(AdapterView<?> adapter, View arg1, int index, long arg3) { if (adapter == localidad) { if (index == 0) { centroVal = ""; } else { centroVal = ((Family) localidad.getSelectedItem()).getCode(); if(!tipoVal.isEmpty() && !tipoVal.equals("")){ list.setRefreshing(); } } } else if (adapter == tipo) { if (index == 0) { tipoVal = ""; } else { tipoVal = ((Family) tipo.getSelectedItem()).getCode(); if(!centroVal.isEmpty() && !centroVal.equals("")){ list.setRefreshing(); } } } //Se lanza de forma automática mostrando en la lista //la consulta de actividades online if (origen.equals(Constants.TIPO_ONLINE)) { new Handler().postDelayed(new Runnable() { public void run() { list.setRefreshing(); } }, 250); } } /** * Se lanza cuando se arrastra en la lista. * @param refreshView */ @Override public void onRefresh(PullToRefreshBase<ListView> refreshView) { //search-> valor del campo de texto de búsqueda //provinciaVal -> valor del spinner de provincias //tipoVal -> valor del spinner de tipo de actividad requestData(true, search.getText().toString()); } //@Override protected void onScrollNext() { requestData(false, search.getText().toString()); } /** * @param clear * @param search */ private void requestData(boolean clear, String search) { // To prevent another scrolling event adapter.lock(); //Objeto de tipo BoardAdapter // if (!clear && data != null // && (data.size() == 0 || data.get(data.size() - 1) != null)) { // data.add(null); // adapter.notifyDataSetChanged(); // } if (currentCallId != null) { CyLDFormacionHandler.cancelCall(currentCallId); } //Se limpia el ArrayList de nuevos datos de Actividades datosFuturos.clear(); currentCallId = "education" + new Date().getTime(); currentCallTime = new Date().getTime(); //Si no hay valor en ninguno de los campos if (origen.equals(Constants.TIPO_ONLINE)) { CyLDFormacionHandler.listActivitiesOnline(currentCallId, ActividadesFormativasActivity.this, fechaInicioAct, fechaFinAct); // Parámetro this válido porque se implementa CyLDFormacionHandlerListener } else if (origen.equals(Constants.TIPO_PRESENCIAL)) { CyLDFormacionHandler.listActivitiesPresencial(0, null, null, search, tipoVal, centroVal, currentCallId, ActividadesFormativasActivity.this); } }// requestData @Override public void onNothingSelected(AdapterView<?> adapter) { if (adapter == localidad) { centroVal = ""; } else if (adapter == tipo) { tipoVal = ""; } list.setRefreshing();//Se vió la razón de esto.TODO } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_online, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @Override public void onClick(View v) { if (v == back) { Intent i = new Intent(this, MenuFormacionActivity.class); startActivity(i); finish(); }else if (v == btnMenuRight) { slide_me.toggleRightDrawer(); } else if (v == botonPrueba) { requestData(false, search.getText().toString()); } else if (v == imageButtonFechaInicio) { showDialog(0); } else if (v == imageButtonFechaFin) { showDialog(1); } else if (v == itemPresentacion) { slide_me.closeRightSide(); Intent i = new Intent(this, PresentacionActivity.class); startActivity(i); finish(); } else if (v == itemFormativas) { slide_me.closeRightSide(); Intent i = new Intent(this, MenuFormacionActivity.class); startActivity(i); finish(); } else if (v == itemAcerca) { slide_me.closeRightSide(); Intent i = new Intent(this, AcercaActivity.class); startActivity(i); //finish(); } } @Override @Deprecated protected Dialog onCreateDialog(int id) { if (id == 0) { return new DatePickerDialog(this, datePickerListenerI, year, month, day); } else if (id == 1) { return new DatePickerDialog(this, datePickerListenerF, year, month, day); } return null; } private DatePickerDialog.OnDateSetListener datePickerListenerI = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int selectedYear, int selectedMonth, int selectedDay) { editTextFechaInicio.setText(selectedDay + " / " + (selectedMonth + 1) + " / " + selectedYear); } }; private DatePickerDialog.OnDateSetListener datePickerListenerF = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int selectedYear, int selectedMonth, int selectedDay) { editTextFechaFin.setText(selectedDay + " / " + (selectedMonth + 1) + " / " + selectedYear); } }; @Override public void onResults(String callId, Collection<CyLDFormacion> res, final boolean expectRefresh){ if (callId.equalsIgnoreCase(currentCallId)) { datosFuturos.clear(); datosFuturos.addAll(res); if (!expectRefresh) { long dif = currentCallTime - new Date().getTime(); dif = dif + LOADING_DELAY; if (dif < 0) dif = 0; list.postDelayed(new Runnable() { public void run() { data.clear(); data.addAll(datosFuturos); list.onRefreshComplete(); list.setScrollingWhileRefreshingEnabled(true); adapter.unlock(); adapter.notifyDataSetChanged(); count.setText(String.format(getString(R.string.cuenta_actividades), data.size())); count.setVisibility(View.VISIBLE); if (data.size() == 0) { Utils.showSimpleDialog(ActividadesFormativasActivity.this, null, getString(R.string.no_results), null); } } }, dif); } }// if currentCallId } @Override public void onError(String callId, Exception e, boolean expectRefresh) { e.printStackTrace(); if (!expectRefresh) { data.clear(); data.addAll(datosFuturos); list.onRefreshComplete(); adapter.unlock(); adapter.notifyDataSetChanged(); count.setVisibility(View.VISIBLE); if (data.size() == 0) { count.setText(getString(R.string.server_error_short)); Utils.showSimpleDialog(this, null, getString(R.string.server_error), null); }else{ count.setText(String.format(getString(R.string.cuenta_actividades), data.size())); } } } //onError /** * Clase que extiende de ArrayAdapter a la cual se le pasa en el constructor * Los objetos en un Array de tipo Family * El contexto (this) * La vista, un TextView para contener el valor del objeto de tipo Family * */ private class FamilyAdapter extends ArrayAdapter<Family> { LayoutInflater inflater; /** * Constructor con el que se crea un objeto LayoutInflater. */ public FamilyAdapter(Context context, int textViewResourceId, Family[] objects) { super(context, textViewResourceId, objects); inflater = LayoutInflater.from(context); } @Override /*Devuelve/rellena en pantalla los elementos del combo*/ public View getDropDownView(final int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = inflater.inflate(android.R.layout.simple_spinner_dropdown_item, parent, false);//con false no da error } TextView item = (TextView) convertView; item.setText(getItem(position).getName()); final TextView finalItem = item; item.post(new Runnable() { @Override public void run() { finalItem.setSingleLine(false); } }); return item; } }// FamilyAdapter /** * Extiende de AutoPagingListAdapter * Implementa interfaz OnItemClickListener: implementar onItemClick() * Extiende AutoPagingListAdapter: implementar getView() * Rellena la lista de items * */ private class BoardAdapter extends AutoPagingListAdapter<CyLDFormacion> implements AdapterView.OnItemClickListener { public BoardAdapter() { super(ActividadesFormativasActivity.this, R.layout.item_actividad, data); } /** * * @param position * @param convertView * @param parent * @return */ public View getView(int position, View convertView, ViewGroup parent) { int type = getItemViewType(position); if (convertView == null) { if (type == TYPE_ITEM) { convertView = getLayoutInflater().inflate( R.layout.item_actividad, null); //Pillo el Layout item_actividad } else if (type == TYPE_LOADING) { convertView = getLayoutInflater().inflate( R.layout.item_menu, null); } } if (type == TYPE_ITEM) { CyLDFormacion it = getItem(position); //Objeto CyLDFormacion TextView tv = (TextView) convertView.findViewById(R.id.titulo_actividad); //textView titulo_actividad de item_actividad tv.setText(it.nombre); //Le paso el valor del nombre //Centro. Solo si es presencial tv = (TextView) convertView.findViewById(R.id.centro_realizacion); if (it.centro != null && !it.centro.equals("")) { tv.setText(it.centro); } //Fecha de Inicio tv = (TextView) convertView.findViewById(R.id.fecha_realizacion); if (it.fechaInicio != null) { try { Date date = new SimpleDateFormat("yyyy-MM-dd").parse(it.fechaInicio);//M may. para obtener el mes correcto tv.setText(sdf.format(date)); }catch (ParseException pe) { System.err.println("Problemas parseando fecha de inicio actividad formativa"); } } else { tv.setText(""); } //Duración en horas tv = (TextView) convertView.findViewById(R.id.total_horas); tv.setText(Float.toString(it.numeroHoras) + " horas"); } else if (type == TYPE_LOADING) { TextView tv = (TextView) convertView.findViewById(R.id.text); tv.setText("Cargando..."); } return convertView; } @Override protected void onScrollNext() { requestData(false, search.getText().toString()); } /** * Evento que se ejecuta cuando se selecciona una de las actividades de la lista. * * @param arg0 * @param arg1 * @param position * @param arg3 */ @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { CyLDFormacion it = getItem(position - 1); if (it != null) { //Globals.selectedItem = it; Intent i = new Intent(ActividadesFormativasActivity.this, DetalleActividadActivity.class); i.putExtra("SELECTED_ITEM", it); startActivity(i); } } }//BoardAdapter }
25,102
0.60995
0.607436
645
37.862015
28.783251
209
false
false
0
0
0
0
0
0
0.595349
false
false
4
e862c77013bf101b242336e931ad9b7ea72caaf7
2,886,218,054,369
e60a6e3e4af03235ef93d8e4a97b8f69cfd6437c
/platform-sdk/swirlds-common/src/main/java/com/swirlds/common/system/status/StatusActionSubmitter.java
4e5c9cd61bb66894be5233dbe2c075a68730aa33
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
hashgraph/hedera-services
https://github.com/hashgraph/hedera-services
bca04c759d2cc5b539f4fd726151c60c831035dd
0b028f60bd92e4dc6524a068e75351ffe193ea40
refs/heads/develop
2023-08-17T05:06:10.782000
2023-08-16T21:57:57
2023-08-16T21:57:57
261,828,887
260
112
Apache-2.0
false
2023-09-14T21:47:44
2020-05-06T17:17:43
2023-09-13T08:40:37
2023-09-14T21:47:43
332,528
227
86
1,359
Java
false
false
/* * Copyright (C) 2023 Hedera Hashgraph, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.swirlds.common.system.status; import com.swirlds.common.system.status.actions.PlatformStatusAction; import edu.umd.cs.findbugs.annotations.NonNull; /** * A functional interface for submitting status actions */ @FunctionalInterface public interface StatusActionSubmitter { /** * Submit a status action, which will be processed in the order received * * @param action the action to submit */ void submitStatusAction(@NonNull final PlatformStatusAction action); }
UTF-8
Java
1,116
java
StatusActionSubmitter.java
Java
[ { "context": "/*\n * Copyright (C) 2023 Hedera Hashgraph, LLC\n *\n * Licensed under the Apache License, Vers", "end": 41, "score": 0.9805576205253601, "start": 25, "tag": "NAME", "value": "Hedera Hashgraph" } ]
null
[]
/* * Copyright (C) 2023 <NAME>, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.swirlds.common.system.status; import com.swirlds.common.system.status.actions.PlatformStatusAction; import edu.umd.cs.findbugs.annotations.NonNull; /** * A functional interface for submitting status actions */ @FunctionalInterface public interface StatusActionSubmitter { /** * Submit a status action, which will be processed in the order received * * @param action the action to submit */ void submitStatusAction(@NonNull final PlatformStatusAction action); }
1,106
0.743728
0.736559
33
32.81818
28.629774
76
false
false
0
0
0
0
0
0
0.333333
false
false
4
4a6f07ed1b54e31a546feb4f37fdcc2b4041239a
6,889,127,610,146
5a3da5340f1f3b9380877d3a6a2194c2f9702f88
/src/test/java/com/oleti/tests/BaseTest.java
5231083cdca85770fbc872ca0b29b0498bd6fa58
[]
no_license
oletishiva/SeleniumautomationE2E
https://github.com/oletishiva/SeleniumautomationE2E
0ebce729d817d7e987c586ac57936af8878ddbf7
61f1984243bbd186c9b8d1b55e51579da6cc85a8
refs/heads/main
2023-07-15T06:16:56.697000
2021-09-06T04:38:00
2021-09-06T04:38:00
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.oleti.tests; import org.openqa.selenium.WebDriver; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import com.oleti.pages.BasePage; import com.oleti.utils.logs.Log; public class BaseTest extends BasePage{ public WebDriver getDriver() { return driver; } @BeforeClass public void classLevelSetup() { Log.info("Tests is starting!"); Log.info("Navigate to"+BasePage.config.getProperty("testsiteurl")); BasePage.driver.get(BasePage.config.getProperty("testsiteurl")); BasePage.driver.manage().window().maximize(); } @BeforeMethod public void methodLevelSetup() { } @AfterClass public void teardown() { Log.info("Tests are ending!"); driver.quit(); } }
UTF-8
Java
849
java
BaseTest.java
Java
[]
null
[]
package com.oleti.tests; import org.openqa.selenium.WebDriver; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import com.oleti.pages.BasePage; import com.oleti.utils.logs.Log; public class BaseTest extends BasePage{ public WebDriver getDriver() { return driver; } @BeforeClass public void classLevelSetup() { Log.info("Tests is starting!"); Log.info("Navigate to"+BasePage.config.getProperty("testsiteurl")); BasePage.driver.get(BasePage.config.getProperty("testsiteurl")); BasePage.driver.manage().window().maximize(); } @BeforeMethod public void methodLevelSetup() { } @AfterClass public void teardown() { Log.info("Tests are ending!"); driver.quit(); } }
849
0.684335
0.684335
35
23.285715
19.533958
75
false
false
0
0
0
0
0
0
0.514286
false
false
4
8b152990e97c0636b0d3272f0c84238c6ed8625f
27,719,718,997,176
97c36c01647af5c208afb439f482d2c1857e1953
/app/src/main/java/com/example/gronthomongol/backend/CONSTANTS.java
d5023814545493e01011e7b7b3596b6d9d5fa5df
[]
no_license
farhanfuad35/GronthoMongol
https://github.com/farhanfuad35/GronthoMongol
d3ba6e2fc70d81769c36f3b460c9902813a19665
3533a7ad47ba405438de1edf6d4317709e50b80e
refs/heads/master
2022-11-27T01:44:44.388000
2020-08-05T06:54:29
2020-08-05T06:54:29
268,801,992
4
1
null
false
2020-08-05T06:54:30
2020-06-02T13:00:34
2020-07-13T18:31:08
2020-08-05T06:54:30
75,812
1
1
2
Java
false
false
/* Orderlist Sort must be by last created. Because after creating a new order, that is instantly added to the cached order list at the top * Book list sort shouldn't matter because it is re retrieved if a new book is added. In case of update, it is added only if it is found * in the cache list of books and replaced at that particular index. In case of removing a book, it is deleted if it is found. * The page size must not be more than 10. Because orders are extracted with a limit of 10. Because relational object query in Backendless * implements paging and the max is 10. You need to reconfigure the query and everything if page size is more than 10. However, for retrieving * books, there shouldn't be any issue as the book objects are not related. But for consistency it is recommended that both be the same. * */ package com.example.gronthomongol.backend; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; import android.widget.Toast; import androidx.recyclerview.widget.RecyclerView; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.Request; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.android.volley.toolbox.Volley; import com.backendless.Backendless; import com.backendless.BackendlessUser; import com.backendless.async.callback.AsyncCallback; import com.backendless.exceptions.BackendlessFault; import com.backendless.messaging.MessageStatus; import com.backendless.messaging.PublishOptions; import com.backendless.persistence.DataQueryBuilder; import com.example.gronthomongol.backend.models.Book; import com.example.gronthomongol.backend.models.Order; import com.example.gronthomongol.ui.auth.AuthActivity; import com.example.gronthomongol.ui.main.admin.AdminMainActivity; import com.example.gronthomongol.ui.main.user.UserMainActivity; import com.example.gronthomongol.ui.util.adapters.UserBooksAdapter; import com.example.gronthomongol.ui.util.adapters.AdminBooksAdapter; import com.example.gronthomongol.ui.util.listeners.EndlessScrollEventListener; import com.example.gronthomongol.ui.util.adapters.OrdersAdapter; import com.example.gronthomongol.R; import com.example.gronthomongol.ui.welcome.WelcomeScreenActivity; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.Comparator; import java.util.List; public class CONSTANTS { public static double CURRENT_APP_VERSION = 1.1; private static int MAX_NO_OF_BOOKS_PER_USER_PER_ORDER = 10; private static int MAX_NO_OF_ORDERS_PER_USER_PER_BOOK = 2; private static int MIN_NO_OF_ORDERS_PER_USER_PER_BOOK = 1; private static int ID_BOOKLIST = 17; private static int ID_BOOKLIST_ADMIN = 41; private static int ID_SPALSH_SCREEN = 29; private static int ID_LOGIN = 31; private static int ID_PLACE_ORDER = 19; private static int ID_VIEW_ORDERS = 37; private static int ID_VIEW_ORDERS_ADMIN = 43; private static int ID_PLACE_ORDER_ADD_MORE_BOOK = 23; private static int ID_BOOKLISTADMIN_BOOKDETAILS = 47; private static int ID_DELETE_BOOK_FROM_BOOK_DETAILS = 53; public static boolean sendNotificationToAdmins; public static boolean operational; public static boolean canOrder; public static String cannot_order_message; public static String non_operational_message; public static double min_version; public static int maximum_order_per_day; public static int currentOrderFilter = 0; // none. index according to values/array_filter_by_admin.xml public static OrdersAdapter orderlistAdapterRV; public static int CURRENT_NUMBER_OF_ORDERS = 0; private static boolean showingDefaultBooklist = true; // Not the search query list private static BackendlessUser currentUser; public static List<Book> bookListCached; public static List<Book> tempBookListCached = new ArrayList<>(); public static List<Order> myOrdersCached; public static List<com.example.gronthomongol.backend.models.Request> userRequestsCached; public static ArrayList<Book> orderedBooks; private static int OFFSET = 0; // Explicitly for booklist private static int MYORDEROFFSET = 0; private static int PAGE_SIZE = 13; private static int MY_ORDER_PAGE_SIZE = 13; // MIGHT CAUSE TROUBLE. SET IT TO 10 private static int REQUESTS_PAGE_SIZE = 13; private static int REQUESTS_OFFSET = 0; private static DataQueryBuilder bookListQueryBuilder; private static DataQueryBuilder userRequestsQueryBuilder; private static DataQueryBuilder orderListQueryBuilder; private static DataQueryBuilder SearchBookQueryBuilder; public static String NULLMARKER = "N/A_AUTO"; public static int getOFFSET() { return OFFSET; } public static int getIdPlaceOrderAddMoreBook() { return ID_PLACE_ORDER_ADD_MORE_BOOK; } public static int getIdSpalshScreen() { return ID_SPALSH_SCREEN; } public static DataQueryBuilder getUserRequestsQueryBuilder() { return userRequestsQueryBuilder; } public static void setUserRequestsQueryBuilder(DataQueryBuilder userRequestsQueryBuilder) { CONSTANTS.userRequestsQueryBuilder = userRequestsQueryBuilder; } public static int getIdLogin() { return ID_LOGIN; } public static int getMyOrderPageSize() { return MY_ORDER_PAGE_SIZE; } public static List<Book> getTempBookListCached() { return tempBookListCached; } public static boolean isShowingDefaultBooklist() { return showingDefaultBooklist; } public static void setShowingDefaultBooklist(boolean showingDefaultBooklist) { CONSTANTS.showingDefaultBooklist = showingDefaultBooklist; } public static void setTempBookListCached(List<Book> tempBookListCached) { CONSTANTS.tempBookListCached = tempBookListCached; } public static int getRequestsPageSize() { return REQUESTS_PAGE_SIZE; } public static int getRequestsOffset() { return REQUESTS_OFFSET; } public static void setRequestsOffset(int requestsOffset) { REQUESTS_OFFSET = requestsOffset; } public static DataQueryBuilder getSearchBookQueryBuilder() { return SearchBookQueryBuilder; } public static void setSearchBookQueryBuilder(DataQueryBuilder searchBookQueryBuilder) { SearchBookQueryBuilder = searchBookQueryBuilder; } public static BackendlessUser getCurrentUser() { return currentUser; } public static int getIdViewOrders() { return ID_VIEW_ORDERS; } public static void setCurrentUser(BackendlessUser currentUser) { CONSTANTS.currentUser = currentUser; } public static int getIdBooklistadminBookdetails() { return ID_BOOKLISTADMIN_BOOKDETAILS; } public static int getMYORDEROFFSET() { return MYORDEROFFSET; } public static void setMYORDEROFFSET(int MYORDEROFFSET) { CONSTANTS.MYORDEROFFSET = MYORDEROFFSET; } public static DataQueryBuilder getOrderListQueryBuilder() { return orderListQueryBuilder; } public static void setOrderListQueryBuilder(DataQueryBuilder orderListQueryBuilder) { CONSTANTS.orderListQueryBuilder = orderListQueryBuilder; } public static int getMaxNoOfBooksPerUserPerOrder() { return MAX_NO_OF_BOOKS_PER_USER_PER_ORDER; } public static int getIdBooklistAdmin() { return ID_BOOKLIST_ADMIN; } public static int getIdDeleteBookFromBookDetails() { return ID_DELETE_BOOK_FROM_BOOK_DETAILS; } public static int getIdViewOrdersAdmin() { return ID_VIEW_ORDERS_ADMIN; } public static int getPageSize() { return PAGE_SIZE; } public static DataQueryBuilder getBookListQueryBuilder() { return bookListQueryBuilder; } public static int getIdBooklist() { return ID_BOOKLIST; } public static int getIdPlaceOrder() { return ID_PLACE_ORDER; } public static void setBookListQueryBuilder(DataQueryBuilder bookListQueryBuilder) { CONSTANTS.bookListQueryBuilder = bookListQueryBuilder; } public static List<Book> getBookListCached() { return bookListCached; } public static void setBookListCached(List<Book> bookListCached) { CONSTANTS.bookListCached = bookListCached; } public static List<Order> getMyOrdersCached() { return myOrdersCached; } public static void setMyOrdersCached(List<Order> myOrdersCached) { CONSTANTS.myOrdersCached = myOrdersCached; } public static int getMAX_NO_OF_ORDERS_PER_USER_PER_BOOK() { return MAX_NO_OF_ORDERS_PER_USER_PER_BOOK; } public static int getMIN_NO_OF_ORDERS_PER_USER_PER_BOOK() { return MIN_NO_OF_ORDERS_PER_USER_PER_BOOK; } public static void setOFFSET(int OFFSET) { CONSTANTS.OFFSET = OFFSET; } public static Comparator<Book> compareByName = new Comparator<Book>() { @Override public int compare(Book o1, Book o2) { return o1.getName().compareTo(o2.getName()); } }; public static Comparator<Book> compareByWriter = new Comparator<Book>() { @Override public int compare(Book o1, Book o2) { return o1.getWriter().compareTo(o2.getWriter()); } }; public static Comparator<Book> compareByQuantity = new Comparator<Book>() { @Override public int compare(Book o1, Book o2) { return o1.getQuantity() - o2.getQuantity(); } }; public static void getConfigFile(final Context context, final int callingActivityId){ String url = String.format("https://backendlessappcontent.com/%s/%s/files/config.json", CREDENTIALS.getApplicationId(), CREDENTIALS.getRestApiKey()); RequestQueue requestQueue = Volley.newRequestQueue((Activity)context); JsonObjectRequest jsonObjectRequest = new JsonObjectRequest (Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject config) { try { min_version = (double) config.get("min_version"); sendNotificationToAdmins = (boolean) config.get("sendNotificationToAdmins"); operational = (boolean) config.get("operational"); non_operational_message = (String) config.get("non_operational_message"); canOrder = (boolean) config.get("canOrder"); cannot_order_message = (String) config.get("cannot_order_message"); maximum_order_per_day = (int) config.get("maximum_order_per_day"); Log.i("file", min_version + "\t" + sendNotificationToAdmins + "\t" + operational + "\t" + non_operational_message + "\t" + canOrder + "\t" + cannot_order_message + "\t" + maximum_order_per_day); if(CURRENT_APP_VERSION < min_version){ showErrorDialog((Activity)context, "Update Required", "Your app is outdated. Please update to continue", "okay", null, 19); } else if(!operational){ showErrorDialog((Activity)context, "Notice", non_operational_message, "Okay", null, 19); } else{ checkLoginStatus(context, callingActivityId); } } catch (JSONException e) { showErrorDialog((Activity)context, "Error Occured", "Couldn't Load App Config. App must quit", "Okay", null, 19); Log.i("file", "onErrorResponse: Exception occurred reading the file" + e.getMessage()); e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { // TODO: Handle error if(error.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageVolley))){ String title = "Connection Failed!"; String message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: Error Message = " + error.getMessage()); } else{ showErrorDialog((Activity)context, "Error Occurred", "Something went wrong", "Quit", null, 19); } Log.i("file", "onErrorResponse: Error occurred getting the file " + error.getMessage()); } }); requestQueue.add(jsonObjectRequest); } public static void checkLoginStatus(final Context context, final int callingActivityId){ // #1 // REQUIREMENT: ASSUMED COMING FROM THE SPLASH SCREEN ONLY // CHECK LOGIN final String currentUserId = Backendless.UserService.loggedInUser(); // Get current user details from the database Backendless.UserService.findById(currentUserId, new AsyncCallback<BackendlessUser>() { @Override public void handleResponse(BackendlessUser response) { // Get current number of orders from backendless AsyncCallback<Integer> callback = new AsyncCallback<Integer>() { @Override public void handleResponse( Integer value ) { CONSTANTS.CURRENT_NUMBER_OF_ORDERS = value; Log.i("counter", "handleResponse: Current number of orders: " + value); } @Override public void handleFault( BackendlessFault backendlessFault ) { Log.i("counter", "handleFault: " + backendlessFault.getMessage() + "\tcode: " + backendlessFault.getCode()); CONSTANTS.CURRENT_NUMBER_OF_ORDERS = 0; } }; Backendless.Counters.get( "current_number_of_orders", callback ); // IAtomic<Integer> myCounter = Backendless.Counters.of( "current_number_of_orders", Integer.class ); // CURRENT_NUMBER_OF_ORDERS = myCounter.get(); // Log.i("counter", "handleResponse: Current number of orders: " + myCounter.get()); // Note: Both of the below functions can be used to retrieve the current logged in user // But both of these functions might have been used somewhere in this project. So recommended that both be here. Backendless.UserService.setCurrentUser( response ); CONSTANTS.setCurrentUser(response); // Retrieve Book List here // Book list retrieval requires to test if the current user is an admin. Thus it can't be placed anywhere earlier RetrieveBookListFromDatabaseInitially((Activity)context, callingActivityId, null); // #2 } @Override public void handleFault(BackendlessFault fault) { // Couldn't get user details from the database. The program CANNOT continue // Getting user error String title; String message; if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else { // Couldn't get user from database. Take the user to the login page after a logout attempt Backendless.Messaging.unregisterDevice(new AsyncCallback<Integer>() { @Override public void handleResponse(Integer response) { // Couldn't get user from database. Take the user to the login page after a logout attempt Intent intent = new Intent((Activity)context, AuthActivity.class); ((Activity)context).finish(); ((Activity)context).startActivity(intent); } @Override public void handleFault(BackendlessFault fault) { // Couldn't get user from database. Take the user to the login page after a logout attempt Intent intent = new Intent((Activity)context, AuthActivity.class); ((Activity)context).finish(); ((Activity)context).startActivity(intent); } }); } } }); } public static void backendlessBookQuery(final Context context, final Dialog dialog, String whereClause, final AdminBooksAdapter booklistAdapterRV_admin){ final DataQueryBuilder searchBookQueryBuilder = DataQueryBuilder.create(); searchBookQueryBuilder.setWhereClause(whereClause); Backendless.Data.of(Book.class).find(searchBookQueryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse(List<Book> response) { Log.i("search", "handleResponse: response size: " + response.size()); CONSTANTS.setSearchBookQueryBuilder(searchBookQueryBuilder); dialog.dismiss(); if(isShowingDefaultBooklist()) tempBookListCached.addAll(bookListCached); bookListCached.clear(); bookListCached.addAll(response); setShowingDefaultBooklist(false); if(response.isEmpty()){ Toast.makeText(((Activity)context), "No result found!", Toast.LENGTH_LONG).show(); } booklistAdapterRV_admin.notifyDataSetChanged(); } @Override public void handleFault(BackendlessFault fault) { String title; String message; dialog.dismiss(); if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText(((Activity)context), "Sorry couldn't complete search query", Toast.LENGTH_SHORT).show(); } Log.i("search", "handleFault: " + fault.getMessage()); } }); } // TODO REMEMBER TO PASTE UPDATES HERE TOO FROM THE ABOVE public static void backendlessBookQuery(final Context context, final Dialog dialog, String whereClause, final UserBooksAdapter booklistAdapterRV){ final DataQueryBuilder searchBookQueryBuilder = DataQueryBuilder.create(); searchBookQueryBuilder.setWhereClause(whereClause); Backendless.Data.of(Book.class).find(searchBookQueryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse(List<Book> response) { Log.i("search", "handleResponse: response size: " + response.size()); CONSTANTS.setSearchBookQueryBuilder(searchBookQueryBuilder); dialog.dismiss(); if(isShowingDefaultBooklist()) tempBookListCached.addAll(bookListCached); // Now the query list will be shown as the book list cached bookListCached.clear(); bookListCached.addAll(response); setShowingDefaultBooklist(false); if(response.isEmpty()){ Toast.makeText(((Activity)context), "No result found!", Toast.LENGTH_LONG).show(); } Log.i("search", String.format("booklistCached size now: %d\t tempBookListCached size: %d", bookListCached.size(), tempBookListCached.size())); booklistAdapterRV.notifyDataSetChanged(); } @Override public void handleFault(BackendlessFault fault) { String title; String message; dialog.dismiss(); if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText(((Activity)context), "Sorry couldn't complete search query", Toast.LENGTH_SHORT).show(); } Log.i("search", "handleFault: " + fault.getMessage()); } }); } public static void RetrieveBookListFromDatabaseInitially(final Context context, final int callingActivityId, final Dialog dialog){ // For initial booklist database call only // REQUIREMENT: ONLY FOR THE INITIAL BOOKLIST RETRIEVAL WHERE NO CONTEXT, ADAPTER ETC ARE REQUIRED // THEREFORE, COMING FROM EITHER SPLASH SCREEN OR LOGIN SharedPreferences pref = ((Activity)context).getSharedPreferences("preferences", 0); // 0 - for private mode setOFFSET(0); final DataQueryBuilder queryBuilder = DataQueryBuilder.create(); if(! (boolean) CONSTANTS.getCurrentUser().getProperty("admin")) { String whereClause = "quantity > 0"; queryBuilder.setWhereClause(whereClause); } queryBuilder.addAllProperties(); queryBuilder.setSortBy(pref.getString("sortBy", "name")); queryBuilder.setPageSize( CONSTANTS.getPageSize() ).setOffset( CONSTANTS.getOFFSET() ); Backendless.Data.of( Book.class ).find( queryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse( List<Book> response ) { CONSTANTS.bookListCached = response; CONSTANTS.setBookListQueryBuilder(queryBuilder); // To make this exact querybuilder accessible from all over the app Log.i("booklist_retrieve", "Booklist retrieved. Size = " + response.size()); CONSTANTS.setOFFSET(CONSTANTS.getOFFSET()+CONSTANTS.getPageSize()); // Retrieve Order List from Database boolean hasWhereClause = false; String whereClause = ""; if(!(boolean) getCurrentUser().getProperty("admin")){ hasWhereClause = true; whereClause = "user.email = '" + CONSTANTS.getCurrentUser().getEmail() + "'"; } retrieveOrdersFromDatabase(context, hasWhereClause, whereClause, callingActivityId, dialog); } @Override public void handleFault( BackendlessFault fault ) { // DONE if(dialog != null){ dialog.dismiss(); } String title; String message; if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; if(callingActivityId == getIdSpalshScreen()){ showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); } else{ showErrorDialog((Activity)context, title, message, "Okay", null, 0); } Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ title = "Error Occurred"; message = "Couldn't Retrieve Book List from the Server"; if(callingActivityId == getIdSpalshScreen()){ showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); } else{ showErrorDialog((Activity)context, title, message, "Okay", null, 0); } } Log.i("fault", fault.getMessage()); //Toast.makeText(getApplicationContext(), "Error: " + fault.getMessage(), Toast.LENGTH_SHORT).show(); } }); } public static void retrieveOrdersFromDatabase(final Context context, boolean hasWhereClause, String whereClause, final int callingActivityId, final Dialog dialog){ // REQUIREMENT: SORTING SHOULDN'T BE CHANGED. IT IS ASSUMED TO BE CREATED DESC BY DEFAULT // No need to check if the user is an admin or not. It is handled before calling and this info is forwarded by the whereClause CONSTANTS.setMYORDEROFFSET(0); final DataQueryBuilder queryBuilder = DataQueryBuilder.create(); if(hasWhereClause) { queryBuilder.setWhereClause(whereClause); } queryBuilder.addAllProperties(); queryBuilder.setSortBy("created DESC"); queryBuilder.setPageSize( CONSTANTS.getMyOrderPageSize() ).setOffset( CONSTANTS.getMYORDEROFFSET() ); Backendless.Data.of(Order.class).find(queryBuilder, new AsyncCallback<List<Order>>() { @Override public void handleResponse(List<Order> response) { //Log.i("myOrders_retrieve", "SplashScreen/handleResponse: where Clause: " + whereClause); Log.i("myOrders_retrieve", "SplashScreen/handleResponse: My orders retrieved. response size = " + response.size()); CONSTANTS.setMyOrdersCached(response); CONSTANTS.setOrderListQueryBuilder(queryBuilder); CONSTANTS.setMYORDEROFFSET(CONSTANTS.getMYORDEROFFSET() + CONSTANTS.getMyOrderPageSize()); if(callingActivityId == getIdLogin() || callingActivityId == getIdSpalshScreen()){ if(dialog != null){ dialog.dismiss(); } if(!(boolean) CONSTANTS.getCurrentUser().getProperty("admin")) { Intent intent = new Intent((Activity) context, UserMainActivity.class); intent.putExtra(((Activity) context).getString(R.string.activityIDName), CONSTANTS.getIdSpalshScreen()); ((Activity) context).startActivity(intent); ((Activity) context).finish(); } else{ Intent intent = new Intent((Activity) context, AdminMainActivity.class); intent.putExtra(((Activity) context).getString(R.string.activityIDName), CONSTANTS.getIdSpalshScreen()); ((Activity) context).startActivity(intent); ((Activity) context).finish(); } } } @Override public void handleFault(BackendlessFault fault) { if(dialog != null){ dialog.dismiss(); } String title; String message; if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; if(callingActivityId == getIdSpalshScreen()){ showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); } else{ showErrorDialog((Activity)context, title, message, "Okay", null, 0); } Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ title = "Error Occurred"; message = "Couldn't Retrieve Book List from the Server"; if(callingActivityId == getIdSpalshScreen()){ showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); } else{ showErrorDialog((Activity)context, title, message, "Okay", null, 0); } } Log.i("fault", fault.getMessage()); //Toast.makeText(getApplicationContext(), "Error: " + fault.getMessage(), Toast.LENGTH_SHORT).show(); } }); } public static void freshRetrieveFromDatabase(final Context context, final UserBooksAdapter userBooksAdapter, String sortBy, final Dialog dialog, final RecyclerView recyclerView, final EndlessScrollEventListener endlessScrollEventListener){ // REQUIREMENTS: MUST BE CALLED AFTER IT IS DETERMINED IF THE USER IS AN ADMIN OR NOT // MUST BE CALLED AFTER THE FULL LIST DISPLAY REQUIREMENTS ARE INITIALIZED // CANNOT BE USED AS THE INITIAL DATABASE CALL. INITIAL CALL IS DEFINED IN THE SplashScreen ACTIVITY // Internal Changes Log.i("booklist_retrieve", "freshRetrieveFromDatabase: before sortBy = " + sortBy); final int oldOffset = CONSTANTS.getOFFSET(); CONSTANTS.setOFFSET(0); SharedPreferences pref = context.getSharedPreferences("preferences", 0); // 0 - for private mode SharedPreferences.Editor editor = pref.edit(); editor.putString("sortBy", sortBy); editor.commit(); Log.i("shared_preference", "freshRetrieveFromDatabase: sortBy = " + sortBy); Log.i("shared_preference", "freshRetrieveFromDatabase: value from sharedPreference: " + pref.getString("sortBy", "default")); // Database Stuff final DataQueryBuilder queryBuilder = DataQueryBuilder.create(); // Include where clause only if the user is not an admin if(! (boolean) CONSTANTS.getCurrentUser().getProperty("admin")) { String whereClause = "quantity > 0"; queryBuilder.setWhereClause(whereClause); } queryBuilder.addAllProperties(); queryBuilder.setSortBy(sortBy); queryBuilder.setPageSize( CONSTANTS.getPageSize() ).setOffset( CONSTANTS.getOFFSET() ); Backendless.Data.of( Book.class ).find( queryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse( List<Book> response ) { // booklistAdapter = new BooklistAdapter(getApplicationContext(), response); // listView.setAdapter(booklistAdapter); CONSTANTS.bookListCached.clear(); CONSTANTS.bookListCached.addAll(response); Log.i("booklist_retrieve", "received list[0] = " + response.get(0).getName()); Log.i("booklist_retrieve", "cached list[0] = " + CONSTANTS.bookListCached.get(0).getName()); endlessScrollEventListener.reset(); userBooksAdapter.notifyDataSetChanged(); CONSTANTS.setBookListQueryBuilder(queryBuilder); // To make this exact querybuilder accessible from all over the app Log.i("booklist_retrieve", "Booklist retrieved. Size = " + response.size()); CONSTANTS.setOFFSET(CONSTANTS.getOFFSET()+CONSTANTS.getPageSize()); dialog.dismiss(); } @Override public void handleFault( BackendlessFault fault ) { dialog.dismiss(); CONSTANTS.setOFFSET(oldOffset); String title; String message; if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText((Activity)context, "Something went wrong!", Toast.LENGTH_SHORT).show(); } Log.e("fault", fault.getMessage()); //Toast.makeText(getApplicationContext(), "Error: " + fault.getMessage(), Toast.LENGTH_SHORT).show(); } }); } public static void freshRetrieveFromDatabase(final Context context, final AdminBooksAdapter adminBooksAdapter, String sortBy, final Dialog dialog, final RecyclerView recyclerView, final EndlessScrollEventListener endlessScrollEventListener){ // REQUIREMENTS: MUST BE CALLED AFTER IT IS DETERMINED IF THE USER IS AN ADMIN OR NOT // MUST BE CALLED AFTER THE FULL LIST DISPLAY REQUIREMENTS ARE INITIALIZED // CANNOT BE USED AS THE INITIAL DATABASE CALL. INITIAL CALL IS DEFINED IN THE SplashScreen ACTIVITY // Internal Changes Log.i("booklist_retrieve", "freshRetrieveFromDatabase: before sortBy = " + sortBy); final int oldOffset = CONSTANTS.getOFFSET(); CONSTANTS.setOFFSET(0); SharedPreferences pref = context.getSharedPreferences("preferences", 0); // 0 - for private mode SharedPreferences.Editor editor = pref.edit(); editor.putString("sortBy", sortBy); editor.apply(); Log.i("shared_preference", "freshRetrieveFromDatabase: sortBy = " + sortBy); Log.i("shared_preference", "freshRetrieveFromDatabase: value from sharedPreference: " + pref.getString("sortBy", "default")); // Database Stuff final DataQueryBuilder queryBuilder = DataQueryBuilder.create(); // Include where clause only if the user is not an admin if(! (boolean) CONSTANTS.getCurrentUser().getProperty("admin")) { String whereClause = "quantity > 0"; queryBuilder.setWhereClause(whereClause); } queryBuilder.addAllProperties(); queryBuilder.setSortBy(sortBy); queryBuilder.setPageSize( CONSTANTS.getPageSize() ).setOffset( CONSTANTS.getOFFSET() ); Backendless.Data.of( Book.class ).find( queryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse( List<Book> response ) { // booklistAdapter = new BooklistAdapter(getApplicationContext(), response); // listView.setAdapter(booklistAdapter); CONSTANTS.bookListCached.clear(); CONSTANTS.bookListCached.addAll(response); Log.i("booklist_retrieve", "received list[0] = " + response.get(0).getName()); Log.i("booklist_retrieve", "cached list[0] = " + CONSTANTS.bookListCached.get(0).getName()); endlessScrollEventListener.reset(); adminBooksAdapter.notifyDataSetChanged(); CONSTANTS.setBookListQueryBuilder(queryBuilder); // To make this exact querybuilder accessible from all over the app Log.i("booklist_retrieve", "Booklist retrieved. Size = " + response.size()); CONSTANTS.setOFFSET(CONSTANTS.getOFFSET()+CONSTANTS.getPageSize()); dialog.dismiss(); } @Override public void handleFault( BackendlessFault fault ) { dialog.dismiss(); String title; String message; CONSTANTS.setOFFSET(oldOffset); if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText((Activity)context, "Something went wrong!", Toast.LENGTH_SHORT).show(); } Log.e("fault", fault.getMessage()); //Toast.makeText(getApplicationContext(), "Error: " + fault.getMessage(), Toast.LENGTH_SHORT).show(); } }); } public static void freshOrderRetrieveFromDatabase(final Context context, final OrdersAdapter orderlistAdapterRV, String whereClause, final Dialog dialog, final EndlessScrollEventListener endlessScrollEventListener, final int which){ final int oldOffset = CONSTANTS.getMYORDEROFFSET(); CONSTANTS.setMYORDEROFFSET(0); final DataQueryBuilder dataQueryBuilder = DataQueryBuilder.create(); dataQueryBuilder.setPageSize(CONSTANTS.getMyOrderPageSize()).setOffset(CONSTANTS.getMYORDEROFFSET()); if(!whereClause.equals(NULLMARKER)) dataQueryBuilder.setWhereClause(whereClause); dataQueryBuilder.addAllProperties(); dataQueryBuilder.setSortBy("created DESC"); Backendless.Data.of(Order.class).find(dataQueryBuilder, new AsyncCallback<List<Order>>() { @Override public void handleResponse(List<Order> response) { if(response.size()>0){ CONSTANTS.myOrdersCached.clear(); CONSTANTS.myOrdersCached.addAll(response); Log.i("orderlist_retrieve", "received list[0] = " + response.get(0).getRecipient_Name()); endlessScrollEventListener.reset(); orderlistAdapterRV.notifyDataSetChanged(); CONSTANTS.setOrderListQueryBuilder(dataQueryBuilder); // To make this exact querybuilder accessible from all over the app Log.i("orderlist_retrieve", "Booklist retrieved. Size = " + response.size()); CONSTANTS.setMYORDEROFFSET(CONSTANTS.getMYORDEROFFSET()+CONSTANTS.getMyOrderPageSize()); CONSTANTS.currentOrderFilter = which; } dialog.dismiss(); } @Override public void handleFault(BackendlessFault fault) { dialog.dismiss(); String title; String message; CONSTANTS.setMYORDEROFFSET(oldOffset); if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText((Activity)context, "Something went wrong!", Toast.LENGTH_SHORT).show(); } Log.e("fault", fault.getMessage()); } }); } public static void sendNotificationToTheAdmins(String message, String messageTitle) { if(CONSTANTS.sendNotificationToAdmins){ PublishOptions publishOptions = new PublishOptions(); publishOptions.putHeader("android-ticker-text", "You just got a private push notification!"); publishOptions.putHeader("android-content-title", messageTitle); publishOptions.putHeader("android-content-text", "Push Notifications Text"); Backendless.Messaging.publish("admin", message, publishOptions, new AsyncCallback<MessageStatus>() { @Override public void handleResponse(MessageStatus response) { Log.i("notification", "handleResponse: Notification sent to the admins"); } @Override public void handleFault(BackendlessFault fault) { Log.i("notification", "handleFault: Notification sending to the admins failed\t" + fault.getMessage()); } }); } } public static void showErrorDialog_splashScreen(final Context context, String title, String message, String positiveButton, String negativeButton) { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(((Activity)context)); alertDialogBuilder.setTitle(title); alertDialogBuilder.setMessage(message); alertDialogBuilder.setPositiveButton(positiveButton, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { //Toast.makeText(Splash_Screen.this,"You clicked yes button",Toast.LENGTH_LONG).show(); arg0.dismiss(); Intent intent = new Intent(((Activity)context), WelcomeScreenActivity.class); ((Activity)context).startActivity(intent); ((Activity)context).finish(); } }); alertDialogBuilder.setNegativeButton(negativeButton, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ((Activity)context).finish(); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } public static void showErrorDialog(final Context context, String title, String message, String positiveButton, String negativeButton, final int fromOperationId){ AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(((Activity)context)); alertDialogBuilder.setTitle(title); alertDialogBuilder.setMessage(message); alertDialogBuilder.setPositiveButton(positiveButton, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { //Toast.makeText(Splash_Screen.this,"You clicked yes button",Toast.LENGTH_LONG).show(); arg0.dismiss(); if(fromOperationId == 19) { // Close current activity ((Activity)context).finish(); } } }); if(negativeButton != null){ alertDialogBuilder.setNegativeButton(negativeButton, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); } AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } }
UTF-8
Java
45,657
java
CONSTANTS.java
Java
[]
null
[]
/* Orderlist Sort must be by last created. Because after creating a new order, that is instantly added to the cached order list at the top * Book list sort shouldn't matter because it is re retrieved if a new book is added. In case of update, it is added only if it is found * in the cache list of books and replaced at that particular index. In case of removing a book, it is deleted if it is found. * The page size must not be more than 10. Because orders are extracted with a limit of 10. Because relational object query in Backendless * implements paging and the max is 10. You need to reconfigure the query and everything if page size is more than 10. However, for retrieving * books, there shouldn't be any issue as the book objects are not related. But for consistency it is recommended that both be the same. * */ package com.example.gronthomongol.backend; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; import android.widget.Toast; import androidx.recyclerview.widget.RecyclerView; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.Request; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.android.volley.toolbox.Volley; import com.backendless.Backendless; import com.backendless.BackendlessUser; import com.backendless.async.callback.AsyncCallback; import com.backendless.exceptions.BackendlessFault; import com.backendless.messaging.MessageStatus; import com.backendless.messaging.PublishOptions; import com.backendless.persistence.DataQueryBuilder; import com.example.gronthomongol.backend.models.Book; import com.example.gronthomongol.backend.models.Order; import com.example.gronthomongol.ui.auth.AuthActivity; import com.example.gronthomongol.ui.main.admin.AdminMainActivity; import com.example.gronthomongol.ui.main.user.UserMainActivity; import com.example.gronthomongol.ui.util.adapters.UserBooksAdapter; import com.example.gronthomongol.ui.util.adapters.AdminBooksAdapter; import com.example.gronthomongol.ui.util.listeners.EndlessScrollEventListener; import com.example.gronthomongol.ui.util.adapters.OrdersAdapter; import com.example.gronthomongol.R; import com.example.gronthomongol.ui.welcome.WelcomeScreenActivity; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.Comparator; import java.util.List; public class CONSTANTS { public static double CURRENT_APP_VERSION = 1.1; private static int MAX_NO_OF_BOOKS_PER_USER_PER_ORDER = 10; private static int MAX_NO_OF_ORDERS_PER_USER_PER_BOOK = 2; private static int MIN_NO_OF_ORDERS_PER_USER_PER_BOOK = 1; private static int ID_BOOKLIST = 17; private static int ID_BOOKLIST_ADMIN = 41; private static int ID_SPALSH_SCREEN = 29; private static int ID_LOGIN = 31; private static int ID_PLACE_ORDER = 19; private static int ID_VIEW_ORDERS = 37; private static int ID_VIEW_ORDERS_ADMIN = 43; private static int ID_PLACE_ORDER_ADD_MORE_BOOK = 23; private static int ID_BOOKLISTADMIN_BOOKDETAILS = 47; private static int ID_DELETE_BOOK_FROM_BOOK_DETAILS = 53; public static boolean sendNotificationToAdmins; public static boolean operational; public static boolean canOrder; public static String cannot_order_message; public static String non_operational_message; public static double min_version; public static int maximum_order_per_day; public static int currentOrderFilter = 0; // none. index according to values/array_filter_by_admin.xml public static OrdersAdapter orderlistAdapterRV; public static int CURRENT_NUMBER_OF_ORDERS = 0; private static boolean showingDefaultBooklist = true; // Not the search query list private static BackendlessUser currentUser; public static List<Book> bookListCached; public static List<Book> tempBookListCached = new ArrayList<>(); public static List<Order> myOrdersCached; public static List<com.example.gronthomongol.backend.models.Request> userRequestsCached; public static ArrayList<Book> orderedBooks; private static int OFFSET = 0; // Explicitly for booklist private static int MYORDEROFFSET = 0; private static int PAGE_SIZE = 13; private static int MY_ORDER_PAGE_SIZE = 13; // MIGHT CAUSE TROUBLE. SET IT TO 10 private static int REQUESTS_PAGE_SIZE = 13; private static int REQUESTS_OFFSET = 0; private static DataQueryBuilder bookListQueryBuilder; private static DataQueryBuilder userRequestsQueryBuilder; private static DataQueryBuilder orderListQueryBuilder; private static DataQueryBuilder SearchBookQueryBuilder; public static String NULLMARKER = "N/A_AUTO"; public static int getOFFSET() { return OFFSET; } public static int getIdPlaceOrderAddMoreBook() { return ID_PLACE_ORDER_ADD_MORE_BOOK; } public static int getIdSpalshScreen() { return ID_SPALSH_SCREEN; } public static DataQueryBuilder getUserRequestsQueryBuilder() { return userRequestsQueryBuilder; } public static void setUserRequestsQueryBuilder(DataQueryBuilder userRequestsQueryBuilder) { CONSTANTS.userRequestsQueryBuilder = userRequestsQueryBuilder; } public static int getIdLogin() { return ID_LOGIN; } public static int getMyOrderPageSize() { return MY_ORDER_PAGE_SIZE; } public static List<Book> getTempBookListCached() { return tempBookListCached; } public static boolean isShowingDefaultBooklist() { return showingDefaultBooklist; } public static void setShowingDefaultBooklist(boolean showingDefaultBooklist) { CONSTANTS.showingDefaultBooklist = showingDefaultBooklist; } public static void setTempBookListCached(List<Book> tempBookListCached) { CONSTANTS.tempBookListCached = tempBookListCached; } public static int getRequestsPageSize() { return REQUESTS_PAGE_SIZE; } public static int getRequestsOffset() { return REQUESTS_OFFSET; } public static void setRequestsOffset(int requestsOffset) { REQUESTS_OFFSET = requestsOffset; } public static DataQueryBuilder getSearchBookQueryBuilder() { return SearchBookQueryBuilder; } public static void setSearchBookQueryBuilder(DataQueryBuilder searchBookQueryBuilder) { SearchBookQueryBuilder = searchBookQueryBuilder; } public static BackendlessUser getCurrentUser() { return currentUser; } public static int getIdViewOrders() { return ID_VIEW_ORDERS; } public static void setCurrentUser(BackendlessUser currentUser) { CONSTANTS.currentUser = currentUser; } public static int getIdBooklistadminBookdetails() { return ID_BOOKLISTADMIN_BOOKDETAILS; } public static int getMYORDEROFFSET() { return MYORDEROFFSET; } public static void setMYORDEROFFSET(int MYORDEROFFSET) { CONSTANTS.MYORDEROFFSET = MYORDEROFFSET; } public static DataQueryBuilder getOrderListQueryBuilder() { return orderListQueryBuilder; } public static void setOrderListQueryBuilder(DataQueryBuilder orderListQueryBuilder) { CONSTANTS.orderListQueryBuilder = orderListQueryBuilder; } public static int getMaxNoOfBooksPerUserPerOrder() { return MAX_NO_OF_BOOKS_PER_USER_PER_ORDER; } public static int getIdBooklistAdmin() { return ID_BOOKLIST_ADMIN; } public static int getIdDeleteBookFromBookDetails() { return ID_DELETE_BOOK_FROM_BOOK_DETAILS; } public static int getIdViewOrdersAdmin() { return ID_VIEW_ORDERS_ADMIN; } public static int getPageSize() { return PAGE_SIZE; } public static DataQueryBuilder getBookListQueryBuilder() { return bookListQueryBuilder; } public static int getIdBooklist() { return ID_BOOKLIST; } public static int getIdPlaceOrder() { return ID_PLACE_ORDER; } public static void setBookListQueryBuilder(DataQueryBuilder bookListQueryBuilder) { CONSTANTS.bookListQueryBuilder = bookListQueryBuilder; } public static List<Book> getBookListCached() { return bookListCached; } public static void setBookListCached(List<Book> bookListCached) { CONSTANTS.bookListCached = bookListCached; } public static List<Order> getMyOrdersCached() { return myOrdersCached; } public static void setMyOrdersCached(List<Order> myOrdersCached) { CONSTANTS.myOrdersCached = myOrdersCached; } public static int getMAX_NO_OF_ORDERS_PER_USER_PER_BOOK() { return MAX_NO_OF_ORDERS_PER_USER_PER_BOOK; } public static int getMIN_NO_OF_ORDERS_PER_USER_PER_BOOK() { return MIN_NO_OF_ORDERS_PER_USER_PER_BOOK; } public static void setOFFSET(int OFFSET) { CONSTANTS.OFFSET = OFFSET; } public static Comparator<Book> compareByName = new Comparator<Book>() { @Override public int compare(Book o1, Book o2) { return o1.getName().compareTo(o2.getName()); } }; public static Comparator<Book> compareByWriter = new Comparator<Book>() { @Override public int compare(Book o1, Book o2) { return o1.getWriter().compareTo(o2.getWriter()); } }; public static Comparator<Book> compareByQuantity = new Comparator<Book>() { @Override public int compare(Book o1, Book o2) { return o1.getQuantity() - o2.getQuantity(); } }; public static void getConfigFile(final Context context, final int callingActivityId){ String url = String.format("https://backendlessappcontent.com/%s/%s/files/config.json", CREDENTIALS.getApplicationId(), CREDENTIALS.getRestApiKey()); RequestQueue requestQueue = Volley.newRequestQueue((Activity)context); JsonObjectRequest jsonObjectRequest = new JsonObjectRequest (Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject config) { try { min_version = (double) config.get("min_version"); sendNotificationToAdmins = (boolean) config.get("sendNotificationToAdmins"); operational = (boolean) config.get("operational"); non_operational_message = (String) config.get("non_operational_message"); canOrder = (boolean) config.get("canOrder"); cannot_order_message = (String) config.get("cannot_order_message"); maximum_order_per_day = (int) config.get("maximum_order_per_day"); Log.i("file", min_version + "\t" + sendNotificationToAdmins + "\t" + operational + "\t" + non_operational_message + "\t" + canOrder + "\t" + cannot_order_message + "\t" + maximum_order_per_day); if(CURRENT_APP_VERSION < min_version){ showErrorDialog((Activity)context, "Update Required", "Your app is outdated. Please update to continue", "okay", null, 19); } else if(!operational){ showErrorDialog((Activity)context, "Notice", non_operational_message, "Okay", null, 19); } else{ checkLoginStatus(context, callingActivityId); } } catch (JSONException e) { showErrorDialog((Activity)context, "Error Occured", "Couldn't Load App Config. App must quit", "Okay", null, 19); Log.i("file", "onErrorResponse: Exception occurred reading the file" + e.getMessage()); e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { // TODO: Handle error if(error.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageVolley))){ String title = "Connection Failed!"; String message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: Error Message = " + error.getMessage()); } else{ showErrorDialog((Activity)context, "Error Occurred", "Something went wrong", "Quit", null, 19); } Log.i("file", "onErrorResponse: Error occurred getting the file " + error.getMessage()); } }); requestQueue.add(jsonObjectRequest); } public static void checkLoginStatus(final Context context, final int callingActivityId){ // #1 // REQUIREMENT: ASSUMED COMING FROM THE SPLASH SCREEN ONLY // CHECK LOGIN final String currentUserId = Backendless.UserService.loggedInUser(); // Get current user details from the database Backendless.UserService.findById(currentUserId, new AsyncCallback<BackendlessUser>() { @Override public void handleResponse(BackendlessUser response) { // Get current number of orders from backendless AsyncCallback<Integer> callback = new AsyncCallback<Integer>() { @Override public void handleResponse( Integer value ) { CONSTANTS.CURRENT_NUMBER_OF_ORDERS = value; Log.i("counter", "handleResponse: Current number of orders: " + value); } @Override public void handleFault( BackendlessFault backendlessFault ) { Log.i("counter", "handleFault: " + backendlessFault.getMessage() + "\tcode: " + backendlessFault.getCode()); CONSTANTS.CURRENT_NUMBER_OF_ORDERS = 0; } }; Backendless.Counters.get( "current_number_of_orders", callback ); // IAtomic<Integer> myCounter = Backendless.Counters.of( "current_number_of_orders", Integer.class ); // CURRENT_NUMBER_OF_ORDERS = myCounter.get(); // Log.i("counter", "handleResponse: Current number of orders: " + myCounter.get()); // Note: Both of the below functions can be used to retrieve the current logged in user // But both of these functions might have been used somewhere in this project. So recommended that both be here. Backendless.UserService.setCurrentUser( response ); CONSTANTS.setCurrentUser(response); // Retrieve Book List here // Book list retrieval requires to test if the current user is an admin. Thus it can't be placed anywhere earlier RetrieveBookListFromDatabaseInitially((Activity)context, callingActivityId, null); // #2 } @Override public void handleFault(BackendlessFault fault) { // Couldn't get user details from the database. The program CANNOT continue // Getting user error String title; String message; if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else { // Couldn't get user from database. Take the user to the login page after a logout attempt Backendless.Messaging.unregisterDevice(new AsyncCallback<Integer>() { @Override public void handleResponse(Integer response) { // Couldn't get user from database. Take the user to the login page after a logout attempt Intent intent = new Intent((Activity)context, AuthActivity.class); ((Activity)context).finish(); ((Activity)context).startActivity(intent); } @Override public void handleFault(BackendlessFault fault) { // Couldn't get user from database. Take the user to the login page after a logout attempt Intent intent = new Intent((Activity)context, AuthActivity.class); ((Activity)context).finish(); ((Activity)context).startActivity(intent); } }); } } }); } public static void backendlessBookQuery(final Context context, final Dialog dialog, String whereClause, final AdminBooksAdapter booklistAdapterRV_admin){ final DataQueryBuilder searchBookQueryBuilder = DataQueryBuilder.create(); searchBookQueryBuilder.setWhereClause(whereClause); Backendless.Data.of(Book.class).find(searchBookQueryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse(List<Book> response) { Log.i("search", "handleResponse: response size: " + response.size()); CONSTANTS.setSearchBookQueryBuilder(searchBookQueryBuilder); dialog.dismiss(); if(isShowingDefaultBooklist()) tempBookListCached.addAll(bookListCached); bookListCached.clear(); bookListCached.addAll(response); setShowingDefaultBooklist(false); if(response.isEmpty()){ Toast.makeText(((Activity)context), "No result found!", Toast.LENGTH_LONG).show(); } booklistAdapterRV_admin.notifyDataSetChanged(); } @Override public void handleFault(BackendlessFault fault) { String title; String message; dialog.dismiss(); if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText(((Activity)context), "Sorry couldn't complete search query", Toast.LENGTH_SHORT).show(); } Log.i("search", "handleFault: " + fault.getMessage()); } }); } // TODO REMEMBER TO PASTE UPDATES HERE TOO FROM THE ABOVE public static void backendlessBookQuery(final Context context, final Dialog dialog, String whereClause, final UserBooksAdapter booklistAdapterRV){ final DataQueryBuilder searchBookQueryBuilder = DataQueryBuilder.create(); searchBookQueryBuilder.setWhereClause(whereClause); Backendless.Data.of(Book.class).find(searchBookQueryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse(List<Book> response) { Log.i("search", "handleResponse: response size: " + response.size()); CONSTANTS.setSearchBookQueryBuilder(searchBookQueryBuilder); dialog.dismiss(); if(isShowingDefaultBooklist()) tempBookListCached.addAll(bookListCached); // Now the query list will be shown as the book list cached bookListCached.clear(); bookListCached.addAll(response); setShowingDefaultBooklist(false); if(response.isEmpty()){ Toast.makeText(((Activity)context), "No result found!", Toast.LENGTH_LONG).show(); } Log.i("search", String.format("booklistCached size now: %d\t tempBookListCached size: %d", bookListCached.size(), tempBookListCached.size())); booklistAdapterRV.notifyDataSetChanged(); } @Override public void handleFault(BackendlessFault fault) { String title; String message; dialog.dismiss(); if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText(((Activity)context), "Sorry couldn't complete search query", Toast.LENGTH_SHORT).show(); } Log.i("search", "handleFault: " + fault.getMessage()); } }); } public static void RetrieveBookListFromDatabaseInitially(final Context context, final int callingActivityId, final Dialog dialog){ // For initial booklist database call only // REQUIREMENT: ONLY FOR THE INITIAL BOOKLIST RETRIEVAL WHERE NO CONTEXT, ADAPTER ETC ARE REQUIRED // THEREFORE, COMING FROM EITHER SPLASH SCREEN OR LOGIN SharedPreferences pref = ((Activity)context).getSharedPreferences("preferences", 0); // 0 - for private mode setOFFSET(0); final DataQueryBuilder queryBuilder = DataQueryBuilder.create(); if(! (boolean) CONSTANTS.getCurrentUser().getProperty("admin")) { String whereClause = "quantity > 0"; queryBuilder.setWhereClause(whereClause); } queryBuilder.addAllProperties(); queryBuilder.setSortBy(pref.getString("sortBy", "name")); queryBuilder.setPageSize( CONSTANTS.getPageSize() ).setOffset( CONSTANTS.getOFFSET() ); Backendless.Data.of( Book.class ).find( queryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse( List<Book> response ) { CONSTANTS.bookListCached = response; CONSTANTS.setBookListQueryBuilder(queryBuilder); // To make this exact querybuilder accessible from all over the app Log.i("booklist_retrieve", "Booklist retrieved. Size = " + response.size()); CONSTANTS.setOFFSET(CONSTANTS.getOFFSET()+CONSTANTS.getPageSize()); // Retrieve Order List from Database boolean hasWhereClause = false; String whereClause = ""; if(!(boolean) getCurrentUser().getProperty("admin")){ hasWhereClause = true; whereClause = "user.email = '" + CONSTANTS.getCurrentUser().getEmail() + "'"; } retrieveOrdersFromDatabase(context, hasWhereClause, whereClause, callingActivityId, dialog); } @Override public void handleFault( BackendlessFault fault ) { // DONE if(dialog != null){ dialog.dismiss(); } String title; String message; if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; if(callingActivityId == getIdSpalshScreen()){ showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); } else{ showErrorDialog((Activity)context, title, message, "Okay", null, 0); } Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ title = "Error Occurred"; message = "Couldn't Retrieve Book List from the Server"; if(callingActivityId == getIdSpalshScreen()){ showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); } else{ showErrorDialog((Activity)context, title, message, "Okay", null, 0); } } Log.i("fault", fault.getMessage()); //Toast.makeText(getApplicationContext(), "Error: " + fault.getMessage(), Toast.LENGTH_SHORT).show(); } }); } public static void retrieveOrdersFromDatabase(final Context context, boolean hasWhereClause, String whereClause, final int callingActivityId, final Dialog dialog){ // REQUIREMENT: SORTING SHOULDN'T BE CHANGED. IT IS ASSUMED TO BE CREATED DESC BY DEFAULT // No need to check if the user is an admin or not. It is handled before calling and this info is forwarded by the whereClause CONSTANTS.setMYORDEROFFSET(0); final DataQueryBuilder queryBuilder = DataQueryBuilder.create(); if(hasWhereClause) { queryBuilder.setWhereClause(whereClause); } queryBuilder.addAllProperties(); queryBuilder.setSortBy("created DESC"); queryBuilder.setPageSize( CONSTANTS.getMyOrderPageSize() ).setOffset( CONSTANTS.getMYORDEROFFSET() ); Backendless.Data.of(Order.class).find(queryBuilder, new AsyncCallback<List<Order>>() { @Override public void handleResponse(List<Order> response) { //Log.i("myOrders_retrieve", "SplashScreen/handleResponse: where Clause: " + whereClause); Log.i("myOrders_retrieve", "SplashScreen/handleResponse: My orders retrieved. response size = " + response.size()); CONSTANTS.setMyOrdersCached(response); CONSTANTS.setOrderListQueryBuilder(queryBuilder); CONSTANTS.setMYORDEROFFSET(CONSTANTS.getMYORDEROFFSET() + CONSTANTS.getMyOrderPageSize()); if(callingActivityId == getIdLogin() || callingActivityId == getIdSpalshScreen()){ if(dialog != null){ dialog.dismiss(); } if(!(boolean) CONSTANTS.getCurrentUser().getProperty("admin")) { Intent intent = new Intent((Activity) context, UserMainActivity.class); intent.putExtra(((Activity) context).getString(R.string.activityIDName), CONSTANTS.getIdSpalshScreen()); ((Activity) context).startActivity(intent); ((Activity) context).finish(); } else{ Intent intent = new Intent((Activity) context, AdminMainActivity.class); intent.putExtra(((Activity) context).getString(R.string.activityIDName), CONSTANTS.getIdSpalshScreen()); ((Activity) context).startActivity(intent); ((Activity) context).finish(); } } } @Override public void handleFault(BackendlessFault fault) { if(dialog != null){ dialog.dismiss(); } String title; String message; if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; if(callingActivityId == getIdSpalshScreen()){ showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); } else{ showErrorDialog((Activity)context, title, message, "Okay", null, 0); } Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ title = "Error Occurred"; message = "Couldn't Retrieve Book List from the Server"; if(callingActivityId == getIdSpalshScreen()){ showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); } else{ showErrorDialog((Activity)context, title, message, "Okay", null, 0); } } Log.i("fault", fault.getMessage()); //Toast.makeText(getApplicationContext(), "Error: " + fault.getMessage(), Toast.LENGTH_SHORT).show(); } }); } public static void freshRetrieveFromDatabase(final Context context, final UserBooksAdapter userBooksAdapter, String sortBy, final Dialog dialog, final RecyclerView recyclerView, final EndlessScrollEventListener endlessScrollEventListener){ // REQUIREMENTS: MUST BE CALLED AFTER IT IS DETERMINED IF THE USER IS AN ADMIN OR NOT // MUST BE CALLED AFTER THE FULL LIST DISPLAY REQUIREMENTS ARE INITIALIZED // CANNOT BE USED AS THE INITIAL DATABASE CALL. INITIAL CALL IS DEFINED IN THE SplashScreen ACTIVITY // Internal Changes Log.i("booklist_retrieve", "freshRetrieveFromDatabase: before sortBy = " + sortBy); final int oldOffset = CONSTANTS.getOFFSET(); CONSTANTS.setOFFSET(0); SharedPreferences pref = context.getSharedPreferences("preferences", 0); // 0 - for private mode SharedPreferences.Editor editor = pref.edit(); editor.putString("sortBy", sortBy); editor.commit(); Log.i("shared_preference", "freshRetrieveFromDatabase: sortBy = " + sortBy); Log.i("shared_preference", "freshRetrieveFromDatabase: value from sharedPreference: " + pref.getString("sortBy", "default")); // Database Stuff final DataQueryBuilder queryBuilder = DataQueryBuilder.create(); // Include where clause only if the user is not an admin if(! (boolean) CONSTANTS.getCurrentUser().getProperty("admin")) { String whereClause = "quantity > 0"; queryBuilder.setWhereClause(whereClause); } queryBuilder.addAllProperties(); queryBuilder.setSortBy(sortBy); queryBuilder.setPageSize( CONSTANTS.getPageSize() ).setOffset( CONSTANTS.getOFFSET() ); Backendless.Data.of( Book.class ).find( queryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse( List<Book> response ) { // booklistAdapter = new BooklistAdapter(getApplicationContext(), response); // listView.setAdapter(booklistAdapter); CONSTANTS.bookListCached.clear(); CONSTANTS.bookListCached.addAll(response); Log.i("booklist_retrieve", "received list[0] = " + response.get(0).getName()); Log.i("booklist_retrieve", "cached list[0] = " + CONSTANTS.bookListCached.get(0).getName()); endlessScrollEventListener.reset(); userBooksAdapter.notifyDataSetChanged(); CONSTANTS.setBookListQueryBuilder(queryBuilder); // To make this exact querybuilder accessible from all over the app Log.i("booklist_retrieve", "Booklist retrieved. Size = " + response.size()); CONSTANTS.setOFFSET(CONSTANTS.getOFFSET()+CONSTANTS.getPageSize()); dialog.dismiss(); } @Override public void handleFault( BackendlessFault fault ) { dialog.dismiss(); CONSTANTS.setOFFSET(oldOffset); String title; String message; if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText((Activity)context, "Something went wrong!", Toast.LENGTH_SHORT).show(); } Log.e("fault", fault.getMessage()); //Toast.makeText(getApplicationContext(), "Error: " + fault.getMessage(), Toast.LENGTH_SHORT).show(); } }); } public static void freshRetrieveFromDatabase(final Context context, final AdminBooksAdapter adminBooksAdapter, String sortBy, final Dialog dialog, final RecyclerView recyclerView, final EndlessScrollEventListener endlessScrollEventListener){ // REQUIREMENTS: MUST BE CALLED AFTER IT IS DETERMINED IF THE USER IS AN ADMIN OR NOT // MUST BE CALLED AFTER THE FULL LIST DISPLAY REQUIREMENTS ARE INITIALIZED // CANNOT BE USED AS THE INITIAL DATABASE CALL. INITIAL CALL IS DEFINED IN THE SplashScreen ACTIVITY // Internal Changes Log.i("booklist_retrieve", "freshRetrieveFromDatabase: before sortBy = " + sortBy); final int oldOffset = CONSTANTS.getOFFSET(); CONSTANTS.setOFFSET(0); SharedPreferences pref = context.getSharedPreferences("preferences", 0); // 0 - for private mode SharedPreferences.Editor editor = pref.edit(); editor.putString("sortBy", sortBy); editor.apply(); Log.i("shared_preference", "freshRetrieveFromDatabase: sortBy = " + sortBy); Log.i("shared_preference", "freshRetrieveFromDatabase: value from sharedPreference: " + pref.getString("sortBy", "default")); // Database Stuff final DataQueryBuilder queryBuilder = DataQueryBuilder.create(); // Include where clause only if the user is not an admin if(! (boolean) CONSTANTS.getCurrentUser().getProperty("admin")) { String whereClause = "quantity > 0"; queryBuilder.setWhereClause(whereClause); } queryBuilder.addAllProperties(); queryBuilder.setSortBy(sortBy); queryBuilder.setPageSize( CONSTANTS.getPageSize() ).setOffset( CONSTANTS.getOFFSET() ); Backendless.Data.of( Book.class ).find( queryBuilder, new AsyncCallback<List<Book>>() { @Override public void handleResponse( List<Book> response ) { // booklistAdapter = new BooklistAdapter(getApplicationContext(), response); // listView.setAdapter(booklistAdapter); CONSTANTS.bookListCached.clear(); CONSTANTS.bookListCached.addAll(response); Log.i("booklist_retrieve", "received list[0] = " + response.get(0).getName()); Log.i("booklist_retrieve", "cached list[0] = " + CONSTANTS.bookListCached.get(0).getName()); endlessScrollEventListener.reset(); adminBooksAdapter.notifyDataSetChanged(); CONSTANTS.setBookListQueryBuilder(queryBuilder); // To make this exact querybuilder accessible from all over the app Log.i("booklist_retrieve", "Booklist retrieved. Size = " + response.size()); CONSTANTS.setOFFSET(CONSTANTS.getOFFSET()+CONSTANTS.getPageSize()); dialog.dismiss(); } @Override public void handleFault( BackendlessFault fault ) { dialog.dismiss(); String title; String message; CONSTANTS.setOFFSET(oldOffset); if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText((Activity)context, "Something went wrong!", Toast.LENGTH_SHORT).show(); } Log.e("fault", fault.getMessage()); //Toast.makeText(getApplicationContext(), "Error: " + fault.getMessage(), Toast.LENGTH_SHORT).show(); } }); } public static void freshOrderRetrieveFromDatabase(final Context context, final OrdersAdapter orderlistAdapterRV, String whereClause, final Dialog dialog, final EndlessScrollEventListener endlessScrollEventListener, final int which){ final int oldOffset = CONSTANTS.getMYORDEROFFSET(); CONSTANTS.setMYORDEROFFSET(0); final DataQueryBuilder dataQueryBuilder = DataQueryBuilder.create(); dataQueryBuilder.setPageSize(CONSTANTS.getMyOrderPageSize()).setOffset(CONSTANTS.getMYORDEROFFSET()); if(!whereClause.equals(NULLMARKER)) dataQueryBuilder.setWhereClause(whereClause); dataQueryBuilder.addAllProperties(); dataQueryBuilder.setSortBy("created DESC"); Backendless.Data.of(Order.class).find(dataQueryBuilder, new AsyncCallback<List<Order>>() { @Override public void handleResponse(List<Order> response) { if(response.size()>0){ CONSTANTS.myOrdersCached.clear(); CONSTANTS.myOrdersCached.addAll(response); Log.i("orderlist_retrieve", "received list[0] = " + response.get(0).getRecipient_Name()); endlessScrollEventListener.reset(); orderlistAdapterRV.notifyDataSetChanged(); CONSTANTS.setOrderListQueryBuilder(dataQueryBuilder); // To make this exact querybuilder accessible from all over the app Log.i("orderlist_retrieve", "Booklist retrieved. Size = " + response.size()); CONSTANTS.setMYORDEROFFSET(CONSTANTS.getMYORDEROFFSET()+CONSTANTS.getMyOrderPageSize()); CONSTANTS.currentOrderFilter = which; } dialog.dismiss(); } @Override public void handleFault(BackendlessFault fault) { dialog.dismiss(); String title; String message; CONSTANTS.setMYORDEROFFSET(oldOffset); if( fault.getMessage().equals(((Activity)context).getString(R.string.connectionErrorMessageBackendless) )) { title = "Connection Failed!"; message = "Please Check Your Internet Connection"; showErrorDialog_splashScreen((Activity)context, title, message, "Retry", "Quit"); Log.i("errorCode", "handleFault: error Code: " + fault.getCode() + "\t Error Message = " + fault.getMessage()); } else{ Toast.makeText((Activity)context, "Something went wrong!", Toast.LENGTH_SHORT).show(); } Log.e("fault", fault.getMessage()); } }); } public static void sendNotificationToTheAdmins(String message, String messageTitle) { if(CONSTANTS.sendNotificationToAdmins){ PublishOptions publishOptions = new PublishOptions(); publishOptions.putHeader("android-ticker-text", "You just got a private push notification!"); publishOptions.putHeader("android-content-title", messageTitle); publishOptions.putHeader("android-content-text", "Push Notifications Text"); Backendless.Messaging.publish("admin", message, publishOptions, new AsyncCallback<MessageStatus>() { @Override public void handleResponse(MessageStatus response) { Log.i("notification", "handleResponse: Notification sent to the admins"); } @Override public void handleFault(BackendlessFault fault) { Log.i("notification", "handleFault: Notification sending to the admins failed\t" + fault.getMessage()); } }); } } public static void showErrorDialog_splashScreen(final Context context, String title, String message, String positiveButton, String negativeButton) { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(((Activity)context)); alertDialogBuilder.setTitle(title); alertDialogBuilder.setMessage(message); alertDialogBuilder.setPositiveButton(positiveButton, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { //Toast.makeText(Splash_Screen.this,"You clicked yes button",Toast.LENGTH_LONG).show(); arg0.dismiss(); Intent intent = new Intent(((Activity)context), WelcomeScreenActivity.class); ((Activity)context).startActivity(intent); ((Activity)context).finish(); } }); alertDialogBuilder.setNegativeButton(negativeButton, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ((Activity)context).finish(); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } public static void showErrorDialog(final Context context, String title, String message, String positiveButton, String negativeButton, final int fromOperationId){ AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(((Activity)context)); alertDialogBuilder.setTitle(title); alertDialogBuilder.setMessage(message); alertDialogBuilder.setPositiveButton(positiveButton, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { //Toast.makeText(Splash_Screen.this,"You clicked yes button",Toast.LENGTH_LONG).show(); arg0.dismiss(); if(fromOperationId == 19) { // Close current activity ((Activity)context).finish(); } } }); if(negativeButton != null){ alertDialogBuilder.setNegativeButton(negativeButton, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); } AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } }
45,657
0.59866
0.596316
970
46.069073
39.287552
167
false
false
0
0
0
0
0
0
0.708247
false
false
4
aa3a5684e179a51284b328f64b8e80f88d1a5265
4,200,478,049,770
8cf8f1a5fd7f749c5b8e34a9459ff5b7189a5881
/2 - Construcao/fontes/java/sgp/src/main/java/br/com/sgp/util/Constants.java
dd892221d74b083a0d491bc4b0430a4d9e46edf6
[]
no_license
juliandegutis/sgp-all
https://github.com/juliandegutis/sgp-all
8d808b22b4c467755b5ba653841a272d6b15c94c
216dba2cebff322cf7925b44d6eebd05986e7588
refs/heads/master
2021-01-10T09:32:07.494000
2015-12-15T23:05:37
2015-12-15T23:05:37
45,932,201
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.com.sgp.util; public class Constants { public static final String SCRIPT_SELECT_PROJETOS_FINALIZADOS = new StringBuilder() .append(" SELECT COUNT(1) AS COUNT FROM SGPPRD.PROJETO P ") .append(" JOIN SGPPRD.ALOCACAO A ON P.ID_PROJETO = A.ID_PROJETO ") .append(" JOIN SGPPRD.RECURSO R ON A.ID_RECURSO = R.ID_RECURSO ") .append(" WHERE P.DT_FIM IS NOT NULL AND R.ID_RECURSO = ?").toString(); public static final String SCRIPT_SELECT_PROJETOS_PENDENTES = new StringBuilder() .append(" SELECT COUNT(1) AS COUNT FROM SGPPRD.PROJETO P ") .append(" JOIN SGPPRD.ALOCACAO A ON P.ID_PROJETO = A.ID_PROJETO ") .append(" JOIN SGPPRD.RECURSO R ON A.ID_RECURSO = R.ID_RECURSO ") .append(" WHERE P.DT_FIM IS NULL AND R.ID_RECURSO = ?").toString(); public static final String SCRIPT_SELECT_REUNIOES_PENDENTES = new StringBuilder() .append(" SELECT COUNT(1) AS COUNT FROM SGPPRD.REUNIAO R ") .append(" JOIN SGPPRD.RECURSO RE ON RE.ID_RECURSO = R.ID_RECURSO ") .append(" WHERE R.ID_RECURSO = ?").toString(); public static final String SCRIPT_SELECT_REUNIOES = new StringBuilder() .append(" SELECT * FROM SGPPRD.REUNIAO R ") .append(" JOIN SGPPRD.RECURSO RE ON RE.ID_RECURSO = R.ID_RECURSO JOIN SGPPRD.PROJETO P ON R.ID_PROJETO = P.ID_PROJETO ") .append(" WHERE R.ID_RECURSO = ?").toString(); public static final String SCRIPT_SELECT_PROJETOS = new StringBuilder() .append(" SELECT P.ID_PROJETO, P.NM_PROJETO, P.DT_INICIO, P.DT_FIM, SUM(H.VL_HORAS) AS VL_HORAS FROM SGPPRD.PROJETO P LEFT JOIN SGPPRD.HORAS H ON P.ID_PROJETO = H.ID_PROJETO ") .append(" WHERE P.DT_FIM IS NULL ") .append(" GROUP BY P.ID_PROJETO, P.NM_PROJETO, P.DT_INICIO, P.DT_FIM ").toString(); public static final String SCRIPT_SELECT_PROJETOS_RECURSO = new StringBuilder() .append(" SELECT P.ID_PROJETO, P.NM_PROJETO, P.DT_INICIO, P.DT_FIM, SUM(H.VL_HORAS) AS VL_HORAS FROM SGPPRD.PROJETO P JOIN SGPPRD.ALOCACAO A ON P.ID_PROJETO = A.ID_PROJETO LEFT JOIN SGPPRD.HORAS H ON P.ID_PROJETO = H.ID_PROJETO WHERE A.ID_RECURSO = ? GROUP BY P.ID_PROJETO, P.NM_PROJETO, P.DT_INICIO, P.DT_FIM ").toString(); public static final String SCRIPT_SELECT_RECURSOS = new StringBuilder() .append(" SELECT * FROM SGPPRD.RECURSO ").toString(); public static final String SCRIPT_SELECT_RECURSO_PROJETO = new StringBuilder() .append(" SELECT * FROM SGPPRD.PROJETO P JOIN SGPPRD.ALOCACAO A ON P.ID_PROJETO = A.ID_PROJETO WHERE P.ID_PROJETO = ? ").toString(); public static final String SCRIPT_SELECT_HORAS_RECURSO = new StringBuilder() .append(" SELECT H.*, REC.NM_RECURSO, P.NM_PROJETO FROM SGPPRD.HORAS H JOIN SGPPRD.PROJETO P ON H.ID_PROJETO = P.ID_PROJETO JOIN SGPPRD.RECURSO REC ON REC.ID_RECURSO = H.ID_RECURSO ").toString(); public static final String SCRIPT_INSERT_REUNIAO = new StringBuilder() .append(" INSERT INTO SGPPRD.REUNIAO (ID_REUNIAO, ID_PROJETO, DT_INICIO, ID_RECURSO, DT_HORARIO, NM_LOCAL) VALUES (nextval('SGPPRD.REUNIAO_SQ'), ?, ? , ?, ?, ? )").toString(); public static final String SCRIPT_INSERT_PROJETO = new StringBuilder() .append(" INSERT INTO SGPPRD.PROJETO (ID_PROJETO, NM_PROJETO, DT_INICIO) VALUES (nextval('SGPPRD.PROJETO_SQ'), ?, ? )").toString(); public static final String SCRIPT_INSERT_HORAS = new StringBuilder() .append(" INSERT INTO SGPPRD.HORAS (ID_PROJETO, ID_RECURSO, DT_LANCAMENTO, VL_HORAS) VALUES (?, ?, ?, ? )").toString(); public static final String SCRIPT_INSERT_ALOCACAO = new StringBuilder() .append(" INSERT INTO SGPPRD.ALOCACAO (ID_ALOCACAO, ID_PROJETO, ID_RECURSO, DT_INICIO, DT_FIM) VALUES (nextval('SGPPRD.ALOCACAO_SQ'), ?, ?, ?, ? )").toString(); public static final String SCRIPT_INSERT_SESSAO = new StringBuilder() .append(" INSERT INTO SGPPRD.SESSAO (ID_SESSAO, NM_RECURSO) VALUES ( nextval('SGPPRD.SESSAO_SQ'), ? )").toString(); public static final String SCRIPT_SELECT_SESSAO = new StringBuilder() .append(" SELECT * FROM SGPPRD.SESSAO S JOIN SGPPRD.RECURSO R ON S.NM_RECURSO = R.NM_RECURSO ORDER BY 1 DESC LIMIT 1 ").toString(); }
UTF-8
Java
4,011
java
Constants.java
Java
[]
null
[]
package br.com.sgp.util; public class Constants { public static final String SCRIPT_SELECT_PROJETOS_FINALIZADOS = new StringBuilder() .append(" SELECT COUNT(1) AS COUNT FROM SGPPRD.PROJETO P ") .append(" JOIN SGPPRD.ALOCACAO A ON P.ID_PROJETO = A.ID_PROJETO ") .append(" JOIN SGPPRD.RECURSO R ON A.ID_RECURSO = R.ID_RECURSO ") .append(" WHERE P.DT_FIM IS NOT NULL AND R.ID_RECURSO = ?").toString(); public static final String SCRIPT_SELECT_PROJETOS_PENDENTES = new StringBuilder() .append(" SELECT COUNT(1) AS COUNT FROM SGPPRD.PROJETO P ") .append(" JOIN SGPPRD.ALOCACAO A ON P.ID_PROJETO = A.ID_PROJETO ") .append(" JOIN SGPPRD.RECURSO R ON A.ID_RECURSO = R.ID_RECURSO ") .append(" WHERE P.DT_FIM IS NULL AND R.ID_RECURSO = ?").toString(); public static final String SCRIPT_SELECT_REUNIOES_PENDENTES = new StringBuilder() .append(" SELECT COUNT(1) AS COUNT FROM SGPPRD.REUNIAO R ") .append(" JOIN SGPPRD.RECURSO RE ON RE.ID_RECURSO = R.ID_RECURSO ") .append(" WHERE R.ID_RECURSO = ?").toString(); public static final String SCRIPT_SELECT_REUNIOES = new StringBuilder() .append(" SELECT * FROM SGPPRD.REUNIAO R ") .append(" JOIN SGPPRD.RECURSO RE ON RE.ID_RECURSO = R.ID_RECURSO JOIN SGPPRD.PROJETO P ON R.ID_PROJETO = P.ID_PROJETO ") .append(" WHERE R.ID_RECURSO = ?").toString(); public static final String SCRIPT_SELECT_PROJETOS = new StringBuilder() .append(" SELECT P.ID_PROJETO, P.NM_PROJETO, P.DT_INICIO, P.DT_FIM, SUM(H.VL_HORAS) AS VL_HORAS FROM SGPPRD.PROJETO P LEFT JOIN SGPPRD.HORAS H ON P.ID_PROJETO = H.ID_PROJETO ") .append(" WHERE P.DT_FIM IS NULL ") .append(" GROUP BY P.ID_PROJETO, P.NM_PROJETO, P.DT_INICIO, P.DT_FIM ").toString(); public static final String SCRIPT_SELECT_PROJETOS_RECURSO = new StringBuilder() .append(" SELECT P.ID_PROJETO, P.NM_PROJETO, P.DT_INICIO, P.DT_FIM, SUM(H.VL_HORAS) AS VL_HORAS FROM SGPPRD.PROJETO P JOIN SGPPRD.ALOCACAO A ON P.ID_PROJETO = A.ID_PROJETO LEFT JOIN SGPPRD.HORAS H ON P.ID_PROJETO = H.ID_PROJETO WHERE A.ID_RECURSO = ? GROUP BY P.ID_PROJETO, P.NM_PROJETO, P.DT_INICIO, P.DT_FIM ").toString(); public static final String SCRIPT_SELECT_RECURSOS = new StringBuilder() .append(" SELECT * FROM SGPPRD.RECURSO ").toString(); public static final String SCRIPT_SELECT_RECURSO_PROJETO = new StringBuilder() .append(" SELECT * FROM SGPPRD.PROJETO P JOIN SGPPRD.ALOCACAO A ON P.ID_PROJETO = A.ID_PROJETO WHERE P.ID_PROJETO = ? ").toString(); public static final String SCRIPT_SELECT_HORAS_RECURSO = new StringBuilder() .append(" SELECT H.*, REC.NM_RECURSO, P.NM_PROJETO FROM SGPPRD.HORAS H JOIN SGPPRD.PROJETO P ON H.ID_PROJETO = P.ID_PROJETO JOIN SGPPRD.RECURSO REC ON REC.ID_RECURSO = H.ID_RECURSO ").toString(); public static final String SCRIPT_INSERT_REUNIAO = new StringBuilder() .append(" INSERT INTO SGPPRD.REUNIAO (ID_REUNIAO, ID_PROJETO, DT_INICIO, ID_RECURSO, DT_HORARIO, NM_LOCAL) VALUES (nextval('SGPPRD.REUNIAO_SQ'), ?, ? , ?, ?, ? )").toString(); public static final String SCRIPT_INSERT_PROJETO = new StringBuilder() .append(" INSERT INTO SGPPRD.PROJETO (ID_PROJETO, NM_PROJETO, DT_INICIO) VALUES (nextval('SGPPRD.PROJETO_SQ'), ?, ? )").toString(); public static final String SCRIPT_INSERT_HORAS = new StringBuilder() .append(" INSERT INTO SGPPRD.HORAS (ID_PROJETO, ID_RECURSO, DT_LANCAMENTO, VL_HORAS) VALUES (?, ?, ?, ? )").toString(); public static final String SCRIPT_INSERT_ALOCACAO = new StringBuilder() .append(" INSERT INTO SGPPRD.ALOCACAO (ID_ALOCACAO, ID_PROJETO, ID_RECURSO, DT_INICIO, DT_FIM) VALUES (nextval('SGPPRD.ALOCACAO_SQ'), ?, ?, ?, ? )").toString(); public static final String SCRIPT_INSERT_SESSAO = new StringBuilder() .append(" INSERT INTO SGPPRD.SESSAO (ID_SESSAO, NM_RECURSO) VALUES ( nextval('SGPPRD.SESSAO_SQ'), ? )").toString(); public static final String SCRIPT_SELECT_SESSAO = new StringBuilder() .append(" SELECT * FROM SGPPRD.SESSAO S JOIN SGPPRD.RECURSO R ON S.NM_RECURSO = R.NM_RECURSO ORDER BY 1 DESC LIMIT 1 ").toString(); }
4,011
0.716031
0.714784
62
63.69355
59.942604
325
false
false
0
0
0
0
0
0
2.016129
false
false
4
cf5cedb8bea799b6aafbddce587302ef47d91908
17,824,114,289,328
4c160b608af07b81e8b92944c4731842a302329b
/src/main/java/me/rayzr522/hitcounter/HitCounter.java
0940d8fa153d7f2ce9c7e6e6df2895e2adf22910
[]
no_license
rayzr522/HitCounter
https://github.com/rayzr522/HitCounter
e4d74e8ed444f1b31ba3d9e9be4b65bf14e5a6aa
6e9551c2c81974ffe495d74b42131f5252b3739c
refs/heads/master
2022-11-29T09:06:06.406000
2020-08-07T06:02:55
2020-08-07T06:02:55
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package me.rayzr522.hitcounter; import org.bukkit.plugin.java.JavaPlugin; public class HitCounter extends JavaPlugin { @Override public void onEnable() { getServer().getPluginManager().registerEvents(new PlayerListener(this), this); } }
UTF-8
Java
259
java
HitCounter.java
Java
[ { "context": "package me.rayzr522.hitcounter;\n\nimport org.bukkit.plugin.java.JavaPl", "end": 19, "score": 0.9209586977958679, "start": 11, "tag": "USERNAME", "value": "rayzr522" } ]
null
[]
package me.rayzr522.hitcounter; import org.bukkit.plugin.java.JavaPlugin; public class HitCounter extends JavaPlugin { @Override public void onEnable() { getServer().getPluginManager().registerEvents(new PlayerListener(this), this); } }
259
0.733591
0.722008
10
24.9
25.986343
86
false
false
0
0
0
0
0
0
0.4
false
false
4
791ffc7afd6b3df142e4efa7e8a53d25e8fd0caf
9,122,510,592,875
1d6bfe21a951806ef3fd6984fefaf2b66f44b66a
/usr1/arbor/oam_src/ism/agent/ismagent/src/ism/monagent/bp/JProcessSession.java
03fb816ed13d24716b9291f1bb6cd66b28d6ae28
[]
no_license
patrickmcgrory/Projects
https://github.com/patrickmcgrory/Projects
218e1c3ea4f3f57f5f6f218889eb289d927f639e
6a9024efc9cb968df3f5cbd3b5cb8cd5482095d8
refs/heads/master
2018-04-22T06:02:19.798000
2015-11-14T17:30:16
2015-11-14T17:30:16
91,143,423
0
0
null
true
2017-05-13T02:19:23
2017-05-13T02:19:23
2015-11-02T14:45:23
2015-11-14T17:30:51
9,760
0
0
0
null
null
null
/** * Copyright (c) 2002, QCOM Inc. All rights reserved. */ package ism.monagent; //JDK Classes import java.util.*; import java.io.*; import java.net.*; import java.text.*; import java.sql.*; //QCOM Classes import com.qcominc.ms.event.*; import com.qcominc.util.util.*; //ISM Classes import ism.event.*; import ism.ismagent.*; import ism.monagent.util.*; import ism.process.*; //APACHE XML API & Parser Classes //import org.apache.xerces.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; /** * This class defines the Java Process Session to communicate with a Process. * * @author SenthilKumar Muniswamy * @author QCOM, Inc. * @version Since 1.0 */ class JProcessSession extends ProcessSession { private boolean runThread = true; private Vector requestList = null; private Hashtable msgList = null; private Vector responses = null; private ObjectInputStream in = null; private ObjectOutputStream out = null; /** * Constructs JProcessSession. * * @param processServer ProcessServer instance. * @param socket Socket connection established with the Process. * * @exception IllegalArgumentException if the arguments are null. */ JProcessSession(ProcessServer processServer, Socket socket) throws IllegalArgumentException { super(processServer, socket); } /** * Construct and send the IsmDoCommand request message to the process. * * @param msgType request message type. * @param props request message parameters and values. * * @exception MAException if fails to send the request. */ Hashtable sendIsmDoCommand(int msgType, Properties props) throws MAException { //construct the request IsmDoCommand ismDoCmd = new IsmDoCommand(msgType); int seqNum = processServer.genMessageId(); ismDoCmd.setSeqNum(seqNum); IsmPair[] ismPair = null; if(props != null) { ismPair = new IsmPair[props.size()]; int i = 0; for(Enumeration en=props.propertyNames(); en.hasMoreElements();) { String name = (String)en.nextElement(); String value = props.getProperty(name); if(value == null) { value = ""; } ismPair[i++] = new IsmPair(name, value); } } String seqNumVal = String.valueOf(seqNum); requestList.addElement(seqNumVal); long reqtimeout = System.currentTimeMillis() + 5000; ismDoCmd.addIsmPairList(ismPair); //send the request boolean flag = sendObject(ismDoCmd); if(!flag) { throw new MAException("Socket failure."); } while(true) { //wait till the response received or timeouts Integer returnValue = (Integer)msgList.remove(seqNumVal); if(returnValue != null) { //response received int msgtype_retcode = returnValue.intValue(); if(msgtype_retcode == 0) { //request succeeded. No response required for this message. return null; } else if(msgtype_retcode > 0) { //request succeeded. Response required for this message. IsmData response = null; synchronized(responses) { for(int i=0; i<responses.size(); i++) { IsmData resp = (IsmData)responses.elementAt(i); int msgtype = resp.getMessageType(); if(msgtype == msgtype_retcode) { responses.removeElementAt(i); response = resp; break; } } } if(response != null) { Hashtable table = new Hashtable(); IsmPair[] pairs = response.getIsmPairList(); if(pairs != null) { for(int i=0; i<pairs.length; i++) { String name = pairs[i].getName(); String value = pairs[i].getValue(); if(name != null) { if(value == null) { value = ""; } table.put(name, value); } } } return table; } else { return null; } } else { throw new MAException( IsmMonAgentUtil.getErrorString(msgtype_retcode)); } } else { if(System.currentTimeMillis() < reqtimeout) { try { Thread.sleep(25); } catch(InterruptedException ie) { //ignore } } else { return null; } } } } /** * Send the message to the process. * * @param msg request message. */ private boolean sendObject(Object msg) { if(out == null) { return false; } synchronized(out) { try { IsmMonAgentUtil.debug(processName + "->" + msg, IsmMonAgentUtil.INFO); //write the messge out.writeObject(msg); //flushes the stream out.flush(); return true; } catch(ObjectStreamException oe) { IsmMonAgentUtil.debug("Error sending message to process.", IsmMonAgentUtil.CRITICAL); } catch(Exception e) { close(); IsmMonAgentUtil.debug("Error sending message to process.", IsmMonAgentUtil.CRITICAL); } } return false; } /** * Receiver. */ public void run() { requestList = new Vector(); msgList = new Hashtable(); responses = new Vector(); try { in = new ObjectInputStream(socket.getInputStream()); } catch(Exception e) { IsmMonAgentUtil.debug("Unable to create input stream. " + e.getMessage()); runThread = false; } boolean isNotRegistered = true; String str; int alarmCnt = 0; long lastCheckpointTime = System.currentTimeMillis(); Runtime rt = Runtime.getRuntime(); // Due to a bug in Java with the value returned for maxMemory, // if a value is specified on the command line, use it to override // the value returned by the Runtime class. long maxMemory = rt.maxMemory(); str = System.getProperty("maxMemory"); if ( str != null && str.trim().length() > 0 ) { str = str.trim(); int idx; idx = str.indexOf("M"); if(idx < 0) idx = str.indexOf("m"); if(idx < 0) idx = str.indexOf("K"); if(idx < 0) idx = str.indexOf("k"); if(idx < 0) idx = str.indexOf("G"); if(idx < 0) idx = str.indexOf("g"); if ( idx < 0 ) maxMemory = Long.parseLong(str); else { maxMemory = Long.parseLong(str.substring(0, idx)); if ( str.indexOf("M") > 0 || str.indexOf("m") > 0 ) maxMemory = maxMemory * 1024 * 1024; else if ( str.indexOf("K") > 0 || str.indexOf("k") > 0 ) maxMemory = maxMemory * 1024; else if ( str.indexOf("G") > 0 || str.indexOf("g") > 0 ) maxMemory = maxMemory * 1024 * 1024 * 1024; } } int CHECKPOINT = 500; // Memory threshold levels and associated sleep times int mem1thr = 50; int mem2thr = 60; int mem3thr = 70; int mem4thr = 80; int mem1sleep = 500; int mem2sleep = 1000; int mem3sleep = 2000; int mem4sleep = 5000; // Process time threshold levels and associated sleep times int proc1thr = 500; int proc2thr = 1000; int proc1sleep = 500; int proc2sleep = 250; // Sleep time for Central Controller suppression request. int suppressSleep = 500; int suppressCnt = 0; // Check for override values in the MonAgent.xml configuration file Document confdoc = processServer.getConfDoc(); if ( confdoc != null ) { str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/checkpoint"); if ( str != null ) CHECKPOINT = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem1thr"); if ( str != null ) mem1thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem2thr"); if ( str != null ) mem2thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem3thr"); if ( str != null ) mem3thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem4thr"); if ( str != null ) mem4thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem1sleep"); if ( str != null ) mem1sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem2sleep"); if ( str != null ) mem2sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem3sleep"); if ( str != null ) mem3sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem4sleep"); if ( str != null ) mem4sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/proc1thr"); if ( str != null ) proc1thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/proc2thr"); if ( str != null ) proc2thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/proc1sleep"); if ( str != null ) proc1sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/proc2sleep"); if ( str != null ) proc2sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/forcedHeartbeatTimeout"); if ( str != null ) setForcedHeartbeatTimeout( Integer.parseInt(str)); } //process the message received from the process while(runThread) { Object obj = null; try { obj = in.readObject(); } catch(InterruptedIOException ie) { if(runThread) { continue; } else { break; } } catch(ClassNotFoundException ce) { if(runThread) { continue; } else { break; } } catch(ObjectStreamException oe) { if(runThread) { continue; } else { break; } } catch(Exception e) { IsmMonAgentUtil.debug("Error reading message." + e.getMessage(), IsmMonAgentUtil.CRITICAL); break; } if(obj == null) { continue; } IsmMonAgentUtil.debug(obj, IsmMonAgentUtil.INFO); try { if(isNotRegistered && !(obj instanceof IsmRegistrationInfo)) { continue; } if(obj instanceof IsmAlarmMsg) { //process alarm processIsmMsgAlarm((IsmAlarmMsg)obj); alarmCnt++; } else if(obj instanceof IsmHeartbeat) { setHeartbeatExpTime(System.currentTimeMillis() + getHeartbeat()); if(isForcedHeartbeatRequested) { isForcedHeartbeatRequested = false; } } else if(obj instanceof IsmQueryData) { try { processIsmMsgQueryData((IsmQueryData)obj); } catch(MAException e) { IsmMonAgentUtil.debug(e.getMessage(), IsmMonAgentUtil.MAJOR); break; } } else if(obj instanceof IsmData) { synchronized(responses) { IsmData ismData = (IsmData)obj; if(ismData.getMessageType() == ISM_PGEVENT) { processPGEvent(ismData); } else if(ismData.getMessageType() == ISM_BICEVENT) { sendBICEvent(ismData); } else { responses.addElement(ismData); } } } else if(obj instanceof IsmRegistrationInfo) { if(out == null) { try { out = new ObjectOutputStream( socket.getOutputStream()); } catch(Exception e) { IsmMonAgentUtil.debug( "Unable to create output stream. " + e.getMessage(), IsmMonAgentUtil.CRITICAL); break; } } try { processIsmMsgRegInfo((IsmRegistrationInfo)obj); } catch(Exception e) { IsmMonAgentUtil.debug(e.getMessage(), IsmMonAgentUtil.MAJOR); break; } isNotRegistered = false; } else if(obj instanceof IsmDisconnect) { IsmMonAgentUtil.debug("Disconnect request received for " + processName, IsmMonAgentUtil.INFO); break; } else { IsmMonAgentUtil.debug(obj + " message is not supported.", IsmMonAgentUtil.WARNING); } // Check if the Central Controller EventServer has // ordered us to stop sending alarms if ( processServer.getEventSuppression() == true ) { if ( (suppressCnt % 10) == 0 ) { String xxx = "CC JSUPPRESS: proc=" + processName + " time=" + (suppressCnt * suppressSleep); IsmMonAgentUtil.debug(xxx, IsmMonAgentUtil.MAJOR); } // While in suppression mode, keep resetting the // heartbeat timer so that the HeartbeatMonitor // doesn't think we are hung. setHeartbeatExpTime(System.currentTimeMillis() + getHeartbeat()); isForcedHeartbeatRequested = false; // Sleep for a while to stop reading messages from // the client process. try { Thread.sleep(suppressSleep); } catch(Exception e) { //ignore } suppressCnt++; continue; } else { if ( suppressCnt > 0 ) { String xxx = "CC JUNSUPPRESS: proc=" + processName; IsmMonAgentUtil.debug(xxx, IsmMonAgentUtil.MAJOR); } suppressCnt = 0; } if ( alarmCnt >= CHECKPOINT ) { long checkpointTime = System.currentTimeMillis(); long usedMemory = rt.totalMemory() - rt.freeMemory(); long availableMemory = maxMemory - usedMemory; long percentUsed = (100*usedMemory)/maxMemory; if ( percentUsed > mem1thr ) { // Everybody sleeps int sleepTime = mem1sleep; if ( percentUsed > mem4thr ) sleepTime = mem4sleep; else if ( percentUsed > mem3thr ) sleepTime = mem3sleep; else if ( percentUsed > mem2thr ) sleepTime = mem2sleep; else sleepTime = mem1sleep; if ( (checkpointTime - lastCheckpointTime) < proc1thr ) sleepTime += proc1sleep; else if ( (checkpointTime - lastCheckpointTime) < proc2thr ) sleepTime += proc2sleep; String xxx = "JCHECKPOINT: max=" + maxMemory + " used=" + usedMemory + " avail=" + availableMemory + " percUsed=" + percentUsed + " sleep=" + sleepTime + " cnt=" + alarmCnt; IsmMonAgentUtil.debug(xxx, IsmMonAgentUtil.INFO); try { Thread.sleep(sleepTime); } catch(Exception e) { //ignore } } else { String xxx = "JCHECKPOINT: max=" + maxMemory + " used=" + usedMemory + " avail=" + availableMemory + " percUsed=" + percentUsed + " sleep=" + 0 + " cnt=" + alarmCnt; IsmMonAgentUtil.debug(xxx, IsmMonAgentUtil.INFO); } alarmCnt = 0; lastCheckpointTime = System.currentTimeMillis(); } } catch(Exception e) { e.printStackTrace(); } } close(); setHeartbeatExpTime(System.currentTimeMillis()); if(processName == null) { processServer.removeProcessSession(this); } if(processName != null) { ProcessInfo processInfo = processServer.getProcessInfo(processName); if(processInfo != null && !processInfo.isMonitored()) { processServer.removeProcessSession(this); processServer.removeProcessInfo(processName); StateChangeEvent event = new StateChangeEvent( IsmMonitoringAgentImpl.genEventId(), "ProcessStateChange", IsmMonitoringAgentImpl.hostaddress + "/" + processName, "Unmonitored process disconnected. ", Calendar.getInstance().getTime(), null, "ProcessStateChange", ProcessInfo.DIED); processServer.sendEvent(event); } } if(processName != null && processName.equalsIgnoreCase( IsmMonitoringAgentImpl.datablitzName)) { String state = ProcessInfo.NOTCONNECTED; DataBlitzTask.setState(state); StateChangeEvent event = new StateChangeEvent( IsmMonitoringAgentImpl.genEventId(), "DbStateChange", IsmMonitoringAgentImpl.hostaddress + "/" + DatabaseInfo.DATABLITZ, "DataBlitz is offline. " + "Process is not running.", Calendar.getInstance().getTime(), null, "DbStateChange", state); processServer.sendEvent(event); } } /** * Process the ism process registration information. * * @param regInfo process registration info. * * @exception MAException if fails to send the response message. */ private void processIsmMsgRegInfo(IsmRegistrationInfo regInfo) throws MAException { String processName = regInfo.getProcessName(); if(processServer.getProcessSession(processName) != null) { throw new MAException("Duplicate process name " + processName); } this.processName = processName; setName(processName); ProcessInfo processInfo = processServer.getProcessInfo(processName); moduleName = regInfo.getModuleName(); if(processInfo == null) { //throw new MAException(processName + // " not found in process list."); int pid = regInfo.getPID(); String state = ProcessInfo.RUNNING; long time = System.currentTimeMillis(); String description = "New process connected."; processInfo = new BatchProcessInfo(processName, moduleName, pid, state, -1, time, description, 30000, false); synchronized(processInfo) { processServer.addProcessInfo(processInfo); //send a state change event to the client StateChangeEvent event = new StateChangeEvent( IsmMonitoringAgentImpl.genEventId(), "ProcessStateChange", IsmMonitoringAgentImpl.hostaddress + "/" + processName, description, new java.util.Date(time), null, "ProcessStateChange", state); processServer.sendEvent(event); IsmMonAgentUtil.debug(event, IsmMonAgentUtil.INFO); } } synchronized(processInfo) { //change the state if the process is in notconnected state if(processInfo.getState().equals(ProcessInfo.NOTCONNECTED)) { long time = System.currentTimeMillis(); String state = ProcessInfo.RUNNING; String description = "Process connected."; processServer.setProcessInfo(processName, moduleName, processInfo.getPID(), state, processInfo.getExitCode(), time, description, processInfo.getHeartbeat()); StateChangeEvent event = new StateChangeEvent( IsmMonitoringAgentImpl.genEventId(), "ProcessStateChange", IsmMonitoringAgentImpl.hostaddress + "/" + processName, description, new java.util.Date(time), null, "ProcessStateChange", state); processServer.sendEvent(event); } processInfo.setModuleName(moduleName); version = regInfo.getVersion(); dbServerId = regInfo.getDbServerId(); portNumber = regInfo.getPortNumber(); long processheatbeat = processInfo.getHeartbeat(); if(processheatbeat <= 0) {//never happens but ... processheatbeat = 30000; processInfo.setHeartbeat(processheatbeat); } setHeartbeat(processheatbeat); setHeartbeatExpTime(System.currentTimeMillis() + getHeartbeat()); } processServer.addProcessSession(this); sendObject(new IsmHeartbeat((int)(getHeartbeat()/1000))); if(processName.equalsIgnoreCase( IsmMonitoringAgentImpl.datablitzName)) { try { DataBlitzTask.getDataBlitzState(processName, processServer); } catch(Exception e) { //ignore } } } /** * Process the process alarm message. * * @param alarm process alarm message. * * @exception MAException if fails to send the response message. */ private void processIsmMsgAlarm(IsmAlarmMsg alarm) { sendProcessAlarm(alarm.getMessageNumber(), alarm.getProcessName(), alarm.getSeverity(), alarm.getOccurrenceDate(), alarm.getDescription()); } /** * Process ism query data request message. * * @param msgprops ism query data request. */ private void processIsmMsgQueryData(IsmQueryData queryData) throws MAException { String[] moduleList = queryData.getModuleNameList(); ProcessSession[] sessions = processServer.getAllProcessSession(); Vector regInfoList = new Vector(); //construct the response with requested modules information for(int i=0; i<moduleList.length; i++) { String moduleName = moduleList[i]; for(int j=0; j<sessions.length; j++) { ProcessSession session = sessions[j]; if(moduleName.equals(session.moduleName)) { regInfoList.addElement(new IsmRegistrationInfo( session.version, session.moduleName, session.processName, session.dbServerId, session.portNumber)); } } } IsmRegistrationInfo[] regInfo = new IsmRegistrationInfo[regInfoList.size()]; regInfoList.copyInto(regInfo); sendObject(regInfo); } /** * Process process group event message. * * @param ismData IsmData message. */ private void processPGEvent(IsmData ismData) { int process_id = 0; int activity_status = 0; int work_status = 0; int work_rate_status = 0; java.util.Date sched_start_time = null; java.util.Date start_time = null; java.util.Date end_time = null; IsmPair[] ismPairs = ismData.getIsmPairList(); for(int i=0; i<ismPairs.length; i++) { IsmPair ismPair = ismPairs[i]; String name = ismPair.getName(); if(name.equals("process_id")) { String process_id_str = ismPair.getValue(); if(process_id_str != null) { process_id = Integer.parseInt(process_id_str); } } else if(name.equals("activity_status")) { String activity_status_str = ismPair.getValue(); if(activity_status_str != null) { activity_status = Integer.parseInt(activity_status_str); } } else if(name.equals("work_status")) { String work_status_str = ismPair.getValue(); if(work_status_str != null) { work_status = Integer.parseInt(work_status_str); } } else if(name.equals("work_rate_status")) { String work_rate_status_str = ismPair.getValue(); if(work_rate_status_str != null) { work_rate_status = Integer.parseInt(work_rate_status_str); } } else if(name.equals("sched_start_time")) { String sched_start_time_str = ismPair.getValue(); if(sched_start_time_str != null) { sched_start_time = convertDate(sched_start_time_str); } } else if(name.equals("start_time")) { String start_time_str = ismPair.getValue(); if(start_time_str != null) { start_time = convertDate(start_time_str); } } else if(name.equals("end_time")) { String end_time_str = ismPair.getValue(); if(end_time_str != null) { end_time = convertDate(end_time_str); } } } sendPwStatusUpdate(process_id, activity_status, work_status, work_rate_status, sched_start_time, start_time, end_time); } /** * Process ism docommand response message and add to the response list. * * @param ismData ism docommand response message. */ private void processIsmMsgDoCommand(IsmDoCommand ismDoCommand) { int msgtype = ismDoCommand.getMessageType(); int seqnum = ismDoCommand.getSeqNum(); int msgtype_retcode = ismDoCommand.getReturnCode(); if(msgtype_retcode >= 0) { switch(msgtype) { case 3: case 5: case 51: msgtype_retcode = msgtype; break; case 90: msgtype_retcode = 1; break; case 1: case 2: case 4: case 6: case 7: case 8: case 9: case 10: case 50: case 60: case 70: case 71: case 72: case 73: case 80: default: msgtype_retcode = 0; break; } } msgList.put(String.valueOf(seqnum), new Integer(msgtype_retcode)); } /** * Sends the Heartbeat request to the Process. */ protected void sendHeartbeatRequest() { isForcedHeartbeatRequested = true; sendObject(new IsmForcedHeartbeat()); IsmMonAgentUtil.debug("Send ForcedHeartbeat request for " + processName, IsmMonAgentUtil.MINOR); } /** * Stop this session. */ void close() { runThread = false; try { in.close(); } catch(Exception e) { } in = null; try { out.close(); } catch(Exception e) { } out = null; try { socket.close(); } catch(Exception e) { } socket = null; } }
UTF-8
Java
29,901
java
JProcessSession.java
Java
[ { "context": "sion to communicate with a Process.\n * \n * @author SenthilKumar Muniswamy\n * @author QCOM, Inc.\n * @version Since 1.0\n */\nc", "end": 620, "score": 0.9998623728752136, "start": 598, "tag": "NAME", "value": "SenthilKumar Muniswamy" } ]
null
[]
/** * Copyright (c) 2002, QCOM Inc. All rights reserved. */ package ism.monagent; //JDK Classes import java.util.*; import java.io.*; import java.net.*; import java.text.*; import java.sql.*; //QCOM Classes import com.qcominc.ms.event.*; import com.qcominc.util.util.*; //ISM Classes import ism.event.*; import ism.ismagent.*; import ism.monagent.util.*; import ism.process.*; //APACHE XML API & Parser Classes //import org.apache.xerces.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; /** * This class defines the Java Process Session to communicate with a Process. * * @author <NAME> * @author QCOM, Inc. * @version Since 1.0 */ class JProcessSession extends ProcessSession { private boolean runThread = true; private Vector requestList = null; private Hashtable msgList = null; private Vector responses = null; private ObjectInputStream in = null; private ObjectOutputStream out = null; /** * Constructs JProcessSession. * * @param processServer ProcessServer instance. * @param socket Socket connection established with the Process. * * @exception IllegalArgumentException if the arguments are null. */ JProcessSession(ProcessServer processServer, Socket socket) throws IllegalArgumentException { super(processServer, socket); } /** * Construct and send the IsmDoCommand request message to the process. * * @param msgType request message type. * @param props request message parameters and values. * * @exception MAException if fails to send the request. */ Hashtable sendIsmDoCommand(int msgType, Properties props) throws MAException { //construct the request IsmDoCommand ismDoCmd = new IsmDoCommand(msgType); int seqNum = processServer.genMessageId(); ismDoCmd.setSeqNum(seqNum); IsmPair[] ismPair = null; if(props != null) { ismPair = new IsmPair[props.size()]; int i = 0; for(Enumeration en=props.propertyNames(); en.hasMoreElements();) { String name = (String)en.nextElement(); String value = props.getProperty(name); if(value == null) { value = ""; } ismPair[i++] = new IsmPair(name, value); } } String seqNumVal = String.valueOf(seqNum); requestList.addElement(seqNumVal); long reqtimeout = System.currentTimeMillis() + 5000; ismDoCmd.addIsmPairList(ismPair); //send the request boolean flag = sendObject(ismDoCmd); if(!flag) { throw new MAException("Socket failure."); } while(true) { //wait till the response received or timeouts Integer returnValue = (Integer)msgList.remove(seqNumVal); if(returnValue != null) { //response received int msgtype_retcode = returnValue.intValue(); if(msgtype_retcode == 0) { //request succeeded. No response required for this message. return null; } else if(msgtype_retcode > 0) { //request succeeded. Response required for this message. IsmData response = null; synchronized(responses) { for(int i=0; i<responses.size(); i++) { IsmData resp = (IsmData)responses.elementAt(i); int msgtype = resp.getMessageType(); if(msgtype == msgtype_retcode) { responses.removeElementAt(i); response = resp; break; } } } if(response != null) { Hashtable table = new Hashtable(); IsmPair[] pairs = response.getIsmPairList(); if(pairs != null) { for(int i=0; i<pairs.length; i++) { String name = pairs[i].getName(); String value = pairs[i].getValue(); if(name != null) { if(value == null) { value = ""; } table.put(name, value); } } } return table; } else { return null; } } else { throw new MAException( IsmMonAgentUtil.getErrorString(msgtype_retcode)); } } else { if(System.currentTimeMillis() < reqtimeout) { try { Thread.sleep(25); } catch(InterruptedException ie) { //ignore } } else { return null; } } } } /** * Send the message to the process. * * @param msg request message. */ private boolean sendObject(Object msg) { if(out == null) { return false; } synchronized(out) { try { IsmMonAgentUtil.debug(processName + "->" + msg, IsmMonAgentUtil.INFO); //write the messge out.writeObject(msg); //flushes the stream out.flush(); return true; } catch(ObjectStreamException oe) { IsmMonAgentUtil.debug("Error sending message to process.", IsmMonAgentUtil.CRITICAL); } catch(Exception e) { close(); IsmMonAgentUtil.debug("Error sending message to process.", IsmMonAgentUtil.CRITICAL); } } return false; } /** * Receiver. */ public void run() { requestList = new Vector(); msgList = new Hashtable(); responses = new Vector(); try { in = new ObjectInputStream(socket.getInputStream()); } catch(Exception e) { IsmMonAgentUtil.debug("Unable to create input stream. " + e.getMessage()); runThread = false; } boolean isNotRegistered = true; String str; int alarmCnt = 0; long lastCheckpointTime = System.currentTimeMillis(); Runtime rt = Runtime.getRuntime(); // Due to a bug in Java with the value returned for maxMemory, // if a value is specified on the command line, use it to override // the value returned by the Runtime class. long maxMemory = rt.maxMemory(); str = System.getProperty("maxMemory"); if ( str != null && str.trim().length() > 0 ) { str = str.trim(); int idx; idx = str.indexOf("M"); if(idx < 0) idx = str.indexOf("m"); if(idx < 0) idx = str.indexOf("K"); if(idx < 0) idx = str.indexOf("k"); if(idx < 0) idx = str.indexOf("G"); if(idx < 0) idx = str.indexOf("g"); if ( idx < 0 ) maxMemory = Long.parseLong(str); else { maxMemory = Long.parseLong(str.substring(0, idx)); if ( str.indexOf("M") > 0 || str.indexOf("m") > 0 ) maxMemory = maxMemory * 1024 * 1024; else if ( str.indexOf("K") > 0 || str.indexOf("k") > 0 ) maxMemory = maxMemory * 1024; else if ( str.indexOf("G") > 0 || str.indexOf("g") > 0 ) maxMemory = maxMemory * 1024 * 1024 * 1024; } } int CHECKPOINT = 500; // Memory threshold levels and associated sleep times int mem1thr = 50; int mem2thr = 60; int mem3thr = 70; int mem4thr = 80; int mem1sleep = 500; int mem2sleep = 1000; int mem3sleep = 2000; int mem4sleep = 5000; // Process time threshold levels and associated sleep times int proc1thr = 500; int proc2thr = 1000; int proc1sleep = 500; int proc2sleep = 250; // Sleep time for Central Controller suppression request. int suppressSleep = 500; int suppressCnt = 0; // Check for override values in the MonAgent.xml configuration file Document confdoc = processServer.getConfDoc(); if ( confdoc != null ) { str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/checkpoint"); if ( str != null ) CHECKPOINT = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem1thr"); if ( str != null ) mem1thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem2thr"); if ( str != null ) mem2thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem3thr"); if ( str != null ) mem3thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem4thr"); if ( str != null ) mem4thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem1sleep"); if ( str != null ) mem1sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem2sleep"); if ( str != null ) mem2sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem3sleep"); if ( str != null ) mem3sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/mem4sleep"); if ( str != null ) mem4sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/proc1thr"); if ( str != null ) proc1thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/proc2thr"); if ( str != null ) proc2thr = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/proc1sleep"); if ( str != null ) proc1sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/proc2sleep"); if ( str != null ) proc2sleep = Integer.parseInt(str); str = XmlDocUtil.getNodeValue(confdoc, "MA/ProcessServer/forcedHeartbeatTimeout"); if ( str != null ) setForcedHeartbeatTimeout( Integer.parseInt(str)); } //process the message received from the process while(runThread) { Object obj = null; try { obj = in.readObject(); } catch(InterruptedIOException ie) { if(runThread) { continue; } else { break; } } catch(ClassNotFoundException ce) { if(runThread) { continue; } else { break; } } catch(ObjectStreamException oe) { if(runThread) { continue; } else { break; } } catch(Exception e) { IsmMonAgentUtil.debug("Error reading message." + e.getMessage(), IsmMonAgentUtil.CRITICAL); break; } if(obj == null) { continue; } IsmMonAgentUtil.debug(obj, IsmMonAgentUtil.INFO); try { if(isNotRegistered && !(obj instanceof IsmRegistrationInfo)) { continue; } if(obj instanceof IsmAlarmMsg) { //process alarm processIsmMsgAlarm((IsmAlarmMsg)obj); alarmCnt++; } else if(obj instanceof IsmHeartbeat) { setHeartbeatExpTime(System.currentTimeMillis() + getHeartbeat()); if(isForcedHeartbeatRequested) { isForcedHeartbeatRequested = false; } } else if(obj instanceof IsmQueryData) { try { processIsmMsgQueryData((IsmQueryData)obj); } catch(MAException e) { IsmMonAgentUtil.debug(e.getMessage(), IsmMonAgentUtil.MAJOR); break; } } else if(obj instanceof IsmData) { synchronized(responses) { IsmData ismData = (IsmData)obj; if(ismData.getMessageType() == ISM_PGEVENT) { processPGEvent(ismData); } else if(ismData.getMessageType() == ISM_BICEVENT) { sendBICEvent(ismData); } else { responses.addElement(ismData); } } } else if(obj instanceof IsmRegistrationInfo) { if(out == null) { try { out = new ObjectOutputStream( socket.getOutputStream()); } catch(Exception e) { IsmMonAgentUtil.debug( "Unable to create output stream. " + e.getMessage(), IsmMonAgentUtil.CRITICAL); break; } } try { processIsmMsgRegInfo((IsmRegistrationInfo)obj); } catch(Exception e) { IsmMonAgentUtil.debug(e.getMessage(), IsmMonAgentUtil.MAJOR); break; } isNotRegistered = false; } else if(obj instanceof IsmDisconnect) { IsmMonAgentUtil.debug("Disconnect request received for " + processName, IsmMonAgentUtil.INFO); break; } else { IsmMonAgentUtil.debug(obj + " message is not supported.", IsmMonAgentUtil.WARNING); } // Check if the Central Controller EventServer has // ordered us to stop sending alarms if ( processServer.getEventSuppression() == true ) { if ( (suppressCnt % 10) == 0 ) { String xxx = "CC JSUPPRESS: proc=" + processName + " time=" + (suppressCnt * suppressSleep); IsmMonAgentUtil.debug(xxx, IsmMonAgentUtil.MAJOR); } // While in suppression mode, keep resetting the // heartbeat timer so that the HeartbeatMonitor // doesn't think we are hung. setHeartbeatExpTime(System.currentTimeMillis() + getHeartbeat()); isForcedHeartbeatRequested = false; // Sleep for a while to stop reading messages from // the client process. try { Thread.sleep(suppressSleep); } catch(Exception e) { //ignore } suppressCnt++; continue; } else { if ( suppressCnt > 0 ) { String xxx = "CC JUNSUPPRESS: proc=" + processName; IsmMonAgentUtil.debug(xxx, IsmMonAgentUtil.MAJOR); } suppressCnt = 0; } if ( alarmCnt >= CHECKPOINT ) { long checkpointTime = System.currentTimeMillis(); long usedMemory = rt.totalMemory() - rt.freeMemory(); long availableMemory = maxMemory - usedMemory; long percentUsed = (100*usedMemory)/maxMemory; if ( percentUsed > mem1thr ) { // Everybody sleeps int sleepTime = mem1sleep; if ( percentUsed > mem4thr ) sleepTime = mem4sleep; else if ( percentUsed > mem3thr ) sleepTime = mem3sleep; else if ( percentUsed > mem2thr ) sleepTime = mem2sleep; else sleepTime = mem1sleep; if ( (checkpointTime - lastCheckpointTime) < proc1thr ) sleepTime += proc1sleep; else if ( (checkpointTime - lastCheckpointTime) < proc2thr ) sleepTime += proc2sleep; String xxx = "JCHECKPOINT: max=" + maxMemory + " used=" + usedMemory + " avail=" + availableMemory + " percUsed=" + percentUsed + " sleep=" + sleepTime + " cnt=" + alarmCnt; IsmMonAgentUtil.debug(xxx, IsmMonAgentUtil.INFO); try { Thread.sleep(sleepTime); } catch(Exception e) { //ignore } } else { String xxx = "JCHECKPOINT: max=" + maxMemory + " used=" + usedMemory + " avail=" + availableMemory + " percUsed=" + percentUsed + " sleep=" + 0 + " cnt=" + alarmCnt; IsmMonAgentUtil.debug(xxx, IsmMonAgentUtil.INFO); } alarmCnt = 0; lastCheckpointTime = System.currentTimeMillis(); } } catch(Exception e) { e.printStackTrace(); } } close(); setHeartbeatExpTime(System.currentTimeMillis()); if(processName == null) { processServer.removeProcessSession(this); } if(processName != null) { ProcessInfo processInfo = processServer.getProcessInfo(processName); if(processInfo != null && !processInfo.isMonitored()) { processServer.removeProcessSession(this); processServer.removeProcessInfo(processName); StateChangeEvent event = new StateChangeEvent( IsmMonitoringAgentImpl.genEventId(), "ProcessStateChange", IsmMonitoringAgentImpl.hostaddress + "/" + processName, "Unmonitored process disconnected. ", Calendar.getInstance().getTime(), null, "ProcessStateChange", ProcessInfo.DIED); processServer.sendEvent(event); } } if(processName != null && processName.equalsIgnoreCase( IsmMonitoringAgentImpl.datablitzName)) { String state = ProcessInfo.NOTCONNECTED; DataBlitzTask.setState(state); StateChangeEvent event = new StateChangeEvent( IsmMonitoringAgentImpl.genEventId(), "DbStateChange", IsmMonitoringAgentImpl.hostaddress + "/" + DatabaseInfo.DATABLITZ, "DataBlitz is offline. " + "Process is not running.", Calendar.getInstance().getTime(), null, "DbStateChange", state); processServer.sendEvent(event); } } /** * Process the ism process registration information. * * @param regInfo process registration info. * * @exception MAException if fails to send the response message. */ private void processIsmMsgRegInfo(IsmRegistrationInfo regInfo) throws MAException { String processName = regInfo.getProcessName(); if(processServer.getProcessSession(processName) != null) { throw new MAException("Duplicate process name " + processName); } this.processName = processName; setName(processName); ProcessInfo processInfo = processServer.getProcessInfo(processName); moduleName = regInfo.getModuleName(); if(processInfo == null) { //throw new MAException(processName + // " not found in process list."); int pid = regInfo.getPID(); String state = ProcessInfo.RUNNING; long time = System.currentTimeMillis(); String description = "New process connected."; processInfo = new BatchProcessInfo(processName, moduleName, pid, state, -1, time, description, 30000, false); synchronized(processInfo) { processServer.addProcessInfo(processInfo); //send a state change event to the client StateChangeEvent event = new StateChangeEvent( IsmMonitoringAgentImpl.genEventId(), "ProcessStateChange", IsmMonitoringAgentImpl.hostaddress + "/" + processName, description, new java.util.Date(time), null, "ProcessStateChange", state); processServer.sendEvent(event); IsmMonAgentUtil.debug(event, IsmMonAgentUtil.INFO); } } synchronized(processInfo) { //change the state if the process is in notconnected state if(processInfo.getState().equals(ProcessInfo.NOTCONNECTED)) { long time = System.currentTimeMillis(); String state = ProcessInfo.RUNNING; String description = "Process connected."; processServer.setProcessInfo(processName, moduleName, processInfo.getPID(), state, processInfo.getExitCode(), time, description, processInfo.getHeartbeat()); StateChangeEvent event = new StateChangeEvent( IsmMonitoringAgentImpl.genEventId(), "ProcessStateChange", IsmMonitoringAgentImpl.hostaddress + "/" + processName, description, new java.util.Date(time), null, "ProcessStateChange", state); processServer.sendEvent(event); } processInfo.setModuleName(moduleName); version = regInfo.getVersion(); dbServerId = regInfo.getDbServerId(); portNumber = regInfo.getPortNumber(); long processheatbeat = processInfo.getHeartbeat(); if(processheatbeat <= 0) {//never happens but ... processheatbeat = 30000; processInfo.setHeartbeat(processheatbeat); } setHeartbeat(processheatbeat); setHeartbeatExpTime(System.currentTimeMillis() + getHeartbeat()); } processServer.addProcessSession(this); sendObject(new IsmHeartbeat((int)(getHeartbeat()/1000))); if(processName.equalsIgnoreCase( IsmMonitoringAgentImpl.datablitzName)) { try { DataBlitzTask.getDataBlitzState(processName, processServer); } catch(Exception e) { //ignore } } } /** * Process the process alarm message. * * @param alarm process alarm message. * * @exception MAException if fails to send the response message. */ private void processIsmMsgAlarm(IsmAlarmMsg alarm) { sendProcessAlarm(alarm.getMessageNumber(), alarm.getProcessName(), alarm.getSeverity(), alarm.getOccurrenceDate(), alarm.getDescription()); } /** * Process ism query data request message. * * @param msgprops ism query data request. */ private void processIsmMsgQueryData(IsmQueryData queryData) throws MAException { String[] moduleList = queryData.getModuleNameList(); ProcessSession[] sessions = processServer.getAllProcessSession(); Vector regInfoList = new Vector(); //construct the response with requested modules information for(int i=0; i<moduleList.length; i++) { String moduleName = moduleList[i]; for(int j=0; j<sessions.length; j++) { ProcessSession session = sessions[j]; if(moduleName.equals(session.moduleName)) { regInfoList.addElement(new IsmRegistrationInfo( session.version, session.moduleName, session.processName, session.dbServerId, session.portNumber)); } } } IsmRegistrationInfo[] regInfo = new IsmRegistrationInfo[regInfoList.size()]; regInfoList.copyInto(regInfo); sendObject(regInfo); } /** * Process process group event message. * * @param ismData IsmData message. */ private void processPGEvent(IsmData ismData) { int process_id = 0; int activity_status = 0; int work_status = 0; int work_rate_status = 0; java.util.Date sched_start_time = null; java.util.Date start_time = null; java.util.Date end_time = null; IsmPair[] ismPairs = ismData.getIsmPairList(); for(int i=0; i<ismPairs.length; i++) { IsmPair ismPair = ismPairs[i]; String name = ismPair.getName(); if(name.equals("process_id")) { String process_id_str = ismPair.getValue(); if(process_id_str != null) { process_id = Integer.parseInt(process_id_str); } } else if(name.equals("activity_status")) { String activity_status_str = ismPair.getValue(); if(activity_status_str != null) { activity_status = Integer.parseInt(activity_status_str); } } else if(name.equals("work_status")) { String work_status_str = ismPair.getValue(); if(work_status_str != null) { work_status = Integer.parseInt(work_status_str); } } else if(name.equals("work_rate_status")) { String work_rate_status_str = ismPair.getValue(); if(work_rate_status_str != null) { work_rate_status = Integer.parseInt(work_rate_status_str); } } else if(name.equals("sched_start_time")) { String sched_start_time_str = ismPair.getValue(); if(sched_start_time_str != null) { sched_start_time = convertDate(sched_start_time_str); } } else if(name.equals("start_time")) { String start_time_str = ismPair.getValue(); if(start_time_str != null) { start_time = convertDate(start_time_str); } } else if(name.equals("end_time")) { String end_time_str = ismPair.getValue(); if(end_time_str != null) { end_time = convertDate(end_time_str); } } } sendPwStatusUpdate(process_id, activity_status, work_status, work_rate_status, sched_start_time, start_time, end_time); } /** * Process ism docommand response message and add to the response list. * * @param ismData ism docommand response message. */ private void processIsmMsgDoCommand(IsmDoCommand ismDoCommand) { int msgtype = ismDoCommand.getMessageType(); int seqnum = ismDoCommand.getSeqNum(); int msgtype_retcode = ismDoCommand.getReturnCode(); if(msgtype_retcode >= 0) { switch(msgtype) { case 3: case 5: case 51: msgtype_retcode = msgtype; break; case 90: msgtype_retcode = 1; break; case 1: case 2: case 4: case 6: case 7: case 8: case 9: case 10: case 50: case 60: case 70: case 71: case 72: case 73: case 80: default: msgtype_retcode = 0; break; } } msgList.put(String.valueOf(seqnum), new Integer(msgtype_retcode)); } /** * Sends the Heartbeat request to the Process. */ protected void sendHeartbeatRequest() { isForcedHeartbeatRequested = true; sendObject(new IsmForcedHeartbeat()); IsmMonAgentUtil.debug("Send ForcedHeartbeat request for " + processName, IsmMonAgentUtil.MINOR); } /** * Stop this session. */ void close() { runThread = false; try { in.close(); } catch(Exception e) { } in = null; try { out.close(); } catch(Exception e) { } out = null; try { socket.close(); } catch(Exception e) { } socket = null; } }
29,885
0.505468
0.498311
887
32.710258
22.529613
92
false
false
0
0
0
0
0
0
0.862458
false
false
4
b364d7e5662a94068d220475788795da47ae72fb
28,759,101,014,306
16358360fe1cf527fcf45e1cf13bbf2e441b530c
/core/citrus-spring/src/main/java/org/citrusframework/config/CitrusNamespaceParserRegistry.java
182ad494f8d1597067276302e2f7293f7c023018
[ "Apache-2.0" ]
permissive
citrusframework/citrus
https://github.com/citrusframework/citrus
cc08796208428fe29ae0502ff7da340cc70b5a6c
dd8d57602d77cb6cc10c8793b8f7aa00f1e99a4a
refs/heads/main
2023-08-26T16:25:20.966000
2023-08-21T13:39:31
2023-08-21T18:36:14
500,806
232
95
Apache-2.0
false
2023-09-12T11:33:21
2010-02-03T15:32:30
2023-09-05T09:43:29
2023-09-12T11:33:21
81,514
403
131
153
Java
false
false
/* * Copyright 2006-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.citrusframework.config; import java.util.HashMap; import java.util.Map; import org.citrusframework.config.handler.CitrusTestCaseNamespaceHandler; import org.citrusframework.config.xml.*; import org.citrusframework.spi.ResourcePathTypeResolver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.xml.BeanDefinitionParser; /** * Registers bean definition parser for beans in test case, handled by {@link CitrusTestCaseNamespaceHandler} * * @author Christoph Deppisch * @since 2007 */ public final class CitrusNamespaceParserRegistry { /** Logger */ private static final Logger LOG = LoggerFactory.getLogger(CitrusNamespaceParserRegistry.class); /** Resource path where to find custom parsers via lookup */ private static final String RESOURCE_PATH = "META-INF/citrus/action/parser"; /** Type resolver for dynamic parser lookup via resource path */ private static final ResourcePathTypeResolver TYPE_RESOLVER = new ResourcePathTypeResolver(RESOURCE_PATH); /** Parser registry as map */ private static final Map<String, BeanDefinitionParser> BEAN_PARSER = new HashMap<>(); static { registerParser("testcase", new TestCaseParser()); registerParser("meta-info", new TestCaseMetaInfoParser()); registerParser("template", new TemplateParser()); registerParser("send", new SendMessageActionParser()); registerParser("receive", new ReceiveMessageActionParser()); registerParser("java", new JavaActionParser()); registerParser("sleep", new SleepActionParser()); registerParser("delay", new DelayActionParser()); registerParser("trace-variables", new TraceVariablesActionParser()); registerParser("create-variables", new CreateVariablesActionParser()); registerParser("trace-time", new StopTimeActionParser()); registerParser("echo", new EchoActionParser()); registerParser("print", new PrintActionParser()); registerParser("expect-timeout", new ReceiveTimeoutActionParser()); registerParser("purge-endpoint", new PurgeEndpointActionParser()); registerParser("action", new ActionParser()); registerParser("template", new TemplateParser()); registerParser("call-template", new CallTemplateParser()); registerParser("conditional", new ConditionalParser()); registerParser("sequential", new SequenceParser()); registerParser("async", new AsyncParser()); registerParser("iterate", new IterateParser()); registerParser("repeat-until-true", new RepeatUntilTrueParser()); registerParser("repeat-onerror-until-true", new RepeatOnErrorUntilTrueParser()); registerParser("fail", new FailActionParser()); registerParser("input", new InputActionParser()); registerParser("load", new LoadPropertiesActionParser()); registerParser("parallel", new ParallelParser()); registerParser("catch", new CatchParser()); registerParser("assert", new AssertParser()); registerParser("transform", new TransformActionParser()); registerParser("ant", new AntRunActionParser()); registerParser("start", new StartServerActionParser()); registerParser("stop", new StopServerActionParser()); registerParser("wait", new WaitParser()); registerParser("timer", new TimerParser()); registerParser("stop-timer", new StopTimerParser()); registerParser("stop-timer", new StopTimerParser()); } /** * Prevent instantiation. */ private CitrusNamespaceParserRegistry() { } /** * Register method to add new action parser. * @param beanName * @param parserObject */ public static void registerParser(String beanName, BeanDefinitionParser parserObject) { BEAN_PARSER.put(beanName, parserObject); } /** * Getter for parser. * @return */ public static Map<String, BeanDefinitionParser> getRegisteredBeanParser() { return BEAN_PARSER; } /** * Resolve test bean parser for given bean name. If not already present in the local parser cache try to locate * the parser through resource lookup. * @param name * @return */ public static BeanDefinitionParser getBeanParser(String name) { if (!BEAN_PARSER.containsKey(name)) { try { BEAN_PARSER.put(name, TYPE_RESOLVER.resolve(name)); } catch (Exception e) { LOG.warn(String.format("Unable to locate bean parser for '%s'", name), e); } } return BEAN_PARSER.get(name); } /** * Resolves all available bean parsers from resource path lookup. Scans classpath for meta information * and instantiates those components. * @return map of custom bean parsers */ public static Map<String, BeanDefinitionParser> lookupBeanParser() { return TYPE_RESOLVER.resolveAll(); } }
UTF-8
Java
5,651
java
CitrusNamespaceParserRegistry.java
Java
[ { "context": "link CitrusTestCaseNamespaceHandler}\n *\n * @author Christoph Deppisch\n * @since 2007\n */\npublic final class CitrusNames", "end": 1150, "score": 0.9997734427452087, "start": 1132, "tag": "NAME", "value": "Christoph Deppisch" } ]
null
[]
/* * Copyright 2006-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.citrusframework.config; import java.util.HashMap; import java.util.Map; import org.citrusframework.config.handler.CitrusTestCaseNamespaceHandler; import org.citrusframework.config.xml.*; import org.citrusframework.spi.ResourcePathTypeResolver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.xml.BeanDefinitionParser; /** * Registers bean definition parser for beans in test case, handled by {@link CitrusTestCaseNamespaceHandler} * * @author <NAME> * @since 2007 */ public final class CitrusNamespaceParserRegistry { /** Logger */ private static final Logger LOG = LoggerFactory.getLogger(CitrusNamespaceParserRegistry.class); /** Resource path where to find custom parsers via lookup */ private static final String RESOURCE_PATH = "META-INF/citrus/action/parser"; /** Type resolver for dynamic parser lookup via resource path */ private static final ResourcePathTypeResolver TYPE_RESOLVER = new ResourcePathTypeResolver(RESOURCE_PATH); /** Parser registry as map */ private static final Map<String, BeanDefinitionParser> BEAN_PARSER = new HashMap<>(); static { registerParser("testcase", new TestCaseParser()); registerParser("meta-info", new TestCaseMetaInfoParser()); registerParser("template", new TemplateParser()); registerParser("send", new SendMessageActionParser()); registerParser("receive", new ReceiveMessageActionParser()); registerParser("java", new JavaActionParser()); registerParser("sleep", new SleepActionParser()); registerParser("delay", new DelayActionParser()); registerParser("trace-variables", new TraceVariablesActionParser()); registerParser("create-variables", new CreateVariablesActionParser()); registerParser("trace-time", new StopTimeActionParser()); registerParser("echo", new EchoActionParser()); registerParser("print", new PrintActionParser()); registerParser("expect-timeout", new ReceiveTimeoutActionParser()); registerParser("purge-endpoint", new PurgeEndpointActionParser()); registerParser("action", new ActionParser()); registerParser("template", new TemplateParser()); registerParser("call-template", new CallTemplateParser()); registerParser("conditional", new ConditionalParser()); registerParser("sequential", new SequenceParser()); registerParser("async", new AsyncParser()); registerParser("iterate", new IterateParser()); registerParser("repeat-until-true", new RepeatUntilTrueParser()); registerParser("repeat-onerror-until-true", new RepeatOnErrorUntilTrueParser()); registerParser("fail", new FailActionParser()); registerParser("input", new InputActionParser()); registerParser("load", new LoadPropertiesActionParser()); registerParser("parallel", new ParallelParser()); registerParser("catch", new CatchParser()); registerParser("assert", new AssertParser()); registerParser("transform", new TransformActionParser()); registerParser("ant", new AntRunActionParser()); registerParser("start", new StartServerActionParser()); registerParser("stop", new StopServerActionParser()); registerParser("wait", new WaitParser()); registerParser("timer", new TimerParser()); registerParser("stop-timer", new StopTimerParser()); registerParser("stop-timer", new StopTimerParser()); } /** * Prevent instantiation. */ private CitrusNamespaceParserRegistry() { } /** * Register method to add new action parser. * @param beanName * @param parserObject */ public static void registerParser(String beanName, BeanDefinitionParser parserObject) { BEAN_PARSER.put(beanName, parserObject); } /** * Getter for parser. * @return */ public static Map<String, BeanDefinitionParser> getRegisteredBeanParser() { return BEAN_PARSER; } /** * Resolve test bean parser for given bean name. If not already present in the local parser cache try to locate * the parser through resource lookup. * @param name * @return */ public static BeanDefinitionParser getBeanParser(String name) { if (!BEAN_PARSER.containsKey(name)) { try { BEAN_PARSER.put(name, TYPE_RESOLVER.resolve(name)); } catch (Exception e) { LOG.warn(String.format("Unable to locate bean parser for '%s'", name), e); } } return BEAN_PARSER.get(name); } /** * Resolves all available bean parsers from resource path lookup. Scans classpath for meta information * and instantiates those components. * @return map of custom bean parsers */ public static Map<String, BeanDefinitionParser> lookupBeanParser() { return TYPE_RESOLVER.resolveAll(); } }
5,639
0.692975
0.689789
139
39.654675
30.439871
115
false
false
0
0
0
0
0
0
0.784173
false
false
4
73f0c1cd26cdf4a1cfbb7543b7c76ea8624bbd2b
5,987,184,432,963
f9e58ea99853c7ab3e373c54212d6b2fe546390c
/AndroidAR/app/src/androidTest/java/com/example/livelyturtle/androidar/CoordinateTest.java
56a1fa29a1c74db1c690374d09ee3e3d6a755df1
[]
no_license
hsieha/CIS400Project
https://github.com/hsieha/CIS400Project
3bd7d07d4875f42a9138f85cca65cf260fbe27d1
25b434820176609432f4b57f3b6d71e6e4ac2fee
refs/heads/master
2021-01-10T10:11:37.321000
2016-04-24T18:46:01
2016-04-24T18:46:01
44,953,965
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.livelyturtle.androidar; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.Assert; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) public class CoordinateTest { @Test public void testCoordinateAtCompass() { double epsilon = 0.01; // a centimeter Coordinate c = new Coordinate(Coordinate.COMPASS_LAT, Coordinate.COMPASS_LONG); Assert.assertEquals("x==0?", 0, c.x, epsilon); Assert.assertEquals("z==0?", 0, c.z, epsilon); } @Test public void testConstantDistanceAwayFromCompass() { double epsilon = 0.01; // a centimeter double someDist = 0.001; // about 110m? Coordinate cN = new Coordinate(Coordinate.COMPASS_LAT + someDist, Coordinate.COMPASS_LONG); Coordinate cNE = new Coordinate(Coordinate.COMPASS_LAT + someDist, Coordinate.COMPASS_LONG + someDist); Coordinate cE = new Coordinate(Coordinate.COMPASS_LAT, Coordinate.COMPASS_LONG + someDist); Coordinate cSE = new Coordinate(Coordinate.COMPASS_LAT - someDist, Coordinate.COMPASS_LONG + someDist); Coordinate cS = new Coordinate(Coordinate.COMPASS_LAT - someDist, Coordinate.COMPASS_LONG); Coordinate cSW = new Coordinate(Coordinate.COMPASS_LAT - someDist, Coordinate.COMPASS_LONG - someDist); Coordinate cW = new Coordinate(Coordinate.COMPASS_LAT, Coordinate.COMPASS_LONG - someDist); Coordinate cNW = new Coordinate(Coordinate.COMPASS_LAT + someDist, Coordinate.COMPASS_LONG - someDist); // N is around 0 different along x; negative along z Assert.assertEquals("N: x==0?", 0, cN.x, epsilon); Assert.assertTrue(cN.z < 0); // NE is +x, -z Assert.assertTrue(cNE.x > 0); Assert.assertTrue(cNE.z < 0); // E is +x Assert.assertTrue(cE.x > 0); Assert.assertEquals("E: z==0?", 0, cE.z, epsilon); // SE is +x, +z Assert.assertTrue(cSE.x > 0); Assert.assertTrue(cSE.z > 0); // S is +z Assert.assertEquals("S: x==0?", 0, cS.x, epsilon); Assert.assertTrue(cS.z > 0); // SW is -x, +z Assert.assertTrue(cSW.x < 0); Assert.assertTrue(cSW.z > 0); // W is -x Assert.assertTrue(cW.x < 0); Assert.assertEquals("W: z==0?", 0, cW.z, epsilon); // NW is -x, -z Assert.assertTrue(cNW.x < 0); Assert.assertTrue(cNW.z < 0); } @Test public void convertMetersToLatLong() { double epsilon = 1.; // allow for 1m of inaccuracy // these tests convert an x/z format into lat/long format, then // convert BACK into x/z format (the "new" Coordinates). // Since the 2 conversions are handled with entirely separate algorithms, the idea is // to ensure that the values do not stray too far. // some coordinates Coordinate cN = Coordinate.fromXZ(0,-100); Coordinate cNE = Coordinate.fromXZ(50,-50); Coordinate cE = Coordinate.fromXZ(100,0); Coordinate cSE = Coordinate.fromXZ(50,50); Coordinate cS = Coordinate.fromXZ(0,100); Coordinate cSW = Coordinate.fromXZ(-50,50); Coordinate cW = Coordinate.fromXZ(-100,0); Coordinate cNW = Coordinate.fromXZ(-50,-50); Coordinate newN = new Coordinate(cN.latitude, cN.longitude); Coordinate newNE = new Coordinate(cNE.latitude, cNE.longitude); Coordinate newE = new Coordinate(cE.latitude, cE.longitude); Coordinate newSE = new Coordinate(cSE.latitude, cSE.longitude); Coordinate newS = new Coordinate(cS.latitude, cS.longitude); Coordinate newSW = new Coordinate(cSW.latitude, cSW.longitude); Coordinate newW = new Coordinate(cW.latitude, cW.longitude); Coordinate newNW = new Coordinate(cNW.latitude, cNW.longitude); Assert.assertEquals("N x value correct", cN.x, newN.x, epsilon); Assert.assertEquals("N z value correct", cN.z, newN.z, epsilon); Assert.assertEquals("NE x value correct", cNE.x, newNE.x, epsilon); Assert.assertEquals("NE z value correct", cNE.z, newNE.z, epsilon); Assert.assertEquals("E x value correct", cE.x, newE.x, epsilon); Assert.assertEquals("E z value correct", cE.z, newE.z, epsilon); Assert.assertEquals("SE x value correct", cSE.x, newSE.x, epsilon); Assert.assertEquals("SE z value correct", cSE.z, newSE.z, epsilon); Assert.assertEquals("S x value correct", cS.x, newS.x, epsilon); Assert.assertEquals("S z value correct", cS.z, newS.z, epsilon); Assert.assertEquals("SW x value correct", cSW.x, newSW.x, epsilon); Assert.assertEquals("SW z value correct", cSW.z, newSW.z, epsilon); Assert.assertEquals("W x value correct", cW.x, newW.x, epsilon); Assert.assertEquals("W z value correct", cW.z, newW.z, epsilon); Assert.assertEquals("NW x value correct", cNW.x, newNW.x, epsilon); Assert.assertEquals("NW z value correct", cNW.z, newNW.z, epsilon); } }
UTF-8
Java
5,089
java
CoordinateTest.java
Java
[]
null
[]
package com.example.livelyturtle.androidar; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.Assert; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) public class CoordinateTest { @Test public void testCoordinateAtCompass() { double epsilon = 0.01; // a centimeter Coordinate c = new Coordinate(Coordinate.COMPASS_LAT, Coordinate.COMPASS_LONG); Assert.assertEquals("x==0?", 0, c.x, epsilon); Assert.assertEquals("z==0?", 0, c.z, epsilon); } @Test public void testConstantDistanceAwayFromCompass() { double epsilon = 0.01; // a centimeter double someDist = 0.001; // about 110m? Coordinate cN = new Coordinate(Coordinate.COMPASS_LAT + someDist, Coordinate.COMPASS_LONG); Coordinate cNE = new Coordinate(Coordinate.COMPASS_LAT + someDist, Coordinate.COMPASS_LONG + someDist); Coordinate cE = new Coordinate(Coordinate.COMPASS_LAT, Coordinate.COMPASS_LONG + someDist); Coordinate cSE = new Coordinate(Coordinate.COMPASS_LAT - someDist, Coordinate.COMPASS_LONG + someDist); Coordinate cS = new Coordinate(Coordinate.COMPASS_LAT - someDist, Coordinate.COMPASS_LONG); Coordinate cSW = new Coordinate(Coordinate.COMPASS_LAT - someDist, Coordinate.COMPASS_LONG - someDist); Coordinate cW = new Coordinate(Coordinate.COMPASS_LAT, Coordinate.COMPASS_LONG - someDist); Coordinate cNW = new Coordinate(Coordinate.COMPASS_LAT + someDist, Coordinate.COMPASS_LONG - someDist); // N is around 0 different along x; negative along z Assert.assertEquals("N: x==0?", 0, cN.x, epsilon); Assert.assertTrue(cN.z < 0); // NE is +x, -z Assert.assertTrue(cNE.x > 0); Assert.assertTrue(cNE.z < 0); // E is +x Assert.assertTrue(cE.x > 0); Assert.assertEquals("E: z==0?", 0, cE.z, epsilon); // SE is +x, +z Assert.assertTrue(cSE.x > 0); Assert.assertTrue(cSE.z > 0); // S is +z Assert.assertEquals("S: x==0?", 0, cS.x, epsilon); Assert.assertTrue(cS.z > 0); // SW is -x, +z Assert.assertTrue(cSW.x < 0); Assert.assertTrue(cSW.z > 0); // W is -x Assert.assertTrue(cW.x < 0); Assert.assertEquals("W: z==0?", 0, cW.z, epsilon); // NW is -x, -z Assert.assertTrue(cNW.x < 0); Assert.assertTrue(cNW.z < 0); } @Test public void convertMetersToLatLong() { double epsilon = 1.; // allow for 1m of inaccuracy // these tests convert an x/z format into lat/long format, then // convert BACK into x/z format (the "new" Coordinates). // Since the 2 conversions are handled with entirely separate algorithms, the idea is // to ensure that the values do not stray too far. // some coordinates Coordinate cN = Coordinate.fromXZ(0,-100); Coordinate cNE = Coordinate.fromXZ(50,-50); Coordinate cE = Coordinate.fromXZ(100,0); Coordinate cSE = Coordinate.fromXZ(50,50); Coordinate cS = Coordinate.fromXZ(0,100); Coordinate cSW = Coordinate.fromXZ(-50,50); Coordinate cW = Coordinate.fromXZ(-100,0); Coordinate cNW = Coordinate.fromXZ(-50,-50); Coordinate newN = new Coordinate(cN.latitude, cN.longitude); Coordinate newNE = new Coordinate(cNE.latitude, cNE.longitude); Coordinate newE = new Coordinate(cE.latitude, cE.longitude); Coordinate newSE = new Coordinate(cSE.latitude, cSE.longitude); Coordinate newS = new Coordinate(cS.latitude, cS.longitude); Coordinate newSW = new Coordinate(cSW.latitude, cSW.longitude); Coordinate newW = new Coordinate(cW.latitude, cW.longitude); Coordinate newNW = new Coordinate(cNW.latitude, cNW.longitude); Assert.assertEquals("N x value correct", cN.x, newN.x, epsilon); Assert.assertEquals("N z value correct", cN.z, newN.z, epsilon); Assert.assertEquals("NE x value correct", cNE.x, newNE.x, epsilon); Assert.assertEquals("NE z value correct", cNE.z, newNE.z, epsilon); Assert.assertEquals("E x value correct", cE.x, newE.x, epsilon); Assert.assertEquals("E z value correct", cE.z, newE.z, epsilon); Assert.assertEquals("SE x value correct", cSE.x, newSE.x, epsilon); Assert.assertEquals("SE z value correct", cSE.z, newSE.z, epsilon); Assert.assertEquals("S x value correct", cS.x, newS.x, epsilon); Assert.assertEquals("S z value correct", cS.z, newS.z, epsilon); Assert.assertEquals("SW x value correct", cSW.x, newSW.x, epsilon); Assert.assertEquals("SW z value correct", cSW.z, newSW.z, epsilon); Assert.assertEquals("W x value correct", cW.x, newW.x, epsilon); Assert.assertEquals("W z value correct", cW.z, newW.z, epsilon); Assert.assertEquals("NW x value correct", cNW.x, newNW.x, epsilon); Assert.assertEquals("NW z value correct", cNW.z, newNW.z, epsilon); } }
5,089
0.644527
0.62979
121
41.05785
32.293922
111
false
false
0
0
0
0
0
0
1.371901
false
false
4
efa9fa1d334bdb4769c22dd909e5ed93560346a5
13,718,125,567,843
616a9830db1a7fdb5808a6d315461988c5144255
/src/main/java/E88/E88_2.java
b3eff87f18bd7978cfb3b79dc3307afe958be4e5
[]
no_license
sharidatulshahira/exercises_week2
https://github.com/sharidatulshahira/exercises_week2
5e7fde6563c82033f609d00eeb9231eeb7d9be80
6c2d5215e6d0bf634e8979130e8eb2dd81c2f2dc
refs/heads/master
2020-05-20T19:46:04.680000
2017-03-10T03:20:48
2017-03-10T03:20:48
84,514,404
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * EXERCISE 88.2: LIST OF STUDENTS * */ /* Expected output: name: Alan Turing studentnumber: 017635727 name: Linus Torvalds studentnumber: 011288989 name: Steve Jobs studentnumber: 013672548 name: Alan Turing (017635727) Linus Torvalds (011288989) Steve Jobs (013672548) */ package E88; /** * @author SIsmail * */ import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class E88_2 { public static void main(String[] args) { ArrayList<Student> list = new ArrayList<Student>(); Scanner scan = new Scanner(System.in); while(true){ System.out.print("name: "); String name = scan.nextLine(); if (name.isEmpty()){ break; } System.out.print("student number: "); String studentNumber=scan.nextLine(); list.add(new Student(name,studentNumber)); } for (Student student : list) { System.out.println(student); } } }
UTF-8
Java
975
java
E88_2.java
Java
[ { "context": "DENTS\n * \n */\n\n/*\n \t Expected output:\n \t \n \tname: Alan Turing\n \tstudentnumber: 017635727\n \tname: Linus Torvalds", "end": 95, "score": 0.9998816251754761, "start": 84, "tag": "NAME", "value": "Alan Turing" }, { "context": "me: Alan Turing\n \tstudentnumber: 017635727\n \tname: Linus Torvalds\n \tstudentnumber: 011288989\n \tname: Steve Jobs\n \ts", "end": 145, "score": 0.9998689889907837, "start": 131, "tag": "NAME", "value": "Linus Torvalds" }, { "context": " Linus Torvalds\n \tstudentnumber: 011288989\n \tname: Steve Jobs\n \tstudentnumber: 013672548\n \tname:\n \tAlan Turing ", "end": 191, "score": 0.999803900718689, "start": 181, "tag": "NAME", "value": "Steve Jobs" }, { "context": ": Steve Jobs\n \tstudentnumber: 013672548\n \tname:\n \tAlan Turing (017635727)\n \tLinus Torvalds (011288989)\n \tSteve ", "end": 240, "score": 0.9998955726623535, "start": 229, "tag": "NAME", "value": "Alan Turing" }, { "context": "er: 013672548\n \tname:\n \tAlan Turing (017635727)\n \tLinus Torvalds (011288989)\n \tSteve Jobs (013672548)\n\n*/\npackage ", "end": 269, "score": 0.99988853931427, "start": 255, "tag": "NAME", "value": "Linus Torvalds" }, { "context": "Turing (017635727)\n \tLinus Torvalds (011288989)\n \tSteve Jobs (013672548)\n\n*/\npackage E88;\n\n\n/**\n * @author SIs", "end": 294, "score": 0.9998610615730286, "start": 284, "tag": "NAME", "value": "Steve Jobs" }, { "context": "Jobs (013672548)\n\n*/\npackage E88;\n\n\n/**\n * @author SIsmail\n *\n */\nimport java.util.ArrayList;\nimport java.ut", "end": 348, "score": 0.801426112651825, "start": 341, "tag": "USERNAME", "value": "SIsmail" } ]
null
[]
/** * EXERCISE 88.2: LIST OF STUDENTS * */ /* Expected output: name: <NAME> studentnumber: 017635727 name: <NAME> studentnumber: 011288989 name: <NAME> studentnumber: 013672548 name: <NAME> (017635727) <NAME> (011288989) <NAME> (013672548) */ package E88; /** * @author SIsmail * */ import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class E88_2 { public static void main(String[] args) { ArrayList<Student> list = new ArrayList<Student>(); Scanner scan = new Scanner(System.in); while(true){ System.out.print("name: "); String name = scan.nextLine(); if (name.isEmpty()){ break; } System.out.print("student number: "); String studentNumber=scan.nextLine(); list.add(new Student(name,studentNumber)); } for (Student student : list) { System.out.println(student); } } }
941
0.628718
0.565128
61
14.770492
14.537001
53
false
false
0
0
0
0
0
0
1.52459
false
false
4
0c0d6754a9af734d687d7544e009eedf6f9d0e69
33,191,507,277,996
85480242d55a9c220af8427e30db44296d2195a3
/Methods/RandImages.java
6a776bfc1f66c59fcdab621fd997ba627cf709ad
[]
no_license
Sidhved/JAVA
https://github.com/Sidhved/JAVA
661a6289b5bbc2b05347fbed9d818ca4ad8e445b
103561e451b8a0a295b5d5d4508d277348e44674
refs/heads/main
2023-04-26T05:53:42.367000
2021-06-06T14:20:11
2021-06-06T14:20:11
370,450,584
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Methods; import java.awt.Color; import java.awt.Graphics; import java.security.SecureRandom; import javax.swing.JFrame; import javax.swing.JPanel; public class RandImages extends JPanel { SecureRandom randomNumber = new SecureRandom(); public void paintComponent(Graphics g){ super.paintComponent(g); boolean flag = true; int width = getWidth(); int height = getHeight(); int x = randomNumber.nextInt(width); int y = randomNumber.nextInt(height); int p = randomNumber.nextInt(width/2); int q = randomNumber.nextInt(height/2); while (flag == true) { for(int i = 1; i<=10; i++){ int col = 1 + randomNumber.nextInt(2); int r = randomNumber.nextInt(5); switch(r){ case 1: g.setColor(Color.BLACK); break; case 2: g.setColor(Color.BLUE); break; case 3: g.setColor(Color.CYAN); break; case 4: g.setColor(Color.GRAY); break; case 5: g.setColor(Color.MAGENTA); break; } switch (col) { case 1: g.fillRect(x, y, p, q); break; case 2: g.fillOval(x, y, p, q); break; default: break; } if(i == 10){ flag = false; } } } } public static void main(String[] args) { RandImages panel = new RandImages(); JFrame app = new JFrame(); app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); app.add(panel); app.setSize(500, 500); app.setVisible(true); } }
UTF-8
Java
2,086
java
RandImages.java
Java
[]
null
[]
package Methods; import java.awt.Color; import java.awt.Graphics; import java.security.SecureRandom; import javax.swing.JFrame; import javax.swing.JPanel; public class RandImages extends JPanel { SecureRandom randomNumber = new SecureRandom(); public void paintComponent(Graphics g){ super.paintComponent(g); boolean flag = true; int width = getWidth(); int height = getHeight(); int x = randomNumber.nextInt(width); int y = randomNumber.nextInt(height); int p = randomNumber.nextInt(width/2); int q = randomNumber.nextInt(height/2); while (flag == true) { for(int i = 1; i<=10; i++){ int col = 1 + randomNumber.nextInt(2); int r = randomNumber.nextInt(5); switch(r){ case 1: g.setColor(Color.BLACK); break; case 2: g.setColor(Color.BLUE); break; case 3: g.setColor(Color.CYAN); break; case 4: g.setColor(Color.GRAY); break; case 5: g.setColor(Color.MAGENTA); break; } switch (col) { case 1: g.fillRect(x, y, p, q); break; case 2: g.fillOval(x, y, p, q); break; default: break; } if(i == 10){ flag = false; } } } } public static void main(String[] args) { RandImages panel = new RandImages(); JFrame app = new JFrame(); app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); app.add(panel); app.setSize(500, 500); app.setVisible(true); } }
2,086
0.426654
0.415628
68
29.67647
14.434885
59
false
false
0
0
0
0
0
0
0.705882
false
false
4
7aecfaa2e4ceff3471484fc82ea81735fe9e46e8
14,903,536,586,128
16ad102ec33523fd2ff53d36cafe58df5f7b1fa3
/src/main/java/com/apps/dashboard/service/FileReaderImpl.java
18766f37d8a98a73b8c1d3897338f980f67f85a4
[]
no_license
sajinsachidanand/dashboard
https://github.com/sajinsachidanand/dashboard
e4fcd77f2ef72fe8e7f4c9e2f8b23fc142e0a383
534b905ea6f46f9ff71b3b845ad5b2a201b4dc12
refs/heads/master
2022-07-11T16:08:37.957000
2019-06-02T11:53:57
2019-06-02T11:53:57
189,839,993
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.apps.dashboard.service; import com.apps.dashboard.constants.ColumnNames; import com.apps.dashboard.model.AppModel; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.core.io.ClassPathResource; import org.springframework.stereotype.Service; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @Service public class FileReaderImpl implements FileReader { public static final String FILE_PATH = "assets/filename.xlsx"; @Override public List<AppModel> getAppDetails() { return getApplicationDetails(); } private List<AppModel> getApplicationDetails() { List<AppModel> appDetails = new ArrayList<>(); try (InputStream is = new ClassPathResource(FILE_PATH).getInputStream()) { Workbook workbook = new XSSFWorkbook(is); Sheet sheet = workbook.getSheetAt(1); Iterator rowIterator = sheet.iterator(); while (rowIterator.hasNext()) { AppModel appModel = new AppModel(); Row row = (Row) rowIterator.next(); Iterator cellIterator = row.cellIterator(); while (cellIterator.hasNext() && row.getRowNum() > 0){ Cell cell = (Cell) cellIterator.next(); cell.setCellType(Cell.CELL_TYPE_STRING); switch (cell.getColumnIndex()) { case ColumnNames.APP_ID: appModel.setAppId(cell.getStringCellValue()); break; case ColumnNames.APP_Name: appModel.setAppName(cell.getStringCellValue()); break; case ColumnNames.APP_MANAGER: appModel.setAppManager(cell.getStringCellValue()); break; case ColumnNames.SME: appModel.setSme(cell.getStringCellValue()); break; case ColumnNames.CI: appModel.setCi(cell.getStringCellValue()); break; case ColumnNames.SERVICE_TYPE: appModel.setServiceType(cell.getStringCellValue()); break; case ColumnNames.N1ORG: appModel.setN1Org(cell.getStringCellValue()); break; case ColumnNames.REGION: appModel.setRegion(cell.getStringCellValue()); break; case ColumnNames.TECH_SKILL: appModel.setTechSkill(cell.getStringCellValue()); break; case ColumnNames.SYS_TYPE: appModel.setSysType(cell.getStringCellValue()); break; case ColumnNames.SER_CLASS: appModel.setServiceClass(cell.getStringCellValue()); break; case ColumnNames.NO_OF_USR: appModel.setNoOfUsers(cell.getStringCellValue()); break; case ColumnNames.NO_OF_INC: appModel.setNoOfIncidentsPerYear(cell.getStringCellValue()); break; case ColumnNames.NO_OF_SR: appModel.setNoOfServiceRequestPerYear(cell.getStringCellValue()); break; case ColumnNames.NO_OF_CR: appModel.setNoOfChangeRequestPerYear(cell.getStringCellValue()); break; case ColumnNames.GO_LIVE_DATE: appModel.setGoLiveDate(cell.getStringCellValue()); break; case ColumnNames.REVISED_WAVE: appModel.setRevisedWave(cell.getStringCellValue()); break; case ColumnNames.PRIMARY_KR: appModel.setPrimaryKr(cell.getStringCellValue()); break; case ColumnNames.SECONDARY_KR: appModel.setSecondaryKr(cell.getStringCellValue()); break; case ColumnNames.ADDITIONAL_KR: appModel.setAdditionalKr(cell.getStringCellValue()); break; case ColumnNames.SER_TYPE: appModel.setServerType(cell.getStringCellValue()); break; case ColumnNames.SER_NAME: appModel.setServerName(cell.getStringCellValue()); break; case ColumnNames.SER_ACCESS_ID: appModel.setServerAccessId(cell.getStringCellValue()); break; case ColumnNames.LOG_PATH: appModel.setLogPath(cell.getStringCellValue()); break; case ColumnNames.DB_DETAIL: appModel.setDbDetail(cell.getStringCellValue()); break; case ColumnNames.DB_TYPE: appModel.setDbType(cell.getStringCellValue()); break; case ColumnNames.DB_USR_ID: appModel.setDbUserId(cell.getStringCellValue()); break; case ColumnNames.DB_PREVILEGE_URL: appModel.setDbPrivilage(cell.getStringCellValue()); break; case ColumnNames.DB_URL: appModel.setUrl(cell.getStringCellValue()); break; case ColumnNames.DB_URL_ACCESS_ID: appModel.setUrlAccessId(cell.getStringCellValue()); break; case ColumnNames.LIC_RENEWAL_FREQ: appModel.setLicence(cell.getStringCellValue()); break; case ColumnNames.LAST_RENEW_DATE: appModel.setLastRenewDate(cell.getStringCellValue()); break; case ColumnNames.VENDOR_CNT_DETAIL: appModel.setVendorContact(cell.getStringCellValue()); break; case ColumnNames.USR_DTL: appModel.setUserDl(cell.getStringCellValue()); break; case ColumnNames.APP_DTL: appModel.setAppDetail(cell.getStringCellValue()); break; default: break; } } if(appModel.getAppId()!= null) { appDetails.add(appModel); } else{ // } } } catch (IOException e) { e.printStackTrace(); } return appDetails; } }
UTF-8
Java
7,857
java
FileReaderImpl.java
Java
[]
null
[]
package com.apps.dashboard.service; import com.apps.dashboard.constants.ColumnNames; import com.apps.dashboard.model.AppModel; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.core.io.ClassPathResource; import org.springframework.stereotype.Service; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @Service public class FileReaderImpl implements FileReader { public static final String FILE_PATH = "assets/filename.xlsx"; @Override public List<AppModel> getAppDetails() { return getApplicationDetails(); } private List<AppModel> getApplicationDetails() { List<AppModel> appDetails = new ArrayList<>(); try (InputStream is = new ClassPathResource(FILE_PATH).getInputStream()) { Workbook workbook = new XSSFWorkbook(is); Sheet sheet = workbook.getSheetAt(1); Iterator rowIterator = sheet.iterator(); while (rowIterator.hasNext()) { AppModel appModel = new AppModel(); Row row = (Row) rowIterator.next(); Iterator cellIterator = row.cellIterator(); while (cellIterator.hasNext() && row.getRowNum() > 0){ Cell cell = (Cell) cellIterator.next(); cell.setCellType(Cell.CELL_TYPE_STRING); switch (cell.getColumnIndex()) { case ColumnNames.APP_ID: appModel.setAppId(cell.getStringCellValue()); break; case ColumnNames.APP_Name: appModel.setAppName(cell.getStringCellValue()); break; case ColumnNames.APP_MANAGER: appModel.setAppManager(cell.getStringCellValue()); break; case ColumnNames.SME: appModel.setSme(cell.getStringCellValue()); break; case ColumnNames.CI: appModel.setCi(cell.getStringCellValue()); break; case ColumnNames.SERVICE_TYPE: appModel.setServiceType(cell.getStringCellValue()); break; case ColumnNames.N1ORG: appModel.setN1Org(cell.getStringCellValue()); break; case ColumnNames.REGION: appModel.setRegion(cell.getStringCellValue()); break; case ColumnNames.TECH_SKILL: appModel.setTechSkill(cell.getStringCellValue()); break; case ColumnNames.SYS_TYPE: appModel.setSysType(cell.getStringCellValue()); break; case ColumnNames.SER_CLASS: appModel.setServiceClass(cell.getStringCellValue()); break; case ColumnNames.NO_OF_USR: appModel.setNoOfUsers(cell.getStringCellValue()); break; case ColumnNames.NO_OF_INC: appModel.setNoOfIncidentsPerYear(cell.getStringCellValue()); break; case ColumnNames.NO_OF_SR: appModel.setNoOfServiceRequestPerYear(cell.getStringCellValue()); break; case ColumnNames.NO_OF_CR: appModel.setNoOfChangeRequestPerYear(cell.getStringCellValue()); break; case ColumnNames.GO_LIVE_DATE: appModel.setGoLiveDate(cell.getStringCellValue()); break; case ColumnNames.REVISED_WAVE: appModel.setRevisedWave(cell.getStringCellValue()); break; case ColumnNames.PRIMARY_KR: appModel.setPrimaryKr(cell.getStringCellValue()); break; case ColumnNames.SECONDARY_KR: appModel.setSecondaryKr(cell.getStringCellValue()); break; case ColumnNames.ADDITIONAL_KR: appModel.setAdditionalKr(cell.getStringCellValue()); break; case ColumnNames.SER_TYPE: appModel.setServerType(cell.getStringCellValue()); break; case ColumnNames.SER_NAME: appModel.setServerName(cell.getStringCellValue()); break; case ColumnNames.SER_ACCESS_ID: appModel.setServerAccessId(cell.getStringCellValue()); break; case ColumnNames.LOG_PATH: appModel.setLogPath(cell.getStringCellValue()); break; case ColumnNames.DB_DETAIL: appModel.setDbDetail(cell.getStringCellValue()); break; case ColumnNames.DB_TYPE: appModel.setDbType(cell.getStringCellValue()); break; case ColumnNames.DB_USR_ID: appModel.setDbUserId(cell.getStringCellValue()); break; case ColumnNames.DB_PREVILEGE_URL: appModel.setDbPrivilage(cell.getStringCellValue()); break; case ColumnNames.DB_URL: appModel.setUrl(cell.getStringCellValue()); break; case ColumnNames.DB_URL_ACCESS_ID: appModel.setUrlAccessId(cell.getStringCellValue()); break; case ColumnNames.LIC_RENEWAL_FREQ: appModel.setLicence(cell.getStringCellValue()); break; case ColumnNames.LAST_RENEW_DATE: appModel.setLastRenewDate(cell.getStringCellValue()); break; case ColumnNames.VENDOR_CNT_DETAIL: appModel.setVendorContact(cell.getStringCellValue()); break; case ColumnNames.USR_DTL: appModel.setUserDl(cell.getStringCellValue()); break; case ColumnNames.APP_DTL: appModel.setAppDetail(cell.getStringCellValue()); break; default: break; } } if(appModel.getAppId()!= null) { appDetails.add(appModel); } else{ // } } } catch (IOException e) { e.printStackTrace(); } return appDetails; } }
7,857
0.471554
0.471045
167
46.047905
22.342144
93
false
false
0
0
0
0
0
0
0.598802
false
false
4
2420936e72692862210d59f39e702b067a592ae4
1,537,598,318,379
3dbc97dc0228e8dba5a050a3be4ffee771cf0ce2
/src/ModeMsgThread.java
5e860d04e218b393408de1ba55d487bcdcfff118
[]
no_license
mjyan0720/CS425sp15
https://github.com/mjyan0720/CS425sp15
1114056f5380a122721cbda50d038dc47b048411
9d90211b8779ad09b6ed233c65570f3288193cb2
refs/heads/master
2020-05-31T18:08:59.143000
2015-03-13T04:46:42
2015-03-13T04:46:42
31,138,682
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.io.*; import java.util.*; import java.net.*; import java.text.*; public class ModeMsgThread implements Runnable{ private ObjectOutputStream leader_obj;// = new ObjectOutputStream(); private ObjectOutputStream obj_os[] = new ObjectOutputStream[DataCenter.TOTAL_NUM]; ModeDataCenter data_center; public ModeMsgThread(ModeDataCenter c){ data_center = c; } public void initializeOutput() throws IOException{ OutputStream os = data_center.getLeaderSocket().getOutputStream(); leader_obj = new ObjectOutputStream(os); for(int i=0; i<DataCenter.TOTAL_NUM; i++){ os = data_center.getSocket(i).getOutputStream(); obj_os[i] = new ObjectOutputStream(os); } } public void run(){ System.out.println("Starting Message Thread..."); try{ initializeOutput(); } catch(IOException e){ System.err.println("error occur when initialize all object output stream"); System.err.println(e); } Thread ack_thread = new Thread(new ModeAckThread(this)); ack_thread.start(); while(true){ //get the top packet of the queue while(!data_center.messageComplete()); // If the mode is 3 or 4, continue to send 4 messages sendMessage(); }//end of infinite loop }// end of run() private void sendMessage(){ Packet packet = data_center.getMessage(); if( packet != null ){ if(packet.getModel() == 3 || packet.getModel() == 4){ int i = 0; // send 4 messages setPacketVariableInDataCenter(packet); do{ long current_time = System.currentTimeMillis(); long send_time = packet.getSendTime(); //check whether it's the time to send the message //if not, sleep for required length of time if(send_time > current_time){ try{ Thread.sleep(send_time - current_time); } catch(InterruptedException e){ System.err.println("In message thread, message delay is interrupted."); System.err.println(e); } } //send the message try{ sendPacket(packet); } catch(IOException e){ System.err.println("error in send packet."); System.err.println(e); } i += 1; while((packet = data_center.getMessage()) == null && i<DataCenter.TOTAL_NUM); }while(i < DataCenter.TOTAL_NUM); } else{ long current_time = System.currentTimeMillis(); long send_time = packet.getSendTime(); //check whether it's the time to send the message //if not, sleep for required length of time if(send_time > current_time){ try{ Thread.sleep(send_time - current_time); } catch(InterruptedException e){ System.err.println("In message thread, message delay is interrupted."); System.err.println(e); } } //send the message try{ setPacketVariableInDataCenter(packet); sendPacket(packet); } catch(IOException e){ System.err.println("error in send packet."); System.err.println(e); } } // System.out.println("After sending message, new ack_num is " + data_center.getMessageAckNum()); } } private void setPacketVariableInDataCenter(Packet p){ int ack_num = 0; int model = p.getModel(); Packet.PacketType type = p.getType(); switch(type){ case Search: case Delete: ack_num = 1; break; case Insert: case Update: case Get: if(model == 1 || model == 2 || model == 3) ack_num = 1; else if(model == 4) ack_num = 2; else ack_num = 0; break; default: ack_num = 0; break; } data_center.setLastMessageTime(p.getTimestamp()); data_center.setMessageAckNum(ack_num); } protected synchronized void sendPacket(Packet packet) throws IOException { // System.out.println("A packet with desitination "+packet.getDestination() + ", lastMsgAckNum " + data_center.getMessageAckNum()); if(packet.getDestination()<0 || packet.getDestination() > DataCenter.TOTAL_NUM){ System.out.println("A packet with invalid desitination "+packet.getDestination()+", drop it!"); return; } else if (packet.getDestination() == DataCenter.TOTAL_NUM){ leader_obj.writeObject(packet); } else{ obj_os[packet.getDestination()].writeObject(packet); } } public ModeDataCenter getDataCenter(){ return data_center; } }
UTF-8
Java
4,854
java
ModeMsgThread.java
Java
[]
null
[]
import java.io.*; import java.util.*; import java.net.*; import java.text.*; public class ModeMsgThread implements Runnable{ private ObjectOutputStream leader_obj;// = new ObjectOutputStream(); private ObjectOutputStream obj_os[] = new ObjectOutputStream[DataCenter.TOTAL_NUM]; ModeDataCenter data_center; public ModeMsgThread(ModeDataCenter c){ data_center = c; } public void initializeOutput() throws IOException{ OutputStream os = data_center.getLeaderSocket().getOutputStream(); leader_obj = new ObjectOutputStream(os); for(int i=0; i<DataCenter.TOTAL_NUM; i++){ os = data_center.getSocket(i).getOutputStream(); obj_os[i] = new ObjectOutputStream(os); } } public void run(){ System.out.println("Starting Message Thread..."); try{ initializeOutput(); } catch(IOException e){ System.err.println("error occur when initialize all object output stream"); System.err.println(e); } Thread ack_thread = new Thread(new ModeAckThread(this)); ack_thread.start(); while(true){ //get the top packet of the queue while(!data_center.messageComplete()); // If the mode is 3 or 4, continue to send 4 messages sendMessage(); }//end of infinite loop }// end of run() private void sendMessage(){ Packet packet = data_center.getMessage(); if( packet != null ){ if(packet.getModel() == 3 || packet.getModel() == 4){ int i = 0; // send 4 messages setPacketVariableInDataCenter(packet); do{ long current_time = System.currentTimeMillis(); long send_time = packet.getSendTime(); //check whether it's the time to send the message //if not, sleep for required length of time if(send_time > current_time){ try{ Thread.sleep(send_time - current_time); } catch(InterruptedException e){ System.err.println("In message thread, message delay is interrupted."); System.err.println(e); } } //send the message try{ sendPacket(packet); } catch(IOException e){ System.err.println("error in send packet."); System.err.println(e); } i += 1; while((packet = data_center.getMessage()) == null && i<DataCenter.TOTAL_NUM); }while(i < DataCenter.TOTAL_NUM); } else{ long current_time = System.currentTimeMillis(); long send_time = packet.getSendTime(); //check whether it's the time to send the message //if not, sleep for required length of time if(send_time > current_time){ try{ Thread.sleep(send_time - current_time); } catch(InterruptedException e){ System.err.println("In message thread, message delay is interrupted."); System.err.println(e); } } //send the message try{ setPacketVariableInDataCenter(packet); sendPacket(packet); } catch(IOException e){ System.err.println("error in send packet."); System.err.println(e); } } // System.out.println("After sending message, new ack_num is " + data_center.getMessageAckNum()); } } private void setPacketVariableInDataCenter(Packet p){ int ack_num = 0; int model = p.getModel(); Packet.PacketType type = p.getType(); switch(type){ case Search: case Delete: ack_num = 1; break; case Insert: case Update: case Get: if(model == 1 || model == 2 || model == 3) ack_num = 1; else if(model == 4) ack_num = 2; else ack_num = 0; break; default: ack_num = 0; break; } data_center.setLastMessageTime(p.getTimestamp()); data_center.setMessageAckNum(ack_num); } protected synchronized void sendPacket(Packet packet) throws IOException { // System.out.println("A packet with desitination "+packet.getDestination() + ", lastMsgAckNum " + data_center.getMessageAckNum()); if(packet.getDestination()<0 || packet.getDestination() > DataCenter.TOTAL_NUM){ System.out.println("A packet with invalid desitination "+packet.getDestination()+", drop it!"); return; } else if (packet.getDestination() == DataCenter.TOTAL_NUM){ leader_obj.writeObject(packet); } else{ obj_os[packet.getDestination()].writeObject(packet); } } public ModeDataCenter getDataCenter(){ return data_center; } }
4,854
0.574372
0.570251
143
32.944057
26.133539
138
false
false
0
0
0
0
0
0
2.097902
false
false
4
7a0926f9618456f89e57fff975a50f4df3900f4e
32,427,003,116,686
f5f367e0b0de4c1a9353cfbfaf491a3bfdf84bf2
/CountriesApp.java
2699625679111e87680b58a85f57a951eaf11d7c
[]
no_license
kbsasikarthik/Lab16FileIO
https://github.com/kbsasikarthik/Lab16FileIO
948bbdc158b980f15750a94f12cad4364d69fc82
9d653de9b68ea5792606648f00b5f1b1dd630018
refs/heads/master
2020-03-25T01:15:31.451000
2018-08-02T02:25:26
2018-08-02T02:25:26
143,228,349
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
//@ Sasikaladevi Kumarasamy package lab16; import java.util.ArrayList; import java.util.Scanner; // Uses fileI/O system to read data from file and create objects with it and store the objects in an ArrayList // write user entered data to file as well as corresponding object to the ArrayList // user can List, Add, Remove or Exit public class CountriesApp { // a static variable which can be used by all methods in this class public static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int menuOption=0; boolean isValid = false; // create a new ArrayList to store the objects ArrayList<Country> countries = new ArrayList<>(); // display welcome message System.out.println("Welcome to the List of Countries!\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); do { mainMenu(); menuOption = Validator.getInteger(sc,"Please enter your option from the menu(1,2,3,4): ", 1, 4); sc.nextLine(); if(menuOption == 1) { listCountries(countries); isValid=false; }else if(menuOption == 2) { addCountry(countries); isValid=false; }else if(menuOption == 3) { countries=removeCountry(countries); isValid=false; }else isValid = true; } while(!isValid); // display concluding message System.out.println("\nThanks for your interest! Bye!!"); } // end of main method // displays main menu with options for the user to select from private static void mainMenu() { System.out.println("\nMain Menu:\n---- -----"); System.out.println("1. List Countries\n2. Add a Country\n3. Remove a Country\n4. Exit"); } // reads data from the file, stores it as objects in an ArrayList and then and lists it private static void listCountries(ArrayList<Country> countries) { System.out.println("\nList of countries on File:\n**** ** ********* ** *****"); countries = CountriesTextFile.readFile(); for (Country country : countries) { System.out.println(country.getNameOfCountry()); } } // adds the user entered data to the file and updates the ArrayList containing // corresponding objects as well private static void addCountry(ArrayList<Country> countries) { String addCountry=""; addCountry = Validator.getString(sc, "Enter a Country to be added: "); Country newCountry = new Country(addCountry.trim()); countries.add(newCountry); CountriesTextFile.appendLine(newCountry); System.out.println("\n"+addCountry.trim()+" has been added!"); } // removes the data chosen by the user and updates the file and the ArrayList as well private static ArrayList<Country> removeCountry(ArrayList<Country> countries) { listCountries(countries); String removeCountry = Validator.getString(sc,"\nPlease enter a country from the list to remove: "); if(removeCountry.isEmpty()) { System.out.println("Invalid entry! Try again."); removeCountry(countries); }else { countries = CountriesTextFile.readFile(); for(int i = 0; i<countries.size();i++) { if(countries.get(i).getNameOfCountry().equalsIgnoreCase(removeCountry.trim())) { countries.remove(i); } } System.out.println("\n"+removeCountry.trim().toUpperCase() +" has been removed!"); CountriesTextFile.writeFile(countries); } return countries; } }// end of class
UTF-8
Java
3,276
java
CountriesApp.java
Java
[ { "context": "//@ Sasikaladevi Kumarasamy\npackage lab16;\n\nimport java.util.ArrayList;\nimpor", "end": 27, "score": 0.9998750686645508, "start": 4, "tag": "NAME", "value": "Sasikaladevi Kumarasamy" } ]
null
[]
//@ <NAME> package lab16; import java.util.ArrayList; import java.util.Scanner; // Uses fileI/O system to read data from file and create objects with it and store the objects in an ArrayList // write user entered data to file as well as corresponding object to the ArrayList // user can List, Add, Remove or Exit public class CountriesApp { // a static variable which can be used by all methods in this class public static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int menuOption=0; boolean isValid = false; // create a new ArrayList to store the objects ArrayList<Country> countries = new ArrayList<>(); // display welcome message System.out.println("Welcome to the List of Countries!\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); do { mainMenu(); menuOption = Validator.getInteger(sc,"Please enter your option from the menu(1,2,3,4): ", 1, 4); sc.nextLine(); if(menuOption == 1) { listCountries(countries); isValid=false; }else if(menuOption == 2) { addCountry(countries); isValid=false; }else if(menuOption == 3) { countries=removeCountry(countries); isValid=false; }else isValid = true; } while(!isValid); // display concluding message System.out.println("\nThanks for your interest! Bye!!"); } // end of main method // displays main menu with options for the user to select from private static void mainMenu() { System.out.println("\nMain Menu:\n---- -----"); System.out.println("1. List Countries\n2. Add a Country\n3. Remove a Country\n4. Exit"); } // reads data from the file, stores it as objects in an ArrayList and then and lists it private static void listCountries(ArrayList<Country> countries) { System.out.println("\nList of countries on File:\n**** ** ********* ** *****"); countries = CountriesTextFile.readFile(); for (Country country : countries) { System.out.println(country.getNameOfCountry()); } } // adds the user entered data to the file and updates the ArrayList containing // corresponding objects as well private static void addCountry(ArrayList<Country> countries) { String addCountry=""; addCountry = Validator.getString(sc, "Enter a Country to be added: "); Country newCountry = new Country(addCountry.trim()); countries.add(newCountry); CountriesTextFile.appendLine(newCountry); System.out.println("\n"+addCountry.trim()+" has been added!"); } // removes the data chosen by the user and updates the file and the ArrayList as well private static ArrayList<Country> removeCountry(ArrayList<Country> countries) { listCountries(countries); String removeCountry = Validator.getString(sc,"\nPlease enter a country from the list to remove: "); if(removeCountry.isEmpty()) { System.out.println("Invalid entry! Try again."); removeCountry(countries); }else { countries = CountriesTextFile.readFile(); for(int i = 0; i<countries.size();i++) { if(countries.get(i).getNameOfCountry().equalsIgnoreCase(removeCountry.trim())) { countries.remove(i); } } System.out.println("\n"+removeCountry.trim().toUpperCase() +" has been removed!"); CountriesTextFile.writeFile(countries); } return countries; } }// end of class
3,259
0.694444
0.689255
96
33.125
29.232277
110
false
false
0
0
0
0
0
0
2.427083
false
false
4
7bb07a7852f1fccf0a06d1f06f219f948f355d09
15,324,443,325,626
3b4a06fb721b23eaf8eae534c8def2f4c329b3bb
/skyski-selenium/src/main/java/module/skyski_selenium/casus/BibliographyPage.java
4b1dcdd33ffdd1e24839a4ed0ba6858b9acc1c66
[]
no_license
pavelski01/SkyskiTestProject
https://github.com/pavelski01/SkyskiTestProject
75bdf07a7dd3c8654b995f4bb39f1cb2959998c4
79a0e2e0dcc104e0340912a3bd9d674faaae42a1
refs/heads/master
2021-01-22T00:58:32.166000
2015-10-31T18:18:48
2015-10-31T18:18:48
28,569,630
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package module.skyski_selenium.casus; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import module.skyski_selenium.fixture.TestCaseFixture; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public final class BibliographyPage extends TestCaseFixture { @Test public void bibliographyPageShouldLoadAndU_ValidUrl_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.findAndClickElementByCss("form tfoot > tr > td > a"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("SKYski Project", "Load home page"); } @Test public void bibliographyPageShouldChangeLanguage_PolishRussianEnglish_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("form > a:nth-of-type(2)"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("Bibliografia SKYski", "Load home bibliography in polish"); super.findAndClickElementByCss("form > a:last-of-type"); super.titleNotAssertion("Bibliografia SKYski", "Unload home bibliography in polish"); super.titleAssertion("Библиография SKYski", "Load home bibliography in russian"); super.findAndClickElementByCss("form > a:first-of-type"); super.titleNotAssertion("Библиография SKYski", "Unload home bibliography in russian"); super.titleAssertion("SKYski Bibliography", "Load home bibliography in english"); } @Test public void bibliographyPageShouldSortByAuthors_AuthorsEnglishPolishRussian_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.resetScreen(); super.adjustScreen(); super.sortAssertion( "form table > thead > tr > td:nth-of-type(2) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(2)", "form table > tbody > tr:last-of-type > td:nth-of-type(2)", false ); super.findAndClickElementByCss("form > a:nth-of-type(2)"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("Bibliografia SKYski", "Load home bibliography in polish"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(2) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(2)", "form table > tbody > tr:last-of-type > td:nth-of-type(2)", false ); super.findAndClickElementByCss("form > a:last-of-type"); super.titleNotAssertion("Bibliografia SKYski", "Unload home bibliography in polish"); super.titleAssertion("Библиография SKYski", "Load home bibliography in russian"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(2) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(2)", "form table > tbody > tr:last-of-type > td:nth-of-type(2)", false ); } @Test public void bibliographyPageShouldSortByTitles_TitlesEnglishPolishRussian_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.resetScreen(); super.adjustScreen(); super.sortAssertion( "form table > thead > tr > td:nth-of-type(3) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(3)", "form table > tbody > tr:last-of-type > td:nth-of-type(3)", false ); super.findAndClickElementByCss("form > a:nth-of-type(2)"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("Bibliografia SKYski", "Load home bibliography in polish"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(3) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(3)", "form table > tbody > tr:last-of-type > td:nth-of-type(3)", false ); super.findAndClickElementByCss("form > a:last-of-type"); super.titleNotAssertion("Bibliografia SKYski", "Unload home bibliography in polish"); super.titleAssertion("Библиография SKYski", "Load home bibliography in russian"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(3) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(3)", "form table > tbody > tr:last-of-type > td:nth-of-type(3)", false ); } @Test public void bibliographyPageShouldSortByPlaceAndYearOfPublication_PlaceAndYearOfPublicationEnglishPolishRussian_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.resetScreen(); super.adjustScreen(); super.sortAssertion( "form table > thead > tr > td:nth-of-type(4) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(4)", "form table > tbody > tr:last-of-type > td:nth-of-type(4)", false ); super.findAndClickElementByCss("form > a:nth-of-type(2)"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("Bibliografia SKYski", "Load home bibliography in polish"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(4) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(4)", "form table > tbody > tr:last-of-type > td:nth-of-type(4)", false ); super.findAndClickElementByCss("form > a:last-of-type"); super.titleNotAssertion("Bibliografia SKYski", "Unload home bibliography in polish"); super.titleAssertion("Библиография SKYski", "Load home bibliography in russian"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(4) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(4)", "form table > tbody > tr:last-of-type > td:nth-of-type(4)", false ); } }
UTF-8
Java
6,535
java
BibliographyPage.java
Java
[]
null
[]
package module.skyski_selenium.casus; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import module.skyski_selenium.fixture.TestCaseFixture; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public final class BibliographyPage extends TestCaseFixture { @Test public void bibliographyPageShouldLoadAndU_ValidUrl_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.findAndClickElementByCss("form tfoot > tr > td > a"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("SKYski Project", "Load home page"); } @Test public void bibliographyPageShouldChangeLanguage_PolishRussianEnglish_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("form > a:nth-of-type(2)"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("Bibliografia SKYski", "Load home bibliography in polish"); super.findAndClickElementByCss("form > a:last-of-type"); super.titleNotAssertion("Bibliografia SKYski", "Unload home bibliography in polish"); super.titleAssertion("Библиография SKYski", "Load home bibliography in russian"); super.findAndClickElementByCss("form > a:first-of-type"); super.titleNotAssertion("Библиография SKYski", "Unload home bibliography in russian"); super.titleAssertion("SKYski Bibliography", "Load home bibliography in english"); } @Test public void bibliographyPageShouldSortByAuthors_AuthorsEnglishPolishRussian_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.resetScreen(); super.adjustScreen(); super.sortAssertion( "form table > thead > tr > td:nth-of-type(2) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(2)", "form table > tbody > tr:last-of-type > td:nth-of-type(2)", false ); super.findAndClickElementByCss("form > a:nth-of-type(2)"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("Bibliografia SKYski", "Load home bibliography in polish"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(2) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(2)", "form table > tbody > tr:last-of-type > td:nth-of-type(2)", false ); super.findAndClickElementByCss("form > a:last-of-type"); super.titleNotAssertion("Bibliografia SKYski", "Unload home bibliography in polish"); super.titleAssertion("Библиография SKYski", "Load home bibliography in russian"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(2) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(2)", "form table > tbody > tr:last-of-type > td:nth-of-type(2)", false ); } @Test public void bibliographyPageShouldSortByTitles_TitlesEnglishPolishRussian_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.resetScreen(); super.adjustScreen(); super.sortAssertion( "form table > thead > tr > td:nth-of-type(3) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(3)", "form table > tbody > tr:last-of-type > td:nth-of-type(3)", false ); super.findAndClickElementByCss("form > a:nth-of-type(2)"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("Bibliografia SKYski", "Load home bibliography in polish"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(3) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(3)", "form table > tbody > tr:last-of-type > td:nth-of-type(3)", false ); super.findAndClickElementByCss("form > a:last-of-type"); super.titleNotAssertion("Bibliografia SKYski", "Unload home bibliography in polish"); super.titleAssertion("Библиография SKYski", "Load home bibliography in russian"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(3) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(3)", "form table > tbody > tr:last-of-type > td:nth-of-type(3)", false ); } @Test public void bibliographyPageShouldSortByPlaceAndYearOfPublication_PlaceAndYearOfPublicationEnglishPolishRussian_Success() { super.resetScreen(); super.adjustScreen(); super.findAndClickElementByCss("#bibliography"); super.titleNotAssertion("SKYski Project", "Unload home page"); super.titleAssertion("SKYski Bibliography", "Load bibliography page"); super.resetScreen(); super.adjustScreen(); super.sortAssertion( "form table > thead > tr > td:nth-of-type(4) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(4)", "form table > tbody > tr:last-of-type > td:nth-of-type(4)", false ); super.findAndClickElementByCss("form > a:nth-of-type(2)"); super.titleNotAssertion("SKYski Bibliography", "Unload bibliography page"); super.titleAssertion("Bibliografia SKYski", "Load home bibliography in polish"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(4) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(4)", "form table > tbody > tr:last-of-type > td:nth-of-type(4)", false ); super.findAndClickElementByCss("form > a:last-of-type"); super.titleNotAssertion("Bibliografia SKYski", "Unload home bibliography in polish"); super.titleAssertion("Библиография SKYski", "Load home bibliography in russian"); super.sortAssertion( "form table > thead > tr > td:nth-of-type(4) > a", "form table > tbody > tr:first-of-type > td:nth-of-type(4)", "form table > tbody > tr:last-of-type > td:nth-of-type(4)", false ); } }
6,535
0.713887
0.709077
153
41.124184
29.586546
126
false
false
0
0
0
0
0
0
2.738562
false
false
4
d5cf3d13e4d945165f4a1d8262c21d18d9c69e28
15,358,803,079,095
ac23f46ce6667fe7f5d7b33de0036be4d600254d
/src/main/java/Lesson7.java
ed4f7a8c4dd8b1fc80fa2a0c444c44cd6aa63d6f
[]
no_license
natalkaya/java-core-base
https://github.com/natalkaya/java-core-base
c41ea0723828bd8b7a14cbe0aeacd3dd19219a73
2c4550619b6149732532e7dce526db84c20d6366
refs/heads/master
2022-12-24T00:21:13.983000
2020-09-18T10:15:07
2020-09-18T10:15:07
289,559,388
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import org.apache.commons.lang3.RandomStringUtils; import plates.Cat; import plates.Plate; import java.util.ArrayList; import java.util.List; /** * Расширить задачу про котов и тарелки с едой. * Сделать так, чтобы в тарелке с едой не могло получиться отрицательного количества еды (например, в миске 10 еды, а кот пытается покушать 15-20). * Каждому коту нужно добавить поле сытость (когда создаем котов, они голодны). Если коту удалось покушать (хватило еды), сытость = true. * Считаем, что если коту мало еды в тарелке, то он её просто не трогает, то есть не может быть наполовину сыт (это сделано для упрощения логики программы). * Создать массив котов и тарелку с едой, попросить всех котов покушать из этой тарелки и потом вывести информацию о сытости котов в консоль. * Добавить в тарелку метод, с помощью которого можно было бы добавлять еду в тарелку. */ public class Lesson7 { public static void main(String[] args) { final int catsCount = 5; final int appetite = 5; List<Cat> cats = new ArrayList<>(); Plate plate = new Plate(catsCount * appetite + 2); plate.info(); for (int i = 0; i < catsCount; i++) { cats.add(new Cat(RandomStringUtils.randomAlphabetic(5), appetite)); } System.out.println("Generated cats:"); cats.forEach(System.out::println); cats.forEach(cat -> cat.eat(plate)); System.out.println("1. Cats after eating:"); cats.forEach(System.out::println); plate.info(); System.out.println("Add eating to plate"); plate.add(appetite); plate.info(); cats.forEach(cat -> cat.eat(plate)); System.out.println("2. Cats after eating:"); cats.forEach(System.out::println); plate.info(); } }
UTF-8
Java
2,346
java
Lesson7.java
Java
[]
null
[]
import org.apache.commons.lang3.RandomStringUtils; import plates.Cat; import plates.Plate; import java.util.ArrayList; import java.util.List; /** * Расширить задачу про котов и тарелки с едой. * Сделать так, чтобы в тарелке с едой не могло получиться отрицательного количества еды (например, в миске 10 еды, а кот пытается покушать 15-20). * Каждому коту нужно добавить поле сытость (когда создаем котов, они голодны). Если коту удалось покушать (хватило еды), сытость = true. * Считаем, что если коту мало еды в тарелке, то он её просто не трогает, то есть не может быть наполовину сыт (это сделано для упрощения логики программы). * Создать массив котов и тарелку с едой, попросить всех котов покушать из этой тарелки и потом вывести информацию о сытости котов в консоль. * Добавить в тарелку метод, с помощью которого можно было бы добавлять еду в тарелку. */ public class Lesson7 { public static void main(String[] args) { final int catsCount = 5; final int appetite = 5; List<Cat> cats = new ArrayList<>(); Plate plate = new Plate(catsCount * appetite + 2); plate.info(); for (int i = 0; i < catsCount; i++) { cats.add(new Cat(RandomStringUtils.randomAlphabetic(5), appetite)); } System.out.println("Generated cats:"); cats.forEach(System.out::println); cats.forEach(cat -> cat.eat(plate)); System.out.println("1. Cats after eating:"); cats.forEach(System.out::println); plate.info(); System.out.println("Add eating to plate"); plate.add(appetite); plate.info(); cats.forEach(cat -> cat.eat(plate)); System.out.println("2. Cats after eating:"); cats.forEach(System.out::println); plate.info(); } }
2,346
0.668708
0.660356
44
39.81818
39.491238
156
false
false
0
0
0
0
0
0
0.840909
false
false
4
c1b437e6e7aaaf4702e20d81f166e713ae785712
11,630,771,449,809
c8d753c500a90a476ef5439ebbc7bcc9b702ae96
/src/main/java/Creational/Builder/pattern/example1/Computer.java
49c3863b111b5d40b66cfb4462a7c5166b4d9f6d
[]
no_license
asniii/design-patterns
https://github.com/asniii/design-patterns
1e12e49fca9b015eb64521ae3ca74faf6f23ba3d
55077e6157c2c753fe32ad7c966cd2d7086b2182
refs/heads/master
2020-03-22T18:33:39.161000
2019-05-23T08:41:24
2019-05-23T08:41:24
140,467,439
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package Creational.Builder.pattern.example1; public class Computer { public static class ComputerBuilder{ private String monitor; private String ram; private String cpu; private String motherBoard; private String cabinet; private String smps; private String hardDisk; private String ssd; private String cdRom; private String floopyDisk; private String fan; private String keyboard; private String mouse; private String camera; private String touchpad; ComputerBuilder(String monitor, String ram, String motherBoard,String mouse, String keyboard){ this.monitor = monitor; this.ram = ram; this.motherBoard = motherBoard; this.mouse = mouse; this.keyboard = keyboard; } public ComputerBuilder cpu(String cpu){ this.cpu = cpu; return this; } public ComputerBuilder cabinet(String cabinet){ this.cabinet = cabinet; return this; } public ComputerBuilder smps(String smps){ this.smps = smps; return this; } public ComputerBuilder hardDisk(String hardDisk){ this.hardDisk = hardDisk; return this; } public ComputerBuilder ssd(String ssd){ this.ssd = ssd; return this; } public ComputerBuilder cdRom(String cdRom){ this.cdRom = cdRom; return this; } public ComputerBuilder floopyDisk(String floopyDisk){ this.floopyDisk = floopyDisk; return this; } public ComputerBuilder fan(String fan){ this.fan = fan; return this; } public ComputerBuilder camera(String camera){ this.camera = camera; return this; } public ComputerBuilder touchpad(String touchpad){ this.touchpad = touchpad; return this; } public Computer build(){ return new Computer(this); } } private String monitor; private String ram; private String cpu; private String motherBoard; private String cabinet; private String smps; private String hardDisk; private String ssd; private String cdRom; private String floopyDisk; private String fan; private String keyboard; private String mouse; private String camera; private String touchpad; private Computer(ComputerBuilder computerBuilder){ this.monitor = computerBuilder.monitor; this.ram = computerBuilder.ram; this.cpu = computerBuilder.cpu; this.motherBoard = computerBuilder.motherBoard; this.cabinet = computerBuilder.cabinet; this.smps = computerBuilder.smps; this.hardDisk = computerBuilder.hardDisk; this.ssd = computerBuilder.ssd; this.cdRom = computerBuilder.cdRom; this.floopyDisk = computerBuilder.floopyDisk; this.fan = computerBuilder.fan; this.keyboard = computerBuilder.keyboard; this.mouse = computerBuilder.mouse; this.camera = computerBuilder.camera; this.touchpad = computerBuilder.touchpad; } public String getMonitor() { return monitor; } public String getRam() { return ram; } public String getCpu() { return cpu; } public String getMotherBoard() { return motherBoard; } public String getCabinet() { return cabinet; } public String getSmps() { return smps; } public String getHardDisk() { return hardDisk; } public String getSsd() { return ssd; } public String getCdRom() { return cdRom; } public String getFloopyDisk() { return floopyDisk; } public String getFan() { return fan; } public String getKeyboard() { return keyboard; } public String getMouse() { return mouse; } public String getCamera() { return camera; } public String getTouchpad() { return touchpad; } @Override public String toString() { return "Computer{" + "monitor='" + monitor + '\n' + ", ram='" + ram + '\n' + ", cpu='" + cpu + '\n' + ", motherBoard='" + motherBoard + '\n' + ", cabinet='" + cabinet + '\n' + ", smps='" + smps + '\n' + ", hardDisk='" + hardDisk + '\n' + ", ssd='" + ssd + '\n' + ", cdRom='" + cdRom + '\n' + ", floopyDisk='" + floopyDisk + '\n' + ", fan='" + fan + '\n' + ", keyboard='" + keyboard + '\n' + ", mouse='" + mouse + '\n' + ", camera='" + camera + '\n' + ", touchpad='" + touchpad + '\n' + '}'; } }
UTF-8
Java
5,081
java
Computer.java
Java
[]
null
[]
package Creational.Builder.pattern.example1; public class Computer { public static class ComputerBuilder{ private String monitor; private String ram; private String cpu; private String motherBoard; private String cabinet; private String smps; private String hardDisk; private String ssd; private String cdRom; private String floopyDisk; private String fan; private String keyboard; private String mouse; private String camera; private String touchpad; ComputerBuilder(String monitor, String ram, String motherBoard,String mouse, String keyboard){ this.monitor = monitor; this.ram = ram; this.motherBoard = motherBoard; this.mouse = mouse; this.keyboard = keyboard; } public ComputerBuilder cpu(String cpu){ this.cpu = cpu; return this; } public ComputerBuilder cabinet(String cabinet){ this.cabinet = cabinet; return this; } public ComputerBuilder smps(String smps){ this.smps = smps; return this; } public ComputerBuilder hardDisk(String hardDisk){ this.hardDisk = hardDisk; return this; } public ComputerBuilder ssd(String ssd){ this.ssd = ssd; return this; } public ComputerBuilder cdRom(String cdRom){ this.cdRom = cdRom; return this; } public ComputerBuilder floopyDisk(String floopyDisk){ this.floopyDisk = floopyDisk; return this; } public ComputerBuilder fan(String fan){ this.fan = fan; return this; } public ComputerBuilder camera(String camera){ this.camera = camera; return this; } public ComputerBuilder touchpad(String touchpad){ this.touchpad = touchpad; return this; } public Computer build(){ return new Computer(this); } } private String monitor; private String ram; private String cpu; private String motherBoard; private String cabinet; private String smps; private String hardDisk; private String ssd; private String cdRom; private String floopyDisk; private String fan; private String keyboard; private String mouse; private String camera; private String touchpad; private Computer(ComputerBuilder computerBuilder){ this.monitor = computerBuilder.monitor; this.ram = computerBuilder.ram; this.cpu = computerBuilder.cpu; this.motherBoard = computerBuilder.motherBoard; this.cabinet = computerBuilder.cabinet; this.smps = computerBuilder.smps; this.hardDisk = computerBuilder.hardDisk; this.ssd = computerBuilder.ssd; this.cdRom = computerBuilder.cdRom; this.floopyDisk = computerBuilder.floopyDisk; this.fan = computerBuilder.fan; this.keyboard = computerBuilder.keyboard; this.mouse = computerBuilder.mouse; this.camera = computerBuilder.camera; this.touchpad = computerBuilder.touchpad; } public String getMonitor() { return monitor; } public String getRam() { return ram; } public String getCpu() { return cpu; } public String getMotherBoard() { return motherBoard; } public String getCabinet() { return cabinet; } public String getSmps() { return smps; } public String getHardDisk() { return hardDisk; } public String getSsd() { return ssd; } public String getCdRom() { return cdRom; } public String getFloopyDisk() { return floopyDisk; } public String getFan() { return fan; } public String getKeyboard() { return keyboard; } public String getMouse() { return mouse; } public String getCamera() { return camera; } public String getTouchpad() { return touchpad; } @Override public String toString() { return "Computer{" + "monitor='" + monitor + '\n' + ", ram='" + ram + '\n' + ", cpu='" + cpu + '\n' + ", motherBoard='" + motherBoard + '\n' + ", cabinet='" + cabinet + '\n' + ", smps='" + smps + '\n' + ", hardDisk='" + hardDisk + '\n' + ", ssd='" + ssd + '\n' + ", cdRom='" + cdRom + '\n' + ", floopyDisk='" + floopyDisk + '\n' + ", fan='" + fan + '\n' + ", keyboard='" + keyboard + '\n' + ", mouse='" + mouse + '\n' + ", camera='" + camera + '\n' + ", touchpad='" + touchpad + '\n' + '}'; } }
5,081
0.542216
0.542019
191
25.602095
17.368769
102
false
false
0
0
0
0
0
0
0.554974
false
false
4
28b15cca4ad4f252cf414ba848cd6b69b4bf3ba1
10,067,403,384,363
98fe67efd1334147a2096135484d02f3d1a5bf24
/server/server-war/src/java/service/TimeframeResource.java
2f5c641ca47822091a93f3b10e73bcc6ea5a16c8
[]
no_license
daveangulo/ivolunteer
https://github.com/daveangulo/ivolunteer
8e473dfa16a8ccdf405e5b0940cb8db1151da31d
6375f7fe54b40d1fe3b95879165c00974c62ab4e
refs/heads/master
2021-01-17T12:11:53.167000
2009-09-23T01:08:14
2009-09-23T01:08:14
102,981
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Copyright (c) 2008 Boulder Community Foundation - iVolunteer * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package service; import javax.ws.rs.Path; import javax.ws.rs.GET; import javax.ws.rs.PUT; import javax.ws.rs.DELETE; import javax.ws.rs.Produces; import javax.ws.rs.Consumes; import javax.ws.rs.QueryParam; import javax.ws.rs.DefaultValue; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; import com.sun.jersey.api.core.ResourceContext; import javax.ws.rs.WebApplicationException; import javax.persistence.NoResultException; import javax.persistence.EntityManager; import java.util.Collection; import persistence.Filter; import converter.TimeframeConverter; import persistence.Timeframe; /** * * @author Dave Angulo */ public class TimeframeResource { @Context protected UriInfo uriInfo; @Context protected ResourceContext resourceContext; protected String id; /** Creates a new instance of TimeframeResource */ public TimeframeResource() { } public void setId(String id) { this.id = id; } /** * Get method for retrieving an instance of Timeframe identified by id in * XML format. * * @param id * identifier for the entity * @return an instance of TimeframeConverter */ @GET @Produces( { "application/xml", "application/json" }) public TimeframeConverter get(@QueryParam("expandLevel") @DefaultValue("1") int expandLevel) { PersistenceService persistenceSvc = PersistenceService.getInstance(); try { persistenceSvc.beginTx(); return new TimeframeConverter(getEntity(), uriInfo.getAbsolutePath(), expandLevel); } finally { PersistenceService.getInstance().close(); } } /** * Put method for updating an instance of Timeframe identified by id using * XML as the input format. * * @param id * identifier for the entity * @param data * an TimeframeConverter entity that is deserialized from a XML * stream */ @PUT @Consumes( { "application/xml", "application/json" }) public void put(TimeframeConverter data) { PersistenceService persistenceSvc = PersistenceService.getInstance(); try { persistenceSvc.beginTx(); EntityManager em = persistenceSvc.getEntityManager(); updateEntity(getEntity(), data.resolveEntity(em)); persistenceSvc.commitTx(); } finally { persistenceSvc.close(); } } /** * Delete method for deleting an instance of Timeframe identified by id. * * @param id * identifier for the entity */ @DELETE public void delete() { PersistenceService persistenceSvc = PersistenceService.getInstance(); try { persistenceSvc.beginTx(); deleteEntity(getEntity()); persistenceSvc.commitTx(); } finally { persistenceSvc.close(); } } /** * Returns an instance of Timeframe identified by id. * * @param id * identifier for the entity * @return an instance of Timeframe */ protected Timeframe getEntity() { EntityManager em = PersistenceService.getInstance().getEntityManager(); try { return (Timeframe) em.createQuery("SELECT e FROM Timeframe e where e.id = :id") .setParameter("id", id).getSingleResult(); } catch (NoResultException ex) { throw new WebApplicationException(new Throwable("Resource for " + uriInfo.getAbsolutePath() + " does not exist."), 404); } } /** * Updates entity using data from newEntity. * * @param entity * the entity to update * @param newEntity * the entity containing the new data * @return the updated entity */ protected Timeframe updateEntity(Timeframe entity, Timeframe newEntity) { EntityManager em = PersistenceService.getInstance().getEntityManager(); Collection<Filter> filterCollection = entity.getFilterCollection(); Collection<Filter> filterCollectionNew = newEntity.getFilterCollection(); entity = em.merge(newEntity); for (Filter value : filterCollection) { if (!filterCollectionNew.contains(value)) { throw new WebApplicationException(new Throwable( "Cannot remove items from filterCollection")); } } for (Filter value : filterCollectionNew) { if (!filterCollection.contains(value)) { Timeframe oldEntity = value.getTimeframeId(); value.setTimeframeId(entity); if (oldEntity != null && !oldEntity.equals(entity)) { oldEntity.getFilterCollection().remove(value); } } } return entity; } /** * Deletes the entity. * * @param entity * the entity to deletle */ protected void deleteEntity(Timeframe entity) { EntityManager em = PersistenceService.getInstance().getEntityManager(); if (!entity.getFilterCollection().isEmpty()) { throw new WebApplicationException(new Throwable( "Cannot delete entity because filterCollection is not empty.")); } em.remove(entity); } /** * Returns a dynamic instance of FiltersResource used for entity navigation. * * @param id * identifier for the parent entity * @return an instance of FiltersResource */ @Path("filterCollection/") public FiltersResource getFilterCollectionResource() { FilterCollectionResourceSub resource = resourceContext .getResource(FilterCollectionResourceSub.class); resource.setParent(getEntity()); return resource; } public static class FilterCollectionResourceSub extends FiltersResource { private Timeframe parent; public void setParent(Timeframe parent) { this.parent = parent; } @Override protected Collection<Filter> getEntities(int start, int max, String query) { Collection<Filter> result = new java.util.ArrayList<Filter>(); int index = 0; for (Filter e : parent.getFilterCollection()) { if (index >= start && (index - start) < max) { result.add(e); } index++; } return result; } } }
UTF-8
Java
6,853
java
TimeframeResource.java
Java
[ { "context": "\nimport persistence.Timeframe;\n\n/**\n * \n * @author Dave Angulo\n */\n\npublic class TimeframeResource {\n\t@Context\n\t", "end": 1799, "score": 0.9997402429580688, "start": 1788, "tag": "NAME", "value": "Dave Angulo" } ]
null
[]
/* * Copyright (c) 2008 Boulder Community Foundation - iVolunteer * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package service; import javax.ws.rs.Path; import javax.ws.rs.GET; import javax.ws.rs.PUT; import javax.ws.rs.DELETE; import javax.ws.rs.Produces; import javax.ws.rs.Consumes; import javax.ws.rs.QueryParam; import javax.ws.rs.DefaultValue; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; import com.sun.jersey.api.core.ResourceContext; import javax.ws.rs.WebApplicationException; import javax.persistence.NoResultException; import javax.persistence.EntityManager; import java.util.Collection; import persistence.Filter; import converter.TimeframeConverter; import persistence.Timeframe; /** * * @author <NAME> */ public class TimeframeResource { @Context protected UriInfo uriInfo; @Context protected ResourceContext resourceContext; protected String id; /** Creates a new instance of TimeframeResource */ public TimeframeResource() { } public void setId(String id) { this.id = id; } /** * Get method for retrieving an instance of Timeframe identified by id in * XML format. * * @param id * identifier for the entity * @return an instance of TimeframeConverter */ @GET @Produces( { "application/xml", "application/json" }) public TimeframeConverter get(@QueryParam("expandLevel") @DefaultValue("1") int expandLevel) { PersistenceService persistenceSvc = PersistenceService.getInstance(); try { persistenceSvc.beginTx(); return new TimeframeConverter(getEntity(), uriInfo.getAbsolutePath(), expandLevel); } finally { PersistenceService.getInstance().close(); } } /** * Put method for updating an instance of Timeframe identified by id using * XML as the input format. * * @param id * identifier for the entity * @param data * an TimeframeConverter entity that is deserialized from a XML * stream */ @PUT @Consumes( { "application/xml", "application/json" }) public void put(TimeframeConverter data) { PersistenceService persistenceSvc = PersistenceService.getInstance(); try { persistenceSvc.beginTx(); EntityManager em = persistenceSvc.getEntityManager(); updateEntity(getEntity(), data.resolveEntity(em)); persistenceSvc.commitTx(); } finally { persistenceSvc.close(); } } /** * Delete method for deleting an instance of Timeframe identified by id. * * @param id * identifier for the entity */ @DELETE public void delete() { PersistenceService persistenceSvc = PersistenceService.getInstance(); try { persistenceSvc.beginTx(); deleteEntity(getEntity()); persistenceSvc.commitTx(); } finally { persistenceSvc.close(); } } /** * Returns an instance of Timeframe identified by id. * * @param id * identifier for the entity * @return an instance of Timeframe */ protected Timeframe getEntity() { EntityManager em = PersistenceService.getInstance().getEntityManager(); try { return (Timeframe) em.createQuery("SELECT e FROM Timeframe e where e.id = :id") .setParameter("id", id).getSingleResult(); } catch (NoResultException ex) { throw new WebApplicationException(new Throwable("Resource for " + uriInfo.getAbsolutePath() + " does not exist."), 404); } } /** * Updates entity using data from newEntity. * * @param entity * the entity to update * @param newEntity * the entity containing the new data * @return the updated entity */ protected Timeframe updateEntity(Timeframe entity, Timeframe newEntity) { EntityManager em = PersistenceService.getInstance().getEntityManager(); Collection<Filter> filterCollection = entity.getFilterCollection(); Collection<Filter> filterCollectionNew = newEntity.getFilterCollection(); entity = em.merge(newEntity); for (Filter value : filterCollection) { if (!filterCollectionNew.contains(value)) { throw new WebApplicationException(new Throwable( "Cannot remove items from filterCollection")); } } for (Filter value : filterCollectionNew) { if (!filterCollection.contains(value)) { Timeframe oldEntity = value.getTimeframeId(); value.setTimeframeId(entity); if (oldEntity != null && !oldEntity.equals(entity)) { oldEntity.getFilterCollection().remove(value); } } } return entity; } /** * Deletes the entity. * * @param entity * the entity to deletle */ protected void deleteEntity(Timeframe entity) { EntityManager em = PersistenceService.getInstance().getEntityManager(); if (!entity.getFilterCollection().isEmpty()) { throw new WebApplicationException(new Throwable( "Cannot delete entity because filterCollection is not empty.")); } em.remove(entity); } /** * Returns a dynamic instance of FiltersResource used for entity navigation. * * @param id * identifier for the parent entity * @return an instance of FiltersResource */ @Path("filterCollection/") public FiltersResource getFilterCollectionResource() { FilterCollectionResourceSub resource = resourceContext .getResource(FilterCollectionResourceSub.class); resource.setParent(getEntity()); return resource; } public static class FilterCollectionResourceSub extends FiltersResource { private Timeframe parent; public void setParent(Timeframe parent) { this.parent = parent; } @Override protected Collection<Filter> getEntities(int start, int max, String query) { Collection<Filter> result = new java.util.ArrayList<Filter>(); int index = 0; for (Filter e : parent.getFilterCollection()) { if (index >= start && (index - start) < max) { result.add(e); } index++; } return result; } } }
6,848
0.713556
0.712243
227
29.189426
26.053051
95
false
false
0
0
0
0
0
0
1.797357
false
false
4
215faacde03a3a9d77d60bc3e19dc5c04e891a69
30,013,231,465,048
f4b52a92bdf4eeda31a647b465df73c478294ca4
/app/src/main/java/com/pokemonbattlearena/android/activity/BaseActivity.java
b7af460cdf5a798d2338ccc27a0c262ffb114aaa
[]
no_license
cireficc/pokemon-arena-android
https://github.com/cireficc/pokemon-arena-android
b03b4b2f3cec5d3d83aeff0dc81a89ce996816dd
7f2d2cc17b542c8e62ef92a6b2dc6406cca4abc8
refs/heads/master
2020-12-25T15:09:15.490000
2017-01-07T17:36:37
2017-01-07T17:36:37
68,238,759
4
2
null
false
2017-10-22T14:57:20
2016-09-14T20:00:17
2016-12-07T19:08:44
2017-10-22T14:56:56
40,383
1
2
10
Java
false
null
package com.pokemonbattlearena.android.activity; import android.app.ProgressDialog; import android.content.DialogInterface; import android.support.annotation.VisibleForTesting; import android.support.v7.app.AppCompatActivity; import android.view.WindowManager; import com.pokemonbattlearena.android.R; /** * Created by droidowl on 9/25/16. */ public class BaseActivity extends AppCompatActivity { @VisibleForTesting public ProgressDialog mProgressDialog; public void showProgressDialog() { if (mProgressDialog == null) { mProgressDialog = new ProgressDialog(this); mProgressDialog.setMessage(getString(R.string.loading)); mProgressDialog.setIndeterminate(true); } mProgressDialog.show(); } public void hideProgressDialog() { if (mProgressDialog != null && mProgressDialog.isShowing()) { mProgressDialog.dismiss(); } } public void keepScreenOn() { getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } // Clears the flag that keeps the screen on. public void stopKeepingScreenOn() { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } public void hideKeyboard() { getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); } @Override public void onStop() { super.onStop(); hideProgressDialog(); } }
UTF-8
Java
1,467
java
BaseActivity.java
Java
[ { "context": "m.pokemonbattlearena.android.R;\n\n/**\n * Created by droidowl on 9/25/16.\n */\n\npublic class BaseActivity extend", "end": 331, "score": 0.9996199011802673, "start": 323, "tag": "USERNAME", "value": "droidowl" } ]
null
[]
package com.pokemonbattlearena.android.activity; import android.app.ProgressDialog; import android.content.DialogInterface; import android.support.annotation.VisibleForTesting; import android.support.v7.app.AppCompatActivity; import android.view.WindowManager; import com.pokemonbattlearena.android.R; /** * Created by droidowl on 9/25/16. */ public class BaseActivity extends AppCompatActivity { @VisibleForTesting public ProgressDialog mProgressDialog; public void showProgressDialog() { if (mProgressDialog == null) { mProgressDialog = new ProgressDialog(this); mProgressDialog.setMessage(getString(R.string.loading)); mProgressDialog.setIndeterminate(true); } mProgressDialog.show(); } public void hideProgressDialog() { if (mProgressDialog != null && mProgressDialog.isShowing()) { mProgressDialog.dismiss(); } } public void keepScreenOn() { getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } // Clears the flag that keeps the screen on. public void stopKeepingScreenOn() { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } public void hideKeyboard() { getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); } @Override public void onStop() { super.onStop(); hideProgressDialog(); } }
1,467
0.691207
0.687117
53
26.679245
24.375811
89
false
false
0
0
0
0
0
0
0.339623
false
false
4
c7d2b498f033cf58659f9edf45f250cf747914fc
3,324,304,695,412
ef957a9eaaea60734ee356be91b76c7c5b54e725
/blogV1/src/main/java/com/blog/dao/BlogtypeDao.java
20de8b692064de22286cee433174ceb759b70456
[]
no_license
zhuzhujian/personBlogSys
https://github.com/zhuzhujian/personBlogSys
c6127ed61be3aac71ffd96418a3f232bf355e70f
d6313f9570c330f29bfa105e8a1e156fa78b3190
refs/heads/master
2022-05-11T12:06:50.554000
2019-09-27T07:06:15
2019-09-27T07:06:15
211,256,763
0
0
null
false
2022-03-31T21:40:47
2019-09-27T07:02:36
2019-09-27T07:08:03
2022-03-31T21:40:47
3,362
0
0
6
JavaScript
false
false
package com.blog.dao; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.stereotype.Repository; import com.blog.entitys.Blogtype; import com.blog.beans.PageBean; @Repository public class BlogtypeDao { @Autowired JdbcTemplate jdbcTemplate; @Autowired NamedParameterJdbcTemplate namedJdbcTemplate; public Blogtype findById(Integer id) { return jdbcTemplate.queryForObject("select * from blogtype where id=?", new BeanPropertyRowMapper<Blogtype>(Blogtype.class),id); } //全部记录 public List<Blogtype> listAll(Integer user_id){ String sql="SELECT * FROM blogtype where user_id=? "; return jdbcTemplate.query(sql, new BeanPropertyRowMapper<Blogtype>(Blogtype.class),user_id); } // 分页查询 public PageBean list(Integer pgNo,Integer pgSize, Map<String,Object> params){ PageBean page = new PageBean(pgNo,pgSize); Integer user_id=(Integer) params.get("user_id"); String sql="SELECT * FROM blogtype where user_id=? "; //-----查询记录条数 String sql_count="select count(*) as num from ( "+sql +" ) as ds"; int total=(Integer) jdbcTemplate.queryForObject(sql_count, Integer.class,user_id); page.setTotal(total); sql+=" limit "+page.getStartIndex()+" ,"+ page.getPageSize(); page.setRows(jdbcTemplate.query(sql, new BeanPropertyRowMapper<Blogtype>(Blogtype.class),user_id)); return page; } // 添加 public boolean add(Blogtype blogtype) { return jdbcTemplate.update("insert into blogtype(typeName, orderNum,user_id ) values(?,?,?)",blogtype.getTypeName(), blogtype.getOrderNum(),blogtype.getUser_id())>0; } // 更新 public boolean update(Blogtype blogtype) { return jdbcTemplate.update("update blogtype SET typeName=?, orderNum=? where id =? ",blogtype.getTypeName(), blogtype.getOrderNum(), blogtype.getId())>0; } // 删除 public boolean delete(Integer id) { return jdbcTemplate.update("delete from blogtype where id=?",id) >0; } public List getBlogtypeList(Integer user_id) { String sql="SELECT blogtype.*,count(blog.id) as blogCount FROM blog right join blogtype on blogtype.id=blog.type_id where blog.user_id=? group by blog.type_id "; return jdbcTemplate.query(sql, new BeanPropertyRowMapper<Blogtype>(Blogtype.class),user_id); } }
UTF-8
Java
2,507
java
BlogtypeDao.java
Java
[]
null
[]
package com.blog.dao; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.stereotype.Repository; import com.blog.entitys.Blogtype; import com.blog.beans.PageBean; @Repository public class BlogtypeDao { @Autowired JdbcTemplate jdbcTemplate; @Autowired NamedParameterJdbcTemplate namedJdbcTemplate; public Blogtype findById(Integer id) { return jdbcTemplate.queryForObject("select * from blogtype where id=?", new BeanPropertyRowMapper<Blogtype>(Blogtype.class),id); } //全部记录 public List<Blogtype> listAll(Integer user_id){ String sql="SELECT * FROM blogtype where user_id=? "; return jdbcTemplate.query(sql, new BeanPropertyRowMapper<Blogtype>(Blogtype.class),user_id); } // 分页查询 public PageBean list(Integer pgNo,Integer pgSize, Map<String,Object> params){ PageBean page = new PageBean(pgNo,pgSize); Integer user_id=(Integer) params.get("user_id"); String sql="SELECT * FROM blogtype where user_id=? "; //-----查询记录条数 String sql_count="select count(*) as num from ( "+sql +" ) as ds"; int total=(Integer) jdbcTemplate.queryForObject(sql_count, Integer.class,user_id); page.setTotal(total); sql+=" limit "+page.getStartIndex()+" ,"+ page.getPageSize(); page.setRows(jdbcTemplate.query(sql, new BeanPropertyRowMapper<Blogtype>(Blogtype.class),user_id)); return page; } // 添加 public boolean add(Blogtype blogtype) { return jdbcTemplate.update("insert into blogtype(typeName, orderNum,user_id ) values(?,?,?)",blogtype.getTypeName(), blogtype.getOrderNum(),blogtype.getUser_id())>0; } // 更新 public boolean update(Blogtype blogtype) { return jdbcTemplate.update("update blogtype SET typeName=?, orderNum=? where id =? ",blogtype.getTypeName(), blogtype.getOrderNum(), blogtype.getId())>0; } // 删除 public boolean delete(Integer id) { return jdbcTemplate.update("delete from blogtype where id=?",id) >0; } public List getBlogtypeList(Integer user_id) { String sql="SELECT blogtype.*,count(blog.id) as blogCount FROM blog right join blogtype on blogtype.id=blog.type_id where blog.user_id=? group by blog.type_id "; return jdbcTemplate.query(sql, new BeanPropertyRowMapper<Blogtype>(Blogtype.class),user_id); } }
2,507
0.749493
0.748277
72
33.263889
40.566814
167
false
false
0
0
0
0
0
0
1.805556
false
false
1
00aca214f3e559ad2bf1b04a5166c3379feffd7b
4,183,298,150,947
cea1bf31f443aa4c479d1d1004bf5640b5aad059
/Test/src/string/StrFormCharArray.java
e859a07d4fd38537a46047886ac734f2fcc939aa
[]
no_license
PrakashKumarMallick/CoreJavaPractice
https://github.com/PrakashKumarMallick/CoreJavaPractice
0cb951207ceac9158a2700305b4d4cb98c3700ad
be68431c4c650f2781ba642b6c9c45d2030f0f8c
refs/heads/master
2021-03-30T23:14:22.274000
2018-03-13T10:51:24
2018-03-13T10:51:24
125,032,846
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package string; public class StrFormCharArray { public static void main(String[] args) { char c[]={'R','E','M','E','M','B','E','R'}; String s=new String(c); System.out.println(s); String s1=new String(c,2,6); System.out.println(s1); String sb="1"; String sb1="2"; } }
UTF-8
Java
302
java
StrFormCharArray.java
Java
[]
null
[]
package string; public class StrFormCharArray { public static void main(String[] args) { char c[]={'R','E','M','E','M','B','E','R'}; String s=new String(c); System.out.println(s); String s1=new String(c,2,6); System.out.println(s1); String sb="1"; String sb1="2"; } }
302
0.576159
0.55298
15
18.133333
14.687259
45
false
false
0
0
0
0
0
0
2.2
false
false
1
180c5c344388680686a9f0e170a54d2622fa44f1
13,804,024,894,617
c6aad17cfbcea262444f58547dd15b6c8fac4565
/UVA/src/Subprime11679.java
13d329db410e977518c0e029067dfe5a65b88529
[]
no_license
nguyenmanhphuc/Competitive
https://github.com/nguyenmanhphuc/Competitive
5cf6cd1d1de3991c3c254e3cf66f765244ed660c
329aa28622720822850db02615e931a5c6a2d98b
refs/heads/master
2016-09-06T11:38:36.415000
2015-07-03T06:32:04
2015-07-03T06:32:04
38,296,138
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Scanner; public class Subprime11679 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int b = in.nextInt(); int c = in.nextInt(); while (b + c != 0) { long banks[] = new long[b + 1]; for (int i = 1; i <= b; ++i) { banks[i] = in.nextLong(); } for (int i = 0; i < c; ++i) { int a = in.nextInt(); int z = in.nextInt(); int d = in.nextInt(); banks[a] -= d; banks[z] += d; } boolean check = true; for (int j = 1; j <= b; ++j) { if (banks[j] < 0) { check = false; } } System.out.println(check ? "S" : "N"); b = in.nextInt(); c = in.nextInt(); } } }
UTF-8
Java
677
java
Subprime11679.java
Java
[]
null
[]
import java.util.Scanner; public class Subprime11679 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int b = in.nextInt(); int c = in.nextInt(); while (b + c != 0) { long banks[] = new long[b + 1]; for (int i = 1; i <= b; ++i) { banks[i] = in.nextLong(); } for (int i = 0; i < c; ++i) { int a = in.nextInt(); int z = in.nextInt(); int d = in.nextInt(); banks[a] -= d; banks[z] += d; } boolean check = true; for (int j = 1; j <= b; ++j) { if (banks[j] < 0) { check = false; } } System.out.println(check ? "S" : "N"); b = in.nextInt(); c = in.nextInt(); } } }
677
0.493353
0.477105
35
18.342857
13.153909
41
false
false
0
0
0
0
0
0
2.971429
false
false
1
3cc06e0150d60e7336cbf92aaa64aa23be4db21e
15,023,795,611,895
c5c9cd8ecea7de879ea1050c10a11448174f4d46
/eltcustom/src/main/java/com/ssh/action/JfqjAction.java
69f4d8943936a39125be813e7380ceefe35d649c
[]
no_license
mygithubwork/Combinationforspringsecurity
https://github.com/mygithubwork/Combinationforspringsecurity
d98d523b4b32fc06fb477b7a55fa149e5b5f6bb9
f9ec7e4de481873b1063f564b5716bedadeba8f7
refs/heads/master
2017-12-31T14:48:14.137000
2013-06-20T02:48:55
2013-06-20T02:48:55
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ssh.action; import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import net.sf.json.JSON; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.springframework.stereotype.Controller; import com.ssh.entity.TblJfqmc; import com.ssh.entity.TblQyyg; import com.ssh.entity.TblSyqyjfq; import com.ssh.service.JfqService; @Controller public class JfqjAction extends PageAction { private static final long serialVersionUID = -4681753361100453511L; @Resource private JfqService jfq; public String profile(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getJfqbyUid(getParam(), 4)); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String page(){ List<Map<String,Object>> list = jfq.page(getParam(), getPage(), getRp()); String total = jfq.count(getParam()); return super.pagelist(list, total); } public String pagely(){ List<Map<String,Object>> list = jfq.pagely(getParam(), getPage(), getRp()); String total = jfq.countly(getParam()); return super.pagelist(list, total); } public String lqsj(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getJfqLjsj(getParam())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String detail(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getDetail(getParam())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String lq(){ Map<String, Object> map = new HashMap<String,Object>(); if (isTrialAccount()) { TblQyyg user = (TblQyyg) session.get("user"); if (user != null) { TblSyqyjfq syqyjfq = new TblSyqyjfq(); syqyjfq.setQyyg(user.getNid()); syqyjfq.setJfqId(Integer.parseInt(getParam())); map.put("rs", Boolean.valueOf(jfq.syqylqjfq(syqyjfq))); } } else { TblJfqmc jfqmc = jfq.findById(Integer.parseInt(getParam())); jfqmc.setSflq(1); jfqmc.setLqsj(new Timestamp(System.currentTimeMillis())); map.put("rs", jfq.save(jfqmc)); } JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String syqylqjl() { List list = new ArrayList(); TblQyyg user = (TblQyyg) this.session.get("user"); if (user != null) { list = this.jfq.getylqmrjfq(Integer.toString(user.getNid() .intValue())); } JSON res = JSONArray.fromObject(list); setResult(res); return "success"; } public String spsjfq(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getSpJfq(getParam())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String spsjfqcount(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getSpsJfqCount(getParam())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String userjfqs(){ TblQyyg tyg = (TblQyyg) session.get("user"); Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getJfqs(tyg.getNid())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } }
UTF-8
Java
3,398
java
JfqjAction.java
Java
[]
null
[]
package com.ssh.action; import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import net.sf.json.JSON; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.springframework.stereotype.Controller; import com.ssh.entity.TblJfqmc; import com.ssh.entity.TblQyyg; import com.ssh.entity.TblSyqyjfq; import com.ssh.service.JfqService; @Controller public class JfqjAction extends PageAction { private static final long serialVersionUID = -4681753361100453511L; @Resource private JfqService jfq; public String profile(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getJfqbyUid(getParam(), 4)); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String page(){ List<Map<String,Object>> list = jfq.page(getParam(), getPage(), getRp()); String total = jfq.count(getParam()); return super.pagelist(list, total); } public String pagely(){ List<Map<String,Object>> list = jfq.pagely(getParam(), getPage(), getRp()); String total = jfq.countly(getParam()); return super.pagelist(list, total); } public String lqsj(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getJfqLjsj(getParam())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String detail(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getDetail(getParam())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String lq(){ Map<String, Object> map = new HashMap<String,Object>(); if (isTrialAccount()) { TblQyyg user = (TblQyyg) session.get("user"); if (user != null) { TblSyqyjfq syqyjfq = new TblSyqyjfq(); syqyjfq.setQyyg(user.getNid()); syqyjfq.setJfqId(Integer.parseInt(getParam())); map.put("rs", Boolean.valueOf(jfq.syqylqjfq(syqyjfq))); } } else { TblJfqmc jfqmc = jfq.findById(Integer.parseInt(getParam())); jfqmc.setSflq(1); jfqmc.setLqsj(new Timestamp(System.currentTimeMillis())); map.put("rs", jfq.save(jfqmc)); } JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String syqylqjl() { List list = new ArrayList(); TblQyyg user = (TblQyyg) this.session.get("user"); if (user != null) { list = this.jfq.getylqmrjfq(Integer.toString(user.getNid() .intValue())); } JSON res = JSONArray.fromObject(list); setResult(res); return "success"; } public String spsjfq(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getSpJfq(getParam())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String spsjfqcount(){ Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getSpsJfqCount(getParam())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } public String userjfqs(){ TblQyyg tyg = (TblQyyg) session.get("user"); Map<String, Object> map = new HashMap<String,Object>(); map.put("rows", jfq.getJfqs(tyg.getNid())); JSON res = JSONObject.fromObject(map); setResult(res); return SUCCESS; } }
3,398
0.670983
0.664803
123
25.626017
19.921961
77
false
false
0
0
0
0
0
0
2.284553
false
false
1
01d1e3471471a369f0db489be397acf9ffb8a335
7,868,380,100,360
451d69aa962abed944e0c8addf18b165dc1a439e
/src/com/nicolaslopez82/dsa/amazon/FirstUniqueCharacterInString.java
ece510808dd115276c0cca72a1f96e789b027337
[]
no_license
nicolaslopez82/data-structures-and-algorithms
https://github.com/nicolaslopez82/data-structures-and-algorithms
c8799e5fc6bf14a0122232cef59d54686b3ab166
9b0458b79e4a00a5bc4b8f3eb77cb85afced5852
refs/heads/master
2022-11-05T09:11:18.189000
2020-06-13T04:44:11
2020-06-13T04:44:11
263,191,992
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.nicolaslopez82.dsa.amazon; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; /** * @author nicolaslopez82 * Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. * * Examples: * s = "leetcode" * return 0. * * s = "loveleetcode", * return 2. * * Details: * Runtime: 24 ms, faster than 30.56% of Java online submissions for First Unique Character in a String. * Memory Usage: 40.1 MB, less than 49.28% of Java online submissions for First Unique Character in a String. */ public class FirstUniqueCharacterInString { public static void main(String[] args){ FirstUniqueCharacterInString firstUniqueCharacterInString = new FirstUniqueCharacterInString(); String str = "leetcode"; System.out.println(firstUniqueCharacterInString.solve(str)); } private int solve(String str){ if(str.length() == 0) return -1; Map<Character, Integer> map = new LinkedHashMap(); char[] chars = str.toCharArray(); for(int i = 0; i < chars.length; i++){ if(map.containsKey(chars[i])){ map.put(chars[i], -1); }else{ map.put(chars[i], i); } } for (char c: map.keySet()) { if(map.get(c) != -1 ) return map.get(c); } return -1; } }
UTF-8
Java
1,415
java
FirstUniqueCharacterInString.java
Java
[ { "context": "package com.nicolaslopez82.dsa.amazon;\n\n\nimport java.util.HashMap;\nimport ", "end": 24, "score": 0.5209562182426453, "start": 23, "tag": "USERNAME", "value": "z" }, { "context": "kedHashMap;\nimport java.util.Map;\n\n\n/**\n * @author nicolaslopez82\n * Given a string, find the first non-repeating c", "end": 152, "score": 0.9996209740638733, "start": 138, "tag": "USERNAME", "value": "nicolaslopez82" } ]
null
[]
package com.nicolaslopez82.dsa.amazon; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; /** * @author nicolaslopez82 * Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. * * Examples: * s = "leetcode" * return 0. * * s = "loveleetcode", * return 2. * * Details: * Runtime: 24 ms, faster than 30.56% of Java online submissions for First Unique Character in a String. * Memory Usage: 40.1 MB, less than 49.28% of Java online submissions for First Unique Character in a String. */ public class FirstUniqueCharacterInString { public static void main(String[] args){ FirstUniqueCharacterInString firstUniqueCharacterInString = new FirstUniqueCharacterInString(); String str = "leetcode"; System.out.println(firstUniqueCharacterInString.solve(str)); } private int solve(String str){ if(str.length() == 0) return -1; Map<Character, Integer> map = new LinkedHashMap(); char[] chars = str.toCharArray(); for(int i = 0; i < chars.length; i++){ if(map.containsKey(chars[i])){ map.put(chars[i], -1); }else{ map.put(chars[i], i); } } for (char c: map.keySet()) { if(map.get(c) != -1 ) return map.get(c); } return -1; } }
1,415
0.614134
0.59576
55
24.727272
29.518225
118
false
false
0
0
0
0
0
0
0.436364
false
false
1
e2d4bc7d675bc50e3cb096581aee30d857d33eec
27,376,121,581,933
5e7590f7a301ab9d09efa74185c3a96734b33221
/src/org.agileware.natural.cucumber.ui/src-gen/org/agileware/natural/cucumber/ui/contentassist/antlr/internal/InternalCucumberParser.java
afa4d62346b9f56b49fc109658a445cf1b28224e
[]
no_license
slipchansky/ats-eclipse-plugin
https://github.com/slipchansky/ats-eclipse-plugin
e901087ae28a9116ff84bcd04eec61566ab4c670
0d85b2e876b3595bec4ea6bbfc1560a34e8321de
refs/heads/master
2021-07-04T08:15:12.279000
2017-09-26T09:53:01
2017-09-26T09:53:01
104,846,265
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.agileware.natural.cucumber.ui.contentassist.antlr.internal; import java.io.InputStream; import org.eclipse.xtext.*; import org.eclipse.xtext.parser.*; import org.eclipse.xtext.parser.impl.*; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.parser.antlr.XtextTokenStream; import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; import org.agileware.natural.cucumber.services.CucumberGrammarAccess; import org.antlr.runtime.*; import java.util.Stack; import java.util.List; import java.util.ArrayList; @SuppressWarnings("all") public class InternalCucumberParser extends AbstractInternalContentAssistParser { public static final String[] tokenNames = new String[] { "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_WORD", "RULE_INT", "RULE_STRING", "RULE_PLACEHOLDER", "RULE_STEP_KEYWORD", "RULE_TAGNAME", "RULE_EOL", "RULE_TABLE_ROW", "RULE_DOC_STRING", "RULE_NL", "RULE_SL_COMMENT", "RULE_WS", "'Feature:'", "'Background:'", "'Scenario:'", "'Scenario Outline:'", "'Examples:'" }; public static final int RULE_DOC_STRING=12; public static final int RULE_WORD=4; public static final int RULE_STRING=6; public static final int RULE_SL_COMMENT=14; public static final int T__19=19; public static final int T__16=16; public static final int T__17=17; public static final int T__18=18; public static final int EOF=-1; public static final int RULE_EOL=10; public static final int RULE_WS=15; public static final int RULE_TAGNAME=9; public static final int RULE_PLACEHOLDER=7; public static final int RULE_TABLE_ROW=11; public static final int RULE_INT=5; public static final int RULE_STEP_KEYWORD=8; public static final int RULE_NL=13; public static final int T__20=20; // delegates // delegators public InternalCucumberParser(TokenStream input) { this(input, new RecognizerSharedState()); } public InternalCucumberParser(TokenStream input, RecognizerSharedState state) { super(input, state); } public String[] getTokenNames() { return InternalCucumberParser.tokenNames; } public String getGrammarFileName() { return "InternalCucumber.g"; } private CucumberGrammarAccess grammarAccess; public void setGrammarAccess(CucumberGrammarAccess grammarAccess) { this.grammarAccess = grammarAccess; } @Override protected Grammar getGrammar() { return grammarAccess.getGrammar(); } @Override protected String getValueForTokenName(String tokenName) { return tokenName; } // $ANTLR start "entryRuleFeature" // InternalCucumber.g:60:1: entryRuleFeature : ruleFeature EOF ; public final void entryRuleFeature() throws RecognitionException { try { // InternalCucumber.g:61:1: ( ruleFeature EOF ) // InternalCucumber.g:62:1: ruleFeature EOF { before(grammarAccess.getFeatureRule()); pushFollow(FOLLOW_1); ruleFeature(); state._fsp--; after(grammarAccess.getFeatureRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleFeature" // $ANTLR start "ruleFeature" // InternalCucumber.g:69:1: ruleFeature : ( ( rule__Feature__Group__0 ) ) ; public final void ruleFeature() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:73:2: ( ( ( rule__Feature__Group__0 ) ) ) // InternalCucumber.g:74:1: ( ( rule__Feature__Group__0 ) ) { // InternalCucumber.g:74:1: ( ( rule__Feature__Group__0 ) ) // InternalCucumber.g:75:1: ( rule__Feature__Group__0 ) { before(grammarAccess.getFeatureAccess().getGroup()); // InternalCucumber.g:76:1: ( rule__Feature__Group__0 ) // InternalCucumber.g:76:2: rule__Feature__Group__0 { pushFollow(FOLLOW_2); rule__Feature__Group__0(); state._fsp--; } after(grammarAccess.getFeatureAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleFeature" // $ANTLR start "entryRuleBackground" // InternalCucumber.g:88:1: entryRuleBackground : ruleBackground EOF ; public final void entryRuleBackground() throws RecognitionException { try { // InternalCucumber.g:89:1: ( ruleBackground EOF ) // InternalCucumber.g:90:1: ruleBackground EOF { before(grammarAccess.getBackgroundRule()); pushFollow(FOLLOW_1); ruleBackground(); state._fsp--; after(grammarAccess.getBackgroundRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleBackground" // $ANTLR start "ruleBackground" // InternalCucumber.g:97:1: ruleBackground : ( ( rule__Background__Group__0 ) ) ; public final void ruleBackground() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:101:2: ( ( ( rule__Background__Group__0 ) ) ) // InternalCucumber.g:102:1: ( ( rule__Background__Group__0 ) ) { // InternalCucumber.g:102:1: ( ( rule__Background__Group__0 ) ) // InternalCucumber.g:103:1: ( rule__Background__Group__0 ) { before(grammarAccess.getBackgroundAccess().getGroup()); // InternalCucumber.g:104:1: ( rule__Background__Group__0 ) // InternalCucumber.g:104:2: rule__Background__Group__0 { pushFollow(FOLLOW_2); rule__Background__Group__0(); state._fsp--; } after(grammarAccess.getBackgroundAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleBackground" // $ANTLR start "entryRuleScenario" // InternalCucumber.g:116:1: entryRuleScenario : ruleScenario EOF ; public final void entryRuleScenario() throws RecognitionException { try { // InternalCucumber.g:117:1: ( ruleScenario EOF ) // InternalCucumber.g:118:1: ruleScenario EOF { before(grammarAccess.getScenarioRule()); pushFollow(FOLLOW_1); ruleScenario(); state._fsp--; after(grammarAccess.getScenarioRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleScenario" // $ANTLR start "ruleScenario" // InternalCucumber.g:125:1: ruleScenario : ( ( rule__Scenario__Group__0 ) ) ; public final void ruleScenario() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:129:2: ( ( ( rule__Scenario__Group__0 ) ) ) // InternalCucumber.g:130:1: ( ( rule__Scenario__Group__0 ) ) { // InternalCucumber.g:130:1: ( ( rule__Scenario__Group__0 ) ) // InternalCucumber.g:131:1: ( rule__Scenario__Group__0 ) { before(grammarAccess.getScenarioAccess().getGroup()); // InternalCucumber.g:132:1: ( rule__Scenario__Group__0 ) // InternalCucumber.g:132:2: rule__Scenario__Group__0 { pushFollow(FOLLOW_2); rule__Scenario__Group__0(); state._fsp--; } after(grammarAccess.getScenarioAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleScenario" // $ANTLR start "entryRuleScenarioOutline" // InternalCucumber.g:144:1: entryRuleScenarioOutline : ruleScenarioOutline EOF ; public final void entryRuleScenarioOutline() throws RecognitionException { try { // InternalCucumber.g:145:1: ( ruleScenarioOutline EOF ) // InternalCucumber.g:146:1: ruleScenarioOutline EOF { before(grammarAccess.getScenarioOutlineRule()); pushFollow(FOLLOW_1); ruleScenarioOutline(); state._fsp--; after(grammarAccess.getScenarioOutlineRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleScenarioOutline" // $ANTLR start "ruleScenarioOutline" // InternalCucumber.g:153:1: ruleScenarioOutline : ( ( rule__ScenarioOutline__Group__0 ) ) ; public final void ruleScenarioOutline() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:157:2: ( ( ( rule__ScenarioOutline__Group__0 ) ) ) // InternalCucumber.g:158:1: ( ( rule__ScenarioOutline__Group__0 ) ) { // InternalCucumber.g:158:1: ( ( rule__ScenarioOutline__Group__0 ) ) // InternalCucumber.g:159:1: ( rule__ScenarioOutline__Group__0 ) { before(grammarAccess.getScenarioOutlineAccess().getGroup()); // InternalCucumber.g:160:1: ( rule__ScenarioOutline__Group__0 ) // InternalCucumber.g:160:2: rule__ScenarioOutline__Group__0 { pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__0(); state._fsp--; } after(grammarAccess.getScenarioOutlineAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleScenarioOutline" // $ANTLR start "entryRuleStep" // InternalCucumber.g:172:1: entryRuleStep : ruleStep EOF ; public final void entryRuleStep() throws RecognitionException { try { // InternalCucumber.g:173:1: ( ruleStep EOF ) // InternalCucumber.g:174:1: ruleStep EOF { before(grammarAccess.getStepRule()); pushFollow(FOLLOW_1); ruleStep(); state._fsp--; after(grammarAccess.getStepRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleStep" // $ANTLR start "ruleStep" // InternalCucumber.g:181:1: ruleStep : ( ( rule__Step__Group__0 ) ) ; public final void ruleStep() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:185:2: ( ( ( rule__Step__Group__0 ) ) ) // InternalCucumber.g:186:1: ( ( rule__Step__Group__0 ) ) { // InternalCucumber.g:186:1: ( ( rule__Step__Group__0 ) ) // InternalCucumber.g:187:1: ( rule__Step__Group__0 ) { before(grammarAccess.getStepAccess().getGroup()); // InternalCucumber.g:188:1: ( rule__Step__Group__0 ) // InternalCucumber.g:188:2: rule__Step__Group__0 { pushFollow(FOLLOW_2); rule__Step__Group__0(); state._fsp--; } after(grammarAccess.getStepAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleStep" // $ANTLR start "entryRuleExamples" // InternalCucumber.g:200:1: entryRuleExamples : ruleExamples EOF ; public final void entryRuleExamples() throws RecognitionException { try { // InternalCucumber.g:201:1: ( ruleExamples EOF ) // InternalCucumber.g:202:1: ruleExamples EOF { before(grammarAccess.getExamplesRule()); pushFollow(FOLLOW_1); ruleExamples(); state._fsp--; after(grammarAccess.getExamplesRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleExamples" // $ANTLR start "ruleExamples" // InternalCucumber.g:209:1: ruleExamples : ( ( rule__Examples__Group__0 ) ) ; public final void ruleExamples() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:213:2: ( ( ( rule__Examples__Group__0 ) ) ) // InternalCucumber.g:214:1: ( ( rule__Examples__Group__0 ) ) { // InternalCucumber.g:214:1: ( ( rule__Examples__Group__0 ) ) // InternalCucumber.g:215:1: ( rule__Examples__Group__0 ) { before(grammarAccess.getExamplesAccess().getGroup()); // InternalCucumber.g:216:1: ( rule__Examples__Group__0 ) // InternalCucumber.g:216:2: rule__Examples__Group__0 { pushFollow(FOLLOW_2); rule__Examples__Group__0(); state._fsp--; } after(grammarAccess.getExamplesAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleExamples" // $ANTLR start "entryRuleTable" // InternalCucumber.g:228:1: entryRuleTable : ruleTable EOF ; public final void entryRuleTable() throws RecognitionException { try { // InternalCucumber.g:229:1: ( ruleTable EOF ) // InternalCucumber.g:230:1: ruleTable EOF { before(grammarAccess.getTableRule()); pushFollow(FOLLOW_1); ruleTable(); state._fsp--; after(grammarAccess.getTableRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleTable" // $ANTLR start "ruleTable" // InternalCucumber.g:237:1: ruleTable : ( ( rule__Table__Group__0 ) ) ; public final void ruleTable() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:241:2: ( ( ( rule__Table__Group__0 ) ) ) // InternalCucumber.g:242:1: ( ( rule__Table__Group__0 ) ) { // InternalCucumber.g:242:1: ( ( rule__Table__Group__0 ) ) // InternalCucumber.g:243:1: ( rule__Table__Group__0 ) { before(grammarAccess.getTableAccess().getGroup()); // InternalCucumber.g:244:1: ( rule__Table__Group__0 ) // InternalCucumber.g:244:2: rule__Table__Group__0 { pushFollow(FOLLOW_2); rule__Table__Group__0(); state._fsp--; } after(grammarAccess.getTableAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleTable" // $ANTLR start "entryRuleDocString" // InternalCucumber.g:256:1: entryRuleDocString : ruleDocString EOF ; public final void entryRuleDocString() throws RecognitionException { try { // InternalCucumber.g:257:1: ( ruleDocString EOF ) // InternalCucumber.g:258:1: ruleDocString EOF { before(grammarAccess.getDocStringRule()); pushFollow(FOLLOW_1); ruleDocString(); state._fsp--; after(grammarAccess.getDocStringRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleDocString" // $ANTLR start "ruleDocString" // InternalCucumber.g:265:1: ruleDocString : ( ( rule__DocString__Group__0 ) ) ; public final void ruleDocString() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:269:2: ( ( ( rule__DocString__Group__0 ) ) ) // InternalCucumber.g:270:1: ( ( rule__DocString__Group__0 ) ) { // InternalCucumber.g:270:1: ( ( rule__DocString__Group__0 ) ) // InternalCucumber.g:271:1: ( rule__DocString__Group__0 ) { before(grammarAccess.getDocStringAccess().getGroup()); // InternalCucumber.g:272:1: ( rule__DocString__Group__0 ) // InternalCucumber.g:272:2: rule__DocString__Group__0 { pushFollow(FOLLOW_2); rule__DocString__Group__0(); state._fsp--; } after(grammarAccess.getDocStringAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleDocString" // $ANTLR start "entryRuleTitle" // InternalCucumber.g:284:1: entryRuleTitle : ruleTitle EOF ; public final void entryRuleTitle() throws RecognitionException { try { // InternalCucumber.g:285:1: ( ruleTitle EOF ) // InternalCucumber.g:286:1: ruleTitle EOF { before(grammarAccess.getTitleRule()); pushFollow(FOLLOW_1); ruleTitle(); state._fsp--; after(grammarAccess.getTitleRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleTitle" // $ANTLR start "ruleTitle" // InternalCucumber.g:293:1: ruleTitle : ( ( rule__Title__Group__0 ) ) ; public final void ruleTitle() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:297:2: ( ( ( rule__Title__Group__0 ) ) ) // InternalCucumber.g:298:1: ( ( rule__Title__Group__0 ) ) { // InternalCucumber.g:298:1: ( ( rule__Title__Group__0 ) ) // InternalCucumber.g:299:1: ( rule__Title__Group__0 ) { before(grammarAccess.getTitleAccess().getGroup()); // InternalCucumber.g:300:1: ( rule__Title__Group__0 ) // InternalCucumber.g:300:2: rule__Title__Group__0 { pushFollow(FOLLOW_2); rule__Title__Group__0(); state._fsp--; } after(grammarAccess.getTitleAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleTitle" // $ANTLR start "entryRuleNarrative" // InternalCucumber.g:312:1: entryRuleNarrative : ruleNarrative EOF ; public final void entryRuleNarrative() throws RecognitionException { try { // InternalCucumber.g:313:1: ( ruleNarrative EOF ) // InternalCucumber.g:314:1: ruleNarrative EOF { before(grammarAccess.getNarrativeRule()); pushFollow(FOLLOW_1); ruleNarrative(); state._fsp--; after(grammarAccess.getNarrativeRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleNarrative" // $ANTLR start "ruleNarrative" // InternalCucumber.g:321:1: ruleNarrative : ( ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) ) ; public final void ruleNarrative() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:325:2: ( ( ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) ) ) // InternalCucumber.g:326:1: ( ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) ) { // InternalCucumber.g:326:1: ( ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) ) // InternalCucumber.g:327:1: ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) { // InternalCucumber.g:327:1: ( ( rule__Narrative__Group__0 ) ) // InternalCucumber.g:328:1: ( rule__Narrative__Group__0 ) { before(grammarAccess.getNarrativeAccess().getGroup()); // InternalCucumber.g:329:1: ( rule__Narrative__Group__0 ) // InternalCucumber.g:329:2: rule__Narrative__Group__0 { pushFollow(FOLLOW_3); rule__Narrative__Group__0(); state._fsp--; } after(grammarAccess.getNarrativeAccess().getGroup()); } // InternalCucumber.g:332:1: ( ( rule__Narrative__Group__0 )* ) // InternalCucumber.g:333:1: ( rule__Narrative__Group__0 )* { before(grammarAccess.getNarrativeAccess().getGroup()); // InternalCucumber.g:334:1: ( rule__Narrative__Group__0 )* loop1: do { int alt1=2; int LA1_0 = input.LA(1); if ( ((LA1_0>=RULE_WORD && LA1_0<=RULE_PLACEHOLDER)) ) { alt1=1; } switch (alt1) { case 1 : // InternalCucumber.g:334:2: rule__Narrative__Group__0 { pushFollow(FOLLOW_3); rule__Narrative__Group__0(); state._fsp--; } break; default : break loop1; } } while (true); after(grammarAccess.getNarrativeAccess().getGroup()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleNarrative" // $ANTLR start "entryRuleStepDescription" // InternalCucumber.g:347:1: entryRuleStepDescription : ruleStepDescription EOF ; public final void entryRuleStepDescription() throws RecognitionException { try { // InternalCucumber.g:348:1: ( ruleStepDescription EOF ) // InternalCucumber.g:349:1: ruleStepDescription EOF { before(grammarAccess.getStepDescriptionRule()); pushFollow(FOLLOW_1); ruleStepDescription(); state._fsp--; after(grammarAccess.getStepDescriptionRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleStepDescription" // $ANTLR start "ruleStepDescription" // InternalCucumber.g:356:1: ruleStepDescription : ( ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) ) ; public final void ruleStepDescription() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:360:2: ( ( ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) ) ) // InternalCucumber.g:361:1: ( ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) ) { // InternalCucumber.g:361:1: ( ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) ) // InternalCucumber.g:362:1: ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) { // InternalCucumber.g:362:1: ( ( rule__StepDescription__Alternatives ) ) // InternalCucumber.g:363:1: ( rule__StepDescription__Alternatives ) { before(grammarAccess.getStepDescriptionAccess().getAlternatives()); // InternalCucumber.g:364:1: ( rule__StepDescription__Alternatives ) // InternalCucumber.g:364:2: rule__StepDescription__Alternatives { pushFollow(FOLLOW_4); rule__StepDescription__Alternatives(); state._fsp--; } after(grammarAccess.getStepDescriptionAccess().getAlternatives()); } // InternalCucumber.g:367:1: ( ( rule__StepDescription__Alternatives )* ) // InternalCucumber.g:368:1: ( rule__StepDescription__Alternatives )* { before(grammarAccess.getStepDescriptionAccess().getAlternatives()); // InternalCucumber.g:369:1: ( rule__StepDescription__Alternatives )* loop2: do { int alt2=2; alt2 = dfa2.predict(input); switch (alt2) { case 1 : // InternalCucumber.g:369:2: rule__StepDescription__Alternatives { pushFollow(FOLLOW_4); rule__StepDescription__Alternatives(); state._fsp--; } break; default : break loop2; } } while (true); after(grammarAccess.getStepDescriptionAccess().getAlternatives()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleStepDescription" // $ANTLR start "entryRuleTag" // InternalCucumber.g:382:1: entryRuleTag : ruleTag EOF ; public final void entryRuleTag() throws RecognitionException { try { // InternalCucumber.g:383:1: ( ruleTag EOF ) // InternalCucumber.g:384:1: ruleTag EOF { before(grammarAccess.getTagRule()); pushFollow(FOLLOW_1); ruleTag(); state._fsp--; after(grammarAccess.getTagRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleTag" // $ANTLR start "ruleTag" // InternalCucumber.g:391:1: ruleTag : ( ( rule__Tag__Group__0 ) ) ; public final void ruleTag() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:395:2: ( ( ( rule__Tag__Group__0 ) ) ) // InternalCucumber.g:396:1: ( ( rule__Tag__Group__0 ) ) { // InternalCucumber.g:396:1: ( ( rule__Tag__Group__0 ) ) // InternalCucumber.g:397:1: ( rule__Tag__Group__0 ) { before(grammarAccess.getTagAccess().getGroup()); // InternalCucumber.g:398:1: ( rule__Tag__Group__0 ) // InternalCucumber.g:398:2: rule__Tag__Group__0 { pushFollow(FOLLOW_2); rule__Tag__Group__0(); state._fsp--; } after(grammarAccess.getTagAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleTag" // $ANTLR start "rule__Feature__ScenariosAlternatives_6_0" // InternalCucumber.g:410:1: rule__Feature__ScenariosAlternatives_6_0 : ( ( ruleScenario ) | ( ruleScenarioOutline ) ); public final void rule__Feature__ScenariosAlternatives_6_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:414:1: ( ( ruleScenario ) | ( ruleScenarioOutline ) ) int alt3=2; alt3 = dfa3.predict(input); switch (alt3) { case 1 : // InternalCucumber.g:415:1: ( ruleScenario ) { // InternalCucumber.g:415:1: ( ruleScenario ) // InternalCucumber.g:416:1: ruleScenario { before(grammarAccess.getFeatureAccess().getScenariosScenarioParserRuleCall_6_0_0()); pushFollow(FOLLOW_2); ruleScenario(); state._fsp--; after(grammarAccess.getFeatureAccess().getScenariosScenarioParserRuleCall_6_0_0()); } } break; case 2 : // InternalCucumber.g:421:6: ( ruleScenarioOutline ) { // InternalCucumber.g:421:6: ( ruleScenarioOutline ) // InternalCucumber.g:422:1: ruleScenarioOutline { before(grammarAccess.getFeatureAccess().getScenariosScenarioOutlineParserRuleCall_6_0_1()); pushFollow(FOLLOW_2); ruleScenarioOutline(); state._fsp--; after(grammarAccess.getFeatureAccess().getScenariosScenarioOutlineParserRuleCall_6_0_1()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__ScenariosAlternatives_6_0" // $ANTLR start "rule__Title__Alternatives_0" // InternalCucumber.g:432:1: rule__Title__Alternatives_0 : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) ); public final void rule__Title__Alternatives_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:436:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) ) int alt4=4; switch ( input.LA(1) ) { case RULE_WORD: { alt4=1; } break; case RULE_INT: { alt4=2; } break; case RULE_STRING: { alt4=3; } break; case RULE_PLACEHOLDER: { alt4=4; } break; default: NoViableAltException nvae = new NoViableAltException("", 4, 0, input); throw nvae; } switch (alt4) { case 1 : // InternalCucumber.g:437:1: ( RULE_WORD ) { // InternalCucumber.g:437:1: ( RULE_WORD ) // InternalCucumber.g:438:1: RULE_WORD { before(grammarAccess.getTitleAccess().getWORDTerminalRuleCall_0_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getTitleAccess().getWORDTerminalRuleCall_0_0()); } } break; case 2 : // InternalCucumber.g:443:6: ( RULE_INT ) { // InternalCucumber.g:443:6: ( RULE_INT ) // InternalCucumber.g:444:1: RULE_INT { before(grammarAccess.getTitleAccess().getINTTerminalRuleCall_0_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getTitleAccess().getINTTerminalRuleCall_0_1()); } } break; case 3 : // InternalCucumber.g:449:6: ( RULE_STRING ) { // InternalCucumber.g:449:6: ( RULE_STRING ) // InternalCucumber.g:450:1: RULE_STRING { before(grammarAccess.getTitleAccess().getSTRINGTerminalRuleCall_0_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getTitleAccess().getSTRINGTerminalRuleCall_0_2()); } } break; case 4 : // InternalCucumber.g:455:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:455:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:456:1: RULE_PLACEHOLDER { before(grammarAccess.getTitleAccess().getPLACEHOLDERTerminalRuleCall_0_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getTitleAccess().getPLACEHOLDERTerminalRuleCall_0_3()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Alternatives_0" // $ANTLR start "rule__Title__Alternatives_1" // InternalCucumber.g:466:1: rule__Title__Alternatives_1 : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ); public final void rule__Title__Alternatives_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:470:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ) int alt5=6; switch ( input.LA(1) ) { case RULE_WORD: { alt5=1; } break; case RULE_INT: { alt5=2; } break; case RULE_STRING: { alt5=3; } break; case RULE_PLACEHOLDER: { alt5=4; } break; case RULE_STEP_KEYWORD: { alt5=5; } break; case RULE_TAGNAME: { alt5=6; } break; default: NoViableAltException nvae = new NoViableAltException("", 5, 0, input); throw nvae; } switch (alt5) { case 1 : // InternalCucumber.g:471:1: ( RULE_WORD ) { // InternalCucumber.g:471:1: ( RULE_WORD ) // InternalCucumber.g:472:1: RULE_WORD { before(grammarAccess.getTitleAccess().getWORDTerminalRuleCall_1_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getTitleAccess().getWORDTerminalRuleCall_1_0()); } } break; case 2 : // InternalCucumber.g:477:6: ( RULE_INT ) { // InternalCucumber.g:477:6: ( RULE_INT ) // InternalCucumber.g:478:1: RULE_INT { before(grammarAccess.getTitleAccess().getINTTerminalRuleCall_1_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getTitleAccess().getINTTerminalRuleCall_1_1()); } } break; case 3 : // InternalCucumber.g:483:6: ( RULE_STRING ) { // InternalCucumber.g:483:6: ( RULE_STRING ) // InternalCucumber.g:484:1: RULE_STRING { before(grammarAccess.getTitleAccess().getSTRINGTerminalRuleCall_1_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getTitleAccess().getSTRINGTerminalRuleCall_1_2()); } } break; case 4 : // InternalCucumber.g:489:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:489:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:490:1: RULE_PLACEHOLDER { before(grammarAccess.getTitleAccess().getPLACEHOLDERTerminalRuleCall_1_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getTitleAccess().getPLACEHOLDERTerminalRuleCall_1_3()); } } break; case 5 : // InternalCucumber.g:495:6: ( RULE_STEP_KEYWORD ) { // InternalCucumber.g:495:6: ( RULE_STEP_KEYWORD ) // InternalCucumber.g:496:1: RULE_STEP_KEYWORD { before(grammarAccess.getTitleAccess().getSTEP_KEYWORDTerminalRuleCall_1_4()); match(input,RULE_STEP_KEYWORD,FOLLOW_2); after(grammarAccess.getTitleAccess().getSTEP_KEYWORDTerminalRuleCall_1_4()); } } break; case 6 : // InternalCucumber.g:501:6: ( RULE_TAGNAME ) { // InternalCucumber.g:501:6: ( RULE_TAGNAME ) // InternalCucumber.g:502:1: RULE_TAGNAME { before(grammarAccess.getTitleAccess().getTAGNAMETerminalRuleCall_1_5()); match(input,RULE_TAGNAME,FOLLOW_2); after(grammarAccess.getTitleAccess().getTAGNAMETerminalRuleCall_1_5()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Alternatives_1" // $ANTLR start "rule__Narrative__Alternatives_0" // InternalCucumber.g:512:1: rule__Narrative__Alternatives_0 : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) ); public final void rule__Narrative__Alternatives_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:516:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) ) int alt6=4; switch ( input.LA(1) ) { case RULE_WORD: { alt6=1; } break; case RULE_INT: { alt6=2; } break; case RULE_STRING: { alt6=3; } break; case RULE_PLACEHOLDER: { alt6=4; } break; default: NoViableAltException nvae = new NoViableAltException("", 6, 0, input); throw nvae; } switch (alt6) { case 1 : // InternalCucumber.g:517:1: ( RULE_WORD ) { // InternalCucumber.g:517:1: ( RULE_WORD ) // InternalCucumber.g:518:1: RULE_WORD { before(grammarAccess.getNarrativeAccess().getWORDTerminalRuleCall_0_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getWORDTerminalRuleCall_0_0()); } } break; case 2 : // InternalCucumber.g:523:6: ( RULE_INT ) { // InternalCucumber.g:523:6: ( RULE_INT ) // InternalCucumber.g:524:1: RULE_INT { before(grammarAccess.getNarrativeAccess().getINTTerminalRuleCall_0_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getINTTerminalRuleCall_0_1()); } } break; case 3 : // InternalCucumber.g:529:6: ( RULE_STRING ) { // InternalCucumber.g:529:6: ( RULE_STRING ) // InternalCucumber.g:530:1: RULE_STRING { before(grammarAccess.getNarrativeAccess().getSTRINGTerminalRuleCall_0_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getSTRINGTerminalRuleCall_0_2()); } } break; case 4 : // InternalCucumber.g:535:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:535:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:536:1: RULE_PLACEHOLDER { before(grammarAccess.getNarrativeAccess().getPLACEHOLDERTerminalRuleCall_0_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getPLACEHOLDERTerminalRuleCall_0_3()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Alternatives_0" // $ANTLR start "rule__Narrative__Alternatives_1" // InternalCucumber.g:546:1: rule__Narrative__Alternatives_1 : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ); public final void rule__Narrative__Alternatives_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:550:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ) int alt7=6; switch ( input.LA(1) ) { case RULE_WORD: { alt7=1; } break; case RULE_INT: { alt7=2; } break; case RULE_STRING: { alt7=3; } break; case RULE_PLACEHOLDER: { alt7=4; } break; case RULE_STEP_KEYWORD: { alt7=5; } break; case RULE_TAGNAME: { alt7=6; } break; default: NoViableAltException nvae = new NoViableAltException("", 7, 0, input); throw nvae; } switch (alt7) { case 1 : // InternalCucumber.g:551:1: ( RULE_WORD ) { // InternalCucumber.g:551:1: ( RULE_WORD ) // InternalCucumber.g:552:1: RULE_WORD { before(grammarAccess.getNarrativeAccess().getWORDTerminalRuleCall_1_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getWORDTerminalRuleCall_1_0()); } } break; case 2 : // InternalCucumber.g:557:6: ( RULE_INT ) { // InternalCucumber.g:557:6: ( RULE_INT ) // InternalCucumber.g:558:1: RULE_INT { before(grammarAccess.getNarrativeAccess().getINTTerminalRuleCall_1_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getINTTerminalRuleCall_1_1()); } } break; case 3 : // InternalCucumber.g:563:6: ( RULE_STRING ) { // InternalCucumber.g:563:6: ( RULE_STRING ) // InternalCucumber.g:564:1: RULE_STRING { before(grammarAccess.getNarrativeAccess().getSTRINGTerminalRuleCall_1_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getSTRINGTerminalRuleCall_1_2()); } } break; case 4 : // InternalCucumber.g:569:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:569:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:570:1: RULE_PLACEHOLDER { before(grammarAccess.getNarrativeAccess().getPLACEHOLDERTerminalRuleCall_1_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getPLACEHOLDERTerminalRuleCall_1_3()); } } break; case 5 : // InternalCucumber.g:575:6: ( RULE_STEP_KEYWORD ) { // InternalCucumber.g:575:6: ( RULE_STEP_KEYWORD ) // InternalCucumber.g:576:1: RULE_STEP_KEYWORD { before(grammarAccess.getNarrativeAccess().getSTEP_KEYWORDTerminalRuleCall_1_4()); match(input,RULE_STEP_KEYWORD,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getSTEP_KEYWORDTerminalRuleCall_1_4()); } } break; case 6 : // InternalCucumber.g:581:6: ( RULE_TAGNAME ) { // InternalCucumber.g:581:6: ( RULE_TAGNAME ) // InternalCucumber.g:582:1: RULE_TAGNAME { before(grammarAccess.getNarrativeAccess().getTAGNAMETerminalRuleCall_1_5()); match(input,RULE_TAGNAME,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getTAGNAMETerminalRuleCall_1_5()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Alternatives_1" // $ANTLR start "rule__StepDescription__Alternatives" // InternalCucumber.g:592:1: rule__StepDescription__Alternatives : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ); public final void rule__StepDescription__Alternatives() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:596:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ) int alt8=6; switch ( input.LA(1) ) { case RULE_WORD: { alt8=1; } break; case RULE_INT: { alt8=2; } break; case RULE_STRING: { alt8=3; } break; case RULE_PLACEHOLDER: { alt8=4; } break; case RULE_STEP_KEYWORD: { alt8=5; } break; case RULE_TAGNAME: { alt8=6; } break; default: NoViableAltException nvae = new NoViableAltException("", 8, 0, input); throw nvae; } switch (alt8) { case 1 : // InternalCucumber.g:597:1: ( RULE_WORD ) { // InternalCucumber.g:597:1: ( RULE_WORD ) // InternalCucumber.g:598:1: RULE_WORD { before(grammarAccess.getStepDescriptionAccess().getWORDTerminalRuleCall_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getWORDTerminalRuleCall_0()); } } break; case 2 : // InternalCucumber.g:603:6: ( RULE_INT ) { // InternalCucumber.g:603:6: ( RULE_INT ) // InternalCucumber.g:604:1: RULE_INT { before(grammarAccess.getStepDescriptionAccess().getINTTerminalRuleCall_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getINTTerminalRuleCall_1()); } } break; case 3 : // InternalCucumber.g:609:6: ( RULE_STRING ) { // InternalCucumber.g:609:6: ( RULE_STRING ) // InternalCucumber.g:610:1: RULE_STRING { before(grammarAccess.getStepDescriptionAccess().getSTRINGTerminalRuleCall_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getSTRINGTerminalRuleCall_2()); } } break; case 4 : // InternalCucumber.g:615:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:615:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:616:1: RULE_PLACEHOLDER { before(grammarAccess.getStepDescriptionAccess().getPLACEHOLDERTerminalRuleCall_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getPLACEHOLDERTerminalRuleCall_3()); } } break; case 5 : // InternalCucumber.g:621:6: ( RULE_STEP_KEYWORD ) { // InternalCucumber.g:621:6: ( RULE_STEP_KEYWORD ) // InternalCucumber.g:622:1: RULE_STEP_KEYWORD { before(grammarAccess.getStepDescriptionAccess().getSTEP_KEYWORDTerminalRuleCall_4()); match(input,RULE_STEP_KEYWORD,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getSTEP_KEYWORDTerminalRuleCall_4()); } } break; case 6 : // InternalCucumber.g:627:6: ( RULE_TAGNAME ) { // InternalCucumber.g:627:6: ( RULE_TAGNAME ) // InternalCucumber.g:628:1: RULE_TAGNAME { before(grammarAccess.getStepDescriptionAccess().getTAGNAMETerminalRuleCall_5()); match(input,RULE_TAGNAME,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getTAGNAMETerminalRuleCall_5()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__StepDescription__Alternatives" // $ANTLR start "rule__Feature__Group__0" // InternalCucumber.g:640:1: rule__Feature__Group__0 : rule__Feature__Group__0__Impl rule__Feature__Group__1 ; public final void rule__Feature__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:644:1: ( rule__Feature__Group__0__Impl rule__Feature__Group__1 ) // InternalCucumber.g:645:2: rule__Feature__Group__0__Impl rule__Feature__Group__1 { pushFollow(FOLLOW_5); rule__Feature__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__0" // $ANTLR start "rule__Feature__Group__0__Impl" // InternalCucumber.g:652:1: rule__Feature__Group__0__Impl : ( ( rule__Feature__TagsAssignment_0 )* ) ; public final void rule__Feature__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:656:1: ( ( ( rule__Feature__TagsAssignment_0 )* ) ) // InternalCucumber.g:657:1: ( ( rule__Feature__TagsAssignment_0 )* ) { // InternalCucumber.g:657:1: ( ( rule__Feature__TagsAssignment_0 )* ) // InternalCucumber.g:658:1: ( rule__Feature__TagsAssignment_0 )* { before(grammarAccess.getFeatureAccess().getTagsAssignment_0()); // InternalCucumber.g:659:1: ( rule__Feature__TagsAssignment_0 )* loop9: do { int alt9=2; int LA9_0 = input.LA(1); if ( (LA9_0==RULE_TAGNAME) ) { alt9=1; } switch (alt9) { case 1 : // InternalCucumber.g:659:2: rule__Feature__TagsAssignment_0 { pushFollow(FOLLOW_6); rule__Feature__TagsAssignment_0(); state._fsp--; } break; default : break loop9; } } while (true); after(grammarAccess.getFeatureAccess().getTagsAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__0__Impl" // $ANTLR start "rule__Feature__Group__1" // InternalCucumber.g:669:1: rule__Feature__Group__1 : rule__Feature__Group__1__Impl rule__Feature__Group__2 ; public final void rule__Feature__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:673:1: ( rule__Feature__Group__1__Impl rule__Feature__Group__2 ) // InternalCucumber.g:674:2: rule__Feature__Group__1__Impl rule__Feature__Group__2 { pushFollow(FOLLOW_7); rule__Feature__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__1" // $ANTLR start "rule__Feature__Group__1__Impl" // InternalCucumber.g:681:1: rule__Feature__Group__1__Impl : ( 'Feature:' ) ; public final void rule__Feature__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:685:1: ( ( 'Feature:' ) ) // InternalCucumber.g:686:1: ( 'Feature:' ) { // InternalCucumber.g:686:1: ( 'Feature:' ) // InternalCucumber.g:687:1: 'Feature:' { before(grammarAccess.getFeatureAccess().getFeatureKeyword_1()); match(input,16,FOLLOW_2); after(grammarAccess.getFeatureAccess().getFeatureKeyword_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__1__Impl" // $ANTLR start "rule__Feature__Group__2" // InternalCucumber.g:700:1: rule__Feature__Group__2 : rule__Feature__Group__2__Impl rule__Feature__Group__3 ; public final void rule__Feature__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:704:1: ( rule__Feature__Group__2__Impl rule__Feature__Group__3 ) // InternalCucumber.g:705:2: rule__Feature__Group__2__Impl rule__Feature__Group__3 { pushFollow(FOLLOW_8); rule__Feature__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__2" // $ANTLR start "rule__Feature__Group__2__Impl" // InternalCucumber.g:712:1: rule__Feature__Group__2__Impl : ( ( rule__Feature__TitleAssignment_2 ) ) ; public final void rule__Feature__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:716:1: ( ( ( rule__Feature__TitleAssignment_2 ) ) ) // InternalCucumber.g:717:1: ( ( rule__Feature__TitleAssignment_2 ) ) { // InternalCucumber.g:717:1: ( ( rule__Feature__TitleAssignment_2 ) ) // InternalCucumber.g:718:1: ( rule__Feature__TitleAssignment_2 ) { before(grammarAccess.getFeatureAccess().getTitleAssignment_2()); // InternalCucumber.g:719:1: ( rule__Feature__TitleAssignment_2 ) // InternalCucumber.g:719:2: rule__Feature__TitleAssignment_2 { pushFollow(FOLLOW_2); rule__Feature__TitleAssignment_2(); state._fsp--; } after(grammarAccess.getFeatureAccess().getTitleAssignment_2()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__2__Impl" // $ANTLR start "rule__Feature__Group__3" // InternalCucumber.g:729:1: rule__Feature__Group__3 : rule__Feature__Group__3__Impl rule__Feature__Group__4 ; public final void rule__Feature__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:733:1: ( rule__Feature__Group__3__Impl rule__Feature__Group__4 ) // InternalCucumber.g:734:2: rule__Feature__Group__3__Impl rule__Feature__Group__4 { pushFollow(FOLLOW_9); rule__Feature__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__3" // $ANTLR start "rule__Feature__Group__3__Impl" // InternalCucumber.g:741:1: rule__Feature__Group__3__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Feature__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:745:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:746:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:746:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:747:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:747:1: ( ( RULE_EOL ) ) // InternalCucumber.g:748:1: ( RULE_EOL ) { before(grammarAccess.getFeatureAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:749:1: ( RULE_EOL ) // InternalCucumber.g:749:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getFeatureAccess().getEOLTerminalRuleCall_3()); } // InternalCucumber.g:752:1: ( ( RULE_EOL )* ) // InternalCucumber.g:753:1: ( RULE_EOL )* { before(grammarAccess.getFeatureAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:754:1: ( RULE_EOL )* loop10: do { int alt10=2; int LA10_0 = input.LA(1); if ( (LA10_0==RULE_EOL) ) { alt10=1; } switch (alt10) { case 1 : // InternalCucumber.g:754:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop10; } } while (true); after(grammarAccess.getFeatureAccess().getEOLTerminalRuleCall_3()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__3__Impl" // $ANTLR start "rule__Feature__Group__4" // InternalCucumber.g:765:1: rule__Feature__Group__4 : rule__Feature__Group__4__Impl rule__Feature__Group__5 ; public final void rule__Feature__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:769:1: ( rule__Feature__Group__4__Impl rule__Feature__Group__5 ) // InternalCucumber.g:770:2: rule__Feature__Group__4__Impl rule__Feature__Group__5 { pushFollow(FOLLOW_9); rule__Feature__Group__4__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__5(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__4" // $ANTLR start "rule__Feature__Group__4__Impl" // InternalCucumber.g:777:1: rule__Feature__Group__4__Impl : ( ( rule__Feature__NarrativeAssignment_4 )? ) ; public final void rule__Feature__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:781:1: ( ( ( rule__Feature__NarrativeAssignment_4 )? ) ) // InternalCucumber.g:782:1: ( ( rule__Feature__NarrativeAssignment_4 )? ) { // InternalCucumber.g:782:1: ( ( rule__Feature__NarrativeAssignment_4 )? ) // InternalCucumber.g:783:1: ( rule__Feature__NarrativeAssignment_4 )? { before(grammarAccess.getFeatureAccess().getNarrativeAssignment_4()); // InternalCucumber.g:784:1: ( rule__Feature__NarrativeAssignment_4 )? int alt11=2; int LA11_0 = input.LA(1); if ( ((LA11_0>=RULE_WORD && LA11_0<=RULE_PLACEHOLDER)) ) { alt11=1; } switch (alt11) { case 1 : // InternalCucumber.g:784:2: rule__Feature__NarrativeAssignment_4 { pushFollow(FOLLOW_2); rule__Feature__NarrativeAssignment_4(); state._fsp--; } break; } after(grammarAccess.getFeatureAccess().getNarrativeAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__4__Impl" // $ANTLR start "rule__Feature__Group__5" // InternalCucumber.g:794:1: rule__Feature__Group__5 : rule__Feature__Group__5__Impl rule__Feature__Group__6 ; public final void rule__Feature__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:798:1: ( rule__Feature__Group__5__Impl rule__Feature__Group__6 ) // InternalCucumber.g:799:2: rule__Feature__Group__5__Impl rule__Feature__Group__6 { pushFollow(FOLLOW_9); rule__Feature__Group__5__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__6(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__5" // $ANTLR start "rule__Feature__Group__5__Impl" // InternalCucumber.g:806:1: rule__Feature__Group__5__Impl : ( ( rule__Feature__BackgroundAssignment_5 )? ) ; public final void rule__Feature__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:810:1: ( ( ( rule__Feature__BackgroundAssignment_5 )? ) ) // InternalCucumber.g:811:1: ( ( rule__Feature__BackgroundAssignment_5 )? ) { // InternalCucumber.g:811:1: ( ( rule__Feature__BackgroundAssignment_5 )? ) // InternalCucumber.g:812:1: ( rule__Feature__BackgroundAssignment_5 )? { before(grammarAccess.getFeatureAccess().getBackgroundAssignment_5()); // InternalCucumber.g:813:1: ( rule__Feature__BackgroundAssignment_5 )? int alt12=2; int LA12_0 = input.LA(1); if ( (LA12_0==17) ) { alt12=1; } switch (alt12) { case 1 : // InternalCucumber.g:813:2: rule__Feature__BackgroundAssignment_5 { pushFollow(FOLLOW_2); rule__Feature__BackgroundAssignment_5(); state._fsp--; } break; } after(grammarAccess.getFeatureAccess().getBackgroundAssignment_5()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__5__Impl" // $ANTLR start "rule__Feature__Group__6" // InternalCucumber.g:823:1: rule__Feature__Group__6 : rule__Feature__Group__6__Impl ; public final void rule__Feature__Group__6() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:827:1: ( rule__Feature__Group__6__Impl ) // InternalCucumber.g:828:2: rule__Feature__Group__6__Impl { pushFollow(FOLLOW_2); rule__Feature__Group__6__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__6" // $ANTLR start "rule__Feature__Group__6__Impl" // InternalCucumber.g:834:1: rule__Feature__Group__6__Impl : ( ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) ) ; public final void rule__Feature__Group__6__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:838:1: ( ( ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) ) ) // InternalCucumber.g:839:1: ( ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) ) { // InternalCucumber.g:839:1: ( ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) ) // InternalCucumber.g:840:1: ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) { // InternalCucumber.g:840:1: ( ( rule__Feature__ScenariosAssignment_6 ) ) // InternalCucumber.g:841:1: ( rule__Feature__ScenariosAssignment_6 ) { before(grammarAccess.getFeatureAccess().getScenariosAssignment_6()); // InternalCucumber.g:842:1: ( rule__Feature__ScenariosAssignment_6 ) // InternalCucumber.g:842:2: rule__Feature__ScenariosAssignment_6 { pushFollow(FOLLOW_11); rule__Feature__ScenariosAssignment_6(); state._fsp--; } after(grammarAccess.getFeatureAccess().getScenariosAssignment_6()); } // InternalCucumber.g:845:1: ( ( rule__Feature__ScenariosAssignment_6 )* ) // InternalCucumber.g:846:1: ( rule__Feature__ScenariosAssignment_6 )* { before(grammarAccess.getFeatureAccess().getScenariosAssignment_6()); // InternalCucumber.g:847:1: ( rule__Feature__ScenariosAssignment_6 )* loop13: do { int alt13=2; int LA13_0 = input.LA(1); if ( (LA13_0==RULE_TAGNAME||(LA13_0>=18 && LA13_0<=19)) ) { alt13=1; } switch (alt13) { case 1 : // InternalCucumber.g:847:2: rule__Feature__ScenariosAssignment_6 { pushFollow(FOLLOW_11); rule__Feature__ScenariosAssignment_6(); state._fsp--; } break; default : break loop13; } } while (true); after(grammarAccess.getFeatureAccess().getScenariosAssignment_6()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__6__Impl" // $ANTLR start "rule__Background__Group__0" // InternalCucumber.g:872:1: rule__Background__Group__0 : rule__Background__Group__0__Impl rule__Background__Group__1 ; public final void rule__Background__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:876:1: ( rule__Background__Group__0__Impl rule__Background__Group__1 ) // InternalCucumber.g:877:2: rule__Background__Group__0__Impl rule__Background__Group__1 { pushFollow(FOLLOW_12); rule__Background__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Background__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__0" // $ANTLR start "rule__Background__Group__0__Impl" // InternalCucumber.g:884:1: rule__Background__Group__0__Impl : ( 'Background:' ) ; public final void rule__Background__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:888:1: ( ( 'Background:' ) ) // InternalCucumber.g:889:1: ( 'Background:' ) { // InternalCucumber.g:889:1: ( 'Background:' ) // InternalCucumber.g:890:1: 'Background:' { before(grammarAccess.getBackgroundAccess().getBackgroundKeyword_0()); match(input,17,FOLLOW_2); after(grammarAccess.getBackgroundAccess().getBackgroundKeyword_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__0__Impl" // $ANTLR start "rule__Background__Group__1" // InternalCucumber.g:903:1: rule__Background__Group__1 : rule__Background__Group__1__Impl rule__Background__Group__2 ; public final void rule__Background__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:907:1: ( rule__Background__Group__1__Impl rule__Background__Group__2 ) // InternalCucumber.g:908:2: rule__Background__Group__1__Impl rule__Background__Group__2 { pushFollow(FOLLOW_12); rule__Background__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Background__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__1" // $ANTLR start "rule__Background__Group__1__Impl" // InternalCucumber.g:915:1: rule__Background__Group__1__Impl : ( ( rule__Background__TitleAssignment_1 )? ) ; public final void rule__Background__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:919:1: ( ( ( rule__Background__TitleAssignment_1 )? ) ) // InternalCucumber.g:920:1: ( ( rule__Background__TitleAssignment_1 )? ) { // InternalCucumber.g:920:1: ( ( rule__Background__TitleAssignment_1 )? ) // InternalCucumber.g:921:1: ( rule__Background__TitleAssignment_1 )? { before(grammarAccess.getBackgroundAccess().getTitleAssignment_1()); // InternalCucumber.g:922:1: ( rule__Background__TitleAssignment_1 )? int alt14=2; int LA14_0 = input.LA(1); if ( ((LA14_0>=RULE_WORD && LA14_0<=RULE_PLACEHOLDER)) ) { alt14=1; } switch (alt14) { case 1 : // InternalCucumber.g:922:2: rule__Background__TitleAssignment_1 { pushFollow(FOLLOW_2); rule__Background__TitleAssignment_1(); state._fsp--; } break; } after(grammarAccess.getBackgroundAccess().getTitleAssignment_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__1__Impl" // $ANTLR start "rule__Background__Group__2" // InternalCucumber.g:932:1: rule__Background__Group__2 : rule__Background__Group__2__Impl rule__Background__Group__3 ; public final void rule__Background__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:936:1: ( rule__Background__Group__2__Impl rule__Background__Group__3 ) // InternalCucumber.g:937:2: rule__Background__Group__2__Impl rule__Background__Group__3 { pushFollow(FOLLOW_13); rule__Background__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Background__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__2" // $ANTLR start "rule__Background__Group__2__Impl" // InternalCucumber.g:944:1: rule__Background__Group__2__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Background__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:948:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:949:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:949:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:950:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:950:1: ( ( RULE_EOL ) ) // InternalCucumber.g:951:1: ( RULE_EOL ) { before(grammarAccess.getBackgroundAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:952:1: ( RULE_EOL ) // InternalCucumber.g:952:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getBackgroundAccess().getEOLTerminalRuleCall_2()); } // InternalCucumber.g:955:1: ( ( RULE_EOL )* ) // InternalCucumber.g:956:1: ( RULE_EOL )* { before(grammarAccess.getBackgroundAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:957:1: ( RULE_EOL )* loop15: do { int alt15=2; int LA15_0 = input.LA(1); if ( (LA15_0==RULE_EOL) ) { alt15=1; } switch (alt15) { case 1 : // InternalCucumber.g:957:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop15; } } while (true); after(grammarAccess.getBackgroundAccess().getEOLTerminalRuleCall_2()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__2__Impl" // $ANTLR start "rule__Background__Group__3" // InternalCucumber.g:968:1: rule__Background__Group__3 : rule__Background__Group__3__Impl rule__Background__Group__4 ; public final void rule__Background__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:972:1: ( rule__Background__Group__3__Impl rule__Background__Group__4 ) // InternalCucumber.g:973:2: rule__Background__Group__3__Impl rule__Background__Group__4 { pushFollow(FOLLOW_13); rule__Background__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Background__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__3" // $ANTLR start "rule__Background__Group__3__Impl" // InternalCucumber.g:980:1: rule__Background__Group__3__Impl : ( ( rule__Background__NarrativeAssignment_3 )? ) ; public final void rule__Background__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:984:1: ( ( ( rule__Background__NarrativeAssignment_3 )? ) ) // InternalCucumber.g:985:1: ( ( rule__Background__NarrativeAssignment_3 )? ) { // InternalCucumber.g:985:1: ( ( rule__Background__NarrativeAssignment_3 )? ) // InternalCucumber.g:986:1: ( rule__Background__NarrativeAssignment_3 )? { before(grammarAccess.getBackgroundAccess().getNarrativeAssignment_3()); // InternalCucumber.g:987:1: ( rule__Background__NarrativeAssignment_3 )? int alt16=2; int LA16_0 = input.LA(1); if ( ((LA16_0>=RULE_WORD && LA16_0<=RULE_PLACEHOLDER)) ) { alt16=1; } switch (alt16) { case 1 : // InternalCucumber.g:987:2: rule__Background__NarrativeAssignment_3 { pushFollow(FOLLOW_2); rule__Background__NarrativeAssignment_3(); state._fsp--; } break; } after(grammarAccess.getBackgroundAccess().getNarrativeAssignment_3()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__3__Impl" // $ANTLR start "rule__Background__Group__4" // InternalCucumber.g:997:1: rule__Background__Group__4 : rule__Background__Group__4__Impl ; public final void rule__Background__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1001:1: ( rule__Background__Group__4__Impl ) // InternalCucumber.g:1002:2: rule__Background__Group__4__Impl { pushFollow(FOLLOW_2); rule__Background__Group__4__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__4" // $ANTLR start "rule__Background__Group__4__Impl" // InternalCucumber.g:1008:1: rule__Background__Group__4__Impl : ( ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) ) ; public final void rule__Background__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1012:1: ( ( ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) ) ) // InternalCucumber.g:1013:1: ( ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) ) { // InternalCucumber.g:1013:1: ( ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) ) // InternalCucumber.g:1014:1: ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) { // InternalCucumber.g:1014:1: ( ( rule__Background__StepsAssignment_4 ) ) // InternalCucumber.g:1015:1: ( rule__Background__StepsAssignment_4 ) { before(grammarAccess.getBackgroundAccess().getStepsAssignment_4()); // InternalCucumber.g:1016:1: ( rule__Background__StepsAssignment_4 ) // InternalCucumber.g:1016:2: rule__Background__StepsAssignment_4 { pushFollow(FOLLOW_14); rule__Background__StepsAssignment_4(); state._fsp--; } after(grammarAccess.getBackgroundAccess().getStepsAssignment_4()); } // InternalCucumber.g:1019:1: ( ( rule__Background__StepsAssignment_4 )* ) // InternalCucumber.g:1020:1: ( rule__Background__StepsAssignment_4 )* { before(grammarAccess.getBackgroundAccess().getStepsAssignment_4()); // InternalCucumber.g:1021:1: ( rule__Background__StepsAssignment_4 )* loop17: do { int alt17=2; int LA17_0 = input.LA(1); if ( (LA17_0==RULE_STEP_KEYWORD) ) { alt17=1; } switch (alt17) { case 1 : // InternalCucumber.g:1021:2: rule__Background__StepsAssignment_4 { pushFollow(FOLLOW_14); rule__Background__StepsAssignment_4(); state._fsp--; } break; default : break loop17; } } while (true); after(grammarAccess.getBackgroundAccess().getStepsAssignment_4()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__4__Impl" // $ANTLR start "rule__Scenario__Group__0" // InternalCucumber.g:1042:1: rule__Scenario__Group__0 : rule__Scenario__Group__0__Impl rule__Scenario__Group__1 ; public final void rule__Scenario__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1046:1: ( rule__Scenario__Group__0__Impl rule__Scenario__Group__1 ) // InternalCucumber.g:1047:2: rule__Scenario__Group__0__Impl rule__Scenario__Group__1 { pushFollow(FOLLOW_15); rule__Scenario__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__0" // $ANTLR start "rule__Scenario__Group__0__Impl" // InternalCucumber.g:1054:1: rule__Scenario__Group__0__Impl : ( ( rule__Scenario__TagsAssignment_0 )* ) ; public final void rule__Scenario__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1058:1: ( ( ( rule__Scenario__TagsAssignment_0 )* ) ) // InternalCucumber.g:1059:1: ( ( rule__Scenario__TagsAssignment_0 )* ) { // InternalCucumber.g:1059:1: ( ( rule__Scenario__TagsAssignment_0 )* ) // InternalCucumber.g:1060:1: ( rule__Scenario__TagsAssignment_0 )* { before(grammarAccess.getScenarioAccess().getTagsAssignment_0()); // InternalCucumber.g:1061:1: ( rule__Scenario__TagsAssignment_0 )* loop18: do { int alt18=2; int LA18_0 = input.LA(1); if ( (LA18_0==RULE_TAGNAME) ) { alt18=1; } switch (alt18) { case 1 : // InternalCucumber.g:1061:2: rule__Scenario__TagsAssignment_0 { pushFollow(FOLLOW_6); rule__Scenario__TagsAssignment_0(); state._fsp--; } break; default : break loop18; } } while (true); after(grammarAccess.getScenarioAccess().getTagsAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__0__Impl" // $ANTLR start "rule__Scenario__Group__1" // InternalCucumber.g:1071:1: rule__Scenario__Group__1 : rule__Scenario__Group__1__Impl rule__Scenario__Group__2 ; public final void rule__Scenario__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1075:1: ( rule__Scenario__Group__1__Impl rule__Scenario__Group__2 ) // InternalCucumber.g:1076:2: rule__Scenario__Group__1__Impl rule__Scenario__Group__2 { pushFollow(FOLLOW_12); rule__Scenario__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__1" // $ANTLR start "rule__Scenario__Group__1__Impl" // InternalCucumber.g:1083:1: rule__Scenario__Group__1__Impl : ( 'Scenario:' ) ; public final void rule__Scenario__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1087:1: ( ( 'Scenario:' ) ) // InternalCucumber.g:1088:1: ( 'Scenario:' ) { // InternalCucumber.g:1088:1: ( 'Scenario:' ) // InternalCucumber.g:1089:1: 'Scenario:' { before(grammarAccess.getScenarioAccess().getScenarioKeyword_1()); match(input,18,FOLLOW_2); after(grammarAccess.getScenarioAccess().getScenarioKeyword_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__1__Impl" // $ANTLR start "rule__Scenario__Group__2" // InternalCucumber.g:1102:1: rule__Scenario__Group__2 : rule__Scenario__Group__2__Impl rule__Scenario__Group__3 ; public final void rule__Scenario__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1106:1: ( rule__Scenario__Group__2__Impl rule__Scenario__Group__3 ) // InternalCucumber.g:1107:2: rule__Scenario__Group__2__Impl rule__Scenario__Group__3 { pushFollow(FOLLOW_12); rule__Scenario__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__2" // $ANTLR start "rule__Scenario__Group__2__Impl" // InternalCucumber.g:1114:1: rule__Scenario__Group__2__Impl : ( ( rule__Scenario__TitleAssignment_2 )? ) ; public final void rule__Scenario__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1118:1: ( ( ( rule__Scenario__TitleAssignment_2 )? ) ) // InternalCucumber.g:1119:1: ( ( rule__Scenario__TitleAssignment_2 )? ) { // InternalCucumber.g:1119:1: ( ( rule__Scenario__TitleAssignment_2 )? ) // InternalCucumber.g:1120:1: ( rule__Scenario__TitleAssignment_2 )? { before(grammarAccess.getScenarioAccess().getTitleAssignment_2()); // InternalCucumber.g:1121:1: ( rule__Scenario__TitleAssignment_2 )? int alt19=2; int LA19_0 = input.LA(1); if ( ((LA19_0>=RULE_WORD && LA19_0<=RULE_PLACEHOLDER)) ) { alt19=1; } switch (alt19) { case 1 : // InternalCucumber.g:1121:2: rule__Scenario__TitleAssignment_2 { pushFollow(FOLLOW_2); rule__Scenario__TitleAssignment_2(); state._fsp--; } break; } after(grammarAccess.getScenarioAccess().getTitleAssignment_2()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__2__Impl" // $ANTLR start "rule__Scenario__Group__3" // InternalCucumber.g:1131:1: rule__Scenario__Group__3 : rule__Scenario__Group__3__Impl rule__Scenario__Group__4 ; public final void rule__Scenario__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1135:1: ( rule__Scenario__Group__3__Impl rule__Scenario__Group__4 ) // InternalCucumber.g:1136:2: rule__Scenario__Group__3__Impl rule__Scenario__Group__4 { pushFollow(FOLLOW_13); rule__Scenario__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__3" // $ANTLR start "rule__Scenario__Group__3__Impl" // InternalCucumber.g:1143:1: rule__Scenario__Group__3__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Scenario__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1147:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:1148:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:1148:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:1149:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:1149:1: ( ( RULE_EOL ) ) // InternalCucumber.g:1150:1: ( RULE_EOL ) { before(grammarAccess.getScenarioAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:1151:1: ( RULE_EOL ) // InternalCucumber.g:1151:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getScenarioAccess().getEOLTerminalRuleCall_3()); } // InternalCucumber.g:1154:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1155:1: ( RULE_EOL )* { before(grammarAccess.getScenarioAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:1156:1: ( RULE_EOL )* loop20: do { int alt20=2; int LA20_0 = input.LA(1); if ( (LA20_0==RULE_EOL) ) { alt20=1; } switch (alt20) { case 1 : // InternalCucumber.g:1156:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop20; } } while (true); after(grammarAccess.getScenarioAccess().getEOLTerminalRuleCall_3()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__3__Impl" // $ANTLR start "rule__Scenario__Group__4" // InternalCucumber.g:1167:1: rule__Scenario__Group__4 : rule__Scenario__Group__4__Impl rule__Scenario__Group__5 ; public final void rule__Scenario__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1171:1: ( rule__Scenario__Group__4__Impl rule__Scenario__Group__5 ) // InternalCucumber.g:1172:2: rule__Scenario__Group__4__Impl rule__Scenario__Group__5 { pushFollow(FOLLOW_13); rule__Scenario__Group__4__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__5(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__4" // $ANTLR start "rule__Scenario__Group__4__Impl" // InternalCucumber.g:1179:1: rule__Scenario__Group__4__Impl : ( ( rule__Scenario__NarrativeAssignment_4 )? ) ; public final void rule__Scenario__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1183:1: ( ( ( rule__Scenario__NarrativeAssignment_4 )? ) ) // InternalCucumber.g:1184:1: ( ( rule__Scenario__NarrativeAssignment_4 )? ) { // InternalCucumber.g:1184:1: ( ( rule__Scenario__NarrativeAssignment_4 )? ) // InternalCucumber.g:1185:1: ( rule__Scenario__NarrativeAssignment_4 )? { before(grammarAccess.getScenarioAccess().getNarrativeAssignment_4()); // InternalCucumber.g:1186:1: ( rule__Scenario__NarrativeAssignment_4 )? int alt21=2; int LA21_0 = input.LA(1); if ( ((LA21_0>=RULE_WORD && LA21_0<=RULE_PLACEHOLDER)) ) { alt21=1; } switch (alt21) { case 1 : // InternalCucumber.g:1186:2: rule__Scenario__NarrativeAssignment_4 { pushFollow(FOLLOW_2); rule__Scenario__NarrativeAssignment_4(); state._fsp--; } break; } after(grammarAccess.getScenarioAccess().getNarrativeAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__4__Impl" // $ANTLR start "rule__Scenario__Group__5" // InternalCucumber.g:1196:1: rule__Scenario__Group__5 : rule__Scenario__Group__5__Impl ; public final void rule__Scenario__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1200:1: ( rule__Scenario__Group__5__Impl ) // InternalCucumber.g:1201:2: rule__Scenario__Group__5__Impl { pushFollow(FOLLOW_2); rule__Scenario__Group__5__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__5" // $ANTLR start "rule__Scenario__Group__5__Impl" // InternalCucumber.g:1207:1: rule__Scenario__Group__5__Impl : ( ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) ) ; public final void rule__Scenario__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1211:1: ( ( ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) ) ) // InternalCucumber.g:1212:1: ( ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) ) { // InternalCucumber.g:1212:1: ( ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) ) // InternalCucumber.g:1213:1: ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) { // InternalCucumber.g:1213:1: ( ( rule__Scenario__StepsAssignment_5 ) ) // InternalCucumber.g:1214:1: ( rule__Scenario__StepsAssignment_5 ) { before(grammarAccess.getScenarioAccess().getStepsAssignment_5()); // InternalCucumber.g:1215:1: ( rule__Scenario__StepsAssignment_5 ) // InternalCucumber.g:1215:2: rule__Scenario__StepsAssignment_5 { pushFollow(FOLLOW_14); rule__Scenario__StepsAssignment_5(); state._fsp--; } after(grammarAccess.getScenarioAccess().getStepsAssignment_5()); } // InternalCucumber.g:1218:1: ( ( rule__Scenario__StepsAssignment_5 )* ) // InternalCucumber.g:1219:1: ( rule__Scenario__StepsAssignment_5 )* { before(grammarAccess.getScenarioAccess().getStepsAssignment_5()); // InternalCucumber.g:1220:1: ( rule__Scenario__StepsAssignment_5 )* loop22: do { int alt22=2; int LA22_0 = input.LA(1); if ( (LA22_0==RULE_STEP_KEYWORD) ) { alt22=1; } switch (alt22) { case 1 : // InternalCucumber.g:1220:2: rule__Scenario__StepsAssignment_5 { pushFollow(FOLLOW_14); rule__Scenario__StepsAssignment_5(); state._fsp--; } break; default : break loop22; } } while (true); after(grammarAccess.getScenarioAccess().getStepsAssignment_5()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__5__Impl" // $ANTLR start "rule__ScenarioOutline__Group__0" // InternalCucumber.g:1243:1: rule__ScenarioOutline__Group__0 : rule__ScenarioOutline__Group__0__Impl rule__ScenarioOutline__Group__1 ; public final void rule__ScenarioOutline__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1247:1: ( rule__ScenarioOutline__Group__0__Impl rule__ScenarioOutline__Group__1 ) // InternalCucumber.g:1248:2: rule__ScenarioOutline__Group__0__Impl rule__ScenarioOutline__Group__1 { pushFollow(FOLLOW_9); rule__ScenarioOutline__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__0" // $ANTLR start "rule__ScenarioOutline__Group__0__Impl" // InternalCucumber.g:1255:1: rule__ScenarioOutline__Group__0__Impl : ( ( rule__ScenarioOutline__TagsAssignment_0 )* ) ; public final void rule__ScenarioOutline__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1259:1: ( ( ( rule__ScenarioOutline__TagsAssignment_0 )* ) ) // InternalCucumber.g:1260:1: ( ( rule__ScenarioOutline__TagsAssignment_0 )* ) { // InternalCucumber.g:1260:1: ( ( rule__ScenarioOutline__TagsAssignment_0 )* ) // InternalCucumber.g:1261:1: ( rule__ScenarioOutline__TagsAssignment_0 )* { before(grammarAccess.getScenarioOutlineAccess().getTagsAssignment_0()); // InternalCucumber.g:1262:1: ( rule__ScenarioOutline__TagsAssignment_0 )* loop23: do { int alt23=2; int LA23_0 = input.LA(1); if ( (LA23_0==RULE_TAGNAME) ) { alt23=1; } switch (alt23) { case 1 : // InternalCucumber.g:1262:2: rule__ScenarioOutline__TagsAssignment_0 { pushFollow(FOLLOW_6); rule__ScenarioOutline__TagsAssignment_0(); state._fsp--; } break; default : break loop23; } } while (true); after(grammarAccess.getScenarioOutlineAccess().getTagsAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__0__Impl" // $ANTLR start "rule__ScenarioOutline__Group__1" // InternalCucumber.g:1272:1: rule__ScenarioOutline__Group__1 : rule__ScenarioOutline__Group__1__Impl rule__ScenarioOutline__Group__2 ; public final void rule__ScenarioOutline__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1276:1: ( rule__ScenarioOutline__Group__1__Impl rule__ScenarioOutline__Group__2 ) // InternalCucumber.g:1277:2: rule__ScenarioOutline__Group__1__Impl rule__ScenarioOutline__Group__2 { pushFollow(FOLLOW_12); rule__ScenarioOutline__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__1" // $ANTLR start "rule__ScenarioOutline__Group__1__Impl" // InternalCucumber.g:1284:1: rule__ScenarioOutline__Group__1__Impl : ( 'Scenario Outline:' ) ; public final void rule__ScenarioOutline__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1288:1: ( ( 'Scenario Outline:' ) ) // InternalCucumber.g:1289:1: ( 'Scenario Outline:' ) { // InternalCucumber.g:1289:1: ( 'Scenario Outline:' ) // InternalCucumber.g:1290:1: 'Scenario Outline:' { before(grammarAccess.getScenarioOutlineAccess().getScenarioOutlineKeyword_1()); match(input,19,FOLLOW_2); after(grammarAccess.getScenarioOutlineAccess().getScenarioOutlineKeyword_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__1__Impl" // $ANTLR start "rule__ScenarioOutline__Group__2" // InternalCucumber.g:1303:1: rule__ScenarioOutline__Group__2 : rule__ScenarioOutline__Group__2__Impl rule__ScenarioOutline__Group__3 ; public final void rule__ScenarioOutline__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1307:1: ( rule__ScenarioOutline__Group__2__Impl rule__ScenarioOutline__Group__3 ) // InternalCucumber.g:1308:2: rule__ScenarioOutline__Group__2__Impl rule__ScenarioOutline__Group__3 { pushFollow(FOLLOW_12); rule__ScenarioOutline__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__2" // $ANTLR start "rule__ScenarioOutline__Group__2__Impl" // InternalCucumber.g:1315:1: rule__ScenarioOutline__Group__2__Impl : ( ( rule__ScenarioOutline__TitleAssignment_2 )? ) ; public final void rule__ScenarioOutline__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1319:1: ( ( ( rule__ScenarioOutline__TitleAssignment_2 )? ) ) // InternalCucumber.g:1320:1: ( ( rule__ScenarioOutline__TitleAssignment_2 )? ) { // InternalCucumber.g:1320:1: ( ( rule__ScenarioOutline__TitleAssignment_2 )? ) // InternalCucumber.g:1321:1: ( rule__ScenarioOutline__TitleAssignment_2 )? { before(grammarAccess.getScenarioOutlineAccess().getTitleAssignment_2()); // InternalCucumber.g:1322:1: ( rule__ScenarioOutline__TitleAssignment_2 )? int alt24=2; int LA24_0 = input.LA(1); if ( ((LA24_0>=RULE_WORD && LA24_0<=RULE_PLACEHOLDER)) ) { alt24=1; } switch (alt24) { case 1 : // InternalCucumber.g:1322:2: rule__ScenarioOutline__TitleAssignment_2 { pushFollow(FOLLOW_2); rule__ScenarioOutline__TitleAssignment_2(); state._fsp--; } break; } after(grammarAccess.getScenarioOutlineAccess().getTitleAssignment_2()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__2__Impl" // $ANTLR start "rule__ScenarioOutline__Group__3" // InternalCucumber.g:1332:1: rule__ScenarioOutline__Group__3 : rule__ScenarioOutline__Group__3__Impl rule__ScenarioOutline__Group__4 ; public final void rule__ScenarioOutline__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1336:1: ( rule__ScenarioOutline__Group__3__Impl rule__ScenarioOutline__Group__4 ) // InternalCucumber.g:1337:2: rule__ScenarioOutline__Group__3__Impl rule__ScenarioOutline__Group__4 { pushFollow(FOLLOW_13); rule__ScenarioOutline__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__3" // $ANTLR start "rule__ScenarioOutline__Group__3__Impl" // InternalCucumber.g:1344:1: rule__ScenarioOutline__Group__3__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__ScenarioOutline__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1348:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:1349:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:1349:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:1350:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:1350:1: ( ( RULE_EOL ) ) // InternalCucumber.g:1351:1: ( RULE_EOL ) { before(grammarAccess.getScenarioOutlineAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:1352:1: ( RULE_EOL ) // InternalCucumber.g:1352:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getScenarioOutlineAccess().getEOLTerminalRuleCall_3()); } // InternalCucumber.g:1355:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1356:1: ( RULE_EOL )* { before(grammarAccess.getScenarioOutlineAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:1357:1: ( RULE_EOL )* loop25: do { int alt25=2; int LA25_0 = input.LA(1); if ( (LA25_0==RULE_EOL) ) { alt25=1; } switch (alt25) { case 1 : // InternalCucumber.g:1357:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop25; } } while (true); after(grammarAccess.getScenarioOutlineAccess().getEOLTerminalRuleCall_3()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__3__Impl" // $ANTLR start "rule__ScenarioOutline__Group__4" // InternalCucumber.g:1368:1: rule__ScenarioOutline__Group__4 : rule__ScenarioOutline__Group__4__Impl rule__ScenarioOutline__Group__5 ; public final void rule__ScenarioOutline__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1372:1: ( rule__ScenarioOutline__Group__4__Impl rule__ScenarioOutline__Group__5 ) // InternalCucumber.g:1373:2: rule__ScenarioOutline__Group__4__Impl rule__ScenarioOutline__Group__5 { pushFollow(FOLLOW_13); rule__ScenarioOutline__Group__4__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__5(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__4" // $ANTLR start "rule__ScenarioOutline__Group__4__Impl" // InternalCucumber.g:1380:1: rule__ScenarioOutline__Group__4__Impl : ( ( rule__ScenarioOutline__NarrativeAssignment_4 )? ) ; public final void rule__ScenarioOutline__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1384:1: ( ( ( rule__ScenarioOutline__NarrativeAssignment_4 )? ) ) // InternalCucumber.g:1385:1: ( ( rule__ScenarioOutline__NarrativeAssignment_4 )? ) { // InternalCucumber.g:1385:1: ( ( rule__ScenarioOutline__NarrativeAssignment_4 )? ) // InternalCucumber.g:1386:1: ( rule__ScenarioOutline__NarrativeAssignment_4 )? { before(grammarAccess.getScenarioOutlineAccess().getNarrativeAssignment_4()); // InternalCucumber.g:1387:1: ( rule__ScenarioOutline__NarrativeAssignment_4 )? int alt26=2; int LA26_0 = input.LA(1); if ( ((LA26_0>=RULE_WORD && LA26_0<=RULE_PLACEHOLDER)) ) { alt26=1; } switch (alt26) { case 1 : // InternalCucumber.g:1387:2: rule__ScenarioOutline__NarrativeAssignment_4 { pushFollow(FOLLOW_2); rule__ScenarioOutline__NarrativeAssignment_4(); state._fsp--; } break; } after(grammarAccess.getScenarioOutlineAccess().getNarrativeAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__4__Impl" // $ANTLR start "rule__ScenarioOutline__Group__5" // InternalCucumber.g:1397:1: rule__ScenarioOutline__Group__5 : rule__ScenarioOutline__Group__5__Impl rule__ScenarioOutline__Group__6 ; public final void rule__ScenarioOutline__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1401:1: ( rule__ScenarioOutline__Group__5__Impl rule__ScenarioOutline__Group__6 ) // InternalCucumber.g:1402:2: rule__ScenarioOutline__Group__5__Impl rule__ScenarioOutline__Group__6 { pushFollow(FOLLOW_16); rule__ScenarioOutline__Group__5__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__6(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__5" // $ANTLR start "rule__ScenarioOutline__Group__5__Impl" // InternalCucumber.g:1409:1: rule__ScenarioOutline__Group__5__Impl : ( ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) ) ; public final void rule__ScenarioOutline__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1413:1: ( ( ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) ) ) // InternalCucumber.g:1414:1: ( ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) ) { // InternalCucumber.g:1414:1: ( ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) ) // InternalCucumber.g:1415:1: ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) { // InternalCucumber.g:1415:1: ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) // InternalCucumber.g:1416:1: ( rule__ScenarioOutline__StepsAssignment_5 ) { before(grammarAccess.getScenarioOutlineAccess().getStepsAssignment_5()); // InternalCucumber.g:1417:1: ( rule__ScenarioOutline__StepsAssignment_5 ) // InternalCucumber.g:1417:2: rule__ScenarioOutline__StepsAssignment_5 { pushFollow(FOLLOW_14); rule__ScenarioOutline__StepsAssignment_5(); state._fsp--; } after(grammarAccess.getScenarioOutlineAccess().getStepsAssignment_5()); } // InternalCucumber.g:1420:1: ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) // InternalCucumber.g:1421:1: ( rule__ScenarioOutline__StepsAssignment_5 )* { before(grammarAccess.getScenarioOutlineAccess().getStepsAssignment_5()); // InternalCucumber.g:1422:1: ( rule__ScenarioOutline__StepsAssignment_5 )* loop27: do { int alt27=2; int LA27_0 = input.LA(1); if ( (LA27_0==RULE_STEP_KEYWORD) ) { alt27=1; } switch (alt27) { case 1 : // InternalCucumber.g:1422:2: rule__ScenarioOutline__StepsAssignment_5 { pushFollow(FOLLOW_14); rule__ScenarioOutline__StepsAssignment_5(); state._fsp--; } break; default : break loop27; } } while (true); after(grammarAccess.getScenarioOutlineAccess().getStepsAssignment_5()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__5__Impl" // $ANTLR start "rule__ScenarioOutline__Group__6" // InternalCucumber.g:1433:1: rule__ScenarioOutline__Group__6 : rule__ScenarioOutline__Group__6__Impl ; public final void rule__ScenarioOutline__Group__6() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1437:1: ( rule__ScenarioOutline__Group__6__Impl ) // InternalCucumber.g:1438:2: rule__ScenarioOutline__Group__6__Impl { pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__6__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__6" // $ANTLR start "rule__ScenarioOutline__Group__6__Impl" // InternalCucumber.g:1444:1: rule__ScenarioOutline__Group__6__Impl : ( ( rule__ScenarioOutline__ExamplesAssignment_6 ) ) ; public final void rule__ScenarioOutline__Group__6__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1448:1: ( ( ( rule__ScenarioOutline__ExamplesAssignment_6 ) ) ) // InternalCucumber.g:1449:1: ( ( rule__ScenarioOutline__ExamplesAssignment_6 ) ) { // InternalCucumber.g:1449:1: ( ( rule__ScenarioOutline__ExamplesAssignment_6 ) ) // InternalCucumber.g:1450:1: ( rule__ScenarioOutline__ExamplesAssignment_6 ) { before(grammarAccess.getScenarioOutlineAccess().getExamplesAssignment_6()); // InternalCucumber.g:1451:1: ( rule__ScenarioOutline__ExamplesAssignment_6 ) // InternalCucumber.g:1451:2: rule__ScenarioOutline__ExamplesAssignment_6 { pushFollow(FOLLOW_2); rule__ScenarioOutline__ExamplesAssignment_6(); state._fsp--; } after(grammarAccess.getScenarioOutlineAccess().getExamplesAssignment_6()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__6__Impl" // $ANTLR start "rule__Step__Group__0" // InternalCucumber.g:1475:1: rule__Step__Group__0 : rule__Step__Group__0__Impl rule__Step__Group__1 ; public final void rule__Step__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1479:1: ( rule__Step__Group__0__Impl rule__Step__Group__1 ) // InternalCucumber.g:1480:2: rule__Step__Group__0__Impl rule__Step__Group__1 { pushFollow(FOLLOW_17); rule__Step__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__0" // $ANTLR start "rule__Step__Group__0__Impl" // InternalCucumber.g:1487:1: rule__Step__Group__0__Impl : ( RULE_STEP_KEYWORD ) ; public final void rule__Step__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1491:1: ( ( RULE_STEP_KEYWORD ) ) // InternalCucumber.g:1492:1: ( RULE_STEP_KEYWORD ) { // InternalCucumber.g:1492:1: ( RULE_STEP_KEYWORD ) // InternalCucumber.g:1493:1: RULE_STEP_KEYWORD { before(grammarAccess.getStepAccess().getSTEP_KEYWORDTerminalRuleCall_0()); match(input,RULE_STEP_KEYWORD,FOLLOW_2); after(grammarAccess.getStepAccess().getSTEP_KEYWORDTerminalRuleCall_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__0__Impl" // $ANTLR start "rule__Step__Group__1" // InternalCucumber.g:1504:1: rule__Step__Group__1 : rule__Step__Group__1__Impl rule__Step__Group__2 ; public final void rule__Step__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1508:1: ( rule__Step__Group__1__Impl rule__Step__Group__2 ) // InternalCucumber.g:1509:2: rule__Step__Group__1__Impl rule__Step__Group__2 { pushFollow(FOLLOW_18); rule__Step__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__1" // $ANTLR start "rule__Step__Group__1__Impl" // InternalCucumber.g:1516:1: rule__Step__Group__1__Impl : ( ( rule__Step__DescriptionAssignment_1 ) ) ; public final void rule__Step__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1520:1: ( ( ( rule__Step__DescriptionAssignment_1 ) ) ) // InternalCucumber.g:1521:1: ( ( rule__Step__DescriptionAssignment_1 ) ) { // InternalCucumber.g:1521:1: ( ( rule__Step__DescriptionAssignment_1 ) ) // InternalCucumber.g:1522:1: ( rule__Step__DescriptionAssignment_1 ) { before(grammarAccess.getStepAccess().getDescriptionAssignment_1()); // InternalCucumber.g:1523:1: ( rule__Step__DescriptionAssignment_1 ) // InternalCucumber.g:1523:2: rule__Step__DescriptionAssignment_1 { pushFollow(FOLLOW_2); rule__Step__DescriptionAssignment_1(); state._fsp--; } after(grammarAccess.getStepAccess().getDescriptionAssignment_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__1__Impl" // $ANTLR start "rule__Step__Group__2" // InternalCucumber.g:1533:1: rule__Step__Group__2 : rule__Step__Group__2__Impl rule__Step__Group__3 ; public final void rule__Step__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1537:1: ( rule__Step__Group__2__Impl rule__Step__Group__3 ) // InternalCucumber.g:1538:2: rule__Step__Group__2__Impl rule__Step__Group__3 { pushFollow(FOLLOW_18); rule__Step__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__2" // $ANTLR start "rule__Step__Group__2__Impl" // InternalCucumber.g:1545:1: rule__Step__Group__2__Impl : ( ( RULE_EOL )* ) ; public final void rule__Step__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1549:1: ( ( ( RULE_EOL )* ) ) // InternalCucumber.g:1550:1: ( ( RULE_EOL )* ) { // InternalCucumber.g:1550:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1551:1: ( RULE_EOL )* { before(grammarAccess.getStepAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:1552:1: ( RULE_EOL )* loop28: do { int alt28=2; int LA28_0 = input.LA(1); if ( (LA28_0==RULE_EOL) ) { alt28=1; } switch (alt28) { case 1 : // InternalCucumber.g:1552:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop28; } } while (true); after(grammarAccess.getStepAccess().getEOLTerminalRuleCall_2()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__2__Impl" // $ANTLR start "rule__Step__Group__3" // InternalCucumber.g:1562:1: rule__Step__Group__3 : rule__Step__Group__3__Impl rule__Step__Group__4 ; public final void rule__Step__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1566:1: ( rule__Step__Group__3__Impl rule__Step__Group__4 ) // InternalCucumber.g:1567:2: rule__Step__Group__3__Impl rule__Step__Group__4 { pushFollow(FOLLOW_18); rule__Step__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__3" // $ANTLR start "rule__Step__Group__3__Impl" // InternalCucumber.g:1574:1: rule__Step__Group__3__Impl : ( ( rule__Step__TablesAssignment_3 )* ) ; public final void rule__Step__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1578:1: ( ( ( rule__Step__TablesAssignment_3 )* ) ) // InternalCucumber.g:1579:1: ( ( rule__Step__TablesAssignment_3 )* ) { // InternalCucumber.g:1579:1: ( ( rule__Step__TablesAssignment_3 )* ) // InternalCucumber.g:1580:1: ( rule__Step__TablesAssignment_3 )* { before(grammarAccess.getStepAccess().getTablesAssignment_3()); // InternalCucumber.g:1581:1: ( rule__Step__TablesAssignment_3 )* loop29: do { int alt29=2; int LA29_0 = input.LA(1); if ( (LA29_0==RULE_TABLE_ROW) ) { alt29=1; } switch (alt29) { case 1 : // InternalCucumber.g:1581:2: rule__Step__TablesAssignment_3 { pushFollow(FOLLOW_19); rule__Step__TablesAssignment_3(); state._fsp--; } break; default : break loop29; } } while (true); after(grammarAccess.getStepAccess().getTablesAssignment_3()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__3__Impl" // $ANTLR start "rule__Step__Group__4" // InternalCucumber.g:1591:1: rule__Step__Group__4 : rule__Step__Group__4__Impl rule__Step__Group__5 ; public final void rule__Step__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1595:1: ( rule__Step__Group__4__Impl rule__Step__Group__5 ) // InternalCucumber.g:1596:2: rule__Step__Group__4__Impl rule__Step__Group__5 { pushFollow(FOLLOW_18); rule__Step__Group__4__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__5(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__4" // $ANTLR start "rule__Step__Group__4__Impl" // InternalCucumber.g:1603:1: rule__Step__Group__4__Impl : ( ( rule__Step__CodeAssignment_4 )? ) ; public final void rule__Step__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1607:1: ( ( ( rule__Step__CodeAssignment_4 )? ) ) // InternalCucumber.g:1608:1: ( ( rule__Step__CodeAssignment_4 )? ) { // InternalCucumber.g:1608:1: ( ( rule__Step__CodeAssignment_4 )? ) // InternalCucumber.g:1609:1: ( rule__Step__CodeAssignment_4 )? { before(grammarAccess.getStepAccess().getCodeAssignment_4()); // InternalCucumber.g:1610:1: ( rule__Step__CodeAssignment_4 )? int alt30=2; int LA30_0 = input.LA(1); if ( (LA30_0==RULE_DOC_STRING) ) { alt30=1; } switch (alt30) { case 1 : // InternalCucumber.g:1610:2: rule__Step__CodeAssignment_4 { pushFollow(FOLLOW_2); rule__Step__CodeAssignment_4(); state._fsp--; } break; } after(grammarAccess.getStepAccess().getCodeAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__4__Impl" // $ANTLR start "rule__Step__Group__5" // InternalCucumber.g:1620:1: rule__Step__Group__5 : rule__Step__Group__5__Impl ; public final void rule__Step__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1624:1: ( rule__Step__Group__5__Impl ) // InternalCucumber.g:1625:2: rule__Step__Group__5__Impl { pushFollow(FOLLOW_2); rule__Step__Group__5__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__5" // $ANTLR start "rule__Step__Group__5__Impl" // InternalCucumber.g:1631:1: rule__Step__Group__5__Impl : ( ( rule__Step__TablesAssignment_5 )* ) ; public final void rule__Step__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1635:1: ( ( ( rule__Step__TablesAssignment_5 )* ) ) // InternalCucumber.g:1636:1: ( ( rule__Step__TablesAssignment_5 )* ) { // InternalCucumber.g:1636:1: ( ( rule__Step__TablesAssignment_5 )* ) // InternalCucumber.g:1637:1: ( rule__Step__TablesAssignment_5 )* { before(grammarAccess.getStepAccess().getTablesAssignment_5()); // InternalCucumber.g:1638:1: ( rule__Step__TablesAssignment_5 )* loop31: do { int alt31=2; int LA31_0 = input.LA(1); if ( (LA31_0==RULE_TABLE_ROW) ) { alt31=1; } switch (alt31) { case 1 : // InternalCucumber.g:1638:2: rule__Step__TablesAssignment_5 { pushFollow(FOLLOW_19); rule__Step__TablesAssignment_5(); state._fsp--; } break; default : break loop31; } } while (true); after(grammarAccess.getStepAccess().getTablesAssignment_5()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__5__Impl" // $ANTLR start "rule__Examples__Group__0" // InternalCucumber.g:1660:1: rule__Examples__Group__0 : rule__Examples__Group__0__Impl rule__Examples__Group__1 ; public final void rule__Examples__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1664:1: ( rule__Examples__Group__0__Impl rule__Examples__Group__1 ) // InternalCucumber.g:1665:2: rule__Examples__Group__0__Impl rule__Examples__Group__1 { pushFollow(FOLLOW_12); rule__Examples__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Examples__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__0" // $ANTLR start "rule__Examples__Group__0__Impl" // InternalCucumber.g:1672:1: rule__Examples__Group__0__Impl : ( 'Examples:' ) ; public final void rule__Examples__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1676:1: ( ( 'Examples:' ) ) // InternalCucumber.g:1677:1: ( 'Examples:' ) { // InternalCucumber.g:1677:1: ( 'Examples:' ) // InternalCucumber.g:1678:1: 'Examples:' { before(grammarAccess.getExamplesAccess().getExamplesKeyword_0()); match(input,20,FOLLOW_2); after(grammarAccess.getExamplesAccess().getExamplesKeyword_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__0__Impl" // $ANTLR start "rule__Examples__Group__1" // InternalCucumber.g:1691:1: rule__Examples__Group__1 : rule__Examples__Group__1__Impl rule__Examples__Group__2 ; public final void rule__Examples__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1695:1: ( rule__Examples__Group__1__Impl rule__Examples__Group__2 ) // InternalCucumber.g:1696:2: rule__Examples__Group__1__Impl rule__Examples__Group__2 { pushFollow(FOLLOW_12); rule__Examples__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Examples__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__1" // $ANTLR start "rule__Examples__Group__1__Impl" // InternalCucumber.g:1703:1: rule__Examples__Group__1__Impl : ( ( rule__Examples__TitleAssignment_1 )? ) ; public final void rule__Examples__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1707:1: ( ( ( rule__Examples__TitleAssignment_1 )? ) ) // InternalCucumber.g:1708:1: ( ( rule__Examples__TitleAssignment_1 )? ) { // InternalCucumber.g:1708:1: ( ( rule__Examples__TitleAssignment_1 )? ) // InternalCucumber.g:1709:1: ( rule__Examples__TitleAssignment_1 )? { before(grammarAccess.getExamplesAccess().getTitleAssignment_1()); // InternalCucumber.g:1710:1: ( rule__Examples__TitleAssignment_1 )? int alt32=2; int LA32_0 = input.LA(1); if ( ((LA32_0>=RULE_WORD && LA32_0<=RULE_PLACEHOLDER)) ) { alt32=1; } switch (alt32) { case 1 : // InternalCucumber.g:1710:2: rule__Examples__TitleAssignment_1 { pushFollow(FOLLOW_2); rule__Examples__TitleAssignment_1(); state._fsp--; } break; } after(grammarAccess.getExamplesAccess().getTitleAssignment_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__1__Impl" // $ANTLR start "rule__Examples__Group__2" // InternalCucumber.g:1720:1: rule__Examples__Group__2 : rule__Examples__Group__2__Impl rule__Examples__Group__3 ; public final void rule__Examples__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1724:1: ( rule__Examples__Group__2__Impl rule__Examples__Group__3 ) // InternalCucumber.g:1725:2: rule__Examples__Group__2__Impl rule__Examples__Group__3 { pushFollow(FOLLOW_20); rule__Examples__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Examples__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__2" // $ANTLR start "rule__Examples__Group__2__Impl" // InternalCucumber.g:1732:1: rule__Examples__Group__2__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Examples__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1736:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:1737:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:1737:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:1738:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:1738:1: ( ( RULE_EOL ) ) // InternalCucumber.g:1739:1: ( RULE_EOL ) { before(grammarAccess.getExamplesAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:1740:1: ( RULE_EOL ) // InternalCucumber.g:1740:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getExamplesAccess().getEOLTerminalRuleCall_2()); } // InternalCucumber.g:1743:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1744:1: ( RULE_EOL )* { before(grammarAccess.getExamplesAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:1745:1: ( RULE_EOL )* loop33: do { int alt33=2; int LA33_0 = input.LA(1); if ( (LA33_0==RULE_EOL) ) { alt33=1; } switch (alt33) { case 1 : // InternalCucumber.g:1745:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop33; } } while (true); after(grammarAccess.getExamplesAccess().getEOLTerminalRuleCall_2()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__2__Impl" // $ANTLR start "rule__Examples__Group__3" // InternalCucumber.g:1756:1: rule__Examples__Group__3 : rule__Examples__Group__3__Impl rule__Examples__Group__4 ; public final void rule__Examples__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1760:1: ( rule__Examples__Group__3__Impl rule__Examples__Group__4 ) // InternalCucumber.g:1761:2: rule__Examples__Group__3__Impl rule__Examples__Group__4 { pushFollow(FOLLOW_20); rule__Examples__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Examples__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__3" // $ANTLR start "rule__Examples__Group__3__Impl" // InternalCucumber.g:1768:1: rule__Examples__Group__3__Impl : ( ( rule__Examples__NarrativeAssignment_3 )? ) ; public final void rule__Examples__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1772:1: ( ( ( rule__Examples__NarrativeAssignment_3 )? ) ) // InternalCucumber.g:1773:1: ( ( rule__Examples__NarrativeAssignment_3 )? ) { // InternalCucumber.g:1773:1: ( ( rule__Examples__NarrativeAssignment_3 )? ) // InternalCucumber.g:1774:1: ( rule__Examples__NarrativeAssignment_3 )? { before(grammarAccess.getExamplesAccess().getNarrativeAssignment_3()); // InternalCucumber.g:1775:1: ( rule__Examples__NarrativeAssignment_3 )? int alt34=2; int LA34_0 = input.LA(1); if ( ((LA34_0>=RULE_WORD && LA34_0<=RULE_PLACEHOLDER)) ) { alt34=1; } switch (alt34) { case 1 : // InternalCucumber.g:1775:2: rule__Examples__NarrativeAssignment_3 { pushFollow(FOLLOW_2); rule__Examples__NarrativeAssignment_3(); state._fsp--; } break; } after(grammarAccess.getExamplesAccess().getNarrativeAssignment_3()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__3__Impl" // $ANTLR start "rule__Examples__Group__4" // InternalCucumber.g:1785:1: rule__Examples__Group__4 : rule__Examples__Group__4__Impl ; public final void rule__Examples__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1789:1: ( rule__Examples__Group__4__Impl ) // InternalCucumber.g:1790:2: rule__Examples__Group__4__Impl { pushFollow(FOLLOW_2); rule__Examples__Group__4__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__4" // $ANTLR start "rule__Examples__Group__4__Impl" // InternalCucumber.g:1796:1: rule__Examples__Group__4__Impl : ( ( rule__Examples__TableAssignment_4 ) ) ; public final void rule__Examples__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1800:1: ( ( ( rule__Examples__TableAssignment_4 ) ) ) // InternalCucumber.g:1801:1: ( ( rule__Examples__TableAssignment_4 ) ) { // InternalCucumber.g:1801:1: ( ( rule__Examples__TableAssignment_4 ) ) // InternalCucumber.g:1802:1: ( rule__Examples__TableAssignment_4 ) { before(grammarAccess.getExamplesAccess().getTableAssignment_4()); // InternalCucumber.g:1803:1: ( rule__Examples__TableAssignment_4 ) // InternalCucumber.g:1803:2: rule__Examples__TableAssignment_4 { pushFollow(FOLLOW_2); rule__Examples__TableAssignment_4(); state._fsp--; } after(grammarAccess.getExamplesAccess().getTableAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__4__Impl" // $ANTLR start "rule__Table__Group__0" // InternalCucumber.g:1823:1: rule__Table__Group__0 : rule__Table__Group__0__Impl rule__Table__Group__1 ; public final void rule__Table__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1827:1: ( rule__Table__Group__0__Impl rule__Table__Group__1 ) // InternalCucumber.g:1828:2: rule__Table__Group__0__Impl rule__Table__Group__1 { pushFollow(FOLLOW_8); rule__Table__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Table__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__Group__0" // $ANTLR start "rule__Table__Group__0__Impl" // InternalCucumber.g:1835:1: rule__Table__Group__0__Impl : ( ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) ) ; public final void rule__Table__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1839:1: ( ( ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) ) ) // InternalCucumber.g:1840:1: ( ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) ) { // InternalCucumber.g:1840:1: ( ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) ) // InternalCucumber.g:1841:1: ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) { // InternalCucumber.g:1841:1: ( ( rule__Table__RowsAssignment_0 ) ) // InternalCucumber.g:1842:1: ( rule__Table__RowsAssignment_0 ) { before(grammarAccess.getTableAccess().getRowsAssignment_0()); // InternalCucumber.g:1843:1: ( rule__Table__RowsAssignment_0 ) // InternalCucumber.g:1843:2: rule__Table__RowsAssignment_0 { pushFollow(FOLLOW_19); rule__Table__RowsAssignment_0(); state._fsp--; } after(grammarAccess.getTableAccess().getRowsAssignment_0()); } // InternalCucumber.g:1846:1: ( ( rule__Table__RowsAssignment_0 )* ) // InternalCucumber.g:1847:1: ( rule__Table__RowsAssignment_0 )* { before(grammarAccess.getTableAccess().getRowsAssignment_0()); // InternalCucumber.g:1848:1: ( rule__Table__RowsAssignment_0 )* loop35: do { int alt35=2; int LA35_0 = input.LA(1); if ( (LA35_0==RULE_TABLE_ROW) ) { alt35=1; } switch (alt35) { case 1 : // InternalCucumber.g:1848:2: rule__Table__RowsAssignment_0 { pushFollow(FOLLOW_19); rule__Table__RowsAssignment_0(); state._fsp--; } break; default : break loop35; } } while (true); after(grammarAccess.getTableAccess().getRowsAssignment_0()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__Group__0__Impl" // $ANTLR start "rule__Table__Group__1" // InternalCucumber.g:1859:1: rule__Table__Group__1 : rule__Table__Group__1__Impl ; public final void rule__Table__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1863:1: ( rule__Table__Group__1__Impl ) // InternalCucumber.g:1864:2: rule__Table__Group__1__Impl { pushFollow(FOLLOW_2); rule__Table__Group__1__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__Group__1" // $ANTLR start "rule__Table__Group__1__Impl" // InternalCucumber.g:1870:1: rule__Table__Group__1__Impl : ( ( RULE_EOL )* ) ; public final void rule__Table__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1874:1: ( ( ( RULE_EOL )* ) ) // InternalCucumber.g:1875:1: ( ( RULE_EOL )* ) { // InternalCucumber.g:1875:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1876:1: ( RULE_EOL )* { before(grammarAccess.getTableAccess().getEOLTerminalRuleCall_1()); // InternalCucumber.g:1877:1: ( RULE_EOL )* loop36: do { int alt36=2; int LA36_0 = input.LA(1); if ( (LA36_0==RULE_EOL) ) { alt36=1; } switch (alt36) { case 1 : // InternalCucumber.g:1877:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop36; } } while (true); after(grammarAccess.getTableAccess().getEOLTerminalRuleCall_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__Group__1__Impl" // $ANTLR start "rule__DocString__Group__0" // InternalCucumber.g:1891:1: rule__DocString__Group__0 : rule__DocString__Group__0__Impl rule__DocString__Group__1 ; public final void rule__DocString__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1895:1: ( rule__DocString__Group__0__Impl rule__DocString__Group__1 ) // InternalCucumber.g:1896:2: rule__DocString__Group__0__Impl rule__DocString__Group__1 { pushFollow(FOLLOW_8); rule__DocString__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__DocString__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__Group__0" // $ANTLR start "rule__DocString__Group__0__Impl" // InternalCucumber.g:1903:1: rule__DocString__Group__0__Impl : ( ( rule__DocString__ContentAssignment_0 ) ) ; public final void rule__DocString__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1907:1: ( ( ( rule__DocString__ContentAssignment_0 ) ) ) // InternalCucumber.g:1908:1: ( ( rule__DocString__ContentAssignment_0 ) ) { // InternalCucumber.g:1908:1: ( ( rule__DocString__ContentAssignment_0 ) ) // InternalCucumber.g:1909:1: ( rule__DocString__ContentAssignment_0 ) { before(grammarAccess.getDocStringAccess().getContentAssignment_0()); // InternalCucumber.g:1910:1: ( rule__DocString__ContentAssignment_0 ) // InternalCucumber.g:1910:2: rule__DocString__ContentAssignment_0 { pushFollow(FOLLOW_2); rule__DocString__ContentAssignment_0(); state._fsp--; } after(grammarAccess.getDocStringAccess().getContentAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__Group__0__Impl" // $ANTLR start "rule__DocString__Group__1" // InternalCucumber.g:1920:1: rule__DocString__Group__1 : rule__DocString__Group__1__Impl ; public final void rule__DocString__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1924:1: ( rule__DocString__Group__1__Impl ) // InternalCucumber.g:1925:2: rule__DocString__Group__1__Impl { pushFollow(FOLLOW_2); rule__DocString__Group__1__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__Group__1" // $ANTLR start "rule__DocString__Group__1__Impl" // InternalCucumber.g:1931:1: rule__DocString__Group__1__Impl : ( ( RULE_EOL )* ) ; public final void rule__DocString__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1935:1: ( ( ( RULE_EOL )* ) ) // InternalCucumber.g:1936:1: ( ( RULE_EOL )* ) { // InternalCucumber.g:1936:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1937:1: ( RULE_EOL )* { before(grammarAccess.getDocStringAccess().getEOLTerminalRuleCall_1()); // InternalCucumber.g:1938:1: ( RULE_EOL )* loop37: do { int alt37=2; int LA37_0 = input.LA(1); if ( (LA37_0==RULE_EOL) ) { alt37=1; } switch (alt37) { case 1 : // InternalCucumber.g:1938:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop37; } } while (true); after(grammarAccess.getDocStringAccess().getEOLTerminalRuleCall_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__Group__1__Impl" // $ANTLR start "rule__Title__Group__0" // InternalCucumber.g:1952:1: rule__Title__Group__0 : rule__Title__Group__0__Impl rule__Title__Group__1 ; public final void rule__Title__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1956:1: ( rule__Title__Group__0__Impl rule__Title__Group__1 ) // InternalCucumber.g:1957:2: rule__Title__Group__0__Impl rule__Title__Group__1 { pushFollow(FOLLOW_17); rule__Title__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Title__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Group__0" // $ANTLR start "rule__Title__Group__0__Impl" // InternalCucumber.g:1964:1: rule__Title__Group__0__Impl : ( ( rule__Title__Alternatives_0 ) ) ; public final void rule__Title__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1968:1: ( ( ( rule__Title__Alternatives_0 ) ) ) // InternalCucumber.g:1969:1: ( ( rule__Title__Alternatives_0 ) ) { // InternalCucumber.g:1969:1: ( ( rule__Title__Alternatives_0 ) ) // InternalCucumber.g:1970:1: ( rule__Title__Alternatives_0 ) { before(grammarAccess.getTitleAccess().getAlternatives_0()); // InternalCucumber.g:1971:1: ( rule__Title__Alternatives_0 ) // InternalCucumber.g:1971:2: rule__Title__Alternatives_0 { pushFollow(FOLLOW_2); rule__Title__Alternatives_0(); state._fsp--; } after(grammarAccess.getTitleAccess().getAlternatives_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Group__0__Impl" // $ANTLR start "rule__Title__Group__1" // InternalCucumber.g:1981:1: rule__Title__Group__1 : rule__Title__Group__1__Impl ; public final void rule__Title__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1985:1: ( rule__Title__Group__1__Impl ) // InternalCucumber.g:1986:2: rule__Title__Group__1__Impl { pushFollow(FOLLOW_2); rule__Title__Group__1__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Group__1" // $ANTLR start "rule__Title__Group__1__Impl" // InternalCucumber.g:1992:1: rule__Title__Group__1__Impl : ( ( rule__Title__Alternatives_1 )* ) ; public final void rule__Title__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1996:1: ( ( ( rule__Title__Alternatives_1 )* ) ) // InternalCucumber.g:1997:1: ( ( rule__Title__Alternatives_1 )* ) { // InternalCucumber.g:1997:1: ( ( rule__Title__Alternatives_1 )* ) // InternalCucumber.g:1998:1: ( rule__Title__Alternatives_1 )* { before(grammarAccess.getTitleAccess().getAlternatives_1()); // InternalCucumber.g:1999:1: ( rule__Title__Alternatives_1 )* loop38: do { int alt38=2; int LA38_0 = input.LA(1); if ( ((LA38_0>=RULE_WORD && LA38_0<=RULE_TAGNAME)) ) { alt38=1; } switch (alt38) { case 1 : // InternalCucumber.g:1999:2: rule__Title__Alternatives_1 { pushFollow(FOLLOW_4); rule__Title__Alternatives_1(); state._fsp--; } break; default : break loop38; } } while (true); after(grammarAccess.getTitleAccess().getAlternatives_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Group__1__Impl" // $ANTLR start "rule__Narrative__Group__0" // InternalCucumber.g:2013:1: rule__Narrative__Group__0 : rule__Narrative__Group__0__Impl rule__Narrative__Group__1 ; public final void rule__Narrative__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2017:1: ( rule__Narrative__Group__0__Impl rule__Narrative__Group__1 ) // InternalCucumber.g:2018:2: rule__Narrative__Group__0__Impl rule__Narrative__Group__1 { pushFollow(FOLLOW_21); rule__Narrative__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Narrative__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__0" // $ANTLR start "rule__Narrative__Group__0__Impl" // InternalCucumber.g:2025:1: rule__Narrative__Group__0__Impl : ( ( rule__Narrative__Alternatives_0 ) ) ; public final void rule__Narrative__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2029:1: ( ( ( rule__Narrative__Alternatives_0 ) ) ) // InternalCucumber.g:2030:1: ( ( rule__Narrative__Alternatives_0 ) ) { // InternalCucumber.g:2030:1: ( ( rule__Narrative__Alternatives_0 ) ) // InternalCucumber.g:2031:1: ( rule__Narrative__Alternatives_0 ) { before(grammarAccess.getNarrativeAccess().getAlternatives_0()); // InternalCucumber.g:2032:1: ( rule__Narrative__Alternatives_0 ) // InternalCucumber.g:2032:2: rule__Narrative__Alternatives_0 { pushFollow(FOLLOW_2); rule__Narrative__Alternatives_0(); state._fsp--; } after(grammarAccess.getNarrativeAccess().getAlternatives_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__0__Impl" // $ANTLR start "rule__Narrative__Group__1" // InternalCucumber.g:2042:1: rule__Narrative__Group__1 : rule__Narrative__Group__1__Impl rule__Narrative__Group__2 ; public final void rule__Narrative__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2046:1: ( rule__Narrative__Group__1__Impl rule__Narrative__Group__2 ) // InternalCucumber.g:2047:2: rule__Narrative__Group__1__Impl rule__Narrative__Group__2 { pushFollow(FOLLOW_21); rule__Narrative__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Narrative__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__1" // $ANTLR start "rule__Narrative__Group__1__Impl" // InternalCucumber.g:2054:1: rule__Narrative__Group__1__Impl : ( ( rule__Narrative__Alternatives_1 )* ) ; public final void rule__Narrative__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2058:1: ( ( ( rule__Narrative__Alternatives_1 )* ) ) // InternalCucumber.g:2059:1: ( ( rule__Narrative__Alternatives_1 )* ) { // InternalCucumber.g:2059:1: ( ( rule__Narrative__Alternatives_1 )* ) // InternalCucumber.g:2060:1: ( rule__Narrative__Alternatives_1 )* { before(grammarAccess.getNarrativeAccess().getAlternatives_1()); // InternalCucumber.g:2061:1: ( rule__Narrative__Alternatives_1 )* loop39: do { int alt39=2; int LA39_0 = input.LA(1); if ( ((LA39_0>=RULE_WORD && LA39_0<=RULE_TAGNAME)) ) { alt39=1; } switch (alt39) { case 1 : // InternalCucumber.g:2061:2: rule__Narrative__Alternatives_1 { pushFollow(FOLLOW_4); rule__Narrative__Alternatives_1(); state._fsp--; } break; default : break loop39; } } while (true); after(grammarAccess.getNarrativeAccess().getAlternatives_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__1__Impl" // $ANTLR start "rule__Narrative__Group__2" // InternalCucumber.g:2071:1: rule__Narrative__Group__2 : rule__Narrative__Group__2__Impl ; public final void rule__Narrative__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2075:1: ( rule__Narrative__Group__2__Impl ) // InternalCucumber.g:2076:2: rule__Narrative__Group__2__Impl { pushFollow(FOLLOW_2); rule__Narrative__Group__2__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__2" // $ANTLR start "rule__Narrative__Group__2__Impl" // InternalCucumber.g:2082:1: rule__Narrative__Group__2__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Narrative__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2086:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:2087:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:2087:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:2088:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:2088:1: ( ( RULE_EOL ) ) // InternalCucumber.g:2089:1: ( RULE_EOL ) { before(grammarAccess.getNarrativeAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:2090:1: ( RULE_EOL ) // InternalCucumber.g:2090:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getNarrativeAccess().getEOLTerminalRuleCall_2()); } // InternalCucumber.g:2093:1: ( ( RULE_EOL )* ) // InternalCucumber.g:2094:1: ( RULE_EOL )* { before(grammarAccess.getNarrativeAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:2095:1: ( RULE_EOL )* loop40: do { int alt40=2; int LA40_0 = input.LA(1); if ( (LA40_0==RULE_EOL) ) { alt40=1; } switch (alt40) { case 1 : // InternalCucumber.g:2095:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop40; } } while (true); after(grammarAccess.getNarrativeAccess().getEOLTerminalRuleCall_2()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__2__Impl" // $ANTLR start "rule__Tag__Group__0" // InternalCucumber.g:2112:1: rule__Tag__Group__0 : rule__Tag__Group__0__Impl rule__Tag__Group__1 ; public final void rule__Tag__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2116:1: ( rule__Tag__Group__0__Impl rule__Tag__Group__1 ) // InternalCucumber.g:2117:2: rule__Tag__Group__0__Impl rule__Tag__Group__1 { pushFollow(FOLLOW_8); rule__Tag__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Tag__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__Group__0" // $ANTLR start "rule__Tag__Group__0__Impl" // InternalCucumber.g:2124:1: rule__Tag__Group__0__Impl : ( ( rule__Tag__IdAssignment_0 ) ) ; public final void rule__Tag__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2128:1: ( ( ( rule__Tag__IdAssignment_0 ) ) ) // InternalCucumber.g:2129:1: ( ( rule__Tag__IdAssignment_0 ) ) { // InternalCucumber.g:2129:1: ( ( rule__Tag__IdAssignment_0 ) ) // InternalCucumber.g:2130:1: ( rule__Tag__IdAssignment_0 ) { before(grammarAccess.getTagAccess().getIdAssignment_0()); // InternalCucumber.g:2131:1: ( rule__Tag__IdAssignment_0 ) // InternalCucumber.g:2131:2: rule__Tag__IdAssignment_0 { pushFollow(FOLLOW_2); rule__Tag__IdAssignment_0(); state._fsp--; } after(grammarAccess.getTagAccess().getIdAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__Group__0__Impl" // $ANTLR start "rule__Tag__Group__1" // InternalCucumber.g:2141:1: rule__Tag__Group__1 : rule__Tag__Group__1__Impl ; public final void rule__Tag__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2145:1: ( rule__Tag__Group__1__Impl ) // InternalCucumber.g:2146:2: rule__Tag__Group__1__Impl { pushFollow(FOLLOW_2); rule__Tag__Group__1__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__Group__1" // $ANTLR start "rule__Tag__Group__1__Impl" // InternalCucumber.g:2152:1: rule__Tag__Group__1__Impl : ( ( RULE_EOL )? ) ; public final void rule__Tag__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2156:1: ( ( ( RULE_EOL )? ) ) // InternalCucumber.g:2157:1: ( ( RULE_EOL )? ) { // InternalCucumber.g:2157:1: ( ( RULE_EOL )? ) // InternalCucumber.g:2158:1: ( RULE_EOL )? { before(grammarAccess.getTagAccess().getEOLTerminalRuleCall_1()); // InternalCucumber.g:2159:1: ( RULE_EOL )? int alt41=2; int LA41_0 = input.LA(1); if ( (LA41_0==RULE_EOL) ) { alt41=1; } switch (alt41) { case 1 : // InternalCucumber.g:2159:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_2); } break; } after(grammarAccess.getTagAccess().getEOLTerminalRuleCall_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__Group__1__Impl" // $ANTLR start "rule__Feature__TagsAssignment_0" // InternalCucumber.g:2174:1: rule__Feature__TagsAssignment_0 : ( ruleTag ) ; public final void rule__Feature__TagsAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2178:1: ( ( ruleTag ) ) // InternalCucumber.g:2179:1: ( ruleTag ) { // InternalCucumber.g:2179:1: ( ruleTag ) // InternalCucumber.g:2180:1: ruleTag { before(grammarAccess.getFeatureAccess().getTagsTagParserRuleCall_0_0()); pushFollow(FOLLOW_2); ruleTag(); state._fsp--; after(grammarAccess.getFeatureAccess().getTagsTagParserRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__TagsAssignment_0" // $ANTLR start "rule__Feature__TitleAssignment_2" // InternalCucumber.g:2189:1: rule__Feature__TitleAssignment_2 : ( ruleTitle ) ; public final void rule__Feature__TitleAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2193:1: ( ( ruleTitle ) ) // InternalCucumber.g:2194:1: ( ruleTitle ) { // InternalCucumber.g:2194:1: ( ruleTitle ) // InternalCucumber.g:2195:1: ruleTitle { before(grammarAccess.getFeatureAccess().getTitleTitleParserRuleCall_2_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getFeatureAccess().getTitleTitleParserRuleCall_2_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__TitleAssignment_2" // $ANTLR start "rule__Feature__NarrativeAssignment_4" // InternalCucumber.g:2204:1: rule__Feature__NarrativeAssignment_4 : ( ruleNarrative ) ; public final void rule__Feature__NarrativeAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2208:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2209:1: ( ruleNarrative ) { // InternalCucumber.g:2209:1: ( ruleNarrative ) // InternalCucumber.g:2210:1: ruleNarrative { before(grammarAccess.getFeatureAccess().getNarrativeNarrativeParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getFeatureAccess().getNarrativeNarrativeParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__NarrativeAssignment_4" // $ANTLR start "rule__Feature__BackgroundAssignment_5" // InternalCucumber.g:2219:1: rule__Feature__BackgroundAssignment_5 : ( ruleBackground ) ; public final void rule__Feature__BackgroundAssignment_5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2223:1: ( ( ruleBackground ) ) // InternalCucumber.g:2224:1: ( ruleBackground ) { // InternalCucumber.g:2224:1: ( ruleBackground ) // InternalCucumber.g:2225:1: ruleBackground { before(grammarAccess.getFeatureAccess().getBackgroundBackgroundParserRuleCall_5_0()); pushFollow(FOLLOW_2); ruleBackground(); state._fsp--; after(grammarAccess.getFeatureAccess().getBackgroundBackgroundParserRuleCall_5_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__BackgroundAssignment_5" // $ANTLR start "rule__Feature__ScenariosAssignment_6" // InternalCucumber.g:2234:1: rule__Feature__ScenariosAssignment_6 : ( ( rule__Feature__ScenariosAlternatives_6_0 ) ) ; public final void rule__Feature__ScenariosAssignment_6() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2238:1: ( ( ( rule__Feature__ScenariosAlternatives_6_0 ) ) ) // InternalCucumber.g:2239:1: ( ( rule__Feature__ScenariosAlternatives_6_0 ) ) { // InternalCucumber.g:2239:1: ( ( rule__Feature__ScenariosAlternatives_6_0 ) ) // InternalCucumber.g:2240:1: ( rule__Feature__ScenariosAlternatives_6_0 ) { before(grammarAccess.getFeatureAccess().getScenariosAlternatives_6_0()); // InternalCucumber.g:2241:1: ( rule__Feature__ScenariosAlternatives_6_0 ) // InternalCucumber.g:2241:2: rule__Feature__ScenariosAlternatives_6_0 { pushFollow(FOLLOW_2); rule__Feature__ScenariosAlternatives_6_0(); state._fsp--; } after(grammarAccess.getFeatureAccess().getScenariosAlternatives_6_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__ScenariosAssignment_6" // $ANTLR start "rule__Background__TitleAssignment_1" // InternalCucumber.g:2250:1: rule__Background__TitleAssignment_1 : ( ruleTitle ) ; public final void rule__Background__TitleAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2254:1: ( ( ruleTitle ) ) // InternalCucumber.g:2255:1: ( ruleTitle ) { // InternalCucumber.g:2255:1: ( ruleTitle ) // InternalCucumber.g:2256:1: ruleTitle { before(grammarAccess.getBackgroundAccess().getTitleTitleParserRuleCall_1_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getBackgroundAccess().getTitleTitleParserRuleCall_1_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__TitleAssignment_1" // $ANTLR start "rule__Background__NarrativeAssignment_3" // InternalCucumber.g:2265:1: rule__Background__NarrativeAssignment_3 : ( ruleNarrative ) ; public final void rule__Background__NarrativeAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2269:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2270:1: ( ruleNarrative ) { // InternalCucumber.g:2270:1: ( ruleNarrative ) // InternalCucumber.g:2271:1: ruleNarrative { before(grammarAccess.getBackgroundAccess().getNarrativeNarrativeParserRuleCall_3_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getBackgroundAccess().getNarrativeNarrativeParserRuleCall_3_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__NarrativeAssignment_3" // $ANTLR start "rule__Background__StepsAssignment_4" // InternalCucumber.g:2280:1: rule__Background__StepsAssignment_4 : ( ruleStep ) ; public final void rule__Background__StepsAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2284:1: ( ( ruleStep ) ) // InternalCucumber.g:2285:1: ( ruleStep ) { // InternalCucumber.g:2285:1: ( ruleStep ) // InternalCucumber.g:2286:1: ruleStep { before(grammarAccess.getBackgroundAccess().getStepsStepParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleStep(); state._fsp--; after(grammarAccess.getBackgroundAccess().getStepsStepParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__StepsAssignment_4" // $ANTLR start "rule__Scenario__TagsAssignment_0" // InternalCucumber.g:2295:1: rule__Scenario__TagsAssignment_0 : ( ruleTag ) ; public final void rule__Scenario__TagsAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2299:1: ( ( ruleTag ) ) // InternalCucumber.g:2300:1: ( ruleTag ) { // InternalCucumber.g:2300:1: ( ruleTag ) // InternalCucumber.g:2301:1: ruleTag { before(grammarAccess.getScenarioAccess().getTagsTagParserRuleCall_0_0()); pushFollow(FOLLOW_2); ruleTag(); state._fsp--; after(grammarAccess.getScenarioAccess().getTagsTagParserRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__TagsAssignment_0" // $ANTLR start "rule__Scenario__TitleAssignment_2" // InternalCucumber.g:2310:1: rule__Scenario__TitleAssignment_2 : ( ruleTitle ) ; public final void rule__Scenario__TitleAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2314:1: ( ( ruleTitle ) ) // InternalCucumber.g:2315:1: ( ruleTitle ) { // InternalCucumber.g:2315:1: ( ruleTitle ) // InternalCucumber.g:2316:1: ruleTitle { before(grammarAccess.getScenarioAccess().getTitleTitleParserRuleCall_2_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getScenarioAccess().getTitleTitleParserRuleCall_2_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__TitleAssignment_2" // $ANTLR start "rule__Scenario__NarrativeAssignment_4" // InternalCucumber.g:2325:1: rule__Scenario__NarrativeAssignment_4 : ( ruleNarrative ) ; public final void rule__Scenario__NarrativeAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2329:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2330:1: ( ruleNarrative ) { // InternalCucumber.g:2330:1: ( ruleNarrative ) // InternalCucumber.g:2331:1: ruleNarrative { before(grammarAccess.getScenarioAccess().getNarrativeNarrativeParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getScenarioAccess().getNarrativeNarrativeParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__NarrativeAssignment_4" // $ANTLR start "rule__Scenario__StepsAssignment_5" // InternalCucumber.g:2340:1: rule__Scenario__StepsAssignment_5 : ( ruleStep ) ; public final void rule__Scenario__StepsAssignment_5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2344:1: ( ( ruleStep ) ) // InternalCucumber.g:2345:1: ( ruleStep ) { // InternalCucumber.g:2345:1: ( ruleStep ) // InternalCucumber.g:2346:1: ruleStep { before(grammarAccess.getScenarioAccess().getStepsStepParserRuleCall_5_0()); pushFollow(FOLLOW_2); ruleStep(); state._fsp--; after(grammarAccess.getScenarioAccess().getStepsStepParserRuleCall_5_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__StepsAssignment_5" // $ANTLR start "rule__ScenarioOutline__TagsAssignment_0" // InternalCucumber.g:2355:1: rule__ScenarioOutline__TagsAssignment_0 : ( ruleTag ) ; public final void rule__ScenarioOutline__TagsAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2359:1: ( ( ruleTag ) ) // InternalCucumber.g:2360:1: ( ruleTag ) { // InternalCucumber.g:2360:1: ( ruleTag ) // InternalCucumber.g:2361:1: ruleTag { before(grammarAccess.getScenarioOutlineAccess().getTagsTagParserRuleCall_0_0()); pushFollow(FOLLOW_2); ruleTag(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getTagsTagParserRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__TagsAssignment_0" // $ANTLR start "rule__ScenarioOutline__TitleAssignment_2" // InternalCucumber.g:2370:1: rule__ScenarioOutline__TitleAssignment_2 : ( ruleTitle ) ; public final void rule__ScenarioOutline__TitleAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2374:1: ( ( ruleTitle ) ) // InternalCucumber.g:2375:1: ( ruleTitle ) { // InternalCucumber.g:2375:1: ( ruleTitle ) // InternalCucumber.g:2376:1: ruleTitle { before(grammarAccess.getScenarioOutlineAccess().getTitleTitleParserRuleCall_2_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getTitleTitleParserRuleCall_2_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__TitleAssignment_2" // $ANTLR start "rule__ScenarioOutline__NarrativeAssignment_4" // InternalCucumber.g:2385:1: rule__ScenarioOutline__NarrativeAssignment_4 : ( ruleNarrative ) ; public final void rule__ScenarioOutline__NarrativeAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2389:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2390:1: ( ruleNarrative ) { // InternalCucumber.g:2390:1: ( ruleNarrative ) // InternalCucumber.g:2391:1: ruleNarrative { before(grammarAccess.getScenarioOutlineAccess().getNarrativeNarrativeParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getNarrativeNarrativeParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__NarrativeAssignment_4" // $ANTLR start "rule__ScenarioOutline__StepsAssignment_5" // InternalCucumber.g:2400:1: rule__ScenarioOutline__StepsAssignment_5 : ( ruleStep ) ; public final void rule__ScenarioOutline__StepsAssignment_5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2404:1: ( ( ruleStep ) ) // InternalCucumber.g:2405:1: ( ruleStep ) { // InternalCucumber.g:2405:1: ( ruleStep ) // InternalCucumber.g:2406:1: ruleStep { before(grammarAccess.getScenarioOutlineAccess().getStepsStepParserRuleCall_5_0()); pushFollow(FOLLOW_2); ruleStep(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getStepsStepParserRuleCall_5_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__StepsAssignment_5" // $ANTLR start "rule__ScenarioOutline__ExamplesAssignment_6" // InternalCucumber.g:2415:1: rule__ScenarioOutline__ExamplesAssignment_6 : ( ruleExamples ) ; public final void rule__ScenarioOutline__ExamplesAssignment_6() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2419:1: ( ( ruleExamples ) ) // InternalCucumber.g:2420:1: ( ruleExamples ) { // InternalCucumber.g:2420:1: ( ruleExamples ) // InternalCucumber.g:2421:1: ruleExamples { before(grammarAccess.getScenarioOutlineAccess().getExamplesExamplesParserRuleCall_6_0()); pushFollow(FOLLOW_2); ruleExamples(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getExamplesExamplesParserRuleCall_6_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__ExamplesAssignment_6" // $ANTLR start "rule__Step__DescriptionAssignment_1" // InternalCucumber.g:2430:1: rule__Step__DescriptionAssignment_1 : ( ruleStepDescription ) ; public final void rule__Step__DescriptionAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2434:1: ( ( ruleStepDescription ) ) // InternalCucumber.g:2435:1: ( ruleStepDescription ) { // InternalCucumber.g:2435:1: ( ruleStepDescription ) // InternalCucumber.g:2436:1: ruleStepDescription { before(grammarAccess.getStepAccess().getDescriptionStepDescriptionParserRuleCall_1_0()); pushFollow(FOLLOW_2); ruleStepDescription(); state._fsp--; after(grammarAccess.getStepAccess().getDescriptionStepDescriptionParserRuleCall_1_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__DescriptionAssignment_1" // $ANTLR start "rule__Step__TablesAssignment_3" // InternalCucumber.g:2445:1: rule__Step__TablesAssignment_3 : ( ruleTable ) ; public final void rule__Step__TablesAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2449:1: ( ( ruleTable ) ) // InternalCucumber.g:2450:1: ( ruleTable ) { // InternalCucumber.g:2450:1: ( ruleTable ) // InternalCucumber.g:2451:1: ruleTable { before(grammarAccess.getStepAccess().getTablesTableParserRuleCall_3_0()); pushFollow(FOLLOW_2); ruleTable(); state._fsp--; after(grammarAccess.getStepAccess().getTablesTableParserRuleCall_3_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__TablesAssignment_3" // $ANTLR start "rule__Step__CodeAssignment_4" // InternalCucumber.g:2460:1: rule__Step__CodeAssignment_4 : ( ruleDocString ) ; public final void rule__Step__CodeAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2464:1: ( ( ruleDocString ) ) // InternalCucumber.g:2465:1: ( ruleDocString ) { // InternalCucumber.g:2465:1: ( ruleDocString ) // InternalCucumber.g:2466:1: ruleDocString { before(grammarAccess.getStepAccess().getCodeDocStringParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleDocString(); state._fsp--; after(grammarAccess.getStepAccess().getCodeDocStringParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__CodeAssignment_4" // $ANTLR start "rule__Step__TablesAssignment_5" // InternalCucumber.g:2475:1: rule__Step__TablesAssignment_5 : ( ruleTable ) ; public final void rule__Step__TablesAssignment_5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2479:1: ( ( ruleTable ) ) // InternalCucumber.g:2480:1: ( ruleTable ) { // InternalCucumber.g:2480:1: ( ruleTable ) // InternalCucumber.g:2481:1: ruleTable { before(grammarAccess.getStepAccess().getTablesTableParserRuleCall_5_0()); pushFollow(FOLLOW_2); ruleTable(); state._fsp--; after(grammarAccess.getStepAccess().getTablesTableParserRuleCall_5_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__TablesAssignment_5" // $ANTLR start "rule__Examples__TitleAssignment_1" // InternalCucumber.g:2490:1: rule__Examples__TitleAssignment_1 : ( ruleTitle ) ; public final void rule__Examples__TitleAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2494:1: ( ( ruleTitle ) ) // InternalCucumber.g:2495:1: ( ruleTitle ) { // InternalCucumber.g:2495:1: ( ruleTitle ) // InternalCucumber.g:2496:1: ruleTitle { before(grammarAccess.getExamplesAccess().getTitleTitleParserRuleCall_1_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getExamplesAccess().getTitleTitleParserRuleCall_1_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__TitleAssignment_1" // $ANTLR start "rule__Examples__NarrativeAssignment_3" // InternalCucumber.g:2505:1: rule__Examples__NarrativeAssignment_3 : ( ruleNarrative ) ; public final void rule__Examples__NarrativeAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2509:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2510:1: ( ruleNarrative ) { // InternalCucumber.g:2510:1: ( ruleNarrative ) // InternalCucumber.g:2511:1: ruleNarrative { before(grammarAccess.getExamplesAccess().getNarrativeNarrativeParserRuleCall_3_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getExamplesAccess().getNarrativeNarrativeParserRuleCall_3_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__NarrativeAssignment_3" // $ANTLR start "rule__Examples__TableAssignment_4" // InternalCucumber.g:2520:1: rule__Examples__TableAssignment_4 : ( ruleTable ) ; public final void rule__Examples__TableAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2524:1: ( ( ruleTable ) ) // InternalCucumber.g:2525:1: ( ruleTable ) { // InternalCucumber.g:2525:1: ( ruleTable ) // InternalCucumber.g:2526:1: ruleTable { before(grammarAccess.getExamplesAccess().getTableTableParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleTable(); state._fsp--; after(grammarAccess.getExamplesAccess().getTableTableParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__TableAssignment_4" // $ANTLR start "rule__Table__RowsAssignment_0" // InternalCucumber.g:2535:1: rule__Table__RowsAssignment_0 : ( RULE_TABLE_ROW ) ; public final void rule__Table__RowsAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2539:1: ( ( RULE_TABLE_ROW ) ) // InternalCucumber.g:2540:1: ( RULE_TABLE_ROW ) { // InternalCucumber.g:2540:1: ( RULE_TABLE_ROW ) // InternalCucumber.g:2541:1: RULE_TABLE_ROW { before(grammarAccess.getTableAccess().getRowsTABLE_ROWTerminalRuleCall_0_0()); match(input,RULE_TABLE_ROW,FOLLOW_2); after(grammarAccess.getTableAccess().getRowsTABLE_ROWTerminalRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__RowsAssignment_0" // $ANTLR start "rule__DocString__ContentAssignment_0" // InternalCucumber.g:2550:1: rule__DocString__ContentAssignment_0 : ( RULE_DOC_STRING ) ; public final void rule__DocString__ContentAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2554:1: ( ( RULE_DOC_STRING ) ) // InternalCucumber.g:2555:1: ( RULE_DOC_STRING ) { // InternalCucumber.g:2555:1: ( RULE_DOC_STRING ) // InternalCucumber.g:2556:1: RULE_DOC_STRING { before(grammarAccess.getDocStringAccess().getContentDOC_STRINGTerminalRuleCall_0_0()); match(input,RULE_DOC_STRING,FOLLOW_2); after(grammarAccess.getDocStringAccess().getContentDOC_STRINGTerminalRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__ContentAssignment_0" // $ANTLR start "rule__Tag__IdAssignment_0" // InternalCucumber.g:2565:1: rule__Tag__IdAssignment_0 : ( RULE_TAGNAME ) ; public final void rule__Tag__IdAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2569:1: ( ( RULE_TAGNAME ) ) // InternalCucumber.g:2570:1: ( RULE_TAGNAME ) { // InternalCucumber.g:2570:1: ( RULE_TAGNAME ) // InternalCucumber.g:2571:1: RULE_TAGNAME { before(grammarAccess.getTagAccess().getIdTAGNAMETerminalRuleCall_0_0()); match(input,RULE_TAGNAME,FOLLOW_2); after(grammarAccess.getTagAccess().getIdTAGNAMETerminalRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__IdAssignment_0" // Delegated rules protected DFA2 dfa2 = new DFA2(this); protected DFA3 dfa3 = new DFA3(this); static final String dfa_1s = "\12\uffff"; static final String dfa_2s = "\1\1\1\uffff\1\11\7\uffff"; static final String dfa_3s = "\1\4\1\uffff\1\4\7\uffff"; static final String dfa_4s = "\1\24\1\uffff\1\24\7\uffff"; static final String dfa_5s = "\1\uffff\1\2\1\uffff\7\1"; static final String dfa_6s = "\12\uffff}>"; static final String[] dfa_7s = { "\4\3\1\2\1\3\3\1\5\uffff\3\1", "", "\1\4\1\5\1\6\1\7\1\10\4\11\5\uffff\3\11", "", "", "", "", "", "", "" }; static final short[] dfa_1 = DFA.unpackEncodedString(dfa_1s); static final short[] dfa_2 = DFA.unpackEncodedString(dfa_2s); static final char[] dfa_3 = DFA.unpackEncodedStringToUnsignedChars(dfa_3s); static final char[] dfa_4 = DFA.unpackEncodedStringToUnsignedChars(dfa_4s); static final short[] dfa_5 = DFA.unpackEncodedString(dfa_5s); static final short[] dfa_6 = DFA.unpackEncodedString(dfa_6s); static final short[][] dfa_7 = unpackEncodedStringArray(dfa_7s); class DFA2 extends DFA { public DFA2(BaseRecognizer recognizer) { this.recognizer = recognizer; this.decisionNumber = 2; this.eot = dfa_1; this.eof = dfa_2; this.min = dfa_3; this.max = dfa_4; this.accept = dfa_5; this.special = dfa_6; this.transition = dfa_7; } public String getDescription() { return "()* loopback of 369:1: ( rule__StepDescription__Alternatives )*"; } } static final String dfa_8s = "\5\uffff"; static final String dfa_9s = "\2\11\2\uffff\1\11"; static final String dfa_10s = "\2\23\2\uffff\1\23"; static final String dfa_11s = "\2\uffff\1\1\1\2\1\uffff"; static final String dfa_12s = "\5\uffff}>"; static final String[] dfa_13s = { "\1\1\10\uffff\1\2\1\3", "\1\1\1\4\7\uffff\1\2\1\3", "", "", "\1\1\10\uffff\1\2\1\3" }; static final short[] dfa_8 = DFA.unpackEncodedString(dfa_8s); static final char[] dfa_9 = DFA.unpackEncodedStringToUnsignedChars(dfa_9s); static final char[] dfa_10 = DFA.unpackEncodedStringToUnsignedChars(dfa_10s); static final short[] dfa_11 = DFA.unpackEncodedString(dfa_11s); static final short[] dfa_12 = DFA.unpackEncodedString(dfa_12s); static final short[][] dfa_13 = unpackEncodedStringArray(dfa_13s); class DFA3 extends DFA { public DFA3(BaseRecognizer recognizer) { this.recognizer = recognizer; this.decisionNumber = 3; this.eot = dfa_8; this.eof = dfa_8; this.min = dfa_9; this.max = dfa_10; this.accept = dfa_11; this.special = dfa_12; this.transition = dfa_13; } public String getDescription() { return "410:1: rule__Feature__ScenariosAlternatives_6_0 : ( ( ruleScenario ) | ( ruleScenarioOutline ) );"; } } public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L}); public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L}); public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x00000000000000F2L}); public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x00000000000003F2L}); public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000010000L}); public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000000202L}); public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x00000000000000F0L}); public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000000400L}); public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x00000000000E02F0L}); public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000000000000402L}); public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x00000000000E02F2L}); public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x00000000000004F0L}); public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x00000000000001F0L}); public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x00000000000001F2L}); public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000040200L}); public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000000000100000L}); public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x00000000000003F0L}); public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000000001C00L}); public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000000000802L}); public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x00000000000008F0L}); public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x00000000000007F0L}); }
UTF-8
Java
225,051
java
InternalCucumberParser.java
Java
[]
null
[]
package org.agileware.natural.cucumber.ui.contentassist.antlr.internal; import java.io.InputStream; import org.eclipse.xtext.*; import org.eclipse.xtext.parser.*; import org.eclipse.xtext.parser.impl.*; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.parser.antlr.XtextTokenStream; import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; import org.agileware.natural.cucumber.services.CucumberGrammarAccess; import org.antlr.runtime.*; import java.util.Stack; import java.util.List; import java.util.ArrayList; @SuppressWarnings("all") public class InternalCucumberParser extends AbstractInternalContentAssistParser { public static final String[] tokenNames = new String[] { "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_WORD", "RULE_INT", "RULE_STRING", "RULE_PLACEHOLDER", "RULE_STEP_KEYWORD", "RULE_TAGNAME", "RULE_EOL", "RULE_TABLE_ROW", "RULE_DOC_STRING", "RULE_NL", "RULE_SL_COMMENT", "RULE_WS", "'Feature:'", "'Background:'", "'Scenario:'", "'Scenario Outline:'", "'Examples:'" }; public static final int RULE_DOC_STRING=12; public static final int RULE_WORD=4; public static final int RULE_STRING=6; public static final int RULE_SL_COMMENT=14; public static final int T__19=19; public static final int T__16=16; public static final int T__17=17; public static final int T__18=18; public static final int EOF=-1; public static final int RULE_EOL=10; public static final int RULE_WS=15; public static final int RULE_TAGNAME=9; public static final int RULE_PLACEHOLDER=7; public static final int RULE_TABLE_ROW=11; public static final int RULE_INT=5; public static final int RULE_STEP_KEYWORD=8; public static final int RULE_NL=13; public static final int T__20=20; // delegates // delegators public InternalCucumberParser(TokenStream input) { this(input, new RecognizerSharedState()); } public InternalCucumberParser(TokenStream input, RecognizerSharedState state) { super(input, state); } public String[] getTokenNames() { return InternalCucumberParser.tokenNames; } public String getGrammarFileName() { return "InternalCucumber.g"; } private CucumberGrammarAccess grammarAccess; public void setGrammarAccess(CucumberGrammarAccess grammarAccess) { this.grammarAccess = grammarAccess; } @Override protected Grammar getGrammar() { return grammarAccess.getGrammar(); } @Override protected String getValueForTokenName(String tokenName) { return tokenName; } // $ANTLR start "entryRuleFeature" // InternalCucumber.g:60:1: entryRuleFeature : ruleFeature EOF ; public final void entryRuleFeature() throws RecognitionException { try { // InternalCucumber.g:61:1: ( ruleFeature EOF ) // InternalCucumber.g:62:1: ruleFeature EOF { before(grammarAccess.getFeatureRule()); pushFollow(FOLLOW_1); ruleFeature(); state._fsp--; after(grammarAccess.getFeatureRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleFeature" // $ANTLR start "ruleFeature" // InternalCucumber.g:69:1: ruleFeature : ( ( rule__Feature__Group__0 ) ) ; public final void ruleFeature() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:73:2: ( ( ( rule__Feature__Group__0 ) ) ) // InternalCucumber.g:74:1: ( ( rule__Feature__Group__0 ) ) { // InternalCucumber.g:74:1: ( ( rule__Feature__Group__0 ) ) // InternalCucumber.g:75:1: ( rule__Feature__Group__0 ) { before(grammarAccess.getFeatureAccess().getGroup()); // InternalCucumber.g:76:1: ( rule__Feature__Group__0 ) // InternalCucumber.g:76:2: rule__Feature__Group__0 { pushFollow(FOLLOW_2); rule__Feature__Group__0(); state._fsp--; } after(grammarAccess.getFeatureAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleFeature" // $ANTLR start "entryRuleBackground" // InternalCucumber.g:88:1: entryRuleBackground : ruleBackground EOF ; public final void entryRuleBackground() throws RecognitionException { try { // InternalCucumber.g:89:1: ( ruleBackground EOF ) // InternalCucumber.g:90:1: ruleBackground EOF { before(grammarAccess.getBackgroundRule()); pushFollow(FOLLOW_1); ruleBackground(); state._fsp--; after(grammarAccess.getBackgroundRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleBackground" // $ANTLR start "ruleBackground" // InternalCucumber.g:97:1: ruleBackground : ( ( rule__Background__Group__0 ) ) ; public final void ruleBackground() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:101:2: ( ( ( rule__Background__Group__0 ) ) ) // InternalCucumber.g:102:1: ( ( rule__Background__Group__0 ) ) { // InternalCucumber.g:102:1: ( ( rule__Background__Group__0 ) ) // InternalCucumber.g:103:1: ( rule__Background__Group__0 ) { before(grammarAccess.getBackgroundAccess().getGroup()); // InternalCucumber.g:104:1: ( rule__Background__Group__0 ) // InternalCucumber.g:104:2: rule__Background__Group__0 { pushFollow(FOLLOW_2); rule__Background__Group__0(); state._fsp--; } after(grammarAccess.getBackgroundAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleBackground" // $ANTLR start "entryRuleScenario" // InternalCucumber.g:116:1: entryRuleScenario : ruleScenario EOF ; public final void entryRuleScenario() throws RecognitionException { try { // InternalCucumber.g:117:1: ( ruleScenario EOF ) // InternalCucumber.g:118:1: ruleScenario EOF { before(grammarAccess.getScenarioRule()); pushFollow(FOLLOW_1); ruleScenario(); state._fsp--; after(grammarAccess.getScenarioRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleScenario" // $ANTLR start "ruleScenario" // InternalCucumber.g:125:1: ruleScenario : ( ( rule__Scenario__Group__0 ) ) ; public final void ruleScenario() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:129:2: ( ( ( rule__Scenario__Group__0 ) ) ) // InternalCucumber.g:130:1: ( ( rule__Scenario__Group__0 ) ) { // InternalCucumber.g:130:1: ( ( rule__Scenario__Group__0 ) ) // InternalCucumber.g:131:1: ( rule__Scenario__Group__0 ) { before(grammarAccess.getScenarioAccess().getGroup()); // InternalCucumber.g:132:1: ( rule__Scenario__Group__0 ) // InternalCucumber.g:132:2: rule__Scenario__Group__0 { pushFollow(FOLLOW_2); rule__Scenario__Group__0(); state._fsp--; } after(grammarAccess.getScenarioAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleScenario" // $ANTLR start "entryRuleScenarioOutline" // InternalCucumber.g:144:1: entryRuleScenarioOutline : ruleScenarioOutline EOF ; public final void entryRuleScenarioOutline() throws RecognitionException { try { // InternalCucumber.g:145:1: ( ruleScenarioOutline EOF ) // InternalCucumber.g:146:1: ruleScenarioOutline EOF { before(grammarAccess.getScenarioOutlineRule()); pushFollow(FOLLOW_1); ruleScenarioOutline(); state._fsp--; after(grammarAccess.getScenarioOutlineRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleScenarioOutline" // $ANTLR start "ruleScenarioOutline" // InternalCucumber.g:153:1: ruleScenarioOutline : ( ( rule__ScenarioOutline__Group__0 ) ) ; public final void ruleScenarioOutline() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:157:2: ( ( ( rule__ScenarioOutline__Group__0 ) ) ) // InternalCucumber.g:158:1: ( ( rule__ScenarioOutline__Group__0 ) ) { // InternalCucumber.g:158:1: ( ( rule__ScenarioOutline__Group__0 ) ) // InternalCucumber.g:159:1: ( rule__ScenarioOutline__Group__0 ) { before(grammarAccess.getScenarioOutlineAccess().getGroup()); // InternalCucumber.g:160:1: ( rule__ScenarioOutline__Group__0 ) // InternalCucumber.g:160:2: rule__ScenarioOutline__Group__0 { pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__0(); state._fsp--; } after(grammarAccess.getScenarioOutlineAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleScenarioOutline" // $ANTLR start "entryRuleStep" // InternalCucumber.g:172:1: entryRuleStep : ruleStep EOF ; public final void entryRuleStep() throws RecognitionException { try { // InternalCucumber.g:173:1: ( ruleStep EOF ) // InternalCucumber.g:174:1: ruleStep EOF { before(grammarAccess.getStepRule()); pushFollow(FOLLOW_1); ruleStep(); state._fsp--; after(grammarAccess.getStepRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleStep" // $ANTLR start "ruleStep" // InternalCucumber.g:181:1: ruleStep : ( ( rule__Step__Group__0 ) ) ; public final void ruleStep() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:185:2: ( ( ( rule__Step__Group__0 ) ) ) // InternalCucumber.g:186:1: ( ( rule__Step__Group__0 ) ) { // InternalCucumber.g:186:1: ( ( rule__Step__Group__0 ) ) // InternalCucumber.g:187:1: ( rule__Step__Group__0 ) { before(grammarAccess.getStepAccess().getGroup()); // InternalCucumber.g:188:1: ( rule__Step__Group__0 ) // InternalCucumber.g:188:2: rule__Step__Group__0 { pushFollow(FOLLOW_2); rule__Step__Group__0(); state._fsp--; } after(grammarAccess.getStepAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleStep" // $ANTLR start "entryRuleExamples" // InternalCucumber.g:200:1: entryRuleExamples : ruleExamples EOF ; public final void entryRuleExamples() throws RecognitionException { try { // InternalCucumber.g:201:1: ( ruleExamples EOF ) // InternalCucumber.g:202:1: ruleExamples EOF { before(grammarAccess.getExamplesRule()); pushFollow(FOLLOW_1); ruleExamples(); state._fsp--; after(grammarAccess.getExamplesRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleExamples" // $ANTLR start "ruleExamples" // InternalCucumber.g:209:1: ruleExamples : ( ( rule__Examples__Group__0 ) ) ; public final void ruleExamples() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:213:2: ( ( ( rule__Examples__Group__0 ) ) ) // InternalCucumber.g:214:1: ( ( rule__Examples__Group__0 ) ) { // InternalCucumber.g:214:1: ( ( rule__Examples__Group__0 ) ) // InternalCucumber.g:215:1: ( rule__Examples__Group__0 ) { before(grammarAccess.getExamplesAccess().getGroup()); // InternalCucumber.g:216:1: ( rule__Examples__Group__0 ) // InternalCucumber.g:216:2: rule__Examples__Group__0 { pushFollow(FOLLOW_2); rule__Examples__Group__0(); state._fsp--; } after(grammarAccess.getExamplesAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleExamples" // $ANTLR start "entryRuleTable" // InternalCucumber.g:228:1: entryRuleTable : ruleTable EOF ; public final void entryRuleTable() throws RecognitionException { try { // InternalCucumber.g:229:1: ( ruleTable EOF ) // InternalCucumber.g:230:1: ruleTable EOF { before(grammarAccess.getTableRule()); pushFollow(FOLLOW_1); ruleTable(); state._fsp--; after(grammarAccess.getTableRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleTable" // $ANTLR start "ruleTable" // InternalCucumber.g:237:1: ruleTable : ( ( rule__Table__Group__0 ) ) ; public final void ruleTable() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:241:2: ( ( ( rule__Table__Group__0 ) ) ) // InternalCucumber.g:242:1: ( ( rule__Table__Group__0 ) ) { // InternalCucumber.g:242:1: ( ( rule__Table__Group__0 ) ) // InternalCucumber.g:243:1: ( rule__Table__Group__0 ) { before(grammarAccess.getTableAccess().getGroup()); // InternalCucumber.g:244:1: ( rule__Table__Group__0 ) // InternalCucumber.g:244:2: rule__Table__Group__0 { pushFollow(FOLLOW_2); rule__Table__Group__0(); state._fsp--; } after(grammarAccess.getTableAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleTable" // $ANTLR start "entryRuleDocString" // InternalCucumber.g:256:1: entryRuleDocString : ruleDocString EOF ; public final void entryRuleDocString() throws RecognitionException { try { // InternalCucumber.g:257:1: ( ruleDocString EOF ) // InternalCucumber.g:258:1: ruleDocString EOF { before(grammarAccess.getDocStringRule()); pushFollow(FOLLOW_1); ruleDocString(); state._fsp--; after(grammarAccess.getDocStringRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleDocString" // $ANTLR start "ruleDocString" // InternalCucumber.g:265:1: ruleDocString : ( ( rule__DocString__Group__0 ) ) ; public final void ruleDocString() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:269:2: ( ( ( rule__DocString__Group__0 ) ) ) // InternalCucumber.g:270:1: ( ( rule__DocString__Group__0 ) ) { // InternalCucumber.g:270:1: ( ( rule__DocString__Group__0 ) ) // InternalCucumber.g:271:1: ( rule__DocString__Group__0 ) { before(grammarAccess.getDocStringAccess().getGroup()); // InternalCucumber.g:272:1: ( rule__DocString__Group__0 ) // InternalCucumber.g:272:2: rule__DocString__Group__0 { pushFollow(FOLLOW_2); rule__DocString__Group__0(); state._fsp--; } after(grammarAccess.getDocStringAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleDocString" // $ANTLR start "entryRuleTitle" // InternalCucumber.g:284:1: entryRuleTitle : ruleTitle EOF ; public final void entryRuleTitle() throws RecognitionException { try { // InternalCucumber.g:285:1: ( ruleTitle EOF ) // InternalCucumber.g:286:1: ruleTitle EOF { before(grammarAccess.getTitleRule()); pushFollow(FOLLOW_1); ruleTitle(); state._fsp--; after(grammarAccess.getTitleRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleTitle" // $ANTLR start "ruleTitle" // InternalCucumber.g:293:1: ruleTitle : ( ( rule__Title__Group__0 ) ) ; public final void ruleTitle() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:297:2: ( ( ( rule__Title__Group__0 ) ) ) // InternalCucumber.g:298:1: ( ( rule__Title__Group__0 ) ) { // InternalCucumber.g:298:1: ( ( rule__Title__Group__0 ) ) // InternalCucumber.g:299:1: ( rule__Title__Group__0 ) { before(grammarAccess.getTitleAccess().getGroup()); // InternalCucumber.g:300:1: ( rule__Title__Group__0 ) // InternalCucumber.g:300:2: rule__Title__Group__0 { pushFollow(FOLLOW_2); rule__Title__Group__0(); state._fsp--; } after(grammarAccess.getTitleAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleTitle" // $ANTLR start "entryRuleNarrative" // InternalCucumber.g:312:1: entryRuleNarrative : ruleNarrative EOF ; public final void entryRuleNarrative() throws RecognitionException { try { // InternalCucumber.g:313:1: ( ruleNarrative EOF ) // InternalCucumber.g:314:1: ruleNarrative EOF { before(grammarAccess.getNarrativeRule()); pushFollow(FOLLOW_1); ruleNarrative(); state._fsp--; after(grammarAccess.getNarrativeRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleNarrative" // $ANTLR start "ruleNarrative" // InternalCucumber.g:321:1: ruleNarrative : ( ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) ) ; public final void ruleNarrative() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:325:2: ( ( ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) ) ) // InternalCucumber.g:326:1: ( ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) ) { // InternalCucumber.g:326:1: ( ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) ) // InternalCucumber.g:327:1: ( ( rule__Narrative__Group__0 ) ) ( ( rule__Narrative__Group__0 )* ) { // InternalCucumber.g:327:1: ( ( rule__Narrative__Group__0 ) ) // InternalCucumber.g:328:1: ( rule__Narrative__Group__0 ) { before(grammarAccess.getNarrativeAccess().getGroup()); // InternalCucumber.g:329:1: ( rule__Narrative__Group__0 ) // InternalCucumber.g:329:2: rule__Narrative__Group__0 { pushFollow(FOLLOW_3); rule__Narrative__Group__0(); state._fsp--; } after(grammarAccess.getNarrativeAccess().getGroup()); } // InternalCucumber.g:332:1: ( ( rule__Narrative__Group__0 )* ) // InternalCucumber.g:333:1: ( rule__Narrative__Group__0 )* { before(grammarAccess.getNarrativeAccess().getGroup()); // InternalCucumber.g:334:1: ( rule__Narrative__Group__0 )* loop1: do { int alt1=2; int LA1_0 = input.LA(1); if ( ((LA1_0>=RULE_WORD && LA1_0<=RULE_PLACEHOLDER)) ) { alt1=1; } switch (alt1) { case 1 : // InternalCucumber.g:334:2: rule__Narrative__Group__0 { pushFollow(FOLLOW_3); rule__Narrative__Group__0(); state._fsp--; } break; default : break loop1; } } while (true); after(grammarAccess.getNarrativeAccess().getGroup()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleNarrative" // $ANTLR start "entryRuleStepDescription" // InternalCucumber.g:347:1: entryRuleStepDescription : ruleStepDescription EOF ; public final void entryRuleStepDescription() throws RecognitionException { try { // InternalCucumber.g:348:1: ( ruleStepDescription EOF ) // InternalCucumber.g:349:1: ruleStepDescription EOF { before(grammarAccess.getStepDescriptionRule()); pushFollow(FOLLOW_1); ruleStepDescription(); state._fsp--; after(grammarAccess.getStepDescriptionRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleStepDescription" // $ANTLR start "ruleStepDescription" // InternalCucumber.g:356:1: ruleStepDescription : ( ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) ) ; public final void ruleStepDescription() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:360:2: ( ( ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) ) ) // InternalCucumber.g:361:1: ( ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) ) { // InternalCucumber.g:361:1: ( ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) ) // InternalCucumber.g:362:1: ( ( rule__StepDescription__Alternatives ) ) ( ( rule__StepDescription__Alternatives )* ) { // InternalCucumber.g:362:1: ( ( rule__StepDescription__Alternatives ) ) // InternalCucumber.g:363:1: ( rule__StepDescription__Alternatives ) { before(grammarAccess.getStepDescriptionAccess().getAlternatives()); // InternalCucumber.g:364:1: ( rule__StepDescription__Alternatives ) // InternalCucumber.g:364:2: rule__StepDescription__Alternatives { pushFollow(FOLLOW_4); rule__StepDescription__Alternatives(); state._fsp--; } after(grammarAccess.getStepDescriptionAccess().getAlternatives()); } // InternalCucumber.g:367:1: ( ( rule__StepDescription__Alternatives )* ) // InternalCucumber.g:368:1: ( rule__StepDescription__Alternatives )* { before(grammarAccess.getStepDescriptionAccess().getAlternatives()); // InternalCucumber.g:369:1: ( rule__StepDescription__Alternatives )* loop2: do { int alt2=2; alt2 = dfa2.predict(input); switch (alt2) { case 1 : // InternalCucumber.g:369:2: rule__StepDescription__Alternatives { pushFollow(FOLLOW_4); rule__StepDescription__Alternatives(); state._fsp--; } break; default : break loop2; } } while (true); after(grammarAccess.getStepDescriptionAccess().getAlternatives()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleStepDescription" // $ANTLR start "entryRuleTag" // InternalCucumber.g:382:1: entryRuleTag : ruleTag EOF ; public final void entryRuleTag() throws RecognitionException { try { // InternalCucumber.g:383:1: ( ruleTag EOF ) // InternalCucumber.g:384:1: ruleTag EOF { before(grammarAccess.getTagRule()); pushFollow(FOLLOW_1); ruleTag(); state._fsp--; after(grammarAccess.getTagRule()); match(input,EOF,FOLLOW_2); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; } // $ANTLR end "entryRuleTag" // $ANTLR start "ruleTag" // InternalCucumber.g:391:1: ruleTag : ( ( rule__Tag__Group__0 ) ) ; public final void ruleTag() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:395:2: ( ( ( rule__Tag__Group__0 ) ) ) // InternalCucumber.g:396:1: ( ( rule__Tag__Group__0 ) ) { // InternalCucumber.g:396:1: ( ( rule__Tag__Group__0 ) ) // InternalCucumber.g:397:1: ( rule__Tag__Group__0 ) { before(grammarAccess.getTagAccess().getGroup()); // InternalCucumber.g:398:1: ( rule__Tag__Group__0 ) // InternalCucumber.g:398:2: rule__Tag__Group__0 { pushFollow(FOLLOW_2); rule__Tag__Group__0(); state._fsp--; } after(grammarAccess.getTagAccess().getGroup()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "ruleTag" // $ANTLR start "rule__Feature__ScenariosAlternatives_6_0" // InternalCucumber.g:410:1: rule__Feature__ScenariosAlternatives_6_0 : ( ( ruleScenario ) | ( ruleScenarioOutline ) ); public final void rule__Feature__ScenariosAlternatives_6_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:414:1: ( ( ruleScenario ) | ( ruleScenarioOutline ) ) int alt3=2; alt3 = dfa3.predict(input); switch (alt3) { case 1 : // InternalCucumber.g:415:1: ( ruleScenario ) { // InternalCucumber.g:415:1: ( ruleScenario ) // InternalCucumber.g:416:1: ruleScenario { before(grammarAccess.getFeatureAccess().getScenariosScenarioParserRuleCall_6_0_0()); pushFollow(FOLLOW_2); ruleScenario(); state._fsp--; after(grammarAccess.getFeatureAccess().getScenariosScenarioParserRuleCall_6_0_0()); } } break; case 2 : // InternalCucumber.g:421:6: ( ruleScenarioOutline ) { // InternalCucumber.g:421:6: ( ruleScenarioOutline ) // InternalCucumber.g:422:1: ruleScenarioOutline { before(grammarAccess.getFeatureAccess().getScenariosScenarioOutlineParserRuleCall_6_0_1()); pushFollow(FOLLOW_2); ruleScenarioOutline(); state._fsp--; after(grammarAccess.getFeatureAccess().getScenariosScenarioOutlineParserRuleCall_6_0_1()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__ScenariosAlternatives_6_0" // $ANTLR start "rule__Title__Alternatives_0" // InternalCucumber.g:432:1: rule__Title__Alternatives_0 : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) ); public final void rule__Title__Alternatives_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:436:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) ) int alt4=4; switch ( input.LA(1) ) { case RULE_WORD: { alt4=1; } break; case RULE_INT: { alt4=2; } break; case RULE_STRING: { alt4=3; } break; case RULE_PLACEHOLDER: { alt4=4; } break; default: NoViableAltException nvae = new NoViableAltException("", 4, 0, input); throw nvae; } switch (alt4) { case 1 : // InternalCucumber.g:437:1: ( RULE_WORD ) { // InternalCucumber.g:437:1: ( RULE_WORD ) // InternalCucumber.g:438:1: RULE_WORD { before(grammarAccess.getTitleAccess().getWORDTerminalRuleCall_0_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getTitleAccess().getWORDTerminalRuleCall_0_0()); } } break; case 2 : // InternalCucumber.g:443:6: ( RULE_INT ) { // InternalCucumber.g:443:6: ( RULE_INT ) // InternalCucumber.g:444:1: RULE_INT { before(grammarAccess.getTitleAccess().getINTTerminalRuleCall_0_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getTitleAccess().getINTTerminalRuleCall_0_1()); } } break; case 3 : // InternalCucumber.g:449:6: ( RULE_STRING ) { // InternalCucumber.g:449:6: ( RULE_STRING ) // InternalCucumber.g:450:1: RULE_STRING { before(grammarAccess.getTitleAccess().getSTRINGTerminalRuleCall_0_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getTitleAccess().getSTRINGTerminalRuleCall_0_2()); } } break; case 4 : // InternalCucumber.g:455:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:455:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:456:1: RULE_PLACEHOLDER { before(grammarAccess.getTitleAccess().getPLACEHOLDERTerminalRuleCall_0_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getTitleAccess().getPLACEHOLDERTerminalRuleCall_0_3()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Alternatives_0" // $ANTLR start "rule__Title__Alternatives_1" // InternalCucumber.g:466:1: rule__Title__Alternatives_1 : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ); public final void rule__Title__Alternatives_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:470:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ) int alt5=6; switch ( input.LA(1) ) { case RULE_WORD: { alt5=1; } break; case RULE_INT: { alt5=2; } break; case RULE_STRING: { alt5=3; } break; case RULE_PLACEHOLDER: { alt5=4; } break; case RULE_STEP_KEYWORD: { alt5=5; } break; case RULE_TAGNAME: { alt5=6; } break; default: NoViableAltException nvae = new NoViableAltException("", 5, 0, input); throw nvae; } switch (alt5) { case 1 : // InternalCucumber.g:471:1: ( RULE_WORD ) { // InternalCucumber.g:471:1: ( RULE_WORD ) // InternalCucumber.g:472:1: RULE_WORD { before(grammarAccess.getTitleAccess().getWORDTerminalRuleCall_1_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getTitleAccess().getWORDTerminalRuleCall_1_0()); } } break; case 2 : // InternalCucumber.g:477:6: ( RULE_INT ) { // InternalCucumber.g:477:6: ( RULE_INT ) // InternalCucumber.g:478:1: RULE_INT { before(grammarAccess.getTitleAccess().getINTTerminalRuleCall_1_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getTitleAccess().getINTTerminalRuleCall_1_1()); } } break; case 3 : // InternalCucumber.g:483:6: ( RULE_STRING ) { // InternalCucumber.g:483:6: ( RULE_STRING ) // InternalCucumber.g:484:1: RULE_STRING { before(grammarAccess.getTitleAccess().getSTRINGTerminalRuleCall_1_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getTitleAccess().getSTRINGTerminalRuleCall_1_2()); } } break; case 4 : // InternalCucumber.g:489:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:489:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:490:1: RULE_PLACEHOLDER { before(grammarAccess.getTitleAccess().getPLACEHOLDERTerminalRuleCall_1_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getTitleAccess().getPLACEHOLDERTerminalRuleCall_1_3()); } } break; case 5 : // InternalCucumber.g:495:6: ( RULE_STEP_KEYWORD ) { // InternalCucumber.g:495:6: ( RULE_STEP_KEYWORD ) // InternalCucumber.g:496:1: RULE_STEP_KEYWORD { before(grammarAccess.getTitleAccess().getSTEP_KEYWORDTerminalRuleCall_1_4()); match(input,RULE_STEP_KEYWORD,FOLLOW_2); after(grammarAccess.getTitleAccess().getSTEP_KEYWORDTerminalRuleCall_1_4()); } } break; case 6 : // InternalCucumber.g:501:6: ( RULE_TAGNAME ) { // InternalCucumber.g:501:6: ( RULE_TAGNAME ) // InternalCucumber.g:502:1: RULE_TAGNAME { before(grammarAccess.getTitleAccess().getTAGNAMETerminalRuleCall_1_5()); match(input,RULE_TAGNAME,FOLLOW_2); after(grammarAccess.getTitleAccess().getTAGNAMETerminalRuleCall_1_5()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Alternatives_1" // $ANTLR start "rule__Narrative__Alternatives_0" // InternalCucumber.g:512:1: rule__Narrative__Alternatives_0 : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) ); public final void rule__Narrative__Alternatives_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:516:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) ) int alt6=4; switch ( input.LA(1) ) { case RULE_WORD: { alt6=1; } break; case RULE_INT: { alt6=2; } break; case RULE_STRING: { alt6=3; } break; case RULE_PLACEHOLDER: { alt6=4; } break; default: NoViableAltException nvae = new NoViableAltException("", 6, 0, input); throw nvae; } switch (alt6) { case 1 : // InternalCucumber.g:517:1: ( RULE_WORD ) { // InternalCucumber.g:517:1: ( RULE_WORD ) // InternalCucumber.g:518:1: RULE_WORD { before(grammarAccess.getNarrativeAccess().getWORDTerminalRuleCall_0_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getWORDTerminalRuleCall_0_0()); } } break; case 2 : // InternalCucumber.g:523:6: ( RULE_INT ) { // InternalCucumber.g:523:6: ( RULE_INT ) // InternalCucumber.g:524:1: RULE_INT { before(grammarAccess.getNarrativeAccess().getINTTerminalRuleCall_0_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getINTTerminalRuleCall_0_1()); } } break; case 3 : // InternalCucumber.g:529:6: ( RULE_STRING ) { // InternalCucumber.g:529:6: ( RULE_STRING ) // InternalCucumber.g:530:1: RULE_STRING { before(grammarAccess.getNarrativeAccess().getSTRINGTerminalRuleCall_0_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getSTRINGTerminalRuleCall_0_2()); } } break; case 4 : // InternalCucumber.g:535:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:535:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:536:1: RULE_PLACEHOLDER { before(grammarAccess.getNarrativeAccess().getPLACEHOLDERTerminalRuleCall_0_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getPLACEHOLDERTerminalRuleCall_0_3()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Alternatives_0" // $ANTLR start "rule__Narrative__Alternatives_1" // InternalCucumber.g:546:1: rule__Narrative__Alternatives_1 : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ); public final void rule__Narrative__Alternatives_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:550:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ) int alt7=6; switch ( input.LA(1) ) { case RULE_WORD: { alt7=1; } break; case RULE_INT: { alt7=2; } break; case RULE_STRING: { alt7=3; } break; case RULE_PLACEHOLDER: { alt7=4; } break; case RULE_STEP_KEYWORD: { alt7=5; } break; case RULE_TAGNAME: { alt7=6; } break; default: NoViableAltException nvae = new NoViableAltException("", 7, 0, input); throw nvae; } switch (alt7) { case 1 : // InternalCucumber.g:551:1: ( RULE_WORD ) { // InternalCucumber.g:551:1: ( RULE_WORD ) // InternalCucumber.g:552:1: RULE_WORD { before(grammarAccess.getNarrativeAccess().getWORDTerminalRuleCall_1_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getWORDTerminalRuleCall_1_0()); } } break; case 2 : // InternalCucumber.g:557:6: ( RULE_INT ) { // InternalCucumber.g:557:6: ( RULE_INT ) // InternalCucumber.g:558:1: RULE_INT { before(grammarAccess.getNarrativeAccess().getINTTerminalRuleCall_1_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getINTTerminalRuleCall_1_1()); } } break; case 3 : // InternalCucumber.g:563:6: ( RULE_STRING ) { // InternalCucumber.g:563:6: ( RULE_STRING ) // InternalCucumber.g:564:1: RULE_STRING { before(grammarAccess.getNarrativeAccess().getSTRINGTerminalRuleCall_1_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getSTRINGTerminalRuleCall_1_2()); } } break; case 4 : // InternalCucumber.g:569:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:569:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:570:1: RULE_PLACEHOLDER { before(grammarAccess.getNarrativeAccess().getPLACEHOLDERTerminalRuleCall_1_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getPLACEHOLDERTerminalRuleCall_1_3()); } } break; case 5 : // InternalCucumber.g:575:6: ( RULE_STEP_KEYWORD ) { // InternalCucumber.g:575:6: ( RULE_STEP_KEYWORD ) // InternalCucumber.g:576:1: RULE_STEP_KEYWORD { before(grammarAccess.getNarrativeAccess().getSTEP_KEYWORDTerminalRuleCall_1_4()); match(input,RULE_STEP_KEYWORD,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getSTEP_KEYWORDTerminalRuleCall_1_4()); } } break; case 6 : // InternalCucumber.g:581:6: ( RULE_TAGNAME ) { // InternalCucumber.g:581:6: ( RULE_TAGNAME ) // InternalCucumber.g:582:1: RULE_TAGNAME { before(grammarAccess.getNarrativeAccess().getTAGNAMETerminalRuleCall_1_5()); match(input,RULE_TAGNAME,FOLLOW_2); after(grammarAccess.getNarrativeAccess().getTAGNAMETerminalRuleCall_1_5()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Alternatives_1" // $ANTLR start "rule__StepDescription__Alternatives" // InternalCucumber.g:592:1: rule__StepDescription__Alternatives : ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ); public final void rule__StepDescription__Alternatives() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:596:1: ( ( RULE_WORD ) | ( RULE_INT ) | ( RULE_STRING ) | ( RULE_PLACEHOLDER ) | ( RULE_STEP_KEYWORD ) | ( RULE_TAGNAME ) ) int alt8=6; switch ( input.LA(1) ) { case RULE_WORD: { alt8=1; } break; case RULE_INT: { alt8=2; } break; case RULE_STRING: { alt8=3; } break; case RULE_PLACEHOLDER: { alt8=4; } break; case RULE_STEP_KEYWORD: { alt8=5; } break; case RULE_TAGNAME: { alt8=6; } break; default: NoViableAltException nvae = new NoViableAltException("", 8, 0, input); throw nvae; } switch (alt8) { case 1 : // InternalCucumber.g:597:1: ( RULE_WORD ) { // InternalCucumber.g:597:1: ( RULE_WORD ) // InternalCucumber.g:598:1: RULE_WORD { before(grammarAccess.getStepDescriptionAccess().getWORDTerminalRuleCall_0()); match(input,RULE_WORD,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getWORDTerminalRuleCall_0()); } } break; case 2 : // InternalCucumber.g:603:6: ( RULE_INT ) { // InternalCucumber.g:603:6: ( RULE_INT ) // InternalCucumber.g:604:1: RULE_INT { before(grammarAccess.getStepDescriptionAccess().getINTTerminalRuleCall_1()); match(input,RULE_INT,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getINTTerminalRuleCall_1()); } } break; case 3 : // InternalCucumber.g:609:6: ( RULE_STRING ) { // InternalCucumber.g:609:6: ( RULE_STRING ) // InternalCucumber.g:610:1: RULE_STRING { before(grammarAccess.getStepDescriptionAccess().getSTRINGTerminalRuleCall_2()); match(input,RULE_STRING,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getSTRINGTerminalRuleCall_2()); } } break; case 4 : // InternalCucumber.g:615:6: ( RULE_PLACEHOLDER ) { // InternalCucumber.g:615:6: ( RULE_PLACEHOLDER ) // InternalCucumber.g:616:1: RULE_PLACEHOLDER { before(grammarAccess.getStepDescriptionAccess().getPLACEHOLDERTerminalRuleCall_3()); match(input,RULE_PLACEHOLDER,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getPLACEHOLDERTerminalRuleCall_3()); } } break; case 5 : // InternalCucumber.g:621:6: ( RULE_STEP_KEYWORD ) { // InternalCucumber.g:621:6: ( RULE_STEP_KEYWORD ) // InternalCucumber.g:622:1: RULE_STEP_KEYWORD { before(grammarAccess.getStepDescriptionAccess().getSTEP_KEYWORDTerminalRuleCall_4()); match(input,RULE_STEP_KEYWORD,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getSTEP_KEYWORDTerminalRuleCall_4()); } } break; case 6 : // InternalCucumber.g:627:6: ( RULE_TAGNAME ) { // InternalCucumber.g:627:6: ( RULE_TAGNAME ) // InternalCucumber.g:628:1: RULE_TAGNAME { before(grammarAccess.getStepDescriptionAccess().getTAGNAMETerminalRuleCall_5()); match(input,RULE_TAGNAME,FOLLOW_2); after(grammarAccess.getStepDescriptionAccess().getTAGNAMETerminalRuleCall_5()); } } break; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__StepDescription__Alternatives" // $ANTLR start "rule__Feature__Group__0" // InternalCucumber.g:640:1: rule__Feature__Group__0 : rule__Feature__Group__0__Impl rule__Feature__Group__1 ; public final void rule__Feature__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:644:1: ( rule__Feature__Group__0__Impl rule__Feature__Group__1 ) // InternalCucumber.g:645:2: rule__Feature__Group__0__Impl rule__Feature__Group__1 { pushFollow(FOLLOW_5); rule__Feature__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__0" // $ANTLR start "rule__Feature__Group__0__Impl" // InternalCucumber.g:652:1: rule__Feature__Group__0__Impl : ( ( rule__Feature__TagsAssignment_0 )* ) ; public final void rule__Feature__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:656:1: ( ( ( rule__Feature__TagsAssignment_0 )* ) ) // InternalCucumber.g:657:1: ( ( rule__Feature__TagsAssignment_0 )* ) { // InternalCucumber.g:657:1: ( ( rule__Feature__TagsAssignment_0 )* ) // InternalCucumber.g:658:1: ( rule__Feature__TagsAssignment_0 )* { before(grammarAccess.getFeatureAccess().getTagsAssignment_0()); // InternalCucumber.g:659:1: ( rule__Feature__TagsAssignment_0 )* loop9: do { int alt9=2; int LA9_0 = input.LA(1); if ( (LA9_0==RULE_TAGNAME) ) { alt9=1; } switch (alt9) { case 1 : // InternalCucumber.g:659:2: rule__Feature__TagsAssignment_0 { pushFollow(FOLLOW_6); rule__Feature__TagsAssignment_0(); state._fsp--; } break; default : break loop9; } } while (true); after(grammarAccess.getFeatureAccess().getTagsAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__0__Impl" // $ANTLR start "rule__Feature__Group__1" // InternalCucumber.g:669:1: rule__Feature__Group__1 : rule__Feature__Group__1__Impl rule__Feature__Group__2 ; public final void rule__Feature__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:673:1: ( rule__Feature__Group__1__Impl rule__Feature__Group__2 ) // InternalCucumber.g:674:2: rule__Feature__Group__1__Impl rule__Feature__Group__2 { pushFollow(FOLLOW_7); rule__Feature__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__1" // $ANTLR start "rule__Feature__Group__1__Impl" // InternalCucumber.g:681:1: rule__Feature__Group__1__Impl : ( 'Feature:' ) ; public final void rule__Feature__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:685:1: ( ( 'Feature:' ) ) // InternalCucumber.g:686:1: ( 'Feature:' ) { // InternalCucumber.g:686:1: ( 'Feature:' ) // InternalCucumber.g:687:1: 'Feature:' { before(grammarAccess.getFeatureAccess().getFeatureKeyword_1()); match(input,16,FOLLOW_2); after(grammarAccess.getFeatureAccess().getFeatureKeyword_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__1__Impl" // $ANTLR start "rule__Feature__Group__2" // InternalCucumber.g:700:1: rule__Feature__Group__2 : rule__Feature__Group__2__Impl rule__Feature__Group__3 ; public final void rule__Feature__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:704:1: ( rule__Feature__Group__2__Impl rule__Feature__Group__3 ) // InternalCucumber.g:705:2: rule__Feature__Group__2__Impl rule__Feature__Group__3 { pushFollow(FOLLOW_8); rule__Feature__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__2" // $ANTLR start "rule__Feature__Group__2__Impl" // InternalCucumber.g:712:1: rule__Feature__Group__2__Impl : ( ( rule__Feature__TitleAssignment_2 ) ) ; public final void rule__Feature__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:716:1: ( ( ( rule__Feature__TitleAssignment_2 ) ) ) // InternalCucumber.g:717:1: ( ( rule__Feature__TitleAssignment_2 ) ) { // InternalCucumber.g:717:1: ( ( rule__Feature__TitleAssignment_2 ) ) // InternalCucumber.g:718:1: ( rule__Feature__TitleAssignment_2 ) { before(grammarAccess.getFeatureAccess().getTitleAssignment_2()); // InternalCucumber.g:719:1: ( rule__Feature__TitleAssignment_2 ) // InternalCucumber.g:719:2: rule__Feature__TitleAssignment_2 { pushFollow(FOLLOW_2); rule__Feature__TitleAssignment_2(); state._fsp--; } after(grammarAccess.getFeatureAccess().getTitleAssignment_2()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__2__Impl" // $ANTLR start "rule__Feature__Group__3" // InternalCucumber.g:729:1: rule__Feature__Group__3 : rule__Feature__Group__3__Impl rule__Feature__Group__4 ; public final void rule__Feature__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:733:1: ( rule__Feature__Group__3__Impl rule__Feature__Group__4 ) // InternalCucumber.g:734:2: rule__Feature__Group__3__Impl rule__Feature__Group__4 { pushFollow(FOLLOW_9); rule__Feature__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__3" // $ANTLR start "rule__Feature__Group__3__Impl" // InternalCucumber.g:741:1: rule__Feature__Group__3__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Feature__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:745:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:746:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:746:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:747:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:747:1: ( ( RULE_EOL ) ) // InternalCucumber.g:748:1: ( RULE_EOL ) { before(grammarAccess.getFeatureAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:749:1: ( RULE_EOL ) // InternalCucumber.g:749:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getFeatureAccess().getEOLTerminalRuleCall_3()); } // InternalCucumber.g:752:1: ( ( RULE_EOL )* ) // InternalCucumber.g:753:1: ( RULE_EOL )* { before(grammarAccess.getFeatureAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:754:1: ( RULE_EOL )* loop10: do { int alt10=2; int LA10_0 = input.LA(1); if ( (LA10_0==RULE_EOL) ) { alt10=1; } switch (alt10) { case 1 : // InternalCucumber.g:754:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop10; } } while (true); after(grammarAccess.getFeatureAccess().getEOLTerminalRuleCall_3()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__3__Impl" // $ANTLR start "rule__Feature__Group__4" // InternalCucumber.g:765:1: rule__Feature__Group__4 : rule__Feature__Group__4__Impl rule__Feature__Group__5 ; public final void rule__Feature__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:769:1: ( rule__Feature__Group__4__Impl rule__Feature__Group__5 ) // InternalCucumber.g:770:2: rule__Feature__Group__4__Impl rule__Feature__Group__5 { pushFollow(FOLLOW_9); rule__Feature__Group__4__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__5(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__4" // $ANTLR start "rule__Feature__Group__4__Impl" // InternalCucumber.g:777:1: rule__Feature__Group__4__Impl : ( ( rule__Feature__NarrativeAssignment_4 )? ) ; public final void rule__Feature__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:781:1: ( ( ( rule__Feature__NarrativeAssignment_4 )? ) ) // InternalCucumber.g:782:1: ( ( rule__Feature__NarrativeAssignment_4 )? ) { // InternalCucumber.g:782:1: ( ( rule__Feature__NarrativeAssignment_4 )? ) // InternalCucumber.g:783:1: ( rule__Feature__NarrativeAssignment_4 )? { before(grammarAccess.getFeatureAccess().getNarrativeAssignment_4()); // InternalCucumber.g:784:1: ( rule__Feature__NarrativeAssignment_4 )? int alt11=2; int LA11_0 = input.LA(1); if ( ((LA11_0>=RULE_WORD && LA11_0<=RULE_PLACEHOLDER)) ) { alt11=1; } switch (alt11) { case 1 : // InternalCucumber.g:784:2: rule__Feature__NarrativeAssignment_4 { pushFollow(FOLLOW_2); rule__Feature__NarrativeAssignment_4(); state._fsp--; } break; } after(grammarAccess.getFeatureAccess().getNarrativeAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__4__Impl" // $ANTLR start "rule__Feature__Group__5" // InternalCucumber.g:794:1: rule__Feature__Group__5 : rule__Feature__Group__5__Impl rule__Feature__Group__6 ; public final void rule__Feature__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:798:1: ( rule__Feature__Group__5__Impl rule__Feature__Group__6 ) // InternalCucumber.g:799:2: rule__Feature__Group__5__Impl rule__Feature__Group__6 { pushFollow(FOLLOW_9); rule__Feature__Group__5__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Feature__Group__6(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__5" // $ANTLR start "rule__Feature__Group__5__Impl" // InternalCucumber.g:806:1: rule__Feature__Group__5__Impl : ( ( rule__Feature__BackgroundAssignment_5 )? ) ; public final void rule__Feature__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:810:1: ( ( ( rule__Feature__BackgroundAssignment_5 )? ) ) // InternalCucumber.g:811:1: ( ( rule__Feature__BackgroundAssignment_5 )? ) { // InternalCucumber.g:811:1: ( ( rule__Feature__BackgroundAssignment_5 )? ) // InternalCucumber.g:812:1: ( rule__Feature__BackgroundAssignment_5 )? { before(grammarAccess.getFeatureAccess().getBackgroundAssignment_5()); // InternalCucumber.g:813:1: ( rule__Feature__BackgroundAssignment_5 )? int alt12=2; int LA12_0 = input.LA(1); if ( (LA12_0==17) ) { alt12=1; } switch (alt12) { case 1 : // InternalCucumber.g:813:2: rule__Feature__BackgroundAssignment_5 { pushFollow(FOLLOW_2); rule__Feature__BackgroundAssignment_5(); state._fsp--; } break; } after(grammarAccess.getFeatureAccess().getBackgroundAssignment_5()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__5__Impl" // $ANTLR start "rule__Feature__Group__6" // InternalCucumber.g:823:1: rule__Feature__Group__6 : rule__Feature__Group__6__Impl ; public final void rule__Feature__Group__6() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:827:1: ( rule__Feature__Group__6__Impl ) // InternalCucumber.g:828:2: rule__Feature__Group__6__Impl { pushFollow(FOLLOW_2); rule__Feature__Group__6__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__6" // $ANTLR start "rule__Feature__Group__6__Impl" // InternalCucumber.g:834:1: rule__Feature__Group__6__Impl : ( ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) ) ; public final void rule__Feature__Group__6__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:838:1: ( ( ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) ) ) // InternalCucumber.g:839:1: ( ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) ) { // InternalCucumber.g:839:1: ( ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) ) // InternalCucumber.g:840:1: ( ( rule__Feature__ScenariosAssignment_6 ) ) ( ( rule__Feature__ScenariosAssignment_6 )* ) { // InternalCucumber.g:840:1: ( ( rule__Feature__ScenariosAssignment_6 ) ) // InternalCucumber.g:841:1: ( rule__Feature__ScenariosAssignment_6 ) { before(grammarAccess.getFeatureAccess().getScenariosAssignment_6()); // InternalCucumber.g:842:1: ( rule__Feature__ScenariosAssignment_6 ) // InternalCucumber.g:842:2: rule__Feature__ScenariosAssignment_6 { pushFollow(FOLLOW_11); rule__Feature__ScenariosAssignment_6(); state._fsp--; } after(grammarAccess.getFeatureAccess().getScenariosAssignment_6()); } // InternalCucumber.g:845:1: ( ( rule__Feature__ScenariosAssignment_6 )* ) // InternalCucumber.g:846:1: ( rule__Feature__ScenariosAssignment_6 )* { before(grammarAccess.getFeatureAccess().getScenariosAssignment_6()); // InternalCucumber.g:847:1: ( rule__Feature__ScenariosAssignment_6 )* loop13: do { int alt13=2; int LA13_0 = input.LA(1); if ( (LA13_0==RULE_TAGNAME||(LA13_0>=18 && LA13_0<=19)) ) { alt13=1; } switch (alt13) { case 1 : // InternalCucumber.g:847:2: rule__Feature__ScenariosAssignment_6 { pushFollow(FOLLOW_11); rule__Feature__ScenariosAssignment_6(); state._fsp--; } break; default : break loop13; } } while (true); after(grammarAccess.getFeatureAccess().getScenariosAssignment_6()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__Group__6__Impl" // $ANTLR start "rule__Background__Group__0" // InternalCucumber.g:872:1: rule__Background__Group__0 : rule__Background__Group__0__Impl rule__Background__Group__1 ; public final void rule__Background__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:876:1: ( rule__Background__Group__0__Impl rule__Background__Group__1 ) // InternalCucumber.g:877:2: rule__Background__Group__0__Impl rule__Background__Group__1 { pushFollow(FOLLOW_12); rule__Background__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Background__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__0" // $ANTLR start "rule__Background__Group__0__Impl" // InternalCucumber.g:884:1: rule__Background__Group__0__Impl : ( 'Background:' ) ; public final void rule__Background__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:888:1: ( ( 'Background:' ) ) // InternalCucumber.g:889:1: ( 'Background:' ) { // InternalCucumber.g:889:1: ( 'Background:' ) // InternalCucumber.g:890:1: 'Background:' { before(grammarAccess.getBackgroundAccess().getBackgroundKeyword_0()); match(input,17,FOLLOW_2); after(grammarAccess.getBackgroundAccess().getBackgroundKeyword_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__0__Impl" // $ANTLR start "rule__Background__Group__1" // InternalCucumber.g:903:1: rule__Background__Group__1 : rule__Background__Group__1__Impl rule__Background__Group__2 ; public final void rule__Background__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:907:1: ( rule__Background__Group__1__Impl rule__Background__Group__2 ) // InternalCucumber.g:908:2: rule__Background__Group__1__Impl rule__Background__Group__2 { pushFollow(FOLLOW_12); rule__Background__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Background__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__1" // $ANTLR start "rule__Background__Group__1__Impl" // InternalCucumber.g:915:1: rule__Background__Group__1__Impl : ( ( rule__Background__TitleAssignment_1 )? ) ; public final void rule__Background__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:919:1: ( ( ( rule__Background__TitleAssignment_1 )? ) ) // InternalCucumber.g:920:1: ( ( rule__Background__TitleAssignment_1 )? ) { // InternalCucumber.g:920:1: ( ( rule__Background__TitleAssignment_1 )? ) // InternalCucumber.g:921:1: ( rule__Background__TitleAssignment_1 )? { before(grammarAccess.getBackgroundAccess().getTitleAssignment_1()); // InternalCucumber.g:922:1: ( rule__Background__TitleAssignment_1 )? int alt14=2; int LA14_0 = input.LA(1); if ( ((LA14_0>=RULE_WORD && LA14_0<=RULE_PLACEHOLDER)) ) { alt14=1; } switch (alt14) { case 1 : // InternalCucumber.g:922:2: rule__Background__TitleAssignment_1 { pushFollow(FOLLOW_2); rule__Background__TitleAssignment_1(); state._fsp--; } break; } after(grammarAccess.getBackgroundAccess().getTitleAssignment_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__1__Impl" // $ANTLR start "rule__Background__Group__2" // InternalCucumber.g:932:1: rule__Background__Group__2 : rule__Background__Group__2__Impl rule__Background__Group__3 ; public final void rule__Background__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:936:1: ( rule__Background__Group__2__Impl rule__Background__Group__3 ) // InternalCucumber.g:937:2: rule__Background__Group__2__Impl rule__Background__Group__3 { pushFollow(FOLLOW_13); rule__Background__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Background__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__2" // $ANTLR start "rule__Background__Group__2__Impl" // InternalCucumber.g:944:1: rule__Background__Group__2__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Background__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:948:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:949:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:949:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:950:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:950:1: ( ( RULE_EOL ) ) // InternalCucumber.g:951:1: ( RULE_EOL ) { before(grammarAccess.getBackgroundAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:952:1: ( RULE_EOL ) // InternalCucumber.g:952:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getBackgroundAccess().getEOLTerminalRuleCall_2()); } // InternalCucumber.g:955:1: ( ( RULE_EOL )* ) // InternalCucumber.g:956:1: ( RULE_EOL )* { before(grammarAccess.getBackgroundAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:957:1: ( RULE_EOL )* loop15: do { int alt15=2; int LA15_0 = input.LA(1); if ( (LA15_0==RULE_EOL) ) { alt15=1; } switch (alt15) { case 1 : // InternalCucumber.g:957:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop15; } } while (true); after(grammarAccess.getBackgroundAccess().getEOLTerminalRuleCall_2()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__2__Impl" // $ANTLR start "rule__Background__Group__3" // InternalCucumber.g:968:1: rule__Background__Group__3 : rule__Background__Group__3__Impl rule__Background__Group__4 ; public final void rule__Background__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:972:1: ( rule__Background__Group__3__Impl rule__Background__Group__4 ) // InternalCucumber.g:973:2: rule__Background__Group__3__Impl rule__Background__Group__4 { pushFollow(FOLLOW_13); rule__Background__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Background__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__3" // $ANTLR start "rule__Background__Group__3__Impl" // InternalCucumber.g:980:1: rule__Background__Group__3__Impl : ( ( rule__Background__NarrativeAssignment_3 )? ) ; public final void rule__Background__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:984:1: ( ( ( rule__Background__NarrativeAssignment_3 )? ) ) // InternalCucumber.g:985:1: ( ( rule__Background__NarrativeAssignment_3 )? ) { // InternalCucumber.g:985:1: ( ( rule__Background__NarrativeAssignment_3 )? ) // InternalCucumber.g:986:1: ( rule__Background__NarrativeAssignment_3 )? { before(grammarAccess.getBackgroundAccess().getNarrativeAssignment_3()); // InternalCucumber.g:987:1: ( rule__Background__NarrativeAssignment_3 )? int alt16=2; int LA16_0 = input.LA(1); if ( ((LA16_0>=RULE_WORD && LA16_0<=RULE_PLACEHOLDER)) ) { alt16=1; } switch (alt16) { case 1 : // InternalCucumber.g:987:2: rule__Background__NarrativeAssignment_3 { pushFollow(FOLLOW_2); rule__Background__NarrativeAssignment_3(); state._fsp--; } break; } after(grammarAccess.getBackgroundAccess().getNarrativeAssignment_3()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__3__Impl" // $ANTLR start "rule__Background__Group__4" // InternalCucumber.g:997:1: rule__Background__Group__4 : rule__Background__Group__4__Impl ; public final void rule__Background__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1001:1: ( rule__Background__Group__4__Impl ) // InternalCucumber.g:1002:2: rule__Background__Group__4__Impl { pushFollow(FOLLOW_2); rule__Background__Group__4__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__4" // $ANTLR start "rule__Background__Group__4__Impl" // InternalCucumber.g:1008:1: rule__Background__Group__4__Impl : ( ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) ) ; public final void rule__Background__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1012:1: ( ( ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) ) ) // InternalCucumber.g:1013:1: ( ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) ) { // InternalCucumber.g:1013:1: ( ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) ) // InternalCucumber.g:1014:1: ( ( rule__Background__StepsAssignment_4 ) ) ( ( rule__Background__StepsAssignment_4 )* ) { // InternalCucumber.g:1014:1: ( ( rule__Background__StepsAssignment_4 ) ) // InternalCucumber.g:1015:1: ( rule__Background__StepsAssignment_4 ) { before(grammarAccess.getBackgroundAccess().getStepsAssignment_4()); // InternalCucumber.g:1016:1: ( rule__Background__StepsAssignment_4 ) // InternalCucumber.g:1016:2: rule__Background__StepsAssignment_4 { pushFollow(FOLLOW_14); rule__Background__StepsAssignment_4(); state._fsp--; } after(grammarAccess.getBackgroundAccess().getStepsAssignment_4()); } // InternalCucumber.g:1019:1: ( ( rule__Background__StepsAssignment_4 )* ) // InternalCucumber.g:1020:1: ( rule__Background__StepsAssignment_4 )* { before(grammarAccess.getBackgroundAccess().getStepsAssignment_4()); // InternalCucumber.g:1021:1: ( rule__Background__StepsAssignment_4 )* loop17: do { int alt17=2; int LA17_0 = input.LA(1); if ( (LA17_0==RULE_STEP_KEYWORD) ) { alt17=1; } switch (alt17) { case 1 : // InternalCucumber.g:1021:2: rule__Background__StepsAssignment_4 { pushFollow(FOLLOW_14); rule__Background__StepsAssignment_4(); state._fsp--; } break; default : break loop17; } } while (true); after(grammarAccess.getBackgroundAccess().getStepsAssignment_4()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__Group__4__Impl" // $ANTLR start "rule__Scenario__Group__0" // InternalCucumber.g:1042:1: rule__Scenario__Group__0 : rule__Scenario__Group__0__Impl rule__Scenario__Group__1 ; public final void rule__Scenario__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1046:1: ( rule__Scenario__Group__0__Impl rule__Scenario__Group__1 ) // InternalCucumber.g:1047:2: rule__Scenario__Group__0__Impl rule__Scenario__Group__1 { pushFollow(FOLLOW_15); rule__Scenario__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__0" // $ANTLR start "rule__Scenario__Group__0__Impl" // InternalCucumber.g:1054:1: rule__Scenario__Group__0__Impl : ( ( rule__Scenario__TagsAssignment_0 )* ) ; public final void rule__Scenario__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1058:1: ( ( ( rule__Scenario__TagsAssignment_0 )* ) ) // InternalCucumber.g:1059:1: ( ( rule__Scenario__TagsAssignment_0 )* ) { // InternalCucumber.g:1059:1: ( ( rule__Scenario__TagsAssignment_0 )* ) // InternalCucumber.g:1060:1: ( rule__Scenario__TagsAssignment_0 )* { before(grammarAccess.getScenarioAccess().getTagsAssignment_0()); // InternalCucumber.g:1061:1: ( rule__Scenario__TagsAssignment_0 )* loop18: do { int alt18=2; int LA18_0 = input.LA(1); if ( (LA18_0==RULE_TAGNAME) ) { alt18=1; } switch (alt18) { case 1 : // InternalCucumber.g:1061:2: rule__Scenario__TagsAssignment_0 { pushFollow(FOLLOW_6); rule__Scenario__TagsAssignment_0(); state._fsp--; } break; default : break loop18; } } while (true); after(grammarAccess.getScenarioAccess().getTagsAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__0__Impl" // $ANTLR start "rule__Scenario__Group__1" // InternalCucumber.g:1071:1: rule__Scenario__Group__1 : rule__Scenario__Group__1__Impl rule__Scenario__Group__2 ; public final void rule__Scenario__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1075:1: ( rule__Scenario__Group__1__Impl rule__Scenario__Group__2 ) // InternalCucumber.g:1076:2: rule__Scenario__Group__1__Impl rule__Scenario__Group__2 { pushFollow(FOLLOW_12); rule__Scenario__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__1" // $ANTLR start "rule__Scenario__Group__1__Impl" // InternalCucumber.g:1083:1: rule__Scenario__Group__1__Impl : ( 'Scenario:' ) ; public final void rule__Scenario__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1087:1: ( ( 'Scenario:' ) ) // InternalCucumber.g:1088:1: ( 'Scenario:' ) { // InternalCucumber.g:1088:1: ( 'Scenario:' ) // InternalCucumber.g:1089:1: 'Scenario:' { before(grammarAccess.getScenarioAccess().getScenarioKeyword_1()); match(input,18,FOLLOW_2); after(grammarAccess.getScenarioAccess().getScenarioKeyword_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__1__Impl" // $ANTLR start "rule__Scenario__Group__2" // InternalCucumber.g:1102:1: rule__Scenario__Group__2 : rule__Scenario__Group__2__Impl rule__Scenario__Group__3 ; public final void rule__Scenario__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1106:1: ( rule__Scenario__Group__2__Impl rule__Scenario__Group__3 ) // InternalCucumber.g:1107:2: rule__Scenario__Group__2__Impl rule__Scenario__Group__3 { pushFollow(FOLLOW_12); rule__Scenario__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__2" // $ANTLR start "rule__Scenario__Group__2__Impl" // InternalCucumber.g:1114:1: rule__Scenario__Group__2__Impl : ( ( rule__Scenario__TitleAssignment_2 )? ) ; public final void rule__Scenario__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1118:1: ( ( ( rule__Scenario__TitleAssignment_2 )? ) ) // InternalCucumber.g:1119:1: ( ( rule__Scenario__TitleAssignment_2 )? ) { // InternalCucumber.g:1119:1: ( ( rule__Scenario__TitleAssignment_2 )? ) // InternalCucumber.g:1120:1: ( rule__Scenario__TitleAssignment_2 )? { before(grammarAccess.getScenarioAccess().getTitleAssignment_2()); // InternalCucumber.g:1121:1: ( rule__Scenario__TitleAssignment_2 )? int alt19=2; int LA19_0 = input.LA(1); if ( ((LA19_0>=RULE_WORD && LA19_0<=RULE_PLACEHOLDER)) ) { alt19=1; } switch (alt19) { case 1 : // InternalCucumber.g:1121:2: rule__Scenario__TitleAssignment_2 { pushFollow(FOLLOW_2); rule__Scenario__TitleAssignment_2(); state._fsp--; } break; } after(grammarAccess.getScenarioAccess().getTitleAssignment_2()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__2__Impl" // $ANTLR start "rule__Scenario__Group__3" // InternalCucumber.g:1131:1: rule__Scenario__Group__3 : rule__Scenario__Group__3__Impl rule__Scenario__Group__4 ; public final void rule__Scenario__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1135:1: ( rule__Scenario__Group__3__Impl rule__Scenario__Group__4 ) // InternalCucumber.g:1136:2: rule__Scenario__Group__3__Impl rule__Scenario__Group__4 { pushFollow(FOLLOW_13); rule__Scenario__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__3" // $ANTLR start "rule__Scenario__Group__3__Impl" // InternalCucumber.g:1143:1: rule__Scenario__Group__3__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Scenario__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1147:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:1148:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:1148:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:1149:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:1149:1: ( ( RULE_EOL ) ) // InternalCucumber.g:1150:1: ( RULE_EOL ) { before(grammarAccess.getScenarioAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:1151:1: ( RULE_EOL ) // InternalCucumber.g:1151:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getScenarioAccess().getEOLTerminalRuleCall_3()); } // InternalCucumber.g:1154:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1155:1: ( RULE_EOL )* { before(grammarAccess.getScenarioAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:1156:1: ( RULE_EOL )* loop20: do { int alt20=2; int LA20_0 = input.LA(1); if ( (LA20_0==RULE_EOL) ) { alt20=1; } switch (alt20) { case 1 : // InternalCucumber.g:1156:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop20; } } while (true); after(grammarAccess.getScenarioAccess().getEOLTerminalRuleCall_3()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__3__Impl" // $ANTLR start "rule__Scenario__Group__4" // InternalCucumber.g:1167:1: rule__Scenario__Group__4 : rule__Scenario__Group__4__Impl rule__Scenario__Group__5 ; public final void rule__Scenario__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1171:1: ( rule__Scenario__Group__4__Impl rule__Scenario__Group__5 ) // InternalCucumber.g:1172:2: rule__Scenario__Group__4__Impl rule__Scenario__Group__5 { pushFollow(FOLLOW_13); rule__Scenario__Group__4__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Scenario__Group__5(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__4" // $ANTLR start "rule__Scenario__Group__4__Impl" // InternalCucumber.g:1179:1: rule__Scenario__Group__4__Impl : ( ( rule__Scenario__NarrativeAssignment_4 )? ) ; public final void rule__Scenario__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1183:1: ( ( ( rule__Scenario__NarrativeAssignment_4 )? ) ) // InternalCucumber.g:1184:1: ( ( rule__Scenario__NarrativeAssignment_4 )? ) { // InternalCucumber.g:1184:1: ( ( rule__Scenario__NarrativeAssignment_4 )? ) // InternalCucumber.g:1185:1: ( rule__Scenario__NarrativeAssignment_4 )? { before(grammarAccess.getScenarioAccess().getNarrativeAssignment_4()); // InternalCucumber.g:1186:1: ( rule__Scenario__NarrativeAssignment_4 )? int alt21=2; int LA21_0 = input.LA(1); if ( ((LA21_0>=RULE_WORD && LA21_0<=RULE_PLACEHOLDER)) ) { alt21=1; } switch (alt21) { case 1 : // InternalCucumber.g:1186:2: rule__Scenario__NarrativeAssignment_4 { pushFollow(FOLLOW_2); rule__Scenario__NarrativeAssignment_4(); state._fsp--; } break; } after(grammarAccess.getScenarioAccess().getNarrativeAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__4__Impl" // $ANTLR start "rule__Scenario__Group__5" // InternalCucumber.g:1196:1: rule__Scenario__Group__5 : rule__Scenario__Group__5__Impl ; public final void rule__Scenario__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1200:1: ( rule__Scenario__Group__5__Impl ) // InternalCucumber.g:1201:2: rule__Scenario__Group__5__Impl { pushFollow(FOLLOW_2); rule__Scenario__Group__5__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__5" // $ANTLR start "rule__Scenario__Group__5__Impl" // InternalCucumber.g:1207:1: rule__Scenario__Group__5__Impl : ( ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) ) ; public final void rule__Scenario__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1211:1: ( ( ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) ) ) // InternalCucumber.g:1212:1: ( ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) ) { // InternalCucumber.g:1212:1: ( ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) ) // InternalCucumber.g:1213:1: ( ( rule__Scenario__StepsAssignment_5 ) ) ( ( rule__Scenario__StepsAssignment_5 )* ) { // InternalCucumber.g:1213:1: ( ( rule__Scenario__StepsAssignment_5 ) ) // InternalCucumber.g:1214:1: ( rule__Scenario__StepsAssignment_5 ) { before(grammarAccess.getScenarioAccess().getStepsAssignment_5()); // InternalCucumber.g:1215:1: ( rule__Scenario__StepsAssignment_5 ) // InternalCucumber.g:1215:2: rule__Scenario__StepsAssignment_5 { pushFollow(FOLLOW_14); rule__Scenario__StepsAssignment_5(); state._fsp--; } after(grammarAccess.getScenarioAccess().getStepsAssignment_5()); } // InternalCucumber.g:1218:1: ( ( rule__Scenario__StepsAssignment_5 )* ) // InternalCucumber.g:1219:1: ( rule__Scenario__StepsAssignment_5 )* { before(grammarAccess.getScenarioAccess().getStepsAssignment_5()); // InternalCucumber.g:1220:1: ( rule__Scenario__StepsAssignment_5 )* loop22: do { int alt22=2; int LA22_0 = input.LA(1); if ( (LA22_0==RULE_STEP_KEYWORD) ) { alt22=1; } switch (alt22) { case 1 : // InternalCucumber.g:1220:2: rule__Scenario__StepsAssignment_5 { pushFollow(FOLLOW_14); rule__Scenario__StepsAssignment_5(); state._fsp--; } break; default : break loop22; } } while (true); after(grammarAccess.getScenarioAccess().getStepsAssignment_5()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__Group__5__Impl" // $ANTLR start "rule__ScenarioOutline__Group__0" // InternalCucumber.g:1243:1: rule__ScenarioOutline__Group__0 : rule__ScenarioOutline__Group__0__Impl rule__ScenarioOutline__Group__1 ; public final void rule__ScenarioOutline__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1247:1: ( rule__ScenarioOutline__Group__0__Impl rule__ScenarioOutline__Group__1 ) // InternalCucumber.g:1248:2: rule__ScenarioOutline__Group__0__Impl rule__ScenarioOutline__Group__1 { pushFollow(FOLLOW_9); rule__ScenarioOutline__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__0" // $ANTLR start "rule__ScenarioOutline__Group__0__Impl" // InternalCucumber.g:1255:1: rule__ScenarioOutline__Group__0__Impl : ( ( rule__ScenarioOutline__TagsAssignment_0 )* ) ; public final void rule__ScenarioOutline__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1259:1: ( ( ( rule__ScenarioOutline__TagsAssignment_0 )* ) ) // InternalCucumber.g:1260:1: ( ( rule__ScenarioOutline__TagsAssignment_0 )* ) { // InternalCucumber.g:1260:1: ( ( rule__ScenarioOutline__TagsAssignment_0 )* ) // InternalCucumber.g:1261:1: ( rule__ScenarioOutline__TagsAssignment_0 )* { before(grammarAccess.getScenarioOutlineAccess().getTagsAssignment_0()); // InternalCucumber.g:1262:1: ( rule__ScenarioOutline__TagsAssignment_0 )* loop23: do { int alt23=2; int LA23_0 = input.LA(1); if ( (LA23_0==RULE_TAGNAME) ) { alt23=1; } switch (alt23) { case 1 : // InternalCucumber.g:1262:2: rule__ScenarioOutline__TagsAssignment_0 { pushFollow(FOLLOW_6); rule__ScenarioOutline__TagsAssignment_0(); state._fsp--; } break; default : break loop23; } } while (true); after(grammarAccess.getScenarioOutlineAccess().getTagsAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__0__Impl" // $ANTLR start "rule__ScenarioOutline__Group__1" // InternalCucumber.g:1272:1: rule__ScenarioOutline__Group__1 : rule__ScenarioOutline__Group__1__Impl rule__ScenarioOutline__Group__2 ; public final void rule__ScenarioOutline__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1276:1: ( rule__ScenarioOutline__Group__1__Impl rule__ScenarioOutline__Group__2 ) // InternalCucumber.g:1277:2: rule__ScenarioOutline__Group__1__Impl rule__ScenarioOutline__Group__2 { pushFollow(FOLLOW_12); rule__ScenarioOutline__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__1" // $ANTLR start "rule__ScenarioOutline__Group__1__Impl" // InternalCucumber.g:1284:1: rule__ScenarioOutline__Group__1__Impl : ( 'Scenario Outline:' ) ; public final void rule__ScenarioOutline__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1288:1: ( ( 'Scenario Outline:' ) ) // InternalCucumber.g:1289:1: ( 'Scenario Outline:' ) { // InternalCucumber.g:1289:1: ( 'Scenario Outline:' ) // InternalCucumber.g:1290:1: 'Scenario Outline:' { before(grammarAccess.getScenarioOutlineAccess().getScenarioOutlineKeyword_1()); match(input,19,FOLLOW_2); after(grammarAccess.getScenarioOutlineAccess().getScenarioOutlineKeyword_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__1__Impl" // $ANTLR start "rule__ScenarioOutline__Group__2" // InternalCucumber.g:1303:1: rule__ScenarioOutline__Group__2 : rule__ScenarioOutline__Group__2__Impl rule__ScenarioOutline__Group__3 ; public final void rule__ScenarioOutline__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1307:1: ( rule__ScenarioOutline__Group__2__Impl rule__ScenarioOutline__Group__3 ) // InternalCucumber.g:1308:2: rule__ScenarioOutline__Group__2__Impl rule__ScenarioOutline__Group__3 { pushFollow(FOLLOW_12); rule__ScenarioOutline__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__2" // $ANTLR start "rule__ScenarioOutline__Group__2__Impl" // InternalCucumber.g:1315:1: rule__ScenarioOutline__Group__2__Impl : ( ( rule__ScenarioOutline__TitleAssignment_2 )? ) ; public final void rule__ScenarioOutline__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1319:1: ( ( ( rule__ScenarioOutline__TitleAssignment_2 )? ) ) // InternalCucumber.g:1320:1: ( ( rule__ScenarioOutline__TitleAssignment_2 )? ) { // InternalCucumber.g:1320:1: ( ( rule__ScenarioOutline__TitleAssignment_2 )? ) // InternalCucumber.g:1321:1: ( rule__ScenarioOutline__TitleAssignment_2 )? { before(grammarAccess.getScenarioOutlineAccess().getTitleAssignment_2()); // InternalCucumber.g:1322:1: ( rule__ScenarioOutline__TitleAssignment_2 )? int alt24=2; int LA24_0 = input.LA(1); if ( ((LA24_0>=RULE_WORD && LA24_0<=RULE_PLACEHOLDER)) ) { alt24=1; } switch (alt24) { case 1 : // InternalCucumber.g:1322:2: rule__ScenarioOutline__TitleAssignment_2 { pushFollow(FOLLOW_2); rule__ScenarioOutline__TitleAssignment_2(); state._fsp--; } break; } after(grammarAccess.getScenarioOutlineAccess().getTitleAssignment_2()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__2__Impl" // $ANTLR start "rule__ScenarioOutline__Group__3" // InternalCucumber.g:1332:1: rule__ScenarioOutline__Group__3 : rule__ScenarioOutline__Group__3__Impl rule__ScenarioOutline__Group__4 ; public final void rule__ScenarioOutline__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1336:1: ( rule__ScenarioOutline__Group__3__Impl rule__ScenarioOutline__Group__4 ) // InternalCucumber.g:1337:2: rule__ScenarioOutline__Group__3__Impl rule__ScenarioOutline__Group__4 { pushFollow(FOLLOW_13); rule__ScenarioOutline__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__3" // $ANTLR start "rule__ScenarioOutline__Group__3__Impl" // InternalCucumber.g:1344:1: rule__ScenarioOutline__Group__3__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__ScenarioOutline__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1348:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:1349:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:1349:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:1350:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:1350:1: ( ( RULE_EOL ) ) // InternalCucumber.g:1351:1: ( RULE_EOL ) { before(grammarAccess.getScenarioOutlineAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:1352:1: ( RULE_EOL ) // InternalCucumber.g:1352:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getScenarioOutlineAccess().getEOLTerminalRuleCall_3()); } // InternalCucumber.g:1355:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1356:1: ( RULE_EOL )* { before(grammarAccess.getScenarioOutlineAccess().getEOLTerminalRuleCall_3()); // InternalCucumber.g:1357:1: ( RULE_EOL )* loop25: do { int alt25=2; int LA25_0 = input.LA(1); if ( (LA25_0==RULE_EOL) ) { alt25=1; } switch (alt25) { case 1 : // InternalCucumber.g:1357:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop25; } } while (true); after(grammarAccess.getScenarioOutlineAccess().getEOLTerminalRuleCall_3()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__3__Impl" // $ANTLR start "rule__ScenarioOutline__Group__4" // InternalCucumber.g:1368:1: rule__ScenarioOutline__Group__4 : rule__ScenarioOutline__Group__4__Impl rule__ScenarioOutline__Group__5 ; public final void rule__ScenarioOutline__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1372:1: ( rule__ScenarioOutline__Group__4__Impl rule__ScenarioOutline__Group__5 ) // InternalCucumber.g:1373:2: rule__ScenarioOutline__Group__4__Impl rule__ScenarioOutline__Group__5 { pushFollow(FOLLOW_13); rule__ScenarioOutline__Group__4__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__5(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__4" // $ANTLR start "rule__ScenarioOutline__Group__4__Impl" // InternalCucumber.g:1380:1: rule__ScenarioOutline__Group__4__Impl : ( ( rule__ScenarioOutline__NarrativeAssignment_4 )? ) ; public final void rule__ScenarioOutline__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1384:1: ( ( ( rule__ScenarioOutline__NarrativeAssignment_4 )? ) ) // InternalCucumber.g:1385:1: ( ( rule__ScenarioOutline__NarrativeAssignment_4 )? ) { // InternalCucumber.g:1385:1: ( ( rule__ScenarioOutline__NarrativeAssignment_4 )? ) // InternalCucumber.g:1386:1: ( rule__ScenarioOutline__NarrativeAssignment_4 )? { before(grammarAccess.getScenarioOutlineAccess().getNarrativeAssignment_4()); // InternalCucumber.g:1387:1: ( rule__ScenarioOutline__NarrativeAssignment_4 )? int alt26=2; int LA26_0 = input.LA(1); if ( ((LA26_0>=RULE_WORD && LA26_0<=RULE_PLACEHOLDER)) ) { alt26=1; } switch (alt26) { case 1 : // InternalCucumber.g:1387:2: rule__ScenarioOutline__NarrativeAssignment_4 { pushFollow(FOLLOW_2); rule__ScenarioOutline__NarrativeAssignment_4(); state._fsp--; } break; } after(grammarAccess.getScenarioOutlineAccess().getNarrativeAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__4__Impl" // $ANTLR start "rule__ScenarioOutline__Group__5" // InternalCucumber.g:1397:1: rule__ScenarioOutline__Group__5 : rule__ScenarioOutline__Group__5__Impl rule__ScenarioOutline__Group__6 ; public final void rule__ScenarioOutline__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1401:1: ( rule__ScenarioOutline__Group__5__Impl rule__ScenarioOutline__Group__6 ) // InternalCucumber.g:1402:2: rule__ScenarioOutline__Group__5__Impl rule__ScenarioOutline__Group__6 { pushFollow(FOLLOW_16); rule__ScenarioOutline__Group__5__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__6(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__5" // $ANTLR start "rule__ScenarioOutline__Group__5__Impl" // InternalCucumber.g:1409:1: rule__ScenarioOutline__Group__5__Impl : ( ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) ) ; public final void rule__ScenarioOutline__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1413:1: ( ( ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) ) ) // InternalCucumber.g:1414:1: ( ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) ) { // InternalCucumber.g:1414:1: ( ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) ) // InternalCucumber.g:1415:1: ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) { // InternalCucumber.g:1415:1: ( ( rule__ScenarioOutline__StepsAssignment_5 ) ) // InternalCucumber.g:1416:1: ( rule__ScenarioOutline__StepsAssignment_5 ) { before(grammarAccess.getScenarioOutlineAccess().getStepsAssignment_5()); // InternalCucumber.g:1417:1: ( rule__ScenarioOutline__StepsAssignment_5 ) // InternalCucumber.g:1417:2: rule__ScenarioOutline__StepsAssignment_5 { pushFollow(FOLLOW_14); rule__ScenarioOutline__StepsAssignment_5(); state._fsp--; } after(grammarAccess.getScenarioOutlineAccess().getStepsAssignment_5()); } // InternalCucumber.g:1420:1: ( ( rule__ScenarioOutline__StepsAssignment_5 )* ) // InternalCucumber.g:1421:1: ( rule__ScenarioOutline__StepsAssignment_5 )* { before(grammarAccess.getScenarioOutlineAccess().getStepsAssignment_5()); // InternalCucumber.g:1422:1: ( rule__ScenarioOutline__StepsAssignment_5 )* loop27: do { int alt27=2; int LA27_0 = input.LA(1); if ( (LA27_0==RULE_STEP_KEYWORD) ) { alt27=1; } switch (alt27) { case 1 : // InternalCucumber.g:1422:2: rule__ScenarioOutline__StepsAssignment_5 { pushFollow(FOLLOW_14); rule__ScenarioOutline__StepsAssignment_5(); state._fsp--; } break; default : break loop27; } } while (true); after(grammarAccess.getScenarioOutlineAccess().getStepsAssignment_5()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__5__Impl" // $ANTLR start "rule__ScenarioOutline__Group__6" // InternalCucumber.g:1433:1: rule__ScenarioOutline__Group__6 : rule__ScenarioOutline__Group__6__Impl ; public final void rule__ScenarioOutline__Group__6() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1437:1: ( rule__ScenarioOutline__Group__6__Impl ) // InternalCucumber.g:1438:2: rule__ScenarioOutline__Group__6__Impl { pushFollow(FOLLOW_2); rule__ScenarioOutline__Group__6__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__6" // $ANTLR start "rule__ScenarioOutline__Group__6__Impl" // InternalCucumber.g:1444:1: rule__ScenarioOutline__Group__6__Impl : ( ( rule__ScenarioOutline__ExamplesAssignment_6 ) ) ; public final void rule__ScenarioOutline__Group__6__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1448:1: ( ( ( rule__ScenarioOutline__ExamplesAssignment_6 ) ) ) // InternalCucumber.g:1449:1: ( ( rule__ScenarioOutline__ExamplesAssignment_6 ) ) { // InternalCucumber.g:1449:1: ( ( rule__ScenarioOutline__ExamplesAssignment_6 ) ) // InternalCucumber.g:1450:1: ( rule__ScenarioOutline__ExamplesAssignment_6 ) { before(grammarAccess.getScenarioOutlineAccess().getExamplesAssignment_6()); // InternalCucumber.g:1451:1: ( rule__ScenarioOutline__ExamplesAssignment_6 ) // InternalCucumber.g:1451:2: rule__ScenarioOutline__ExamplesAssignment_6 { pushFollow(FOLLOW_2); rule__ScenarioOutline__ExamplesAssignment_6(); state._fsp--; } after(grammarAccess.getScenarioOutlineAccess().getExamplesAssignment_6()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__Group__6__Impl" // $ANTLR start "rule__Step__Group__0" // InternalCucumber.g:1475:1: rule__Step__Group__0 : rule__Step__Group__0__Impl rule__Step__Group__1 ; public final void rule__Step__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1479:1: ( rule__Step__Group__0__Impl rule__Step__Group__1 ) // InternalCucumber.g:1480:2: rule__Step__Group__0__Impl rule__Step__Group__1 { pushFollow(FOLLOW_17); rule__Step__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__0" // $ANTLR start "rule__Step__Group__0__Impl" // InternalCucumber.g:1487:1: rule__Step__Group__0__Impl : ( RULE_STEP_KEYWORD ) ; public final void rule__Step__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1491:1: ( ( RULE_STEP_KEYWORD ) ) // InternalCucumber.g:1492:1: ( RULE_STEP_KEYWORD ) { // InternalCucumber.g:1492:1: ( RULE_STEP_KEYWORD ) // InternalCucumber.g:1493:1: RULE_STEP_KEYWORD { before(grammarAccess.getStepAccess().getSTEP_KEYWORDTerminalRuleCall_0()); match(input,RULE_STEP_KEYWORD,FOLLOW_2); after(grammarAccess.getStepAccess().getSTEP_KEYWORDTerminalRuleCall_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__0__Impl" // $ANTLR start "rule__Step__Group__1" // InternalCucumber.g:1504:1: rule__Step__Group__1 : rule__Step__Group__1__Impl rule__Step__Group__2 ; public final void rule__Step__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1508:1: ( rule__Step__Group__1__Impl rule__Step__Group__2 ) // InternalCucumber.g:1509:2: rule__Step__Group__1__Impl rule__Step__Group__2 { pushFollow(FOLLOW_18); rule__Step__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__1" // $ANTLR start "rule__Step__Group__1__Impl" // InternalCucumber.g:1516:1: rule__Step__Group__1__Impl : ( ( rule__Step__DescriptionAssignment_1 ) ) ; public final void rule__Step__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1520:1: ( ( ( rule__Step__DescriptionAssignment_1 ) ) ) // InternalCucumber.g:1521:1: ( ( rule__Step__DescriptionAssignment_1 ) ) { // InternalCucumber.g:1521:1: ( ( rule__Step__DescriptionAssignment_1 ) ) // InternalCucumber.g:1522:1: ( rule__Step__DescriptionAssignment_1 ) { before(grammarAccess.getStepAccess().getDescriptionAssignment_1()); // InternalCucumber.g:1523:1: ( rule__Step__DescriptionAssignment_1 ) // InternalCucumber.g:1523:2: rule__Step__DescriptionAssignment_1 { pushFollow(FOLLOW_2); rule__Step__DescriptionAssignment_1(); state._fsp--; } after(grammarAccess.getStepAccess().getDescriptionAssignment_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__1__Impl" // $ANTLR start "rule__Step__Group__2" // InternalCucumber.g:1533:1: rule__Step__Group__2 : rule__Step__Group__2__Impl rule__Step__Group__3 ; public final void rule__Step__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1537:1: ( rule__Step__Group__2__Impl rule__Step__Group__3 ) // InternalCucumber.g:1538:2: rule__Step__Group__2__Impl rule__Step__Group__3 { pushFollow(FOLLOW_18); rule__Step__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__2" // $ANTLR start "rule__Step__Group__2__Impl" // InternalCucumber.g:1545:1: rule__Step__Group__2__Impl : ( ( RULE_EOL )* ) ; public final void rule__Step__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1549:1: ( ( ( RULE_EOL )* ) ) // InternalCucumber.g:1550:1: ( ( RULE_EOL )* ) { // InternalCucumber.g:1550:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1551:1: ( RULE_EOL )* { before(grammarAccess.getStepAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:1552:1: ( RULE_EOL )* loop28: do { int alt28=2; int LA28_0 = input.LA(1); if ( (LA28_0==RULE_EOL) ) { alt28=1; } switch (alt28) { case 1 : // InternalCucumber.g:1552:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop28; } } while (true); after(grammarAccess.getStepAccess().getEOLTerminalRuleCall_2()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__2__Impl" // $ANTLR start "rule__Step__Group__3" // InternalCucumber.g:1562:1: rule__Step__Group__3 : rule__Step__Group__3__Impl rule__Step__Group__4 ; public final void rule__Step__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1566:1: ( rule__Step__Group__3__Impl rule__Step__Group__4 ) // InternalCucumber.g:1567:2: rule__Step__Group__3__Impl rule__Step__Group__4 { pushFollow(FOLLOW_18); rule__Step__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__3" // $ANTLR start "rule__Step__Group__3__Impl" // InternalCucumber.g:1574:1: rule__Step__Group__3__Impl : ( ( rule__Step__TablesAssignment_3 )* ) ; public final void rule__Step__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1578:1: ( ( ( rule__Step__TablesAssignment_3 )* ) ) // InternalCucumber.g:1579:1: ( ( rule__Step__TablesAssignment_3 )* ) { // InternalCucumber.g:1579:1: ( ( rule__Step__TablesAssignment_3 )* ) // InternalCucumber.g:1580:1: ( rule__Step__TablesAssignment_3 )* { before(grammarAccess.getStepAccess().getTablesAssignment_3()); // InternalCucumber.g:1581:1: ( rule__Step__TablesAssignment_3 )* loop29: do { int alt29=2; int LA29_0 = input.LA(1); if ( (LA29_0==RULE_TABLE_ROW) ) { alt29=1; } switch (alt29) { case 1 : // InternalCucumber.g:1581:2: rule__Step__TablesAssignment_3 { pushFollow(FOLLOW_19); rule__Step__TablesAssignment_3(); state._fsp--; } break; default : break loop29; } } while (true); after(grammarAccess.getStepAccess().getTablesAssignment_3()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__3__Impl" // $ANTLR start "rule__Step__Group__4" // InternalCucumber.g:1591:1: rule__Step__Group__4 : rule__Step__Group__4__Impl rule__Step__Group__5 ; public final void rule__Step__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1595:1: ( rule__Step__Group__4__Impl rule__Step__Group__5 ) // InternalCucumber.g:1596:2: rule__Step__Group__4__Impl rule__Step__Group__5 { pushFollow(FOLLOW_18); rule__Step__Group__4__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Step__Group__5(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__4" // $ANTLR start "rule__Step__Group__4__Impl" // InternalCucumber.g:1603:1: rule__Step__Group__4__Impl : ( ( rule__Step__CodeAssignment_4 )? ) ; public final void rule__Step__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1607:1: ( ( ( rule__Step__CodeAssignment_4 )? ) ) // InternalCucumber.g:1608:1: ( ( rule__Step__CodeAssignment_4 )? ) { // InternalCucumber.g:1608:1: ( ( rule__Step__CodeAssignment_4 )? ) // InternalCucumber.g:1609:1: ( rule__Step__CodeAssignment_4 )? { before(grammarAccess.getStepAccess().getCodeAssignment_4()); // InternalCucumber.g:1610:1: ( rule__Step__CodeAssignment_4 )? int alt30=2; int LA30_0 = input.LA(1); if ( (LA30_0==RULE_DOC_STRING) ) { alt30=1; } switch (alt30) { case 1 : // InternalCucumber.g:1610:2: rule__Step__CodeAssignment_4 { pushFollow(FOLLOW_2); rule__Step__CodeAssignment_4(); state._fsp--; } break; } after(grammarAccess.getStepAccess().getCodeAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__4__Impl" // $ANTLR start "rule__Step__Group__5" // InternalCucumber.g:1620:1: rule__Step__Group__5 : rule__Step__Group__5__Impl ; public final void rule__Step__Group__5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1624:1: ( rule__Step__Group__5__Impl ) // InternalCucumber.g:1625:2: rule__Step__Group__5__Impl { pushFollow(FOLLOW_2); rule__Step__Group__5__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__5" // $ANTLR start "rule__Step__Group__5__Impl" // InternalCucumber.g:1631:1: rule__Step__Group__5__Impl : ( ( rule__Step__TablesAssignment_5 )* ) ; public final void rule__Step__Group__5__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1635:1: ( ( ( rule__Step__TablesAssignment_5 )* ) ) // InternalCucumber.g:1636:1: ( ( rule__Step__TablesAssignment_5 )* ) { // InternalCucumber.g:1636:1: ( ( rule__Step__TablesAssignment_5 )* ) // InternalCucumber.g:1637:1: ( rule__Step__TablesAssignment_5 )* { before(grammarAccess.getStepAccess().getTablesAssignment_5()); // InternalCucumber.g:1638:1: ( rule__Step__TablesAssignment_5 )* loop31: do { int alt31=2; int LA31_0 = input.LA(1); if ( (LA31_0==RULE_TABLE_ROW) ) { alt31=1; } switch (alt31) { case 1 : // InternalCucumber.g:1638:2: rule__Step__TablesAssignment_5 { pushFollow(FOLLOW_19); rule__Step__TablesAssignment_5(); state._fsp--; } break; default : break loop31; } } while (true); after(grammarAccess.getStepAccess().getTablesAssignment_5()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__Group__5__Impl" // $ANTLR start "rule__Examples__Group__0" // InternalCucumber.g:1660:1: rule__Examples__Group__0 : rule__Examples__Group__0__Impl rule__Examples__Group__1 ; public final void rule__Examples__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1664:1: ( rule__Examples__Group__0__Impl rule__Examples__Group__1 ) // InternalCucumber.g:1665:2: rule__Examples__Group__0__Impl rule__Examples__Group__1 { pushFollow(FOLLOW_12); rule__Examples__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Examples__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__0" // $ANTLR start "rule__Examples__Group__0__Impl" // InternalCucumber.g:1672:1: rule__Examples__Group__0__Impl : ( 'Examples:' ) ; public final void rule__Examples__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1676:1: ( ( 'Examples:' ) ) // InternalCucumber.g:1677:1: ( 'Examples:' ) { // InternalCucumber.g:1677:1: ( 'Examples:' ) // InternalCucumber.g:1678:1: 'Examples:' { before(grammarAccess.getExamplesAccess().getExamplesKeyword_0()); match(input,20,FOLLOW_2); after(grammarAccess.getExamplesAccess().getExamplesKeyword_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__0__Impl" // $ANTLR start "rule__Examples__Group__1" // InternalCucumber.g:1691:1: rule__Examples__Group__1 : rule__Examples__Group__1__Impl rule__Examples__Group__2 ; public final void rule__Examples__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1695:1: ( rule__Examples__Group__1__Impl rule__Examples__Group__2 ) // InternalCucumber.g:1696:2: rule__Examples__Group__1__Impl rule__Examples__Group__2 { pushFollow(FOLLOW_12); rule__Examples__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Examples__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__1" // $ANTLR start "rule__Examples__Group__1__Impl" // InternalCucumber.g:1703:1: rule__Examples__Group__1__Impl : ( ( rule__Examples__TitleAssignment_1 )? ) ; public final void rule__Examples__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1707:1: ( ( ( rule__Examples__TitleAssignment_1 )? ) ) // InternalCucumber.g:1708:1: ( ( rule__Examples__TitleAssignment_1 )? ) { // InternalCucumber.g:1708:1: ( ( rule__Examples__TitleAssignment_1 )? ) // InternalCucumber.g:1709:1: ( rule__Examples__TitleAssignment_1 )? { before(grammarAccess.getExamplesAccess().getTitleAssignment_1()); // InternalCucumber.g:1710:1: ( rule__Examples__TitleAssignment_1 )? int alt32=2; int LA32_0 = input.LA(1); if ( ((LA32_0>=RULE_WORD && LA32_0<=RULE_PLACEHOLDER)) ) { alt32=1; } switch (alt32) { case 1 : // InternalCucumber.g:1710:2: rule__Examples__TitleAssignment_1 { pushFollow(FOLLOW_2); rule__Examples__TitleAssignment_1(); state._fsp--; } break; } after(grammarAccess.getExamplesAccess().getTitleAssignment_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__1__Impl" // $ANTLR start "rule__Examples__Group__2" // InternalCucumber.g:1720:1: rule__Examples__Group__2 : rule__Examples__Group__2__Impl rule__Examples__Group__3 ; public final void rule__Examples__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1724:1: ( rule__Examples__Group__2__Impl rule__Examples__Group__3 ) // InternalCucumber.g:1725:2: rule__Examples__Group__2__Impl rule__Examples__Group__3 { pushFollow(FOLLOW_20); rule__Examples__Group__2__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Examples__Group__3(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__2" // $ANTLR start "rule__Examples__Group__2__Impl" // InternalCucumber.g:1732:1: rule__Examples__Group__2__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Examples__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1736:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:1737:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:1737:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:1738:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:1738:1: ( ( RULE_EOL ) ) // InternalCucumber.g:1739:1: ( RULE_EOL ) { before(grammarAccess.getExamplesAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:1740:1: ( RULE_EOL ) // InternalCucumber.g:1740:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getExamplesAccess().getEOLTerminalRuleCall_2()); } // InternalCucumber.g:1743:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1744:1: ( RULE_EOL )* { before(grammarAccess.getExamplesAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:1745:1: ( RULE_EOL )* loop33: do { int alt33=2; int LA33_0 = input.LA(1); if ( (LA33_0==RULE_EOL) ) { alt33=1; } switch (alt33) { case 1 : // InternalCucumber.g:1745:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop33; } } while (true); after(grammarAccess.getExamplesAccess().getEOLTerminalRuleCall_2()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__2__Impl" // $ANTLR start "rule__Examples__Group__3" // InternalCucumber.g:1756:1: rule__Examples__Group__3 : rule__Examples__Group__3__Impl rule__Examples__Group__4 ; public final void rule__Examples__Group__3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1760:1: ( rule__Examples__Group__3__Impl rule__Examples__Group__4 ) // InternalCucumber.g:1761:2: rule__Examples__Group__3__Impl rule__Examples__Group__4 { pushFollow(FOLLOW_20); rule__Examples__Group__3__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Examples__Group__4(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__3" // $ANTLR start "rule__Examples__Group__3__Impl" // InternalCucumber.g:1768:1: rule__Examples__Group__3__Impl : ( ( rule__Examples__NarrativeAssignment_3 )? ) ; public final void rule__Examples__Group__3__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1772:1: ( ( ( rule__Examples__NarrativeAssignment_3 )? ) ) // InternalCucumber.g:1773:1: ( ( rule__Examples__NarrativeAssignment_3 )? ) { // InternalCucumber.g:1773:1: ( ( rule__Examples__NarrativeAssignment_3 )? ) // InternalCucumber.g:1774:1: ( rule__Examples__NarrativeAssignment_3 )? { before(grammarAccess.getExamplesAccess().getNarrativeAssignment_3()); // InternalCucumber.g:1775:1: ( rule__Examples__NarrativeAssignment_3 )? int alt34=2; int LA34_0 = input.LA(1); if ( ((LA34_0>=RULE_WORD && LA34_0<=RULE_PLACEHOLDER)) ) { alt34=1; } switch (alt34) { case 1 : // InternalCucumber.g:1775:2: rule__Examples__NarrativeAssignment_3 { pushFollow(FOLLOW_2); rule__Examples__NarrativeAssignment_3(); state._fsp--; } break; } after(grammarAccess.getExamplesAccess().getNarrativeAssignment_3()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__3__Impl" // $ANTLR start "rule__Examples__Group__4" // InternalCucumber.g:1785:1: rule__Examples__Group__4 : rule__Examples__Group__4__Impl ; public final void rule__Examples__Group__4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1789:1: ( rule__Examples__Group__4__Impl ) // InternalCucumber.g:1790:2: rule__Examples__Group__4__Impl { pushFollow(FOLLOW_2); rule__Examples__Group__4__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__4" // $ANTLR start "rule__Examples__Group__4__Impl" // InternalCucumber.g:1796:1: rule__Examples__Group__4__Impl : ( ( rule__Examples__TableAssignment_4 ) ) ; public final void rule__Examples__Group__4__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1800:1: ( ( ( rule__Examples__TableAssignment_4 ) ) ) // InternalCucumber.g:1801:1: ( ( rule__Examples__TableAssignment_4 ) ) { // InternalCucumber.g:1801:1: ( ( rule__Examples__TableAssignment_4 ) ) // InternalCucumber.g:1802:1: ( rule__Examples__TableAssignment_4 ) { before(grammarAccess.getExamplesAccess().getTableAssignment_4()); // InternalCucumber.g:1803:1: ( rule__Examples__TableAssignment_4 ) // InternalCucumber.g:1803:2: rule__Examples__TableAssignment_4 { pushFollow(FOLLOW_2); rule__Examples__TableAssignment_4(); state._fsp--; } after(grammarAccess.getExamplesAccess().getTableAssignment_4()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__Group__4__Impl" // $ANTLR start "rule__Table__Group__0" // InternalCucumber.g:1823:1: rule__Table__Group__0 : rule__Table__Group__0__Impl rule__Table__Group__1 ; public final void rule__Table__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1827:1: ( rule__Table__Group__0__Impl rule__Table__Group__1 ) // InternalCucumber.g:1828:2: rule__Table__Group__0__Impl rule__Table__Group__1 { pushFollow(FOLLOW_8); rule__Table__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Table__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__Group__0" // $ANTLR start "rule__Table__Group__0__Impl" // InternalCucumber.g:1835:1: rule__Table__Group__0__Impl : ( ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) ) ; public final void rule__Table__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1839:1: ( ( ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) ) ) // InternalCucumber.g:1840:1: ( ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) ) { // InternalCucumber.g:1840:1: ( ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) ) // InternalCucumber.g:1841:1: ( ( rule__Table__RowsAssignment_0 ) ) ( ( rule__Table__RowsAssignment_0 )* ) { // InternalCucumber.g:1841:1: ( ( rule__Table__RowsAssignment_0 ) ) // InternalCucumber.g:1842:1: ( rule__Table__RowsAssignment_0 ) { before(grammarAccess.getTableAccess().getRowsAssignment_0()); // InternalCucumber.g:1843:1: ( rule__Table__RowsAssignment_0 ) // InternalCucumber.g:1843:2: rule__Table__RowsAssignment_0 { pushFollow(FOLLOW_19); rule__Table__RowsAssignment_0(); state._fsp--; } after(grammarAccess.getTableAccess().getRowsAssignment_0()); } // InternalCucumber.g:1846:1: ( ( rule__Table__RowsAssignment_0 )* ) // InternalCucumber.g:1847:1: ( rule__Table__RowsAssignment_0 )* { before(grammarAccess.getTableAccess().getRowsAssignment_0()); // InternalCucumber.g:1848:1: ( rule__Table__RowsAssignment_0 )* loop35: do { int alt35=2; int LA35_0 = input.LA(1); if ( (LA35_0==RULE_TABLE_ROW) ) { alt35=1; } switch (alt35) { case 1 : // InternalCucumber.g:1848:2: rule__Table__RowsAssignment_0 { pushFollow(FOLLOW_19); rule__Table__RowsAssignment_0(); state._fsp--; } break; default : break loop35; } } while (true); after(grammarAccess.getTableAccess().getRowsAssignment_0()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__Group__0__Impl" // $ANTLR start "rule__Table__Group__1" // InternalCucumber.g:1859:1: rule__Table__Group__1 : rule__Table__Group__1__Impl ; public final void rule__Table__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1863:1: ( rule__Table__Group__1__Impl ) // InternalCucumber.g:1864:2: rule__Table__Group__1__Impl { pushFollow(FOLLOW_2); rule__Table__Group__1__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__Group__1" // $ANTLR start "rule__Table__Group__1__Impl" // InternalCucumber.g:1870:1: rule__Table__Group__1__Impl : ( ( RULE_EOL )* ) ; public final void rule__Table__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1874:1: ( ( ( RULE_EOL )* ) ) // InternalCucumber.g:1875:1: ( ( RULE_EOL )* ) { // InternalCucumber.g:1875:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1876:1: ( RULE_EOL )* { before(grammarAccess.getTableAccess().getEOLTerminalRuleCall_1()); // InternalCucumber.g:1877:1: ( RULE_EOL )* loop36: do { int alt36=2; int LA36_0 = input.LA(1); if ( (LA36_0==RULE_EOL) ) { alt36=1; } switch (alt36) { case 1 : // InternalCucumber.g:1877:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop36; } } while (true); after(grammarAccess.getTableAccess().getEOLTerminalRuleCall_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__Group__1__Impl" // $ANTLR start "rule__DocString__Group__0" // InternalCucumber.g:1891:1: rule__DocString__Group__0 : rule__DocString__Group__0__Impl rule__DocString__Group__1 ; public final void rule__DocString__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1895:1: ( rule__DocString__Group__0__Impl rule__DocString__Group__1 ) // InternalCucumber.g:1896:2: rule__DocString__Group__0__Impl rule__DocString__Group__1 { pushFollow(FOLLOW_8); rule__DocString__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__DocString__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__Group__0" // $ANTLR start "rule__DocString__Group__0__Impl" // InternalCucumber.g:1903:1: rule__DocString__Group__0__Impl : ( ( rule__DocString__ContentAssignment_0 ) ) ; public final void rule__DocString__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1907:1: ( ( ( rule__DocString__ContentAssignment_0 ) ) ) // InternalCucumber.g:1908:1: ( ( rule__DocString__ContentAssignment_0 ) ) { // InternalCucumber.g:1908:1: ( ( rule__DocString__ContentAssignment_0 ) ) // InternalCucumber.g:1909:1: ( rule__DocString__ContentAssignment_0 ) { before(grammarAccess.getDocStringAccess().getContentAssignment_0()); // InternalCucumber.g:1910:1: ( rule__DocString__ContentAssignment_0 ) // InternalCucumber.g:1910:2: rule__DocString__ContentAssignment_0 { pushFollow(FOLLOW_2); rule__DocString__ContentAssignment_0(); state._fsp--; } after(grammarAccess.getDocStringAccess().getContentAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__Group__0__Impl" // $ANTLR start "rule__DocString__Group__1" // InternalCucumber.g:1920:1: rule__DocString__Group__1 : rule__DocString__Group__1__Impl ; public final void rule__DocString__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1924:1: ( rule__DocString__Group__1__Impl ) // InternalCucumber.g:1925:2: rule__DocString__Group__1__Impl { pushFollow(FOLLOW_2); rule__DocString__Group__1__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__Group__1" // $ANTLR start "rule__DocString__Group__1__Impl" // InternalCucumber.g:1931:1: rule__DocString__Group__1__Impl : ( ( RULE_EOL )* ) ; public final void rule__DocString__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1935:1: ( ( ( RULE_EOL )* ) ) // InternalCucumber.g:1936:1: ( ( RULE_EOL )* ) { // InternalCucumber.g:1936:1: ( ( RULE_EOL )* ) // InternalCucumber.g:1937:1: ( RULE_EOL )* { before(grammarAccess.getDocStringAccess().getEOLTerminalRuleCall_1()); // InternalCucumber.g:1938:1: ( RULE_EOL )* loop37: do { int alt37=2; int LA37_0 = input.LA(1); if ( (LA37_0==RULE_EOL) ) { alt37=1; } switch (alt37) { case 1 : // InternalCucumber.g:1938:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop37; } } while (true); after(grammarAccess.getDocStringAccess().getEOLTerminalRuleCall_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__Group__1__Impl" // $ANTLR start "rule__Title__Group__0" // InternalCucumber.g:1952:1: rule__Title__Group__0 : rule__Title__Group__0__Impl rule__Title__Group__1 ; public final void rule__Title__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1956:1: ( rule__Title__Group__0__Impl rule__Title__Group__1 ) // InternalCucumber.g:1957:2: rule__Title__Group__0__Impl rule__Title__Group__1 { pushFollow(FOLLOW_17); rule__Title__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Title__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Group__0" // $ANTLR start "rule__Title__Group__0__Impl" // InternalCucumber.g:1964:1: rule__Title__Group__0__Impl : ( ( rule__Title__Alternatives_0 ) ) ; public final void rule__Title__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1968:1: ( ( ( rule__Title__Alternatives_0 ) ) ) // InternalCucumber.g:1969:1: ( ( rule__Title__Alternatives_0 ) ) { // InternalCucumber.g:1969:1: ( ( rule__Title__Alternatives_0 ) ) // InternalCucumber.g:1970:1: ( rule__Title__Alternatives_0 ) { before(grammarAccess.getTitleAccess().getAlternatives_0()); // InternalCucumber.g:1971:1: ( rule__Title__Alternatives_0 ) // InternalCucumber.g:1971:2: rule__Title__Alternatives_0 { pushFollow(FOLLOW_2); rule__Title__Alternatives_0(); state._fsp--; } after(grammarAccess.getTitleAccess().getAlternatives_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Group__0__Impl" // $ANTLR start "rule__Title__Group__1" // InternalCucumber.g:1981:1: rule__Title__Group__1 : rule__Title__Group__1__Impl ; public final void rule__Title__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1985:1: ( rule__Title__Group__1__Impl ) // InternalCucumber.g:1986:2: rule__Title__Group__1__Impl { pushFollow(FOLLOW_2); rule__Title__Group__1__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Group__1" // $ANTLR start "rule__Title__Group__1__Impl" // InternalCucumber.g:1992:1: rule__Title__Group__1__Impl : ( ( rule__Title__Alternatives_1 )* ) ; public final void rule__Title__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:1996:1: ( ( ( rule__Title__Alternatives_1 )* ) ) // InternalCucumber.g:1997:1: ( ( rule__Title__Alternatives_1 )* ) { // InternalCucumber.g:1997:1: ( ( rule__Title__Alternatives_1 )* ) // InternalCucumber.g:1998:1: ( rule__Title__Alternatives_1 )* { before(grammarAccess.getTitleAccess().getAlternatives_1()); // InternalCucumber.g:1999:1: ( rule__Title__Alternatives_1 )* loop38: do { int alt38=2; int LA38_0 = input.LA(1); if ( ((LA38_0>=RULE_WORD && LA38_0<=RULE_TAGNAME)) ) { alt38=1; } switch (alt38) { case 1 : // InternalCucumber.g:1999:2: rule__Title__Alternatives_1 { pushFollow(FOLLOW_4); rule__Title__Alternatives_1(); state._fsp--; } break; default : break loop38; } } while (true); after(grammarAccess.getTitleAccess().getAlternatives_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Title__Group__1__Impl" // $ANTLR start "rule__Narrative__Group__0" // InternalCucumber.g:2013:1: rule__Narrative__Group__0 : rule__Narrative__Group__0__Impl rule__Narrative__Group__1 ; public final void rule__Narrative__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2017:1: ( rule__Narrative__Group__0__Impl rule__Narrative__Group__1 ) // InternalCucumber.g:2018:2: rule__Narrative__Group__0__Impl rule__Narrative__Group__1 { pushFollow(FOLLOW_21); rule__Narrative__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Narrative__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__0" // $ANTLR start "rule__Narrative__Group__0__Impl" // InternalCucumber.g:2025:1: rule__Narrative__Group__0__Impl : ( ( rule__Narrative__Alternatives_0 ) ) ; public final void rule__Narrative__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2029:1: ( ( ( rule__Narrative__Alternatives_0 ) ) ) // InternalCucumber.g:2030:1: ( ( rule__Narrative__Alternatives_0 ) ) { // InternalCucumber.g:2030:1: ( ( rule__Narrative__Alternatives_0 ) ) // InternalCucumber.g:2031:1: ( rule__Narrative__Alternatives_0 ) { before(grammarAccess.getNarrativeAccess().getAlternatives_0()); // InternalCucumber.g:2032:1: ( rule__Narrative__Alternatives_0 ) // InternalCucumber.g:2032:2: rule__Narrative__Alternatives_0 { pushFollow(FOLLOW_2); rule__Narrative__Alternatives_0(); state._fsp--; } after(grammarAccess.getNarrativeAccess().getAlternatives_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__0__Impl" // $ANTLR start "rule__Narrative__Group__1" // InternalCucumber.g:2042:1: rule__Narrative__Group__1 : rule__Narrative__Group__1__Impl rule__Narrative__Group__2 ; public final void rule__Narrative__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2046:1: ( rule__Narrative__Group__1__Impl rule__Narrative__Group__2 ) // InternalCucumber.g:2047:2: rule__Narrative__Group__1__Impl rule__Narrative__Group__2 { pushFollow(FOLLOW_21); rule__Narrative__Group__1__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Narrative__Group__2(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__1" // $ANTLR start "rule__Narrative__Group__1__Impl" // InternalCucumber.g:2054:1: rule__Narrative__Group__1__Impl : ( ( rule__Narrative__Alternatives_1 )* ) ; public final void rule__Narrative__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2058:1: ( ( ( rule__Narrative__Alternatives_1 )* ) ) // InternalCucumber.g:2059:1: ( ( rule__Narrative__Alternatives_1 )* ) { // InternalCucumber.g:2059:1: ( ( rule__Narrative__Alternatives_1 )* ) // InternalCucumber.g:2060:1: ( rule__Narrative__Alternatives_1 )* { before(grammarAccess.getNarrativeAccess().getAlternatives_1()); // InternalCucumber.g:2061:1: ( rule__Narrative__Alternatives_1 )* loop39: do { int alt39=2; int LA39_0 = input.LA(1); if ( ((LA39_0>=RULE_WORD && LA39_0<=RULE_TAGNAME)) ) { alt39=1; } switch (alt39) { case 1 : // InternalCucumber.g:2061:2: rule__Narrative__Alternatives_1 { pushFollow(FOLLOW_4); rule__Narrative__Alternatives_1(); state._fsp--; } break; default : break loop39; } } while (true); after(grammarAccess.getNarrativeAccess().getAlternatives_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__1__Impl" // $ANTLR start "rule__Narrative__Group__2" // InternalCucumber.g:2071:1: rule__Narrative__Group__2 : rule__Narrative__Group__2__Impl ; public final void rule__Narrative__Group__2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2075:1: ( rule__Narrative__Group__2__Impl ) // InternalCucumber.g:2076:2: rule__Narrative__Group__2__Impl { pushFollow(FOLLOW_2); rule__Narrative__Group__2__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__2" // $ANTLR start "rule__Narrative__Group__2__Impl" // InternalCucumber.g:2082:1: rule__Narrative__Group__2__Impl : ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ; public final void rule__Narrative__Group__2__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2086:1: ( ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) ) // InternalCucumber.g:2087:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) { // InternalCucumber.g:2087:1: ( ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) ) // InternalCucumber.g:2088:1: ( ( RULE_EOL ) ) ( ( RULE_EOL )* ) { // InternalCucumber.g:2088:1: ( ( RULE_EOL ) ) // InternalCucumber.g:2089:1: ( RULE_EOL ) { before(grammarAccess.getNarrativeAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:2090:1: ( RULE_EOL ) // InternalCucumber.g:2090:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } after(grammarAccess.getNarrativeAccess().getEOLTerminalRuleCall_2()); } // InternalCucumber.g:2093:1: ( ( RULE_EOL )* ) // InternalCucumber.g:2094:1: ( RULE_EOL )* { before(grammarAccess.getNarrativeAccess().getEOLTerminalRuleCall_2()); // InternalCucumber.g:2095:1: ( RULE_EOL )* loop40: do { int alt40=2; int LA40_0 = input.LA(1); if ( (LA40_0==RULE_EOL) ) { alt40=1; } switch (alt40) { case 1 : // InternalCucumber.g:2095:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_10); } break; default : break loop40; } } while (true); after(grammarAccess.getNarrativeAccess().getEOLTerminalRuleCall_2()); } } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Narrative__Group__2__Impl" // $ANTLR start "rule__Tag__Group__0" // InternalCucumber.g:2112:1: rule__Tag__Group__0 : rule__Tag__Group__0__Impl rule__Tag__Group__1 ; public final void rule__Tag__Group__0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2116:1: ( rule__Tag__Group__0__Impl rule__Tag__Group__1 ) // InternalCucumber.g:2117:2: rule__Tag__Group__0__Impl rule__Tag__Group__1 { pushFollow(FOLLOW_8); rule__Tag__Group__0__Impl(); state._fsp--; pushFollow(FOLLOW_2); rule__Tag__Group__1(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__Group__0" // $ANTLR start "rule__Tag__Group__0__Impl" // InternalCucumber.g:2124:1: rule__Tag__Group__0__Impl : ( ( rule__Tag__IdAssignment_0 ) ) ; public final void rule__Tag__Group__0__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2128:1: ( ( ( rule__Tag__IdAssignment_0 ) ) ) // InternalCucumber.g:2129:1: ( ( rule__Tag__IdAssignment_0 ) ) { // InternalCucumber.g:2129:1: ( ( rule__Tag__IdAssignment_0 ) ) // InternalCucumber.g:2130:1: ( rule__Tag__IdAssignment_0 ) { before(grammarAccess.getTagAccess().getIdAssignment_0()); // InternalCucumber.g:2131:1: ( rule__Tag__IdAssignment_0 ) // InternalCucumber.g:2131:2: rule__Tag__IdAssignment_0 { pushFollow(FOLLOW_2); rule__Tag__IdAssignment_0(); state._fsp--; } after(grammarAccess.getTagAccess().getIdAssignment_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__Group__0__Impl" // $ANTLR start "rule__Tag__Group__1" // InternalCucumber.g:2141:1: rule__Tag__Group__1 : rule__Tag__Group__1__Impl ; public final void rule__Tag__Group__1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2145:1: ( rule__Tag__Group__1__Impl ) // InternalCucumber.g:2146:2: rule__Tag__Group__1__Impl { pushFollow(FOLLOW_2); rule__Tag__Group__1__Impl(); state._fsp--; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__Group__1" // $ANTLR start "rule__Tag__Group__1__Impl" // InternalCucumber.g:2152:1: rule__Tag__Group__1__Impl : ( ( RULE_EOL )? ) ; public final void rule__Tag__Group__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2156:1: ( ( ( RULE_EOL )? ) ) // InternalCucumber.g:2157:1: ( ( RULE_EOL )? ) { // InternalCucumber.g:2157:1: ( ( RULE_EOL )? ) // InternalCucumber.g:2158:1: ( RULE_EOL )? { before(grammarAccess.getTagAccess().getEOLTerminalRuleCall_1()); // InternalCucumber.g:2159:1: ( RULE_EOL )? int alt41=2; int LA41_0 = input.LA(1); if ( (LA41_0==RULE_EOL) ) { alt41=1; } switch (alt41) { case 1 : // InternalCucumber.g:2159:3: RULE_EOL { match(input,RULE_EOL,FOLLOW_2); } break; } after(grammarAccess.getTagAccess().getEOLTerminalRuleCall_1()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__Group__1__Impl" // $ANTLR start "rule__Feature__TagsAssignment_0" // InternalCucumber.g:2174:1: rule__Feature__TagsAssignment_0 : ( ruleTag ) ; public final void rule__Feature__TagsAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2178:1: ( ( ruleTag ) ) // InternalCucumber.g:2179:1: ( ruleTag ) { // InternalCucumber.g:2179:1: ( ruleTag ) // InternalCucumber.g:2180:1: ruleTag { before(grammarAccess.getFeatureAccess().getTagsTagParserRuleCall_0_0()); pushFollow(FOLLOW_2); ruleTag(); state._fsp--; after(grammarAccess.getFeatureAccess().getTagsTagParserRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__TagsAssignment_0" // $ANTLR start "rule__Feature__TitleAssignment_2" // InternalCucumber.g:2189:1: rule__Feature__TitleAssignment_2 : ( ruleTitle ) ; public final void rule__Feature__TitleAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2193:1: ( ( ruleTitle ) ) // InternalCucumber.g:2194:1: ( ruleTitle ) { // InternalCucumber.g:2194:1: ( ruleTitle ) // InternalCucumber.g:2195:1: ruleTitle { before(grammarAccess.getFeatureAccess().getTitleTitleParserRuleCall_2_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getFeatureAccess().getTitleTitleParserRuleCall_2_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__TitleAssignment_2" // $ANTLR start "rule__Feature__NarrativeAssignment_4" // InternalCucumber.g:2204:1: rule__Feature__NarrativeAssignment_4 : ( ruleNarrative ) ; public final void rule__Feature__NarrativeAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2208:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2209:1: ( ruleNarrative ) { // InternalCucumber.g:2209:1: ( ruleNarrative ) // InternalCucumber.g:2210:1: ruleNarrative { before(grammarAccess.getFeatureAccess().getNarrativeNarrativeParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getFeatureAccess().getNarrativeNarrativeParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__NarrativeAssignment_4" // $ANTLR start "rule__Feature__BackgroundAssignment_5" // InternalCucumber.g:2219:1: rule__Feature__BackgroundAssignment_5 : ( ruleBackground ) ; public final void rule__Feature__BackgroundAssignment_5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2223:1: ( ( ruleBackground ) ) // InternalCucumber.g:2224:1: ( ruleBackground ) { // InternalCucumber.g:2224:1: ( ruleBackground ) // InternalCucumber.g:2225:1: ruleBackground { before(grammarAccess.getFeatureAccess().getBackgroundBackgroundParserRuleCall_5_0()); pushFollow(FOLLOW_2); ruleBackground(); state._fsp--; after(grammarAccess.getFeatureAccess().getBackgroundBackgroundParserRuleCall_5_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__BackgroundAssignment_5" // $ANTLR start "rule__Feature__ScenariosAssignment_6" // InternalCucumber.g:2234:1: rule__Feature__ScenariosAssignment_6 : ( ( rule__Feature__ScenariosAlternatives_6_0 ) ) ; public final void rule__Feature__ScenariosAssignment_6() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2238:1: ( ( ( rule__Feature__ScenariosAlternatives_6_0 ) ) ) // InternalCucumber.g:2239:1: ( ( rule__Feature__ScenariosAlternatives_6_0 ) ) { // InternalCucumber.g:2239:1: ( ( rule__Feature__ScenariosAlternatives_6_0 ) ) // InternalCucumber.g:2240:1: ( rule__Feature__ScenariosAlternatives_6_0 ) { before(grammarAccess.getFeatureAccess().getScenariosAlternatives_6_0()); // InternalCucumber.g:2241:1: ( rule__Feature__ScenariosAlternatives_6_0 ) // InternalCucumber.g:2241:2: rule__Feature__ScenariosAlternatives_6_0 { pushFollow(FOLLOW_2); rule__Feature__ScenariosAlternatives_6_0(); state._fsp--; } after(grammarAccess.getFeatureAccess().getScenariosAlternatives_6_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Feature__ScenariosAssignment_6" // $ANTLR start "rule__Background__TitleAssignment_1" // InternalCucumber.g:2250:1: rule__Background__TitleAssignment_1 : ( ruleTitle ) ; public final void rule__Background__TitleAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2254:1: ( ( ruleTitle ) ) // InternalCucumber.g:2255:1: ( ruleTitle ) { // InternalCucumber.g:2255:1: ( ruleTitle ) // InternalCucumber.g:2256:1: ruleTitle { before(grammarAccess.getBackgroundAccess().getTitleTitleParserRuleCall_1_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getBackgroundAccess().getTitleTitleParserRuleCall_1_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__TitleAssignment_1" // $ANTLR start "rule__Background__NarrativeAssignment_3" // InternalCucumber.g:2265:1: rule__Background__NarrativeAssignment_3 : ( ruleNarrative ) ; public final void rule__Background__NarrativeAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2269:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2270:1: ( ruleNarrative ) { // InternalCucumber.g:2270:1: ( ruleNarrative ) // InternalCucumber.g:2271:1: ruleNarrative { before(grammarAccess.getBackgroundAccess().getNarrativeNarrativeParserRuleCall_3_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getBackgroundAccess().getNarrativeNarrativeParserRuleCall_3_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__NarrativeAssignment_3" // $ANTLR start "rule__Background__StepsAssignment_4" // InternalCucumber.g:2280:1: rule__Background__StepsAssignment_4 : ( ruleStep ) ; public final void rule__Background__StepsAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2284:1: ( ( ruleStep ) ) // InternalCucumber.g:2285:1: ( ruleStep ) { // InternalCucumber.g:2285:1: ( ruleStep ) // InternalCucumber.g:2286:1: ruleStep { before(grammarAccess.getBackgroundAccess().getStepsStepParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleStep(); state._fsp--; after(grammarAccess.getBackgroundAccess().getStepsStepParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Background__StepsAssignment_4" // $ANTLR start "rule__Scenario__TagsAssignment_0" // InternalCucumber.g:2295:1: rule__Scenario__TagsAssignment_0 : ( ruleTag ) ; public final void rule__Scenario__TagsAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2299:1: ( ( ruleTag ) ) // InternalCucumber.g:2300:1: ( ruleTag ) { // InternalCucumber.g:2300:1: ( ruleTag ) // InternalCucumber.g:2301:1: ruleTag { before(grammarAccess.getScenarioAccess().getTagsTagParserRuleCall_0_0()); pushFollow(FOLLOW_2); ruleTag(); state._fsp--; after(grammarAccess.getScenarioAccess().getTagsTagParserRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__TagsAssignment_0" // $ANTLR start "rule__Scenario__TitleAssignment_2" // InternalCucumber.g:2310:1: rule__Scenario__TitleAssignment_2 : ( ruleTitle ) ; public final void rule__Scenario__TitleAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2314:1: ( ( ruleTitle ) ) // InternalCucumber.g:2315:1: ( ruleTitle ) { // InternalCucumber.g:2315:1: ( ruleTitle ) // InternalCucumber.g:2316:1: ruleTitle { before(grammarAccess.getScenarioAccess().getTitleTitleParserRuleCall_2_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getScenarioAccess().getTitleTitleParserRuleCall_2_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__TitleAssignment_2" // $ANTLR start "rule__Scenario__NarrativeAssignment_4" // InternalCucumber.g:2325:1: rule__Scenario__NarrativeAssignment_4 : ( ruleNarrative ) ; public final void rule__Scenario__NarrativeAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2329:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2330:1: ( ruleNarrative ) { // InternalCucumber.g:2330:1: ( ruleNarrative ) // InternalCucumber.g:2331:1: ruleNarrative { before(grammarAccess.getScenarioAccess().getNarrativeNarrativeParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getScenarioAccess().getNarrativeNarrativeParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__NarrativeAssignment_4" // $ANTLR start "rule__Scenario__StepsAssignment_5" // InternalCucumber.g:2340:1: rule__Scenario__StepsAssignment_5 : ( ruleStep ) ; public final void rule__Scenario__StepsAssignment_5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2344:1: ( ( ruleStep ) ) // InternalCucumber.g:2345:1: ( ruleStep ) { // InternalCucumber.g:2345:1: ( ruleStep ) // InternalCucumber.g:2346:1: ruleStep { before(grammarAccess.getScenarioAccess().getStepsStepParserRuleCall_5_0()); pushFollow(FOLLOW_2); ruleStep(); state._fsp--; after(grammarAccess.getScenarioAccess().getStepsStepParserRuleCall_5_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Scenario__StepsAssignment_5" // $ANTLR start "rule__ScenarioOutline__TagsAssignment_0" // InternalCucumber.g:2355:1: rule__ScenarioOutline__TagsAssignment_0 : ( ruleTag ) ; public final void rule__ScenarioOutline__TagsAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2359:1: ( ( ruleTag ) ) // InternalCucumber.g:2360:1: ( ruleTag ) { // InternalCucumber.g:2360:1: ( ruleTag ) // InternalCucumber.g:2361:1: ruleTag { before(grammarAccess.getScenarioOutlineAccess().getTagsTagParserRuleCall_0_0()); pushFollow(FOLLOW_2); ruleTag(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getTagsTagParserRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__TagsAssignment_0" // $ANTLR start "rule__ScenarioOutline__TitleAssignment_2" // InternalCucumber.g:2370:1: rule__ScenarioOutline__TitleAssignment_2 : ( ruleTitle ) ; public final void rule__ScenarioOutline__TitleAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2374:1: ( ( ruleTitle ) ) // InternalCucumber.g:2375:1: ( ruleTitle ) { // InternalCucumber.g:2375:1: ( ruleTitle ) // InternalCucumber.g:2376:1: ruleTitle { before(grammarAccess.getScenarioOutlineAccess().getTitleTitleParserRuleCall_2_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getTitleTitleParserRuleCall_2_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__TitleAssignment_2" // $ANTLR start "rule__ScenarioOutline__NarrativeAssignment_4" // InternalCucumber.g:2385:1: rule__ScenarioOutline__NarrativeAssignment_4 : ( ruleNarrative ) ; public final void rule__ScenarioOutline__NarrativeAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2389:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2390:1: ( ruleNarrative ) { // InternalCucumber.g:2390:1: ( ruleNarrative ) // InternalCucumber.g:2391:1: ruleNarrative { before(grammarAccess.getScenarioOutlineAccess().getNarrativeNarrativeParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getNarrativeNarrativeParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__NarrativeAssignment_4" // $ANTLR start "rule__ScenarioOutline__StepsAssignment_5" // InternalCucumber.g:2400:1: rule__ScenarioOutline__StepsAssignment_5 : ( ruleStep ) ; public final void rule__ScenarioOutline__StepsAssignment_5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2404:1: ( ( ruleStep ) ) // InternalCucumber.g:2405:1: ( ruleStep ) { // InternalCucumber.g:2405:1: ( ruleStep ) // InternalCucumber.g:2406:1: ruleStep { before(grammarAccess.getScenarioOutlineAccess().getStepsStepParserRuleCall_5_0()); pushFollow(FOLLOW_2); ruleStep(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getStepsStepParserRuleCall_5_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__StepsAssignment_5" // $ANTLR start "rule__ScenarioOutline__ExamplesAssignment_6" // InternalCucumber.g:2415:1: rule__ScenarioOutline__ExamplesAssignment_6 : ( ruleExamples ) ; public final void rule__ScenarioOutline__ExamplesAssignment_6() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2419:1: ( ( ruleExamples ) ) // InternalCucumber.g:2420:1: ( ruleExamples ) { // InternalCucumber.g:2420:1: ( ruleExamples ) // InternalCucumber.g:2421:1: ruleExamples { before(grammarAccess.getScenarioOutlineAccess().getExamplesExamplesParserRuleCall_6_0()); pushFollow(FOLLOW_2); ruleExamples(); state._fsp--; after(grammarAccess.getScenarioOutlineAccess().getExamplesExamplesParserRuleCall_6_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__ScenarioOutline__ExamplesAssignment_6" // $ANTLR start "rule__Step__DescriptionAssignment_1" // InternalCucumber.g:2430:1: rule__Step__DescriptionAssignment_1 : ( ruleStepDescription ) ; public final void rule__Step__DescriptionAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2434:1: ( ( ruleStepDescription ) ) // InternalCucumber.g:2435:1: ( ruleStepDescription ) { // InternalCucumber.g:2435:1: ( ruleStepDescription ) // InternalCucumber.g:2436:1: ruleStepDescription { before(grammarAccess.getStepAccess().getDescriptionStepDescriptionParserRuleCall_1_0()); pushFollow(FOLLOW_2); ruleStepDescription(); state._fsp--; after(grammarAccess.getStepAccess().getDescriptionStepDescriptionParserRuleCall_1_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__DescriptionAssignment_1" // $ANTLR start "rule__Step__TablesAssignment_3" // InternalCucumber.g:2445:1: rule__Step__TablesAssignment_3 : ( ruleTable ) ; public final void rule__Step__TablesAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2449:1: ( ( ruleTable ) ) // InternalCucumber.g:2450:1: ( ruleTable ) { // InternalCucumber.g:2450:1: ( ruleTable ) // InternalCucumber.g:2451:1: ruleTable { before(grammarAccess.getStepAccess().getTablesTableParserRuleCall_3_0()); pushFollow(FOLLOW_2); ruleTable(); state._fsp--; after(grammarAccess.getStepAccess().getTablesTableParserRuleCall_3_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__TablesAssignment_3" // $ANTLR start "rule__Step__CodeAssignment_4" // InternalCucumber.g:2460:1: rule__Step__CodeAssignment_4 : ( ruleDocString ) ; public final void rule__Step__CodeAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2464:1: ( ( ruleDocString ) ) // InternalCucumber.g:2465:1: ( ruleDocString ) { // InternalCucumber.g:2465:1: ( ruleDocString ) // InternalCucumber.g:2466:1: ruleDocString { before(grammarAccess.getStepAccess().getCodeDocStringParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleDocString(); state._fsp--; after(grammarAccess.getStepAccess().getCodeDocStringParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__CodeAssignment_4" // $ANTLR start "rule__Step__TablesAssignment_5" // InternalCucumber.g:2475:1: rule__Step__TablesAssignment_5 : ( ruleTable ) ; public final void rule__Step__TablesAssignment_5() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2479:1: ( ( ruleTable ) ) // InternalCucumber.g:2480:1: ( ruleTable ) { // InternalCucumber.g:2480:1: ( ruleTable ) // InternalCucumber.g:2481:1: ruleTable { before(grammarAccess.getStepAccess().getTablesTableParserRuleCall_5_0()); pushFollow(FOLLOW_2); ruleTable(); state._fsp--; after(grammarAccess.getStepAccess().getTablesTableParserRuleCall_5_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Step__TablesAssignment_5" // $ANTLR start "rule__Examples__TitleAssignment_1" // InternalCucumber.g:2490:1: rule__Examples__TitleAssignment_1 : ( ruleTitle ) ; public final void rule__Examples__TitleAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2494:1: ( ( ruleTitle ) ) // InternalCucumber.g:2495:1: ( ruleTitle ) { // InternalCucumber.g:2495:1: ( ruleTitle ) // InternalCucumber.g:2496:1: ruleTitle { before(grammarAccess.getExamplesAccess().getTitleTitleParserRuleCall_1_0()); pushFollow(FOLLOW_2); ruleTitle(); state._fsp--; after(grammarAccess.getExamplesAccess().getTitleTitleParserRuleCall_1_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__TitleAssignment_1" // $ANTLR start "rule__Examples__NarrativeAssignment_3" // InternalCucumber.g:2505:1: rule__Examples__NarrativeAssignment_3 : ( ruleNarrative ) ; public final void rule__Examples__NarrativeAssignment_3() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2509:1: ( ( ruleNarrative ) ) // InternalCucumber.g:2510:1: ( ruleNarrative ) { // InternalCucumber.g:2510:1: ( ruleNarrative ) // InternalCucumber.g:2511:1: ruleNarrative { before(grammarAccess.getExamplesAccess().getNarrativeNarrativeParserRuleCall_3_0()); pushFollow(FOLLOW_2); ruleNarrative(); state._fsp--; after(grammarAccess.getExamplesAccess().getNarrativeNarrativeParserRuleCall_3_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__NarrativeAssignment_3" // $ANTLR start "rule__Examples__TableAssignment_4" // InternalCucumber.g:2520:1: rule__Examples__TableAssignment_4 : ( ruleTable ) ; public final void rule__Examples__TableAssignment_4() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2524:1: ( ( ruleTable ) ) // InternalCucumber.g:2525:1: ( ruleTable ) { // InternalCucumber.g:2525:1: ( ruleTable ) // InternalCucumber.g:2526:1: ruleTable { before(grammarAccess.getExamplesAccess().getTableTableParserRuleCall_4_0()); pushFollow(FOLLOW_2); ruleTable(); state._fsp--; after(grammarAccess.getExamplesAccess().getTableTableParserRuleCall_4_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Examples__TableAssignment_4" // $ANTLR start "rule__Table__RowsAssignment_0" // InternalCucumber.g:2535:1: rule__Table__RowsAssignment_0 : ( RULE_TABLE_ROW ) ; public final void rule__Table__RowsAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2539:1: ( ( RULE_TABLE_ROW ) ) // InternalCucumber.g:2540:1: ( RULE_TABLE_ROW ) { // InternalCucumber.g:2540:1: ( RULE_TABLE_ROW ) // InternalCucumber.g:2541:1: RULE_TABLE_ROW { before(grammarAccess.getTableAccess().getRowsTABLE_ROWTerminalRuleCall_0_0()); match(input,RULE_TABLE_ROW,FOLLOW_2); after(grammarAccess.getTableAccess().getRowsTABLE_ROWTerminalRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Table__RowsAssignment_0" // $ANTLR start "rule__DocString__ContentAssignment_0" // InternalCucumber.g:2550:1: rule__DocString__ContentAssignment_0 : ( RULE_DOC_STRING ) ; public final void rule__DocString__ContentAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2554:1: ( ( RULE_DOC_STRING ) ) // InternalCucumber.g:2555:1: ( RULE_DOC_STRING ) { // InternalCucumber.g:2555:1: ( RULE_DOC_STRING ) // InternalCucumber.g:2556:1: RULE_DOC_STRING { before(grammarAccess.getDocStringAccess().getContentDOC_STRINGTerminalRuleCall_0_0()); match(input,RULE_DOC_STRING,FOLLOW_2); after(grammarAccess.getDocStringAccess().getContentDOC_STRINGTerminalRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__DocString__ContentAssignment_0" // $ANTLR start "rule__Tag__IdAssignment_0" // InternalCucumber.g:2565:1: rule__Tag__IdAssignment_0 : ( RULE_TAGNAME ) ; public final void rule__Tag__IdAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalCucumber.g:2569:1: ( ( RULE_TAGNAME ) ) // InternalCucumber.g:2570:1: ( RULE_TAGNAME ) { // InternalCucumber.g:2570:1: ( RULE_TAGNAME ) // InternalCucumber.g:2571:1: RULE_TAGNAME { before(grammarAccess.getTagAccess().getIdTAGNAMETerminalRuleCall_0_0()); match(input,RULE_TAGNAME,FOLLOW_2); after(grammarAccess.getTagAccess().getIdTAGNAMETerminalRuleCall_0_0()); } } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { restoreStackSize(stackSize); } return ; } // $ANTLR end "rule__Tag__IdAssignment_0" // Delegated rules protected DFA2 dfa2 = new DFA2(this); protected DFA3 dfa3 = new DFA3(this); static final String dfa_1s = "\12\uffff"; static final String dfa_2s = "\1\1\1\uffff\1\11\7\uffff"; static final String dfa_3s = "\1\4\1\uffff\1\4\7\uffff"; static final String dfa_4s = "\1\24\1\uffff\1\24\7\uffff"; static final String dfa_5s = "\1\uffff\1\2\1\uffff\7\1"; static final String dfa_6s = "\12\uffff}>"; static final String[] dfa_7s = { "\4\3\1\2\1\3\3\1\5\uffff\3\1", "", "\1\4\1\5\1\6\1\7\1\10\4\11\5\uffff\3\11", "", "", "", "", "", "", "" }; static final short[] dfa_1 = DFA.unpackEncodedString(dfa_1s); static final short[] dfa_2 = DFA.unpackEncodedString(dfa_2s); static final char[] dfa_3 = DFA.unpackEncodedStringToUnsignedChars(dfa_3s); static final char[] dfa_4 = DFA.unpackEncodedStringToUnsignedChars(dfa_4s); static final short[] dfa_5 = DFA.unpackEncodedString(dfa_5s); static final short[] dfa_6 = DFA.unpackEncodedString(dfa_6s); static final short[][] dfa_7 = unpackEncodedStringArray(dfa_7s); class DFA2 extends DFA { public DFA2(BaseRecognizer recognizer) { this.recognizer = recognizer; this.decisionNumber = 2; this.eot = dfa_1; this.eof = dfa_2; this.min = dfa_3; this.max = dfa_4; this.accept = dfa_5; this.special = dfa_6; this.transition = dfa_7; } public String getDescription() { return "()* loopback of 369:1: ( rule__StepDescription__Alternatives )*"; } } static final String dfa_8s = "\5\uffff"; static final String dfa_9s = "\2\11\2\uffff\1\11"; static final String dfa_10s = "\2\23\2\uffff\1\23"; static final String dfa_11s = "\2\uffff\1\1\1\2\1\uffff"; static final String dfa_12s = "\5\uffff}>"; static final String[] dfa_13s = { "\1\1\10\uffff\1\2\1\3", "\1\1\1\4\7\uffff\1\2\1\3", "", "", "\1\1\10\uffff\1\2\1\3" }; static final short[] dfa_8 = DFA.unpackEncodedString(dfa_8s); static final char[] dfa_9 = DFA.unpackEncodedStringToUnsignedChars(dfa_9s); static final char[] dfa_10 = DFA.unpackEncodedStringToUnsignedChars(dfa_10s); static final short[] dfa_11 = DFA.unpackEncodedString(dfa_11s); static final short[] dfa_12 = DFA.unpackEncodedString(dfa_12s); static final short[][] dfa_13 = unpackEncodedStringArray(dfa_13s); class DFA3 extends DFA { public DFA3(BaseRecognizer recognizer) { this.recognizer = recognizer; this.decisionNumber = 3; this.eot = dfa_8; this.eof = dfa_8; this.min = dfa_9; this.max = dfa_10; this.accept = dfa_11; this.special = dfa_12; this.transition = dfa_13; } public String getDescription() { return "410:1: rule__Feature__ScenariosAlternatives_6_0 : ( ( ruleScenario ) | ( ruleScenarioOutline ) );"; } } public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L}); public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L}); public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x00000000000000F2L}); public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x00000000000003F2L}); public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000010000L}); public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000000202L}); public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x00000000000000F0L}); public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000000400L}); public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x00000000000E02F0L}); public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000000000000402L}); public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x00000000000E02F2L}); public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x00000000000004F0L}); public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x00000000000001F0L}); public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x00000000000001F2L}); public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000040200L}); public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000000000100000L}); public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x00000000000003F0L}); public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000000001C00L}); public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000000000802L}); public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x00000000000008F0L}); public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x00000000000007F0L}); }
225,051
0.506721
0.473981
7,659
28.383993
29.897177
317
false
false
0
0
0
0
0
0
0.409975
false
false
1
5e000e1373eec42b1a3c42fb6c6eb047ab8467b6
33,835,752,390,026
e81e4e290ef07aa33db580f3794de72f47a8dca7
/app/src/main/java/williamamills/colorify/DBHelper.java
f64369618fcea682f507ac6760d293795da4f6ea
[]
no_license
asharma94/Colorifyv2
https://github.com/asharma94/Colorifyv2
00f048bb46016042fa4b7adcbe9d80daf4ff99a2
675c36f387cda3684d0d18fe34d28db2a376f29a
refs/heads/master
2021-01-10T18:30:01.693000
2016-05-09T01:05:01
2016-05-09T01:05:01
56,941,872
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package williamamills.colorify; import android.content.ContentValues; import android.content.Context; import android.content.res.Resources; import android.database.Cursor; import android.database.DatabaseUtils; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.widget.ArrayAdapter; import org.json.JSONArray; import org.json.JSONObject; import java.math.BigDecimal; import java.math.MathContext; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; public class DBHelper extends SQLiteOpenHelper { private static DBHelper mInstance; public static final String DATABASE_NAME = "pictures.db"; public static final String TABLE_NAME = "photos"; public static final String COLUMN_ID = "id"; public static final String COLUMN_PICTURE= "pic"; public static final String COLUMN_TAG = "tag"; private static final int DATABASE_VERSION = 1; private Context mCtx; // private static final String DATABASE_ALTER_START_TIME = "ALTER TABLE " // + TABLE_NAME + " ADD COLUMN " + SITE_COLUMN_START_TIME + " text;"; public static DBHelper getInstance(Context ctx) { if (mInstance == null) { mInstance = new DBHelper(ctx.getApplicationContext()); } return mInstance; } private DBHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); this.mCtx = context; } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub db.execSQL( "create table "+TABLE_NAME+" " + "(id integer primary key, "+COLUMN_PICTURE+" text, "+COLUMN_TAG+" text)" ); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub if(oldVersion<2){ //db.execSQL(DATABASE_ALTER_START_TIME); } } public SQLiteDatabase returnDB(){ SQLiteDatabase db = this.getReadableDatabase(); return db; } public boolean insertPhoto (JSONObject picture, String tag) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(COLUMN_PICTURE, picture.toString()); contentValues.put(COLUMN_TAG, tag); db.insert(TABLE_NAME, null, contentValues); return true; } public Cursor getData(int id){ SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery("select * from "+TABLE_NAME+" where id=" + id + "", null); return res; } public int numberOfRows(){ SQLiteDatabase db = this.getReadableDatabase(); int numRows = (int) DatabaseUtils.queryNumEntries(db, TABLE_NAME); return numRows; } public boolean updatePhoto (Integer id, JSONArray picture, String tag) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(COLUMN_PICTURE, picture.toString()); contentValues.put(COLUMN_TAG, tag); db.update(TABLE_NAME, contentValues, "id = ? ", new String[]{Integer.toString(id)}); return true; } public Integer deletePhoto (Integer id) { SQLiteDatabase db = this.getWritableDatabase(); return db.delete(TABLE_NAME, "id = ? ", new String[] { Integer.toString(id) }); } public ArrayList<String> getAllPhotos() { ArrayList<String> array_list = new ArrayList<String>(); //hp = new HashMap(); SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery( "select * from " + TABLE_NAME, null ); res.moveToFirst(); while(!res.isAfterLast()){ String s = res.getString(res.getColumnIndex(COLUMN_PICTURE)) + " " + res.getString(res.getColumnIndex(COLUMN_TAG)); res.moveToNext(); } return array_list; } public JSONObject getPhoto(int id) { ArrayList<String> array_list = new ArrayList<String>(); SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery("select * from " + TABLE_NAME + " where id=" + id + "", null); res.moveToPosition(0); String jsonString = res.getString(res.getColumnIndex(COLUMN_PICTURE)); res.close(); JSONObject j; try { j = new JSONObject(jsonString); }catch(Exception e){ j = null; } //TODO get JSON to Photo return j; } }
UTF-8
Java
4,805
java
DBHelper.java
Java
[ { "context": "package williamamills.colorify;\n\nimport android.content.ContentValues;\n", "end": 21, "score": 0.6911461353302002, "start": 8, "tag": "USERNAME", "value": "williamamills" } ]
null
[]
package williamamills.colorify; import android.content.ContentValues; import android.content.Context; import android.content.res.Resources; import android.database.Cursor; import android.database.DatabaseUtils; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.widget.ArrayAdapter; import org.json.JSONArray; import org.json.JSONObject; import java.math.BigDecimal; import java.math.MathContext; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; public class DBHelper extends SQLiteOpenHelper { private static DBHelper mInstance; public static final String DATABASE_NAME = "pictures.db"; public static final String TABLE_NAME = "photos"; public static final String COLUMN_ID = "id"; public static final String COLUMN_PICTURE= "pic"; public static final String COLUMN_TAG = "tag"; private static final int DATABASE_VERSION = 1; private Context mCtx; // private static final String DATABASE_ALTER_START_TIME = "ALTER TABLE " // + TABLE_NAME + " ADD COLUMN " + SITE_COLUMN_START_TIME + " text;"; public static DBHelper getInstance(Context ctx) { if (mInstance == null) { mInstance = new DBHelper(ctx.getApplicationContext()); } return mInstance; } private DBHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); this.mCtx = context; } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub db.execSQL( "create table "+TABLE_NAME+" " + "(id integer primary key, "+COLUMN_PICTURE+" text, "+COLUMN_TAG+" text)" ); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub if(oldVersion<2){ //db.execSQL(DATABASE_ALTER_START_TIME); } } public SQLiteDatabase returnDB(){ SQLiteDatabase db = this.getReadableDatabase(); return db; } public boolean insertPhoto (JSONObject picture, String tag) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(COLUMN_PICTURE, picture.toString()); contentValues.put(COLUMN_TAG, tag); db.insert(TABLE_NAME, null, contentValues); return true; } public Cursor getData(int id){ SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery("select * from "+TABLE_NAME+" where id=" + id + "", null); return res; } public int numberOfRows(){ SQLiteDatabase db = this.getReadableDatabase(); int numRows = (int) DatabaseUtils.queryNumEntries(db, TABLE_NAME); return numRows; } public boolean updatePhoto (Integer id, JSONArray picture, String tag) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(COLUMN_PICTURE, picture.toString()); contentValues.put(COLUMN_TAG, tag); db.update(TABLE_NAME, contentValues, "id = ? ", new String[]{Integer.toString(id)}); return true; } public Integer deletePhoto (Integer id) { SQLiteDatabase db = this.getWritableDatabase(); return db.delete(TABLE_NAME, "id = ? ", new String[] { Integer.toString(id) }); } public ArrayList<String> getAllPhotos() { ArrayList<String> array_list = new ArrayList<String>(); //hp = new HashMap(); SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery( "select * from " + TABLE_NAME, null ); res.moveToFirst(); while(!res.isAfterLast()){ String s = res.getString(res.getColumnIndex(COLUMN_PICTURE)) + " " + res.getString(res.getColumnIndex(COLUMN_TAG)); res.moveToNext(); } return array_list; } public JSONObject getPhoto(int id) { ArrayList<String> array_list = new ArrayList<String>(); SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery("select * from " + TABLE_NAME + " where id=" + id + "", null); res.moveToPosition(0); String jsonString = res.getString(res.getColumnIndex(COLUMN_PICTURE)); res.close(); JSONObject j; try { j = new JSONObject(jsonString); }catch(Exception e){ j = null; } //TODO get JSON to Photo return j; } }
4,805
0.638502
0.637877
156
29.801283
26.019081
125
false
false
0
0
0
0
0
0
0.647436
false
false
1
e182b3f8b53bb28ab7fad0a8bb22ee67ee3a396a
687,194,822,256
1586297c848886f3bae9f84dd8e9b1660529cc40
/Laboratoare/Lab/src/polimorfism/birdcontrollerex1/birdcontrollerex3/Penguin.java
7a435c21e102dcba0f29f581eedb009430ca577e
[]
no_license
SerbuCatalina/workJava
https://github.com/SerbuCatalina/workJava
c8968ffe8f7418adb2262a2248cba8eac8d0b37f
70c58c5ae50c3ac3d058cf1f845dd2f5ab3cae82
refs/heads/master
2020-12-06T04:33:19.793000
2016-08-26T07:46:46
2016-08-26T07:46:46
66,623,366
1
0
null
false
2016-09-01T10:00:43
2016-08-26T06:41:41
2016-08-26T07:47:45
2016-09-01T10:00:43
66
1
0
1
Java
null
null
package polimorfism.birdcontrollerex1.birdcontrollerex3; public class Penguin implements IBird { public void move(){ System.out.println("The NONI_PENGUIN is swiming."); } }
UTF-8
Java
190
java
Penguin.java
Java
[]
null
[]
package polimorfism.birdcontrollerex1.birdcontrollerex3; public class Penguin implements IBird { public void move(){ System.out.println("The NONI_PENGUIN is swiming."); } }
190
0.726316
0.715789
7
26.142857
23.630661
59
false
false
0
0
0
0
0
0
0.285714
false
false
1
204d3ff61d024776f00ee3be3a8b711ea78f2823
9,526,237,484,169
53e0fed90ef912102dca6ce91fb7ef3b38492caa
/app/src/main/java/com/young/Demo/ImageAdapter.java
6fa53c12c5bd4d48c7d24794e737d37b95fd4f3a
[]
no_license
tobecrazy/AndroidDemo
https://github.com/tobecrazy/AndroidDemo
93c4d1bf5b0be1ecbf5ebe7a452d658f0da1187a
8f08b5d0f2946970b7c4548f83058f452b61938c
refs/heads/master
2021-01-19T05:10:50.940000
2016-08-22T16:35:54
2016-08-22T16:35:54
64,626,286
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.young.Demo; import android.content.Context; import android.support.v4.view.PagerAdapter; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.library.utils.GlideUtil; import java.util.List; /** * Created by longbh on 16/7/7. */ class ImageAdapter extends PagerAdapter { public List<String> datas; private Context context; public ImageAdapter(List<String> datas, Context context){ this.datas = datas; this.context = context; } @Override public int getCount() { return datas.size(); } @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView((View) object);//删除页卡 } @Override public Object instantiateItem(ViewGroup container, int position) { //这个方法用来实例化页卡 ImageView iv = new ImageView(context); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); iv.setLayoutParams(params); iv.setScaleType(ImageView.ScaleType.CENTER_CROP);// 图片按等比缩放 GlideUtil.loadPicture(datas.get(position),iv, R.drawable.default_image); container.addView(iv); return iv; } @Override public boolean isViewFromObject(View view, Object object) { return view == object; } }
UTF-8
Java
1,484
java
ImageAdapter.java
Java
[ { "context": "deUtil;\n\nimport java.util.List;\n\n/**\n * Created by longbh on 16/7/7.\n */\nclass ImageAdapter extends PagerAd", "end": 278, "score": 0.9993505477905273, "start": 272, "tag": "USERNAME", "value": "longbh" } ]
null
[]
package com.young.Demo; import android.content.Context; import android.support.v4.view.PagerAdapter; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.library.utils.GlideUtil; import java.util.List; /** * Created by longbh on 16/7/7. */ class ImageAdapter extends PagerAdapter { public List<String> datas; private Context context; public ImageAdapter(List<String> datas, Context context){ this.datas = datas; this.context = context; } @Override public int getCount() { return datas.size(); } @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView((View) object);//删除页卡 } @Override public Object instantiateItem(ViewGroup container, int position) { //这个方法用来实例化页卡 ImageView iv = new ImageView(context); ViewGroup.LayoutParams params = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); iv.setLayoutParams(params); iv.setScaleType(ImageView.ScaleType.CENTER_CROP);// 图片按等比缩放 GlideUtil.loadPicture(datas.get(position),iv, R.drawable.default_image); container.addView(iv); return iv; } @Override public boolean isViewFromObject(View view, Object object) { return view == object; } }
1,484
0.679167
0.675694
53
26.150944
23.799791
85
false
false
0
0
0
0
0
0
0.566038
false
false
1
987180b56b6c60cdbf4acee58144e46cf5c5aa93
2,740,189,185,085
71d0b65f6d0859d8f70c2a1127fffb5168151fec
/src/main/java/com/abhi/webservices/myrestwebservice/MyRestWebserviceApplication.java
733df69c5698fb3f7cc1a78909d74bc3bca8f0e3
[]
no_license
erabhinavrana/my-rest-webservice
https://github.com/erabhinavrana/my-rest-webservice
216734a5fffbd22496c54e1e8dfedb1542fbac4f
f7cc8bc09848e6e62d652c72036f7be2d30c7f64
refs/heads/master
2020-04-22T04:43:32.159000
2019-03-03T12:22:50
2019-03-03T12:22:50
170,133,036
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.abhi.webservices.myrestwebservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; import java.util.Locale; //import org.springframework.security.config.annotation.web.builders.HttpSecurity; //import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @SpringBootApplication public class MyRestWebserviceApplication { public static void main(String[] args) { SpringApplication.run(MyRestWebserviceApplication.class, args); // ApplicationContext // applicationContext = // SpringApplication.run(MyRestWebserviceApplication.class, args); // // for (String name : applicationContext.getBeanDefinitionNames()) { // System.out.println(name); // } } @Bean public LocaleResolver getLocaleResolver(){ return new AcceptHeaderLocaleResolver(){ @Override public void setDefaultLocale(Locale defaultLocale) { super.setDefaultLocale(Locale.US); } }; } /* public ResourceBundleMessageSource getResourceBundleMessageSource(){ return new ResourceBundleMessageSource(){ @Override public void setBasename(String basename) { super.setBasename("messages"); } }; }*/ /* @Bean public WebSecurityConfigurerAdapter webSecurityConfigurerAdapter(){ return new WebSecurityConfigurerAdapter() { @Override protected void configure(HttpSecurity http) throws Exception { super.configure(http); http.csrf().disable(); } }; }*/ }
UTF-8
Java
1,689
java
MyRestWebserviceApplication.java
Java
[]
null
[]
package com.abhi.webservices.myrestwebservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver; import java.util.Locale; //import org.springframework.security.config.annotation.web.builders.HttpSecurity; //import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; @SpringBootApplication public class MyRestWebserviceApplication { public static void main(String[] args) { SpringApplication.run(MyRestWebserviceApplication.class, args); // ApplicationContext // applicationContext = // SpringApplication.run(MyRestWebserviceApplication.class, args); // // for (String name : applicationContext.getBeanDefinitionNames()) { // System.out.println(name); // } } @Bean public LocaleResolver getLocaleResolver(){ return new AcceptHeaderLocaleResolver(){ @Override public void setDefaultLocale(Locale defaultLocale) { super.setDefaultLocale(Locale.US); } }; } /* public ResourceBundleMessageSource getResourceBundleMessageSource(){ return new ResourceBundleMessageSource(){ @Override public void setBasename(String basename) { super.setBasename("messages"); } }; }*/ /* @Bean public WebSecurityConfigurerAdapter webSecurityConfigurerAdapter(){ return new WebSecurityConfigurerAdapter() { @Override protected void configure(HttpSecurity http) throws Exception { super.configure(http); http.csrf().disable(); } }; }*/ }
1,689
0.780935
0.779751
56
29.142857
27.10919
103
false
false
0
0
0
0
0
0
1.910714
false
false
1
7fddd0877752677b8aa4ce4b49e5d5163a8fad93
38,062,000,184,957
51934a954934c21cae6a8482a6f5e6c3b3bd5c5a
/output/cc8aa09278ef4300834cb8e3555d5a83.java
533eef696c670d8f3521fc24246243d7ad0ae7a4
[ "MIT", "Apache-2.0" ]
permissive
comprakt/comprakt-fuzz-tests
https://github.com/comprakt/comprakt-fuzz-tests
e8c954d94b4f4615c856fd3108010011610a5f73
c0082d105d7c54ad31ab4ea461c3b8319358eaaa
refs/heads/master
2021-09-25T15:29:58.589000
2018-10-23T17:33:46
2018-10-23T17:33:46
154,370,249
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
class PQ { public static void A5KJta8xT8 (String[] pVd) { int ZLjiZO7A_; } public int[][][] dmbKfTw_ () { return --( this.CC5()).p4uYT5I9e0IB(); boolean[] bZ = !true.v3CHz2i1RIADw = -g9Y1W[ !!!new NZ().xnn1OYUR()]; ; return null.C6ze; return !--( null.uim_tE()).WZRweHwkyZc7Vs(); void RbXfIir91; int[][] hli = null.LuuwbKwxtol() = new Fo0oshwSkM_q().HFdUfvFS6(); } public int YWbd () { void AU6rb = !Wp.HyX4YzLZCa3e() = null.ZbfORMnmaVdF(); } public CM7AD7e7pqg3J flcWQerDD3Jzg; public int[][] h7aJdsks () { boolean[][] t9bLOOg3cd1m7u = this.Pwn05Rwl; ; } }
UTF-8
Java
693
java
cc8aa09278ef4300834cb8e3555d5a83.java
Java
[]
null
[]
class PQ { public static void A5KJta8xT8 (String[] pVd) { int ZLjiZO7A_; } public int[][][] dmbKfTw_ () { return --( this.CC5()).p4uYT5I9e0IB(); boolean[] bZ = !true.v3CHz2i1RIADw = -g9Y1W[ !!!new NZ().xnn1OYUR()]; ; return null.C6ze; return !--( null.uim_tE()).WZRweHwkyZc7Vs(); void RbXfIir91; int[][] hli = null.LuuwbKwxtol() = new Fo0oshwSkM_q().HFdUfvFS6(); } public int YWbd () { void AU6rb = !Wp.HyX4YzLZCa3e() = null.ZbfORMnmaVdF(); } public CM7AD7e7pqg3J flcWQerDD3Jzg; public int[][] h7aJdsks () { boolean[][] t9bLOOg3cd1m7u = this.Pwn05Rwl; ; } }
693
0.536797
0.484848
22
30.5
23.581099
79
false
false
0
0
0
0
0
0
0.545455
false
false
1
7cf3896511787b34d04631a45000e6d028befce6
34,325,378,648,536
999a599c004f556f6111097ee6053b370ec42a6b
/dogproject/src/co/dog/wp/mypage/controller/Myhistory.java
154f7adb84ae0c29d0b79607a3e8672a2e5065c0
[]
no_license
eo339912/walkitpuppit
https://github.com/eo339912/walkitpuppit
382bed08860adff335d2f208ce10b200fb48967c
dcb6071c2736888f58d94a2597cadc683fb745aa
refs/heads/master
2022-09-28T10:22:18.041000
2020-06-05T08:42:54
2020-06-05T08:42:54
267,186,949
4
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package co.dog.wp.mypage.controller; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import co.dog.wp.common.Command; public class Myhistory implements Command{ @Override public String exec(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = (String) request.getSession().getAttribute("loginId"); //서비스로직 // return "mypage/myhistory.jsp"; } }
UTF-8
Java
545
java
Myhistory.java
Java
[]
null
[]
package co.dog.wp.mypage.controller; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import co.dog.wp.common.Command; public class Myhistory implements Command{ @Override public String exec(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = (String) request.getSession().getAttribute("loginId"); //서비스로직 // return "mypage/myhistory.jsp"; } }
545
0.783178
0.783178
23
22.26087
28.21843
116
false
false
0
0
0
0
0
0
1.086957
false
false
1
651061255511f8192cf6f416594a96dd72a6181b
7,258,494,753,753
f7492fc996c2e67dccb9dc1e7943ed39726b9ba1
/BaseTrainManage/src/com/hhit/basetrain/entity/User.java
4e9eec8e2f1837d9ed58175c9a2aad2d9719a899
[]
no_license
Wizhiai/HhitBaseTrain
https://github.com/Wizhiai/HhitBaseTrain
7418ce9d961b909d09f28d804aa2fddad644b2a5
2a8ec7c35646fd8658b10dee6e24efe3cb2fa690
refs/heads/master
2021-01-21T14:44:17.533000
2016-06-19T05:00:38
2016-06-19T05:00:38
56,747,855
0
2
null
false
2016-06-18T07:19:07
2016-04-21T06:22:50
2016-06-18T06:56:10
2016-06-18T07:19:06
43,256
0
2
0
JavaScript
null
null
/** * */ package com.hhit.basetrain.entity; /** * @author Jiya * @date 2016-4-18下午03:15:52 用户实体类 */ public class User { /** 用户名 */ private String username; /** 密码 */ private String password; /** 身份 */ private String identity; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getIdentity() { return identity; } public void setIdentity(String identity) { this.identity = identity; } @Override public String toString() { return "User [identity=" + identity + ", password=" + password + ", username=" + username + "]"; } }
UTF-8
Java
807
java
User.java
Java
[ { "context": "package com.hhit.basetrain.entity;\n\n/**\n * @author Jiya\n * @date 2016-4-18下午03:15:52 用户实体类\n */\npublic cla", "end": 67, "score": 0.9821198582649231, "start": 63, "tag": "USERNAME", "value": "Jiya" } ]
null
[]
/** * */ package com.hhit.basetrain.entity; /** * @author Jiya * @date 2016-4-18下午03:15:52 用户实体类 */ public class User { /** 用户名 */ private String username; /** 密码 */ private String password; /** 身份 */ private String identity; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getIdentity() { return identity; } public void setIdentity(String identity) { this.identity = identity; } @Override public String toString() { return "User [identity=" + identity + ", password=" + password + ", username=" + username + "]"; } }
807
0.654685
0.637997
49
14.897959
15.644319
64
false
false
0
0
0
0
0
0
1.061224
false
false
1
c7422149b396324f0f9fd32e87adca09e636450c
26,680,336,870,882
361a2f4757d4c0d5f0cb2a677e627d462e7eaba7
/SelectionSort.java
7b6b57b221a4f9c1aa30fdb08b05b2868d4d2662
[]
no_license
pearlyjo/java-ninjas
https://github.com/pearlyjo/java-ninjas
5f34bfbeb547bec11c36635b609ab8379c453cc7
34ca8918fe29060c90e368bd46e66f515595f089
refs/heads/master
2020-03-18T11:36:07.599000
2018-09-03T18:53:33
2018-09-03T18:53:33
134,681,116
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.Scanner; public class SelectionSort { public static void SelectionSorting(int[] nums) { int Value=0; int smallestValue=0; for(int j=0;j<nums.length-1;j++) { for(int i=j+1;i<nums.length;i++) { if(nums[j]>nums[i]) { smallestValue =nums[j]; nums[j]=nums[i]; nums[i]=smallestValue; //System.out.println(smallestValue) } } } } public static void main(String[] args) { // TODO Auto-generated method stub inputOutput im= new inputOutput(); int arr[]=im.input(); SelectionSorting(arr); System.out.println("The Selection Sorted Array is:"); im.output(arr); } }
UTF-8
Java
768
java
SelectionSort.java
Java
[]
null
[]
import java.util.Scanner; public class SelectionSort { public static void SelectionSorting(int[] nums) { int Value=0; int smallestValue=0; for(int j=0;j<nums.length-1;j++) { for(int i=j+1;i<nums.length;i++) { if(nums[j]>nums[i]) { smallestValue =nums[j]; nums[j]=nums[i]; nums[i]=smallestValue; //System.out.println(smallestValue) } } } } public static void main(String[] args) { // TODO Auto-generated method stub inputOutput im= new inputOutput(); int arr[]=im.input(); SelectionSorting(arr); System.out.println("The Selection Sorted Array is:"); im.output(arr); } }
768
0.529948
0.523438
53
12.490566
14.987571
55
false
false
0
0
0
0
0
0
2.54717
false
false
1
a3cb28b52d5bebf96bf09f9d2062caba90e35023
25,958,782,388,852
fceccabe6d9012548001d5cd201a1196ab0cd01e
/src/main/java/FileUtilsC.java
67ee7f2a463f2d7652dcd4fd8d644237357f03a9
[]
no_license
datevid/FileUtilsC
https://github.com/datevid/FileUtilsC
6dd6b737fc8416d654eab5e658a5c0a8a93f31c6
72ea66defb948c1a20aa94313857150f1e7b3abe
refs/heads/main
2023-06-06T22:45:10.753000
2021-06-23T23:55:31
2021-06-23T23:55:31
379,753,625
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.io.*; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class FileUtilsC { /** * guarda archivo en una ruta temporal * Proceso: * Agrega al nuEmi la fecha nuEmi+AAMMDDhhmm * Indica el nombre del documento en nombreArchivoInRutaTmpDes * Indica el path del documento en pathArchivoInRutaTmpDes * @return * * ver: https://attacomsian.com/blog/java-read-write-binary-files * para optimizar ver: https://stackoverflow.com/a/16710301/7105200 * ver: https://stackoverflow.com/q/2818507/7105200 */ public static void saveBytesInPath(byte[] archivo, String pathFileStr, String fileName) throws IOException { try { String absolutePath = pathFileStr+"/"+fileName; FileOutputStream fos = new FileOutputStream(new File(absolutePath)); BufferedOutputStream writer = new BufferedOutputStream(fos); writer.write(archivo); writer.flush(); writer.close(); archivo = null;//liberamos espacio en memoria } catch (IOException e) { e.printStackTrace(); throw e; } } /** * genera MD5 de archivos * Optimizado para archivos grandes * see: https://stackoverflow.com/a/9322214/7105200 * https://attacomsian.com/blog/java-read-write-binary-files * @param pathFileStr * @return */ public static String getMD5FromLargeFiles(String pathFileStr, String fileName){ FileInputStream fis = null; MessageDigest md; try { fis = new FileInputStream(new File(pathFileStr+"/"+fileName)); md = MessageDigest.getInstance("MD5"); FileChannel channel = fis.getChannel(); ByteBuffer buff = ByteBuffer.allocate(2048); while(channel.read(buff) != -1) { buff.flip(); md.update(buff); buff.clear(); } byte[] hashValue = md.digest(); String md5Str = convertByteArrayToHexString(hashValue); return md5Str; } catch (NoSuchAlgorithmException e) { return null; } catch (IOException e) { return null; } finally { try { if(fis!=null)fis.close(); } catch (IOException e) { } } } private static String convertByteArrayToHexString(byte[] arrayBytes) { StringBuilder stringBuffer = new StringBuilder(); for (int i = 0; i < arrayBytes.length; i++) { stringBuffer.append(Integer.toString((arrayBytes[i] & 0xff) + 0x100, 16).substring(1)); } return stringBuffer.toString(); } /** * Genera el MD5 de un binario * Carga todos los bytes a memoria por lo que se recomienda no usarlo para archivos pesados * @param bytes * @return * @throws NoSuchAlgorithmException */ public static String getMD5FromBinary(byte[] bytes) throws NoSuchAlgorithmException { String msgFile = ""; MessageDigest digest = MessageDigest.getInstance("md5"); byte[] hashedBytes = digest.digest(bytes); msgFile = convertByteArrayToHexString(hashedBytes); return msgFile; } }
UTF-8
Java
3,432
java
FileUtilsC.java
Java
[]
null
[]
import java.io.*; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class FileUtilsC { /** * guarda archivo en una ruta temporal * Proceso: * Agrega al nuEmi la fecha nuEmi+AAMMDDhhmm * Indica el nombre del documento en nombreArchivoInRutaTmpDes * Indica el path del documento en pathArchivoInRutaTmpDes * @return * * ver: https://attacomsian.com/blog/java-read-write-binary-files * para optimizar ver: https://stackoverflow.com/a/16710301/7105200 * ver: https://stackoverflow.com/q/2818507/7105200 */ public static void saveBytesInPath(byte[] archivo, String pathFileStr, String fileName) throws IOException { try { String absolutePath = pathFileStr+"/"+fileName; FileOutputStream fos = new FileOutputStream(new File(absolutePath)); BufferedOutputStream writer = new BufferedOutputStream(fos); writer.write(archivo); writer.flush(); writer.close(); archivo = null;//liberamos espacio en memoria } catch (IOException e) { e.printStackTrace(); throw e; } } /** * genera MD5 de archivos * Optimizado para archivos grandes * see: https://stackoverflow.com/a/9322214/7105200 * https://attacomsian.com/blog/java-read-write-binary-files * @param pathFileStr * @return */ public static String getMD5FromLargeFiles(String pathFileStr, String fileName){ FileInputStream fis = null; MessageDigest md; try { fis = new FileInputStream(new File(pathFileStr+"/"+fileName)); md = MessageDigest.getInstance("MD5"); FileChannel channel = fis.getChannel(); ByteBuffer buff = ByteBuffer.allocate(2048); while(channel.read(buff) != -1) { buff.flip(); md.update(buff); buff.clear(); } byte[] hashValue = md.digest(); String md5Str = convertByteArrayToHexString(hashValue); return md5Str; } catch (NoSuchAlgorithmException e) { return null; } catch (IOException e) { return null; } finally { try { if(fis!=null)fis.close(); } catch (IOException e) { } } } private static String convertByteArrayToHexString(byte[] arrayBytes) { StringBuilder stringBuffer = new StringBuilder(); for (int i = 0; i < arrayBytes.length; i++) { stringBuffer.append(Integer.toString((arrayBytes[i] & 0xff) + 0x100, 16).substring(1)); } return stringBuffer.toString(); } /** * Genera el MD5 de un binario * Carga todos los bytes a memoria por lo que se recomienda no usarlo para archivos pesados * @param bytes * @return * @throws NoSuchAlgorithmException */ public static String getMD5FromBinary(byte[] bytes) throws NoSuchAlgorithmException { String msgFile = ""; MessageDigest digest = MessageDigest.getInstance("md5"); byte[] hashedBytes = digest.digest(bytes); msgFile = convertByteArrayToHexString(hashedBytes); return msgFile; } }
3,432
0.602564
0.583625
102
32.64706
25.659782
112
false
false
0
0
0
0
0
0
0.421569
false
false
1
6ee5e9553252f88c612ca1564f1f12adfe85872c
30,923,764,583,605
6c60d22abbe0a0eafddf0aa67461ef6fb671e563
/ChessProject/src/main/java/com/ncr/chess/ChessBoard.java
42e4e63278b8bfe9b6c9a5091ca5f7fb7b7154de
[]
no_license
Navneeth-Eedi/chess-project-
https://github.com/Navneeth-Eedi/chess-project-
1dd31d6baf855c75edfe653152cf92c3834209c8
a475fe0633abcc886442dcc66d2143c35f6a9db1
refs/heads/main
2023-03-21T05:39:57.370000
2021-03-08T11:16:20
2021-03-08T11:16:20
345,629,234
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ncr.chess; import com.ncr.chess.exception.ChessBoardUnSupportedOperationException; import lombok.Data; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Data public class ChessBoard { private static final Logger logger = LogManager.getLogger(ChessBoard.class); public static int MAX_BOARD_WIDTH = 7; public static int MAX_BOARD_HEIGHT = 7; private static Pawn[][] pieces; public ChessBoard() { pieces = new Pawn[MAX_BOARD_WIDTH][MAX_BOARD_HEIGHT]; } public static void setPieces(int xCoordinate, int yCoordinate, Pawn pawn) { pieces[xCoordinate][yCoordinate] = pawn; } public static Pawn getPieces(int xCoordinate, int yCoordinate) { return pieces[xCoordinate][yCoordinate]; } /** * This method adds piece on chess board if X and Y coordinates are valid * and no piece is available in that position * * @param pawn input piece pawn object * @param xCoordinate input X coordinate * @param yCoordinate input Y coordinate * @param pieceColor input piece colour * @throws ChessBoardUnSupportedOperationException Exception */ public void addPiece(Pawn pawn, int xCoordinate, int yCoordinate, PieceColor pieceColor) throws ChessBoardUnSupportedOperationException { logger.info("In Add Piece method"); if (this.isLegalBoardPosition(xCoordinate, yCoordinate)) { logger.info("IS Legal board position"); if (this.getPieces(xCoordinate, yCoordinate) instanceof Pawn) { pawn.setXCoordinate(-1); pawn.setYCoordinate(-1); } else { logger.info("Setting Pieces"); this.setPieces(xCoordinate, yCoordinate, pawn); pawn.setXCoordinate(xCoordinate); pawn.setYCoordinate(yCoordinate); } } else { logger.info("IS Not a Legal board position"); pawn.setXCoordinate(-1); pawn.setYCoordinate(-1); } pawn.setPieceColor(pieceColor); } /** * Utility Method to check if the given Coordinate Positions are valid or not. * * @param xCoordinate Input X Coordinate * @param yCoordinate Input Y Coordinate * @return True or False * @throws ChessBoardUnSupportedOperationException Exception */ public boolean isLegalBoardPosition(int xCoordinate, int yCoordinate) throws ChessBoardUnSupportedOperationException { if (xCoordinate >= 0 && xCoordinate < MAX_BOARD_WIDTH && yCoordinate >= 0 && yCoordinate < MAX_BOARD_HEIGHT) { return true; } return false; } }
UTF-8
Java
2,504
java
ChessBoard.java
Java
[]
null
[]
package com.ncr.chess; import com.ncr.chess.exception.ChessBoardUnSupportedOperationException; import lombok.Data; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Data public class ChessBoard { private static final Logger logger = LogManager.getLogger(ChessBoard.class); public static int MAX_BOARD_WIDTH = 7; public static int MAX_BOARD_HEIGHT = 7; private static Pawn[][] pieces; public ChessBoard() { pieces = new Pawn[MAX_BOARD_WIDTH][MAX_BOARD_HEIGHT]; } public static void setPieces(int xCoordinate, int yCoordinate, Pawn pawn) { pieces[xCoordinate][yCoordinate] = pawn; } public static Pawn getPieces(int xCoordinate, int yCoordinate) { return pieces[xCoordinate][yCoordinate]; } /** * This method adds piece on chess board if X and Y coordinates are valid * and no piece is available in that position * * @param pawn input piece pawn object * @param xCoordinate input X coordinate * @param yCoordinate input Y coordinate * @param pieceColor input piece colour * @throws ChessBoardUnSupportedOperationException Exception */ public void addPiece(Pawn pawn, int xCoordinate, int yCoordinate, PieceColor pieceColor) throws ChessBoardUnSupportedOperationException { logger.info("In Add Piece method"); if (this.isLegalBoardPosition(xCoordinate, yCoordinate)) { logger.info("IS Legal board position"); if (this.getPieces(xCoordinate, yCoordinate) instanceof Pawn) { pawn.setXCoordinate(-1); pawn.setYCoordinate(-1); } else { logger.info("Setting Pieces"); this.setPieces(xCoordinate, yCoordinate, pawn); pawn.setXCoordinate(xCoordinate); pawn.setYCoordinate(yCoordinate); } } else { logger.info("IS Not a Legal board position"); pawn.setXCoordinate(-1); pawn.setYCoordinate(-1); } pawn.setPieceColor(pieceColor); } /** * Utility Method to check if the given Coordinate Positions are valid or not. * * @param xCoordinate Input X Coordinate * @param yCoordinate Input Y Coordinate * @return True or False * @throws ChessBoardUnSupportedOperationException Exception */ public boolean isLegalBoardPosition(int xCoordinate, int yCoordinate) throws ChessBoardUnSupportedOperationException { if (xCoordinate >= 0 && xCoordinate < MAX_BOARD_WIDTH && yCoordinate >= 0 && yCoordinate < MAX_BOARD_HEIGHT) { return true; } return false; } }
2,504
0.71246
0.708466
73
33.301369
30.197834
139
false
false
0
0
0
0
0
0
0.506849
false
false
1
7d9ac5c27b50a816d864de73b3b41b8913da5738
12,902,081,779,519
030cf35d513d4e4f88c752b2418243123ea8c26c
/src/chattcp2/Client.java
25208b90dae9925cc1067f3efbedaee6fcdeed71
[]
no_license
capo11/ChatTCP
https://github.com/capo11/ChatTCP
feb2c800045ba501b1611945e612bd8c8e4c98ef
a6fcc1d5465adf28e7d079d7498da02d4182cb7a
refs/heads/master
2021-04-26T22:54:39.888000
2018-03-18T14:22:54
2018-03-18T14:22:54
123,893,237
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package chattcp2; /** * * @author Andrea */ import java.net.*; import java.io.*; public class Client { Socket connessione; BufferedReader in; PrintStream out; int port=1000; public static final String GREEN = "\u001B[32m"; public static final String RED = "\u001B[31m"; public Client() { BufferedReader t = new BufferedReader(new InputStreamReader(System.in)); try { connessione = new Socket("127.0.0.1", port); in = new BufferedReader(new InputStreamReader(connessione.getInputStream())); out = new PrintStream(connessione.getOutputStream()); } catch(IOException e) { System.out.println(e); } } // Client() public void conversazione() { String messaggio = ""; BufferedReader t = new BufferedReader(new InputStreamReader(System.in)); try { while(!messaggio.equals("end")) { messaggio = in.readLine(); System.out.println(messaggio); if(!messaggio.equals("end")) { messaggio = t.readLine(); out.println("Client: "+messaggio); } } // while connessione.close(); } catch(IOException e) { System.out.println(RED + "Conversazione interrotta"); } } // conversazione() }
UTF-8
Java
1,425
java
Client.java
Java
[ { "context": "e editor.\n */\npackage chattcp2;\n\n/**\n *\n * @author Andrea\n */\nimport java.net.*;\nimport java.io.*;\n\npublic ", "end": 228, "score": 0.9996746182441711, "start": 222, "tag": "NAME", "value": "Andrea" }, { "context": "System.in));\n\t\ttry {\n\t\t\tconnessione = new Socket(\"127.0.0.1\", port);\n\t\t\tin = new BufferedReader(new InputStr", "end": 695, "score": 0.9997523427009583, "start": 686, "tag": "IP_ADDRESS", "value": "127.0.0.1" } ]
null
[]
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package chattcp2; /** * * @author Andrea */ import java.net.*; import java.io.*; public class Client { Socket connessione; BufferedReader in; PrintStream out; int port=1000; public static final String GREEN = "\u001B[32m"; public static final String RED = "\u001B[31m"; public Client() { BufferedReader t = new BufferedReader(new InputStreamReader(System.in)); try { connessione = new Socket("127.0.0.1", port); in = new BufferedReader(new InputStreamReader(connessione.getInputStream())); out = new PrintStream(connessione.getOutputStream()); } catch(IOException e) { System.out.println(e); } } // Client() public void conversazione() { String messaggio = ""; BufferedReader t = new BufferedReader(new InputStreamReader(System.in)); try { while(!messaggio.equals("end")) { messaggio = in.readLine(); System.out.println(messaggio); if(!messaggio.equals("end")) { messaggio = t.readLine(); out.println("Client: "+messaggio); } } // while connessione.close(); } catch(IOException e) { System.out.println(RED + "Conversazione interrotta"); } } // conversazione() }
1,425
0.638596
0.62386
53
25.905661
22.814482
80
false
false
0
0
0
0
0
0
1.981132
false
false
1
14148755f673e6551c6aa1be5527b1fe6b3982ac
15,822,659,588,126
6b997b11bdf9ea362ea57ff76547ccf9a7734f00
/Web02/src/main/java/controller01/C01_LoginTest.java
d744bc695a329d968b2834419cbcb80b6e9cd9dc
[]
no_license
ctho55/Java_Study
https://github.com/ctho55/Java_Study
c9694df63a9c9f8d1780653794785f1536b8e54a
a497edb0973d6c29c24936371ed3ab5f7cb1348e
refs/heads/master
2023-08-24T22:57:00.661000
2021-09-28T11:44:52
2021-09-28T11:44:52
381,704,688
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package controller01; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import service.MemberService; import vo.MemberVO; import vo.UserVO; @WebServlet("/logintest") public class C01_LoginTest extends HttpServlet { private static final long serialVersionUID = 1L; public C01_LoginTest() { super(); } // ** LoginTest // => UserVO Test (로그인 한 User 의 정보보관) protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // ** 준비 MemberService service = new MemberService(); MemberVO vo = new MemberVO(); String uri = "/member/loginForm2.jsp"; String message = ""; // 1. Parameter 처리 String id = request.getParameter("id"); String password = request.getParameter("password"); // 2. Service // => id 가 맞는지 , password 가 맞는지 // => 성공 : index // 실패 : loginForm2 으로 재로그인 유도 vo.setId(id); vo = service.selectOne(vo); if (vo!=null) { // password 확인 // => password 와 vo.getPassword() 비교 if ( vo.getPassword().equals(password)) { // 로그인 성공 // => 로그인 정보 보관, index 로 UserVO user = new UserVO(); user.setId(id); user.setName(vo.getName()); user.setLev(vo.getLev()); // 세션 생성시간 출력포맷 처리 : String Type SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); user.setSctime(formatter.format(request.getSession().getCreationTime())); // 세션 생성시간 처리 : Date Type user.setSctimeDate(new Date(request.getSession().getCreationTime())); request.getSession().setAttribute("loginUser",user); message = "~~ UserVO Test 중 !!! 정상 로그인 후 이용하세요 ~~" ; uri = "/index.jsp"; }else { // password 오류 message = "~~ password 오류 !!! 다시 하세요 ~~" ; } }else { // id 오류 message = "~~ id 오류 !!! 다시 하세요 ~~" ; } // 3. View 처리 : forward if (message != null) request.setAttribute("message", message); request.getRequestDispatcher(uri).forward(request, response); } //doGet protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } } //class
UTF-8
Java
2,593
java
C01_LoginTest.java
Java
[]
null
[]
package controller01; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import service.MemberService; import vo.MemberVO; import vo.UserVO; @WebServlet("/logintest") public class C01_LoginTest extends HttpServlet { private static final long serialVersionUID = 1L; public C01_LoginTest() { super(); } // ** LoginTest // => UserVO Test (로그인 한 User 의 정보보관) protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // ** 준비 MemberService service = new MemberService(); MemberVO vo = new MemberVO(); String uri = "/member/loginForm2.jsp"; String message = ""; // 1. Parameter 처리 String id = request.getParameter("id"); String password = request.getParameter("password"); // 2. Service // => id 가 맞는지 , password 가 맞는지 // => 성공 : index // 실패 : loginForm2 으로 재로그인 유도 vo.setId(id); vo = service.selectOne(vo); if (vo!=null) { // password 확인 // => password 와 vo.getPassword() 비교 if ( vo.getPassword().equals(password)) { // 로그인 성공 // => 로그인 정보 보관, index 로 UserVO user = new UserVO(); user.setId(id); user.setName(vo.getName()); user.setLev(vo.getLev()); // 세션 생성시간 출력포맷 처리 : String Type SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); user.setSctime(formatter.format(request.getSession().getCreationTime())); // 세션 생성시간 처리 : Date Type user.setSctimeDate(new Date(request.getSession().getCreationTime())); request.getSession().setAttribute("loginUser",user); message = "~~ UserVO Test 중 !!! 정상 로그인 후 이용하세요 ~~" ; uri = "/index.jsp"; }else { // password 오류 message = "~~ password 오류 !!! 다시 하세요 ~~" ; } }else { // id 오류 message = "~~ id 오류 !!! 다시 하세요 ~~" ; } // 3. View 처리 : forward if (message != null) request.setAttribute("message", message); request.getRequestDispatcher(uri).forward(request, response); } //doGet protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } } //class
2,593
0.674906
0.669878
79
29.215189
23.030344
119
false
false
0
0
0
0
0
0
2.455696
false
false
1
437f04c4ae9f82fd808d490a9e9a4dce0be94d31
10,934,986,771,227
1b407dbe618598034e24fdfd933a26dd9956d9b6
/src/com/es/employees/EmployeesDto.java
8caac511f6e2f38928e366256e14d8970546a078
[]
no_license
Myounghwany/EducationSystem
https://github.com/Myounghwany/EducationSystem
934008007ba9d3044462738970742532f13feb9a
9e764974cd2546a24273ab09af045a55046bb94a
refs/heads/master
2020-03-27T08:31:10.947000
2018-06-03T15:46:49
2018-06-03T15:46:49
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.es.employees; public class EmployeesDto { private String emp_no; private String name; private String identity_no; private String address; private String phone; private String email; private int position_no; private int dept_no; private int belong_no; public EmployeesDto() { } public EmployeesDto(String emp_no, String name, String identity_no, String address, String phone, String email, int position_no, int dept_no, int belong_no) { this.emp_no = emp_no; this.name = name; this.identity_no = identity_no; this.address = address; this.phone = phone; this.email = email; this.position_no = position_no; this.dept_no = dept_no; this.belong_no = belong_no; } public String getEmp_no() { return emp_no; } public void setEmp_no(String emp_no) { this.emp_no = emp_no; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getIdentity_no() { return identity_no; } public void setIdentity_no(String identity_no) { this.identity_no = identity_no; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public int getPosition_no() { return position_no; } public void setPosition_no(int position_no) { this.position_no = position_no; } public int getDept_no() { return dept_no; } public void setDept_no(int dept_no) { this.dept_no = dept_no; } public int getBelong_no() { return belong_no; } public void setBelong_no(int belong_no) { this.belong_no = belong_no; } }
UTF-8
Java
1,808
java
EmployeesDto.java
Java
[]
null
[]
package com.es.employees; public class EmployeesDto { private String emp_no; private String name; private String identity_no; private String address; private String phone; private String email; private int position_no; private int dept_no; private int belong_no; public EmployeesDto() { } public EmployeesDto(String emp_no, String name, String identity_no, String address, String phone, String email, int position_no, int dept_no, int belong_no) { this.emp_no = emp_no; this.name = name; this.identity_no = identity_no; this.address = address; this.phone = phone; this.email = email; this.position_no = position_no; this.dept_no = dept_no; this.belong_no = belong_no; } public String getEmp_no() { return emp_no; } public void setEmp_no(String emp_no) { this.emp_no = emp_no; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getIdentity_no() { return identity_no; } public void setIdentity_no(String identity_no) { this.identity_no = identity_no; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public int getPosition_no() { return position_no; } public void setPosition_no(int position_no) { this.position_no = position_no; } public int getDept_no() { return dept_no; } public void setDept_no(int dept_no) { this.dept_no = dept_no; } public int getBelong_no() { return belong_no; } public void setBelong_no(int belong_no) { this.belong_no = belong_no; } }
1,808
0.689712
0.689712
85
20.270588
16.795929
112
false
false
0
0
0
0
0
0
1.835294
false
false
1
f394f2ff9be9b0513d97908e01bf72af7996c701
2,327,872,293,654
6d119a21933a8903f9f16e85d26e54565ff719d0
/src/Tree.java
acd7ae032d2c818f7c27999c67489363c990dc3e
[]
no_license
Taesthetic/Tris
https://github.com/Taesthetic/Tris
b245ddbc917a97db12ff792f8caaa902d86d6b97
72d521e3406ae3dd18def03f88e3d7ce43f6873c
refs/heads/master
2020-12-19T17:19:55.939000
2020-02-13T14:51:41
2020-02-13T14:51:41
235,799,042
1
1
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Tree<T> implements Iterable<Node<T>> { private List<Node<T>> tree; public Tree(List<T> list) { int size = list.size(); if (size == 0) throw new IndexOutOfBoundsException(); tree = new ArrayList<>(); int i = 0; int state = 0; for (int j = 0; j < size; j++) { switch (state) { case 0: tree.add(new Node<T>(list.get(i))); break; case 1: tree.get(i).setLeftChild(new Node<>(list.get(2*i+1))); break; case 2: tree.get(i).setRightChild(new Node<T>(list.get(2*i+2))); i++; break; } if (state == 2) state = 0; else state++; } } @Override public Iterator<Node<T>> iterator() { return new TreeIterator<>(tree); } }
UTF-8
Java
1,069
java
Tree.java
Java
[]
null
[]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Tree<T> implements Iterable<Node<T>> { private List<Node<T>> tree; public Tree(List<T> list) { int size = list.size(); if (size == 0) throw new IndexOutOfBoundsException(); tree = new ArrayList<>(); int i = 0; int state = 0; for (int j = 0; j < size; j++) { switch (state) { case 0: tree.add(new Node<T>(list.get(i))); break; case 1: tree.get(i).setLeftChild(new Node<>(list.get(2*i+1))); break; case 2: tree.get(i).setRightChild(new Node<T>(list.get(2*i+2))); i++; break; } if (state == 2) state = 0; else state++; } } @Override public Iterator<Node<T>> iterator() { return new TreeIterator<>(tree); } }
1,069
0.434051
0.42189
40
25.725
17.836742
76
false
false
0
0
0
0
0
0
0.525
false
false
1
d218dcb9c6493b45345b6dc7b9446f80da98de4e
3,813,930,985,266
54c963ac435afa8c7acabb23021aab288dedf6fb
/pmms/src/trackit/backingbeans/LoanBean.java
f89c7ec601dffa88171af994e547769f42e5f3b4
[]
no_license
nabil1st/PMMS_app
https://github.com/nabil1st/PMMS_app
d85dc01a07e226c5913dee5e980b325081c2ad2f
8f014c42e046a2f6c7f4bc13612aaa8b12f69537
refs/heads/main
2023-02-27T16:33:46.810000
2021-02-09T18:25:09
2021-02-09T18:25:09
337,291,922
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package trackit.backingbeans; import java.util.List; import java.util.Map; import javax.faces.model.SelectItem; import trackit.businessobjects.Entity; import trackit.businessobjects.Payee; import trackit.exception.EntityException; import trackit.util.FacesUtils; import trackit.util.ListUtils; /** * * @author Nabil Daoud */ public class LoanBean extends GenericPaymentEnabledBean { private Long borrowerId; private Long payeeId; private Long groupId; private String description; private Long userId; private Map<Long, Payee> payeeLookup; public LoanBean(){} public Long getPayeeId() { return payeeId; } public void setPayeeId(Long payeeId) { this.payeeId = payeeId; } public String getPayeeName() { if (payeeLookup != null && payeeId != null) { Payee payee = payeeLookup.get(payeeId); if (payee != null) { return payee.getDescription(); } } return ""; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getBorrowerId() { return borrowerId; } public void setBorrowerId(Long borrowerId) { this.borrowerId = borrowerId; } public Long getGroupId() { return groupId; } public void setGroupId(Long groupId) { this.groupId = groupId; } public List<SelectItem> getBorrowerList() { return ListUtils.getBorrowersList(this.serviceLocator, true); } public List<SelectItem> getPayeeList() { return ListUtils.getPayeeList(this.serviceLocator, true); } public List<SelectItem> getExpenseGroupList() { return ListUtils.getExpenseGroupList(serviceLocator, true); } public void clearAllFields() { super.clearAllFields(); this.description = null; this.payeeId = null; this.borrowerId = null; } public String addExpenseGroupAction() throws EntityException { FacesUtils.getSessionBean().setFollowOnAction( NavigationResults.CREATE_LOAN_REQUESTED); return NavigationResults.CREATE_EXPENSE_GROUP_REQUESTED; } public String addExpenseTypeAction() throws EntityException { FacesUtils.getSessionBean().setFollowOnAction( NavigationResults.CREATE_LOAN_REQUESTED); return NavigationResults.CREATE_EXPENSE_TYPE_REQUESTED; } public String addPayeeAction() throws EntityException { FacesUtils.getSessionBean().setFollowOnAction( NavigationResults.CREATE_LOAN_REQUESTED); return NavigationResults.CREATE_PAYEE_REQUESTED; } public String addBorrowerAction() throws EntityException { FacesUtils.getSessionBean().setFollowOnAction( NavigationResults.CREATE_LOAN_REQUESTED); return NavigationResults.CREATE_BORROWER_REQUESTED; } @Override public String doCancel() { clearAllFields(); return NavigationResults.CREATE_LOAN_CANCELLED; } @Override public String createIt() throws Exception { this.serviceLocator.getLoanTransactionalService().setServiceLocator(serviceLocator); try { this.serviceLocator.getLoanTransactionalService().saveLoan(this); } catch (Exception ex) { throw new Exception("Loan was not created"); } clearAllFields(); return NavigationResults.LOAN_CREATED; } @Override public String getListBeanName() { return null; } @Override public void validate() throws Exception { super.validate(); if (ListUtils.isNullSelection(borrowerId)) { throw new Exception("Borrower is a required field"); } } @Override public String getFollowOnAction() { return NavigationResults.CREATE_LOAN_REQUESTED; } @Override public void editIt(Entity entity) { // TODO Auto-generated method stub } }
UTF-8
Java
4,181
java
LoanBean.java
Java
[ { "context": "\nimport trackit.util.ListUtils;\n\n/**\n *\n * @author Nabil Daoud\n */\npublic class LoanBean extends GenericPaymentE", "end": 326, "score": 0.999851405620575, "start": 315, "tag": "NAME", "value": "Nabil Daoud" } ]
null
[]
package trackit.backingbeans; import java.util.List; import java.util.Map; import javax.faces.model.SelectItem; import trackit.businessobjects.Entity; import trackit.businessobjects.Payee; import trackit.exception.EntityException; import trackit.util.FacesUtils; import trackit.util.ListUtils; /** * * @author <NAME> */ public class LoanBean extends GenericPaymentEnabledBean { private Long borrowerId; private Long payeeId; private Long groupId; private String description; private Long userId; private Map<Long, Payee> payeeLookup; public LoanBean(){} public Long getPayeeId() { return payeeId; } public void setPayeeId(Long payeeId) { this.payeeId = payeeId; } public String getPayeeName() { if (payeeLookup != null && payeeId != null) { Payee payee = payeeLookup.get(payeeId); if (payee != null) { return payee.getDescription(); } } return ""; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public Long getBorrowerId() { return borrowerId; } public void setBorrowerId(Long borrowerId) { this.borrowerId = borrowerId; } public Long getGroupId() { return groupId; } public void setGroupId(Long groupId) { this.groupId = groupId; } public List<SelectItem> getBorrowerList() { return ListUtils.getBorrowersList(this.serviceLocator, true); } public List<SelectItem> getPayeeList() { return ListUtils.getPayeeList(this.serviceLocator, true); } public List<SelectItem> getExpenseGroupList() { return ListUtils.getExpenseGroupList(serviceLocator, true); } public void clearAllFields() { super.clearAllFields(); this.description = null; this.payeeId = null; this.borrowerId = null; } public String addExpenseGroupAction() throws EntityException { FacesUtils.getSessionBean().setFollowOnAction( NavigationResults.CREATE_LOAN_REQUESTED); return NavigationResults.CREATE_EXPENSE_GROUP_REQUESTED; } public String addExpenseTypeAction() throws EntityException { FacesUtils.getSessionBean().setFollowOnAction( NavigationResults.CREATE_LOAN_REQUESTED); return NavigationResults.CREATE_EXPENSE_TYPE_REQUESTED; } public String addPayeeAction() throws EntityException { FacesUtils.getSessionBean().setFollowOnAction( NavigationResults.CREATE_LOAN_REQUESTED); return NavigationResults.CREATE_PAYEE_REQUESTED; } public String addBorrowerAction() throws EntityException { FacesUtils.getSessionBean().setFollowOnAction( NavigationResults.CREATE_LOAN_REQUESTED); return NavigationResults.CREATE_BORROWER_REQUESTED; } @Override public String doCancel() { clearAllFields(); return NavigationResults.CREATE_LOAN_CANCELLED; } @Override public String createIt() throws Exception { this.serviceLocator.getLoanTransactionalService().setServiceLocator(serviceLocator); try { this.serviceLocator.getLoanTransactionalService().saveLoan(this); } catch (Exception ex) { throw new Exception("Loan was not created"); } clearAllFields(); return NavigationResults.LOAN_CREATED; } @Override public String getListBeanName() { return null; } @Override public void validate() throws Exception { super.validate(); if (ListUtils.isNullSelection(borrowerId)) { throw new Exception("Borrower is a required field"); } } @Override public String getFollowOnAction() { return NavigationResults.CREATE_LOAN_REQUESTED; } @Override public void editIt(Entity entity) { // TODO Auto-generated method stub } }
4,176
0.661803
0.661803
168
23.886906
22.204254
86
false
false
0
0
0
0
0
0
0.577381
false
false
1
09292255b693808cf7d901c694beb313f8423b80
27,951,647,212,513
0fd30f574b286d2814ad0777f9468c3adb132e01
/src/main/java/com/mj/modernjava/common/Dish.java
21165c6bb66a8d325884920dfae8716d6aebbdbf
[]
no_license
HyeongJunMin/ModernJava
https://github.com/HyeongJunMin/ModernJava
2a052fde2ab665f5afa87613dfd72b5e7b7d9d3a
3d79704ff52206b6c541143dab8ba3ff5c7dd2dd
refs/heads/master
2021-05-17T22:15:09.784000
2020-10-28T09:56:31
2020-10-28T09:56:31
250,975,345
0
0
null
false
2020-10-13T23:11:59
2020-03-29T07:16:03
2020-10-10T05:21:12
2020-10-13T23:11:58
266
0
0
1
Java
false
false
package com.mj.modernjava.common; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.ToString; @Getter @ToString @AllArgsConstructor public class Dish { private final String name; private final boolean vegeterian; private final Integer calories; private final Type type; public CaloricalLevel getCaloricalLevel() { if (this.getCalories() <= 400) return CaloricalLevel.DIET; else if (this.getCalories() <= 700) return CaloricalLevel.NORMAL; else return CaloricalLevel.FAT; } public enum Type { MEAT, FISH, OTHER } public enum CaloricalLevel { DIET, NORMAL, FAT } }
UTF-8
Java
616
java
Dish.java
Java
[]
null
[]
package com.mj.modernjava.common; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.ToString; @Getter @ToString @AllArgsConstructor public class Dish { private final String name; private final boolean vegeterian; private final Integer calories; private final Type type; public CaloricalLevel getCaloricalLevel() { if (this.getCalories() <= 400) return CaloricalLevel.DIET; else if (this.getCalories() <= 700) return CaloricalLevel.NORMAL; else return CaloricalLevel.FAT; } public enum Type { MEAT, FISH, OTHER } public enum CaloricalLevel { DIET, NORMAL, FAT } }
616
0.751623
0.741883
25
23.639999
19.766396
69
false
false
0
0
0
0
0
0
0.6
false
false
1
5afe0aabfe4ef81699d9a22070af9db42bdfdf21
11,982,958,771,285
bb115c4e3367bf8d981f692285570f60820f4f26
/src/main/java/com/benhumphreys/jgitcassandra/repo/CassandraObjDatabase.java
1f9adfbffcd0f49b6114ada766844c9de6ed6f77
[ "Apache-2.0" ]
permissive
xavierchen/jgit-cassandra
https://github.com/xavierchen/jgit-cassandra
a4609224223bdbc49cf4940474e16755edfd60bd
010e3018665537572d2ea1b788cb394438cac7b6
refs/heads/master
2021-05-28T08:24:27.694000
2015-02-28T11:58:06
2015-02-28T11:58:06
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * A Cassandra backend for JGit * Copyright 2014-2015 Ben Humphreys * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.benhumphreys.jgitcassandra.repo; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.UUID; import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase; import org.eclipse.jgit.internal.storage.dfs.DfsOutputStream; import org.eclipse.jgit.internal.storage.dfs.DfsPackDescription; import org.eclipse.jgit.internal.storage.dfs.DfsReaderOptions; import org.eclipse.jgit.internal.storage.dfs.DfsRepository; import org.eclipse.jgit.internal.storage.dfs.ReadableChannel; import org.eclipse.jgit.internal.storage.pack.PackExt; import com.benhumphreys.jgitcassandra.store.ObjStore; import com.benhumphreys.jgitcassandra.store.StoreConnection; class CassandraObjDatabase extends DfsObjDatabase { /** * ObjStore object provides access to the Cassandra database */ private final ObjStore objstore; /** * Constructor * * @param repository a reference to the repository this ref database * is associated with. * @param conn connection to the Cassandra data store. */ public CassandraObjDatabase(DfsRepository repository, StoreConnection conn) throws IOException { super(repository, new DfsReaderOptions()); objstore = new ObjStore(repository.getDescription().getRepositoryName(), conn.getSession(), repository.getDescription()); } /** * Implementation of pack commit. * * @param desc description of the new packs. * @param replaces if not null, list of packs to remove. * @throws IOException if the packs could not be committed */ @Override protected void commitPackImpl(Collection<DfsPackDescription> desc, Collection<DfsPackDescription> replaces) throws IOException { if (replaces != null && !replaces.isEmpty()) { objstore.removeDesc(replaces); } objstore.insertDesc(desc); } /** * List the available pack files. * The returned list supports random access and is mutable by the caller. * * @return available packs. May be empty if there are no packs. * @throws java.io.IOException if a list of packs could not be retrieved * from the store */ @Override protected List<DfsPackDescription> listPacks() throws IOException { return objstore.listPacks(); } /** * Generate a new unique name for a pack file. * * @param source where the pack stream is created * @return a unique name for the pack file. Guaranteed not to collide * with any other pack file name in the same DFS. * @throws IOException if a new pack name could not be generated */ @Override protected DfsPackDescription newPack(PackSource source) throws IOException { DfsPackDescription desc = new DfsPackDescription( getRepository().getDescription(), UUID.randomUUID() + "-" + source.name()); return desc.setPackSource(source); } /** * Rollback a pack creation. * * @param desc pack to delete */ @Override protected void rollbackPack(Collection<DfsPackDescription> desc) { // Since new packs are not persisted until they are committed, no need // to do anything here } /** * Open a pack, pack index, or other related file for reading. * * @param desc description of pack related to the data that will be read. * This is an instance previously obtained from listPacks(), * but not necessarily from the same DfsObjDatabase instance. * @param ext file extension that will be read i.e "pack" or "idx". * @return channel to read the file * @throws FileNotFoundException if the specified file does not exist * @throws IOException if the file could not be opened */ @Override protected ReadableChannel openFile(DfsPackDescription desc, PackExt ext) throws IOException { return new CassandraReadableChannel(objstore.readFile(desc, ext)); } /** * Open a pack, pack index, or other related file for writing. * * @param desc description of pack related to the data that will be * written. This is an instance previously obtained from * newPack(PackSource). * @param ext file extension that will be written i.e "pack" or "idx". * @return channel to write the file * @throws IOException the file cannot be opened. */ @Override protected DfsOutputStream writeFile(DfsPackDescription desc, PackExt ext) throws IOException { return new CassandraOutputStream(objstore, desc, ext); } }
UTF-8
Java
5,469
java
CassandraObjDatabase.java
Java
[ { "context": " Cassandra backend for JGit\n * Copyright 2014-2015 Ben Humphreys\n *\n * Licensed under the Apache License, Version ", "end": 71, "score": 0.9998629689216614, "start": 58, "tag": "NAME", "value": "Ben Humphreys" } ]
null
[]
/* * A Cassandra backend for JGit * Copyright 2014-2015 <NAME> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.benhumphreys.jgitcassandra.repo; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.UUID; import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase; import org.eclipse.jgit.internal.storage.dfs.DfsOutputStream; import org.eclipse.jgit.internal.storage.dfs.DfsPackDescription; import org.eclipse.jgit.internal.storage.dfs.DfsReaderOptions; import org.eclipse.jgit.internal.storage.dfs.DfsRepository; import org.eclipse.jgit.internal.storage.dfs.ReadableChannel; import org.eclipse.jgit.internal.storage.pack.PackExt; import com.benhumphreys.jgitcassandra.store.ObjStore; import com.benhumphreys.jgitcassandra.store.StoreConnection; class CassandraObjDatabase extends DfsObjDatabase { /** * ObjStore object provides access to the Cassandra database */ private final ObjStore objstore; /** * Constructor * * @param repository a reference to the repository this ref database * is associated with. * @param conn connection to the Cassandra data store. */ public CassandraObjDatabase(DfsRepository repository, StoreConnection conn) throws IOException { super(repository, new DfsReaderOptions()); objstore = new ObjStore(repository.getDescription().getRepositoryName(), conn.getSession(), repository.getDescription()); } /** * Implementation of pack commit. * * @param desc description of the new packs. * @param replaces if not null, list of packs to remove. * @throws IOException if the packs could not be committed */ @Override protected void commitPackImpl(Collection<DfsPackDescription> desc, Collection<DfsPackDescription> replaces) throws IOException { if (replaces != null && !replaces.isEmpty()) { objstore.removeDesc(replaces); } objstore.insertDesc(desc); } /** * List the available pack files. * The returned list supports random access and is mutable by the caller. * * @return available packs. May be empty if there are no packs. * @throws java.io.IOException if a list of packs could not be retrieved * from the store */ @Override protected List<DfsPackDescription> listPacks() throws IOException { return objstore.listPacks(); } /** * Generate a new unique name for a pack file. * * @param source where the pack stream is created * @return a unique name for the pack file. Guaranteed not to collide * with any other pack file name in the same DFS. * @throws IOException if a new pack name could not be generated */ @Override protected DfsPackDescription newPack(PackSource source) throws IOException { DfsPackDescription desc = new DfsPackDescription( getRepository().getDescription(), UUID.randomUUID() + "-" + source.name()); return desc.setPackSource(source); } /** * Rollback a pack creation. * * @param desc pack to delete */ @Override protected void rollbackPack(Collection<DfsPackDescription> desc) { // Since new packs are not persisted until they are committed, no need // to do anything here } /** * Open a pack, pack index, or other related file for reading. * * @param desc description of pack related to the data that will be read. * This is an instance previously obtained from listPacks(), * but not necessarily from the same DfsObjDatabase instance. * @param ext file extension that will be read i.e "pack" or "idx". * @return channel to read the file * @throws FileNotFoundException if the specified file does not exist * @throws IOException if the file could not be opened */ @Override protected ReadableChannel openFile(DfsPackDescription desc, PackExt ext) throws IOException { return new CassandraReadableChannel(objstore.readFile(desc, ext)); } /** * Open a pack, pack index, or other related file for writing. * * @param desc description of pack related to the data that will be * written. This is an instance previously obtained from * newPack(PackSource). * @param ext file extension that will be written i.e "pack" or "idx". * @return channel to write the file * @throws IOException the file cannot be opened. */ @Override protected DfsOutputStream writeFile(DfsPackDescription desc, PackExt ext) throws IOException { return new CassandraOutputStream(objstore, desc, ext); } }
5,462
0.675626
0.673432
144
36.979168
28.125826
95
false
false
0
0
0
0
0
0
0.333333
false
false
1
d0436753198a2271b39a6d81cf870103f2b55fd3
26,860,725,518,414
9aae01266df2183d7d07f78f48eff0938c6960dc
/AYParser/src/main/java/de/aboutyou/Main.java
b27657f1696d9ac08c288ca86354340a434423c8
[]
no_license
AnastasiaKozachuk/AYParser
https://github.com/AnastasiaKozachuk/AYParser
92336882c4987ed910c84c1bac94a2d0314e57e8
cd445bf64e0d8f76d9f91b0d4bdc87619250e715
refs/heads/master
2020-03-08T10:10:48.842000
2018-04-04T13:30:05
2018-04-04T13:30:05
128,065,838
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package de.aboutyou; import java.util.logging.Logger; import de.aboutyou.service.StartParsing; /** * @author Anastasiia Kozachuk * */ public class Main { private static final Logger LOGGER = Logger.getLogger( Main.class.getName() ); public static void main( String[] args ) { long beforeUsedMem=Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory(); StartParsing parserAY = new StartParsing(args[0]); parserAY.runParsing(); long afterUsedMem=Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory(); LOGGER.info("\nMemory footprint: "+(afterUsedMem-beforeUsedMem)+" bytes\n"); } }
UTF-8
Java
713
java
Main.java
Java
[ { "context": ".aboutyou.service.StartParsing;\r\n\r\n/**\r\n * @author Anastasiia Kozachuk\r\n *\r\n */\r\npublic class Main \r\n{\r\n\tprivate static ", "end": 139, "score": 0.9998568296432495, "start": 120, "tag": "NAME", "value": "Anastasiia Kozachuk" } ]
null
[]
package de.aboutyou; import java.util.logging.Logger; import de.aboutyou.service.StartParsing; /** * @author <NAME> * */ public class Main { private static final Logger LOGGER = Logger.getLogger( Main.class.getName() ); public static void main( String[] args ) { long beforeUsedMem=Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory(); StartParsing parserAY = new StartParsing(args[0]); parserAY.runParsing(); long afterUsedMem=Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory(); LOGGER.info("\nMemory footprint: "+(afterUsedMem-beforeUsedMem)+" bytes\n"); } }
700
0.654979
0.653576
28
23.464285
29.662966
93
false
false
0
0
0
0
0
0
0.75
false
false
1
cf123a03e36485909f0a4143be6a7a4e2c94031a
16,226,386,474,716
d3e460f7778b7a31dad1116ec5a64374ce3e1cf7
/JavaHomeWork/src/JanHomeWork/HW3Polymorphism.java
67e048681eb7e75e116477125ca30545a6401de5
[]
no_license
LearnWeb2019/JavaHW
https://github.com/LearnWeb2019/JavaHW
54d10f4c6ccf16eadbae76eb99c428feb188c2c2
107fa2416d89a5f0812604cc2df86e921db42f09
refs/heads/master
2023-02-22T02:31:20.343000
2021-01-21T14:55:23
2021-01-21T14:55:23
330,694,288
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package JanHomeWork; import java.util.Scanner; class OverRidingMethods{ int num1, num2; float flt1, flt2; void sum(int x, int y) { System.out.println("Method 01: Sum of two int parameters " + x + " and " + y + " is " + (x+y)); } void sum(float x, float y) { System.out.println("Method 02: Sum of two float parameters " + x + " and " + y + " is " + (x+y)); } void sum(int x, float y) { System.out.println("Method 03: Sum of int and float parameters " + x + " and " + y + " is " + (x+y)); } void sum(float x, int y) { System.out.println("Method 04: Sum of float and int parameters " + x + " and " + y + " is " + (x+y)); } void sum(int x) { System.out.println("Method 05: with one int parameters " + x); } } public class HW3Polymorphism { public static void main(String[] args) { Scanner sc = new Scanner(System.in); OverRidingMethods or = new OverRidingMethods(); or.num1 = sc.nextInt(); or.num2 = sc.nextInt(); or.flt1 = sc.nextFloat(); or.flt2 = sc.nextFloat(); or.sum(or.num1,or.num2); or.sum(or.flt1,or.flt2); or.sum(or.num1,or.flt2); or.sum(or.flt1,or.num2); or.sum(or.num2); } }
UTF-8
Java
1,231
java
HW3Polymorphism.java
Java
[]
null
[]
package JanHomeWork; import java.util.Scanner; class OverRidingMethods{ int num1, num2; float flt1, flt2; void sum(int x, int y) { System.out.println("Method 01: Sum of two int parameters " + x + " and " + y + " is " + (x+y)); } void sum(float x, float y) { System.out.println("Method 02: Sum of two float parameters " + x + " and " + y + " is " + (x+y)); } void sum(int x, float y) { System.out.println("Method 03: Sum of int and float parameters " + x + " and " + y + " is " + (x+y)); } void sum(float x, int y) { System.out.println("Method 04: Sum of float and int parameters " + x + " and " + y + " is " + (x+y)); } void sum(int x) { System.out.println("Method 05: with one int parameters " + x); } } public class HW3Polymorphism { public static void main(String[] args) { Scanner sc = new Scanner(System.in); OverRidingMethods or = new OverRidingMethods(); or.num1 = sc.nextInt(); or.num2 = sc.nextInt(); or.flt1 = sc.nextFloat(); or.flt2 = sc.nextFloat(); or.sum(or.num1,or.num2); or.sum(or.flt1,or.flt2); or.sum(or.num1,or.flt2); or.sum(or.flt1,or.num2); or.sum(or.num2); } }
1,231
0.570268
0.547522
53
21.226416
20.288153
69
false
false
0
0
0
0
0
0
2.132076
false
false
1
bbb78548cd63d4cda9080d8e748a9bceb9737afb
798,863,933,661
e6ecb76c4e489b6a07ace650e7acbd249ac7226a
/JavaAbstractandInterfaceStudy/cn.Daxiong/第20节_图形结构/Test.java
f2637c2830fa71d5b8768980fa71298d231693c4
[]
no_license
lujianxiong/JavaBasics
https://github.com/lujianxiong/JavaBasics
e8b104abcd2bac679eb838d44d4ba3f8caa37c9b
77464b4fa8131b392a4316866d441793822cf142
refs/heads/master
2022-12-18T10:58:57.536000
2020-10-10T02:12:09
2020-10-10T02:12:09
302,792,679
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package 第20节_图形结构; public class Test { public static void main(String[] args) { AbstractShape a = Factory.getInstance("Circular",1.1); AbstractShape b = Factory.getInstance("Rectangle",1,2,1,3); System.out.println(" 圆形的面积:"+a.area()+"、圆形的周长"+a.perimeter()); System.out.println("矩形的面积"+b.area()+"、矩形的周长"+b.perimeter()); } }
UTF-8
Java
422
java
Test.java
Java
[]
null
[]
package 第20节_图形结构; public class Test { public static void main(String[] args) { AbstractShape a = Factory.getInstance("Circular",1.1); AbstractShape b = Factory.getInstance("Rectangle",1,2,1,3); System.out.println(" 圆形的面积:"+a.area()+"、圆形的周长"+a.perimeter()); System.out.println("矩形的面积"+b.area()+"、矩形的周长"+b.perimeter()); } }
422
0.629121
0.607143
10
35.400002
28.235439
70
false
false
0
0
0
0
0
0
1
false
false
1
1864f8b1fdd8f629979b3643807949dbe2fb8b60
26,989,574,500,293
455c2df145dabfaa1352c5d0bbe556fcdc6c0016
/sharkapp/src/main/java/com/shark/app/business/resultentity/Check.java
c2cff6c411ccb91462b711d8d0ac942598e36059
[]
no_license
srxffcc1/SingleShark
https://github.com/srxffcc1/SingleShark
e35a3159e87c0984533ec5fced7c77fec9a8df44
09cfbd6bc319dcdb464a3b4a980c42976031042a
refs/heads/master
2021-08-18T08:11:27.707000
2018-10-31T01:25:06
2018-10-31T01:25:06
94,157,210
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.shark.app.business.resultentity; /** * Created by King6rf on 2017/9/25. */ public class Check { }
UTF-8
Java
114
java
Check.java
Java
[ { "context": "hark.app.business.resultentity;\n\n/**\n * Created by King6rf on 2017/9/25.\n */\n\npublic class Check {\n}\n", "end": 71, "score": 0.9993000626564026, "start": 64, "tag": "USERNAME", "value": "King6rf" } ]
null
[]
package com.shark.app.business.resultentity; /** * Created by King6rf on 2017/9/25. */ public class Check { }
114
0.692982
0.622807
8
13.25
16.490528
44
false
false
0
0
0
0
0
0
0.125
false
false
1
6217dfdf22f1053aa16dcc3a2ef3253886409144
23,699,629,578,823
2f4a058ab684068be5af77fea0bf07665b675ac0
/app/com/facebook/katana/binding/ManagedDataStore$Mode.java
9c27696ad46a87d986b5a35eca27fde3253297c5
[]
no_license
cengizgoren/facebook_apk_crack
https://github.com/cengizgoren/facebook_apk_crack
ee812a57c746df3c28fb1f9263ae77190f08d8d2
a112d30542b9f0bfcf17de0b3a09c6e6cfe1273b
refs/heads/master
2021-05-26T14:44:04.092000
2013-01-16T08:39:00
2013-01-16T08:39:00
8,321,708
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.facebook.katana.binding; public enum ManagedDataStore$Mode { static { SINGLE_REQUEST_BY_KEY = new Mode("SINGLE_REQUEST_BY_KEY", 1); SINGLE_REQUEST = new Mode("SINGLE_REQUEST", 2); Mode[] arrayOfMode = new Mode[3]; arrayOfMode[0] = UNRESTRICTED; arrayOfMode[1] = SINGLE_REQUEST_BY_KEY; arrayOfMode[2] = SINGLE_REQUEST; $VALUES = arrayOfMode; } } /* Location: /data1/software/jd-gui/com.facebook.katana_2.0_liqucn.com-dex2jar.jar * Qualified Name: com.facebook.katana.binding.ManagedDataStore.Mode * JD-Core Version: 0.6.0 */
UTF-8
Java
591
java
ManagedDataStore$Mode.java
Java
[]
null
[]
package com.facebook.katana.binding; public enum ManagedDataStore$Mode { static { SINGLE_REQUEST_BY_KEY = new Mode("SINGLE_REQUEST_BY_KEY", 1); SINGLE_REQUEST = new Mode("SINGLE_REQUEST", 2); Mode[] arrayOfMode = new Mode[3]; arrayOfMode[0] = UNRESTRICTED; arrayOfMode[1] = SINGLE_REQUEST_BY_KEY; arrayOfMode[2] = SINGLE_REQUEST; $VALUES = arrayOfMode; } } /* Location: /data1/software/jd-gui/com.facebook.katana_2.0_liqucn.com-dex2jar.jar * Qualified Name: com.facebook.katana.binding.ManagedDataStore.Mode * JD-Core Version: 0.6.0 */
591
0.678511
0.656514
20
28.6
26.194275
92
false
false
0
0
0
0
0
0
0.5
false
false
1
d527ff07c18262c988c9bfa7042f334d1e12b7e7
23,699,629,580,937
0ff5a7a6bcdbd09411b385f2a2496a5c329dc8f9
/NumRush/app/src/main/java/com/jordanh/numrush/MainActivity.java
d0db39e7237a9ef229264644b5aece06d3a52f03
[]
no_license
Jordan-H/Number-Rush
https://github.com/Jordan-H/Number-Rush
eac27d25caff0ae7e3ed2f5aa8f6ee1d491d0101
3355a9812ef4dbbc75edd11539f7b10c82b98674
refs/heads/master
2021-01-11T12:09:49.357000
2017-01-19T22:56:32
2017-01-19T22:56:32
79,424,369
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.jordanh.numrush; import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView highScore; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); highScore = (TextView) findViewById(R.id.highScore); SharedPreferences sp = getSharedPreferences("Scores", Activity.MODE_PRIVATE); int myHigh = sp.getInt("high_score", -1); highScore.setText("My Highscore: " + String.valueOf(myHigh)); } public void startGame(View view){ Intent intent = new Intent(this, GameActivity.class); startActivity(intent); } public void showInstructions(View view){ AlertDialog.Builder instructionsDialog = new AlertDialog.Builder(this); instructionsDialog.setTitle("Instructions"); instructionsDialog.setMessage("Answer as many questions as you can before time runs out!\n" + "If you answer incorrectly, you will lose 5 seconds."); instructionsDialog.setPositiveButton("Ok", new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int d){ dialog.dismiss(); } }); instructionsDialog.show(); } }
UTF-8
Java
1,617
java
MainActivity.java
Java
[]
null
[]
package com.jordanh.numrush; import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView highScore; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); highScore = (TextView) findViewById(R.id.highScore); SharedPreferences sp = getSharedPreferences("Scores", Activity.MODE_PRIVATE); int myHigh = sp.getInt("high_score", -1); highScore.setText("My Highscore: " + String.valueOf(myHigh)); } public void startGame(View view){ Intent intent = new Intent(this, GameActivity.class); startActivity(intent); } public void showInstructions(View view){ AlertDialog.Builder instructionsDialog = new AlertDialog.Builder(this); instructionsDialog.setTitle("Instructions"); instructionsDialog.setMessage("Answer as many questions as you can before time runs out!\n" + "If you answer incorrectly, you will lose 5 seconds."); instructionsDialog.setPositiveButton("Ok", new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int d){ dialog.dismiss(); } }); instructionsDialog.show(); } }
1,617
0.702536
0.700062
48
32.6875
27.372551
101
false
false
0
0
0
0
0
0
0.645833
false
false
1
494c304c7793b726e805127e4388dfedcdb5441c
21,406,117,037,546
42ce17f5adff8c9a24276a2e26303ebfeb6f46e4
/portfolio-plugin-src/com/atlassian/rm/jpo/rest/service/resource/GsonScenarioResourceAddResponse.java
cdd131aa09b5035ba543c33c296d6613e463cbe7
[ "Apache-2.0" ]
permissive
tied/jira-5
https://github.com/tied/jira-5
1ffea0533cee2cbf351eda5a9f28380e893baa99
e7369b9092d730ca7c25622da8da6d2a80973316
refs/heads/master
2020-03-11T12:50:11.014000
2018-04-04T11:19:00
2018-04-04T11:19:00
130,008,681
1
0
null
true
2018-04-18T05:30:56
2018-04-18T05:30:55
2018-04-04T11:19:10
2018-04-04T11:19:09
13,530
0
0
0
null
false
null
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) ansi // Source File Name: GsonScenarioResourceAddResponse.java package com.atlassian.rm.jpo.rest.service.resource; import com.atlassian.rm.common.basics.gson.entities.GsonEntity; import com.atlassian.rm.common.basics.validation.Validation; import com.atlassian.rm.jpo.basics.scenario.Scenario; import com.atlassian.rm.jpo.core.scenario.common.result.ScenarioOperationResult; import com.atlassian.rm.jpo.core.scenario.common.result.changecount.ScenarioChangeCountGatekeeperService; import com.atlassian.rm.jpo.rest.service.person.list.GsonPerson; import com.atlassian.rm.jpo.rest.service.scenario.common.data.GsonScenarioChange; import com.google.common.base.Function; import com.google.common.base.Optional; public class GsonScenarioResourceAddResponse implements GsonEntity { private GsonScenarioResourceAddResponse() { } public static GsonScenarioResourceAddResponse create(Scenario scenario, String resourceItemKey, Optional person, ScenarioOperationResult scenarioOperationResult, ScenarioChangeCountGatekeeperService changeCountGatekeeperService) throws Exception { com.atlassian.rm.common.basics.validation.Validation.Optionals.notNullAndPresent(person); GsonScenarioResourceAddResponse gson = new GsonScenarioResourceAddResponse(); gson.resourceItemKey = resourceItemKey; gson.person = (GsonPerson)GsonPerson.TO_GSON.apply(person.get()); gson.change = GsonScenarioChange.from(changeCountGatekeeperService.verify(scenario, scenarioOperationResult.getChangeCount()), scenarioOperationResult.getChangeSequence()); return gson; } public String getResourceItemKey() { return resourceItemKey; } public GsonPerson getPerson() { return person; } public GsonScenarioChange getChange() { return change; } private String resourceItemKey; private GsonPerson person; private GsonScenarioChange change; }
UTF-8
Java
2,115
java
GsonScenarioResourceAddResponse.java
Java
[ { "context": "// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.\n// Jad home page: http://www.kpdus.com/jad.html\n", "end": 61, "score": 0.9996263980865479, "start": 45, "tag": "NAME", "value": "Pavel Kouznetsov" } ]
null
[]
// Decompiled by Jad v1.5.8g. Copyright 2001 <NAME>. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) ansi // Source File Name: GsonScenarioResourceAddResponse.java package com.atlassian.rm.jpo.rest.service.resource; import com.atlassian.rm.common.basics.gson.entities.GsonEntity; import com.atlassian.rm.common.basics.validation.Validation; import com.atlassian.rm.jpo.basics.scenario.Scenario; import com.atlassian.rm.jpo.core.scenario.common.result.ScenarioOperationResult; import com.atlassian.rm.jpo.core.scenario.common.result.changecount.ScenarioChangeCountGatekeeperService; import com.atlassian.rm.jpo.rest.service.person.list.GsonPerson; import com.atlassian.rm.jpo.rest.service.scenario.common.data.GsonScenarioChange; import com.google.common.base.Function; import com.google.common.base.Optional; public class GsonScenarioResourceAddResponse implements GsonEntity { private GsonScenarioResourceAddResponse() { } public static GsonScenarioResourceAddResponse create(Scenario scenario, String resourceItemKey, Optional person, ScenarioOperationResult scenarioOperationResult, ScenarioChangeCountGatekeeperService changeCountGatekeeperService) throws Exception { com.atlassian.rm.common.basics.validation.Validation.Optionals.notNullAndPresent(person); GsonScenarioResourceAddResponse gson = new GsonScenarioResourceAddResponse(); gson.resourceItemKey = resourceItemKey; gson.person = (GsonPerson)GsonPerson.TO_GSON.apply(person.get()); gson.change = GsonScenarioChange.from(changeCountGatekeeperService.verify(scenario, scenarioOperationResult.getChangeCount()), scenarioOperationResult.getChangeSequence()); return gson; } public String getResourceItemKey() { return resourceItemKey; } public GsonPerson getPerson() { return person; } public GsonScenarioChange getChange() { return change; } private String resourceItemKey; private GsonPerson person; private GsonScenarioChange change; }
2,105
0.776832
0.77305
55
37.454544
43.537159
232
false
false
0
0
0
0
0
0
0.509091
false
false
1
abc0dcbe0edf68bc5a30509688132f6f7bb24818
14,379,550,538,542
74d0124d63e49b7bcc76ce2a6953633c39594764
/service/src/main/java/com/ares/service/algorithms/leetcode/middle/SwapNodesInPairs.java
5d806e55ecb1e1d3f45e3ee22d453a0d9614bb79
[]
no_license
0xZzzz/ares
https://github.com/0xZzzz/ares
a22a923cc213a5fbc781262aa9a80ff13b0ee67e
e9c3ab2f167dd7b271f36952d704dac6f4c0fa3c
refs/heads/master
2023-06-22T01:13:50.063000
2022-12-11T15:30:25
2022-12-11T15:30:25
146,444,715
0
1
null
false
2023-06-14T22:46:50
2018-08-28T12:32:46
2021-12-09T09:02:46
2023-06-14T22:46:49
292
0
0
5
Java
false
false
package com.ares.service.algorithms.leetcode.middle; /** * 24. 两两交换链表中的节点 * https://leetcode.cn/problems/swap-nodes-in-pairs/ * <p> * 给你一个链表,两两交换其中相邻的节点,并返回交换后链表的头节点。你必须在不修改节点内部的值的情况下完成本题(即,只能进行节点交换)。 * <p> * 示例 1: * 输入:head = [1,2,3,4] * 输出:[2,1,4,3] * <p> * 示例 2: * 输入:head = [] * 输出:[] * <p> * 示例 3: * 输入:head = [1] * 输出:[1] * <p> * 提示: * 链表中节点的数目在范围 [0, 100] 内 * 0 <= Node.val <= 100 * * @author fansheng * @date 2022/6/11 */ public class SwapNodesInPairs { public static void main(String[] args) { ListNode n5 = new ListNode(5); ListNode n4 = new ListNode(4, n5); ListNode n3 = new ListNode(3, n4); ListNode n2 = new ListNode(2, n3); ListNode n1 = new ListNode(1, n2); print(self(n3)); } /** * 时间复杂度 O(N) * 空间复杂度 O(1) */ private static ListNode self(ListNode l) { if (l == null) { return null; } ListNode head = new ListNode(0); ListNode tmp = head; tmp.next = l; while (tmp.next != null && tmp.next.next != null) { ListNode n = tmp.next; ListNode nn = n.next; n.next = nn.next; nn.next = n; tmp.next = nn; tmp = n; } return head.next; } private static void print(ListNode head) { if (head == null) { System.out.println("null"); } else { StringBuilder sb = new StringBuilder().append(head.val); while (head.next != null) { head = head.next; sb.append(head.val); } System.out.println(sb); } } private static class ListNode { int val; ListNode next; ListNode() { } ListNode(int val) { this.val = val; } ListNode(int val, ListNode next) { this.val = val; this.next = next; } } }
UTF-8
Java
2,233
java
SwapNodesInPairs.java
Java
[ { "context": "围 [0, 100] 内\n * 0 <= Node.val <= 100\n *\n * @author fansheng\n * @date 2022/6/11\n */\npublic class SwapNodesInPa", "end": 431, "score": 0.8958056569099426, "start": 423, "tag": "USERNAME", "value": "fansheng" } ]
null
[]
package com.ares.service.algorithms.leetcode.middle; /** * 24. 两两交换链表中的节点 * https://leetcode.cn/problems/swap-nodes-in-pairs/ * <p> * 给你一个链表,两两交换其中相邻的节点,并返回交换后链表的头节点。你必须在不修改节点内部的值的情况下完成本题(即,只能进行节点交换)。 * <p> * 示例 1: * 输入:head = [1,2,3,4] * 输出:[2,1,4,3] * <p> * 示例 2: * 输入:head = [] * 输出:[] * <p> * 示例 3: * 输入:head = [1] * 输出:[1] * <p> * 提示: * 链表中节点的数目在范围 [0, 100] 内 * 0 <= Node.val <= 100 * * @author fansheng * @date 2022/6/11 */ public class SwapNodesInPairs { public static void main(String[] args) { ListNode n5 = new ListNode(5); ListNode n4 = new ListNode(4, n5); ListNode n3 = new ListNode(3, n4); ListNode n2 = new ListNode(2, n3); ListNode n1 = new ListNode(1, n2); print(self(n3)); } /** * 时间复杂度 O(N) * 空间复杂度 O(1) */ private static ListNode self(ListNode l) { if (l == null) { return null; } ListNode head = new ListNode(0); ListNode tmp = head; tmp.next = l; while (tmp.next != null && tmp.next.next != null) { ListNode n = tmp.next; ListNode nn = n.next; n.next = nn.next; nn.next = n; tmp.next = nn; tmp = n; } return head.next; } private static void print(ListNode head) { if (head == null) { System.out.println("null"); } else { StringBuilder sb = new StringBuilder().append(head.val); while (head.next != null) { head = head.next; sb.append(head.val); } System.out.println(sb); } } private static class ListNode { int val; ListNode next; ListNode() { } ListNode(int val) { this.val = val; } ListNode(int val, ListNode next) { this.val = val; this.next = next; } } }
2,233
0.485584
0.461811
91
20.725275
16.525084
69
false
false
0
0
0
0
0
0
0.43956
false
false
1
7b4937dc5ec90cce3867933128ff6d2a4cf97d74
27,960,237,141,553
0cb65010704d3fcd8c428555a9df5e2d1c82412a
/test-common/src/main/java/com/masterspring/common/concurrent/synch/Synchronized.java
26239a7b6524ef3303fd46ba9a139542077ea30d
[]
no_license
hyligithub/master-spring
https://github.com/hyligithub/master-spring
a60c05bca81f44f26ff94b8ea958e1502e451f7d
47374374ae5b68a880d89f750893ba3ff2986df0
refs/heads/master
2020-12-25T16:50:03.072000
2016-08-05T09:32:57
2016-08-05T09:32:57
54,524,466
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.masterspring.common.concurrent.synch; /** * Created by lihuiyan on 2016/5/4. */ public class Synchronized { public static void main(String[] args){ synchronized (Synchronized.class){ } m(); } public static synchronized void m(){} }
UTF-8
Java
284
java
Synchronized.java
Java
[ { "context": "spring.common.concurrent.synch;\n\n/**\n * Created by lihuiyan on 2016/5/4.\n */\npublic class Synchronized {\n ", "end": 77, "score": 0.9995739459991455, "start": 69, "tag": "USERNAME", "value": "lihuiyan" } ]
null
[]
package com.masterspring.common.concurrent.synch; /** * Created by lihuiyan on 2016/5/4. */ public class Synchronized { public static void main(String[] args){ synchronized (Synchronized.class){ } m(); } public static synchronized void m(){} }
284
0.633803
0.612676
13
20.846153
18.296053
49
false
false
0
0
0
0
0
0
0.153846
false
false
1
3240d74c63919cb76d6ca0f4911137d75e5356fd
27,960,237,140,145
d44843a088271725ec56633c2d62038644dd785d
/app/src/main/java/com/example/workflowguidance/LoginActivity.java
dbcaf95253692edcc950066ef7200706980d0aae
[]
no_license
ratwareid/WorkflowGuidance
https://github.com/ratwareid/WorkflowGuidance
e445573730954eb8322bddb5b1439021bebdb8de
0d22a94ef7ec00b8c65372be537ee77092a91f6e
refs/heads/master
2022-02-26T07:31:44.492000
2022-02-11T09:31:55
2022-02-11T09:31:55
175,226,454
4
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.workflowguidance; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.Toast; import com.example.workflowguidance.api.ApiService; import com.example.workflowguidance.api.ApiUrl; import com.example.workflowguidance.api.SharedPreferenceManager; import com.example.workflowguidance.api.module.UserModuleApi; import com.example.workflowguidance.api.spkey.SPUserDataKey; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class LoginActivity extends AppCompatActivity { private EditText eTEmail,eTPassword; private String email,pass; private SharedPreferenceManager spManager; private ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); eTEmail = findViewById(R.id.id_email_login); eTPassword = findViewById(R.id.id_password_login); spManager = new SharedPreferenceManager(this); if (spManager.getSp().getBoolean(SPUserDataKey.LOGGED,false)){ Intent intent = new Intent (LoginActivity.this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); finish(); } progressBar = findViewById(R.id.progressBar); progressBar.setVisibility(View.INVISIBLE); } public void doSignIn(View view){ boolean error = checkAllData(); if (!error) { email = eTEmail.getText().toString(); pass = eTPassword.getText().toString(); sendDatatoServer(email,pass); }else{ Toast.makeText(getApplicationContext(), "Please check your input data", Toast.LENGTH_SHORT).show(); } } public void sendDatatoServer(String em, String pw){ // Set up progress before call progressBar = findViewById(R.id.progressBar); progressBar.setVisibility(View.VISIBLE); Retrofit retrofit = new Retrofit.Builder() .baseUrl(ApiUrl.URL_HEAD) .addConverterFactory(GsonConverterFactory.create()) .build(); ApiService service = retrofit.create(ApiService.class); progressBar.setProgress(10); Call<UserModuleApi> call = service.Login(ApiUrl.API_KEY,em,pw); progressBar.setProgress(20); call.enqueue(new Callback<UserModuleApi>() { @Override public void onResponse(Call<UserModuleApi> call, Response<UserModuleApi> response) { progressBar.setProgress(30); if (response.isSuccessful()){ String responCode = response.body().getResponCode(); String responDesc = response.body().getResponDesc(); progressBar.setProgress(40); if (responCode != null) { if (responCode.equals("100")) { progressBar.setProgress(60); String name = response.body().getUserName(); String email = response.body().getEmail(); String companyID = response.body().getCompanyID(); progressBar.setProgress(80); Toast.makeText(LoginActivity.this, responDesc, Toast.LENGTH_SHORT).show(); Intent intent = new Intent(LoginActivity.this, MainActivity.class); progressBar.setProgress(85); //Untuk save session login spManager.saveSPString(SPUserDataKey.Username, name); spManager.saveSPString(SPUserDataKey.Email, email); spManager.saveSPString(SPUserDataKey.CompanyID, companyID); spManager.saveSPBoolean(SPUserDataKey.LOGGED, true); //Start Intent progressBar.setProgress(95); startActivity(intent); progressBar.setProgress(100); progressBar.setVisibility(View.GONE); finish(); } else { progressBar.setProgress(100); Toast.makeText(LoginActivity.this, responDesc, Toast.LENGTH_SHORT).show(); progressBar.setVisibility(View.INVISIBLE); } } } } @Override public void onFailure(Call<UserModuleApi> call, Throwable t) { progressBar.setProgress(100); Toast.makeText(LoginActivity.this,t.getMessage(),Toast.LENGTH_SHORT).show(); progressBar.setVisibility(View.INVISIBLE); } }); } public boolean checkAllData(){ boolean error = false; email = eTEmail.getText().toString(); pass = eTPassword.getText().toString(); if (!email.contains("@")){ eTEmail.setError("Invalid Email"); error = true; } if (TextUtils.isEmpty(email)){ eTEmail.setError("Please Fill Email"); error = true; } if (TextUtils.isEmpty(pass)){ eTPassword.setError("Please fill password"); error = true; } return error; } public void toRegister(View view){ Intent intent = new Intent(this,RegisterActivity.class); startActivity(intent); } }
UTF-8
Java
5,948
java
LoginActivity.java
Java
[]
null
[]
package com.example.workflowguidance; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.Toast; import com.example.workflowguidance.api.ApiService; import com.example.workflowguidance.api.ApiUrl; import com.example.workflowguidance.api.SharedPreferenceManager; import com.example.workflowguidance.api.module.UserModuleApi; import com.example.workflowguidance.api.spkey.SPUserDataKey; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class LoginActivity extends AppCompatActivity { private EditText eTEmail,eTPassword; private String email,pass; private SharedPreferenceManager spManager; private ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); eTEmail = findViewById(R.id.id_email_login); eTPassword = findViewById(R.id.id_password_login); spManager = new SharedPreferenceManager(this); if (spManager.getSp().getBoolean(SPUserDataKey.LOGGED,false)){ Intent intent = new Intent (LoginActivity.this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); finish(); } progressBar = findViewById(R.id.progressBar); progressBar.setVisibility(View.INVISIBLE); } public void doSignIn(View view){ boolean error = checkAllData(); if (!error) { email = eTEmail.getText().toString(); pass = eTPassword.getText().toString(); sendDatatoServer(email,pass); }else{ Toast.makeText(getApplicationContext(), "Please check your input data", Toast.LENGTH_SHORT).show(); } } public void sendDatatoServer(String em, String pw){ // Set up progress before call progressBar = findViewById(R.id.progressBar); progressBar.setVisibility(View.VISIBLE); Retrofit retrofit = new Retrofit.Builder() .baseUrl(ApiUrl.URL_HEAD) .addConverterFactory(GsonConverterFactory.create()) .build(); ApiService service = retrofit.create(ApiService.class); progressBar.setProgress(10); Call<UserModuleApi> call = service.Login(ApiUrl.API_KEY,em,pw); progressBar.setProgress(20); call.enqueue(new Callback<UserModuleApi>() { @Override public void onResponse(Call<UserModuleApi> call, Response<UserModuleApi> response) { progressBar.setProgress(30); if (response.isSuccessful()){ String responCode = response.body().getResponCode(); String responDesc = response.body().getResponDesc(); progressBar.setProgress(40); if (responCode != null) { if (responCode.equals("100")) { progressBar.setProgress(60); String name = response.body().getUserName(); String email = response.body().getEmail(); String companyID = response.body().getCompanyID(); progressBar.setProgress(80); Toast.makeText(LoginActivity.this, responDesc, Toast.LENGTH_SHORT).show(); Intent intent = new Intent(LoginActivity.this, MainActivity.class); progressBar.setProgress(85); //Untuk save session login spManager.saveSPString(SPUserDataKey.Username, name); spManager.saveSPString(SPUserDataKey.Email, email); spManager.saveSPString(SPUserDataKey.CompanyID, companyID); spManager.saveSPBoolean(SPUserDataKey.LOGGED, true); //Start Intent progressBar.setProgress(95); startActivity(intent); progressBar.setProgress(100); progressBar.setVisibility(View.GONE); finish(); } else { progressBar.setProgress(100); Toast.makeText(LoginActivity.this, responDesc, Toast.LENGTH_SHORT).show(); progressBar.setVisibility(View.INVISIBLE); } } } } @Override public void onFailure(Call<UserModuleApi> call, Throwable t) { progressBar.setProgress(100); Toast.makeText(LoginActivity.this,t.getMessage(),Toast.LENGTH_SHORT).show(); progressBar.setVisibility(View.INVISIBLE); } }); } public boolean checkAllData(){ boolean error = false; email = eTEmail.getText().toString(); pass = eTPassword.getText().toString(); if (!email.contains("@")){ eTEmail.setError("Invalid Email"); error = true; } if (TextUtils.isEmpty(email)){ eTEmail.setError("Please Fill Email"); error = true; } if (TextUtils.isEmpty(pass)){ eTPassword.setError("Please fill password"); error = true; } return error; } public void toRegister(View view){ Intent intent = new Intent(this,RegisterActivity.class); startActivity(intent); } }
5,948
0.591291
0.585575
158
36.63924
27.256683
111
false
false
0
0
0
0
0
0
0.702532
false
false
1
3d8286af02d7b825a9e4ccc5c354ae4f91a9fdfe
10,050,223,502,251
7755f553c9bfc24460c531193f3c211206ecec98
/src/ch/ehi/umleditor/application/UserSettingsBeanInfo.java
301072362cbd207ab7777ecea3df8a81a3f9eec3
[]
no_license
claeis/umleditor
https://github.com/claeis/umleditor
2fec9503b1300c3e45589886804455449f59eadb
8a75d943e75dfd1ed476bd18df693532fcf07383
refs/heads/master
2023-06-21T18:22:39.419000
2023-06-15T13:02:53
2023-06-15T13:02:53
109,155,258
5
9
null
false
2022-07-01T09:22:17
2017-11-01T16:27:10
2021-12-28T11:37:23
2022-07-01T09:22:10
26,089
1
9
18
Java
false
false
package ch.ehi.umleditor.application; /* This file is part of the UML/INTERLIS-Editor. * For more information, please see <http://www.umleditor.org/>. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * The bean information class for ch.ehi.umleditor.application.UserSettings. * * @author: Peter Hirzel <i>soft</i>Environment * @version $Revision: 1.1.1.1 $ $Date: 2003-12-23 10:40:07 $ */ public class UserSettingsBeanInfo extends java.beans.SimpleBeanInfo { /** * Gets the backgroundColor property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor backgroundColorPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the backgroundColor property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getBackgroundColor", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getBackgroundColor", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.awt.Color.class }; aSetMethod = getBeanClass().getMethod("setBackgroundColor", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setBackgroundColor", 1); }; aDescriptor = new java.beans.PropertyDescriptor("backgroundColor" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("backgroundColor" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("backgroundColor"); */ /* aDescriptor.setShortDescription("backgroundColor"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the diagramHeight property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor diagramHeightPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the diagramHeight property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getDiagramHeight", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getDiagramHeight", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Integer.class }; aSetMethod = getBeanClass().getMethod("setDiagramHeight", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setDiagramHeight", 1); }; aDescriptor = new java.beans.PropertyDescriptor("diagramHeight" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("diagramHeight" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("diagramHeight"); */ /* aDescriptor.setShortDescription("diagramHeight"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the diagramWidth property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor diagramWidthPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the diagramWidth property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getDiagramWidth", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getDiagramWidth", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Integer.class }; aSetMethod = getBeanClass().getMethod("setDiagramWidth", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setDiagramWidth", 1); }; aDescriptor = new java.beans.PropertyDescriptor("diagramWidth" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("diagramWidth" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("diagramWidth"); */ /* aDescriptor.setShortDescription("diagramWidth"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Find the method by comparing (name & parameter size) against the methods in the class. * @return java.lang.reflect.Method * @param aClass java.lang.Class * @param methodName java.lang.String * @param parameterCount int */ public static java.lang.reflect.Method findMethod(java.lang.Class aClass, java.lang.String methodName, int parameterCount) { try { /* Since this method attempts to find a method by getting all methods from the class, this method should only be called if getMethod cannot find the method. */ java.lang.reflect.Method methods[] = aClass.getMethods(); for (int index = 0; index < methods.length; index++){ java.lang.reflect.Method method = methods[index]; if ((method.getParameterTypes().length == parameterCount) && (method.getName().equals(methodName))) { return method; } } } catch (java.lang.Throwable exception) { return null; } return null; } /** * Gets the font property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor fontPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the font property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getFont", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getFont", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.String.class }; aSetMethod = getBeanClass().getMethod("setFont", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setFont", 1); }; aDescriptor = new java.beans.PropertyDescriptor("font" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("font" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("font"); */ /* aDescriptor.setShortDescription("font"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the foregroundColor property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor foregroundColorPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the foregroundColor property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getForegroundColor", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getForegroundColor", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.awt.Color.class }; aSetMethod = getBeanClass().getMethod("setForegroundColor", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setForegroundColor", 1); }; aDescriptor = new java.beans.PropertyDescriptor("foregroundColor" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("foregroundColor" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("foregroundColor"); */ /* aDescriptor.setShortDescription("foregroundColor"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Returns the BeanInfo of the superclass of this bean to inherit its features. * @return java.beans.BeanInfo[] */ public java.beans.BeanInfo[] getAdditionalBeanInfo() { java.lang.Class superClass; java.beans.BeanInfo superBeanInfo = null; try { superClass = getBeanDescriptor().getBeanClass().getSuperclass(); } catch (java.lang.Throwable exception) { return null; } try { superBeanInfo = java.beans.Introspector.getBeanInfo(superClass); } catch (java.beans.IntrospectionException ie) {} if (superBeanInfo != null) { java.beans.BeanInfo[] ret = new java.beans.BeanInfo[1]; ret[0] = superBeanInfo; return ret; } return null; } /** * Gets the bean class. * @return java.lang.Class */ public static java.lang.Class getBeanClass() { return ch.ehi.umleditor.application.UserSettings.class; } /** * Gets the bean class name. * @return java.lang.String */ public static java.lang.String getBeanClassName() { return "ch.ehi.umleditor.application.UserSettings"; } public java.beans.BeanDescriptor getBeanDescriptor() { java.beans.BeanDescriptor aDescriptor = null; try { /* Create and return the UserSettingsBeanInfo bean descriptor. */ aDescriptor = new java.beans.BeanDescriptor(ch.ehi.umleditor.application.UserSettings.class); /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("hidden-state", Boolean.FALSE); */ } catch (Throwable exception) { }; return aDescriptor; } /** * Return the event set descriptors for this bean. * @return java.beans.EventSetDescriptor[] */ public java.beans.EventSetDescriptor[] getEventSetDescriptors() { try { java.beans.EventSetDescriptor aDescriptorList[] = {}; return aDescriptorList; } catch (Throwable exception) { handleException(exception); }; return null; } /** * Return the method descriptors for this bean. * @return java.beans.MethodDescriptor[] */ public java.beans.MethodDescriptor[] getMethodDescriptors() { try { java.beans.MethodDescriptor aDescriptorList[] = {}; return aDescriptorList; } catch (Throwable exception) { handleException(exception); }; return null; } /** * Return the property descriptors for this bean. * @return java.beans.PropertyDescriptor[] */ public java.beans.PropertyDescriptor[] getPropertyDescriptors() { try { java.beans.PropertyDescriptor aDescriptorList[] = { backgroundColorPropertyDescriptor() ,diagramHeightPropertyDescriptor() ,diagramWidthPropertyDescriptor() ,fontPropertyDescriptor() ,foregroundColorPropertyDescriptor() ,importDirectoryPropertyDescriptor() ,languagePropertyDescriptor() ,showLogViewPropertyDescriptor() ,showStatusBarPropertyDescriptor() ,showToolBarPropertyDescriptor() ,workingDirectoryPropertyDescriptor() }; return aDescriptorList; } catch (Throwable exception) { handleException(exception); }; return null; } /** * Called whenever the bean information class throws an exception. * @param exception java.lang.Throwable */ private void handleException(java.lang.Throwable exception) { /* Uncomment the following lines to print uncaught exceptions to stdout */ // System.out.println("--------- UNCAUGHT EXCEPTION ---------"); // exception.printStackTrace(System.out); } /** * Gets the importDirectory property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor importDirectoryPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the importDirectory property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getImportDirectory", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getImportDirectory", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.String.class }; aSetMethod = getBeanClass().getMethod("setImportDirectory", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setImportDirectory", 1); }; aDescriptor = new java.beans.PropertyDescriptor("importDirectory" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("importDirectory" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("importDirectory"); */ /* aDescriptor.setShortDescription("importDirectory"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the language property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor languagePropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the language property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getLanguage", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getLanguage", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.String.class }; aSetMethod = getBeanClass().getMethod("setLanguage", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setLanguage", 1); }; aDescriptor = new java.beans.PropertyDescriptor("language" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("language" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("language"); */ /* aDescriptor.setShortDescription("language"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the showLogView property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor showLogViewPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the showLogView property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getShowLogView", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getShowLogView", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Boolean.class }; aSetMethod = getBeanClass().getMethod("setShowLogView", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setShowLogView", 1); }; aDescriptor = new java.beans.PropertyDescriptor("showLogView" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("showLogView" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("showLogView"); */ /* aDescriptor.setShortDescription("showLogView"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the showStatusBar property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor showStatusBarPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the showStatusBar property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getShowStatusBar", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getShowStatusBar", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Boolean.class }; aSetMethod = getBeanClass().getMethod("setShowStatusBar", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setShowStatusBar", 1); }; aDescriptor = new java.beans.PropertyDescriptor("showStatusBar" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("showStatusBar" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("showStatusBar"); */ /* aDescriptor.setShortDescription("showStatusBar"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the showToolBar property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor showToolBarPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the showToolBar property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getShowToolBar", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getShowToolBar", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Boolean.class }; aSetMethod = getBeanClass().getMethod("setShowToolBar", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setShowToolBar", 1); }; aDescriptor = new java.beans.PropertyDescriptor("showToolBar" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("showToolBar" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("showToolBar"); */ /* aDescriptor.setShortDescription("showToolBar"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the workingDirectory property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor workingDirectoryPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the workingDirectory property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getWorkingDirectory", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getWorkingDirectory", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.String.class }; aSetMethod = getBeanClass().getMethod("setWorkingDirectory", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setWorkingDirectory", 1); }; aDescriptor = new java.beans.PropertyDescriptor("workingDirectory" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("workingDirectory" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("workingDirectory"); */ /* aDescriptor.setShortDescription("workingDirectory"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } }
UTF-8
Java
28,634
java
UserSettingsBeanInfo.java
Java
[ { "context": "mleditor.application.UserSettings.\n * \n * @author: Peter Hirzel <i>soft</i>Environment \n * @version $Revision: 1.", "end": 1005, "score": 0.999692440032959, "start": 993, "tag": "NAME", "value": "Peter Hirzel" } ]
null
[]
package ch.ehi.umleditor.application; /* This file is part of the UML/INTERLIS-Editor. * For more information, please see <http://www.umleditor.org/>. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * The bean information class for ch.ehi.umleditor.application.UserSettings. * * @author: <NAME> <i>soft</i>Environment * @version $Revision: 1.1.1.1 $ $Date: 2003-12-23 10:40:07 $ */ public class UserSettingsBeanInfo extends java.beans.SimpleBeanInfo { /** * Gets the backgroundColor property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor backgroundColorPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the backgroundColor property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getBackgroundColor", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getBackgroundColor", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.awt.Color.class }; aSetMethod = getBeanClass().getMethod("setBackgroundColor", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setBackgroundColor", 1); }; aDescriptor = new java.beans.PropertyDescriptor("backgroundColor" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("backgroundColor" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("backgroundColor"); */ /* aDescriptor.setShortDescription("backgroundColor"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the diagramHeight property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor diagramHeightPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the diagramHeight property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getDiagramHeight", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getDiagramHeight", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Integer.class }; aSetMethod = getBeanClass().getMethod("setDiagramHeight", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setDiagramHeight", 1); }; aDescriptor = new java.beans.PropertyDescriptor("diagramHeight" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("diagramHeight" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("diagramHeight"); */ /* aDescriptor.setShortDescription("diagramHeight"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the diagramWidth property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor diagramWidthPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the diagramWidth property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getDiagramWidth", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getDiagramWidth", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Integer.class }; aSetMethod = getBeanClass().getMethod("setDiagramWidth", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setDiagramWidth", 1); }; aDescriptor = new java.beans.PropertyDescriptor("diagramWidth" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("diagramWidth" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("diagramWidth"); */ /* aDescriptor.setShortDescription("diagramWidth"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Find the method by comparing (name & parameter size) against the methods in the class. * @return java.lang.reflect.Method * @param aClass java.lang.Class * @param methodName java.lang.String * @param parameterCount int */ public static java.lang.reflect.Method findMethod(java.lang.Class aClass, java.lang.String methodName, int parameterCount) { try { /* Since this method attempts to find a method by getting all methods from the class, this method should only be called if getMethod cannot find the method. */ java.lang.reflect.Method methods[] = aClass.getMethods(); for (int index = 0; index < methods.length; index++){ java.lang.reflect.Method method = methods[index]; if ((method.getParameterTypes().length == parameterCount) && (method.getName().equals(methodName))) { return method; } } } catch (java.lang.Throwable exception) { return null; } return null; } /** * Gets the font property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor fontPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the font property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getFont", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getFont", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.String.class }; aSetMethod = getBeanClass().getMethod("setFont", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setFont", 1); }; aDescriptor = new java.beans.PropertyDescriptor("font" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("font" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("font"); */ /* aDescriptor.setShortDescription("font"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the foregroundColor property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor foregroundColorPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the foregroundColor property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getForegroundColor", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getForegroundColor", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.awt.Color.class }; aSetMethod = getBeanClass().getMethod("setForegroundColor", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setForegroundColor", 1); }; aDescriptor = new java.beans.PropertyDescriptor("foregroundColor" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("foregroundColor" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("foregroundColor"); */ /* aDescriptor.setShortDescription("foregroundColor"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Returns the BeanInfo of the superclass of this bean to inherit its features. * @return java.beans.BeanInfo[] */ public java.beans.BeanInfo[] getAdditionalBeanInfo() { java.lang.Class superClass; java.beans.BeanInfo superBeanInfo = null; try { superClass = getBeanDescriptor().getBeanClass().getSuperclass(); } catch (java.lang.Throwable exception) { return null; } try { superBeanInfo = java.beans.Introspector.getBeanInfo(superClass); } catch (java.beans.IntrospectionException ie) {} if (superBeanInfo != null) { java.beans.BeanInfo[] ret = new java.beans.BeanInfo[1]; ret[0] = superBeanInfo; return ret; } return null; } /** * Gets the bean class. * @return java.lang.Class */ public static java.lang.Class getBeanClass() { return ch.ehi.umleditor.application.UserSettings.class; } /** * Gets the bean class name. * @return java.lang.String */ public static java.lang.String getBeanClassName() { return "ch.ehi.umleditor.application.UserSettings"; } public java.beans.BeanDescriptor getBeanDescriptor() { java.beans.BeanDescriptor aDescriptor = null; try { /* Create and return the UserSettingsBeanInfo bean descriptor. */ aDescriptor = new java.beans.BeanDescriptor(ch.ehi.umleditor.application.UserSettings.class); /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("hidden-state", Boolean.FALSE); */ } catch (Throwable exception) { }; return aDescriptor; } /** * Return the event set descriptors for this bean. * @return java.beans.EventSetDescriptor[] */ public java.beans.EventSetDescriptor[] getEventSetDescriptors() { try { java.beans.EventSetDescriptor aDescriptorList[] = {}; return aDescriptorList; } catch (Throwable exception) { handleException(exception); }; return null; } /** * Return the method descriptors for this bean. * @return java.beans.MethodDescriptor[] */ public java.beans.MethodDescriptor[] getMethodDescriptors() { try { java.beans.MethodDescriptor aDescriptorList[] = {}; return aDescriptorList; } catch (Throwable exception) { handleException(exception); }; return null; } /** * Return the property descriptors for this bean. * @return java.beans.PropertyDescriptor[] */ public java.beans.PropertyDescriptor[] getPropertyDescriptors() { try { java.beans.PropertyDescriptor aDescriptorList[] = { backgroundColorPropertyDescriptor() ,diagramHeightPropertyDescriptor() ,diagramWidthPropertyDescriptor() ,fontPropertyDescriptor() ,foregroundColorPropertyDescriptor() ,importDirectoryPropertyDescriptor() ,languagePropertyDescriptor() ,showLogViewPropertyDescriptor() ,showStatusBarPropertyDescriptor() ,showToolBarPropertyDescriptor() ,workingDirectoryPropertyDescriptor() }; return aDescriptorList; } catch (Throwable exception) { handleException(exception); }; return null; } /** * Called whenever the bean information class throws an exception. * @param exception java.lang.Throwable */ private void handleException(java.lang.Throwable exception) { /* Uncomment the following lines to print uncaught exceptions to stdout */ // System.out.println("--------- UNCAUGHT EXCEPTION ---------"); // exception.printStackTrace(System.out); } /** * Gets the importDirectory property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor importDirectoryPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the importDirectory property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getImportDirectory", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getImportDirectory", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.String.class }; aSetMethod = getBeanClass().getMethod("setImportDirectory", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setImportDirectory", 1); }; aDescriptor = new java.beans.PropertyDescriptor("importDirectory" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("importDirectory" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("importDirectory"); */ /* aDescriptor.setShortDescription("importDirectory"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the language property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor languagePropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the language property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getLanguage", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getLanguage", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.String.class }; aSetMethod = getBeanClass().getMethod("setLanguage", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setLanguage", 1); }; aDescriptor = new java.beans.PropertyDescriptor("language" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("language" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("language"); */ /* aDescriptor.setShortDescription("language"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the showLogView property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor showLogViewPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the showLogView property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getShowLogView", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getShowLogView", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Boolean.class }; aSetMethod = getBeanClass().getMethod("setShowLogView", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setShowLogView", 1); }; aDescriptor = new java.beans.PropertyDescriptor("showLogView" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("showLogView" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("showLogView"); */ /* aDescriptor.setShortDescription("showLogView"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the showStatusBar property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor showStatusBarPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the showStatusBar property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getShowStatusBar", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getShowStatusBar", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Boolean.class }; aSetMethod = getBeanClass().getMethod("setShowStatusBar", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setShowStatusBar", 1); }; aDescriptor = new java.beans.PropertyDescriptor("showStatusBar" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("showStatusBar" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("showStatusBar"); */ /* aDescriptor.setShortDescription("showStatusBar"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the showToolBar property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor showToolBarPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the showToolBar property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getShowToolBar", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getShowToolBar", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.Boolean.class }; aSetMethod = getBeanClass().getMethod("setShowToolBar", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setShowToolBar", 1); }; aDescriptor = new java.beans.PropertyDescriptor("showToolBar" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("showToolBar" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("showToolBar"); */ /* aDescriptor.setShortDescription("showToolBar"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the workingDirectory property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor workingDirectoryPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the workingDirectory property descriptor. */ java.lang.reflect.Method aGetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aGetMethodParameterTypes[] = {}; aGetMethod = getBeanClass().getMethod("getWorkingDirectory", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getWorkingDirectory", 0); }; java.lang.reflect.Method aSetMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aSetMethodParameterTypes[] = { java.lang.String.class }; aSetMethod = getBeanClass().getMethod("setWorkingDirectory", aSetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aSetMethod = findMethod(getBeanClass(), "setWorkingDirectory", 1); }; aDescriptor = new java.beans.PropertyDescriptor("workingDirectory" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("workingDirectory" , getBeanClass()); }; aDescriptor.setBound(true); /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("workingDirectory"); */ /* aDescriptor.setShortDescription("workingDirectory"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } }
28,628
0.723336
0.721275
734
38.010899
26.483604
124
false
false
0
0
0
0
0
0
2.871935
false
false
1
c353332a0f461b24f31bef948c551ee33b8f6a31
28,278,064,713,559
86ea60cfc235aeaf16e100ee5d31eb1a634006ba
/Android_ICP1/Demo/app/src/main/java/com/csee5590/demo/SignUpActivity.java
81ed60f0491360c9f0a743d1b21eadda23b099d1
[]
no_license
Viral1101/CSS5590_490_web_mobile
https://github.com/Viral1101/CSS5590_490_web_mobile
376385d6fa2032c4933e81ca1a5599b0acacfaed
ce6b3379e9b417bf485c76a0e40b073c72fa5170
refs/heads/master
2021-07-18T11:56:42.148000
2018-12-08T22:00:04
2018-12-08T22:00:04
146,124,813
0
1
null
false
2018-10-04T03:14:53
2018-08-25T19:44:58
2018-10-04T03:01:39
2018-10-04T03:14:52
13,200
0
1
0
JavaScript
false
null
package com.csee5590.demo; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.TextView; import static android.provider.AlarmClock.EXTRA_MESSAGE; public class SignUpActivity extends AppCompatActivity { public void onClick(View v){ Intent redirect = new Intent(this, MainActivity.class); startActivity(redirect); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sign_up); Intent intent = getIntent(); String userName = intent.getStringExtra(EXTRA_MESSAGE); TextView user = findViewById(R.id.userTxt); user.setText(userName); user.setVisibility(View.VISIBLE); } }
UTF-8
Java
848
java
SignUpActivity.java
Java
[ { "context": "package com.csee5590.demo;\n\nimport android.content.Intent;\nimport ", "end": 16, "score": 0.6563571095466614, "start": 13, "tag": "USERNAME", "value": "see" }, { "context": " findViewById(R.id.userTxt);\n user.setText(userName);\n user.setVisibility(View.VISIBLE);\n }", "end": 795, "score": 0.9926084876060486, "start": 787, "tag": "USERNAME", "value": "userName" } ]
null
[]
package com.csee5590.demo; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.TextView; import static android.provider.AlarmClock.EXTRA_MESSAGE; public class SignUpActivity extends AppCompatActivity { public void onClick(View v){ Intent redirect = new Intent(this, MainActivity.class); startActivity(redirect); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sign_up); Intent intent = getIntent(); String userName = intent.getStringExtra(EXTRA_MESSAGE); TextView user = findViewById(R.id.userTxt); user.setText(userName); user.setVisibility(View.VISIBLE); } }
848
0.720519
0.714623
30
27.266666
21.739264
63
false
false
0
0
0
0
0
0
0.566667
false
false
1
62ef7c74f035a0ddee78ae77b7e2ce57e8836a54
14,620,068,715,246
b9ce8171af17d8c58f8457f7e90d0b57996c4b35
/Inventory managment system/src/main/java/net/vatri/inventory/controllers/DashboardController.java
5511cf17135d8ccfbfaac2754d6d78ad41267886
[ "MIT" ]
permissive
masudul21/Inventory-management-system-using-java
https://github.com/masudul21/Inventory-management-system-using-java
3be2e41f862ccacd3c7509ca9ed1d85c94fbd796
1801c3b878885394fd49f0fa3045719489ff4f23
refs/heads/main
2023-02-12T10:09:08.907000
2021-01-16T16:10:59
2021-01-16T16:10:59
312,030,403
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.vatri.inventory.controllers; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.fxml.Initializable; import javafx.scene.chart.BarChart; import javafx.scene.chart.CategoryAxis; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import net.vatri.inventory.libs.BaseController; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import java.net.URL; import java.util.Map; import java.util.ResourceBundle; public class DashboardController extends BaseController implements Initializable { // private InventoryDao dao = new InventoryDaoImpl( new JdbcQueryBuilder(App.getConfig("db_connection")) ); @FXML private Label productsNumber; @FXML private Label groupsNumber; @FXML private Label ordersNumber; @FXML private BarChart<String, Number> ordersChart; @FXML private CategoryAxis x; @FXML private NumberAxis y; private Map<String, String> stats = inventoryService.getStats(); public void initialize(URL url, ResourceBundle rb) { productsNumber.setText(stats.get("products_number")); groupsNumber.setText(stats.get("groups_number")); ordersNumber.setText(stats.get("orders_number")); } }
UTF-8
Java
1,319
java
DashboardController.java
Java
[]
null
[]
package net.vatri.inventory.controllers; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.fxml.Initializable; import javafx.scene.chart.BarChart; import javafx.scene.chart.CategoryAxis; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import net.vatri.inventory.libs.BaseController; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import java.net.URL; import java.util.Map; import java.util.ResourceBundle; public class DashboardController extends BaseController implements Initializable { // private InventoryDao dao = new InventoryDaoImpl( new JdbcQueryBuilder(App.getConfig("db_connection")) ); @FXML private Label productsNumber; @FXML private Label groupsNumber; @FXML private Label ordersNumber; @FXML private BarChart<String, Number> ordersChart; @FXML private CategoryAxis x; @FXML private NumberAxis y; private Map<String, String> stats = inventoryService.getStats(); public void initialize(URL url, ResourceBundle rb) { productsNumber.setText(stats.get("products_number")); groupsNumber.setText(stats.get("groups_number")); ordersNumber.setText(stats.get("orders_number")); } }
1,319
0.74981
0.74981
50
25.4
24.724077
110
false
false
0
0
0
0
0
0
0.58
false
false
1
6ecdb2d4a19f98e276c4f7c972e3d3e45b65862b
10,411,000,774,856
9ea704d36e5b6df52203cd31ff886edc228ab1ec
/Webadmin/src/main/java/com/ts/app/repository/SettingsRepository.java
a06c05acf1003dbf3a50f7fa43496e1c27fc6744
[]
no_license
Suresh-UDS/TaskManTechGinko
https://github.com/Suresh-UDS/TaskManTechGinko
63f5d97a88f766dfd7fb00121c0d1f11c7eb14f0
7d23f3518b82c0510cb083c8cb7cc2ca77090bfc
refs/heads/master
2022-12-22T14:41:46.204000
2018-05-21T04:41:04
2018-05-21T04:41:04
224,148,932
0
0
null
false
2022-12-07T21:23:57
2019-11-26T09:11:09
2019-11-26T09:35:58
2022-12-07T21:23:57
118,477
0
0
23
JavaScript
false
false
package com.ts.app.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import com.ts.app.domain.Setting; /** * * @author gnana * */ public interface SettingsRepository extends JpaRepository<Setting, Long>,JpaSpecificationExecutor<Setting> { @Query("SELECT s from Setting s where s.settingKey = :key") Setting findSettingByKey(@Param("key") String key); @Query("SELECT s from Setting s where s.settingKey = :key and s.projectId = :projectId") Setting findSettingByKeyAndProjectId(@Param("key") String key,@Param("projectId") long projectId); @Query("SELECT s from Setting s where s.settingKey = :key and s.siteId = :siteId") Setting findSettingByKeyAndSiteId(@Param("key") String key,@Param("siteId") long siteId); @Query("SELECT s from Setting s where s.projectId = :projectId") List<Setting> findSettingByProjectId(@Param("projectId") long projectId); @Query("SELECT s from Setting s where s.siteId = :siteId") List<Setting> findSettingBySiteId(@Param("siteId") long siteId); @Query("SELECT s from Setting s where s.projectId = :projectId and s.siteId = :siteId") List<Setting> findSettingByProjectAndSiteId(@Param("projectId") long projectId, @Param("siteId") long siteId); }
UTF-8
Java
1,475
java
SettingsRepository.java
Java
[ { "context": "ort com.ts.app.domain.Setting;\n\n/**\n * \n * @author gnana\n *\n */\npublic interface SettingsRepository extend", "end": 361, "score": 0.999550998210907, "start": 356, "tag": "USERNAME", "value": "gnana" } ]
null
[]
package com.ts.app.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import com.ts.app.domain.Setting; /** * * @author gnana * */ public interface SettingsRepository extends JpaRepository<Setting, Long>,JpaSpecificationExecutor<Setting> { @Query("SELECT s from Setting s where s.settingKey = :key") Setting findSettingByKey(@Param("key") String key); @Query("SELECT s from Setting s where s.settingKey = :key and s.projectId = :projectId") Setting findSettingByKeyAndProjectId(@Param("key") String key,@Param("projectId") long projectId); @Query("SELECT s from Setting s where s.settingKey = :key and s.siteId = :siteId") Setting findSettingByKeyAndSiteId(@Param("key") String key,@Param("siteId") long siteId); @Query("SELECT s from Setting s where s.projectId = :projectId") List<Setting> findSettingByProjectId(@Param("projectId") long projectId); @Query("SELECT s from Setting s where s.siteId = :siteId") List<Setting> findSettingBySiteId(@Param("siteId") long siteId); @Query("SELECT s from Setting s where s.projectId = :projectId and s.siteId = :siteId") List<Setting> findSettingByProjectAndSiteId(@Param("projectId") long projectId, @Param("siteId") long siteId); }
1,475
0.744407
0.744407
38
37.815788
38.744682
114
false
false
0
0
0
0
0
0
0.473684
false
false
1
215b639e5c08c490e7a5fcf0392651e6d47ea9f4
11,665,131,214,608
3c4e764d4498db3b135129fa8b07ce9655d9e5aa
/app/src/main/java/com/schoolofai/objectclassificationgame/customview/TeamListAdapter.java
b0afacbae362965b75265261870603f8b91f0aed
[]
no_license
joceyngan/Objects-Classification-Game
https://github.com/joceyngan/Objects-Classification-Game
d4e65a3f424903179add2f60acf2dcef51d1e6c5
d23282e3b321134ccbec6266885acf6906e3171e
refs/heads/master
2020-06-24T11:54:35.483000
2019-08-30T07:35:12
2019-08-30T07:35:12
198,956,375
0
1
null
false
2019-08-13T16:57:30
2019-07-26T06:04:52
2019-08-08T09:21:11
2019-08-13T16:57:29
28,768
0
1
0
Java
false
false
package com.schoolofai.objectclassificationgame.customview; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Color; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.firestore.DocumentReference; import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.firestore.ListenerRegistration; import com.google.firebase.firestore.Transaction; import com.schoolofai.objectclassificationgame.R; import com.schoolofai.objectclassificationgame.models.Player; import com.schoolofai.objectclassificationgame.models.Room; import java.util.ArrayList; import java.util.List; import java.util.Map; public class TeamListAdapter extends ArrayAdapter<Player> { private Context context; private List<Player> playerList; private Button btnKick; private DocumentReference documentReference; private FirebaseFirestore db = FirebaseFirestore.getInstance(); private Room room; private Player player; private ListenerRegistration listenerChange; private int arrayIndex; @NonNull @Override public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { View listItem = convertView; player = playerList.get(position); if (listItem == null) listItem = LayoutInflater.from(context).inflate(R.layout.item_teamlist, parent, false); TextView tvTeamName = listItem.findViewById(R.id.tvTeamName); TextView tvStatus = listItem.findViewById(R.id.tvStatus); btnKick = listItem.findViewById(R.id.btnKick); btnKick.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { displayAlertDialog(position); } }); tvTeamName.setText(player.getPlayerName()); switch (player.getStatus()) { case 0: tvStatus.setText("Waiting"); break; case 1: tvStatus.setText("Ready"); break; case 2: tvStatus.setText("Status: Completed"); break; } ; return listItem; } public TeamListAdapter(@NonNull Context context, List<Player> list, Room room) { super(context, R.layout.item_teamlist, list); this.context = context; this.playerList = list; this.room = room; } private void displayAlertDialog(int position) { player = playerList.get(position); AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle("Are you sure to kick " + player.getPlayerName() + "?\n"); builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { documentReference = db.collection("rooms").document(room.getRoomId()); db.runTransaction((Transaction.Function<Void>) transaction -> { DocumentSnapshot snapshot = transaction.get(documentReference); Room roomtmp = snapshot.toObject(Room.class); roomtmp.kickPlayer(player.getPlayerUid()); transaction.set(documentReference, roomtmp); return null; }).addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { Log.e("SUCCESS", "Transaction success!"); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Log.e("FAIL", "Transaction failure.", e); } }); } }); builder.setNegativeButton("No", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }).show(); } }
UTF-8
Java
4,622
java
TeamListAdapter.java
Java
[]
null
[]
package com.schoolofai.objectclassificationgame.customview; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.Color; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.firestore.DocumentReference; import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.firestore.ListenerRegistration; import com.google.firebase.firestore.Transaction; import com.schoolofai.objectclassificationgame.R; import com.schoolofai.objectclassificationgame.models.Player; import com.schoolofai.objectclassificationgame.models.Room; import java.util.ArrayList; import java.util.List; import java.util.Map; public class TeamListAdapter extends ArrayAdapter<Player> { private Context context; private List<Player> playerList; private Button btnKick; private DocumentReference documentReference; private FirebaseFirestore db = FirebaseFirestore.getInstance(); private Room room; private Player player; private ListenerRegistration listenerChange; private int arrayIndex; @NonNull @Override public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { View listItem = convertView; player = playerList.get(position); if (listItem == null) listItem = LayoutInflater.from(context).inflate(R.layout.item_teamlist, parent, false); TextView tvTeamName = listItem.findViewById(R.id.tvTeamName); TextView tvStatus = listItem.findViewById(R.id.tvStatus); btnKick = listItem.findViewById(R.id.btnKick); btnKick.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { displayAlertDialog(position); } }); tvTeamName.setText(player.getPlayerName()); switch (player.getStatus()) { case 0: tvStatus.setText("Waiting"); break; case 1: tvStatus.setText("Ready"); break; case 2: tvStatus.setText("Status: Completed"); break; } ; return listItem; } public TeamListAdapter(@NonNull Context context, List<Player> list, Room room) { super(context, R.layout.item_teamlist, list); this.context = context; this.playerList = list; this.room = room; } private void displayAlertDialog(int position) { player = playerList.get(position); AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); builder.setTitle("Are you sure to kick " + player.getPlayerName() + "?\n"); builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { documentReference = db.collection("rooms").document(room.getRoomId()); db.runTransaction((Transaction.Function<Void>) transaction -> { DocumentSnapshot snapshot = transaction.get(documentReference); Room roomtmp = snapshot.toObject(Room.class); roomtmp.kickPlayer(player.getPlayerUid()); transaction.set(documentReference, roomtmp); return null; }).addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { Log.e("SUCCESS", "Transaction success!"); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Log.e("FAIL", "Transaction failure.", e); } }); } }); builder.setNegativeButton("No", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }).show(); } }
4,622
0.646257
0.645608
126
35.682541
25.01893
99
false
false
0
0
0
0
0
0
0.706349
false
false
1
d5379ff2d6650ee13d0c057c2758aaf20a06a3ce
30,296,699,338,368
d86036ecb5a3874a67dfaed4ee38c1b506623881
/src/dongfang/xsltools/simplification/StylesheetSimplifierBase.java
0b9fa6e083452cdd8421cdc5cba7cc5d022a6e1d
[]
no_license
cs-au-dk/XSLV
https://github.com/cs-au-dk/XSLV
44aaa11f12829328b057e56e92a39c50c39f5a3d
41e53c964d2cf797e2c2c77531156ec3e7dcd0ef
refs/heads/master
2021-01-01T20:05:16.004000
2013-08-19T09:44:54
2013-08-19T09:44:54
7,849,936
2
3
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * dongfang M. Sc. Thesis * Created on 09-02-2005 */ package dongfang.xsltools.simplification; import dongfang.xsltools.exceptions.XSLToolsException; import dongfang.xsltools.model.Stylesheet; import dongfang.xsltools.model.StylesheetLevel; /** * This class supports simplification of <code>Stylesheet</code>s, by * applying the simplification defined in a subclass to the principal group of * the <code>Stylesheet</code>. * * @author dongfang */ public abstract class StylesheetSimplifierBase implements StylesheetProcessor { protected abstract void process(StylesheetLevel group) throws XSLToolsException; public void process(Stylesheet stylesheet) throws XSLToolsException { process(stylesheet.getPrincipalLevel()); } }
UTF-8
Java
754
java
StylesheetSimplifierBase.java
Java
[ { "context": " of\n * the <code>Stylesheet</code>.\n * \n * @author dongfang\n */\npublic abstract class StylesheetSimplifierBas", "end": 456, "score": 0.9995617866516113, "start": 448, "tag": "USERNAME", "value": "dongfang" } ]
null
[]
/* * dongfang M. Sc. Thesis * Created on 09-02-2005 */ package dongfang.xsltools.simplification; import dongfang.xsltools.exceptions.XSLToolsException; import dongfang.xsltools.model.Stylesheet; import dongfang.xsltools.model.StylesheetLevel; /** * This class supports simplification of <code>Stylesheet</code>s, by * applying the simplification defined in a subclass to the principal group of * the <code>Stylesheet</code>. * * @author dongfang */ public abstract class StylesheetSimplifierBase implements StylesheetProcessor { protected abstract void process(StylesheetLevel group) throws XSLToolsException; public void process(Stylesheet stylesheet) throws XSLToolsException { process(stylesheet.getPrincipalLevel()); } }
754
0.781167
0.770557
26
28.038462
26.93508
79
false
false
0
0
0
0
0
0
0.269231
false
false
1
bb93413f7113a17f18fe0a80837c527f8fb5a72c
11,562,051,969,058
01346f0f6d33d1d4a74048ab28075e6ef421b609
/web-app-client-for-eregistrar-restfulservice/eregistrar 2/src/main/java/miu/edu/cs/cs425/lab9/eregistrar/eregistrar/service/StudentServiceImpt.java
87ba81ae256934fc0d5229da689babf608f055e8
[]
no_license
selam2020/SE_Assignments
https://github.com/selam2020/SE_Assignments
def8b0ba02f4292bda26a9cbbdc3fedd85bb9910
0ea345dcc62f63bffb8b6e2abff35e767727178d
refs/heads/master
2023-01-09T01:04:24.280000
2020-06-15T20:12:19
2020-06-15T20:12:19
267,502,796
0
0
null
false
2020-10-13T22:41:09
2020-05-28T05:38:23
2020-06-15T20:12:40
2020-10-13T22:41:08
8,575
0
0
1
HTML
false
false
package miu.edu.cs.cs425.lab9.eregistrar.eregistrar.service; import miu.edu.cs.cs425.lab9.eregistrar.eregistrar.model.Student; import miu.edu.cs.cs425.lab9.eregistrar.eregistrar.model.StudentList; import miu.edu.cs.cs425.lab9.eregistrar.eregistrar.repository.StudentRepository; //import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import java.text.ParseException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.List; import java.util.Optional; @Service public class StudentServiceImpt implements StudentService { @Autowired private StudentRepository studentRepository; @Autowired RestTemplate restTemplate; String baseURL = "http://localhost:8081/eregistrar/api/student"; @Override public List<Student> getListOfStudent() { StudentList studentList = restTemplate.getForObject(baseURL + "/list", StudentList.class); return studentList.getStudents(); } @Override public Student saveStudent(Student s) { return restTemplate.postForObject(baseURL + "/register", s, Student.class); } @Override public Student getStudentId(Long id) { return restTemplate.getForObject(baseURL + "/get/" + id, Student.class); } @Override public void deleteStudent(long studentId) { restTemplate.delete(baseURL + "/delete/" + studentId); } }
UTF-8
Java
1,742
java
StudentServiceImpt.java
Java
[]
null
[]
package miu.edu.cs.cs425.lab9.eregistrar.eregistrar.service; import miu.edu.cs.cs425.lab9.eregistrar.eregistrar.model.Student; import miu.edu.cs.cs425.lab9.eregistrar.eregistrar.model.StudentList; import miu.edu.cs.cs425.lab9.eregistrar.eregistrar.repository.StudentRepository; //import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import java.text.ParseException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.util.List; import java.util.Optional; @Service public class StudentServiceImpt implements StudentService { @Autowired private StudentRepository studentRepository; @Autowired RestTemplate restTemplate; String baseURL = "http://localhost:8081/eregistrar/api/student"; @Override public List<Student> getListOfStudent() { StudentList studentList = restTemplate.getForObject(baseURL + "/list", StudentList.class); return studentList.getStudents(); } @Override public Student saveStudent(Student s) { return restTemplate.postForObject(baseURL + "/register", s, Student.class); } @Override public Student getStudentId(Long id) { return restTemplate.getForObject(baseURL + "/get/" + id, Student.class); } @Override public void deleteStudent(long studentId) { restTemplate.delete(baseURL + "/delete/" + studentId); } }
1,742
0.765212
0.753731
53
31.849056
27.529329
98
false
false
0
0
0
0
0
0
0.54717
false
false
2
16b58a08c2b4c82e5930eb278469ddd67bc1fdf9
11,862,699,676,759
9487da427fb67823a8fa504de06c3774ba1b3674
/src/main/java/com/enitalk/configs/TeacherFinder.java
fcec2fd911074c0a7dfd0389b35ff6af894a2cdf
[]
no_license
bellmit/enitalk
https://github.com/bellmit/enitalk
2f9cbb9d6f62039bd5f78e00f7b86d6b4a9021fe
e1b19858fed0920eb9ed324d1a557af2b33a7a81
refs/heads/master
2022-01-01T16:34:37.470000
2017-02-16T21:36:19
2017-02-16T21:36:19
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.enitalk.configs; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; /** * * @author astrologer */ @Component public class TeacherFinder { @Autowired private MongoTemplate mongo; public Collection<String> teachers() { Query q = Query.query(Criteria.where("visible").is(true)); q.fields().exclude("_id").include("i"); List<HashMap> tchs = mongo.find(q, HashMap.class, "teachers"); ArrayList<String> ids = new ArrayList<>(); tchs.stream().forEach((HashMap t) -> { ids.add(t.get("i").toString()); }); return ids; } }
UTF-8
Java
1,148
java
TeacherFinder.java
Java
[ { "context": "framework.stereotype.Component;\n\n/**\n *\n * @author astrologer\n */\n@Component\npublic class TeacherFinder {\n\n ", "end": 641, "score": 0.9992409944534302, "start": 631, "tag": "USERNAME", "value": "astrologer" } ]
null
[]
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.enitalk.configs; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Component; /** * * @author astrologer */ @Component public class TeacherFinder { @Autowired private MongoTemplate mongo; public Collection<String> teachers() { Query q = Query.query(Criteria.where("visible").is(true)); q.fields().exclude("_id").include("i"); List<HashMap> tchs = mongo.find(q, HashMap.class, "teachers"); ArrayList<String> ids = new ArrayList<>(); tchs.stream().forEach((HashMap t) -> { ids.add(t.get("i").toString()); }); return ids; } }
1,148
0.701219
0.701219
39
28.435898
23.82715
79
false
false
0
0
0
0
0
0
0.589744
false
false
2
15118c8a334e8d9894b464775eab470d2317e6f8
18,494,129,181,759
3cd69da4d40f2d97130b5bf15045ba09c219f1fa
/sources/com/google/android/material/navigation/NavigationView.java
10d0a51e230152edea797b3a4fa6c869b0225604
[]
no_license
TheWizard91/Album_base_source_from_JADX
https://github.com/TheWizard91/Album_base_source_from_JADX
946ea3a407b4815ac855ce4313b97bd42e8cab41
e1d228fc2ee550ac19eeac700254af8b0f96080a
refs/heads/master
2023-01-09T08:37:22.062000
2020-11-11T09:52:40
2020-11-11T09:52:40
311,927,971
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.google.android.material.navigation; import android.app.Activity; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.graphics.drawable.InsetDrawable; import android.os.Build; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; import android.util.TypedValue; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewTreeObserver; import androidx.appcompat.C2018R; import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.view.SupportMenuInflater; import androidx.appcompat.view.menu.MenuItemImpl; import androidx.appcompat.widget.TintTypedArray; import androidx.core.content.ContextCompat; import androidx.core.view.WindowInsetsCompat; import androidx.customview.view.AbsSavedState; import com.google.android.material.C2413R; import com.google.android.material.internal.NavigationMenu; import com.google.android.material.internal.NavigationMenuPresenter; import com.google.android.material.internal.ScrimInsetsFrameLayout; import com.google.android.material.resources.MaterialResources; import com.google.android.material.shape.MaterialShapeDrawable; import com.google.android.material.shape.MaterialShapeUtils; import com.google.android.material.shape.ShapeAppearanceModel; import com.google.common.primitives.Ints; public class NavigationView extends ScrimInsetsFrameLayout { private static final int[] CHECKED_STATE_SET = {16842912}; private static final int DEF_STYLE_RES = C2413R.C2419style.Widget_Design_NavigationView; private static final int[] DISABLED_STATE_SET = {-16842910}; private static final int PRESENTER_NAVIGATION_VIEW_ID = 1; OnNavigationItemSelectedListener listener; private final int maxWidth; private final NavigationMenu menu; private MenuInflater menuInflater; private ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener; /* access modifiers changed from: private */ public final NavigationMenuPresenter presenter; /* access modifiers changed from: private */ public final int[] tmpLocation; public interface OnNavigationItemSelectedListener { boolean onNavigationItemSelected(MenuItem menuItem); } public NavigationView(Context context) { this(context, (AttributeSet) null); } public NavigationView(Context context, AttributeSet attrs) { this(context, attrs, C2413R.attr.navigationViewStyle); } /* JADX WARNING: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. */ public NavigationView(android.content.Context r13, android.util.AttributeSet r14, int r15) { /* r12 = this; int r4 = DEF_STYLE_RES android.content.Context r0 = com.google.android.material.theme.overlay.MaterialThemeOverlay.wrap(r13, r14, r15, r4) r12.<init>(r0, r14, r15) com.google.android.material.internal.NavigationMenuPresenter r6 = new com.google.android.material.internal.NavigationMenuPresenter r6.<init>() r12.presenter = r6 r0 = 2 int[] r0 = new int[r0] r12.tmpLocation = r0 android.content.Context r13 = r12.getContext() com.google.android.material.internal.NavigationMenu r7 = new com.google.android.material.internal.NavigationMenu r7.<init>(r13) r12.menu = r7 int[] r2 = com.google.android.material.C2413R.styleable.NavigationView r8 = 0 int[] r5 = new int[r8] r0 = r13 r1 = r14 r3 = r15 androidx.appcompat.widget.TintTypedArray r0 = com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(r0, r1, r2, r3, r4, r5) int r1 = com.google.android.material.C2413R.styleable.NavigationView_android_background boolean r1 = r0.hasValue(r1) if (r1 == 0) goto L_0x003d int r1 = com.google.android.material.C2413R.styleable.NavigationView_android_background android.graphics.drawable.Drawable r1 = r0.getDrawable(r1) androidx.core.view.ViewCompat.setBackground(r12, r1) L_0x003d: android.graphics.drawable.Drawable r1 = r12.getBackground() if (r1 == 0) goto L_0x004b android.graphics.drawable.Drawable r1 = r12.getBackground() boolean r1 = r1 instanceof android.graphics.drawable.ColorDrawable if (r1 == 0) goto L_0x006c L_0x004b: android.graphics.drawable.Drawable r1 = r12.getBackground() com.google.android.material.shape.MaterialShapeDrawable r2 = new com.google.android.material.shape.MaterialShapeDrawable r2.<init>() boolean r3 = r1 instanceof android.graphics.drawable.ColorDrawable if (r3 == 0) goto L_0x0066 r3 = r1 android.graphics.drawable.ColorDrawable r3 = (android.graphics.drawable.ColorDrawable) r3 int r3 = r3.getColor() android.content.res.ColorStateList r3 = android.content.res.ColorStateList.valueOf(r3) r2.setFillColor(r3) L_0x0066: r2.initializeElevationOverlay(r13) androidx.core.view.ViewCompat.setBackground(r12, r2) L_0x006c: int r1 = com.google.android.material.C2413R.styleable.NavigationView_elevation boolean r1 = r0.hasValue(r1) if (r1 == 0) goto L_0x007e int r1 = com.google.android.material.C2413R.styleable.NavigationView_elevation int r1 = r0.getDimensionPixelSize(r1, r8) float r1 = (float) r1 r12.setElevation(r1) L_0x007e: int r1 = com.google.android.material.C2413R.styleable.NavigationView_android_fitsSystemWindows boolean r1 = r0.getBoolean(r1, r8) r12.setFitsSystemWindows(r1) int r1 = com.google.android.material.C2413R.styleable.NavigationView_android_maxWidth int r1 = r0.getDimensionPixelSize(r1, r8) r12.maxWidth = r1 int r1 = com.google.android.material.C2413R.styleable.NavigationView_itemIconTint boolean r1 = r0.hasValue(r1) if (r1 == 0) goto L_0x009e int r1 = com.google.android.material.C2413R.styleable.NavigationView_itemIconTint android.content.res.ColorStateList r1 = r0.getColorStateList(r1) goto L_0x00a5 L_0x009e: r1 = 16842808(0x1010038, float:2.3693715E-38) android.content.res.ColorStateList r1 = r12.createDefaultColorStateList(r1) L_0x00a5: r2 = 0 r3 = 0 int r4 = com.google.android.material.C2413R.styleable.NavigationView_itemTextAppearance boolean r4 = r0.hasValue(r4) if (r4 == 0) goto L_0x00b6 int r4 = com.google.android.material.C2413R.styleable.NavigationView_itemTextAppearance int r3 = r0.getResourceId(r4, r8) r2 = 1 L_0x00b6: int r4 = com.google.android.material.C2413R.styleable.NavigationView_itemIconSize boolean r4 = r0.hasValue(r4) if (r4 == 0) goto L_0x00c7 int r4 = com.google.android.material.C2413R.styleable.NavigationView_itemIconSize int r4 = r0.getDimensionPixelSize(r4, r8) r12.setItemIconSize(r4) L_0x00c7: r4 = 0 int r5 = com.google.android.material.C2413R.styleable.NavigationView_itemTextColor boolean r5 = r0.hasValue(r5) if (r5 == 0) goto L_0x00d6 int r5 = com.google.android.material.C2413R.styleable.NavigationView_itemTextColor android.content.res.ColorStateList r4 = r0.getColorStateList(r5) L_0x00d6: if (r2 != 0) goto L_0x00e1 if (r4 != 0) goto L_0x00e1 r5 = 16842806(0x1010036, float:2.369371E-38) android.content.res.ColorStateList r4 = r12.createDefaultColorStateList(r5) L_0x00e1: int r5 = com.google.android.material.C2413R.styleable.NavigationView_itemBackground android.graphics.drawable.Drawable r5 = r0.getDrawable(r5) if (r5 != 0) goto L_0x00f3 boolean r9 = r12.hasShapeAppearance(r0) if (r9 == 0) goto L_0x00f3 android.graphics.drawable.Drawable r5 = r12.createDefaultItemBackground(r0) L_0x00f3: int r9 = com.google.android.material.C2413R.styleable.NavigationView_itemHorizontalPadding boolean r9 = r0.hasValue(r9) if (r9 == 0) goto L_0x0104 int r9 = com.google.android.material.C2413R.styleable.NavigationView_itemHorizontalPadding int r9 = r0.getDimensionPixelSize(r9, r8) r6.setItemHorizontalPadding(r9) L_0x0104: int r9 = com.google.android.material.C2413R.styleable.NavigationView_itemIconPadding int r9 = r0.getDimensionPixelSize(r9, r8) int r10 = com.google.android.material.C2413R.styleable.NavigationView_itemMaxLines r11 = 1 int r10 = r0.getInt(r10, r11) r12.setItemMaxLines(r10) com.google.android.material.navigation.NavigationView$1 r10 = new com.google.android.material.navigation.NavigationView$1 r10.<init>() r7.setCallback(r10) r6.setId(r11) r6.initForMenu(r13, r7) r6.setItemIconTintList(r1) int r10 = r12.getOverScrollMode() r6.setOverScrollMode(r10) if (r2 == 0) goto L_0x0131 r6.setItemTextAppearance(r3) L_0x0131: r6.setItemTextColor(r4) r6.setItemBackground(r5) r6.setItemIconPadding(r9) r7.addMenuPresenter(r6) androidx.appcompat.view.menu.MenuView r6 = r6.getMenuView(r12) android.view.View r6 = (android.view.View) r6 r12.addView(r6) int r6 = com.google.android.material.C2413R.styleable.NavigationView_menu boolean r6 = r0.hasValue(r6) if (r6 == 0) goto L_0x0157 int r6 = com.google.android.material.C2413R.styleable.NavigationView_menu int r6 = r0.getResourceId(r6, r8) r12.inflateMenu(r6) L_0x0157: int r6 = com.google.android.material.C2413R.styleable.NavigationView_headerLayout boolean r6 = r0.hasValue(r6) if (r6 == 0) goto L_0x0168 int r6 = com.google.android.material.C2413R.styleable.NavigationView_headerLayout int r6 = r0.getResourceId(r6, r8) r12.inflateHeaderView(r6) L_0x0168: r0.recycle() r12.setupInsetScrimsListener() return */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.navigation.NavigationView.<init>(android.content.Context, android.util.AttributeSet, int):void"); } public void setOverScrollMode(int overScrollMode) { super.setOverScrollMode(overScrollMode); NavigationMenuPresenter navigationMenuPresenter = this.presenter; if (navigationMenuPresenter != null) { navigationMenuPresenter.setOverScrollMode(overScrollMode); } } private boolean hasShapeAppearance(TintTypedArray a) { return a.hasValue(C2413R.styleable.NavigationView_itemShapeAppearance) || a.hasValue(C2413R.styleable.NavigationView_itemShapeAppearanceOverlay); } /* access modifiers changed from: protected */ public void onAttachedToWindow() { super.onAttachedToWindow(); MaterialShapeUtils.setParentAbsoluteElevation(this); } public void setElevation(float elevation) { if (Build.VERSION.SDK_INT >= 21) { super.setElevation(elevation); } MaterialShapeUtils.setElevation(this, elevation); } private final Drawable createDefaultItemBackground(TintTypedArray a) { MaterialShapeDrawable materialShapeDrawable = new MaterialShapeDrawable(ShapeAppearanceModel.builder(getContext(), a.getResourceId(C2413R.styleable.NavigationView_itemShapeAppearance, 0), a.getResourceId(C2413R.styleable.NavigationView_itemShapeAppearanceOverlay, 0)).build()); materialShapeDrawable.setFillColor(MaterialResources.getColorStateList(getContext(), a, C2413R.styleable.NavigationView_itemShapeFillColor)); return new InsetDrawable(materialShapeDrawable, a.getDimensionPixelSize(C2413R.styleable.NavigationView_itemShapeInsetStart, 0), a.getDimensionPixelSize(C2413R.styleable.NavigationView_itemShapeInsetTop, 0), a.getDimensionPixelSize(C2413R.styleable.NavigationView_itemShapeInsetEnd, 0), a.getDimensionPixelSize(C2413R.styleable.NavigationView_itemShapeInsetBottom, 0)); } /* access modifiers changed from: protected */ public Parcelable onSaveInstanceState() { SavedState state = new SavedState(super.onSaveInstanceState()); state.menuState = new Bundle(); this.menu.savePresenterStates(state.menuState); return state; } /* access modifiers changed from: protected */ public void onRestoreInstanceState(Parcelable savedState) { if (!(savedState instanceof SavedState)) { super.onRestoreInstanceState(savedState); return; } SavedState state = (SavedState) savedState; super.onRestoreInstanceState(state.getSuperState()); this.menu.restorePresenterStates(state.menuState); } public void setNavigationItemSelectedListener(OnNavigationItemSelectedListener listener2) { this.listener = listener2; } /* access modifiers changed from: protected */ public void onMeasure(int widthSpec, int heightSpec) { int mode = View.MeasureSpec.getMode(widthSpec); if (mode == Integer.MIN_VALUE) { widthSpec = View.MeasureSpec.makeMeasureSpec(Math.min(View.MeasureSpec.getSize(widthSpec), this.maxWidth), Ints.MAX_POWER_OF_TWO); } else if (mode == 0) { widthSpec = View.MeasureSpec.makeMeasureSpec(this.maxWidth, Ints.MAX_POWER_OF_TWO); } super.onMeasure(widthSpec, heightSpec); } /* access modifiers changed from: protected */ public void onInsetsChanged(WindowInsetsCompat insets) { this.presenter.dispatchApplyWindowInsets(insets); } public void inflateMenu(int resId) { this.presenter.setUpdateSuspended(true); getMenuInflater().inflate(resId, this.menu); this.presenter.setUpdateSuspended(false); this.presenter.updateMenuView(false); } public Menu getMenu() { return this.menu; } public View inflateHeaderView(int res) { return this.presenter.inflateHeaderView(res); } public void addHeaderView(View view) { this.presenter.addHeaderView(view); } public void removeHeaderView(View view) { this.presenter.removeHeaderView(view); } public int getHeaderCount() { return this.presenter.getHeaderCount(); } public View getHeaderView(int index) { return this.presenter.getHeaderView(index); } public ColorStateList getItemIconTintList() { return this.presenter.getItemTintList(); } public void setItemIconTintList(ColorStateList tint) { this.presenter.setItemIconTintList(tint); } public ColorStateList getItemTextColor() { return this.presenter.getItemTextColor(); } public void setItemTextColor(ColorStateList textColor) { this.presenter.setItemTextColor(textColor); } public Drawable getItemBackground() { return this.presenter.getItemBackground(); } public void setItemBackgroundResource(int resId) { setItemBackground(ContextCompat.getDrawable(getContext(), resId)); } public void setItemBackground(Drawable itemBackground) { this.presenter.setItemBackground(itemBackground); } public int getItemHorizontalPadding() { return this.presenter.getItemHorizontalPadding(); } public void setItemHorizontalPadding(int padding) { this.presenter.setItemHorizontalPadding(padding); } public void setItemHorizontalPaddingResource(int paddingResource) { this.presenter.setItemHorizontalPadding(getResources().getDimensionPixelSize(paddingResource)); } public int getItemIconPadding() { return this.presenter.getItemIconPadding(); } public void setItemIconPadding(int padding) { this.presenter.setItemIconPadding(padding); } public void setItemIconPaddingResource(int paddingResource) { this.presenter.setItemIconPadding(getResources().getDimensionPixelSize(paddingResource)); } public void setCheckedItem(int id) { MenuItem item = this.menu.findItem(id); if (item != null) { this.presenter.setCheckedItem((MenuItemImpl) item); } } public void setCheckedItem(MenuItem checkedItem) { MenuItem item = this.menu.findItem(checkedItem.getItemId()); if (item != null) { this.presenter.setCheckedItem((MenuItemImpl) item); return; } throw new IllegalArgumentException("Called setCheckedItem(MenuItem) with an item that is not in the current menu."); } public MenuItem getCheckedItem() { return this.presenter.getCheckedItem(); } public void setItemTextAppearance(int resId) { this.presenter.setItemTextAppearance(resId); } public void setItemIconSize(int iconSize) { this.presenter.setItemIconSize(iconSize); } public void setItemMaxLines(int itemMaxLines) { this.presenter.setItemMaxLines(itemMaxLines); } public int getItemMaxLines() { return this.presenter.getItemMaxLines(); } private MenuInflater getMenuInflater() { if (this.menuInflater == null) { this.menuInflater = new SupportMenuInflater(getContext()); } return this.menuInflater; } private ColorStateList createDefaultColorStateList(int baseColorThemeAttr) { TypedValue value = new TypedValue(); if (!getContext().getTheme().resolveAttribute(baseColorThemeAttr, value, true)) { return null; } ColorStateList baseColor = AppCompatResources.getColorStateList(getContext(), value.resourceId); if (!getContext().getTheme().resolveAttribute(C2018R.attr.colorPrimary, value, true)) { return null; } int colorPrimary = value.data; int defaultColor = baseColor.getDefaultColor(); int[] iArr = DISABLED_STATE_SET; return new ColorStateList(new int[][]{iArr, CHECKED_STATE_SET, EMPTY_STATE_SET}, new int[]{baseColor.getColorForState(iArr, defaultColor), colorPrimary, defaultColor}); } /* access modifiers changed from: protected */ public void onDetachedFromWindow() { super.onDetachedFromWindow(); if (Build.VERSION.SDK_INT < 16) { getViewTreeObserver().removeGlobalOnLayoutListener(this.onGlobalLayoutListener); } else { getViewTreeObserver().removeOnGlobalLayoutListener(this.onGlobalLayoutListener); } } private void setupInsetScrimsListener() { this.onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() { public void onGlobalLayout() { NavigationView navigationView = NavigationView.this; navigationView.getLocationOnScreen(navigationView.tmpLocation); boolean z = true; boolean isBehindStatusBar = NavigationView.this.tmpLocation[1] == 0; NavigationView.this.presenter.setBehindStatusBar(isBehindStatusBar); NavigationView.this.setDrawTopInsetForeground(isBehindStatusBar); Context context = NavigationView.this.getContext(); if ((context instanceof Activity) && Build.VERSION.SDK_INT >= 21) { boolean isBehindSystemNav = ((Activity) context).findViewById(16908290).getHeight() == NavigationView.this.getHeight(); boolean hasNonZeroAlpha = Color.alpha(((Activity) context).getWindow().getNavigationBarColor()) != 0; NavigationView navigationView2 = NavigationView.this; if (!isBehindSystemNav || !hasNonZeroAlpha) { z = false; } navigationView2.setDrawBottomInsetForeground(z); } } }; getViewTreeObserver().addOnGlobalLayoutListener(this.onGlobalLayoutListener); } public static class SavedState extends AbsSavedState { public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.ClassLoaderCreator<SavedState>() { public SavedState createFromParcel(Parcel in, ClassLoader loader) { return new SavedState(in, loader); } public SavedState createFromParcel(Parcel in) { return new SavedState(in, (ClassLoader) null); } public SavedState[] newArray(int size) { return new SavedState[size]; } }; public Bundle menuState; public SavedState(Parcel in, ClassLoader loader) { super(in, loader); this.menuState = in.readBundle(loader); } public SavedState(Parcelable superState) { super(superState); } public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeBundle(this.menuState); } } }
UTF-8
Java
21,990
java
NavigationView.java
Java
[]
null
[]
package com.google.android.material.navigation; import android.app.Activity; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.graphics.drawable.InsetDrawable; import android.os.Build; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; import android.util.TypedValue; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewTreeObserver; import androidx.appcompat.C2018R; import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.view.SupportMenuInflater; import androidx.appcompat.view.menu.MenuItemImpl; import androidx.appcompat.widget.TintTypedArray; import androidx.core.content.ContextCompat; import androidx.core.view.WindowInsetsCompat; import androidx.customview.view.AbsSavedState; import com.google.android.material.C2413R; import com.google.android.material.internal.NavigationMenu; import com.google.android.material.internal.NavigationMenuPresenter; import com.google.android.material.internal.ScrimInsetsFrameLayout; import com.google.android.material.resources.MaterialResources; import com.google.android.material.shape.MaterialShapeDrawable; import com.google.android.material.shape.MaterialShapeUtils; import com.google.android.material.shape.ShapeAppearanceModel; import com.google.common.primitives.Ints; public class NavigationView extends ScrimInsetsFrameLayout { private static final int[] CHECKED_STATE_SET = {16842912}; private static final int DEF_STYLE_RES = C2413R.C2419style.Widget_Design_NavigationView; private static final int[] DISABLED_STATE_SET = {-16842910}; private static final int PRESENTER_NAVIGATION_VIEW_ID = 1; OnNavigationItemSelectedListener listener; private final int maxWidth; private final NavigationMenu menu; private MenuInflater menuInflater; private ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener; /* access modifiers changed from: private */ public final NavigationMenuPresenter presenter; /* access modifiers changed from: private */ public final int[] tmpLocation; public interface OnNavigationItemSelectedListener { boolean onNavigationItemSelected(MenuItem menuItem); } public NavigationView(Context context) { this(context, (AttributeSet) null); } public NavigationView(Context context, AttributeSet attrs) { this(context, attrs, C2413R.attr.navigationViewStyle); } /* JADX WARNING: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. */ public NavigationView(android.content.Context r13, android.util.AttributeSet r14, int r15) { /* r12 = this; int r4 = DEF_STYLE_RES android.content.Context r0 = com.google.android.material.theme.overlay.MaterialThemeOverlay.wrap(r13, r14, r15, r4) r12.<init>(r0, r14, r15) com.google.android.material.internal.NavigationMenuPresenter r6 = new com.google.android.material.internal.NavigationMenuPresenter r6.<init>() r12.presenter = r6 r0 = 2 int[] r0 = new int[r0] r12.tmpLocation = r0 android.content.Context r13 = r12.getContext() com.google.android.material.internal.NavigationMenu r7 = new com.google.android.material.internal.NavigationMenu r7.<init>(r13) r12.menu = r7 int[] r2 = com.google.android.material.C2413R.styleable.NavigationView r8 = 0 int[] r5 = new int[r8] r0 = r13 r1 = r14 r3 = r15 androidx.appcompat.widget.TintTypedArray r0 = com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(r0, r1, r2, r3, r4, r5) int r1 = com.google.android.material.C2413R.styleable.NavigationView_android_background boolean r1 = r0.hasValue(r1) if (r1 == 0) goto L_0x003d int r1 = com.google.android.material.C2413R.styleable.NavigationView_android_background android.graphics.drawable.Drawable r1 = r0.getDrawable(r1) androidx.core.view.ViewCompat.setBackground(r12, r1) L_0x003d: android.graphics.drawable.Drawable r1 = r12.getBackground() if (r1 == 0) goto L_0x004b android.graphics.drawable.Drawable r1 = r12.getBackground() boolean r1 = r1 instanceof android.graphics.drawable.ColorDrawable if (r1 == 0) goto L_0x006c L_0x004b: android.graphics.drawable.Drawable r1 = r12.getBackground() com.google.android.material.shape.MaterialShapeDrawable r2 = new com.google.android.material.shape.MaterialShapeDrawable r2.<init>() boolean r3 = r1 instanceof android.graphics.drawable.ColorDrawable if (r3 == 0) goto L_0x0066 r3 = r1 android.graphics.drawable.ColorDrawable r3 = (android.graphics.drawable.ColorDrawable) r3 int r3 = r3.getColor() android.content.res.ColorStateList r3 = android.content.res.ColorStateList.valueOf(r3) r2.setFillColor(r3) L_0x0066: r2.initializeElevationOverlay(r13) androidx.core.view.ViewCompat.setBackground(r12, r2) L_0x006c: int r1 = com.google.android.material.C2413R.styleable.NavigationView_elevation boolean r1 = r0.hasValue(r1) if (r1 == 0) goto L_0x007e int r1 = com.google.android.material.C2413R.styleable.NavigationView_elevation int r1 = r0.getDimensionPixelSize(r1, r8) float r1 = (float) r1 r12.setElevation(r1) L_0x007e: int r1 = com.google.android.material.C2413R.styleable.NavigationView_android_fitsSystemWindows boolean r1 = r0.getBoolean(r1, r8) r12.setFitsSystemWindows(r1) int r1 = com.google.android.material.C2413R.styleable.NavigationView_android_maxWidth int r1 = r0.getDimensionPixelSize(r1, r8) r12.maxWidth = r1 int r1 = com.google.android.material.C2413R.styleable.NavigationView_itemIconTint boolean r1 = r0.hasValue(r1) if (r1 == 0) goto L_0x009e int r1 = com.google.android.material.C2413R.styleable.NavigationView_itemIconTint android.content.res.ColorStateList r1 = r0.getColorStateList(r1) goto L_0x00a5 L_0x009e: r1 = 16842808(0x1010038, float:2.3693715E-38) android.content.res.ColorStateList r1 = r12.createDefaultColorStateList(r1) L_0x00a5: r2 = 0 r3 = 0 int r4 = com.google.android.material.C2413R.styleable.NavigationView_itemTextAppearance boolean r4 = r0.hasValue(r4) if (r4 == 0) goto L_0x00b6 int r4 = com.google.android.material.C2413R.styleable.NavigationView_itemTextAppearance int r3 = r0.getResourceId(r4, r8) r2 = 1 L_0x00b6: int r4 = com.google.android.material.C2413R.styleable.NavigationView_itemIconSize boolean r4 = r0.hasValue(r4) if (r4 == 0) goto L_0x00c7 int r4 = com.google.android.material.C2413R.styleable.NavigationView_itemIconSize int r4 = r0.getDimensionPixelSize(r4, r8) r12.setItemIconSize(r4) L_0x00c7: r4 = 0 int r5 = com.google.android.material.C2413R.styleable.NavigationView_itemTextColor boolean r5 = r0.hasValue(r5) if (r5 == 0) goto L_0x00d6 int r5 = com.google.android.material.C2413R.styleable.NavigationView_itemTextColor android.content.res.ColorStateList r4 = r0.getColorStateList(r5) L_0x00d6: if (r2 != 0) goto L_0x00e1 if (r4 != 0) goto L_0x00e1 r5 = 16842806(0x1010036, float:2.369371E-38) android.content.res.ColorStateList r4 = r12.createDefaultColorStateList(r5) L_0x00e1: int r5 = com.google.android.material.C2413R.styleable.NavigationView_itemBackground android.graphics.drawable.Drawable r5 = r0.getDrawable(r5) if (r5 != 0) goto L_0x00f3 boolean r9 = r12.hasShapeAppearance(r0) if (r9 == 0) goto L_0x00f3 android.graphics.drawable.Drawable r5 = r12.createDefaultItemBackground(r0) L_0x00f3: int r9 = com.google.android.material.C2413R.styleable.NavigationView_itemHorizontalPadding boolean r9 = r0.hasValue(r9) if (r9 == 0) goto L_0x0104 int r9 = com.google.android.material.C2413R.styleable.NavigationView_itemHorizontalPadding int r9 = r0.getDimensionPixelSize(r9, r8) r6.setItemHorizontalPadding(r9) L_0x0104: int r9 = com.google.android.material.C2413R.styleable.NavigationView_itemIconPadding int r9 = r0.getDimensionPixelSize(r9, r8) int r10 = com.google.android.material.C2413R.styleable.NavigationView_itemMaxLines r11 = 1 int r10 = r0.getInt(r10, r11) r12.setItemMaxLines(r10) com.google.android.material.navigation.NavigationView$1 r10 = new com.google.android.material.navigation.NavigationView$1 r10.<init>() r7.setCallback(r10) r6.setId(r11) r6.initForMenu(r13, r7) r6.setItemIconTintList(r1) int r10 = r12.getOverScrollMode() r6.setOverScrollMode(r10) if (r2 == 0) goto L_0x0131 r6.setItemTextAppearance(r3) L_0x0131: r6.setItemTextColor(r4) r6.setItemBackground(r5) r6.setItemIconPadding(r9) r7.addMenuPresenter(r6) androidx.appcompat.view.menu.MenuView r6 = r6.getMenuView(r12) android.view.View r6 = (android.view.View) r6 r12.addView(r6) int r6 = com.google.android.material.C2413R.styleable.NavigationView_menu boolean r6 = r0.hasValue(r6) if (r6 == 0) goto L_0x0157 int r6 = com.google.android.material.C2413R.styleable.NavigationView_menu int r6 = r0.getResourceId(r6, r8) r12.inflateMenu(r6) L_0x0157: int r6 = com.google.android.material.C2413R.styleable.NavigationView_headerLayout boolean r6 = r0.hasValue(r6) if (r6 == 0) goto L_0x0168 int r6 = com.google.android.material.C2413R.styleable.NavigationView_headerLayout int r6 = r0.getResourceId(r6, r8) r12.inflateHeaderView(r6) L_0x0168: r0.recycle() r12.setupInsetScrimsListener() return */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.navigation.NavigationView.<init>(android.content.Context, android.util.AttributeSet, int):void"); } public void setOverScrollMode(int overScrollMode) { super.setOverScrollMode(overScrollMode); NavigationMenuPresenter navigationMenuPresenter = this.presenter; if (navigationMenuPresenter != null) { navigationMenuPresenter.setOverScrollMode(overScrollMode); } } private boolean hasShapeAppearance(TintTypedArray a) { return a.hasValue(C2413R.styleable.NavigationView_itemShapeAppearance) || a.hasValue(C2413R.styleable.NavigationView_itemShapeAppearanceOverlay); } /* access modifiers changed from: protected */ public void onAttachedToWindow() { super.onAttachedToWindow(); MaterialShapeUtils.setParentAbsoluteElevation(this); } public void setElevation(float elevation) { if (Build.VERSION.SDK_INT >= 21) { super.setElevation(elevation); } MaterialShapeUtils.setElevation(this, elevation); } private final Drawable createDefaultItemBackground(TintTypedArray a) { MaterialShapeDrawable materialShapeDrawable = new MaterialShapeDrawable(ShapeAppearanceModel.builder(getContext(), a.getResourceId(C2413R.styleable.NavigationView_itemShapeAppearance, 0), a.getResourceId(C2413R.styleable.NavigationView_itemShapeAppearanceOverlay, 0)).build()); materialShapeDrawable.setFillColor(MaterialResources.getColorStateList(getContext(), a, C2413R.styleable.NavigationView_itemShapeFillColor)); return new InsetDrawable(materialShapeDrawable, a.getDimensionPixelSize(C2413R.styleable.NavigationView_itemShapeInsetStart, 0), a.getDimensionPixelSize(C2413R.styleable.NavigationView_itemShapeInsetTop, 0), a.getDimensionPixelSize(C2413R.styleable.NavigationView_itemShapeInsetEnd, 0), a.getDimensionPixelSize(C2413R.styleable.NavigationView_itemShapeInsetBottom, 0)); } /* access modifiers changed from: protected */ public Parcelable onSaveInstanceState() { SavedState state = new SavedState(super.onSaveInstanceState()); state.menuState = new Bundle(); this.menu.savePresenterStates(state.menuState); return state; } /* access modifiers changed from: protected */ public void onRestoreInstanceState(Parcelable savedState) { if (!(savedState instanceof SavedState)) { super.onRestoreInstanceState(savedState); return; } SavedState state = (SavedState) savedState; super.onRestoreInstanceState(state.getSuperState()); this.menu.restorePresenterStates(state.menuState); } public void setNavigationItemSelectedListener(OnNavigationItemSelectedListener listener2) { this.listener = listener2; } /* access modifiers changed from: protected */ public void onMeasure(int widthSpec, int heightSpec) { int mode = View.MeasureSpec.getMode(widthSpec); if (mode == Integer.MIN_VALUE) { widthSpec = View.MeasureSpec.makeMeasureSpec(Math.min(View.MeasureSpec.getSize(widthSpec), this.maxWidth), Ints.MAX_POWER_OF_TWO); } else if (mode == 0) { widthSpec = View.MeasureSpec.makeMeasureSpec(this.maxWidth, Ints.MAX_POWER_OF_TWO); } super.onMeasure(widthSpec, heightSpec); } /* access modifiers changed from: protected */ public void onInsetsChanged(WindowInsetsCompat insets) { this.presenter.dispatchApplyWindowInsets(insets); } public void inflateMenu(int resId) { this.presenter.setUpdateSuspended(true); getMenuInflater().inflate(resId, this.menu); this.presenter.setUpdateSuspended(false); this.presenter.updateMenuView(false); } public Menu getMenu() { return this.menu; } public View inflateHeaderView(int res) { return this.presenter.inflateHeaderView(res); } public void addHeaderView(View view) { this.presenter.addHeaderView(view); } public void removeHeaderView(View view) { this.presenter.removeHeaderView(view); } public int getHeaderCount() { return this.presenter.getHeaderCount(); } public View getHeaderView(int index) { return this.presenter.getHeaderView(index); } public ColorStateList getItemIconTintList() { return this.presenter.getItemTintList(); } public void setItemIconTintList(ColorStateList tint) { this.presenter.setItemIconTintList(tint); } public ColorStateList getItemTextColor() { return this.presenter.getItemTextColor(); } public void setItemTextColor(ColorStateList textColor) { this.presenter.setItemTextColor(textColor); } public Drawable getItemBackground() { return this.presenter.getItemBackground(); } public void setItemBackgroundResource(int resId) { setItemBackground(ContextCompat.getDrawable(getContext(), resId)); } public void setItemBackground(Drawable itemBackground) { this.presenter.setItemBackground(itemBackground); } public int getItemHorizontalPadding() { return this.presenter.getItemHorizontalPadding(); } public void setItemHorizontalPadding(int padding) { this.presenter.setItemHorizontalPadding(padding); } public void setItemHorizontalPaddingResource(int paddingResource) { this.presenter.setItemHorizontalPadding(getResources().getDimensionPixelSize(paddingResource)); } public int getItemIconPadding() { return this.presenter.getItemIconPadding(); } public void setItemIconPadding(int padding) { this.presenter.setItemIconPadding(padding); } public void setItemIconPaddingResource(int paddingResource) { this.presenter.setItemIconPadding(getResources().getDimensionPixelSize(paddingResource)); } public void setCheckedItem(int id) { MenuItem item = this.menu.findItem(id); if (item != null) { this.presenter.setCheckedItem((MenuItemImpl) item); } } public void setCheckedItem(MenuItem checkedItem) { MenuItem item = this.menu.findItem(checkedItem.getItemId()); if (item != null) { this.presenter.setCheckedItem((MenuItemImpl) item); return; } throw new IllegalArgumentException("Called setCheckedItem(MenuItem) with an item that is not in the current menu."); } public MenuItem getCheckedItem() { return this.presenter.getCheckedItem(); } public void setItemTextAppearance(int resId) { this.presenter.setItemTextAppearance(resId); } public void setItemIconSize(int iconSize) { this.presenter.setItemIconSize(iconSize); } public void setItemMaxLines(int itemMaxLines) { this.presenter.setItemMaxLines(itemMaxLines); } public int getItemMaxLines() { return this.presenter.getItemMaxLines(); } private MenuInflater getMenuInflater() { if (this.menuInflater == null) { this.menuInflater = new SupportMenuInflater(getContext()); } return this.menuInflater; } private ColorStateList createDefaultColorStateList(int baseColorThemeAttr) { TypedValue value = new TypedValue(); if (!getContext().getTheme().resolveAttribute(baseColorThemeAttr, value, true)) { return null; } ColorStateList baseColor = AppCompatResources.getColorStateList(getContext(), value.resourceId); if (!getContext().getTheme().resolveAttribute(C2018R.attr.colorPrimary, value, true)) { return null; } int colorPrimary = value.data; int defaultColor = baseColor.getDefaultColor(); int[] iArr = DISABLED_STATE_SET; return new ColorStateList(new int[][]{iArr, CHECKED_STATE_SET, EMPTY_STATE_SET}, new int[]{baseColor.getColorForState(iArr, defaultColor), colorPrimary, defaultColor}); } /* access modifiers changed from: protected */ public void onDetachedFromWindow() { super.onDetachedFromWindow(); if (Build.VERSION.SDK_INT < 16) { getViewTreeObserver().removeGlobalOnLayoutListener(this.onGlobalLayoutListener); } else { getViewTreeObserver().removeOnGlobalLayoutListener(this.onGlobalLayoutListener); } } private void setupInsetScrimsListener() { this.onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() { public void onGlobalLayout() { NavigationView navigationView = NavigationView.this; navigationView.getLocationOnScreen(navigationView.tmpLocation); boolean z = true; boolean isBehindStatusBar = NavigationView.this.tmpLocation[1] == 0; NavigationView.this.presenter.setBehindStatusBar(isBehindStatusBar); NavigationView.this.setDrawTopInsetForeground(isBehindStatusBar); Context context = NavigationView.this.getContext(); if ((context instanceof Activity) && Build.VERSION.SDK_INT >= 21) { boolean isBehindSystemNav = ((Activity) context).findViewById(16908290).getHeight() == NavigationView.this.getHeight(); boolean hasNonZeroAlpha = Color.alpha(((Activity) context).getWindow().getNavigationBarColor()) != 0; NavigationView navigationView2 = NavigationView.this; if (!isBehindSystemNav || !hasNonZeroAlpha) { z = false; } navigationView2.setDrawBottomInsetForeground(z); } } }; getViewTreeObserver().addOnGlobalLayoutListener(this.onGlobalLayoutListener); } public static class SavedState extends AbsSavedState { public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.ClassLoaderCreator<SavedState>() { public SavedState createFromParcel(Parcel in, ClassLoader loader) { return new SavedState(in, loader); } public SavedState createFromParcel(Parcel in) { return new SavedState(in, (ClassLoader) null); } public SavedState[] newArray(int size) { return new SavedState[size]; } }; public Bundle menuState; public SavedState(Parcel in, ClassLoader loader) { super(in, loader); this.menuState = in.readBundle(loader); } public SavedState(Parcelable superState) { super(superState); } public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeBundle(this.menuState); } } }
21,990
0.672487
0.638745
503
42.717693
37.553936
377
false
false
0
0
0
0
0
0
0.449304
false
false
2
a73e69d2da3c8f2db1cef2d0b7076a5a18b334d3
21,131,239,104,149
a1dc34c279779801c42ea88b49cb7296257e2821
/app/src/main/java/com/project/zhongrenweigong/business/teach/TeachListActivity.java
caad2eceee8dd675e247e5b1388de037cd51d511
[]
no_license
Streamduo/ZhongRenWeiGong
https://github.com/Streamduo/ZhongRenWeiGong
ad53d61080bcf22f109f93fdfea8ba2721bae631
749be6433780dbe67c14960cc45824bd5c0a0004
refs/heads/master
2020-08-23T02:47:18.069000
2019-12-03T09:33:50
2019-12-03T09:33:50
216,526,409
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.project.zhongrenweigong.business.teach; import android.content.Intent; import android.content.res.AssetManager; import android.graphics.Typeface; import android.os.Bundle; import android.support.v4.view.ViewPager; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.EditorInfo; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.baidu.location.BDAbstractLocationListener; import com.baidu.location.BDLocation; import com.bigkoo.pickerview.builder.OptionsPickerBuilder; import com.bigkoo.pickerview.listener.CustomListener; import com.bigkoo.pickerview.listener.OnOptionsSelectListener; import com.bigkoo.pickerview.view.OptionsPickerView; import com.flyco.tablayout.SlidingTabLayout; import com.project.zhongrenweigong.App; import com.project.zhongrenweigong.R; import com.project.zhongrenweigong.baidumap.LocationService; import com.project.zhongrenweigong.base.BaseActivity; import com.project.zhongrenweigong.business.adapter.TeachListPageAdapter; import com.project.zhongrenweigong.currency.Constans; import com.project.zhongrenweigong.currency.bean.NavigationBean; import com.project.zhongrenweigong.currency.event.RefreshIndustrySearchEvent; import com.project.zhongrenweigong.home.MainActivity; import com.project.zhongrenweigong.util.GsonProvider; import com.project.zhongrenweigong.util.KeyboardUtils; import org.greenrobot.eventbus.EventBus; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; import okhttp3.Call; import okhttp3.Callback; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; public class TeachListActivity extends BaseActivity<TeachListPresent> { @BindView(R.id.te_back) TextView teBack; @BindView(R.id.te_title) TextView teTitle; @BindView(R.id.te_mine_address) TextView teMineAddress; @BindView(R.id.ed_search) EditText edSearch; @BindView(R.id.tab_layout) SlidingTabLayout tabLayout; @BindView(R.id.discover_list_vp) ViewPager discoverListVp; private LocationService locationService; public String province = "北京市"; private String searchText = ""; private OptionsPickerView datePickerView; // 省数据集合 private ArrayList<String> mListProvince = new ArrayList<>(); // 市数据集合 private ArrayList<ArrayList<String>> mListCity = new ArrayList<>(); // 区数据集合 private ArrayList<ArrayList<ArrayList<String>>> mListArea = new ArrayList<>(); private JSONObject mJsonObj; private String address_str; public double longitude = 1; public double latitude = 1; private BDLocation bdLocation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ButterKnife.bind(this); } @Override public void initView() { teTitle.setText("教育"); Intent intent = getIntent(); bdLocation = intent.getParcelableExtra("bdLocation"); edSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEARCH) { searchText = edSearch.getText().toString(); if (searchText != null && !searchText.equals("")) { //关闭软键盘 KeyboardUtils.hideSoftInput(TeachListActivity.this); } EventBus.getDefault().post(new RefreshIndustrySearchEvent(searchText, discoverListVp.getCurrentItem(), province, String.valueOf(latitude), String.valueOf(longitude))); return true; } return false; } }); TeachListPageAdapter teachListPageAdapter = new TeachListPageAdapter(getSupportFragmentManager(), bdLocation); discoverListVp.setAdapter(teachListPageAdapter); tabLayout.setViewPager(discoverListVp); discoverListVp.setCurrentItem(0); discoverListVp.setOffscreenPageLimit(2); tabLayout.onPageSelected(0); tabLayout.getTitleView(0).setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); discoverListVp.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int i, float v, int i1) { } @Override public void onPageSelected(int position) { for (int i = 0; i < 2; i++) { if (position == i) { //选中的字体大小 tabLayout.getTitleView(i).setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); } else { tabLayout.getTitleView(i).setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL)); } } } @Override public void onPageScrollStateChanged(int i) { } }); } @Override public void initAfter() { initJsonData(); initJsonDatas(); initAreaPicker(); if (bdLocation != null) { province = bdLocation.getProvince(); //经度 longitude = bdLocation.getLongitude(); //纬度 latitude = bdLocation.getLatitude(); String district = bdLocation.getDistrict();//地区 teMineAddress.setText(province + "." + district); } } private void setData(BDLocation location) { province = location.getProvince(); //经度 longitude = location.getLongitude(); //纬度 latitude = location.getLatitude(); String district = location.getDistrict();//地区 EventBus.getDefault().post(new RefreshIndustrySearchEvent(searchText, 2, province, String.valueOf(latitude), String.valueOf(longitude))); teMineAddress.setText(province + "." + district); } @Override protected void onStart() { super.onStart(); locationService = App.getInstance().locationService; //获取locationservice实例,建议应用中只初始化1个location实例,然后使用,可以参考其他示例的activity,都是通过此种方式获取locationservice实例的 locationService.registerListener(mListener); //注册监听 locationService.setLocationOption(locationService.getDefaultLocationClientOption()); if (bdLocation == null) { locationService.start(); } } @Override public void onResume() { super.onResume(); } @Override public int bindLayout() { return R.layout.activity_teach_list; } @Override public TeachListPresent bindPresent() { return new TeachListPresent(); } @Override public void setListener() { teBack.setOnClickListener(this); teMineAddress.setOnClickListener(this); } @Override public void widgetClick(View v) { switch (v.getId()) { case R.id.te_back: finish(); break; case R.id.te_mine_address: datePickerView.show(); break; } } private BDAbstractLocationListener mListener = new BDAbstractLocationListener() { /** * 定位请求回调函数 * @param location 定位结果 */ @Override public void onReceiveLocation(BDLocation location) { if (null != location && location.getLocType() != BDLocation.TypeServerError) { setData(location); if (location.getLocType() == BDLocation.TypeServerError) {//"服务端网络定位失败,可以反馈IMEI号和大体定位时间到 // loc-bugs@baidu.com,会有人追查原因" } else if (location.getLocType() == BDLocation.TypeNetWorkException) { //"网络不同导致定位失败,请检查网络是否通畅" showToastShort("定位失败,请检查网络后重试"); } else if (location.getLocType() == BDLocation.TypeCriteriaException) { showToastShort("定位失败,请检查网络后重试"); //"无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机"); } } } @Override public void onConnectHotSpotMessage(String s, int i) { super.onConnectHotSpotMessage(s, i); } /** * 回调定位诊断信息,开发者可以根据相关信息解决定位遇到的一些问题 * @param locType 当前定位类型 * @param diagnosticType 诊断类型(1~9) * @param diagnosticMessage 具体的诊断信息释义 */ @Override public void onLocDiagnosticMessage(int locType, int diagnosticType, String diagnosticMessage) { super.onLocDiagnosticMessage(locType, diagnosticType, diagnosticMessage); } }; private void initAreaPicker() { datePickerView = new OptionsPickerBuilder(this, new OnOptionsSelectListener() { @Override public void onOptionsSelect(int option1, int option2, int option3, View v) { if (mListCity.size() > option1 && mListCity.get(option1).size() > option2) { if (mListArea.size() > option1 && mListArea.get(option1).size() > option2 && mListArea.get(option1).get(option2).size() > option3) { String prov = mListProvince.get(option1); String city = mListCity.get(option1).get(option2); String area = mListArea.get(option1).get(option2).get(option3); address_str = prov + " " + city + " " + area; changeNavigation(prov + city + area); teMineAddress.setText(address_str); } } } }).setLayoutRes(R.layout.dialog_set_plan_start_time, new CustomListener() { @Override public void customLayout(View v) { final TextView tvSubmit = (TextView) v.findViewById(R.id.tv_finish); TextView ivCancel = (TextView) v.findViewById(R.id.tv_cancel); tvSubmit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { datePickerView.returnData(); datePickerView.dismiss(); } }); ivCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { datePickerView.dismiss(); } }); } }).setContentTextSize(18) .build(); datePickerView.setPicker(mListProvince, mListCity, mListArea);//添加数据 , mListArea } private void changeNavigation(String city) { //创建OkHttpClient对象 OkHttpClient okhttpClient = new OkHttpClient(); //创建Request对象 Request request = new Request.Builder() .url("http://api.map.baidu.com/geocoding/v3/?address=" + city + "&output=json&ak=" + Constans.MAP_AK + "&mcode=" + Constans.MAP_SAFE_NUM)//请求的地址,根据需求带参 .build(); //创建call对象 Call call = okhttpClient.newCall(request); call.enqueue(new Callback() { /** * 请求失败后执行 * @param call * @param e */ @Override public void onFailure(Call call, IOException e) { } /** * 请求成功后执行 * @param call * @param response * @throws IOException */ @Override public void onResponse(Call call, Response response) throws IOException { if (response.isSuccessful()) { String json = response.body().string(); try { JSONObject jsonObject = new JSONObject(json); int status = jsonObject.getInt("status"); if (status == 0) { NavigationBean navigationBean = GsonProvider.gson.fromJson(json, NavigationBean.class); NavigationBean.ResultBean result = navigationBean.getResult(); NavigationBean.ResultBean.LocationBean location = result.getLocation(); latitude = location.getLat(); longitude = location.getLng(); EventBus.getDefault().post(new RefreshIndustrySearchEvent(searchText, 2, province, String.valueOf(latitude), String.valueOf(longitude))); } } catch (JSONException e) { e.printStackTrace(); } } } }); } /** * 从assert文件夹中读取省市区的json文件,然后转化为json对象 */ private void initJsonData() { AssetManager assets = this.getAssets(); try { InputStream is = assets.open("area.json"); byte[] buf = new byte[is.available()]; is.read(buf); String json = new String(buf, "UTF-8"); mJsonObj = new JSONObject(json); is.close(); } catch (Exception e) { e.printStackTrace(); } } /** * 初始化Json数据,并释放Json对象 */ private void initJsonDatas() { try { JSONArray jsonArray = mJsonObj.getJSONArray("citylist"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonP = jsonArray.getJSONObject(i);// 获取每个省的Json对象 String province = jsonP.getString("name"); ArrayList<String> options2Items_01 = new ArrayList<>(); ArrayList<ArrayList<String>> options3Items_01 = new ArrayList<>(); JSONArray jsonCs = jsonP.getJSONArray("city"); for (int j = 0; j < jsonCs.length(); j++) { JSONObject jsonC = jsonCs.getJSONObject(j);// 获取每个市的Json对象 String city = jsonC.getString("name"); options2Items_01.add(city);// 添加市数据 ArrayList<String> options3Items_01_01 = new ArrayList<>(); JSONArray jsonAs = jsonC.getJSONArray("area"); for (int k = 0; k < jsonAs.length(); k++) { options3Items_01_01.add(jsonAs.getString(k));// 添加区数据 } options3Items_01.add(options3Items_01_01); } mListProvince.add(province);// 添加省数据 mListCity.add(options2Items_01); mListArea.add(options3Items_01); } } catch (JSONException e) { e.printStackTrace(); } mJsonObj = null; } @Override protected void onPause() { super.onPause(); locationService.unregisterListener(mListener); locationService.stop(); } }
UTF-8
Java
15,978
java
TeachListActivity.java
Java
[ { "context": "服务端网络定位失败,可以反馈IMEI号和大体定位时间到\n // loc-bugs@baidu.com,会有人追查原因\"\n } else if (location.getL", "end": 7865, "score": 0.9998933672904968, "start": 7847, "tag": "EMAIL", "value": "loc-bugs@baidu.com" } ]
null
[]
package com.project.zhongrenweigong.business.teach; import android.content.Intent; import android.content.res.AssetManager; import android.graphics.Typeface; import android.os.Bundle; import android.support.v4.view.ViewPager; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.EditorInfo; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.baidu.location.BDAbstractLocationListener; import com.baidu.location.BDLocation; import com.bigkoo.pickerview.builder.OptionsPickerBuilder; import com.bigkoo.pickerview.listener.CustomListener; import com.bigkoo.pickerview.listener.OnOptionsSelectListener; import com.bigkoo.pickerview.view.OptionsPickerView; import com.flyco.tablayout.SlidingTabLayout; import com.project.zhongrenweigong.App; import com.project.zhongrenweigong.R; import com.project.zhongrenweigong.baidumap.LocationService; import com.project.zhongrenweigong.base.BaseActivity; import com.project.zhongrenweigong.business.adapter.TeachListPageAdapter; import com.project.zhongrenweigong.currency.Constans; import com.project.zhongrenweigong.currency.bean.NavigationBean; import com.project.zhongrenweigong.currency.event.RefreshIndustrySearchEvent; import com.project.zhongrenweigong.home.MainActivity; import com.project.zhongrenweigong.util.GsonProvider; import com.project.zhongrenweigong.util.KeyboardUtils; import org.greenrobot.eventbus.EventBus; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; import okhttp3.Call; import okhttp3.Callback; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; public class TeachListActivity extends BaseActivity<TeachListPresent> { @BindView(R.id.te_back) TextView teBack; @BindView(R.id.te_title) TextView teTitle; @BindView(R.id.te_mine_address) TextView teMineAddress; @BindView(R.id.ed_search) EditText edSearch; @BindView(R.id.tab_layout) SlidingTabLayout tabLayout; @BindView(R.id.discover_list_vp) ViewPager discoverListVp; private LocationService locationService; public String province = "北京市"; private String searchText = ""; private OptionsPickerView datePickerView; // 省数据集合 private ArrayList<String> mListProvince = new ArrayList<>(); // 市数据集合 private ArrayList<ArrayList<String>> mListCity = new ArrayList<>(); // 区数据集合 private ArrayList<ArrayList<ArrayList<String>>> mListArea = new ArrayList<>(); private JSONObject mJsonObj; private String address_str; public double longitude = 1; public double latitude = 1; private BDLocation bdLocation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ButterKnife.bind(this); } @Override public void initView() { teTitle.setText("教育"); Intent intent = getIntent(); bdLocation = intent.getParcelableExtra("bdLocation"); edSearch.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEARCH) { searchText = edSearch.getText().toString(); if (searchText != null && !searchText.equals("")) { //关闭软键盘 KeyboardUtils.hideSoftInput(TeachListActivity.this); } EventBus.getDefault().post(new RefreshIndustrySearchEvent(searchText, discoverListVp.getCurrentItem(), province, String.valueOf(latitude), String.valueOf(longitude))); return true; } return false; } }); TeachListPageAdapter teachListPageAdapter = new TeachListPageAdapter(getSupportFragmentManager(), bdLocation); discoverListVp.setAdapter(teachListPageAdapter); tabLayout.setViewPager(discoverListVp); discoverListVp.setCurrentItem(0); discoverListVp.setOffscreenPageLimit(2); tabLayout.onPageSelected(0); tabLayout.getTitleView(0).setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); discoverListVp.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int i, float v, int i1) { } @Override public void onPageSelected(int position) { for (int i = 0; i < 2; i++) { if (position == i) { //选中的字体大小 tabLayout.getTitleView(i).setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); } else { tabLayout.getTitleView(i).setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL)); } } } @Override public void onPageScrollStateChanged(int i) { } }); } @Override public void initAfter() { initJsonData(); initJsonDatas(); initAreaPicker(); if (bdLocation != null) { province = bdLocation.getProvince(); //经度 longitude = bdLocation.getLongitude(); //纬度 latitude = bdLocation.getLatitude(); String district = bdLocation.getDistrict();//地区 teMineAddress.setText(province + "." + district); } } private void setData(BDLocation location) { province = location.getProvince(); //经度 longitude = location.getLongitude(); //纬度 latitude = location.getLatitude(); String district = location.getDistrict();//地区 EventBus.getDefault().post(new RefreshIndustrySearchEvent(searchText, 2, province, String.valueOf(latitude), String.valueOf(longitude))); teMineAddress.setText(province + "." + district); } @Override protected void onStart() { super.onStart(); locationService = App.getInstance().locationService; //获取locationservice实例,建议应用中只初始化1个location实例,然后使用,可以参考其他示例的activity,都是通过此种方式获取locationservice实例的 locationService.registerListener(mListener); //注册监听 locationService.setLocationOption(locationService.getDefaultLocationClientOption()); if (bdLocation == null) { locationService.start(); } } @Override public void onResume() { super.onResume(); } @Override public int bindLayout() { return R.layout.activity_teach_list; } @Override public TeachListPresent bindPresent() { return new TeachListPresent(); } @Override public void setListener() { teBack.setOnClickListener(this); teMineAddress.setOnClickListener(this); } @Override public void widgetClick(View v) { switch (v.getId()) { case R.id.te_back: finish(); break; case R.id.te_mine_address: datePickerView.show(); break; } } private BDAbstractLocationListener mListener = new BDAbstractLocationListener() { /** * 定位请求回调函数 * @param location 定位结果 */ @Override public void onReceiveLocation(BDLocation location) { if (null != location && location.getLocType() != BDLocation.TypeServerError) { setData(location); if (location.getLocType() == BDLocation.TypeServerError) {//"服务端网络定位失败,可以反馈IMEI号和大体定位时间到 // <EMAIL>,会有人追查原因" } else if (location.getLocType() == BDLocation.TypeNetWorkException) { //"网络不同导致定位失败,请检查网络是否通畅" showToastShort("定位失败,请检查网络后重试"); } else if (location.getLocType() == BDLocation.TypeCriteriaException) { showToastShort("定位失败,请检查网络后重试"); //"无法获取有效定位依据导致定位失败,一般是由于手机的原因,处于飞行模式下一般会造成这种结果,可以试着重启手机"); } } } @Override public void onConnectHotSpotMessage(String s, int i) { super.onConnectHotSpotMessage(s, i); } /** * 回调定位诊断信息,开发者可以根据相关信息解决定位遇到的一些问题 * @param locType 当前定位类型 * @param diagnosticType 诊断类型(1~9) * @param diagnosticMessage 具体的诊断信息释义 */ @Override public void onLocDiagnosticMessage(int locType, int diagnosticType, String diagnosticMessage) { super.onLocDiagnosticMessage(locType, diagnosticType, diagnosticMessage); } }; private void initAreaPicker() { datePickerView = new OptionsPickerBuilder(this, new OnOptionsSelectListener() { @Override public void onOptionsSelect(int option1, int option2, int option3, View v) { if (mListCity.size() > option1 && mListCity.get(option1).size() > option2) { if (mListArea.size() > option1 && mListArea.get(option1).size() > option2 && mListArea.get(option1).get(option2).size() > option3) { String prov = mListProvince.get(option1); String city = mListCity.get(option1).get(option2); String area = mListArea.get(option1).get(option2).get(option3); address_str = prov + " " + city + " " + area; changeNavigation(prov + city + area); teMineAddress.setText(address_str); } } } }).setLayoutRes(R.layout.dialog_set_plan_start_time, new CustomListener() { @Override public void customLayout(View v) { final TextView tvSubmit = (TextView) v.findViewById(R.id.tv_finish); TextView ivCancel = (TextView) v.findViewById(R.id.tv_cancel); tvSubmit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { datePickerView.returnData(); datePickerView.dismiss(); } }); ivCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { datePickerView.dismiss(); } }); } }).setContentTextSize(18) .build(); datePickerView.setPicker(mListProvince, mListCity, mListArea);//添加数据 , mListArea } private void changeNavigation(String city) { //创建OkHttpClient对象 OkHttpClient okhttpClient = new OkHttpClient(); //创建Request对象 Request request = new Request.Builder() .url("http://api.map.baidu.com/geocoding/v3/?address=" + city + "&output=json&ak=" + Constans.MAP_AK + "&mcode=" + Constans.MAP_SAFE_NUM)//请求的地址,根据需求带参 .build(); //创建call对象 Call call = okhttpClient.newCall(request); call.enqueue(new Callback() { /** * 请求失败后执行 * @param call * @param e */ @Override public void onFailure(Call call, IOException e) { } /** * 请求成功后执行 * @param call * @param response * @throws IOException */ @Override public void onResponse(Call call, Response response) throws IOException { if (response.isSuccessful()) { String json = response.body().string(); try { JSONObject jsonObject = new JSONObject(json); int status = jsonObject.getInt("status"); if (status == 0) { NavigationBean navigationBean = GsonProvider.gson.fromJson(json, NavigationBean.class); NavigationBean.ResultBean result = navigationBean.getResult(); NavigationBean.ResultBean.LocationBean location = result.getLocation(); latitude = location.getLat(); longitude = location.getLng(); EventBus.getDefault().post(new RefreshIndustrySearchEvent(searchText, 2, province, String.valueOf(latitude), String.valueOf(longitude))); } } catch (JSONException e) { e.printStackTrace(); } } } }); } /** * 从assert文件夹中读取省市区的json文件,然后转化为json对象 */ private void initJsonData() { AssetManager assets = this.getAssets(); try { InputStream is = assets.open("area.json"); byte[] buf = new byte[is.available()]; is.read(buf); String json = new String(buf, "UTF-8"); mJsonObj = new JSONObject(json); is.close(); } catch (Exception e) { e.printStackTrace(); } } /** * 初始化Json数据,并释放Json对象 */ private void initJsonDatas() { try { JSONArray jsonArray = mJsonObj.getJSONArray("citylist"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonP = jsonArray.getJSONObject(i);// 获取每个省的Json对象 String province = jsonP.getString("name"); ArrayList<String> options2Items_01 = new ArrayList<>(); ArrayList<ArrayList<String>> options3Items_01 = new ArrayList<>(); JSONArray jsonCs = jsonP.getJSONArray("city"); for (int j = 0; j < jsonCs.length(); j++) { JSONObject jsonC = jsonCs.getJSONObject(j);// 获取每个市的Json对象 String city = jsonC.getString("name"); options2Items_01.add(city);// 添加市数据 ArrayList<String> options3Items_01_01 = new ArrayList<>(); JSONArray jsonAs = jsonC.getJSONArray("area"); for (int k = 0; k < jsonAs.length(); k++) { options3Items_01_01.add(jsonAs.getString(k));// 添加区数据 } options3Items_01.add(options3Items_01_01); } mListProvince.add(province);// 添加省数据 mListCity.add(options2Items_01); mListArea.add(options3Items_01); } } catch (JSONException e) { e.printStackTrace(); } mJsonObj = null; } @Override protected void onPause() { super.onPause(); locationService.unregisterListener(mListener); locationService.stop(); } }
15,967
0.585363
0.580163
406
36.423645
27.030413
125
false
false
0
0
0
0
0
0
0.541872
false
false
2
c042710b133e2c3f2816762e392cdef6985e3d92
9,689,446,232,661
013c2acf5b231a3cd51439ca0d6b028dcbfdb51d
/src/main/java/com/globe_sh/cloudplatform/server/explain/DIntResolve.java
dabf9962dcac71640b5e62e8b84653842a991d99
[]
no_license
bluebird1999/nec-server
https://github.com/bluebird1999/nec-server
3392e6007e7562bbac00e3947d3fb8c312f4a1c8
5ad05fcdb6be3fa2ecbd9f99935c2e6730e735f0
refs/heads/master
2022-12-22T10:18:52.930000
2021-01-28T07:48:17
2021-01-28T07:48:17
252,859,188
0
1
null
false
2022-12-16T08:19:01
2020-04-03T22:51:04
2021-01-28T07:48:33
2022-12-16T08:18:58
72
0
0
17
Java
false
false
package com.globe_sh.cloudplatform.server.explain; import com.globe_sh.cloudplatform.common.util.ByteArrayUtil; import com.globe_sh.cloudplatform.server.entity.DecoderBean; public class DIntResolve extends AbsResolve { public DIntResolve(DecoderBean decoder) { super(decoder); } public void execute() { int startIndex = start + decoder.getStartByte(); int s = 0; if("1".equals(decoder.getLowPrecede())) { s = ByteArrayUtil.getInt(data, startIndex); } else { s = ByteArrayUtil.getIntLowEnd(data, startIndex); } String value = translate(s); endResolve(value); } }
UTF-8
Java
622
java
DIntResolve.java
Java
[]
null
[]
package com.globe_sh.cloudplatform.server.explain; import com.globe_sh.cloudplatform.common.util.ByteArrayUtil; import com.globe_sh.cloudplatform.server.entity.DecoderBean; public class DIntResolve extends AbsResolve { public DIntResolve(DecoderBean decoder) { super(decoder); } public void execute() { int startIndex = start + decoder.getStartByte(); int s = 0; if("1".equals(decoder.getLowPrecede())) { s = ByteArrayUtil.getInt(data, startIndex); } else { s = ByteArrayUtil.getIntLowEnd(data, startIndex); } String value = translate(s); endResolve(value); } }
622
0.699357
0.696141
25
22.879999
21.911312
60
false
false
0
0
0
0
0
0
1.64
false
false
2
022bcb56676654542788f138347366ab6f21b485
10,024,453,678,321
60572e49812927e6a8038f9090bac56c4a5472fa
/src/Mud/comandi/Comandi.java
66c1660451ee9f2fa4374cdc98a02e620c7dfb8a
[]
no_license
Frakka/JitMud
https://github.com/Frakka/JitMud
dc1d683b5a28fd3b5075d78cbffad48fa486b2b0
ac12b2a1b6ce74b795a7d0242b34aa8fc88cfbf3
refs/heads/master
2016-03-27T00:19:19.056000
2013-05-07T14:38:57
2013-05-07T14:38:57
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Mud.comandi; import Mud.Comando; import Mud.GestoreComandi; import Mud.Player; /** * Comando per visualizzare la lista di tutti i comandi disponibili. * * @author Enrico Fraccaroli */ public class Comandi extends CommandTemplate { /** * Costrutto del comando. * * @param command The command object on which to base this template. */ public Comandi(Comando command) { super(command); } @Override public boolean exec(Player player, String args) { player.getClientHandler().sendMessage("Comandi Disponibili:\r\n"); player.getClientHandler().sendMessage(GestoreComandi.getInstance().toString()); player.getClientHandler().sendMessage("\r\n"); return true; } }
UTF-8
Java
755
java
Comandi.java
Java
[ { "context": "ista di tutti i comandi disponibili.\n *\n * @author Enrico Fraccaroli\n */\npublic class Comandi extends CommandTemplate ", "end": 193, "score": 0.9998804330825806, "start": 176, "tag": "NAME", "value": "Enrico Fraccaroli" } ]
null
[]
package Mud.comandi; import Mud.Comando; import Mud.GestoreComandi; import Mud.Player; /** * Comando per visualizzare la lista di tutti i comandi disponibili. * * @author <NAME> */ public class Comandi extends CommandTemplate { /** * Costrutto del comando. * * @param command The command object on which to base this template. */ public Comandi(Comando command) { super(command); } @Override public boolean exec(Player player, String args) { player.getClientHandler().sendMessage("Comandi Disponibili:\r\n"); player.getClientHandler().sendMessage(GestoreComandi.getInstance().toString()); player.getClientHandler().sendMessage("\r\n"); return true; } }
744
0.675497
0.675497
30
24.200001
25.288206
87
false
false
0
0
0
0
0
0
0.333333
false
false
2
0ea4d58c181a5f2c32fd1d71769c83825a961a21
15,135,464,760,746
d448f74160425f82881c451464330dae2f936d02
/src/sample/Graph.java
982dd2c82fcbb3028ee8d1ac13241304585dbefb
[]
no_license
ivanDsky/GraphFX
https://github.com/ivanDsky/GraphFX
b03fc51d80ec86b7c8d54ff20fb42bc57a1f8866
3b825e1ff3afe7a439580e86e50a528b59980cfe
refs/heads/master
2023-05-05T09:52:25.056000
2021-05-15T15:38:14
2021-05-15T15:38:14
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package sample; import javafx.collections.ObservableList; import javafx.scene.chart.XYChart; import javafx.scene.control.SpinnerValueFactory; public abstract class Graph { public String name; protected String startLabel; protected String finishLabel; protected double start; protected double finish; public double samples = 100; public boolean showA; protected double aDef; protected double aStart; protected double aStop; protected double aStep; public boolean showB; protected double bDef; protected double bStart; protected double bStop; protected double bStep; protected final Controller controller; protected void updateDataset(XYChart.Series<Double, Double> series) { samples = controller.density.getValue(); } ; protected XYChart.Series<Double, Double> seriesFromData(ObservableList<XYChart.Series<Double, Double>> data) { XYChart.Series<Double, Double> series; series = new XYChart.Series<>(); series.setName(name); if (data.size() == 0) data.add(series); else data.set(0, series); return series; } public Graph(Controller controller) { this.controller = controller; } public void init() { controller.graphChart.setTitle(name); controller.spinnerA.getParent().setManaged(showA); controller.spinnerA.getParent().setVisible(showA); if (showA) controller.spinnerA.setValueFactory(new SpinnerValueFactory.DoubleSpinnerValueFactory(aStart, aStop, aDef, aStep)); controller.spinnerB.getParent().setManaged(showB); controller.spinnerB.getParent().setVisible(showB); if (showB) controller.spinnerB.setValueFactory(new SpinnerValueFactory.DoubleSpinnerValueFactory(bStart, bStop, bDef, bStep)); controller.startLabel.setText(startLabel); controller.finishLabel.setText(finishLabel); controller.start.setText(Double.toString(start)); controller.finish.setText(Double.toString(finish)); controller.description.setText(description()); } public abstract String description(); @Override public String toString() { return name; } }
UTF-8
Java
2,252
java
Graph.java
Java
[]
null
[]
package sample; import javafx.collections.ObservableList; import javafx.scene.chart.XYChart; import javafx.scene.control.SpinnerValueFactory; public abstract class Graph { public String name; protected String startLabel; protected String finishLabel; protected double start; protected double finish; public double samples = 100; public boolean showA; protected double aDef; protected double aStart; protected double aStop; protected double aStep; public boolean showB; protected double bDef; protected double bStart; protected double bStop; protected double bStep; protected final Controller controller; protected void updateDataset(XYChart.Series<Double, Double> series) { samples = controller.density.getValue(); } ; protected XYChart.Series<Double, Double> seriesFromData(ObservableList<XYChart.Series<Double, Double>> data) { XYChart.Series<Double, Double> series; series = new XYChart.Series<>(); series.setName(name); if (data.size() == 0) data.add(series); else data.set(0, series); return series; } public Graph(Controller controller) { this.controller = controller; } public void init() { controller.graphChart.setTitle(name); controller.spinnerA.getParent().setManaged(showA); controller.spinnerA.getParent().setVisible(showA); if (showA) controller.spinnerA.setValueFactory(new SpinnerValueFactory.DoubleSpinnerValueFactory(aStart, aStop, aDef, aStep)); controller.spinnerB.getParent().setManaged(showB); controller.spinnerB.getParent().setVisible(showB); if (showB) controller.spinnerB.setValueFactory(new SpinnerValueFactory.DoubleSpinnerValueFactory(bStart, bStop, bDef, bStep)); controller.startLabel.setText(startLabel); controller.finishLabel.setText(finishLabel); controller.start.setText(Double.toString(start)); controller.finish.setText(Double.toString(finish)); controller.description.setText(description()); } public abstract String description(); @Override public String toString() { return name; } }
2,252
0.693162
0.690941
74
29.432432
27.327879
127
false
false
0
0
0
0
0
0
0.743243
false
false
2
a5bb4d5c8ed373d3cf084b41651cbc299719cbe5
1,090,921,710,545
7d6e81fa565dc7b719b4a166895641aea3277a0b
/ListviewFragmentsAsigment/app/src/main/java/com/example/aptivist_u002/listviewfragmentsasigment/DetailFragment.java
cf5a13075ff640e4409e4fb8b75684fe5e533a7d
[]
no_license
Sonredi/android_training
https://github.com/Sonredi/android_training
74ad4ee5744e9536e59b5b9edb4a9ad9a2c75cb4
686ef42aa8b1c0b3224d2449d6bd5d765209b70e
refs/heads/master
2021-08-20T09:53:53.864000
2017-11-28T19:33:56
2017-11-28T19:33:56
109,873,447
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.aptivist_u002.listviewfragmentsasigment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.squareup.picasso.MemoryPolicy; import com.squareup.picasso.NetworkPolicy; import com.squareup.picasso.Picasso; /** * A simple {@link Fragment} subclass. */ public class DetailFragment extends Fragment { TextView detailText1; private ImageView imageVIew; public DetailFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_detail, container, false); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); detailText1 = (TextView) view.findViewById(R.id.detail_text1); imageVIew = (ImageView) view.findViewById(R.id.fragment_image1); detailText1.setText(getArguments().getString("name")); Picasso.with(getContext()).load("http://lorempixel.com/200/200/sports/") .networkPolicy(NetworkPolicy.NO_CACHE) .memoryPolicy(MemoryPolicy.NO_CACHE).into(imageVIew); } }
UTF-8
Java
1,546
java
DetailFragment.java
Java
[]
null
[]
package com.example.aptivist_u002.listviewfragmentsasigment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.squareup.picasso.MemoryPolicy; import com.squareup.picasso.NetworkPolicy; import com.squareup.picasso.Picasso; /** * A simple {@link Fragment} subclass. */ public class DetailFragment extends Fragment { TextView detailText1; private ImageView imageVIew; public DetailFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_detail, container, false); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); detailText1 = (TextView) view.findViewById(R.id.detail_text1); imageVIew = (ImageView) view.findViewById(R.id.fragment_image1); detailText1.setText(getArguments().getString("name")); Picasso.with(getContext()).load("http://lorempixel.com/200/200/sports/") .networkPolicy(NetworkPolicy.NO_CACHE) .memoryPolicy(MemoryPolicy.NO_CACHE).into(imageVIew); } }
1,546
0.717982
0.708279
51
29.313726
26.397036
80
false
false
0
0
0
0
0
0
0.509804
false
false
2
c62464a731f83200f043adfc18ba53f0bdeaf37d
7,653,631,739,036
21edb3829fe62235536d22e5363bdaf763bce604
/Movie.java
6f292ed3439f58807c92022aca7372721e5f5b46
[]
no_license
mohithabhiram/PrimeSearchFilter
https://github.com/mohithabhiram/PrimeSearchFilter
298172a13e530dcfa714b58f4ee2b75dbdacb9e6
abb8f0352fffe02776cbf4555f1fd6d18dd533a1
refs/heads/main
2023-08-29T04:51:54.043000
2021-09-27T07:51:35
2021-09-27T07:51:35
410,787,334
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.*; public class Movie { private String movieName; private int yearOfRelease; private double rating; private int views; public Movie() { } public Movie(String movieName,int yearOfRelease ,double rating, int views) { this.movieName = movieName; this.yearOfRelease = yearOfRelease; this.rating = rating; this.views = views; } public int getYearOfRelease() { return yearOfRelease; } public void setYearOfRelease(int yearOfRelease) { this.yearOfRelease = yearOfRelease; } public int getViews() { return views; } public void setViews(int views) { this.views = views; } public String getMovieName() { return movieName; } public void setmovieName(String movieName) { this.movieName = movieName; } public double getRating() { return rating; } public void setRating(double rating) { this.rating = rating; } public static Comparator<Movie> viewsComp = new Comparator <Movie>() { public int compare(Movie m1,Movie m2) { int v1=m1.getViews(); int v2=m2.getViews(); return v2-v1; } }; public static void main(String [] args) { ArrayList<Movie> mve = new ArrayList<Movie>(); Scanner sc = new Scanner(System.in); mve.add(new Movie("Arrival",2016,7.9,3100)); mve.add(new Movie("The Shawshank Redemption",1994,9.2,3500)); mve.add(new Movie("12 Angry Men",1957,8.9,3200)); mve.add(new Movie("The Prestige",2006,8.5,4200)); mve.add(new Movie("The Dark Knight Rises",2012,8.3,2800)); mve.add(new Movie("A Beautiful Mind",2001,8.1,2890)); mve.add(new Movie("Shutter Island",2010,8.1,3200)); mve.add(new Movie("Prisoners",2013,8.1,2910)); mve.add(new Movie("Incendies",2010,8.3,3100)); mve.add(new Movie("Interstellar",2014,8.6, 3580)); mve.add(new Movie("Drive",2011,7.8, 2960)); mve.add(new Movie("Django Unchained",2012,8.4,3560)); mve.add(new Movie("Fight Club",1999,8.8,4696)); while(true) { System.out.println("_______________________________"); System.out.println("Choose the required filter:"); System.out.println("1.Order by IMDB rating"); System.out.println("2.Order by year of release"); System.out.println("3.Order by number of views"); System.out.println("4.Exit"); int choice = sc.nextInt(); switch(choice) { case 1: System.out.println("Please enter the IMDB rating"); double rating = sc.nextDouble(); fetchByRating(mve,rating); break; case 2: System.out.println("Please enter the range for year of release"); System.out.print("From:"); int from = sc.nextInt(); System.out.print("To:"); int to = sc.nextInt(); fetchByYearOfRelease(mve,from,to); break; case 3: System.out.println("Ordering by number of views"); fetchByViews(mve); break; default: System.exit(0); break; } } } private static void fetchByViews(ArrayList<Movie> mve) { Collections.sort(mve,Movie.viewsComp); for(int i = 0; i < mve.size(); i++){ Movie m = mve.get(i); System.out.println(m.getMovieName()+", "+"Views:"+m.getViews()); } } private static void fetchByYearOfRelease(ArrayList<Movie> mve, int from, int to) { Movie m; for(int i = 0; i < mve.size(); i++){ m = mve.get(i); if(m.getYearOfRelease()>=from && m.getYearOfRelease()<=to) { System.out.println(m.getMovieName()+", "+"Year:"+m.getYearOfRelease()); } } } private static void fetchByRating(ArrayList<Movie> mve, double rating2) { Movie m; for(int i = 0; i < mve.size(); i++){ m = mve.get(i); if(m.getRating()>=rating2) { System.out.println(m.getMovieName()+", "+"Rating:"+m.getRating()); } } } }
UTF-8
Java
3,943
java
Movie.java
Java
[]
null
[]
import java.util.*; public class Movie { private String movieName; private int yearOfRelease; private double rating; private int views; public Movie() { } public Movie(String movieName,int yearOfRelease ,double rating, int views) { this.movieName = movieName; this.yearOfRelease = yearOfRelease; this.rating = rating; this.views = views; } public int getYearOfRelease() { return yearOfRelease; } public void setYearOfRelease(int yearOfRelease) { this.yearOfRelease = yearOfRelease; } public int getViews() { return views; } public void setViews(int views) { this.views = views; } public String getMovieName() { return movieName; } public void setmovieName(String movieName) { this.movieName = movieName; } public double getRating() { return rating; } public void setRating(double rating) { this.rating = rating; } public static Comparator<Movie> viewsComp = new Comparator <Movie>() { public int compare(Movie m1,Movie m2) { int v1=m1.getViews(); int v2=m2.getViews(); return v2-v1; } }; public static void main(String [] args) { ArrayList<Movie> mve = new ArrayList<Movie>(); Scanner sc = new Scanner(System.in); mve.add(new Movie("Arrival",2016,7.9,3100)); mve.add(new Movie("The Shawshank Redemption",1994,9.2,3500)); mve.add(new Movie("12 Angry Men",1957,8.9,3200)); mve.add(new Movie("The Prestige",2006,8.5,4200)); mve.add(new Movie("The Dark Knight Rises",2012,8.3,2800)); mve.add(new Movie("A Beautiful Mind",2001,8.1,2890)); mve.add(new Movie("Shutter Island",2010,8.1,3200)); mve.add(new Movie("Prisoners",2013,8.1,2910)); mve.add(new Movie("Incendies",2010,8.3,3100)); mve.add(new Movie("Interstellar",2014,8.6, 3580)); mve.add(new Movie("Drive",2011,7.8, 2960)); mve.add(new Movie("Django Unchained",2012,8.4,3560)); mve.add(new Movie("Fight Club",1999,8.8,4696)); while(true) { System.out.println("_______________________________"); System.out.println("Choose the required filter:"); System.out.println("1.Order by IMDB rating"); System.out.println("2.Order by year of release"); System.out.println("3.Order by number of views"); System.out.println("4.Exit"); int choice = sc.nextInt(); switch(choice) { case 1: System.out.println("Please enter the IMDB rating"); double rating = sc.nextDouble(); fetchByRating(mve,rating); break; case 2: System.out.println("Please enter the range for year of release"); System.out.print("From:"); int from = sc.nextInt(); System.out.print("To:"); int to = sc.nextInt(); fetchByYearOfRelease(mve,from,to); break; case 3: System.out.println("Ordering by number of views"); fetchByViews(mve); break; default: System.exit(0); break; } } } private static void fetchByViews(ArrayList<Movie> mve) { Collections.sort(mve,Movie.viewsComp); for(int i = 0; i < mve.size(); i++){ Movie m = mve.get(i); System.out.println(m.getMovieName()+", "+"Views:"+m.getViews()); } } private static void fetchByYearOfRelease(ArrayList<Movie> mve, int from, int to) { Movie m; for(int i = 0; i < mve.size(); i++){ m = mve.get(i); if(m.getYearOfRelease()>=from && m.getYearOfRelease()<=to) { System.out.println(m.getMovieName()+", "+"Year:"+m.getYearOfRelease()); } } } private static void fetchByRating(ArrayList<Movie> mve, double rating2) { Movie m; for(int i = 0; i < mve.size(); i++){ m = mve.get(i); if(m.getRating()>=rating2) { System.out.println(m.getMovieName()+", "+"Rating:"+m.getRating()); } } } }
3,943
0.599036
0.560233
138
26.528986
21.61293
82
false
false
0
0
0
0
0
0
1.789855
false
false
2
cfe3025069d84e7f6b8ebd5973c3caa255cd7cc5
25,374,666,797,950
9fa0841bc42c765b50a51fca573c5b497d1a87b9
/src/projeto/lista/ListaProjeto.java
95343aaa152723a19ec9f95a8d12dad14167aeaa
[]
no_license
fernandogatto/sisBicicletas
https://github.com/fernandogatto/sisBicicletas
dcc4ec0e181a0ffe78f7c24a9f4b4e4e3d1fe89e
c4623ba9cb40c54178246fdf93c57ea5b31e517e
refs/heads/master
2020-09-12T04:33:02.956000
2019-12-13T23:36:25
2019-12-13T23:36:25
222,307,555
3
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package projeto.lista; import java.util.ArrayList; import java.util.List; import pedido.encomenda.Encomenda; import projeto.Projeto; import projeto.modelo.Modelo; import rh.pessoa.Engenheiro; public class ListaProjeto { private List<Modelo> modelosProntos = new ArrayList<>(); private Projeto projeto; public ListaProjeto() {} public List<Modelo> getModelosProntos() { return modelosProntos; } public void setModelosProntos(List<Modelo> modelosProntos) { this.modelosProntos = modelosProntos; } public void adicionarModeloListaProjeto(Modelo modelo) { modelosProntos.add(modelo); } public void listarModelosProntos() { System.out.println("### MODELOS PRONTOS: ###"); for(int i = 0; i < modelosProntos.size(); i++) { System.out.println(modelosProntos.get(i).toString()); } } public void verificarListaProjeto(List<Encomenda> encomendas, List<Engenheiro> engenheiros) { for(int i = 0; i < encomendas.size(); i++) { boolean encomendaExiste = false; Encomenda encomenda = encomendas.get(i); for(int j = 0; j < modelosProntos.size(); j++) { String strModelo = modelosProntos.get(j).toString(); if(encomenda.toString().compareTo(strModelo) == 0) { encomendaExiste = true; j = modelosProntos.size() + 1; } } System.out.println("### ENCOMENDA No " + i + ": ###"); if(encomendaExiste) { System.out.println("Modelo pronto na Lista de Projetos -> produzirEncomenda() em Producao"); } else { System.out.println("Modelo nao existente na Lista de Projetos -> verificarEngenheirosDisponiveis() em Projeto"); projeto = new Projeto(); boolean engenheiroDisponivel = projeto.verificarEngenheirosDisponiveis(engenheiros); if(engenheiroDisponivel) { System.out.println("### ENGENHEIROS DISPONIVEIS: ###"); for(int j = 0; j < engenheiros.size(); j++) { System.out.println(engenheiros.get(j).getNome()); } System.out.println("Engenheiros disponiveis -> desenvolverProjeto() em Projeto"); projeto.desenvolverProjeto(encomenda, modelosProntos); } else { System.out.println("Nenhum engenheiro disponivel. Necessario contratar."); } } } } }
UTF-8
Java
2,204
java
ListaProjeto.java
Java
[]
null
[]
package projeto.lista; import java.util.ArrayList; import java.util.List; import pedido.encomenda.Encomenda; import projeto.Projeto; import projeto.modelo.Modelo; import rh.pessoa.Engenheiro; public class ListaProjeto { private List<Modelo> modelosProntos = new ArrayList<>(); private Projeto projeto; public ListaProjeto() {} public List<Modelo> getModelosProntos() { return modelosProntos; } public void setModelosProntos(List<Modelo> modelosProntos) { this.modelosProntos = modelosProntos; } public void adicionarModeloListaProjeto(Modelo modelo) { modelosProntos.add(modelo); } public void listarModelosProntos() { System.out.println("### MODELOS PRONTOS: ###"); for(int i = 0; i < modelosProntos.size(); i++) { System.out.println(modelosProntos.get(i).toString()); } } public void verificarListaProjeto(List<Encomenda> encomendas, List<Engenheiro> engenheiros) { for(int i = 0; i < encomendas.size(); i++) { boolean encomendaExiste = false; Encomenda encomenda = encomendas.get(i); for(int j = 0; j < modelosProntos.size(); j++) { String strModelo = modelosProntos.get(j).toString(); if(encomenda.toString().compareTo(strModelo) == 0) { encomendaExiste = true; j = modelosProntos.size() + 1; } } System.out.println("### ENCOMENDA No " + i + ": ###"); if(encomendaExiste) { System.out.println("Modelo pronto na Lista de Projetos -> produzirEncomenda() em Producao"); } else { System.out.println("Modelo nao existente na Lista de Projetos -> verificarEngenheirosDisponiveis() em Projeto"); projeto = new Projeto(); boolean engenheiroDisponivel = projeto.verificarEngenheirosDisponiveis(engenheiros); if(engenheiroDisponivel) { System.out.println("### ENGENHEIROS DISPONIVEIS: ###"); for(int j = 0; j < engenheiros.size(); j++) { System.out.println(engenheiros.get(j).getNome()); } System.out.println("Engenheiros disponiveis -> desenvolverProjeto() em Projeto"); projeto.desenvolverProjeto(encomenda, modelosProntos); } else { System.out.println("Nenhum engenheiro disponivel. Necessario contratar."); } } } } }
2,204
0.68784
0.685118
76
28.013159
27.958378
116
false
false
0
0
0
0
0
0
2.776316
false
false
2
9364b1766b5844628122bc3250280c43b4c893c2
5,557,687,697,954
5741045375dcbbafcf7288d65a11c44de2e56484
/reddit-decompilada/com/twitter/sdk/android/tweetui/GalleryScribeClient.java
4b4229c903e4e955e078dd758007817c844366c1
[]
no_license
miarevalo10/ReporteReddit
https://github.com/miarevalo10/ReporteReddit
18dd19bcec46c42ff933bb330ba65280615c281c
a0db5538e85e9a081bf268cb1590f0eeb113ed77
refs/heads/master
2020-03-16T17:42:34.840000
2018-05-11T10:16:04
2018-05-11T10:16:04
132,843,706
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.twitter.sdk.android.tweetui; import com.twitter.sdk.android.core.internal.scribe.ScribeItem; public interface GalleryScribeClient { void mo5494a(); void mo5495a(ScribeItem scribeItem); void mo5496b(); void mo5497c(); }
UTF-8
Java
252
java
GalleryScribeClient.java
Java
[]
null
[]
package com.twitter.sdk.android.tweetui; import com.twitter.sdk.android.core.internal.scribe.ScribeItem; public interface GalleryScribeClient { void mo5494a(); void mo5495a(ScribeItem scribeItem); void mo5496b(); void mo5497c(); }
252
0.738095
0.674603
13
18.384615
20.197252
63
false
false
0
0
0
0
0
0
0.461538
false
false
2
0340bcd051333b21b3699448fcd1d1ba726275e6
27,281,632,278,511
51abfb8429c55b7ec4601e7ab5fc81dceb892094
/Bat.java
ed58a2bf9a11526b6d523bc2fc79042e9a0b5cab
[]
no_license
adeebahmed/OOP-Demo
https://github.com/adeebahmed/OOP-Demo
de84dc3f01ba13d46a5b416210abed39455a6331
965aace36f7e21990a9d59565b0dabd591094f1e
refs/heads/master
2020-12-25T14:08:33.300000
2016-05-09T16:44:40
2016-05-09T16:44:40
51,416,050
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Bat extends Creature implements Flyer { //constructor public Bat(String name) { super(name); } //methods public void eat(Thing t) { if(t == null) return; if (t.getClass().getSimpleName().equals("Thing")) System.out.println(this + " won't eat a " + t); else super.eat(t); } public void fly() { System.out.println(this + " is blindly flying."); } public void move() { fly(); } }
UTF-8
Java
503
java
Bat.java
Java
[]
null
[]
public class Bat extends Creature implements Flyer { //constructor public Bat(String name) { super(name); } //methods public void eat(Thing t) { if(t == null) return; if (t.getClass().getSimpleName().equals("Thing")) System.out.println(this + " won't eat a " + t); else super.eat(t); } public void fly() { System.out.println(this + " is blindly flying."); } public void move() { fly(); } }
503
0.524851
0.524851
28
16.928572
18.696693
67
false
false
0
0
0
0
0
0
1.178571
false
false
2
289700ada27efb544f0ec6a446a7f79b8888d835
27,281,632,279,231
5df5c0b041c97fb9659d02eebffa751560b066c1
/src/z/hol/utils/android/PhoneState.java
37eab3830088a26d068c20304cd46e3ee59a60ea
[]
no_license
holmeszyx/ZUtils
https://github.com/holmeszyx/ZUtils
daed0768190784a34aa01f04a95acdcfc65aa095
71d7d49bd78ad5b5b4f38d0739b2a3a48157eca1
refs/heads/master
2021-01-10T20:11:34.072000
2015-12-02T11:02:59
2015-12-02T11:02:59
4,255,858
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package z.hol.utils.android; import android.content.Context; import android.telephony.TelephonyManager; public class PhoneState { public static final int PHONE_TYPE_SIP = 3; public static final int NETWORK_TYPE_IDEN = 11; public static final int NETWORK_TYPE_LTE = 13; public static final int NETWORK_TYPE_EVDO_B = 12; public static final int NETWORK_TYPE_EHRPD = 14; public static final int NETWORK_TYPE_HSPAP = 15; private TelephonyManager mTelephonyManager; private static PhoneState mPhoneState; private PhoneState(Context context) { super(); // TODO Auto-generated constructor stub this.mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); } public static PhoneState get(Context context){ if (mPhoneState == null){ mPhoneState = new PhoneState(context); } return mPhoneState; } /** * 获取imei * @return */ public String getPhoneId(){ return mTelephonyManager.getDeviceId(); } public String getPhoneIMSI(){ return mTelephonyManager.getSubscriberId(); } public int getPhoneType(){ return mTelephonyManager.getPhoneType(); } // 防止一些病毒误报 // public static String phoneType2String(int type){ // String typeStr = null; // switch(type){ // case TelephonyManager.PHONE_TYPE_CDMA: // typeStr = "cdma"; // break; // case TelephonyManager.PHONE_TYPE_GSM: // typeStr = "gsm"; // break; // case TelephonyManager.PHONE_TYPE_NONE: // typeStr = "none"; // break; // case PHONE_TYPE_SIP: // typeStr = "sip"; // break; // default: // typeStr = "unknown"; // break; // } // return typeStr; // } /** * 获取网络类型 * @return */ public int getMobileNetType(){ return mTelephonyManager.getNetworkType(); } // 防止一些病毒误报 // public static String mobileNetType2String(int type){ // String str = null; // switch (type){ // case TelephonyManager.NETWORK_TYPE_1xRTT: // str = "1xrtt"; // break; // case TelephonyManager.NETWORK_TYPE_CDMA: // str = "cdma"; // break; // case TelephonyManager.NETWORK_TYPE_EDGE: // str = "edge"; // break; // case TelephonyManager.NETWORK_TYPE_EVDO_0: // str = "evdo_0"; // break; // case TelephonyManager.NETWORK_TYPE_EVDO_A: // str = "evd0_a"; // break; // case TelephonyManager.NETWORK_TYPE_GPRS: // str = "gprs"; // break; // case TelephonyManager.NETWORK_TYPE_HSDPA: // str = "hsdpa"; // break; // case TelephonyManager.NETWORK_TYPE_HSPA: // str = "hspa"; // break; // case TelephonyManager.NETWORK_TYPE_HSUPA: // str = "hsupa"; // break; // case TelephonyManager.NETWORK_TYPE_UMTS: // str = "umts"; // break; // case TelephonyManager.NETWORK_TYPE_UNKNOWN: // str = "unknown"; // break; // case NETWORK_TYPE_EHRPD: // str = "ehrpd"; // break; // case NETWORK_TYPE_EVDO_B: // str = "evdo_b"; // break; // case NETWORK_TYPE_HSPAP: // str = "hspap"; // break; // case NETWORK_TYPE_IDEN: // str = "iden"; // break; // case NETWORK_TYPE_LTE: // str = "lte"; // break; // default: // str = "unknown"; // break; // } // return str; // } public String getNetworkOpertor(){ return mTelephonyManager.getNetworkOperatorName(); } }
UTF-8
Java
3,355
java
PhoneState.java
Java
[]
null
[]
package z.hol.utils.android; import android.content.Context; import android.telephony.TelephonyManager; public class PhoneState { public static final int PHONE_TYPE_SIP = 3; public static final int NETWORK_TYPE_IDEN = 11; public static final int NETWORK_TYPE_LTE = 13; public static final int NETWORK_TYPE_EVDO_B = 12; public static final int NETWORK_TYPE_EHRPD = 14; public static final int NETWORK_TYPE_HSPAP = 15; private TelephonyManager mTelephonyManager; private static PhoneState mPhoneState; private PhoneState(Context context) { super(); // TODO Auto-generated constructor stub this.mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); } public static PhoneState get(Context context){ if (mPhoneState == null){ mPhoneState = new PhoneState(context); } return mPhoneState; } /** * 获取imei * @return */ public String getPhoneId(){ return mTelephonyManager.getDeviceId(); } public String getPhoneIMSI(){ return mTelephonyManager.getSubscriberId(); } public int getPhoneType(){ return mTelephonyManager.getPhoneType(); } // 防止一些病毒误报 // public static String phoneType2String(int type){ // String typeStr = null; // switch(type){ // case TelephonyManager.PHONE_TYPE_CDMA: // typeStr = "cdma"; // break; // case TelephonyManager.PHONE_TYPE_GSM: // typeStr = "gsm"; // break; // case TelephonyManager.PHONE_TYPE_NONE: // typeStr = "none"; // break; // case PHONE_TYPE_SIP: // typeStr = "sip"; // break; // default: // typeStr = "unknown"; // break; // } // return typeStr; // } /** * 获取网络类型 * @return */ public int getMobileNetType(){ return mTelephonyManager.getNetworkType(); } // 防止一些病毒误报 // public static String mobileNetType2String(int type){ // String str = null; // switch (type){ // case TelephonyManager.NETWORK_TYPE_1xRTT: // str = "1xrtt"; // break; // case TelephonyManager.NETWORK_TYPE_CDMA: // str = "cdma"; // break; // case TelephonyManager.NETWORK_TYPE_EDGE: // str = "edge"; // break; // case TelephonyManager.NETWORK_TYPE_EVDO_0: // str = "evdo_0"; // break; // case TelephonyManager.NETWORK_TYPE_EVDO_A: // str = "evd0_a"; // break; // case TelephonyManager.NETWORK_TYPE_GPRS: // str = "gprs"; // break; // case TelephonyManager.NETWORK_TYPE_HSDPA: // str = "hsdpa"; // break; // case TelephonyManager.NETWORK_TYPE_HSPA: // str = "hspa"; // break; // case TelephonyManager.NETWORK_TYPE_HSUPA: // str = "hsupa"; // break; // case TelephonyManager.NETWORK_TYPE_UMTS: // str = "umts"; // break; // case TelephonyManager.NETWORK_TYPE_UNKNOWN: // str = "unknown"; // break; // case NETWORK_TYPE_EHRPD: // str = "ehrpd"; // break; // case NETWORK_TYPE_EVDO_B: // str = "evdo_b"; // break; // case NETWORK_TYPE_HSPAP: // str = "hspap"; // break; // case NETWORK_TYPE_IDEN: // str = "iden"; // break; // case NETWORK_TYPE_LTE: // str = "lte"; // break; // default: // str = "unknown"; // break; // } // return str; // } public String getNetworkOpertor(){ return mTelephonyManager.getNetworkOperatorName(); } }
3,355
0.629574
0.624131
142
21.316902
17.137131
98
false
false
0
0
0
0
0
0
2.338028
false
false
2
bd0490cf2424e1a0b8f2d8f5bc366f98633e6559
8,675,833,956,039
bcbc450e0bb8e3fff45df58b196263113d9eda9b
/src/week03/P_Question_NewAccount.java
376bc03105f8bca21b1bf35b0445f08ffa6a92d3
[]
no_license
Ecelik-git/practicejava
https://github.com/Ecelik-git/practicejava
a428bfb0da55433aef38ee0d4d9b4c8fcaa3bd17
123eacaccecb288f4739c2bfa602fe8e791b0da6
refs/heads/master
2023-05-09T11:22:49.215000
2021-06-03T04:42:43
2021-06-03T04:42:43
373,382,857
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package week03; import java.util.Scanner; public class P_Question_NewAccount { /* * Type the program which asks the user to enter 10 * character code to be able to create a new account. * This code should start with a capital letter. If the codes is valid, * it prints "You can create a new account" Otherwise, it prints "Please enter a valid code" */ public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Please enter 10 characters: "); String name = scan.next(); String result = name.length() ==10 && (name.charAt(0)>='A' && name.charAt(0)<='Z')? "You can create a new account":"Please enter a valid code"; System.out.println(result); String str = "Java"; System.out.println(str.replace("a", "")); scan.close(); } }
UTF-8
Java
836
java
P_Question_NewAccount.java
Java
[]
null
[]
package week03; import java.util.Scanner; public class P_Question_NewAccount { /* * Type the program which asks the user to enter 10 * character code to be able to create a new account. * This code should start with a capital letter. If the codes is valid, * it prints "You can create a new account" Otherwise, it prints "Please enter a valid code" */ public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Please enter 10 characters: "); String name = scan.next(); String result = name.length() ==10 && (name.charAt(0)>='A' && name.charAt(0)<='Z')? "You can create a new account":"Please enter a valid code"; System.out.println(result); String str = "Java"; System.out.println(str.replace("a", "")); scan.close(); } }
836
0.651914
0.639952
26
31.153847
24.580624
85
false
false
0
0
0
0
0
0
1.384615
false
false
2
0bd9fd3d42b1101649c67cd144c7532e87199043
23,527,830,861,984
b647302609c1528791b3870eb4413dae21784cfc
/AutoDroid/src/edu/gmu/isa/automater/RecordService.java
4d650286ac2663b8fcfd0ceba07e68e29e49cfa8
[]
no_license
oatsuper/automater-isa673
https://github.com/oatsuper/automater-isa673
59b9c05872086ab4e4ce9320c6fbd49c250bc152
dab7335da949fad7a8c70e3368eb9acb3c0066f9
refs/heads/master
2021-01-10T05:52:22.367000
2010-05-20T19:01:31
2010-05-20T19:01:31
47,923,453
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.gmu.isa.automater; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.IBinder; import android.util.Log; public class RecordService extends Service { private String TAG = "RecordService"; private AutoDroidDbAdapter mDbHelper; private Long runId = null; private java.lang.Process p; private Runtime r; private Thread t1; private boolean running = true; private boolean stopCalled = false; private long stopTime = 0; private BroadcastReceiver buttonReceiver; @Override public void onDestroy() { super.onDestroy(); if (!stopCalled) { stopProcess(); } stopService(); } private void startService() { Log.i(TAG, "startService"); mDbHelper = new AutoDroidDbAdapter(this); mDbHelper.open(); _registerReceiver(); captureProcess(); } private void _registerReceiver() { Log.i(TAG, "_registerReceiver"); IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_OFF); buttonReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { stopProcess(); } }; registerReceiver(buttonReceiver, filter); } private void stopService() { Log.i(TAG, "stopService"); unregisterReceiver(buttonReceiver); } @Override public IBinder onBind(Intent arg0) { return null; } @Override public int onStartCommand(Intent intent, int flags, int startId) { runId = intent.getLongExtra(AutoDroidDbAdapter.KEY_RUNID, 0); startService(); return super.onStartCommand(intent, flags, startId); } private void captureProcess() { Log.i(TAG, "captureProcess"); t1 = new Thread() { @Override public void run() { try { r = Runtime.getRuntime(); p = r.exec("su"); DataOutputStream out = new DataOutputStream(p.getOutputStream()); out.writeBytes("getevent -tq;\n"); out.flush(); Log.i(TAG, "Input Stream Started"); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()),16); String inputText = null; long currTime = -1; int time = -1; int time2 = -1; String[] times = null; String timeStr = null; String timeStr2 = null; String type = null; String code = null; String value = null; String device = null; String[] split = null; while (running && (inputText = in.readLine()) != null) { try { split = inputText.split(" "); times = split[0].split("-"); timeStr = times[0]; timeStr2 = times[1].split(":")[0]; time = Integer.parseInt(timeStr); time2 = Integer.parseInt(timeStr2); currTime = (time * 1000) + (time2 / 1000); device = split[1].split(":")[0]; type = split[2]; code = split[3]; value = split[4]; if (device.equals(Constants.DEVICE_KEYS)) { if (stopTime == 0 && Integer.parseInt(type,16) == 1 && Integer.parseInt(code,16) == 116 && Integer.parseInt(value,16) == 1) { stopTime = currTime; Log.i(TAG, "STOPTIME: " + stopTime); } } else if (device.equals(Constants.DEVICE_TOUCHPAD)) { mDbHelper.addTouch(runId, Integer.parseInt(code,16), Integer.parseInt(type, 16), Integer.parseInt(value, 16), currTime); } } catch (Exception e) { Log.e(TAG, "INPUTTEXT: " + inputText); e.printStackTrace(); } } if (stopTime > 0) { mDbHelper.endRun(runId); Log.i(TAG, "Rows Deleted: " + mDbHelper.deleteAfter(runId, stopTime)); } else { mDbHelper.errorRun(runId); } Log.i(TAG, "Input Stream Ended"); mDbHelper.close(); in.close(); out.close(); this.join(); } catch (Exception e) { e.printStackTrace(); } } }; t1.start(); } private void fillBuffer() throws Exception{ Log.i(TAG, "fillBuffer"); Thread t = new Thread() { @Override public void run() { try { Process process = Runtime.getRuntime().exec("su"); DataOutputStream out = new DataOutputStream(process.getOutputStream()); for (int i = 0; i < 1024; i++) { out.writeBytes("sendevent " + Constants.DEVICE_TOUCHPAD + " 0 2 0;\n"); out.flush(); out.writeBytes("sendevent " + Constants.DEVICE_TOUCHPAD + " 0 0 0;\n"); out.flush(); } out.close(); process.waitFor(); process.destroy(); Thread.sleep(1000); running = false; this.join(); } catch (Exception e) { e.printStackTrace(); } } }; t.start(); } private void stopProcess() { Log.i(TAG, "stopProcess"); stopCalled = true; try { fillBuffer(); if (p != null) { p.destroy(); } } catch (Exception e) { e.printStackTrace(); } } }
UTF-8
Java
5,198
java
RecordService.java
Java
[]
null
[]
package edu.gmu.isa.automater; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.IBinder; import android.util.Log; public class RecordService extends Service { private String TAG = "RecordService"; private AutoDroidDbAdapter mDbHelper; private Long runId = null; private java.lang.Process p; private Runtime r; private Thread t1; private boolean running = true; private boolean stopCalled = false; private long stopTime = 0; private BroadcastReceiver buttonReceiver; @Override public void onDestroy() { super.onDestroy(); if (!stopCalled) { stopProcess(); } stopService(); } private void startService() { Log.i(TAG, "startService"); mDbHelper = new AutoDroidDbAdapter(this); mDbHelper.open(); _registerReceiver(); captureProcess(); } private void _registerReceiver() { Log.i(TAG, "_registerReceiver"); IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_OFF); buttonReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { stopProcess(); } }; registerReceiver(buttonReceiver, filter); } private void stopService() { Log.i(TAG, "stopService"); unregisterReceiver(buttonReceiver); } @Override public IBinder onBind(Intent arg0) { return null; } @Override public int onStartCommand(Intent intent, int flags, int startId) { runId = intent.getLongExtra(AutoDroidDbAdapter.KEY_RUNID, 0); startService(); return super.onStartCommand(intent, flags, startId); } private void captureProcess() { Log.i(TAG, "captureProcess"); t1 = new Thread() { @Override public void run() { try { r = Runtime.getRuntime(); p = r.exec("su"); DataOutputStream out = new DataOutputStream(p.getOutputStream()); out.writeBytes("getevent -tq;\n"); out.flush(); Log.i(TAG, "Input Stream Started"); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()),16); String inputText = null; long currTime = -1; int time = -1; int time2 = -1; String[] times = null; String timeStr = null; String timeStr2 = null; String type = null; String code = null; String value = null; String device = null; String[] split = null; while (running && (inputText = in.readLine()) != null) { try { split = inputText.split(" "); times = split[0].split("-"); timeStr = times[0]; timeStr2 = times[1].split(":")[0]; time = Integer.parseInt(timeStr); time2 = Integer.parseInt(timeStr2); currTime = (time * 1000) + (time2 / 1000); device = split[1].split(":")[0]; type = split[2]; code = split[3]; value = split[4]; if (device.equals(Constants.DEVICE_KEYS)) { if (stopTime == 0 && Integer.parseInt(type,16) == 1 && Integer.parseInt(code,16) == 116 && Integer.parseInt(value,16) == 1) { stopTime = currTime; Log.i(TAG, "STOPTIME: " + stopTime); } } else if (device.equals(Constants.DEVICE_TOUCHPAD)) { mDbHelper.addTouch(runId, Integer.parseInt(code,16), Integer.parseInt(type, 16), Integer.parseInt(value, 16), currTime); } } catch (Exception e) { Log.e(TAG, "INPUTTEXT: " + inputText); e.printStackTrace(); } } if (stopTime > 0) { mDbHelper.endRun(runId); Log.i(TAG, "Rows Deleted: " + mDbHelper.deleteAfter(runId, stopTime)); } else { mDbHelper.errorRun(runId); } Log.i(TAG, "Input Stream Ended"); mDbHelper.close(); in.close(); out.close(); this.join(); } catch (Exception e) { e.printStackTrace(); } } }; t1.start(); } private void fillBuffer() throws Exception{ Log.i(TAG, "fillBuffer"); Thread t = new Thread() { @Override public void run() { try { Process process = Runtime.getRuntime().exec("su"); DataOutputStream out = new DataOutputStream(process.getOutputStream()); for (int i = 0; i < 1024; i++) { out.writeBytes("sendevent " + Constants.DEVICE_TOUCHPAD + " 0 2 0;\n"); out.flush(); out.writeBytes("sendevent " + Constants.DEVICE_TOUCHPAD + " 0 0 0;\n"); out.flush(); } out.close(); process.waitFor(); process.destroy(); Thread.sleep(1000); running = false; this.join(); } catch (Exception e) { e.printStackTrace(); } } }; t.start(); } private void stopProcess() { Log.i(TAG, "stopProcess"); stopCalled = true; try { fillBuffer(); if (p != null) { p.destroy(); } } catch (Exception e) { e.printStackTrace(); } } }
5,198
0.595614
0.582532
203
23.605911
18.288933
90
false
false
0
0
0
0
0
0
3.995074
false
false
2
98d5401ba6c57419a515a15f48fdd4e414c1dc48
6,296,422,077,740
aff603493cde8ed4590f2bc827b8906a1c76d558
/src/it/polito/tdp/emergency/model/Paziente.java
ecd8b6a7ea49cd0243b38913905e070d8c5d1fef
[]
no_license
GiuliaVerra97/Emergency
https://github.com/GiuliaVerra97/Emergency
69b6c15afde4978f7cad3281cb7b1ca22ba8dba9
6020a354da2b9c8a317c2a87b1bfbd664db75e56
refs/heads/master
2020-05-28T00:09:55.806000
2019-06-03T16:21:55
2019-06-03T16:21:55
188,828,288
0
0
null
true
2019-05-27T11:11:56
2019-05-27T11:11:56
2019-05-27T05:32:43
2019-05-27T05:32:42
3
0
0
0
null
false
false
package it.polito.tdp.emergency.model; import java.time.LocalTime; public class Paziente { //a ogni paziente viene assegnato un colore a seconda dell'urgenza di quel paziente, oppure si pu trattare //di un paziente nuovo o in trattamento o che viene dimesso public enum StatoPaziente{ NEW, WAITING_WHITE, WAITING_YELLOW, WAITING_RED, TREATING, //in trattamento OUT, //dimesso BLACK, } private int id; private StatoPaziente stato; private LocalTime oraArrivo; //quando due pazienti hanno la stessa priority passa prima quello che è arrivato prima public Paziente(int id, LocalTime oraArrivo) { this.id=id; this.oraArrivo=oraArrivo; this.stato=StatoPaziente.NEW; //arriva il paziente } public int getId() { return id; } public void setId(int id) { this.id = id; } public StatoPaziente getStato() { return stato; } public void setStato(StatoPaziente stato) { this.stato = stato; } public LocalTime getOraArrivo() { return oraArrivo; } public void setOraArrivo(LocalTime oraArrivo) { this.oraArrivo = oraArrivo; } @Override public String toString() { return String.format("[id=%s]", id); } }
WINDOWS-1252
Java
1,284
java
Paziente.java
Java
[]
null
[]
package it.polito.tdp.emergency.model; import java.time.LocalTime; public class Paziente { //a ogni paziente viene assegnato un colore a seconda dell'urgenza di quel paziente, oppure si pu trattare //di un paziente nuovo o in trattamento o che viene dimesso public enum StatoPaziente{ NEW, WAITING_WHITE, WAITING_YELLOW, WAITING_RED, TREATING, //in trattamento OUT, //dimesso BLACK, } private int id; private StatoPaziente stato; private LocalTime oraArrivo; //quando due pazienti hanno la stessa priority passa prima quello che è arrivato prima public Paziente(int id, LocalTime oraArrivo) { this.id=id; this.oraArrivo=oraArrivo; this.stato=StatoPaziente.NEW; //arriva il paziente } public int getId() { return id; } public void setId(int id) { this.id = id; } public StatoPaziente getStato() { return stato; } public void setStato(StatoPaziente stato) { this.stato = stato; } public LocalTime getOraArrivo() { return oraArrivo; } public void setOraArrivo(LocalTime oraArrivo) { this.oraArrivo = oraArrivo; } @Override public String toString() { return String.format("[id=%s]", id); } }
1,284
0.653157
0.653157
82
13.646341
21.573116
117
false
false
0
0
0
0
0
0
1.268293
false
false
2
dff43d0d8f46fb252f0dfcf908d4e8a1e81987aa
11,355,893,549,062
57cb302d5695502b3c06cf5cfb7ba9150864d160
/src/adapter/DragAdapter.java
e790e667bab257a1b862e23a6c88ae0f2b3c2677
[]
no_license
gyerob/TrakiApp
https://github.com/gyerob/TrakiApp
c1dee61122ba15f5ca754027653ea5b783fbf702
b1bc39b9b6040bb86e9013cac737ad2b78d9dbae
refs/heads/master
2020-05-20T07:47:21.809000
2014-02-19T12:05:37
2014-02-19T12:05:37
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package adapter; import hu.gyerob.trakiapp.R; import android.content.Context; import android.database.Cursor; import android.graphics.Color; import android.support.v4.widget.CursorAdapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import data.Drag; import datastorage.DbLoader; public class DragAdapter extends CursorAdapter { public DragAdapter(Context context, Cursor c) { super(context, c, false); } @Override public Drag getItem(int position) { getCursor().moveToPosition(position); return DbLoader.getDragByCursor(getCursor()); } @Override public void bindView(View view, Context context, Cursor cursor) { TextView name = (TextView) view.findViewById(R.id.row_dragName); TextView number = (TextView) view.findViewById(R.id.row_dragNumber); TextView ido1 = (TextView) view.findViewById(R.id.row_dragIdo1); TextView ido2 = (TextView) view.findViewById(R.id.row_dragIdo2); TextView lido = (TextView) view.findViewById(R.id.row_dragLido); name.setTextColor(Color.BLACK); number.setTextColor(Color.BLACK); ido1.setTextColor(Color.BLACK); ido2.setTextColor(Color.BLACK); lido.setTextColor(Color.BLACK); Drag drag = DbLoader.getDragByCursor(cursor); name.setText(drag.getName()); number.setText(Integer.toString(drag.getNumber())); ido1.setText(drag.getIdo1()); ido2.setText(drag.getIdo2()); lido.setText(drag.getLegjobbido()); } @Override public View newView(Context context, Cursor cursor, ViewGroup viewGroup) { final LayoutInflater inflater = LayoutInflater.from(context); View row = inflater.inflate(R.layout.row_drag, null); bindView(row, context, cursor); return row; } }
UTF-8
Java
1,727
java
DragAdapter.java
Java
[]
null
[]
package adapter; import hu.gyerob.trakiapp.R; import android.content.Context; import android.database.Cursor; import android.graphics.Color; import android.support.v4.widget.CursorAdapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import data.Drag; import datastorage.DbLoader; public class DragAdapter extends CursorAdapter { public DragAdapter(Context context, Cursor c) { super(context, c, false); } @Override public Drag getItem(int position) { getCursor().moveToPosition(position); return DbLoader.getDragByCursor(getCursor()); } @Override public void bindView(View view, Context context, Cursor cursor) { TextView name = (TextView) view.findViewById(R.id.row_dragName); TextView number = (TextView) view.findViewById(R.id.row_dragNumber); TextView ido1 = (TextView) view.findViewById(R.id.row_dragIdo1); TextView ido2 = (TextView) view.findViewById(R.id.row_dragIdo2); TextView lido = (TextView) view.findViewById(R.id.row_dragLido); name.setTextColor(Color.BLACK); number.setTextColor(Color.BLACK); ido1.setTextColor(Color.BLACK); ido2.setTextColor(Color.BLACK); lido.setTextColor(Color.BLACK); Drag drag = DbLoader.getDragByCursor(cursor); name.setText(drag.getName()); number.setText(Integer.toString(drag.getNumber())); ido1.setText(drag.getIdo1()); ido2.setText(drag.getIdo2()); lido.setText(drag.getLegjobbido()); } @Override public View newView(Context context, Cursor cursor, ViewGroup viewGroup) { final LayoutInflater inflater = LayoutInflater.from(context); View row = inflater.inflate(R.layout.row_drag, null); bindView(row, context, cursor); return row; } }
1,727
0.762594
0.756225
56
29.839285
21.992512
75
false
false
0
0
0
0
0
0
1.857143
false
false
2
25e75a1ee045be2cc1d1435476e147e22ba3eb2b
18,081,812,331,053
89500ef7fabc3c3298065edade13f1b20bc138a3
/src/main/java/amethyst/mapper/UserMapper.java
e4cef2f350adbc4ff4c7af18cd5cda7f36b562e2
[]
no_license
NoahAmethyst/content_management_system_demo
https://github.com/NoahAmethyst/content_management_system_demo
7c50e10f632eb39cb55ee29762e76636acd81424
a0637804e995a1cbce50228a4c57357e4d502636
refs/heads/master
2022-06-27T04:01:38.148000
2019-09-26T06:34:12
2019-09-26T06:34:12
211,013,207
0
0
null
false
2022-06-21T01:56:48
2019-09-26T06:12:10
2019-09-26T06:37:39
2022-06-21T01:56:43
11,371
0
0
7
JavaScript
false
false
package amethyst.mapper; import amethyst.dto.sys.UserDto; import amethyst.po.sys.User; import java.util.List; public interface UserMapper { //查询 List<UserDto> selectUserDtoList(UserDto userDto); List<User> selectUserList(User user); User selectUserById(Long userId); User selectUserDtoById(Long userId); //修改 void updateUser(User user); //插入 int insertUser(UserDto userDto); //删除 void deleteUserByIds(String[] ids); User selectUserByName(String loginName); User selectUserByPhone(String phone); User selectUserByEmail(String email); }
UTF-8
Java
623
java
UserMapper.java
Java
[]
null
[]
package amethyst.mapper; import amethyst.dto.sys.UserDto; import amethyst.po.sys.User; import java.util.List; public interface UserMapper { //查询 List<UserDto> selectUserDtoList(UserDto userDto); List<User> selectUserList(User user); User selectUserById(Long userId); User selectUserDtoById(Long userId); //修改 void updateUser(User user); //插入 int insertUser(UserDto userDto); //删除 void deleteUserByIds(String[] ids); User selectUserByName(String loginName); User selectUserByPhone(String phone); User selectUserByEmail(String email); }
623
0.706755
0.706755
36
15.861111
17.829678
53
false
false
0
0
0
0
0
0
0.388889
false
false
2
0dc9809f53be56b67882c9556b3530be943a6549
14,937,896,274,575
c414b1b4c9437f1d210e3b5481043a497f748b55
/admin-service/src/main/java/com/medisec/adminservice/web/certificate/CertificateController.java
29eddff28bc1355536f6df9614a6e90ccbcea6ab
[]
no_license
matijapetrovic/medisec
https://github.com/matijapetrovic/medisec
003d3e16019a24ee8f2e458298359b18140941e4
813488a1c844f6e539bd095991228da26662b1bd
refs/heads/main
2023-05-22T21:36:02.231000
2021-06-15T21:59:12
2021-06-15T21:59:12
353,453,017
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.medisec.adminservice.web.certificate; import com.medisec.adminservice.domain.certificate.CertificateResponse; import com.medisec.adminservice.domain.certificate.RevocationReason; import com.medisec.adminservice.exception.AliasNotValidException; import com.medisec.adminservice.exception.CSRNotVerifiedException; import com.medisec.adminservice.exception.MissingPrivateKeyException; import com.medisec.adminservice.domain.certificate.CertificateService; import lombok.RequiredArgsConstructor; import org.bouncycastle.operator.OperatorCreationException; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.mail.MessagingException; import javax.validation.Valid; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.security.*; import java.security.cert.CRLException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @RequiredArgsConstructor @RestController @RequestMapping(value="/api/certificates", produces = MediaType.APPLICATION_JSON_VALUE) public class CertificateController { private final CertificateService certificateService; @PostMapping("") public ResponseEntity<Void> issueCertificate(@Valid @RequestBody IssueCertificateRequest request) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, OperatorCreationException, KeyStoreException, MissingPrivateKeyException, IOException, InvalidKeyException, CSRNotVerifiedException, NoSuchProviderException, MessagingException { certificateService.issueCertificate(request); return ResponseEntity.status(HttpStatus.CREATED).build(); } @PostMapping("/{sn}/revoke") public ResponseEntity<Void> revokeCertificated(@RequestBody RevokeCertificateRequest request, @PathVariable String sn) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, KeyStoreException, OperatorCreationException { certificateService.revokeCertificate(sn, request.getReason(), request.getAlias()); return ResponseEntity.status(HttpStatus.OK).build(); } @PostMapping("/{sn}/pending-revoke") public ResponseEntity<Void> pendingRevocation(@RequestBody String alias, @PathVariable String sn) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, KeyStoreException, OperatorCreationException { // String request = new String(revokeRequest); // String[] params = request.split("="); //alias=myAlias certificateService.revokeCertificate(sn, 1, alias); return ResponseEntity.status(HttpStatus.OK).build(); } @PostMapping("/is-revoked") public ResponseEntity<Boolean> isRevoked(@RequestBody byte[] certificate) throws IOException, ClassNotFoundException, CertificateException, CRLException { return ResponseEntity.ok(certificateService.isRevoked(certificate)); } @GetMapping("") public ResponseEntity<List<CertificateResponse>> readAllCertificates() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, AliasNotValidException, IOException, CRLException { return ResponseEntity.ok(certificateService.readAllCertificates()); } @GetMapping("/issuer-aliases") public ResponseEntity<List<String>> getIssuerAliases() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { return ResponseEntity.ok(certificateService.getIssuerAliases()); } @GetMapping("revocation-reasons") public ResponseEntity<List<RevocationReasonDTO>> getRevocationReasons() { List<RevocationReasonDTO> reasons = Arrays.stream(RevocationReason.values()) .map(revocationReason -> new RevocationReasonDTO( revocationReason.getKey(), revocationReason.getDesc())) .collect(Collectors.toList()); return ResponseEntity.ok(reasons); } }
UTF-8
Java
4,286
java
CertificateController.java
Java
[]
null
[]
package com.medisec.adminservice.web.certificate; import com.medisec.adminservice.domain.certificate.CertificateResponse; import com.medisec.adminservice.domain.certificate.RevocationReason; import com.medisec.adminservice.exception.AliasNotValidException; import com.medisec.adminservice.exception.CSRNotVerifiedException; import com.medisec.adminservice.exception.MissingPrivateKeyException; import com.medisec.adminservice.domain.certificate.CertificateService; import lombok.RequiredArgsConstructor; import org.bouncycastle.operator.OperatorCreationException; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.mail.MessagingException; import javax.validation.Valid; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.security.*; import java.security.cert.CRLException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @RequiredArgsConstructor @RestController @RequestMapping(value="/api/certificates", produces = MediaType.APPLICATION_JSON_VALUE) public class CertificateController { private final CertificateService certificateService; @PostMapping("") public ResponseEntity<Void> issueCertificate(@Valid @RequestBody IssueCertificateRequest request) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, OperatorCreationException, KeyStoreException, MissingPrivateKeyException, IOException, InvalidKeyException, CSRNotVerifiedException, NoSuchProviderException, MessagingException { certificateService.issueCertificate(request); return ResponseEntity.status(HttpStatus.CREATED).build(); } @PostMapping("/{sn}/revoke") public ResponseEntity<Void> revokeCertificated(@RequestBody RevokeCertificateRequest request, @PathVariable String sn) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, KeyStoreException, OperatorCreationException { certificateService.revokeCertificate(sn, request.getReason(), request.getAlias()); return ResponseEntity.status(HttpStatus.OK).build(); } @PostMapping("/{sn}/pending-revoke") public ResponseEntity<Void> pendingRevocation(@RequestBody String alias, @PathVariable String sn) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, KeyStoreException, OperatorCreationException { // String request = new String(revokeRequest); // String[] params = request.split("="); //alias=myAlias certificateService.revokeCertificate(sn, 1, alias); return ResponseEntity.status(HttpStatus.OK).build(); } @PostMapping("/is-revoked") public ResponseEntity<Boolean> isRevoked(@RequestBody byte[] certificate) throws IOException, ClassNotFoundException, CertificateException, CRLException { return ResponseEntity.ok(certificateService.isRevoked(certificate)); } @GetMapping("") public ResponseEntity<List<CertificateResponse>> readAllCertificates() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, AliasNotValidException, IOException, CRLException { return ResponseEntity.ok(certificateService.readAllCertificates()); } @GetMapping("/issuer-aliases") public ResponseEntity<List<String>> getIssuerAliases() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { return ResponseEntity.ok(certificateService.getIssuerAliases()); } @GetMapping("revocation-reasons") public ResponseEntity<List<RevocationReasonDTO>> getRevocationReasons() { List<RevocationReasonDTO> reasons = Arrays.stream(RevocationReason.values()) .map(revocationReason -> new RevocationReasonDTO( revocationReason.getKey(), revocationReason.getDesc())) .collect(Collectors.toList()); return ResponseEntity.ok(reasons); } }
4,286
0.773682
0.773448
83
50.638554
59.018391
362
false
false
0
0
0
0
0
0
0.939759
false
false
2
3d70edbc45a1b1bfb9ee82910258e9f6a193b949
16,329,465,679,568
264ee29dbeeade9e93315626eb7a9a5c4ccf5f15
/src/com/codersbay/Main.java
4dfa90b02f0050969af0763dd704cb80b06d432f
[]
no_license
CODERS-BAY/java-06-2-leetspeak-translator-Schweinschwaller
https://github.com/CODERS-BAY/java-06-2-leetspeak-translator-Schweinschwaller
e42ea8a80d565ee36d8439829e3e594cb4c8ea77
f02d432cee070acd1e3e902f12fcc4b6306913c2
refs/heads/master
2022-12-09T04:48:44.820000
2020-09-07T09:32:36
2020-09-07T09:32:36
293,469,307
0
0
null
false
2020-09-07T08:35:55
2020-09-07T08:35:40
2020-09-07T08:35:53
2020-09-07T08:35:54
0
0
0
1
Java
false
false
package com.codersbay; import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Enter your text and end it with enter."); Scanner s = new Scanner(System.in); String inputStr = s.nextLine(); String leet = ""; for (int i = 0; i < inputStr.length(); i++) { leet += switch (inputStr.toUpperCase().charAt(i)) { case ('A') -> "@"; case ('B') -> "8"; case ('C') -> "("; case ('E') -> "3"; case ('G') -> "6"; case ('H') -> "#"; case ('I') -> "!"; case ('L') -> "1"; case ('O') -> "0"; case ('S') -> "$"; case ('T') -> "7"; case ('Z') -> "2"; default -> inputStr.charAt(i); }; } System.out.println("Your text in Leetspeak:"); System.out.println(leet); } }
UTF-8
Java
1,005
java
Main.java
Java
[]
null
[]
package com.codersbay; import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Enter your text and end it with enter."); Scanner s = new Scanner(System.in); String inputStr = s.nextLine(); String leet = ""; for (int i = 0; i < inputStr.length(); i++) { leet += switch (inputStr.toUpperCase().charAt(i)) { case ('A') -> "@"; case ('B') -> "8"; case ('C') -> "("; case ('E') -> "3"; case ('G') -> "6"; case ('H') -> "#"; case ('I') -> "!"; case ('L') -> "1"; case ('O') -> "0"; case ('S') -> "$"; case ('T') -> "7"; case ('Z') -> "2"; default -> inputStr.charAt(i); }; } System.out.println("Your text in Leetspeak:"); System.out.println(leet); } }
1,005
0.39204
0.38408
33
29.454546
17.927616
69
false
false
0
0
0
0
0
0
0.727273
false
false
2
92068def68514773ff5edcc9c52e0aa51bc50648
2,241,972,959,765
4d217ad387fa982969f4fe8c64a120d65a56ecc5
/src/ExecutionTree/CRangeETNode.java
be92afc1e5b9dc73e3e659bd981ecb51c8b90e43
[]
no_license
reidHoruff/Crater
https://github.com/reidHoruff/Crater
0d6bc059d192869d55449a21df7cbc9592fee95f
7a3f0f2cf7ceab773ac545b21ec557aa984a596a
refs/heads/master
2021-05-15T01:32:08.014000
2020-10-19T03:19:54
2020-10-19T03:19:54
25,171,610
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ExecutionTree; import CraterExecutionEnvironment.CraterVariableScope; import Exceptions.CraterExecutionException; import NativeDataTypes.CDT; import NativeDataTypes.CInteger; import NativeDataTypes.CRange; import NativeDataTypes.EndCDT; /** * Created by reidhoruff on 10/13/14. */ public class CRangeETNode extends ETNode { public ETNode head, tail, increment; private boolean include; public CRangeETNode(ETNode head, ETNode tail, boolean include, ETNode increment) { this.head = head.setParent(this); this.tail = tail.setParent(this); this.include = include; this.increment = increment.setParent(this); } public CRangeETNode(ETNode head, ETNode tail, boolean include) { this(head, tail, include, new IntegerLiteralETNode(1)); } @Override public CDT execute(CraterVariableScope scope) { CDT head = this.head.executeMetaSafe(scope); CDT tail = this.tail.executeMetaSafe(scope); CDT increment = this.increment.executeMetaSafe(scope); if (!isValidCRangeType(head) || !isValidCRangeType(tail) || !isValidCRangeType(increment)) { throw new CraterExecutionException("range can only contain integers and floats"); } return new CRange(head, tail, increment, this.include); } private boolean isValidCRangeType(CDT node) { return node.isNumber() || node instanceof EndCDT; } }
UTF-8
Java
1,439
java
CRangeETNode.java
Java
[ { "context": "\nimport NativeDataTypes.EndCDT;\n\n/**\n * Created by reidhoruff on 10/13/14.\n */\npublic class CRangeETNode extend", "end": 275, "score": 0.9996875524520874, "start": 265, "tag": "USERNAME", "value": "reidhoruff" } ]
null
[]
package ExecutionTree; import CraterExecutionEnvironment.CraterVariableScope; import Exceptions.CraterExecutionException; import NativeDataTypes.CDT; import NativeDataTypes.CInteger; import NativeDataTypes.CRange; import NativeDataTypes.EndCDT; /** * Created by reidhoruff on 10/13/14. */ public class CRangeETNode extends ETNode { public ETNode head, tail, increment; private boolean include; public CRangeETNode(ETNode head, ETNode tail, boolean include, ETNode increment) { this.head = head.setParent(this); this.tail = tail.setParent(this); this.include = include; this.increment = increment.setParent(this); } public CRangeETNode(ETNode head, ETNode tail, boolean include) { this(head, tail, include, new IntegerLiteralETNode(1)); } @Override public CDT execute(CraterVariableScope scope) { CDT head = this.head.executeMetaSafe(scope); CDT tail = this.tail.executeMetaSafe(scope); CDT increment = this.increment.executeMetaSafe(scope); if (!isValidCRangeType(head) || !isValidCRangeType(tail) || !isValidCRangeType(increment)) { throw new CraterExecutionException("range can only contain integers and floats"); } return new CRange(head, tail, increment, this.include); } private boolean isValidCRangeType(CDT node) { return node.isNumber() || node instanceof EndCDT; } }
1,439
0.706046
0.701181
45
30.977777
27.704384
100
false
false
0
0
0
0
0
0
0.866667
false
false
2
c6902d3557cdbd1e7feabfc0db0e8dda02b6835f
9,491,877,771,799
4c253915717548a87949a7069d5abfb71c7a47dd
/QuDue/src/dataModels/Module.java
9c23b07e16bdcf5f4f79635b870f073c545696ad
[]
no_license
michaelclarke77/qudue
https://github.com/michaelclarke77/qudue
a3a0b5a8f6f6cf838ad457dde14a96146f7cf026
11d5d69c12c497eb0b02463a9de7ae2ef733d2ad
refs/heads/master
2021-01-19T11:51:42.594000
2016-10-03T12:06:04
2016-10-03T12:06:04
67,214,821
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package dataModels; public class Module { private String id; private String title; private int lecturerId; public Module() { } public Module(String id, String title, int lecturerId) { this.id = id; this.title = title; this.lecturerId = lecturerId; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getLecturerId() { return lecturerId; } public void setLecturerId(int lecturerId) { this.lecturerId = lecturerId; } }
UTF-8
Java
615
java
Module.java
Java
[]
null
[]
package dataModels; public class Module { private String id; private String title; private int lecturerId; public Module() { } public Module(String id, String title, int lecturerId) { this.id = id; this.title = title; this.lecturerId = lecturerId; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getLecturerId() { return lecturerId; } public void setLecturerId(int lecturerId) { this.lecturerId = lecturerId; } }
615
0.678049
0.678049
45
12.666667
14.176663
57
false
false
0
0
0
0
0
0
1.155556
false
false
2
9221732f4fea0daad1913a4a1fde599406f9ed6b
4,612,794,906,958
2978fe2a80b32e1c5347cbc243892c796a1a2271
/src/main/java/baseballgame/BaseballGame.java
9dd7a080819da0aff5a34ddbd50c0eead0ec68d8
[]
no_license
Gomding/java-baseball
https://github.com/Gomding/java-baseball
48125873ed73e04deb5cde76b5695277bc07d421
94ca7cc3b14b3735100040c1accd53aee8b885f4
refs/heads/master
2022-12-28T13:34:23.322000
2020-10-18T17:45:14
2020-10-18T17:45:14
304,554,519
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * BaseballGame.java 2020/10/16 * */ package baseballgame; import java.io.BufferedReader; import java.io.InputStreamReader; /* * 전체적인 게임 시작 기능 * 1번을 입력하면 게임 시작 , 2번을 입력하면 게임 종료 * 그 외의 번호, 숫자가 아닌 문자를 입력하게 되면 다시 입력 요청 * 이 게임은 2번을 누르기 전까지 계속 반복됩니다. * * @version 1.0 2020/10/16 * @author https://github.com/Gomding */ public class BaseballGame { private final static String START = "1"; private final static String EXIT = "2"; Computer computer; User user = new User(); int count; /** * 게임을 시작을 알리는 메서드 * isPlayOrStop() 메서드가 true값이라면 게임을 종료합니다. * * @throws Exception */ public void startGame() throws Exception{ System.out.println("숫자 야구 게임을 시작하겠습니다."); while(true) { if (isPlayOrStop()) { System.out.println("게임을 종료합니다."); break; } resetGame(); playGame(); } } /** * 1 또는 2를 입력하여 게임 시작 또는 게임 종료 명령을 받는 메서드 * 1을 입력 받으면 야구 게임을 시작함 * 2를 입력 받으면 게임을 종료 * * @return 입력값이 2라면 true를 반환함 * @throws Exception */ public boolean isPlayOrStop() throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String command; while (true) { System.out.print("1. 게임 시작 / 2. 게임 종료 > "); command = br.readLine(); if (command.equals(START) || command.equals(EXIT)) { break; } System.out.println("[입력 오류] 1 또는 2를 입력해주세요."); } return command.equals(EXIT); } /** * computer 객체에 새로운 3자리 숫자로 초기화하고 count를 0으로 초기화 해서 * 새로운 게임을 준비하는 메서드 */ public void resetGame() { computer = new Computer(); count = 0; } /** * 게임 시작 후 사용자의 입력을 받아 게임을 진행하는 메서드 * * @throws Exception */ public void playGame() throws Exception{ while(true) { System.out.print("1이상 9이하의 숫자 3자리를 입력해주세요 > "); user.requestNumber(); count++; if (isCorrectAnswer()) { break; } checkNum(); } } /** * 정답인지 아닌지 판단하는 메서드 * * @return 사용자 입력값과 컴퓨터늬 숫자가 같다면 true를 반환 */ public boolean isCorrectAnswer() { if (user.getNumber().equals(computer.getNumber())) { System.out.println("정답!! 시도 횟수 : " + count + "회"); return true; } return false; } /** * 사용자가 입력한 숫자를 스트라이크, 볼 이 몇인지 검사후 출력해주는 메서드 * */ public void checkNum() { int strike = 0; int ball = 0; for (int i = 0; i < user.getNumber().length(); i++) { if (isStrike(i)) { strike++; } else if (isBall(i)) { ball++; } } printResult(strike, ball); } /** * 사용자의 입력 숫자중 i번째 숫자가 컴퓨터의 숫자 i번째가 순서와 숫자가 일치해서 * 스트라이크(Strike) 인지 확인하는 메서드 * * @param i 문자열의 몇번째인지를 나타내는 매개변수 (int 타입) * @return 스트라이크가 맞다면 true 반환 */ public boolean isStrike(int i) { return (user.getNumber().charAt(i) == computer.getNumber().charAt(i)); } /** * 사용자가 입력한 숫자 중 i번째 숫자가 컴퓨터의 숫자에 존재하는지 확인하여 * 볼(Ball)인지 확인하는 메서드 * * @param i 문자열의 몇번째인지를 나타내는 매개변수 (int 타입) * @return 볼이 맞다면 true 반환 */ public boolean isBall(int i) { return (computer.getNumber().contains(String.valueOf(user.getNumber().charAt(i)))); } /** * 사용자가 입력한 숫자를 컴퓨터의 숫자와 비교한 결과를 출력하는 메서드 * * @param strike 몇번의 strike가 있었는지 나타내는 매개변수 * @param ball 몇번의 ball이 있었는지 나타내는 매개변수 */ public void printResult(int strike, int ball) { StringBuilder result = new StringBuilder(); if (strike != 0) { result.append(strike); result.append(" 스트라이크 "); } if (ball != 0) { result.append(ball); result.append(" 볼"); } if (result.length() == 0) { result.append("낫싱(포볼)"); } System.out.println(result); } }
UTF-8
Java
5,266
java
BaseballGame.java
Java
[ { "context": "sion 1.0 2020/10/16\n * @author https://github.com/Gomding\n */\npublic class BaseballGame {\n\n private fina", "end": 326, "score": 0.9995701909065247, "start": 319, "tag": "USERNAME", "value": "Gomding" } ]
null
[]
/* * BaseballGame.java 2020/10/16 * */ package baseballgame; import java.io.BufferedReader; import java.io.InputStreamReader; /* * 전체적인 게임 시작 기능 * 1번을 입력하면 게임 시작 , 2번을 입력하면 게임 종료 * 그 외의 번호, 숫자가 아닌 문자를 입력하게 되면 다시 입력 요청 * 이 게임은 2번을 누르기 전까지 계속 반복됩니다. * * @version 1.0 2020/10/16 * @author https://github.com/Gomding */ public class BaseballGame { private final static String START = "1"; private final static String EXIT = "2"; Computer computer; User user = new User(); int count; /** * 게임을 시작을 알리는 메서드 * isPlayOrStop() 메서드가 true값이라면 게임을 종료합니다. * * @throws Exception */ public void startGame() throws Exception{ System.out.println("숫자 야구 게임을 시작하겠습니다."); while(true) { if (isPlayOrStop()) { System.out.println("게임을 종료합니다."); break; } resetGame(); playGame(); } } /** * 1 또는 2를 입력하여 게임 시작 또는 게임 종료 명령을 받는 메서드 * 1을 입력 받으면 야구 게임을 시작함 * 2를 입력 받으면 게임을 종료 * * @return 입력값이 2라면 true를 반환함 * @throws Exception */ public boolean isPlayOrStop() throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String command; while (true) { System.out.print("1. 게임 시작 / 2. 게임 종료 > "); command = br.readLine(); if (command.equals(START) || command.equals(EXIT)) { break; } System.out.println("[입력 오류] 1 또는 2를 입력해주세요."); } return command.equals(EXIT); } /** * computer 객체에 새로운 3자리 숫자로 초기화하고 count를 0으로 초기화 해서 * 새로운 게임을 준비하는 메서드 */ public void resetGame() { computer = new Computer(); count = 0; } /** * 게임 시작 후 사용자의 입력을 받아 게임을 진행하는 메서드 * * @throws Exception */ public void playGame() throws Exception{ while(true) { System.out.print("1이상 9이하의 숫자 3자리를 입력해주세요 > "); user.requestNumber(); count++; if (isCorrectAnswer()) { break; } checkNum(); } } /** * 정답인지 아닌지 판단하는 메서드 * * @return 사용자 입력값과 컴퓨터늬 숫자가 같다면 true를 반환 */ public boolean isCorrectAnswer() { if (user.getNumber().equals(computer.getNumber())) { System.out.println("정답!! 시도 횟수 : " + count + "회"); return true; } return false; } /** * 사용자가 입력한 숫자를 스트라이크, 볼 이 몇인지 검사후 출력해주는 메서드 * */ public void checkNum() { int strike = 0; int ball = 0; for (int i = 0; i < user.getNumber().length(); i++) { if (isStrike(i)) { strike++; } else if (isBall(i)) { ball++; } } printResult(strike, ball); } /** * 사용자의 입력 숫자중 i번째 숫자가 컴퓨터의 숫자 i번째가 순서와 숫자가 일치해서 * 스트라이크(Strike) 인지 확인하는 메서드 * * @param i 문자열의 몇번째인지를 나타내는 매개변수 (int 타입) * @return 스트라이크가 맞다면 true 반환 */ public boolean isStrike(int i) { return (user.getNumber().charAt(i) == computer.getNumber().charAt(i)); } /** * 사용자가 입력한 숫자 중 i번째 숫자가 컴퓨터의 숫자에 존재하는지 확인하여 * 볼(Ball)인지 확인하는 메서드 * * @param i 문자열의 몇번째인지를 나타내는 매개변수 (int 타입) * @return 볼이 맞다면 true 반환 */ public boolean isBall(int i) { return (computer.getNumber().contains(String.valueOf(user.getNumber().charAt(i)))); } /** * 사용자가 입력한 숫자를 컴퓨터의 숫자와 비교한 결과를 출력하는 메서드 * * @param strike 몇번의 strike가 있었는지 나타내는 매개변수 * @param ball 몇번의 ball이 있었는지 나타내는 매개변수 */ public void printResult(int strike, int ball) { StringBuilder result = new StringBuilder(); if (strike != 0) { result.append(strike); result.append(" 스트라이크 "); } if (ball != 0) { result.append(ball); result.append(" 볼"); } if (result.length() == 0) { result.append("낫싱(포볼)"); } System.out.println(result); } }
5,266
0.511887
0.501213
171
23.105263
18.943762
91
false
false
0
0
0
0
0
0
0.309942
false
false
2
946d9b29e44b9b63e4af5559836c2c28b943e1f3
15,272,903,730,948
dbd60bc555a39703ffc921da3c6a5d9f2ac601bf
/core/src/alexander/marashov/smo/components/generators/RequestSupplier.java
bcb7383c5cc98411eaa1995e00165d82988e97f4
[]
no_license
Marashov-Alexander/smo-2020
https://github.com/Marashov-Alexander/smo-2020
ac136d9b89187b9f1eb79de792f88e343035f1a1
dde8cc842f81dab2b5a2d752a97782416fd3e6ab
refs/heads/master
2023-01-24T01:13:35.150000
2020-11-28T20:07:34
2020-11-28T20:07:34
316,813,407
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package alexander.marashov.smo.components.generators; import alexander.marashov.smo.components.timeline.Event; public class RequestSupplier extends EventGenerator { private final int priority; private int generatedCount; private int rejectedCount; private int doneCount; private double inBufferTime; private double inBufferTimeSquare; private double inConsumerTime; private double inConsumerTimeSquare; public RequestSupplier(final int id, final double intensity, final int priority) { super(id, intensity); this.priority = priority; this.generatedCount = 0; this.doneCount = 0; this.rejectedCount = 0; this.inBufferTime = 0.; this.inBufferTimeSquare = 0.; this.inConsumerTime = 0.; this.inConsumerTimeSquare = 0.; } @Override public double generateDelay() { return 5 - Math.log(Math.random()) * 20 / intensity; } @Override public Event generateEvent(final double currentTime) { generatedCount++; final double timestamp = currentTime + generateDelay(); return new Event( Event.EventType.SUPPLIER_EVENT, this, timestamp, () -> new Request(priority, timestamp) ); } @Override public void clear() { this.generatedCount = 0; this.doneCount = 0; this.rejectedCount = 0; this.inBufferTime = 0.; this.inBufferTimeSquare = 0.; this.inConsumerTime = 0.; this.inConsumerTimeSquare = 0.; } public int getGeneratedCount() { return this.generatedCount; } public int getRejectedCount() { return this.rejectedCount; } public double rejectProbability() { return (double) rejectedCount / generatedCount; } public double averageInSystemTime() { return averageInBufferTime() + averageInConsumerTime(); } // D(x) = M(x^2) - (M(x))^2 public double varianceBufferTime() { return inBufferTimeSquare / generatedCount - (inBufferTime / generatedCount) * (inBufferTime / generatedCount); } public double varianceConsumerTime() { return inConsumerTimeSquare / doneCount - (inConsumerTime / doneCount) * (inConsumerTime / doneCount); } public double averageInBufferTime() { return inBufferTime / generatedCount; } public double averageInConsumerTime() { return inConsumerTime / generatedCount; } public double getInConsumerTime() { return inConsumerTime; } public void reject(final Request request, final double time) { assert request.priority == this.priority; rejectedCount++; inBufferTime += (time - request.timestamp); inBufferTimeSquare += (time - request.timestamp) * (time - request.timestamp); } public void done(Request request, double time) { assert request.priority == this.priority; doneCount++; inConsumerTime += (time - request.timestamp); inConsumerTimeSquare += (time - request.timestamp) * (time - request.timestamp); } public void took(final Request request, final double time) { assert request.priority == this.priority; inBufferTime += (time - request.timestamp); inBufferTimeSquare += (time - request.timestamp) * (time - request.timestamp); } @Override public String toString() { return "RequestSupplier(priority = " + priority + ", generatedCount = " + generatedCount + ", rejectedCount = " + rejectedCount + ")"; } }
UTF-8
Java
3,661
java
RequestSupplier.java
Java
[]
null
[]
package alexander.marashov.smo.components.generators; import alexander.marashov.smo.components.timeline.Event; public class RequestSupplier extends EventGenerator { private final int priority; private int generatedCount; private int rejectedCount; private int doneCount; private double inBufferTime; private double inBufferTimeSquare; private double inConsumerTime; private double inConsumerTimeSquare; public RequestSupplier(final int id, final double intensity, final int priority) { super(id, intensity); this.priority = priority; this.generatedCount = 0; this.doneCount = 0; this.rejectedCount = 0; this.inBufferTime = 0.; this.inBufferTimeSquare = 0.; this.inConsumerTime = 0.; this.inConsumerTimeSquare = 0.; } @Override public double generateDelay() { return 5 - Math.log(Math.random()) * 20 / intensity; } @Override public Event generateEvent(final double currentTime) { generatedCount++; final double timestamp = currentTime + generateDelay(); return new Event( Event.EventType.SUPPLIER_EVENT, this, timestamp, () -> new Request(priority, timestamp) ); } @Override public void clear() { this.generatedCount = 0; this.doneCount = 0; this.rejectedCount = 0; this.inBufferTime = 0.; this.inBufferTimeSquare = 0.; this.inConsumerTime = 0.; this.inConsumerTimeSquare = 0.; } public int getGeneratedCount() { return this.generatedCount; } public int getRejectedCount() { return this.rejectedCount; } public double rejectProbability() { return (double) rejectedCount / generatedCount; } public double averageInSystemTime() { return averageInBufferTime() + averageInConsumerTime(); } // D(x) = M(x^2) - (M(x))^2 public double varianceBufferTime() { return inBufferTimeSquare / generatedCount - (inBufferTime / generatedCount) * (inBufferTime / generatedCount); } public double varianceConsumerTime() { return inConsumerTimeSquare / doneCount - (inConsumerTime / doneCount) * (inConsumerTime / doneCount); } public double averageInBufferTime() { return inBufferTime / generatedCount; } public double averageInConsumerTime() { return inConsumerTime / generatedCount; } public double getInConsumerTime() { return inConsumerTime; } public void reject(final Request request, final double time) { assert request.priority == this.priority; rejectedCount++; inBufferTime += (time - request.timestamp); inBufferTimeSquare += (time - request.timestamp) * (time - request.timestamp); } public void done(Request request, double time) { assert request.priority == this.priority; doneCount++; inConsumerTime += (time - request.timestamp); inConsumerTimeSquare += (time - request.timestamp) * (time - request.timestamp); } public void took(final Request request, final double time) { assert request.priority == this.priority; inBufferTime += (time - request.timestamp); inBufferTimeSquare += (time - request.timestamp) * (time - request.timestamp); } @Override public String toString() { return "RequestSupplier(priority = " + priority + ", generatedCount = " + generatedCount + ", rejectedCount = " + rejectedCount + ")"; } }
3,661
0.63316
0.627971
127
27.826771
25.664429
142
false
false
0
0
0
0
0
0
0.496063
false
false
2
0bb4f3ed01e9f7f786023fa926f27cc6b29933d3
11,819,750,031,819
1e7756ee4bb47e3299ad995de81ceeff6daddac6
/src/ui/UI.java
d1eaff225e113a3d0d32efd3ee3f4ce420c02727
[]
no_license
jmsaylor/GoFish
https://github.com/jmsaylor/GoFish
0350fe8da93985ffd2ff0e2040e423923c0dd520
a5e082817f2683ed9d21694d4b8b575ad617cdd7
refs/heads/master
2023-01-12T05:15:00.675000
2020-10-28T22:45:27
2020-10-28T22:45:27
308,159,056
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ui; import deck.Value; import hand.Hand; import hand.StandardHand; import players.Player; import java.util.List; public interface UI { void printPlayer(Player player); void printHand(Hand hand); void ask(Value cardValue, Player player); boolean respond(Value cardValue); Player choosePlayer(List<Player> players); Value chooseValue(); String inputName(); void sendBookResults(); }
UTF-8
Java
429
java
UI.java
Java
[]
null
[]
package ui; import deck.Value; import hand.Hand; import hand.StandardHand; import players.Player; import java.util.List; public interface UI { void printPlayer(Player player); void printHand(Hand hand); void ask(Value cardValue, Player player); boolean respond(Value cardValue); Player choosePlayer(List<Player> players); Value chooseValue(); String inputName(); void sendBookResults(); }
429
0.717949
0.717949
24
16.875
15.103291
46
false
false
0
0
0
0
0
0
0.625
false
false
2
b1c774a6f76d7e9fe3677ff5ed5311c358f79712
6,545,530,185,923
4b54074087e2dcbae892e30b4fb98cf08c2d4988
/src/Finish.java
461c4553beb9e4a84a9da1b5efe6e4000e3f164a
[]
no_license
programming-project/sleutelgame
https://github.com/programming-project/sleutelgame
950bd262f4e1f10683d1229c037995142f68205e
f48782ffa6be8bb065334380207bde4ef5f09104
refs/heads/master
2020-05-02T14:16:06.134000
2019-04-04T23:13:19
2019-04-04T23:13:19
178,005,644
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import javax.swing.*; public class Finish extends VeldObject { /** * Constructor voor finish * @param rij positierij van finish * @param kolom positiekolom van finish */ public Finish(int rij, int kolom) { super(rij, kolom); super.setIcon(new JLabel(new ImageIcon("src/icons/finish.png"))); } /** * Geeft melding als de speler op de finish komt */ public void spelGewonnen() { JOptionPane.showMessageDialog(null, "Je hebt het spel gewonnen hoera! Bedankt voor het spelen!"); } }
UTF-8
Java
506
java
Finish.java
Java
[]
null
[]
import javax.swing.*; public class Finish extends VeldObject { /** * Constructor voor finish * @param rij positierij van finish * @param kolom positiekolom van finish */ public Finish(int rij, int kolom) { super(rij, kolom); super.setIcon(new JLabel(new ImageIcon("src/icons/finish.png"))); } /** * Geeft melding als de speler op de finish komt */ public void spelGewonnen() { JOptionPane.showMessageDialog(null, "Je hebt het spel gewonnen hoera! Bedankt voor het spelen!"); } }
506
0.701581
0.701581
22
22.045454
25.472761
99
false
false
0
0
0
0
0
0
1.136364
false
false
2
07db5bb0d1ff6526ff366577a64347bf334bb97a
10,883,447,152,017
371a1e7a0c0bf3b9308bb4c1be8b76a5217fe9cd
/src/main/java/wordBreak/wordbreak2/Solution2.java
322085ecdc58f923083a5aca865b56ab74732f6f
[]
no_license
clarkchen/leetcode_java
https://github.com/clarkchen/leetcode_java
55d41cf1acdb1e2a2c00591a49619c826d5825c6
db0d0d4d965ac73962d04cebe0cbddcc64f0ba8b
refs/heads/master
2021-01-01T19:15:33.842000
2015-08-31T16:30:34
2015-08-31T16:30:34
25,287,291
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package wordBreak.wordbreak2; import java.util.*; public class Solution2 { public boolean wordBreakTest(String s, Set<String> dict) { Boolean dp[] = new Boolean[s.length()]; for(int i=0;i<s.length();i++) { dp[i] = false; Iterator<String> it= dict.iterator(); while(it.hasNext()) { String d =it.next(); int m = i-d.length()+1; if(m<0) continue; String temp = s.substring(m,i+1); if(temp.equals(d) &&(m==0|| dp[m-1]==true)) { dp[i] =true;break; } } } return dp[s.length()-1]; } public List<String> wordBreak(String s, Set<String> dict) { if(s==null || s.length()==0 || !wordBreakTest(s,dict)) return new ArrayList<String>(); HashMap<Integer, ArrayList<String>> hr =new HashMap<Integer, ArrayList<String>> (); for(int i= 0;i<s.length();i++) { ArrayList<String> cur = new ArrayList<String>(); hr.put(i,cur ); Iterator<String> it = dict.iterator(); while(it.hasNext()) { String dj = it.next(); int pre = i - dj.length()+1; if(pre <0) continue; String temp = s.substring(pre,i+1); if(temp.equals(dj)) { if(pre==0) { cur.add(dj); } else{ ArrayList<String> preA = hr.get(pre-1); if(preA.size()>0) { for(int j = 0;j<preA.size();j++) { cur.add(preA.get(j)+" "+dj); } } } } } } return hr.get(s.length()-1); } public static void main(String[] args) { // TODO Auto-generated method stub String s = "catsanddog"; HashSet<String> dict = new HashSet(); dict.add("cat"); dict.add("cats"); dict.add("and"); dict.add("sand"); dict.add("dog"); Solution s1 =new Solution(); System.out.print(s1.wordBreak(s, dict)); } }
UTF-8
Java
1,776
java
Solution2.java
Java
[]
null
[]
package wordBreak.wordbreak2; import java.util.*; public class Solution2 { public boolean wordBreakTest(String s, Set<String> dict) { Boolean dp[] = new Boolean[s.length()]; for(int i=0;i<s.length();i++) { dp[i] = false; Iterator<String> it= dict.iterator(); while(it.hasNext()) { String d =it.next(); int m = i-d.length()+1; if(m<0) continue; String temp = s.substring(m,i+1); if(temp.equals(d) &&(m==0|| dp[m-1]==true)) { dp[i] =true;break; } } } return dp[s.length()-1]; } public List<String> wordBreak(String s, Set<String> dict) { if(s==null || s.length()==0 || !wordBreakTest(s,dict)) return new ArrayList<String>(); HashMap<Integer, ArrayList<String>> hr =new HashMap<Integer, ArrayList<String>> (); for(int i= 0;i<s.length();i++) { ArrayList<String> cur = new ArrayList<String>(); hr.put(i,cur ); Iterator<String> it = dict.iterator(); while(it.hasNext()) { String dj = it.next(); int pre = i - dj.length()+1; if(pre <0) continue; String temp = s.substring(pre,i+1); if(temp.equals(dj)) { if(pre==0) { cur.add(dj); } else{ ArrayList<String> preA = hr.get(pre-1); if(preA.size()>0) { for(int j = 0;j<preA.size();j++) { cur.add(preA.get(j)+" "+dj); } } } } } } return hr.get(s.length()-1); } public static void main(String[] args) { // TODO Auto-generated method stub String s = "catsanddog"; HashSet<String> dict = new HashSet(); dict.add("cat"); dict.add("cats"); dict.add("and"); dict.add("sand"); dict.add("dog"); Solution s1 =new Solution(); System.out.print(s1.wordBreak(s, dict)); } }
1,776
0.550113
0.538288
81
20.91358
17.467569
86
false
false
0
0
0
0
0
0
3.839506
false
false
2
5136bc897a063dd821f1f4974ffff1afc3940c8d
68,719,506,599
02c94592ea008294be89e9ec7f0953e23a84ef4c
/app/src/main/java/beans/Item3_home.java
8f878125adad44ea4d55db2679bbf6ac85ff6c98
[]
no_license
Felfan/demo1
https://github.com/Felfan/demo1
6963b0605db424fdb2350e73fd1e57d77480976c
381536bc855a067d0525cd2a385d405162bb361f
refs/heads/master
2020-06-30T20:24:55.351000
2016-11-21T10:25:33
2016-11-21T10:25:33
74,351,702
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package beans; import java.util.ArrayList; import java.util.List; import interfaces.IItem; /** * Created by 房庆丰 on 2016/11/7. */ public class Item3_home implements IItem { @Override public int getType() { return 3; } private List<String> mList = new ArrayList<>(); private List<String> toList = new ArrayList<>(); public List<String> getToList() { return toList; } public void setToList(List<String> toList) { this.toList = toList; } public List<String> getList() { return mList; } public void setList(List<String> list) { mList = list; } }
UTF-8
Java
650
java
Item3_home.java
Java
[ { "context": "ist;\n\nimport interfaces.IItem;\n\n/**\n * Created by 房庆丰 on 2016/11/7.\n */\npublic class Item3_home impleme", "end": 115, "score": 0.9747270345687866, "start": 112, "tag": "NAME", "value": "房庆丰" } ]
null
[]
package beans; import java.util.ArrayList; import java.util.List; import interfaces.IItem; /** * Created by 房庆丰 on 2016/11/7. */ public class Item3_home implements IItem { @Override public int getType() { return 3; } private List<String> mList = new ArrayList<>(); private List<String> toList = new ArrayList<>(); public List<String> getToList() { return toList; } public void setToList(List<String> toList) { this.toList = toList; } public List<String> getList() { return mList; } public void setList(List<String> list) { mList = list; } }
650
0.608696
0.59472
36
16.888889
16.721207
52
false
false
0
0
0
0
0
0
0.305556
false
false
2
ab1db4cf25888708811b11f939bd9f87f6022c5a
19,164,144,110,730
5e02bd4c517a1813c76bc53e4ca04428b37bdc11
/src/main/java/com/github/myauth/core/Permission.java
7cbcd1bac209ace45a30cdeb9deab520743ecebb
[]
no_license
sluggard6/myauth
https://github.com/sluggard6/myauth
90019b635d965bb94694f543e9645cdc9c9bfd7e
9a0e4d13e7c393aa92f07292fb5fd51d7f36752b
refs/heads/master
2023-07-11T07:53:45.389000
2021-08-02T03:06:20
2021-08-02T03:06:20
391,774,100
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.github.myauth.core; public interface Permission { }
UTF-8
Java
66
java
Permission.java
Java
[]
null
[]
package com.github.myauth.core; public interface Permission { }
66
0.772727
0.772727
5
12.2
14.551976
31
false
false
0
0
0
0
0
0
0.2
false
false
2
0ec6497723c29cf366befa7222ef008f9aef1c4b
7,722,351,222,214
8b7e34b6c9ca4877ecf5bd9885cafa9056fd53e0
/src/_02_cat/CatRunner.java
662ecf3a086d16b9f149e4d67a638da846b37650
[]
no_license
League-Level1-Student/level1-module1-jerneward
https://github.com/League-Level1-Student/level1-module1-jerneward
fe181b18d79f23a9f4ba1005c94d978290da7e28
a16eac1e1ef5b669056789f5440b5c1a2cd400fb
refs/heads/master
2023-02-11T01:13:11.956000
2021-01-07T00:33:00
2021-01-07T00:33:00
316,087,854
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package _02_cat; public class CatRunner { public static void main(String[] args) { Cat bubbles = new Cat("bubbles"); bubbles.meow(); bubbles.printName(); bubbles.kill(); }}
UTF-8
Java
189
java
CatRunner.java
Java
[]
null
[]
package _02_cat; public class CatRunner { public static void main(String[] args) { Cat bubbles = new Cat("bubbles"); bubbles.meow(); bubbles.printName(); bubbles.kill(); }}
189
0.650794
0.640212
15
11.533334
13.220523
40
false
false
0
0
0
0
0
0
0.8
false
false
2
34d8559d1b116dc0331bc7c70f1836ee0569a6e3
9,758,165,753,325
9656daa7007690d9597a64483f53188e6a3deede
/src/MyArrays/MyArray.java
f85d9062294c3d8fe379df2f1e6757d7b0105f7a
[]
no_license
aloksaxena77/Java_Training
https://github.com/aloksaxena77/Java_Training
141c8443d17f7afdddfeb42d85df5a12c557af7e
2ca15b5fa55f41c15f379184359f4810e2686ff4
refs/heads/master
2021-06-23T04:02:39.835000
2018-06-14T17:13:15
2018-06-14T17:13:15
95,912,190
0
0
null
false
2018-06-14T17:13:16
2017-06-30T18:00:37
2018-06-14T17:10:46
2018-06-14T17:13:15
6
0
0
0
Java
false
null
package MyArrays; import java.util.*; public class MyArray { int [] i = {2,5,6,1,8,5,9}; char[] c = {'A','Z','B','H','C'}; public void intSortArray() { for (int k : i) {System.out.println("int Array before Sorting : " + k);} Arrays.sort(i); for (int k : i) {System.out.println("int Array after Sorting : " + k);} } public void charSortArray() { for (char k : c) {System.out.println("Char Array before Sorting : " + k);} Arrays.sort(c); for (char k : c) {System.out.println("Char Array after Sorting : " + k);} } }
UTF-8
Java
570
java
MyArray.java
Java
[]
null
[]
package MyArrays; import java.util.*; public class MyArray { int [] i = {2,5,6,1,8,5,9}; char[] c = {'A','Z','B','H','C'}; public void intSortArray() { for (int k : i) {System.out.println("int Array before Sorting : " + k);} Arrays.sort(i); for (int k : i) {System.out.println("int Array after Sorting : " + k);} } public void charSortArray() { for (char k : c) {System.out.println("Char Array before Sorting : " + k);} Arrays.sort(c); for (char k : c) {System.out.println("Char Array after Sorting : " + k);} } }
570
0.563158
0.550877
25
20.799999
19.095549
59
false
false
0
0
0
0
0
0
1.92
false
false
2
dbd45482a933920437d506a2cd744e61fc5395b7
28,260,884,828,336
44a968d10d745b19704f7c89675192a20cf96c92
/src/com/tbk/cabinet/SearchView.java
e5f97d65a98eca3dd7cf0f913a344e40da852a63
[]
no_license
zhangkari/cabinet
https://github.com/zhangkari/cabinet
9683b226582b5548aa6900b89db3f26050424d92
dae5550712cfa6c7df448fce59139f94f7112edc
refs/heads/master
2015-08-14T09:21:01.846000
2014-11-20T14:33:16
2014-11-20T14:33:16
26,006,094
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.tbk.cabinet; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.RelativeLayout; public class SearchView extends RelativeLayout { final static String TAG = "DetailView"; private Context mContext; private LayoutInflater mInflater; private Button btnSearch; private EditText editText; public SearchView(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; initView(); } public SearchView(Context context) { super(context); mContext = context; initView(); } private void initView() { mInflater = LayoutInflater.from(mContext); mInflater.inflate(R.layout.view_search, this); btnSearch = (Button) findViewById(R.id.search_btn_search); editText = (EditText) findViewById(R.id.search_editext_keyword); } public void SetOnSearchClickListener(OnClickListener listener) { btnSearch.setOnClickListener(listener); } public String getKeyword() { return editText.getText().toString(); } public void clearFocus() { editText.clearFocus(); InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); } }
UTF-8
Java
1,372
java
SearchView.java
Java
[]
null
[]
package com.tbk.cabinet; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.RelativeLayout; public class SearchView extends RelativeLayout { final static String TAG = "DetailView"; private Context mContext; private LayoutInflater mInflater; private Button btnSearch; private EditText editText; public SearchView(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; initView(); } public SearchView(Context context) { super(context); mContext = context; initView(); } private void initView() { mInflater = LayoutInflater.from(mContext); mInflater.inflate(R.layout.view_search, this); btnSearch = (Button) findViewById(R.id.search_btn_search); editText = (EditText) findViewById(R.id.search_editext_keyword); } public void SetOnSearchClickListener(OnClickListener listener) { btnSearch.setOnClickListener(listener); } public String getKeyword() { return editText.getText().toString(); } public void clearFocus() { editText.clearFocus(); InputMethodManager imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); } }
1,372
0.77551
0.774781
51
25.90196
22.638035
104
false
false
0
0
0
0
0
0
1.54902
false
false
2