query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Attempt to authenticate to the underlying resource using the given identity and password. The identity may be the value of the identity attribute, but could also be a value that can be used to search for the account (eg sAMAccountName, full name, etc...). If successful, this returns the account that was authenticated to.
public Map<String, Object> authenticate(String identity, String password) throws ConnectorException, ObjectNotFoundException, AuthenticationFailedException, ExpiredPasswordException { Map<String, Object> obj = read(identity); if (null == obj) { throw new ObjectNotFoundException(identity); } // If there was a problem we would have thrown already. Return the // // // matched object. return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static synchronized Credentials authenticate(String userName, String password){\n\t\t\tConnection connection;\n\t\t \tCredentials credentials=null;\n\t\t \t\n\t\t \tPreparedStatement statement=null;\n\t\t\tString preparedSQL = \"SELECT * FROM Credential WHERE Email = ? and Pass = ?\";\n\t\t\t\n\t\t try{\n\t\t \tconnection=DBConnector.getConnection();\n\t\t \tstatement = connection.prepareStatement(preparedSQL);\n\t\t \tstatement.setString(1, userName);\n\t\t \tstatement.setString(2, password);\n\t\t\t\tResultSet rs = statement.executeQuery();\n\t\t\t\tif(rs.next()){\n\t\t\t\t\tcredentials = new Credentials();\n\t\t\t\t\tcredentials.setCredID(rs.getInt(1));\n\t\t\t\t\tcredentials.setUserID(rs.getInt(2));\n\t\t\t\t\tcredentials.setEmail(rs.getString(3));\n\t\t\t\t\tcredentials.setPass(rs.getString(4));\n\t\t\t\t\tcredentials.setRole(rs.getString(5));\n\t\t\t\t\tcredentials.setValid(rs.getInt(6));\n\t\t\t\t\tcredentials.setRegKey(rs.getString(7));\n\t\t\t\t}\t\n\t\t\t\trs.close();\t\t\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t\t\n\t\t\t}catch (SQLException ex){\n\t\t\t\t\tSystem.out.println(\"Error: \" + ex);\n\t\t\t\t\tSystem.out.println(\"Query: \" + statement.toString());\n\t\t\t\t\tcredentials = null;\n\t\t\t\t}\t\n\t\t\treturn credentials;\n\t}", "public static User authenticate(String email, String password) \n {\n \tAccountDetails temp = AccountDetails.authenticate(email, password);\n \t\n if (temp != null)\n return find.ref(temp.userId);\n else\n return null;\n }", "public User authenticateUser(String userID, String password) {\n // using fluent interface to construct multi-clause queries\n Realm realm = (mRealm == null) ? Realm.getDefaultInstance() : mRealm;\n\n final User user = realm.where(User.class)\n .equalTo(\"IsActive\", true)\n .equalTo(\"UserId\", userID)\n .findFirst();\n\n // conditions: userid or (userid and password)required\n // authentication success\n if (user != null && ((password == null || user.getPassword().equals(password)) || (getUserAccountStatus(user) == AccountStatus.LockedOut))) {\n\n if (mRealm == null)\n realm.close();\n\n return user;\n }\n\n // password authentication failed.\n if (user != null) {\n realm.executeTransaction(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n if (user.getLastInvalidLogin() != null) {\n // if more than 5 min from last invalid login, then set invalid login attempts to 0\n if (!earlyLoginAttempt(user.getLastInvalidLogin())) {\n user.setInvalidLoginAttempts(0);\n }\n }\n user.setLastInvalidLogin(new Date());\n user.setInvalidLoginAttempts(user.getInvalidLoginAttempts() + 1);\n }\n });\n }\n\n if (mRealm == null)\n realm.close();\n\n // if here, return anonymous user\n return realm.where(User.class).equalTo(\"UserId\", \"anonymous\").findFirst();\n }", "public User doAuthentication(String account, String password);", "User authenticate(String username, String password);", "public abstract boolean authenticate(String userid, String password) throws\n YAuthenticationException;", "public Identity authenticate(String login, String pwd){\r\n\t\t\t\r\n\t\t\r\n\t\tSpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);\r\n\t\tSession session = sf.openSession();\r\n\t\tList<Identity> ids = new ArrayList<Identity>();\r\n\t\tTransaction t = session.beginTransaction();\r\n\t\tQuery query = session.createQuery(\"FROM Identity AS identity WHERE identity.displayName = :login\");\r\n\t\t//transaction - forces changes in cache to be updated to dbs\r\n\t\tquery.setParameter(\"login\", login);\r\n\t\tids = query.list();\r\n\t\tt.commit();\r\n\t\tsession.close();\r\n\t\t\r\n\t\tif(ids.isEmpty())\r\n\t\t\treturn null;\r\n\t\t\r\n\t\t//there should be only one identity to a single displayname!\r\n\t\tfor(Identity id : ids)\r\n\t\t{\r\n\t\t\tPasswordEndecryptor.getInst();\r\n\t\t\t// hashed password decryption and authentication\r\n\t\t\tif(PasswordEndecryptor.checkPwd(pwd, id.getPassword()))\r\n\t\t\t{\r\n\t\t\t\tLOGGER.debug(\"Authentication should be succesfull!\");\r\n\t\t\t\treturn id;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\tLOGGER.debug(\"Authentication should NOT be succesfull!\");\r\n\t\treturn null;\r\n\t}", "public static Account authenticate(String token, String password)\n\t{\n\t\tString username = usernames.get(token);\n\t\tif(username == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tAccount account = Application.getAccountLibrary().getAccount(username);\n\t\tif(account == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tif(account.authenticate(password))\n\t\t{\n\t\t\tusernames.remove(token);\n\t\t\treturn account;\n\t\t}\n\t\treturn null;\n\t}", "AuthenticationToken authenticate(String username, CharSequence password) throws Exception;", "public Person authenticateAndGetUser(String numCc, String password) throws RemoteException;", "EmployeeMaster authenticateUser(int employeeId, String password);", "private Authentication tryToAuthenticateWithUsernameAndPassword(String username, String password) {\n\t\tUsernamePasswordAuthenticationToken requestAuthentication = new UsernamePasswordAuthenticationToken(username, password);\n\t\treturn tryToAuthenticate(requestAuthentication);\n \n\t}", "@Override\n\tpublic Authentication authenticate(Authentication authentication) throws AuthenticationException {\n\t\tString userId = authentication.getPrincipal().toString();\n\t\tString password = authentication.getCredentials().toString();\n\t\tUserInfo userAuth = Config.getInstance().getUserAuth();\n\t\tuserAuth.setUserEmail(userId);\n\t\tuserAuth.setUserPassword(password);\n\t\tLoginService loginService = Config.getInstance().getLoginService();\n\t\tUserInfo userInfo;\n\t\ttry{\n\t\t\tuserInfo = loginService.authenticateUser(userId,password);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new AuthenticationServiceException(\"1000\");\n\t\t}\n\t\tif (userInfo != null)\n\t\t{\n\t\t\treturn grantNormalRole(userInfo, authentication);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// No user with this banner id found.\n\t\t\tthrow new BadCredentialsException(\"1001\");\n\t\t}\n\t}", "User login(String email, String password) throws AuthenticationException;", "@Override\n public boolean authenticated(final String username, final String password) {\n\n Claim claim;\n try {\n claim = credService.authenticate(new PasswordCredentialsWrapper(username, password));\n } catch (AuthenticationException e) {\n LOG.debug(\"Authentication failed for user '{}' : {}\", username, e);\n return false;\n }\n\n LOG.debug(\"Authentication result for user '{}' : {}\", username, claim.domain());\n return true;\n }", "LoggedUser authenticate(@Valid AccountCredentials credentials) throws IOException;", "boolean authenticate(String userName, String password);", "@Override\n public Authentication authenticate(Authentication authentication) throws AuthenticationException {\n\n String id = authentication.getName();\n String password = authentication.getCredentials().toString();\n\n Optional<Employee> found = employeeService.get(id);\n if (found.isPresent()) {\n Employee employee = found.get();\n\n // Get employee's roles\n List authorities = getAuthorities(employee);\n\n // Check password\n String encodedPassword = employee.getPassword();\n if (encoder.matches(password, encodedPassword)) {\n // Return the valid authentication that will be stored in SecurityContext\n return new UsernamePasswordAuthenticationToken(\n id, encodedPassword, authorities);\n }\n }\n\n throw new BadCredentialsException(\"Invalid credentials\");\n }", "public static String authenticate(final String username,\n final String password) throws IOException {\n\n String AUTH_URL = String.format(RestURI.LOGIN.getValue(), Server.getIp(), username, password);\n\n Request request = new Request.Builder()\n .url(AUTH_URL)\n .post(emptyBody)\n .build();\n\n try (Response response = getHttpClient().newCall(request).execute()) {\n return getResponseMessage(response);\n }\n }", "@Transactional\n public static User authenticate(String email, String password) {\n String sha1 = Utils.Hasher.hash(password);\n\n if (sha1 == null)\n return null;\n return User.find.where().eq(\"email\", email).eq(\"password\", sha1).findUnique();\n }", "public User login(String username, String password) throws InvalidLoginCredentialException {\n try {\n User user = retrieveUserByUsername(username);\n if (user.getPassword().equals(password)) {\n return user;\n } else {\n throw new InvalidLoginCredentialException(\"Username does not exist or invalid password!\");\n }\n } catch (UserNotFoundException ex) {\n throw new InvalidLoginCredentialException(\"Username does not exist or invalid password!\");\n }\n }", "public static Account getAcc(String username, String password)\n\t\t\tthrows InvalidUserNameOrPasswordExeption, SQLException {\n\t\tConnection con = getConnection();\n\t\tPreparedStatement ps;\n\t\tint returned = -1;\n\t\tString email;\n\n\t\tps = con.prepareStatement(\"SELECT name,password FROM account WHERE name=? AND password=?;\");\n\t\tps.setString(1, username);\n\t\tps.setString(2, password);\n\t\tResultSet rs = ps.executeQuery();\n\t\tif (rs.next() == false) {\n\t\t\tthrow new InvalidUserNameOrPasswordExeption();\n\t\t} else {\n\t\t\treturned = rs.getInt(1);\n\t\t\temail = rs.getString(3);\n\t\t}\n\n\t\treturn new Account(returned, email, username, password);\n\n\t}", "@Override\r\n\tpublic UserAccount get(String identity, String username, String password,\r\n\t\t\tboolean usePassword) {\n\t\tConnection con = MysqlDatabase.getInstance().getConnection();\r\n\t\tPreparedStatement ps = null;\r\n\t\tUserAccount ua = null;\r\n\t\ttry {\r\n\t\t\tif (usePassword) {\r\n\t\t\t\tps = con.prepareStatement(GetByIdtyUsernamePwd);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tps = con.prepareStatement(GetByIdtyUsernameNoPwd);\r\n\t\t\t}\r\n\t\t\tps.setString(1, identity);\r\n\t\t\tps.setString(2, username);\r\n\t\t\tif (usePassword) {\r\n\t\t\t\tps.setString(3, password);\r\n\t\t\t}\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tua = get(rs.getInt(\"id\"));\r\n\t\t\t}\r\n\t\t\tcon.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn ua;\r\n\t}", "public void authenticate(LoginCredentials credentials) throws LoginException;", "protected PasswordAuthentication getPasswordAuthentication() {\n\t\t\treturn new PasswordAuthentication(from, password);\n\t\t}", "protected PasswordAuthentication\n getPasswordAuthentication() {\n\n return new PasswordAuthentication(username,\n password);\n }", "protected PasswordAuthentication\n getPasswordAuthentication() {\n\n return new PasswordAuthentication(username,\n password);\n }", "@Override\r\n\tpublic Person authenticatePerson(String user, String password)\r\n\t\t\tthrows AuthenticationException {\n\t\treturn null;\r\n\t}", "AuthenticationResponseDTO authenticateUser(String email, String password);", "protected PasswordAuthentication getPasswordAuthentication()\n\t\t\t\t{\n\t\t\t\t\treturn new PasswordAuthentication(fromEmail, pwd);\n\t\t\t\t}", "public PasswordAuthentication getPasswordAuthentication() {\n return (new PasswordAuthentication(username, pwd.toCharArray()));\n }", "@Override\n public Authentication attemptAuthentication(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)\n throws AuthenticationException, IOException, ServletException {\n AccountCredentials credentials = new ObjectMapper().readValue(httpServletRequest.getInputStream(), AccountCredentials.class);\n UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(credentials.getUsername(), credentials.getPassword());\n return getAuthenticationManager().authenticate(token);\n }", "public CustomerEntity login(String username, String password) {\n return customerPersistencePort.getUser(username);\n }", "protected PasswordAuthentication getPasswordAuthentication()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn new PasswordAuthentication(fromEmail, pwd);\n\t\t\t\t\t\t\t}", "@Transactional(propagation = Propagation.REQUIRED)\n public CustomerAuthEntity authenticateCustomer(String contactNumber, String password) throws AuthenticationFailedException {\n CustomerEntity customerEntity = customerDao.getCustomerByContactNumber(contactNumber);\n if (customerEntity == null) {\n throw new AuthenticationFailedException(\"ATH-001\", \"This contact number has not been registered!\");\n }\n\n String encryptedPassword = PasswordCryptographyProvider.encrypt(password, customerEntity.getSalt());\n\n if (encryptedPassword.equals(customerEntity.getPassword())) {\n JwtTokenProvider jwtTokenProvider = new JwtTokenProvider(encryptedPassword);\n CustomerAuthEntity customerAuthEntity = new CustomerAuthEntity();\n customerAuthEntity.setCustomer(customerEntity);\n\n final ZonedDateTime now = ZonedDateTime.now();\n final ZonedDateTime expiresAt = now.plusHours(8);\n\n customerAuthEntity.setAccessToken(jwtTokenProvider.generateToken(customerEntity.getUuid(), now, expiresAt));\n customerAuthEntity.setLoginAt(now);\n customerAuthEntity.setExpiresAt(expiresAt);\n customerAuthEntity.setUuid(UUID.randomUUID().toString());\n\n return customerAuthDao.createCustomerAuth(customerAuthEntity);\n } else {\n throw new AuthenticationFailedException(\"ATH-002\", \"Invalid Credentials\");\n }\n }", "int authenticateUser(IDAOSession session, String userName, String password);", "void login(String email, String password) throws InvalidCredentialsException, IOException;", "protected PasswordAuthentication getPasswordAuthentication() {\n\t return new PasswordAuthentication(username, password.toCharArray());\r\n\t}", "public String loginAAALegacy(String userName, String password) {\n\t\tString token = \"\";\n\t\tHttpURLConnection httpConn;\n\n\t\ttry {\n\t\t\thttpConn = this.setHttpConnection(openAMLocation\n\t\t\t\t\t+ \"/identity/authenticate\");\n\n\t\t\tOutputStreamWriter owriter = this.setPostHttpConnection(httpConn,\n\t\t\t\t\t\"\");\n\t\t\tString data = \"username=\" + userName + \"&password=\" + password;\n\t\t\towriter.write(data);\n\t\t\towriter.flush();\n\t\t\towriter.close();\n\n\t\t\tBufferedReader bufReader = this.getHttpInputReader(httpConn);\n\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\tString str = null;\n\n\t\t\twhile ((str = bufReader.readLine()) != null) {\n\t\t\t\tlogger.info(\"{}\", str);\n\t\t\t\tsb.append(str);\n\t\t\t}\n\n\t\t\tif (httpConn.getResponseCode() == 200) {\n\t\t\t\ttoken = sb.toString();\n\t\t\t\ttoken = token.substring(token.indexOf(\"token.id=\")\n\t\t\t\t\t\t+ \"token.id=\".length());\n\t\t\t\tlogger.info(\"token = {}\", token);\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"IOException: \", e);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Exception: \", e);\n\t\t}\n\n\t\treturn token;\n\t}", "protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(Utils.EMAIL, Utils.PASSWORD);\n }", "LoginContext login(String username, String password) throws LoginException;", "public void authenticateCurrentCustomer(String password) throws SQLException,\n DatabaseInsertException {\n this.currentCustomerAuthenticated = this.currentCustomer.authenticate(password);\n if (authenticate(this.currentCustomer.getId(), password)) {\n System.out.println(\"*AUTHENTICATION SUCCESSFUL*\");\n } else {\n System.out.println(\"*AUTHENTICATION FAILED*\");\n }\n }", "public java.lang.String getAccessToken(java.lang.String userName, java.lang.String password) throws java.rmi.RemoteException;", "protected PasswordAuthentication getPasswordAuthentication() {\r\n return new PasswordAuthentication(fromEmail, password);\r\n }", "@Override\n\tpublic User getUserWithCredentials(String username, String password) {\n\t\tUser loginUser=mobileDao.getLoginUser(username);\n\t\t//System.out.println(\"password is -\"+loginBean.getPassword());\n\t\tif(loginUser!=null)\n\t\t{\t\n\t\t\tif(password.equals(loginUser.getPassword()))\n\t\t\t\treturn loginUser;\n\t\t}\n\t\treturn null;\n\t}", "protected PasswordAuthentication getPasswordAuthentication() {\r\n\t\t\t\treturn new PasswordAuthentication(fromEmail, password);\r\n\t\t\t}", "protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(fromEmail, password);\n }", "@Override\r\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(this.sUsername, this.sPassword);\r\n }", "public User logIn(String username, String password) {\n\t\tUser user = null;\n\t\ttry {\n\t\t\tTypedQuery<User> query = em.createNamedQuery(\"User.findByCredentials\", User.class);\n\t\t\tquery.setParameter(\"inUsername\", username);\n\t\t\tquery.setParameter(\"inPassword\", password);\n\t\t\tuser = query.getSingleResult();\n\t\t\tif (user != null) {\n\t\t\t\tuser.setToken(generateToken());\n\t\t\t\tem.merge(user);\n\t\t\t}\n\t\t\treturn user;\n\t\t} catch (Exception e) {\n\t\t\tlogger.log(Level.WARNING, \"User not found\", e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n\tpublic Authentication authenticate(Authentication auth) throws AuthenticationException {\n\t\t username = auth.getName();\n\t\tString pass = auth.getCredentials().toString();\n\t\t\n\t\tif(AppController.users.containsKey(username))\n\t\t{\n\t\tString password = AppController.users.get(username); \n\t\t\t\n\t\tif(password.equals(pass))\n\t\t\treturn new UsernamePasswordAuthenticationToken(username,pass,Collections.EMPTY_LIST);\n\t\telse\n\t\t\tthrow new BadCredentialsException(\"authentication failed\");\n\t\t\n\t\t}\n\t\telse\n\t\t\tthrow new BadCredentialsException(\"authentication failed\");\n\t}", "String signIn(String userName, String password) throws UserNotFoundException;", "public static StudentAccount getStudentAccount(\n\t\t\tString loginID, // Read in UPPERCASE\n\t\t\tString password) {\n\t\t\n\t\tStudentAccount temp = SystemBackend.retrieveStudentRecord(loginID, password);\n\t\treturn temp;\n\t}", "SignedObject authenticate(String username, String hashedPassword) throws RemoteException, Exception;", "public AppUser login(String username, String password) {\n\n if (username == null || username.trim().equals(\"\") || password == null || password.trim().equals(\"\")) {\n throw new InvalidRequestException(\"Invalid user credentials provided!\");\n }\n\n AppUser authUser = userRepo.findUserByCredentials(username, password);\n\n if (authUser == null) {\n throw new AuthenticationException(\"Invalid credentials provided!\");\n }\n\n\n return authUser;\n\n }", "@GET\n @Path(\"/{userid}/{password}\")\n public Response logIn(@PathParam(\"userid\") String userid, @PathParam(\"password\") String password) throws ProfileDaoException {\n Optional<Profile> user = api.getProfile(userid);\n\n \n \n if(BCrypt.hashpw(password, user.get().getPassword()).equals(user.get().getPassword())){\n //create Session\n return Response\n .ok(loginApi.logIn(userid))\n .build();\n } else {\n return Response.status(Response.Status.NOT_FOUND).build();\n }\n\n }", "public void authenticate() {\n LOGGER.info(\"Authenticating user: {}\", this.name);\n WebSession result = null;\n try {\n result =\n getContext()\n .getAuthenticationMethod()\n .authenticate(\n getContext().getSessionManagementMethod(),\n this.authenticationCredentials,\n this);\n } catch (UnsupportedAuthenticationCredentialsException e) {\n LOGGER.error(\"User does not have the expected type of credentials:\", e);\n } catch (Exception e) {\n LOGGER.error(\"An error occurred while authenticating:\", e);\n return;\n }\n // no issues appear if a simultaneous call to #queueAuthentication() is made\n synchronized (this) {\n this.getAuthenticationState().setLastSuccessfulAuthTime(System.currentTimeMillis());\n this.authenticatedSession = result;\n }\n }", "@Override\n protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)\n throws AuthenticationException {\n\n LOG.info(\"Obtaining authentication info\");\n\n /* Any leading and/or trailing white space contained in the credentials\n * (password) has been stripped out before it gets here.\n */\n try {\n if (token instanceof OAuthToken) {\n // Principal = email\n // Credentials = authenticator\n LOG.info(\"Authentication is using OAuth\");\n return new SimpleAccount(\n token.getPrincipal(), \n token.getCredentials(), \n \"CloudSession\");\n } else {\n LOG.info(\"Authentication is using local login authority\");\n\n // Principal = login\n String principal = (String) token.getPrincipal();\n\n // Credentials = password\n String credentials = new String((char[]) token.getCredentials());\n\n LOG.info(\"Authenticating user '{}'\", principal);\n\n // Thia can throw a NullPointerException\n User user = SecurityServiceImpl.authenticateLocalUserStatic(\n principal, \n credentials);\n\n if (user == null) {\n LOG.info(\"No exception but user object is null\");\n return null;\n }\n\n LOG.info(\"User {} is authenticated\", principal);\n\n try {\n return new SimpleAccount(\n token.getPrincipal(), \n token.getCredentials(), \n \"CloudSession\");\n } catch (Throwable t) {\n LOG.error(\"Unexpected exception creating account object\", t);\n }\n }\n throw new AuthenticationException(\"Unable to authenticate token\");\n }\n catch (UnknownUserException ex) {\n LOG.warn(\"Authentication failed. Message: {}\", ex.getMessage());\n throw new AuthenticationException(ex.getMessage());\n }\n catch (UserBlockedException ex) {\n LOG.warn(\"Blocked user {}\", ex);\n throw new AuthenticationException(ex.getMessage());\n }\n catch (EmailNotConfirmedException ex) {\n LOG.warn(\"Authentication failed. Message: {}\", ex.getMessage());\n throw new AuthenticationException(\"EmailNotConfirmed\");\n }\n catch (InsufficientBucketTokensException ex) {\n LOG.info(\"Insufficient bucket tokens: {}\", ex.getMessage());\n throw new AuthenticationException(ex.getMessage());\n }\n catch (NullPointerException npe) {\n LOG.warn(\"NullPointer\", npe);\n throw new AuthenticationException(npe.getMessage());\n }\n catch (Throwable t) {\n // This is a catchall exception handler that kicks the can back\n // to the caller\n LOG.warn(\"Throwable\", t);\n }\n\n return null;\n }", "public static void authenticate(String email, String password) {\n\t\tboolean authentic = Security.authenticate(email, password);\n\t\tvalidation.isTrue(\"loggedIn\", authentic)\n\t\t\t.message(\"Email and Passwords do not match\");\n\t if (authentic) {\n\t \tApplication.index();\n\t } else {\n\t \t// has errors\n\t\t params.flash(); \n\t \tvalidation.keep();\n\t \tApplication.index();\n\t }\n\t}", "@Override\n\t@Transactional(readOnly=true)\n\tpublic UserType authenticate(String username, String password) {\n\t\treturn null;\n\t}", "@Override\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\treturn new PasswordAuthentication(from, password);\n\t\t\t}", "public static Call<AccessToken> login(String email, String password){\n LoginCredentials credentials = new LoginCredentials(email, password);\n return ApiConfig.getService().login(credentials);\n }", "public final Session tryToAuthenticate(final String user, final String password)\r\n {\n return null;\r\n }", "public AuthToken login(UserCreds credentials) throws ResourceNotFoundException, UnauthorizedException {\n User user = getByName(credentials);\n // Check if user is authorized\n if (!user.getUserCreds().equals(credentials)) throw new UnauthorizedException();\n // Generate auth token\n AuthToken token = new AuthToken(user);\n // Return the token\n return token;\n }", "@Override\n\tpublic Enterprise login(String userName, String password) {\n\t\t\n\t\treturn enterpriseDao.findEnterpriseByUserNameAndPassword(userName, password);\n\t}", "protected synchronized String authenticated() throws JSONException {\n JSONObject principal = new JSONObject()\n .put(FIELD_USERNAME, USER)\n .put(FIELD_PASSWORD, PASSWORD);\n if (token == null){ //Avoid authentication in each call\n token =\n given()\n .basePath(\"/\")\n .contentType(ContentType.JSON)\n .body(principal.toString())\n .when()\n .post(LOGIN)\n .then()\n .statusCode(200)\n .extract()\n .header(HEADER_AUTHORIZATION);\n\n }\n return token;\n }", "@Override\r\n\tpublic UserAccount get(String username, String password) {\n\t\tConnection con = MysqlDatabase.getInstance().getConnection();\r\n\t\tUserAccount ua = null;\r\n\t\ttry {\r\n\t\t\tPreparedStatement ps = con.prepareStatement(GetByUsernamePwd);\r\n\t\t\tps.setString(1, username);\r\n\t\t\tps.setString(2, password);\r\n\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\tif (rs.next()) {\r\n\t\t\t\tua = get(rs.getInt(\"id\"));\r\n\t\t\t}\r\n\t\t\tcon.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn ua;\r\n\t}", "public User Authenticate(String email, String password) {\n User user = new User();\n\n TokenGenerationResult result = getAuthService().GetTokenForUser(email,password);\n\n if (result.TokenGenerationState.equals(\"0\")) {\n user.setSuccessful(false);\n user.setErrorMessage(\"User not found\");\n return user;\n }\n else if (result.TokenGenerationState.equals(\"1\"))\n {\n user.setSuccessful(false);\n user.setErrorMessage(\"invalid password\");\n return user;\n }\n\n user.setSuccessful(true);\n user.setFirstName(email);\n user.setLastName(\"email\");\n user.setUsername(email);\n user.setSessionToken(result.GeneratedToken);\n\n return user;\n }", "public User login(String email, String password) throws InvAuthException{\n\t\tString sql = \"select * from HealthUsers where email = ? \";\n\t\tUser u = null;\n\t\ttry {\n\t\t\tu = jdbcTemplate.queryForObject(sql, new UserRowMapper(),email);\n\t\t\tif(u.getPassword().equals(password))\n\t\t\t\treturn u;\n\t\t\tthrow new InvAuthException(\"invalid Password\");\n\t\t}\n\t\tcatch(EmptyResultDataAccessException e) {\n\t\t\tthrow new InvAuthException(\"invalid email\");\n\t\t}\n\t\t\n\t}", "public Object login(String studentID, String password) {\n\t\tList result = accountDao.findByStudentIDAndPass(studentID, password);\r\n\t\treturn result.size()==0 ? null: result.get(0);\r\n\t}", "public abstract boolean authenticate(ServiceSecurity serviceSecurity, SecurityContext securityContext);", "public Authentication(String email, String password) {\n this.email = email;\n this.password = password;\n }", "@Override\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(fromEmail, password);\n }", "@Override\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(fromEmail, password);\n }", "private void authenticate(String username, String password) throws Exception {\n\t\tboolean autenticated = false;\n\t\tEntityManagerFactory factory = Persistence.createEntityManagerFactory(\"ForumApp\");\n\t\tEntityManager em = factory.createEntityManager();\n\n\t\tTypedQuery<User> q = em.createQuery(\"SELECT u FROM User u WHERE u.username = '\" + username + \"'\", User.class);\n\t\tUser user = q.getSingleResult();\n\n\t\tif (user != null) {\n\n\t\t\tif (user.getPassword().equals(password)) {\n\t\t\t\tautenticated = true;\n\t\t\t}\n\t\t}\n\n\t\t// Close the entity manager\n\t\tem.close();\n\t\tfactory.close();\n\n\t\t// Throw an Exception if the credentials are invalid\n\t\tif (!autenticated) {\n\t\t\tthrow new Exception();\n\t\t}\n\t}", "public Boolean authenticateUser(String username, String password) throws SQLException{\n\t\tStatement stmt = conn.createStatement();\n\t\tString querystring = String.format(\n\t\t\t\t\"SELECT * FROM user where username='%s' AND password='%s';\", \n\t\t\t\tusername,\n\t\t\t\tpassword);\n\t\tResultSet rs = stmt.executeQuery(querystring);\n\t\tBoolean result = rs.first();\n\t\trs.close();\n\t\tstmt.close();\n\t\treturn result;\n\t}", "@Override\n\tpublic String authenticate(String username, String password) throws RemoteException\n\t{\n\t\tIterator<User> userIterator = this.users.iterator();\n\t\tUser user;\n\t\t//For every user in users\n\t\twhile (userIterator.hasNext())\n\t\t{\n\t\t\tuser = userIterator.next();\n\t\t\t//If this user's username matches the given username\n\t\t\tif (user.getUsername().equals(username))\n\t\t\t{\n\t\t\t\t//If this user's password matches the given password\n\t\t\t\tif (user.getPassword().equals(password))\n\t\t\t\t{\n\t\t\t\t\t//Generate a unique userToken\n\t\t\t\t\tString userToken = \"\";\n\t\t\t\t\tboolean duplicate = true;\n\t\t\t\t\twhile (duplicate)\n\t\t\t\t\t{\n\t\t\t\t\t\tuserToken = genUserToken();\n\t\t\t\t\t\tif (matchUser(userToken) == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tduplicate = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t//Give the userToken to the user and return it\n\t\t\t\t\t}\n\t\t\t\t\tfor(int i = 0; i < users.size(); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tuser = users.get(i);\n\t\t\t\t\t\tif(user.getUsername().equals(username))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tuser.setUserToken(userToken);\n\t\t\t\t\t\t\tServerStartup.refreshSaver();\n\t\t\t\t\t\t\treturn userToken;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tServerStartup.refreshSaver();\n\t\t\t\t\treturn userToken;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//If no username/password match was found, return null.\n\t\treturn null;\n\t}", "@Override\n protected PasswordAuthentication getPasswordAuthentication() {\n return new PasswordAuthentication(fromEmail, password);\n }", "public PasswordCredential getPasswordCredential() {\n return passCred;\n }", "public void authenticate(String email, String password) throws InterruptedException\n\t{\n\t\tthis.ref.authWithPassword(email, password, this);\n\t\t\n\t\twhile(!this.isDone)\n\t\t{\n\t\t\tThread.sleep(250);\n\t\t}\n\t}", "Customer authenticateCustomer(LoginRequestDto loginRequestDto) throws UserNotFoundException;", "@Override\n public AuthenticatedUser authenticateUser(Credentials credentials)\n throws GuacamoleException {\n SSOAuthenticationProviderService authProviderService =\n injector.getInstance(SSOAuthenticationProviderService.class);\n\n return authProviderService.authenticateUser(credentials);\n\n }", "public AuthenticationResult authenticateByName(String username, String password) {\n\t\taccessToken = null;\n\t\tAuthenticationRequest authRequest = this.setCredentials();\n\t\tAuthenticationResult authResult = restTemplate.postForObject(embyUrl +\"/\"+ EmbyUrlConstants.AUTH_BY_NAME, authRequest, AuthenticationResult.class);\n\t\t\n\t\t// set access token from result for subsequent calls\n\t\taccessToken = authResult.getAccessToken();\n\t\treturn authResult; \n\t}", "private void authenticate(String user, String pass) {\n }", "@Override\r\n public Authentication authenticate(final Authentication authentication) {\r\n final String credentials = (String) authentication.getCredentials();\r\n if (credentials == null || credentials.isEmpty()) {\r\n final GrantedAuthority grantedAuthority = new GrantedAuthorityImpl(\"\");\r\n final GrantedAuthority[] grantedAuthorities = { grantedAuthority };\r\n return new AnonymousAuthenticationToken(\"key\", \"Anonymous\", grantedAuthorities);\r\n }\r\n final UserDetails userDetails = escidocUserDetailsService.loadUserByUsername(credentials);\r\n return new UsernamePasswordAuthenticationToken(userDetails, credentials);\r\n }", "public Object getCredential()\n {\n return this.credential;\n }", "public Object getCredential()\n {\n return this.credential;\n }", "public Object getCredential()\n {\n return this.credential;\n }", "@Override\n\tpublic User logIn(String email,String password){\n\t\tUser user = userRepository.logIn(email, password);\n\t\tif(user==null)\n\t\t\tthrow new BookException(HttpStatus.UNAUTHORIZED,\"Invalid email and password\");\n\t\treturn user;\n\t}", "private void authenticateAction() {\n if (requestModel.getUsername().equals(\"superuser\")\n && requestModel.getPassword().equals(\"\")) {\n Collection<Webres> webres = getAllWebres();\n proceedWhenAuthenticated(new User(null, null, null, \"superuser\", \"\", null) {\n @Override\n public Collection<Webres> getAllowedResources() {\n return webres;\n }\n @Override\n public ActionController getDefaultController() {\n return ActionController.EMPLOYEES_SERVLET;\n }\n });\n return;\n }\n \n // try to authenticate against other credentials from the database\n Optional<User> u = getUserByCredentials(requestModel.getUsername(), requestModel.getPassword()); \n if (u.isPresent()) {\n proceedWhenAuthenticated(u.get());\n return;\n }\n \n // report authentication failed\n LOG.log(Level.INFO, \"{0} Authentication failed. Login: {1}, Password: {2}\", new Object[]{httpSession.getId(), requestModel.getUsername(), requestModel.getPassword()});\n SignInViewModel viewModel = new SignInViewModel(true);\n renderSignInView(viewModel);\n }", "public JavaaccountModel authenticateUser(JavaaccountModel oJavaaccountModel)\n\t {\n\t\t try\n\t\t {\n\t\t\t//create a new session and begin the transaction\n\t\t Session hibernateSession = HibernateUtil.getSessionFactory().openSession();\n\t\t\tTransaction hibernateTransaction = hibernateSession.beginTransaction();\n\t\t\t\n\t\t\t//create the query in HQL language\n\t\t\tString strQuery = String.format(\"FROM JavaaccountModel WHERE (username = '%s' AND password = '%s')\", oJavaaccountModel.getusername() , oJavaaccountModel.getpassword());\n\t\t\tQuery hibernateQuery = hibernateSession.createQuery(strQuery);\n\t\t\t\n\t\t\toJavaaccountModel = null;\n\t\t\t\n\t\t\t//retrieve the unique result, if there is a result at all\n\t\t\toJavaaccountModel = (JavaaccountModel) hibernateQuery.uniqueResult();\n\t\t\t\n\t\t\tif(oJavaaccountModel == null)\n\t\t\t{\n\t \t\tthrow new WebApplicationException(Response.Status.UNAUTHORIZED);\n\t\t\t}\n\t\t\t\n\t\t\t//commit and terminate the session\n\t\t\thibernateTransaction.commit();\n\t\t\thibernateSession.close();\n\t\t\t\n\t\t\t//return the JavaaccountModel of the authenticated user, or null if authentication failed\n\t\t\treturn oJavaaccountModel ;\n\t\t}\n\t\tcatch (HibernateException exception)\n\t\t{\n\t\t\tSystem.out.println(exception.getCause());\n\n\t\t\tResponseBuilderImpl builder = new ResponseBuilderImpl();\n\t\t\tbuilder.status(Response.Status.BAD_REQUEST);\n\t\t\tbuilder.entity(String.format(\"%s\",exception.getCause()));\n\t\t\tResponse response = builder.build();\n\t\t\tthrow new WebApplicationException(response);\n\t\t}\n\t }", "@Override\n\tpublic UserDetails checkUser(String emailId, String password) {\n\t\tfor (UserDetails ud :Repository.USER_DETAILS) {\n\t\t\tif ((ud.getEmailId().equalsIgnoreCase(emailId)) && (ud.getPassword().equals(password))) {\n\t\t\t\treturn ud;\n\t\t\t}\n\t\t}\n\t\tthrow new AirlineException(\"Invalid Credentials\");\n\t}", "CloudCredentialStatus create(@Nonnull AuthenticatedContext authenticatedContext);", "public String loginAAA(String userName, String password) {\n\t\tString token = null;\n\n\t\tHttpURLConnection httpConn = null;\n\t\ttry {\n\t\t\thttpConn = this.setHttpConnection(openAMLocation\n\t\t\t\t\t+ \"/json/authenticate\");\n\t\t\tthis.setHttpLoginAAARequestProperty(httpConn, userName, password);\n\t\t\tthis.setPostHttpConnection(httpConn, \"application/json\");\n\n\t\t\tBufferedReader bufReader = this.getHttpInputReader(httpConn);\n\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\tString str = null;\n\n\t\t\twhile ((str = bufReader.readLine()) != null) {\n\t\t\t\tlogger.info(\"{}\", str);\n\t\t\t\tsb.append(str);\n\t\t\t}\n\n\t\t\tif (httpConn.getResponseCode() == 200) {\n\t\t\t\tString responseContentType = httpConn.getContentType();\n\t\t\t\tif (responseContentType.contains(\"json\")) {\n\t\t\t\t\tJSONObject JsonObj = new JSONObject(sb.toString());\n\t\t\t\t\tif (JsonObj.has(\"tokenId\"))\n\t\t\t\t\t\ttoken = JsonObj.getString(\"tokenId\");\n\t\t\t\t}\n\t\t\t\tlogger.info(\"token: {}\", token);\n\t\t\t}\n\n\t\t\tbufReader.close();\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"IOException:\", e);\n\t\t} catch (JSONException e) {\n\t\t\tlogger.error(\"JSONException:\", e);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Exception:\", e);\n\t\t}\n\n\t\treturn token;\n\t}", "public String login(final String email, final String password) {\n LOG.info(\"User with email {} wants to login\", email);\n\n User user = crudServices.getUserFromEmail(email);\n\n if (user == null) {\n LOG.info(\"User with email {} does no exist\", email);\n throw new ServiceException(\"Invalid email or password\");\n }\n\n if (!appUtils.verifyPassword(password, user.getPassword())) {\n LOG.info(\"User with email {} provided wrong password\", email);\n throw new ServiceException(\"Invalid email or password\");\n }\n\n if (!user.isVerified()) {\n LOG.info(\"User with email {} is not verified\", email);\n throw new ServiceException(\"User is not verified with the given email: \" + email);\n }\n\n LOG.info(\"User with email {} provided correct password\", email);\n\n return appUtils.createJWT(String.valueOf(user.getId()));\n }", "public static Usuario connect(String email, String password) {\n\n \treturn find(\"byEmailAndPassword\", email, password).first();\n\t\n\t}", "public User checkAuthentication(String username, String password) {\n\t\tUser user = null;\n\t\ttry {\n\t\t\tsendMessage(\"authenticate\");\n\t\t\t\n\t\t\tUser userAuthentication = new User(username, password);\n\t\t\tsocketObjectOut.writeObject(userAuthentication);\n\t\t\tuser = (User)socketObjectIn.readObject();\n\t\t}catch (NoSuchElementException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t}catch (ClassNotFoundException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t}catch (IOException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t}\n\t\treturn user;\n\t}", "public String signIn(String username, String password);", "public void authenticateUser(String username, String password) {\n\n // Need to validate credentials\n // For now just authenticate the user\n\n AuthenticateUserPayload payload = new\n AuthenticateUserPayload(username, password);\n\n Timber.v(\"authenticateUser called username: \" + username);\n Observable<AuthenticateUserResponse> respObserv = ApiUtility.getApiService().authenticateUser(payload);\n respObserv.subscribeOn(Schedulers.computation())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Observer<AuthenticateUserResponse>() {\n @Override\n public void onSubscribe(@NonNull Disposable d) { }\n\n @Override\n public void onNext(@NonNull AuthenticateUserResponse authenticateUserResponse) {\n Timber.v(\"on Next() called \" + authenticateUserResponse.getMessage());\n authUserResponseObservable.onNext(authenticateUserResponse);\n }\n\n @Override\n public void onError(@NonNull Throwable e) {\n Timber.v(\"on Error() called message: \" + e.getMessage());\n Timber.v(\"on Error() called cause: \" + e.getCause());\n authUserError(e);\n }\n\n @Override\n public void onComplete() { }\n });\n }", "public HomePage loginValidCredentials (String email, String password){\n\n insertCredentials(email, password);\n submitInformation();\n\n return new HomePage(driver);\n }", "private boolean authenticate(String _uid, String _pwd) {\n\n Connection dbCon = null;\n ResultSet rs = null;\n try {\n dbCon = ds.getConnection();\n Statement s = dbCon.createStatement();\n rs = s.executeQuery(\"select * from user where id = '\"\n + _uid + \"' and pwd = '\" + _pwd + \"'\");\n return (rs.next());\n }\n catch (java.sql.SQLException e) {\n System.out.println(\"A problem occurred while accessing the database.\");\n System.out.println(e.toString());\n }\n finally {\n try {\n dbCon.close();\n }\n catch (SQLException e) {\n System.out.println(\"A problem occurred while closing the database.\");\n System.out.println(e.toString());\n }\n }\n \n return false;\n\n }" ]
[ "0.6253502", "0.6209187", "0.60534567", "0.6043665", "0.5740305", "0.57395345", "0.5735096", "0.57069236", "0.5702548", "0.56827307", "0.56315404", "0.5622231", "0.5533871", "0.5519001", "0.55058676", "0.55015486", "0.5482796", "0.54554445", "0.5449051", "0.54428834", "0.5419583", "0.5412422", "0.5412247", "0.5404184", "0.54022294", "0.5386416", "0.5386416", "0.53744334", "0.53735054", "0.53715324", "0.5367903", "0.5362782", "0.5362657", "0.53605413", "0.53592616", "0.5316179", "0.5315722", "0.53137165", "0.53126776", "0.5294151", "0.5277743", "0.52653366", "0.5256874", "0.5240915", "0.5239027", "0.52235913", "0.5208222", "0.5206024", "0.5160326", "0.5157516", "0.5156465", "0.51561004", "0.5144987", "0.51440877", "0.5142708", "0.5132558", "0.51225984", "0.5121381", "0.51111656", "0.51085055", "0.51010334", "0.507807", "0.50680155", "0.50499994", "0.5047306", "0.5043377", "0.5036272", "0.5020317", "0.5020062", "0.5014916", "0.5010872", "0.49870118", "0.49870118", "0.49589407", "0.49512172", "0.49461806", "0.4927062", "0.4920857", "0.49169225", "0.4909975", "0.49020958", "0.48865965", "0.48773268", "0.48726174", "0.48713878", "0.48713878", "0.48713878", "0.48566407", "0.4852852", "0.4834591", "0.48344037", "0.48243773", "0.48083055", "0.48068935", "0.4796257", "0.47897953", "0.47784662", "0.47775486", "0.47741717", "0.4772171" ]
0.64030397
0
Using the id passed into this method to check the request to see if has completed. This method is used to poll the system for status when things in any of the results are marked Queued and have a requestToken. The new status, returned result's errors, and warnings will be merged back into the main project. Returning a null result will have no change on the request and it will remained queued.
public Result checkStatus(String id) throws ConnectorException, ObjectNotFoundException, UnsupportedOperationException { Result result = new Result(); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkComplete(){\n return Status;\n }", "public boolean is_completed();", "public Status getStatus(int id) {\n\t\treturn null;\r\n\t}", "public Status waitUntilFinished();", "RequestStatus getStatus();", "public boolean isDone(String requestId);", "private void finishJob(int id) {\n Call<FinishJobResult> call = apiService.finishJob(id);\n final SharedPreferences.Editor editor = sharedPreferences.edit();\n call.enqueue(new Callback<FinishJobResult>() {\n @Override\n public void onResponse(Call<FinishJobResult> call, Response<FinishJobResult> response) {\n FinishJobResult finishJobResult = response.body();\n try {\n if (finishJobResult.getSuccess() == 1) {\n //job is now status 2 and it is finished\n editor.putInt(\"JOB_HANDLED\", 0);\n editor.apply();\n Toast.makeText(MapActivity.this, \"Done handling request.\", Toast.LENGTH_SHORT).show();\n recreate();\n }\n } catch (Exception e) {\n }\n }\n\n @Override\n public void onFailure(Call<FinishJobResult> call, Throwable t) {\n Toast.makeText(MapActivity.this, \"lease try again\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "@Override\n public PingCommand getCurrentStatus(long id) {\n return null;\n }", "public int getStatus(int id) {\r\n\t\tTicket ticket = getTicketById(id);\r\n\t\tif (ticket.getStatusCheck()==false) {\r\n\t\t\tticket.setStatusCheck(true);\r\n\t\t}\r\n\t\treturn ticket.getTotalScore();\r\n\t\t\r\n\t}", "public boolean getStatus() {\n return this.isDone;\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public synchronized boolean poll_response(){\n return gotResponse;\n }", "com.lvl6.proto.EventQuestProto.QuestProgressResponseProto.QuestProgressStatus getStatus();", "@Override\n\tpublic int getStatus(Integer id) {\n\t\tint status = taxTaskDao.getStatus(id);\n\t\treturn status;\n\t}", "@GET(\"replays/upload/status/{id}\")\n Call<DataResponse<JobData>> getJobStatus(@Path(\"id\") String jobId);", "private void getCheckIn (String id) throws MqttException {\n MqttMessage message = new MqttMessage(new Gson().toJson(dao.getCheckIn(id)).getBytes());\n message.setQos(0);\n publishThread(\"checkin\", message, UniMed.mqttClient);\n }", "public OperationStatusResultInner withId(String id) {\n this.id = id;\n return this;\n }", "TaskStatus getStatus();", "private void statusCheck() {\n\t\tif(status.equals(\"waiting\")) {if(waitingPlayers.size()>1) status = \"ready\";}\n\t\tif(status.equals(\"ready\")) {if(waitingPlayers.size()<2) status = \"waiting\";}\n\t\tif(status.equals(\"start\")) {\n\t\t\tif(players.size()==0) status = \"waiting\";\n\t\t}\n\t\tview.changeStatus(status);\n\t}", "public void examResults(int id) {\n\t\tObject obj = new Object();\n\t\tsynchronized (obj) {\n\t\t\tif (resultsNotIn(obj)) {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tobj.wait();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}// try\n\t\t\t\t\tcatch (InterruptedException e) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}// catch\n\t\t\t\t}// while\n\t\t\t}// if\n\t\t}\n\t}", "boolean hasListResponse();", "private void checkResult() {\n if (parent != -1 && (numOfAck == (outgoingLinks.size() - 1))) {\n if (setOfAck.add(this.maxId)) {\n Message message = new Message(this.uid, this.maxId, \"ack\");\n sendTo(message, this.parent);\n }\n if (!termination) {\n marker.addNumOfTerminatedProc();\n termination = true;\n }\n } else if (parent == -1 && (numOfAck == outgoingLinks.size())) {\n System.out.println(this.uid + \" is the leader.\");\n marker.addNumOfTerminatedProc();\n }\n }", "public boolean isDone(){\n return status;\n }", "@GetMapping(\"/byid/{id}\")\r\n public ResponseEntity<TaskStatus> getTaskStatusById(@PathVariable(value = \"id\") Long id) {\r\n\r\n TaskStatus tsk = dao.findOne(id);\r\n\r\n if (tsk == null) {\r\n return ResponseEntity.notFound().build();\r\n }\r\n return ResponseEntity.ok().body(tsk);\r\n\r\n }", "public retStatus Status(){\n // Your code here\n this.mutex.lock();\n\n retStatus r = new retStatus(State.Pending, this.values.get(this.me));\n if (done) {\n r.state = State.Decided;\n }\n\n this.mutex.unlock();\n return r;\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public boolean cancelRequest(int id) {\n Future f = currentRequests.get(id);\n return (f != null) && f.cancel();\n }", "public boolean inProgress(){return (this.currentTicket != null);}", "com.lvl6.proto.EventQuestProto.QuestRedeemResponseProto.QuestRedeemStatus getStatus();", "boolean isCompleted();", "public boolean isComplete()\n {\n return getStatus() == STATUS_COMPLETE;\n }", "boolean hasIsComplete();", "boolean hasIsComplete();", "public boolean isOkToQuery(String id){\n try{\n queryTextbook(id);\n return true;\n }catch (RuntimeException e){\n e.printStackTrace();\n return false;\n }\n }", "protected void awaitResult(){\t\n\t\ttry {\n\t\t\t/*place thread/tuple identifier in waitlist for future responses from web service*/\n\t\t\tResponses.getInstance().addToWaitList(this.transId, this);\n\t\t\tthis.latch.await();\n\t\t\t\n\t\t} catch (InterruptedException e) {\n\n\t\t\tLogger.getLogger(\"RSpace\").log(Level.WARNING, \"Transaction #\" + transId + \" response listener was terminated\");\n\t\t}\n\t}", "public SearchResponse getStatus();", "public Entity editStatus(UUID id){\n\n Entity ent = a.getEntityRepository().get(id);\n if ( ent.getStatus() == Entity.StatusEnum.IN_PROGRESS) {\n ent.setStatus(Entity.StatusEnum.FINISHED);\n //System.out.println(\"changed status of session: \" + id.toString() + \" to \"+ ent.getStatus().toString() );\n }\n return ent;\n }", "@Override\n public Tournament tournamentStatus(String id) {\n return Optional.ofNullable(tournamentCache.get(id))\n .orElseThrow(TournamentNotFoundException::new);\n }", "public IStatus getResult();", "public boolean isComplete();", "com.lvl6.proto.EventQuestProto.QuestAcceptResponseProto.QuestAcceptStatus getStatus();", "public TaskStatus getStatus(String requestId) {\r\n TaskStatus toReturn = new TaskStatus();\r\n if (null == requestId || 0 == requestId.length()) {\r\n setError(\"APIL_0100\", \"argument's not valid.\");\r\n return toReturn;\r\n }\r\n\r\n String[] paramFields = {};\r\n SocketMessage request = new SocketMessage(\"admin\", \"status\",\r\n SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, requestId, paramFields);\r\n\r\n SocketMessage response = handleMessage(request);\r\n\r\n if (!isSuccessful(response)) {\r\n if (\"\".equals(response.getErrorCode())) {\r\n setError(\"APIL_0211\", \"couldn't get task status: task_id=\" + requestId);\r\n } else {\r\n wrapError(\"APIL_0211\", \"couldn't get task status: task_id=\" + requestId);\r\n }\r\n toReturn.setStatus(EnumTaskStatus.FAILED);\r\n toReturn.setErrorCode(getErrorCode());\r\n toReturn.setMessage(getErrorMessage());\r\n return toReturn;\r\n }\r\n\r\n toReturn.setRequestId(response.getRequestId());\r\n toReturn.setStatus(response.getValue(\"task_status\").trim());\r\n toReturn.setTaskType(response.getValue(\"task_type\").trim());\r\n toReturn.setPercent(Tools.parseDouble(response.getValue(\"percentage\")));\r\n toReturn.setStartTime(Tools.parseTime(response.getValue(\"start_time\")));\r\n toReturn.setEndTime(Tools.parseTime(response.getValue(\"end_time\")));\r\n toReturn.setEstimatedTime(Tools.parseTime(response.getValue(\"estimated_time\")));\r\n toReturn.setMessage(response.getValue(\"message\"));\r\n toReturn.setErrorCode(response.getValue(\"error_code\"));\r\n\r\n return toReturn;\r\n }", "private static void checkStatus() {\n\r\n\t\tDate date = new Date();\r\n\t\tSystem.out.println(\"Checking at :\"+date.toString());\r\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tresponse = sendGET(GET_URL_COVAXIN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//System.out.println(response.toString());\r\n\t\tArrayList<Map> res = formatResponse(response);\r\n\r\n\t\tres = checkAvailability(res);\r\n\t\tif(res.size()>0)\r\n\t\t\tnotifyUser(res);\r\n\t\t//System.out.println(emp.toString());\r\n\t}", "public Boolean wait(Integer id, Integer timeoutPeriod) throws DynamicCallException, ExecutionException {\n return (Boolean)call(\"wait\", id, timeoutPeriod).get();\n }", "public WorkerVO inquireWorker(String id) {\n\t\tSystem.out.println(\"Worker is inquired\");\n\t\treturn null;\n\t}", "public boolean checkDone() {\n return this.isDone;\n }", "public abstract PendingResult<Status> mo27382b();", "ResolvableStatus getResolvableStatus();", "public List<Request> viewResolved(int id) {\n\t\tList<Request> list = null;\n\t\tRequest request = null;\n\t\t\t\t\n\t\ttry {\n\t\t\tlist = new ArrayList<Request>();\n\n\t\t\tString sql = \"select * from requests \"+\n\t\t\t\t \"where employee_id = \"+id+\" and status = 'resolved'\";\n\t\t\t\t\t\n\n\t\t\tConnection connection = DBConnectionUtil.getConnection();\n\t\t\tStatement statement = connection.createStatement();\n\t\t\tResultSet resultSet = statement.executeQuery(sql);\n\n\t\t\twhile(resultSet.next()) {\n\t\t\t\trequest = new Request();\n\t\t\t\trequest.setId(resultSet.getInt(\"request_id\"));\t\t\t\t\t\t\n\t\t\t\trequest.setEmpId(resultSet.getInt(\"employee_id\"));\n\t\t\t\trequest.setMgrId(resultSet.getInt(\"manager_id\"));\n\t\t\t\trequest.setRequestAmount(resultSet.getInt(\"request_amount\"));\n\t\t\t\trequest.setExpenseDate(resultSet.getString(\"expense_date\"));\n\t\t\t\trequest.setStatus(resultSet.getString(\"status\"));\n\t\t\t\trequest.setDecision(resultSet.getString(\"decision\"));\n\t\t\t\tlist.add(request);\n\t\t\t}\n\t\t\t\treturn list;\n\t\t\t}\n\t\t\tcatch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\treturn null;\n\t}", "@WorkerThread\n public static void validateExamStatus(int examId, Context context) {\n ExamStatus status = LearnJavaDatabase.getInstance(context).getExamDao().queryExamStatus(examId);\n if(status == null) { //not found in the database\n @Status final int DEF_STATUS = Status.LOCKED;\n //both last_started and top_score are marked with exam never started\n ExamStatus newStatus = new ExamStatus(examId, DEF_STATUS, EXAM_NEVER_STARTED, EXAM_NEVER_STARTED);\n LearnJavaDatabase.getInstance(context).getExamDao().addExamStatus(newStatus); //add to database\n }\n }", "public Boolean wait(Integer id, Integer timeoutPeriod) throws CallError, InterruptedException {\n return (Boolean)service.call(\"wait\", id, timeoutPeriod).get();\n }", "void queryDone(String queryId);", "private boolean checkCompletedCourse(int id) {\r\n boolean x = false;\r\n for (Registration registration : completeCourses) {\r\n if (id == registration.getCourseId()) {\r\n x = true;\r\n break;\r\n }\r\n x = false;\r\n }\r\n return x;\r\n }", "com.polytech.spik.protocol.SpikMessages.Status getStatus();", "com.polytech.spik.protocol.SpikMessages.Status getStatus();", "public Future<Boolean> isRunning(Integer id) throws DynamicCallException, ExecutionException {\n return call(\"isRunning\", id);\n }", "boolean isComplete();", "boolean isComplete();", "@Override\n\tpublic LotteryTicket retrieveLotteryTicketStatus(int ticketId) {\n\t\tLotteryTicket ticket = getLotteryTicket(ticketId);\n\n\t\t// Check if ticket status is checked or not\n\t\tif (ticket.isTicketStatusChecked()) {\n\t\t\tthrow new InternalServerError(\"This ticket is already checked\");\n\t\t} else {\n\t\t\t// Update the ticket object\n\t\t\tticket.setTicketStatusChecked(true);\n\t\t\ttry {\n\t\t\t\t// Save and return ticket response\n\t\t\t\treturn lotteryTicketRepository.save(ticket);\n\t\t\t} catch (Exception exception) {\n\t\t\t\tLOGGER.error(\"Something went wrong in retrieveLotteryTicketStatus\" + exception);\n\t\t\t\tthrow new InternalServerError(\"Something went wrong in retrieving the lottery ticket status\");\n\t\t\t}\n\t\t}\n\t}", "public Future<Void> wait(Integer id) throws DynamicCallException, ExecutionException{\n return call(\"wait\", id);\n }", "public boolean isSetStatusQuest() {\n\t\treturn org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STATUSQUEST_ISSET_ID);\n\t}", "@CrossOrigin\n\t@RequestMapping(value=\"/getStatus\", method= RequestMethod.POST)\n\tpublic JSONObject getStatus(@RequestBody StatusRequestBody requestBody, @RequestHeader HttpHeaders headers){\n\t\tHeadersManager.setHeaders(headers);\n\t\ttry {\n\t\t\tString jobId = requestBody.jobId;\n\t\t\t \n\t\t SimpleResultSet res = new SimpleResultSet();\n\t\t LoggerRestClient logger = LoggerRestClient.getInstance(log_prop);\n\t \tLoggerRestClient.easyLog(logger, \"Status Service\", \"getStatus start\", \"JobId\", jobId);\n\t \tLocalLogger.logToStdOut(\"Status Service getStatus start JobId=\" + jobId);\n\t\n\t \t\n\t\t try {\n\t\t \t\n\t\t \tJobTracker tracker = this.getTracker();\n\t\t \n\t\t\t res.addResult(SimpleResultSet.STATUS_RESULT_KEY, String.valueOf(tracker.getJobStatus(jobId)));\n\t\t\t res.setSuccess(true);\n\t\t\t \n\t\t } catch (Exception e) {\n\t\t \tres.setSuccess(false);\n\t\t \tres.addRationaleMessage(SERVICE_NAME, \"getStatus\", e);\n\t\t\t LoggerRestClient.easyLog(logger, \"Status Service\", \"getStatus exception\", \"message\", e.toString());\n\t\t\t LocalLogger.logToStdOut(\"Status Service getStatus exception message=\" + e.toString());\n\t\t } \n\t\t \n\t\t return res.toJson();\n\t\t \n\t\t} finally {\n\t \tHeadersManager.clearHeaders();\n\t }\n\t}", "Status showStatus(long id) throws TwitterException;", "public boolean isDone()\r\n/* 69: */ {\r\n/* 70:106 */ return isDone0(this.result);\r\n/* 71: */ }", "boolean completed();", "public void requestDone(Request request, boolean isSuccessful);", "public boolean getResponseStatus();", "public abstract boolean isCompleted();", "@Override\n public <V> HugeTask<V> waitUntilTaskCompleted(Id id)\n throws TimeoutException {\n long timeout = this.graph.configuration()\n .get(CoreOptions.TASK_WAIT_TIMEOUT);\n return this.waitUntilTaskCompleted(id, timeout, 1L);\n }", "public void action (int rsid, int id, LocalDateTime ld) {\n\t\tTR_Request tr = adao.getRequestById(id);\n\t\tRS rs = RS.valueOfStatusCode(rsid);\n\t\tadao.setApprovalStatus(rs, tr, ld);\n\t\tLogThis.LogIt(\"info\", \"Request \"+ id + \" was changed to status \" + rs.toString());\n\t\t\n\t}", "protected void done() {\n logoPanel.stop();\n qtf.setCursor(normalCursor);\n searchButton.setEnabled(true);\n\n boolean isStatusOK = false;\n try {\n isStatusOK = get();\n } catch (Exception e) {\n }\n\n if (isStatusOK) {\n Thread tableFill = new Thread(msb_qtm);\n tableFill.start();\n\n try {\n tableFill.join();\n } catch (InterruptedException iex) {\n logger.warn(\"Problem joining tablefill thread\");\n }\n\n synchronized (this) {\n Thread projectFill = new Thread(\n qtf.getProjectModel());\n projectFill.start();\n try {\n projectFill.join();\n } catch (InterruptedException iex) {\n logger.warn(\"Problem joining projectfill thread\");\n }\n\n qtf.initProjectTable();\n }\n\n msb_qtm.setProjectId(\"All\");\n qtf.setColumnSizes();\n qtf.resetScrollBars();\n logoPanel.stop();\n qtf.setCursor(normalCursor);\n\n if (queryTask != null) {\n queryTask.cancel();\n }\n\n qtf.setQueryExpired(false);\n String queryTimeout = System.getProperty(\n \"queryTimeout\");\n System.out.println(\"Query expiration: \"\n + queryTimeout);\n Integer timeout = new Integer(queryTimeout);\n if (timeout != 0) {\n // Conversion from minutes of milliseconds\n int delay = timeout * 60 * 1000;\n queryTask = OMPTimer.getOMPTimer().setTimer(\n delay, infoPanel, false);\n }\n }\n }", "com.google.rpc.Status getStatus();", "com.google.rpc.Status getStatus();", "private static boolean hasErrFound(final int id) {\r\n\t\tsynchronized (workerLock) {\r\n\t\t\treturn (errFoundByThread == id);\r\n\t\t}\r\n\t}", "@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic Record findIncompletedRecordById(final String testId, String tokenId, String source){\n\t\tList<Record> temp = null;\n\n\t\ttry{\n\t\t\tCriteria criteria = dao.getSession().createCriteria(Record.class);\n\t\t\tcriteria.add(Restrictions.eq(\"test.id\", testId));\n\t\t\tif (tokenId!=null && tokenId.length()>0){\n\t\t\t\tcriteria.add(Restrictions.eq(\"tokenId\", tokenId));\n\t\t\t}\n\t\t\tif (source!=null && source.length()>0){\n\t\t\t\tcriteria.add(Restrictions.eq(\"source\", source));\n\t\t\t}\n\t\t\tcriteria.add(Restrictions.isNull(\"endTime\"));\n\t\t\tcriteria.add(Restrictions.isNotNull(\"startTime\"));\n\t\t\tcriteria.addOrder(Order.desc(\"startTime\"));\n\t\t\t//criteria.setMaxResults(1);\n\n\t\t\ttemp = criteria.list();\n\t\t\tif (temp != null && temp.size()>0){\n\t\t\t\t//update all subsequent as incompleted\n\t\t\t\tfor (int i=1; i< temp.size(); i++){\n\t\t\t\t\ttemp.get(i).setEndTime(new Timestamp(System.currentTimeMillis()));\n\t\t\t\t\ttemp.get(i).setResult(Record.Result.Other);\n\t\t\t\t\tdao.update(temp.get(i));\n\t\t\t\t}\n\t\t\t\treturn temp.get(0);\n\t\t\t}\n\t\t} catch (Exception e){\n\n\t\t\tlog.error(\"Error searching for incomplete records, \", e);\n\n\t\t}\n\t\treturn null;\n\t}", "public List<Reimbursements> viewResolvedRequests(int id) {\r\n\t\tList<Reimbursements> resolved = rs.getReimByStatnID(id, \"approved\");\r\n\t\tint i = 0;\r\n\t\tfor (Reimbursements r : resolved) {\r\n\t\t\tSystem.out.println(i + \") Resolved Reimbursements: \" + r);\r\n\t\t}\r\n\t\treturn resolved;\r\n\t}", "public PendingRequest getPendingRequest(final String id);", "protected void awaitPending(IdentityHolder<NamedCache> cacheId)\n {\n Object oPending = f_mapPending.get(cacheId);\n\n if (oPending != null)\n {\n synchronized (oPending)\n {\n if (oPending == f_mapPending.get(cacheId))\n {\n try\n {\n Blocking.wait(oPending);\n }\n catch (InterruptedException e)\n {\n // ignore\n }\n }\n }\n }\n }", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();" ]
[ "0.56896687", "0.55527496", "0.5443882", "0.54084814", "0.5354779", "0.5316078", "0.5300526", "0.5289856", "0.5258303", "0.5257337", "0.5211519", "0.5211519", "0.5211519", "0.5211519", "0.51987803", "0.5197523", "0.51882625", "0.51405436", "0.51296353", "0.5092815", "0.50781447", "0.50709957", "0.5069275", "0.5058644", "0.5050692", "0.50490975", "0.5046477", "0.5044101", "0.5033697", "0.5033697", "0.5023172", "0.50020653", "0.500175", "0.49844405", "0.49583328", "0.49551007", "0.49551007", "0.49509388", "0.49499863", "0.49449733", "0.4936757", "0.4934163", "0.4915489", "0.49023288", "0.4894297", "0.48879844", "0.48826388", "0.48807952", "0.48783717", "0.48743725", "0.48717707", "0.48646018", "0.48514885", "0.48439762", "0.48439005", "0.48436603", "0.48423013", "0.4839168", "0.4839168", "0.48376957", "0.48313263", "0.48313263", "0.4830887", "0.48285064", "0.48270717", "0.48255986", "0.48204848", "0.48197007", "0.48191106", "0.48175612", "0.48172873", "0.4799242", "0.47921437", "0.47862527", "0.47852007", "0.47830206", "0.47830206", "0.47786528", "0.4771278", "0.47676522", "0.4767302", "0.47621804", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095", "0.4748095" ]
0.54626393
2
Close the underlying resources that are being held by this connector. Clients MUST call this when they are done with a connector or else there may be resource leaks.
public void close() { debug(); if (isDebug == true) { log.debug("=== CLOSE === "); } try { if (connection != null) { log.debug("Antes Connection Close"); connection.close(); log.debug("Pos Connection Close"); } if (m_dbConn != null) { m_dbConn.close(); } if (isDebug == true) { log.debug("Connection Close"); } } catch (SQLException e) { log.debug("ERRO Connection Close"); e.printStackTrace(); } connection = null; m_dbConn = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void destroy() {\n super.destroy();\n if(connector != null) {\n connector.close();\n }\n }", "@Override\n public void close()\n {\n this.disconnect();\n }", "public void close()\n {\n getConnectionManager().shutdown();\n }", "void close()\n {\n DisconnectInfo disconnectInfo = connection.getDisconnectInfo();\n if (disconnectInfo == null)\n {\n disconnectInfo = connection.setDisconnectInfo(\n new DisconnectInfo(connection, DisconnectType.UNKNOWN, null, null));\n }\n\n // Determine if this connection was closed by a finalizer.\n final boolean closedByFinalizer =\n ((disconnectInfo.getType() == DisconnectType.CLOSED_BY_FINALIZER) &&\n socket.isConnected());\n\n\n // Make sure that the connection reader is no longer running.\n try\n {\n connectionReader.close(false);\n }\n catch (final Exception e)\n {\n debugException(e);\n }\n\n try\n {\n outputStream.close();\n }\n catch (final Exception e)\n {\n debugException(e);\n }\n\n try\n {\n socket.close();\n }\n catch (final Exception e)\n {\n debugException(e);\n }\n\n if (saslClient != null)\n {\n try\n {\n saslClient.dispose();\n }\n catch (final Exception e)\n {\n debugException(e);\n }\n finally\n {\n saslClient = null;\n }\n }\n\n debugDisconnect(host, port, connection, disconnectInfo.getType(),\n disconnectInfo.getMessage(), disconnectInfo.getCause());\n if (closedByFinalizer && debugEnabled(DebugType.LDAP))\n {\n debug(Level.WARNING, DebugType.LDAP,\n \"Connection closed by LDAP SDK finalizer: \" + toString());\n }\n disconnectInfo.notifyDisconnectHandler();\n }", "protected void close() {\n\t\tthis.connection.close();\n\t\tthis.connection = null;\n\t}", "public void close() {\n try {\n jmxc.close();\n } catch (IOException e) {\n log.error(\"Unable to close JMX connector\", e);\n }\n log.info(\"JMX connector successfully closed\");\n }", "@Override\n public synchronized void close() throws IOException {\n disconnect(false);\n }", "@Override\n public synchronized void close() {\n disconnect();\n mClosed = true;\n }", "public void close() {\n if (mLeakedException != null) {\n getConnectionManager().shutdown();\n mLeakedException = null;\n }\n }", "private void closeConnection() {\n\t\t_client.getConnectionManager().shutdown();\n\t}", "public void close() {\n\t\ttry {\n\t\t\t_inputStream.close();\n\t\t\t_outputStream.close();\n\t\t\t_socket.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void closeConnection () {\n setConnection (null);\n }", "private void close() {\r\n try {\r\n if (m_in != null) {\r\n m_in.close();\r\n }\r\n if (m_out != null) {\r\n m_out.close();\r\n }\r\n if (m_socket != null) {\r\n m_socket.close();\r\n }\r\n } catch (IOException e) {\r\n throw new WrappedRuntimeException(e);\r\n }\r\n }", "public synchronized void close() {\n\t\t/**\n\t\t * DISCONNECT FROM SERVER\n\t\t */\n\t\tsrvDisconnect();\n\t}", "public void close() {\n connection.close();\n running = false;\n }", "public void close() {\n if (closed) {\n return;\n }\n try {\n disconnect();\n } catch (Exception e) {\n throw new IOError(e);\n }\n closed = true;\n }", "private void close() {\n\t\ttry {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog(e);\n\t\t} finally {\n\t\t\tisConnected = false;\n\t\t}\n\t}", "public void close() {\n try {\n socket.close();\n outputStream.close();\n inputStream.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void disconnect() {\n\n try {\n if (inputStream != null) {\n inputStream.close();\n }\n\n if (outputStream != null) {\n outputStream.close();\n }\n\n if (socket != null ) {\n socket.close();\n connected = socket.isClosed();\n }\n } catch (IOException e) {\n logger.error(\"S7Client error [disconnect]: \" + e);\n }\n }", "public void close() {\n\t\ttry {\n\t\t\tif (resultSet != null)\n\t\t\t\tresultSet.close();\n\t\t\tif (connect != null)\n\t\t\t\tconnect.close();\n\t\t} catch (Exception e) {\n\t\t}\n\t}", "public void close() {\n this.consoleListenerAndSender.shutdownNow();\n this.serverListenerAndConsoleWriter.shutdownNow();\n try {\n this.getter.close();\n this.sender.close();\n this.socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void close()\n\t{\n\t\ttry { stream.close(); } catch(Exception ex1) {}\n\t\ttry { channel.close(); } catch(Exception ex2) {}\n\t}", "private void close()\n {\n try\n {\n if (outputStream != null)\n {\n outputStream.close();\n }\n } catch (Exception e)\n {\n\n }\n try\n {\n if (inputStream != null)\n {\n inputStream.close();\n }\n } catch (Exception e)\n {\n\n }\n try\n {\n if (socket != null)\n {\n socket.close();\n }\n } catch (Exception e)\n {\n\n }\n }", "protected void finalize() {\n this.asClient.close();\n this.asClient = null;\n }", "private void closeConnection() {\n try {\n fromClient.close();\n toClient.close();\n client.close();\n } catch (IOException e) {\n System.err.println(\"Unable to close connection:\" + e.getMessage());\n }\n }", "@Override\r\n\tpublic void close() throws IOException {\r\n\t\t List<Connection> connections = new ArrayList<>();\r\n\t\t connections.addAll(busyConnection);\r\n\t\t connections.addAll(freeConnection);\r\n\t\t \r\n\t\t for (Connection connection : connections) {\r\n\t\t\ttry {\r\n\t\t\t\tif(connection.isClosed()== false){\r\n\t\t\t\t\tconnection.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tlogger.error(ErrorMessageDAO.ERROR_SQL_CLOSE + e);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public void close() {\n\t\ttry {\n\t\t\tif (resultSet != null) {\n\t\t\t\tresultSet.close();\n\t\t\t}\n\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.close();\n\t\t\t}\n\n\t\t\tif (connect != null) {\n\t\t\t\tconnect.close();\n\t\t\t}\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}", "public void close() {\n try {\n connect.close();\n } catch (SQLException ex) {\n System.err.println(\"Error while closing db connection\" + ex.toString());\n }\n }", "public void closeConnection() {\n try {\n socket.close();\n oStream.close();\n } catch (Exception e) { }\n }", "public void close() throws BadDescriptorException, IOException {\n+ // tidy up\n+ finish();\n+\n+ // if we're the last referrer, close the channel\n+ if (refCounter.get() <= 0) {\n+ channel.close();\n+ }", "public void close(){\r\n\t\tif(managedOutputSocket != null) managedOutputSocket.close();\r\n\t\tmanagedOutputSocket = null;\r\n\t\tsuper.close();\r\n\t}", "public synchronized void close() {}", "public void close() {\n // Don't close anything, leave the GeoPackage connection open\n }", "public void close() {\n dispose();\n }", "private void closeConnection() {\n\t\t\tSystem.out.println(\"\\nTerminating connection \" + myConID + \"\\n\");\n\t\t\ttry {\n\t\t\t\toutput.close(); // close output stream\n\t\t\t\tinput.close(); // close input stream\n\t\t\t\tconnection.close(); // close socket\n\t\t\t} catch (IOException ioException) {\n\t\t\t\tSystem.out.println(\"Exception occured in closing connection\"\n\t\t\t\t\t\t+ ioException);\n\t\t\t}\n\t\t}", "public void close() {\n wrapped.close();\n }", "public void dispose() {\r\n\t\tclose();\r\n\t}", "public void close() throws IOException{\n this.channel.close();\n this.connection.close();\n }", "private void close() {\n try {\n if (reader != null) {\n this.reader.close();\n }\n if (writer != null) {\n this.writer.close();\n }\n }\n catch (IOException e) {\n log.error(e);\n log.debug(Constants.STREAM_IS_CLOSED);\n }\n }", "public void closeConnections() {\r\n\t\t\ttry {\r\n\t\t\t\toutStream.close();\r\n\t\t\t\tinStream.close();\r\n\t\t\t\tpeerToPeerSocket.close();\r\n\t\t\t\t//System.out.println(\"Connection closing...\");\r\n\t\t\t}\r\n\t\t\tcatch(Exception e) {\r\n\t\t\t\tSystem.out.println(\"Couldn't close connections...\");\r\n\t\t\t}\r\n\t\t}", "@Override public abstract void close();", "public void closeConnection() {\r\n if (getConnection() != null && StringUtil.isNotBlank(config.getDataSource())\r\n /*&& this.conn.getConnection() instanceof PooledConnection */) {\r\n LOG.ok(\"Close the pooled connection\");\r\n dispose();\r\n }\r\n }", "public void close() throws IOException {\n /*\n * Set m_iport to 0, in order to quit out of the while loop\n * in the receiver thread.\n */\n\tint save_iport = m_iport;\n\n\tm_iport = 0;\n\n synchronized (closeLock) {\n if (open) {\n /*\n * Reset open flag early to prevent receive0 executed by\n * concurrent thread to operate on partially closed\n * connection\n */\n open = false;\n\n close0(save_iport, connHandle, 1);\n\n setMessageListener(null);\n\n /*\n * Reset handle and other params to default\n * values. Multiple calls to close() are allowed\n * by the spec and the resetting would prevent any\n * strange behaviour.\n */\n connHandle = 0;\n host = null;\n m_mode = 0;\n\n /*\n * Remove this connection from the list of open\n * connections.\n */\n int len = openconnections.size();\n for (int i = 0; i < len; i++) {\n if (openconnections.elementAt(i) == this) {\n openconnections.removeElementAt(i);\n break;\n }\n }\n\n open_count--;\n }\n }\n }", "public void close() {}", "public void close() {\n try {\n closeConnection(socket);\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "public void close() {\r\n\t\ttry {\r\n\t\t\tif (resultSet != null) {\r\n\t\t\t\tresultSet.close();\r\n\t\t\t}\r\n\r\n\t\t\tif (statement != null) {\r\n\t\t\t\tstatement.close();\r\n\t\t\t}\r\n\r\n\t\t\tif (connect != null) {\r\n\t\t\t\tconnect.close();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t}", "public void close() {\r\n\t\ttry {\r\n\t\t\tif (resultSet != null) {\r\n\t\t\t\tresultSet.close();\r\n\t\t\t}\r\n\r\n\t\t\tif (statement != null) {\r\n\t\t\t\tstatement.close();\r\n\t\t\t}\r\n\r\n\t\t\tif (connect != null) {\r\n\t\t\t\tconnect.close();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t}", "public void closeConnection(){\r\n\t\t_instance.getServerConnection().logout();\r\n\t}", "@Override\n\tpublic void close() {\n\t\t\n\t\t\t\n\t\t\t\n\t\n\t\tif(flightGear!=null)\n\t\t\ttry {\n\t\t\t\tflightGear.getInputStream().close();\n\t\t\t\tflightGear.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\tif(server!=null)\n\t\t\ttry {\n\t\t\t\tserver.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\tif(telnetConnection!=null)\n\t\t\ttry {\n\t\t\t\ttelnetConnection.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t}\n\t}", "void disconnect() {\n connector.disconnect();\n // Unregister from activity lifecycle tracking\n application.unregisterActivityLifecycleCallbacks(activityLifecycleTracker);\n getEcologyLooper().quit();\n }", "@Override\n public synchronized void close() {\n mOpenConnections--;\n if (mOpenConnections == 0) {\n super.close();\n }\n }", "@Override\n public synchronized void close() {\n mOpenConnections--;\n if (mOpenConnections == 0) {\n super.close();\n }\n }", "public void dispose() {\n\t\tsocket.close();\n\t}", "@Override\n public void releaseResources() {\n if (cluster != null) {\n cluster.close();\n }\n if (cpds != null) {\n cpds.close();\n }\n }", "public void close() throws IOException {\n try {\n _connection.close();\n } catch (SQLException e) {\n String msg = \"Failed to close database connection.\";\n _logger.warn(msg, e);\n }\n super.close(); //close the /dev/null that ncml gave us\n }", "final public void closeConnection() throws IOException {\n\n readyToStop = true;\n closeAll();\n }", "@Override\n public void close() {\n }", "@Override\n public void close() {\n }", "@Override\n public void close() throws IOException {\n inputMessageStream.close();\n outputMessageStream.close();\n socket.close();\n }", "public void close() {\n\t\tshutdownClient(clientRef.get());\n\t}", "public void disconnect() {\n DatabaseGlobalAccess.getInstance().getEm().close();\n DatabaseGlobalAccess.getInstance().getEmf().close();\n }", "public void close() {\r\n channel.close();\r\n }", "protected void disconnect() {\n try {\n if (connection != null) {\n connection.close();\n }\n connection = null;\n queryRunner = null;\n thread = null;\n queries = null;\n } catch (SQLException ex) {\n Logger.getGlobal().log(Level.WARNING, ex.getMessage(), ex);\n }\n }", "private void close() {\n\t\tif (socketChannel != null) {\n\t\t\ttry {\n\t\t\t\tif (in != null) {\n\t\t\t\t\tin.close();\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.log(Level.SEVERE, \"Close in stream \", e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (out != null) {\n\t\t\t\t\tout.close();\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.log(Level.SEVERE, \"Close out stream \", e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tsocketChannel.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tlog.log(Level.SEVERE, \"Can't close socket channel\", ex);\n\t\t\t}\n\n\t\t}\n\t\t//Defender.stopConnection();\n\t}", "@Override\n public synchronized void forceClose() throws IOException {\n disconnect(true);\n }", "public void close() {\n try {\n inputStream.close();\n } catch(IOException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - could not close the socket's input stream!\");\n e.printStackTrace();\n System.exit(1);\n }\n\n try {\n outputStream.close();\n } catch(IOException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - could not close the socket's output stream!\");\n e.printStackTrace();\n System.exit(1);\n }\n\n try {\n commSocket.close();\n } catch(IOException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - could not close the communication socket!\");\n e.printStackTrace();\n System.exit(1);\n }\n }", "@Override\r\n\tpublic void disconnect() throws Exception\r\n\t\t{\r\n\t\treader.close();\r\n\t\toutputStream.close();\r\n\t\tport.close();\r\n\t\t}", "@Override\n public void close() {\n }", "public void close() {\n\t\ttry {\n\t\t\tif(mMessageProducer != null) {\n\t\t\t\tmMessageProducer.close();\n\t\t\t}\n\t\t\tif(mMessageConsumer != null) {\n\t\t\t\tmMessageConsumer.close();\n\t\t\t}\n\t\t\tif(mSession != null) {\n\t\t\t\tmSession.close();\n\t\t\t}\n\t\t\tif(mConnection != null) {\n\t\t\t\tmConnection.close();\n\t\t\t}\n\t\t} catch (JMSException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void closeConnection() {\n try {\n if (connection != null) {\n connection.close();\n connection = null;\n }\n } catch (Exception e) {\n System.out.print(e.getMessage());\n }\n }", "private synchronized void closeConnection() {\n/* 212 */ if (this.conn != null) {\n/* 213 */ this.log.debug(\"Closing connection\");\n/* */ try {\n/* 215 */ this.conn.close();\n/* 216 */ } catch (IOException iox) {\n/* 217 */ if (this.log.isDebugEnabled()) {\n/* 218 */ this.log.debug(\"I/O exception closing connection\", iox);\n/* */ }\n/* */ } \n/* 221 */ this.conn = null;\n/* */ } \n/* */ }", "public void dispose() {\n mInputChannel.dispose();\n try {\n mHost.dispose();\n } catch (RemoteException e) {\n e.rethrowFromSystemServer();\n }\n }", "@Override\n void close();", "@Override\n void close();", "@Override\n void close();", "@Override\n void close();", "private void disconnect() {\n\n if (inStream != null) {\n try {inStream.close();} catch (Exception e) { e.printStackTrace(); }\n }\n\n if (outStream != null) {\n try {outStream.close();} catch (Exception e) { e.printStackTrace(); }\n }\n\n if (socket != null) {\n try {socket.close();} catch (Exception e) { e.printStackTrace(); }\n }\n }", "private void closeConnection()\n\t{\n\t\tif(result != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tresult.close();\n\t\t\t\tresult = null;\n\t\t\t}\n\t\t\tcatch(Exception ignore){}\n\t\t}\n\t\tif(con != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tcon.close();\n\t\t\t\tcon = null;\n\t\t\t}\n\t\t\tcatch(Exception ignore){}\n\t\t}\n\t}", "public void close() {\n\t\tcloseConnection();\n\t\tcloseStatement();\n\t\tcloseResultSet();\n\t}", "public void close() {\n\t\tchannel.close();\n\t}", "public synchronized void close(){\n if(connected){\n try{\n socket.close();\n streamIn.close();\n streamOut.close();\n System.out.println(clientID+\": close: socket\"); \n }catch(IOException ioe){\n System.out.println(clientID+\": close: IOException:\"+ioe);\n }\n }else if(isHost){\n try{\n hostSocket.close();\n System.out.println(clientID+\": close: hostSocket\"); \n }catch(IOException ioe){\n System.out.println(clientID+\": close: IOException:\"+ioe);\n }\n }\n }", "private void close() {\n\t\t try {\n\t\t\tresultSet.close();\n\t\t\tstatement.close();\n\t\t\t connect.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \n\t }", "private void close() {\n/* */ try {\n/* 253 */ if (this.dataReader != null) {\n/* 254 */ this.dataReader.close();\n/* 255 */ this.dataReader = null;\n/* */ } \n/* 257 */ } catch (SQLException e) {\n/* 258 */ logger.log(Level.SEVERE, (String)null, e);\n/* */ } \n/* */ try {\n/* 261 */ if (this.pstmt != null) {\n/* 262 */ this.pstmt.close();\n/* 263 */ this.pstmt = null;\n/* */ } \n/* 265 */ } catch (SQLException e) {\n/* 266 */ logger.log(Level.SEVERE, (String)null, e);\n/* */ } \n/* */ }", "public void shutdown() {\n for (Connection connection : connections) { //Try closing all connections\n closeConnection(connection);\n }\n }", "@Override\r\n @SuppressWarnings(\"empty-statement\")\r\n public void close()\r\n {\r\n curDb_ = null;\r\n curConnection_ = null;\r\n try\r\n {\r\n for(Map.Entry<Db_db, Connection> entry: connections_.entrySet())\r\n {\r\n entry.getValue().close();\r\n }\r\n }catch(Exception e){};\r\n \r\n connections_.clear();\r\n }", "@Override\r\n\tpublic synchronized void close() {\n\t\tsuper.close();\r\n\t}", "public synchronized void closeAllConnections() {\n\t\tstop();\n\t}", "public void close() {\n if (cleanup != null) {\n cleanup.disable();\n }\n if (isOpen()) {\n forceClose();\n }\n }", "public synchronized void close() throws SQLException {\n/* 204 */ if (this.physicalConn != null) {\n/* 205 */ this.physicalConn.close();\n/* */ \n/* 207 */ this.physicalConn = null;\n/* */ } \n/* */ \n/* 210 */ if (this.connectionEventListeners != null) {\n/* 211 */ this.connectionEventListeners.clear();\n/* */ \n/* 213 */ this.connectionEventListeners = null;\n/* */ } \n/* */ }", "@PreDestroy\n public void close() {\n connectionManagers.values().forEach(ConnectionManager::close);\n }", "public static void close() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t} catch(Exception e) {\n\t\t\tPvPTeleport.instance.getLogger().info(e.getMessage());\n\t\t}\n\n\t}", "public void disconnect() {\n\t\tdisconnect(null);\n\t}", "public void close()\n\t\t{\n\t\t}", "@Override\n public void close() {\n try {\n if (tunnelSession != null) {\n tunnelSession.close();\n tunnelSession = null;\n }\n if (sshclient != null) {\n sshclient.stop();\n sshclient = null;\n }\n } catch (final Throwable t) {\n throw new RuntimeException(t);\n }\n }", "@Override\r\n public void close ()\r\n {\r\n }", "protected void cleanup() {\n try {\n if (_in != null) {\n _in.close();\n _in = null;\n }\n if (_out != null) {\n _out.close();\n _out = null;\n }\n if (_socket != null) {\n _socket.close();\n _socket = null;\n }\n } catch (java.io.IOException e) {\n }\n }", "public void close() {\n\t\t}", "@Override\n void close();", "@Override\n void close();", "private void close() {\n\t\ttry {\n\t\t\tsendCommand(\"end\\n\");\n\t\t\tout.close();\n\t\t\tin.close();\n\t\t\tsocket.close();\n\t\t} catch (MossException e) {\n\t\t} catch (IOException e2) {\n\t\t} finally {\n\t\t\tcurrentStage = Stage.DISCONNECTED;\n\t\t}\n\n\t}" ]
[ "0.7997331", "0.74099255", "0.73258686", "0.7273008", "0.7208843", "0.71478504", "0.7090683", "0.7003705", "0.6998696", "0.6964073", "0.6893352", "0.6891452", "0.68785256", "0.6825776", "0.68071145", "0.67984027", "0.67795336", "0.6751732", "0.6736061", "0.67223", "0.6722273", "0.67119384", "0.6690206", "0.6685278", "0.6672338", "0.66676766", "0.66636926", "0.66568834", "0.6656608", "0.6655424", "0.66409445", "0.66358566", "0.66335994", "0.66335136", "0.6627949", "0.66144943", "0.661279", "0.66076577", "0.660314", "0.65982825", "0.65807253", "0.65789586", "0.6578535", "0.6576774", "0.65714", "0.65648913", "0.65648913", "0.65607363", "0.6552703", "0.65482455", "0.6547317", "0.6547317", "0.6541108", "0.65402555", "0.65400517", "0.65360224", "0.65324587", "0.65324587", "0.6530916", "0.65294945", "0.6526066", "0.65238696", "0.6523356", "0.65231293", "0.65168667", "0.65159714", "0.6503935", "0.6501699", "0.65003526", "0.65001833", "0.6496683", "0.6488854", "0.64886445", "0.64886445", "0.64886445", "0.64886445", "0.64778054", "0.64761835", "0.6472071", "0.647081", "0.6466021", "0.64657384", "0.64652294", "0.64605135", "0.6458819", "0.6452402", "0.6448748", "0.6428803", "0.64275014", "0.6426792", "0.6426754", "0.64258087", "0.64168215", "0.6416778", "0.6416727", "0.6416558", "0.6416089", "0.64158505", "0.64158505", "0.6414171" ]
0.67941415
16
Obtem os dados para acesso ao banco
public void valorConexao() throws Exception { debug(); if (isDebug == true) { log.debug("=== Valor Conexao === "); } URL = config.getString("url"); SENHA = config.getString("password"); USUARIO = config.getString("user"); DRIVE = config.getString("driverClass"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void recogerDatos() {\n\t\ttry {\n\t\t\tusuSelecc.setId(etId.getText().toString());\n\t\t\tusuSelecc.setName(etNombre.getText().toString());\n\t\t\tusuSelecc.setFirstName(etPApellido.getText().toString());\n\t\t\tusuSelecc.setLastName(etSApellido.getText().toString());\n\t\t\tusuSelecc.setEmail(etCorreo.getText().toString());\n\t\t\tusuSelecc.setCustomFields(etAuth.getText().toString());\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n\t\t\tmostrarException(e.getMessage());\n\t\t}\n\t}", "private void cargarDatos()\n {\n // Pantalla carga\n showProgress(true, mView, mProgressView, getContext());\n Comando login = new LoginComando(KPantallas.PANTALLA_PERFIL);\n String email = UtilUI.getEmail(getContext());\n String password = UtilUI.getPassword(getContext());\n login.ejecutar(email,password);\n }", "private void cargarCatalogo() throws DAOException {\n\t\t List<Usuario> usuariosBD = adaptadorUsuario.recuperarTodosUsuarios();\n\t\t for (Usuario u: usuariosBD) \n\t\t\t usuarios.put(u.getTelefono(), u);\n\t}", "private static void validar() throws AcessoException {\r\n BancoDados bd = new BancoDados();\r\n PreparedStatement ps;\r\n ResultSet rs;\r\n String sql;\r\n \r\n try {\r\n //Define String\r\n sql = \"SELECT * FROM Usuario WHERE Login=? AND Senha=? AND XDEAD=FALSE\";\r\n //Prepara gatilho\r\n ps = bd.abrirConexao().prepareStatement(sql);\r\n ps.setString(1, usuario.getLogin());\r\n ps.setString(2, usuario.getSenha());\r\n //Executa e puxa a busca\r\n rs = ps.executeQuery();\r\n //Caso não foi encontrado, informa de erro, e anula admin\r\n if(!rs.next()){\r\n usuario = null;\r\n throw new AcessoException(\"Usuário não encontrado.\");\r\n }\r\n //Fecha conexão\r\n bd.fecharConexao();\r\n } catch(SQLException ex) {\r\n throw new AcessoException(\"Erro de SQL: \" + ex.getMessage() + \".\");\r\n } catch(ConexaoException ex) {\r\n throw new AcessoException(\"Erro de conexão: \" + ex.getMessage() + \".\");\r\n }\r\n }", "private void controladorAtras(Controlador controlador){\n this.contAtras = controlador.getAtras();\n registro.setControlAtras(contAtras);\n login.setControlAtras(contAtras);\n }", "public void almacenoDatos(){\n BaseDatosSecundaria administrador= new BaseDatosSecundaria(this);\n SQLiteDatabase bdsecunadaria= administrador.getWritableDatabase();\n _valuesPedido.put(\"Producto\", this._productoNombre);\n _valuesPedido.put(\"Precio\",this._productoPrecio);\n _valuesPedido.put(\"Cantidad\",this._etAdquirir.getText().toString());\n _valuesPedido.put(\"Vendedor\",this.username);\n _valuesPedido.put(\"Id_Producto\",this._productoId);\n bdsecunadaria.insert(\"DATOS\",null,this._valuesPedido);\n bdsecunadaria.close();\n }", "@Override\n\tpublic void imprimirBancoDados() {\n\t\tSystem.out.println(\"Nome do Banco: \"+nomeBanco);\n\t\tSystem.out.println(\"Tipo do Banco: \"+tipoBanco);\n\t\tSystem.out.println(\"Lista de Metodos: \"+listaMetodos);\n\t}", "private void cargaInfoEmpleado(){\r\n Connection conn = null;\r\n Conexion conex = null;\r\n try{\r\n if(!Config.estaCargada){\r\n Config.cargaConfig();\r\n }\r\n conex = new Conexion();\r\n conex.creaConexion(Config.host, Config.user, Config.pass, Config.port, Config.name, Config.driv, Config.surl);\r\n conn = conex.getConexion();\r\n if(conn != null){\r\n ArrayList<Object> paramsIn = new ArrayList();\r\n paramsIn.add(txtLogin);\r\n QryRespDTO resp = new Consulta().ejecutaSelectSP(conn, IQryUsuarios.NOM_FN_OBTIENE_INFO_USUARIOWEB, paramsIn);\r\n System.out.println(\"resp: \" + resp.getRes() + \"-\" + resp.getMsg());\r\n if(resp.getRes() == 1){\r\n ArrayList<ColumnaDTO> listaColumnas = resp.getColumnas();\r\n for(HashMap<String, CampoDTO> fila : resp.getDatosTabla()){\r\n usuario = new UsuarioDTO();\r\n \r\n for(ColumnaDTO col: listaColumnas){\r\n switch(col.getIdTipo()){\r\n case java.sql.Types.INTEGER:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Integer.parseInt(fila.get(col.getEtiqueta()).getValor().toString().replaceAll(\",\", \"\").replaceAll(\"$\", \"\").replaceAll(\" \", \"\")));\r\n break;\r\n \r\n case java.sql.Types.DOUBLE:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Double.parseDouble(fila.get(col.getEtiqueta()).getValor().toString()));\r\n break;\r\n \r\n case java.sql.Types.FLOAT:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Float.parseFloat(fila.get(col.getEtiqueta()).getValor().toString()));\r\n break;\r\n \r\n case java.sql.Types.DECIMAL:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Float.parseFloat(fila.get(col.getEtiqueta()).getValor().toString()));\r\n break;\r\n \r\n case java.sql.Types.VARCHAR:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"\":fila.get(col.getEtiqueta()).getValor().toString());\r\n break;\r\n \r\n case java.sql.Types.NUMERIC:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"0\":Float.parseFloat(fila.get(col.getEtiqueta()).getValor().toString()));\r\n break;\r\n \r\n default:\r\n usuario.getClass().getField(col.getEtiqueta()).set(usuario\r\n , fila.get(col.getEtiqueta()).getValor()==null?\"\":fila.get(col.getEtiqueta()).getValor().toString());\r\n break;\r\n } \r\n }\r\n }\r\n sesionMap.put(\"UsuarioDTO\", usuario);\r\n }else{\r\n context.getExternalContext().getApplicationMap().clear();\r\n context.getExternalContext().redirect(\"index.xhtml\");\r\n }\r\n }\r\n }catch(Exception ex){\r\n System.out.println(\"Excepcion en la cargaInfoEmpleado: \" + ex);\r\n }finally{\r\n try{\r\n conn.close();\r\n }catch(Exception ex){\r\n \r\n }\r\n }\r\n }", "private void listaContatos() throws SQLException {\n limpaCampos();\n DAOLivro d = new DAOLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\"); \n \n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }", "public void mostrarDados() {\n txtId.setText(\"\" + lista.get(indice).getId());\n txtNome.setText(lista.get(indice).getNome());\n txtEmail.setText(lista.get(indice).getEmail());\n txtSenha.setText(lista.get(indice).getSenha());\n preencheTabela();\n }", "private void listaContatos() throws SQLException {\n limpaCampos();\n BdLivro d = new BdLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\");\n\n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n UsuarioEntity entity = factory.manufacturePojo(UsuarioEntity.class);\r\n em.persist(entity);\r\n dataUsuario.add(entity);\r\n }\r\n for (int i = 0; i < 3; i++) {\r\n CarritoDeComprasEntity entity = factory.manufacturePojo(CarritoDeComprasEntity.class);\r\n if (i == 0 ){\r\n entity.setUsuario(dataUsuario.get(0));\r\n }\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }", "@Override\n public Boleto anular(Boleto boleto) throws CRUDException {\n\n Boleto boletoAnular = em.find(Boleto.class, boleto.getIdBoleto());\n\n Optional op = Optional.ofNullable(boletoAnular);\n\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe el Boleto\");\n }\n\n if (boletoAnular.getEstado().equals(Boleto.Estado.ANULADO)) {\n throw new CRUDException(\"El Boleto ya se encuentra anulado\");\n }\n\n //Si el Boleto esta Emitido se deben dar de bajas su contabilidad\n if (boletoAnular.getEstado().equals(Boleto.Estado.EMITIDO)) {\n System.out.println(\"Anulando Boleto:\" + boleto.getIdBoleto());\n System.out.println(\"Anulando Boleto NotaDebito:\" + boleto.getIdNotaDebito());\n System.out.println(\"Anulando Boleto IngresoCaja :\" + boleto.getIdIngresoCaja());\n boletoAnular.setEstado(Boleto.Estado.ANULADO);\n em.merge(boletoAnular);\n\n //anulamos los asientos contables de los asientos. (AD y CI)\n ejbComprobante.anularAsientosContables(boletoAnular);\n\n //anulamos las transacciones de la nota de debito\n //El proceso de Anular la transaccion de la Nota de Debito\n //llama internamente en el Procedimiento Almacenado a un proceso de anulacion \n //las transacciones del Ingreso de Caja. esto debido a mejorar el proceso y no \n //realizar un doble barrido en la tabla de transacciones de \n //la nota dede\n ejbNotaDebito.anularTransaccion(boletoAnular);\n\n //anulamos las transacciones del Ingreso de Caja\n //ejbIngresoCaja.anularTransaccion(boleto) ;\n // si esta en Pendiente solo debe cambiar el estado\n } else if (boletoAnular.getEstado().equals(Boleto.Estado.PENDIENTE)\n || boletoAnular.getEstado().equals(Boleto.Estado.CANCELADO)) {\n boletoAnular.setEstado(Boleto.Estado.ANULADO);\n em.merge(boletoAnular);\n //Si el Boleto es Void, se puede volver a ingresar el boleto.\n }\n return boletoAnular;\n\n }", "public void guardarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tsetUpperCase();\r\n\t\t\tif (validarForm()) {\r\n\t\t\t\t// Cargamos los componentes //\r\n\r\n\t\t\t\tMap datos = new HashMap();\r\n\r\n\t\t\t\tHis_atencion_embarazada his_atencion_embarazada = new His_atencion_embarazada();\r\n\t\t\t\this_atencion_embarazada.setCodigo_empresa(empresa\r\n\t\t\t\t\t\t.getCodigo_empresa());\r\n\t\t\t\this_atencion_embarazada.setCodigo_sucursal(sucursal\r\n\t\t\t\t\t\t.getCodigo_sucursal());\r\n\t\t\t\this_atencion_embarazada.setCodigo_historia(tbxCodigo_historia\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFecha_inicial(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_inicial.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setCodigo_eps(tbxCodigo_eps.getValue());\r\n\t\t\t\this_atencion_embarazada.setCodigo_dpto(lbxCodigo_dpto\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCodigo_municipio(lbxCodigo_municipio\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setIdentificacion(tbxIdentificacion\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDireccion(tbxMotivo.getValue());\r\n\t\t\t\this_atencion_embarazada.setTelefono(tbxTelefono.getValue());\r\n\t\t\t\this_atencion_embarazada.setSeleccion(rdbSeleccion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setGestaciones(lbxGestaciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPartos(lbxPartos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCesarias(lbxCesarias\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAbortos(lbxAbortos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEspontaneo(lbxEspontaneo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setProvocado(lbxProvocado\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setNacido_muerto(lbxNacido_muerto\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPrematuro(lbxPrematuro\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHijos_menos(lbxHijos_menos\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHijos_mayor(lbxHijos_mayor\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setMalformado(lbxMalformado\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHipertension(lbxHipertension\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFecha_ultimo_parto(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_ultimo_parto.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setCirugia(lbxCirugia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setOtro_antecedente(tbxOtro_antecedente\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setHemoclasificacion(lbxHemoclasificacion\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setRh(lbxRh.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPeso(tbxPeso.getValue());\r\n\t\t\t\this_atencion_embarazada.setTalla(tbxTalla.getValue());\r\n\t\t\t\this_atencion_embarazada.setImc(tbxImc.getValue());\r\n\t\t\t\this_atencion_embarazada.setTa(tbxTa.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc(tbxFc.getValue());\r\n\t\t\t\this_atencion_embarazada.setFr(tbxFr.getValue());\r\n\t\t\t\this_atencion_embarazada.setTemperatura(tbxTemperatura\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setCroomb(tbxCroomb.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setFecha_ultima_mestruacion(new Timestamp(\r\n\t\t\t\t\t\t\t\tdtbxFecha_ultima_mestruacion.getValue()\r\n\t\t\t\t\t\t\t\t\t\t.getTime()));\r\n\t\t\t\this_atencion_embarazada.setFecha_probable_parto(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_probable_parto.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setEdad_gestacional(tbxEdad_gestacional\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setControl(lbxControl.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setNum_control(tbxNum_control\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFetales(lbxFetales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFiebre(lbxFiebre.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido(lbxLiquido.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFlujo(lbxFlujo.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEnfermedad(lbxEnfermedad\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_enfermedad(tbxCual_enfermedad\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setCigarrillo(lbxCigarrillo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlcohol(lbxAlcohol.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_alcohol(tbxCual_alcohol\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDroga(lbxDroga.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_droga(tbxCual_droga.getValue());\r\n\t\t\t\this_atencion_embarazada.setViolencia(lbxViolencia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_violencia(tbxCual_violencia\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setToxoide(lbxToxoide.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setDosis(lbxDosis.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_gestion(tbxObservaciones_gestion\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setAltura_uterina(tbxAltura_uterina\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setCorelacion(chbCorelacion.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setEmbarazo_multiple(chbEmbarazo_multiple.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setTrasmision_sexual(chbTrasmision_sexual.isChecked());\r\n\t\t\t\this_atencion_embarazada.setAnomalia(rdbAnomalia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEdema_gestion(rdbEdema_gestion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPalidez(rdbPalidez.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConvulciones(rdbConvulciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConciencia(rdbConciencia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCavidad_bucal(rdbCavidad_bucal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHto(tbxHto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHb(tbxHb.getValue());\r\n\t\t\t\this_atencion_embarazada.setToxoplasma(tbxToxoplasma.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl1(tbxVdrl1.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl2(tbxVdrl2.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih1(tbxVih1.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih2(tbxVih2.getValue());\r\n\t\t\t\this_atencion_embarazada.setHepb(tbxHepb.getValue());\r\n\t\t\t\this_atencion_embarazada.setOtro(tbxOtro.getValue());\r\n\t\t\t\this_atencion_embarazada.setEcografia(tbxEcografia.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_gestion(rdbClasificacion_gestion\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setContracciones(lbxContracciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setNum_contracciones(lbxNum_contracciones\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHemorragia(lbxHemorragia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido_vaginal(lbxLiquido_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setColor_liquido(tbxColor_liquido\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDolor_cabeza(lbxDolor_cabeza\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setVision(lbxVision.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConvulcion(lbxConvulcion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_parto(tbxObservaciones_parto\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setContracciones_min(tbxContracciones_min.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc_fera(tbxFc_fera.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setDilatacion_cervical(tbxDilatacion_cervical\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setPreentacion(rdbPreentacion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setOtra_presentacion(tbxOtra_presentacion.getValue());\r\n\t\t\t\this_atencion_embarazada.setEdema(rdbEdema.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setHemorragia_vaginal(lbxHemorragia_vaginal\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHto_parto(tbxHto_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHb_parto(tbxHb_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHepb_parto(tbxHepb_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl_parto(tbxVdrl_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih_parto(tbxVih_parto.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_parto(rdbClasificacion_parto\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFecha_nac(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_nac.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setIdentificacion_nac(tbxIdentificacion_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setSexo(lbxSexo.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPeso_nac(tbxPeso_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setTalla_nac(tbxTalla_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setPc_nac(tbxPc_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc_nac(tbxFc_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setTemper_nac(tbxTemper_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setEdad(tbxEdad.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar1(tbxAdgar1.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar5(tbxAdgar5.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar10(tbxAdgar10.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar20(tbxAdgar20.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_nac(tbxObservaciones_nac.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_nac(rdbClasificacion_nac\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setReani_prematuro(chbReani_prematuro\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_meconio(chbReani_meconio\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_respiracion(chbReani_respiracion.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_hipotonico(chbReani_hipotonico\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_apnea(chbReani_apnea\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_jadeo(chbReani_jadeo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_deficultosa(chbReani_deficultosa.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_gianosis(chbReani_gianosis\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_bradicardia(chbReani_bradicardia.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_hipoxemia(chbReani_hipoxemia\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_estimulacion(chbReani_estimulacion\r\n\t\t\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_ventilacion(chbReani_ventilacion.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_comprensiones(chbReani_comprensiones\r\n\t\t\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_intubacion(chbReani_intubacion\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setMedicina(tbxMedicina.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_reani(rdbClasificacion_reani\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setRuptura(lbxRuptura.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTiempo_ruptura(lbxTiempo_ruptura\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido_neo(tbxLiquido_neo\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFiebre_neo(lbxFiebre_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTiempo_neo(lbxTiempo_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCoricamniotis(tbxCoricamniotis\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setIntrauterina(rdbIntrauterina\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setMadre20(lbxMadre20.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlcohol_neo(chbAlcohol_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setDrogas_neo(chbDrogas_neo.isChecked());\r\n\t\t\t\this_atencion_embarazada.setCigarrillo_neo(chbCigarrillo_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setRespiracion_neo(rdbRespiracion_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLlanto_neo(rdbLlanto_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setVetalidad_neo(rdbVetalidad_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTaquicardia_neo(chbTaquicardia_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setBradicardia_neo(chbBradicardia_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setPalidez_neo(chbPalidez_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setCianosis_neo(chbCianosis_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setAnomalias_congenitas(lbxAnomalias_congenitas\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_anomalias(tbxCual_anomalias\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setLesiones(tbxLesiones.getValue());\r\n\t\t\t\this_atencion_embarazada.setOtras_alter(tbxOtras_alter\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_neo(rdbClasificacion_neo\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlarma(tbxAlarma.getValue());\r\n\t\t\t\this_atencion_embarazada.setConsulta_control(tbxConsulta_control\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setMedidas_preventiva(tbxMedidas_preventiva.getValue());\r\n\t\t\t\this_atencion_embarazada.setRecomendaciones(tbxRecomendaciones\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDiagnostico(tbxDiagnostico\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setCodigo_diagnostico(tbxCodigo_diagnostico.getValue());\r\n\t\t\t\this_atencion_embarazada.setTratamiento(tbxTratamiento\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setRecomendacion_alimentacion(tbxRecomendacion_alimentacion\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setEvolucion_servicio(tbxEvolucion_servicio.getValue());\r\n\r\n\t\t\t\tdatos.put(\"codigo_historia\", his_atencion_embarazada);\r\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getText());\r\n\r\n\t\t\t\this_atencion_embarazada = getServiceLocator()\r\n\t\t\t\t\t\t.getHis_atencion_embarazadaService().guardar(datos);\r\n\r\n\t\t\t\tif (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n\t\t\t\t\taccionForm(true, \"modificar\");\r\n\t\t\t\t}\r\n\t\t\t\t/*\r\n\t\t\t\t * else{ int result =\r\n\t\t\t\t * getServiceLocator().getHis_atencion_embarazadaService\r\n\t\t\t\t * ().actualizar(his_atencion_embarazada); if(result==0){ throw\r\n\t\t\t\t * new Exception(\r\n\t\t\t\t * \"Lo sentimos pero los datos a modificar no se encuentran en base de datos\"\r\n\t\t\t\t * ); } }\r\n\t\t\t\t */\r\n\r\n//\t\t\t\tcodigo_historia = his_atencion_embarazada.getCodigo_historia();\r\n\r\n\t\t\t\tMessagebox.show(\"Los datos se guardaron satisfactoriamente\",\r\n\t\t\t\t\t\t\"Informacion ..\", Messagebox.OK,\r\n\t\t\t\t\t\tMessagebox.INFORMATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\r\n\t}", "private void llenarEntidadConLosDatosDeLosControles() {\n clienteActual.setNombre(txtNombre.getText());\n clienteActual.setApellido(txtApellido.getText());\n clienteActual.setDui(txtDui.getText());\n //clienteActual.setNumero(txtNumero.getText());\n //clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n }", "public void guardarDatos() throws Exception {\n\t\ttry {\n\t\t\tFormularioUtil.setUpperCase(groupboxEditar);\n\t\t\tif (validarForm()) {\n\t\t\t\t// Cargamos los componentes //\n\n\t\t\t\tHisc_urgencia_odontologico hisc_urgencia_odontologico = getBean();\n\n\t\t\t\tMap<String, Object> datos = new HashMap<String, Object>();\n\t\t\t\tdatos.put(\"hisc_urgencia_odontologico\",\n\t\t\t\t\t\thisc_urgencia_odontologico);\n\t\t\t\t// datos.put(\"sigvitales\", mcSignosVitales.obtenerSigvitales());\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getValue());\n\t\t\t\tdatos.put(\"admision\", admision);\n\t\t\t\tdatos.put(\"datos_procedimiento\", getProcedimientos());\n\n\t\t\t\tImpresion_diagnostica impresion_diagnostica = macroImpresion_diagnostica\n\t\t\t\t\t\t.obtenerImpresionDiagnostica();\n\t\t\t\tdatos.put(\"impresion_diagnostica\", impresion_diagnostica);\n\n\t\t\t\tgetServiceLocator().getHisc_urgencia_odontologicoService()\n\t\t\t\t\t\t.guardarDatos(datos);\n\n\t\t\t\ttbxAccion.setValue(\"modificar\");\n\t\t\t\tinfoPacientes.setCodigo_historia(hisc_urgencia_odontologico\n\t\t\t\t\t\t.getCodigo_historia());\n\n\t\t\t\tactualizarRemision(admision, getInformacionClinica(), this);\n\t\t\t\tcargarServicios();\n\n\t\t\t\tMensajesUtil.mensajeInformacion(\"Informacion ..\",\n\t\t\t\t\t\t\"Los datos se guardaron satisfactoriamente\");\n\t\t\t}\n\n\t\t} catch (ImpresionDiagnosticaException e) {\n\t\t\tlog.error(e.getMessage(), e);\n\t\t} catch (Exception e) {\n\t\t\tif (!(e instanceof WrongValueException)) {\n\t\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t\t}\n\t\t}\n\t}", "public void popoulaRepositorioUsuarios(){\n Usuario usuario1 = new Usuario();\n usuario1.setUsername(\"EliSilva\");\n usuario1.setEmail(\"elineide.silva.inf@gmail.com\");\n usuario1.setSenha(\"123\");\n usuario1.setNome(\"Elineide Silva\");\n usuario1.setCPF(\"12345678\");\n\n\n\n Usuario usuario2 = new Usuario();\n usuario2.setUsername(\"gustavo\");\n usuario2.setEmail(\"gustavo@gmail.com\");\n usuario2.setSenha(\"12345\");\n usuario2.setNome(\"Gustavo\");\n usuario2.setCPF(\"666\");\n\n Usuario usuario3 = new Usuario();\n usuario1.setUsername(\"peixe\");\n usuario1.setEmail(\"peixe@gmail.com\");\n usuario1.setSenha(\"1111\");\n usuario1.setNome(\"quem dera ser um peixe\");\n usuario1.setCPF(\"1111\");\n\n Usuario usuario4 = new Usuario();\n usuario1.setUsername(\"segundo\");\n usuario1.setEmail(\"2@gmail.com\");\n usuario1.setSenha(\"123\");\n usuario1.setNome(\"Elineide Silva\");\n usuario1.setCPF(\"12345678\");\n\n inserir(usuario1);\n inserir(usuario2);\n inserir(usuario3);\n inserir(usuario4);\n }", "private void enviarRequisicaoAdicionar() {\n servidor.adicionarPalito(nomeJogador);\n atualizarPalitos();\n }", "private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }", "private void todos(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n Connection con = null;//Objeto para la conexion\r\n Statement sentencia = null;//Objeto para definir y ejecutar las consultas sql\r\n ResultSet resultado = null;//Objeto para obtener los resultados de las consultas sql\r\n String sql = \"\";\r\n try {\r\n con = conBD.getCConexion();\r\n //Definición de Sentencia SQL\r\n //sql = \"SELECT semail,sclave,nestado,snombre,sapellido,stelefono,sgenero,nidPerfil FROM usuarios\";\r\n sql = \"SELECT semail,sclave,nestado,usuarios.snombre,sapellido,stelefono,sgenero,nidPerfil,\"\r\n + \"(case WHEN nestado=0 THEN 'Inactivo' ELSE 'Activo' END) AS sestado,\"\r\n + \"(case WHEN sgenero=0 THEN 'Femenino' ELSE 'Masculino' END) AS desgenero,\"\r\n + \"perfiles.snombre \"\r\n + \"FROM usuarios,perfiles \"\r\n + \"where usuarios.nidPerfil=perfiles.idPerfil \"\r\n + \"order by usuarios.snombre\";\r\n\r\n //Ejecutar sentencia\r\n sentencia = con.createStatement();\r\n resultado = sentencia.executeQuery(sql);\r\n\r\n //arreglo donde se gurdaran los usuarios encontrados en la BD\r\n ArrayList Usuarios = new ArrayList();\r\n while (resultado.next()) //si el resultado tiene datos empezar a guardarlos.\r\n {\r\n Usuario e = new Usuario(resultado.getString(1), resultado.getString(2),\r\n resultado.getString(4), resultado.getString(5), resultado.getString(6), resultado.getString(7),\r\n resultado.getInt(8), resultado.getInt(3));\r\n //agregamos las descripciones al objeto.\r\n e.setDescripcionEstado(resultado.getString(9));\r\n e.setDescripcionGenero(resultado.getString(10));\r\n e.setDescripcionPerfil(resultado.getString(11));\r\n //Agregamos el estudiante al arrelo\r\n Usuarios.add(e);\r\n }\r\n // Agregar el arreglo de estudiantes a la solicitud\r\n request.setAttribute(\"usuarios\", Usuarios);\r\n //redirigir la solicitu a la página JSP\r\n request.getRequestDispatcher(\"/ListaUsuarios.jsp\").include(request, response);\r\n //cerrar la conexion\r\n //con.close();\r\n } catch (SQLException ex) {\r\n System.out.println(\"No se ha podido establecer la conexión, o el SQL esta mal formado \" + sql);\r\n request.getRequestDispatcher(\"/Error.jsp\").forward(request, response);\r\n }\r\n }", "@Override\n public void procesarBoleto(Boleto boleto) throws CRUDException {\n\n //1 Obtenemos la configuracion de la contabilidad del boleto de acuerdo a la empresa\n HashMap<String, Integer> parameters = new HashMap<>();\n parameters.put(\"idEmpresa\", boleto.getIdEmpresa());\n\n ContabilidadBoletaje contabilidad = (ContabilidadBoletaje) get(\"ContabilidadBoletaje.find\", ContabilidadBoletaje.class, parameters);\n\n Optional op = Optional.ofNullable(contabilidad);\n if (!op.isPresent()) {\n throw new CRUDException(\"No existe configuracion de Boletaje para la Entidad \" + boleto.getIdEmpresa());\n }\n\n }", "private void saveClientePasajero(Boleto b) throws CRUDException {\n if (b.getIdCliente() != null) {\n ClientePasajero cp = createClientePasajero(b);\n HashMap<String, Object> parpas = new HashMap<>();\n parpas.put(\"idCliente\", b.getIdCliente().getIdCliente());\n parpas.put(\"nombrePasajero\", b.getNombrePasajero());\n\n List search = get(\"ClientePasajero.findPasajero\", ClientePasajero.class, parpas);\n if (search.isEmpty()) {\n cp.setIdClientePasajero(insert(cp));\n }//else ya existe el cliente\n }\n }", "private void cambiarBloqueoCampos(boolean bloqueo) {\n btnNuevoCliente.setEnabled(!bloqueo);\n btnEditarCliente.setEnabled(!bloqueo);\n cmbDatosCliente.setEnabled(!bloqueo);\n btnGuardarCliente.setEnabled(bloqueo);\n btnCancelar.setEnabled(bloqueo);\n\n\n\n for (int i = 0; i < pnlIzquierdo.getComponentCount(); i++) {\n WebPanel pnlIz = (WebPanel) pnlIzquierdo.getComponent(i);\n for (Component c : pnlIz.getComponents()) {\n c.setEnabled(bloqueo);\n }\n }\n for (int i = 0; i < pnlDerecho.getComponentCount(); i++) {\n WebPanel pnlIz = (WebPanel) pnlDerecho.getComponent(i);\n for (Component c : pnlIz.getComponents()) {\n c.setEnabled(bloqueo);\n }\n }\n }", "public void salvarNoBanco() {\n\n try {\n ofertaDisciplinaFacade.save(oferta);\n// JsfUtil.addSuccessMessage(\"Pessoa \" + pessoa.getNome() + \" criado com sucesso!\");\n oferta= null;\n// recriarModelo();\n } catch (Exception e) {\n JsfUtil.addErrorMessage(e, \"Ocorreu um erro de persistência\");\n }\n }", "public void executar() {\n\t\tSystem.out.println(dao.getListaPorNome(\"abacatão\"));\n\t}", "private void populateFields() {\n pedidos = pdao.listaTodos();\n cCliente = new HashSet();\n cEstado = new HashSet();\n cCidade = new HashSet();\n cFornecedor = new HashSet();\n\n for (int i = 0; i < pedidos.size(); i++) {\n cCliente.add(pedidos.get(i).getCliente().getNome());\n cEstado.add(pedidos.get(i).getCliente().getEstado());\n cCidade.add(pedidos.get(i).getCliente().getCidade());\n for (int j = 0; j < pedidos.get(i).getItens().size(); j++) {\n cFornecedor.add(pedidos.get(i).getItens().get(j).getProduto().getFornecedor().getNome());\n }\n }\n\n clientes = new ArrayList<>(cCliente);\n fornecedores = new ArrayList<>(cFornecedor);\n\n Iterator i = cCliente.iterator();\n while (i.hasNext()) {\n jCBCliente.addItem(i.next());\n }\n\n i = null;\n i = cEstado.iterator();\n while (i.hasNext()) {\n jCBEstado.addItem(i.next());\n }\n\n i = null;\n i = cCidade.iterator();\n while (i.hasNext()) {\n jCBCidade.addItem(i.next());\n }\n i = null;\n i = cFornecedor.iterator();\n while (i.hasNext()) {\n jCBFornecedor.addItem(i.next());\n }\n\n }", "public void salvarAluno() {\n \n this.aluno.setName(nome);\n this.aluno.setEmail(email);\n this.aluno.setSenha(senha);\n\n try {\n \n this.alunoServico.persistence(this.aluno);\n \n } catch (CadastroUsuarioException ex) {\n \n //Precisa tratar aqui!\n }\n \n setNome(null);\n setEmail(null);\n setSenha(null);\n\n }", "private void inicializarUsuarios(){\n usuarios = new ArrayList<Usuario>();\n Administrador admin=new Administrador();\n admin.setCodigo(1);\n admin.setApellidos(\"Alcaide Gomez\");\n admin.setNombre(\"Juan Carlos\");\n admin.setDni(\"31000518Z\");\n admin.setPassword(\"admin\");\n admin.setCorreo(\"algojuca@alu.uma.es\");\n admin.setDireccion(\"Sebastian Garrido 54\");\n admin.setNacimiento(new Date(1991, 12, 29));\n admin.setNacionalidad(\"España\");\n admin.setCentro(\"Centro\");\n admin.setSexo(\"Varon\");\n admin.setDespacho(\"301\");\n usuarios.add(admin);\n \n JefeServicio js=new JefeServicio();\n js.setCodigo(2);\n js.setApellidos(\"Gutierrez Cazorla\");\n js.setNombre(\"Ruben\");\n js.setDni(\"75895329k\");\n js.setPassword(\"admin\");\n js.setCorreo(\"algojuca@alu.uma.es\");\n js.setDireccion(\"Sebastian Garrido 54\");\n js.setNacimiento(new Date(1991, 12, 29));\n js.setNacionalidad(\"España\");\n js.setCentro(\"Centro\");\n js.setSexo(\"Varon\");\n js.setDespacho(\"301\");\n \n usuarios.add(js);\n \n \n Ciudadano c =new Ciudadano();\n c.setCodigo(3);\n c.setApellidos(\"Moreno\");\n c.setNombre(\"Maria\");\n c.setDni(\"123\");\n c.setPassword(\"123\");\n c.setCorreo(\"magonmo92@alu.uma.es\");\n c.setDireccion(\"Sebastian Garrido 54\");\n c.setNacimiento(new Date(1992, 01, 12));\n c.setCentro(\"Teatinos\");\n c.setNacionalidad(\"España\");\n c.setSexo(\"Mujer\");\n c.setTelefono(\"999\");\n usuarios.add(c);\n \n //--Administrativos--\n Administrativo a =new Administrativo();\n a.setCodigo(4);\n a.setApellidos(\"Fernández\");\n a.setNombre(\"Salva\");\n a.setDni(\"1234\");\n a.setPassword(\"1234\");\n a.setCorreo(\"safcf@alu.uma.es\");\n a.setDireccion(\"Sebastian Garrido 54\");\n a.setNacimiento(new Date(1991, 9, 29));\n a.setNacionalidad(\"España\");\n a.setSexo(\"Hombre\");\n a.setCentro(\"Centro\");\n usuarios.add(a);\n \n Tecnico tec=new Tecnico();\n tec.setCodigo(5);\n tec.setApellidos(\"Alcaide Gomez\");\n tec.setNombre(\"Juan Carlos\");\n tec.setDni(\"tecnico\");\n tec.setPassword(\"tecnico\");\n tec.setCorreo(\"algojuca@alu.uma.es\");\n tec.setDireccion(\"Sebastian Garrido 54\");\n tec.setNacimiento(new Date(1991, 12, 29));\n tec.setNacionalidad(\"España\");\n tec.setCentro(\"Centro\");\n tec.setSexo(\"Varon\");\n tec.setDespacho(\"301\");\n tec.setTelefono(\"664671040\");\n tec.setEspecialidad(\"Maltrato\");\n tec.setTfijo(957375546);\n \n usuarios.add(tec);\n \n }", "@Override\n @TransactionAttribute(TransactionAttributeType.REQUIRED)\n public synchronized Boleto procesarBoleto(Boleto b) throws CRUDException {\n Optional op;\n Aerolinea a = em.find(Aerolinea.class, b.getIdAerolinea().getIdAerolinea());\n Cliente c = em.find(Cliente.class, b.getIdCliente().getIdCliente());\n NotaDebito notaDebito = null;\n NotaDebitoTransaccion transaccion = null;\n ComprobanteContable comprobanteAsiento = null, comprobanteIngreso = null;\n AsientoContable totalCancelar = null, montoPagarLinea = null,\n montoDescuento = null, montoComision = null, montoFee = null;\n\n AsientoContable ingTotalCancelarCaja = null, ingTotalCancelarHaber = null;\n IngresoCaja ingreso = null;\n IngresoTransaccion ingTran = null;\n\n try {\n // Revisamos que el boleto no este registrado\n if (isBoletoRegistrado(b)) {\n throw new CRUDException(\"El Numero de Boleto ya ha sido registrado\");\n }\n\n //4. Obtenemos la configuracion del Boleto para guardar en el comprobanteAsiento\n HashMap<String, Integer> parameters = new HashMap<>();\n parameters.put(\"idEmpresa\", b.getIdEmpresa());\n List lconf = ejbComprobante.get(\"ContabilidadBoletaje.find\", ContabilidadBoletaje.class, parameters);\n if (lconf.isEmpty()) {\n throw new CRUDException(\"Los parametros de Contabilidad para la empresa no estan Configurados\");\n }\n\n AerolineaCuenta av = getAerolineCuenta(b, \"V\");\n\n if (av == null) {\n throw new CRUDException(\"No existe Cuenta asociada a la Aerolinea para Ventas\");\n }\n\n AerolineaCuenta ac = getAerolineCuenta(b, \"C\");\n\n if (ac == null) {\n throw new CRUDException(\"No existe Cuenta asociada a la Aerolinea para Comisiones\");\n }\n\n //Obtenemos la configuracion de las cuentas para el boletaje\n ContabilidadBoletaje cbconf = (ContabilidadBoletaje) lconf.get(0);\n\n // SI no existiera alguna configuraion, no hace nada\n if (validarConfiguracion(cbconf)) {\n //1. Registra el nombre del pasajero en la tabla cnt_cliente_pasajero\n saveClientePasajero(b);\n\n //2. CRear nota de debito para el boleto en la tabla cnt_nota_debito\n notaDebito = ejbNotaDebito.createNotaDebito(b);\n notaDebito.setIdNotaDebito(insert(notaDebito));\n\n b.setIdNotaDebito(notaDebito.getIdNotaDebito());\n b.setEstado(Boleto.Estado.EMITIDO);\n insert(b);\n //notaDebito.getNotaDebitoPK().setIdNotaDebito(insert(notaDebito));\n //crea la transaccion de la nota de Debito\n transaccion = ejbNotaDebito.createNotaDebitoTransaccion(b, notaDebito);\n //transaccion.getNotaDebitoTransaccionPK().setIdNotaDebitoTransaccion(insert(transaccion));\n transaccion.setIdNotaDebitoTransaccion(insert(transaccion));\n //3. Registramos el Boleto\n\n //insert(b);\n // creamos el Comprobante Contable\n comprobanteAsiento = ejbComprobante.createAsientoDiarioBoleto(b);\n comprobanteAsiento.setIdNotaDebito(notaDebito.getIdNotaDebito());\n comprobanteAsiento.setIdLibro(insert(comprobanteAsiento));\n // se crean los asientos de acuerdo a la configuracion.\n b.setIdLibro(comprobanteAsiento.getIdLibro());\n\n //TotalCancelar\n //totalCancelar = ejbComprobante.crearTotalCancelar(b, comprobanteAsiento, cbconf, a, transaccion.getIdNotaDebitoTransaccion());\n totalCancelar = ejbComprobante.crearTotalCancelar(b, comprobanteAsiento, cbconf, a, transaccion);\n insert(totalCancelar);\n //ejbComprobante.insert(totalCancelar);\n //DiferenciaTotalBoleto\n montoPagarLinea = ejbComprobante.crearMontoPagarLineaAerea(b, comprobanteAsiento, cbconf, av, notaDebito, transaccion);\n //ejbComprobante.insert(montoPagarLinea);\n insert(montoPagarLinea);\n //Comision\n montoComision = ejbComprobante.crearMontoComision(b, comprobanteAsiento, a, ac, notaDebito, transaccion);\n //ejbComprobante.insert(montoComision);\n insert(montoComision);\n //Fee\n montoFee = ejbComprobante.crearMontoFee(b, comprobanteAsiento, cbconf, a, notaDebito, transaccion);\n //ejbComprobante.insert(montoFee);\n insert(montoFee);\n //Descuento\n montoDescuento = ejbComprobante.crearMontoDescuentos(b, comprobanteAsiento, cbconf, a, notaDebito, transaccion);\n //ejbComprobante.insert(montoDescuento);\n insert(montoDescuento);\n\n //actualizamos los montos Totales del Comprobante.\n double totalDebeNac = 0;\n double totalDebeExt = 0;\n double totalHaberNac = 0;\n double totalHaberExt = 0;\n //Se realizan las sumas para el comprobanteAsiento.\n if (b.getTipoCupon().equals(Boleto.Cupon.INTERNACIONAL)) {\n op = Optional.ofNullable(totalCancelar.getMontoDebeExt());\n if (op.isPresent()) {\n totalDebeExt += totalCancelar.getMontoDebeExt().doubleValue();\n }\n\n op = Optional.ofNullable(montoDescuento);\n if (op.isPresent()) {\n totalDebeExt += montoDescuento.getMontoDebeExt().doubleValue();\n }\n\n op = Optional.ofNullable(totalDebeExt);\n if (op.isPresent()) {\n totalDebeNac = totalDebeExt * b.getFactorCambiario().doubleValue();\n }\n // Haber\n\n op = Optional.ofNullable(montoPagarLinea.getMontoHaberExt());\n if (op.isPresent()) {\n totalHaberExt += montoPagarLinea.getMontoHaberExt().doubleValue();\n }\n\n op = Optional.ofNullable(montoComision);\n if (op.isPresent()) {\n totalHaberExt += montoComision.getMontoHaberExt().doubleValue();\n }\n\n op = Optional.ofNullable(montoFee);\n if (op.isPresent()) {\n totalHaberExt += montoFee.getMontoHaberExt().doubleValue();\n }\n\n op = Optional.ofNullable(totalHaberExt);\n if (op.isPresent()) {\n totalHaberNac = totalHaberExt * b.getFactorCambiario().doubleValue();\n }\n\n } else if (b.getTipoCupon().equals(Boleto.Cupon.NACIONAL)) {\n op = Optional.ofNullable(totalCancelar.getMontoDebeNac());\n if (op.isPresent()) {\n totalDebeNac += totalCancelar.getMontoDebeNac().doubleValue();\n }\n\n op = Optional.ofNullable(montoDescuento.getMontoDebeNac());\n if (op.isPresent()) {\n totalDebeNac += montoDescuento.getMontoDebeNac().doubleValue();\n }\n op = Optional.ofNullable(totalDebeNac);\n if (op.isPresent()) {\n totalDebeExt = totalDebeNac / b.getFactorCambiario().doubleValue();\n }\n //\n\n op = Optional.ofNullable(montoPagarLinea.getMontoHaberNac());\n if (op.isPresent()) {\n totalHaberNac += montoPagarLinea.getMontoHaberNac().doubleValue();\n }\n op = Optional.ofNullable(montoComision.getMontoHaberNac());\n if (op.isPresent()) {\n totalHaberNac += montoComision.getMontoHaberNac().doubleValue();\n }\n op = Optional.ofNullable(montoFee.getMontoHaberNac());\n if (op.isPresent()) {\n totalHaberNac += montoFee.getMontoHaberNac().doubleValue();\n }\n op = Optional.ofNullable(totalHaberNac);\n if (op.isPresent()) {\n totalHaberExt = totalHaberNac / b.getFactorCambiario().doubleValue();\n }\n }\n\n comprobanteAsiento.setTotalDebeExt(new BigDecimal(totalDebeExt));\n comprobanteAsiento.setTotalHaberExt(new BigDecimal(totalHaberExt));\n comprobanteAsiento.setTotalDebeNac(new BigDecimal(totalDebeNac));\n comprobanteAsiento.setTotalHaberNac(new BigDecimal(totalHaberNac));\n\n em.merge(comprobanteAsiento);\n\n // creamos para las formas de pago\n //Si son Contado o Tarjeta, se crea el Ingreso a Caja y el Comprobante de Ingreso\n if (b.getFormaPago().equals(FormasPago.CONTADO) || b.getFormaPago().equals(FormasPago.TARJETA)) {\n //Crear Ingreso a Caja\n ingreso = ejbIngresoCaja.createIngresoCaja(b, notaDebito);\n ingreso.setIdIngresoCaja(insert(ingreso));\n b.setIdIngresoCaja(ingreso.getIdIngresoCaja());\n\n ingTran = ejbIngresoCaja.createIngresoCajaTransaccion(b, notaDebito, transaccion, ingreso);\n ingTran.setIdTransaccion(insert(ingTran));\n b.setIdIngresoCajaTransaccion(ingTran.getIdTransaccion());\n\n //Crear Comprobante de Ingreso\n comprobanteIngreso = ejbComprobante.createComprobante(a, b, c, ComprobanteContable.Tipo.COMPROBANTE_INGRESO);\n comprobanteIngreso.setIdNotaDebito(notaDebito.getIdNotaDebito());\n /* if (ingreso.getMoneda().equals(Moneda.EXTRANJERA)) {\n comprobanteIngreso.setTotalDebeExt(ingreso.getMontoAbonadoUsd());\n comprobanteIngreso.setTotalHaberExt(ingreso.getMontoAbonadoUsd());\n comprobanteIngreso.setTotalDebeNac(ingreso.getMontoAbonadoUsd().multiply(ingreso.getFactorCambiario()));\n comprobanteIngreso.setTotalHaberNac(ingreso.getMontoAbonadoUsd().multiply(ingreso.getFactorCambiario()));\n\n notaDebito.setMontoAdeudadoUsd(notaDebito.getMontoTotalUsd().subtract(ingreso.getMontoAbonadoUsd()));\n } else {\n comprobanteIngreso.setTotalDebeExt(ingreso.getMontoAbonadoBs());\n comprobanteIngreso.setTotalHaberExt(ingreso.getMontoAbonadoBs());\n comprobanteIngreso.setTotalDebeNac(ingreso.getMontoAbonadoBs().divide(ingreso.getFactorCambiario()));\n comprobanteIngreso.setTotalHaberNac(ingreso.getMontoAbonadoBs().divide(ingreso.getFactorCambiario()));\n\n notaDebito.setMontoAdeudadoBs(notaDebito.getMontoTotalBs().subtract(ingreso.getMontoAbonadoBs()));\n }*/\n insert(comprobanteIngreso);\n\n /**\n *\n */\n // ESTAS TRANSACCIONES PASARLAS. al nuevo metodo de cada uno\n /*ingTotalCancelarCaja = ejbComprobante.createTotalCancelarIngresoCajaDebe(comprobanteIngreso, cbconf, a, b);\n ingTotalCancelarCaja.setIdIngresoCajaTransaccion(ingTran.getIdTransaccion());\n insert(ingTotalCancelarCaja);\n\n ingTotalCancelarHaber = ejbComprobante.createTotalCancelarIngresoClienteHaber(comprobanteIngreso, cbconf, a, b);\n ingTotalCancelarHaber.setIdIngresoCajaTransaccion(ingTran.getIdTransaccion());\n insert(ingTotalCancelarHaber);*/\n /**\n *\n */\n //actualizar nota debito\n em.merge(notaDebito);\n }\n\n //b.setIdLibro(notaDebito.getIdNotaDebito());\n if (ingTran != null) {\n b.setIdIngresoCajaTransaccion(ingTran.getIdTransaccion());\n }\n\n em.merge(b);\n }\n } catch (Exception e) {\n\n em.clear();\n\n Optional opex = Optional.ofNullable(notaDebito);\n if (opex.isPresent()) {\n remove(notaDebito);\n }\n\n opex = Optional.ofNullable(transaccion);\n if (opex.isPresent()) {\n remove(transaccion);\n }\n\n opex = Optional.ofNullable(comprobanteAsiento);\n if (opex.isPresent()) {\n remove(comprobanteAsiento);\n }\n\n opex = Optional.ofNullable(totalCancelar);\n if (opex.isPresent()) {\n remove(totalCancelar);\n }\n\n opex = Optional.ofNullable(montoPagarLinea);\n if (opex.isPresent()) {\n remove(montoPagarLinea);\n }\n opex = Optional.ofNullable(montoDescuento);\n if (opex.isPresent()) {\n remove(montoDescuento);\n }\n opex = Optional.ofNullable(montoComision);\n if (opex.isPresent()) {\n remove(montoComision);\n }\n opex = Optional.ofNullable(montoFee);\n if (opex.isPresent()) {\n remove(montoFee);\n }\n\n opex = Optional.ofNullable(b);\n if (opex.isPresent() && b.getIdBoleto() > 0) {\n remove(b);\n }\n\n opex = Optional.ofNullable(ingreso);\n if (opex.isPresent()) {\n remove(ingreso);\n }\n\n opex = Optional.ofNullable(ingTran);\n if (opex.isPresent()) {\n remove(ingTran);\n }\n\n opex = Optional.ofNullable(ingTotalCancelarCaja);\n if (opex.isPresent()) {\n remove(ingTotalCancelarCaja);\n }\n\n opex = Optional.ofNullable(ingTotalCancelarHaber);\n if (opex.isPresent()) {\n remove(ingTotalCancelarHaber);\n }\n\n throw new CRUDException(e.getMessage());\n\n }\n\n em.flush();\n return b;\n }", "public void guardarBloqueSeleccionado(){\n\t\tif(bloqueSeleccionadoEditar.getIdbloques() == 0){\n\t\t\tbloquesFacade.create(bloqueSeleccionadoEditar);\n\t\t}else{\n\t\t\tbloquesFacade.edit(bloqueSeleccionadoEditar);\n\t\t}\n\t\tdataListBloques = bloquesFacade.findByLike(\"SELECT B FROM Bloques B ORDER BY B.nombre\");\n\t}", "private void limpiarDatos() {\n\t\t\n\t}", "public void inicializarBalances(Empresa empresa) {\r\n\t\tEntityManager manager = PerThreadEntityManagers.getEntityManager();\r\n\t\tPersistenceUnitUtil checkeadorDeLoad = manager.getEntityManagerFactory().getPersistenceUnitUtil();\r\n\t\tif(checkeadorDeLoad.isLoaded(empresa, \"balancesSemestrales\" ) && checkeadorDeLoad.isLoaded(empresa, \"balancesAnuales\"))\r\n\t\t{\r\n\t\t\tmanager.close();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tList<BalanceAnual> balancesAnuales = manager.createQuery(\"SELECT b FROM BalanceAnual b WHERE empresa_id = :emp_id\")\r\n\t\t\t\t.setParameter(\"emp_id\", empresa.getId()).getResultList();\r\n\t\t\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tList<BalanceSemestral> balancesSemestrales = manager.createQuery(\"SELECT b FROM BalanceSemestral b WHERE empresa_id = :emp_id\")\r\n\t\t\t\t.setParameter(\"emp_id\", empresa.getId()).getResultList();\r\n\t\t\r\n\t\tmanager.close();\r\n\t\tempresa.setBalancesAnuales(balancesAnuales);\r\n\t\tempresa.setBalancesSemestrales(balancesSemestrales);\r\n\t}", "private void enviarDatos() {\n try {\n if (validarDatos()) { // verificar si todos los datos obligatorios tienen informacion\n // verificar que el usuario de la pantalla presiono el boton YES\n if (obtenerMensajeDeConfirmacion() == JOptionPane.YES_OPTION) {\n llenarEntidadConLosDatosDeLosControles(); // llenar la entidad de Rol con los datos de la caja de texto del formulario\n int resultado = 0;\n switch (opcionForm) {\n case FormEscOpcion.CREAR:\n resultado = ClienteDAL.crear(clienteActual); // si la propiedad opcionForm es CREAR guardar esos datos en la base de datos\n break;\n case FormEscOpcion.MODIFICAR:\n resultado = ClienteDAL.modificar(clienteActual);// si la propiedad opcionForm es MODIFICAR actualizar esos datos en la base de datos\n break;\n case FormEscOpcion.ELIMINAR:\n // si la propiedad opcionForm es ELIMINAR entonces quitamos ese registro de la base de datos\n resultado = ClienteDAL.eliminar(clienteActual);\n break;\n default:\n break;\n }\n if (resultado != 0) {\n // notificar al usuario que \"Los datos fueron correctamente actualizados\"\n JOptionPane.showMessageDialog(this, \"Los datos fueron correctamente actualizados\");\n if (frmPadre != null) {\n // limpiar los datos de la tabla de datos del formulario FrmRolLec\n frmPadre.iniciarDatosDeLaTabla(new ArrayList());\n }\n this.cerrarFormulario(false); // Cerrar el formulario utilizando el metodo \"cerrarFormulario\"\n } else {\n // En el caso que las filas modificadas en el la base de datos sean cero \n // mostrar el siguiente mensaje al usuario \"Sucedio un error al momento de actualizar los datos\"\n JOptionPane.showMessageDialog(this, \"Sucedio un error al momento de actualizar los datos\");\n }\n }\n }\n } catch (Exception ex) {\n // En el caso que suceda un error al ejecutar la consulta en la base de datos \n // mostrar el siguiente mensaje al usuario \"Sucedio un error al momento de actualizar los datos\"\n JOptionPane.showMessageDialog(this, \"Sucedio el siguiente error: \" + ex.getMessage());\n }\n\n }", "private void guardarEstadoObjetosUsados() {\n }", "public void PrepararBaseDatos() { \r\n try{ \r\n conexion=DriverManager.getConnection(\"jdbc:ucanaccess://\"+this.NOMBRE_BASE_DE_DATOS,this.USUARIO_BASE_DE_DATOS,this.CLAVE_BASE_DE_DATOS);\r\n \r\n } \r\n catch (Exception e) { \r\n JOptionPane.showMessageDialog(null,\"Error al realizar la conexion \"+e);\r\n } \r\n try { \r\n sentencia=conexion.createStatement( \r\n ResultSet.TYPE_SCROLL_INSENSITIVE, \r\n ResultSet.CONCUR_READ_ONLY); \r\n \r\n System.out.println(\"Se ha establecido la conexión correctamente\");\r\n } \r\n catch (Exception e) { \r\n JOptionPane.showMessageDialog(null,\"Error al crear el objeto sentencia \"+e);\r\n } \r\n }", "public CriaBanco (Context context){\n\n super (context, NOME_BD, null, VERSAO);\n }", "public ArrayList<Comobox> listaTodosBanco()\n {\n @SuppressWarnings(\"MismatchedQueryAndUpdateOfCollection\")\n ArrayList<Comobox> al= new ArrayList<>();\n @SuppressWarnings(\"UnusedAssignment\")\n ResultSet rs = null;\n sql=\"select * FROM VER_BANCO\";\n Conexao conexao = new Conexao();\n if(conexao.getCon()!=null)\n {\n try \n {\n if(conexao.getCon()!=null)\n {\n cs = conexao.getCon().prepareCall(sql);\n cs.execute();\n rs=cs.executeQuery(); \n if (rs!=null) \n { \n while (rs.next())\n { \n al.add(new Comobox(rs.getString(\"ID\"), rs.getString(\"SIGLA\")));\n } \n }\n rs.close();\n }\n else\n {\n al.add(new Comobox(\"djdj\",\"ddj\"));\n al.add(new Comobox(\"1dj\",\"dmsmdj\"));\n }\n } \n catch (SQLException ex)\n {\n Logger.getLogger(CreditoDao.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Erro a obter fontes rendimentos \"+ex.getMessage());\n }\n }\n return al;\n }", "public void guardarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tsetUpperCase();\r\n\t\t\tif (validarForm()) {\r\n\t\t\t\t// Cargamos los componentes //\r\n\r\n\t\t\t\tMap datos = new HashMap();\r\n\r\n\t\t\t\tHis_parto his_parto = new His_parto();\r\n\t\t\t\this_parto.setCodigo_empresa(empresa.getCodigo_empresa());\r\n\t\t\t\this_parto.setCodigo_sucursal(sucursal.getCodigo_sucursal());\r\n\t\t\t\this_parto.setCodigo_historia(tbxCodigo_historia.getValue());\r\n\t\t\t\this_parto.setIdentificacion(tbxIdentificacion.getValue());\r\n\t\t\t\this_parto.setFecha_inicial(new Timestamp(dtbxFecha_inicial\r\n\t\t\t\t\t\t.getValue().getTime()));\r\n\t\t\t\this_parto.setConyugue(tbxConyugue.getValue());\r\n\t\t\t\this_parto.setId_conyugue(tbxId_conyugue.getValue());\r\n\t\t\t\this_parto.setEdad_conyugue(tbxEdad_conyugue.getValue());\r\n\t\t\t\this_parto.setEscolaridad_conyugue(tbxEscolaridad_conyugue\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setMotivo(tbxMotivo.getValue());\r\n\t\t\t\this_parto.setEnfermedad_actual(tbxEnfermedad_actual.getValue());\r\n\t\t\t\this_parto.setAntecedentes_familiares(tbxAntecedentes_familiares\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setPreeclampsia(rdbPreeclampsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setHipertension(rdbHipertension.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEclampsia(rdbEclampsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setH1(rdbH1.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setH2(rdbH2.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setPostimadurez(rdbPostimadurez.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setRot_pre(rdbRot_pre.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setPolihidramnios(rdbPolihidramnios.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setRcui(rdbRcui.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setPelvis(rdbPelvis.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setFeto_macrosonico(rdbFeto_macrosonico\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setIsoinmunizacion(rdbIsoinmunizacion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setAo(rdbAo.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setCirc_cordon(rdbCirc_cordon.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setPostparto(rdbPostparto.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setDiabetes(rdbDiabetes.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setCardiopatia(rdbCardiopatia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setAnemias(rdbAnemias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEnf_autoinmunes(rdbEnf_autoinmunes\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setEnf_renales(rdbEnf_renales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInf_urinaria(rdbInf_urinaria.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEpilepsia(rdbEpilepsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto\r\n\t\t\t\t\t\t.setTbc(rdbTbc.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setMiomas(rdbMiomas.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setHb(rdbHb.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setFumadora(rdbFumadora.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setInf_puerperal(rdbInf_puerperal.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInfertilidad(rdbInfertilidad.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMenarquia(tbxMenarquia.getValue());\r\n\t\t\t\this_parto.setCiclos(tbxCiclos.getValue());\r\n\t\t\t\this_parto.setVida_marital(tbxVida_marital.getValue());\r\n\t\t\t\this_parto.setVida_obstetrica(tbxVida_obstetrica.getValue());\r\n\t\t\t\this_parto.setNo_gestaciones(lbxNo_gestaciones.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setParto(lbxParto.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setAborto(lbxAborto.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setCesarias(lbxCesarias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setFecha_um(new Timestamp(dtbxFecha_um.getValue()\r\n\t\t\t\t\t\t.getTime()));\r\n\t\t\t\this_parto.setUm(tbxUm.getValue());\r\n\t\t\t\this_parto.setFep(tbxFep.getValue());\r\n\t\t\t\this_parto.setGemerales(lbxGemerales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMalformados(lbxMalformados.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNacidos_vivos(lbxNacidos_vivos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNacidos_muertos(lbxNacidos_muertos\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setPreterminos(lbxPreterminos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMedico(chbMedico.isChecked());\r\n\t\t\t\this_parto.setEnfermera(chbEnfermera.isChecked());\r\n\t\t\t\this_parto.setAuxiliar(chbAuxiliar.isChecked());\r\n\t\t\t\this_parto.setPartera(chbPartera.isChecked());\r\n\t\t\t\this_parto.setOtros(chbOtros.isChecked());\r\n\t\t\t\this_parto.setControlado(rdbControlado.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setLugar_consulta(rdbLugar_consulta.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNo_consultas(lbxNo_consultas.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEspecialistas(chbEspecialistas.isChecked());\r\n\t\t\t\this_parto.setGeneral(chbGeneral.isChecked());\r\n\t\t\t\this_parto.setPartera_consulta(chbPartera_consulta.isChecked());\r\n\t\t\t\this_parto.setSangrado_vaginal(rdbSangrado_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setCefalias(rdbCefalias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEdema(rdbEdema.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEpigastralgia(rdbEpigastralgia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setVomitos(rdbVomitos.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setTinutus(rdbTinutus.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEscotomas(rdbEscotomas.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInfeccion_urinaria(rdbInfeccion_urinaria\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setInfeccion_vaginal(rdbInfeccion_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setOtros_embarazo(tbxOtros_embarazo.getValue());\r\n\t\t\t\this_parto.setCardiaca(tbxCardiaca.getValue());\r\n\t\t\t\this_parto.setRespiratoria(tbxRespiratoria.getValue());\r\n\t\t\t\this_parto.setPeso(tbxPeso.getValue());\r\n\t\t\t\this_parto.setTalla(tbxTalla.getValue());\r\n\t\t\t\this_parto.setTempo(tbxTempo.getValue());\r\n\t\t\t\this_parto.setPresion(tbxPresion.getValue());\r\n\t\t\t\this_parto.setPresion2(tbxPresion2.getValue());\r\n\t\t\t\this_parto.setInd_masa(tbxInd_masa.getValue());\r\n\t\t\t\this_parto.setSus_masa(tbxSus_masa.getValue());\r\n\t\t\t\this_parto.setCabeza_cuello(tbxCabeza_cuello.getValue());\r\n\t\t\t\this_parto.setCardiovascular(tbxCardiovascular.getValue());\r\n\t\t\t\this_parto.setMamas(tbxMamas.getValue());\r\n\t\t\t\this_parto.setPulmones(tbxPulmones.getValue());\r\n\t\t\t\this_parto.setAbdomen(tbxAbdomen.getValue());\r\n\t\t\t\this_parto.setUterina(tbxUterina.getValue());\r\n\t\t\t\this_parto.setSituacion(tbxSituacion.getValue());\r\n\t\t\t\this_parto.setPresentacion(tbxPresentacion.getValue());\r\n\t\t\t\this_parto.setV_presentacion(tbxV_presentacion.getValue());\r\n\t\t\t\this_parto.setPosicion(tbxPosicion.getValue());\r\n\t\t\t\this_parto.setV_posicion(tbxV_posicion.getValue());\r\n\t\t\t\this_parto.setC_uterina(tbxC_uterina.getValue());\r\n\t\t\t\this_parto.setTono(tbxTono.getValue());\r\n\t\t\t\this_parto.setFcf(tbxFcf.getValue());\r\n\t\t\t\this_parto.setGenitales(tbxGenitales.getValue());\r\n\t\t\t\this_parto.setDilatacion(tbxDilatacion.getValue());\r\n\t\t\t\this_parto.setBorramiento(tbxBorramiento.getValue());\r\n\t\t\t\this_parto.setEstacion(tbxEstacion.getValue());\r\n\t\t\t\this_parto.setMembranas(tbxMembranas.getValue());\r\n\t\t\t\this_parto.setExtremidades(tbxExtremidades.getValue());\r\n\t\t\t\this_parto.setSnc(tbxSnc.getValue());\r\n\t\t\t\this_parto.setObservacion(tbxObservacion.getValue());\r\n\t\t\t\this_parto.setCodigo_consulta_pyp(lbxCodigo_consulta_pyp\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setFinalidad_cons(lbxFinalidad_cons.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setCausas_externas(lbxCausas_externas\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setTipo_disnostico(lbxTipo_disnostico\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setTipo_principal(tbxTipo_principal.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_1(tbxTipo_relacionado_1\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_2(tbxTipo_relacionado_2\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_3(tbxTipo_relacionado_3\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTratamiento(tbxTratamiento.getValue());\r\n\r\n\t\t\t\tdatos.put(\"codigo_historia\", his_parto);\r\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getText());\r\n\r\n\t\t\t\this_parto = getServiceLocator().getHis_partoService().guardar(\r\n\t\t\t\t\t\tdatos);\r\n\r\n\t\t\t\tif (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n\t\t\t\t\taccionForm(true, \"modificar\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tMessagebox.show(\"Los datos se guardaron satisfactoriamente\",\r\n\t\t\t\t\t\t\"Informacion ..\", Messagebox.OK,\r\n\t\t\t\t\t\tMessagebox.INFORMATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\r\n\t}", "private void carregaInformacoes() {\n Pessoa pessoa = (Pessoa) getIntent().getExtras().getSerializable(\"pessoa\");\n edtNome.setText(pessoa.getNome());\n edtEmail.setText(pessoa.getEmail());\n edtTelefone.setText(pessoa.getTelefone());\n edtIdade.setText(pessoa.getIdade());\n edtCPF.setText(pessoa.getCpf());\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException \r\n\t{\n ((HttpServletResponse) response).addHeader(\"Access-Control-Allow-Origin\", \"*\");\r\n \r\n try\r\n {\r\n \tString usuario_id = request.getParameter(\"usuarioid\");\r\n \tint usuarioid = 0;\r\n \ttry \r\n \t{\r\n \t\tusuarioid = Integer.parseInt(usuario_id);\r\n \t\tString observacoes = request.getParameter(\"observacoes\");\r\n \t\r\n \tSystem.out.println(usuarioid + observacoes + \"\");\r\n \t\r\n \tBudget b = BudgetDAO.Build(usuarioid, observacoes);\r\n \tBudgetDAO.Create(b);\r\n \t}\r\n \tcatch (Exception e) \r\n \t{\r\n\t\t\t\tSystem.out.println(\"Erro convertendo usuario_id\");\r\n\t\t\t}\r\n\t\t}\r\n catch (Exception e) \r\n {\r\n \tSystem.out.println(\"Erro: \" + e.getMessage());\r\n\t\t}\r\n\t}", "public void cargaDatosInicialesSoloParaModificacionDeCuenta() throws Exception {\n GestionContableWrapper gestionContableWrapper = parParametricasService.factoryGestionContable();\n gestionContableWrapper.getNormaContable3();\n parAjustesList = parParametricasService.listaTiposDeAjuste(obtieneEnumTipoAjuste(gestionContableWrapper.getNormaContable3()));\n selectAuxiliarParaAsignacionModificacion = cntEntidadesService.listaDeAuxiliaresPorEntidad(selectedEntidad);\n //Obtien Ajuste Fin\n\n //Activa formulario para automatico modifica \n switch (selectedEntidad.getNivel()) {\n case 1:\n swParAutomatico = true;\n numeroEspaciador = 200;\n break;\n case 2:\n swParAutomatico = true;\n swActivaBoton = true;\n numeroEspaciador = 200;\n break;\n case 3:\n swParAutomatico = false;\n numeroEspaciador = 1;\n break;\n default:\n break;\n }\n\n cntEntidad = (CntEntidad) getCntEntidadesService().find(CntEntidad.class, selectedEntidad.getIdEntidad());\n }", "private void insertData() {\n\n cliente = factory.manufacturePojo(ClienteEntity.class);\n em.persist(cliente);\n for (int i = 0; i < 3; i++) {\n FormaPagoEntity formaPagoEntity = factory.manufacturePojo(FormaPagoEntity.class);\n formaPagoEntity.setCliente(cliente);\n em.persist(formaPagoEntity);\n data.add(formaPagoEntity);\n }\n }", "public void salvarDadosUsuario(String idUsuario){\n editor.putString(CHAVE_ID, idUsuario);\n editor.commit();\n }", "@Override\r\n public boolean ActualizarDatosCliente() {\r\n try {\r\n puente.executeUpdate(\"UPDATE `cliente` SET `Nombre` = '\"+Nombre+\"', `Apellido` = '\"+Apellido+\"', `Telefono` = '\"+Telefono+\"', `Fecha_Nacimiento` = '\"+Fecha_Nacimiento+\"', `Email` = '\"+Email+\"', `Direccion` = '\"+Direccion+\"', `Ciudad` = '\"+Ciudad+\"' WHERE `cliente`.`Cedula` = '\"+Cedula+\"';\");\r\n listo = true;\r\n } catch (Exception e) {\r\n Logger.getLogger(DaoCliente.class.getName()).log(Level.SEVERE, null, e);\r\n }\r\n return listo;\r\n }", "public void guardar() {\n try {\n if (this.buscarCodApelacion()) {\n Dr_siseg_usuarioBean usuario = new Dr_siseg_usuarioBean();\n FacesContext facesContext = FacesContext.getCurrentInstance();\n usuario = (Dr_siseg_usuarioBean) facesContext.getExternalContext().getSessionMap().get(\"usuario\");\n\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n apelacionesDao.INSERTA_APELACIONES(apelacionesBean); \n\n BitacoraSolicitudDao bitacoraSolicitudDao = new BitacoraSolicitudDao();//INSERTA EL MOVIMIENTO EN LA BITACORA\n BitacoraSolicitudBean bitacoraSolicitudBean = new BitacoraSolicitudBean();\n bitacoraSolicitudBean.setBit_sol_id(this.apelacionesBean.getApel_sol_numero());\n bitacoraSolicitudBean.setUsuarioBean(usuario);\n bitacoraSolicitudBean.setBit_tipo_movimiento(\"0\");\n bitacoraSolicitudBean.setBit_detalle(\"Fue insertada la apelacion\");\n bitacoraSolicitudDao.dmlDr_regt_bitacora_solicitud(bitacoraSolicitudBean);\n\n this.Listar();\n this.apelacionesBean = new ApelacionesBean();\n addMessage(\"Guadado Exitosamente\", 1);\n } else {\n addMessage(\"La solicitud de apelacion especificada no existe\", 1);\n this.Listar();\n }\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n addMessage(\"Se produjo un error al insertar el registro, contacte al administrador del sistema\", 1);\n }\n }", "private void salvar() {\n setaCidadeBean();\n //Instanciamos o DAO\n CidadeDAO dao = new CidadeDAO();\n //verifica qual será a operação de peristência a ser realizada\n if (operacao == 1) {\n dao.inserir(cidadeBean);\n }\n if (operacao == 2) {\n dao.alterar(cidadeBean);\n }\n habilitaBotoesParaEdicao(false);\n reiniciaTela();\n }", "public String elegirBloque() throws SQLException {\n\t\tCRUD crud = new CRUD();\n\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\tBloque bloque = context.getApplication().evaluateExpressionGet(context, \"#{bloque}\", Bloque.class);\n\t\tActividad actividad = new Actividad();\n\t\tactividad.setNombresA(crud.select_Bloque_actividad(bloque.getTematica()));\n\t\tSystem.out.println(\"look: \"+bloque.getTematica()+\" \"+actividad.getNombresA().get(0));\n\t\t\n\t\t// put the user object into the POST request \n\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"actividad\", actividad);\n\t\t\n\t\treturn\"elegirActividad.xhtml?faces-redirect=false\";\n\t}", "public static void pedirCredenciales(int rango) throws PersistenciaException, EmpleadoException {\n\n System.out.print(\"Introduzca su dni: \");\n String dni = teclado.nextLine();\n\n System.out.print(\"Introduzca su contrsenia: \");\n String contrasenia = teclado.nextLine();\n\n empleadoController.comprobarCredenciales(rango, dni, contrasenia);\n }", "public void novoDebito(Debitos debitos, String conCodigo, Contas contaComSaldo) throws SQLException {\r\n String sqls = \"select * from contas where concodigo = \" + conCodigo + \" \";\r\n\r\n PreparedStatement psc = null;\r\n ResultSet rsc = null;\r\n try {\r\n psc = connection.prepareStatement(sqls);\r\n rsc = psc.executeQuery();\r\n while (rsc.next()) {\r\n contaComSaldo.setConCodigo(rsc.getInt(\"concodigo\"));\r\n contaComSaldo.setConDescricao(rsc.getString(\"condescricao\"));\r\n contaComSaldo.setTipoCodigo(rsc.getInt(\"tipocodigo\"));\r\n contaComSaldo.setConSaldo(rsc.getDouble(\"consaldo\"));\r\n }\r\n\r\n } catch (Exception e) {\r\n Logger.getLogger(ContaDAO.class.getName()).log(Level.SEVERE, null, e);\r\n\r\n }\r\n\r\n String sqlUltimoCredito = \"select * from creditos order by crecodigo desc limit 1\";\r\n\r\n PreparedStatement pscUltimoCredito = null;\r\n ResultSet rscUltimoCredito = null;\r\n\r\n Creditos creditos = new Creditos();\r\n\r\n try {\r\n\r\n pscUltimoCredito = connection.prepareStatement(sqlUltimoCredito);\r\n rscUltimoCredito = pscUltimoCredito.executeQuery();\r\n while (rscUltimoCredito.next()) {\r\n\r\n creditos.setCreCodigo(rscUltimoCredito.getInt(\"crecodigo\"));\r\n creditos.setCreData(rscUltimoCredito.getDate(\"credata\"));\r\n creditos.setConCodigo(rscUltimoCredito.getInt(\"concodigo\"));\r\n creditos.setCreValor(rscUltimoCredito.getInt(\"crevalor\"));\r\n creditos.setCreHistorico(rscUltimoCredito.getString(\"crehistorico\"));\r\n creditos.setConSaldo(rscUltimoCredito.getDouble(\"consaldo\"));\r\n }\r\n\r\n } catch (Exception e) {\r\n Logger.getLogger(DebitoDAO.class.getName()).log(Level.SEVERE, null, e);\r\n\r\n }\r\n\r\n String sql = \"insert into debitos (debdata,concodigo,debvalor,debhistorico,consaldo,creditoid) values (?,?,?,?,?,?)\";\r\n PreparedStatement ps = null;\r\n try {\r\n ps = connection.prepareStatement(sql);\r\n ps.setDate(1, new java.sql.Date(debitos.getDebData().getTime()));\r\n ps.setInt(2, debitos.getConCodigo());\r\n ps.setDouble(3, debitos.getDebValor() * -1);\r\n ps.setString(4, debitos.getDebHistorico());\r\n ps.setDouble(5, contaComSaldo.getConSaldo());\r\n ps.setInt(6, creditos.getCreCodigo());\r\n\r\n ps.execute();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(CreditoDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n connection.close();\r\n ps.close();\r\n }\r\n }", "public void pedirValoresCabecera(){\n \r\n \r\n \r\n \r\n }", "@Override\r\n public List<Assunto> buscarTodas() {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"FROM Assunto As a\");\r\n return query.getResultList();\r\n }", "@Override\r\n public List<Concursando> consultarTodosConcursando() throws Exception {\n return rnConcursando.consultarTodos();\r\n }", "public void apagarDadosCobranca(ApagarDadosFaturamentoHelper helper) throws ErroRepositorioException ;", "public ArrayList<Comobox> listaUserBancos(String valor)\n {\n @SuppressWarnings(\"MismatchedQueryAndUpdateOfCollection\")\n ArrayList<Comobox> al= new ArrayList<>();\n ResultSet rs = null;\n\n sql=\"select * FROM table(FUNCT_LOAD_BANCO_SIMULACAO(?,?,?))\";\n Conexao conexao = new Conexao();\n if(conexao.getCon()!=null)\n {\n try \n {\n cs = conexao.getCon().prepareCall(sql);\n cs.setInt(1, SessionUtil.getUserlogado().getIdAgencia());\n cs.setString(2, SessionUtil.getUserlogado().getNif());\n cs.setFloat(3, Float.valueOf(valor));\n cs.execute();\n rs=cs.executeQuery(); \n if (rs!=null) \n { \n al.add(new Comobox(\"Selecione\", \"Selecione\"));\n while (rs.next())\n { \n al.add(new Comobox(rs.getString(\"ID\"), rs.getString(\"SIGLA\"), rs.getString(\"QUANTIDADE DE CHEQUES VARIAVEL\")));\n } \n }\n rs.close();\n \n if(al.size() == 1){\n FacesContext context = FacesContext.getCurrentInstance();\n context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,\"Cheque\", \"Nenhum Cheque disponivel para essa agencia!\") );\n }\n } \n catch (SQLException ex)\n {\n Logger.getLogger(CreditoDao.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Erro a obter bancos \"+ex.getMessage());\n }\n }\n return al;\n }", "public void verificarDatosConsola(Cliente cliente, List<Cuenta> listaCuentas) {\n\n int codigoCliente = cliente.getCodigo();\n\n System.out.println(\"Codigo: \"+cliente.getCodigo());\n System.out.println(\"Nombre: \"+cliente.getNombre());\n System.out.println(\"DPI: \"+cliente.getDPI());\n System.out.println(\"Direccion: \"+cliente.getDireccion());\n System.out.println(\"Sexo: \"+cliente.getSexo());\n System.out.println(\"Password: \"+cliente.getPassword());\n System.out.println(\"Tipo de Usuario: \"+ 3);\n\n System.out.println(\"Nacimiento: \"+cliente.getNacimiento());\n System.out.println(\"ArchivoDPI: \"+cliente.getDPIEscaneado());\n System.out.println(\"Estado: \"+cliente.isEstado());\n \n \n for (Cuenta cuenta : listaCuentas) {\n System.out.println(\"CUENTAS DEL CLIENTE\");\n System.out.println(\"Numero de Cuenta: \"+cuenta.getNoCuenta());\n System.out.println(\"Fecha de Creacion: \"+cuenta.getFechaCreacion());\n System.out.println(\"Saldo: \"+cuenta.getSaldo());\n System.out.println(\"Codigo del Dueño: \"+codigoCliente);\n \n }\n \n\n\n }", "List<CatalogoAprobadorDTO> buscarAprobador(int cveADM, String numEmpleado, Integer claveNivel, Integer centroCostoOP) throws SIATException;", "public List<Usuario> getAll(){\n String sql = \"SELECT * FROM usuarios \" +\n \" INNER JOIN ciudades ON ciudades.id = usuarios.id_ciudad\" +\n \" INNER JOIN provincias ON provincias.id = usuarios.id_provincia\" +\n \" INNER JOIN paises ON paises.id = usuarios.id_pais\";\n try {\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(sql);\n List<Usuario> usuarios = new ArrayList<Usuario>();\n while (rs.next()){\n Ciudad ciudad = new Ciudad(rs.getInt(\"ciudades.id\"),rs.getString(\"ciudades.nombre\"));\n\n Provincia provincia = new Provincia(rs.getInt(\"provincias.id\"),rs.getString(\"provincias.nombre\"));\n\n Pais pais = new Pais(rs.getInt(\"paises.id\"),rs.getString(\"paises.nombre\"));\n\n Usuario usuario = new Usuario(rs.getString(\"nombre\"),rs.getString(\"apellido\"),\n rs.getString(\"direccion\"), rs.getString(\"telefono\"),\n ciudad, provincia, pais, rs.getString(\"email\"),\n rs.getString(\"username\"), rs.getString(\"contrasena\"));\n usuario.setId(rs.getInt(\"usuarios.id\"));\n usuarios.add(usuario);\n }\n return usuarios;\n }catch (SQLException e){\n e.printStackTrace();\n }\n return null;\n }", "public void setar_campos()\n {\n int setar = tblCliNome.getSelectedRow();\n txtCliId.setText(tblCliNome.getModel().getValueAt(setar, 0).toString());\n txtCliNome.setText(tblCliNome.getModel().getValueAt(setar, 1).toString());\n txtCliRua.setText(tblCliNome.getModel().getValueAt(setar, 2).toString());\n txtCliNumero.setText(tblCliNome.getModel().getValueAt(setar, 3).toString());\n txtCliComplemento.setText(tblCliNome.getModel().getValueAt(setar, 4).toString());\n txtCliBairro.setText(tblCliNome.getModel().getValueAt(setar, 5).toString());\n txtCliCidade.setText(tblCliNome.getModel().getValueAt(setar, 6).toString());\n txtCliUf.setText(tblCliNome.getModel().getValueAt(setar, 7).toString());\n txtCliFixo.setText(tblCliNome.getModel().getValueAt(setar, 8).toString());\n txtCliCel.setText(tblCliNome.getModel().getValueAt(setar, 9).toString());\n txtCliMail.setText(tblCliNome.getModel().getValueAt(setar, 10).toString());\n txtCliCep.setText(tblCliNome.getModel().getValueAt(setar, 11).toString());\n \n // A LINHA ABAIXO DESABILITA O BOTÃO ADICIONAR PARA QUE O CADASTRO NÃO SEJA DUPLICADO\n btnAdicionar.setEnabled(true);\n \n }", "public List<User> ObtenerTodosUsuarios() throws BLException;", "public void localizarDados(int idOrcamento){\n OrcamentoCursoController orcamentoCursoController = new OrcamentoCursoController();\n this.orcamentocurso = orcamentoCursoController.consultar(idOrcamento);\n if (orcamentocurso!=null){\n ClienteController clienteController = new ClienteController();\n cliente = clienteController.consultar(orcamentocurso.getCliente());\n if (cliente!=null){\n parajTextField.setText(cliente.getEmail());\n }\n }\n }", "private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }", "public void recuperandoDadosUsuarioescolhido(){\n Bundle bundle = getIntent().getExtras();\n if (bundle != null){\n if (bundle.containsKey(\"usuarioSelecionado\")){\n dadosDoUsuario = (Usuario) bundle.getSerializable(\"usuarioSelecionado\");\n }\n }\n\n // Configurando Toolbar\n\n toolbar.setTitle(dadosDoUsuario.getNome());\n setSupportActionBar(toolbar);\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n\n // Configurando Imagem\n if (dadosDoUsuario.getFoto() != null){\n if (!dadosDoUsuario.getFoto().isEmpty()){\n Uri url = Uri.parse(dadosDoUsuario.getFoto());\n Glide.with(getApplicationContext()).load(url).into(civFotoPerfil);\n }\n }\n\n // Configurando Seguidores Postagens e Seguindo\n\n //stPublicacao = String.valueOf(dadosDoUsuario.getPublicacoes());\n stSeguidores = String.valueOf(dadosDoUsuario.getSeguidores());\n stSeguindo = String.valueOf(dadosDoUsuario.getSeguindo());\n\n tvSeguindo.setText(stSeguindo);\n tvSeguidores.setText(stSeguidores);\n //tvPublicacao.setText(stPublicacao);\n\n // Configurando Referencia postagens Usuario Escolhido\n postagensUsuarioRef = ConfiguracaoFirebase.getFirebaseDatabase()\n .child(\"postagens\")\n .child(dadosDoUsuario.getId());\n\n // Inicializa o Universal Image Loader\n inicializarImageLoader();\n // Recupera as Postagens do nosso Banco de Dados\n carregarFotosPostagem();\n }", "public void recebeDados(\n\tList<NotasFaltasModel> lista, String nome, String curso) {\n\t\tDefaultTableModel modelo = (DefaultTableModel) tbBoletim.getModel();\n\t\tlblNome.setText(nome);\n\t\tlblCurso.setText(curso);\n\t\t\n\tfor(NotasFaltasModel boletimAluno : lista) {\n\t\t\tmodelo.addRow(new Object[] {\n\t\t\t\tboletimAluno.getDisciplina(),\n\t\t\t\tboletimAluno.getNota(),\n\t\t\t\tboletimAluno.getFaltas()\n\t\t\t});\n\t\t}\n\t}", "@Override\n\n public void run(String... strings) throws Exception {\n \n Usuario u= new Usuario(1521L, \"Viridiana Hernandez\",\"ndzmviridiana@hotmail.com\");\n \n //la guardamos\n \n // repoUsu.save(u);\n \n //GENERAMOS LA DIRECCION QUE VAMOS A GUARDAR\n \n Direccion d = new Direccion(new Usuario(1521L),\"Calle 13\", 55120, \"Ecatepec\");\n //repoDir.save(d);\n \n \n //AQUI HAREMOS EL JOIN\n \n \n Direccion d2= repoDir.findOne(2L);\n System.out.println(\"Correo:\"+d2.getU().getEmail()+ \" municipio \"+d2.getMunicipio());\n \n \n \n \n \n \n //repoMensa.save (new Mensajito(\"Primero\",\"Mi primera vez con hibernate\"))\n /*\n Mensajito m= repoMensa.findOne(1);\n System.out.println(m.getTitulo());\n \n \n \n // repoMensa.save(new Mensajito(\"17 de octubre\",\"No temblo\"));\n System.out.println(\"vamos a uscar todos\");\n \n for (Mensajito mensa:repoMensa.findAll()){\n System.out.println(mensa);\n \n }\n \n //para buscar por id FINDONE\n System.out.println(\"vamos a buscar por id\");\n System.out.println(repoMensa.findOne(1));\n \n \n // Actualizar \n repoMensa.save(new Mensajito(1,\"nuevo titulo\",\"nuevo cuerpo\"));\n System.out.println(repoMensa.findOne(1));\n*/\n }", "public void addDicas(){\n\t\tMetaDica metaDicaOac = new MetaDica(oac, \"user1\", \"Não falte as aulas, toda aula tem ponto extra!\");\n\t\tmetaDicaOac.setConcordancias(5);\n\t\tdao.persist(metaDicaOac);\n\n\t\tdicaExerciciosOac = new DicaConselho(\"Os exercicios extras valem muitos pontos, nao deixe de fazer\");\n\t\tdicaExerciciosOac.setTema(temaOacExercicios);\n\t\ttemaOacExercicios.setDisciplina(oac);\n\t\tdicaExerciciosOac.setUser(\"user5\");\n\t\tdicaExerciciosOac.addUsuarioQueVotou(\"user1\");\n\t\tdicaExerciciosOac.addUsuarioQueVotou(\"user2\");\n\n\t\t//adiciona pontos a dica\n\t\tfor (int i = 0; i < 20;i++){\n\t\t\tdicaExerciciosOac.incrementaConcordancias();\n\t\t}\n\t\tfor (int i = 0; i < 5;i++){\n\t\t\tdicaExerciciosOac.incrementaDiscordancias();\n\t\t}\n\n\t\t//adiciona pontos a dica\n\t\tfor (int i = 0; i < 5;i++){\n\t\t\tdicaExerciciosOac.incrementaConcordancias();\n\t\t}\n\t\tfor (int i = 0; i < 25;i++){\n\t\t\tdicaExerciciosOac.incrementaDiscordancias();\n\t\t}\n\t\tdao.persist(dicaExerciciosOac);\n\n\t\tdicaRevisaoIcOac = new DicaAssunto(\"Antes das aulas faça uma boa revisao de IC\");\n\t\ttemaOacRevisaoIC.setDisciplina(oac);\n\t\tdicaRevisaoIcOac.setTema(temaOacRevisaoIC);\n\t\tdicaRevisaoIcOac.setUser(\"user4\");\n\t\tdicaRevisaoIcOac.addUsuarioQueVotou(\"user5\");\n\t\tdicaRevisaoIcOac.addUsuarioQueVotou(\"user1\");\n\t\tdicaRevisaoIcOac.incrementaConcordancias();\n\t\tdicaRevisaoIcOac.incrementaConcordancias();\n\n\t\t//cria meta dica em si\n\t\tMetaDica metaDicaSi1 = new MetaDica(si1, \"user2\", \"Seja autodidata! Procure por cursos online\");\n\t\tdao.persist(metaDicaSi1);\n\n\t\tdicaLabSi = new DicaConselho(\"Faça todo os labs, não deixe acumular\");\n\t\ttemaMinitestesSi.setDisciplina(si1);\n\t\tdicaLabSi.setTema(temaMinitestesSi);\n\t\tdicaLabSi.setUser(\"user1\");\n\t\tdicaLabSi.addUsuarioQueVotou(\"user2\");\n\t\tdicaLabSi.addUsuarioQueVotou(\"user3\");\n\t\tdicaLabSi.incrementaConcordancias();\n\t\tdicaLabSi.incrementaConcordancias();\n\t\tdao.persist(dicaLabSi);\n\n\t\tdicaPlaySi = new DicaConselho(\"Comece a configurar o Play no primeiro dia de aula, pois dá muuuito trabalho\");\n\t\ttemaPlaySi.setDisciplina(si1);\n\t\tdicaPlaySi.setTema(temaPlaySi);\n\t\tdicaPlaySi.setUser(\"user2\");\n\t\tdicaPlaySi.addUsuarioQueVotou(\"user5\");\n\t\tdicaPlaySi.addUsuarioQueVotou(\"user4\");\n\t\tdicaPlaySi.incrementaConcordancias();\n\t\tdicaPlaySi.incrementaConcordancias();\n\t\tdao.persist(dicaPlaySi);\n\n\t\tdicaMaterialSi = new DicaMaterial(\"http://www.wthreex.com/rup/process/workflow/ana_desi/co_swarch.htm\");\n\t\ttemaMaterialSi.setDisciplina(si1);\n\t\tdicaMaterialSi.setTema(temaMaterialSi);\n\t\tdicaMaterialSi.setUser(\"user2\");\n\t\tdicaMaterialSi.addUsuarioQueVotou(\"user5\");\n\t\tdicaMaterialSi.addUsuarioQueVotou(\"user4\");\n\t\tdicaMaterialSi.incrementaConcordancias();\n\t\tdicaMaterialSi.incrementaConcordancias();\n\t\tdao.persist(dicaMaterialSi);\n\n\n\t\t//cria meta dica logica\n\t\tMetaDica metaDicaLogica = new MetaDica(logica, \"user3\", \"Copie para o seu caderno tudo que o professor copiar no quadro, TUDO!\");\n\t\tdao.persist(metaDicaLogica);\n\n\t\tdicaListasLogica = new DicaConselho(\"Faça todas as listas possíveis\");\n\t\ttemaListasLogica.setDisciplina(logica);\n\t\tdicaListasLogica.setTema(temaListasLogica);\n\t\tdicaListasLogica.setTema(temaListasLogica);\n\t\tdicaListasLogica.setUser(\"user6\");\n\t\tdicaListasLogica.addUsuarioQueVotou(\"user3\");\n\t\tdicaListasLogica.addUsuarioQueVotou(\"user5\");\n\t\tdicaListasLogica.incrementaConcordancias();\n\t\tdicaListasLogica.incrementaConcordancias();\n\t\tdao.persist(dicaListasLogica);\n\n\t\tdicaProjetoLogica = new DicaAssunto(\"Peça ajuda ao monitor responsável por seu grupo, começe o projeto assim que for lançado!\");\n\t\ttemaProjetoLogica.setDisciplina(logica);\n\t\tdicaProjetoLogica.setTema(temaProjetoLogica);\n\t\tdicaProjetoLogica.setTema(temaProjetoLogica);\n\t\tdicaProjetoLogica.setUser(\"user4\");\n\t\tdicaProjetoLogica.addUsuarioQueVotou(\"user1\");\n\t\tdicaProjetoLogica.addUsuarioQueVotou(\"user2\");\n\t\tdicaProjetoLogica.incrementaConcordancias();\n\t\tdicaProjetoLogica.incrementaConcordancias();\n\t\tdao.persist(dicaProjetoLogica);\n\n\t\tdao.flush();\n\n\t}", "public void carregarCadastro() {\n\n try {\n\n if (codigo != null) {\n\n ClienteDao fdao = new ClienteDao();\n\n cliente = fdao.buscarCodigo(codigo);\n\n } else {\n cliente = new Cliente();\n\n }\n } catch (RuntimeException e) {\n JSFUtil.AdicionarMensagemErro(\"ex.getMessage()\");\n e.printStackTrace();\n }\n\n }", "public List<Soldados> conectar(){\n EntityManagerFactory conexion = Persistence.createEntityManagerFactory(\"ABP_Servicio_MilitarPU\");\n //creamos una instancia de la clase controller\n SoldadosJpaController tablasoldado = new SoldadosJpaController(conexion);\n //creamos una lista de soldados\n List<Soldados> listasoldado = tablasoldado.findSoldadosEntities();\n \n return listasoldado;\n }", "protected void accionUsuario() {\n\t\t\r\n\t}", "private void salvar() {\n try {\n validarCampos();\n Cliente c = new Cliente();\n c.setUserLogin(fldUsuario.getText());\n c.setSenha(fldSenha.getText());\n ClienteDao cd = new ClienteDao();\n cd.usuarioCliente(c);\n JOptionPane.showMessageDialog(null, \"Usuário cadastrado com sucesso\",\"\",JOptionPane.PLAIN_MESSAGE);\n dispose();\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage(),\"\",JOptionPane.ERROR_MESSAGE);\n } catch (Exception e){\n JOptionPane.showMessageDialog(null, e.getMessage(),\"\",JOptionPane.ERROR_MESSAGE);\n }\n }", "public Usuarios(String Cedula){ //método que retorna atributos asociados con la cedula que recibamos\n conexion = base.GetConnection();\n PreparedStatement select;\n try {\n select = conexion.prepareStatement(\"select * from usuarios where Cedula = ?\");\n select.setString(1, Cedula);\n boolean consulta = select.execute();\n if(consulta){\n ResultSet resultado = select.getResultSet();\n if(resultado.next()){\n this.Cedula= resultado.getString(1);\n this.Nombres= resultado.getString(2);\n \n this.Sexo= resultado.getString(3);\n this.Edad= resultado.getInt(4);\n this.Direccion= resultado.getString(5);\n this.Ciudad=resultado.getString(6);\n this.Contrasena=resultado.getString(7);\n this.Estrato=resultado.getInt(8);\n this.Rol=resultado.getString(9);\n }\n resultado.close();\n }\n conexion.close();\n } catch (SQLException ex) {\n System.err.println(\"Ocurrió un error: \"+ex.getMessage().toString());\n }\n}", "public List<Usuario> listarTodos() {\n List<Usuario> r = new ArrayList<>();\n try {\n try (Connection cnx = bd.obtenerConexion(Credenciales.BASE_DATOS, Credenciales.USUARIO, Credenciales.CLAVE);\n Statement stm = cnx.createStatement();\n ResultSet rs = stm.executeQuery(CMD_LISTAR2)) {\n while (rs.next()) {\n r.add(new Usuario(\n rs.getString(\"cedula\"),\n rs.getString(\"apellido1\"),\n rs.getString(\"apellido2\"),\n rs.getString(\"nombre\")\n ));\n }\n }\n } catch (SQLException ex) {\n System.err.printf(\"Excepción: '%s'%n\",\n ex.getMessage());\n }\n return r;\n }", "public void gravarBd(Aluno a) {\n\t\t\n\t\t\n\t\ttry {\n\t\t\tConnection con = DBUtil.getInstance().getConnection();\n\t\t\tPreparedStatement stmt = con.prepareStatement(\"INSERT INTO Aluno\"\n\t\t\t\t\t+ \"(idAluno, Nome)\"+\n\t\t\t\t\t\"VALUES(?,?)\");\n\t\t\tstmt.setInt(1,a.getNumero());\n\t\t\tstmt.setString(2, a.getNome());\n\t\t\tstmt.executeUpdate();\n\t\t\tJOptionPane.showMessageDialog(null,\"Cadastrado com sucesso!\");\n\t\t} \n\t\tcatch(com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Numero ja existe\", \"ERRO\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t\t catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Erro no Sql, verifique o banco\", \"ERRO\", JOptionPane.ERROR_MESSAGE);\n\n\t\t\t}\n\t\n\t\t\n\t}", "private void iniciaFrm() {\n statusLbls(false);\n statusBtnInicial();\n try {\n clientes = new Cliente_DAO().findAll();\n } catch (Exception ex) {\n Logger.getLogger(JF_CadastroCliente.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void habilitarCamposModif() {\n\n listarPromotoresModif();\n //limpiarListaCrear();\n }", "public void CrearBDatos(Connection conn, String sNombreBDatos) {\r\n\t\tString \tsqlDB=consultas.CrearBDatos(sNombreBDatos),\r\n\t\t\t\tsqlUsarDB=consultas.UsarBDatos(sNombreBDatos),\r\n\t\t\t\tsqlTablaCliente=consultas.CrearTablaCliente(),\r\n\t\t\t\tsqlTablaDepartamento=consultas.CrearTablaDepartamentos(),\r\n\t\t\t\tsqlTablaFuncionarios=consultas.CrearTablaFuncionarios(),\r\n\t\t\t\tsqlTablaHorasFun=consultas.CrearTablaHorasFunc(),\r\n\t\t\t\tsqltablaServicios=consultas.CrearTablaServicios();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tStatement stmt=conn.createStatement();\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tstmt.executeUpdate(sqlDB);\r\n\t\t\t\tstmt.executeUpdate(sqlUsarDB);\r\n\t\t\t\tstmt.executeUpdate(sqlTablaCliente);\r\n\t\t\t\tstmt.executeUpdate(sqlTablaDepartamento);\t\t\t\t\r\n\t\t\t\tstmt.executeUpdate(sqlTablaFuncionarios);\r\n\t\t\t\tstmt.executeUpdate(sqltablaServicios);\r\n\t\t\t\tstmt.executeUpdate(sqlTablaHorasFun);\r\n\t\t\t\tstmt.close();\r\n\t\t\t\r\n\t\t\t}catch (SQLException e){stmt.close(); e.getStackTrace();}\r\n\t\t}catch (SQLException e){\te.getStackTrace();}\r\n\t\tAgregarDepartamentos(conn);\r\n\r\n\t}", "public int almacenarCambiosCuenta(Connection conn, BCuenta cuenta, BUsuario usuario, Lista listaAdicionales, BSucursal sucursal)throws SQLException{\r\n\t\tICuenta daoCliente = new DCuenta();\r\n\t\tITarjetaFidelizacion tarjetaFidel = new DTarjetaFidelizacion();\r\n\t\t//actualiza la tarjeta del cliente titular\r\n\t\tdaoCliente.actualizarTarjetaClienteTitular(conn, (BTarjetaFidelizacion)cuenta.getTarjeta().getElemento(0), usuario, sucursal, cuenta.getCodigo());\r\n\t\tBTarjetaFidelizacion tarjeta;\r\n\t\t//primero debo eliminarlos\r\n\t\t\r\n\t\tfor(int i=0; i< listaAdicionales.getTamanio();i++){\r\n\t\t\ttarjeta = (BTarjetaFidelizacion)listaAdicionales.getElemento(i);\r\n\t\t\tif(tarjetaFidel.buscarClienteFidelizado(tarjeta.getCliente(),cuenta)){\r\n\t\t\t\tdaoCliente.actualizarTarjetaClienteTitular(conn, tarjeta, usuario, sucursal, cuenta.getCodigo());\r\n\t\t\t}else{\r\n\t\t\t\ttarjetaFidel.almacenarTarjeta(conn, tarjeta, usuario, sucursal, cuenta.getCodigo());\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t}\r\n\t\treturn cuenta.getCodigo();\r\n\t}", "private void carregaLista() {\n listagem = (ListView) findViewById(R.id.lst_cadastrados);\n dbhelper = new DBHelper(this);\n UsuarioDAO dao = new UsuarioDAO(dbhelper);\n //Preenche a lista com os dados do banco\n List<Usuarios> usuarios = dao.buscaUsuarios();\n dbhelper.close();\n UsuarioAdapter adapter = new UsuarioAdapter(this, usuarios);\n listagem.setAdapter(adapter);\n }", "public void limpiarDatos() {\r\n FormularioUtil.limpiarComponentes(groupboxEditar, idsExcluyentes);\r\n tbxNro_identificacion.setValue(\"\");\r\n tbxNro_identificacion.setDisabled(false);\r\n deshabilitarCampos(true);\r\n\r\n }", "private void guardarCredenciales(String codigo,String contra){\n SharedPreferences sharedPreferences = getPreferences(getApplicationContext().MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"USUARIO\",codigo);\n editor.putString(\"PASSWORD\",contra);\n editor.commit();\n }", "public DatoGeneralMinimo getEntityDatoGeneralMinimoGenerico(Connexion connexion,QueryWhereSelectParameters queryWhereSelectParameters,ArrayList<Classe> classes) throws SQLException,Exception { //Banco\r\n\t\tDatoGeneralMinimo datoGeneralMinimo= new DatoGeneralMinimo();\r\n\t\t\r\n\t\tBanco entity = new Banco();\r\n\t\t\t\t\r\n try {\t\t\t\r\n\t\t\tString sQuery=\"\";\r\n \t String sQuerySelect=\"\";\r\n\t\t\t\r\n\t\t\tStatement statement = connexion.getConnection().createStatement();\t\t\t\r\n\t\t\t\r\n\t\t\tif(!queryWhereSelectParameters.getSelectQuery().equals(\"\")) {\r\n\t\t\t\tsQuerySelect=queryWhereSelectParameters.getSelectQuery();\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tif(!this.isForForeingKeyData) {\r\n\t\t\t\t\tsQuerySelect=BancoDataAccess.QUERYSELECTNATIVE;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsQuerySelect=BancoDataAccess.QUERYSELECTNATIVEFORFOREINGKEY;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n \t sQuery=DataAccessHelper.buildSqlGeneralGetEntitiesJDBC(entity,BancoDataAccess.TABLENAME+\".\",queryWhereSelectParameters,sQuerySelect);\r\n\t\t\t\r\n\t\t\tif(Constantes2.ISDEVELOPING_SQL) {\r\n \tFunciones2.mostrarMensajeDeveloping(sQuery);\r\n }\r\n\t\t\t\r\n \t \tResultSet resultSet = statement.executeQuery(sQuery);//Tesoreria.Banco.isActive=1\r\n \t \r\n\t\t\t//ResultSetMetaData metadata = resultSet.getMetaData();\r\n \t \t\r\n \t \t//int iTotalCountColumn = metadata.getColumnCount();\r\n\t\t\t\t\r\n\t\t\t//if(queryWhereSelectParameters.getIsGetGeneralObjects()) {\r\n\t\t\t\tif(resultSet.next()) {\t\t\t\t\r\n\t\t\t\t\tfor(Classe classe:classes) {\r\n\t\t\t\t\t\tDataAccessHelperBase.setFieldDynamic(datoGeneralMinimo,classe,resultSet);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*\r\n\t\t\t\t\tint iIndexColumn = 1;\r\n\t\t\t\t \r\n\t\t\t\t\twhile(iIndexColumn <= iTotalCountColumn) {\r\n\t\t\t\t\t\t//arrayListObject.add(resultSet.getObject(iIndexColumn++));\r\n\t\t\t\t }\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t*/\r\n\t\t\t\t} else {\r\n\t\t\t\t\tentity =null;\r\n\t\t\t\t}\r\n\t\t\t//}\r\n\t\t\t\r\n\t\t\tif(entity!=null) {\r\n\t\t\t\t//this.setIsNewIsChangedFalseBanco(entity);\r\n\t\t\t}\r\n\t\t\t\r\n \t statement.close(); \r\n\t\t\r\n\t\t} \r\n\t\tcatch(Exception e) {\r\n\t\t\tthrow e;\r\n \t}\r\n\t\t\r\n \t//return entity;\t\r\n\t\t\r\n\t\treturn datoGeneralMinimo;\r\n }", "public void editarData(){\n\t\talunoTurmaService.inserirAlterar(alunoTurmaAltera);\n\t\t\n\t\t\n\t\tmovimentacao.setDataMovimentacao(alunoTurmaAltera.getDataMudanca());\n\t\tmovimentacaoService.inserirAlterar(movimentacao);\n\t\t\n\t\tFecharDialog.fecharDialogDATAAluno();\n\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\talunoTurmaAltera = new AlunoTurma();\n\t\tmovimentacao = new Movimentacao();\n\t\t\n\t\tatualizarListas();\n\t}", "public void setContratos(List<ContratoDTO> contratos) {\r\n this.contratos = contratos;\r\n }", "private void cargaPermisos() {\n habilitaCampos();\n \n //Abre la conexion\n Connection con = Star.conAbrBas(true, false);\n \n //Declara variables de la base de datos \n java.sql.Statement st;\n java.sql.ResultSet rs; \n String sQ;\n \n try {\n /*Obtiene todos los datos del usuario*/\n sQ = \"SELECT * FROM er_permisos WHERE FKIdUsuario = (SELECT id_id FROM estacs WHERE estac = '\"+jcmbUsuarios.getSelectedItem().toString()+\"')\";\n st = con.createStatement();\n rs = st.executeQuery(sQ);\n /*Si hay datos*/\n if(rs.next())\n {\n /*Obtiene los datos y cargalos en sus campos*/\n llenaPermisos(rs,jcbConf,jcbConfCorreos,jcbConfDatos,jcbconfSeries,jcbConfImpresoras,jcbConfCambiarIcono,jcbConfConfiguraciones, jcbConfiguracionesPermiso,\n jcbUsuarios, jcbDefinirUsr, jcbUsrConectados, jcbPermisosUsr,jcbClaves, jcbReparar, jcbReparador, jcbRestaurar, jcbBaseDatos, jcbConexionesBD, jcbArchivoConf,jcbReportes, jcbRepUsuarios, jcbRepRespaldos, jcbRepLog, jcbRepEstadisticas, jcbRevocacion, jcbActivar,jcbSistemaPermiso,\n jcbContabilidad, jcbConceptos, jcbCatalogo, jcbZonas, jcbGiros, jcbMonedas, jcbImpuestos, jcbModulosPermiso,\n jcbCompras, jcbCancelarCompra, jcbDevolCompra, jcbParcialCompra, jcbNuevoCompra,jcbNotCompra, jcbVerCompra,jcbCargarArchivoCompra, jcbBorrarArchivoCompra, jcbRecibirCompra, jcbComprasPermiso,\n jcbProve, jcbProveNuevo, jcbProveModificar, jcbProveVer, jcbProveBorrar, jcbProveePermiso,\n jcbPrevioCompra, jcbNuevaPrevio, jcbAbrirPrevio, jcbVerPrevio, jcbCancelarPrevio, jcbSeriesPrevio,jcbCompraPrevio,jcbPrevioPermiso,\n jcbInventario, jcbProductos, jcbNuevoProd, jcbModificarProd, jcbBorrarProd, jcbInventarioPermiso,\n jcbClientes, jcbClieNuevo, jcbClieModificar, jcbClieVer, jcbClieBorrar, jcbClieEnviar, jcbClientesPermiso,\n jcbVentas, jcbCancelarVentas, jcbDevolVentas, jcbParcialVentas, jcbNuevaVentas, jcbNotVentas, jcbVerVentas, jcbEnviarVentas, jcbTimbrarVentas, jcbEntregarVentas, jcbComprobarVentas, jcbAcuseVentas, jcbObtenerXmlVentas, jcbFacturarVentas, jcbCargarArchivoVentas, jcbBorrarArchivoVentas, jcbVentasPermiso,\n jcbCotizaciones, jcbNuevaCotiza, jcbAbrirCotiza, jcbVerCotiza, jcbCancelarCotiza, jcbReenviarCotiza, jcbVentaCotiza, jcbCotizaPermiso);\n \n }\n } catch (SQLException ex) {\n Logger.getLogger(PermsEstacs.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n try {\n /*Obtiene todos los datos del usuario*/\n sQ = \"SELECT otorgaPermisosConfig, otorgaPermisosSistema, otorgaPermisosModulos, otorgaPermisosCompras, otorgaPermisosProvee, otorgaPermisosPrevio, otorgaPermisosInventario, otorgaPermisosClientes, otorgaPermisosVentas, otorgaPermisosCotiza FROM er_permisos WHERE FKIdUsuario = (SELECT id_id FROM estacs WHERE estac = '\"+Login.sUsrG+\"')\";\n st = con.createStatement();\n rs = st.executeQuery(sQ);\n /*Si hay datos*/\n if(rs.last())\n {\n //Desactiva los permisos a los cuales no tiene permiso el usuario actual\n revisaOtorgaPermisos(rs);\n \n }\n } catch (SQLException ex) {\n Logger.getLogger(PermsEstacs.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void listarContato(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString id = request.getParameter(\"id\");\n\t\t// System.out.println(id);//teste de recebimento do ID\n\n\t\t// evio do ID - Send ID\n\t\tcontato.setId(id);\n\t\t// executar o metodo selecionarContato - execute method selecionarContato\n\t\tdao.selecionarContato(contato);\n\t\t// test\n\t\t/*\n\t\t * System.out.println(contato.getId()); System.out.println(contato.getNome());\n\t\t * System.out.println(contato.getFone());\n\t\t * System.out.println(contato.getEmail());\n\t\t */\n\t\t// setar os atributos no formulário - show information in form edit\n\t\trequest.setAttribute(\"id\", contato.getId());\n\t\trequest.setAttribute(\"nome\", contato.getNome());\n\t\trequest.setAttribute(\"fone\", contato.getFone());\n\t\trequest.setAttribute(\"email\", contato.getEmail());\n\t\t// enviar para editar.jsp - send to editar.jsp\n\t\tRequestDispatcher rd = request.getRequestDispatcher(\"editar.jsp\");\n\t\trd.forward(request, response);\n\n\t}", "void cargarDatos(Persona beanTabla) {\n this.oPersona = beanTabla;\n oFondoSolidaridad = new FondoSolidaridad();\n\n if (oPersona != null) {\n oBlFondoPrevision = new FondoPrevisionBl();\n listFondos = oBlFondoPrevision.listar(oPersona.getIdpersona());\n oFondoSolidaridad.setPersona(oPersona);\n if (listFondos.isEmpty()) {\n JOptionPane.showMessageDialog(null, \"La persona no tiene fondos\", \"ATENCION\", JOptionPane.ERROR_MESSAGE);\n } else {\n for (FondoSolidaridad obj : listFondos) {\n oModeloFondoPrevision.add(obj);\n }\n\n }\n\n } else {\n JOptionPane.showMessageDialog(null, \"Verifique sus datos\", \"ATENCION\", JOptionPane.ERROR_MESSAGE);\n }\n }", "boolean setDadosInsercao(Object dados);", "public void mostrarDatos(Object obj) throws Exception {\r\n\t\tHis_atencion_embarazada his_atencion_embarazada = (His_atencion_embarazada) obj;\r\n\t\ttry {\r\n\t\t\ttbxCodigo_historia.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCodigo_historia());\r\n\t\t\tdtbxFecha_inicial.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getFecha_inicial());\r\n\r\n\t\t\tAdministradora administradora = new Administradora();\r\n\t\t\tadministradora.setCodigo(his_atencion_embarazada.getCodigo_eps());\r\n\t\t\tadministradora = getServiceLocator().getAdministradoraService()\r\n\t\t\t\t\t.consultar(administradora);\r\n\r\n\t\t\ttbxCodigo_eps.setValue(administradora != null ? administradora\r\n\t\t\t\t\t.getCodigo() : \"\");\r\n\t\t\ttbxNombre_eps.setValue(administradora != null ? administradora\r\n\t\t\t\t\t.getNombre() : \"\");\r\n\r\n\t\t\tfor (int i = 0; i < lbxCodigo_dpto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCodigo_dpto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getCodigo_dpto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCodigo_dpto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlistarMunicipios(lbxCodigo_municipio, lbxCodigo_dpto);\r\n\r\n\t\t\tPaciente paciente = new Paciente();\r\n\t\t\tpaciente.setCodigo_empresa(his_atencion_embarazada\r\n\t\t\t\t\t.getCodigo_empresa());\r\n\t\t\tpaciente.setCodigo_sucursal(his_atencion_embarazada\r\n\t\t\t\t\t.getCodigo_sucursal());\r\n\t\t\tpaciente.setNro_identificacion(his_atencion_embarazada\r\n\t\t\t\t\t.getIdentificacion());\r\n\t\t\tpaciente = getServiceLocator().getPacienteService().consultar(\r\n\t\t\t\t\tpaciente);\r\n\r\n\t\t\tElemento elemento = new Elemento();\r\n\t\t\telemento.setCodigo(paciente.getSexo());\r\n\t\t\telemento.setTipo(\"sexo\");\r\n\t\t\telemento = getServiceLocator().getElementoService().consultar(\r\n\t\t\t\t\telemento);\r\n\r\n\t\t\ttbxIdentificacion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getIdentificacion());\r\n\t\t\ttbxNomPaciente.setValue((paciente != null ? paciente.getNombre1()\r\n\t\t\t\t\t+ \" \" + paciente.getApellido1() : \"\"));\r\n\t\t\ttbxTipoIdentificacion.setValue((paciente != null ? paciente\r\n\t\t\t\t\t.getTipo_identificacion() : \"\"));\r\n\t\t\ttbxEdad_madre.setValue(Util.getEdad(new java.text.SimpleDateFormat(\r\n\t\t\t\t\t\"dd/MM/yyyy\").format(paciente.getFecha_nacimiento()),\r\n\t\t\t\t\tpaciente.getUnidad_medidad(), false));\r\n\t\t\ttbxSexo_madre.setValue((elemento != null ? elemento\r\n\t\t\t\t\t.getDescripcion() : \"\"));\r\n\t\t\tdbxNacimiento.setValue(paciente.getFecha_nacimiento());\r\n\r\n\t\t\ttbxMotivo.setValue(his_atencion_embarazada.getDireccion());\r\n\t\t\ttbxTelefono.setValue(his_atencion_embarazada.getTelefono());\r\n\t\t\tRadio radio = (Radio) rdbSeleccion.getFellow(\"Seleccion\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getSeleccion());\r\n\t\t\tradio.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxGestaciones.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxGestaciones.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getGestaciones())) {\r\n\t\t\t\t\ti = lbxGestaciones.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxPartos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxPartos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getPartos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxPartos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxCesarias.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCesarias.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getCesarias())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCesarias.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxAbortos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxAbortos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getAbortos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxAbortos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxEspontaneo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxEspontaneo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getEspontaneo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxEspontaneo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxProvocado.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxProvocado.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getProvocado())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxProvocado.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxNacido_muerto.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNacido_muerto.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getNacido_muerto())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNacido_muerto.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxPrematuro.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxPrematuro.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getPrematuro())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxPrematuro.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxHijos_menos.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHijos_menos.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHijos_menos())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHijos_menos.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxHijos_mayor.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHijos_mayor.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHijos_mayor())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHijos_mayor.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxMalformado.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxMalformado.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getMalformado())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxMalformado.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxHipertension.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHipertension.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHipertension())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHipertension.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdtbxFecha_ultimo_parto.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getFecha_ultimo_parto());\r\n\t\t\tfor (int i = 0; i < lbxCirugia.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCirugia.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getCirugia())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCirugia.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxOtro_antecedente.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getOtro_antecedente());\r\n\t\t\tfor (int i = 0; i < lbxHemoclasificacion.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHemoclasificacion.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHemoclasificacion())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHemoclasificacion.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxRh.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxRh.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getRh())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxRh.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxPeso.setValue(his_atencion_embarazada.getPeso());\r\n\t\t\ttbxTalla.setValue(his_atencion_embarazada.getTalla());\r\n\t\t\ttbxImc.setValue(his_atencion_embarazada.getImc());\r\n\t\t\ttbxTa.setValue(his_atencion_embarazada.getTa());\r\n\t\t\ttbxFc.setValue(his_atencion_embarazada.getFc());\r\n\t\t\ttbxFr.setValue(his_atencion_embarazada.getFr());\r\n\t\t\ttbxTemperatura.setValue(his_atencion_embarazada.getTemperatura());\r\n\t\t\ttbxCroomb.setValue(his_atencion_embarazada.getCroomb());\r\n\t\t\tdtbxFecha_ultima_mestruacion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getFecha_ultima_mestruacion());\r\n\t\t\tdtbxFecha_probable_parto.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getFecha_probable_parto());\r\n\t\t\ttbxEdad_gestacional.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getEdad_gestacional());\r\n\t\t\tfor (int i = 0; i < lbxControl.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxControl.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getControl())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxControl.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxNum_control.setValue(his_atencion_embarazada.getNum_control());\r\n\t\t\tfor (int i = 0; i < lbxFetales.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFetales.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getFetales())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFetales.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxFiebre.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFiebre.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getFiebre())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFiebre.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxLiquido.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxLiquido.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getLiquido())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxLiquido.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxFlujo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFlujo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getFlujo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFlujo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxEnfermedad.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxEnfermedad.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getEnfermedad())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxEnfermedad.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_enfermedad.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCual_enfermedad());\r\n\t\t\tfor (int i = 0; i < lbxCigarrillo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxCigarrillo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getCigarrillo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxCigarrillo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxAlcohol.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxAlcohol.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getAlcohol())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxAlcohol.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_alcohol.setValue(his_atencion_embarazada.getCual_alcohol());\r\n\t\t\tfor (int i = 0; i < lbxDroga.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxDroga.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getDroga())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxDroga.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_droga.setValue(his_atencion_embarazada.getCual_droga());\r\n\t\t\tfor (int i = 0; i < lbxViolencia.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxViolencia.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getViolencia())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxViolencia.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_violencia.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCual_violencia());\r\n\t\t\tfor (int i = 0; i < lbxToxoide.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxToxoide.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getToxoide())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxToxoide.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxDosis.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxDosis.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getDosis())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxDosis.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxObservaciones_gestion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getObservaciones_gestion());\r\n\t\t\ttbxAltura_uterina.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getAltura_uterina());\r\n\t\t\tchbCorelacion.setChecked(his_atencion_embarazada.getCorelacion());\r\n\t\t\tchbEmbarazo_multiple.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getEmbarazo_multiple());\r\n\t\t\tchbTrasmision_sexual.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getTrasmision_sexual());\r\n\t\t\tRadio radio1 = (Radio) rdbAnomalia.getFellow(\"Anomalia\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getAnomalia());\r\n\t\t\tradio1.setChecked(true);\r\n\t\t\tRadio radio2 = (Radio) rdbEdema_gestion.getFellow(\"Edema_gestion\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getEdema_gestion());\r\n\t\t\tradio2.setChecked(true);\r\n\t\t\tRadio radio3 = (Radio) rdbPalidez.getFellow(\"Palidez\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getPalidez());\r\n\t\t\tradio3.setChecked(true);\r\n\t\t\tRadio radio4 = (Radio) rdbConvulciones.getFellow(\"Convulciones\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getConvulciones());\r\n\t\t\tradio4.setChecked(true);\r\n\t\t\tRadio radio5 = (Radio) rdbConciencia.getFellow(\"Conciencia\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getConciencia());\r\n\t\t\tradio5.setChecked(true);\r\n\t\t\tRadio radio6 = (Radio) rdbCavidad_bucal.getFellow(\"Cavidad_bucal\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getCavidad_bucal());\r\n\t\t\tradio6.setChecked(true);\r\n\t\t\ttbxHto.setValue(his_atencion_embarazada.getHto());\r\n\t\t\ttbxHb.setValue(his_atencion_embarazada.getHb());\r\n\t\t\ttbxToxoplasma.setValue(his_atencion_embarazada.getToxoplasma());\r\n\t\t\ttbxVdrl1.setValue(his_atencion_embarazada.getVdrl1());\r\n\t\t\ttbxVdrl2.setValue(his_atencion_embarazada.getVdrl2());\r\n\t\t\ttbxVih1.setValue(his_atencion_embarazada.getVih1());\r\n\t\t\ttbxVih2.setValue(his_atencion_embarazada.getVih2());\r\n\t\t\ttbxHepb.setValue(his_atencion_embarazada.getHepb());\r\n\t\t\ttbxOtro.setValue(his_atencion_embarazada.getOtro());\r\n\t\t\ttbxEcografia.setValue(his_atencion_embarazada.getEcografia());\r\n\t\t\tRadio radio7 = (Radio) rdbClasificacion_gestion\r\n\t\t\t\t\t.getFellow(\"Clasificacion_gestion\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada\r\n\t\t\t\t\t\t\t\t\t.getClasificacion_gestion());\r\n\t\t\tradio7.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxContracciones.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxContracciones.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getContracciones())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxContracciones.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxNum_contracciones.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxNum_contracciones.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getNum_contracciones())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxNum_contracciones.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxHemorragia.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHemorragia.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHemorragia())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHemorragia.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxLiquido_vaginal.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxLiquido_vaginal.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getLiquido_vaginal())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxLiquido_vaginal.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxColor_liquido.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getColor_liquido());\r\n\t\t\tfor (int i = 0; i < lbxDolor_cabeza.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxDolor_cabeza.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getDolor_cabeza())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxDolor_cabeza.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxVision.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxVision.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getDolor_cabeza())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxVision.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxConvulcion.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxConvulcion.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getConvulcion())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxConvulcion.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxObservaciones_parto.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getObservaciones_parto());\r\n\t\t\ttbxContracciones_min.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getContracciones_min());\r\n\t\t\ttbxFc_fera.setValue(his_atencion_embarazada.getFc_fera());\r\n\t\t\ttbxDilatacion_cervical.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getDilatacion_cervical());\r\n\t\t\tRadio radio8 = (Radio) rdbPreentacion.getFellow(\"Preentacion\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getPreentacion());\r\n\t\t\tradio8.setChecked(true);\r\n\t\t\ttbxOtra_presentacion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getOtra_presentacion());\r\n\t\t\tRadio radio9 = (Radio) rdbEdema.getFellow(\"Edema\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getEdema());\r\n\t\t\tradio9.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxHemorragia_vaginal.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxHemorragia_vaginal.getItemAtIndex(i);\r\n\t\t\t\tif (listitem\r\n\t\t\t\t\t\t.getValue()\r\n\t\t\t\t\t\t.toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getHemorragia_vaginal())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxHemorragia_vaginal.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxHto_parto.setValue(his_atencion_embarazada.getHto_parto());\r\n\t\t\ttbxHb_parto.setValue(his_atencion_embarazada.getHb_parto());\r\n\t\t\ttbxHepb_parto.setValue(his_atencion_embarazada.getHepb_parto());\r\n\t\t\ttbxVdrl_parto.setValue(his_atencion_embarazada.getVdrl_parto());\r\n\t\t\ttbxVih_parto.setValue(his_atencion_embarazada.getVih_parto());\r\n\t\t\tRadio radio10 = (Radio) rdbClasificacion_parto\r\n\t\t\t\t\t.getFellow(\"Clasificacion_parto\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getClasificacion_parto());\r\n\t\t\tradio10.setChecked(true);\r\n\t\t\tdtbxFecha_nac.setValue(his_atencion_embarazada.getFecha_nac());\r\n\t\t\ttbxIdentificacion_nac.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getIdentificacion_nac());\r\n\t\t\tfor (int i = 0; i < lbxSexo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxSexo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getSexo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxSexo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxPeso_nac.setValue(his_atencion_embarazada.getPeso_nac());\r\n\t\t\ttbxTalla_nac.setValue(his_atencion_embarazada.getTalla_nac());\r\n\t\t\ttbxPc_nac.setValue(his_atencion_embarazada.getPc_nac());\r\n\t\t\ttbxFc_nac.setValue(his_atencion_embarazada.getFc_nac());\r\n\t\t\ttbxTemper_nac.setValue(his_atencion_embarazada.getTemper_nac());\r\n\t\t\ttbxEdad.setValue(his_atencion_embarazada.getEdad());\r\n\t\t\ttbxAdgar1.setValue(his_atencion_embarazada.getAdgar1());\r\n\t\t\ttbxAdgar5.setValue(his_atencion_embarazada.getAdgar5());\r\n\t\t\ttbxAdgar10.setValue(his_atencion_embarazada.getAdgar10());\r\n\t\t\ttbxAdgar20.setValue(his_atencion_embarazada.getAdgar20());\r\n\t\t\ttbxObservaciones_nac.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getObservaciones_nac());\r\n\t\t\tRadio radio11 = (Radio) rdbClasificacion_nac\r\n\t\t\t\t\t.getFellow(\"Clasificacion_nac\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getClasificacion_nac());\r\n\t\t\tradio11.setChecked(true);\r\n\t\t\tchbReani_prematuro.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_prematuro());\r\n\t\t\tchbReani_meconio.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_meconio());\r\n\t\t\tchbReani_respiracion.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_respiracion());\r\n\t\t\tchbReani_hipotonico.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_hipotonico());\r\n\t\t\tchbReani_apnea.setChecked(his_atencion_embarazada.getReani_apnea());\r\n\t\t\tchbReani_jadeo.setChecked(his_atencion_embarazada.getReani_jadeo());\r\n\t\t\tchbReani_deficultosa.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_deficultosa());\r\n\t\t\tchbReani_gianosis.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_gianosis());\r\n\t\t\tchbReani_bradicardia.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_bradicardia());\r\n\t\t\tchbReani_hipoxemia.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_hipoxemia());\r\n\t\t\tchbReani_estimulacion.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_estimulacion());\r\n\t\t\tchbReani_ventilacion.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_ventilacion());\r\n\t\t\tchbReani_comprensiones.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_comprensiones());\r\n\t\t\tchbReani_intubacion.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getReani_intubacion());\r\n\t\t\ttbxMedicina.setValue(his_atencion_embarazada.getMedicina());\r\n\t\t\tRadio radio12 = (Radio) rdbClasificacion_reani\r\n\t\t\t\t\t.getFellow(\"Clasificacion_reani\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getClasificacion_reani());\r\n\t\t\tradio12.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxRuptura.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxRuptura.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getRuptura())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxRuptura.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxTiempo_ruptura.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxTiempo_ruptura.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getTiempo_ruptura())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxTiempo_ruptura.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxLiquido_neo.setValue(his_atencion_embarazada.getLiquido_neo());\r\n\t\t\tfor (int i = 0; i < lbxFiebre_neo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxFiebre_neo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getFiebre_neo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxFiebre_neo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < lbxTiempo_neo.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxTiempo_neo.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getTiempo_neo())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxTiempo_neo.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCoricamniotis.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCoricamniotis());\r\n\t\t\tRadio radio17 = (Radio) rdbIntrauterina.getFellow(\"Intrauterina\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getIntrauterina());\r\n\t\t\tradio17.setChecked(true);\r\n\t\t\tfor (int i = 0; i < lbxMadre20.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxMadre20.getItemAtIndex(i);\r\n\t\t\t\tif (listitem.getValue().toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada.getMadre20())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxMadre20.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tchbAlcohol_neo.setChecked(his_atencion_embarazada.getAlcohol_neo());\r\n\t\t\tchbDrogas_neo.setChecked(his_atencion_embarazada.getDrogas_neo());\r\n\t\t\tchbCigarrillo_neo.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getCigarrillo_neo());\r\n\t\t\tRadio radio13 = (Radio) rdbRespiracion_neo\r\n\t\t\t\t\t.getFellow(\"Respiracion_neo\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getRespiracion_neo());\r\n\t\t\tradio13.setChecked(true);\r\n\t\t\tRadio radio14 = (Radio) rdbLlanto_neo.getFellow(\"Llanto_neo\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getLlanto_neo());\r\n\t\t\tradio14.setChecked(true);\r\n\t\t\tRadio radio15 = (Radio) rdbVetalidad_neo.getFellow(\"Vetalidad_neo\"\r\n\t\t\t\t\t+ his_atencion_embarazada.getVetalidad_neo());\r\n\t\t\tradio15.setChecked(true);\r\n\t\t\tchbTaquicardia_neo.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getTaquicardia_neo());\r\n\t\t\tchbBradicardia_neo.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getBradicardia_neo());\r\n\t\t\tchbPalidez_neo.setChecked(his_atencion_embarazada.getPalidez_neo());\r\n\t\t\tchbCianosis_neo.setChecked(his_atencion_embarazada\r\n\t\t\t\t\t.getCianosis_neo());\r\n\t\t\tfor (int i = 0; i < lbxAnomalias_congenitas.getItemCount(); i++) {\r\n\t\t\t\tListitem listitem = lbxAnomalias_congenitas.getItemAtIndex(i);\r\n\t\t\t\tif (listitem\r\n\t\t\t\t\t\t.getValue()\r\n\t\t\t\t\t\t.toString()\r\n\t\t\t\t\t\t.equals(his_atencion_embarazada\r\n\t\t\t\t\t\t\t\t.getAnomalias_congenitas())) {\r\n\t\t\t\t\tlistitem.setSelected(true);\r\n\t\t\t\t\ti = lbxAnomalias_congenitas.getItemCount();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttbxCual_anomalias.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCual_anomalias());\r\n\t\t\ttbxLesiones.setValue(his_atencion_embarazada.getLesiones());\r\n\t\t\ttbxOtras_alter.setValue(his_atencion_embarazada.getOtras_alter());\r\n\t\t\tRadio radio16 = (Radio) rdbClasificacion_neo\r\n\t\t\t\t\t.getFellow(\"Clasificacion_neo\"\r\n\t\t\t\t\t\t\t+ his_atencion_embarazada.getClasificacion_neo());\r\n\t\t\tradio16.setChecked(true);\r\n\t\t\ttbxAlarma.setValue(his_atencion_embarazada.getAlarma());\r\n\t\t\ttbxConsulta_control.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getConsulta_control());\r\n\t\t\ttbxMedidas_preventiva.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getMedidas_preventiva());\r\n\t\t\ttbxRecomendaciones.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getRecomendaciones());\r\n\t\t\ttbxDiagnostico.setValue(his_atencion_embarazada.getDiagnostico());\r\n\t\t\ttbxCodigo_diagnostico.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getCodigo_diagnostico());\r\n\t\t\ttbxTratamiento.setValue(his_atencion_embarazada.getTratamiento());\r\n\t\t\ttbxRecomendacion_alimentacion.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getRecomendacion_alimentacion());\r\n\t\t\ttbxEvolucion_servicio.setValue(his_atencion_embarazada\r\n\t\t\t\t\t.getEvolucion_servicio());\r\n\r\n\t\t\t// Mostramos la vista //\r\n\t\t\ttbxAccion.setText(\"modificar\");\r\n\t\t\taccionForm(true, tbxAccion.getText());\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(\"Este dato no se puede editar\", \"Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\t}", "public EncabezadoRespuesta bajaAsistencia(AsistenciaDTO asistencia) {\n\t\t//Primero generamos el identificador unico de la transaccion\n\t\tString uid = GUIDGenerator.generateGUID(asistencia);\n\t\t//Mandamos a log el objeto de entrada\n\t\tLogHandler.debug(uid, this.getClass(), \"bajaAsistencia - Datos Entrada: \" + asistencia);\n\t\t//Variable de resultado\n\t\tEncabezadoRespuesta respuesta = new EncabezadoRespuesta();\n\t\ttry {\n\t\t\tif (asistencia.getIdEmpleado() == null) {\n \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el id del empleado.\");\n \t}\n \tif (asistencia.getUsuarioBaja() == null || asistencia.getUsuarioBaja().trim().isEmpty())\n \t{\n \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el usuario para la baja.\");\n \t}\n \tif (asistencia.getUsuarioUltMod() == null || asistencia.getUsuarioUltMod().trim().isEmpty())\n \t{\n \t\tthrow new ExcepcionesCuadrillas(\"Es necesario el usuario para la modificacion.\");\n \t}\n \tAsistenciaDAO dao = new AsistenciaDAO();\n \trespuesta = dao.bajaAsistencia(uid, asistencia);\n\t\t}\n\t\tcatch (ExcepcionesCuadrillas ex) {\n\t\t\tLogHandler.error(uid, this.getClass(), \"bajaAsistencia - Error: \" + ex.getMessage(), ex);\n\t\t\trespuesta.setUid(uid);\n\t\t\trespuesta.setEstatus(false);\n\t\t\trespuesta.setMensajeFuncional(ex.getMessage());\n\t\t\trespuesta.setMensajeTecnico(ex.getMessage());\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\tLogHandler.error(uid, this.getClass(), \"bajaAsistencia - Error: \" + ex.getMessage(), ex);\n\t\t\trespuesta.setUid(uid);\n\t\t\trespuesta.setEstatus(false);\n\t\t\trespuesta.setMensajeFuncional(ex.getMessage());\n\t\t\trespuesta.setMensajeTecnico(ex.getMessage());\n\t\t}\n\t\tLogHandler.debug(uid, this.getClass(), \"bajaAsistencia - Datos Salida: \" + respuesta);\n\t\treturn respuesta;\n\t}", "public List<Usuario> listarUsuario() {\n \n List<Usuario> lista = usuarioDAO.findAll();\n return lista;\n \n \n\n }", "protected String cargarObsequios(String url, String username,\n String password) throws Exception {\n try {\n getObsequios();\n if(mObsequios.size()>0){\n saveObsequios(Constants.STATUS_SUBMITTED);\n // La URL de la solicitud POST\n final String urlRequest = url + \"/movil/obsequios\";\n Obsequio[] envio = mObsequios.toArray(new Obsequio[mObsequios.size()]);\n HttpHeaders requestHeaders = new HttpHeaders();\n HttpAuthentication authHeader = new HttpBasicAuthentication(username, password);\n requestHeaders.setContentType(MediaType.APPLICATION_JSON);\n requestHeaders.setAuthorization(authHeader);\n HttpEntity<Obsequio[]> requestEntity =\n new HttpEntity<Obsequio[]>(envio, requestHeaders);\n RestTemplate restTemplate = new RestTemplate();\n restTemplate.getMessageConverters().add(new StringHttpMessageConverter());\n restTemplate.getMessageConverters().add(new MappingJacksonHttpMessageConverter());\n // Hace la solicitud a la red, pone la vivienda y espera un mensaje de respuesta del servidor\n ResponseEntity<String> response = restTemplate.exchange(urlRequest, HttpMethod.POST, requestEntity,\n String.class);\n // Regresa la respuesta a mostrar al usuario\n if (!response.getBody().matches(\"Datos recibidos!\")) {\n saveObsequios(Constants.STATUS_NOT_SUBMITTED);\n }\n return response.getBody();\n }\n else{\n return \"Datos recibidos!\";\n }\n } catch (Exception e) {\n Log.e(TAG, e.getMessage(), e);\n saveObsequios(Constants.STATUS_NOT_SUBMITTED);\n return e.getMessage();\n }\n\n }", "public List<NotaDeCredito> procesar();", "public void Listar() {\n try {\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n this.listaApelaciones.clear();\n setListaApelaciones(apelacionesDao.cargaApelaciones());\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void cargaDeDatos(List<List<Object>> Musuarios,List<List<Object>> Mtareas, List<List<Object>> Mrequisitos) {\r\n\tfor (List<Object> l: Musuarios) {\r\n\t\tam.addMiembro(new MiembroDeEquipo((int)l.get(0),(String)l.get(1)));\r\n\t}\r\n\t/**\r\n\t * Cargamos a la lista de administrador de tareas todas las tareas que se encuentran en la base de datos, \r\n\t * si no tiene miembro se le pone a null sino se le añade un miembro.\r\n\t */\r\n\tfor (List<Object> l: Mtareas) {\r\n\t\tat.addTarea(new Tarea((String)l.get(0),(int)l.get(1),(int)l.get(2),(int)l.get(3),(int)l.get(6)));\r\n\t\t//Si tiene un miembro asignado (cualquier id mayor que cero) le añade el miembro de equipo, sino null\r\n\t\tif(0 < (int)l.get(5)) {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setAsignadoA(am.BuscarMiembro((int) l.get(5)));\r\n\t\t}else {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setAsignadoA(null);\r\n\t\t}\r\n\t\t//Si tiene un requisito (cualquier id maor que cero) le añade el requisito, sino null\r\n\t\tif(0 < (int)l.get(4)) {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setRequisito(ar.BuscarRequisito((int) l.get(4)));\r\n\t\t}else {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setRequisito(null);\r\n\t\t}\r\n\t\tat.BuscarTarea((int)l.get(1)).setDescripcion((String)l.get(7));\r\n\t}\r\n\t/**\r\n\t * Cargamos la lista del administrador de requisitos con todos los requisitos que tenemos,\r\n\t * si el requisito tiene 5 atributos, será un defecto, sino será una historia de usuario\r\n\t */\r\n\tfor (List<Object> l: Mrequisitos) {\r\n\t\tHashSet<Tarea> lista = new HashSet<Tarea>();\r\n\t\t//Buscamos todas las tareas que tengan este requisito, para tener una lista de las tareas que este tiene\r\n\t\tfor(List<Object> t: Mtareas) {\r\n\t\t\t\r\n\t\t\tif((int)l.get(2)==(int)t.get(4)) {\r\n\t\t\t\tlista.add(at.BuscarTarea((int)t.get(1)));\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Creamos defecto o historiaDeUsuario, según sea el caso y lo añadimos a la lista generica de Requisitos.\r\n\t\tif(l.size()==5) {\r\n\t\t\tDefecto req = new Defecto((String)l.get(4),(String) l.get(0), (String)l.get(1),(int)l.get(2),lista);\r\n\t\t\tif((int)l.get(3)==1) {\r\n\t\t\treq.finalizar();\r\n\t\t\t}\r\n\t\t\tar.addRequisito(req);\r\n\t\t}else {\r\n\t\t\tRequisito req = new HistoriaDeUsuario((String) l.get(0), (String)l.get(1),(int)l.get(2));\r\n\t\t\tif(!lista.isEmpty()) {\r\n\t\t\t\treq.setRequisitos(lista);\r\n\t\t\t}\r\n\t\t\tif((int)l.get(3)==1) {\r\n\t\t\treq.finalizar();\r\n\t\t\t}\r\n\t\t\tar.addRequisito(req);\t\t\r\n\t\t}\r\n\t}\r\n\tfor (List<Object> l: Mtareas) {\r\n\t\t//Si tiene un requisito (cualquier id maor que cero) le añade el requisito, sino null\r\n\t\tif(0 < (int)l.get(4)) {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setRequisito(ar.BuscarRequisito((int) l.get(4)));\r\n\t\t}else {\r\n\t\t\tat.BuscarTarea((int)l.get(1)).setRequisito(null);\r\n\t\t}\r\n\t}\r\n}", "private void cargaUsuarios() {\n //Abre la conexion\n Connection con = Star.conAbrBas(true, false);\n \n //Declara variables de la base de datos \n java.sql.Statement st;\n java.sql.ResultSet rs; \n String sQ;\n /*Obtiene todos los datos del usuario*/\n try\n {\n sQ = \"SELECT estac FROM estacs WHERE estac <> '\" + Login.sUsrG + \"' AND admcaj <= (SELECT admcaj FROM estacs WHERE estac = '\" + Login.sUsrG + \"')\";\n st = con.createStatement();\n rs = st.executeQuery(sQ);\n /*Si hay datos*/\n while(rs.next())\n {\n /*Obtiene los datos y cargalos en sus campos*/\n jcmbUsuarios.addItem(rs.getString(\"estac\"));\n }\n //si ingreso usuarios al combo, jalo los permisos del primer usuario\n// if(jcmbUsuarios.getItemCount() > 0){\n// cargaPermisos(jcmbUsuarios.getSelectedItem().toString());\n// }\n \n }catch(SQLException expnSQL)\n {\n //Procesa el error y regresa\n Star.iErrProc(this.getClass().getName() + \" \" + expnSQL.getMessage(), Star.sErrSQL, expnSQL.getStackTrace(), con); \n }\n }", "public void adicionarServicos() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Não existem hospedes cadastrados!\\n\");\n } else {\n\n System.err.println(\"Digite o cpf do hospede que deseja adicionar servicos:\");\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//pega o indice i do objeo pessoa, pega o id da pessoa e compara com o id da pessoa digitada\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//verifica se a situaçao do contrato ainda está aberta para esse hospede\n\n System.err.println(\"O que deseja editar do contrato\\n\");\n //adicionar carro, trocar de quarto, adicionar conta de restaurante,\n //encerrar contrato\n\n System.err.println(\"Adicionar carro (1):\\nAdicionar restaurante (2):\\n\"\n + \"Adicionar horas de BabySitter (3):\\nAdicionar quarto(4):\\n\");\n int caso = verifica();\n switch (caso) {\n case 1://carro\n if (carrosCadastrados.isEmpty()) {\n System.err.println(\"Nao existem carros cadastrados!\\n\");\n } else {\n listarCarros();\n System.err.println(\"Digite o id do carro que deseja contratar:\\n\");\n int idCarro = verifica();\n\n for (int j = 0; j < carrosCadastrados.size(); j++) {\n if (carrosCadastrados.get(j).getId() == idCarro) {\n if (carrosCadastrados.get(j).isEstado()) {\n System.err.println(\"Esse carro já está cadastrado.\\n\");\n } else {\n hospedesCadastrados.get(i).getContrato().setCarros(carrosCadastrados.get(j));\n carrosCadastrados.get(j).setEstado(true);\n }\n }\n }\n }\n break;\n\n case 2://restaurante\n System.err.println(\"Digite o quanto deseja gastar no restaurente\\n\");\n double valorRestaurante = ler.nextDouble();\n// idd();\n// int idRestaurante = id;\n// Restaurante restaurante = new Restaurante(idRestaurante, valorRestaurante);\n hospedesCadastrados.get(i).getContrato().setValorRestaurante(valorRestaurante);\n break;\n case 3://babysitter\n System.err.println(\"Digite o tempo gasto no BabySytter em horas\\n\");\n double tempoBaby = ler.nextDouble();\n hospedesCadastrados.get(i).getContrato().setHorasBaby(tempoBaby);\n break;\n case 4://quartos\n\n if (quartosCadastrados.isEmpty()) {\n\n } else {\n System.err.println(\"Digite o numero do quarto que deseja contratar:\\n\");\n listarQuartos();\n int num = verifica();\n System.err.println(\"Digite a quantidade de dis que pretente alugar o quarto:\\n\");\n int dias = verifica();\n for (int j = 0; j < quartosCadastrados.size(); j++) {\n if (num == quartosCadastrados.get(j).getNumero()) {//verifica se o numero digitado é igual ao numero do quarto do laco\n if (quartosCadastrados.get(j).getEstado()) {//verifica se o estado do quarto está como true\n System.err.println(\"Este quarto já está cadastrado em um contrato\");\n } else {//se o estado tiver em true é porque o quarto ja está cadastrado\n\n hospedesCadastrados.get(i).getContrato().setQuartos(quartosCadastrados.get(j));\n hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().get(j).setDias(dias);\n hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().get(j).setEstado(true);//seta o estado do quarto como ocupado\n System.err.println(\"Quarto cadastrado!\\n\");\n }\n\n }\n\n }\n\n//remove all remove todas as pessoas com tal nome\t\n }\n break;\n\n }\n } else {\n System.err.println(\"O contrato deste Hospede encontra-se encerrado\");\n break;\n }\n }\n }\n }\n }", "public void enviaMotorista() {\n\t\tConector con = new Conector();\r\n\t\tString params[] = new String[2];\r\n\r\n\t\tparams[0] = \"op=4\";\r\n\t\tparams[1] = \"email=\" + usuario;\r\n\r\n\t\tcon.sendHTTP(params);\r\n\t}", "private void modi() { \n try {\n cvo.getId_cliente();\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n cvo.setClave_cliente(vista.txtClave.getText());\n cdao.actualizar(cvo);\n vista.txtNombre.setText(\"\");\n vista.txtApellido.setText(\"\");\n vista.txtDireccion.setText(\"\");\n vista.txtCorreo.setText(\"\");\n vista.txtClave.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Registro Modificado\");\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Debe ingresar Datos para Modificar registro!\");\n }\n }", "public void limpiarCamposCita() {\r\n try {\r\n visitaRealizada = false;\r\n fechaNueva = null;\r\n observacionReasignaCita = \"\";\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".limpiarCamposCita()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n\r\n }", "public SgfensBanco[] findAll() throws SgfensBancoDaoException;", "protected void contatos(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t// response.sendRedirect(\"agenda.jsp\");\n\t\t// recebendo os dados da classe JavaBeans\n\t\tArrayList<JavaBeans> lista = dao.listarContatos();\n\t\trequest.setAttribute(\"contatos\", lista);\n\t\tRequestDispatcher rd = request.getRequestDispatcher(\"agenda.jsp\");\n\t\trd.forward(request, response);\n/*\n\t\tfor (int i = 0; i < lista.size(); i++) {\n\t\t\tSystem.out.println(lista.get(i).getId());\n\t\t\tSystem.out.println(lista.get(i).getNome());\n\t\t\tSystem.out.println(lista.get(i).getFone());\n\t\t\tSystem.out.println(lista.get(i).getEmail());\n\t\t}*/\n\t}", "public void buscarDatos() throws Exception {\n\t\ttry {\n\t\t\tString parameter = lbxParameter.getSelectedItem().getValue()\n\t\t\t\t\t.toString();\n\t\t\tString value = tbxValue.getValue().toUpperCase().trim();\n\n\t\t\tMap<String, Object> parameters = new HashMap<String, Object>();\n\t\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\n\t\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\n\n\t\t\tif (admision != null) {\n\t\t\t\tparameters.put(\"identificacion\",\n\t\t\t\t\t\tadmision.getNro_identificacion());\n\t\t\t}\n\n\t\t\tif (parameter.equalsIgnoreCase(\"fecha_inicial\")) {\n\t\t\t\tparameters.put(\"fecha_string\", value);\n\t\t\t} else {\n\t\t\t\tparameters.put(\"parameter\", parameter);\n\t\t\t\tparameters.put(\"value\", \"%\" + value + \"%\");\n\t\t\t}\n\n\t\t\tgetServiceLocator().getHisc_urgencia_odontologicoService()\n\t\t\t\t\t.setLimit(\"limit 25 offset 0\");\n\n\t\t\tList<Hisc_urgencia_odontologico> lista_datos = getServiceLocator()\n\t\t\t\t\t.getHisc_urgencia_odontologicoService().listar(parameters);\n\t\t\trowsResultado.getChildren().clear();\n\n\t\t\tfor (Hisc_urgencia_odontologico hisc_urgencia_odontologico : lista_datos) {\n\t\t\t\trowsResultado.appendChild(crearFilas(\n\t\t\t\t\t\thisc_urgencia_odontologico, this));\n\t\t\t}\n\n\t\t\tgridResultado.setVisible(true);\n\t\t\tgridResultado.setMold(\"paging\");\n\t\t\tgridResultado.setPageSize(20);\n\n\t\t\tgridResultado.applyProperties();\n\t\t\tgridResultado.invalidate();\n\n\t\t} catch (Exception e) {\n\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t}\n\t}" ]
[ "0.6177644", "0.6155391", "0.60634065", "0.60100234", "0.60008955", "0.5970871", "0.5955642", "0.59276336", "0.58990896", "0.5898335", "0.5888969", "0.5840249", "0.5815367", "0.5799103", "0.57852745", "0.5758845", "0.57570654", "0.57530236", "0.5719925", "0.5699261", "0.5689621", "0.5678498", "0.56763756", "0.5672996", "0.56720227", "0.56687665", "0.56669104", "0.5637132", "0.56245214", "0.5623884", "0.5598489", "0.55951655", "0.5594289", "0.55937386", "0.5591456", "0.55907774", "0.55843824", "0.55840975", "0.5578688", "0.5576232", "0.55738574", "0.5570747", "0.556336", "0.5560424", "0.5552943", "0.5549508", "0.55482894", "0.5543092", "0.5542426", "0.55391735", "0.5539102", "0.55387133", "0.5535689", "0.5534051", "0.5525368", "0.5524786", "0.55137336", "0.55127764", "0.55078155", "0.5507673", "0.55034065", "0.55009973", "0.55001223", "0.5499972", "0.5494876", "0.5492509", "0.548506", "0.5484285", "0.5478009", "0.5477102", "0.5475923", "0.5472424", "0.5471961", "0.54692113", "0.54681545", "0.5465754", "0.5465479", "0.5463695", "0.5463545", "0.54622024", "0.54616576", "0.5459471", "0.54587966", "0.54544437", "0.5451315", "0.54506516", "0.5449149", "0.54434055", "0.54401165", "0.54390675", "0.54333645", "0.5431946", "0.5426252", "0.5420485", "0.54166764", "0.5415142", "0.5413508", "0.5409073", "0.5408758", "0.5408008", "0.54061663" ]
0.0
-1
Called when creating a new instance.
public ExtendedWorkObject(IElement element) { this.element = element; this.element.setWorkObject(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\n\tpublic void create() {\n\n\t}", "public void create(){}", "public void create() {\n\t\t\n\t}", "@Override\r\n\tpublic void create() {\n\r\n\t}", "private Instantiation(){}", "public Instance() {\n }", "Instance createInstance();", "public abstract void create();", "@Override\r\n public void instantiate() {\r\n }", "@Override\n public void create() {\n // enable logging\n Gdx.app.setLogLevel(Application.LOG_DEBUG);\n log.debug(\"create()\");\n }", "Reproducible newInstance();", "public Factory() {\n\t\tsuper();\n\t}", "@Override\n public void Create() {\n initView();\n initData();\n }", "void createNewInstance(String filename)\n {\n iIncomingLobsFactory = new incomingLobsFactory();\n iIncomingLobsFactory.setPackageName(\"com.loadSample\");\n \n // include schemaLocation hint for validation\n iIncomingLobsFactory.setXSDFileName(\"LoadSample.xsd\");\n \n // encoding for output document\n iIncomingLobsFactory.setEncoding(\"UTF8\");\n \n // encoding tag for xml declaration\n iIncomingLobsFactory.setEncodingTag(\"UTF-8\");\n \n // Create the root element in the document using the specified root element name\n iIncomingLobs = (incomingLobs) iIncomingLobsFactory.createRoot(\"incomingLobs\");\n createincomingLobs();\n \n iIncomingLobsFactory.save(filename);\n }", "@Override\n public void Create() {\n\n initView();\n }", "protected abstract void construct();", "protected IPCGCallDetailCreator()\r\n {\r\n // empty\r\n }", "public Instance() {\n super(Routing.NAMESPACE, \"instance\");\n }", "@Override\n\tpublic void create() {\n\t\tGdx.app.setLogLevel(Application.LOG_DEBUG);\n\t\t\n\t\t//Load assets\n\t\tAssets.instance.init(new AssetManager());\n\t\t\n\t\t//initialize controller and renderer\n\t\tworldController = new WorldController();\n\t\tworldRenderer= new WorldRenderer(worldController);\n\t\t\n\t\t//The world is not paused on start\n\t\tpaused = false;\n\t}", "private static void makeInstance(){\n\n if(settingsFile==null){\n settingsFile = new MetadataFile(SETTINGS_FILE_PATH);\n }\n\n if(!settingsFile.exists()){\n settingsFile.create();\n }\n\n if(tagListeners==null){\n tagListeners= new HashMap<>();\n }\n\n }", "private Person()\r\n\t{\r\n\t\tsuper();\r\n\t\t//created = LocalDateTime.now();\r\n\t\tcreated = Calendar.getInstance().getTime();\r\n\t}", "private Template() {\r\n\r\n }", "@Override\n\tpublic void create () {\n\t\tgempiresAssetHandler = new GempiresAssetHandler(this);\n\t\tbatch = new SpriteBatch();\n\t\tcastle = new CastleScreen(this);\n\t\tsetScreen(new MainMenuScreen(this));\n\t}", "@Override\n \t\t\t\tpublic void doNew() {\n \n \t\t\t\t}", "private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}", "public XCanopusFactoryImpl()\r\n {\r\n super();\r\n }", "public ApplicationCreator() {\n }", "public static void created() {\n\t\t// TODO\n\t}", "public ObjectFactory() {\n super(grammarInfo);\n }", "protected void postInstantiate() {}", "private MyResource() {\n System.out.printf(\"[%s] has been created \\n\", MyResource.class.getSimpleName());\n }", "public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }", "private StickFactory() {\n\t}", "void create(T instance) throws IOException;", "public void makeInstance() {\n\t\t// Create the attributes, class and text\n\t\tFastVector fvNominalVal = new FastVector(2);\n\t\tfvNominalVal.addElement(\"ad1\");\n\t\tfvNominalVal.addElement(\"ad2\");\n\t\tAttribute attribute1 = new Attribute(\"class\", fvNominalVal);\n\t\tAttribute attribute2 = new Attribute(\"text\",(FastVector) null);\n\t\t// Create list of instances with one element\n\t\tFastVector fvWekaAttributes = new FastVector(2);\n\t\tfvWekaAttributes.addElement(attribute1);\n\t\tfvWekaAttributes.addElement(attribute2);\n\t\tinstances = new Instances(\"Test relation\", fvWekaAttributes, 1); \n\t\t// Set class index\n\t\tinstances.setClassIndex(0);\n\t\t// Create and add the instance\n\t\tInstance instance = new Instance(2);\n\t\tinstance.setValue(attribute2, text);\n\t\t// Another way to do it:\n\t\t// instance.setValue((Attribute)fvWekaAttributes.elementAt(1), text);\n\t\tinstances.add(instance);\n \t\tSystem.out.println(\"===== Instance created with reference dataset =====\");\n\t\tSystem.out.println(instances);\n\t}", "public PiviFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "@Override\n public void init() {}", "Constructor() {\r\n\t\t \r\n\t }", "public ObjectFactory() {\n\t}", "@Override\r\n public void create() {\r\n super.create();\r\n setTitle(title);\r\n }", "@Override\n public void create() {\n Gdx.app.log(TAG, \"Application Listener Created\");\n // Never allocate anything in render, since that gets called 60 times a second\n shapeRenderer = new ShapeRenderer();\n }", "CreateEventViewModelFactory() {\n super(Storage.class, Authenticator.class);\n }", "public ObjectFactory() {\r\n\t}", "public NewShape() {\r\n\t\tsuper();\r\n\t}", "private PerksFactory() {\n\n\t}", "public void initForAddNew() {\r\n\r\n\t}", "public Taginstance() {\n\t\tthis(\"taginstance\", null);\n\t}", "public CreateStatus()\n {\n super(new DataMap(), null);\n }", "public CustomerNew () {\n\t\tsuper();\n\t}", "public void init() {\n \n }", "public PetrinetmodelFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "@Override\r\n\tpublic void init() {}", "For createFor();", "public MyResource() {\n System.out.println(\"creating Resource\");\n }", "public RegisterNewData() {\n }", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "@Override\n public void construct() throws IOException {\n \n }", "public PertFactory() {\n for (Object[] o : classTagArray) {\n addStorableClass((String) o[1], (Class) o[0]);\n }\n }", "public EcoreFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "@Override\n\tpublic void create() {\n\t\tthis.playScreen = new PlayScreen<EntityUnknownGame>(this);\n\t\tsetScreen(this.playScreen);\n\t\t\n\t\t//this.shadowMapTest = new ShadowMappingTest<EntityUnknownGame>(this);\n\t\t//setScreen(this.shadowMapTest);\n\t\t\n\t\t//this.StillModelTest = new StillModelTest<EntityUnknownGame>(this);\n\t\t//setScreen(this.StillModelTest);\n\t\t\n//\t\tthis.keyframedModelTest = new KeyframedModelTest<EntityUnknownGame>(this);\n//\t\tsetScreen(this.keyframedModelTest);\n\t}", "public Hello()\n {\n // initialise instance variables\n \n }", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "public ClassTemplate() {\n\t}", "private synchronized static void createInstance(){\r\n\t\tif (instance == null){\r\n\t\t\tinstance = new Casino();\r\n\t\t}\r\n\t}", "public ScribbleFactoryImpl()\n {\n\t\tsuper();\n\t}", "@Override\n void init() {\n }", "@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public MystFactoryImpl()\r\n {\r\n super();\r\n }", "@Override\n public void init() {\n }", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public EcoreFactoryImpl()\n {\n super();\n }", "public ObjectFactoryTeacherPresence() {\n }", "public static void create() {\r\n render();\r\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t}", "@Override\n protected void init() {\n }", "public CMObject newInstance();", "@Override public void init()\n\t\t{\n\t\t}", "public EcoreFactoryImpl() {\n super();\n }", "@Override\n public void init() {\n\n }", "public MgtFactoryImpl()\n {\n super();\n }", "private MApi() {}", "public Tp2FactoryImpl() {\n\t\tsuper();\n\t}", "public ParsedmodelFactoryImpl() {\n\t\tsuper();\n\t}", "public void create()\n throws Exception\n {\n super.start();\n\n BeanMetaData md = getContainer().getBeanMetaData();\n ejbName = md.getEjbName();\n\n // Should we log call details\n callLogging = md.getContainerConfiguration().getCallLogging();\n }", "public Activator() {\r\n\t}", "public EntityBundleCreate() {}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}" ]
[ "0.76195306", "0.7569643", "0.75395733", "0.7506403", "0.7466292", "0.745281", "0.73184633", "0.7002408", "0.6995371", "0.6914073", "0.6896456", "0.68244374", "0.67743766", "0.66241175", "0.65950114", "0.6515394", "0.6489284", "0.6463911", "0.64419925", "0.6436192", "0.6394316", "0.6349449", "0.6343879", "0.63292104", "0.6309987", "0.6306847", "0.6283739", "0.62779796", "0.62726414", "0.625722", "0.62529624", "0.6248368", "0.62474406", "0.6236781", "0.6235252", "0.6211086", "0.61880136", "0.6183868", "0.6176961", "0.6171449", "0.61557376", "0.6148855", "0.6145401", "0.6144308", "0.6141273", "0.6126167", "0.6106766", "0.6105801", "0.60929745", "0.6087961", "0.608783", "0.6083605", "0.6075668", "0.60713935", "0.6058638", "0.6050789", "0.6044693", "0.60344803", "0.6033039", "0.6031403", "0.6029428", "0.6029271", "0.6028296", "0.60277826", "0.6017065", "0.6016521", "0.6016521", "0.6016521", "0.60152626", "0.60148585", "0.60092413", "0.6006636", "0.6003236", "0.6002355", "0.6002355", "0.6002355", "0.6002355", "0.6002355", "0.6002355", "0.5997053", "0.59969395", "0.5989195", "0.5989195", "0.5989195", "0.59885937", "0.5985838", "0.59857017", "0.5983873", "0.598151", "0.5976129", "0.59690833", "0.5968346", "0.59677905", "0.5966895", "0.5964311", "0.5960366", "0.59584415", "0.5948054", "0.5945756", "0.5943749", "0.59399945" ]
0.0
-1
/ This class takes previous and current models to analyze the StackInstances to create, delete, and update The process logic: 1. For the regions only appear in previous model all the associated instances should be deleted 2. For the regions only appear in current model all the associated instances should be created 3. Further comparison will be done for the regions shared in two models by calling AltStackInstancesCalculator
public void analyze(final StackInstancesPlaceHolder placeHolder) { Set<StackInstances> previousStackInstancesGroup = previousModel == null ? new HashSet<>() : previousModel.getStackInstancesGroup(); Set<StackInstances> currentStackInstancesGroup = currentModel == null ? new HashSet<>() : currentModel.getStackInstancesGroup(); Validator.validateServiceMangedInstancesGroup(previousStackInstancesGroup); Validator.validateServiceMangedInstancesGroup(currentStackInstancesGroup); HashMap<String, Set<StackInstances>> previousStackInstancesByRegion = regroupStackInstancesByRegion(previousStackInstancesGroup); HashMap<String, Set<StackInstances>> currentStackInstancesByRegion = regroupStackInstancesByRegion(currentStackInstancesGroup); Set<String> previousRegions = previousStackInstancesByRegion.keySet(); Set<String> currentRegions = currentStackInstancesByRegion.keySet(); setDiff(previousRegions, currentRegions).forEach( region -> stackInstancesToDelete.addAll(previousStackInstancesByRegion.get(region)) ); setDiff(currentRegions, previousRegions).forEach( region -> stackInstancesToCreate.addAll(currentStackInstancesByRegion.get(region)) ); setInter(currentRegions, previousRegions).forEach( region -> new AltStackInstancesCalculator(region, previousStackInstancesByRegion.get(region), currentStackInstancesByRegion.get(region)) .calculate( stackInstancesToDelete, stackInstancesToCreate, stackInstancesToUpdate) ); placeHolder.setCreateStackInstances(new ArrayList<>(stackInstancesToCreate)); placeHolder.setDeleteStackInstances(new ArrayList<>(stackInstancesToDelete)); placeHolder.setUpdateStackInstances(new ArrayList<>(stackInstancesToUpdate)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testInstanceFiltering() {\n\t\t\r\n\t\tMetaModel lhsUnfiltered = this.metaModelFactory.getLHSMetaModel();\r\n\t\t\r\n\t\tassertTrue(\"Unfiltered LHS MetaModel has unexpected amount of classes\", lhsUnfiltered.getClasses().size() == 8);\r\n\t\tassertTrue(\"Unfiltered LHS MetaModel has unexpected amount of attributes\", lhsUnfiltered.getAttributes().size() == 7);\r\n\t\tassertTrue(\"Unfiltered LHS MetaModel has unexpected amount of references\", lhsUnfiltered.getReferences().size() == 16);\r\n\t\t\r\n\t\tMetaModel rhsUnfiltered = this.metaModelFactory.getRHSMetaModel();\r\n\t\tassertTrue(\"Unfiltered RHS MetaModel has unexpected amount of classes\", rhsUnfiltered.getClasses().size() == 7);\r\n\t\tassertTrue(\"Unfiltered RHS MetaModel has unexpected amount of attributes\", rhsUnfiltered.getAttributes().size() == 12);\r\n\t\tassertTrue(\"Unfiltered RHS MetaModel has unexpected amount of references\", rhsUnfiltered.getReferences().size() == 8);\r\n\t\t\r\n\t\tthis.metaModelFactory.addFilter(new InstanceFilter());\r\n\t\t\r\n\t\tMetaModel lhsFiltered = this.metaModelFactory.getLHSMetaModel();\r\n\t\t\r\n\t\t// Classes Model, Attribute, Entity\r\n\t\tassertTrue(\"Filtered LHS MetaModel has unexpected amount of classes\", lhsFiltered.getClasses().size() == 3);\r\n\t\tassertTrue(\"Filtered LHS MetaModel has unexpected amount of attributes\", lhsFiltered.getAttributes().size() == 2);\r\n\t\tassertTrue(\"Filtered LHS MetaModel has unexpected amount of references\", lhsFiltered.getReferences().size() == 3);\r\n\t\t\r\n\t\t\r\n\t\tMetaModel rhsFiltered = this.metaModelFactory.getRHSMetaModel();\r\n\t\t\r\n\t\tassertTrue(\"Filtered RHS MetaModel has unexpected amount of classes\", rhsFiltered.getClasses().size() == 3);\r\n\t\tassertTrue(\"Filtered RHS MetaModel has unexpected amount of attributes\", rhsFiltered.getAttributes().size() == 4);\r\n\t\tassertTrue(\"Filtered RHS MetaModel has unexpected amount of references\", rhsFiltered.getReferences().size() == 2);\r\n\t}", "private ArrayList<Region> processRegions(ArrayList<Region> list, int oldStart, int newStart, RegionSequenceData parent, String trackName) {\n // first make a deep clone of the list\n ArrayList<Region> newList=new ArrayList<Region>(list.size());\n for (Region reg:list) {\n Region newreg=reg.clone();\n newreg.setParent(null);\n newList.add(newreg);\n }\n if (oldStart==newStart) return newList; // no need to update reference frame\n // now update all coordinates since the frame of reference has been altered\n for (Region reg:newList) {\n reg.updatePositionReferenceFrame(oldStart, newStart); // this is \"recursive\" for nested regions\n }\n return newList;\n }", "public void start() throws Exception {\n String datasetPath = \"dataset\\\\arcene_train.arff\";\n\n Instances dataset = new Instances(fileSystemUtil.readDataSet(datasetPath));\n dataset.setClassIndex(dataset.numAttributes() - 1);\n\n // Creating instances of feature selection models\n List<FeatureSelectionModel> featureSelectionModels = new ArrayList<>();\n featureSelectionModels.add(new CorellationFeatureSelectionModel());\n featureSelectionModels.add(new InfoGainFeatureSelectionModel());\n featureSelectionModels.add(new WrapperAttributeFeatureSelectionModel());\n\n List<List<Integer>> listOfRankedLists = calculateRankedLists(dataset, featureSelectionModels);\n\n // Creating instances of classifiers\n List<AbstractClassifier> classifiers = createClassifiers();\n Instances datasetBackup = new Instances(dataset);\n\n int modelCounter = 0;\n for (FeatureSelectionModel model : featureSelectionModels) {\n System.out.println(\"============================================================================\");\n System.out.println(String.format(\"Classification, step #%d. %s.\", ++modelCounter, model));\n System.out.println(\"============================================================================\");\n\n // Ranking attributes\n List<Integer> attrRankList = listOfRankedLists.get(modelCounter - 1);\n\n for (int attrIndex = (int)(attrRankList.size() * WORST_ATTRIBUTES_NUMBER_PROPORTION - 1) + 1, removedCounter = 0;\n attrIndex >= attrRankList.size() * BEST_ATTRIBUTES_NUMBER_PROPORTION;\n attrIndex--, removedCounter++) {\n if (datasetBackup.numAttributes() == attrRankList.size()\n && attrIndex == 0) {\n continue;\n }\n// for (int attrIndex = attrRankList.size() * BEST_ATTRIBUTES_NUMBER_PROPORTION, removedCounter = 0;\n// attrIndex <= (attrRankList.size() * WORST_ATTRIBUTES_NUMBER_PROPORTION - 1);\n// attrIndex++, removedCounter++) {\n// if (datasetBackup.numAttributes() == attrRankList.size()\n// && attrIndex == attrRankList.size() - 1) {\n// continue;\n// }\n dataset = new Instances(datasetBackup);\n // Do not remove for first iteration\n if (removedCounter > 0) {\n // Selecting features (removing attributes one-by-one starting from worst)\n List<Integer> attrToRemoveList = attrRankList.subList(attrIndex,\n (int)(attrRankList.size() * WORST_ATTRIBUTES_NUMBER_PROPORTION));\n Collections.sort(attrToRemoveList);\n for (int i = attrToRemoveList.size() - 1; i >= 0; i--) {\n dataset.deleteAttributeAt(attrToRemoveList.get(i));\n }\n// for (Integer attr : attrToRemoveList) {\n// dataset.deleteAttributeAt(attr);\n// }\n System.out.println(\"\\n\\n-------------- \" + (removedCounter) + \" attribute(s) removed (of \" +\n (datasetBackup.numAttributes() - 1) + \") --------------\\n\");\n } else {\n System.out.println(\"\\n\\n-------------- First iteration - without feature selection --------------\\n\");\n }\n\n classify(classifiers, dataset);\n }\n }\n }", "private void clearPreviousInstances() {\n DiscardedCards.clearInstance();\n Fireworks.clearInstance();\n History.clearInstance();\n SelectedSymbol.clearInstance();\n Tokens.clearInstance();\n HanabiCards.initDeck();\n }", "private void analyze() {\n\t\tdouble org = 0;\n\t\tdouble avgIndPerDoc = 0;\n\t\tdouble avgTotalPerDoc = 0;\n\n\t\tfor (Instance instance : instanceProvider.getInstances()) {\n\n\t\t\tint g = 0;\n\t\t\tSet<AbstractAnnotation> orgM = new HashSet<>();\n\n//\t\t\torgM.addAll(instance.getGoldAnnotations().getAnnotations());\n//\t\t\tg += instance.getGoldAnnotations().getAnnotations().size();\n\n\t\t\tfor (AbstractAnnotation instance2 : instance.getGoldAnnotations().getAnnotations()) {\n\n\t\t\t\tResult r = new Result(instance2);\n\n\t\t\t\t{\n////\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getTrend());\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(r.getInvestigationMethod());\n////\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(\n////\t\t\t\t\t\t\tr.getDefinedExperimentalGroups().stream().map(a -> a.get()).collect(Collectors.toList()));\n//\n//\t\t\t\t\torgM.addAll(aa);\n//\t\t\t\t\tg += aa.size();\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\t/**\n\t\t\t\t\t * props of exp\n\t\t\t\t\t */\n\t\t\t\t\tfor (DefinedExperimentalGroup instance3 : r.getDefinedExperimentalGroups()) {\n\n//\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getOrganismModel());\n//\t\t\t\t\tList<AbstractAnnotation> aa = new ArrayList<>(instance3.getTreatments());\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> ab = Arrays.asList(instance3.getInjury());\n\n\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getDeliveryMethods().stream())\n\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n\t\t\t\t\t\taa.addAll(instance3.getTreatments().stream().filter(i -> i != null)\n\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Treatment(et))\n\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getDeliveryMethod()).filter(i -> i != null)\n\t\t\t\t\t\t\t\t.collect(Collectors.toList()));\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).flatMap(i -> i.getAnaesthetics().stream())\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).collect(Collectors.toList());\n\n//\t\t\t\t\t\tList<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryDevice()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\t// List<AbstractAnnotation> aa = ab.stream().filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.map(et -> et.asInstanceOfEntityTemplate()).map(et -> new Injury(et))\n//\t\t\t\t\t\t\t\t.filter(i -> i != null).map(i -> i.getInjuryLocation()).filter(i -> i != null)\n//\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\n\t\t\t\t\t\torgM.addAll(aa);\n\t\t\t\t\t\tg += aa.size();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tavgIndPerDoc += orgM.size();\n\t\t\tavgTotalPerDoc += g;\n\n\t\t\torg += ((double) orgM.size()) / (g == 0 ? 1 : g);\n//\t\t\tSystem.out.println(((double) orgM.size()) / g);\n\n\t\t}\n\t\tSystem.out.println(\"avgTotalPerDoc = \" + avgTotalPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"avgIndPerDoc = \" + avgIndPerDoc / instanceProvider.getInstances().size());\n\t\tSystem.out.println(\"org = \" + org);\n\t\tSystem.out.println(\"avg. org = \" + (org / instanceProvider.getInstances().size()));\n\t\tSystem.out.println(new DecimalFormat(\"0.00\").format(avgTotalPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(avgIndPerDoc / instanceProvider.getInstances().size())\n\t\t\t\t+ \" & \" + new DecimalFormat(\"0.00\").format(org / instanceProvider.getInstances().size()));\n\t\tSystem.exit(1);\n\n\t\tStats.countVariables(0, instanceProvider.getInstances());\n\n\t\tint count = 0;\n\t\tfor (SlotType slotType : EntityType.get(\"Result\").getSlots()) {\n\n\t\t\tif (slotType.isExcluded())\n\t\t\t\tcontinue;\n\t\t\tcount++;\n\t\t\tSystem.out.println(slotType.name);\n\n\t\t}\n\t\tSystem.out.println(count);\n\t\tSystem.exit(1);\n\t}", "public void splitInstances(int iClass) throws Exception {\n RemoveWithValues rmvFilter = new RemoveWithValues();\r\n rmvFilter.setAttributeIndex(\"\" + (m_Instances.classIndex() + 1));\r\n rmvFilter.setInvertSelection(true);\r\n rmvFilter.setNominalIndicesArr(new int[]{iClass});\r\n rmvFilter.setInputFormat(m_Instances);\r\n// m_cInstances[iClass] = new Instances(m_Instances);\r\n// m_cInstances[iClass] = Filter.useFilter(m_cInstances[iClass],\r\n// rmvFilter);\r\n m_cInstances[iClass] = Filter.useFilter(m_Instances, rmvFilter);\r\n\r\n // generate tree structure for this class label, based on Chow and\r\n // Liu's greedy search\r\n int numClasses = m_Instances.classAttribute().numValues();\r\n MultiNet tan = new MultiNet();\r\n tan.setScoreType(new SelectedTag(m_nScoreType,\r\n LocalScoreSearchAlgorithm.TAGS_SCORE_TYPE));\r\n initializeEstimators(numClasses);\r\n m_Structures[iClass] = new BayesNet();\r\n\r\n m_Estimators[iClass].setAlpha(m_fAlpha);\r\n ((BayesNet) m_Structures[iClass]).setSearchAlgorithm(tan);\r\n ((BayesNet) m_Structures[iClass]).setEstimator(m_Estimators[iClass]);\r\n m_Structures[iClass].buildClassifier(m_cInstances[iClass]);\r\n\r\n // update probability of this class label\r\n // Enumeration enumInsts =\r\n // m_cInstances[iClass].enumerateInstances();\r\n // int classIndex = m_Instances.classIndex();\r\n // while (enumInsts.hasMoreElements()) {\r\n // Instance instance = (Instance) enumInsts.nextElement();\r\n // m_cEstimator.addValue(instance.value(classIndex),\r\n // instance.weight());\r\n // } \r\n }", "private void createOncomingGroupsForBranchPoints(SignalGroupsData signalGroups) {\n Id<SignalSystem> idSystem2 = Id.create(\"signalSystem2\", SignalSystem.class);\r\n\t\tSignalGroupData signalIn2 = signalGroups.getFactory().createSignalGroupData(idSystem2, \r\n\t\t\t\tId.create(\"signalIn2\", SignalGroup.class));\r\n\t\tsignalIn2.addSignalId(Id.create(\"signal1_2.2_3\", Signal.class));\r\n\t\tsignalIn2.addSignalId(Id.create(\"signal1_2.2_7\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(signalIn2);\r\n\r\n\t\tSignalGroupData signalOut2 = signalGroups.getFactory().createSignalGroupData(idSystem2, \r\n\t\t\t\tId.create(\"signalLeftTurn7_2\", SignalGroup.class));\r\n\t\tsignalOut2.addSignalId(Id.create(\"signal7_2.2_1\", Signal.class));\r\n\t\tsignalOut2.addSignalId(Id.create(\"signal3_2.2_1\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(signalOut2);\r\n\t\t\r\n\t\t// create groups for system 5\r\n\t\tId<SignalSystem> idSystem5 = Id.create(\"signalSystem5\", SignalSystem.class);\r\n\t\tSignalGroupData signalIn5 = signalGroups.getFactory().createSignalGroupData(idSystem5, \r\n\t\t\t\tId.create(\"signalIn5\", SignalGroup.class));\r\n\t\tsignalIn5.addSignalId(Id.create(\"signal6_5.5_8\", Signal.class));\r\n\t\tsignalIn5.addSignalId(Id.create(\"signal6_5.5_4\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(signalIn5);\r\n\r\n\t\tSignalGroupData signalOut5 = signalGroups.getFactory().createSignalGroupData(idSystem5, \r\n\t\t\t\tId.create(\"signalOut5\", SignalGroup.class));\r\n\t\tsignalOut5.addSignalId(Id.create(\"signal4_5.5_6\", Signal.class));\r\n\t\tsignalOut5.addSignalId(Id.create(\"signal8_5.5_6\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(signalOut5);\r\n\t\t\r\n\t\tif (TtCreateParallelNetworkAndLanes.checkNetworkForSecondODPair(this.scenario.getNetwork())) {\r\n\t\t\t// create groups for system 10\r\n\t\t\tId<SignalSystem> idSystem10 = Id.create(\"signalSystem10\", SignalSystem.class);\r\n\t\t\tSignalGroupData signalIn10 = signalGroups.getFactory().createSignalGroupData(idSystem10, \r\n\t\t\t\t\tId.create(\"signalIn10\", SignalGroup.class));\r\n\t\t\tsignalIn10.addSignalId(Id.create(\"signal9_10.10_4\", Signal.class));\r\n\t\t\tsignalIn10.addSignalId(Id.create(\"signal9_10.10_3\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(signalIn10);\r\n\r\n\t\t\tSignalGroupData signalOut10 = signalGroups.getFactory().createSignalGroupData(idSystem10, \r\n\t\t\t\t\tId.create(\"signalOut10\", SignalGroup.class));\r\n\t\t\tsignalOut10.addSignalId(Id.create(\"signal3_10.10_9\", Signal.class));\r\n\t\t\tsignalOut10.addSignalId(Id.create(\"signal4_10.10_9\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(signalOut10);\r\n\t\t\t\r\n\t\t\t// create groups for system 11\r\n\t\t\tId<SignalSystem> idSystem11 = Id.create(\"signalSystem11\", SignalSystem.class);\r\n\t\t\tSignalGroupData signalIn11 = signalGroups.getFactory().createSignalGroupData(idSystem11, \r\n\t\t\t\t\tId.create(\"signalIn11\", SignalGroup.class));\r\n\t\t\tsignalIn11.addSignalId(Id.create(\"signal12_11.11_7\", Signal.class));\r\n\t\t\tsignalIn11.addSignalId(Id.create(\"signal12_11.11_8\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(signalIn11);\r\n\r\n\t\t\tSignalGroupData signalOut11 = signalGroups.getFactory().createSignalGroupData(idSystem11, \r\n\t\t\t\t\tId.create(\"signalOut11\", SignalGroup.class));\r\n\t\t\tsignalOut11.addSignalId(Id.create(\"signal8_11.11_12\", Signal.class));\r\n\t\t\tsignalOut11.addSignalId(Id.create(\"signal7_11.11_12\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(signalOut11);\r\n\t\t}\r\n\t}", "@Override\n public boolean checkCurrentStates(final CurrentStateOutput currentStateOutput,\n final String resourceName, final Partition partition, StateModelDefinition stateModelDef) {\n if (!stateModelDef.isSingleTopStateModel()) {\n return true;\n }\n // TODO: Cache top state count in the ResourceControllerDataProvider and avoid repeated counting\n // TODO: here. It would be premature to do it now. But with more use case, we can improve the\n // TODO: ResourceControllerDataProvider to calculate by default.\n if (currentStateOutput.getCurrentStateMap(resourceName, partition).values().stream()\n .filter(state -> state.equals(stateModelDef.getTopState())).count() > 1) {\n return false;\n }\n return true;\n }", "@PreDestroy\n public void saveStates() {\n if(getShopId() != 0) {\n log.info(\"Interrupt matching for shop {} during phase {} at {} \", getShopId(), getPhase(), new Date());\n getRemainingStates().add(new State(getShopId(), getPhase(), getPictureIds()));\n }\n getMatcherStateRepository().saveAllStates(getRemainingStates());\n }", "private void applyInsRevisions(ArrayList p_tags)\n {\n boolean b_changed = true;\n\n instags: while (b_changed)\n {\n for (int i = 0, max = p_tags.size(); i < max; i++)\n {\n Object o = p_tags.get(i);\n\n if (o instanceof HtmlObjects.Tag)\n {\n HtmlObjects.Tag tag = (HtmlObjects.Tag) o;\n String original = tag.original;\n\n if (tag.tag.equalsIgnoreCase(\"span\")\n && original.indexOf(\"class=msoIns\") >= 0)\n {\n removeInsTag(p_tags, tag);\n\n continue instags;\n }\n }\n }\n\n b_changed = false;\n }\n }", "private void createCommonGroupForBranchPoints(SignalGroupsData signalGroups) {\n SignalGroupData group2 = signalGroups.getFactory().createSignalGroupData(Id.create(\"signalSystem2\", SignalSystem.class), \r\n\t\t\t\tId.create(\"signal2\", SignalGroup.class));\r\n\t\tgroup2.addSignalId(Id.create(\"signal1_2.2_3\", Signal.class));\r\n\t\tgroup2.addSignalId(Id.create(\"signal7_2.2_1\", Signal.class));\r\n\t\tgroup2.addSignalId(Id.create(\"signal1_2.2_7\", Signal.class));\r\n\t\tgroup2.addSignalId(Id.create(\"signal3_2.2_1\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(group2);\r\n\t\t\r\n\t\t// create groups for system 5\r\n\t\tSignalGroupData group5 = signalGroups.getFactory().createSignalGroupData(Id.create(\"signalSystem5\", SignalSystem.class), \r\n\t\t\t\tId.create(\"signal5\", SignalGroup.class));\r\n\t\tgroup5.addSignalId(Id.create(\"signal6_5.5_8\", Signal.class));\r\n\t\tgroup5.addSignalId(Id.create(\"signal4_5.5_6\", Signal.class));\r\n\t\tgroup5.addSignalId(Id.create(\"signal6_5.5_4\", Signal.class));\r\n\t\tgroup5.addSignalId(Id.create(\"signal8_5.5_6\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(group5);\r\n\t\t\r\n\t\tif (TtCreateParallelNetworkAndLanes.checkNetworkForSecondODPair(this.scenario.getNetwork())) {\r\n\t\t\t// create groups for system 10\r\n\t\t\tSignalGroupData group10 = signalGroups.getFactory().createSignalGroupData(Id.create(\"signalSystem10\", SignalSystem.class), \r\n\t\t\t\t\tId.create(\"signal10\", SignalGroup.class));\r\n\t\t\tgroup10.addSignalId(Id.create(\"signal9_10.10_4\", Signal.class));\r\n\t\t\tgroup10.addSignalId(Id.create(\"signal3_10.10_9\", Signal.class));\r\n\t\t\tgroup10.addSignalId(Id.create(\"signal9_10.10_3\", Signal.class));\r\n\t\t\tgroup10.addSignalId(Id.create(\"signal4_10.10_9\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(group10);\r\n\r\n\t\t\t// create groups for system 11\r\n\t\t\tSignalGroupData group11 = signalGroups.getFactory().createSignalGroupData(Id.create(\"signalSystem11\", SignalSystem.class), \r\n\t\t\t\t\tId.create(\"signal11\", SignalGroup.class));\r\n\t\t\tgroup11.addSignalId(Id.create(\"signal12_11.11_7\", Signal.class));\r\n\t\t\tgroup11.addSignalId(Id.create(\"signal8_11.11_12\", Signal.class));\r\n\t\t\tgroup11.addSignalId(Id.create(\"signal12_11.11_8\", Signal.class));\r\n\t\t\tgroup11.addSignalId(Id.create(\"signal7_11.11_12\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(group11);\r\n\t\t}\r\n\t}", "@Test\n public void testDiff() throws Exception {\n String newVersionJarPath = \"data/sample/jar/change4.jar\";\n String oldVersionJarPath = \"data/sample/jar/change3.jar\";\n String changePath = \"data/sample/changes_change4_change3.txt\";\n\n// RelationInfo relationInfoForChangedPart = new RelationInfo(newVersionCodePath, oldVersionCodePath, changePath, false);\n// RelationInfo relationInfoForChangedPart = new RelationInfo(newVersionJarPath, oldVersionJarPath, changePath, false);\n// CallRelationGraph callGraphForChangedPart = new CallRelationGraph(relationInfoForChangedPart);\n//\n// double thresholdForInitialRegion = 0.35;\n// RelationInfo oldRelationInfo = new RelationInfo(newVersionJarPath,false);\n// oldRelationInfo.setPruning(thresholdForInitialRegion);\n// RelationInfo newRelationInfo = new RelationInfo(oldVersionJarPath,false);\n// newRelationInfo.setPruning(thresholdForInitialRegion);\n//\n// CallRelationGraph oldCallGraph = new CallRelationGraph(oldRelationInfo);\n// CallRelationGraph newCallGraph = new CallRelationGraph(newRelationInfo);\n//\n// ChangedArtifacts changedArtifacts = new ChangedArtifacts();\n// changedArtifacts.parse(changePath);\n//\n// InitialRegionFetcher fetcher = new InitialRegionFetcher(changedArtifacts, newCallGraph, oldCallGraph);\n//\n// ExportInitialRegion exporter = new ExportInitialRegion(fetcher.getChangeRegion());\n\n }", "@Override\n public void restore() {\n // Rather than copying the stored stuff back, just swap the pointers...\n int[] iTmp1 = m_iCurrentMatrices;\n m_iCurrentMatrices = m_iStoredMatrices;\n m_iStoredMatrices = iTmp1;\n\n int[] iTmp2 = m_iCurrentPartials;\n m_iCurrentPartials = m_iStoredPartials;\n m_iStoredPartials = iTmp2;\n\n// int[] iTmp3 = m_iCurrentStates;\n// m_iCurrentStates= m_iStoredStates;\n// m_iStoredStates = iTmp3;\n }", "private void bakeItemModels() {\n/* 754 */ Iterator<ResourceLocation> var1 = this.itemLocations.values().iterator();\n/* */ \n/* 756 */ while (var1.hasNext()) {\n/* */ \n/* 758 */ ResourceLocation var2 = var1.next();\n/* 759 */ ModelBlock var3 = (ModelBlock)this.models.get(var2);\n/* */ \n/* 761 */ if (func_177581_b(var3)) {\n/* */ \n/* 763 */ ModelBlock var4 = func_177582_d(var3);\n/* */ \n/* 765 */ if (var4 != null)\n/* */ {\n/* 767 */ var4.field_178317_b = var2.toString();\n/* */ }\n/* */ \n/* 770 */ this.models.put(var2, var4); continue;\n/* */ } \n/* 772 */ if (isCustomRenderer(var3))\n/* */ {\n/* 774 */ this.models.put(var2, var3);\n/* */ }\n/* */ } \n/* */ \n/* 778 */ var1 = this.field_177599_g.values().iterator();\n/* */ \n/* 780 */ while (var1.hasNext()) {\n/* */ \n/* 782 */ TextureAtlasSprite var5 = (TextureAtlasSprite)var1.next();\n/* */ \n/* 784 */ if (!var5.hasAnimationMetadata())\n/* */ {\n/* 786 */ var5.clearFramesTextureData();\n/* */ }\n/* */ } \n/* */ }", "public void updateFromSearchFilters() {\n this.businessTravelReadyModel.checked(ExploreHomesFiltersFragment.this.searchFilters.isBusinessTravelReady());\n ExploreHomesFiltersFragment.this.businessTravelAccountManager.setUsingBTRFilter(this.businessTravelReadyModel.checked());\n this.instantBookModel.checked(ExploreHomesFiltersFragment.this.searchFilters.isInstantBookOnly());\n this.entireHomeModel.checked(ExploreHomesFiltersFragment.this.searchFilters.getRoomTypes().contains(C6120RoomType.EntireHome));\n this.privateRoomModel.checked(ExploreHomesFiltersFragment.this.searchFilters.getRoomTypes().contains(C6120RoomType.PrivateRoom));\n this.sharedRoomModel.checked(ExploreHomesFiltersFragment.this.searchFilters.getRoomTypes().contains(C6120RoomType.SharedRoom));\n SearchMetaData homeTabMetadata = ExploreHomesFiltersFragment.this.dataController.getHomesMetadata();\n if (homeTabMetadata != null && homeTabMetadata.hasFacet()) {\n SearchFacets facets = homeTabMetadata.getFacets();\n this.entireHomeModel.show(facets.facetGreaterThanZero(C6120RoomType.EntireHome));\n this.privateRoomModel.show(facets.facetGreaterThanZero(C6120RoomType.PrivateRoom));\n this.sharedRoomModel.show(facets.facetGreaterThanZero(C6120RoomType.SharedRoom));\n }\n this.priceModel.minPrice(ExploreHomesFiltersFragment.this.searchFilters.getMinPrice()).maxPrice(ExploreHomesFiltersFragment.this.searchFilters.getMaxPrice());\n if (homeTabMetadata == null) {\n this.priceModel.histogram(null).metadata(null);\n } else {\n this.priceModel.histogram(homeTabMetadata.getPriceHistogram()).metadata(homeTabMetadata.getSearch());\n }\n this.priceButtonsModel.selection(ExploreHomesFiltersFragment.this.searchFilters.getPriceFilterSelection());\n this.bedCountModel.value(ExploreHomesFiltersFragment.this.searchFilters.getNumBeds());\n this.bedroomCountModel.value(ExploreHomesFiltersFragment.this.searchFilters.getNumBedrooms());\n this.bathroomCountModel.value(ExploreHomesFiltersFragment.this.searchFilters.getNumBathrooms());\n addCategorizedAmenitiesIfNeeded();\n updateOtherAmenitiesModels();\n updateFacilitiesAmenitiesModels();\n updateHouseRulesAmenitiesModels();\n notifyModelsChanged();\n }", "public void train() {\n\t\tfor (Instance ins : arrTrainInstances) {\n\t\t\tif (ins.scorePmi_E1E2 > largestPMI)\n\t\t\t\tlargestPMI = ins.scorePmi_E1E2;\n\t\t}\n\t\tSystem.out.println(\"Largest PMI: \" + largestPMI);\n\n\t\tfor (Instance ins : arrTrainInstances) {\n\t\t\tins.scorePmi_E1E2 = ins.scorePmi_E1E2 / largestPMI;\n\t\t}\n\n\t\tfor (Instance ins : arrTestInstances) {\n\t\t\tins.scorePmi_E1E2 = ins.scorePmi_E1E2 / largestPMI;\n\t\t}\n\n\t\tint sizeD0 = arrD0.size();\n\t\tint sizeD1 = arrD1.size();\n\t\tint sizeD2 = arrD2.size();\n\t\tint sizeD3 = arrD3.size();\n\n\t\tint sizeMin = Math.min(sizeD0, Math.min(sizeD1, Math\n\t\t\t\t.min(sizeD2, sizeD3)));\n\t\tSystem.out.println(\"sizeMin=\" + sizeMin);\n\n\t\tint n = instanceNums.length;\n\n\t\tboolean flag = false;\n\n\t\tint count = 0;\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tint k = instanceNums[i];\n\n\t\t\tif (k > sizeMin) {\n\t\t\t\tk = sizeMin;\n\t\t\t\tinstanceNums[i] = k;\n\t\t\t\tflag = true;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\\nk=\" + k);\n\n\t\t\tArrayList<Instance> arrSub0 = getInstances(arrD0, k);\n\t\t\tArrayList<Instance> arrSub1 = getInstances(arrD1, k);\n\t\t\tArrayList<Instance> arrSub2 = getInstances(arrD2, k);\n\t\t\tArrayList<Instance> arrSub3 = getInstances(arrD3, k);\n\n\t\t\tArrayList<Instance> arrTrains = new ArrayList<Instance>();\n\t\t\tarrTrains.addAll(arrSub0);\n\t\t\tarrTrains.addAll(arrSub1);\n\t\t\tarrTrains.addAll(arrSub2);\n\t\t\tarrTrains.addAll(arrSub3);\n\t\t\tCollections.shuffle(arrTrains);\n\n\t\t\tSystem.out.println(\"Training size: \" + arrTrains.size());\n\n\t\t\ttrain(arrTrains);\n\n\t\t\tdouble acc = test();\n\t\t\tacc = test();\n\n\t\t\taccuracies[i] = acc;\n\n\t\t\tcount++;\n\n\t\t\tif (flag == true)\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tSystem.out.print(\" | \" + \"K=\" + instanceNums[i]);\n\t\t}\n\t\tSystem.out.println();\n\n\t\tfor (int i = 0; i < count; i++) {\n\n\t\t\tDecimalFormat df = new DecimalFormat(\"#.####\");\n\t\t\tString res = df.format(accuracies[i]);\n\t\t\tSystem.out.print(\" | \" + res);\n\t\t}\n\t\tSystem.out.println();\n\t}", "@Override\n\tpublic void buildBVH() {\n\t\tif(this.bvhObjList.size()<=4) {\n\t\t}else {\n\t\t BVH nebt1 = new BVH(this.bvHi);\n\t\t BVH nebt2 = new BVH(this.bvHi);\n\t\tint tmp = this.calculateSplitDimension(this.bvhBox.getMax().sub(this.bvhBox.getMin()));\n\t\tfloat splitpos;\n\t\tif(tmp==0) {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).x();\n\t\t}else if(tmp==1) {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).y();\n\t\t}else {\n\t\t\tsplitpos = this.calculateMinMax().b.avg(this.calculateMinMax().a).z();\n\t\t\t\n\t\t}\n\t\tthis.distributeObjects(nebt1, nebt2, tmp, splitpos);\n\t\tthis.bvHi.add(nebt1);\n\t\tthis.neb1 = bvHi.indexOf(nebt1);\n\t\tthis.bvHi.add(nebt2);\n\t\tthis.neb2 = bvHi.indexOf(nebt2);\n\t\tnebt2.buildBVH();\n\t\tnebt1.buildBVH();\n\n\t\t}\n\t}", "private static void determineFinalRanks(Fold fold, ParametersManager params) {\n for (int currRank = fold.getNumInst(); currRank >= 1; currRank--) {\n Instance instSmallestWeight = fold.getInstSmallestWeight(); // selects the next less important instance\n\n instSmallestWeight.setRank(currRank); // ranks the instance by its order of elimination\n instSmallestWeight.setWeight(Double.POSITIVE_INFINITY); // the instance will be disregarded from now\n\n // removes the traces of the ranked instance out of the other instances\n fold.clearInstTraces(instSmallestWeight);\n\n /* For instances with rank value smaller than the number of neighbors, the relative position in the ranking\n is irrelevant (and, by construction, impossible to determine). Therefore, only the first steps of the\n ranking are performed for these instances. */\n if (currRank <= params.getNumNeighbors()) continue;\n\n // updates the distances matrix, setting the distance to or from the ranked instance to infinite\n fold.updateDistMatrix(instSmallestWeight.getId());\n\n // updates the weights of instances that had the eliminated instance among its nearest neighbors\n InstanceWeighting.updateAssociatesWeights(fold, instSmallestWeight, params);\n }\n }", "public void previousSolution() {\r\n\t\tif (solutionIndex > 0) {\r\n\t\t\tsolutionIndex--;\r\n\t\t\tcreateObjectDiagram(solutions.get(solutionIndex));\r\n\t\t} else {\r\n\t\t\tLOG.info(LogMessages.pagingFirst);\r\n\t\t}\r\n\t}", "public void setIns() {\n\t\tImage p1= null, f1 = null;\n\t\ttry {\n\t\t\tp1 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P1.png\"));\n\t\t\tf1 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P1 = new ImageView(p1);\n\t\tP1.setFitHeight(360); \n\t\tP1.setFitWidth(600);\n\t\tImageView F1 = new ImageView(f1);\n\t\tF1.setX(545); \n\t\tF1.setY(305);\n\t\tF1.setFitHeight(50); \n\t\tF1.setFitWidth(50);\n\n\t\tGroup insP1 = new Group(P1, F1);\n\t\tScene scene1 = new Scene(insP1, 600, 360);\n\n\t\tImage p2= null, b2 = null, f2 = null;\n\t\ttry {\n\t\t\tp2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P2.png\"));\n\t\t\tb2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P2 = new ImageView(p2);\n\t\tP2.setFitHeight(360); \n\t\tP2.setFitWidth(600);\n\t\tImageView B2 = new ImageView(b2);\n\t\tB2.setX(5); \n\t\tB2.setY(305);\n\t\tB2.setFitHeight(50); \n\t\tB2.setFitWidth(50);\n\t\tImageView F2 = new ImageView(f2);\n\t\tF2.setX(545); \n\t\tF2.setY(305);\n\t\tF2.setFitHeight(50); \n\t\tF2.setFitWidth(50);\n\n\t\tGroup insP2 = new Group(P2, F2, B2);\n\t\tScene scene2 = new Scene(insP2, 600, 360);\n\n\t\tImage p3= null, b3 = null, f3 = null;\n\t\ttry {\n\t\t\tp3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P3.png\"));\n\t\t\tb3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P3 = new ImageView(p3);\n\t\tP3.setFitHeight(360); \n\t\tP3.setFitWidth(600);\n\t\tImageView B3 = new ImageView(b3);\n\t\tB3.setX(5); \n\t\tB3.setY(305);\n\t\tB3.setFitHeight(50); \n\t\tB3.setFitWidth(50);\n\t\tImageView F3 = new ImageView(f3);\n\t\tF3.setX(545); \n\t\tF3.setY(305);\n\t\tF3.setFitHeight(50); \n\t\tF3.setFitWidth(50);\n\n\t\tGroup insP3 = new Group(P3, F3, B3);\n\t\tScene scene3 = new Scene(insP3, 600, 360);\n\n\t\tImage p4= null, b4 = null, f4 = null;\n\t\ttry {\n\t\t\tp4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P4.png\"));\n\t\t\tb4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P4 = new ImageView(p4);\n\t\tP4.setFitHeight(360); \n\t\tP4.setFitWidth(600);\n\t\tImageView B4 = new ImageView(b4);\n\t\tB4.setX(5); \n\t\tB4.setY(305);\n\t\tB4.setFitHeight(50); \n\t\tB4.setFitWidth(50);\n\t\tImageView F4 = new ImageView(f4);\n\t\tF4.setX(545); \n\t\tF4.setY(305);\n\t\tF4.setFitHeight(50); \n\t\tF4.setFitWidth(50);\n\n\t\tGroup insP4 = new Group(P4, B4, F4);\n\t\tScene scene4 = new Scene(insP4, 600, 360);\n\n\t\tImage p5= null, b5 = null;\n\t\ttry {\n\t\t\tp5 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P5.png\"));\n\t\t\tb5 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P5 = new ImageView(p5);\n\t\tP5.setFitHeight(360); \n\t\tP5.setFitWidth(600);\n\t\tImageView B5 = new ImageView(b5);\n\t\tB5.setX(5); \n\t\tB5.setY(305);\n\t\tB5.setFitHeight(50); \n\t\tB5.setFitWidth(50);\n\n\t\tGroup insP5 = new Group(P5, B5);\n\t\tScene scene5 = new Scene(insP5, 600, 360);\n\n\t\tStage newWindow = new Stage();\n\t\tnewWindow.setTitle(\"Instructions\");\n\t\tnewWindow.setScene(scene1);\n\t\tnewWindow.initModality(Modality.WINDOW_MODAL);\n\t\tnewWindow.initOwner(primaryStage);\n\n\t\tnewWindow.show();\n\n\t\tF1.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene2);\n\t\t\t}\n\t\t});\n\t\tB2.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene1);\n\t\t\t}\n\t\t});\n\t\tF2.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene3);\n\t\t\t}\n\t\t});\n\t\tB3.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene2);\n\t\t\t}\n\t\t});\n\t\tF3.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene4);\n\t\t\t}\n\t\t});\n\t\tB4.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene3);\n\t\t\t}\n\t\t});\n\t\tF4.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene5);\n\t\t\t}\n\t\t});\n\t\tB5.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene4);\n\t\t\t}\n\t\t});\n\t}", "private void createGroupsForBranchPoints(SignalGroupsData signalGroups) {\n Id<SignalSystem> idSystem2 = Id.create(\"signalSystem2\", SignalSystem.class);\r\n\t\tSignalGroupData groupLeftTurn12 = signalGroups.getFactory().createSignalGroupData(idSystem2, \r\n\t\t\t\tId.create(\"signalLeftTurn1_2\", SignalGroup.class));\r\n\t\tgroupLeftTurn12.addSignalId(Id.create(\"signal1_2.2_3\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(groupLeftTurn12);\r\n\r\n\t\tSignalGroupData groupLeftTurn72 = signalGroups.getFactory().createSignalGroupData(idSystem2, \r\n\t\t\t\tId.create(\"signalLeftTurn7_2\", SignalGroup.class));\r\n\t\tgroupLeftTurn72.addSignalId(Id.create(\"signal7_2.2_1\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(groupLeftTurn72);\r\n\t\t\r\n\t\tSignalGroupData groupRightTurns1232 = signalGroups.getFactory().createSignalGroupData(idSystem2, \r\n\t\t\t\tId.create(\"signalRightTurns2\", SignalGroup.class));\r\n\t\tgroupRightTurns1232.addSignalId(Id.create(\"signal1_2.2_7\", Signal.class));\r\n\t\tgroupRightTurns1232.addSignalId(Id.create(\"signal3_2.2_1\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(groupRightTurns1232);\r\n\t\t\r\n\t\t// create groups for system 5\r\n\t\tId<SignalSystem> idSystem5 = Id.create(\"signalSystem5\", SignalSystem.class);\r\n\t\tSignalGroupData groupLeftTurn65 = signalGroups.getFactory().createSignalGroupData(idSystem5, \r\n\t\t\t\tId.create(\"signalLeftTurn6_5\", SignalGroup.class));\r\n\t\tgroupLeftTurn65.addSignalId(Id.create(\"signal6_5.5_8\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(groupLeftTurn65);\r\n\r\n\t\tSignalGroupData groupLeftTurn45 = signalGroups.getFactory().createSignalGroupData(idSystem5, \r\n\t\t\t\tId.create(\"signalLeftTurn4_5\", SignalGroup.class));\r\n\t\tgroupLeftTurn45.addSignalId(Id.create(\"signal4_5.5_6\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(groupLeftTurn45);\r\n\t\t\r\n\t\tSignalGroupData groupRightTurns6585 = signalGroups.getFactory().createSignalGroupData(idSystem5, \r\n\t\t\t\tId.create(\"signalRightTurns5\", SignalGroup.class));\r\n\t\tgroupRightTurns6585.addSignalId(Id.create(\"signal6_5.5_4\", Signal.class));\r\n\t\tgroupRightTurns6585.addSignalId(Id.create(\"signal8_5.5_6\", Signal.class));\r\n\t\tsignalGroups.addSignalGroupData(groupRightTurns6585);\r\n\t\t\r\n\t\tif (TtCreateParallelNetworkAndLanes.checkNetworkForSecondODPair(this.scenario.getNetwork())) {\r\n\t\t\t// create groups for system 10\r\n\t\t\tId<SignalSystem> idSystem10 = Id.create(\"signalSystem10\", SignalSystem.class);\r\n\t\t\tSignalGroupData groupLeftTurn910 = signalGroups.getFactory().createSignalGroupData(idSystem10, \r\n\t\t\t\t\tId.create(\"signalLeftTurn9_10\", SignalGroup.class));\r\n\t\t\tgroupLeftTurn910.addSignalId(Id.create(\"signal9_10.10_4\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(groupLeftTurn910);\r\n\r\n\t\t\tSignalGroupData groupLeftTurn310 = signalGroups.getFactory().createSignalGroupData(idSystem10, \r\n\t\t\t\t\tId.create(\"signalLeftTurn3_10\", SignalGroup.class));\r\n\t\t\tgroupLeftTurn310.addSignalId(Id.create(\"signal3_10.10_9\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(groupLeftTurn310);\r\n\t\t\t\r\n\t\t\tSignalGroupData groupRightTurns910410 = signalGroups.getFactory().createSignalGroupData(idSystem10, \r\n\t\t\t\t\tId.create(\"signalRightTurns10\", SignalGroup.class));\r\n\t\t\tgroupRightTurns910410.addSignalId(Id.create(\"signal9_10.10_3\", Signal.class));\r\n\t\t\tgroupRightTurns910410.addSignalId(Id.create(\"signal4_10.10_9\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(groupRightTurns910410);\r\n\t\t\t\r\n\t\t\t// create groups for system 11\r\n\t\t\tId<SignalSystem> idSystem11 = Id.create(\"signalSystem11\", SignalSystem.class);\r\n\t\t\tSignalGroupData groupLeftTurn1211 = signalGroups.getFactory().createSignalGroupData(idSystem11, \r\n\t\t\t\t\tId.create(\"signalLeftTurn12_11\", SignalGroup.class));\r\n\t\t\tgroupLeftTurn1211.addSignalId(Id.create(\"signal12_11.11_7\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(groupLeftTurn1211);\r\n\r\n\t\t\tSignalGroupData groupLeftTurn811 = signalGroups.getFactory().createSignalGroupData(idSystem11, \r\n\t\t\t\t\tId.create(\"signalLeftTurn8_11\", SignalGroup.class));\r\n\t\t\tgroupLeftTurn811.addSignalId(Id.create(\"signal8_11.11_12\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(groupLeftTurn811);\r\n\t\t\t\r\n\t\t\tSignalGroupData groupRightTurns1211711 = signalGroups.getFactory().createSignalGroupData(idSystem11, \r\n\t\t\t\t\tId.create(\"signalRightTurns11\", SignalGroup.class));\r\n\t\t\tgroupRightTurns1211711.addSignalId(Id.create(\"signal12_11.11_8\", Signal.class));\r\n\t\t\tgroupRightTurns1211711.addSignalId(Id.create(\"signal7_11.11_12\", Signal.class));\r\n\t\t\tsignalGroups.addSignalGroupData(groupRightTurns1211711);\r\n\t\t}\r\n\t}", "public List<StockCounter> compareOldAndNewStepToExtractStockMotionsAndUpdateStockCounters(Etape oldEtape, Etape newEtape, CounterType counterTypeFrom, CounterType counterTypeTo);", "private void process() {\n\n Cluster current=_clusters.get(0);\n while (!current.isValid()) {\n KMeans kmeans=new KMeans(K,current);\n for (Cluster cluster : kmeans.getResult())\n if (cluster.getId()!=current.getId())\n _clusters.add(cluster);\n for (; current.isValid() && current.getId()+1<_clusters.size(); current=_clusters.get(current.getId()+1));\n }\n }", "private List<Region> experimentFullRegions() {\n\t\tList<Region> rs = new ArrayList<Region>();\n\t\tRegion r;\n\n\t\t// Vassar St\n\t\tr = new Region(\"Vassar-1\");\n\t\tr.addVertex(42.36255147026933, -71.09034599930573);\n\t\tr.addVertex(42.36240877523236, -71.08975591332245);\n\t\tr.addVertex(42.36013353836458, -71.09434785515595);\n\t\tr.addVertex(42.360442721730834, -71.0948091951065);\n\t\trs.add(r);\n\n\t\t// Windsor-1\n\t\tr = new Region(\"Windsor-1\");\n\t\tr.addVertex(42.36302711805193, -71.09707297951508);\n\t\tr.addVertex(42.36297955343571, -71.09641852051544);\n\t\tr.addVertex(42.3615288153431, -71.09657945305634);\n\t\tr.addVertex(42.36186970216797, -71.09723391205597);\n\t\trs.add(r);\n\n\t\t// Mass-1\n\t\tr = new Region(\"Mass-1\");\n\t\tr.addVertex(42.362678310030105, -71.0995620694809);\n\t\tr.addVertex(42.3629954083118, -71.09918656021881);\n\t\tr.addVertex(42.36179042632724, -71.09720172554779);\n\t\tr.addVertex(42.361322696830854, -71.09736265808868);\n\t\trs.add(r);\n\n\t\t// Mass-2\n\t\tr = new Region(\"Mass-2\");\n\t\tr.addVertex(42.36114036066024, -71.09588207871246);\n\t\tr.addVertex(42.360791542163774, -71.09660091072845);\n\t\tr.addVertex(42.36106901157985, -71.0969335046463);\n\t\tr.addVertex(42.36156052582344, -71.09657945305634);\n\t\trs.add(r);\n\n\t\t// Mass-3\n\t\tr = new Region(\"Mass-3\");\n\t\tr.addVertex(42.36035551632001, -71.09489502579498);\n\t\tr.addVertex(42.3601731773427, -71.09523834854889);\n\t\tr.addVertex(42.360577493491306, -71.095978638237);\n\t\tr.addVertex(42.36077568673155, -71.0955816713028);\n\t\trs.add(r);\n\n\t\t/*\n\t\t * Albany-1-full r = new Region(\"Albany-1\");\n\t\t * r.addVertex(42.36087874696942, -71.09530272156525);\n\t\t * r.addVertex(42.361227564981775, -71.0956353154831);\n\t\t * r.addVertex(42.362678310030105, -71.092556139534);\n\t\t * r.addVertex(42.362527687785665, -71.09185876519012); rs.add(r);\n\t\t */\n\n\t\t// Albany-1\n\t\tr = new Region(\"Albany-1\");\n\t\tr.addVertex(42.36172700558263, -71.09442295700836);\n\t\tr.addVertex(42.3614891772202, -71.09410109192658);\n\t\tr.addVertex(42.360823253016186, -71.09553875595856);\n\t\tr.addVertex(42.361084866938036, -71.09590353638458);\n\t\trs.add(r);\n\n\t\t// Albany-2\n\t\tr = new Region(\"Albany-2\");\n\t\tr.addVertex(42.362678310030105, -71.09243812233734);\n\t\tr.addVertex(42.36253561528121, -71.09191240937042);\n\t\tr.addVertex(42.36180628150339, -71.09342517525482);\n\t\tr.addVertex(42.36223436974708, -71.09344663292694);\n\t\trs.add(r);\n\n\t\t// Portland-1\n\t\tr = new Region(\"Portland-1\");\n\t\tr.addVertex(42.362757584750575, -71.09386505753326);\n\t\tr.addVertex(42.36273380234492, -71.09342517525482);\n\t\tr.addVertex(42.36217887699113, -71.09354319245148);\n\t\tr.addVertex(42.36198861574153, -71.09409036309052);\n\t\trs.add(r);\n\n\t\t// Main-2\n\t\tr = new Region(\"Main-1\");\n\t\tr.addVertex(42.36321737615673, -71.09918656021881);\n\t\tr.addVertex(42.36356618118581, -71.09917583138275);\n\t\tr.addVertex(42.36342348845344, -71.0969335046463);\n\t\tr.addVertex(42.363042972916034, -71.09699787766266);\n\t\trs.add(r);\n\n\t\t// Main-2\n\t\tr = new Region(\"Main-2\");\n\t\tr.addVertex(42.36318566651262, -71.09384359986115);\n\t\tr.addVertex(42.36278929461076, -71.09392943054962);\n\t\tr.addVertex(42.36297162599619, -71.09643997818756);\n\t\tr.addVertex(42.36336799674776, -71.09641852051544);\n\t\trs.add(r);\n\n\t\t// Main-3\n\t\tr = new Region(\"Main-3\");\n\t\tr.addVertex(42.36300333574834, -71.09216990143585);\n\t\tr.addVertex(42.36271794740286, -71.09249176651764);\n\t\tr.addVertex(42.36277343968266, -71.09333934456635);\n\t\tr.addVertex(42.363106392332284, -71.09324278504181);\n\t\trs.add(r);\n\n\t\t// Main-4\n\t\tr = new Region(\"Main-4\");\n\t\tr.addVertex(42.36289235154579, -71.09035672814178);\n\t\tr.addVertex(42.36259110772208, -71.09038891464996);\n\t\tr.addVertex(42.36264660011392, -71.09166564614105);\n\t\tr.addVertex(42.36303504548448, -71.09157981545258);\n\t\trs.add(r);\n\n\t\tLocation l;\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36035940296916);\n\t\tl.setLongitude(-71.0944926738739);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36081921192526);\n\t\tl.setLongitude(-71.09338760375977);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36160405047349);\n\t\tl.setLongitude(-71.0919177532196);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.3619370093201);\n\t\tl.setLongitude(-71.09123110771179);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36234924163794);\n\t\tl.setLongitude(-71.09039425849915);\n\t\tlog(String.format(\"Test point on Vassar is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.3631736981596);\n\t\tl.setLongitude(-71.09626293182373);\n\t\tlog(String.format(\"Test point on Main-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36303893196785);\n\t\tl.setLongitude(-71.09436392784119);\n\t\tlog(String.format(\"Test point on Main-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362935875273244);\n\t\tl.setLongitude(-71.09288334846497);\n\t\tlog(String.format(\"Test point on Main-2 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362785253646265);\n\t\tl.setLongitude(-71.09100580215454);\n\t\tlog(String.format(\"Test point on Main-3 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362476081807);\n\t\tl.setLongitude(-71.0936987400055);\n\t\tlog(String.format(\"Test point on Portland-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36099362133876);\n\t\tl.setLongitude(-71.09561920166016);\n\t\tlog(String.format(\"Test point on Albany-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36154855716084);\n\t\tl.setLongitude(-71.0943853855133);\n\t\tlog(String.format(\"Test point on Albany-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362008357414815);\n\t\tl.setLongitude(-71.093430519104);\n\t\tlog(String.format(\"Test point on Albany-2 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.362610849206014);\n\t\tl.setLongitude(-71.09221816062927);\n\t\tlog(String.format(\"Test point on Albany-2 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.3611521749309);\n\t\tl.setLongitude(-71.09653115272522);\n\t\tlog(String.format(\"Test point on Mass-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.3604862471552);\n\t\tl.setLongitude(-71.09537243843079);\n\t\tlog(String.format(\"Test point on Mass-2 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\tl = new Location(\"\");\n\t\tl.setLatitude(42.36238887921827);\n\t\tl.setLongitude(-71.09683156013489);\n\t\tlog(String.format(\"Test point on Windsor-1 is in region %s\",\n\t\t\t\tgetRegion(rs, l)));\n\n\t\treturn rs;\n\t}", "private void calculateGlobals() {\n if (!edge.getIncomingLinks().isEmpty()) {\n this.source = edge.getIncomingLinks().get(0);\n } else\n throw new RuntimeException(\"edge hs no source : \" + edge.getId());\n if (!edge.getOutgoingLinks().isEmpty()) {\n this.target = edge.getOutgoingLinks().get(0);\n } else\n throw new RuntimeException(\"edge hs no target : \" + edge.getId());\n\n this.sourceGeometry = source.getGeometry();\n this.targetGeometry = target.getGeometry();\n\n // get relative centers of elements\n this.sourceRelativCenterX = this.sourceGeometry.getWidth() / 2;\n this.sourceRelativCenterY = this.sourceGeometry.getHeight() / 2;\n this.targetRelativCenterX = this.targetGeometry.getWidth() / 2;\n this.targetRelativCenterY = this.targetGeometry.getHeight() / 2;\n\n // get parent adjustments\n double sourceParentAdjustmentX = 0;\n double sourceParentAdjustmentY = 0;\n LayoutingElement parent = this.source.getParent();\n while (parent != null) {\n sourceParentAdjustmentX += parent.getGeometry().getX();\n sourceParentAdjustmentY += parent.getGeometry().getY();\n parent = parent.getParent();\n }\n\n double targetParentAdjustmentX = 0;\n double targetParentAdjustmentY = 0;\n parent = this.target.getParent();\n while (parent != null) {\n targetParentAdjustmentX += parent.getGeometry().getX();\n targetParentAdjustmentY += parent.getGeometry().getY();\n parent = parent.getParent();\n }\n\n // get absolute coordinates\n double sourceAbsoluteX = this.sourceGeometry.getX() + sourceParentAdjustmentX;\n this.sourceAbsoluteY = this.sourceGeometry.getY() + sourceParentAdjustmentY;\n this.sourceAbsoluteX2 = this.sourceGeometry.getX2() + sourceParentAdjustmentX;\n this.sourceAbsoluteY2 = this.sourceGeometry.getY2() + sourceParentAdjustmentY;\n\n this.targetAbsoluteX = this.targetGeometry.getX() + targetParentAdjustmentX;\n this.targetAbsoluteY = this.targetGeometry.getY() + targetParentAdjustmentY;\n this.targetAbsoluteY2 = this.targetGeometry.getY2() + targetParentAdjustmentY;\n\n this.sourceAbsoluteCenterX = sourceAbsoluteX + this.sourceRelativCenterX;\n this.sourceAbsoluteCenterY = this.sourceAbsoluteY + this.sourceRelativCenterY;\n this.targetAbsoluteCenterX = this.targetAbsoluteX + this.targetRelativCenterX;\n this.targetAbsoluteCenterY = this.targetAbsoluteY + this.targetRelativCenterY;\n\n // layout hints\n this.sourceJoin = this.source.isJoin();\n this.sourceSplit = this.source.isSplit();\n this.targetJoin = this.target.isJoin();\n this.target.isSplit();\n this.backwards = this.sourceAbsoluteCenterX > this.targetAbsoluteCenterX;\n }", "public void updateStructure()\n\t{\n\t\tboolean itWorked = true;\n\t\t\n\t\t// Get block's rotational information as a ForgeDirection\n\t\tForgeDirection rotation = ForgeDirection.getOrientation(Utils.backFromMeta(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)));\n\t\t\n\t\t//\n\t\t// Step one: validate all blocks\n\t\t//\n\t\t\n\t\t// Get the MachineStructures from the MachineStructureRegistrar\n\t\t// But if the machine is already set up it should only check the desired structure.\n\t\tfor (MachineStructure struct : (structureComplete() ? MachineStructureRegistrar.getStructuresForMachineID(getMachineID()) : MachineStructureRegistrar.getStructuresForMachineID(getMachineID())))\n\t\t{\n\t\t\t// Check each block in requirements\n\t\t\tfor (PReq req : struct.requirements)\n\t\t\t{\n\t\t\t\t// Get the rotated block coordinates.\n\t\t\t\tBlockPosition pos = req.rel.getPosition(rotation, xCoord, yCoord, zCoord);\n\n\t\t\t\t// Check the requirement.\n\t\t\t\tif (!req.requirement.isMatch(tier, worldObj, pos.x, pos.y, pos.z, xCoord, yCoord, zCoord))\n\t\t\t\t{\n\t\t\t\t\t// If it didn't work, stop checking.\n\t\t\t\t\titWorked = false; break;\n\t\t\t\t}\n\t\t\t\t// If it did work keep calm and carry on\n\t\t\t}\n\t\t\t\n\t\t\t// We've gone through all the blocks. They all match up!\n\t\t\tif (itWorked)\n\t\t\t{\n\t\t\t\t// **If the structure is new only**\n\t\t\t\t// Which implies the blocks have changed between checks\n\t\t\t\tif (struct.ID != structureID)\n\t\t\t\t{\n\t\t\t\t\t//\n\t\t\t\t\t// This is only called when structures are changed/first created.\n\t\t\t\t\t//\n\t\t\t\t\t\n\t\t\t\t\t// Save what structure we have.\n\t\t\t\t\tstructureID = struct.ID;\n\t\t\t\t\t\n\t\t\t\t\t// Make an arraylist to save all teh structures\n\t\t\t\t\tArrayList<StructureUpgradeEntity> newEntities = new ArrayList<StructureUpgradeEntity>();\n\n\t\t\t\t\t// Tell all of the blocks to join us!\n\t\t\t\t\tfor (PReq req : struct.requirements)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Get the blocks that the structure has checked.\n\t\t\t\t\t\tBlockPosition pos = req.rel.getPosition(rotation, xCoord, yCoord, zCoord);\n\t\t\t\t\t\tBlock brock = worldObj.getBlock(pos.x, pos.y, pos.z); if (brock == null) continue;\n\n\t\t\t\t\t\tif (brock instanceof IStructureAware)\n\t\t\t\t\t\t\t((IStructureAware)brock).onStructureCreated(worldObj, pos.x, pos.y, pos.z, xCoord, yCoord, zCoord);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Check the tile entity for upgrades\n\t\t\t\t\t\tTileEntity ent = worldObj.getTileEntity(pos.x, pos.y, pos.z);\n\t\t\t\t\t\tif (ent != null && ent instanceof StructureUpgradeEntity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tStructureUpgradeEntity structEnt = (StructureUpgradeEntity)ent;\n\t\t\t\t\t\t\tnewEntities.add(structEnt);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* // Not sure about this.\n\t\t\t\t\t\t\tif (structEnt.coreX != xCoord && structEnt.coreY != yCoord && structEnt.coreZ != zCoord)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstructEnt.onCoreConnected()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// do stuff with that\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// I haven't figured out how the hell to do toArray() in this crap\n\t\t\t\t\t// so here's a weird combination of iterator and for loop\n\t\t\t\t\tupgrades = new StructureUpgradeEntity[newEntities.size()];\n\t\t\t\t\tfor (int i = 0; i < newEntities.size(); i++)\n\t\t\t\t\t\tupgrades[i] = newEntities.get(i);\n\n\t\t\t\t\t// Tell all of the structure blocks to stripe it up!\n\t\t\t\t\tfor (RelativeFaceCoords relPos : struct.relativeStriped)\n\t\t\t\t\t{\n\t\t\t\t\t\tBlockPosition pos = relPos.getPosition(rotation, xCoord, yCoord, zCoord);\n\t\t\t\t\t\tBlock brock = worldObj.getBlock(pos.x, pos.y, pos.z);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If it's a structure block tell it to stripe up\n\t\t\t\t\t\tif (brock != null && brock instanceof StructureBlock)\n\t\t\t\t\t\t\tworldObj.setBlockMetadataWithNotify(pos.x, pos.y, pos.z, 2, 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// If not, reset the loop and try again.\n\t\t\telse { itWorked = true; continue; }\n\t\t}\n\t\t\n\t\t//\n\t\t// None of the structures worked!\n\t\t//\n\t\t\n\t\t// If we had a structure before, we need to clear it\n\t\tif (structureComplete())\n\t\t{\n\t\t\tfor (PReq req : MachineStructureRegistrar.getMachineStructureByID(structureID).requirements)\n\t\t\t{\n\t\t\t\tBlockPosition pos = req.rel.getPosition(rotation, xCoord, yCoord, zCoord);\n\t\t\t\tBlock brock = worldObj.getBlock(pos.x, pos.y, pos.z);\n\t\t\t\t\n\t\t\t\t// This will also un-stripe all structure blocks.\n\t\t\t\tif (brock instanceof IStructureAware)\n\t\t\t\t\t((IStructureAware)brock).onStructureBroken(worldObj, pos.x, pos.y, pos.z, xCoord, yCoord, zCoord);\n\t\t\t}\n\t\t\t// We don't have a structure.\n\t\t\tstructureID = null;\n\t\t}\n\t\t\n\t}", "private void calculations() {\n\t\tSystem.out.println(\"Starting calculations\\n\");\n\t\tcalcMedian(myProt.getChain(requestedChain));\n\t\tcalcZvalue(myProt.getChain(requestedChain));\n\t\tcalcSVMweightedZvalue(myProt.getChain(requestedChain));\n\t}", "private void deepEnterSequence_mainRegion_State2__region0_State4__region0_State7__region0() {\n\t\tswitch (historyVector[2]) {\n\t\t\tcase mainRegion_State2__region0_State4__region0_State7__region0_State8 :\n\t\t\t\tenterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State8_default();\n\t\t\t\tbreak;\n\n\t\t\tcase mainRegion_State2__region0_State4__region0_State7__region0_State9 :\n\t\t\t\tenterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9_default();\n\t\t\t\tbreak;\n\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\t}", "private void onUpdate(FrameTime frameTime) {\n Frame frame = arFragment.getArSceneView().getArFrame();\n Collection<AugmentedImage> images = frame.getUpdatedTrackables(AugmentedImage.class);\n //Iterate through the image database\n for (AugmentedImage image : images) {\n // Check if scanned image existed in the image database\n if (image.getTrackingMethod() == AugmentedImage.TrackingMethod.FULL_TRACKING) {\n //Set the scene\n RelativeLayout gallery = findViewById(R.id.gallery);\n ArFragment arFragment = (ArFragment) getSupportFragmentManager().findFragmentById(R.id.arFragment);\n String name = image.getName();\n //check which image was scanned\n switch (name) {\n case \"argon.png\":\n //Set string\n string = \"argon.sfb\";\n //Set the text that appears to the student\n text=getString(R.string.argon2);\n //call the 3D object\n callAR();\n break;\n case \"bromine.png\":\n string = \"bariumatom.sfb\";\n text=getString(R.string.bromine2);\n callAR();\n break;\n case \"calcium.png\":\n string = \"calcium.sfb\";\n text=getString(R.string.calcium2);\n callAR();\n break;\n case \"chlorine.png\":\n string = \"chlorineatom.sfb\";\n text=getString(R.string.chlorine2);\n callAR();\n break;\n case \"fluorine.png\":\n string = \"fluorineatom.sfb\";\n text=getString(R.string.fluorine2);\n callAR();\n break;\n case \"helium.png\":\n string = \"heliumatom.sfb\";\n text=getString(R.string.helium2);\n callAR();\n break;\n case \"hydrogen.png\":\n string = \"hydrogen.sfb\";\n text=getString(R.string.hydrogen2);\n callAR();\n break;\n case \"lithium.png\":\n string = \"Lithiumatom.sfb\";\n text=getString(R.string.lithium2);\n callAR();\n break;\n case \"magnesium.png\":\n string = \"magnesiumatomm.sfb\";\n text=getString(R.string.magnesium2);\n callAR();\n break;\n case \"neon.png\":\n string = \"neonn.sfb\";\n text=getString(R.string.neon2);\n callAR();\n break;\n case \"sodium.png\":\n string = \"sodium.sfb\";\n text=getString(R.string.sodium2);\n callAR();\n break;\n }\n\n\n }\n }\n }", "@Override\r\n public void buildClassifier(Instances instances) throws Exception {\n getCapabilities().testWithFail(instances);\r\n\r\n // remove instances with missing class\r\n instances = new Instances(instances);\r\n instances.deleteWithMissingClass();\r\n\r\n // ensure we have a data set with discrete variables only and with no\r\n // missing values\r\n instances = normalizeDataSet(instances);\r\n\r\n // copy instances to local field\r\n// m_Instances = new Instances(instances);\r\n m_Instances = instances;\r\n\r\n // initialize arrays\r\n int numClasses = m_Instances.classAttribute().numValues();\r\n m_Structures = new BayesNet[numClasses];\r\n m_cInstances = new Instances[numClasses];\r\n // m_cEstimator = new DiscreteEstimatorBayes(numClasses, m_fAlpha);\r\n\r\n for (int iClass = 0; iClass < numClasses; iClass++) {\r\n splitInstances(iClass);\r\n }\r\n\r\n // update probabilty of class label, using Bayesian network associated\r\n // with the class attribute only\r\n Remove rFilter = new Remove();\r\n rFilter.setAttributeIndices(\"\" + (m_Instances.classIndex() + 1));\r\n rFilter.setInvertSelection(true);\r\n rFilter.setInputFormat(m_Instances);\r\n Instances classInstances = new Instances(m_Instances);\r\n classInstances = Filter.useFilter(classInstances, rFilter);\r\n\r\n m_cEstimator = new BayesNet();\r\n SimpleEstimator classEstimator = new SimpleEstimator();\r\n classEstimator.setAlpha(m_fAlpha);\r\n m_cEstimator.setEstimator(classEstimator);\r\n m_cEstimator.buildClassifier(classInstances);\r\n\r\n /*combiner = new LibSVM(); \r\n FastVector classFv = new FastVector(2);\r\n classFv.addElement(CNTL);\r\n classFv.addElement(CASE);\r\n Attribute classAt = new Attribute(m_Instances.classAttribute().name(), \r\n classFv);\r\n attributesFv = new FastVector(m_Structures.length);\r\n attributesFv.addElement(classAt);\r\n for (int i = 0; i < m_Instances.classAttribute().numValues(); i++){\r\n if (!m_Instances.classAttribute().value(i).equals(CNTL))\r\n attributesFv.addElement(new Attribute(m_Instances.classAttribute\r\n ().value(i)));\r\n }\r\n combinerTrain = new Instances(\"combinertrain\", attributesFv, \r\n m_Instances.numInstances());\r\n combinerTrain.setClassIndex(0);\r\n for (int i = 0; i < m_Instances.numInstances(); i++){\r\n double[] probs = super.distributionForInstance(m_Instances.instance(i));\r\n Instance result = new Instance(attributesFv.size()); \r\n if (!m_Instances.classAttribute().value(m_Instances.instance(i).\r\n classIndex()).equals(CNTL))\r\n result.setValue(classAt, CASE);\r\n else\r\n result.setValue(classAt, CNTL);\r\n for (int j = 0; j < attributesFv.size(); j++){\r\n if (!attributesFv.elementAt(j).equals(classAt)){\r\n Attribute current = (Attribute) attributesFv.elementAt(j);\r\n result.setValue(current, \r\n probs[m_Instances.classAttribute().indexOfValue\r\n (current.name())]);\r\n }\r\n }\r\n combinerTrain.add(result);\r\n }\r\n combinerTrain = discretize(combinerTrain);\r\n combiner.buildClassifier(combinerTrain);*/\r\n }", "private void restorePreviousState() {\n\n\t\tif (StoreAnalysisStateApplication.question1Answered) {\n\t\t\tfirstImageVievQuestion\n\t\t\t\t\t.setImageResource(R.drawable.swipegestureenabled);\n\t\t}\n\n\t\tif (StoreAnalysisStateApplication.question2Answered) {\n\t\t\tsecondImageVievQuestion\n\t\t\t\t\t.setImageResource(R.drawable.swipegestureenabled);\n\t\t}\n\n\t\tif (StoreAnalysisStateApplication.question3Answered) {\n\t\t\tthirdImageVievQuestion\n\t\t\t\t\t.setImageResource(R.drawable.swipegestureenabled);\n\t\t}\n\n\t\tif (StoreAnalysisStateApplication.stageCleared) {\n\t\t\tfirstImageVievDescription\n\t\t\t\t\t.setImageResource(R.drawable.swipegestureenabled);\n\t\t}\n\n\t\tif (StoreDesignStateApplication.stageCleared) {\n\t\t\tsecondImageVievDescription\n\t\t\t\t\t.setImageResource(R.drawable.voicereadingenabled);\n\t\t}\n\n\t\tif (StoreImplementationStateApplication.stageCleared) {\n\t\t\tthirdImageVievDescription\n\t\t\t\t\t.setImageResource(R.drawable.microphonenabled);\n\t\t}\n\n\t}", "public void cleanUpDuplicatedStructures() throws Exception {\n\t\tif (currentDeployedStructs == null)\n\t\t\treturn;\n\t\t\n\t\tSet<DeployedPhysicalStructure> duplicatedStructsToBeRemoved = findDuplicatedStructures(currentDeployedStructs);\n\t\t\n\t\t// now let us remove the duplicated ones! they exist in the DB because currentDeployedStructs is guaranteed to always reflect what's deployed in the DB\n\t\tfor (DeployedPhysicalStructure p : duplicatedStructsToBeRemoved) {\n\t\t\tlog.status(LogLevel.WARNING, \"found a repeated deployed structure, going to remove it: \" + p.getSchema() +\".\"+ p.getBasename());\n\t\t\tdropPhysicalStructure(dbConnection, p.getSchema(), p.getBasename());\n\t\t}\t\t\n\t}", "@Test\n\tpublic void testManagementGraph() {\n\n\t\tfinal ManagementGraph orig = constructTestManagementGraph();\n\t\tfinal ManagementGraph copy = (ManagementGraph) ManagementTestUtils.createCopy(orig);\n\n\t\tassertEquals(orig.getJobID(), copy.getJobID());\n\t\tassertEquals(orig.getNumberOfStages(), copy.getNumberOfStages());\n\n\t\tfor (int i = 0; i < orig.getNumberOfStages(); i++) {\n\n\t\t\tfinal ManagementStage origStage = orig.getStage(i);\n\t\t\tfinal ManagementStage copyStage = copy.getStage(i);\n\n\t\t\tassertEquals(origStage.getNumberOfGroupVertices(), copyStage.getNumberOfGroupVertices());\n\t\t\tassertEquals(origStage.getNumberOfInputGroupVertices(), copyStage.getNumberOfInputGroupVertices());\n\t\t\tassertEquals(origStage.getNumberOfOutputGroupVertices(), copyStage.getNumberOfOutputGroupVertices());\n\n\t\t\tfor (int j = 0; j < origStage.getNumberOfInputGroupVertices(); j++) {\n\n\t\t\t\tfinal ManagementGroupVertex origGroupVertex = origStage.getInputGroupVertex(j);\n\t\t\t\tfinal ManagementGroupVertex copyGroupVertex = copyStage.getInputGroupVertex(j);\n\n\t\t\t\tassertEquals(origGroupVertex.getID(), copyGroupVertex.getID());\n\t\t\t}\n\n\t\t\tfor (int j = 0; j < origStage.getNumberOfOutputGroupVertices(); j++) {\n\n\t\t\t\tfinal ManagementGroupVertex origGroupVertex = origStage.getOutputGroupVertex(j);\n\t\t\t\tfinal ManagementGroupVertex copyGroupVertex = copyStage.getOutputGroupVertex(j);\n\n\t\t\t\tassertEquals(origGroupVertex.getID(), copyGroupVertex.getID());\n\t\t\t}\n\n\t\t\tfor (int j = 0; j < origStage.getNumberOfGroupVertices(); j++) {\n\n\t\t\t\tfinal ManagementGroupVertex origGroupVertex = origStage.getGroupVertex(j);\n\t\t\t\tfinal ManagementGroupVertex copyGroupVertex = copyStage.getGroupVertex(j);\n\n\t\t\t\ttestGroupVertex(origGroupVertex, copyGroupVertex);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public List<InstanceOverallStatusDto> syncInstances(List<Manifest.Key> given) {\n List<InstanceDto> list = list();\n List<Manifest.Key> instances = (given == null || given.isEmpty()) ? list.stream().map(d -> d.instance).toList() : given;\n Set<String> errors = new TreeSet<>();\n\n // on CENTRAL only, synchronize managed servers. only after that we know all instances.\n if (minion.getMode() == MinionMode.CENTRAL) {\n List<ManagedMasterDto> toSync = list.stream().filter(i -> instances.contains(i.instance)).map(i -> i.managedServer)\n .toList();\n\n log.info(\"Mass-synchronize {} server(s).\", toSync.size());\n\n ManagedServersResource rs = rc.initResource(new ManagedServersResourceImpl());\n try (Activity sync = reporter.start(\"Synchronize Servers\", toSync.size())) {\n AtomicLong syncNo = new AtomicLong(0);\n ExecutorService es = Executors.newFixedThreadPool(4, new RequestScopedNamedDaemonThreadFactory(reqScope,\n reg.get(group).getTransactions(), reporter, () -> \"Mass-Synchronizer \" + syncNo.incrementAndGet()));\n List<Future<?>> syncTasks = new ArrayList<>();\n for (ManagedMasterDto host : toSync) {\n syncTasks.add(es.submit(() -> {\n try (Activity singleSync = reporter.start(\"Synchronize \" + host.hostName)) {\n if (log.isDebugEnabled()) {\n log.debug(\"Synchronize {}\", host.hostName);\n }\n rs.synchronize(group, host.hostName);\n } catch (Exception e) {\n errors.add(host.hostName);\n log.warn(\"Could not synchronize managed server: {}: {}\", host.hostName, e.toString());\n if (log.isDebugEnabled()) {\n log.debug(\"Exception:\", e);\n }\n }\n sync.workAndCancelIfRequested(1);\n }));\n }\n\n FutureHelper.awaitAll(syncTasks);\n es.shutdown(); // make all threads exit :)\n }\n } else {\n // update the local stored state.\n ResourceProvider.getResource(minion.getSelf(), MasterRootResource.class, context).getNamedMaster(group)\n .updateOverallStatus();\n }\n\n // for each instance, read the meta-manifest, and provide the recorded data.\n var result = new ArrayList<InstanceOverallStatusDto>();\n for (var inst : list.stream().filter(i -> instances.contains(i.instance)).toList()) {\n if (inst.managedServer != null && inst.managedServer.hostName != null\n && errors.contains(inst.managedServer.hostName)) {\n continue; // no state as we could not sync.\n }\n result.add(new InstanceOverallStatusDto(inst.instanceConfiguration.id,\n new InstanceOverallState(inst.instance, hive).read()));\n }\n\n return result;\n }", "private void handleStepChange()\n {\n boolean processorsChanged = false;\n myProcessorsLock.writeLock().lock();\n try\n {\n final Iterator<Entry<ProcessorDistributionKey, GeometryProcessor<? extends Geometry>>> procIter = myGeometryProcessorsMap\n .entrySet().iterator();\n final ActiveTimeSpans activeTimeSpans = myActiveTimeSpans;\n while (procIter.hasNext())\n {\n final Entry<ProcessorDistributionKey, GeometryProcessor<? extends Geometry>> entry = procIter.next();\n if (!inProcessRange(entry.getKey(), activeTimeSpans))\n {\n processorsChanged = true;\n procIter.remove();\n myInactiveGeometries.put(entry.getKey(), New.set(entry.getValue().getGeometries()));\n entry.getValue().close();\n }\n }\n\n final Iterator<Entry<ProcessorDistributionKey, Set<Geometry>>> inactiveIter = myInactiveGeometries.entrySet()\n .iterator();\n while (inactiveIter.hasNext())\n {\n final Entry<ProcessorDistributionKey, Set<Geometry>> entry = inactiveIter.next();\n if (inProcessRange(entry.getKey(), activeTimeSpans) && !entry.getValue().isEmpty())\n {\n processorsChanged = true;\n inactiveIter.remove();\n setProcessorConstraints(entry.getKey());\n final GeometryProcessor<? extends Geometry> processor = myProcessorBuilder\n .createProcessorForClass(entry.getKey().getGeometryType());\n processor.receiveObjects(this, entry.getValue(), Collections.<Geometry>emptyList());\n myGeometryProcessorsMap.put(entry.getKey(), processor);\n }\n }\n }\n finally\n {\n myProcessorsLock.writeLock().unlock();\n }\n\n if (processorsChanged)\n {\n populateRenderableProcessors();\n }\n }", "public void extractStackedDataObjects(AbstractModelAdapter model) {\n\t\tfor(NodeInterface n : model.getNodes()) {\r\n\t\t\tBPMNNodeInterface _n = (BPMNNodeInterface) n;\r\n\t\t\tif(_n.isDataObject()) {\r\n\t\t\t\tif(isPartOfTree(_n,model)) {\r\n\t\t\t\t\tf_data.add(new DOTree(_n,model));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void updateDeletions() {\r\n for (Lane l : lanes) {\r\n Vehicle[] vehArray = l.getVehicles().toArray(new Vehicle[0]);\r\n for (Vehicle v : vehArray) {\r\n if (v.getHeadSegment().equals(l.getLastSegment())) {\r\n l.getVehicles().remove(v);\r\n numberOfVehicles--;\r\n if (v instanceof Car) {\r\n SimulationStats.incrementCars();\r\n SimulationStats.addEvent(SimulationStats.createVehicleLeavingEvent(v));\r\n } else if (v instanceof Truck) {\r\n SimulationStats.incrementTrucks();\r\n SimulationStats.addEvent(SimulationStats.createVehicleLeavingEvent(v));\r\n }\r\n }\r\n }\r\n }\r\n }", "@SuppressWarnings({ \"unchecked\", \"deprecation\" })\n\tprivate static NeuralNetwork crossover(NeuralNetwork cross, NeuralNetwork over, Singleton s1) throws IOException, ClassNotFoundException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException {\n\t\tEvolveSingleton s = (EvolveSingleton) s1;\n\t\t//determines which of the two networks was more fit and less fit\n\t\tClass<? extends NeuralNetwork> networkClass = (Class<? extends NeuralNetwork>) Class.forName(\"BackEvolution.\"+s.getType()+\".\"+s.getType()+\"Network\");\n\t\tClass<? extends Layer> layerClass = (Class<? extends Layer>) Class.forName(\"BackEvolution.\"+s.getType()+\".\"+s.getType()+\"Layer\");\n\t\tClass<? extends Neuron> neuronClass = (Class<? extends Neuron>) Class.forName(\"BackEvolution.\"+s.getType()+\".\"+s.getType()+\"Neuron\");\n\t\tNeuralNetwork newnn = null;\n\t\tNeuralNetwork lessfit = null;\n\t\tNeuralNetwork morefit = null;\n\t\tif (cross.getFitness() > over.getFitness()){\n\t\t\tmorefit = cross;\n\t\t\tlessfit = over;\n\t\t}\n\t\telse{\n\t\t\tmorefit = over;\n\t\t\tlessfit = cross;\n\t\t}\n\t\t//creates the structure for the new network\n\t\tLayer[] puts = NetworkCreator.creator(s);\n\t\tClass<?>[] types2 = {Class.forName(\"BackEvolution.Layer\"),Class.forName(\"BackEvolution.Layer\")};\n\t\tConstructor<? extends NeuralNetwork> con2 = networkClass.getConstructor(types2);\n\t\tClass<? extends SpecialCreator> managerClass = (Class<? extends SpecialCreator>) Class.forName(\"BackEvolution.\"+s.getType()+\".\"+s.getType()+\"Creator\");\n\t\tSpecialCreator manager = managerClass.newInstance();\n\t\tmanager.InputOutputcreator(puts);\n\t\tnewnn = con2.newInstance(puts[0],puts[1]);\n\t\tNetworkCreator.Neuraltracker(newnn);\n\t\t//pretty sure this is obsolete from when i tried to breed different layered networks but not sure if I can delete.\n\t\tArrayList<Layer> lesslayers = lessfit.getLayers();\n\t\tArrayList<Layer> morelayers = morefit.getLayers();\n\t\tint maxlayers = 1;\n\t\tif (lesslayers.size() > morelayers.size()){\n\t\t\tmaxlayers = lesslayers.size();\n\t\t}\n\t\telse { \n\t\t\tmaxlayers = morelayers.size();\n\t\t}\n\t\t//adds the neuron to each layer based on which network had the most neurons in that layer\n\t\tfor (int i = 1; i < maxlayers-1; i++){\n\t\t\tLayer lesslayer = null;\n\t\t\tLayer morelayer = null;\n\t\t\tint lessnum = 0;\n\t\t\tint morenum = 0;\n\t\t\ttry{\n\t\t\tlesslayer = lesslayers.get(i);\n\t\t\tlessnum = lesslayer.getNeurons().size();\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tmorelayer = morelayers.get(i);\n\t\t\t\tmorenum = morelayer.getNeurons().size();\n\t\t\t}\n\t\t\ttry{\n\t\t\tmorelayer = morelayers.get(i);\n\t\t\tmorenum = morelayer.getNeurons().size();\n\t\t\t}\n\t\t\tcatch (Exception e){\n\t\t\t}\n\t\t\tif (morelayer == null) morenum = 0;\n\t\t\telse if (morelayer.isOutput()){\n\t\t\t\tmorenum = 0;\n\t\t\t}\n\t\t\tif (lesslayer == null) lessnum = 0;\n\t\t\telse if (lesslayer.isOutput()){\n\t\t\t\tlessnum = 0;\n\t\t\t}\n\t\t\tClass<?>[] types = {boolean.class,boolean.class};\n\t\t\tConstructor<? extends Layer> con = layerClass.getConstructor(types);\n\t\t\tLayer newl = con.newInstance(false, false);\n\t\t\tnewnn.addLayer(newl);\n\t\t\tnewl.setNumber(newnn.getLayers().size()-1);\n\t\t\tfor (int j = 0; j < morenum || j < lessnum; j++){\n\t\t\t\tNeuron newn = neuronClass.newInstance();\n\t\t\t\tnewl.addNeuron(newn);\n\t\t\t\tnewn.setLayernumber(newl.getNumber());\n\t\t\t\tnewn.setNumber(newl.getNeurons().size()-1);\n\t\t\t}\n\t\t}\n\t\tfor (int i = 1; i <=lesslayers.size(); i++){\n\t\t\tLayer l = lesslayers.get(i-1);\n\t\t\tfor (Neuron n : l.getNeurons()){\n\t\t\t\tn.setLayernumber(i);\n\t\t\t\t\n\t\t\t}\n\t\t\tl.setNumber(i);\n\t\t}\n\t\tfor (int i = 1; i <=morelayers.size(); i++){\n\t\t\tLayer l = lesslayers.get(i-1);\n\t\t\tfor (Neuron n : l.getNeurons()){\n\t\t\t\tn.setLayernumber(i);\n\t\t\t\t\n\t\t\t}\n\t\t\tl.setNumber(i);\t\n\t\t}\n\t\t//adds genes to the structure. if the same conection exists in the more fit network, it gets preference over the less fit network. if one or the other does not have this gene at all it gets added. currently more fit is always selected may add random chance that the less fit networks gene is selected.\n\t\t//gets all the data from the more fit layer.\n\t\tArrayList<double[]> geneIdentities = new ArrayList<double[]>();\n\t\tfor(Layer l : morelayers){\t\t\n\t\t\t\tfor (Neuron n : l.getNeurons()){\n\t\t\t\t\tfor(Gene g : n.getGenes()){\n\t\t\t\t\t\tdouble data[] = new double[5];\n\t\t\t\t\t\tdata[0] = l.getNumber();\n\t\t\t\t\t\tdata[1] = n.getNumber();\n\t\t\t\t\t\tdata[2] = g.getConnection().getNumber();\n\t\t\t\t\t\tif (morelayers.get(g.getConnection().getLayernumber()-1).isOutput()) data[3] = maxlayers;\n\t\t\t\t\t\telse data[3] = g.getConnection().getLayernumber();\n\t\t\t\t\t\tdata[4] = g.getWeight();\n\t\t\t\t\t\tgeneIdentities.add(data);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\t\t}\n\t\t//gets all the gene data from the less fit layer.\n\t\tArrayList<double[]> geneIdentities2 = new ArrayList<double[]>();\n\t\tfor(Layer l : lesslayers){\n\t\t\t\tfor (Neuron n : l.getNeurons()){\n\t\t\t\t\tfor(Gene g : n.getGenes()){\n\t\t\t\t\t\tdouble data[] = new double[5];\n\t\t\t\t\t\tdata[0] = l.getNumber();\n\t\t\t\t\t\tdata[1] = n.getNumber();\n\t\t\t\t\t\tdata[2] = g.getConnection().getNumber();\n\t\t\t\t\t\tif (lesslayers.get(g.getConnection().getLayernumber()-1).isOutput()) data[3] = maxlayers;\n\t\t\t\t\t\telse data[3] = g.getConnection().getLayernumber();\n\t\t\t\t\t\tdata[4] = g.getWeight();\n\t\t\t\t\t\tgeneIdentities2.add(data);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\t}\n\t\t//if two genes connect the same neuron, it averages the weights of them and removes one leaving the other with the average weight\n\t\tfor (double[] nums : geneIdentities){\n\t\t\tfor (int i = 0; i < geneIdentities2.size(); i++){\n\t\t\t\tdouble[] nums2 = geneIdentities2.get(i);\n\t\t\t\tif (nums[0] == nums2[0] && nums[1] == nums2[1] && nums[2] == nums2[2] && nums[3] == nums2[3]){\n\t\t\t\t\tnums[4] = (nums[4] + nums2[4])/2;\n\t\t\t\t\tgeneIdentities2.remove(nums2);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//adds the new genes to the new neural network based on the gene data.\n\t\tfor(double[] nums : geneIdentities){\t\t\n\t\t\tGene newGene = new Gene(newnn.getLayers().get((int) nums[3]-1).getNeurons().get((int) nums[2]-1), nums[4]);\n\t\t\tNeuron newNeuron = newnn.getLayers().get((int) (nums[0]-1)).getNeurons().get((int) nums[1]-1);\n\t\t\tnewNeuron.AddGenes(newGene);\n\t\t\tnewGene.setInput(newNeuron);\t\t\t\n\t\t}\n\t\tfor(double[] nums : geneIdentities2){\t\t\t\n\t\t\tGene newGene = new Gene(newnn.getLayers().get((int) nums[3]-1).getNeurons().get((int) nums[2]-1), nums[4]);\n\t\t\tNeuron newNeuron = newnn.getLayers().get((int) (nums[0]-1)).getNeurons().get((int) nums[1]-1);\n\t\t\tnewNeuron.AddGenes(newGene);\n\t\t\tnewGene.setInput(newNeuron);\n\t\t}\n\t\t//returns mutated bred network\n\t\treturn mutate(newnn,s);\n\t}", "public void test28() {\n //$NON-NLS-1$\n deployBundles(\"test28\");\n IApiBaseline before = getBeforeState();\n IApiBaseline after = getAfterState();\n IApiComponent beforeApiComponent = before.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", beforeApiComponent);\n IApiComponent afterApiComponent = after.getApiComponent(BUNDLE_NAME);\n //$NON-NLS-1$\n assertNotNull(\"no api component\", afterApiComponent);\n IDelta delta = ApiComparator.compare(beforeApiComponent, afterApiComponent, before, after, VisibilityModifiers.ALL_VISIBILITIES, null);\n //$NON-NLS-1$\n assertNotNull(\"No delta\", delta);\n IDelta[] allLeavesDeltas = collectLeaves(delta);\n //$NON-NLS-1$\n assertEquals(\"Wrong size\", 1, allLeavesDeltas.length);\n IDelta child = allLeavesDeltas[0];\n //$NON-NLS-1$\n assertEquals(\"Wrong kind\", IDelta.CHANGED, child.getKind());\n //$NON-NLS-1$\n assertTrue(\"Is visible\", Util.isVisible(child.getNewModifiers()));\n //$NON-NLS-1$\n assertTrue(\"No extend restrictions\", RestrictionModifiers.isExtendRestriction(child.getCurrentRestrictions()));\n //$NON-NLS-1$\n assertEquals(\"Wrong flag\", IDelta.VALUE, child.getFlags());\n //$NON-NLS-1$\n assertEquals(\"Wrong element type\", IDelta.FIELD_ELEMENT_TYPE, child.getElementType());\n //$NON-NLS-1$\n assertTrue(\"Not compatible\", DeltaProcessor.isCompatible(child));\n }", "protected void resetModified()\n {\n m_pool.resetModified();\n\n // reset all other VM sub-structures\n StringTable[] atbl = CONTAINED_TABLE;\n for (int i = 0; i < atbl.length; ++i)\n {\n Enumeration enmr = atbl[i].elements();\n while (enmr.hasMoreElements())\n {\n ((VMStructure) enmr.nextElement()).resetModified();\n }\n }\n\n m_fModified = false;\n }", "private void updPrevRunningConfigUpdates() {\n\t\tList<FilterCondition> cond = new ArrayList<>();\n\t\tList<ConfiguredValuesMO> prevConfigList = null;\n\t\tConfiguredValuesMO prevConfig = null;\n\t\tsetFilterConditions(cond); \n\t\ttry {\n\t\t\tprevConfigList = (List<ConfiguredValuesMO>) genDao.getGenericObjects(ConfiguredValuesMO.class, cond, Boolean.TRUE);\n\t\t} catch (DAOException e) {\n\t\t\tlogger.error(\"Exception while retrieving Config updates for the device.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tprevConfig = prevConfigList.get(0); // Ideally this should give only one item.\n\t\tprevConfig.setStatus(ConfigUpdateStatus.INACTIVE);\n\t\ttry {\n\t\t\tgenDao.saveGenericObject(prevConfig);\n\t\t} catch (DAOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void updateTopNodes() {\n\t\ttopNodes.clear();\n\t\tif (this.diff == null)\n\t\t\treturn;\n\n\t\t// PSets node\n\t\tint psetCount = diff.psetCount();\n\t\tif (psetCount > 0) {\n\t\t\tpsetsNode.delete(0, psetsNode.length());\n\t\t\tpsetsNode.append(\"<html><b>PSets</b> (\").append(psetCount).append(\")</html>\");\n\t\t\ttopNodes.add(psetsNode);\n\t\t\tIterator<Comparison> it = diff.psetIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(psetsNode);\n\t\t}\n\t\t\n\t\t// global EDAlias node\n\t\tint globlaEDAliasCount = diff.globalEDAliasCount();\n\t\tif (globlaEDAliasCount > 0) {\n\t\t\tglobalEDAliasNode.delete(0, globalEDAliasNode.length());\n\t\t\tglobalEDAliasNode.append(\"<html><b>Global EDAliases</b> (\").append(globlaEDAliasCount).append(\")</html>\");\n\t\t\ttopNodes.add(globalEDAliasNode);\n\t\t\tIterator<Comparison> it = diff.globalEDAliasIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(globalEDAliasNode);\n\t\t}\n\n\t\t// EDSources node\n\t\tint edsourceCount = diff.edsourceCount();\n\t\tif (edsourceCount > 0) {\n\t\t\tedsourcesNode.delete(0, edsourcesNode.length());\n\t\t\tedsourcesNode.append(\"<html><b>EDSource</b> (\").append(edsourceCount).append(\")</html>\");\n\t\t\ttopNodes.add(edsourcesNode);\n\t\t\tIterator<Comparison> it = diff.edsourceIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(edsourcesNode);\n\t\t}\n\n\t\t// ESSource node\n\t\tint essourceCount = diff.essourceCount();\n\t\tif (essourceCount > 0) {\n\t\t\tessourcesNode.delete(0, essourcesNode.length());\n\t\t\tessourcesNode.append(\"<html><b>ESSources</b> (\").append(essourceCount).append(\")</html>\");\n\t\t\ttopNodes.add(essourcesNode);\n\t\t\tIterator<Comparison> it = diff.essourceIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(essourcesNode);\n\t\t}\n\n\t\t// ESModule node\n\t\tint esmoduleCount = diff.esmoduleCount();\n\t\tif (esmoduleCount > 0) {\n\t\t\tesmodulesNode.delete(0, esmodulesNode.length());\n\t\t\tesmodulesNode.append(\"<html><b>ESModules</b> (\").append(esmoduleCount).append(\")</html>\");\n\t\t\ttopNodes.add(esmodulesNode);\n\t\t\tIterator<Comparison> it = diff.esmoduleIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(esmodulesNode);\n\t\t}\n\n\t\t// Service node\n\t\tint serviceCount = diff.serviceCount();\n\t\tif (serviceCount > 0) {\n\t\t\tservicesNode.delete(0, servicesNode.length());\n\t\t\tservicesNode.append(\"<html><b>Services</b> (\").append(serviceCount).append(\")</html>\");\n\t\t\ttopNodes.add(servicesNode);\n\t\t\tIterator<Comparison> it = diff.serviceIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(servicesNode);\n\t\t}\n\n\t\t// Paths node\n\t\tint pathCount = diff.pathCount();\n\t\tif (pathCount > 0) {\n\t\t\tpathsNode.delete(0, pathsNode.length());\n\t\t\tpathsNode.append(\"<html><b>Paths</b> (\").append(pathCount).append(\")</html>\");\n\t\t\ttopNodes.add(pathsNode);\n\t\t\tIterator<Comparison> it = diff.pathIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(pathsNode);\n\t\t}\n\n\t\t// Sequences node\n\t\tint sequenceCount = diff.sequenceCount();\n\t\tif (sequenceCount > 0) {\n\t\t\tsequencesNode.delete(0, sequencesNode.length());\n\t\t\tsequencesNode.append(\"<html><b>Sequences</b> (\").append(sequenceCount).append(\")</html>\");\n\t\t\ttopNodes.add(sequencesNode);\n\t\t\tIterator<Comparison> it = diff.sequenceIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(sequencesNode);\n\t\t}\n\n\t\t// Tasks node\n\t\tint taskCount = diff.taskCount();\n\t\tif (taskCount > 0) {\n\t\t\ttasksNode.delete(0, tasksNode.length());\n\t\t\ttasksNode.append(\"<html><b>Tasks</b> (\").append(taskCount).append(\")</html>\");\n\t\t\ttopNodes.add(tasksNode);\n\t\t\tIterator<Comparison> it = diff.taskIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(tasksNode);\n\t\t}\n\t\t\n\t\t// SwitchProducers node\n\t\tint switchProducerCount = diff.switchProducerCount();\n\t\tif (switchProducerCount > 0) {\n\t\t\tswitchProducersNode.delete(0, switchProducersNode.length());\n\t\t\tswitchProducersNode.append(\"<html><b>SwitchProducers</b> (\").append(switchProducerCount).append(\")</html>\");\n\t\t\ttopNodes.add(switchProducersNode);\n\t\t\tIterator<Comparison> it = diff.switchProducerIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(switchProducersNode);\n\t\t}\n\n\t\t// Module node\n\t\tint moduleCount = diff.moduleCount();\n\t\tif (moduleCount > 0) {\n\t\t\tmodulesNode.delete(0, modulesNode.length());\n\t\t\tmodulesNode.append(\"<html><b>Modules</b> (\").append(moduleCount).append(\")</html>\");\n\t\t\ttopNodes.add(modulesNode);\n\t\t\tIterator<Comparison> it = diff.moduleIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(modulesNode);\n\t\t}\n\t\t\n\t\t// EDAlias node\n\t\tint edAliasCount = diff.edAliasCount();\n\t\tif (edAliasCount > 0) {\n\t\t\tedAliasNode.delete(0, edAliasNode.length());\n\t\t\tedAliasNode.append(\"<html><b>EDAliases</b> (\").append(edAliasCount).append(\")</html>\");\n\t\t\ttopNodes.add(edAliasNode);\n\t\t\tIterator<Comparison> it = diff.edAliasIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(edAliasNode);\n\t\t}\n\n\t\t// OutputModule node\n\t\tint outputCount = diff.outputCount();\n\t\tif (outputCount > 0) {\n\t\t\toutputsNode.delete(0, outputsNode.length());\n\t\t\toutputsNode.append(\"<html><b>OutputModules</b> (\").append(outputCount).append(\")</html>\");\n\t\t\ttopNodes.add(outputsNode);\n\t\t\tIterator<Comparison> it = diff.outputIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(outputsNode);\n\t\t}\n\n\t\t// EventContent node\n\t\tint contentCount = diff.contentCount();\n\t\tif (contentCount > 0) {\n\t\t\tcontentsNode.delete(0, contentsNode.length());\n\t\t\tcontentsNode.append(\"<html><b>EventContents</b> (\").append(contentCount).append(\")</html>\");\n\t\t\ttopNodes.add(contentsNode);\n\t\t\tIterator<Comparison> it = diff.contentIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(contentsNode);\n\t\t}\n\n\t\t// Stream node\n\t\tint streamCount = diff.streamCount();\n\t\tif (streamCount > 0) {\n\t\t\tstreamsNode.delete(0, streamsNode.length());\n\t\t\tstreamsNode.append(\"<html><b>Streams</b> (\").append(streamCount).append(\")</html>\");\n\t\t\ttopNodes.add(streamsNode);\n\t\t\tIterator<Comparison> it = diff.streamIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(streamsNode);\n\t\t}\n\n\t\t// Dataset node\n\t\tint datasetCount = diff.datasetCount();\n\t\tif (datasetCount > 0) {\n\t\t\tdatasetsNode.delete(0, datasetsNode.length());\n\t\t\tdatasetsNode.append(\"<html><b>Datasets</b> (\").append(datasetCount).append(\")</html>\");\n\t\t\ttopNodes.add(datasetsNode);\n\t\t\tIterator<Comparison> it = diff.datasetIterator();\n\t\t\twhile (it.hasNext())\n\t\t\t\tit.next().setParent(datasetsNode);\n\t\t}\n\t}", "private void initialize() {\n buttonPanel1.addButton(\"Apply step and close\");\n buttonPanel1.setButtonIcon(\"Apply step and close\",new javax.swing.ImageIcon(getClass().getResource(\"/nl/astron/lofar/sas/otb/icons/16_apply.png\")));\n buttonPanel1.addButton(\"Close\");\n buttonPanel1.setButtonIcon(\"Close\",new javax.swing.ImageIcon(getClass().getResource(\"/nl/astron/lofar/sas/otb/icons/16_exit2.png\")));\n if(itsBBSStep == null){\n stepExplorerStepNameText.setEditable(true);\n }\n this.stepExplorerNSourcesList.setModel(new DefaultListModel());\n this.stepExplorerInstrumentModelList.setModel(new DefaultListModel());\n// this.stepExplorerESourcesList.setModel(new DefaultListModel());\n \n //fill the supported step operation panels\n stepOperationPanels.put(\"Predict\",null);\n stepOperationPanels.put(\"Solve\",\"nl.astron.lofar.sas.otbcomponents.bbs.stepmanagement.operations.BBSStepOperationPanelSolveImpl\");\n stepOperationPanels.put(\"Subtract\",null);\n stepOperationPanels.put(\"Correct\",null);\n \n // Fill the comboboxes (will need to be done from Database later)\n stepExplorerModifyNSourceCombobox.removeAllItems();\n stepExplorerModifyNSourceCombobox.addItem(\"CygA\");\n stepExplorerModifyNSourceCombobox.addItem(\"CasA\");\n stepExplorerModifyNSourceCombobox.addItem(\"TauA\");\n stepExplorerModifyNSourceCombobox.addItem(\"VirA\");\n stepExplorerModifyNSourceCombobox.addItem(\"HerA\");\n stepExplorerModifyNSourceCombobox.addItem(\"PerA\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C123\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C134\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C157\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C196\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C219\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C295\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C343\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C343.1\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C353\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C363.1\");\n stepExplorerModifyNSourceCombobox.addItem(\"3C400\");\n \n stepExplorerModifyInstrumentModelCombobox.removeAllItems();\n stepExplorerModifyInstrumentModelCombobox.addItem(\"TOTALGAIN\");\n stepExplorerModifyInstrumentModelCombobox.addItem(\"PATCHGAIN\");\n stepExplorerModifyInstrumentModelCombobox.addItem(\"BANDPASS\");\n }", "@Override\n protected void postProcessMeta(MetaRegion m, HRegionInterface server)\n throws IOException {\n Set<HRegionInfo> regionsToReopen = new HashSet<HRegionInfo>();\n for (HRegionInfo i: regionsToProcess) {\n // All we need to do to change the schema is modify the table descriptor.\n // When the region is brought on-line, it will find the changes and\n // update itself accordingly.\n updateTableDescriptor(i.getTableDesc());\n updateRegionInfo(server, m.getRegionName(), i);\n // TODO: queue this to occur after reopening region\n postProcess(i);\n // Ignore regions that are split or disabled,\n // as we do not want to reopen them\n if (!(i.isSplit() || i.isOffline())) {\n regionsToReopen.add(i);\n }\n }\n if (regionsToReopen.size() > 0) {\n this.master.getRegionManager().getThrottledReopener(\n Bytes.toString(tableName)).addRegionsToReopen(regionsToReopen);\n }\n }", "private void updateMI(Instance inst) throws Exception {\n\n if(m_NumFoldersMI < 1){\n throw new Exception(\"NNge.updateMI : incorrect number of folders ! Option I must be greater than 1.\");\n }\n\n m_MI_NumClass[(int) inst.classValue()]++;\n m_MI_NumInst++;\n\n /* for each attribute */\n for(int attrIndex = 0; attrIndex < m_Train.numAttributes(); attrIndex++){\n\n /* which is the class attribute */\n if(m_Train.classIndex() == attrIndex)\n\tcontinue;\n\n /* which is a numeric attribute */\n else if(m_Train.attribute(attrIndex).isNumeric()){\n\t\t\n\t/* if max-min have to be updated */\n\tif(Double.isNaN(m_MI_MaxArray[attrIndex]) ||\n\t Double.isNaN(m_MI_MinArray[attrIndex]) ||\n\t m_MI_MaxArray[attrIndex] < inst.value(attrIndex) || \n\t inst.value(attrIndex) < m_MI_MinArray[attrIndex]){\n\n\t /* then update them */\n\t if(Double.isNaN(m_MI_MaxArray[attrIndex])) m_MI_MaxArray[attrIndex] = inst.value(attrIndex);\n\t if(Double.isNaN(m_MI_MinArray[attrIndex])) m_MI_MinArray[attrIndex] = inst.value(attrIndex);\n\t if(m_MI_MaxArray[attrIndex] < inst.value(attrIndex)) m_MI_MaxArray[attrIndex] = inst.value(attrIndex);\n\t if(m_MI_MinArray[attrIndex] > inst.value(attrIndex)) m_MI_MinArray[attrIndex] = inst.value(attrIndex);\n\t\t \n\t /* and re-compute everything from scratch... (just for this attribute) */\n\t double delta = (m_MI_MaxArray[attrIndex] - m_MI_MinArray[attrIndex]) / (double) m_NumFoldersMI;\n\n\t /* for each interval */\n\t for(int inter = 0; inter < m_NumFoldersMI; inter++){\n\n\t m_MI_NumAttrInter[attrIndex][inter] = 0;\n\n\t /* for each class */\n\t for(int cclass = 0; cclass < m_Train.numClasses(); cclass++){\n\t\t\t \n\t m_MI_NumAttrClassInter[attrIndex][cclass][inter] = 0;\n\n\t /* count */\n\t Enumeration enu = m_Train.enumerateInstances();\n\t while(enu.hasMoreElements()){\n\t\tInstance cur = (Instance) enu.nextElement();\n\t\tif(( (m_MI_MinArray[attrIndex] + inter * delta) <= cur.value(attrIndex) ) &&\n\t\t ( cur.value(attrIndex) <= (m_MI_MinArray[attrIndex] + (inter + 1) * delta) ) &&\n\t\t ( cur.classValue() == cclass ) ){\n\t\t m_MI_NumAttrInter[attrIndex][inter]++;\n\t\t m_MI_NumAttrClassInter[attrIndex][cclass][inter]++;\n\t\t}\n\t }\n\t }\n\t }\n\t\t\n\t /* max-min don't have to be updated */\n\t} else {\n\n\t /* still have to incr the card of the correct interval */\n\t double delta = (m_MI_MaxArray[attrIndex] - m_MI_MinArray[attrIndex]) / (double) m_NumFoldersMI;\n\t\t \n\t /* for each interval */\n\t for(int inter = 0; inter < m_NumFoldersMI; inter++){\n\t /* which contains inst*/\n\t if(( (m_MI_MinArray[attrIndex] + inter * delta) <= inst.value(attrIndex) ) &&\n\t ( inst.value(attrIndex) <= (m_MI_MinArray[attrIndex] + (inter + 1) * delta) )){\n\t m_MI_NumAttrInter[attrIndex][inter]++;\n\t m_MI_NumAttrClassInter[attrIndex][(int) inst.classValue()][inter]++;\n\t }\n\t }\n\t}\n\t\t\n\t/* update the mutual information of this attribute... */\n\tm_MI[attrIndex] = 0;\n\t\t\n\t/* for each interval, for each class */\n\tfor(int inter = 0; inter < m_NumFoldersMI; inter++){\n\t for(int cclass = 0; cclass < m_Train.numClasses(); cclass++){\n\t double pXY = ((double) m_MI_NumAttrClassInter[attrIndex][cclass][inter]) / ((double) m_MI_NumInst);\n\t double pX = ((double) m_MI_NumClass[cclass]) / ((double) m_MI_NumInst);\n\t double pY = ((double) m_MI_NumAttrInter[attrIndex][inter]) / ((double) m_MI_NumInst);\n\n\t if(pXY != 0)\n\t m_MI[attrIndex] += pXY * Utils.log2(pXY / (pX * pY));\n\t }\n\t}\n\t\t\n\t/* which is a nominal attribute */\n } else if (m_Train.attribute(attrIndex).isNominal()){\n\t\t\n\t/*incr the card of the correct 'values' */\n\tm_MI_NumAttrValue[attrIndex][(int) inst.value(attrIndex)]++;\n\tm_MI_NumAttrClassValue[attrIndex][(int) inst.classValue()][(int) inst.value(attrIndex)]++;\n\t\t\n\t/* update the mutual information of this attribute... */\n\tm_MI[attrIndex] = 0;\n\t\t\n\t/* for each nominal value, for each class */\n\tfor(int attrValue = 0; attrValue < m_Train.attribute(attrIndex).numValues() + 1; attrValue++){\n\t for(int cclass = 0; cclass < m_Train.numClasses(); cclass++){\n\t double pXY = ((double) m_MI_NumAttrClassValue[attrIndex][cclass][attrValue]) / ((double) m_MI_NumInst);\n\t double pX = ((double) m_MI_NumClass[cclass]) / ((double) m_MI_NumInst);\n\t double pY = ((double) m_MI_NumAttrValue[attrIndex][attrValue]) / ((double) m_MI_NumInst);\n\t if(pXY != 0)\n\t m_MI[attrIndex] += pXY * Utils.log2(pXY / (pX * pY));\n\t }\n\t}\n\n\t/* not a nominal attribute, not a numeric attribute */\n } else {\n\tthrow new Exception(\"NNge.updateMI : Cannot deal with 'string attribute'.\");\n }\n }\t\n }", "private void updateAccPoolState() {\n List<AionAddress> clearAddr = new ArrayList<>();\n for (Entry<AionAddress, AccountState> e : this.accountView.entrySet()) {\n AccountState as = e.getValue();\n if (as.isDirty()) {\n\n if (as.getMap().isEmpty()) {\n this.poolStateView.remove(e.getKey());\n clearAddr.add(e.getKey());\n } else {\n // checking AccountState given by account\n List<PoolState> psl = this.poolStateView.get(e.getKey());\n if (psl == null) {\n psl = new LinkedList<>();\n }\n\n List<PoolState> newPoolState = new LinkedList<>();\n // Checking new tx has been include into old pools.\n BigInteger txNonceStart = as.getFirstNonce();\n\n if (txNonceStart != null) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState fn [{}]\",\n txNonceStart.toString());\n }\n for (PoolState ps : psl) {\n // check the previous txn status in the old\n // PoolState\n if (isClean(ps, as)\n && ps.firstNonce.equals(txNonceStart)\n && ps.combo == seqTxCountMax) {\n ps.resetInFeePool();\n newPoolState.add(ps);\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState add fn [{}]\",\n ps.firstNonce.toString());\n }\n\n txNonceStart = txNonceStart.add(BigInteger.valueOf(seqTxCountMax));\n } else {\n // remove old poolState in the feeMap\n if (this.feeView.get(ps.getFee()) != null) {\n\n if (e.getValue().getMap().get(ps.firstNonce) != null) {\n this.feeView\n .get(ps.getFee())\n .remove(\n e.getValue()\n .getMap()\n .get(ps.firstNonce)\n .getKey());\n }\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState remove fn [{}]\",\n ps.firstNonce.toString());\n }\n\n if (this.feeView.get(ps.getFee()).isEmpty()) {\n this.feeView.remove(ps.getFee());\n }\n }\n }\n }\n }\n\n int cnt = 0;\n BigInteger fee = BigInteger.ZERO;\n BigInteger totalFee = BigInteger.ZERO;\n\n for (Entry<BigInteger, SimpleEntry<ByteArrayWrapper, BigInteger>> en :\n as.getMap().entrySet()) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState mapsize[{}] nonce:[{}] cnt[{}] txNonceStart[{}]\",\n as.getMap().size(),\n en.getKey().toString(),\n cnt,\n txNonceStart != null ? txNonceStart.toString() : null);\n }\n if (en.getKey()\n .equals(\n txNonceStart != null\n ? txNonceStart.add(BigInteger.valueOf(cnt))\n : null)) {\n if (en.getValue().getValue().compareTo(fee) > -1) {\n fee = en.getValue().getValue();\n totalFee = totalFee.add(fee);\n\n if (++cnt == seqTxCountMax) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case1 - nonce:[{}] totalFee:[{}] cnt:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt);\n }\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n\n txNonceStart = en.getKey().add(BigInteger.ONE);\n totalFee = BigInteger.ZERO;\n fee = BigInteger.ZERO;\n cnt = 0;\n }\n } else {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case2 - nonce:[{}] totalFee:[{}] cnt:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt);\n }\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n\n // next PoolState\n txNonceStart = en.getKey();\n fee = en.getValue().getValue();\n totalFee = fee;\n cnt = 1;\n }\n }\n }\n\n if (totalFee.signum() == 1) {\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState case3 - nonce:[{}] totalFee:[{}] cnt:[{}] bw:[{}]\",\n txNonceStart,\n totalFee.toString(),\n cnt,\n e.getKey().toString());\n }\n\n newPoolState.add(\n new PoolState(\n txNonceStart,\n totalFee.divide(BigInteger.valueOf(cnt)),\n cnt));\n }\n\n this.poolStateView.put(e.getKey(), newPoolState);\n\n if (LOG.isTraceEnabled()) {\n this.poolStateView.forEach(\n (k, v) ->\n v.forEach(\n l -> {\n LOG.trace(\n \"AbstractTxPool.updateAccPoolState - the first nonce of the poolState list:[{}]\",\n l.firstNonce);\n }));\n }\n as.sorted();\n }\n }\n }\n\n if (!clearAddr.isEmpty()) {\n clearAddr.forEach(\n addr -> {\n lock.writeLock().lock();\n this.accountView.remove(addr);\n lock.writeLock().unlock();\n this.bestNonce.remove(addr);\n });\n }\n }", "ImagePlus doStackOperation(ImagePlus img1, ImagePlus img2) {\n ImagePlus img3 = null;\n int size1 = img1.getStackSize();\n int size2 = img2.getStackSize();\n if (size1 > 1 && size2 > 1 && size1 != size2) {\n IJ.error(\"Image Calculator\", \"'Image1' and 'image2' must be stacks with the same\\nnumber of slices, or 'image2' must be a single image.\");\n return null;\n }\n if (createWindow) {\n img1 = duplicateStack(img1);\n if (img1 == null) {\n IJ.error(\"Calculator\", \"Out of memory\");\n return null;\n }\n img3 = img1;\n }\n int mode = getBlitterMode();\n ImageWindow win = img1.getWindow();\n if (win != null)\n WindowManager.setCurrentWindow(win);\n else if (Interpreter.isBatchMode() && !createWindow && WindowManager.getImage(img1.getID()) != null)\n IJ.selectWindow(img1.getID());\n Undo.reset();\n ImageStack stack1 = img1.getStack();\n StackProcessor sp = new StackProcessor(stack1, img1.getProcessor());\n try {\n if (size2 == 1)\n sp.copyBits(img2.getProcessor(), 0, 0, mode);\n else\n sp.copyBits(img2.getStack(), 0, 0, mode);\n } catch (IllegalArgumentException e) {\n IJ.error(\"\\\"\" + img1.getTitle() + \"\\\": \" + e.getMessage());\n return null;\n }\n img1.setStack(null, stack1);\n if (img1.getType() != ImagePlus.GRAY8) {\n img1.getProcessor().resetMinAndMax();\n }\n if (img3 == null)\n img1.updateAndDraw();\n return img3;\n }", "private static void applySelection(Fold origFold, Fold normFold, String expId, ParametersManager params,\n double selectionLevel) throws IOException {\n int numInst = normFold.getNumInst();\n int numInstRemoved = (int) Math.round(selectionLevel / 100 * numInst);\n int numInstKept = numInst - numInstRemoved;\n\n Instance[] instKept = new Instance[numInstKept];\n\n int index = 0;\n for (int i = 0; i < numInst; i++) {\n Instance currInst = normFold.getInst(i);\n\n if (currInst.getRank() <= numInstKept) {\n instKept[index] = origFold.getInst(i);\n index++;\n }\n }\n\n System.out.println(\" Number of instances kept: \" + numInstKept);\n System.out.println(\" Number of instances removed: \" + numInstRemoved);\n System.out.println(\" Total number of instances: \" + numInst + \"\\n\");\n\n assert index + numInstRemoved == numInst : \"The index at the end of the for loop responsible for selecting\" +\n \" instances (\" + index + \") should be the same as the number of instances that should be kept (\" +\n numInstKept + \").\";\n\n OutputHandler.writeInstances(instKept, expId, params, origFold.getFoldId(), selectionLevel);\n }", "@Override\n\tpublic void restoreState() {\n // Rather than copying the stored stuff back, just swap the pointers...\n int[] tmp1 = currentMatricesIndices;\n currentMatricesIndices = storedMatricesIndices;\n storedMatricesIndices = tmp1;\n\n int[] tmp2 = currentPartialsIndices;\n currentPartialsIndices = storedPartialsIndices;\n storedPartialsIndices = tmp2;\n\n\n }", "final boolean init_stacks()\n {\n stateptr = -1;\n val_init();\n return true;\n }", "void saveNewTargetsForLater() {\n while (!newFutureTargets.isEmpty()) {tempStack.push(newFutureTargets.pop());}\n while (!tempStack.isEmpty()) {laterFutureTargets.push(tempStack.pop());}\n }", "private void updatingOptionalFeature(ArrayList<String>\tOnlyInLeft, ArrayList<String>\tOnlyInRight, Model splModel, Model newModel){\r\n//STEP 1 ---------------------------------------------------------------------------------------------\r\n\t\t//Feature optionalFeature = null;\t\t\r\n\t\t//New 02/12/201/\r\n\t\tFeature newModelOptionalFeature = null;\r\n\t\tFeature newVariant = null;\r\n\t\tConstraint constraint = null;\r\n\t\tnewVariant = new Feature(newModel.getId()+\"_Variant\", \"variant\", this.alternativeFeatureGroup.get(0).getId());\r\n\t\tthis.addVariant(newVariant);\r\n\t\t//-New 02/12/201/\r\n\t\t\r\n\t\tif(OnlyInLeft.size()==0){\r\n\t\t}else{\r\n\t\t\tnewModelOptionalFeature= new Feature(\"f\"+(this.optionalFeatures.size()+1) , \"optional\", this.getBase().getName(), OnlyInLeft);\r\n\t\t\tthis.optionalFeatures.add(newModelOptionalFeature);\r\n\t\t\t\r\n\t\t\t//New 02/12/201/\r\n\t\t\tfor(int i = 0; i < this.getVariants().getFeatures().size();i++){\r\n\t\t\t\tFeature variant = this.getVariants().getFeatures().get(i);\r\n\t\t\t\tif(variant==newVariant){\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconstraint = new Constraint(variant.getName(), \"\\u00AC\"+newModelOptionalFeature.getName());\r\n\t\t\t\t\t//addConstraint(constraint);\r\n\t\t\t\t}//if(variant==newVariant){\r\n\t\t\t\t\r\n\t\t\t}//for(int i = 0; i <this.getVariants().getFeatures().size();i++){\t\r\n\t\t\t//-New 02/12/201/\r\n\t\t\tconstraint = new Constraint(newVariant.getName(), newModelOptionalFeature.getName());\r\n\t\t\t//this.constraints.add(constraint);\r\n\t\t\taddConstraint(constraint);\r\n\t\t\t\r\n\t\t\t//System.out.println(\" *** \"+this.constraints.size());\r\n\t\t\t//System.out.println(\" ... \"+constraint.toString());\r\n\t\t\t\r\n\t\t}//if(OnlyInLeft.size()==0){\r\n\r\n//STEP 2 ---------------------------------------------------------------------------------------------\r\n\t\t\r\n\t\tFeature optionalFeature = null;\r\n\t\t\r\n\t\tArrayList<String> elts = MyString.intersection(OnlyInRight, this.getBase().getElements());\r\n\t\tif(elts.size()==0){\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tthis.getBase().setElements(MyString.minus(this.getBase().getElements(), elts));\r\n\t\t\toptionalFeature= new Feature(\"f\"+(this.optionalFeatures.size()+1) , \"optional\", this.getBase().getName(), elts);\r\n\t\t\tthis.optionalFeatures.add(optionalFeature);\r\n\t\t\t\r\n\t\t\t//OnlyInRight = MyString.minus(OnlyInRight, elts);\r\n\t\t\t\r\n\t\t\t//New 03/12/2018\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < this.getVariants().getFeatures().size();i++){\r\n\t\t\t\tFeature variant = this.getVariants().getFeatures().get(i);\r\n\t\t\t\tif(variant==newVariant){\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconstraint = new Constraint(variant.getName(), optionalFeature.getName());\r\n\t\t\t\t\t//this.constraints.add(constraint);\r\n\t\t\t\t\taddConstraint(constraint);\r\n\t\t\t\t}//if(variant==newVariant){\r\n\t\t\t}//for(int i = 0; i <this.getVariants().getFeatures().size();i++){\r\n\t\t\t\r\n\t\t\tconstraint = new Constraint(newVariant.getName(), \"\\u00AC\" + optionalFeature.getName());\r\n\t\t\t//this.constraints.add(constraint);\r\n\t\t\t//addConstraint(constraint);\r\n\t\t\t//-New 03/12/2018\r\n\t\t\t\r\n\t\t\t//New 03/12/2018\r\n\t\t\t//update parent feature of feature groups\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor(int i = 1; i < this.getAlternativeFeatureGroup().size(); i++){\r\n\t\t\t\tFeatureGroup fg = this.getAlternativeFeatureGroup().get(i);\r\n\t\t\t\t\r\n\t\t\t\tif(fg.getParent().equals(this.getBase().getName())){\r\n\t\t\t\t\t\r\n\t\t\t\t\tString elt = fg.getFeatures().get(0).getElements().get(0); \r\n\t\t\t\t\tString parentElt = splModel.getParent(splModel.getElement(elt)).getId();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(optionalFeature.contains(parentElt)){\r\n\t\t\t\t\t\t//System.out.println(\"%%%%%%%%%%%%% + \"+parentElt);\r\n\t\t\t\t\t\tfg.setParent(optionalFeature.getName());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}//for(int i = 1; i < this.getAlternativeFeatureGroup().size(); i++){\r\n\t\t\t\r\n\t\t\t//-New 03/12/2018\r\n\t\t}//if(elts.size()==0){\r\n\t\t\r\n//STEP 3 ---------------------------------------------------------------------------------------------\r\n\r\n\t\t\r\n\t\tint i = 0;\r\n\t\twhile( i<this.optionalFeatures.size()){ //New 03/12/02018\r\n\t\t\tFeature f = this.optionalFeatures.get(i);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(f==newModelOptionalFeature){\r\n\t\t\t}else{\r\n\t\t\t\telts = f.getElements();\r\n\t\t\t\tArrayList<String> elts1 = MyString.intersection(OnlyInRight, elts);\r\n\t\t\t\tif(elts1.size()==0 ){\r\n\t\t\t\t\t//SUP\r\n\t\t\t\t\t//New 03/12/02018\r\n\t\t\t\t\tconstraint = new Constraint(newVariant.getName(), f.getName());\r\n\t\t\t\t\t//this.constraints.add(constraint);\r\n\t\t\t\t\taddConstraint(constraint);\r\n\t\t\t\t\t//-New 03/12/02018\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif( MyString.contains(OnlyInRight, elts) ){\r\n\t\t\t\t\t\t//New 03/12/02018\r\n\t\t\t\t\t\t//OnlyInRight = MyString.minus(OnlyInRight, elts); \r\n\t\t\t\t\t\tconstraint = new Constraint(newVariant.getName(), \"\\u00AC\"+f.getName());\r\n\t\t\t\t\t\t//addConstraint(constraint);\r\n\t\t\t\t\t\t//-New 03/12/02018\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\toptionalFeature= new Feature(\"f\"+(this.optionalFeatures.size()+1) , \"optional\", this.getBase().getName(), elts1);\r\n\t\t\t\t\t\tthis.optionalFeatures.add(optionalFeature);\r\n\t\t\t\t\t\tf.setElements(MyString.minus(elts, elts1));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//OnlyInRight = MyString.minus(OnlyInRight, elts1);\r\n\r\n\t\t\t\t\t\t//New 09-01-2019\r\n\t\t\t\t\t\t//OnlyInRight = elts; \r\n\t\t\t\t\t\t//--------New 09-01-2019\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(int j = 0; j < this.getVariants().getFeatures().size(); j++){\r\n\t\t\t\t\t\t\tFeature variant = this.getVariants().getFeatures().get(j);\r\n\t\t\t\t\t\t\tif(variant==newVariant){\r\n\t\t\t\t\t\t\t}else{ \r\n\t\t\t\t\t\t\t\tif(Constraint.contains(this.constraints, variant.getName(), f.getName(), \"implies\") ){\r\n\t\t\t\t\t\t\t\t\tconstraint = new Constraint(variant.getName(), optionalFeature.getName());\r\n\t\t\t\t\t\t\t\t\t//this.constraints.add(constraint);\r\n\t\t\t\t\t\t\t\t\taddConstraint(constraint);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}//if(variant==newVariant){\r\n\t\t\t\t\t\t}//for(int j = 0; j < this.getVariants().getFeatures().size(); j++){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tconstraint = new Constraint(newVariant.getName(), \"\\u00AC\"+optionalFeature.getName());\r\n\t\t\t\t\t\t\t//this.constraints.add(constraint);\r\n\t\t\t\t\t\t\t//addConstraint(constraint);\r\n\t\t\t\t\t\t\tconstraint = new Constraint(newVariant.getName(), f.getName());\r\n\t\t\t\t\t\t\t//this.constraints.add(constraint);\r\n\t\t\t\t\t\t\taddConstraint(constraint);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//-New 03/12/02018\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//New 03/12/2018\r\n\t\t\t\t\t\t\t//update parent feature of feature groups\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tfor(int j = 1; j < this.getAlternativeFeatureGroup().size(); j++){\r\n\t\t\t\t\t\t\t\tFeatureGroup fg = this.getAlternativeFeatureGroup().get(j);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(fg.getParent().equals(f.getName())){\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tString elt = fg.getFeatures().get(0).getElements().get(0); \r\n\t\t\t\t\t\t\t\t\tString parentElt = splModel.getParent(splModel.getElement(elt)).getId();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(optionalFeature.contains(parentElt)){\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tfg.setParent(optionalFeature.getName());\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}//for(int i = 1; i < this.getAlternativeFeatureGroup().size(); i++){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//-New 03/12/2018\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//if( MyString.contains(OnlyInRight, f.getElements()) ){\r\n\t\t\t\t}//if( elts1.size()==0 ){\r\n\t\t\t\r\n\t\t\t}//if(f==newModelOptionalFeature){ New 03/12/02018\r\n\t\t\ti++;\r\n\t\t}//while(){\r\n\t\t\r\n\t\r\n\t\t\r\n\t\tthis.updatingAlternativeFeatures(splModel, newModelOptionalFeature, newVariant, OnlyInRight, newModel);\r\n\t}", "@Override\n\t\t\tpublic void onChildRemoved(DataSnapshot dataSnapshot) {\n\t\t\t\tString modelName = dataSnapshot.getName();\n\t\t\t\tT oldModel = modelNamesMapping.get(modelName);\n\t\t\t\tmodels.remove(oldModel);\n\t\t\t\tmodelNames.remove(modelName);\n\t\t\t\tmodelNamesMapping.remove(modelName);\n\n\t\t\t\tif(filterApplied){\n\t\t\t\t\tif(!(index_begin<=index_end&&index_end<models.size()&&index_begin>=0)){\n\t\t\t\t\t\tindex_begin=findBeginIndex();\n\t\t\t\t\t\tindex_end=findEndIndex();\n\t\t\t\t\t} else{\n\t\t\t\t\t\tint currentDate=Integer.parseInt(modelName.substring(0,8));\n\t\t\t\t\t\tif(currentDate>=date_begin&&currentDate<=date_end)//within the filter range\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindex_end--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(currentDate<date_begin)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tindex_begin--;\n\t\t\t\t\t\t\tindex_end--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {;}//do nothing\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnotifyDataSetChanged();\n\t\t\t}", "public void trainOnInstance(Instance inst) {\n\t\t\t\t\t\t\n\t\t\ttry{\t\t\t\t\n\t\t\t\tinstancesSeen++;\n\t\t\t\tupdateStats(inst);\n\t\t\t\t\n\t\t\t\tDoubleVector normaliezedExtendedInstance = PrepareExtendedFeatureVector(inst) ;\n\t\t\t\tdouble normaliezedTargetValue= NormalizeTarget(inst) ;\n\t\t\t\tResultSummary resultSummary = getMemberships (normaliezedExtendedInstance,normaliezedTargetValue) ;\n\t\t\t\t\n\t\t\t\tdouble error = resultSummary.getNormaliezedTargetValue() - resultSummary.getFinalPrediction() ;\n\t\t\t\tthis.CurModSSE += Math.pow(error, 2) ;\n\t\t\t\t\n\t\t\t\t// checking a possible drift\n//\t\t\t\tboolean drift =checkChangeDetection() ;\n//\t\t\t\tif (drift)\n//\t\t\t\t\tthis.countChangeDetected++ ;\n\t\t\t\tboolean drift = false ;\n\t\t\t\tif ((this.instancesSeen % graceperiod)==0){\n\t\t\t\t\tdrift =checkChangeDetection() ;\n\t\t\t\t\tif (drift){\n\t\t\t\t\t\tthis.countChangeDetected++ ;\n//\t\t\t\t\t\tthis.clearAllStats();\n\t\t\t\t\t\tthis.currentValidCandidates.clear() ;\n\t\t\t\t\t\tthis.currentNonReadyCandidates.clear() ;\n\t\t\t\t\t\tcurrentSystemVersion++ ;\n\t\t\t\t\t\tSystem.out.println(\"########After a drift################\");\n\t\t\t\t\t\tSystem.out.println(this);\n\t\t\t\t\t\tSystem.out.println(\"########################\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n// \t\tVarianceRationREduction\n\t\t\t\tif (learningCriteriaOption.getChosenIndex()==1) {\n\t\t\t\t\t// checking a possible extension\n//\t\t\t\t\tif (this.instancesSeen > graceperiod && !drift ) {\n\t\t\t\t\tif (!drift ) {\n\t\t\t\t\t\tboolean systemChanged = false ;\n\t\t\t\t\t\tVector <RuleVR> removeRules= new Vector<RuleVR>() ;\n\t\t\t\t\t\tVector <RuleVR> newRules= new Vector<RuleVR>() ;\n\t\t\t\t\t\tfor (FuzzyRule rule : rs){\n\t\t\t\t\t\t\tVector <RuleVR> expansions = ((RuleVR)rule).tryToExpand(confidence, tau) ;\n\t\t\t\t\t\t\tif (expansions != null) {\n\t\t\t\t\t\t\t\tsystemChanged = true ;\n\t\t\t\t\t\t\t\tif (chooseSingleRuleOption.isSet()) {\n\t\t\t\t\t\t\t\t\tif (expansions.get(0).getInitialMerit() > expansions.get(1).getInitialMerit()) {\n\t\t\t\t\t\t\t\t\t\tnewRules.add(expansions.get(0)) ;\n\t\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t\tnewRules.add(expansions.get(1)) ;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (rule !=defaultRule)\n\t\t\t\t\t\t\t\t\t\tremoveRules.add((RuleVR)rule) ;\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\tremoveRules.add((RuleVR)rule) ;\n\t\t\t\t\t\t\t\t\tnewRules.addAll(expansions) ;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (systemChanged) {\n\t\t\t\t\t\t\trs.removeAll(removeRules) ;\n\t\t\t\t\t\t\trs.addAll(newRules) ;\n\t\t\t\t\t\t\tthis.clearAllStats();\n\t\t\t\t\t\t\tcurrentSystemVersion++ ;\n\t\t\t\t\t\t\tSystem.out.println(\"########################\");\n\t\t\t\t\t\t\tSystem.out.println(this);\n\t\t\t\t\t\t\tSystem.out.println(\"########################\");\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}//RMSEReduction\n\t\t\t\telse{\n\t\t\t\t\t// checking a possible extension\n\t\t\t\t\tif (this.instancesSeen > graceperiod && !drift ) {\n\t\t\t\t\t\tExtendedCandidateErrR bestExtension = this.checkValidExpansion();\n\t\t\t\t\t\tif ((bestExtension != null)) {\n\t\t\t\t\t\t\tif (chooseSingleRuleOption.isSet()) {\n\t\t\n\t\t\t\t\t\t\t\tVector<RuleErrR> newRules = bestExtension.CreateRuleFromExtension() ;\n\t\t\t\t\t\t\t\tif (bestExtension.getParentRule()!=defaultRule)\n\t\t\t\t\t\t\t\t\trs.remove(bestExtension.getParentRule()) ;\n\t\t\t\t\t\t\t\t\n\t\t//\t\t\t\t\t\tWe must choose the best candidate here!\n\t\t\t\t\t\t\t\tdouble [] SSESingleExtenstions = bestExtension.getMeanSSESingleExension() ;\n\t\t\t\t\t\t\t\tif (SSESingleExtenstions[0]<SSESingleExtenstions[1])\n\t\t\t\t\t\t\t\t\trs.add(newRules.get(0)) ;\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\trs.add(newRules.get(1)) ;\t\n\t\t\t\t\t\t\t\t\t\n\t\t//\t\t\t\t\t\trs.addAll(newRules) ;\n\t\t\t\t\t\t\t\tif (bestExtension.getParentRule()==defaultRule)\n\t\t\t\t\t\t\t\t\tdefaultRule.buildExtendedCandidates(bestExtension.getAttributeIndex());\n\t\t\n\t\t\t\t\t\t\t\tthis.clearAllStats();\n\t\t\t\t\t\t\t\tthis.currentValidCandidates.clear() ;\n\t\t\t\t\t\t\t\tthis.currentNonReadyCandidates.clear() ;\n\t\t\t\t\t\t\t\tcurrentSystemVersion++ ;\n\t\t\t\t\t\t\t\tSystem.out.println(\"########################\");\n\t\t\t\t\t\t\t\tSystem.out.println(this);\n\t\t\t\t\t\t\t\tSystem.out.println(\"########################\");\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tExtendedCandidateErrR cbestExtension = this.checkValidExpansion();\n\n\t\t\t\t\t\t\t\tVector<RuleErrR> newRules = bestExtension.CreateRuleFromExtension() ;\n\t\t\t\t\t\t\t\trs.remove(bestExtension.getParentRule()) ;\n\t\t\t\t\t\t\t\trs.addAll(newRules) ;\n\t\t\t\t\t\t\t\tthis.clearAllStats();\n\t\t\t\t\t\t\t\tthis.currentValidCandidates.clear() ;\n\t\t\t\t\t\t\t\tthis.currentNonReadyCandidates.clear() ;\n\t\t\t\t\t\t\t\tcurrentSystemVersion++ ;\n\t\t\t\t\t\t\t\tSystem.out.println(\"########################\");\n\t\t\t\t\t\t\t\tSystem.out.println(this);\n\t\t\t\t\t\t\t\tSystem.out.println(\"########################\");\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\tif (chooseSingleRuleOption.isSet()) {\n\t\t\t\t\tdouble maxMembership = 0 ;\n\t\t\t\t\tfor (ResultSummary.ResultPair resultPair: resultSummary.getResultPairs()) {\n\t\t\t\t\t\tresultPair.getRule().trainOnInstance(resultSummary, resultPair);\n\t\t\t\t\t\tmaxMembership = Math.max(maxMembership, resultPair.getMembership()) ;\n\t\t\t\t\t}\n\t\t\t\t\tif (maxMembership < max_Membership_For_Choosing_Single_Rule)\n\t\t\t\t\t\tdefaultRule.trainOnInstance(resultSummary, resultSummary.getResultPairDefaultRule()) ;\n\t\t\t\t}else{\n\t\t\t\t\tfor (ResultSummary.ResultPair resultPair: resultSummary.getResultPairs()) {\n\t\t\t\t\t\tresultPair.getRule().trainOnInstance(resultSummary, resultPair);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch (Exception ex){\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}", "public void gotOld(){\n\n for (int i = 0; i < residents.size(); i ++){\n\n residents.get(i).gotOld();\n }\n }", "public void evolve_enviroment() {\r\n\r\n // this.main_population.update_population();\r\n // get the indices of the best individual in the main population\r\n int main_pop_best = this.main_population.getBest_indices();\r\n\r\n // create a new individua with the genes of the best individual\r\n this.pop_best = new individual(this.main_population.getPopulation()[main_pop_best].getGenes(), solutions, output); // best individual in population\r\n\r\n // perform selection, crossover and mutation\r\n this.roulette_selection();\r\n this.crossover();\r\n this.mutate(this.prob);\r\n this.tournament_selection(); // survivor selection\r\n\r\n // find the indices of the worst individual and replace it with the best from the last generation\r\n this.main_population.setIndividual(pop_best, this.main_population.find_Worst_indicies());\r\n this.main_population.update_population();\r\n\r\n }", "private void recalcSpecs() {\n if (!(this.mCurrentSpecs == null || this.mAllTiles == null)) {\n this.mTiles.clear();\n this.mOtherTiles.clear();\n ArrayList arrayList = new ArrayList(this.mAllTiles);\n for (int i = 0; i < this.mCurrentSpecs.size(); i++) {\n TileQueryHelper.TileInfo andRemoveOther = getAndRemoveOther(this.mCurrentSpecs.get(i), arrayList);\n if (andRemoveOther != null) {\n this.mTiles.add(andRemoveOther);\n }\n }\n this.mTileDividerIndex = this.mTiles.size();\n this.mOtherTiles.addAll(arrayList);\n this.mEditIndex = this.mTiles.size();\n notifyDataSetChanged();\n }\n }", "@Override\n public double classifyInstance(Instance instance) throws Exception {\n\n\n\n int numAttributes = instance.numAttributes();\n int clsIndex = instance.classIndex();\n boolean hasClassAttribute = true;\n int numTestAtt = numAttributes -1;\n if (numAttributes == m_numOfInputNeutrons) {\n hasClassAttribute = false; // it means the test data doesn't has class attribute\n numTestAtt = numTestAtt+1;\n }\n\n for (int i = 0; i< numAttributes; i++){\n if (instance.attribute(i).isNumeric()){\n\n double max = m_normalization[0][i];\n double min = m_normalization[1][i];\n double normValue = 0 ;\n if (instance.value(i)<min) {\n normValue = 0;\n m_normalization[1][i] = instance.value(i); // reset the smallest value\n }else if(instance.value(i)> max){\n normValue = 1;\n m_normalization[0][i] = instance.value(i); // reset the biggest value\n }else {\n if (max == min ){\n if (max == 0){\n normValue = 0;\n }else {\n normValue = max/Math.abs(max);\n }\n }else {\n normValue = (instance.value(i) - min) / (max - min);\n }\n }\n instance.setValue(i, normValue);\n }\n }\n\n double[] testData = new double[numTestAtt];\n\n\n\n\n\n int index = 0 ;\n\n if (!hasClassAttribute){\n\n for (int i =0; i<numAttributes; i++) {\n testData[i] = instance.value(i);\n }\n }else {\n for (int i = 0; i < numAttributes; i++) {\n\n if (i != clsIndex) {\n\n testData[index] = instance.value(i);\n\n index++;\n }\n }\n }\n\n\n\n DenseMatrix prediction = new DenseMatrix(numTestAtt,1);\n for (int i = 0; i<numTestAtt; i++){\n prediction.set(i, 0, testData[i]);\n }\n\n DenseMatrix H_test = generateH(prediction,weightsOfInput,biases, 1);\n\n DenseMatrix H_test_T = new DenseMatrix(1, m_numHiddenNeurons);\n\n H_test.transpose(H_test_T);\n\n DenseMatrix output = new DenseMatrix(1, m_numOfOutputNeutrons);\n\n H_test_T.mult(weightsOfOutput, output);\n\n double result = 0;\n\n if (m_typeOfELM == 0) {\n double value = output.get(0,0);\n result = value*(m_normalization[0][classIndex]-m_normalization[1][classIndex])+m_normalization[1][classIndex];\n //result = value;\n if (m_debug == 1){\n System.out.print(result + \" \");\n }\n }else if (m_typeOfELM == 1){\n int indexMax = 0;\n double labelValue = output.get(0,0);\n\n if (m_debug == 1){\n System.out.println(\"Each instance output neuron result (after activation)\");\n }\n for (int i =0; i< m_numOfOutputNeutrons; i++){\n if (m_debug == 1){\n System.out.print(output.get(0,i) + \" \");\n }\n if (output.get(0,i) > labelValue){\n labelValue = output.get(0,i);\n indexMax = i;\n }\n }\n if (m_debug == 1){\n\n System.out.println(\"//\");\n System.out.println(indexMax);\n }\n result = indexMax;\n }\n\n\n\n return result;\n\n\n }", "public void InitiateSegmentation()\n\t{\n\t\ti1.setOverlay(null);\n\t\ti1.killRoi();\n\t\tToolbar Tb = Toolbar.getInstance();\n\t\tTb.setTool(Toolbar.HAND);\n\n\n\t\tif (i1.getType() != i1.GRAY8) {\n\t\t\tIJ.error(\"Sorry, this plugin currently works with 8bit grey scale images!\");\n\t\t\tdispose();\n\t\t\treturn;\n\t\t}\n\n\n\t\tImageStack stack1 = i1.getStack();\n\t\tpopSequence = new BalloonSequence(i1);\n\t\tcurrentStage = new int[i1.getStackSize()];\n\t\tIJ.showStatus(\"Loading\");\n\t\tIJ.showProgress(0.0);\n\n\t\tfor (int i=0; i<i1.getStackSize();i++){\n\t\t\tIJ.showProgress( ((double)i)/((double)i1.getStackSize()) );\n\t\t\tIJ.showStatus(\"Slice/Image-file: \" + i + \"/\" +\n\t\t\t\t\ti1.getStackSize()) ;\n\t\t\tInitiateImageData (3, i+1);\n\t\t\tif (ipWallSegment != null)\n\t\t\t{\n\t\t\t\tipWallSegment.setProgressBar(null);\n\t\t\t\t// Initiate the population\n\t\t\t\tpopSequence.setSequence(i, ipWallSegment, 3);\n\t\t\t}\n\t\t}\n\t\tIJ.showStatus(\"\");\n\t\tIJ.showProgress(1.0);\n\t\t//IJ.run(\"Close\");\n\t\tcurrentSlice = i1.getCurrentSlice();\n\t\tipWallSegment = (i1.getStack()).getProcessor(i1.getCurrentSlice());\n\t\tpop = popSequence.PopList[currentSlice-1];\n\t}", "public static void findSelectedInstances() {\n int selected = 0;\n for (int i = 0; i < allInstances.length; i++) {\n if (allInstances[i][2].equals(\"selected\")) selected++;\n }\n\n // create an array of just the selected instances\n selectedInstances = new String[selected][3];\n int j = 0;\n onlyLocalInstanceSelected = true;\n for (int i = 0; i < allInstances.length; i++) {\n if (allInstances[i][2].equals(\"selected\")) {\n selectedInstances[j][0] = allInstances[i][0];\n selectedInstances[j][1] = allInstances[i][1];\n selectedInstances[j][2] = allInstances[i][2];\n j++;\n if (!allInstances[i][1].toLowerCase().equals(getInstanceName().toLowerCase())) onlyLocalInstanceSelected = false;\n }\n }\n }", "public GlobalState() {\r\n\t\t//initialize ITANet location vector\r\n\t\tint ITACount = Model.getITACount();\r\n\t\tthis.locVec = new int[ITACount];\r\n\t\tfor (int i = 0; i < ITACount; i++){\r\n\t\t\tthis.locVec[i] = Model.getITAAt(i).getInitLoc();\r\n\t\t}\r\n\r\n\t\t//initialize interruption vector\r\n\t\tint interCount = Model.getInterCount();\r\n\t\tthis.interVec = new boolean[interCount];\r\n\t\tfor(int i = 0; i < interCount; i++){\r\n\t\t\tthis.interVec[i] = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.cvMap = Model.getCVMap(); //share 'cvMap' with Model\r\n\t\tthis.srArray = Model.getSRArray();\t//share 'srArray' with Model \r\n\t\tthis.stack = new CPUStack();\r\n\t\tthis.switches = new IRQSwitch();\r\n\t}", "protected MultiInstanceDecisionTree(Instances instances) {\n\n m_instanceBags = new HashMap<Instance, Bag>();\n ArrayList<Instance> all = new ArrayList<Instance>();\n double totalInstances = 0;\n double totalBags = 0;\n for (Instance i : instances) {\n Bag bag = new Bag(i);\n for (Instance bagged : bag.instances()) {\n m_instanceBags.put(bagged, bag);\n all.add(bagged);\n }\n totalBags++;\n totalInstances += bag.instances().numInstances();\n }\n\n double b_multiplier = totalInstances / totalBags;\n if (m_scaleK) {\n for (Bag bag : m_instanceBags.values()) {\n bag.setBagWeightMultiplier(b_multiplier);\n }\n }\n\n makeTree(m_instanceBags, all, false);\n }", "@Override\n\tpublic void undo() throws PGenException {\n\n\t\tif ( parent != null ){\n\t\t\tif ( newElements != null ) {\n\t\t\t\tfor ( AbstractDrawableComponent ade : newElements ) {\n\t\t\t\t\tparent.removeElement( ade );\n\t\t\t\t}\t \t\n\t\t\t}\n\n\t\t\tif ( oldElements != null ) {\n\t\t\t\tparent.add( oldElements );\n\t\t\t}\n\t\t}\n\t\telse if ( oldElements.size() == newElements.size() ){\n\t\t\tfor ( int ii = 0; ii < newElements.size(); ii++ ) {\n\t\t\t\tAbstractDrawableComponent ade = newElements.get(ii);\n\t\t\t\tif ( ade.getParent() != null && ade.getParent() instanceof DECollection ){\n\t\t\t\t\tDECollection dec = (DECollection) ade.getParent();\n\t\t\t\t\tdec.removeElement( ade );\n\t\t\t\t\tdec.add( oldElements.get( ii ));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void optimize(){\n\n NfaState currState;\n HashMap<Integer, State> statesCloned = (HashMap)states.clone();\n\n\n boolean removed;\n\n for(Map.Entry<Integer, State> entry : statesCloned.entrySet()) {//for each state of the nfa\n\n do {\n removed=false;\n Integer id = entry.getKey();\n\n if (states.get(id) == null)//state already been removed\n continue;\n else\n currState = (NfaState) entry.getValue();\n\n HashMap<String, ArrayList<Integer>> startEdges = currState.getOut_edges();\n\n for (Map.Entry<String, ArrayList<Integer>> startEdge : startEdges.entrySet()) {//for each edge of the current state being optimezed\n\n ArrayList<Integer> transactions = new ArrayList(startEdge.getValue());\n\n\n for (Integer state2DegID : transactions) {// for each transaction the 2nd degree state\n NfaState stateDeg2 = (NfaState) states.get(state2DegID);\n\n if (stateDeg2.getOut_edges() == null)\n continue;\n\n\n\n ArrayList<Integer> edgesDeg2 = stateDeg2.getOut_edges().get(EPSILON);\n\n if (edgesDeg2 != null && edgesDeg2.size() == 1 && stateDeg2.getOut_edges().size() == 1) {//if the next state has only a epsilon transaction, we can remove this state\n NfaState successor = (NfaState) states.get(edgesDeg2.get(0));\n\n\n for (Map.Entry<String, ArrayList<Integer>> inEdgesDeg2 : stateDeg2.getIn_edges().entrySet()) {//for every in_edge of the state being removed, update the elements accordingly\n String key = inEdgesDeg2.getKey();\n\n if (inEdgesDeg2.getValue().size() > 0)\n removed = true;\n\n for (Integer stateBeingUpdatedId : inEdgesDeg2.getValue()) {//state to be updated\n NfaState stateBeingUpdated = (NfaState) states.get(stateBeingUpdatedId);\n //add new edge\n stateBeingUpdated.addEdge(key, successor);\n\n //remove out and in edge to intermediate\n stateBeingUpdated.getOut_edges().get(key).remove((Integer) stateDeg2.getId());\n }\n }\n\n //remove out_edges\n for (Map.Entry<String, ArrayList<Integer>> outEdgesDeg2 : stateDeg2.getOut_edges().entrySet()) {\n for (Integer sucId : outEdgesDeg2.getValue()){\n ((NfaState)states.get(sucId)).getIn_edges().get(outEdgesDeg2.getKey()).remove((Integer) stateDeg2.getId());\n }\n }\n //remove state\n states.remove(stateDeg2.getId());\n }\n }\n\n }\n\n }while (removed);\n }\n }", "boolean generateAutomata()\n{\n empty_calls = new HashSet<JflowMethod>();\n event_calls = new HashSet<JflowMethod>();\n complete_calls = new LinkedHashMap<JflowMethod,ModelMethod>();\n methods_todo = new LinkedHashSet<JflowMethod>();\n return_set = new HashMap<JflowMethod,Boolean>();\n\n start_set = new HashSet<JflowMethod>();\n for (JflowMethod cm : model_master.getStartMethods()) {\n methods_todo.add(cm);\n start_set.add(cm);\n }\n\n while (!methods_todo.isEmpty()) {\n Iterator<JflowMethod> it = methods_todo.iterator();\n if (!it.hasNext()) break;\n JflowMethod cm = it.next();\n it.remove();\n if (!empty_calls.contains(cm) && !complete_calls.containsKey(cm)) {\n\t if (!model_master.checkUseMethod(cm) || !model_master.isMethodAccessible(cm.getMethod()) ||\n\t\tcm.getMethod().isAbstract()) {\n\t if (model_master.doDebug()) {\n\t System.err.println(\"Ignore method: \" + cm.getMethodName() + \" \" +\n\t\t\t\t cm.getMethodSignature() + \" \" +\n\t\t\t\t model_master.checkUseMethod(cm) + \" \" +\n\t\t\t\t model_master.isMethodAccessible(cm.getMethod()));\n\t }\n\t empty_calls.add(cm);\n\t }\n\t else {\n\t ModelBuilder bld = new ModelBuilder(model_master,this,cm);\n\t complete_calls.put(cm,null);\n\t ModelMethod cs = bld.createAutomata();\n\t if (cs == null) empty_calls.add(cm);\n\t else complete_calls.put(cm,cs);\n\t }\n }\n }\n\n Set<JflowMethod> workq = new LinkedHashSet<JflowMethod>();\n for (Map.Entry<JflowMethod,ModelMethod> ent : complete_calls.entrySet()) {\n JflowMethod bm = ent.getKey();\n ModelMethod cs = ent.getValue();\n if (cs == null) continue;\n Set<JflowModel.Node> states = simplify(cs.getStartState());\n int ctr = 0;\n boolean hasrtn = false;\n for (JflowModel.Node st1 : states) {\n\t if (st1.getEvent() != null) event_calls.add(bm);\n\t else if (st1.getFieldSet() != null) event_calls.add(bm);\n\t if (!hasrtn && st1.getReturnValue() != null) hasrtn = true;\n\t JflowMethod cm = st1.getCall();\n\t if (cm != null) {\n\t if (event_calls.contains(cm)) event_calls.add(bm);\n\t else {\n\t ++ctr;\n\t ModelMethod ncs = complete_calls.get(cm);\n\t if (ncs != null) ncs.addUser(bm);\n\t else System.err.println(\"Call to \" + cm.getMethodName() + \" not found\");\n\t }\n\t }\n }\n return_set.put(bm,Boolean.valueOf(hasrtn));\n\n if (model_master.doDebug()) {\n\t System.err.println(\"First pass method \" + bm.getMethodName() + \" \" +\n\t\t\t bm.getMethodSignature() + \" \" + ctr + \" \" +\n\t\t\t states.size() + \" \" + event_calls.contains(bm));\n }\n if (ctr == 0) {\n\t if (!event_calls.contains(bm)) empty_calls.add(bm);\n }\n else {\n\t workq.add(bm);\n }\n }\n if (model_master.doDebug()) System.err.println(\"Work queue size = \" + workq.size());\n if (event_calls.size() == 0) return false;\n\n Set<JflowMethod> returnused = null;\n boolean chng = true;\n while (chng) {\n chng = false;\n returnused = new HashSet<JflowMethod>();\n while (!workq.isEmpty()) {\n\t Iterator<JflowMethod> it = workq.iterator();\n\t if (!it.hasNext()) break;\n\t JflowMethod bm = it.next();\n\t it.remove();\n\t ModelMethod cs = complete_calls.get(bm);\n\t boolean chkit = !event_calls.contains(bm);\n\n\t if (cs == null || empty_calls.contains(bm)) continue;\n\n\t int ctr = 0;\n\t Set<JflowModel.Node> states = simplify(cs.getStartState());\n\t boolean mchng = false;\n\t boolean hasrtn = false;\n\t for (JflowModel.Node st1 : states) {\n\t if (!hasrtn && st1.getReturnValue() != null) hasrtn = true;\n\t JflowMethod cm = st1.getCall();\n\t if (cm != null) {\n\t if (st1.getUseReturn()) returnused.add(cm);\n\t if (!event_calls.contains(cm)) {\n\t\t ++ctr;\n\t\t}\n\t else if (chkit) {\n\t\t if (model_master.doDebug()) {\n\t\t System.err.println(\"Method required: \" + bm.getMethodName() + \" \" +\n\t\t\t\t\t bm.getMethodSignature() + \" :: \" + cm.getMethodName() +\n\t\t\t\t\t \" \" + cm.getMethodSignature());\n\t\t }\n\t\t event_calls.add(bm);\n\t\t chkit = false;\n\t\t mchng = true;\n\t\t}\n\t }\n\t }\n\n\t if (return_set.get(bm) != Boolean.FALSE) {\n\t return_set.put(bm,Boolean.valueOf(hasrtn));\n\t if (!hasrtn) mchng = true;\n\t }\n\n\t if (ctr == 0 && !event_calls.contains(bm)) {\n\t empty_calls.add(bm);\n\t mchng = true;\n\t }\n\n\t if (model_master.doDebug()) System.err.println(\"Consider method \" + bm.getMethodName() + \" \" + bm.getMethodSignature() + \" \" + ctr + \" \" + states.size() + \" \" + mchng);\n\n\t if (mchng) {\n\t for (Iterator<?> it1 = cs.getUsers(); it1.hasNext(); ) {\n\t JflowMethod cm = (JflowMethod) it1.next();\n\t if (model_master.doDebug()) System.err.println(\"\\tQueue \" + cm.getMethodName() + \" \" + cm.getMethodSignature());\n\t workq.add(cm);\n\t }\n\t }\n }\n\n for (Map.Entry<JflowMethod,ModelMethod> ent : complete_calls.entrySet()) {\n\t JflowMethod bm = ent.getKey();\n\t ModelMethod cs = ent.getValue();\n\t if (cs != null && !empty_calls.contains(bm) && !event_calls.contains(bm)) {\n\t empty_calls.add(bm);\n\t chng = true;\n\t for (Iterator<JflowMethod> it1 = cs.getUsers(); it1.hasNext(); ) {\n\t JflowMethod cm = it1.next();\n\t if (model_master.doDebug()) System.err.println(\"\\tQueue \" + cm.getMethodName() + \" \" + cm.getMethodSignature());\n\t workq.add(cm);\n\t }\n\t }\n }\n }\n\n for (JflowMethod cm : empty_calls) {\n complete_calls.remove(cm);\n }\n\n chng = true;\n boolean needsync = true;\n while (chng) {\n chng = false;\n boolean nextsync = false;\n for (ModelMethod em : complete_calls.values()) {\n\t Set<JflowModel.Node> sts = simplify(em.getStartState());\n\t if (!needsync) {\n\t for (JflowModel.Node nms : sts) {\n\t ModelState ms = (ModelState) nms;\n\t if (ms.getWaitType() != ModelWaitType.NONE) {\n\t\t ms.clearCall();\n\t\t chng = true;\n\t\t}\n\t }\n\t }\n\t else if (!nextsync) {\n\t for (JflowModel.Node ms : sts) {\n\t if (ms.getCall() != null && ms.isAsync()) nextsync = true;\n\t }\n\t }\n\t if (return_set.get(em.getMethod()) != Boolean.FALSE && returnused != null && \n\t\t!returnused.contains(em.getMethod())) {\n\t for (JflowModel.Node nms : sts) {\n\t ModelState ms = (ModelState) nms;\n\t if (ms.getReturnValue() != null) {\n\t\t ms.clearCall();\n\t\t chng = true;\n\t\t}\n\t }\n\t return_set.put(em.getMethod(),Boolean.FALSE);\n\t }\n }\n if (nextsync != needsync) chng = true;\n needsync = nextsync;\n }\n\n for (ModelMethod em : complete_calls.values()) {\n ModelMinimizer.minimize(model_master,em.getStartState());\n }\n\n ModelSynch msynch = new ModelSynch(complete_calls.values());\n msynch.establishPartitions();\n\n if (model_master.doDebug()) {\n IvyXmlWriter nxw = new IvyXmlWriter(new OutputStreamWriter(System.err));\n nxw.begin(\"DEBUG\");\n outputEvents(nxw);\n outputProgram(nxw);\n nxw.end();\n nxw.flush();\n }\n\n boolean retfg = true;\n\n Collection<JflowEvent> c = model_master.getRequiredEvents();\n if (c != null && !c.isEmpty()) {\n Set<JflowEvent> evts = new HashSet<JflowEvent>();\n for (ModelMethod cs : complete_calls.values()) {\n\t Set<JflowModel.Node> states = simplify(cs.getStartState());\n\t for (JflowModel.Node ms : states) {\n\t JflowEvent ev = ms.getEvent();\n\t if (ev != null) evts.add(ev);\n\t }\n }\n for (JflowEvent ev : c) {\n\t if (!evts.contains(ev)) {\n\t System.err.println(\"JFLOW: Required event \" + ev + \" not found\");\n\t retfg = false;\n\t break;\n\t }\n }\n }\n\n empty_calls = null;\n event_calls = null;\n methods_todo = null;\n return_set = null;\n\n return retfg;\n}", "private void updateRegions() {\r\n\t\t\r\n\t\tinfobarRenderer.updateRegions(this);\r\n\t\t\r\n\t\tbtnBuilding.rect.x = 0;\r\n\t\tbtnBuilding.rect.y = cgfx.top.left.getHeight();\r\n\t\tbtnBuilding.rect.width = gfx.buildingButton.getWidth();\r\n\t\tbtnBuilding.rect.height = gfx.buildingButton.getHeight();\r\n\t\t\r\n\t\tleftTopRect.x = 0;\r\n\t\tleftTopRect.y = btnBuilding.rect.y + btnBuilding.rect.height;\r\n\t\tleftTopRect.width = gfx.leftTop.getWidth();\r\n\t\tleftTopRect.height = gfx.leftTop.getHeight();\r\n\t\t\r\n\t\tbtnRadar.rect.x = 0;\r\n\t\tbtnRadar.rect.y = getHeight() - cgfx.bottom.left.getHeight() - gfx.radarButton.getHeight();\r\n\t\tbtnRadar.rect.width = gfx.radarButton.getWidth();\r\n\t\tbtnRadar.rect.height = gfx.radarButton.getHeight();\r\n\t\t\r\n\t\tleftBottomRect.x = 0;\r\n\t\tleftBottomRect.y = btnRadar.rect.y - gfx.leftBottom.getHeight();\r\n\t\tleftBottomRect.width = gfx.leftBottom.getWidth();\r\n\t\tleftBottomRect.height = gfx.leftBottom.getHeight();\r\n\t\t\r\n\t\tleftFillerRect.x = 0;\r\n\t\tleftFillerRect.y = leftTopRect.y + leftTopRect.height;\r\n\t\tleftFillerRect.width = gfx.leftFiller.getWidth();\r\n\t\tleftFillerRect.height = leftBottomRect.y - leftFillerRect.y;\r\n\t\tif (leftFillerPaint == null) {\r\n\t\t\tleftFillerPaint = new TexturePaint(gfx.leftFiller, leftFillerRect);\r\n\t\t}\r\n\t\t\r\n\t\tbtnBuildingInfo.rect.x = getWidth() - gfx.buildingInfoButton.getWidth();\r\n\t\tbtnBuildingInfo.rect.y = cgfx.top.left.getHeight();\r\n\t\tbtnBuildingInfo.rect.width = gfx.buildingInfoButton.getWidth();\r\n\t\tbtnBuildingInfo.rect.height = gfx.buildingInfoButton.getHeight();\r\n\t\t\r\n\t\trightTopRect.x = btnBuildingInfo.rect.x;\r\n\t\trightTopRect.y = btnBuildingInfo.rect.y + btnBuildingInfo.rect.height;\r\n\t\trightTopRect.width = gfx.rightTop.getWidth();\r\n\t\trightTopRect.height = gfx.rightTop.getHeight();\r\n\t\t\r\n\t\tbtnButtons.rect.x = btnBuildingInfo.rect.x;\r\n\t\tbtnButtons.rect.y = getHeight() - cgfx.bottom.left.getHeight() - gfx.screenButtons.getHeight();\r\n\t\tbtnButtons.rect.width = gfx.screenButtons.getWidth();\r\n\t\tbtnButtons.rect.height = gfx.screenButtons.getHeight();\r\n\t\t\r\n\t\trightBottomRect.x = btnBuildingInfo.rect.x;\r\n\t\trightBottomRect.y = btnButtons.rect.y - gfx.rightBottom.getHeight();\r\n\t\trightBottomRect.width = gfx.rightBottom.getWidth();\r\n\t\trightBottomRect.height = gfx.rightBottom.getHeight();\r\n\t\t\r\n\t\trightFillerRect.x = btnBuildingInfo.rect.x;\r\n\t\trightFillerRect.y = rightTopRect.y + gfx.rightTop.getHeight();\r\n\t\trightFillerRect.width = gfx.rightFiller.getWidth();\r\n\t\trightFillerRect.height = rightBottomRect.y - rightFillerRect.y;\r\n\t\t\r\n\t\trightFillerPaint = new TexturePaint(gfx.rightFiller, rightFillerRect);\r\n\t\t\r\n\t\t// BOTTOM RIGHT CONTROL BUTTONS\r\n\t\t\r\n\t\tbtnBridge.rect.x = getWidth() - gfx.rightBottom.getWidth() - gfx.bridgeButton.getWidth();\r\n\t\tbtnBridge.rect.y = getHeight() - cgfx.bottom.right.getHeight() - gfx.bridgeButton.getHeight();\r\n\t\tbtnBridge.rect.width = gfx.bridgeButton.getWidth();\r\n\t\tbtnBridge.rect.height = gfx.bridgeButton.getHeight();\r\n\t\t\r\n\t\tbtnStarmap.rect.x = btnBridge.rect.x - gfx.starmapButton.getWidth();\r\n\t\tbtnStarmap.rect.y = btnBridge.rect.y;\r\n\t\tbtnStarmap.rect.width = gfx.starmapButton.getWidth();\r\n\t\tbtnStarmap.rect.height = gfx.starmapButton.getHeight();\r\n\t\t\r\n\t\tbtnPlanet.rect.x = btnStarmap.rect.x - gfx.planetButton.getWidth();\r\n\t\tbtnPlanet.rect.y = btnBridge.rect.y;\r\n\t\tbtnPlanet.rect.width = gfx.planetButton.getWidth();\r\n\t\tbtnPlanet.rect.height = gfx.planetButton.getHeight();\r\n\r\n\t\tbtnColonyInfo.rect.x = btnPlanet.rect.x - gfx.colonyInfoButton.getWidth();\r\n\t\tbtnColonyInfo.rect.y = btnBridge.rect.y;\r\n\t\tbtnColonyInfo.rect.width = gfx.colonyInfoButton.getWidth();\r\n\t\tbtnColonyInfo.rect.height = gfx.colonyInfoButton.getHeight();\r\n\t\t\r\n\t\tmainWindow.x = btnBuilding.rect.width + 1;\r\n\t\tmainWindow.y = btnBuilding.rect.y;\r\n\t\tmainWindow.width = btnBuildingInfo.rect.x - mainWindow.x;\r\n\t\tmainWindow.height = btnRadar.rect.y + btnRadar.rect.height - mainWindow.y;\r\n\t\t\r\n\t\tbuildPanelRect.x = mainWindow.x - 1;\r\n\t\tbuildPanelRect.y = mainWindow.y;\r\n\t\tbuildPanelRect.width = gfx.buildPanel.getWidth();\r\n\t\tbuildPanelRect.height = gfx.buildPanel.getHeight();\r\n\t\t\r\n\t\tbuildingInfoPanelRect.x = mainWindow.x + mainWindow.width - gfx.buildingInfoPanel.getWidth();\r\n\t\tbuildingInfoPanelRect.y = mainWindow.y;\r\n\t\tbuildingInfoPanelRect.width = gfx.buildingInfoPanel.getWidth();\r\n\t\tbuildingInfoPanelRect.height = gfx.buildingInfoPanel.getHeight();\r\n\t\t\r\n\t\tradarPanelRect.x = buildPanelRect.x;\r\n\t\tradarPanelRect.y = mainWindow.y + mainWindow.height - gfx.radarPanel.getHeight();\r\n\t\tradarPanelRect.width = gfx.radarPanel.getWidth();\r\n\t\tradarPanelRect.height = gfx.radarPanel.getHeight();\r\n\t\t\r\n\t}", "public void apply(at.ac.tuwien.dsg.mela.common.monitoringConcepts.ServiceMonitoringSnapshot serviceMonitoringSnapshot) {\n\n //1'step extract the monitoring data for the target service elements\n Map<MonitoredElement, MonitoredElementMonitoringSnapshot> levelMonitoringData = serviceMonitoringSnapshot.getMonitoredData(targetMonitoredElementLevel);\n\n if (levelMonitoringData == null) {\n Logger.getRootLogger().log(Level.WARN, \"Level \" + targetMonitoredElementLevel + \" not found in monitoring data\");\n return;\n }\n\n Collection<MonitoredElementMonitoringSnapshot> toBeProcessed = new ArrayList<MonitoredElementMonitoringSnapshot>();\n\n //step 2\n //if target IDs have ben supplied, use them to extract only the monitoring data for the target elements, else process all elements on this level\n if (targetMonitoredElementIDs.isEmpty()) {\n //if all on level, get each elementy data, and add its children data. Might destroy the data in the long run\n Collection<MonitoredElementMonitoringSnapshot> levelData = levelMonitoringData.values();\n for (MonitoredElementMonitoringSnapshot levelElementData : levelData) {\n\n toBeProcessed.add(levelElementData);\n }\n } else {\n for (String id : targetMonitoredElementIDs) {\n\n //TODO: an issue is that in the MonitoredElementMonitoringSnapshot I do NOT hold the children snapshots.\n //So now I follow the MonitoredElement children, get their MonitoredElementMonitoringSnapshot, and enrich the MonitoredElementMonitoringSnapshot supplied to the operations\n MonitoredElement element = new MonitoredElement(id);\n if (levelMonitoringData.containsKey(element)) {\n MonitoredElementMonitoringSnapshot elementData = levelMonitoringData.get(element);\n toBeProcessed.add(elementData);\n } else {\n Logger.getRootLogger().log(Level.WARN, \"Element with ID \" + id + \" not found in monitoring data\");\n }\n }\n }\n //step 3 \n //for each MonitoredElementMonitoringSnapshot apply composition rule and enrich monitoring data in place\n for (MonitoredElementMonitoringSnapshot snapshot : toBeProcessed) {\n\n MetricValue result = operation.apply(snapshot);\n// resultingMetric.setMonitoredElement(snapshot.getMonitoredElement());\n if (result != null) {\n //put new composite metric\n snapshot.putMetric(resultingMetric, result);\n }\n }\n }", "@Test\n public void testSaveMultipleInstancesCreatedOnDifferenceLines() throws ClassNotFoundException {\n\n List<ObjectDefinition> objectDefinitions = new ArrayList<ObjectDefinition>();\n ObjectDefinition instance1 = new ObjectDefinition(\n \"w\", \"MultipleInstanceDefinitionLines\", 11);\n ObjectDefinition instance2 = new ObjectDefinition(\n \"w\", \"MultipleInstanceDefinitionLines\", 13);\n objectDefinitions.add(instance1);\n objectDefinitions.add(instance2);\n\n Map<ObjectDefinition, List<AccessHistory>> accesses = analysis.run(\n \"MultipleInstanceDefinitionLines\", \"tests/analysis_examples\", objectDefinitions);\n\n List<AccessHistory> w1Accesses = accesses.get(instance1);\n assertEquals(1, w1Accesses.size());\n List<Access> w1IntAccesses = w1Accesses.get(0).getFieldAccesses(\"myInt\");\n assertEquals(1, w1IntAccesses.size());\n assertEquals(0, ((PrimitiveAccess) w1IntAccesses.get(0)).getValue());\n\n List<AccessHistory> w2Accesses = accesses.get(instance2);\n assertEquals(1, w2Accesses.size());\n List<Access> w2IntAccesses = w2Accesses.get(0).getFieldAccesses(\"myInt\");\n assertEquals(1, w2IntAccesses.size());\n assertEquals(42, ((PrimitiveAccess) w2IntAccesses.get(0)).getValue());\n\n }", "public void markRenderModelsModified() {\n\t\t\n\t\t// TODO dispose of the VBOs!!!\n\t\trenderUnits = null;\n\t\t\n\t}", "private void createSignalSystems() {\r\n\r\n createSignalSystemAtNode(this.scenario.getNetwork().getNodes().get(Id.createNodeId(2)));\r\n createSignalSystemAtNode(this.scenario.getNetwork().getNodes().get(Id.createNodeId(3)));\r\n createSignalSystemAtNode(this.scenario.getNetwork().getNodes().get(Id.createNodeId(4)));\r\n createSignalSystemAtNode(this.scenario.getNetwork().getNodes().get(Id.createNodeId(5)));\r\n createSignalSystemAtNode(this.scenario.getNetwork().getNodes().get(Id.createNodeId(7)));\r\n createSignalSystemAtNode(this.scenario.getNetwork().getNodes().get(Id.createNodeId(8)));\r\n\r\n if (TtCreateParallelNetworkAndLanes.checkNetworkForSecondODPair(this.scenario.getNetwork())) {\r\n createSignalSystemAtNode(this.scenario.getNetwork().getNodes().get(Id.createNodeId(10)));\r\n createSignalSystemAtNode(this.scenario.getNetwork().getNodes().get(Id.createNodeId(11)));\r\n }\r\n }", "private void deepEnterSequence_mainRegion_State2__region0() {\n\t\tswitch (historyVector[0]) {\n\t\t\tcase mainRegion_State2__region0_a :\n\t\t\t\tenterSequence_mainRegion_State2__region0_a_default();\n\t\t\t\tbreak;\n\n\t\t\tcase mainRegion_State2__region0_State4__region0_State6 :\n\t\t\t\tdeepEnterSequence_mainRegion_State2__region0_State4__region0();\n\t\t\t\tbreak;\n\n\t\t\tcase mainRegion_State2__region0_State4__region0_State7__region0_State8 :\n\t\t\t\tdeepEnterSequence_mainRegion_State2__region0_State4__region0();\n\t\t\t\tbreak;\n\n\t\t\tcase mainRegion_State2__region0_State4__region0_State7__region0_State9 :\n\t\t\t\tdeepEnterSequence_mainRegion_State2__region0_State4__region0();\n\t\t\t\tbreak;\n\n\t\t\tcase mainRegion_State2__region0_State5 :\n\t\t\t\tenterSequence_mainRegion_State2__region0_State5_default();\n\t\t\t\tbreak;\n\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\t}", "public ArrayList<TemplateState> modifyQualityBasedOnHistory( ArrayList<TemplateState> states )\r\n {\r\n for( TemplateState state : states ) {\r\n String id = state.getTemplate().getId();\r\n if( recentRunTemplates.contains(id) ) {\r\n int index = recentRunTemplates.indexOf(id);\r\n state.setQuality(state.getQuality() - ((index+1)*HISTORY_MODIFIER));\r\n }\r\n }\r\n return states;\r\n }", "private void normalizeModel(List<Server> servers) {\n\n for (Server server : servers) {\n ServerInstance serverInstance = getServerInstance(new ServerRef(server.getHostName(), server.getName()));\n server.setServerState(serverInstance.getServerState());\n server.setSuspendState(serverInstance.getSuspendState());\n }\n }", "public void setModel(RegionModel newModel) {\n\t\tmodel = newModel;\n\t}", "protected final void undo() {\n requireAllNonNull(model, previousResidentBook, previousEventBook);\n model.resetData(previousResidentBook, previousEventBook);\n model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS);\n model.updateFilteredEventList(PREDICATE_SHOW_ALL_EVENTS);\n\n }", "private void computeSets(DLProgram datalogGlobal){\n\t\t\n\t\tDLVInvocation invocation = DLVWrapper.getInstance().createInvocation(dlvPath);\n\t\tDLVInputProgram inputProgram = new DLVInputProgramImpl();\n\n\t\ttry {\t\t\t\n\t\t\tDLProgramStorer storer = new DLProgramStorerImpl();\n\t\t\tStringBuilder target = new StringBuilder();\n\t\t\tstorer.store(datalogGlobal, target);\n \n\t\t\t//Add to DLV input program the contents of global program. \n\t\t\tString datalogGlobalText = target.toString();\n\t\t\tinputProgram.addText(datalogGlobalText);\n\t\t\t\n\t\t\t//inputProgram.addText(\"triple(c1,\\\"hasModule\\\",m1,\\\"g\\\").\" + \n\t\t\t// \" inst(c1,\\\"Context\\\",\\\"g\\\").\"+ \n\t\t\t// \"triple(c1,\\\"hasModule\\\",m2,\\\"g\\\").\" + \n\t\t\t// \"triple(X, \\\"hasModule\\\", m3, \\\"g\\\") :- inst(X,\\\"Context\\\",\\\"g\\\").\");\n\t\t\t\n\t\t\t//Set input program for current invocation.\n\t\t\tinvocation.setInputProgram(inputProgram);\n\t\t\t\n\t\t\t//Filter for \\triple and \\inst predicates. \n\t\t\t//System.out.println(inputProgram.getCompleteText());\n\t\t\tList<String> filters = new LinkedList<String>();\n\t\t\tfilters.add(\"tripled\");\n\t\t\tfilters.add(\"instd\");\n\t\t\tinvocation.setFilter(filters, true);\n\t\t\t\n\t\t\t//List of computed models, used to check at least a model is computed.\n\t\t\tfinal List<Model> models = new ArrayList<Model>();\n\t\t\t\n\t\t\t//Model handler: retrieves contexts and associations in the computed model(s).\n\t\t\tinvocation.subscribe(new ModelHandler() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void handleResult(DLVInvocation paramDLVInvocation,\n\t\t\t\t\t\tModelResult modelResult) {\n\t\t\t\t\t\n\t\t\t\t\t//System.out.print(\"{ \");\n\t\t\t\t\tModel model = (Model) modelResult;\n\t\t\t\t\tmodels.add(model);\n\n\t\t\t\t\t//model.beforeFirst();\n\t\t\t\t\t//while (model.hasMorePredicates()) {}\n\n\t\t\t\t\t//Predicate predicate = model.nextPredicate();\n\t\t\t\t\tPredicate predicate = model.getPredicate(\"instd\");\n\t\t\t\t\tif (predicate != null){\n\t\t\t\t\t\t//System.out.println(predicate.name() + \": \");\n\t\t\t\t\t\twhile (predicate.hasMoreLiterals()) {\n\n\t\t\t\t\t\t\tLiteral literal = predicate.nextLiteral();\n\t\t\t\t\t\t\tif (literal.getAttributeAt(1).toString().equals(\"\\\"Context\\\"\")) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//Add context to list of inferred contexts.\n\t\t\t\t\t\t\t\tcontextsSet.add(literal.getAttributeAt(0).toString());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//System.out.print(literal);\n\t\t\t\t\t\t\t\t//System.out.println(\", \");\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpredicate = model.getPredicate(\"tripled\");\n\t\t\t\t\tif (predicate != null){\n\t\t\t\t\t\t//System.out.println(predicate.name() + \": \");\n\t\t\t\t\t\twhile (predicate.hasMoreLiterals()) {\n\n\t\t\t\t\t\t\t//Add module association for each context.\n\t\t\t\t\t\t\tLiteral literal = predicate.nextLiteral();\n\t\t\t\t\t\t\tif (literal.getAttributeAt(1).toString().equals(\"\\\"hasModule\\\"\")) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString[] association = new String[2];\n\t\t\t\t\t\t\t\tassociation[0] = literal.getAttributeAt(0).toString();\n\t\t\t\t\t\t\t\tassociation[1] = literal.getAttributeAt(2).toString();\n\t\t\t\t\t\t\t\thasModuleAssociations.add(association);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//System.out.print(literal);\n\t\t\t\t\t\t\t\t//System.out.println(\", \");\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"}\");\n\t\t\t\t\t//System.out.println();\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\t\n\t\t\tinvocation.run();\n\t\t\tinvocation.waitUntilExecutionFinishes();\n\t\t\t\n\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\tglobalModelComputationTime = endTime - startTime;\n\t\t\t\n\t\t\t//System.out.println(\"Global computation time: \" + globalModelComputationTime + \" ms.\");\n\t\t\t\n\t\t\tList<DLVError> k = invocation.getErrors();\n\t\t\tif (k.size() > 0)\n\t\t\t\tSystem.err.println(k);\n\t\t\t\n\t\t\t//System.out.println(\"Number of computed models: \" + models.size());\n\t\t\tif(models.size() == 0) \n\t\t\t\tSystem.err.println(\"[!] No models for global context program.\");\n\t\t\t\n\t\t\t//for (String[] a : hasModuleAssociations) {\n\t\t\t//\tSystem.out.println(a[0] + \" -> \" + a[1]);\n\t\t\t//}\n\t\t\t\n\t\t\t//System.out.println(\"Contexts: \");\n\t\t\t//for (String s : contextsSet) {\n\t\t\t//\tSystem.out.println(s);\n\t\t\t//\tfor(String[] a : hasModuleAssociations){\n\t\t\t//\t\tif(a[0].equals(s))\n\t\t\t//\t\tSystem.out.println(\" -> \" + a[1]);\t\n\t\t\t//\t}\n\t\t\t//}\n\t\t} catch (DLVInvocationException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void buildCombinedData() throws PipelineModelException {\n List<PipelineData> combined;\n if (baseStack != null) {\n combined = new ArrayList<>(baseStack.size() + 1);\n } else {\n combined = new ArrayList<>(1);\n }\n\n if (baseStack != null) {\n combined.addAll(baseStack);\n }\n if (pipelineData != null) {\n combined.add(pipelineData);\n }\n\n final PipelineDataMerger pipelineDataMerger = new PipelineDataMerger();\n pipelineDataMerger.merge(combined);\n combinedData = pipelineDataMerger;\n }", "public Solution_155() {\n stack = new Stack();\n minStack = new Stack();\n }", "private void preGeneralise(Instance inst) throws Exception {\n\t\n if(m_ClassValue != inst.classValue())\n\tthrow new Exception(\"Exemplar.preGeneralise : Incompatible instance's class.\");\n\n m_PreInst = inst;\n\n /* save the current state */\n m_PreRange = new boolean[numAttributes()][];\n m_PreMinBorder = new double[numAttributes()];\n m_PreMaxBorder = new double[numAttributes()];\n for(int i = 0; i < numAttributes(); i++){\n\tif(attribute(i).isNumeric()){\n\t m_PreMinBorder[i] = m_MinBorder[i];\n\t m_PreMaxBorder[i] = m_MaxBorder[i];\n\t} else {\n\t m_PreRange[i] = new boolean[attribute(i).numValues() + 1];\n\t for(int j = 0; j < attribute(i).numValues() + 1; j++){\n\t m_PreRange[i][j] = m_Range[i][j];\n\t }\n\t}\n }\n\n /* perform the pre-generalisation */\n for(int i = 0; i < numAttributes(); i++){\n\tif(inst.isMissing(i))\n\t throw new Exception(\"Exemplar.preGeneralise : Generalisation with missing feature impossible.\");\n\tif(i == classIndex())\n\t continue;\n\tif(attribute(i).isNumeric()){\n\t if(m_MaxBorder[i] < inst.value(i)) \n\t m_MaxBorder[i] = inst.value(i);\n\t if(inst.value(i) < m_MinBorder[i]) \n\t m_MinBorder[i] = inst.value(i); \n\t} else {\n\t m_Range[i][(int) inst.value(i)] = true;\n\t}\n }\n }", "public void UpdateInstanceSpecialization(ArrayList<Instance> listAllInstances, OntModel model,\tInfModel infModel, String ns) {\n\t\t\r\n\t\tfor (Instance instanceSelected : listAllInstances) \r\n\t\t{\t\t\t\r\n\t\t\t// ------ Complete classes list ------//\r\n\t\t\t\r\n\t\t\tArrayList<DtoCompleteClass> ListCompleteClsInstaceSelected = new ArrayList<DtoCompleteClass>();\r\n\t\t\tDtoCompleteClass dto = null;\r\n\t\t\t\r\n\t\t\tif(instanceSelected.ListClasses.size() == 1 && instanceSelected.ListClasses.get(0).contains(\"Thing\"))\t//Case thing\r\n\t\t\t{\r\n\t\t\t\t//Case if the instance have no class selected - only Thing\r\n\t\t\t\tdto = new DtoCompleteClass();\r\n\t\t\t\tdto.CompleteClass = instanceSelected.ListClasses.get(0);\r\n\t\t\t\tfor (String subClas : search.GetClasses(model)) {\r\n\t\t\t\t\tif(subClas != null)\r\n\t\t\t\t\t\tdto.AddMember(subClas);\r\n\t\t\t\t}\r\n\t\t\t\tListCompleteClsInstaceSelected.add(dto);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\tfor (String cls : instanceSelected.ListClasses)\r\n\t\t\t\t{\r\n\t\t\t\t\tArrayList<DtoCompleteClass> ListCompleteClsAndSubCls = search.GetCompleteSubClasses(cls, instanceSelected.ListClasses, infModel);\t\t\t\t\t\r\n\t\t\t\t\tListCompleteClsInstaceSelected.addAll(ListCompleteClsAndSubCls);\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tinstanceSelected.ListCompleteClasses = ListCompleteClsInstaceSelected;\t\t\t\r\n\t\t\t\r\n\t\t\t// ------ Complete properties list ------//\r\n\t\t\t\r\n\t\t\tArrayList<DtoPropertyAndSubProperties> ListSpecializationProperties = new ArrayList<DtoPropertyAndSubProperties>();\r\n\t\t\tDtoPropertyAndSubProperties dtoP = null;\r\n\t\t\t\r\n\t\t\tArrayList<DtoInstanceRelation> instanceListRelations = search.GetInstanceRelations(infModel, instanceSelected.ns + instanceSelected.name); \t\t//Get instance relations\r\n\t\t\tfor (DtoInstanceRelation dtoInstanceRelation : instanceListRelations) \r\n\t\t\t{\t\t\t\r\n\t\t\t\tArrayList<String> subPropertiesWithDomainAndRange = search.GetSubPropertiesWithDomaninAndRange(instanceSelected.ns + instanceSelected.name, dtoInstanceRelation.Property, dtoInstanceRelation.Target, instanceListRelations, infModel);\r\n\r\n\t\t\t\tif(subPropertiesWithDomainAndRange.size() > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tdtoP = new DtoPropertyAndSubProperties();\r\n\t\t\t\t\tdtoP.Property = dtoInstanceRelation.Property;\r\n\t\t\t\t\tdtoP.iTargetNs = dtoInstanceRelation.Target.split(\"#\")[0] + \"#\";\r\n\t\t\t\t\tdtoP.iTargetName = dtoInstanceRelation.Target.split(\"#\")[1];\r\n\t\t\t\t\tdtoP.propertyType = search.GetPropertyType(infModel, dtoInstanceRelation.Property);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (String sub : subPropertiesWithDomainAndRange) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tboolean ok = true;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tArrayList<String> distointSubPropOfProp = this.search.GetDisjointPropertiesOf(sub, infModel);\r\n\t\t\t\t\t\tfor (String disjointrop : distointSubPropOfProp) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tfor (DtoInstanceRelation dtoWithRelation : instanceListRelations) {\r\n\t\t\t\t\t\t\t\tif(dtoWithRelation.Property.equals(disjointrop)) // instance have this sub relation\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tok = false;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (DtoInstanceRelation dtoWithRelation : instanceListRelations) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(dtoWithRelation.Property.equals(sub)) // instance have this sub relation\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tok = false;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(ok == true)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tdtoP.SubProperties.add(sub);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(dtoP.SubProperties.size() > 0)\r\n\t\t\t\t\t\tListSpecializationProperties.add(dtoP);\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tinstanceSelected.ListSpecializationProperties = ListSpecializationProperties;\t\t\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "private void addRegionsToMeta(final MasterProcedureEnv env) throws IOException {\n newRegions = CreateTableProcedure.addTableToMeta(env, tableDescriptor, newRegions);\n\n // TODO: parentsToChildrenPairMap is always empty, which makes updateMetaParentRegions()\n // a no-op. This part seems unnecessary. Figure out. - Appy 12/21/17\n RestoreSnapshotHelper.RestoreMetaChanges metaChanges =\n new RestoreSnapshotHelper.RestoreMetaChanges(tableDescriptor, parentsToChildrenPairMap);\n metaChanges.updateMetaParentRegions(env.getMasterServices().getConnection(), newRegions);\n }", "@SuppressWarnings(\"rawtypes\")\n\tprivate void generatePipeModels(){\n\t\t//Pipe center model\n\t\tmodels().getBuilder(BLOCK_DIR + \"/pipe_center\")\n\t\t\t.element().from(5, 5, 5).to(11, 11, 11).allFaces((dir, face) -> face.texture(\"#side\")).end();\n\t\t\n\t\t//X+ facing pipe segment, to be rotated in blockstate json\n\t\tElementBuilder segmentBuilder = models().getBuilder(BLOCK_DIR + \"/pipe_segment\").texture(\"particle\", \"#side\")\n\t\t\t.element().from(5, 5, 11).to(11, 11, 16);\n\t\tfor(Direction dir : Direction.values()){ //TODO: This adds an extra face inside the center model\n\t\t\tif(dir.getAxis() == Direction.Axis.Z)continue;\n\t\t\tsegmentBuilder.face(dir).texture(\"#side\");\n\t\t}\n\t\t\n\t\t//Pipe inventory model\n\t\tmodels().withExistingParent(\"pipe_inventory\", BLOCK_DIR + \"/block\")\n\t\t\t.element().from(5, 0, 5).to(11, 16, 11).allFaces((dir, face) -> {\n\t\t\t\tface.texture(\"#side\");\n\t\t\t});\n\t}", "@Override\n \tpublic void regionsRemoved(RegionEvent evt) {\n \t\t\n \t}", "private void cleanWorldsAndRegions() {\n Set<PermissionRegion> usedRegions = new HashSet<>();\n Set<PermissionWorld> usedWorlds = new HashSet<>();\n\n List<PermissionEntity> entities = new ArrayList<>();\n entities.addAll(getGroups().values());\n entities.addAll(getPlayers().values());\n\n for (PermissionEntity entity : entities) {\n for (Entry entry : entity.getPermissions()) {\n if (entry.getRegion() != null)\n usedRegions.add(entry.getRegion());\n if (entry.getWorld() != null)\n usedWorlds.add(entry.getWorld());\n }\n }\n\n // Determine what needs to be deleted\n Set<PermissionRegion> regionsToDelete = new HashSet<>(getRegions().values());\n regionsToDelete.removeAll(usedRegions);\n Set<PermissionWorld> worldsToDelete = new HashSet<>(getWorlds().values());\n worldsToDelete.removeAll(usedWorlds);\n\n // Re-build lists\n getRegions().clear();\n for (PermissionRegion region : usedRegions) {\n getRegions().put(region.getName(), region);\n }\n getWorlds().clear();\n for (PermissionWorld world : usedWorlds) {\n getWorlds().put(world.getName(), world);\n }\n\n // Tell underlying DAO about deleted regions/worlds\n if (!regionsToDelete.isEmpty())\n deleteRegions(regionsToDelete);\n if (!worldsToDelete.isEmpty())\n deleteWorlds(worldsToDelete);\n }", "@Override\n public void onResume() {\n super.onResume();\n mSectionsPagerAdapter.newHazards = HazardManager.getNewHazardSet();\n }", "final boolean init_stacks()\r\n{\r\n stateptr = -1;\r\n val_init();\r\n return true;\r\n}", "protected void create() {\n\t\t_segments = _geneticCode.getNGenes() * _geneticCode.getSymmetry();\n\t\t_segColor = new Color[_segments];\n\t\tfor (int i = 0; i < _segments; i++)\n\t\t\t_segColor[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getColor();\n\t\t_segBranch = new int[_segments];\n\t\tfor (int j = 0; j < _segments; j++)\n\t\t\t_segBranch[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getBranch();\n\t\t_segredReaction = new int[_segments];\n\t\tfor (int a = 0; a < _segments; a++)\n\t\t\t_segredReaction[a] = _geneticCode.getGene(a%_geneticCode.getNGenes()).getredReaction();\n\t\t_seggreenReaction = new int[_segments];\n\t\tfor (int b = 0; b < _segments; b++)\n\t\t\t_seggreenReaction[b] = _geneticCode.getGene(b%_geneticCode.getNGenes()).getgreenReaction();\n\t\t_segblueReaction = new int[_segments];\n\t\tfor (int c = 0; c < _segments; c++)\n\t\t\t_segblueReaction[c] = _geneticCode.getGene(c%_geneticCode.getNGenes()).getblueReaction();\n\t\t_segplagueReaction = new int[_segments];\n\t\tfor (int d = 0; d < _segments; d++)\n\t\t\t_segplagueReaction[d] = _geneticCode.getGene(d%_geneticCode.getNGenes()).getplagueReaction();\n\t\t_segwhiteReaction = new int[_segments];\n\t\tfor (int e = 0; e < _segments; e++)\n\t\t\t_segwhiteReaction[e] = _geneticCode.getGene(e%_geneticCode.getNGenes()).getwhiteReaction();\n\t\t_seggrayReaction = new int[_segments];\n\t\tfor (int f = 0; f < _segments; f++)\n\t\t\t_seggrayReaction[f] = _geneticCode.getGene(f%_geneticCode.getNGenes()).getgrayReaction();\n\t\t_segdefaultReaction = new int[_segments];\n\t\tfor (int g = 0; g < _segments; g++)\n\t\t\t_segdefaultReaction[g] = _geneticCode.getGene(g%_geneticCode.getNGenes()).getdefaultReaction();\n\t\t_segmagentaReaction = new int[_segments];\n\t\tfor (int h = 0; h < _segments; h++)\n\t\t\t_segmagentaReaction[h] = _geneticCode.getGene(h%_geneticCode.getNGenes()).getmagentaReaction();\n\t\t_segpinkReaction = new int[_segments];\n\t\tfor (int i = 0; i < _segments; i++)\n\t\t\t_segpinkReaction[i] = _geneticCode.getGene(i%_geneticCode.getNGenes()).getpinkReaction();\n\t\t_segcoralReaction = new int[_segments];\n\t\tfor (int j = 0; j < _segments; j++)\n\t\t\t_segcoralReaction[j] = _geneticCode.getGene(j%_geneticCode.getNGenes()).getcoralReaction();\n\t\t_segorangeReaction = new int[_segments];\n\t\tfor (int k = 0; k < _segments; k++)\n\t\t\t_segorangeReaction[k] = _geneticCode.getGene(k%_geneticCode.getNGenes()).getorangeReaction();\n\t\t_segbarkReaction = new int[_segments];\n\t\tfor (int l = 0; l < _segments; l++)\n\t\t\t_segbarkReaction[l] = _geneticCode.getGene(l%_geneticCode.getNGenes()).getbarkReaction();\n\t\t_segvioletReaction = new int[_segments];\n\t\tfor (int m = 0; m < _segments; m++)\n\t\t\t_segvioletReaction[m] = _geneticCode.getGene(m%_geneticCode.getNGenes()).getvioletReaction();\n\t\t_segvirusReaction = new int[_segments];\n\t\tfor (int n = 0; n < _segments; n++)\n\t\t\t_segvirusReaction[n] = _geneticCode.getGene(n%_geneticCode.getNGenes()).getvirusReaction();\n\t\t_segmaroonReaction = new int[_segments];\n\t\tfor (int o = 0; o < _segments; o++)\n\t\t\t_segmaroonReaction[o] = _geneticCode.getGene(o%_geneticCode.getNGenes()).getmaroonReaction();\n\t\t_segoliveReaction = new int[_segments];\n\t\tfor (int p = 0; p < _segments; p++)\n\t\t\t_segoliveReaction[p] = _geneticCode.getGene(p%_geneticCode.getNGenes()).getoliveReaction();\n\t\t_segmintReaction = new int[_segments];\n\t\tfor (int q = 0; q < _segments; q++)\n\t\t\t_segmintReaction[q] = _geneticCode.getGene(q%_geneticCode.getNGenes()).getmintReaction();\n\t\t_segcreamReaction = new int[_segments];\n\t\tfor (int r = 0; r < _segments; r++)\n\t\t\t_segcreamReaction[r] = _geneticCode.getGene(r%_geneticCode.getNGenes()).getcreamReaction();\n\t\t_segspikeReaction = new int[_segments];\n\t\tfor (int s = 0; s < _segments; s++)\n\t\t\t_segspikeReaction[s] = _geneticCode.getGene(s%_geneticCode.getNGenes()).getspikeReaction();\n\t\t_seglightblueReaction = new int[_segments];\n\t\tfor (int t = 0; t < _segments; t++)\n\t\t\t_seglightblueReaction[t] = _geneticCode.getGene(t%_geneticCode.getNGenes()).getlightblueReaction();\n\t\t_segochreReaction = new int[_segments];\n\t\tfor (int u = 0; u < _segments; u++)\n\t\t\t_segochreReaction[u] = _geneticCode.getGene(u%_geneticCode.getNGenes()).getochreReaction();\n\t\t_seglightbrownReaction = new int[_segments];\n\t\tfor (int v = 0; v < _segments; v++)\n\t\t\t_seglightbrownReaction[v] = _geneticCode.getGene(v%_geneticCode.getNGenes()).getlightbrownReaction();\n\t\t_segbrownReaction = new int[_segments];\n\t\tfor (int w = 0; w < _segments; w++)\n\t\t\t_segbrownReaction[w] = _geneticCode.getGene(w%_geneticCode.getNGenes()).getbrownReaction();\n\t\t_segsickReaction = new int[_segments];\n\t\tfor (int x = 0; x < _segments; x++)\n\t\t\t_segsickReaction[x] = _geneticCode.getGene(x%_geneticCode.getNGenes()).getsickReaction();\n\t\t_segskyReaction = new int[_segments];\n\t\tfor (int y = 0; y < _segments; y++)\n\t\t\t_segskyReaction[y] = _geneticCode.getGene(y%_geneticCode.getNGenes()).getskyReaction();\n\t\t_seglilacReaction = new int[_segments];\n\t\tfor (int z = 0; z < _segments; z++)\n\t\t\t_seglilacReaction[z] = _geneticCode.getGene(z%_geneticCode.getNGenes()).getlilacReaction();\n\t\t_segiceReaction = new int[_segments];\n\t\tfor (int a = 0; a < _segments; a++)\n\t\t\t_segiceReaction[a] = _geneticCode.getGene(a%_geneticCode.getNGenes()).geticeReaction();\n\t\t_segsilverReaction = new int[_segments];\n\t\tfor (int b = 0; b < _segments; b++)\n\t\t\t_segsilverReaction[b] = _geneticCode.getGene(b%_geneticCode.getNGenes()).getsilverReaction();\n\t\t_segfireReaction = new int[_segments];\n\t\tfor (int c = 0; c < _segments; c++)\n\t\t\t_segfireReaction[c] = _geneticCode.getGene(c%_geneticCode.getNGenes()).getfireReaction();\n\t\t_segfriendReaction = new int[_segments];\n\t\tfor (int d = 0; d < _segments; d++)\n\t\t\t_segfriendReaction[d] = _geneticCode.getGene(d%_geneticCode.getNGenes()).getfriendReaction();\n\t\t_seggreenbrownReaction = new int[_segments];\n\t\tfor (int e = 0; e < _segments; e++)\n\t\t\t_seggreenbrownReaction[e] = _geneticCode.getGene(e%_geneticCode.getNGenes()).getgreenbrownReaction();\n\t\t_segspikepointReaction = new int[_segments];\n\t\tfor (int f = 0; f < _segments; f++)\n\t\t\t_segspikepointReaction[f] = _geneticCode.getGene(f%_geneticCode.getNGenes()).getspikepointReaction();\n\t\t_startPointX = new int[_segments];\n\t\t_startPointY = new int[_segments];\n\t\t_endPointX = new int[_segments];\n\t\t_endPointY = new int[_segments];\n\t\t_m1 = new double[_segments];\n\t\t_m2 = new double[_segments];\n\t\t_m = new double[_segments];\n\t\t_mphoto = new double[_segments];\n\t\tx1 = new int[_segments];\n\t\ty1 = new int[_segments];\n\t\tx2 = new int[_segments];\n\t\ty2 = new int[_segments];\n\t}", "public ModelStructure(){\n dcModelPurposeIndexMap = new HashMap<String,Integer>();\n dcModelIndexPurposeMap = new HashMap<Integer,String>();\n dcSoaUecIndexMap = new HashMap<String,Integer>();\n dcUecIndexMap = new HashMap<String,Integer>();\n tourModeChoiceUecIndexMap = new HashMap<String,Integer>();\n stopFreqUecIndexMap = new HashMap<String,Integer>();\n stopLocUecIndexMap = new HashMap<String,Integer>();\n tripModeChoiceUecIndexMap = new HashMap<String,Integer>();\n \n segmentedPurposeIndexMap = new HashMap<String,Integer>();\n segmentedIndexPurposeMap = new HashMap<Integer,String>();\n\n primaryPurposeIndexMap = new HashMap<String,Integer>();\n primaryIndexPurposeMap = new HashMap<Integer,String>();\n primaryPurposeIndexMap.put( \"Home\", -1 );\n primaryPurposeIndexMap.put( \"Work\", -2 );\n primaryPurposeIndexMap.put( WORK_PURPOSE_NAME, WORK_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( UNIVERSITY_PURPOSE_NAME, UNIVERSITY_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SCHOOL_PURPOSE_NAME, SCHOOL_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( ESCORT_PURPOSE_NAME, ESCORT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SHOPPING_PURPOSE_NAME, SHOPPING_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( OTH_MAINT_PURPOSE_NAME, OTH_MAINT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( EAT_OUT_PURPOSE_NAME, EAT_OUT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SOCIAL_PURPOSE_NAME, SOCIAL_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( OTH_DISCR_PURPOSE_NAME, OTH_DISCR_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( AT_WORK_PURPOSE_NAME, AT_WORK_PURPOSE_INDEX );\n primaryIndexPurposeMap.put( -1, \"Home\" );\n primaryIndexPurposeMap.put( -2, \"Work\" );\n primaryIndexPurposeMap.put( WORK_PURPOSE_INDEX, WORK_PURPOSE_NAME );\n primaryIndexPurposeMap.put( UNIVERSITY_PURPOSE_INDEX, UNIVERSITY_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SCHOOL_PURPOSE_INDEX, SCHOOL_PURPOSE_NAME );\n primaryIndexPurposeMap.put( ESCORT_PURPOSE_INDEX, ESCORT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SHOPPING_PURPOSE_INDEX, SHOPPING_PURPOSE_NAME );\n primaryIndexPurposeMap.put( OTH_MAINT_PURPOSE_INDEX, OTH_MAINT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( EAT_OUT_PURPOSE_INDEX, EAT_OUT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SOCIAL_PURPOSE_INDEX, SOCIAL_PURPOSE_NAME );\n primaryIndexPurposeMap.put( OTH_DISCR_PURPOSE_INDEX, OTH_DISCR_PURPOSE_NAME );\n primaryIndexPurposeMap.put( AT_WORK_PURPOSE_INDEX, AT_WORK_PURPOSE_NAME );\n }", "public void execute(OutputManager om) {\n\n int numRegions = allROIs.length;\n \n \n // get the voxel classification\n // either from a voxel class map or from a brain / background segmentation\n int[][][] vc = new int[xDataDim][yDataDim][zDataDim];\n \n // number of PDs in each voxel (for Bayesian images)\n int[][][] voxelNumPDs = new int[xDataDim][yDataDim][zDataDim];\n \n for (int k = 0; k < zDataDim; k++) {\n for (int j = 0; j < yDataDim; j++) {\n for (int i = 0; i < xDataDim; i++) {\n vc[i][j][k] = 2;\n voxelNumPDs[i][j][k] = 1;\n }\n }\n }\n \n if (CL_Initializer.bgMaskFile != null) {\n \n if (ImageHeader.imageExists(CL_Initializer.bgMaskFile)) {\n if ( !CL_Initializer.headerTemplate.sameSpace(CL_Initializer.bgMaskFile) ) {\n throw new LoggedException(\"Brain mask must be in the same voxel space as the input data\");\n }\n }\n\n CL_Initializer.initMaskSource();\n \n for (int k = 0; k < zDataDim; k++) {\n for (int j = 0; j < yDataDim; j++) {\n for (int i = 0; i < xDataDim; i++) {\n \n double maskValue = CL_Initializer.bgMask.nextVoxel()[0];\n \n vc[i][j][k] = maskValue > 0.0 ? 2 : -1;\n voxelNumPDs[i][j][k] = maskValue > 0.0 ? 1 : 0;\n }\n }\n }\n \n }\n \n \n // use VC from file if we have it - note this overrides the bgmask\n\n // This needs generalizing to support NIfTI files / other formats. Ideally it should be decoupled from the\n // SH order (which is ambiguous over order 4 anyhow), it should be simply the number of PDs in the voxel\n //\n // Actually doing this will require work to the TractographyImage tree and other classes\n //\n if (CL_Initializer.voxelClassMap != null) {\n vc = new int[xDataDim][yDataDim][zDataDim];\n \n DataSource vcSource = ExternalDataSource.getDataSource(CL_Initializer.voxelClassMap, 1, \"int\");\n \n for (int k = 0; k < zDataDim; k++) {\n for (int j = 0; j < yDataDim; j++) {\n for (int i = 0; i < xDataDim; i++) {\n vc[i][j][k] = (int)vcSource.nextVoxel()[0];\n }\n }\n }\n }\n \n // get the anisotropy map, if any\n //\n // Could be FA or any scalar image where we cease tracking below a threshold\n double[][][] anisMap = null;\n \n if (anisMapFile != null) {\n if (ImageHeader.imageExists(anisMapFile)) {\n try {\n \n ImageHeader ih = ImageHeader.readHeader(anisMapFile);\n\n \n if (!CL_Initializer.headerTemplate.sameSpace(ih)) {\n throw new LoggedException(\"Anisotropy image must be in the same voxel space as the input data\");\n }\n\n\n anisMap = ih.readSingleVolumeData();\n }\n catch (IOException e) {\n throw new LoggedException(e);\n }\n }\n else {\n anisMap = new double[xDataDim][yDataDim][zDataDim];\n \n DataSource anisSource =\n ExternalDataSource.getDataSource(anisMapFile, 1, CL_Initializer.inputDataType);\n \n for (int k = 0; k < zDataDim; k++) {\n for (int j = 0; j < yDataDim; j++) {\n for (int i = 0; i < xDataDim; i++) {\n anisMap[i][j][k] = anisSource.nextVoxel()[0];\n }\n }\n }\n \n }\n }\n\n\n // set up the image\n \n TractographyImage image = null;\n \n switch (imageType) {\n\n\tcase BEDPOSTX : case BEDPOSTX_DYAD :\n\n\t boolean probabilistic = ( imageType == ImageType.BEDPOSTX ); \n\t \n\t image = BedpostxTractographyImage.getTractographyImage(bedpostxDir, probabilistic, bedpostxMinF, anisMap, anisThresh,\n\t\t\t\t\t\t\t\t new int[] {xDataDim, yDataDim, zDataDim},\n\t\t\t\t\t\t\t\t new double[] {xVoxelDim, yVoxelDim, zVoxelDim}, ran);\n\t \n\t break;\n\n \n case REPBS_DT: case REPBS_MULTITENSOR: \n \n CL_Initializer.initImagingScheme();\n \n \n image =\n RepBS_DWI_TractographyImage.getTractographyImage(CL_Initializer.bsDataFiles,\n CL_Initializer.inputDataType,\n CL_Initializer.imPars,\n CL_Initializer.inversionIndices,\n vc, anisMap, anisThresh,\n new int[] {xDataDim, yDataDim, zDataDim},\n new double[] {xVoxelDim, yVoxelDim, zVoxelDim}, ran);\n \n break;\n \n \n case WILDBS_DT:\n\t CL_Initializer.initImagingScheme();\n \n\t image =\n\t\tDT_WildBS_DWI_TractographyImage.getTractographyImage(CL_Initializer.inputFile,\n\t\t\t\t\t\t\t\t CL_Initializer.inputDataType,\n\t\t\t\t\t\t\t\t CL_Initializer.imPars,\n\t\t\t\t\t\t\t\t vc, anisMap, anisThresh, \n\t\t\t\t\t\t\t\t new int[] {xDataDim, yDataDim, zDataDim},\n\t\t\t\t\t\t\t\t new double[] {xVoxelDim, yVoxelDim, zVoxelDim}, ran);\n \n\t break;\n \n \n \n case PICO :\n \n image = PICoTractographyImage.getTractographyImage\n (CL_Initializer.inputFile, CL_Initializer.inputDataType, CL_Initializer.numPDsIO,\n picoPDF, anisMap, anisThresh, new int[] {xDataDim, yDataDim, zDataDim},\n new double[] {xVoxelDim, yVoxelDim, zVoxelDim}, ran);\n \n break;\n \n case BAYESDIRAC: case BAYESDIRAC_DT :\n \n CL_Initializer.initImagingScheme();\n \n // Friman Bayesian method\n // add anisotropy map option\n\n BayesDataModel dataModel = imageType == ImageType.BAYESDIRAC ? BayesDataModel.BALL_STICK : BayesDataModel.CYL_SYMM_DT;\n\n BayesDiracTractographyImage bi = BayesDiracTractographyImage.getTractographyImage\n (CL_Initializer.inputFile, CL_Initializer.inputDataType,\n CL_Initializer.imPars, dataModel, voxelNumPDs, anisMap, anisThresh,\n new int[] {xDataDim, yDataDim, zDataDim},\n new double[] {xVoxelDim, yVoxelDim, zVoxelDim}, CL_Initializer.pointSetInd, ran);\n \n if (curvePriorK > 0.0) {\n bi.setCurvePriorKappa(curvePriorK);\n }\n if (curvePriorG > 0.0) {\n bi.setCurvePriorGamma(curvePriorG);\n }\n \n if (externalPriorImageFile != null) {\n PICoTractographyImage ePrior = PICoTractographyImage.getTractographyImage\n (externalPriorImageFile, externalPriorDataType, CL_Initializer.numPDsIO,\n picoPDF, anisMap, anisThresh, new int[] {xDataDim, yDataDim, zDataDim},\n new double[] {xVoxelDim, yVoxelDim, zVoxelDim}, ran);\n \n bi.setExternalPriors(ePrior);\n }\n \n image = bi;\n \n break;\n \n case SF_PEAK :\n image =\n SF_TractographyImage.getTractographyImage(CL_Initializer.inputFile, CL_Initializer.inputDataType,\n CL_Initializer.numPDsIO, anisMap, anisThresh,\n new int[] {xDataDim, yDataDim, zDataDim},\n new double[] {xVoxelDim, yVoxelDim, zVoxelDim});\n break;\n \n case DT: case MULTITENSOR :\n image =\n DT_TractographyImage.getTractographyImage(CL_Initializer.inputFile, CL_Initializer.inputDataType,\n CL_Initializer.maxTensorComponents, anisMap, anisThresh,\n new int[] {xDataDim, yDataDim, zDataDim},\n new double[] {xVoxelDim, yVoxelDim, zVoxelDim});\n break;\n\n case DWI_DT : case DWI_MULTITENSOR:\n\n CL_Initializer.initImagingScheme();\n\n image =\n DWI_TractographyImage.getTractographyImage(CL_Initializer.inputFile, CL_Initializer.inputDataType,\n CL_Initializer.imPars, CL_Initializer.inversionIndices,\n vc, anisMap, anisThresh, \n new int[] {xDataDim, yDataDim, zDataDim},\n new double[] {xVoxelDim, yVoxelDim, zVoxelDim});\n break;\n\n\tcase VECTOR : \n\n\t image = PD_TractographyImage.getTractographyImage(vectorFiles, CL_Initializer.inputDataType,\n\t\t\t\t\t\t\t anisMap, anisThresh, \n\t\t\t\t\t\t\t new int[] {xDataDim, yDataDim, zDataDim},\n\t\t\t\t\t\t\t new double[] {xVoxelDim, yVoxelDim, zVoxelDim});\n\t break;\n \n default : throw new LoggedException(\"Unsupported image type : \" + imageType);\n \n }\n \n \n // Set up the interpolation\n\n ImageInterpolator interp = null;\n\n \n switch (dataInterpolation) {\n\n\n case NEAREST_NEIGHBOUR: \n \n interp = new NearestNeighbourInterpolator(image);\n\n break;\n\n case NEIGHBOUR_CHOICE: \n\n interp = new NeighbourChoiceInterpolator(image, ran);\n\n break;\n\n case DWI_TRILINEAR: \n\n interp = new DWI_LinearInterpolator((DWI_TractographyImage)image);\n\n break;\n\n case VECTOR_TRILINEAR: \n\n interp = new VectorLinearInterpolator(image);\n\n break;\n\n case TEND_NN: case TEND_NC:\n\n // how to interpolate the tensor data itself, in order to provide\n // the tensor for the TEND term\n TensorInterpolator dataInterp = null;\n\n if (dataInterpolation == DataInterpolation.TEND_NC) {\n dataInterp = new DT_NC_Interpolator((TensorTractographyImage)image, ran);\n }\n else {\n dataInterp = new DT_NN_Interpolator((TensorTractographyImage)image);\n }\n\n if (tendF_File != null) {\n try { \n ImageHeader ih = ImageHeader.readHeader(tendF_File);\n \n interp = new TendInterpolator((TensorTractographyImage)image, dataInterp, ih.readSingleVolumeData(), tendG);\n }\n catch (IOException e) {\n throw new LoggedException(e);\n\n }\n \n }\n else {\n interp = new TendInterpolator((TensorTractographyImage)image, dataInterp, tendF, tendG); \n }\n \n break;\n\n default: throw new LoggedException(\"Unsupported interpolation : \" + dataInterpolation);\n\n\n }\n\n \n // set up the tracker\n\n FibreTracker tracker = null;\n\n\n switch (trackingAlgorithm) {\n\n case FACT:\n \n tracker = new FACT_FibreTracker(image);\n \n break;\n \n case EULER: \n \n tracker = new EulerFibreTracker(interp, stepSize); \n\n break;\n\n case RK4: \n\n tracker = new RK4FibreTracker(interp, stepSize);\n\n break;\n }\n\n tracker.setCurveCheckInterval(checkCurveLength);\n tracker.setIP_Threshold(ipThresh);\n \n \n // And finally, do the tracking\n \n regions : for (int region = 0; region < allROIs.length; region++) {\n\n RegionOfInterest roi = allROIs[region];\n \n if (regionIndex > -1) {\n if (roi.getRegionLabel() != regionIndex) {\n continue;\n }\n }\n \n \n int outputRegionID = roi.getRegionLabel();\n \n \n // points defined in Camino space\n Point3D[] seeds = roi.getSeedPoints();\n \n if (!silent) {\n System.err.println(\"Processing ROI \" + (region + 1) + \" of \" + numRegions);\n }\n \n FileOutputStream fout = null;\n DataOutputStream dout = null;\n \n try {\n \n if (outputRoot == null) {\n dout = om.getOutputStream();\n }\n else {\n \n if (gzip) {\n fout = new FileOutputStream(outputRoot + outputRegionID + \".Bfloat.gz\");\n dout = new DataOutputStream(new GZIPOutputStream(fout, 1024*1024*16));\n \n }\n else {\n fout = new FileOutputStream(outputRoot + outputRegionID + \".Bfloat\");\n dout = new DataOutputStream\n (new BufferedOutputStream(fout, 1024*1024*16));\n }\n }\n \n \n \n \n seed: for (int sp = 0; sp < seeds.length; sp++) {\n \n if (!silent) {\n System.err.print(\"\\rProcessing seed \" + (sp + 1) + \" of \" + seeds.length);\n }\n \n Point3D seedPoint = seeds[sp];\n \n if (!tracker.inBounds(seedPoint)) {\n logger.warning(\"Seed point \\n\\t\" + seedPoint + \"\\n is outside the diffusion image space, ignoring\");\n continue seed;\n }\n\n int xVox = (int)(seedPoint.x / xVoxelDim);\n int yVox = (int)(seedPoint.y / yVoxelDim);\n int zVox = (int)(seedPoint.z / zVoxelDim);\n \n int numPDs = image.numberOfPDs(xVox, yVox, zVox);\n \n // if number of PDs is zero, track once\n // tracker will return the seed point\n numPDs = numPDs == 0 ? 1 : numPDs;\n \n for (int p = 0; p < numPDs; p++) {\n \n for (int i = 0; i < iterations; i++) {\n \n Tract t = tracker.trackFromSeed(seedPoint, p);\n \n // warp tracts to physical space\n t.transformToPhysicalSpace(voxelToPhysicalTrans, xVoxelDim, yVoxelDim, zVoxelDim);\n \n t.writeRaw(dout);\n \n }\n \n }\n \n } // end for seedpoints\n \n if (!silent) {\n System.err.println(\"\\n\");\n }\n \n if (outputRoot != null) {\n // want to close file\n dout.close();\n }\n \n }\n catch(IOException e) {\n throw new LoggedException(e);\n }\n \n } // end for all ROIs\n \n // close om stream\n if(om != null)\n om.close();\n \n }", "public void reset() {\n\t\tplayerModelDiff1.clear();\n\t\tplayerModelDiff4.clear();\n\t\tplayerModelDiff7.clear();\n\t\tif(normalDiffMethods)\n\t\t{\t\n\t\tupdatePlayerModel();\n\t\tdisplayReceivedRewards();\n\t\t}\n\t\tint temp_diffsegment1;\n\t\tint temp_diffsegment2;\n\t\tif (currentLevelSegment == 0) {\n\t\t\t//System.out.println(\"-you died in the first segment, resetting to how you just started\");\n\t\t\ttemp_diffsegment1 = (int) plannedDifficultyLevels.get(0);\n\t\t\ttemp_diffsegment2 = (int) plannedDifficultyLevels.get(1);\n\t\t}\n\t\telse {\n\t\t\t//System.out.println(\"-nextSegmentAlreadyGenerated:\" + nextSegmentAlreadyGenerated);\n\t\t\tif (nextSegmentAlreadyGenerated) {\n\t\t\t\t//because the next segment is already generated (and so the previous does not exist anymore),\n\t\t\t\ttemp_diffsegment1 = (int) plannedDifficultyLevels.get(currentLevelSegment);\n\t\t\t\ttemp_diffsegment2 = (int) plannedDifficultyLevels.get(currentLevelSegment+1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//because the next segment is not yet generated\n\t\t\t\ttemp_diffsegment1 = (int) plannedDifficultyLevels.get(currentLevelSegment-1);\n\t\t\t\ttemp_diffsegment2 = (int) plannedDifficultyLevels.get(currentLevelSegment);\n\t\t\t}\n\t\t}\n\t\tplannedDifficultyLevels.clear();\n\n\t\t//System.out.println(\"-resetting to: \" + temp_diffsegment1 + \", \" + temp_diffsegment2);\n\t\tplannedDifficultyLevels.add(temp_diffsegment1);\n\t\tplannedDifficultyLevels.add(temp_diffsegment2);\n\t\tcurrentLevelSegment = 0;\n\n\t\tpaused = false;\n\t\tSprite.spriteContext = this;\n\t\tsprites.clear();\n\n\t\ttry {\n\t\t\tlevel2 = level2_reset.clone();\n\t\t} catch (CloneNotSupportedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\ttry {\n\t\t\tlevel3 = level3_reset.clone();\n\t\t} catch (CloneNotSupportedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n fixborders();\n\t\tconjoin();\n\n\t\tlayer = new LevelRenderer(level, graphicsConfiguration, 320, 240);\n\t\tfor (int i = 0; i < 2; i++)\n\t\t{\n\t\t\tint scrollSpeed = 4 >> i;\n\t\tint w = ((level.getWidth() * 16) - 320) / scrollSpeed + 320;\n\t\tint h = ((level.getHeight() * 16) - 240) / scrollSpeed + 240;\n\t\tLevel bgLevel = BgLevelGenerator.createLevel(w / 32 + 1, h / 32 + 1, i == 0, levelType);\n\t\tbgLayer[i] = new BgRenderer(bgLevel, graphicsConfiguration, 320, 240, scrollSpeed);\n\t\t}\n\n\t\tdouble oldX = 0;\n\t\tif(mario!=null)\n\t\t\toldX = mario.x;\n\n\t\tmario = new Mario(this);\n\t\tsprites.add(mario);\n\t\tstartTime = 1;\n\n\t\ttimeLeft = 200*15;\n\n\t\ttick = 0;\n\n\t\t/*\n\t\t * SETS UP ALL OF THE CHECKPOINTS TO CHECK FOR SWITCHING\n\t\t */\n\t\t switchPoints = new ArrayList<Double>();\n\n\t\t//first pick a random starting waypoint from among ten positions\n\t\tint squareSize = 16; //size of one square in pixels\n\t\tint sections = 10;\n\n\t\tdouble startX = 32; //mario start position\n\t\tdouble endX = level.getxExit()*squareSize; //position of the end on the level\n\t\t//if(!isCustom && recorder==null)\n level2.playValues = this.valueList[0];\n\t\t\trecorder = new DataRecorder(this,level3,keys);\n\t\t\t////System.out.println(\"\\n enemies LEFT : \" + recorder.level.COINS); //Sander disable\n\t\t\t////System.out.println(\"\\n enemies LEFT : \" + recorder.level.BLOCKS_COINS);\n\t\t\t////System.out.println(\"\\n enemies LEFT : \" + recorder.level.BLOCKS_POWER);\n\t\t\tgameStarted = false;\n\t}", "private Set func_177575_g() {\n/* 450 */ HashSet var1 = Sets.newHashSet();\n/* 451 */ ArrayList<?> var2 = Lists.newArrayList(this.variants.keySet());\n/* 452 */ Collections.sort(var2, new Comparator()\n/* */ {\n/* */ private static final String __OBFID = \"CL_00002390\";\n/* */ \n/* */ public int func_177505_a(ModelResourceLocation p_177505_1_, ModelResourceLocation p_177505_2_) {\n/* 457 */ return p_177505_1_.toString().compareTo(p_177505_2_.toString());\n/* */ }\n/* */ \n/* */ public int compare(Object p_compare_1_, Object p_compare_2_) {\n/* 461 */ return func_177505_a((ModelResourceLocation)p_compare_1_, (ModelResourceLocation)p_compare_2_);\n/* */ }\n/* */ });\n/* 464 */ Iterator<?> var3 = var2.iterator();\n/* */ \n/* 466 */ while (var3.hasNext()) {\n/* */ \n/* 468 */ ModelResourceLocation var4 = (ModelResourceLocation)var3.next();\n/* 469 */ ModelBlockDefinition.Variants var5 = (ModelBlockDefinition.Variants)this.variants.get(var4);\n/* 470 */ Iterator<ModelBlockDefinition.Variant> var6 = var5.getVariants().iterator();\n/* */ \n/* 472 */ while (var6.hasNext()) {\n/* */ \n/* 474 */ ModelBlockDefinition.Variant var7 = var6.next();\n/* 475 */ ModelBlock var8 = (ModelBlock)this.models.get(var7.getModelLocation());\n/* */ \n/* 477 */ if (var8 == null) {\n/* */ \n/* 479 */ LOGGER.warn(\"Missing model for: \" + var4);\n/* */ \n/* */ continue;\n/* */ } \n/* 483 */ var1.addAll(func_177585_a(var8));\n/* */ } \n/* */ } \n/* */ \n/* */ \n/* 488 */ var1.addAll(field_177602_b);\n/* 489 */ return var1;\n/* */ }", "public void differences(){\n\n\t\t/* Set the value of the initial differences to zero (it is calculated through\n\t\t * incrementing the variable) */\n\t\tfixeddifferences=0;\n\n\t\t/* For every cell in the cell space */\n\t\tfor (int i=0;i<GlobalAttributes.xCells;i++){\n\t\t\tfor(int j=0;j<GlobalAttributes.yCells;j++){\n\n\t\t\t\t/* If the value in the initial configuration differs from the value\n\t\t\t\t * in the target configuration */\n\t\t\t\tif(source[i][j].topSubcellValue != target[i][j].topSubcellValue ||\n\t\t\t\t\t\tsource[i][j].bottomSubcellValue != target[i][j].bottomSubcellValue ||\n\t\t\t\t\t\tsource[i][j].leftSubcellValue != target[i][j].leftSubcellValue ||\n\t\t\t\t\t\tsource[i][j].rightSubcellValue != target[i][j].rightSubcellValue){\n\n\t\t\t\t\t/* Set the value in the fixed initial difference matrix\n\t\t\t\t\t * to true and increment the fixed initial differences counter */\n\t\t\t\t\tfixeddifferent[i][j]=true;\n\t\t\t\t\tfixeddifferences++;\n\t\t\t\t}\n\n\t\t\t\t/* Else if the value does not differ, set the value in the\n\t\t\t\t * fixed initial differences matrix to false and do not increment\n\t\t\t\t * the fixed initial differences counter */\n\t\t\t\telse{\n\t\t\t\t\tfixeddifferent[i][j]=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void performTests() throws ModelManagementException {\n int count = VarModel.INSTANCE.getModelCount();\n UnloadTestModelLoader loader = new UnloadTestModelLoader();\n VarModel.INSTANCE.locations().addLocation(BASE, ProgressObserver.NO_OBSERVER);\n VarModel.INSTANCE.loaders().registerLoader(loader, ProgressObserver.NO_OBSERVER);\n // no model was loaded\n Assert.assertEquals(VarModel.INSTANCE.getModelCount(), count);\n // prepare all models\n for (ModelInfo<Project> info : loader.infos()) {\n Assert.assertTrue(loader.getProject(info) == VarModel.INSTANCE.load(info));\n }\n // no model was loaded\n Assert.assertEquals(VarModel.INSTANCE.getModelCount(), count + loader.infoCount());\n\n testUnloading(loader, \"f\", \"f\"); // f is not imported so it shall be unloaded\n testUnloading(loader, \"a\"); // a is imported so it shall not be unloaded\n testUnloading(loader, \"e\"); // e is imported so it shall not be unloaded\n testUnloading(loader, \"b\"); // b is imported and imports e so it shall not be unloaded\n testUnloading(loader, \"c\"); // c is imported so it shall not be unloaded\n testUnloading(loader, \"d\"); // d is imported so it shall not be unloaded\n testUnloading(loader, \"p1\", \"p1\", \"a\"); // p1 shall be unloaded, also a\n testUnloading(loader, \"p2\", \"p2\", \"c\"); // p2 shall be unloaded, also c\n testUnloading(loader, \"p3\", \"p3\", \"b\", \"e\"); // p3 shall be unloaded, also b and transitively e\n testUnloading(loader, \"p4\", \"p4\", \"d\"); // p4 shall be unloaded, as now d is not imported from other projects\n \n VarModel.INSTANCE.loaders().unregisterLoader(loader, ProgressObserver.NO_OBSERVER);\n VarModel.INSTANCE.locations().removeLocation(BASE, ProgressObserver.NO_OBSERVER);\n }", "@Test\n\tpublic void testGetStack() {\n\t\tip = new ImagePlus();\n\t\tst = ip.getStack();\n\t\tassertEquals(1,ip.getStackSize());\n\n\t\t// if stack == null and not proc == null and no info string\n\t\t// do stuff and setRoi() if needed\n\t\tproc = new ByteProcessor(1,1,new byte[] {22}, null);\n\t\tip = new ImagePlus(\"CareBearStation\",proc);\n\t\tst = ip.getStack();\n\t\tassertEquals(1,ip.getStackSize());\n\t\tassertNull(st.getSliceLabel(1));\n\t\tassertEquals(proc.getColorModel(),st.getColorModel());\n\t\tassertEquals(proc.getRoi(),st.getRoi());\n\n\t\t// if stack == null and not proc == null and yes info string\n\t\t// do stuff and setRoi() if needed\n\t\tproc = new ByteProcessor(1,1,new byte[] {22}, null);\n\t\tip = new ImagePlus(\"CareBearStation\",proc);\n\t\tip.setProperty(\"Info\",\"SnapDragon\");\n\t\tst = ip.getStack();\n\t\tassertEquals(1,ip.getStackSize());\n\t\tassertEquals(\"CareBearStation\\nSnapDragon\",st.getSliceLabel(1));\n\t\tassertEquals(proc.getColorModel(),st.getColorModel());\n\t\tassertEquals(proc.getRoi(),st.getRoi());\n\n\t\t// if not stack == null\n\t\t// do stuff and setRoi() if needed\n\t\tproc = new ByteProcessor(1,1,new byte[] {22}, null);\n\t\tip = new ImagePlus(\"CareBearStation\",proc);\n\t\tst = new ImageStack(1,1);\n\t\tst.addSlice(\"Fixed\", proc);\n\t\tst.addSlice(\"Crooked\", proc);\n\t\tip.setStack(\"Odds\",st);\n\t\tst = ip.getStack();\n\t\tassertEquals(2,ip.getStackSize());\n\t\tassertEquals(proc.getColorModel(),st.getColorModel());\n\t\tassertEquals(proc.getRoi(),st.getRoi());\n\t}", "final boolean init_stacks()\n{\n stateptr = -1;\n val_init();\n return true;\n}", "final boolean init_stacks()\n{\n stateptr = -1;\n val_init();\n return true;\n}", "final boolean init_stacks()\n{\n stateptr = -1;\n val_init();\n return true;\n}", "protected void recalculateSelectedCurves() {\n\t\tfor (int i = 0; i < selectedCurves.size(); ++i) {\n\t\t\tCurve c = selectedCurves.elementAt(i);\n\t\t\tAlgorithm temp = getAlgorithm(c.getType());\n\t\t\tif (temp != null) {\n\t\t\t\t// De oude gegevens verwijderen.\n\t\t\t\tselectionTool.deleteCurve(c);\n\t\t\t\tc.clearOutput();\n\t\t\t\ttry {\n\t\t\t\t\t// Nieuwe gegevens berekenen en opslaan.\n\t\t\t\t\ttemp.calculateComplete(c);\n\t\t\t\t\tselectionTool.addCurve(c);\n\t\t\t\t} catch (InvalidArgumentException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void showStacksVisualization() {\n\t\tsetVisualization(new StackVisualization(rootComposite, controller, checklist));\n\t}", "public void cleanUp() {\n logger.info(\"clean up...\");\n this.sequenceNo = calculateSequenceNumber();\n if (this.prevoteStore != null) {\n this.prevoteStore = this.prevoteStore.stream()\n .filter(i -> i.sequence_no >= this.sequenceNo)\n .collect(Collectors.toCollection(ArrayList::new));\n } else {\n this.prevoteStore = new ArrayList<>();\n }\n }" ]
[ "0.5131899", "0.48168126", "0.47813162", "0.46838826", "0.45952", "0.4534551", "0.45288855", "0.44857058", "0.44621515", "0.4450844", "0.43721744", "0.43576345", "0.433535", "0.43305254", "0.4279932", "0.42758366", "0.42620096", "0.4256342", "0.4241903", "0.42344424", "0.4234362", "0.42237374", "0.4222336", "0.4212967", "0.420492", "0.42024657", "0.42018113", "0.41887185", "0.4181281", "0.4178686", "0.41782784", "0.41723266", "0.4168215", "0.41681403", "0.4164895", "0.41625136", "0.41574505", "0.41557464", "0.41515836", "0.41409528", "0.4137897", "0.4135767", "0.41347995", "0.4132849", "0.41327527", "0.4130257", "0.41289937", "0.41259962", "0.41193685", "0.4116706", "0.41150922", "0.41092739", "0.4107168", "0.41013402", "0.41006634", "0.4098967", "0.40986502", "0.4096431", "0.40962484", "0.4094818", "0.4093595", "0.4089897", "0.40886506", "0.40874243", "0.4085931", "0.40857732", "0.4083547", "0.40828285", "0.4077737", "0.40775514", "0.40747258", "0.40694362", "0.40680975", "0.40676835", "0.40676716", "0.40604535", "0.40577778", "0.40547803", "0.4054715", "0.4050065", "0.40493274", "0.40491393", "0.40480474", "0.40420303", "0.40391102", "0.40349638", "0.4034454", "0.40321505", "0.40315533", "0.40252015", "0.40244037", "0.40209845", "0.4018242", "0.4011161", "0.40077338", "0.40077338", "0.40077338", "0.40072048", "0.40069366", "0.40039724" ]
0.72745025
0
TODO Autogenerated method stub
@Override public void command() { Shape r = new Rectangle(0, 0, p.getImage().getWidth(), p.getImage().getHeight()); r.setCenterX(p.getLoc().x + dx); r.setCenterY(p.getLoc().y + dy); System.out.println(commandBlockType); if (!m.isColliding(r)) { p.setColliding(false); p.getLoc().x+=dx; p.getLoc().y+=dy; } else { p.setColliding(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1
TODO Autogenerated method stub
@Override public void init(GameContainer c, RunState s) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
you are strongly suggested to build the index by installments you need to assign the new nonnegative integer docId to each document, which will be used in MyIndexReader
public void IndexADocument(String docno, String content) throws IOException { this.idWriter.write(docID+":"+docno); this.idWriter.newLine(); this.idWriter.flush(); String[] words = content.split(" "); HashMap<String,Integer> count = new HashMap<>(); for(String s:words){ count.put(s,count.getOrDefault(s,0)+1); } for(String key: count.keySet()){ if(this.map.containsKey(key)){ this.map.get(key).append(docID).append(":").append(count.get(key)).append(","); }else { StringBuilder sb = new StringBuilder(); this.map.put(key, sb.append(docID).append(":").append(count.get(key)).append(",")); } } docID++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void indexItem(IndexDocument indexDoc) {\n if(bDebug) System.out.println(\"\\n*** document to index - \" + indexDoc);\n Indexer indexer=null;\n try {\n indexer=new Indexer(PetstoreConstants.PETSTORE_INDEX_DIRECTORY, false);\n PetstoreUtil.getLogger().log(Level.FINE, \"Adding document to index: \" + indexDoc.toString());\n indexer.addDocument(indexDoc);\n } catch (Exception e) {\n PetstoreUtil.getLogger().log(Level.WARNING, \"index.exception\", e);\n e.printStackTrace();\n } finally {\n try {\n // must close file or will not be able to reindex\n if(indexer != null) {\n indexer.close();\n }\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n }", "void index(IDocument document, IIndexerOutput output) throws java.io.IOException;", "public void addDocument(Document d) throws IndexerException {\n\t\t\n\t//if (!isvaliddir) {System.out.println(\"INVALID PATH/execution !\");return;}\n\t\n\t\n\t//Tokenizing\n\t//one thgread\n\tDocID did=new DocID(d.getField(FieldNames.FILEID),\n\t\t\td.getField(FieldNames.CATEGORY),\n\t\t\td.getField(FieldNames.AUTHOR));\n\t\n\tTokenStream stream=tokenize(FieldNames.CATEGORY,d);\n\tAnalyzer analyz=analyze(FieldNames.CATEGORY, stream);\n\tCategoryIndex.getInst().doIndexing(did.getdID(), stream);\n\t/*\t}catch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);\n\t}\n\ttry{*/TokenStream stream1=tokenize(FieldNames.AUTHOR,d);\n\tAnalyzer analyz1=analyze(FieldNames.AUTHOR, stream1);\n\tAuthorIndex.getInst().doIndexing(did.getdID(), stream1);\n\t/*}catch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);}\n\ttry{*/TokenStream stream2=tokenize(FieldNames.PLACE,d);\n\tAnalyzer analyz2=analyze(FieldNames.PLACE, stream2);\n\tPlaceIndex.getInst().doIndexing(did.getdID(), stream2);\n/*}catch(Exception e)\n\t{\n\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t);}\n\ttry{*/tkizer = new Tokenizer();\n\tTokenStream stream3=tokenize(FieldNames.CONTENT,d);\n\tfactory = AnalyzerFactory.getInstance();\n\tAnalyzer analyz3=analyze(FieldNames.CONTENT, stream3);\n\tnew Indxr(IndexType.TERM).doIndexing(did, stream3);\n\t/*}\tcatch(Exception e)\n\t{\n\t\tif (e instanceof NullPointerException ||e instanceof StringIndexOutOfBoundsException\n\t\t\t\t||e instanceof ArrayIndexOutOfBoundsException ||e instanceof IllegalArgumentException\n\t\t\t\t);}\n\t*/\n\tdocs.add(did==null?\" \":did.toString());\n\t \n\t\na_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.AUTHOR);\nc_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.CATEGORY);\np_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.PLACE);\nt_indexrd= new IndexReader(System.getProperty(\"INDEX.DIR\"), IndexType.TERM);\n\t\t}", "LuceneMemoryIndex createLuceneMemoryIndex();", "public void init() {\n File file=new File(\"D:\\\\lucene\\\\index\");\n if(file.isDirectory())\n { //否则如果它是一个目录\n File files[] = file.listFiles(); //声明目录下所有的文件 files[];\n for(int i=0;i<files.length;i++)\n { //遍历目录下所有的文件\n files[i].delete(); //把每个文件 用这个方法进行迭代\n }\n }\n String indexPath = \"D:\\\\lucene\\\\index\";\n //String docsPath = \"D:\\\\lucene\\\\data\";\n boolean create = true;\n try\n {\n Session session=factory.openSession();\n String hql = \"from Book\";\n org.hibernate.Query query = session.createQuery(hql);\n List<Book> list=query.list();\n Directory indexDir = FSDirectory.open(Paths.get(\"D:\\\\lucene\\\\index\"));\n Analyzer luceneAnalyzer = new StandardAnalyzer(); //新建一个分词器实例 \n IndexWriterConfig config = new IndexWriterConfig(luceneAnalyzer); \n IndexWriter indexWriter = new IndexWriter(indexDir,config);\n for(int i=0;i<list.size();i++)\n {\n Document document = new Document();\n Field field1 = new StringField(\"id\",list.get(i).getBookid().toString(),Field.Store.YES); \n Field field2 = new StringField(\"bookname\",list.get(i).getBookname(),Field.Store.YES); \n Field field3 = new StringField(\"author\",list.get(i).getAuthor(),Field.Store.YES); \n Field field4 = new StringField(\"category\",list.get(i).getCategory(),Field.Store.YES); \n Field field5 = new StringField(\"price\", Double.toString(list.get(i).getPrice()),Field.Store.YES); \n document.add(field1); \n document.add(field2); \n document.add(field3); \n document.add(field4);\n document.add(field5);\n indexWriter.addDocument(document);\n }\n indexWriter.close();\n }\n catch(IOException e)\n {\n System.out.println(\"error\");\n return;\n }\n }", "indexSet createindexSet();", "private static Positional_inverted_index posindexCorpus(DocumentCorpus corpus) throws ClassNotFoundException, InstantiationException, IllegalAccessException, FileNotFoundException, IOException {\n\n NewTokenProcessor processor = new NewTokenProcessor();\n Iterable<Document> docs = corpus.getDocuments(); //call registerFileDocumentFactory first?\n\n List<Double> Doc_length = new ArrayList<>();\n Positional_inverted_index index = new Positional_inverted_index();\n\n double token_count = 0;\n\n // Iterate through the documents, and:\n for (Document d : docs) {\n //File f = new File(path + \"\\\\\" + d.getTitle());\n File f = new File(path + \"\\\\\" + d.getFileName().toString());\n double Filesize = f.length();\n //edited by bhavya\n double doc_weight = 0; //first entry in docweights.bin\n double doc_tokens = 0;\n double doc_length = 0;\n HashMap<String, Integer> tftd = new HashMap<>();\n // Tokenize the document's content by constructing an EnglishTokenStream around the document's content.\n Reader reader = d.getContent();\n EnglishTokenStream stream = new EnglishTokenStream(reader); //can access tokens through this stream\n N++;\n // Iterate through the tokens in the document, processing them using a BasicTokenProcessor,\n //\t\tand adding them to the HashSet vocabulary.\n Iterable<String> tokens = stream.getTokens();\n int i = 0;\n\n for (String token : tokens) {\n\n //adding token in index\n List<String> word = new ArrayList<String>();\n word = processor.processToken(token);\n //System.out.println(word.get(0));\n if (word.get(0).matches(\"\")) {\n continue;\n } else {\n\n index.addTerm(word.get(0), i, d.getId());\n\n }\n i = i + 1;\n\n //we check if token already exists in hashmap or not. \n //if it exists, increase its freq by 1 else make a new entry.\n if (tftd.containsKey(word.get(0))) {\n doc_tokens++;\n int count = tftd.get(word.get(0));\n tftd.replace(word.get(0), count + 1);\n } else {\n doc_tokens++;\n// token_count++; //gives total number of tokens.\n tftd.put(word.get(0), 1);\n }\n\n }\n double length = 0;\n double wdt = 0;\n\n double total_tftd = 0;\n for (Map.Entry<String, Integer> entry : tftd.entrySet()) {\n\n wdt = 1 + log(entry.getValue());\n\n length = length + pow(wdt, 2);\n total_tftd = total_tftd + entry.getValue();\n }\n token_count = token_count + doc_tokens;\n doc_weight = pow(length, 0.5);\n double avg_tftd = total_tftd / (double) tftd.size();\n\n Doc_length.add(doc_weight);\n Doc_length.add(avg_tftd);\n Doc_length.add(doc_tokens);\n Doc_length.add(Filesize);\n }\n Doc_length.add(token_count / N);\n\n DiskIndexWriter d = new DiskIndexWriter();\n d.write_doc(path, Doc_length);\n\n return index;\n }", "public void index(Map<Integer, Document> docs) {\r\n this.docs = docs;\r\n\r\n // index\r\n this.index.process(this.docs);\r\n\r\n // tf-idf model\r\n this.tfidf.inject(this.index, this.docs.size());\r\n this.tfidf.process();\r\n }", "public void index(List<ParsedDocument> pdocs,int qid) {\n\t\ttry {\n\t\t\tint count = iw.maxDoc()+1;\n\t\t\tDocument doc = null;\n\t\t\tIndexDocument iDoc=null;\n\t\t\tfor (ParsedDocument pdoc : pdocs) {\n\t\t\t\t\n\t\t\t\tiDoc=parseDocument(pdoc);\n\t\t\t\tif(iDoc==null){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tField queryField = new Field(\"qid\", qid+\"\", Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField uniqueField = new Field(\"id\", count + \"\", Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField titleField = new Field(\"title\", iDoc.getTitle(),\n\t\t\t\t\t\tStore.YES, Index.ANALYZED, TermVector.YES);\n\t\t\t\tField bodyField = new Field(\"body\", iDoc.getBody(), Store.YES,\n\t\t\t\t\t\tIndex.ANALYZED, TermVector.YES);\n\t\t\t\tField urlField = new Field(\"url\", iDoc.getUrl(), Store.YES,\n\t\t\t\t\t\tIndex.NOT_ANALYZED);\n\t\t\t\tField anchorField = new Field(\"anchor\", iDoc.getAnchor(), Store.YES,\n\t\t\t\t\t\tIndex.ANALYZED, TermVector.YES);\n\n\t\t\t\tdoc = new Document();\n\t\t\t\tdoc.add(uniqueField);//标示不同的document\n\t\t\t\tdoc.add(queryField);//标示不同的query\n\t\t\t\tdoc.add(titleField);\n\t\t\t\tdoc.add(bodyField);\n\t\t\t\tdoc.add(urlField);\n\t\t\t\tdoc.add(anchorField);\n\t\t\t\t\n\t\t\t\tiw.addDocument(doc);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tiw.commit();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "public interface ILuceneIndexDAO extends IStatefulIndexerSession {\n // ===================================================================\n // The domain of indexing creates a separation between\n // readers and writers. In lucene, these are searchers\n // and writers. This DAO creates the more familiar DAO-ish interface\n // for developers to use and attempts to hide the details of\n // the searcher and write.\n // Calls are stateless meaning calling a find after a save does\n // not guarantee data will be reflected for the instance of the DAO\n // ===================================================================\n\n /**\n * Updates a document by first deleting the document(s) containing a term and then adding the new document. A Term is created by termFieldName, termFieldValue.\n *\n * @param termFieldName - Field name of the index.\n * @param termFieldValue - Field value of the index.\n * @param document - Lucene document to be updated.\n * @return - True for successful addition.\n */\n boolean saveDocument(String termFieldName, String termFieldValue, Document document);\n\n /**\n * Generates a BooleanQuery from the given fields Map and uses it to delete the documents matching in the IndexWriter.\n *\n * @param fields - A Map data structure containing a field(Key) and text(value) pair.\n * @return - True for successful deletion.\n */\n boolean deleteDocuments(Map<String, String> fields);\n\n /**\n * Find the documents in the IndexSearcher matching the Terms generated from fields.\n *\n * @param fields - A Map data structure contains the field(Key) and text(value).\n * @return - Collection of Documents obtained from the search.\n */\n Set<Document> findDocuments(Map<String, String> fields);\n\n /**\n * Find the documents in the IndexSearcher matching the Terms generated from fields. Offset is the starting position for the search and numberOfResults\n * is the length from offset position.\n *\n * @param fields - A Map data structure containing a field(Key) and text(value) pair.\n * @param offset - Starting position of the search.\n * @param numberOfResults - Number of documents to be searched from an offset position.\n * @return - Collection of Documents obtained from the search.\n */\n Set<Document> findDocuments(Map<String, String> fields, int offset, int numberOfResults);\n\n /**\n * Return the count of the documents present in the IndexSearcher.\n *\n * @return - Integer representing the count of documents.\n */\n int getDocumentCount();\n\n}", "public IndexableDocument() {\n\t\tthis.id=new ObjectId();\n\t}", "public SearchDocuments(String indexPath) throws IOException{\r\n this.setIndexPath(indexPath); \r\n \r\n //TO DO : add config.properties file\r\n //read configuration file and update static variables adequately\r\n// readConf();\r\n\r\n // Supported index Fields and their pubmed counterpart (\"Title\",\"ArticleTitle\") \r\n supportedIndexFields.put(\"Title\", \"ArticleTitle\");\r\n supportedIndexFields.put(\"TI\", \"ArticleTitle\");\r\n supportedIndexFields.put(\"Abstract\", \"AbstractText\");\r\n supportedIndexFields.put(\"AB\", \"AbstractText\");\r\n supportedIndexFields.put(\"PMID\", \"PMID\");\r\n supportedIndexFields.put(\"UID\", \"PMID\");\r\n //TO DO : add all supported index fields\r\n //TO DO : special words (i.e. nothascommenton etc) \r\n \r\n // Lucene objects\r\n \r\n /* Sorting */\r\n // Fields used for reverse chronological sorting of results\r\n // This Fields are indexed with no tokenization (for each element a StringField AND a SortedDocValuesField are added)\r\n // Using SortField.Type.STRING is valid (as an exception) beacause years are 4-digit numbers resulting in identical String-sorting and number-sorting.\r\n SortField sortFieldYear = new SortField(\"PubDate-Year\", SortField.Type.STRING, true);\r\n \r\n //TO DO : make custom comparators for the rest fields where lexilogical comparison is not valid\r\n // OR, store Pud Date as Date and use date comparison\r\n // Idealy one \"complex-field\" should be used for sorting, taking into account Year, Month, Day, Season and MedlineDate together)\r\n// SortField sortFieldMonth = new SortField(\"PubDate-Month\",SortField.Type.STRING,true);\r\n// SortField sortFieldDay = new SortField(\"PubDate-Day\",SortField.Type.STRING,true);\r\n// SortField sortFieldSeason = new SortField(\"PubDate-Season\",SortField.Type.STRING,true);\r\n// SortField sortFieldMedlineDate = new SortField(\"PubDate-MedlineDate\",SortField.Type.STRING,true);\r\n// this.setSort(new Sort(sortFieldYear, sortFieldMonth, sortFieldDay, sortFieldSeason, sortFieldMedlineDate));\r\n this.setSort(new Sort(sortFieldYear));\r\n \r\n /* Reading the index */\r\n// this.setReader(DirectoryReader.open(FSDirectory.open(Paths.get(getIndexPath()))));\r\n this.setReader(DirectoryReader.open(MMapDirectory.open(Paths.get(getIndexPath()))));\r\n this.setSearcher(new IndexSearcher(getReader()));\r\n this.setAnalyzer(new StandardAnalyzer());\r\n \r\n /* Caching */\r\n // these cache and policy instances can be shared across several queries and readers\r\n // it is fine to eg. store them into static variables\r\n // TO DO: Use stored (old) expert-queries (from mongoDB) and MESH terms to \"prepare\" cache.\r\n queryCache = new LRUQueryCache(maxNumberOfCachedQueries, maxRamBytesUsed);\r\n// defaultCachingPolicy = new UsageTrackingQueryCachingPolicy();\r\n defaultCachingPolicy = new QueryCachingPolicy.CacheOnLargeSegments(minIndexSize, minSizeRatio);\r\n this.getSearcher().setQueryCache(queryCache);\r\n this.getSearcher().setQueryCachingPolicy(defaultCachingPolicy);\r\n \r\n /* All fields as default for search */\r\n Iterator <String> allFieldsIterator = org.apache.lucene.index.MultiFields.getFields(reader).iterator();\r\n ArrayList <String> a = new ArrayList();\r\n String current = \"\";\r\n while(allFieldsIterator.hasNext()){\r\n current = allFieldsIterator.next();\r\n if(!current.startsWith(\"PubDate-\")){\r\n a.add(current);\r\n }\r\n }\r\n \r\n String[] allFields = new String[a.size()];\r\n allFields = a.toArray(allFields); //All index fields to be used as default search fields\r\n this.setParser( new MultiFieldQueryParser( allFields, getAnalyzer())); \r\n }", "InstAssignIndex createInstAssignIndex();", "public interface IndexDocsInES {\n\n void indexDocs(Client client, String index_name, String type_name, List<Pair> docs);\n}", "public void indexCreate()\n {\n try{\n Directory dir = FSDirectory.open(Paths.get(\"indice/\"));\n Analyzer analyzer = new StandardAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n iwc.setOpenMode(OpenMode.CREATE);\n IndexWriter writer = new IndexWriter(dir,iwc);\n MongoConnection mongo = MongoConnection.getMongo();\n mongo.OpenMongoClient();\n DBCursor cursor = mongo.getTweets();\n Document doc = null;\n\n while (cursor.hasNext()) {\n DBObject cur = cursor.next();\n if (cur.get(\"retweet\").toString().equals(\"false\")) {\n doc = new Document();\n doc.add(new StringField(\"id\", cur.get(\"_id\").toString(), Field.Store.YES));\n doc.add(new TextField(\"text\", cur.get(\"text\").toString(), Field.Store.YES));\n doc.add(new StringField(\"analysis\", cur.get(\"analysis\").toString(), Field.Store.YES));\n //doc.add(new StringField(\"finalCountry\",cur.get(\"finalCountry\").toString(),Field.Store.YES));\n doc.add(new StringField(\"userScreenName\", cur.get(\"userScreenName\").toString(), Field.Store.YES));\n doc.add(new StringField(\"userFollowersCount\", cur.get(\"userFollowersCount\").toString(), Field.Store.YES));\n doc.add(new StringField(\"favoriteCount\", cur.get(\"favoriteCount\").toString(), Field.Store.YES));\n\n if (writer.getConfig().getOpenMode() == OpenMode.CREATE) {\n System.out.println(\"Indexando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.addDocument(doc);\n System.out.println(doc);\n } else {\n System.out.println(\"Actualizando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.updateDocument(new Term(\"text\" + cur.get(\"text\")), doc);\n System.out.println(doc);\n }\n }\n }\n cursor.close();\n writer.close();\n }\n catch(IOException ioe){\n System.out.println(\" Error en \"+ ioe.getClass() + \"\\n mensaje: \" + ioe.getMessage());\n }\n }", "public interface BoostingIndexer {\r\n\t/**\r\n\t * Add a new {@link Document} to the Index or update an existing one.<br> \r\n\t * When adding a document, its dynamic boosts values must be set. Specifying the values is accomplished by\r\n\t * passing the dynamicBoosts parameter with a Map from the boost index (zero based) to the boost value (a <code>double</code>).\r\n\t * In this map, no index can be larger than the number of available boosts the {@link IndexEngine}'s {@link Scorer} has, minus one (since it is zero based).\r\n\t * The value for any available boost index not specified in the map is defaulted to zero. \r\n\t * \r\n\t * @param docId external (customer) identifier of the document to add\r\n\t * @param document the {@link Document} to add\r\n\t * @param timestampBoost a <code>float</code> representing the time of the document (the younger the document, the larger the boost should be)\r\n\t * @param dynamicBoosts a Map from the boost index (zero based) to the boost value (a <code>double</code>).\r\n\t * @throws {@link IllegalArgumentException} if an invalid index is passed for a boost \r\n\t */\r\n\tpublic void add(String docId, Document document, int timestampBoost, Map<Integer, Double> dynamicBoosts);\r\n\r\n\t/**\r\n\t * Remove a document from the index.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document to remove\r\n\t */\r\n\tpublic void del(String docId);\r\n\t\r\n\t/**\r\n\t * Update the special boost for the timestamp\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param timestampBoost a <code>float</code> representing the time of the document (the younger the document, the larger the boost should be)\r\n\t */\r\n\tpublic void updateTimestamp(String docId, int timestampBoost);\r\n\t\r\n\t/**\r\n\t * Update one or more of the dynamic boosts values.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param updatedBoosts a Map from the boost index (zero based) to the boost value (a <code>double</code>). No index can be larger than the available boosts the {@link IndexEngine}'s {@link Scorer} has, minus one (since it is zero based)\r\n\t * @throws {@link IllegalArgumentException} if an invalid index is passed for a boost \r\n\t */\r\n\tpublic void updateBoosts(String docId, Map<Integer, Double> updatedBoosts);\r\n\r\n public void updateCategories(String docId, Map<String, String> categories);\r\n\t/**\r\n\t * Promote a document to be the first result for a specific query.\r\n\t * \r\n\t * @param docId external (customer) identifier of the document\r\n\t * @param query the exact query the document must be promoted to the first result for\r\n\t */\r\n public void promoteResult(String docId, String query);\r\n\r\n /**\r\n * Dumps the current state to disk.\r\n */\r\n public void dump() throws IOException;\r\n\r\n public void addScoreFunction(int functionIndex, String definition) throws Exception;\r\n\r\n public void removeScoreFunction(int functionIndex);\r\n\r\n public Map<Integer,String> listScoreFunctions();\r\n \r\n public Map<String, String> getStats();\r\n\r\n}", "public void testCreIdx(){\r\n\t \r\n\t String dataDir = \"C:\\\\study\\\\Lucene\\\\Data\";\r\n\t String idxDir = \"C:\\\\study\\\\Lucene\\\\Index\";\r\n\t \r\n\t LuceneUtils.delAll(idxDir);\r\n\t \r\n\t CreateIndex ci = new CreateIndex();\r\n\t \r\n\t ci.Indexer(new File(idxDir), new File(dataDir));\r\n\t \r\n\t\t\r\n\t}", "void addIndexForRepository(long repositoryId);", "public interface InvertedIndex extends Serializable {\n\n\n /**\n * Sampling for creating mini batches\n * @return the sampling for mini batches\n */\n double sample();\n\n /**\n * Iterates over mini batches\n * @return the mini batches created by this vectorizer\n */\n Iterator<List<VocabWord>> miniBatches();\n\n /**\n * Returns a list of words for a document\n * @param index\n * @return\n */\n List<VocabWord> document(int index);\n\n /**\n * Returns the list of documents a vocab word is in\n * @param vocabWord the vocab word to get documents for\n * @return the documents for a vocab word\n */\n int[] documents(VocabWord vocabWord);\n\n /**\n * Returns the number of documents\n * @return\n */\n int numDocuments();\n\n /**\n * Returns a list of all documents\n * @return the list of all documents\n */\n int[] allDocs();\n\n\n\n /**\n * Add word to a document\n * @param doc the document to add to\n * @param word the word to add\n */\n void addWordToDoc(int doc,VocabWord word);\n\n\n /**\n * Adds words to the given document\n * @param doc the document to add to\n * @param words the words to add\n */\n void addWordsToDoc(int doc,List<VocabWord> words);\n\n\n /**\n * Finishes saving data\n */\n void finish();\n\n /**\n * Total number of words in the index\n * @return the total number of words in the index\n */\n int totalWords();\n\n /**\n * For word vectors, this is the batch size for which to train on\n * @return the batch size for which to train on\n */\n int batchSize();\n\n /**\n * Iterate over each document\n * @param func the function to apply\n * @param exec exectuor service for execution\n */\n void eachDoc(Function<List<VocabWord>, Void> func, ExecutorService exec);\n}", "private void indexDocumentHelper(HashMap<String, StringBuilder> fm)\n\t\t\tthrows IOException {\n\n\t\tIndexWriter writer = getIndexWriter();\n\n\t\tDocument doc = new Document();\n\n\t\tfor (int i = 0; i < fieldNames.length; i++) {\n\n\t\t\tif (fieldNames[i].equals(\"DOCNO\")) {\n\n\t\t\t\tdoc.add(new StringField(fieldNames[i], fm.get(fieldNames[i])\n\t\t\t\t\t\t.toString(), Field.Store.YES));\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tdoc.add(new TextField(fieldNames[i], fm.get(fieldNames[i])\n\t\t\t\t\t\t.toString(), Field.Store.YES));\n\t\t\t}\n\t\t}\n\n\t\twriter.addDocument(doc);\n\n\t}", "private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }", "IndexedDocument indexDocument(String name, String type, String id, CharSequence document)\n throws ElasticException;", "private void indexUpdates(UpdateQueryResult updates) {\r\n Iterator<HashMap<String, String>> i = updates.getIterator();\r\n while (i.hasNext()) {\r\n HashMap<String, String> values = i.next();\r\n \r\n \t// during index default solr fields are indexed separately\r\n \tString articleId = values.get(\"KnowledgeArticleId\");\r\n \tString title = values.get(\"Title\");\r\n \tvalues.remove(\"Title\");\r\n \tString summary = values.get(\"Summary\");\r\n \tvalues.remove(\"Summary\");\r\n \t\r\n \ttry {\r\n \t\tif (UtilityLib.notEmpty(articleId) && UtilityLib.notEmpty(title)) {\r\n \t\t\t// index sObject\r\n \t\t\t// default fields every index must have\r\n \t\t\tStringBuilder sb = new StringBuilder();\r\n \t\t\tContent c = new Content();\r\n \t\t\tc.setKey(articleId);\r\n \t\t\tsb.setLength(0);\r\n \t\t\tsb.append(summary);\r\n \t\t\tc.setData(sb.toString().getBytes());\r\n \t\t\tc.addMetadata(\"Content-Type\", \"text/html\");\r\n \t\t\tc.addMetadata(\"title\", title);\r\n \t\t\t\r\n \t\t\tLOG.debug(\"Salesforce Crawler: Indexing articleId=\"+articleId+\" title=\"+title+\" summary=\"+summary);\r\n \t\t\t\r\n \t\t\t// index articleType specific fields\r\n \t\t\tfor (Entry<String, String> entry : values.entrySet()) {\r\n \t\t\t\tc.addMetadata(entry.getKey(), entry.getValue().toString());\r\n \t\t\t\tif (!entry.getKey().equals(\"Attachment__Body__s\")) {\r\n \t\t\t\t\tLOG.debug(\"Salesforce Crawler: Indexing field key=\"+entry.getKey()+\" value=\"+entry.getValue().toString());\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tstate.getProcessor().process(c);\r\n \t\t}\r\n } catch (Exception e) {\r\n \tUtilityLib.errorException(LOG, e);\r\n \tstate.getStatus().incrementCounter(Counter.Failed);\r\n }\r\n }\r\n }", "public interface IndexBuilder {\n\n /**\n * Rebuilds the index only when the existing index is not populated.\n */\n void rebuildIfNecessary();\n\n}", "public void renewPreIndex(List<String> docs) {\r\n this.preIndex = new Index();\r\n IndexWriter iw = this.getIndexWriter(this.preIndex);\r\n this.logger.trace(\"Renewed preIndex\");\r\n docs.forEach(e -> iw.addDocument(new Document(e)));\r\n }", "public void index(final Document doc) {\t\n\t\ttry {\n\t\t\t_reopenToken = _trackingIndexWriter.addDocument(doc);\n\t\t\tlog.debug(\"document indexed in lucene\");\n\t\t} catch(IOException ioEx) {\n\t\t\tlog.error(\"Error while in Lucene index operation: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t \t\t ioEx);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t_indexWriter.commit();\n\t\t\t} catch (IOException ioEx) {\n\t\t\t\tlog.error(\"Error while commiting changes to Lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t \t\t\t\t\t ioEx);\n\t\t\t}\n\t\t}\n\t}", "private void createProductIndex() {\n\t\tLinkedList<String> ids = new LinkedList<>(productIds.keySet());\n\t\tArrayList<ArrayList<Integer>> vals = new ArrayList<>(productIds.values());\n\t\tint k = 8;\n\t\tKFront kf = new KFront();\n\t\tkf.createKFront(k, ids);\n\t\tfor (int i = 0; i < vals.size(); i++) {\n\t\t\tkf.getTable().get(i).addAll(vals.get(i));\n\t\t}\n\n\t\tProductIndex pIndex = new ProductIndex(k);\n\t\tpIndex.insertData(kf.getTable(), kf.getConcatString());\n\t\tsaveToDir(PRODUCT_INDEX_FILE, pIndex);\n\t}", "public static synchronized void indexDocument(CodeIndexDocument codeIndexDocument) throws IOException {\n Queue<CodeIndexDocument> queue = new ConcurrentLinkedQueue<CodeIndexDocument>();\n queue.add(codeIndexDocument);\n indexDocuments(queue);\n queue = null;\n }", "public void IndexADocument(String docno, String content) throws IOException {\n\t\tdocid++;\n\t\tdoc2docid.put(docno, docid);\n\t\tdocid2doc.put(docid, docno);\n\n\t\t// Insert every term in this doc into docid2map\n\t\tString[] terms = content.trim().split(\" \");\n\t\tMap<Integer, Integer> docTerm = new HashMap<>();\n\t\tint thisTermid;\n\t\tfor(String term: terms){\n\t\t\t// get termid\n\t\t\tif(term2termid.get(term)!=null) thisTermid = term2termid.get(term);\n\t\t\telse{\n\t\t\t\tthisTermid = ++termid;\n\t\t\t\tterm2termid.put(term, thisTermid);\n\t\t\t}\n\t\t\tdocTerm.put(thisTermid, docTerm.getOrDefault(thisTermid, 0)+1);\n\t\t\t// Merge this term's information into termid2map\n\t\t\tMap<Integer, Integer> temp = termid2map.getOrDefault(thisTermid, new HashMap());\n\t\t\ttemp.put(docid, temp.getOrDefault(docid, 0)+1);\n\t\t\ttermid2map.put(thisTermid, temp);\n\t\t\ttermid2fre.put(thisTermid, termid2fre.getOrDefault(thisTermid, 0)+1);\n\t\t}\n\t\tdocid2map.put(docid, docTerm);\n\n//\t\t// Merge all the terms' information into termid2map\n//\t\tfor(Long tid: docTerm.keySet()){\n//\t\t\tMap<Long, Long> temp = termid2map.getOrDefault(tid, new HashMap());\n//\t\t\ttemp.put(docid,docTerm.get(tid));\n//\t\t\ttermid2map.put(tid, temp);\n//\t\t\t// update this term's frequency\n//\t\t\ttermid2fre.put(tid, termid2fre.getOrDefault(tid,0L)+docTerm.get(tid));\n//\t\t}\n\n\t\t// When termid2map and docid2map is big enough, put it into disk\n\t\tif(docid%blockSize==0){\n\t\t\tWritePostingFile();\n\t\t\tWriteDocFile();\n\t\t}\n\t}", "IndexedDocument indexDocument(\n String name,\n String type,\n String id,\n CharSequence document,\n long epochMillisUtc) throws ElasticException;", "public boolean shouldIndex(IDocument document);", "public generateIndex() {\n\n\t\tthis.analyzer = \"StandardAnalyzer\";\n\t}", "@Override\r\n\tprotected void indexDocument(PluginServiceCallbacks callbacks, JSONResponse jsonResults, HttpServletRequest request,\r\n\t\t\tIndexing indexing) throws Exception {\n\t\t\r\n\t}", "private void createReviewIndex() {\n\t\t// Revise the review dictionary to the correct structure & change productIDs to product index\n\t\tLinkedList<List<Integer>> dictValues = new LinkedList<>();\n\t\tfor (int review : reviewIds.keySet()) {\n\t\t\tArrayList<String> vals = reviewIds.get(review);\n\t\t\tArrayList<Integer> new_vals = new ArrayList<>(List.of(0, 0, 0, 0, 0));\n\t\t\tnew_vals.set(ReviewIndex.PRODUCTID_INDEX, productIds.headMap(vals.get(0)).size());\n\t\t\tString[] helpf = vals.get(2).split(\"/\");\n\t\t\tnew_vals.set(ReviewIndex.HELPFNUM_INDEX, Integer.parseInt(helpf[0]));\n\t\t\tnew_vals.set(ReviewIndex.HELPFDNOM_INDEX, Integer.parseInt(helpf[1]));\n\t\t\tnew_vals.set(ReviewIndex.REVIEWLENGTH_INDEX, Integer.parseInt(vals.get(3)));\n\t\t\tnew_vals.set(ReviewIndex.SCORE_INDEX, (int) Float.parseFloat(vals.get(1)));\n\t\t\tdictValues.add(new_vals);\n\t\t}\n\t\tReviewIndex rIndex = new ReviewIndex();\n\t\trIndex.insertData(dictValues);\n\n\t\tsaveToDir(REVIEW_INDEX_FILE, rIndex);\n\t}", "private void init(int bytesPerId, int bytesPerType, int bytesPerPath) throws IOException {\n this.indexVersion = INDEX_VERSION;\n this.bytesPerId = bytesPerId;\n this.bytesPerType = bytesPerType;\n this.bytesPerPath = bytesPerPath;\n this.bytesPerSlot = bytesPerId + bytesPerType + bytesPerPath;\n this.entries = 0;\n \n logger.info(\"Creating uri index with {} bytes per entry\", bytesPerSlot);\n \n // Write header\n idx.seek(IDX_START_OF_HEADER);\n idx.writeInt(indexVersion);\n idx.writeInt(bytesPerId);\n idx.writeInt(bytesPerType);\n idx.writeInt(bytesPerPath);\n idx.writeLong(slots);\n idx.writeLong(entries);\n \n // If this file used to contain entries, we just null out the rest\n try {\n byte[] bytes = new byte[bytesPerSlot - 2];\n while (idx.getFilePointer() < idx.length()) {\n idx.writeChar('\\n');\n idx.write(bytes);\n }\n } catch (EOFException e) {\n // That's ok, we wanted to write until the very end\n }\n \n logger.debug(\"Uri index created\");\n }", "@Override\n\tpublic void build(Index index) {\n\t\tthis.indexdir = index.getPath();\n\t\tLuceneIndex luceneIndex = (LuceneIndex) index;\n\t\tthis.indexSearcher = new IndexSearcher(luceneIndex.getReader());\n\n\t}", "@Test\r\n\tpublic void indexOneLater() throws Exception {\n\t\tSolrInputDocument sd = new SolrInputDocument();\r\n\t\tsd.addField(\"id\", \"addone\");\r\n\t\tsd.addField(\"channelid\", \"9999\");\r\n\t\tsd.addField(\"topictree\", \"tptree\");\r\n\t\tsd.addField(\"topicid\", \"tpid\");\r\n\t\tsd.addField(\"dkeys\", \"测试\");\r\n\t\tsd.addField(\"title\", \"junit 标题\");\r\n\t\tsd.addField(\"ptime\", new Date());\r\n\t\tsd.addField(\"url\", \"/junit/test/com\");\r\n//\t\t\tSystem.out.println(doc);\r\n//\t\tbuffer.add(sd);\r\n\t\tdocIndexer.addDocumentAndCommitLater(sd, 1);\r\n\t}", "protected void constructIndex(DocumentInfo doc, Map index,\n KeyDefinition keydef,\n BuiltInAtomicType soughtItemType,\n Set foundItemTypes, XPathContext context,\n boolean isFirst)\n throws XPathException \n {\n PatternFinder match = keydef.getMatch();\n if (match instanceof NodeTestPattern) {\n match = new FastNodeTestPattern(((NodeTestPattern)match).getNodeTest());\n KeyDefinition oldDef = keydef;\n keydef = new KeyDefinition(match, \n oldDef.getUse(),\n oldDef.getCollationName(), \n oldDef.getCollation());\n }\n super.constructIndex(doc, index, keydef, soughtItemType,\n foundItemTypes, context, isFirst);\n }", "public void indexDocument(String documentName, ArrayList<String> documentTokens) {\n for (String token : documentTokens) {\n if (!this.index.containsKey(token)) {\n // Create a key with that token\n this.index.put(token, new HashMap<>());\n }\n\n // Get the HashMap associated with that term\n HashMap<String, Integer> term = this.index.get(token);\n\n // Check if term has a posting for the document\n if (term.containsKey(documentName)) {\n // Increase its occurrence by 1\n int occurrences = term.get(documentName);\n term.put(documentName, ++occurrences);\n } else {\n // Create a new posting for the term\n term.put(documentName, 1);\n }\n }\n }", "private void buildPKIndex() {\n // index PK\n Collection<DbAttribute> pks = getResolver()\n .getEntity()\n .getDbEntity()\n .getPrimaryKeys();\n this.idIndices = new int[pks.size()];\n\n // this is needed for checking that a valid index is made\n Arrays.fill(idIndices, -1);\n\n Iterator<DbAttribute> it = pks.iterator();\n for (int i = 0; i < idIndices.length; i++) {\n DbAttribute pk = it.next();\n\n for (int j = 0; j < columns.length; j++) {\n if (pk.getName().equals(columns[j].getName())) {\n idIndices[i] = j;\n break;\n }\n }\n\n // sanity check\n if (idIndices[i] == -1) {\n throw new CayenneRuntimeException(\"PK column is not part of result row: %s\", pk.getName());\n }\n }\n }", "@Override\n public void postInserts() \n {\n for(IndexObject i: myIndex.values())\n {\n i.tfidf(documentData);\n }\n }", "@Ignore \n @Test\n public void testIndexDocument() {\n System.out.println(\"IndexDocument\");\n Client client = null;\n String indexName = \"\";\n String indexTypeName = \"\";\n String docId = \"\";\n Map<String, Object> jsonMap = null;\n long expResult = 0L;\n //long result = ESUtil.indexDocument(client, indexName, indexTypeName, docId, jsonMap);\n //assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static synchronized void indexDocuments(Queue<CodeIndexDocument> codeIndexDocumentQueue) throws IOException {\n // Index all documents and commit at the end for performance gains\n Directory dir = FSDirectory.open(Paths.get(Properties.getProperties().getProperty(Values.INDEXLOCATION, Values.DEFAULTINDEXLOCATION)));\n Directory facetsdir = FSDirectory.open(Paths.get(Properties.getProperties().getProperty(Values.FACETSLOCATION, Values.DEFAULTFACETSLOCATION)));\n\n Analyzer analyzer = new CodeAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n FacetsConfig facetsConfig = new FacetsConfig();\n SearchcodeLib scl = new SearchcodeLib();\n\n iwc.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND);\n\n IndexWriter writer = new IndexWriter(dir, iwc);\n TaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(facetsdir);\n\n\n try {\n CodeIndexDocument codeIndexDocument = codeIndexDocumentQueue.poll();\n int count = 0;\n\n while (codeIndexDocument != null) {\n Singleton.getLogger().info(\"Indexing file \" + codeIndexDocument.getRepoLocationRepoNameLocationFilename());\n Singleton.decrementCodeIndexLinesCount(codeIndexDocument.getCodeLines());\n\n Document doc = new Document();\n // Path is the primary key for documents\n // needs to include repo location, project name and then filepath including file\n Field pathField = new StringField(\"path\", codeIndexDocument.getRepoLocationRepoNameLocationFilename(), Field.Store.YES);\n doc.add(pathField);\n\n // Add in facets\n facetsConfig = new FacetsConfig();\n facetsConfig.setIndexFieldName(Values.LANGUAGENAME, Values.LANGUAGENAME);\n facetsConfig.setIndexFieldName(Values.REPONAME, Values.REPONAME);\n facetsConfig.setIndexFieldName(Values.CODEOWNER, Values.CODEOWNER);\n\n if (Helpers.isNullEmptyOrWhitespace(codeIndexDocument.getLanguageName()) == false) {\n doc.add(new SortedSetDocValuesFacetField(Values.LANGUAGENAME, codeIndexDocument.getLanguageName()));\n }\n if (Helpers.isNullEmptyOrWhitespace(codeIndexDocument.getRepoName()) == false) {\n doc.add(new SortedSetDocValuesFacetField(Values.REPONAME, codeIndexDocument.getRepoName()));\n }\n if (Helpers.isNullEmptyOrWhitespace(codeIndexDocument.getCodeOwner()) == false) {\n doc.add(new SortedSetDocValuesFacetField(Values.CODEOWNER, codeIndexDocument.getCodeOwner()));\n }\n\n String indexContents = Values.EMPTYSTRING;\n\n Singleton.getLogger().info(\"Splitting keywords\");\n indexContents += scl.splitKeywords(codeIndexDocument.getContents());\n Singleton.getLogger().info(\"Cleaning pipeline\");\n indexContents += scl.codeCleanPipeline(codeIndexDocument.getContents());\n Singleton.getLogger().info(\"Adding to spelling corrector\");\n scl.addToSpellingCorrector(codeIndexDocument.getContents()); // Store in spelling corrector\n\n indexContents = indexContents.toLowerCase();\n\n doc.add(new TextField(Values.REPONAME, codeIndexDocument.getRepoName(), Field.Store.YES));\n doc.add(new TextField(Values.FILENAME, codeIndexDocument.getFileName(), Field.Store.YES));\n doc.add(new TextField(Values.FILELOCATION, codeIndexDocument.getFileLocation(), Field.Store.YES));\n doc.add(new TextField(Values.FILELOCATIONFILENAME, codeIndexDocument.getFileLocationFilename(), Field.Store.YES));\n doc.add(new TextField(Values.MD5HASH, codeIndexDocument.getMd5hash(), Field.Store.YES));\n doc.add(new TextField(Values.LANGUAGENAME, codeIndexDocument.getLanguageName(), Field.Store.YES));\n doc.add(new IntField(Values.CODELINES, codeIndexDocument.getCodeLines(), Field.Store.YES));\n doc.add(new TextField(Values.CONTENTS, indexContents, Field.Store.NO));\n doc.add(new TextField(Values.REPOLOCATION, codeIndexDocument.getRepoRemoteLocation(), Field.Store.YES));\n doc.add(new TextField(Values.CODEOWNER, codeIndexDocument.getCodeOwner(), Field.Store.YES));\n\n // Extra metadata in this case when it was last indexed\n doc.add(new LongField(Values.MODIFIED, new Date().getTime(), Field.Store.YES));\n\n writer.updateDocument(new Term(Values.PATH, codeIndexDocument.getRepoLocationRepoNameLocationFilename()), facetsConfig.build(taxoWriter, doc));\n\n count++;\n if (count >= 1000) { // Only index 1000 documents at most each time\n codeIndexDocument = null;\n }\n else {\n codeIndexDocument = codeIndexDocumentQueue.poll();\n }\n\n }\n }\n finally {\n Singleton.getLogger().info(\"Closing writers\");\n writer.close();\n taxoWriter.close();\n }\n }", "private void createInvertedIndex() {\n\t\tArrayList<Index> invertedIndex=new ArrayList<>();\n\t\ttry{\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(\"E:\\\\graduate\\\\cloud\\\\project\\\\data\\\\part-r-00001\"));\n\t\t\tString line = \"\";\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\tString parts[] = line.split(\"\\t\");\n\t\t\t\tparts[1]=parts[1].replace(\"{\", \"\").replace(\"}\", \"\");\n\t\t\t\tString counts[]=parts[1].split(\",\");\n\t\t\t\tHashMap<String,Integer> fileList=new HashMap<String,Integer>();\n\t\t\t\tfor (String count : counts) {\n\t\t\t\t\tString file[]=count.split(\"=\");\n\t\t\t\t\tfileList.put(file[0].trim().replace(\".txt\", \"\"), Integer.parseInt(file[1].trim()));\n\t\t\t\t}\n\t\t\t\tIndex index=new Index();\n\t\t\t\tindex.setWord(parts[0]);\n\t\t\t\tindex.setFileList(fileList);\n\t\t\t\tinvertedIndex.add(index);\n\t\t\t}\n\t\t\tin.close();\n\t\t}catch(IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tDBUtil.insertIndex(invertedIndex);\n\t}", "public interface Indexed {\n\n /**\n * index keyword and resource\n * @param resourceId keyword KAD id\n * @param entry published entry with keyword information\n * @param lastActivityTime current time from external system\n * @return percent of taken place in storage\n */\n int addKeyword(final KadId resourceId, final KadSearchEntry entry, long lastActivityTime);\n\n /**\n *\n * @param resourceId file KAD id\n * @param entry published entry with source information\n * @return true if source was indexed\n */\n int addSource(final KadId resourceId, final KadSearchEntry entry, long lastActivityTime);\n}", "private HashMap<String, HashSet<String>> convertIndexToMap(IndexReader reader) throws IOException{\n\t\t HashMap<String, HashSet<String>> hmap = new HashMap<String, HashSet<String>>();\n\t\t HashSet<String> docIdSet;\n\t\t \n\t\t for(int i=0; i<reader.numDocs(); i++){\n\t\t\t Fields termVect = reader.getTermVectors(i);\n\n\t\t\t if(termVect == null)\n\t\t\t\t continue;\n\t\t\t \n\t for (String field : termVect) {\n\t \t \n\t Terms terms = termVect.terms(field);\n\t TermsEnum termsEnum = terms.iterator();\n\t Document doc = reader.document(i);\n\t \n\t while(termsEnum.next() != null){\n\t \t BytesRef term = termsEnum.term();\n\t \t String strTerm = term.utf8ToString();\n\t \t \n\t \t if (hmap.containsKey(strTerm)){\n\t \t\t docIdSet = hmap.get(strTerm);\n\t \t\t docIdSet.add(doc.get(\"url\"));\n\t \t } else{\n\t \t\t docIdSet = new HashSet<String>();\n\t \t\t docIdSet.add(doc.get(\"url\"));\n\t \t\t hmap.put(strTerm, docIdSet);\n\t \t }\n\t }\n\t }\n\t\t }\n\t\t \n\t\t return hmap;\n\t}", "public void ReadIndex(int K) throws IOException {\n IndexReader indexReader = new IndexReader();\n\n // get doc frequency, termFrequency in all docs\n// int df = indexReader.getDocFreq(token);\n// long collectionTf = indexReader.getCollectionFrequency(token);\n//// System.out.println(\" The token \\\"\" + token + \"\\\" appeared in \" + df + \" documents and \" + collectionTf\n//// + \" times in total\");\n// if (df > 0) {\n// int[][] posting = indexReader.getPostingList(token);\n// for (int i = 0; i < posting.length; i++) {\n// int doc_id = posting[i][0];\n//// int term_freq = posting[i][1];\n// String doc_no = indexReader.getDocNo(doc_id);\n//// System.out.println(\"doc_no: \" + doc_id);\n//\n//// System.out.printf(\"%10s %6d %6d\\n\", doc_no, doc_id, term_freq);\n//// System.out.printf(\"%10s 10%6d %6d\\n\", doc_no, doc_id, indexReader.getTF(token, doc_id));\n// System.out.println(\"tf_idf: \" + indexReader.getTF_IDF_weight(token, doc_id));\n//\n// }\n// }\n\n\n String doc_no = indexReader.getDocNo(FileConst.query_doc_id);\n // retreived top K relevant doc ids\n System.out.println(\"=== Top 20 Most Relevant Documents and its Cosine Similarity Score ===\");\n indexReader.retrieveRank(query_tokens, Integer.parseInt(doc_no), K);\n\n indexReader.close();\n }", "@Override\n public void updateItemSearchIndex() {\n try {\n // all item IDs that don't have a search index yet\n int[] allMissingIds = mDatabaseAccess.itemsDAO().selectMissingSearchIndexIds();\n // Selects the item to the id, extract all parts of the item name to create the\n // search index (all ItemSearchEntity's) and insert them into the database\n for (int missingId : allMissingIds) {\n try {\n ItemEntity item = mDatabaseAccess.itemsDAO().selectItem(missingId);\n List<ItemSearchEntity> searchEntities = createItemSearchIndex(item);\n mDatabaseAccess.itemsDAO().insertItemSearchParts(searchEntities);\n } catch (Exception ex) {\n Log.e(TAG, \"An error occurred trying to create the search index to the id\" +\n missingId, ex);\n }\n }\n } catch (Exception ex) {\n Log.e(TAG, \"A general failure has occurred while trying to load and process all \" +\n \"item IDs to generate a search index\", ex);\n }\n }", "public AutoIndexMap()\n\t\t{\n\t\t\t// Initialise instance variables\n\t\t\tindices = new IdentityHashMap<>();\n\t\t}", "private Reindex() {}", "private Reindex() {}", "public static void main(String[] args) throws IOException {\n\t\tif (args.length != 2) {\n\t\t\tSystem.err\n\t\t\t\t\t.println(\"You need to give database directory path and output directory path as arguments.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tdirectory = args[0];\n\t\toutputFilePath = args[1];\n\t\t// Get list of all files.\n\t\tFile[] listOfFiles = Util.getAllFiles(directory);\n\t\t// Get all the stop words in the sorted order.\n\t\tTreeMap<String, String> stopWords = Util\n\t\t\t\t.getStopWordsFromFile(stopWordFile);\n\t\tint numberOfFiles = listOfFiles.length;\n\t\t// 2D array to store the required information about each doc.\n\t\tInteger[][] docInfo = new Integer[numberOfFiles + 1][2];\n\t\tdouble timeForIndexVersion1 = 0.0d, timeForIndexVersion2 = 0.0d;\n\t\tlong startTime, endTime;\n\t\tif (numberOfFiles != 0) {\n\n\t\t\t// Starting creating Index version 1.\n\t\t\tstartTime = System.currentTimeMillis();\n\t\t\tfor (File file : listOfFiles) {\n\t\t\t\t// Get the doc id.\n\t\t\t\tint docId = Integer.parseInt(file.getName().substring(9));\n\t\t\t\t// For version 1:\n\t\t\t\t// do lemmatization\n\t\t\t\tMap<String, Integer> lemmasFromFile = lemmatizer\n\t\t\t\t\t\t.lemmatize(file);\n\t\t\t\t// remove stop words,\n\t\t\t\tMap<String, Integer> lemmasWoStopWords = Util.removeStopWords(\n\t\t\t\t\t\tlemmasFromFile, stopWords);\n\t\t\t\t// create index.\n\t\t\t\tindexVersion1.creatIndex(docId, lemmasWoStopWords);\n\t\t\t}\n\t\t\tendTime = System.currentTimeMillis();\n\t\t\t// calculate total time taken\n\t\t\ttimeForIndexVersion1 = (endTime - startTime) / 1000.0d;\n\n\t\t\t// indexVersion1.printIndex();\n\t\t\t// write uncompressed index of version 1 to a binary file.\n\t\t\tindexVersion1.writeIndexUncompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version1.uncompress\");\n\t\t\t// compress index\n\t\t\tindexVersion1.compressIndex();\n\t\t\t// write compressed index of version 1 to a binary file.\n\t\t\tindexVersion1.writeIndexCompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version1.compress\");\n\n\t\t\t// Starting creating Index version 2.\n\t\t\tstartTime = System.currentTimeMillis();\n\t\t\tfor (File file : listOfFiles) {\n\t\t\t\tint docId = Integer.parseInt(file.getName().substring(9));\n\t\t\t\t// For version 2:\n\t\t\t\t// generate tokens from the file\n\t\t\t\tMap<String, Integer> tokensFromFile = Util\n\t\t\t\t\t\t.getTokensFromFile(file);\n\t\t\t\t// do stemming\n\t\t\t\tMap<String, Integer> stemmedTokens = Util\n\t\t\t\t\t\t.getStemmedTokens(tokensFromFile);\n\t\t\t\t// remove stop words\n\t\t\t\tMap<String, Integer> stemmedTokensWoStopWords = Util\n\t\t\t\t\t\t.removeStopWords(stemmedTokens, stopWords);\n\t\t\t\t// update the information about current document.\n\t\t\t\tUtil.updateDocInfo(docInfo, docId, stemmedTokens,\n\t\t\t\t\t\tstemmedTokensWoStopWords);\n\t\t\t\t// System.out.println(\"DocId: \" + docId + \" Max Freq: \"\n\t\t\t\t// + docInfo[docId][0].toString() + \" Doc length: \"\n\t\t\t\t// + docInfo[docId][1].toString());\n\t\t\t\t// create index\n\t\t\t\tindexVersion2.creatIndex(docId, stemmedTokensWoStopWords);\n\n\t\t\t}\n\t\t\tendTime = System.currentTimeMillis();\n\t\t\t// calculate total time taken\n\t\t\ttimeForIndexVersion2 = (endTime - startTime) / 1000.0d;\n\t\t\t// write documents information to a binary file\n\t\t\twriteDocInfo(docInfo, outputFilePath, \"docs.info\");\n\t\t\t// write uncompressed index of version 2 to a binary file.\n\n\t\t\t// indexVersion2.printIndex();\n\t\t\tindexVersion2.writeIndexUncompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version2.uncompress\");\n\t\t\t// compress index\n\t\t\tindexVersion2.compressIndex();\n\t\t\t// write compressed index of version 2 to a binary file.\n\t\t\tindexVersion2.writeIndexCompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version2.compress\");\n\n\t\t\t// display the required information.\n\t\t\tdisplayOutput(timeForIndexVersion1, timeForIndexVersion2);\n\t\t} else {\n\t\t\tSystem.err.println(\"Empty folder\");\n\t\t}\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\tString indexPath = \"F:/IRS/search/pr/sig_index_naive\";\n\t\t\tString docsPath = \"F:/IRS/search/vldb_icse_id.txt\";\n\t\t\tDirectory dir = FSDirectory.open(Paths.get(indexPath));\n\t\t\tAnalyzer analyzer = new StandardAnalyzer();\n\t\t\tIndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n\t\t\tIndexWriter writer = new IndexWriter(dir, iwc);\n\t\t\t\n\t\t\tFileReader f1 = new FileReader(docsPath);\n\t\t\tBufferedReader br = new BufferedReader(f1);\n\t\t\t\n\t\t\tdouble d;\n\t\t\t//String d=null;\n\t\t\tString lineTxt = null;\n\t\t\t\n\t\t\twhile ((lineTxt = br.readLine()) != null)\n\t\t {\n\t\t\t\t\t String[] splits = lineTxt.split(\"\\t\");\n\t\t\tDocument doc = new Document();\n\n\t\t\tdoc.add(new StringField(\"docid\", splits[0] , Field.Store.YES));\n\n\t\t\tdoc.add(new TextField(\"title\", splits[1], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"title\", splits[1], Field.Store.YES));\t\n\t\t\tdoc.add(new SortedField);\n\n\t\t\tdoc.add(new TextField(\"titlexn\", splits[2], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"titlexn\", splits[2], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"year\", splits[3], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"date\", splits[4], Field.Store.YES));\n\t\t\tdoc.add(new TextField(\"conf\", splits[7], Field.Store.YES));\n\t\t\tdoc.add(new StringField(\"conf\", splits[7], Field.Store.YES));\n\t\t\t\n\t\t\twriter.addDocument(doc);\n\t\t\t\n\t\t}\n\n\t\t\twriter.close();\n\t\t}", "public interface Index {\n\t\n\tvoid index(AddOnInfoAndVersions infoAndVersions) throws Exception;\n\t\n\tCollection<AddOnInfoSummary> search(AddOnType type, String query) throws Exception;\n\t\n\tCollection<AddOnInfoAndVersions> getAllByType(AddOnType type) throws Exception;\n\t\n\tCollection<AddOnInfoAndVersions> getByTag(String tag) throws Exception;\n\t\n\tAddOnInfoAndVersions getByUid(String uid) throws Exception;\n}", "private void indexDocument(File f) throws IOException {\n\n\t\tHashMap<String, StringBuilder> fm;\n\t\tif (!f.getName().equals(\".DS_Store\")) {\n\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\n\t\t\tString s = \"\";\n\t\t\twhile ((s = br.readLine()) != null) {\n\n\t\t\t\tString temp = \"\";\n\n\t\t\t\tif (s.contains(\"<DOC>\")) {\n\n\t\t\t\t\ts = br.readLine();\n\n\t\t\t\t\twhile (!s.contains(\"</DOC>\")) {\n\n\t\t\t\t\t\ttemp += s + \" \";\n\n\t\t\t\t\t\ts = br.readLine();\n\t\t\t\t\t}\n\n\t\t\t\t\tfm = parseTags(temp);\n\t\t\t\t\tindexDocumentHelper(fm);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tbr.close();\n\t\t}\n\n\t}", "public abstract void updateIndex();", "public void addIndex(){\n\t\tdbCol=mdb.getCollection(\"genericCollection\");\n\t\tstart=Calendar.getInstance().getTimeInMillis();\n\t\tdbCol.ensureIndex(new BasicDBObject(\"RandomGeo\", \"2d\"));\n\t\tstop = Calendar.getInstance().getTimeInMillis() - start;\n\t\tSystem.out.println(\"Mongo Index Timer \"+Long.toString(stop));\n\t}", "@Override\n public void buildIndexes(Properties props)\n {\n Statement statement;\n try\n {\n statement = connection.createStatement();\n \n //Create Indexes\n statement.executeUpdate(\"CREATE INDEX CONFFRIENDSHIP_INVITEEID ON CONFFRIENDSHIP (INVITEEID)\");\n statement.executeUpdate(\"CREATE INDEX CONFFRIENDSHIP_INVITERID ON CONFFRIENDSHIP (INVITERID)\");\n statement.executeUpdate(\"CREATE INDEX PENDFRIENDSHIP_INVITEEID ON PENDFRIENDSHIP (INVITEEID)\");\n statement.executeUpdate(\"CREATE INDEX PENDFRIENDSHIP_INVITERID ON PENDFRIENDSHIP (INVITERID)\");\n statement.executeUpdate(\"CREATE INDEX MANIPULATION_RID ON MANIPULATION (RID)\");\n statement.executeUpdate(\"CREATE INDEX MANIPULATION_CREATORID ON MANIPULATION (CREATORID)\");\n statement.executeUpdate(\"CREATE INDEX RESOURCES_WALLUSERID ON RESOURCES (WALLUSERID)\");\n statement.executeUpdate(\"CREATE INDEX RESOURCE_CREATORID ON RESOURCES (CREATORID)\");\n \n System.out.println(\"Indexes Built\");\n }\n catch (Exception ex)\n {\n Logger.getLogger(WindowsAzureClientInit.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Error in building indexes!\");\n }\n }", "com.google.firestore.admin.v1beta1.Index getIndex();", "@Ignore\n @Test\n public void testCreateIndex() {\n System.out.println(\"createIndex\");\n Util.commonServiceIPs=\"127.0.0.1\";\n \n EntityManager em=Util.getEntityManagerFactory(100).createEntityManager();\n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client client = ESUtil.getClient(em,platformEm,1,false);\n \n RuntimeContext.dataobjectTypes = Util.getDataobjectTypes();\n String indexName = \"test000000\";\n try {\n ESUtil.createIndex(platformEm, client, indexName, true);\n }\n catch(Exception e)\n {\n \n }\n \n\n }", "public void build(DatabaseConsumer s) {\n // define an Iterator over the collection of documents\n Iterator<Integer> e = s.getDocumentList();\n\n // temporary variables\n HashMap currentFL;\n DocConsumer current;\n Iterator f;\n String word;\n\n // for performance stats\n long totalKeywords = 0;\n int documents = 0;\n\n // BUILD THE INDEX\n\n // while there are more documents\n while (e.hasNext()) {\n // load the unique identifier\n int docid = e.next();\n\n // load doc stats\n current = s.getDocumentStatistics(docid);\n\n // decide how to pull out the terms for this document\n\n {\n\t\t\t\t/*if (BuildSettings.useProbCutoff)\n\t\t\t\t\tcurrentFL = current\n\t\t\t\t\t\t\t.mostOccurring(BuildSettings.probabilityCutoff);\n\t\t\t\telse*/\n currentFL = current\n .destructiveMostOccurring(mostSignificantTerms);\n }\n\n // get an Iterator over the terms\n f = currentFL.keySet().iterator();\n\n // while there are more terms\n while (f.hasNext()) {\n word = (String) f.next();\n\n // count the occurrance of this word in the internal data\n // structure\n register(docid, word, ((int[]) currentFL.get(word))[0]);\n totalKeywords++;\n }\n documents++;\n }\n\n // print statistics\n // if (BuildSettings.printAverageKeywords)\n {\n System.out.println(\"Average number of keywords: \"\n + (totalKeywords / (double) documents));\n }\n }", "public interface IIndexBuilder {\n\n public IIndex getIndex( Class<?> searchable ) throws BuilderException;\n\n public IFieldVisitor getFieldVisitor();\n\n public void setFieldVisitor( IFieldVisitor visitor );\n\n}", "public static void main(String[] args) throws IOException{\n\t\tint termIndex = 1;\n\t\t\n\t\t// startOffset holds the start offset for each term in\n\t\t// the corpus.\n\t\tlong startOffset = 0;\n\t\t\t\n\t\t// unique_terms is true if there are atleast one more\n\t\t// unique term in corpus.\n\t\tboolean unique_terms = true;\n\t\t\n\t\t\n\t\t//load the stopwords from the HDD\n\t\tString stopwords = getStopWords();\n\t\t\n\t\t// allTokenHash contains all the terms and its termid\n\t\tHashMap<String, Integer> allTermHash = new HashMap<String, Integer>();\n\t\t\n\t\t// catalogHash contains the term and its position in\n\t\t// the inverted list present in the HDD.\n\t\tHashMap<Integer, Multimap> catalogHash = new HashMap<Integer, Multimap>();\n\t\t\n\t\t// finalCatalogHash contains the catalogHash for the invertedIndexHash\n\t\t// present in the HDD.\n\t\tHashMap<Integer, String> finalCatalogHash = new HashMap<Integer, String>();\n\t\t\n\t\t// token1000Hash contains the term and Dblocks for the first 1000\n\t\tHashMap<Integer, Multimap> token1000DocHash = new HashMap<Integer, Multimap>();\n\t\t\n\t\t// documentHash contains the doclength of all the documents in the corpus\n\t\tHashMap<String, String> documentHash = new HashMap<String, String>();\t\n\t\t\n\t\t// id holds the document id corresponding to the docNumber.\n\t\tint id = 1;\n\t\t\n\t\t// until all unique terms are exhausted\n\t\t// pass through the documents and index the terms.\n\t\t//while(unique_terms){\n\t\t\t\n\t\t\tFile folder = new File(\"C:/Naveen/CCS/IR/AP89_DATA/AP_DATA/ap89_collection\");\n\t\t\t//File folder = new File(\"C:/Users/Naveen/Desktop/TestFolder\");\n\t\t\tFile[] listOfFiles = folder.listFiles();\n\t\t\t\n\t\t\t//for each file in the folder \n\t\t\tfor (File file : listOfFiles) {\n\t\t\t if (file.isFile()) {\n\t\t\t \t\n\t\t\t \tString str = file.getPath().replace(\"\\\\\",\"//\");\n\t\t\t \t\n\t\t\t \t\n\t\t\t\t\t//Document doc = new Document();\n\t\t\t //System.out.println(\"\"+str);\n\t\t\t\t\t//variables to keep parse document.\n\t\t\t\t\tint docCount = 0;\n\t\t\t\t\tint docNumber = 0;\n\t\t\t\t\tint endDoc = 0;\n\t\t\t\t\tint textCount = 0;\n\t\t\t\t\tint noText = 0;\n\t\t\t\t\tPath path = Paths.get(str);\n\t\t\t\t\t\n\t\t\t\t\t//Document id and text\n\t\t\t\t\tString docID = null;\n\t\t\t\t\tString docTEXT = null;\n\t\t\t\t\t\n\t\t\t\t\t//Stringbuffer to hold the text of each document\n\t\t\t\t\tStringBuffer text = new StringBuffer();\n\t\t\t\t\t\n\t\t\t\t\tScanner scanner = new Scanner(path);\n\t\t\t\t\twhile(scanner.hasNext()){\n\t\t\t\t\t\tString line = scanner.nextLine();\n\t\t\t\t\t\tif(line.contains(\"<DOC>\")){\n\t\t\t\t\t\t\t++docCount;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"</DOC>\")){\n\t\t\t\t\t\t\t++endDoc;\n\t\t\t\t\t\t\tdocTEXT = text.toString();\n\t\t\t\t\t\t\t//docTEXT = docTEXT.replaceAll(\"[\\\\n]\",\" \");\n\t\t\t\t\t\t\tSystem.out.println(\"ID: \"+id);\n\t\t\t\t\t\t\t//System.out.println(\"TEXT: \"+docTEXT);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// text with stop words removed\n\t\t\t\t\t\t\tPattern pattern1 = Pattern.compile(\"\\\\b(?:\"+stopwords+\")\\\\b\\\\s*\", Pattern.CASE_INSENSITIVE);\n\t\t\t\t\t\t\tMatcher matcher1 = pattern1.matcher(docTEXT);\n\t\t\t\t\t\t\tdocTEXT = matcher1.replaceAll(\"\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// text with stemming\n\t\t\t\t\t\t\t//docTEXT = stemmer(docTEXT);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docLength = 1;\n\t\t\t\t\t\t\t// regex to build the tokens from the document text\n\t\t\t\t\t\t\tPattern pattern = Pattern.compile(\"\\\\w+(\\\\.?\\\\w+)*\");\n\t\t\t\t\t\t\tMatcher matcher = pattern.matcher(docTEXT.toLowerCase());\n\t\t\t\t\t\t\twhile (matcher.find()) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (int i = 0; i < matcher.groupCount(); i++) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// alltermHash contains term and term id\n\t\t\t\t\t\t\t\t\t// if term is present in the alltermHash\n\t\t\t\t\t\t\t\t\tif(allTermHash.containsKey(matcher.group(i))){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tint termId = allTermHash.get(matcher.group(i));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//if term is present in the token1000Hash\n\t\t\t\t\t\t\t\t\t\t//then update the dblock of the term.\n\t\t\t\t\t\t\t\t\t\tif(token1000DocHash.containsKey(termId)){\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockUpdate = token1000DocHash.get(termId);\n\t\t\t\t\t\t\t\t\t\t\t//Multimap<Integer, Integer> dBlockUpdate = token1000DocHash.get(matcher.group(i));\n\t\t\t\t\t\t\t\t\t\t\tif(dBlockUpdate.containsKey(id)){\n\t\t\t\t\t\t\t\t\t\t\t\tdBlockUpdate.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\tdBlockUpdate.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//if term is not present in the token1000hash\n\t\t\t\t\t\t\t\t\t\t//then add the token with its dBlock\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\t\tdBlockInsert.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\t\ttoken1000DocHash.put(termId, dBlockInsert);\t\n\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// if the term is not present I will put the term into allTermHash\n\t\t\t\t\t\t\t\t\t// put corresponding value into the token1000DocHash and increment\n\t\t\t\t\t\t\t\t\t// termIndex\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tallTermHash.put(matcher.group(i),termIndex);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tMultimap<String, String> dBlockInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\tdBlockInsert.put(String.valueOf(id), String.valueOf(matcher.start()));\n\t\t\t\t\t\t\t\t\t\ttoken1000DocHash.put(termIndex, dBlockInsert);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\ttermIndex++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocLength++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(id%1000 == 0){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// then dump index file to HDD\n\t\t\t\t\t\t\t\t\twriteInvertedIndex(token1000DocHash,\"token1000DocHash\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// update catalog file\n\t\t\t\t\t\t\t\t\t// to populate catalogHash with the offset\n\t\t\t\t\t\t\t\t\tfor(Entry<Integer, Multimap> entry : token1000DocHash.entrySet()){\n\t\t\t\t\t\t\t\t\t\tif(catalogHash.containsKey(entry.getKey())){\n\t\t\t\t\t\t\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t\t\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> catUpdate = catalogHash.get(entry.getKey());\n\t\t\t\t\t\t\t\t\t\t\tcatUpdate.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\t\t\t\t\t\t\tcatalogHash.put(entry.getKey(), catUpdate);\n\t\t\t\t\t\t\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t\t\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\t\t\t\t\t\t\tMultimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t\t\t\t\t\t\t\tcatInsert.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\t\t\t\t\t\t\tcatalogHash.put(entry.getKey(), catInsert);//entry.getValue());\n\t\t\t\t\t\t\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//clear the token1000DocHash\n\t\t\t\t\t\t\t\t\ttoken1000DocHash.clear();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdocumentHash.put(docID, \"\"+id+\":\"+docLength);\n\t\t\t\t\t\t\tid++;\n\t\t\t\t\t\t\ttext = new StringBuffer();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"<DOCNO>\")){\n\t\t\t\t\t\t\t++docNumber;\n\t\t\t\t\t\t\tdocID = line.substring(8, 21);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(line.contains(\"<TEXT>\")){\n\t\t\t\t\t\t\t++textCount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if((line.contains(\"<DOC>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</DOC>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<DOCNO>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<FILEID>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<FIRST>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<SECOND>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<HEAD>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</HEAD>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<BYLINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</BYLINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<UNK>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</UNK>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<DATELINE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<NOTE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</NOTE>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"</TEXT>\"))||\n\t\t\t\t\t\t\t\t(line.contains(\"<TEXT>\"))){\n\t\t\t\t\t\t\t ++noText;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(endDoc == docCount - 1){\n\t\t\t\t\t\t\ttext.append(line);\n\t\t\t\t\t\t\ttext.append(\" \");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t \t\n\t\t\t }//end of if - to check if this is a file and parse.\n\t\t\t \n\t\t\t}//end of for loop to load each file\n\t\t\t\n\t\t//}//end of while loop \n\t\t\n\t// write catalogfile to the hdd to check.\n\t\t\t\n\t\t\t// then dump index file to HDD\n\t\t\twriteInvertedIndex(token1000DocHash,\"token1000DocHash\");\n\t\t\t\n\t\t\t// update catalog file\n\t\t\t// to populate catalogHash with the offset\n\t\t\tfor(Entry<Integer, Multimap> entry : token1000DocHash.entrySet()){\n\t\t\t\tif(catalogHash.containsKey(entry.getKey())){\n\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\tMultimap<String, String> catUpdate = catalogHash.get(entry.getKey());\n\t\t\t\t\tcatUpdate.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\tcatalogHash.put(entry.getKey(), catUpdate);\n\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tint len = (entry.getKey()+\":\"+entry.getValue()).length();\n\t\t\t\t\t//String offset = String.valueOf(startOffset)+\":\"+String.valueOf(len);\n\t\t\t\t\tMultimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t\tcatInsert.put(String.valueOf(startOffset), String.valueOf(len));\n\t\t\t\t\tcatalogHash.put(entry.getKey(), catInsert);//entry.getValue());\n\t\t\t\t\tstartOffset += len+2;\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\twriteInvertedIndex(catalogHash,\"catalogHash\");\n\t\t\tprintHashMapSI(allTermHash);\n\t\t\tprintHashMapSS(documentHash);\n\t\t\t\n\t\t\tlong InvIndstartOffset = 0;\n\t\t\t\n\t\t\t//write it to file\n \n\t\t\t//change the finalcatalogHash to the form termid:startoffset:length\n\t\t\tfor (Integer name: catalogHash.keySet()){\n\t String key = name.toString();\n\t String value = catalogHash.get(name).toString(); \n\t //System.out.println(key + \" \" + value); \n\t String finalTermIndex = genInvertedIndex(key, value);\n\t finalTermIndex = key+\":\"+finalTermIndex;\n\t int indexLength = finalTermIndex.length();\n\t \n\t \n\t PrintWriter writer = new PrintWriter(new BufferedWriter\n\t \t\t(new FileWriter(\"C:/Users/Naveen/Desktop/TestRuns/LastRun/InvertedIndex\", true)));\n\t writer.println(finalTermIndex);\n\t writer.close();\n\t \n\t //update the finalcatalogHash\n\t //Multimap<String, String> catInsert = ArrayListMultimap.create();\n\t\t\t\t//catInsert.put(String.valueOf(InvIndstartOffset), String.valueOf(indexLength));\n\t\t\t\tfinalCatalogHash.put(name, String.valueOf(InvIndstartOffset)+\":\"+String.valueOf(indexLength));//entry.getValue());\n\t\t\t\tInvIndstartOffset += indexLength+2;\n\t \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tprintHashMapIS(finalCatalogHash);\n\t\t\t\n\t}", "public TranscriptionIndexer() throws SQLException, CorruptIndexException, IOException\r\n {\r\n\r\n\r\n IndexWriter writer = null;\r\n Analyzer analyser;\r\n Directory directory;\r\n /**@TODO parameterized location*/\r\n String dest = \"/usr/indexTranscriptions\";\r\n\r\n directory = FSDirectory.getDirectory(dest, true);\r\n analyser = new StandardAnalyzer();\r\n writer = new IndexWriter(directory, analyser, true);\r\n PreparedStatement stmt=null;\r\n Connection j = null;\r\n try {\r\n j=DatabaseWrapper.getConnection();\r\n String query=\"select * from transcription where text!='' and creator>0 order by folio, line\";\r\n stmt=j.prepareStatement(query);\r\n ResultSet rs=stmt.executeQuery();\r\n while(rs.next())\r\n {\r\n int folio=rs.getInt(\"folio\");\r\n int line=rs.getInt(\"line\");\r\n int UID=rs.getInt(\"creator\");\r\n int id=rs.getInt(\"id\");\r\n Transcription t=new Transcription(id);\r\n Document doc = new Document();\r\n Field field;\r\n field = new Field(\"text\", t.getText(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"comment\", t.getComment(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"creator\", \"\" + t.UID, Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"security\", \"\" + \"private\", Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"line\", \"\" + t.getLine(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"page\", \"\" + t.getFolio(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"id\", \"\" + t.getLineID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"manuscript\", \"\" + new Manuscript(t.getFolio()).getID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n field = new Field(\"projectID\", \"\" + t.getProjectID(), Field.Store.YES, Field.Index.ANALYZED);\r\n doc.add(field);\r\n writer.addDocument(doc);\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n if(writer!=null)\r\n {\r\n writer.commit();\r\n \twriter.close();\r\n return;\r\n }\r\n ex.printStackTrace();\r\n }\r\n finally{\r\n DatabaseWrapper.closeDBConnection(j);\r\n DatabaseWrapper.closePreparedStatement(stmt);\r\n }\r\n\r\n writer.commit();\r\n \twriter.close();\r\n}", "public void makeIndex(String docsFile, String noiseWordsFile)\n throws FileNotFoundException {\n // load noise words to hash table\n Scanner sc = new Scanner(new File(noiseWordsFile));\n while (sc.hasNext()) {\n String word = sc.next();\n noiseWords.put(word, word);\n }\n\n // index all keywords\n sc = new Scanner(new File(docsFile));\n while (sc.hasNext()) {\n String docFile = sc.next();\n HashMap<String, Occurrence> kws = loadKeyWords(docFile);\n mergeKeyWords(kws);\n }\n\n }", "public void set_graph() throws ParseException, IOException {\n \tg = new WeightedUndirectedGraph(words.length);\n //g = new WeightedUndirectedGraph(most_important_terms.size());\n \n Directory dir = new SimpleFSDirectory(new File(\".\\\\data\\\\lucene_index_r_r\"));\n Analyzer analyzer = new StandardAnalyzer(LUCENE_41);\n \n // creat a map that stores, for each word (in the cluster), a set of all the documents that contain that word\n HashMap<String,HashSet<Integer>> word_to_docs_map = new HashMap<String,HashSet<Integer>>();\n int n_strings = words.length; \n \n // for each word...\n for (int idx = 0; idx < n_strings; idx++) {\n // query the index with that given word and retrieve all the documents that contains that word\n String query = words[idx]; \n QueryParser parser = new QueryParser(Version.LUCENE_41, \"text\", analyzer); \n Query q = parser.parse(query); \n\n IndexReader reader = DirectoryReader.open(dir);\n IndexSearcher searcher = new IndexSearcher(reader);\n TopDocs docs = searcher.search(q, reader.numDocs());\n ScoreDoc[] hits = docs.scoreDocs;\n \n // update map from word to docs it appears in \n //HashSet<Integer> tmp = null;\n // tmp is the set of all the document ids in which the current word is contained\n HashSet<Integer> tmp = new HashSet<>();\n //word_to_docs_map.put(query, tmp);\n \n // for each document, retrieved from the query\n for(Integer i=0;i<hits.length;i++) {\n Integer docId = hits[i].doc;\n // tmp = word_to_docs_map.get(query); \n // if the document is a document written by an user of interest \n if(indices.contains(docId)) {\n tmp.add(docId);\n }\n //word_to_docs_map.put(query, tmp); \n }\n word_to_docs_map.put(query, tmp);\n\t }\n\t \n\t // add edges: iterate over possible term pairs ...\n\t for(int idx_1 = 0; idx_1 < n_strings - 1; idx_1++) {\n\t \n\t for(int idx_2 = idx_1 + 1 ; idx_2 < n_strings ; idx_2 ++ ) {\n\t \n\t // extract document sets associated with the considered terms \n\t HashSet<Integer> set_a = word_to_docs_map.get(words[idx_1]); \n\t HashSet<Integer> set_b = word_to_docs_map.get(words[idx_2]); \n\t \n\t // compute set intersection \n\t int n = intersectionSize(set_a, set_b);\n\t \n\t // if the terms appear in at least one common document\n\t if(n>0) {\n\t // add edge \n\t g.testAndAdd(idx_1, idx_2 , n); \n\t }\n\t } \n\t }\n\t}", "public interface IIndexer {\n /**\n * Returns the file types the <code>IIndexer</code> handles.\n */\n String[] getFileTypes();\n /**\n * Indexes the given document, adding the document name and the word references \n * to this document to the given <code>IIndex</code>.The caller should use \n * <code>shouldIndex()</code> first to determine whether this indexer handles \n * the given type of file, and only call this method if so. \n */\n void index(IDocument document, IIndexerOutput output) throws java.io.IOException;\n /**\n * Sets the document types the <code>IIndexer</code> handles.\n */\n public void setFileTypes(String[] fileTypes);\n /**\n * Returns whether the <code>IIndexer</code> can index the given document or not.\n */\n public boolean shouldIndex(IDocument document); }", "private int getIndexForDocument(int docId){\n\n int i = 0;\n while(i < this.postingList.size() && this.postingList.get(i) != docId){\n i += this.postingList.get(i+1)+2;\n }\n if(i >= this.postingList.size())\n return -1; // document does not exist in posting List. Return -1\n return i;\n }", "@SuppressWarnings(\"unused\")\n public void buildIndex() throws IOException {\n indexWriter = getIndexWriter(indexDir);\n ArrayList <JSONObject> jsonArrayList = parseJSONFiles(JSONdir);\n indexTweets(jsonArrayList, indexWriter);\n indexWriter.close();\n }", "public void setDocumentCount(Integer arg0) {\n \n }", "public void createIndex(String dirPath) throws IOException {\n\n\t\tFile[] files = new File(dirPath).listFiles();\n\n\t\tfor (File f : files) {\n\t\t\tindexDocument(f);\n\t\t}\n\n\t\tclose();\n\t\tprintStatistics();\n\t}", "private Document createMapping() {\n return getIndexOperations().createMapping();\n }", "public static void generateInvertedIndex(Map<String, List<Posting>> stemMap, List<String> documentIds)\n {\n long lineCounter = 0;\n int documentCounter = -1;\n String currentDocId = \"\";\n String currentDocTitle = \"\";\n Scanner scanner = new Scanner(System.in);\n\n while (scanner.hasNext())\n {\n String line = scanner.nextLine();\n lineCounter++;\n \n if (line.startsWith(\"$DOC\"))\n {\n String[] wordStems = line.split(\" \");\n currentDocId = wordStems[1];\n documentCounter++;\n }\n else if (line.startsWith(\"$TITLE\"))\n {\n /* Save document titles for documentId list */\n long docLineNumber = lineCounter - 1;\n currentDocTitle = \"\";\n \n while (scanner.hasNext())\n {\n String nextTitleLine = scanner.nextLine();\n if (nextTitleLine.startsWith(\"$TEXT\"))\n {\n lineCounter++;\n documentIds.add(String.format(\"%s %d %s\\n\", currentDocId, docLineNumber, currentDocTitle));\n break;\n }\n else\n {\n lineCounter++;\n currentDocTitle += nextTitleLine;\n currentDocTitle += \" \";\n }\n }\n }\n else\n {\n String[] wordStems = line.split(\" \");\n for (String wordStem: wordStems)\n {\n if (stemMap.containsKey(wordStem))\n {\n List<Posting> currentStemPostings = stemMap.get(wordStem);\n int lastElementIndex = currentStemPostings.size() - 1;\n Posting lastPosting = currentStemPostings.get(lastElementIndex);\n \n if (lastPosting.documentId == documentCounter)\n {\n lastPosting.termFrequency += 1;\n }\n else\n {\n Posting posting = new Posting(documentCounter, 1);\n currentStemPostings.add(posting);\n }\n }\n else\n {\n List<Posting> postings = new ArrayList<>();\n Posting posting = new Posting(documentCounter, 1);\n postings.add(posting);\n stemMap.put(wordStem, postings);\n }\n }\n }\n }\n scanner.close();\n }", "public void indexFileOrDirectory(String fileName) {\r\n\r\n addFiles(new File(fileName));\r\n\r\n int originalNumDocs = writer.numRamDocs();\r\n for (File f : queue) {\r\n try {\r\n Document doc = new Document();\r\n\r\n // Creation of a simpledateformatter in order to print the last-modified-date of our files.\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\r\n String date = sdf.format(f.lastModified());\r\n\r\n if (f.getName().endsWith(\".html\")) {\r\n\r\n // Creation of a jsoup document to help us with our html parsing.\r\n org.jsoup.nodes.Document htmlFile = Jsoup.parse(f, null);\r\n String body = htmlFile.body().text();\r\n String title = htmlFile.title();\r\n String summary = getSummary(htmlFile);\r\n\r\n\r\n doc.add(new TextField(\"contents\", body + \" \" + title + \" \" + date, Field.Store.YES));\r\n doc.add(new TextField(\"title\", title, Field.Store.YES));\r\n doc.add(new StringField(\"path\", f.getPath(), Field.Store.YES));\r\n doc.add(new TextField(\"modified-date\", date, Field.Store.YES));\r\n doc.add(new StringField(\"summary\", summary, Field.Store.YES));\r\n\r\n }\r\n else {\r\n String content = FileUtils.readFileToString(f, StandardCharsets.UTF_8);\r\n\r\n doc.add(new TextField(\"contents\", content + \" \" + date, Field.Store.YES));\r\n doc.add(new StringField(\"path\", f.getPath(), Field.Store.YES));\r\n doc.add(new TextField(\"modified-date\", date, Field.Store.YES));\r\n }\r\n doc.add(new StringField(\"filename\", f.getName(), Field.Store.YES));\r\n\r\n writer.addDocument(doc);\r\n System.out.println(\"Added: \" + f);\r\n } catch (Exception e) {\r\n System.out.println(\"Could not add: \" + f);\r\n }\r\n }\r\n\r\n int newNumDocs = writer.numDocs();\r\n System.out.println(\"\");\r\n System.out.println(\"************************\");\r\n System.out.println((newNumDocs - originalNumDocs) + \" documents added.\");\r\n System.out.println(\"************************\");\r\n\r\n queue.clear();\r\n }", "public SimpleIndexFactory() {\n\t}", "public static void main(String[] args) throws IOException\r\n\t{\n\t\tif (args.length <= 0)\r\n\t\t{\r\n System.out.println(\"Expected corpus as input\");\r\n System.exit(1);\r\n }\r\n\r\n\t\t// Analyzer that is used to process TextField\r\n\t\tAnalyzer analyzer = new StandardAnalyzer();\r\n\r\n\t\t// ArrayList of documents in the corpus\r\n\t\tArrayList<Document> documents = new ArrayList<Document>();\r\n\r\n\t\t// Open the directory that contains the search index\r\n\t\tDirectory directory = FSDirectory.open(Paths.get(INDEX_DIRECTORY));\r\n\r\n\t\t// Set up an index writer to add process and save documents to the index\r\n\t\tIndexWriterConfig config = new IndexWriterConfig(analyzer);\r\n\t\tconfig.setOpenMode(IndexWriterConfig.OpenMode.CREATE);\r\n\t\tIndexWriter iwriter = new IndexWriter(directory, config);\r\n\r\n\r\n\t\tfor (String arg : args)\r\n\t\t{\r\n\r\n\t\t\t// Load the contents of the file\r\n\t\t\t//System.out.printf(\"Indexing \\\"%s\\\"\\n\", arg);\r\n\t\t\tString content = new String(Files.readAllBytes(Paths.get(arg)));\r\n\r\n\t\t\tString[] big = content.split(\".I\");\r\n\t\t\tfor (String a : big) {\r\n\t\t\t\tDocument doc = new Document();\r\n\t\t\t\tint count = 0;\r\n\t\t\t\tString[] small = a.split(\".A\");\r\n\t\t\t\tfor (String b : small) {\r\n\t\t\t\t\tif (count == 0) {\r\n\t\t\t\t\t\tdoc.add(new StringField(\"filename\", b, Field.Store.YES));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tdoc.add(new TextField(\"content\", b, Field.Store.YES));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\tdocuments.add(doc);\r\n\t\t\t}\r\n\t\t\tfor (Document doc : documents) {\r\n\t\t\t\tSystem.out.println(doc.get(\"filename\"));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Write all the documents in the linked list to the search index\r\n\t\tiwriter.addDocuments(documents);\r\n\r\n\t\t// Commit everything and close\r\n\t\tiwriter.close();\r\n\t\tdirectory.close();\r\n\t}", "@Test\n public void testCreateIdxOnClient() {\n getDefaultCacheOnClient().query(new SqlFieldsQuery(((\"CREATE INDEX IDX_11 ON \" + (GridCacheDynamicLoadOnClientTest.FULL_TABLE_NAME)) + \" (name asc)\"))).getAll();\n }", "public void createIndex() throws IOException {\n\t\tindexWriter.commit();\n\t\ttaxoWriter.commit();\n\n\t\t// categories\n\t\tfor (Article.Facets f : Article.Facets.values()) {\n\t\t\ttaxoWriter.addCategory(new CategoryPath(f.toString()));\n\t\t}\n\t\ttaxoWriter.commit();\n\n\t\tfinal Iterable<Article> articles = articleRepository.findAll();\n\t\tint c = 0;\n\t\tfor (Article article : articles) {\n\t\t\taddArticle(indexWriter, taxoWriter, article);\n\t\t\tc++;\n\t\t}\n\t\t// commit\n\t\ttaxoWriter.commit();\n\t\tindexWriter.commit();\n\n\t\ttaxoWriter.close();\n\t\tindexWriter.close();\n\n\t\ttaxoDirectory.close();\n\t\tindexDirectory.close();\n\t\tLOGGER.debug(\"{} articles indexed\", c);\n\t}", "public static void loadDocumentCollecion() throws IOException {\n\t\tSystem.out.println(\"Document Collection index: \" + DocumentCollection_location);\t\t\n\t\tDirectory DocsIndexDirectory = FSDirectory.open(new File(DocumentCollection_location));\t\t\n\t\tdocuments = new IndexSearcher((IndexReader.open(DocsIndexDirectory)));\t\n\t}", "public void enableIndexAutoCreation() {\n client.setIndexAutoCreationEnabled(true);\n }", "public void addDocument(IDocument document) {\n if (indexedFile == null) {\n indexedFile= index.addDocument(document);\n } else {\n throw new IllegalStateException(); } }", "void createIndex(){\n int index=0;\n for(int i=0;i<ancogs.size();i++)\n if(!cogToIndex.containsKey(ancogs.get(i).getValue2()))\n cogToIndex.put(ancogs.get(i).getValue2(), index++);\n}", "@Override\n public void setupIndex() {\n List lst = DBClient.getList(\"SELECT a FROM AppMenu a WHERE a.moduleName='MyBranchMemberExt'\");\n if (lst!=null && !lst.isEmpty()) {\n return;\n }\n AppMenu.createAppMenuObj(\"MyBranchMemberExt\", \"Main\", \"Branch Member\", 110).save();\n AppMenu.createAppMenuObj(\"MyCenterMemberExt\", \"Main\", \"Center Member\", 120).save();\n AppMenu.createAppMenuObj(\"SearchAllMembersOnlyExt\", \"Main\", \"Search Member\", 130).save();\n AppMenu.createAppMenuObj(\"ReferenceForm\", \"Reference\", \"Reference\", 200).save();\n runUniqueIndex(8, \"firstName\", \"lastName\");\n }", "public void IndexADocument(String docno, String content) throws IOException {\n\t\t\n\t\tdocIdx.append(docno + \"\\n\");\n\t\n\t\tString[] tokens = content.split(\" \");\n\t\t\n\t\tfor(String word: tokens) {\n\t\t\tif(token.containsKey(word)) {\t\t\n\t\t\t\tLinkedHashMap<Integer, Integer> cur = token.get(word);\n\t\t\t\tif(cur.containsKey(docid))\n\t\t\t\t\tcur.put(docid, cur.get(docid)+1);\n\t\t\t\telse \n\t\t\t\t\tcur.put(docid, 1);\n\t\t\t} else {\n\t\t\t\tLinkedHashMap<Integer, Integer> cur = new LinkedHashMap<>();\n\t\t\t\tcur.put(docid, 1);\n\t\t\t\ttoken.put(word, cur);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t++docid;\n\t\t\n\t\tif(docid % BLOCK == 0) \n\t\t\tsaveBlock();\t\n\t}", "private void collect() {\n\n System.out.println(\"Getting IndexReader...\");\n final IndexReader reader = index.reader();\n\n System.out.println(\"Calling forEachDocument()...\");\n index.forEachDocument(new DocTask() {\n\n int docsDone = 0;\n\n final int totalDocs = reader.maxDoc() - reader.numDeletedDocs();\n\n @Override\n public void perform(BlackLabIndex index, int docId) {\n Map<String, String> metadata = new HashMap<>();\n Document luceneDoc = index.luceneDoc(docId);\n for (IndexableField f: luceneDoc.getFields()) {\n // If this is a regular metadata field, not a control field\n if (!f.name().contains(\"#\")) {\n fieldNames.add(f.name());\n if (f.stringValue() != null)\n metadata.put(f.name(), f.stringValue());\n else if (f.numericValue() != null)\n metadata.put(f.name(), f.numericValue().toString());\n }\n }\n values.add(metadata);\n docsDone++;\n if (docsDone % 100 == 0) {\n int perc = docsDone * 100 / totalDocs;\n System.out.println(docsDone + \" docs exported (\" + perc + \"%)...\");\n }\n }\n });\n }", "@FunctionalInterface\npublic interface IIndexer<T extends IDocument> {\n\tList<T> getDocuments(String query, int limit);\n}", "public void createIndex(String dataDirPath){\n\t\tFile[] files = new File(dataDirPath).listFiles();\n\n\t\tfor (File file : files) {\n\t\t\tif(!file.isDirectory()\n\t\t\t\t\t&& !file.isHidden()\n\t\t\t\t\t&& file.exists()\n\t\t\t\t\t){\n\t\t\t\t//add to Map\n\t\t\t\t// m.put(file.getAbsolutePath(), new RankModel(file,0,getOutLinks(file.getAbsolutePath())));\n\t\t\t\tallFiles.add(file.getAbsolutePath());\n\t\t\t}else{\n\t\t\t\tcreateIndex(file.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t\t// return writer.numDocs();\n\t}", "public interface IndexRegistry\n{\n void registerIndex(Index index);\n void unregisterIndex(Index index);\n\n Index getIndex(IndexMetadata indexMetadata);\n Collection<Index> listIndexes();\n}", "boolean createIndex(String indexName);", "public void createIndex(Configuration configuration){\n }", "@Override\n\tpublic String indexData(String db, String filename,\n\t\t\tWeightComputer weightComputer, TextTransformer trans)\n\t\t\tthrows IOException {\n\t\tString cascades_collection=MongoDB.mongoDB.createCollection(db,\"cascades\",\" cascades from \"+filename+\" selon \"+this.toString()+\" avec \"+weightComputer+\" transform par \"+trans);\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Indexation \"+filename);\n\t\t//ArrayListStruct<User> ret=new ArrayListStruct<User>();\n\t\tHashMap<String,User> users=new HashMap<String,User>();\n\t\tHashSet<Post> posts=new HashSet<Post>();\n\t\tHashSet<Cascade> cascades=new HashSet<Cascade>();\n\t\t\n\t\tStemmer stemmer=new Stemmer();\n\t\tBufferedReader lecteur=new BufferedReader(new FileReader(filename));\n\t\tBufferedReader lecteurW=new BufferedReader(new FileReader(this.cascadesWeightsFile));\n\t\ttry{\n\t\t\tString ligne;\n\t\t\tint nbl=0;\n\t\t\twhile((ligne=lecteur.readLine())!=null){\n\t\t\t\tnbl++;\n\t\t\t}\n\t\t\tSystem.out.println(nbl+\" lignes\");\n\t\t\tlecteur.close();\n\t\t\tlecteur=new BufferedReader(new FileReader(filename));\n\t\t\tint nb=0;\n\t\t\tint nbc=0;\n\t\t\tint nbinvalides=0;\n\t\t\tlecteur.readLine();\n\t\t\tlecteurW.readLine();\n\t\t\twhile(((ligne=lecteur.readLine())!=null)){ // && (nb<10000)){\n\t\t\t\t\t//System.out.println(ligne); \n\t\t\t\t\t\n\t\t\t\tligne=ligne.replaceAll(\"\\r\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\r\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\\\\\r\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\n\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\n\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\\\\\n\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\t\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\t\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\"\\\\\\\\t\", \" \");\n\t\t\t\tligne=ligne.replaceAll(\" \", \" \");\n\t\t\t\tligne=ligne.replace(\"^ \", \"\");\n\t\t\t\t\t//System.out.println(ligne);\n\t\t\t\t\tString[] li=ligne.split(\" \");\n\t\t\t\t\tUser user;\n\t\t\t\t\t\n\t\t\t\t\tif (li.length>=2){\n\t\t\t\t\t\t//System.out.println(li[0]+\":\"+li[1]);\n\t\t\t\t\t\tHashMap<String,Post> pc=new HashMap<String,Post>();\n\t\t\t\t\t\tHashMap<String,Long> vusUsers=new HashMap<String,Long>();\n\t\t\t\t\t\tfor(int i=0;i<li.length;i++){\n\t\t\t\t\t\t\tString[] triplet=li[i].split(\",\");\n\t\t\t\t\t\t\tif (users.containsKey(triplet[1])){\n\t\t\t\t\t\t\t\tuser=users.get(triplet[1]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tuser=User.getUser(triplet[1]);\n\t\t\t\t\t\t\t\tusers.put(triplet[1],user);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlong t=Long.valueOf(triplet[2])+1;\n\t\t\t\t\t\t\tif(triplet[0].compareTo(\"i\")==0){\n\t\t\t\t\t\t\t\tt=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif((!vusUsers.containsKey(user.getName())) || (vusUsers.get(user.getName())<t)){\n\t\t\t\t\t\t\t\tPost p=new Post(\"\",user,t,null);\n\t\t\t\t\t\t\t\tpc.put(user.getName(),p);\n\t\t\t\t\t\t\t\tvusUsers.put(user.getName(),t);\n\t\t\t\t\t\t\t\tposts.add(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(pc.size()>1){\n\t\t\t\t\t\t\tString wl=lecteurW.readLine();\n\t\t\t\t\t\t\tString[] ws=wl.split(\" \");\n\t\t\t\t\t\t\tHashMap<Integer,Double> weights=new HashMap<Integer,Double>();\n\t\t\t\t\t\t\tfor(int i=0;i<ws.length;i++){\n\t\t\t\t\t\t\t\tString[] st=ws[i].split(\",\");\n\t\t\t\t\t\t\t\tweights.put(Integer.parseInt(st[0])+add, Double.valueOf(st[1]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tnbc++;\n\t\t\t\t\t\t\tCascade c=new ArtificialCascade(nbc,nbc+\"\",new HashSet<Post>(pc.values()),weights);\n\t\t\t\t\t\t\tc.indexInto(db, cascades_collection);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"ligne invalide :\" + ligne);\n\t\t\t\t\t\tnbinvalides++;\n\t\t\t\t\t\t//break;\n\t\t\t\t\t}\n\t\t\t\t\tnb++;\n\t\t\t\t\tif (nb%100==0){\n\t\t\t\t\t\tSystem.out.println(nb+\"/\"+nbl+\" lignes traitees\");\n\t\t\t\t\t}\n\n\t\t\t}\n\t\t\tSystem.out.println(nbinvalides+\" lignes invalides\");\n\t\t\t\n\t\t\t/*nb=0;\n\t\t\tnbl=posts.size();\n\t\t\tfor(Post post:posts){\n\t\t\t\tpost.indexInto(collection);\n\t\t\t\tif (nb%100==0){\n\t\t\t\t\tSystem.out.println(nb+\"/\"+nbl+\" posts inseres\");\n\t\t\t\t}\n\t\t\t\tnb++;\n\t\t\t}*/\n\t\t\tSystem.out.println(\"Creation indexs\");\n\t\t\tDBCollection col=MongoDB.mongoDB.getCollectionFromDB(db,cascades_collection);\n\t\t\tcol.ensureIndex(new BasicDBObject(\"id\", 1));\n\t\t}\n\t\tfinally{\n\t\t\tlecteur.close();\n\t\t\tlecteurW.close();\n\t\t}\n\t\t\n\t\treturn cascades_collection;\n\t}", "private static RDFIndex createDefaultIndex() {\n defaultIndex = new RDFIndex(com.hp.hpl.jena.graph.Factory.createGraphMem());\n try {\n File indexFile = new File(INDEX_FILE);\n if(indexFile.exists()) {\n defaultIndex.read(new FileReader(indexFile),Constants.RESOURCE_URL);\n }\n } catch(Throwable t) {\n t.printStackTrace();\n }\n return defaultIndex;\n }", "public static void main(String[] args) throws CorruptIndexException, LockObtainFailedException, IOException, ParseException{\n\t\tboolean lucene_im_mem = false;\n\t\t//1. Build the Index with varying \"database size\"\n\t\tString dirName =\"/data/home/duy113/SupSearchExp/AIDSNew/\";\n//\t\tString dirName = \"/Users/dayuyuan/Documents/workspace/Experiment/\";\n\t\tString dbFileName = dirName + \"DBFile\";\n\t\tString trainQueryName= dirName + \"TrainQuery\";\n//\t\tString testQuery15 = dirName + \"TestQuery15\";\n\t\tString testQuery25 = dirName + \"TestQuery25\";\n//\t\tString testQuery35 = dirName + \"TestQuery35\";\n\t\tGraphDatabase query = new GraphDatabase_OnDisk(testQuery25, MyFactory.getSmilesParser());\n\t\tdouble[] minSupts = new double[4];\n\t\tminSupts[0] = 0.05; minSupts[1] = 0.03; minSupts[2] =0.02; minSupts[3] = 0.01;\n \t\tint lwIndexCount[] = new int[1];\n\t\tlwIndexCount[0] = 479;\t\n//\t\tSystem.out.println(\"Build CIndexFlat Left-over: \");\n//\t\tfor(int j = 3; j< 4; j++){\n//\t\t\tdouble minSupt = minSupts[j];\n//\t\t\tfor(int i = 4; i<=10; i = i+2){\n//\t\t\t\tString baseName = dirName + \"G_\" + i + \"MinSup_\" + minSupt + \"/\";\n//\t\t\t\tGraphDatabase trainingDB = new GraphDatabase_OnDisk(dbFileName + i, MyFactory.getDFSCoder());\n//\t\t\t\tGraphDatabase trainQuery = new GraphDatabase_OnDisk(trainQueryName, MyFactory.getSmilesParser());\t\t\n//\t\t\t\tif(i == 2){\n//\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat\");\n//\t\t\t\t\tCIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, baseName, minSupt, lwIndexCount[0]);\n//\t\t\t\t}\n//\t\t\t\telse{\n//\t\t\t\t\tString featureBaseName = dirName + \"G_2\" + \"MinSup_\" + minSupt + \"/\";\n//\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat with Features \" + featureBaseName);\n//\t\t\t\t\tCIndexExp.buildIndex(featureBaseName, trainingDB, baseName, minSupt);\n//\t\t\t\t}\n//\t\t\t\tSystem.gc();\n//\t\t\t}\n//\t\t}\n\t\tSystem.out.println(\"Run Query Processing: \");\n\t\tfor(int j = 0; j< 4; j++){\n\t\t\tdouble minSupt = minSupts[j];\n\t\t\tfor(int i = 2; i<=10; i = i+2){\n\t\t\t\tString baseName = dirName + \"G_\" + i + \"MinSup_\" + minSupt + \"/\";\n\t\t\t\tGraphDatabase trainingDB = new GraphDatabase_OnDisk(dbFileName + i, MyFactory.getDFSCoder());\n\t\t\t\tGraphDatabase trainQuery = new GraphDatabase_OnDisk(trainQueryName, MyFactory.getSmilesParser());\t\t\n\t\t\t\tif(j!=0 || i!=2){\n\t\t\t\t\tSystem.out.println(baseName + \"LWindex\");\n\t\t\t\t\t//LWIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, trainQuery.getParser(),baseName, minSupt, lwIndexCount);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tLWIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tLWIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\t\t\n\t\t\t\t\tSystem.out.println(baseName + \"PrefixIndex\");\n\t\t\t\t\t//PrefixIndexExp.buildIndex(trainingDB, trainingDB, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tPrefixIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tPrefixIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\t\t\n\t\t\t\t\tSystem.out.println(baseName + \"PrefixIndexHi\");\n\t\t\t\t\t//PrefixIndexExp.buildHiIndex(trainingDB, trainingDB, 2, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tPrefixIndexExp.runHiIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tPrefixIndexExp.runHiIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tSystem.out.println(baseName + \"GPTree\");\n\t\t\t\t\t//GPTreeExp.buildIndex(trainingDB, trainingDB, baseName, minSupt);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tGPTreeExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tGPTreeExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tSystem.out.println(baseName + \"CIndexFlat\");\n\t\t\t\t\t//CIndexExp.buildIndex(trainingDB, trainQuery, trainingDB, baseName, minSupt, lwIndexCount[0]);\n\t\t\t\t\t//System.gc();\n\t\t\t\t\tCIndexExp.runIndex(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\t\tCIndexExp.runIndex(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\t\tSystem.gc();\n\t\t\t\t}\n\t\t\t\tif(j==0&&i==2){\n\t\t\t\t\tSystem.out.println(baseName + \"CIndexTopDown: \" + lwIndexCount[0]);\n\t\t\t\t\tCIndexExp.buildIndexTopDown(trainingDB, trainQuery, trainingDB,MyFactory.getUnCanDFS(), baseName, minSupt, 2*trainQuery.getTotalNum()/lwIndexCount[0] ); // 8000 test queries\n\t\t\t\t\t//System.gc();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(baseName + \"CIndexTopDown: \" + lwIndexCount[0]);\n\t\t\t\tCIndexExp.runIndexTopDown(trainingDB, trainQuery, baseName, lucene_im_mem);\n\t\t\t\tCIndexExp.runIndexTopDown(trainingDB, query, baseName, lucene_im_mem);\n\t\t\t\tSystem.gc();\n\t\t\t}\n\t\t}\n\t\tAIDSLargeExp.main(args);\n\t}", "void initiateIndexing(HarvestResultDTO harvestResult) throws DigitalAssetStoreException;", "int[] allDocs();", "IndexNameReference createIndexNameReference();", "public void indexFileOrDirectory(String fileName, String packageType) throws IOException {\n //===================================================\n //gets the list of files in a folder (if user has submitted\n //the name of a folder) or gets a single file name (is user\n //has submitted only the file name)\n //===================================================\n this.setThreadCount(this.queue.size());\n int originalNumDocs = writer.numDocs();\n startTime = System.currentTimeMillis();\n for (File f : queue) {\n LogReader lr = new LogReader(f.getAbsolutePath());\n \n Thread t = new Thread(new Runnable(){//Using thread \n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tcurrentThreadCount = currentThreadCount + 1;\n\t\t\t\t\tSystem.out.println(\"Number of thread: \" + currentThreadCount);\n\t\t\t\t\ttry {\n\t\t for (int cnt = 0; ; cnt++) {\n\t\t \tif(lr == null){\n\t\t \t\tSystem.out.println(\"hello\");\n\t\t \t}\n\t\t ArrayList<Package> list = lr.PackagesWrapper(2000);\n\t\t if (list == null || list.size() <= 0)\n\t\t {\n\t\t break;\n\t\t }\n\n\t\t int size = list.size();\n\t\t ArrayList<Document> docs = new ArrayList<Document>();\n\t\t for (int i = 0; i < size; i++)\n\t\t {\n\t\t Package p = list.get(i);\n\t\t Document doc = new Document();\n\t\t deWrapString(packageType, p, doc);\n\t\t \n\t\t docs.add(doc);\n\t\t }\n\n\t\t writer.addDocuments(docs);\n\n\t\t if (cnt != 0 && cnt % 10 == 0) {\n\t\t flush();\n\t\t currentTime = System.currentTimeMillis();\n\t\t \n\t\t System.out.println(\"Current document: \" + writer.numDocs() + \n\t\t \t\t\", current indexing rate: \" + (writer.numDocs()/ (currentTime - startTime)) * 1000);\n\t\t }\n\t\t }\n\t\t System.out.println(\"Added: \" + f);\n\t\t } catch (Exception e) {\n\t\t \te.printStackTrace();\n\t\t System.out.println(\"Could not add: \" + f);\n\t\t } finally {\n\t\t \tthreadCount--;\n\t\t }\n\t\t\t\t}\n \t\n });\n t.start(); \n /*\n try {\n for (int cnt = 0; ; cnt++) {\n ArrayList<Package> list = lr.PackagesWrapper(2000);\n if (list == null || list.size() <= 0)\n {\n break;\n }\n\n int size = list.size();\n ArrayList<Document> docs = new ArrayList<Document>();\n for (int i = 0; i < size; i++)\n {\n Package p = list.get(i);\n Document doc = new Document();\n this.deWrapString(packageType, p, doc);\n \n docs.add(doc);\n }\n\n writer.addDocuments(docs);\n\n if (cnt % 10 == 0) {\n flush();\n System.out.println(\"bulk count: \" + cnt);\n }\n }\n System.out.println(\"Added: \" + f);\n } catch (Exception e) {\n System.out.println(\"Could not add: \" + f);\n } finally {\n\n }*/\n }\n \n /*\n int newNumDocs = writer.numDocs();\n System.out.println(\"\");\n System.out.println(\"************************\");\n System.out.println((newNumDocs - originalNumDocs) + \" documents added.\");\n System.out.println(\"************************\");\n queue.clear();\n */\n }", "public void forceUpdateSearchIndexes() throws InterruptedException {\n\t getFullTextEntityManager().createIndexer().startAndWait();\n\t}", "private void ensureIndexes() throws Exception {\n LOGGER.info(\"Ensuring all Indexes are created.\");\n\n QueryResult indexResult = bucket.query(\n Query.simple(select(\"indexes.*\").from(\"system:indexes\").where(i(\"keyspace_id\").eq(s(bucket.name()))))\n );\n\n\n List<String> indexesToCreate = new ArrayList<String>();\n indexesToCreate.addAll(Arrays.asList(\n \"def_sourceairport\", \"def_airportname\", \"def_type\", \"def_faa\", \"def_icao\", \"def_city\"\n ));\n\n boolean hasPrimary = false;\n List<String> foundIndexes = new ArrayList<String>();\n for (QueryRow indexRow : indexResult) {\n String name = indexRow.value().getString(\"name\");\n if (name.equals(\"#primary\")) {\n hasPrimary = true;\n } else {\n foundIndexes.add(name);\n }\n }\n indexesToCreate.removeAll(foundIndexes);\n\n if (!hasPrimary) {\n String query = \"CREATE PRIMARY INDEX def_primary ON `\" + bucket.name() + \"` WITH {\\\"defer_build\\\":true}\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully created primary index.\");\n } else {\n LOGGER.warn(\"Could not create primary index: {}\", result.errors());\n }\n }\n\n for (String name : indexesToCreate) {\n String query = \"CREATE INDEX \" + name + \" ON `\" + bucket.name() + \"` (\" + name.replace(\"def_\", \"\") + \") \"\n + \"WITH {\\\"defer_build\\\":true}\\\"\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully created index with name {}.\", name);\n } else {\n LOGGER.warn(\"Could not create index {}: {}\", name, result.errors());\n }\n }\n\n LOGGER.info(\"Waiting 5 seconds before building the indexes.\");\n\n Thread.sleep(5000);\n\n StringBuilder indexes = new StringBuilder();\n boolean first = true;\n for (String name : indexesToCreate) {\n if (first) {\n first = false;\n } else {\n indexes.append(\",\");\n }\n indexes.append(name);\n }\n\n if (!hasPrimary) {\n indexes.append(\",\").append(\"def_primary\");\n }\n\n String query = \"BUILD INDEX ON `\" + bucket.name() + \"` (\" + indexes.toString() + \")\";\n LOGGER.info(\"Executing index query: {}\", query);\n QueryResult result = bucket.query(Query.simple(query));\n if (result.finalSuccess()) {\n LOGGER.info(\"Successfully executed build index query.\");\n } else {\n LOGGER.warn(\"Could not execute build index query {}.\", result.errors());\n }\n }", "private static void createIndex() {\n XML_Shell workFile = new XML_Shell();\n String messageFromServer = ClientService.getLastMessageFromServer();\n\n try {\n XML_Manager.stringToDom(messageFromServer, workFile);\n } catch (SAXException | ParserConfigurationException | IOException | TransformerException e) {\n e.printStackTrace();\n }\n\n }" ]
[ "0.65429235", "0.653879", "0.64278746", "0.6412016", "0.63508445", "0.63154024", "0.62886333", "0.6277428", "0.6266001", "0.6252447", "0.62521183", "0.62375504", "0.6213176", "0.6203272", "0.6189587", "0.6113869", "0.61061925", "0.6084267", "0.6036071", "0.6019144", "0.6008313", "0.5986647", "0.59777856", "0.59732634", "0.5973257", "0.59718806", "0.5963232", "0.59095234", "0.58712226", "0.5855696", "0.5855664", "0.5853939", "0.5849345", "0.5826364", "0.5815358", "0.58116096", "0.5808339", "0.58006585", "0.5785502", "0.5761615", "0.57604116", "0.5755712", "0.57366484", "0.5735878", "0.57109714", "0.57054937", "0.5701028", "0.5698437", "0.5690738", "0.5687422", "0.5687422", "0.56806993", "0.5677373", "0.56758386", "0.5675576", "0.56601244", "0.5649762", "0.56482005", "0.56481016", "0.56466407", "0.564534", "0.5640656", "0.56406295", "0.56377137", "0.5633686", "0.56330544", "0.5620945", "0.5618748", "0.56111234", "0.5611077", "0.5607953", "0.5597308", "0.559684", "0.55884737", "0.55805415", "0.557763", "0.55632246", "0.5560548", "0.55575055", "0.55574214", "0.55492336", "0.5546922", "0.5544141", "0.55254304", "0.5511414", "0.5493514", "0.5477045", "0.54762536", "0.54734117", "0.5457794", "0.5454185", "0.5452415", "0.5445063", "0.54343176", "0.5433939", "0.5433459", "0.54301673", "0.54266846", "0.5425765", "0.5407359" ]
0.546721
89
close the index writer, and you should output all the buffered content (if any). if you write your index into several files, you need to fuse them here.
public void Close() throws IOException { for(String key: this.map.keySet()){ String tonkenList = this.map.get(key).toString(); this.writer.write(key+";"+tonkenList.substring(0,tonkenList.length()-1)); this.writer.newLine(); this.writer.flush(); } this.writer.close(); this.idWriter.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void close() throws IOException{\n\t\tSystem.out.println(\"Indexed \" + writer.numDocs() + \" Docs!\");\n\t\twriter.commit();\n\t\twriter.close();\n\t}", "public void close() {\n\t\t\n\t\ttry {\n\t\t\tindexWriter.optimize();\n\t\t\t\n\t\t\tindexWriter.close();\n\t\t\t\n\t\t\tIndexSearcher = new IndexSearcher(idx);\n\t\t\t\n\t\t} catch (CorruptIndexException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t}", "public void closeWriter () {\n try {\n writer.close();\n indexDir.close();\n indexHandler = null;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void close() throws CorruptIndexException, IOException {\n\n\t\tidxWriter.forceMerge(1);\n\t\tidxWriter.commit();\n\t\tidxWriter.close();\n\t}", "public void closeIndexWriter() throws IOException {\n if(indexWriter != null) {\n try {\n indexWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public void close() throws IndexerException {\n\t\t//TODO\n\t\t\n\t}", "public void close() throws IndexException {\n }", "public void WriteIndex() throws Exception {\n CorpusReader corpus = new CorpusReader();\n // initiate the output object\n IndexWriter output = new IndexWriter();\n\n // Map to hold doc_id and doc content;\n Map<String, String> doc;\n\n // index the corpus, load the doc one by one\n while ((doc = corpus.NextDoc()) != null){\n // get the doc_id and content of the current doc.\n String doc_id = doc.get(\"DOC_ID\");\n String content = doc.get(\"CONTENT\");\n\n // index the doc\n output.IndexADoc(doc_id, content);\n }\n output.close_index_writer();\n }", "public void close() throws IOException {\n for (var dos : dataStreams) {\n if (dos != null) {\n dos.close();\n }\n }\n\n for (var dos : indexStreams) {\n if (dos != null) {\n dos.close();\n }\n }\n\n // Stats\n log.info(\"Number of keys: {}\", keyCount);\n log.info(\"Number of values: {}\", valueCount);\n\n var bloomFilter = config.getBoolean(Configuration.BLOOM_FILTER_ENABLED) ?\n new BloomFilter(keyCount, config.getDouble(Configuration.BLOOM_FILTER_ERROR_FACTOR, 0.01)) :\n null;\n\n\n // Prepare files to merge\n List<File> filesToMerge = new ArrayList<>();\n try {\n // Build index file\n for (int i = 0; i < indexFiles.length; i++) {\n if (indexFiles[i] != null) {\n filesToMerge.add(buildIndex(i, bloomFilter));\n }\n }\n\n //Write metadata file\n File metadataFile = new File(tempFolder, \"metadata.dat\");\n metadataFile.deleteOnExit();\n try (var metadataOutputStream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(metadataFile)))) {\n writeMetadata(metadataOutputStream, bloomFilter);\n }\n\n filesToMerge.add(0, metadataFile);\n\n // Stats collisions\n log.info(\"Number of collisions: {}\", collisions);\n\n // Add data files\n for (File dataFile : dataFiles) {\n if (dataFile != null) {\n filesToMerge.add(dataFile);\n }\n }\n\n // Merge and write to output\n checkFreeDiskSpace(filesToMerge);\n mergeFiles(filesToMerge, outputStream);\n } finally {\n outputStream.close();\n cleanup(filesToMerge);\n }\n }", "@Override\n public void close() throws IOException {\n flushCurrentIndexBlock();\n\n // logger.info(\"Performing final merge\");\n // try {\n //Bin finalMergeBin = geometricParts.getAllShards();\n //doMerge(finalMergeBin, getNextIndexShardFolder(finalMergeBin.size + 1));\n // check point is updated by the merge op.\n\n // } catch (IOException ex) {\n // Logger.getLogger(GeometricRetrieval.class.getName()).log(Level.SEVERE, null, ex);\n //}\n\n }", "public void Close() throws IOException, ClassNotFoundException {\n\t\tsaveBlock(); \n\t\tmergeAllIndex();\n\t\tsaveToken();\n\t\tdocIdx.close();\n\t}", "@Override\n public void close()\n {\n notifyLegacyIndexOperationQueue();\n\n }", "public void close(){\r\n\t\tif (this.fileWriter != null){\r\n\t\t\ttry {\r\n\t\t\t\tthis.fileWriter.flush();\r\n\t\t\t\tthis.fileWriter.close();\r\n\t\t\t\tthis.fileWriter = null;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tlogger.error(\"Cannot close the file handle \"+this.myfilename+\". Your results might be lost. Cause: \"+e.getMessage());\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\r\n\t\t}\r\n\t}", "public void Close() throws IOException {\n\n\t\ttermFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(Path.ResultHM1+type+Path.TermDir), \"utf-8\"));\n\t\t// Write to term file\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(String term: term2termid.keySet()){\n\t\t\tsb.append(term + \" \" + term2termid.get(term) + \"\\n\");\n\t\t}\n\t\ttermFile.write(sb.toString());\n\t\ttermFile.close();\n\t\tterm2termid.clear();\n\n\t\t// Write to docVector\n\t\tWriteDocFile();\n\t\t// Write to posting file\n\t\tWritePostingFile();\n\n\t}", "public void flush() {\n synchronized (getLock()) {\n sIndexWritersCache.flush(this);\n sIndexReadersCache.removeIndexReader(this);\n }\n }", "@Override\n public void close() {\n backingIterator.close();\n outputBuffer.close();\n isClosed = true;\n }", "public void flush(String filename) throws IOException {\n // open the file\n // the false part means that the buffer won't be automatically flushed\n // we flush after every term\n PrintStream out = new PrintStream(new BufferedOutputStream(\n new FileOutputStream(filename)), false);\n\n // STORE THE INDEX\n\n // an iterator over all terms\n Iterator i = index.keySet().iterator();\n\n // temporary variables\n Iterator docs;\n HashMap docList;\n String doc;\n int[] t;\n\n // the first line is the number of terms\n out.println(index.size());\n String word;\n\n // loop through each term\n while (i.hasNext()) {\n word = (String) i.next();\n\n // print the term\n out.println(word);\n\n // get variables to loop through documents containing the term\n docList = (HashMap) index.get(word);\n docs = docList.keySet().iterator();\n\n // loop through documents containing the term\n while (docs.hasNext()) {\n // get the document and frequency\n doc = (String) docs.next();\n t = (int[]) docList.get(doc);\n\n // store the document and frequency\n out.println(doc);\n out.println(t[0]);\n }\n\n // put another newline on there and flush the buffer\n out.println();\n out.flush();\n }\n\n // close the file\n out.close();\n }", "public void commit () throws IOException {\n log.info(\"Internal committing index ... \");\n this.writer().commit();\n commitCounter = 0;\n this.closeReader();\n }", "private IndexHandler (boolean test) throws IOException {\n analyzer = new StandardAnalyzer();\n indexDir = test ? new RAMDirectory() : new DistributedDirectory(new MongoDirectory(mongoClient, \"search-engine\", \"index\"));\n //storePath = storedPath;\n config = new IndexWriterConfig(analyzer);\n\n // write separate IndexWriter to RAM for each IndexHandler\n // writer will have to be manually closed with each instance call\n // see IndexWriter documentation for .close()\n // explaining continuous closing of IndexWriter is an expensive operation\n try {\n writer = new IndexWriter(indexDir, config);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@SuppressWarnings(\"unused\")\n public void buildIndex() throws IOException {\n indexWriter = getIndexWriter(indexDir);\n ArrayList <JSONObject> jsonArrayList = parseJSONFiles(JSONdir);\n indexTweets(jsonArrayList, indexWriter);\n indexWriter.close();\n }", "public void close() throws IOException {\r\n writer.close();\r\n }", "public void finishedDirectIndexBuild()\n\t{\n\t\tif(logger.isInfoEnabled()){\n\t\t\tlogger.info(\"flushing utf block lexicon to disk after the direct index completed\");\n\t\t}\n\t\t//only write a temporary lexicon if there are any items in it\n\t\tif (TempLex.getNumberOfNodes() > 0)\n\t\t\twriteTemporaryLexicon();\n\n\t\t//merges the temporary lexicons\n\t\tif (tempLexFiles.size() > 0)\n\t\t{\n\t\t\ttry{\n\t\t\t\tmerge(tempLexFiles);\n\t\n\t\t\t\t//creates the offsets file\n\t\t\t\tfinal String lexiconFilename = \n\t\t\t\t\tindexPath + ApplicationSetup.FILE_SEPARATOR + \n\t\t\t\t\tindexPrefix + ApplicationSetup.LEXICONSUFFIX;\n\t\t\t\tLexiconInputStream lis = getLexInputStream(lexiconFilename);\n\t\t\t\tcreateLexiconIndex(\n\t\t\t\t\tlis,\n\t\t\t\t\tlis.numberOfEntries(),\n\t\t\t\t\t/* after inverted index is built, the lexicon will be transformed into a\n\t\t\t\t\t * normal lexicon, without block frequency */\n\t\t\t\t\tUTFLexicon.lexiconEntryLength\n\t\t\t\t\t); \n\t\t\t\tTermCount = lis.numberOfEntries();\n\t\t\t\tif (index != null)\n\t\t\t\t{\n\t\t\t\t\tindex.addIndexStructure(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexicon\");\n\t\t\t\t\tindex.addIndexStructureInputStream(\"lexicon\", \"uk.ac.gla.terrier.structures.UTFBlockLexiconInputStream\");\n\t\t\t\t\tindex.setIndexProperty(\"num.Terms\", \"\"+lis.numberOfEntries());\n\t\t\t\t\tindex.setIndexProperty(\"num.Pointers\", \"\"+lis.getNumberOfPointersRead());\n\t\t\t\t}\n\t\t\t} catch(IOException ioe){\n\t\t\t\tlogger.error(\"Indexing failed to write a lexicon index file to disk\", ioe);\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t\tlogger.warn(\"No temporary lexicons to merge, skipping\");\n\t\t\n\t}", "public void truncate() {\n\t\ttry {\n\t\t\t_reopenToken = _trackingIndexWriter.deleteAll();\n\t\t\tlog.warn(\"lucene index truncated\");\n\t\t} catch(IOException ioEx) {\n\t\t\tlog.error(\"Error truncating lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t \t\t \t ioEx);\t\t\t\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t_indexWriter.commit(); \n\t\t\t} catch (IOException ioEx) {\n\t\t\t\tlog.error(\"Error truncating lucene index: {}\",ioEx.getMessage(),\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t ioEx);\n\t\t\t}\n\t\t}\n\t}", "@Override\npublic void close() throws IOException, JoinsException, SortException, IndexException {\n\t\n}", "public void close() throws IOException\n {\n writer.close();\n }", "public synchronized void close() throws IOException {\n\t\tif (journalWriter == null) {\n\t\t\treturn; // already closed\n\t\t}\n\t\tfor (Entry entry : new ArrayList<Entry>(lruEntries.values())) {\n\t\t\tif (entry.currentEditor != null) {\n\t\t\t\tentry.currentEditor.abort();\n\t\t\t}\n\t\t}\n\t\ttrimToSize();\n\t\tjournalWriter.close();\n\t\tjournalWriter = null;\n\t}", "public void clear() throws IOException {\n\t\tindexWriter.deleteAll();\n\t\tforceCommit();\n\t}", "@Override\r\n public void close() throws IOException {\r\n IOException ioException = null;\r\n for (WriterInfo writerInfo : mWriters) {\r\n try {\r\n Writer writer = writerInfo.getWriter();\r\n if (writerInfo.getOwned()) {\r\n writer.close();\r\n } else {\r\n writer.flush();\r\n }\r\n } catch(IOException ioex) {\r\n ioException = ioex;\r\n }\r\n }\r\n if (ioException != null) {\r\n throw ioException;\r\n }\r\n }", "public void close() throws IOException {\n\t\tif (keyClass != null) {\n\t\t keySerializer.close();\n\t\t valueSerializer.close();\n\t\t}\n\n\t\t// Write EOF_MARKER for key/value length\n\t\tWritableUtils.writeVInt(out, EOF_MARKER);\n\t\tWritableUtils.writeVInt(out, EOF_MARKER);\n\t\tdecompressedBytesWritten += 2 * WritableUtils.getVIntSize(EOF_MARKER);\n \n\t\t//Flush the stream\n\t\tout.flush();\n \n\t\tif (compressOutput) {\n\t\t // Flush\n\t\t compressedOut.finish();\n\t\t compressedOut.resetState();\n\t\t}\n \n\t\t// Close the underlying stream iff we own it...\n\t\tif (ownOutputStream) {\n\t\t out.close();\n\t\t}\n\t\telse {\n\t\t // Write the checksum\n\t\t checksumOut.finish();\n\t\t}\n\n\t\tcompressedBytesWritten = rawOut.getPos() - start;\n\n\t\tif (compressOutput) {\n\t\t // Return back the compressor\n\t\t CodecPool.returnCompressor(compressor);\n\t\t compressor = null;\n\t\t}\n\n\t\tout = null;\n\t\tif(writtenRecordsCounter != null) {\n\t\t writtenRecordsCounter.increment(numRecordsWritten);\n\t\t}\n\t }", "void index(IDocument document, IIndexerOutput output) throws java.io.IOException;", "public void closeFile() throws IOException {\n finstream.close();\n writer.close();\n }", "@Override\n public void close() throws IOException {\n flush();\n }", "private IndexWriter getIndexWriter() throws IOException {\n\n\t\tAnalyzer a = getAnaLyzer();\n\n\t\tif (idxWriter == null) {\n\n\t\t\tindexPath = this.analyzer + \" index-directory\";\n\t\t\tDirectory indexDir = FSDirectory.open(Paths.get(indexPath));\n\t\t\tIndexWriterConfig config = new IndexWriterConfig(a);\n\n\t\t\tconfig.setOpenMode(OpenMode.CREATE);\n\n\t\t\tidxWriter = new IndexWriter(indexDir, config);\n\t\t}\n\n\t\treturn idxWriter;\n\t}", "public void printIndex(Path outFile) throws IOException {\n\t\tSimpleJsonWriter.asDoubleNested(invertedIndex, outFile);\n\t}", "@Override\n public void close() throws IOException\n {\n try {\n mergingIterator.close();\n }\n finally {\n cleanup.run();\n }\n }", "private void flushCurrentIndexBlock() throws IOException {\n if (currentMemoryIndex.documentsInIndex() < 1) {\n return;\n }\n\n logger.info(\"Flushing current memory Index. id = \" + indexBlockCount);\n\n final MemoryIndex flushingMemoryIndex = currentMemoryIndex;\n final File shardFolder = getNextIndexShardFolder(1);\n\n try {\n // reset the current index\n // - this makes the flush operation thread safe while continuing to add new documents.\n resetCurrentMemoryIndex();\n } catch (Exception ex) {\n throw new IOException(ex);\n }\n\n try {\n // first flush the index to disk\n FlushToDisk.flushMemoryIndex(flushingMemoryIndex, shardFolder.getAbsolutePath(), false);\n\n // indicate that the flushing part of this thread is done\n synchronized (geometricParts) {\n // add flushed index to the set of bins -- needs to be a synconeous action\n geometricParts.add(0, shardFolder.getAbsolutePath());\n updateIndex();\n flushingMemoryIndex.close();\n }\n\n } catch (IOException e) {\n logger.severe(e.toString());\n }\n }", "@Override\n public void closeExportWriter() {\n }", "private static void closeAll() {\n try {\n outputFileBuffer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n Encog.getInstance().shutdown();\n }", "int writerIndex();", "public void indexFileOrDirectory(String fileName) {\r\n\r\n addFiles(new File(fileName));\r\n\r\n int originalNumDocs = writer.numRamDocs();\r\n for (File f : queue) {\r\n try {\r\n Document doc = new Document();\r\n\r\n // Creation of a simpledateformatter in order to print the last-modified-date of our files.\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\r\n String date = sdf.format(f.lastModified());\r\n\r\n if (f.getName().endsWith(\".html\")) {\r\n\r\n // Creation of a jsoup document to help us with our html parsing.\r\n org.jsoup.nodes.Document htmlFile = Jsoup.parse(f, null);\r\n String body = htmlFile.body().text();\r\n String title = htmlFile.title();\r\n String summary = getSummary(htmlFile);\r\n\r\n\r\n doc.add(new TextField(\"contents\", body + \" \" + title + \" \" + date, Field.Store.YES));\r\n doc.add(new TextField(\"title\", title, Field.Store.YES));\r\n doc.add(new StringField(\"path\", f.getPath(), Field.Store.YES));\r\n doc.add(new TextField(\"modified-date\", date, Field.Store.YES));\r\n doc.add(new StringField(\"summary\", summary, Field.Store.YES));\r\n\r\n }\r\n else {\r\n String content = FileUtils.readFileToString(f, StandardCharsets.UTF_8);\r\n\r\n doc.add(new TextField(\"contents\", content + \" \" + date, Field.Store.YES));\r\n doc.add(new StringField(\"path\", f.getPath(), Field.Store.YES));\r\n doc.add(new TextField(\"modified-date\", date, Field.Store.YES));\r\n }\r\n doc.add(new StringField(\"filename\", f.getName(), Field.Store.YES));\r\n\r\n writer.addDocument(doc);\r\n System.out.println(\"Added: \" + f);\r\n } catch (Exception e) {\r\n System.out.println(\"Could not add: \" + f);\r\n }\r\n }\r\n\r\n int newNumDocs = writer.numDocs();\r\n System.out.println(\"\");\r\n System.out.println(\"************************\");\r\n System.out.println((newNumDocs - originalNumDocs) + \" documents added.\");\r\n System.out.println(\"************************\");\r\n\r\n queue.clear();\r\n }", "private void blockCompressAndIndex(String in, String bgzfOut, boolean deleteOnExit) throws IOException {\n\t\t\n\t\t// System.err.print(\"Compressing: \" + in + \" to file: \" + bgzfOut + \"... \");\n\t\t\n\t\tFile inFile= new File(in);\n\t\tFile outFile= new File(bgzfOut);\n\t\t\n\t\tLineIterator lin= IOUtils.openURIForLineIterator(inFile.getAbsolutePath());\n\n\t\tBlockCompressedOutputStream writer = new BlockCompressedOutputStream(outFile);\n\t\tlong filePosition= writer.getFilePointer();\n\t\t\n\t\tTabixIndexCreator indexCreator=new TabixIndexCreator(TabixFormat.BED);\n\t\tBedLineCodec bedCodec= new BedLineCodec();\n\t\twhile(lin.hasNext()){\n\t\t\tString line = lin.next();\n\t\t\tBedLine bed = bedCodec.decode(line);\n\t\t\tif(bed==null) continue;\n\t\t\twriter.write(line.getBytes());\n\t\t\twriter.write('\\n');\n\t\t\tindexCreator.addFeature(bed, filePosition);\n\t\t\tfilePosition = writer.getFilePointer();\n\t\t}\n\t\twriter.flush();\n\t\t\n\t\t// System.err.print(\"Indexing... \");\n\t\t\n\t\tFile tbi= new File(bgzfOut + TabixUtils.STANDARD_INDEX_EXTENSION);\n\t\tif(tbi.exists() && tbi.isFile()){\n\t\t\twriter.close();\n\t\t\tthrow new RuntimeException(\"Index file exists: \" + tbi);\n\t\t}\n\t\tIndex index = indexCreator.finalizeIndex(writer.getFilePointer());\n\t\tindex.writeBasedOnFeatureFile(outFile);\n\t\twriter.close();\n\n\t\t// System.err.println(\"Done\");\n\t\t\n\t\tif(deleteOnExit){\n\t\t\toutFile.deleteOnExit();\n\t\t\tFile idx= new File(outFile.getAbsolutePath() + TabixUtils.STANDARD_INDEX_EXTENSION);\n\t\t\tidx.deleteOnExit();\n\t\t}\n\t}", "public void closeWriter() throws IOException{\n if(isOpen){\n dataWriter.close();\n }\n }", "private void endDoc() {\n\t\ttry {\n\t\t\t// Report the end of the document to the IndexListener\n\t\t\tindexer.getListener().documentDone(currentDocumentName);\n\n\t\t\t// Store the captured document content in the content store\n\t\t\t// and add the contents of the complex field to the Lucene document\n\t\t\taddContentToLuceneDoc();\n\n\t\t\t// Add the Lucene document to the index\n\t\t\tindexer.add(currentLuceneDoc);\n\n\t\t\t// Report character progress\n\t\t\treportCharsProcessed();\n\n\t\t\t// Reset the contents field for the next document\n\t\t\tcontentsField.clear();\n\n\t\t\t// Should we continue or are we done?\n\t\t\tif (!indexer.continueIndexing())\n\t\t\t\tthrow new MaxDocsReachedException();\n\n\t\t} catch (MaxDocsReachedException e) {\n\n\t\t\t// We've reached our maximum number of documents we'd like to index.\n\t\t\t// This is okay; just rethrow it.\n\t\t\tthrow e;\n\n\t\t} catch (Exception e) {\n\n\t\t\t// Some error occurred.\n\t\t\tthrow ExUtil.wrapRuntimeException(e);\n\n\t\t}\n\t}", "public void close() {\n try { out.flush(); } catch (Exception e) {}; // just to be sure\n \n cleanup();\n }", "@Test\n public void close() throws Exception {\n ResizeRequest request = new ResizeRequest(\"target_index\", \"source_index\");\n /** 可选参数*/\n\n AcknowledgedResponse response = synchronousShrink(client, request);\n log.info(\"Shrink索引:{}成功?:{}\", Consts.INDEX_NAME, response.isAcknowledged());\n\n }", "public void close() throws IOException {\n\t\tout.flush();\n\t\tout.close();\n\t}", "@Override\n public void close() throws IOException \n { \n decorator.flush(entries);\n }", "public void close(){\n\t\ttry {\n\t\t\tout.close();\n\t\t\tout = null;\n\t\t}\n\t\tcatch (IOException e){\n\t\t\tSystem.out.println(\"Problem closing file.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void deleteIndex() throws IOException {\n synchronized (getLock()) {\n flush();\n if (ZimbraLog.index_add.isDebugEnabled()) {\n ZimbraLog.index_add.debug(\"Deleting index \" + luceneDirectory);\n }\n\n String[] files;\n try {\n files = luceneDirectory.listAll();\n } catch (NoSuchDirectoryException ignore) {\n return;\n } catch (IOException e) {\n ZimbraLog.index_add.warn(\"Failed to delete index: %s\",\n luceneDirectory, e);\n return;\n }\n\n for (String file : files) {\n luceneDirectory.deleteFile(file);\n }\n }\n }", "protected void close()\n {\n out.close();\n }", "@Override\n\t\tpublic void close() throws IOException {\n\t\t\tout.close();\n\t\t}", "public void close() {\n\t\tif (taxonomyAccessor != null && taxonomyWriter != null) {\n\t\t\ttaxonomyAccessor.release(taxonomyWriter);\n\t\t}\n\t}", "public void indexCreate()\n {\n try{\n Directory dir = FSDirectory.open(Paths.get(\"indice/\"));\n Analyzer analyzer = new StandardAnalyzer();\n IndexWriterConfig iwc = new IndexWriterConfig(analyzer);\n iwc.setOpenMode(OpenMode.CREATE);\n IndexWriter writer = new IndexWriter(dir,iwc);\n MongoConnection mongo = MongoConnection.getMongo();\n mongo.OpenMongoClient();\n DBCursor cursor = mongo.getTweets();\n Document doc = null;\n\n while (cursor.hasNext()) {\n DBObject cur = cursor.next();\n if (cur.get(\"retweet\").toString().equals(\"false\")) {\n doc = new Document();\n doc.add(new StringField(\"id\", cur.get(\"_id\").toString(), Field.Store.YES));\n doc.add(new TextField(\"text\", cur.get(\"text\").toString(), Field.Store.YES));\n doc.add(new StringField(\"analysis\", cur.get(\"analysis\").toString(), Field.Store.YES));\n //doc.add(new StringField(\"finalCountry\",cur.get(\"finalCountry\").toString(),Field.Store.YES));\n doc.add(new StringField(\"userScreenName\", cur.get(\"userScreenName\").toString(), Field.Store.YES));\n doc.add(new StringField(\"userFollowersCount\", cur.get(\"userFollowersCount\").toString(), Field.Store.YES));\n doc.add(new StringField(\"favoriteCount\", cur.get(\"favoriteCount\").toString(), Field.Store.YES));\n\n if (writer.getConfig().getOpenMode() == OpenMode.CREATE) {\n System.out.println(\"Indexando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.addDocument(doc);\n System.out.println(doc);\n } else {\n System.out.println(\"Actualizando el tweet: \" + doc.get(\"text\") + \"\\n\");\n writer.updateDocument(new Term(\"text\" + cur.get(\"text\")), doc);\n System.out.println(doc);\n }\n }\n }\n cursor.close();\n writer.close();\n }\n catch(IOException ioe){\n System.out.println(\" Error en \"+ ioe.getClass() + \"\\n mensaje: \" + ioe.getMessage());\n }\n }", "@Override\n public void close() throws IOException\n {\n _out.close();\n }", "public void forceFlush() throws IOException {\n flushCurrentIndexBlock();\n }", "public static void writeMultipleIndex(/*File directory,*/ JarOutputStream jarOutputStream, Collection collection, HashMap books) throws IOException\n\t{\n\t\t// Write out the main bible index\n\t\t\n//\t\tDataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(new File(directory, \"Index\"))));\n\n\t\tByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n\t\tDataOutputStream output = new DataOutputStream(byteArrayOutputStream);\n\t\t\n\t\t// Write out the number of books\n\t\toutput.write(collection.books.size());\n\t\t\n\t\t// Write the number of chapters and verses for each book\n\t\tfor (Enumeration e = collection.books.elements(); e.hasMoreElements(); )\n\t\t{\n\t\t\tBook collectionBook = (Book) e.nextElement();\n\t\t\tBook thmlBook = (Book) books.get(collectionBook.name);\n\t\t\t// Write the book name\n\t\t\toutput.writeUTF(thmlBook.name);\n\t\t\t\n\t\t\t// Write the book's file name\n\t\t\toutput.writeUTF(thmlBook.fileName);\n\n\t\t\t// Write the start chapter and number of chapters\n\t\t\toutput.writeShort(collectionBook.startChapter);\n\t\t\toutput.writeShort(collectionBook.endChapter - collectionBook.startChapter + 1);\n\t\t\t\n\t\t\tint fileNumber = 0;\n\t\t\tint fileLength = 0;\n\t\t\t\n\t\t\tfor (int i = collectionBook.startChapter; i <= collectionBook.endChapter; i++ )\n\t\t\t{\n\t\t\t\tChapter chapter = (Chapter) thmlBook.chapters.elementAt(i - thmlBook.startChapter);\n\n\t\t\t\tif (COMBINED_CHAPTERS)\n\t\t\t\t{\n\t\t\t\t\t// If this isn't the first chapter for the file and the length of the\n\t\t\t\t\t// next chapter will be greater than the maximum allowed file length\n\t\t\t\t\t// then put this chapter into the next file\n\t\t\t\t\tif ((fileLength != 0) && ((fileLength + chapter.allVerses.length() - MAX_FILE_SIZE) > (MAX_FILE_SIZE - fileLength)))\n\t\t\t\t\t{\n\t\t\t\t\t\tfileNumber++;\n\t\t\t\t\t\tfileLength = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tfileLength += chapter.allVerses.length();\n\t\t\t\t\tchapter.fileNumber = fileNumber;\n\n\t\t\t\t\toutput.write(fileNumber);\n\t\t\t\t\toutput.writeInt(chapter.allVerses.length());\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tSystem.err.printf(\"chapter %d num verses: %d length %d\\n\", i, chapter.verses.size(), chapter.allVerses.length());\n\t\t\t\toutput.write(chapter.verses.size());\n\t\t\t}\n\t\t}\n\t\t\n\t\toutput.close();\n\t\t\n\t\t// Get the bytes of the index so that they can be written to the JAR file\n\t\tbyte[] byteArray = byteArrayOutputStream.toByteArray();\n\t\t\n\t\tjarOutputStream.putNextEntry(new JarEntry(\"Bible Data/Index\"));\n\t\tjarOutputStream.write(byteArray, 0, byteArray.length);\n\t}", "public void writeToFile(StringBuilder text)throws IOException{\n\n Path filePath = Paths.get(\"index.txt\");\n if (!Files.exists(filePath)) {\n \t Files.createFile(filePath);\n \t}\n \tFiles.write(filePath, text.toString().getBytes(), StandardOpenOption.APPEND);\n }", "@Override\n protected void cleanup(Context context) throws IOException, InterruptedException {\n logger.info(\"Cleanup\");\n super.cleanup(context);\n for (java.util.Map.Entry<String, FullImageMetadata> entry : indexer.getEntries().entrySet()) {\n String surt = entry.getKey();\n context.write(new Text(surt), entry.getValue());\n }\n }", "public void close() {\n this.output.flush();\n this.output.close();\n }", "private synchronized void criarIndice() throws Exception {\r\n\t\tIndexWriter indexWriter = getWriterPadrao(true);\r\n\t\ttry {\r\n\t\t\tindexWriter.getAnalyzer().close();\r\n\t\t\tindexWriter.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public synchronized void close() throws IOException {\n\t\t\tfinish();\n\t\t\tout.close();\n\t\t}", "private void updateIndex() throws IOException {\n // maintain the document store (corpus) - if there is one\n if (currentMemoryIndex.containsPart(\"corpus\")) {\n // get all corpora + shove into document store\n ArrayList<DocumentReader> readers = new ArrayList<>();\n readers.add((DocumentReader) currentMemoryIndex.getIndexPart(\"corpus\"));\n for (String path : geometricParts.getAllShards().getBinPaths()) {\n String corpus = path + File.separator + \"corpus\";\n readers.add(new CorpusReader(corpus));\n }\n }\n // finally write new checkpointing data (checkpoints the disk indexes)\n Parameters checkpoint = createCheckpoint();\n this.checkpointer.saveCheckpoint(checkpoint);\n }", "@Override\n\t public synchronized void close() throws IOException {\n\t\tout.close();\n\t\topen = false;\n\t }", "public void closeAll() throws IOException {\n\t\tfor (BufferedWriter writer : writers.values()) {\n\t\t\twriter.close();\n\t\t}\n\t\twriters.clear();\n\t}", "public void close()\n throws IOException\n {\n outstream.close();\n }", "public void flush()\r\n\tthrows IOException\r\n\t{\r\n\tgetWriter().flush();\r\n\treturn;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t public void close() throws IOException, InterruptedException {\r\n\t for (RecordWriter writer : recordWriters.values()) {\r\n\t writer.close(context);\r\n\t }\r\n\t }", "public void close() {\n\t\tSystem.out.println(\"WordReader.close\");\n\t}", "@Override\n public void close() throws IOException {\n try\n {\n if (outputStream != null)\n {\n outputStream.flush();\n outputStream.close();\n }\n if (workbook != null)\n {\n workbook.dispose();\n workbook.close();\n }\n }\n catch (IOException e)\n {\n throw new IOException(e);\n }\n }", "public void reopen() throws IOException {\r\n writer.close();\r\n writer = new BufferedWriter(new java.io.FileWriter(file));\r\n }", "@Override\n\t\tpublic void close(final TaskAttemptContext ctx) throws IOException,\n\t\t\t\tInterruptedException {\n\n\t\t\ttry {\n\n\t\t\t\tif (docs.size() > 0) {\n\t\t\t\t\tserver.add(docs);\n\t\t\t\t\tdocs.clear();\n\t\t\t\t}\n\n\t\t\t\tserver.commit();\n\t\t\t} catch (SolrServerException e) {\n\t\t\t\tRuntimeException exc = new RuntimeException(e.toString(), e);\n\t\t\t\texc.setStackTrace(e.getStackTrace());\n\t\t\t\tthrow exc;\n\t\t\t} finally {\n\t\t\t\tserver.close();\n\t\t\t\texec.shutdownNow();\n\t\t\t}\n\n\t\t}", "public static void main(String[] args) throws IOException {\n\t\tif (args.length != 2) {\n\t\t\tSystem.err\n\t\t\t\t\t.println(\"You need to give database directory path and output directory path as arguments.\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tdirectory = args[0];\n\t\toutputFilePath = args[1];\n\t\t// Get list of all files.\n\t\tFile[] listOfFiles = Util.getAllFiles(directory);\n\t\t// Get all the stop words in the sorted order.\n\t\tTreeMap<String, String> stopWords = Util\n\t\t\t\t.getStopWordsFromFile(stopWordFile);\n\t\tint numberOfFiles = listOfFiles.length;\n\t\t// 2D array to store the required information about each doc.\n\t\tInteger[][] docInfo = new Integer[numberOfFiles + 1][2];\n\t\tdouble timeForIndexVersion1 = 0.0d, timeForIndexVersion2 = 0.0d;\n\t\tlong startTime, endTime;\n\t\tif (numberOfFiles != 0) {\n\n\t\t\t// Starting creating Index version 1.\n\t\t\tstartTime = System.currentTimeMillis();\n\t\t\tfor (File file : listOfFiles) {\n\t\t\t\t// Get the doc id.\n\t\t\t\tint docId = Integer.parseInt(file.getName().substring(9));\n\t\t\t\t// For version 1:\n\t\t\t\t// do lemmatization\n\t\t\t\tMap<String, Integer> lemmasFromFile = lemmatizer\n\t\t\t\t\t\t.lemmatize(file);\n\t\t\t\t// remove stop words,\n\t\t\t\tMap<String, Integer> lemmasWoStopWords = Util.removeStopWords(\n\t\t\t\t\t\tlemmasFromFile, stopWords);\n\t\t\t\t// create index.\n\t\t\t\tindexVersion1.creatIndex(docId, lemmasWoStopWords);\n\t\t\t}\n\t\t\tendTime = System.currentTimeMillis();\n\t\t\t// calculate total time taken\n\t\t\ttimeForIndexVersion1 = (endTime - startTime) / 1000.0d;\n\n\t\t\t// indexVersion1.printIndex();\n\t\t\t// write uncompressed index of version 1 to a binary file.\n\t\t\tindexVersion1.writeIndexUncompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version1.uncompress\");\n\t\t\t// compress index\n\t\t\tindexVersion1.compressIndex();\n\t\t\t// write compressed index of version 1 to a binary file.\n\t\t\tindexVersion1.writeIndexCompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version1.compress\");\n\n\t\t\t// Starting creating Index version 2.\n\t\t\tstartTime = System.currentTimeMillis();\n\t\t\tfor (File file : listOfFiles) {\n\t\t\t\tint docId = Integer.parseInt(file.getName().substring(9));\n\t\t\t\t// For version 2:\n\t\t\t\t// generate tokens from the file\n\t\t\t\tMap<String, Integer> tokensFromFile = Util\n\t\t\t\t\t\t.getTokensFromFile(file);\n\t\t\t\t// do stemming\n\t\t\t\tMap<String, Integer> stemmedTokens = Util\n\t\t\t\t\t\t.getStemmedTokens(tokensFromFile);\n\t\t\t\t// remove stop words\n\t\t\t\tMap<String, Integer> stemmedTokensWoStopWords = Util\n\t\t\t\t\t\t.removeStopWords(stemmedTokens, stopWords);\n\t\t\t\t// update the information about current document.\n\t\t\t\tUtil.updateDocInfo(docInfo, docId, stemmedTokens,\n\t\t\t\t\t\tstemmedTokensWoStopWords);\n\t\t\t\t// System.out.println(\"DocId: \" + docId + \" Max Freq: \"\n\t\t\t\t// + docInfo[docId][0].toString() + \" Doc length: \"\n\t\t\t\t// + docInfo[docId][1].toString());\n\t\t\t\t// create index\n\t\t\t\tindexVersion2.creatIndex(docId, stemmedTokensWoStopWords);\n\n\t\t\t}\n\t\t\tendTime = System.currentTimeMillis();\n\t\t\t// calculate total time taken\n\t\t\ttimeForIndexVersion2 = (endTime - startTime) / 1000.0d;\n\t\t\t// write documents information to a binary file\n\t\t\twriteDocInfo(docInfo, outputFilePath, \"docs.info\");\n\t\t\t// write uncompressed index of version 2 to a binary file.\n\n\t\t\t// indexVersion2.printIndex();\n\t\t\tindexVersion2.writeIndexUncompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version2.uncompress\");\n\t\t\t// compress index\n\t\t\tindexVersion2.compressIndex();\n\t\t\t// write compressed index of version 2 to a binary file.\n\t\t\tindexVersion2.writeIndexCompressed(outputFilePath,\n\t\t\t\t\t\"Index_Version2.compress\");\n\n\t\t\t// display the required information.\n\t\t\tdisplayOutput(timeForIndexVersion1, timeForIndexVersion2);\n\t\t} else {\n\t\t\tSystem.err.println(\"Empty folder\");\n\t\t}\n\t}", "public void close() throws IOException {\n maxStreamPos = cache.length();\n\n seek(maxStreamPos);\n flushBefore(maxStreamPos);\n super.close();\n cache.close();\n cache = null;\n cacheFile.delete();\n cacheFile = null;\n stream.flush();\n stream = null;\n StreamCloser.removeFromQueue(closeAction);\n }", "public void close() throws IOException {\n FileOutputStream out = new FileOutputStream(fileName);\n wb.write(out);\n\n out.close();\n wb.close();\n }", "@Override\n public void close() {\n try {\n out.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void close() throws IOException\n {\n _writer.writeInt(ENTRY_VALUE_CNT_POSITION, _valCnt);\n \n // Update the tail section\n _writer.writeLong(_minScn);\n _writer.writeLong(_maxScn);\n \n _writer.close();\n _log.info(\"closed: minScn=\" + _minScn + \" maxScn=\" + _maxScn + \" valCnt=\" + _valCnt);\n \n _valCnt = 0;\n _minScn = 0;\n _maxScn = 0;\n }", "public void close() throws IOException {\n wrapper.closeParquetFile(parquetWriterHandler);\n }", "@TestMethod(\"testClose\")\n public void close() throws IOException {\n writer.close();\n }", "public void close() throws DukeException {\n try {\n this.writer.close();\n } catch (IOException e) {\n throw Ui.ioException(e);\n }\n }", "public void createIndex() throws IOException {\n\t\tindexWriter.commit();\n\t\ttaxoWriter.commit();\n\n\t\t// categories\n\t\tfor (Article.Facets f : Article.Facets.values()) {\n\t\t\ttaxoWriter.addCategory(new CategoryPath(f.toString()));\n\t\t}\n\t\ttaxoWriter.commit();\n\n\t\tfinal Iterable<Article> articles = articleRepository.findAll();\n\t\tint c = 0;\n\t\tfor (Article article : articles) {\n\t\t\taddArticle(indexWriter, taxoWriter, article);\n\t\t\tc++;\n\t\t}\n\t\t// commit\n\t\ttaxoWriter.commit();\n\t\tindexWriter.commit();\n\n\t\ttaxoWriter.close();\n\t\tindexWriter.close();\n\n\t\ttaxoDirectory.close();\n\t\tindexDirectory.close();\n\t\tLOGGER.debug(\"{} articles indexed\", c);\n\t}", "protected void close() {\n\t\tthis.writer.stop();\n\t\tsynchronized (this.writer.writer) {\n\t\t\twhile (!this.writer.isFinished()) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.writer.writer.wait();\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tthis.btc.close();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t}\n\n\t\tthis.closed = true;\n\t}", "@Override\n public synchronized void close() throws IOException {\n if (closed) {\n return;\n }\n closed = true;\n if (this.scheduledFuture != null) {\n scheduledFuture.cancel(false);\n this.scheduler.shutdown();\n }\n\n if (batchCount > 0) {\n flush();\n }\n\n try {\n if(jdbcWriter != null){\n jdbcWriter.close();\n }\n } catch (SQLException e) {\n LOG.warn(\"Close JDBC writer failed.\", e);\n }\n\n closeDbConnection();\n }", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "public void close() throws IOException;", "@Override public void close() throws IOException {\r\n\t\tif (closed) return;\r\n\t\tfor (Reader reader: readerQueue) {\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\tclosed = true;\r\n\t}", "public static void writeMultipleBookIndex(/*File directory,*/ JarOutputStream jarOutputStream, Book collectionBook, Book xmlBook) throws IOException\n\t{\n\t\t// Create index file\n\t\t//DataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(new File(directory, \"Index\"))));\n\t\t\n\t\tByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n\t\tDataOutputStream output = new DataOutputStream(byteArrayOutputStream);\n\t\t\n\t\t// Write the verse sizes for every chapter\n\t\tfor (int chapterNumber = collectionBook.startChapter; chapterNumber <= collectionBook.endChapter; chapterNumber++)\n\t\t{\n\t\t\tChapter chapter = (Chapter) xmlBook.chapters.elementAt(chapterNumber - xmlBook.startChapter);\n\t\t\t\n\t\t\tfor (Enumeration e = chapter.verses.elements(); e.hasMoreElements(); )\n\t\t\t{\n\t\t\t\tString verse = (String) e.nextElement();\n\t\t\t\toutput.writeShort(verse.length());\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\toutput.close();\t\t\n\t\t\n\t\tbyte[] byteArray = byteArrayOutputStream.toByteArray();\n\t\t\n\t\tjarOutputStream.putNextEntry(new JarEntry(\"Bible Data/\" + xmlBook.fileName + \"/Index\"));\n\t\t\n\t\tjarOutputStream.write(byteArray, 0, byteArray.length);\n\t}", "public static void save(String indexFileName) throws FileNotFoundException, UnsupportedEncodingException{\n\t\tHashMap<String, String> sCurrentHashMap = globalHash.get(indexFileName);\n\t\t\n\t\tPrintWriter writer = new PrintWriter(indexFileName+\".txt\", \"UTF-8\");\n\n\t\tIterator it = sCurrentHashMap.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tHashMap.Entry<String, String> entry = (HashMap.Entry<String, String>) it.next();\n\t\t\t//if this term appear more than one doc\n\t\t\tif(entry.getValue().length()>1) {\n\t\t\t\tStringTokenizer stDocID = new StringTokenizer(entry.getValue(),\",\");\n\t\t\t\twriter.println(entry.getKey()+\",\"+stDocID.countTokens()+\":<\"+entry.getValue()+\">\");\n\t\t\t} else{\n\t\t\t\twriter.println(entry.getKey()+\",1:<\"+entry.getValue()+\">\");\n\t\t\t}\n\t\t}\n\t\twriter.close();\n\t}", "@Override\n\t\tpublic void close() throws IOException {\n\t\t\t\n\t\t}", "@Override\n public void end(boolean interrupted) {\n index.run(0);\n }", "@Deprecated\r\n\tpublic synchronized void otimizarIndice() throws Exception {\r\n\t\tIndexWriter indexWriter = getWriterPadrao(false);\r\n\t\tindexWriter.forceMerge(50);\r\n\t\tindexWriter.close();\r\n\t}", "@Override\n public void closeCompletely()\n throws XMLStreamException\n {\n _finishDocument(true);\n }", "public synchronized void flush() {\n\t\ttry {\n\t\t\tcloseWriter();\n\t\t} catch(IOException ioe ) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\topenWriter(true);\n\t\t} catch(IOException ioe ) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t}", "public void close() {\r\n\t\tflush();\r\n\t\ttry {\r\n\t\t\tdos.close();\r\n\t\t\ts.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "@Override\n public void close() {\n CloserUtil.close(iterator);\n }" ]
[ "0.788233", "0.77917767", "0.76639414", "0.7625352", "0.7480781", "0.7226295", "0.6904643", "0.6777747", "0.67493135", "0.67010814", "0.6600063", "0.6596496", "0.6475349", "0.64480054", "0.64427716", "0.6404657", "0.6397302", "0.6351259", "0.63132507", "0.6264711", "0.61583054", "0.6149482", "0.61425763", "0.6092168", "0.60630447", "0.60516214", "0.6038052", "0.601697", "0.5977928", "0.5976682", "0.59560806", "0.593485", "0.59174645", "0.59070015", "0.5875617", "0.5864907", "0.58622956", "0.58595586", "0.58558935", "0.5817863", "0.58097565", "0.58087885", "0.58080256", "0.5802909", "0.57894766", "0.57790065", "0.577797", "0.5774381", "0.57678276", "0.57635796", "0.5754576", "0.5753033", "0.5726383", "0.5714042", "0.5688929", "0.5680566", "0.56672376", "0.56670773", "0.566042", "0.5652106", "0.5648072", "0.56242007", "0.56236964", "0.559878", "0.55803883", "0.55618376", "0.55615085", "0.55449957", "0.55361706", "0.5530963", "0.55280966", "0.5522631", "0.55159974", "0.5513443", "0.55121404", "0.5504822", "0.5502643", "0.5499915", "0.5487692", "0.5468488", "0.54414785", "0.5440796", "0.54404515", "0.54404515", "0.54404515", "0.54404515", "0.54404515", "0.54404515", "0.54404515", "0.54404515", "0.5437486", "0.5436911", "0.54347664", "0.5432632", "0.5431849", "0.54303586", "0.5427042", "0.5420165", "0.5412874", "0.5410527" ]
0.6270383
19
Implement action which will be performed by particular endpoint
public abstract HttpResponse<String> buildAction(@Nullable Object object) throws Exception;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Action {\n\n /**\n * Execute.\n *\n * @param router the router\n * @param request the request\n * @return the response\n */\n public Response execute(Router router, Request request);\n\n}", "public interface ApiAction {}", "protected void service(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tString actionType=req.getParameter(\"actionType\");\n\t\tif(actionType.equals(\"query\"))\n\t\t{\n\t\t\tquery(req,resp);\n\t\t}\n\t\tif(actionType.equals(\"kanweizhang\"))\n\t\t{\n\t\t\tkanweizhang(req,resp);\n\t\t}\n\t\tif(actionType.equals(\"tuiweizhang\"))\n\t\t{\n\t\t\ttuiweizhang(req,resp);\n\t\t}\n\t\t\n\t\tif(actionType.equals(\"querywenlei\"))\n\t\t{\n\t\t\tquerywenlei(req,resp);\n\t\t}\n\t}", "void executeAction(String action, Map params,\n IPSAgentHandlerResponse response);", "public abstract void action(UUID uuid);", "public void actionOffered();", "ResponseDTO performServerActions();", "boolean postAccept(Operation operation, HandlerMethod handlerMethod);", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler(exceptionUnmarshallersMap, defaultUnmarshaller);\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }", "public interface Action {\r\n\r\n /**\r\n * Execute the Action based on http request and response\r\n *\r\n * @param req the request\r\n * @param res the response\r\n * @return the jsp page to redirect the user\r\n */\r\n String execute(HttpServletRequest req, HttpServletResponse res);\r\n}", "public void processAction (ActionRequest request, ActionResponse response) \n throws PortletException, java.io.IOException {\n throw new PortletException(\"processAction method not implemented\");\n }", "public abstract void actionReal(HttpResponseCallback callback);", "@Override\r\n\tpublic void processAction(ActionRequest actionRequest,\r\n\t\t\tActionResponse actionResponse) throws IOException, PortletException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.processAction(actionRequest, actionResponse);\r\n\t}", "public abstract void dispatch(ExchangeContext context);", "private void callHandler(String method, HttpServletRequest request, HttpServletResponse response) throws IOException {\n JsonElement payload = getPayload(request, response);\n RequestContext context = new RequestContext(\n request, response, urlVariables, request.getParameterMap(), payload);\n PathNode apiStructure = getApiStructure(method);\n\n if (request.getPathInfo() == null) {\n logger.warn(\"Received \" + method + \" request with empty path.\");\n return;\n }\n\n PathNode.PathNodeResult result = apiStructure.getBindingForSubPath(request.getPathInfo());\n if (result != null) {\n urlVariables.putAll(result.getArgValues());\n result.getApiSpec().apiInterface.call(context);\n }\n }", "void executeEndpoint(DnCxt cxt, DnRequestHandler handler, DnEndpoint endpoint) throws DnException {\n DnSchemaService schemaService = DnSchemaService.get(cxt);\n if (schemaService == null) {\n // Not doing endpoints.\n return;\n }\n\n // Use input type to convert and coerce data.\n DnType in = endpoint.inType;\n var validator = new DnSchemaValidator(cxt, DnSchemaValidator.REQUEST_MODE);\n var data = cloneMap(handler.queryParams);\n if (handler.postData != null ) {\n data.putAll(handler.postData);\n }\n Map<String,Object> requestData;\n try {\n requestData = validator.validateAndCoerce(in, data);\n } catch (DnException e) {\n if (DnException.CONVERSION.equals(e.activity)) {\n throw DnException.mkInput(\"Validation failure in request data.\", e);\n } else {\n throw e;\n }\n }\n\n // Build up a request context.\n var requestCxt = new DnRequestCxt(cxt, requestData, endpoint);\n requestCxt.webRequest = handler;\n\n requestCxt.requestInfo = new DnRequestInfo(handler.userAgent, handler.forwardedFor, handler.isFromLoadBalancer,\n handler.queryParams, handler.postData);\n\n // Execute request.\n endpoint.endpointFunction.executeRequest(requestCxt);\n\n if (!handler.sentResponse) {\n prepareAndSendResponse(requestCxt, endpoint.outType, handler);\n if (!requestCxt.logRequest) {\n handler.logSuccess = false;\n }\n }\n }", "ManagedEndpoint next();", "Object executeMethodCall(String actionName, String inMainParamValue) throws APIException;", "public interface IAction {\n /**\n * request dispatcher.\n * @param request objet resuete\n * @param response objet reponse\n * @return String return if the response is ok or ko\n */\n String execute(HttpServletRequest request, HttpServletResponse response);\n}", "public abstract void handle(Request request, Response response) throws Exception;", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString uri = req.getRequestURI();\r\n\t\tString action = uri.substring(uri.lastIndexOf('/') + 1);\r\n\t\tsession = req.getSession();\r\n\t\tpath = req.getContextPath();\r\n\t\tpw = resp.getWriter();\r\n\t\tSystem.out.println(uri);\r\n\t\tswitch (action) {\r\n\t\tcase \"check\":\r\n\t\t\ttry {\r\n\t\t\t\tthis.checkAction(req,resp);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"index\":\r\n\t\t\tthis.checkSessionAction(req,resp);\r\n\t\t\tbreak;\r\n\t\tcase \"logout\":\r\n\t\t\tthis.logoutAction(req,resp);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public interface Action {\n String execute(HttpServletRequest request);\n}", "public abstract String intercept(ActionInvocation invocation) throws Exception;", "public void request() {\n }", "protected void service(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException {\n\tif (aRequest.getAttribute(\"EXTRANET_METHOD\") == null) {\n\t\tsuper.service(aRequest, aResponse);\n\t} else {\n\t\t// If comming from a forward, determine if GET method should be invoked\n\t\tString lMethod = (String) aRequest.getAttribute(\"EXTRANET_METHOD\");\n\t\tif (lMethod != null && lMethod.equals(\"GET\")) {\n\t\t\tdoGet(aRequest, aResponse);\n\t\t} else {\n\t\t\tsuper.service(aRequest, aResponse);\n\t\t}\n\t}\n}", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "public void handle(String action, String resourceURI, HandlerContext context, Management request, Management response) throws Exception {\n\n if (Transfer.GET_ACTION_URI.equals(action)) {\n response.setAction(Transfer.GET_RESPONSE_URI);\n get(context, request, response);\n return;\n }\n\n if (Transfer.PUT_ACTION_URI.equals(action)) {\n response.setAction(Transfer.PUT_RESPONSE_URI);\n put(context, request, response);\n return;\n }\n if (Transfer.DELETE_ACTION_URI.equals(action)) {\n response.setAction(Transfer.DELETE_RESPONSE_URI);\n delete(context, request, response);\n return;\n }\n if (Transfer.CREATE_ACTION_URI.equals(action)) {\n response.setAction(Transfer.CREATE_RESPONSE_URI);\n create(context, request, response);\n return;\n }\n\n if (Enumeration.ENUMERATE_ACTION_URI.equals(action)) {\n response.setAction(Enumeration.ENUMERATE_RESPONSE_URI);\n Enumeration enuRequest = new Enumeration(request);\n Enumeration enuResponse = new Enumeration(response);\n enumerate( context, enuRequest, enuResponse);\n return;\n }\n if (Enumeration.PULL_ACTION_URI.equals(action)) {\n response.setAction(Enumeration.PULL_RESPONSE_URI);\n final Enumeration enuRequest = new Enumeration(request);\n final Enumeration enuResponse = new Enumeration(response);\n pull( context, enuRequest, enuResponse);\n return;\n }\n if (Enumeration.RELEASE_ACTION_URI.equals(action)) {\n response.setAction(Enumeration.RELEASE_RESPONSE_URI);\n final Enumeration enuRequest = new Enumeration(request);\n final Enumeration enuResponse = new Enumeration(response);\n release( context, enuRequest, enuResponse);\n return;\n }\n\n if(!customDispatch(action, context, request, response))\n throw new ActionNotSupportedFault(action);\n\t\t\n\t}", "Object handle(Object request);", "public void processAction(ActionRequest request, ActionResponse response) throws PortletException, java.io.IOException {\r\n\r\n }", "public void performAction(HandlerData actionInfo) throws ActionException;", "public interface RouteFinish {\n\n String execute(HttpRequest req,HttpResponse res,NextOperation next);\n\n}", "Object executeMethodCall(ActionType actionType, String actionName, Map<String, Object> inParams) throws APIException;", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\t\r\n\t}", "@WebMethod\n URI exposeEndpoint(Endpoint endpoint);", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public abstract void action();", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "protected abstract void action(Object obj);", "public abstract void handle(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ApiException, IOException;", "public void doAction(){}", "@Override\n\tpublic void processAction(ActionRequest actionRequest, ActionResponse actionResponse)\n\t\t\tthrows IOException, PortletException {\n\t\tsuper.processAction(actionRequest, actionResponse);\n\t}", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "public void act() \n {\n // Add your action code here.\n }", "private void handleActionFoo(String param1, String param2){\n\t// TODO: Handle action Foo\n\tthrow new UnsupportedOperationException(\"Not yet implemented\");\n }", "public interface ActionHandler {\n ModelApiResponse handleActionChoice(ActionChoice choice);\n List<AvailableActions> getActionsCurrentlyAvailable();\n}", "public String requestAction1(){\n return \"Response One\";\n }", "@Override\r\n\tpublic Response invoke() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void authorize(String resourceName, String action, String rpcName)\n\t\t\tthrows Exception {\n\t}", "public interface ActionCommand {\n String execute(HttpServletRequest request);\n\n}", "public interface ICommonAction {\n\n void obtainData(Object data, String methodIndex, int status,Map<String, String> parameterMap);\n\n\n}", "@Service\npublic interface EventHandler {\n public AppdirectAPIResponse handleEvent(EventInfo eventInfo);\n}", "public String requestAction2(){\n return \"Response Two\";\n }", "public interface ResourceChangeForMaketService {\n\n void send(Object o,User operator);\n}", "abstract protected void doService(HttpServletRequest request,\r\n\t\t\t\t\t\t\t\t\t HttpServletResponse response) throws ServletException, IOException,ApplicationException;", "@Override\n\tpublic void action() {\n\n\t}", "protected abstract String invoke(HttpServletRequest request) throws DriverException, WorkflowException;", "private void handleActionFoo(String param1, String param2) {\n // TODO: Handle action Foo\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "private void handleActionFoo(String param1, String param2) {\n // TODO: Handle action Foo\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "private void handleActionFoo(String param1, String param2) {\n // TODO: Handle action Foo\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "private void handleActionFoo(String param1, String param2) {\n // TODO: Handle action Foo\n throw new UnsupportedOperationException(\"Not yet implemented\");\n }", "String serviceEndpoint();", "public abstract void onAction();", "private void operation$(HttpAction action) {\n try {\n actOnRDFPatch(action);\n } catch (Exception ex) {\n throw ex;\n }\n ServletOps.success(action);\n }", "@Override\n protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.service(req, resp);\n logger.log(Level.INFO, \"service(req, resp) Invoked\");\n }", "public interface AppFooEndpoint {\n}", "public interface APIClient {\n\n\t// regular expression to parse the action name\n\tPattern actionNamePattern = Pattern.compile(\"violet\\\\.([\\\\w]+)\\\\.([\\\\w]+)\");\n\n\t/**\n\t * The simplest type of call when only one parameter is needed Works only if\n\t * Action type is GET (no side effects)\n\t * \n\t * @param actionName\n\t * @param inMainParamValue\n\t * @return the POJO response\n\t * @throws APIException\n\t */\n\tObject executeMethodCall(String actionName, String inMainParamValue) throws APIException;\n\n\t/**\n\t * A more sophisticated call when multiple structured parameters must be\n\t * passed\n\t * \n\t * @param actionName\n\t * @param inParam\n\t * @return the POJO response\n\t * @throws APIException\n\t */\n\tObject executeMethodCall(ActionType actionType, String actionName, Map<String, Object> inParams) throws APIException;\n\n}", "@Override\r\n\tpublic void execute(ActionContext ctx) {\n\t\t\r\n\t}", "public interface Handle {\n public void handle(HttpExchange httpExchange);\n}", "public abstract Action getAction();", "void configureEndpoint(Endpoint endpoint);", "public void action() {\n action.action();\n }", "interface Action {\n void process(AbstractMessagingService serviceAction,\n Message message);\n\n }", "void dispatchRequest(String urlPath) throws Exception;", "@Override\n public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException {\n LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute(\"dispatcher\");\n if (dispatcher == null) {\n throw new EventHandlerException(\"The local service dispatcher is null\");\n }\n DispatchContext dctx = dispatcher.getDispatchContext();\n if (dctx == null) {\n throw new EventHandlerException(\"Dispatch context cannot be found\");\n }\n\n // get the details for the service(s) to call\n String mode = SYNC;\n String serviceName = null;\n\n if (UtilValidate.isEmpty(event.getPath())) {\n mode = SYNC;\n } else {\n mode = event.getPath();\n }\n\n // we only support SYNC mode in this handler\n if (!SYNC.equals(mode)) {\n throw new EventHandlerException(\"Async mode is not supported\");\n }\n\n // nake sure we have a defined service to call\n serviceName = event.getInvoke();\n if (serviceName == null) {\n throw new EventHandlerException(\"Service name (eventMethod) cannot be null\");\n }\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Set mode/service]: \" + mode + \"/\" + serviceName, MODULE);\n }\n\n // some needed info for when running the service\n Locale locale = UtilHttp.getLocale(request);\n TimeZone timeZone = UtilHttp.getTimeZone(request);\n HttpSession session = request.getSession();\n GenericValue userLogin = (GenericValue) session.getAttribute(\"userLogin\");\n\n // get the service model to generate context(s)\n ModelService modelService = null;\n\n try {\n modelService = dctx.getModelService(serviceName);\n } catch (GenericServiceException e) {\n throw new EventHandlerException(\"Problems getting the service model\", e);\n }\n\n if (modelService == null) {\n throw new EventHandlerException(\"Problems getting the service model\");\n }\n\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Processing]: SERVICE Event\", MODULE);\n }\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Using delegator]: \" + dispatcher.getDelegator().getDelegatorName(), MODULE);\n }\n\n // check if we are using per row submit\n boolean useRowSubmit = request.getParameter(\"_useRowSubmit\") == null ? false\n : \"Y\".equalsIgnoreCase(request.getParameter(\"_useRowSubmit\"));\n\n // check if we are to also look in a global scope (no delimiter)\n boolean checkGlobalScope = request.getParameter(\"_checkGlobalScope\") == null ? true\n : !\"N\".equalsIgnoreCase(request.getParameter(\"_checkGlobalScope\"));\n\n // The number of multi form rows is retrieved\n int rowCount = UtilHttp.getMultiFormRowCount(request);\n if (rowCount < 1) {\n throw new EventHandlerException(\"No rows to process\");\n }\n\n // some default message settings\n String errorPrefixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.error.prefix\", locale);\n String errorSuffixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.error.suffix\", locale);\n String messagePrefixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.message.prefix\", locale);\n String messageSuffixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.message.suffix\", locale);\n\n // prepare the error message and success message lists\n List<Object> errorMessages = new LinkedList<>();\n List<String> successMessages = new LinkedList<>();\n\n boolean eventGlobalTransaction = event.isGlobalTransaction();\n\n // big try/finally to make sure commit or rollback are run\n boolean beganTrans = false;\n String returnString = null;\n try {\n if (eventGlobalTransaction) {\n // start the global transaction\n try {\n beganTrans = TransactionUtil.begin(modelService.getTransactionTimeout() * rowCount);\n } catch (GenericTransactionException e) {\n throw new EventHandlerException(\"Problem starting multi-service global transaction\", e);\n }\n }\n\n // now loop throw the rows and prepare/invoke the service for each\n for (int i = 0; i < rowCount; i++) {\n String curSuffix = UtilHttp.getMultiRowDelimiter() + i;\n boolean rowSelected = false;\n if (UtilValidate.isNotEmpty(request.getAttribute(UtilHttp.getRowSubmitPrefix() + i))) {\n rowSelected = request.getAttribute(UtilHttp.getRowSubmitPrefix() + i) == null ? false\n : \"Y\".equalsIgnoreCase((String) request.getAttribute(UtilHttp.getRowSubmitPrefix() + i));\n } else {\n rowSelected = request.getParameter(UtilHttp.getRowSubmitPrefix() + i) == null ? false\n : \"Y\".equalsIgnoreCase(request.getParameter(UtilHttp.getRowSubmitPrefix() + i));\n }\n\n // make sure we are to process this row\n if (useRowSubmit && !rowSelected) {\n continue;\n }\n\n // build the context\n Map<String, Object> serviceContext = new HashMap<>();\n for (ModelParam modelParam: modelService.getInModelParamList()) {\n String paramName = modelParam.getName();\n\n // Debug.logInfo(\"In ServiceMultiEventHandler processing input parameter [\" + modelParam.name +\n // (modelParam.optional?\"(optional):\":\"(required):\") + modelParam.mode + \"] for service [\" + serviceName + \"]\", MODULE);\n\n // don't include userLogin, that's taken care of below\n if (\"userLogin\".equals(paramName)) continue;\n // don't include locale, that is also taken care of below\n if (\"locale\".equals(paramName)) continue;\n // don't include timeZone, that is also taken care of below\n if (\"timeZone\".equals(paramName)) continue;\n\n Object value = null;\n if (UtilValidate.isNotEmpty(modelParam.getStringMapPrefix())) {\n Map<String, Object> paramMap = UtilHttp.makeParamMapWithPrefix(request, modelParam.getStringMapPrefix(), curSuffix);\n value = paramMap;\n } else if (UtilValidate.isNotEmpty(modelParam.getStringListSuffix())) {\n List<Object> paramList = UtilHttp.makeParamListWithSuffix(request, modelParam.getStringListSuffix(), null);\n value = paramList;\n } else {\n // check attributes; do this before parameters so that attribute which can be changed by code can\n // override parameters which can't\n value = request.getAttribute(paramName + curSuffix);\n\n // first check for request parameters\n if (value == null) {\n String name = paramName + curSuffix;\n\n String[] paramArr = request.getParameterValues(name);\n if (paramArr != null) {\n if (paramArr.length > 1) {\n value = Arrays.asList(paramArr);\n } else {\n value = paramArr[0];\n }\n }\n }\n\n // if the parameter wasn't passed and no other value found, check the session\n if (value == null) {\n value = session.getAttribute(paramName + curSuffix);\n }\n\n // now check global scope\n if (value == null) {\n if (checkGlobalScope) {\n String[] gParamArr = request.getParameterValues(paramName);\n if (gParamArr != null) {\n if (gParamArr.length > 1) {\n value = Arrays.asList(gParamArr);\n } else {\n value = gParamArr[0];\n }\n }\n if (value == null) {\n value = request.getAttribute(paramName);\n }\n if (value == null) {\n value = session.getAttribute(paramName);\n }\n }\n }\n\n // make any composite parameter data (e.g., from a set of parameters {name_c_date, name_c_hour, name_c_minutes})\n if (value == null) {\n value = UtilHttp.makeParamValueFromComposite(request, paramName + curSuffix);\n }\n\n if (value == null) {\n // still null, give up for this one\n continue;\n }\n\n if (value instanceof String && ((String) value).isEmpty()) {\n // interpreting empty fields as null values for each in back end handling...\n value = null;\n }\n }\n // set even if null so that values will get nulled in the db later on\n serviceContext.put(paramName, value);\n\n // Debug.logInfo(\"In ServiceMultiEventHandler got value [\" + value + \"] for input parameter [\" + paramName + \"] for service [\"\n // + serviceName + \"]\", MODULE);\n }\n\n // get only the parameters for this service - converted to proper type\n serviceContext = modelService.makeValid(serviceContext, ModelService.IN_PARAM, true, null, timeZone, locale);\n\n // include the UserLogin value object\n if (userLogin != null) {\n serviceContext.put(\"userLogin\", userLogin);\n }\n\n // include the Locale object\n if (locale != null) {\n serviceContext.put(\"locale\", locale);\n }\n\n // include the TimeZone object\n if (timeZone != null) {\n serviceContext.put(\"timeZone\", timeZone);\n }\n\n // Debug.logInfo(\"ready to call \" + serviceName + \" with context \" + serviceContext, MODULE);\n\n // invoke the service\n Map<String, Object> result = null;\n try {\n result = dispatcher.runSync(serviceName, serviceContext);\n } catch (ServiceAuthException e) {\n // not logging since the service engine already did\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNonNestedMessage());\n } catch (ServiceValidationException e) {\n // not logging since the service engine already did\n request.setAttribute(\"serviceValidationException\", e);\n List<String> errors = e.getMessageList();\n if (errors != null) {\n for (String message: errors) {\n errorMessages.add(\"Service invocation error on row (\" + i + \"): \" + message);\n }\n } else {\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNonNestedMessage());\n }\n } catch (GenericServiceException e) {\n Debug.logError(e, \"Service invocation error\", MODULE);\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNested() + messageSuffixStr);\n }\n\n if (result == null) {\n returnString = ModelService.RESPOND_SUCCESS;\n } else {\n // check for an error message\n String errorMessage = ServiceUtil.makeErrorMessage(result, messagePrefixStr, messageSuffixStr, \"\", \"\");\n if (UtilValidate.isNotEmpty(errorMessage)) {\n errorMessages.add(errorMessage);\n }\n\n // get the success messages\n if (UtilValidate.isNotEmpty(result.get(ModelService.SUCCESS_MESSAGE))) {\n String newSuccessMessage = (String) result.get(ModelService.SUCCESS_MESSAGE);\n if (!successMessages.contains(newSuccessMessage)) {\n successMessages.add(newSuccessMessage);\n }\n }\n if (UtilValidate.isNotEmpty(result.get(ModelService.SUCCESS_MESSAGE_LIST))) {\n List<String> newSuccessMessages = UtilGenerics.cast(result.get(ModelService.SUCCESS_MESSAGE_LIST));\n for (int j = 0; j < newSuccessMessages.size(); j++) {\n String newSuccessMessage = newSuccessMessages.get(j);\n if (!successMessages.contains(newSuccessMessage)) {\n successMessages.add(newSuccessMessage);\n }\n }\n }\n }\n // set the results in the request\n if ((result != null) && (result.entrySet() != null)) {\n for (Map.Entry<String, Object> rme: result.entrySet()) {\n String resultKey = rme.getKey();\n Object resultValue = rme.getValue();\n\n if (resultKey != null && !ModelService.RESPONSE_MESSAGE.equals(resultKey) && !ModelService.ERROR_MESSAGE.equals(resultKey)\n && !ModelService.ERROR_MESSAGE_LIST.equals(resultKey) && !ModelService.ERROR_MESSAGE_MAP.equals(resultKey)\n && !ModelService.SUCCESS_MESSAGE.equals(resultKey) && !ModelService.SUCCESS_MESSAGE_LIST.equals(resultKey)) {\n //set the result to request w/ and w/o a suffix to handle both cases: to have the result in each iteration and to prevent\n // its overriding\n request.setAttribute(resultKey + curSuffix, resultValue);\n request.setAttribute(resultKey, resultValue);\n }\n }\n }\n }\n } finally {\n if (!errorMessages.isEmpty()) {\n if (eventGlobalTransaction) {\n // rollback the global transaction\n try {\n TransactionUtil.rollback(beganTrans, \"Error in multi-service event handling: \" + errorMessages.toString(), null);\n } catch (GenericTransactionException e) {\n Debug.logError(e, \"Could not rollback multi-service global transaction\", MODULE);\n }\n }\n errorMessages.add(0, errorPrefixStr);\n errorMessages.add(errorSuffixStr);\n StringBuilder errorBuf = new StringBuilder();\n for (Object em: errorMessages) {\n errorBuf.append(em + \"\\n\");\n }\n request.setAttribute(\"_ERROR_MESSAGE_\", errorBuf.toString());\n returnString = \"error\";\n } else {\n if (eventGlobalTransaction) {\n // commit the global transaction\n try {\n TransactionUtil.commit(beganTrans);\n } catch (GenericTransactionException e) {\n Debug.logError(e, \"Could not commit multi-service global transaction\", MODULE);\n throw new EventHandlerException(\"Commit multi-service global transaction failed\");\n }\n }\n if (!successMessages.isEmpty()) {\n request.setAttribute(\"_EVENT_MESSAGE_LIST_\", successMessages);\n }\n returnString = \"success\";\n }\n }\n\n return returnString;\n }", "@Override\r\n\tpublic void service(Request request,Response response) {\n\t\tresponse.print(\"lalaa\");\r\n\r\n\t\t\r\n\t}", "protected abstract String getBaseEndpoint();", "protected void doSystemMethod(HttpServletRequest request, HttpServletResponse response, String action) throws ServletException, IOException {\n String _action = request.getParameter(\"$action\");\n // if we didn't get an action via parameter lets use the default for the GET/POST/PUT/DELETE operation\n if (_action == null || _action.length() == 0)\n _action = action;\n // now if the default action was delete only allow deletions (delete only allows delete)\n if (action.equalsIgnoreCase(\"delete\"))\n _action = action;\n // if we have a default action of update then we don't want to query or delete (put only allows insert & update)\n if (action.equalsIgnoreCase(\"update\") && (_action.equalsIgnoreCase(\"delete\") || _action.equalsIgnoreCase(\"query\")))\n _action = \"update\";\n // just incase someone passes something stupid lets reset it to query\n if (!(_action.equalsIgnoreCase(\"query\") || _action.equalsIgnoreCase(\"insert\") || _action.equalsIgnoreCase(\"update\") || _action.equalsIgnoreCase(\"delete\")))\n _action = \"query\";\n\n // now get our path and configuration needed for sql calls\n String dsPath = (String) request.getAttribute(\"_DS_PATH\");\n log.debug(\"attribute dsPath: \" + dsPath);\n if (dsPath == null || dsPath.length() == 0) {\n response.sendError(404);\n return;\n }\n\n // we have a good action and path so lets load the sql based on path and then call the appropriate sql action\n if (dsPath.equalsIgnoreCase(\"/_system/connections\")) {\n Configuration configuration = ConfigurationHandler.getConfiguration(\"/connections\");\n if (configuration == null) {\n response.sendError(404, \"Configuration error: /connections configuration was not found!\");\n return;\n }\n if (action.equalsIgnoreCase(\"query\"))\n response.getOutputStream().println(ConnectionHandler.toJSON());\n else {\n // attempt to execute the connection requested action\n try {response.getOutputStream().println(configuration.execute(request, _action));}\n catch (Throwable ex)\n {\n ex.printStackTrace();\n response.sendError(500, ex.toString());\n }\n }\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/connections/test\")) {\n // attempt to get the parameters (assume always GET)\n try {\n String name = request.getParameter(\"name\");\n String type = request.getParameter(\"type\");\n if (name == null || name.length() == 0 || type == null || type.length() == 0)\n throw new RuntimeException(\"name or type parameter was not passed! connection is invalid!\");\n ConnectionHandler.test(name, type, request.getParameter(\"jndi-context\"),\n request.getParameter(\"jndi-name\"), request.getParameter(\"driver\"), request.getParameter(\"url\"),\n request.getParameter(\"login\"), request.getParameter(\"password\"));\n response.setContentType(\"application/json\");\n String sresult = \"{\\\"status\\\": \\\"Connection Successful\\\"}\";\n response.getOutputStream().write(sresult.getBytes(\"UTF-8\"));\n response.flushBuffer();\n }\n catch (Exception ex) {response.sendError(500, ex.toString());}\n response.flushBuffer();\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/connections/refresh\")) {\n try {ConnectionHandler.destroy(); ConnectionHandler.init();}\n catch (Exception ex) {log.fatal(\"Exception trying to refresh connection list: \" + ex);}\n response.getOutputStream().print(\"refreshed\");\n response.flushBuffer();\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/connections/download\")) {\n try {\n String nameFilter = request.getParameter(\"nameFilter\");\n response.setContentType(\"application/xml\");\n StringBuffer extension = new StringBuffer();\n String xml = ConnectionHandler.toXML(nameFilter);\n // we tack on the filter part to the end of the filename to later identify the download better\n if (nameFilter == null || nameFilter.equalsIgnoreCase(\"*\") || nameFilter.equalsIgnoreCase(\"all\"))\n nameFilter = \"\";\n // name filter just replace the spaces and special chars with underscores\n if (nameFilter.length() > 0) {\n nameFilter = nameFilter.replaceAll(\" \", \"_\").toLowerCase();\n nameFilter = nameFilter.replaceAll(\"[^a-zA-Z0-9.-]\", \"_\");\n // few other tricks:\n // cant start or end with a dot; while valid in unix we don't want our export files to ever be hidden\n if (nameFilter.startsWith(\".\"))\n nameFilter = nameFilter.substring(1);\n if (nameFilter.endsWith(\".\"))\n nameFilter = nameFilter.substring(0, nameFilter.length() - 2);\n extension.append(\"-\").append(nameFilter.toLowerCase());\n }\n // Last: cant be more than 240 characters - the static text for the filename\n int staticLength = \"connections\".length() + \".xml\".length();\n if (extension.length() > (240 - staticLength))\n extension.setLength((240 - staticLength));\n\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"connections\" + extension.toString() + \".xml\\\"\");\n response.setContentLength(xml.length());\n response.getOutputStream().print(xml);\n response.flushBuffer();\n }\n catch (Exception ex) {\n ex.printStackTrace();\n response.sendError(500, \"Exception downloading connections: \" + ex);\n }\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/connections/upload\")) {\n try {\n// InputSource is = new InputSource(new StringReader(xml));\n// is.setEncoding(\"UTF-8\");\n// DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n// DocumentBuilder db = dbf.newDocumentBuilder();\n// Document doc = db.parse(is);\n// NodeList connections = doc.getElementsByTagName(\"connection\");\n// String name;\n// for (int conct=0; conct < connections.getLength(); conct++) {\n// name = getNode(\"name\");\n// System.out.println(\"name: \" + name);\n// }\n\n // read in and parse the body content\n SAXParserFactory factory = SAXParserFactory.newInstance();\n SAXParser saxParser = factory.newSAXParser();\n XMLConnectionUploader2 handler = new XMLConnectionUploader2();\n String xml = request.getParameter(\"file\");\n //log.info(\"using string: \" + xml);\n InputSource is = new InputSource(new StringReader(xml));\n is.setEncoding(\"UTF-8\");\n saxParser.parse(is, handler);\n response.getOutputStream().print(handler.getStatus());\n response.flushBuffer();\n }\n catch (SAXParseException err) {\n err.printStackTrace();\n response.sendError(500, \"Exception parsing connections upload file: \" + err);\n }\n catch (Throwable t) {\n t.printStackTrace();\n response.sendError(500, \"Exception uploading connections: \" + t);\n }\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/configurations\")) {\n Configuration configuration = ConfigurationHandler.getConfiguration(\"/configurations\");\n if (configuration == null) {\n response.sendError(404, \"Configuration error: /configurations configuration was not found!\");\n return;\n }\n try {response.getOutputStream().println(configuration.execute(request, _action));}\n catch (Throwable ex)\n {\n ex.printStackTrace();\n response.sendError(500, ex.toString());\n }\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/configurations/refresh\")) {\n try {ConfigurationHandler.init();}\n catch (Exception ex) {log.fatal(\"Exception trying to refresh configuration list: \" + ex);}\n response.getOutputStream().print(\"refreshed\");\n response.flushBuffer();\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/configurations/download\")) {\n try {\n String pathFilter = request.getParameter(\"pathFilter\");\n String tagFilter = request.getParameter(\"tagFilter\");\n response.setContentType(\"application/xml\");\n StringBuffer extension = new StringBuffer();\n String xml = ConfigurationHandler.toXML(pathFilter, tagFilter);\n // we tack on the filter part to the end of the filename to later identify the download better\n if (pathFilter == null || pathFilter.equalsIgnoreCase(\"*\") || pathFilter.equalsIgnoreCase(\"all\"))\n pathFilter = \"\";\n if (pathFilter.length() > 0) {\n // path filter just replace the spaces and special chars with underscores\n pathFilter = pathFilter.replaceAll(\" \", \"_\").toLowerCase();\n pathFilter = pathFilter.replaceAll(\"[^a-zA-Z0-9.-]\", \"_\");\n // few other tricks:\n // cant start or end with a dot; while valid in unix we don't want our export files to ever be hidden\n if (pathFilter.startsWith(\".\"))\n pathFilter = pathFilter.substring(1);\n if (pathFilter.endsWith(\".\"))\n pathFilter = pathFilter.substring(0, pathFilter.length() - 2);\n extension.append(\"-\").append(pathFilter.toLowerCase());\n }\n // tag filter is a bit more complicated as we have to only use directory approved characters\n // we need to obfuscate && and || so they work. we will use underscores for spaces and\n // words for the && and || or.\n if (tagFilter == null)\n tagFilter = \"\";\n if (tagFilter.length() > 0) {\n tagFilter = tagFilter.replaceAll(\" \", \"_\").toLowerCase();\n tagFilter = tagFilter.replaceAll(\"&&\", \"and\");\n tagFilter = tagFilter.replaceAll(\"\\\\|\\\\|\", \"or\");\n tagFilter = tagFilter.replaceAll(\":\", \"#\");\n tagFilter = tagFilter.replaceAll(\"[^a-zA-Z0-9.-\\\\\\\\!#]\", \"_\");\n // few other tricks:\n // cant start or end with a dot; while valid in unix we don't want our export files to ever be hidden\n if (tagFilter.startsWith(\".\"))\n tagFilter = tagFilter.substring(1);\n if (tagFilter.endsWith(\".\"))\n tagFilter = tagFilter.substring(0, tagFilter.length() - 2);\n extension.append(\"-\").append(tagFilter);\n }\n // Last: cant be more than 240 characters - the static text for the filename\n int staticLength = \"configurations\".length() + \".xml\".length();\n if (extension.length() > (240 - staticLength))\n extension.setLength(240 - staticLength);\n\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"configurations\" + extension.toString() + \".xml\\\"\");\n response.setContentLength(xml.length());\n response.getOutputStream().print(xml);\n response.flushBuffer();\n }\n catch (Exception ex) {\n ex.printStackTrace();\n response.sendError(500, \"Exception downloading configurations: \" + ex);\n }\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/configurations/upload\")) {\n try {\n // read in and parse the body content\n SAXParserFactory factory = SAXParserFactory.newInstance();\n \tSAXParser saxParser = factory.newSAXParser();\n \tXMLConfigurationUploader handler = new XMLConfigurationUploader();\n String xml = request.getParameter(\"file\");\n// log.debug(\"using string: \" + xml);\n InputSource is = new InputSource(new StringReader(xml));\n is.setEncoding(\"UTF-8\");\n saxParser.parse(is, handler);\n response.getOutputStream().print(handler.getStatus());\n response.flushBuffer();\n }\n catch (SAXParseException err) {\n err.printStackTrace();\n response.sendError(500, \"Exception parsing configurations: \" + err);\n }\n catch (Throwable t) {\n t.printStackTrace ();\n response.sendError(500, \"Exception uploading configurations: \" + t);\n }\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/sql/execute\")) {\n try {\n // look for $sql to attempt to execute\n String con = request.getParameter(\"$con\");\n String sql = request.getParameter(\"$sql\");\n log.debug(\"found [\" + con + \"] connection request...\");\n log.debug(\"found [\" + sql + \"] execute request...\");\n if (con == null || sql == null || con.length() == 0 || sql.length() == 0)\n throw new Exception(\"Reqeusted sql execution but didn't provide required parameters.\");\n Connection connection = null;\n Statement stmt = null;\n try {\n connection = ConnectionHandler.getConnection(con);\n if (connection == null)\n throw new SQLException(\"Connection [\" + con + \"] was not found or set up!\");\n stmt = connection.createStatement();\n stmt.execute(sql);\n }\n finally {\n if (stmt != null)\n stmt.close();\n if (connection != null)\n connection.close();\n }\n\n response.getOutputStream().print(\"Statment Executed Successfully\");\n response.flushBuffer();\n }\n catch (Throwable t) {\n t.printStackTrace ();\n response.sendError(500, t.toString());\n }\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/log/level/set\")) {\n // attempt to set the global log level runtime for the server\n String requestLevel = request.getParameter(\"log_level\");\n if (requestLevel != null && (requestLevel.equalsIgnoreCase(\"debug\") || requestLevel.equalsIgnoreCase(\"info\") || requestLevel.equalsIgnoreCase(\"warn\"))) {\n Logger rootLogger = Logger.getRootLogger();\n if (requestLevel.equalsIgnoreCase(\"debug\"))\n rootLogger.setLevel(Level.DEBUG);\n else if(requestLevel.equalsIgnoreCase(\"info\"))\n rootLogger.setLevel(Level.INFO);\n else if(requestLevel.equalsIgnoreCase(\"warn\"))\n rootLogger.setLevel(Level.WARN);\n response.getOutputStream().print(\"log level: \" + rootLogger.getLevel());\n }\n else\n response.sendError(404, \"Missing log_level parameter; must be one of ['debug', 'info', 'warn']\");\n }\n else if (dsPath.equalsIgnoreCase(\"/_system/boom\")) {\n response.sendError(500, \"Test Exception \");\n }\n else\n response.sendError(404);\n }", "public interface Target {\n void handleRequest();\n}", "public abstract Endpoint createAndPublishEndpoint(String address, Object implementor);", "public void handle(HttpExchange exch) {\n\n }", "@Override\n\t\t\tpublic void handle(Request req, Response res) throws Exception {\n\t\t\t\tfinal String op = req.params(\":op\");\n\t\t\t\tfinal String username = req.queryParams(\"user\");\n\t\t\t\tfinal String path = req.queryParams(\"path\");\n\t\t\t\t\n\t\t\t\t//--- framework access ---//\n\t\t\t\tif (!Results.hasFrameworkAccess(op, path)) halt(404);\n\t\t\t\t//--- path exists? ---//\n\t\t\t\tif (!Directories.isExist(path)) halt(404);\n\t\t\t\t//--- section and path access ---//\n\t\t\t\tif (!AccessManager.hasAccess(username, path)) halt(401);\n\n\t\t\t}", "void handleRequest();", "WebActionResponse processWebAction(String actionName, RequestContext rc) {\n WebActionHandlerRef webActionRef = webObjectRegistry.getWebActionHandlerRef(actionName);\n\n if (webActionRef == null) {\n throw new SnowException(Error.NO_WEB_ACTION, \"WebAction\", actionName);\n }\n\n // --------- Invoke Method --------- //\n Object result = null;\n try {\n result = methodInvoker.invokeWebHandler(webActionRef, rc);\n } catch (Throwable t) {\n throw Throwables.propagate(t);\n }\n // --------- /Invoke Method --------- //\n\n WebActionResponse response = new WebActionResponse(result);\n return response;\n }", "public interface HTTPContract {\n void getRequirementList(AnnounceDataSource.GetRequirementListCallback callback);\n void getFeelingList(AnnounceDataSource.GetFeelingListCallback callback);\n void postFeelingCommend();\n void postFeelingComment();\n// void postRequirementBook();\n// void postRequirementComment();\n\n}" ]
[ "0.64274323", "0.6388726", "0.6306151", "0.6272702", "0.6225909", "0.6134459", "0.6113351", "0.6086571", "0.60557383", "0.60557383", "0.60557383", "0.60557383", "0.6026853", "0.6025024", "0.6020501", "0.60189384", "0.60024947", "0.5992049", "0.5971841", "0.59704894", "0.5964553", "0.5961097", "0.5958135", "0.5951935", "0.5939967", "0.5936717", "0.5923551", "0.5911627", "0.5910066", "0.59087205", "0.59087205", "0.59087205", "0.59013593", "0.58586144", "0.58569443", "0.5853623", "0.5852814", "0.5851226", "0.58310276", "0.58180326", "0.5812938", "0.5812926", "0.5812926", "0.5812926", "0.5812926", "0.58073527", "0.5796987", "0.57949555", "0.57934564", "0.57721204", "0.5760942", "0.5760942", "0.5758171", "0.5758171", "0.5758171", "0.5758171", "0.5758171", "0.5758171", "0.5758171", "0.5758171", "0.57403296", "0.5728505", "0.5719504", "0.5714409", "0.57074314", "0.570692", "0.5705741", "0.5678602", "0.56644756", "0.5659014", "0.56526184", "0.5648773", "0.5644708", "0.5641521", "0.5641521", "0.5641521", "0.5641521", "0.5631337", "0.56242955", "0.5606956", "0.56058455", "0.5602783", "0.56027335", "0.56022215", "0.5590281", "0.5583908", "0.5564048", "0.55503213", "0.55443823", "0.55434406", "0.5533859", "0.5533716", "0.5533317", "0.5528046", "0.55275095", "0.5524014", "0.5522692", "0.5517921", "0.55153763", "0.5504801", "0.55025196" ]
0.0
-1
Implement validation logic required to test above action mentioned in buildAction(obj)
public abstract void responseMiddleware(HttpResponse<String> response) throws Exception;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\tprotected boolean validateAction(int actionID, String... arguments) {\n\t\t\treturn false;\n\t\t}", "@Override\r\n\tprotected boolean validateFields(String action) {\r\n\t\t// Booleano para indicar que hubo error\r\n\t\tisError = false;\r\n\t\t// IRI Concepto\r\n\t\tif (this.isBlanks(object.getDcoiricaf())) {\r\n\t\t\tisError = true;\r\n\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\tApplicationMessages.getMessage(\"se010_iriDetail\")));\r\n\t\t}\r\n\t\t// Concepto Semántico\r\n\t\tif (this.isBlanks(object.getCosccosak())) {\r\n\t\t\tisError = true;\r\n\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\tApplicationMessages\r\n\t\t\t\t\t\t\t\t\t.getMessage(\"se010_semanticConcept\")));\r\n\t\t}\r\n\t\t// Valida relaciones\r\n\t\tfor (Sedrelco relco : object.getRelcos()) {\r\n\t\t\t// Valor Relacion\r\n\t\t\tif (this.isBlanks(relco.getDrcvalraf())) {\r\n\t\t\t\tisError = true;\r\n\t\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\t\tApplicationMessages\r\n\t\t\t\t\t\t\t\t\t\t.getMessage(\"se010_valueRelation\")));\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Retorna\r\n\t\treturn !isError;\r\n\t}", "protected abstract void action(Object obj);", "@Override\r\n\tprotected void validateData(ActionMapping arg0, HttpServletRequest arg1) {\n\t\t\r\n\t}", "@Override\r\n protected boolean validateAction() {\n Set inputNames = getInputNames();\r\n Iterator inputNamesIterator = inputNames.iterator();\r\n String inputName;\r\n IActionParameter actionParameter;\r\n while (inputNamesIterator.hasNext()) {\r\n inputName = (String) inputNamesIterator.next();\r\n actionParameter = getInputParameter(inputName);\r\n message(Messages.getString(\"TestComponent.DEBUG_INPUT_DESCRIPTION\", inputName, actionParameter.getType())); //$NON-NLS-1$\r\n }\r\n\r\n Set outputNames = getOutputNames();\r\n Iterator outputNamesIterator = outputNames.iterator();\r\n String outputName;\r\n while (outputNamesIterator.hasNext()) {\r\n outputName = (String) outputNamesIterator.next();\r\n actionParameter = getOutputItem(outputName);\r\n message(Messages.getString(\"TestComponent.DEBUG_OUTPUT_DESCRIPTION\", outputName, actionParameter.getType())); //$NON-NLS-1$\r\n }\r\n\r\n Set resourceNames = getResourceNames();\r\n Iterator resourceNamesIterator = resourceNames.iterator();\r\n String resourceName;\r\n IActionSequenceResource actionResource;\r\n while (resourceNamesIterator.hasNext()) {\r\n resourceName = (String) resourceNamesIterator.next();\r\n actionResource = getResource(resourceName);\r\n message(Messages\r\n .getString(\r\n \"TestComponent.DEBUG_RESOURCE_DESCRIPTION\", resourceName, actionResource.getMimeType(), PentahoSystem.getApplicationContext().getSolutionPath(actionResource.getAddress()))); //$NON-NLS-1$\r\n try {\r\n String content = getResourceAsString(actionResource);\r\n message(Messages.getString(\r\n \"TestComponent.DEBUG_RESOURCE_CONTENTS\", ((content == null) ? \"null\" : content.substring(0, 100)))); //$NON-NLS-1$ //$NON-NLS-2$\r\n } catch (Exception e) {\r\n message(Messages.getString(\"TestComponent.ERROR_0005_RESOURCE_NOT_LOADED\", e.getMessage())); //$NON-NLS-1$\r\n }\r\n }\r\n\r\n return true;\r\n }", "private void checkAction() {\n if (action == Consts.CREATE_ACTION) {\n createAction();\n } else {\n updateAction(getArguments().getString(\"taskId\"));\n }\n }", "public void checkActions() {\n\t\tfor (BaseAction ba : this.actions) {\n\t\t\tba.checkAction();\n\t\t}\n\t}", "@Test\n public void isActionLegal()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final Agent agentWhite = agents.get(1);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final Adjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n {\n final CheckersMoveAction action = new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P13);\n assertTrue(adjudicator.isActionLegal(action));\n }\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P05)));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P04,\n CheckersPosition.P08)));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P21,\n CheckersPosition.P17)));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isActionLegal(new CheckersMoveAction(environment, agentWhite, CheckersPosition.P09,\n CheckersPosition.P18)));\n }", "public ActionsValidator() {\n super();\n }", "CaseAction createCaseAction();", "@Override public void action() {\n //Do Nothing\n assert(checkRep());\n }", "void validateActivoCreate(Activo activo);", "protected boolean validateActions(PDPage page, DocumentHandler handler,\n List<ValidationError> result) throws ValidationException {\n // ---- get AA (additional actions) entry if it is present\n List<AbstractActionManager> lActions = this.actionFact.getActions(page\n .getCOSDictionary(), handler.getDocument().getDocument());\n for (AbstractActionManager action : lActions) {\n if (!action.valid(true, result)) {\n return false;\n }\n }\n\n return true;\n }", "protected void validate() {\n // no op\n }", "boolean tryToPerform_with(Object anAction, Object anObject)\n {\n\treturn false;\n }", "private void createActions() {\n\n\t\t//-----------------------------------------------\n\t\t// Check if Party Exists\n\t\t//-----------------------------------------------\n\t\tpartyExists = new GuardedRequest<Party>() {\n\t\t\tprotected boolean error() {return emailaddressField.noValue();}\n\t\t\tprotected void send() {super.send(getValue(new PartyExists()));}\n\t\t\tprotected void receive(Party party) {\n\t\t\t\tif (party != null ) {setValue(party);}\n\t\t\t}\n\t\t};\n\n\t\t//-----------------------------------------------\n\t\t// Read Party\n\t\t//-----------------------------------------------\n\t\tactorRead = new GuardedRequest<Party>() {\n\t\t\tprotected boolean error() {return partyField.noValue();}\n\t\t\tprotected void send() {super.send(getValue(new ActorRead()));}\n\t\t\tprotected void receive(Party party){setValue(party);}\n\t\t};\n\n\t\t//-----------------------------------------------\n\t\t// Update Party\n\t\t//-----------------------------------------------\n\t\tactorUpdate = new GuardedRequest<Party>() {\n\t\t\tprotected boolean error() {\n\t\t\t\treturn (\n\t\t\t\t\t\tifMessage(AbstractRoot.noOrganizationid(), Level.TERSE, AbstractField.CONSTANTS.errOrganizationid(), partyField)\n\t\t\t\t\t\t|| ifMessage(partyField.noValue(), Level.TERSE, AbstractField.CONSTANTS.errId(), partyField)\n\t\t\t\t\t\t|| ifMessage(emailaddressField.noValue(), Level.ERROR, AbstractField.CONSTANTS.errEmailaddress(), emailaddressField)\n\t\t\t\t\t\t|| ifMessage(formatdateField.noValue(), Level.ERROR, CONSTANTS.formatdateError(), formatdateField)\n\t\t\t\t\t\t|| ifMessage(formatphoneField.noValue(), Level.ERROR, CONSTANTS.formatphoneError(), formatphoneField)\n\t\t\t\t\t\t|| ifMessage(!Party.isEmailAddress(emailaddressField.getValue()), Level.ERROR, AbstractField.CONSTANTS.errEmailaddress(), emailaddressField)\n//\t\t\t\t\t\t|| ifMessage((typesField.hasValue(Party.Type.Agent.name()) || typesField.hasValue(Party.Type.Organization.name())) && !partyField.hasValue(AbstractRoot.getOrganizationid()), Level.ERROR, CONSTANTS.partytypeError(), partyField)\n\t\t\t\t);\n\t\t\t}\n\t\t\tprotected void send() {super.send(getValue(new ActorUpdate()));}\n\t\t\tprotected void receive(Party party) {\n\t\t\t\tif (parentTable != null) {parentTable.execute(true);}\n\t\t\t\thide();\n\t\t\t}\n\t\t};\n\n\t\t//-----------------------------------------------\n\t\t// Delete Party\n\t\t//-----------------------------------------------\n\t\tactorDelete = new GuardedRequest<Party>() {\n\t\t\tprotected String popup() {return AbstractField.CONSTANTS.errDeleteOK();}\n\t\t\tpublic void cancel() {state = oldstate;}\n\t\t\tprotected boolean error() {\n\t\t\t\treturn (\n\t\t\t\t\t\tifMessage(partyField.noValue(), Level.TERSE, AbstractField.CONSTANTS.errId(), partyField)\n\t\t\t\t);\n\t\t\t}\n\t\t\tprotected void send() {super.send(getValue(new ActorDelete()));}\n\t\t\tprotected void receive(Party party){\n\t\t\t\tif (parentTable != null) {parentTable.execute(true);}\n\t\t\t\thide();\n\t\t\t}\n\t\t};\t\n\t}", "public void testCtor() {\n assertNotNull(\"Failed to create a new AddActionStateAction instance.\", action);\n assertTrue(\"The state should be formatted.\", state.isSpecification());\n }", "public abstract boolean checkAction(String str);", "public void validate() {}", "@Test\n public void doAction() throws ModelException {\n CommonTestMethods.gameInitOne(game);\n String response;\n CommonTestMethods.givePlayerLeaderCards(game.getCurrentPlayer(), game.getLeaderCards().get(2), game.getLeaderCards().get(1));\n\n actionController.getGame().getCurrentPlayer().addPossibleAction(BUY_CARD);\n actionController.getGame().getCurrentPlayer().addPossibleAction(ACTIVATE_LEADERCARD);\n\n response = card.doAction(actionController);\n assertEquals(\"Not enough resources to buy Card\", response);\n messageToClient = card.messagePrepare(actionController);\n\n assertTrue(messageToClient instanceof BuyCardMessage);\n assertEquals(ActionType.BUY_CARD, messageToClient.getActionDone());\n assertEquals(\"Not enough resources to buy Card\", messageToClient.getError());\n assertEquals(game.getCurrentPlayerNickname(), messageToClient.getPlayerNickname());\n assertEquals(ActionType.ACTIVATE_PRODUCTION, messageToClient.getPossibleActions().get(0));\n assertEquals(ActionType.BUY_CARD, messageToClient.getPossibleActions().get(1));\n assertEquals(ActionType.MARKET_CHOOSE_ROW, messageToClient.getPossibleActions().get(2));\n assertEquals(ActionType.ACTIVATE_LEADERCARD, messageToClient.getPossibleActions().get(3));\n\n\n ResourceStack stack = new ResourceStack(5,3,3,0);\n CommonTestMethods.giveResourcesToPlayer(game.getCurrentPlayer(), 1,12,1, ResourceType.SHIELDS, ResourceType.COINS, ResourceType.STONES, stack);\n BuyCard secondCard = new BuyCard(0,0);\n response = card.doAction(actionController);\n assertEquals(\"2 0 2 0\", game.getCurrentPlayer().getBoard().getResourceManager().getTemporaryResourcesToPay().toString());\n assertEquals(\"SUCCESS\", response);\n messageToClient = card.messagePrepare(actionController);\n\n assertTrue(messageToClient instanceof BuyCardMessage);\n assertEquals(ActionType.BUY_CARD, messageToClient.getActionDone());\n assertEquals(\"SUCCESS\", messageToClient.getError());\n assertEquals(game.getCurrentPlayerNickname(), messageToClient.getPlayerNickname());\n assertEquals(ActionType.PAY_RESOURCE_CARD, messageToClient.getPossibleActions().get(0));\n\n actionController.getGame().getCurrentPlayer().addPossibleAction(BUY_CARD);\n\n assertEquals(\"Card does not fit inside Personal Board\", secondCard.doAction(actionController));\n messageToClient = secondCard.messagePrepare(actionController);\n\n assertTrue(messageToClient instanceof BuyCardMessage);\n assertEquals(ActionType.BUY_CARD, messageToClient.getActionDone());\n assertEquals(\"Card does not fit inside Personal Board\", messageToClient.getError());\n assertEquals(game.getCurrentPlayerNickname(), messageToClient.getPlayerNickname());\n assertEquals(ActionType.ACTIVATE_PRODUCTION, messageToClient.getPossibleActions().get(0));\n assertEquals(ActionType.BUY_CARD, messageToClient.getPossibleActions().get(1));\n assertEquals(ActionType.MARKET_CHOOSE_ROW, messageToClient.getPossibleActions().get(2));\n assertEquals(ActionType.ACTIVATE_LEADERCARD, messageToClient.getPossibleActions().get(3));\n }", "public void testActionListener() throws Exception\n {\n checkFormEventListener(ACTION_BUILDER, \"ACTION\");\n }", "public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {\r\n ActionErrors actionErrors = new ActionErrors();\r\n try {\r\n UserDAO gObjUserDAO = new UserDAOImpl();\r\n if (userFirstName == null || userFirstName.length() < 1) {\r\n\r\n actionErrors.add(\"userFirstName\", new ActionMessage(\"error.userFirstName\"));\r\n // TODO: add 'error.name.required' key to your resources\r\n }\r\n if (getUserName() == null || getUserName().length() < 1) {\r\n\r\n actionErrors.add(\"userName\", new ActionMessage(\"error.userName\"));\r\n // TODO: add 'error.name.required' key to your resources\r\n }\r\n if (getUserPassword() == null || getUserPassword().length() < 1) {\r\n actionErrors.add(\"userPassword\", new ActionMessage(\"error.userPassword\"));\r\n // TODO: add 'error.name.required' key to your resources\r\n }\r\n if (getUserActivationCode() == null || getUserActivationCode().length() < 1) {\r\n actionErrors.add(\"userActivationCode\", new ActionMessage(\"error.userActivationCode\"));\r\n // TODO: add 'error.name.required' key to your resources\r\n }\r\n if (getUserName() != null && getUserName().length() > 0) {\r\n\r\n List<CmnUserMst> lLstCmnUserMst = new ArrayList<CmnUserMst>();\r\n lLstCmnUserMst = gObjUserDAO.validateUserName(getUserName().toUpperCase());\r\n if (!lLstCmnUserMst.isEmpty()) {\r\n actionErrors.add(\"userName\", new ActionMessage(\"error.duplicateUserName\"));\r\n\r\n }\r\n\r\n }\r\n if (getUserActivationCode() != null && getUserActivationCode().length() > 0) {\r\n\r\n System.out.println(\"userType.....\" + userType);\r\n logger.info(\"userType......\" + userType);\r\n if (userType != null && !\"\".equals(userType) && \"H\".equals(userType)) {\r\n roleActivationMpgList = gObjUserDAO.validateActivationCodeForHR(getUserActivationCode());\r\n if (roleActivationMpgList != null && !roleActivationMpgList.isEmpty()) {\r\n PcHrDtls lObjPcHrDtls = (PcHrDtls) roleActivationMpgList.get(0);\r\n universityId = lObjPcHrDtls.getUniversityId();\r\n }\r\n }\r\n else if (userType != null && !\"\".equals(userType) && (\"S\".equals(userType) || \"A\".equals(userType) || \"F\".equals(userType))) {\r\n roleActivationMpgList = gObjUserDAO.validateActnCodeForStudOrAlumniOfFaculty(userType,userActivationCode);\r\n if(roleActivationMpgList != null && !roleActivationMpgList.isEmpty())\r\n {\r\n List lLstResult = gObjUserDAO.validateActivationCodeWithExistingCode(userActivationCode);\r\n if(lLstResult != null && !lLstResult.isEmpty())\r\n {\r\n actionErrors.add(\"userActivationCode\", new ActionMessage(\"error.validateUserActivationCodeWithExistingCode\")); \r\n }\r\n else\r\n {\r\n TmpUserExcelData lObjTmpUserExcelData = (TmpUserExcelData) roleActivationMpgList.get(0);\r\n universityId = lObjTmpUserExcelData.getUniversityId();\r\n }\r\n }\r\n } \r\n else {\r\n roleActivationMpgList = gObjUserDAO.validateActivationCode(getUserActivationCode());\r\n if (roleActivationMpgList != null && !roleActivationMpgList.isEmpty()) {\r\n CmnRoleActivationMpg lObjCmnRoleActivationMpg = (CmnRoleActivationMpg) roleActivationMpgList.get(0);\r\n universityId = lObjCmnRoleActivationMpg.getUniversityId();\r\n }\r\n }\r\n\r\n if (roleActivationMpgList == null || roleActivationMpgList.isEmpty()) {\r\n actionErrors.add(\"userActivationCode\", new ActionMessage(\"error.validateUserActivationCode\"));\r\n\r\n }\r\n }\r\n request.setAttribute(\"fromFlag\", \"signUp\");\r\n } catch (Exception ex) {\r\n logger.error(\"Error while validating user data : \" + ex, ex);\r\n }\r\n return actionErrors;\r\n }", "public void createAction() {\n }", "public abstract HttpResponse<String> buildAction(@Nullable Object object) throws Exception;", "@Override\n\tprotected void validate(Controller c) {\n\n\t}", "public void testActionPerformed() \n {\n System.out.println(\"actionPerformed\");\n ActionEvent e = new ActionEvent(\"\", 0, \"New Game\");\n instance.actionPerformed(e);\n verify(tableModel).newGame();\n e = new ActionEvent(\"\", 0, \"Board Size-Small\");\n instance.actionPerformed(e);\n verify(tableModel).setSize(5);\n e = new ActionEvent(\"\", 0, \"Board Size-Medium\");\n instance.actionPerformed(e);\n verify(tableModel).setSize(9);\n e = new ActionEvent(\"\", 0, \"Board Size-Large\");\n instance.actionPerformed(e);\n verify(tableModel).setSize(11);\n e = new ActionEvent(\"\", 0, \"Skin-Default\");\n instance.actionPerformed(e);\n verify(model).changeTheme(\"Default\");\n e = new ActionEvent(\"\", 0, \"Skin-Classic\");\n instance.actionPerformed(e);\n verify(model).changeTheme(\"Classic\");\n e = new ActionEvent(\"\", 0, \"Skin-Night\");\n instance.actionPerformed(e);\n verify(model).changeTheme(\"Night\");\n when(model.getTableModel()).thenReturn(hurkleModel);\n e = new ActionEvent(\"\", 0, \"Cheat-Cheat\");\n instance.actionPerformed(e);\n assertEquals(\"\", hurkleModel.validateMove(1, 1, true));\n }", "private boolean actionIsValid(Action a) {\n\t\tif(board[horizontal-1][a.getColumn() ] != Player.NOT_PLAYED.ordinal()\t) {\n\t\t\treturn false;\n\t\t}else {\n\t\t\treturn true;\n\t\t}\n\t\n\t}", "public void takeAction(BoardGameController.BoardBugAction action)\n {\n\n }", "public abstract ActionInMatch act();", "@Test\n public void test049() throws Throwable {\n Checkbox checkbox0 = new Checkbox((Component) null, \"x_Oj]\", \"x_Oj]\");\n ActionExpression actionExpression0 = checkbox0._getAction();\n }", "public T caseAction(Action object) {\n\t\treturn null;\n\t}", "void checkPrerequisite() throws ActionNotPossibleException;", "@Test\n\tpublic void validObjectShouldValidate() {\n\t\tT validObject = buildValid();\n\t\tAssertions.assertThat(isValid(validObject))\n\t\t\t\t.as(invalidMessage(validObject))\n\t\t\t\t.isTrue();\n\t}", "public interface Action {\n\n /**\n * The executeAction method takes in actionInfo and runs the action code\n * @param actionInfo all information sent by the test file to the action\n */\n public void executeAction( String actionInfo );\n\n}", "protected void validateArguments( Object[] args ) throws ActionExecutionException {\n\n Annotation[][] annotations = method.getParameterAnnotations();\n for (int i = 0; i < annotations.length; i++) {\n\n Annotation[] paramAnnotations = annotations[i];\n\n for (Annotation paramAnnotation : paramAnnotations) {\n if (paramAnnotation instanceof Parameter) {\n Parameter paramDescriptionAnnotation = (Parameter) paramAnnotation;\n ValidationType validationType = paramDescriptionAnnotation.validation();\n\n String[] validationArgs;\n\n // if we are checking for valid constants, then the\n // args array should contain\n // the name of the array holding the valid constants\n if (validationType == ValidationType.STRING_CONSTANT\n || validationType == ValidationType.NUMBER_CONSTANT) {\n try {\n String arrayName = paramDescriptionAnnotation.args()[0];\n\n // get the field and set access level if\n // necessary\n Field arrayField = method.getDeclaringClass().getDeclaredField(arrayName);\n if (!arrayField.isAccessible()) {\n arrayField.setAccessible(true);\n }\n Object arrayValidConstants = arrayField.get(null);\n\n // convert the object array to string array\n String[] arrayValidConstatnsStr = new String[Array.getLength(arrayValidConstants)];\n for (int j = 0; j < Array.getLength(arrayValidConstants); j++) {\n arrayValidConstatnsStr[j] = Array.get(arrayValidConstants, j).toString();\n }\n\n validationArgs = arrayValidConstatnsStr;\n\n } catch (IndexOutOfBoundsException iobe) {\n // this is a fatal error\n throw new ActionExecutionException(\"You need to specify the name of the array with valid constants in the 'args' field of the Parameter annotation\");\n } catch (Exception e) {\n // this is a fatal error\n throw new ActionExecutionException(\"Could not get array with valid constants - action annotations are incorrect\");\n }\n } else {\n validationArgs = paramDescriptionAnnotation.args();\n }\n\n List<BaseType> typeValidators = createBaseTypes(paramDescriptionAnnotation.validation(),\n paramDescriptionAnnotation.name(),\n args[i], validationArgs);\n //perform validation\n for (BaseType baseType : typeValidators) {\n if (baseType != null) {\n try {\n baseType.validate();\n } catch (TypeException e) {\n throw new InvalidInputArgumentsException(\"Validation failed while validating argument \"\n + paramDescriptionAnnotation.name()\n + e.getMessage());\n }\n } else {\n log.warn(\"Could not perform validation on argument \"\n + paramDescriptionAnnotation.name());\n }\n }\n }\n }\n }\n }", "@Test\n public void getSorteerAction() throws Exception {\n }", "@Test\n public void testGetActions() {\n }", "void validate(Inspector inspector) throws ValidationException;", "@Override\n\tpublic void validate() {\n\t\t if(pname==null||pname.toString().equals(\"\")){\n\t\t\t addActionError(\"父项节点名称必填!\");\n\t\t }\n\t\t if(cname==null||cname.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点名称必填!\");\n\t\t }\n\t\t if(caction==null||caction.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点动作必填!\");\n\t\t }\n\t\t \n\t\t List l=new ArrayList();\n\t\t\tl=userService.QueryByTabId(\"Resfun\", \"resfunid\", resfunid);\n\t\t\t//判断是否修改\n\t\t\tif(l.size()!=0){\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\t\tResfun rf=new Resfun();\n\t\t\t\t\trf=(Resfun)l.get(i);\n\t\t\t\t\tif(rf.getCaction().equals(caction.trim())&&rf.getCname().equals(cname)&&rf.getPname().equals(pname)){\n\t\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\t\tn=userService.QueryByPcac(\"Resfun\", \"pname\", pname, \"cname\", cname, \"caction\", caction);\n\t\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\t\taddActionError(\"该记录已经存在!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "Action createAction();", "Action createAction();", "Action createAction();", "private boolean checkForAction(){\n IndividualAction thisAction = checkTriggers();\n if(thisAction.getTriggers() == null){\n return false;\n }\n if(!checkSubjects(thisAction.getSubjects())){\n return false;\n }\n doConsumed(thisAction.getConsumed());\n doProduce(thisAction.getProduced());\n results.add(thisAction.getNarration());\n\n return true;\n }", "@Override\n public void customValidation() {\n }", "@Override\n public void customValidation() {\n }", "@Override\n public void customValidation() {\n }", "public Action newAction(Object data) throws Exception;", "@Override\n\tpublic void validate()\n\t{\n\n\t}", "@Override\n protected void validate(final OperationIF oper) throws Exception {\n String METHOD = Thread.currentThread().getStackTrace()[1].getMethodName();\n JSONObject jsonInput = null;\n\n _logger.entering(CLASS, METHOD);\n\n if (oper == null) {\n throw new Exception(\"Operation object is null\");\n }\n\n jsonInput = oper.getJSON();\n if (jsonInput == null || jsonInput.isEmpty()) {\n throw new Exception(\"JSON Input is null or empty\");\n }\n\n switch (oper.getType()) {\n case READ: {\n this.checkAttr(jsonInput, ConstantsIF.UID);\n break;\n }\n case REPLACE: {\n this.checkAttr(jsonInput, ConstantsIF.UID);\n this.checkMeta(jsonInput);\n break;\n }\n case DELETE: {\n this.checkAttr(jsonInput, ConstantsIF.UID);\n break;\n }\n default:\n break;\n }\n\n _logger.exiting(CLASS, METHOD);\n\n return;\n }", "public interface ObjectAction {\n\t/**\n\t * Get menu filter associated with the tool\n\t */\n\tpublic ObjectMenuFilter getMenuFilter();\n\n\t/**\n\t * Sets menu filter for the tool\n\t */\n\tpublic void setMenuFilter(ObjectMenuFilter filter);\n\n\t/**\n\t * Get tool type\n\t */\n\tpublic int getToolType();\n\n\t/**\n\t * Check if this action is applicable to given node\n\t * \n\t * @param node\n\t * node object\n\t * @return true if applicable\n\t */\n\tpublic boolean isApplicableForNode(AbstractNode node);\n}", "@Override\r\n public void validate() {\r\n }", "@Override\n\tpublic void validate(Object target, Errors errors) {\n\t\t\n\t}", "@Override\r\n\tpublic void validate() {\n\t\t\r\n\t}", "void validate(T object);", "protected void validate() {\n // no implementation.\n }", "@Override\n\tpublic void validate(Object target, Errors errors) {\n\t\t\n\t\t\n\t}", "@Override\n\tpublic void createAction(Model m) {\n\t\t\n\t}", "public CreateIndividualPreAction() {\n }", "public EmptyRuleActionImpl() {}", "@Override\n protected Result validate() {\n return successful(this);\n }", "public boolean validate(Object o){\r\n\t\treturn false;\r\n\t}", "private void validateInputParameters(){\n\n }", "public void testHandleActionEvent_SimpleActionEvent_Accuracy()\n throws Exception {\n setUpEventManager();\n\n ActionEvent actionEvent = new ActionEvent(undoableAction1, new String());\n // Handle the event, actionEventListener1 and actionEventListener2 should be notified\n eventManager.handleActionEvent(actionEvent);\n\n // The validation result is EventValidation.EVENT_MODIFIED\n Pair<EventObject, EventValidation> performRecord = new Pair<EventObject, EventValidation>(actionEvent,\n EventValidation.EVENT_MODIFIED);\n // actionEventListener1 should be notified\n assertTrue(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener1).getPerformedRecords().contains(performRecord));\n // actionEventListener2 should be notified\n assertTrue(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener2).getPerformedRecords().contains(performRecord));\n // actionEventListener3 should not be notified\n assertFalse(\"Test method for 'EventManager.handleActionEvent(ActionEvent)' failed.\",\n ((MockActionEventListener) actionEventListener3).getPerformedRecords().contains(performRecord));\n }", "private boolean canPerformAction(String actionName, Action action, Value value) {\n\t\tif (actions.get(actionName) != null && actions.get(actionName).compareTo(String.valueOf(action) + \"_\" + String.valueOf(value)) == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void testActionPerformed() {\n try {\n handler.actionPerformed(null, EventValidation.SUCCESSFUL);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "@Test\n\tpublic void testValidRemainingActions() {\n\t\tassertFalse(Player.isValidRemainingActions(Player.MAX_ALLOWED_ACTIONS + 1));\n\t}", "public abstract void validateCommand(FORM target, Errors errors);", "@Test(timeout = 4000)\n public void test267() throws Throwable {\n Submit submit0 = new Submit((Component) null, \".\\\"=_m?KP<D\\\"\", \"I&{b+CI\");\n ActionExpression actionExpression0 = submit0.action(\"\");\n assertFalse(actionExpression0.isSubmissible());\n }", "@Override\r\n\tprotected void validate() {\n\t}", "protected void validateFact(Fact[] param) {\r\n\r\n }", "ValidationResponse validate();", "@Override\n\tpublic void validate() {\n\t}", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "public void testAddAction() {\n AccuracyMockAddAction addAction = new AccuracyMockAddAction(\n modelElement, classToolUtil, manager, namespace);\n\n assertEquals(\"Should return ModelElement instance.\", modelElement,\n addAction.getModelElement());\n assertEquals(\"Should return ClassToolUtil instance.\", classToolUtil,\n addAction.getClassToolUtil());\n }", "@Test(timeout = 4000)\n public void test031() throws Throwable {\n Submit submit0 = new Submit((Component) null, \".\\\"=_m?KP<D\\\"\", \"style\");\n ActionExpression actionExpression0 = submit0.action(\"K]D$m.xC\");\n assertFalse(actionExpression0.isSubmissible());\n }", "public HSRCreateDraftRequestProcessorAction() {\n\t\tlogger.warn(\"***** This constructor is for Test Cases only *****\");\n\t\t\n\t}", "@Override\n\tpublic boolean setUp(Action action) {\n\t\tif (action == null)\n\t\t\treturn false;\n\t\t\n\t\t// ACTIONS THAT LEAD TO THIS STATE\n\t\tif (action.ID == StateActionRegistry.A.GO)\n\t\t{\n\t\t\tGo g = (Go) action;\n\t\t\tif (g.owner == null || (g.loc == null && g.locationOf == null))\n\t\t\t\t\treturn false;\n\t\t\towner = g.owner;\n\t\t\tif (g.loc != null)\n\t\t\t{\n\t\t\t\tloc = g.loc;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlocationOf = g.locationOf;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t\n\t\t// ACTIONS WHOSE PRECOND INCLUDES THIS STATE\n\t\tif (action.ID == StateActionRegistry.A.TAKE)\n\t\t{\n\t\t\tTake t = (Take) action;\n\t\t\tif (t.owner == null || t.taken == null)\n\t\t\t\treturn false;\n\t\t\towner = t.owner;\n\t\t\tlocationOf = t.taken;\n\t\t\treturn true;\n\t\t} else if (action.ID == StateActionRegistry.A.STEAL)\n\t\t{\n\t\t\t\n\t\t\tSteal s = (Steal) action;\n\t\t\tif (s.owner == null || s.stolen == null)\n\t\t\t\treturn false;\n\t\t\towner = s.owner;\n\t\t\tlocationOf = s.stolen;\n\t\t\treturn true;\n\t\t} else if (action.ID == StateActionRegistry.A.ASKTO)\n\t\t{\n\t\t\tAskTo a = (AskTo) action;\n\t\t\tif (a.asker == null || a.askee == null)\n\t\t\t\treturn false;\n\t\t\towner = a.asker;\n\t\t\tlocationOf = a.askee;\n\t\t\treturn true;\n\t\t} else if (action.ID == StateActionRegistry.A.GIVE)\n\t\t{\n\t\t\tGive g = (Give) action;\n\t\t\tif (g.giver == null || g.givee == null || g.obj == null || g.obj.owner != g.giver)\n\t\t\t\treturn false;\n\t\t\towner = g.giver;\n\t\t\tlocationOf = g.givee;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}", "public AssertSoapFaultBuilder(TestRunner runner, AssertSoapFault action) {\n super(runner, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }", "public void testCtor_Accuracy1() {\n assertNotNull(\"Failed to create the action!\",\n new CutCommentAction(this.comment, null));\n }", "@Test\n public void isMoveActionLegalFor()\n {\n // Setup.\n final CheckersGameInjector injector = new CheckersGameInjector();\n final List<Agent> agents = createAgents(injector);\n final CheckersEnvironment environment = createEnvironment(injector, agents);\n final CheckersAdjudicator adjudicator = injector.injectAdjudicator();\n\n // Agent white can move his token to an adjacent empty space.\n assertTrue(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P13));\n\n // Agent white cannot move backwards.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P05));\n\n // Agent white cannot move to an occupied space.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P04,\n CheckersPosition.P08));\n\n // Agent white cannot move a red token.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P21,\n CheckersPosition.P17));\n\n // Agent white cannot move too far.\n assertFalse(adjudicator.isMoveActionLegalFor(environment, CheckersTeam.WHITE, CheckersPosition.P09,\n CheckersPosition.P18));\n }", "@Test\n public void officeActionCreateWithMismatchingEviCaseNo77777778() {\n // This test case validate the understanding based on which the create\n // office-action api has been developed.\n // ie, while creating an office-action inside a given serial number the\n // incoming association of evidence file has to match\n // the serial number of office-action.\n // In-other words the incoming associated evidence files needs to exists\n // inside the same office-action case number.\n testCreateSampleEviOneForOffActn78();\n testCreateSampleEviTwoForOffActn78();\n testCreateOfficeAction77();\n }", "@Test\r\n public void testAction() {\r\n System.out.println(\"action\");\r\n ImageView but = null;\r\n ChessMain instance = new ChessMain();\r\n instance.action(but);\r\n // TODO review the generated test code and remove the default call to fail.\r\n \r\n }", "public abstract void init_actions() throws Exception;", "public abstract void\n bypassValidation_();", "public AssertSoapFaultBuilder(TestDesigner designer, AssertSoapFault action) {\n\t super(designer, action);\n\n\t // for now support one single soap fault detail\n\t SoapFaultDetailValidationContext soapFaultDetailValidationContext = new SoapFaultDetailValidationContext();\n\t soapFaultDetailValidationContext.addValidationContext(validationContext);\n\t action.setValidationContext(soapFaultDetailValidationContext);\n }", "void validateActivoUpdate(Activo activo);", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "private void makeValidActionsDiscretized() {\n validActionsDiscretized = new ArrayList<>();\n\n List<ActionType> actionTypes = problemSpec.getLevel().getAvailableActions();\n\n // Valid tire pressures\n List<TirePressure> tirePressures = Arrays.asList(\n TirePressure.FIFTY_PERCENT,\n TirePressure.SEVENTY_FIVE_PERCENT,\n TirePressure.ONE_HUNDRED_PERCENT\n );\n\n // Valid fuel levels (note that this is an arbitrary discretization)\n List<Integer> fuelLevels = new ArrayList<>();\n int fuelInterval = ProblemSpec.FUEL_MAX / FUEL_DISCRETE_INTERVALS;\n\n for (int i = 0; i < FUEL_DISCRETE_INTERVALS; i++) {\n fuelLevels.add(fuelInterval * i);\n }\n\n // Go through A1-A8 and add all possible combinations of the parameters\n for (ActionType actionType : actionTypes) {\n switch (actionType.getActionNo()) {\n case 1:\n validActionsDiscretized.add(new Action(actionType));\n break;\n\n case 2:\n for (String car : problemSpec.getCarOrder()) {\n validActionsDiscretized.add(new Action(actionType, car));\n }\n\n break;\n\n case 3:\n for (String driver : problemSpec.getDriverOrder()) {\n validActionsDiscretized.add(new Action(actionType, driver));\n }\n\n break;\n\n case 4:\n for (Tire tire : problemSpec.getTireOrder()) {\n validActionsDiscretized.add(new Action(actionType, tire));\n }\n\n break;\n\n case 5:\n for (int fuel : fuelLevels) {\n validActionsDiscretized.add(new Action(actionType, fuel));\n }\n\n break;\n\n case 6:\n for (TirePressure pressure : tirePressures) {\n validActionsDiscretized.add(new Action(actionType, pressure));\n }\n\n break;\n case 7:\n for (String car : problemSpec.getCarOrder()) {\n for (String driver : problemSpec.getDriverOrder()) {\n validActionsDiscretized.add(new Action(actionType, car, driver));\n }\n }\n\n break;\n\n case 8:\n for (TirePressure pressure : tirePressures) {\n for (int fuel : fuelLevels) {\n for (Tire tire : problemSpec.getTireOrder()) {\n validActionsDiscretized.add(new Action(actionType, tire, fuel,\n pressure));\n }\n }\n }\n\n break;\n }\n }\n }", "public void testValidationMessageWithOnUpdateAndOnEditRules() {\r\n \t\tfinal Text control = getWidget();\r\n \t\tfinal ITextRidget ridget = getRidget();\r\n \r\n \t\tfinal IValidator ruleMin3 = new MinLength(3);\r\n \t\tfinal IValidator ruleMin5 = new MinLength(5);\r\n \t\tridget.addValidationRule(ruleMin3, ValidationTime.ON_UI_CONTROL_EDIT);\r\n \t\tridget.addValidationRule(ruleMin5, ValidationTime.ON_UPDATE_TO_MODEL);\r\n \t\tridget.addValidationMessage(\"need 3\", ruleMin3);\r\n \t\tridget.addValidationMessage(\"need 5\", ruleMin5);\r\n \r\n \t\tbean.setProperty(\"a\");\r\n \t\tridget.bindToModel(bean, TestBean.PROPERTY);\r\n \t\tridget.updateFromModel();\r\n \r\n \t\tassertMessage(ridget, ValidationMessageMarker.class, \"need 3\");\r\n \t\tassertMessage(ridget, ValidationMessageMarker.class, \"need 5\");\r\n \t\tassertMessageCount(ridget, ValidationMessageMarker.class, 2);\r\n \r\n \t\tcontrol.setSelection(1, 1);\r\n \t\tUITestHelper.sendString(control.getDisplay(), \"b\");\r\n \r\n \t\tassertMessage(ridget, ValidationMessageMarker.class, \"need 3\");\r\n \t\tassertMessage(ridget, ValidationMessageMarker.class, \"need 5\");\r\n \t\tassertMessageCount(ridget, ValidationMessageMarker.class, 2);\r\n \r\n \t\tUITestHelper.sendString(control.getDisplay(), \"c\");\r\n \r\n \t\tassertMessage(ridget, ValidationMessageMarker.class, \"need 5\");\r\n \t\tassertMessageCount(ridget, ValidationMessageMarker.class, 1);\r\n \r\n \t\tUITestHelper.sendString(control.getDisplay(), \"de\");\r\n \r\n \t\tassertMessage(ridget, ValidationMessageMarker.class, \"need 5\");\r\n \t\tassertMessageCount(ridget, ValidationMessageMarker.class, 1);\r\n \r\n \t\tUITestHelper.sendString(control.getDisplay(), \"\\r\");\r\n \r\n \t\tassertMessageCount(ridget, ValidationMessageMarker.class, 0);\r\n \t}", "public void testCtor_NullState() {\n try {\n new AddActionStateAction(null, activityGraph, manager);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n }\n }", "public void testAddEventValidator1_NotActionClass() {\n try {\n eventManager.addEventValidator(successEventValidator, String.class);\n fail(\"IllegalArgumentException should be thrown.\");\n } catch (IllegalArgumentException iae) {\n // Success\n }\n }", "@Override\n\tpublic void check() throws ApiRuleException {\n\t\t\n\t}", "@Test\n\tpublic void testValidate() throws Exception {\n\t\tSystem.out.println(\"validate\");\n\t\tso.validate(entity);\n\t}", "@Test\n\tpublic void testValidateNewAssetTargetWithValidQuery() {\n\t\tupdates.add(mockAssetView(\"target\", DefaultRuleAssetValidator.SEARCH_PAGES));\n\t\tdefaultRuleAssetValidator.validateNewAsset(editorInfo, updates, null);\n\t\tverify(assetService).addError(anyString(), anyString());\t\t\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void EditViewLessthan15AcctsErrorValidation() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify whether proper error message is displayed in view when continuing with out enabling the accounts check box\");\n\n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMvManageView\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t\t.clicktestacct();\n\t\t/*.ClickManageUserLink()\n\t\t.ManageViews()\n\t\t.VerifyEditviewname(userProfile)\n\t\t.EditViewNameErrorValidation(userProfile); \t \t\t\t\t\t\t \t \t\t\n\t}*/\n\t}", "protected void init_actions()\n {\n action_obj = new CUP$ParserForms$actions(this);\n }", "public void validate() {\n\t\tlog(\"In validate of LoginAction\");\n\t\t//if (StringUtils.isEmpty(user.getUserId())) {\n\t if (StringUtils.isEmpty(userId)) {\t\n\t\t\tlog(\"In validate of LoginAction: userId is blank\");\n\t\t\taddFieldError(\"userId\", \"User ID cannot be blank\");\n\t\t}\n\t\t//if (StringUtils.isEmpty(user.getPassword())) {\n\t if (StringUtils.isEmpty(password)) {\n\t\t\tlog(\"In validate of LoginAction: password is blank\");\n\t\t\taddFieldError(\"password\", \"Password cannot be blank\");\n\t\t}\n\t\tlog(\"Completed validate of LoginAction\");\n\t}", "@Override\r\n\tpublic ActionErrors validate(ActionMapping mapping, HttpServletRequest request)\r\n\t{\n\t\treturn super.validate(mapping, request);\r\n\t}", "public T caseUbqAction(UbqAction object) {\r\n\t\treturn null;\r\n\t}" ]
[ "0.668825", "0.6321527", "0.62437004", "0.6134117", "0.61323154", "0.61301625", "0.6055052", "0.602525", "0.58938116", "0.5862158", "0.58501863", "0.57452804", "0.57328737", "0.57160527", "0.56856424", "0.567906", "0.56670535", "0.5665796", "0.56407785", "0.56107265", "0.56062347", "0.5595135", "0.5583868", "0.5579473", "0.55695367", "0.5565867", "0.5554627", "0.55472696", "0.5536421", "0.55168295", "0.55142546", "0.5505257", "0.5495313", "0.54856753", "0.54839355", "0.5482533", "0.54716796", "0.5468296", "0.54640466", "0.54547334", "0.54547334", "0.54547334", "0.54510164", "0.54430854", "0.54430854", "0.54430854", "0.5441892", "0.5411546", "0.5401252", "0.5399562", "0.5397778", "0.5395436", "0.53939605", "0.53820354", "0.53778154", "0.537313", "0.5364259", "0.5359661", "0.53566223", "0.5342234", "0.5337273", "0.53332096", "0.53326124", "0.53212345", "0.53156084", "0.5313976", "0.5312379", "0.5311896", "0.53098446", "0.52972835", "0.5292021", "0.5282396", "0.52797735", "0.52797735", "0.52797735", "0.5274972", "0.526768", "0.52666074", "0.5263917", "0.52533907", "0.5234942", "0.5228214", "0.5223862", "0.5222578", "0.52207106", "0.52056617", "0.5202464", "0.52019876", "0.5199677", "0.51961195", "0.519088", "0.51863146", "0.51854", "0.5179594", "0.5178182", "0.5175568", "0.5160877", "0.5160603", "0.51585376", "0.5147129", "0.51437217" ]
0.0
-1
/ TODO take care of multiples and order.
@Override protected void doVisit(SqlUpdateClause<?> clause) { if (! appendStart(clause)) return; sb.append(clause.getSql()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getOne_or_more();", "public boolean hasMultiple() {\n/* 99 */ return this.multiple;\n/* */ }", "private void mul() {\n\n\t}", "int order();", "boolean getMultiple();", "@Override\n protected int getNumRepetitions() {\n return 1;\n }", "public void testMultiple() {\n \tMeasurement a = new Measurement(2,6);\n \tMeasurement b = new Measurement(1,5);\n \t\n \tMeasurement c = a.multiple(2);\n \tMeasurement d = b.multiple(5);\n \t\n assertTrue(a.getFeet() == 2);\n assertTrue(a.getInches() == 6);\n assertTrue(b.getFeet() == 1);\n assertTrue(b.getInches() == 5);\n \n assertTrue(c.getFeet() == 5);\n assertTrue(c.getInches() == 0);\n assertTrue(d.getFeet() == 7);\n assertTrue(d.getInches() == 1);\n }", "public void nextIterate() {\n\tdd1[0] = POW2_53 * d1;\n\tdd1[1] = 0.0;\n\tdddivd(dd1, POW3_33, dd2);\n\tddmuldd(POW3_33, Math.floor(dd2[0]), dd2);\n\tddsub(dd1, dd2, dd3);\n\td1 = dd3[0];\n\tif (d1 < 0.0) {\n\t d1 += POW3_33;\n\t}\n }", "@RepeatedTest(20)\n void multTest(){\n assertEquals(f.mult(f), new Float(decimal*decimal));\n assertEquals(f.mult(g), new Float(decimal*random));\n assertEquals(f.mult(g), g.mult(f));\n assertEquals(f.mult(i), new Float(decimal*seed));\n assertEquals(f.mult(bi), new Float(decimal*bi.toInt(bi.getBinary())));\n assertEquals(i.mult(f), new Float(seed*decimal));\n assertEquals(i.mult(i), new Int(seed*seed));\n assertEquals(i.mult(j), new Int(seed*random));\n assertEquals(i.mult(j), j.mult(i));\n assertEquals(i.mult(bi), new Int(seed*bi.toInt(bi.getBinary())));\n\n //nulls\n //Bool * ITypes\n assertEquals(bot.mult(st),Null);\n assertEquals(bof.mult(st),Null);\n assertEquals(bot.mult(bot),Null);\n assertEquals(bof.mult(bot), Null);\n assertEquals(bot.mult(f), Null);\n assertEquals(bof.mult(i), Null);\n assertEquals(bot.mult(bi), Null);\n //Float * ITypes \\ {Numbers}\n assertEquals(f.mult(st), Null);\n assertEquals(f.mult(bot), Null);\n assertEquals(f.mult(bof), Null);\n //Int * ITypes \\ {Numbers}\n assertEquals(i.mult(st), Null);\n assertEquals(i.mult(bot),Null);\n assertEquals(i.mult(bof), Null);\n //Binary * ITypes \\ {Int, Binary}\n assertEquals(bi.mult(st), Null);\n assertEquals(bi.mult(bot), Null);\n assertEquals(bi.mult(f), Null);\n //NullType multiplications\n assertEquals(Null.mult(st), Null);\n assertEquals(Null.mult(bof), Null);\n assertEquals(Null.mult(f), Null);\n assertEquals(Null.mult(i), Null);\n assertEquals(Null.mult(bi), Null);\n assertEquals(Null.mult(Null), Null);\n assertEquals(st.mult(Null), Null);\n assertEquals(bot.mult(Null), Null);\n assertEquals(f.mult(Null), Null);\n assertEquals(i.mult(Null), Null);\n assertEquals(bi.mult(Null), Null);\n }", "public void multiply() {\n\t\t\n\t}", "static Stream<Arguments> args() {\n\t\treturn Stream.of(\n\t\t\tArguments.of(0, 1, 0, 0, \"one\"),\n\t\t\tArguments.of(3, 1, 0, 3, \"one \"),\n\t\t\tArguments.of(4, 2, 1, 0, \"one \"),\n\n\t\t\tArguments.of(0, 2, 0, 0, \"one two\"),\n\t\t\tArguments.of(1, 2, 0, 1, \"one two\"),\n\t\t\tArguments.of(2, 2, 0, 2, \"one two\"),\n\t\t\tArguments.of(3, 2, 0, 3, \"one two\"),\n\t\t\tArguments.of(7, 2, 1, 3, \"one two\"),\n\t\t\tArguments.of(7, 2, 1, 3, \"one two \"),\n\t\t\tArguments.of(8, 3, 2, 0, \"one two \"),\n\n\t\t\tArguments.of(0, 1, 0, 0, \"'one'\"),\n\t\t\t// Arguments.of(5, 1, 0, 3, \"'one' \"),\n\t\t\tArguments.of(6, 2, 1, 0, \"'one' \"),\n\n\t\t\tArguments.of(0, 1, 0, 0, \"'one'\"),\n\t\t\tArguments.of(1, 1, 0, 0, \"'one'\"),\n\t\t\tArguments.of(2, 1, 0, 1, \"'one'\"),\n\t\t\tArguments.of(3, 1, 0, 2, \"'one'\"),\n\t\t\tArguments.of(4, 1, 0, 3, \"'one'\"),\n\t\t\t// Arguments.of(5, 1, 0, 3, \"'one'\"),\n\n\t\t\tArguments.of(0, 1, 0, 0, \"'one' \"),\n\t\t\tArguments.of(1, 1, 0, 0, \"'one' \"),\n\t\t\tArguments.of(2, 1, 0, 1, \"'one' \"),\n\t\t\tArguments.of(3, 1, 0, 2, \"'one' \"),\n\t\t\tArguments.of(4, 1, 0, 3, \"'one' \"),\n\t\t\t// Arguments.of(5, 1, 0, 3, \"'one' \"),\n\t\t\tArguments.of(6, 2, 1, 0, \"'one' \"),\n\n\t\t\tArguments.of(0, 1, 0, 0, \"\\\"one\\\"\"),\n\t\t\tArguments.of(1, 1, 0, 0, \"\\\"one\\\"\"),\n\t\t\tArguments.of(2, 1, 0, 1, \"\\\"one\\\"\"),\n\t\t\tArguments.of(3, 1, 0, 2, \"\\\"one\\\"\"),\n\t\t\tArguments.of(4, 1, 0, 3, \"\\\"one\\\"\"),\n\t\t\t// Arguments.of(5, 1, 0, 3, \"\\\"one\\\"\"),\n\n\t\t\tArguments.of(0, 1, 0, 0, \"\\\"one\\\" \"),\n\t\t\tArguments.of(1, 1, 0, 0, \"\\\"one\\\" \"),\n\t\t\tArguments.of(2, 1, 0, 1, \"\\\"one\\\" \"),\n\t\t\tArguments.of(3, 1, 0, 2, \"\\\"one\\\" \"),\n\t\t\tArguments.of(4, 1, 0, 3, \"\\\"one\\\" \"),\n\t\t\t// Arguments.of(5, 1, 0, 3, \"\\\"one\\\" \"),\n\t\t\tArguments.of(6, 2, 1, 0, \"\\\"one\\\" \")\n\t\t\t);\n\t}", "static List<List<Card>> multiply(List<List<Card>> runs, Set<Card> operand) {\n List<List<Card>> expandedRuns = new ArrayList<>();\n for (List<Card> run : runs) {\n for (Card card : operand) {\n List<Card> newRun = new ArrayList<>();\n newRun.addAll(run);\n newRun.add(card);\n expandedRuns.add(newRun);\n }\n }\n return expandedRuns;\n }", "private void multiple() throws Exception{\n\t\tif(!(stackBiggerThanTwo())) throw new Exception(\"Stack hat zu wenig einträge mindestens 2 werden gebraucht!!\");\n\t\telse{\n\t\t\tvalue1=stack.pop();\n\t\t\tvalue2=stack.pop();\n\t\t\tstack.push(value1*value2);\n\t\t}\n\t}", "@Override\n public int getOrder() {\n return 4;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] x = {1,2,2};\r\n\t\tint[] y = {1, 2, 1,2};\r\n\t\tint[] a = {2,1,2};\r\n\t\tint[] b = {2,2,1,2};\r\n\t\t\r\n\t\tSystem.out.println(nextToTwo(x));\r\n\t\tSystem.out.println(nextToTwo(y));\r\n\t\tSystem.out.println(nextToTwo(a));\r\n\t\tSystem.out.println(nextToTwo(b));\t\t\r\n\r\n\t}", "int[] getGivenByOrder();", "@Test\r\npublic void multiplesNumerosSeparadosPorComa() {\r\n try {\r\n assertEquals(Calculadora.add(\"1,6,11,6\"), 24);\r\n assertEquals(Calculadora.add(\"1,2,3,5,6,7,8\"), 32);\r\n assertEquals(Calculadora.add(\"1,4,12,5,20\"), 42);\r\n } catch (Exception ex) {\r\n fail(\"Error probando la calculadora con varios números separados por una coma\");\r\n }\r\n}", "@Test\n public void testFactor_4args() {\n System.out.println(\"factor\");\n int[] number = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n int[] weighting = {1, 2, 2, 3, 4, 5};\n int start = 4;\n int end = 9;\n AbstractMethod instance = new AbstractMethodImpl();\n int[] expResult = {0, 1, 2, 15, 16, 15, 12, 14, 8, 9};\n int[] result = instance.factor(number, weighting, start, end);\n assertArrayEquals(expResult, result);\n\n\n }", "private SBomCombiner()\n\t{}", "public static int[] largestMultiple(int[] arr) {\r\n\t\tif(arr==null || arr.length==0) return arr;\r\n\t\t\r\n\t\tQueue<Integer> q1 = new PriorityQueue<Integer>();\r\n\t\tQueue<Integer> q2 = new PriorityQueue<Integer>();\r\n\t\tQueue<Integer> q3 = new PriorityQueue<Integer>();\r\n\t\t\r\n\t\tArrays.sort(arr);\r\n\t\t\r\n\t\tint sum= 0;\r\n\t\tfor(int i=0;i<arr.length;i++) {\r\n\t\t\tif(arr[i]%3==0) {\r\n\t\t\t\tq1.add(arr[i]);\r\n\t\t\t}\r\n\t\t\telse if(arr[i]%3==1) {\r\n\t\t\t\tq2.add(arr[i]);\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t\tq3.add(arr[i]);\r\n\t\t\tsum += arr[i];\r\n\t\t}\r\n\t\t\r\n\t\tif(sum%3==2) {\r\n\t\t\tif(!q2.isEmpty()) {\r\n\t\t\t\tq2.remove();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(!q1.isEmpty()) {\r\n\t\t\t\t\tq1.remove();\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t\treturn null;\r\n\t\t\t\tif(!q1.isEmpty()) {\r\n\t\t\t\t\tq1.remove();\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(sum%3==1) {\r\n\t\t\tif(!q1.isEmpty()) {\r\n\t\t\t\tq1.remove();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(!q2.isEmpty()) \r\n\t\t\t\t\tq2.remove();\r\n\t\t\t\telse \r\n\t\t\t\t\treturn null;\r\n\t\t\t\tif(!q2.isEmpty()) \r\n\t\t\t\t\tq2.remove();\r\n\t\t\t\telse\r\n\t\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint top=0;\r\n\t\twhile(!q1.isEmpty()) {\r\n\t\t\tarr[top++] = (int)q1.remove();\r\n\t\t}\r\n\t\twhile(!q2.isEmpty()) {\r\n\t\t\tarr[top++] = (int) q2.remove();\r\n\t\t}\r\n\t\t\r\n\t\twhile(!q3.isEmpty()) {\r\n\t\t\tarr[top++] = (int) q3.remove();\r\n\t\t}\r\n\t\tfor(int i=top-1;i>=0;i--){\r\n\t\t\tSystem.out.print(arr[i]+\" \");\r\n\t\t}\r\n\t\treturn arr;\r\n\t}", "@Test\n public void test_singleParametersToArity() throws Exception {\n new Thread(MultiProcessor::processStrings);\n\n // Same but with one value\n ListSequence.fromList(ListSequence.fromList(new ArrayList<String>())).select((values) -> MultiProcessor.processStrings(values));\n\n // Same but with more than one value\n Arrays.sort(new String[]{}, MultiProcessor::processStrings);\n }", "public static void main(String[] args) {\n\n\n List<Integer> a = range(3, 19).mapToObj(Integer::valueOf).collect(toList());\n a.sort((x, y) -> (x - y));\n// System.out.println(a);\n\n List<List<String>> QUICK_THREE_OPTIONS = new ArrayList<>();\n //空 0\n QUICK_THREE_OPTIONS.add(new ArrayList<>());\n //和值 1\n final List<String> sumOptions = range(3, 19).mapToObj(String::valueOf).collect(toList());\n QUICK_THREE_OPTIONS.add(sumOptions);\n //三同号 2\n final List<String> threeSameOptions = range(1, 7).mapToObj(i -> nTimes(i, 3)).collect(toList());\n threeSameOptions.add(\"3A\");\n QUICK_THREE_OPTIONS.add(threeSameOptions);\n //二同号 3\n final List<String> twoSameOptions = range(1, 7).mapToObj(i -> nTimes(i, 2)).collect(toList());\n twoSameOptions.addAll(range(1, 7).mapToObj(String::valueOf).collect(toList()));\n twoSameOptions.addAll(range(1, 7).mapToObj(i -> nTimes(i, 2) + \"*\").collect(toList()));\n QUICK_THREE_OPTIONS.add(twoSameOptions);\n //三不同 4\n final List<String> threeDifferent = range(1, 7).mapToObj(String::valueOf).collect(toList());\n threeDifferent.add(\"3B\");\n QUICK_THREE_OPTIONS.add(threeDifferent);\n //二不同 5\n final List<String> twoDifferent = range(1, 7).mapToObj(String::valueOf).collect(toList());\n QUICK_THREE_OPTIONS.add(twoDifferent);\n\n// System.out.println(QUICK_THREE_OPTIONS);\n\n List<List<String>> ELEVEN_C_FIVE_OPTIONS = new ArrayList<>();\n\n //组合选项\n ELEVEN_C_FIVE_OPTIONS.add(IntStream.range(1, 12).mapToObj(i -> String.format(\"%02d\", i)).collect(toList()));\n //前二直选\n final List<String> frontTwoDirect = new ArrayList<>();\n frontTwoDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontTwoDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n ELEVEN_C_FIVE_OPTIONS.add(frontTwoDirect);\n //前三直选\n final List<String> frontThreeDirect = new ArrayList<>();\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"c\" + String.format(\"%02d\", i)).collect(toList()));\n ELEVEN_C_FIVE_OPTIONS.add(frontThreeDirect);\n\n final int TWENTY_C_FIVE_SAN_GUO_SHI_LI = 1;\n final int TWENTY_C_FIVE_SAN_GUO_FIVE = 2;\n final int TWENTY_C_FIVE_SAN_GUO_EIGHT = 3;\n final int TWENTY_C_FIVE_SAN_GUO_FRONT_THREE_DIRECT = 4;\n final List<List<String>> TWENTY_C_FIVE_SAN_GUO_OPTIONS = new ArrayList<>();\n\n //势力选择\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(IntStream.range(1, 4).mapToObj(i -> String.format(\"%02d\", i)).collect(toList()));\n //组合选项\n final List<String> group = new ArrayList<>();\n group.addAll(IntStream.range(1, 21).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n group.addAll(IntStream.range(1, 4).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(group);\n //前三直选\n final List<String> frontThreeDirect1 = new ArrayList<>();\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"c\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 4).mapToObj(i -> \"d\" + String.format(\"%02d\", i)).collect(toList()));\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(frontThreeDirect1);\n\n// System.out.println(ELEVEN_C_FIVE_OPTIONS);\n\n List<String> s = new ArrayList<>();\n s.add(\"3\");\n s.add(\"5\");\n s.add(\"6\");\n s.add(\"7\");\n s.add(\"9\");\n// s.add(\"11\");\n// System.out.println(c);\n List<List<String>> s1 = new ArrayList<>();\n s1.add(s);\n List<String> targetNumbers = s1.stream().map(l -> join(l, \",\")).collect(toList());\n\n// System.out.println(getPermutationXSrcLists(s, 2, true));\n\n long tl = computeElevenCFiveGroup(targetNumbers.get(0));\n// System.out.println(tl);\n System.out.println(TWENTY_C_FIVE_SAN_GUO_OPTIONS);\n\n }", "protected abstract void recombineNext();", "@Test\n public void testItem_Ordering() {\n OasisList<Integer> baseList = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 2, 6, 8);\n baseList.addAll(expResult);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), baseList.get(i));\n }\n }", "private static void test4() {\n int[] numbers = {4, 5, 1, 6, 2, 7, 2, 8};\n int[] expected = {1, 2};\n\n test(\"Test4\", numbers, expected);\n }", "@Test\n public void addMultipleNonEmptyTest() {\n Set<String> s = this.createFromArgsTest(\"zero\", \"three\");\n Set<String> sExpected = this.createFromArgsRef(\"zero\", \"one\", \"two\",\n \"three\");\n\n s.add(\"two\");\n s.add(\"one\");\n\n assertEquals(sExpected, s);\n }", "@Test\n\tvoid RepeatedNumberTest() \n\t{ int[] oneNum = new int[] {1};\n\t\tint[] twoDiffNums = new int[] {1, 2};\n\t\tint[] twoSameNums = new int[] {2, 2};\n\t\tint[] insideOut = new int[] {5, 4, 3, 2, 1, 1, 2, 3, 4, 5};\n\t\t\n\t\tassertFalse(utilities.RepeatedNumber(oneNum));\n\t\tassertFalse(utilities.RepeatedNumber(twoDiffNums));\n\t\tassertTrue(utilities.RepeatedNumber(twoSameNums));\n\t\tassertTrue(utilities.RepeatedNumber(insideOut));\n\t}", "public static void main(String[] args) {\n\t\tint[] nums = {1,2,3};\n\t\tnew NextPermutation().nextPermutation(nums);\n\t\tint[] nums1 = {3,2,1};\n\t\tnew NextPermutation().nextPermutation(nums1);\n\t\tint[] nums2 = {1,3,2};\n\t\t//Arrays.sort(nums2, 1, nums.length);\n\t\t//for(int i=0;i<nums2.length;i++)System.out.println(nums2[i]);\n\t\tnew NextPermutation().nextPermutation(nums2);\n\n\t}", "public final void mod() {\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (topMostValue > 0) {\n\t\t\t\tpush(secondTopMostValue % topMostValue);\n\t\t\t}\n\t\t}\n\t}", "private List<Integer> multiply(List<Integer> numbers) {\n List<Integer> result = new ArrayList<>();\n for (int number : numbers) {\n if (number != 8 && number != 9) {\n result.add(number);\n }\n if (number == 8 || number == 9) {\n int currentNumber = number * 2;\n result.add(currentNumber);\n }\n }\n return result;\n }", "public void findMutual(){\n\n }", "private void addTwoNumbers() {\n\t\t\n\t}", "Split getNext();", "public DoubleLinkedSeq everyOther(){\r\n\t DoubleLinkedSeq everyOther = new DoubleLinkedSeq(); \r\n\t int count = 2; \r\n\t for(cursor = head; cursor != null; cursor = cursor.getLink()){\r\n\t\t if(count % 2 == 0){\r\n\t\t\t everyOther.addAfter(this.getCurrent());\r\n\t\t }\r\n\t\t else {}\r\n\t\t \r\n\t\t count += 1; \r\n\t }\r\n\t return everyOther; \r\n\t \r\n}", "private static int multAndDivFixer(int size){\n return size;\n }", "int generatorsCalculation(String... generatorsNumbers);", "@Test\r\n public void PermutationTest() {\r\n System.out.println(\"permutation\");\r\n String prefix = \"\";\r\n String in = \"123\";\r\n Input input = new Input(in);\r\n List<String> expResult = Arrays.asList(\"123\",\"132\",\"213\",\"231\",\"312\",\"321\");\r\n List<String> result = instance.permutation(prefix, input);\r\n instance.sort(result);\r\n assertEquals(expResult, result);\r\n }", "@Override\r\n\tpublic int multiNums(int n1, int n2) {\n\t\treturn 0;\r\n\t}", "@Override\n\tpublic int getOrder() {\n\t\treturn 1;\n\t}", "public void testSUBORDINARY_MULTIPLE4() throws Exception {\n\t\tObject retval = execLexer(\"SUBORDINARY_MULTIPLE\", 50, \"chevronels\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"SUBORDINARY_MULTIPLE\", expecting, actual);\n\t}", "@Test\n public void testAddAll_int_Collection_Order_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n instance.addAll(1, c);\n\n List expResult = Arrays.asList(3, 1, 2, 3, 2, 3, 2, 3, 2);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), instance.get(i));\n }\n }", "@Override\n public Integer next(){\n while(!isPowerOfTwo(this.getValue() + 1)){\n super.next(); \n }\n if(this.getValue() == 3)\n super.next();\n Integer save = this.getValue();\n super.next();\n return save;\n }", "@Test\n void testPutReturnsRightValueAfterMultiplePuts() {\n MyList l = new MyList();\n for (int i = 0; i < 10; i++)\n l.put(\"key\" + i, \"value\" + i);\n\n assertEquals(\"value5\", l.put(\"key5\", \"another value\"));\n }", "public static void highlyDivisibleTriangularNumber(){\n\n int position = 1;\n long triangleNumber;\n Long[] factors;\n do{\n position ++;\n triangleNumber = getTriangleNumber(position);\n factors = getFactors(triangleNumber); \n }while(factors.length <= 500);\n\n System.out.println(triangleNumber);\n}", "public void getJobMixAndMakeProcesses(){\n if(jobType == 1){\n //type 1: there is only one process, with A=1 and B=C=0\n //since there is only one process, no the currentWord is 111%processSize\n processes.add(new process(1, 1, 0, 0, 111 % processSize));\n\n }else if(jobType ==2){\n //type 2: there are four processes, each with A=1, B=C=0\n for(int i=1; i<5; i++){\n processes.add(new process(i, 1, 0, 0, (111*i) % processSize));\n }\n\n\n }else if(jobType ==3){\n //type 3: there are four processes, each with A=B=C=0\n for(int i=1; i<5; i++){\n processes.add(new process(i,0, 0, 0, (111*i) % processSize));\n }\n\n }else{\n System.out.println(\"job type 4!!\");\n //process 1 with A=0.75, B=0.25, C=0\n processes.add(new process(1, 0.75, 0.25, 0, (111) % processSize));\n //process 2 with A=0.75, B= 0, C=0.25\n processes.add(new process(2, 0.75, 0, 0.25, (111*2) % processSize));\n //process 3 with A=0.75, B=0.125, C=0.125\n processes.add(new process(3, 0.75, 0.125, 0.125, (111*3) % processSize));\n //process 4 with A=0.5, B=0.125, C=0.125\n processes.add(new process(4, 0.5, 0.125, 0.125, (111*4) % processSize));\n\n }\n\n }", "public static void main(String[] args) {\n\t\t\n\t\t// 10 Tests: \n\t\tList<Integer> a1 = new List<>();\n\t\tList<Integer> b1 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\t\n\t\tList<Integer> a2 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\tList<Integer> b2 = new List<>();\n\t\t\n\t\tList<Integer> a3 = new List<>();\n\t\tList<Integer> b3 = new List<>();\n\t\t\n\t\tList<Integer> a4 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\tList<Integer> b4 = new List<>(4, new List<>(5, new List<>(6, new List<>())));\n\t\t\n\t\tList<Integer> a5 = new List<>(4, new List<>(5, new List<>(6, new List<>())));\n\t\tList<Integer> b5 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\t\n\t\tList<Integer> a6 = new List<>(1, new List<>(4, new List<>(6, new List<>()))); \n\t\tList<Integer> b6 = new List<>(5, new List<>(6, new List<>(9, new List<>())));\n\t\t\n\t\tList<Integer> a7 = new List<>(-6, new List<>(-5, new List<>(-4, new List<>())));\n\t\tList<Integer> b7 = new List<>(-3, new List<>(-2, new List<>(-1, new List<>())));\n\t\t\n\t\tList<Integer> a8 = new List<>(-2, new List<>(-1, new List<>(0, new List<>())));\n\t\tList<Integer> b8 = new List<>(-1, new List<>(0, new List<>(1, new List<>(2, new List<>()))));\n\t\t\n\t\tList<Integer> a9 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\tList<Integer> b9 = new List<>(3, new List<>(4, new List<>(5, new List<>())));\n\t\t\n\t\tList<Integer> a10 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\tList<Integer> b10 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\t\n\t\tSystem.out.println(unique(a1, b1));\n\t\tSystem.out.println(unique(a2, b2));\n\t\tSystem.out.println(unique(a3, b3));\n\t\tSystem.out.println(unique(a4, b4));\n\t\tSystem.out.println(unique(a5, b5));\n\t\tSystem.out.println(unique(a6, b6));\n\t\tSystem.out.println(unique(a7, b7));\n\t\tSystem.out.println(unique(a8, b8));\n\t\tSystem.out.println(unique(a9, b9));\n\t\tSystem.out.println(unique(a10, b10));\n\t\t\n\t}", "public void testSUBORDINARY_MULTIPLE3() throws Exception {\n\t\tObject retval = execLexer(\"SUBORDINARY_MULTIPLE\", 49, \"chevronel\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"SUBORDINARY_MULTIPLE\", expecting, actual);\n\t}", "public static void multipleReplacement() {\r\n\t\tfor (int i = 1; i <= 100; i++) {\r\n\t\t\tif (i % 3 == 0) {\r\n\t\t\t\tSystem.out.println(i + \" is a multiple of 3\");\r\n\t\t\t} else if (i % 7 == 0) {\r\n\t\t\t\tSystem.out.println(i + \" is a multiple of 7\");\r\n\t\t\t} else\r\n\t\t\t\tSystem.out.println(i);\r\n\t\t}\r\n\t}", "private static int[] getSquersArray(int[] nums) {\n\t\tint[] seqNums = new int[nums.length];\n\t\tint i = 0;\n\t\tfor (int num : nums) {\n\t\t\tseqNums[i] = num * num;\n\t\t\ti++;\n\t\t}\n\t\treturn seqNums;\n\t}", "private void generateLists()\n {\n\tgenerateLists(num1, number);\n\tgenerateLists(num2, otherNumber);\n }", "@Test\r\n\tpublic void testIterator()\r\n\t{\r\n\t\tInteger[] results =\r\n\t\t{ 5, 7, 3 };\r\n\t\tint i = 0;\r\n\t\tfor (Integer item : threeElementsInOrder)\r\n\t\t{\r\n\t\t\tassertEquals(results[i], item);\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "private static BigInteger multiplyToomCook3(BigInteger a, BigInteger b) {\n int alen = a.mag.length;\n int blen = b.mag.length;\n\n int largest = Math.max(alen, blen);\n\n // k is the size (in ints) of the lower-order slices.\n int k = (largest+2)/3; // Equal to ceil(largest/3)\n\n // r is the size (in ints) of the highest-order slice.\n int r = largest - 2*k;\n\n // Obtain slices of the numbers. a2 and b2 are the most significant\n // bits of the numbers a and b, and a0 and b0 the least significant.\n BigInteger a0, a1, a2, b0, b1, b2;\n a2 = a.getToomSlice(k, r, 0, largest);\n a1 = a.getToomSlice(k, r, 1, largest);\n a0 = a.getToomSlice(k, r, 2, largest);\n b2 = b.getToomSlice(k, r, 0, largest);\n b1 = b.getToomSlice(k, r, 1, largest);\n b0 = b.getToomSlice(k, r, 2, largest);\n\n BigInteger v0, v1, v2, vm1, vinf, t1, t2, tm1, da1, db1;\n\n v0 = a0.multiply(b0);\n da1 = a2.add(a0);\n db1 = b2.add(b0);\n vm1 = da1.subtract(a1).multiply(db1.subtract(b1));\n da1 = da1.add(a1);\n db1 = db1.add(b1);\n v1 = da1.multiply(db1);\n v2 = da1.add(a2).shiftLeft(1).subtract(a0).multiply(\n db1.add(b2).shiftLeft(1).subtract(b0));\n vinf = a2.multiply(b2);\n\n // The algorithm requires two divisions by 2 and one by 3.\n // All divisions are known to be exact, that is, they do not produce\n // remainders, and all results are positive. The divisions by 2 are\n // implemented as right shifts which are relatively efficient, leaving\n // only an exact division by 3, which is done by a specialized\n // linear-time algorithm.\n t2 = v2.subtract(vm1).exactDivideBy3();\n tm1 = v1.subtract(vm1).shiftRight(1);\n t1 = v1.subtract(v0);\n t2 = t2.subtract(t1).shiftRight(1);\n t1 = t1.subtract(tm1).subtract(vinf);\n t2 = t2.subtract(vinf.shiftLeft(1));\n tm1 = tm1.subtract(t2);\n\n // Number of bits to shift left.\n int ss = k*32;\n\n BigInteger result = vinf.shiftLeft(ss).add(t2).shiftLeft(ss).add(t1).shiftLeft(ss).add(tm1).shiftLeft(ss).add(v0);\n\n if (a.signum != b.signum) {\n return result.negate();\n } else {\n return result;\n }\n }", "@Test\n public void testLetterCasePermutation() {\n System.out.println(\"testLetterCasePermutation\");\n LetterCasePermutation instance = new LetterCasePermutation();\n\n List<String> result1 = instance.letterCasePermutation(\"a1b2\");\n List<String> expect1 = ListUtil.buildList(new String[]{\"a1b2\", \"a1B2\", \"A1b2\", \"A1B2\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect1, result1));\n\n List<String> result2 = instance.letterCasePermutation(\"3z4\");\n List<String> expect2 = ListUtil.buildList(new String[]{\"3z4\", \"3Z4\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect2, result2));\n\n List<String> result3 = instance.letterCasePermutation(\"12345\");\n List<String> expect3 = ListUtil.buildList(new String[]{\"12345\"});\n assertTrue(ListUtil.equalsIgnoreOrder(expect3, result3));\n }", "private Combined() {}", "@Override\n protected abstract SecondOrderCollection wrapped();", "@Test\n void multiConstruct() {\n var multicons = \"(define conCar_a (cons 1 2))(define conCar_b (cons 3 conCar_a))(define conCar_c (cons conCar_b 4))(define conCar_d (cons conCar_b conCar_c))\";\n Main.parseInputString(multicons);\n assertEquals(\"(3 1 . 2)\", Main.parseInputString(\"(display (car conCar_d)) \"));\n }", "static String stringMultiplier( String word , int multiplier) {\n\t\tString largeWord = \"\"; \n\t\tfor (int i = 1; i <= multiplier; i++ ) {\n\t\t\tlargeWord += (word + \" \"); \n\t\t}\n\t\treturn largeWord;\n\t}", "@Test\n\tpublic void test() {\n\t\tTestUtil.testEquals(new Object[][]{\n\t\t\t\t{4, 2, 7, 1, 3},\n\t\t\t\t{3, 3, 5, 2, 1},\n\t\t\t\t{15, 2, 4, 8, 2}\n\t\t});\n\t}", "@Test\r\n public void sequentialHasNextInvocationDoesntAffectRetrievalOrder() {\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.hasNext(), is(true));\r\n assertThat(it.next(), is(2));\r\n assertThat(it.next(), is(4));\r\n assertThat(it.next(), is(6));\r\n }", "@Test\n\t\tpublic void orderTest () {\n\t\t\tassertTrue (Demo.isTriangle(2, 1, 4));\t\n\t\t}", "@Test\n public void testAddAll_int_Collection_Order() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n instance.addAll(1, c);\n\n List expResult = Arrays.asList(3, 1, 2, 3, 2);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), instance.get(i));\n }\n }", "int getCombine();", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint N = sc.nextInt();\n\t\tint total = sc.nextInt();\n\t\tint lastAns = 0;\n\t\tList<List<Integer>> list = new ArrayList();\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tlist.add(new ArrayList());\n\t\t}\n\t\tfor (int i = 0; i < total; i++) {\n\t\t\tint q = sc.nextInt();\n\t\t\tint x = sc.nextInt();\n\t\t\tint y = sc.nextInt();\n\t\t\tint seq = (x ^ lastAns) % N;\n\t\t\tList<Integer> seqList = list.get(seq);\n\t\t\t\n\t\t\tswitch (q) {\n\t\t\t\tcase 1:\n\t\t\t\t\tseqList.add(y);\n\t\t\t\t\tlist.set(seq, seqList);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tlastAns = seqList.get(y % seqList.size());\n\t\t\t\t\tSystem.out.println(lastAns);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "@RepeatedTest(20)\n void subTest(){\n assertEquals(f.sub(f), new Float(decimal-decimal));\n assertEquals(f.sub(g), new Float(decimal-random));\n assertEquals(f.sub(i), new Float(decimal-seed));\n assertEquals(f.sub(bi), new Float(decimal-bi.toInt(bi.getBinary())));\n assertEquals(i.sub(f), new Float(seed-decimal));\n assertEquals(i.sub(i), new Int(seed-seed));\n assertEquals(i.sub(bi), new Int(seed-bi.toInt(bi.getBinary())));\n\n //nulls\n //Bool - ITypes\n assertEquals(bot.sub(st),Null);\n assertEquals(bof.sub(st),Null);\n assertEquals(bot.sub(bot),Null);\n assertEquals(bof.sub(bot), Null);\n assertEquals(bot.sub(f), Null);\n assertEquals(bof.sub(i), Null);\n assertEquals(bot.sub(bi), Null);\n //Float - ITypes \\ {Numbers}\n assertEquals(f.sub(st), Null);\n assertEquals(f.sub(bot), Null);\n assertEquals(f.sub(bof), Null);\n //Int - ITypes \\ {Numbers}\n assertEquals(i.sub(st), Null);\n assertEquals(i.sub(bot),Null);\n assertEquals(i.sub(bof), Null);\n //Binary - ITypes \\ {Int, Binary}\n assertEquals(bi.sub(st), Null);\n assertEquals(bi.sub(bot), Null);\n assertEquals(bi.sub(f), Null);\n //NullType subtractions\n assertEquals(Null.sub(st), Null);\n assertEquals(Null.sub(bof), Null);\n assertEquals(Null.sub(f), Null);\n assertEquals(Null.sub(i), Null);\n assertEquals(Null.sub(bi), Null);\n assertEquals(Null.sub(Null), Null);\n assertEquals(st.sub(Null), Null);\n assertEquals(bot.sub(Null), Null);\n assertEquals(f.sub(Null), Null);\n assertEquals(i.sub(Null), Null);\n assertEquals(bi.sub(Null), Null);\n }", "private void GetMontgomeryParms() {\r\n\t\tint NumberLength = this.NumberLength;\r\n\t\tint N, x, j;\r\n\r\n\t\tx = N = (int) TestNbr[0]; // 2 least significant bits of inverse\r\n\t\t\t\t\t\t\t\t\t// correct.\r\n\t\tx = x * (2 - N * x); // 4 least significant bits of inverse correct.\r\n\t\tx = x * (2 - N * x); // 8 least significant bits of inverse correct.\r\n\t\tx = x * (2 - N * x); // 16 least significant bits of inverse correct.\r\n\t\tx = x * (2 - N * x); // 32 least significant bits of inverse correct.\r\n\t\tMontgomeryMultN = (-x) & 0x7FFFFFFF;\r\n\t\tj = NumberLength;\r\n\t\tMontgomeryMultR1[j] = 1;\r\n\t\tdo {\r\n\t\t\tMontgomeryMultR1[--j] = 0;\r\n\t\t} while (j > 0);\r\n\t\tAdjustModN(MontgomeryMultR1, TestNbr, NumberLength);\r\n\t\tMultBigNbrModN(MontgomeryMultR1, MontgomeryMultR1, MontgomeryMultR2, TestNbr, NumberLength);\r\n\t\tMontgomeryMult(MontgomeryMultR2, MontgomeryMultR2, MontgomeryMultAfterInv);\r\n\t\tAddBigNbrModN(MontgomeryMultR1, MontgomeryMultR1, MontgomeryMultR2, TestNbr, NumberLength);\r\n\t}", "@Test\n public void shouldAssertAllTheGroup() {\n List<Integer> list = Arrays.asList(1, 2, 4);\n assertAll(\"List is not incremental\",\n () -> Assertions.assertEquals(list.get(0).intValue(), 1),\n () -> Assertions.assertEquals(list.get(1).intValue(), 2),\n () -> Assertions.assertEquals(list.get(2).intValue(), 3));\n }", "@BeforeAll\n public static void beforeAll()\n {\n cart1.add(\"apple\");\n\n seq1.add(List.of(\"apple\"));\n\n result1 = 1;\n\n // Cart: [Apple, Orange]\n // Seq: [[Orange], [Apple]]\n // Winner: False, items in cart not in the right order\n cart2.add(\"apple\");\n cart2.add(\"orange\");\n\n seq2.add(List.of(\"orange\"));\n seq2.add(List.of(\"apple\"));\n\n result2 = 0;\n\n // Cart: [Apple, Orange, Pear, Apple]\n // Seq: [[Apple], [Orange,Apple]]\n // Winner: False, items not contiguous\n cart3.add(\"apple\");\n cart3.add(\"orange\");\n cart3.add(\"pear\");\n cart3.add(\"apple\");\n\n seq3.add(List.of(\"apple\"));\n seq3.add(List.of(\"orange\", \"apple\"));\n\n result3 = 0;\n\n // Cart: [Apple, Orange, Pear, Apple]\n // Seq: [[Apple], [Any, Apple]]\n // Winner: True, careful that \"any\" doesn't start consuming once \"orange\" is encountered\n cart4.add(\"apple\");\n cart4.add(\"orange\");\n cart4.add(\"pear\");\n cart4.add(\"apple\");\n\n seq4.add(List.of(\"apple\"));\n seq4.add(List.of(\"any\", \"apple\"));\n\n result4 = 1;\n\n // Cart: [Apple]\n // Seq: [[Apple, Any]]\n // Winner: False, No match for apple\n cart5.add(\"apple\");\n\n seq5.add(List.of(\"apple\", \"any\"));\n\n result5 = 0;\n\n // Cart: [Apple]\n // Seq: [[Apple], [Apple]]\n // Winner: False, fruit can't be matched multiple times.\n cart6.add(\"apple\");\n\n seq6.add(List.of(\"apple\"));\n seq6.add(List.of(\"apple\"));\n\n result6 = 0;\n\n // Cart: [Apple, Orange, Pear, Apple]\n // Seq: [[Apple], [Pear, Any]]\n // Winner: True\n cart7.add(\"apple\");\n cart7.add(\"orange\");\n cart7.add(\"pear\");\n cart7.add(\"apple\");\n\n seq7.add(List.of(\"apple\"));\n seq7.add(List.of(\"pear\", \"any\"));\n\n result7 = 1;\n\n // Cart: [Apple, Orange, Apple, Orange, Pear]\n // Seq: [[Apple, Orange, Pear]]\n // Winner: True\n\n cart8.add(\"apple\");\n cart8.add(\"orange\");\n cart8.add(\"apple\");\n cart8.add(\"orange\");\n cart8.add(\"pear\");\n\n seq8.add(List.of(\"apple\", \"orange\", \"pear\"));\n\n result8 = 1;\n }", "void mo1638a(long j, long j2, List list, ayp ayp);", "private void addExactlyOne(Integer[] values){\n ArrayList<Integer> list = new ArrayList<>();\n clauses.add(new ArrayList<Integer>(Arrays.asList(values)));\n //negation of each combination of the variables (nchoose2)\n for (int i=0; i < values.length ; i++){\n for (int j=i+1; j < values.length; j++){\n ArrayList<Integer> clause = new ArrayList<Integer>();\n int firstNo = values[i];\n int secondNo = values[j];\n clause.add(firstNo*-1);\n clause.add(secondNo*-1);\n clauses.add(clause);\n }\n }\n }", "private static String[] calculateAllMultiplicationsAndDivisions(String[] formulaArray){\n Integer operatorPosition = getMultiplicationOrDivisionPosition(formulaArray);\n while(operatorPosition!=-1){\n try {\n formulaArray = calculateMultiplicationOrDivision(formulaArray, operatorPosition);\n }catch(Exception e){\n System.err.println(e);\n }\n operatorPosition= getMultiplicationOrDivisionPosition(formulaArray);\n }\n return formulaArray;\n\n }", "@Override\n\t\tpublic void reduce() {\n\t\t\t\n\t\t}", "void setGivenByOrder(int[] gbo);", "private ARXOrderedString(List<String> format){\r\n if (format.size()==0) {\r\n this.order = null;\r\n } else {\r\n this.order = new HashMap<String, Integer>(); \r\n for (int i=0; i< format.size(); i++){\r\n if (this.order.put(format.get(i), i) != null) {\r\n throw new IllegalArgumentException(\"Duplicate value '\"+format.get(i)+\"'\");\r\n }\r\n }\r\n }\r\n }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "@Test\n public void testSeparateNumber131() { // FlairImage: 131\n java.util.concurrent.atomic.AtomicBoolean totuus = new java.util.concurrent.atomic.AtomicBoolean(false); \n StringBuilder testi = new StringBuilder(); \n assertEquals(\"From: FlairImage line: 135\", 0, separateNumber(testi,'-',totuus)); \n totuus.set(false); \n testi = new StringBuilder(\"123-asdasd\"); \n assertEquals(\"From: FlairImage line: 139\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 140\", \"asdasd\", testi.toString()); \n assertEquals(\"From: FlairImage line: 141\", true, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"123-asdasd-muumi\"); \n assertEquals(\"From: FlairImage line: 145\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 146\", \"asdasd-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 147\", true, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-asdasd-muumi\"); \n assertEquals(\"From: FlairImage line: 151\", 0, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 152\", \"asd-asdasd-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 153\", false, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-asdasd-123\"); \n assertEquals(\"From: FlairImage line: 157\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 158\", \"asd-asdasd-123\", testi.toString()); \n assertEquals(\"From: FlairImage line: 159\", false, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-123-muumi\"); \n assertEquals(\"From: FlairImage line: 163\", 0, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 164\", \"asd-123-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 165\", false, totuus.get()); \n }", "static int comb(int big, int smal) \n\t{ \n\t\treturn (int) ((long) fact[big] * invfact[smal] % mod \n\t\t\t\t* invfact[big - smal] % mod); \n\t}", "@Test\n public void testCalculateNumberOfDivisors() {\n System.out.println(\"calculateNumberOfDivisors\");\n int value = 10; \n List<Integer> primelist = Arrays.asList(2, 3, 5, 7);\n int expResult = 4; //1, 2, 5, 10\n int result = NumberUtil.calculateNumberOfDivisors(value, primelist);\n assertEquals(expResult, result);\n }", "public static void main(String[] args) {\n int N, Q;\n int a, x, y;\n int lastAnswer = 0;\n\n Scanner sc = new Scanner(System.in);\n N = sc.nextInt();\n Q = sc.nextInt();\n\n ArrayList<ArrayList<Integer>> seqList = new ArrayList<ArrayList<Integer>>(N);\n ArrayList<Integer> seq;\n for (int i = 0; i < N; i++) {\n seq = new ArrayList<Integer>();\n seqList.add(seq);\n }\n for (int i = 0; i < Q; i++) {\n seq = new ArrayList<Integer>();\n a = sc.nextInt();\n x = sc.nextInt();\n y = sc.nextInt();\n\n seq = seqList.get((x ^ lastAnswer) % N);\n if (a == 1) {\n seq.add(y);\n } else if(a == 2) {\n lastAnswer = seq.get(y % seq.size());\n System.out.println(lastAnswer);\n }\n\n }\n }", "public int singleNumber3(int[] nums) {\n Set<Integer> set = new HashSet<>();\n for(int a :nums){\n if(set.contains(a)){\n set.remove(a);\n }else{\n set.add(a);\n }\n }\n Iterator<Integer> i = set.iterator();\n return i.next();\n }", "@Test\n public void testMultiplyAllNumbersWithManyNumbers() {\n assertEquals(Integer.valueOf(120), calculator.multiplyAllNumbers(new Integer[]{1, 2, 3, 4, 5}));\n }", "@Test\n public void test01() {\n EjercicioR755 ejercici1 = new EjercicioR755();\n\n\n ArrayList<Integer> origen = new ArrayList<>(Arrays.asList(5, 8, 2, 1, 9, 7, 4));\n String resultadoEsperado = \"9, 8, 7, 5, 4, 2, 1\";\n assertEquals(resultadoEsperado, ejercici1.devolverEnOrden(origen));\n\n\n origen = new ArrayList<>(Arrays.asList(10, 4, 5, 4, 3, 9, 1));\n resultadoEsperado = \"10, 9, 5, 4, 4, 3, 1\";\n assertEquals(resultadoEsperado, ejercici1.devolverEnOrden(origen));\n\n\n origen = new ArrayList<>(Arrays.asList(6, 4, 5, 4, 3, 9, 10));\n resultadoEsperado = \"10, 9, 6, 5, 4, 4, 3\";\n assertEquals(resultadoEsperado, ejercici1.devolverEnOrden(origen));\n\n\n origen = new ArrayList<>();\n resultadoEsperado = \"\";\n assertEquals(resultadoEsperado, ejercici1.devolverEnOrden(origen));\n }", "private ARXOrderedString(String[] format){\r\n if (format.length == 0) {\r\n this.order = null;\r\n } else {\r\n this.order = new HashMap<String, Integer>(); \r\n for (int i=0; i< format.length; i++){\r\n if (this.order.put(format[i], i) != null) {\r\n throw new IllegalArgumentException(\"Duplicate value '\"+format[i]+\"'\");\r\n }\r\n }\r\n }\r\n }", "default int getOrder() {\n\treturn 0;\n }", "@Override\r\n\tpublic int multi(int x, int y) {\n\t\treturn x * y;\r\n\t}", "@Test\n void Adventure_ShouldReuseOrderOfRemovedStoryPiecesAndIncrementTheOrderOnlyIfThereAreNoSpareOrdersLeft() {\n for (int i=0; i<5; i++) {\n StoryPiece sp = new StoryPiece();\n defaultAdventure.addStoryPiece(sp);\n }\n\n // Removing StoryPieces with orders 3 and 5\n defaultAdventure.removeStoryPiece(defaultAdventure.getStoryPieces().get(2));\n defaultAdventure.removeStoryPiece(defaultAdventure.getStoryPieces().get(3));\n\n // Adventure should reuse the unassigned orders before incrementing the order\n StoryPiece spWithOrder3 = new StoryPiece();\n StoryPiece spWithOrder5 = new StoryPiece();\n\n defaultAdventure.addStoryPiece(spWithOrder3);\n defaultAdventure.addStoryPiece(spWithOrder5);\n\n // At this point all orders 1-6 should be assigned, so we expect this to have order 7\n StoryPiece newSP = new StoryPiece();\n defaultAdventure.addStoryPiece(newSP);\n\n assertEquals(3, spWithOrder3.getOrder(),\n \"Order not reused - StoryPiece should have order 3\");\n assertEquals(5, spWithOrder5.getOrder(),\n \"Order not reused, StoryPiece should have order 5\");\n assertEquals(7, newSP.getOrder(),\n \"StoryPiece should have been assigned a new incremented order 7.\");\n\n }", "public String multiply(String num1, String num2) {\n int[] n1 = new int[num1.length()];\r\n for(int i = 0; i < num1.length(); i++) {\r\n \tn1[i] = num1.charAt(i) - '0';\r\n }\r\n int[] n2 = new int[num2.length()];\r\n for(int i = 0; i < num2.length(); i++) {\r\n \tn2[i] = num2.charAt(i) - '0';\r\n }\r\n //the result\r\n int[] result = new int[num1.length() + num2.length()];\r\n \r\n //multiple two large numbers\r\n for(int i = n2.length - 1; i >=0; i--) {\r\n \t//the starting point in the result array\r\n \tint v2 = n2[i];\r\n \tint startPoint = result.length - 1 - (n2.length - 1 - i);\r\n \tint carrier = 0;\r\n \tfor(int j = n1.length - 1; j >= 0; j--) {\r\n \t\tint index = startPoint - (n1.length - 1 - j);\r\n \t\tint v1 = n1[j];\r\n \t\t\r\n// \t\tSystem.out.println(\"i: \" + i + \": \" + v2 + \", j: \" + j + \": \" + v1 + \", carrier: \" + carrier);\r\n \t\t\r\n \t\tint finalValue = v1*v2 + carrier + result[index];\r\n \t\tcarrier = finalValue/10;\r\n \t\tresult[index] = finalValue % 10;\r\n \t\t//update the last\r\n \t\tif(j == 0) {\r\n \t\t\tif(carrier > 0) {\r\n \t\t\t\tresult[index - 1] = carrier; //XXX note, need to write to the array cell\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n// \tthis.printArray(result);\r\n }\r\n \r\n //convert to the result\r\n StringBuilder sb = new StringBuilder();\r\n boolean zero = true;\r\n for(int i : result) {\r\n \tif(i != 0 && zero) {\r\n \t\tzero = false;\r\n \t}\r\n \tif(!zero) {\r\n \t sb.append(i);\r\n \t}\r\n }\r\n if(sb.length() == 0) {\r\n \tsb.append(\"0\"); //all ZERO\r\n }\r\n return sb.toString();\r\n }", "private BigInteger[] factor(BigInteger i) {\n return null;\r\n }", "public int getOrder();", "protected ArrayList<ArrayList<String>> method1() {\n\n ArrayList<ArrayList<String>> arr = new ArrayList<ArrayList<String>>();\n ArrayList<String> n_clone = new ArrayList<>(Arrays.asList(input));\n\n // Create equal amount of containers as requested.\n for (int i=0;i<num;i++) {\n arr.add(new ArrayList<String>());\n }\n\n // Iterate through given Array while putting items\n // into the containers you just created.\n Iterator itor = n_clone.iterator();\n int count = 0;\n while (itor.hasNext()) {\n if (count < this.num) {\n arr.get(count).add((String)itor.next());\n count++;\n } else {\n count = 0;\n }\n }\n\n System.out.println(\"Paying no attention to order, the Array - \");\n printArrayList(new ArrayList<>(Arrays.asList(input)));\n System.out.println(\"divided into \" + this.num + \" sections is: \\n\");\n printMatrix(arr);\n\n return arr;\n }", "@Test\n public void forEachTest() {\n Object[] resultActual = new Object[] {this.work1, this.work2, this.work3, this.work4};\n Object[] resultExpected = new Object[4];\n int index = 0;\n for (String work : this.queue) {\n resultExpected[index++] = work;\n }\n assertThat(resultActual, is(resultExpected));\n }", "static void findGroups() {\n G2 = 0;\n while (group2()) {\n }\n\n // find group of size 3\n G3 = 0;\n while (group3()) {\n }\n }", "@Test\n public void StuckInLine() {\n\n int[] line = {2,5,3,4,5};\n int position = 2;\n Assert.assertEquals(12,Computation.getNeededTickets(line,position));\n\n int[] line2 = {5,5,2,3};\n position = 3;\n Assert.assertEquals(11,Computation.getNeededTickets(line2,position));\n\n int[] line3 = {1,1,1,1};\n position = 0;\n Assert.assertEquals(1,Computation.getNeededTickets(line3,position));\n\n\n }", "public static void main(String[] args){\n\n ArrayList<String> test = new ArrayList<>();\n test.add(\"T\");\n test.add(\"L\");\n\n ArrayList<String> test2 = new ArrayList<>();\n test2.add(\"P\");\n\n PFD pfd1 = new PFD(test,test2,1);\n\n ArrayList<String> test3 = new ArrayList<>();\n test3.add(\"T\");\n test3.add(\"L\");\n\n ArrayList<String> test4 = new ArrayList<>();\n test4.add(\"M\");\n\n PFD pfd2 = new PFD(test3,test4,1);\n\n ArrayList<String> test5 = new ArrayList<>();\n test5.add(\"P\");\n ArrayList<String> test6 = new ArrayList<>();\n test6.add(\"M\");\n\n ArrayList<String> test7 = new ArrayList<>();\n test7.add(\"T\");\n ArrayList<String> test8 = new ArrayList<>();\n test8.add(\"S\");\n\n PFD pfd3 = new PFD(test5,test6,3);\n PFD pfd4 = new PFD(test7,test8,3);\n ArrayList<PFD> test2List = new ArrayList<PFD>(Arrays.asList(pfd1, pfd2));\n ArrayList<String> r = new ArrayList<String>(Arrays.asList(\"M\", \"S\", \"T\", \"P\"));\n// System.out.println(test2List);\n// System.out.println(\"Closure: \" + getClosureForAttr(new ArrayList<String>(Arrays.asList(\"T\",\"M\")),test2List,1));\n// System.out.println(\"BDNF? \"+ isSatisfiedBDFN(test2List,3));\n// System.out.println(getCanCover1(test2List));\n// S = DecomposeWithTheCertainty(r,test2List,4);\n// System.out.println(turnDeOutputToString());\n// System.out.println(getAllComb(r, new ArrayList<ArrayList<String>>()));\n\n// System.out.println(getMinimalKeys(test2List,r,4));\n\n// System.out.println(\"B-prime: \"+getBetaPrimeList(test2List,r,2));\n// System.out.println(\"Satisfied 3NF? \"+isSatisfied3NF(test2List,r,3));\n// System.out.println(\"Is not subset:\"+isNotSubset(pfd4,test2List));\n ArrayList<String> t = new ArrayList<>();\n t.add(\"A\");\n t.add(\"B\");\n t.add(\"C\");\n ArrayList<String> t1 = new ArrayList<>();\n t1.add(\"B\");\n t1.add(\"A\");\n// t1.add(\"D\");\n t.retainAll(t1);\n// System.out.println(t.toString());\n// System.out.println(String.join(\"\",t1));\n//\n// System.out.println(getAllCombo(r).toString());\n double x = 2 / 3.0;\n System.out.println(x);\n\n}", "void test1(IAllOne obj) {\n assertEquals(\"\", obj.getMaxKey());\n assertEquals(\"\", obj.getMinKey());\n obj.inc(\"a\");\n assertEquals(\"a\", obj.getMaxKey());\n assertEquals(\"a\", obj.getMinKey());\n obj.inc(\"a\");\n obj.inc(\"b\");\n obj.inc(\"b\");\n obj.inc(\"b\");\n obj.inc(\"c\");\n assertEquals(\"b\", obj.getMaxKey());\n assertEquals(\"c\", obj.getMinKey());\n obj.dec(\"b\");\n obj.inc(\"a\");\n assertEquals(\"a\", obj.getMaxKey());\n assertEquals(\"c\", obj.getMinKey());\n obj.inc(\"c\");\n obj.dec(\"b\");\n assertEquals(\"b\", obj.getMinKey());\n obj.dec(\"b\");\n assertEquals(\"c\", obj.getMinKey());\n }", "public static void main(String[] args) {\n List<Integer> li = new ArrayList<>();\n li.add(4);\n li.add(4);\n li.add(2);\n li.add(2);\n li.add(2);\n li.add(2);\n li.add(3);\n li.add(3);\n li.add(1);\n li.add(1);\n li.add(6);\n li.add(7);\n li.add(5);\n li.add(5);\n li.add(3);\n li.add(1);\n li.add(2);\n li.add(2);\n li.add(4);\n\n List<Integer> li1 = new ArrayList<>();\n li1.add(5);\n li1.add(1);\n li1.add(2);\n li1.add(3);\n li1.add(4);\n li1.add(1);\n System.out.println(li1);\n int[] array = { 4, 4, 2, 2, 2, 2, 3, 3, 1, 1, 6, 7, 5 };\n\n customSort(li1);\n//\n// missingWords(\"I am using hackerrank to improve programming\",\"am hackerrank to improve\");\n//\n// System.out.println(fourthBit(32));\n////nums\n// System.out.println(kSub(3,li1));\n\n Float f = 0.1F;\n\n System.out.println(f);;\n\n System.out.println(new BigDecimal(f.toString()));\n\n System.out.println(twoSum(new int[]{2,7,1,4}, 9));\n }", "private Expr mult(Expr x) throws Err {\n if (x instanceof ExprUnary) {\n ExprUnary y=(ExprUnary)x;\n if (y.op==ExprUnary.Op.SOME) return ExprUnary.Op.SOMEOF.make(y.pos, y.sub);\n if (y.op==ExprUnary.Op.LONE) return ExprUnary.Op.LONEOF.make(y.pos, y.sub);\n if (y.op==ExprUnary.Op.ONE) return ExprUnary.Op.ONEOF.make(y.pos, y.sub);\n }\n return x;\n }", "private void findUniqueInBoxes() {\n findUniqueInBox(1,3,1,3);\n findUniqueInBox(1,3,4,6);\n findUniqueInBox(1,3,7,9);\n findUniqueInBox(4,6,1,3);\n findUniqueInBox(4,6,4,6);\n findUniqueInBox(4,6,7,9);\n findUniqueInBox(7,9,1,3);\n findUniqueInBox(7,9,4,6);\n findUniqueInBox(7,9,7,9);\n\n }", "@Test\n public void hailStoneOne(){\n List<Integer> expected = new ArrayList<>();\n expected.add(1);\n assertThat(ComputeStuff.hailstoneSequence(1),is(expected));\n }", "public Set<E> getNextSet()\r\n/* */ {\r\n/* 155 */ List<E> result = getNextArray();\r\n/* 156 */ if (result == null) {\r\n/* 157 */ return null;\r\n/* */ }\r\n/* */ \r\n/* 160 */ Set<E> resultSet = new LinkedHashSet(result);\r\n/* 161 */ return resultSet;\r\n/* */ }", "public void testSUBORDINARY_MULTIPLE2() throws Exception {\n\t\tObject retval = execLexer(\"SUBORDINARY_MULTIPLE\", 48, \"bendlets\", false);\n\t\tObject actual = examineExecResult(org.antlr.gunit.gUnitParser.OK, retval);\n\t\tObject expecting = \"OK\";\n\n\t\tassertEquals(\"testing rule \"+\"SUBORDINARY_MULTIPLE\", expecting, actual);\n\t}", "@Test\r\n public void repeatedValuesTest() {\r\n int[] unsorted = new int[]{1,33,1,0,33,-23,1,-23,1,0,-23};\r\n int[] expResult = new int[]{-23,-23,-23,0,0,1,1,1,1,33,33};\r\n int[] result = arraySorter.sort(unsorted);\r\n assertArrayEquals(expResult, result);\r\n }" ]
[ "0.5398442", "0.5375469", "0.5326775", "0.52726614", "0.5258083", "0.524847", "0.51515526", "0.5150981", "0.5134023", "0.51001877", "0.5097347", "0.5079206", "0.5021934", "0.50212884", "0.5016537", "0.4993866", "0.4983248", "0.49808756", "0.4967377", "0.49556085", "0.49520174", "0.4943662", "0.49396506", "0.49383926", "0.4919586", "0.49111927", "0.49002865", "0.48871112", "0.48796868", "0.48751643", "0.48695517", "0.48675507", "0.48561472", "0.48538184", "0.4850788", "0.48491427", "0.48415682", "0.48192036", "0.4804787", "0.4797835", "0.47937748", "0.47934562", "0.47882667", "0.4775216", "0.4774935", "0.4774054", "0.47710913", "0.47626173", "0.47615853", "0.47601593", "0.47588152", "0.47459513", "0.4731091", "0.4729481", "0.4727049", "0.47269472", "0.4723717", "0.47216198", "0.47214594", "0.4718092", "0.47082302", "0.47046846", "0.46945998", "0.46944025", "0.4692162", "0.46901253", "0.46892455", "0.46875063", "0.46860373", "0.46822384", "0.46819565", "0.46784383", "0.46771446", "0.4675842", "0.4674466", "0.466441", "0.4662952", "0.46571612", "0.46571475", "0.46539244", "0.4650939", "0.46469513", "0.46464354", "0.46443152", "0.46413782", "0.46410304", "0.46409813", "0.4639334", "0.46386448", "0.46373105", "0.46363625", "0.46316886", "0.46283245", "0.46282068", "0.46279442", "0.4627877", "0.46266735", "0.4625593", "0.4623374", "0.46202296", "0.46170995" ]
0.0
-1
TODO Autogenerated method stub
@Override public void ButtonCallback(int ID, Vec2f p) { if (screenFade.active() == false && clock <= 0) { switch (ID) { case 1: side = !side; if (side == true) { encyclopediaPanel.genList(); } clock += 0.2F; break; case 2: callback.Callback(); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub 0 is font 1 is frame 2 button 3 is button alt 4 tint
@Override public void initialize(int[] textures, Callback callback) { subWindow = new Window(new Vec2f(-20, -16), new Vec2f(5, 5), textures[1], true); Button[] buttons = new Button[2]; buttons[0] = new Button(new Vec2f(0.5F, 0.5F), new Vec2f(4, 1.8F), textures[2], this, "Exit", 2, 1); buttons[1] = new Button(new Vec2f(0.5F, 2.5F), new Vec2f(4, 1.8F), textures[2], this, "flip", 1, 1); // add buttons to move things to and from the container for (int i = 0; i < 2; i++) { subWindow.add(buttons[i]); } this.callback = callback; screenFade = new Screen_Fade(this); researchPanel = new ComputerResearch(textures, this); encyclopediaPanel = new ComputerPedia(textures, this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setupButtons()\n\t{\n\t\tequals.setText(\"=\");\n\t\tequals.setBackground(Color.RED);\n\t\tequals.setForeground(Color.WHITE);\n\t\tequals.setOpaque(true);\n\t\tequals.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 50));\n\t\tequals.setBorder(new CompoundBorder(new LineBorder(Color.LIGHT_GRAY, 5), new LineBorder(Color.BLACK, 3)));\n\t\tclear.setText(\"C\");\n\t\tclear.setBackground(new Color(0, 170, 100));\n\t\tclear.setForeground(Color.WHITE);\n\t\tclear.setOpaque(true);\n\t\tclear.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 50));\n\t\tclear.setBorder(new CompoundBorder(new LineBorder(Color.LIGHT_GRAY, 5), new LineBorder(Color.BLACK, 3)));\n\t\tbackspace.setText(\"<--\");\n\t\tbackspace.setBackground(new Color(0, 170, 100));\n\t\tbackspace.setForeground(Color.WHITE);\n\t\tbackspace.setOpaque(true);\n\t\tbackspace.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 35));\n\t\tbackspace.setBorder(new CompoundBorder(new LineBorder(Color.LIGHT_GRAY, 5), new LineBorder(Color.BLACK, 3)));\n\t\tnegative.setText(\"+/-\");\n\t\tnegative.setBackground(Color.GRAY);\n\t\tnegative.setForeground(Color.WHITE);\n\t\tnegative.setOpaque(true);\n\t\tnegative.setFont(new Font(\"Lucida Grande\", Font.PLAIN, 35));\n\t\tnegative.setBorder(new CompoundBorder(new LineBorder(Color.LIGHT_GRAY, 5), new LineBorder(Color.BLACK, 3)));\n\t}", "public void applyButtonStyles(JButton button, String type){\n button.setBackground(coloursObject.getTitlePanelColour());//set background colour\n button.setForeground(coloursObject.getButtonTextColour());//set foreground colour\n button.setFont(new java.awt.Font(\"Microsoft Tai Le\", 0, 16));//set font and size\n button.setBorder(null);//remove the border//remove any border\n button.setFocusPainted(false);//make not focusable (custom hover effect overides this)\n button.setPreferredSize(new Dimension(50,25));//set preferred dimensions for the close application button\n \n button.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {//when hovering over mouse\n button.setForeground(coloursObject.getButtonTextHoverColour());//the colour of the text when hovered over\n if(type == \"close\"){//if the close button is being edited\n button.setBackground(new Color(237,64,64));//colour chosen for the \n }\n if(type == \"scale\"){//if the fullscreen button is being edited\n button.setBackground(coloursObject.getMenuPanelColour());\n }\n }\n\n public void mouseExited(java.awt.event.MouseEvent evt) {//when cursor stops hovering over the mouse\n button.setForeground(coloursObject.getButtonTextColour());//the colour of the text when the cursor is removed\n button.setBackground(coloursObject.getTitlePanelColour());\n }\n });\n }", "public void createButtons() {\n\t\tescapeBackground = new GRect(200, 150, 300, 400);\n\t\tescapeBackground.setFilled(true);\n\t\tescapeBackground.setColor(Color.gray);\n\n\t\tbutton1 = new GButton(\"Return to Game\", 250, 175, 200, 50, Color.cyan);\n\t\tbutton3 = new GButton(\"Exit Level\", 250, 330, 200, 50, Color.cyan);\n\t\tbutton4 = new GButton(\"Return to Menu\", 250, 475, 200, 50, Color.cyan);\n\n\t\tescapeButtons.add(button1);\n\t\tescapeButtons.add(button3);\n\t\tescapeButtons.add(button4);\n\n\t}", "public Button(){\n id=1+nbrButton++;\n setBounds(((id-1)*getDimX())/(Data.getNbrLevelAviable()+1),((id-1)*getDimY())/(Data.getNbrLevelAviable()+1),getDimX()/(2*Data.getNbrLevelAviable()),getDimY()/(2*Data.getNbrLevelAviable()));\n setText(id+\"\");\n setFont(Data.getFont());\n addMouseListener(this);\n setVisible(true);\n }", "private void settingNormalButton(Button button1, Button button2, Button button3) {\n button1.setBackgroundResource(R.drawable.my_btn_bg);\n button1.setTextColor(getResources().getColor(R.color.test_dark_blue));\n button2.setBackgroundResource(R.drawable.my_btn_bg);\n button2.setTextColor(getResources().getColor(R.color.test_dark_blue));\n button3.setBackgroundResource(R.drawable.my_btn_bg);\n button3.setTextColor(getResources().getColor(R.color.test_dark_blue));\n }", "protected void drawButtons() {\n\t\tint spaceX = 50;\n\t\tint spaceY = 500;\t\n\t\t\n\t\tint aux = 1;\n\t\tfor(int i = 65; i < 91; i++) {\n\n\t\t\tLetterButton button = new LetterButton((char) i, (25 + spaceX ) * aux, spaceY);\n\t\t\taux++;\n\t\t\tif(aux == 14) {\n\t\t\t\tspaceY += 25 + 50;\n\t\t\t\taux = 1;\n\t\t\t}\n\t\t\tthis.add(button);\n\t\t}\n\t\t\n\t}", "protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect){\n }", "public static void setButton(String nameOfButton,int x,int y,int width,int heigth, JFrame frame) {\r\n //tozi metod suzdava butonut s negovite parametri - ime,koordinati,razmeri,frame\r\n\t JButton Button = new JButton(nameOfButton);\r\n\t Button.setBounds(x, y, width, heigth);\r\n\t colorOfButton(153,204,255,Button); //izpolzvam metodite ot po-gore\r\n\t colorOfTextInButton(60,0,150,Button);\r\n\t frame.getContentPane().add(Button);\r\n Button.addActionListener(new ActionListener(){ \r\n \tpublic void actionPerformed(ActionEvent e){ \r\n\t frame.setVisible(false);\r\n\t if(nameOfButton == \"Action\") { //kogato imeto na butona suvpada sus Stringa \"Action\",to tova e nashiqt janr\r\n\t \t Genre action = new Genre(\"Action\", //chrez klasa Genre zadavam vseki buton kakuv nov prozorec shte otvori\r\n\t \t\t\t \"Black Panther (2018)\", //kakvi filmi shte sudurja vseki janr \r\n\t \t\t\t \"Avengers: Endgame (2019)\",\r\n\t \t\t\t \" Mission: Impossible - Fallout (2018)\",\r\n\t \t\t\t \"Mad Max: Fury Road (2015)\",\r\n\t \t\t\t \"Spider-Man: Into the Spider-Verse (2018)\", \"MoviesWindow.png\" //kakvo fonovo izobrajenie shte ima\r\n);\r\n\t\t \t\r\n\t\t \taction.displayWindow(); \r\n//chrez metoda showWindow(); ,koito vseki obekt ot klasa Genre ima, otvarqme sledvashtiq(posleden) prozorec\r\n\t\t \t\r\n\t\t \t\r\n\t }else if (nameOfButton == \"Comedy\") { //i taka za vsichki filmovi janri\r\n\t \t Genre comedy = new Genre(\"Comedy\",\r\n\t \t\t\t \"The General (1926)\",\r\n\t \t\t\t \"It Happened One Night (1934)\",\r\n\t \t\t\t \"Bridesmaids (2011)\",\r\n\t \t\t\t \"Eighth Grade (2018)\",\r\n\t \t\t\t \"We're the Millers (2013)\",\"MoviesWindow.png\");\r\n\t\t \t\r\n\t\t \tcomedy.displayWindow();\r\n\t }else if (nameOfButton == \"Drama\") {\r\n\t \t Genre drama2 = new Genre(\"Drama\",\r\n\t \t\t\t \"Parasite (Gisaengchung) (2019)\",\r\n\t\t \t\t\t \" Moonlight (2016)\",\r\n\t\t \t\t\t \" A Star Is Born (2018)\",\r\n\t\t \t\t\t \" The Shape of Water (2017)\",\r\n\t\t \t\t\t \" Marriage Story (2019)\",\"MoviesWindow.png\");\r\n\t\t \t\r\n\t\t \tdrama2.displayWindow();\r\n\t }else if (nameOfButton == \"Fantasy\") {\r\n\t \t Genre fantasy2 = new Genre(\"Fantasy\",\r\n\t \t\t\t \"The Lord of the Rings Trilogy\",\r\n\t \t\t\t \"Metropolis (2016)\",\r\n\t \t\t\t \"Gravity (2013)\",\r\n\t \t\t\t \" Pan's Labyrinth (2006)\",\r\n\t \t\t\t \"The Shape of Water (2017)\",\"MoviesWindow.png\");\r\n\t\t \t\r\n\t\t \tfantasy2.displayWindow();\r\n\t }else if (nameOfButton == \"Horror\") {\r\n\t \t Genre horror = new Genre(\"Horror\",\r\n\t \t\t\t \" Host (2020)\",\r\n\t \t\t\t \" Saw (2004)\",\r\n\t \t\t\t \" The Birds (1963)\",\r\n\t \t\t\t \" Dawn of the Dead (1978)\",\r\n\t \t\t\t \" Shaun of the Dead (2004)\",\"MoviesWindow.png\");\r\n\t\t \t\r\n\t\t \thorror.displayWindow();\r\n\t }else if (nameOfButton == \"Romance\") {\r\n\t \tGenre romance2 = new Genre(\"Romance\",\r\n\t \t\t\t\"Titanic (1997)\",\r\n\t \t\t\t\"La La Land(2016)\",\r\n\t \t\t\t\"The Vow (2012)\",\r\n\t \t\t\t\"The Notebook (2004)\",\r\n\t \t\t\t\"Carol (2015)\",\"MoviesWindow.png\");\r\n\t \t\r\n\t \tromance2.displayWindow();\r\n\t \t\r\n\t \t\r\n\t \t\r\n\t }else if (nameOfButton == \"Mystery\") {\r\n\t \t Genre mystery = new Genre(\"Mystery\",\r\n\t \t\t\t \" Knives Out (2019)\",\r\n\t \t\t\t \" The Girl With the Dragon Tattoo (2011)\",\r\n\t \t\t\t \" Before I Go to Sleep (2014)\",\r\n\t \t\t\t \" Kiss the Girls (1997)\",\r\n\t \t\t\t \" The Girl on the Train (2016)\",\"MoviesWindow.png\"\r\n\t \t\t\t );\r\n\t\t \t\r\n\t\t \tmystery.displayWindow();\r\n\t }\r\n\r\n \t}\r\n });\r\n\t}", "private ImageTextButton createImageTextButton(TextureRegionDrawable drawable, BitmapFont font, int number){ ;\r\n\t\tImageTextButton.ImageTextButtonStyle btnStyle1 = new ImageTextButton.ImageTextButtonStyle();\r\n\t\tbtnStyle1.up = drawable;\r\n\t\tbtnStyle1.font = font;\r\n\t\tImageTextButton btn = new ImageTextButton(\"\"+number, btnStyle1);\r\n\t\treturn btn;\r\n\t}", "public void drawButtons() {\n\t\tfill(color(221, 221, 221));\n\t\tfor (int i = 0; i < NUM_BUTTONS; i++) {\n\t\t\trect(BUTTON_LEFT_OFFSET + i * (BUTTON_WIDTH + 12), BUTTON_TOP_OFFSET, BUTTON_WIDTH, BUTTON_HEIGHT);\n\t\t}\n\n\t\t// set text color on the buttons to blue\n\t\tfill(color(0, 0, 255));\n\n\t\ttext(\"Add Cards\", BUTTON_LEFT_OFFSET + 18, BUTTON_TOP_OFFSET + 22);\n\t\ttext(\" Find Set\", BUTTON_LEFT_OFFSET + 18 + BUTTON_WIDTH + 12, BUTTON_TOP_OFFSET + 22);\n\t\ttext(\"New Game\", BUTTON_LEFT_OFFSET + 18 + 2 * (BUTTON_WIDTH + 12), BUTTON_TOP_OFFSET + 22);\n\t\tif (state == State.PAUSED) {\n\t\t\ttext(\"Resume\", BUTTON_LEFT_OFFSET + 45 + 3 * (BUTTON_WIDTH + 12), BUTTON_TOP_OFFSET + 22);\n\t\t} else {\n\t\t\ttext(\"Pause\", BUTTON_LEFT_OFFSET + 54 + 3 * (BUTTON_WIDTH + 12), BUTTON_TOP_OFFSET + 22);\n\t\t}\n\t}", "public void paint(Graphics g) { //paints the LWButton\n\n\t\t//If LWButton has the focus, display the text in\n\t\t// bold italics. Otherwise display plain.\n\t\tif (gotFocus)\n\t\t\tg.setFont(new Font(getFont().getName(), Font.BOLD | Font.ITALIC, getFont().getSize()));\n\t\telse\n\t\t\tg.setFont(new Font(getFont().getName(), Font.PLAIN, getFont().getSize()));\n\n\t\tif (pressed) { //if the pressed flag is true\n\t\t\tg.setColor(getBackground());\n\t\t\tg.fillRect( //fill rectangle with background color\n\t\t\t0, 0, this.getSize().width, this.getSize().height);\n\n\t\t\t//Draw shadows three shades darker than background\n\t\t\tg.setColor(getBackground().darker().darker().darker());\n\n\t\t\t//Note that three offset rectangles are drawn to\n\t\t\t// produce a shadow effect on the left and top of\n\t\t\t// the rectangle. \n\t\t\tg.drawRect( //\n\t\t\t0, 0, this.getSize().width, this.getSize().height);\n\t\t\tg.drawRect(1, 1, this.getSize().width, this.getSize().height);\n\t\t\tg.drawRect(2, 2, this.getSize().width, this.getSize().height);\n\n\t\t\t//Now draw a faint outline on the bottom and right of\n\t\t\t// the rectangle.\n\t\t\tg.setColor(getBackground().darker());\n\t\t\tg.drawRect(-1, -1, this.getSize().width, this.getSize().height);\n\n\t\t\t//Now center the text in the LWButton object\n\t\t\tFontMetrics fm = getFontMetrics(getFont());\n\t\t\tg.setColor(getForeground());\n\t\t\tg.drawString(label, (getSize().width / 2) - (fm.stringWidth(label) / 2),\n\t\t\t (getSize().height / 2) + (fm.getAscent() / 2));\n\t\t} //end if(pressed)\n\n\t\telse { //not pressed\n\t\t\t//Make the protruding LWButton object one shade\n\t\t\t// brighter than the background.\n\t\t\tg.setColor(getBackground().brighter());\n\t\t\tg.fillRect( //and fill a rectangle\n\t\t\t0, 0, this.getSize().width, this.getSize().height);\n\n\t\t\t//Set the color for the shadows three shades darker\n\t\t\t// than the background.\n\t\t\tg.setColor(getBackground().darker().darker().darker());\n\n\t\t\t//Draw two offset rectangles to create shadows on \n\t\t\t// the right and bottom. \n\t\t\tg.drawRect(-1, -1, this.getSize().width, this.getSize().height);\n\t\t\tg.drawRect(-2, -2, this.getSize().width, this.getSize().height);\n\n\t\t\t//Highlight the left and top two shades brighter \n\t\t\t// than the background, one shade brighter than the\n\t\t\t// color of the LWButton itself which is one shade\n\t\t\t// brighter than the background.\n\t\t\tg.setColor(getBackground().brighter().brighter());\n\t\t\tg.drawRect( //\n\t\t\t0, 0, this.getSize().width, this.getSize().height);\n\n\t\t\t//Now place the text in the LWButton object shifted\n\t\t\t// by two pixels up and to the left. \n\t\t\tFontMetrics fm = getFontMetrics(getFont());\n\t\t\tg.setColor(getForeground());\n\t\t\tg.drawString(label, (getSize().width / 2) - (fm.stringWidth(label) / 2) - 2,\n\t\t\t ((getSize().height / 2) + (fm.getAscent() / 2)) - 2);\n\t\t} //end else\n\t}", "@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}", "private void beautifyButtons() {\n ImageIcon todayIcon = new ImageIcon(getClass().getResource(\"/images/today.png\"));\n today.setIcon(todayIcon);\n today.setFont(new Font(Font.DIALOG, Font.PLAIN, 12));\n today.setMaximumSize(mediumButton);\n today.setIconTextGap(ICON_GAP);\n today.setAlignmentX(CENTER_ALIGNMENT);\n\n //adding icon and attempting to beautify the \"<\" button\n ImageIcon leftIcon = new ImageIcon(getClass().getResource(\"/images/left.png\"));\n left.setIcon(leftIcon);\n left.setFont(new Font(Font.DIALOG, Font.PLAIN, 14));\n left.setMaximumSize(smallButton);\n\n //adding icon and attempting to beautify the \">\" button\n ImageIcon rightIcon = new ImageIcon(getClass().getResource(\"/images/right.png\"));\n right.setIcon(rightIcon);\n right.setFont(new Font(Font.DIALOG, Font.PLAIN, 14));\n right.setMaximumSize(smallButton);\n\n //adding icon and attempting to beautify the new event button\n ImageIcon newIcon = new ImageIcon(getClass().getResource(\"/images/new.jpg\"));\n newEvent.setIcon(newIcon);\n newEvent.setFont(new Font(Font.DIALOG, Font.PLAIN, 12));\n newEvent.setMaximumSize(mediumButton);\n newEvent.setIconTextGap(ICON_GAP);\n newEvent.setAlignmentX(CENTER_ALIGNMENT);\n }", "private void setPressedStyle() {\n this.setStyle(BUTTON_PRESSED);\n this.setPrefHeight(43);\n this.setLayoutY(getLayoutY() + 4);\n }", "public void makeGUI()\r\n {\n\t\t\tContainer jfrm;\r\n\t\t\tjfrm = getContentPane();\r\n jfrm.setLayout( new GridLayout( 200, 20 ) );\r\n jfrm.setLayout(null);\r\n jfrm.setBackground(new Color(144, 238, 144));\r\n //jfrm.setFont(f);\r\n //jfrm.setLayout(null);\r\n //jfrm.setSize(1250,500);\r\n //jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n \r\n txt = new JTextField(70);\r\n txt.setBounds(100,40,960,40);\r\n jfrm.add(txt);\r\n txt.setText(\"\");\t\t\r\n txt.setFont(f);\r\n int x = 100,y = 100,x1 = 60,y1 = 40,i=0;\r\n \r\n JButton btna = new JButton(\"\\u0C85\");\r\n btna.setBounds(x+x1*i++,y,x1,y1);\r\n btna.setFont(f);\r\n btna.addActionListener(this);\r\n JButton btnaa = new JButton(\"\\u0C86\");\r\n btnaa.setBounds(x+x1*i++,y,x1,y1);\r\n btnaa.setFont(f);\r\n btnaa.addActionListener(this);\r\n JButton btni = new JButton(\"\\u0C87\");\r\n btni.setBounds(x+x1*i++,y,x1,y1);\r\n btni.setFont(f);\r\n btni.addActionListener(this);\r\n JButton btnii = new JButton(\"\\u0C88\");\r\n btnii.setBounds(x+x1*i++,y,x1,y1);\r\n btnii.setFont(f);\r\n btnii.addActionListener(this);\r\n JButton btnu = new JButton(\"\\u0C89\");\r\n btnu.setBounds(x+x1*i++,y,x1,y1);\r\n btnu.addActionListener(this);\r\n btnu.setFont(f);\r\n JButton btnuu = new JButton(\"\\u0C8A\");\r\n btnuu.setBounds(x+x1*i++,y,x1,y1);\r\n btnuu.addActionListener(this);\r\n btnuu.setFont(f);\r\n JButton btnr = new JButton(\"\\u0C8B\");\r\n btnr.setBounds(x+x1*i++,y,x1,y1);\r\n btnr.setFont(f);\r\n btnr.addActionListener(this);\r\n JButton btnrr = new JButton(\"\\u0CE0\");\r\n btnrr.setBounds(x+x1*i++,y,x1,y1);\r\n btnrr.setFont(f);\r\n btnrr.addActionListener(this);\r\n JButton btne = new JButton(\"\\u0C8E\");\r\n btne.setBounds(x+x1*i++,y,x1,y1);\r\n btne.addActionListener(this);\r\n btne.setFont(f);\r\n JButton btnee = new JButton(\"\\u0C8F\");\r\n btnee.setBounds(x+x1*i++,y,x1,y1);\r\n btnee.setFont(f);\r\n btnee.addActionListener(this);\r\n JButton btnai = new JButton(\"\\u0C90\");\r\n btnai.setBounds(x+x1*i++,y,x1,y1);\r\n btnai.setFont(f);\r\n btnai.addActionListener(this);\r\n JButton btno = new JButton(\"\\u0C92\");\r\n btno.setBounds(x+x1*i++,y,x1,y1);\r\n btno.setFont(f);\r\n btno.addActionListener(this);\r\n JButton btnoo = new JButton(\"\\u0C93\");\r\n btnoo.setBounds(x+x1*i++,y,x1,y1);\r\n btnoo.setFont(f);\r\n btnoo.addActionListener(this);\r\n JButton btnou = new JButton(\"\\u0C94\");\r\n btnou.setBounds(x+x1*i++,y,x1,y1);\r\n btnou.setFont(f);\r\n btnou.addActionListener(this);\r\n JButton btnam = new JButton(\"\\u0C85\\u0C82\");\r\n btnam.setBounds((x+x1*i++),y,x1+5,y1);\r\n btnam.setFont(f);\r\n btnam.addActionListener(this);\r\n JButton btnaha = new JButton(\"\\u0C85\\u0C83\");\r\n btnaha.setBounds(x+x1*i++,y,x1,y1);\r\n btnaha.setFont(f);\r\n btnaha.addActionListener(this);\r\n \r\n x = 400;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btnka = new JButton(\"\\u0C95\");\r\n btnka.setBounds(x+x1*i++,y,x1,y1);\r\n btnka.setFont(f);\r\n btnka.addActionListener(this);\r\n JButton btnkha = new JButton(\"\\u0C96\");\r\n btnkha.setBounds(x+x1*i++,y,x1,y1);\r\n btnkha.setFont(f);\r\n btnkha.addActionListener(this);\r\n JButton btnga = new JButton(\"\\u0C97\");\r\n btnga.setBounds(x+x1*i++,y,x1,y1);\r\n btnga.setFont(f);\r\n btnga.addActionListener(this);\r\n JButton btngha = new JButton(\"\\u0C98\");\r\n btngha.setBounds(x+x1*i++,y,x1,y1);\r\n btngha.setFont(f);\r\n btngha.addActionListener(this);\r\n JButton btnnga = new JButton(\"\\u0C99\");\r\n btnnga.setBounds(x+x1*i++,y,x1,y1);\r\n btnnga.setFont(f);\r\n btnnga.addActionListener(this);\r\n \r\n x = 400;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btnca = new JButton(\"\\u0C9A\");\r\n btnca.setBounds(x+x1*i++,y,x1,y1);\r\n btnca.setFont(f);\r\n btnca.addActionListener(this);\r\n JButton btncha = new JButton(\"\\u0C9B\");\r\n btncha.setBounds(x+x1*i++,y,x1,y1);\r\n btncha.setFont(f);\r\n btncha.addActionListener(this);\r\n JButton btnja = new JButton(\"\\u0C9C\");\r\n btnja.setBounds(x+x1*i++,y,x1,y1);\r\n btnja.setFont(f);\r\n btnja.addActionListener(this);\r\n JButton btnjha = new JButton(\"\\u0C9D\");\r\n btnjha.setBounds(x+x1*i++,y,x1,y1);\r\n btnjha.setFont(f);\r\n btnjha.addActionListener(this);\r\n JButton btnnya = new JButton(\"\\u0C9E\");\r\n btnnya.setBounds(x+x1*i++,y,x1,y1);\r\n btnnya.setFont(f);\r\n btnnya.addActionListener(this);\r\n \r\n x = 400;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btntta = new JButton(\"\\u0C9F\");\r\n btntta.setBounds(x+x1*i++,y,x1,y1);\r\n btntta.setFont(f);\r\n btntta.addActionListener(this);\r\n JButton btnttha = new JButton(\"\\u0CA0\");\r\n btnttha.setBounds(x+x1*i++,y,x1,y1);\r\n btnttha.setFont(f);\r\n btnttha.addActionListener(this);\r\n JButton btndda = new JButton(\"\\u0CA1\");\r\n btndda.setBounds(x+x1*i++,y,x1,y1);\r\n btndda.setFont(f);\r\n btndda.addActionListener(this);\r\n JButton btnddha = new JButton(\"\\u0CA2\");\r\n btnddha.setBounds(x+x1*i++,y,x1,y1);\r\n btnddha.setFont(f);\r\n btnddha.addActionListener(this);\r\n JButton btnnna = new JButton(\"\\u0CA3\");\r\n btnnna.setBounds(x+x1*i++,y,x1,y1);\r\n btnnna.setFont(f);\r\n btnnna.addActionListener(this);\r\n \r\n x = 400;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btnta = new JButton(\"\\u0CA4\");\r\n btnta.setBounds(x+x1*i++,y,x1,y1);\r\n btnta.setFont(f);\r\n btnta.addActionListener(this);\r\n JButton btntha = new JButton(\"\\u0CA5\");\r\n btntha.setBounds(x+x1*i++,y,x1,y1);\r\n btntha.setFont(f);\r\n btntha.addActionListener(this);\r\n JButton btnda = new JButton(\"\\u0CA6\");\r\n btnda.setBounds(x+x1*i++,y,x1,y1);\r\n btnda.setFont(f);\r\n btnda.addActionListener(this);\r\n JButton btndha = new JButton(\"\\u0CA7\");\r\n btndha.setBounds(x+x1*i++,y,x1,y1);\r\n btndha.setFont(f);\r\n btndha.addActionListener(this);\r\n JButton btnna = new JButton(\"\\u0CA8\");\r\n btnna.setBounds(x+x1*i++,y,x1,y1);\r\n btnna.setFont(f);\r\n btnna.addActionListener(this);\r\n \r\n x = 400;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btnpa = new JButton(\"\\u0CAA\");\r\n btnpa.setBounds(x+x1*i++,y,x1,y1);\r\n btnpa.setFont(f);\r\n btnpa.addActionListener(this);\r\n JButton btnpha = new JButton(\"\\u0CAB\");\r\n btnpha.setBounds(x+x1*i++,y,x1,y1);\r\n btnpha.setFont(f);\r\n btnpha.addActionListener(this);\r\n JButton btnba = new JButton(\"\\u0CAC\");\r\n btnba.setBounds(x+x1*i++,y,x1,y1);\r\n btnba.setFont(f);\r\n btnba.addActionListener(this);\r\n JButton btnbha = new JButton(\"\\u0CAD\");\r\n btnbha.setBounds(x+x1*i++,y,x1,y1);\r\n btnbha.setFont(f);\r\n btnbha.addActionListener(this);\r\n JButton btnma = new JButton(\"\\u0CAE\");\r\n btnma.setBounds(x+x1*i++,y,x1,y1);\r\n btnma.setFont(f);\r\n btnma.addActionListener(this);\r\n \r\n x = 200;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btnya = new JButton(\"\\u0CAF\");\r\n btnya.setBounds(x+x1*i++,y,x1,y1);\r\n btnya.setFont(f);\r\n btnya.addActionListener(this);\r\n JButton btnra = new JButton(\"\\u0CB0\");\r\n btnra.setBounds(x+x1*i++,y,x1,y1);\r\n btnra.setFont(f);\r\n btnra.addActionListener(this);\r\n JButton btnla = new JButton(\"\\u0CB2\");\r\n btnla.setBounds(x+x1*i++,y,x1,y1);\r\n btnla.setFont(f);\r\n btnla.addActionListener(this);\r\n JButton btnva = new JButton(\"\\u0CB5\");\r\n btnva.setBounds(x+x1*i++,y,x1,y1);\r\n btnva.setFont(f);\r\n btnva.addActionListener(this);\r\n JButton btnsha = new JButton(\"\\u0CB6\");\r\n btnsha.setBounds(x+x1*i++,y,x1,y1);\r\n btnsha.setFont(f);\r\n btnsha.addActionListener(this);\r\n JButton btnssa = new JButton(\"\\u0CB7\");\r\n btnssa.setBounds(x+x1*i++,y,x1,y1);\r\n btnssa.setFont(f);\r\n btnssa.addActionListener(this);\r\n JButton btnsa = new JButton(\"\\u0CB8\");\r\n btnsa.setBounds(x+x1*i++,y,x1,y1);\r\n btnsa.setFont(f);\r\n btnsa.addActionListener(this);\r\n JButton btnha = new JButton(\"\\u0CB9\");\r\n btnha.setBounds(x+x1*i++,y,x1,y1);\r\n btnha.setFont(f);\r\n btnha.addActionListener(this);\r\n JButton btnlla = new JButton(\"\\u0CB3\");\r\n btnlla.setBounds(x+x1*i++,y,x1,y1);\r\n btnlla.setFont(f);\r\n btnlla.addActionListener(this);\r\n JButton btnksha = new JButton(\"\\u0C95\\u0CCD\\u0CB7\");\r\n btnksha.setBounds(x+x1*i++,y,x1,y1);\r\n btnksha.setFont(f);\r\n btnksha.addActionListener(this);\r\n JButton btntra = new JButton(\"\\u0CA4\\u0CCD\\u0CB0\");\r\n btntra.setBounds(x+x1*i++,y,x1,y1);\r\n btntra.setFont(f);\r\n btntra.addActionListener(this);\r\n JButton btnjna = new JButton(\"\\u0C9C\\u0CCD\\u0C9E\");\r\n btnjna.setBounds(x+x1*i++,y,x1,y1);\r\n btnjna.setFont(f);\r\n btnjna.addActionListener(this);\r\n \r\n x = 750;\r\n y = 175;\r\n i=0;\r\n \r\n JButton btnhal = new JButton(\"\\u0CCD\");\r\n btnhal.setBounds(x+x1*i++,y,x1,y1);\r\n btnhal.setFont(f);\r\n btnhal.addActionListener(this);\r\n JButton btnvaa = new JButton(\"\\u0CBE\");\r\n btnvaa.setBounds(x+x1*i++,y,x1,y1);\r\n btnvaa.setFont(f);\r\n btnvaa.addActionListener(this);\t\r\n JButton btnvi = new JButton(\"\\u0CBF\");\r\n btnvi.setBounds(x+x1*i++,y,x1,y1);\r\n btnvi.setFont(f);\r\n btnvi.addActionListener(this);\r\n JButton btnvii = new JButton(\"\\u0CC0\");\r\n btnvii.setBounds(x+x1*i++,y,x1,y1);\r\n btnvii.setFont(f);\r\n btnvii.addActionListener(this);\r\n \r\n x = 750;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btnvu = new JButton(\"\\u0CC1\");\r\n btnvu.setBounds(x+x1*i++,y,x1,y1);\r\n btnvu.setFont(f);\r\n btnvu.addActionListener(this);\r\n JButton btnvuu = new JButton(\"\\u0CC2\");\r\n btnvuu.setBounds(x+x1*i++,y,x1,y1);\r\n btnvuu.setFont(f);\r\n btnvuu.addActionListener(this);\r\n JButton btnvr = new JButton(\"\\u0CC3\");\r\n btnvr.setBounds(x+x1*i++,y,x1,y1);\r\n btnvr.setFont(f);\r\n btnvr.addActionListener(this);\r\n JButton btnvrr = new JButton(\"\\u0CC4\");\r\n btnvrr.setBounds(x+x1*i++,y,x1,y1);\r\n btnvrr.setFont(f);\r\n btnvrr.addActionListener(this);\r\n \r\n x = 750;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btnve = new JButton(\"\\u0CC6\");\r\n btnve.setBounds(x+x1*i++,y,x1,y1);\r\n btnve.setFont(f);\r\n btnve.addActionListener(this);\r\n JButton btnvee = new JButton(\"\\u0CC7\");\r\n btnvee.setBounds(x+x1*i++,y,x1,y1);\r\n btnvee.setFont(f);\r\n btnvee.addActionListener(this);\r\n JButton btnvai = new JButton(\"\\u0CC8\");\r\n btnvai.setBounds(x+x1*i++,y,x1,y1);\r\n btnvai.setFont(f);\r\n btnvai.addActionListener(this);\r\n JButton btnvo = new JButton(\"\\u0CCA\");\r\n btnvo.setBounds(x+x1*i++,y,x1,y1);\r\n btnvo.setFont(f);\r\n btnvo.addActionListener(this);\r\n \r\n x = 750;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btnvoo = new JButton(\"\\u0CCB\");\r\n btnvoo.setBounds(x+x1*i++,y,x1,y1);\r\n btnvoo.setFont(f);\r\n btnvoo.addActionListener(this);\r\n JButton btnvou = new JButton(\"\\u0CCC\");\r\n btnvou.setBounds(x+x1*i++,y,x1,y1);\r\n btnvou.setFont(f);\r\n btnvou.addActionListener(this);\r\n JButton btnvam = new JButton(\"\\u0C82\");\r\n btnvam.setBounds(x+x1*i++,y,x1,y1);\r\n btnvam.setFont(f);\r\n btnvam.addActionListener(this);\r\n JButton btnvaha = new JButton(\"\\u0C83\");\r\n btnvaha.setBounds(x+x1*i++,y,x1,y1);\r\n btnvaha.setFont(f);\r\n btnvaha.addActionListener(this);\r\n \r\n x = 160;\r\n y = 175;\r\n i=0;\r\n \r\n JButton btn1 = new JButton(\"\\u0CE7\");\r\n btn1.setBounds(x+x1*i++,y,x1,y1);\r\n btn1.setFont(f);\r\n btn1.addActionListener(this);\r\n JButton btn2 = new JButton(\"\\u0CE8\");\r\n btn2.setBounds(x+x1*i++,y,x1,y1);\r\n btn2.setFont(f);\r\n btn2.addActionListener(this);\r\n JButton btn3 = new JButton(\"\\u0CE9\");\r\n btn3.setBounds(x+x1*i++,y,x1,y1);\r\n btn3.setFont(f);\r\n btn3.addActionListener(this);\r\n \r\n x = 160;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btn4 = new JButton(\"\\u0CEA\");\r\n btn4.setBounds(x+x1*i++,y,x1,y1);\r\n btn4.setFont(f);\r\n btn4.addActionListener(this);\r\n JButton btn5 = new JButton(\"\\u0CEB\");\r\n btn5.setBounds(x+x1*i++,y,x1,y1);\r\n btn5.setFont(f);\r\n btn5.addActionListener(this);\r\n JButton btn6 = new JButton(\"\\u0CEC\");\r\n btn6.setBounds(x+x1*i++,y,x1,y1);\r\n btn6.setFont(f);\r\n btn6.addActionListener(this);\r\n \r\n x = 160;\r\n y += 50;\r\n i=0;\r\n \r\n JButton btn7 = new JButton(\"\\u0CED\");\r\n btn7.setBounds(x+x1*i++,y,x1,y1);\r\n btn7.setFont(f);\r\n btn7.addActionListener(this);\r\n JButton btn8 = new JButton(\"\\u0CEE\");\r\n btn8.setBounds(x+x1*i++,y,x1,y1);\r\n btn8.setFont(f);\r\n btn8.addActionListener(this);\r\n JButton btn9 = new JButton(\"\\u0CEF\");\r\n btn9.setBounds(x+x1*i++,y,x1,y1);\r\n btn9.setFont(f);\r\n btn9.addActionListener(this);\r\n \r\n x = 220;\r\n y += 50;\r\n \t\t\r\n JButton btn0 = new JButton(\"\\u0CE6\");\r\n btn0.setBounds(x,y,x1,y1);\r\n btn0.setFont(f);\r\n btn0.addActionListener(this);\r\n \r\n x = 1000;\r\n y = 200;\r\n \t\t\r\n JButton btnBlank = new JButton(\"\\u0C96\\u0CBE\\u0CB2\\u0CBF\");\r\n btnBlank.setBounds(x,y,90,y1);\r\n btnBlank.setFont(f);\r\n btnBlank.addActionListener(this);\r\n \r\n x = 1000;\r\n y = 250;\r\n \r\n JButton btnClear = new JButton(\"\\u0C85\\u0CB3\\u0CBF\\u0CB8\\u0CC1\");\r\n btnClear.setBounds(x,y,90,40);\r\n btnClear.setFont(f);\r\n btnClear.addActionListener(this);\r\n /*JButton btnBack = new JButton(\"\\u0008\");\r\n btnBack.setFont(f);\r\n btnBack.addActionListener(this);\r\n */\r\n \t\r\n jfrm.add(btna);\r\n jfrm.add(btnaa);\r\n jfrm.add(btni);\r\n jfrm.add(btnii);\r\n jfrm.add(btnu);\r\n jfrm.add(btnuu);\r\n jfrm.add(btnr);\r\n jfrm.add(btnrr);\r\n jfrm.add(btne);\r\n jfrm.add(btnee);\r\n jfrm.add(btnai);\r\n jfrm.add(btno);\r\n jfrm.add(btnoo);\r\n jfrm.add(btnou);\r\n jfrm.add(btnam);\r\n jfrm.add(btnaha);\r\n jfrm.add(btnka);\r\n jfrm.add(btnkha);\r\n jfrm.add(btnga);\r\n jfrm.add(btngha);\r\n jfrm.add(btnnga);\r\n jfrm.add(btnca);\r\n jfrm.add(btncha);\r\n jfrm.add(btnja);\r\n jfrm.add(btnjha);\r\n jfrm.add(btnnya);\r\n jfrm.add(btntta);\r\n jfrm.add(btnttha);\r\n jfrm.add(btndda);\r\n jfrm.add(btnddha);\r\n jfrm.add(btnnna);\r\n jfrm.add(btnta);\r\n jfrm.add(btntha);\r\n jfrm.add(btnda);\r\n jfrm.add(btndha);\r\n jfrm.add(btnna);\r\n jfrm.add(btnha);\r\n jfrm.add(btnpa);\r\n jfrm.add(btnpha);\r\n jfrm.add(btnba);\r\n jfrm.add(btnbha);\r\n jfrm.add(btnma);\r\n jfrm.add(btnya);\r\n jfrm.add(btnra);\r\n jfrm.add(btnla);\r\n jfrm.add(btnva);\r\n jfrm.add(btnsha);\r\n jfrm.add(btnssa);\r\n jfrm.add(btnsa);\r\n jfrm.add(btnha);\r\n jfrm.add(btnlla);\r\n jfrm.add(btnksha);\r\n jfrm.add(btntra);\r\n jfrm.add(btnjna);\r\n \r\n jfrm.add(btnhal);\r\n jfrm.add(btnvaa);\r\n jfrm.add(btnvi);\r\n jfrm.add(btnvii);\r\n jfrm.add(btnvu);\r\n jfrm.add(btnvuu);\r\n jfrm.add(btnvr);\r\n jfrm.add(btnvrr);\r\n jfrm.add(btnve);\r\n jfrm.add(btnvee);\r\n jfrm.add(btnvai);\r\n jfrm.add(btnvo);\r\n jfrm.add(btnvoo);\r\n jfrm.add(btnvou);\r\n jfrm.add(btnvam);\r\n jfrm.add(btnvaha);\r\n \r\n jfrm.add(btn0);\r\n jfrm.add(btn1);\r\n jfrm.add(btn2);\r\n jfrm.add(btn3);\r\n jfrm.add(btn4);\r\n jfrm.add(btn5);\r\n jfrm.add(btn6);\r\n jfrm.add(btn7);\r\n jfrm.add(btn8);\r\n jfrm.add(btn9);\r\n jfrm.add(btnBlank);\r\n jfrm.add(btnClear);\r\n //jfrm.add(btnBack);\r\n \t\t\t\t\r\n jfrm.setVisible(true);\r\n }", "public FrameEjercicio1() {\n super(\"Control de Ratón\");\n setLayout(new FlowLayout());\n setFocusable(true);\n\n class MouseHandler extends MouseAdapter { // Uso el adaptador para no escribir funciones vacías\n\n @Override\n public void mouseExited(MouseEvent e) {\n setTitle(titulo);\n }\n\n @Override\n public void mouseMoved(MouseEvent e) {\n\n if(e.getSource().getClass() == JButton.class){\n setTitle(String.format(titulo + \" - (X:%d Y:%d)\", e.getX() + (int)((JButton)e.getSource()).getBounds().getX(), e.getY() + (int)((JButton)e.getSource()).getBounds().getY())); \n }\n else{\n setTitle(String.format(titulo + \" - (X:%d Y:%d)\", e.getX(), e.getY()));\n }\n }\n\n @Override\n public void mousePressed(MouseEvent e) {\n if (e.getButton() == MouseEvent.BUTTON1) {\n btnClickIzquierdo.setBackground(colorFondoBotones);\n } else if (e.getButton() == MouseEvent.BUTTON3) {\n btnClickDerecho.setBackground(colorFondoBotones);\n }\n }\n\n @Override\n public void mouseReleased(MouseEvent e) {\n btnClickIzquierdo.setBackground(null);\n btnClickDerecho.setBackground(null);\n }\n }\n\n MouseHandler mh = new MouseHandler(); // Creo el MouseHandler\n // Añado los listeners al ContentPane\n getContentPane().addMouseListener(mh);\n getContentPane().addMouseMotionListener(mh);\n \n addKeyListener(this); // Añado el KeyListener\n\n btnClickIzquierdo = new JButton(\"Click Izquierdo\");\n btnClickIzquierdo.setSize(btnClickIzquierdo.getPreferredSize());\n btnClickIzquierdo.addMouseMotionListener(mh); // También añado el MotionListener a los botones para que muestre las coordenadas aún cuando esté encima de ellos\n add(btnClickIzquierdo);\n\n btnClickDerecho = new JButton(\"Click Derecho\");\n btnClickDerecho.setSize(btnClickDerecho.getPreferredSize());\n btnClickDerecho.addMouseMotionListener(mh);\n add(btnClickDerecho);\n\n lblTeclas = new JLabel(\"Teclas\");\n lblTeclas.setSize(lblTeclas.getPreferredSize());\n add(lblTeclas);\n\n }", "private Button buttonStyling(Button button, boolean top, boolean left) {\r\n\t\tif(top) {\r\n\t\t\tbutton.getAllStyles().setMarginTop(100);\t\r\n\t\t} else if(left) {\r\n\t\t\tbutton.getAllStyles().setMarginLeft(500);\r\n\t\t}\r\n\t\t\r\n\t\tbutton.getAllStyles().setPadding(5, 5, 2, 2);\r\n\t\tbutton.getAllStyles().setBgTransparency(255);\r\n\t\tbutton.getUnselectedStyle().setBgColor(ColorUtil.BLUE);\r\n\t\tbutton.getAllStyles().setFgColor(ColorUtil.WHITE);\r\n\t\tbutton.getAllStyles().setBorder(Border.createLineBorder(4, ColorUtil.BLACK));\r\n\t\t\r\n\t\treturn button;\r\n\t}", "private javax.swing.JButton getJButton8() {\n\t\tif(jButton8 == null) {\n\t\t\tjButton8 = new javax.swing.JButton();\n\t\t\tjButton8.setPreferredSize(new java.awt.Dimension(120,40));\n\t\t\tjButton8.setBackground(new java.awt.Color(226,226,222));\n\t\t\tjButton8.setMargin(new Insets(1,2,1,1));\n\t\t\tjButton8.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.BOLD, 10));\n\t\t\tjButton8.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n\t\t\tjButton8.setText(\"F8 Anular Lista\");\n\t\t}\n\t\treturn jButton8;\n\t}", "@Override\r\n public void actionPerformed(ActionEvent e) {\n Font currentFont = jshellLabGlobal.Interpreter.GlobalValues.globalEditorPane.getFont();\r\n Font newFont = new Font(currentFont.getFontName(), currentFont.getStyle(), currentFont.getSize()+1);\r\n jshellLabGlobal.Interpreter.GlobalValues.globalEditorPane.setFont(newFont);\r\n }", "private void setUpKeyboardButtons() {\n mQWERTY = \"qwertyuiopasdfghjklzxcvbnm_\";\n mQWERTYWithDot = \"qwertyuiopasdfghjklzxcvbnm.\";\n\n mKeySize = mQWERTY.length();\n\n mLetterButtons = new Button[mQWERTY.length()];\n mKeyObjects = new KeyObject[mQWERTY.length() + 10];\n mIsShiftPressed = false;\n\n\n for (int i = 0; i < mQWERTY.length(); i++) {\n int id = getResources().getIdentifier(mQWERTY.charAt(i) + \"Button\", \"id\", getPackageName());\n mLetterButtons[i] = (Button) findViewById(id);\n\n final int finalI = i;\n mLetterButtons[i].setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n // create KeyObject when button is pressed and assign pressed features\n if (event.getAction() == MotionEvent.ACTION_DOWN) {\n mKeyObjects[finalI] = new KeyObject();\n\n Rect buttonShape = new Rect();\n v.getLocalVisibleRect(buttonShape);\n\n mKeyObjects[finalI].setPressedPressure(event.getPressure());\n mKeyObjects[finalI].setPressedTime(event.getEventTime());\n\n mKeyObjects[finalI].setCoordXPressed(event.getX());\n mKeyObjects[finalI].setCoordYPressed(event.getY());\n\n mKeyObjects[finalI].setCenterXCoord(buttonShape.exactCenterX());\n mKeyObjects[finalI].setCenterYCoord(buttonShape.exactCenterY());\n }\n\n // assign release features, check if button is canceled\n if (event.getAction() == MotionEvent.ACTION_UP) {\n mKeyObjects[finalI].setReleasedPressure(event.getPressure());\n mKeyObjects[finalI].setReleasedTime(event.getEventTime());\n\n mKeyObjects[finalI].setCoordXReleased(event.getX());\n mKeyObjects[finalI].setCoordYReleased(event.getY());\n\n if (mIsShiftPressed) {\n mKeyObjects[finalI].setKeyChar(Character.toUpperCase(mQWERTYWithDot.charAt(finalI)));\n } else {\n mKeyObjects[finalI].setKeyChar(mQWERTYWithDot.charAt(finalI));\n }\n\n Log.d(TAG, mKeyObjects[finalI].toString());\n\n\n // add key to buffer and update EditText\n if (mKeyBuffer.add(mKeyObjects[finalI]))\n if (mIsShiftPressed) {\n mPasswordEditText.append((mQWERTYWithDot.charAt(finalI) + \"\").toUpperCase());\n switchToLowerCase();\n } else {\n mPasswordEditText.append(mQWERTYWithDot.charAt(finalI) + \"\");\n }\n }\n\n return false;\n }\n });\n }\n\n mShiftButton = (Button) findViewById(R.id.shiftButton);\n mShiftButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (mIsShiftPressed) {\n switchToLowerCase();\n } else {\n switchToUpperCase();\n }\n }\n });\n }", "private javax.swing.JButton getJButtonAceptar() {\n\t\tif(jButtonAceptar == null) {\n\t\t\tjButtonAceptar = new JHighlightButton();\n\t\t\tjButtonAceptar.setText(\"Aceptar\");\n\t\t\tjButtonAceptar.setBackground(new java.awt.Color(226,226,222));\n\t\t\tjButtonAceptar.setIcon(new ImageIcon(getClass().getResource(\"/com/becoblohm/cr/gui/resources/icons/ix16x16/check2.png\")));\n\t\t}\n\t\treturn jButtonAceptar;\n\t}", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tif(\"colorButton\".equals(e.getActionCommand())){//使颜色按钮\r\n\t\t\t\tString ct = tt.resultTextPane.getSelectedText();\r\n\t\t\t\tif(ct != null&&!\"\".equals(ct.trim())){//判断是否已经选取了文字\r\n\t\t\t\t\tFontColor fc = new FontColor(\"0\",this.tt);\r\n\t\t\t\t\tfc.setResizable(false);\r\n\t\t\t\t\tfc.setTitle(\"颜色编辑器\");\r\n\t\t\t\t\tint end = tt.resultTextPane.getSelectionEnd();\r\n\t\t\t\t\tint begin = tt.resultTextPane.getSelectionStart();\r\n\t\t\t\t\tMap<Integer,Integer> map = tt.numberIndex;\r\n\t\t\t\t\tfc.setBegin(map.get(begin));//选中区域的开始位置\r\n\t\t\t\t\tfc.setEnd(map.get(end));//选中区域的结束位置\r\n\t\t\t\t\tfc.setBounds(250, 200, 255, 265);\r\n\t\t\t\t\t\r\n\t\t\t\t\tDimension d=fc.getSize();\r\n\t\t\t\t\tPoint loc = basePanel.getLocationOnScreen();\r\n\t\t \tloc.translate(d.width/3,0);\r\n\t\t \tfc.setLocation(loc);\r\n\t\t \t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfc.setModal(true);\r\n\t\t\t\t\tfc.setVisible(true);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {//没有选取文字\r\n\t\t\t\t\t\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"请选择要编辑的文字\",\"提示\",1);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(\"linkButton\".equals(e.getActionCommand())){//是超链接按钮\r\n\t\t\t\tString ct = tt.resultTextPane.getSelectedText();\r\n\t\t\t\tif(ct != null&&!\"\".equals(ct.trim())){//判断是否已经选取了文字\r\n\t\t\t\t\tint end = tt.resultTextPane.getSelectionEnd();\r\n\t\t\t\t\tint begin = tt.resultTextPane.getSelectionStart();\r\n\t\t\t\t\tMap<Integer,Integer> map = tt.numberIndex;\r\n\t\r\n\t\t\t\t\tUnderLine ul = new UnderLine(map.get(begin),map.get(end),tt);\r\n\t\t\t\t\tul.setResizable(false);\r\n\t\t\t\t\tul.setTitle(\"超链接编辑\");\r\n\t\t\t\t\tul.setContentPane(ul.getTotalPanel());\r\n\t\t\t\t\tul.setBounds(250, 200, 255, 265);\r\n\t\t\t\t\t\r\n\t\t\t\t\tDimension d=ul.getSize();\r\n\t\t\t\t\tPoint loc = basePanel.getLocationOnScreen();\r\n\t\t \tloc.translate(d.width/3,0);\r\n\t\t \tul.setLocation(loc);\r\n\t\t\t\t\t\r\n\t\t\t\t\tul.setModal(true);\r\n\t\t\t\t\tul.setVisible(true);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {//没有选择编辑的文字\r\n\t\t\t\t\t\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"请选择要编辑的文字\",\"提示\",1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(\"icoButton\".equals(e.getActionCommand())){//点击了图片选择按钮\r\n//\t\t\t\tSystem.out.println(resultTextPane.get);\r\n\t\t\t\t\r\n\t\t\t\tint end = tt.resultTextPane.getSelectionEnd();\r\n\t\t\t\tint begin = tt.resultTextPane.getSelectionStart();\r\n\t\t\t\tMap<Integer,Integer> map = tt.numberIndex;\r\n\t\t\t\t\r\n\t\t\t\tIco ico = new Ico(tt,map.get(begin));\r\n\t\t\t\tico.setTitle(\"图标编辑\");\r\n\t\t\t\tico.setResizable(false);\r\n\t\t\t\tico.setContentPane(ico.getTotalPanel());\r\n\t\t\t\tico.setBounds(250, 200, 255, 265);\r\n\r\n\t\t\t\tDimension d=ico.getSize();\r\n\t\t\t\tPoint loc = basePanel.getLocationOnScreen();\r\n\t \tloc.translate(d.width/3,0);\r\n\t \tico.setLocation(loc);\r\n\t \t\r\n\t \tico.setModal(true);\r\n\t\t\t\tico.setVisible(true);\r\n\t\t\t}\r\n\r\n\t\t}", "public void applyTheme(){\n\t\tColor backgroundColour = new Color(255,255,255);\n\t\tColor buttonText = new Color(255,255,255);\n\t\tColor normalText = new Color(0,0,0);\n\t\tColor buttonColour = new Color(15,169,249);\n\n\t\tfirstAttemptResult.setForeground(new Color(255,0,110));\n\t\tsecondAttemptResult.setForeground(new Color(255,0,0));\n\t\t\n\t\t// background color\n\t\tthis.setBackground(backgroundColour);\n\t\t\n\t\t// normal text\n\t\tspellQuery.setForeground(normalText);\n\t\tdefinitionArea.setForeground(normalText);\n\t\tlblstAttempt.setForeground(normalText);\n\t\tlblndAttempt.setForeground(normalText);\n\t\tfirstAttempt.setForeground(normalText);\n\t\tsecondAttempt.setForeground(normalText);\n\t\tcurrentQuiz.setForeground(normalText);\n\t\tcurrentStreak.setForeground(normalText);\n\t\tlongestStreak.setForeground(normalText);\n\t\tnoOfCorrectSpellings.setForeground(normalText);\n\t\tquizAccuracy.setForeground(normalText);\n\t\tlblNewLabel.setForeground(normalText);\n\t\tlblYouOnlyHave.setForeground(normalText);\n\t\tlblCurrentQuiz.setForeground(normalText);\n\t\tlblCurrentStreak.setForeground(normalText);\n\t\tlblLongeststreak.setForeground(normalText);\n\t\tlblSpelledCorrectly.setForeground(normalText);\n\t\tlblQuizAccuracy.setForeground(normalText);\n\t\t\n\t\t// button text\n\t\tbtnConfirmOrNext.setForeground(buttonText);\n\t\tbtnStop.setForeground(buttonText);\n\t\tbtnListenAgain.setForeground(buttonText);\n\t\t// normal button color\n\t\tbtnConfirmOrNext.setBackground(buttonColour);\n\t\tbtnStop.setBackground(buttonColour);\n\t\tbtnListenAgain.setBackground(buttonColour);\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getActionCommand().equals(\"黑色\")){\r\n\t\t\tSystem.out.println(\"猫猫也知道你点击的是黑色按钮\");\r\n\t\t\t\r\n\t\t}else if(e.getActionCommand().equals(\"红色\")){\r\n\t\t\tSystem.out.println(\"猫猫也知道你点击的是红色按钮\");\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"不知道\");\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton1 = new javax.swing.JButton();\n bn_play = new javax.swing.JButton();\n bn_ex = new javax.swing.JButton();\n bn_how = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n bg = new javax.swing.JLabel();\n\n jButton1.setText(\"jButton1\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n bn_play.setBackground(java.awt.SystemColor.textHighlightText);\n bn_play.setFont(new java.awt.Font(\"Gabriola\", 1, 48)); // NOI18N\n bn_play.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/res/bnplay.png\"))); // NOI18N\n bn_play.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n bn_playMouseEntered(evt);\n }\n });\n bn_play.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bn_playActionPerformed(evt);\n }\n });\n getContentPane().add(bn_play);\n bn_play.setBounds(460, 190, 220, 100);\n\n bn_ex.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/res/bnex1.png\"))); // NOI18N\n bn_ex.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bn_exActionPerformed(evt);\n }\n });\n getContentPane().add(bn_ex);\n bn_ex.setBounds(630, 340, 110, 50);\n\n bn_how.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/res/bnhow1.png\"))); // NOI18N\n bn_how.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n bn_howActionPerformed(evt);\n }\n });\n getContentPane().add(bn_how);\n bn_how.setBounds(350, 340, 160, 50);\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/res/avatar2 (1)_1.gif\"))); // NOI18N\n getContentPane().add(jLabel1);\n jLabel1.setBounds(60, -20, 300, 470);\n\n jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/res/head2.png\"))); // NOI18N\n getContentPane().add(jLabel3);\n jLabel3.setBounds(360, 0, 540, 170);\n\n bg.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/res/main-2-1.png\"))); // NOI18N\n getContentPane().add(bg);\n bg.setBounds(0, 0, 800, 480);\n\n pack();\n setLocationRelativeTo(null);\n }", "public void solve(){\n\t\tfor(int i = 1; i < 26; i++){\n\t\t\tp.getButton(i).setBackground(Color.white);\n\t\t}\n\t}", "@Override\r\n public void mouseClicked(MouseEvent e) {\n System.out.println(e.getButton());\r\n\r\n // MouseEvent.BUTTON3 es el boton derecho\r\n }", "public void sButton() {\n\n\n\n }", "private Technique clickButton(TextButton button) {\n\t\tInputEvent event1 = new InputEvent();\n event1.setType(InputEvent.Type.touchDown);\n button.fire(event1);\n InputEvent event2 = new InputEvent();\n event2.setType(InputEvent.Type.touchUp);\n button.fire(event2);\n return selectedTechnique;\n\t}", "public void applyButtonStyles(JButton button){\n button.setBackground(coloursObject.getContentPanelColour());//set background colour\n button.setForeground(coloursObject.getButtonTextColour());//set foreground colour\n button.setFont(new java.awt.Font(\"Microsoft Tai Le\", 0, 14));//set font and size\n button.setBorder(null);//remove the border//remove any border\n button.setFocusPainted(false);//make not focusable (custom hover effect overides this)\n \n button.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {//when hovering over mouse\n button.setForeground(coloursObject.getButtonTextHoverColour());//the colour of the text when hovered over\n }\n\n public void mouseExited(java.awt.event.MouseEvent evt) {//when cursor stops hovering over the mouse\n button.setForeground(coloursObject.getButtonTextColour());//the colour of the text when the cursor is removed\n }\n });\n }", "void objek() {\n getContentPane().setLayout(null);\n getContentPane().add(text1);\n getContentPane().add(bt1);\n getContentPane().add(bt2);\n getContentPane().add(bt3);\n getContentPane().add(bt4);\n getContentPane().add(bt5);\n getContentPane().add(bt6);\n getContentPane().add(bt7);\n getContentPane().add(bt8);\n getContentPane().add(bt9);\n getContentPane().add(bt10);\n getContentPane().add(bt11);\n getContentPane().add(bt12);\n getContentPane().add(bt13);\n getContentPane().add(bt14);\n getContentPane().add(bt15);\n getContentPane().add(bt16);\n \n text1.setBounds(50, 8, 190, 30);\n \n bt1.setBounds(50, 40, 40, 40);\n bt2.setBounds(100, 40, 40, 40);\n bt3.setBounds(150, 40, 40, 40);\n bt4.setBounds(200, 40, 40, 40);\n \n bt5.setBounds(50, 90, 40, 40);\n bt6.setBounds(100, 90, 40, 40);\n bt7.setBounds(150, 90, 40, 40);\n bt8.setBounds(200, 90, 40, 40);\n \n bt9.setBounds(50, 140, 40, 40);\n bt10.setBounds(100, 140, 40, 40);\n bt11.setBounds(150, 140, 40, 40);\n bt12.setBounds(200, 140, 40, 40);\n \n bt13.setBounds(50, 190, 40, 40);\n bt14.setBounds(100, 190, 40, 40);\n bt15.setBounds(150, 190, 40, 40);\n bt16.setBounds(200, 190, 40, 40);\n \n bt1.setBackground(Color.BLUE);\n bt2.setBackground(Color.CYAN);\n bt3.setBackground(Color.DARK_GRAY);\n bt4.setBackground(Color.GREEN);\n bt5.setBackground(Color.LIGHT_GRAY);\n bt6.setBackground(Color.MAGENTA);\n bt7.setBackground(Color.ORANGE);\n bt8.setBackground(Color.PINK);\n bt9.setBackground(Color.RED);\n bt10.setBackground(Color.WHITE);\n bt11.setBackground(Color.YELLOW);\n bt12.setBackground(Color.BLUE);\n bt13.setBackground(Color.DARK_GRAY);\n bt14.setBackground(Color.CYAN);\n bt15.setBackground(Color.MAGENTA);\n bt16.setBackground(Color.RED);\n \n setVisible(true);\n }", "private void m1937a(int i) {\n ImageButton imageButton;\n int i2;\n if (i == RainbowPalette.f2748b) {\n this.f2425b.mo5193a(RainbowPalette.f2748b);\n imageButton = this.f2424a;\n i2 = C0462R.C0463drawable.ic_small_wheel;\n } else if (i == RainbowPalette.f2749c) {\n this.f2425b.mo5193a(RainbowPalette.f2749c);\n imageButton = this.f2424a;\n i2 = C0462R.C0463drawable.temprature_s;\n } else if (i == RainbowPalette.f2750d) {\n this.f2425b.mo5193a(RainbowPalette.f2750d);\n imageButton = this.f2424a;\n i2 = C0462R.C0463drawable.black_s;\n } else {\n if (i == RainbowPalette.f2751e) {\n this.f2425b.mo5193a(RainbowPalette.f2751e);\n imageButton = this.f2424a;\n i2 = C0462R.C0463drawable.ic_colorwheel;\n }\n m1939b();\n }\n imageButton.setBackgroundResource(i2);\n m1939b();\n }", "public MenuButtons(String nameOfButton) {\n Text text = new Text(nameOfButton);\n text.setFont(Font.font(null, FontWeight.BOLD, 18));\n text.setFill(Color.WHITESMOKE);\n\n //A rectangle that will be a part of the button\n Rectangle rectangle = new Rectangle(250,30);\n rectangle.setOpacity(0.3);\n rectangle.setFill(Color.BLUE);\n\n setAlignment(Pos.CENTER_LEFT);\n getChildren().addAll(rectangle, text);\n\n setOnMouseEntered(e -> {\n rectangle.setTranslateX(5);\n text.setTranslateX(5);\n rectangle.setFill(Color.DARKBLUE);\n });\n\n setOnMouseExited(e -> {\n rectangle.setTranslateX(0);\n text.setTranslateX(0);\n rectangle.setFill(Color.BLUE);\n });\n\n DropShadow shadowEffect = new DropShadow();\n shadowEffect.setInput(new Glow());\n\n setOnMousePressed(e -> setEffect(shadowEffect));\n setOnMouseReleased(e -> setEffect(null));\n }", "public void resetButtonStyles() {\n\t\tint drawable_id = R.drawable.stockbutton;\n\t\tDrawable stockbutton = getResources().getDrawable(drawable_id);\n\t\t\n\t\t// For now I'm just going to set the bg colors\n\t\tButton outsideButton = (Button) findViewById(R.id.outside);\n\t\toutsideButton.setBackground(stockbutton);\n\t\tButton fridgeButton = (Button) findViewById(R.id.fridge);\n\t\tfridgeButton.setBackground(stockbutton);\n\t\tButton freezerButton = (Button) findViewById(R.id.freezer);\n\t\tfreezerButton.setBackground(stockbutton);\n\t}", "public void drawButtons(){\r\n\t\tGuiBooleanButton showDirection = new GuiBooleanButton(1, 10, 20, 150, 20, \"Show Direction\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowdir(), \"showdir\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showdir\").split(\";\"));\r\n\t\tGuiChooseStringButton dirpos = new GuiChooseStringButton(2, width/2+50, 20, 150, 20, \"Dir-Position\", GuiPositions.getPosList(), \"posdir\", ModData.InfoMod, speicher,GuiPositions.getPos(((InfoMod)speicher.getMod(ModData.InfoMod.name())).getPosDir()),LiteModMain.lconfig.getData(\"Main.choosepos\").split(\";\"));\r\n\t\t\r\n\t\tGuiBooleanButton showFPS= new GuiBooleanButton(3, 10, 45, 150, 20, \"Show FPS\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowfps(), \"showfps\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showfps\").split(\";\"));\r\n\t\tGuiChooseStringButton fpspos = new GuiChooseStringButton(4, width/2+50, 45, 150, 20, \"FPS-Position\", GuiPositions.getPosList(), \"posfps\", ModData.InfoMod, speicher,GuiPositions.getPos(((InfoMod)speicher.getMod(ModData.InfoMod.name())).getPosFPS()),LiteModMain.lconfig.getData(\"Main.choosepos\").split(\";\"));\r\n\t\t\r\n\t\tGuiBooleanButton showCoor = new GuiBooleanButton(5, 10, 70, 150, 20, \"Show Coor\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowcoor(), \"showcoor\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showcoor\").split(\";\"));\r\n\t\tGuiChooseStringButton coorpos = new GuiChooseStringButton(6, width/2+50, 70, 150, 20, \"Coor-Position\", GuiPositions.getPosList(), \"poscoor\", ModData.InfoMod, speicher,GuiPositions.getPos(((InfoMod)speicher.getMod(ModData.InfoMod.name())).getPosCoor()),LiteModMain.lconfig.getData(\"Main.choosepos\").split(\";\"));\r\n\t\t\r\n\t\tGuiBooleanButton showworldage = new GuiBooleanButton(7, 10, 95, 150, 20, \"Show WorldAge\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowWorldAge(), \"showworldage\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showworldage\").split(\";\"));\r\n\t\tGuiChooseStringButton worldagepos = new GuiChooseStringButton(8, width/2+50, 95, 150, 20, \"WorldAge-Position\", GuiPositions.getPosList(), \"posworldage\", ModData.InfoMod, speicher,GuiPositions.getPos(((InfoMod)speicher.getMod(ModData.InfoMod.name())).getPosWorldAge()),LiteModMain.lconfig.getData(\"Main.choosepos\").split(\";\"));\r\n\t\t\r\n\t\t\r\n\t\tGuiBooleanButton showFriendly = new GuiBooleanButton(7, 10, 120, 150, 20, \"Mark friendly spawns\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowingFriendlySpawns(), \"showfmobspawn\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showfriendlymobspawn\").split(\";\"));\r\n\t\tGuiBooleanButton showAggressiv = new GuiBooleanButton(7, 10, 145, 150, 20, \"Mark aggressiv spawns\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isShowingAggressivSpawns(), \"showamobspawn\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.showaggressivmobspawn\").split(\";\"));\r\n\t\t\r\n\t\tGuiBooleanButton dynamic = new GuiBooleanButton(7, width/2+50, 120, 150, 20, \"dynamic selection\", ((InfoMod)speicher.getMod(ModData.InfoMod.name())).isDynamic(), \"dynamichsel\", ModData.InfoMod, speicher,LiteModMain.lconfig.getData(\"InfoMod.dynamicselection\").split(\";\"));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tGuiButton back = new GuiButton(9, width/2-100,height-50 , \"back to game\");\r\n\t\t\r\n\t\tbuttonList.add(showworldage);\r\n\t\tbuttonList.add(worldagepos);\r\n\t\tbuttonList.add(dirpos);\r\n\t\tbuttonList.add(fpspos);\r\n\t\tbuttonList.add(coorpos);\r\n\t\tbuttonList.add(showCoor);\r\n\t\tbuttonList.add(showFPS);\r\n\t\tbuttonList.add(showDirection);\r\n\t\t\r\n\t\tbuttonList.add(showFriendly);\r\n\t\tbuttonList.add(showAggressiv);\r\n\t\tbuttonList.add(dynamic);\r\n\t\t\r\n\t\tbuttonList.add(back);\r\n\t}", "public TextButton (BufferedImage bi)\n { \n updateValue(bi);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tbtnPrincipal.setBackgroundResource(R.drawable.est_premier_victorias);\n\t\t\t}", "public void specialChars(){\r\n \r\n //Each corresponding button is pressed ,its symbol is Stored in Greek Symbol variable and Button gets Disabled\r\n //alpha (α)\r\n if(alpha_btn.isArmed()){\r\n greekSymbols=alpha_btn.getText();\r\n alpha_btn.setDisable(true);\r\n }\r\n //beta (β)\r\n else if(beta_btn.isArmed()){\r\n greekSymbols=beta_btn.getText();\r\n beta_btn.setDisable(true);\r\n }\r\n //gamma (γ)\r\n else if(gamma_btn.isArmed()){\r\n greekSymbols=gamma_btn.getText();\r\n gamma_btn.setDisable(true);\r\n }\r\n //delta (δ)\r\n else if(delta_btn.isArmed()){\r\n greekSymbols=delta_btn.getText();\r\n delta_btn.setDisable(true);\r\n }\r\n //theta (θ)\r\n else if(theta_btn.isArmed()){\r\n greekSymbols=theta_btn.getText();\r\n theta_btn.setDisable(true);\r\n }\r\n //phi (ɸ)\r\n else if(phi_btn.isArmed()){\r\n greekSymbols=phi_btn.getText();\r\n phi_btn.setDisable(true);\r\n }\r\n //appending Greek Symbols to Text Field\r\n anglefield.setText(anglefield.getText()+greekSymbols);\r\n }", "public String getButtonFontStyle() {\r\n\t\tif (_saveButton == null)\r\n\t\t\treturn null;\r\n\t\telse\r\n\t\t\treturn _saveButton.getButtonFontStyle();\r\n\t}", "@Override\n public void onClick(View view) {\n\n mainTextView.setText(\"Hello from Omar!\");\n mainButton.setBackground(getResources().getDrawable(R.drawable.preset_button_1));\n mainButton.setTextColor(getResources().getColor(R.color.colorPrimary));\n mainEditText.setTextColor(getResources().getColor(R.color.colorPrimary));\n mainTextView.setTextColor(getResources().getColor(R.color.colorPrimary));\n findViewById(R.id.rootView).setBackgroundColor(getResources().getColor(R.color.white));\n secondTextView.setTextColor(getResources().getColor(R.color.grey));\n }", "Button(int x, int y, int w, int h, String label, int c){\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n this.label = label;\n this.col = c;\n }", "public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_)\n {\n if (this.visible)\n {\n FontRenderer fontrenderer = p_146112_1_.fontRendererObj;\n p_146112_1_.getTextureManager().bindTexture(ThemeRegistry.curTheme().guiTexture());\n GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n this.hovered = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition && p_146112_2_ < this.xPosition + this.width && p_146112_3_ < this.yPosition + this.height;\n int k = this.getHoverState(this.hovered);\n GlStateManager.enableBlend();\n GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);\n GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);\n \n GlStateManager.pushMatrix();\n float sh = height/20F;\n float sw = width >= 196? width/200F : 1F;\n float py = yPosition/sh;\n float px = xPosition/sw;\n GlStateManager.scale(sw, sh, 1F);\n \n if(width > 200) // Could use 396 but limiting it to 200 this makes things look nicer\n {\n \tGlStateManager.translate(px, py, 0F); // Fixes floating point errors related to position\n \tthis.drawTexturedModalRect(0, 0, 48, k * 20, 200, 20);\n } else\n {\n \tthis.drawTexturedModalRect((int)px, (int)py, 48, k * 20, this.width / 2, 20);\n \tthis.drawTexturedModalRect((int)px + width / 2, (int)py, 248 - this.width / 2, k * 20, this.width / 2, 20);\n }\n \n GlStateManager.popMatrix();\n \n this.mouseDragged(p_146112_1_, p_146112_2_, p_146112_3_);\n int l = 14737632;\n\n if (packedFGColour != 0)\n {\n l = packedFGColour;\n }\n else if (!this.enabled)\n {\n l = 10526880;\n }\n else if (this.hovered)\n {\n l = 16777120;\n }\n \n String txt = this.displayString;\n \n if(fontrenderer.getStringWidth(txt) > width) // Auto crop text to keep things tidy\n {\n \tint dotWidth = fontrenderer.getStringWidth(\"...\");\n \ttxt = fontrenderer.trimStringToWidth(txt, width - dotWidth) + \"...\";\n }\n \n this.drawCenteredString(fontrenderer, txt, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);\n }\n }", "public void toggleButton(){\r\n\t\tImageIcon xImage = new ImageIcon(\"image/x.png\");\t//Inserting image to the button\r\n\t\tImageIcon oImage = new ImageIcon(\"image/o.png\");\t//Inserting image to the button\r\n\t\tfor(int i=0;i<3;i++){\t\t\t\t\t//Update the buttons' text base on array of state\r\n\t\t\tfor(int j=0;j<3;j++){\r\n\t\t\t\t this.b[i][j].setIcon(Exer10.state[i][j]==1?xImage:(Exer10.state[i][j]==2?oImage:null));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public Hard_Button()\n {\n GreenfootImage text1 = new GreenfootImage(100 , 50);\n\n hardButtonImage.setColor(Color.RED);\n hardButtonImage.fillRect(0, 0, 100, 50);\n text1.setColor( Color.WHITE );\n text1.setFont( new Font( \"Helvetica\", Font.BOLD, 30 ) );\n text1.drawString(\"Hard\", text1.getWidth()/6 + 1, text1.getHeight()/2 + 8);\n \n hardButtonImage.drawImage( text1, 0, 0 );\n \n setImage( hardButtonImage );\n }", "public TextButton (String text,int textSize, Color color)\n {\n buttonText = text;\n GreenfootImage tempTextImage = new GreenfootImage (text, textSize, color, Color.WHITE);\n myImage = new GreenfootImage (tempTextImage.getWidth() + 8, tempTextImage.getHeight() + 8);\n myImage.setColor (Color.WHITE);\n myImage.fill();\n myImage.drawImage (tempTextImage, 4, 4);\n\n myImage.setColor (Color.BLACK);\n myImage.drawRect (0,0,tempTextImage.getWidth() + 7, tempTextImage.getHeight() + 7);\n setImage(myImage);\n }", "@Override\r\n\tpublic ButtonInterfaceRichard getButton() {\n\t\treturn move;\r\n\t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tbtnPrincipal.setBackgroundResource(R.drawable.est_premier_goles);\n\t\t\t}", "private javax.swing.JButton getJButton10() {\n\t\tif(jButton10 == null) {\n\t\t\tjButton10 = new javax.swing.JButton();\n\t\t\tjButton10.setPreferredSize(new java.awt.Dimension(120,40));\n\t\t\tjButton10.setBackground(new java.awt.Color(226,226,222));\n\t\t\tjButton10.setText(\"F10 Gaveta\");\n\t\t\tjButton10.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.BOLD, 10));\n\t\t\tjButton10.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n\t\t\tjButton10.setMargin(new Insets(1,2,1,1));\n\t\t}\n\t\treturn jButton10;\n\t}", "public void modifyButtons(int i)\n\t{\n\t\t{\n\t\t\tif (colorList.get(i) == 0)\n\t\t\t{\n\t\t\t\tbuttonList.get(i).setBackground(RED);\n\t\t\t\tredLeft--;\n\t\t\t\tredRemaining.setText(\"Red: \" + redLeft);\n\t\t\t}\n\t\t\telse if (colorList.get(i) == 1)\n\t\t\t{\n\t\t\t\tbuttonList.get(i).setBackground(BLUE);\n\t\t\t\tblueLeft--;\n\t\t\t\tblueRemaining.setText(\"Blue: \" + blueLeft);\n\t\t\t}\n\t\t\telse if (colorList.get(i) == 2)\n\t\t\t{\n\t\t\t\tbuttonList.get(i).setBackground(YELLOW);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbuttonList.get(i).setBackground(Color.black);\n\t\t\t\tJOptionPane.showMessageDialog(new JFrame(), \"You lose!\");\n\t\t\t}\n\t\t\tbuttonList.get(i).setForeground(Color.white);\n\t\t}\n\t}", "private javax.swing.JButton getJButton6() {\n\t\tif(jButton6 == null) {\n\t\t\tjButton6 = new javax.swing.JButton();\n\t\t\tjButton6.setPreferredSize(new java.awt.Dimension(120,40));\n\t\t\tjButton6.setBackground(new java.awt.Color(226,226,222));\n\t\t\tjButton6.setMargin(new Insets(1,2,1,1));\n\t\t\tjButton6.setText(\"F6 Colocar en Espera\");\n\t\t\tjButton6.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.BOLD, 10));\n\t\t\tjButton6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n\t\t}\n\t\treturn jButton6;\n\t}", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tString command =e.getActionCommand();\r\n\t\t\t\t\tJButton button =(JButton) e.getSource();\r\n\t\t\t\t\tif(command.equals(\"north\")) {\r\n\t\t\t\t\t\tbutton.setBackground(Color.gray);\r\n\t\t\t\t }\telse if (command.equals(\"south\")) {\r\n\t\t\t\t\t\tbutton.setBackground(Color.BLUE);\r\n\t\t\t\t\t}else if (command.equals(\"east\")) {\r\n\t\t\t\t\t\tbutton.setBackground(Color.yellow);\r\n\t\t\t\t\t}else if (command.equals(\"center\")) {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(Myframe.this,\"aa,bb,cc\");\r\n\t\t\t\t\t}else if (command.equals(\"west\")) {\r\n\t\t\t\t\t\tbutton.setBackground(Color.PINK);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}", "private void clearxuan() {\n\t\tbtn_Fourgroup6_xuan_big.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_little.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_all.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_odd.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_even.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_clear.setBackgroundResource(0);\r\n\t\tbtn_Fourgroup6_xuan_big.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_little.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_all.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_odd.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_even.setTextColor(0xffcfcfcf);\r\n\t\tbtn_Fourgroup6_xuan_clear.setTextColor(0xffcfcfcf);\r\n\r\n\t}", "private void setupButtonUI(Button b, String ff, double f, double w, Pos p, double x, double y) {\n\t\tb.setFont(Font.font(ff, f));\n\t\tb.setMinWidth(w);\n\t\tb.setAlignment(p);\n\t\tb.setLayoutX(x);\n\t\tb.setLayoutY(y);\n\t}", "private void setupSayAgainButton() {\n\t\tImageIcon sayagain_button_image = new ImageIcon(parent_frame.getResourceFileLocation() + \"sayagain.png\");\n\t\tJButton sayagain_button = new JButton(\"\", sayagain_button_image);\n\t\tsayagain_button.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tinput_from_user.requestFocusInWindow();//gets focus back to the spell here field\n\t\t\t\t\n\t\t\t\t//says the word slowly\n\t\t\t\tparent_frame.getFestival().speak(words_to_spell.get(current_word_number),true);\n\n\t\t\t\t//says the sample sentence at user's preferred speed there is one @author Abby S\n\t\t\t\tif(parent_frame.getDataHandler().hasSampleSentences()){\n\t\t\t\t\tint index=parent_frame.getDataHandler().getWordlistWords().get(parent_frame.getDataHandler().getCurrentLevel()).indexOf(words_to_spell.get(current_word_number));\n\t\t\t\t\tString sentence=parent_frame.getDataHandler().getSampleSentences().get(parent_frame.getDataHandler().getCurrentLevel()).get(index);\n\t\t\t\t\tif (!sentence.trim().isEmpty()){\n\t\t\t\t\t\tparent_frame.getFestival().speak(sentence,false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tsayagain_button.addMouseListener(new VoxMouseAdapter(sayagain_button,null));\n\t\tadd(sayagain_button);\n\t\tsayagain_button.setBounds(667, 598, 177, 100);\n\t}", "public Handler(Font f)\n {\n font_var=f; //sets font as font button selected\n }", "private TextView m25232e(Context context) {\n View textView = new TextView(context);\n context = new LayoutParams(-2, -2);\n context.addRule(12, -1);\n context.addRule(14, -1);\n context.setMargins(0, 0, 0, SizeUtil.dp5);\n textView.setPadding(SizeUtil.dp20, SizeUtil.dp5, SizeUtil.dp20, SizeUtil.dp5);\n textView.setLayoutParams(context);\n textView.setText(this.options.getAcceptButtonText());\n textView.setTextColor(this.options.getAcceptButtonTextColor());\n textView.setTypeface(null, 1);\n BitmapUtil.stateBackgroundDarkerByPercentage(textView, this.options.getAcceptButtonBackgroundColor(), 30);\n textView.setTextSize(2, 18.0f);\n textView.setOnClickListener(new C57457(this));\n return textView;\n }", "public Button createButton(String text, Color color) {\n final String texthere = text;\n Button.ButtonStyle style = new Button.ButtonStyle();\n style.up = skin.getDrawable(text);\n style.down = skin.getDrawable(text);\n\n Button button = new Button(style);\n// button.s(1000,1000);\n button.pad(50);\n button.addListener(new InputListener() {\n public boolean touchDown(InputEvent event, float x, float y,\n int pointer, int button) {\n\n return true;\n }\n\n public void touchUp(InputEvent event, float x, float y,\n int pointer, int button) {\n if (texthere.equals(\"play\"))\n game.setScreen(new Person_Comp(game));\n else if (texthere.equals(\"multi\"))\n game.setScreen(new Multiplayer(game));\n else {\n }\n// game.setScreen(new Settings(game));\n }\n\n });\n return button;\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tbtnPrincipal.setBackgroundResource(R.drawable.est_premier_rojas);\n\t\t\t}", "private void setReleasedStyle() {\n this.setStyle(BUTTON_FREE);\n this.setPrefHeight(47);\n this.setLayoutY(getLayoutY() - 4);\n }", "public SimulationViewButton(String words, String language) {\n myResources = ResourceBundle.getBundle(DEFAULT_RESOURCE_PACKAGE + \"English\");\n font = myResources.getString(\"FontStylePath\");\n setText(words);\n setButtonTextFont();\n setPrefHeight(BUTTON_HEIGHT);//45\n setPrefWidth(BUTTON_WIDTH);//190\n setStyle(font);\n mouseUpdateListener();\n }", "public TextButton (String text, int textSize)\n {\n buttonText = text;\n GreenfootImage tempTextImage = new GreenfootImage (text, textSize, Color.BLACK, Color.WHITE);\n myImage = new GreenfootImage (tempTextImage.getWidth() + 8, tempTextImage.getHeight() + 8);\n myImage.setColor (Color.WHITE);\n myImage.fill();\n myImage.drawImage (tempTextImage, 4, 4);\n\n myImage.setColor (Color.BLACK);\n myImage.drawRect (0,0,tempTextImage.getWidth() + 7, tempTextImage.getHeight() + 7);\n setImage(myImage);\n }", "private javax.swing.JButton getJButton9() {\n\t\tif(jButton9 == null) {\n\t\t\tjButton9 = new javax.swing.JButton();\n\t\t\tjButton9.setPreferredSize(new java.awt.Dimension(120,40));\n\t\t\tjButton9.setBackground(new java.awt.Color(226,226,222));\n\t\t\tjButton9.setMargin(new Insets(1,2,1,1));\n\t\t\tjButton9.setText(\"F9 Cancelar\");\n\t\t\tjButton9.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n\t\t\tjButton9.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.BOLD, 10));\n\t\t\tjButton9.setActionCommand(\"Cancelar Consulta\");\n\t\t}\n\t\treturn jButton9;\n\t}", "protected void buttonUI (final Context context, final Map<Button,Integer> audios){\n final int offColor = R.color.cardview_dark_background;\n final int onColor = R.color.colorAccent;\n\n String retval = \"\";\n //Modify color of buttons in a column on click\n for (final Button btn : audios.keySet()) {\n// retval = \"\";\n btn.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n //Play audio and turn on color\n btn.setBackgroundColor(ContextCompat.getColor(context, onColor));\n MediaPlayer mp = MediaPlayer.create(btn.getContext(), audios.get(btn));\n mp.start();\n //Change color of other buttons to off\n for (Button other : audios.keySet()) {\n if (other != btn) {\n other.setBackgroundColor(ContextCompat.getColor(context, offColor));\n }\n }\n\n }\n });\n }\n }", "public void createGameButtons() {\n \tcreateGameButton(myResources.getString(\"startcommand\"), 1, GAME_BUTTON_XLOCATION, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"stopcommand\"), 0, GAME_BUTTON_XLOCATION * 3, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"speedup\"), SPEED_INCREASE, GAME_BUTTON_XLOCATION*5, GAME_BUTTON_YLOCATION);\n \tcreateGameButton(myResources.getString(\"slowdown\"), 1/SPEED_INCREASE, GAME_BUTTON_XLOCATION*7, GAME_BUTTON_YLOCATION);\n }", "private void easyOrAdvanced(){\n\t\tclearContentPane();\n\n\t\tJButton easyButton = new JButton();\n\t\teasyButton.setFont(new Font(\"Arial Black\", Font.PLAIN, 24));\n\t\teasyButton.setText(\"Beginner mode\");\n\t\teasyButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\teasyMode = true;\n\t\t\t\tif(singlePlayerGame){\n\t\t\t\t\tdecidePlayerColor();\n\t\t\t\t}\n\t\t\t\telse{ startTwoPlayerGame();\t}\n\t\t\t}\n\t\t});\n\t\tframeContent.add(easyButton);\n\t\teasyButton.setBounds(frameContent.getWidth()/4, frameContent.getHeight()/2 - frameContent.getHeight()/3, frameContent.getWidth()/2, frameContent.getHeight()/6);\n\n\t\tJButton advancedButton = new JButton();\n\t\tadvancedButton.setFont(new Font(\"Arial Black\", Font.PLAIN, 24));\n\t\tadvancedButton.setText(\"Advanced Mode\");\n\t\tadvancedButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teasyMode = false;\n\t\t\t\tif(singlePlayerGame){\n\t\t\t\t\tdecidePlayerColor();\n\t\t\t\t}\n\t\t\t\telse{ startTwoPlayerGame();}\n\t\t\t}\n\t\t});\n\t\tframeContent.add(advancedButton);\n\t\tadvancedButton.setBounds(frameContent.getWidth()/4, frameContent.getHeight()/2 + frameContent.getHeight()/10, frameContent.getWidth()/2, frameContent.getHeight()/6);\n\t}", "private void updateBtnMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_updateBtnMousePressed\n updateBtn.setBackground(Color.decode(\"#1e5837\"));\n }", "public static boolean needButtonFontMetrics() {\n return !adjustedButtonSize;\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n\n btnAdicionar.setBackground(new Color(176, 196, 222));\n btnCalcular.setBackground(new Color(176, 196, 222));\n btnLimpar.setBackground(new Color(176, 196, 222));\n btnRemover.setBackground(new Color(176, 196, 222));\n }", "private void decorateCancelButton() {\n cancelButton.setVisible(false);\n ResourceUtils.resButton(cancelButton, Res.getString(\"cancel\"));\n cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196)));\n cancelButton.setForeground(new Color(73, 113, 196));\n cancelButton.setFont(new Font(\"Dialog\", Font.BOLD, 10));\n \n cancelButton.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n cancelTransfer();\n }\n });\n \n cancelButton.addMouseListener(new MouseAdapter() {\n public void mouseEntered(MouseEvent e) {\n cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR));\n \n }\n \n public void mouseExited(MouseEvent e) {\n cancelButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));\n }\n });\n \n }", "@Override\n public void onClick(View v) {\n switch(v.getId()) {\n case R.id.button1:\n display.setText(button1.getText());\n button1.setBackgroundColor(Color.BLUE);\n reset(1);\n tuningF = getNoteFrequency(1, tuning);\n tuningIndex = 1;\n break;\n case R.id.button2:\n display.setText(button2.getText());\n button2.setBackgroundColor(Color.BLUE);\n reset(2);\n tuningF = getNoteFrequency(2, tuning);\n tuningIndex = 2;\n break;\n case R.id.button3:\n display.setText(button3.getText());\n button3.setBackgroundColor(Color.BLUE);\n reset(3);\n tuningF = getNoteFrequency(3, tuning);\n tuningIndex = 3;\n break;\n case R.id.button4:\n display.setText(button4.getText());\n button4.setBackgroundColor(Color.BLUE);\n reset(4);\n tuningF = getNoteFrequency(4, tuning);\n tuningIndex = 4;\n break;\n case R.id.button5:\n display.setText(button5.getText());\n button5.setBackgroundColor(Color.BLUE);\n reset(5);\n tuningF = getNoteFrequency(5, tuning);\n tuningIndex = 5;\n break;\n case R.id.button6:\n display.setText(button6.getText());\n button6.setBackgroundColor(Color.BLUE);\n reset(6);\n tuningF = getNoteFrequency(6, tuning);\n tuningIndex = 6;\n break;\n }\n }", "protected void resetSideButtons(){\n mFightButton.setText(\"FIGHT\");\n mPokemonButton.setText(\"POKEMON\");\n mBagButton.setText(\"BAG\");\n mRunButton.setText(\"RUN\");\n mFightButton.setBackgroundColor(PokemonApp.FIGHT_COLOR);\n mPokemonButton.setBackgroundColor(PokemonApp.POKEMON_COLOR);\n mBagButton.setBackgroundColor(PokemonApp.BAG_COLOR);\n mRunButton.setBackgroundColor(PokemonApp.RUN_COLOR);\n }", "void buttonPressed(ButtonType type);", "public void resetButtonAndText() {\n currentText = colorTxtArr[(int) (Math.random() * 5)];\n buttonColor = colorArr[(int) (Math.random() * 5)];\n colorText.setForeground(buttonColor);\n colorText.setText(currentText);\n }", "@Override\n\t\tpublic void renderButton(int mouseX, int mouseY){\n\t\t}", "private javax.swing.JButton getJButton7() {\n\t\tif(jButton7 == null) {\n\t\t\tjButton7 = new javax.swing.JButton();\n\t\t\tjButton7.setPreferredSize(new java.awt.Dimension(120,40));\n\t\t\tjButton7.setBackground(new java.awt.Color(226,226,222));\n\t\t\tjButton7.setMargin(new Insets(1,2,1,1));\n\t\t\tjButton7.setText(\"F7 Cerrar Lista\");\n\t\t\tjButton7.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.BOLD, 10));\n\t\t\tjButton7.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n\t\t}\n\t\treturn jButton7;\n\t}", "private javax.swing.JButton getJButton3() {\n\t\tif(jButton3 == null) {\n\t\t\tjButton3 = new javax.swing.JButton();\n\t\t\tjButton3.setPreferredSize(new java.awt.Dimension(120,40));\n\t\t\tjButton3.setBackground(new java.awt.Color(226,226,222));\n\t\t\tjButton3.setText(\"F3 Modificar Detalles\");\n\t\t\tjButton3.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.BOLD, 10));\n\t\t\tjButton3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n\t\t\tjButton3.setMargin(new Insets(1,2,1,1));\n\t\t\tjButton3.setActionCommand(\"F3 Modificar Detalles\");\n\t\t}\n\t\treturn jButton3;\n\t}", "public int getButtonTextSize(){\n return buttonTextSize;\n }", "protected abstract void pressedOKButton( );", "public CustomDialog button(String buttonText, Object object, String style, String name) {\n TextButton button = new TextButton(buttonText, getSkin(), style);\n button.setName(name);\n super.button(button, object);\n return this;\n }", "public void actionPerformed(ActionEvent e) {\n try {\n UIManager.setLookAndFeel(theLNFName);\n SwingUtilities.updateComponentTreeUI(theFrame);\n theFrame.pack();\n } catch (Exception evt) {\n JOptionPane.showMessageDialog(null,\n \"setLookAndFeel didn't work: \" + evt, \"UI Failure\",\n JOptionPane.INFORMATION_MESSAGE);\n previousButton.setSelected(true); // reset the GUI to agree\n }\n previousButton = thisButton;\n }", "public instructionButton()\n {\n getImage().scale(getImage().getWidth()/10, getImage().getHeight()/10);\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tsetFontClickedState(SetActivity.this, j);\n\t\t\t\t\tfont = j;\n\t\t\t\t}", "private void createOKButtons() {\n okAddButton = addOKButton(\"Add Shape\");\n okRemoveButton = addOKButton(\"Remove Shape\");\n okAddKeyframeButton = addOKButton(\"Add Keyframe\");\n okAddKeyframeTimeButton = addOKButton(\"Add Keyframe Time\");\n okRemoveKeyframeButton = addOKButton(\"Remove Keyframe\");\n okRemoveKeyframeTimeButton = addOKButton(\"Remove Keyframe Time\");\n okEditKeyframeButton = addOKButton(\"Edit Keyframe\");\n okEditKeyframeTimeButton = addOKButton(\"Edit Keyframe Time\");\n okEditKeyframeFinalButton = addOKButton(\"Edit Keyframe Final\");\n okClearShapeButton = addOKButton(\"Clear Shape\");\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tbtnPrincipal.setBackgroundResource(R.drawable.est_premier_amarillas);\n\t\t\t}", "void createButton(Button main){\n\t\tActions handler = new Actions();\r\n\t\tmain.setOnAction(handler);\r\n\t\tmain.setFont(font);\r\n\t\t//sets button preference dimensions and label \r\n\t\tmain.setPrefWidth(100);\r\n\t\tmain.setPrefHeight(60);\r\n\t\tmain.setText(\"Close\");\r\n\t}", "private void createButton() {\n this.setIcon(images.getImageIcon(fileName + \"-button\"));\n this.setActionCommand(command);\n this.setPreferredSize(new Dimension(width, height));\n this.setMaximumSize(new Dimension(width, height));\n }", "private javax.swing.JButton getJButton13() {\n\t\tif(jButton13 == null) {\n\t\t\tjButton13 = new javax.swing.JButton();\n\t\t\tjButton13.setPreferredSize(new java.awt.Dimension(120,40));\n\t\t\tjButton13.setBackground(new java.awt.Color(226,226,222));\n\t\t\tjButton13.setText(\"Modo Invitado\");\n\t\t\tjButton13.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.BOLD, 10));\n\t\t\tjButton13.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n\t\t\tjButton13.setMargin(new Insets(1,2,1,1));\n\t\t\tjButton13.setMnemonic('I');\n\t\t}\n\t\treturn jButton13;\n\t}", "public void changeColourButton(Color color) {\n //goes through to each button\n for (int i = 0; i < 7; i++) {\n Inputbuttons[i].setForeground(color);\n }\n }", "@Override\n // Method that handles the event.\n public void handle(ActionEvent event) {\n text.setText(\"Buttons are cool!\");\n Random rand = new Random();\n // Change the color of the text to a random color.\n text.setFill(Color.rgb(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256)));\n }", "protected Button CButton(String s, Color fg, Color bg) {\n Button b = new Button(s);\n b.setBackground(bg);\n b.setForeground(fg);\n b.addActionListener(this);\n return b;\n }", "private void resetButton() {\n for(int x=0;x<buttons.size();x++) {\n if(buttons.get(x).isOpaque())\n buttons.get(x).setOpaque(false);\n }\n }", "private void updateButtons() {\n\t\tsetTitle(\"Insert \" + title + \"\\t\\tPage \" + pagenum + \"/\" + MAX_PAGE);\n\t\t// update button labels\n\t\tint symbx = pageoffset;\n\t\tint stop = symbx + 9;\n\t\tint nomore = stop;\n\t\tint symsize = getSymbolSize();\n\t\tif (nomore >= symsize - 1) {\n\t\t\tnomore = symsize - 1;\n\t\t}\n\t\tfor (int buttx = 0; symbx <= stop; symbx++) {\n\t\t\t// Log.d(\"SymbolDialog - updateButtons\", \"buttx: \" + buttx +\n\t\t\t// \" symbx: \" + symbx);\n\t\t\tif (symbx > nomore) {\n\t\t\t\t((TextView) mainview.findViewById(buttons[buttx])).setText(\"\");\n\t\t\t} else {\n\t\t\t\t((TextView) mainview.findViewById(buttons[buttx]))\n\t\t\t\t\t\t.setText(String.valueOf(getSymbol(symbx)));\n\t\t\t}\n\t\t\tbuttx++;\n\t\t}\n\t}", "private ButtonPane()\r\n\t\t\t{ super(new String[]{\"OK\",\"Cancel\"},1,2); }", "private JButton getColorButton() {\r\n\t\tif (colorButton == null) {\r\n\t\t\tcolorButton = new JButton(); \r\n\t\t\tcolorButton.setIcon(new ImageIcon(getClass().getResource(\"/img/icon/rtf_choosecolor.gif\")));\r\n\t\t\tcolorButton.setPreferredSize(new Dimension(23, 23));\r\n\t\t\tcolorButton.setBounds(new Rectangle(16, 1, 23, 20));\r\n\t\t\tcolorButton.setToolTipText(\"颜色编辑\");\r\n\t\t\tcolorButton.setActionCommand(\"colorButton\");\r\n\t\t\tcolorButton.addActionListener(this.buttonAction);\r\n\t\t}\r\n\t\treturn colorButton;\r\n\t}", "public static String _butcolor_click() throws Exception{\nmostCurrent._butpatas.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 101;BA.debugLine=\"butColor.Visible = False\";\nmostCurrent._butcolor.setVisible(anywheresoftware.b4a.keywords.Common.False);\n //BA.debugLineNum = 103;BA.debugLine=\"lblFondo.Initialize(\\\"\\\")\";\nmostCurrent._lblfondo.Initialize(mostCurrent.activityBA,\"\");\n //BA.debugLineNum = 104;BA.debugLine=\"lblFondo.Color = Colors.ARGB(30,255,94,94)\";\nmostCurrent._lblfondo.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int) (30),(int) (255),(int) (94),(int) (94)));\n //BA.debugLineNum = 105;BA.debugLine=\"Activity.AddView(lblFondo,0,0,100%x,100%y)\";\nmostCurrent._activity.AddView((android.view.View)(mostCurrent._lblfondo.getObject()),(int) (0),(int) (0),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (100),mostCurrent.activityBA));\n //BA.debugLineNum = 107;BA.debugLine=\"panelPopUps_1.Initialize(\\\"\\\")\";\nmostCurrent._panelpopups_1.Initialize(mostCurrent.activityBA,\"\");\n //BA.debugLineNum = 108;BA.debugLine=\"panelPopUps_1.LoadLayout(\\\"lay_Mosquito_PopUps\\\")\";\nmostCurrent._panelpopups_1.LoadLayout(\"lay_Mosquito_PopUps\",mostCurrent.activityBA);\n //BA.debugLineNum = 110;BA.debugLine=\"lblPopUp_Descripcion.Text = \\\"A simple vista se ve\";\nmostCurrent._lblpopup_descripcion.setText(BA.ObjectToCharSequence(\"A simple vista se ve\"+anywheresoftware.b4a.keywords.Common.CRLF+\"de color negro intenso\"));\n //BA.debugLineNum = 111;BA.debugLine=\"imgPopUp.Bitmap = LoadBitmap(File.DirAssets,\\\"mosq\";\nmostCurrent._imgpopup.setBitmap((android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.LoadBitmap(anywheresoftware.b4a.keywords.Common.File.getDirAssets(),\"mosquito_Color.png\").getObject()));\n //BA.debugLineNum = 112;BA.debugLine=\"imgPopUp.Visible = True\";\nmostCurrent._imgpopup.setVisible(anywheresoftware.b4a.keywords.Common.True);\n //BA.debugLineNum = 113;BA.debugLine=\"Activity.AddView(panelPopUps_1, 15%x, 15%y, 70%x,\";\nmostCurrent._activity.AddView((android.view.View)(mostCurrent._panelpopups_1.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (15),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (15),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (70),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (70),mostCurrent.activityBA));\n //BA.debugLineNum = 114;BA.debugLine=\"End Sub\";\nreturn \"\";\n}", "@Override\n public void actionPerformed(ActionEvent e) {\n String s = e.getActionCommand();\n if(s.equals(\"vcc3\"))\n {\n if(ic14.getText().equals(\"14\"))\n {\n ic14.setText(\" v\");\n ic14.setBackground(Color.red);\n }\n else\n {\n ic14.setText(\"14\");\n ic14.setBackground(null);\n ic1.setText(\" 1\");\n ic2.setText(\" 2\");\n ic3.setText(\" 3\");\n ic4.setText(\" 4\");\n ic5.setText(\" 5\");\n ic6.setText(\" 6\");\n ic8.setText(\" 8\");\n ic9.setText(\" 9\");\n ic10.setText(\"10\");\n ic11.setText(\"11\");\n ic12.setText(\"12\");\n ic13.setText(\"13\");\n \n }\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n ic1.setText(\" x\");\n ic2.setText(\" x\");\n ic3.setText(\" x\");\n ic4.setText(\" x\");\n ic5.setText(\" x\");\n ic6.setText(\" x\");\n ic8.setText(\" x\");\n ic9.setText(\" x\");\n ic10.setText(\" x\");\n ic11.setText(\" x\");\n ic12.setText(\" x\");\n ic13.setText(\" x\");\n \n \n }\n }\n else if(s.equals(\"gr3\"))\n {\n if(ic7.getText().equals(\" 7\"))\n {\n ic7.setText(\"G\");\n ic7.setBackground(Color.GRAY);\n }\n else\n {\n ic7.setText(\" 7\");\n ic7.setBackground(null);\n ic1.setText(\" 1\");\n ic2.setText(\" 2\");\n ic3.setText(\" 3\");\n ic4.setText(\" 4\");\n ic5.setText(\" 5\");\n ic6.setText(\" 6\");\n ic8.setText(\" 8\");\n ic9.setText(\" 9\");\n ic10.setText(\"10\");\n ic11.setText(\"11\");\n ic12.setText(\"12\");\n ic13.setText(\"13\");\n }\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n ic1.setText(\" x\");\n ic2.setText(\" x\");\n ic3.setText(\" x\");\n ic4.setText(\" x\");\n ic5.setText(\" x\");\n ic6.setText(\" x\");\n ic8.setText(\" x\");\n ic9.setText(\" x\");\n ic10.setText(\" x\");\n ic11.setText(\" x\");\n ic12.setText(\" x\");\n ic13.setText(\" x\");\n \n \n }\n \n \n }\n else if(s.equals(\"ic1\"))\n {\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic1.getText().equals(\" x\"))\n {\n ic1.setText(\" 1\");ic3.setText(\" x\");\n }\n else if(ic1.getText().equals(\" 1\"))\n {\n ic1.setText(\" 0\");ic3.setText(\" x\");\n }\n else\n {\n ic1.setText(\" x\");ic3.setText(\" x\");\n \n }\n \n }\n else\n {\n connect3();\n }\n }\n else if(s.equals(\"ic2\"))\n {\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic2.getText().equals(\" x\"))\n {\n ic2.setText(\" 1\");ic3.setText(\" x\");\n }\n else if(ic2.getText().equals(\" 1\"))\n {\n ic2.setText(\" 0\");ic3.setText(\" x\");\n }\n else\n {\n ic2.setText(\" x\");ic3.setText(\" x\");\n \n }\n }\n else\n {\n connect3();\n }\n \n }\n else if(s.equals(\"ic4\"))\n {\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic4.getText().equals(\" x\"))\n {\n ic4.setText(\" 1\");ic6.setText(\" x\");\n }\n else if(ic4.getText().equals(\" 1\"))\n {\n ic4.setText(\" 0\");ic6.setText(\" x\");\n }\n else\n {\n ic4.setText(\" x\");ic6.setText(\" x\");\n \n }\n }\n else\n {\n connect3();\n }\n }\n else if(s.equals(\"ic5\"))\n {\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic5.getText().equals(\" x\"))\n {\n ic5.setText(\" 1\");ic6.setText(\" x\");\n }\n else if(ic5.getText().equals(\" 1\"))\n {\n ic5.setText(\" 0\");ic6.setText(\" x\");\n }\n else\n {\n ic5.setText(\" x\");ic6.setText(\" x\");\n \n }\n \n }\n else\n {\n connect3();\n }\n }\n else if(s.equals(\"ic9\"))\n {\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic9.getText().equals(\" x\"))\n {\n ic9.setText(\" 1\");ic8.setText(\" x\");\n }\n else if(ic9.getText().equals(\" 1\"))\n {\n ic9.setText(\" 0\");ic8.setText(\" x\");\n }\n else\n {\n ic9.setText(\" x\");ic8.setText(\" x\");\n \n }\n }\n else\n {\n connect3();\n }\n }\n else if(s.equals(\"ic10\"))\n {\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic10.getText().equals(\" x\"))\n {\n ic10.setText(\" 1\");ic8.setText(\" x\");\n }\n else if(ic10.getText().equals(\" 1\"))\n {\n ic10.setText(\" 0\");ic8.setText(\" x\");\n }\n else\n {\n ic10.setText(\" x\");ic8.setText(\" x\");\n \n }\n \n }\n else\n {\n connect3();\n }\n }\n else if(s.equals(\"ic12\"))\n {\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic12.getText().equals(\" x\"))\n {\n ic12.setText(\" 1\");ic11.setText(\" x\");\n }\n else if(ic12.getText().equals(\" 1\"))\n {\n ic12.setText(\" 0\");ic11.setText(\" x\");\n }\n else\n {\n ic12.setText(\" x\");ic11.setText(\" x\");\n \n }\n }\n else\n {\n connect3();\n }\n }\n else if(s.equals(\"ic13\"))\n {\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic13.getText().equals(\" x\"))\n {\n ic13.setText(\" 1\");ic11.setText(\" x\");\n }\n else if(ic13.getText().equals(\" 1\"))\n {\n ic13.setText(\" 0\");ic11.setText(\" x\");\n }\n else\n {\n ic13.setText(\" x\");ic11.setText(\" x\");\n \n }\n \n }\n else\n {\n connect3();\n }\n }\n if(ic14.getText().equals(\" v\")&&ic7.getText().equals(\"G\"))\n {\n if(ic1.getText().equals(\" 0\")&&ic2.getText().equals(\" 0\"))\n {\n ic3.setText(\" 0\");\n \n }\n else if(ic1.getText().equals(\" x\")||ic2.getText().equals(\" x\"))\n {\n \n ic3.setText(\" x\");\n }\n else\n {\n ic3.setText(\" 1\");\n }\n if(ic4.getText().equals(\" 0\")&&ic5.getText().equals(\" 0\"))\n {\n ic6.setText(\" 0\");\n \n }\n else if(ic4.getText().equals(\" x\")||ic5.getText().equals(\" x\"))\n {\n \n ic6.setText(\" x\");\n }\n else\n {\n ic6.setText(\" 1\");\n }\n if(ic9.getText().equals(\" 0\")&&ic10.getText().equals(\" 0\"))\n {\n ic8.setText(\" 0\");\n \n }\n else if(ic9.getText().equals(\" x\")||ic10.getText().equals(\" x\"))\n {\n \n ic8.setText(\" x\");\n }\n else\n {\n ic8.setText(\" 1\");\n }\n if(ic13.getText().equals(\" 0\")&&ic12.getText().equals(\" 0\"))\n {\n ic11.setText(\" 0\");\n \n }\n else if(ic13.getText().equals(\" x\")||ic12.getText().equals(\" x\"))\n {\n \n ic11.setText(\" x\");\n }\n else\n {\n ic11.setText(\" 1\");\n }\n }\n }", "private void createButtons() {\n Texture playButtonIdle, playButtonPressed,settingsButtonIdle, settingsButtonPressed, creditsButtonIdle, creditsButtonPressed;\n\n if(game.getLocale().getCountry().equals(\"FI\")){\n playButtonIdle = game.getAssetManager().get(\"BUTTONS/button_startgame_FIN.png\");\n playButtonPressed = game.getAssetManager().get(\"BUTTONS/button_startgame_FIN_PRESSED.png\");\n\n settingsButtonIdle = game.getAssetManager().get(\"BUTTONS/button_startsettings_FIN.png\");\n settingsButtonPressed = game.getAssetManager().get(\"BUTTONS/button_startsettings_FIN_PRESSED.png\");\n\n creditsButtonIdle = game.getAssetManager().get(\"BUTTONS/button_credits_FIN.png\");\n creditsButtonPressed = game.getAssetManager().get(\"BUTTONS/button_credits_FIN_PRESSED.png\");\n }else{\n playButtonIdle = game.getAssetManager().get(\"BUTTONS/button_startgame_ENG.png\");\n playButtonPressed = game.getAssetManager().get(\"BUTTONS/button_startgame_ENG_PRESSED.png\");\n\n settingsButtonIdle = game.getAssetManager().get(\"BUTTONS/button_startsettings_ENG.png\");\n settingsButtonPressed = game.getAssetManager().get(\"BUTTONS/button_startsettings_ENG_PRESSED.png\");\n\n creditsButtonIdle = game.getAssetManager().get(\"BUTTONS/button_credits_ENG.png\");\n creditsButtonPressed = game.getAssetManager().get(\"BUTTONS/button_credits_ENG_PRESSED.png\");\n }\n\n ImageButton playButton = new ImageButton(new TextureRegionDrawable(new TextureRegion(playButtonIdle)), new TextureRegionDrawable(new TextureRegion(playButtonPressed)));\n\n playButton.setPosition(95, 12);\n stage.addActor(playButton);\n\n playButton.addListener(new ChangeListener() {\n // This method is called whenever the actor is clicked. We override its behavior here.\n @Override\n public void changed(ChangeEvent event, Actor actor) {\n game.setScreen(gameScreen);\n }\n });\n\n ImageButton settingsButton = new ImageButton(new TextureRegionDrawable(new TextureRegion(settingsButtonIdle)), new TextureRegionDrawable(new TextureRegion(settingsButtonPressed)));\n\n settingsButton.setPosition(175, 12);\n stage.addActor(settingsButton);\n\n settingsButton.addListener(new ChangeListener() {\n // This method is called whenever the actor is clicked. We override its behavior here.\n @Override\n public void changed(ChangeEvent event, Actor actor) {\n game.setScreen(new OptionsScreen(game));\n }\n });\n\n ImageButton creditsButton = new ImageButton(new TextureRegionDrawable(new TextureRegion(creditsButtonIdle)), new TextureRegionDrawable(new TextureRegion(creditsButtonPressed)));\n\n creditsButton.setPosition(15, 12);\n stage.addActor(creditsButton);\n\n creditsButton.addListener(new ChangeListener() {\n // This method is called whenever the actor is clicked. We override its behavior here.\n @Override\n public void changed(ChangeEvent event, Actor actor) {\n game.setScreen(new CreditsScreen(game));\n }\n });\n }", "@Override\n public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta) {\n }", "public void buttonPressed(){\r\n\t\tsetBorder(new BevelBorder(10));\r\n\t}", "public void menuRadioButtonListener(ActionEvent ae) {\r\n // Get the current font.\r\n Font textFont = workSpace.getFont();\r\n // Retrieve the font name and size.\r\n String fontName = textFont.getName();\r\n\r\n if (monoButton.isSelected()) {\r\n fontName = \"Monospaced\";\r\n } else if (serifButton.isSelected()) {\r\n fontName = \"Serif\";\r\n } else if (sansSerifButton.isSelected()) {\r\n fontName = \"SansSerif\";\r\n }\r\n\r\n workSpace.setFont(Font.font(fontName));\r\n }", "private JButton getJButton1() {\n\t\tif (edit_button == null) {\n\t\t\tedit_button = new JButton();\n\t\t\tedit_button.setMnemonic(java.awt.event.KeyEvent.VK_E);\n\t\t\tedit_button.setText(Locale.getString(\"EDIT\"));\n\t\t}\n\t\treturn edit_button;\n\t}" ]
[ "0.6560085", "0.6255243", "0.61988276", "0.60727465", "0.60717565", "0.6059787", "0.60314894", "0.59975225", "0.5940784", "0.590519", "0.5886354", "0.5833242", "0.58213615", "0.5814609", "0.5811493", "0.57950586", "0.5793128", "0.5787113", "0.57822645", "0.57785296", "0.5775782", "0.5771959", "0.57464916", "0.57359743", "0.57191324", "0.5713666", "0.57074404", "0.57010263", "0.56995094", "0.56950134", "0.5692141", "0.56648326", "0.5663222", "0.5660024", "0.5648504", "0.5646536", "0.5629193", "0.56277287", "0.5620312", "0.5614149", "0.5613306", "0.56122154", "0.56094223", "0.56048614", "0.56020844", "0.55952734", "0.55947596", "0.5589949", "0.5582937", "0.55828243", "0.5578496", "0.5577505", "0.55627394", "0.55595696", "0.55595076", "0.5553839", "0.5551876", "0.55460113", "0.55310637", "0.5527708", "0.55256057", "0.5520035", "0.5517358", "0.5515972", "0.5511532", "0.55114883", "0.5510554", "0.54928", "0.5491173", "0.5487486", "0.5482486", "0.5481352", "0.5481351", "0.5480218", "0.54772365", "0.5477012", "0.5474102", "0.54732317", "0.5471791", "0.5468418", "0.5462414", "0.5456643", "0.54559124", "0.5455815", "0.5455784", "0.54546446", "0.5451904", "0.5449414", "0.54491156", "0.54386145", "0.5435263", "0.54347575", "0.5434653", "0.5434413", "0.54319537", "0.5431539", "0.5422949", "0.5417531", "0.5414726", "0.5409183", "0.5404693" ]
0.0
-1
TODO Autogenerated method stub
@Override public void Callback() { if (ViewScene.m_interface != null) { screenFade.run(); ViewScene.m_interface.UpdateInfo(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Created by lby on 9/7/2018.
public interface LogFileOperateApi { void writeLogFile(List<LogModel> list); List<LogModel> readLogFile(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public int describeContents() { return 0; }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n public void init() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "private void m50366E() {\n }", "@Override\n void init() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n public void init() {}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "public void mo4359a() {\n }", "protected boolean func_70814_o() { return true; }", "public void gored() {\n\t\t\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private void init() {\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void initialize() { \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "private TMCourse() {\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n\tprotected void initialize() {\n\t}" ]
[ "0.59833777", "0.57256705", "0.57253087", "0.56657743", "0.5633637", "0.56083333", "0.56048274", "0.56048274", "0.55998904", "0.5521637", "0.5499145", "0.54761887", "0.5468524", "0.5460587", "0.5458139", "0.5448702", "0.54445815", "0.5425761", "0.540499", "0.53991777", "0.539799", "0.539799", "0.539799", "0.539799", "0.539799", "0.539799", "0.5391703", "0.5388682", "0.5388459", "0.53806645", "0.53675467", "0.53660536", "0.5365911", "0.5365911", "0.5365911", "0.5365911", "0.5365911", "0.5365844", "0.5363423", "0.53529346", "0.533283", "0.53238344", "0.532234", "0.5315257", "0.5315257", "0.53098977", "0.5308229", "0.53081936", "0.53065646", "0.52982396", "0.5296388", "0.52962035", "0.52935684", "0.5288161", "0.5268806", "0.5258411", "0.5258411", "0.5252929", "0.5252157", "0.52508616", "0.5250439", "0.5250439", "0.5250439", "0.5242353", "0.5242337", "0.5242337", "0.5242312", "0.523591", "0.523591", "0.523591", "0.5227577", "0.5220073", "0.5206629", "0.5196889", "0.51937866", "0.51914185", "0.51914185", "0.51914185", "0.5188737", "0.51850295", "0.51771164", "0.5175557", "0.5171209", "0.5169996", "0.5165438", "0.5162931", "0.5159297", "0.5159297", "0.5159297", "0.5159297", "0.5159297", "0.5159297", "0.5159297", "0.51553017", "0.5154087", "0.5148379", "0.5145695", "0.5145695", "0.5145695", "0.5142253", "0.5142218" ]
0.0
-1
Lager en ny Spiller.
public Spiller(Brett brett) { this.brett = brett; brikke = new Brikke(brett.finnRute("start")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void skrivUtSpiller() {\r\n\t\tSystem.out.println(\"Spiller \" + id + \": \" + navn + \", har \" + poengsum + \" poeng\");\r\n\t}", "public void spillTrekk(List<Terning> terninger) {\n Integer sum = 0;\n for (Terning terning : terninger) {\n terning.trill();\n sum += terning.getVerdi();\n }\n Rute plass = brikke.getPlass();\n plass = brett.finnRute(plass, sum);\n brikke.setPlass(plass);\n }", "@Override\r\n\tpublic void loeschen() {\r\n//\t\tsuper.leuchterAbmelden(this);\r\n\t\tsuper.loeschen();\r\n\t}", "Spill(){\n\n\t\tin = new Scanner(System.in); \n\t\tspiller = new Spiller(in.nextLine()); \n\t\tdatamaskin = new Spiller(\"Datamaskin\"); // oppretter en datamaskin-spiller\n\t\tspillSteinSaksPapir();\n\t}", "@Override\n\tvoid ligar() {\n\t\tsuper.ligar();\n\t\tSystem.out.println(\"Automovel ligando\");\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "private void limpa() {\n\t\t// limpa Alfabeto\n\t\tsimbolos.limpar();\n\t\t// limpa conjunto de estados\n\t\testados.limpar();\n\t\t// limpa Funcao Programa\n\t\tfuncaoPrograma.limpar();\n\t\t// Limpa estados finais\n\t\testadosFinais.limpar();\n\t}", "public void schritt() {\r\n\t\tfor (int i = 0; i < anzahlRennautos; i++) {\r\n\t\t\tlisteRennautos[i].fahren(streckenlaenge);\r\n\t\t}\r\n\t}", "public void starteSpiel(int pAnzahl){\n\n this.anzahl = pAnzahl;\n\n spielerRing = new Ring<>();\n for (int i = 0; i < pAnzahl; i++) {\n spielerRing.insert(new Spieler(i));\n }\n\n Spieler startSpieler = null;\n while (startSpieler==null) {\n\n //verteile Steine\n int count = 0;\n while (count < pAnzahl) {\n Spieler spieler = this.spielerRing.getContent();\n spieler.loescheAlleSteine();\n for (int i = 0; i < 6; i++) {\n spieler.addStein(beutel.gibStein());\n }\n this.spielerRing.next();\n count++;\n }\n\n //bestimme Startspieler\n int startWert = 0;\n count=0;\n while (count < pAnzahl) {\n Spieler spieler = this.spielerRing.getContent();\n int wert = spieler.gibStartWert();\n if (wert>startWert){\n startWert = wert;\n if (wert>2)\n startSpieler = spieler;\n }\n this.spielerRing.next();\n count++;\n }\n\n if (startSpieler!=null)\n startSpieler.setzeAktiv(true);\n }\n }", "public void sendeSpielfeld();", "public Spiller(int id, String navn) {\r\n\t\tthis.id = id;\r\n\t\tthis.navn = navn;\r\n\t\tpoengsum = 0;\r\n\t}", "private void sterben()\n {\n lebendig = false;\n if(position != null) {\n feld.raeumen(position);\n position = null;\n feld = null;\n }\n }", "public void sendeNeuerSpieler(String spieler);", "private void obsluga_pilek()\n {\n if (liczba_pilek > 0)\n {\n i++;\n if (i%50==0)\n {\n p.add(new Pilka(w.getPolozenie_x(), w.getPolozenie_y(), getWidth(), getHeight(), rozmiar_pilki));\n liczba_pilek--;\n }\n }\n }", "public void sendeSpielerWeg(String spieler);", "private void heilenTrankBenutzen() {\n LinkedList<Gegenstand> gegenstaende = spieler.getAlleGegenstaende();\n for (Gegenstand g : gegenstaende) {\n if (g.getName().equalsIgnoreCase(\"heiltrank\")) {\n spieler.heilen();\n gegenstaende.remove(g);\n System.out.print(\"Heiltrank wird benutzt\");\n makePause();\n System.out.println(\"Du hast noch \" + zaehltGegenstand(\"heiltrank\") + \" Heiltranke!\");\n return;\n }\n }\n System.out.println(\"Du hast gerade keinen Heiltrank\");\n }", "protected boolean laufEinfach(){ \r\n\r\n\t\tint groessteId=spieler.getFigur(0).getPosition().getId();\r\n\t\tint figurId=0; // Figur mit der gr��ten ID\r\n\t\t\r\n\t\t\r\n\t\tfor(int i=1; i<4; i++)\r\n\t\t{ \r\n\t\t\tint neueId;\r\n\t\t\tneueId = spieler.getFigur(i).getPosition().getId() + spiel.getBewegungsWert();\r\n\t\t\tif(spieler.getFigur(i).getPosition().getTyp() != FeldTyp.Startfeld && groessteId<spieler.getFigur(i).getPosition().getId()){\r\n\t\t\t\tgroessteId=spieler.getFigur(i).getPosition().getId();\r\n\t\t\t\tfigurId=i;\r\n\t\t\t}\r\n\t\t\tneueId = spiel.ueberlauf(neueId, i);\r\n\t\t\tif (spieler.getFigur(i).getPosition().getTyp() == FeldTyp.Endfeld) {\r\n\t\t\t\tif (!spiel.zugGueltigAufEndfeld(neueId, i)) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tneueId = spieler.getFigur(i).getPosition().getId() + spiel.getBewegungsWert();\r\n\t\t\t\tif(spieler.getFigur(i).getPosition().getId() == spieler.getFigur(i).getFreiPosition()){\r\n\t\t\t\t\tif(!spiel.userIstDumm(neueId, i)){\r\n\t\t\t\t\t\tfigurId = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tfor(int j = 0; j < 4; j++){\r\n\t\t\t\t\t\t\tif(spieler.getFigur(j).getPosition().getId() == neueId){\r\n\t\t\t\t\t\t\t\tif(!spiel.userIstDumm(neueId+spiel.getBewegungsWert(), j)){\r\n\t\t\t\t\t\t\t\t\tfigurId = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tspiel.bewege(figurId);\r\n\t\treturn true;\r\n\t}", "public void verwerkRijVoorKassa() {\r\n while(kassarij.erIsEenRij()) {\r\n Persoon staatBijKassa = kassarij.eerstePersoonInRij();\r\n kassa.rekenAf(staatBijKassa);\r\n }\r\n }", "public Spiel()\n {\n \tspieler = new Spieler();\n \t//landkarte = new Landkarte(5);\n //landkarte.raeumeAnlegen(spieler);\n\n \tlandkarte = levelGen.generate(spieler, 5, 6, 4, 10);\n\n parser = new Parser();\n }", "public void breaker() \r\n\t{\n\t\t\r\n\t}", "private void plant(int l) {\n if (l >= empties.size()) {\n if (currentMines > bestMines) {\n copyField(current, best);\n bestMines = currentMines;\n }\n //geval 2: we zijn nog niet alle lege vakjes afgegaan, en we kunnen misschien nog beter doen dan de huidige oplossing\n } else if(currentMines + (empties.size() - l) > bestMines ) {\n //recursief verder uitwerken, met eerst de berekening van welk vakje we na (i,j) zullen behandelen\n int i = empties.get(l).getI();\n int j = empties.get(l).getJ();\n\n //probeer een mijn te leggen op positie i,j\n if (canPlace(i,j)) {\n placeMine(i, j);\n currentMines++;\n\n\n //recursie\n plant(l + 1);\n\n //hersteloperatie\n removeMine(i, j);\n currentMines--;\n\n }\n //recursief verder werken zonder mijn op positie i,j\n plant(l +1);\n }\n }", "public void snare();", "public void leggTil(Melding melding){\n laas.lock();\n try{\n if (melding == null){\n antallTelegrafister--;\n }\n else{\n meldingerKrypterte.leggTil(melding);\n }\n signal.signalAll();\n }\n finally{\n laas.unlock();\n }\n }", "public MilitaerResept(Legemiddel legem, Lege utskrLege, Pasient pas, int rt) {\n super(legem, utskrLege, pas, rt);\n }", "public void livrosLer(Livro livro){\n\n Boolean enviar = true;\n\n LivroLer livroLer = new LivroLer();\n\n //setando o valor do id livroler\n livroLer.setIdLivro(livro.getId());\n\n //for para saber se o livro já foi enviado para livros lidos\n if(myBooksDb.daoLivroLer().idLivros(livro.getId()) == livro.getId()){\n enviar = false;\n Toast.makeText(getContext(),\"O livro já se encontra em meus livros\", Toast.LENGTH_SHORT).show();\n }\n //verificar se o livro esta em outra tela\n else if(myBooksDb.daoLivrosLidos().idLivros(livro.getId()) == livro.getId()){\n enviar = false;\n tranferirLer(livro.getId(),livroLer);\n }\n\n if(enviar == true){\n myBooksDb.daoLivroLer().inserir(livroLer);\n }\n\n }", "public void llenarInformacion(){\n llenarDetalles();\n llenarLogros();\n }", "private void poetries() {\n\n\t}", "private void add(Himmelskoerper himmelskoerper, Modul m) {\r\n\t\tthis.ladung.put(himmelskoerper, m);\r\n\t\tthis.aktuelleLast += m.getGewicht();\r\n\r\n\t\tif (this.schwerstesModul == null || this.schwerstesModul.getGewicht() < m.getGewicht()) {\r\n\t\t\tthis.schwerstesModul = m;\r\n\t\t}\r\n\t}", "@Override\n\tpublic Departamento leer(Integer id) {\n\t\treturn null;\n\t}", "public Speler schuifGangkaartIn(int positie, int richting)\n {\n positie = positie - 1;\n Gangkaart oudeKaart;\n switch (richting)\n {\n case 1:\n for (int rij = 0; rij < gangkaarten.length; rij++)\n {\n oudeKaart = gangkaarten[positie][rij];\n gangkaarten[positie][rij] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 2:\n for (int rij = gangkaarten.length - 1; rij >= 0; rij--)\n {\n oudeKaart = gangkaarten[positie][rij];\n gangkaarten[positie][rij] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 3:\n for (int kolom = 0; kolom < gangkaarten.length; kolom++)\n {\n oudeKaart = gangkaarten[kolom][positie];\n gangkaarten[kolom][positie] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 4:\n for (int kolom = gangkaarten.length - 1; kolom >= 0; kolom--)\n {\n oudeKaart = gangkaarten[kolom][positie];\n gangkaarten[kolom][positie] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n }\n Speler speler = null;\n if (vrijeGangkaart.getSpeler() != null)\n {\n int[] pos = {-1,-1};\n speler = vrijeGangkaart.getSpeler();\n vrijeGangkaart.setSpeler(null);\n switch(richting)\n {\n case 1: pos[0] = positie;\n pos[1] = 0;\n speler.setPositie(pos);\n gangkaarten[positie][0].setSpeler(speler);\n break;\n case 2: pos[0] = positie;\n pos[1] = 6;\n speler.setPositie(pos);\n gangkaarten[positie][6].setSpeler(speler);\n break;\n case 3: pos[0] = 0;\n pos[1] = positie;\n gangkaarten[0][positie].setSpeler(speler);\n break;\n case 4: pos[0] = 6;\n pos[1] = positie;\n speler.setPositie(pos);\n gangkaarten[6][positie].setSpeler(speler);\n break;\n }\n }\n return speler;\n\n }", "public void wuerfeln() {\n if (istGefängnis) {\n setIstGefängnis(false);\n if (aktuellesFeldName instanceof GefängnisFeld && !(aktuellesFeldName instanceof NurZuBesuchFeld)) {\n GefängnisFeld g = (GefängnisFeld) aktuellesFeldName;\n g.gefaengnisAktion(this);\n \n return;\n }\n\n } else {\n String[] worte = {\"Eins\", \"Zwei\", \"Drei\", \"Vier\", \"Fünf\", \"Sechs\", \"Sieben\", \"Acht\", \"Neun\", \"Zehn\", \"Elf\", \"Zwölf\"};\n\n wuerfelZahl = getRandomInteger(12, 1);\n\n this.aktuellesFeld = this.aktuellesFeld + wuerfelZahl + 1;\n if (this.aktuellesFeld >= 40) {\n setAktuellesFeld(0);\n\n }\n\n System.out.println(worte[wuerfelZahl] + \" gewürfelt\");\n\n aktuellesFeldName = spielfigurSetzen(this.aktuellesFeld);\n System.out.println(\"Du befindest dich auf Feld-Nr: \" + (this.aktuellesFeld));\n boolean check = false;\n for (Spielfelder s : felderInBesitz) {\n if (aktuellesFeldName.equals(s)) {\n check = true;\n }\n }\n\n if (!check) {\n aktuellesFeldName.spielfeldAktion(this, aktuellesFeldName);\n } else {\n System.out.println(\"Das Feld: \" + aktuellesFeldName.getFeldname() + \"(Nr: \" + aktuellesFeldName.getFeldnummer() + \")gehört dir!\");\n if (aktuellesFeldName instanceof Straße) {\n Straße strasse = (Straße) aktuellesFeldName;\n System.out.println(\"Farbe: \" + strasse.getFarbe());\n try {\n strasse.hausBauen(this, strasse);\n } catch (IOException ex) {\n Logger.getLogger(Spieler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n }\n }\n }", "private void nullstillFordeling(){\n int i = indeks;\n politi = -1;\n mafiaer = -1;\n venner = -1;\n mafia.nullstillSpesialister();\n spillere.tømTommeRoller();\n for (indeks = 0; roller[indeks] == null; indeks++) ;\n fordeling = null;\n }", "public void retur() {\r\n System.out.println(\"Hvem skal returnere DVD'en?\");\r\n String person = scan.nextLine().toLowerCase();\r\n if(personListe.containsKey(person)) {\r\n\r\n if (personListe.get(person).laanerSize() > 0) {\r\n System.out.println(\"Hvilken DVD skal returneres?\");\r\n String tittel = scan.nextLine();\r\n DVD dvd = personListe.get(person).hentLaanerListe().get(tittel);\r\n\r\n if(personListe.get(person).hentLaanerListe().containsKey(tittel)) {\r\n personListe.get(person).fjernFraLaaner(personListe.get(person).hentLaanerListe().get(tittel));\r\n dvd.hentEier().faaTilbake(dvd);\r\n }\r\n\r\n else {\r\n System.out.println(person + \" laaner ikke \" + tittel);\r\n }\r\n\r\n }\r\n\r\n else {\r\n System.out.println(person + \" laaner ikke noen DVD'er\");\r\n }\r\n\r\n }\r\n else {\r\n System.out.println(\"Den personen finnes ikke\");\r\n }\r\n\r\n }", "public void paintLigne(Graphics g) {\r\n g.setColor(Color.BLACK);\r\n for (int i = 0; i < this.ligne.getTailleListePoints() - 1; i++) {\r\n g.drawLine((int) this.ligne.getPoint(i).getX(), (int) this.ligne.getPoint(i).getY(),\r\n (int) this.ligne.getPoint(i + 1).getX(), (int) this.ligne.getPoint(i + 1).getY());\r\n }\r\n }", "public void ler()\n {\n lerDados( AxellIO.readLine(\"\") );\n }", "void parralellSil(){\n\t\tint lilleTabellen = (int) Math.sqrt(maxtall) + 1;\r\n\t\tTraad[] traadArray = new Traad[lilleTabellen];\r\n\r\n\r\n\t\tlong ti = System.nanoTime();\r\n\t\terastothenesSil(lilleTabellen);\r\n\t\tint counter=0;\r\n\r\n\t\tfor(int e = nextPrime(2); e<lilleTabellen; e=nextPrime(e)){\r\n\t\t\ttraadArray[counter]=new Traad(true, maxtall, bitArr, e, this, counter);\r\n\t\t\ttraadArray[counter].start();\r\n\r\n\t\t\t// System.out.println();\r\n\t\t\tcounter++;\r\n\t\t}\r\n\r\n\t\tfor(Traad e: traadArray){\r\n\t\t\ttry{\r\n\t\t\t\te.join();\r\n\t\t\t}catch(Exception y){\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlong tid = System.nanoTime();\r\n\t\tSystem.out.println(\"tid pa parralellSil: \" + ((tid-ti)/1000000.0) + \" ms\");\r\n\t\ttider.put(\"parralellSil\", ((tid-ti)/1000000.0));\r\n\r\n\t}", "@Override\n\tpublic void loese(Schiebepuzzle p) {\n\t\tPoint endPos = new Point(0,0);\n\t\twhile(!p.getLocationOfField(1).equals(endPos)) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfor(int i = 1; i <= p.maxElement(); i++) {\n\t\t\t\tif(p.istVerschiebar(i)) {\n\t\t\t\t\ttemp.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tint index = randInt(temp.size() - 1);\n\t\t\tp.schiebe(temp.get(index));\n\t\t}\t\t\n\t}", "public Melding hentMelding(){\n laas.lock();\n try{\n while(meldingerKrypterte.stoerrelse() == 0){\n if(antallTelegrafister == 0){\n return null;\n }\n signal.await();\n }\n return meldingerKrypterte.fjern(0);\n }\n catch(InterruptedException e){\n return null;\n }\n finally{\n laas.unlock();\n }\n }", "public String limpiar()\r\n/* 509: */ {\r\n/* 510:529 */ return null;\r\n/* 511: */ }", "public void laan() {\r\n if (personListe.size() > 1) {\r\n System.out.println(\"Hvem vil laane DVD'en?\");\r\n String laaner = scan.nextLine().toLowerCase();\r\n\r\n if (personListe.containsKey(laaner)) {\r\n System.out.println(\"Hvem eier DVD'en?\");\r\n String eier = scan.nextLine().toLowerCase();\r\n Person nyEier = personListe.get(eier);\r\n if (!eier.equalsIgnoreCase(laaner)) {\r\n\r\n if(personListe.containsKey(eier)) {\r\n\r\n if(personListe.get(eier).eierSize() > 0) {\r\n System.out.println(\"Hvilken DVD skal laanes?\");\r\n String tittel = scan.nextLine().toLowerCase();\r\n\r\n if(nyEier.hentEierListe().containsKey(tittel)) {\r\n\r\n if (!nyEier.hentUtlaantListe().containsKey(tittel)) {\r\n\r\n /*kaller paa laanut pa eier, laaner legger den til laaner listen,\r\n og dvd'en setter en laaner referanse */\r\n DVD dvd = nyEier.hentEierListe().get(tittel);\r\n nyEier.laanUt(dvd);\r\n personListe.get(laaner).leggTilLaaner(dvd);\r\n System.out.println(laaner + \" laaner naa \" + tittel + \" av \" + eier);\r\n }\r\n\r\n else {\r\n System.out.println(tittel + \" er allerede utlaant.\");\r\n }\r\n\r\n }\r\n\r\n else {\r\n System.out.println(eier + \" eier ikke den DVD'en\");\r\n }\r\n\r\n }\r\n\r\n else {\r\n System.out.println(eier + \" har ingen DVD'er aa laane ut\");\r\n }\r\n\r\n }\r\n\r\n else {\r\n System.out.println(eier + \" finnes ikke i systemet\");\r\n }\r\n\r\n }\r\n\r\n else {\r\n System.out.println(\"Man kan ikke laane fra seg selv!\");\r\n }\r\n\r\n }\r\n\r\n else {\r\n System.out.println(laaner + \" finnes ikke i systemet\");\r\n }\r\n }\r\n\r\n else {\r\n System.out.println(\"Ikke nok personer til a kunne laane ut en DVD!\");\r\n }\r\n\r\n }", "void enleverBrouillard(Soldat s);", "private void findeNachbarSteine(Stein pStein, java.util.List<Stein> pSteinListe, Richtung pRichtung){\n spielfeld.toFirst();\n while(spielfeld.hasAccess()){ //Schleife ueber alle Steine des Spielfelds\n Stein stein = spielfeld.getContent();\n switch(pRichtung){\n case oben:\n if (pStein.gibZeile()==stein.gibZeile()+1 && pStein.gibSpalte()==stein.gibSpalte()) {\n pSteinListe.add(stein);\n findeNachbarSteine(stein,pSteinListe,pRichtung);\n }\n break;\n case links:\n if (pStein.gibZeile()==stein.gibZeile() && pStein.gibSpalte()==stein.gibSpalte()+1) {\n pSteinListe.add(stein);\n findeNachbarSteine(stein,pSteinListe,pRichtung);\n }\n break;\n case unten:\n if (pStein.gibZeile()==stein.gibZeile()-1 && pStein.gibSpalte()==stein.gibSpalte()) {\n pSteinListe.add(stein);\n findeNachbarSteine(stein,pSteinListe,pRichtung);\n }\n break;\n case rechts:\n if (pStein.gibZeile()==stein.gibZeile() && pStein.gibSpalte()==stein.gibSpalte()-1) {\n pSteinListe.add(stein);\n findeNachbarSteine(stein,pSteinListe,pRichtung);\n }\n break;\n }\n spielfeld.next();\n }\n }", "protected boolean betreteSpielfeld(){\r\n\t\t\r\n\t\tint neueId;\r\n\t\t\r\n\t\tif(spiel.getBewegungsWert()==6)\r\n\t\t{\r\n\t\t\tfor(int i=0; i<4; i++){\r\n\t\t\t\tif(spieler.getFigur(i).getPosition().getTyp() == FeldTyp.Startfeld){\r\n\t\t\t\t\tneueId = spieler.getFigur(i).getFreiPosition();\r\n\t\t\t\t\tif(spiel.userIstDumm(neueId, i)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tspiel.bewege(i);\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public Livraison ModifierLivraison(Plan plan, Livraison liv, Date DPH, Date FPH) {\r\n\r\n\t\tif (this.getListeLivraison().contains(liv)) {\r\n\t\t\tint i = this.getListeLivraison().indexOf(liv);\r\n\t\t\tif (DPH == null || FPH == null) {\r\n\t\t\t\tliv = new Livraison(liv.getDuree(), liv.getDestination());\r\n\t\t\t} else {\r\n\t\t\t\tliv.setDebutPlageHoraire(DPH);\r\n\t\t\t\tliv.setFinPlageHoraire(FPH);\r\n\t\t\t}\r\n\t\t\tthis.getListeLivraison().set(i, liv);\r\n\r\n\t\t} else {\r\n\t\t\tSystem.err.println(\"ERREUR ! La livraison ne fait pas partie de la tournee actuelle\");\r\n\t\t\treturn liv;\r\n\t\t}\r\n\t\tthis.initTempsPassage();\r\n\t\treturn liv;\r\n\t}", "Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);", "public void nastaviIgru() {\r\n\t\t// nastavi igru poslije pobjede\r\n\t\tigrajPoslijePobjede = true;\r\n\t}", "public Endbildschirm(Spiel s) {\r\n\t\tdasSpiel = s;\r\n\r\n\t}", "private boolean analyseQueryBefore(Spieler spieler,Spieler spielerB, Board board) {\r\n\t\t// Switch mit der Spielphase des Spielers\r\n\t\tboolean back = false;\r\n\t\tswitch (spieler.getSpielPhase()) {\r\n\t\t\tcase 0: \t// Werte nur Regel 1 aus\r\n\t\t\t\t\t\tList<Stein> rueckgabe = this.logikCheck.sucheZweiInGleicherReihe(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!rueckgabe.isEmpty() && !rueckgabe.get(0).equals(new Stein(0,0,0, null))) {\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe.get(0));\r\n\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\tcase 1:\t\tfor(Regel regel: uebergreifendeRegeln) {\r\n\t\t\t\t\t\t\tif(regel.getIfTeil().contains(\"eigene Steine\")) {\r\n\t\t\t\t\t\t\t\tList<Stein> getDataBack = this.logikCheck.sucheZweiGleicheReiheUnddrittenSteinDazu(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\t\t\tif(!getDataBack.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\tStein stein = getDataBack.get(1);\r\n\t\t\t\t\t\t\t\t\tdataBack.add(stein);\r\n\t\t\t\t\t\t\t\t\tFeld nachbarn = stein.convertToFeld();\r\n\t\t\t\t\t\t\t\t\tList<Feld> moeglicheZuege = nachbarn.allefreienNachbarn(board);\r\n\t\t\t\t\t\t\t\t\tif(!moeglicheZuege.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\tdataBack.add(moeglicheZuege.get(0).convertToStein());\r\n\t\t\t\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tList<Stein> zweiGegner = this.logikCheck.sucheZweiInGleicherReihe(spielerB.getPosiSteine(), board);\r\n\t\t\t\t\t\t\t\tif(!zweiGegner.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\tList<Stein> result = this.logikCheck.sucheSteinInderNäheUmGegnerZuBlocken(zweiGegner, spieler);\r\n\t\t\t\t\t\t\t\t\tif(!result.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\tStein stein = result.get(0);\r\n\t\t\t\t\t\t\t\t\t\tdataBack.add(stein);\r\n\t\t\t\t\t\t\t\t\t\tFeld nachbarn = stein.convertToFeld();\r\n\t\t\t\t\t\t\t\t\t\tList<Feld> moeglicheZuege = nachbarn.allefreienNachbarn(board);\r\n\t\t\t\t\t\t\t\t\t\tif(!moeglicheZuege.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\t\tdataBack.add(moeglicheZuege.get(0).convertToStein());\r\n\t\t\t\t\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\tcase 2:\t\tList<Stein> rueckgabe2 = this.logikCheck.sucheZweiGleicheReiheUnddrittenSteinDazu(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\tif(!rueckgabe2.isEmpty()) {\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe2.get(0));\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe2.get(1));\r\n\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault: break;\t\r\n\t\t}\r\n\t\treturn back;\r\n\t}", "@Override\n public void onMoreLoadding() {\n\n }", "public void cambioLigas(){\n\t\ttry{\n\t\t\tmodelo.updatePartidosEmaitzak(ligasel.getSelectionModel().getSelectedItem().getIdLiga());\n\t\t}catch(ManteniException e){\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "public Pont ertesit(Pont innenlep, Szereplo sz);", "private void shootLaser() {\n\t\tfor(int i = 0; i<lasers.size(); i++) {\n\t\t\tif(lasers.get(i).getLayoutY() > -lasers.get(i).getBoundsInParent().getHeight() ) { //-37 wenn unterhalb des windows \n\t\t\t\tlasers.get(i).relocate(lasers.get(i).getLayoutX(), lasers.get(i).getLayoutY() - 3); //um 3 pixel nach oben bewegen\n\t\t\t}\n\t\t\telse { //wenn oberhalb des windows \n\t\t\t\t\n\t\t\t\tgamePane.getChildren().remove(lasers.get(i));\n\t\t\t\tlasers.remove(i);\n\t\t\t\tSystem.out.println(lasers.size());\n\t\t\t}\n\t\t}\n\t}", "public void ramasser(ArrayList<Loot> drop, int entree) {\n\t\tString s = drop.get(entree-1).getNom();\n\t Connection c = null;\n\t Statement select = null;\n\t try {\n\t Class.forName(\"org.postgresql.Driver\");\n\t c = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/ProjetJava\", \"postgres\", \"sql\");\n\t select = c.createStatement();\n\t ResultSet query = select.executeQuery(\"SELECT weaponDamage, lootXpValue from tbLoot WHERE lootName = \\'\"+s+\"\\'\");\n\t int weapDam = 0;\n\t int lootXp = 0;\n\t while(query.next()) {\n\t \t weapDam = query.getInt(\"weaponDamage\");\n\t \t lootXp = query.getInt(\"lootXpValue\");\n\t }\n\t if(weapDam>0) {\n\t \t if(this.getArmeDroite().getDegat() < weapDam) {\n\t \t\t System.out.println(\"Vous avez choisi : \"+s+\" / degat : \"+weapDam);\n\t \t\t Arme a = new Arme(s, weapDam);\n\t \t\t this.setArmeDroite(a);\n\t \t }else {\n\t \t\t System.out.println(\"Vous avez choisi : \"+s+\" / valeur d XP : \"+lootXp);\n\t \t\t this.ajoutXp(lootXp);\n\t \t }\n\t } else {\n\t \t System.out.println(\"Vous avez choisi : \"+s+\" / valeur d XP : \"+lootXp);\n\t \t this.ajoutXp(lootXp);\n\t }\n\t query.close();\n\t select.close();\n\t c.close();\n\t drop.remove(entree-1);\n\t } catch (Exception e) {\n\t \te.printStackTrace();\n\t System.err.println(e.getClass().getName()+\": \"+e.getMessage());\n\t System.exit(0);\n\t }\n\t}", "public void disparar(){}", "public void retireLead()\r\n\t{\r\n\t\tisleader = false;\r\n\t}", "public void print() {\r\n\t\tSystem.out.println(\"---Vrachtwagen---\");\r\n//\t\thaalt de print functie op van de class voertuigen\r\n\t\tsuper.print();\r\n//\t \tgeeft lading weer\r\n\t\tSystem.out.println(\"Lading: \" + lading);\r\n\t}", "public void fjernAlle() {\n listehode.neste = null;\n antall = 0;\n }", "public void setNumDeparting() {\n if (isStopped() && !embarkingPassengersSet){\n \tRandom rand = new Random();\n \tint n = rand.nextInt(this.numPassengers+1);\n \tif (this.numPassengers - n <= 0) {\n \t\tthis.numPassengers = 0;\n n = this.numPassengers;\n \t} else {\n this.numPassengers = this.numPassengers - n;\n }\n trkMdl.passengersUnboarded(trainID, n);\n }\n \t//return 0;\n }", "private void seePerso() {\n\t\tfor (int i = 0; i < persoList.size(); i++) {\n\t\t\tPersonnage perso = persoList.get(i);\n\t\t\tSystem.out.println(\"id : \" + i);\n\t\t\tSystem.out.println(perso);\n\t\t}\n\n\t\tSystem.out.println(\"souhaitez vous modifier un personnage ? o/n\");\n\t\tif (sc.nextLine().toLowerCase().contentEquals(\"o\")) {\n\t\t\tSystem.out.println(\"Lequel ? id\");\n\t\t\tint id = sc.nextInt();\n\t\t\tsc.nextLine();\n\t\t\tchangePerso(id);\n\t\t}\n\t}", "public Spiel(TerraSnowSpleef plugin) {\r\n this.plugin = plugin;\r\n joinCountdown = false;\r\n startCountdown = false;\r\n spiel = false;\r\n sf = new Spielfeld(plugin);\r\n spielerSet = new HashSet<>();\r\n }", "public Spieler(String spielfigur) {\n\n this.kontostand = 30000;\n this.spielfigur = spielfigur;\n this.istGefängnis = false;\n\n liste.put(\"braun\", braun);\n liste.put(\"hellblau\", hellblau);\n liste.put(\"pink\", pink);\n liste.put(\"orange\", orange);\n liste.put(\"rot\", rot);\n liste.put(\"gelb\", gelb);\n liste.put(\"grün\", grün);\n liste.put(\"duneklblau\", dunkelblau);\n liste.put(\"bahnhoefe\", bahnhoefe);\n liste.put(\"werke\", werke);\n felderInBesitz = new ArrayList<>();\n\n }", "private List<ItemMovement> uitGraven(Slot slot, Gantry gantry){\n\n List<ItemMovement> itemMovements = new ArrayList<>();\n Richting richting = Richting.NaarVoor;\n\n //Recursief naar boven gaan, doordat we namelijk eerste de gevulde parents van een bepaald slot moeten uithalen\n if(slot.getParent() != null && slot.getParent().getItem() != null){\n itemMovements.addAll(uitGraven(slot.getParent(), gantry));\n }\n\n //Slot in een zo dicht mogelijke rij zoeken\n boolean newSlotFound = false;\n Slot newSlot = null;\n int offset = 1;\n do { //TODO: als storage vol zit en NaarVoor en NaarAchter vinden geen vrije plaats => inf loop\n // bij het NaarAchter lopen uw index telkens het negatieve deel nemen, dus deze wordt telkens groter negatief.\n //AANPASSING\n Integer locatie = richting==Richting.NaarVoor? (slot.getCenterY() / 10) + offset : (slot.getCenterY() / 10) - offset;\n //we overlopen eerst alle richtingen NaarVoor wanneer deze op zen einde komt en er geen plaats meer is van richting veranderen naar achter\n // index terug op 1 zetten omdat de indexen ervoor al gecontroleerd waren\n if (grondSlots.get(locatie) == null) {\n //Grootte resetten en richting omdraaien\n offset = 1;\n richting = Richting.NaarAchter;\n continue;\n }\n\n Set<Slot> ondersteRij = new HashSet<>(grondSlots.get(locatie).values());\n newSlot = GeneralMeasures.zoekLeegSlot(ondersteRij);\n\n if(newSlot != null){\n newSlotFound = true;\n }\n //telkens één slot verder gaan\n offset += 1;\n }while(!newSlotFound);\n // vanaf er een nieuw vrij slot gevonden is deze functie verlaten\n\n //verplaatsen\n itemMovements.addAll(GeneralMeasures.createMoves(pickupPlaceDuration,gantry, slot, newSlot));\n update(Operatie.VerplaatsIntern, newSlot, slot);\n\n return itemMovements;\n }", "public void repartirGananciasDealer() {\n\t\t if(contieneJugador(ganador,\"dealer\")) {\n\t\t\t if(verificarJugadaBJ(manosJugadores.get(3))) {\n\t\t\t\t System.out.println(\"Pareja nombre agregado dealer\");\n\t\t\t\t int cantidadGanancia = verificarCantidadGanadores() + 15;\n\t\t\t\t parejaNombreGanancia.add(new Pair<String, Integer>(\"dealer\", cantidadGanancia));\n\t\t\t }else {\n\t\t\t\t System.out.println(\"Pareja nombre agregado --> dealer\");\n\t\t\t\t int cantidadGanancia = verificarCantidadGanadores()+10;\n\t\t\t\t parejaNombreGanancia.add(new Pair<String, Integer>(\"dealer\",cantidadGanancia));\n\t\t\t }\n\t\t }else {\n\t\t\t int cantidadGanancia = verificarCantidadGanadores();\n\t\t\t parejaNombreGanancia.add(new Pair<String, Integer>(\"dealer\",cantidadGanancia));\n\t\t }\n\t\t \n\t }", "public void feedArmies (WarPlayer player) {\n super.feedPersonnages(player, 1);\n System.out.println(\" III ) Armies feeded.\");\n }", "public void RuchyKlas() {\n\t\tSystem.out.println(\"RuchyKlas\");\n\t\tPlansza.getNiewolnikNaPLanszy().Ruch();\n\t\tPlansza.getRzemieslnikNaPlanszy().Ruch();\n\t\tPlansza.getArystokrataNaPlanszy().Ruch();\n\t}", "Sporthall() {\n reservationsList = new ArrayList<>();\n }", "public void stampajSpisak() {\n\t\t\n\t\tif (prviFilm != null) {\n\t\t\t\n\t\t\tFilm tekuciFilm = prviFilm;\n\t\t\tint count = 0;\n\t\t\t\n\t\t\tSystem.out.println(\"Filmovi: \");\n\t\t\t\n\t\t\twhile (tekuciFilm != null) {\n\t\t\t\t\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\"Film #\" + count + \": '\" + tekuciFilm.naziv + \"'\");\n\t\t\t\t\n\t\t\t\tif (tekuciFilm.sadrzaj == null) {\n\t\t\t\t\tSystem.out.println(\"\\tNema unetih glumaca.\");\n\t\t\t\t} else {\n\t\t\t\t\tGlumac tekuciGlumac = tekuciFilm.sadrzaj;\n\t\t\t\t\t\n\t\t\t\t\twhile (tekuciGlumac != null) {\n\t\t\t\t\t\tSystem.out.println(\"\\t\" + tekuciGlumac);\n\t\t\t\t\t\ttekuciGlumac = tekuciGlumac.veza;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttekuciFilm = tekuciFilm.veza;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"Spisak je prazan.\");\n\t\t}\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private void lanzarListadoLugares() {\n\t\tIntent i = new Intent(this, ListLugares.class);\n\t\tstartActivity(i);\n\n\t}", "public void beeindig(int gehaaldeSlagen){\n //doe het reguliere-geval\n if(rondetype.isRegulier()){\n updateScore(gehaaldeSlagen);\n }\n // doe het passpel-geval\n else{\n \n }\n }", "public Raum2 (Player spieler){\n\t\t\n\t\tlabel = new Label();\n\t\tlabel.setBounds(0, 0, 600, 600);\n\t\tThread th = new Thread(label);\n\t\tth.start();\n\t\tPlayer.update(hoch,runter,links,rechts);\n\t\tadd(label);\n\t\taddKeyListener(label);\n\t\tthis.spieler=spieler;\n\t\tspieler.lv2walls();\n\t\t\n\t\t\n\t\t\t\n\t\t}", "void parralellFakto(){\n\t\tlong tall=maxtall;\r\n\t\ttall=tall*tall;\t//tallene som skal faktoriseres\r\n\r\n\t\t//lagrer faktoriseringen\r\n\t\tArrayList<Long> fakro = new ArrayList<>();\r\n\r\n\t\tlong ti = System.nanoTime();\r\n\t\tlong k=1;\r\n\t\tfor(long i=tall-100; i<tall; i++){\r\n\t\t// long i=3999999999999999991L;\r\n\t\t// System.out.println(\"i \" + i);\r\n\t\t\t\tk = traadfaktorisering(i);\r\n\t\t\t\tfakro.add(k);\r\n\t\t\t\t// System.out.println(\"k\" + k);\r\n\t\t\t\tlong temp=i/k;\r\n\t\t\t\t// System.out.println(\"temp\" + temp);\r\n\t\t\twhile(temp!=1 ) {\r\n\t\t\t\tif(temp<maxtall && isPrime((int)temp)){\r\n\t\t\t\t\tfakro.add(temp);\r\n\t\t\t\t\t// System.out.println(\"is prime\" + temp);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tk = traadfaktorisering(temp);\r\n\t\t\t\t// System.out.println(\"k\" + k);\r\n\t\t\t\tfakro.add(k);\r\n\t\t\t\ttemp=temp/k;\r\n\t\t\t\t// System.out.println(\"temp\" + temp);\r\n\r\n\t\t\t}\r\n\t\t\tSystem.out.print(i + \" = \");\r\n\t\t\tSystem.out.print(fakro.get(0));\r\n\t\t\tfor(int e=1; e<fakro.size(); e++){\r\n\t\t\t\tSystem.out.print(\" * \");\r\n\t\t\t\tSystem.out.print(fakro.get(e));\r\n\t\t\t}\r\n\t\t\tfakro.clear();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t\tlong tid = System.nanoTime();\r\n\t\tSystem.out.println(\"tid pa parralellFakto: \" + ((tid-ti)/1000000.0) + \" ms\");\r\n\t\ttider.put(\"parralellFakto\", ((tid-ti)/1000000.0));\r\n\r\n\r\n\r\n\t}", "private void toRent() {\n }", "protected ArrayList<Integer> bepaalTrioSpelers(Groep groep) {\r\n ArrayList<Integer> trio = new ArrayList<>();\r\n if (groep.getSpelers().size() == 3) {\r\n \t// 3 spelers, dus maak gelijk trio\r\n trio.add(groep.getSpelers().get(0).getId());\r\n trio.add(groep.getSpelers().get(1).getId());\r\n trio.add(groep.getSpelers().get(2).getId());\r\n return trio;\r\n }\r\n int spelerID = 0;\r\n try {\r\n spelerID = IJCController.c().getBeginpuntTrio(groep.getSpelers().size());\r\n }\r\n catch (Exception e) {\r\n \tlogger.log(Level.WARNING, \"Problem with spelersID. No int.\");\r\n }\r\n int minDelta = 1;\r\n int plusDelta = 1;\r\n int ignore = 0;\r\n boolean doorzoeken = true;\r\n while (doorzoeken) {\r\n Speler s1 = groep.getSpelerByID(spelerID);\r\n Speler s2 = groep.getSpelerByID(spelerID - minDelta);\r\n Speler s3 = groep.getSpelerByID(spelerID + plusDelta);\r\n if (isGoedTrio(s1, s2, s3, ignore)) {\r\n trio.add(s1.getId());\r\n trio.add(s2.getId());\r\n trio.add(s3.getId());\r\n return trio;\r\n } else {\r\n if ((s2 == null) || (s3 == null)) {\r\n if (ignore > 4) {\r\n doorzoeken = false;\r\n }\r\n ignore += 1;\r\n minDelta = 1;\r\n plusDelta = 1;\r\n } else {\r\n if (minDelta > plusDelta) {\r\n plusDelta++;\r\n } else {\r\n minDelta++;\r\n }\r\n }\r\n }\r\n }\r\n return trio;\r\n }", "@Override\n\tpublic boolean livre() {\n\t\treturn true;\n\t}", "public void rodar(){\n\t\tmeuConjuntoDePneus.rodar();\r\n\t}", "public void relinkLR()\n {\n this.L.R = this.R.L = this;\n }", "@Override\n\tpublic void rent() {\n\t\tcontactLandlord();\n\t\tli.rent();\n\t\tchargeAgency();\n\t}", "private static void kapazitaetPruefen(){\n\t\tList<OeffentlichesVerkehrsmittel> loev = new ArrayList<OeffentlichesVerkehrsmittel>();\n\t\t\n\t\tLinienBus b1 = new LinienBus();\n\t\tFaehrschiff f1 = new Faehrschiff();\n\t\tLinienBus b2 = new LinienBus();\t\n\t\t\n\t\tloev.add(b1);\n\t\tloev.add(b2);\n\t\tloev.add(f1);\n\t\t\n\t\tint zaehlung = 500;\n\t\tboolean ausreichend = kapazitaetPruefen(loev,500);\n\t\tp(\"Kapazitaet ausreichend? \" + ausreichend);\n\t\t\n\t}", "public void ende() {\r\n\t\tSystem.out.println(dasSpiel.getSieger().getName() + \" hat gewonnen\"); \r\n\t}", "public void opretMedlem(KassererController kassererController, Hold hold) {\n Scanner scan = new Scanner(System.in);\n Motionist motionist;\n KonkurrenceSvømmer konkurrenceSvømmer;\n\n //Alle medlemmer\n System.out.println(\"Opret det nye medlem herunder: \");\n System.out.print(\"Skal det nye medlem registreres som konkurrencesvømmer, 'ja' eller 'nej': \");\n String svømmeType = scan.nextLine();\n\n System.out.print(\"Fulde navn: \");\n String navn = scan.nextLine();\n System.out.print(\"Alder: \");\n int alder = scan.nextInt();\n System.out.print(\"Har medlemmet en aktiv aktivitetsform? (true eller false): \");\n boolean aktivitetsform = scan.nextBoolean();\n System.out.print(\"Har medlemmet betalt? (true eller false): \");\n boolean betalt = scan.nextBoolean();\n\n //Motionist\n if (svømmeType.equals(\"nej\")) {\n motionist = new Motionist(navn, alder, aktivitetsform, betalt);\n if (motionist.getAlder() < 18) {\n System.out.println(\"Medlemmet er motionist og i kategorien juniormedlem.\");\n } else if (motionist.getAlder() >= 18) {\n System.out.println(\"Medlemmet er motionist og i kategorien seniormedlem.\");\n }\n System.out.println();\n System.out.print(motionist.toString());\n medlemmer.add(motionist);\n kassererController.kontingentBetaling(motionist);\n filHåndtering.filSkrivning(motionist);\n\n //Konkurrencesvømmer\n } else if (svømmeType.equals(\"ja\")) {\n konkurrenceSvømmer = new KonkurrenceSvømmer(navn, alder, aktivitetsform, betalt);\n if (konkurrenceSvømmer.getAlder() < 18) {\n hold.tilføjJuniorKonkurrencesvømmere(konkurrenceSvømmer);\n System.out.println(\"Medlemmet er konkurrencesvømmer i kategorien juniormedlem, og dermed tildelt ungdomsholdet.\");\n } else if (konkurrenceSvømmer.getAlder() >= 18) {\n hold.tilføjSeniorKonkurrencesvømmere(konkurrenceSvømmer);\n System.out.println(\"Medlemmet er konkurrencesvømmer i kategorien seniormedlem, og dermed tildelt seniorholdet.\");\n }\n konkurrenceSvømmer.svømmeDisciplin(konkurrenceSvømmer);\n System.out.println();\n System.out.print(konkurrenceSvømmer.toString());\n medlemmer.add(konkurrenceSvømmer);\n kassererController.kontingentBetaling(konkurrenceSvømmer);\n filHåndtering.filSkrivning(konkurrenceSvømmer);\n }\n }", "public void retournerLesPilesParcelles() {\n int compteur = 0;\n //pour chacune des 4 piles , retourner la parcelle au sommet de la pile\n for (JLabel jLabel : pileParcellesGUI) {\n JLabel thumb = jLabel;\n retournerParcelles(thumb, compteur);\n compteur++;\n }\n }", "public void vergissAlles() {\n\t\tmerker.clear();\n\t}", "public void warenkorbLeeren(Person p) throws AccessRestrictedException{\r\n\t\tif(istKunde(p)){\r\n\t\t\tWarenkorb wk = kv.gibWarenkorbVonKunde(p);\r\n\t\t\twv.leereWarenkorb(wk);\r\n\t\t} else {\r\n\t\t\tthrow new AccessRestrictedException(p, \"\\\"Warenkorb leeren\\\"\");\r\n\t\t}\r\n\t}", "public ParkingSpot(Level lvl, int ro, int no, VehicleSize vs){\r\n numOfSp = no;\r\n row = ro;\r\n lv = lvl;\r\n sizeOfSp = vs;\r\n lv = lvl;\r\n }", "public void hentTrekk() {\n\n Parti parti = this.fp_liste_parti.getSelectionModel().getSelectedItem();\n\n if (this.partierLastet && parti != null){\n\n valgtParti = fp_liste_parti.getSelectionModel().getSelectedItem();\n\n for(Trekk t: valgtParti.getTrekkListe()) {\n sp_liste_trekk.getItems().add(t);\n }\n\n tab_pane.getSelectionModel().select(tab_sp);\n\n this.initierAnimasjon();\n\n } else {\n\n Sjakkbrett.visFeil(\"Parti ikke valgt\", \"Du har ikke valgt et parti\", \"Vennligst velg et parti!\");\n\n }\n\n this.sp_knapp_forrige_trekk.setDisable(false);\n this.sp_knapp_spill_av_pause.setDisable(false);\n this.sp_knapp_neste_trekk.setDisable(false);\n this.sp_kombo_hastighet.setDisable(false);\n this.sp_knapp_velg_trekk.setDisable(false);\n\n }", "public Feld erzeugeFeld() {\n\t\tArrayList<Schiff> schiffe = new ArrayList<Schiff>();\n\t\t\n\t\t// 1 Schlachtschiff = 5\n\t\tschiffe.add(new Schiff(5));\n\t\t// 2 Kreuzer = 4\n\t\tschiffe.add(new Schiff(4));\n\t\tschiffe.add(new Schiff(4));\n\t\t// 3 Zerstoerer = 3\n\t\tschiffe.add(new Schiff(3));\n\t\tschiffe.add(new Schiff(3));\n\t\tschiffe.add(new Schiff(3));\n\t\t// 4 Uboote = 2\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\tschiffe.add(new Schiff(2));\n\t\t\n\t\tFeld neuesFeld = new Feld(getSpiel().getFeldGroesse());\n\t\t\n\t\tfor(int s = 0; s<schiffe.size(); s++) {\n\t\t\tSchiff schiff = schiffe.get(s);\n\t\t\t// Jeweils maximal 2*n^2 Versuche das Schiff zu positionieren\n\t\t\tfor(int i = 0; i < getSpiel().getFeldGroesse() * getSpiel().getFeldGroesse() * 2; i++) {\n\t\t\t\t// Zufallsorientierung\n\t\t\t\tOrientierung orientierung = Orientierung.HORIZONTAL;\n\t\t\t\tif(Math.random() * 2 > 1) {\n\t\t\t\t\torientierung = Orientierung.VERTIKAL;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Zufallskoordinate\n\t\t\t\tKoordinate koordinate = new Koordinate(\n\t\t\t\t\t(int) (Helfer.zufallszahl(0, getSpiel().getFeldGroesse() - 1)), \n\t\t\t\t\t(int) (Helfer.zufallszahl(0, getSpiel().getFeldGroesse() - 1)));\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tneuesFeld.setzeSchiff(schiff, koordinate, orientierung);\n\t\t\t\t\tbreak;\n\t\t\t\t} catch(Exception e) { }\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(neuesFeld.getSchiffe().size() != 10) throw new RuntimeException(\"Schiffe konnten nicht gesetzt werden!\");\n\t\t\t\n\t\treturn neuesFeld;\n\t}", "public ControllerUtilizadorGeraLinhaEncomenda(TrazAqui s, String u, String l){\n this.trazAqui = s;\n this.codLoja = l;\n this.codUtilizador = u;\n this.linhaCriada = new ArrayList<>();\n this.peso = 0.0;\n }", "public QwirkleSpiel()\n {\n beutel=new Beutel(3); //erzeuge Beutel mit 3 Steinfamilien\n spielfeld=new List<Stein>();\n\n rote=new ArrayList<Stein>(); //Unterlisten, die zum leichteren Durchsuchen des Spielfelds angelegt werden\n blaue=new ArrayList<Stein>();\n gruene=new ArrayList<Stein>();\n gelbe=new ArrayList<Stein>();\n violette=new ArrayList<Stein>();\n orangene=new ArrayList<Stein>();\n kreise=new ArrayList<Stein>();\n kleeblaetter=new ArrayList<Stein>();\n quadrate=new ArrayList<Stein>();\n karos=new ArrayList<Stein>();\n kreuze=new ArrayList<Stein>();\n sterne=new ArrayList<Stein>();\n\n erstelleListenMap();\n }", "private Position findeNahrung(Position position)\n {\n List<Position> nachbarPositionen = \n feld.nachbarpositionen(position);\n Iterator<Position> iter = nachbarPositionen.iterator();\n while(iter.hasNext()) {\n Position pos = iter.next();\n Object tier = feld.gibObjektAn(pos);\n if(tier instanceof Hase) {\n Hase hase = (Hase) tier;\n if(hase.istLebendig()) { \n hase.sterben();\n futterLevel = HASEN_NAEHRWERT;\n return pos;\n }\n }\n }\n return null;\n }", "private void moveMehran() {\r\n\t\tif(count == 300 && dragon2 == null && mehran != null) {\r\n\t\t\tdouble x = mehran.getX();\r\n\t\t\tdouble y = mehran.getY();\r\n\t\t\tfor(int i = 1; i < animationArr.length; i++) {\r\n\t\t\t\tremove(mehran);\r\n\t\t\t\tmehran = animationArr[i];\r\n\t\t\t\tadd(mehran, x, y);\r\n\t\t\t\tmoveBullet();\r\n\t\t\t\tpause(DELAY);\r\n\t\t\t}\r\n\t\t\tlaser = new GRect(mehran.getX() - 1, mehran.getY() + 100, LASER_WIDTH, LASER_HEIGHT);\r\n\t\t\tlaser.setFilled(true);\r\n\t\t\tlaser.setColor(Color.RED);\r\n\t\t\tadd(laser);\r\n\t\t\tfor(int i = animationArr.length - 1; i > 0; i--) {\r\n\t\t\t\tremove(mehran);\r\n\t\t\t\tmehran = animationArr[i];\r\n\t\t\t\tadd(mehran, x, y);\r\n\t\t\t\tmoveBullet();\r\n\t\t\t\tpause(DELAY);\r\n\t\t\t}\r\n\t\t\tcount = 0;\r\n\t\t}\r\n\t}", "public Labyrinthe (int h, int l) {\n\thauteur = h;\n\tlargeur = l;\n\ttailleRoute = 0;\n\tGenererLab (h, l);\n }", "public void skratiListu() {\n if (!jePrazna()) {\n int n = Svetovid.in.readInt(\"Unesite broj elemenata za skracivanje: \");\n obrniListu(); //Zato sto se trazi odsecanje poslednjih n elemenata\n while (prvi != null && n > 0) {\n prvi = prvi.veza;\n n--;\n }\n obrniListu(); //Vraca listu u prvobitni redosled\n }\n }", "public void addSteinZuSpielFeld(Stein pStein, int spielerIndex)\n {\n if (!checkLegbarkeit(pStein))\n return;\n //System.out.println(\"QuirkelSpiel: \"+(System.currentTimeMillis() - start) + \" ms for Legbarkeitscheck!\");\n\n\n\n if (aktiveZeile ==null && aktiveSpalte ==null){\n aktiveZeile = pStein.gibZeile();\n aktiveSpalte = pStein.gibSpalte();\n }\n else if (aktiveZeile!=null && aktiveSpalte!=null){\n if (pStein.gibZeile()!=aktiveZeile && pStein.gibSpalte()!=aktiveSpalte) //Stein muss in gleiche Zeile oder Spalte gelegt werden\n return;\n else if (pStein.gibZeile()==aktiveZeile)\n aktiveSpalte = null;\n else\n aktiveZeile =null;\n }\n else if (aktiveZeile!=null){\n if (pStein.gibZeile()!=aktiveZeile) //Stein muss in die gleiche Zeile gelegt werden\n return;\n }\n else\n if (pStein.gibSpalte()!=aktiveSpalte) //Stein muss in die gleiche Spalte gelegt werden\n return;\n\n if (aktiveFarbe ==null && aktivesSymbol ==null){\n aktiveFarbe = pStein.gibFarbString();\n aktivesSymbol = pStein.gibSymbolString();\n }\n else if (aktiveFarbe!=null && aktivesSymbol!=null){\n if (!pStein.gibFarbString().equals(aktiveFarbe) && !pStein.gibSymbolString().equals(aktivesSymbol)) //Stein muss gleiches Symbol oder gleiche Farbe haben\n return;\n else if (pStein.gibFarbString().equals(aktiveFarbe))\n aktivesSymbol = null;\n else\n aktiveFarbe =null;\n }\n else if (aktiveFarbe!=null){\n if (!pStein.gibFarbString().equals(aktiveFarbe)) //Stein muss gleiche Farbe haben\n return;\n }\n else\n if (!pStein.gibSymbolString().equals(aktivesSymbol)) //Stein muss gleiches Symbol haben\n return;\n\n\n spielfeld.append(pStein); // legt ihn auf das Spielfeld\n symbolMap.get(pStein.gibSymbol()).add(pStein);\n farbenMap.get(pStein.gibSymbol()).add(pStein);\n\n int punkte=0;\n int zwischenPunkte =horizontalePunkte(pStein);\n if (zwischenPunkte==6)\n zwischenPunkte+=6;//Qwirkle\n punkte+=zwischenPunkte;\n zwischenPunkte =senkrechtePunkte(pStein);\n if (zwischenPunkte==6)\n zwischenPunkte+=6;//Qwirkle\n punkte+=zwischenPunkte;\n\n if (punkte==0)\n punkte = 1; //gib auf alle Faelle einen Punkt\n\n while (spielerRing.getContent().gibIndex()!=spielerIndex)\n spielerRing.next();\n\n Spieler spieler = this.spielerRing.getContent();\n spieler.legeStein(pStein,punkte);\n System.out.println(\"QwirkleSpiel: \"+\"Spieler \" + spieler.gibIndex() + \" hat \" + pStein.toString() + \" gelegt.\");\n System.out.println(\"QwirkleSpiel: \"+\"Spieler \" + spieler.gibIndex() + \" hat \" + punkte + \" Punkte bekommen.\");\n\n\n //Wiederauffuellen in der gleichen Runde, wenn alle Steine abgelegt worden sind\n if (spieler.gibAnzahlSteine()==0 && beutel.gibAnzahl()>0){\n while (spieler.gibAnzahlSteine()<6 && beutel.gibAnzahl()>0){\n spieler.addStein(beutel.gibStein());\n }\n }\n\n }", "private static void obterNumeroLugar(String nome) {\n\t\tint numero = gestor.obterNumeroLugar(nome);\n\t\tif (numero > 0)\n\t\t\tSystem.out.println(\"O FUNCIONARIO \" + nome + \" tem LUGAR no. \" + numero);\n\t\telse\n\t\t\tSystem.out.println(\"NAO EXISTE LUGAR de estacionamento atribuido a \" + nome);\n\t}", "@Override\n\n public void leggInn(int indeks, T verdi) {\n\n if (verdi == null){\n throw new NullPointerException(); }\n if (indeks < 0){\n throw new IndexOutOfBoundsException(); }\n if (indeks > (antall - 1)){\n throw new IndexOutOfBoundsException(); }\n\n Node<T> newNode = new Node<T>(verdi);\n if (hode == null ){ // Hvis Listen er Tom\n hode = newNode;\n hale = newNode;\n }\n else if (indeks == 0){\n newNode.neste = hode;\n hode.forrige = newNode;\n hode = newNode;\n }\n else if (indeks == (antall - 1)){\n newNode.forrige = hale;\n hale.forrige = newNode;\n hale = newNode;\n }\n else {\n Node<T> nodeTemp = hode;\n for (int i = 1; i < indeks; i++){\n nodeTemp = nodeTemp.neste;\n newNode.neste = nodeTemp.neste;\n nodeTemp.neste = newNode;\n newNode.forrige = nodeTemp;\n newNode.neste.forrige = newNode;\n }\n }\n antall++;\n endringer++;\n }", "public void sendeSpielStarten();", "public void setNrLoja(int nrLoja) {\n this.nrLoja = nrLoja;\n }", "public int miete(Spieler spieler){\n\t\treturn logik.miete(spieler);\n\t}" ]
[ "0.65164876", "0.6370465", "0.5849916", "0.58305126", "0.57956135", "0.5760994", "0.5719868", "0.5706785", "0.5659191", "0.56398904", "0.56351197", "0.55999404", "0.55787694", "0.5557695", "0.5555198", "0.5538456", "0.5497973", "0.54722035", "0.54711163", "0.54226345", "0.5388816", "0.53620356", "0.53317153", "0.53198206", "0.52412176", "0.52334344", "0.52322257", "0.5228619", "0.5214176", "0.519546", "0.51910365", "0.51701325", "0.51630604", "0.5155232", "0.5149174", "0.51384044", "0.5128157", "0.5122948", "0.5109447", "0.5108457", "0.5095409", "0.50856906", "0.5072105", "0.50689805", "0.50649357", "0.5058123", "0.5057514", "0.5054802", "0.5051363", "0.5049903", "0.50482136", "0.50413615", "0.5039634", "0.5029413", "0.5023485", "0.5019493", "0.5019066", "0.501879", "0.50160956", "0.50125545", "0.5010819", "0.50085956", "0.5007756", "0.50076133", "0.50071955", "0.5005414", "0.50041044", "0.4993744", "0.49913722", "0.49810302", "0.4974746", "0.49607033", "0.49596938", "0.49393252", "0.493282", "0.49283758", "0.4926426", "0.4925746", "0.49160796", "0.49115917", "0.49079823", "0.49073994", "0.49051926", "0.49051258", "0.49013373", "0.4900864", "0.4900779", "0.48979175", "0.48974967", "0.48875356", "0.4886163", "0.48817354", "0.48812047", "0.48721388", "0.48706794", "0.4869998", "0.48678946", "0.486687", "0.4864471", "0.48499182" ]
0.5581894
12
Spiller ett trekk for spilleren.
public void spillTrekk(List<Terning> terninger) { Integer sum = 0; for (Terning terning : terninger) { terning.trill(); sum += terning.getVerdi(); } Rute plass = brikke.getPlass(); plass = brett.finnRute(plass, sum); brikke.setPlass(plass); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void skrivUtSpiller() {\r\n\t\tSystem.out.println(\"Spiller \" + id + \": \" + navn + \", har \" + poengsum + \" poeng\");\r\n\t}", "public void sendeSpielfeld();", "public void schritt() {\r\n\t\tfor (int i = 0; i < anzahlRennautos; i++) {\r\n\t\t\tlisteRennautos[i].fahren(streckenlaenge);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "private void heilenTrankBenutzen() {\n LinkedList<Gegenstand> gegenstaende = spieler.getAlleGegenstaende();\n for (Gegenstand g : gegenstaende) {\n if (g.getName().equalsIgnoreCase(\"heiltrank\")) {\n spieler.heilen();\n gegenstaende.remove(g);\n System.out.print(\"Heiltrank wird benutzt\");\n makePause();\n System.out.println(\"Du hast noch \" + zaehltGegenstand(\"heiltrank\") + \" Heiltranke!\");\n return;\n }\n }\n System.out.println(\"Du hast gerade keinen Heiltrank\");\n }", "private void poetries() {\n\n\t}", "public void hentTrekk() {\n\n Parti parti = this.fp_liste_parti.getSelectionModel().getSelectedItem();\n\n if (this.partierLastet && parti != null){\n\n valgtParti = fp_liste_parti.getSelectionModel().getSelectedItem();\n\n for(Trekk t: valgtParti.getTrekkListe()) {\n sp_liste_trekk.getItems().add(t);\n }\n\n tab_pane.getSelectionModel().select(tab_sp);\n\n this.initierAnimasjon();\n\n } else {\n\n Sjakkbrett.visFeil(\"Parti ikke valgt\", \"Du har ikke valgt et parti\", \"Vennligst velg et parti!\");\n\n }\n\n this.sp_knapp_forrige_trekk.setDisable(false);\n this.sp_knapp_spill_av_pause.setDisable(false);\n this.sp_knapp_neste_trekk.setDisable(false);\n this.sp_kombo_hastighet.setDisable(false);\n this.sp_knapp_velg_trekk.setDisable(false);\n\n }", "private void tallennaTiedostoon() {\n viitearkisto.tallenna();\n }", "public void stampajSpisak() {\n\t\t\n\t\tif (prviFilm != null) {\n\t\t\t\n\t\t\tFilm tekuciFilm = prviFilm;\n\t\t\tint count = 0;\n\t\t\t\n\t\t\tSystem.out.println(\"Filmovi: \");\n\t\t\t\n\t\t\twhile (tekuciFilm != null) {\n\t\t\t\t\n\t\t\t\tcount++;\n\t\t\t\t\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\"Film #\" + count + \": '\" + tekuciFilm.naziv + \"'\");\n\t\t\t\t\n\t\t\t\tif (tekuciFilm.sadrzaj == null) {\n\t\t\t\t\tSystem.out.println(\"\\tNema unetih glumaca.\");\n\t\t\t\t} else {\n\t\t\t\t\tGlumac tekuciGlumac = tekuciFilm.sadrzaj;\n\t\t\t\t\t\n\t\t\t\t\twhile (tekuciGlumac != null) {\n\t\t\t\t\t\tSystem.out.println(\"\\t\" + tekuciGlumac);\n\t\t\t\t\t\ttekuciGlumac = tekuciGlumac.veza;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttekuciFilm = tekuciFilm.veza;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tSystem.out.println(\"Spisak je prazan.\");\n\t\t}\n\t}", "public static void hentOgSkrivKostnader() {\n Connection con = getCon();\n PreparedStatement prepStmt = null;\n ResultSet res = null;\n try {\n String query = \"SELECT prosj_id, kunde, tekst, beløp FROM prosjekt JOIN prosjektkostnader USING(prosj_id) WHERE faktura_sendt IS NULL ORDER BY prosj_id, kunde;\";\n prepStmt = con.prepareStatement(query);\n res = prepStmt.executeQuery();\n while (res.next()) {\n Tekstfil.skriv(res.getString(\"prosj_id\") +\n \"; \" + res.getString(\"tekst\") + \"; \" +\n res.getString(\"kunde\") + \"; \" +\n res.getDouble(\"beløp\") + \"\\n\");\n }\n /*\n String query2 = \"UPDATE prosjektkostnader SET faktura_sendt=CURRENT_DATE() WHERE faktura_sendt IS NULL;\";\n prepStmt = con.prepareStatement(query2);\n prepStmt.executeUpdate();\n */\n } catch (SQLSyntaxErrorException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n closeConnection(con, prepStmt, null);\n }\n }", "public void tegnTre() {\r\n tegneBrett.getChildren().clear();\r\n if (root != null) {\r\n tegnTre(root, tegneBrett.getWidth() / 2, høydeAvstand,\r\n tegneBrett.getWidth() / 4);\r\n }\r\n }", "private static void kapazitaetPruefen(){\n\t\tList<OeffentlichesVerkehrsmittel> loev = new ArrayList<OeffentlichesVerkehrsmittel>();\n\t\t\n\t\tLinienBus b1 = new LinienBus();\n\t\tFaehrschiff f1 = new Faehrschiff();\n\t\tLinienBus b2 = new LinienBus();\t\n\t\t\n\t\tloev.add(b1);\n\t\tloev.add(b2);\n\t\tloev.add(f1);\n\t\t\n\t\tint zaehlung = 500;\n\t\tboolean ausreichend = kapazitaetPruefen(loev,500);\n\t\tp(\"Kapazitaet ausreichend? \" + ausreichend);\n\t\t\n\t}", "private void sterben()\n {\n lebendig = false;\n if(position != null) {\n feld.raeumen(position);\n position = null;\n feld = null;\n }\n }", "public void sendeSpielerWeg(String spieler);", "public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "public void skratiListu() {\n if (!jePrazna()) {\n int n = Svetovid.in.readInt(\"Unesite broj elemenata za skracivanje: \");\n obrniListu(); //Zato sto se trazi odsecanje poslednjih n elemenata\n while (prvi != null && n > 0) {\n prvi = prvi.veza;\n n--;\n }\n obrniListu(); //Vraca listu u prvobitni redosled\n }\n }", "@Override\n\tpublic void sortir() {\n\t\tif (!estVide()) {\n\t\t\tTC next = getProchain();\t\t\t\t//On recupere le prochain\n\t\t\tsalle.get(next.getPrio()).remove(next);\t//Antinomie de entrer\n\t\t}\n\t}", "public void nastaviIgru() {\r\n\t\t// nastavi igru poslije pobjede\r\n\t\tigrajPoslijePobjede = true;\r\n\t}", "public void sendeNeuerSpieler(String spieler);", "public static void TroskoviPredjenogPuta() {\n\t\tUtillMethod.izlistavanjeVozila();\n\t\tSystem.out.println(\"Unesite redni broj vozila za koje zelite da racunate predjeni put!\");\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tif (!Main.getVozilaAll().get(redniBroj).isVozObrisano()) {\n\t\t\t\tSystem.out.println(\"Unesite broj kilometara koje ste presli sa odgovarajucim vozilom\");\n\t\t\t\tdouble km = UtillMethod.unesiteBroj();\n\t\t\t\tVozilo v = Main.getVozilaAll().get(redniBroj);\n\t\t\t\tdouble rezultat;\n\t\t\t\tif(v.getGorivaVozila().size()>1) {\n\t\t\t\t\tGorivo g = UtillMethod.izabirGoriva();\n\t\t\t\t\trezultat = cenaTroskaVoz(v,km,g);\n\t\t\t\t}else {\n\t\t\t\t\t rezultat = cenaTroskaVoz(v,km,v.getGorivaVozila().get(0));\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Cena troskova za predjeni put je \" + rezultat + \"Dinara!\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Ovo vozilo je obrisano i ne moze da se koristi!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Uneli ste pogresan redni broj!\");\n\t\t}\n\t}", "public void starteSpiel(int pAnzahl){\n\n this.anzahl = pAnzahl;\n\n spielerRing = new Ring<>();\n for (int i = 0; i < pAnzahl; i++) {\n spielerRing.insert(new Spieler(i));\n }\n\n Spieler startSpieler = null;\n while (startSpieler==null) {\n\n //verteile Steine\n int count = 0;\n while (count < pAnzahl) {\n Spieler spieler = this.spielerRing.getContent();\n spieler.loescheAlleSteine();\n for (int i = 0; i < 6; i++) {\n spieler.addStein(beutel.gibStein());\n }\n this.spielerRing.next();\n count++;\n }\n\n //bestimme Startspieler\n int startWert = 0;\n count=0;\n while (count < pAnzahl) {\n Spieler spieler = this.spielerRing.getContent();\n int wert = spieler.gibStartWert();\n if (wert>startWert){\n startWert = wert;\n if (wert>2)\n startSpieler = spieler;\n }\n this.spielerRing.next();\n count++;\n }\n\n if (startSpieler!=null)\n startSpieler.setzeAktiv(true);\n }\n }", "public void verwerkRijVoorKassa() {\r\n while(kassarij.erIsEenRij()) {\r\n Persoon staatBijKassa = kassarij.eerstePersoonInRij();\r\n kassa.rekenAf(staatBijKassa);\r\n }\r\n }", "public void ZbierzTowaryKlas() {\n\t\tSystem.out.println(\"ZbierzTowaryKlas\");\n\t\tfor(int i=0;i<Plansza.getTowarNaPlanszy().size();i++) {\n\t\t\tfor(Towar towar : Plansza.getTowarNaPlanszy()) {\n\t\t\t\t\n\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getNiewolnikNaPLanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getNiewolnikNaPLanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t//Szansa Niewolnika na zdobycie dwoch razy wiecej towarow\n\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getNiewolnicySzansa()) {\n\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikTowarow(Plansza.getNiewolnikNaPLanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getRzemieslnikNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getRzemieslnikNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikTowarow(Plansza.getRzemieslnikNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getXpolozenie()-1 <= towar.getXtowar() && Plansza.getArystokrataNaPlanszy().getXpolozenie()+1 >= towar.getXtowar()) \n\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getYpolozenie()-1 <= towar.getYtowar() && Plansza.getArystokrataNaPlanszy().getYpolozenie()+1 >= towar.getYtowar()) {\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().ZbieranieTowarow(towar);\n\t\t\t\t\t\tPlansza.getTowarNaPlanszy().remove(towar);\n\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikTowarow(Plansza.getArystokrataNaPlanszy().getLicznikTowarow()+1);\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n }\n }", "public QwirkleSpiel()\n {\n beutel=new Beutel(3); //erzeuge Beutel mit 3 Steinfamilien\n spielfeld=new List<Stein>();\n\n rote=new ArrayList<Stein>(); //Unterlisten, die zum leichteren Durchsuchen des Spielfelds angelegt werden\n blaue=new ArrayList<Stein>();\n gruene=new ArrayList<Stein>();\n gelbe=new ArrayList<Stein>();\n violette=new ArrayList<Stein>();\n orangene=new ArrayList<Stein>();\n kreise=new ArrayList<Stein>();\n kleeblaetter=new ArrayList<Stein>();\n quadrate=new ArrayList<Stein>();\n karos=new ArrayList<Stein>();\n kreuze=new ArrayList<Stein>();\n sterne=new ArrayList<Stein>();\n\n erstelleListenMap();\n }", "public void urciStupneVrcholu(){\n\t\tfor(int i = 0;i < vrchP.length; i++){\n\t\t\tstupenVrcholu(vrchP[i].klic);\n\t\t}\n\t}", "public void fjernAlle() {\n listehode.neste = null;\n antall = 0;\n }", "Spill(){\n\n\t\tin = new Scanner(System.in); \n\t\tspiller = new Spiller(in.nextLine()); \n\t\tdatamaskin = new Spiller(\"Datamaskin\"); // oppretter en datamaskin-spiller\n\t\tspillSteinSaksPapir();\n\t}", "private void remplirPrestaraireData() {\n\t}", "Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);", "public void RuchyKlas() {\n\t\tSystem.out.println(\"RuchyKlas\");\n\t\tPlansza.getNiewolnikNaPLanszy().Ruch();\n\t\tPlansza.getRzemieslnikNaPlanszy().Ruch();\n\t\tPlansza.getArystokrataNaPlanszy().Ruch();\n\t}", "@Override\r\n\tpublic void loeschen() {\r\n//\t\tsuper.leuchterAbmelden(this);\r\n\t\tsuper.loeschen();\r\n\t}", "public void dohvatiOtpad(KonkretniSpremnik ks) {\n VozilaLogger.printRad(this, ks);\n if (ks.getNazivBroj() == getVrsta()) {\n float nova_popunjenost = popunjenost + ks.getNapunjenost();\n if (nova_popunjenost >= nosivost) {\n notifyAllObservers();\n } else {\n popunjenost = nova_popunjenost;\n ks.isprazni();\n azurirajStatistikuOtpada(1, ks.getNapunjenost());\n }\n }\n }", "public void soin() {\n if (!autoriseOperation()) {\n return;\n }\n if (tamagoStats.getXp() >= 2) {\n incrFatigue(-3);\n incrHumeur(3);\n incrFaim(-3);\n incrSale(-3);\n incrXp(-2);\n\n if (tamagoStats.getPoids() == 0) {\n incrPoids(3);\n } else if (tamagoStats.getPoids() == TamagoStats.POIDS_MAX) {\n incrPoids(-3);\n }\n\n setEtatPiece(Etat.NONE);\n tamagoStats.setEtatSante(Etat.NONE);\n\n setChanged();\n notifyObservers();\n }\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public void pleitegeierSperren() {\n kontoMap.values().stream()\n .filter(konto -> konto.getKontostand() < 0)\n .forEach(Konto::sperren);\n }", "public void maakNieuweDoolhof()\n {\n /*hzs: hoek zonder schat\n hms: hoek met schat\n r: recht stuk\n t: T-kruispunt met schat*/\n //vaste aantallen vakjes\n int hzs = 10, hms = 6, r = 11, t = 6;\n List<String> schatten = sch.getSchatten();\n List<String> tSchatten = schatten.subList(12, 18);\n Collections.shuffle(tSchatten);\n List<String> hSchatten = schatten.subList(18, 24);\n Collections.shuffle(hSchatten);\n\n int hKaartTeller = 0, tKaartTeller = 0;\n\n //losse vakken random invullen\n //oneven rijen\n for (int h = 0; h <= 6; h += 2)\n {\n for (int i = 1; i <= 5; i += 2)\n {\n int kaart = (int) (1 + (Math.random() * 4));\n switch (kaart)\n {\n case 1:\n if (hzs > 0)\n {\n this.gangkaarten[h][i] = new HoekKaart((int) Math.floor(Math.random() * 4) + 1, false);\n hzs--;\n } else\n {\n i--;\n }\n break;\n case 2:\n if (hms > 0)\n {\n this.gangkaarten[h][i] = new HoekKaart((int) Math.floor(Math.random() * 4) + 1, hSchatten.get(hKaartTeller), false);\n hms--;\n hKaartTeller++;\n } else\n {\n i--;\n }\n break;\n case 3:\n if (r > 0)\n {\n this.gangkaarten[h][i] = new RechtKaart((int) Math.floor(Math.random() * 4) + 1, false);\n r--;\n } else\n {\n i--;\n }\n break;\n case 4:\n if (t > 0)\n {\n this.gangkaarten[h][i] = new TKaart((int) Math.floor(Math.random() * 4) + 1, tSchatten.get(tKaartTeller), false);\n t--;\n tKaartTeller++;\n } else\n {\n i--;\n }\n break;\n\n }\n }\n }\n\n //even rijen\n for (int j = 1; j <= 5; j += 2)\n {\n for (int i = 0; i <= 6; i++)\n {\n int kaart = (int) (1 + (Math.random() * 4));\n switch (kaart)\n {\n case 1:\n if (hzs > 0)\n {\n this.gangkaarten[j][i] = new HoekKaart((int) Math.floor(Math.random() * 4) + 1, false);\n hzs--;\n } else\n {\n i--;\n }\n break;\n case 2:\n if (hms > 0)\n {\n this.gangkaarten[j][i] = new HoekKaart((int) Math.floor(Math.random() * 4) + 1, hSchatten.get(hKaartTeller), false);\n hms--;\n hKaartTeller++;\n } else\n {\n i--;\n }\n break;\n case 3:\n if (r > 0)\n {\n this.gangkaarten[j][i] = new RechtKaart((int) Math.floor(Math.random() * 4) + 1, false);\n r--;\n } else\n {\n i--;\n }\n break;\n case 4:\n if (t > 0)\n {\n this.gangkaarten[j][i] = new TKaart((int) Math.floor(Math.random() * 4) + 1, tSchatten.get(tKaartTeller), false);\n t--;\n tKaartTeller++;\n } else\n {\n i--;\n }\n break;\n\n }\n }\n }\n }", "public void trykkPaa() throws TrykketPaaBombe {\n // Ingenting skal skje dersom en av disse er true;\n if (brettTapt || trykketPaa || flagget) {\n return;\n }\n\n // Om ruten er en bombe taper man brettet\n if (bombe) {\n trykketPaa = true;\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY)));\n throw new TrykketPaaBombe();\n }\n // Om ruten har null naboer skal et stoerre omraade aapnes\n else if (bombeNaboer == 0) {\n Lenkeliste<Rute> besokt = new Lenkeliste<Rute>();\n Lenkeliste<Rute> aapneDisse = new Lenkeliste<Rute>();\n aapneDisse.leggTil(this);\n // Rekursiv metode som fyller aapneDisse med riktige ruter\n finnAapentOmraade(besokt, aapneDisse);\n for (Rute r : aapneDisse) {\n r.aapne();\n }\n } else {\n aapne();\n }\n }", "public void teken(){\n removeAll();\n \n //eerste tekening\n if(tekenEerste != false){\n tekenMuur();\n tekenSleutel();\n veld[9][9] = 6;\n tekenEerste = false;\n tekenBarricade();\n }\n \n //methode die de speler de waarde van de sleutel geeft aanroepen\n sleutelWaarde();\n \n //de methode van het spel einde aanroepen\n einde();\n \n //vernieuwd veld aanroepen\n veld = speler.nieuwVeld(veld);\n \n //het veld tekenen\n for(int i = 0; i < coordinaten.length; i++) {\n for(int j = 0; j < coordinaten[1].length; j++){\n switch (veld[i][j]) {\n case 1: //de sleutels\n if(i == sleutel100.getY() && j == sleutel100.getX()){\n coordinaten[i][j] = new SleutelVakje(100);\n }\n else if (i == sleutel1002.getY() && j == sleutel1002.getX()){\n coordinaten[i][j] = new SleutelVakje(100);\n }\n else if (i == sleutel200.getY() && j == sleutel200.getX()){\n coordinaten[i][j] = new SleutelVakje(200);\n }\n else if (i == sleutel300.getY() && j == sleutel300.getX()){\n coordinaten[i][j] = new SleutelVakje(300);\n } break;\n case 2: //de muren\n coordinaten[i][j] = new MuurVakje();\n break;\n // de barricades\n case 3:\n coordinaten[i][j] = new BarricadeVakje(100);\n break;\n case 4:\n coordinaten[i][j] = new BarricadeVakje(200);\n break;\n case 5:\n coordinaten[i][j] = new BarricadeVakje(300);\n break;\n case 6: // het eindveld vakje\n coordinaten[i][j] = new EindveldVakje();\n break;\n default: // het normale vakje\n coordinaten[i][j] = new CoordinaatVakje();\n break;\n }\n //de speler\n coordinaten[speler.getY()][speler.getX()] = new SpelerVakje();\n \n //het veld aan de JPanel toevoegen\n add(coordinaten[i][j]);\n }\n }\n System.out.println(\"Speler waarde = \" + speler.getSleutelWaarde());\n revalidate();\n repaint();\n }", "public Speler schuifGangkaartIn(int positie, int richting)\n {\n positie = positie - 1;\n Gangkaart oudeKaart;\n switch (richting)\n {\n case 1:\n for (int rij = 0; rij < gangkaarten.length; rij++)\n {\n oudeKaart = gangkaarten[positie][rij];\n gangkaarten[positie][rij] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 2:\n for (int rij = gangkaarten.length - 1; rij >= 0; rij--)\n {\n oudeKaart = gangkaarten[positie][rij];\n gangkaarten[positie][rij] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 3:\n for (int kolom = 0; kolom < gangkaarten.length; kolom++)\n {\n oudeKaart = gangkaarten[kolom][positie];\n gangkaarten[kolom][positie] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n case 4:\n for (int kolom = gangkaarten.length - 1; kolom >= 0; kolom--)\n {\n oudeKaart = gangkaarten[kolom][positie];\n gangkaarten[kolom][positie] = vrijeGangkaart;\n vrijeGangkaart = oudeKaart;\n }\n break;\n }\n Speler speler = null;\n if (vrijeGangkaart.getSpeler() != null)\n {\n int[] pos = {-1,-1};\n speler = vrijeGangkaart.getSpeler();\n vrijeGangkaart.setSpeler(null);\n switch(richting)\n {\n case 1: pos[0] = positie;\n pos[1] = 0;\n speler.setPositie(pos);\n gangkaarten[positie][0].setSpeler(speler);\n break;\n case 2: pos[0] = positie;\n pos[1] = 6;\n speler.setPositie(pos);\n gangkaarten[positie][6].setSpeler(speler);\n break;\n case 3: pos[0] = 0;\n pos[1] = positie;\n gangkaarten[0][positie].setSpeler(speler);\n break;\n case 4: pos[0] = 6;\n pos[1] = positie;\n speler.setPositie(pos);\n gangkaarten[6][positie].setSpeler(speler);\n break;\n }\n }\n return speler;\n\n }", "void TaktImpulsAusfuehren ()\n {\n \n wolkebew();\n \n }", "@Before\r\n\tpublic void erstelleSUT() {\n\t\tSpiel spiel = new Spiel();\r\n\r\n\t\t// Für jeden Spieler eine Unternehmenskette, damit eine\r\n\t\t// Konkurrenzsituation entsteht\r\n\t\tukette = new Unternehmenskette(\"KetteNummer1\");\r\n\t\tukette1 = new Unternehmenskette(\"KetteNummer2\");\r\n\t\t// Es werden für Unternehmenskette ein Report erstellt. Pro Runde\r\n\t\t// brauchen wir eigentlich ein Report für jede Kette.\r\n\t\tReport report = new Report(1, ukette);\r\n\t\tReport report1 = new Report(1, ukette1);\r\n\t\tukette.hinzufuegenReport(report);\r\n\t\tukette1.hinzufuegenReport(report1);\r\n\t\t// Dem Spiel werden die Unternehmensketten zugeordnet\r\n\t\tspiel.hinzufuegenUnternehmenskette(ukette);\r\n\t\tspiel.hinzufuegenUnternehmenskette(ukette1);\r\n\t\t// Ein Standort, an dem die Ketten konkurrieren sollen, wird angelegt\r\n\r\n\t\t// für den Kunden:\r\n\t\t// Praeferenz für ALLE ist Qualität\r\n\t\tZufall.setzeTestmodus(true);\r\n\t\tZufall.setzeTestZufallszahl(2);\r\n\t\tZufall.setzeTestQualitaet(0.4);\r\n\t\tstandort = new Standort(Standorttyp.Standort1);\r\n\t\tfil1 = new Filiale(standort, ukette);\r\n\t\tfil1.setzeMitarbeiter(1);\r\n\t\tfil1.initialisierenKapazitaet();\r\n\t\tfil2 = new Filiale(standort, ukette1);\r\n\t\tfil2.setzeMitarbeiter(1);\r\n\t\tfil2.initialisierenKapazitaet();\r\n\t\tZufall.setzeTestmodus(false);\r\n\t\tstandort.beeinflussenKunden(ukette, 1);\r\n\t\tstandort.beeinflussenKunden(ukette1, 1);\r\n\t\tZufall.setzeTestmodus(true);\r\n\t\tZufall.setzeTestZufallszahl(2);\r\n\t\tZufall.setzeTestQualitaet(0.4);\r\n\t\tProdukt p1 = new Produkt(Produkttyp.TEE, 20);\r\n\t\tProdukt p2 = new Produkt(Produkttyp.KUCHEN, 10);\r\n\t\tp1.setzePreis(1);\r\n\t\tp1.setzeQualitaet(0.56);\r\n\t\tp2.setzePreis(1.2);\r\n\t\tp2.setzeQualitaet(0.6);\r\n\t\tukette.holeLager().einlagern(p1);\r\n\t\tukette.holeLager().einlagern(p2);\r\n\t\tp1.setzePreis(0.8);\r\n\t\tp1.setzeQualitaet(0.5);\r\n\t\tukette1.holeLager().einlagern(p1);\r\n\t\t// Kette1 bietet Kaffee (P:1; Q:0.56) und Kuchen (P:1.2; Q:0.6) an\r\n\t\t// Kette2 bietet Kaffe (P:0.8, Q:0.5) an.\r\n\t}", "public void wuerfeln() {\n if (istGefängnis) {\n setIstGefängnis(false);\n if (aktuellesFeldName instanceof GefängnisFeld && !(aktuellesFeldName instanceof NurZuBesuchFeld)) {\n GefängnisFeld g = (GefängnisFeld) aktuellesFeldName;\n g.gefaengnisAktion(this);\n \n return;\n }\n\n } else {\n String[] worte = {\"Eins\", \"Zwei\", \"Drei\", \"Vier\", \"Fünf\", \"Sechs\", \"Sieben\", \"Acht\", \"Neun\", \"Zehn\", \"Elf\", \"Zwölf\"};\n\n wuerfelZahl = getRandomInteger(12, 1);\n\n this.aktuellesFeld = this.aktuellesFeld + wuerfelZahl + 1;\n if (this.aktuellesFeld >= 40) {\n setAktuellesFeld(0);\n\n }\n\n System.out.println(worte[wuerfelZahl] + \" gewürfelt\");\n\n aktuellesFeldName = spielfigurSetzen(this.aktuellesFeld);\n System.out.println(\"Du befindest dich auf Feld-Nr: \" + (this.aktuellesFeld));\n boolean check = false;\n for (Spielfelder s : felderInBesitz) {\n if (aktuellesFeldName.equals(s)) {\n check = true;\n }\n }\n\n if (!check) {\n aktuellesFeldName.spielfeldAktion(this, aktuellesFeldName);\n } else {\n System.out.println(\"Das Feld: \" + aktuellesFeldName.getFeldname() + \"(Nr: \" + aktuellesFeldName.getFeldnummer() + \")gehört dir!\");\n if (aktuellesFeldName instanceof Straße) {\n Straße strasse = (Straße) aktuellesFeldName;\n System.out.println(\"Farbe: \" + strasse.getFarbe());\n try {\n strasse.hausBauen(this, strasse);\n } catch (IOException ex) {\n Logger.getLogger(Spieler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n }\n }\n }", "public SpielfeldZeile()\n\t{\n\t _spalte0 = 0;\n\t _spalte1 = 0;\n\t _spalte2 = 0;\n\t}", "public void addSteinZuSpielFeld(Stein pStein, int spielerIndex)\n {\n if (!checkLegbarkeit(pStein))\n return;\n //System.out.println(\"QuirkelSpiel: \"+(System.currentTimeMillis() - start) + \" ms for Legbarkeitscheck!\");\n\n\n\n if (aktiveZeile ==null && aktiveSpalte ==null){\n aktiveZeile = pStein.gibZeile();\n aktiveSpalte = pStein.gibSpalte();\n }\n else if (aktiveZeile!=null && aktiveSpalte!=null){\n if (pStein.gibZeile()!=aktiveZeile && pStein.gibSpalte()!=aktiveSpalte) //Stein muss in gleiche Zeile oder Spalte gelegt werden\n return;\n else if (pStein.gibZeile()==aktiveZeile)\n aktiveSpalte = null;\n else\n aktiveZeile =null;\n }\n else if (aktiveZeile!=null){\n if (pStein.gibZeile()!=aktiveZeile) //Stein muss in die gleiche Zeile gelegt werden\n return;\n }\n else\n if (pStein.gibSpalte()!=aktiveSpalte) //Stein muss in die gleiche Spalte gelegt werden\n return;\n\n if (aktiveFarbe ==null && aktivesSymbol ==null){\n aktiveFarbe = pStein.gibFarbString();\n aktivesSymbol = pStein.gibSymbolString();\n }\n else if (aktiveFarbe!=null && aktivesSymbol!=null){\n if (!pStein.gibFarbString().equals(aktiveFarbe) && !pStein.gibSymbolString().equals(aktivesSymbol)) //Stein muss gleiches Symbol oder gleiche Farbe haben\n return;\n else if (pStein.gibFarbString().equals(aktiveFarbe))\n aktivesSymbol = null;\n else\n aktiveFarbe =null;\n }\n else if (aktiveFarbe!=null){\n if (!pStein.gibFarbString().equals(aktiveFarbe)) //Stein muss gleiche Farbe haben\n return;\n }\n else\n if (!pStein.gibSymbolString().equals(aktivesSymbol)) //Stein muss gleiches Symbol haben\n return;\n\n\n spielfeld.append(pStein); // legt ihn auf das Spielfeld\n symbolMap.get(pStein.gibSymbol()).add(pStein);\n farbenMap.get(pStein.gibSymbol()).add(pStein);\n\n int punkte=0;\n int zwischenPunkte =horizontalePunkte(pStein);\n if (zwischenPunkte==6)\n zwischenPunkte+=6;//Qwirkle\n punkte+=zwischenPunkte;\n zwischenPunkte =senkrechtePunkte(pStein);\n if (zwischenPunkte==6)\n zwischenPunkte+=6;//Qwirkle\n punkte+=zwischenPunkte;\n\n if (punkte==0)\n punkte = 1; //gib auf alle Faelle einen Punkt\n\n while (spielerRing.getContent().gibIndex()!=spielerIndex)\n spielerRing.next();\n\n Spieler spieler = this.spielerRing.getContent();\n spieler.legeStein(pStein,punkte);\n System.out.println(\"QwirkleSpiel: \"+\"Spieler \" + spieler.gibIndex() + \" hat \" + pStein.toString() + \" gelegt.\");\n System.out.println(\"QwirkleSpiel: \"+\"Spieler \" + spieler.gibIndex() + \" hat \" + punkte + \" Punkte bekommen.\");\n\n\n //Wiederauffuellen in der gleichen Runde, wenn alle Steine abgelegt worden sind\n if (spieler.gibAnzahlSteine()==0 && beutel.gibAnzahl()>0){\n while (spieler.gibAnzahlSteine()<6 && beutel.gibAnzahl()>0){\n spieler.addStein(beutel.gibStein());\n }\n }\n\n }", "public Spieler(String spielfigur) {\n\n this.kontostand = 30000;\n this.spielfigur = spielfigur;\n this.istGefängnis = false;\n\n liste.put(\"braun\", braun);\n liste.put(\"hellblau\", hellblau);\n liste.put(\"pink\", pink);\n liste.put(\"orange\", orange);\n liste.put(\"rot\", rot);\n liste.put(\"gelb\", gelb);\n liste.put(\"grün\", grün);\n liste.put(\"duneklblau\", dunkelblau);\n liste.put(\"bahnhoefe\", bahnhoefe);\n liste.put(\"werke\", werke);\n felderInBesitz = new ArrayList<>();\n\n }", "protected void pretragaGledalac() {\n\t\tString Gledalac=tfPretraga.getText();\r\n\r\n\t\tObject[]redovi=new Object[9];\r\n\t\tdtm.setRowCount(0);\r\n\t\t\r\n\t\tfor(Rezervacije r:Kontroler.getInstanca().vratiRezervacije()) {\r\n\t\t\tif(r.getImePrezime().toLowerCase().contains(Gledalac.toLowerCase())) {\r\n\t\t\t\r\n\t\t\t\tredovi[0]=r.getID_Rez();\r\n\t\t\t\tredovi[1]=r.getImePrezime();\r\n\t\t\t\tredovi[2]=r.getImePozorista();\r\n\t\t\t\tredovi[3]=r.getNazivPredstave();\r\n\t\t\t\tredovi[4]=r.getDatumIzvodjenja();\r\n\t\t\t\tredovi[5]=r.getVremeIzvodjenja();\r\n\t\t\t\tredovi[6]=r.getScenaIzvodjenja();\r\n\t\t\t\tredovi[7]=r.getBrRezUl();\r\n\t\t\t\tredovi[8]=r.getCenaUlaznica();\r\n\t\t\t\tdtm.addRow(redovi);\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void przestaw(int ktoraRamkaKurwa){ //0 nic, 1 korwin, 2 nosacz\n\n\t\tthis.ktoraRamkaKurwa = ktoraRamkaKurwa;\n\t\tktoraRamka++; \n\t}", "public void reset()\n\t{\n\t\tprint (\"Rynek reset\");\n\t\t//this line is for debug purposes only\n\t\t\n\t\titeracja =0;\n\t\t\n\t\tlistaFunkcjiUzytecznosci = new ArrayList<ArrayList<Point>>();\n\n\t\t//dla scenariuszy nie psoiadajacych EV \n\t\tint liczbaHandlowcow=obliczLiczbaKont();\n\t\n\t\t\n\t\tint a=0;\n\t\twhile (a<liczbaHandlowcow)\n\t\t{\n\t\t\tlistaFunkcjiUzytecznosci.add(new ArrayList<Point>());\n\t\t\ta++;\n\t\t}\n\t\t\n\t\tpriceVectorsList = new ArrayList<ArrayList<Float>>();\n\t\t\n\t\trynekHistory.reset(liczbaHandlowcow);\n\t\t\n\t}", "public Spiel()\n {\n \tspieler = new Spieler();\n \t//landkarte = new Landkarte(5);\n //landkarte.raeumeAnlegen(spieler);\n\n \tlandkarte = levelGen.generate(spieler, 5, 6, 4, 10);\n\n parser = new Parser();\n }", "public void AwansSpoleczny() {\n\t\tSystem.out.println(\"AwansSpoleczny\");\n\t\tif(Plansza.getNiewolnikNaPLanszy().getPopulacja() >= ZapisOdczyt.getPOPULACJAMAX()*0.67 && Plansza.getNiewolnikNaPLanszy() instanceof Niewolnicy) {\n\t\t\tPlansza.setNiewolnikNaPlanszy(new Mieszczanie(Plansza.getNiewolnikNaPLanszy()));\n\t\t}\n\t\t\t\n\t\tif(Plansza.getRzemieslnikNaPlanszy().getPopulacja() >= ZapisOdczyt.getPOPULACJAMAX()*0.67 && Plansza.getRzemieslnikNaPlanszy() instanceof Rzemieslnicy) {\n\t\t\tPlansza.setRzemieslnikNaPlanszy(new Handlarze(Plansza.getRzemieslnikNaPlanszy()));\n\t\t}\n\t\t\t\n\t\tif(Plansza.getArystokrataNaPlanszy().getPopulacja() >= ZapisOdczyt.getPOPULACJAMAX()*0.67 && Plansza.getArystokrataNaPlanszy() instanceof Arystokracja) {\n\t\t\tPlansza.setArystokrataNaPlanszy(new Szlachta(Plansza.getArystokrataNaPlanszy()));\n\t\t}\n\t}", "@Override\n\tpublic void trabajar() {\n\n\t}", "public void DaneStartowe() {\n\t\tSystem.out.println(\"DaneStartowe\");\n\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(ZapisOdczyt.getPopulacjaStartowaNiewolnicy());\n\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(ZapisOdczyt.getPopulacjaStartowaNiewolnicy());\n\t\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(ZapisOdczyt.getPopulacjaStartowaRzemieslnicy());\n\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(ZapisOdczyt.getPopulacjaStartowaRzemieslnicy());\n\t\tPlansza.getArystokrataNaPlanszy().setZloto((int) (ZapisOdczyt.getPopulacjaStartowaArystokracja() + ZapisOdczyt.getArystokracjaWiekszaPopulacja()*ZapisOdczyt.getPopulacjaStartowaArystokracja()*0.01));\n\t\tPlansza.getArystokrataNaPlanszy().setTowary((int) (ZapisOdczyt.getPopulacjaStartowaArystokracja() + ZapisOdczyt.getArystokracjaWiekszaPopulacja()*ZapisOdczyt.getPopulacjaStartowaArystokracja()*0.01));\n\t}", "private void ucitajTestPodatke() {\n\t\tList<Integer> l1 = new ArrayList<Integer>();\n\n\t\tRestoran r1 = new Restoran(\"Palazzo Bianco\", \"Bulevar Cara Dušana 21\", KategorijeRestorana.PICERIJA, l1, l1);\n\t\tRestoran r2 = new Restoran(\"Ananda\", \"Petra Drapšina 51\", KategorijeRestorana.DOMACA, l1, l1);\n\t\tRestoran r3 = new Restoran(\"Dizni\", \"Bulevar cara Lazara 92\", KategorijeRestorana.POSLASTICARNICA, l1, l1);\n\n\t\tdodajRestoran(r1);\n\t\tdodajRestoran(r2);\n\t\tdodajRestoran(r3);\n\t}", "public void Zabojstwa() {\n\t\tSystem.out.println(\"Zabojstwa\");\n\t\tfor(int i=0;i<Plansza.getNiebezpieczenstwoNaPlanszy().size();i++) {\n\t\t\tfor(GenerujNiebezpieczenstwo niebez : Plansza.getNiebezpieczenstwoNaPlanszy()) {\n\n\t\t\t\tif(niebez.getZabojca() instanceof DzikieZwierzeta) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getNiewolnikNaPLanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getNiewolnikNaPLanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getNiewolnikNaPLanszy().getUbrania() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getNiewolnikNaPLanszy().getJedzenie() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setUbrania(Plansza.getNiewolnikNaPLanszy().getUbrania() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setJedzenie(Plansza.getNiewolnikNaPLanszy().getJedzenie() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getNiewolnikNaPLanszy().setLicznikNiebezpieczenstw(Plansza.getNiewolnikNaPLanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Bandyci) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getRzemieslnikNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getRzemieslnikNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getRzemieslnikNaPlanszy().getMaterialy() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getRzemieslnikNaPlanszy().getNarzedzia() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tif(GeneratorRandom.RandomOd0(101) <= ZapisOdczyt.getRzemieslnicySzansa()) {\n\t\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setMaterialy(Plansza.getRzemieslnikNaPlanszy().getMaterialy() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setNarzedzia(Plansza.getRzemieslnikNaPlanszy().getNarzedzia() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getRzemieslnikNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getRzemieslnikNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(niebez.getZabojca() instanceof Zlodzieje) {\n\t\t\t\t\tif(niebez.getXniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getXpolozenie() && niebez.getXniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getXpolozenie()) {\n\t\t\t\t\t\tif(niebez.getYniebezpieczenstwo()-1 <= Plansza.getArystokrataNaPlanszy().getYpolozenie() && niebez.getYniebezpieczenstwo()+1 >= Plansza.getArystokrataNaPlanszy().getYpolozenie()) {\n\t\t\t\t\t\t\tif(Plansza.getArystokrataNaPlanszy().getTowary() >= niebez.getZabojca().ZmniejszIloscPopulacja() && Plansza.getArystokrataNaPlanszy().getZloto() >= niebez.getZabojca().ZmniejszIloscPopulacja()) {\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setTowary(Plansza.getArystokrataNaPlanszy().getTowary() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setZloto(Plansza.getArystokrataNaPlanszy().getZloto() - niebez.getZabojca().ZmniejszIloscPopulacja());\n\t\t\t\t\t\t\t\tPlansza.getArystokrataNaPlanszy().setLicznikNiebezpieczenstw(Plansza.getArystokrataNaPlanszy().getLicznikNiebezpieczenstw()+1);\n\t\t\t\t\t\t\t\tPlansza.getNiebezpieczenstwoNaPlanszy().remove(niebez);\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public static void dodavanjeTeretnogVozila() {\n\t\tString vrstaVozila = \"Teretno Vozilo\";\n\t\tString regBr = UtillMethod.unosRegBroj();\n\t\tGorivo gorivo = UtillMethod.izabirGoriva();\n\t\tGorivo gorivo2 = UtillMethod.izabirGorivaOpet(gorivo);\n\t\tint brServisa = 1;\n\t\tdouble potrosnja = UtillMethod.unesiteDoublePotrosnja();\n\t\tSystem.out.println(\"Unesite broj km koje je vozilo preslo:\");\n\t\tdouble predjeno = UtillMethod.unesiteBroj();\n\t\tdouble preServisa = 20000;\n\t\tdouble cenaServisa = 10000;\n\t\tSystem.out.println(\"Unesite cenu vozila za jedan dan:\");\n\t\tdouble cenaDan = UtillMethod.unesiteBroj();\n\t\tSystem.out.println(\"Unesite broj sedista u vozilu:\");\n\t\tint brSedista = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite broj vrata vozila:\");\n\t\tint brVrata = UtillMethod.unesiteInt();\n\t\tboolean vozObrisano = false;\n\t\tArrayList<Gorivo> gorivaVozila = new ArrayList<Gorivo>();\n\t\tgorivaVozila.add(gorivo);\n\t\tif(gorivo2!=Main.nista) {\n\t\t\tgorivaVozila.add(gorivo2);\n\t\t}\n\t\tArrayList<Servis> servisiNadVozilom = new ArrayList<Servis>();\n\t\tSystem.out.println(\"Unesite maximalnu masu koje vozilo moze da prenosi u KG !!\");\n\t\tint maxMasauKg = UtillMethod.unesiteInt();\n\t\tSystem.out.println(\"Unesite maximalnu visinu u m:\");\n\t\tdouble visinauM = UtillMethod.unesiteBroj();\n\t\tTeretnaVozila vozilo = new TeretnaVozila(vrstaVozila, regBr, gorivaVozila, brServisa, potrosnja, predjeno, preServisa,\n\t\t\t\tcenaServisa, cenaDan, brSedista, brVrata, vozObrisano, servisiNadVozilom, maxMasauKg, visinauM);\n\t\tUtillMethod.prviServis(vozilo, predjeno);\n\t\tMain.getVozilaAll().add(vozilo);\n\t\tSystem.out.println(\"Novo vozilo je uspesno dodato u sistem!\");\n\t\tSystem.out.println(\"--------------------------------------\");\n\t}", "public void steuern() {\n\t\teinlesenUndInitialisieren();\n\t\tausgabe();\n\t}", "public void pagarSaidaDaPrisao() throws Exception {\n if (listaJogadoresNaPrisao.contains(listaJogadores.get(jogadorAtual()).getNome())) {\n listaJogadoresNaPrisao.remove(listaJogadores.get(jogadorAtual()).getNome());\n listaJogadores.get(jogadorAtual()).setTentativasSairDaPrisao(0);\n listaJogadores.get(jogadorAtual()).retirarDinheiro(50);\n\n } else {\n print(\"\\tTentou tirar \" + listaJogadores.get(jogadorAtual()).getNome());\n throw new Exception(\"player is not on jail\");\n }\n\n this.pagouPrisaoRecentemente = false;\n }", "public void obrisiPredmet(String sp) {\n\t\tGlavniProzor.getControllerProfesor().obrisiPredmetKodSvihProf(sp);\t\t\n\t\t\n\t\t//Potom kod svih studenata :\n\t\tGlavniProzor.getControllerStudent().obrisiPredmetKodSvihStud(sp);\n\t\t\n\t\t//Potom iz konacne liste : \n\t\tfor(Predmet p : listaPredmeta) {\n\t\t\tif(p.getSifPred().equals(sp)) {\n\t\t\t\tlistaPredmeta.remove(p);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "protected boolean betreteSpielfeld(){\r\n\t\t\r\n\t\tint neueId;\r\n\t\t\r\n\t\tif(spiel.getBewegungsWert()==6)\r\n\t\t{\r\n\t\t\tfor(int i=0; i<4; i++){\r\n\t\t\t\tif(spieler.getFigur(i).getPosition().getTyp() == FeldTyp.Startfeld){\r\n\t\t\t\t\tneueId = spieler.getFigur(i).getFreiPosition();\r\n\t\t\t\t\tif(spiel.userIstDumm(neueId, i)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tspiel.bewege(i);\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "protected void restart()\r\n \t{\r\n \t\tspielen();\r\n \t}", "public void macheZugRueckgaengig(int spalte, int zeile, String spieler){\n\t\t\n\t\tif(spielfeld[spalte][zeile].equals(spieler)){\n\t\t\tspielfeld[spalte][zeile] = \"_\";\n\t\t}\n\t\t\t\n\t}", "public void sprawdzBonusy()\n\t{\n\t\tif(aktualnyNumerSciezki != -1)\n\t\t{\n\t\t\tpojazd.sprawdzBonus(droga.get(aktualnyNumerSciezki));\n\t\t\twyswietleniePunktow.setText(\"\" + pojazd.pobierzPunkty());\n\t\t}\n\t}", "public void zeichnen_kavalier() {\n /**\n * Abrufen der Koordinaten aus den einzelnen\n * Point Objekten des Objekts Tetraeder.\n */\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n /**\n * Aufrufen der Methode sortieren\n */\n double[][] sP = cls_berechnen.sortieren(A, B, C, D);\n\n A = sP[0];\n B = sP[1];\n C = sP[2];\n D = sP[3];\n\n /**Wenn alle z Koordinaten gleich sind, ist es kein Tetraeder. */\n if (A[2] == D[2] || (A[2]==B[2] && C[2]==D[2])) {\n System.out.println(\"kein Tetraeder\");\n return;\n }\n\n /** Transformiert x,y,z Koordinaten zu x,y Koordinaten */\n double ax, ay, bx, by, cx, cy, dx, dy;\n ax = (A[0] + (A[2] / 2));\n ay = (A[1] + (A[2] / 2));\n bx = (B[0] + (B[2] / 2));\n by = (B[1] + (B[2] / 2));\n cx = (C[0] + (C[2] / 2));\n cy = (C[1] + (C[2] / 2));\n dx = (D[0] + (D[2] / 2));\n dy = (D[1] + (D[2] / 2));\n\n tetraederzeichnen(ax, ay, bx, by, cx, cy, dx, dy);\n }", "public void rodar(){\n\t\tmeuConjuntoDePneus.rodar();\r\n\t}", "public void vaaraSyote() {\n System.out.println(\"En ymmärtänyt\");\n kierros();\n }", "public void dodaj(String ime, int starost, int pol)\n {\n // pre svega nam je potrebno da pronadjemo odgovarajuce mesto\n // za naseg novog sticenika, zbog toga sto oni moraju biti sortirani\n //\n // pre toga, proveravamo da li on vec postoji\n if(postoji(ime))\n return;\n\n Sticenik s = new Sticenik(ime, starost, pol);\n\n // prvo resavamo trivijalan slucaj, kada je lista prazna\n if(this.head == null)\n {\n s.next = this.head;\n this.head = s;\n return; // izlazimo iz metode, jer nema potrebe da proveravamo dalje\n }\n\n // posebno treba proveriti, u slucaju kada je novi sticenik stariji od prvog (head)\n // u listi\n // ovo radimo iz razloga, sto moramo da pomeramo head tj uvek dodajemo na pocetak\n if(this.head.starost >= starost)\n {\n s.next = this.head;\n this.head = s;\n return;\n }\n\n // u slucaju da se nas sticenik nalazi negde u sredini liste,\n // moramo da znamo gde je tacno, pa stoga pamtimo prethodnika\n // da bi mogli da ga uvezemo na odgovarajuce mesto\n Sticenik t = this.head; // trenutni\n Sticenik p = null; // prethodni\n\n // sada prolazimo kroz listu while petljom, dok ne naidjemo na sticenika koji je stariji od naseg\n // kada ga pronadjemo, hocemo da dodamo novog sticenika izmedju njega i prethodnika\n while(t.next != null && t.starost <= starost)\n {\n p = t;\n t = t.next;\n }\n\n // sada treba da proverimo da li je t == null\n // ako nije uvezujemo sticenika izmedju dva, a ako jeste\n // onda samo dodajemo sticenika na kraj\n if(t.next != null)\n {\n System.out.println(\"t: \" + t.next);\n p.next = s;\n s.next = t;\n }\n else\n {\n s.next = t.next;\n t.next = s;\n }\n }", "public void restarPunto ( ) {\n\t\tif ( vida > 0 )\n\t\t\tvida--;\n\t}", "public void inicjalizujRynek()\n\t{\n\t\tif (!Stale.cenyZGeneratora)\n\t\t{\n\t\t\tlistaCenWczytanaZPliku=loader.loadPrices();\n\t\t}\n\t}", "public void sendeSpielStarten();", "public void deplacements () {\n\t\t//Efface de la fenetre le mineur\n\t\t((JLabel)grille.getComponents()[this.laby.getMineur().getY()*this.laby.getLargeur()+this.laby.getMineur().getX()]).setIcon(this.laby.getLabyrinthe()[this.laby.getMineur().getY()][this.laby.getMineur().getX()].imageCase(themeJeu));\n\t\t//Deplace et affiche le mineur suivant la touche pressee\n\t\tpartie.laby.deplacerMineur(Partie.touche);\n\t\tPartie.touche = ' ';\n\n\t\t//Operations effectuees si la case ou se trouve le mineur est une sortie\n\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Sortie) {\n\t\t\t//On verifie en premier lieu que tous les filons ont ete extraits\n\t\t\tboolean tousExtraits = true;\t\t\t\t\t\t\t\n\t\t\tfor (int i = 0 ; i < partie.laby.getHauteur() && tousExtraits == true ; i++) {\n\t\t\t\tfor (int j = 0 ; j < partie.laby.getLargeur() && tousExtraits == true ; j++) {\n\t\t\t\t\tif (partie.laby.getLabyrinthe()[i][j] instanceof Filon) {\n\t\t\t\t\t\ttousExtraits = ((Filon)partie.laby.getLabyrinthe()[i][j]).getExtrait();\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Si c'est le cas alors la partie est terminee et le joueur peut recommencer ou quitter, sinon le joueur est averti qu'il n'a pas recupere tous les filons\n\t\t\tif (tousExtraits == true) {\n\t\t\t\tpartie.affichageLabyrinthe ();\n\t\t\t\tSystem.out.println(\"\\nFelicitations, vous avez trouvé la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire à present : [r]ecommencer ou [q]uitter ?\");\n\t\t\t\tString[] choixPossiblesFin = {\"Quitter\", \"Recommencer\"};\n\t\t\t\tint choixFin = JOptionPane.showOptionDialog(null, \"Felicitations, vous avez trouve la sortie, ainsi que tous les filons en \" + partie.laby.getNbCoups() + \" coups !\\n\\nQue voulez-vous faire a present :\", \"Fin de la partie\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, choixPossiblesFin, choixPossiblesFin[0]);\n\t\t\t\tif ( choixFin == 1) {\n\t\t\t\t\tPartie.touche = 'r';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tPartie.touche = 'q';\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpartie.enTete.setText(\"Tous les filons n'ont pas ete extraits !\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//Si la case ou se trouve le mineur est un filon qui n'est pas extrait, alors ce dernier est extrait.\n\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Filon && ((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getExtrait() == false) {\n\t\t\t\t((Filon)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setExtrait();\n\t\t\t\tSystem.out.println(\"\\nFilon extrait !\");\n\t\t\t}\n\t\t\t//Sinon si la case ou se trouve le mineur est une clef, alors on indique que la clef est ramassee, puis on cherche la porte et on l'efface de la fenetre, avant de rendre la case quelle occupe vide\n\t\t\telse {\n\t\t\t\tif (partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()] instanceof Clef && ((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).getRamassee() == false) {\n\t\t\t\t\t((Clef)partie.laby.getLabyrinthe()[partie.laby.getMineur().getY()][partie.laby.getMineur().getX()]).setRamassee();\n\t\t\t\t\tint[] coordsPorte = {-1,-1};\n\t\t\t\t\tfor (int i = 0 ; i < this.laby.getHauteur() && coordsPorte[1] == -1 ; i++) {\n\t\t\t\t\t\tfor (int j = 0 ; j < this.laby.getLargeur() && coordsPorte[1] == -1 ; j++) {\n\t\t\t\t\t\t\tif (this.laby.getLabyrinthe()[i][j] instanceof Porte) {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcoordsPorte[0] = j;\n\t\t\t\t\t\t\t\tcoordsPorte[1] = i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpartie.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].setEtat(true);\n\t\t\t\t\t((JLabel)grille.getComponents()[coordsPorte[1]*this.laby.getLargeur()+coordsPorte[0]]).setIcon(this.laby.getLabyrinthe()[coordsPorte[1]][coordsPorte[0]].imageCase(themeJeu));\n\t\t\t\t\tSystem.out.println(\"\\nClef ramassee !\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected ArrayList<Integer> bepaalTrioSpelers(Groep groep) {\r\n ArrayList<Integer> trio = new ArrayList<>();\r\n if (groep.getSpelers().size() == 3) {\r\n \t// 3 spelers, dus maak gelijk trio\r\n trio.add(groep.getSpelers().get(0).getId());\r\n trio.add(groep.getSpelers().get(1).getId());\r\n trio.add(groep.getSpelers().get(2).getId());\r\n return trio;\r\n }\r\n int spelerID = 0;\r\n try {\r\n spelerID = IJCController.c().getBeginpuntTrio(groep.getSpelers().size());\r\n }\r\n catch (Exception e) {\r\n \tlogger.log(Level.WARNING, \"Problem with spelersID. No int.\");\r\n }\r\n int minDelta = 1;\r\n int plusDelta = 1;\r\n int ignore = 0;\r\n boolean doorzoeken = true;\r\n while (doorzoeken) {\r\n Speler s1 = groep.getSpelerByID(spelerID);\r\n Speler s2 = groep.getSpelerByID(spelerID - minDelta);\r\n Speler s3 = groep.getSpelerByID(spelerID + plusDelta);\r\n if (isGoedTrio(s1, s2, s3, ignore)) {\r\n trio.add(s1.getId());\r\n trio.add(s2.getId());\r\n trio.add(s3.getId());\r\n return trio;\r\n } else {\r\n if ((s2 == null) || (s3 == null)) {\r\n if (ignore > 4) {\r\n doorzoeken = false;\r\n }\r\n ignore += 1;\r\n minDelta = 1;\r\n plusDelta = 1;\r\n } else {\r\n if (minDelta > plusDelta) {\r\n plusDelta++;\r\n } else {\r\n minDelta++;\r\n }\r\n }\r\n }\r\n }\r\n return trio;\r\n }", "private void aktualisierePreisanzeige(Set<Platz> plaetze)\r\n\t{\r\n\r\n\t\tif (istVerkaufenMoeglich(plaetze))\r\n\t\t{\r\n\t\t\tGeldbetrag preis = _vorstellung.getPreisFuerPlaetze(plaetze);\r\n\t\t\t_ui.getPreisLabel().setText(\"Gesamtpreis: \" + preis.toString() + \" €\");\r\n\t\t\t_preisFuerAuswahl = preis;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t_ui.getPreisLabel().setText(\"Gesamtpreis:\");\r\n\t\t}\r\n\t}", "private void nullstillFordeling(){\n int i = indeks;\n politi = -1;\n mafiaer = -1;\n venner = -1;\n mafia.nullstillSpesialister();\n spillere.tømTommeRoller();\n for (indeks = 0; roller[indeks] == null; indeks++) ;\n fordeling = null;\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public void PedirSintomas() {\n\t\t\r\n\t\tSystem.out.println(\"pedir sintomas del paciente para relizar el diagnosticoa\");\r\n\t}", "@Override\r\n\tpublic void hacerSonido() {\n\t\tSystem.out.print(\"miau,miau -- o depende\");\r\n\t\t\r\n\t}", "protected final void reduireTempsRestant() {\n arme.reduireTempsRestant();\n }", "public Pont ertesit(Pont innenlep, Szereplo sz);", "public void skalierung(){\n double scale = Double.parseDouble(skalierung_textfield.getText());\n scale = scale/100;\n\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n t1.getTetraeder()[0].setPoint(A[0]*scale,A[1]*scale,A[2]*scale);\n t1.getTetraeder()[1].setPoint(B[0]*scale,B[1]*scale,B[2]*scale);\n t1.getTetraeder()[2].setPoint(C[0]*scale,C[1]*scale,C[2]*scale);\n t1.getTetraeder()[3].setPoint(D[0]*scale,D[1]*scale,D[2]*scale);\n\n redraw();\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void snare();", "private List<ItemMovement> uitGraven(Slot slot, Gantry gantry){\n\n List<ItemMovement> itemMovements = new ArrayList<>();\n Richting richting = Richting.NaarVoor;\n\n //Recursief naar boven gaan, doordat we namelijk eerste de gevulde parents van een bepaald slot moeten uithalen\n if(slot.getParent() != null && slot.getParent().getItem() != null){\n itemMovements.addAll(uitGraven(slot.getParent(), gantry));\n }\n\n //Slot in een zo dicht mogelijke rij zoeken\n boolean newSlotFound = false;\n Slot newSlot = null;\n int offset = 1;\n do { //TODO: als storage vol zit en NaarVoor en NaarAchter vinden geen vrije plaats => inf loop\n // bij het NaarAchter lopen uw index telkens het negatieve deel nemen, dus deze wordt telkens groter negatief.\n //AANPASSING\n Integer locatie = richting==Richting.NaarVoor? (slot.getCenterY() / 10) + offset : (slot.getCenterY() / 10) - offset;\n //we overlopen eerst alle richtingen NaarVoor wanneer deze op zen einde komt en er geen plaats meer is van richting veranderen naar achter\n // index terug op 1 zetten omdat de indexen ervoor al gecontroleerd waren\n if (grondSlots.get(locatie) == null) {\n //Grootte resetten en richting omdraaien\n offset = 1;\n richting = Richting.NaarAchter;\n continue;\n }\n\n Set<Slot> ondersteRij = new HashSet<>(grondSlots.get(locatie).values());\n newSlot = GeneralMeasures.zoekLeegSlot(ondersteRij);\n\n if(newSlot != null){\n newSlotFound = true;\n }\n //telkens één slot verder gaan\n offset += 1;\n }while(!newSlotFound);\n // vanaf er een nieuw vrij slot gevonden is deze functie verlaten\n\n //verplaatsen\n itemMovements.addAll(GeneralMeasures.createMoves(pickupPlaceDuration,gantry, slot, newSlot));\n update(Operatie.VerplaatsIntern, newSlot, slot);\n\n return itemMovements;\n }", "public void loescheEintrag() {\n\t\tzahl = 0;\n\t\tistEbenenStart = false;\n\t}", "private void findeNachbarSteine(Stein pStein, java.util.List<Stein> pSteinListe, Richtung pRichtung){\n spielfeld.toFirst();\n while(spielfeld.hasAccess()){ //Schleife ueber alle Steine des Spielfelds\n Stein stein = spielfeld.getContent();\n switch(pRichtung){\n case oben:\n if (pStein.gibZeile()==stein.gibZeile()+1 && pStein.gibSpalte()==stein.gibSpalte()) {\n pSteinListe.add(stein);\n findeNachbarSteine(stein,pSteinListe,pRichtung);\n }\n break;\n case links:\n if (pStein.gibZeile()==stein.gibZeile() && pStein.gibSpalte()==stein.gibSpalte()+1) {\n pSteinListe.add(stein);\n findeNachbarSteine(stein,pSteinListe,pRichtung);\n }\n break;\n case unten:\n if (pStein.gibZeile()==stein.gibZeile()-1 && pStein.gibSpalte()==stein.gibSpalte()) {\n pSteinListe.add(stein);\n findeNachbarSteine(stein,pSteinListe,pRichtung);\n }\n break;\n case rechts:\n if (pStein.gibZeile()==stein.gibZeile() && pStein.gibSpalte()==stein.gibSpalte()-1) {\n pSteinListe.add(stein);\n findeNachbarSteine(stein,pSteinListe,pRichtung);\n }\n break;\n }\n spielfeld.next();\n }\n }", "public void sairdaPrisao(Jogador jogador) {\n print(\"\\tA prisao tinha \" + listaJogadoresNaPrisao);\n listaJogadoresNaPrisao.remove(jogador.getNome());\n\n print(\"\\tmas saiu prisioneiro e prisao agora tem \" + listaJogadoresNaPrisao);\n }", "private void pokupiIzPoljaIKreirajServisera() {\n\t\tServiser noviServiser;\n\t\tif(izmena == false) {\n\t\t\tString ime = rssv.getTfIme().getText();\n\t\t\tString prezime = rssv.getTfPrezime().getText();\n\t\t\tString JMBG = rssv.getTfJMBG().getText();\n\t\t\tPol pol = rssv.getPolBox().getSelectionModel().getSelectedItem();\n\t\t\tString adresa = rssv.getTfAdresa().getText();\n\t\t\tString brojTelefona = rssv.getTfBrojTelefona().getText();\n\t\t\tString korisnickoIme = rssv.getTfKorisnickoIme().getText();\n\t\t\tString lozinka = rssv.getTfLozinka().getText();\n\t\t\tSpecijalizacija specijalizacija = rssv.getSpecijalizacijaBox().getSelectionModel().getSelectedItem();\n\t\t\t\t\n\t\t\ttry {\n\t\t\t\tdouble plata = Double.valueOf(rssv.getTfPlata().getText());\n\t\t\t\tnoviServiser = new Serviser(ime, prezime, JMBG, pol, adresa, brojTelefona, korisnickoIme, lozinka, specijalizacija, plata);\n\t\t\t\trssv.getTabela().getItems().add(noviServiser);\n\t\t\t\tServiserController.upisiServiseraUFajl(noviServiser);\n\t\t\t\trssv.resetujPolja();\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\trssv.izbaciPorukuOGresci(e.getMessage());\n\t\t\t} catch (Exception e) {\n\t\t\t\trssv.izbaciPorukuOGresci(e.getMessage());\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tString ime = rssv.getTfIme().getText();\n\t\t\tString prezime = rssv.getTfPrezime().getText();\n\t\t\tString JMBG = rssv.getTfJMBG().getText();\n\t\t\tPol pol = rssv.getPolBox().getSelectionModel().getSelectedItem();\n\t\t\tString adresa = rssv.getTfAdresa().getText();\n\t\t\tString brojTelefona = rssv.getTfBrojTelefona().getText();\n\t\t\tString korisnickoIme = rssv.getTfKorisnickoIme().getText();\n\t\t\tString lozinka = rssv.getTfLozinka().getText();\n\t\t\tSpecijalizacija specijalizacija = rssv.getSpecijalizacijaBox().getSelectionModel().getSelectedItem();\n\t\t\t\n\t\t\ttry {\n\t\t\t\tdouble plata = Double.valueOf(rssv.getTfPlata().getText());\n\t\t\t\tnoviServiser = new Serviser(tempServiser.getOznaka(), ime, prezime, JMBG, pol, adresa, brojTelefona, korisnickoIme, lozinka, false, specijalizacija, plata);\n\t\t\t\tServiserController.izbrisiIzUcitanihServiseraSaOznakom(tempServiser.getOznaka());\n\t\t\t\trssv.getTabela().getItems().add(noviServiser);\n\t\t\t\tServiserController.upisiServiseraUFajl(noviServiser);\n\t\t\t\trssv.getTabela().getItems().remove(tempServiser);\n\t\t\t\tServiserController.sacuvajIzmeneUFajl();\n\t\t\t\trssv.resetujPolja();\n\t\t\t\t\n\t\t\t\tizmena = false;\n\t\t\t\ttempServiser = null;\n\t\t\t\t\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected void generar() {\n generar(1, 1);\n }", "protected int maakTrein(int positie){\r\n for (int i = 0; i <= treinaantal; i++){\r\n if (treinlijst[i] == null){\r\n treinlijst[i] = new Trein(positie, treinaantal++);\r\n baan.addTrein(treinlijst[i].getId());\r\n //update naar gui\r\n int trein[] = new int[1];\r\n trein[0] = treinlijst[i].getId();\r\n int[] arg = new int[1];\r\n arg[0] = positie;\r\n main.updateGui(\"trein\", trein, arg);\r\n return treinlijst[i].getId();\r\n }\r\n }\r\n return 0;\r\n }", "protected void obrisiPoljePretraga() {\n\t\ttfPretraga.setText(\"\");\r\n\t}", "public void resetMoeglichkeiten(){\t\t\n\t\tfor( int iSpalten = 0; iSpalten < kacheln.length;iSpalten++){\t\t\t\n\t\t\tfor (int jReihen = 0; jReihen < kacheln[iSpalten].length;jReihen++){\n\t\t\t\tkacheln[iSpalten][jReihen].setMoeglichkeitenHierher(null);\n\t\t\t}\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void loese(Schiebepuzzle p) {\n\t\tPoint endPos = new Point(0,0);\n\t\twhile(!p.getLocationOfField(1).equals(endPos)) {\n\t\t\tArrayList<Integer> temp = new ArrayList<>();\n\t\t\tfor(int i = 1; i <= p.maxElement(); i++) {\n\t\t\t\tif(p.istVerschiebar(i)) {\n\t\t\t\t\ttemp.add(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tint index = randInt(temp.size() - 1);\n\t\t\tp.schiebe(temp.get(index));\n\t\t}\t\t\n\t}", "public void sortiereTabelleSpiele() {\n sortListe.sort(new Comparator<Spiel>() {\n @Override\n public int compare(Spiel o1, Spiel o2) {\n /*int a=0,b=0;\n if(o1.getStatus()==0)\n {\n a-=100000;\n }\n if(o2.getStatus()==0)\n {\n b-=100000;\n }*/\n return o1.getZeitplanNummer() - o2.getZeitplanNummer();\n }\n });\n tabelle_spiele.setItems(sortListe);\n }", "public void stg() {\n\n\t}", "public void renovarBolsa() {\n\t\tSystem.out.println(\"Bolsa renovada com suceso!\");\n\t}", "public void zpracujObjednavky()\n\t{\n\t\tint idtmp = 0;\n\t\tfloat delkaCesty = 0;\n\t\t\n\t\tif (this.objednavky.isEmpty())\n\t\t{\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tNakladak nakl = (Nakladak) getVolneAuto();\n\t\t\n\t\tnakl.poloha[0] = this.poloha[0];\n\t\tnakl.poloha[1] = this.poloha[1];\n\t\tObjednavka ob = this.objednavky.remove();\n\n\t\t/*System.out.println();\n\t\tSystem.out.println(\"Objednavka hospody:\" + ob.id + \" se zpracuje pres trasu: \");\n\t\t */\n\t\tdelkaCesty += vyberCestu(this.id, ob.id, nakl);\n\t\t\n\t\twhile(nakl.pridejObjednavku(ob))\n\t\t{\n\t\t\tidtmp = ob.id;\n\t\t\t\n\t\t\tob = vyberObjednavku(ob.id);\n\t\t\tif (ob == null)\n\t\t\t{\n\t\t\t\tob=nakl.objednavky.getLast();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tobjednavky.remove(ob);\n\t\t\t\n\t\t\tdelkaCesty += vyberCestu(idtmp, ob.id, nakl);\n\t\t\t\n\t\t\tif((nakl.objem > 24)||(13-Simulator.getCas().hodina)*(nakl.RYCHLOST) + 100 < delkaCesty){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}\n\t\t\t/*\n\t\t\tif((Simulator.getCas().hodina > 12) && (delkaCesty > 80) ){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif((Simulator.getCas().hodina > 9) && (delkaCesty > 130) ){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}*/\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//cesta zpatky\n\t\tvyberCestu(ob.id, this.id, nakl);\n\t\tif (nakl.objem >= 1)\n\t\t{\n\t\t\tnakl.kDispozici = false;\n\t\t\tnakl.jede = true;\n\t\t\t//vytvoreni nove polozky seznamu pro statistiku\n\t\t\tnakl.novaStatCesta();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnakl.resetCesta();\n\t\t}\n\t}", "private boolean analyseQueryBefore(Spieler spieler,Spieler spielerB, Board board) {\r\n\t\t// Switch mit der Spielphase des Spielers\r\n\t\tboolean back = false;\r\n\t\tswitch (spieler.getSpielPhase()) {\r\n\t\t\tcase 0: \t// Werte nur Regel 1 aus\r\n\t\t\t\t\t\tList<Stein> rueckgabe = this.logikCheck.sucheZweiInGleicherReihe(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!rueckgabe.isEmpty() && !rueckgabe.get(0).equals(new Stein(0,0,0, null))) {\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe.get(0));\r\n\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\tcase 1:\t\tfor(Regel regel: uebergreifendeRegeln) {\r\n\t\t\t\t\t\t\tif(regel.getIfTeil().contains(\"eigene Steine\")) {\r\n\t\t\t\t\t\t\t\tList<Stein> getDataBack = this.logikCheck.sucheZweiGleicheReiheUnddrittenSteinDazu(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\t\t\tif(!getDataBack.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\tStein stein = getDataBack.get(1);\r\n\t\t\t\t\t\t\t\t\tdataBack.add(stein);\r\n\t\t\t\t\t\t\t\t\tFeld nachbarn = stein.convertToFeld();\r\n\t\t\t\t\t\t\t\t\tList<Feld> moeglicheZuege = nachbarn.allefreienNachbarn(board);\r\n\t\t\t\t\t\t\t\t\tif(!moeglicheZuege.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\tdataBack.add(moeglicheZuege.get(0).convertToStein());\r\n\t\t\t\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tList<Stein> zweiGegner = this.logikCheck.sucheZweiInGleicherReihe(spielerB.getPosiSteine(), board);\r\n\t\t\t\t\t\t\t\tif(!zweiGegner.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\tList<Stein> result = this.logikCheck.sucheSteinInderNäheUmGegnerZuBlocken(zweiGegner, spieler);\r\n\t\t\t\t\t\t\t\t\tif(!result.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\tStein stein = result.get(0);\r\n\t\t\t\t\t\t\t\t\t\tdataBack.add(stein);\r\n\t\t\t\t\t\t\t\t\t\tFeld nachbarn = stein.convertToFeld();\r\n\t\t\t\t\t\t\t\t\t\tList<Feld> moeglicheZuege = nachbarn.allefreienNachbarn(board);\r\n\t\t\t\t\t\t\t\t\t\tif(!moeglicheZuege.isEmpty()) {\r\n\t\t\t\t\t\t\t\t\t\t\tdataBack.add(moeglicheZuege.get(0).convertToStein());\r\n\t\t\t\t\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\tcase 2:\t\tList<Stein> rueckgabe2 = this.logikCheck.sucheZweiGleicheReiheUnddrittenSteinDazu(spieler.getPosiSteine(), board);\r\n\t\t\t\t\t\tif(!rueckgabe2.isEmpty()) {\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe2.get(0));\r\n\t\t\t\t\t\t\tdataBack.add(rueckgabe2.get(1));\r\n\t\t\t\t\t\t\tback = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault: break;\t\r\n\t\t}\r\n\t\treturn back;\r\n\t}", "public void skrivUt(){\n System.out.println(this.fornavn + \" \" + this.etternavn + \" \" + this.adresse + \" \" + this.telefonnr + \" \" + this.alder);\n }", "@Override\n public void onClick(View view) {\n Button trykket = null;\n for (int i = 0; i < 30 ; i++) {\n if (view==buttons.get(i)){\n trykket=buttons.get(i);\n }\n }\n assert trykket != null;\n gæt(trykket);\n\n //vi afslutter spiller hvis det er slut eller vundet.\n if(logik.erSpilletSlut()){\n if(logik.erSpilletTabt()){\n // die.start();\n slutspilllet(false);\n }\n if(logik.erSpilletVundet()) slutspilllet(true);\n }\n\n }" ]
[ "0.6755344", "0.64620745", "0.6334064", "0.6246789", "0.6233761", "0.61721563", "0.61424285", "0.61396664", "0.61331755", "0.6114973", "0.60803026", "0.60435355", "0.6022935", "0.60218936", "0.5995749", "0.59879494", "0.5980557", "0.597481", "0.59677255", "0.5942622", "0.5934045", "0.5910811", "0.5849422", "0.5847548", "0.5845012", "0.5820108", "0.58008057", "0.57900834", "0.57821023", "0.5781994", "0.5778501", "0.57523555", "0.5740597", "0.57384634", "0.5734356", "0.5722644", "0.57174796", "0.5708223", "0.5693474", "0.56915486", "0.5681206", "0.567545", "0.5640277", "0.5628662", "0.5617181", "0.56088173", "0.5600462", "0.55848515", "0.55756044", "0.55746007", "0.5565859", "0.55619407", "0.55611", "0.5560354", "0.55590016", "0.55512166", "0.5550314", "0.5539147", "0.55286527", "0.5528591", "0.5517158", "0.55157274", "0.55152315", "0.5512289", "0.5499607", "0.54984474", "0.54962087", "0.5494299", "0.54882693", "0.54880255", "0.54843336", "0.5482607", "0.5482508", "0.54800403", "0.5475795", "0.54755586", "0.54750353", "0.5474784", "0.5462998", "0.5460929", "0.54585624", "0.5452353", "0.544869", "0.54391026", "0.5437753", "0.5432762", "0.54314035", "0.54283184", "0.54271126", "0.54262775", "0.54184943", "0.54145736", "0.5405909", "0.5393961", "0.53845793", "0.53799003", "0.5364261", "0.5355725", "0.53512305", "0.5347176" ]
0.66729605
1
Gets the pm 3511 repository.
public Pm3511Repository getPm3511Repository() { return pm3511Repository; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Repository getSnprcEhrModulesRepository()\r\n {\r\n RepositoryBuilder repoBuilder = new RepositoryBuilder(\"optionalModules\", \"snprcEHRModules\", LicenseType.APACHE_LICENSE, BranchType.TRUNK);\r\n repoBuilder.setDirectoriesToIgnore(\r\n set(\r\n \"snprc_scheduler\"\r\n )\r\n );\r\n return repoBuilder.buildRepository();\r\n }", "private Repository getAccountsRepository()\r\n {\r\n RepositoryBuilder repoBuilder = new RepositoryBuilder(\"optionalModules\", \"accounts\", LicenseType.APACHE_LICENSE, BranchType.TRUNK);\r\n return repoBuilder.buildRepository();\r\n }", "Repository getRepository();", "public String getLocalRepository() {\r\n return localRepository;\r\n }", "RepositoryPackage getRepositoryPackage();", "synchronized Repository getRepository(String name) {\n\t\treturn repositoryMap.get(name);\n\t}", "public Repo getLatestModifiedRepository(String company) throws IOException {\n\t\tRepositoryService service = repoService;\n\t\tList<Repository> repositories = service.getRepositories(company);\n\t\t\n\t\t// if there is lack of Repositories throw Exception\n\t\tif(repositories.isEmpty()) throw new LackOfRepositoriesExcpetion(company);\n\t\t\n\t\t//sort list of repositories by latest update date\n\t\trepositories.sort((r1,r2) ->r1.getUpdatedAt().compareTo(r2.getUpdatedAt()));\n\t\t\n\t\t//create Repo to return (with latest update date)\n\t\tRepo repo = new Repo();\n\t\trepo.setRepo_name(repositories.get(repositories.size()-1).getName());\n\t\treturn repo;\n\t}", "ArtifactRepository getRepository();", "static Repo getInstance() {\n return RepoSingelton.getRepo(); //todo: refactor\n }", "private Repository getAssayReportRepository()\r\n {\r\n RepositoryBuilder repoBuilder = new RepositoryBuilder(\"optionalModules\", \"assayreport\", LicenseType.LABKEY_LICENSE, BranchType.TRUNK);\r\n return repoBuilder.buildRepository();\r\n }", "public String getRepository() {\n return repository;\n }", "public String getRepository() {\n return repository;\n }", "private RepositorySystem getRepositorySystem() {\n\t\tDefaultServiceLocator locator = MavenRepositorySystemUtils\n\t\t\t\t.newServiceLocator();\n\t\tlocator.addService(RepositoryConnectorFactory.class,\n\t\t\t\tBasicRepositoryConnectorFactory.class);\n\t\tlocator.addService(TransporterFactory.class,\n\t\t\t\tFileTransporterFactory.class);\n\t\tlocator.addService(TransporterFactory.class,\n\t\t\t\tHttpTransporterFactory.class);\n\n\t\tlocator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {\n\t\t\t@Override\n\t\t\tpublic void serviceCreationFailed(Class<?> type, Class<?> impl,\n\t\t\t\t\tThrowable exception) {\n\t\t\t\texception.printStackTrace();\n\t\t\t}\n\t\t});\n\n\t\tRepositorySystem system = locator.getService(RepositorySystem.class);\n\t\treturn system;\n\t}", "public Repository getRepository() {\n return mRepository;\n }", "Git getGit();", "String getRepositoryPath();", "String repoUrl();", "public RepositoryManager getRepositoryManager() {\n return repositoryManager;\n }", "protected SlingRepository getRepository() {\n return repository;\n }", "String getSourceRepoUrl();", "public void setPm3511Repository(Pm3511Repository pm3511Repository) {\r\n\t\tthis.pm3511Repository = pm3511Repository;\r\n\t}", "public abstract KenaiProject getKenaiProjectForRepository(String repositoryUrl) throws IOException;", "public static ObjectRepository getRepository() {\n\t\tif (_instance == null) {\n\t\t\tsynchronized (ObjectRepository.class) {\n\t\t\t\tif (_instance == null) {\n\t\t\t\t\t_instance = new ObjectRepository();\n\t\t\t\t\tif (config == null) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconfig = new PropertiesConfiguration(\n\t\t\t\t\t\t\t\t\t\"object.properties\");\n\t\t\t\t\t\t} catch (final ConfigurationException e) {\n\t\t\t\t\t\t\tSystem.err\n\t\t\t\t\t\t\t\t\t.println(\"Configuration Exception - Not able to locate object.properties\");\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn _instance;\n\t}", "private RepositorySystem newRepositorySystem()\n\t{\n\t\tDefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();\n\t\tlocator.addService( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );\n\t\tlocator.addService( TransporterFactory.class, FileTransporterFactory.class );\n\t\tlocator.addService( TransporterFactory.class, HttpTransporterFactory.class );\n\n\t\tlocator.setErrorHandler( new DefaultServiceLocator.ErrorHandler()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void serviceCreationFailed( Class<?> type, Class<?> impl, Throwable exception )\n\t\t\t{\n\t\t\t\texception.printStackTrace();\n\t\t\t}\n\t\t} );\n\n\t\treturn locator.getService( RepositorySystem.class );\n\t}", "public String getRepositoryPath() \n {\n return \"/atg/portal/gear/discussion/DiscussionRepository\";\n }", "public String getRepoURL() {\n return repoURL;\n }", "public File getRepo() {\n return _repo;\n }", "AutoCommittalRepositoryManager getAutoCommittalRepositoryManager();", "public abstract RepoDao getRepoDao();", "String getRepositoryPath(String name);", "public String getRepoUrl() {\n return \"ssh://git@\" + host() + \":\" + port() + REPO_DIR;\n }", "public static MapSummonerCommentsRepository getInstance() {\n\n\t\tif (instance == null) {\n\t\t\tinstance = new MapSummonerCommentsRepository();\n\t\t\t// instance.init();\n\t\t}\n\n\t\treturn instance;\n\t}", "private static ArtifactRepository createLocalRepository( Embedder embedder, Settings settings,\n CommandLine commandLine )\n throws ComponentLookupException\n {\n ArtifactRepositoryLayout repositoryLayout =\n (ArtifactRepositoryLayout) embedder.lookup( ArtifactRepositoryLayout.ROLE, \"default\" );\n\n ArtifactRepositoryFactory artifactRepositoryFactory =\n (ArtifactRepositoryFactory) embedder.lookup( ArtifactRepositoryFactory.ROLE );\n\n String url = settings.getLocalRepository();\n\n if ( !url.startsWith( \"file:\" ) )\n {\n url = \"file://\" + url;\n }\n\n ArtifactRepository localRepository = new DefaultArtifactRepository( \"local\", url, repositoryLayout );\n\n boolean snapshotPolicySet = false;\n\n if ( commandLine.hasOption( CLIManager.OFFLINE ) )\n {\n settings.setOffline( true );\n\n snapshotPolicySet = true;\n }\n\n if ( !snapshotPolicySet && commandLine.hasOption( CLIManager.UPDATE_SNAPSHOTS ) )\n {\n artifactRepositoryFactory.setGlobalUpdatePolicy( ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS );\n }\n\n if ( commandLine.hasOption( CLIManager.CHECKSUM_FAILURE_POLICY ) )\n {\n System.out.println( \"+ Enabling strict checksum verification on all artifact downloads.\" );\n\n artifactRepositoryFactory.setGlobalChecksumPolicy( ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL );\n }\n else if ( commandLine.hasOption( CLIManager.CHECKSUM_WARNING_POLICY ) )\n {\n System.out.println( \"+ Disabling strict checksum verification on all artifact downloads.\" );\n\n artifactRepositoryFactory.setGlobalChecksumPolicy( ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN );\n }\n\n return localRepository;\n }", "String getRepositoryUUID();", "private Repository getLabkeyApiJdbcRepository()\r\n {\n RepositoryBuilder repoBuilder = new RepositoryBuilder(\"optionalModules\", \"labkey-api-jdbc\", LicenseType.LABKEY_LICENSE, BranchType.TRUNK);\r\n return repoBuilder.buildRepository();\r\n }", "private NodeRef getompanyHomeFolder(){\n LOG.debug(\"### Executing \"+ Thread.currentThread().getStackTrace()[1].getMethodName() +\" ####\");\n return nodeLocatorService.getNode(\"companyhome\", null, null);\n }", "@Override\n\tprotected IGenericRepo<Estudiante, Integer> getRepo() {\n\t\treturn repo;\n\t}", "public abstract URI[] getKnownRepositories();", "@NonNull\n RepoPackage getPackage();", "public com.hps.july.persistence.Organization getOrganization() throws java.rmi.RemoteException, javax.ejb.FinderException;", "public Path getRepositoryGroupBaseDir();", "@Override\n\tpublic GenericRepository<Consulta, Long> getRepository() {\n\t\treturn this.consultaRepository;\n\t}", "static Repository getRepositoryFromArguments(String[] args)\n {\n File dataDir = new File(args[args.length - 2]);\n \n Repository rep = new SailRepository(new NativeStore(dataDir));\n \n try\n {\n rep.initialize();\n }\n catch (RepositoryException e)\n {\n System.err.println(\"Repository could not be initialized!\");\n System.exit(1);\n }\n \n return rep;\n }", "public String getBaseRepositoryUrl() {\n\t\treturn baseRepositoryUrl;\n\t}", "public Path getRemoteRepositoryBaseDir();", "@Override\n\t\tpublic Repository loadRepository()\n\t\t{\n\t\t\tMemoryStore store = new MemoryStore(IWBFileUtil.getFileInDataFolder(Config.getConfig().getRepositoryName()));\n\t\t\t\n\t\t\t// create a lucenesail to wrap the memorystore\n\t\t\tLuceneSail luceneSail = new LuceneSail();\n\t\t\t// let the lucene index store its data in ram\n\t\t\tluceneSail.setParameter(LuceneSail.LUCENE_RAMDIR_KEY, \"true\");\n\t\t\t// wrap memorystore in a lucenesail\n\t\t\tluceneSail.setBaseSail(store);\n\t\t\t\n\t\t\t// create a Repository to access the sails\n\t\t\treturn new SailRepository(luceneSail);\n\t\t}", "public Repository<Long, Competition> getCompetitionRepository() {\n final String repositoryType = properties.getProperty(\"competitionRepositoryType\");\n final String pathToFile = properties.getProperty(\"competitionRepositoryPathToFile\");\n final String tableName = properties.getProperty(\"competitionRepositoryTableName\");\n\n final Validator<Competition> validator = new CompetitionValidator();\n\n return switch (repositoryType) {\n case IN_MEMORY -> new InMemoryRepository<>(validator);\n case XML -> new CompetitionXmlRepository(validator, Objects.requireNonNull(pathToFile));\n case CSV -> new CompetitionFileRepository(validator, Objects.requireNonNull(pathToFile));\n case JDBC -> new CompetitionJdbcRepository(validator, getDatabaseProvider(), Objects.requireNonNull(tableName));\n default -> throw new IllegalStateException(illegalRepositoryTypeErrorMessage);\n };\n }", "public static Repository getOwlimRepository(String repositoryName) throws Exception {\n logger.info(\"Loading owlim repository with name \" + repositoryName);\n return new OwlimRepositoryFactory(repositoryName).loadRepository();\n }", "public Collection<AbstractRepository> getRepositories();", "String getRepositoryName(URL repositoryUrl);", "private ProjectMgr getPmNameTrueLoadActualProject() {\n ProjectMgr pm = null;\n try {\n pm = new ProjectMgr(\"Example\", true);\n\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (SAXException e) {\n e.printStackTrace();\n }\n\n IOException e;\n return pm;\n }", "public AccountRepository getAccountRepository() {\n\t\treturn this.accountRepository;\n\t}", "private RepositoryService getRepositoryService() {\n\t\tif (repositoryService == null && getServletContext() != null) {\n\t\t\tthis.repositoryService = (RepositoryService) getServletContext().getAttribute(\"repositoryService\");\n\t\t}\n\t\treturn this.repositoryService;\n\t}", "public OwlimRepositoryFactory() {\n\t\t\tthis(IWBFileUtil.getFileInDataFolder(Config.getConfig()\n\t\t\t\t\t\t\t.getRepositoryName()).getAbsolutePath()); \n\t\t}", "public Collection getOpenedRepositories() {\r\n\t\t\r\n\t\treturn repositories.values();\r\n\t}", "List<ArtifactoryRepo> getRepos(String instanceUrl);", "public static APIRepository getRepositoryInstance() {\n if (mApiRepository == null) {\n mApiRepository = new APIRepository();\n }\n if (mApiInterface == null) {\n mApiInterface = RetrofitClientInstance.getRetrofitInstance(AppRoot.getInstance()).create(APIInterface.class);\n }\n return mApiRepository;\n }", "protected SVNRepository getRepository() {\n\t\treturn repository;\n\t}", "@Override\n public GetRepositoryResult getRepository(GetRepositoryRequest request) {\n request = beforeClientExecution(request);\n return executeGetRepository(request);\n }", "private String getCodeRepo() throws Exception {\n\t\tObject[] options = { \"Local Git Repository\", \"Github URI\" };\n\n\t\tJFrame frame = new JFrame();\n\t\tint selection = JOptionPane.showOptionDialog(frame,\n\t\t\t\t\"Please select your type of codebase\", \"GalacticTBA\",\n\t\t\t\tJOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,\n\t\t\t\toptions, options[0]);\n\n\t\tif (selection == 1) {\n\t\t\tfolderName = \"cpsc410_\" + new Date().getTime();\n\t\t\tString baseDir = getCodeRoot(true);\n\n\t\t\tString githubURI = (String) JOptionPane.showInputDialog(frame,\n\t\t\t\t\t\"Galactic TBA:\\n\" + \"Please enter Github URI\",\n\t\t\t\t\t\"Galactic TBA\", JOptionPane.PLAIN_MESSAGE, null, null,\n\t\t\t\t\tnull);\n\n\t\t\tString dir = System.getProperty(\"user.dir\");\n\t\t\tProcess p;\n\t\t\tif (isOSWindows) {\n\t\t\t\tp = Runtime.getRuntime().exec(\n\t\t\t\t\t\t\"cmd /C \" + dir + \"\\\\scripts\\\\gitclone.sh \" + githubURI\n\t\t\t\t\t\t\t\t+ \" \" + baseDir + \"\\\\\" + folderName);\n\t\t\t} else {\n\t\t\t\tp = Runtime.getRuntime().exec(\n\t\t\t\t\t\tdir + \"/scripts/gitclone.sh \" + folderName + \"/\"\n\t\t\t\t\t\t\t\t+ baseDir);\n\t\t\t}\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tp.getInputStream()));\n\n\t\t\twhile (in.readLine() != null) {\n\t\t\t\tThread.sleep(1000);\n\t\t\t}\n\t\t\tin.close();\n\t\t\treturn baseDir + \"\\\\\" + folderName;\n\t\t} else if (selection != 0) {\n\t\t\tSystem.exit(0);\n\t\t}\n\n\t\treturn getCodeRoot(false);\n\t}", "public String getRepos() {\n return repos;\n }", "TRepo createRepo();", "RepositoryConfiguration getRepositoryConfiguration();", "public OAuth2Manager get() {\n OAuth2Manager a = this.f30636a.mo34992a((C11818g) this.f30637b.get(), (C11766a) this.f30638c.get(), (C13325v) this.f30639d.get(), (C11125d) this.f30640e.get(), C12020b.m31668a(this.f30641f), (C11791e) this.f30642g.get(), C12020b.m31668a(this.f30643h));\n C12021c.m31671a(a, \"Cannot return null from a non-@Nullable @Provides method\");\n return a;\n }", "public com.sun.org.omg.CORBA.Repository get_ir ()\n {\n org.omg.CORBA.portable.InputStream _in = null;\n try {\n org.omg.CORBA.portable.OutputStream _out = _request (\"get_ir\", true);\n _in = _invoke (_out);\n com.sun.org.omg.CORBA.Repository __result = com.sun.org.omg.CORBA.RepositoryHelper.read (_in);\n return __result;\n } catch (org.omg.CORBA.portable.ApplicationException _ex) {\n _in = _ex.getInputStream ();\n String _id = _ex.getId ();\n throw new org.omg.CORBA.MARSHAL (_id);\n } catch (org.omg.CORBA.portable.RemarshalException _rm) {\n return get_ir ();\n } finally {\n _releaseReply (_in);\n }\n }", "String getRepoType();", "public Repository repository(long id) {\n return apiClient.deserialize(apiClient.get(String.format(\"/repositories/%d\", id)), Repository.class);\n }", "@Override\r\n\tpublic RemoteDomainRepository getDatabaseRepository (UserDatabase userDatabase) {\n\t\t\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic ActRepository<CreditrepayplanAct> getActRepository() {\n\t\treturn creditrepayplanActRepository;\n\t}", "public org.jboss.com.sun.org.omg.CORBA.Repository get_ir()\n {\n org.omg.CORBA.portable.InputStream _in = null;\n try\n {\n org.omg.CORBA.portable.OutputStream _out = _request(\"get_ir\", true);\n _in = _invoke(_out);\n org.jboss.com.sun.org.omg.CORBA.Repository __result = org.jboss.com.sun.org.omg.CORBA.RepositoryHelper\n .read(_in);\n return __result;\n }\n catch (org.omg.CORBA.portable.ApplicationException _ex)\n {\n _in = _ex.getInputStream();\n String _id = _ex.getId();\n throw new org.omg.CORBA.MARSHAL(_id);\n }\n catch (org.omg.CORBA.portable.RemarshalException _rm)\n {\n return get_ir();\n }\n finally\n {\n _releaseReply(_in);\n }\n }", "public List<Repo> getRepos() {\n return repos;\n }", "static public void readRepository(){\n File cache_file = getCacheFile();\n if (cache_file.exists()) {\n try {\n // Read the cache acutally\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder = factory.newDocumentBuilder();\n Document document = builder.parse(cache_file);\n NodeList images_nodes = document.getElementsByTagName(\"image\");\n for (int i = 0; i < images_nodes.getLength(); i++) {\n Node item = images_nodes.item(i);\n String image_path = item.getTextContent();\n File image_file = new File(image_path);\n if (image_file.exists()){\n AppImage image = Resources.loadAppImage(image_path);\n images.add(image);\n }\n }\n }\n catch (Exception e) {\n throw new RuntimeException(e);\n }\n }\n }", "public static RepositoryService getInstance() {\n return instance;\n }", "@Override\n\t\tpublic Repository loadRepository()\n\t\t{\n\t\t\tNativeStore store = ReadDataManagerImpl.getNativeStore(IWBFileUtil.getFileInDataFolder(repositoryName));\n\n\t\t\t// create a lucenesail to wrap the store\n\t\t\tLuceneSail luceneSail = new LuceneSail();\n\t\t\t// store the lucene index on disk\n\t\t\tluceneSail.setParameter(LuceneSail.LUCENE_DIR_KEY, IWBFileUtil.getLuceneIndexFolder().getAbsolutePath());\n\t\t\t// wrap store in a lucenesail\n\t\t\tluceneSail.setBaseSail(store);\n\n\t\t\t// create a Repository to access the sail\n\t\t\treturn new SailRepository(luceneSail);\n\t\t}", "protected static void getLatestPack() {\n\t\tSystem.out.println(\"Getting Latest Pack Version Link...\");\n\t\ttempPackURL = ConfigHandler.packLatestLink;\n\t\tSystem.out.println(\"Link Found!\");\n\t}", "public static QuestionRepository getInstance() {\n if (sCrimeRepository == null)\n sCrimeRepository = new QuestionRepository();\n\n return sCrimeRepository;\n }", "@Override\n\tprotected List<Change> getJournalImpl(RepositoryModel repository, long ticketId) {\n\t\tJedis jedis = pool.getResource();\n\t\tif (jedis == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tList<Change> changes = getJournal(jedis, repository, ticketId);\n\t\t\tif (ArrayUtils.isEmpty(changes)) {\n\t\t\t\tlog.warn(\"Empty journal for {}:{}\", repository, ticketId);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn changes;\n\t\t} catch (JedisException e) {\n\t\t\tlog.error(\"failed to retrieve journal from Redis @ \" + getUrl(), e);\n\t\t\tpool.returnBrokenResource(jedis);\n\t\t\tjedis = null;\n\t\t} finally {\n\t\t\tif (jedis != null) {\n\t\t\t\tpool.returnResource(jedis);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Repository getFallbackRepository();", "public Repository getRepository(String repositoryId) {\r\n\t\t\r\n\t\tRepository repository = (Repository)repositories.get(repositoryId);\r\n\t\treturn repository;\r\n\t}", "public Optional<QuayRepo> getToolFromQuay(final Tool tool) {\n final String repo = tool.getNamespace() + '/' + tool.getName();\n\n try {\n final QuayRepo quayRepo = repositoryApi.getRepo(repo, false);\n return Optional.of(quayRepo);\n } catch (ApiException e) {\n LOG.error(quayToken.getUsername() + \" could not read from \" + repo, e);\n }\n return Optional.empty();\n }", "public static Repository openRepository() throws IOException {\n\t\treturn new FileRepositoryBuilder().setGitDir(new File(\"C:\\\\Users\\\\ukrolmi\\\\eclipse-workspace\\\\testing\\\\.git\")).build();\n\t}", "public Path getRepositoryBaseDir();", "public static SubmissionRepository current() {\n return theRepository;\n }", "public synchronized Repository getRepository(String currentUser, String name)\n\t\t\tthrows UserAccessException {\n\n\t\tif (!isAnonymousUser(currentUser)) {\n\t\t\tvalidateUser(currentUser);\n\t\t}\n\n\t\tRepository rep = repositoryMap.get(name);\n\t\tif (rep != null) {\n\t\t\trep.validateReadPrivilege(currentUser);\n\t\t}\n\t\treturn rep;\n\t}", "Repo get(Coordinates coords);", "public CountDownLatch fetchRepo(PitchParams pp) {\n\n final String grmKey = GitRepoModel.genKey(pp);\n log.debug(\"fetchRepo: pp={}\", pp);\n CountDownLatch freshLatch = new CountDownLatch(1);\n CountDownLatch activeLatch =\n repoLatchMap.putIfAbsent(grmKey, freshLatch);\n\n if (activeLatch != null) {\n\n /*\n * Non-null activeLatch implies a fetchRepo() operation\n * is already in progress for this /{user}/{repo}. So\n * activeLatch so caller can block until operation completes.\n */\n log.debug(\"fetchRepo: pp={}, already in progress, \" +\n \"returning existing activeLatch={}\", pp, activeLatch);\n return activeLatch;\n\n } else {\n\n GRS grs = grsManager.get(pp);\n final GRSService grsService = grsManager.getService(grs);\n String apiCall = grsService.repo(pp);\n\n log.debug(\"fetchRepo: apiCall={}\", apiCall);\n final long start = System.currentTimeMillis();\n\n WSRequest apiRequest = wsClient.url(apiCall);\n\n grs.getHeaders().forEach((k,v) -> {\n apiRequest.setHeader(k, v);\n });\n\n CompletableFuture<WSResponse> apiFuture =\n apiRequest.get().toCompletableFuture();\n\n CompletableFuture<GitRepoModel> rmFuture =\n apiFuture.thenApplyAsync(apiResp -> {\n\n log.debug(\"fetchRepo: pp={}, fetch meta time-taken={}\",\n pp, (System.currentTimeMillis() - start));\n\n log.info(\"{}: API Rate Limit Status [ {}, {} ]\",\n grs.getName(),\n apiResp.getHeader(API_RATE_LIMIT),\n apiResp.getHeader(API_RATE_LIMIT_REMAINING));\n\n try {\n\n if (apiResp.getStatus() == HTTP_OK) {\n\n try {\n\n JsonNode json = apiResp.asJson();\n GitRepoModel grm = grsService.model(pp, json);\n\n /*\n * Update pitchCache with new GitRepoModel\n * generated using GitHub API response data.\n */\n pitchCache.set(grm.key(), grm, cacheTimeout.grm(pp));\n\n } catch (Exception ex) {\n /*\n * Prevent any runtime errors, such as JSON parsing,\n * from propogating to the front end.\n */\n log.warn(\"fetchRepo: pp={}, unexpected ex={}\", pp, ex);\n }\n\n } else {\n\n log.debug(\"fetchRepo: pp={}, fail status={}\",\n pp, apiResp.getStatus());\n\n try {\n\n String remainingHdr =\n apiResp.getHeader(API_RATE_LIMIT_REMAINING);\n int rateLimitRemaining =\n Integer.parseInt(remainingHdr);\n\n if (rateLimitRemaining <= 0) {\n log.warn(\"WARNING! {} API rate limit exceeded.\", grs.getName());\n }\n\n } catch (Exception rlex) {\n }\n }\n\n } catch (Exception rex) {\n log.warn(\"fetchRepo: pp={}, unexpected runtime ex={}\", pp, rex);\n }\n\n /*\n * Current operation completed, so remove latch associated\n * with operation from repoLatchMap to permit future operations\n * on this /{user}/{repo}.\n */\n releaseCountDownLatch(repoLatchMap, grmKey);\n\n /*\n * Operation completed, valid result cached, no return required.\n */\n return null;\n\n }, backEndThreads.POOL)\n .handle((result, error) -> {\n\n if (error != null) {\n\n log.warn(\"fetchRepo: pp={}, fetch error={}\", pp, error);\n releaseCountDownLatch(repoLatchMap, grmKey);\n }\n\n return null;\n });\n\n return freshLatch;\n }\n }", "@GetMapping(\"/api/getLatest\")\n\tpublic List<Project> findlatestProject()\n\t{\n\t\treturn this.integrationClient.findlatestProject();\n\t}", "public GitRemote getRemote(String aName) { return new GitRemote(aName); }", "public Repository<Long, Participation> getParticipationRepository() {\n final String repositoryType = properties.getProperty(\"participationRepositoryType\");\n final String pathToFile = properties.getProperty(\"participationRepositoryPathToFile\");\n final String tableName = properties.getProperty(\"participationRepositoryTableName\");\n\n final Validator<Participation> validator = new ParticipationValidator();\n\n return switch (repositoryType) {\n case IN_MEMORY -> new InMemoryRepository<>(validator);\n case XML -> new ParticipationXmlRepository(validator, Objects.requireNonNull(pathToFile));\n case CSV -> new ParticipationFileRepository(validator, Objects.requireNonNull(pathToFile));\n case JDBC -> new ParticipationJdbcRepository(validator, getDatabaseProvider(), Objects.requireNonNull(tableName));\n default -> throw new IllegalStateException(illegalRepositoryTypeErrorMessage);\n };\n }", "public WorkspaceCache getWorkspace();", "public static synchronized RepositoryTransport getInstance() {\n \t\tif (instance == null) {\n \t\t\tinstance = new RepositoryTransport();\n \t\t}\n \t\treturn instance;\n \t}", "@Override\n public RepositoryWrapper getRepositories(Environment environment) {\n final Jdbi jdbi = new JdbiFactory().build(environment, this.database, \"sql\");\n\n // Create\n final PlantInRepository plantInRepository = jdbi.onDemand(PlantInRepository.class);\n final PlantOutRepository plantOutRepository = jdbi.onDemand(PlantOutRepository.class);\n final DetailInRepository detailInRepository = jdbi.onDemand(DetailInRepository.class);\n final DetailOutRepository detailOutRepository = jdbi.onDemand(DetailOutRepository.class);\n\n // Register\n environment.jersey().register(plantInRepository);\n environment.jersey().register(plantOutRepository);\n environment.jersey().register(detailInRepository);\n environment.jersey().register(detailOutRepository);\n\n return new RepositoryWrapper(plantInRepository, plantOutRepository, detailInRepository, detailOutRepository);\n }", "public String getLocalRepositoryRootFolder() {\n\t\tString userFolder = IdatrixPropertyUtil.getProperty(\"idatrix.local.reposity.root\",getRepositoryRootFolder() );\n\t\tint index = userFolder.indexOf(\"://\");\n\t\tif(index > -1 ) {\n\t\t\tuserFolder = userFolder.substring(index+3);\n\t\t}\n\t\treturn userFolder;\n\t}", "public static List<GHRepository> getUserRepos(String username) throws IOException {\n List<GHRepository> ghRepositories = new ArrayList<>();\n GitHub github = GitHub.connect();\n GHUser user = github.getUser(username);\n Map<String, GHRepository> repositories = user.getRepositories();\n if(repositories != null){\n ghRepositories.addAll(repositories.values());\n }\n return ghRepositories;\n }", "@GET\n @Produces({\"application/xml\", \"application/json\"})\n public ModelBase pull() throws NotFoundException {\n // ?? get latest ontModel directly from TopologyManager ??\n ModelBase model = NPSGlobalState.getModelStore().getHead();\n if (model == null)\n throw new NotFoundException(\"None!\"); \n return model;\n }", "private String getRemoteRepositoryName( URL url ) throws IndyDataException\n {\n final String name = repoCreator.formatId( url.getHost(), getPort( url ), 0, null, StoreType.remote );\n\n logger.debug( \"Looking for remote repo starts with name: {}\", name );\n\n AbstractProxyRepositoryCreator abstractProxyRepositoryCreator = null;\n if ( repoCreator instanceof AbstractProxyRepositoryCreator )\n {\n abstractProxyRepositoryCreator = (AbstractProxyRepositoryCreator) repoCreator;\n }\n\n if ( abstractProxyRepositoryCreator == null )\n {\n return name;\n }\n\n Predicate<ArtifactStore> filter = abstractProxyRepositoryCreator.getNameFilter( name );\n List<String> l = storeManager.query()\n .packageType( GENERIC_PKG_KEY )\n .storeType( RemoteRepository.class )\n .stream( filter )\n .map( repository -> repository.getName() )\n .collect( Collectors.toList() );\n\n if ( l.isEmpty() )\n {\n return name;\n }\n return abstractProxyRepositoryCreator.getNextName( l );\n }", "public final CompletableFuture<GetRepositoryResponse> getRepository(\n\t\t\tFunction<GetRepositoryRequest.Builder, ObjectBuilder<GetRepositoryRequest>> fn) throws IOException {\n\t\treturn getRepository(fn.apply(new GetRepositoryRequest.Builder()).build());\n\t}", "protected RemoteRepository createAntRemoteRepository( org.apache.maven.model.Repository pomRepository )\n {\n \n RemoteRepository r = new RemoteRepository();\n r.setUrl( pomRepository.getUrl() );\n r.setSnapshotPolicy( pomRepository.getSnapshotPolicy() );\n r.setLayout( pomRepository.getLayout() );\n \n Server server = getSettings().getServer( pomRepository.getId() );\n if ( server != null )\n {\n r.addAuthentication( new Authentication( server ) );\n }\n \n org.apache.maven.settings.Proxy proxy = getSettings().getActiveProxy();\n if ( proxy != null )\n {\n r.addProxy( new Proxy( proxy ) );\n }\n \n Mirror mirror = getSettings().getMirrorOf( pomRepository.getId() );\n r.setUrl( mirror.getUrl() );\n \n return r;\n }", "public String getClientRepository() {\r\n return clientRepository;\r\n }", "@Override\n\tpublic LogRepository<CreditrepayplanLog> getLogRepository() {\n\t\treturn creditrepayplanLogRepository;\n\t}" ]
[ "0.60298175", "0.5801043", "0.5795305", "0.5793669", "0.5769669", "0.57186395", "0.5705274", "0.5678369", "0.5621719", "0.55508655", "0.55183274", "0.55183274", "0.5513887", "0.54446435", "0.539905", "0.53623176", "0.5339877", "0.528297", "0.523138", "0.51665056", "0.5161375", "0.51483715", "0.5131752", "0.51307034", "0.51175785", "0.50915444", "0.5091132", "0.5085148", "0.5052174", "0.5037973", "0.5034605", "0.5031475", "0.50244784", "0.5006974", "0.500684", "0.49969822", "0.4987329", "0.49828994", "0.49697903", "0.49361923", "0.49097642", "0.49071828", "0.4880372", "0.48721752", "0.48618072", "0.4859342", "0.48551625", "0.48497438", "0.48466995", "0.4839965", "0.48394054", "0.48385262", "0.48312864", "0.48306134", "0.4813993", "0.48090604", "0.48018414", "0.4800586", "0.47989762", "0.4789767", "0.47848374", "0.47831038", "0.47576436", "0.4749266", "0.47472316", "0.47469547", "0.4745552", "0.47379997", "0.47376043", "0.47351924", "0.47332168", "0.47312394", "0.47262305", "0.47219068", "0.4703403", "0.4693981", "0.4691391", "0.46875542", "0.46820647", "0.46737987", "0.46705332", "0.4667964", "0.46459466", "0.4633421", "0.46325022", "0.46301627", "0.46283665", "0.46247795", "0.46221778", "0.4616226", "0.46119893", "0.4598846", "0.45954967", "0.4570642", "0.45657712", "0.45595476", "0.45568985", "0.45518702", "0.45517495", "0.45478553" ]
0.7224269
0
Sets the pm 3511 repository.
public void setPm3511Repository(Pm3511Repository pm3511Repository) { this.pm3511Repository = pm3511Repository; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setRepository(Repository repository);", "public void setRepository(Repository pRepository) {\n mRepository = pRepository;\n }", "public void setRepository(String repository) {\n this.repository = repository;\n }", "public void setRepository(String repository) {\n this.repository = repository;\n }", "public Pm3511Repository getPm3511Repository() {\r\n\t\treturn pm3511Repository;\r\n\t}", "public void setRepository(Repository repo) {\n\t\tthis.repo = repo;\n\t}", "public void setRepository(CollisionRepository repo) \n\t{ \n\t\tmRepo = repo; \n\t}", "public void setRepositoryManager(RepositoryManager repositoryManager) {\n this.repositoryManager = repositoryManager;\n }", "public static void updateRepositoryList() {\n \t\tassetLoader.removeAllRepositories();\n \t\tfor (String repo : MapTool.getCampaign().getRemoteRepositoryList()) {\n \t\t\tassetLoader.addRepository(repo);\n \t\t}\n \t}", "public void setRepoURL(String repoURL) {\n this.repoURL = repoURL;\n }", "void setRepoType(String repoType);", "void setRemoteUrl(String name, String url, String GIT_DIR) throws GitException, InterruptedException;", "public void setOrganization(com.hps.july.persistence.Organization anOrganization) throws java.rmi.RemoteException;", "void init() {\n List<Artifact> artifacts = null;\n final List<RepositoryInfo> infos = RepositoryPreferences.getInstance().getRepositoryInfos();\n for (final RepositoryInfo info : infos) {\n if (info.isLocal()) {\n final File localrepo = new File(info.getRepositoryPath() + File.separator\n + DEFAULT_GID_PREFIX.replace('.', '/'));\n if (localrepo.exists()) {\n artifacts = resolveArtifacts(new File(info.getRepositoryPath()), localrepo);\n }\n }\n }\n\n if (artifacts == null) {\n artifacts = new ArrayList<Artifact>(1);\n }\n\n populateLocalTree(artifacts);\n populateAppPane(model.getApps());\n }", "public Repo() {\n //this.app = Init.application;\n }", "void setPlayerLocation(Player p, int bp) {\n\t\t\tplayerLocationRepo.put(p, bp);\n\t\t}", "public static void setRepositoryConnector(OMRSRepositoryConnector localRepositoryConnector) {\n try {\n AssetCatalogAssetService.metadataCollection = localRepositoryConnector.getMetadataCollection();\n } catch (Throwable error) {\n }\n }", "void setSubmoduleUrl(String name, String url) throws GitException, InterruptedException;", "@Override\n public void setRepository(final ModelRepository repository) throws InternalErrorException {\n }", "public void setOwner(String s) {\n log(\"This option is not supported by ILASM as of Beta-2, \"\n + \"and will be ignored\", Project.MSG_WARN);\n }", "GitRemote(String aName) { _name = aName; }", "public void setTutRepositoryServerName(String tutRepositoryServerName)\n {\n this.tutRepositoryServerName = tutRepositoryServerName;\n }", "private void onNewRepo() {\n RepositoryImpl repoImpl = BugtrackingUtil.createRepository();\n if(repoImpl == null) {\n return;\n }\n Repository repo = repoImpl.getRepository();\n repositoryComboBox.addItem(repo);\n repositoryComboBox.setSelectedItem(repo);\n }", "void setSourceRepoUrl(String sourceRepoUrl);", "public void setShRepositoryName(String val) {\n\n\t\tshRepositoryName = val;\n\n\t}", "public String getLocalRepository() {\r\n return localRepository;\r\n }", "private Repository getSnprcEhrModulesRepository()\r\n {\r\n RepositoryBuilder repoBuilder = new RepositoryBuilder(\"optionalModules\", \"snprcEHRModules\", LicenseType.APACHE_LICENSE, BranchType.TRUNK);\r\n repoBuilder.setDirectoriesToIgnore(\r\n set(\r\n \"snprc_scheduler\"\r\n )\r\n );\r\n return repoBuilder.buildRepository();\r\n }", "public void setLobby(Lobby l){\r\n\t\tthis.lobby = l;\r\n\t}", "public void setRepositoryListener(AbstractRepositoryListener repositoryListener) {\n\t\tthis.repositoryListener = repositoryListener;\t\n\t\tSystem.out.println(\"set new repo listener OK\");\n\t}", "public void setPlayer(ViewerManager2 player) {\n this.player = player;\n // the player is needed to be existent befor starting up the remote Server\n //startRemoteServer();\n\n }", "public void setManagingComponent(ProjectComponent pc) {\n this.managingPc = pc;\n }", "public void setUserRepository (UserRepository userRepository) {\n\t\tthis.userRepository = userRepository; \n\t}", "public void start() {\n System.out.println(\"OBRMAN started\");\n ApamManagers.addManager(this, 3);\n OBRMan.obr = new OBRManager(null, repoAdmin);\n obr.startWatchingRepository();\n }", "public RepositoryAssignment()\r\n\t{\r\n\t\tteamMembers = new ArrayList<String>();\r\n\t}", "public void setManager(String manager) {\n this.manager = manager;\n }", "public void setRepos(String repos) {\n this.repos = repos;\n }", "void setRepositoryPermissionsToReadOnly(URL repositoryUrl, String projectKey, String username) throws Exception;", "private static ArtifactRepository createLocalRepository( Embedder embedder, Settings settings,\n CommandLine commandLine )\n throws ComponentLookupException\n {\n ArtifactRepositoryLayout repositoryLayout =\n (ArtifactRepositoryLayout) embedder.lookup( ArtifactRepositoryLayout.ROLE, \"default\" );\n\n ArtifactRepositoryFactory artifactRepositoryFactory =\n (ArtifactRepositoryFactory) embedder.lookup( ArtifactRepositoryFactory.ROLE );\n\n String url = settings.getLocalRepository();\n\n if ( !url.startsWith( \"file:\" ) )\n {\n url = \"file://\" + url;\n }\n\n ArtifactRepository localRepository = new DefaultArtifactRepository( \"local\", url, repositoryLayout );\n\n boolean snapshotPolicySet = false;\n\n if ( commandLine.hasOption( CLIManager.OFFLINE ) )\n {\n settings.setOffline( true );\n\n snapshotPolicySet = true;\n }\n\n if ( !snapshotPolicySet && commandLine.hasOption( CLIManager.UPDATE_SNAPSHOTS ) )\n {\n artifactRepositoryFactory.setGlobalUpdatePolicy( ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS );\n }\n\n if ( commandLine.hasOption( CLIManager.CHECKSUM_FAILURE_POLICY ) )\n {\n System.out.println( \"+ Enabling strict checksum verification on all artifact downloads.\" );\n\n artifactRepositoryFactory.setGlobalChecksumPolicy( ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL );\n }\n else if ( commandLine.hasOption( CLIManager.CHECKSUM_WARNING_POLICY ) )\n {\n System.out.println( \"+ Disabling strict checksum verification on all artifact downloads.\" );\n\n artifactRepositoryFactory.setGlobalChecksumPolicy( ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN );\n }\n\n return localRepository;\n }", "public void setOrgExecutor(java.lang.String newOrgExecutor) {\n\torgExecutor = newOrgExecutor;\n}", "public void setOrganization(com.hps.july.persistence.Organization arg0) throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n\n instantiateEJB();\n ejbRef().setOrganization(arg0);\n }", "public void setManager(String manager)\r\n {\r\n m_manager = manager;\r\n }", "public void setClientRepository(String clientRepository) {\r\n this.clientRepository = clientRepository;\r\n }", "private Repository getAssayReportRepository()\r\n {\r\n RepositoryBuilder repoBuilder = new RepositoryBuilder(\"optionalModules\", \"assayreport\", LicenseType.LABKEY_LICENSE, BranchType.TRUNK);\r\n return repoBuilder.buildRepository();\r\n }", "void SetOwner(int passedOwner) {\n if(passedOwner == 0 || passedOwner == 1) {\n owner = passedOwner;\n }\n else {\n Log.d(\"MyError\", \"Error in setting the owner of a build in the build class.\");\n }\n }", "private Repository getAccountsRepository()\r\n {\r\n RepositoryBuilder repoBuilder = new RepositoryBuilder(\"optionalModules\", \"accounts\", LicenseType.APACHE_LICENSE, BranchType.TRUNK);\r\n return repoBuilder.buildRepository();\r\n }", "public void setPackage()\n {\n ensureLoaded();\n m_flags.setPackage();\n setModified(true);\n }", "public void setManager(String manager) {\n\n if (manager.isEmpty()) {\n\n System.out.println(\"Manager must not be empty\");\n /**\n * If Owner manager is ever an empty String, a NullPointerException will be thrown when the\n * listings are loaded in from the JSON file. I believe this is because the JSON parser we're\n * using stores empty Strings as \"null\" in the .json file. TODO this fix is fine for now, but\n * I want to make it safer in the future.\n */\n this.manager = \" \";\n } else {\n\n this.manager = manager;\n }\n }", "public void setRepoData(String[] repoData) {\n mRepoData = repoData;\n notifyDataSetChanged();\n }", "public void setOwner(com.hps.july.persistence.OrganizationAccessBean newOwner) {\n\towner = newOwner;\n}", "public static void setLocalVersion() {\n Properties prop = new Properties();\n try {\n prop.setProperty(\"updateID\", \"\"+UPDATE_ID); //make sure this matches the server's updateID\n prop.setProperty(\"name\", \"\"+VERSION_NAME);\n prop.store(\n new FileOutputStream(System.getProperty(\"user.home\") + \"/sheepfarmsimulator/client.properties\"), null);\n\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "@TaskAction\n public void configureRepository() throws IOException {\n GitHub github = GitHub.connect(null, getGithubToken());\n String user = github.getMyself().getLogin();\n GHRepository repository = null;\n\n try {\n repository = github.getRepository(user + \"/\" + getRepositoryName());\n }\n catch (FileNotFoundException e) {\n GHCreateRepositoryBuilder repositoryCreator = github.createRepository(getRepositoryName());\n repository = repositoryCreator.create();\n }\n\n String description = getRepositoryDescription();\n\n if (description != null && !description.equals(repository.getDescription())) {\n repository.setDescription(description);\n }\n }", "public void setEmployeeRepository(final EmployeeRepository employeeRepository) {\r\n this.employeeRepository = employeeRepository;\r\n }", "void setOwner(String owner);", "public void setGuid(Guid param) {\n this.localGuid = param;\n }", "public void setRepositoryFileName(String repositoryFileName) {\n this.repositoryFileName = repositoryFileName;\n }", "protected void createRepository() throws Exception {\r\n\t\t\r\n\t\t//Creating MLSesame Connection object Using MarkLogicRepositoryConfig\r\n\t\t\r\n\t\tMarkLogicRepositoryConfig adminconfig = new MarkLogicRepositoryConfig();\r\n\t\tadminconfig.setHost(host);\r\n\t\tadminconfig.setAuth(\"DIGEST\");\r\n\t\tadminconfig.setUser(\"admin\");\r\n\t\tadminconfig.setPassword(\"admin\");\r\n\t\tadminconfig.setPort(restPort);\r\n\t\tRepositoryFactory factory = new MarkLogicRepositoryFactory();\r\n Assert.assertEquals(\"marklogic:MarkLogicRepository\", factory.getRepositoryType());\r\n try {\r\n\t\t\ttestAdminRepository = (MarkLogicRepository) factory.getRepository(adminconfig);\r\n\t\t} catch (RepositoryConfigException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n try {\r\n\t\t\ttestAdminRepository.initialize();\r\n\t\t\ttestAdminCon = (MarkLogicRepositoryConnection) testAdminRepository.getConnection();\r\n\t\t} catch (RepositoryException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n \r\n // Creating testAdminCon with MarkLogicRepositoryConfig constructor\r\n testAdminCon.close();\r\n testAdminRepository.shutDown();\r\n testAdminRepository = null; \r\n testAdminCon = null; \r\n \r\n adminconfig = new MarkLogicRepositoryConfig(host,restPort,\"admin\",\"admin\",\"DIGEST\");\r\n Assert.assertEquals(\"marklogic:MarkLogicRepository\", factory.getRepositoryType());\r\n testAdminRepository = (MarkLogicRepository) factory.getRepository(adminconfig);\r\n testAdminRepository.initialize();\r\n \r\n testAdminCon = testAdminRepository.getConnection();\r\n Assert.assertTrue(testAdminCon instanceof MarkLogicRepositoryConnection);\r\n \r\n Repository otherrepo = factory.getRepository(adminconfig);\r\n RepositoryConnection conn = null;\r\n try{\r\n \t //try to get connection without initializing repo, will throw error\r\n conn = otherrepo.getConnection();\r\n Assert.assertTrue(false);\r\n }\r\n catch(Exception e){\r\n \tAssert.assertTrue(e instanceof RepositoryException);\r\n \tAssert.assertTrue(conn == null);\r\n \totherrepo.shutDown();\r\n }\r\n \r\n Assert.assertTrue(testAdminCon instanceof MarkLogicRepositoryConnection);\r\n graph1 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/Graph1\");\r\n graph2 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/Graph2\");\r\n dirgraph = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/dirgraph\");\r\n dirgraph1 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/dirgraph1\");\r\n \r\n \r\n //Creating MLSesame Connection object Using MarkLogicRepository overloaded constructor\r\n if(testReaderCon == null || testReaderRepository ==null){\r\n \ttestReaderRepository = new MarkLogicRepository(host, restPort, \"reader\", \"reader\", \"DIGEST\");\r\n\t try {\r\n\t\t\t\ttestReaderRepository.initialize();\r\n\t\t\t\tAssert.assertNotNull(testReaderRepository);\r\n\t\t\t\ttestReaderCon = (MarkLogicRepositoryConnection) testReaderRepository.getConnection();\r\n\t\t\t} catch (RepositoryException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t Assert.assertTrue(testReaderCon instanceof MarkLogicRepositoryConnection);\r\n\t \r\n\t }\r\n \r\n \r\n //Creating MLSesame Connection object Using MarkLogicRepository(databaseclient) constructor\r\n if (databaseClient == null){\r\n \tdatabaseClient = DatabaseClientFactory.newClient(host, restPort, \"writer\", \"writer\", DatabaseClientFactory.Authentication.valueOf(\"DIGEST\"));\r\n }\r\n \t\t\r\n\t\tif(testWriterCon == null || testWriterRepository ==null){\r\n\t\t\ttestWriterRepository = new MarkLogicRepository(databaseClient);\r\n\t\t\tqmgr = databaseClient.newQueryManager();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\ttestWriterRepository.initialize();\r\n\t\t\t\tAssert.assertNotNull(testWriterRepository);\r\n\t\t\t\ttestWriterCon = (MarkLogicRepositoryConnection) testWriterRepository.getConnection();\r\n\t\t\t} catch (RepositoryException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void changeOwner(String o){\n owner = o;\r\n }", "void setModBookFilePath(Path modBookFilePath);", "public void setLobby(Lobby lobby)\r\n\t{\r\n\t\treceiver.setLobby(lobby);\t\r\n\t}", "public String getRepoUrl() {\n return \"ssh://git@\" + host() + \":\" + port() + REPO_DIR;\n }", "public void setHost(LobbyPlayer player) {\n DocumentReference doc = Firebase.docRefFromPath(\"lobbies/\" + player.getLobbyCode());\n doc.update(FieldPath.of(\"players\", player.getUsername(), \"host\"), true);\n }", "public void openRepository( String repositoryName ) throws MetaStoreException {\n gitSpoonMenuController.openRepo( repositoryName );\n }", "@Inject\n public RDF4J_DataCollector(LocalRepositoryManager manager) {\n this.manager = new RepoManagerWrapper(manager);\n }", "private void createNewRepository() {\n\t\tRepositoryConfiguration conf = repositorySettingsJPanel\n\t\t\t\t.getRepositoryConfiguration();\n\n\t\t/*\n\t\t * if (RepositoryType.HTTP.equals(conf.getType())) { new\n\t\t * MessageDialog(this, \"TBD\",\n\t\t * \"The support for HTTP repository is not implemented yet\"\n\t\t * ).setVisible(true); return; }\n\t\t */\n\n\t\tif (!validateRepositoryConfiguration(conf)) {\n\t\t\t// fixme igor; mark what is wrong!!\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tContextHolder.getInstance().getApplicationConfiguration()\n\t\t\t\t\t.addRepositoryConfiguration(conf);\n\t\t} catch (AddRepositoryException e) {\n\t\t\tnew MessageDialog(this, \"Cannot create new repository\",\n\t\t\t\t\te.getMessage()).setVisible(true);\n\t\t\treturn;\n\t\t}\n\n\t\tAppEventsManager.getInstance().fireRepositoriesChanagedEvent(this);\n\t\tdispose();\n\t}", "public String getRepoURL() {\n return repoURL;\n }", "public void setTool(Tool t) {\n\ttool = t;\n }", "public void setRepositoryName(@Nullable String name) {\n this.repositoryName = name;\n }", "public void set(Lobby lobby) {\n Firebase.setDocument(\"lobbies/\" + lobby.getGameCode(), LobbyDTO.fromModel(lobby));\n }", "public void setOrigen(java.lang.String param){\n \n this.localOrigen=param;\n \n\n }", "public void set(String gr) {\n simConnection.doCommand(cmd(gr));\n }", "public ProjectModule() {\n packaging = AutomationConstant.PACKAGING_POM;\n }", "public void setLastLogin() {\r\n game.settings.setLastSeen(strDate);\r\n }", "protected void setProject(MavenProject project)\n {\n this.project = project;\n }", "public Repository (FileSystem def) {\n this.system = def;\n java.net.URL.setURLStreamHandlerFactory(\n new org.openide.execution.NbfsStreamHandlerFactory());\n init ();\n }", "public static void initRepository() {\n deserialize();\n if (flightRepository == null) {\n flightRepository = new FlightRepository();\n }\n }", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "public void setConfigChangeSetRepository(String configChangeSetRepository) {\n this.configChangeSetRepository = configChangeSetRepository;\n }", "public void secondarySetOrganization(com.hps.july.persistence.Organization anOrganization) throws java.rmi.RemoteException;", "void setPackager(String packager);", "private static void setCredentials(String nick, String passwd, String channel, String currency) {\r\n IRC.nick = nick.toLowerCase();\r\n IRC.passwd = passwd;\r\n \r\n if (channel.startsWith(\"#\")) {\r\n IRC.channel = channel;\r\n IRC.admin = capName(channel.substring(1));\r\n }\r\n else {\r\n IRC.channel = \"#\" + channel;\r\n IRC.admin = capName(channel);\r\n }\r\n IRC.currency = currency;\r\n }", "public LoadRepositoryInfoTask(RepositoryActivity activity) {\n mTarget = new WeakReference<RepositoryActivity>(activity);\n }", "@Override\n\tpublic void setHomeTeam() {\n\t\t\n\t}", "public GitChangesetConverter(org.eclipse.jgit.lib.Repository repository)\n {\n this(repository, null);\n }", "public void setOwner(UserModel param) {\n localOwnerTracker = true;\n\n this.localOwner = param;\n }", "public void setRallyPoint (Location3D rallyPoint) {\n myRallyPoint = rallyPoint;\n }", "public static void setAccountsLastModified(long timestamp) {\r\n log.debug(\"Setting accountsLastModified to \" + timestamp);\r\n accountsLastModified = timestamp;\r\n }", "public void setSiteExporter(DraftSiteExporter initSiteExporter) {\n siteExporter = initSiteExporter;\n }", "public void setManagerID(int managerID) { this.managerID = managerID; }", "public LunchModel(LunchRepo repo) {\n this.repo = repo;\n }", "@Override\r\n\tprotected void prepareForUseImpl(TaskMonitor monitor,\r\n\t\t\tObjectRepository repository) {\n\t\t\r\n\t}", "public void setCacheDirectory(String directory) {\n this.localRepository = directory;\n this.customized = true;\n }", "public void set_next_local_commitment_number(long val) {\n\t\tbindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val);\n\t}", "public void setProjectLocation(int i, int j) {\n// Location l = new Location();\n int[] l = Location.init();\n Location.setLocationId(l, i);\n l = Location.addLocationPos(l, j);\n// l.setLocationId(i);\n// l.addLocationPos(j);\n this.locations.add(l);\n }", "public String getRepository() {\n return repository;\n }", "public String getRepository() {\n return repository;\n }", "public void setHost(Player roomHost) {\r\n this.roomHost = roomHost;\r\n }", "private void setProject()\n\t{\n\t\tproject.setName(tf0.getValue().toString());\n \t\tproject.setDescription(tf8.getValue().toString());\n \t\tproject.setEndDate(df4.getValue());\n \t\tif (sf6.getValue().toString().equals(\"yes\"))project.setActive(true);\n \t\telse project.setActive(false);\n \t\tif (!tf7.getValue().toString().equals(\"\"))project.setBudget(Float.parseFloat(tf7.getValue().toString()));\n \t\telse project.setBudget(-1);\n \t\tproject.setNextDeadline(df5.getValue());\n \t\tproject.setStartDate(df3.getValue());\n \t\ttry \n \t\t{\n \t\t\t\tif (sf1.getValue()!=null)\n\t\t\t\tproject.setCustomerID(db.selectCustomerforName( sf1.getValue().toString()));\n\t\t}\n \t\tcatch (SQLException|java.lang.NullPointerException e) \n \t\t{\n \t\t\tErrorWindow wind = new ErrorWindow(e); \n \t UI.getCurrent().addWindow(wind);\t\t\n \t e.printStackTrace();\n\t\t\t}\n \t\tproject.setInserted_by(\"Grigoris\");\n \t\tproject.setModified_by(\"Grigoris\");\n \t\tproject.setRowversion(1);\n \t\tif (sf2.getValue()!=null)project.setProjectType(sf2.getValue().toString());\n \t\telse project.setProjectType(null);\n\t }", "@Override\n public void onInitRepositoryStructure() {\n if (model != null) {\n if (model.isMultiModule()) {\n doRepositoryStructureInitialization(DeploymentMode.VALIDATED);\n } else if (model.isSingleProject()) {\n repositoryManagedStatusUpdater.initSingleProject(projectContext.getActiveRepository(),\n projectContext.getActiveBranch());\n } else if (!model.isManaged()) {\n repositoryManagedStatusUpdater.updateNonManaged(projectContext.getActiveRepository(),\n projectContext.getActiveBranch());\n }\n }\n }", "@Override\n public void setContributorURI(String arg0)\n {\n \n }", "void setTechStuff(com.hps.july.persistence.Worker aTechStuff) throws java.rmi.RemoteException;" ]
[ "0.6123217", "0.5794862", "0.5646765", "0.5646765", "0.55834246", "0.5527648", "0.54887176", "0.5141668", "0.5106595", "0.50703794", "0.50534284", "0.5035586", "0.4997972", "0.4980235", "0.49548802", "0.49259114", "0.48643595", "0.4853971", "0.48217937", "0.48093617", "0.48045996", "0.48010024", "0.47848552", "0.47708678", "0.47487354", "0.47107062", "0.47097814", "0.47046158", "0.46958795", "0.46949852", "0.46747065", "0.46510458", "0.46391252", "0.46390837", "0.46371907", "0.46370855", "0.46205398", "0.4616476", "0.45795035", "0.4577609", "0.45729828", "0.4537126", "0.4531285", "0.453025", "0.4518234", "0.45119464", "0.44997302", "0.4497208", "0.44835627", "0.44809055", "0.44648883", "0.445974", "0.44477695", "0.4441467", "0.443696", "0.4435461", "0.44263706", "0.4424446", "0.44233206", "0.4420282", "0.44028565", "0.43995136", "0.43950468", "0.43944857", "0.43938094", "0.43919623", "0.438786", "0.43839747", "0.4378637", "0.43771833", "0.43738744", "0.43724638", "0.43644634", "0.43581355", "0.43509224", "0.4347601", "0.43451583", "0.43442333", "0.43403307", "0.4340065", "0.4334615", "0.43288216", "0.43278906", "0.43097526", "0.4307341", "0.42986017", "0.42942157", "0.42921036", "0.42908692", "0.42885178", "0.42880264", "0.42828774", "0.42790404", "0.4277702", "0.4277702", "0.42758986", "0.42756513", "0.42721352", "0.42714462", "0.42697543" ]
0.6437217
0
constructor with no dimension values
public Player(int x, int y, int vx, int vy) { this.x = x; this.y = y; this.vx = vx; this.vy = vy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected SimpleMatrix() {}", "public MultiArrayDimension() {\n\t\tthis(\"\", 0, 0);\n\t}", "public Complex(){\r\n\t this(0,0);\r\n\t}", "public Matrix33() {\r\n // empty\r\n }", "public Complex() {\n this(0);\n }", "public Shape() { this(X_DEFAULT, Y_DEFAULT); }", "public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }", "public VectorGridSlice() {\n\n }", "public UnivariateStatsData() {\n super();\n }", "protected DenseMatrix()\n\t{\n\t}", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "public JXGraph() {\r\n this(0.0, 0.0, -1.0, 1.0, -1.0, 1.0, 0.2, 4, 0.2, 4);\r\n }", "TwoDShape5() {\n width = height = 0.0;\n }", "public VariableGridLayout() {\n\t\tthis(FIXED_NUM_ROWS, 1, 0, 0);\n\t}", "public WeatherGridSlice() {\n super();\n }", "public IntArrays()\n\t{\n\t\tthis(10);\n\t}", "public Matrix() {\n\tmatrix = new Object[DEFAULT_SIZE][DEFAULT_SIZE];\n }", "@Model\r\n\tpublic Vector() {\r\n\t\tthis(50,50);\r\n\t}", "public GenericDynamicArray() {this(11);}", "Matrix()\n {\n x = new Vector();\n y = new Vector();\n z = new Vector();\n }", "public Vector() {\n construct();\n }", "Constructor() {\r\n\t\t \r\n\t }", "public DoubleMatrixDataset() {\r\n }", "public LinesDimension1() {\n \n }", "public RegularGrid() {\r\n }", "public ContasCorrentes(){\n this(0,\"\",0.0,0.0,0);\n }", "public Sudoku() {\n\t\tgrid = new Variable[ROWS][COLUMNS];\n\t}", "public AStar2D() {\n super( new Grid2D(20, 20) );\n }", "public OpticalElements() {\n }", "public Generic(){\n\t\tthis(null);\n\t}", "public Grid() {\n }", "public Matrix(){\r\n\t\t\r\n\t\t//dim = dimension; for now, only 3-dim. matrices are being handled\r\n\t\tmat = new int[dim][dim];\r\n\t\t\r\n\t\tfor(int rowi = 0; rowi < dim; rowi++ )\r\n\t\t\tfor (int coli = 0; coli < dim; coli++)\r\n\t\t\t\tmat[rowi][coli]=0;\r\n\t}", "public MultiShape3D()\n {\n this( (Geometry)null, (Appearance)null );\n }", "public DiscMesh() {\n this(1f, 25);\n }", "public SpecimenArray()\r\n\t{\r\n\t\tsuper();\r\n\t}", "public Square () {\r\n super();\r\n \r\n }", "public DimensionProperties() {\n }", "public MultiShapeLayer() {}", "public DynamicArray() {\n this(16);\n }", "public Constructor(){\n\t\t\n\t}", "public CircularGrid() {\r\n\t\tthis(0, false, false);\r\n\t}", "public LifeComponent() {\n // call other constructor with null param\n this(null);\n }", "public Property() {\n this(0, 0, 0, 0);\n }", "private D3() {\n super(3);\n }", "public Cenario1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(900, 600, 1);\n adicionar();\n \n }", "public OriginalSparseVector () {}", "public Square() {\n this(\"x\", false, false);\n }", "public BasicKPartiteGraph() {\n\t\tthis(\"none\",UNLIMITED_PARTITIONS);\n\t}", "public JTensor() {\n this(TH.THTensor_(new)());\n }", "public DateAxis() { this(null); }", "public DTLZ5_2D() {\r\n super(12, 2);\r\n }", "public Grid()\n {\n height = 4;\n\twidth = 4;\n\tcases = new Case[height][width];\n }", "public CompositeData()\r\n {\r\n }", "protected SquareDungeon() throws IllegalMaximumDimensionsException {\r\n\t\tthis(Point.CUBE);\r\n\t}", "public Mesh() {\n this(DEFAULT_COORDS);\n }", "Rectangle()\n {\n this(1.0,1.0);\n }", "public StsPoint2D()\n\t{\n\t}", "public DataSet() {\r\n \r\n }", "public Identity()\n {\n super( Fields.ARGS );\n }", "public Vector(double x, double y, double z) {\n super(new double[][] {\n { x },\n { y },\n { z },\n { 1 }\n });\n }", "public ExpandableArray() {\n\n\t}", "public Data() {}", "public Field(){\n\n // this(\"\",\"\",\"\",\"\",\"\");\n }", "@SuppressWarnings(\"unused\")\n public Coordinate() {}", "public ArrayContainer() {\n this(DEFAULT_CAPACITY);\n }", "Composite() {\n\n\t}", "public CubeEarth() {\n this(1, null);\n }", "public AllDifferent()\n {\n this(0);\n }", "public ScaleInformation() {\n\t\tthis(0.0, 0.0, 800.0, 540.0, 800, 540);\n\t}", "public Shape() {\n\t\tthis(DEFAULT_X_POS, DEFAULT_Y_POS, DEFAULT_DELTA_X, DEFAULT_DELTA_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t}", "public BinaryMatrixNew() {\n\t\t\tsuper(Matrixes.<R, C>newValidating(PredicateUtils.inBetween(0d, 1d)));\n\t\t}", "public Triangle() {\n this(0,0,0,0,0);\n }", "public Board()\r\n\t{\r\n\t\tsuper(8, 8);\r\n\t}", "public Square()\r\n {\r\n super();\r\n }", "public Layer() {\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tfor (int j = 0; j < 16; j++) {\n\t\t\t\tgrid[i][j] = false;\n\t\t\t}\n\t\t}\n\t}", "public Matrix() {\n matrix = new double[DEFAULT_SIZE][DEFAULT_SIZE];\n }", "public SparseVector() {\n }", "Fraction () {\n this (0, 1);\n }", "private FplList() {\n\t\tshape = new FplValue[0][];\n\t}", "defaultConstructor(){}", "public Fahrzeug() {\r\n this(0, null, null, null, null, 0, 0);\r\n }", "Cube()\r\n\t{\r\n\t\t//System.out.println(\"We are in constructor\");\r\n\t\tlength=10;\r\n\t\tbredth=20;\r\n\t\theight=30;\r\n\t}", "public HorizontalCoords() {\n }", "public Short2DPoint() {\n this(0,0);\n }", "Matrix(){\n matrixVar = new double[1][1];\n rows = 1;\n columns = 1;\n }", "public Classroom()\n { \n // Create a new world with 10x6 cells with a cell size of 130x130 pixels.\n super(10, 6, 130); \n prepare();\n }", "public Point2d() {\r\n\t // Call two-argument constructor and specify the origin.\r\n\t\t this(0, 0);\r\n\t\t System.out.println(\"Point2d default initiializing\");\r\n\t }", "public PQR() {}", "private Vect3() {\n\t\tthis(0.0,0.0,0.0);\n\t}", "public AnalysisDef() {}", "Rectangle() {\r\n\t\tlength = 1.0;\r\n\t\twidth = 1.0;\r\n\t}", "public salida()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(600, 400, 1); \r\n }", "public DiscreteTag(){}", "protected SimpleHeatmapNodeModel() {\r\n\t\tsuper(1, 0);\r\n\t}", "protected Shape() {}", "public Nodo() {\n\t\tthis(null, null);\n\t}", "public VectorImage() {\n\t}", "public VOIVector() {\r\n super();\r\n }", "public D() {}", "public PantallaVictoria()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(400, 600, 1); \n prepare();\n }", "public Pixel() {\r\n\t\t}" ]
[ "0.7226805", "0.68926233", "0.6784418", "0.6675314", "0.66722274", "0.66245306", "0.65963805", "0.6504279", "0.65035915", "0.6481795", "0.6408954", "0.63946843", "0.6390135", "0.63837916", "0.6374397", "0.63735133", "0.63538355", "0.6336664", "0.63245344", "0.62880105", "0.62594104", "0.62552863", "0.6255195", "0.6233639", "0.62319326", "0.6217153", "0.62153256", "0.620131", "0.6195655", "0.6189067", "0.6157667", "0.6149386", "0.61447966", "0.6135145", "0.61230654", "0.61200106", "0.6119707", "0.6117092", "0.6115894", "0.61095065", "0.6096316", "0.60957545", "0.60954535", "0.6088667", "0.6083925", "0.60799557", "0.60762525", "0.60738873", "0.6067764", "0.6057247", "0.6053343", "0.60521", "0.6042996", "0.60363466", "0.6032415", "0.60307306", "0.6027707", "0.60208434", "0.60160255", "0.6014687", "0.6012691", "0.6010952", "0.6008614", "0.6004647", "0.5995601", "0.59906167", "0.5984323", "0.5969935", "0.59559256", "0.5954626", "0.59512943", "0.59511036", "0.5949552", "0.59495455", "0.59439963", "0.59433424", "0.5942111", "0.59409726", "0.5940186", "0.59331036", "0.593039", "0.5929174", "0.59281826", "0.5921073", "0.59148395", "0.59145266", "0.5911648", "0.5907515", "0.59031135", "0.58999425", "0.5895673", "0.58956695", "0.5894936", "0.588788", "0.5886436", "0.58829165", "0.58783114", "0.5875827", "0.58740383", "0.5872476", "0.5866639" ]
0.0
-1
Create a List of Articles with Randomly Generated Fields with the size indicated in the 'articleNumber' property of testdata.properties
public List<Article> generateArticles(Data data) { List<Article> articles = new ArrayList<>(); for (int i = 0; i < Integer.parseInt(data.getArticleNumber()); i++) { articles.add(new Article( data.getArticle().getTitle() + RandomStringUtils.random(5, false, true), data.getArticle().getDescription() + RandomStringUtils.random(5, false, true), data.getArticle().getBody(), data.getArticle().getTags() + RandomStringUtils.random(5, false, true) )); } return articles; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void autoGenerateData(List<ArticleModel> list, int n) {\r\n\t\t\r\n\t\tfor (int i = 1; i <= n; i++) {\r\n\t\t\t\r\n\t\t\tarticleModel = new ArticleModel();\r\n\t\t\t\r\n\t\t\tarticleModel.setId(++autoId);\r\n\t\t\tarticleModel.setTitle(\"title\" + i);\r\n\t\t\tarticleModel.setAuthor(\"author\" + i);\r\n\t\t\tarticleModel.setContent(\"hellololo\" + i);\r\n\t\t\tarticleModel.setDateByAuto(); \r\n\t\t\t\r\n\t\t\tlist.add(articleModel);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "private static List<Article> createArticleList() {\n List<Article> articles = new ArrayList();\n articles.add(new Article(1l, \"Ball\", new Double(5.5), Type.TOY));\n articles.add(new Article(2l, \"Hammer\", new Double(250.0), Type.TOOL));\n articles.add(new Article(3l, \"Doll\", new Double(12.75), Type.TOY));\n return articles;\n }", "public void setupArticlesList();", "public void setArticles(ArrayList<Article> articles_list) {\n Log.d(TAG, \"setArticles: RETURNED: \" + articles_list.toString());\n for (int i=0; i < 10; i++) {\n nu_array.add(articles_list.get(i));\n }\n\n Log.d(TAG, \"setArticles: ARTICLES: \" + nu_array.toString());\n }", "private RandomData() {\n initFields();\n }", "@Given(\"an Article exists under the Section\")\r\n\tpublic void createArticle(){\n\t\ttestArticle = new ArticleModel();\r\n\t\ttestArticle.setId(\"3236549\");\r\n\t\ttestArticle.setDefaultValues(baseFeedDomain);\r\n\t\ttestArticle.setTitle(\"automation 3 article title\");\r\n\t\ttestArticle.setState(\"published\");\r\n\t\ttestArticle.setParentName(\"automation3published\");\r\n\t\ttestArticle.setAuthorFirstName(\"tto\");\r\n\t\ttestArticle.setAuthorLastName(\"Administrator\");\r\n\t\t\t\r\n\t\ttestArticle.setStandFirst(\"automation 3 article standfirst\");\r\n\t\ttestArticle.setSectionNameOverride(\"automation 3 article section name override\");\r\n\t\ttestArticle.setTitleprefix(\"automation 3 article times sport title prefix\");\r\n\t\ttestArticle.setHeadlineTitleOverride(\"automation 3 article headline changed\");\r\n\t\ttestArticle.setArticleStandFirstOverride(\"automation 3 article standfirst changed\");\r\n\t\ttestArticle.setArticleBodyOverride(\"automation 3 article body - changed \");\r\n\t\t\r\n\t\ttestArticle.setFeedLink(baseFeedDomain + \"article/\" + 3236549);\r\n\t\ttestArticle.setArticleBodyOverride(\"<p>\\nautomation 3 article body - changed \\n</p>\\n\");\r\n\t\ttestArticle.setBody(\"<p>\\nautomation 3 article body\\n</p>\\n\");\r\n\t\ttestArticle.setCategory(\"article\");\r\n\t\ttestArticle.setAuthorFirstName(\"tto\");\r\n\t\ttestArticle.setAuthorLastName(\"Administrator\");\r\n\t\ttestArticle.setAuthorId(\"2\");\r\n\t\ttestArticle.setFeedLink(baseFeedDomain + \"article/3236549\");\r\n\t\ttestArticle.setHeadline(\"automation 3 article headline\");\r\n\t\ttestArticle.setAuthorUri(baseFeedDomain + \"author/\" + testArticle.getAuthorId());\r\n\t\t\r\n\t\t//TODO re-implement this once cms asset creation/teardown is available\r\n//\t\tString articleId = cmsHelper.createArticle(testArticle);\r\n//\t\ttestArticle.setArticleId(articleId);\r\n\t\t\t\t\r\n\t}", "@BeforeEach\n public void createList() {\n myListOfInts = new ArrayListDIY<>(LIST_SIZE);\n listOfInts = new ArrayList<>(LIST_SIZE);\n\n getRandomIntStream(0,10).limit(LIST_SIZE)\n .forEach(elem -> {\n listOfInts.add(elem);\n myListOfInts.add(elem);\n });\n }", "public ArrayList<Article> getTopNumberArticles(int number) throws Exception {\n String sql = \"SELECT TOP(?) * FROM dbo.Article\\n\"\n + \"ORDER BY [time] DESC\";\n ArrayList<Article> articles = new ArrayList<>();\n Connection con = null;\n PreparedStatement st = null;\n ResultSet rs = null;\n try {\n con = getConnection();\n st = con.prepareStatement(sql);\n st.setInt(1, number);\n rs = st.executeQuery();\n while (rs.next()) {\n Article a = new Article();\n a.setId(rs.getInt(\"id\"));\n a.setTitle(rs.getString(\"title\"));\n a.setContent(rs.getString(\"content\"));\n a.setDescription(rs.getString(\"description\"));\n a.setImage(getImgPath() + rs.getString(\"image\"));\n a.setTime(rs.getTimestamp(\"time\"));\n a.setAuthor(rs.getString(\"author\"));\n articles.add(a);\n }\n } catch (Exception ex) {\n throw ex;\n } finally {\n closeResultSet(rs);\n closePreparedStatement(st);\n closeConnection(con);\n }\n return articles;\n }", "public List<Articleimage> getArticleImageList(Article article){\n \n UrlGenerator urlGen = new UrlGenerator();\n String imageKeyIdTemp = urlGen.getNewURL();\n \n List<Articleimage> articleimageList = new ArrayList<>();\n Document doc = Jsoup.parse(article.getArtContent());\n Elements elements = doc.getElementsByTag(\"img\");\n \n \n for(int i=0; i< elements.size(); i++){ \n String artImagekeyid = String.valueOf(i)+imageKeyIdTemp;\n \n String artImgsrc=elements.get(i).attr(\"src\");\n String artImgalt=elements.get(i).attr(\"alt\");\n String artImgcssclass=elements.get(i).attr(\"class\");\n String artImgcssstyle=elements.get(i).attr(\"style\");\n \n Articleimage articleimage = new Articleimage( artImgsrc, artImgcssclass,\n \t\t\t artImgcssstyle, artImgalt, artImagekeyid);\n articleimageList.add(articleimage);\n }\n return articleimageList;\n }", "@Override protected List<String> initialize(int size){\n container.clear();\n container.addAll(Arrays.asList(Generated.array(String.class, new RandomGenerator.String(), size)));\n return container;\n }", "public void fillProducts(int totalEntries) {\n Fairy fairy = Fairy.create();\n TextProducer text = fairy.textProducer();\n StoreAPI storeOperations = new StoreAPIMongoImpl();\n for (int i = 0; i < totalEntries; i++) {\n storeOperations.addProduct(i, text.sentence(getRandomNumber(1, 10)), text.paragraph(getRandomNumber(1, 50)), (float) getRandomNumber(1, 3000), getRandomNumber(1, 5000));\n }\n }", "public List<Food> requestAction4(){\n\n List<Food> foodList = new ArrayList<>();\n Food food = new Food();\n for(int i=0;i<10;i++){\n\n Random random = new Random();\n int n = random.nextInt(10) +1;\n // random.nextInt(10) + 1;\n food.setId(i+1);\n food.setName(\"Food :\"+n);\n food.setDescriptiom(\"Food Description.................. \"+i);\n\n foodList.add(food);\n\n }\n\n\n return foodList;\n }", "public static Map<Integer, Integer> getRandomARs(int size) {\n Map<Integer, Integer> output = new HashMap<Integer, Integer>();\n Random rndm = new Random();\n while (output.size() < size) {\n int author = rndm.nextInt(40);\n int review = rndm.nextInt(5) + 1;\n output.put(author, review);\n }\n return output;\n }", "private static List<Integer> initLista(int tamanho) {\r\n\t\tList<Integer> lista = new ArrayList<Integer>();\r\n\t\tRandom rand = new Random();\r\n\r\n\t\tfor (int i = 0; i < tamanho; i++) {\r\n\t\t\tlista.add(rand.nextInt(tamanho - (tamanho / 10) + 1)\r\n\t\t\t\t\t+ (tamanho / 10));\r\n\t\t}\r\n\t\treturn lista;\r\n\t}", "private List<OrderElement> generateElements(int maxElems) {\n List<OrderElement> elements = new ArrayList();\n\n for (int i = 0; i < intRandom(maxElems); i++) {\n elements.add(new OrderElement(randomProductName(), randomPrice()));\n }\n return elements;\n }", "private void createTestData() {\n for (int i = startKey; i < startKey + numKeys; i++) {\n keys.add(i);\n }\n }", "@Test\n void generate25Words() {\n // given\n Board board = new Board();\n board.generateWords(WordsReader.read(\"words.json\"));\n List<Word> words;\n // when\n words = board.getWordList();\n // then\n assertEquals(25, words.size());\n assertNotNull(words.get(0));\n assertNotNull(words.get(1));\n assertNotNull(words.get(2));\n assertNotNull(words.get(24));\n }", "@Before\r\n\tpublic void setUp() {\r\n\t\tRandom r = new Random();\r\n\t\tmyID = r.nextInt(100);\r\n\t\tmyEntryData = new Entry_Database();\r\n\t\tfor (int i = 0; i < 20; i++) {\r\n\t\t\tEntry e = new Entry(myID);\r\n\t\t\te.setCat(\"Science\");\r\n\t\t\te.setEntry(new File(\"example.txt\"));\r\n\t\t\te.setName(\"Test Name\");\r\n\t\t\te.setNotes(\"\");\r\n\t\t\te.setScore(0);\r\n\t\t\tmyEntryData.addEntry(myID, e);\r\n\t\t}\r\n\t}", "@Test \n\tpublic void generateListsTest() {\n\t\tHomePage homePage = new HomePage(driver);\n\t\thomePage.OpenPage();\n\n\t\t// select 'lists' radio button \n\t\thomePage.selectContentType(\"lists\");\n\n\t\t// enter '9' in the count field \n\t\thomePage.inputCount(\"9\");\n\n\t\t// click \"Generate Lorum Ipsum\" button\n\t\thomePage.generateLorumIpsum();\n\t\tGeneratedPage generatedPage = new GeneratedPage(driver);\n\n\t\t// validate the number of lists generated \n\t\tint listCount = generatedPage.getActualGeneratedCount(\"lists\");\n\t\tAssert.assertTrue(\"Incorrect list count\",listCount == 9);\n\n\t\t// validate the report text // ex: \"Generated 10 paragraphs, 1106 words, 7426 bytes of Lorem Ipsum\" \n\t\tAssert.assertEquals(\"Generated \" + generatedPage.getReport(\"paragraphs\") + \n\t\t\t\t\" paragraphs, \" + generatedPage.getReport(\"words\") + \n\t\t\t\t\" words, \" + generatedPage.getReport(\"bytes\") + \n\t\t\t\t\" bytes of Lorem Ipsum\", generatedPage.getCompleteReport()); \n\n\t}", "public ArticleData() {\r\n\t\tid = Constants.EMPTY_STRING;\r\n\t\tname = Constants.EMPTY_STRING;\r\n\t\turl = Constants.EMPTY_STRING;\r\n\t\tdesc = Constants.EMPTY_STRING;\r\n\t\tlevels = Constants.EMPTY_STRING;\r\n\t\twebSiteId = Constants.EMPTY_STRING;\r\n\t\tmatched = Constants.EMPTY_STRING;\r\n\t\tcreateBy = Constants.EMPTY_STRING;\r\n\t\tcreateDate = Constants.EMPTY_STRING;\r\n\t\tlastUpdateBy = Constants.EMPTY_STRING;\r\n\t\tlastUpdateDate = Constants.EMPTY_STRING;\r\n\t\tenabled = Constants.EMPTY_STRING;\r\n\t\tpostTableName = Constants.EMPTY_STRING;\r\n\t\treturnPage = Constants.EMPTY_STRING;\r\n\t\twebSiteShowName = Constants.EMPTY_STRING;\r\n\t\treturnDirect = Constants.EMPTY_STRING;\r\n\t\tkeyWordTableName = Constants.EMPTY_STRING;\r\n\t\ttitle = Constants.EMPTY_STRING;\r\n\t\ttitleCounter = Constants.EMPTY_STRING;\r\n\t\tbufferStartCounter = Constants.EMPTY_STRING;\r\n\t\tbufferEndCounter = Constants.EMPTY_STRING;\r\n\t\tcatId = Constants.EMPTY_STRING;\r\n\t\tpostUrl = Constants.EMPTY_STRING;\r\n\t}", "public void randomize()\n {\n for (int i=0; i<list.length; i++)\n list[i] = (int)(Math.random() * 100) + 1;\n }", "public void generateRandomQuestions(){\r\n numberHolder = new ArrayList<>(NUMBER_OF_QUESTIONS);\r\n for (int i = 0; i < NUMBER_OF_QUESTIONS; i++)\r\n numberHolder.add(i);\r\n\r\n Collections.shuffle(numberHolder);\r\n System.out.println(numberHolder);\r\n\r\n }", "Article createArticle();", "@Override\r\n\tpublic void initialize() {\n\t\tRandom randomGenerator = new Random();\r\n\t\tthis.size = Helper.getRandomInRange(1, 9, randomGenerator);\r\n\t\tif (this.size % 2 == 0)\r\n\t\t\tthis.size--;\r\n\t}", "private void fillRandomList()\n\t{\n\t\trandomList.add(\"I like cheese.\");\n\t\trandomList.add(\"Tortoise can move faster than slow rodent.\");\n\t\trandomList.add(\"I enjoy sitting on the ground.\");\n\t\trandomList.add(\"I like cereal.\");\n\t\trandomList.add(\"This is random.\");\n\t\trandomList.add(\"I like typing\");\n\t\trandomList.add(\"FLdlsjejf is my favorite word.\");\n\t\trandomList.add(\"I have two left toes.\");\n\t\trandomList.add(\"Sqrt(2) = 1.414213562 ...\");\n\t\trandomList.add(\"Hi mom.\");\n\t}", "public Army(int armySize){\n\t\trnd = new Random();\n\t\tunitList = new LinkedList<>();\n\t\tlogger = CsvLogger.getInstance();\n\n\t\tfor(int i=0;i<armySize;i++){\n\t\t\tunitList.add(getRandomCacheUnit());\n\t\t}\n\t}", "private static void createPlayfulSet() {\n\n\t\trandomKeys = new ArrayList<>();\n\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT1);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT2);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT3);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT4);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT5);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT6);\n\t\trandomKeys.add(GuessRevealerConstants.RANDOM_TEXT7);\n\t\trandomKeys.add(GuessRevealerConstants.END);\n\n\t\trandomCount = randomKeys.size();\n\n\t}", "public PostingList(int df, int N)\n {\n documentFrequency = df;\n totalNoOfDocuments = N;\n }", "public List<Article> processAllArticles(List<ArticleGeneral> allArticles) {\n\t\t\tDocument document;\n\t\t\tList<Article> articles = new ArrayList<Article>();\n\t\t\tfor (ArticleGeneral articleGeneral : allArticles) {\n\t\t\t\tdocument = connectToPage(articleGeneral.getLink());\n\t\t\t\tString nameItem = getNameOfArticle(document);\n\t\t\t\tString color = getColorOfArticle(document);\n\t\t\t\tString price = getPriceOfArticle(document);\n\t\t\t\tList<String> sizes = getSizesOfArticle(document);\n\t\t\t\tboolean isSoldOut = true;\n\t\t\t\tif (!sizes.isEmpty()) {\n\t\t\t\t\tisSoldOut = false;\n\t\t\t\t}\n\t\t\t\tString link = document.baseUri();\n\t\t\t\tArticle article = new Article(nameItem, color, price, sizes, isSoldOut, link);\n\t\t\t\tarticles.add(article);\n\t\t\t\tSystem.out.println(document.select(\"h1\"));\n\t\t\t}\n\t\t\treturn articles;\n\t}", "@Test\n\t@DisplayName(\"GET /api/article - Success\")\n\tpublic void testGetAllArticles() throws Exception {\n\t\tmockMvc.perform(get(\"/api/article/\"))\n\t\t.andExpect(status().isOk())\n\t\t.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n\t\t.andExpect(jsonPath(\"$.article.length\").value(2));\n\t}", "private void addRandomSpecialEditionCard(List<CardCollection.Item> result, int count) {\n List<String> possibleCards = new ArrayList<String>();\n possibleCards.addAll(_specialEditionSetRarity.getAllCards());\n filterNonExistingCards(possibleCards);\n Collections.shuffle(possibleCards, _random);\n addCards(result, possibleCards.subList(0, Math.min(possibleCards.size(), count)), false);\n }", "public static ArrayList<Integer> createRandomList(int n) {\n\n\t\tArrayList<Integer> list = new ArrayList<>();\n\t\tRandom rand = new Random();\n\n\t\tint max = 1000000;\n\t\tint min = -1000000;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint value = (int) ((Math.random() * (max - min)) + min);\n\t\t\tlist.add(value);\n\t\t}\n\t\treturn list;\n\t}", "public ListNode createList(int len) {\r\n\t\tListNode head = null;\r\n\t\tRandom r = new Random(10);\r\n\t\tfor (int i = 0; i < len; ++i) {\r\n\r\n\t\t\thead = createNode(head, r.nextInt(20) + 1);\r\n\t\t}\r\n\r\n\t\treturn head;\r\n\t}", "@Test\n public void addArticle(){\n User user = userDao.load(3);\n Article article = new Article();\n article.setUser(user);\n// article.setTitle(\"1896\");\n articleDao.add(article);\n }", "public List<Article> getArticleListByTopicAndKey(String topicCode, String key, int size);", "public ArtItemBuilder(){\n this.r = new Random();\n }", "public void updateArticlesList(int expectedReadingDurationInMinutes);", "@BeforeClass\n\tpublic static void generatingItems() {\n\t\tfor (Item i : allItems) {\n\t\t\tif (i.getType().equals(\"spores engine\")) {\n\t\t\t\titem4 = i;\n\t\t\t}\n\t\t}\n\t\tltsTest = new LongTermStorage();\n\t\tltsTest1 = new LongTermStorage();\n\t}", "public static ObjectList<DynamicPart[]> defaultSeeds(int numberOfCuboids) {\n DynamicModelPart temp = new DynamicModelPart(0, 0, 0, 0);\n ObjectList<DynamicPart[]> SEEDS = new ObjectArrayList<DynamicPart[]>();\n for (int index = 0; index < numberOfCuboids; index++) {\n DynamicPart[] parts = new DynamicPart[DynamicModelPart.DYNAMIC_ENUM_LENGTH];\n for (int dEnumIndex =\n 0; dEnumIndex < DynamicModelPart.DYNAMIC_ENUM_LENGTH; dEnumIndex++) {\n DYNAMIC_ENUM dEnum = DYNAMIC_ENUM.values()[dEnumIndex];\n DynamicPart part = temp.new DynamicPart(dEnum,\n (DEFAULT_STATE.length - 1 < dEnumIndex)\n ? DEFAULT_STATE[DEFAULT_STATE.length - 1]\n : DEFAULT_STATE[dEnumIndex],\n (DEFAULT_MIN.length - 1 < dEnumIndex) ? DEFAULT_MIN[DEFAULT_MIN.length - 1]\n : DEFAULT_MIN[dEnumIndex],\n (DEFAULT_MAX.length - 1 < dEnumIndex) ? DEFAULT_MAX[DEFAULT_MAX.length - 1]\n : DEFAULT_MAX[dEnumIndex],\n 0F, // value\n (DEFAULT_LERP_PERCENT.length - 1 < dEnumIndex)\n ? DEFAULT_LERP_PERCENT[DEFAULT_LERP_PERCENT.length - 1]\n : DEFAULT_LERP_PERCENT[dEnumIndex],\n (DEFAULT_APPLY_RANDOM_MAX.length - 1 < dEnumIndex)\n ? DEFAULT_APPLY_RANDOM_MAX[DEFAULT_APPLY_RANDOM_MAX.length - 1]\n : DEFAULT_APPLY_RANDOM_MAX[dEnumIndex],\n (DEFAULT_APPLY_RANDOM_MIN.length - 1 < dEnumIndex)\n ? DEFAULT_APPLY_RANDOM_MIN[DEFAULT_APPLY_RANDOM_MIN.length - 1]\n : DEFAULT_APPLY_RANDOM_MIN[dEnumIndex],\n (DEFAULT_APPLY_RANDOM_MULTIPLIER.length - 1 < dEnumIndex)\n ? DEFAULT_APPLY_RANDOM_MULTIPLIER[DEFAULT_APPLY_RANDOM_MULTIPLIER.length\n - 1]\n : DEFAULT_APPLY_RANDOM_MULTIPLIER[dEnumIndex]);\n parts[dEnumIndex] = part;\n }\n SEEDS.add(index, parts);\n }\n return SEEDS;\n }", "@Override\n protected List<String> initialize(int size) {\n String[] ia = Generated.array(String.class,\n new RandomGenerator.String(), size);\n return Arrays.asList(ia);\n }", "public ArrayList<String[]> recommendByArticle(int articleId, int topN) {\n ArrayList<String[]> recommendations = new ArrayList<String[]>();\n try {\n if (connection != null) {\n String query = \"SELECT TOP \" + topN + \" [tblPatterns].[ePrintID], [Title], SUM([patternRating])\\n\"\n + \"FROM [capstone].[dbo].[tblPatterns]\\n\"\n + \"INNER JOIN [capstone].[dbo].[OriginaltblArticleInfo]\\n\"\n + \"ON [tblPatterns].[ePrintID] = [OriginaltblArticleInfo].[ePrintID]\\n\"\n + \"WHERE [patternID] IN\\n\"\n + \"(SELECT patternID FROM [capstone].[dbo].[tblPatterns]\\n\"\n + \"WHERE [ePrintID] = \" + articleId + \")\\n\"\n + \"AND [tblPatterns].[ePrintID] <> \" + articleId + \"\\n\"\n + \"GROUP BY [tblPatterns].[ePrintID], [Title]\\n\"\n + \"ORDER BY SUM([patternRating]) DESC;\";\n Statement statement = connection.createStatement();\n ResultSet rs = statement.executeQuery(query);\n while (rs.next()) {\n String[] recommendation = {\n rs.getString(1),\n rs.getString(2),\n rs.getString(3)\n };\n recommendations.add(recommendation);\n }\n rs.close();\n } else {\n System.out.print(\"No database connection\");\n }\n } catch (SQLException e) {\n System.out.print(e.getMessage());\n } catch (NullPointerException e) {\n System.out.print(e.getMessage());\n }\n return recommendations;\n }", "public int[] fillDatabase()\n {\n int [] db = new int [20];\n \n \n for (int i = 0; i < db.length; i++)\n {\n db[i] = new java.util.Random().nextInt(25);\n }\n return db;\n }", "public RandomizedCollection() {\n nums = new ArrayList<>();\n num2Index = new HashMap<>();\n rand = new Random();\n }", "private Line[] makeTenRandomLines() {\n Random rand = new Random(); // create a random-number generator\n Line[] lines = new Line[NUM_LINE];\n for (int i = 0; i < NUM_LINE; ++i) {\n int x1 = rand.nextInt(400) + 1; // get integer in range 1-400\n int y1 = rand.nextInt(300) + 1; // get integer in range 1-300\n int x2 = rand.nextInt(400) + 1; // get integer in range 1-400\n int y2 = rand.nextInt(300) + 1; // get integer in range 1-300\n lines[i] = new Line(x1, y1, x2, y2);\n }\n return lines;\n }", "Article() {\n\t\tthis.title = \"\";\n\t\tthis.firstPage = 0;\n\t\tthis.lastPage = 0;\n\t}", "private static ListNode initializeListNode() {\n\n\t\tRandom rand = new Random();\n\t\tListNode result = new ListNode(rand.nextInt(10)+1);\n\t\t\n\t\tresult.next = new ListNode(rand.nextInt(10)+1);\n\t\tresult.next.next = new ListNode(rand.nextInt(10)+1);\n\t\tresult.next.next.next = new ListNode(rand.nextInt(10)+1);\n\t\tresult.next.next.next.next = new ListNode(rand.nextInt(10)+1);\n\t\t\n\t\treturn result;\n\t}", "@GetMapping(\"random-list/{id}\")\n\tpublic List<Movie> getRandomList(@PathVariable(\"id\") int limit){\n\t\tRandom rand = new Random();\n\t\tList<Movie> list1 = repo.findAll();\n\t\tList<Movie> list = new ArrayList<Movie>();\n\t\tfor (int i = 0; i <= limit; i++) {\n\t\t\tint num1 = rand.nextInt(list1.size()) + 1;\n\t\t\tlist.add(repo.findById(num1));\n\t\t\t\n\t\t}\n\t\treturn list;\n\t}", "void createArray(int n) {\n numbers = new int[n];\n for ( int i = 0; i < n; i++){\n numbers[i] = random.nextInt(1000);\n }\n }", "public RandomizedCollection() {\n map=new HashMap();\n li=new ArrayList();\n rand=new Random();\n }", "public static List<Integer> prepareRandomIntegeArrayList(int size) {\n\t\tList<Integer> arrayList = new ArrayList<>(size);\n\t\tfor (int j = 0; j < size; j++) {\n\t\t\tarrayList.add(j, (int) ((Math.random() * 1000000)));\n\t\t}\n\t\treturn arrayList;\n\t}", "public List<Integer> randomAD() {\n\t\tList<Integer> ads = new ArrayList<Integer>();\n\t\tads.add(getRandomInteger(0, 100));\n\t\treturn(ads);\n\t}", "@Override\n\tpublic List<Article> getAllArticles() {\n\t\tArticle[] article = restTemplate.getForObject(serviceUrl+\"/\", Article[].class);\n\t\treturn Arrays.asList(article);\n\t}", "public void init() {\n for (int i = 1; i <= 20; i++) {\n List<Data> dataList = new ArrayList<Data>();\n if (i % 2 == 0 || (1 + i % 10) == _siteIndex) {\n dataList.add(new Data(i, 10 * i));\n _dataMap.put(i, dataList);\n }\n }\n }", "public static void createArrays() {\r\n\t\tRandom rand = new Random();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tint size = rand.nextInt(5) + 5;\r\n\t\t\tTOTAL += size;\r\n\t\t\tArrayList<Integer> numList = new ArrayList<>();\r\n\t\t\tfor (int j = 0; j < size; j++) {\r\n\t\t\t\tint value = rand.nextInt(1000) + 1;\r\n\t\t\t\tnumList.add(value);\r\n\t\t\t}\r\n\t\t\tCollections.sort(numList);\r\n\t\t\tarrayMap.put(i + 1, numList);\r\n\t\t}\r\n\t}", "public Integer[] randomizeObject(int inputSize){\n Integer[] list = new Integer[inputSize];\n for(int i = 0; i < inputSize; i++){\n // generate numbers within absolute range of input size to increase the chance to get distinct elements\n list[i] = ThreadLocalRandom.current().nextInt(-inputSize, inputSize + 1);\n }\n // System.out.println(Arrays.toString(list));\n return list;\n }", "public void randomize()\n {\n int max = list.length;\n for (int i=0; i<list.length; i++)\n list[i] = (int)(Math.random() * max) + 1;\n }", "protected static ArrayList<String> GenNumber() {\n\n ArrayList<String> initialList = new ArrayList<>();\n\n initialList.add(\"1\"); //Add element\n initialList.add(\"2\");\n initialList.add(\"3\");\n initialList.add(\"4\");\n initialList.add(\"5\");\n initialList.add(\"6\");\n initialList.add(\"7\");\n initialList.add(\"8\");\n initialList.add(\"9\");\n\n Collections.shuffle(initialList); //Random the position\n\n return initialList;\n }", "public void saveArticlesList();", "public Article() {\n\t\t/*\n\t\t * This field is updated on insert\n\t\t */\n\t\tthis.articleCreatedDate = new Date(new java.util.Date().getTime());\n\t}", "@Before\n public void setUp() throws Exception {\n lego = new CSVReader();\n array = lego.getLegoArrayList();\n collection = new NewDoublyLinkedList();\n\n for(String[] number : array){\n String numb = number[0];\n numb = numb.replace(\"\\\"\", \"\");\n collection.add(Integer.parseInt(numb)); //Voegt alle elementen toe aan de newlinkedlist\n }\n }", "private static GridLineSet generateRandomTestLines(GridGraph gridGraph,\n int amount) {\n GridLineSet gridLineSet = new GridLineSet();\n \n Random rand = new Random();\n for (int i=0; i<amount; i++) {\n int x1 = rand.nextInt(gridGraph.sizeX);\n int y1 = rand.nextInt(gridGraph.sizeY);\n int x2 = rand.nextInt(gridGraph.sizeX);\n int y2 = rand.nextInt(gridGraph.sizeY);\n \n Experiment.testAndAddLine(x1,y1,x2,y2,gridGraph,gridLineSet);\n }\n \n return gridLineSet;\n }", "public Test(ArrayList<WrittenQuestion> questions){\r\n\t\tmyQuestions = new ArrayList<WrittenQuestion>();\r\n\t\tfor(WrittenQuestion q : questions){\r\n\t\t\tif(q instanceof Question){\r\n\t\t\t\tmyQuestions.add(new Question((Question)q));\r\n\t\t\t}else{\r\n\t\t\t\tmyQuestions.add(new WrittenQuestion(q));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(allIDs==null){\r\n\t\t\tallIDs = new ArrayList<Integer>();\r\n\t\t\tfor (int i = 0; i<1000; i++){\r\n\t\t\t\tallIDs.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tRandom r = new Random();\r\n\t\tid = allIDs.remove((int)(r.nextInt(allIDs.size())));\r\n\r\n\t}", "public FaceRecognitionTests(){\n for(int i = 0; i < 25; i++){\n idsToTest.add(new Long(i + 15));\n }\n }", "private static void initializeLargeRandomList(List<Student> foo) \r\n\t{\r\n\t\t/** query the user for the number of items to sort */\r\n\t\tString amountOfData = JOptionPane.showInputDialog(\"Enter the number of data items\");\r\n\t\tint n = Integer.parseInt ( amountOfData );\r\n\r\n\t\t/** create a list of Strings that is very un-sorted */\r\n\t\tfor ( int i=n-1; i >= 0; i-- ) \r\n\t\t\tfoo.add( new Student(\"alice \" + (n+i), \"MTH\") ); \r\n\t}", "public static void generateSeedData()\n\t{\n\t\teventIDCounter = 1; //set counter for ID of events to 1\n\t\t\n\t\t// generate the grid world\n\t\tfor(int i = 0; i <= (MAX_COORDS*2); i++)\n\t\t{\n\t\t\tfor(int j = 0; j <= (MAX_COORDS*2); j++)\n\t\t\t{\n\t\t\t\tgridWorld[i][j] = new Coordinate(i-MAX_COORDS,j-MAX_COORDS);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Assumption that there will be 1 event to every 10 coordinates\n\t\t// grid of 21*21=441, 441/10=44\n\t\tint numOfEvents = ((MAX_COORDS*2)+1)*((MAX_COORDS*2)+1)/10;\n\t\tEvent newEvent;\n\t\tint newXCoord;\n\t\tint newYCoord;\n\t\tTicket ticket;\n\t\tArrayList<Ticket> tickets;\n\t\t\n\t\tfor(int i = 1; i <= numOfEvents; i++)\n\t\t{\n\t\t\t// create random coordinates for new event\n\t\t\tnewXCoord = rand.nextInt(MAX_COORDS + 1 +MAX_COORDS) -MAX_COORDS;\n\t\t\tnewYCoord = rand.nextInt(MAX_COORDS + 1 +MAX_COORDS) -MAX_COORDS;\n\t\t\t\n\t\t\tnewEvent = new Event(i, gridWorld[newXCoord+MAX_COORDS][newYCoord+MAX_COORDS], \"Event \"+String.format(\"%03d\", i)); \n\t\t\t\n\t\t\t//create a random number of tickets between 0 and 5\n\t\t\ttickets = new ArrayList<Ticket>(); // clear all tickets in the arraylist\n\t\t\tfor(int j = 0; j < 4; j++)\n\t\t\t{\n\t\t\t\tint num = rand.nextInt(5000 - 1000) +1000; // create price in cents, from $10 to $50 \n\t\t\t\tdouble price = num/100.0; // convert to double\n\t\t\t\tticket = new BasicTicket((new BigDecimal(price)).setScale(2, RoundingMode.CEILING));\n\t\t\t\ttickets.add(ticket);\n\t\t\t}\n\t\t\tnewEvent.setTickets(tickets);\n\t\t\t\t\n\t\t\t// set the grid coordinate to have this event\n\t\t\tgridWorld[newXCoord+MAX_COORDS][newYCoord+MAX_COORDS].setEvent(newEvent);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Add a couple of events hard coded first for testing\n\t\t/*Event newEvent1 = new Event(gridWorld[18][20], \"Event 001\"); //distance of 18 from 0,0\n\t\tgridWorld[18][20].setEvent(newEvent1);\n\t\t\n\t\tEvent newEvent2 = new Event(gridWorld[9][10], \"Event 002\"); //distance of 1 from 0,0\n\t\tgridWorld[9][10].setEvent(newEvent2);\n\t\t\n\t\tEvent newEvent3 = new Event(gridWorld[8][5], \"Event 003\"); //distance of 7 from 0,0\n\t\tgridWorld[8][5].setEvent(newEvent3);\n\t\t\n\t\tEvent newEvent4 = new Event(gridWorld[10][14], \"Event 004\"); //distance of 4 from 0,0\n\t\tgridWorld[10][14].setEvent(newEvent4);\n\t\t\n\t\tEvent newEvent5 = new Event(gridWorld[10][11], \"Event 005\"); //distance of 1 from 0,0\n\t\tgridWorld[10][11].setEvent(newEvent5);\n\t\t\n\t\tEvent newEvent6 = new Event(gridWorld[5][10], \"Event 006\"); //distance of 5 from 0,0\n\t\tgridWorld[5][10].setEvent(newEvent6);\n\t\t\n\t\tEvent newEvent7 = new Event(gridWorld[11][12], \"Event 007\"); //distance of 3 from 0,0\n\t\tgridWorld[11][12].setEvent(newEvent7);\n\t\t\n\t\tEvent newEvent8 = new Event(gridWorld[0][0], \"Event 008\"); //distance of 20 from 0,0\n\t\tgridWorld[0][0].setEvent(newEvent8);*/\n\t\t\n\t\t\n\t\t\n\t}", "private List<Integer> createData() {\r\n\t\tList<Integer> data = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "@Test\n public void getUserList() {\n\n for (int i = 0; i < 3; i++) {\n //mongoTemplate.createCollection(\"test111111\" + i);\n mongoTemplate.executeCommand(\"{create:\\\"sfe\"+ i +\"\\\", autoIndexId:true}\");\n }\n }", "@Inject\n public LocalApiImpl() {\n entityList= new ArrayList<>();\n for (int i=0; i<10; i++){\n PostEntity postEntity = new PostEntity();\n postEntity.setPostId(i);\n entityList.add(postEntity);\n }\n }", "private void generateNRandomTasks() {\n\t\tthis.averageServiceTime = 0;\n\t\tfor (int i = 1; i <= this.numberOfClients; i++) {\n\t\t\tRandom rand = new Random();\n\t\t\tint processingTime = 0;\n\t\t\tint arrivalTime = 0;\n\t\t\ttry {\n\t\t\t\tprocessingTime = rand.ints(minProcessingTime, maxProcessingTime).limit(1).findFirst().getAsInt();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tprocessingTime = minProcessingTime;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tarrivalTime = rand.ints(minArrivingTime, maxArrivingTime).limit(1).findFirst().getAsInt();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tarrivalTime = minArrivingTime;\n\t\t\t}\n\t\t\tTask task = new Task(arrivalTime, processingTime, i);\n\t\t\tgeneratedTasks.add(task);\n\t\t\taverageServiceTime += processingTime;\n\t\t}\n\t\t// sort tasks based on their arrival time\n\t\tCollections.sort(generatedTasks, new ArrivalTimeComparator());\n\t\taverageServiceTime /= this.numberOfClients;\n\t}", "private void setTestData() {\n\t\tCollections.shuffle(input);\n\t\ttestData = new LinkedList<>();\n\t\tfor (int i = 0; i < TEST_DATA_SIZE; i++) {\n\t\t\ttestData.add(input.remove(0));\n\t\t}\n\t}", "public static Product[] createOrder()\n {\n Order order = new Order();\n Random r = new Random();\n int x;\n order.orderNumber++;\n int itemCount = 1 + r.nextInt(50);\n order.orderContents = new Product[itemCount];\n for (x = 0 ; x < itemCount; x++){\n Product item = productMaker.generateProduct();\n order.orderContents[x] = item;\n }\n\n return order.orderContents;\n\n }", "public void setRandomItems(ArrayList<RandomItem> items);", "private List<Key> createSequenceKeys(int count) {\n\t\tList<Key> keys = new ArrayList<Key>();\n\t\tdouble id = new Date().getTime();\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tdouble id2 = id + (i / count);\n\t\t\tdouble random = Math.random();\n\t\t\tid2 += random / count;\n\t\t\tlong id3 = (long) (id2 * (1 << 18));\n\t\t\tKey key = Datastore.createKey(UserItemMeta.get(), id3);\n\t\t\tkeys.add(key);\n\t\t}\n\t\treturn keys;\n\t}", "@Override\n public List<Article> getArticles() {\n List<Article> articles=articleDAO.getArticles();\n knownArticles.addAll(articles);\n return articles;\n }", "public static Integer[] randList(int size){\r\n Random generator = new Random();\r\n Integer[] list = new Integer[size];\r\n for(int i=0; i<size; i++){\r\n list[i]=generator.nextInt(10);\r\n }\r\n System.out.println(\"random list of \" + size + \" items\");\r\n for(Integer i: list){\r\n System.out.print(i + \" \");\r\n }\r\n System.out.println(\"\\n\");\r\n return list;\r\n }", "public ArrayList<RandomItem> getRandomItems();", "@BeforeEach\n\tvoid init() {\n\t\tthis.repo.deleteAll();\n\t\tthis.testLists = new TDLists(listTitle, listSubtitle);\n\t\tthis.testListsWithId = this.repo.save(this.testLists);\n\t\tthis.tdListsDTO = this.mapToDTO(testListsWithId);\n\t\tthis.id = this.testListsWithId.getId();\n\t}", "public PageList(){\n count = 0;\n capacity = 4;\n itemArray = new int[capacity];\n }", "void permutateObjects()\n {\n for (int i = 0; i < sampleObjects.length; i++)\n {\n for (int i1 = 0; i1 < (r.nextInt() % 7); i1++)\n {\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleStrings[r.nextInt(5)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleNumbers[r.nextInt(5)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n specialValues[r.nextInt(2)]);\n addToObject(sampleObjects[i], sampleStrings[r.nextInt(5)],\n sampleArrays[r.nextInt(5)]);\n }\n }\n }", "public RandomizedCollection() {\n map = new HashMap<>();\n arr = new ArrayList<>();\n }", "private void addRandomPremiereCard(List<CardCollection.Item> result, int count) {\n List<String> possibleCards = new ArrayList<String>();\n possibleCards.addAll(_premiereSetRarity.getAllCards());\n filterNonExistingCards(possibleCards);\n Collections.shuffle(possibleCards, _random);\n addCards(result, possibleCards.subList(0, Math.min(possibleCards.size(), count)), false);\n }", "public ArticleExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public ArticleExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public RandomEntity(final long len) {\n super((ContentType) null, null);\n length = len;\n }", "@Test\r\n public void getRandomExercise() {\n ArrayList<String> exerList = new ArrayList<>();\r\n exerList.add(\"Exer 1\");\r\n exerList.add(\"Exer 2\");\r\n exerList.add(\"Exer 3\");\r\n exerList.add(\"Exer 4\");\r\n exerList.add(\"Exer 5\");\r\n\r\n assertEquals(2, getRandomExer.getRandomExercise(exerList,2).size());\r\n }", "List<User> getRandomUsers(List<User> uList, int num);", "@Before\n public void setUp() {\n response = new DocumentsResponse();\n testDocList = new ArrayList<>();\n testDocList.add(new DocumentTestData().createTestDocument(1));\n }", "public java.util.List<Object> generateDataSet(java.util.List<Object> genericProperties);", "private void makeTestLines(int n) {\n testLines = new ArrayList<>();\n for (int i = 0; i < n; i += 1) {\n testLines.add(\"Line \" + i);\n }\n }", "public static String getRandomLongDescription() {\n int paragraphs = RandomNumberGenerator.getRandomInt(2, 5);\n StringBuilder sb = new StringBuilder();\n\n for (int i = 0; i < paragraphs; i++) {\n\n sb.append(\"##\").append(getRandomText(2, 1).replace('.', ' ')).append(\"##\\n\");\n int length = RandomNumberGenerator.getRandomInt(30, 200);\n sb.append(getRandomText(length, 1)).append(\"\\n\");\n }\n return sb.toString();\n }", "@Test\n void test_getALlreviews() throws Exception{\n\n List<ReviewMapping> reviewList=new ArrayList<>();\n\n for(long i=1;i<6;i++)\n {\n reviewList.add( new ReviewMapping(i,new Long(1),new Long(1),\"good\",3));\n }\n\n Mockito.when(reviewRepository.findAll()).thenReturn(reviewList);\n List<ReviewMapping> e=reviewService.GetReviewMappings();\n assertThat(e.size(),equalTo(5));\n }", "public static void populate() {\n for (int i = 1; i <= 15; i++) {\n B.add(i);\n Collections.shuffle(B);\n\n }\n for (int i = 16; i <= 30; i++) {\n I.add(i);\n Collections.shuffle(I);\n }\n for (int n = 31; n <= 45; n++) {\n N.add(n);\n Collections.shuffle(N);\n }\n for (int g = 46; g <= 60; g++) {\n G.add(g);\n Collections.shuffle(G);\n }\n for (int o = 61; o <= 75; o++) {\n O.add(o);\n Collections.shuffle(O);\n }\n\n for (int i = 1; i <= 75; i++) {\n roll.add(i); // adds the numbers in the check list\n }\n }", "private void createShuffleAndAddCards() {\n //Creating all 108 cards and saving them into an arraylist\n ArrayList<Card> cards = new ArrayList<>();\n String[] colors = {\"red\", \"blue\", \"yellow\", \"green\"};\n for (String color : colors) {\n for (int i = 1; i < 10; i++) {\n for (int j = 0; j < 2; j++) {\n cards.add(new Card(\"Numeric\", color, i));\n }\n }\n cards.add(new Card(\"Numeric\", color, 0));\n for (int i = 0; i < 2; i++) {\n cards.add(new Card(\"Skip\", color, 20));\n cards.add(new Card(\"Draw2\", color, 20));\n cards.add(new Card(\"Reverse\", color, 20));\n }\n }\n for (int i = 0; i < 4; i++) {\n cards.add(new Card(\"WildDraw4\", \"none\", 50));\n cards.add(new Card(\"WildColorChanger\", \"none\", 50));\n }\n //shuffling cards and adding them into the storageCards main list\n Collections.shuffle(cards);\n for (Card card : cards) {\n storageCards.add(card);\n }\n cards.clear();\n }", "public static List<Integer> makeList(int size) {\r\n List<Integer> result = new ArrayList<>();\r\n /** \r\n * taking input from the user \r\n * by using Random class. \r\n * \r\n */\r\n for (int i = 0; i < size; i++) {\r\n int n = 10 + rng.nextInt(90);\r\n result.add(n);\r\n } // for\r\n\r\n return result;\r\n /**\r\n * @return result \r\n */\r\n }", "public void fillReviews(int totalEntries) {\n StoreAPI storeOperations = new StoreAPIMongoImpl();\n for (int i = 0; i < totalEntries; i++) {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n int getRandomUserId = getRandomNumber(0, 999);\n Fairy fairy = Fairy.create();\n TextProducer text = fairy.textProducer();\n storeOperations.postReview(i, \"user_\" + getRandomUserId, \"password_\" + getRandomUserId, (long) getRandomNumber(0, 9999), getRandomNumber(1, 5), text.paragraph(getRandomNumber(1, 5)), dateFormat.format(date));\n }\n }", "@Override\n\tprotected List<Resource> extractNeededArticleDetails(List<String> articleIdList) {\n\t\treturn new ArrayList<Resource>();\n\t}", "private List<Integer> loadTestNumbers(ArrayList<Integer> arrayList) {\n for (int i = 1; i <= timetablepro.TimetablePro.MAX_TIMETABLE; i++) {\n arrayList.add(i);\n }\n return arrayList;\n }", "@Override\n public int getItemCount() {\n return mArticles.size();\n }", "private void collectRandomRIDs(){\n\t\tint numRIDs = iterations + 1;\n\t\trandomRID_list = new String[numRIDs];\n\t\tString randomClusterName;\n\t\tint clusterID, randomPosition;\n\t\t\n\t\t// Collect #iterations of random RID's\n\t\tfor(int i=0; i < numRIDs; i++){\n\t\t\trandomClusterName = env.VERTEX_PREFIX + (int) (Math.random() * env.NUM_VERTEX_TYPE);\n\t\t\tclusterID = db.getClusterIdByName(randomClusterName); \n\t\t\tOClusterPosition [] range = db.getStorage().getClusterDataRange(clusterID);\n\t\t\t\n\t\t\trandomPosition = (int) (Math.random() * range[1].intValue()) + range[0].intValue();\n\t\t\trandomRID_list[i] = \"#\" + clusterID + \":\" + randomPosition;\n\t\t}\n\t\t\n\t}", "public static List<Integer> randomData(final int size) {\n\t\tfinal List<Integer> output = new ArrayList<Integer>();\n\n\t\tfor (int i = 0; i < size; i++)\n\t\t\toutput.add((int)(Math.random() * MAX_VALUE));\n\n\t\treturn output;\n\t}" ]
[ "0.68802166", "0.6721865", "0.6007223", "0.5882705", "0.58134025", "0.57116044", "0.5647476", "0.5562633", "0.54400516", "0.542448", "0.5301264", "0.52600557", "0.52540386", "0.5223321", "0.51951045", "0.51892304", "0.5186838", "0.5186512", "0.5172387", "0.5160455", "0.51584524", "0.5141203", "0.5134248", "0.51321363", "0.5117818", "0.50927174", "0.50660014", "0.50653905", "0.50502735", "0.5029887", "0.5022948", "0.50217634", "0.5006157", "0.5005492", "0.500149", "0.49878016", "0.4977017", "0.49619353", "0.49580923", "0.49574888", "0.49540913", "0.4950529", "0.49500892", "0.49436855", "0.49400318", "0.493145", "0.49273542", "0.49174392", "0.4899685", "0.48893493", "0.48840785", "0.48821113", "0.48796755", "0.48745453", "0.48723483", "0.48705468", "0.48626953", "0.4853979", "0.48527867", "0.48474327", "0.4846112", "0.48444188", "0.48408842", "0.48401818", "0.4824094", "0.48186487", "0.4815312", "0.48109266", "0.48057234", "0.48004013", "0.4793204", "0.47878987", "0.4782225", "0.47724336", "0.47709477", "0.47677967", "0.4762799", "0.4759855", "0.47520044", "0.47502598", "0.47494698", "0.47406548", "0.47406548", "0.4738838", "0.47271553", "0.47259626", "0.47196072", "0.47161773", "0.47127002", "0.4712276", "0.47112423", "0.4710721", "0.47087485", "0.47063398", "0.4704465", "0.47028345", "0.470118", "0.4698556", "0.46981645", "0.46977806" ]
0.7004428
0
Set the current speed as a product of effort and maximum speed
public void setSpeed() { this.currSpeed = this.maxSpeed * this.myStrategy.setEffort(this.distRun); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSpeed(double multiplier);", "public void setSpeed() {\n //assigns the speed based on the shuffleboard with a default value of zero\n double tempSpeed = setpoint.getDouble(0.0);\n\n //runs the proportional control system based on the aquired speed\n controlRotator.proportionalSpeedSetter(tempSpeed);\n }", "public void setSpeed(float val) {speed = val;}", "public void setCurrentSpeed (double speed);", "public void setSpeed(int newSpeed)\n {\n speed = newSpeed;\n }", "public abstract void setSpeed(int sp);", "public void setSpeed() {\r\n\t\tint delay = 0;\r\n\t\tint value = h.getS(\"speed\").getValue();\r\n\t\t\r\n\t\tif(value == 0) {\r\n\t\t\ttimer.stop();\r\n\t\t} else if(value >= 1 && value < 50) {\r\n\t\t\tif(!timer.isRunning()) {\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//exponential function. value (1) == delay (5000). value (50) == delay (25)\r\n\t\t\tdelay = (int)(a1 * (Math.pow(25/5000.0000, value / 49.0000)));\r\n\t\t} else if(value >= 50 && value <= 100) {\r\n\t\t\tif(!timer.isRunning()) {\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//exponential function. value (50) == delay(25). value (100) == delay (1)\r\n\t\t\tdelay = (int)(a2 * (Math.pow(1/25.0000, value/50.0000)));\r\n\t\t}\r\n\t\ttimer.setDelay(delay);\r\n\t}", "public void setMaxSpeed() {\n\t\tspeed = MAX_SPEED;\n\t}", "public void setSpeed(int value) {\n speed = value;\n if (speed < 40) {\n speedIter = speed == 0 ? 0 : speed / 4 + 1;\n speedWait = (44 - speed) * 3;\n fieldDispRate = 20;\n listDispRate = 20;\n } else if (speed < 100) {\n speedIter = speed * 2 - 70;\n fieldDispRate = (speed - 40) * speed / 50;\n speedWait = 1;\n listDispRate = 1000;\n } else {\n speedIter = 10000;\n fieldDispRate = 2000;\n speedWait = 1;\n listDispRate = 4000;\n }\n }", "public void setSpeed(int newSpeed)\n\t{\n\t\tspeed = newSpeed;\n\t}", "private void setSpeed() {\n double cVel = cAccel*0.1;\n speed += round(mpsToMph(cVel), 2);\n speedOutput.setText(String.valueOf(speed));\n }", "public void set(double speed) {\n climb_spark_max.set(speed);\n }", "private void setSpeedValues(){\n minSpeed = trackingList.get(0).getSpeed();\n maxSpeed = trackingList.get(0).getSpeed();\n averageSpeed = trackingList.get(0).getSpeed();\n\n double sumSpeed =0.0;\n for (TrackingEntry entry:trackingList) {\n\n sumSpeed += entry.getSpeed();\n\n //sets min Speed\n if (minSpeed > entry.getSpeed()){\n minSpeed = entry.getSpeed();\n }\n //sets max Speed\n if (maxSpeed < entry.getSpeed()) {\n maxSpeed = entry.getSpeed();\n }\n\n }\n\n averageSpeed = sumSpeed/trackingList.size();\n }", "public void accelerationSet(double speed){\n\t\tdouble currentDelta = Math.abs(currentSpeed - speed);\r\n\t\tif(currentDelta > maxDelta){\r\n\t\t\tif(speed > currentSpeed){\r\n\t\t\t\tspeed = currentSpeed + maxDelta;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tspeed = currentSpeed - maxDelta;\r\n\t\t\t}\r\n\t\t}\r\n\t//\tSystem.out.println(\"Speed:\" + speed);\r\n\t\tcurrentSpeed = speed;\r\n\t\tsuper.set(speed * motorDirection);\r\n\t}", "public void setSpeed( Vector2 sp ) { speed = sp; }", "public synchronized void set (double speed){\n m_liftSpeed = speed;\n if (m_liftSpeed < 0 && isLowerLimit() == false) {\n m_liftMotor.set(m_liftSpeed);\n } else if (m_liftSpeed > 0 && isUpperLimit() == false){\n m_liftMotor.set(m_liftSpeed);\n } else {\n m_liftSpeed = 0;\n m_liftMotor.set(0); \n }\n }", "void setSpeed(RobotSpeedValue newSpeed);", "public void setSpeed(int value) {\n this.speed = value;\n }", "public void setSpeed(int wpm);", "public void setSpeed(double speed)\r\n {\r\n this.speed = speed;\r\n }", "public void setSpeed(double speed) {\n \tthis.speed = speed;\n }", "public void setSpeed() {\n\t\tthis.ySpd = this.MINSPEED + randGen.nextFloat() * (this.MAXSPEED - this.MINSPEED);\n\t\tthis.xSpd = this.MINSPEED + randGen.nextFloat() * (this.MAXSPEED - this.MINSPEED);\n\t}", "public void setSpeed(float speed) {\n this.speed = (int) speed * 13;\n }", "public void setMaxSpeed(double speed){\n\t\tthis.speed = speed;\n\t}", "public void setSpeed(int s){\r\n\t\tspeed = s;\r\n\t}", "public void setSpeed(int newSpeed){\n\t\tmyVaisseau=Isep.getListeVaisseau();\n\t\tspeed=newSpeed;\t\t\n\t}", "public void currentSpeed(double currentSpeed)\n\t{\n\t\tspeed = currentSpeed;\n\t\t\n\t}", "public void setSpeed() {\n if (this.equals(null)) {\n this.speedValue=-5;\n }\n }", "@Override\n\tpublic void setSpeed(double speed) {\n\n\t}", "@Override\n\tpublic void setSpeed(float speed) {\n\t\t\n\t}", "public void setMaxSpeed(double value) {\n super.setMaxSpeed(value);\n }", "public void setSpeed(double speed) {\n this.speed = speed;\n }", "public void setSpeed(double speed) {\n this.speed = speed;\n }", "public void setSpeed(int speed) {\n this.speed = speed;\n }", "public void setSpeed(float speed) {\n this.speed = speed;\n }", "public void setSpeed(float speed) {\n this.speed = speed;\n }", "public void setSpeed(double speed) {\r\n this.speed = Math.min(1.0, Math.max(speed, 0));\r\n }", "public void setSpeed(float speed_)\n\t{\n\t\tthis.speed=speed_;\n\t}", "public void changeSpeed(int speed);", "@Override\n protected double speedFactor() {\n return getEnginePower() * 0.003;\n }", "public void setSpeed(final int speed) {\n mSpeed = speed;\n }", "public void increaseSpeed() {\n\t\t\n\t\tif(this.getSpeed() < this.getMaximumSpeed()) {\n\t\t\tthis.setSpeed(this.getSpeed() + 5);\n\t\t\tSystem.out.println(\"increase speed by 5 \\n\");\n\t\t}else {\n\t\t\tSystem.out.println(\"You already reach at the max speed \" + this.getMaximumSpeed() +\"\\n\");\n\t\t}\n\n\t}", "public void setSpeed(long speed) {\n\t\tmSpeed = speed;\n\t}", "void changeSpeed(int speed) {\n\n this.speed = speed;\n }", "public void setWalkSpeed(int n)\n{\n walkSpeed = n;\n}", "public void updateSpeed() {\n\t\t// should work b/c of integer arithmetic\n\t\tif(isTwoPlayer)\n\t\t\treturn;\n\t\t//System.out.println(\"speed up factor: \" + speedUpFactor);\n\t\t//System.out.println(\"numlinescleared/6: \" + numLinesCleared/6);\n\t\tif (speedUpFactor != numLinesCleared/6) {\n\t\t\t// speed by 10% every lines cleared, needs to be checked\n\t\t\tspeedUpFactor = numLinesCleared/6;\n\t\t\tif(!(defaultSpeed - 30*speedUpFactor <= 0))\n\t\t\t\tdefaultSpeed = defaultSpeed - 30*speedUpFactor;\n\t\t\tlevel = speedUpFactor;\n\t\t}\n\t\t//System.out.println(\"default speed: \" + defaultSpeed);\n\t}", "public int setSpeed(int i) {\n\t\tspeed = i;\n\t\t//Returning the speed\n\t\treturn speed;\t\t\n\t}", "private void changeSpeed() {\n\t\tint t = ((JSlider)components.get(\"speedSlider\")).getValue();\n\t\tsim.setRunSpeed(t);\n\t}", "public void setSpeed(int speed) {\n\t\tthis.speed = speed;\n\t}", "public void setSpeed(int speed) {\n\t\tthis.speed = speed;\n\t}", "public void setSpeed(int speed) {\n\t\tthis.speed = speed;\n\t}", "void changeUpdateSpeed();", "public void set(double speed) {\n\t\tleftIntake.set(speed);\n\t\trightIntake.set(-speed);\n\t}", "@Override\n\tpublic int getMaxSpeed() {\n\t\treturn super.getMaxSpeed();\n\t}", "public void setMaxSpeed(double maxSpeed) {\r\n this.maxSpeed = maxSpeed;\r\n }", "public void changeSpeed(double multiplier, String theBase) {\r\n\t\tif (theBase.equals(\"zombie\")) {\r\n\t\t\tgetEnemyAnimation().getTranslation().setRate(multiplier);\r\n\t\t\tgetEnemyAnimation().getAnimation().setRate(multiplier);\r\n\t\t}else if (theBase.equals(\"tower\")) {\r\n\t\t\tgetAnimation().getAnimation().setRate(multiplier);\r\n\t\t\tProjectile pjtile = getAnimation().getProjectile();\r\n\t\t\tif (pjtile != null) {\r\n\t\t\t\tList<Projectile> listOfPjtile = getAnimation().getPjList();\r\n\t\t\t\tfor (Projectile pjt: listOfPjtile) {\r\n\t\t\t\t\tpjt.getAnimation().setRate(multiplier);\r\n\t\t\t\t\tpjt.getTranslation().setRate(multiplier);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setMaxSpeed(int MaxSpeed) {\n this.MaxSpeed = MaxSpeed;\n }", "private int adjustSpeed(int speed)\n {\n int result = speed;\n if (speed >= FASTEST)\n {\n result = MAX_SPEED;\n }\n else if (speed <= SLOWEST)\n {\n result = MIN_SPEED;\n }\n return result;\n }", "public void changeCurrentSpeed( double newSpeed)\n\t {\t\n\t\tif(newSpeed + currentSpeedOfTheBoat > 25.0)\n\t\t\tcurrentSpeedOfTheBoat-=newSpeed;\n \tif(newSpeed < 0.0)\n \t\tcurrentSpeedOfTheBoat =currentSpeedOfTheBoat + newSpeed ;//decrease the speed if users enters negative number \n \telse if (newSpeed >maximumSpeedOfTheBoat)\n \tcurrentSpeedOfTheBoat=maximumSpeedOfTheBoat;\n else\n \tcurrentSpeedOfTheBoat =currentSpeedOfTheBoat+ newSpeed;//increase the speed\n \t }", "public void setSpeed(int speed) {\n this.movementSpeed = speed;\n }", "public void accelerate() {\n\t\tif (this.hasOnlyOneCar())\n\t\t{\n\t\t\tif (this.getHead().getSpeed()==Speed.SLOW)\n\t\t\t\tthis.getHead().setSpeed(Speed.NORMAL);\n\t\t\telse\n\t\t\t\tthis.getHead().setSpeed(Speed.FAST);\n\t\t}\n\t}", "public void setVehicleSpeed(float value) {\n this.vehicleSpeed = value;\n }", "public void setSpeed(double left, double right){\n leftMasterVictor.setSpeed(left);\n rightMasterVictor.setSpeed(-right);\n }", "public void setArmSpeed(double speed) {\n if (frontSwitch.get()) {\n encoder.reset();\n }\n if (armIsOnLimitSwitchOrHardstop(speed)) {\n OI.secondaryController.setRumble(GenericHID.RumbleType.kLeftRumble, 0.2);\n speed = 0;\n } else {\n OI.secondaryController.setRumble(GenericHID.RumbleType.kLeftRumble, 0);\n }\n double feedforward = 0.06 * Math.cos(getArmRadians());\n speed = speed + feedforward;\n //speed = predictiveCurrentLimiting.getVoltage(speed * 12, getRPM()) / 12;\n armMotorOne.set(speed);\n\n armSpeed.setDouble(speed);\n }", "@Override\n @Deprecated // Deprecated so developer does not accidentally use\n public void setSpeed(int speed) {\n }", "public void setMaxSpeed(float max_speed)\n\t{\n\t\tthis.max_speed = max_speed;\n\t}", "protected void execute() {\n \t// Scales the speed based on a proportion of ideal voltage over actual voltage\n \tRobot.shooter.talon.set(0.59 * (12.5 / Robot.pdp.getVoltage()));\n// \tRobot.shooter.talon.enable();\n// \tRobot.shooter.talon.set(Shooter.IDEAL_SPEED * (12.5 / Robot.pdp.getVoltage()));\n }", "public void increaseSpeed()\r\n\t{\r\n\t\t//Do nothing if maximum speed is achieved\r\n\t\tif(currentSpeed == SnakeSpeed.MAX)\r\n\t\t\treturn;\r\n\t\t//Else, increase the speed to next level\r\n\t\telse if(currentSpeed == SnakeSpeed.DEFAULT)\r\n\t\t{\r\n\t\t\tcurrentSpeed = SnakeSpeed.MEDIUM;\r\n\t\t}\r\n\t\telse if(currentSpeed == SnakeSpeed.MEDIUM)\r\n\t\t{\r\n\t\t\tcurrentSpeed = SnakeSpeed.MAX;\r\n\t\t}\r\n\r\n\t\t//Set the updated speed for the snake of the current player \r\n\t\tsnakes.get(snakeIndex).setSnakeSpeed(currentSpeed);\r\n\t}", "public static void setMotorSpeed(double speed){\n setLeftMotorSpeed(speed);\n setRightMotorSpeed(speed);\n }", "public <T extends Number> void setSpeedPerFrame(T speed){\r\n\t\tif(speed.doubleValue() <= 0){\r\n\t\t\tthis.speed = 1;\r\n\t\t\tSystem.err.println(\"Negative Speed, resulting to a speed of 1!\");\r\n\t\t}else{\r\n\t\t\tthis.speed = speed.doubleValue();\r\n\t\t}\r\n\t}", "public void setSpeedLimit(int speedLim) {\n \tthis.currentSpeedLimit = trkMdl.getBlock(this.lineColor,this.currentBlock).getSpeedLimit();\n }", "public void setYSpeed(int speed){\n ySpeed = speed;\n }", "public void setSpeed(final double speed) {\n m_X.set(ControlMode.PercentOutput, speed); \n }", "public void setValue(double speed) {\n\t\tpid.setSetpoint(speed);\n\t}", "@Test\n\tpublic void TestSetSpeed() {\n\t\tassertTrue(v1.setSpeed(70));\n\t\tassertEquals(\"Speed of car is not set to 70.\",v1.getSpeed(),70.0, 0);\n\t\tassertFalse(v2.setSpeed(150));\n\t\tassertEquals(\"Speed of truck is changed from 0.\",v2.getSpeed(), 0, 0);\n\t}", "public void proportionalSpeedSetter(double setpoint) {\n //calculates error based on the difference between current and target speeds\n double error = setpoint - m_currentSpeed;\n //adjusts the current speed proportionally to the error\n m_currentSpeed += (error * RobotMap.LAUNCHER_ADJUSTMENT_VALUE);\n\n //sets the speed of the motors based on the adjusted current speed\n setMotor(m_currentSpeed);\n }", "public void accelerate(){\n speed += 5;\n }", "public void changeSpeed() {\n Random gen = new Random();\n speedX += gen.nextInt(3);\n speedY += gen.nextInt(3);\n }", "public void doubleSpeed()\r\n {\r\n \tthis.speed= speed-125;\r\n \tgrafico.setVelocidad(speed);\r\n }", "public void setSpeed(int speed) {\n thread.setSpeed(speed);\n }", "public void SetSpeedRaw(double speed)\n {\n Motors.Set(speed);\n }", "public static void setLastSpeed(float speed) {\n\t\tfloat fakeSpeed = speed;\n\t\tLog.i(TAG, \"SafeSpeed.setLastSpeed()\");\n\t\t\n\t\tif (fakeSpeed < 0)\n\t\t{\n\t\t\tspeedText.setText(\"-.-\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnCurrentSpeed = (float)(fakeSpeed * 2.2369);\n\t\t\tString s = String.format(locale, \"%.1f\", nCurrentSpeed);\n\t\t\tspeedText.setText(s);\n\t\t}\n\t}", "public static void setSpeed(int speed) {\n leftMotor.setSpeed(speed);\n rightMotor.setSpeed(speed);\n }", "public void setSpeed(double speed) {\r\n\t\tthis.speed = speed;\r\n\t\tthis.period = (int) (1000 / speed);\r\n\t}", "public void setMaxSpeed(int maxSpeed) {\n\t\tthis.maxSpeed = maxSpeed;\n\t}", "public float maxSpeed();", "public double getCurrentSpeed();", "public int getSpeed()\r\n\t{\n\t\treturn 90;\r\n\t}", "public void set(double speed, CANTalon talon) {\n\t\ttalon.set(speed);\n\t}", "public Builder setSpeed(int value) {\n bitField0_ |= 0x00000080;\n speed_ = value;\n onChanged();\n return this;\n }", "private void driveRight() {\n setSpeed(MAX_SPEED, MIN_SPEED);\n }", "@Override\n\tpublic void set(double speed) {\n\t\tsuper.changeControlMode(TalonControlMode.PercentVbus);\n\t\tsuper.set(speed);\n\t\tsuper.enableControl();\n\t}", "public void setSpeed(float n)\n\t{\n\t\tthis.speed = n;\n\t}", "public int getSpeed(){return this.speed;}", "public void setSpeed(int newTicksMultiplier) {\r\n this.ticksMultiplier = newTicksMultiplier;\r\n }", "@Override\n\t\tpublic int getSpeed() {\n\t\t\treturn i+30;\n\t\t}", "public abstract double getSpeed();", "public void changeFallSpeed (int aChange)\n\t{\n\t\t//Only change the horizontal speed if the resulting new speed is\n\t\t//between -5 and 5.\n\t\tif (( getHSpeed () + aChange )<=5 && ( getHSpeed() + aChange ) >= -5)\n\t\t{\n\t\t\tsetHSpeed (getHSpeed () + aChange);\t//hSpeed is changed by having\n\t\t\t\t\t\t\t\t\t\t\t//aChange added onto it.\n\t\t}\n\t\t\n\t\t//The following changes the vertical speed of the plane according to\n\t\t//the horizontal speed if the horizontal speed is not 5 or -5.\n\t\tif (Math.abs (getHSpeed()) != 5)\n\t\t{\n\t\t\tsetVSpeed ((int)(1.3 * (6 - Math.abs (getHSpeed()))));\n\t\t\tchangeAngle (getHSpeed());\t//This is meant to change the x and y\n\t\t\t\t\t\t\t\t\t\t//coordinates of the PaperAirplane's\n\t\t\t\t\t\t\t\t\t\t//vertices\n\t\t}\n\t\t//The following sets the vertical speed of the plane to 1 if the hSpeed\n\t\t//of the plane is -5 or 5\n\t\telse\n\t\t{\n\t\t\tsetVSpeed (1);\n\t\t\tchangeAngle (getHSpeed());\t//This is meant to change the x and y\n\t\t\t\t\t\t\t\t\t\t//coordinates of the PaperAirplane's\n\t\t\t\t\t\t\t\t\t\t//vertices\n\t\t}\n\t}", "@Override\npublic int accelerate(int speed) {\n\tint carSpeed=getSpeed();\n\treturn carSpeed;\n}", "public Builder setSpeed(int value) {\n bitField0_ |= 0x00000800;\n speed_ = value;\n onChanged();\n return this;\n }" ]
[ "0.76708555", "0.75680846", "0.75204134", "0.7517848", "0.7339526", "0.7202114", "0.71354914", "0.7102554", "0.7098809", "0.7092935", "0.7083586", "0.7070061", "0.7069179", "0.70646966", "0.7064397", "0.7060005", "0.7057114", "0.7055126", "0.7035727", "0.70295596", "0.699804", "0.69935006", "0.69769424", "0.69509983", "0.6928588", "0.6915961", "0.6908097", "0.69043905", "0.6899164", "0.68652606", "0.6863865", "0.6844313", "0.6844313", "0.6824529", "0.6801427", "0.6801427", "0.6725029", "0.66657037", "0.6657059", "0.6637712", "0.6636622", "0.6632863", "0.6630491", "0.66293824", "0.66231495", "0.66216534", "0.6598431", "0.65897757", "0.65831184", "0.65831184", "0.65831184", "0.6579134", "0.65763587", "0.657205", "0.6569084", "0.6567629", "0.65620667", "0.6561396", "0.6556326", "0.6554356", "0.65133685", "0.6503337", "0.65024126", "0.6490667", "0.6489377", "0.64722884", "0.6471612", "0.6467369", "0.6450815", "0.64507663", "0.64479774", "0.644588", "0.64435136", "0.64396256", "0.64361656", "0.643286", "0.64289486", "0.642492", "0.6424788", "0.6403216", "0.6389962", "0.6385768", "0.6385756", "0.63729346", "0.63722855", "0.6351183", "0.6341201", "0.63248867", "0.63180685", "0.6306094", "0.6304765", "0.62997544", "0.6299423", "0.6298004", "0.6290937", "0.6287673", "0.6276157", "0.62643033", "0.62638485", "0.6255587" ]
0.8050975
0
Update the distance traveled as a factor of speed and a time interval
public void setDistance(double interval) { this.setSpeed(); //System.out.println("distance: " + this.distRun + " speed: " + this.currSpeed + " interval: "+ interval); this.distRun += this.currSpeed * interval; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void updateDistance(int distance);", "private void updatePointSpeeds() {\n\t\tfor (int i = 0; i < locations.size(); i++) {\n\t\t\tLocationStructure loc = locations.get(i);\t\t\n\t\t\tDouble dist = Double.MIN_VALUE;\n\t\t\tDouble lat1 = loc.getLatitude().doubleValue();\n\t\t\tDouble lon1 = loc.getLongitude().doubleValue();\n\t\t\t\n\t\t\tDate d = times.get(i);\n\t\t\t\n\t\t\tif( i+1 < locations.size()) {\n\t\t\t\tloc = locations.get(i+1);\n\t\t\t\tDouble lat2 = loc.getLatitude().doubleValue();\n\t\t\t\tDouble lon2 = loc.getLongitude().doubleValue();\n\t\t\t\tdist = calculateDistance(lat1, lon1, lat2, lon2);\n\t\t\t\t\n\t\t\t\tDate d1 = times.get(i+1);\n\t\t\t\tDateTime dt1 = new DateTime(d);\n\t\t\t\tDateTime dt2 = new DateTime(d1);\n\t\t\t\tint seconds = Seconds.secondsBetween(dt1, dt2).getSeconds();\t\t\t\n\t\t\t\tDouble pd = (dist/seconds)*60;\n\t\t\t\tif(!pd.isNaN()) {\n\t\t\t\t\tpointSpeed.add(pd);\t\t\n\t\t\t\t\tSystem.out.println(\"BUS STATE-- Added point speed of \"+ (dist/seconds)*60 + \" for \" +this.vehicleRef);\n\t\t\t\t}\n\t\t\t} else break;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void updateSpeed(CLocation location) {\n try {\n\n i = i + 1;\n Log.i(\"111\", \"====updateSpeed=====i===\" + i);\n // Log.i(\"111\",\"====location=====getLongitude===\"+location.getLongitude());\n // Log.i(\"111\",\"====location=====getLatitude===\"+location.getLatitude());\n\n\n float nCurrentSpeed = 0;\n\n if (location != null) {\n location.setUseMetricunits(true);\n nCurrentSpeed = location.getSpeed();\n }\n\n Formatter fmt = new Formatter(new StringBuilder());\n fmt.format(Locale.US, \"%5.1f\", nCurrentSpeed);\n String strCurrentSpeed = fmt.toString();\n strCurrentSpeed = strCurrentSpeed.replace(' ', '0');\n\n String strUnits = \"miles/hour\";\n\n\n strLog = strLog +\n \"\\n--------------\\n \" +\n strCurrentSpeed + \" \" + strUnits +\n \"\\n--------------\\n \";\n\n tvData.append(\"\\n Speed2 = \" + strCurrentSpeed + \" \" + strUnits);\n\n /* float speed = Float.parseFloat(strCurrentSpeed);\n if(speed<100)\n mGaugeView.setTargetValue(speed);\n else\n {\n tvLog.setText(\"out of speed\"+strLog);\n }*/\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void changeUpdateSpeed();", "public void updateDist(double distance) {\n this.distance = distance;\n }", "private void updateSpeed(CLocation location) {\n float nCurrentSpeed = 0;\n\n if (location != null) {\n nCurrentSpeed = location.getSpeed();\n }\n\n Formatter fmt = new Formatter(new StringBuilder());\n fmt.format(Locale.US, \"%5.1f\", nCurrentSpeed);\n String strCurrentSpeed = fmt.toString();\n strCurrentSpeed = strCurrentSpeed.replace(' ', '0');\n double speed = Double.parseDouble(strCurrentSpeed);\n speed = speed * 1.60934;\n String strUnits = \"miles/hour\";\n int count = (int) speed;\n String s = String.valueOf(count);\n speedTextView.setText(\"Train Speed : \" + s + \" Km/h\");\n }", "public void updateSpeed() {\n\t\t// should work b/c of integer arithmetic\n\t\tif(isTwoPlayer)\n\t\t\treturn;\n\t\t//System.out.println(\"speed up factor: \" + speedUpFactor);\n\t\t//System.out.println(\"numlinescleared/6: \" + numLinesCleared/6);\n\t\tif (speedUpFactor != numLinesCleared/6) {\n\t\t\t// speed by 10% every lines cleared, needs to be checked\n\t\t\tspeedUpFactor = numLinesCleared/6;\n\t\t\tif(!(defaultSpeed - 30*speedUpFactor <= 0))\n\t\t\t\tdefaultSpeed = defaultSpeed - 30*speedUpFactor;\n\t\t\tlevel = speedUpFactor;\n\t\t}\n\t\t//System.out.println(\"default speed: \" + defaultSpeed);\n\t}", "public void doubleSpeed()\r\n {\r\n \tthis.speed= speed-125;\r\n \tgrafico.setVelocidad(speed);\r\n }", "public void increaseSpeed() {\r\n\tupdateTimer.setDelay((int)Math.floor(updateTimer.getDelay()*0.95));\r\n\t\t}", "protected abstract void update(double deltaTime);", "public abstract void update(float dt);", "public abstract void update(float dt);", "public abstract void update(float dt);", "private void run() {\n\n //if no time has elapsed, do not do anything\n if (Harness.getTime().equals(lastRunTime)) {\n return;\n }\n\n //double deltaV, deltaX;\n double newSpeed;\n double newPosition;\n double targetSpeed = 0;\n double currentSpeed = 0;\n double acceleration = 0;\n\n switch (driveOrderedState.speed()) {\n case STOP:\n targetSpeed = 0.0;\n break;\n case LEVEL:\n targetSpeed = LevelingSpeed;\n break;\n case SLOW:\n targetSpeed = SlowSpeed;\n break;\n case FAST:\n targetSpeed = FastSpeed;\n break;\n default:\n throw new RuntimeException(\"Unknown speed\");\n }\n /*\n * JDR Bug fix to make the speed stop in the case where the command is\n * Direction=STOP but speed is something other than STOP.\n */\n if (driveOrderedState.direction() == Direction.STOP) {\n targetSpeed = 0.0;\n }\n if (driveOrderedState.direction() == Direction.DOWN) {\n targetSpeed *= -1;\n }\n\n currentSpeed = driveSpeedState.speed();\n if (driveSpeedState.direction() == Direction.DOWN) {\n currentSpeed *= -1;\n }\n\n if (Math.abs(targetSpeed) > Math.abs(currentSpeed)) {\n //need to accelerate\n acceleration = Acceleration;\n } else if (Math.abs(targetSpeed) < Math.abs(currentSpeed)) {\n //need to decelerate\n acceleration = -1 * Deceleration;\n } else {\n acceleration = 0;\n }\n if (currentSpeed < 0) {\n //reverse everything for negative motion (going down)\n acceleration *= -1;\n }\n\n //get the time offset in seconds since the last update\n double timeOffset = SimTime.subtract(Harness.getTime(), lastRunTime).getFracSeconds();\n //remember this time as the last update\n lastRunTime = Harness.getTime();\n\n //now update speed\n //deltav = at\n newSpeed = currentSpeed + (acceleration * timeOffset);\n\n //deltax= vt+ 1/2 at^2\n newPosition = carPositionState.position() +\n (currentSpeed * timeOffset) + \n (0.5 * acceleration * timeOffset * timeOffset);\n if ((currentSpeed < targetSpeed &&\n newSpeed > targetSpeed) ||\n (currentSpeed > targetSpeed &&\n newSpeed < targetSpeed)) {\n //if deltaV causes us to exceed the target speed, set the speed to the target speed\n driveSpeedState.setSpeed(Math.abs(targetSpeed));\n } else {\n driveSpeedState.setSpeed(Math.abs(newSpeed));\n }\n //determine the direction\n if (driveSpeedState.speed() == 0) {\n driveSpeedState.setDirection(Direction.STOP);\n } else if (targetSpeed > 0) {\n driveSpeedState.setDirection(Direction.UP);\n } else if (targetSpeed < 0) {\n driveSpeedState.setDirection(Direction.DOWN);\n }\n carPositionState.set(newPosition);\n\n physicalConnection.sendOnce(carPositionState);\n physicalConnection.sendOnce(driveSpeedState);\n\n log(\" Ordered State=\", driveOrderedState,\n \" Speed State=\", driveSpeedState,\n \" Car Position=\", carPositionState.position(), \" meters\");\n }", "public void update()\n\t{\n\t\tif (active)\n\t\t{\n\t\t\t// Increases speed to accelerate.\n\t\t\tif (speed < max_speed) speed += acceleration;\n\n\t\t\tif (speed > max_speed) speed = max_speed;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Negates speed to slow down.\n\t\t\tif (speed > 0) speed = -speed;\n\t\t\tif (speed < 0) speed += acceleration;\n\n\t\t\tif (speed > 0) speed = 0;\n\t\t}\n\n\t\t// Sets the speed for thrust.\n\t\thost.momentum.addVelocity(new Displacement(speed * Math.cos(angle), speed * Math.sin(angle)));\n\t}", "void OnSpeedChanges(float speed);", "public void drive(double distance)\n {\n fuelInTank -= distance / fuelEfficiency; \n }", "@Override\n\tpublic void update(long interval) {\n\n\t}", "@Override\n public void updateDispatcher(int newDistance) {\n dispatcher.updateVehicleDistance(this, newDistance);\n }", "public void accelerate(){\n speed += 5;\n }", "private void updateSpeed(CLocation location) {\n double nCurrentSpeed = 0;\n if (location != null) {\n\n nCurrentSpeed = location.getSpeed();\n Log.d(\"Location speed\", nCurrentSpeed+\"\");\n\n }\n\n Formatter fmt = new Formatter(new StringBuilder());\n fmt.format(Locale.UK, \"%5.1f\", nCurrentSpeed);\n String strCurrentSpeed = fmt.toString();\n strCurrentSpeed = strCurrentSpeed.replace(\" \", \"0\");\n\n\n txt.setText(strCurrentSpeed + \" km/h\");\n\n\n }", "public void driveToDistance(double distance) {\n //TODO\n }", "public abstract void update(float time);", "@Override\n\tpublic double calculateVelocity() {\n\t\tdouble result = distance / time + velocitySame - velocityReverse;\n\t\treturn result;\n\t}", "private void setSpeed() {\n double cVel = cAccel*0.1;\n speed += round(mpsToMph(cVel), 2);\n speedOutput.setText(String.valueOf(speed));\n }", "public abstract void update(float deltaTime);", "public abstract void update(float deltaTime);", "public abstract void update(float deltaTime);", "public void setSpeed() {\r\n\t\tthis.currSpeed = this.maxSpeed * this.myStrategy.setEffort(this.distRun);\r\n\t}", "protected void update(IInterval interval) {}", "public void setSpeed(float val) {speed = val;}", "public void changeSpeed(int speed);", "public void setCurrentSpeed (double speed);", "void setSpeed(RobotSpeedValue newSpeed);", "public void onStep() {\n distance += (float)(stepLength / 100000.0);\n notifyListener();\n }", "public void SpeedControl(long iDasherX, long iDasherY, double dFrameRate) {}", "public static void updateDisplaySpeed()\n {\n double oneSecond = 1000;\n //speed.setText( Double.toString(((main.Game.worldTime.getDelay())/oneSecond)) + \" (sec./Day)\" );\n }", "public static void new_speed( Body body, double t ){\r\n body.currentState.vx = body.currentState.vx + body.currentState.ax * t; // new x velocity\r\n body.currentState.vy = body.currentState.vy + body.currentState.ay * t; // new y velocity\r\n body.currentState.vz = body.currentState.vz + body.currentState.az * t; // new z velocity\r\n }", "public void Update(double elapsedTime){\n }", "public void setSpeed(double multiplier);", "private void setSpeedValues(){\n minSpeed = trackingList.get(0).getSpeed();\n maxSpeed = trackingList.get(0).getSpeed();\n averageSpeed = trackingList.get(0).getSpeed();\n\n double sumSpeed =0.0;\n for (TrackingEntry entry:trackingList) {\n\n sumSpeed += entry.getSpeed();\n\n //sets min Speed\n if (minSpeed > entry.getSpeed()){\n minSpeed = entry.getSpeed();\n }\n //sets max Speed\n if (maxSpeed < entry.getSpeed()) {\n maxSpeed = entry.getSpeed();\n }\n\n }\n\n averageSpeed = sumSpeed/trackingList.size();\n }", "public void update()\n {\n scene.realDistance(cfg,\n segway.position(),\n segway.pitch(),\n segway.yaw(),\n result);\n \n scale.setX(result.distance());\n }", "public void calcSpeed() {\n double dist = 0;\n double time = 0;\n for (int i = 0; i < this.length() - 1; i++) {\n dist += get(i).distanceTo(get(i + 1));\n }\n// since it is known that 1ms between frames - calc number of frames * inter_frame_time\n time = (get(length() - 1).getTime() - get(0).getTime()) * INTER_FRAME_TIME;\n\n avgSpeed = dist / time;\n }", "public void setDistance(float dist);", "@Override\n public void tick() {\n setPosition(getPosition().add(getSpeed())); \n }", "public void incWalkSpeed(int n)\n{\n walkSpeed = walkSpeed - n;\n}", "public abstract void setSecondsPerUpdate(float secs);", "@Override\r\n\tpublic void update(int delta)\r\n\t{\r\n\t\tcounter += delta;\r\n\t\twhile(counter >= interval)\r\n\t\t{\r\n\t\t\tcounter -= interval;\r\n\t\t\ttarget.act();\r\n\t\t}\r\n\t}", "public void updateSpeed(double speed, double multiplier) {\n \tif (speed != 0) {\n \t\tspeed *= multiplier;\n \t} else if (multiplier == 1) {\n \t\tspeed = multiplier;\n \t}\n \tanimation.setRate(speed);\n }", "public void refreshMovementSpeed(){\n\t\tif(orientation==ORIENTATION.RIGHT) moveRight();\n\t\telse if(orientation==ORIENTATION.LEFT) moveLeft();\n\t\telse if(orientation==ORIENTATION.UP) moveUp();\n\t\telse if(orientation==ORIENTATION.DOWN) moveDown();\n\t}", "private void updateInterval() {\n this.mNetworkUpdateInterval = Settings.System.getInt(this.mContext.getContentResolver(), \"status_bar_network_speed_interval\", 4000);\n }", "protected void speedRefresh() {\r\n\t\t\ttStartTime = System.currentTimeMillis();\r\n\t\t\ttDownloaded = 0;\r\n\t\t}", "public abstract void update(float delta);", "public abstract void update(float delta);", "public void increaseSpeed(int time) {\n\t\tvelocity += acceleration;\r\n\t}", "public void walk(int distance, int speed) {\n\t\t\r\n\t\t_weight = _weight - distance * speed / 1000000;\r\n\t\tSystem.out.println(_fullname + \" is done walking, his weight is: \" + _weight);\r\n\r\n\t\t\r\n\t}", "public void testConstantSpeed() {\n double endtime = racetrack.getPerimeter() / racetrack.getVelocity();\n double epsilon = 0.000000000001;\n uniformMotion(racetrack, 0, endtime, dt, velocity, epsilon);\n }", "public void update() {\n \n // move\n // Update velocity\n velocity.add(acceleration);\n // Limit speed\n velocity.limit(maxspeed);\n location.add(velocity);\n // Reset accelertion to 0 each cycle\n acceleration.mult(0);\n \n // decay life\n leftToLive = lifespan - (millis() - birth);\n }", "public void setSpeed() {\r\n\t\tint delay = 0;\r\n\t\tint value = h.getS(\"speed\").getValue();\r\n\t\t\r\n\t\tif(value == 0) {\r\n\t\t\ttimer.stop();\r\n\t\t} else if(value >= 1 && value < 50) {\r\n\t\t\tif(!timer.isRunning()) {\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//exponential function. value (1) == delay (5000). value (50) == delay (25)\r\n\t\t\tdelay = (int)(a1 * (Math.pow(25/5000.0000, value / 49.0000)));\r\n\t\t} else if(value >= 50 && value <= 100) {\r\n\t\t\tif(!timer.isRunning()) {\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//exponential function. value (50) == delay(25). value (100) == delay (1)\r\n\t\t\tdelay = (int)(a2 * (Math.pow(1/25.0000, value/50.0000)));\r\n\t\t}\r\n\t\ttimer.setDelay(delay);\r\n\t}", "public void accelerateYD() {\n double temp;\n temp = this.getySpeed();\n if (temp <= this.getMaxSpeed()) {\n temp += this.getMaxSpeed() / 10;\n }\n this.setySpeed(temp);\n\n }", "public void speedUp(){\r\n\t\tmoveSpeed+=1;\r\n\t\tmoveTimer.setDelay(1000/moveSpeed);\r\n\t}", "public void update(){\n\t\tx+=xspeed; \n\t\ty+=yspeed;\t\n\t}", "private void updateNetworkSpeed() {\n Message obtain = Message.obtain();\n obtain.what = 200000;\n long j = 0;\n if (isDemoOrDrive() || this.mDisabled || !this.mIsNetworkConnected) {\n obtain.arg1 = 0;\n this.mHandler.removeMessages(200000);\n this.mHandler.sendMessage(obtain);\n this.mLastTime = 0;\n this.mTotalBytes = 0;\n return;\n }\n long currentTimeMillis = System.currentTimeMillis();\n long totalByte = getTotalByte();\n if (totalByte == 0) {\n this.mLastTime = 0;\n this.mTotalBytes = 0;\n totalByte = getTotalByte();\n }\n long j2 = this.mLastTime;\n if (j2 != 0 && currentTimeMillis > j2) {\n long j3 = this.mTotalBytes;\n if (!(j3 == 0 || totalByte == 0 || totalByte <= j3)) {\n j = ((totalByte - j3) * 1000) / (currentTimeMillis - j2);\n }\n }\n obtain.arg1 = 1;\n obtain.obj = Long.valueOf(j);\n this.mHandler.removeMessages(200000);\n this.mHandler.sendMessage(obtain);\n this.mLastTime = currentTimeMillis;\n this.mTotalBytes = totalByte;\n postUpdateNetworkSpeedDelay((long) this.mNetworkUpdateInterval);\n }", "private void changeSpeed() {\n\t\tint t = ((JSlider)components.get(\"speedSlider\")).getValue();\n\t\tsim.setRunSpeed(t);\n\t}", "void simulationSpeedChange(int value);", "private void calculateDelta() {\n // 60 fps <=> delta ~ 0.016f\n //\n long curTime = SystemClock.elapsedRealtimeNanos();\n delta = (curTime - lastTime) / 1_000_000_000.0f;\n lastTime = curTime;\n }", "public void setSpeed(int hz) {\n this.interval = 1000000000L / hz;\n if (!stopped.get()) {\n this.stop(); \n this.start();\n }\n }", "public void update() {\n // Update velocity\n velocity.add(acceleration);\n // Limit speed\n velocity.limit(maxspeed);\n position.add(velocity);\n // Reset accelertion to 0 each cycle\n acceleration.mult(0);\n }", "public void update() {\n // Update velocity\n velocity.add(acceleration);\n // Limit speed\n velocity.limit(maxspeed);\n position.add(velocity);\n // Reset accelertion to 0 each cycle\n acceleration.mult(0);\n }", "public abstract void update(int delta);", "public void setSpeed(int newSpeed)\n {\n speed = newSpeed;\n }", "public double getCurrentSpeed();", "@Override\n public void Update()\n {\n\n activity.runOnUiThread(new Runnable()\n {\n @Override\n public void run()\n {\n if(geoTarget == null)\n {\n txtInstructions.setVisibility(VISIBLE);\n txtFlightTime.setVisibility(GONE);\n }\n else\n {\n GeoCoord geoFrom = bFromPlayer ? game.GetOurPlayer().GetPosition() : game.GetMissileSite(lSiteID).GetPosition();\n float fltDistance = geoFrom.DistanceTo(geoTarget);\n\n txtFlightTime.setText(context.getString(R.string.flight_time_target, TextUtilities.GetTimeAmount(game.GetTimeToTarget(geoFrom, geoTarget, game.GetConfig().GetMissileSpeed(missileType.GetSpeedIndex())))));\n txtInstructions.setVisibility(GONE);\n txtFlightTime.setVisibility(VISIBLE);\n txtOutOfRange.setVisibility(fltDistance > game.GetConfig().GetMissileRange(missileType.GetRangeIndex()) ? VISIBLE : GONE);\n imgTracking.setVisibility(bTrackPlayer ? VISIBLE : GONE);\n\n //Update trajectory.\n List<LatLng> points = new ArrayList<LatLng>();\n points.add(Utilities.GetLatLng(bFromPlayer ? game.GetOurPlayer().GetPosition() : game.GetMissileSite(lSiteID).GetPosition()));\n\n if(bTrackPlayer)\n {\n geoTarget = game.GetPlayer(lTrackPlayerID).GetPosition();\n }\n\n points.add(Utilities.GetLatLng(geoTarget));\n\n targetTrajectory.setPoints(points);\n }\n }\n });\n }", "void update(int seconds);", "@Override\n\tpublic void increaseSpeed() {\n\t\tSystem.out.println(\"increaseSpeed\");\n\t\t\n\t}", "public void update() {\n if (!hasStarted) {\n //drive.setAutonStraightDrive();\n hasStarted = true;\n } else {\n if (Math.abs((Math.abs(rotations) - (Math.abs(drive.getRightSensorValue() / 4096)))) <= TOLERANCE) {\n drive.setBrakeMode(true);\n setFinished(true);\n }\n }\n\n }", "private static void updateDistances(Stop newStop) {\n stopDistances.put(new StopPair(newStop, newStop), 0);\n for (Stop s : getAllStops()) {\n // Calculate distance both directions, as implementation of\n // calculateDistancesBetweenStops may change and provide non-mirroring\n // results.\n int distanceA = calculateDistanceBetweenStops(s, newStop);\n int distanceB = calculateDistanceBetweenStops(newStop, s);\n stopDistances.put(new StopPair(s, newStop), distanceA);\n stopDistances.put(new StopPair(newStop, s), distanceB);\n }\n }", "public void updateDrive () {\n leftCurrSpeed = scale (leftCurrSpeed, leftTargetSpeed, Constants.Drivetrain.ACCELERATION_SCALING, Constants.Drivetrain.ACCELERATION_THRESHOLD);\n rightCurrSpeed = scale (rightCurrSpeed, rightTargetSpeed, Constants.Drivetrain.ACCELERATION_SCALING, Constants.Drivetrain.ACCELERATION_THRESHOLD);\n driveRaw (leftCurrSpeed, rightCurrSpeed);\n }", "public void update(int time);", "double getSpeed();", "@Override\n public synchronized void update(int deltaTime) {\n }", "@Override\n\tpublic void update()\n\t{\n\t\tsuper.update();\n\n\t\tcalcAcceleration();\n\t\tsetVelocity(Vector2D.add(getVelocity(), getAcceleration()));\n\n\t\tcalcVelocity();\n\t\tsetPosition(Vector2D.add(getPosition(), getVelocity()));\n\n\t\tbm.update(getPosition(), getWidth(), getHeight());\n\t}", "@Override\n\tpublic void update(float dt) {\n\t\t\n\t}", "public void update() {\n vel.add(acc);\n vel.limit(max_vel);\n loc.add(vel);\n acc.mult(0);\n }", "@Override\r\n\tpublic void update(float dt) {\n\r\n\t}", "private void changeDistance() {\n kilometers = sb.getProgress();\n TextView textView = (TextView) findViewById(R.id.distanceText);\n textView.setText(kilometers + \" km\");\n }", "@Override\t\n\tpublic void run() {\n\t\tif(running) {\n\t\t\ttry {\n\t\t\t\tfloat[] results=new float[3];\n\t\t\t\tLocation current;\n\t\t\t\tcurrent=gps.getCurrentLocation();\t\t\n\t\t\t\tLocation.distanceBetween(current.getLatitude(), current.getLongitude(), step.getLocation().getLatitude(), step.getLocation().getLongitude(), results);\t\t\n\t\t\t\tdistance=results[0];\n\t\t\t\t\n\t\t\t\tamount++;\n\t\t\t\t\n\t\t\t\tif(amount==3) {\n\t\t\t\t\tchange=true;\n\t\t\t\t\tvoicer.speak(\"Para\");\n\t\t\t\t\tamount=0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tvoicer.speak(\"Continúa \"+(int)distance);\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\tcatch(Exception ex) {\n\t\t\t\tvoicer.speak(\"Excepcionaca\");\n\t\t\t}\n\t\t}\t\t\n\t}", "private void updateUI() {\n if (mCurrentLocation != null) {\n mLatitudeTextView.setText(String.valueOf(mCurrentLocation.getLatitude()));\n mLongitudeTextView.setText(String.valueOf(mCurrentLocation.getLongitude()));\n mLastUpdateTimeTextView.setText(mLastUpdateTime);\n\n localLatitude = Double.parseDouble(mLatitudeTextView.getText().toString());\n localLongtitude = Double.parseDouble(mLongitudeTextView.getText().toString());\n double newDistance = Math.round(gps2m(previousLatitude, previousLongitude, localLatitude, localLongtitude) * 100) / 100.0;\n\n /*\n if (!mStartUpdatesButton.isEnabled()) {\n mMoveTextView.setText(String.valueOf(newDistance) + \" m\");\n totalDistance += newDistance;\n\n mTotalDistanceTextView.setText(String.valueOf(totalDistance) + \"m\");\n }\n previousLatitude = localLatitude != 0 ? localLatitude : previousLongitude;\n previousLongitude = localLongtitude != 0 ? localLongtitude : previousLatitude;\n\n\n if (!mStartUpdatesButton.isEnabled()) {\n double speed = Double.parseDouble(timeToSpeed());\n\n timeslots.add(System.currentTimeMillis());\n userspeeds.add((float) speed);\n float randomspeed = (float)Math.random()*6;\n compspeeds.add(randomspeed);\n mSpeedTextView.setText(String.valueOf(speed) + \"km/h\");\n\n //TODO: change weight\n double calValue = calorieCalculator(weight, timeSingleValue / 3600, speed);\n calValue = Math.round(calValue * 100) / 100;\n calValue = calValue < 0 ? 0 : calValue;\n calValue = calValue > 100 ? 100 : calValue;\n calValue = calValue / 1000;\n mCalTextView.setText(String.valueOf(calValue));\n compDistance += 5*randomspeed/3600*1000;\n int predictedCalories = (int) Math.round((calValue / timeSingleValue)) * 3600;\n mCalPredictTextView.setText(String.valueOf(predictedCalories));\n\n\n if (compDistance > totalDistance) {\n if (status == 0 || status == 1) {\n MediaPlayer mediaPlayer1 = MediaPlayer.create(getApplicationContext(), R.raw.tooslow);\n mediaPlayer1.start();\n status = 2;\n }\n } else {\n if (status == 0 || status == 2) {\n MediaPlayer mediaPlayer2 = MediaPlayer.create(getApplicationContext(), R.raw.toofast);\n mediaPlayer2.start();\n status = 1;\n }\n }\n }\n */\n if (!mStartUpdatesButton.isEnabled()) {\n mMoveTextView.setText(String.valueOf(newDistance) + \" m\");\n totalDistance += newDistance;\n double totalDistanceOutput = Math.round(totalDistance * 100) / 100.0;\n totalDistanceOutput = totalDistanceOutput < 0 ? 0 : totalDistanceOutput;\n mTotalDistanceTextView.setText(String.valueOf(totalDistanceOutput) + \"m\");\n }\n previousLatitude = localLatitude != 0 ? localLatitude : previousLongitude;\n previousLongitude = localLongtitude != 0 ? localLongtitude : previousLatitude;\n if (!mStartUpdatesButton.isEnabled()) {\n double speed = Double.parseDouble(timeToSpeed());\n timeslots.add(System.currentTimeMillis());\n userspeeds.add((float) speed);\n float randomspeed = (float) Math.random() * 2;\n compspeeds.add(randomspeed);\n mSpeedTextView.setText(String.valueOf(speed) + \" km/h\");\n double calValue = calorieCalculator(weight, timeSingleValue / 3600, speed);\n calValue = calValue < 0 ? 0 : calValue;\n calValue = calValue > 100 ? 100 : calValue;\n calValue = calValue / 1000.0 * 60;\n calValue = Math.round(calValue * 100) / 100.0;\n mCalTextView.setText(String.valueOf(calValue) + \" kCal/m\");\n compDistance += 5 * randomspeed / 3600 * 1000;\n double predictedCalories = (calValue / timeSingleValue) * 60;\n predictedCalories = (predictedCalories < 0 || predictedCalories > 100000) ? 0 : predictedCalories;\n mCalPredictTextView.setText(\"~ \" + String.valueOf(predictedCalories) + \" kCal\");\n\n if (compDistance > totalDistance) {\n if (status == 0 || status == 1) {\n MediaPlayer mediaPlayer1 = MediaPlayer.create(getApplicationContext(), R.raw.tooslow);\n mediaPlayer1.start();\n status = 2;\n }\n } else {\n if (status == 0 || status == 2) {\n MediaPlayer mediaPlayer2 = MediaPlayer.create(getApplicationContext(), R.raw.toofast);\n mediaPlayer2.start();\n status = 1;\n }\n }\n }\n }\n }", "public abstract void decelerateMotorSpeeds(double[] motorSpeeds, double distanceToTarget, double lastDistanceToTarget, long timeSinceLastCallNano, double configuredMovementSpeed, double configuredTurnSpeed);", "protected long travel() {\n\n return Math.round(((1 / Factory.VERTEX_PER_METER_RATIO) / (this.speed / 3.6)) * 1000);\n }", "public void setWalkSpeed(int n)\n{\n walkSpeed = n;\n}", "protected void updateTime(float deltaTime) {\n }", "void addDistance(float distanceToAdd);", "public void addSpeed(int speed) {\n this.speed += speed;\n }", "public void update(Vehicle v, float dt) {\nPoint2D.Float p = v.getPosition();\r\nPoint2D.Float tp = target.getPosition();\r\nPoint2D.Float desired_velocity = new Point2D.Float(tp.x - p.x , tp.y - p.y);\r\nVehicle.scale(desired_velocity, v.getMaxSpeed());\r\nv.updateSteering(desired_velocity.x, desired_velocity.y);\r\n}", "@Override\n public void update(float delta) {\n if (engine) {\n //accelerate\n velocity.x += acceleration * direction.x * delta;\n velocity.y += acceleration * direction.y * delta;\n } else {\n //decelerate\n velocity.scl((1 - (delta / 2))); //(1-delta/2) approx= 0.991\n\n //ship stops when speed is close to 0\n if (velocity.len() < 15) {\n velocity.setZero();\n }\n }\n //cap speed\n if (velocity.len() > speedCap) {\n velocity.setLength(speedCap);\n }\n\n //adjust ship position\n super.update(delta);\n }", "public void setSpeed(int newTicksMultiplier) {\r\n this.ticksMultiplier = newTicksMultiplier;\r\n }", "public double getSpeed();", "public void update(double dt,double fX,double fY){\n\t\tdouble ax = fX/mass;\n\t\tdouble ay = fY/mass; \n\t\txxVel= xxVel + ax * dt;\n\t\tyyVel= yyVel + ay * dt;\n\t\txxPos = xxPos + xxVel * dt;\n\t\tyyPos = yyPos + yyVel * dt; \n\t}", "public void setSpeed(double speed)\r\n {\r\n this.speed = speed;\r\n }" ]
[ "0.7111051", "0.6978464", "0.6838094", "0.6759183", "0.659122", "0.65569574", "0.65229106", "0.65171134", "0.6494507", "0.63265026", "0.6303279", "0.6303279", "0.6303279", "0.62318707", "0.6213522", "0.6197128", "0.61960715", "0.6179815", "0.6176943", "0.6170093", "0.61649173", "0.6158909", "0.6146705", "0.6144743", "0.6097376", "0.60926163", "0.60926163", "0.60926163", "0.60822475", "0.6079751", "0.60689086", "0.606518", "0.6059393", "0.6033726", "0.5990416", "0.59809226", "0.5978857", "0.59719837", "0.59686136", "0.59644353", "0.5934556", "0.5934516", "0.59297013", "0.5914752", "0.5903523", "0.5903144", "0.5901382", "0.5897248", "0.58863837", "0.58428943", "0.5840666", "0.58375216", "0.5830703", "0.5830703", "0.58289003", "0.58262134", "0.58256745", "0.58094966", "0.5800082", "0.5792804", "0.57754844", "0.5774539", "0.5772938", "0.5760494", "0.5745814", "0.5744192", "0.5740231", "0.5735661", "0.5735661", "0.5732186", "0.5732145", "0.57173735", "0.5715528", "0.57148135", "0.57126564", "0.5707883", "0.5704395", "0.56998277", "0.5698966", "0.5698194", "0.56942403", "0.5689905", "0.56871605", "0.5686853", "0.5685381", "0.5681148", "0.5679734", "0.56792927", "0.56671834", "0.56574506", "0.5654926", "0.5654852", "0.5646324", "0.5645413", "0.56389767", "0.5638672", "0.5636681", "0.56364226", "0.56338775", "0.5620322" ]
0.7492844
0
TODO Autogenerated method stub
@Override protected String getProgramId(HttpServletRequest request) { return "BPRA02"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Returns the value of the 'Actual Start' containment reference. If the meaning of the 'Actual Start' containment reference isn't clear, there really should be more of a description here...
ActualStartType getActualStart();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Position getStart() {\r\n return start;\r\n }", "public Date getActualStart()\r\n {\r\n return (m_actualStart);\r\n }", "public Coordinate getStart( )\n\t{\n\t\treturn startLocation;\n\t}", "public Point getStart() {\n return mStart;\n }", "public double getStart() {\n return start;\n }", "public Point getStart() {\n\t\treturn _start;\n\t}", "public Point start() {\r\n return this.start;\r\n }", "public int getStart() {\r\n\t\treturn start;\r\n\t}", "public long getExpectedStart() {\n return this.expectedStart;\n }", "public String getStart(){\n\t\treturn mStart;\n\t}", "public int getStart() {\n\t\treturn start;\n\t}", "public double getStartX() {\n\treturn v1.getX();\n }", "public long getStart() {\n return start;\n }", "public int getStart() {\n return this.start;\n }", "org.hl7.fhir.Integer getStart();", "public int getStart() {\r\n return start;\r\n }", "public int getStart() {\n\t\t\treturn start;\n\t\t}", "public int getStart() {\n return start;\n }", "public int getStart() {\n return start;\n }", "public Point getStart(){\n\t\treturn bigstart;\n\t}", "public String getStart() {\r\n\t\treturn this.start;\r\n\t}", "public double getStartX()\n {\n return startxcoord; \n }", "public BigInteger getStartValue()\r\n {\r\n return this.startValue;\r\n }", "public Position getStartPosition() {\n return start;\n }", "public int getStart()\n {\n return start;\n }", "public double getStart();", "public double getStartX() {\r\n return startx;\r\n }", "public int getStart() {\r\n\t\treturn this.offset;\r\n\t}", "public String getStart(){\n\t\treturn start;\n\t}", "public String getStart() {\n return start;\n }", "public float getStartX() {return startX;}", "@Nullable\n public DpProp getStart() {\n if (mImpl.hasStart()) {\n return DpProp.fromProto(mImpl.getStart());\n } else {\n return null;\n }\n }", "public int getStart ()\n {\n\n return this.start;\n\n }", "public Block getStart () {\n\t\treturn start;\n\t}", "public int getStartX() {\r\n\t\treturn startX;\r\n\t}", "public int getStartx(){\n\t\treturn startx;\n\t}", "public int getStart ()\r\n {\r\n return glyph.getBounds().x;\r\n }", "public final int startOffset() {\n return startOffset;\n }", "public WorldCoordinate getBegin() {\r\n\t\treturn this.begin;\r\n\t}", "public Node getStart(){\n return start;\n }", "public RefLimit getStartFrom() {\n\t\treturn startFrom;\n\t}", "public Location getMeasureStart() {\n if(measureStart == null) {\n return currentLocation;\n } else {\n return measureStart;\n }\n }", "public Point getStartPosition()\r\n\t{\r\n\t\treturn startPosition;\r\n\t}", "public Point getStartPoint() {\n\t\treturn startPoint;\n\t}", "Long getStartAt();", "MinmaxEntity getStart();", "public RefLimit getStartFrom() {\n\t\t\treturn startFrom;\n\t\t}", "public String get_start() {\n\t\treturn start;\n\t}", "public double getStartY() {\n\treturn v1.getY();\n }", "double getStartX();", "public Position getStartPosition()\r\n\t{\r\n\t\treturn startPosition;\r\n\t}", "public GeoPoint getStart(){\n return getOrigin();\n }", "public Location getStartLocation() {\r\n \treturn new Location(0,0);\r\n }", "public ImPoint getCurrentLoc() {\n \treturn this.startLoc;\n }", "public double getDistanceToStart() {\r\n return startDistance;\r\n }", "public int getStartOffset() {\n return startOffset;\n }", "public java.math.BigInteger getStartIndex()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTINDEX$10);\n if (target == null)\n {\n return null;\n }\n return target.getBigIntegerValue();\n }\n }", "public Node getStartNode() {\n return startNode;\n }", "public Position getStartPosition() {\n return startPosition;\n }", "public Vector3f getStartPosition()\n {\n return startPosition;\n }", "public int getStartPosition() {\n return startPosition_;\n }", "net.opengis.gml.x32.TimePositionType getBeginPosition();", "@Override\n\tpublic float getStartValue() {\n\t\treturn value;\n\t}", "public Place getStartingPlace() {\n return startingPlace;\n }", "public int getStartPosition() {\n return startPosition_;\n }", "public double getStartY()\n {\n return startycoord; \n }", "public String getStartPoint()\n\t{\n\t\tString getStart;\n\t\tgetStart = (this.startPoint.xPosition + \",\" + this.startPoint.yPosition);\n\t\treturn getStart;\n\t}", "public long getStartOffset() {\n return mStartOffset;\n }", "public float getDistanceToStart() {\n\t\treturn distanceToStart;\n\t}", "public WeightedPoint getStart()\n {\n return map.getStart();\n }", "public PixelPoint getStartPoint ()\r\n {\r\n Point start = glyph.getLag()\r\n .switchRef(\r\n new Point(getStart(), line.yAt(getStart())),\r\n null);\r\n\r\n return new PixelPoint(start.x, start.y);\r\n }", "public Block returnStart() {\n\t\treturn start;\n\t}", "private double getStartX() {\n\t\treturn Math.min(x1, x2);\n\t}", "public int getStartIdx() {\n return this.startIdx;\n }", "public int getStartOffset() {\n return startPosition.getOffset();\n }", "public int startOffset();", "public int getStartingPos ()\r\n {\r\n if ((getThickness() >= 2) && !getLine()\r\n .isVertical()) {\r\n return getLine()\r\n .yAt(getStart());\r\n } else {\r\n return getFirstPos() + (getThickness() / 2);\r\n }\r\n }", "public Location getStartingLocation() {\r\n return startingLocation;\r\n }", "public BigDecimal getActualPosition() {\n return actualPosition;\n }", "public Float getxBegin() {\r\n return xBegin;\r\n }", "public Integer getStartMark() {\n return startMark;\n }", "public long getRangeStart() {\n return mRangeStart;\n }", "public Point getPlayerStart() {\r\n\t\treturn this.playerStart;\r\n\t}", "public Vector2D getStartPos(){\n\t\treturn startPos;\n\t}", "org.mojolang.mojo.lang.Position getStartPosition();", "public int getRangeStart() {\n return currentViewableRange.getFrom();\n }", "@Override\n public int getStart() {\n return feature.getStart();\n }", "ButEnd getStart();", "public Date getStart() {\n return start;\n }", "public double getStartLat() {\n\t\treturn startLat;\n\t}", "public Vertex getStart()\n\t{\n\t\treturn start.copy();\n\t}", "public int start() {\n return start;\n }", "public int getBegin() {\n\t\treturn begin;\n\t}", "public int restrictionStart() {\n return mRestriction == null ? -1 : mRestriction.getStart();\n }", "public State getStart() {\n \t\treturn start;\n \t}", "public Ndimensional getStartPoint();", "public java.math.BigInteger getStartPage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTPAGE$12);\n if (target == null)\n {\n return null;\n }\n return target.getBigIntegerValue();\n }\n }", "public Integer getiDisplayStart() {\r\n\t\treturn iDisplayStart;\r\n\t}", "public static int getStartXCoordinate(){\n\t\tint x = getThymioStartField_X(); \n\t\t\n\t\tif(x == 0){\n\t\t\n \t}else{\n \t x *= FIELD_HEIGHT;\n \t}\n \t\n\t\treturn x ;\n\t}", "public double getStartingDistance() {\n return myStartDistance;\n }" ]
[ "0.6910748", "0.6884121", "0.6778642", "0.6741016", "0.6736021", "0.6639861", "0.6628435", "0.6571592", "0.65632474", "0.65569574", "0.6525912", "0.65168375", "0.6507129", "0.65014637", "0.64988875", "0.6481824", "0.64680225", "0.6448096", "0.6442841", "0.64262414", "0.6414843", "0.64135426", "0.6402967", "0.638134", "0.6375521", "0.63592434", "0.635907", "0.63396513", "0.6338266", "0.6332822", "0.630419", "0.6273723", "0.6273345", "0.6253108", "0.6226759", "0.6199988", "0.6191666", "0.618458", "0.6164695", "0.61468536", "0.61384803", "0.61275065", "0.6115995", "0.61068606", "0.6062986", "0.6056735", "0.60487854", "0.6040986", "0.60365415", "0.603017", "0.6029034", "0.6025969", "0.60015804", "0.5964516", "0.5959267", "0.5942035", "0.59374774", "0.5924423", "0.5919347", "0.59170526", "0.59071964", "0.58922863", "0.5878101", "0.5867577", "0.58653295", "0.5856552", "0.5855515", "0.5849557", "0.58375156", "0.5830716", "0.5828609", "0.5823986", "0.5822943", "0.5814879", "0.5795828", "0.57957274", "0.5785", "0.57803017", "0.57590395", "0.5742444", "0.5731204", "0.5729964", "0.5724439", "0.572442", "0.5715726", "0.57110435", "0.57087475", "0.5706689", "0.5693517", "0.56916064", "0.5684559", "0.56684196", "0.56662387", "0.5665647", "0.5652929", "0.56514615", "0.5650271", "0.56424296", "0.56397086", "0.5625063" ]
0.69446415
0
Returns the value of the 'Early Start' containment reference. If the meaning of the 'Early Start' containment reference isn't clear, there really should be more of a description here...
EarlyStartType getEarlyStart();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DTM getRxa3_DateTimeStartOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(3, 0);\r\n\t\treturn retVal;\r\n }", "public String getResearchbegindate() {\r\n\t\treturn researchbegindate;\r\n\t}", "org.hl7.fhir.Integer getStart();", "public DTM getDateTimeStartOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(3, 0);\r\n\t\treturn retVal;\r\n }", "LateStartType getLateStart();", "public Location getEntrance() {\n\t\treturn entrance;\n\t}", "public boolean getStartInclusive() {\n return startInclusive;\n }", "EarlyFinishType getEarlyFinish();", "public E startState() {\r\n\t\treturn this.values[0];\r\n\t}", "public String getEntrance() {\n\t\treturn entrance;\n\t}", "public Chamber getStart() {\n return start;\n }", "Long getStartAt();", "public Date getCellLowerDeadline() {\r\n\t\treturn CellLowerDeadline;\r\n\t}", "public Date getEarliestStartDate();", "public double getStart() {\n return start;\n }", "public org.apache.xmlbeans.XmlDate xgetJobStartDate()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlDate target = null;\r\n target = (org.apache.xmlbeans.XmlDate)get_store().find_element_user(JOBSTARTDATE$0, 0);\r\n return target;\r\n }\r\n }", "public String getEarliestConstraint() {\n return earliest;\n }", "public BigInteger getStartValue()\r\n {\r\n return this.startValue;\r\n }", "public M csmiBirthdayStart(Object start){this.put(\"csmiBirthdayStart\", start);return this;}", "public Date getBaselineStart()\r\n {\r\n return (m_baselineStart);\r\n }", "public int getStartX() {\r\n\t\treturn startX;\r\n\t}", "public Coordinate getStart( )\n\t{\n\t\treturn startLocation;\n\t}", "public Date getStart() {\n return start;\n }", "public Date getStart() throws ServiceLocalException {\n\t\treturn (Date) this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.Start);\n\t}", "@XmlElement(\"InitialGap\")\n Expression getInitialGap();", "public java.util.Date startSnap()\n\t{\n\t\treturn _dtBegin;\n\t}", "public RefLimit getStartFrom() {\n\t\treturn startFrom;\n\t}", "public double getStartX() {\n\treturn v1.getX();\n }", "public Place getStartingPlace() {\n return startingPlace;\n }", "public double getStartX() {\r\n return startx;\r\n }", "public GregorianCalendar getStart() {\n return _start;\n }", "public RefLimit getStartFrom() {\n\t\t\treturn startFrom;\n\t\t}", "public BigDecimal getEARLY_SETTLED_AMOUNT() {\r\n return EARLY_SETTLED_AMOUNT;\r\n }", "public BwCalendar fetchBeforeCalendar() {\n return beforeCalendar;\n }", "public Optional<Instant> getBefore() {\n\t\treturn before;\n\t}", "public com.a9.spec.opensearch.x11.QueryType.StartPage xgetStartPage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.a9.spec.opensearch.x11.QueryType.StartPage target = null;\n target = (com.a9.spec.opensearch.x11.QueryType.StartPage)get_store().find_attribute_user(STARTPAGE$12);\n return target;\n }\n }", "public Position getStart() {\r\n return start;\r\n }", "public int getBegin() {\n if (Span_Type.featOkTst && ((Span_Type)jcasType).casFeat_Begin == null)\n jcasType.jcas.throwFeatMissing(\"Begin\", \"Span\");\n return jcasType.ll_cas.ll_getIntValue(addr, ((Span_Type)jcasType).casFeatCode_Begin);}", "public Optional<Instant> getBefore() {\n\t\t\treturn before;\n\t\t}", "public WorldCoordinate getBegin() {\r\n\t\treturn this.begin;\r\n\t}", "@Nullable\n public DpProp getStart() {\n if (mImpl.hasStart()) {\n return DpProp.fromProto(mImpl.getStart());\n } else {\n return null;\n }\n }", "public State getStart() {\n \t\treturn start;\n \t}", "public Date getActualStart()\r\n {\r\n return (m_actualStart);\r\n }", "public int getStart() {\r\n\t\treturn start;\r\n\t}", "public Date getBeginnDate() {\n\t\treturn beginnDate;\n\t}", "public final int startOffset() {\n return startOffset;\n }", "public int getStart() {\n return this.start;\n }", "@Override\n public int getStart() {\n return feature.getStart();\n }", "public Element getStartExpression() {\n\t\treturn startExpression;\n\t}", "public Location getStartLocation() {\r\n \treturn new Location(0,0);\r\n }", "public int getStart() {\r\n return start;\r\n }", "net.opengis.gml.x32.TimeInstantPropertyType getBegin();", "WeekdaySpec getStart();", "public Date getOriginalStart() throws ServiceLocalException {\n\t\treturn (Date) this.getPropertyBag().getObjectFromPropertyDefinition(\n\t\t\t\tAppointmentSchema.OriginalStart);\n\t}", "public Date getStartDate()\n {\n return (Date)getAttributeInternal(STARTDATE);\n }", "public double getStart();", "public int getStart() {\n\t\treturn start;\n\t}", "public double getFirstExtreme(){\r\n return firstExtreme;\r\n }", "public int getStart() {\n return start;\n }", "public java.util.Calendar getJobStartDate()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(JOBSTARTDATE$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getCalendarValue();\r\n }\r\n }", "MinmaxEntity getStart();", "public int getStart ()\n {\n\n return this.start;\n\n }", "public float getStartX() {return startX;}", "@Override\n\tpublic Date getStartDate() {\n\t\treturn model.getStartDate();\n\t}", "public int getStart()\n {\n return start;\n }", "public TimeDateComponents getEventStartDate() {\n return getEventDates().getStartDate();\n }", "@ApiModelProperty(value = \"Model lifeline start (milliseconds UTC)\")\n public Long getLifeStart() {\n return lifeStart;\n }", "public int getStart() {\n return start;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getStartDate();", "public long getStart() {\n return start;\n }", "public long getExpectedStart() {\n return this.expectedStart;\n }", "public int getStart() {\n\t\t\treturn start;\n\t\t}", "public Integer getStartSoc() {\n return startSoc;\n }", "public double getStartX()\n {\n return startxcoord; \n }", "public java.math.BigInteger getStartPage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTPAGE$12);\n if (target == null)\n {\n return null;\n }\n return target.getBigIntegerValue();\n }\n }", "public long getInitial() {\n return m_Initial;\n }", "public String getStart() {\r\n\t\treturn this.start;\r\n\t}", "net.opengis.gml.x32.TimePositionType getBeginPosition();", "public Point start() {\r\n return this.start;\r\n }", "public XtypeGrammarAccess.JvmLowerBoundAndedElements getJvmLowerBoundAndedAccess() {\r\n\t\treturn gaXtype.getJvmLowerBoundAndedAccess();\r\n\t}", "public String getStart(){\n\t\treturn mStart;\n\t}", "public Date getEarliestFinishingDate();", "@Override\r\n public Integer minLowerBound() {\r\n return this.getImpl().minLowerBound();\r\n }", "public String getBeforeValue() {\n return beforeValue;\n }", "public Date getDtStart() {\r\n return dtStart;\r\n }", "public com.a9.spec.opensearch.x11.QueryType.StartIndex xgetStartIndex()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.a9.spec.opensearch.x11.QueryType.StartIndex target = null;\n target = (com.a9.spec.opensearch.x11.QueryType.StartIndex)get_store().find_attribute_user(STARTINDEX$10);\n return target;\n }\n }", "public XtypeGrammarAccess.JvmLowerBoundAndedElements getJvmLowerBoundAndedAccess() {\n\t\treturn gaXtype.getJvmLowerBoundAndedAccess();\n\t}", "public XtypeGrammarAccess.JvmLowerBoundAndedElements getJvmLowerBoundAndedAccess() {\n\t\treturn gaXtype.getJvmLowerBoundAndedAccess();\n\t}", "org.apache.xmlbeans.XmlDateTime xgetSearchRecurrenceStart();", "double getStartX();", "@Override\n\tpublic float getStartValue() {\n\t\treturn value;\n\t}", "public boolean getFiscalYearStart()\r\n {\r\n return (m_fiscalYearStart);\r\n }", "public int getStartx(){\n\t\treturn startx;\n\t}", "public String getStart() {\n return start;\n }", "public Integer getStartMark() {\n return startMark;\n }", "@NotNull\r\n public DateWithOffset getStartDate() {\r\n checkStartDate();\r\n return startDate;\r\n }", "public Point getStart() {\n\t\treturn _start;\n\t}", "public int getStartField()\n {\n return this.startField;\n }", "@Override\n public double getStartXValue(int series, int item) {\n assert 0 <= series && series < checkpoint.gcTraceSize();\n assert 0 <= item && item < checkpoint.size(series);\n\n double startSec = gcActivity(series, item).getStartSec();\n return startSec;\n }", "public Node getStart(){\n return start;\n }" ]
[ "0.56680655", "0.5616965", "0.55787444", "0.557001", "0.55339265", "0.5497526", "0.54779685", "0.54536355", "0.5441419", "0.5420695", "0.5405928", "0.539702", "0.5390282", "0.53814274", "0.536124", "0.53579724", "0.5351047", "0.53479993", "0.5340105", "0.53087974", "0.53021866", "0.52863973", "0.5279398", "0.5275355", "0.52749145", "0.5258421", "0.52462095", "0.52451956", "0.52425003", "0.52392244", "0.5237432", "0.51985943", "0.5195976", "0.5187809", "0.5187703", "0.5185845", "0.51823455", "0.5172283", "0.5163206", "0.5162028", "0.51511985", "0.51505756", "0.51489043", "0.51487744", "0.51487184", "0.51478916", "0.5130432", "0.51288676", "0.5125292", "0.5122707", "0.51195824", "0.511528", "0.5112584", "0.51122767", "0.51046365", "0.5103268", "0.51026416", "0.510121", "0.50958306", "0.50940156", "0.5091502", "0.50878227", "0.50801575", "0.50792116", "0.5074133", "0.50635123", "0.5061342", "0.50597876", "0.5054568", "0.5053729", "0.505343", "0.5049455", "0.5042412", "0.5025597", "0.5025368", "0.5024248", "0.5018856", "0.5008146", "0.5007195", "0.5006362", "0.49968952", "0.4995467", "0.49909544", "0.49833712", "0.4982158", "0.49804735", "0.49770945", "0.49770945", "0.49769807", "0.49757332", "0.4973194", "0.49704692", "0.49687344", "0.49654472", "0.4962587", "0.4961334", "0.49578032", "0.49534974", "0.49512023", "0.494988" ]
0.71470314
0
Returns the value of the 'Late Start' containment reference. If the meaning of the 'Late Start' containment reference isn't clear, there really should be more of a description here...
LateStartType getLateStart();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "EarlyStartType getEarlyStart();", "public double getDayLate() {\n return dayLate;\n }", "public DTM getRxa3_DateTimeStartOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(3, 0);\r\n\t\treturn retVal;\r\n }", "public Location getMeasureStart() {\n if(measureStart == null) {\n return currentLocation;\n } else {\n return measureStart;\n }\n }", "public DTM getDateTimeStartOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(3, 0);\r\n\t\treturn retVal;\r\n }", "public Coordinate getStart( )\n\t{\n\t\treturn startLocation;\n\t}", "public Location getEntrance() {\n\t\treturn entrance;\n\t}", "net.opengis.gml.x32.TimeInstantPropertyType getBegin();", "public Chamber getStart() {\n return start;\n }", "net.opengis.gml.x32.TimePositionType getBeginPosition();", "public Place getStartingPlace() {\n return startingPlace;\n }", "public long getInitial() {\n return m_Initial;\n }", "public boolean getNorth()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(NORTH$0, 0);\n if (target == null)\n {\n return false;\n }\n return target.getBooleanValue();\n }\n }", "org.landxml.schema.landXML11.Station xgetStaStart();", "public Location getStartLocation() {\r\n \treturn new Location(0,0);\r\n }", "org.hl7.fhir.Integer getStart();", "public Position getStart() {\r\n return start;\r\n }", "Long getStartAt();", "LateFinishType getLateFinish();", "public double getStart() {\n return start;\n }", "public PVector getWristPosition(){\n\t\treturn this.leap.map(this.arm.wristPosition());\n\t}", "public Location getStartingLocation() {\r\n return startingLocation;\r\n }", "public Date getActualStart()\r\n {\r\n return (m_actualStart);\r\n }", "public Block getStart () {\n\t\treturn start;\n\t}", "@ApiModelProperty(value = \"Model lifeline start (milliseconds UTC)\")\n public Long getLifeStart() {\n return lifeStart;\n }", "public long getStart() {\n return start;\n }", "@Nullable\n public DpProp getStart() {\n if (mImpl.hasStart()) {\n return DpProp.fromProto(mImpl.getStart());\n } else {\n return null;\n }\n }", "public double getStartLon() {\n\t\treturn startLon;\n\t}", "@Override\n SubwayStation getStartLocation() {\n return this.startLocation;\n }", "org.landxml.schema.landXML11.Station xgetStaEnd();", "public long getComplementary_start() {\n return complementary_start;\n }", "public LocalTime getStart() {\n\treturn start;\n }", "@Override\n public LocalTime getStart() {\n return start;\n }", "public int getStarty(){\n\t\treturn starty;\n\t}", "public WorldCoordinate getBegin() {\r\n\t\treturn this.begin;\r\n\t}", "public String getEntrance() {\n\t\treturn entrance;\n\t}", "ActualStartType getActualStart();", "public org.apache.xmlbeans.XmlBoolean xgetNorth()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlBoolean target = null;\n target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(NORTH$0, 0);\n return target;\n }\n }", "public int getLattine() {\n\t\treturn nLattine;\n\t}", "public java.util.Date startSnap()\n\t{\n\t\treturn _dtBegin;\n\t}", "public double getStart();", "public float getDistanceToStart() {\n\t\treturn distanceToStart;\n\t}", "net.opengis.gml.x32.TimePositionType getEndPosition();", "public State getStart() {\n \t\treturn start;\n \t}", "public Node getStart(){\n return start;\n }", "public RefLimit getStartFrom() {\n\t\treturn startFrom;\n\t}", "public double getStartX() {\n\treturn v1.getX();\n }", "public String getStart(){\n\t\treturn mStart;\n\t}", "public E startState() {\r\n\t\treturn this.values[0];\r\n\t}", "public Point start() {\r\n return this.start;\r\n }", "public boolean hasStartTime() {\n return fieldSetFlags()[0];\n }", "public Point getStart() {\n\t\treturn _start;\n\t}", "public City getStartCity() {\n \treturn vertex1;\n }", "java.util.Calendar getLastrun();", "public double getDistanceToStart() {\r\n return startDistance;\r\n }", "public int getStart() {\r\n\t\treturn start;\r\n\t}", "public Date getCellLowerDeadline() {\r\n\t\treturn CellLowerDeadline;\r\n\t}", "public Point getStart() {\n return mStart;\n }", "public Date getStart() {\n return start;\n }", "public GregorianCalendar getTimePlaced() {\n return this.timePlaced;\n }", "public DTM getRxa4_DateTimeEndOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(4, 0);\r\n\t\treturn retVal;\r\n }", "MinmaxEntity getStart();", "public int getStart() {\r\n return start;\r\n }", "public double getStartX() {\r\n return startx;\r\n }", "public double getStartTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTTIME$22);\r\n if (target == null)\r\n {\r\n return 0.0;\r\n }\r\n return target.getDoubleValue();\r\n }\r\n }", "public Location getMeasureStop() {\n if(measureStart == null) {\n return currentLocation;\n } else {\n return measureStop;\n }\n }", "public int getStart ()\n {\n\n return this.start;\n\n }", "public double getStartY() {\n\treturn v1.getY();\n }", "org.apache.xmlbeans.XmlDateTime xgetLastrun();", "public int getStart() {\n return start;\n }", "public int getStart()\n {\n return start;\n }", "public int getStart() {\n\t\treturn start;\n\t}", "public org.landxml.schema.landXML11.GPSTime xgetStartTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.GPSTime target = null;\r\n target = (org.landxml.schema.landXML11.GPSTime)get_store().find_attribute_user(STARTTIME$22);\r\n return target;\r\n }\r\n }", "public TLifeTimeInSeconds getLifetimeLeft() {\n\n\t\treturn lifetimeLeft;\n\t}", "public String getStart(){\n\t\treturn start;\n\t}", "public RefLimit getStartFrom() {\n\t\t\treturn startFrom;\n\t\t}", "public int getStart() {\n return start;\n }", "public final int startOffset() {\n return startOffset;\n }", "public int getStart() {\n return this.start;\n }", "EarlyFinishType getEarlyFinish();", "public String getStart() {\n return start;\n }", "public double getStartLat() {\n\t\treturn startLat;\n\t}", "public double getStartX()\n {\n return startxcoord; \n }", "public Block returnStart() {\n\t\treturn start;\n\t}", "public InitialValElements getInitialValAccess() {\r\n\t\treturn pInitialVal;\r\n\t}", "public ImPoint getCurrentLoc() {\n \treturn this.startLoc;\n }", "public int getStart() {\n\t\t\treturn start;\n\t\t}", "public Point getStart(){\n\t\treturn bigstart;\n\t}", "public boolean isSetStartTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(STARTTIME$22) != null;\r\n }\r\n }", "public long getTimeStart()\n {\n return this.timeStart;\n }", "public Vector wristPosition() {\r\n\t\treturn new Vector(LeapJNI.Hand_wristPosition(this.swigCPtr, this), true);\r\n\t}", "public Duration getStartVariance()\r\n {\r\n return (m_startVariance);\r\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getStartTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(STARTTIME_PROP.get());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getStartTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(STARTTIME_PROP.get());\n }", "public Position getStartPosition() {\n return start;\n }", "public DTM getDateTimeEndOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(4, 0);\r\n\t\treturn retVal;\r\n }", "public String getStart() {\r\n\t\treturn this.start;\r\n\t}", "public int getStartx(){\n\t\treturn startx;\n\t}", "public int getStartStation() {\n\t\treturn startStation;\n\t}", "public GregorianCalendar getStart() {\n return _start;\n }" ]
[ "0.56020296", "0.55662924", "0.5564025", "0.55029094", "0.5478903", "0.54459167", "0.5444317", "0.53855556", "0.53054804", "0.5296094", "0.52524865", "0.52306426", "0.5226132", "0.522506", "0.52203035", "0.521773", "0.5203279", "0.520146", "0.5191536", "0.519134", "0.51871395", "0.5159112", "0.51410484", "0.51036465", "0.5088615", "0.5079801", "0.5078254", "0.5078221", "0.5072202", "0.5066211", "0.5064566", "0.50643057", "0.5051263", "0.50479555", "0.5037403", "0.5036285", "0.5029782", "0.5023633", "0.5001004", "0.4997201", "0.49776578", "0.4953304", "0.49400115", "0.49311757", "0.4928894", "0.49162734", "0.49153256", "0.49128318", "0.49087912", "0.49029404", "0.49026132", "0.49021316", "0.49014616", "0.4899052", "0.4898485", "0.48977894", "0.48977122", "0.4897581", "0.48958498", "0.48946917", "0.48902747", "0.4886443", "0.48830986", "0.48750538", "0.48715508", "0.48713392", "0.48707077", "0.4869709", "0.4868522", "0.48665982", "0.48638672", "0.48582157", "0.4857867", "0.48501328", "0.48372793", "0.48370236", "0.48322493", "0.48316306", "0.48185414", "0.48144588", "0.4809092", "0.48089117", "0.48032826", "0.47963563", "0.47950378", "0.47890484", "0.47802234", "0.4779533", "0.4774502", "0.47715405", "0.47700733", "0.4768477", "0.4768403", "0.4768403", "0.47683695", "0.47618243", "0.47595492", "0.47579864", "0.47547573", "0.47505596" ]
0.634849
0
Returns the value of the 'Schedule Start' containment reference. If the meaning of the 'Schedule Start' containment reference isn't clear, there really should be more of a description here...
ScheduleStartType getScheduleStart();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Schedule getSchedule() {\r\n\t\treturn schedule;\r\n\t}", "public ScheduleFrom getScheduleFrom()\r\n {\r\n return (m_scheduleFrom);\r\n }", "public Schedule getSchedule() {\n\n return schedule;\n }", "public SpaceSchedule getSchedule() {\n\t\treturn null;\n\t}", "public String getSchedule() {\n return schedule;\n }", "@ApiModelProperty(value = \"Schedule that this filter refers to. Output is a Schedule Summary Object. Input must be a Schedule Lookup Object. Required.\")\n public ScheduleSummary getSchedule() {\n return schedule;\n }", "public Timestamp getDateStartSchedule() {\n\t\treturn (Timestamp) get_Value(\"DateStartSchedule\");\n\t}", "private JNASchedule getFirstSchedule() {\n\t\tif (this.isDisposed()) {\n\t\t\tthrow new DominoException(0, \"Schedule collection has been disposed\");\n\t\t}\n\n\t\tDHANDLE hSchedules = getAllocations().getSchedulesHandle();\n\t\t\n\t\treturn LockUtil.lockHandle(hSchedules, (hSchedulesByVal) -> {\n\t\t\tIntByReference rethObj = new IntByReference();\n\t\t\tMemory schedulePtrMem = new Memory(Native.POINTER_SIZE);\n\n\t\t\tshort result = NotesCAPI.get().SchContainer_GetFirstSchedule(hSchedulesByVal, rethObj, schedulePtrMem);\n\t\t\tif (result == INotesErrorConstants.ERR_SCHOBJ_NOTEXIST) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tNotesErrorUtils.checkResult(result);\n\t\t\t\n\t\t\tif (rethObj.getValue()==0) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\tlong peer = schedulePtrMem.getLong(0);\n\t\t\tif (peer==0) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tPointer schedulePtr = new Pointer(peer);\n\t\t\tNotesScheduleStruct retpSchedule = NotesScheduleStruct.newInstance(schedulePtr);\n\t\t\tretpSchedule.read();\n\t\t\t\n\t\t\tint scheduleSize = JNANotesConstants.scheduleSize;\n\t\t\tif (PlatformUtils.isMac() && PlatformUtils.is64Bit()) {\n\t\t\t\t//on Mac/64, this structure is 4 byte aligned, other's are not\n\t\t\t\tint remainder = scheduleSize % 4;\n\t\t\t\tif (remainder > 0) {\n\t\t\t\t\tscheduleSize = 4 * (scheduleSize / 4) + 4;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tPointer pOwner = retpSchedule.getPointer().share(scheduleSize);\n\t\t\tString owner = NotesStringUtils.fromLMBCS(pOwner, (retpSchedule.wOwnerNameSize-1) & 0xffff);\n\t\t\t\n\t\t\treturn new JNASchedule(this, retpSchedule, owner, rethObj.getValue());\n\t\t});\n\t}", "public CanaryScheduleOutput getSchedule() {\n return this.schedule;\n }", "public Date getStart() {\n return start;\n }", "public String getPlacementRoadshowSchedule() {\n return placementRoadshowSchedule;\n }", "@Override\n public LocalTime getStart() {\n return start;\n }", "java.lang.String getSchedule();", "public FacultySchedule getSchedule() {\n\t\treturn schedule;\n\t}", "public String getScheduleExpression() {\n return this.scheduleExpression;\n }", "public LocalTime getStart() {\n\treturn start;\n }", "public Date getScheduleTime() {\n return this.scheduleTime;\n }", "public String getStart(){\n\t\treturn mStart;\n\t}", "public String getStart() {\r\n\t\treturn this.start;\r\n\t}", "public String getStart() {\n return start;\n }", "public boolean haveSchedule() {\r\n return haveSchedule;\r\n }", "public String getStart(){\n\t\treturn start;\n\t}", "public Date getScheduletime() {\r\n return scheduletime;\r\n }", "public ScheduleType getScheduleType();", "public GregorianCalendar getStart() {\n return _start;\n }", "public Coordinate getStart( )\n\t{\n\t\treturn startLocation;\n\t}", "public Position getStart() {\r\n return start;\r\n }", "public DateTime getStartDateTime() {\r\n\t\treturn start;\r\n\t}", "public Calendar getStartTime() {\r\n\t\treturn startTime;\r\n\t}", "java.util.Calendar getSearchRecurrenceStart();", "ScheduleFinishType getScheduleFinish();", "public String getScheduleRow() {\n\t\treturn uSRow;\n\t}", "public ReplicationSchedule replicationSchedule() {\n return this.replicationSchedule;\n }", "ActualStartType getActualStart();", "public Place getStartingPlace() {\n return startingPlace;\n }", "public M csseAddTimeStart(Object start){this.put(\"csseAddTimeStart\", start);return this;}", "public long getStart() {\n return start;\n }", "public String get_start() {\n\t\treturn start;\n\t}", "WeekdaySpec getStart();", "public Date getStart() {\n return (Date) _start.clone();\n }", "public Date getScheduleDate(){\r\n\t\treturn this.scheduleDate;\r\n\t}", "public io.opencannabis.schema.commerce.CommercialOrder.OrderScheduling getScheduling() {\n return scheduling_ == null ? io.opencannabis.schema.commerce.CommercialOrder.OrderScheduling.getDefaultInstance() : scheduling_;\n }", "public int getSchedulingValue() {\n return scheduling_;\n }", "public Date getActualStart()\r\n {\r\n return (m_actualStart);\r\n }", "public void setStart( Calendar start );", "public int getSchedulingValue() {\n return scheduling_;\n }", "public io.opencannabis.schema.commerce.CommercialOrder.SchedulingType getScheduling() {\n @SuppressWarnings(\"deprecation\")\n io.opencannabis.schema.commerce.CommercialOrder.SchedulingType result = io.opencannabis.schema.commerce.CommercialOrder.SchedulingType.valueOf(scheduling_);\n return result == null ? io.opencannabis.schema.commerce.CommercialOrder.SchedulingType.UNRECOGNIZED : result;\n }", "public io.opencannabis.schema.commerce.CommercialOrder.SchedulingType getScheduling() {\n @SuppressWarnings(\"deprecation\")\n io.opencannabis.schema.commerce.CommercialOrder.SchedulingType result = io.opencannabis.schema.commerce.CommercialOrder.SchedulingType.valueOf(scheduling_);\n return result == null ? io.opencannabis.schema.commerce.CommercialOrder.SchedulingType.UNRECOGNIZED : result;\n }", "org.apache.xmlbeans.XmlString xgetSchedule();", "public M csseStartStart(Object start){this.put(\"csseStartStart\", start);return this;}", "public IScheduleBCF getScheduleBCF()\r\n\t{\r\n\t\treturn scheduleBCF;\r\n\t}", "com.google.cloud.compute.v1.Scheduling getScheduling();", "public io.opencannabis.schema.commerce.CommercialOrder.OrderScheduling getScheduling() {\n if (schedulingBuilder_ == null) {\n return scheduling_ == null ? io.opencannabis.schema.commerce.CommercialOrder.OrderScheduling.getDefaultInstance() : scheduling_;\n } else {\n return schedulingBuilder_.getMessage();\n }\n }", "public Chamber getStart() {\n return start;\n }", "public Point getStart() {\n\t\treturn _start;\n\t}", "public void setSchedule(SpaceSchedule s) {\n\t\t\n\t}", "@Override\n SubwayStation getStartLocation() {\n return this.startLocation;\n }", "public Point getStart() {\n return mStart;\n }", "public State getStart() {\n \t\treturn start;\n \t}", "public M csmiAddTimeStart(Object start){this.put(\"csmiAddTimeStart\", start);return this;}", "public Date getDtStart() {\r\n return dtStart;\r\n }", "public boolean isScheduleSelected() {\r\n return scheduleSelected;\r\n }", "public Node getStart(){\n return start;\n }", "public LocalDateTime getShiftStartTime() {\n\t\treturn shiftStartTime; \n\t}", "@Nullable\n public DpProp getStart() {\n if (mImpl.hasStart()) {\n return DpProp.fromProto(mImpl.getStart());\n } else {\n return null;\n }\n }", "public void setSchedule(Schedule schedule) {\r\n\t\tthis.schedule = schedule;\r\n\t}", "public int getStart() {\n\t\treturn start;\n\t}", "public Point start() {\r\n return this.start;\r\n }", "public int getStart() {\n return this.start;\n }", "public int getStart() {\n\t\t\treturn start;\n\t\t}", "public java.lang.Long getStartTime() {\n return start_time;\n }", "public java.lang.Long getStartTime() {\n return start_time;\n }", "io.opencannabis.schema.commerce.CommercialOrder.SchedulingType getScheduling();", "public LocalTime getStartTime () {\n\t\treturn DateUtils.toLocalTime(this.start);\n\t}", "public Schedule getSchedule() {\n\n Schedule sched = new Schedule();\n\n if (m_startDate.getDate() != null) {\n sched.setStartDate(m_startDate.getDate());\n } else {\n return null; // execute unscheduled (right now)\n }\n if (m_endDate.getDate() != null) {\n sched.setEndDate(m_endDate.getDate());\n }\n\n m_repeat.applyToSchedule(sched);\n\n return sched;\n }", "public int getStart() {\r\n\t\treturn start;\r\n\t}", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getStartTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(STARTTIME_PROP.get());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getStartTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(STARTTIME_PROP.get());\n }", "public M csolAddTimeStart(Object start){this.put(\"csolAddTimeStart\", start);return this;}", "public double getStart() {\n return start;\n }", "public Date getStartWorkTime() {\n return startWorkTime;\n }", "public int getSchedule_id() {\r\n return schedule_id;\r\n }", "public Node getStartNode() {\n return startNode;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getStartTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(STARTTIME_PROP.get());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getStartTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(STARTTIME_PROP.get());\n }", "public java.util.Calendar getStartDate() {\n return startDate;\n }", "public void setScheduleFrom(ScheduleFrom scheduleFrom)\r\n {\r\n m_scheduleFrom = scheduleFrom;\r\n }", "io.opencannabis.schema.commerce.CommercialOrder.OrderScheduling getScheduling();", "public int getStartMinute() {\n\treturn start.getMinute();\n }", "public final DtStart getStartDate() {\n return getProperty(Property.DTSTART);\n }", "boolean isSetSchedule();", "public Block getStart () {\n\t\treturn start;\n\t}", "public java.lang.String getSchedule_date() {\r\n return schedule_date;\r\n }", "public ScheduleComponentType getScheduleComponentType() {\r\n return ScheduleComponentType.GUARD;\r\n }", "public int getStart() {\n return start;\n }", "public String getCentralCashAllocationSchedule() {\n return centralCashAllocationSchedule;\n }", "org.apache.xmlbeans.XmlDateTime xgetSearchRecurrenceStart();", "public M csseUpdateTimeStart(Object start){this.put(\"csseUpdateTimeStart\", start);return this;}", "public int getStart ()\n {\n\n return this.start;\n\n }", "public int getStart() {\n return start;\n }" ]
[ "0.6648999", "0.6548906", "0.64697593", "0.6465361", "0.6450555", "0.6291018", "0.6259888", "0.6180164", "0.6124564", "0.5995495", "0.59864885", "0.5984375", "0.5980512", "0.5946257", "0.5935271", "0.5915046", "0.58450776", "0.58333707", "0.58262634", "0.58187205", "0.5779613", "0.57303244", "0.5727043", "0.57093436", "0.57016355", "0.5700006", "0.566577", "0.5645229", "0.5643895", "0.56401056", "0.56372523", "0.5632168", "0.5626428", "0.56247485", "0.5601608", "0.55910814", "0.5574109", "0.5568288", "0.55629486", "0.55512106", "0.5549614", "0.5548121", "0.5546182", "0.5531844", "0.552798", "0.5527027", "0.551842", "0.55082434", "0.55032295", "0.55028677", "0.5494376", "0.54935956", "0.5487691", "0.5480604", "0.5469382", "0.5466464", "0.5462656", "0.54577714", "0.54540074", "0.5453365", "0.54514503", "0.54443675", "0.5443316", "0.5403504", "0.5399591", "0.5390736", "0.538719", "0.53869617", "0.5386178", "0.5380587", "0.5375989", "0.5364158", "0.53601396", "0.5359512", "0.5356632", "0.5352943", "0.5350524", "0.5350524", "0.53426516", "0.5338265", "0.53375936", "0.5325765", "0.5324249", "0.53238636", "0.53238636", "0.53198695", "0.5314104", "0.5311722", "0.53105766", "0.5308705", "0.5305507", "0.5303268", "0.5301938", "0.52983195", "0.5294191", "0.52907014", "0.52906895", "0.5284066", "0.5282813", "0.5282794" ]
0.7727378
0
Returns the value of the 'Actual Finish' containment reference. If the meaning of the 'Actual Finish' containment reference isn't clear, there really should be more of a description here...
ActualFinishType getActualFinish();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Date getActualFinish()\r\n {\r\n return (m_actualFinish);\r\n }", "public Duration getFinishVariance()\r\n {\r\n return (m_finishVariance);\r\n }", "Double getFinishFloat();", "public boolean getFinish(){\n\t\treturn finish;\n\t}", "public Integer getIsfinish() {\n return isfinish;\n }", "public java.lang.String getFinishCondition() {\n return finishCondition;\n }", "public double getEnd();", "public void setActualFinish(Date actualFinishDate)\r\n {\r\n m_actualFinish = actualFinishDate;\r\n }", "public double getEnd() {\n return end;\n }", "public double getFinishTime(){return finishTime;}", "public int getFinishMinute() {\n return finishMinute;\n }", "@Override\n\tpublic String getFinishTime() {\n\t\treturn finishTime;\n\t}", "@External\r\n\t@ClientFunc\r\n\tpublic MetaVar Finish();", "public OffsetDateTime finishTime() {\n return this.finishTime;\n }", "LateFinishType getLateFinish();", "public BidTime getFinishTime() {\r\n\t\treturn finishTime;\r\n\t}", "public WorldCoordinate getEnd() {\r\n\t\treturn this.end;\r\n\t}", "public Duration getActualWork()\r\n {\r\n return (m_actualWork);\r\n }", "public boolean getFinished() {\n\t\treturn finished;\n\t}", "public int getFinalMark() {\r\n return finalMark;\r\n }", "private Point getEnd() {\n if (goal == null) {\n if (target == null) {\n return null;\n }\n return target.getPosition();\n } else {\n return goal;\n }\n }", "public int getFinalMark()\n {\n return finalMark;\n }", "public E finishedState() {\r\n\t\treturn this.values[this.values.length - 1];\r\n\t}", "public boolean tileFinish(float xTile, float yTile)\r\n/* 166: */ {\r\n/* 167:189 */ return (tileInBounds(xTile, yTile)) && (this.finish[((int)xTile)][((int)yTile)] != 0);\r\n/* 168: */ }", "public long getExpectedEnd() {\n return this.expectedEnd;\n }", "public Integer getEndMark() {\n return endMark;\n }", "public final boolean isFinish() {\n return finish;\n }", "public final boolean isFinish() {\n return finish;\n }", "org.hl7.fhir.Integer getEnd();", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "ScheduleFinishType getScheduleFinish();", "public LocalDate getFinishLocalDate() {\n\t\treturn finishDate;\n\t}", "public boolean getFinished() {\n return finished;\n }", "net.opengis.gml.x32.TimePositionType getEndPosition();", "public String getFinishClor() {\n return (String)getAttributeInternal(FINISHCLOR);\n }", "public java.util.Date finishSnap()\n\t{\n\t\treturn _dtFinish;\n\t}", "public void setFinishTime(double finishTime)\n\t{\n\t\tthis.finishTime = finishTime;\n\t}", "public Coordinate getEnd( )\n\t{\n\t\treturn endLocation;\n\t}", "public T getLast(){\n\treturn _end.getCargo();\n }", "public boolean getFinished() {\n return finished_;\n }", "public long getComplementary_end() {\n return complementary_end;\n }", "public int getFinishHour() {\n return finishHour;\n }", "public Vector3f getEndPosition()\n {\n return endPosition;\n }", "public Date getBaselineFinish()\r\n {\r\n return (m_baselineFinish);\r\n }", "public boolean getFinished() {\n return finished_;\n }", "public java.util.Date getFinishedTime () {\r\n\t\treturn finishedTime;\r\n\t}", "public String getActual() {\n return actual;\n }", "public int getEndy(){\n\t\treturn endy;\n\t}", "net.opengis.gml.x32.TimeInstantPropertyType getEnd();", "String getDefiningEnd();", "public String getEnd(){\n\t\treturn end;\n\t}", "SolutionRef getEndSolution();", "public java.lang.Double getValorFinanciado() {\n return valorFinanciado;\n }", "public Coords getFinalCoords() {\n if (getLastStep() != null) {\n return getLastStep().getPosition();\n }\n return getEntity().getPosition();\n }", "public Date getFinishedAt() {\n\t\treturn finishedAt;\n\t}", "public int getEndx(){\n\t\treturn endx;\n\t}", "org.mojolang.mojo.lang.Position getEndPosition();", "public synchronized boolean getFinished(){\n return finished;\n }", "public int getEnd() {\r\n return end;\r\n }", "public Date getFinishDate()\r\n {\r\n Date result = m_finishDate;\r\n if (result == null)\r\n {\r\n result = getParentFile().getFinishDate();\r\n }\r\n return (result);\r\n }", "public String getEnd() {\n return end;\n }", "public Duration getActualDuration()\r\n {\r\n return (m_actualDuration);\r\n }", "public double getEndY()\n {\n return endycoord; \n }", "public void setFinishVariance(Duration finishVariance)\r\n {\r\n m_finishVariance = finishVariance;\r\n }", "public Float getxEnd() {\r\n return xEnd;\r\n }", "public boolean isFinished() {\r\n\t\treturn this.finished;\r\n\t}", "public Date getFinishDate() {\n if (this.finishDate == null) {\n return null;\n }\n return new Date(this.finishDate.getTime());\n }", "@Override\n public int getFinishLevel() {\n return finishLevel;\n }", "public boolean isActual() {\n return actual;\n }", "IShape getEndShape();", "public Rational getEndTime ()\r\n {\r\n if (isWholeDuration()) {\r\n return null;\r\n }\r\n\r\n Rational chordDur = getDuration();\r\n\r\n if (chordDur == null) {\r\n return null;\r\n } else {\r\n return startTime.plus(chordDur);\r\n }\r\n }", "public BigDecimal getActualPosition() {\n return actualPosition;\n }", "public boolean isFinished() {\r\n\t\t\treturn tIsFinished;\r\n\t\t}", "public Point getEndPosition() {\n return this.movementComposer.getTargetPosition();\n }", "public Point end() {\r\n return this.end;\r\n }", "public int getFin() {\r\n return fin;\r\n }", "public double getEndX() {\r\n return endx;\r\n }", "public int getEnd() {\n return this.end;\n }", "@Nullable\n public DpProp getEnd() {\n if (mImpl.hasEnd()) {\n return DpProp.fromProto(mImpl.getEnd());\n } else {\n return null;\n }\n }", "public void testGetEndValue3() {\n TaskSeriesCollection c = new TaskSeriesCollection();\n TaskSeries s = new TaskSeries(\"Series 1\");\n s.add(new Task(\"Task with null duration\", null));\n c.add(s);\n Number millis = c.getEndValue(\"Series 1\", \"Task with null duration\");\n }", "public int getEnd() {\r\n\t\treturn end;\r\n\t}", "public Vector2 getEndLoc( ) { return endLoc; }", "public int getEnd() {\n return end;\n }", "public boolean getFillAfter() {\n return mFillAfter;\n }", "public int getEnd()\n {\n return end;\n }", "public Float getEndMiles() {\n return endMiles;\n }", "public int getEnd() {\n\t\treturn end;\n\t}", "String getEnd();", "@Override\n public int getEnd() {\n return feature.getEnd();\n }", "public LastJSONFinishElements getLastJSONFinishAccess() {\r\n\t\treturn pLastJSONFinish;\r\n\t}", "double getStaEnd();", "public int getDone() {\n\t\treturn done;\n\t}", "public double getEndY() {\n\treturn v2.getY();\n }", "public boolean getEnd(){\n\t\treturn this.isEnd;\n\t}", "double getEndY();", "public boolean wasFinished()\n {\n return this.isFinished;\n }", "public Position getEndPosition() {\n return endPosition;\n }", "public int getQueryFinish()\n\t{\n\t\treturn myQueryFinish;\n\t}", "public String getDimensionName() {\n\t\treturn \"The End\";\n\t}" ]
[ "0.66379225", "0.58959985", "0.5893828", "0.5864712", "0.58127666", "0.5750253", "0.5721696", "0.5676608", "0.5667964", "0.5645524", "0.5635637", "0.5635342", "0.56024384", "0.5568491", "0.55538845", "0.5539275", "0.5536021", "0.55341274", "0.5475616", "0.54520386", "0.544728", "0.54056627", "0.540051", "0.53961104", "0.5363065", "0.5357266", "0.5350328", "0.5324262", "0.53231794", "0.5314347", "0.5308825", "0.5304287", "0.53041345", "0.5297597", "0.527884", "0.5266837", "0.5264636", "0.52634144", "0.52554995", "0.52554536", "0.52300423", "0.5228625", "0.5218449", "0.5213235", "0.52123255", "0.5206604", "0.5206119", "0.5192651", "0.5174605", "0.5159896", "0.5154223", "0.5142816", "0.5110693", "0.5100978", "0.50878954", "0.508205", "0.50805", "0.5075004", "0.50517404", "0.50447583", "0.5036682", "0.5033251", "0.50332326", "0.50320095", "0.5030931", "0.50301105", "0.50287557", "0.50236225", "0.5013435", "0.50125885", "0.5004211", "0.4997411", "0.4997161", "0.4996709", "0.49936116", "0.4992099", "0.49906397", "0.49894875", "0.49852094", "0.49824983", "0.49812013", "0.4979907", "0.4973346", "0.49668247", "0.4964968", "0.49586958", "0.4953877", "0.4944701", "0.4929715", "0.49140257", "0.491078", "0.49070296", "0.49007323", "0.4899291", "0.4894181", "0.48920912", "0.48874292", "0.4887077", "0.48850608", "0.48827517" ]
0.68972415
0
Returns the value of the 'Early Finish' containment reference. If the meaning of the 'Early Finish' containment reference isn't clear, there really should be more of a description here...
EarlyFinishType getEarlyFinish();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LateFinishType getLateFinish();", "public Integer getIsfinish() {\n return isfinish;\n }", "public E finishedState() {\r\n\t\treturn this.values[this.values.length - 1];\r\n\t}", "public Date getActualFinish()\r\n {\r\n return (m_actualFinish);\r\n }", "public LocalDate getFinishLocalDate() {\n\t\treturn finishDate;\n\t}", "public boolean getFinish(){\n\t\treturn finish;\n\t}", "String getDefiningEnd();", "public boolean getFillAfter() {\n return mFillAfter;\n }", "public Date getBaselineFinish()\r\n {\r\n return (m_baselineFinish);\r\n }", "public DTM getRxa4_DateTimeEndOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(4, 0);\r\n\t\treturn retVal;\r\n }", "public Duration getFinishVariance()\r\n {\r\n return (m_finishVariance);\r\n }", "public Chamber getEnd() {\n return end;\n }", "public int getFullfillment() {\r\n return fullfillment;\r\n }", "public java.lang.String getFinishCondition() {\n return finishCondition;\n }", "public Integer getEndMark() {\n return endMark;\n }", "public DTM getDateTimeEndOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(4, 0);\r\n\t\treturn retVal;\r\n }", "org.hl7.fhir.Integer getEnd();", "ActualFinishType getActualFinish();", "public WorldCoordinate getEnd() {\r\n\t\treturn this.end;\r\n\t}", "ScheduleFinishType getScheduleFinish();", "EarlyStartType getEarlyStart();", "net.opengis.gml.x32.TimePositionType getEndPosition();", "public String getEntrance() {\n\t\treturn entrance;\n\t}", "public int getEndy(){\n\t\treturn endy;\n\t}", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "public int getFinalMark() {\r\n return finalMark;\r\n }", "public java.util.Date finishSnap()\n\t{\n\t\treturn _dtFinish;\n\t}", "public int getFinalMark()\n {\n return finalMark;\n }", "public Date getFinishDate()\r\n {\r\n Date result = m_finishDate;\r\n if (result == null)\r\n {\r\n result = getParentFile().getFinishDate();\r\n }\r\n return (result);\r\n }", "net.opengis.gml.x32.TimeInstantPropertyType getEnd();", "public int getEndX() {\r\n\t\treturn endX;\r\n\t}", "public Location getEntrance() {\n\t\treturn entrance;\n\t}", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "public OffsetDateTime finishTime() {\n return this.finishTime;\n }", "public static Value makeAbsent() {\n return theAbsent;\n }", "public double getEnd() {\n return end;\n }", "public double getEnd();", "public BidTime getFinishTime() {\r\n\t\treturn finishTime;\r\n\t}", "public Date get_end() {\n\t\treturn this.end;\n\t}", "public double getDayAbsent() {\n return dayAbsent;\n }", "@Override\r\n\tpublic E getLast() {\n\t\treturn null;\r\n\t}", "public E last() {\n if(isEmpty()){\n return null;\n }else{\n return trailer.getPrev().getElement();\n }\n }", "public int getFinishHour() {\n return finishHour;\n }", "public Date getGmtFinish() {\n return gmtFinish;\n }", "@Override\n public int getEnd() {\n return feature.getEnd();\n }", "public String getResearchbegindate() {\r\n\t\treturn researchbegindate;\r\n\t}", "public T getLast(){\n\treturn _end.getCargo();\n }", "public Date getCellUpperDeadline() {\r\n\t\treturn CellUpperDeadline;\r\n\t}", "public long getComplementary_end() {\n return complementary_end;\n }", "@Override\n\tpublic String getFinishTime() {\n\t\treturn finishTime;\n\t}", "public FirstJSONFinishElements getFirstJSONFinishAccess() {\r\n\t\treturn pFirstJSONFinish;\r\n\t}", "public int getEndY() {\r\n\t\treturn endY;\r\n\t}", "public boolean isCurrentLevelFinish() {\n return currentLevelFinish;\n }", "public BigDecimal getEARLY_SETTLED_AMOUNT() {\r\n return EARLY_SETTLED_AMOUNT;\r\n }", "@XmlElement(\"InitialGap\")\n Expression getInitialGap();", "public boolean getMoveCompletedEndsBack()\r\n {\r\n return (m_moveCompletedEndsBack);\r\n }", "public double getDayLate() {\n return dayLate;\n }", "public Date getEarliestFinishingDate();", "public M csseFinishNull(){if(this.get(\"csseFinishNot\")==null)this.put(\"csseFinishNot\", \"\");this.put(\"csseFinish\", null);return this;}", "@Override\n\tpublic Calendar getFinishDate() {\n\t\treturn Calendar.getInstance();\n\t}", "public ElementStub getEndOneElement()\n {\n return endOneElement;\n }", "public com.cdoframework.cdolib.database.xsd.Then getThen() {\n return this.then;\n }", "public boolean getEnd(){\n\t\treturn this.isEnd;\n\t}", "public int getEndx(){\n\t\treturn endx;\n\t}", "org.landxml.schema.landXML11.Station xgetStaEnd();", "public int getEndingYear()\n {\n return -1;\n }", "protected boolean isFinished() {\n \tif (Robot.clawElevator.getContainerHeight() == 0) {\n \t\treturn Robot.clawElevator.getLowerSwitch();\n \t} else {\n \t\treturn Robot.clawElevator.getLowerSwitch() || Robot.clawElevator.isAtIntemediateStop(Math.abs(Robot.clawElevator.getContainerHeight() - 3), false);\n \t}\n }", "public double getEndX() {\r\n return endx;\r\n }", "public boolean getFinished() {\n\t\treturn finished;\n\t}", "public LastJSONFinishElements getLastJSONFinishAccess() {\r\n\t\treturn pLastJSONFinish;\r\n\t}", "public Employe findLastHired() {\n\t\treturn null;\n\t}", "public Integer getEndSoc() {\n return endSoc;\n }", "boolean isFinished() {\n return includedInLastStep() && (end == elementList.size() - 1);\n }", "public boolean getEnd()\n\t{\n\t\treturn getBooleanIOValue(\"End\", true);\n\t}", "public String getMiddleInitial() {\r\n return middleInitial;\r\n }", "public double getFirstExtreme(){\r\n return firstExtreme;\r\n }", "public double getFinishTime(){return finishTime;}", "public E getLast(){\n return tail.getPrevious().getElement();\n }", "public String getMiddleInitial(){\r\n\t\treturn middleInitial;\r\n\t}", "public Coordinate getEnd( )\n\t{\n\t\treturn endLocation;\n\t}", "public M csmiBirthdayEnd(Object end){this.put(\"csmiBirthdayEnd\", end);return this;}", "public int getEndMonth()\n\t{\n\t\treturn this.mEndMonth;\n\t}", "public final boolean isFinish() {\n return finish;\n }", "public String getEnd(){\n\t\treturn end;\n\t}", "public long getExpectedEnd() {\n return this.expectedEnd;\n }", "public String getStateMeridianEnd() {\n return stateMeridianEndButton.getText();\n }", "public boolean getEnd() {\n return end_;\n }", "WeekdaySpec getEnd();", "public NodoB getAnterior() {\r\n\t\treturn anterior;\r\n\t}", "public Date getFinishDate() {\n if (this.finishDate == null) {\n return null;\n }\n return new Date(this.finishDate.getTime());\n }", "public final boolean isFinish() {\n return finish;\n }", "@External\r\n\t@ClientFunc\r\n\tpublic MetaVar Finish();", "public Float getxEnd() {\r\n return xEnd;\r\n }", "public String getResearchenddate() {\r\n\t\treturn researchenddate;\r\n\t}", "public Date getFinishedAt() {\n\t\treturn finishedAt;\n\t}", "SolutionRef getEndSolution();", "public static boolean isFinishedCity()\r\n {\r\n try\r\n {\r\n Building b = astApp.getBuildings().get( astApp.getBuildings().size() - 1 );\r\n \r\n if( b.getBuilding().getXLocation() + b.getBuilding().getWidth() >= 700 )\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n catch( ArrayIndexOutOfBoundsException e )\r\n {\r\n return false;\r\n }\r\n }", "public String getAfterValue() {\n return afterValue;\n }", "public double getFinalExam()\n\t{\n\t\treturn this.finalExam;\n\t}", "public Boolean isEndOfMonth() {\n return _endOfMonth;\n }" ]
[ "0.5922294", "0.5491455", "0.54749733", "0.5227593", "0.517418", "0.5156029", "0.5104728", "0.5073053", "0.5071508", "0.50606716", "0.5023606", "0.5003226", "0.49957752", "0.49681327", "0.4953276", "0.4927786", "0.49183995", "0.4915782", "0.48966926", "0.48815912", "0.48504215", "0.48482922", "0.4845619", "0.4844158", "0.48395365", "0.48354498", "0.4825706", "0.48059788", "0.48036656", "0.47957006", "0.47947642", "0.4772671", "0.47650173", "0.47620553", "0.47451794", "0.47417498", "0.4739914", "0.4732893", "0.47297192", "0.4727935", "0.471825", "0.4702445", "0.46914512", "0.4691245", "0.46871987", "0.46821672", "0.46778083", "0.4673237", "0.46629006", "0.46563852", "0.46487167", "0.46400824", "0.46300873", "0.46286488", "0.462455", "0.46233577", "0.46184075", "0.4608125", "0.46063018", "0.46047193", "0.45970112", "0.4592885", "0.45914736", "0.4591133", "0.45876783", "0.45715255", "0.456171", "0.45603102", "0.45551297", "0.45551017", "0.45494908", "0.45403028", "0.4530238", "0.45243895", "0.4523179", "0.45159173", "0.45131534", "0.45013386", "0.4501289", "0.4499398", "0.44967777", "0.44946572", "0.4494318", "0.44939476", "0.44928136", "0.44874123", "0.44861776", "0.44857663", "0.44834888", "0.44818467", "0.44804186", "0.4479919", "0.44776547", "0.44666928", "0.44645444", "0.44594818", "0.44568077", "0.44475368", "0.443689", "0.44314742" ]
0.66862386
0
Returns the value of the 'Late Finish' containment reference. If the meaning of the 'Late Finish' containment reference isn't clear, there really should be more of a description here...
LateFinishType getLateFinish();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Integer getIsfinish() {\n return isfinish;\n }", "public Date getActualFinish()\r\n {\r\n return (m_actualFinish);\r\n }", "public boolean getFinish(){\n\t\treturn finish;\n\t}", "ActualFinishType getActualFinish();", "EarlyFinishType getEarlyFinish();", "public BidTime getFinishTime() {\r\n\t\treturn finishTime;\r\n\t}", "public Duration getFinishVariance()\r\n {\r\n return (m_finishVariance);\r\n }", "public E finishedState() {\r\n\t\treturn this.values[this.values.length - 1];\r\n\t}", "public boolean getFillAfter() {\n return mFillAfter;\n }", "public LocalDate getFinishLocalDate() {\n\t\treturn finishDate;\n\t}", "@Override\n\tpublic String getFinishTime() {\n\t\treturn finishTime;\n\t}", "public OffsetDateTime finishTime() {\n return this.finishTime;\n }", "ScheduleFinishType getScheduleFinish();", "public java.util.Date finishSnap()\n\t{\n\t\treturn _dtFinish;\n\t}", "net.opengis.gml.x32.TimePositionType getEndPosition();", "public DTM getRxa4_DateTimeEndOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(4, 0);\r\n\t\treturn retVal;\r\n }", "@External\r\n\t@ClientFunc\r\n\tpublic MetaVar Finish();", "public java.lang.String getFinishCondition() {\n return finishCondition;\n }", "net.opengis.gml.x32.TimeInstantPropertyType getEnd();", "public void setFinishTime(double finishTime)\n\t{\n\t\tthis.finishTime = finishTime;\n\t}", "public WorldCoordinate getEnd() {\r\n\t\treturn this.end;\r\n\t}", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "public final boolean isFinish() {\n return finish;\n }", "public double getFinishTime(){return finishTime;}", "public boolean isCurrentLevelFinish() {\n return currentLevelFinish;\n }", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "public DTM getDateTimeEndOfAdministration() { \r\n\t\tDTM retVal = this.getTypedField(4, 0);\r\n\t\treturn retVal;\r\n }", "public final boolean isFinish() {\n return finish;\n }", "public T getLast(){\n\treturn _end.getCargo();\n }", "public Date getFinishDate()\r\n {\r\n Date result = m_finishDate;\r\n if (result == null)\r\n {\r\n result = getParentFile().getFinishDate();\r\n }\r\n return (result);\r\n }", "public boolean getFinished() {\n\t\treturn finished;\n\t}", "public int getFinishHour() {\n return finishHour;\n }", "public boolean tileFinish(float xTile, float yTile)\r\n/* 166: */ {\r\n/* 167:189 */ return (tileInBounds(xTile, yTile)) && (this.finish[((int)xTile)][((int)yTile)] != 0);\r\n/* 168: */ }", "public LastJSONFinishElements getLastJSONFinishAccess() {\r\n\t\treturn pLastJSONFinish;\r\n\t}", "public Rational getEndTime ()\r\n {\r\n if (isWholeDuration()) {\r\n return null;\r\n }\r\n\r\n Rational chordDur = getDuration();\r\n\r\n if (chordDur == null) {\r\n return null;\r\n } else {\r\n return startTime.plus(chordDur);\r\n }\r\n }", "public int getEndy(){\n\t\treturn endy;\n\t}", "public static boolean isFinishedCity()\r\n {\r\n try\r\n {\r\n Building b = astApp.getBuildings().get( astApp.getBuildings().size() - 1 );\r\n \r\n if( b.getBuilding().getXLocation() + b.getBuilding().getWidth() >= 700 )\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n catch( ArrayIndexOutOfBoundsException e )\r\n {\r\n return false;\r\n }\r\n }", "public Chamber getEnd() {\n return end;\n }", "public Date getFinishDate() {\n if (this.finishDate == null) {\n return null;\n }\n return new Date(this.finishDate.getTime());\n }", "public Date getFinishedAt() {\n\t\treturn finishedAt;\n\t}", "public java.util.Date getFinishedTime () {\r\n\t\treturn finishedTime;\r\n\t}", "public int getFinishMinute() {\n return finishMinute;\n }", "public double getDayLate() {\n return dayLate;\n }", "public long getComplementary_end() {\n return complementary_end;\n }", "public Date getGmtFinish() {\n return gmtFinish;\n }", "public boolean isFinished() {\n\t\t// the word is guessed out only when the unrevealedSlots is 0\n\t\tif (this.unrevealedSlots == 0) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean getFinished() {\n return finished;\n }", "public int getFinalMark() {\r\n return finalMark;\r\n }", "public E last() {\n if(isEmpty()){\n return null;\n }else{\n return trailer.getPrev().getElement();\n }\n }", "String getDefiningEnd();", "public boolean isSetAfter() {\n return this.after != null;\n }", "public int getFullfillment() {\r\n return fullfillment;\r\n }", "SolutionRef getEndSolution();", "protected boolean isFinished() {\n \tif (Robot.clawElevator.getContainerHeight() == 0) {\n \t\treturn Robot.clawElevator.getLowerSwitch();\n \t} else {\n \t\treturn Robot.clawElevator.getLowerSwitch() || Robot.clawElevator.isAtIntemediateStop(Math.abs(Robot.clawElevator.getContainerHeight() - 3), false);\n \t}\n }", "public void setActualFinish(Date actualFinishDate)\r\n {\r\n m_actualFinish = actualFinishDate;\r\n }", "public int getFinalMark()\n {\n return finalMark;\n }", "Double getFinishFloat();", "public boolean getMoveCompletedEndsBack()\r\n {\r\n return (m_moveCompletedEndsBack);\r\n }", "public LocalTime getEnd() {\n\treturn end;\n }", "public boolean getFinished() {\n return finished_;\n }", "public FirstJSONFinishElements getFirstJSONFinishAccess() {\r\n\t\treturn pFirstJSONFinish;\r\n\t}", "public Coordinate getEnd( )\n\t{\n\t\treturn endLocation;\n\t}", "public Measure<?, ?> getUpperMeasure() {\n return this.upperMeasure;\n }", "public Optional<Instant> getAfter() {\n\t\treturn after;\n\t}", "public boolean getFinished() {\n return finished_;\n }", "@Override\n\tpublic Calendar getFinishDate() {\n\t\treturn Calendar.getInstance();\n\t}", "public int getEndMonth()\n\t{\n\t\treturn this.mEndMonth;\n\t}", "public Optional<Instant> getAfter() {\n\t\t\treturn after;\n\t\t}", "public Direction getExit(){\n\t\t\treturn exit;\n\t\t}", "public Integer getEndMark() {\n return endMark;\n }", "org.hl7.fhir.Integer getEnd();", "public Date getBaselineFinish()\r\n {\r\n return (m_baselineFinish);\r\n }", "public double getEnd() {\n return end;\n }", "public boolean hasCompleted() {\n return this.tail.value != null && NotificationLite.isComplete(leaveTransform(this.tail.value));\n }", "public Date getAfterCt() {\r\n return afterCt;\r\n }", "public Guard isFinishedExecution() {\n if (depth == PSymGlobal.getConfiguration().getMaxStepBound()) {\n return Guard.constTrue();\n } else {\n return allMachinesHalted;\n }\n }", "public boolean hasEndTime() {\n return fieldSetFlags()[1];\n }", "public boolean isFinished() {\r\n\t\t\treturn tIsFinished;\r\n\t\t}", "public double getEnd();", "public boolean isFinishing() {\n return isFinishing;\n }", "public Integer getAfterMission() {\r\n return afterMission;\r\n }", "@Override\n public int getFinishLevel() {\n return finishLevel;\n }", "org.landxml.schema.landXML11.Station xgetStaEnd();", "public Location getEndLocation() {\n return gameLocations.get(GameLocation.END);\n }", "public boolean getEnd(){\n\t\treturn this.isEnd;\n\t}", "public Grid getExit(){\n\t\treturn getpos((byte)3);\n\t}", "@Override\r\n\tpublic E getLast() {\n\t\treturn null;\r\n\t}", "public int getQueryFinish()\n\t{\n\t\treturn myQueryFinish;\n\t}", "public boolean isFinished() {\r\n\t\treturn this.finished;\r\n\t}", "public Vector3f getEndPosition()\n {\n return endPosition;\n }", "public int getEndY() {\r\n\t\treturn endY;\r\n\t}", "private Point getEnd() {\n if (goal == null) {\n if (target == null) {\n return null;\n }\n return target.getPosition();\n } else {\n return goal;\n }\n }", "public City getEndCity() {\n \treturn vertex2;\n }", "public Date getCellUpperDeadline() {\r\n\t\treturn CellUpperDeadline;\r\n\t}", "public M csseFinishNull(){if(this.get(\"csseFinishNot\")==null)this.put(\"csseFinishNot\", \"\");this.put(\"csseFinish\", null);return this;}", "public Date get_end() {\n\t\treturn this.end;\n\t}", "public E last() {\n\r\n if(tail == null) {\r\n return null;\r\n } else {\r\n return tail.getItem();\r\n\r\n }\r\n }", "public static Value makeAbsent() {\n return theAbsent;\n }", "protected double getReferenceY() {\n if (isYAxisBoundsManual() && !mGraphView.getGridLabelRenderer().isHumanRoundingY()) {\n if (Double.isNaN(referenceY)) {\n referenceY = getMinY(false);\n }\n return referenceY;\n } else {\n // starting from 0 so that the steps have nice numbers\n return 0;\n }\n }", "public synchronized boolean getFinished(){\n return finished;\n }" ]
[ "0.5796624", "0.57152283", "0.5646151", "0.5638569", "0.5613752", "0.55289084", "0.551011", "0.5506916", "0.5420865", "0.5343821", "0.5313847", "0.5301591", "0.5285527", "0.5255526", "0.5234418", "0.52270854", "0.5175905", "0.515584", "0.515237", "0.51308095", "0.51145464", "0.5108873", "0.5097293", "0.5095253", "0.5087062", "0.5081961", "0.50814086", "0.5078805", "0.50675243", "0.50354487", "0.50204265", "0.5013962", "0.49954435", "0.4975085", "0.49380773", "0.4910161", "0.49039897", "0.4902111", "0.48871696", "0.4881234", "0.48784652", "0.487468", "0.48708767", "0.48610485", "0.4855179", "0.48409218", "0.48357186", "0.48265225", "0.48165262", "0.48050103", "0.480151", "0.47990742", "0.4794483", "0.47898194", "0.47892326", "0.47802904", "0.47769564", "0.47713622", "0.47683784", "0.4765673", "0.4765245", "0.47644332", "0.47572818", "0.47571424", "0.47522908", "0.47497332", "0.47473544", "0.47273844", "0.4726878", "0.4708847", "0.47061965", "0.47059542", "0.4678424", "0.46724063", "0.46716797", "0.46668786", "0.4665042", "0.46643868", "0.46640265", "0.46629095", "0.46495596", "0.46452343", "0.46434623", "0.46304587", "0.461735", "0.46168688", "0.46115056", "0.46100616", "0.46052307", "0.46022913", "0.4599924", "0.4592182", "0.45920992", "0.45907748", "0.45904815", "0.4588633", "0.45698473", "0.45682567", "0.45647532", "0.45557943" ]
0.67283934
0
Returns the value of the 'Schedule Finish' containment reference. If the meaning of the 'Schedule Finish' containment reference isn't clear, there really should be more of a description here...
ScheduleFinishType getScheduleFinish();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String getFinishTime() {\n\t\treturn finishTime;\n\t}", "ActualFinishType getActualFinish();", "public Timestamp getDateFinishSchedule() {\n\t\treturn (Timestamp) get_Value(\"DateFinishSchedule\");\n\t}", "public LocalDate getFinishLocalDate() {\n\t\treturn finishDate;\n\t}", "public Date getActualFinish()\r\n {\r\n return (m_actualFinish);\r\n }", "public BidTime getFinishTime() {\r\n\t\treturn finishTime;\r\n\t}", "public boolean isCompleteSchedule() {\n if (this.getScheduledTask() != null) {\n return this.getScheduledTask().getNode().getId().equals(\"end\");\n } else return false;\n }", "public OffsetDateTime finishTime() {\n return this.finishTime;\n }", "public java.lang.String getFinishCondition() {\n return finishCondition;\n }", "public int getFinishMinute() {\n return finishMinute;\n }", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "public boolean getFinish(){\n\t\treturn finish;\n\t}", "public int getFinishHour() {\n return finishHour;\n }", "public Integer getIsfinish() {\n return isfinish;\n }", "public SpaceSchedule getSchedule() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Calendar getFinishDate() {\n\t\treturn Calendar.getInstance();\n\t}", "public CanaryScheduleOutput getSchedule() {\n return this.schedule;\n }", "public Schedule getSchedule() {\r\n\t\treturn schedule;\r\n\t}", "public Rational getEndTime ()\r\n {\r\n if (isWholeDuration()) {\r\n return null;\r\n }\r\n\r\n Rational chordDur = getDuration();\r\n\r\n if (chordDur == null) {\r\n return null;\r\n } else {\r\n return startTime.plus(chordDur);\r\n }\r\n }", "public LocalTime getEnd() {\n\treturn end;\n }", "public FacultySchedule getSchedule() {\n\t\treturn schedule;\n\t}", "public String getSchedule() {\n return schedule;\n }", "java.lang.String getSchedule();", "net.opengis.gml.x32.TimeInstantPropertyType getEnd();", "public String getCentralCashAllocationSchedule() {\n return centralCashAllocationSchedule;\n }", "@Override\n\tpublic void setFinishDate(Calendar finishDate) {\n\n\t}", "public Schedule getSchedule() {\n\n return schedule;\n }", "net.opengis.gml.x32.TimePositionType getEndPosition();", "public double getFinishTime(){return finishTime;}", "@ApiModelProperty(value = \"Schedule that this filter refers to. Output is a Schedule Summary Object. Input must be a Schedule Lookup Object. Required.\")\n public ScheduleSummary getSchedule() {\n return schedule;\n }", "public Date getFinishDate() {\n if (this.finishDate == null) {\n return null;\n }\n return new Date(this.finishDate.getTime());\n }", "public Date getGmtFinish() {\n return gmtFinish;\n }", "public java.util.Date finishSnap()\n\t{\n\t\treturn _dtFinish;\n\t}", "public Date get_end() {\n\t\treturn this.end;\n\t}", "public TimeZoneDefinition getEndTimeZone() throws ServiceLocalException {\n\t\treturn (TimeZoneDefinition) this.getPropertyBag()\n\t\t\t\t.getObjectFromPropertyDefinition(AppointmentSchema.EndTimeZone);\n\t}", "public LocalTime getEndTime () {\n\t\treturn DateUtils.toLocalTime(this.end);\n\t}", "public WorldCoordinate getEnd() {\r\n\t\treturn this.end;\r\n\t}", "public void setFinishTime(double finishTime)\n\t{\n\t\tthis.finishTime = finishTime;\n\t}", "public CompletedToDoTask finish() {\n\t\treturn new CompletedToDoTask(this);\n\t}", "public int getEndMinute() {\n\treturn end.getMinute();\n }", "public boolean haveSchedule() {\r\n return haveSchedule;\r\n }", "public java.util.Date getFinishedTime () {\r\n\t\treturn finishedTime;\r\n\t}", "public final boolean isFinish() {\n return finish;\n }", "public final boolean isFinish() {\n return finish;\n }", "Double getScheduleDuration();", "public java.lang.String getEndDay() {\r\n return localEndDay;\r\n }", "public Temporal getEndRecurrence() { return endRecurrence; }", "public Calendar getEndTime() {\r\n\t\treturn endTime;\r\n\t}", "LateFinishType getLateFinish();", "public M csmiAddTimeEnd(Object end){this.put(\"csmiAddTimeEnd\", end);return this;}", "public LinkedBlockingQueue<Run> getFinishQueue() {\n\t\treturn new LinkedBlockingQueue<Run>(finishQueue);\n\t}", "public Date getFinishDate()\r\n {\r\n Date result = m_finishDate;\r\n if (result == null)\r\n {\r\n result = getParentFile().getFinishDate();\r\n }\r\n return (result);\r\n }", "WeekdaySpec getEnd();", "public io.opencannabis.schema.commerce.CommercialOrder.SchedulingType getScheduling() {\n @SuppressWarnings(\"deprecation\")\n io.opencannabis.schema.commerce.CommercialOrder.SchedulingType result = io.opencannabis.schema.commerce.CommercialOrder.SchedulingType.valueOf(scheduling_);\n return result == null ? io.opencannabis.schema.commerce.CommercialOrder.SchedulingType.UNRECOGNIZED : result;\n }", "public io.opencannabis.schema.commerce.CommercialOrder.SchedulingType getScheduling() {\n @SuppressWarnings(\"deprecation\")\n io.opencannabis.schema.commerce.CommercialOrder.SchedulingType result = io.opencannabis.schema.commerce.CommercialOrder.SchedulingType.valueOf(scheduling_);\n return result == null ? io.opencannabis.schema.commerce.CommercialOrder.SchedulingType.UNRECOGNIZED : result;\n }", "public M csseFinishNull(){if(this.get(\"csseFinishNot\")==null)this.put(\"csseFinishNot\", \"\");this.put(\"csseFinish\", null);return this;}", "ScheduleStartType getScheduleStart();", "public void setActualFinish(Date actualFinishDate)\r\n {\r\n m_actualFinish = actualFinishDate;\r\n }", "public Duration getFinishVariance()\r\n {\r\n return (m_finishVariance);\r\n }", "public boolean getFinished() {\n\t\treturn finished;\n\t}", "public Date getjEndtime() {\n return jEndtime;\n }", "public Date getFinishedAt() {\n\t\treturn finishedAt;\n\t}", "public int getSubjectFinish()\n\t{\n\t\treturn mySubjectFinish;\n\t}", "public Chamber getEnd() {\n return end;\n }", "public M csseFinishEnd(Object end){this.put(\"csseFinishEnd\", end);return this;}", "public java.lang.String getTime_end() {\r\n return time_end;\r\n }", "public String getEnd(){\n\t\treturn end;\n\t}", "public PayoutScheduleEnum getPayoutSchedule() {\n return payoutSchedule;\n }", "public int getEndTime()\n {\n if (isRepeated()) return end;\n else return time;\n }", "public String getEndtime() {\n return endtime;\n }", "public LocalDateTime getEndTime() {\n\t\treturn endTime;\n\t}", "public String getScheduleExpression() {\n return this.scheduleExpression;\n }", "public Duration getActualWork()\r\n {\r\n return (m_actualWork);\r\n }", "public Optional<Instant> getAfter() {\n\t\t\treturn after;\n\t\t}", "public Coordinate getEnd( )\n\t{\n\t\treturn endLocation;\n\t}", "public Duration getWork()\r\n {\r\n return (m_work);\r\n }", "public String getHourActualEnd() {\n return hourEndInput.getAttribute(\"value\");\n }", "public String getPlacementRoadshowSchedule() {\n return placementRoadshowSchedule;\n }", "public Optional<Instant> getAfter() {\n\t\treturn after;\n\t}", "public E finishedState() {\r\n\t\treturn this.values[this.values.length - 1];\r\n\t}", "public String getEnd() {\n return end;\n }", "public Type removeEnd(){\n Type value = null;\n if( !this.isEmpty() ){\n value = this.end.value;\n if(this.start == this.end){\n this.start = this.end = null;\n }else{\n this.end = this.end.prev;\n this.end.next = null;\n }\n }\n this.size--;\n return value;\n }", "public Integer getEndMark() {\n return endMark;\n }", "@javax.jdo.annotations.Column(allowsNull = \"false\")\n\t@MemberOrder(sequence = \"4\")\n\tpublic Date getFechaFin() {\n\t\treturn this.fechaFin;\n\t}", "public M csseAddTimeEnd(Object end){this.put(\"csseAddTimeEnd\", end);return this;}", "@Test\n public void getterDepartureTime(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(\"9:00AM\",entry.getDepartureTime());\n }", "public java.util.Calendar getEndExecDate()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ENDEXECDATE$10, 0);\n if (target == null)\n {\n return null;\n }\n return target.getCalendarValue();\n }\n }", "public Date getEndtime() {\n return endtime;\n }", "public int getEndMilitaryHour() {\n return this.endMilitaryHour;\n }", "public boolean getEnd(){\n\t\treturn this.isEnd;\n\t}", "@Nullable\n public DpProp getEnd() {\n if (mImpl.hasEnd()) {\n return DpProp.fromProto(mImpl.getEnd());\n } else {\n return null;\n }\n }", "Instant getEnd();", "public boolean getFinished() {\n return finished;\n }", "public java.util.Date getEndTime() {\n return endTime;\n }", "public Date getEndTime() {\n\t\treturn endTime;\n\t}", "@Override\n SubwayStation getEndLocation() {\n return this.endLocation;\n }", "public void setFinishDate(Date finishDate)\r\n {\r\n m_finishDate = finishDate;\r\n }", "public SlidingPuzzle<T> end() {\n\t\tcheckForStarted();\n\t\tthis.started = Boolean.FALSE;\n\t\tthis.board = null;\n\t\tthis.goal = null;\n\t\tthis.queue = null;\n\t\tthis.closed = null;\n\t\treturn this;\n\t}", "public String getPayoutScheduleReason() {\n return payoutScheduleReason;\n }" ]
[ "0.57614803", "0.57387567", "0.5723688", "0.57205915", "0.5702939", "0.5699351", "0.5653402", "0.5642286", "0.5611572", "0.548883", "0.54835075", "0.5472721", "0.5453687", "0.5426807", "0.54075104", "0.5396249", "0.530422", "0.5285965", "0.5275502", "0.52477854", "0.52073926", "0.5206253", "0.520065", "0.5160516", "0.5148502", "0.51303613", "0.51155525", "0.5109071", "0.50636387", "0.50534165", "0.5036074", "0.5011693", "0.50108725", "0.49906373", "0.49888465", "0.49643213", "0.49600378", "0.49438944", "0.49330553", "0.4932559", "0.49265718", "0.49262884", "0.49150914", "0.49137", "0.4912235", "0.49097046", "0.4900147", "0.48776552", "0.48760903", "0.48679072", "0.48445415", "0.48335546", "0.4800369", "0.47935578", "0.47868055", "0.47818446", "0.4780817", "0.47802946", "0.47755745", "0.47737655", "0.47587323", "0.47541556", "0.47448778", "0.4736627", "0.47336423", "0.47332525", "0.4724958", "0.4722887", "0.4716951", "0.4716881", "0.47147304", "0.47099715", "0.47040004", "0.46980584", "0.46966636", "0.46945268", "0.4694239", "0.46918184", "0.46882093", "0.468433", "0.4660689", "0.46601322", "0.46537977", "0.46488112", "0.4639399", "0.46293873", "0.46236593", "0.46136352", "0.46127468", "0.46014056", "0.4600081", "0.45995763", "0.45983115", "0.45980254", "0.458693", "0.45854622", "0.4583046", "0.45818925", "0.45793003", "0.45771322" ]
0.7414038
0
Returns the value of the 'Schedule Duration' attribute. If the meaning of the 'Schedule Duration' attribute isn't clear, there really should be more of a description here...
Double getScheduleDuration();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getDuration();", "public String getDuration() {\n return this.duration;\n }", "public String getDuration() {\n return duration;\n }", "public int getDuration() {\n\t\treturn this.Duration;\n\t}", "public TimeSpan getDuration() throws ServiceLocalException {\n\t\treturn (TimeSpan) this.getPropertyBag()\n\t\t\t\t.getObjectFromPropertyDefinition(AppointmentSchema.Duration);\n\t}", "public Integer getDuration() {\n return duration;\n }", "org.apache.xmlbeans.GDuration getDuration();", "public int getDuration() {\n\t\treturn duration;\n\t}", "public double getDuration() {\n\t\treturn duration;\n\t}", "Duration getDuration();", "public int getDuration() {\n return this.duration;\n }", "java.lang.String getTransitFlightDuration();", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getDuration() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(DURATION_PROP.get());\n }", "public long getDuration() {\n return mDuration;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getDuration() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(DURATION_PROP.get());\n }", "java.lang.String getTransitAirportDuration();", "org.apache.xmlbeans.XmlString xgetDuration();", "public long getDuration() {\n return duration;\n }", "org.apache.xmlbeans.XmlDuration xgetDuration();", "public int getDuration() {\n return duration;\n }", "public int getDuration() {\n return duration;\n }", "public int getDuration() {\n return duration;\n }", "public long getDuration() {\n return duration;\n }", "java.lang.String getFlightLegDuration();", "Posn getDuration();", "public Long getDuration()\r\n {\r\n return duration;\r\n }", "public int getDuration() {\n return duration_;\n }", "public int getDuration() {\n return duration_;\n }", "long getDuration();", "public Period getDurationValue() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not a duration.\");\n }", "public long getDuration()\n {\n return duration;\n }", "public Duration getDuration()\r\n {\r\n return (m_duration);\r\n }", "public SimpleStringProperty durationProperty(){\r\n\t\treturn duration;\r\n\t}", "public float getDuration()\n\t{\n\t\treturn duration;\n\t}", "int getDuration();", "int getDuration();", "public float getDuration() {\n\t\treturn duration;\n\t}", "public int getDuration();", "public double getDuration () {\n return duration;\n }", "@Nullable\n public Long getDuration() {\n return mDuration;\n }", "public int getDurationMinutes() {\n return durationMinutes;\n }", "org.apache.xmlbeans.XmlInt xgetDuration();", "Double getActualDuration();", "public Integer getRecordDuration() {\n return recordDuration;\n }", "public int getDuration() { return duration; }", "public org.apache.axis2.databinding.types.Duration getDuration() {\n return localDuration;\n }", "public int getmDuration() {\n return mDuration;\n }", "org.apache.xmlbeans.XmlInt xgetRecurrenceDuration();", "com.google.protobuf.Duration getDowntimeJailDuration();", "public int getDuration()\r\n/* 70: */ {\r\n/* 71: 71 */ return this.duration;\r\n/* 72: */ }", "public int getDuration() {return this.duration;}", "public int getRunDuration() {\n return runDuration;\n }", "@Transient\n \tpublic int getDuration() {\n \t\tint duration = (int) (this.endTime.getTime() - this.startTime.getTime());\n \t\treturn duration / 1000;\n \t}", "java.lang.String getSchedule();", "public int getPlanDuration() {\n\t\treturn planDuration;\n\t}", "public Duration getActualDuration()\r\n {\r\n return (m_actualDuration);\r\n }", "public String getDurationUnit() {\n\t\treturn (String) get_Value(\"DurationUnit\");\n\t}", "protected int getDuration() {\n try {\n return Utils.viewToInt(this.durationInput);\n }\n catch (NumberFormatException ex) {\n return Integer.parseInt(durationInput.getHint().toString());\n }\n }", "int getRunningDuration();", "int getSchedulingValue();", "public String getListingduration() {\r\n return listingduration;\r\n }", "int getRecurrenceDuration();", "public String getSchedule() {\n return schedule;\n }", "com.google.protobuf.DurationOrBuilder getDowntimeJailDurationOrBuilder();", "public Integer getDurationEndDay() {\n return durationEndDay;\n }", "public int getDuration() {\n\t\tif(currentPlayingItem==null) return 100;\n\t\treturn mediaPlayer.getDuration();\n\t}", "Double duration() {\n return execute(\"player.duration\");\n }", "public Duration getDuration(Rule rule) throws DatatypeConfigurationException {\n Constraint constraint = rule.getConstraint().get(0);\n if (constraint.getRightOperand().getType().equals(\"xsd:duration\")) {\n String duration = constraint.getRightOperand().getValue();\n return DatatypeFactory.newInstance().newDuration(duration);\n } else {\n return null;\n }\n }", "public double getTime() { return duration; }", "public double getScheduledTime() {\n return scheduledTime;\n }", "@JsonIgnore public Duration getEstimatedFlightDurationDuration() {\n return (Duration) getValue(\"estimatedFlightDuration\");\n }", "public Rational getDuration ()\r\n {\r\n if (this.isWholeDuration()) {\r\n return null;\r\n } else {\r\n Rational raw = getRawDuration();\r\n\r\n if (tupletFactor == null) {\r\n return raw;\r\n } else {\r\n return raw.times(tupletFactor);\r\n }\r\n }\r\n }", "public String getScheduleExpression() {\n return this.scheduleExpression;\n }", "@Override\r\n\tInteger getRedDuration() {\n\t\treturn null;\r\n\t}", "public Optional<BigInteger> getDuration() {\n return duration;\n }", "public DurationBean getEventDuration() {\n// return getEventDates().getDuration();\n DurationBean db = getEventDates().getDuration();\n if (debug()) {\n debug(\"Event duration=\" + db);\n }\n\n return db;\n }", "public int getSchedulingValue() {\n return scheduling_;\n }", "public Duration getDuration() {\n return localDuration;\n }", "java.lang.String getEmploymentDurationText();", "public int getSchedulingValue() {\n return scheduling_;\n }", "@ApiModelProperty(value = \"The duration of logged minutes.\")\n /**\n * The duration of logged minutes.\n *\n * @return duration Integer\n */\n public Integer getDuration() {\n return duration;\n }", "@Override\n\tpublic int getDuration() {\n\t\tlog(\"getDuration()\");\n\t\tif (getState() > PREPARING && getState() < ERROR \n\t\t\t\t&& mCurrentMediaPlayer != null) {\n\t\t\treturn mCurrentMediaPlayer.getDuration();\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public DeltaSeconds getDuration() { \n return duration ;\n }", "public double getStopTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STOPTIME$24);\r\n if (target == null)\r\n {\r\n return 0.0;\r\n }\r\n return target.getDoubleValue();\r\n }\r\n }", "public Integer getDurationStartDay() {\n return durationStartDay;\n }", "public double playTimeInSeconds(){\n\t\treturn durationInSeconds;\n\t}", "public Long getDurationMs();", "@Override protected String getDurationUnit() {\n return super.getDurationUnit();\n }", "public Date getScheduletime() {\r\n return scheduletime;\r\n }", "private static int getDuration() {\n\t\tStack<Object> stack = b.getCurrentWorkFrame();\n\t\tObject obj = stack.peek();\n\t\tif (Simulator.DEBUG)\n\t\t\tSystem.out.println(b.printStack() + \"...\");\n\t\tif (obj instanceof WorkFrame)\n\t\t\tthrow new RuntimeException(\"***ERROR: the next obj on stack should\"\n\t\t\t\t\t+ \"be an activity! WF_Sim.getDuration\" + obj.toString());\n\t\tActivityInstance ai = (ActivityInstance) stack.peek();\n\t\tif (ai.getActivity() instanceof CompositeActivity) {\n\t\t\tCompositeActivity comp = (CompositeActivity) ai.getActivity();\n\t\t\tif (frameInImpassed(comp))\n\t\t\t\treturn -1;\n\t\t\telse\n\t\t\t\tthrow new RuntimeException(\"***ERROR: push shouldn't have ended \" +\n\t\t\t\t\t\"with a composite on top\");\n\t\t}\n\t\treturn ai.getDuration();\n\t}", "public java.lang.String getTransitAirportDuration() {\n java.lang.Object ref = transitAirportDuration_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n transitAirportDuration_ = s;\n return s;\n }\n }", "public Duration length() {\n return getObject(Duration.class, FhirPropertyNames.PROPERTY_LENGTH);\n }", "public java.lang.String getTransitFlightDuration() {\n java.lang.Object ref = transitFlightDuration_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n transitFlightDuration_ = s;\n return s;\n }\n }", "public Date getScheduleTime() {\n return this.scheduleTime;\n }", "public java.lang.String getFlightLegDuration() {\n java.lang.Object ref = flightLegDuration_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n flightLegDuration_ = s;\n return s;\n }\n }", "@SimpleProperty(description = \"The default duration (in seconds) of each scan for this probe\")\n\tpublic float DefaultDuration(){\n\t\t\n\t\treturn SCHEDULE_DURATION;\n\t}", "public java.lang.String getFlightLegDuration() {\n java.lang.Object ref = flightLegDuration_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n flightLegDuration_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\r\n\tpublic int getDuration() {\n\t\treturn mediaPlayer.getDuration();\r\n\t}", "public java.lang.String getTransitFlightDuration() {\n java.lang.Object ref = transitFlightDuration_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n transitFlightDuration_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public double getRemainingTime()\n {\n return totalTime - scheduledTime;\n }" ]
[ "0.6908279", "0.6886332", "0.6850887", "0.67683524", "0.67479795", "0.67351323", "0.67024624", "0.665797", "0.66415125", "0.6630969", "0.66046345", "0.6603263", "0.6596091", "0.6588627", "0.6581435", "0.65721196", "0.6555966", "0.65498185", "0.65480065", "0.65467805", "0.65467805", "0.65467805", "0.6544902", "0.65417325", "0.6531882", "0.65268075", "0.6518652", "0.6517189", "0.6492791", "0.649169", "0.647658", "0.6462611", "0.64596736", "0.6450653", "0.6438481", "0.6438481", "0.6417547", "0.63931006", "0.6388317", "0.63758886", "0.63631356", "0.6354456", "0.6345187", "0.63320255", "0.6330816", "0.63121384", "0.6310894", "0.6304884", "0.6279809", "0.62772316", "0.62306905", "0.62101877", "0.6208824", "0.62015396", "0.61958915", "0.6189238", "0.61715424", "0.6152337", "0.61357516", "0.6130679", "0.611515", "0.610203", "0.60835344", "0.60635746", "0.60562843", "0.60550874", "0.6036601", "0.60272217", "0.60106605", "0.6006493", "0.5991724", "0.5961899", "0.5952296", "0.59504217", "0.5935419", "0.5931687", "0.59256166", "0.5920795", "0.59120613", "0.5908864", "0.5891372", "0.58909684", "0.5877092", "0.58602273", "0.5856139", "0.58560514", "0.5850489", "0.5843703", "0.58424294", "0.5837498", "0.5831895", "0.5823842", "0.58109516", "0.5807124", "0.5805379", "0.5798002", "0.57852465", "0.57804894", "0.57763773", "0.5767817" ]
0.8481141
0
Returns the value of the 'Actual Duration' attribute. If the meaning of the 'Actual Duration' attribute isn't clear, there really should be more of a description here...
Double getActualDuration();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Duration getActualDuration()\r\n {\r\n return (m_actualDuration);\r\n }", "public double getDuration() {\n\t\treturn duration;\n\t}", "public String getDuration() {\n return this.duration;\n }", "public Integer getDuration() {\n return duration;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getDuration() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(DURATION_PROP.get());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getDuration() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(DURATION_PROP.get());\n }", "public String getDuration() {\n return duration;\n }", "public int getDuration() {\n\t\treturn this.Duration;\n\t}", "public long getDuration() {\n return mDuration;\n }", "java.lang.String getDuration();", "public Long getDuration()\r\n {\r\n return duration;\r\n }", "public float getDuration()\n\t{\n\t\treturn duration;\n\t}", "public void setActualDuration(Duration actualDuration)\r\n {\r\n m_actualDuration = actualDuration;\r\n }", "public double getDuration () {\n return duration;\n }", "public float getDuration() {\n\t\treturn duration;\n\t}", "public long getDuration() {\n return duration;\n }", "public int getDuration() {\n return this.duration;\n }", "public long getDuration() {\n return duration;\n }", "public int getDuration() {\n\t\treturn duration;\n\t}", "org.apache.xmlbeans.GDuration getDuration();", "public long getDuration()\n {\n return duration;\n }", "public int getDuration() {\n return duration_;\n }", "public int getDuration() {\n return duration;\n }", "public int getDuration() {\n return duration;\n }", "public int getDuration() {\n return duration;\n }", "public int getmDuration() {\n return mDuration;\n }", "public int getDuration() {\n return duration_;\n }", "public int getDuration() { return duration; }", "long getDuration();", "public Duration getDuration()\r\n {\r\n return (m_duration);\r\n }", "public int getDuration()\r\n/* 70: */ {\r\n/* 71: 71 */ return this.duration;\r\n/* 72: */ }", "public String getDurationUnit() {\n\t\treturn (String) get_Value(\"DurationUnit\");\n\t}", "public Period getDurationValue() {\n throw new OurBadException(\" Item '\" + this.serialize() + \"' is not a duration.\");\n }", "public int getDuration();", "public int getDuration() {return this.duration;}", "Duration getDuration();", "Posn getDuration();", "public DeltaSeconds getDuration() { \n return duration ;\n }", "int getDuration();", "int getDuration();", "@Override\n\tpublic int getDuration() {\n\t\tlog(\"getDuration()\");\n\t\tif (getState() > PREPARING && getState() < ERROR \n\t\t\t\t&& mCurrentMediaPlayer != null) {\n\t\t\treturn mCurrentMediaPlayer.getDuration();\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "@Transient\n \tpublic int getDuration() {\n \t\tint duration = (int) (this.endTime.getTime() - this.startTime.getTime());\n \t\treturn duration / 1000;\n \t}", "public double getTime() { return duration; }", "@Nullable\n public Long getDuration() {\n return mDuration;\n }", "@Override protected String getDurationUnit() {\n return super.getDurationUnit();\n }", "public Rational getDuration ()\r\n {\r\n if (this.isWholeDuration()) {\r\n return null;\r\n } else {\r\n Rational raw = getRawDuration();\r\n\r\n if (tupletFactor == null) {\r\n return raw;\r\n } else {\r\n return raw.times(tupletFactor);\r\n }\r\n }\r\n }", "public int getDuration() {\n\t\tif(currentPlayingItem==null) return 100;\n\t\treturn mediaPlayer.getDuration();\n\t}", "public Long getDurationMs();", "public Integer getRecordDuration() {\n return recordDuration;\n }", "org.apache.xmlbeans.XmlDuration xgetDuration();", "Double duration() {\n return execute(\"player.duration\");\n }", "@Override\r\n\tpublic int getDuration() {\n\t\treturn mediaPlayer.getDuration();\r\n\t}", "public int getduration() {\n\t\tDuration duration = Duration.between(initial_time, current_time);\n\t\treturn (int)duration.getSeconds();\n\t}", "public long getDuration()\n\t{ return (long)0;\n\t}", "public double getDuration() {\n if (null == firstTime) {\n return 0.0;\n }\n return lastTime.timeDiff_ns(firstTime);\n }", "public org.apache.axis2.databinding.types.Duration getDuration() {\n return localDuration;\n }", "protected int getDuration() {\n try {\n return Utils.viewToInt(this.durationInput);\n }\n catch (NumberFormatException ex) {\n return Integer.parseInt(durationInput.getHint().toString());\n }\n }", "org.apache.xmlbeans.XmlInt xgetDuration();", "org.apache.xmlbeans.XmlString xgetDuration();", "@ApiModelProperty(value = \"The duration of logged minutes.\")\n /**\n * The duration of logged minutes.\n *\n * @return duration Integer\n */\n public Integer getDuration() {\n return duration;\n }", "@Override\r\n\t\tpublic long dmr_getMediaDuration() throws RemoteException {\n\t\t\tUtils.printLog(TAG, \"dmr_getMediaDuration()\" + sEndTime);\r\n\t\t\treturn sEndTime;\r\n\t\t}", "public SimpleStringProperty durationProperty(){\r\n\t\treturn duration;\r\n\t}", "public String getMultimediaDuration() {\n return multimediaDuration;\n }", "public Duration getDuration() {\n return localDuration;\n }", "public long getDuration() { throw new RuntimeException(\"Stub!\"); }", "public double getMusicDuration() {\n if (music == null) {\n return -1;\n }\n \n return music.getDuration();\n }", "@Generated\n @Selector(\"duration\")\n public native double duration();", "public Optional<BigInteger> getDuration() {\n return duration;\n }", "public float getFixedDuration() {\n return fixedDuration;\n }", "public Integer getDurationTotal() {\n return durationTotal;\n }", "public int getRunDuration() {\n return runDuration;\n }", "@Override\r\n\tInteger getRedDuration() {\n\t\treturn null;\r\n\t}", "RealDuration asRealDuration();", "long getDuration() {\n if (debugFlag)\n debugPrintln(\"JSChannel:getDuration\");\n\n if (ais == null || audioFormat == null ) {\n if (debugFlag)\n debugPrintln(\"JSChannel: Internal Error getDuration\");\n return (long)Sample.DURATION_UNKNOWN;\n }\n // Otherwise we'll assume that we can calculate this duration\n\n // get \"duration\" of audio stream (wave file)\n // TODO: For True STREAMing audio the size is unknown...\n long numFrames = ais.getFrameLength();\n if (debugFlag)\n debugPrintln(\" frame length = \" + numFrames);\n if (numFrames <= 0)\n return (long)Sample.DURATION_UNKNOWN;\n\n float rateInFrames = audioFormat.getFrameRate();\n rateInHz = audioFormat.getSampleRate();\n if (debugFlag)\n debugPrintln(\" rate in Frames = \" + rateInFrames);\n if (numFrames <= 0)\n return (long)Sample.DURATION_UNKNOWN;\n long duration = (long)((float)numFrames/rateInFrames);\n if (debugFlag)\n debugPrintln(\" duration(based on ais) = \" + duration);\n return duration;\n }", "public default int getDuration(int casterLevel){ return Reference.Values.TICKS_PER_SECOND; }", "public int getDuration() {\n if (!mPlayerState.equals(State.IDLE)) {\n return mMediaPlayer.getDuration();\n }\n return 0;\n }", "public java.lang.String getRndDuration() {\n return rndDuration;\n }", "public Rational getRawDuration ()\r\n {\r\n Rational rawDuration = null;\r\n\r\n if (!getNotes().isEmpty()) {\r\n // All note heads are assumed to be the same within one chord\r\n Note note = (Note) getNotes().get(0);\r\n\r\n if (!note.getShape().isMeasureRest()) {\r\n // Duration (with flags/beams applied for non-rests)\r\n rawDuration = note.getNoteDuration();\r\n\r\n // Apply augmentation (applies to rests as well)\r\n if (dotsNumber == 1) {\r\n rawDuration = rawDuration.times(new Rational(3, 2));\r\n } else if (dotsNumber == 2) {\r\n rawDuration = rawDuration.times(new Rational(7, 4));\r\n }\r\n }\r\n }\r\n\r\n return rawDuration;\r\n }", "public int getDurationMinutes() {\n return durationMinutes;\n }", "public long duration() {\n\t\treturn end - start;\n\t}", "public Duration getActualWork()\r\n {\r\n return (m_actualWork);\r\n }", "public long duration() {\n\t\tif (mPlayer.isInitialized()) {\n\t\t\treturn mPlayer.duration();\n\t\t}\n\t\treturn -1;\n\t}", "public int getFullDuration() {\r\n return disc.getDisc().stream()\r\n .mapToInt(Song::getDuration)\r\n .sum();\r\n }", "public long getDurationInMillis() {\n return Utilities.convertMinutesToMilliseconds(durationMinutes);\n }", "public long getAnimDuration() {\n return (long) (Settings.Global.getFloat(this.mContext.getContentResolver(), \"transition_animation_scale\", this.mContext.getResources().getFloat(17105053)) * 336.0f);\n }", "public int getDuration() {\n\t\treturn (int) ((endTime.getTime()-startTime.getTime())/1000) + 1;\n\t}", "public void setDuration(int val){this.duration = val;}", "@Override\n\tpublic int getMediaDuration() {\n\t\treturn 0;\n\t}", "public double getFrameDuration();", "public double playTimeInSeconds(){\n\t\treturn durationInSeconds;\n\t}", "@JsonIgnore public Duration getEstimatedFlightDurationDuration() {\n return (Duration) getValue(\"estimatedFlightDuration\");\n }", "public int getEffectDuration() {\n\t\treturn effectDuration;\n\t}", "public int getDuration(StarObjectClass self){ \r\n \t\tStarCLEMediaPlayer mediaplayer = (StarCLEMediaPlayer)WrapAndroidClass.GetAndroidObject(self,\"AndroidObject\");\r\n \t\tif( mediaplayer == null )\r\n \t\t\treturn 0;\r\n \t\treturn mediaplayer.getDuration();\r\n \t}", "public double getAsSeconds()\n {\n return itsValue / 1000000.0;\n }", "public double getStopTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STOPTIME$24);\r\n if (target == null)\r\n {\r\n return 0.0;\r\n }\r\n return target.getDoubleValue();\r\n }\r\n }", "public long toDurationMillis() {\r\n return FieldUtils.safeAdd(getEndMillis(), -getStartMillis());\r\n }", "public int getDuration() {\n return animationDuration;\n }", "public Duration getBaselineDuration()\r\n {\r\n return (m_baselineDuration);\r\n }", "public int getDuration( ) {\nreturn numberOfPayments / MONTHS;\n}", "private static int getDuration() {\n\t\tStack<Object> stack = b.getCurrentWorkFrame();\n\t\tObject obj = stack.peek();\n\t\tif (Simulator.DEBUG)\n\t\t\tSystem.out.println(b.printStack() + \"...\");\n\t\tif (obj instanceof WorkFrame)\n\t\t\tthrow new RuntimeException(\"***ERROR: the next obj on stack should\"\n\t\t\t\t\t+ \"be an activity! WF_Sim.getDuration\" + obj.toString());\n\t\tActivityInstance ai = (ActivityInstance) stack.peek();\n\t\tif (ai.getActivity() instanceof CompositeActivity) {\n\t\t\tCompositeActivity comp = (CompositeActivity) ai.getActivity();\n\t\t\tif (frameInImpassed(comp))\n\t\t\t\treturn -1;\n\t\t\telse\n\t\t\t\tthrow new RuntimeException(\"***ERROR: push shouldn't have ended \" +\n\t\t\t\t\t\"with a composite on top\");\n\t\t}\n\t\treturn ai.getDuration();\n\t}" ]
[ "0.8386878", "0.75073814", "0.74831027", "0.7460236", "0.74561304", "0.74406666", "0.7433575", "0.74274683", "0.7416208", "0.7413924", "0.74099344", "0.7408799", "0.74009186", "0.73845553", "0.73664486", "0.7365104", "0.73614943", "0.73506385", "0.73174274", "0.73126906", "0.7309171", "0.7299841", "0.72918785", "0.72918785", "0.72918785", "0.72518635", "0.7233458", "0.71808165", "0.71607053", "0.7131994", "0.7101632", "0.71007514", "0.7092444", "0.7086345", "0.7068017", "0.70657545", "0.70559293", "0.7026513", "0.70264685", "0.70264685", "0.7026296", "0.7016587", "0.7016059", "0.70103633", "0.6967675", "0.69511247", "0.694105", "0.69332385", "0.68944037", "0.6830912", "0.6808592", "0.6803507", "0.6802468", "0.68003577", "0.67933154", "0.67895746", "0.6788466", "0.6732425", "0.6724917", "0.6686004", "0.6685927", "0.66839844", "0.66676396", "0.66520643", "0.6646278", "0.66329306", "0.66309226", "0.6629181", "0.66157204", "0.6613199", "0.6583995", "0.65727943", "0.65474325", "0.654144", "0.65412796", "0.65354884", "0.6528889", "0.6526785", "0.6487121", "0.6478687", "0.64105487", "0.63935953", "0.63787735", "0.6374582", "0.6340857", "0.6338634", "0.6335951", "0.63259333", "0.6324853", "0.63213784", "0.6306828", "0.6291488", "0.6271255", "0.6265861", "0.6240239", "0.6226946", "0.6225107", "0.6222394", "0.620356", "0.6189819" ]
0.8566619
0
Returns the value of the 'Remaining Time' attribute. If the meaning of the 'Remaining Time' attribute isn't clear, there really should be more of a description here...
Double getRemainingTime();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Duration getRemainingTime();", "public double getRemainingTime()\n {\n return totalTime - scheduledTime;\n }", "@java.lang.Override\n public com.google.protobuf.Int32Value getRemainingTimeSeconds() {\n return remainingTimeSeconds_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : remainingTimeSeconds_;\n }", "public long getRemainingDuration() {\n\t\treturn 0;\n\t}", "public float getRemainingTime () {\n\t\treturn duration - timer < 0 ? 0 : duration - timer;\n\t}", "public long getRemainingTime() {\n return (maxTime_ * 1000L)\n - (System.currentTimeMillis() - startTime_);\n }", "private long remainingTime() {\n final long remainingTime = this.designatedEnd - System.currentTimeMillis();\n return remainingTime >= 0 ? remainingTime : 0L;\n }", "public double getTimeRemaining() {\n\t\treturn (startingTime + duration) - System.currentTimeMillis();\n\t}", "public long getTimeRemaining() {\n int timer = 180000; //3 minutes for the game in milliseconds\n long timeElapsed = System.currentTimeMillis() - startTime;\n long timeRemaining = timer - timeElapsed + bonusTime;\n long timeInSeconds = timeRemaining / 1000;\n long seconds = timeInSeconds % 60;\n long minutes = timeInSeconds / 60;\n if (seconds < 0 || minutes < 0) { //so negative numbers don't show\n seconds = 0;\n minutes = 0;\n }\n return timeInSeconds;\n }", "public String getEstimatedRemainingTime() {\n long d = executable.getParent().getEstimatedDuration();\n if(d<0) return \"N/A\";\n \n long eta = d-(System.currentTimeMillis()-startTime);\n if(eta<=0) return \"N/A\";\n \n return Util.getTimeSpanString(eta);\n }", "@java.lang.Override\n public com.google.protobuf.Int32ValueOrBuilder getRemainingTimeSecondsOrBuilder() {\n return getRemainingTimeSeconds();\n }", "public com.google.protobuf.Int32Value getRemainingTimeSeconds() {\n if (remainingTimeSecondsBuilder_ == null) {\n return remainingTimeSeconds_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : remainingTimeSeconds_;\n } else {\n return remainingTimeSecondsBuilder_.getMessage();\n }\n }", "public long getRemainingTime() {\n if (isPaused()) {\n return pausedPoint;\n }\n long res = (long) ((spedEndTime - SystemClock.elapsedRealtime()) * speed);\n return res > 0 ? res : 0;\n }", "public int getAlertMessageTimeRemaining()\n {\n return this.alert_message_time_remaining;\n }", "public com.google.protobuf.Int32ValueOrBuilder getRemainingTimeSecondsOrBuilder() {\n if (remainingTimeSecondsBuilder_ != null) {\n return remainingTimeSecondsBuilder_.getMessageOrBuilder();\n } else {\n return remainingTimeSeconds_ == null ?\n com.google.protobuf.Int32Value.getDefaultInstance() : remainingTimeSeconds_;\n }\n }", "public final long getRemainingTime(K key) {\n final CacheItem<K, V, D> val;\n synchronized (this) {\n val = this.cache.get(key);\n }\n if (val == null)\n return -1;\n return val.getRemainingTimeoutDelay();\n }", "public void printTimeRemaining() {\n long timeInSeconds = getTimeRemaining();\n long seconds = timeInSeconds % 60;\n long minutes = timeInSeconds / 60;\n System.out.println(\"Time until the oxygen supply runs out: \" + minutes \n + \" minutes and \" + seconds + \" seconds.\");\n }", "public Long getEstimatedEvaluationTimeRemainingInMinutes() {\n return this.estimatedEvaluationTimeRemainingInMinutes;\n }", "public long remainingTime() throws IgniteTxTimeoutCheckedException;", "public int getExtraTimeGiven()\r\n {\r\n return extraTimeGiven;\r\n }", "public int getRemaining() {\n\t\treturn activeQuest.getRequirement_left();\n\t}", "public String getTimeLeft() {\n return NumberToTimeLeft.convert(_dateExpiration - System.currentTimeMillis(),true);\n }", "public int getWaitedTime() {\n\t\treturn this.waitedTime;\n\t}", "public Long remaining() {\n return this.remaining;\n }", "public float getRemainingPercentage() {\n float percentage = (float) getRemainingTime() / this.duration;\n if (Float.isNaN(percentage)) {\n percentage = 1;\n }\n return Math.min(Math.max(0, percentage), 1);\n }", "@java.lang.Override\n public boolean hasRemainingTimeSeconds() {\n return remainingTimeSeconds_ != null;\n }", "public int getLivesRemaining();", "public java.lang.String getExpenseTotalTime () {\n\t\treturn expenseTotalTime;\n\t}", "int getRemainingCooldown();", "public abstract float getCooldownRemaining();", "public long getTimeLeft() {\n return getExpiration() - System.currentTimeMillis() / 1000L <= 0 ? 0 : getExpiration() - System.currentTimeMillis() / 1000L;\n }", "public long getTimeLeft() {\n return timeLeft;\n }", "public long getStatusTimeLeft()\r\n {\r\n long timeLeft = statusTimeout - System.currentTimeMillis();\r\n if ( timeLeft < 0 )\r\n {\r\n timeLeft = 0;\r\n }\r\n return timeLeft;\r\n }", "public TLifeTimeInSeconds getLifetimeLeft() {\n\n\t\treturn lifetimeLeft;\n\t}", "java.lang.String getWaitTime();", "public void setRemainingDuration(long remainingDuration) {\n\t\t\n\t}", "public Integer getDealingTime() {\r\n return dealingTime;\r\n }", "public String getWaiting_lock_duration() {\n return waiting_lock_duration;\n }", "public long getTimeLeft() {\n\t\treturn timeLeft;\n\t}", "public double getTime() {\n\t\treturn this.completedTime;\n\t}", "public boolean hasRemainingTimeSeconds() {\n return remainingTimeSecondsBuilder_ != null || remainingTimeSeconds_ != null;\n }", "public int getRecitationTime(){\n\t\treturn this.recitationTime;\n\t}", "java.lang.String getTransitFlightDuration();", "public String getTotalTime() {\r\n if (recipe != null) {\r\n return readableTime(recipe.getCookTime() + recipe.getPrepTime());\r\n } else {\r\n return \"\";\r\n }\r\n }", "public double getHoldTime();", "public int getRemaining( int telObsCompIndex )\n\t{\n\t\treturn _avTable.getInt( ATTR_REMAINING , telObsCompIndex , 0 ) ;\n\t}", "public String estimatedTime() {\n int m = (int)(getFreeBytes()/500000000);\n return (m <= 1) ? \"a minute\" : m+\" minutes\";\n }", "public String getElapsedTime() {\n return elapsedTime;\n }", "public int getCountdown() {\r\n\t\treturn this.Countdown;\r\n\t}", "public int totalTime()\n {\n return departureTime - arrivalTime;\n }", "public Integer getDealTime() {\r\n return dealTime;\r\n }", "public int getTimeLeft() {\n\t\treturn timeLeft;\n\t}", "@Override\n\tpublic Integer getRemainingQuantity() {\n\t\treturn null;\n\t}", "public double getRemainingCost(FieldContext fieldContext) {\n\t\treturn 0;\n\t}", "public double gettimetoAchieve(){\n\t\treturn this.timeFrame;\n\t}", "@Override\n public long getTimeNeeded() {\n return timeNeeded;\n }", "public long getRemaining() {\n\t\treturn disk_mgr.getRemaining();\n\t}", "public long calcRemaining(){\n return getGrandTotal() - getTotalPaid();\n }", "public double getSecs( );", "public int getwaitTime(){\r\n\t\t String temp=rb.getProperty(\"waitTime\");\r\n\t\t return Integer.parseInt(temp);\r\n\t}", "public List<String> getTime() {\r\n\t\treturn timeAvailable;\r\n\t}", "public long getRemainingWork(FieldContext fieldContext) {\n\t\treturn 0;\n\t}", "public String getArriveTime() {\n return arriveTime;\n }", "public int getTimeToLive() {\n\t\treturn deathsTillForget;\n\t}", "public String elapsedTime() {\n return totalWatch.toString();\n }", "public double getmoneyremainingtoSave()\n\t{\n\t\treturn this.getIdealAmount()-this.moneySaved();\n\t}", "public double getStopTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STOPTIME$24);\r\n if (target == null)\r\n {\r\n return 0.0;\r\n }\r\n return target.getDoubleValue();\r\n }\r\n }", "@Basic\n\tpublic double getTimeInvincible(){\n\t\treturn this.time_invincible;\n\t}", "public double getElapsedTime()\n\t{\n\t\treturn elapsedTime;\n\t}", "public Integer getTravelTime() {\n\t\treturn travelTime;\n\t}", "public int getTimeLength() {\r\n return timeLength;\r\n }", "public long getTimeDisrepair()\n\t{\n\t\treturn timeDisrepair;\n\t}", "public String getReqTime() {\n return reqTime;\n }", "java.lang.String getDuration();", "public int getTotalWaitTime() {\n return totalWaitTime;\n }", "public long getOccupiedSeconds(){\n \t\treturn occupiedSeconds;\n \t}", "org.apache.xmlbeans.XmlDuration xgetDuration();", "long getDuration();", "@Override\r\n\tpublic long getTime() {\n\t\treturn this.time;\r\n\t}", "public Integer getTradeTime() {\n return tradeTime;\n }", "public long getDuration() {\n return mDuration;\n }", "public int getDuration() {\n\t\treturn this.Duration;\n\t}", "public void HowMuchTimeLeft() {\n\t\tTimeLeft = Count.HowMuchTimeLeft();\n\t}", "public int getChancesRemaining() {\r\n\t\treturn chancesRemaining;\r\n\t}", "public double getCumTime() {\n return cumTime;\n }", "public long getTotalTime() {\n/* 73 */ return this.totalTime;\n/* */ }", "public String getTimeOut() {\n return prop.getProperty(TIMEOUT_KEY);\n }", "public Long getElapsedTime() {\n return elapsedTime;\n }", "org.apache.xmlbeans.XmlString xgetDuration();", "public int getTravelTime() {\r\n return travelTime;\r\n }", "public int getDelayTime()\n\t{\n\t\treturn delayTime;\n\t}", "public int getduration() {\n\t\tDuration duration = Duration.between(initial_time, current_time);\n\t\treturn (int)duration.getSeconds();\n\t}", "public double getTotalDelayTime() {\r\n return totalDelayTime;\r\n }", "public Duration getActualDuration()\r\n {\r\n return (m_actualDuration);\r\n }", "public String getStopTime() {\n\t\treturn (new Parser(value)).skipString().getString();\n\t}", "@java.lang.Override\n public com.google.protobuf.Int32Value getRemainingDistanceMeters() {\n return remainingDistanceMeters_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : remainingDistanceMeters_;\n }", "public double getTime() { return duration; }", "@Override\n\tpublic int getTimeLeft() {\n\t\treturn chronometer.getTimeLeft();\n\t}", "public int getSkillRechargeTime(Skills currentSkill);", "public java.lang.String getWaitTime() {\n java.lang.Object ref = waitTime_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n waitTime_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }" ]
[ "0.79915655", "0.7945002", "0.7673004", "0.7647582", "0.76015216", "0.7527534", "0.7394165", "0.7318757", "0.7242987", "0.7165264", "0.7144565", "0.7134419", "0.69514054", "0.69037086", "0.683556", "0.67934895", "0.6776207", "0.66022813", "0.6554136", "0.64976025", "0.6437722", "0.6393476", "0.6374584", "0.6374443", "0.6346256", "0.6346163", "0.63057894", "0.6290122", "0.62664264", "0.62253636", "0.62101865", "0.6201816", "0.6188563", "0.6170008", "0.616947", "0.61691034", "0.6166205", "0.61555046", "0.6150929", "0.6136813", "0.61286557", "0.61265856", "0.61261624", "0.6122794", "0.61072844", "0.610029", "0.6099298", "0.60973954", "0.609321", "0.6089406", "0.6072985", "0.6071747", "0.606821", "0.6066473", "0.60581696", "0.6043894", "0.60372794", "0.6031057", "0.6027386", "0.60269415", "0.6003597", "0.60025305", "0.5999603", "0.598768", "0.59848094", "0.5981871", "0.5981545", "0.5980522", "0.595827", "0.5957922", "0.59529275", "0.5951021", "0.59509635", "0.5949156", "0.59484017", "0.59303284", "0.5921384", "0.59194565", "0.59188825", "0.5913554", "0.5907166", "0.5906916", "0.5906833", "0.5903444", "0.5895184", "0.58951783", "0.5888803", "0.58880323", "0.58824617", "0.5881168", "0.5880372", "0.5879732", "0.58794093", "0.5878299", "0.5872483", "0.58656806", "0.58648807", "0.5864557", "0.5864241", "0.58616287" ]
0.8139429
0
Returns the value of the 'Free Float' attribute. If the meaning of the 'Free Float' attribute isn't clear, there really should be more of a description here...
Double getFreeFloat();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Float getFloatAttribute();", "final public float getFloatAttr() {\r\n\t\t\tif(mName.length() == 0)\r\n\t\t\t\treturn -1;\r\n\t\t\tif(mSaveAttr == null)\r\n\t\t\t\treturn getAttr(mName).Value;\r\n\t\t\treturn mSaveAttr.Value;\r\n\t\t}", "public Float getFloat(String attr) {\n return (Float) super.get(attr);\n }", "public float get_float() {\n return local_float;\n }", "public float floatValue()\n\t\t{\n\t\t\treturn (float) doubleValue();\n\t\t}", "public float floatValue() {\n return ( (Float) getAllele()).floatValue();\n }", "public float floatValue() {\n\t\treturn (float) mDouble;\n\t}", "public static float getValueFloat()\n {\n return Util.valueFloat;\n }", "@Override\r\n public float floatValue() {\r\n return (float) this.m_current;\r\n }", "public float getFloatValue() {\n \t\treturn floatValue;\n \t}", "public float getValue()\r\n {\r\n return getSemanticObject().getFloatProperty(swps_floatValue);\r\n }", "float getEFloat();", "public float floatValue() {\n return (float) value;\n }", "public float floatValue() {\r\n return (float) intValue();\r\n }", "float getValue();", "float getValue();", "float getValue();", "public float floatValue() {\n return this.value;\n }", "public Float getValue() {\n\t\treturn value;\n\t}", "public Float getValue() {\n\t\treturn value;\n\t}", "public Double getFNumber()\n\t{\n\t\treturn null;\n\t}", "double getFloatingPointField();", "final public float getFloatAttr(final String name) {\r\n\t\tfor(final Attr attr : mAttributes) {\r\n\t\t\tif(attr.Name.equals(name))\r\n\t\t\t\treturn attr.Value;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public float floatValue() {\n return (float) m_value;\n }", "public float toFloat() {\n return this.toFloatArray()[0];\n }", "public float getFloatValue() {\n if (getValueIndex() <= 0)\n return 0F;\n return ((FloatEntry) getPool().getEntry(getValueIndex())).getValue();\n }", "public Float getValue () {\r\n\t\treturn (Float) getStateHelper().eval(PropertyKeys.value);\r\n\t}", "public Float getFloat(String key)\n\t{\n\t\tDouble d = getDouble(key);\n\t\tif(d == null)\n\t\t\treturn null;\n\t\treturn d.floatValue();\n\t}", "public Number getFee() {\n return (Number) getAttributeInternal(FEE);\n }", "public float getFloat(String key)\n {\n return getFloat(key, 0);\n }", "public BigDecimal getFreeMoney() {\r\n return freeMoney;\r\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn \"float\";\r\n\t}", "public abstract float getValue();", "public float readFloat() {\n return Float.parseFloat(readNextLine());\n }", "public float getValue() {\n return value;\n }", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}", "public float getValue() {\n return value_;\n }", "public float getValue() {\n\t\treturn value;\n\t}", "public java.lang.Double getFreight () {\r\n\t\treturn freight;\r\n\t}", "@Nullable\r\n public Float getFloat(String key) {\r\n return getFloat(key, null);\r\n }", "public boolean isAfloat(){\n \treturn afloat;\r\n }", "String getFloat_lit();", "public float getValue() {\n return value_;\n }", "public final float getValue() {\r\n\t\treturn value;\r\n\t}", "public Float getFreemintotalprice() {\n return freemintotalprice;\n }", "public float unpackFloat() {\n return buffer.getFloat();\n }", "public FloatType asFloat() {\n return TypeFactory.getIntType(toInt(this.getValue())).asFloat();\n }", "public float getValue()\n\t{\n\t\treturn this.value;\n\t}", "public float getRawValue() { return rawValue; }", "@Test\n public void test_TCM__float_getFloatValue() {\n Attribute attr = new Attribute(\"test\", \"1.00000009999e+10f\");\n float flt = 1.00000009999e+10f;\n try {\n assertTrue(\"incorrect float conversion\",\n attr.getFloatValue() == flt);\n } catch (DataConversionException e) {\n fail(\"couldn't convert to float\");\n }\n\n // test an invalid float\n\n attr.setValue(\"1.00000009999e\");\n try {\n attr.getFloatValue();\n fail(\"incorrect float conversion from non float\");\n } catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n }\n\n }", "float readFloat();", "Double getTotalFloat();", "public Float getFloatData(String key) {\n return pref.getFloat(key, 0);\n }", "public static double readFloat() {\n return Float.parseFloat(readString());\n }", "public abstract float read_float();", "public float getAsFloat(){\n return (new Float(getAsCents()) / 100);\n }", "public Float getFloat(float defaultVal) {\n return get(ContentType.FloatType, defaultVal);\n }", "public float leerFloat() throws IOException\r\n {\r\n return maestro.readFloat(); \r\n }", "Double getFieldFloat(VcfEntry vcfEntry) {\n\t\tif (name.equals(\"QUAL\")) return vcfEntry.getQuality();\n\n\t\tString value = getFieldString(vcfEntry);\n\t\tif (value == null) return (Double) fieldNotFound(vcfEntry);\n\t\treturn Gpr.parseDoubleSafe(value);\n\t}", "public static float leerFloat() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public Float getFloat(String key) throws AgentBuilderRuntimeException {\n\t\tif (!extContainsKey(key))\n\t\t\tthrow new AgentBuilderRuntimeException(\n\t\t\t\t\t\"Dictionary does not contain key \\\"\" + key + \"\\\"\");\n\t\treturn (Float) extGet(key);\n\t}", "double floatField(String name, boolean isDefined, double value,\n FloatSpecification spec) throws NullField, InvalidFieldValue;", "public float getReturn()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(RETURN$0, 0);\r\n if (target == null)\r\n {\r\n return 0.0f;\r\n }\r\n return target.getFloatValue();\r\n }\r\n }", "public double getFrecuencia() {\r\n return frecuencia;\r\n }", "float getFull();", "@Override\r\n\tpublic boolean isFloat() {\r\n\t\treturn isFloatType;\r\n\t}", "public boolean isFloat() {\n return this.data instanceof Float;\n }", "public float getRealValue()\r\n\t{\r\n\t\treturn realValue;\r\n\t}", "public float approach_x_GET()\n { return (float)(Float.intBitsToFloat((int) get_bytes(data, 40, 4))); }", "public Float getDeliveryfee() {\n return deliveryfee;\n }", "@Override\n\tpublic float value() {\n\t\treturn currnet().value();\n\t}", "public float evaluateAsFloat();", "public T caseURDFAttrFloat(URDFAttrFloat object) {\r\n\t\treturn null;\r\n\t}", "public float getMandatoryFloat(String key) throws ConfigNotFoundException;", "public float approach_x_GET()\n { return (float)(Float.intBitsToFloat((int) get_bytes(data, 41, 4))); }", "public float readFloat()\r\n/* 447: */ {\r\n/* 448:460 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 449:461 */ return super.readFloat();\r\n/* 450: */ }", "boolean hasFloat();", "public double getF();", "@Override\n public final Float getForfeit() {\n return _forfeit;\n }", "public float getFloat(String name) {\n Enumeration enumer = FLOATS.elements();\n while(enumer.hasMoreElements()) {\n SimpleMessageObjectFloatItem item = (SimpleMessageObjectFloatItem) enumer.nextElement();\n if(item.getName().compareTo(name) == 0) {\n return item.getValue();\n }\n }\n return -1F;\n }", "public Float getFloat(String key, Float defaultValue);", "public float getMinValue();", "public java.lang.Float getVar185() {\n return var185;\n }", "@Override\r\n\tpublic float getFloat(String string) {\n\t\treturn 0;\r\n\t}", "public float getFloat(String key, float defaultValue);", "public float getMinFloat() {\n\t\treturn this.minFloat;\n\t}", "public float getQuantityAvailableForSale () {\n return (float) 0.0;\n }", "public double value(){\n\t return (double) this.f;\n }", "Double getStartFloat();", "public Boolean getFree() {\n return free;\n }", "public Float F(String key) throws AgentBuilderRuntimeException {\n\t\treturn getFloat(key);\n\t}", "public static float getFloatProperty(String key) {\r\n\t\treturn getFloatProperty(key, 0);\r\n\t}", "public float getFieldAsFloat(int tag) {\n return getFieldAsFloat(tag, 0);\n }", "public float getFloat(String key) {\n\t\tfloat defaultValue = 0;\n\t\tif (getDefault(key) != null)\n\t\t\tdefaultValue = (Float) getDefault(key);\n\t\tString sp = internal.getProperty(key);\n\t\tif (sp == null) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\tfloat value;\n\t\ttry {\n\t\t\tvalue = Float.parseFloat(sp);\n\t\t} catch (NumberFormatException ex) {\n\t\t\tsetFloat(key, defaultValue);\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn value;\n\t}", "FloatAttribute(String name, float value) {\r\n super(name);\r\n this.value = value;\r\n }", "String floatRead();", "public java.lang.Float getVar176() {\n return var176;\n }", "public Float getBhDlTbfReq() {\r\n return bhDlTbfReq;\r\n }", "public double getFreightAmtInVisa() {\n return _freightAmtInVisa;\n }", "public java.lang.Float getVar185() {\n return var185;\n }" ]
[ "0.7851724", "0.7577416", "0.71653247", "0.71211755", "0.70970917", "0.70455253", "0.7040956", "0.69917554", "0.6980339", "0.6966827", "0.6965774", "0.6924092", "0.68925935", "0.68913203", "0.687514", "0.687514", "0.687514", "0.6874481", "0.6858666", "0.6858666", "0.6845921", "0.6843258", "0.68023527", "0.67775077", "0.6769061", "0.6748705", "0.6692317", "0.6682078", "0.66753554", "0.6638416", "0.6637119", "0.66249496", "0.66237664", "0.6614386", "0.6606025", "0.6599445", "0.6596542", "0.657748", "0.65759104", "0.65726596", "0.6562242", "0.6543307", "0.6541593", "0.6524085", "0.65238833", "0.65233636", "0.65214396", "0.65212816", "0.65086126", "0.64856225", "0.64751005", "0.6470272", "0.6468706", "0.6461728", "0.6461287", "0.64548963", "0.64516264", "0.6448087", "0.6446965", "0.64441013", "0.6436024", "0.64173895", "0.6408303", "0.6402684", "0.63954127", "0.638724", "0.63826627", "0.63742065", "0.6359141", "0.6352549", "0.6351472", "0.6348222", "0.63463986", "0.6344269", "0.633646", "0.6336431", "0.6317977", "0.6314379", "0.6297082", "0.62946624", "0.62651575", "0.6255707", "0.6254754", "0.6254614", "0.6227865", "0.62220216", "0.6218352", "0.6210901", "0.620093", "0.619516", "0.6193041", "0.61914915", "0.6188727", "0.61774933", "0.6177317", "0.617242", "0.61718535", "0.61620957", "0.61517483", "0.61500674" ]
0.82203525
0
Returns the value of the 'Total Float' attribute. If the meaning of the 'Total Float' attribute isn't clear, there really should be more of a description here...
Double getTotalFloat();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getTotal(){\r\n\t\treturn Total;\r\n\t}", "public float getTotal() {\n return this.total;\n }", "public static float getTotal() {\n return total;\r\n }", "public float totalValue() {\n return 0;\n }", "public Number getTotal() {\n return (Number)getAttributeInternal(TOTAL);\n }", "public java.lang.Double getTotal () {\r\n\t\treturn total;\r\n\t}", "public Double getTotal() {\n return total;\n }", "public Double getTotal() {\n return total;\n }", "public Double getTotal() {\n return total;\n }", "public double getTotal() {\n return Total;\n }", "public double getTotal() {\r\n\t\treturn total;\r\n\t}", "public double getTotal() {\n\t\treturn total;\n\t}", "public Float getGrandTotal() {\r\n return grandTotal;\r\n }", "public Double getTotal() {\n\t\treturn null;\n\t}", "public double getTotal(){\n return total;\n }", "public double getTotal (){ \r\n return total;\r\n }", "public BigDecimal getTotal() {\n return total;\n }", "public BigDecimal getTotal() {\n return total;\n }", "@Override\n public double getTotal() {\n return total;\n }", "public Float getSubTotal() {\r\n return subTotal;\r\n }", "public Float getFreemintotalprice() {\n return freemintotalprice;\n }", "public BigDecimal getTotalFee() {\n return totalFee;\n }", "public int getTotalFLOATS() {\n\t\treturn totalFLOATS;\n\t}", "public float getTcintmtotal()\r\n {\r\n return _tcintmtotal;\r\n }", "public double getTotal(){\n\t\tdouble Total = 0;\n\t\t\n\t\tfor(LineItem lineItem : lineItems){\n\t\t\tTotal += lineItem.getTotal();\t\n\t\t}\n\t\treturn Total;\n\t}", "public float floatValue() {\n return ( (Float) getAllele()).floatValue();\n }", "public void setTotal(float total) {\n this.total = total;\n }", "public Number getTotalNum() {\n return (Number) getAttributeInternal(TOTALNUM);\n }", "public Double getTotal();", "public float getValue()\r\n {\r\n return getSemanticObject().getFloatProperty(swps_floatValue);\r\n }", "public Integer total() {\n return this.total;\n }", "public double getTotalFasjabtel() {\n return this.totalFasjabtel;\n }", "float getAmount();", "public static float getValueFloat()\n {\n return Util.valueFloat;\n }", "public Total getTotal() {\r\n\t\treturn total;\r\n\t}", "final public float getFloatAttr() {\r\n\t\t\tif(mName.length() == 0)\r\n\t\t\t\treturn -1;\r\n\t\t\tif(mSaveAttr == null)\r\n\t\t\t\treturn getAttr(mName).Value;\r\n\t\t\treturn mSaveAttr.Value;\r\n\t\t}", "public float Total2(){\r\n\t\treturn Total2();\r\n\t}", "public float getAsFloat(){\n return (new Float(getAsCents()) / 100);\n }", "public float floatValue() {\n return this.value;\n }", "public float valorTotalItem()\r\n {\r\n float total = (produto.getValor() - (produto.getValor() * desconto)) * quantidade;\r\n return total;\r\n }", "public double getTotalValue(){\r\n return this.quantity * this.price;\r\n }", "public double getTotal() {\r\n\r\n return getSubtotal() + getTax();\r\n }", "public final ReadOnlyDoubleProperty totalProperty() {\n return total.getReadOnlyProperty();\n }", "public Float getFloatAttribute();", "public Long total() {\n return this.total;\n }", "public BigDecimal getFC_AMOUNT() {\r\n return FC_AMOUNT;\r\n }", "public Float getValue() {\n\t\treturn value;\n\t}", "public Float getValue() {\n\t\treturn value;\n\t}", "public float getFloatValue() {\n \t\treturn floatValue;\n \t}", "public double getTotalFactoringFee() {\n return totalFactoringFee;\n }", "public float getReturn()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(RETURN$0, 0);\r\n if (target == null)\r\n {\r\n return 0.0f;\r\n }\r\n return target.getFloatValue();\r\n }\r\n }", "public BigDecimal getTotalAmount() {\n return totalAmount;\n }", "float getValue();", "float getValue();", "float getValue();", "public float getValue() {\n return value_;\n }", "public Float getAmount() {\n\t\treturn amount;\n\t}", "public float getValue() {\n return value_;\n }", "public float floatValue()\n\t\t{\n\t\t\treturn (float) doubleValue();\n\t\t}", "public float getValue()\n\t{\n\t\treturn this.value;\n\t}", "public float getValue() {\n\t\treturn value;\n\t}", "public float getValue() {\n return value;\n }", "public int total() {\n return this.total;\n }", "public float floatValue() {\n return (float) m_value;\n }", "public Amount getAmountTotal() {\n return this.amountTotal;\n }", "public float floatValue() {\r\n return (float) intValue();\r\n }", "public long getPointsTotal()\n {\n return pointsTotal;\n }", "public double getTotale() {\n\t\t\treturn totale;\n\t\t}", "public int total() {\n return _total;\n }", "public Number getFee() {\n return (Number) getAttributeInternal(FEE);\n }", "double getTotal();", "public float floatValue() {\n\t\treturn (float) mDouble;\n\t}", "public Float getValue () {\r\n\t\treturn (Float) getStateHelper().eval(PropertyKeys.value);\r\n\t}", "public String getTotalProperty() {\n\t\tif (null != this.totalProperty) {\n\t\t\treturn this.totalProperty;\n\t\t}\n\t\tValueExpression _ve = getValueExpression(\"totalProperty\");\n\t\tif (_ve != null) {\n\t\t\treturn (String) _ve.getValue(getFacesContext().getELContext());\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public void setTotal(Double total);", "@Override\n public float getAmount() {\n return Float.parseFloat(inputAmount.getText());\n }", "public final float getValue() {\r\n\t\treturn value;\r\n\t}", "@Override\r\n public float floatValue() {\r\n return (float) this.m_current;\r\n }", "public BigDecimal getValorTotal() {\n\t\treturn itens.stream()\n\t\t\t\t.map(ItemDieta::getValorTotal)\n\t\t\t\t.reduce(BigDecimal::add)\n\t\t\t\t.orElse(BigDecimal.ZERO);\n\t}", "@Override\n\tpublic Integer getPayTotalFee() {\n\t\treturn getRealRegFee() + getRealTreatFee();\n\t}", "public double totalprice()\n {\n \tthis.caltotalprice();\n \tdouble res = Math.round(mTotalPrice);\n \t return res;\n }", "public int totalValue() {\r\n\t\tint total = 0;\r\n\t\tfor(Item item: items) {\r\n\t\t\ttotal = total + item.getValue();\r\n\t\t}\r\n\t\treturn total;\r\n\t}", "private CharSequence calculateTotalPrice() {\n float totalPrice = 0.0f;\n totalPrice += UserScreen.fishingRodQuantity * 25.50;\n totalPrice += UserScreen.hockeyStickQuantity * 99.99;\n totalPrice += UserScreen.runningShoesQuantity * 85.99;\n totalPrice += UserScreen.proteinBarQuantity * 5.25;\n totalPrice += UserScreen.skatesQuantity * 50.79;\n return Float.toString(totalPrice);\n }", "@Override\r\n\tpublic int precioTotal() {\n\t\treturn this.precio;\r\n\t}", "public Double getTotalBuyFee() {\r\n return totalBuyFee;\r\n }", "public double getImportTotal() {\n return import_total;\n }", "public long getTotal() { return total; }", "public long getTotal() { return total; }", "public float floatValue() {\n return (float) value;\n }", "public BigDecimal getValorTotal() {\r\n \treturn valorUnitario.setScale(5, BigDecimal.ROUND_HALF_EVEN).multiply(quantidade.setScale(3, BigDecimal.ROUND_HALF_EVEN)).setScale(3, BigDecimal.ROUND_DOWN).subtract(valorDesconto).setScale(3, BigDecimal.ROUND_HALF_EVEN);\r\n }", "public int getTotalValue() {\n\t\tint totalValue = 0;\n\t\tfor(Items temp : this.getAnchors()) {\n\t\t\tif (temp == null)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\ttotalValue = totalValue + temp.getTotalValue();\n\t\t}\n\t\treturn totalValue;\n\t}", "public double getPDPTotalCurrent() { return totalCurrent; }", "public long getTotal() {\n return total;\n }", "public long getTotal() {\n return total;\n }", "public Float getDeliveryfee() {\n return deliveryfee;\n }", "public BigDecimal getsaleamt() {\n return (BigDecimal) getAttributeInternal(SALEAMT);\n }", "public String getFormatTotal (){\r\n DecimalFormat formatter = new DecimalFormat(\"$###,###.00\");\r\n String formatTotal = formatter.format(total);\r\n return formatTotal; \r\n }", "public String getRealTotalCost() {\n return this.RealTotalCost;\n }", "@Override\r\n\tpublic float valorFinal() {\n\t\treturn 0;\r\n\t}", "public float getPrezzoTotale() {\n return prezzoTotale;\n }" ]
[ "0.81140846", "0.80157375", "0.79003125", "0.773294", "0.76815146", "0.73568285", "0.73132354", "0.73132354", "0.73132354", "0.72820425", "0.7266224", "0.72381175", "0.7168824", "0.7137507", "0.7093925", "0.70561904", "0.7031571", "0.7031571", "0.7026145", "0.7005204", "0.6971384", "0.69524497", "0.6905809", "0.68403804", "0.6790642", "0.67861444", "0.6785686", "0.678386", "0.6777337", "0.6766055", "0.67633855", "0.6761434", "0.6755379", "0.6753441", "0.67373294", "0.6722226", "0.6710533", "0.6699991", "0.66922045", "0.6677172", "0.66584915", "0.665695", "0.66483295", "0.66480744", "0.6643044", "0.66352904", "0.6627108", "0.6627108", "0.6624357", "0.66186816", "0.66084033", "0.6597532", "0.6596711", "0.6596711", "0.6596711", "0.65912354", "0.6584726", "0.6574618", "0.65733963", "0.6571044", "0.6565857", "0.65649325", "0.6559695", "0.6558107", "0.65578806", "0.6557058", "0.65458137", "0.6542907", "0.6539873", "0.65325725", "0.6519505", "0.6512812", "0.6511007", "0.6508751", "0.6500888", "0.6499529", "0.64917326", "0.6480882", "0.6473256", "0.6472391", "0.64714634", "0.6462874", "0.64539146", "0.6446983", "0.6444037", "0.6435304", "0.6433338", "0.6433338", "0.64316213", "0.64254516", "0.64244455", "0.64172655", "0.6417026", "0.6417026", "0.64062697", "0.6398263", "0.6395996", "0.6382947", "0.63813615", "0.63687134" ]
0.7949301
2
Returns the value of the 'Is Critical' attribute. If the meaning of the 'Is Critical' attribute isn't clear, there really should be more of a description here...
Boolean getIsCritical();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Criticality getCriticality() {\n return criticality;\n }", "@JsonProperty(\"criticality\")\r\n @JacksonXmlProperty(localName = \"criticality\", isAttribute = true)\r\n public String getCriticality() {\r\n return criticality;\r\n }", "public String criticality() {\n\t\tif (crit_H > 0)\n\t\t\treturn \"1\";\n\t\tif (crit_M > 0)\n\t\t\treturn \"2\";\n\t\tif (crit_L > 0)\n\t\t\treturn \"3\";\n\t\treturn \"4\";\n\t}", "public boolean isCheckForCrit() {\n return checkForCrit;\n }", "public boolean isCriticalStop() {\n return criticalStop;\n }", "public YangEnumeration getCriticalActionValue() throws JNCException {\n YangEnumeration criticalAction = (YangEnumeration)getValue(\"critical-action\");\n if (criticalAction == null) {\n criticalAction = new YangEnumeration(\"ignore\", new String[] { // default\n \"none\",\n \"reject\",\n \"ignore\",\n });\n }\n return criticalAction;\n }", "public boolean isCriticalPath(){\n return this.criticalPath;\n }", "public YangUInt8 getCriticalOnsetValue() throws JNCException {\n YangUInt8 criticalOnset = (YangUInt8)getValue(\"critical-onset\");\n if (criticalOnset == null) {\n criticalOnset = new YangUInt8(\"90\"); // default\n }\n return criticalOnset;\n }", "double getCritChance();", "public YangUInt8 getCriticalAbateValue() throws JNCException {\n YangUInt8 criticalAbate = (YangUInt8)getValue(\"critical-abate\");\n if (criticalAbate == null) {\n criticalAbate = new YangUInt8(\"85\"); // default\n }\n return criticalAbate;\n }", "public int CriticalHitCheck(int creatureSkill){\n \tcriticalChance = genRandom.nextInt(100);\n \tif(criticalChance <= creatureSkill){\n \t\tLog.write(\"A CRITICAL HIT!\");\n \t\treturn 2;\n \t}\n \treturn 1;\n }", "public final Boolean getPriCus() {\n return this.priCus;\n }", "public Integer getRiskWarning() {\n return riskWarning;\n }", "boolean hasHas_certainty();", "boolean canCrit();", "public boolean isColiisionDamageWavier() {\r\n return coliisionDamageWavier;\r\n }", "public double getReliability() {\r\n return reliability;\r\n }", "@JsonProperty(\"criticality\")\r\n @JacksonXmlProperty(localName = \"criticality\", isAttribute = true)\r\n public void setCriticality(String criticality) {\r\n this.criticality = criticality;\r\n }", "public static boolean isCritical(int optionNumber) {\n\t\treturn (optionNumber & 1) == 1;\n\t}", "public int getCertainty() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e3 in method: android.telephony.SmsCbCmasInfo.getCertainty():int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telephony.SmsCbCmasInfo.getCertainty():int\");\n }", "public String getSat_critical_reading_avg_score() {\n return sat_critical_reading_avg_score;\n }", "public Boolean getIsEffective() {\n return isEffective;\n }", "public Confidentiality getConfidentiality() {\n return confidentiality;\n }", "public Integer getIsCert() {\n\t\treturn isCert;\n\t}", "@Override\n public int getEngineCritHeat() {\n int engineCritHeat = 0;\n if (!isShutDown() && getEngine().isFusion()) {\n engineCritHeat += 5 * getHitCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_CT);\n engineCritHeat += 5 * getHitCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_LT);\n engineCritHeat += 5 * getHitCriticals(CriticalSlot.TYPE_SYSTEM, Mech.SYSTEM_ENGINE, Mech.LOC_RT);\n }\n return engineCritHeat;\n }", "public boolean isCommodityRequiredIndicator() {\n return commodityRequiredIndicator;\n }", "public T getAbsoluteCriticalValue() {\n return absoluteCriticalValue;\n }", "public Character getCertifiedFlag() {\n return certifiedFlag;\n }", "public void setCriticalStop(boolean criticalStop) {\n this.criticalStop = criticalStop;\n }", "public String getConclusion() {\n\t\treturn conclusion;\n\t}", "public boolean hasPrimaryImpact() {\n return ((bitField0_ & 0x00000010) != 0);\n }", "public boolean isCritter() {\n\t\treturn critter != null;\n\t}", "public boolean hasSeverity() {\n return fieldSetFlags()[2];\n }", "public PairContainer getCriticalPairs() {\r\n\t\treturn this.criticalPairs;\r\n\t}", "public int NumCrits() {\n return 1;\n }", "public Boolean getC3() {\n\t\treturn c3;\n\t}", "public boolean isClassical() {\n return this == CLASSICAL;\n }", "public boolean getTC() {\n return TC;\n }", "public T getSelectedCriticalValue() {\n return normalizedToValue(normalizedCriticalValue);\n }", "public java.lang.String getConfidential() {\n\t\treturn confidential;\n\t}", "public boolean isMet();", "boolean hasLiquidityIndicator();", "public boolean getTC() {\n return TC;\n }", "public boolean isSafety () {\n return this.safety;\n }", "public boolean getEffdatedOnly()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(EFFDATEDONLY$20);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(EFFDATEDONLY$20);\r\n }\r\n if (target == null)\r\n {\r\n return false;\r\n }\r\n return target.getBooleanValue();\r\n }\r\n }", "public String getConclusion() {\n return conclusion;\n }", "public String getcInterest() {\n return cInterest;\n }", "public EdGraGra getCriticalPairGraGra() {\r\n\t\treturn this.criticalPairGraGra;\r\n\t}", "public boolean isC() {\n return c;\n }", "@java.lang.Override\n public boolean hasPrimaryImpact() {\n return primaryImpact_ != null;\n }", "public Boolean getC11() {\n\t\treturn c11;\n\t}", "double getReliability();", "@Override\r\n\tpublic Integer getPropensity_trust_decile() {\n\t\treturn super.getPropensity_trust_decile();\r\n\t}", "public boolean isControllable() {\n return stats.isControllable();\n }", "boolean isMet();", "public boolean isChemical() {\n return chemical;\n }", "public abstract Boolean isImportant();", "public boolean getExempt();", "public float getSecurity() {\n return security;\n }", "public void addCriticalAbate() throws JNCException {\n setLeafValue(Epc.NAMESPACE,\n \"critical-abate\",\n null,\n childrenNames());\n }", "public Integer getConfidence() {\r\n\t\treturn confidence;\r\n\t}", "@Override\r\n\t\tpublic int threat() {\n\t\t\treturn state.getThreat();\r\n\t\t}", "public double calculateSpecificity() {\n final long divisor = trueNegative + falsePositive;\n if(divisor == 0) {\n return 0.0;\n } else {\n return trueNegative / (double)divisor;\n }\n }", "public double confidence() {\n return this.confidence;\n }", "public BigDecimal getCOVERING_ACC_CY() {\r\n return COVERING_ACC_CY;\r\n }", "Boolean getIndemnity();", "@Override\r\n\tpublic boolean wasIncident() {\r\n\t\tdouble random = Math.random()*100;\r\n\t\tif(random<=25) return true;\r\n\t\treturn false;\r\n\t}", "ObjectProperty<Double> criticalLowProperty();", "public int getWMCProtected(){\r\n\t\t \r\n\t\treturn mccabe.getWMCProtected();\t\t\r\n\t}", "public boolean isOverThreshold(){return isOverThreshold;}", "public String getExclusiveCopyrightFlag() {\n return (String)getAttributeInternal(EXCLUSIVECOPYRIGHTFLAG);\n }", "public Boolean getC8() {\n\t\treturn c8;\n\t}", "public Integer getCriticalSlackLimit()\r\n {\r\n return (m_criticalSlackLimit);\r\n }", "boolean hasHasInjurySeverity();", "public int getConfidence() {\n\t\treturn confidence;\r\n\t}", "public Boolean isAvisCourtier() {\r\n return avisCourtier;\r\n }", "@Override\r\n\tint check_sweetness() {\n\t\treturn 30;\r\n\t}", "public boolean hasTC() {\n return fieldSetFlags()[18];\n }", "public boolean isSetEffdatedOnly()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(EFFDATEDONLY$20) != null;\r\n }\r\n }", "ObjectProperty<Double> criticalHighProperty();", "public boolean securityStatus()\n {\n return m_bSecurity;\n }", "public float getStatusChange() {\n\t\treturn statusChance;\n\t}", "boolean isSetCit();", "@java.lang.Override\n public boolean getIsChulaStudent() {\n return isChulaStudent_;\n }", "public String getExcellent() {\n return excellent;\n }", "public double getConfidence() {\n\t\treturn confidence;\n\t}", "boolean hasMetricControl();", "public int getAlertness() {\n return 0;\n }", "boolean hasConstantValue();", "public String getInsured()\r\n\t{\r\n\t\treturn insured;\r\n\t}", "public boolean getIsInfected() {\n return isInfected;\n }", "public boolean isConstant() {\n\t\treturn this.isConstant;\n\t}", "@java.lang.Override\n public boolean getIsChulaStudent() {\n return isChulaStudent_;\n }", "@NoProxy\n @NoWrap\n @NoDump\n public boolean getSignificantChange() {\n return significantChange;\n }", "boolean isEstConditionne();", "public IfcPositiveLengthMeasure getThresholdThickness()\n\t{\n\t\treturn this.ThresholdThickness;\n\t}", "public static boolean wasCheatShown(Intent i){\n return i.getBooleanExtra(Is_Cheated,false);\n }", "public Confidence getConfidence() {\n return confidence;\n }", "default public boolean getSoundness() {\n if (getValidity()) {\n for (Proposition premise : getPremises()) {\n if (!premise.determineTruth()) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n }", "public boolean getMustUnderstand();" ]
[ "0.74092335", "0.70076287", "0.70061153", "0.64958864", "0.6446229", "0.6421934", "0.62796825", "0.61601645", "0.6042165", "0.583743", "0.582905", "0.5825632", "0.5819799", "0.57937026", "0.5762663", "0.5759257", "0.57585526", "0.5743712", "0.5726962", "0.5726085", "0.5699968", "0.5680329", "0.5642982", "0.56023926", "0.55684817", "0.5547457", "0.55274266", "0.5473983", "0.5460422", "0.5447392", "0.5404657", "0.53959066", "0.5388405", "0.53800386", "0.53693503", "0.5363725", "0.535351", "0.5351648", "0.5350908", "0.5327523", "0.5325409", "0.53237164", "0.53203684", "0.53189915", "0.53154325", "0.53140414", "0.5313967", "0.5297129", "0.5281167", "0.52764416", "0.5274976", "0.52685165", "0.526252", "0.5258822", "0.5254528", "0.52529556", "0.5246602", "0.5240073", "0.52311385", "0.5227914", "0.52270794", "0.5226654", "0.52228355", "0.5219263", "0.521894", "0.52096784", "0.520883", "0.51849425", "0.5183026", "0.5181102", "0.5173468", "0.51663935", "0.5164668", "0.51531327", "0.5141311", "0.5137258", "0.5120246", "0.5117764", "0.5117743", "0.5114596", "0.51123023", "0.51119846", "0.5110546", "0.51015276", "0.50990176", "0.5092462", "0.5087805", "0.50839055", "0.50837386", "0.5078573", "0.5068299", "0.5064923", "0.50602484", "0.50600284", "0.50579536", "0.5057001", "0.50543547", "0.5050905", "0.50441676", "0.50383365" ]
0.7929117
0
Returns the value of the 'Status Time' containment reference. If the meaning of the 'Status Time' containment reference isn't clear, there really should be more of a description here...
StatusTimeType getStatusTime();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Timestamp getStatusTime() {\n\t\treturn null;\n\t}", "public Boolean getTimeStatus()\n {\n return timeStatus;\n }", "@ApiModelProperty(\n value =\n \"Status of the time entry. By default a time entry is created with status of `ACTIVE`. A\"\n + \" `LOCKED` state indicates that the time entry is currently changing state (for\"\n + \" example being invoiced). Updates are not allowed when in this state. It will\"\n + \" have a status of INVOICED once it is invoiced.\")\n /**\n * Status of the time entry. By default a time entry is created with status of &#x60;ACTIVE&#x60;.\n * A &#x60;LOCKED&#x60; state indicates that the time entry is currently changing state (for\n * example being invoiced). Updates are not allowed when in this state. It will have a status of\n * INVOICED once it is invoiced.\n *\n * @return status StatusEnum\n */\n public StatusEnum getStatus() {\n return status;\n }", "public void setTimeStatus(Boolean timeStatus)\n {\n this.timeStatus = timeStatus;\n }", "public Timestamp getRecordStatusTime() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic String getTimerValueStatus() {\n\t\treturn \"this is the timer status!!\";\r\n\t}", "public void setStatusTime(Timestamp statusTime) {\n\t\t\n\t}", "public gov.ucore.ucore._2_0.TimeType getTime()\n {\n synchronized (monitor())\n {\n check_orphaned();\n gov.ucore.ucore._2_0.TimeType target = null;\n target = (gov.ucore.ucore._2_0.TimeType)get_store().find_element_user(TIME$2, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public int getMatchTime() {\n return getIntegerProperty(\"Time\");\n }", "public TimeEntry status(StatusEnum status) {\n this.status = status;\n return this;\n }", "public String getTime() {\n return this.time;\n }", "public Date time() {\n return _time;\n }", "public Date time() {\n return _time;\n }", "public Date time() {\n return _time;\n }", "public String getTime() {\n\t\treturn mTime;\n\t}", "public java.lang.Integer getTime() {\n return time;\n }", "public Integer getOnTime() {\n return onTime;\n }", "public java.lang.Integer getTime() {\n return time;\n }", "public Long getChecktime() {\n return checktime;\n }", "public EventTime getTime() {\n return this.time;\n }", "@javax.annotation.Nullable\n public Long getTime() {\n return time;\n }", "public Date getEventTime() {\n\t\treturn time;\n\t}", "public Time getTime() {\n return this.time; // returns the time associated with the task\n }", "public String getTime() {\r\n\t\treturn time;\r\n\t}", "public double getTime() {\n return this.time;\n }", "public String getFormattedTime() {\n return formattedTime;\n }", "public Long getTime() {\n return time;\n }", "public String getTime() {\n\t\treturn time;\n\t}", "@Override\r\n\tpublic long getTime() {\n\t\treturn this.time;\r\n\t}", "public java.util.Date getValidTime() {\r\n return validTime;\r\n }", "public Date getaTime() {\r\n return aTime;\r\n }", "public Time12 getTime()\n\t{\n\t\treturn time;\n\t}", "public java.lang.String getTime () {\n\t\treturn time;\n\t}", "public static TimeSheetStatus get(String status) {\n return lookup.get(status);\n }", "public String getTimeType() {\n\t\treturn timeType;\n\t}", "public String getValidtime() {\n return validtime;\n }", "public double getFullTime() {\n return fullTime_;\n }", "public Date getTime() {\n return mTime;\n }", "public double getFullTime() {\n return fullTime_;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "public String getTime() {\n return time;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "public long getTime() {\n return time_;\n }", "@Override\n\tpublic String getTime() {\n\t\treturn time;\n\t}", "com.google.protobuf.Timestamp getCurrentStateTime();", "public int getTime() {\n if (USE_SERIALIZABLE) {\n return childBuilder.getTime();\n } else {\n // @todo Replace with real Builder object if possible\n return convertNullToNOT_SET(childBuilderElement.getAttributeValue(\"time\"));\n }\n }", "public java.lang.String getTime() {\n java.lang.Object ref = time_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n time_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@java.lang.Override\n public long getTime() {\n return time_;\n }", "@Array({9}) \n\t@Field(25) \n\tpublic Pointer<Byte > ActiveTime() {\n\t\treturn this.io.getPointerField(this, 25);\n\t}", "public long getTime() {\r\n\t\treturn time;\r\n\t}", "@JsonGetter(\"time\")\r\n public String getTime() {\r\n return time;\r\n }", "public Date getTime() {\r\n\t\treturn time;\r\n\t}", "public long getPlayerTime ( ) {\n\t\treturn extract ( handle -> handle.getPlayerTime ( ) );\n\t}", "public int getLTime() {\n return lTime;\n }", "public long getTime() {\r\n \treturn time;\r\n }", "public java.lang.String getTime() {\n java.lang.Object ref = time_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n time_ = s;\n return s;\n }\n }", "public com.google.protobuf.ByteString\n getTimeBytes() {\n java.lang.Object ref = time_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n time_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Date getTime() {\r\n return time;\r\n }", "public Date getTime() {\r\n return time;\r\n }", "public Date getTime() {\r\n return time;\r\n }", "public Date getTime() {\n\t\treturn time;\n\t}", "public java.lang.String getTime() {\n java.lang.Object ref = time_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n time_ = s;\n return s;\n }\n }", "public int getTime() {\r\n return time;\r\n }", "com.google.protobuf.TimestampOrBuilder getCurrentStateTimeOrBuilder();", "public synchronized String getTime() {\n\t\treturn time;\n\t}", "public long getTime() {\n return _time;\n }", "public int getTime() {\n\t\treturn time;\n\t}", "public int getTime() {\n\t\treturn time;\n\t}", "@JsonProperty(\"time\")\n public String getTime() {\n return time;\n }", "public long getTime() {\n return time;\n }", "public double getTime() {\n\t\treturn this.completedTime;\n\t}", "public long getTimerTime() {\n return timerTime;\n }", "public Date getcTime() {\r\n return cTime;\r\n }", "public short getStatus()\r\n {\r\n return statusObj.getValue();\r\n }", "public Date getTime() {\n return time;\n }", "public Date getTime() {\n return time;\n }", "public Date getTime() {\n return time;\n }", "public Date getTime() {\n return time;\n }", "public double getTime() { return time; }", "@java.lang.Override\n public boolean hasTime() {\n return instance.hasTime();\n }", "public boolean hasTime() {\n return fieldSetFlags()[0];\n }", "public LocalTime getOpeningTime() {\n return openingTime;\n }", "@Override\n public long getTime() {\n return time;\n }", "public java.lang.String getTime() {\n java.lang.Object ref = time_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n time_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int getTime() {\n return time;\n }", "public int getTime() {\n return time;\n }", "public int getTime() {\n return time;\n }", "public double getTime() {return _time;}", "@Override\n\tpublic String getWallTime() {\n\t\treturn model.getWallTime();\n\t}", "public Calendar getTime () {\n return this.time;\n }", "BusinessCenterTime getValuationTime();", "public Timer getTime() {\n\t\treturn time;\n\t}" ]
[ "0.70811707", "0.7030612", "0.6740373", "0.6520798", "0.64010453", "0.6245732", "0.6048209", "0.6034907", "0.60044515", "0.59475386", "0.5892596", "0.58798796", "0.58620214", "0.58620214", "0.5824688", "0.5808219", "0.58076537", "0.57937646", "0.57903296", "0.5774574", "0.5739247", "0.57279617", "0.5724026", "0.57112336", "0.57080835", "0.5700045", "0.5687607", "0.5677352", "0.56700265", "0.5666952", "0.56589127", "0.56567425", "0.5648481", "0.56431496", "0.5628978", "0.5624359", "0.5612545", "0.56072086", "0.5607096", "0.56067234", "0.56067234", "0.56067234", "0.56067234", "0.56067234", "0.56067234", "0.5602619", "0.5602619", "0.5600733", "0.5596756", "0.5596756", "0.5596756", "0.55871177", "0.557621", "0.5570661", "0.55705166", "0.5568134", "0.55672324", "0.55669135", "0.5562219", "0.5554211", "0.5550896", "0.55479133", "0.5546793", "0.55448836", "0.554162", "0.55408424", "0.55408424", "0.55408424", "0.55405027", "0.55379254", "0.55335766", "0.55299795", "0.55263805", "0.5517242", "0.55123097", "0.55123097", "0.5510149", "0.5499276", "0.54979205", "0.54976976", "0.5488837", "0.5484789", "0.5476639", "0.5476639", "0.5476639", "0.5476639", "0.5476514", "0.547641", "0.5475689", "0.5474984", "0.54724044", "0.54714906", "0.5470431", "0.5470431", "0.5470431", "0.5469818", "0.54695725", "0.5469483", "0.54611003", "0.5459079" ]
0.79283947
0
Returns the value of the 'Start Float' attribute. If the meaning of the 'Start Float' attribute isn't clear, there really should be more of a description here...
Double getStartFloat();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic float getStartValue() {\n\t\treturn value;\n\t}", "public double getStart() {\n return start;\n }", "public float getStartX() {return startX;}", "public double getStart();", "public Float getxBegin() {\r\n return xBegin;\r\n }", "public double getStartX() {\r\n return startx;\r\n }", "public float getMin()\n {\n parse_text(); \n return min;\n }", "public Float getFloatAttribute();", "public Float getStartMiles() {\n return startMiles;\n }", "public double getStartX() {\n\treturn v1.getX();\n }", "public float getMinFloat() {\n\t\treturn this.minFloat;\n\t}", "double getStartX();", "public double getStartX()\n {\n return startxcoord; \n }", "@UML(identifier=\"startParameter\", obligation=MANDATORY, specification=ISO_19123)\n double getStartParameter();", "public float getDistanceToStart() {\n\t\treturn distanceToStart;\n\t}", "public int getStartx(){\n\t\treturn startx;\n\t}", "org.hl7.fhir.Integer getStart();", "final public float getFloatAttr() {\r\n\t\t\tif(mName.length() == 0)\r\n\t\t\t\treturn -1;\r\n\t\t\tif(mSaveAttr == null)\r\n\t\t\t\treturn getAttr(mName).Value;\r\n\t\t\treturn mSaveAttr.Value;\r\n\t\t}", "public float getFirstNumber(){\n return firstNumber;\n }", "public float getValue()\r\n {\r\n return getSemanticObject().getFloatProperty(swps_floatValue);\r\n }", "public String getStart(){\n\t\treturn mStart;\n\t}", "public void setStartX(float startX) {this.startX = startX;}", "public float getMinimumFloat() {\n/* 212 */ return (float)this.min;\n/* */ }", "public Float getFloat(String attr) {\n return (Float) super.get(attr);\n }", "String getFloat_lit();", "public String getStartPoint()\n\t{\n\t\tString getStart;\n\t\tgetStart = (this.startPoint.xPosition + \",\" + this.startPoint.yPosition);\n\t\treturn getStart;\n\t}", "public Point getStart() {\n return mStart;\n }", "@Override\r\n public float floatValue() {\r\n return (float) this.m_current;\r\n }", "public double getStartLat() {\n\t\treturn startLat;\n\t}", "@Override\n public int getStart() {\n return feature.getStart();\n }", "float readFloat(int start)\n {\n int bits = readInt(start);\n\n return Float.intBitsToFloat(bits);\n }", "public float _getMin()\r\n {\r\n if (valueClass.equals(Float.class))\r\n {\r\n return (getMinimum() / max);\r\n } else\r\n {\r\n return getMinimum();\r\n }\r\n }", "public Float getT1B11Fmin() {\r\n return t1B11Fmin;\r\n }", "public int getStartX() {\r\n\t\treturn startX;\r\n\t}", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}", "float getEFloat();", "public Float getxEnd() {\r\n return xEnd;\r\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn \"float\";\r\n\t}", "public Point getStart() {\n\t\treturn _start;\n\t}", "public BigInteger getStartValue()\r\n {\r\n return this.startValue;\r\n }", "public Integer getStartMark() {\n return startMark;\n }", "float getValue();", "float getValue();", "float getValue();", "public Double getStartprice() {\r\n return startprice;\r\n }", "double getMin() {\n\t\t\treturn value_min;\n\t\t}", "public double getScaleStart() {\n\t\treturn m_dScaleStart;\n\t}", "public String getStart() {\r\n\t\treturn this.start;\r\n\t}", "public float floatValue() {\n\t\treturn (float) mDouble;\n\t}", "public void setStartX(double val) {\r\n startx = val;\r\n }", "@Nullable\n public DpProp getStart() {\n if (mImpl.hasStart()) {\n return DpProp.fromProto(mImpl.getStart());\n } else {\n return null;\n }\n }", "public Position getStart() {\r\n return start;\r\n }", "public String getStart(){\n\t\treturn start;\n\t}", "public static float getFloatProperty(String key) {\r\n\t\treturn getFloatProperty(key, 0);\r\n\t}", "public WeightedPoint getStart()\n {\n return map.getStart();\n }", "public float floatValue()\n\t\t{\n\t\t\treturn (float) doubleValue();\n\t\t}", "public double getStartingDistance() {\n return myStartDistance;\n }", "public double getStartAngle() {\n return startAngle;\n }", "public double getDistanceToStart() {\r\n return startDistance;\r\n }", "public float getMinValue();", "public static float getValueFloat()\n {\n return Util.valueFloat;\n }", "public float readFloat() {\n return Float.parseFloat(readNextLine());\n }", "public String getStart() {\n return start;\n }", "public int getStart ()\r\n {\r\n return glyph.getBounds().x;\r\n }", "public int getStartField()\n {\n return this.startField;\n }", "public static int getStartXCoordinate(){\n\t\tint x = getThymioStartField_X(); \n\t\t\n\t\tif(x == 0){\n\t\t\n \t}else{\n \t x *= FIELD_HEIGHT;\n \t}\n \t\n\t\treturn x ;\n\t}", "public float floatValue() {\r\n return (float) intValue();\r\n }", "public float floatValue() {\n return this.value;\n }", "double getFloatingPointField();", "public double getStartTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTTIME$22);\r\n if (target == null)\r\n {\r\n return 0.0;\r\n }\r\n return target.getDoubleValue();\r\n }\r\n }", "public int getStart() {\r\n\t\treturn start;\r\n\t}", "Double getTotalFloat();", "public java.lang.Short getStartDigitPosition() {\r\n return startDigitPosition;\r\n }", "public float getMandatoryFloat(String key) throws ConfigNotFoundException;", "public float getStartTime()\r\n\t{\r\n\t\tif (starttime != null)\r\n\t\t\treturn starttime.getTimeInMillis();\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "private double getStartX() {\n\t\treturn Math.min(x1, x2);\n\t}", "public float getValue() {\n return value_;\n }", "public Float getValue () {\r\n\t\treturn (Float) getStateHelper().eval(PropertyKeys.value);\r\n\t}", "public float getMinOffset() {\n return this.mMinOffset;\n }", "public int getStart() {\n\t\treturn start;\n\t}", "public float get_float() {\n return local_float;\n }", "public float getFloat(String key)\n {\n return getFloat(key, 0);\n }", "public int getStart() {\n\t\t\treturn start;\n\t\t}", "public float floatValue() {\n return ( (Float) getAllele()).floatValue();\n }", "public float getStartAlpha() {\n return startAlpha;\n }", "public float getLatitudeValue (){\n return trackLat.getValue ();\n }", "public float getValue() {\n return value;\n }", "public float getFloat(String key) {\n\t\tfloat defaultValue = 0;\n\t\tif (getDefault(key) != null)\n\t\t\tdefaultValue = (Float) getDefault(key);\n\t\tString sp = internal.getProperty(key);\n\t\tif (sp == null) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\tfloat value;\n\t\ttry {\n\t\t\tvalue = Float.parseFloat(sp);\n\t\t} catch (NumberFormatException ex) {\n\t\t\tsetFloat(key, defaultValue);\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn value;\n\t}", "public Float getValue() {\n\t\treturn value;\n\t}", "public Float getValue() {\n\t\treturn value;\n\t}", "public Float getE1() {\r\n return e1;\r\n }", "public float getValue() {\n return value_;\n }", "public float floatValue() {\n return (float) value;\n }", "public int getStart() {\n return this.start;\n }", "public Point getStartPoint() {\n\t\treturn startPoint;\n\t}", "public float floatValue() {\n return (float) m_value;\n }", "Double getFinishFloat();", "@Override\n public float nextFloat() {\n return super.nextFloat();\n }", "public Coordinate getStart( )\n\t{\n\t\treturn startLocation;\n\t}", "public float getFirstSSN(){\n\t\t return FirstSSN;\n\t\t }" ]
[ "0.7955357", "0.7130907", "0.70954305", "0.695513", "0.6945242", "0.690391", "0.68458545", "0.6764886", "0.6758722", "0.67358255", "0.6728445", "0.65594757", "0.65032715", "0.64761406", "0.6469955", "0.6402731", "0.6397222", "0.6394918", "0.63534546", "0.63133025", "0.63031614", "0.62857133", "0.62754524", "0.6271086", "0.6251714", "0.6219938", "0.6199389", "0.61964726", "0.61889595", "0.61823714", "0.61795795", "0.6167326", "0.6157091", "0.6149487", "0.6148358", "0.6144315", "0.6138687", "0.61255795", "0.6114788", "0.6111874", "0.6105117", "0.6095561", "0.6095561", "0.6095561", "0.6085241", "0.6080085", "0.606656", "0.60655886", "0.60642153", "0.6052617", "0.6052033", "0.60360533", "0.60274625", "0.60206944", "0.60015327", "0.5995168", "0.5990539", "0.5975941", "0.5974515", "0.5973419", "0.5957362", "0.5955137", "0.5953258", "0.59474736", "0.59462416", "0.59448683", "0.5927259", "0.59232223", "0.5920439", "0.5917566", "0.5900841", "0.5897987", "0.5894341", "0.5894019", "0.58939683", "0.5891603", "0.589139", "0.5886707", "0.5884915", "0.5884643", "0.5883085", "0.588202", "0.5877189", "0.5875701", "0.5873778", "0.5872703", "0.5862809", "0.58611953", "0.5859719", "0.5859719", "0.58586717", "0.58465105", "0.5842584", "0.58424485", "0.5838478", "0.5828936", "0.58246344", "0.5821577", "0.5820042", "0.58072114" ]
0.84150547
0
Returns the value of the 'Finish Float' attribute. If the meaning of the 'Finish Float' attribute isn't clear, there really should be more of a description here...
Double getFinishFloat();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getFinishTime(){return finishTime;}", "public Duration getFinishVariance()\r\n {\r\n return (m_finishVariance);\r\n }", "ActualFinishType getActualFinish();", "public Date getActualFinish()\r\n {\r\n return (m_actualFinish);\r\n }", "@Override\n\tpublic String getFinishTime() {\n\t\treturn finishTime;\n\t}", "final public float getFloatAttr() {\r\n\t\t\tif(mName.length() == 0)\r\n\t\t\t\treturn -1;\r\n\t\t\tif(mSaveAttr == null)\r\n\t\t\t\treturn getAttr(mName).Value;\r\n\t\t\treturn mSaveAttr.Value;\r\n\t\t}", "Double getStartFloat();", "public float getReturn()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(RETURN$0, 0);\r\n if (target == null)\r\n {\r\n return 0.0f;\r\n }\r\n return target.getFloatValue();\r\n }\r\n }", "double getStaEnd();", "public Float getProfundidadFinal() {\r\n\t\treturn profundidadFinal;\r\n\t}", "public synchronized float getProgressFloat() {\n BigDecimal bigDecimal = BigDecimal.valueOf(mProgress);\n return bigDecimal.setScale(mScale, BigDecimal.ROUND_HALF_UP).floatValue();\n }", "public Integer getIsfinish() {\n return isfinish;\n }", "public float getLastValue() {\n // ensure float division\n return ((float)(mLastData - mLow))/mStep;\n }", "Double getTotalFloat();", "float getValue();", "float getValue();", "float getValue();", "public java.lang.String getFinishCondition() {\n return finishCondition;\n }", "public Float getxEnd() {\r\n return xEnd;\r\n }", "public float getValue()\r\n {\r\n return getSemanticObject().getFloatProperty(swps_floatValue);\r\n }", "@Override\r\n\tpublic float valorFinal() {\n\t\treturn 0;\r\n\t}", "public java.lang.Double getValorFinanciado() {\n return valorFinanciado;\n }", "public float getProgress() {\n // Depends on the total number of tuples\n return 0;\n }", "public double getStopTime()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STOPTIME$24);\r\n if (target == null)\r\n {\r\n return 0.0;\r\n }\r\n return target.getDoubleValue();\r\n }\r\n }", "public Float getEndMiles() {\n return endMiles;\n }", "public double getEnd() {\n return end;\n }", "public double getEnd();", "public void setFinishTime(double finishTime)\n\t{\n\t\tthis.finishTime = finishTime;\n\t}", "protected float findVoidValue(Grid grid) {\n float min = new MinMaxOperator(progressIndicator).findMin(grid);\n String voidValue = \"-9999\";\n while (Float.parseFloat(voidValue) >= min) {\n voidValue += \"9\";\n }\n return Float.parseFloat(voidValue);\n }", "public boolean getFinish(){\n\t\treturn finish;\n\t}", "public Float percentComplete() {\n return this.percentComplete;\n }", "@Override\n\tpublic float getEndTime() \n\t{\n\t\treturn _tend;\n\t}", "@Override\r\n public float floatValue() {\r\n return (float) this.m_current;\r\n }", "LateFinishType getLateFinish();", "public BidTime getFinishTime() {\r\n\t\treturn finishTime;\r\n\t}", "public Float getValue() {\n\t\treturn value;\n\t}", "public Float getValue() {\n\t\treturn value;\n\t}", "public Float getFinalPrice() {\n return finalPrice;\n }", "org.apache.xmlbeans.GDuration getDuration();", "public float getValue() {\n return value;\n }", "public final float getValue() {\r\n\t\treturn value;\r\n\t}", "public Number getPercentageComplete()\r\n {\r\n return (m_percentageComplete);\r\n }", "public int getFinishMinute() {\n return finishMinute;\n }", "public double getPercentCompleted() {\n\t\treturn -1;\n\t}", "@Override\n\tpublic float getStartValue() {\n\t\treturn value;\n\t}", "Float getStatus();", "public float getValue() {\n return value_;\n }", "public Float getFloatAttribute();", "public float getValue() {\n\t\treturn value;\n\t}", "public float getBugReportProgress() {\n return (float) mBugReportProgress.get();\n }", "public float getValue() {\n return value_;\n }", "public double getFlete(){\n return localFlete;\n }", "public Duration getActualWork()\r\n {\r\n return (m_actualWork);\r\n }", "public void setFinishVariance(Duration finishVariance)\r\n {\r\n m_finishVariance = finishVariance;\r\n }", "public float getValue()\n\t{\n\t\treturn this.value;\n\t}", "@FloatRange(from = 0, to = 1) float getProgress();", "public Float getOutUtilization() {\r\n return outUtilization;\r\n }", "public static float getValueFloat()\n {\n return Util.valueFloat;\n }", "@Override\n public int getFinishLevel() {\n return finishLevel;\n }", "public float getDescent() {\n Object value = library.getObject(entries, DESCENT);\n if (value instanceof Number) {\n return ((Number) value).floatValue();\n }\n return 0.0f;\n }", "float getEstimatedTime() {\n return estimated_time;\n }", "@Override\n public final Float getForfeit() {\n return _forfeit;\n }", "float getEvaluationResult();", "public Float completionPercent() {\n return this.completionPercent;\n }", "Double getActualDuration();", "public Date getGmtFinish() {\n return gmtFinish;\n }", "public float getCost() {\n if (categoryIdentifier == AppController.periodicCategoryIdentifier) {\n if (pCostEt.getText().toString().isEmpty())\n return -100;\n cost = Float.valueOf(pCostEt.getText().toString());\n } else {\n if (fCostEt.getText().toString().isEmpty())\n return -100;\n cost = Float.valueOf(fCostEt.getText().toString());\n }\n return cost;\n }", "public float getFloatValue() {\n \t\treturn floatValue;\n \t}", "public abstract float getValue();", "public Date getBaselineFinish()\r\n {\r\n return (m_baselineFinish);\r\n }", "public Float getValue () {\r\n\t\treturn (Float) getStateHelper().eval(PropertyKeys.value);\r\n\t}", "public float getFloat(String name, float defaultValue)\n/* */ {\n/* 984 */ String value = getString(name);\n/* 985 */ if (value == null) {\n/* 986 */ return defaultValue;\n/* */ }\n/* 988 */ return PApplet.parseFloat(value, defaultValue);\n/* */ }", "float getEmpty();", "public float floatValue() {\n return this.value;\n }", "public double getSecondsEnd() {\n return secondsEnd;\n }", "public String getDone() {\n return (isDone ? \"1\" : \"0\");\n }", "float calcularFinal(){\n return (calif1*0.3f)+(calif2*0.3f)+(calif3*0.4f);// debo agregar la f para que lo tome como float y no como double\r\n }", "public int getFin() {\r\n return fin;\r\n }", "public float getDuration()\n\t{\n\t\treturn duration;\n\t}", "public void setFinishTime() {\r\n\t\t\tthis.finishTime = RNG.MAXINT;\r\n\t\t}", "public long getAnimDuration() {\n return (long) (Settings.Global.getFloat(this.mContext.getContentResolver(), \"transition_animation_scale\", this.mContext.getResources().getFloat(17105053)) * 336.0f);\n }", "public int getFinishHour() {\n return finishHour;\n }", "public float bottom_clearance_GET()\n { return (float)(Float.intBitsToFloat((int) get_bytes(data, 28, 4))); }", "public DoubleExpression getProgress()\n {\n return progress;\n }", "public double getEndX() {\r\n return endx;\r\n }", "public java.lang.Float getEta() {\n return eta;\n }", "public float getDistanceToEnd() {\n\t\treturn distanceToEnd;\n\t}", "public float getProgress() {\r\n if (start == end) {\r\n return 0.0f;\r\n } else {\r\n return Math.min(1.0f, (pos - start) / (float)(end - start));\r\n }\r\n }", "public BigDecimal getTOTAL_DEFERRED_PROFIT() {\r\n return TOTAL_DEFERRED_PROFIT;\r\n }", "public OffsetDateTime finishTime() {\n return this.finishTime;\n }", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "public float floatValue() {\n\t\treturn (float) mDouble;\n\t}", "public float getCurrentValue() {\n return currentValue;\n }", "@java.lang.Override\n public int getFinishHour() {\n return finishHour_;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.math.BigDecimal getDuration() {\n return (java.math.BigDecimal)__getInternalInterface().getFieldValue(DURATION_PROP.get());\n }", "float getEFloat();", "public float getDuration() {\n\t\treturn duration;\n\t}", "public java.lang.Float getEta() {\n return eta;\n }", "public Float getInUtilization() {\r\n return inUtilization;\r\n }", "public float getProgress() throws IOException {\r\n\t\tif (start == totalend) {\r\n\t\t\treturn 0.0f;\r\n\t\t} else {\r\n\t\t\treturn Math.min(1.0f, ((getFilePosition() - start) + finishLen) / (float) totalend);\r\n\t\t}\r\n\t}" ]
[ "0.69917077", "0.6601391", "0.6575604", "0.62457585", "0.622157", "0.6124115", "0.60936826", "0.6087994", "0.60752237", "0.60399574", "0.6012749", "0.5984799", "0.5961754", "0.5935689", "0.5933895", "0.5933895", "0.5933895", "0.5914955", "0.5904688", "0.59033585", "0.5892975", "0.58919656", "0.588738", "0.58836424", "0.5865354", "0.5844141", "0.5837552", "0.5809594", "0.5761409", "0.57473624", "0.5701501", "0.56895465", "0.5679379", "0.5675336", "0.5669718", "0.5663643", "0.5663643", "0.5660795", "0.5659911", "0.56554204", "0.5654087", "0.56465757", "0.5640133", "0.56314516", "0.5624076", "0.56225127", "0.5621813", "0.5617529", "0.56150854", "0.5610497", "0.5602217", "0.5595738", "0.5583865", "0.5563685", "0.55616194", "0.5560321", "0.5558528", "0.55464077", "0.55461425", "0.5544348", "0.5497837", "0.5493449", "0.5481805", "0.54725844", "0.5470967", "0.5468311", "0.5463807", "0.5459526", "0.54581517", "0.5449823", "0.5438828", "0.5438265", "0.54350543", "0.5426491", "0.54155797", "0.5415289", "0.54102343", "0.54024893", "0.5399218", "0.5393812", "0.5383007", "0.53720933", "0.5367924", "0.5367191", "0.5365824", "0.5355452", "0.5348652", "0.53434515", "0.5331502", "0.53306097", "0.53304374", "0.5327362", "0.5319453", "0.53116137", "0.53088605", "0.5307799", "0.53026396", "0.5300689", "0.5296089", "0.5288906" ]
0.8542784
0
Returns the value of the 'Completion' attribute. If the meaning of the 'Completion' attribute isn't clear, there really should be more of a description here...
Double getCompletion();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public String getExpectedCompletion() {\n return this.bachelorCompletion;\r\n }", "public ID getCompletionStatus() { \r\n\t\tID retVal = this.getTypedField(20, 0);\r\n\t\treturn retVal;\r\n }", "public ID getRxa20_CompletionStatus() { \r\n\t\tID retVal = this.getTypedField(20, 0);\r\n\t\treturn retVal;\r\n }", "@DISPID(18)\r\n\t// = 0x12. The runtime will prefer the VTID if present\r\n\t@VTID(20)\r\n\tjava.lang.String completionStatus();", "public int getCompletionFlags() {\n return this.completionFlags;\n }", "public String getCompletionCode() {\n\t\treturn completionCode;\n\t}", "public java.lang.String getCompletionThreshold();", "Object getCompletionResult();", "public Float completionPercent() {\n return this.completionPercent;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isRanToCompletion() {\n return (java.lang.Boolean)__getInternalInterface().getFieldValue(RANTOCOMPLETION_PROP.get());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isRanToCompletion() {\n return (java.lang.Boolean)__getInternalInterface().getFieldValue(RANTOCOMPLETION_PROP.get());\n }", "public int getCompletionTime() {\n return this.completeTime;\n }", "public Timestamp\tgetCompletionDate();", "public Date getCompletionDate() {\r\n\t\treturn completionDate;\r\n\t}", "public CompletionState\n getCompletionState() \n {\n return CompletionState.Unfinished;\n }", "public final CountedCompleter<?> getCompleter()\n/* */ {\n/* 499 */ return this.completer;\n/* */ }", "public long getCompleted() { return completed; }", "public boolean getIsComplete() {\n return isComplete_;\n }", "public boolean get_task_completion()\n {\n return task_completion_boolean;\n }", "@Override\r\n public void setExpectedCompletion(String data) {\n this.bachelorCompletion = data;\r\n }", "public boolean getIsComplete() {\n return isComplete_;\n }", "public void onCompletion();", "boolean getIsComplete();", "public Double percentComplete() {\n return this.percentComplete;\n }", "public int completed() {\n return this.completed;\n }", "public Float percentComplete() {\n return this.percentComplete;\n }", "public String getSuggestion() {\n return (String)getAttributeInternal(SUGGESTION);\n }", "public Number getPercentageComplete()\r\n {\r\n return (m_percentageComplete);\r\n }", "public Boolean getComplete(){\n return complete;\n }", "@JsonProperty(\"completions\")\n public Integer getCompletions() {\n return completions;\n }", "@IcalProperty(pindex = PropertyInfoIndex.COMPLETED,\n todoProperty = true)\n public void setCompleted(final String val) {\n completed = val;\n }", "public Boolean isComplete() {\n return true;\n }", "public void completionActivated(AutocompletionEvent<T> e);", "@DISPID(8)\r\n\t// = 0x8. The runtime will prefer the VTID if present\r\n\t@VTID(12)\r\n\tjava.util.Date completionDateTime();", "public void setCompletionCode(String completionCode) {\n\t\tthis.completionCode = completionCode;\n\t}", "public void setCompletionThreshold(java.lang.String completionThreshold);", "@DISPID(9)\r\n\t// = 0x9. The runtime will prefer the VTID if present\r\n\t@VTID(13)\r\n\tjava.lang.String completionMachine();", "public CharSequence getCompletionHint() {\n/* 185 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public boolean isComplete( ) {\n\t\treturn complete;\n\t}", "public double getPercentCompleted() {\n\t\treturn -1;\n\t}", "public boolean isComplete() { \n return isComplete; \n }", "public boolean isComplete()\n {\n return getStatus() == STATUS_COMPLETE;\n }", "public void onCompletion(CountedCompleter<?> paramCountedCompleter) {}", "public MediaPlayer.OnCompletionListener getOnCompletionListener() {\n return completionListener;\n }", "public boolean getComplete(){\n return localComplete;\n }", "public boolean isComplete() {\r\n\t\treturn complete;\r\n\t}", "public final CountedCompleter<?> nextComplete()\n/* */ {\n/* */ CountedCompleter localCountedCompleter;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 675 */ if ((localCountedCompleter = this.completer) != null) {\n/* 676 */ return localCountedCompleter.firstComplete();\n/* */ }\n/* 678 */ quietlyComplete();\n/* 679 */ return null;\n/* */ }", "@Override\n\tpublic void onComplete(String arg0) {\n\n\t}", "public boolean isComplete() {\n return complete;\n }", "public boolean isComplete() {\n return complete;\n }", "public void complete(T paramT)\n/* */ {\n/* 632 */ setRawResult(paramT);\n/* 633 */ onCompletion(this);\n/* 634 */ quietlyComplete();\n/* 635 */ CountedCompleter localCountedCompleter; if ((localCountedCompleter = this.completer) != null) {\n/* 636 */ localCountedCompleter.tryComplete();\n/* */ }\n/* */ }", "public boolean isComplete() {\n\t\treturn false;\n\t}", "public interface CompletionHandler {\n void complete(String retValue);\n void complete();\n void setProgressData(String value);\n}", "Optional<URI> getCompleteURI() {\n return getCompensatorLink(\"complete\");\n }", "public String getProcessCompleted()\r\n\t{\r\n\t\treturn processCompleted;\r\n\t}", "public boolean isComplete();", "public void set_completed();", "public Instant getLastCompletion() {\n\t\treturn Last;\n\t}", "@IcalProperty(pindex = PropertyInfoIndex.PERCENT_COMPLETE,\n jname = \"percentComplete\",\n todoProperty = true)\n public void setPercentComplete(final Integer val) {\n percentComplete = val;\n }", "public void setThreadCompletionState(Boolean completionState) {\n this.threadComplete = completionState;\n }", "public boolean completed() {\n return completed;\n }", "public boolean isPerformingCompletion() {\n/* 545 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void onCompletion(Runnable callback)\n/* */ {\n/* 158 */ this.completionCallback = callback;\n/* */ }", "public void setCompletionEnabled(boolean isEnabled) {\n completionEnabled = isEnabled;\n }", "public synchronized void setComplete() {\n status = Status.COMPLETE;\n }", "public void setComplete(boolean complete) {\n\t\t\n\t}", "public String completionIcon() {\n return completionStatus ? \"[X]\" : \"[-]\";\n }", "public interface CompletionListener {\n\n /** Notifies the completion of \"ConnectDevice\" command. */\n void onConnectDeviceComplete();\n\n /** Notifies the completion of \"SendMessage\" echo command. */\n void onSendMessageComplete(String message);\n\n /** Notifies that the device is ready to receive Wi-Fi network credentials. */\n void onNetworkCredentialsRequested();\n\n /** Notifies that the device is ready to receive operational credentials. */\n void onOperationalCredentialsRequested(byte[] csr);\n\n /** Notifies the pairing status. */\n void onStatusUpdate(int status);\n\n /** Notifies the completion of pairing. */\n void onPairingComplete(int errorCode);\n\n /** Notifies the deletion of pairing session. */\n void onPairingDeleted(int errorCode);\n\n /** Notifies that the Chip connection has been closed. */\n void onNotifyChipConnectionClosed();\n\n /** Notifies the completion of the \"close BLE connection\" command. */\n void onCloseBleComplete();\n\n /** Notifies the listener of the error. */\n void onError(Throwable error);\n }", "private int getCompleteProgress()\n {\n int complete = (int)(getProgress() * 100);\n \n if (complete >= 100)\n complete = 100;\n \n return complete;\n }", "public Date getInspectionResultCompletionDate() {\n return inspectionResultCompletionDate;\n }", "public void setComplete(boolean isComplete) { \n this.isComplete = isComplete; \n }", "boolean isComplete() {\n return complete.get();\n }", "public interface AutoCompleter {\n \n /** Sets the callback that will be notified when items are selected. */\n void setAutoCompleterCallback(AutoCompleterCallback callback);\n\n /** \n * Sets the new input to the autocompleter. This can change what is\n * currently visible as suggestions.\n * \n * The returned Future returns true if the lookup for autocompletions\n * completed succesfully. True does not indicate autocompletions are\n * available. It merely indicates that the lookup completed.\n * \n * Because AutoCompleters are allowed to be asynchronous, one should\n * use Future.get or listen to the future in order to see when\n * the future has completed.\n */\n ListeningFuture<Boolean> setInput(String input);\n\n /**\n * Returns true if any autocomplete suggestions are currently available, based the data\n * that was given to {@link #setInput(String)}.\n */\n boolean isAutoCompleteAvailable();\n\n /** Returns a component that renders the autocomplete items. */\n JComponent getRenderComponent();\n\n /** Returns the currently selected string. */\n String getSelectedAutoCompleteString();\n\n /** Increments the selection. */\n void incrementSelection();\n \n /** Decrements the selection. */\n void decrementSelection();\n \n /** A callback for users of autocompleter, so they know when items have been suggested. */\n public interface AutoCompleterCallback {\n /** Notification that an item is suggested. */\n void itemSuggested(String autoCompleteString, boolean keepPopupVisible, boolean triggerAction);\n }\n\n}", "public java.lang.Boolean getIsIncomplete() {\n return isIncomplete;\n }", "public int getPercentageComplete() {\n\t\tlong rawPercentage = (100*(System.currentTimeMillis() - startingTime))/(duration);\n\t\treturn rawPercentage >= 100 ? 100 : (int) rawPercentage;\n\t}", "public final void propagateCompletion()\n/* */ {\n/* 598 */ CountedCompleter localCountedCompleter1 = this;CountedCompleter localCountedCompleter2 = localCountedCompleter1;\n/* */ int i;\n/* 600 */ do { while ((i = localCountedCompleter1.pending) == 0) {\n/* 601 */ if ((localCountedCompleter1 = (localCountedCompleter2 = localCountedCompleter1).completer) == null) {\n/* 602 */ localCountedCompleter2.quietlyComplete();\n/* 603 */ return;\n/* */ }\n/* */ }\n/* 606 */ } while (!U.compareAndSwapInt(localCountedCompleter1, PENDING, i, i - 1));\n/* */ }", "@ApiModelProperty(value = \"True if the auto order ran successfully to completion\")\r\n public Boolean isCompleted() {\r\n return completed;\r\n }", "public void setRanToCompletion(java.lang.Boolean value) {\n __getInternalInterface().setFieldValue(RANTOCOMPLETION_PROP.get(), value);\n }", "boolean isComplete();", "boolean isComplete();", "public int getOverallCompletionAmount() {\n\t\treturn Times;\n\t}", "public boolean isCompleted() {\n return this.completed;\n }", "public boolean isCompleted() {\r\n return completed;\r\n }", "public void setComplete(boolean param){\n \n // setting primitive attribute tracker to true\n localCompleteTracker =\n true;\n \n this.localComplete=param;\n \n\n }", "public boolean getSpreadPercentComplete()\r\n {\r\n return (m_spreadPercentComplete);\r\n }", "public Boolean getTaskCompletedOption() {\n return (Boolean) commandData.get(CommandProperties.TASKS_COMPLETED_OPTION);\n }", "public abstract boolean isComplete();", "public void setCompleted(boolean achievementCompleted) {\n\t\t\n\t\tcompleted = achievementCompleted;\n\t\t\n\t}", "public void setComplete(boolean complete) {\n }", "public void setRanToCompletion(java.lang.Boolean value) {\n __getInternalInterface().setFieldValue(RANTOCOMPLETION_PROP.get(), value);\n }", "public boolean hasIsComplete() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "@DISPID(14)\r\n\t// = 0xe. The runtime will prefer the VTID if present\r\n\t@VTID(20)\r\n\tjava.util.Date lastInstanceCompletionDateTime();", "public boolean is_completed();", "public boolean hasIsComplete() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean isCompleted() {\r\n return completed;\r\n }", "public void edit_task_completion(boolean completion_status)\n {\n task_completion_boolean = completion_status;\n }", "public boolean isCompleted() {\n return completed;\n }", "public String getProcessCompletedIn()\r\n\t{\r\n\t\treturn processCompletedIn;\r\n\t}", "public void setComplete(Boolean complete){\n this.complete = complete;\n }", "public final CountedCompleter<?> firstComplete()\n/* */ {\n/* */ int i;\n/* */ \n/* */ \n/* */ do\n/* */ {\n/* 649 */ if ((i = this.pending) == 0)\n/* 650 */ return this;\n/* 651 */ } while (!U.compareAndSwapInt(this, PENDING, i, i - 1));\n/* 652 */ return null;\n/* */ }" ]
[ "0.7393019", "0.73595935", "0.73112476", "0.72325665", "0.71926445", "0.6969349", "0.6850511", "0.67815924", "0.65359014", "0.6462296", "0.6458816", "0.6366721", "0.6174905", "0.6154256", "0.61278176", "0.6100004", "0.60856605", "0.6061714", "0.60357493", "0.6031344", "0.6013991", "0.5989609", "0.5949245", "0.5909213", "0.58963233", "0.58740115", "0.58686227", "0.586727", "0.5827291", "0.5775065", "0.57672197", "0.57373667", "0.5733823", "0.5724195", "0.5723534", "0.5672287", "0.5668817", "0.565676", "0.5654232", "0.56344134", "0.5611867", "0.56075907", "0.55838835", "0.55822784", "0.5544854", "0.5542309", "0.55382985", "0.55274", "0.5483311", "0.5483311", "0.5478335", "0.54657936", "0.5460468", "0.54519266", "0.5450247", "0.5442732", "0.54228747", "0.5419395", "0.5396185", "0.539373", "0.53863406", "0.53557354", "0.53536165", "0.5339639", "0.5329752", "0.5323927", "0.530216", "0.52918166", "0.5282428", "0.5272771", "0.5252069", "0.52366674", "0.52363896", "0.52296466", "0.5228074", "0.52264506", "0.52262896", "0.5224411", "0.52238154", "0.52238154", "0.52162814", "0.52148837", "0.52069116", "0.5204404", "0.519637", "0.51931214", "0.51924586", "0.5191114", "0.51829386", "0.51826674", "0.51773375", "0.5176943", "0.5176837", "0.51708984", "0.5160386", "0.51592934", "0.5154492", "0.515189", "0.5146327", "0.51313615" ]
0.723348
3
Default no args constructor
public InternetProductOption() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "defaultConstructor(){}", "void DefaultConstructor(){}", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "private Default()\n {}", "DefaultConstructor(int a){}", "private Instantiation(){}", "ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}", "public Generic(){\n\t\tthis(null);\n\t}", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "public Basic() {}", "TypesOfConstructor(){\n System.out.println(\"This is default constructor\");\n }", "Reproducible newInstance();", "public Constructor(){\n\t\t\n\t}", "public Employee()\n\t{\n\t\tthis(\"(2)Invoke Employee's overload constructor\");\n\t\tSystem.out.println(\"(3)Employee's no-arg constructor is invoked\");\n\t}", "@Test\n public void constructorDefault() {\n final CourseType courseType = new CourseType();\n\n assertNull(courseType.getId());\n assertNull(courseType.getName());\n assertNull(courseType.getPicture());\n assertNull(courseType.getPosition());\n assertNull(courseType.getStatus());\n assertNull(courseType.getCourses());\n assertNull(courseType.getAllowedDishes());\n }", "public lo() {}", "public no() {}", "O() { super(null); }", "public Method() {\n }", "public User() {\r\n this(\"\", \"\");\r\n }", "public Dog() {\n // Default constructor\n }", "public Demo3() {}", "Constructor() {\r\n\t\t \r\n\t }", "private SingleObject(){}", "private SingleObject()\r\n {\r\n }", "public Identity()\n {\n super( Fields.ARGS );\n }", "public SpeakerSerivceImpl() {\n\t\tSystem.out.println(\"No args in constructor\");\n\t}", "private static Constructor getZeroArgumentConstructor(Class cls) {\n \t\treturn ClassUtils.getConstructor(cls, new Class[] { }, zeroArgumentConstructors);\n \t}", "public Person() {}", "public AllDifferent()\n {\n this(0);\n }", "public StandardPipeline() {\n this(null);\n }", "public User(){\n this(null, null);\n }", "public Member() {}", "DefaultAttribute()\n {\n }", "public Curso() {\r\n }", "public DefaultNashRequestImpl() {\n\t\t\n\t}", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "public Clade() {}", "public Orbiter() {\n }", "public D() {}", "public FirstStepBuiltIn()\n {\n super(null);\n }", "public JsonFactory() { this(null); }", "public Pasien() {\r\n }", "private void __sep__Constructors__() {}", "MyEncodeableWithoutPublicNoArgConstructor() {}", "T newInstance(Object... args);", "private Sequence() {\n this(\"<Sequence>\", null, null);\n }", "public God() {}", "public static void main(String[] args) {\n\t\t\r\n\t\tdefaultconstructor d = new defaultconstructor();\r\n\tSystem.out.println(d.Age);\t\r\n\tSystem.out.println(d.Name);\r\n\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public Ruby() {}", "public Instance() {\n }", "public Main() {\r\n\t}", "public ObjectFactory() {\n\t}", "public Postoj() {}", "private ExampleVersion() {\n throw new UnsupportedOperationException(\"Illegal constructor call.\");\n }", "public ObjectFactory() {\r\n\t}", "public None()\n {\n \n }", "public native void constructor();", "public Parser()\n {\n //nothing to do\n }", "public Naive() {\n\n }", "private Ognl() {\n }", "public Demo() {\n\t\t\n\t}", "private CommandLine() {\n\t}", "public CyanSus() {\n\n }", "public TestUser() {//NOPMD\n }", "public GTFTranslator()\r\n {\r\n // do nothing - no variables to instantiate\r\n }", "public Vector() {\n construct();\n }", "public NameParser()\n {\n this(null);\n }", "public LifeComponent() {\n // call other constructor with null param\n this(null);\n }", "public Person() {\n\t\t\n\t}", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "protected abstract S createDefault();", "public Student() {\n//\t\tname = \"\";\n//\t\tage = 0;\n\t\t\n\t\t\n\t\t//call constructors inside of other constructors\n\t\tthis(999,0);\n\t}", "@Test\r\n\tpublic void test002_EmptyArgumentConstructor() {\r\n\t\tCustomer c = new Customer( \"\", \"\", \"\" );\r\n\t\tassertEquals( c.getId(), \"\" );\r\n\t\tassertEquals( c.getFirstName(), \"\" );\r\n\t\tassertEquals( c.getLastName(), \"\" );\r\n\t\tassertEquals( c.getContact(), \"\" );\r\n\t}", "public Main() {\n // Required empty public constructor\n }", "public Nodo() {\n\t\tthis(null, null);\n\t}", "public MyInteger( )\n {\n this( 0 );\n }", "public Data() {}", "public static void main(String[] args) {\n My obj2=new My(9);//--->called overloaded Constructor\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}", "public Chick() {\n\t}", "public prueba()\r\n {\r\n }", "protected SimpleMatrix() {}", "private Constructor<DefaultSimpleInterface> getConstructor() {\n try {\n return DefaultSimpleInterface.class.getConstructor();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "Member() {}", "public Member() {\r\n\t}", "public Data() {\n \n }", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public static void main(String[] args) {\n\r\n\t\tDefaultEx d = new DefaultEx();\r\n\t\tnew DefaultEx();\r\n\t\tSystem.out.println(\"Constructor Done\");\r\n\t}", "public Counter()\n {\n this(0);\n }", "private Ognl(){\n }", "public StubPrivateConstructorPair() {\r\n this(null, null);\r\n }", "public Person()\n {\n //intentionally left empty\n }", "public TennisCoach () {\n\t\tSystem.out.println(\">> inside default constructor.\");\n\t}", "default void init() {\n }", "public Produto() {}", "public BasicLineParser() {\n/* 99 */ this(null);\n/* */ }", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public Student(){}" ]
[ "0.85437375", "0.8417888", "0.7713263", "0.75716937", "0.7479238", "0.72587895", "0.7195075", "0.7179013", "0.71710545", "0.70731026", "0.7059592", "0.70247483", "0.696585", "0.6838911", "0.6704024", "0.6689609", "0.66885316", "0.66448087", "0.66342366", "0.6626244", "0.6609648", "0.6602706", "0.66013205", "0.65910965", "0.65879065", "0.6567745", "0.65653753", "0.65643346", "0.65480554", "0.65398467", "0.6534349", "0.65309364", "0.6528302", "0.6520168", "0.6515191", "0.64965403", "0.64963245", "0.6484863", "0.64772165", "0.64754605", "0.64737195", "0.6473541", "0.6455559", "0.645513", "0.6454601", "0.64492154", "0.64478314", "0.64317566", "0.64181656", "0.641262", "0.63974005", "0.639387", "0.6393013", "0.6382093", "0.6381456", "0.6375589", "0.63664144", "0.6361495", "0.63598657", "0.63568604", "0.6356371", "0.63528943", "0.6345343", "0.6341884", "0.6341", "0.63407964", "0.6338336", "0.63382304", "0.6337389", "0.6331872", "0.63308775", "0.633037", "0.6326571", "0.6310135", "0.6308882", "0.63033515", "0.6302135", "0.6292988", "0.62862575", "0.62847954", "0.6282732", "0.6280985", "0.6271166", "0.62651306", "0.6262568", "0.62622124", "0.62612605", "0.6258193", "0.6251875", "0.62485045", "0.6247559", "0.624514", "0.62431943", "0.62423116", "0.6241376", "0.6235232", "0.623322", "0.62316144", "0.62316144", "0.62316144", "0.6230837" ]
0.0
-1
below are ProductOption implemented methods TODO: implement this method
public Product[] getProductsArray () { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public UpdateProduct() {\n\t\tsuper();\t\t\n\t}", "public InternetProductOption() {\n\t}", "public String buildProductSelectOptions(String product) throws BaseException {\n listProductsCommand.invoke();\n\n List<String> productNames = extract(listProductsCommand.getProductsRet(), on(ProductDetails.class).getName());\n\n // TODO: This should be data driven!!\n productNames.remove(\"AIL.Base\");\n productNames.remove(\"AIL.Demo.TradePL.GenericQB\");\n\n listToOptionCommand.setOptionsArg(productNames);\n listToOptionCommand.setSelectedArg(product);\n listToOptionCommand.setUnknownOptionArg(\"Product?\");\n listToOptionCommand.invoke();\n\n return listToOptionCommand.getOptionMarkupRet();\n }", "ProductProperties productProperties();", "Product getPProducts();", "public String getProduct() {\r\n return this.product;\r\n }", "public addproduct() {\n\t\tsuper();\n\t}", "public String product() {\n return this.product;\n }", "public void setProduct(entity.APDProduct value);", "public static Product generateProduct()\n {\n Random r = new Random();\n Product p = new Product();\n String [] itemName = {\"Cool Hat\" , \"Cool Watch\" , \"Cool Necklace\", \"Black Lipstick\" , \"Red LipStick\" ,\n \"Black Eyeliner\" , \"Blue Shirt\" , \"Blue Jeans\" , \"Black Dress\" , \"Red Bag\" ,\n \"White Bag\" , \"Yellow Bag\" , \"Cool Flip Flops\", \"Cool Shoes\" , \"Cool Heels\" ,\n \"Cool Blender\" , \"Cool Mixer\" , \"Cool Juicer\" };\n p.productID = 1 + r.nextInt(6);\n\n if( p.productID == 1){\n p.productName = itemName[r.nextInt(3)];\n p.productType = (\"Accessory\");\n p.productSize = 1;\n }\n if( p.productID == 2) {\n p.productName = itemName[3 + r.nextInt(3)];\n p.productType = (\"Beauty\");\n p.productSize = 2;\n }\n if( p.productID == 3) {\n p.productName = itemName[6 + r.nextInt(3)];\n p.productType = (\"Clothes\");\n p.productSize = 2;\n }\n if( p.productID == 4){\n p.productName = itemName[9 + r.nextInt(3)];\n p.productType = (\"Bags\");\n p.productSize = 3;\n }\n if( p.productID == 5){\n p.productName = itemName[12 + r.nextInt(3)];\n p.productType = (\"Shoes\");\n p.productSize = 3;\n }\n if( p.productID == 6) {\n p.productName = itemName[15 + r.nextInt(3)];\n p.productType = (\"Housewares\");\n p.productSize = 5;\n }\n\n p.productSku = 1000000 + r.nextInt(9999999);\n\n\n\n\n return p;\n }", "public String getProduct() {\n return this.product;\n }", "String getProduct();", "Object getProduct();", "protected Product() {\n\t\t\n\t}", "public String getProduct()\n {\n return product;\n }", "@Override\r\n\tpublic int updateProductById(HashMap<String, Object> map) {\n\t\tProduct product = (Product) map.get(\"product\");\r\n\t\tdao.updateProductById(product);\r\n\t\tList<ProductOption> oldList = (List<ProductOption>) map.get(\"oldList\");\r\n\t\tfor(int idx=0; idx<oldList.size(); idx++){\r\n\t\t\toldList.get(idx).setProductId(product.getProductId());\r\n\t\t\tdao.updateProductOptionById(oldList.get(idx));\r\n\t\t}\r\n\t\tList<ProductOption> newList = (List<ProductOption>) map.get(\"newList\");\r\n\t\tif(map.get(\"newList\")!=null){\r\n\t\t\tfor(int idx=0; idx<newList.size(); idx++){\r\n\t\t\t\tnewList.get(idx).setProductId(product.getProductId());\r\n\t\t\t\toptionDao.insertOption(newList.get(idx));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif( map.get(\"image\")!=null){\r\n\t\t\tProductDetailImage image = ((ProductDetailImage) map.get(\"image\"));\r\n\t\t\tdao.updateDetailImageById(image);\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic HashMap<String, Object> selectProductById(String productId) {\n\t\tHashMap<String, Object> map = new HashMap<>();\r\n\t\tmap.put(\"product\", dao.selectProductById(productId));\r\n\t\tmap.put(\"optionList\", dao.selectOptionById(productId));\r\n\t\treturn map;\r\n\t}", "@Override\n\tpublic boolean addProduct(Product p) {\n\t\treturn false;\n\t}", "public void setProduct(String product) {\r\n this.product = product;\r\n }", "@Override\r\n\tpublic ProductOption selectOptionStockByName(String optionName, String productId)\r\n\t{\n\t\tHashMap<String, Object> map = new HashMap<>();\r\n\t\tmap.put(\"optionName\", optionName);\r\n\t\tmap.put(\"productId\", productId);\r\n\t\treturn dao.selectOptionStockByName(map);\r\n\t}", "@Override\n\tpublic boolean updateProduct(Product p) {\n\t\treturn false;\n\t}", "@Override\n public float getProductPrice() {\n return ProductPrice.REFLECTIONS_II_BOOSTER_PACK;\n }", "public String getProduct() {\n return product;\n }", "public String getProduct() {\n return product;\n }", "public void addProduct(){\n\t\tSystem.out.println(\"Company:\");\n\t\tSystem.out.println(theHolding.fabricationCompanies());\n\t\tint selected = reader.nextInt();\n\t\treader.nextLine();\n\t\tif(selected > theHolding.getSubordinates().size()-1){\n\t\t\tSystem.out.println(\"Please select a correct option\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Name:\");\n\t\t\tString name = reader.nextLine();\n\t\t\tSystem.out.println(\"Code:\");\n\t\t\tString code = reader.nextLine();\n\t\t\tSystem.out.println(\"Water quantity require:\");\n\t\t\tdouble waterQuantity = reader.nextDouble();\n\t\t\treader.nextLine();\n\t\t\tSystem.out.println(\"Inventory:\");\n\t\t\tint inventory = reader.nextInt();\n\t\t\treader.nextLine();\n\t\t\tProduct toAdd = new Product(name, code, waterQuantity, inventory);\n\t\t\ttheHolding.addProduct(selected, toAdd);\n\t\t\tSystem.out.println(\"The product were added successfuly\");\n\t\t}\n\t}", "@Override\r\n public void getProduct() {\r\n\r\n InventoryList.add(new Product(\"Prod1\", \"Shirt\", \"Each\", 10.0, LocalDate.of(2021,03,19)));\r\n InventoryList.add(new Product(\"Prod1\", \"Trousers\", \"Each\", 20.0, LocalDate.of(2021,03,21)));\r\n InventoryList.add(new Product(\"Prod1\", \"Trousers\", \"Each\", 20.0, LocalDate.of(2021,03,29)));\r\n }", "public interface Product {\n /**\n * Gets the id property: Fully qualified resource Id for the resource.\n *\n * @return the id value.\n */\n String id();\n\n /**\n * Gets the name property: The name of the resource.\n *\n * @return the name value.\n */\n String name();\n\n /**\n * Gets the type property: The type of the resource.\n *\n * @return the type value.\n */\n String type();\n\n /**\n * Gets the etag property: The entity tag used for optimistic concurrency when modifying the resource.\n *\n * @return the etag value.\n */\n String etag();\n\n /**\n * Gets the displayName property: The display name of the product.\n *\n * @return the displayName value.\n */\n String displayName();\n\n /**\n * Gets the description property: The description of the product.\n *\n * @return the description value.\n */\n String description();\n\n /**\n * Gets the publisherDisplayName property: The user-friendly name of the product publisher.\n *\n * @return the publisherDisplayName value.\n */\n String publisherDisplayName();\n\n /**\n * Gets the publisherIdentifier property: Publisher identifier.\n *\n * @return the publisherIdentifier value.\n */\n String publisherIdentifier();\n\n /**\n * Gets the offer property: The offer representing the product.\n *\n * @return the offer value.\n */\n String offer();\n\n /**\n * Gets the offerVersion property: The version of the product offer.\n *\n * @return the offerVersion value.\n */\n String offerVersion();\n\n /**\n * Gets the sku property: The product SKU.\n *\n * @return the sku value.\n */\n String sku();\n\n /**\n * Gets the billingPartNumber property: The part number used for billing purposes.\n *\n * @return the billingPartNumber value.\n */\n String billingPartNumber();\n\n /**\n * Gets the vmExtensionType property: The type of the Virtual Machine Extension.\n *\n * @return the vmExtensionType value.\n */\n String vmExtensionType();\n\n /**\n * Gets the galleryItemIdentity property: The identifier of the gallery item corresponding to the product.\n *\n * @return the galleryItemIdentity value.\n */\n String galleryItemIdentity();\n\n /**\n * Gets the iconUris property: Additional links available for this product.\n *\n * @return the iconUris value.\n */\n IconUris iconUris();\n\n /**\n * Gets the links property: Additional links available for this product.\n *\n * @return the links value.\n */\n List<ProductLink> links();\n\n /**\n * Gets the legalTerms property: The legal terms.\n *\n * @return the legalTerms value.\n */\n String legalTerms();\n\n /**\n * Gets the privacyPolicy property: The privacy policy.\n *\n * @return the privacyPolicy value.\n */\n String privacyPolicy();\n\n /**\n * Gets the payloadLength property: The length of product content.\n *\n * @return the payloadLength value.\n */\n Long payloadLength();\n\n /**\n * Gets the productKind property: The kind of the product (virtualMachine or virtualMachineExtension).\n *\n * @return the productKind value.\n */\n String productKind();\n\n /**\n * Gets the productProperties property: Additional properties for the product.\n *\n * @return the productProperties value.\n */\n ProductProperties productProperties();\n\n /**\n * Gets the compatibility property: Product compatibility with current device.\n *\n * @return the compatibility value.\n */\n Compatibility compatibility();\n\n /**\n * Gets the inner com.azure.resourcemanager.azurestack.fluent.models.ProductInner object.\n *\n * @return the inner object.\n */\n ProductInner innerModel();\n}", "public T getProduct() {\n return this.product;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public entity.APDProduct getProduct();", "@Override\r\n\tpublic int updateProduct(Product product) {\n\t\treturn 0;\r\n\t}", "@Override\n public Productor getProductor() {\n return new ProductorImp1();\n }", "public double getOptionPrice()\n {\n return optionPrice;\n }", "public Product Product() {\n return null;\n }", "@Override\n public void updateProductCounter() {\n\n }", "public void addProduct(Product p) {\n c.addProduct(p);\n }", "public void Addproduct(Product objproduct) {\n\t\t\n\t}", "public Option()\n {\n setOptionName(\"___\");\n setOptionPrice(9999.99);\n }", "public void setProduct(Product product) {\n this.product = product;\n }", "@Override\n\tpublic Product getProduct() {\n\t\treturn product;\n\t}", "public List<Product> getProductByOption(String op) {\n\t\treturn productDAO.getProductByOption(op);\r\n\t}", "protected Product()\n\t{\n\t}", "private static void actOnUsersChoice(MenuOption option) {\n switch (option) {\n case VIEW_LIST_OF_ALL_PRODUCTS:\n viewListOfProductsInStore();\n System.out.println(\"Store has \" + productRepository.count() + \" products.\");\n break;\n case CHECK_IF_PRODUCT_EXISTS_IN_STORE:\n System.out.println(ENTER_SEARCHED_PRODUCT_NAME);\n System.out.println((isProductAvailable())\n ? SEARCHED_PRODUCT_IS_AVAILABLE\n : ERROR_NO_SUCH_PRODUCT_AVAILABLE);\n break;\n case ADD_PRODUCT_TO_ORDER:\n addProductToOrder();\n break;\n case VIEW_ORDER_ITEMS:\n viewOrderItems(order.getOrderItems());\n break;\n case REMOVE_ITEM_FROM_ORDER:\n removeItemFromOrder();\n break;\n case ADD_PRODUCT_TO_STORE:\n if (userIsAdmin) {\n addProductToStore();\n }\n break;\n case EDIT_PRODUCT_IN_STORE:\n if (userIsAdmin) {\n System.out.println(ENTER_PRODUCT_NAME_TO_BE_UPDATED);\n Optional<Product> productToBeModified = getProductByName();\n\n if (productToBeModified.isPresent()) {\n switch (productToBeModified.get().getType()) {\n\n case FOOD:\n Optional<Food> food = InputManager.DataWrapper.createFoodFromInput();\n if (food.isPresent()) {\n Food newFood = food.get();\n productRepository.update(productToBeModified.get().getName(), newFood);\n }\n break;\n\n case DRINK:\n Optional<Drink> drink = InputManager.DataWrapper.createDrinkFromInput();\n if (drink.isPresent()) {\n Drink newDrink = drink.get();\n productRepository.update(productToBeModified.get().getName(), newDrink);\n }\n break;\n }\n } else {\n System.err.println(ERROR_NO_SUCH_PRODUCT_AVAILABLE);\n }\n }\n break;\n case REMOVE_PRODUCT_FROM_STORE:\n if (userIsAdmin) {\n tryToDeleteProduct();\n }\n break;\n case RELOG:\n userIsAdmin = false;\n start();\n break;\n case EXIT:\n onExit();\n break;\n default:\n break;\n }\n }", "@Override\n public String getProductName() {\n return ProductName.REFLECTIONS_II_BOOSTER_PACK;\n }", "public void setProductLine(entity.APDProductLine value);", "public java.lang.String getProduct() {\n return product;\n }", "public ProductType getProduct() {\n return product;\n }", "@Allow(Permission.UpdateCatalog)\n public Product addOptionGroupToProduct(Long productId, Long optionGroupId, DataFetchingEnvironment dfe) {\n ProductEntity productEntity = this.productService.addOptionGroupToProduct(productId, optionGroupId);\n return BeanMapper.map(productEntity, Product.class);\n }", "ProductPlan getProductPlan();", "public String getProductId() ;", "@Override\r\n\tpublic Product updateProduct(Product s) {\n\t\treturn null;\r\n\t}", "protected final Product getProduct() {\n Product.Builder product = new Product.Builder()\n .implementationTitle(getClass())\n .implementationVersion(getClass());\n Optional.ofNullable(getClass().getPackage())\n .flatMap(p -> Optional.ofNullable(p.getSpecificationVersion()))\n .map(specVersion -> \"(specification \" + specVersion + \")\")\n .ifPresent(product::comment);\n return product.build();\n }", "public boolean canBecombo(){\n \treturn super.getPrice() <4;\n }", "public void executeQBEAdvancedCriteria() {\n Session session = getSession();\n Transaction transaction = session.beginTransaction();\n\n // SELECT p.id, p.description, p.name, p.price, p.supplier_id, p.version, p.DTYPE, s.id, s.name\n // FROM Product p\n Criteria productCriteria = session.createCriteria(Product.class);\n\n // INNER JOIN Supplier s\n // ON p.supplier_id = s.id\n Criteria supplierCriteria = productCriteria.createCriteria(\"supplier\");\n\n // WHERE (s.name = 'SuperCorp')\n Supplier supplier = new Supplier();\n supplier.setName(\"SuperCorp\");\n\n supplierCriteria.add(Example.create(supplier));\n\n // AND (p.name LIKE 'M%')\n Product product = new Product();\n product.setName(\"M%\");\n\n Example productExample = Example.create(product);\n\n // TODO: Why must the price column be excluded?\n productExample.excludeProperty(\"price\");\n productExample.enableLike();\n\n productCriteria.add(productExample);\n\n displayProductsList(productCriteria.list());\n transaction.commit();\n }", "public SuperProduct() {\n\t\tsuper();\n\t}", "@Override\n\t\tpublic List<ProductInfo> getProducts() {\n\t\t\treturn TargetProducts;\n\t\t}", "public GetProductoSrv() {\n\t\tsuper();\n\t\tinitializer();\n\t}", "private void addProduct() {\n String type = console.readString(\"type (\\\"Shirt\\\", \\\"Pant\\\" or \\\"Shoes\\\"): \");\n String size = console.readString(\"\\nsize: \");\n int qty = console.readInt(\"\\nQty: \");\n int sku = console.readInt(\"\\nSKU: \");\n Double price = console.readDouble(\"\\nPrice: \");\n int reorderLevel = console.readInt(\"\\nReorder Level: \");\n daoLayer.addProduct(type, size, qty, sku, price, reorderLevel);\n\n }", "@Override\n protected void customize(final UserAgentBuilder builder) {\n List<Product> products = request.getProducts();\n if (products != null) {\n for (Product product : products) {\n builder.product(product);\n }\n }\n }", "protected String getProductId() {\n return productId;\n }", "public ProductImp() {\n insert(new Product(\"hammer\", 9.99));\n insert(new Product(\"screwdriver\", 9.99));\n insert(new Product(\"drill\", 19.99));\n }", "public List<Product> getProductByOption(String op, int startResult,\r\n\t\t\tint maxRows) {\n\t\treturn productDAO.getProductByOption(op, startResult, maxRows);\r\n\t}", "public void associateProductTemplate() {\n productToolOperation.addChildProductTree(selectProductNode, selectTemplateNode, planConfigBehavior);\n }", "@Override\n public void updateProduct(TradingQuote tradingQuote) {\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public entity.APDProductLine getProductLine();", "public String getProductLine() {\n return productLine;\n }", "@Override\n public String toString() {\n return product.toString() + \", Quantity: \" + quantity;\n }", "public void setProduct(java.lang.String product) {\n this.product = product;\n }", "public short getIdProduct() {\r\n\t\treturn idProduct;\r\n\t}", "x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product getProduct();", "public String getKind_of_product() {\r\n return kind_of_product;\r\n }", "@Override\n\tpublic Product getProduct() {\n\t\tSystem.out.println(\"B生产成功\");\n\t\treturn product;\n\t}", "public String getProductDescription() {\r\n/* 221 */ return this._productDescription;\r\n/* */ }", "@Override\n\tpublic void updateProduct(ProductVO vo) {\n\n\t}", "@Override\n\tpublic List<Product> selectAllProduct() {\n\t\treturn productMapper.selectAllProduct();\n\t}", "java.lang.String getProductDescription();", "public static ArrayList<Product> addProduct() {\r\n\r\n\t\tboolean proDiscontinued = false;\r\n\t\tboolean proInStock = false;\r\n\t\tint proQtyAvailable = 0;\r\n\r\n\t\tArrayList<Product> newProductArray = new ArrayList<Product>();\r\n\r\n\t\tSystem.out.println(\"---Product details---\");\r\n\r\n\t\tRandom proCodeRandom = new Random();\t\t\t\t\t\t\t\r\n\t\tint proCode = proCodeRandom.nextInt(100);\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the make of the product:\");\t\t\r\n\r\n\t\tString proMake = Validation.stringNoIntsValidation();\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the model of the product:\");\r\n\r\n\t\tString proModel = Validation.stringNoIntsValidation();\r\n\r\n\r\n\t\tSystem.out.println(\"Please enter the price of the product:\");\r\n\t\tdouble proPrice = Validation.doubleValidation();\r\n\r\n\t\tSystem.out.println(\"Is the product discontinued? y/n \");\r\n\r\n\t\tString answer = Validation.stringNoIntsValidation();\r\n\r\n\r\n\t\tif(answer.equals(\"y\") || answer.equals(\"Y\")) {\r\n\t\t\tproDiscontinued = true;\r\n\t\t\tSystem.out.println(\"How many products are available?\");\r\n\t\t\tproQtyAvailable = Validation.intValidation();\r\n\t\t\tif(proQtyAvailable <= 0) {\r\n\r\n\t\t\t\tproInStock = false;\r\n\t\t\t}else {\r\n\t\t\t\tproInStock = true;\r\n\t\t\t}\r\n\t\t}else if(answer.equals(\"n\") || answer.equals(\"N\")) {\r\n\t\t\tproDiscontinued = false;\r\n\t\t\tSystem.out.println(\"How many products are available?\");\r\n\t\t\tproQtyAvailable = Validation.intValidation();\r\n\t\t\tif(proQtyAvailable <= 0) {\r\n\t\t\t\tproInStock = false;\r\n\t\t\t}else {\r\n\t\t\t\tproInStock = true;\r\n\t\t\t}\r\n\t\t}\t\r\n\r\n\t\tProduct newProduct = new Product(proCode, proMake, proModel, proPrice, proInStock);\r\n\t\tnewProduct.setProQtyAvailable(proQtyAvailable);\r\n\t\tnewProduct.setProDiscontinued(proDiscontinued);\r\n\r\n\t\tnewProductArray.add(newProduct);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//The product is then added to the array list for the specified supplier\r\n\r\n\t\tSystem.out.println();\r\n\r\n\t\treturn newProductArray;\r\n\t}", "public void createProduct(ProductData newProduct) {\n throw new UnsupportedOperationException();\n }", "public void alg_REQAlg(){\r\nswitch (productIndex.value){\r\ncase 0:\r\r\n\tprice.value=10;\r\r\ncase 1:\t\r\r\n\tprice.value=20;\r\r\ncase 2:\r\r\n\tprice.value=30;\r\r\ndefault:\r\n\tprice.value=1;\r\r\n}\r\n}", "public String getProductEdition();", "public void setOptionPrice(double optionPrice)\n {\n this.optionPrice = optionPrice;\n }", "public interface Product {\n\n void productSpec();\n}", "java.lang.String getProductCode();", "private void getAllProducts() {\n }", "public GiftCardProductQuery options(CustomizableOptionInterfaceQueryDefinition queryDef) {\n startField(\"options\");\n\n _queryBuilder.append('{');\n queryDef.define(new CustomizableOptionInterfaceQuery(_queryBuilder));\n _queryBuilder.append('}');\n\n return this;\n }", "private Set<Product> getProductSet(Product product) {\n\t\treturn get(product.getType(), product.getState(), product.getItemId());\n\t}", "public org.mrk.grpc.catalog.ProductOrBuilder getProductOrBuilder() {\n return getProduct();\n }", "@Override\n\tpublic boolean update(ProductCategory procate) {\n\t\treturn false;\n\t}", "public void setPriceMode(final ProductPriceModeEnum priceMode);", "public static void main(String[] args) {\n\t Product a = new Product(123, \"Shiseido Face Cream\", 85.00 , 2);\r\n\t Product b = new Product(111, \"Chanel Perfume\", 65.00, 5);\r\n\t \r\n\t System.out.println(a.toString());\r\n\t System.out.println(b.toString());\r\n\t \r\n}", "IProductInfo getM_piSelectedItem();", "public interface IProduct {\n\n /**\n * 热搜词\n */\n void getHotWords(String tag);\n\n /**\n * 获取搜索结果\n */\n void getSearchResult(String condition,String pageNo,String pageSize,String sortField,String order, String tag);\n\n /**\n * 获取homefragment页面数据\n */\n void getHomeData(String tag);\n\n /**\n * 获取homefragment页面的热门推荐数据\n */\n void getHomeRecData(String page_no,String pageSize, String tag);\n\n /**\n * 获取商品分类数据(分类页面)\n */\n void getProductCategory(String tag);\n\n /**\n * 商品筛选项数据(分类页面)\n */\n void getCategoryFilter(String categoryId, String tag);\n\n /**\n * 商品分类搜索结果数据(分类页面)\n */\n void getCategorySearchData(String gcIds, String sort, String page_no, String tag);\n\n /**\n * 商品详情接口 (商品详情页)\n */\n void getProductDetailData(String skuId, String tag);\n\n /**\n * 评价列表接口(商品详情)\n */\n void evaluateListData(String skuId, String pageNo,String pageSize, String tag);\n\n /**\n * 评价商品列表接口(商品详情页)\n */\n void getProductEvaluateListData(String goodsId, String pageNo, String tag);\n\n /**\n * 商品评价各项指标接口(商品详情页)\n */\n void getProductEvaluateScoreData(String goodsId, String tag);\n\n /**\n * 商品详情 热门推荐商品接口(商品详情页)\n */\n void getProductDetailHotData(String product_id, String tag);\n\n /**\n * 收藏商品(商品详情页)\n */\n void collecteGoods(String skuId, String tag);\n\n /**\n * 收藏商品(商品详情页)\n */\n void collecteProduct(String product_id, String tag);\n\n /**\n * 取消收藏商品(商品详情页)\n */\n void cancelCollecteProduct(String product_id, String tag);\n\n /**\n * 获取收藏夹数据\n */\n void getCollectionList(String page_no, String tag);\n\n /**\n * 商品评价接口\n */\n void setEvaluate(String params,String tag);\n\n}", "public ProductCommand toCreateOrMergePatchProduct(ProductState state)\n {\n boolean bUnsaved = state.isStateUnsaved();\n if (bUnsaved)\n {\n return toCreateProduct(state);\n }\n else \n {\n return toMergePatchProduct(state);\n }\n }", "public synchronized void setOption(OptionSet optSet_Temp,String name,float price){\n optSet_Temp.Increase_Option_Manager(name.toUpperCase(Locale.getDefault()), price);\n }", "public void setKind_of_product(String kind_of_product) {\r\n this.kind_of_product = kind_of_product;\r\n }", "public String getProductId();", "public org.mrk.grpc.catalog.Product.Builder getProductBuilder() {\n \n onChanged();\n return getProductFieldBuilder().getBuilder();\n }", "@Override\r\n\tpublic void BulidPartA() {\n\t product.add(\"part A\");\r\n\r\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tProduct temp =(Product)v.getTag();\r\n\t\t\t\tLog.e(temp.getName(), String.valueOf(true));\r\n\t\t\t\tif(((CheckBox)v).isChecked()){\t\t\t\t\t\r\n\t\t\t\t\tac.ProductList.put(temp,true);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tac.ProductList.put(temp,false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tac.RefreshSelect();\r\n\t\t\t\tac.RefreshSumPrice();\r\n\t\t\t}", "public ProductGroup beProductGroup();", "public PcProductpropertyExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "@Override\n public void changePrice(Product product, int position) {\n changeProductPrice(product, -1);\n }" ]
[ "0.636192", "0.6286941", "0.61240625", "0.61063254", "0.61024666", "0.60536337", "0.60436845", "0.6024986", "0.5998668", "0.59799945", "0.5962174", "0.5949927", "0.594017", "0.5917229", "0.59128535", "0.5893974", "0.5891618", "0.5891157", "0.58857155", "0.58837616", "0.58708113", "0.5868125", "0.58484215", "0.58484215", "0.58382905", "0.58147335", "0.5812249", "0.5809347", "0.5804126", "0.579516", "0.57886773", "0.5782583", "0.5778813", "0.57620484", "0.57348585", "0.5724771", "0.5689197", "0.5631865", "0.5628188", "0.5625997", "0.56109464", "0.560843", "0.5608162", "0.5591771", "0.5589031", "0.55704284", "0.5568233", "0.55647904", "0.5561432", "0.5560578", "0.55592847", "0.55564964", "0.5547826", "0.55439097", "0.5530935", "0.55140775", "0.5499798", "0.54890585", "0.5487789", "0.5487563", "0.5483532", "0.5483122", "0.5481211", "0.54702383", "0.5460863", "0.54525375", "0.54509956", "0.54368407", "0.54335374", "0.5432093", "0.5429771", "0.54286456", "0.54117614", "0.54093283", "0.5408488", "0.54075897", "0.5406559", "0.5391119", "0.5383555", "0.53802204", "0.53660715", "0.53656507", "0.5357307", "0.5357121", "0.53512305", "0.5347533", "0.53474516", "0.53451097", "0.5341047", "0.53408325", "0.5335049", "0.5331193", "0.5330201", "0.5327893", "0.53252566", "0.5324802", "0.53242457", "0.5323536", "0.5318007", "0.53176236", "0.5316861" ]
0.0
-1
TODO: implement this method
public Product[] getConsumerVisibleProducts () { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n protected void prot() {\n }", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n public int describeContents() {\n// ignore for now\n return 0;\n }", "@Override\n\t\t\tpublic int describeContents() {\n\t\t\t\treturn 0;\n\t\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void getStatus() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public void identify() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void init() {\n }", "@Override\n public int describeContents()\n {\n return 0;\n }", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "protected abstract Set method_1559();", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }" ]
[ "0.6083663", "0.5897491", "0.58974624", "0.5885315", "0.5839279", "0.58205366", "0.5804281", "0.56590074", "0.5613571", "0.5613571", "0.56116897", "0.5592549", "0.5589818", "0.55365497", "0.55261093", "0.5517586", "0.55167776", "0.55000013", "0.5479704", "0.54588115", "0.5411891", "0.54060566", "0.5378478", "0.53652", "0.53652", "0.53559464", "0.53391665", "0.53240275", "0.53240275", "0.5320836", "0.531523", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5294331", "0.5293765", "0.5292835", "0.529165", "0.52913404", "0.52826214", "0.52813226", "0.5269443", "0.5264969", "0.525977", "0.5259485", "0.52518505", "0.52498084", "0.52358943", "0.5234925", "0.52267855", "0.52243793", "0.52235854", "0.52176636", "0.5210057", "0.5208562", "0.51958674", "0.51958674", "0.5195119", "0.5184908", "0.51823676", "0.5181685", "0.5180315", "0.5180315", "0.51800144", "0.5179972", "0.5179786", "0.51783603", "0.51720524", "0.5169288", "0.5168218", "0.5157399", "0.5154564", "0.5154077", "0.5153895", "0.5153714", "0.51450855", "0.5142818", "0.5138367", "0.513729", "0.5137212", "0.5128958", "0.5121605", "0.5121605", "0.5121605", "0.5121605", "0.5121605", "0.51193035", "0.51188934", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793" ]
0.0
-1
TODO: implement this method
public float getSellingPrice () { return (float) 0.0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n protected void prot() {\n }", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n public int describeContents() {\n// ignore for now\n return 0;\n }", "@Override\n\t\t\tpublic int describeContents() {\n\t\t\t\treturn 0;\n\t\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void getStatus() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public void identify() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void init() {\n }", "@Override\n public int describeContents()\n {\n return 0;\n }", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "protected abstract Set method_1559();", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }" ]
[ "0.6083663", "0.5897491", "0.58974624", "0.5885315", "0.5839279", "0.58205366", "0.5804281", "0.56590074", "0.5613571", "0.5613571", "0.56116897", "0.5592549", "0.5589818", "0.55365497", "0.55261093", "0.5517586", "0.55167776", "0.55000013", "0.5479704", "0.54588115", "0.5411891", "0.54060566", "0.5378478", "0.53652", "0.53652", "0.53559464", "0.53391665", "0.53240275", "0.53240275", "0.5320836", "0.531523", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5294331", "0.5293765", "0.5292835", "0.529165", "0.52913404", "0.52826214", "0.52813226", "0.5269443", "0.5264969", "0.525977", "0.5259485", "0.52518505", "0.52498084", "0.52358943", "0.5234925", "0.52267855", "0.52243793", "0.52235854", "0.52176636", "0.5210057", "0.5208562", "0.51958674", "0.51958674", "0.5195119", "0.5184908", "0.51823676", "0.5181685", "0.5180315", "0.5180315", "0.51800144", "0.5179972", "0.5179786", "0.51783603", "0.51720524", "0.5169288", "0.5168218", "0.5157399", "0.5154564", "0.5154077", "0.5153895", "0.5153714", "0.51450855", "0.5142818", "0.5138367", "0.513729", "0.5137212", "0.5128958", "0.5121605", "0.5121605", "0.5121605", "0.5121605", "0.5121605", "0.51193035", "0.51188934", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793" ]
0.0
-1
TODO: implement this method
public float getQuantityAvailableForSale () { return (float) 0.0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n protected void prot() {\n }", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n public int describeContents() {\n// ignore for now\n return 0;\n }", "@Override\n\t\t\tpublic int describeContents() {\n\t\t\t\treturn 0;\n\t\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void getStatus() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public void identify() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void init() {\n }", "@Override\n public int describeContents()\n {\n return 0;\n }", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "protected abstract Set method_1559();", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }" ]
[ "0.6083663", "0.5897491", "0.58974624", "0.5885315", "0.5839279", "0.58205366", "0.5804281", "0.56590074", "0.5613571", "0.5613571", "0.56116897", "0.5592549", "0.5589818", "0.55365497", "0.55261093", "0.5517586", "0.55167776", "0.55000013", "0.5479704", "0.54588115", "0.5411891", "0.54060566", "0.5378478", "0.53652", "0.53652", "0.53559464", "0.53391665", "0.53240275", "0.53240275", "0.5320836", "0.531523", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5294331", "0.5293765", "0.5292835", "0.529165", "0.52913404", "0.52826214", "0.52813226", "0.5269443", "0.5264969", "0.525977", "0.5259485", "0.52518505", "0.52498084", "0.52358943", "0.5234925", "0.52267855", "0.52243793", "0.52235854", "0.52176636", "0.5210057", "0.5208562", "0.51958674", "0.51958674", "0.5195119", "0.5184908", "0.51823676", "0.5181685", "0.5180315", "0.5180315", "0.51800144", "0.5179972", "0.5179786", "0.51783603", "0.51720524", "0.5169288", "0.5168218", "0.5157399", "0.5154564", "0.5154077", "0.5153895", "0.5153714", "0.51450855", "0.5142818", "0.5138367", "0.513729", "0.5137212", "0.5128958", "0.5121605", "0.5121605", "0.5121605", "0.5121605", "0.5121605", "0.51193035", "0.51188934", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793" ]
0.0
-1
TODO: implement this method
public int getFulfillmentTimeInDays () { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n protected void prot() {\n }", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n public int describeContents() {\n// ignore for now\n return 0;\n }", "@Override\n\t\t\tpublic int describeContents() {\n\t\t\t\treturn 0;\n\t\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "private void getStatus() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public void identify() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "@Override\n public int getSize() {\n return 1;\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void init() {\n }", "@Override\n public int describeContents()\n {\n return 0;\n }", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "protected abstract Set method_1559();", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }", "@Override\n public int describeContents() {\n return 0;\n }" ]
[ "0.6083663", "0.5897491", "0.58974624", "0.5885315", "0.5839279", "0.58205366", "0.5804281", "0.56590074", "0.5613571", "0.5613571", "0.56116897", "0.5592549", "0.5589818", "0.55365497", "0.55261093", "0.5517586", "0.55167776", "0.55000013", "0.5479704", "0.54588115", "0.5411891", "0.54060566", "0.5378478", "0.53652", "0.53652", "0.53559464", "0.53391665", "0.53240275", "0.53240275", "0.5320836", "0.531523", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5298069", "0.5294331", "0.5293765", "0.5292835", "0.529165", "0.52913404", "0.52826214", "0.52813226", "0.5269443", "0.5264969", "0.525977", "0.5259485", "0.52518505", "0.52498084", "0.52358943", "0.5234925", "0.52267855", "0.52243793", "0.52235854", "0.52176636", "0.5210057", "0.5208562", "0.51958674", "0.51958674", "0.5195119", "0.5184908", "0.51823676", "0.5181685", "0.5180315", "0.5180315", "0.51800144", "0.5179972", "0.5179786", "0.51783603", "0.51720524", "0.5169288", "0.5168218", "0.5157399", "0.5154564", "0.5154077", "0.5153895", "0.5153714", "0.51450855", "0.5142818", "0.5138367", "0.513729", "0.5137212", "0.5128958", "0.5121605", "0.5121605", "0.5121605", "0.5121605", "0.5121605", "0.51193035", "0.51188934", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793", "0.511793" ]
0.0
-1
$FF: synthetic method $FF: bridge method
@Override public void handle(PacketListener var1) { this.a((class_id) var1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final /* bridge */ /* synthetic */ void mo43569b() {\n super.mo43569b();\n }", "public /* bridge */ /* synthetic */ void mo55094a() {\n super.mo55094a();\n }", "public final /* bridge */ /* synthetic */ void mo43566a() {\n super.mo43566a();\n }", "public /* bridge */ /* synthetic */ void mo55096c() {\n super.mo55096c();\n }", "public /* bridge */ /* synthetic */ void mo55097d() {\n super.mo55097d();\n }", "public /* bridge */ /* synthetic */ void mo55095b() {\n super.mo55095b();\n }", "@Override\n protected void prot() {\n }", "@Override\n public void b() {\n }", "public abstract void mo70713b();", "public final /* bridge */ /* synthetic */ void mo43571c() {\n super.mo43571c();\n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "public abstract void mo27386d();", "@Override\r\n\tpublic void cast() {\n\r\n\t}", "public abstract void mo42329d();", "public abstract Object mo1185b();", "public abstract void mo42331g();", "@Override\n\tpublic void b1() {\n\t\t\n\t}", "public abstract void mo6549b();", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "StackManipulation virtual(TypeDescription invocationTarget);", "public abstract void mo35054b();", "@Override\n\tpublic void b() {\n\n\t}", "public String visit(MessageSend n, MethodType argu) {\r\n\r\n //argu.SetTransferedArg();\r\n String temp1 = n.f0.accept(this, argu);\r\n this.callCounter++;\r\n String classType = this.callMap.get(callCounter);\r\n //String classType = argu.getThisType();\r\n //argu.CleanTransferedArg();\r\n //System.out.println(classType);\r\n\r\n n.f2.accept(this, argu);\r\n Integer vtableOffset = methodOffsets.get(classType + \".\" + n.f2.f0.toString())/8;\r\n\r\n emit(\"; \" + classType + \".\" + n.f2.f0.toString() + \" \" + \": \" + vtableOffset.toString() + \"\\n\");\r\n String temp2 = newTemp();\r\n emit(temp2 + \" = bitcast \" + temp1 + \" to i8***\\n\");\r\n String temp3 = newTemp();\r\n emit(temp3 + \" = load i8**, i8*** \" + temp2 + \"\\n\");\r\n String temp4 = newTemp();\r\n String temp5 = newTemp();\r\n String temp6 = newTemp();\r\n String temp7 = newTemp();\r\n emit(temp4 + \" = getelementptr i8*, i8** \" + temp3 + \", i32 \" + vtableOffset + \"\\n\");\r\n emit(temp5 + \"= load i8*, i8** \" + temp4 + \"\\n\");\r\n\r\n\r\n emit(temp6 + \" = bitcast i8* \" + temp5 + \" to \" + typeConverter(symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).returnType) + \" (i8*\");\r\n for(String arg : symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).arguments.keySet()){\r\n emit(\", \" + typeConverter(symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).arguments.get(arg)[0]));\r\n }\r\n emit(\")*\\n\");\r\n\r\n n.f4.accept(this, argu);\r\n\r\n emit(temp7 + \" = call \" + typeConverter(symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).returnType) + \" \" + temp6 + \"(\" + temp1);\r\n for(String arg : argu.tempCallArgumentsCodeG.values()){\r\n emit(\", \" + arg);\r\n }\r\n\r\n\r\n argu.tempCallArgumentsCodeG.clear();\r\n /*\r\n %_4 = bitcast i8* %_3 to i8***\r\n %_5 = load i8**, i8*** %_4\r\n %_6 = getelementptr i8*, i8** %_5, i32 0\r\n %_7 = load i8*, i8** %_6\r\n %_8 = bitcast i8* %_7 to i1 (i8*,i32)*\r\n\t %_9 = call i1 %_8(i8* %_3, i32 16)\r\n */\r\n\r\n emit(\")\\n\");\r\n\r\n return typeConverter(symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).returnType) + \" \" + temp7;\r\n }", "public abstract void mo27464a();", "public abstract void mo1184a(Object obj);", "public abstract void mo45765b();", "public abstract void mo27385c();", "@Override\n\tpublic void A() {\n\t\t\n\t}", "@Override\n\tpublic void A() {\n\t\t\n\t}", "public BridgeEntity onBridge();", "public abstract Object mo26777y();", "public /* bridge */ /* synthetic */ java.lang.Object run() throws java.lang.Exception {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: java.security.Signer.1.run():java.lang.Object, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.Signer.1.run():java.lang.Object\");\n }", "interface G1 {\n default int foo (){ // should be intercepted by peer\n System.out.println(\"this is bytecode G1.foo()\");\n return -1;\n }\n }", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "public abstract BoundType b();", "private VerbBridge() {\r\n\t\tvB = null;\r\n\t}", "AnonymousClass2(android.telecom.ConnectionServiceAdapterServant r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: android.telecom.ConnectionServiceAdapterServant.2.<init>(android.telecom.ConnectionServiceAdapterServant):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.2.<init>(android.telecom.ConnectionServiceAdapterServant):void\");\n }", "@Override\n\tpublic void dosomething2() {\n\t\t\n\t}", "public abstract void mo56925d();", "@Override\n\tpublic void realFun() {\n\n\t}", "AnonymousClass1(java.security.Signer r1, java.security.PublicKey r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: java.security.Signer.1.<init>(java.security.Signer, java.security.PublicKey):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: java.security.Signer.1.<init>(java.security.Signer, java.security.PublicKey):void\");\n }", "public abstract void mo42330e();", "@Override\r\npublic int method() {\n\treturn 0;\r\n}", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "public void method_192() {}", "@Override\n\t\t\t\t\tpublic Method handleSimpleMethod(Element parent, FMethod src) {\n\t\t\t\t\t\treturn super.handleSimpleMethod(parent, src);\n\t\t\t\t\t}", "public interface C11922a {\n void bvR();\n }", "StackManipulation special(TypeDescription invocationTarget);", "public OntoBridge()\r\n\t{ \r\n\t}", "public abstract void m15813a();", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "BOpMethod createBOpMethod();", "public abstract BoundType a();", "@Override\n\tpublic void i2() {\n\t\t\n\t}", "public abstract java.lang.Object a ( ) {\n/* .annotation system Ldalvik/annotation/Signature; */\n/* value = { */\n/* \"()TT;\" */\n/* } */\n}", "public /* bridge */ /* synthetic */ void mo22960b(C7059Ec ec, Object obj) {\n super.mo22960b(ec, obj);\n }", "public abstract void mo30696a();", "@Override\n\tpublic void bbb() {\n\t\t\n\t}", "@Override\n\t\t\t\t\tpublic Method handleBroadcastMethod(Element parent,\n\t\t\t\t\t\t\tFBroadcast src) {\n\t\t\t\t\t\treturn super.handleBroadcastMethod(parent, src);\n\t\t\t\t\t}", "public abstract void mo102899a();", "public static native void OpenMM_AmoebaVdwForce_setNonbondedMethod(PointerByReference target, int method);", "public void mo115190b() {\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "static /* synthetic */ android.os.Handler m19-get1(android.telecom.ConnectionServiceAdapterServant r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.telecom.ConnectionServiceAdapterServant.-get1(android.telecom.ConnectionServiceAdapterServant):android.os.Handler, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.-get1(android.telecom.ConnectionServiceAdapterServant):android.os.Handler\");\n }", "public static native int OpenMM_AmoebaVdwForce_getNonbondedMethod(PointerByReference target);", "AnonymousClass1(android.telecom.ConnectionServiceAdapterServant r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: android.telecom.ConnectionServiceAdapterServant.1.<init>(android.telecom.ConnectionServiceAdapterServant):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.telecom.ConnectionServiceAdapterServant.1.<init>(android.telecom.ConnectionServiceAdapterServant):void\");\n }", "@Override\n\tpublic void some() {\n\t\t\n\t}", "public interface C26438t {\n /* renamed from: b */\n void mo5959b(boolean z, String str, Bundle bundle);\n}", "public abstract void mo53562a(C18796a c18796a);", "@Override\n\tpublic void jugar() {}", "@Override\n\tvoid hi() {\n\t}", "public abstract Object mo1771a();", "void mo57277b();", "protected void h() {}", "void mo2508a(bxb bxb);", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "abstract protected void brew();", "public void startMethod (Symbol methodName, java.lang.Object[] args) throws G2AccessException;", "interface C0868a {\n /* renamed from: a */\n void mo3207a(Object obj);\n\n /* renamed from: a */\n void mo3208a(String str, Bundle bundle);\n\n /* renamed from: a */\n void mo3209a(String str, Bundle bundle, ResultReceiver resultReceiver);\n\n /* renamed from: a */\n boolean mo3210a(Intent intent);\n }", "public void foo() {\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void driving() {\n\t\t\n\t}", "@Override\r\n\tpublic void PrimitiveOperation2() {\n\t\tSystem.out.println(\"Concrete class B method 2 implemation\");\r\n\t}", "public abstract boolean isSynthetic();", "public void mo9137b() {\n }", "private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }", "public abstract void mo957b();", "@Override\n\tpublic void bidfunction() {\n\t\t\n\t}", "@Override\n\tpublic void bidfunction() {\n\t\t\n\t}", "public interface C11859a {\n void bvs();\n }", "@Override\n public void visit(MethodDeclaration decl, Void arg){\n super.visit(decl, arg);\n handleDecl(decl);\n }", "void mo80455b();", "public void b() {\r\n }", "public abstract void mh();", "public void mo21825b() {\n }" ]
[ "0.702399", "0.69453514", "0.67942417", "0.6747192", "0.66855407", "0.66171724", "0.65492755", "0.6361259", "0.63578695", "0.62722635", "0.6263336", "0.6234106", "0.62267876", "0.6198977", "0.6194633", "0.61923254", "0.6169495", "0.6157093", "0.6152129", "0.6123021", "0.6117545", "0.6117545", "0.6117545", "0.6100103", "0.60963714", "0.6075231", "0.6072964", "0.6064642", "0.60158885", "0.5998001", "0.5977452", "0.5970609", "0.5970609", "0.59691995", "0.5958249", "0.5955932", "0.595447", "0.5952187", "0.59379333", "0.5919522", "0.58850825", "0.5881699", "0.5871183", "0.5862842", "0.58605325", "0.5856482", "0.58552504", "0.58360666", "0.5821849", "0.58168685", "0.5812269", "0.58101165", "0.5799901", "0.57919204", "0.5780767", "0.5773735", "0.5773735", "0.5766479", "0.57552326", "0.57488245", "0.5740524", "0.57389504", "0.572889", "0.5728591", "0.57280415", "0.57274073", "0.57255507", "0.5723887", "0.57222533", "0.57185876", "0.57114404", "0.570931", "0.5709245", "0.5708507", "0.5707613", "0.57073706", "0.57020044", "0.5701971", "0.56909806", "0.56856495", "0.5684744", "0.56802917", "0.5677595", "0.5671526", "0.56713074", "0.56698096", "0.5668756", "0.5668211", "0.566791", "0.5659528", "0.56581986", "0.5652847", "0.5645439", "0.5641165", "0.5641165", "0.56387657", "0.563584", "0.5625802", "0.56242335", "0.5622785", "0.56184363" ]
0.0
-1
Log error here since request failed
@Override public void onFailure(Call<DailyReportPojo> call, Throwable t) { System.out.println("retrofit hh failure " + t.getMessage()); d.dismiss(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onRequestFailure(Request request, IOException e) { }", "@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}", "@Override\n\t\t\tpublic void onFailure(Request request, IOException e) {\n\t\t\t\t Log.i(\"info\",\"hehe\");\n\t\t\t}", "@Override\n\t\t\tpublic void onError(Request request, Throwable exception) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void onError(Request request, Throwable exception) {\n\n\t\t\t\t\t}", "public void requestFailed(RequestFailureEvent e);", "public synchronized void onRequestFailed(Throwable reason) {\r\n\t\tallRequestsTracker.onRequestFailed(reason);\r\n\t\trecentRequestsTracker.onRequestFailed(reason);\r\n\t\tmeter.mark();\r\n\t}", "private void action_error(HttpServletRequest request, HttpServletResponse response, String message) {\n\n FailureResult fail = new FailureResult(getServletContext());\n fail.activate(message, request, response);\n }", "@Override\r\n\t\t\t\t\tpublic void onFailure(Request arg0, IOException arg1) {\n\t\t\t\t\t\tsToast(\"失败\");\r\n\t\t\t\t\t}", "@Override\n\t\t\t\tpublic void onNetworkError(Request request, IOException e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tfail(\"Request failure: \" + caught.getMessage());\n\t\t\t}", "private static void LogError(final String method,\n final ResponseResult result)\n {\n if (result != null && !StringHelper.isNullOrEmpty(result.errorMessage))\n {\n// Crashlytics.log(\"SharecareClient() FAILURE: \"\n// + String.format(ERROR_MESSAGE, method, result.responseCode,\n// result.errorMessage));\n }\n }", "@Override\n public void onError(final Request request, final Throwable exception) {\n LOGGER.severe(\"Server part (poptavka-core) doesn't respond during user logging, exception=\"\n + exception.getMessage());\n eventBus.setErrorMessage(Storage.MSGS.loginUnknownError());\n }", "@Override\n public void onRequestFailure(SpiceException spiceException) {\n }", "protected void handleFailMessage(Request request, IOException e) {\n\t\tonRequestFailure(request, e);\n\t}", "@Override\r\n\t\t\tpublic void onFailure(Request arg0, IOException arg1) {\n\t\t\t\tsToast(\"失败\");\r\n\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onError(Exception e) {\n\t\t\t\t\t\tLog.e(\"HttpPost\", \"LIES \" + e.getMessage());\r\n\r\n\t\t\t\t\t}", "@Override\n public void onFailure(Request request, IOException e) {\n Toast.makeText(MainActivity.this, \"Request Failed\", Toast.LENGTH_SHORT).show();\n }", "public synchronized void onRequestFailed(String message, Throwable ex) {\r\n\t\tString reason = message + \": \" + ex.getClass().getName() + \": \" + ex.getMessage();\r\n\t\tallRequestsTracker.onRequestFailed(reason);\r\n\t\trecentRequestsTracker.onRequestFailed(reason);\r\n\t\tmeter.mark();\r\n\t}", "public void onApiRequestFailed();", "public void onError(Request request, Throwable exception) {\n\t\t\t logger.severe(\"HTTP error occurred\");\n\t\t\t \tdeliveryPoint.onDeliveryProblem(letterBox, 0);\n\t\t\t }", "@Override\n public void onFailure(Throwable t) {\n errorOut();\n }", "@Override\n public void failure(RetrofitError arg0) {\n Log.info(\"net err:\"+arg0.toString());\n }", "@Override\n public void failure(RetrofitError error) {\n Log.e(\"error\",error.getResponse().getReason());\n }", "@Override\n\tpublic void onRequestDataError(Exception error) {\n\t\tLog.e(\"Jrv Activity jrv\", error.getMessage());\n\t}", "@Override\n\t\t\tpublic void onNetworkError(Request request, IOException e) {\n\n\t\t\t}", "public synchronized void onRequestFailed(String reason) {\r\n\t\tallRequestsTracker.onRequestFailed(reason);\r\n\t\trecentRequestsTracker.onRequestFailed(reason);\r\n\t\tmeter.mark();\r\n\t}", "@Override\n public void onError(Status status) {\n }", "@Override\n public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {\n Log.i(\"doRequest\", \"doRequest failed\");\n\n }", "private Object logError(WebClientResponseException e, String string) {\n\t\treturn null;\n\t}", "protected void sendFailureMessage(Request request, IOException e) {\n\t\tsendMessage(obtainMessage(HttpConsts.REQUEST_FAIL, new Object[] {request, e}));\n\t}", "@Override\n public void onErrorResponse(VolleyError volleyError) { //when error listener is activated\n Log.i(\"volley\", volleyError.toString());\n }", "@Override\n public void onErrorResponse(VolleyError volleyError) { //when error listener is activated\n Log.i(\"volley\", volleyError.toString());\n }", "public void onFail(int statusCode, String address);", "void onFailureRedirection(ErrorModel errorModel);", "@Override\n public void onError(Status status) {\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }", "@Override\n\t\tpublic void onFailure(HttpException error, String msg) {\n\t\t\t\n\t\t}", "void errorResponse( String error );", "public void onError(final Request request, final Throwable exception) {\n \t\t}", "public void onReceivedError();", "@Override\n\t\t\t\tpublic void onFailure(Call call, Exception e, int id) {\n\t\t\t\t\tlogger.error(e.getMessage(),e);\n\t\t\t\t}", "void uploadFailed(StreamingErrorEvent event);", "@Override\n\tpublic void onErrorResult(HttpRequest request,int requestId, int statusCode, Throwable e) {\n\t\t\n\t}", "private void error() {\n this.error = true;\n this.clients[0].error();\n this.clients[1].error();\n }", "@Override\n public void onError(Status status) {\n }", "@Override\n public void onError(Status status) {\n }", "public void onError(Request request, Throwable exception) {\n Utils.setErrorPrincipal(\"Ocurrio un error al conectar con el servidor\", \"error\");\n }", "public void onError(Request request, Throwable exception) {\n Utils.setErrorPrincipal(\"Ocurrio un error al conectar con el servidor\", \"error\");\n }", "public void failure(RetrofitError arg0) {\n\t\t\t\t\n\t\t\t}", "public void failure(RetrofitError arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\t\t\t\tpublic void error(Exception e) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "void recordExecutionError() {\n hadExecutionError = true;\n }", "public void onError(Request request, Throwable e) {\n Window.alert(\"error = \" + e.getMessage());\n }", "public void onError(Request request, Throwable e) {\n Window.alert(\"error = \" + e.getMessage());\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"ParentInfo\", \"ERROR.._---\" + error.getCause());\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.d(\"ParentInfo\", \"ERROR.._---\" + error.getCause());\n }", "@Override\r\n\t\t\tpublic void onFailure(Call<LogDataModel> call, Throwable t) {\n\t\t\t\t\r\n\t\t\t}", "public static void logGenericUserError() {\n\n }", "@Override\n\t\t\t\t\tpublic void httpFail(String response) {\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"提交超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"提交超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"提交超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"提交超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}", "void onFailure(Throwable error);", "public void onFailure();", "@Override\n\tpublic void onRequestError(String reqID, Exception error) {\n\t\temptyView.showException((ZcdhException)error, this);\n\t}", "void updateCardLogsFailed(Throwable throwable);", "public void onError(Request request, Throwable exception) {\n com.google.gwt.user.client.Window.alert(\"error 1002\");\n Utils.setErrorPrincipal(\"Ocurrio un error al conectar con el servidor\", \"error\");\n }", "void onFailureRedirection(String errorMessage);", "protected void onConnectionError() {\n\t}", "@Override\n public void onFailure(@NonNull Exception e) {\n Discoverer.this.eventListener.trigger(EVENT_LOG, \"Fail to request connection: \" + e.getMessage());\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"WAFAA\", error.toString());\n }", "public void error(Exception e);", "@Override\n public void log(Request request, Response response)\n {\n int committedStatus = response.getCommittedMetaData().getStatus();\n\n // only interested in error cases - bad request & server errors\n if ((committedStatus >= 500) || (committedStatus == 400))\n {\n super.log(request, response);\n }\n else\n {\n System.err.println(\"### Ignored request (response.committed.status=\" + committedStatus + \"): \" + request);\n }\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n try{\n Log.d(\"wsrong\",error.getMessage());\n }catch(NullPointerException ex)\n {\n Toast.makeText(context,\"Server issue try later\", Toast.LENGTH_LONG).show();\n Log.d(\"wsrong\",ex.getMessage());\n }\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n System.out.println(\"ERRO: \"+ error.getMessage());\n }", "@Override\n public void failure(RetrofitError error) {\n }", "public void queryError()\r\n {\r\n myFailedQueryCountProvider.setValue(Integer.valueOf(myFailedQueryCounter.incrementAndGet()));\r\n }", "@Override\n\t\t\t\t\t\t\tpublic void HttpFail(int ErrCode) {\n\n\t\t\t\t\t\t\t}", "private void logError(String msg)\n {\n GlobeRedirector.errorLog.write(msg);\n }", "@Override\n public void onFailure(Call call, IOException e) {\n Log.e(\"Volley\", e.toString());\n }", "@Override\n public void failure(RetrofitError error) {\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n\n NetworkResponse networkResponse = error.networkResponse;\n if (networkResponse != null) {\n String statusCode = String.valueOf(networkResponse.statusCode);\n switch (statusCode) {\n case \"400\":\n Toast.makeText(CreateTour.this, \"ERROR 400\", Toast.LENGTH_SHORT).show();\n break;\n case \"500\":\n Toast.makeText(CreateTour.this, \"ERROR 500\", Toast.LENGTH_SHORT).show();\n break;\n default:\n Toast.makeText(CreateTour.this, \"ERROR\", Toast.LENGTH_SHORT).show();\n }\n }\n }", "@Override\n\t\t\t\t\tpublic void onMyError(VolleyError error) {\n\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\t\t\tpublic void onFail(String msg) {\n\t\t\t\t\t\t\t\tToast.makeText(PhotoImagePagerActivity.this, \"服务器错误\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\t\t\t\t}", "@Override\r\n\t\t\tpublic void onErrorResponse(VolleyError arg0) {\n\t\t\t\tonMyError(arg0);\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void onErrorResponse(String errorMessage) {\n\r\n\t\t\t}", "public void downloadFailed(Throwable t);", "@Override\n\tprotected void onResponseFailure(ReqTag tag, MamaHaoServerError error,\n\t\t\tMamaHaoError clientError) {\n\t\tsuper.onResponseFailure(tag, error, clientError);\n\t}" ]
[ "0.72718394", "0.7237803", "0.6898779", "0.68949074", "0.68339616", "0.67830634", "0.67263997", "0.6665285", "0.6653348", "0.66524214", "0.6650157", "0.66040653", "0.6585609", "0.6581046", "0.6562807", "0.65474397", "0.6533174", "0.653112", "0.65069175", "0.6487646", "0.64853215", "0.64851105", "0.6483066", "0.6463411", "0.64447296", "0.64402235", "0.64400756", "0.64228463", "0.6417312", "0.6403869", "0.63606787", "0.6358939", "0.6358939", "0.6345237", "0.6341708", "0.6340972", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.6329582", "0.63295114", "0.6309588", "0.62948275", "0.6279842", "0.6274252", "0.627367", "0.62630105", "0.62624705", "0.6261592", "0.6261592", "0.6256917", "0.6256917", "0.6254493", "0.6254493", "0.6246891", "0.6240329", "0.6237388", "0.6237388", "0.62373483", "0.62373483", "0.62339693", "0.6228249", "0.6224815", "0.6223691", "0.6223691", "0.6223691", "0.6223691", "0.62220323", "0.6218944", "0.6216407", "0.62054735", "0.6201445", "0.6188693", "0.61861956", "0.6181093", "0.61730963", "0.616362", "0.61628854", "0.6159322", "0.6139726", "0.6134912", "0.6134442", "0.6132167", "0.6128068", "0.6127786", "0.61258435", "0.61243224", "0.61115134", "0.6109636", "0.6109451", "0.6107222", "0.6105645", "0.6104567" ]
0.0
-1
Checks if the contradiction was applied correctly to this board state
protected String checkContradictionRaw(BoardState state) { String error = null; int height = state.getHeight(); int width = state.getWidth(); int[][] arrayacross = new int[height][width]; int[][] arraydown = new int[height][width]; int[][] cellRegions = (int[][])state.getExtraData().get(2); for(int x = 0; x < width; ++x) { for(int y = 0; y < height; ++y) { arrayacross[y][x] = arraydown[y][x] = 0; } } for(int x = 0; x < width; ++x) { for(int y = 0; y < height; ++y) { if(state.getCellContents(x,y) == 1) { if(x+1 < width) { if(state.getCellContents(x+1,y) == 1) { if( cellRegions[y][x] != cellRegions[y][x+1]) arrayacross[y][x+1] = arrayacross[y][x] + 1; else arrayacross[y][x+1] = arrayacross[y][x]; } } if(y+1 < height) { if(state.getCellContents(x,y+1) == 1) { if( cellRegions[y][x] != cellRegions[y+1][x]) arraydown[y+1][x] = arraydown[y][x] + 1; else arraydown[y+1][x] = arraydown[y][x]; } } } } } for(int x = 0; x < width; ++x) { for(int y = 0; y < height; ++y) { if(arrayacross[y][x] > 1 || arraydown[y][x] > 1) return error; } } error = "A line of white cells does not exceed two rooms."; return error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkEquality(){\n boolean flag = true;\n for (int i = 0; i < boardRows ; i++) {\n for (int j = 0; j < boardColumns; j++) {\n if(this.currentBoardState[i][j] != this.goalBoardState[i][j]){\n flag = false;\n }\n }\n }\n return flag;\n }", "private boolean isCorrect() {\n\t\t// if a single tile is incorrect, return false\n\t\tfor (Tile tile : tiles) {\n\t\t\tif (!tile.isCorrect()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isValid() {\n if (state.length != Board.dim*Board.dim) return false;\n if ((double)Board.dim != Math.sqrt((double)state.length)) return false;\n byte[] counts = new byte[state.length];\n try {\n for (int i = 0; i < counts.length; i++) counts[state[i]]++;\n } catch (ArrayIndexOutOfBoundsException e) { return false; }\n for (int i = 0; i < counts.length; i++) if (counts[i] != 1) return false;\n return true;\n }", "private boolean checkFinalPuzzle() throws Exception {\n for(int i = 0; i < puzzle.getColumns(); ++i) {\n var clues = puzzle.getColumnClue(i);\n var solver_col = searchBoard.getFilledGroups(i, TraversalType.COLUMN);\n if(clues.size() != solver_col.size()) {\n return false;\n }\n for(int j = 0; j < clues.size(); ++j) {\n if(!clues.get(j).equals(solver_col.get(j))) {\n return false;\n }\n }\n }\n for(int i = 0; i < puzzle.getRows(); ++i) {\n var clues = puzzle.getRowClue(i);\n var solver_row = searchBoard.getFilledGroups(i, TraversalType.ROW);\n if(clues.size() != solver_row.size()) {\n return false;\n }\n for(int j = 0; j < clues.size(); ++j) {\n if(!clues.get(j).equals(solver_row.get(j))) {\n return false;\n }\n }\n }\n return true;\n }", "public boolean isLegal() {\r\n\r\n return( isLegalRow() && isLegalCol() );\r\n }", "private static boolean isValidBoard(byte[][] board) {\n for(int columnIndex = 0; columnIndex < board.length; columnIndex++) {\n for(int rowIndex = 0; rowIndex < board[columnIndex].length; rowIndex++) {\n byte value = board[columnIndex][rowIndex];\n if((value != IBoardState.symbolOfInactiveCell) && (value != IBoardState.symbolOfEmptyCell) && (value != IBoardState.symbolOfFirstPlayer) && (value != IBoardState.symbolOfSecondPlayer)) {\n return false;\n }\n }\n }\n return true;\n }", "private void checkLegal() {\n\tif (undoStack.size() == 2) {\n ArrayList<Integer> canGo = \n getMoves(undoStack.get(0), curBoard);\n boolean isLegal = false;\n int moveTo = undoStack.get(1);\n for (int i = 0; i < canGo.size(); i++) {\n if(canGo.get(i) == moveTo) {\n isLegal = true;\n break;\n }\n }\n\n if(isLegal) {\n curBoard = moveUnit(undoStack.get(0), \n moveTo, curBoard);\n clearStack();\n\n moveCount++;\n\t setChanged();\n\t notifyObservers();\n }\n\t}\n }", "@Override\n\tpublic boolean check(piece[][] board) {\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public boolean checkRep() {\n return location.x() >= 0 && location.x() < board.getWidth() && \n location.y() >= 0 && location.y() < board.getHeight(); \n }", "boolean ensureBoardisCreated(String[][] board) {\r\n\t\tint i = 0, j = 0;\r\n\t\tboolean isBoardCorrectFlag = false;\r\n\t\tfor (i = 0; i < 3; i++) {\r\n\t\t\tSystem.out.println();\r\n\t\t\tfor (j = 0; j < 3; j++) {\r\n\t\t\t\tSystem.out.print(\"[\" + board[i][j] + \"]\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\r\n\t\tif (i == j) {\r\n\t\t\tSystem.out.println(\"3*3 Board created successfully\");\r\n\t\t\tisBoardCorrectFlag = true;\r\n\t\t}\r\n\t\treturn isBoardCorrectFlag;\r\n\t}", "public boolean repOk(){\n\t\t\tif(board == null || layer < 0 || position < 0)\n\t\t\t\treturn false;\n\t\t\tif(layer >= 3 || position >= board.getLayerLength(layer))\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}", "public boolean checkState(){\r\n boolean checkZero = false;\r\n for (int i = 0; i<puzzleSize; i++){\r\n for (int j = 0; j<puzzleSize; j++){\r\n if (this.state[i][j] == 0)\r\n checkZero = true;\r\n if ( (this.state[i][j]<0) || (this.state[i][j]>maxValue)){\r\n System.out.println(\"Value greater than \" + maxValue + \" found.\");\r\n return false;\r\n }\r\n for (int k = 0; k<puzzleSize; k++){\r\n for (int l = 0; l<puzzleSize; l++){\r\n if ( (this.state[i][j] == this.state[k][l])&&( (i!=k) || (j!=l))){\r\n System.out.println(\"State contained duplicate value(s).\");\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (!checkZero)\r\n System.out.println(\"State did not contain an empty space. Denote an empty space with a 0.\");\r\n return checkZero;\r\n }", "public boolean isConflictZero() {\r\n for (int x = 0; x < this.state.length; x++) {\r\n for (int y = x + 1; y < this.state.length; y++) {\r\n if (isConflict(x, this.state[x], y, this.state[y])) {\r\n // There is a conflict between a queen in A column and B column.\r\n\r\n // Record the column A.\r\n this.conflictColA = x;\r\n // Record the column B.\r\n this.conflictColB = y;\r\n\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }", "public boolean isValid() {\n\t\treturn (x >= 0 && x < Board.SIZE && y >= 0 && y < Board.SIZE);\n\t}", "private boolean isGoodState() {\n\t resetMask();\n\t checkHorizontal();\n\t checkVertical();\n\n\t for(int i = 0; i < maskArray.length; i++){\n\t for (int j = 0; j < maskArray[i].length; j++){\n\n\t if (maskArray[i][j] == 1){\n\t return false;\n\t }\n\n\t }\n\t }\n\n\t return true;\n }", "public boolean isCheckmate()\n {\n Game g = Game.getInstance();\n\n int sum = 0;\n\n for(Piece[] p1 : g.m_board.m_pieces)\n {\n for(Piece p2 : p1)\n {\n if(p2 != null)\n {\n if(p2.m_color == this.m_color)\n {\n sum += p2.getLegalMoves().size();\n }\n }\n }\n }\n\n if(sum == 0){ return true; } else { return false; }\n }", "public int verify() {\n\t\tint incorrect = 0; // Number of incorrect squares.\n\t\tint match = 0; // Number of matches in an array\n\n\t\t// Verify that the nonzero values in initialState\n\t\t// are the same numbers as in currentState.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tif (this.initialState[row][col] != 0) {\n\t\t\t\t\tif (this.initialState[row][col] != this.currentState[row][col]) {\n\t\t\t\t\t\tincorrect++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that there are no blank spots in the\n\t\t// sudoku. Blank spots, in this program, are\n\t\t// represented by zeroes. To do that, we'll\n\t\t// simply count the zeroes in the entire sudoku\n\t\t// and add them to 'incorrect'.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tif (this.currentState[col][row] == 0) {\n\t\t\t\t\tincorrect++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each row only has unique\n\t\t// numbers and that each number ranges\n\t\t// from one through four. How this is done\n\t\t// is that a for loop cycles through\n\t\t// the array and counts up the matches. If\n\t\t// the number of matches is greater than one,\n\t\t// then the number of matches minus one is added\n\t\t// to the incorrect variable, and the match variable\n\t\t// is zeroed out.\n\t\tfor (int col = 0; col < 9; col++) {\n\t\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t\tfor (int i = 0; i < 9; i++) {\n\t\t\t\t\tif (this.currentState[col][row] == this.currentState[col][i]) {\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (match > 1) {\n\t\t\t\t\tincorrect += --match;\n\t\t\t\t\tmatch = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each column only has unique\n\t\t// numbers and that each number range\n\t\t// from one through four. How this is done\n\t\t// is that a for loop cycles through\n\t\t// the array and counts up the matches. If\n\t\t// the number of matches is greater than one,\n\t\t// then the number of matches minus one is added\n\t\t// to the incorrect variable, and the match variable\n\t\t// is zeroed out.\n\t\tfor (int row = 0; row < 9; row++) {\n\t\t\tfor (int col = 0; col < 9; col++) {\n\t\t\t\tfor (int i = 0; i < 9; i++) {\n\t\t\t\t\tif (this.currentState[col][row] == this.currentState[i][row]) {\n\t\t\t\t\t\tmatch++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (match > 1) {\n\t\t\t\t\tincorrect += --match;\n\t\t\t\t\tmatch = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Verify that each square has only unique\n\t\t// numbers and that each number range\n\t\t// from one through four.\n\t\t// First, I made four temporary 2x2 arrays,\n\t\t// then I basically put each square of the\n\t\t// sudoku into each array, then I checked\n\t\t// the validity of each square, incrementing\n\t\t// the incorrect variable by one for each\n\t\t// duplicate in each square.\n\n\t\t// từng hình vuông nhỏ\n\t\t// cho mục đích xác nhận\n\t\tint[][] tempOne = new int[3][3];\n\t\tint[][] tempTwo = new int[3][3];\n\t\tint[][] tempThree = new int[3][3];\n\t\tint[][] tempFour = new int[3][3];\n\t\tint[][] tempFive = new int[3][3];\n\t\tint[][] tempSix = new int[3][3];\n\t\tint[][] tempSeven = new int[3][3];\n\t\tint[][] tempEight = new int[3][3];\n\t\tint[][] tempNine = new int[3][3];\n\n\t\t// chia Sudoku thành 9 mảng nhỏ\n\t\t// 1 mảng cho 1 hình vuông\n\t\tfor (int row = 0; row < 9; row++) {\n\t\t\t// chạy từng ô vuông nhỏ\n\t\t\tswitch (row) {\n\t\t\tcase 0:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempOne[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempTwo[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempThree[row][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFour[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempFive[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSix[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[0][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[1][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempSeven[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempEight[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\t\t\t\tfor (int col = 0; col < 3; col++) {\n\t\t\t\t\ttempNine[2][col] = this.currentState[row][col];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"You shouldn't be here...\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// xác nhận mỗi hình vuông có duy nhất 1 số nguyên từ 1-9\n\t\tint matchOne = 0;\n\t\tint matchTwo = 0;\n\t\tint matchThree = 0;\n\t\tint matchFour = 0;\n\t\tint matchFive = 0;\n\t\tint matchSix = 0;\n\t\tint matchSeven = 0;\n\t\tint matchEight = 0;\n\t\tint matchNine = 0;\n\n\t\t// The first two for loops fix a number to be compared.\n\t\tfor (int row = 0; row < 3; row++) {\n\t\t\tfor (int col = 0; col < 3; col++) {\n\n\t\t\t\t// These two for loops cycles through the square,\n\t\t\t\t// counting the number of matches along the way.\n\t\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\t\t\tif (tempOne[row][col] == tempOne[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchOne++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempTwo[row][col] == tempTwo[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchTwo++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempThree[row][col] == tempThree[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchThree++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempFour[row][col] == tempFour[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchFour++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempFive[row][col] == tempFive[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchFive++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempSix[row][col] == tempSix[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchSix++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempSeven[row][col] == tempSeven[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchSeven++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempEight[row][col] == tempEight[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchEight++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (tempNine[row][col] == tempNine[i][j]) {\n\t\t\t\t\t\t\tif (i != row && col != j) {\n\t\t\t\t\t\t\t\tmatchNine++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If there is more than one match, the match variable\n\t\t\t\t// is decremented by one (so the original number isn't\n\t\t\t\t// counted) and added to the number of incorrect\n\t\t\t\t// squares in the sudoku.\n\t\t\t\tif (matchOne > 1) {\n\t\t\t\t\tincorrect += matchOne;\n\t\t\t\t\tmatchOne = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchOne = 0;\n\t\t\t\t}\n\t\t\t\tif (matchTwo > 1) {\n\t\t\t\t\tincorrect += matchTwo;\n\t\t\t\t\tmatchTwo = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchTwo = 0;\n\t\t\t\t}\n\t\t\t\tif (matchThree > 1) {\n\t\t\t\t\tincorrect += matchThree;\n\t\t\t\t\tmatchThree = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchThree = 0;\n\t\t\t\t}\n\t\t\t\tif (matchFour > 1) {\n\t\t\t\t\tincorrect += matchFour;\n\t\t\t\t\tmatchFour = 0;\n\t\t\t\t} else {\n\t\t\t\t\tmatchFour = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Returns the number of incorrect numbers in the array.\n\t\treturn incorrect;\n\t}", "private static boolean checkIsTrue() {\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tif(col[i]!=colTemp[i]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0 ; i < n ;i++){\r\n\t\t\tif(row[i]!=rowTemp[i]){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean allCellsCorrect() {\n for (int i = 0;i < btArray.length;i++) {\n for (int j = 0;j < btArray[0].length;j++) {\n int cellState = mainField.getCellState(i,j);\n // if the cell has a mine\n if (mainField.getValue(i,j) == -1) {\n // tests to see if it isn't marked\n if (cellState != mainField.MARKED) {\n // returns false if it isn't, because it should be marked if the game is complete\n return false;\n }\n }\n // if it isn't a mine\n else {\n // tests to see if the cell is marked\n if (cellState == mainField.MARKED) {\n // returns false, because this nonmine cell should not be marked if the game is complete\n return false;\n }\n }\n }\n }\n return true;\n }", "private boolean isCorrect() {\n return !console.getTrueFalse(\"Is this correct?>>> \");\n }", "static void checkCompleteness(Piece piece, Context context) {\n\t\tif (Helper.isSolved()) { //puzzle is solved\n \t\tpuzzleComplete(context); //cleanup\n \t} else {\n \t\tif(Helper.isPieceCorrect(piece)) { //piece is in the correct position and orientation\n \t\t\tHelper.markPiece(piece, true); //mark the piece as correct\n \t\t}\n \t}\n\t}", "public boolean istrianglevalid() {\n //if all of the sides are valid, then return true, else return false\n if (sideA > 0 && sideB > 0 && sideC > 0) {\n return true;\n } else {\n return false;\n }\n }", "public boolean isValid()\n {\n return mCRC[ 0 ] == CRC.PASSED || \n \t mCRC[ 0 ] == CRC.CORRECTED;\n }", "public boolean isValid() {\n\t\tif (isPlayer1() && currentPit < 7 && currentPit != 6) {\n\t\t\tif (board[currentPit] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true; // check appropriate side of board, excluding scoring\n\t\t}\n\t\t// pit\n\t\telse if (!isPlayer1() && currentPit >= 7 && currentPit != 13) {\n\t\t\tif (board[currentPit] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean checkBoardVictory() {\n boolean topRowStatus = checkRowVictory(getTopRow()) != 0;\n boolean midRowStatus = checkRowVictory(getMidRow()) != 0;\n boolean vertMidStatus = checkRowVictory(getVerticalMidRow()) != 0;\n boolean lowRowStatus = checkRowVictory(getLowRow()) != 0;\n boolean leftMidStatus = checkRowVictory(getVerticalLeftRow()) != 0;\n boolean rightMidStatus = checkRowVictory(getVerticalRightRow()) != 0;\n\n return topRowStatus || midRowStatus || vertMidStatus || lowRowStatus || leftMidStatus\n || rightMidStatus;\n }", "private boolean checkComp() {\n\t\tfor (int i = 0; i < comp.length; i++) {\n\t\t\tfor (int j = 0; j < comp[i].length; j++) {\n\t\t\t\tif (comp[i][j] != answer[i][j]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean checkWinner() {\n\t\tboolean frontDiagWin = !myBoard.isEmpty(0, 0);\n\t\tchar frontDiagToken = myBoard.getCell(0, 0);\n\t\tboolean backDiagWin = !myBoard.isEmpty(0, Board.BOARD_SIZE - 1);\n\t\tchar backDiagToken = myBoard.getCell(0, Board.BOARD_SIZE - 1);\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\t// check Diagonals\n\t\t\tfrontDiagWin = myBoard.getCell(i, i) == frontDiagToken ? frontDiagWin\n\t\t\t\t\t: false;\n\t\t\tbackDiagWin = myBoard.getCell(i, (Board.BOARD_SIZE - 1) - i) == backDiagToken ? backDiagWin\n\t\t\t\t\t: false;\n\t\t\t// check Rows and Columns\n\t\t\tboolean rowWin = !myBoard.isEmpty(i, 0);\n\t\t\tchar startRowToken = myBoard.getCell(i, 0);\n\t\t\tboolean colWin = !myBoard.isEmpty(0, i);\n\t\t\tchar startColToken = myBoard.getCell(0, i);\n\t\t\tfor (int j = 0; j < Board.BOARD_SIZE; j++) {\n\t\t\t\trowWin = myBoard.getCell(i, j) == startRowToken ? rowWin\n\t\t\t\t\t\t: false;\n\t\t\t\tcolWin = myBoard.getCell(j, i) == startColToken ? colWin\n\t\t\t\t\t\t: false;\n\t\t\t}\n\t\t\tif (rowWin || colWin) {\n\t\t\t\tSystem.out.println(\"\\\"\"\n\t\t\t\t\t\t+ (rowWin ? startRowToken : startColToken)\n\t\t\t\t\t\t+ \"\\\" wins the game!\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif (frontDiagWin || backDiagWin) {\n\t\t\tSystem.out.println(\"\\\"\"\n\t\t\t\t\t+ (frontDiagWin ? frontDiagToken : backDiagToken)\n\t\t\t\t\t+ \"\\\" wins the game!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean validate() {\n System.out.println();\n System.out.println(new Encryption(I).toString());\n return compMatrix(matx.times(matx.inverse()), I);\n }", "private boolean fail(Piece piece) {\n\n // To store the moving over\n int localColumnPos = columnPos - piece.getShift();\n\n // If the piece will go outside the bounds of the board, return false\n if (piece.getMatrix().length + rowPos > board.length ||\n piece.getMatrix()[0].length + localColumnPos > board[0].length || localColumnPos < 0) return true;\n\n // Check for no true true collisions\n for (int i = 0; i < piece.getMatrix().length; i++) {\n for (int j = 0; j < piece.getMatrix()[0].length; j++) {\n // If there is a true + true anywhere, do not add piece\n if (piece.getMatrix()[i][j] && board[i + rowPos][j + localColumnPos]) return true;\n }\n }\n return false;\n }", "public boolean checkCheckMate() {\n\t\t// \n\t\tboolean checked = false;\n\t\tfor (int i = 0; i < 32; i++) { \n\t\t\tif (pieces[i].handlePieceCheckMate()) {\n\t\t\t\tchecked = true;\n\n\t\t\t\tswitch (pieces[i].getColor())\n\t\t\t\t{\n\t\t\t\tcase BLACK:\n\t\t\t\t\twhichKing = 28;\n\t\t\t\t\tbreak;\n\t\t\t\tcase WHITE:\n\t\t\t\t\twhichKing = 4;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twhichKing = 40;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} \t\n\t\t}\n\t\treturn checked;\n\t}", "private void checkRep() {\n assert (width <= Board.SIDELENGTH);\n assert (height <= Board.SIDELENGTH);\n assert (this.boundingBoxPosition.x() >= 0 && this.boundingBoxPosition.x() <= Board.SIDELENGTH);\n assert (this.boundingBoxPosition.y() >= 0 && this.boundingBoxPosition.y() <= Board.SIDELENGTH);\n }", "private boolean shouldClearBoard() {\n return rnd.nextInt(3) == 2 || isMoreThanMoles(2) || (rnd.nextBoolean() && isMoreThanMoles(1));\n }", "public static boolean validMoves(AbstractBoard[] boards )\n\t{\n\t\tint x = boards[0].getSize();\n\t\tint y = boards[0].getWidth();\n\t\tint count = 1;\n\t\tint[][] Final = new int[x][y];\n\t\t\n\t\tfor( int i = 0; i < x; i++ )\n\t\t{\n\t\t\tfor( int j = 0; j < y; j++ )\n\t\t\t{\n\t\t\t\tif( i == x - 1 && j == y - 1)\n\t\t\t\t\tFinal[i][j] = -1;\n\t\t\t\telse\n\t\t\t\t\tFinal[i][j] = count++;\n\t\t\t}\n\t\t}\n\t\tAbstractBoard temp = boards[boards.length - 1];\n\t\t\n\t\tfor( int i = 0; i < x; i++ )\n\t\t{\n\t\t\tfor( int j = 0; j < y; j++ )\n\t\t\t{\n\t\t\t\tif( temp.cell(i, j) != Final[i][j] )\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif( boards.length >= 2) {\n\t\t\tint compareX, compareY;\n\t\t\tfor( int i = 0; i < boards.length - 1; i++)\n\t\t\t{\n\t\t\t\tx = boards[i].getLocationX();\n\t\t\t\ty = boards[i].getLocationY();\n\t\t\t\t\n\t\t\t\tcompareX = boards[i + 1].getLocationX();\n\t\t\t\tcompareY = boards[i + 1].getLocationY();\n\t\t\t\t\n\t\t\t\tif( Math.abs( x - compareX ) != 1 && Math.abs( x - compareX ) != 1)\n\t\t\t\t{\n\t\t\t\t\tif( x != compareX || y != compareY )\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private void checkValid() {\n getSimType();\n getInitialConfig();\n getIsOutlined();\n getEdgePolicy();\n getNeighborPolicy();\n getCellShape();\n }", "public boolean checkForVictory() {\n // keep track of whether we have seen any pieces of either color.\n boolean anyWhitePieces = false;\n boolean anyRedPieces = false;\n // iterate through each row\n for (Row row : this.redBoard) {\n // whether we iterate through the red or white board does not matter; they contain the same pieces, just\n // in a different layout\n // iterate through each space in a row\n for (Space space : row) {\n // if there is a piece on this space\n if (space.getPiece() != null) {\n if (space.getPiece().getColor() == Piece.COLOR.RED) {\n // and if it's red, we have now seen at least one red piece\n anyRedPieces = true;\n } else if (space.getPiece().getColor() == Piece.COLOR.WHITE) {\n // and if it's white, we have now seen at least one white piece\n anyWhitePieces = true;\n }\n }\n }\n }\n // if we haven't seen any pieces of a color, then the other player has won\n if (!anyRedPieces) {\n // white player has won\n markGameAsDone(getWhitePlayer().getName() + \" has captured all the pieces.\");\n return true;\n } else if (!anyWhitePieces) {\n // red player has won\n markGameAsDone(getRedPlayer().getName() + \" has captured all the pieces.\");\n return true;\n }\n return false;\n }", "public static boolean isValid(int[][] board)\r\n\t{\r\n\t\t// Verifie les lignes et les colonnes\r\n\t\tfor (int i = 0; i < board.length; i++)\r\n\t\t{\r\n\t\t\tBitSet bsRow = new BitSet( 9);\r\n\t\t\tBitSet bsColumn = new BitSet( 9);\r\n\t\t\tfor (int j = 0; j < board[i].length; j++)\r\n\t\t\t{\r\n\t\t\t\tif (board[i][j] == 0 || board[j][i] == 0)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tif (bsRow.get( board[i][j] - 1) || bsColumn.get( board[j][i] - 1))\r\n\t\t\t\t\treturn false;\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tbsRow.set( board[i][j] - 1);\r\n\t\t\t\t\tbsColumn.set( board[j][i] - 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Verifie la taille de la grile\r\n\t\tfor (int rowOffset = 0; rowOffset < 9; rowOffset += 3)\r\n\t\t{\r\n\t\t\tfor (int columnOffset = 0; columnOffset < 9; columnOffset += 3)\r\n\t\t\t{\r\n\t\t\t\tBitSet threeByThree = new BitSet( 9);\r\n\t\t\t\tfor (int i = rowOffset; i < rowOffset + 3; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfor (int j = columnOffset; j < columnOffset + 3; j++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (board[i][j] == 0)\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tif (threeByThree.get( board[i][j] - 1))\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthreeByThree.set( board[i][j] - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Renvoie Vrai\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean isSolved () {\n\t\tCube222 solved = new Cube222();\n\t\tfor ( int ctr = 0 ; ctr < state_.length ; ctr++ ) {\n\t\t\tif ( state_[ctr].id() != ctr\n\t\t\t || state_[ctr].frontback() != solved.state_[ctr].frontback()\n\t\t\t || state_[ctr].updown() != solved.state_[ctr].updown()\n\t\t\t || state_[ctr].leftright() != solved.state_[ctr].leftright() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isValidBoard() {\n\t\t\n\t\tif(mainSlots.size() != NUM_MAIN_SLOTS) {\n\t\t\treturn false;\n\t\t} else if ((redHomeZone != null && redHomeZone.size() != NUM_HOME_SLOTS) ||\n\t\t\t\t(greenHomeZone != null && greenHomeZone.size() != NUM_HOME_SLOTS) ||\n\t\t\t\t(yellowHomeZone != null && yellowHomeZone.size() != NUM_HOME_SLOTS) || \n\t\t\t\t(blueHomeZone != null && blueHomeZone.size() != NUM_HOME_SLOTS)) {\n\t\t\treturn false;\n\t\t} else if ((redEndZone != null && redEndZone.size() != NUM_END_SLOTS) ||\n\t\t\t\t(greenEndZone != null && greenEndZone.size() != NUM_END_SLOTS) || \n\t\t\t\t(yellowEndZone != null && yellowEndZone.size() != NUM_END_SLOTS) || \n\t\t\t\t(blueEndZone != null && blueEndZone.size() != NUM_END_SLOTS)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "private boolean check() {\n if (!isBST()) System.out.println(\"Not in symmetric order\");\n if (!isSizeConsistent()) System.out.println(\"Subtree counts not consistent\");\n if (!isRankConsistent()) System.out.println(\"Ranks not consistent\");\n return isBST() && isSizeConsistent() && isRankConsistent();\n }", "static void checkCompleteness(Piece piece1, Piece piece2, Context context) {\n\t\tif (isSolved()) { //puzzle is solved\n \t\tpuzzleComplete(context); //cleanup\n \t} else {\n \t\tif(isPieceCorrect(piece1)) { //piece is in the correct position and orientation\n \t\t\tmarkPiece(piece1, true); //mark the piece as correct\n \t\t}\n \t\tif(Helper.isPieceCorrect(piece2)) { //piece is in the correct position and orientation\n \t\t\tmarkPiece(piece2, true); //mark the piece as correct\n \t\t}\n \t}\n\t}", "public void checkRep() {\n assert(wall.p1().x() >= BOARD_MIN_BOUND && wall.p1().x() <= BOARD_MAX_BOUND) :\n \"x coordinate of p1 must be within in the board\";\n assert(wall.p2().x() >= BOARD_MIN_BOUND && wall.p2().x() <= BOARD_MAX_BOUND) :\n \"x coordinate of p2 must be within in the board\";\n assert(wall.p1().y() >= BOARD_MIN_BOUND && wall.p1().y() <= BOARD_MAX_BOUND) :\n \"y coordinate of p1 must be within in the board\";\n assert(wall.p2().y() >= BOARD_MIN_BOUND && wall.p2().y() <= BOARD_MAX_BOUND) :\n \"y coordinate of p2 must be within in the board\";\n }", "private boolean diagWin(){ \r\n\t\treturn ((checkValue (board[0][0],board[1][1],board[2][2]) == true) || \r\n\t\t\t\t(checkValue (board[0][2], board[1][1], board[2][0]) == true)); \r\n\t}", "private boolean finalMilestoneAccomplished()\n {\n if( (firstMilestoneAccomplished()) &&\n (secondMilestoneAccomplished()) &&\n (thirdMilestoneAccomplished()) &&\n (beliefs.puzzle[2][1] == 10) &&\n (beliefs.puzzle[2][2] == 11) &&\n (beliefs.puzzle[2][3] == 12) &&\n (beliefs.puzzle[3][1] == 14) &&\n (beliefs.puzzle[3][2] == 15)\n\n )\n return true;\n else\n return false;\n }", "public int checkField() {\n //check win & impossible win\n if (checkDiagWin(X) || checkRowColWin(X)) {\n return 1; // X wins\n } else if (checkDiagWin(O) || checkRowColWin(O)) {\n return 2; // O wins\n }\n\n //check draw or not finished\n for (int i = 0; i < SIZE; i++) {\n for (int j = 0; j < SIZE; j++) {\n if (gameField[i][j] == ' ' || gameField[i][j] == '_') {\n return 0; // Not finished\n }\n }\n }\n return 3; // Draw\n }", "public boolean isFailed() {\n return candyName.equals(\"\") && pokemonHP == 10 && pokemonCP == 10;\r\n }", "public boolean solved() {\n if (orient != 1) {\n return false;\n }\n return onSide(colors[0]) && onSide(colors[1]);\n }", "Boolean getCompletelyCorrect();", "private void CheckWin() throws VictoryException {\n if (!isMiddleSquareEmpty()) {\n checkDiagonalTopRightToBottomLeft();\n checkDiagonalTopLeftToBottomRight();\n }\n\n checkHorozontalWin();\n checkVercticalWin();\n\n if (didAnyoneWin) {resetBoard(myGame);\n throw (new VictoryException());\n }\n }", "public boolean isPuzzleSolved() {\n\t\t// check rows/col/block )\n\t\tfor (int i = 1; i <= N; i++) {\n\t\t\tif ((this.constraints[i][0].nextClearBit(1) < N + 1) || (this.constraints[0][i].nextClearBit(1) < N + 1)\n\t\t\t\t\t|| (this.constraints[N + 1][i].nextClearBit(1) < N + 1))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private boolean colWin(){ \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tif (checkValue (board[0][i], board[1][i], board[2][i]))\r\n\t\t\t\treturn true; \r\n\t\t}\r\n\t\treturn false; \r\n\t}", "private void checkVercticalWin() throws VictoryException {\n\n for (int x = 0; x < 3; x++) {\n if (myGame.myBoard[x].getText().toUpperCase().length() > 0) {\n\n if (myGame.myBoard[x].getText().toUpperCase().equals(myGame.myBoard[x + 3].getText().toUpperCase())\n && myGame.myBoard[x].getText().toUpperCase().equals(myGame.myBoard[x + 6].getText().toUpperCase())) {\n didAnyoneWin = true;\n }\n }\n\n if (didAnyoneWin) {\n throw (new VictoryException());\n }\n }\n }", "boolean isRollbackOnConstraintViolation();", "public boolean validate() {\n double ab = lengthSide(a, b);\n double ac = lengthSide(a, c);\n double bc = lengthSide(b, c);\n\n return ((ab < ac + bc)\n && (ac < ab + bc)\n && (bc < ab + ac));\n }", "private boolean isBoardFull() {\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n if (boardState[i][j] != 'X' && boardState[i][j] != 'O') {\n return false; \n }\n }\n }\n return true; \n }", "private boolean is_valid(int x, int y, int proposed_color) {\n\t\tfor (int x1 = 1; x1 <= x; x1++) {\n\t\t\tif (color[x1 - 1][y - 1] == proposed_color)\n\t\t\t\treturn false;\n\t\t}\n\t\tfor (int y1 = 1; y1 <= y; y1++) {\n\t\t\tif (color[x - 1][y1 - 1] == proposed_color)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private boolean isLegalState(int[] state){\n int[] stateOtherSide = new int[3];\n stateOtherSide[0] = totalMissionaries - state[0];\n stateOtherSide[1] = totalCannibals - state[1];\n stateOtherSide[2] = state[2]==0 ? 1 : 0;\n\n if((state[0] < state[1]) && state[0] >0 || (stateOtherSide[0] < stateOtherSide[1]) && stateOtherSide[0] > 0) {\n return false;\n }else{\n return true;\n }\n }", "private static boolean colAreInvalid(int[][] grid) {\n\t\tfor(int i = 0; i < BOUNDARY; i++) {\n\t\t\tList<Integer> row = new ArrayList<>();\n\t\t\tfor(int j = 0; j < BOUNDARY; j++) {\n\t\t\t\trow.add(grid[i][j]);\n\t\t\t}\n\t\t\tif(collectionHasRepeat(row)) return true;\n\t\t}\n\t\treturn false;\n\t}", "boolean isLegal(String move) {\n int[][] theStatusBoard;\n if (_playerOnMove == ORANGE) {\n theStatusBoard = _orangeStatusBoard;\n } else {\n theStatusBoard = _violetStatusBoard;\n }\n Pieces thispiece = new Pieces();\n String piecename = move.substring(0, 1);\n int col = getCoordinate(move.substring(1, 2));\n int row = getCoordinate(move.substring(2, 3));\n int ori = Integer.parseInt(move.substring(3, 4));\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n if (row + depth - 1 > 13 || col + length - 1 > 13) {\n System.out.println(\"Your move makes your piece out of the board, try again!\");\n return false;\n }\n\n boolean has1 = false;\n boolean no2 = true;\n\n int i, j;\n for (i = 0; i < depth; i++) {\n for (j = 0; j < length; j++) {\n if (finalPositions[i][j] == 1) {\n if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 1) {\n has1 = true;\n } else if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 2) {\n return false;\n }\n }\n }\n }\n System.out.println(\"has1: \" + has1);\n return has1;\n }", "void validateState() throws EPPCodecException {\n // add/chg/rem\n if ((addDsData == null) && (chgDsData == null) && (remKeyTag == null)) {\n throw new EPPCodecException(\"EPPSecDNSExtUpdate required attribute missing\");\n }\n \n // Ensure there is only one non-null add, chg, or rem\n\t\tif (((addDsData != null) && ((chgDsData != null) || (remKeyTag != null)))\n\t\t\t\t|| ((chgDsData != null) && ((addDsData != null) || (remKeyTag != null)))\n\t\t\t\t|| ((remKeyTag != null) && ((chgDsData != null) || (addDsData != null)))) {\n\t\t\tthrow new EPPCodecException(\"Only one add, chg, or rem is allowed\");\n\t\t}\n }", "private boolean isValidSolitaireBoard() {\n \n /**\n \u0016The number of piles should be greater than or equal to zero but smaller than piles.length\n should be true\n */\n boolean containsPiles = numPiles >= 0 && numPiles < piles.length;\n \n /**\n The number of piles should be equal to the CARD_TOTAL.\n should be true\n */\n boolean pilesSizeEqualCardTotal = (piles.length == CARD_TOTAL);\n \n /**\n None of the elements in the partially filled array is equal to zero\n should be true\n */\n boolean pilesDoesntContainZeros = true;\n \n /**\n The card sum is equal to the card total\n should be true\n */\n boolean cardSumEqualCardTotal = true;\n \n \n if (containsPiles && pilesSizeEqualCardTotal){\n int cardSum = 0;\n for (int i = 0; i < numPiles; i++){\n cardSum += piles[i];\n //checks if array has any zeros\n if (piles [i] == 0)\n pilesDoesntContainZeros = false;\n }\n //check if the card sum is equal to the card total\n if (cardSum != CARD_TOTAL){\n cardSumEqualCardTotal = false;\n }\n }\n \n //returns true if all true\n return containsPiles && pilesSizeEqualCardTotal && cardSumEqualCardTotal &&\n pilesDoesntContainZeros;\n }", "public boolean isValid() {\n //valid melds must have 3+ tile\n if (tiles.size() < 3) {\n //System.out.println(\"fail 1\");\n return false;\n }\n if (tiles.get(0).getColour() == tiles.get(1).getColour() &&\n\t\t\ttiles.get(0).getValue() != tiles.get(1).getValue()) { //test a run\n\t\t\tif (this.size() > 13) {\n //System.out.println(\"fail 2\");\n return false;\n }\n for (int i=1; i<tiles.size(); i++) {\n if (tiles.get(i).getColour() != tiles.get(0).getColour()) { //make sure all are same colour\n //System.out.println(\"fail 3\");\n return false;\n }\n if (tiles.get(i).getValue() != (tiles.get(0).getValue() + i)) { //make sure all values make a run\n //System.out.println(\"fail 4\");\n return false;\n }\n }\n } else { //test a set\n Set<Character> colours = new HashSet<>();\n for (int i=0; i<tiles.size(); i++) {\n if (tiles.get(i).getValue() != tiles.get(0).getValue()) { //all are same value\n //System.out.println(\"fail 5\");\n\t\t\t\t\treturn false;\n }\n\n if (colours.contains(tiles.get(i).getColour()) && tiles.get(i).getColour() != 'J') { //check for duplicate colours\n //System.out.println(\"fail 6\");\n\t\t\t\t\treturn false;\n } else {\n\t\t\t\t\tcolours.add(tiles.get(i).getColour()); //keep track of all the colours this set has\n }\n }\n if (this.size() > 4) { //only possible if there are 5 cards, including a joker\n //System.out.println(\"fail 7\");\n\t\t\t\treturn false;\n }\n }\n\n return true; \n }", "private boolean isValidMove(int pressedHole) {\n return getPlayerHole(pressedHole).getKorgools() != 0;\n }", "@Override\n public boolean isValidMove(Tile target, Board board) {\n if (target == null || board == null) {\n throw new NullPointerException(\"Arguments for the isValidMove method can not be null.\");\n }\n // current and target tiles have to be on a diagonal (delta between row and col index have to be identical)\n int currentCol = this.getTile().getCol();\n int currentRow = this.getTile().getRow();\n int targetCol = target.getCol();\n int targetRow = target.getRow();\n\n int deltaRow = Math.abs(currentRow - targetRow);\n int deltaCol = Math.abs(currentCol - targetCol);\n int minDelta = Math.min(deltaCol, deltaRow);\n\n boolean sameDiagonal = deltaCol == deltaRow;\n\n // check if there are pieces between the tiles\n boolean noPiecesBetween = true;\n // Directions -- (Up and to the left) , -+ (Up and to the right), ++, +-\n if (targetRow < currentRow && targetCol < currentCol) { // --\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow - delta, currentCol - delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n\n } else if (targetRow > currentRow && targetCol < currentCol) { // +-\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow + delta, currentCol - delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n } else if (targetRow > currentRow && targetCol > currentCol) { // ++\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow + delta, currentCol + delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n } else if (targetRow < currentRow && targetCol > currentCol) { // -+\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow - delta, currentCol + delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n }\n\n return sameDiagonal && noPiecesBetween;\n }", "public boolean solved()\n\t{\n\t\tfor(int row = 0; row < board.length; row++)\n\t\t{\n\t\t\tfor(int col = 0; col < board.length; col++)\n\t\t\t{\n\t\t\t\tif(board[row][col] == 0)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean checkGameOver(){\n\t\tfor(int x = 0; x < this.tile[3].length; x++){\n\t\t if(this.isFilled(3, x)){\n\t\t \tSystem.out.println(\"game over\");\n\t\t return true;\n\t\t }\n\t\t}\n\t\treturn false;\n\t}", "public boolean isBoardSolved() {\n for (int goal : goalCells) {\n if (!((board[goal] & 15) == BOX_ON_GOAL)) {\n return false;\n }\n }\n return true;\n }", "@Test\r\n\tpublic void testDirectCheck() {\n\t\tBoard b = new Board();\r\n\t\tb.state = new Piece[][] //set up the board in the standard way\r\n\t\t\t\t{\r\n\t\t\t\t{new Rook(\"b\"), new Knight(\"b\"),new Bishop(\"b\"),new Queen(\"b\"), new King(\"b\"), new Bishop(\"b\"),\r\n\t\t\t\t\tnew Knight(\"b\"), new Rook(\"b\")},\r\n\t\t\t\t{new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),\r\n\t\t\t\t\t\tnew Pawn(\"b\")},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,new Knight(\"b\"),null,null},\r\n\t\t\t\t{new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),\r\n\t\t\t\t\tnew Pawn(\"w\")},\r\n\t\t\t\t{new Rook(\"w\"), new Knight(\"w\"),new Bishop(\"w\"),new Queen(\"w\"), new King(\"w\"), new Bishop(\"w\"),\r\n\t\t\t\t\tnew Knight(\"w\"), new Rook(\"w\")}\r\n\t\t\t\t};\r\n\t\tassertTrue(b.whiteCheck());\t\r\n\t}", "private boolean isValidBuild(List<Card> build) {\n if ((build.size() == 0) || (build.size() == 1)) {\n return true;\n }\n for (int i = 1; i < build.size(); i++) {\n boolean result = (CardSuit.differentColors(build.get(i), build.get(i - 1))\n && (build.get(i).getValue().intVal == (build.get(i - 1).getValue().intVal - 1)));\n if (!result) {\n return false;\n }\n }\n return true;\n }", "public boolean checkmate()\n {\n return checkmate(PieceColor.BLACK)||checkmate(PieceColor.WHITE);\n }", "public boolean check() {\n BigInteger t1 = y.modPow(int2, c.p);\n BigInteger t2 = x.modPow(int3, c.p);\n BigInteger t3 = ((t2.add(c.a.multiply(x))).add(c.b)).mod(c.p);\n return t1.compareTo(t3) == 0;\n }", "public boolean checkForStaleMate(Player player) {\r\n\t\t// Both colors only have king left\t\r\n\t\tif (this.black.size() == 1 && this.white.size() == 1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn checkAnyPieceCanMove(player);\r\n\t\t}\r\n\t}", "private boolean isBoardFilled() {\n for (char[] y : board) {\n for (char xy : y) {\n if (xy == 0) {\n return false;\n }\n }\n }\n return true;\n }", "public boolean isCorrectValue(){\r\n for(int i=0; i<4; i++){\r\n if(matrixMastermind.getCellValue(currentRow, i) != value[i])\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isValidSetup() {\n\t\tif(!rowCheck())\n\t\t\treturn false;\n\t\tif(!columnCheck())\n\t\t\treturn false;\n\t\tif(!subGridCheck())\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public boolean isInCheckMate() {\n\t\treturn this.isInCheck && !hasEscapeMoves();\n\t}", "public int checkStatus(){\n\t\t\n\t\tint status = 0;\n\t\t\n\t\tif(numRows != numCols || !isValidSymbol(treeSymbol) || !isValidSymbol(tentSymbol)) {\n\t\t\tstatus = 0;\n\t\t\treturn status;\n\t\t}\n\t\t\n\t\tif(numRows != numCols) {\n\t\t\tstatus = 3;\n\t\t\treturn status;\n\t\t}\n\t\t\n\t\treturn 2;\n\t\t\n\t}", "boolean hasCorrect();", "private boolean checkDraw()\n {\n \tboolean IsDraw = true;\n \tfor(int i =0;i<movesPlayed.length;i++)\n \t{\n \t\t//\"O\" or \"X\"\n \t\tif (!\"X\".equals(movesPlayed[i]) || !\"O\".equals(movesPlayed[i]))\n \t\t//if(movesPlayed[i] != 'X' || movesPlayed[i] != 'O')\n \t\t{\n \t\t\t//System.out.println(movesPlayed[i]);\n \t\t\t//System.out.println(\"False condition \");\n \t\t\tIsDraw = false;\n \t\t\treturn IsDraw;\n \t\t}\n \t}\n \t//System.out.println(\"true condition \");\n \t\n \treturn IsDraw;\n }", "@Test public void testInconsistentBoard() {\n assertThrows(IOException.class, () -> {\n new CrosswordBoard(\"puzzles/inconsistent.puzzle\");\n }, \"should fail because two letters that overlap are not the same\");\n }", "@Override\n\tpublic boolean valid(Solitaire game) {\n\t\tif (crosspile.empty())\n\t\t\treturn true;\n\t\tif ((crosspile.peek().isAce()) && (cardBeingDragged.getRank() == cardBeingDragged.KING))\n\t\t\treturn true;\n\t\tif ((cardBeingDragged.getRank() == crosspile.rank() - 1))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isValid(Board board) {\n if (!from.isValid(board.size) || !to.isValid(board.size)) {\r\n return false;\r\n }\r\n\r\n // Confirm the 'from' space is occupied\r\n if (!board.b[from.row][from.column]) {\r\n return false;\r\n }\r\n\r\n // Confirm the 'to' space is empty\r\n if (board.b[to.row][to.column]) {\r\n return false;\r\n }\r\n\r\n int rowJump = Math.abs(from.row - to.row);\r\n int colJump = Math.abs(from.column - to.column);\r\n\r\n if (rowJump == 0) {\r\n if (colJump != 2) {\r\n return false;\r\n }\r\n }\r\n else if (rowJump == 2) {\r\n if (colJump != 0 && colJump != 2) {\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n\r\n // Confirm the 'step' space is occupied\r\n return board.b[(from.row + to.row) / 2][(from.column + to.column) / 2];\r\n }", "public boolean wasValid() {\n return !wasInvalid();\n }", "private void checkColors(){\r\n\t\tpaintCorner(RED);\r\n\t\tif(leftIsClear()){\r\n\t\t\tturnLeft();\r\n\t\t\tmove();\r\n\t\t\tif(cornerColorIs(null)){\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnLeft();\r\n\t\t\t\tpaintCorner(GREEN);\r\n\t\t\t}else{\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnLeft();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(rightIsClear()){\r\n\t\t\tturnRight();\r\n\t\t\tmove();\r\n\t\t\tif(cornerColorIs(null)){\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnRight();\r\n\t\t\t\tpaintCorner(GREEN);\r\n\t\t\t}else{\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnRight();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(frontIsClear()){\r\n\t\t\tmove();\r\n\t\t\tif(cornerColorIs(null)) {\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tpaintCorner(GREEN);\r\n\t\t\t\tturnAround();\r\n\t\t\t}else{\r\n\t\t\t\tmoveBack();\r\n\t\t\t\tturnAround();\r\n\t\t\t}\r\n\t\t}\r\n\t\tmakeMove();\r\n\t}", "public boolean moveValidation(Board board, Piece piece, int sourceX, int sourceY, int targetX, int targetY){//TODO make directions in Piece class\n int diffX = targetX - sourceX;\n int diffY = targetY - sourceY;\n if (!board.isPieceAtLocation(targetX, targetY) || board.isPieceAtLocationCapturable(piece.getColour(), targetX, targetY)) {\n if(diffX==0 && diffY > 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 0, 1);\n else if(diffX > 0 && diffY == 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 1, 0);\n else if(diffX < 0 && diffY == 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, -1, 0);\n else if(diffX==0 && diffY < 0 )\n return !board.isPieceBetweenLocations(sourceX, sourceY, targetX, targetY, 0, -1);\n }\n return false;\n }", "public boolean isValid(int row, int column) {\n for (int i = 1; i <= row; i++)\n if (queens[row - i] == column // Check column\n || queens[row - i] == column - i // Check upleft diagonal\n || queens[row - i] == column + i) // Check upright diagonal\n return false; // There is a conflict\n return true; // No conflict\n }", "public boolean checkIsValid() {\n for (Terminal s : sources) {\n if (!s.isValid()) {\n return false;\n }\n }\n for (Terminal t : sinks) {\n if (!t.isValid()) {\n return false;\n }\n }\n\n // check cap constraints on edges\n for (SingleEdge[] row : matrix) {\n for (SingleEdge e : row) {\n if (e != null && !e.isValid()) {\n return false;\n }\n }\n }\n\n // check for conversation of flow at all nodes\n for (int i = 0; i < n; i++) {\n // compute the flow in and out \n double in = 0;\n double out = 0;\n for (int j = 0; j < n; j++) {\n if (matrix[j][i] != null) {\n in += matrix[j][i].getFlow();\n }\n }\n for (int j = 0; j < n; j++) {\n if (matrix[i][j] != null) {\n out += matrix[i][j].getFlow();\n }\n }\n // make sure it aligns \n if (!isSource(i) && !isSink(i)) {\n if (in != out) {\n return false;\n }\n } else if (isSource(i)) {\n if (out - in != getNode(i).getFlow()) {\n return false;\n }\n } else { // is sink\n if (in - out != getNode(i).getFlow()) {\n return false;\n }\n }\n }\n return true;\n }", "public boolean checkBoardFull() {\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (grid[i][j].getSymbol() == '-')\n return false;\n }\n }\n return true;\n }", "public static boolean isLegal(int[][] board) {\nif (!isRectangleLegal(board, 0, 2, 0, 2, \"Block 1\")) return false;\nif (!isRectangleLegal(board, 3, 5, 0, 2, \"Block 2\")) return false;\nif (!isRectangleLegal(board, 6, 8, 0, 2, \"Block 3\")) return false;\nif (!isRectangleLegal(board, 0, 2, 3, 5, \"Block 4\")) return false;\nif (!isRectangleLegal(board, 3, 5, 3, 5, \"Block 5\")) return false;\nif (!isRectangleLegal(board, 6, 8, 3, 5, \"Block 6\")) return false;\nif (!isRectangleLegal(board, 0, 2, 6, 8, \"Block 7\")) return false;\nif (!isRectangleLegal(board, 3, 5, 6, 8, \"Block 8\")) return false;\nif (!isRectangleLegal(board, 6, 8, 6, 8, \"Block 9\")) return false;\n \n// check the nine columns\nif (!isRectangleLegal(board, 0, 0, 0, 8, \"Column 0\")) return false;\nif (!isRectangleLegal(board, 1, 1, 0, 8, \"Column 1\")) return false;\nif (!isRectangleLegal(board, 2, 2, 0, 8, \"Column 2\")) return false;\nif (!isRectangleLegal(board, 3, 3, 0, 8, \"Column 3\")) return false;\nif (!isRectangleLegal(board, 4, 4, 0, 8, \"Column 4\")) return false;\nif (!isRectangleLegal(board, 5, 5, 0, 8, \"Column 5\")) return false;\nif (!isRectangleLegal(board, 6, 6, 0, 8, \"Column 6\")) return false;\nif (!isRectangleLegal(board, 7, 7, 0, 8, \"Column 7\")) return false;\nif (!isRectangleLegal(board, 8, 8, 0, 8, \"Column 8\")) return false;\n \n// check the nine rows\nif (!isRectangleLegal(board, 0, 8, 0, 0, \"Row 0\")) return false;\nif (!isRectangleLegal(board, 0, 8, 1, 1, \"Row 1\")) return false;\nif (!isRectangleLegal(board, 0, 8, 2, 2, \"Row 2\")) return false;\nif (!isRectangleLegal(board, 0, 8, 3, 3, \"Row 3\")) return false;\nif (!isRectangleLegal(board, 0, 8, 4, 4, \"Row 4\")) return false;\nif (!isRectangleLegal(board, 0, 8, 5, 5, \"Row 5\")) return false;\nif (!isRectangleLegal(board, 0, 8, 6, 6, \"Row 6\")) return false;\nif (!isRectangleLegal(board, 0, 8, 7, 7, \"Row 7\")) return false;\nif (!isRectangleLegal(board, 0, 8, 8, 8, \"Row 8\")) return false;\nreturn true;\n }", "private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }", "public boolean IsSafe(int rowIndex, int columIndex) {\n for (int i = 0; i < this.SIZE_OF_CHESS_BOARD; i++) {\n //this.list_cells[rowIndex][i].setBackground(Color.red);\n if (maps[rowIndex][i] == true) {\n return false;\n }\n }\n\n //check in a colums\n for (int i = 0; i < this.SIZE_OF_CHESS_BOARD; i++) {\n //this.list_cells[i][columIndex].setBackground(Color.red);\n if (maps[i][columIndex] == true) {\n return false;\n }\n }\n\n //check in a diagonal line\n for (int x = -(this.SIZE_OF_CHESS_BOARD - 1); x < this.SIZE_OF_CHESS_BOARD; x++) {\n for (int y = -(this.SIZE_OF_CHESS_BOARD - 1); y < this.SIZE_OF_CHESS_BOARD; y++) {\n int newRowIndex = x + rowIndex;\n int newColumIndex = y + columIndex;\n if (newColumIndex >= 0 && newColumIndex < this.SIZE_OF_CHESS_BOARD && newRowIndex >= 0 && newRowIndex < this.SIZE_OF_CHESS_BOARD) {\n if (newColumIndex + newRowIndex == columIndex + rowIndex || columIndex - rowIndex == newColumIndex - newRowIndex) {\n // System.out.println(newRowIndex + \",\" + newColumIndex);\n if (maps[newRowIndex][newColumIndex] == true) {\n return false;\n }\n //this.list_cells[newRowIndex][newColumIndex].setBackground(Color.red);\n }\n }\n }\n }\n return true;\n }", "public static boolean checkSafety(int[][] board, int row, int col) {\n for (int i = row - 1, j = col; i >= 0; i--) {\n if (board[i][j] == 1) {\n return false;\n }\n }\n\n // LEFT D\n for (int i = row - 1, j = col - 1; i >= 0 && j >= 0; i--, j--) {\n if (board[i][j] == 1) {\n return false;\n }\n }\n // Right D\n for (int i = row - 1, j = col + 1; i >= 0 && j < board.length; i--, j++) {\n if (board[i][j] == 1) {\n return false;\n }\n }\n\n return true;\n }", "protected void checkState() {\n\t\tboolean valid = true;\n\t\tinvalidFieldEditor = null;\n\t\t// The state can only be set to true if all\n\t\t// field editors contain a valid value. So we must check them all\n\t\tif (fields != null) {\n\t\t\tint size = fields.size();\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\tFieldEditor editor = fields.get(i);\n\t\t\t\tvalid = valid && editor.isValid();\n\t\t\t\tif (!valid) {\n\t\t\t\t\tinvalidFieldEditor = editor;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsetValid(valid);\n\t}", "@Test\n void checkCannotForceWithForcedCellOccupied() {\n assertFalse(abilities.checkCanMove(turn, board.getCellFromCoords(1, 0)));\n }", "public boolean checkMoveValidity(Board board, Piece[][] b, int curRow, int curCol, int newRow, int newCol)\n {\n if(new Rook(color).checkMoveValidity(board, b, curRow, curCol, newRow, newCol) || new Bishop(color).checkMoveValidity(board, b, curRow, curCol, newRow, newCol))\n return true;\n return false;\n }", "void checkRep() {\n\t\tassert this.clauses != null : \"SATProblem, Rep invariant: clauses non-null\";\n\t}", "private boolean columnCheck() {\n\t\tfor(int col = 0; col < puzzle[0].length; col++) {\n\t\t\tfor(int i = 0; i < puzzle[0].length; i++) {\n\t\t\t\tif(puzzle[i][col] != 0) {\n\t\t\t\t\tfor(int j = i + 1; j < puzzle[0].length; j++) {\n\t\t\t\t\t\tif(puzzle[i][col] == puzzle[j][col])\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean moveIsValid(Move move){\n BoardSpace[][] boardCopy = new BoardSpace[Constants.BOARD_DIMENSIONS][Constants.BOARD_DIMENSIONS];\n for(int i = 0; i < Constants.BOARD_DIMENSIONS; i++){\n for(int j = 0; j < Constants.BOARD_DIMENSIONS; j++){\n boardCopy[i][j] = new BoardSpace(boardSpaces[i][j]);\n }\n }\n int row = move.getStartRow();\n int col = move.getStartCol();\n String ourWord = \"\";\n String currentWord = \"\";\n for (Tile tile: move.getTiles()){\n ourWord += tile.getLetter();\n if (move.isAcross()){\n col++;\n } else {\n row++;\n }\n }\n currentWord = ourWord;\n if(move.isAcross()){\n //check if we keep going right we invalidate the word\n while(col+1 < boardCopy.length && !boardCopy[row][++col].isEmpty() ){\n if( isValidWord(currentWord += boardCopy[row][col].getTile().getLetter()) == false ) return false;\n }\n //check if we keep going left we invalidate the word\n col = move.getStartCol();\n currentWord = ourWord;\n while(col-1 >= 0 && !boardCopy[row][--col].isEmpty() ){\n if(!isValidWord( currentWord = boardCopy[row][col].getTile().getLetter() + currentWord ) ) return false;\n }\n } else if(!move.isAcross()){\n row = move.getStartRow(); col = move.getStartCol();\n currentWord = ourWord;\n //check if we keep going down we invalidate the word;\n while(row+1 < boardCopy.length && !boardCopy[++row][col].isEmpty()){\n if( !isValidWord(currentWord += boardCopy[row][col].getTile().getLetter() )) return false;\n }\n row = move.getStartRow();\n currentWord = ourWord;\n while(row-1 >= 0 && !boardCopy[--row][col].isEmpty()){\n if( !isValidWord( currentWord = boardCopy[row][col].getTile().getLetter() + currentWord )) return false;\n }\n }\n return true;\n }", "public boolean check() {\n return StuffUtils.equal(structure, SpigotUtils.structBetweenTwoLocations(pos1, pos2, material));\n }", "private static boolean checkWin() {\n\t\tfor (int i = 0; i < nRows; i++)\n\t\t\tfor (int j = 0; j < nColumns; j++) {\n\t\t\t\tCell cell = field.getCellAt(i, j);\n\t\t\t\tif (cell.hasMine() && !cell.hasSign())\t // if the cell has a mine\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// but has no flag\n\t\t\t\t\treturn false;\n\t\t\t\tif (cell.getFlag() >= 0 && !cell.getVisiblity()) // if the cell has no\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// mine in it but\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// it is not visible\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\twin = gameOver = true;\n\t\treturn true;\n\t}", "public boolean isInCorrectPosition() {\n return originalPos == currentPos;\n }" ]
[ "0.65967333", "0.6574986", "0.65225685", "0.62151533", "0.617835", "0.61236036", "0.606732", "0.6056269", "0.60442334", "0.6015634", "0.59909195", "0.5935737", "0.59335685", "0.59298986", "0.5924944", "0.5922566", "0.5919327", "0.5917481", "0.5913688", "0.5910476", "0.59031767", "0.58838594", "0.5872401", "0.58588827", "0.58513033", "0.58363414", "0.58312607", "0.58145", "0.58050394", "0.5799628", "0.57965934", "0.57817763", "0.57774323", "0.5774086", "0.57649684", "0.57611036", "0.57530046", "0.5749198", "0.57456553", "0.5736412", "0.5732909", "0.57242334", "0.5721556", "0.5711169", "0.57082045", "0.5699984", "0.5695394", "0.56930476", "0.5691503", "0.5689019", "0.56884617", "0.5686053", "0.5679226", "0.56788623", "0.56778955", "0.56742245", "0.5671505", "0.5642131", "0.56385595", "0.5636317", "0.56332976", "0.5629269", "0.5625149", "0.56212866", "0.56186426", "0.5618597", "0.56181324", "0.5615509", "0.56129944", "0.56090397", "0.56051975", "0.5596317", "0.55936855", "0.55893546", "0.5589188", "0.55872107", "0.5584652", "0.5568112", "0.55635375", "0.5562973", "0.5558295", "0.5555494", "0.5551502", "0.5547116", "0.5534863", "0.5534743", "0.55303454", "0.5528999", "0.55267334", "0.5526046", "0.5524955", "0.55247235", "0.55226946", "0.55220807", "0.5510311", "0.5507567", "0.55014616", "0.5495496", "0.54948896", "0.5490957" ]
0.69316846
0
A constructor with no parameters that initializes Root field as null
public BalancedBinarySearchTree() { Root = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tree() {\n // constructor. no nodes in tree yet\n root = null;\n }", "public Tree() // constructor\n\t{ root = null; }", "public Tree(){\n root = null;\n }", "public ObjectBinaryTree() {\n root = null;\n }", "private void init() {\n if (root == null) {\n root = buildRoot();\n }\n }", "public TreeBuilder() {\n\t\troot = null;\n\t}", "public TreeRootNode() {\n super(\"root\");\n }", "public BST() {\r\n root = null;\r\n }", "public BinaryTree(){\r\n root = null;\r\n }", "public BST()\r\n\t{\r\n\t\troot = null;\r\n\t}", "public BinaryTree() {\n root = null;\n }", "public BinaryTree() {\n root = null;\n }", "BinaryTree()\n\t{\n\t\troot = null;\t\t\t\t\t\t// at starting root is equals to null\n\t}", "public LinkedBinaryTree() {\n\t\t root = null;\n\t}", "public RBTree() {\r\n\t\troot = null;\r\n\t}", "public BST() {\n\t\troot = null;\n\t}", "public static AsonValue CreateRootObject() {\n return CreateRootObject(null);\n }", "public BST() {\n this.root = null;\n }", "public BinaryTree()\r\n\t{\r\n\t\t// Initialize field values\r\n\t\tthis.counter = 0;\r\n\t\tthis.arrayCounter = 0;\r\n\t\tthis.root = null;\r\n\t}", "public BST(){\n\t\tthis.root = null;\n\t}", "public KdTree() {\n root = null;\n }", "public IntTree() {\n overallRoot = null;\n }", "public Node()\r\n {\r\n initialize(null);\r\n lbl = id;\r\n }", "public EventTree()\n\t{\n\t\tthis.root = null;\n\t}", "public AVLTree() \r\n\t{\r\n\t\tthis.root = new AVLNode(null);\r\n\t}", "private BinaryTree() {\n root = new Node(0);\n }", "public RedBlackTree()\n { \n \t root = null;\n }", "public AVLTree() {\n\t\tthis.root = null;\n\t}", "public ExpressionTree()\n\t\t{\n\t root = null;\n\t\t}", "private void createRootNode()\r\n {\r\n root = new Node(\"root\", null);\r\n Node.clear();\r\n }", "BinarySearchTree() {\n this.root = null;\n }", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "public BinaryTree()\n\t{\n\t\troot = null;\n\t}", "public JdbTree() {\r\n this(new Object [] {});\r\n }", "public BinarySearchTree(){\n\t\tthis.root = null;\n\t}", "public AVLTree() { \n super();\n // This acts as a sentinel root node\n // How to identify a sentinel node: A node with parent == null is SENTINEL NODE\n // The actual tree starts from one of the child of the sentinel node !.\n // CONVENTION: Assume right child of the sentinel node holds the actual root! and left child will always be null.\n \n }", "public JSONBuilder() {\n\t\tthis(null, null);\n\t}", "BSTDictionary() {\n\t\troot = null;// default root to null;\n\t}", "public BinaryTree() {\n count = 0;\n root = null;\n }", "public BSearchTree() {\n\t\tthis.overallRoot = null;\n\t}", "public MapNode()\n\t{\n\t\t// Call alternative constructor\n\t\tthis((AbstractNode)null);\n\t}", "public BinaryTree() {\r\n\t\troot = null;\r\n\t\tcount = 0;\r\n\t}", "public TreeNode(){ this(null, null, 0);}", "public RBTree() {\r\n\t\t// well its supposed just create a new Red Black Tree\r\n\t\t// Maybe create a new one that does a array of Objects\r\n\t}", "public Node() {\r\n\t}", "public Node() {\r\n\t}", "public TernaryTree() {\n root = null;\n\n }", "public Node() {\n }", "public BSTree2(){\n root = null;\n }", "public TreeNode() {\n // do nothing\n }", "public RBTree() {\n\t\troot = null;\n\t\tdrawer = new RBTreeDrawer();\n\t}", "public Node() {\n\t}", "public void makeEmpty()\n {\n root = nil;\n }", "public BinarySearchTree() {\n root = null;\n size = 0;\n }", "public DirectoryModel() {\r\n\tthis(null);\r\n }", "public AVL() {\r\n this.root = null;\r\n }", "public void makeEmpty() {\n root = null;\n }", "public JSONNode() {\n map = new HashMap<>();\n }", "private void buildRoot() {\n this.root = new GPRootTreeNode(this.tree);\n }", "public Leaf(){}", "public KdTree() {\n root = null;\n n = 0;\n }", "public LinkedBinaryTree() { // constructs an empty binary tree\n\n }", "public BinarySearchTree() {\r\n\t\troot = null;\r\n\t\tleftChild = null;\r\n\t\trightChild = null;\r\n\t}", "FractalTree() {\r\n }", "public Tree()\n\t{\n\t\tsuper(\"Tree\", \"tree\", 0);\n\t}", "public EmptyBinarySearchTree()\n {\n\n }", "public Node() {}", "public Node() {}", "public Node() {}", "public Node() {}", "public Node(){}", "public TreeNode(Object initValue)\r\n {\r\n this(initValue, null, null);\r\n }", "private HPTNode<K, V> buildRoot() {\n HPTNode<K, V> node = new HPTNode<K, V>(keyIdSequence++, null);\n node.children = reallocate(ROOT_CAPACITY);\n return node;\n }", "private Node() {\n\n }", "public HtmlTree()\n {\n // do nothing\n }", "public BinarySearchTree(Object root){\r\n\t\tthis.root = (KeyedItem)root;\r\n\t\tleftChild = null;\r\n\t\trightChild = null;\r\n\t}", "public T208() {\n root = new Node(-1);\n }", "public KdTree()\n {\n root = null;\n size = 0;\n }", "public BST() {\n }", "private Node() {\n // Start empty.\n element = null;\n }", "public JdbTree(TreeNode root) {\r\n this(root, false);\r\n }", "public JsonFactory() { this(null); }", "private Node createNullLeaf(Node parent) {\n Node leaf = new Node();\n leaf.color = Color.BLACK;\n leaf.isNull = true;\n leaf.parent = parent;\n leaf.count = Integer.MAX_VALUE;\n leaf.ID = Integer.MAX_VALUE;\n return leaf;\n }", "public Tree(String label) {\n treeName = label;\n root = null;\n }", "public void makeEmpty( )\r\n\t{\r\n\t\troot = null;\r\n\t}", "public BinaryTree() {\n\t}", "public BinaryTree()\n {\n this.root = null;\n this.actualNode = null;\n this.altMode = false;\n this.deepestRight = null;\n }", "public TreeNode()\r\n\t\t{\r\n\t\t\thead = null; //no data so set head to null\r\n\t\t}", "public GeneralTreeOfInteger() {\n root = null;\n count = 0;\n }", "public void makeEmpty() {\r\n\t\troot = null;\r\n\t}", "public KdTree() {\n this.root = null;\n this.size = 0;\n }", "public Node(){\n }", "public MyTreeSet()\r\n {\r\n root = null;\r\n }", "public void makeEmpty() {\n\t\troot = null;\n\t}", "public BSTMap() {\n root = null;\n size = 0;\n }", "public SegmentTree() {}", "public Node(){\n\n\t\t}", "public BST() {\n\n }", "public Node( Item root ) {\r\n\t\t\tsuper( null, 0, INTERACTIVE, null );\r\n\t\t\tthis.root = root;\r\n\t\t\tthis.root.parent = this;\r\n\t\t\tthis.children = new Container( false );\r\n\t\t\tthis.children.parent = this;\r\n\t\t}", "public BinarySearchTree(KeyedItem root) {\r\n\t\tthis.root = root;\r\n\t\tleftChild = null;\r\n\t\trightChild = null;\r\n\t\t\r\n\t}", "public BinaryNode() {\n\t\tthis(null);\t\t\t// Call next constructor\n\t}" ]
[ "0.74415535", "0.72366524", "0.7159564", "0.7078871", "0.7053996", "0.68822706", "0.6784491", "0.6779226", "0.6764834", "0.67549425", "0.67337483", "0.67337483", "0.6731564", "0.6727097", "0.6717535", "0.66874105", "0.66689736", "0.66441715", "0.6619487", "0.6580809", "0.65703154", "0.6566703", "0.65603155", "0.6557673", "0.6532084", "0.65233046", "0.65104336", "0.6486722", "0.646888", "0.6448774", "0.6444359", "0.6439224", "0.6437787", "0.64220554", "0.64177585", "0.64028007", "0.6351665", "0.63513863", "0.6328314", "0.6323257", "0.63178873", "0.63156307", "0.6312242", "0.63054556", "0.6299133", "0.6299133", "0.6295999", "0.6283069", "0.628076", "0.626887", "0.6268433", "0.6258789", "0.6250515", "0.62381816", "0.6231208", "0.6224638", "0.62186486", "0.61964417", "0.61788905", "0.61728406", "0.6168244", "0.6160833", "0.6155423", "0.615276", "0.6149901", "0.6142258", "0.6139107", "0.6139107", "0.6139107", "0.6139107", "0.6132575", "0.61301446", "0.61297584", "0.61146826", "0.61138797", "0.6106772", "0.6105182", "0.6087148", "0.6073345", "0.6070362", "0.60551566", "0.604075", "0.600375", "0.5999081", "0.59982955", "0.5995916", "0.5994189", "0.5980825", "0.5978395", "0.5969238", "0.5965335", "0.59640723", "0.5964044", "0.59566605", "0.59444475", "0.5940273", "0.5936509", "0.59339166", "0.59309435", "0.59233457", "0.59155333" ]
0.0
-1
Insert method that inserts a value (given by the parameter) into a new node into the tree. The method utilizes the TreeNodeWrapper to manage the TreeNode
public boolean Insert(int newInt) { //initialize the parent node TreeNodeWrapper p = new TreeNodeWrapper(); //initialize the child node TreeNodeWrapper c = new TreeNodeWrapper(); //initialize a new TreeNode TreeNode n = new TreeNode(); //set value of TreeNode as integer passed in method n.Data = newInt; //initialize left node as null n.Left = null; //initialize right node as null n.Right = null; //will be inserted as a leaf so its balanceFactor will be zero n.balanceFactor = 0; //if tree is empty set a root node if(Root == null) { Root = n; } else //determine which node is parent node using FindNode Method { FindNode(newInt, p, c); //if new value is less than parent node then set as left node if(newInt < p.Get().Data ) { p.Get().Left = n; } else //else new value is more than parent node and set as right node { p.Get().Right = n; } } //insert successful return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insertNode(T insertValue){\n if(root == null)\n root = new TreeNode<T>(insertValue);\n else\n root.insert(insertValue);\n }", "public void insert(T insertValue){\n // insert in left subtree\n if(insertValue.compareTo(data) < 0){\n // insert new TreeNode\n if(leftNode == null)\n leftNode = new TreeNode<T>(insertValue);\n else\n leftNode.insert(insertValue);\n }\n\n // insert in right subtree\n else if (insertValue.compareTo(data) > 0){\n // insert new treeNode\n if(rightNode == null)\n rightNode = new TreeNode<T>(insertValue);\n else // continue traversing right subtree\n rightNode.insert(insertValue);\n }\n }", "public void insert(T value) {\n\n // Assigns the new node as the root if root is empty.\n if (root == null) root = new Node<>(value);\n\n // Otherwise, traverses the tree until an appropriate empty branch is found.\n else insertRecursively(root, value);\n }", "@Override\n\tpublic void insert(T value) \n\t{\n\t\tif(root==null)\n\t\t{\n\t\t\t//Add the new node to the root\n\t\t\troot = new TreeNode<T>(value);\n\t\t}\n\t\t//if the value compared to the root is less than zero (it's smaller than the root)\n\t\telse if(value.compareTo(value())<0)\n\t\t{\n\t\t\t//move to the left node, try insert again\n\t\t\troot.left().insert(value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//move to the right node, try insert again\n\t\t\troot.right().insert(value);\n\t\t}\n\t}", "private Node _insert(Node node, T value) {\n if (node == null) {\n node = new Node(null, null, value);\n }\n /**\n * If the value is less than the current node's value, choose left.\n */\n else if (value.compareTo(node.element) < 0) {\n node.left = _insert(node.left, value);\n }\n /**\n * If the value is greater than the current node's value, choose right.\n */\n else if (value.compareTo(node.element) > 0) {\n node.right = _insert(node.right, value);\n }\n /** \n * A new node is created, or\n * a node with this value already exists in the tree.\n * return this node\n * */\n return node;\n\n }", "public void insert(int value){\r\n\t\tNode node = new Node<>(value);\r\n\t\t//If the tree is empty\r\n\t\tif ( root == null ) {\r\n\t\t\troot = node;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tinsertRec(root, node);\r\n\t}", "public void insert (T value) {\n if (left == null) {\n left = new BinaryTreeNode<>(value);\n return;\n }\n\n if (right == null) {\n right = new BinaryTreeNode<>(value);\n return;\n }\n\n if (getHeight(left) <= getHeight(right)) {\n left.insert(value);\n } else {\n right.insert(value);\n }\n }", "public void insert(double key, Double value){\n\tif(search(key)!=null){\r\n\t\tLeaf Leaf = (Leaf)Search(root, key);\r\n\t\t\r\n\t\tfor(int i=0; i<Leaf.keyvalues.size(); i++) {\r\n\t\t\tif(key==Leaf.getKeyValue(i).getKey()) {\r\n\t\t\t\t\tLeaf.getKeyValue(i).values.add(value);\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tLeaf newleaf = new Leaf(key, value);\r\n\t\r\n\tPair<Double,Node> entry=new Pair<Double, Node>(key,newleaf);\r\n\r\n\tif(root == null ) {\r\n\t\troot = entry.getValue();\r\n\t}\r\n\t\r\n\r\n\tPair<Double, Node> newChildEntry = getChildEntry(root, entry, null);\r\n\t\r\n\tif(newChildEntry == null) {\r\n\t\treturn;\r\n\t} else {\r\n\t\tIntrnlNode newRoot = new IntrnlNode(newChildEntry.getKey(), root, newChildEntry.getValue());\r\n\t\troot = newRoot;\r\n\t\treturn;\r\n\t}\r\n}", "public TreeNode insert(int value) {\n TreeNode newNode = new TreeNode(value);\n\n // CASE when Root Is NULL\n if (root == null) {\n this.root = newNode;\n } else {\n // CASE when Root is Not NULL\n TreeNode currentlyPointedNode = root;\n boolean keepWalking = true;\n\n while (keepWalking) {\n // CASE : Inserted Value BIGGER THAN Current Node's Value\n if (value >= currentlyPointedNode.value) {\n // CASE : current node's Right Child is NULL\n if (currentlyPointedNode.rightChild == null) {\n\n // If its null, just assigning the new node to the right place\n currentlyPointedNode.rightChild = newNode;\n keepWalking = false;\n\n } else {\n // CASE WHEN current node's Right Child is not null , we need to keep walking right\n currentlyPointedNode = currentlyPointedNode.rightChild;\n }\n } else {\n // CASE : Inserted Value SMALLER THAN Current Node's Value\n\n // CASE WHEN current node's LEFT Child is null\n if (currentlyPointedNode.leftChild == null) {\n\n // If its null, just assigning the new node to the right place\n currentlyPointedNode.leftChild = newNode;\n keepWalking = false;\n } else {\n // CASE WHEN current node's Right Child is not null , we need to keep walking right\n currentlyPointedNode = currentlyPointedNode.leftChild;\n }\n\n }\n }\n }\n\n return root;\n }", "public static TreeNode insertIntoBST(TreeNode root, int val)\n{\n TreeNode droot = root;\n TreeNode par = find(droot, val, null);\n if(par==null)\n return par;\n if(par.val < val)\n par.right = new TreeNode(val);\n else\n par.left = new TreeNode(val);\n return root;\n}", "public Node insert(Key key, Value value) { \r\n // inserting into an empty tree results in a single value leaf node\r\n return new LeafNode(key,value);\r\n }", "public void insert(Key key, Value value){\n this.root = this.insertHelper(key, value, root);\n }", "public void insert(Node n);", "private void insertNodeIntoTree(Node node) {\n\t\troot = insert(root,node);\t\n\t}", "public void insertNode(int d){\n if(root == null){\n root = new TreeNode(d);\n }\n else{\n root.insert(d);\n }\n }", "void insert(int val){\n\t\tthis.root = insertHelper(root, val);\n\t}", "public void insert(int value) {\n var node = new Node(value);\n\n if (root == null) {\n root = node;\n return;\n }\n\n var current = root;\n while (true) {\n if (value < current.value) {\n if (current.leftChild == null) {\n current.leftChild = node;\n break;\n }\n current = current.leftChild;\n } else {\n if (current.rightChild == null) {\n current.rightChild = node;\n break;\n }\n current = current.rightChild;\n }\n }\n }", "@Override\n\tpublic BSTNode insert(int key, Object value) throws OperationNotPermitted {\n\n\t\tBSTNode p = searchByKey(key);\n\t\tBSTNode n;\n\n\t\tif (p == null) {\n\t\t\t// tree is empty, create new root\n\n\t\t\tn = createNode(key, value);\n\t\t\t_root = n;\n\t\t} else if (p.key == key) {\n\t\t\t// key exists, update payload\n\n\t\t\tn = p;\n\t\t\tn.value = value;\n\t\t} else {\n\t\t\t// key does not exist\n\n\t\t\tn = createNode(key, value);\n\t\t\tn.parent = p;\n\n\t\t\tif (p != null) {\n\t\t\t\tif (key < p.key) {\n\t\t\t\t\tp.left = n;\n\t\t\t\t} else {\n\t\t\t\t\tp.right = n;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tupdateSubtreeSizePath(n.parent);\n\t\t}\n\n\t\treturn n;\n\t}", "@Override\r\n public void insert(K key, V value) {\r\n // call insert of the root\r\n root.insert(key, value);\r\n }", "private AVLTreeNode<E> insert(E value) {\n int cmp = this.getValue().compareTo(value);\n AVLTreeNode<E> result;\n if(cmp == 0){\n result = null;\n } else if(cmp < 0){\n result = this.getRight() != null ? this.getRight().insert(value) : createTreeNode(value);\n if(result != null){\n this.setRight(result);\n }\n } else {\n result = this.getLeft() != null ? this.getLeft().insert(value) : createTreeNode(value);\n if(result != null){\n this.setLeft(result);\n }\n }\n return result == null ? result : balancing(this);\n }", "public void insert(T data)\r\n {\r\n root = insert(root, data);\r\n }", "static void treeInsert(double x) {\n if ( root == null ) {\n // If the tree is empty set root to point to a new node \n // containing the new item.\n root = new TreeNode( x );\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if ( x < runner.item ) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a node there.\n // Otherwise, advance runner down one level to the left.\n if ( runner.left == null ) {\n runner.left = new TreeNode( x );\n return; // New item has been added to the tree.\n }\n else\n runner = runner.left;\n }\n else {\n // Since the new item is greater than or equal to the \n // item in runner, it belongs in the right subtree of\n // runner. If there is an open space at runner.right, \n // add a new node there. Otherwise, advance runner\n // down one level to the right.\n if ( runner.right == null ) {\n runner.right = new TreeNode( x );\n return; // New item has been added to the tree.\n }\n else\n runner = runner.right;\n }\n } // end while\n }", "public void insert(Node node, int value) {\n if (value < node.value) {\n if (node.left != null) {\n insert(node.left, value);\n } else {\n System.out.println(\" Inserted \" + value + \" to left of \" + node.value);\n node.left = new Node(value);\n }\n } else if (value > node.value) {\n if (node.right != null) {\n insert(node.right, value);\n } else {\n System.out.println(\" Inserted \" + value + \" to right of \" + node.value);\n node.right = new Node(value);\n }\n }\n }", "public void insert(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null){\n\t\t\tif (currentNode.getKey() == key){\n\t\t\t\tSystem.out.println(\"This value already exists in the tree!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\t// once we reached the bottom of the tree, we insert the new node.\n\t\t// to do that we need to know the leaf node which is stored in the BSTNode parent\n\t\t// by comparing with its value, we know which side to insert the new node.\n\t\tif (key < parent.getKey()){\n\t\t\tparent.setLeft(new BSTNode(key, null, null));\n\t\t}else{\n\t\t\tparent.setRight(new BSTNode(key, null, null));\n\t\t}\n\t\tsize++;\n\t}", "public void insert(HuffmanTree node);", "public void insert(T x) {\n\t\tif (data == null) {\n\t\t\t// root = new MyTreeNode<T>();\n\t\t\tdata = x;\n\t\t\treturn;\n\t\t}\n\n\t\tMyTreeNode<T> node = new MyTreeNode<T>();\n\t\tnode.data = x;\n\n\t\tif (x.compareTo(data) < 0) {\n\t\t\tif (leftChild == null) {\n\t\t\t\tleftChild = node;\n\t\t\t} else {\n\t\t\t\tleftChild.insert(x);\n\t\t\t}\n//\t\t\t\t\t\t\tpointerNode = pointerNode.leftChild;\n\n//\t\t\t\t\t\t\tif (pointerNode == null) {\n//\n//\t\t\t\t\t\t\t\tparent.leftChild = insert;\n//\n//\t\t\t\t\t\t\t\treturn;\n//\n//\t\t\t\t\t\t\t}\n\t\t} else if (x.compareTo(data) > 0) {\n\t\t\tif (rightChild == null) {\n\t\t\t\trightChild = node;\n\t\t\t} else {\n\t\t\t\trightChild.insert(x);\n\t\t\t}\n\t\t} else {\n\n\t\t\tif (leftChild == null) {\n\t\t\t\tleftChild = node;\n\t\t\t} else {\n\t\t\t\tleftChild.insert(x);\n\t\t\t}\n\n\t\t\tif (rightChild == null) {\n\t\t\t\trightChild = node;\n\t\t\t} else {\n\t\t\t\trightChild.insert(x);\n\t\t\t}\n\n\t\t}\n\n\t}", "private TreeNode<K, V> put(TreeNode<K, V> node, K key, V value){\r\n \r\n // If the node is null, create a new node with the information\r\n // passed into the function\r\n if(node == null){\r\n return new TreeNode<>(key, value);\r\n }\r\n \r\n // Compare the keys recursively to find the correct spot to insert\r\n // the new node or if the key already exists\r\n if(node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n node.left = put(node.left, key, value);\r\n }\r\n else if(node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n node.right = put(node.right, key, value);\r\n }\r\n else{\r\n // If the keys are equal, only update the value\r\n node.setValue(value);\r\n }\r\n \r\n // Return the updated or newly inserted node\r\n return node;\r\n }", "public void insertNode(T d) {\n /* Functions to insert data */\n TreeNode newNode = new TreeNode(d);\n nodesToInsertAt.add(newNode);\n size++;\n if(root == null){\n root = newNode;\n return;\n }\n TreeNode current; \n current = nodesToInsertAt.get(0);\n if(current.left == null){\n current.left = newNode;\n return;\n }\n if(current.right == null){\n current.right = newNode;\n nodesToInsertAt.remove(0);\n }\n }", "public void insert(Node given){\n\t\tlength++;\n\t\tString retVar = \"\";\n\t\tNode curNode = root;\n\t\twhile (!curNode.isLeaf()){\n\t\t\tif (curNode.getData() > given.getData()){\n\t\t\t\tcurNode = curNode.getLeft();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcurNode = curNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (curNode.getData() > given.getData()){ \n\t\t\tcurNode.setLeft(given);\n\t\t}\n\t\telse{\n\t\t\tcurNode.setRight(given);\n\t\t}\n\t\tmyLazySearchFunction = curNode;\n\t}", "void insert(K key, V value) {\r\n\r\n\r\n Node child = getChild(key);\r\n child.insert(key, value);\r\n // to check if the child is overloaded\r\n if (child.isOverflow()) {\r\n Node sibling = child.split();\r\n insertChild(sibling.getFirstLeafKey(), sibling);\r\n }\r\n\r\n // if the node is full then it requires to split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n\r\n }", "private void insert(int aValue) {\n\t\tOO8BinaryTreeNode newNode = createBlankBinaryTreeNode(aValue);\n\t\t\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();// only used for level order traversal\n\t\tif(root==null) {\n\t\t\troot=newNode;\n\t\t\tqueue.add(root);\n\t\t}else {\n\t\t\tqueue.add(root);\n\t\t\twhile(!queue.isEmpty()) {\n\t\t\t\tOO8BinaryTreeNode currentNode = queue.remove();\n\t\t\t\tif(currentNode.getLeftNode()==null) {\n\t\t\t\t\t//queue.add(newNode); - wrong - Queue is only used for traversal and not for insertion\n\t\t\t\t\t//insertion still happens in the Binary node - left or right nodes\n\t\t\t\t\tcurrentNode.setLeftNode(newNode);\n\t\t\t\t\tbreak;//exit the while loop once the value is set\n\t\t\t\t}else if(currentNode.getRightNode()==null) {\n\t\t\t\t\t//queue.add(newNode);- wrong - Queue is only used for traversal and not for insertion\n\t\t\t\t\t// insertion still happens in the Binary node - left or right nodes\n\t\t\t\t\tcurrentNode.setRightNode(newNode);\n\t\t\t\t\tbreak;//exit the while loop once the value is set\n\t\t\t\t}else {\n\t\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void insert(T data){\n\t\troot = insert(data, root);\n\t}", "public boolean insert(T value){\n\t\treturn insert(root, value);\n\t}", "private void insert(RBNode<T> node) {\r\n RBNode<T> current = this.root;\r\n //need to save the information of parentNode\r\n //because need the parentNode to connect the new node to the tree\r\n RBNode<T> parentNode = null;\r\n\r\n //1. find the insert position\r\n while(current != null) {\r\n parentNode = current;//store the parent of current, because current is going to move\r\n int cmp = node.key.compareTo(current.key);\r\n if(cmp < 0)//if insert data is smaller than current data, then go into left subtree\r\n current = current.left;\r\n else//if insert data is bigger than or equal to current data, then go into right subtree\r\n current = current.right;\r\n }\r\n\r\n //find the position, let parentNode as the parent of newNode\r\n node.parent = parentNode;\r\n\r\n //2. connect newNode to parentNode\r\n if(parentNode != null) {\r\n int cmp = node.key.compareTo(parentNode.key);\r\n if(cmp < 0)\r\n parentNode.left = node;\r\n else\r\n parentNode.right = node;\r\n } else {\r\n //if parentNode is null, means tree was empty, let root = newNode\r\n this.root = node;\r\n }\r\n\r\n //3. fix the current tree to be a RBTree again\r\n insertFixUp(node);\r\n }", "void insert(int value){\r\n\t\tNode node = new Node(value);\r\n\t\t \r\n\t\tif( this.root == null ) {\r\n\t\t\tthis.root = node ;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t \r\n\t\tNode tempNode = this.root , parent = this.root;\r\n\t\t\r\n\t\twhile( tempNode != null ) {\r\n\t\t\tparent = tempNode;\r\n\t\t\tif( node.value >= tempNode.value ) {\r\n\t\t\t\ttempNode = tempNode.right;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttempNode = tempNode.left ;\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n\t\tif( node.value < parent.value ) {\r\n\t\t\tparent.left = node ;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tparent.right = node ;\r\n\t\t}\r\n\t}", "private static void treeInsert(String newItem) {\n if (root == null) {\n // The tree is empty. Set root to point to a new node containing\n // the new item. This becomes the only node in the tree.\n root = new TreeNode(newItem);\n return;\n }\n TreeNode runner; // Runs down the tree to find a place for newItem.\n runner = root; // Start at the root.\n while (true) {\n if (newItem.compareTo(runner.item) < 0) {\n // Since the new item is less than the item in runner,\n // it belongs in the left subtree of runner. If there\n // is an open space at runner.left, add a new node there.\n // Otherwise, advance runner down one level to the left.\n if (runner.left == null) {\n runner.left = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.left;\n } else {\n // Since the new item is greater than or equal to the item in\n // runner it belongs in the right subtree of runner. If there\n // is an open space at runner.right, add a new node there.\n // Otherwise, advance runner down one level to the right.\n if (runner.right == null) {\n runner.right = new TreeNode(newItem);\n return; // New item has been added to the tree.\n } else\n runner = runner.right;\n }\n } // end while\n }", "public void insert(int a) {\r\n\t\tif (this.value > a) {\r\n\t\t\tif (this.leftChild == null) {\r\n\t\t\t\tthis.leftChild = new Node(a);\r\n\t\t\t} else {\r\n\t\t\t\tthis.leftChild.insert(a);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this.value == 0) {\r\n\t\t\t\tthis.value = a;\r\n\t\t\t} else {\r\n\t\t\t\tif (this.rightChild == null) {\r\n\t\t\t\t\tthis.rightChild = new Node(a);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.rightChild.insert(a);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void insert( AnyType x )\r\n\t{\r\n\t\troot = insert( x, root );\r\n\t}", "public void insertNode(int val)\r\n {\r\n temp=new TriLinkNode();\r\n temp.v1=val;\r\n temp.d1=false;\r\n temp.i1=true;\r\n if(root==null)\r\n {\r\n root=temp;\r\n }else\r\n {\r\n recInsertNode(root);\r\n }\r\n \r\n }", "public void insert(Comparable<T> item)\r\n {\r\n root = insert(root, item);\r\n }", "protected boolean insert(Node<T> node, T value) {\n\n\t\tif (value == null)\n\t\t\treturn false;\n\t\tif (node == null) {\n\t\t\troot = new Node<T>(value);\n\t\t\treturn true;\n\t\t}\n\t\tif (value.compareTo(node.value) > 0)\n\t\t\tif (node.left != null) {\n\t\t\t\treturn insert(node.left, value);\n\t\t\t} else {\n\t\t\t\tnode.left = new Node<T>(value);\n\t\t\t\tnode.left.previous = node;\n\t\t\t\treturn true;\n\t\t\t}\n\t\telse if (value.compareTo(node.value) < 0)\n\t\t\tif (node.right != null) {\n\t\t\t\treturn insert(node.right, value);\n\t\t\t} else {\n\t\t\t\tnode.right = new Node<T>(value);\n\t\t\t\tnode.right.previous = node;\n\t\t\t\treturn true;\n\t\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "static TreeNode insert(TreeNode node, int key) \n\t{ \n\t // if tree is empty return new node \n\t if (node == null) \n\t return newNode(key); \n\t \n\t // if key is less then or grater then \n\t // node value then recur down the tree \n\t if (key < node.key) \n\t node.left = insert(node.left, key); \n\t else if (key > node.key) \n\t node.right = insert(node.right, key); \n\t \n\t // return the (unchanged) node pointer \n\t return node; \n\t}", "public Node insertNode(K key, V value) {\n\t\tNode newNode = new Node(key, value);// first we need to create the new\n\t\t\t\t\t\t\t\t\t\t\t// node\n\t\tNode currentNode = this.getRoot();// then we move to the root ot the\n\t\t\t\t\t\t\t\t\t\t\t// tree that has called the method\n\t\tNode currentNodeParent = mSentinel;// the parent of the root is of\n\t\t\t\t\t\t\t\t\t\t\t// course sentinel\n\t\twhile (currentNode != mSentinel) {// and while the current node(starting\n\t\t\t\t\t\t\t\t\t\t\t// from the root) is not a sentinel\n\t\t\tcurrentNodeParent = currentNode;// then remember this node as a\n\t\t\t\t\t\t\t\t\t\t\t// parent\n\t\t\tif (key.compareTo(currentNode.getKey()) < 0) {// and appropriate its\n\t\t\t\tcurrentNode = currentNode.getLeftChild();// left\n\t\t\t} else {// or\n\t\t\t\tcurrentNode = currentNode.getrightChild();// right child as the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// next current node\n\t\t\t}\n\t\t}\n\t\t// we iterate through the described loop in order to get to the\n\t\t// appropriate place(in respect to the given key) where the new node\n\t\t// should be put\n\t\tnewNode.setParent(currentNodeParent);// we make the new node's parent\n\t\t\t\t\t\t\t\t\t\t\t\t// the last non empty node that\n\t\t\t\t\t\t\t\t\t\t\t\t// we've reached\n\t\tif (currentNodeParent == mSentinel) {\n\t\t\tmRoot = newNode;// if there is no such node then the tree is empty\n\t\t\t\t\t\t\t// and our node is actually going to be the root\n\t\t} else {\n\t\t\tif (key.compareTo(currentNodeParent.getKey()) < 0) {// otherwise we\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// put our new\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// node\n\t\t\t\tcurrentNodeParent.setLeftChild(newNode);// as a left\n\t\t\t} else { // or\n\t\t\t\tcurrentNodeParent.setrightChild(newNode);// right child of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last node we've\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reached\n\t\t\t}\n\t\t}\n\t\treturn newNode;\n\t}", "public void insertNode(int data){\r\n\t\troot = insert(data, root);\r\n\t}", "public static void insert(TreeNode root, int key) {\n\t\tcounter++;\r\n\r\n\t\t// key less than the value of root.\r\n\t\tif (key < root.item) {\r\n\t\t\tif (root.left == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.left = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.left, key);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (root.right == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.right = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.right, key);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void insert(int val) {\n root = insertRec(root, val);\n }", "public void insert(int key){\n\t\tif(this.root == null){\n\t\t\tNode r = new Node(key);\n\t\t\tthis.root = r;\t\n\t\t}else{\n\t\t\t//if not recursively insert the node\n\t\t\trecInsert(this.root, key);\n\t\t}\n\t\treturn;\n\t}", "public void insert(int x) {\n root = insertHelper(root, x);\n }", "public void insert(T data) {\n\t\tBSTNode<T> add = new BSTNode<T>(data);\n\t\tBSTNode<T> tmp = root;\n\t\tBSTNode<T> parent = null;\n\t\tint c = 0;\n\t\twhile (tmp!=null) {\n\t\t\tc = tmp.data.compareTo(data);\n\t\t\tparent = tmp;\n\t\t\ttmp = c < 0 ? tmp.left: tmp.right;\n\t\t}\n\t\tif (c < 0) \tparent.left = add;\n\t\telse \t\tparent.right = add;\n\t\t\n\n\t\n\t}", "public void insert(TreeNode insertNode) {\n\t\tif(root == null) {\n\t\t\troot = insertNode; \n\t\t\tlength++;\n\t\t\treturn;\n\t\t}\n\n\t\tTreeNode currentNode = root; \n\n\t\twhile(true) {\n\t\t\tif(insertNode.getData() >= currentNode.getData()) {\n\t\t\t\tif(currentNode.getRightChild() == null) {\n\t\t\t\t\tcurrentNode.setRightChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getRightChild();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(currentNode.getLeftChild() == null) {\n\t\t\t\t\tcurrentNode.setLeftChild(insertNode);\n\t\t\t\t\tlength++;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "Node insertRec(T val, Node node, List<Node> path, boolean[] wasInserted) {\n if (node == null) {\n wasInserted[0] = true;\n Node newNode = new Node(val);\n path.add(newNode);\n return newNode;\n }\n\n int comp = val.compareTo(node.val);\n if (comp < 0) {\n node.left = insertRec(val, node.left, path, wasInserted);\n } else if (comp > 0) {\n node.right = insertRec(val, node.right, path, wasInserted);\n }\n\n path.add(node);\n return node;\n }", "public void insert(Nodo tree, String textField) {\n tree.getRoot().insertG(tree.getRoot(),textField);\n }", "Node insertBefore(Node newChild, Node refChild);", "public static TreeNode insert(TreeNode t, String s)\n { \t\n if(t==null)\n return new TreeNode(s);\n if(s.compareTo(t.getValue()+\"\")<0)\n t.setLeft(insert(t.getLeft(), s));\n else\n t.setRight(insert(t.getRight(), s));\n return t;\n }", "public void insert(int X)\n {\n root = insert(X, root);\n }", "public void insert(int data) { \n\t\troot = insert(root, data);\t\n\t}", "public void insert(T e) {\n if (e == null) return;\n root = insert(root, e);\n }", "void insert(K key, V value) {\r\n // binary search\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int indexing;\r\n if (correct_place >= 0) {\r\n indexing = correct_place;\r\n } else {\r\n indexing = -correct_place - 1;\r\n }\r\n\r\n if (correct_place >= 0) {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n } else {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n }\r\n\r\n // to check if the node is overloaded then split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n }", "public void add(int value){\n \n // Case 1: The tree is empty - allocate the root\n if(root==null){\n root = new BSTNode(value);\n }\n \n // Case 2: The tree is not empty \n // find the right location to insert value\n else{\n addTo(root, value);\n } \n count++; // update the number of nodes\n }", "public TreeNodeImpl(N value) {\n this.value = value;\n }", "public static TreeNode insert(TreeNode t, String s)\n {\n if (t == null) {\n t = new TreeNode(s);\n return t;\n }\n else {\n if(s.compareTo((String)t.getValue()) <= 0)\n t.setLeft(insert(t.getLeft(), s));\n else\n t.setRight(insert(t.getRight(), s));\n return t;\n }\n }", "public static void insert(TreeNode root, TreeNode node){\n\t\t \n\t\t if(node.val < root.val){\n\t\t\t if(root.left == null){\n\t\t\t\t root.left = node;\n\t\t\t }\n\t\t\t else{\n\t\t\t\t insert(root.left, node);\n\t\t\t }\n\t\t }\n\t\t else{\n\t\t\t if(root.right == null){\n\t\t\t\t root.right = node;\n\t\t\t }\n\t\t\t else{\n\t\t\t\t insert(root.right,node);\n\t\t\t }\n\t\t }\n\t }", "TreeNode addChild(TreeNode node);", "protected Node<T> insert(Node<T> node, Comparable<T> item)\r\n {\r\n // if current root has not been previously instantiated\r\n // instantiate a new Node with item added as the data\r\n if (node == null) {\r\n return new Node<T>(item); // when your node is null, insert at leaf\r\n }\r\n if (item.compareTo((T) node.data) < 0) {\r\n node.left = insert(node.left,item);\r\n }\r\n else {\r\n node.right = insert(node.right,item);\r\n }\r\n return node; // re-link the nodes\r\n }", "public void insert(Key key, Value value) {\r\n root.insert(key,value);\r\n size++;\r\n }", "public Node insertBefore(Node node);", "public void insert(int key) {\n // Implement insert() using the non-recursive version\n // This function should call findClosestLeaf()\n\n if(root!=null){ // มี node ใน tree\n Node n = findClosestLeaf(key); //หา Leaf n ที่ใกล้ค่าที่ใส่มากที่สุด โดย call findClosestLeaf()\n\n\n if(n.key!= key){ // ค่าที่จะใส่ต้องไม่มีใน tree\n if(key > n.key){ // ค่าที่จะใส่มากกว่า Leaf n ให้ใส่เป็นลูฏของ Leaf ด้านขวา\n n.right = new Node(key);\n n.right.parent = n;\n }\n\n else { // ค่าที่จะใส่น้อยกว่า Leaf n ให้ใส่เป็นลูฏของ Leaf ด้านซ้าย\n n.left = new Node(key);\n n.left.parent = n;\n }\n }\n else\n {\n return;\n }\n\n }else{ // ไม่มี node ใน tree ดังนั้นค่าที่ใส่เข้ามาจะกลายเป็ฯ root\n root = new Node(key);\n }\n }", "private BTNode insert(BTNode node, T data)\r\n {\r\n if (node == null)\r\n node = new BTNode(data);\r\n else\r\n {\r\n if (node.getLeft() == null)\r\n node.left = insert(node.left, data);\r\n else\r\n node.right = insert(node.right, data); \r\n }\r\n return node;\r\n }", "public void treeInsert(TernaryTreeNode root, int newData) {\n if (newData<=root.data)\n {\n if (root.left!=null) \n treeInsert(root.left, newData);\n else \n root.left = new TernaryTreeNode(newData);\n }\n else \n {\n if (root.right!=null) \n treeInsert(root.right, newData);\n else\n root.right = new TernaryTreeNode(newData);\n }\n }", "@SuppressWarnings(\"unchecked\")\n public void insert(E value) {\n int level = flipAndIncrementLevel();\n\n SLNode<E> newNode = new SLNode<>(value,level);\n\n SLNode cur_walker = head;\n\n for (int i = currentMaxLevel - 1; i >= 0; i--) {\n // walk down the level until it find a range\n while (null != cur_walker.next[i]) {\n // when at bottom level, i is always 0, needs to find the right node to stop\n if (greaterThan((E) cur_walker.next[i].getValue(), value) ) {\n break;\n }\n cur_walker = cur_walker.next[i];\n }\n\n if (i <= level) {\n newNode.next[i] = cur_walker.next[i];\n cur_walker.next[i] = newNode;\n }\n }\n\n size++;\n }", "@Override\r\n public V put(K key, V value){\r\n \r\n // Declare a temporay node and instantiate it with the key and\r\n // previous value of that key\r\n TreeNode<K, V> tempNode = new TreeNode<>(key, get(key));\r\n \r\n // Call overloaded put function to either place a new node\r\n // in the tree or update the exisiting value for the key\r\n root = put(root, key, value);\r\n \r\n // Return the previous value of the key through the temporary node\r\n return tempNode.getValue();\r\n }", "public void insertBST(Object o) {\n ObjectTreeNode p, q;\n \n ObjectTreeNode r = new ObjectTreeNode(o);\n if (root == null)\n root = r;\n else {\n p = root;\n q = root;\n while (q != null) {\n p = q;\n if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) < 0 )\n q = p.getLeft();\n else\n q = p.getRight();\n }\n if (((TreeComparable)(r.getInfo())).compareTo((TreeComparable)(p.getInfo())) < 0)\n setLeftChild(p, r);\n else\n setRightChild(p, r);\n }\n }", "public void addTo(BSTNode node, int value){\n // Allocate new node with specified value\n BSTNode newNode = new BSTNode(value);\n \n // Case 1: Value is less than the current node value\n if(value < node.value){\n // If there is no left child make this the new left\n if(node.left == null){\n node.left = newNode;\n }\n else{\n // else add it to the left node\n addTo(node.left, value);\n }\n } // End Case 1\n \n // Case 2: Value is equal to or greater than the current value\n else {\n // If there is no right, add it to the right\n if(node.right == null){\n node.right = newNode;\n }\n else{\n // else add it to the right node\n addTo(node.right, value);\n }\n } // End Case 2\n }", "public void insertingANode(T key, E value) {\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t}", "public void insert(int X, int WT)\n {\n root = insert(X, WT, root);\n }", "public void insert(int val) throws DifferentOrderTrees {\r\n \tMonceau monceauTemp = new Monceau();\r\n \t\r\n \tmonceauTemp.arbres.add(new Node(val));\r\n \tthis.fusion(monceauTemp);\r\n }", "public void insert(int data)\r\n {\r\n root = insert(root, data);\r\n }", "public static void treeInsert(Node root, int newData) {\r\n if (newData <= root.value) {\r\n if (root.left != null)\r\n treeInsert(root.left, newData);\r\n else\r\n root.left = new Node(newData);\r\n } else {\r\n if (root.right != null)\r\n treeInsert(root.right, newData);\r\n else\r\n root.right = new Node(newData);\r\n }\r\n }", "public void add(T value) {\n final Node node = new Node(value);\n if (root != null) {\n root.add(node);\n } else {\n root = node;\n }\n }", "private int insertNode(TreeNodeSpecial root, int x) {\n\t\tTreeNodeSpecial cur = root;\n\t\tint sum = 0;\n\n\t\t// loop until your number or exhausted the whole tree\n\t\twhile (cur.val != x) {\n\t\t\tif (x < cur.val) {\n\t\t\t\tif (cur.left == null)\n\t\t\t\t\tcur.left = new TreeNodeSpecial(x);\n\t\t\t\tcur.lCount++;\n\t\t\t\tcur = cur.left;\n\t\t\t} else {\n\t\t\t\tsum = sum + cur.dCount + cur.lCount;\n\t\t\t\tif (cur.right == null) {\n\t\t\t\t\tcur.right = new TreeNodeSpecial(x);\n\t\t\t\t}\n\t\t\t\tcur = cur.right;\n\n\t\t\t}\n\t\t}\n\n\t\tcur.dCount++;\n\t\treturn cur.lCount + sum;\n\t}", "public void add(Comparable obj)\n { \n \t //TODO\n \t //add code\n \t Node n = new Node(); \n \t n.data = obj;\n \t // \tn.left = null;\n \t // \tn.right = null;\n\n \t Node y = null;\n \t // \tNode x = root;\n \t Node current = root;\n \t while(current != null)\n \t {\n \t\t y = current;\n \t\t if(n.data.compareTo(root.data) < 0)\n \t\t\t current = current.left;\n \t\t else\n \t\t\t current = current.right;\n \t }\n\n\n \t n.parent = y;\n \t if(y == null)\n \t\t root = n;\n \t else\n \t\t if(n.data.compareTo(y.data) < 0)\n \t\t\t y.left = n;\n \t\t else\n \t\t\t y.right = n;\n \t n.left = null;\n \t n.right = null;\n \t n.color = RED;\n \t // \troot = new Node();\n \t // \troot.data = \"k\";\n \t // \tNode test = new Node();\n \t // \ttest.data = \"g\";\n \t // \troot.left= test;\n// \t System.out.println(\"the insertion looks like:\");\n// \t System.out.println(BTreePrinter.printNode(root));\n\n \t fixup(root,n);\n \t /*\n \tThe insert() method places a data item into the tree.\n\n \tInsertions\n \tpseudocode for\n \tRB-Insert(T,z)\n \ty = nil[T]\n \tx = root[T]\n \twhile x != nil[T]\n \ty = x\n \tif key[z] < key[x] then\n \tx = left[x]\n \telse\n \tx = right[x]\n \tp[z] = y\n \tif y = nil[T]\n \troot[T] = z\n \telse\n \tif key[z] < key[y] then\n \tleft[y] = z\n \telse\n \tright[y] = z\n \tleft[z] = nil[T]\n \tright[z] = nil[T]\n \tcolor[z] = RED\n \tRB-Insert-fixup(T,z)\n \t */\n }", "public void insertNode(Node newNode) {\r\n\t\thFlag = 0;\r\n\t\tif( newNode == null ) {\r\n\t\t\tthrow new NullPointerException(\"Inserted node is null\");\r\n\t\t}\r\n\t\t//if tree is empty, make this node the root\r\n\t\tif( size == 0 ) {\r\n\t\t\troot = newNode;\r\n\t\t\tnewNode.parent = nilNode;\r\n\t\t\tnewNode.left = nilNode;\r\n\t\t\tnewNode.right = nilNode;\r\n\t\t\tnewNode.color = 1;\r\n\t\t\theight = 1;\r\n\t\t} else {\r\n\t\t\t//otherwise, start at root and climb down tree until a spot is found\r\n\t\t\tNode y = nilNode;\r\n\t\t\tNode x = root;\r\n\t\t\tint count = 1;\r\n\r\n\t\t\twhile(x != nilNode) {\r\n\t\t\t\ty = x;\r\n\t\t\t\tif(newNode.key < x.key || (newNode.key == x.key && newNode.p == 1) )\r\n\t\t\t\t\tx = x.left;\r\n\t\t\t\telse\r\n\t\t\t\t\tx = x.right;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tif(height < count) {\r\n\t\t\t\theight = count;\r\n\t\t\t\thFlag = 1;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tnewNode.parent = y;\r\n\t\t\tif(newNode.key < y.key || (newNode.key == y.key && newNode.p == 1) )\r\n\t\t\t\ty.left = newNode;\r\n\t\t\telse\r\n\t\t\t\ty.right = newNode;\r\n\t\t\tnewNode.left = nilNode;\r\n\t\t\tnewNode.right = nilNode;\r\n\t\t\tnewNode.color = 0;\r\n\r\n\t\t\t//fix up tree\r\n\t\t\tRBFixup(newNode);\r\n\t\t\t\r\n\t\t\t//Time to update the vaules in each node in O(h) time\r\n\t\t\t//after the fix up, newNode may have children who need to be updated,so\r\n\t\t\t//if newNode has nonNil children, start updating from either child\r\n\t\t\tif( !newNode.right.isNil || !newNode.left.isNil ) {\r\n\t\t\t\t//start from newNode's left child (right would work too)\r\n\t\t\t\trecUpdateNode(newNode.left);\r\n\t\t\t} else {\r\n\t\t\t\t//start from newNode\r\n\t\t\t\trecUpdateNode(newNode);\r\n\t\t\t}\n\t\t}\r\n\t\tsize++;\r\n\t}", "private BinaryNode<E> _insert(BinaryNode<E> node, E e) {\n\n\t\tif (node == null) {\n\t\t\treturn new BinaryNode<E>(e);\n\t\t} else if (comparator.compare(e, node.getData()) < 0) { // <, so go left\n\t\t\tnode.setLeftChild(_insert(node.getLeftChild(), e));// recursive call\n\t\t} else { // >, so go right\n\t\t\tnode.setRightChild(_insert(node.getRightChild(), e));// recursive call\n\t\t}\n\t\treturn node;\n\t}", "void insert(int data) { \n root = insertRec(root, data); \n }", "public static <E extends Comparable> TreeNode<E> insertNode(TreeNode<E> root, TreeNode<E> node) {\r\n TreeNode<E> newRoot = TreeNode.copy(root);\r\n \r\n TreeNode<E> parent = newRoot;\r\n \r\n while(true) {\r\n if(node.getValue().compareTo(parent.getValue()) < 0) {\r\n if(parent.getLeft() == null) {\r\n parent.setLeft(node);\r\n break;\r\n } else {\r\n parent.setLeft(TreeNode.copy(parent.getLeft()));\r\n parent = parent.getLeft();\r\n }\r\n } else {\r\n if(parent.getRight() == null) {\r\n parent.setRight(node);\r\n break;\r\n } else {\r\n parent.setRight(TreeNode.copy(parent.getRight()));\r\n parent = parent.getRight();\r\n }\r\n }\r\n }\r\n \r\n return newRoot; \r\n }", "public void insertNodeInto(MutableTreeNode child, MutableTreeNode par, int i) {\n insertNodeInto(child, par);\n }", "public void insert(T val) {\n\t\tlstEle.add(val);\n\t\theapSize++;\n\t\t// Need to move up the tree and satisfy the heap property\n\t\tint currIndex = heapSize - 1;\n\t\tint parentIndex = getParent(currIndex);\n\t\tif (parentIndex >= 0) {\n\t\t\tdo {\n\t\t\t\tT parentVal = lstEle.get(parentIndex);\n\t\t\t\tif (parentVal.compareTo(val) > 0) {\n\t\t\t\t\tlstEle.set(parentIndex, val);\n\t\t\t\t\tlstEle.set(currIndex, parentVal);\n\t\t\t\t\tcurrIndex = parentIndex;\n\t\t\t\t\tparentIndex = getParent(currIndex);\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (parentIndex >= 0);\n\t\t}else{\n\t\t\t//do nothing\n\t\t}\n\t\t\n\t}", "public void insert(T data) {\n if (root == null) {\n root = new Node<>(data);\n } else {\n Node<T> current = root;\n Node<T> newNode = new Node<>(data);\n\n while (true) {\n if (newNode.compareTo(current) <= 0) {\n if (current.hasLeft()) {\n current = current.getLeft();\n } else {\n current.setLeft(newNode);\n break;\n }\n } else {\n if (current.hasRight()) {\n current = current.getRight();\n } else {\n current.setRight(newNode);\n break;\n }\n }\n }\n }\n size++;\n }", "void insert(T value, int position);", "public void insert(AnyType x) {\n\t\troot = insert(x, root);\n\t}", "public void insert(double x, double y){\n root = insert(root, new Node(x, y), X_AXIS);\n\t\t}", "public void insert(AnyType x) {\n root = merge(new LeftistNode<>(x), root);\n }", "public void insert(Integer key){\r\n\t\tint start=this.root;\r\n\t\tint currentPos=avail;\r\n\t\tint temp=-1;\r\n\t\twhile(increaseCompares() && start!=-1) {\r\n\t\t\ttemp=start;\r\n\t\t\tcompares++;\r\n\t\t\tif(increaseCompares() && key<getKey(start)) {\r\n\t\t\t\tstart=getLeft(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart=getRight(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Tree is empty. New Node is now root of tree\r\n\t\tif(increaseCompares() && temp==-1) {\r\n\t\t\tsetRoot(0);\r\n\t\t\tcompares++;\r\n\t\t\tsetKey(avail, key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\t//Compare values and place newNode either left or right of previous Node\r\n\t\telse if(increaseCompares() && key<getKey(temp)) {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetLeft(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetRight(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t}", "void insert(Object value, int position);", "protected int insert(int toAdd){\n\n tnode object = new tnode();\n\n return object.insert(toAdd);\n\n }", "public void insert(int data) {\n root = insert(root, data, null);\n }", "public void add(E val){\n if(mData.compareTo(val) > 0){\n if(mLeft == null){\n mLeft = new BSTNode(val);\n mLeft.mParent = this;\n }//End if null\n else if(mRight == null){\n mRight = new BSTNode(val);\n mRight.mParent = this;\n }//End Else\n }//End if\n else{\n mLeft.add(val);\n mLeft.mParent = this;\n }//End Else\n }", "public void insertnode ()\n\t// insert an empty node\n\t{\n\t\tif (Pos.haschildren() && !GF.askInsert()) return;\n\t\tNode n = new Node(Pos.node().number());\n\t\tPos.insertchild(new TreeNode(n));\n\t\tn.main(Pos);\n\t\tgetinformation();\n\t\tPos = Pos.lastChild();\n\t\tsetlast();\n\t\tshowinformation();\n\t\tcopy();\n\t}", "private BSTNode insert(BSTNode node, int data) {\r\n \r\n // if the node is null, create a new node\r\n if (node == null) {\r\n \r\n // create new BSTNode node\r\n node = new BSTNode(data);\r\n }\r\n \r\n // if the node is not null, execute\r\n else {\r\n \r\n // if the data < parent, traverse left\r\n if (data < node.getData()) {\r\n \r\n // call the insert method on the left node\r\n node.left = insert(node.left, data); \r\n }\r\n \r\n // if data > parent, traverse right\r\n else if (data > node.getData()) {\r\n \r\n // call the insert method on the right node\r\n node.right = insert(node.right, data);\r\n }\r\n \r\n // if the data == parent, increment intensity count\r\n else {\r\n \r\n // call method to increment the node's intensity count\r\n node.incrementIntensityCount();\r\n }\r\n }\r\n \r\n // return the node\r\n return node;\r\n }", "public TreeNode insert(TreeNode root, int key) {\n if (root == null) {\n root = new TreeNode(key);\n return root;\n }\n TreeNode cur = root, par = root;\n while (cur != null) {\n par = cur;\n if (cur.key == key) {\n return root;\n }\n if (key < cur.key) {\n cur = cur.left;\n } else {\n cur = cur.right;\n }\n }\n // this is when cur is null (out of the while)\n if (key < par.key) {\n par.left = new TreeNode(key);\n } else {\n par.right = new TreeNode(key);\n }\n \n return root;\n }" ]
[ "0.79044545", "0.7691836", "0.76474065", "0.76078707", "0.7340209", "0.73348576", "0.7257333", "0.72340155", "0.7131304", "0.70963067", "0.70949656", "0.70934266", "0.7081722", "0.706175", "0.70335525", "0.70326066", "0.7017584", "0.6991691", "0.69889456", "0.6928948", "0.6912415", "0.6911112", "0.68814903", "0.688058", "0.68635035", "0.6857675", "0.6856021", "0.68406314", "0.6835938", "0.68296635", "0.68106997", "0.67997664", "0.6797656", "0.6789097", "0.67795587", "0.67640346", "0.67410874", "0.6734588", "0.6681633", "0.66393214", "0.65942603", "0.6586638", "0.655445", "0.6552148", "0.6542242", "0.6540122", "0.6539208", "0.65319204", "0.6526019", "0.6522406", "0.6521045", "0.6510586", "0.65042865", "0.6503146", "0.6481549", "0.64735395", "0.6469017", "0.6461794", "0.6443964", "0.64223576", "0.64192796", "0.6415942", "0.64155525", "0.64150584", "0.63877636", "0.63863087", "0.63833845", "0.6380975", "0.63791203", "0.6369452", "0.63684887", "0.63582677", "0.6353192", "0.63516647", "0.63344353", "0.63333315", "0.6332793", "0.63308704", "0.63252455", "0.63238627", "0.6316965", "0.63057107", "0.6298714", "0.6298161", "0.62823987", "0.6280146", "0.6277556", "0.62763035", "0.6256265", "0.6251516", "0.6250835", "0.62504673", "0.6239643", "0.62394667", "0.62335825", "0.6232976", "0.6230919", "0.6225716", "0.62215436", "0.621396" ]
0.67918754
33
Fetch method that returns the value of of the node that matches integer passed to the method
public int Fetch(int num) { //initialize boolean field, set to true if value found in tree boolean found; //initialize the parent node TreeNodeWrapper p = new TreeNodeWrapper(); //initialize the child node TreeNodeWrapper c = new TreeNodeWrapper(); //found set to true if FindNode methods locates value in the tree found = FindNode(num, p, c); //locate the node //if found is true print success message and return value of node if(found == true) { System.out.println("The number you entered was found in the tree"); return c.Get().Data; } else //if found is false print message that value not found and return integer not found { System.out.println("\nThe number you entered is not in tree."); return num; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object get(Node node);", "Integer getValue();", "Integer getValue();", "public int get(int key) {\n Node node = cache.get(key);\n // If the node exists\n if (node != null) {\n // Get the value stored in the node\n int value = node.value;\n // Remove and add the node\n remove(node);\n add(node);\n return value;\n }\n return -1;\n }", "public String getNodeValue ();", "public int getValue();", "public int getValue();", "protected abstract int getValue(int paramInt);", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "int getValue();", "N getNode(int id);", "public String getNodeValue(Node node) throws Exception;", "public abstract int getValue();", "public abstract int getValue();", "public abstract int getValue();", "public Object lookup(String key){\n ListNode<String,Object> temp = getNode(key);\n if(temp != null)\n return temp.value;\n else\n return null;\n }", "public Integer nodeValue(String id)\n\t{\n\t\treturn getNode(id).value;\n\t}", "public Integer getValue();", "int value(String name);", "private int intvalue(JsonNode n, String name) {\n\t\treturn n.findValue(name).getIntValue();\n\t}", "String getIdNode1();", "public V getValueOfNode(Integer id) {\n\t\treturn nodes.get(id);\n\t}", "public int get(int key) {\n Node n = map.get(key);\n if(n == null){\n //we do not have the value, return -1\n return -1;\n }\n //we do have the node\n //update the node in the DLL, so that its now in the front\n update(n);\n return n.val;\n }", "String getIdNode2();", "public int getM_Locator_ID() \n{\nInteger ii = (Integer)get_Value(\"M_Locator_ID\");\nif (ii == null) return 0;\nreturn ii.intValue();\n}", "public int get(int index) {\n\t\treturn nodeAt(index).data;\n\t}", "String get(Integer key);", "public abstract Object \t\tgetNodeValue(int nodeIndex,int nodeColumn);", "int getIntValue();", "int getFromValue();", "public int get(int key) {\n if(map.containsKey(key)) {\n Node node = map.get(key);\n \n removeNode(node);\n insertNode(node);\n \n return node.val;\n }\n return -1;\n }", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "Object getValue();", "public @Override E get(int index) {\n \treturn getNode(index).data;\n }", "public int findItem(int value) {\n return find(value, root);\n }", "org.apache.xmlbeans.XmlInt xgetValue();", "public int get(int index) {\n if(index>-1 && index<len) {\n SingleNode iSingleNode = head;\n for(int i=0; i<index; i++) {\n\n iSingleNode = iSingleNode.next;\n }\n return iSingleNode.data;\n }\n return 0;\n }", "public int getValue(){\n return number;\n }", "public int value();", "public Object get(int index) {\n isValidIndex(index);\n return getNode(index).data;\n }", "public String search(Integer key) {\n\t\treturn root.search(key);\n\t}", "V get(K id);", "public int getNode() {\r\n\t\t\treturn data;\r\n\t\t}", "Node getVariable();", "int get(int index)\n\t{\n\t\t//Get the reference of the head of the Linked list\n\t\tNode ref = head;\n\t\t\n\t\t//Initialize the counter to -1\n\t\tint count = -1;\n\t\t\n\t\t//Traverse the Linked List until the Node with position index is reached\n\t\twhile(count != index)\n\t\t{\n\t\t\tcount++;\n\t\t\tref = ref.next;\n\t\t}\n\t\t\n\t\t//Return the value of the Node having position index\n\t\treturn ref.value;\n\t}", "public int getValue() throws Exception {\n\t\treturn RemoteServer.instance().executeAndGetId(\"getvalue\", getRefId());\n\t}", "public int get(int i) {\n // YOUR CODE HERE\n return 1;\n }", "double getValue(int id);", "public Value get(String key) {\n Node x = get(root, key, 0);\n if (x == null) return null; //node does not exist\n else return (Value) x.val; //found node, but key could be null\n }", "public T get(int index) {\r\n return getNodeAtIndex(index).getData();\r\n }", "Node get(URI uri);", "private int find(int p1, int p2) {\n return id[p1 - 1][p2 - 1]; // find the current value of a node\n }", "public int get(int key) {\n int index = key % n;\n MapNode node = keys[index];\n for (int i =0; i < node.list.size(); ++i) {\n if (node.list.get(i) == key) {\n return vals[index].list.get(i);\n }\n }\n\n return -1;\n }", "io.dstore.values.IntegerValue getTreeNodeId();", "NodeId getNodeId();", "public int get(int key) {\n ListNode node = hashtable.get(key);\n \n if(node == null){\n return -1;\n }\n \n // Item has been accessed. Move to the front of the cache\n moveToHead(node);\n return node.value;\n }", "private String getLocalValue(int key)\n {\n // binary search, since the list is sorted\n int start = 0;\n int end = cache.size() - 1;\n while (start <= end)\n {\n int mid = (start + end) / 2;\n Record currentRecord = cache.get(mid);\n if (key == currentRecord.key())\n {\n return currentRecord.value();\n }\n else if (key < currentRecord.key())\n {\n end = mid - 1;\n }\n else\n {\n start = mid + 1;\n }\n }\n \n // not found\n return null; \n }", "abstract public Object getValue(int index);", "public int get(int key) {\n int hashCode = key%nodes.length;\n if (nodes[hashCode]==null) return -1;\n ListNode pre = findPrev(key);\n return pre.next==null?-1:pre.next.val;\n }", "public int get(int key) {\n Node x = root;\r\n while (x != null) {\r\n if (key > x.key) x = x.right;\r\n else if (key < x.key) x = x.left;\r\n else if (x.key == key) return key;\r\n }\r\n System.out.print(\"No key found\");\r\n return -1; //return 0 means did not find!\r\n }", "public Object get(Object key){\n\t\tNode tempNode = _locate(key);\r\n\t\tif(tempNode != null){\r\n\t\t\treturn tempNode._value;\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public int getM_Splitting_ID() \n{\nInteger ii = (Integer)get_Value(\"M_Splitting_ID\");\nif (ii == null) return 0;\nreturn ii.intValue();\n}", "private int entityValue(String name)\n\t{\n\t\treturn map.value(name);\n\t}", "public T getValue(String key) {\r\n\t\tNode node = getNode(root, key, 0);\r\n\t\treturn node == null ? null : node.value;\r\n\t}", "public String lookup(String key){\n Node N;\n N = findKey(root, key);\n return ( N == null ? null : N.item.value );\n }", "Object getValueFrom();", "String getValueOfNode(String path)\n throws ProcessingException;", "abstract int get(int index);", "public Object getValue(int index);", "io.dstore.values.IntegerValue getPageNo();", "io.dstore.values.IntegerValue getPageNo();", "public int getDataFromGivenIndex(int index){\n //Index validation\n checkIndex(index);\n return getNodeFromGivenIndex(index).data;\n }", "public E get(int index)\n { \n if(index >= size() || index < 0)\n {\n return null; \n }\n Node<E> n = getNode(index);\n return n.getValue();\n }", "Object getAttribute(int attribute);", "entities.Torrent.NodeId getNode();", "entities.Torrent.NodeId getNode();", "int getResultValue();", "int getResultValue();", "String getValueId();", "public int getNum();", "public abstract long getValue();", "public abstract long getValue();", "public node_info getNode(int key)\n{\n\treturn getNodes().get(key);\n\t\n}", "private Node getNodeById(int objId){\n return dungeonPane.lookup(\"#\" + Integer.toString(objId));\n }", "public String getTextValue (Node node);", "public Node getOne(int identifier) throws SQLException, NodeNotFoundException {\n var statement = connection.prepareStatement(\"SELECT identifier, x, y, parentx, parenty, status, owner, description FROM nodes WHERE identifier = ?\");\n statement.setInt(1, identifier);\n var result = statement.executeQuery();\n try {\n if (result.next()) {\n return new Node(\n result.getInt(\"identifier\"),\n result.getInt(\"x\"),\n result.getInt(\"y\"),\n result.getInt(\"parentx\"),\n result.getInt(\"parenty\"),\n result.getString(\"status\"),\n result.getString(\"owner\"),\n result.getString(\"description\")\n );\n } else {\n throw new NodeNotFoundException();\n }\n }\n finally {\n statement.close();\n result.close();\n }\n }", "public int getM_Product_ID() \n{\nInteger ii = (Integer)get_Value(\"M_Product_ID\");\nif (ii == null) return 0;\nreturn ii.intValue();\n}", "private Node getChildById(String identifier)\r\n {\r\n Node result = null;\r\n\r\n result = convertNode(cmisSession.getObject(identifier));\r\n\r\n return result;\r\n }", "@Override\n\tpublic node_data getNode(int key) {\n\n\t\treturn this.Nodes.get(key);\n\n\t}", "public int get(int key) {\n if (!map.containsKey(key)) return -1;\n Node n = map.get(key);\n \n if (n.next != tail) {\n putToTail(n); \n }\n \n return n.val;\n }", "public abstract R getValue();", "@Override\n public Number getValue() {\n return tcpStatWrapper.query().get(entry.getKey());\n }" ]
[ "0.6744988", "0.6252605", "0.6252605", "0.62095433", "0.61842084", "0.618371", "0.618371", "0.61658305", "0.6136108", "0.6136108", "0.6136108", "0.6136108", "0.6136108", "0.6070504", "0.60603863", "0.602501", "0.602501", "0.602501", "0.59970194", "0.59690523", "0.5947366", "0.5929287", "0.59283966", "0.59190446", "0.5915449", "0.58501345", "0.58412623", "0.57820344", "0.5770137", "0.5734081", "0.57099915", "0.57020587", "0.56950873", "0.5687295", "0.5674964", "0.5674964", "0.5674964", "0.5674964", "0.5674964", "0.5674964", "0.5674964", "0.56696296", "0.56685466", "0.56400967", "0.56265193", "0.56088674", "0.5570823", "0.5557664", "0.55565876", "0.5551695", "0.5548964", "0.5544202", "0.5542839", "0.55426776", "0.55375284", "0.55371654", "0.55246466", "0.5524332", "0.5510916", "0.55041057", "0.5500896", "0.5499294", "0.5495941", "0.54768926", "0.5476276", "0.5472442", "0.54542303", "0.54519564", "0.5445468", "0.54402876", "0.5414719", "0.5414056", "0.5413109", "0.5412862", "0.5408044", "0.54076207", "0.53933287", "0.5387772", "0.5387772", "0.53865296", "0.5375783", "0.5369409", "0.5368514", "0.5368514", "0.5365764", "0.5365764", "0.53616756", "0.5361361", "0.5353989", "0.5353989", "0.5351944", "0.534782", "0.5347418", "0.5346819", "0.534281", "0.5335619", "0.53325385", "0.5331954", "0.5331817", "0.5328658" ]
0.7072995
0
A method that deletes a value (given by the parameter) from the AVL tree Delete method deletes the value given as a parameter from the tree method reestablished parent and child nodes accordingly when node is deleted
public boolean Delete(int num) { //initialize boolean field, set to true if value found in tree boolean found; //initialize the parent node using the TreeNodeWrapper TreeNodeWrapper p = new TreeNodeWrapper(); //initialize the child node using the TreeNodeWrapper TreeNodeWrapper c = new TreeNodeWrapper(); //initialize largest field to re-allocate parent/child nodes TreeNode largest; //initialize nextLargest field to re-allocate parent/child nodes TreeNode nextLargest; //found set to true if FindNode methods locates value in the tree found = FindNode(num, p, c); //if node not found return false if(found == false) return false; else //identify the case number { //case 1: deleted node has no children //if left and right child nodes of value are both null node has no children if(c.Get().Left == null && c.Get().Right == null) //if parent left node is equal to child node then deleted node is a left child if(p.Get().Left == c.Get()) p.Get().Left = null; else //deleted node is a right child p.Get().Right = null; //case 2: deleted node has 1 child //if deleted node only has 1 child node else if(c.Get().Left == null || c.Get().Right == null) { //if parent left node is equal to child node then deleted node is a left child if(p.Get().Left == c.Get()) { //if deleted node is a left child then set deleted node child node as child to parent node if(c.Get().Left != null) //deleted node has a left child p.Get().Left = c.Get().Left; else p.Get().Left = c.Get().Right; } else //if deleted node is a right child then set deleted node child node as child to parent node { if(c.Get().Left != null) //deleted node has a left child p.Get().Right = c.Get().Left; else p.Get().Right = c.Get().Right; } } //case 3: deleted node has two children else { //set the nextLargest as the left child of deleted node nextLargest = c.Get().Left; //set the largest as the right node of the nextLargest node largest = nextLargest.Right; //if right node is not null then left child has a right subtree if(largest != null) { //while loop to move down the right subtree and re-allocate after node is deleted while(largest.Right != null) //move down right subtree { nextLargest = largest; largest = largest.Right; } //overwrite the deleted node c.Get().Data = largest.Data; // save the left subtree nextLargest.Right = largest.Left; } else //left child does not have a right subtree { //save the right subtree nextLargest.Right = c.Get().Right; //deleted node is a left child if(p.Get().Left == c.Get()) //jump around deleted node p.Get().Left = nextLargest; else //deleted node is a right child p.Get().Right = nextLargest; //jump around deleted node } } //return true is delete is successful return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deleteNode(Cat valueToDelete, Node root){\n Node temp = findNode(valueToDelete, root);\n if(temp.getRight()==null){\n Node parent = temp.getParent();\n if(temp.getLeft()==null){\n temp.setParent(null);\n if(temp==parent.getRight()){\n parent.setRight(null);\n fixBalanceValues(parent,-1);\n }\n else{\n parent.setLeft(null);\n fixBalanceValues(parent,1);\n }\n \n }\n else{\n //copy value of leftchild into the node to deletes data and delete it's leftchild\n temp.setData(temp.getLeft().getData());\n temp.setLeft(null);\n fixBalanceValues(temp, 1);\n }\n }\n Node nodeToDelete = temp.getRight();\n if(nodeToDelete.getLeft()==null){\n temp.setData(nodeToDelete.getData());\n temp.setRight(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(temp,-1);\n }\n else{\n while(nodeToDelete.getLeft()!=null){\n nodeToDelete=nodeToDelete.getLeft(); \n } \n temp.setData(nodeToDelete.getData());\n Node parent = nodeToDelete.getParent();\n parent.setLeft(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(parent,1);\n }\n \n \n }", "private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }", "public void delete(Integer data) {\n ArrayList<Node> parents = new ArrayList<>();\n Node nodeDel = this.root;\n Node parent = this.root;\n Node imBalance;\n Integer balanceFactor;\n boolean isLeftChild = false;\n if (nodeDel == null) {\n return;\n }\n while (nodeDel != null && !nodeDel.getData().equals(data)) {\n parent = nodeDel;\n if (data < nodeDel.getData()) {\n nodeDel = nodeDel.getLeftChild();\n isLeftChild = true;\n } else {\n nodeDel = nodeDel.getRightChild();\n isLeftChild = false;\n }\n parents.add(nodeDel);\n }\n\n if (nodeDel == null) {\n return;\n// delete a leaf node\n } else if (nodeDel.getLeftChild() == null && nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = null;\n } else {\n if (isLeftChild) {\n parent.setLeftChild(null);\n } else {\n parent.setRightChild(null);\n }\n }\n }\n// deleting a node with degree of one\n else if (nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getLeftChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getLeftChild());\n } else {\n parent.setRightChild(nodeDel.getLeftChild());\n }\n } else if (nodeDel.getLeftChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getRightChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getRightChild());\n } else {\n parent.setRightChild(nodeDel.getRightChild());\n }\n }\n // deleting a node with degree of two\n else {\n Integer minimumData = minimumData(nodeDel.getRightChild());\n delete(minimumData);\n nodeDel.setData(minimumData);\n }\n parent.setHeight(maximum(height(parent.getLeftChild()), height(parent.getRightChild())));\n balanceFactor = getBalance(parent);\n if (balanceFactor <= 1 && balanceFactor >= -1) {\n for (int i = parents.size() - 1; i >= 0; i--) {\n imBalance = parents.get(i);\n balanceFactor = getBalance(imBalance);\n if (balanceFactor > 1 || balanceFactor < -1) {\n if (imBalance.getData() > parent.getData()) {\n parent.setRightChild(rotateCase(imBalance, data, balanceFactor));\n } else\n parent.setLeftChild(rotateCase(imBalance, data, balanceFactor));\n break;\n }\n }\n }\n }", "void deleteTree(TreeNode node) \n {\n root = null; \n }", "public int delete(int k) {\n\t\tif (this.empty()) {// empty tree, nothing to erase\n\t\t\treturn -1;\n\t\t}\n\t\tAVLNode root = (AVLNode) this.root;\n\t\tAVLNode node = (AVLNode) root.delFindNode(k);\n\t\tif (node == null) {// no node with key==k in this tree\n\t\t\treturn -1;\n\t\t}\n\t\tchar side = node.parentSide();\n\t\tboolean rootTerm = (node.getLeft().getKey() != -1 && node.getRight().getKey() != -1);\n\t\tif (side == 'N' && (rootTerm == false)) {\n\t\t\treturn this.deleteRoot(node);\n\t\t}\n\t\tif (side == 'L') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 1 && rightEdge == 2) {\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.left != null && node.right == null) || (node.left == null && node.right != null)) {// node is //\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// unary\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 2)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (side == 'R') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 2 && rightEdge == 1) {\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.getLeft().getHeight() != -1 && node.getRight().getHeight() == -1)\n\t\t\t\t\t|| (node.getLeft().getHeight() == -1 && node.getRight().getHeight() != -1)) {// node is unary\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 2 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// we get here only if node is binary, and thus not going through any other\n\t\t// submethod\n\t\tAVLNode successor = this.findSuccessor(node); // successor must be unary/leaf\n\t\tif (node.checkRoot()) {\n\t\t\tthis.root = successor;\n\t\t}\n\t\tint numOp = this.delete(successor.key);\n\t\tsuccessor.setHeight(node.getHeight());\n\t\tsuccessor.size = node.getSize();\n\t\tsuccessor.setRight(node.getRight());\n\t\tnode.right.setParent(successor);\n\t\tnode.setRight(null);\n\t\tsuccessor.setLeft(node.getLeft());\n\t\tnode.left.setParent(successor);\n\t\tnode.setLeft(null);\n\t\tsuccessor.setParent(node.getParent());\n\t\tif (node.parentSide() == 'L') {\n\t\t\tnode.parent.setLeft(successor);\n\t\t} else if (node.parentSide() == 'R') {// node.parentSide()=='R'\n\t\t\tnode.parent.setRight(successor);\n\t\t}\n\t\tnode.setParent(null);\n\t\treturn numOp;\n\n\t}", "private static void rightLeftDelete() {\n System.out.println(\"RightLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 55, 70, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n \n System.out.println(\"Does 40 exist in tree? \"+tree1.search(40));\n System.out.println(\"Does 50 exist in tree? \"+tree1.search(50));\n System.out.print(\"Does null exist in tree? \");\n System.out.println(tree1.search(null));\n System.out.println(\"Try to insert 55 again: \");\n tree1.insert(55);\n System.out.println(\"Try to insert null: \");\n tree1.insert(null);\n System.out.println(\"Try to delete null: \");\n tree1.delete(null);\n System.out.println(\"Try to delete 100: nothing happen!\");\n tree1.delete(100);\n tree1.print();\n }", "public int delete(int k)\r\n\t{\r\n\t\tIAVLNode node = searchFor(this.root, k);\r\n\t\tIAVLNode parent;\r\n\t\tif(node==root)\r\n\t\t\tparent=new AVLNode(null);\r\n\t\telse\r\n\t\t\tparent=node.getParent();\r\n\t\t\r\n\t\tIAVLNode startHieghtUpdate = parent; // this will be the node from which we'll start updating the nodes' hieghts\r\n\t\t\r\n\t\tif (!node.isRealNode())\r\n\t\t\treturn -1;\r\n\t\t\r\n\t\t//updating the maximum and minimum fields\r\n\t\tif (node == this.maximum)\r\n\t\t\tthis.maximum = findPredecessor(node);\r\n\t\telse\r\n\t\t\tif (node == this.minimum)\r\n\t\t\t\tthis.minimum = findSuccessor(node); \r\n\t\t\r\n\t\t//if the node we wish to delete is a leaf\r\n\t\tif (!node.getLeft().isRealNode()&&!node.getRight().isRealNode())\r\n\t\t{\r\n\t\t\tif (node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\telse\r\n\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\tnode.getRight().setParent(parent);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t //if the node we wish to delete is unary:\r\n\t\t\tif (node.getLeft().isRealNode()&&!node.getRight().isRealNode()) //only left child\r\n\t\t\t{\r\n\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\tparent.setLeft(node.getLeft());\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.setRight(node.getLeft());\r\n\t\t\t\tnode.getLeft().setParent(parent);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tif (node.getRight().isRealNode()&&!node.getLeft().isRealNode()) //only right child\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\t\t\tnode.getRight().setParent(parent);\r\n\t\t\t\t\t}\r\n\t\t\t\t//if the node we wish to delete is a father of two\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\tIAVLNode suc = findSuccessor(node);\r\n\t\t\t\t\t\tIAVLNode sucsParent = suc.getParent();\r\n\t\t\t\t\t\t//deleting the successor of the node we wish to delete\r\n\t\t\t\t\t\tif (suc == sucsParent.getLeft())\r\n\t\t\t\t\t\t\tsucsParent.setLeft(suc.getRight());\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tsucsParent.setRight(suc.getRight());\r\n\t\t\t\t\t\tsuc.getRight().setParent(sucsParent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//inserting the successor in it's new place (the previous place of the node we deleted)\r\n\t\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\t\tparent.setLeft(suc);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tparent.setRight(suc);\r\n\t\t\t\t\t\tsuc.setParent(parent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// node's children are now his scuccessor's children\r\n\t\t\t\t\t\tsuc.setRight(node.getRight());\r\n\t\t\t\t\t\tsuc.setLeft(node.getLeft());\r\n\t\t\t\t\t\tsuc.getRight().setParent(suc);\r\n\t\t\t\t\t\tsuc.getLeft().setParent(suc);\r\n\t\t\t\t\t\t//now we check if the successor of the node we wanted to delete was his son\r\n\t\t\t\t\t\tif (node != sucsParent) // the successor's parent was the deleted node (which is no longer part of the tree)\r\n\t\t\t\t\t\t\tstartHieghtUpdate = sucsParent;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tstartHieghtUpdate = suc;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if we wish to delete the tree's root, then we need to update the tree's root to a new node\r\n\t\tif (node == this.root) \r\n\t\t{\r\n\t\t\tthis.root = parent.getRight();\r\n\t\t\tthis.root.setParent(null);\r\n\t\t}\r\n\t\t\r\n\t\tint moneRot = HieghtsUpdating(startHieghtUpdate);\r\n\t\treturn moneRot;\r\n\t}", "private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void deleteNode(BinaryTreeNode node) // Only leaf nodes and nodes with degree 1 can be deleted. If a degree 1 node is deleted, it is replaced by its subtree.\r\n {\n if(!node.hasRightChild() && !node.hasLeftChild()){\r\n if(node.mActualNode.mParent.mRightChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mRightChild = null;\r\n }\r\n else if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mLeftChild = null;\r\n }\r\n //node.mActualNode = null;\r\n\r\n }\r\n //if deleted node has degree 1 and has only left child\r\n else if(node.hasLeftChild() && !node.hasRightChild()){\r\n node.mActualNode.mLeftChild.mParent = node.mActualNode.mParent;\r\n //if deleted node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode)\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mLeftChild;\r\n //if deleted node is right child of his father\r\n else {\r\n\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mLeftChild;\r\n }\r\n }\r\n // if deleted node has degree 1 and has only right child\r\n else if(node.hasRightChild() && !node.hasLeftChild()){\r\n node.mActualNode.mRightChild.mParent = node.mActualNode.mParent;\r\n\r\n //if node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mRightChild;\r\n\r\n }\r\n //if node is right child of his father\r\n else\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mRightChild;\r\n\r\n\r\n }\r\n else\r\n System.out.println(\"Error : node has two child\");\r\n\r\n }", "public int delete(int k){\n\t WAVLNode x = treePosForDel(this, k); // find the node to delete\r\n\t int cnt = 0; // rebalance operations counter\r\n\t if(x.key!=k) { // if a node with a key of k doesnt exist in the tree there is nothing to delete, return -1\r\n\t\t return -1;\r\n\t }\r\n\t if(this.root.key==x.key&&this.root.rank==0) {//root is a leaf\r\n\t\t this.root=EXT_NODE;// change the root pointer to EXT_NODE\r\n\t\t return 0;\r\n\t }\r\n\t else if(this.root.key==x.key&&(this.root.right==EXT_NODE||this.root.left==EXT_NODE)) {//root is onary\r\n\t\t if(x.left!=EXT_NODE) { // x is a root with a left child\r\n\t\t\t x.left.parent = null;\r\n\t\t\t this.root = x.left; // change the root pointer to the root's left child\r\n\t\t\t x.left.sizen=1;\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t x.right.parent = null; // x is a root with a right child \r\n\t\t x.right.sizen=1;\r\n\t\t this.root = x.right; // change the root pointer to the root's right child\r\n\t\t return 0;\r\n\t }\r\n\t WAVLNode z;\r\n\t if(isInnerNode(x)) {// x is an inner node, requires a call for successor and swap\r\n\t\t z = successorForDel(x); // find the successor of x\r\n\t\t x = swap(x,z); // put x's successor instead of x and delete successor \r\n\t }\r\n\t\t if(x.rank == 0) {//x is a leaf\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.left = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.left;\r\n\t\t\t }\r\n\t\t\telse { // x is a right child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.right = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.right; \r\n\t\t\t }\r\n\t\t }\r\n\t\t else {//x is onary\r\n\t\t\t boolean onaryside = onaryLeft(x); // check if x is onary with a left child\r\n\t\t\t WAVLNode x_child = EXT_NODE;\r\n\t\t\t if (onaryside) {\r\n\t\t\t\t x_child=x.left; // get a pointer for x child\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t x_child=x.right;\r\n\t\t\t }\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.left=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {// x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.right=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t }\r\n\t\t }\r\n\t if (z.left.rank==-1&&z.right.rank==-1) {//special case, z becomes a leaf, change pointers and demote\r\n\t\t demote(z);\r\n\t\t x=z;\r\n\t\t z=z.parent;\r\n\t\t cnt++;\r\n\t }\r\n\t \r\n\t while(z!=null&&z.rank-x.rank==3) { // while the tree is not balanced continue to balance the tree\r\n\t\t if(parentside(z, x).equals(\"left\")) { // x is z's left son\r\n\t\t\t if(z.rank-z.right.rank==2) {//condition for demote\r\n\r\n\t\t\t\t demote(z);\r\n\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.right.rank-z.right.left.rank==2&&z.right.rank-z.right.right.rank==2) {//condition for doubledemote left\r\n\t\t\t\t\t doubleDemoteLeft(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t else if((z.right.rank-z.right.left.rank==1||z.right.rank-z.right.left.rank==2)&&z.right.rank-z.right.right.rank==1) {// condition for rotate left for del\r\n\t\t\t\t\t rotateLeftDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t\t else {//condition for doublerotate left for del\r\n\t\t\t\t\t doubleRotateLeftDel(z);\r\n\t\t\t\t\t \r\n\t\t\t\t\t cnt=cnt+5;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t\t else { // x is z's right son, conditions are symmetric to left side\r\n\t\t\t if(z.rank-z.left.rank==2) {\r\n\t\t\t\t demote(z);\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.left.rank-z.left.right.rank==2&&z.left.rank-z.left.left.rank==2) {\r\n\t\t\t\t\t doubleDemoteright(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t }\r\n\t\t\t\t else if((z.left.rank-z.left.right.rank==1||z.left.rank-z.left.right.rank==2)&&z.left.rank-z.left.left.rank==1) {\r\n\t\t\t\t\t rotateRightDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t else {\r\n\r\n\t\t\t\t\t doubleRotateRightDel(z);\r\n\t\t\t\t\t cnt+=5;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t }\r\n\t }\r\n\t return cnt;\r\n }", "public void delete() {\n this.root = null;\n }", "private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void delete(int key) {\n\n\n // There should be 6 cases here\n // Non-root nodes should be forwarded to the static function\n if (root == null) System.out.println(\"Empty Tree!!!\"); // ไม่มี node ใน tree\n else {\n\n Node node = find(key);\n\n if (node == null) System.out.println(\"Key not found!!!\"); //ไม่เจอ node\n\n\n else if(node == root){ //ตัวที่ลบเป็น root\n if (root.left == null && root.right == null) { //ใน tree มีแค่ root ตัสเดียว ก็หายไปสิ จะรอไร\n root = null;\n }\n else if (root.left != null && root.right == null) { //่ root มีลูกฝั่งซ้าย เอาตัวลูกขึ้นมาแทน\n root.left.parent = null;\n root = root.left;\n }\n else { //่ root มีลูกฝั่งขวา เอาตัวลูกขึ้นมาแทน\n Node n = findMin(root.right);\n root.key = n.key;\n delete(n);\n }\n\n }\n\n\n else { //ตัวที่ลบไม่ใช่ root\n delete(node);\n }\n }\n }", "AVLNode delete(AVLNode node, int key) {\n if (node == null) \n return node; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < node.key) \n node.left = delete(node.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n node.right = delete(node.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n \n // node with only one child or no child \n if ((node.left == null) || (node.right == null)) \n { \n AVLNode temp = null; \n if (temp == node.left) \n temp = node.right; \n else\n temp = node.left; \n \n if (temp == null) \n { \n temp = node; \n node = null; \n } \n else \n node = temp; \n } \n else\n { \n AVLNode temp = getSucc(node.right); \n node.key = temp.key; \n node.right = delete(node.right, temp.key); \n } \n } \n \n if (node== null) \n return node; \n \n node.height = max(height(node.left), height(node.right)) + 1; \n \n int balance = getBF(node); \n \n if (balance > 1 && getBF(node.left) >= 0) \n return rightrot(node); \n \n if (balance > 1 && getBF(node.left) < 0) \n { \n node.left = leftrot(node.left); \n return rightrot(node); \n } \n \n if (balance < -1 && getBF(node.right) <= 0) \n return leftrot(node); \n\n if (balance < -1 && getBF(node.right) > 0) \n { \n node.right = rightrot(node.right); \n return leftrot(node); \n } \n return node;\n }", "@Override\n /*\n * Delete an element from the binary tree. Return true if the element is\n * deleted successfully Return false if the element is not in the tree\n */\n public boolean delete(E e) {\n TreeNode<E> parent = null;\n TreeNode<E> current = root;\n while (current != null) {\n if (e.compareTo(current.element) < 0) {\n parent = current;\n current = current.left;\n } else if (e.compareTo(current.element) > 0) {\n parent = current;\n current = current.right;\n } else {\n break; // Element is in the tree pointed at by current\n }\n }\n if (current == null) {\n return false; // Element is not in the tree\n }// Case 1: current has no left children\n if (current.left == null) {\n// Connect the parent with the right child of the current node\n if (parent == null) {\n root = current.right;\n } else {\n if (e.compareTo(parent.element) < 0) {\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n }\n } else {\n// Case 2: The current node has a left child\n// Locate the rightmost node in the left subtree of\n// the current node and also its parent\n TreeNode<E> parentOfRightMost = current;\n TreeNode<E> rightMost = current.left;\n while (rightMost.right != null) {\n parentOfRightMost = rightMost;\n rightMost = rightMost.right; // Keep going to the right\n }\n// Replace the element in current by the element in rightMost\n current.element = rightMost.element;\n// Eliminate rightmost node\n if (parentOfRightMost.right == rightMost) {\n\n parentOfRightMost.right = rightMost.left;\n } else // Special case: parentOfRightMost == current\n {\n parentOfRightMost.left = rightMost.left;\n }\n }\n size--;\n return true; // Element inserted\n }", "public void deleteNode() {\n TreeNode pNode = this.getParentNode();\n int id = this.getSelfId();\n\n if (pNode != null) {\n pNode.deleteChildNode(id);\n }\n }", "public void delete(int val){\n Node parent = this.root;\n Node current = this.root;\n boolean isLeftChild = false;\n \n while (current.val != val){\n parent = current;\n if (current.val > val){\n isLeftChild = true;\n current = current.left;\n } else {\n isLeftChild = false;\n current = current.right;\n }\n \n if (current == null){\n return;\n }\n }\n \n // If we are here it means we have found the node\n // Case 1. leaf node\n if (current.left == null && current.right == null){\n if (current == this.root){\n this.root = null;\n }\n \n if (isLeftChild){\n parent.left = null;\n } else {\n parent.right = null;\n }\n }\n \n // Case 2. one child\n else if (current.left == null){\n if (current == this.root){\n this.root = current.right;\n } else if (isLeftChild){\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n } else if (current.right == null){\n if (current == this.root){\n this.root = current.left;\n } else if (isLeftChild){\n parent.left = current.left;\n } else {\n parent.right = current.left;\n }\n }\n \n // Case 3. two children. successor is the smallest node in the right subtree\n else if (current.left != null && current.right != null){\n Node successor = getSuccessor(current);\n if (current == this.root){\n root = successor;\n } else if (isLeftChild){\n parent.left = successor;\n } else {\n parent.right = successor;\n }\n }\n \n }", "public static TreeNode delete(TreeNode t, String target)\n {\n \n if(t == null)\n return null;\n \n else if(target.compareTo((String)t.getValue()) < 0)\n t.setLeft(delete(t.getLeft(), target));\n else if(target.compareTo((String)t.getValue()) > 0)\n t.setRight(delete(t.getRight(), target));\n else\n {\n //t.getValue() == v\n //ndoe thats leaf or one child\n if(t.getLeft() == null)\n return t.getRight();\n else if (t.getRight() == null)\n return t.getLeft();\n \n \n //if node has 2 children\n t.setValue(min(t.getRight()));\n \n //recursive call \n t.setRight(delete(t.getRight(), (String)t.getValue()));\n }\n return t;\n \n }", "private Node<E> delete(Node<E> localRoot, E item) {\r\n\t\tif(localRoot == null) {\r\n\t\t\t// item is not in the tree.\r\n\t\t\tdeleteReturn = null;\r\n\t\t\treturn localRoot;\r\n\t\t}\t\r\n\t\t// Search for item to delete\r\n\t\tint compResult = item.compareTo(localRoot.data);\r\n\t\tif(compResult < 0) {\r\n\t\t\t// item is smaller than localRoot.data\r\n\t\t\tlocalRoot.left = delete(localRoot.left, item);\r\n\t\t\treturn localRoot;\r\n\t\t}\r\n\t\telse if(compResult > 0) {\r\n\t\t\t// item is larger than localRoot.data\r\n\t\t\tlocalRoot.right = delete(localRoot.right, item);\r\n\t\t\treturn localRoot;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// item is at the local root\r\n\t\t\tdeleteReturn = localRoot.data;\r\n\t\t\tif(localRoot.left == null) {\r\n\t\t\t\t// if there is no left child, return the right child which can also be null\r\n\t\t\t\treturn localRoot.right;\r\n\t\t\t}\r\n\t\t\telse if(localRoot.right == null) {\r\n\t\t\t\t// if theres no right child, return the left child\r\n\t\t\t\treturn localRoot.left;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//Node being deleted has two children, replace the data with inorder predecessor\r\n\t\t\t\tif(localRoot.left.right == null) {\r\n\t\t\t\t\t// the left child has no right child\r\n\t\t\t\t\t//replace the data with the data in the left child\r\n\t\t\t\t\tlocalRoot.data = localRoot.left.data;\r\n\t\t\t\t\t// replace the left child with its left child\r\n\t\t\t\t\tlocalRoot.left = localRoot.left.left;\r\n\t\t\t\t\treturn localRoot;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t//Search for in order predecessor(IP) and replace deleted nodes data with IP\r\n\t\t\t\t\tlocalRoot.data = findLargestChild(localRoot.left);\r\n\t\t\t\t\treturn localRoot;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private TSTNode<E> deleteNodeRecursion(TSTNode<E> currentNode) {\n \n if(currentNode == null) return null;\n if(currentNode.relatives[TSTNode.EQKID] != null || currentNode.data != null) return null; // can't delete this node if it has a non-null eq kid or data\n\n TSTNode<E> currentParent = currentNode.relatives[TSTNode.PARENT];\n\n // if we've made it this far, then we know the currentNode isn't null, but its data and equal kid are null, so we can delete the current node\n // (before deleting the current node, we'll move any lower nodes higher in the tree)\n boolean lokidNull = currentNode.relatives[TSTNode.LOKID] == null;\n boolean hikidNull = currentNode.relatives[TSTNode.HIKID] == null;\n\n ////////////////////////////////////////////////////////////////////////\n // Add by Cheok. To resolve java.lang.NullPointerException\n // I am not sure this is the correct solution, as I have not gone\n // through this sourc code in detail.\n if (currentParent == null && currentNode == this.rootNode) {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n // Add by Cheok. To resolve java.lang.NullPointerException\n ////////////////////////////////////////////////////////////////////////\n\n // now find out what kind of child current node is\n int childType;\n if(currentParent.relatives[TSTNode.LOKID] == currentNode) {\n childType = TSTNode.LOKID;\n } else if(currentParent.relatives[TSTNode.EQKID] == currentNode) {\n childType = TSTNode.EQKID;\n } else if(currentParent.relatives[TSTNode.HIKID] == currentNode) {\n childType = TSTNode.HIKID;\n } else {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n\n if(lokidNull && hikidNull) {\n // if we make it to here, all three kids are null and we can just delete this node\n currentParent.relatives[childType] = null;\n return currentParent;\n }\n\n // if we make it this far, we know that EQKID is null, and either HIKID or LOKID is null, or both HIKID and LOKID are NON-null\n if(lokidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.HIKID];\n currentNode.relatives[TSTNode.HIKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n if(hikidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.LOKID];\n currentNode.relatives[TSTNode.LOKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n int deltaHi = currentNode.relatives[TSTNode.HIKID].splitchar - currentNode.splitchar;\n int deltaLo = currentNode.splitchar - currentNode.relatives[TSTNode.LOKID].splitchar;\n int movingKid;\n TSTNode<E> targetNode;\n \n // if deltaHi is equal to deltaLo, then choose one of them at random, and make it \"further away\" from the current node's splitchar\n if(deltaHi == deltaLo) {\n if(Math.random() < 0.5) {\n deltaHi++;\n } else {\n deltaLo++;\n }\n }\n\n\tif(deltaHi > deltaLo) {\n movingKid = TSTNode.HIKID;\n targetNode = currentNode.relatives[TSTNode.LOKID];\n } else {\n movingKid = TSTNode.LOKID;\n targetNode = currentNode.relatives[TSTNode.HIKID];\n }\n\n while(targetNode.relatives[movingKid] != null) targetNode = targetNode.relatives[movingKid];\n \n // now targetNode.relatives[movingKid] is null, and we can put the moving kid into it.\n targetNode.relatives[movingKid] = currentNode.relatives[movingKid];\n\n // now we need to put the target node where the current node used to be\n currentParent.relatives[childType] = targetNode;\n targetNode.relatives[TSTNode.PARENT] = currentParent;\n\n if(!lokidNull) currentNode.relatives[TSTNode.LOKID] = null;\n if(!hikidNull) currentNode.relatives[TSTNode.HIKID] = null;\n\n // note that the statements above ensure currentNode is completely dereferenced, and so it will be garbage collected\n return currentParent;\n }", "private static void leftLeftDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(65);\n System.out.println(\"After delete nodes 65, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "public void delete(E data){\n \t// Preform a regular delete\n \t// Check to make sure the tree remains an RBT tree\n\tNode<E> z = search(data);\n\tNode<E> x = sentinel;\n\tNode<E> y = z;\n\tCharacter y_original_color = y.getColor();\n\tif (z.getLeftChild() == sentinel) {\n\t\tx = z.getRightChild();\n\t\ttransplant(z, z.getRightChild());\n\t} else if (z.getRightChild() == sentinel) {\n\t\tx = z.getLeftChild();\n\t\ttransplant(z, z.getLeftChild());\n\t} else {\n\t\ty = getMin(z.getRightChild());\n\t\ty_original_color = y.getColor();\n\t\tx = y.getRightChild();\n\t\tif (y.getParent() == z) {\n\t\t\tx.setParent(y);\n\t\t} else {\n\t\t\ttransplant(y, y.getRightChild());\n\t\t\ty.setRightChild(z.getRightChild());\n\t\t\ty.getRightChild().setParent(y);\n\t\t}\n\t\t\n\t\ttransplant(z, y);\n\t\ty.setLeftChild(z.getLeftChild());\n\t\ty.getLeftChild().setParent(y);\n\t\ty.setColor(z.getColor());\n\t}\n\t\n\tif (y_original_color == 'B') {\n\t\tfixDelete(x);\n\t}\n\t\t\n \n }", "public void deleteNode(int val) {\n\n Node nodeToDelete = find(val);\n\n if (nodeToDelete != null) {\n\n if (nodeToDelete.leftChild == null && nodeToDelete.rightChild == null) {\n\n //case1 - node has no child\n deleteCase1(nodeToDelete);\n } else if (nodeToDelete.leftChild != null && nodeToDelete.rightChild != null) {\n // case 3- node has both left and right child\n deleteCase3(nodeToDelete);\n } else {\n // Case 2 - node has left or right child not both\n deleteCase2(nodeToDelete);\n }\n\n }\n\n\n }", "public void delete(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null && currentNode.getKey() != key){\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (currentNode == null){\n\t\t\tSystem.out.println(\"No such key is found in the tree\");\n\t\t\treturn;\n\t\t}\n\t\tif (currentNode.getLeft() == null && currentNode.getRight() == null){\n\t\t\t//Leaf Node\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(null);\n\t\t\t}else{\n\t\t\t\tparent.setLeft(null);\n\t\t\t}\n\t\t}else if (currentNode.getLeft() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getRight());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getRight());\n\t\t\t}\n\t\t}else if(currentNode.getRight() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getLeft());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getLeft());\n\t\t\t}\n\t\t}else{\n\t\t\t// this is case where this node has two children\n\t\t\tBSTNode node = currentNode.getLeft();\n\t\t\tBSTNode parentTemp = currentNode;\n\t\t\twhile (node.getRight() != null){\n\t\t\t\tparentTemp = node;\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t\t// switch the value with the target node we are deleting.\n\t\t\tcurrentNode.setKey(node.getKey());\n\t\t\t// remove this node but don't forget about its left tree\n\t\t\tparentTemp.setRight(node.getLeft());\n\t\t}\n\t}", "private BinarySearchTree deleteTree(BinarySearchTree tree, Comparable key){\r\n\t\t\r\n\t\t//If it is a leaf\r\n\t\tif(tree.getLeftChild() == null && tree.getRightChild() == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//Tree has only 1 leaf\r\n\t\telse if( (tree.getLeftChild() == null && tree.getRightChild() != null) ||\r\n\t\t\t\t (tree.getLeftChild() != null && tree.getRightChild() == null)){\r\n\t\t\t\r\n\t\t\t//Make a new tree out of the leaf and make it the new root\r\n\t\t\tif(tree.getLeftChild() != null){\r\n\t\t\t\treturn tree.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn tree.getRightChild();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Has two leaves. This case is slightly more complicated\r\n\t\telse{\r\n\t\t\t//get the leftmost item in the right child subtree. This becomes the \r\n\t\t\t//new root. This allows the BinarySearchTree to stay a valid \r\n\t\t\t//BinarySearchTree\r\n\t\t\tKeyedItem replacementItem = findLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//Delete the tree with that item so it can be moved to the new root\r\n\t\t\tBinarySearchTree replacementTree = deleteLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//change the root to the new item\r\n\t\t\ttree.setRootItem(replacementItem);\r\n\t\t\t\r\n\t\t\t//Set the new roots right tree to the replacement tree\r\n\t\t\ttree.attachRightSubtree(replacementTree);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}", "public void deleteNode ()\n {\n ConfigTreeNode node = _tree.getSelectedNode();\n ConfigTreeNode parent = (ConfigTreeNode)node.getParent();\n int index = parent.getIndex(node);\n ((DefaultTreeModel)_tree.getModel()).removeNodeFromParent(node);\n int ccount = parent.getChildCount();\n node = (ccount > 0) ?\n (ConfigTreeNode)parent.getChildAt(Math.min(index, ccount - 1)) : parent;\n if (node != _tree.getModel().getRoot()) {\n _tree.setSelectionPath(new TreePath(node.getPath()));\n }\n DirtyGroupManager.setDirty(group, true);\n }", "Node deleteNode(Node root, int key) \n {\n if (root == null) \n return root; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < root.key) \n root.left = deleteNode(root.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n root.right = deleteNode(root.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n // node with only one child or no child \n if ((root.left == null) || (root.right == null)) \n { \n Node temp = null; \n if (temp == root.left) \n temp = root.right; \n else\n temp = root.left; \n \n // No child case \n if (temp == null) \n { \n temp = root; \n root = null; \n } \n else // One child case \n root = temp; // Copy the contents of \n // the non-empty child \n } \n else\n { \n \n // node with two children: Get the inorder \n // successor (smallest in the right subtree) \n Node temp = minValueNode(root.right); \n \n // Copy the inorder successor's data to this node \n root.key = temp.key; \n \n // Delete the inorder successor \n root.right = deleteNode(root.right, temp.key); \n } \n } \n \n // If the tree had only one node then return \n if (root == null) \n return root; \n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE \n root.height = max(height(root.left), height(root.right)) + 1; \n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether \n // this node became unbalanced) \n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n \n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n \n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n \n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n \n return root; \n }", "@Override\n\tpublic void onPreNodeDelete(NodeModel oldParent, NodeModel selectedNode, int index) {\n\n\t}", "public static void delete(Node node){\n // There should be 7 cases here\n if (node == null) return;\n\n if (node.left == null && node.right == null) { // sub-tree is empty case\n if (node.key < node.parent.key) { // node น้อยกว่าข้างบน\n node.parent.left = null;\n }\n else {\n node.parent.right = null;\n }\n\n return;\n }\n\n else if (node.left != null && node.right == null) { // right sub-tree is empty case\n if (node.left.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.left.parent = node.parent;\n node.parent.left = node.left;\n }\n else {\n node.left.parent = node.parent;\n node.parent.right = node.left;\n }\n return;\n }\n else if (node.right != null && node.left == null) { // left sub-tree is empty case\n if (node.right.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.right.parent = node.parent;\n node.parent.left = node.right;\n }\n else {\n node.right.parent = node.parent;\n node.parent.right = node.right;\n }\n return;\n }\n else { // full node case\n // หา min ของ right-subtree เอา key มาเขียนทับ key ของ node เลย\n Node n = findMin(node.right);\n node.key = n.key;\n delete(n);\n }\n }", "void deleteTreeRef(TreeNode nodeRef) \n { \n \tif(nodeRef == null) return;\n \t\n \t\n \tdeleteTreeRef(nodeRef.left);\n\n \tdeleteTreeRef(nodeRef.right);\n \t\n \t\n \t System.out.println(\"Deleting node:\" + nodeRef.val);\n \t deleteTree(nodeRef); \n \n nodeRef=null; \n }", "public Object remove(int id) {\n AVLNode parent = root;\n AVLNode current = root;\n boolean isLeftChild = false;\n Object element = null;\n \n while(current.getId() != id) {\n parent = current;\n \n if(current.getId() > id) {\n isLeftChild = true;\n current = current.getLeft();\n } else {\n isLeftChild = false;\n current = current.getRight();\n }\n \n if(current == null) {\n return element;\n }\n }\n element = current.getElement();\n \n //if node to be deleted has no children\n if(current.getLeft() == null && current.getRight() == null) {\n if(current == root) {\n root = null;\n }\n \n if(isLeftChild == true) {\n parent.setLeft(null);\n } else {\n parent.setRight(null);\n }\n }\n \n //if node to be deleted has only one child\n else if(current.getRight() == null) {\n if(current == root) {\n root = current.getLeft();\n } else if(isLeftChild) {\n parent.setLeft(current.getLeft());\n } else {\n parent.setRight(current.getLeft());\n }\n } else if(current.getLeft() == null) {\n if(current == root) {\n root = current.getRight();\n } else if(isLeftChild) {\n parent.setLeft(current.getRight());\n } else {\n parent.setRight(current.getRight());\n }\n } else if(current.getLeft() != null && current.getRight() != null) { \n AVLNode successor = getSuccessor(current);\n \n if(current == root) {\n root = successor;\n } else if(isLeftChild) {\n parent.setLeft(successor);\n } else {\n parent.setRight(successor);\n }\n \n successor.setLeft(current.getLeft());\n }\n \n return element;\n }", "AVLNode deleteNode(AVLNode root, int data){\r\n\t if (root == null){\r\n\t return root;\r\n\t }\r\n\t \r\n\t //Slightly different than the already implemented search for node function\r\n\t if ( data < root.data ){\r\n\t root.left = deleteNode(root.left, data);\r\n\t }\r\n\t else if( data > root.data ){\r\n\t root.right = deleteNode(root.right, data);\r\n\t }else{\r\n\t // node with only one child or no child\r\n\t if( (root.left == null) || (root.right == null) ){\r\n\t AVLNode temp = root.left!=null ? root.left : root.right;\r\n\t // No child case\r\n\t if(temp == null){\r\n\t temp = root;\r\n\t root = null;\r\n\t }else{ // One child case\r\n\t root = temp; \r\n\t }\r\n\t }else{\r\n\t // node with two children: Get the inorder successor (smallest\r\n\t // in the right subtree)\r\n\t \tAVLNode minNode = root.right;\r\n\t \twhile (minNode.left != null){\r\n\t minNode = minNode.left;\r\n\t \t}\r\n\t \tAVLNode temp = minNode;\r\n\t // Copy the inorder successor's data to this node\r\n\t root.data = temp.data;\r\n\t // Delete the inorder successor\r\n\t root.right = deleteNode(root.right, temp.data);\r\n\t }\r\n\t \r\n\t // If the tree had only one node then return\r\n\t if (root == null){\r\n\t return root;\r\n\t }\r\n\t balanceTree(root);\r\n\t }\r\n\t return root;\r\n\t}", "private AVLNode handleDeletion(AVLNode treeRoot) {\n if ((treeRoot.getLeft() == null) || (treeRoot.getRight() == null)) {\n\n // Node with only one child or with no childs at all\n\n // Store the node which can be non-null\n AVLNode node = null;\n if (node == treeRoot.getLeft()) {\n node = treeRoot.getRight();\n } else {\n node = treeRoot.getLeft();\n }\n\n // Two possible cases:\n // - No child case\n // - One child case\n\n // No child case\n if (node == null) {\n treeRoot = null;\n }\n else { // One child case\n treeRoot = node; // Copy the contents of the non-empty child\n }\n } else {\n\n // Case of node with two children\n\n // Store the inorder successor (smallest node in the right subtree)\n AVLNode temp = minValueNode(treeRoot.getRight());\n\n // Copy the inorder successor's data to this node\n treeRoot.setElement(temp.getElement());\n\n // Delete the inorder successor\n treeRoot.setRight(deleteNodeImmersion(treeRoot.getRight(), temp.getKey()));\n }\n\n return treeRoot;\n }", "public NodeBinaryTree deleteNode(NodeBinaryTree node, int value)\n {\n if(node == null)\n {\n return null;\n }\n\n if(value < node.data)\n {\n node.leftNode = deleteNode(node.leftNode, value);\n }\n else if(value > node.data)\n {\n node.rightNode = deleteNode(node.rightNode, value);\n }\n else\n {\n // it is the condition where the the ndoe value is itself\n if(node.leftNode == null)\n {\n return node.rightNode;\n }\n else if(node.rightNode == null)\n {\n return node.leftNode;\n }\n\n // we traverse right part of tree for minimum value\n node.data = minimumValueOfRight(node.rightNode);\n node.rightNode = deleteNode(node.rightNode, node.data);\n }\n return node;\n }", "private Node removeElement(Object value) {\n if (value.equals(this.value)) {\n return this.removeElement();\n }\n\n if (((Comparable)value).compareTo(this.value) < 0) {\n if (this.leftChild != null) {\n this.leftChild = this.leftChild.removeElement(value);\n return this.balance();\n }\n } else {\n if (this.rightChild != null) {\n this.rightChild = this.rightChild.removeElement(value);\n return this.balance();\n }\n }\n return this;\n }", "public void remove(T value) {\n\n // Declares and initializes the node whose value is being searched for and begins a recursive search.\n Node<T> node = new Node<>(value);\n if (root.getValue().compareTo(value) == 0) node = root;\n else node = searchRecursively(root, value);\n\n // If node has no children...\n if (node.getLeft() == null && node.getRight() == null) {\n // If it's the root, remove root.\n if (node.getValue().compareTo(root.getValue()) == 0) {\n root = null;\n return;\n }\n // Otherwise, get its parent node.\n Node parent = getParent(value);\n // Determines whether the node is the left or right child of the parent and sets the appropriate branch of\n // the parent to null.\n if (parent.getLeft() == null) {\n if (parent.getRight().getValue().compareTo(value) == 0)\n parent.setRight(null);\n } else if (parent.getRight() == null) {\n if (parent.getLeft().getValue().compareTo(value) == 0)\n parent.setLeft(null);\n } else if (parent.getLeft().getValue().compareTo(value) == 0) {\n parent.setLeft(null);\n } else if (parent.getRight().getValue().compareTo(value) == 0) {\n parent.setRight(null);\n }\n\n // If the node has either no left or no right branch...\n } else if (node.getLeft() == null || node.getRight() == null) {\n // If its left branch is null...\n if (node.getLeft() == null) {\n // If the value in question belongs to the root and root has no left branch, its right branch becomes\n // the new root.\n if (node.getValue().compareTo(root.getValue()) == 0) root = root.getRight();\n // Otherwise, finds the parent, determines whether the value in question belongs to the node in the\n // parent's left or right branch, and sets the appropriate branch to reference the node's right branch.\n else {\n Node<T> parent = getParent(value);\n if (parent.getLeft().getValue().compareTo(value) == 0) parent.setLeft(node.getRight());\n else parent.setRight(node.getRight());\n }\n // If its right branch is null...\n } else if (node.getRight() == null) {\n // If the value in question belongs to the root and root has no right branch, its left branch becomes\n // the new root.\n if (node.getValue().compareTo(root.getValue()) == 0) root = root.getLeft();\n else {\n Node<T> parent = getParent(value);\n if (parent.getLeft().getValue().compareTo(value) == 0) parent.setLeft(node.getLeft());\n else parent.setRight(node.getRight());\n }\n }\n // If the node has two children...\n } else {\n // Iterates through the current node's left nodes until none remain, replacing its value with that of its left node.\n while (node.getLeft() != null) {\n Node<T> left = node.getLeft();\n node.setValue(left.getValue());\n if (node.getLeft().getLeft() == null && node.getLeft().getRight() == null) {\n node.setLeft(null);\n }\n node = left;\n // If there are no left nodes but a right node exists, sets the current node's value to that of its right\n // node. Loop will continue to iterate through left nodes.\n if (node.getLeft() == null && node.getRight() != null) {\n Node<T> right = node.getRight();\n node.setValue(right.getValue());\n node = right;\n }\n }\n }\n balance(root);\n }", "public void delete(int val) {\n\t\troot=delete(root,val);\n\t}", "public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}", "private void delete(Node curr, int ID, AtomicReference<Node> rootRef) {\n\t\tif(curr == null || curr.isNull) {\n return;\n }\n if(curr.ID == ID) {\n if(curr.right.isNull || curr.left.isNull) {\n deleteDegreeOneChild(curr, rootRef);\n } else {\n Node n = findSmallest(curr.right);\n \tcurr.ID = n.ID;\n curr.count = n.count;\n delete(curr.right, n.ID, rootRef);\n }\n }\n if(curr.ID < ID) {\n delete(curr.right, ID, rootRef);\n } else {\n delete(curr.left, ID, rootRef);\n }\n\t}", "public void delete(Item<K,V> i) {\n if (i.getL() == null && i.getR() == null) {\n if (i.getP() != null) {\n declineChild(i, null);\n } else {\n root = null;\n }\n } else if (i.getL() != null && i.getR() != null) {\n Item<K,V> s = successor(i);\n declineChild(s, s.getR());\n i.setK(s.getK());\n i.setV(s.getV());\n } else {\n Item<K,V> x = i.getL();\n if (x == null) {\n x = i.getR();\n }\n if (i.getP() != null) {\n declineChild(i, x);\n } else {\n root = x;\n x.setP(null);\n }\n }\n size -= 1;\n }", "private Node<Integer, Integer> delete(Node<Integer, Integer> node, int value) {\n\t\tif (node.getKey() == value && !node.hasChildren()) {\n\t\t\treturn null;\n\t\t} else if (node.getKey() == value && node.hasChildren()) {\n\t\t\tif (node.getLeft() == null && node.getRight() != null) {\n\t\t\t\treturn node.getRight();\n\t\t\t} else if (node.getLeft() != null && node.getRight() == null) {\n\t\t\t\treturn node.getLeft();\n\t\t\t} else {\n\t\t\t\treturn deleteRotateRight(node);\n\t\t\t}\n\t\t} else {\n\t\t\tif (node.getKey() > value) {\n\t\t\t\tnode.left = delete(node.getLeft(), value);\n\t\t\t\treturn node;\n\t\t\t} else {\n\t\t\t\tnode.right = delete(node.getRight(), value);\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t}", "void deleteTreeRef(Node nodeRef) {\n\t\tSystem.out.println(\"\\nSize of given Tree before delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t\tdeleteTree(nodeRef);\n\t\tnodeRef = null;\n\n\t\tSystem.out.println(\"\\nSize of given Tree after delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t}", "private void deleteTree(tnode root){\n if (root != null)\n root = null;\n }", "public void delete(E e) {\n\t\tNode node = getNode(root, e);\n\t\tif (node == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tif (parentOfLast.right != null) {\n\t\t\tnode.data = parentOfLast.right.data;\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tnode.data = parentOfLast.left.data;\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t\tsize--;\n\t}", "private Node deleteRec(T val, Node node, boolean[] deleted) {\n if (node == null) {\n return null;\n }\n\n int comp = val.compareTo(node.val);\n if (comp == 0) {\n // This is the node to delete\n deleted[0] = true;\n if (node.left == null) {\n // Just slide the right child up\n return node.right;\n } else if (node.right == null) {\n // Just slide the left child up\n return node.left;\n } else {\n // Find next inorder node and replace deleted node with it\n T nextInorder = minValue(node.right);\n node.val = nextInorder;\n node.right = deleteRec(nextInorder, node.right, deleted);\n }\n } else if (comp < 0) {\n node.left = deleteRec(val, node.left, deleted);\n } else {\n node.right = deleteRec(val, node.right, deleted);\n }\n\n return node;\n }", "public void delete(Comparable<T> item)\r\n {\r\n root = delete(root,item);\r\n }", "private NodeTest delete(NodeTest root, int data)\n\t{\n\t\t//if the root is null then there's no tree\n\t\tif (root == null)\n\t\t{\n\t\t\tSystem.out.println(\"There was no tree.\");\n\t\t\treturn null;\n\t\t}\n\t\t//if the data is less go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = delete(root.left, data);\n\t\t}\n\t\t//otherwise go to the right\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = delete(root.right, data);\n\t\t}\n\t\t//else, we have a hit, so find out how we are going to delete it\n\t\telse\n\t\t{\n\t\t\t//if there are no children then return null\n\t\t\t//because we can delete the NodeTest without worries\n\t\t\tif (root.left == null && root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no children NodeTests\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t//if there is no right-child then return the left\n\t\t\t//\n\t\t\telse if (root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no right-children NodeTests\");\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t//if there is no left child return the right\n\t\t\telse if (root.left == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no left-children NodeTests\");\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if it is a parent NodeTest, we need to find the max of the lowest so we can fix the BST\n\t\t\t\troot.data = findMax(root.left);\n\t\t\t\troot.left = delete(root.left, root.data);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\t}", "static Node deleteBst(Node tmp,int v)\n { // if the tree is empty nothing to delete\n \n if(tmp==null)\n {\n System.out.println(\"Tree is empty\");\n return null;\n }\n // otherwise it will find out the node needs to be deleted\n \n if(tmp.val<v)\n tmp.right=deleteBst(tmp.right,v);\n else if(tmp.val>v)\n tmp.left=deleteBst(tmp.left,v);\n \n else {\n //deleting leaf node\n \n if(tmp.left==null && tmp.right==null)\n {tmp=null;\n return tmp;\n }\n // the target node has only one child\n \n else if(tmp.left!=null && tmp.right==null)\n return tmp.left;\n else if(tmp.left==null && tmp.right!=null)\n return tmp.right;\n \n else //the target node has two children replace the node value with it's predecessor //and then delete the predessor node\n {\n tmp.val=findpredecessor(tmp.left);\n tmp.left=deleteBst(tmp.left,tmp.val);\n }\n }\n return tmp;\n \n }", "Node deleteNode(Node root, int key) {\n if (root == null) {\n return root;\n }\n\n // If the key to be deleted is smaller than the root's key,\n // then it lies in left subtree\n if (key < root.key) {\n root.left = deleteNode(root.left, key);\n }\n\n // If the key to be deleted is greater than the root's key,\n // then it lies in right subtree\n else if (key > root.key) {\n root.right = deleteNode(root.right, key);\n }\n\n // if key is same as root's key, then this is the node\n // to be deleted\n else {\n\n // node with only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // No child case\n if (temp == null) {\n temp = root;\n root = null;\n } else // One child case\n {\n root = temp; // Copy the contents of the non-empty child\n }\n } else {\n\n // node with two children: Get the inorder successor (smallest\n // in the right subtree)\n Node temp = minValueNode(root.right);\n\n // Copy the inorder successor's data to this node\n root.key = temp.key;\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, temp.key);\n }\n }\n\n // If the tree had only one node then return\n if (root == null) {\n return root;\n }\n\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\n root.height = max(height(root.left), height(root.right)) + 1;\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\n // this node became unbalanced)\n int balance = getBalance(root);\n\n // If this node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && getBalance(root.left) >= 0) {\n return rightRotate(root);\n }\n\n // Left Right Case\n if (balance > 1 && getBalance(root.left) < 0) {\n root.left = leftRotate(root.left);\n return rightRotate(root);\n }\n\n // Right Right Case\n if (balance < -1 && getBalance(root.right) <= 0) {\n return leftRotate(root);\n }\n\n // Right Left Case\n if (balance < -1 && getBalance(root.right) > 0) {\n root.right = rightRotate(root.right);\n return leftRotate(root);\n }\n\n return root;\n }", "public AVLTree() {\r\n\r\n\r\n this.root = new AVLTreeNode(9);\r\n Delete(9);\r\n }", "public void delete(int index) {\n\t\tNode node = getNode(index+1);\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tnode.data = parentOfLast.right != null ? parentOfLast.right.data : parentOfLast.left.data;\n\t\tif (parentOfLast.right != null) {\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t}", "public boolean delete(Integer key){\n\n TreeNode parent=null;\n TreeNode curr=root;\n\n while (curr!=null && (Integer.compare(key,curr.data)!=0)){\n parent=curr;\n curr=Integer.compare(key,curr.data)>0?curr.right:curr.left;\n }\n\n if(curr==null){ // node does not exist\n\n return false;\n }\n\n TreeNode keyNode=curr;\n\n if(keyNode.right!=null){ //has right subtree\n\n // Find the minimum of Right Subtree\n\n TreeNode rKeyNode=keyNode.right;\n TreeNode rParent=keyNode;\n\n while (rKeyNode.left!=null){\n rParent=rKeyNode;\n rKeyNode=rKeyNode.left;\n }\n\n keyNode.data=rKeyNode.data;\n\n // Move Links to erase data\n\n if(rParent.left==rKeyNode){\n\n rParent.left=rKeyNode.right;\n }else{\n\n rParent.right=rKeyNode.right;\n }\n rKeyNode.right=null;\n\n }else{ // has only left subtree\n\n if(root==keyNode){ // if node to be deleted is root\n\n root=keyNode.left; // making new root\n keyNode.left=null; // unlinking initial root's left pointer\n }\n else{\n\n if(parent.left==keyNode){ // if nodes to be deleted is a left child of it's parent\n\n parent.left=keyNode.left;\n }else{ // // if nodes to be deleted is a right child of it's parent\n\n parent.right=keyNode.left;\n }\n\n }\n\n }\n return true;\n }", "private BSTNode<K> deleteNode(BSTNode<K> currentNode, K key) throws IllegalArgumentException{ \n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, return null\n if (currentNode == null) \n return currentNode; \n // otherwise, keep searching through the tree until meet the node with value key\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(deleteNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), key));\n break;\n case 0:\n // build a temporary node when finding the node that need to be deleted\n BSTNode<K> tempNode = null;\n // when the node doesn't have two childNodes\n // has one childNode: currentNode = tempNode = a childNode\n // has no childNode: currentNode = null, tempNode = currentNode\n if ((currentNode.getLeftChild() == null) || (currentNode.getRightChild() == null)) {\n if (currentNode.getLeftChild() == null) \n tempNode = currentNode.getRightChild(); \n else \n tempNode = currentNode.getLeftChild(); \n \n if (tempNode == null) {\n //tempNode = currentNode; \n currentNode = null; \n }\n else\n currentNode = tempNode;\n }\n // when the node has two childNodes, \n // use in-order way to find the minimum node in its subrighttree, called rightMinNode\n // set tempNode = rightMinNode, and currentNode's ID = tempNode.ID\n // do recursion to update the subrighttree with currentNode's rightChild and tempNode's Id\n else {\n BSTNode<K> rightMinNode = currentNode.getRightChild();\n while (rightMinNode.getLeftChild() != null)\n rightMinNode = rightMinNode.getLeftChild();\n \n tempNode = rightMinNode;\n currentNode.setId(tempNode.getId());\n \n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), tempNode.getId()));\n }\n }\n // since currentNode == null means currentNode has no childNode, return null to its ancestor\n if (currentNode == null) \n return currentNode; \n // since currentNode != null, we have to update its balance\n int balanceValue = getNodeBalance(currentNode);\n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n if (getNodeBalance(currentNode.getLeftChild()) < 0) { // Left Left Case \n return rotateRight(currentNode);\n }\n else if (getNodeBalance(currentNode.getLeftChild()) >= 0) { // Left Right Case \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n if ((getNodeBalance(currentNode.getRightChild()) > 0)) { // Right Right Case \n return rotateLeft(currentNode);\n }\n else if ((getNodeBalance(currentNode.getRightChild()) <= 0)) {// Right Left Case \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n }\n }\n return currentNode;\n }", "public static void deleteNode(int nodeData){\n }", "private Node<E> nodeDelete(Node<E> current, E toDelete) {\n\t\tif (current == null)\n\t\t\treturn null;\n\t\tif (toDelete == current.data)\n\t\t\treturn current;\n\t\tif (((Comparable<E>) toDelete).compareTo((E) current.data) >= 0)\n\t\t\treturn nodeDelete(current.rightChild, toDelete);\n\t\telse\n\t\t\treturn nodeDelete(current.leftChild, toDelete);\n\t}", "public static void testTreeDelete()\n {\n ArrayList<Tree<String>> treelist = new ArrayList<Tree<String>>();\n treelist.add(new BinaryTree<String>());\n treelist.add(new AVLTree<String>());\n treelist.add(new RBTree<String>());\n treelist.add(new SplayTree<String>());\n\n System.out.println(\"Start TreeDelete test\");\n for(Tree<String> t : treelist)\n {\n\n try\n {\n RobotRunner.loadDictionaryIntoTree(\"newDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"smallDutch.dic\", t);\n// RobotRunner.loadDictionaryIntoTree(\"Dutch.dic\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n// RobotRunner.loadDictionaryIntoTree(\"dict.txt\", t); //Won't work with BinaryTree and SplayTree, too many items == StackOverflow\n }\n catch(IOException e)\n {\n System.out.println(e);\n }\n System.out.println(\"\\nStart Testcase\");\n\n SystemAnalyser.start();\n t.delete(\"aanklotsten\");\n SystemAnalyser.stop();\n\n SystemAnalyser.printPerformance();\n\n System.out.println(\"Stop Testcase\\n\");\n }\n System.out.println(\"Values after test.\");\n SystemAnalyser.printSomeTestValues();\n }", "public Tree<K, V> delete(K key) {\n\t\tif (key.compareTo(this.key) == 0) {\n\t\t\ttry {\n\t\t\t\tthis.key = left.max();\n\t\t\t\tthis.value = left.lookup(left.max());\n\t\t\t\tleft = left.delete(this.key); \n\t\t\t} catch (EmptyTreeException e) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.key = right.min();\n\t\t\t\t\tthis.value = right.lookup(right.min());\n\t\t\t\t\tright = right.delete(this.key);\n\t\t\t\t} catch (EmptyTreeException f) {\n\t\t\t\t\treturn EmptyTree.getInstance();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (key.compareTo(this.key) < 0) {\n\t\t\tleft = left.delete(key);\n\t\t} else {\n\t\t\tright = right.delete(key);\n\t\t}\n\t\treturn this;\n\t}", "@Override /**\r\n\t\t\t\t * Delete an element from the binary tree. Return true if the element is deleted\r\n\t\t\t\t * successfully Return false if the element is not in the tree\r\n\t\t\t\t */\r\n\tpublic boolean delete(E e) {\n\t\tTreeNode<E> parent = null;\r\n\t\tTreeNode<E> current = root;\r\n\t\twhile (current != null) {\r\n\t\t\tif (e.compareTo(current.element) < 0) {\r\n\t\t\t\tparent = current;\r\n\t\t\t\tcurrent = current.left;\r\n\t\t\t} else if (e.compareTo(current.element) > 0) {\r\n\t\t\t\tparent = current;\r\n\t\t\t\tcurrent = current.right;\r\n\t\t\t} else\r\n\t\t\t\tbreak; // Element is in the tree pointed at by current\r\n\t\t}\r\n\r\n\t\tif (current == null)\r\n\t\t\treturn false; // Element is not in the tree\r\n\r\n\t\t// Case 1: current has no left child\r\n\t\tif (current.left == null) {\r\n\t\t\t// Connect the parent with the right child of the current node\r\n\t\t\tif (parent == null) {\r\n\t\t\t\troot = current.right;\r\n\t\t\t} else {\r\n\t\t\t\tif (e.compareTo(parent.element) < 0)\r\n\t\t\t\t\tparent.left = current.right;\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.right = current.right;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Case 2: The current node has a left child\r\n\t\t\t// Locate the rightmost node in the left subtree of\r\n\t\t\t// the current node and also its parent\r\n\t\t\tTreeNode<E> parentOfRightMost = current;\r\n\t\t\tTreeNode<E> rightMost = current.left;\r\n\r\n\t\t\twhile (rightMost.right != null) {\r\n\t\t\t\tparentOfRightMost = rightMost;\r\n\t\t\t\trightMost = rightMost.right; // Keep going to the right\r\n\t\t\t}\r\n\r\n\t\t\t// Replace the element in current by the element in rightMost\r\n\t\t\tcurrent.element = rightMost.element;\r\n\r\n\t\t\t// Eliminate rightmost node\r\n\t\t\tif (parentOfRightMost.right == rightMost)\r\n\t\t\t\tparentOfRightMost.right = rightMost.left;\r\n\t\t\telse\r\n\t\t\t\t// Special case: parentOfRightMost == current\r\n\t\t\t\tparentOfRightMost.left = rightMost.left;\r\n\t\t}\r\n\r\n\t\tsize--;\r\n\t\treturn true; // Element deleted successfully\r\n\t}", "private BinaryNode<E> _delete(BinaryNode<E> node, E e) {\n\t\tif (node == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (comparator.compare(e, node.getData()) < 0) // <, so go left\n\t\t\tnode.setLeftChild(_delete(node.getLeftChild(), e));// recursive call\n\t\telse if (comparator.compare(e, node.getData()) > 0) // >, so go right\n\t\t\tnode.setRightChild(_delete(node.getRightChild(), e));// recursive call\n\t\telse { // FOUND THE NODE\n\t\t\tfoundNode = true;\n\t\t\tnode = _deleteNode(node);\n\t\t}\n\t\treturn node;\n\t}", "public boolean deleteNode(Type val){\n MyBinNode aux = this.root;\n MyBinNode parent = this.root;\n boolean left = true;\n \n while(aux.value.compareTo(val) != 0){\n parent = aux;\n if(aux.value.compareTo(val) > 0){\n left = true;\n aux = aux.left;\n }else{\n left = false;\n aux = aux.right;\n }\n if(aux == null){\n return false;\n }\n }\n \n if(aux.left==null && aux.right==null){\n if(aux == this.root){\n this.root = null;\n }else if(left){\n parent.left = null;\n }else{\n parent.right = null;\n }\n }else if(aux.right == null){\n if(aux == this.root){\n this.root = aux.left;\n }else if(left){\n parent.left = aux.left;\n }else{\n parent.right = aux.left;\n }\n }else if(aux.left == null){\n if(aux == this.root){\n this.root = aux.right;\n }else if(left){\n parent.left = aux.right;\n }else{\n parent.right = aux.right;\n }\n }else{\n MyBinNode replace = getToReplace(aux);\n if(aux == this.root){\n this.root = replace;\n }else if(left){\n parent.left = replace;\n }else{\n parent.right = replace;\n }\n replace.left = aux.left;\n }\n return true;\n }", "public boolean delete(int m) {\r\n \r\n System.out.println(\"We are deleting \" + m);\r\n\tbtNode current = root;\r\n btNode parent = root;\r\n boolean LeftChild = true;\r\n\r\n while(current.getData() != m) \r\n {\r\n parent = current;\r\n if(m < current.getData()) \r\n {\r\n LeftChild = true;\r\n current = current.left;\r\n }\r\n else { \r\n LeftChild = false;\r\n current = current.right;\r\n }\r\n if(current == null) \r\n return false; \r\n } // end while\r\n // found node to delete\r\n\r\n // if no children, simply delete it\r\n if(current.left==null && current.right==null)\r\n {\r\n if(current == root) // if root,\r\n root = null; // tree is empty\r\n else if(LeftChild)\r\n parent.left = null; // disconnect\r\n else // from parent\r\n parent.right = null;\r\n }\r\n\r\n // if no right child, replace with left subtree\r\n else if(current.right==null)\r\n if(current == root)\r\n root = current.left;\r\n else if(LeftChild)\r\n parent.left = current.left;\r\n else\r\n parent.right = current.left;\r\n\r\n // if no left child, replace with right subtree\r\n else if(current.left==null)\r\n if(current == root)\r\n root = current.right;\r\n else if(LeftChild)\r\n parent.left = current.right;\r\n else\r\n parent.right = current.right;\r\n\r\n else // two children, so replace with inorder successor\r\n {\r\n // get successor of node to delete (current)\r\n btNode successor = getNext(current);\r\n\r\n // connect parent of current to successor instead\r\n if(current == root)\r\n root = successor;\r\n else if(LeftChild)\r\n parent.left = successor;\r\n else\r\n parent.right = successor;\r\n\r\n // connect successor to current's left child\r\n successor.left = current.left;\r\n } // end else two children\r\n // (successor cannot have a left child)\r\n return true; // success\r\n }", "public void deleteNode(int key){\n\t\t//System.out.println(\" in delete Node \");\n\t\tNode delNode = search(key);\n\t\tif(delNode != nil){\n\t\t\t//System.out.println(\" del \" + delNode.id);\n\t\t\tdelete(delNode);\n\t\t}else{\n\t\t\tSystem.out.println(\" Node not in RB Tree\");\n\t\t}\n\t}", "@objid (\"808c0839-1dec-11e2-8cad-001ec947c8cc\")\n @Override\n public void delete() {\n // List children from the end to avoid reordering of the other GMs\n for (int i = this.children.size() - 1; i >= 0; i--) {\n GmNodeModel child = this.children.get(i);\n child.delete();\n \n // When several elements have been deleted consecutively, fix the next index\n if (i > this.children.size()) {\n i = this.children.size();\n }\n }\n \n assert (this.children.isEmpty()) : \"All children should have been deleted:\" + this.children;\n \n super.delete();\n }", "private Node<T> delete(Node<T> node,Comparable<T> item) {\r\n if (node == null) { // this is the base case\r\n return null;\r\n }\r\n if (node.data.compareTo((T) item) < 0) {\r\n node.right = delete(node.right, item);\r\n return node;\r\n }\r\n else if (node.data.compareTo((T) item) > 0) {\r\n node.left = delete(node.left, item);\r\n return node;\r\n }\r\n else { // the item == node.data\r\n if (node.left == null) { // no left child\r\n return node.right;\r\n }\r\n else if (node.right == null) { // no right child\r\n return node.left;\r\n }\r\n else { // 2 children: find in-order successor\r\n if (node.right.left == null) { // if right child does not have a left child of its own\r\n node.data = node.right.data;\r\n node.right = node.right.right;\r\n }\r\n else {\r\n node.data = (Comparable<T>) removeSmallest(node.right); // if the right child has two children, or has a left subtree\r\n }\r\n return node;\r\n }\r\n }\r\n }", "private Node caseOneChild(Node deleteThis) {\r\n\r\n Node child, parent;\r\n if (deleteThis.getLeft() != null) {\r\n child = deleteThis.getLeft();\r\n } else {\r\n child = deleteThis.getRight();\r\n }\r\n parent = deleteThis.getParent();\r\n child.setParent(parent);\r\n\r\n\r\n if (parent == null) {\r\n this.root = child; // Poistettava on juuri\r\n return deleteThis;\r\n }\r\n if (deleteThis == parent.getLeft()) {\r\n parent.setLeft(child);\r\n } else {\r\n parent.setRight(child);\r\n }\r\n return deleteThis;\r\n }", "public int deleteByParentid(Integer value) throws SQLException \n {\n Connection c = null;\n PreparedStatement ps = null;\n try \n {\n c = getConnection();\n ps = c.prepareStatement(\"DELETE FROM institution WHERE parentid=?\");\n Manager.setInteger(ps, 1, value);\n return ps.executeUpdate();\n }\n finally\n {\n getManager().close(ps);\n freeConnection(c);\n }\n }", "private void deleteNode(Node<K> p) {\n // If strictly internal, copy successor's element to p and then make p\n // point to successor.\n if (p.left != null && p.right != null) {\n Node<K> s = successor(p); // 节点有 2 个子节点时,找到实际删除的后继节点\n p.key = s.key; // 将后继节点的值复制到原来节点上,原来的节点只是值被删除,节点本身不删除\n p = s; // 将实际要删除的节点位置指向后继节点位置\n } // p has 2 children //\n // //////////////////////////////////////////////////////////////////\n // Start fixup at replacement node, if it exists. //\n Node<K> replacement = (p.left != null ? p.left : p.right); // 实际删除的节点最多只有一个子节点,并且一定是红色子节点\n if (replacement != null) { // 如果有一个红色子节点\n // Link replacement to parent //\n replacement.parent = p.parent; // 将此节点上移\n if (p.parent == null) //\n root = replacement; //\n else if (p == p.parent.left) // 实际被删除的节点 p 为左子\n p.parent.left = replacement; //\n else // 实际被删除的节点 p 为右子\n p.parent.right = replacement; //\n // //\n // Null out links so they are OK to use by fixAfterDeletion. //\n p.left = p.right = p.parent = null; //\n // //\n // Fix replacement //////////////////////////////////////////////////////////////////\n if (p.color == BLACK) // 删除情形 5. 因为 replacement 是红节点,所以这里 p 的颜色一定是黑色的\n fixAfterDeletion(replacement); // 修复只要将此红节点上移并置黑就完成了\n } else if (p.parent == null) { // return if we are the only node. //////////////////////////////////////////////////////////////////\n root = null; // 根节点被删除\n } else { // No children. Use self as phantom replacement and unlink. // 被删除的节点没有子节点时\n if (p.color == BLACK) // 如果是红色的节点,直接删除就完成\n fixAfterDeletion(p); // 如果被删除的是黑色节点,则会破坏红黑树性质 5,需要修复红黑树\n\n if (p.parent != null) {\n if (p == p.parent.left)\n p.parent.left = null;\n else if (p == p.parent.right)\n p.parent.right = null;\n p.parent = null;\n }\n }\n }", "public void Delete(int data)\r\n\t{\r\n\t\troot=DeleteData(root,data);\r\n\t}", "private TreeNode remove(TreeNode node, Object value)\r\n {\r\n int diff = ((Comparable<Object>)value).compareTo(node.getValue());\r\n if (diff == 0) // base case\r\n node = removeRoot(node);\r\n else if (diff < 0)\r\n node.setLeft(remove(node.getLeft(), value));\r\n else // if (diff > 0)\r\n node.setRight(remove(node.getRight(), value));\r\n return node;\r\n }", "private Node caseNoChildren(Node deleteThis) {\r\n\r\n Node parent = deleteThis.getParent();\r\n\r\n if (parent == null) {\r\n this.root = null; // Kyseessä on juuri\r\n return deleteThis;\r\n }\r\n if (deleteThis == parent.getLeft()) {\r\n parent.setLeft(null);\r\n } else {\r\n parent.setRight(null);\r\n }\r\n return deleteThis;\r\n }", "public Node<E> delete(E payload) {\n Node<E> parent = searchParent(payload);\n Node<E> current = search(payload);\n if (current != null)\n return delete(current, parent);\n else\n return null;\n }", "public static TreapNode deleteNode(TreapNode root, int key)\n {\n // base case: the key is not found in the tree\n if (root == null) {\n return null;\n }\n\n // if the key is less than the root node, recur for the left subtree\n if (key < root.data) {\n root.left = deleteNode(root.left, key);\n }\n\n // if the key is more than the root node, recur for the right subtree\n else if (key > root.data) {\n root.right = deleteNode(root.right, key);\n }\n\n // if the key is found\n else {\n // Case 1: node to be deleted has no children (it is a leaf node)\n if (root.left == null && root.right == null)\n {\n // deallocate the memory and update root to null\n root = null;\n }\n\n // Case 2: node to be deleted has two children\n else if (root.left != null && root.right != null)\n {\n // if the left child has less priority than the right child\n if (root.left.priority < root.right.priority)\n {\n // call `rotateLeft()` on the root\n root = rotateLeft(root);\n\n // recursively delete the left child\n root.left = deleteNode(root.left, key);\n }\n else {\n // call `rotateRight()` on the root\n root = rotateRight(root);\n\n // recursively delete the right child\n root.right = deleteNode(root.right, key);\n }\n }\n\n // Case 3: node to be deleted has only one child\n else {\n // choose a child node\n TreapNode child = (root.left != null)? root.left: root.right;\n root = child;\n }\n }\n\n return root;\n }", "public int deleteRoot(AVLNode node) { // root is unary node or leaf\n\t\tif (node.isLeaf()) {\n\t\t\tthis.root = null;\n\t\t} else { // root is unary\n\t\t\tif (node.getRight().getHeight() != -1) { // root has a right child\n\t\t\t\tthis.root = node.getRight();\n\t\t\t\tnode.getRight().setParent(null);\n\t\t\t\tnode.setRight(null);\n\t\t\t} else { // root has a left child\n\t\t\t\tthis.root = node.getLeft();\n\t\t\t\tnode.getLeft().setParent(null);\n\t\t\t\tnode.setLeft(null);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "private boolean recursiveDelete(int number, Node position, Node parent) {\r\n\t\t//check middle child, or at value\r\n\t\tif (number == position.getValue()) {\r\n\t\t\tif (position.getMiddleChild() != null) {\r\n\t\t\t\treturn recursiveDelete(number, position.getMiddleChild(), position);\r\n\t\t\t}\r\n\t\t\t// we are at value, so delete -- note no middle children for current position at this point\r\n\t\t\telse {\r\n\t\t\t\tNode replacement = null;\r\n\t\t\t\tRandom rnd = new Random();\r\n\t\t\t\t//this boolean variable determine whether we choose inorder predecessor or inorder successor\r\n\t\t\t\tboolean successor = rnd.nextBoolean();\r\n\t\t\t\t\r\n\t\t\t\t// if there in only a left node, delete current item, replace with left node\r\n\t\t\t\tif (position.getRightChild() == null) {\r\n\t\t\t\t\treplacement = position.getLeftChild();\r\n\t\t\t\t}\r\n\t\t\t\t//if there is only a right node, delete current item, replace with right node\r\n\t\t\t\telse if (position.getLeftChild() == null) {\r\n\t\t\t\t\treplacement = position.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder successor\r\n\t\t\t\t//if right child has no left child, delete current item, replace with right node, change left pointer\r\n\t\t\t\telse if (position.getRightChild().getLeftChild() == null && successor) {\r\n\t\t\t\t\tposition.getRightChild().setLeftChild(position.getLeftChild());\r\n\t\t\t\t\treplacement = position.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder successor\r\n\t\t\t\t//right child has a left child, replace current item with inorder successor, delete inorder successor\r\n\t\t\t\telse if (position.getRightChild().getLeftChild() != null && successor) {\r\n\t\t\t\t\tNode successorParent = position;\r\n\t\t\t\t\tNode successorPosition = position.getRightChild();\r\n\t\t\t\t\twhile (successorPosition.getLeftChild() != null) {\r\n\t\t\t\t\t\tsuccessorParent = successorPosition;\r\n\t\t\t\t\t\tsuccessorPosition = successorPosition.getLeftChild();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//replace current position with InorderSuccessor\r\n\t\t\t\t\tNode successorRightNode = successorPosition.getRightChild();\r\n\t\t\t\t\treplacement = successorPosition;\r\n\t\t\t\t\treplacement.setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement.setLeftChild(position.getLeftChild());\r\n\t\t\t\t\t//delete InorderSuccessor\r\n\t\t\t\t\treadjustTree(successorParent, successorPosition, successorRightNode);\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder predecessor\r\n\t\t\t\t//if left child has no right child, delete current item, replace with left child, change right pointer\r\n\t\t\t\telse if (position.getLeftChild().getRightChild() == null && !successor) {\r\n\t\t\t\t\tposition.getLeftChild().setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement = position.getLeftChild();\r\n\t\t\t\t}\r\n\t\t\t\t//replace with inorder predecessor\r\n\t\t\t\t//left child has a right child, replace current item with inorder predecessor, delete inorder predecessor\r\n\t\t\t\telse if (position.getLeftChild().getRightChild() != null && !successor) {\r\n\t\t\t\t\tNode predecessorParent = position;\r\n\t\t\t\t\tNode predecessorPosition = position.getLeftChild();\r\n\t\t\t\t\twhile (predecessorPosition.getRightChild() != null) {\r\n\t\t\t\t\t\tpredecessorParent = predecessorPosition;\r\n\t\t\t\t\t\tpredecessorPosition = predecessorPosition.getRightChild();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//replace current position with InorderPredecessor\r\n\t\t\t\t\tNode predecessorLeftNode = predecessorPosition.getLeftChild();\r\n\t\t\t\t\treplacement = predecessorPosition;\r\n\t\t\t\t\treplacement.setRightChild(position.getRightChild());\r\n\t\t\t\t\treplacement.setLeftChild(position.getLeftChild());\r\n\t\t\t\t\t//delete InorderPredecessor\r\n\t\t\t\t\treadjustTree(predecessorParent, predecessorPosition, predecessorLeftNode);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.err.println(\"ERROR - should never get here, right and left children nodes exhausted in delete\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t// replace current position with replacement node\r\n\t\t\t\tif (parent == null) {\r\n\t\t\t\t\troot = replacement;\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn readjustTree(parent, position, replacement);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check left child\r\n\t\telse if (number < position.getValue()) {\r\n\t\t\tif (position.getLeftChild() == null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn recursiveDelete(number, position.getLeftChild(), position);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check right child\r\n\t\telse if (number > position.getValue()) {\r\n\t\t\tif (position.getRightChild() == null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn recursiveDelete(number, position.getRightChild(), position);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.err.println(\"Error: should never get here, number !comparable to position.getValue in delete\");\r\n\t\t\treturn false;\r\n\t\t} \r\n\t}", "static Node deleteNode(Node root, int k) {\n\n // Base case\n if (root == null)\n return root;\n\n // Recursive calls for ancestors of\n // node to be deleted\n if (root.key > k) {\n root.left = deleteNode(root.left, k);\n return root;\n } else if (root.key < k) {\n root.right = deleteNode(root.right, k);\n return root;\n }\n\n // We reach here when root is the node\n // to be deleted.\n\n // If one of the children is empty\n if (root.left == null) {\n Node temp = root.right;\n return temp;\n } else if (root.right == null) {\n Node temp = root.left;\n return temp;\n }\n\n // If both children exist\n else {\n Node succParent = root;\n\n // Find successor\n Node succ = root.right;\n\n while (succ.left != null) {\n succParent = succ;\n succ = succ.left;\n }\n\n // Delete successor. Since successor\n // is always left child of its parent\n // we can safely make successor's right\n // right child as left of its parent.\n // If there is no succ, then assign\n // succ->right to succParent->right\n if (succParent != root)\n succParent.left = succ.right;\n else\n succParent.right = succ.right;\n\n // Copy Successor Data to root\n root.key = succ.key;\n\n return root;\n }\n }", "private Node<E> delete(E item, Node<E> root){\n\t\t/** the item to delete does not exist */\n\t\tif(root == null){\n\t\t\tdeleteReturn = null;\n\t\t\treturn root;\n\t\t}\n\t\t\n\t\tint comparison = item.compareTo(root.item);\n\t\t\n\t\t/** delete from the left subtree */\n\t\tif(comparison < 0){\n\t\t\troot.left = delete(item, root.left);\n\t\t\treturn root;\n\t\t}\n\t\t/** delete from the right subtree */\n\t\telse if(comparison > 0){\n\t\t\troot.right = delete(item, root.right);\n\t\t\treturn root;\n\t\t}\n\t\t/** the node to delete is found */\n\t\telse{\n\t\t\tdeleteReturn = root.item;\n\t\t\t\n\t\t\t/** the node is a leaf */\n\t\t\tif(root.left == null && root.right == null){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t/** the node has one left child */\n\t\t\telse if(root.left != null && root.right == null){\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t/** the node has one right child */\n\t\t\telse if(root.left == null && root.right != null){\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\t/** the node has two children */\n\t\t\telse{\n\t\t\t\t/**\n\t\t\t\t* the left child becomes the local root\n\t\t\t\t*/\n\t\t\t\tif(root.left.right == null){\n\t\t\t\t\troot.item = root.left.item;\n\t\t\t\t\troot.left = root.left.left;\n\t\t\t\t\treturn root;\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t* find the left-rightmost node and replace the local root's\n\t\t\t\t* item with that of left-rightmost node.\n\t\t\t\t*/\n\t\t\t\telse{\n\t\t\t\t\troot.item = findRightmost(root.left);\n\t\t\t\t\treturn root;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void delete(String key) {\n key = key.toLowerCase();\n BTreeNode leftChild = root.getChild(0);\n BTreeNode rightChild = root.getChild(1);\n\n if (!root.isLeaf() && root.getN() == 1 && leftChild.getN() < T_VAR && rightChild.getN() < T_VAR) {\n root = mergeSingleKeyRoot();\n }\n if (root.keyExist(key)) {\n if (root.isLeaf()) {\n root.deleteKey(key);\n }\n else {\n root.handleCase2(key);\n }\n }\n else {\n root.handleCase4(key);\n }\n }", "private void deleteNode(TSTNode<E> nodeToDelete) {\n if(nodeToDelete == null) return;\n nodeToDelete.data = null;\n \n while(nodeToDelete != null) {\n nodeToDelete = deleteNodeRecursion(nodeToDelete);\n }\n }", "public static TreapNode deleteNode(TreapNode root, int key)\n {\n if (root == null)\n return root;\n\n if (key < root.key)\n root.left = deleteNode(root.left, key);\n else if (key > root.key)\n root.right = deleteNode(root.right, key);\n\n // IF KEY IS AT ROOT\n\n // If left is null\n else if (root.left == null)\n {\n TreapNode temp = root.right;\n root = temp; // Make right child as root\n }\n\n // If Right is null\n else if (root.right == null)\n {\n TreapNode temp = root.left;\n root = temp; // Make left child as root\n }\n\n // If key is at root and both left and right are not null\n else if (root.left.priority < root.right.priority)\n {\n root = leftRotate(root);\n root.left = deleteNode(root.left, key);\n }\n else\n {\n root = rightRotate(root);\n root.right = deleteNode(root.right, key);\n }\n\n return root;\n }", "private A deleteLargest(int subtree) {\n return null; \n }", "public boolean delete(String name)\r\n\t{\r\n\t\t// Find the location of the Node with the search method and assign it to current\r\n\t\tNode current = search(name);\r\n\t\t\r\n\t\t// Return False if the Node was not found\r\n\t\tif(current == null)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Special case of deleting the root Node\r\n\t\tif(current == getRoot())\r\n\t\t{\r\n\t\t\t// Root has no children (aka is a leaf)\r\n\t\t\tif(getRoot().isLeaf())\r\n\t\t\t{\r\n\t\t\t\t// Deleting the Root (aka destroying the Binary Tree)\r\n\t\t\t\tdestroy();\r\n\t\t\t}\r\n\t\t\t// Root only has a left child\r\n\t\t\telse if(getRoot().getRightChild() == null)\r\n\t\t\t{\r\n\t\t\t\t// Make the left child of the deleted Root the new Root\r\n\t\t\t\tsetRoot(current.getLeftChild());\r\n\t\t\t\tcurrent.getLeftChild().setParent(null);\r\n\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Root only has a right child\r\n\t\t\telse if(getRoot().getLeftChild() == null)\r\n\t\t\t{\r\n\t\t\t\t// Make the right child of the deleted Root the new Root\r\n\t\t\t\tsetRoot(current.getRightChild());\r\n\t\t\t\tcurrent.getRightChild().setParent(null);\r\n\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Root has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Find the minimum of the Right Subtree of the Node to delete to use as the replacement\r\n\t\t\t\tNode minimum = findMinimum(current.getRightChild());\r\n\t\t\t\t\r\n\t\t\t\t// Copy the String from the minimum Node to the original Node we were supposed to delete\r\n\t\t\t\tcurrent.setName(minimum.getName());\r\n\t\t\t\t\r\n\t\t\t\t// Delete what used to be the minimum from the Tree\r\n\t\t\t\t// The minimum is the right child of its parent\r\n\t\t\t\tif(minimum.getParent().getRightChild() == minimum)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Minimum by definition cannot have a left child, however:\r\n\t\t\t\t\t// The minimum has no children\r\n\t\t\t\t\tif(minimum.getRightChild() == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Just delete the minimum\r\n\t\t\t\t\t\tminimum.getParent().setRightChild(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// The minimum has a right child\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Delete the minimum but connect its child and its parent\r\n\t\t\t\t\t\tminimum.getParent().setRightChild(minimum.getRightChild());\r\n\t\t\t\t\t\tminimum.getRightChild().setParent(minimum.getParent());\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t\t}\r\n\t\t\t\t// The minimum is the left child of its parent\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Minimum by definition cannot have a left child, however:\r\n\t\t\t\t\t// The minimum has no children\r\n\t\t\t\t\tif(minimum.getRightChild() == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Just delete the minimum\r\n\t\t\t\t\t\tminimum.getParent().setLeftChild(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// The minimum has a right child\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Delete the minimum but connect its child and its parent\r\n\t\t\t\t\t\tminimum.getParent().setLeftChild(minimum.getRightChild());\r\n\t\t\t\t\t\tminimum.getRightChild().setParent(minimum.getParent());\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}// END special root case\r\n\t\t// Deleting any other Node besides the root\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Node to delete has no children (aka is a leaf)\r\n\t\t\tif(current.isLeaf())\r\n\t\t\t{\r\n\t\t\t\t// Delete the Node by finding out what type of child it is\r\n\t\t\t\t// Node is a left child\r\n\t\t\t\tif(current.getParent().getLeftChild() == current)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getParent().setLeftChild(null);\r\n\t\t\t\t}\r\n\t\t\t\t// Node is a right child\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getParent().setRightChild(null);\r\n\t\t\t\t}\r\n\t\t\t\t// Node was deleted so adjust the counter accordingly\t\r\n\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Node to delete only has a left child\r\n\t\t\telse if(current.getRightChild() == null)\r\n\t\t\t{\r\n\t\t\t\t// Connect the Node to delete's parent and left child\r\n\t\t\t\t// Need to first find out what type of child the Node to delete is\r\n\t\t\t\t// Node is a left child\r\n\t\t\t\tif(current.getParent().getLeftChild() == current)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getLeftChild().setParent(current.getParent());\r\n\t\t\t\t\tcurrent.getParent().setLeftChild(current.getLeftChild());\r\n\t\t\t\t}\r\n\t\t\t\t// Node is a right child\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getLeftChild().setParent(current.getParent());\r\n\t\t\t\t\tcurrent.getParent().setRightChild(current.getLeftChild());\r\n\t\t\t\t}\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Node to delete only has a right child\r\n\t\t\telse if(current.getLeftChild() == null)\r\n\t\t\t{\r\n\t\t\t\t// Connect the Node to delete's parent and right child\r\n\t\t\t\t// Need to first find out what type of child the Node to delete is\r\n\t\t\t\t// Node is a left child\r\n\t\t\t\tif(current.getParent().getLeftChild() == current)\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getRightChild().setParent(current.getParent());\r\n\t\t\t\t\tcurrent.getParent().setLeftChild(current.getRightChild());\r\n\t\t\t\t}\r\n\t\t\t\t// Node is a right child\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcurrent.getRightChild().setParent(current.getParent());\r\n\t\t\t\t\tcurrent.getParent().setRightChild(current.getRightChild());\r\n\t\t\t\t}\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t}\r\n\t\t\t// Node to delete has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Find the minimum of the Right Subtree of the Node to delete to use as the replacement\r\n\t\t\t\tNode minimum = findMinimum(current.getRightChild());\r\n\t\t\t\t\r\n\t\t\t\t// Copy the String from the minimum Node to the Node we were supposed to delete\r\n\t\t\t\tcurrent.setName(minimum.getName());\r\n\t\t\t\t\r\n\t\t\t\t// Delete what used to be the minimum from the Tree\r\n\t\t\t\t// The minimum is the right child of its parent\r\n\t\t\t\tif(minimum.getParent().getRightChild() == minimum)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Minimum by definition cannot have a left child, however:\r\n\t\t\t\t\t// The minimum has no children\r\n\t\t\t\t\tif(minimum.getRightChild() == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Just delete the minimum\r\n\t\t\t\t\t\tminimum.getParent().setRightChild(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// The minimum has a right child\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Delete the minimum but connect its child and its parent\r\n\t\t\t\t\t\tminimum.getParent().setRightChild(minimum.getRightChild());\r\n\t\t\t\t\t\tminimum.getRightChild().setParent(minimum.getParent());\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t\t}\r\n\t\t\t\t// The minimum is the left child of its parent\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// Minimum by definition cannot have a left child, however:\r\n\t\t\t\t\t// The minimum has no children\r\n\t\t\t\t\tif(minimum.getRightChild() == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Just delete the minimum\r\n\t\t\t\t\t\tminimum.getParent().setLeftChild(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// The minimum has a right child\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Delete the minimum but connect its child and its parent\r\n\t\t\t\t\t\tminimum.getParent().setLeftChild(minimum.getRightChild());\r\n\t\t\t\t\t\tminimum.getRightChild().setParent(minimum.getParent());\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Node was deleted so adjust the counter accordingly\r\n\t\t\t\t\tdecrementCounter();\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}// END of deleting any case except for Root\r\n\t\t\r\n\t\t// Balance the tree only if necessary - the current depth of the tree is greater than what it should be based on \r\n\t\t// the total amount of Nodes in the tree\r\n\t\tif(depth() > howManyLevels())\r\n\t\t{\r\n\t\t\tbalance();\r\n\t\t}\r\n\t\t// A Node was deleted so return true\r\n\t\treturn true;\r\n\t}", "private boolean _deleteLeaf(Node node, T value) {\n if (node == null)\n // not found\n return false;\n /** if the value is found */\n if (value.compareTo(node.element) == 0) {\n // is it a leaf? if yes, delete it\n if(node.left == null && node.right == null){\n node = null;\n return true;\n }\n else{\n // not a leaf\n return false;\n }\n }\n /** Otherwise, continue the search recursively */\n return value.compareTo(node.element) < 0 ? _deleteLeaf(node.left, value) : _deleteLeaf(node.right, value);\n }", "private void deleteHierarchyData(TreePath[] selRows) {\r\n SponsorHierarchyBean delBean;\r\n CoeusVector delData = new CoeusVector();\r\n TreePath treePath=selRows[selRows.length-1];\r\n DefaultMutableTreeNode selNode = (DefaultMutableTreeNode)treePath.getLastPathComponent();\r\n int selRow=sponsorHierarchyTree.getRowForPath(treePath);\r\n String optionPaneMsg=EMPTY_STRING;\r\n if(selNode.isRoot()) return;\r\n if(!selNode.getAllowsChildren()) {\r\n if(selRows.length > 1) {\r\n optionPaneMsg = coeusMessageResources.parseMessageKey(\"maintainSponsorHierarchy_exceptionCode.1252\");\r\n }else {\r\n optionPaneMsg = \"Do you want to remove the sponsor \"+selNode.toString()+\" from the hierarchy?\";\r\n }\r\n int optionSelected = CoeusOptionPane.showQuestionDialog(optionPaneMsg,CoeusOptionPane.OPTION_YES_NO,CoeusOptionPane.DEFAULT_NO);\r\n if(optionSelected == CoeusOptionPane.SELECTION_YES) {\r\n for (int index=selRows.length-1; index>=0; index--) {\r\n treePath = selRows[index];\r\n selRow = sponsorHierarchyTree.getRowForPath(treePath);\r\n selNode = (DefaultMutableTreeNode)treePath.getLastPathComponent();\r\n int endIndex = selNode.toString().indexOf(\":\");\r\n Equals getRowData = new Equals(\"sponsorCode\",selNode.toString().substring(0,endIndex == -1 ? selNode.toString().length():endIndex));\r\n CoeusVector cvFilteredData = getDeleteData(cvHierarchyData.filter(getRowData));\r\n delBean = (SponsorHierarchyBean)cvFilteredData.get(0);\r\n delBean.setAcType(TypeConstants.DELETE_RECORD);\r\n flushBean(delBean);//Added for bug fix Start #1830\r\n model.removeNodeFromParent(selNode);\r\n delData.addAll(cvFilteredData);\r\n saveRequired = true;\r\n }\r\n }\r\n } else {\r\n \r\n// int optionSelected = CoeusOptionPane.showQuestionDialog(\"Do you want to remove the Group \"+selNode.toString()+\" all its children from the hierarchy.\",CoeusOptionPane.OPTION_YES_NO,CoeusOptionPane.DEFAULT_YES);\r\n int optionSelected = -1;\r\n try{\r\n if(selNode != null && selNode.getLevel() == 1 && isPrintingHierarchy && isFormsExistInGroup(selNode.toString())){\r\n optionSelected = CoeusOptionPane.showQuestionDialog(\"Do you want to remove the group \"+selNode.toString()+\" , all its children and associated sponsor forms from the hierarchy?\",CoeusOptionPane.OPTION_YES_NO,CoeusOptionPane.DEFAULT_NO);\r\n }else{\r\n optionSelected = CoeusOptionPane.showQuestionDialog(\"Do you want to remove the Group \"+selNode.toString()+\" , all its children from the hierarchy.\",CoeusOptionPane.OPTION_YES_NO,CoeusOptionPane.DEFAULT_NO);\r\n }\r\n }catch(CoeusUIException coeusUIException){\r\n CoeusOptionPane.showDialog(coeusUIException);\r\n return ;\r\n }\r\n if(optionSelected == CoeusOptionPane.SELECTION_YES) {\r\n //Case#2445 - proposal development print forms linked to indiv sponsor, should link to sponsor hierarchy - Start\r\n if(isPrintingHierarchy && selectedNode.getLevel() == 1){\r\n TreeNode root = (TreeNode)sponsorHierarchyTree.getModel().getRoot();\r\n TreePath result = findEmptyGroup(sponsorHierarchyTree, new TreePath(root));\r\n if( result == null){\r\n try{\r\n deleteForms(selNode.toString());\r\n }catch(CoeusUIException coeusUIException){\r\n CoeusOptionPane.showDialog(coeusUIException);\r\n return ;\r\n }\r\n }\r\n }\r\n Equals getRowData = new Equals(fieldName[selNode.getLevel()],selNode.toString());\r\n CoeusVector cvFilteredData = getDeleteData(cvHierarchyData.filter(getRowData));//Modified for bug fix Start #1830\r\n model.removeNodeFromParent(selNode);\r\n for (int i=0; i<cvFilteredData.size(); i++) {\r\n delBean = (SponsorHierarchyBean)cvFilteredData.get(i);\r\n delBean.setAcType(TypeConstants.DELETE_RECORD);\r\n flushBean(delBean);//Added for bug fix Start #1830\r\n saveRequired = true;\r\n }\r\n delData.addAll(cvFilteredData);\r\n }\r\n }\r\n if(selRow < sponsorHierarchyTree.getRowCount() && \r\n ((DefaultMutableTreeNode)sponsorHierarchyTree.getPathForRow(selRow).getLastPathComponent()).getAllowsChildren() && !selNode.getAllowsChildren())\r\n sponsorHierarchyTree.setSelectionPath(treePath.getParentPath());\r\n else\r\n if(selRow >= sponsorHierarchyTree.getRowCount())\r\n selRow = 0;\r\n sponsorHierarchyTree.setSelectionRow(selRow);\r\n \r\n groupsController.refreshTableData(delData);\r\n }", "@Override\n public boolean delete(E e) {\n TreeNode<E> curr = root;\n while(curr!= null){\n if(e.compareTo(curr.element)<0){\n curr = curr.left;\n }else if (e.compareTo(curr.element)>0){\n curr = curr.right;\n }else{\n break; // we found the element to delete\n }\n }\n \n if(curr == null){\n return false; // we did not found the element\n }else{\n \n if(curr.left == null){\n transplant(curr, curr.right);\n }else if(curr.right == null){\n transplant(curr, curr.left);\n }else{\n TreeNode<E> min = minimum(curr);\n if(min.parent != curr){\n transplant(min, min.right);\n min.right = curr.right;\n min.right.parent = min;\n }\n transplant(curr, min);\n min.left = curr.left;\n min.left.parent = min;\n }\n return true;\n }\n }", "public static Node delete (BST bst, String name){\n\t\tNode bstRoot = bst.getRoot();\n\t\tNode deletedNode = findByName(bstRoot, name); // The node to be removed from the bst.\n\t\tNode substituteNode = floorOrCeiling(deletedNode); // The substitute node for the removed one.\n\t\t\n\t\t\n\t\tSystem.out.println(\"\\nThe node to be deleted:\");\n\t\tSystem.out.println(deletedNode);\n\n\t\tSystem.out.println(\"\\nThe substitute for the deleted node:\");\n\t\tSystem.out.println(substituteNode);\n\t\t\n\t\t/* If the node to be removed is an external node, which has no children nodes,\n\t\t then there is no need for the substitute node. Thus, we can simply set the nodes\n\t\t that point to the external nodes to null to remove the node.\n\t\t*/\n\t\tif ((deletedNode.getRight()==null)&&(deletedNode.getLeft()==null)){\n\t\t\tif(deletedNode.getName().compareTo(deletedNode.getParent().getName())<0)\n\t\t\t\tdeletedNode.getParent().setLeft(null);\t\t\t\n\t\t\telse\n\t\t\t\tdeletedNode.getParent().setRight(null);\n\t\t\t\n\t\t\tdeletedNode.setLeft(null);\n\t\t\tdeletedNode.setRight(null);\n\t\t\tdeletedNode.setParent(null);\n\t\t\t\n\t\t\treturn bstRoot;\n\t\t}\n\t\t\n\t\t/* If the node to be removed is not a root node, we'll apply the general approach.\n\t\t*/\n\t\tif (deletedNode.getParent()!=null){\n\n\t\t\t/* If the name of the parent node of the substitute node precedes the one of the substitute,\n\t\t\t * then, set the right child of the parent node to a null unless the substitute node is a child\n\t\t\t * of the deleted node.\n\t\t\t */\n\t\t\tif(substituteNode.getParent().getName().compareTo(substituteNode.getName())<0)\t\t\t\n\t\t\t\tif(substituteNode == deletedNode.getRight())\n\t\t\t\t\tsubstituteNode.getParent().setRight(substituteNode.getRight());\n\t\t\t\telse\t\n\t\t\t\tsubstituteNode.getParent().setRight(null);\n\t\t\t\n\t\t\t/* If the name of the parent node of the substitute node succeeds the one of the substitute,\n\t\t\t * then, set the left child of the parent node to a null unless the substitute node is a child\n\t\t\t * of the deleted node.\n\t\t\t */\n\t\t\telse\n\t\t\t\tif(substituteNode == deletedNode.getLeft())\n\t\t\t\t\tsubstituteNode.getParent().setLeft(substituteNode.getLeft());\n\t\t\t\telse\n\t\t\t\t\tsubstituteNode.getParent().setLeft(null);\n\t\t\t\n\t\t\t\n\t\t\t/* If the name of the parent node of the deleted node succeed the one of the substitute,\n\t\t\t * then, set substitute node as the left child of the parent node of the deleted node.\n\t\t\t * Otherwise, set the substitute to the right child.\n\t\t\t */\n\t\t\tif(deletedNode.getParent().getName().compareTo(substituteNode.getName())>0)\n\t\t\t\tdeletedNode.getParent().setLeft(substituteNode);\n\t\t\t\t\n\t\t\telse\n\t\t\t\tdeletedNode.getParent().setRight(substituteNode);\t\t\t\n\t\t\t\n\n\t\t\t/* Duplicates the binding that the deleted node previously had.\n\t\t\t */\n\t\t\tsubstituteNode.setLeft(deletedNode.getLeft());\n\t\t\tsubstituteNode.setRight(deletedNode.getRight());\n\t\t\tsubstituteNode.setParent(deletedNode.getParent());\n\t\t\t\n\t\t\t\n\t\t\t/* If the deleted node has any child, then set the substitute node as their parent node.\n\t\t\t */\n\t\t\tif (deletedNode.getRight()!=null)\n\t\t\t\tdeletedNode.getRight().setParent(substituteNode);\n\t\t\t\n\t\t\tif (deletedNode.getLeft()!=null)\n\t\t\tdeletedNode.getLeft().setParent(substituteNode);\n\t\t\t\n\t\t\tdeletedNode.setLeft(null);\n\t\t\tdeletedNode.setRight(null);\n\t\t\tdeletedNode.setParent(null);\n\t\t}\t\n\t\t/* If the node to be removed is a root node, we'll approach a bit differently.\n\t\t*/\t\t\t\n\t\telse{\n\t\t\t/* Sets the child node of the parent of the substitute one to null.\n\t\t\t*/\t\t\t\n\t\t\tif(substituteNode.getParent().getName().compareTo(substituteNode.getName())<0)\n\t\t\t\tsubstituteNode.getParent().setRight(null);\n\t\t\telse\n\t\t\t\tsubstituteNode.getParent().setLeft(null);\n\t\t\t\n\t\t\t/* Duplicates the binding that the deleted node previously had without setting the parent node.\n\t\t\t */\n\t\t\tsubstituteNode.setLeft(deletedNode.getLeft());\n\t\t\tsubstituteNode.setRight(deletedNode.getRight());\n\t\t\t\n\t\t\t\n\t\t\t/* If the deleted node has any child, then set the substitute node as their parent node.\n\t\t\t*/\t\t\t\n\t\t\tif (deletedNode.getRight()!=null)\n\t\t\t\tdeletedNode.getRight().setParent(substituteNode);\n\t\t\t\n\t\t\tif (deletedNode.getLeft()!=null)\n\t\t\tdeletedNode.getLeft().setParent(substituteNode);\t\n\t\t\t\n\t\t\t\n\t\t\tdeletedNode.setLeft(null);\n\t\t\tdeletedNode.setRight(null);\n\t\t\tdeletedNode.setParent(null);\n\t\t\t\n\t\t\tSystem.out.println(\"\\nThe node \" + deletedNode + \" is removed from the tree successfully\\n\");\n\t\t\t\n\t\t\treturn substituteNode;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\nThe node \" + deletedNode + \" is removed from the tree successfully\\n\");\n\n\n\t\treturn bstRoot;\n\t\t\n\t}", "public void delete(Node x) {\n if (!redoDone)\n redoStack.clear();\n else\n redoDone = false;\n BSTTrackingData log = new BSTTrackingData(x, x.left, x.right, x.parent, null, 'd');\n Boolean isRoot = x == root;\n Node toRemove = x;\n Node succ = null;\n if (x.left != null & x.right != null) { //if Case 3 - PartA change toRemove to the successor and remove it from the tree\n succ = successorForDelete(x); //use side function to get the successor (adjusted to improve retrack runtime)\n toRemove = succ;\n log.setSuccParent(succ.parent); //update log accordingly\n }\n stack.push(log);\n deleteUpToChild(toRemove); //function to handle removal of node with up to 1 child.\n if (succ != null) { //Case 3 part B - Place the successor in x's location in the tree.\n //update parent\n succ.parent = x.parent;\n if (isRoot) {\n root = succ;\n } else {\n if (x.parent.right == x) x.parent.right = succ;\n else x.parent.left = succ;\n }\n //update both children\n succ.right = x.right;\n if (x.right != null)\n x.right.parent = succ;\n succ.left = x.left;\n if (x.left != null)\n x.left.parent = succ;\n }\n\n }", "private Node removeVn(Node node, K k){\n if(node == null)\n return null;\n\n if(k.compareTo(node.k) >0) {\n node.right = removeVn(node.right, k);\n }else if(k.compareTo(node.k) < 0){\n node.left = removeVn(node.left, k);\n }else{ //(e.compareTo(node.e) == 0) found value matched node\n deleting = true;\n if(node.count!=0) { // if multiple value in one node, just decrease count\n node.count--;\n }\n else if(node.right!=null) { // had right child, use min of right child to replace this node\n node.copyValue(min(node.right));\n node.right = removeMin(node.right);\n }\n else if(node.left!=null) {// left child only , use left child to replace this node\n decDepth(node.left); //maintain depth when chain in left tree\n node = node.left;\n }\n else {\n node = null; // no children, delete this node\n }\n }\n // update size of node and its parent nodes\n if (node != null && deleting) node.size--;\n return node;\n }", "public boolean remove(int a) {\r\n\t\tif (contains(a)) {\r\n\t\t\tif (this.value == a) {\r\n\t\t\t\tif (this.leftChild != null) {\r\n\t\t\t\t\tthis.value = this.leftChild.value; \r\n\t\t\t\t\tfindRL(this.leftChild).rightChild = this.rightChild;\r\n\t\t\t\t\tif (this.leftChild.rightChild != null) {\r\n\t\t\t\t\t\tthis.rightChild = this.leftChild.rightChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.leftChild.leftChild != null) {\r\n\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (this.rightChild != null) {\r\n\t\t\t\t\tthis.value = this.rightChild.value;\r\n\t\t\t\t\tif (this.rightChild.rightChild != null) {\r\n\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (this.rightChild.leftChild != null) {\r\n\t\t\t\t\t\tthis.leftChild = this.rightChild.leftChild;\r\n\t\t\t\t\t} \r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.value = 0; \r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif (this.value < a) {\r\n\t\t\t\tif (this.rightChild != null) {\r\n\t\t\t\t\tif (this.rightChild.value == a) {\r\n\t\t\t\t\t\tif (this.rightChild.leftChild != null) {\r\n\t\t\t\t\t\t\tfindRL(this.rightChild.leftChild).rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t\t\tthis.rightChild = this.rightChild.leftChild;\r\n\t\t\t\t\t\t} else if (this.rightChild.rightChild != null) {\r\n\t\t\t\t\t\t\tthis.rightChild = this.rightChild.rightChild;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.rightChild = null; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.rightChild.remove(a);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (this.leftChild != null) {\r\n\t\t\t\t\tif (this.leftChild.value == a) {\r\n\t\t\t\t\t\tif (this.leftChild.leftChild != null) {\r\n\t\t\t\t\t\t\tfindRL(this.leftChild.leftChild).rightChild = this.leftChild.rightChild; \r\n\t\t\t\t\t\t\tthis.leftChild = this.leftChild.leftChild;\r\n\t\t\t\t\t\t} else if (this.leftChild.rightChild != null) {\r\n\t\t\t\t\t\t\tthis.leftChild = this.leftChild.rightChild;\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.leftChild = null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.leftChild.remove(a);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void delete(String key) throws KeyNotFoundException{\n Node N, P, S;\n if(findKey(root, key)==null){\n throw new KeyNotFoundException(\"Dictionary Error: delete() cannot delete non-existent key\");\n }\n N = findKey(root, key);\n if( N.left == null && N.right == null ){\n if( N == root ){\n root = null;\n }else{\n P = findParent(N, root);\n if( P.right == N ) P.right = null;\n else P.left = null;\n }\n }else if( N.right == null ){\n if( N == root ){\n root = N.left;\n }else{\n P = findParent(N, root);\n if( P.right == N ) P.right = N.left;\n else P.left = N.left;\n }\n }else if( N.left == null ){\n if( N == root ){\n root = N.right;\n }else{\n P = findParent(N, root);\n if( P.right == N ) P.right = N.right;\n else P.left = N.right;\n }\n }else{ // N.left != null && N.right != null\n S = findLeftmost(N.right);\n N.item.key = S.item.key;\n N.item.value = S.item.value;\n P = findParent(S, N);\n if( P.right == S ) P.right = S.right;\n else P.left = S.right; \n }\n numItems--;\n }", "public void delete(int data)\n\t{\n\t\tSystem.out.println(\"Deleting: \" + data);\n\t\troot = delete(root, data);\n\t}", "@Override\n public void delete(K key){\n try {\n this.rootNode = deleteNode(this.rootNode, key);\n } catch (IllegalArgumentException e) {\n System.out.println(e.getMessage());\n }\n }", "public TreeNode<T> delete(TreeNode<T> root, T info) {\n\t\tif(null == root || info == null) {\n\t\t\treturn root;\n\t\t} else {\n\t\t\treturn deleteNode(root, info);\n\t\t}\t\t\n\t}", "private BSTnode<K> actualDelete(BSTnode<K> n, K key) {\n\t\tif (n == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (key.equals(n.getKey())) {\n\t\t\t// n is the node to be removed\n\t\t\tif (n.getLeft() == null && n.getRight() == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (n.getLeft() == null) {\n\t\t\t\treturn n.getRight();\n\t\t\t}\n\t\t\tif (n.getRight() == null) {\n\t\t\t\treturn n.getLeft();\n\t\t\t}\n\n\t\t\t// if we get here, then n has 2 children\n\t\t\tK smallVal = smallest(n.getRight());\n\t\t\tn.setKey(smallVal);\n\t\t\tn.setRight(actualDelete(n.getRight(), smallVal));\n\t\t\treturn n;\n\t\t}\n\n\t\telse if (key.compareTo(n.getKey()) < 0) {\n\t\t\tn.setLeft(actualDelete(n.getLeft(), key));\n\t\t\treturn n;\n\t\t}\n\n\t\telse {\n\t\t\tn.setRight(actualDelete(n.getRight(), key));\n\t\t\treturn n;\n\t\t}\n\t}", "private Node removeElement() {\n if (this.leftChild != null) {\n if (this.rightChild != null) {\n Node current = this.rightChild;\n\n while (current.leftChild != null) {\n current = current.leftChild;\n }\n\n //swap\n E value = this.value;\n this.value = current.value;\n current.value = value;\n\n this.rightChild = this.rightChild.removeElement(current.value);\n return this.balance();\n } else {\n return this.leftChild;\n }\n } else {\n return this.rightChild;\n }\n }", "int deleteByExample(ChangesetParentsExample example);", "public TreeNode deleteNode1(TreeNode root, int key) {\n if (root == null) {\n return root;\n }\n\n // delete current node if root is the target node\n if (root.val == key) {\n // replace root with root->right if root->left is null\n if (root.left == null) {\n return root.right;\n }\n\n // replace root with root->left if root->right is null\n if (root.right == null) {\n return root.left;\n }\n\n // replace root with its successor if root has two children\n TreeNode p = findSuccessor(root);\n root.val = p.val;\n root.right = deleteNode1(root.right, p.val);\n return root;\n }\n if (root.val < key) {\n // find target in right subtree if root->val < key\n root.right = deleteNode1(root.right, key);\n } else {\n // find target in left subtree if root->val > key\n root.left = deleteNode1(root.left, key);\n }\n return root;\n }", "void deleteNode(ZVNode node);", "public Node deleteBST(Node root, int key) {\n if (root == null) {\n return root;\n }\n if (key < root.key) {\n root.left = deleteBST(root.left, key);\n } else if (key > root.key) {\n root.right = deleteBST(root.right, key);\n } // deletes the target key node\n else {\n // condition if node has only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // Condition if there's no child\n if (temp == null) {\n temp = root;\n root = null;\n // else if there's one child\n } else\n {\n root = temp;\n }\n } else {\n // Gets the Inorder traversal inlined with the node w/ two children\n Node temp = minNode(root.right);\n // Stores the inorder successor's node to this node\n root.key = temp.key;\n // Delete the inorder successor\n root.right = deleteBST(root.right, temp.key);\n }\n }\n // Condition if there's only one child then returns the root\n if (root == null) {\n return root;\n }\n // Gets the updated height of the BST\n root.height = maxInt(heightBST(root.left), heightBST(root.right)) + 1;\n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n\n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n\n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n\n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n return root;\n\n }", "public Node deleteNode(Node root, int key) {\n if (root == null)\n return root;\n\n /* Otherwise, recur down the tree */\n if (key < root.data)\n root.left = deleteNode(root.left, key);\n else if (key > root.data)\n root.right = deleteNode(root.right, key);\n\n // if key is same as root's\n // key, then This is the\n // node to be deleted\n else {\n // node with only one child or no child\n if (root.left == null)\n return root.right;\n else if (root.right == null)\n return root.left;\n\n // node with two children: Get the inorder\n // successor (smallest in the right subtree)\n root.data = minValue(root.right);\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, root.data);\n }\n\n return root;\n }", "public AVLNode deleteNodeImmersion(AVLNode treeRoot, int key) {\n if (treeRoot == null) {\n // Sub tree is empty\n // End operation\n return treeRoot;\n }\n\n // Sub tree is NOT empty so we have to perform the recursive descent\n if (key < treeRoot.getKey()) {\n // The key of the current node is less than the key we are looking for\n // Recursive descent through the left\n treeRoot.setLeft(deleteNodeImmersion(treeRoot.getLeft(), key));\n } else if (key > treeRoot.getKey()) {\n // The key of the current node is greater than the key we are looking for\n // Recursive descent through the right\n treeRoot.setRight(deleteNodeImmersion(treeRoot.getRight(), key));\n } else {\n // Key already exists, so we cannot add a new element with the same key\n treeRoot = this.handleDeletion(treeRoot);\n }\n\n // After applying the removal, let's see if rotations need to be applied\n\n // Case of tree with just one node: it is not necessary to apply rotations\n if (treeRoot == null) {\n return treeRoot;\n }\n\n // After inserting the element, we must increase the height of the current node\n // so we can later compute the height of the whole tree.\n // Let's compute height below using child heights\n int heightBelow = IntegerUtilities.max(height(treeRoot.getLeft()), height(treeRoot.getRight()));\n // Increase the height of the current node\n treeRoot.setHeight(heightBelow + 1);\n\n // Compute the balance factor of this node\n int balance = getBalance(treeRoot);\n\n // Check if this node is unbalanced\n if (balance > 1 || balance < -1) {\n\n // This node is unbalanced\n // Let's check the case\n\n if (balance > 1) {\n // Case Left Left / case Left Right\n if (getBalance(treeRoot.getLeft()) >= 0) {\n // Case Left Left: Right Rotation\n return rightRotate(treeRoot);// Right Rotation\n } else if (getBalance(treeRoot.getLeft()) < 0) {\n // Case Left Right: Left Rotation and Right Rotation\n treeRoot.setLeft(leftRotate(treeRoot.getLeft()));// Left Rotation\n return rightRotate(treeRoot);// Right Rotation\n }\n } else {// balance < -1\n // Case Right Right / case Right Left\n if (getBalance(treeRoot.getRight()) <= 0) {\n // Case Right Right: Left Rotation\n return leftRotate(treeRoot);// Left Rotation\n } else if (getBalance(treeRoot.getRight()) > 0) {\n // Case Right Left: Right Rotation and Left Rotation\n treeRoot.setRight(rightRotate(treeRoot.getRight()));// Right Rotation\n return leftRotate(treeRoot);// Left Rotation\n }\n }\n }\n\n return treeRoot;\n }" ]
[ "0.7455714", "0.73532605", "0.714509", "0.7108383", "0.70707625", "0.7053375", "0.6968687", "0.6922639", "0.6921851", "0.6904563", "0.67787135", "0.6713763", "0.67076504", "0.6686676", "0.6676089", "0.6645888", "0.66386473", "0.6634845", "0.6628414", "0.65962356", "0.6591985", "0.6591607", "0.65898806", "0.65669274", "0.65591836", "0.65577614", "0.65159327", "0.65039945", "0.6493385", "0.6478466", "0.64680016", "0.64637214", "0.6438169", "0.6429239", "0.6419628", "0.64071643", "0.6384831", "0.6381583", "0.63741094", "0.63700426", "0.6369435", "0.63632524", "0.63439506", "0.63235974", "0.6316977", "0.6305443", "0.6305083", "0.6288994", "0.62880605", "0.627932", "0.6272173", "0.6272053", "0.6269685", "0.62555194", "0.6235252", "0.6233648", "0.6216977", "0.61984295", "0.6196531", "0.61619437", "0.615457", "0.6150578", "0.61364305", "0.612299", "0.611871", "0.61176586", "0.61165315", "0.61132514", "0.6100973", "0.6099226", "0.60949266", "0.60869443", "0.6075392", "0.607253", "0.60720867", "0.60691833", "0.60670453", "0.60617596", "0.605826", "0.60570896", "0.6054683", "0.602635", "0.600277", "0.5998216", "0.5997753", "0.594808", "0.5947792", "0.5946225", "0.5944478", "0.5940392", "0.5930597", "0.5929396", "0.59282655", "0.59232855", "0.5920814", "0.59149694", "0.5909831", "0.5901329", "0.5882202", "0.5881848" ]
0.7330108
2
A method that updates a value (given by the first parameter) from the AVL tree to a new value (given by the second parameter) Update method updates a value given by the first parameter from the tree to a new value given by the second parameter
public boolean Update(int oldNum, int newNum) { //attempt to delete node and return false if unsuccessful if(Delete(oldNum) == false) return false; //attempt to insert new node and return false if unsuccessful else if(Insert(newNum) == false) return false; //return true if update successful return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AVLNode() {\n\t\t\tthis.key = -1;\n\t\t\tthis.val = null;\n\t\t\tthis.left = null;\n\t\t\tthis.right = null;\n\t\t\tthis.parent = null;\n\t\t\tthis.rank = -1;\n\t\t\tthis.size = 0;\n\t\t}", "private void modify(seg_node root, int l, int r, int a, int b, int v) {\n push_down(root);\n if (l == a && r == b) {\n root._sum += v * root.tot ;\n root._product = root._product * power_mod(root._product_of_di, v) % mod;\n root._lazy_sum += v;\n return;\n }\n int m = (l + r) / 2;\n if (b <= m) {\n modify(root.left, l, m, a, b, v);\n } else if (a >= m + 1) {\n modify(root.right, m + 1, r, a, b, v);\n } else {\n modify(root.left, l, m, a, m, v);\n modify(root.right, m + 1, r, m + 1, b, v);\n }\n push_up(root);\n }", "public static AabbTreeNode updateTree(AabbTreeNode treeRoot) {\n if (treeRoot == null || treeRoot.parent != null) {\n // TODO add log message\n // It is necessary to start from tree root, otherwise the inherited cost will be calculated incorrectly\n return treeRoot;\n }\n if (treeRoot.isLeaf()) {\n AabbTreeNode.calculateEnlargedAabb(treeRoot, treeRoot.shape);\n }\n\n List<AabbTreeNode> invalidNodes = getInvalidLeafs(treeRoot);\n for (AabbTreeNode node : invalidNodes) {\n treeRoot = AabbTreeNode.removeNode(treeRoot, node);\n treeRoot = AabbTreeNode.insertLeaf(treeRoot, node.shape);\n }\n return treeRoot;\n }", "public AVL() {\r\n this.root = null;\r\n }", "@Override\n\tpublic void updateLevel() {\n\t\tthis.algorithm();\n\t\t\n\t}", "public void calculateNewIntensity() {\r\n \r\n // call the recursive method with the root\r\n calculateNewIntensity(root);\r\n }", "public void parseUpdate(StatementTree sTree) {\r\n\r\n\t}", "public AVLTreeNode(AVLBinarySearchTree<E> tree, AVLTreeNode<E> eavlTreeNode, E value) {\n super(eavlTreeNode, value);\n this.tree = tree;\n height = 1;\n }", "public void setRoot(WAVLNode root)\r\n\t {\r\n\t\t this.root = root;\r\n\t }", "private AVLTreeNode<E> insert(E value) {\n int cmp = this.getValue().compareTo(value);\n AVLTreeNode<E> result;\n if(cmp == 0){\n result = null;\n } else if(cmp < 0){\n result = this.getRight() != null ? this.getRight().insert(value) : createTreeNode(value);\n if(result != null){\n this.setRight(result);\n }\n } else {\n result = this.getLeft() != null ? this.getLeft().insert(value) : createTreeNode(value);\n if(result != null){\n this.setLeft(result);\n }\n }\n return result == null ? result : balancing(this);\n }", "public void setTreeSearch(Player tree){\n t = tree;\n\n // e = new EvaluationFunction1(t);\n }", "ITree changeTheta(double theta);", "private void update(int v, int from, int to, int value) {\n\t\tNode node = heap[v];\n\n\t\t/**\n\t\t * If the updating-range contains the portion of the current Node We lazily update it. This means We\n\t\t * do NOT update each position of the vector, but update only some temporal values into the Node;\n\t\t * such values into the Node will be propagated down to its children only when they need to.\n\t\t */\n\t\tif (contains(from, to, node.from, node.to)) {\n\t\t\tchange(node, value);\n\t\t}\n\n\t\tif (node.size() == 1)\n\t\t\treturn;\n\n\t\tif (intersects(from, to, node.from, node.to)) {\n\t\t\t/**\n\t\t\t * Before keeping going down to the tree We need to propagate the the values that have been\n\t\t\t * temporally/lazily saved into this Node to its children So that when We visit them the values are\n\t\t\t * properly updated\n\t\t\t */\n\t\t\tpropagate(v);\n\n\t\t\tupdate(2 * v, from, to, value);\n\t\t\tupdate(2 * v + 1, from, to, value);\n\n\t\t\tnode.sum = heap[2 * v].sum + heap[2 * v + 1].sum;\n\t\t\tnode.min = Math.min(heap[2 * v].min, heap[2 * v + 1].min);\n\t\t}\n\t}", "public void update(L l);", "void setValue(Adjustable adj, int v);", "public AVLTree() {\n\t\tthis.root = null;\n\t}", "public void updateSize() {\n\t\t\tthis.setSize();\n\t\t\tif (this.checkRoot()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tAVLNode parent = (AVLNode) this.parent;\n\t\t\tparent.updateSize();\n\t\t}", "private static void joinWithRoot(AVLTree t1, IAVLNode x, AVLTree t2) \r\n {\t\t\r\n\t\t\t if (t1.getRoot().getKey() < x.getKey() && t2.getRoot().getKey() > x.getKey()) {\r\n\t\t\t\t x.setLeft(t1.getRoot());\r\n\t\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t x.setRight(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t t1.setRoot(x);\r\n\t\t\t\t int newSize = t1.getRoot().getLeft().getSize() + t1.getRoot().getRight().getSize() + 1;\r\n\t\t\t\t int newHeight = Math.max(t1.getRoot().getLeft().getHeight(),t1.getRoot().getRight().getHeight())+1;\r\n\t\t\t\t t1.getRoot().setSize(newSize);\r\n\t\t\t\t t1.getRoot().setHeight(newHeight);\r\n\t\t\t\t t1.maximum = t2.maximum; \r\n\t\t\t }\r\n\t\t\t //case 2\r\n\t\t\t else {\r\n\t\t\t\t x.setRight(t1.getRoot());\r\n\t\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t x.setLeft(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t \r\n\t\t\t\t t1.setRoot(x);\r\n\t\t\t\t int newSize = t1.getRoot().getLeft().getSize() + t1.getRoot().getRight().getSize() + 1;\r\n\t\t\t\t int newHeight = Math.max(t1.getRoot().getLeft().getHeight(),t1.getRoot().getRight().getHeight())+1;\r\n\t\t\t\t t1.getRoot().setSize(newSize);\r\n\t\t\t\t t1.getRoot().setHeight(newHeight);\r\n\t\t\t\t t1.minimum = t2.minimum; \r\n\t\t\t }\r\n\t\t }", "@Override\n public void update() {\n selectedLevel.update();\n }", "private void calculateNewIntensity(BSTNode node) {\r\n \r\n // if the node is NOT null, execute if statement\r\n if (node != null) {\r\n \r\n // call method on left node\r\n calculateNewIntensity(node.getLeft());\r\n \r\n // visit the node (calculate and assign new intensity value)\r\n node.newIntensity(node);\r\n \r\n // call method on right node\r\n calculateNewIntensity(node.getRight());\r\n }\r\n }", "public interface AVLTree<E extends Comparable<E>> extends BinarySortedTree<E>{\n\n boolean isAVLTree(AVLNode<E> current);\n\n interface AVLNode<E>{\n E getData();\n\n AVLNode setData(E data);\n\n AVLNode<E> getParent();\n\n AVLNode setParent(AVLNode<E> parent);\n\n AVLNode<E> getLeft();\n AVLNode setLeft(AVLNode<E> left);\n\n AVLNode<E> getRight();\n\n AVLNode setRight(AVLNode<E> right);\n\n int getHeight();\n\n AVLNode setHeight(int height);\n }\n}", "public int insert(int k, String i) { // insert a node with a key of k and info of i, the method returns the number of rebalance operation\r\n WAVLNode x = new WAVLNode(k,i);// create the new node to insert\r\n x.left=EXT_NODE;\r\n x.right=EXT_NODE;\r\n if(root==EXT_NODE) { // checking if the tree is empty, in that case put x as a root\r\n \t root=x;\r\n \t return 0;\r\n }\r\n WAVLNode y = treePos(this, k); // find the correct position to insert the node\r\n int [] f = {x.key,y.key};\r\n if (f[0]==f[1]) { // in case the key is already exists in the tree, return -1 and dosent insert anything\r\n \t \r\n \t return -1;\r\n }\r\n x.parent=y; \r\n if(y.rank!=0) {// if y is onary do:\r\n \t if(x.key<y.key) {// check if x should be left son of y\r\n \t\t y.left=x;\r\n \t }\r\n \t else { // x should be right son of y\r\n \t\t y.right=x;\r\n \t }\r\n \t return 0; // no rebalance operation was needed, return 0\r\n }\r\n if(x.key<y.key) { // if y is a leaf\r\n \t y.left=x;\r\n }\r\n else {\r\n \t y.right=x;\r\n }\r\n int cnt=0;//rebalance operation to return\r\n while(x.parent!=null&&x.parent.rank-x.rank==0) { // while the tree is not balanced continue to balance the tree\r\n \t if(parentside(x.parent, x).equals(\"left\")) { // check if x is a left son of x's parent\r\n \t\t if (x.parent.rank-x.parent.right.rank==1) {//check the conditions for promotion\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.left.rank==1) { // check the conditions for rotate\r\n \t\t\t rightRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t doubleRotateleft(x); // check the conditions for double rotate\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n \t else { // x is a right son of x's parent, all conditions and actions are symmetric to the left side\r\n \t\t if (x.parent.rank-x.parent.left.rank==1) {\r\n \t\t\t promote(x.parent);\r\n \t\t\t x=x.parent;\r\n \t\t\t cnt++;\r\n \t\t }\r\n \t\t else if(x.rank-x.right.rank==1) {\r\n \t\t\t leftRotate(x);\r\n \t\t\t cnt+=2;\r\n \t\t }\r\n \t\t else {\r\n \t\t\t \r\n \t\t\t doubleRotateright(x);\r\n \t\t\t cnt+=5;\r\n \t\t }\r\n \t }\r\n }\r\n return cnt;\r\n \r\n }", "public tree apply(A p1 ) {\n\t}", "public AVLTree() \r\n\t{\r\n\t\tthis.root = new AVLNode(null);\r\n\t}", "void updateAllParentsBelow();", "public void balance() {\n tree.balance();\n }", "public AVLTree() {\r\n\r\n\r\n this.root = new AVLTreeNode(9);\r\n Delete(9);\r\n }", "public int insert(int k, String i) {\r\n\t\t WAVLNode parentToInsert;\r\n\t\t if(this.root == null)\r\n\t\t {\r\n\t\t\t this.root = new WAVLNode (k,i,this.getExternalNode());\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t parentToInsert = this.root.placeToInsert(k);\r\n\t\t\t //System.out.println(parentToInsert.getKey());\r\n\t\t\t WAVLNode nodeToInsert = new WAVLNode(k,i,this.getExternalNode());\r\n\t\t\t if(parentToInsert == null)\r\n\t\t\t {\r\n\t\t\t\t return -1;\r\n\t\t\t }\r\n\t\t\t if(this.min == null || k < this.min.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.min = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(this.max == null || k > this.max.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.max = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(parentToInsert.getKey() > k)\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setLeft(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t else\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setRight(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t WAVLNode currentNode = nodeToInsert;\r\n\t\t\t while(currentNode.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t currentNode = currentNode.getParent();\r\n\t\t\t\t currentNode.setSubTreeSize(currentNode.getSubTreeSize()+1);\r\n\t\t\t\t //System.out.println(\"Changed \" +currentNode.getKey()+ \" To \" + (currentNode.getSubTreeSize()));\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t int numRebalance = parentToInsert.rebalanceInsert();\r\n\t\t\t while(this.root.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t //System.out.println(this.root.getKey());\r\n\t\t\t\t this.setRoot(this.root.getParent());\r\n\t\t\t }\r\n\t\t\t return numRebalance;\r\n\t\t }\r\n\t }", "void updateLT (int size, LeapNode [][] pa, LeapNode [][] na, LeapNode[] n, LeapNode[][] newNode, int[] maxHeight,\n\t\t\t\t\t\t\t\tboolean[] changed){\n\t}", "public AVLNode(int item){\n this.key=item;\n left=right=null;\n height=1;\n }", "public void updateSingleNode(Node n) {\r\n\t\t//update val\r\n\t\tn.val = n.left.getVal() + n.p + n.right.getVal();\r\n\r\n\t\t//update eval and emax\r\n\t\tint case1 = n.left.getMaxVal();\r\n\t\tint case2 = n.left.getVal() + n.p;\r\n\t\tint case3 = n.left.getVal() + n.p + n.right.getMaxVal();\r\n\t\tif( case1 >= case2 && case1 >= case3 ) {\r\n\t\t\t//case 1\r\n\t\t\tn.maxval = case1;\r\n\t\t\t//if the left node is the nilNode, make emax this node\r\n\t\t\tif( n.left.isNil ) {\r\n\t\t\t\tn.emax = n.getEndpoint();\r\n\t\t\t} else {\r\n\t\t\t\t//otherwise get emax of left\r\n\t\t\t\tn.emax = n.left.getEmax();\r\n\t\t\t}\r\n\t\t} else if( case2 >= case1 && case2 >= case3 ) {\r\n\t\t\t//case 2\r\n\t\t\tn.maxval = case2;\r\n\t\t\tn.emax = n.getEndpoint();\r\n\t\t} else if( case3 >= case1 && case3 >= case2 ) {\r\n\t\t\t//case 3\r\n\t\t\tn.maxval = case3;\r\n\t\t\t//if the left node is the nilNode, make emax this node\r\n\t\t\tif( n.right.isNil ) {\r\n\t\t\t\tn.emax = n.getEndpoint();\r\n\t\t\t} else {\r\n\t\t\t\t//otherwise get emax of right\r\n\t\t\t\tn.emax = n.right.getEmax();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void refreshTree(TwoDimensionBone value) {\r\n\t\tif(value.getParent()==null){\r\n\t\t\ttreeModel.refresh(null);\r\n\t\t}else{\r\n\t\t\ttreeModel.refresh(value.getParent());\r\n\t\t}\r\n\t\ttreeModel.refresh(value);\r\n\t}", "public void insert(double key, Double value){\n\tif(search(key)!=null){\r\n\t\tLeaf Leaf = (Leaf)Search(root, key);\r\n\t\t\r\n\t\tfor(int i=0; i<Leaf.keyvalues.size(); i++) {\r\n\t\t\tif(key==Leaf.getKeyValue(i).getKey()) {\r\n\t\t\t\t\tLeaf.getKeyValue(i).values.add(value);\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tLeaf newleaf = new Leaf(key, value);\r\n\t\r\n\tPair<Double,Node> entry=new Pair<Double, Node>(key,newleaf);\r\n\r\n\tif(root == null ) {\r\n\t\troot = entry.getValue();\r\n\t}\r\n\t\r\n\r\n\tPair<Double, Node> newChildEntry = getChildEntry(root, entry, null);\r\n\t\r\n\tif(newChildEntry == null) {\r\n\t\treturn;\r\n\t} else {\r\n\t\tIntrnlNode newRoot = new IntrnlNode(newChildEntry.getKey(), root, newChildEntry.getValue());\r\n\t\troot = newRoot;\r\n\t\treturn;\r\n\t}\r\n}", "public int scoreLeafNode();", "public double calculateValue() {\n if (!isLeaf && Double.isNaN(value)) {\n for (List<LatticeNode> list : children) {\n double tempVal = 0;\n for (LatticeNode node : list) {\n tempVal += ((CALatticeNode) node).calculateValue();\n }\n if (!list.isEmpty())\n value = tempVal;\n }\n }\n weight = Math.abs(value);\n return value;\n }", "public nodoArbolAVL insertarAVL(nodoArbolAVL nuevo,nodoArbolAVL subAr){\n nodoArbolAVL nuevoPadre = subAr;\n if(nuevo.dato < subAr.dato){\n if(subAr.hijoIzquierdo == null){\n subAr.hijoIzquierdo = nuevo;\n }else{\n subAr.hijoIzquierdo = \n insertarAVL(nuevo,subAr.hijoIzquierdo);\n if((obtenerFE(subAr.hijoIzquierdo)-obtenerFE(subAr.hijoDerecho)==2)){\n if(nuevo.dato < subAr.hijoIzquierdo.dato){\n nuevoPadre = rotacionIzquierda(subAr);\n }else{\n nuevoPadre = rotacionDobleIzquierda(subAr);\n }\n }\n }\n }else if(nuevo.dato > subAr.dato){\n if(subAr.hijoDerecho == null){\n subAr.hijoDerecho = nuevo;\n \n }else{\n subAr.hijoDerecho = insertarAVL(nuevo,subAr.hijoDerecho);\n if((obtenerFE(subAr.hijoDerecho)-obtenerFE(subAr.hijoIzquierdo)==-2)){\n if(nuevo.dato > subAr.hijoDerecho.dato){\n nuevoPadre = rotacionDerecha (subAr);\n }else{\n nuevoPadre = rotacionDobleDerecha(subAr);\n }\n }\n }\n }else{\n System.out.println(\"NODO DUPLICADO\");\n }\n //ACTUALIZANDO EL FE\n if((subAr.hijoIzquierdo == null)&&(subAr.hijoDerecho !=null)){\n subAr.fe = subAr.hijoDerecho.fe + 1;\n }else if((subAr.hijoDerecho == null)&&(subAr.hijoIzquierdo != null)){\n subAr.fe = subAr.hijoIzquierdo.fe +1 ;\n }else{\n subAr.fe = Math.max(obtenerFE(subAr.hijoIzquierdo),\n obtenerFE(subAr.hijoDerecho))+1;\n }\n nuevo.SetNivel(nuevo.nivel+1);\n return nuevoPadre;\n }", "void updateMax(StockNode a){\n\t\tif(maxNode==null){\r\n\t\t\tmaxNode=a;\r\n\t\t} else { \r\n\t\t\tif(a.stockValue>maxNode.stockValue){\r\n\t\t\t\tmaxNode=a;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void update (int trees, int bushes, int prey, int predators){\n numTrees = trees;\n numBushes = bushes;\n numPrey = prey;\n numPredators = predators;\n this.update();\n }", "@Override\r\n public Pair<DeepTree, DeepTree> process(Tree tree) {\n\r\n IdentityHashMap<Tree, SimpleMatrix> goldVectors = new IdentityHashMap<Tree, SimpleMatrix>();\r\n double scoreGold = score(tree, goldVectors);\r\n DeepTree bestTree = getHighestScoringTree(tree, TRAIN_LAMBDA);\r\n DeepTree goldTree = new DeepTree(tree, goldVectors, scoreGold);\r\n return Pair.makePair(goldTree, bestTree);\r\n }", "public void update_height() {\r\n int tmp_height = 0;\r\n int tmp_left = -1;\r\n int tmp_right = -1;\r\n\r\n // set height of null children to -1\r\n if (leftChild != null) {\r\n tmp_left = leftChild.height;\r\n }\r\n if (rightChild != null) {\r\n tmp_right = rightChild.height;\r\n }\r\n\r\n // find highest child\r\n if (tmp_left > tmp_right) {\r\n tmp_height = tmp_left;\r\n }\r\n else {\r\n tmp_height = tmp_right;\r\n }\r\n\r\n // update this node's height\r\n height = tmp_height + 1;\r\n }", "public static void setValue(Object tree,Map context,Object root,Object value) throws OgnlException{\n OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);\n Node n = (Node) tree;\n\n if (n.getAccessor() != null){\n n.getAccessor().set(ognlContext, root, value);\n return;\n }\n\n n.setValue(ognlContext, root, value);\n }", "public interface IAVLNode{\t\r\n\t\tpublic int getKey(); //returns node's key (for virtuval node return -1)\r\n\t\tpublic String getValue(); //returns node's value [info] (for virtuval node return null)\r\n\t\tpublic void setValue(String value); // sets the value of the node\r\n\t\tpublic void setLeft(IAVLNode node); //sets left child\r\n\t\tpublic IAVLNode getLeft(); //returns left child (if there is no left child return null)\r\n\t\tpublic void setRight(IAVLNode node); //sets right child\r\n\t\tpublic IAVLNode getRight(); //returns right child (if there is no right child return null)\r\n\t\tpublic void setParent(IAVLNode node); //sets parent\r\n\t\tpublic IAVLNode getParent(); //returns the parent (if there is no parent return null)\r\n\t\tpublic boolean isRealNode(); // Returns True if this is a non-virtual AVL node\r\n\t\tpublic void setHeight(int height); // sets the height of the node\r\n \tpublic int getHeight(); // Returns the height of the node (-1 for virtual nodes)\r\n \tpublic void setKey(int key); // Sets the key of the node\r\n \tpublic void setSize(int size); // sets the number of real nodes in this node's subtree\r\n \tpublic int getSize(); // Returns the number of real nodes in this node's subtree (Should be implemented in O(1))\r\n\t}", "public void update(Avion avion)\n\t{\n\t}", "private Value update(Node recentNode) {\n Node temp = recentNode.next;\n Value value = temp.val;\n recentNode.next = recentNode.next.next;\n Node node = first;\n while (node.next != null) {\n node = node.next;\n }\n node.next = temp;\n temp.next = null;\n return value;\n }", "private void UpdateAddNestedValue(){\n notebookRef.document(\"IpWOjXtIgGJ2giKF4VTp\")\r\n// .update(KEY_Tags+\".tag1\", false);\r\n\r\n // ****** For Practice If we have nested over nested values likke:\r\n // tags-> tag1-> nested_tag-> nested_tag2 :true we write like\r\n .update(\"tags.tag1.nested_tag.nested_tag2\", true);\r\n\r\n }", "public void valueChanged(TreeSelectionEvent e) {\n DefaultMutableTreeNode TreeN = (DefaultMutableTreeNode)\n tree.getLastSelectedPathComponent();\n \n if (TreeN == null) return;\n \n Object nodeIn = TreeN.getUserObject();\n Node y = (Node)nodeIn;\n Homework1.inorder(y);\n htmlPane.setText(y.value.toString());\n \n }", "private int joinFirstCase(AVLTree t1, IAVLNode x, AVLTree t2) {\r\n\t\t\t int returnValue = 0;\r\n\t\t\t IAVLNode curr = t2.getRoot();\r\n\t\t\t \r\n\t\t\t while(true) {\r\n\t\t\t\t if(curr.getHeight() <= t1.getRoot().getHeight())\r\n\t\t\t\t\t break;\r\n\t\t\t\t if(curr.getLeft().getHeight() == -1)\r\n\t\t\t\t\t break;\r\n\t\t\t\t curr = curr.getLeft();\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t if(t2.getRoot() == curr) {\r\n\t\t\t\t curr.setLeft(x);\r\n\t\t\t\t x.setParent(curr);\r\n\t\t\t\t curr.setHeight(curr.getHeight() + 1 );\r\n\t\t\t\t return 0;\r\n\t\t\t\t\t\t \r\n\t\t\t }\r\n\t\t\t returnValue = t2.getRoot().getHeight() - curr.getHeight();\r\n\t\t\r\n\t\t\t //replacing pointers\r\n\t\t\t x.setRight(curr);\r\n\t\t\t x.setParent(curr.getParent());\r\n\t\t\t curr.getParent().setLeft(x);\r\n\t\t\t curr.setParent(x);\r\n\t\t\t x.setLeft(t1.getRoot());\r\n\t\t\t t1.getRoot().setParent(x);\r\n\t\t\t t1.setRoot(t2.getRoot());\r\n\t\t\t x.setHeight(Math.max(x.getRight().getHeight(),x.getLeft().getHeight()) + 1);\r\n\t\t\t \r\n\t\t\t t2.minimum = t1.minimum;\r\n\t\t\t \r\n\t\t\t //FIXING NEW TREE CREATED\r\n\t\t\t HieghtsUpdating(x);\r\n\t\t\t SizesUpdate(x);\r\n\t\r\n\t\t\t return returnValue;\r\n\t\t\t \r\n\t\t}", "public void balanceTree() {\n\n balanceTree(root);\n }", "public void setParent(IAVLNode node);", "public void setParent(IAVLNode node);", "private int joinSecnodCase(AVLTree t1, IAVLNode x, AVLTree t2) {\r\n\t\t\t\t int returnValue = 0;\r\n\t\t\t\t IAVLNode curr = t1.getRoot(), parent;\r\n\t\t\t\t \r\n\t\t\t\t while(true) {\r\n\t\t\t\t\t if(curr.getHeight() <= t2.getRoot().getHeight())\r\n\t\t\t\t\t\t break;\r\n\t\t\t\t\t if(curr.getRight().getHeight() == -1)\r\n\t\t\t\t\t\t break;\r\n\t\t\t\t\t curr = curr.getRight();\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t parent = curr.getParent();\r\n\t\t\t\t \r\n\t\t\t\t if(t1.getRoot() == curr) {\r\n\t\t\t\t\t curr.setRight(x);\r\n\t\t\t\t\t x.setParent(curr);\r\n\t\t\t\t\t curr.setHeight(curr.getHeight() + 1 );\r\n\t\t\t\t\t return 0;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t returnValue = Math.abs(t2.getRoot().getHeight() - curr.getHeight());\r\n\t\t\t\t \r\n\t\t\t\t //replacing pointers\r\n\t\t\t\t \r\n\t\t\t\t x.setLeft(curr);\r\n\t\t\t\t x.setParent(parent);\r\n\t\t\t\t parent.setRight(x);\r\n\t\t\t\t curr.setParent(x);\r\n\t\t\t\t x.setRight(t2.getRoot());\r\n\t\t\t\t t2.getRoot().setParent(x);\r\n\t\t\t\t t2.setRoot(null);\r\n\t\t\t\t t2.setRoot(t1.getRoot());\r\n\t\t\t\t x.setHeight(Math.max(x.getRight().getHeight(), x.getLeft().getHeight()) + 1);\r\n\t\t\t\t //FIXING NEW TREE CREATED\r\n\t\t\t\t \r\n\t\t\t\t //t2.minimum = t1.minimum;\r\n\t\t\t\t t2.maximum = t1.maximum;\r\n\t\t\t\t \r\n\t\t\t\t //FIXING NEW TREE CREATED\r\n\t\t\t\t HieghtsUpdating(x);\r\n\t\t\t\t SizesUpdate(x);\r\n\t\t\r\n\t\t\t\t return returnValue;\r\n\t\t\t\t}", "public static void main(String[] args) {\n\n\t\tAVLTree tree = new AVLTree();\n\t\ttree.root = insert(tree.root,10);\n\t\ttree.root = insert(tree.root, 20); \n tree.root = insert(tree.root, 30); \n tree.root = insert(tree.root, 40); \n tree.root = insert(tree.root, 50); \n tree.root = insert(tree.root, 25); \n \n preOrder(tree.root);\n \n tree.root = deleteNodeFomAVL(tree.root, 25);\n \n System.out.println();\n \n preOrder(tree.root);\n \n\t}", "public AVLTreeNode(AVLBinarySearchTree<E> es) {\n tree = es;\n height = 1;\n }", "public ITree changeTheta(double theta) {\n return this; \n }", "public void setLeft(IAVLNode node);", "public void setLeft(IAVLNode node);", "private void fixAVLTree(Node node) {\n\t\tfinal int lf = getLoadFactor(node);\n\t\t//if (lf == -1 || lf == 0 || lf == 1) {\n\t\tif (lf >= -1 && lf <= 1) {\n\t\t\t// do nothing\n\t\t\treturn;\n\t\t}\t\t\n\t\trotateTree(node);\n\t}", "public void insert(T key, U data){\n\t\t\n\t\tAVLNode<T, U> parent = null;\n\t\tAVLNode<T, U> node = this.root;\n\t\tAVLNode<T, U> newNode = new AVLNode<T, U>(key, data);\n\t\t\n\t\tthis.amountOfNodes++;\n\t\t\n\t\twhile(node != null){\n\t\t\tparent = node;\n\t\t\tif(newNode.getKey().compareTo(node.getKey()) < 0){\n\t\t\t\tnode = node.getLeft();\n\t\t\t}else{\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t}\n\t\t\n\t\tnewNode.setParent(parent);\n\t\t\n\t\tif(parent == null){ //It is the first element of the tree.\n\t\t\tthis.root = newNode;\n\t\t}else if(newNode.getKey().compareTo(parent.getKey()) < 0){\n\t\t\tparent.setLeft(newNode);\n\t\t}else{\n\t\t\tparent.setRight(newNode);\n\t\t}\n\t\tcomputeHeights(newNode);\n\t\tthis.balanceTree(parent);\n\t}", "public void valueChanged(TreeSelectionEvent e) {\r\n DefaultMutableTreeNode node = (DefaultMutableTreeNode)\r\n tree.getLastSelectedPathComponent();\r\n \r\n Node n = (Node)node.getUserObject();\r\n \r\n if (tree == null) return;\r\n \r\n htmlPane.setText(Homework1.inorder(n)+\"=\"+Homework1.calculate(n));\r\n \r\n }", "void incrementOldDepth() {\n mOldDepth++;\n }", "public AVLNode deleteNodeImmersion(AVLNode treeRoot, int key) {\n if (treeRoot == null) {\n // Sub tree is empty\n // End operation\n return treeRoot;\n }\n\n // Sub tree is NOT empty so we have to perform the recursive descent\n if (key < treeRoot.getKey()) {\n // The key of the current node is less than the key we are looking for\n // Recursive descent through the left\n treeRoot.setLeft(deleteNodeImmersion(treeRoot.getLeft(), key));\n } else if (key > treeRoot.getKey()) {\n // The key of the current node is greater than the key we are looking for\n // Recursive descent through the right\n treeRoot.setRight(deleteNodeImmersion(treeRoot.getRight(), key));\n } else {\n // Key already exists, so we cannot add a new element with the same key\n treeRoot = this.handleDeletion(treeRoot);\n }\n\n // After applying the removal, let's see if rotations need to be applied\n\n // Case of tree with just one node: it is not necessary to apply rotations\n if (treeRoot == null) {\n return treeRoot;\n }\n\n // After inserting the element, we must increase the height of the current node\n // so we can later compute the height of the whole tree.\n // Let's compute height below using child heights\n int heightBelow = IntegerUtilities.max(height(treeRoot.getLeft()), height(treeRoot.getRight()));\n // Increase the height of the current node\n treeRoot.setHeight(heightBelow + 1);\n\n // Compute the balance factor of this node\n int balance = getBalance(treeRoot);\n\n // Check if this node is unbalanced\n if (balance > 1 || balance < -1) {\n\n // This node is unbalanced\n // Let's check the case\n\n if (balance > 1) {\n // Case Left Left / case Left Right\n if (getBalance(treeRoot.getLeft()) >= 0) {\n // Case Left Left: Right Rotation\n return rightRotate(treeRoot);// Right Rotation\n } else if (getBalance(treeRoot.getLeft()) < 0) {\n // Case Left Right: Left Rotation and Right Rotation\n treeRoot.setLeft(leftRotate(treeRoot.getLeft()));// Left Rotation\n return rightRotate(treeRoot);// Right Rotation\n }\n } else {// balance < -1\n // Case Right Right / case Right Left\n if (getBalance(treeRoot.getRight()) <= 0) {\n // Case Right Right: Left Rotation\n return leftRotate(treeRoot);// Left Rotation\n } else if (getBalance(treeRoot.getRight()) > 0) {\n // Case Right Left: Right Rotation and Left Rotation\n treeRoot.setRight(rightRotate(treeRoot.getRight()));// Right Rotation\n return leftRotate(treeRoot);// Left Rotation\n }\n }\n }\n\n return treeRoot;\n }", "public void update(int i, int val) {\n tree.updateTree(tree.root, i, val);\n }", "private void doOneUpdateStep(){\r\n SparseFractalSubTree target = null; //stores the tree which will receive the update\r\n for (int i = 0; i < subTrees.length - 1; i++) { //top tree never receives an update (reason for -1)\r\n SparseFractalSubTree subTree = subTrees[i];\r\n if (!subTree.hasStopped()) { //not permanently or temporary finished\r\n if (target != null) { //are we the first tree who can receive an update\r\n if ((subTree.getTailHeight() < target.getTailHeight())) { //are we a better candidate then the last one?\r\n target = subTree;\r\n }\r\n } else { //we are the first not finished subtree, so we receive the update if no better candidate is found\r\n target = subTree;\r\n }\r\n\r\n }\r\n }\r\n assert (target != null);\r\n assert (check(target)); //check all the assumptions\r\n\r\n measureDynamicSpace(); //measure\r\n\r\n target.updateTreeHashLow(); //apply a update to the target\r\n }", "public static void main(String[] args) throws AVLTreeException, BSTreeException, IOException {\n\t\tint bsDepths = 0, avlDepths = 0; // tracks the sum of the depths of every node\n\t\tScanner inFile = new Scanner(new FileReader(args[0]));\n\t\tAVLTree<String> avltree = new AVLTree<>();\n\t\tBSTree<String> bstree = new BSTree<>();\n\t\tFunction<String, PrintStream> printUpperCase = x -> System.out.printf(\"%S\\n\", x); // function example from Duncan. Hope this is okay :)\n\t\tArrayList<String> words = new ArrayList<>(); // Way to store the words without opening the file twice\n\t\twhile (inFile.hasNext()) { // inserting words into each tree without using an extra loop\n\t\t\twords.add(inFile.next().toUpperCase());\n\t\t\tbstree.insert(words.get(words.size() - 1));\n\t\t\tavltree.insert(words.get(words.size() - 1));\n\t\t}\n\t\tinFile.close();\n\t\t// VVV Prints table 1 VVV\n\t\tSystem.out.printf(\"Table 1: Binary Search Tree [%s]\\n\" + \"Level-Order Traversal\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Word\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\", args[0]);\n\t\tbstree.levelTraverse(printUpperCase);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\t// VVV Prints table 2 VVV\n\t\tSystem.out.printf(\n\t\t\t\t\"Table 2: AVL Tree [%s]\\n\" + \"Level-Order Traversal\\n\" + \"=========================================\\n\"\n\t\t\t\t\t\t+ \"Word\\n\" + \"-----------------------------------------\\n\",\n\t\t\t\targs[0]);\n\t\tavltree.levelTraverse(printUpperCase);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\t// VVV Prints table 3 VVV\n\t\tSystem.out.printf(\"Table 3:Number of Nodes vs Height vs Diameter\\n\" + \"Using Data in [%s]\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Tree # Nodes Height Diameter\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\" + \"BST\\t%d\\t %d\\t %d\\n\" + \"AVL\\t%d\\t %d\\t %d\\n\",\n\t\t\t\targs[0], bstree.size(), bstree.height(), bstree.diameter(), avltree.size(), avltree.height(),\n\t\t\t\tavltree.diameter());\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\tfor (int i = 0; i < words.size(); i++) { //searches the trees for each word, totaling their depths\n\t\t\tbsDepths += 1 + bstree.depth(words.get(i));\n\t\t\tavlDepths += 1 + avltree.depth(words.get(i));\n\t\t}\n\t\t// VVV Prints table 4 VVV\n\t\tSystem.out.printf(\"Table 4:Total Number of Node Accesses\\n\" + \"Searching for all the Words in [%s]\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Tree # Nodes\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\" + \"BST %d\\n\" + \"AVL %d\\n\",\n\t\t\t\targs[0], bsDepths, avlDepths);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t}", "public AVLTree(IAVLNode node) {\n\t\tthis.root = node;\n\t}", "public void incLevel(int lvl){this.Level=this.XP/(100);}", "private void _update(int nodeNum, int s, int e, final long l, final long r, final int kind){\n if(r<s || e<l)\n return;\n\n // case 2: in range\n if(l<=s && e<=r){\n tree[nodeNum] = kind;\n return;\n }\n\n // case 3-1: overlap range, same value\n if(tree[nodeNum] == kind)\n return;\n\n // case 3-2: overlap range, different value\n if(tree[nodeNum] != -1) {\n tree[nodeNum*2] = tree[nodeNum];\n tree[nodeNum*2+1] = tree[nodeNum];\n tree[nodeNum] = -1;\n }\n\n int mid = (s + e) / 2;\n _update(nodeNum*2, s, mid, l, r, kind);\n _update(nodeNum*2+1, mid+1, e, l, r, kind);\n }", "@Override\n\tdouble updateLevel() {\n\t\treturn 0;\n\t}", "private void updateSkiTreeLevel(SkiNode head) {\n\t\tfor (SkiNode nextNode : head.next) {\n\t\t\tif (nextNode != null) {\n\t\t\t\tupdateSkiTreeLevel(nextNode);\n\t\t\t\thead.level = Math.max(head.level, nextNode.level + 1);\n\t\t\t}\n\t\t}\n\t\thead.level = Math.max(head.level, 1);\n\t\thMap[head.i][head.j] = head.level;\n\t}", "public int join(IAVLNode x, AVLTree t) {\n\t\tif (this.empty() && t.empty()) {\n\t\t\tthis.root = x;\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (this.empty()) {// t is not empty\n\t\t\tint comp = t.getRoot().getHeight() + 1;\n\t\t\tt.insert(x.getKey(), x.getValue());\n\t\t\tthis.root = t.root;\n\t\t\treturn comp;\n\t\t}\n\n\t\tif (t.empty()) {// this is not empty\n\t\t\tint comp = this.getRoot().getHeight() + 1;\n\t\t\tthis.insert(x.getKey(), x.getValue());\n\t\t\treturn comp;\n\t\t}\n\n\t\tint thisRank = this.getRoot().getHeight();\n\t\tint otherRank = t.getRoot().getHeight();\n\t\tif (thisRank == otherRank) {\n\t\t\tif (this.getRoot().getKey() < x.getKey()) {\n\t\t\t\tx.setLeft(this.getRoot());\n\t\t\t\tthis.getRoot().setParent(x);\n\t\t\t\tx.setRight(t.getRoot());\n\t\t\t\tt.getRoot().setParent(x);\n\t\t\t\tx.setHeight(x.getLeft().getHeight() + 1);\n\t\t\t\tthis.root = x;\n\t\t\t} else {// this.getRoot().getKey() > x.getKey()\n\t\t\t\tx.setRight(this.getRoot());\n\t\t\t\tthis.getRoot().setParent(x);\n\t\t\t\tx.setLeft(t.getRoot());\n\t\t\t\tt.getRoot().setParent(x);\n\t\t\t\tx.setHeight(x.getRight().getHeight() + 1);\n\t\t\t\tthis.root = x;\n\t\t\t}\n\t\t\treturn (Math.abs(thisRank - otherRank) + 1);\n\t\t} // if we got here, than the trees aren't in the same height\n\t\tboolean newIsHigher;\n\t\tboolean newIsBigger;\n\t\tnewIsHigher = (this.getRoot().getHeight() < t.getRoot().getHeight());\n\t\tnewIsBigger = (this.getRoot().getKey() < this.getRoot().getKey());\n\t\tAVLNode tempX = (AVLNode) x;\n\t\tif (newIsHigher && newIsBigger) {\n\t\t\tt.joinByLeft(tempX, this, 'R');\n\t\t}\n\t\tif (!newIsHigher && !newIsBigger) {\n\t\t\tthis.joinByLeft(tempX, t, 'L');\n\t\t}\n\t\tif (newIsHigher && !newIsBigger) {\n\t\t\tt.joinByRight(tempX, this, 'R');\n\t\t}\n\t\tif (!newIsHigher && newIsBigger) {\n\t\t\tthis.joinByRight(tempX, t, 'L');\n\t\t}\n\t\treturn (Math.abs(thisRank - otherRank) + 1);\n\t}", "@Override\n protected AVLTreeNode<E> createTreeNode(E value) {\n return new AVLTreeNode<E>(tree, this, value);\n }", "public void updateRankingValue(double delta) {\n sortingValues.rankingValue += delta;\n }", "public AVLTree Insert(int address, int size, int key) \n { \n AVLTree insert = new AVLTree(address,size,key);\n AVLTree root = this.getRoot();\n if(root.right==null){ \n root.right = insert;\n insert.parent = root;\n insert.changeHeight();\n insert.balance();\n insert.changeHeight();\n return insert;\n }\n root.right.insertNode(insert);\n return insert;\n }", "private void applyLvlUpCost() {\n }", "private void doBasicUpdate(){\n for (int i = 0; i < subTrees.length - 1; i++) { //top tree never receives an update (reason for -1)\r\n if(!subTrees[i].hasStopped()) {\r\n doOneUpdateStep() ;\r\n }\r\n }\r\n }", "protected void case3L(AbsTree t) {\n\t\t\tAbsTree max_left_t = t.left.max();\r\n\t\t\tif (max_left_t.left == null && max_left_t.right == null)\r\n\t\t\t\tcase1(max_left_t, this); // max_left_t is a leaf node\r\n\t\t\telse\r\n\t\t\t\tcase2(max_left_t, this); // max_left_t is a non-leaf node\r\n\t\t\tt.value = max_left_t.value;\r\n\t\t\tt.set_count(max_left_t.get_count());\r\n\t}", "public void changeLVL(int index){\n level +=index;\n changeLvL=true;\n }", "public void convertToGreater(TreeNode root){\n if(root==null)return;\n \n //if it is a leaf node\n if(root.left==null && root.right==null){\n //temporary variable to store root value\n int prev=root.val;\n //adding sum value to root\n root.val+=sum;\n //adding prev value to sum\n sum+=prev;\n return; \n };\n //calling right subtree\n convertToGreater(root.right);\n //temporary variable to store root value\n int prev=root.val;\n //adding sum value to root\n root.val+=sum;\n //adding prev value to sum\n sum+=prev;\n //calling left sub tree\n convertToGreater(root.left);\n }", "void updateGarage(Garage updatedGarage);", "public void joinByLeft(AVLNode node, AVLTree hTree, char parentTree) {\n\t\tAVLNode bNode = (AVLNode) hTree.getRoot();\n\t\twhile (bNode.getHeight() > this.getRoot().getHeight()) { // connecting the trees\n\t\t\tbNode = (AVLNode) bNode.getLeft();\n\t\t}\n\t\tnode.setHeight(this.getRoot().getHeight() + 1);\n\t\tnode.setLeft(this.getRoot());\n\t\tthis.getRoot().setParent(node);\n\t\tnode.setRight(bNode);\n\t\tnode.setParent(bNode.getParent());\n\t\tnode.getParent().setLeft(node);\n\t\tnode.getRight().setParent(node);\n\t\t// end of concatenation\n\t\tif (node.getHeight() - node.getRight().getHeight() == 2) {\n\t\t\thTree.case1(node, 1);\n\t\t\tif (parentTree == 'L') {\n\t\t\t\tthis.root = hTree.getRoot();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (node.getParent().getHeight() - node.getHeight() == 1) {\n\t\t\tif (parentTree == 'L') {// higher tree is t, not our tree\n\t\t\t\tthis.root = hTree.getRoot();// we need to change our tree's root to the higher tree\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (node.getParent().getHeight() - node.getParent().getRight().getHeight() == 2) {\n\t\t\thTree.singleRotation(node, 'L');\n\t\t\tif (parentTree == 'L') {\n\t\t\t\tthis.root = hTree.getRoot();\n\t\t\t}\n\t\t\tnode.setHeight(node.getHeight() + 1);\n\t\t\tnode.getRight().setHeight(node.getRight().getHeight() + 1);\n\t\t\treturn;\n\t\t}\n\n\t\tif (node.getParent().getHeight() - node.getParent().getRight().getHeight() == 1) {\n\t\t\thTree.case1(node, 1);\n\t\t\tif (parentTree == 'L') {\n\t\t\t\tthis.root = hTree.getRoot();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}", "private void balance()\r\n\t{\t\r\n\t\tBinaryTree balancedTree = new BinaryTree();\r\n\t\t\r\n\t\t// Temporary String array to store the node names of the old tree inorder\r\n\t\tString[] temp = new String[getCounter()];\r\n\t\tsetArrayCounter(0);\r\n\t\t\t\t\r\n\t\t// use the inorder method to store the node names in the String array\r\n\t\tinorder(temp ,getRoot());\r\n\t\t\r\n\t\t// Call the balance method recursive helper to insert the Nodes into the new Tree in a \"balanced\" order\r\n\t\tbalance(balancedTree, temp, 0, getCounter());\r\n\t\t\r\n\t\t// Make the root of the old tree point to the new tree\r\n\t\tsetRoot(balancedTree.getRoot());\r\n\t}", "public void refresh()\n\t{\n\t\tNode master = new Node(\"Tyler\");\n\t\t//master.add(new Node(\"Test\"));\n\t\tmaster.addParent(new Node(\"Clinton\"));\n\t\tmaster.addParent(new Node(\"Terry\"));\n\t\t\n\t\tmaster.add(\"Justin\", \"Terry\"); \n\t\tmaster.add(\"Justin\", \"Clinton\"); \n\t\t//this adds directly under Terry\n\t\t//maybe do this differently...\n\t\t\n\t\t\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"Diana\"));\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"George\"));\n\t\t\n\t\tmaster.add(new Node(\"Tyler 2.0\"));\n\t\tmaster.add(new Node(\"Tyler 3.0\"));\n\t\tmaster.add(new Node(\"Tyler Jr\"));\n\t\t\n\n\t\tmaster.add(\"Tyler Jr Jr\", \"Tyler 2.0\");\n\t\t\n\t\tmaster.add(\"Tyler 3.0\", \"Tyler Jr 2.0\");\n\t\t\n\t\tmaster.findNode(\"Clinton\").addParent(new Node(\"Eric\"));\n\t\tmaster.findNode(\"Eric\").addParent(new Node(\"Eric's Dad\"));\n\t\t\n\t\t\n\t\tmaster.findNode(\"Tyler Jr Jr\", 6).add(new Node(\"Mini Tyler\"));\n\t\t//master.findNode(\"Clinton\", 2).add(new Node(\"Justin\"));\n\t\t\n\t\t\n\t\tmaster.getParent().get(0).findNode(\"Justin\", 3).add(new Node(\"Mini Justin\"));\n\t\t\n\t\tmaster.add(new Node(\"Laptop\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Keyboard\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Mouse\"));\n\t\t\n\t\tmaster.add(\"Touchpad\", \"Laptop\");\n\t\t//master.add(\"Justin\", \"Eric\");\n\t\t\n\t\tmaster.add(\"Hunger\", \"Tyler\");\n\t\t\n\t\tselectedNode = master;\n\t\tselect(selectedNode);\n\t}", "Node insert(Node Node, int key) {\n if (Node == null) {\n return (new Node(key));\n }\n\n if (key < Node.key) {\n Node.left = insert(Node.left, key);\n } else {\n Node.right = insert(Node.right, key);\n }\n\n /* 2. Update height of this ancestor avl.Node */\n Node.height = max(height(Node.left), height(Node.right)) + 1;\n /* 3. Get the balance factor of this ancestor avl.Node to check whether\n this avl.Node became unbalanced */\n int balance = getBalance(Node);\n\n // If this avl.Node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && key < Node.left.key) {\n return rightRotate(Node);\n }\n\n // Right Right Case\n if (balance < -1 && key > Node.right.key) {\n return leftRotate(Node);\n }\n\n // Left Right Case\n if (balance > 1 && key > Node.left.key) {\n Node.left = leftRotate(Node.left);\n return rightRotate(Node);\n }\n\n // Right Left Case\n if (balance < -1 && key < Node.right.key) {\n Node.right = rightRotate(Node.right);\n return leftRotate(Node);\n }\n\n /* return the (unchanged) avl.Node pointer */\n return Node;\n }", "public MoveNode ab(PentagoBoardState pbs,int myscore, int alpha, int beta,int amimaxplayer, int depth,int requireddepth){\n\n int bestmovescore;\n PentagoMove bestmove;\n\n ArrayList<PentagoMove> legalmoves = pbs.getAllLegalMoves();\n Collections.shuffle(legalmoves); //helps avoid worst run time if all good moves are at the end of array list\n\n MoveNode moveNode =new MoveNode(new PentagoMove(0,0,0,0,0),0);\n\n if (depth==requireddepth){\n bestmovescore= evaluate(pbs);\n moveNode.MyMove = null;\n moveNode.value = evaluate(pbs);\n return moveNode;\n\n }\n else if (pbs.getWinner() != Board.NOBODY){ //check win since we are at leafnode\n bestmovescore= evaluate(pbs);\n moveNode.MyMove = null;\n int movescore = evaluate(pbs);\n if (movescore<-1200000){\n moveNode.value = -999999999; //assign loss value\n } //Losing Move\n else if (movescore>1200000){\n moveNode.value = 999999999; //assign win value\n } // Winning Move\n return moveNode;\n\n }\n //do max player\n if (amimaxplayer ==1){\n int currentvalue = -999999999;\n PentagoMove currentmove =legalmoves.get(0);\n MoveNode currentmovenode = new MoveNode(currentmove,currentvalue);\n for (int i = 0; i < legalmoves.size(); i++) {\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n PentagoMove movetoprocess = legalmoves.get(i);\n newboard.processMove(movetoprocess);\n\n\n MoveNode scoreAfterMove = ab(newboard, currentvalue, alpha, beta, 0, depth + 1, requireddepth); // run recursion till leaf node or depth reached\n if (scoreAfterMove.value > currentvalue) { //see if current best value is lower than the new value if so replace\n currentvalue = scoreAfterMove.value;\n currentmove = movetoprocess;\n currentmovenode.value = currentvalue;\n currentmovenode.MyMove = currentmove;\n\n //System.out.println(\"I am max plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue);\n\n }\n\n alpha = Math.max(alpha,currentvalue);\n if (alpha>=beta){ // break loop if alpha more than beta\n //System.out.println(\"Get pruned my alpha is \" + alpha + \" my beta is \" + beta );\n break;\n }\n }\n //System.out.println(\"I am max plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue+\" my alpha is \" + alpha + \" my beta is \" + beta);\n\n return currentmovenode;\n }\n //do min player\n else if (amimaxplayer==0){\n int currentvalue = 999999999;\n PentagoMove currentmove =legalmoves.get(0);\n MoveNode currentmovenode = new MoveNode(currentmove,currentvalue);\n for (int i = 0; i < legalmoves.size(); i++) {\n PentagoBoardState newboard = (PentagoBoardState) pbs.clone();\n PentagoMove movetoprocess = legalmoves.get(i);\n newboard.processMove(movetoprocess);\n\n MoveNode scoreAfterMove = ab(newboard, currentvalue, alpha, beta, 1, depth + 1, requireddepth);\n if (scoreAfterMove.value < currentvalue) {\n currentvalue = scoreAfterMove.value;\n currentmove = movetoprocess;\n currentmovenode.value = currentvalue;\n currentmovenode.MyMove = currentmove;\n //System.out.println(\"I am min plyaer at depth:\" + depth + \"\\n current move is: \" + currentmove + \"\\ncurrentvalue is: \" + currentvalue);\n }\n beta = Math.min(beta,currentvalue);\n if (alpha>=beta){\n //System.out.println(\"Get pruned my alpha is \" + alpha + \" my beta is \" + beta );\n break;\n }\n }\n return currentmovenode;\n }\n //System.out.println(\"move val \" + moveNode.value);\n return moveNode;\n }", "public void updateRoot(MachineState theState) {\n ;\n }", "AVLNode balanceTree(AVLNode Node){\r\n\t\tif(getDifference(Node) > 1){\r\n\t\t\tif(getDifference(Node.left)>0){\r\n\t\t\t\tNode = llCase(Node);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tNode = lrCase(Node);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(getDifference(Node)<-1){\r\n\t\t\tif(getDifference(Node.right)>0){\r\n\t\t\t\tNode = rlCase(Node);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tNode = rrCase(Node);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Node;\r\n\t}", "public void merge( int value )\n {\n BiNode loc = _root.findLeaf( value );\n\n //////////////////////////////////////////////////////////\n // Add code here to complete the merge\n //\n // The findLeaf( value ) method of BiNode will return the\n // leaf of the tree that has the range that includes value.\n // Invoke that method using the _root instance variable of\n //\n // Need to get to parent of that node, and get the sibling\n // of the one returned from findLeaf.\n //\n // Then use the 'getValues()' method to get the data points\n // for the found node and for its sibling. All of the data\n // points for both nodes must be added to the parent, AFTER\n // setting the parent's left and right links to null!\n //\n // Note that the sibling of a leaf node might not itself be\n // a leaf, so you'll be deleting a subtree. However, it's\n // straightforwad since the \"getValues()\" method when called\n // on an internal node will return all the values in all its\n // descendents.\n //\n ////////////////////////////////////////////////////////////\n BiNode parent = loc.parent;\n BiNode sibling = null;\n if( loc == parent._left )\n {\n sibling = parent._right;\n }\n else\n {\n sibling = parent._left;\n }\n parent._left = null;\n parent._right = null;\n for( int i = 0; i < loc.getValues( ).size( ); i++ )\n {\n parent.add( loc.getValues( ).get( i ) );\n }\n for( int j = 0; j < sibling.getValues( ).size( ); j++ )\n {\n parent.add( sibling.getValues( ).get( j ) );\n }\n\n\n\n }", "public V put(K key, V value){\n\t\tV v=null;\n\t\tNode n;\n\t\t\n\t\t\n\t\tif(root==null){\n\t\t\t\n\t\t\troot=new Node(key,value);\t\t\t\n\t\t\troot.parent=null;\n\t\t\t\n\t\t}\n\t\telse if(get(key)!=null){\n\t\t\t\n\t\t\tv=searchkey(root, key).value;\n\t\t\t\n\t\t\tsearchkey(root, key).value=value;\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tif(root.key.compareTo(key)>0){\n\t\t\t\tn=leftend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){if(t.key.compareTo(key)<0&&t!=root){break;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.left;\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=rightend(n);\n\t\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tn.right.parent=n;\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(root.key.compareTo(key)<0 ){\n\t\t\t\t\n\t\t\t\tn=rightend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){\n\t\t\t\t\tif(t.key.compareTo(key)>0 && t!=root){\n\t\t\t\t\t\tbreak;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.right;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\t\n\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\n\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=leftend(n);\n\t\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn v;\t\n\t}", "private static <K, V> void recursiveCloner(Position<Entry<K, V>> v, AVLTree<K, V> original, Position<Entry<K, V>> v2, AVLTree<K, V> NewTree) {\n\n if (original.hasLeft(v)) {\n NewTree.insertLeft(v2, original.left(v).element());\n recursiveCloner(original.left(v), original, NewTree.left(v2), NewTree);\n }\n if (original.hasRight(v)) {\n NewTree.insertRight(v2, original.right(v).element());\n recursiveCloner(original.right(v), original, NewTree.right(v2), NewTree);\n }\n if(v2.element()!=null) {\n \t//assign the height to current parent node\n\t\t\tNewTree.setHeight(v2);\n\t\t}\n }", "private void LLRotation(IAVLNode node)\r\n\t{\r\n\t\tIAVLNode parent = node.getParent(); \r\n\t\tIAVLNode leftChild = node.getLeft(); \r\n\t\tIAVLNode rightGrandChild = node.getLeft().getRight(); \r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\tif(node != root) \r\n\t\t{\r\n\t\t\tif(node == parent.getLeft()) \r\n\t\t\t\tparent.setLeft(leftChild);\r\n\t\t\telse \r\n\t\t\t\tparent.setRight(leftChild);\r\n\t\t}\r\n\t\tnode.setLeft(rightGrandChild); // rightGrandChild is now node's left child\r\n\t\trightGrandChild.setParent(node); // node becomes rightGrandChild's parent\r\n\t\tleftChild.setRight(node); // node is now leftChild's right child\r\n\t\tnode.setParent(leftChild); // node's parent is now leftChild\r\n\t\tleftChild.setParent(parent); // leftChild's parent is now node's old parent\r\n\t\t\r\n\t\t//updating sizes and heights\r\n\t\tnode.setSize(sizeCalc(node)); // updating node's size \r\n\t\tleftChild.setSize(sizeCalc(leftChild)); //updating leftChild's size\r\n\t\tleftChild.setHeight(HeightCalc(leftChild)); // updating leftChild's height\r\n\t\tnode.setHeight(HeightCalc(node)); // updating node's height\r\n\r\n\t\tif (node == root)\r\n\t\t\tthis.root = leftChild;\r\n\t}", "public static void setValue(Object tree, Map context, Object root, Object value)\n throws OgnlException {\n OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);\n Node n = (Node) tree;\n\n if (n.getAccessor() != null) {\n n.getAccessor().set(ognlContext, root, value);\n return;\n }\n\n n.setValue(ognlContext, root, value);\n }", "public void setRight(IAVLNode node);", "public void setRight(IAVLNode node);", "public void update(){\r\n try {\r\n TreePrinter.print(root);\r\n } catch (Exception e) {\r\n System.out.println(\"[Alert] Could not print diagram!\");\r\n }\r\n }", "public void update(Graph graph, Rule rule) {\n Term[] terms = rule.terms();\n Entry[][] matrix = graph.matrix();\n final double q = rule.getQuality().raw();\n\n for (int i = 0; i < terms.length; i++) {\n double value = matrix[terms[i].index()][0].value(0);\n matrix[terms[i].index()][0].set(0, value + (value * q));\n }\n\n // normilises the pheromone values (it has the effect of\n // evaporation for vertices that have not being updated)\n\n double total = 0.0;\n\n for (int i = 1; i < matrix.length; i++) {\n total += matrix[i][0].value(0);\n }\n\n for (int i = 1; i < matrix.length; i++) {\n double value = matrix[i][0].value(0);\n matrix[i][0].set(0, value / total);\n }\n }", "private void updateCategoryTree() {\n categoryTree.removeAll();\r\n fillTree(categoryTree);\r\n\r\n }", "public void updateNodeDataChanges(Object src) {\n\t}", "public static void setOldTree(RootedTree t) {\r\n\t\tsetOldNewickString(createNewickString(t)); // Added by Madhu, it is where I save the newick\r\n\t\t// string for the uploaded tree.\r\n\t\tSystem.out.println(\"OLD NODE:\" + getOldNewickString());\r\n\t\toldTree = t;\r\n\t}", "AVLNode llCase(AVLNode Node){\r\n\t\t\r\n\t\tAVLNode childL = Node.left;\r\n\t\tNode.left = childL.right;\r\n\t\tchildL.right = Node;\r\n\t\treturn childL;\r\n\t}", "protected void updateValues(){\n double total = 0;\n for(int i = 0; i < values.length; i++){\n values[i] = \n operation(minimum + i * (double)(maximum - minimum) / (double)numSteps);\n \n total += values[i];\n }\n for(int i = 0; i < values.length; i++){\n values[i] /= total;\n }\n }", "private void updateData(Multa ant, Multa multa) {\n\t}" ]
[ "0.58444625", "0.577749", "0.55634195", "0.5547832", "0.5542801", "0.5509363", "0.5473701", "0.5353664", "0.534179", "0.53414416", "0.53362554", "0.5336195", "0.53223205", "0.5313886", "0.530966", "0.53076005", "0.52769935", "0.527589", "0.5262119", "0.5254018", "0.5231753", "0.5224102", "0.52126575", "0.5198982", "0.51862746", "0.5185121", "0.5162951", "0.51605594", "0.5155109", "0.5148743", "0.5148067", "0.51138854", "0.51094824", "0.5096265", "0.50792885", "0.50671893", "0.5066307", "0.50582284", "0.50550866", "0.50528085", "0.50282806", "0.5025755", "0.50245243", "0.50180024", "0.5015804", "0.50021917", "0.49969453", "0.4996924", "0.49929634", "0.49929634", "0.49907833", "0.49815848", "0.49787706", "0.4971234", "0.49692956", "0.49692956", "0.4953075", "0.49515983", "0.49494234", "0.4940416", "0.49281347", "0.49190602", "0.4917692", "0.49040738", "0.48913142", "0.48694748", "0.48651823", "0.48565182", "0.48541245", "0.4853169", "0.48375785", "0.48322418", "0.48319486", "0.4830217", "0.48195153", "0.48178327", "0.48168373", "0.48154658", "0.48068064", "0.48060936", "0.48055083", "0.48050568", "0.48035726", "0.4798002", "0.4788922", "0.47864234", "0.4784643", "0.47817063", "0.4780781", "0.4780054", "0.4775762", "0.4773457", "0.4773457", "0.47717485", "0.47676998", "0.47586912", "0.47517553", "0.47512636", "0.47491068", "0.47409368", "0.4739706" ]
0.0
-1
FindNode method that finds a value in the tree given as a parameter
private boolean FindNode(int num, TreeNodeWrapper parent, TreeNodeWrapper child) { //set parent node of TreeNodeWrapper as Root parent.Set(Root); //set child node as TreeNode Wrapper as Root child.Set(Root); //if root is null, tree is empty if(Root == null) //tree is empty return true; //while loop which searches tree until empty child node is found while(child.Get() != null) { if(child.Get().Data == num) // node found return true; //if node not found use TreeNodeWrapper search remaining nodes else { parent.Set(child.Get()); if(num < child.Get().Data) child.Set(child.Get().Left); else child.Set(child.Get().Right); } } //return false if node not found return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BinaryNode<T> find(T v);", "@Override\n public Optional<Node<T>> findBy(T value) {\n Optional<Node<T>> rsl = Optional.empty();\n Queue<Node<T>> data = new LinkedList<>();\n data.offer(this.root);\n while (!data.isEmpty()) {\n Node<T> el = data.poll();\n if (el.eqValues(value)) {\n rsl = Optional.of(el);\n break;\n }\n for (Node<T> child : el.leaves()) {\n data.offer(child);\n }\n }\n return rsl;\n }", "@Override\n public Optional<Node<E>> findBy(E value) {\n Optional<Node<E>> rsl = Optional.empty();\n Queue<Node<E>> data = new LinkedList<>();\n data.offer(this.root);\n while (!data.isEmpty()) {\n Node<E> el = data.poll();\n if (el.eqValue(value)) {\n rsl = Optional.of(el);\n break;\n }\n for (Node<E> child : el.leaves()) {\n data.offer(child);\n }\n }\n return rsl;\n }", "public Node findNode(E val) {\n\t\tif (val == null) return null;\n\t\treturn findNode(root, val);\n\t}", "public static <E extends Comparable> TreeNode<E> findNode(TreeNode<E> root, E value) {\r\n TreeNode node = root;\r\n \r\n while(node != null) {\r\n int compare = value.compareTo(node.getValue());\r\n \r\n if(compare == 0) {\r\n return node;\r\n } else if(compare < 0) {\r\n node = node.getLeft();\r\n } else {\r\n node = node.getRight();\r\n }\r\n }\r\n \r\n return null;\r\n }", "public T search(T value) {\n\n if (root.getValue().compareTo(value) == 0) return root.getValue();\n else return searchRecursively(root, value).getValue();\n }", "public TreeNode find(Integer searchKey) {\n\t\treturn root.find(searchKey);\n\t}", "public Node searchSubTreeByValue(String value){\n\t\tArrayList<Node> childNodes = new ArrayList<Node>();\n\t\tchildNodes = this.getChildren(); // get children\n\t\tlastFounded = null;\n\t\tfor(Node resNode : childNodes){ // for each child\n\t\t\tif(resNode.value.equals(value)){ // if we find the searched value\n\t\t\t\tif(resNode.getChildren()==null){\n\t\t\t\t\treturn resNode;// we return the node if it has no children\n\t\t\t\t}else{// 50% to return the node if it has children\n\t\t\t\t\tlastFounded = resNode;// we save the node in case we don't find any matching not later.\n\t\t\t\t\treturn (new Random().nextInt(2)==0?resNode:resNode.searchSubTreeByValue(value));\n\t\t\t\t}\n\t\t\t\t//return resNode;\n\n\t\t\t}else if(resNode.getChildren()!=null && resNode.getChildren().size()>0){ // if node has children but has not value searched\n\t\t\t\treturn resNode.searchSubTreeByValue(value); // Recursively search value\n\t\t\t}\n\t\t}\n\t\tif(lastFounded != null)// if we founded matching nodes, we return the last matching node founded\n\t\t\treturn lastFounded;\n\t\treturn this.getSubTree(-1); // if we didn't find any matching node, we take random node \n\t}", "public boolean searchNode(int value) \n { \n return searchNode(header.rightChild, value); \n }", "public Node find(int val) {\r\n\r\n\t\tif (root == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tNode currentNode = root;\r\n\r\n\t\twhile (!currentNode.isLeaf()) {\r\n\t\t\tif (currentNode.getKey() == val) {\r\n\t\t\t\treturn currentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif (val < currentNode.getKey()) {\r\n\t\t\t\tcurrentNode = currentNode.getLeftChild();\r\n\t\t\t} else {\r\n\t\t\t\tcurrentNode = currentNode.getRightChild();\r\n\t\t\t}\r\n\t\t\tif (currentNode == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (currentNode.getKey() == val) {\r\n\t\t\treturn currentNode;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public TFNode findNode(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n\r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node;\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "Node search(int reqNodeValue){\r\n\t\tNode reqNode = this.root ;\r\n\t\t \r\n\t\twhile(reqNode != null && reqNode.value != reqNodeValue) {\r\n\t\t\tif(reqNode.value < reqNodeValue) {\r\n\t\t\t\treqNode = reqNode.right ; \r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treqNode = reqNode.left ;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(reqNode == null) {\r\n\t\t\tSystem.out.println(\"No such node exists in the tree\");\r\n\t\t}\r\n\t\treturn reqNode;\r\n\t}", "public BSTNode search(int value){ //The value to search for.\n BSTNode current = root;\n \n // While we don't have a match\n while(current!=null){\n \n // If the value is less than current, go left.\n if(value < current.value){\n current = current.left;\n }\n \n // If the value is more than current, go right.\n else if(value > current.value){\n current = current.right;\n }\n \n // We have a match!\n else{\n break;\n }\n }\n return current;\n }", "public Node find(int key) {\n Node current = root; // start at root\n while (current.iData != key) {\n // while no match\n if (key < current.iData)\n // go left\n current = current.leftChild;\n else\n current = current.rightChild;\n if (current == null) // if no child, didn't find it\n return null;\n }\n return current; // found it\n }", "public void testFind() {\r\n assertNull(tree.find(\"apple\"));\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n assertEquals(\"act\", tree.find(\"act\"));\r\n assertEquals(\"apple\", tree.find(\"apple\"));\r\n assertEquals(\"bagel\", tree.find(\"bagel\"));\r\n }", "public SkipNode find(String k, Integer val) {\n SkipNode node = head;\n\n while(true) {\n // Search right until a larger entry is found\n while( (node.right.key) != SkipNode.posInf && (node.right.value).compareTo(val) <= 0 ) {\n node = node.right;\n }\n\n // If possible, go down one level\n if(node.down != null)\n node = node.down;\n else\n break; // Lowest level reached\n }\n\n /**\n * If k is FOUND: return reference to entry containing key k\n * If k is NOT FOUND: return reference to next smallest entry of key k\n */\n return node;\n }", "private BinaryTreeNode findNode(T item) {\n\t\tif (item.equals(root.data)) {\n\t\t\treturn root;\n\t\t}\n\n\t\telse return findNodeRecursive(item, root);\n\t}", "@Override\r\n public Object findElement(Object key) {\r\n\r\n // Search for node possibly containing key\r\n TFNode node = search(root(), key);\r\n \r\n // Note the index of where the key should be\r\n int index = FFGTE(node, key);\r\n\r\n // If the index is greater than the number of items in the node, the key is not in the node\r\n if (index < node.getNumItems()) {\r\n // Look for key in node\r\n if (treeComp.isEqual(node.getItem(index).key(), key)) {\r\n return node.getItem(index);\r\n }\r\n }\r\n\r\n // The search hit a leaf without finding the key\r\n return null;\r\n }", "private static Node search(Node currentNode, Node nodeToFind) {\n\t\tif (currentNode != null) {\n\t\t\tNode leftNode = search(currentNode.leftChild, nodeToFind);\n\t\t\tNode rightNode = search(currentNode.rightChild, nodeToFind);\n\t\t\t\n\t\t\t// If either node is not null it means that the matching node has\n\t\t\t// been found in a previous recursion.\n\t\t\tif (leftNode != null || rightNode != null) {\n\t\t\t\treturn leftNode == null ? rightNode : leftNode; \n\t\t\t}\n\t\t\t// Otherwise we compare the current node values.\n\t\t\tif (currentNode.value == nodeToFind.value) {\n\t\t\t\treturn currentNode;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn null; // Return null if no match.\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public V find(K key) {\n Node<K,V> node = root;\n while (node != null) {\n int cmp = key.compareTo(node.key);\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n return node.value;\n }\n }\n return null;\n }", "private BinaryNode<E> _findNode(BinaryNode<E> node, E e) {\n\t\tif (node == null)\n\t\t\treturn null;\n\t\telse if (comparator.compare(e, node.getData()) < 0) // *****CHANGE THIS for HW#4*****\n\t\t\treturn _findNode(node.getLeftChild(), e);\n\t\telse if (comparator.compare(e, node.getData()) > 0) // *****CHANGE THIS for HW#4*****\n\t\t\treturn _findNode(node.getRightChild(), e);\n\t\telse // found it!\n\t\t\treturn node;\n\t}", "public Node find(int key) // find node with given key\n\t{ // (assumes non-empty tree)\n\t\tNode current = root; // start at root\n\t\tif(current == null) {\n\t\t\treturn null;\n\t\t}\n\t\twhile(current.iData != key) // while no match,\n\t\t{\n\t\t\tif(key < current.iData) // go left?\n\t\t\t\tcurrent = current.leftChild;\n\t\t\telse // or go right?\n\t\t\t\tcurrent = current.rightChild;\n\t\t\tif(current == null) // if no child,\n\t\t\t\treturn null; // didn't find it\n\t\t}\n\t\treturn current; // found it\n\t}", "public TValue find(TKey key) {\n Node n = bstFind(key, mRoot); // find the Node containing the key if any\n if (n == null || n == NIL_NODE)\n throw new RuntimeException(\"Key not found\");\n return n.mValue;\n }", "public BTNode<T> find ( T data ){\n\t\t//reset the find count\n\t\tfindCount = 0;\n\t\t \t\t\n\t\tif (root == null) \n\t\t\treturn null;\n \t\telse\n \t\treturn find (data, root);\n \t}", "public Reference search(int val) { // completely not sure\n\t\tReference ref = null;\n\t\t// This method will call findPtrIndex(val)\n\t\t// which returns the array index i, such that the ith pointer in the node points to the subtree containing val.\n\t\t// It will then call search() recursively on the node returned in the previous step.\n\t\tint ptrIndex = findPtrIndex(val);\n\t\tNode subNode = ptrs[ptrIndex];\n\t\tref = subNode.search(val); // return the reference pointing to a leaf node.\n\t\treturn ref;\n\t}", "private Node search(String name)\r\n\t{\r\n\t\t// Check to see if the list is empty\r\n\t\tif(isEmpty())\r\n\t\t{\r\n\t\t\t// Return null which will be checked for by the method that called it\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// Tree is not empty so use the recursive search method starting at the root reference \r\n\t\t// to find the correct Node containing the String name\r\n\t\treturn search(getRoot(), name);\r\n\t}", "public Node find(int id) {\n return tree.find(id);\n }", "public MyBinNode findNodeByValue(Type val){\n MyBinNode aux = this.root;\n while(aux.value.compareTo(val) != 0){\n if(aux.value.compareTo(val) > 0){\n aux = aux.left;\n }else{\n aux = aux.right;\n }\n if(aux == null){\n return null;\n }\n }\n return aux;\n }", "private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }", "public static Node find(Node node, int search_key){\n if(node!=null){ // node ที่รับมาต้องมีตัวตน\n if (search_key== node.key){ //ถ้าเจอ node ที่ตามหา ส่งค่าออกไป\n return node;\n }\n else if (search_key > node.key) { //ถ้า search_key มากกว่า node.key ตอนนี้ แสดงว่า อยู่ทางด้านขวา\n return find(node.right,search_key); // recursive โดยส่ง right-subtree\n }\n else{\n return find(node.left,search_key); // recursive โดยส่ง left-subtree\n }\n }\n else return null;\n\n }", "public int findItem(int value) {\n return find(value, root);\n }", "int indexOfChild(TreeNodeValueModel<T> child);", "public Node search(int key) {\n\t\t\t Node node=root;\n\t while (node!= nil){\n\t if(node.id==key){\n\t \treturn node;\n\t }\n\t else if(node.id<key){\n\t \tnode=node.right;\n\t }\n\t else{\n\t \tnode=node.left;\n\t } \n\t }\n\t //key not found in the tree\n\t return nil;\n\t }", "public Value find(Value key) {\n\t\tValue v = get(key);\n\t\tif (v != null)\n\t\t\treturn v;\n\t\tif (parent != null)\n\t\t\treturn parent.find(key);\n\t\treturn null;\n\t}", "public int searchByValue(T value) {\n Node<T> currNode = head;\n int index = 0;\n if (null != currNode) {\n while ((null != currNode.next) || (null != currNode.data)) {\n if (currNode.data == value) {\n break;\n }\n currNode = currNode.next;\n if (null == currNode) {\n return -1;\n }\n index++;\n }\n }\n return index;\n }", "private T bestValue(MatchTreeNode<T> node) {\n T value = null;\n if (node != null) {\n if (node.child(\"/\") != null) {\n value = node.child(\"/\").value();\n } else {\n value = bestValue(node.parent());\n }\n }\n return value;\n }", "public static<T> Optional<Node<T>> search(T value, Node<T> start ){\n\n Queue<Node> queue = new ArrayDeque<>();//inicializar cola\n queue.add(start);// se agraga a la cola el inicial\n\n Node<T> currentNode = null; //creacion de variable currenteNode\n\n Node<T> father = null;\n\n Set<Node<T>> closed = new HashSet<>(); //memoria //una coleccion de nodos existentes\n\n while(!queue.isEmpty()){ //1-verificar si puede continuar\n\n currentNode = queue.remove();\n\n System.out.println(\"Visitando el nodo... \" + currentNode.getValue()); //se convierte en string\n\n //2-verificar si se encuentra en la meta\n if(currentNode.getValue().equals(value)){\n return Optional.of(currentNode);\n }\n else{\n if (!closed.contains(currentNode)){ // existe o no en memoria (no repetir caminos.\n closed.add(currentNode); // 3-espacio explorado\n queue.addAll(currentNode.getNeighbors()); // sucesor // expande\n }\n queue.removeAll(closed);//elimina el recien visitado\n }\n\n }\n return Optional.empty();\n }", "public Node search(K key) {\n\t\tNode currentNode = this.mRoot;\n\t\t// start from the root of the tree that calls the method\n\t\twhile (currentNode != mSentinel && key.compareTo(currentNode.getKey()) != 0) {\n\t\t\t// if the current node is not empty and its key is not equal to the\n\t\t\t// search key\n\t\t\tif (key.compareTo(currentNode.getKey()) < 0) {\n\t\t\t\tcurrentNode = currentNode.getLeftChild();\n\t\t\t\t// go left if the search key is lower\n\t\t\t} else {\n\t\t\t\tcurrentNode = currentNode.getrightChild();\n\t\t\t\t// go right if the search key is higher\n\t\t\t}\n\t\t\t// break the loop if the search key matches the node key\n\t\t}\n\t\tif (currentNode == mSentinel) {\n\t\t\treturn null;\n\t\t\t// if there is not a match return nu;;\n\t\t} else {\n\t\t\treturn currentNode;\n\t\t\t// return the first node with the same key as the search key\n\t\t}\n\t}", "@Test\n public void whenSearchTwoThenResultIndexOne() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n nodeTwo.addChild(nodeThree, \"3\");\n assertThat(tree.searchByValue(\"4\"), is(\"Element not found\"));\n }", "private int find(int p1, int p2) {\n return id[p1 - 1][p2 - 1]; // find the current value of a node\n }", "public TreeNode find(Integer searchKey) {\n\t\tif(searchKey.equals(data)) {\n\t\t\treturn this;\n\t\t} else if(searchKey > data) {\n\t\t\tif(rightChild == null) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\treturn rightChild.find(searchKey);\n\t\t\t}\n\t\t} else {\n\t\t\tif(leftChild == null) {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\treturn leftChild.find(searchKey);\n\t\t\t}\n\t\t}\n\t}", "public RBNode<T> search(T key) {\r\n return search1(key);\r\n//\t\treturn search2(root, key); //recursive version\r\n }", "public Integer search(String k, Integer val) {\n SkipNode node = find(k, val);\n\n if( k.equals(node.getKey()) ) {\n System.out.println(k + \" found\");\n return node.value;\n }\n else {\n System.out.println(k + \" NOT FOUND\");\n return null;\n }\n }", "private Node searchNode(int id) {\n\t\tNode node = searchRec(root,id);\n\t\treturn node;\n\t}", "public BiNode findLeaf( int value )\n {\n return _root.findLeaf( value );\n }", "private BTNode<T> find ( T data, BTNode<T> node ){\n \t\tfindCount++;\n\t\tif (data.compareTo (node.getData()) == 0){\n \t\treturn node;\n\t\t}else {\n\t\t//findCount++;\n\t\tif (data.compareTo (node.getData()) < 0){\n \t\treturn (node.getLeft() == null) ? null : find (data, node.getLeft());\n\t\t}else{\n \t\treturn (node.getRight() == null) ? null : find (data, node.getRight());\n\t\t}\n\t\t}\n }", "@Override\n\tpublic int find(int pValueToFind) {\n\t\tfor (int n = 0; n < pointer; ++n) {\n\t\t\tif (values[n] == pValueToFind) {\n\t\t\t\t// this returns the index position\n\t\t\t\treturn n;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public Node nodeSearch(String s){\t \n\t int i=0;\n\t i++;\n\t if(this.children == null){\n\t\t//\t\tSystem.out.println(\"1\");\n\t\treturn null;\n\t }\n\t if(root.state.equals(s)){\n\t\t//System.out.println(\"2\");\n\t\treturn this;\n\t }\n\t Node v=null;\n\t for(String key:this.children.keySet()){\n\t\tNode nxt=this.children.get(key);\n\t\tif(key.equals(s)){\n\t\t // System.out.println(\"3\");\n\t\t return nxt;\n\t\t}\n\t\telse{\n\t\t v=nxt.nodeSearch(s);\n\t\t}\n\t }\n\n\t if(v!=null){\n\t\t//\t\tSystem.out.println(\"4\");\n\t\treturn v;\n\t }else{\n\t\t//System.out.println(\"5\");\t\t\n\t\treturn null;\n\t }\n\t}", "@Test\n public void whenSearchTwoThenResultLevelTwo() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n assertThat(tree.searchByValue(\"2\"), is(\"Element founded on level 2\"));\n }", "public void searchNode(int value) {\n int i = 1;\n boolean flag = false;\n Node current = head;\n if (head == null) {\n System.out.println(\"List is empty\");\n return;\n }\n while (current != null) {\n if (current.data == value) {\n flag = true;\n break;\n }\n current = current.next;\n i++;\n }\n if (flag)\n System.out.println(\"Node is present in the list at the position::\" + i);\n else\n System.out.println(\"Node is note present in the list\");\n }", "public String find(int key) {\n\t\t//YOUR CODE HERE\n\t\tif (root == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn find(key,root);\n\t}", "private AvlNode<E> find(Comparable<E> element, AvlNode<E> node){\n if(node == null) {\n return null;\n } else {\n comparisons++;\n if(node.value.compareTo((E)element) > 0){\n return find(element, node.left);\n } else if(node.value.compareTo((E)element) < 0){\n return find(element, node.right);\n } else {\n return node;\n }\n }\n }", "public Node findNode(Node search, Node node) {\n\n if (search == null) {\n return null;\n }\n if (search.data == node.data) {\n return search;\n } else {\n\n Node returnNode = findNode(search.leftChild, node);\n\n if (returnNode == null) {\n\n returnNode = findNode(search.leftChild, node);\n }\n\n return returnNode;\n }\n\n\n }", "@Test\n\tpublic void testFind() {\n\t\tBinarySearchTree binarySearchTree=new BinarySearchTree();\n\t\tbinarySearchTree.insert(3);\n\t\tbinarySearchTree.insert(2);\n\t\tbinarySearchTree.insert(4);\n\t\tassertEquals(true, binarySearchTree.find(3));\n\t\tassertEquals(true, binarySearchTree.find(2));\n\t\tassertEquals(true, binarySearchTree.find(4));\n\t\tassertEquals(false, binarySearchTree.find(5));\n\t}", "public static Node find(Node a){\n\t\tif(a.parent == null) return a;\n\t\treturn find(a.parent);\n\t}", "public Node searchItemAtNode(Node start, int value) {\n if (start == null)\n return null;\n if (value < start.value)\n return searchItemAtNode(start.left, value);\n if (value > start.value)\n return searchItemAtNode(start.right, value);\n\n return start;\n }", "boolean containsValue(Object toFind)\n\t\t{\n\t\t\tif(value != null && toFind.equals(value))\n\t\t\t\treturn true;\n\t\t\tif(nextMap == null)\n\t\t\t\treturn false;\n\t\t\tfor(Node<T> node : nextMap.values())\n\t\t\t\tif(node.containsValue(toFind))\n\t\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}", "public HTreeNode find (char value) {\r\n HTreeNode listrunner = getHeadNode();\r\n while (listrunner != null && listrunner.getCharacter() != value) {\r\n listrunner = listrunner.getNext();\r\n }\r\n return listrunner;\r\n }", "public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}", "public E find(E item){\n\t\tE found = find(item, root);\n\t\treturn found;\n\t}", "public static void main(String[] args) {\n Node root = newNode(1);\n\n root.left = newNode(2);\n root.right = newNode(3);\n\n root.left.left = newNode(4);\n root.left.right = newNode(5);\n\n root.left.left.left = newNode(8);\n root.left.left.right = newNode(9);\n\n root.left.right. left = newNode(10);\n root.left.right. right = newNode(11);\n\n root.right.left = newNode(6);\n root.right.right = newNode(7);\n root.right.left .left = newNode(12);\n root.right.left .right = newNode(13);\n root.right.right. left = newNode(14);\n root.right.right. right = newNode(15);\n System.out.println(findNode(root, 5, 6, 15));\n }", "private boolean search(BTNode r, T val)\r\n {\r\n if (r.getData() == val)\r\n return true;\r\n if (r.getLeft() != null)\r\n if (search(r.getLeft(), val))\r\n return true;\r\n if (r.getRight() != null)\r\n if (search(r.getRight(), val))\r\n return true;\r\n return false; \r\n }", "public NodeD find(Object data){\n if (this.isEmpty()){\n return null;\n }else{\n if (this.head.getObject()==data){\n return this.head;\n }else{\n NodeD tmp = this.head.getNext();\n\n while(tmp!=null){\n if (tmp.getObject()==data){\n return tmp;\n }\n tmp = tmp.getNext();\n }\n return null;\n }\n }\n }", "private static INodePO findNode(INodePO ownerNode,\n INodePO selectecNode) {\n Iterator childIt = ownerNode.getNodeListIterator();\n while (childIt.hasNext()) {\n INodePO child = (INodePO)childIt.next();\n if (child.getId().equals(selectecNode.getId())) {\n return child;\n }\n }\n return null;\n }", "private void valueSearch(int key, Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) {\n queueNodeSelectAnimation(null, \"Current Node null, desired Node not found\",\n AnimationParameters.ANIM_TIME);\n return;\n\n }\n\n // Finishes the traversal if the key has been found.\n if (currNode.key == key) {\n queueNodeSelectAnimation(currNode, key + \" == \"\n + currNode.key + \", desired Node found\",\n AnimationParameters.ANIM_TIME);\n\n }\n // Explores the left subtree.\n else if (key < currNode.key) {\n for (int i = 0; i < numChildren / 2; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" < \" + currNode.key +\n \", exploring left subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n // Explores the right subtree.\n else {\n for (int i = numChildren / 2; i < numChildren; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" > \" + currNode.key +\n \", exploring right subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n }", "private Node findNode(Node node, String name) {\n Node temp = node;\n\n if (temp.getNext() != null && name.compareTo(temp.getNext().getState().getName()) > 0) {\n temp = findNode(temp.getNext(), name);\n }\n return temp;\n }", "public V find (K key) throws KeyNotFoundException {\n\t\treturn findKey(root, key);\n\t}", "private SkipNode<K, V> findNode(Object key) {\n\t\tSkipNode<K, V> nodeOut;\n\t\tnodeOut = headNode;\n\t\twhile (true) {\n\t\t\twhile ((nodeOut.getNext().getKey()) != posInf\n\t\t\t\t\t&& (nodeOut.getNext().getKey()).compareTo((Integer) key) <= 0)\n\t\t\t\tnodeOut = nodeOut.getNext();\n\t\t\tif (nodeOut.getDown() != null)\n\t\t\t\tnodeOut = nodeOut.getDown();\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t\treturn nodeOut;\n\t}", "private static Node mrvFindNode() {\n\t\tif (constrainedNodes.size() == 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t// Was able to use this by 'implementing Comparable'\r\n\t\t// in the Node class\r\n\t\t// return max value node of constrained nodes\r\n\t\treturn Collections.max(constrainedNodes);\r\n\r\n\t}", "public Node<T> find(T data) {\n Node<T> current = this.root;\n Node<T> toFind = new Node<>(data);\n\n while (current != null && current.getData() != data) {\n if (toFind.compareTo(current) < 1) {\n current = current.getLeft();\n }\n else {\n current = current.getRight();\n }\n }\n return current;\n }", "public Node<E> findNode(int index){\t\r\n\t\tcheckIndex(index);\r\n\t\tint k = 0;\r\n\t\tNode<E> foundNode = headNode;\r\n\t\twhile(k < index - 1) {\r\n\t\t\tfoundNode = foundNode.link;\r\n\t\t}\r\n\t\t\r\n\t\treturn foundNode;\r\n\t}", "public void searchNode(int value) { \r\n int i = 1; \r\n boolean flag = false; \r\n //Node current will point to head \r\n Node current = head; \r\n \r\n //Checks whether the list is empty \r\n if(head == null) { \r\n System.out.println(\"List is empty\"); \r\n return; \r\n } \r\n while(current != null) { \r\n //Compare value to be searched with each node in the list \r\n if(current.data == value) { \r\n flag = true; \r\n break; \r\n } \r\n current = current.next; \r\n i++; \r\n } \r\n if(flag) \r\n System.out.println(\"Node is present in the list at the position : \" + i); \r\n else \r\n System.out.println(\"Node is not present in the list\"); \r\n }", "public static Node getFindChildNode(Node node, String id, String value)\r\n\t{\r\n\t\t\r\n\t\tNodeList listNode = ((Element)node).getElementsByTagName(id);\r\n\t\t\r\n\t\tif ( listNode.getLength() != 0 )\r\n\t\t{\r\n\t\t\tint i=0;\r\n\t\t\tdo \r\n\t\t\t{\r\n\t\t\t\tif ( getNodeValue(listNode.item(i)).equals(value) )\r\n\t\t\t\t{\r\n\t\t\t\t\treturn listNode.item(i).getParentNode();\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\twhile ( i<listNode.getLength() );\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public TreeNode<T> Search(TreeNode<T> n, T s){\n if(n == null || n.elem.equals(s)) {return n;}\n else if(s.compareTo(n.elem) < 0) {return Search(n.left, s);}\n else {return Search(n.right, s);}\n\n }", "public int Fetch(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree \r\n\t\tboolean found;\r\n\t\t//initialize the parent node\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\t\t//initialize the child node\r\n\t\tTreeNodeWrapper c = new TreeNodeWrapper();\r\n\t\t//found set to true if FindNode methods locates value in the tree\r\n\t\tfound = FindNode(num, p, c); //locate the node\r\n\t\t//if found is true print success message and return value of node\r\n\t\tif(found == true)\r\n\t\t\t{ System.out.println(\"The number you entered was found in the tree\");\r\n\t\t\treturn c.Get().Data; }\r\n\t\telse\r\n\t\t//if found is false print message that value not found and return integer not found\r\n\t\t\t{ System.out.println(\"\\nThe number you entered is not in tree.\");\r\n\t\t\treturn num; }\r\n\t}", "public BinaryTree<E> find(E item) \r\n\t{\r\n\t\treturn finderHelper(item, root);\r\n\t}", "public Reference search (String val) {\n Node nextPtr = ptrs[this.findPtrIndex(val)];\n return nextPtr.search(val);\n }", "boolean searchValueExists(int i){\t\r\n\t\tthis.searchedNode = search(this.root, i);\r\n\t\tif(this.searchedNode != null){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private K lookup(BSTnode<K> n, K key) {\n\t\tif (n == null) {// if key is not present\n\t\t\treturn null;\n\t\t}\n\t\tif (key.equals(n.getKey())) {// if key is present, return the match to\n\t\t\t\t\t\t\t\t\t\t// be incremented\n\t\t\treturn n.getKey();\n\t\t}\n\t\tif (key.compareTo(n.getKey()) < 0) {\n\t\t\t// key < this node's key; look in left subtree\n\t\t\treturn lookup(n.getLeft(), key);\n\t\t}\n\n\t\telse {\n\t\t\t// key > this node's key; look in right subtree\n\t\t\treturn lookup(n.getRight(), key);\n\t\t}\n\t}", "private Node<Pair<K, V>> findItem(K key) {\n Node<Pair<K, V>> result = null;\n\n int hash1 = hash1(key);\n\n if (table[hash1] != null) {\n Node<Pair<K, V>> node = search(table[hash1].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n int hash2 = hash2(key);\n\n if (table[hash2] != null && result == null) {\n Node<Pair<K, V>> node = search(table[hash2].list, key);\n\n if (node != null) {\n result = node;\n }\n }\n\n return result;\n }", "public Node<T> search(int id) {\n Node<T> res = root;\n res = search(res, id);\n if (res.getId() == id) return res;\n else return null;\n }", "public Node<E> search(E data){\n\tNode<E> tempNode = root; //becomes the root\n\twhile (tempNode != sentinel) {\n\t\tif (tempNode.getData().compareTo(data) == 0) {\n\t\t\treturn tempNode;\n\t\t} else if (tempNode.getData().compareTo(data) > 0) {\n\t\t\ttempNode = tempNode.getLeftChild();\n\t\t} else if (tempNode.getData().compareTo(data) < 0) {\n\t\t\ttempNode = tempNode.getRightChild();\n\t\t}\n\t}\n\treturn null;\n }", "TreeNode returnNode(TreeNode node);", "private E find(E item, Node<E> root){\n\t\t/** item not found */\n\t\tif(root == null){\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tint comparison = item.compareTo(root.item);\n\t\t\n\t\t/** item found */\n\t\tif(comparison == 0){\n\t\t\treturn root.item;\n\t\t}\n\t\t/** item less than that of root */\n\t\telse if(comparison < 0){\n\t\t\treturn find(item, root.left);\n\t\t}\n\t\t/** item greater than that of root */\n\t\telse{\n\t\t\treturn find(item, root.right);\n\t\t}\n\t}", "public Node findSuccessor(int id);", "public E find(E target) {\r\n\t\treturn find(root, target);\r\n\t}", "public void search(int value, Node start) {\r\n\t\tif (start == null) {\r\n\t\t\tSystem.out.println(\"node is not found\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (value == start.value) {\r\n\t\t\tSystem.out.println(\"node is found\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (value == start.value) {\r\n\t\t\tSystem.out.println(\"node is found\");\r\n\t\t}\r\n\r\n\t\t// if value is greater than current node value, it will be set to right\r\n\t\t// side\r\n\t\tif (value > start.value) {\r\n\t\t\tsearch(value, start.right);\r\n\t\t}\r\n\r\n\t\t// if value is less than current node value, it will be set to left side\r\n\t\tif (value < start.value) {\r\n\t\t\tsearch(value, start.left);\r\n\t\t}\r\n\t}", "private V get(TreeNode<K, V> node, K key){\n if(node == null){\r\n return null;\r\n }\r\n \r\n // Compare the key passed into the function with the keys in the tree\r\n // Recursive function calls determine which direction is taken\r\n if (node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n return get(node.left, key);\r\n }\r\n else if (node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n return get(node.right, key);\r\n }\r\n else{\r\n // If the keys are equal, a match is found return the value\r\n return node.getValue();\r\n }\r\n }", "public static TreeNode insertIntoBST(TreeNode root, int val)\n{\n TreeNode droot = root;\n TreeNode par = find(droot, val, null);\n if(par==null)\n return par;\n if(par.val < val)\n par.right = new TreeNode(val);\n else\n par.left = new TreeNode(val);\n return root;\n}", "private BTNode search(BTNode btNode, DataPair key) {\n int i =0;\n while (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i]) > 0)\n i++;\n\n if (i < btNode.mCurrentKeyNum && key.compareTo(btNode.mKeys[i])==0)\n return btNode;//btNode.mKeys[i];\n if (btNode.mIsLeaf)\n return null;\n return search(btNode.mChildren[i],key);\n }", "public String getNodeValue(Node node) throws Exception;", "private RadixTree find(Signature key) {\n if (key.isEmpty()) {\n return this;\n } else {\n for (Signature label : children.keySet()) {\n if (label.equals(key)) {\n return children.get(label);\n } else if (label.isPrefix(key)) {\n RadixTree child = children.get(label);\n int len = label.size();\n return child.find(key.suffix(len));\n }\n }\n }\n\n return null;\n }", "public HPTNode<K, V> search(List<K> key) {\n check(key);\n int size = key.size();\n\n // Start at the root, and only search lower in the tree if it is\n // large enough to produce a match.\n HPTNode<K, V> current = root;\n for (int i = 0; i < size; i++) {\n if (current == null || (size - i) > current.maxDepth()) {\n return null;\n }\n current = find(current, i, key.get(i), false);\n }\n if (current == null || current.values == null) {\n return null;\n }\n return current.values.isEmpty() ? null : current;\n }", "public boolean search(T val)\r\n {\r\n return search(root, val);\r\n }", "public int search(T value) {\n\t\tif(head!=null) {\n\t\t\tNode<T> current=head;\n\t\t\tint i=0;\n\t\t\twhile(current!=null && current.getValue()!=value) {\n\t\t\t\ti++;\n\t\t\t\tcurrent=current.getNext();\n\t\t\t}\n\t\t\tif(i >= size) return -1;\n\t\t\treturn i;\n\t\t}\n\t\treturn -1;\n\t}", "@Override\r\n public E find(E target) {\r\n return findHelper(root,target,0);\r\n }", "public BSTNode<E> find (E item) {\r\n\t\tBSTNode<E> pointer = this;\r\n\t\twhile (pointer != null) {\r\n\t\t\tif (pointer.value.compareTo(item) == 0) {\r\n\t\t\t\treturn pointer;\r\n\t\t\t}\r\n\t\t\tif (pointer.value.compareTo(item) > 0) {\r\n\t\t\t\tpointer = pointer.left;\r\n\t\t\t}else if (pointer.value.compareTo(item) < 0) {\r\n\t\t\t\tpointer = pointer.right;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public MyBinaryNode<K> search(K key) {\n\t\t\n\t\treturn searchRecursive(root, key);\n\t}", "Object get(Node node);", "public boolean search(int value)\n{\n if(head==null)\n return false;\nelse\n{\n Node last=head;\n while(last.next!=null)\n{\n if(last.data==value)\n return true;\n\nlast=last.next;\n}\nreturn false;\n}\n}" ]
[ "0.7506734", "0.72539115", "0.72521406", "0.7240446", "0.7074273", "0.70583385", "0.7052432", "0.6977954", "0.6948312", "0.6914631", "0.6865563", "0.6863409", "0.6734918", "0.6699729", "0.66943437", "0.66807246", "0.66728103", "0.66546804", "0.6653322", "0.6640145", "0.66306597", "0.6626309", "0.660158", "0.65852183", "0.65769255", "0.6552707", "0.65501004", "0.6517653", "0.65102136", "0.65099406", "0.64949507", "0.649339", "0.64416444", "0.64388627", "0.642619", "0.64230525", "0.6417796", "0.6400399", "0.639088", "0.6381251", "0.6369509", "0.6337146", "0.63259405", "0.632545", "0.6322933", "0.63227886", "0.63213307", "0.6308766", "0.6305638", "0.6299293", "0.6297182", "0.6288854", "0.6288803", "0.6281548", "0.6263662", "0.6249853", "0.6228314", "0.62159675", "0.6196914", "0.6184163", "0.61764646", "0.61520946", "0.61496615", "0.613351", "0.6133381", "0.6124032", "0.61190385", "0.61164683", "0.61071885", "0.61051476", "0.60855", "0.6081239", "0.6074288", "0.6069084", "0.6045179", "0.60202104", "0.60182196", "0.60100895", "0.60062253", "0.59969735", "0.59966844", "0.5982569", "0.5975884", "0.59680766", "0.59666955", "0.59659255", "0.596386", "0.59564763", "0.59467953", "0.5946274", "0.5944244", "0.5939766", "0.593426", "0.5926321", "0.59216714", "0.59209216", "0.5920648", "0.59154683", "0.59114397", "0.59096944" ]
0.6185567
59
TraverseLNR method traverses tree from left subtree, root, then right subtree and outputs the values
public void TraverseLNR(TreeNode Root) { if(Root.Left != null) TraverseLNR(Root.Left); System.out.println(Root.Data); if(Root.Right != null) TraverseLNR(Root.Right); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void TraverseLRN(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\t\r\n\t}", "public void TraverseRNL(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public void TraverseNLR(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public static void main(String[] args) {\n TreeNode node = new TreeNode();\n node.value = 1;\n node.left = new TreeNode();\n node.left.value = 2;\n node.right = new TreeNode();\n node.right.value = 3;\n node.left.left = new TreeNode();\n node.left.left.value = 4;\n node.left.right = new TreeNode();\n node.left.right.value = 5;\n node.right.left = new TreeNode();\n node.right.left.value = 6;\n node.right.right = new TreeNode();\n node.right.right.value = 7;\n// System.out.println(mirro(node).value);\n// System.out.println(mirro(node).left.value);\n// System.out.println(Arrays.toString(LevelPrintTree.levelPrint(mirro(node))));\n\n recur(node);\n\n }", "public void TraverseRLN(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t}", "public void TraverseNRL(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "@Test\r\n\tpublic void test(){\r\n\t\tTreeNode root = new TreeNode(1); \r\n TreeNode r2 = new TreeNode(2); \r\n TreeNode r3 = new TreeNode(3); \r\n TreeNode r4 = new TreeNode(4); \r\n TreeNode r5 = new TreeNode(5); \r\n TreeNode r6 = new TreeNode(6); \r\n root.left = r2; \r\n root.right = r3; \r\n r2.left = r4; \r\n r2.right = r5; \r\n r3.right = r6;\r\n System.out.println(getNodeNumRec(root));\r\n System.out.println(getNodeNum(root));\r\n System.out.println(getDepthRec(root));\r\n System.out.println(getDepth(root));\r\n System.out.println(\"前序遍历\");\r\n preorderTraversalRec(root);\r\n System.out.println(\"\");\r\n preorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"中序遍历\");\r\n inorderTraversalRec(root);\r\n System.out.println(\"\");\r\n inorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"后序遍历\");\r\n postorderTraversalRec(root);\r\n System.out.println(\"\");\r\n postorderTraversal(root);\r\n System.out.println(\"分层遍历\");\r\n levelTraversal(root);\r\n System.out.println(\"\");\r\n levelTraversalRec(root);\r\n\t}", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public void reverseLevelOrderTraversel(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tQueue<TreeNode> que = new LinkedList<>();\r\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\r\n\t\t\r\n\t\tque.add(root);\r\n\t\twhile(que.size()>0)\r\n\t\t{\r\n\t\t\tTreeNode element=que.remove();\r\n\t\t\tif(element.right!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.right);\r\n\t\t\t}\r\n\t\t\tif(element.left!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.left);\r\n\t\t\t}\r\n\t\t\tstack.push(element);\r\n\t\t}\r\n\t\twhile(stack.size()>0)\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop().data+\" \");\r\n\t\t}\r\n\t\t\t\r\n\t}", "public static void leftToRight(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n leftToRight(root.left, level-1);\n leftToRight(root.right, level-1);\n }\n\n }", "public static void main(String[] args) {\n // TODO Auto-generated method stub\n int[] nums = {3, 2, 1, 6, 0, 5};\n TreeNode root = solution2(nums);\n System.out.println(root.val);\n System.out.println(root.left.val);\n System.out.println(root.left.right.val);\n System.out.println(root.left.right.right.val);\n System.out.println(root.right.val);\n System.out.println(root.right.left.val);\n System.out.println(root.right.right);\n }", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "private int treeTraverse (TreeNode root, int previousVal) {\n if (root == null)\n return 0;\n \n // traverse left, then right\n int left = treeTraverse(root.left, root.val);\n int right = treeTraverse(root.right, root.val);\n \n // calculate the longest path\n path = Math.max(left + right, path);\n\n //return\n if (root.val == previousVal) \n return Math.max(left, right) + 1;\n \n return 0;\n }", "public static void main(String[] args) {\n TreeNode n7 = new TreeNode(7);\n TreeNode n6 = new TreeNode(6);\n TreeNode n5 = new TreeNode(5);\n TreeNode n4 = new TreeNode(4);\n TreeNode n3 = new TreeNode(3);\n TreeNode n2 = new TreeNode(2);\n TreeNode n1 = new TreeNode(1);\n\n n4.left = n2;\n n4.right = n6;\n\n n2.left = n1;\n n2.right = n3;\n\n n6.left = n5;\n n6.right = n7;\n\n System.out.println(\"Cay n4\");\n List<Integer> resultPreOrder = preOrderTravel(n4);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n\n System.out.println(\"Cay n2\");\n resultPreOrder = preOrderTravel(n2);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n }", "public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }", "public void leftViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == queue.size()) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n\n }", "private Voter traverseRBT(RedBlackTree.Node<Voter> root, Date birthdate) {\r\n \r\n RedBlackTree.Node<Voter> currentNode = root;\r\n //no voter in the database so none can be gotten\r\n if (currentNode == null) {\r\n throw new NoSuchElementException(\"There is no voter in the database\");\r\n }\r\n \r\n // if the current node matches that of that of the birthdate, return that node\r\n if (currentNode.data.compareTo(new Voter(birthdate)) == 0) {\r\n return currentNode.data;\r\n \r\n //if the current node does not match traverse down the subtrees\r\n \r\n } else if (currentNode.data.compareTo(new Voter(birthdate)) > 0) {\r\n // left subtree\r\n return traverseRBT(currentNode.leftChild, birthdate); //recursively traverse through left subtree\r\n } else {\r\n // right subtree\r\n return traverseRBT(currentNode.rightChild, birthdate); //recursively traverse through right subtree\r\n }\r\n }", "public void rightViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == 0) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n }", "public void printLRDNodes(Node N) {\n if(N != null) {\n printLRDNodes(N.getLeft());\n printLRDNodes(N.getRight());\n System.out.print(N.getData() + \" \");\n }\n }", "public static void main(String[] args) { Scanner scanner = new Scanner(System.in);\n// System.out.println(\"Please read number of levels for tree: \");\n// int n = scanner.nextInt();\n//\n// System.out.println(\"The tree will have \" + n + \" levels\");\n//\n Tree tree = new Tree();\n// tree.generateDefaultTree(n);\n tree.readUnbalancedTree();\n System.out.println(\"Display NLR:\");\n tree.showTreeNLR(tree.root);\n System.out.println();\n System.out.println(\"Display LNR\");\n tree.showTreeLNR(tree.root);\n System.out.println();\n System.out.println(\"Display LRN\");\n tree.showTreeLRN(tree.root);\n }", "public static void main(String[] args){\n\t\tTreeNode node1 = new TreeNode(1);\n\t\tTreeNode node2 = new TreeNode(2);\n\t\tTreeNode node3 = new TreeNode(3);\n\t\tTreeNode node4 = new TreeNode(4);\n\t\tTreeNode node5 = new TreeNode(5);\n\t\tTreeNode node6 = new TreeNode(6);\n\t\tTreeNode node7 = new TreeNode(7);\n\t\tnode4.left = node2;\n\t\tnode4.right = node6;\n\t\tnode2.left = node1;\n\t\tnode2.right = node3;\n\t\tnode6.left = node5;\n\t\tnode6.right = node7;\n\t\t/*\n\t\t * 4\n\t\t * /\n\t\t * 5\n\t\t * \\\n\t\t * 6\n\t\t */\n\t\t/*node4.left = node5;\n\t\tnode5.right = node6;*/\n\t\t\n\t\ttreeTraversal2 tt = new treeTraversal2();\n\t\tSystem.out.print(\"Inorder Rcur: \");tt.inorderTraverse(node4);//1234567\n\t\tSystem.out.println();\t\t\n\t\tSystem.out.print(\"Inorder Iter: \");tt.stackInorder(node4);//1234567\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Rcur: \");tt.preorderTraverse(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Iter: \"); tt.stackPreorder(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Postorder Rcur: \");tt.postorderTraverse(node4);//1325764\n\t\tSystem.out.println();\t\t \n\t\tSystem.out.print(\"Postorder Iter: \");tt.stackPostorder(node4);//1325764\n\t\t//System.out.println();\n\t\t//System.out.print(\"Postorder Iter: \");tt.twoStackPostorder(node4);//1325764\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Level Iter: \");tt.levelTraverse(node4);//4261357\n\t}", "TreeNode<T> getLeft();", "public static void main(String[] args){\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.right = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.right = new TreeNode(4);\n root.right.left = new TreeNode(4);\n root.right.right = new TreeNode(6);\n \n System.out.println(levelOrder(root)); // output: [[1], [2, 2], [6, 4, 4, 6]]\n }", "public List<Integer> rightSideView(TreeNode root) {\n List<Integer> r = new ArrayList<>();\n LinkedList<LinkedList<Integer>> levelOrder = new LinkedList<>();\n LinkedList<TreeNode> queue = new LinkedList<>();\n if(root == null) return r;\n queue.offer(root);\n while(!queue.isEmpty()){\n int size = queue.size();\n LinkedList<Integer> res = new LinkedList<>();\n for(int i=0;i<size;i++){\n TreeNode cur = queue.pop();\n res.add(cur.val);\n if(cur.left != null) queue.offer(cur.left);\n if(cur.right != null) queue.offer(cur.right);\n }\n levelOrder.add(res);\n }\n //2. store the last element of each list\n LinkedList<Integer> ans = new LinkedList<>();\n for(LinkedList<Integer> l : levelOrder){\n int s = l.get(l.size() - 1);\n ans.add(s);\n }\n return ans;\n }", "public static void main(String[] args) {\n\t\tBinary_Tree_Level_Order_Traversal_102 b=new Binary_Tree_Level_Order_Traversal_102();\n\t\tTreeNode root=new TreeNode(3);\n\t\troot.left=new TreeNode(9);\n\t\troot.right=new TreeNode(20);\n\t\troot.right.left=new TreeNode(15);\n\t\troot.right.right=new TreeNode(7);\n\t\tList<List<Integer>> res=b.levelOrder(root);\n\t\tfor(List<Integer> list:res){\n\t\t\tfor(Integer i:list){\n\t\t\t\tSystem.out.print(i+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "int query_tree(int v, int l, int r, int tl, int tr) {\n int ans = query(1, l, r, r, tl, tr);\n return r - l + 1 - ans;\n }", "public void traverse(Node root){\n\t\tNode pred, current;\n\t\tcurrent=root;\n\t\tint rank=10;\n\t\tint rankCount=1;\n\t\twhile(current!=null){\n\t\t\tif(current.left==null){\n\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\trankCount++;\n\t\t\t\tcurrent=current.right;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpred=current.left;\n\t\t\t\twhile(pred.right!=null && pred.right!=current){\n\t\t\t\t\tpred=pred.right;\n\t\t\t\t}\n\n\t\t\t\tif(pred.right==null){\n\t\t\t\t\tpred.right=current;\n\t\t\t\t\tcurrent=current.left;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tpred.right=null;\n\t\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\trankCount++;\n\t\t\t\t\tcurrent=current.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String args[]){\n BinaryTreeNode root = new BinaryTreeNode();\n root.setData(1);\n\n BinaryTreeNode left = new BinaryTreeNode();\n left.setData(2);\n\n BinaryTreeNode right = new BinaryTreeNode();\n right.setData(3);\n\n BinaryTreeNode leftleft = new BinaryTreeNode();\n leftleft.setData(4);\n\n BinaryTreeNode leftright = new BinaryTreeNode();\n leftright.setData(5);\n\n root.setLeft(left);\n root.setRight(right);\n left.setLeft(leftleft);\n left.setRight(leftright);\n\n\n postOrderIterative(root);\n\n }", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "public static void main(String[] args) {\n\n TreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n TreeNode node8 = new TreeNode(8);\n node1.right=node3;\n node1.left=node2;\n node2.left=node4;\n node3.right=node5;\n node4.right=node6;\n node6.left=node7;\n node6.right=node8;\n traversalRecursion(node1);\n System.out.println();\n nonRecurInTraverse(node1);\n }", "public static void main(String[] args) {\n \n LinkedBinaryTree expr = new LinkedBinaryTree<String>();\n // a is the root of the tree\n Position a, b, c, d, e, f, g, h, i;\n a = expr.addRoot(\"*\");\n b = expr.addLeft(a, \"+\");\n c = expr.addLeft(b, \"/\");\n d = expr.addLeft(c, \"*\");\n e = expr.addLeft(d, \"+\");\n expr.addLeft(e, \"5\");\n expr.addRight(e, \"2\");\n f = expr.addRight(d, \"-\");\n expr.addLeft(f, \"2\");\n expr.addRight(f, \"1\");\n g = expr.addRight(c, \"+\");\n expr.addLeft(g, \"2\");\n expr.addRight(g, \"9\");\n h = expr.addRight(b, \"-\");\n i = expr.addLeft(h, \"-\");\n expr.addLeft(i, \"7\");\n expr.addRight(i, \"2\");\n expr.addRight(h, \"1\");\n expr.addRight(a, \"8\");\n \n System.out.println(\"The original expression:\");\n System.out.println(\"(((5+2)*(2–1)/(2+9)+((7–2)–1))*8)\\n\");\n \n System.out.println(\"Preorder traversal:\");\n Iterable<Position<String>> preIter = expr.preorder();\n for (Position<String> s : preIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Inorder traversal:\");\n Iterable<Position<String>> inIter = expr.inorder();\n for (Position<String> s : inIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Postorder traversal:\");\n Iterable<Position<String>> postIter = expr.postorder();\n for (Position<String> s : postIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Breadth traversal:\");\n Iterable<Position<String>> breadthIter = expr.breadthfirst();\n for (Position<String> s : breadthIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Parenthesized representation:\"); \n printParenthesize(expr, a);\n System.out.println();\n }", "public static void main(String args[])\n {\n /* creating a binary tree and entering the nodes */\n BinaryTree tree = new BinaryTree();\n tree.root = new TNode(12);\n tree.root.left = new TNode(10);\n tree.root.right = new TNode(30);\n tree.root.right.left = new TNode(25);\n tree.root.right.right = new TNode(40);\n tree.rightView();\n max_level=0;\n tree.leftView();\n }", "private TraverseData traverse(int treeIndex) {\n Node<T> newRoot = new Node<>(branchingFactor);\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData data = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, b));\n currentNode = data.currentNode;\n currentNewNode = data.currentNewNode;\n treeIndex = data.index;\n }\n return new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, 1);\n }", "public static void rightToLeft(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n rightToLeft(root.right, level-1);\n rightToLeft(root.left, level-1);\n }\n }", "public static void main(String[] args) {\n String levelNodes = \"1,2,3,#,#,4,#,#,#\";\n TreeNode<String> level = of(levelNodes, \"#\", TraverseType.LEVEL);\n System.out.println(level);\n\n\n String postNodes = \"#,#,2,#,#,4,#,3,1\";\n TreeNode<String> post = of(postNodes, \"#\", TraverseType.POST);\n System.out.println(post);\n\n\n String preNodes = \"1,2,#,#,3,4,#,#,#\";\n TreeNode<String> pre = of(preNodes, \"#\", TraverseType.PRE);\n System.out.println(pre);\n }", "public void printRightView(){\n \n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n Node<T> lastVal = null;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n\n // keep track of last node and dont print it\n lastVal = node;\n\n // Enqueue left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // print last node\n System.out.println(lastVal.data + \" ,\");\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "void leftViewUtil(TNode TNode, int level)\n {\n // Base Case\n if (TNode == null)\n return;\n\n // If this is the first node of its level\n if (max_level < level) {\n System.out.print(\" \" + TNode.data);\n max_level = level;\n }\n\n // Recur for left and right subtrees\n leftViewUtil(TNode.left, level + 1);\n leftViewUtil(TNode.right, level + 1);\n }", "public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }", "public int sumOfLeftLeaves(BinaryTree root) {\n\n if (root == null) {\n return 0;\n }\n if (root.left == null && root.right == null) {\n System.out.println(\"Sum of all the left Nodes is : \" + lsum);\n return 0;\n }\n subTreeSum(root, false);\n System.out.println(\"Sum of all the left Nodes is : \" + lsum);\n return lsum;\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tTreeNode r1 = new TreeNode(1);\n\t\tTreeNode r2 = new TreeNode(2);\n\t\tTreeNode r3 = new TreeNode(3);\n\t\tTreeNode r4 = new TreeNode(4);\n\t\tTreeNode r5 = new TreeNode(5);\n\t\tTreeNode r6 = new TreeNode(6);\n\t\tTreeNode r7 = new TreeNode(7);\n\t\tTreeNode r8 = new TreeNode(8);\n\t\t\n\t\tr1.left = r2;\n\t\tr1.right = r5;\n\t\tr2.left = r3;\n\t\tr2.right = r4;\n\t\tr5.right = r6;\n\t\tr6.left = r7;\n\t\tr6.right = r8;\n\t\t\n\t\tflatten(r1);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tTreeNode p = r1;\n\t\twhile(p !=null){\n\t\t\tsb.append(p.val+\"-->\");\n\t\t\tp=p.right;\n\t\t}\n\t\t\n\t\tSystem.out.println(sb);\n\t\t\n\t}", "public void levelOrderTraversal(TreeNode root){\n int height = height(root);\n for(int i = 0; i <=height; i++){\n System.out.println();\n printNodesInLevel(root,i);\n }\n }", "public static void main(String args[]) {\n\t\tBNode root = new BNode(4);\n\t\troot.left = new BNode(2);\n\t\troot.right = new BNode(6);\n\t\troot.left.left = new BNode(1);\n\t\troot.left.right = new BNode(3);\n\t\troot.right.left = new BNode(5);\n\t\troot.right.right = new BNode(7);\n\t\tSystem.out.println(\"LCA(4, 5) = \" + findLCA(root, 4, 5).data);\n\t\tSystem.out.println(\"itr LCA(4, 5) = \" + lcaIterative(root, 4, 5).data);\n\t\tSystem.out.println(\"LCA(4, 6) = \" + findLCA(root, 4, 6).data);\n\t\tSystem.out.println(\"itr LCA(4, 6) = \" + lcaIterative(root, 4, 6).data);\n\t\tSystem.out.println(\"LCA(3, 4) = \" + findLCA(root, 3, 4).data);\n\t\tSystem.out.println(\"itr LCA(3, 4) = \" + lcaIterative(root, 3, 4).data);\n\t\tSystem.out.println(\"LCA(2, 4) = \" + findLCA(root, 2, 4).data);\n\t\tSystem.out.println(\"itr LCA(2, 4) = \" + lcaIterative(root, 2, 4).data);\n\t\t\n\t\tSystem.out.println(\"itr LCA(2, 9) = \" + lcaIterative(root, 2, 9).data);\n\n\t\tBNode root2 = new BNode(4);\n\t\troot2.left = new BNode(2);\n\t\troot2.right = new BNode(6);\n\t\troot2.left.left = new BNode(1);\n\t\troot2.left.right = new BNode(3);\n\t\troot2.right.left = new BNode(5);\n\t\troot2.right.right = new BNode(7);\n\t\troot2.right.right.right = new BNode(8);\n\t\tSystem.out.println(\"-----------------------------------------------\");\n\t\tSystem.out.println(\"Dist (4, 5) = \" + findDistance(root2, 4, 5));\n\t\tSystem.out.println(\"Dist itr (4, 5) = \" + findDistance2(root2, 4, 5));\n\n\t\tSystem.out.println(\"Dist(4, 6) = \" + findDistance(root2, 4, 6));\n\t\tSystem.out.println(\"Dist itr (4, 6) = \" + findDistance2(root2, 4, 6));\n\n\t\tSystem.out.println(\"Dist(3, 4) = \" + findDistance(root2, 3, 4));\n\t\tSystem.out.println(\"Dist itr(3, 4) = \" + findDistance2(root2, 3, 4));\n\n\t\tSystem.out.println(\"Dist(2, 4) = \" + findDistance(root2, 2, 4));\n\t\tSystem.out.println(\"Dist itr(2, 4) = \" + findDistance2(root2, 2, 4));\n\n\t\tSystem.out.println(\"Dist(8, 5) = \" + findDistance(root2, 8, 5));\n\t\tSystem.out.println(\"Dist itr(8, 5) = \" + findDistance2(root2, 8, 5));\n\n\t}", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "public TreeNode getLeft(){ return leftChild;}", "public void rightBoundary(TreeNode root) {\n if (root.right == null && root.left == null) return; // ignore leaf\n if (root.right != null) rightBoundary(root.right);\n else rightBoundary(root.left);\n result.add(root.val); // add after child visit(reverse)\n }", "public void levelOrderUsingRecurison(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint height=heightOfTree(root);\r\n\t\tfor (int i=0;i<=height;i++)\r\n\t\t{\r\n\t\t\tprintNodesAtGivenLevel(root,i+1);\t\t\r\n\t\t}\r\n\t}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "private void inOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n inOrderTraversalRec(root.getLeft());\n System.out.print(root.getData() + \" \");\n inOrderTraversalRec(root.getRight());\n }", "public static void main(String[] args) {\n Node root = new Node(1);\n\n Node left = new Node(2);\n left.left = new Node(4);\n left.right = new Node(3);\n\n Node right = new Node(5);\n right.left = new Node(6);\n right.right = new Node(7);\n\n root.left = left;\n root.right = right;\n\n Traversal traversal = new Traversal();\n traversal.preOrder(root);\n System.out.println();\n traversal.postOrder(root);\n System.out.println();\n traversal.inOrder(root);\n System.out.println();\n traversal.levelOrder(root);\n //System.out.println(checkBST(root));\n }", "TreeNode<T> getRight();", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public List<Integer> rightSideView_bfs(TreeNode root) {\n List<Integer> list = new ArrayList<>();\n if(root == null){\n return list;\n }\n Queue<TreeNode> q = new LinkedList<>();\n q.offer(root);\n while(!q.isEmpty()){\n int len = q.size();\n for(int i=0; i<len; i++){\n TreeNode node = q.poll();\n if(i == 0){\n list.add(node.val);\n }\n if(node.left != null) q.offer(node.left);\n if(node.right != null) q.offer(node.right); \n }\n }\n return list;\n }", "public void printLDRNodes(Node N) {\n if(N != null) {\n printLDRNodes(N.getLeft());\n System.out.print(N.getData() + \" \");\n printLDRNodes(N.getRight());\n }\n }", "public void printLeftView(){\n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n boolean printed = false;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n // if the first node is not printed print it and flip the bool value\n if(! printed){\n System.out.println(node.data);\n printed = true;\n }\n\n // add left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // flip the printed bool value\n // break if the queue is empty else enqueue a null\n printed = false;\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "void leftView(Node node)\r\n {\r\n \tif(node == null)\r\n \t\treturn;\r\n \t\r\n \tif(node.leftChild != null)\r\n \t\tSystem.out.print(\" \"+node.leftChild.data);\r\n \t\r\n \tleftView(node.leftChild);\r\n \tleftView(node.rightChild);\r\n }", "private TreeNode traverseTree(Instance i) {\n TreeNode next = root;\n while (next != null && !next.isLeafNode()) {\n Attribute a = next.split.attribute;\n if (a.isNominal()) {\n next = next.nominals()[(int) i.value(a)];\n } else {\n if (i.value(a) < next.split.splitPoint) {\n next = next.left();\n } else {\n next = next.right();\n }\n }\n }\n return next;\n }", "public static void main(String[] args) {\n\t\tTreeNode root = new TreeNode(1);\r\n\t\tTreeNode two = new TreeNode(2);\r\n\t\tTreeNode three = new TreeNode(3);\r\n\t\tTreeNode six = new TreeNode(6);\r\n\t\tTreeNode four = new TreeNode(4);\r\n\t\tTreeNode five = new TreeNode(5);\r\n\t\troot.left = two;\r\n\t\troot.right = three;\r\n\t\t//two.left = six;\r\n\t\tthree.left = four;\r\n\t\tthree.right = five;\r\n\t\tprintLevel(root);\r\n\t}", "Node findLeftmost(Node R){\n Node L = R;\n if( L!= null ) for( ; L.left != null; L = L.left);\n return L;\n }", "public static void main(String[] args) {\n TreeNode n20 = new TreeNode(20);\n TreeNode n8 = new TreeNode(8);\n TreeNode n4 = new TreeNode(4);\n TreeNode n7 = new TreeNode(7);\n TreeNode n12 = new TreeNode(12);\n TreeNode n14 = new TreeNode(14);\n TreeNode n21 = new TreeNode(21);\n TreeNode n22 = new TreeNode(22);\n TreeNode n25 = new TreeNode(25);\n TreeNode n24 = new TreeNode(24);\n n20.left = n8;\n n20.right = n22;\n n8.left = n4;\n n8.right = n12;\n n4.right = n7;\n n12.right = n14;\n n22.left = n21;\n n22.right = n25;\n n25.left = n24;\n\n for (Integer i : printBoundary(n20)) {\n System.out.println(i);\n }\n }", "public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}", "public BinNode<T> getLeft();", "static void levelOrder(Node root) {\n // create a node queue\n Queue<Node> queue = new LinkedList<>();\n queue.add(root);\n while (!queue.isEmpty()) {\n Node node = queue.remove();\n // if node print value\n System.out.printf(\"%d \", node.data);\n // if left node not null add child node to the queue\n if (node.left != null)\n queue.add(node.left);\n // if right node not null add child node to the queue\n if (node.right != null)\n queue.add(node.right);\n }\n }", "public static void main(String[] args) {\n\t\ttn=new TreeNode(null,null,null,1);\n\t\tTreeNode tleft=new TreeNode(tn,null,null,2);\n\t\tTreeNode tright=new TreeNode(tn,null,null,3);\n\t\ttn.left=tleft;\n\t\ttn.right=tright;\n\t\t\n\t\tTreeNode tleft1=new TreeNode(tleft,null,null,4);\n\t\tTreeNode tright1=new TreeNode(tleft,null,null,5);\n\t\ttleft.left=tleft1;\n\t\ttleft.right=tright1;\n\t\t\n\t\tTreeNode tleft2=new TreeNode(tright,null,null,6);\n\t\tTreeNode tright2=new TreeNode(tright,null,null,7);\n\t\ttright.left=tleft2;\n\t\ttright.right=tright2;\n\t\t\n\t\tTreeNode tleft3=new TreeNode(tleft1,null,null,8);\n\t\tTreeNode tright3=new TreeNode(tleft1,null,null,9);\n\t\ttleft1.left=tleft3;\n\t\ttleft1.right=tright3;\n\t\t\n\t\tTreeNode tleft4=new TreeNode(tright1,null,null,10);\n\t\tTreeNode tright4=new TreeNode(tright1,null,null,11);\n\t\ttright1.left=tleft4;\n\t\ttright1.right=tright4;\n\t\t\n\t\tSystem.out.println(inorderTraversal2(tn));\n\t}", "public void printLRD() {\n if(!empty()){\n printLRDNodes(root);\n System.out.println();\n }\n }", "public static void main(String[] args) {\n// TreeNode node1 = new TreeNode(0);\n// TreeNode node2l = new TreeNode(3);\n// TreeNode node2r = new TreeNode(5);\n//// TreeNode node3l = new TreeNode(2);\n// TreeNode node3r = new TreeNode(2);\n//// TreeNode node4l = new TreeNode(4);\n// TreeNode node4r = new TreeNode(1);\n//\n// node1.left = node2l;\n// node1.right = node2r;\n//// node2l.left = node3l;\n// node2l.right = node3r;\n// node3r.right = node4r;\n//\n\n int[] nums = {3, 2, 1, 6, 0, 5};\n\n }", "private void inOrderTraversal(int index) {\n // go through the graph as long as has values\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n inOrderTraversal(2 * index + 1);\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on right child\n inOrderTraversal(2 * index + 2);\n }", "void\nprintBoundaryLeft(Node node) \n\n{ \n\nif\n(node != \nnull\n) { \n\nif\n(node.left != \nnull\n) { \n\n\n// to ensure top down order, print the node \n\n// before calling itself for left subtree \n\nSystem.out.print(node.data + \n\" \"\n); \n\nprintBoundaryLeft(node.left); \n\n} \n\nelse\nif\n(node.right != \nnull\n) { \n\nSystem.out.print(node.data + \n\" \"\n); \n\nprintBoundaryLeft(node.right); \n\n} \n\n\n// do nothing if it is a leaf node, this way we avoid \n\n// duplicates in output \n\n} \n\n}", "public int sumOfLeftLeaves(TreeNode root) {\n if(root == null) {\n return 0;\n }\n int left = 0, right = 0;\n if(root.left != null) left = helper(root.left, true);\n if(root.right != null) right = helper(root.right, false);\n return left + right;\n \n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void levelOrderTraversal(TreeNode<T> root) {\n\t\tif(null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tLinkedList<TreeNode<T>> list = new LinkedList<TreeNode<T>>();\n\t\t\t\n\t\t\tlist.add(root);\n\t\t\t\n\t\t\twhile(!list.isEmpty()) {\n\t\t\t\tTreeNode<T> tempNode = list.removeFirst();\n\t\t\t\tSystem.out.println(tempNode);\n\t\t\t\t\n\t\t\t\tif(null != tempNode.getLeftChild()) {\n\t\t\t\t\tlist.addLast(tempNode.getLeftChild());\n\t\t\t\t}\n\t\t\t\t if(null != tempNode.getRightChild()) {\n\t\t\t\t\t list.addLast(tempNode.getRightChild());\n\t\t\t\t }\n\t\t\t\t tempNode = null; \n\t\t\t}\n\t\t}\n\t}", "public static void main(String args[]) {\n\t\t\n\t\tTreeNode root = new TreeNode(3);\n\t\troot.right = new TreeNode(2);\n\t\troot.right.right = new TreeNode(1);\n\t\t\n\n\t\tRecoverTree tree = new RecoverTree();\n\n\t\ttree.recoverTree(root);\n\t\tSystem.out.println(tree.firstElement.val);\n\t\tSystem.out.println(tree.secondElement.val);\n\t}", "public void leftBoundary(TreeNode root) {\n if (root.left == null && root.right == null) return; // ignore leaf\n result.add(root.val);\n if (root.left != null) leftBoundary(root.left);\n else leftBoundary(root.right);\n }", "ArrayList< LinkedList< Node > > levellist(Node root)\n{\n\t//results contain all the linkedlists containing all the nodes on each level of the tree\n\tArrayList< LinkedList< Node > > results = new ArrayList< LinkedList< Node > > ();\n\t//basic condition for the following built-in calling of recursive\n\tlevellist(root, results, 0);\n\t//because results is used as a parameter in the recursive and then we all need to return the output\n\treturn results;\n}", "public BTNode getLeft(){\r\n return leftLeaf;\r\n }", "public int sumOfLeftLeaves(TreeNode root) {\n return sumOfLeftLeaves(null, root);\n }", "public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}", "void leftViewUtil(Node3 Node3, int level) \n\t\t{ \n\t\t\t// Base Case \n\t\t\tif (Node3 == null) \n\t\t\t\treturn; \n\n\t\t\t// If this is the first Node3 of its level \n\t\t\tif (max_level < level) { \n\t\t\t\tSystem.out.print(\" \" + Node3.data); \n\t\t\t\tmax_level = level; \n\t\t\t} \n\n\t\t\t// Recur for left and right subtrees \n\t\t\tleftViewUtil(Node3.left, level + 1); \n\t\t\tleftViewUtil(Node3.right, level + 1); \n\t\t}", "void levelList(Node root, ArrayList< LinkedList< Node > > results, int level)\n{\n\tif(root == null) return; // base case: the outlet of the recursive\n\n\tLinkedList<Node> list = null; // initialize list with null, i.e. we did not create it yet\n\n\t//because we use the DFS therefore we must pass the level as one of the parameter\n\t//to pinpoint the level for the current position\n\tif(results.size() == level)\n\t\t//now we are visiting a new level we did not visit before\n\t{\n\t\tlist = new LinkedList<Node>();//now we create a new element which will be stored in results later\n\t\tresults.add(list);\n\t}else{\n\t\t//else we have already visited this level and all we need to do is get out of the level \n\t\t//to add the new node into it\n\t\tlist = results.get(level);\n\t}\n\n\t//ok. now is the kernel operation, i.e. after we locate the level we will add the node anyway\n\tlist.add(root);\n\n\t//now we can go to the next recursive condition\n\t//do not forget to increase the level as the new parameter for the next round\n\tlevellist(root.left, results, level+1);\n\tlevellist(root.right, results, level+1);\n}", "public static void main(String args[]) \n\t\t{ \n\t\t\t/* creating a binary tree and entering the Node3s */\n\t\t\tLeftViewofTree tree = new LeftViewofTree(); \n\t\t\ttree.root = new Node3(12); \n\t\t\ttree.root.left = new Node3(10); \n\t\t\ttree.root.right = new Node3(30); \n\t\t\ttree.root.right.left = new Node3(25); \n\t\t\ttree.root.right.right = new Node3(40); \n\n\t\t\ttree.leftView(); \n\t\t}", "private void rebalanceLeft(TreeNodeDataType n) {\n left(n);\r\n \r\n \r\n }", "private BSTNode linkedListToTree (Iterator iter, int n) {\n // TODO Your code here\n \tint leftlenght,rightlength;\n \tdouble LenOfleft = n/2;\n \tleftlenght = (int)java.lang.Math.floor(LenOfleft);\n \trightlength = n - leftlenght -1;\n \t\n \t//linkedListToTree(iter,leftlenght);\n \t//Object item = iter.next();\n \t//linkedListToTree(iter,rightlength);\n \t\n return new BSTNode(linkedListToTree(iter,leftlenght),iter.next(),linkedListToTree(iter,rightlength)) ;\n }", "int sumRootToLeafNumbers();", "private TraverseData traverseOneLevel(TraverseData data) {\n Node<T> currentNode = data.currentNode;\n Node<T> currentNewNode = data.currentNewNode;\n int nextBranch = data.index / data.base;\n\n currentNewNode.set(nextBranch, new Node<>(branchingFactor));\n for (int anotherBranch = 0; anotherBranch < branchingFactor; anotherBranch++) {\n if (anotherBranch == nextBranch) {\n continue;\n }\n currentNewNode.set(anotherBranch, currentNode.get(anotherBranch));\n }\n\n //down\n currentNode = currentNode.get(nextBranch);\n currentNewNode = currentNewNode.get(nextBranch);\n return new TraverseData(currentNode, currentNewNode, data.newRoot, data.index % data.base,\n data.base);\n }", "public static void main(String[] args) {\n\n Node<Integer> node1 = new Node<>(1);\n Node<Integer> node2 = new Node<>(2);\n Node<Integer> node3 = new Node<>(3);\n Node<Integer> node4 = new Node<>(4);\n\n node1.setLeftChild(node2);\n node1.setRightChild(node3);\n\n node2.setLeftChild(node4);\n\n node3.setLeftChild(new Node<>(5));\n node3.setRightChild(new Node<>(6));\n\n node4.setLeftChild(new Node<>(7));\n node4.setRightChild(new Node<>(8));\n\n traverse(node1);\n }", "void traverseLevelOrder1() {\n\t\tint h = height(root);\n\t\tint i;\n\t\tfor (i = 1; i <= h; i++)\n\t\t\tprintGivenLevel(root, i);\n\t}", "public void traverse(double num){\n //This means go left\n if (num <= value){\n if (left == null){\n left = new Node(num);\n }\n else{\n left.traverse(num);\n }\n }//This means it goes left; num > value\n else{\n if (right == null){\n right = new Node(num);\n }\n else{\n right.traverse(num);\n }\n }\n }", "public static void main(String[] args) {\n\t\tint[] num = { 1, 2, 3, 4, 5, 6 };\r\n TreeNode head= getDoubleLinked(num);\r\n while(head!=null){\r\n \tSystem.out.println(head.val);\r\n \thead=head.right;\r\n }\r\n\t}", "private static void traversals(Node root) {\n\t\tSystem.out.println(\"Node Pre \" + root.data);\n\t\tfor(Node child : root.children) {\n\t\t\tSystem.out.println(\"Edge Pre \" + root.data + \"--\" + child.data);\n\t\t\ttraversals(child);\n\t\t\tSystem.out.println(\"Edge Post \" + root.data + \"--\" + child.data);\n\t\t}\n\t\tSystem.out.println(\"Node Post \" + root.data);\n\t}", "public void postOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n postOrderTraverseTree(focusNode.leftChild);\n postOrderTraverseTree(focusNode.rightChild);\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n }\n }", "private static void rightLeftInsert() {\n System.out.println(\"RightLeft Tree Insert Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 60, 30, 70, 55, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }", "private static List<Integer> printTree(Tree tree, List values){\n int height = heightOfTree(tree);\n\n for(int i=1;i<=height;i++) {\n System.out.println(\"\");\n printTreeInLevel(tree, i, values);\n }\n return values;\n}", "void\nprintBoundaryRight(Node node) \n\n{ \n\nif\n(node != \nnull\n) { \n\nif\n(node.right != \nnull\n) { \n\n// to ensure bottom up order, first call for right \n\n// subtree, then print this node \n\nprintBoundaryRight(node.right); \n\nSystem.out.print(node.data + \n\" \"\n); \n\n} \n\nelse\nif\n(node.left != \nnull\n) { \n\nprintBoundaryRight(node.left); \n\nSystem.out.print(node.data + \n\" \"\n); \n\n} \n\n// do nothing if it is a leaf node, this way we avoid \n\n// duplicates in output \n\n} \n\n}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(20, null, null);\n TreeNode lvl2Node1 = insertTreeNode(true, 10, root);\n TreeNode lvl2Node2 = insertTreeNode(false, 1, root);\n TreeNode lvl3Node1 = insertTreeNode(true, 25, lvl2Node1);\n TreeNode lvl3Node2 = insertTreeNode(false, 26, lvl2Node1);\n TreeNode lvl3Node3 = insertTreeNode(true, 32, lvl2Node2);\n TreeNode lvl3Node4 = insertTreeNode(false, 37, lvl2Node2);\n insertTreeNode(true, 5, lvl3Node1);\n insertTreeNode(false, 6, lvl3Node2);\n insertTreeNode(false, 8, lvl3Node3);\n insertTreeNode(true, 10, lvl3Node4);\n\n\n breadthFirstSearchPrintTree(root);\n\n }", "public void inOrderTree(TernaryTreeNode root)\n {\n if(root==null) return;\n \n \n inOrderTree(root.left);\n inOrderTree(root.middle);\n inOrderTree(root.right);\n System.out.print(root.data+\" \");\n \n }", "private void constructBSTree(Node<T> u, int n, String lr) {\n\t\tn++;\n\t\taddToPT(n, lr + \" \" + u.x.toString());\n\t\telements.add(u.x);\n\t\tif (u.left != nil)\n\t\t\tconstructBSTree(u.left, n, lr + \"L\");\n\t\tif (u.right != nil)\n\t\t\tconstructBSTree(u.right, n, lr + \"R\");\n\t}", "public TreeNode getRight(){ return rightChild;}", "private int rightSideView(Node root, int currentLevel, int processingLevel){\n if(root== null){\n return processingLevel;\n }\n if(processingLevel == currentLevel) {\n System.out.println(root.getData());\n processingLevel++;\n }\n processingLevel = rightSideView(root.getRight(), currentLevel+1, processingLevel);\n processingLevel = rightSideView(root.getLeft(), currentLevel+1, processingLevel);\n\n return processingLevel;\n }", "void inorder(Node root) {\n\t\tboolean leftdone = false;\n\n\t\t// Start traversal from root\n\t\twhile (root != null) {\n\t\t\t// If left child is not traversed, find the\n\t\t\t// leftmost child\n\t\t\tif (!leftdone) {\n\t\t\t\twhile (root.left != null) {\n\t\t\t\t\troot = root.left;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print root's data\n\t\t\tSystem.out.print(root.data + \" \");\n\n\t\t\t// Mark left as done\n\t\t\tleftdone = true;\n\n\t\t\t// If right child exists\n\t\t\tif (root.right != null) {\n\t\t\t\tleftdone = false;\n\t\t\t\troot = root.right;\n\t\t\t}\n\n\t\t\t// If right child doesn't exist, move to parent\n\t\t\telse if (root.parent != null) {\n\t\t\t\t// If this node is right child of its parent,\n\t\t\t\t// visit parent's parent first\n\t\t\t\twhile (root.parent != null && root == root.parent.right)\n\t\t\t\t\troot = root.parent;\n\n\t\t\t\tif (root.parent == null)\n\t\t\t\t\tbreak;\n\t\t\t\troot = root.parent;\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t}\n\t}" ]
[ "0.68279636", "0.66867083", "0.666776", "0.66421175", "0.6510334", "0.6440574", "0.62225276", "0.620094", "0.61647624", "0.6043045", "0.6036506", "0.60138345", "0.5978342", "0.5922041", "0.5915518", "0.5901135", "0.58904785", "0.5883763", "0.587059", "0.58666044", "0.58657545", "0.58510834", "0.5840027", "0.5834438", "0.5822483", "0.5819683", "0.5801651", "0.5784688", "0.5759642", "0.57567126", "0.5744308", "0.57224655", "0.57020056", "0.56993103", "0.568666", "0.56771857", "0.5659484", "0.56428814", "0.5632269", "0.56211394", "0.5613194", "0.5609921", "0.5608303", "0.5599119", "0.55931693", "0.5590628", "0.5590371", "0.55844486", "0.5581931", "0.55791783", "0.5578538", "0.5575979", "0.55676913", "0.5562234", "0.55533874", "0.55500084", "0.55413866", "0.55396754", "0.5534475", "0.55308264", "0.5524886", "0.5524176", "0.5522527", "0.5517301", "0.5508027", "0.55065423", "0.5505603", "0.5504913", "0.5502869", "0.55023944", "0.5490185", "0.548803", "0.5476934", "0.5473712", "0.54659855", "0.5460018", "0.5458056", "0.545667", "0.5437582", "0.54357296", "0.5434748", "0.5429794", "0.54278994", "0.54242575", "0.54242146", "0.5417448", "0.54168797", "0.54163927", "0.5401382", "0.53979015", "0.5389271", "0.538869", "0.5386581", "0.5385243", "0.5384986", "0.5377163", "0.5375649", "0.5375639", "0.5372473", "0.53702545" ]
0.6740373
1
TraverseLRN method traverses tree from left subtree, right subtree, then root and outputs the values
public void TraverseLRN(TreeNode Root) { if(Root.Left != null) TraverseLNR(Root.Left); if(Root.Right != null) TraverseLNR(Root.Right); System.out.println(Root.Data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void TraverseRNL(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public void TraverseNLR(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }", "public void TraverseLNR(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public void TraverseNRL(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public static void main(String[] args) {\n TreeNode node = new TreeNode();\n node.value = 1;\n node.left = new TreeNode();\n node.left.value = 2;\n node.right = new TreeNode();\n node.right.value = 3;\n node.left.left = new TreeNode();\n node.left.left.value = 4;\n node.left.right = new TreeNode();\n node.left.right.value = 5;\n node.right.left = new TreeNode();\n node.right.left.value = 6;\n node.right.right = new TreeNode();\n node.right.right.value = 7;\n// System.out.println(mirro(node).value);\n// System.out.println(mirro(node).left.value);\n// System.out.println(Arrays.toString(LevelPrintTree.levelPrint(mirro(node))));\n\n recur(node);\n\n }", "public void TraverseRLN(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t}", "@Test\r\n\tpublic void test(){\r\n\t\tTreeNode root = new TreeNode(1); \r\n TreeNode r2 = new TreeNode(2); \r\n TreeNode r3 = new TreeNode(3); \r\n TreeNode r4 = new TreeNode(4); \r\n TreeNode r5 = new TreeNode(5); \r\n TreeNode r6 = new TreeNode(6); \r\n root.left = r2; \r\n root.right = r3; \r\n r2.left = r4; \r\n r2.right = r5; \r\n r3.right = r6;\r\n System.out.println(getNodeNumRec(root));\r\n System.out.println(getNodeNum(root));\r\n System.out.println(getDepthRec(root));\r\n System.out.println(getDepth(root));\r\n System.out.println(\"前序遍历\");\r\n preorderTraversalRec(root);\r\n System.out.println(\"\");\r\n preorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"中序遍历\");\r\n inorderTraversalRec(root);\r\n System.out.println(\"\");\r\n inorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"后序遍历\");\r\n postorderTraversalRec(root);\r\n System.out.println(\"\");\r\n postorderTraversal(root);\r\n System.out.println(\"分层遍历\");\r\n levelTraversal(root);\r\n System.out.println(\"\");\r\n levelTraversalRec(root);\r\n\t}", "public static void main(String[] args) {\n TreeNode n7 = new TreeNode(7);\n TreeNode n6 = new TreeNode(6);\n TreeNode n5 = new TreeNode(5);\n TreeNode n4 = new TreeNode(4);\n TreeNode n3 = new TreeNode(3);\n TreeNode n2 = new TreeNode(2);\n TreeNode n1 = new TreeNode(1);\n\n n4.left = n2;\n n4.right = n6;\n\n n2.left = n1;\n n2.right = n3;\n\n n6.left = n5;\n n6.right = n7;\n\n System.out.println(\"Cay n4\");\n List<Integer> resultPreOrder = preOrderTravel(n4);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n\n System.out.println(\"Cay n2\");\n resultPreOrder = preOrderTravel(n2);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n }", "public void reverseLevelOrderTraversel(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tQueue<TreeNode> que = new LinkedList<>();\r\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\r\n\t\t\r\n\t\tque.add(root);\r\n\t\twhile(que.size()>0)\r\n\t\t{\r\n\t\t\tTreeNode element=que.remove();\r\n\t\t\tif(element.right!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.right);\r\n\t\t\t}\r\n\t\t\tif(element.left!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.left);\r\n\t\t\t}\r\n\t\t\tstack.push(element);\r\n\t\t}\r\n\t\twhile(stack.size()>0)\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop().data+\" \");\r\n\t\t}\r\n\t\t\t\r\n\t}", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args){\n\t\tTreeNode node1 = new TreeNode(1);\n\t\tTreeNode node2 = new TreeNode(2);\n\t\tTreeNode node3 = new TreeNode(3);\n\t\tTreeNode node4 = new TreeNode(4);\n\t\tTreeNode node5 = new TreeNode(5);\n\t\tTreeNode node6 = new TreeNode(6);\n\t\tTreeNode node7 = new TreeNode(7);\n\t\tnode4.left = node2;\n\t\tnode4.right = node6;\n\t\tnode2.left = node1;\n\t\tnode2.right = node3;\n\t\tnode6.left = node5;\n\t\tnode6.right = node7;\n\t\t/*\n\t\t * 4\n\t\t * /\n\t\t * 5\n\t\t * \\\n\t\t * 6\n\t\t */\n\t\t/*node4.left = node5;\n\t\tnode5.right = node6;*/\n\t\t\n\t\ttreeTraversal2 tt = new treeTraversal2();\n\t\tSystem.out.print(\"Inorder Rcur: \");tt.inorderTraverse(node4);//1234567\n\t\tSystem.out.println();\t\t\n\t\tSystem.out.print(\"Inorder Iter: \");tt.stackInorder(node4);//1234567\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Rcur: \");tt.preorderTraverse(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Iter: \"); tt.stackPreorder(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Postorder Rcur: \");tt.postorderTraverse(node4);//1325764\n\t\tSystem.out.println();\t\t \n\t\tSystem.out.print(\"Postorder Iter: \");tt.stackPostorder(node4);//1325764\n\t\t//System.out.println();\n\t\t//System.out.print(\"Postorder Iter: \");tt.twoStackPostorder(node4);//1325764\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Level Iter: \");tt.levelTraverse(node4);//4261357\n\t}", "public static void main(String args[]){\n BinaryTreeNode root = new BinaryTreeNode();\n root.setData(1);\n\n BinaryTreeNode left = new BinaryTreeNode();\n left.setData(2);\n\n BinaryTreeNode right = new BinaryTreeNode();\n right.setData(3);\n\n BinaryTreeNode leftleft = new BinaryTreeNode();\n leftleft.setData(4);\n\n BinaryTreeNode leftright = new BinaryTreeNode();\n leftright.setData(5);\n\n root.setLeft(left);\n root.setRight(right);\n left.setLeft(leftleft);\n left.setRight(leftright);\n\n\n postOrderIterative(root);\n\n }", "public static void main(String[] args) {\n // TODO Auto-generated method stub\n int[] nums = {3, 2, 1, 6, 0, 5};\n TreeNode root = solution2(nums);\n System.out.println(root.val);\n System.out.println(root.left.val);\n System.out.println(root.left.right.val);\n System.out.println(root.left.right.right.val);\n System.out.println(root.right.val);\n System.out.println(root.right.left.val);\n System.out.println(root.right.right);\n }", "public void printLRDNodes(Node N) {\n if(N != null) {\n printLRDNodes(N.getLeft());\n printLRDNodes(N.getRight());\n System.out.print(N.getData() + \" \");\n }\n }", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\n TreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n TreeNode node8 = new TreeNode(8);\n node1.right=node3;\n node1.left=node2;\n node2.left=node4;\n node3.right=node5;\n node4.right=node6;\n node6.left=node7;\n node6.right=node8;\n traversalRecursion(node1);\n System.out.println();\n nonRecurInTraverse(node1);\n }", "public void traverse(Node root){\n\t\tNode pred, current;\n\t\tcurrent=root;\n\t\tint rank=10;\n\t\tint rankCount=1;\n\t\twhile(current!=null){\n\t\t\tif(current.left==null){\n\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\trankCount++;\n\t\t\t\tcurrent=current.right;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpred=current.left;\n\t\t\t\twhile(pred.right!=null && pred.right!=current){\n\t\t\t\t\tpred=pred.right;\n\t\t\t\t}\n\n\t\t\t\tif(pred.right==null){\n\t\t\t\t\tpred.right=current;\n\t\t\t\t\tcurrent=current.left;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tpred.right=null;\n\t\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\trankCount++;\n\t\t\t\t\tcurrent=current.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }", "private TraverseData traverse(int treeIndex) {\n Node<T> newRoot = new Node<>(branchingFactor);\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData data = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, b));\n currentNode = data.currentNode;\n currentNewNode = data.currentNewNode;\n treeIndex = data.index;\n }\n return new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, 1);\n }", "public static void main(String[] args) { Scanner scanner = new Scanner(System.in);\n// System.out.println(\"Please read number of levels for tree: \");\n// int n = scanner.nextInt();\n//\n// System.out.println(\"The tree will have \" + n + \" levels\");\n//\n Tree tree = new Tree();\n// tree.generateDefaultTree(n);\n tree.readUnbalancedTree();\n System.out.println(\"Display NLR:\");\n tree.showTreeNLR(tree.root);\n System.out.println();\n System.out.println(\"Display LNR\");\n tree.showTreeLNR(tree.root);\n System.out.println();\n System.out.println(\"Display LRN\");\n tree.showTreeLRN(tree.root);\n }", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public static void main(String[] args) {\n\t\tBinary_Tree_Level_Order_Traversal_102 b=new Binary_Tree_Level_Order_Traversal_102();\n\t\tTreeNode root=new TreeNode(3);\n\t\troot.left=new TreeNode(9);\n\t\troot.right=new TreeNode(20);\n\t\troot.right.left=new TreeNode(15);\n\t\troot.right.right=new TreeNode(7);\n\t\tList<List<Integer>> res=b.levelOrder(root);\n\t\tfor(List<Integer> list:res){\n\t\t\tfor(Integer i:list){\n\t\t\t\tSystem.out.print(i+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void inOrderTraversal(int index) {\n // go through the graph as long as has values\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n inOrderTraversal(2 * index + 1);\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on right child\n inOrderTraversal(2 * index + 2);\n }", "private int treeTraverse (TreeNode root, int previousVal) {\n if (root == null)\n return 0;\n \n // traverse left, then right\n int left = treeTraverse(root.left, root.val);\n int right = treeTraverse(root.right, root.val);\n \n // calculate the longest path\n path = Math.max(left + right, path);\n\n //return\n if (root.val == previousVal) \n return Math.max(left, right) + 1;\n \n return 0;\n }", "public void printLDRNodes(Node N) {\n if(N != null) {\n printLDRNodes(N.getLeft());\n System.out.print(N.getData() + \" \");\n printLDRNodes(N.getRight());\n }\n }", "private BSTNode linkedListToTree (Iterator iter, int n) {\n // TODO Your code here\n \tint leftlenght,rightlength;\n \tdouble LenOfleft = n/2;\n \tleftlenght = (int)java.lang.Math.floor(LenOfleft);\n \trightlength = n - leftlenght -1;\n \t\n \t//linkedListToTree(iter,leftlenght);\n \t//Object item = iter.next();\n \t//linkedListToTree(iter,rightlength);\n \t\n return new BSTNode(linkedListToTree(iter,leftlenght),iter.next(),linkedListToTree(iter,rightlength)) ;\n }", "public void rightViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == 0) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n }", "public static void main(String[] args) {\n\t\ttn=new TreeNode(null,null,null,1);\n\t\tTreeNode tleft=new TreeNode(tn,null,null,2);\n\t\tTreeNode tright=new TreeNode(tn,null,null,3);\n\t\ttn.left=tleft;\n\t\ttn.right=tright;\n\t\t\n\t\tTreeNode tleft1=new TreeNode(tleft,null,null,4);\n\t\tTreeNode tright1=new TreeNode(tleft,null,null,5);\n\t\ttleft.left=tleft1;\n\t\ttleft.right=tright1;\n\t\t\n\t\tTreeNode tleft2=new TreeNode(tright,null,null,6);\n\t\tTreeNode tright2=new TreeNode(tright,null,null,7);\n\t\ttright.left=tleft2;\n\t\ttright.right=tright2;\n\t\t\n\t\tTreeNode tleft3=new TreeNode(tleft1,null,null,8);\n\t\tTreeNode tright3=new TreeNode(tleft1,null,null,9);\n\t\ttleft1.left=tleft3;\n\t\ttleft1.right=tright3;\n\t\t\n\t\tTreeNode tleft4=new TreeNode(tright1,null,null,10);\n\t\tTreeNode tright4=new TreeNode(tright1,null,null,11);\n\t\ttright1.left=tleft4;\n\t\ttright1.right=tright4;\n\t\t\n\t\tSystem.out.println(inorderTraversal2(tn));\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n System.out.println(new Solution().preorderTraversal(null));\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void postOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n postOrderTraverseTree(focusNode.leftChild);\n postOrderTraverseTree(focusNode.rightChild);\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n }\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "private Voter traverseRBT(RedBlackTree.Node<Voter> root, Date birthdate) {\r\n \r\n RedBlackTree.Node<Voter> currentNode = root;\r\n //no voter in the database so none can be gotten\r\n if (currentNode == null) {\r\n throw new NoSuchElementException(\"There is no voter in the database\");\r\n }\r\n \r\n // if the current node matches that of that of the birthdate, return that node\r\n if (currentNode.data.compareTo(new Voter(birthdate)) == 0) {\r\n return currentNode.data;\r\n \r\n //if the current node does not match traverse down the subtrees\r\n \r\n } else if (currentNode.data.compareTo(new Voter(birthdate)) > 0) {\r\n // left subtree\r\n return traverseRBT(currentNode.leftChild, birthdate); //recursively traverse through left subtree\r\n } else {\r\n // right subtree\r\n return traverseRBT(currentNode.rightChild, birthdate); //recursively traverse through right subtree\r\n }\r\n }", "public static void main(String[] args) {\n Node root = new Node(1);\n\n Node left = new Node(2);\n left.left = new Node(4);\n left.right = new Node(3);\n\n Node right = new Node(5);\n right.left = new Node(6);\n right.right = new Node(7);\n\n root.left = left;\n root.right = right;\n\n Traversal traversal = new Traversal();\n traversal.preOrder(root);\n System.out.println();\n traversal.postOrder(root);\n System.out.println();\n traversal.inOrder(root);\n System.out.println();\n traversal.levelOrder(root);\n //System.out.println(checkBST(root));\n }", "public void leftViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == queue.size()) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n\n }", "public static void leftToRight(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n leftToRight(root.left, level-1);\n leftToRight(root.right, level-1);\n }\n\n }", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "private void postOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n postOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n postOrderTraversal(2 * index + 2);\n // print the node\n System.out.print(array[index] + \", \");\n }", "public static void main(String[] args) {\n \n LinkedBinaryTree expr = new LinkedBinaryTree<String>();\n // a is the root of the tree\n Position a, b, c, d, e, f, g, h, i;\n a = expr.addRoot(\"*\");\n b = expr.addLeft(a, \"+\");\n c = expr.addLeft(b, \"/\");\n d = expr.addLeft(c, \"*\");\n e = expr.addLeft(d, \"+\");\n expr.addLeft(e, \"5\");\n expr.addRight(e, \"2\");\n f = expr.addRight(d, \"-\");\n expr.addLeft(f, \"2\");\n expr.addRight(f, \"1\");\n g = expr.addRight(c, \"+\");\n expr.addLeft(g, \"2\");\n expr.addRight(g, \"9\");\n h = expr.addRight(b, \"-\");\n i = expr.addLeft(h, \"-\");\n expr.addLeft(i, \"7\");\n expr.addRight(i, \"2\");\n expr.addRight(h, \"1\");\n expr.addRight(a, \"8\");\n \n System.out.println(\"The original expression:\");\n System.out.println(\"(((5+2)*(2–1)/(2+9)+((7–2)–1))*8)\\n\");\n \n System.out.println(\"Preorder traversal:\");\n Iterable<Position<String>> preIter = expr.preorder();\n for (Position<String> s : preIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Inorder traversal:\");\n Iterable<Position<String>> inIter = expr.inorder();\n for (Position<String> s : inIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Postorder traversal:\");\n Iterable<Position<String>> postIter = expr.postorder();\n for (Position<String> s : postIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Breadth traversal:\");\n Iterable<Position<String>> breadthIter = expr.breadthfirst();\n for (Position<String> s : breadthIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Parenthesized representation:\"); \n printParenthesize(expr, a);\n System.out.println();\n }", "public static void main(String[] args) {\n\n Node<Integer> node1 = new Node<>(1);\n Node<Integer> node2 = new Node<>(2);\n Node<Integer> node3 = new Node<>(3);\n Node<Integer> node4 = new Node<>(4);\n\n node1.setLeftChild(node2);\n node1.setRightChild(node3);\n\n node2.setLeftChild(node4);\n\n node3.setLeftChild(new Node<>(5));\n node3.setRightChild(new Node<>(6));\n\n node4.setLeftChild(new Node<>(7));\n node4.setRightChild(new Node<>(8));\n\n traverse(node1);\n }", "private void constructBSTree(Node<T> u, int n, String lr) {\n\t\tn++;\n\t\taddToPT(n, lr + \" \" + u.x.toString());\n\t\telements.add(u.x);\n\t\tif (u.left != nil)\n\t\t\tconstructBSTree(u.left, n, lr + \"L\");\n\t\tif (u.right != nil)\n\t\t\tconstructBSTree(u.right, n, lr + \"R\");\n\t}", "public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}", "private void preOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on left child\n preOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n preOrderTraversal(2 * index + 2);\n }", "public static void main(String[] args){\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.right = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.right = new TreeNode(4);\n root.right.left = new TreeNode(4);\n root.right.right = new TreeNode(6);\n \n System.out.println(levelOrder(root)); // output: [[1], [2, 2], [6, 4, 4, 6]]\n }", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\t\tNode root = new Node(30);\n\t\troot.right = new Node(40);\n\t\troot.left = new Node(20);\n\t\troot.left.right=new Node(25);\n\t\troot.left.left = new Node(10);\n\t\troot.right.left = new Node(35);\n\t\troot.right.right = new Node(45);\n\t\t\n\t\tpostOrderTraversal(root);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tpostOrderRecursion(root);\n\t}", "private void inOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n inOrderTraversalRec(root.getLeft());\n System.out.print(root.getData() + \" \");\n inOrderTraversalRec(root.getRight());\n }", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "protected void rotateLeft(BSTNode n) {\n\n\t\tassert (n != null);\n\n\t\tBSTNode pv = n.right;\n\t\tassert (pv != null);\n\n\t\t// promote pv\n\t\tpv.parent = n.parent;\n\n\t\tif (n.parent == null) {\n\t\t\tif (n == _root) {\n\t\t\t\t_root = pv;\n\t\t\t} else {\n\t\t\t\t// do nothing, pv has no parent to notify\n\t\t\t}\n\t\t} else {\n\t\t\tsetParentReference(n, pv);\n\t\t}\n\n\t\t// move pv's left subtree over to n's right\n\t\tn.right = pv.left;\n\t\tif (n.right != null)\n\t\t\tn.right.parent = n;\n\n\t\t// move n to be the left child of pv\n\t\tpv.left = n;\n\t\tn.parent = pv;\n\n\t\t_stats.incRotations();\n\n\t\t/*\n\t\t * Fixup other tree stats\n\t\t */\n\n\t\tn.size = 1 + (n.left != null ? n.left.size : 0)\n\t\t\t\t+ (n.right != null ? n.right.size : 0);\n\n\t\tpv.size = 1 + n.size + (pv.right != null ? pv.right.size : 0);\n\t}", "TreeNode<T> getLeft();", "public static void main(String[] args) {\n TreeNode n20 = new TreeNode(20);\n TreeNode n8 = new TreeNode(8);\n TreeNode n4 = new TreeNode(4);\n TreeNode n7 = new TreeNode(7);\n TreeNode n12 = new TreeNode(12);\n TreeNode n14 = new TreeNode(14);\n TreeNode n21 = new TreeNode(21);\n TreeNode n22 = new TreeNode(22);\n TreeNode n25 = new TreeNode(25);\n TreeNode n24 = new TreeNode(24);\n n20.left = n8;\n n20.right = n22;\n n8.left = n4;\n n8.right = n12;\n n4.right = n7;\n n12.right = n14;\n n22.left = n21;\n n22.right = n25;\n n25.left = n24;\n\n for (Integer i : printBoundary(n20)) {\n System.out.println(i);\n }\n }", "private void preOrdertraverse(Node root){\n System.out.println(root.value);\n for(var child : root.getChildren())\n preOrdertraverse(child); //recursively travels other childrens in current child\n }", "public static void main(String[] args) {\n\t\tTreeNode root = new TreeNode(1);\n\t\troot.right = new TreeNode(2);\n\t\t//root.left.left = new TreeNode(3);\n\t\t//root.left.right = new TreeNode(3);\n\t\troot.right.left = new TreeNode(3);\n\t\t//root.right.right = new TreeNode(3);\n\t\t\n\t\tSystem.out.println(inorderTraversal(root));\n\t}", "public List<Integer> rightSideView(TreeNode root) {\n List<Integer> r = new ArrayList<>();\n LinkedList<LinkedList<Integer>> levelOrder = new LinkedList<>();\n LinkedList<TreeNode> queue = new LinkedList<>();\n if(root == null) return r;\n queue.offer(root);\n while(!queue.isEmpty()){\n int size = queue.size();\n LinkedList<Integer> res = new LinkedList<>();\n for(int i=0;i<size;i++){\n TreeNode cur = queue.pop();\n res.add(cur.val);\n if(cur.left != null) queue.offer(cur.left);\n if(cur.right != null) queue.offer(cur.right);\n }\n levelOrder.add(res);\n }\n //2. store the last element of each list\n LinkedList<Integer> ans = new LinkedList<>();\n for(LinkedList<Integer> l : levelOrder){\n int s = l.get(l.size() - 1);\n ans.add(s);\n }\n return ans;\n }", "public void printRightView(){\n \n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n Node<T> lastVal = null;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n\n // keep track of last node and dont print it\n lastVal = node;\n\n // Enqueue left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // print last node\n System.out.println(lastVal.data + \" ,\");\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "public void printDLRNodes(Node N) {\n if(N != null) {\n System.out.print(N.getData() + \" \");\n printDLRNodes(N.getLeft());\n printDLRNodes(N.getRight());\n }\n }", "public static void main(String[] args) {\n\n\t\tTreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node3.left = node6;\n node4.left = node7;\n \n System.out.println(preorderTraversalIterative(node1));\n System.out.println(preorderTraversalRecursive(node1));\n \n\t\t\n\t\t\n\t\t\n\t}", "public void levelOrderTraversal(TreeNode root){\n int height = height(root);\n for(int i = 0; i <=height; i++){\n System.out.println();\n printNodesInLevel(root,i);\n }\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tTreeNode r1 = new TreeNode(1);\n\t\tTreeNode r2 = new TreeNode(2);\n\t\tTreeNode r3 = new TreeNode(3);\n\t\tTreeNode r4 = new TreeNode(4);\n\t\tTreeNode r5 = new TreeNode(5);\n\t\tTreeNode r6 = new TreeNode(6);\n\t\tTreeNode r7 = new TreeNode(7);\n\t\tTreeNode r8 = new TreeNode(8);\n\t\t\n\t\tr1.left = r2;\n\t\tr1.right = r5;\n\t\tr2.left = r3;\n\t\tr2.right = r4;\n\t\tr5.right = r6;\n\t\tr6.left = r7;\n\t\tr6.right = r8;\n\t\t\n\t\tflatten(r1);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tTreeNode p = r1;\n\t\twhile(p !=null){\n\t\t\tsb.append(p.val+\"-->\");\n\t\t\tp=p.right;\n\t\t}\n\t\t\n\t\tSystem.out.println(sb);\n\t\t\n\t}", "public List<Integer> traversePreOrderIterative(TreeNode root) {\n if (root == null) {\n return Collections.emptyList();\n }\n\n List<Integer> result = new ArrayList<>();\n\n Deque<TreeNode> stack = new ArrayDeque<>();\n stack.add(root);\n\n while (!stack.isEmpty()) {\n TreeNode node = stack.pop();\n result.add(node.val);\n\n if (node.right != null) {\n stack.push(node.right);\n }\n\n if (node.left != null) {\n stack.push(node.left);\n }\n }\n\n return result;\n }", "public static void main(String[] args) {\n TreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n TreeNode node8 = new TreeNode(8);\n\n node1.left = node2;\n node2.left = node3;\n node3.left = node4;\n node4.left = node5;\n\n node2.right = node6;\n node6.left = node7;\n node7.right = node8;\n\n// int count = leaveCount(node1.left, 0);\n int count = leaveCountFast(node1.left);\n\n traverse(node1, 0, 5, -1000000);\n Main.print(count);\n }", "TreeNode<T> getRight();", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "private TreeNode traverseTree(Instance i) {\n TreeNode next = root;\n while (next != null && !next.isLeafNode()) {\n Attribute a = next.split.attribute;\n if (a.isNominal()) {\n next = next.nominals()[(int) i.value(a)];\n } else {\n if (i.value(a) < next.split.splitPoint) {\n next = next.left();\n } else {\n next = next.right();\n }\n }\n }\n return next;\n }", "public void levelOrderTraversal(TreeNode<T> root) {\n\t\tif(null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tLinkedList<TreeNode<T>> list = new LinkedList<TreeNode<T>>();\n\t\t\t\n\t\t\tlist.add(root);\n\t\t\t\n\t\t\twhile(!list.isEmpty()) {\n\t\t\t\tTreeNode<T> tempNode = list.removeFirst();\n\t\t\t\tSystem.out.println(tempNode);\n\t\t\t\t\n\t\t\t\tif(null != tempNode.getLeftChild()) {\n\t\t\t\t\tlist.addLast(tempNode.getLeftChild());\n\t\t\t\t}\n\t\t\t\t if(null != tempNode.getRightChild()) {\n\t\t\t\t\t list.addLast(tempNode.getRightChild());\n\t\t\t\t }\n\t\t\t\t tempNode = null; \n\t\t\t}\n\t\t}\n\t}", "public Node findRL(Node n) {\r\n\t\tif (n.rightChild == null) {\r\n\t\t\treturn n; \r\n\t\t} else { \r\n\t\t\treturn findRL(n.rightChild);\r\n\t\t}\r\n\t}", "private void rebalanceLeft(TreeNodeDataType n) {\n left(n);\r\n \r\n \r\n }", "public void levelOrderUsingRecurison(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint height=heightOfTree(root);\r\n\t\tfor (int i=0;i<=height;i++)\r\n\t\t{\r\n\t\t\tprintNodesAtGivenLevel(root,i+1);\t\t\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n \n\t\t\n\t\tNode root = new Node(8);\n\t\tinsertNode(root, 5);\n\t\tinsertNode(root, 3);\n\t\tinsertNode(root, 6);\n\t\tinsertNode(root, 2);\n\t\tinsertNode(root, 14);\n\t\tinsertNode(root, 13);\n\t\tinsertNode(root, 16);\n\t\tinsertNode(root, 12);\n\t\tinsertNode(root, 1);\n\t\tinsertNode(root, 11);\n \n\t\tprintRightOrder(root,0,-1);\n\t\t\n\t}", "public static void main(String args[])\n {\n /* creating a binary tree and entering the nodes */\n BinaryTree tree = new BinaryTree();\n tree.root = new TNode(12);\n tree.root.left = new TNode(10);\n tree.root.right = new TNode(30);\n tree.root.right.left = new TNode(25);\n tree.root.right.right = new TNode(40);\n tree.rightView();\n max_level=0;\n tree.leftView();\n }", "public void inOrderTraverseTree(Node focusNode) {\n if(focusNode != null) { // recursively traverse left child nodes first than right\n inOrderTraverseTree(focusNode.leftChild);\n\n System.out.println(focusNode); // print recursively inorder node (or return!)\n\n inOrderTraverseTree(focusNode.rightChild);\n\n }\n }", "public void traverse(double num){\n //This means go left\n if (num <= value){\n if (left == null){\n left = new Node(num);\n }\n else{\n left.traverse(num);\n }\n }//This means it goes left; num > value\n else{\n if (right == null){\n right = new Node(num);\n }\n else{\n right.traverse(num);\n }\n }\n }", "@Test\n public void test(){\n BinarySearchTree tree = new BinarySearchTree(new Node(35));\n\n tree.addNode(4);\n tree.addNode(15);\n tree.addNode(3);\n tree.addNode(1);\n tree.addNode(20);\n tree.addNode(8);\n tree.addNode(50);\n tree.addNode(40);\n tree.addNode(30);\n tree.addNode(80);\n tree.addNode(70);\n\n tree.addNode(90);\n\n tree.deleteNode(50);\n System.out.println(\"=====中序遍历 递归法=====\");\n TreeUtil.traverseInOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====中序遍历 迭代法=====\");\n TreeUtil.traverseInOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====前序遍历=====\");\n TreeUtil.traversePreOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====中序遍历 迭代法=====\");\n TreeUtil.traversePreOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====后序遍历=====\");\n TreeUtil.traversePostOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====后序遍历 迭代法=====\");\n TreeUtil.traversePostOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====层次遍历=====\");\n TreeUtil.traverseLevelOrder(tree.getRoot());\n\n int height = TreeUtil.getChildDepth(tree.getRoot());\n System.out.println(\"\");\n System.out.println(\"树高:\"+height);\n }", "public static void main(String[] args) {\n Node root = newNode(1);\n\n root.left = newNode(2);\n root.right = newNode(3);\n\n root.left.left = newNode(4);\n root.left.right = newNode(5);\n\n root.left.left.left = newNode(8);\n root.left.left.right = newNode(9);\n\n root.left.right. left = newNode(10);\n root.left.right. right = newNode(11);\n\n root.right.left = newNode(6);\n root.right.right = newNode(7);\n root.right.left .left = newNode(12);\n root.right.left .right = newNode(13);\n root.right.right. left = newNode(14);\n root.right.right. right = newNode(15);\n System.out.println(findNode(root, 5, 6, 15));\n }", "public void rightBoundary(TreeNode root) {\n if (root.right == null && root.left == null) return; // ignore leaf\n if (root.right != null) rightBoundary(root.right);\n else rightBoundary(root.left);\n result.add(root.val); // add after child visit(reverse)\n }", "public List<Long> depthTraverse(){\n return depthTraverseGen(null);\n }", "public static void main(String[] args) {\n String levelNodes = \"1,2,3,#,#,4,#,#,#\";\n TreeNode<String> level = of(levelNodes, \"#\", TraverseType.LEVEL);\n System.out.println(level);\n\n\n String postNodes = \"#,#,2,#,#,4,#,3,1\";\n TreeNode<String> post = of(postNodes, \"#\", TraverseType.POST);\n System.out.println(post);\n\n\n String preNodes = \"1,2,#,#,3,4,#,#,#\";\n TreeNode<String> pre = of(preNodes, \"#\", TraverseType.PRE);\n System.out.println(pre);\n }", "public static void main(String[] args) {\n\t\tint arr[] = {1,2,3,4,5,6,};\r\n\t\tTreenode<Integer> root= func(arr,0 , arr.length-1);\r\n\t\tprint(root);\r\n\t}", "public void inOrderTraverseRecursive();", "public static void main(String[] args) {\n TreeNode root = new TreeNode(20, null, null);\n TreeNode lvl2Node1 = insertTreeNode(true, 10, root);\n TreeNode lvl2Node2 = insertTreeNode(false, 1, root);\n TreeNode lvl3Node1 = insertTreeNode(true, 25, lvl2Node1);\n TreeNode lvl3Node2 = insertTreeNode(false, 26, lvl2Node1);\n TreeNode lvl3Node3 = insertTreeNode(true, 32, lvl2Node2);\n TreeNode lvl3Node4 = insertTreeNode(false, 37, lvl2Node2);\n insertTreeNode(true, 5, lvl3Node1);\n insertTreeNode(false, 6, lvl3Node2);\n insertTreeNode(false, 8, lvl3Node3);\n insertTreeNode(true, 10, lvl3Node4);\n\n\n breadthFirstSearchPrintTree(root);\n\n }", "public void traverse(Node node) {\n //pre order\n //System.out.println(node.data);\n\n if (node.leftChild != null) {\n traverse(node.leftChild);\n }\n //in order\n System.out.println(node.data);\n\n if (node.rightChild != null) {\n traverse(node.rightChild);\n }\n //post order\n //System.out.println(node.data);\n\n\n }", "public BinNode<T> getLeft();", "void printInOrder(Node R){\n if( R != null ){\n printInOrder(R.left);\n System.out.println(R.item.key + \" \" + R.item.value);\n printInOrder(R.right);\n }\n }", "public static void main(String[] args) {\n// TreeNode node1 = new TreeNode(0);\n// TreeNode node2l = new TreeNode(3);\n// TreeNode node2r = new TreeNode(5);\n//// TreeNode node3l = new TreeNode(2);\n// TreeNode node3r = new TreeNode(2);\n//// TreeNode node4l = new TreeNode(4);\n// TreeNode node4r = new TreeNode(1);\n//\n// node1.left = node2l;\n// node1.right = node2r;\n//// node2l.left = node3l;\n// node2l.right = node3r;\n// node3r.right = node4r;\n//\n\n int[] nums = {3, 2, 1, 6, 0, 5};\n\n }", "void traverse2() {\n BTNode node = root, prev = null, next;\n while (node != null) {\n if (prev == node.parent) {\n if (node.left != null) {\n next = node.left;\n }\n else if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else if (prev == node.left) {\n if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else {\n next = node.parent;\n }\n prev = node;\n node = next;\n }\n }", "private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }", "public static void main(String[] args) {\n BinayTree root = new BinayTree();\n root.data = 8;\n root.left = new BinayTree();\n root.left.data = 6;\n root.left.left = new BinayTree();\n root.left.left.data = 5;\n root.left.right = new BinayTree();\n root.left.right.data = 7;\n root.right = new BinayTree();\n root.right.data = 10;\n root.right.left = new BinayTree();\n root.right.left.data = 9;\n root.right.right = new BinayTree();\n root.right.right.data = 11;\n printTree(root);\n System.out.println();\n mirror(root);\n printTree(root);\n // 1\n // /\n // 3\n // /\n // 5\n // /\n // 7\n // /\n // 9\n BinayTree root2 = new BinayTree();\n root2.data = 1;\n root2.left = new BinayTree();\n root2.left.data = 3;\n root2.left.left = new BinayTree();\n root2.left.left.data = 5;\n root2.left.left.left = new BinayTree();\n root2.left.left.left.data = 7;\n root2.left.left.left.left = new BinayTree();\n root2.left.left.left.left.data = 9;\n System.out.println(\"\\n\");\n printTree(root2);\n System.out.println();\n mirror(root2);\n printTree(root2);\n\n // 0\n // \\\n // 2\n // \\\n // 4\n // \\\n // 6\n // \\\n // 8\n BinayTree root3 = new BinayTree();\n root3.data = 0;\n root3.right = new BinayTree();\n root3.right.data = 2;\n root3.right.right = new BinayTree();\n root3.right.right.data = 4;\n root3.right.right.right = new BinayTree();\n root3.right.right.right.data = 6;\n root3.right.right.right.right = new BinayTree();\n root3.right.right.right.right.data = 8;\n System.out.println(\"\\n\");\n printTree(root3);\n System.out.println();\n mirror(root3);\n printTree(root3);\n\n\n }", "public List<Integer> postorderTraversal1(TreeNode root) {\n List<Integer> traversal = new ArrayList<>();\n Deque<TreeNode> stack = new ArrayDeque<>();\n\n TreeNode current = root;\n\n while (current != null || !stack.isEmpty()) {\n\n // visit until the leaf\n while (current != null) {\n stack.push(current);\n\n // visit left right, then right, as in post-order\n if (current.left != null) {\n current = current.left;\n } else {\n current = current.right;\n // check in the end is to sure right is always visited\n }\n }\n\n // node as parent, its left and right child are both null\n TreeNode node = stack.pop();\n traversal.add(node.val); // node is added after both its children are visited\n\n // visit node's right sibling if it exists\n // stack.peek()\n // / \\\n // node to be visited\n if (!stack.isEmpty() && stack.peek().left == node) {\n current = stack.peek().right;\n }\n }\n\n return traversal;\n }", "private static void traversals(Node root) {\n\t\tSystem.out.println(\"Node Pre \" + root.data);\n\t\tfor(Node child : root.children) {\n\t\t\tSystem.out.println(\"Edge Pre \" + root.data + \"--\" + child.data);\n\t\t\ttraversals(child);\n\t\t\tSystem.out.println(\"Edge Post \" + root.data + \"--\" + child.data);\n\t\t}\n\t\tSystem.out.println(\"Node Post \" + root.data);\n\t}", "public void inorder()\r\n\t{\r\n\t\tif(root==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"tree is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// find the leftmost node of the tree\r\n\t\tNode p =root;\r\n\t\twhile(p.leftThread==false)\r\n\t\t\tp=p.left;\r\n\t\twhile(p!=null)//loop until we reach the right most node whose right link(rightThread) is null\r\n\t\t{\r\n\t\t\tSystem.out.print(p.info + \" \");\r\n\t\t\tif(p.rightThread==true) // if 'right' is pointing to the inorder successor\r\n\t\t\t\tp = p.right;\r\n\t\t\telse // find the inorder successor i.e the left most node in the right sub tree\r\n\t\t\t{\r\n\t\t\t\tp = p.right;\r\n\t\t\t\twhile(p.leftThread==false)\r\n\t\t\t\t\tp = p.left;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public List<Integer> rightSideView_bfs(TreeNode root) {\n List<Integer> list = new ArrayList<>();\n if(root == null){\n return list;\n }\n Queue<TreeNode> q = new LinkedList<>();\n q.offer(root);\n while(!q.isEmpty()){\n int len = q.size();\n for(int i=0; i<len; i++){\n TreeNode node = q.poll();\n if(i == 0){\n list.add(node.val);\n }\n if(node.left != null) q.offer(node.left);\n if(node.right != null) q.offer(node.right); \n }\n }\n return list;\n }", "public void preOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n preOrderTraverseTree(focusNode.leftChild);\n\n preOrderTraverseTree(focusNode.rightChild);\n\n }\n }", "public void printTree(Node n) {\r\n\t\tif( !n.isNil ) {\r\n\t\t\tSystem.out.print(\"Key: \" + n.key + \" c: \" + n.color + \" p: \" + n.p + \" v: \"+ n.val + \" mv: \" + n.maxval + \"\\t\\tleft.key: \" + n.left.key + \"\\t\\tright.key: \" + n.right.key + \"\\n\");\r\n\t\t\tprintTree(n.left);\r\n\t\t\tprintTree(n.right);\r\n\t\t}\r\n\t}", "public static void main(String[] args)\n throws Exception\n {\n PrintWriter pen = new PrintWriter(System.out, true);\n BST<String, String> dict =\n new BST<String, String>((left, right) -> left.compareTo(right));\n\n String[] values =\n new String[] { \"gorilla\", \"dingo\", \"chimp\", \"emu\", \"elephant\", \"beta\",\n \"aardvark\", \"chinchilla\", \"yeti\", \"gibbon\", \"horse\",\n \"elephant\", \"duck\", \"emu\" };\n String[] moreValues =\n new String[] { \"gnu\", \"dingo\", \"flying squirrel\", \"iguana\", \"squirrel\",\n \"red squirrel\", \"moose\" };\n\n // Add each element and make sure that it's there.\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n\n // A quick printout for fun\n pen.println(\"After setting the first set of values\");\n iterate(pen, dict.iterator());\n\n // Another quick printout for fun\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n pen.println(\"After setting the second set of values\");\n iterate(pen, dict.iterator());\n\n // Build iterators that traverse in different ways\n Iterable<String> df_pre_lr =\n dict.values(Traversal.DEPTH_FIRST_PREORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_lr =\n dict.values(Traversal.DEPTH_FIRST_INORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_rl =\n dict.values(Traversal.DEPTH_FIRST_INORDER_RIGHT_TO_LEFT);\n Iterable<String> bf_pre_rl =\n dict.values(Traversal.BREADTH_FIRST_PREORDER_RIGHT_TO_LEFT);\n\n // Iterate!\n pen.println(\"Iterating depth-first, preorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_pre_lr);\n \n pen.println(\"Iterating depth-first, inorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_in_lr);\n \n pen.println(\"Iterating depth-first, inorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, df_in_rl);\n \n pen.println(\"Iterating breadth-first, preorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, bf_pre_rl);\n\n // And we're done\n pen.close();\n }" ]
[ "0.6512704", "0.649675", "0.64723516", "0.642322", "0.6406655", "0.63904434", "0.6367901", "0.63225967", "0.62686306", "0.6089795", "0.608508", "0.60443443", "0.60366356", "0.6030832", "0.60155195", "0.59747696", "0.5960692", "0.5941504", "0.5910865", "0.5886656", "0.5867212", "0.5825406", "0.58135056", "0.5767738", "0.57661647", "0.57520443", "0.57381445", "0.5735701", "0.57313466", "0.572962", "0.57201475", "0.5703441", "0.5698854", "0.5695666", "0.5685687", "0.5676052", "0.56638837", "0.56572604", "0.56436306", "0.5626154", "0.5621887", "0.56209457", "0.56139785", "0.56130815", "0.56033725", "0.5590046", "0.5573643", "0.5560788", "0.55464566", "0.553954", "0.5532938", "0.55218756", "0.5518071", "0.5517814", "0.5516902", "0.550304", "0.54988426", "0.5494656", "0.5490097", "0.54873663", "0.54851294", "0.5484901", "0.54809916", "0.5470178", "0.5464442", "0.546249", "0.5460734", "0.54601586", "0.54595524", "0.5455435", "0.54460275", "0.54407746", "0.5438733", "0.5435342", "0.54304945", "0.54298794", "0.54236513", "0.54083085", "0.54061687", "0.53971666", "0.5396137", "0.5395373", "0.5395099", "0.53943807", "0.5394094", "0.5388501", "0.53877825", "0.5374847", "0.5368999", "0.53689796", "0.536831", "0.5367849", "0.5366116", "0.5360103", "0.5352667", "0.5350725", "0.534356", "0.5337523", "0.5337422", "0.5336863" ]
0.6782273
0
TraverseNLR method traverses tree from root, left subtree, then right subtree and outputs the values
public void TraverseNLR(TreeNode Root) { System.out.println(Root.Data); if(Root.Left != null) TraverseLNR(Root.Left); if(Root.Right != null) TraverseLNR(Root.Right); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void TraverseRNL(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public void TraverseLRN(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\t\r\n\t}", "public void TraverseNRL(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public void TraverseLNR(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public static void main(String[] args) {\n TreeNode node = new TreeNode();\n node.value = 1;\n node.left = new TreeNode();\n node.left.value = 2;\n node.right = new TreeNode();\n node.right.value = 3;\n node.left.left = new TreeNode();\n node.left.left.value = 4;\n node.left.right = new TreeNode();\n node.left.right.value = 5;\n node.right.left = new TreeNode();\n node.right.left.value = 6;\n node.right.right = new TreeNode();\n node.right.right.value = 7;\n// System.out.println(mirro(node).value);\n// System.out.println(mirro(node).left.value);\n// System.out.println(Arrays.toString(LevelPrintTree.levelPrint(mirro(node))));\n\n recur(node);\n\n }", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public void traverse(Node root){\n\t\tNode pred, current;\n\t\tcurrent=root;\n\t\tint rank=10;\n\t\tint rankCount=1;\n\t\twhile(current!=null){\n\t\t\tif(current.left==null){\n\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\trankCount++;\n\t\t\t\tcurrent=current.right;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpred=current.left;\n\t\t\t\twhile(pred.right!=null && pred.right!=current){\n\t\t\t\t\tpred=pred.right;\n\t\t\t\t}\n\n\t\t\t\tif(pred.right==null){\n\t\t\t\t\tpred.right=current;\n\t\t\t\t\tcurrent=current.left;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tpred.right=null;\n\t\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\trankCount++;\n\t\t\t\t\tcurrent=current.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void TraverseRLN(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t}", "@Test\r\n\tpublic void test(){\r\n\t\tTreeNode root = new TreeNode(1); \r\n TreeNode r2 = new TreeNode(2); \r\n TreeNode r3 = new TreeNode(3); \r\n TreeNode r4 = new TreeNode(4); \r\n TreeNode r5 = new TreeNode(5); \r\n TreeNode r6 = new TreeNode(6); \r\n root.left = r2; \r\n root.right = r3; \r\n r2.left = r4; \r\n r2.right = r5; \r\n r3.right = r6;\r\n System.out.println(getNodeNumRec(root));\r\n System.out.println(getNodeNum(root));\r\n System.out.println(getDepthRec(root));\r\n System.out.println(getDepth(root));\r\n System.out.println(\"前序遍历\");\r\n preorderTraversalRec(root);\r\n System.out.println(\"\");\r\n preorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"中序遍历\");\r\n inorderTraversalRec(root);\r\n System.out.println(\"\");\r\n inorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"后序遍历\");\r\n postorderTraversalRec(root);\r\n System.out.println(\"\");\r\n postorderTraversal(root);\r\n System.out.println(\"分层遍历\");\r\n levelTraversal(root);\r\n System.out.println(\"\");\r\n levelTraversalRec(root);\r\n\t}", "public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }", "public static void main(String[] args) {\n // TODO Auto-generated method stub\n int[] nums = {3, 2, 1, 6, 0, 5};\n TreeNode root = solution2(nums);\n System.out.println(root.val);\n System.out.println(root.left.val);\n System.out.println(root.left.right.val);\n System.out.println(root.left.right.right.val);\n System.out.println(root.right.val);\n System.out.println(root.right.left.val);\n System.out.println(root.right.right);\n }", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public static void main(String args[]){\n BinaryTreeNode root = new BinaryTreeNode();\n root.setData(1);\n\n BinaryTreeNode left = new BinaryTreeNode();\n left.setData(2);\n\n BinaryTreeNode right = new BinaryTreeNode();\n right.setData(3);\n\n BinaryTreeNode leftleft = new BinaryTreeNode();\n leftleft.setData(4);\n\n BinaryTreeNode leftright = new BinaryTreeNode();\n leftright.setData(5);\n\n root.setLeft(left);\n root.setRight(right);\n left.setLeft(leftleft);\n left.setRight(leftright);\n\n\n postOrderIterative(root);\n\n }", "public void reverseLevelOrderTraversel(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tQueue<TreeNode> que = new LinkedList<>();\r\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\r\n\t\t\r\n\t\tque.add(root);\r\n\t\twhile(que.size()>0)\r\n\t\t{\r\n\t\t\tTreeNode element=que.remove();\r\n\t\t\tif(element.right!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.right);\r\n\t\t\t}\r\n\t\t\tif(element.left!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.left);\r\n\t\t\t}\r\n\t\t\tstack.push(element);\r\n\t\t}\r\n\t\twhile(stack.size()>0)\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop().data+\" \");\r\n\t\t}\r\n\t\t\t\r\n\t}", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\n TreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n TreeNode node8 = new TreeNode(8);\n node1.right=node3;\n node1.left=node2;\n node2.left=node4;\n node3.right=node5;\n node4.right=node6;\n node6.left=node7;\n node6.right=node8;\n traversalRecursion(node1);\n System.out.println();\n nonRecurInTraverse(node1);\n }", "public static void main(String[] args){\n\t\tTreeNode node1 = new TreeNode(1);\n\t\tTreeNode node2 = new TreeNode(2);\n\t\tTreeNode node3 = new TreeNode(3);\n\t\tTreeNode node4 = new TreeNode(4);\n\t\tTreeNode node5 = new TreeNode(5);\n\t\tTreeNode node6 = new TreeNode(6);\n\t\tTreeNode node7 = new TreeNode(7);\n\t\tnode4.left = node2;\n\t\tnode4.right = node6;\n\t\tnode2.left = node1;\n\t\tnode2.right = node3;\n\t\tnode6.left = node5;\n\t\tnode6.right = node7;\n\t\t/*\n\t\t * 4\n\t\t * /\n\t\t * 5\n\t\t * \\\n\t\t * 6\n\t\t */\n\t\t/*node4.left = node5;\n\t\tnode5.right = node6;*/\n\t\t\n\t\ttreeTraversal2 tt = new treeTraversal2();\n\t\tSystem.out.print(\"Inorder Rcur: \");tt.inorderTraverse(node4);//1234567\n\t\tSystem.out.println();\t\t\n\t\tSystem.out.print(\"Inorder Iter: \");tt.stackInorder(node4);//1234567\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Rcur: \");tt.preorderTraverse(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Iter: \"); tt.stackPreorder(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Postorder Rcur: \");tt.postorderTraverse(node4);//1325764\n\t\tSystem.out.println();\t\t \n\t\tSystem.out.print(\"Postorder Iter: \");tt.stackPostorder(node4);//1325764\n\t\t//System.out.println();\n\t\t//System.out.print(\"Postorder Iter: \");tt.twoStackPostorder(node4);//1325764\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Level Iter: \");tt.levelTraverse(node4);//4261357\n\t}", "private int treeTraverse (TreeNode root, int previousVal) {\n if (root == null)\n return 0;\n \n // traverse left, then right\n int left = treeTraverse(root.left, root.val);\n int right = treeTraverse(root.right, root.val);\n \n // calculate the longest path\n path = Math.max(left + right, path);\n\n //return\n if (root.val == previousVal) \n return Math.max(left, right) + 1;\n \n return 0;\n }", "public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }", "public static void main(String[] args) {\n TreeNode n7 = new TreeNode(7);\n TreeNode n6 = new TreeNode(6);\n TreeNode n5 = new TreeNode(5);\n TreeNode n4 = new TreeNode(4);\n TreeNode n3 = new TreeNode(3);\n TreeNode n2 = new TreeNode(2);\n TreeNode n1 = new TreeNode(1);\n\n n4.left = n2;\n n4.right = n6;\n\n n2.left = n1;\n n2.right = n3;\n\n n6.left = n5;\n n6.right = n7;\n\n System.out.println(\"Cay n4\");\n List<Integer> resultPreOrder = preOrderTravel(n4);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n\n System.out.println(\"Cay n2\");\n resultPreOrder = preOrderTravel(n2);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n }", "private Voter traverseRBT(RedBlackTree.Node<Voter> root, Date birthdate) {\r\n \r\n RedBlackTree.Node<Voter> currentNode = root;\r\n //no voter in the database so none can be gotten\r\n if (currentNode == null) {\r\n throw new NoSuchElementException(\"There is no voter in the database\");\r\n }\r\n \r\n // if the current node matches that of that of the birthdate, return that node\r\n if (currentNode.data.compareTo(new Voter(birthdate)) == 0) {\r\n return currentNode.data;\r\n \r\n //if the current node does not match traverse down the subtrees\r\n \r\n } else if (currentNode.data.compareTo(new Voter(birthdate)) > 0) {\r\n // left subtree\r\n return traverseRBT(currentNode.leftChild, birthdate); //recursively traverse through left subtree\r\n } else {\r\n // right subtree\r\n return traverseRBT(currentNode.rightChild, birthdate); //recursively traverse through right subtree\r\n }\r\n }", "public void traverse(Node node) {\n //pre order\n //System.out.println(node.data);\n\n if (node.leftChild != null) {\n traverse(node.leftChild);\n }\n //in order\n System.out.println(node.data);\n\n if (node.rightChild != null) {\n traverse(node.rightChild);\n }\n //post order\n //System.out.println(node.data);\n\n\n }", "private TraverseData traverse(int treeIndex) {\n Node<T> newRoot = new Node<>(branchingFactor);\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData data = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, b));\n currentNode = data.currentNode;\n currentNewNode = data.currentNewNode;\n treeIndex = data.index;\n }\n return new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, 1);\n }", "public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}", "private void inOrderTraversal(int index) {\n // go through the graph as long as has values\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n inOrderTraversal(2 * index + 1);\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on right child\n inOrderTraversal(2 * index + 2);\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "private void inOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n inOrderTraversalRec(root.getLeft());\n System.out.print(root.getData() + \" \");\n inOrderTraversalRec(root.getRight());\n }", "private void traverse(TNode node)\r\n\t\t{\n\t\t\tif (node != null) {\r\n\t\t\t\ttraverse(node.getLeft());\r\n\r\n\t\t\t\tSystem.out.println(node);\r\n\r\n\t\t\t\ttraverse(node.getRight());\r\n\t\t\t}\r\n\r\n\t\t}", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "public void postOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n postOrderTraverseTree(focusNode.leftChild);\n postOrderTraverseTree(focusNode.rightChild);\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n }\n }", "public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "private static void traversals(Node root) {\n\t\tSystem.out.println(\"Node Pre \" + root.data);\n\t\tfor(Node child : root.children) {\n\t\t\tSystem.out.println(\"Edge Pre \" + root.data + \"--\" + child.data);\n\t\t\ttraversals(child);\n\t\t\tSystem.out.println(\"Edge Post \" + root.data + \"--\" + child.data);\n\t\t}\n\t\tSystem.out.println(\"Node Post \" + root.data);\n\t}", "public static void main(String[] args) {\n\t\ttn=new TreeNode(null,null,null,1);\n\t\tTreeNode tleft=new TreeNode(tn,null,null,2);\n\t\tTreeNode tright=new TreeNode(tn,null,null,3);\n\t\ttn.left=tleft;\n\t\ttn.right=tright;\n\t\t\n\t\tTreeNode tleft1=new TreeNode(tleft,null,null,4);\n\t\tTreeNode tright1=new TreeNode(tleft,null,null,5);\n\t\ttleft.left=tleft1;\n\t\ttleft.right=tright1;\n\t\t\n\t\tTreeNode tleft2=new TreeNode(tright,null,null,6);\n\t\tTreeNode tright2=new TreeNode(tright,null,null,7);\n\t\ttright.left=tleft2;\n\t\ttright.right=tright2;\n\t\t\n\t\tTreeNode tleft3=new TreeNode(tleft1,null,null,8);\n\t\tTreeNode tright3=new TreeNode(tleft1,null,null,9);\n\t\ttleft1.left=tleft3;\n\t\ttleft1.right=tright3;\n\t\t\n\t\tTreeNode tleft4=new TreeNode(tright1,null,null,10);\n\t\tTreeNode tright4=new TreeNode(tright1,null,null,11);\n\t\ttright1.left=tleft4;\n\t\ttright1.right=tright4;\n\t\t\n\t\tSystem.out.println(inorderTraversal2(tn));\n\t}", "protected abstract void traverse();", "public static void main(String[] args) {\n\t\tBinary_Tree_Level_Order_Traversal_102 b=new Binary_Tree_Level_Order_Traversal_102();\n\t\tTreeNode root=new TreeNode(3);\n\t\troot.left=new TreeNode(9);\n\t\troot.right=new TreeNode(20);\n\t\troot.right.left=new TreeNode(15);\n\t\troot.right.right=new TreeNode(7);\n\t\tList<List<Integer>> res=b.levelOrder(root);\n\t\tfor(List<Integer> list:res){\n\t\t\tfor(Integer i:list){\n\t\t\t\tSystem.out.print(i+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void traversal (\n TreeNodeVisitor visitor\n ) {\n\n visitor.visit (this);\n if (children != null) {\n for (SceneOctTree child : children) child.traversal (visitor);\n } // if\n\n }", "private TreeNode traverseTree(Instance i) {\n TreeNode next = root;\n while (next != null && !next.isLeafNode()) {\n Attribute a = next.split.attribute;\n if (a.isNominal()) {\n next = next.nominals()[(int) i.value(a)];\n } else {\n if (i.value(a) < next.split.splitPoint) {\n next = next.left();\n } else {\n next = next.right();\n }\n }\n }\n return next;\n }", "void traverse2() {\n BTNode node = root, prev = null, next;\n while (node != null) {\n if (prev == node.parent) {\n if (node.left != null) {\n next = node.left;\n }\n else if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else if (prev == node.left) {\n if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else {\n next = node.parent;\n }\n prev = node;\n node = next;\n }\n }", "public static void main(String[] args) {\n\n Node<Integer> node1 = new Node<>(1);\n Node<Integer> node2 = new Node<>(2);\n Node<Integer> node3 = new Node<>(3);\n Node<Integer> node4 = new Node<>(4);\n\n node1.setLeftChild(node2);\n node1.setRightChild(node3);\n\n node2.setLeftChild(node4);\n\n node3.setLeftChild(new Node<>(5));\n node3.setRightChild(new Node<>(6));\n\n node4.setLeftChild(new Node<>(7));\n node4.setRightChild(new Node<>(8));\n\n traverse(node1);\n }", "public void inOrderTraverseTree(Node focusNode) {\n if(focusNode != null) { // recursively traverse left child nodes first than right\n inOrderTraverseTree(focusNode.leftChild);\n\n System.out.println(focusNode); // print recursively inorder node (or return!)\n\n inOrderTraverseTree(focusNode.rightChild);\n\n }\n }", "public ArrayList<K> inOrdorTraverseBST(){\n BSTNode<K> currentNode = this.rootNode;\n LinkedList<BSTNode<K>> nodeStack = new LinkedList<BSTNode<K>>();\n ArrayList<K> result = new ArrayList<K>();\n \n if (currentNode == null)\n return null;\n \n while (currentNode != null || nodeStack.size() > 0) {\n while (currentNode != null) {\n nodeStack.add(currentNode);\n currentNode = currentNode.getLeftChild();\n }\n currentNode = nodeStack.pollLast();\n result.add(currentNode.getId());\n currentNode = currentNode.getRightChild();\n }\n \n return result;\n }", "public void printLRDNodes(Node N) {\n if(N != null) {\n printLRDNodes(N.getLeft());\n printLRDNodes(N.getRight());\n System.out.print(N.getData() + \" \");\n }\n }", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "public void levelOrderTraversal(TreeNode root){\n int height = height(root);\n for(int i = 0; i <=height; i++){\n System.out.println();\n printNodesInLevel(root,i);\n }\n }", "void inOrderTraversal(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tinOrderTraversal( node.left );\r\n\t\tSystem.out.print( node.value + \" \");\r\n\t\tinOrderTraversal( node.right );\r\n\t}", "static void inorderTraversal(Node root) {\n if (root == null) {\n return;\n }\n inorderTraversal(root.left);\n System.out.print(root.data + \" \");\n inorderTraversal(root.right);\n }", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "private void postOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n postOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n postOrderTraversal(2 * index + 2);\n // print the node\n System.out.print(array[index] + \", \");\n }", "public static void main(String[] args) {\n \n LinkedBinaryTree expr = new LinkedBinaryTree<String>();\n // a is the root of the tree\n Position a, b, c, d, e, f, g, h, i;\n a = expr.addRoot(\"*\");\n b = expr.addLeft(a, \"+\");\n c = expr.addLeft(b, \"/\");\n d = expr.addLeft(c, \"*\");\n e = expr.addLeft(d, \"+\");\n expr.addLeft(e, \"5\");\n expr.addRight(e, \"2\");\n f = expr.addRight(d, \"-\");\n expr.addLeft(f, \"2\");\n expr.addRight(f, \"1\");\n g = expr.addRight(c, \"+\");\n expr.addLeft(g, \"2\");\n expr.addRight(g, \"9\");\n h = expr.addRight(b, \"-\");\n i = expr.addLeft(h, \"-\");\n expr.addLeft(i, \"7\");\n expr.addRight(i, \"2\");\n expr.addRight(h, \"1\");\n expr.addRight(a, \"8\");\n \n System.out.println(\"The original expression:\");\n System.out.println(\"(((5+2)*(2–1)/(2+9)+((7–2)–1))*8)\\n\");\n \n System.out.println(\"Preorder traversal:\");\n Iterable<Position<String>> preIter = expr.preorder();\n for (Position<String> s : preIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Inorder traversal:\");\n Iterable<Position<String>> inIter = expr.inorder();\n for (Position<String> s : inIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Postorder traversal:\");\n Iterable<Position<String>> postIter = expr.postorder();\n for (Position<String> s : postIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Breadth traversal:\");\n Iterable<Position<String>> breadthIter = expr.breadthfirst();\n for (Position<String> s : breadthIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Parenthesized representation:\"); \n printParenthesize(expr, a);\n System.out.println();\n }", "public static void leftToRight(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n leftToRight(root.left, level-1);\n leftToRight(root.right, level-1);\n }\n\n }", "public void inOrderTree(TernaryTreeNode root)\n {\n if(root==null) return;\n \n \n inOrderTree(root.left);\n inOrderTree(root.middle);\n inOrderTree(root.right);\n System.out.print(root.data+\" \");\n \n }", "public void rightViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == 0) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n }", "public static void main(String[] args)\n throws Exception\n {\n PrintWriter pen = new PrintWriter(System.out, true);\n BST<String, String> dict =\n new BST<String, String>((left, right) -> left.compareTo(right));\n\n String[] values =\n new String[] { \"gorilla\", \"dingo\", \"chimp\", \"emu\", \"elephant\", \"beta\",\n \"aardvark\", \"chinchilla\", \"yeti\", \"gibbon\", \"horse\",\n \"elephant\", \"duck\", \"emu\" };\n String[] moreValues =\n new String[] { \"gnu\", \"dingo\", \"flying squirrel\", \"iguana\", \"squirrel\",\n \"red squirrel\", \"moose\" };\n\n // Add each element and make sure that it's there.\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n\n // A quick printout for fun\n pen.println(\"After setting the first set of values\");\n iterate(pen, dict.iterator());\n\n // Another quick printout for fun\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n pen.println(\"After setting the second set of values\");\n iterate(pen, dict.iterator());\n\n // Build iterators that traverse in different ways\n Iterable<String> df_pre_lr =\n dict.values(Traversal.DEPTH_FIRST_PREORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_lr =\n dict.values(Traversal.DEPTH_FIRST_INORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_rl =\n dict.values(Traversal.DEPTH_FIRST_INORDER_RIGHT_TO_LEFT);\n Iterable<String> bf_pre_rl =\n dict.values(Traversal.BREADTH_FIRST_PREORDER_RIGHT_TO_LEFT);\n\n // Iterate!\n pen.println(\"Iterating depth-first, preorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_pre_lr);\n \n pen.println(\"Iterating depth-first, inorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_in_lr);\n \n pen.println(\"Iterating depth-first, inorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, df_in_rl);\n \n pen.println(\"Iterating breadth-first, preorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, bf_pre_rl);\n\n // And we're done\n pen.close();\n }", "void printInOrder(Node R){\n if( R != null ){\n printInOrder(R.left);\n System.out.println(R.item.key + \" \" + R.item.value);\n printInOrder(R.right);\n }\n }", "public void printRightView(){\n \n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n Node<T> lastVal = null;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n\n // keep track of last node and dont print it\n lastVal = node;\n\n // Enqueue left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // print last node\n System.out.println(lastVal.data + \" ,\");\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "void traverse(BTNode node) {\n if (node == null){\n return;\n }\n traverse(node.left);\n traverse(node.right);\n }", "public static void main(String[] args) {\n\t\tTreeNode root = new TreeNode(1);\n\t\troot.right = new TreeNode(2);\n\t\t//root.left.left = new TreeNode(3);\n\t\t//root.left.right = new TreeNode(3);\n\t\troot.right.left = new TreeNode(3);\n\t\t//root.right.right = new TreeNode(3);\n\t\t\n\t\tSystem.out.println(inorderTraversal(root));\n\t}", "public static void main(String[] args) {\n String levelNodes = \"1,2,3,#,#,4,#,#,#\";\n TreeNode<String> level = of(levelNodes, \"#\", TraverseType.LEVEL);\n System.out.println(level);\n\n\n String postNodes = \"#,#,2,#,#,4,#,3,1\";\n TreeNode<String> post = of(postNodes, \"#\", TraverseType.POST);\n System.out.println(post);\n\n\n String preNodes = \"1,2,#,#,3,4,#,#,#\";\n TreeNode<String> pre = of(preNodes, \"#\", TraverseType.PRE);\n System.out.println(pre);\n }", "public void inOrderTraverseRecursive();", "public static void main(String[] args){\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.right = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.right = new TreeNode(4);\n root.right.left = new TreeNode(4);\n root.right.right = new TreeNode(6);\n \n System.out.println(levelOrder(root)); // output: [[1], [2, 2], [6, 4, 4, 6]]\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tTreeNode r1 = new TreeNode(1);\n\t\tTreeNode r2 = new TreeNode(2);\n\t\tTreeNode r3 = new TreeNode(3);\n\t\tTreeNode r4 = new TreeNode(4);\n\t\tTreeNode r5 = new TreeNode(5);\n\t\tTreeNode r6 = new TreeNode(6);\n\t\tTreeNode r7 = new TreeNode(7);\n\t\tTreeNode r8 = new TreeNode(8);\n\t\t\n\t\tr1.left = r2;\n\t\tr1.right = r5;\n\t\tr2.left = r3;\n\t\tr2.right = r4;\n\t\tr5.right = r6;\n\t\tr6.left = r7;\n\t\tr6.right = r8;\n\t\t\n\t\tflatten(r1);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tTreeNode p = r1;\n\t\twhile(p !=null){\n\t\t\tsb.append(p.val+\"-->\");\n\t\t\tp=p.right;\n\t\t}\n\t\t\n\t\tSystem.out.println(sb);\n\t\t\n\t}", "public TraversalResults traverse(ObjectNode traverse);", "private void preOrdertraverse(Node root){\n System.out.println(root.value);\n for(var child : root.getChildren())\n preOrdertraverse(child); //recursively travels other childrens in current child\n }", "public void traverse(double num){\n //This means go left\n if (num <= value){\n if (left == null){\n left = new Node(num);\n }\n else{\n left.traverse(num);\n }\n }//This means it goes left; num > value\n else{\n if (right == null){\n right = new Node(num);\n }\n else{\n right.traverse(num);\n }\n }\n }", "public static void main(String[] args) {\n Node root = new Node(1);\n\n Node left = new Node(2);\n left.left = new Node(4);\n left.right = new Node(3);\n\n Node right = new Node(5);\n right.left = new Node(6);\n right.right = new Node(7);\n\n root.left = left;\n root.right = right;\n\n Traversal traversal = new Traversal();\n traversal.preOrder(root);\n System.out.println();\n traversal.postOrder(root);\n System.out.println();\n traversal.inOrder(root);\n System.out.println();\n traversal.levelOrder(root);\n //System.out.println(checkBST(root));\n }", "public static void main(String args[])\n {\n /* creating a binary tree and entering the nodes */\n BinaryTree tree = new BinaryTree();\n tree.root = new TNode(12);\n tree.root.left = new TNode(10);\n tree.root.right = new TNode(30);\n tree.root.right.left = new TNode(25);\n tree.root.right.right = new TNode(40);\n tree.rightView();\n max_level=0;\n tree.leftView();\n }", "public String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "public void postOrderTraverseTree(Node focusNode) {\n\n\t\tif (focusNode != null) {\n\n\t\t\tpreorderTraverseTree(focusNode.left);\n\t\t\tpreorderTraverseTree(focusNode.right);\n\n\t\t\tSystem.out.print(focusNode.data + \" \");\n\n\t\t}\n\n\t}", "public void levelOrderTraversal(TreeNode<T> root) {\n\t\tif(null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tLinkedList<TreeNode<T>> list = new LinkedList<TreeNode<T>>();\n\t\t\t\n\t\t\tlist.add(root);\n\t\t\t\n\t\t\twhile(!list.isEmpty()) {\n\t\t\t\tTreeNode<T> tempNode = list.removeFirst();\n\t\t\t\tSystem.out.println(tempNode);\n\t\t\t\t\n\t\t\t\tif(null != tempNode.getLeftChild()) {\n\t\t\t\t\tlist.addLast(tempNode.getLeftChild());\n\t\t\t\t}\n\t\t\t\t if(null != tempNode.getRightChild()) {\n\t\t\t\t\t list.addLast(tempNode.getRightChild());\n\t\t\t\t }\n\t\t\t\t tempNode = null; \n\t\t\t}\n\t\t}\n\t}", "public void postOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tpostOrderTraversal(root.getLeftChild());\n\t\t\tpostOrderTraversal(root.getRightChild());\n\t\t\tSystem.out.println(root);\n\t\t}\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n System.out.println(new Solution().preorderTraversal(null));\n }", "void traverseInOrder(Node node){\n if (node != null) {\n traversePreOrder(node.left); // fokus left sampai dihabiskan, lalu right (berbasis sub-tree)\n System.out.println(\" \" + node.data);\n traversePreOrder(node.right);\n }\n }", "public AVLTreeNode traverseTree(AVLTreeNode root, int key) {\r\n if (root == null)\r\n return null;\r\n if (root.key == key)\r\n return root;\r\n if (root.key > key)\r\n return traverseTree(root.left, key);\r\n else\r\n return traverseTree(root.right, key);\r\n }", "public static void main(String[] args) { Scanner scanner = new Scanner(System.in);\n// System.out.println(\"Please read number of levels for tree: \");\n// int n = scanner.nextInt();\n//\n// System.out.println(\"The tree will have \" + n + \" levels\");\n//\n Tree tree = new Tree();\n// tree.generateDefaultTree(n);\n tree.readUnbalancedTree();\n System.out.println(\"Display NLR:\");\n tree.showTreeNLR(tree.root);\n System.out.println();\n System.out.println(\"Display LNR\");\n tree.showTreeLNR(tree.root);\n System.out.println();\n System.out.println(\"Display LRN\");\n tree.showTreeLRN(tree.root);\n }", "public static void main(String[] args) {\n\t\tint arr[] = {1,2,3,4,5,6,};\r\n\t\tTreenode<Integer> root= func(arr,0 , arr.length-1);\r\n\t\tprint(root);\r\n\t}", "public static void main(String[] args) {\n TreeNode n20 = new TreeNode(20);\n TreeNode n8 = new TreeNode(8);\n TreeNode n4 = new TreeNode(4);\n TreeNode n7 = new TreeNode(7);\n TreeNode n12 = new TreeNode(12);\n TreeNode n14 = new TreeNode(14);\n TreeNode n21 = new TreeNode(21);\n TreeNode n22 = new TreeNode(22);\n TreeNode n25 = new TreeNode(25);\n TreeNode n24 = new TreeNode(24);\n n20.left = n8;\n n20.right = n22;\n n8.left = n4;\n n8.right = n12;\n n4.right = n7;\n n12.right = n14;\n n22.left = n21;\n n22.right = n25;\n n25.left = n24;\n\n for (Integer i : printBoundary(n20)) {\n System.out.println(i);\n }\n }", "TreeNode<T> getRight();", "private TraverseData traverseOneLevel(TraverseData data) {\n Node<T> currentNode = data.currentNode;\n Node<T> currentNewNode = data.currentNewNode;\n int nextBranch = data.index / data.base;\n\n currentNewNode.set(nextBranch, new Node<>(branchingFactor));\n for (int anotherBranch = 0; anotherBranch < branchingFactor; anotherBranch++) {\n if (anotherBranch == nextBranch) {\n continue;\n }\n currentNewNode.set(anotherBranch, currentNode.get(anotherBranch));\n }\n\n //down\n currentNode = currentNode.get(nextBranch);\n currentNewNode = currentNewNode.get(nextBranch);\n return new TraverseData(currentNode, currentNewNode, data.newRoot, data.index % data.base,\n data.base);\n }", "public List<Long> depthTraverse(){\n return depthTraverseGen(null);\n }", "public void inorderTraversal(Node root) {\r\n\t\tif(root != null) {\r\n\t\t\tinorderTraversal(root.leftChild);\r\n\t\t\tSystem.out.print(root.data + \" \");\r\n\t\t\tinorderTraversal(root.rightChild);\r\n\t\t}\r\n\t}", "@Override\n public void traverse()\n {\n System.out.print(\"DFS Tree: \");\n DFSHelper(root);\n System.out.println();\n }", "@Test\n public void test(){\n BinarySearchTree tree = new BinarySearchTree(new Node(35));\n\n tree.addNode(4);\n tree.addNode(15);\n tree.addNode(3);\n tree.addNode(1);\n tree.addNode(20);\n tree.addNode(8);\n tree.addNode(50);\n tree.addNode(40);\n tree.addNode(30);\n tree.addNode(80);\n tree.addNode(70);\n\n tree.addNode(90);\n\n tree.deleteNode(50);\n System.out.println(\"=====中序遍历 递归法=====\");\n TreeUtil.traverseInOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====中序遍历 迭代法=====\");\n TreeUtil.traverseInOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====前序遍历=====\");\n TreeUtil.traversePreOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====中序遍历 迭代法=====\");\n TreeUtil.traversePreOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====后序遍历=====\");\n TreeUtil.traversePostOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====后序遍历 迭代法=====\");\n TreeUtil.traversePostOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====层次遍历=====\");\n TreeUtil.traverseLevelOrder(tree.getRoot());\n\n int height = TreeUtil.getChildDepth(tree.getRoot());\n System.out.println(\"\");\n System.out.println(\"树高:\"+height);\n }", "private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }", "private void preOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on left child\n preOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n preOrderTraversal(2 * index + 2);\n }", "public static void main(String[] args) throws AVLTreeException, BSTreeException, IOException {\n\t\tint bsDepths = 0, avlDepths = 0; // tracks the sum of the depths of every node\n\t\tScanner inFile = new Scanner(new FileReader(args[0]));\n\t\tAVLTree<String> avltree = new AVLTree<>();\n\t\tBSTree<String> bstree = new BSTree<>();\n\t\tFunction<String, PrintStream> printUpperCase = x -> System.out.printf(\"%S\\n\", x); // function example from Duncan. Hope this is okay :)\n\t\tArrayList<String> words = new ArrayList<>(); // Way to store the words without opening the file twice\n\t\twhile (inFile.hasNext()) { // inserting words into each tree without using an extra loop\n\t\t\twords.add(inFile.next().toUpperCase());\n\t\t\tbstree.insert(words.get(words.size() - 1));\n\t\t\tavltree.insert(words.get(words.size() - 1));\n\t\t}\n\t\tinFile.close();\n\t\t// VVV Prints table 1 VVV\n\t\tSystem.out.printf(\"Table 1: Binary Search Tree [%s]\\n\" + \"Level-Order Traversal\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Word\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\", args[0]);\n\t\tbstree.levelTraverse(printUpperCase);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\t// VVV Prints table 2 VVV\n\t\tSystem.out.printf(\n\t\t\t\t\"Table 2: AVL Tree [%s]\\n\" + \"Level-Order Traversal\\n\" + \"=========================================\\n\"\n\t\t\t\t\t\t+ \"Word\\n\" + \"-----------------------------------------\\n\",\n\t\t\t\targs[0]);\n\t\tavltree.levelTraverse(printUpperCase);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\t// VVV Prints table 3 VVV\n\t\tSystem.out.printf(\"Table 3:Number of Nodes vs Height vs Diameter\\n\" + \"Using Data in [%s]\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Tree # Nodes Height Diameter\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\" + \"BST\\t%d\\t %d\\t %d\\n\" + \"AVL\\t%d\\t %d\\t %d\\n\",\n\t\t\t\targs[0], bstree.size(), bstree.height(), bstree.diameter(), avltree.size(), avltree.height(),\n\t\t\t\tavltree.diameter());\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t\tfor (int i = 0; i < words.size(); i++) { //searches the trees for each word, totaling their depths\n\t\t\tbsDepths += 1 + bstree.depth(words.get(i));\n\t\t\tavlDepths += 1 + avltree.depth(words.get(i));\n\t\t}\n\t\t// VVV Prints table 4 VVV\n\t\tSystem.out.printf(\"Table 4:Total Number of Node Accesses\\n\" + \"Searching for all the Words in [%s]\\n\"\n\t\t\t\t+ \"=========================================\\n\" + \"Tree # Nodes\\n\"\n\t\t\t\t+ \"-----------------------------------------\\n\" + \"BST %d\\n\" + \"AVL %d\\n\",\n\t\t\t\targs[0], bsDepths, avlDepths);\n\t\tSystem.out.println(\"-----------------------------------------\\n\");\n\t}", "public void inOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tinOrderTraversal(root.getLeftChild());\n\t\t\tSystem.out.println(root);\n\t\t\tinOrderTraversal(root.getRightChild());\n\t\t}\n\t}", "void inOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tinOrderTraversal(node.getLeftNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tinOrderTraversal(node.getRightNode());\n\t}", "public static <T> void inorderIterative(TreeNode<T> root)\n {\n // create an empty stack\n Stack<TreeNode> stack = new Stack();\n\n // start from root node (set current node to root node)\n TreeNode curr = root;\n\n // if current node is null and stack is also empty, we're done\n while (!stack.empty() || curr != null)\n {\n // if current node is not null, push it to the stack (defer it)\n // and move to its left child\n if (curr != null)\n {\n stack.push(curr);\n curr = curr.left;\n }\n else\n {\n // else if current node is null, we pop an element from stack,\n // print it and finally set current node to its right child\n curr = stack.pop();\n System.out.print(curr.value + \" \");\n\n curr = curr.right;\n }\n }\n }", "void inorder(Node root) {\n\t\tboolean leftdone = false;\n\n\t\t// Start traversal from root\n\t\twhile (root != null) {\n\t\t\t// If left child is not traversed, find the\n\t\t\t// leftmost child\n\t\t\tif (!leftdone) {\n\t\t\t\twhile (root.left != null) {\n\t\t\t\t\troot = root.left;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print root's data\n\t\t\tSystem.out.print(root.data + \" \");\n\n\t\t\t// Mark left as done\n\t\t\tleftdone = true;\n\n\t\t\t// If right child exists\n\t\t\tif (root.right != null) {\n\t\t\t\tleftdone = false;\n\t\t\t\troot = root.right;\n\t\t\t}\n\n\t\t\t// If right child doesn't exist, move to parent\n\t\t\telse if (root.parent != null) {\n\t\t\t\t// If this node is right child of its parent,\n\t\t\t\t// visit parent's parent first\n\t\t\t\twhile (root.parent != null && root == root.parent.right)\n\t\t\t\t\troot = root.parent;\n\n\t\t\t\tif (root.parent == null)\n\t\t\t\t\tbreak;\n\t\t\t\troot = root.parent;\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t}\n\t}", "private static List<Integer> printTree(Tree tree, List values){\n int height = heightOfTree(tree);\n\n for(int i=1;i<=height;i++) {\n System.out.println(\"\");\n printTreeInLevel(tree, i, values);\n }\n return values;\n}", "public void leftViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == queue.size()) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n\n }", "protected void visitRightSubtree() {\n\t\tif(tree.hasRightNode()) {\n\t\t\ttree.moveToRightNode();\n\t\t\ttraverse();\n\t\t\ttree.moveToParentNode();\n\t\t}\n\t}", "public void inOrderTraverseTree(Node focusNode) {\n\n\t\tif (focusNode != null) {\n\n\t\t\t// Traverse the left node\n\n\t\t\tpreorderTraverseTree(focusNode.left);\n\n\t\t\t// Visit the currently focused on node\n\n\t\t\tSystem.out.print(focusNode.data + \" \");\n\n\t\t\t// Traverse the right node\n\n\t\t\tpreorderTraverseTree(focusNode.right);\n\n\t\t}\n\n\t}", "private RegressionTreeNode traverseNominalNode(Serializable value) {\n\t\tif(value.equals(this.value)){\n\t\t\treturn this.leftChild;\n\t\t}else{\n\t\t\treturn this.rightChild;\n\t\t}\n\t}" ]
[ "0.656927", "0.6439719", "0.62976605", "0.6264961", "0.6246535", "0.6231959", "0.62073827", "0.61638665", "0.61513025", "0.6114864", "0.60459197", "0.59869766", "0.59831166", "0.5948399", "0.5874084", "0.58731985", "0.5836108", "0.58347374", "0.5824642", "0.58175737", "0.5812892", "0.580263", "0.57962084", "0.5794465", "0.57895344", "0.57870984", "0.57700974", "0.5756635", "0.5747169", "0.5744602", "0.5741247", "0.5730464", "0.5720114", "0.57124484", "0.5690451", "0.5657238", "0.565691", "0.5642992", "0.5636821", "0.5631816", "0.5619152", "0.5601586", "0.5596779", "0.5594345", "0.5576019", "0.55747604", "0.5573078", "0.55663824", "0.5566068", "0.5561032", "0.5551844", "0.5543241", "0.55303997", "0.55242604", "0.5520914", "0.55190736", "0.55149543", "0.5505999", "0.55020285", "0.54917955", "0.548896", "0.5488023", "0.5477858", "0.54726577", "0.546681", "0.54558605", "0.54431075", "0.54373944", "0.54359055", "0.54249024", "0.5424793", "0.54128134", "0.5412075", "0.5410084", "0.54077107", "0.5399216", "0.53986806", "0.539296", "0.5388097", "0.538419", "0.5382459", "0.5381103", "0.53780293", "0.537347", "0.53653723", "0.53625417", "0.5360209", "0.5344659", "0.5341261", "0.53399676", "0.53353804", "0.5332638", "0.5330596", "0.5323823", "0.53137714", "0.53127044", "0.53090644", "0.5306975", "0.5302296", "0.5302102" ]
0.6696102
0
TraverseNRL method traverses tree from root, right subtree, then left subtree and outputs the values
public void TraverseNRL(TreeNode Root) { System.out.println(Root.Data); if(Root.Right != null) TraverseLNR(Root.Right); if(Root.Left != null) TraverseLNR(Root.Left); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void TraverseRLN(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t}", "public static void main(String[] args) {\n TreeNode node = new TreeNode();\n node.value = 1;\n node.left = new TreeNode();\n node.left.value = 2;\n node.right = new TreeNode();\n node.right.value = 3;\n node.left.left = new TreeNode();\n node.left.left.value = 4;\n node.left.right = new TreeNode();\n node.left.right.value = 5;\n node.right.left = new TreeNode();\n node.right.left.value = 6;\n node.right.right = new TreeNode();\n node.right.right.value = 7;\n// System.out.println(mirro(node).value);\n// System.out.println(mirro(node).left.value);\n// System.out.println(Arrays.toString(LevelPrintTree.levelPrint(mirro(node))));\n\n recur(node);\n\n }", "public void TraverseRNL(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public void TraverseLRN(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\t\r\n\t}", "public void TraverseNLR(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "@Test\r\n\tpublic void test(){\r\n\t\tTreeNode root = new TreeNode(1); \r\n TreeNode r2 = new TreeNode(2); \r\n TreeNode r3 = new TreeNode(3); \r\n TreeNode r4 = new TreeNode(4); \r\n TreeNode r5 = new TreeNode(5); \r\n TreeNode r6 = new TreeNode(6); \r\n root.left = r2; \r\n root.right = r3; \r\n r2.left = r4; \r\n r2.right = r5; \r\n r3.right = r6;\r\n System.out.println(getNodeNumRec(root));\r\n System.out.println(getNodeNum(root));\r\n System.out.println(getDepthRec(root));\r\n System.out.println(getDepth(root));\r\n System.out.println(\"前序遍历\");\r\n preorderTraversalRec(root);\r\n System.out.println(\"\");\r\n preorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"中序遍历\");\r\n inorderTraversalRec(root);\r\n System.out.println(\"\");\r\n inorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"后序遍历\");\r\n postorderTraversalRec(root);\r\n System.out.println(\"\");\r\n postorderTraversal(root);\r\n System.out.println(\"分层遍历\");\r\n levelTraversal(root);\r\n System.out.println(\"\");\r\n levelTraversalRec(root);\r\n\t}", "public void traverse(Node root){\n\t\tNode pred, current;\n\t\tcurrent=root;\n\t\tint rank=10;\n\t\tint rankCount=1;\n\t\twhile(current!=null){\n\t\t\tif(current.left==null){\n\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\trankCount++;\n\t\t\t\tcurrent=current.right;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpred=current.left;\n\t\t\t\twhile(pred.right!=null && pred.right!=current){\n\t\t\t\t\tpred=pred.right;\n\t\t\t\t}\n\n\t\t\t\tif(pred.right==null){\n\t\t\t\t\tpred.right=current;\n\t\t\t\t\tcurrent=current.left;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tpred.right=null;\n\t\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\trankCount++;\n\t\t\t\t\tcurrent=current.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public static void main(String[] args) {\n TreeNode n7 = new TreeNode(7);\n TreeNode n6 = new TreeNode(6);\n TreeNode n5 = new TreeNode(5);\n TreeNode n4 = new TreeNode(4);\n TreeNode n3 = new TreeNode(3);\n TreeNode n2 = new TreeNode(2);\n TreeNode n1 = new TreeNode(1);\n\n n4.left = n2;\n n4.right = n6;\n\n n2.left = n1;\n n2.right = n3;\n\n n6.left = n5;\n n6.right = n7;\n\n System.out.println(\"Cay n4\");\n List<Integer> resultPreOrder = preOrderTravel(n4);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n\n System.out.println(\"Cay n2\");\n resultPreOrder = preOrderTravel(n2);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n }", "public void TraverseLNR(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args){\n\t\tTreeNode node1 = new TreeNode(1);\n\t\tTreeNode node2 = new TreeNode(2);\n\t\tTreeNode node3 = new TreeNode(3);\n\t\tTreeNode node4 = new TreeNode(4);\n\t\tTreeNode node5 = new TreeNode(5);\n\t\tTreeNode node6 = new TreeNode(6);\n\t\tTreeNode node7 = new TreeNode(7);\n\t\tnode4.left = node2;\n\t\tnode4.right = node6;\n\t\tnode2.left = node1;\n\t\tnode2.right = node3;\n\t\tnode6.left = node5;\n\t\tnode6.right = node7;\n\t\t/*\n\t\t * 4\n\t\t * /\n\t\t * 5\n\t\t * \\\n\t\t * 6\n\t\t */\n\t\t/*node4.left = node5;\n\t\tnode5.right = node6;*/\n\t\t\n\t\ttreeTraversal2 tt = new treeTraversal2();\n\t\tSystem.out.print(\"Inorder Rcur: \");tt.inorderTraverse(node4);//1234567\n\t\tSystem.out.println();\t\t\n\t\tSystem.out.print(\"Inorder Iter: \");tt.stackInorder(node4);//1234567\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Rcur: \");tt.preorderTraverse(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Iter: \"); tt.stackPreorder(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Postorder Rcur: \");tt.postorderTraverse(node4);//1325764\n\t\tSystem.out.println();\t\t \n\t\tSystem.out.print(\"Postorder Iter: \");tt.stackPostorder(node4);//1325764\n\t\t//System.out.println();\n\t\t//System.out.print(\"Postorder Iter: \");tt.twoStackPostorder(node4);//1325764\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Level Iter: \");tt.levelTraverse(node4);//4261357\n\t}", "public static void main(String[] args) {\n // TODO Auto-generated method stub\n int[] nums = {3, 2, 1, 6, 0, 5};\n TreeNode root = solution2(nums);\n System.out.println(root.val);\n System.out.println(root.left.val);\n System.out.println(root.left.right.val);\n System.out.println(root.left.right.right.val);\n System.out.println(root.right.val);\n System.out.println(root.right.left.val);\n System.out.println(root.right.right);\n }", "private void inOrderTraversal(int index) {\n // go through the graph as long as has values\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n inOrderTraversal(2 * index + 1);\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on right child\n inOrderTraversal(2 * index + 2);\n }", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "public void reverseLevelOrderTraversel(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tQueue<TreeNode> que = new LinkedList<>();\r\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\r\n\t\t\r\n\t\tque.add(root);\r\n\t\twhile(que.size()>0)\r\n\t\t{\r\n\t\t\tTreeNode element=que.remove();\r\n\t\t\tif(element.right!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.right);\r\n\t\t\t}\r\n\t\t\tif(element.left!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.left);\r\n\t\t\t}\r\n\t\t\tstack.push(element);\r\n\t\t}\r\n\t\twhile(stack.size()>0)\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop().data+\" \");\r\n\t\t}\r\n\t\t\t\r\n\t}", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "public static void main(String args[]){\n BinaryTreeNode root = new BinaryTreeNode();\n root.setData(1);\n\n BinaryTreeNode left = new BinaryTreeNode();\n left.setData(2);\n\n BinaryTreeNode right = new BinaryTreeNode();\n right.setData(3);\n\n BinaryTreeNode leftleft = new BinaryTreeNode();\n leftleft.setData(4);\n\n BinaryTreeNode leftright = new BinaryTreeNode();\n leftright.setData(5);\n\n root.setLeft(left);\n root.setRight(right);\n left.setLeft(leftleft);\n left.setRight(leftright);\n\n\n postOrderIterative(root);\n\n }", "public static void main(String[] args) {\n\n TreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n TreeNode node8 = new TreeNode(8);\n node1.right=node3;\n node1.left=node2;\n node2.left=node4;\n node3.right=node5;\n node4.right=node6;\n node6.left=node7;\n node6.right=node8;\n traversalRecursion(node1);\n System.out.println();\n nonRecurInTraverse(node1);\n }", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "private void inOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n inOrderTraversalRec(root.getLeft());\n System.out.print(root.getData() + \" \");\n inOrderTraversalRec(root.getRight());\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "private void preOrdertraverse(Node root){\n System.out.println(root.value);\n for(var child : root.getChildren())\n preOrdertraverse(child); //recursively travels other childrens in current child\n }", "public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }", "public static void main(String[] args) {\n \n LinkedBinaryTree expr = new LinkedBinaryTree<String>();\n // a is the root of the tree\n Position a, b, c, d, e, f, g, h, i;\n a = expr.addRoot(\"*\");\n b = expr.addLeft(a, \"+\");\n c = expr.addLeft(b, \"/\");\n d = expr.addLeft(c, \"*\");\n e = expr.addLeft(d, \"+\");\n expr.addLeft(e, \"5\");\n expr.addRight(e, \"2\");\n f = expr.addRight(d, \"-\");\n expr.addLeft(f, \"2\");\n expr.addRight(f, \"1\");\n g = expr.addRight(c, \"+\");\n expr.addLeft(g, \"2\");\n expr.addRight(g, \"9\");\n h = expr.addRight(b, \"-\");\n i = expr.addLeft(h, \"-\");\n expr.addLeft(i, \"7\");\n expr.addRight(i, \"2\");\n expr.addRight(h, \"1\");\n expr.addRight(a, \"8\");\n \n System.out.println(\"The original expression:\");\n System.out.println(\"(((5+2)*(2–1)/(2+9)+((7–2)–1))*8)\\n\");\n \n System.out.println(\"Preorder traversal:\");\n Iterable<Position<String>> preIter = expr.preorder();\n for (Position<String> s : preIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Inorder traversal:\");\n Iterable<Position<String>> inIter = expr.inorder();\n for (Position<String> s : inIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Postorder traversal:\");\n Iterable<Position<String>> postIter = expr.postorder();\n for (Position<String> s : postIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Breadth traversal:\");\n Iterable<Position<String>> breadthIter = expr.breadthfirst();\n for (Position<String> s : breadthIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Parenthesized representation:\"); \n printParenthesize(expr, a);\n System.out.println();\n }", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void traverse(Node node) {\n //pre order\n //System.out.println(node.data);\n\n if (node.leftChild != null) {\n traverse(node.leftChild);\n }\n //in order\n System.out.println(node.data);\n\n if (node.rightChild != null) {\n traverse(node.rightChild);\n }\n //post order\n //System.out.println(node.data);\n\n\n }", "void printInOrder(Node R){\n if( R != null ){\n printInOrder(R.left);\n System.out.println(R.item.key + \" \" + R.item.value);\n printInOrder(R.right);\n }\n }", "private int treeTraverse (TreeNode root, int previousVal) {\n if (root == null)\n return 0;\n \n // traverse left, then right\n int left = treeTraverse(root.left, root.val);\n int right = treeTraverse(root.right, root.val);\n \n // calculate the longest path\n path = Math.max(left + right, path);\n\n //return\n if (root.val == previousVal) \n return Math.max(left, right) + 1;\n \n return 0;\n }", "public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}", "public void printRightView(){\n \n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n Node<T> lastVal = null;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n\n // keep track of last node and dont print it\n lastVal = node;\n\n // Enqueue left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // print last node\n System.out.println(lastVal.data + \" ,\");\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tBinary_Tree_Level_Order_Traversal_102 b=new Binary_Tree_Level_Order_Traversal_102();\n\t\tTreeNode root=new TreeNode(3);\n\t\troot.left=new TreeNode(9);\n\t\troot.right=new TreeNode(20);\n\t\troot.right.left=new TreeNode(15);\n\t\troot.right.right=new TreeNode(7);\n\t\tList<List<Integer>> res=b.levelOrder(root);\n\t\tfor(List<Integer> list:res){\n\t\t\tfor(Integer i:list){\n\t\t\t\tSystem.out.print(i+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static void main(String[] args) {\n Node root = new Node(1);\n\n Node left = new Node(2);\n left.left = new Node(4);\n left.right = new Node(3);\n\n Node right = new Node(5);\n right.left = new Node(6);\n right.right = new Node(7);\n\n root.left = left;\n root.right = right;\n\n Traversal traversal = new Traversal();\n traversal.preOrder(root);\n System.out.println();\n traversal.postOrder(root);\n System.out.println();\n traversal.inOrder(root);\n System.out.println();\n traversal.levelOrder(root);\n //System.out.println(checkBST(root));\n }", "private static void traversals(Node root) {\n\t\tSystem.out.println(\"Node Pre \" + root.data);\n\t\tfor(Node child : root.children) {\n\t\t\tSystem.out.println(\"Edge Pre \" + root.data + \"--\" + child.data);\n\t\t\ttraversals(child);\n\t\t\tSystem.out.println(\"Edge Post \" + root.data + \"--\" + child.data);\n\t\t}\n\t\tSystem.out.println(\"Node Post \" + root.data);\n\t}", "static void inorderTraversal(Node root) {\n if (root == null) {\n return;\n }\n inorderTraversal(root.left);\n System.out.print(root.data + \" \");\n inorderTraversal(root.right);\n }", "public void inOrderTree(TernaryTreeNode root)\n {\n if(root==null) return;\n \n \n inOrderTree(root.left);\n inOrderTree(root.middle);\n inOrderTree(root.right);\n System.out.print(root.data+\" \");\n \n }", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "void inOrderTraversal(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tinOrderTraversal( node.left );\r\n\t\tSystem.out.print( node.value + \" \");\r\n\t\tinOrderTraversal( node.right );\r\n\t}", "public static void main(String[] args)\n throws Exception\n {\n PrintWriter pen = new PrintWriter(System.out, true);\n BST<String, String> dict =\n new BST<String, String>((left, right) -> left.compareTo(right));\n\n String[] values =\n new String[] { \"gorilla\", \"dingo\", \"chimp\", \"emu\", \"elephant\", \"beta\",\n \"aardvark\", \"chinchilla\", \"yeti\", \"gibbon\", \"horse\",\n \"elephant\", \"duck\", \"emu\" };\n String[] moreValues =\n new String[] { \"gnu\", \"dingo\", \"flying squirrel\", \"iguana\", \"squirrel\",\n \"red squirrel\", \"moose\" };\n\n // Add each element and make sure that it's there.\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n\n // A quick printout for fun\n pen.println(\"After setting the first set of values\");\n iterate(pen, dict.iterator());\n\n // Another quick printout for fun\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n pen.println(\"After setting the second set of values\");\n iterate(pen, dict.iterator());\n\n // Build iterators that traverse in different ways\n Iterable<String> df_pre_lr =\n dict.values(Traversal.DEPTH_FIRST_PREORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_lr =\n dict.values(Traversal.DEPTH_FIRST_INORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_rl =\n dict.values(Traversal.DEPTH_FIRST_INORDER_RIGHT_TO_LEFT);\n Iterable<String> bf_pre_rl =\n dict.values(Traversal.BREADTH_FIRST_PREORDER_RIGHT_TO_LEFT);\n\n // Iterate!\n pen.println(\"Iterating depth-first, preorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_pre_lr);\n \n pen.println(\"Iterating depth-first, inorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_in_lr);\n \n pen.println(\"Iterating depth-first, inorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, df_in_rl);\n \n pen.println(\"Iterating breadth-first, preorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, bf_pre_rl);\n\n // And we're done\n pen.close();\n }", "private void postOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n postOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n postOrderTraversal(2 * index + 2);\n // print the node\n System.out.print(array[index] + \", \");\n }", "public void rightViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == 0) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n }", "public static void main(String[] args) {\n\n Node<Integer> node1 = new Node<>(1);\n Node<Integer> node2 = new Node<>(2);\n Node<Integer> node3 = new Node<>(3);\n Node<Integer> node4 = new Node<>(4);\n\n node1.setLeftChild(node2);\n node1.setRightChild(node3);\n\n node2.setLeftChild(node4);\n\n node3.setLeftChild(new Node<>(5));\n node3.setRightChild(new Node<>(6));\n\n node4.setLeftChild(new Node<>(7));\n node4.setRightChild(new Node<>(8));\n\n traverse(node1);\n }", "public void postOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n postOrderTraverseTree(focusNode.leftChild);\n postOrderTraverseTree(focusNode.rightChild);\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n }\n }", "public static void main(String[] args) {\n\t\ttn=new TreeNode(null,null,null,1);\n\t\tTreeNode tleft=new TreeNode(tn,null,null,2);\n\t\tTreeNode tright=new TreeNode(tn,null,null,3);\n\t\ttn.left=tleft;\n\t\ttn.right=tright;\n\t\t\n\t\tTreeNode tleft1=new TreeNode(tleft,null,null,4);\n\t\tTreeNode tright1=new TreeNode(tleft,null,null,5);\n\t\ttleft.left=tleft1;\n\t\ttleft.right=tright1;\n\t\t\n\t\tTreeNode tleft2=new TreeNode(tright,null,null,6);\n\t\tTreeNode tright2=new TreeNode(tright,null,null,7);\n\t\ttright.left=tleft2;\n\t\ttright.right=tright2;\n\t\t\n\t\tTreeNode tleft3=new TreeNode(tleft1,null,null,8);\n\t\tTreeNode tright3=new TreeNode(tleft1,null,null,9);\n\t\ttleft1.left=tleft3;\n\t\ttleft1.right=tright3;\n\t\t\n\t\tTreeNode tleft4=new TreeNode(tright1,null,null,10);\n\t\tTreeNode tright4=new TreeNode(tright1,null,null,11);\n\t\ttright1.left=tleft4;\n\t\ttright1.right=tright4;\n\t\t\n\t\tSystem.out.println(inorderTraversal2(tn));\n\t}", "public static void leftToRight(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n leftToRight(root.left, level-1);\n leftToRight(root.right, level-1);\n }\n\n }", "public static void inOrder(TreeNode root) \r\n { \r\n if (root != null) { \r\n inOrder(root.left); \r\n System.out.print(root.val + \" \"); \r\n inOrder(root.right); \r\n } else {\r\n //System.out.print(null + \" \"); \r\n }\r\n }", "public static void inOrder(TreeNode root) \r\n { \r\n if (root != null) { \r\n inOrder(root.left); \r\n System.out.print(root.val + \" \"); \r\n inOrder(root.right); \r\n } else {\r\n //System.out.print(null + \" \"); \r\n }\r\n }", "private void preOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on left child\n preOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n preOrderTraversal(2 * index + 2);\n }", "private TraverseData traverse(int treeIndex) {\n Node<T> newRoot = new Node<>(branchingFactor);\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData data = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, b));\n currentNode = data.currentNode;\n currentNewNode = data.currentNewNode;\n treeIndex = data.index;\n }\n return new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, 1);\n }", "private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n System.out.println(new Solution().preorderTraversal(null));\n }", "static void inorderTraversal(Node tmp)\n {\n if(tmp!=null) {\n inorderTraversal(tmp.left);\n System.out.print(tmp.val+\" \");\n inorderTraversal(tmp.right);\n }\n \n \n \n }", "public void leftViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == queue.size()) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n\n }", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "private Voter traverseRBT(RedBlackTree.Node<Voter> root, Date birthdate) {\r\n \r\n RedBlackTree.Node<Voter> currentNode = root;\r\n //no voter in the database so none can be gotten\r\n if (currentNode == null) {\r\n throw new NoSuchElementException(\"There is no voter in the database\");\r\n }\r\n \r\n // if the current node matches that of that of the birthdate, return that node\r\n if (currentNode.data.compareTo(new Voter(birthdate)) == 0) {\r\n return currentNode.data;\r\n \r\n //if the current node does not match traverse down the subtrees\r\n \r\n } else if (currentNode.data.compareTo(new Voter(birthdate)) > 0) {\r\n // left subtree\r\n return traverseRBT(currentNode.leftChild, birthdate); //recursively traverse through left subtree\r\n } else {\r\n // right subtree\r\n return traverseRBT(currentNode.rightChild, birthdate); //recursively traverse through right subtree\r\n }\r\n }", "public static void main(String[] args) {\n\t\tNode root = new Node(30);\n\t\troot.right = new Node(40);\n\t\troot.left = new Node(20);\n\t\troot.left.right=new Node(25);\n\t\troot.left.left = new Node(10);\n\t\troot.right.left = new Node(35);\n\t\troot.right.right = new Node(45);\n\t\t\n\t\tpostOrderTraversal(root);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tpostOrderRecursion(root);\n\t}", "void inorder(Node root) {\n\t\tboolean leftdone = false;\n\n\t\t// Start traversal from root\n\t\twhile (root != null) {\n\t\t\t// If left child is not traversed, find the\n\t\t\t// leftmost child\n\t\t\tif (!leftdone) {\n\t\t\t\twhile (root.left != null) {\n\t\t\t\t\troot = root.left;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print root's data\n\t\t\tSystem.out.print(root.data + \" \");\n\n\t\t\t// Mark left as done\n\t\t\tleftdone = true;\n\n\t\t\t// If right child exists\n\t\t\tif (root.right != null) {\n\t\t\t\tleftdone = false;\n\t\t\t\troot = root.right;\n\t\t\t}\n\n\t\t\t// If right child doesn't exist, move to parent\n\t\t\telse if (root.parent != null) {\n\t\t\t\t// If this node is right child of its parent,\n\t\t\t\t// visit parent's parent first\n\t\t\t\twhile (root.parent != null && root == root.parent.right)\n\t\t\t\t\troot = root.parent;\n\n\t\t\t\tif (root.parent == null)\n\t\t\t\t\tbreak;\n\t\t\t\troot = root.parent;\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void inOrder(Node myNode){\n \n if (myNode != null){ //If my node is not null, excute the following\n \n inOrder(myNode.left); //Recurse with left nodes\n System.out.println(myNode.name); //Print node name \n inOrder(myNode.right); //Recurse with right nodes\n \n }\n }", "public void printLRDNodes(Node N) {\n if(N != null) {\n printLRDNodes(N.getLeft());\n printLRDNodes(N.getRight());\n System.out.print(N.getData() + \" \");\n }\n }", "void traverseInOrder(Node node){\n if (node != null) {\n traversePreOrder(node.left); // fokus left sampai dihabiskan, lalu right (berbasis sub-tree)\n System.out.println(\" \" + node.data);\n traversePreOrder(node.right);\n }\n }", "public void inOrderTraverseRecursive();", "public List<Integer> traversePreOrderIterative(TreeNode root) {\n if (root == null) {\n return Collections.emptyList();\n }\n\n List<Integer> result = new ArrayList<>();\n\n Deque<TreeNode> stack = new ArrayDeque<>();\n stack.add(root);\n\n while (!stack.isEmpty()) {\n TreeNode node = stack.pop();\n result.add(node.val);\n\n if (node.right != null) {\n stack.push(node.right);\n }\n\n if (node.left != null) {\n stack.push(node.left);\n }\n }\n\n return result;\n }", "public static void printNodes(Node root)\n\t{\n\t\t// return is tree is empty\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// print root node\n\t\tSystem.out.print(root.key + \" \");\n\n\t\t// create a two empty queues and enqueue root's left and\n\t\t// right child respectively\n\t\tQueue<Node> first = new ArrayDeque<Node>();\n\t\tfirst.add(root.left);\n\n\t\tQueue<Node> second = new ArrayDeque<Node>();\n\t\tsecond.add(root.right);\n\n\t\t// run till queue is empty\n\t\twhile (!first.isEmpty())\n\t\t{\n\t\t\t// calculate number of nodes in current level\n\t\t\tint n = first.size();\n\n\t\t\t// process every node of current level\n\t\t\twhile (n-- > 0)\n\t\t\t{\n\t\t\t\t// pop front node from first queue and print it\n\t\t\t\tNode x = first.poll();\n\n\t\t\t\tSystem.out.print(x.key + \" \");\n\n\t\t\t\t// push left and right child of x to first queue\n\t\t\t\tif (x.left != null) {\n\t\t\t\t\tfirst.add(x.left);\n\t\t\t\t}\n\n\t\t\t\tif (x.right != null) {\n\t\t\t\t\tfirst.add(x.right);\n\t\t\t\t}\n\n\t\t\t\t// pop front node from second queue and print it\n\t\t\t\tNode y = second.poll();\n\n\t\t\t\tSystem.out.print(y.key + \" \");\n\n\t\t\t\t// push right and left child of y to second queue\n\t\t\t\tif (y.right != null) {\n\t\t\t\t\tsecond.add(y.right);\n\t\t\t\t}\n\n\t\t\t\tif (y.left != null) {\n\t\t\t\t\tsecond.add(y.left);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tOrderedTree tree_77, tree_44, tree_99, tree_33, tree_55;\n\t\t// 자식을 갖는 객체 이름 지정\n\t\t\n\t\tOrderedTree tree_22 = new OrderedTree(22); // root가 22인 단독 트리 생성\n\t\tOrderedTree tree_66 = new OrderedTree(66); // root가 66인 단독 트리 생성\n\t\tOrderedTree tree_88 = new OrderedTree(88); // root가 88인 단독 트리 생성\n\t\t\n\t\tList subtreeOf_33 = new LinkedList(); // root를 33으로 하는 트리의 subtree를 담을 list 객체\n\t\tsubtreeOf_33.add(tree_22); // subtree list에 root가 22인 트리를 넣음\n\t\ttree_33 = new OrderedTree(33, subtreeOf_33);\n\t\t// subtree로 subtreeOf_33 list에 담겨있는 트리를 갖고 root가 33인 트리 생성\n\t\t\n\t\tList subtreeOf_55 = new LinkedList(); // root를 55로 하는 트리의 subtree를 담을 list 객체\n\t\tsubtreeOf_55.add(tree_66); // subtree list에 root가 66인 트리를 넣음\n\t\ttree_55 = new OrderedTree(55, subtreeOf_55);\n\t\t// subtree로 subtreeOf_55 list에 담겨있는 트리를 갖고 root가 55인 트리 생성\n\t\t\n\t\tList subtreeOf_44 = new LinkedList(); // root를 44로 하는 트리의 subtree를 담을 list 객체\n\t\tsubtreeOf_44.add(tree_33); // subtree list에 root가 33인 트리를 넣음\n\t\tsubtreeOf_44.add(tree_55); // subtree list에 root가 55인 트리를 넣음\n\t\ttree_44 = new OrderedTree(44, subtreeOf_44);\n\t\t// subtree로 subtreeOf_44 list에 담겨있는 트리를 갖고 root가 44인 트리 생성\n\t\t\n\t\tList subtreeOf_99 = new LinkedList(); // root를 99로 하는 트리의 subtree를 담을 list 객체\n\t\tsubtreeOf_99.add(tree_88); // subtree list에 root가 88인 트리를 넣음\n\t\ttree_99 = new OrderedTree(99, subtreeOf_99);\n\t\t// subtree로 subtreeOf_99 list에 담겨있는 트리를 갖고 root가 99인 트리 생성\n\t\t\n\t\tList subtreeOf_77 = new LinkedList(); // root를 77로 하는 트리의 subtree를 담을 list 객체\n\t\tsubtreeOf_77.add(tree_44); // subtree list에 root가 44인 트리를 넣음\n\t\tsubtreeOf_77.add(tree_99); // subtree list에 root가 99인 트리를 넣음\n\t\ttree_77 = new OrderedTree(77, subtreeOf_77);\n\t\t// subtree로 subtreeOf_77 list에 담겨있는 트리를 갖고 root가 77인 트리 생성\n\t\t\n\t\tSystem.out.print(\"레벨 순서 순회 : \");\n\t\ttree_77.levelorder(); // 레벨 순서 순회 메소드 호출\n\t}", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "public void inOrderTraverseTree(Node focusNode) {\n if(focusNode != null) { // recursively traverse left child nodes first than right\n inOrderTraverseTree(focusNode.leftChild);\n\n System.out.println(focusNode); // print recursively inorder node (or return!)\n\n inOrderTraverseTree(focusNode.rightChild);\n\n }\n }", "public static void main(String[] args) {\n \n\t\t\n\t\tNode root = new Node(8);\n\t\tinsertNode(root, 5);\n\t\tinsertNode(root, 3);\n\t\tinsertNode(root, 6);\n\t\tinsertNode(root, 2);\n\t\tinsertNode(root, 14);\n\t\tinsertNode(root, 13);\n\t\tinsertNode(root, 16);\n\t\tinsertNode(root, 12);\n\t\tinsertNode(root, 1);\n\t\tinsertNode(root, 11);\n \n\t\tprintRightOrder(root,0,-1);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tTreeNode root = new TreeNode(1);\n\t\troot.right = new TreeNode(2);\n\t\t//root.left.left = new TreeNode(3);\n\t\t//root.left.right = new TreeNode(3);\n\t\troot.right.left = new TreeNode(3);\n\t\t//root.right.right = new TreeNode(3);\n\t\t\n\t\tSystem.out.println(inorderTraversal(root));\n\t}", "public static void main(String[] args){\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.right = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.right = new TreeNode(4);\n root.right.left = new TreeNode(4);\n root.right.right = new TreeNode(6);\n \n System.out.println(levelOrder(root)); // output: [[1], [2, 2], [6, 4, 4, 6]]\n }", "public List<Integer> inorderTraversal(TreeNode root) {\n List<Integer> result = new ArrayList<>();\n Stack<TreeNode> stack = new Stack<>();\n TreeNode node = root;\n while (node != null || !stack.empty()) {\n // push left nodes into stack\n while (node != null) {\n stack.push(node);\n node = node.left;\n }\n node = stack.pop();\n result.add(node.val);\n // ! key step: invoke recursive call on node's right child\n node = node.right;\n }\n return result;\n }", "public void inOrderRecursive(TreeNode root){\n if(root == null) return;\n inOrderRecursive(root.left);\n System.out.print(root.data + \" \");\n inOrderRecursive(root.right);\n }", "public void printTree(Node n) {\r\n\t\tif( !n.isNil ) {\r\n\t\t\tSystem.out.print(\"Key: \" + n.key + \" c: \" + n.color + \" p: \" + n.p + \" v: \"+ n.val + \" mv: \" + n.maxval + \"\\t\\tleft.key: \" + n.left.key + \"\\t\\tright.key: \" + n.right.key + \"\\n\");\r\n\t\t\tprintTree(n.left);\r\n\t\t\tprintTree(n.right);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n BinayTree root = new BinayTree();\n root.data = 8;\n root.left = new BinayTree();\n root.left.data = 6;\n root.left.left = new BinayTree();\n root.left.left.data = 5;\n root.left.right = new BinayTree();\n root.left.right.data = 7;\n root.right = new BinayTree();\n root.right.data = 10;\n root.right.left = new BinayTree();\n root.right.left.data = 9;\n root.right.right = new BinayTree();\n root.right.right.data = 11;\n printTree(root);\n System.out.println();\n mirror(root);\n printTree(root);\n // 1\n // /\n // 3\n // /\n // 5\n // /\n // 7\n // /\n // 9\n BinayTree root2 = new BinayTree();\n root2.data = 1;\n root2.left = new BinayTree();\n root2.left.data = 3;\n root2.left.left = new BinayTree();\n root2.left.left.data = 5;\n root2.left.left.left = new BinayTree();\n root2.left.left.left.data = 7;\n root2.left.left.left.left = new BinayTree();\n root2.left.left.left.left.data = 9;\n System.out.println(\"\\n\");\n printTree(root2);\n System.out.println();\n mirror(root2);\n printTree(root2);\n\n // 0\n // \\\n // 2\n // \\\n // 4\n // \\\n // 6\n // \\\n // 8\n BinayTree root3 = new BinayTree();\n root3.data = 0;\n root3.right = new BinayTree();\n root3.right.data = 2;\n root3.right.right = new BinayTree();\n root3.right.right.data = 4;\n root3.right.right.right = new BinayTree();\n root3.right.right.right.data = 6;\n root3.right.right.right.right = new BinayTree();\n root3.right.right.right.right.data = 8;\n System.out.println(\"\\n\");\n printTree(root3);\n System.out.println();\n mirror(root3);\n printTree(root3);\n\n\n }", "private BSTNode linkedListToTree (Iterator iter, int n) {\n // TODO Your code here\n \tint leftlenght,rightlength;\n \tdouble LenOfleft = n/2;\n \tleftlenght = (int)java.lang.Math.floor(LenOfleft);\n \trightlength = n - leftlenght -1;\n \t\n \t//linkedListToTree(iter,leftlenght);\n \t//Object item = iter.next();\n \t//linkedListToTree(iter,rightlength);\n \t\n return new BSTNode(linkedListToTree(iter,leftlenght),iter.next(),linkedListToTree(iter,rightlength)) ;\n }", "private void traverse(TNode node)\r\n\t\t{\n\t\t\tif (node != null) {\r\n\t\t\t\ttraverse(node.getLeft());\r\n\r\n\t\t\t\tSystem.out.println(node);\r\n\r\n\t\t\t\ttraverse(node.getRight());\r\n\t\t\t}\r\n\r\n\t\t}", "public void inorderTraversal(Node root) {\r\n\t\tif(root != null) {\r\n\t\t\tinorderTraversal(root.leftChild);\r\n\t\t\tSystem.out.print(root.data + \" \");\r\n\t\t\tinorderTraversal(root.rightChild);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tTreeNode r1 = new TreeNode(1);\n\t\tTreeNode r2 = new TreeNode(2);\n\t\tTreeNode r3 = new TreeNode(3);\n\t\tTreeNode r4 = new TreeNode(4);\n\t\tTreeNode r5 = new TreeNode(5);\n\t\tTreeNode r6 = new TreeNode(6);\n\t\tTreeNode r7 = new TreeNode(7);\n\t\tTreeNode r8 = new TreeNode(8);\n\t\t\n\t\tr1.left = r2;\n\t\tr1.right = r5;\n\t\tr2.left = r3;\n\t\tr2.right = r4;\n\t\tr5.right = r6;\n\t\tr6.left = r7;\n\t\tr6.right = r8;\n\t\t\n\t\tflatten(r1);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tTreeNode p = r1;\n\t\twhile(p !=null){\n\t\t\tsb.append(p.val+\"-->\");\n\t\t\tp=p.right;\n\t\t}\n\t\t\n\t\tSystem.out.println(sb);\n\t\t\n\t}", "static void levelOrder(Node root) {\n // create a node queue\n Queue<Node> queue = new LinkedList<>();\n queue.add(root);\n while (!queue.isEmpty()) {\n Node node = queue.remove();\n // if node print value\n System.out.printf(\"%d \", node.data);\n // if left node not null add child node to the queue\n if (node.left != null)\n queue.add(node.left);\n // if right node not null add child node to the queue\n if (node.right != null)\n queue.add(node.right);\n }\n }", "public List<Integer> rightSideView(TreeNode root) {\n List<Integer> r = new ArrayList<>();\n LinkedList<LinkedList<Integer>> levelOrder = new LinkedList<>();\n LinkedList<TreeNode> queue = new LinkedList<>();\n if(root == null) return r;\n queue.offer(root);\n while(!queue.isEmpty()){\n int size = queue.size();\n LinkedList<Integer> res = new LinkedList<>();\n for(int i=0;i<size;i++){\n TreeNode cur = queue.pop();\n res.add(cur.val);\n if(cur.left != null) queue.offer(cur.left);\n if(cur.right != null) queue.offer(cur.right);\n }\n levelOrder.add(res);\n }\n //2. store the last element of each list\n LinkedList<Integer> ans = new LinkedList<>();\n for(LinkedList<Integer> l : levelOrder){\n int s = l.get(l.size() - 1);\n ans.add(s);\n }\n return ans;\n }", "public void levelOrderTraversal(TreeNode root){\n int height = height(root);\n for(int i = 0; i <=height; i++){\n System.out.println();\n printNodesInLevel(root,i);\n }\n }", "public void levelOrderUsingRecurison(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint height=heightOfTree(root);\r\n\t\tfor (int i=0;i<=height;i++)\r\n\t\t{\r\n\t\t\tprintNodesAtGivenLevel(root,i+1);\t\t\r\n\t\t}\r\n\t}", "public void printLeftView(){\n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n boolean printed = false;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n // if the first node is not printed print it and flip the bool value\n if(! printed){\n System.out.println(node.data);\n printed = true;\n }\n\n // add left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // flip the printed bool value\n // break if the queue is empty else enqueue a null\n printed = false;\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "public static void main(String[] args) {\n String levelNodes = \"1,2,3,#,#,4,#,#,#\";\n TreeNode<String> level = of(levelNodes, \"#\", TraverseType.LEVEL);\n System.out.println(level);\n\n\n String postNodes = \"#,#,2,#,#,4,#,3,1\";\n TreeNode<String> post = of(postNodes, \"#\", TraverseType.POST);\n System.out.println(post);\n\n\n String preNodes = \"1,2,#,#,3,4,#,#,#\";\n TreeNode<String> pre = of(preNodes, \"#\", TraverseType.PRE);\n System.out.println(pre);\n }", "public static void main(String[] args) { Scanner scanner = new Scanner(System.in);\n// System.out.println(\"Please read number of levels for tree: \");\n// int n = scanner.nextInt();\n//\n// System.out.println(\"The tree will have \" + n + \" levels\");\n//\n Tree tree = new Tree();\n// tree.generateDefaultTree(n);\n tree.readUnbalancedTree();\n System.out.println(\"Display NLR:\");\n tree.showTreeNLR(tree.root);\n System.out.println();\n System.out.println(\"Display LNR\");\n tree.showTreeLNR(tree.root);\n System.out.println();\n System.out.println(\"Display LRN\");\n tree.showTreeLRN(tree.root);\n }", "public void inOrderIterative(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tStack<TreeNode> stack = new Stack<>();\r\n\t\tTreeNode temp=root;\r\n\t\twhile(!stack.isEmpty() || temp!=null)\r\n\t\t{\r\n\t\t\tif(temp!=null)\r\n\t\t\t{\r\n\t\t\t\tstack.push(temp);\r\n\t\t\t\ttemp=temp.left;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttemp=stack.pop();\r\n\t\t\t\tSystem.out.print(temp.data+\" \");\r\n\t\t\t\ttemp=temp.right;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n TreeNode n20 = new TreeNode(20);\n TreeNode n8 = new TreeNode(8);\n TreeNode n4 = new TreeNode(4);\n TreeNode n7 = new TreeNode(7);\n TreeNode n12 = new TreeNode(12);\n TreeNode n14 = new TreeNode(14);\n TreeNode n21 = new TreeNode(21);\n TreeNode n22 = new TreeNode(22);\n TreeNode n25 = new TreeNode(25);\n TreeNode n24 = new TreeNode(24);\n n20.left = n8;\n n20.right = n22;\n n8.left = n4;\n n8.right = n12;\n n4.right = n7;\n n12.right = n14;\n n22.left = n21;\n n22.right = n25;\n n25.left = n24;\n\n for (Integer i : printBoundary(n20)) {\n System.out.println(i);\n }\n }", "public static void main(String[] args) {\n Node root = newNode(1);\n\n root.left = newNode(2);\n root.right = newNode(3);\n\n root.left.left = newNode(4);\n root.left.right = newNode(5);\n\n root.left.left.left = newNode(8);\n root.left.left.right = newNode(9);\n\n root.left.right. left = newNode(10);\n root.left.right. right = newNode(11);\n\n root.right.left = newNode(6);\n root.right.right = newNode(7);\n root.right.left .left = newNode(12);\n root.right.left .right = newNode(13);\n root.right.right. left = newNode(14);\n root.right.right. right = newNode(15);\n System.out.println(findNode(root, 5, 6, 15));\n }", "public static void main(String[] args) {\n\n\t\tTreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node3.left = node6;\n node4.left = node7;\n \n System.out.println(preorderTraversalIterative(node1));\n System.out.println(preorderTraversalRecursive(node1));\n \n\t\t\n\t\t\n\t\t\n\t}", "public ArrayList<K> inOrdorTraverseBST(){\n BSTNode<K> currentNode = this.rootNode;\n LinkedList<BSTNode<K>> nodeStack = new LinkedList<BSTNode<K>>();\n ArrayList<K> result = new ArrayList<K>();\n \n if (currentNode == null)\n return null;\n \n while (currentNode != null || nodeStack.size() > 0) {\n while (currentNode != null) {\n nodeStack.add(currentNode);\n currentNode = currentNode.getLeftChild();\n }\n currentNode = nodeStack.pollLast();\n result.add(currentNode.getId());\n currentNode = currentNode.getRightChild();\n }\n \n return result;\n }", "private static List<Integer> printTree(Tree tree, List values){\n int height = heightOfTree(tree);\n\n for(int i=1;i<=height;i++) {\n System.out.println(\"\");\n printTreeInLevel(tree, i, values);\n }\n return values;\n}", "public void inorder()\r\n\t{\r\n\t\tif(root==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"tree is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// find the leftmost node of the tree\r\n\t\tNode p =root;\r\n\t\twhile(p.leftThread==false)\r\n\t\t\tp=p.left;\r\n\t\twhile(p!=null)//loop until we reach the right most node whose right link(rightThread) is null\r\n\t\t{\r\n\t\t\tSystem.out.print(p.info + \" \");\r\n\t\t\tif(p.rightThread==true) // if 'right' is pointing to the inorder successor\r\n\t\t\t\tp = p.right;\r\n\t\t\telse // find the inorder successor i.e the left most node in the right sub tree\r\n\t\t\t{\r\n\t\t\t\tp = p.right;\r\n\t\t\t\twhile(p.leftThread==false)\r\n\t\t\t\t\tp = p.left;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "private void postorderRightOnly(Node root) {\r\n if (root.right != null)\r\n postorderRightOnly(root.right);\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n }", "TreeNode<T> getLeft();", "public static <T> void inorderIterative(TreeNode<T> root)\n {\n // create an empty stack\n Stack<TreeNode> stack = new Stack();\n\n // start from root node (set current node to root node)\n TreeNode curr = root;\n\n // if current node is null and stack is also empty, we're done\n while (!stack.empty() || curr != null)\n {\n // if current node is not null, push it to the stack (defer it)\n // and move to its left child\n if (curr != null)\n {\n stack.push(curr);\n curr = curr.left;\n }\n else\n {\n // else if current node is null, we pop an element from stack,\n // print it and finally set current node to its right child\n curr = stack.pop();\n System.out.print(curr.value + \" \");\n\n curr = curr.right;\n }\n }\n }", "void inOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tinOrderTraversal(node.getLeftNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tinOrderTraversal(node.getRightNode());\n\t}" ]
[ "0.6573927", "0.6556995", "0.6556145", "0.652927", "0.6507526", "0.64988947", "0.6477003", "0.6466885", "0.64424384", "0.64003044", "0.63955003", "0.6392908", "0.62797445", "0.6238456", "0.62317264", "0.6231374", "0.6201859", "0.6194158", "0.6192342", "0.61681056", "0.615237", "0.612713", "0.6126582", "0.61087143", "0.6034218", "0.6028169", "0.6026789", "0.60107297", "0.6001917", "0.59792936", "0.5970599", "0.5965889", "0.5952815", "0.5945459", "0.5944856", "0.59375525", "0.59178543", "0.5910882", "0.59102064", "0.590724", "0.5900304", "0.5899967", "0.5898513", "0.5882769", "0.58756703", "0.5870824", "0.5870333", "0.58697414", "0.58563876", "0.5848364", "0.5839124", "0.5839124", "0.5837601", "0.58344245", "0.58314115", "0.581926", "0.58154815", "0.5804503", "0.5801557", "0.5783059", "0.57803357", "0.5780008", "0.5776851", "0.5772716", "0.5771619", "0.57679003", "0.5764136", "0.57628113", "0.57517904", "0.5747655", "0.5731838", "0.5730453", "0.57285506", "0.57280815", "0.5726925", "0.572298", "0.5707051", "0.57059765", "0.57032084", "0.57006055", "0.5687547", "0.5686276", "0.56841815", "0.567714", "0.5676769", "0.56635237", "0.56633294", "0.5659491", "0.5658505", "0.56546885", "0.5651119", "0.5648958", "0.56433654", "0.56420296", "0.563877", "0.5633316", "0.5631416", "0.56308395", "0.56307626", "0.5629372" ]
0.67061794
0
TraverseRLN method traverses tree from right subtree, left subtree, then root and outputs the values
public void TraverseRLN(TreeNode Root) { if(Root.Right != null) TraverseLNR(Root.Right); if(Root.Left != null) TraverseLNR(Root.Left); System.out.println(Root.Data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void TraverseRNL(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public void TraverseLRN(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n TreeNode node = new TreeNode();\n node.value = 1;\n node.left = new TreeNode();\n node.left.value = 2;\n node.right = new TreeNode();\n node.right.value = 3;\n node.left.left = new TreeNode();\n node.left.left.value = 4;\n node.left.right = new TreeNode();\n node.left.right.value = 5;\n node.right.left = new TreeNode();\n node.right.left.value = 6;\n node.right.right = new TreeNode();\n node.right.right.value = 7;\n// System.out.println(mirro(node).value);\n// System.out.println(mirro(node).left.value);\n// System.out.println(Arrays.toString(LevelPrintTree.levelPrint(mirro(node))));\n\n recur(node);\n\n }", "public void TraverseNRL(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public void reverseLevelOrderTraversel(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tQueue<TreeNode> que = new LinkedList<>();\r\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\r\n\t\t\r\n\t\tque.add(root);\r\n\t\twhile(que.size()>0)\r\n\t\t{\r\n\t\t\tTreeNode element=que.remove();\r\n\t\t\tif(element.right!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.right);\r\n\t\t\t}\r\n\t\t\tif(element.left!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.left);\r\n\t\t\t}\r\n\t\t\tstack.push(element);\r\n\t\t}\r\n\t\twhile(stack.size()>0)\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop().data+\" \");\r\n\t\t}\r\n\t\t\t\r\n\t}", "@Test\r\n\tpublic void test(){\r\n\t\tTreeNode root = new TreeNode(1); \r\n TreeNode r2 = new TreeNode(2); \r\n TreeNode r3 = new TreeNode(3); \r\n TreeNode r4 = new TreeNode(4); \r\n TreeNode r5 = new TreeNode(5); \r\n TreeNode r6 = new TreeNode(6); \r\n root.left = r2; \r\n root.right = r3; \r\n r2.left = r4; \r\n r2.right = r5; \r\n r3.right = r6;\r\n System.out.println(getNodeNumRec(root));\r\n System.out.println(getNodeNum(root));\r\n System.out.println(getDepthRec(root));\r\n System.out.println(getDepth(root));\r\n System.out.println(\"前序遍历\");\r\n preorderTraversalRec(root);\r\n System.out.println(\"\");\r\n preorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"中序遍历\");\r\n inorderTraversalRec(root);\r\n System.out.println(\"\");\r\n inorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"后序遍历\");\r\n postorderTraversalRec(root);\r\n System.out.println(\"\");\r\n postorderTraversal(root);\r\n System.out.println(\"分层遍历\");\r\n levelTraversal(root);\r\n System.out.println(\"\");\r\n levelTraversalRec(root);\r\n\t}", "public void traverse(Node root){\n\t\tNode pred, current;\n\t\tcurrent=root;\n\t\tint rank=10;\n\t\tint rankCount=1;\n\t\twhile(current!=null){\n\t\t\tif(current.left==null){\n\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\trankCount++;\n\t\t\t\tcurrent=current.right;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpred=current.left;\n\t\t\t\twhile(pred.right!=null && pred.right!=current){\n\t\t\t\t\tpred=pred.right;\n\t\t\t\t}\n\n\t\t\t\tif(pred.right==null){\n\t\t\t\t\tpred.right=current;\n\t\t\t\t\tcurrent=current.left;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tpred.right=null;\n\t\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\trankCount++;\n\t\t\t\t\tcurrent=current.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void TraverseNLR(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public void rightViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == 0) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n }", "public void TraverseLNR(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public static void main(String[] args){\n\t\tTreeNode node1 = new TreeNode(1);\n\t\tTreeNode node2 = new TreeNode(2);\n\t\tTreeNode node3 = new TreeNode(3);\n\t\tTreeNode node4 = new TreeNode(4);\n\t\tTreeNode node5 = new TreeNode(5);\n\t\tTreeNode node6 = new TreeNode(6);\n\t\tTreeNode node7 = new TreeNode(7);\n\t\tnode4.left = node2;\n\t\tnode4.right = node6;\n\t\tnode2.left = node1;\n\t\tnode2.right = node3;\n\t\tnode6.left = node5;\n\t\tnode6.right = node7;\n\t\t/*\n\t\t * 4\n\t\t * /\n\t\t * 5\n\t\t * \\\n\t\t * 6\n\t\t */\n\t\t/*node4.left = node5;\n\t\tnode5.right = node6;*/\n\t\t\n\t\ttreeTraversal2 tt = new treeTraversal2();\n\t\tSystem.out.print(\"Inorder Rcur: \");tt.inorderTraverse(node4);//1234567\n\t\tSystem.out.println();\t\t\n\t\tSystem.out.print(\"Inorder Iter: \");tt.stackInorder(node4);//1234567\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Rcur: \");tt.preorderTraverse(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Iter: \"); tt.stackPreorder(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Postorder Rcur: \");tt.postorderTraverse(node4);//1325764\n\t\tSystem.out.println();\t\t \n\t\tSystem.out.print(\"Postorder Iter: \");tt.stackPostorder(node4);//1325764\n\t\t//System.out.println();\n\t\t//System.out.print(\"Postorder Iter: \");tt.twoStackPostorder(node4);//1325764\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Level Iter: \");tt.levelTraverse(node4);//4261357\n\t}", "private Voter traverseRBT(RedBlackTree.Node<Voter> root, Date birthdate) {\r\n \r\n RedBlackTree.Node<Voter> currentNode = root;\r\n //no voter in the database so none can be gotten\r\n if (currentNode == null) {\r\n throw new NoSuchElementException(\"There is no voter in the database\");\r\n }\r\n \r\n // if the current node matches that of that of the birthdate, return that node\r\n if (currentNode.data.compareTo(new Voter(birthdate)) == 0) {\r\n return currentNode.data;\r\n \r\n //if the current node does not match traverse down the subtrees\r\n \r\n } else if (currentNode.data.compareTo(new Voter(birthdate)) > 0) {\r\n // left subtree\r\n return traverseRBT(currentNode.leftChild, birthdate); //recursively traverse through left subtree\r\n } else {\r\n // right subtree\r\n return traverseRBT(currentNode.rightChild, birthdate); //recursively traverse through right subtree\r\n }\r\n }", "public void printRightView(){\n \n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n Node<T> lastVal = null;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n\n // keep track of last node and dont print it\n lastVal = node;\n\n // Enqueue left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // print last node\n System.out.println(lastVal.data + \" ,\");\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "public static void main(String[] args) {\n // TODO Auto-generated method stub\n int[] nums = {3, 2, 1, 6, 0, 5};\n TreeNode root = solution2(nums);\n System.out.println(root.val);\n System.out.println(root.left.val);\n System.out.println(root.left.right.val);\n System.out.println(root.left.right.right.val);\n System.out.println(root.right.val);\n System.out.println(root.right.left.val);\n System.out.println(root.right.right);\n }", "TreeNode<T> getRight();", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n TreeNode n7 = new TreeNode(7);\n TreeNode n6 = new TreeNode(6);\n TreeNode n5 = new TreeNode(5);\n TreeNode n4 = new TreeNode(4);\n TreeNode n3 = new TreeNode(3);\n TreeNode n2 = new TreeNode(2);\n TreeNode n1 = new TreeNode(1);\n\n n4.left = n2;\n n4.right = n6;\n\n n2.left = n1;\n n2.right = n3;\n\n n6.left = n5;\n n6.right = n7;\n\n System.out.println(\"Cay n4\");\n List<Integer> resultPreOrder = preOrderTravel(n4);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n\n System.out.println(\"Cay n2\");\n resultPreOrder = preOrderTravel(n2);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n }", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public static void leftToRight(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n leftToRight(root.left, level-1);\n leftToRight(root.right, level-1);\n }\n\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "private void inOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n inOrderTraversalRec(root.getLeft());\n System.out.print(root.getData() + \" \");\n inOrderTraversalRec(root.getRight());\n }", "public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public Node findRL(Node n) {\r\n\t\tif (n.rightChild == null) {\r\n\t\t\treturn n; \r\n\t\t} else { \r\n\t\t\treturn findRL(n.rightChild);\r\n\t\t}\r\n\t}", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "public List<Integer> rightSideView(TreeNode root) {\n List<Integer> r = new ArrayList<>();\n LinkedList<LinkedList<Integer>> levelOrder = new LinkedList<>();\n LinkedList<TreeNode> queue = new LinkedList<>();\n if(root == null) return r;\n queue.offer(root);\n while(!queue.isEmpty()){\n int size = queue.size();\n LinkedList<Integer> res = new LinkedList<>();\n for(int i=0;i<size;i++){\n TreeNode cur = queue.pop();\n res.add(cur.val);\n if(cur.left != null) queue.offer(cur.left);\n if(cur.right != null) queue.offer(cur.right);\n }\n levelOrder.add(res);\n }\n //2. store the last element of each list\n LinkedList<Integer> ans = new LinkedList<>();\n for(LinkedList<Integer> l : levelOrder){\n int s = l.get(l.size() - 1);\n ans.add(s);\n }\n return ans;\n }", "public static void main(String[] args) {\n \n LinkedBinaryTree expr = new LinkedBinaryTree<String>();\n // a is the root of the tree\n Position a, b, c, d, e, f, g, h, i;\n a = expr.addRoot(\"*\");\n b = expr.addLeft(a, \"+\");\n c = expr.addLeft(b, \"/\");\n d = expr.addLeft(c, \"*\");\n e = expr.addLeft(d, \"+\");\n expr.addLeft(e, \"5\");\n expr.addRight(e, \"2\");\n f = expr.addRight(d, \"-\");\n expr.addLeft(f, \"2\");\n expr.addRight(f, \"1\");\n g = expr.addRight(c, \"+\");\n expr.addLeft(g, \"2\");\n expr.addRight(g, \"9\");\n h = expr.addRight(b, \"-\");\n i = expr.addLeft(h, \"-\");\n expr.addLeft(i, \"7\");\n expr.addRight(i, \"2\");\n expr.addRight(h, \"1\");\n expr.addRight(a, \"8\");\n \n System.out.println(\"The original expression:\");\n System.out.println(\"(((5+2)*(2–1)/(2+9)+((7–2)–1))*8)\\n\");\n \n System.out.println(\"Preorder traversal:\");\n Iterable<Position<String>> preIter = expr.preorder();\n for (Position<String> s : preIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Inorder traversal:\");\n Iterable<Position<String>> inIter = expr.inorder();\n for (Position<String> s : inIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Postorder traversal:\");\n Iterable<Position<String>> postIter = expr.postorder();\n for (Position<String> s : postIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Breadth traversal:\");\n Iterable<Position<String>> breadthIter = expr.breadthfirst();\n for (Position<String> s : breadthIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Parenthesized representation:\"); \n printParenthesize(expr, a);\n System.out.println();\n }", "public BinaryTree rightTree()\n {return right;}", "public static void main(String[] args) {\n\n TreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n TreeNode node8 = new TreeNode(8);\n node1.right=node3;\n node1.left=node2;\n node2.left=node4;\n node3.right=node5;\n node4.right=node6;\n node6.left=node7;\n node6.right=node8;\n traversalRecursion(node1);\n System.out.println();\n nonRecurInTraverse(node1);\n }", "void printInOrder(Node R){\n if( R != null ){\n printInOrder(R.left);\n System.out.println(R.item.key + \" \" + R.item.value);\n printInOrder(R.right);\n }\n }", "public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "public static void main(String args[]){\n BinaryTreeNode root = new BinaryTreeNode();\n root.setData(1);\n\n BinaryTreeNode left = new BinaryTreeNode();\n left.setData(2);\n\n BinaryTreeNode right = new BinaryTreeNode();\n right.setData(3);\n\n BinaryTreeNode leftleft = new BinaryTreeNode();\n leftleft.setData(4);\n\n BinaryTreeNode leftright = new BinaryTreeNode();\n leftright.setData(5);\n\n root.setLeft(left);\n root.setRight(right);\n left.setLeft(leftleft);\n left.setRight(leftright);\n\n\n postOrderIterative(root);\n\n }", "public static void rightToLeft(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n rightToLeft(root.right, level-1);\n rightToLeft(root.left, level-1);\n }\n }", "public int rob(TreeNode root) {\n if (root == null) return 0;\n int value = root.val;\n \n if (root.left != null) {\n value += rob (root.left.left);\n value += rob (root.left.right);\n }\n \n if (root.right != null) {\n value += rob (root.right.left);\n value += rob (root.right.right);\n }\n \n return Math.max (value, rob (root.left) + rob (root.right));\n }", "public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }", "private int treeTraverse (TreeNode root, int previousVal) {\n if (root == null)\n return 0;\n \n // traverse left, then right\n int left = treeTraverse(root.left, root.val);\n int right = treeTraverse(root.right, root.val);\n \n // calculate the longest path\n path = Math.max(left + right, path);\n\n //return\n if (root.val == previousVal) \n return Math.max(left, right) + 1;\n \n return 0;\n }", "public int rob(TreeNode root) {\n return rob(root, new HashMap<>());\n }", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "public void postOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n postOrderTraverseTree(focusNode.leftChild);\n postOrderTraverseTree(focusNode.rightChild);\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n }\n }", "public void rightBoundary(TreeNode root) {\n if (root.right == null && root.left == null) return; // ignore leaf\n if (root.right != null) rightBoundary(root.right);\n else rightBoundary(root.left);\n result.add(root.val); // add after child visit(reverse)\n }", "private void postorderRightOnly(Node root) {\r\n if (root.right != null)\r\n postorderRightOnly(root.right);\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n }", "public TreeNode getRight(){ return rightChild;}", "protected void visitRightSubtree() {\n\t\tif(tree.hasRightNode()) {\n\t\t\ttree.moveToRightNode();\n\t\t\ttraverse();\n\t\t\ttree.moveToParentNode();\n\t\t}\n\t}", "public BinNode<T> getRight();", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tTreeNode r1 = new TreeNode(1);\n\t\tTreeNode r2 = new TreeNode(2);\n\t\tTreeNode r3 = new TreeNode(3);\n\t\tTreeNode r4 = new TreeNode(4);\n\t\tTreeNode r5 = new TreeNode(5);\n\t\tTreeNode r6 = new TreeNode(6);\n\t\tTreeNode r7 = new TreeNode(7);\n\t\tTreeNode r8 = new TreeNode(8);\n\t\t\n\t\tr1.left = r2;\n\t\tr1.right = r5;\n\t\tr2.left = r3;\n\t\tr2.right = r4;\n\t\tr5.right = r6;\n\t\tr6.left = r7;\n\t\tr6.right = r8;\n\t\t\n\t\tflatten(r1);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tTreeNode p = r1;\n\t\twhile(p !=null){\n\t\t\tsb.append(p.val+\"-->\");\n\t\t\tp=p.right;\n\t\t}\n\t\t\n\t\tSystem.out.println(sb);\n\t\t\n\t}", "private void inOrderTraversal(int index) {\n // go through the graph as long as has values\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n inOrderTraversal(2 * index + 1);\n // print the node\n System.out.print(array[index] + \", \");\n //call recursively the method on right child\n inOrderTraversal(2 * index + 2);\n }", "@Override\n\tpublic BTree<T> right() \n\t{\n\t\treturn root.right;\n\t}", "private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args)\n throws Exception\n {\n PrintWriter pen = new PrintWriter(System.out, true);\n BST<String, String> dict =\n new BST<String, String>((left, right) -> left.compareTo(right));\n\n String[] values =\n new String[] { \"gorilla\", \"dingo\", \"chimp\", \"emu\", \"elephant\", \"beta\",\n \"aardvark\", \"chinchilla\", \"yeti\", \"gibbon\", \"horse\",\n \"elephant\", \"duck\", \"emu\" };\n String[] moreValues =\n new String[] { \"gnu\", \"dingo\", \"flying squirrel\", \"iguana\", \"squirrel\",\n \"red squirrel\", \"moose\" };\n\n // Add each element and make sure that it's there.\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n\n // A quick printout for fun\n pen.println(\"After setting the first set of values\");\n iterate(pen, dict.iterator());\n\n // Another quick printout for fun\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n pen.println(\"After setting the second set of values\");\n iterate(pen, dict.iterator());\n\n // Build iterators that traverse in different ways\n Iterable<String> df_pre_lr =\n dict.values(Traversal.DEPTH_FIRST_PREORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_lr =\n dict.values(Traversal.DEPTH_FIRST_INORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_rl =\n dict.values(Traversal.DEPTH_FIRST_INORDER_RIGHT_TO_LEFT);\n Iterable<String> bf_pre_rl =\n dict.values(Traversal.BREADTH_FIRST_PREORDER_RIGHT_TO_LEFT);\n\n // Iterate!\n pen.println(\"Iterating depth-first, preorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_pre_lr);\n \n pen.println(\"Iterating depth-first, inorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_in_lr);\n \n pen.println(\"Iterating depth-first, inorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, df_in_rl);\n \n pen.println(\"Iterating breadth-first, preorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, bf_pre_rl);\n\n // And we're done\n pen.close();\n }", "public void leftViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == queue.size()) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n\n }", "public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}", "public static void main(String[] args) {\n \n\t\t\n\t\tNode root = new Node(8);\n\t\tinsertNode(root, 5);\n\t\tinsertNode(root, 3);\n\t\tinsertNode(root, 6);\n\t\tinsertNode(root, 2);\n\t\tinsertNode(root, 14);\n\t\tinsertNode(root, 13);\n\t\tinsertNode(root, 16);\n\t\tinsertNode(root, 12);\n\t\tinsertNode(root, 1);\n\t\tinsertNode(root, 11);\n \n\t\tprintRightOrder(root,0,-1);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tBinary_Tree_Level_Order_Traversal_102 b=new Binary_Tree_Level_Order_Traversal_102();\n\t\tTreeNode root=new TreeNode(3);\n\t\troot.left=new TreeNode(9);\n\t\troot.right=new TreeNode(20);\n\t\troot.right.left=new TreeNode(15);\n\t\troot.right.right=new TreeNode(7);\n\t\tList<List<Integer>> res=b.levelOrder(root);\n\t\tfor(List<Integer> list:res){\n\t\t\tfor(Integer i:list){\n\t\t\t\tSystem.out.print(i+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printLRDNodes(Node N) {\n if(N != null) {\n printLRDNodes(N.getLeft());\n printLRDNodes(N.getRight());\n System.out.print(N.getData() + \" \");\n }\n }", "public void levelOrderUsingRecurison(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint height=heightOfTree(root);\r\n\t\tfor (int i=0;i<=height;i++)\r\n\t\t{\r\n\t\t\tprintNodesAtGivenLevel(root,i+1);\t\t\r\n\t\t}\r\n\t}", "public void traverse(Node node) {\n //pre order\n //System.out.println(node.data);\n\n if (node.leftChild != null) {\n traverse(node.leftChild);\n }\n //in order\n System.out.println(node.data);\n\n if (node.rightChild != null) {\n traverse(node.rightChild);\n }\n //post order\n //System.out.println(node.data);\n\n\n }", "private static void traversals(Node root) {\n\t\tSystem.out.println(\"Node Pre \" + root.data);\n\t\tfor(Node child : root.children) {\n\t\t\tSystem.out.println(\"Edge Pre \" + root.data + \"--\" + child.data);\n\t\t\ttraversals(child);\n\t\t\tSystem.out.println(\"Edge Post \" + root.data + \"--\" + child.data);\n\t\t}\n\t\tSystem.out.println(\"Node Post \" + root.data);\n\t}", "public static void main(String[] args) {\n Node root = new Node(1);\n\n Node left = new Node(2);\n left.left = new Node(4);\n left.right = new Node(3);\n\n Node right = new Node(5);\n right.left = new Node(6);\n right.right = new Node(7);\n\n root.left = left;\n root.right = right;\n\n Traversal traversal = new Traversal();\n traversal.preOrder(root);\n System.out.println();\n traversal.postOrder(root);\n System.out.println();\n traversal.inOrder(root);\n System.out.println();\n traversal.levelOrder(root);\n //System.out.println(checkBST(root));\n }", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "void\nprintBoundaryRight(Node node) \n\n{ \n\nif\n(node != \nnull\n) { \n\nif\n(node.right != \nnull\n) { \n\n// to ensure bottom up order, first call for right \n\n// subtree, then print this node \n\nprintBoundaryRight(node.right); \n\nSystem.out.print(node.data + \n\" \"\n); \n\n} \n\nelse\nif\n(node.left != \nnull\n) { \n\nprintBoundaryRight(node.left); \n\nSystem.out.print(node.data + \n\" \"\n); \n\n} \n\n// do nothing if it is a leaf node, this way we avoid \n\n// duplicates in output \n\n} \n\n}", "public int rob(TreeNode root) {\n if(root == null)\n return 0;\n \n int[] result = helper(root);\n return Math.max(result[0], result[1]);\n}", "public int rob(TreeNode root) {\n if(root == null) return 0;\n int withRoot = root.val, withoutRoot = 0;\n if(root.left != null) withRoot += rob(root.left.left) + rob(root.left.right);\n if(root.right != null) withRoot += rob(root.right.left) + rob(root.right.right);\n withoutRoot = rob(root.left) + rob(root.right);\n return Math.max(withRoot, withoutRoot);\n }", "public Node getRight(){\r\n return this.right;\r\n }", "public List<Integer> rightSideView_bfs(TreeNode root) {\n List<Integer> list = new ArrayList<>();\n if(root == null){\n return list;\n }\n Queue<TreeNode> q = new LinkedList<>();\n q.offer(root);\n while(!q.isEmpty()){\n int len = q.size();\n for(int i=0; i<len; i++){\n TreeNode node = q.poll();\n if(i == 0){\n list.add(node.val);\n }\n if(node.left != null) q.offer(node.left);\n if(node.right != null) q.offer(node.right); \n }\n }\n return list;\n }", "public static void main(String args[]) {\n\t\t\n\t\tTreeNode root = new TreeNode(3);\n\t\troot.right = new TreeNode(2);\n\t\troot.right.right = new TreeNode(1);\n\t\t\n\n\t\tRecoverTree tree = new RecoverTree();\n\n\t\ttree.recoverTree(root);\n\t\tSystem.out.println(tree.firstElement.val);\n\t\tSystem.out.println(tree.secondElement.val);\n\t}", "private void preOrdertraverse(Node root){\n System.out.println(root.value);\n for(var child : root.getChildren())\n preOrdertraverse(child); //recursively travels other childrens in current child\n }", "public static void main(String[] args) {\n\n Node<Integer> node1 = new Node<>(1);\n Node<Integer> node2 = new Node<>(2);\n Node<Integer> node3 = new Node<>(3);\n Node<Integer> node4 = new Node<>(4);\n\n node1.setLeftChild(node2);\n node1.setRightChild(node3);\n\n node2.setLeftChild(node4);\n\n node3.setLeftChild(new Node<>(5));\n node3.setRightChild(new Node<>(6));\n\n node4.setLeftChild(new Node<>(7));\n node4.setRightChild(new Node<>(8));\n\n traverse(node1);\n }", "public void inOrderTraverseTree(Node focusNode) {\n if(focusNode != null) { // recursively traverse left child nodes first than right\n inOrderTraverseTree(focusNode.leftChild);\n\n System.out.println(focusNode); // print recursively inorder node (or return!)\n\n inOrderTraverseTree(focusNode.rightChild);\n\n }\n }", "public static int rob(TreeNode root) {\n return rob(root, true);\n }", "public TreeNode getRight() {\n\t\treturn right;\n\t}", "public BinaryTreeNode getRight() {\n\t\treturn right;\n\t}", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "void traverse2() {\n BTNode node = root, prev = null, next;\n while (node != null) {\n if (prev == node.parent) {\n if (node.left != null) {\n next = node.left;\n }\n else if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else if (prev == node.left) {\n if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else {\n next = node.parent;\n }\n prev = node;\n node = next;\n }\n }", "public void postOrder(MyBinNode<Type> r){\n if(r != null){\n this.postOrder(r.right);\n this.postOrder(r.left);\n System.out.print(r.value.toString() + \" \");\n }\n }", "public void inOrderTraverseRecursive();", "public static void printNodes(Node root)\n\t{\n\t\t// return is tree is empty\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// print root node\n\t\tSystem.out.print(root.key + \" \");\n\n\t\t// create a two empty queues and enqueue root's left and\n\t\t// right child respectively\n\t\tQueue<Node> first = new ArrayDeque<Node>();\n\t\tfirst.add(root.left);\n\n\t\tQueue<Node> second = new ArrayDeque<Node>();\n\t\tsecond.add(root.right);\n\n\t\t// run till queue is empty\n\t\twhile (!first.isEmpty())\n\t\t{\n\t\t\t// calculate number of nodes in current level\n\t\t\tint n = first.size();\n\n\t\t\t// process every node of current level\n\t\t\twhile (n-- > 0)\n\t\t\t{\n\t\t\t\t// pop front node from first queue and print it\n\t\t\t\tNode x = first.poll();\n\n\t\t\t\tSystem.out.print(x.key + \" \");\n\n\t\t\t\t// push left and right child of x to first queue\n\t\t\t\tif (x.left != null) {\n\t\t\t\t\tfirst.add(x.left);\n\t\t\t\t}\n\n\t\t\t\tif (x.right != null) {\n\t\t\t\t\tfirst.add(x.right);\n\t\t\t\t}\n\n\t\t\t\t// pop front node from second queue and print it\n\t\t\t\tNode y = second.poll();\n\n\t\t\t\tSystem.out.print(y.key + \" \");\n\n\t\t\t\t// push right and left child of y to second queue\n\t\t\t\tif (y.right != null) {\n\t\t\t\t\tsecond.add(y.right);\n\t\t\t\t}\n\n\t\t\t\tif (y.left != null) {\n\t\t\t\t\tsecond.add(y.left);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void printLDRNodes(Node N) {\n if(N != null) {\n printLDRNodes(N.getLeft());\n System.out.print(N.getData() + \" \");\n printLDRNodes(N.getRight());\n }\n }", "public static void main(String[] args) {\n BinayTree root = new BinayTree();\n root.data = 8;\n root.left = new BinayTree();\n root.left.data = 6;\n root.left.left = new BinayTree();\n root.left.left.data = 5;\n root.left.right = new BinayTree();\n root.left.right.data = 7;\n root.right = new BinayTree();\n root.right.data = 10;\n root.right.left = new BinayTree();\n root.right.left.data = 9;\n root.right.right = new BinayTree();\n root.right.right.data = 11;\n printTree(root);\n System.out.println();\n mirror(root);\n printTree(root);\n // 1\n // /\n // 3\n // /\n // 5\n // /\n // 7\n // /\n // 9\n BinayTree root2 = new BinayTree();\n root2.data = 1;\n root2.left = new BinayTree();\n root2.left.data = 3;\n root2.left.left = new BinayTree();\n root2.left.left.data = 5;\n root2.left.left.left = new BinayTree();\n root2.left.left.left.data = 7;\n root2.left.left.left.left = new BinayTree();\n root2.left.left.left.left.data = 9;\n System.out.println(\"\\n\");\n printTree(root2);\n System.out.println();\n mirror(root2);\n printTree(root2);\n\n // 0\n // \\\n // 2\n // \\\n // 4\n // \\\n // 6\n // \\\n // 8\n BinayTree root3 = new BinayTree();\n root3.data = 0;\n root3.right = new BinayTree();\n root3.right.data = 2;\n root3.right.right = new BinayTree();\n root3.right.right.data = 4;\n root3.right.right.right = new BinayTree();\n root3.right.right.right.data = 6;\n root3.right.right.right.right = new BinayTree();\n root3.right.right.right.right.data = 8;\n System.out.println(\"\\n\");\n printTree(root3);\n System.out.println();\n mirror(root3);\n printTree(root3);\n\n\n }", "public void inorderRec(Node root)\n {\n //If condition to check root is not null .\n if(root!= null) {\n inorderRec(root.left);\n System.out.print(root.key + \" \");\n inorderRec(root.right);\n }\n }", "public static void main(String[] args) {\n\t\tNode root = new Node(30);\n\t\troot.right = new Node(40);\n\t\troot.left = new Node(20);\n\t\troot.left.right=new Node(25);\n\t\troot.left.left = new Node(10);\n\t\troot.right.left = new Node(35);\n\t\troot.right.right = new Node(45);\n\t\t\n\t\tpostOrderTraversal(root);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tpostOrderRecursion(root);\n\t}", "void inorder(Node root) {\n\t\tboolean leftdone = false;\n\n\t\t// Start traversal from root\n\t\twhile (root != null) {\n\t\t\t// If left child is not traversed, find the\n\t\t\t// leftmost child\n\t\t\tif (!leftdone) {\n\t\t\t\twhile (root.left != null) {\n\t\t\t\t\troot = root.left;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print root's data\n\t\t\tSystem.out.print(root.data + \" \");\n\n\t\t\t// Mark left as done\n\t\t\tleftdone = true;\n\n\t\t\t// If right child exists\n\t\t\tif (root.right != null) {\n\t\t\t\tleftdone = false;\n\t\t\t\troot = root.right;\n\t\t\t}\n\n\t\t\t// If right child doesn't exist, move to parent\n\t\t\telse if (root.parent != null) {\n\t\t\t\t// If this node is right child of its parent,\n\t\t\t\t// visit parent's parent first\n\t\t\t\twhile (root.parent != null && root == root.parent.right)\n\t\t\t\t\troot = root.parent;\n\n\t\t\t\tif (root.parent == null)\n\t\t\t\t\tbreak;\n\t\t\t\troot = root.parent;\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t}\n\t}", "public myBinaryTree<T> my_right_tree() throws myException;", "public String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "private E[] getPreOrderRightSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}", "public void inOrderTree(TernaryTreeNode root)\n {\n if(root==null) return;\n \n \n inOrderTree(root.left);\n inOrderTree(root.middle);\n inOrderTree(root.right);\n System.out.print(root.data+\" \");\n \n }", "public BinaryTreeADT<T> getRight();", "public Iteratable<IRNode> topDown(IRNode subtree);", "protected BinarySearchTree<K, V> getRight() {\n return this.right;\n }", "public static void main(String[] args) {\n\t\ttn=new TreeNode(null,null,null,1);\n\t\tTreeNode tleft=new TreeNode(tn,null,null,2);\n\t\tTreeNode tright=new TreeNode(tn,null,null,3);\n\t\ttn.left=tleft;\n\t\ttn.right=tright;\n\t\t\n\t\tTreeNode tleft1=new TreeNode(tleft,null,null,4);\n\t\tTreeNode tright1=new TreeNode(tleft,null,null,5);\n\t\ttleft.left=tleft1;\n\t\ttleft.right=tright1;\n\t\t\n\t\tTreeNode tleft2=new TreeNode(tright,null,null,6);\n\t\tTreeNode tright2=new TreeNode(tright,null,null,7);\n\t\ttright.left=tleft2;\n\t\ttright.right=tright2;\n\t\t\n\t\tTreeNode tleft3=new TreeNode(tleft1,null,null,8);\n\t\tTreeNode tright3=new TreeNode(tleft1,null,null,9);\n\t\ttleft1.left=tleft3;\n\t\ttleft1.right=tright3;\n\t\t\n\t\tTreeNode tleft4=new TreeNode(tright1,null,null,10);\n\t\tTreeNode tright4=new TreeNode(tright1,null,null,11);\n\t\ttright1.left=tleft4;\n\t\ttright1.right=tright4;\n\t\t\n\t\tSystem.out.println(inorderTraversal2(tn));\n\t}", "public static void main(String[] args) { Scanner scanner = new Scanner(System.in);\n// System.out.println(\"Please read number of levels for tree: \");\n// int n = scanner.nextInt();\n//\n// System.out.println(\"The tree will have \" + n + \" levels\");\n//\n Tree tree = new Tree();\n// tree.generateDefaultTree(n);\n tree.readUnbalancedTree();\n System.out.println(\"Display NLR:\");\n tree.showTreeNLR(tree.root);\n System.out.println();\n System.out.println(\"Display LNR\");\n tree.showTreeLNR(tree.root);\n System.out.println();\n System.out.println(\"Display LRN\");\n tree.showTreeLRN(tree.root);\n }", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "public List<Integer> rightSideView(TreeNode root) {\n\t\tList<Integer> result = new ArrayList<>();\n\t\tif (root == null) {\n\t\t\treturn result;\n\t\t}\n\t\tQueue<TreeNode> queue = new LinkedList<>();\n\t\tqueue.offer(root);\n\t\twhile (!queue.isEmpty()) {\n\t\t\tint size = queue.size();\n\t\t\tint changeSize = size;\n\t\t\tList<Integer> tempList = new ArrayList<>();\n\t\t\twhile (changeSize > 0) {\n\t\t\t\tTreeNode tempNode = queue.poll();\n\t\t\t\ttempList.add(tempNode.val);\n\t\t\t\tif (tempNode.left != null) {\n\t\t\t\t\tqueue.offer(tempNode.left);\n\t\t\t\t}\n\t\t\t\tif (tempNode.right != null) {\n\t\t\t\t\tqueue.offer(tempNode.right);\n\t\t\t\t}\n\t\t\t\tchangeSize--;\n\t\t\t}\n\t\t\tresult.add(tempList.get(size - 1));\n\t\t}\n\t\treturn result;\n\t}", "private TraverseData traverse(int treeIndex) {\n Node<T> newRoot = new Node<>(branchingFactor);\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData data = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, b));\n currentNode = data.currentNode;\n currentNewNode = data.currentNewNode;\n treeIndex = data.index;\n }\n return new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, 1);\n }", "private E[] geInOrderRightSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(9);\n root.right = new TreeNode(20);\n root.right.left = new TreeNode(15);\n root.right.right = new TreeNode(7);\n System.out.println(new Solution().preorderTraversal(null));\n }", "private BSTNode linkedListToTree (Iterator iter, int n) {\n // TODO Your code here\n \tint leftlenght,rightlength;\n \tdouble LenOfleft = n/2;\n \tleftlenght = (int)java.lang.Math.floor(LenOfleft);\n \trightlength = n - leftlenght -1;\n \t\n \t//linkedListToTree(iter,leftlenght);\n \t//Object item = iter.next();\n \t//linkedListToTree(iter,rightlength);\n \t\n return new BSTNode(linkedListToTree(iter,leftlenght),iter.next(),linkedListToTree(iter,rightlength)) ;\n }" ]
[ "0.66010094", "0.6489541", "0.6390682", "0.63879144", "0.63628817", "0.6327393", "0.6299505", "0.6230897", "0.61861145", "0.61586416", "0.61366254", "0.6105572", "0.60727614", "0.6066407", "0.6058729", "0.60496914", "0.6041705", "0.6021246", "0.6015386", "0.60137403", "0.6004519", "0.59719783", "0.59573966", "0.5956709", "0.59534585", "0.58912396", "0.58832294", "0.58629096", "0.5844387", "0.58344865", "0.5812768", "0.5802921", "0.5795133", "0.577931", "0.57637125", "0.57500845", "0.5745776", "0.5723326", "0.57029355", "0.5699566", "0.5697958", "0.56834817", "0.56739974", "0.56723535", "0.5637333", "0.563479", "0.562454", "0.56243247", "0.5623416", "0.56146944", "0.5609597", "0.56038207", "0.56009644", "0.5596197", "0.5594819", "0.559142", "0.5588582", "0.5586621", "0.5578636", "0.55780065", "0.556451", "0.5562872", "0.5550411", "0.5545442", "0.55439633", "0.5543814", "0.55435693", "0.5535195", "0.55276936", "0.5526596", "0.55132383", "0.5509124", "0.55055976", "0.5505273", "0.5504591", "0.55041945", "0.54968727", "0.54935277", "0.5493157", "0.5487727", "0.5483142", "0.5478332", "0.5475325", "0.5466432", "0.54554945", "0.5453636", "0.5451602", "0.5449079", "0.5442565", "0.543505", "0.54343766", "0.5433179", "0.54245734", "0.54204595", "0.5419185", "0.5417416", "0.54168487", "0.5415275", "0.5411483", "0.5405959" ]
0.6607801
0
TraverseRNL method traverses tree from right subtree, root, then left subtree and outputs the values
public void TraverseRNL(TreeNode Root) { if(Root.Right != null) TraverseLNR(Root.Right); System.out.println(Root.Data); if(Root.Left != null) TraverseLNR(Root.Left); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void TraverseLRN(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\t\r\n\t}", "public void TraverseNLR(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "private Voter traverseRBT(RedBlackTree.Node<Voter> root, Date birthdate) {\r\n \r\n RedBlackTree.Node<Voter> currentNode = root;\r\n //no voter in the database so none can be gotten\r\n if (currentNode == null) {\r\n throw new NoSuchElementException(\"There is no voter in the database\");\r\n }\r\n \r\n // if the current node matches that of that of the birthdate, return that node\r\n if (currentNode.data.compareTo(new Voter(birthdate)) == 0) {\r\n return currentNode.data;\r\n \r\n //if the current node does not match traverse down the subtrees\r\n \r\n } else if (currentNode.data.compareTo(new Voter(birthdate)) > 0) {\r\n // left subtree\r\n return traverseRBT(currentNode.leftChild, birthdate); //recursively traverse through left subtree\r\n } else {\r\n // right subtree\r\n return traverseRBT(currentNode.rightChild, birthdate); //recursively traverse through right subtree\r\n }\r\n }", "public void TraverseRLN(TreeNode Root) {\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t}", "public static void main(String[] args) {\n TreeNode node = new TreeNode();\n node.value = 1;\n node.left = new TreeNode();\n node.left.value = 2;\n node.right = new TreeNode();\n node.right.value = 3;\n node.left.left = new TreeNode();\n node.left.left.value = 4;\n node.left.right = new TreeNode();\n node.left.right.value = 5;\n node.right.left = new TreeNode();\n node.right.left.value = 6;\n node.right.right = new TreeNode();\n node.right.right.value = 7;\n// System.out.println(mirro(node).value);\n// System.out.println(mirro(node).left.value);\n// System.out.println(Arrays.toString(LevelPrintTree.levelPrint(mirro(node))));\n\n recur(node);\n\n }", "TreeNode<T> getRight();", "public void traverse(Node root){\n\t\tNode pred, current;\n\t\tcurrent=root;\n\t\tint rank=10;\n\t\tint rankCount=1;\n\t\twhile(current!=null){\n\t\t\tif(current.left==null){\n\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\trankCount++;\n\t\t\t\tcurrent=current.right;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpred=current.left;\n\t\t\t\twhile(pred.right!=null && pred.right!=current){\n\t\t\t\t\tpred=pred.right;\n\t\t\t\t}\n\n\t\t\t\tif(pred.right==null){\n\t\t\t\t\tpred.right=current;\n\t\t\t\t\tcurrent=current.left;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tpred.right=null;\n\t\t\t\t\tif(rankCount==rank){\n\t\t\t\t\t\tSystem.out.print(current.value+\" \");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\trankCount++;\n\t\t\t\t\tcurrent=current.right;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void rightViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == 0) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n }", "protected void visitRightSubtree() {\n\t\tif(tree.hasRightNode()) {\n\t\t\ttree.moveToRightNode();\n\t\t\ttraverse();\n\t\t\ttree.moveToParentNode();\n\t\t}\n\t}", "public void reverseLevelOrderTraversel(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tQueue<TreeNode> que = new LinkedList<>();\r\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\r\n\t\t\r\n\t\tque.add(root);\r\n\t\twhile(que.size()>0)\r\n\t\t{\r\n\t\t\tTreeNode element=que.remove();\r\n\t\t\tif(element.right!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.right);\r\n\t\t\t}\r\n\t\t\tif(element.left!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.left);\r\n\t\t\t}\r\n\t\t\tstack.push(element);\r\n\t\t}\r\n\t\twhile(stack.size()>0)\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop().data+\" \");\r\n\t\t}\r\n\t\t\t\r\n\t}", "public void TraverseNRL(TreeNode Root) {\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t}", "public void printRightView(){\n \n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n Node<T> lastVal = null;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n\n // keep track of last node and dont print it\n lastVal = node;\n\n // Enqueue left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // print last node\n System.out.println(lastVal.data + \" ,\");\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "@Test\r\n\tpublic void test(){\r\n\t\tTreeNode root = new TreeNode(1); \r\n TreeNode r2 = new TreeNode(2); \r\n TreeNode r3 = new TreeNode(3); \r\n TreeNode r4 = new TreeNode(4); \r\n TreeNode r5 = new TreeNode(5); \r\n TreeNode r6 = new TreeNode(6); \r\n root.left = r2; \r\n root.right = r3; \r\n r2.left = r4; \r\n r2.right = r5; \r\n r3.right = r6;\r\n System.out.println(getNodeNumRec(root));\r\n System.out.println(getNodeNum(root));\r\n System.out.println(getDepthRec(root));\r\n System.out.println(getDepth(root));\r\n System.out.println(\"前序遍历\");\r\n preorderTraversalRec(root);\r\n System.out.println(\"\");\r\n preorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"中序遍历\");\r\n inorderTraversalRec(root);\r\n System.out.println(\"\");\r\n inorderTraversal(root);\r\n System.out.println(\"\");\r\n System.out.println(\"后序遍历\");\r\n postorderTraversalRec(root);\r\n System.out.println(\"\");\r\n postorderTraversal(root);\r\n System.out.println(\"分层遍历\");\r\n levelTraversal(root);\r\n System.out.println(\"\");\r\n levelTraversalRec(root);\r\n\t}", "public BinaryTree rightTree()\n {return right;}", "public void TraverseLNR(TreeNode Root) {\r\n\t\tif(Root.Left != null)\r\n\t\t\tTraverseLNR(Root.Left);\r\n\t\tSystem.out.println(Root.Data);\r\n\t\tif(Root.Right != null)\r\n\t\t\tTraverseLNR(Root.Right);\r\n\t}", "public static void main(String[] args){\n\t\tTreeNode node1 = new TreeNode(1);\n\t\tTreeNode node2 = new TreeNode(2);\n\t\tTreeNode node3 = new TreeNode(3);\n\t\tTreeNode node4 = new TreeNode(4);\n\t\tTreeNode node5 = new TreeNode(5);\n\t\tTreeNode node6 = new TreeNode(6);\n\t\tTreeNode node7 = new TreeNode(7);\n\t\tnode4.left = node2;\n\t\tnode4.right = node6;\n\t\tnode2.left = node1;\n\t\tnode2.right = node3;\n\t\tnode6.left = node5;\n\t\tnode6.right = node7;\n\t\t/*\n\t\t * 4\n\t\t * /\n\t\t * 5\n\t\t * \\\n\t\t * 6\n\t\t */\n\t\t/*node4.left = node5;\n\t\tnode5.right = node6;*/\n\t\t\n\t\ttreeTraversal2 tt = new treeTraversal2();\n\t\tSystem.out.print(\"Inorder Rcur: \");tt.inorderTraverse(node4);//1234567\n\t\tSystem.out.println();\t\t\n\t\tSystem.out.print(\"Inorder Iter: \");tt.stackInorder(node4);//1234567\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Rcur: \");tt.preorderTraverse(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Preorder Iter: \"); tt.stackPreorder(node4);//4213657\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Postorder Rcur: \");tt.postorderTraverse(node4);//1325764\n\t\tSystem.out.println();\t\t \n\t\tSystem.out.print(\"Postorder Iter: \");tt.stackPostorder(node4);//1325764\n\t\t//System.out.println();\n\t\t//System.out.print(\"Postorder Iter: \");tt.twoStackPostorder(node4);//1325764\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Level Iter: \");tt.levelTraverse(node4);//4261357\n\t}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n // TODO Auto-generated method stub\n int[] nums = {3, 2, 1, 6, 0, 5};\n TreeNode root = solution2(nums);\n System.out.println(root.val);\n System.out.println(root.left.val);\n System.out.println(root.left.right.val);\n System.out.println(root.left.right.right.val);\n System.out.println(root.right.val);\n System.out.println(root.right.left.val);\n System.out.println(root.right.right);\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "public TreeNode getRight(){ return rightChild;}", "@Override\n\tpublic BTree<T> right() \n\t{\n\t\treturn root.right;\n\t}", "private void inOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n inOrderTraversalRec(root.getLeft());\n System.out.print(root.getData() + \" \");\n inOrderTraversalRec(root.getRight());\n }", "public TreeNode getRight() {\n\t\treturn right;\n\t}", "public BinaryTreeNode getRight() {\n\t\treturn right;\n\t}", "public BinNode<T> getRight();", "public void rightBoundary(TreeNode root) {\n if (root.right == null && root.left == null) return; // ignore leaf\n if (root.right != null) rightBoundary(root.right);\n else rightBoundary(root.left);\n result.add(root.val); // add after child visit(reverse)\n }", "private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}", "protected BinarySearchTree<K, V> getRight() {\n return this.right;\n }", "public Node getRight(){\r\n return this.right;\r\n }", "public static void main(String args[]){\n BinaryTreeNode root = new BinaryTreeNode();\n root.setData(1);\n\n BinaryTreeNode left = new BinaryTreeNode();\n left.setData(2);\n\n BinaryTreeNode right = new BinaryTreeNode();\n right.setData(3);\n\n BinaryTreeNode leftleft = new BinaryTreeNode();\n leftleft.setData(4);\n\n BinaryTreeNode leftright = new BinaryTreeNode();\n leftright.setData(5);\n\n root.setLeft(left);\n root.setRight(right);\n left.setLeft(leftleft);\n left.setRight(leftright);\n\n\n postOrderIterative(root);\n\n }", "public static void leftToRight(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n leftToRight(root.left, level-1);\n leftToRight(root.right, level-1);\n }\n\n }", "public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }", "public void traverseLevelOrder() {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tLinkedList<Node> ls = new LinkedList<>();\n\t\tls.add(root);\n\t\twhile (!ls.isEmpty()) {\n\t\t\tNode node = ls.remove();\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\tif (node.left != null) {\n\t\t\t\tls.add(node.left);\n\t\t\t}\n\t\t\tif (node.right != null) {\n\t\t\t\tls.add(node.right);\n\t\t\t}\n\t\t}\n\t}", "public List<Integer> rightSideView(TreeNode root) {\n List<Integer> r = new ArrayList<>();\n LinkedList<LinkedList<Integer>> levelOrder = new LinkedList<>();\n LinkedList<TreeNode> queue = new LinkedList<>();\n if(root == null) return r;\n queue.offer(root);\n while(!queue.isEmpty()){\n int size = queue.size();\n LinkedList<Integer> res = new LinkedList<>();\n for(int i=0;i<size;i++){\n TreeNode cur = queue.pop();\n res.add(cur.val);\n if(cur.left != null) queue.offer(cur.left);\n if(cur.right != null) queue.offer(cur.right);\n }\n levelOrder.add(res);\n }\n //2. store the last element of each list\n LinkedList<Integer> ans = new LinkedList<>();\n for(LinkedList<Integer> l : levelOrder){\n int s = l.get(l.size() - 1);\n ans.add(s);\n }\n return ans;\n }", "public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}", "public void postOrder(MyBinNode<Type> r){\n if(r != null){\n this.postOrder(r.right);\n this.postOrder(r.left);\n System.out.print(r.value.toString() + \" \");\n }\n }", "void printInOrder(Node R){\n if( R != null ){\n printInOrder(R.left);\n System.out.println(R.item.key + \" \" + R.item.value);\n printInOrder(R.right);\n }\n }", "public static void main(String[] args) {\n\n TreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n TreeNode node8 = new TreeNode(8);\n node1.right=node3;\n node1.left=node2;\n node2.left=node4;\n node3.right=node5;\n node4.right=node6;\n node6.left=node7;\n node6.right=node8;\n traversalRecursion(node1);\n System.out.println();\n nonRecurInTraverse(node1);\n }", "void\nprintBoundaryRight(Node node) \n\n{ \n\nif\n(node != \nnull\n) { \n\nif\n(node.right != \nnull\n) { \n\n// to ensure bottom up order, first call for right \n\n// subtree, then print this node \n\nprintBoundaryRight(node.right); \n\nSystem.out.print(node.data + \n\" \"\n); \n\n} \n\nelse\nif\n(node.left != \nnull\n) { \n\nprintBoundaryRight(node.left); \n\nSystem.out.print(node.data + \n\" \"\n); \n\n} \n\n// do nothing if it is a leaf node, this way we avoid \n\n// duplicates in output \n\n} \n\n}", "protected void printTree(){\n if (this.leftNode != null){\n leftNode.printTree();\n }\n System.out.println(value);\n\n if (this.rightNode != null){\n rightNode.printTree();\n }\n }", "public static void main(String[] args) {\n \n LinkedBinaryTree expr = new LinkedBinaryTree<String>();\n // a is the root of the tree\n Position a, b, c, d, e, f, g, h, i;\n a = expr.addRoot(\"*\");\n b = expr.addLeft(a, \"+\");\n c = expr.addLeft(b, \"/\");\n d = expr.addLeft(c, \"*\");\n e = expr.addLeft(d, \"+\");\n expr.addLeft(e, \"5\");\n expr.addRight(e, \"2\");\n f = expr.addRight(d, \"-\");\n expr.addLeft(f, \"2\");\n expr.addRight(f, \"1\");\n g = expr.addRight(c, \"+\");\n expr.addLeft(g, \"2\");\n expr.addRight(g, \"9\");\n h = expr.addRight(b, \"-\");\n i = expr.addLeft(h, \"-\");\n expr.addLeft(i, \"7\");\n expr.addRight(i, \"2\");\n expr.addRight(h, \"1\");\n expr.addRight(a, \"8\");\n \n System.out.println(\"The original expression:\");\n System.out.println(\"(((5+2)*(2–1)/(2+9)+((7–2)–1))*8)\\n\");\n \n System.out.println(\"Preorder traversal:\");\n Iterable<Position<String>> preIter = expr.preorder();\n for (Position<String> s : preIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Inorder traversal:\");\n Iterable<Position<String>> inIter = expr.inorder();\n for (Position<String> s : inIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Postorder traversal:\");\n Iterable<Position<String>> postIter = expr.postorder();\n for (Position<String> s : postIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Breadth traversal:\");\n Iterable<Position<String>> breadthIter = expr.breadthfirst();\n for (Position<String> s : breadthIter) {\n System.out.print(s.getElement() + \" \");\n }\n System.out.println(\"\\n\");\n \n System.out.println(\"Parenthesized representation:\"); \n printParenthesize(expr, a);\n System.out.println();\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tTreeNode r1 = new TreeNode(1);\n\t\tTreeNode r2 = new TreeNode(2);\n\t\tTreeNode r3 = new TreeNode(3);\n\t\tTreeNode r4 = new TreeNode(4);\n\t\tTreeNode r5 = new TreeNode(5);\n\t\tTreeNode r6 = new TreeNode(6);\n\t\tTreeNode r7 = new TreeNode(7);\n\t\tTreeNode r8 = new TreeNode(8);\n\t\t\n\t\tr1.left = r2;\n\t\tr1.right = r5;\n\t\tr2.left = r3;\n\t\tr2.right = r4;\n\t\tr5.right = r6;\n\t\tr6.left = r7;\n\t\tr6.right = r8;\n\t\t\n\t\tflatten(r1);\n\t\tStringBuilder sb = new StringBuilder();\n\t\tTreeNode p = r1;\n\t\twhile(p !=null){\n\t\t\tsb.append(p.val+\"-->\");\n\t\t\tp=p.right;\n\t\t}\n\t\t\n\t\tSystem.out.println(sb);\n\t\t\n\t}", "public HuffmanNode getRightSubtree () {\n \treturn right;\n }", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public Node getRight() {\n return this.right;\n }", "public int rob(TreeNode root) {\n if (root == null) return 0;\n int value = root.val;\n \n if (root.left != null) {\n value += rob (root.left.left);\n value += rob (root.left.right);\n }\n \n if (root.right != null) {\n value += rob (root.right.left);\n value += rob (root.right.right);\n }\n \n return Math.max (value, rob (root.left) + rob (root.right));\n }", "private void postorderRightOnly(Node root) {\r\n if (root.right != null)\r\n postorderRightOnly(root.right);\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n }", "public void postOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n postOrderTraverseTree(focusNode.leftChild);\n postOrderTraverseTree(focusNode.rightChild);\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n }\n }", "private int treeTraverse (TreeNode root, int previousVal) {\n if (root == null)\n return 0;\n \n // traverse left, then right\n int left = treeTraverse(root.left, root.val);\n int right = treeTraverse(root.right, root.val);\n \n // calculate the longest path\n path = Math.max(left + right, path);\n\n //return\n if (root.val == previousVal) \n return Math.max(left, right) + 1;\n \n return 0;\n }", "@Override\n public AVLTreeNode<E> getRight() {\n return (AVLTreeNode<E>) super.getRight();\n }", "private E[] geInOrderRightSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n TreeNode n7 = new TreeNode(7);\n TreeNode n6 = new TreeNode(6);\n TreeNode n5 = new TreeNode(5);\n TreeNode n4 = new TreeNode(4);\n TreeNode n3 = new TreeNode(3);\n TreeNode n2 = new TreeNode(2);\n TreeNode n1 = new TreeNode(1);\n\n n4.left = n2;\n n4.right = n6;\n\n n2.left = n1;\n n2.right = n3;\n\n n6.left = n5;\n n6.right = n7;\n\n System.out.println(\"Cay n4\");\n List<Integer> resultPreOrder = preOrderTravel(n4);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n\n System.out.println(\"Cay n2\");\n resultPreOrder = preOrderTravel(n2);\n for (Integer integer : resultPreOrder) {\n System.out.println(integer);\n }\n }", "void traverse2() {\n BTNode node = root, prev = null, next;\n while (node != null) {\n if (prev == node.parent) {\n if (node.left != null) {\n next = node.left;\n }\n else if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else if (prev == node.left) {\n if (node.right != null) {\n next = node.right;\n }\n else {\n next = node.parent;\n }\n } else {\n next = node.parent;\n }\n prev = node;\n node = next;\n }\n }", "public String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "public BinaryTreeADT<T> getRight();", "public Node getRight () {\r\n\t\treturn right;\r\n\t}", "public myBinaryTree<T> my_right_tree() throws myException;", "public List<Integer> rightSideView_bfs(TreeNode root) {\n List<Integer> list = new ArrayList<>();\n if(root == null){\n return list;\n }\n Queue<TreeNode> q = new LinkedList<>();\n q.offer(root);\n while(!q.isEmpty()){\n int len = q.size();\n for(int i=0; i<len; i++){\n TreeNode node = q.poll();\n if(i == 0){\n list.add(node.val);\n }\n if(node.left != null) q.offer(node.left);\n if(node.right != null) q.offer(node.right); \n }\n }\n return list;\n }", "public int rob(TreeNode root) {\n return rob(root, new HashMap<>());\n }", "public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }", "public Node getRight() {\n return right;\n }", "public Node getRight() {\n return right;\n }", "public Node getRight() {\n return right;\n }", "public void postorderTraversal() \n { \n postorderTraversal(header.rightChild); \n }", "private AvlNode<E> doubleWithRightChild(AvlNode<E> k1){\n k1.right = rotateWithLeftChild(k1.right);\n return rotateWithRightChild(k1);\n }", "private E[] getPreOrderRightSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}", "public static void rightToLeft(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n rightToLeft(root.right, level-1);\n rightToLeft(root.left, level-1);\n }\n }", "public void postOrden(nodoArbolAVL r){\n if(r != null){\n postOrden(r.hijoIzquierdo);\n postOrden(r.hijoDerecho);\n //System.out.print(r.dato + \" , \");\n for (int i = 1; i<=7;i++) {\n if(r.nivel==i)\n {\n //vector[i]=r.dato;\n System.out.println(r.dato + \" NIVEL: \"+i);\n }\n }\n \n } \n \n }", "@Override\n\t\tpublic PrintNode getRight() {\n\t\t\treturn this.right;\n\t\t}", "public Node findRL(Node n) {\r\n\t\tif (n.rightChild == null) {\r\n\t\t\treturn n; \r\n\t\t} else { \r\n\t\t\treturn findRL(n.rightChild);\r\n\t\t}\r\n\t}", "public int rob(TreeNode root) {\n if(root == null)\n return 0;\n \n int[] result = helper(root);\n return Math.max(result[0], result[1]);\n}", "public Node<T> getRight() {\r\n\t\treturn right;\r\n\t}", "public TreeNode getRightChild() {\n return rightChild;\n }", "public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }", "public static void main(String[] args)\n throws Exception\n {\n PrintWriter pen = new PrintWriter(System.out, true);\n BST<String, String> dict =\n new BST<String, String>((left, right) -> left.compareTo(right));\n\n String[] values =\n new String[] { \"gorilla\", \"dingo\", \"chimp\", \"emu\", \"elephant\", \"beta\",\n \"aardvark\", \"chinchilla\", \"yeti\", \"gibbon\", \"horse\",\n \"elephant\", \"duck\", \"emu\" };\n String[] moreValues =\n new String[] { \"gnu\", \"dingo\", \"flying squirrel\", \"iguana\", \"squirrel\",\n \"red squirrel\", \"moose\" };\n\n // Add each element and make sure that it's there.\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n\n // A quick printout for fun\n pen.println(\"After setting the first set of values\");\n iterate(pen, dict.iterator());\n\n // Another quick printout for fun\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n pen.println(\"After setting the second set of values\");\n iterate(pen, dict.iterator());\n\n // Build iterators that traverse in different ways\n Iterable<String> df_pre_lr =\n dict.values(Traversal.DEPTH_FIRST_PREORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_lr =\n dict.values(Traversal.DEPTH_FIRST_INORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_rl =\n dict.values(Traversal.DEPTH_FIRST_INORDER_RIGHT_TO_LEFT);\n Iterable<String> bf_pre_rl =\n dict.values(Traversal.BREADTH_FIRST_PREORDER_RIGHT_TO_LEFT);\n\n // Iterate!\n pen.println(\"Iterating depth-first, preorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_pre_lr);\n \n pen.println(\"Iterating depth-first, inorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_in_lr);\n \n pen.println(\"Iterating depth-first, inorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, df_in_rl);\n \n pen.println(\"Iterating breadth-first, preorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, bf_pre_rl);\n\n // And we're done\n pen.close();\n }", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }", "public Iteratable<IRNode> topDown(IRNode subtree);", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "public static void main(String args[]) {\n\t\t\n\t\tTreeNode root = new TreeNode(3);\n\t\troot.right = new TreeNode(2);\n\t\troot.right.right = new TreeNode(1);\n\t\t\n\n\t\tRecoverTree tree = new RecoverTree();\n\n\t\ttree.recoverTree(root);\n\t\tSystem.out.println(tree.firstElement.val);\n\t\tSystem.out.println(tree.secondElement.val);\n\t}", "public void inOrder(MyBinNode<Type> r){\n if(r != null){\n this.inOrder(r.left);\n System.out.print(r.value.toString() + \" \");\n this.inOrder(r.right);\n }\n }", "private void traverse(TNode node)\r\n\t\t{\n\t\t\tif (node != null) {\r\n\t\t\t\ttraverse(node.getLeft());\r\n\r\n\t\t\t\tSystem.out.println(node);\r\n\r\n\t\t\t\ttraverse(node.getRight());\r\n\t\t\t}\r\n\r\n\t\t}", "public void printLRDNodes(Node N) {\n if(N != null) {\n printLRDNodes(N.getLeft());\n printLRDNodes(N.getRight());\n System.out.print(N.getData() + \" \");\n }\n }", "protected abstract void traverse();", "@Override\n public Object right(Object node) {\n return ((Node<E>) node).right;\n }", "@Override\n public Object right(Object node) {\n return ((Node<E>) node).right;\n }", "public void traverse(Node node) {\n //pre order\n //System.out.println(node.data);\n\n if (node.leftChild != null) {\n traverse(node.leftChild);\n }\n //in order\n System.out.println(node.data);\n\n if (node.rightChild != null) {\n traverse(node.rightChild);\n }\n //post order\n //System.out.println(node.data);\n\n\n }", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "public static void main(String[] args) {\n \n\t\t\n\t\tNode root = new Node(8);\n\t\tinsertNode(root, 5);\n\t\tinsertNode(root, 3);\n\t\tinsertNode(root, 6);\n\t\tinsertNode(root, 2);\n\t\tinsertNode(root, 14);\n\t\tinsertNode(root, 13);\n\t\tinsertNode(root, 16);\n\t\tinsertNode(root, 12);\n\t\tinsertNode(root, 1);\n\t\tinsertNode(root, 11);\n \n\t\tprintRightOrder(root,0,-1);\n\t\t\n\t}", "public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}", "public ArrayList<K> inOrdorTraverseBST(){\n BSTNode<K> currentNode = this.rootNode;\n LinkedList<BSTNode<K>> nodeStack = new LinkedList<BSTNode<K>>();\n ArrayList<K> result = new ArrayList<K>();\n \n if (currentNode == null)\n return null;\n \n while (currentNode != null || nodeStack.size() > 0) {\n while (currentNode != null) {\n nodeStack.add(currentNode);\n currentNode = currentNode.getLeftChild();\n }\n currentNode = nodeStack.pollLast();\n result.add(currentNode.getId());\n currentNode = currentNode.getRightChild();\n }\n \n return result;\n }", "public int rob(TreeNode root) {\n if(root == null) return 0;\n int withRoot = root.val, withoutRoot = 0;\n if(root.left != null) withRoot += rob(root.left.left) + rob(root.left.right);\n if(root.right != null) withRoot += rob(root.right.left) + rob(root.right.right);\n withoutRoot = rob(root.left) + rob(root.right);\n return Math.max(withRoot, withoutRoot);\n }", "public BinarySearchTree getRightChild(){\r\n\t\treturn rightChild;\r\n\t}", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "private TraverseData traverse(int treeIndex) {\n Node<T> newRoot = new Node<>(branchingFactor);\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData data = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, b));\n currentNode = data.currentNode;\n currentNewNode = data.currentNewNode;\n treeIndex = data.index;\n }\n return new TraverseData(currentNode, currentNewNode, newRoot, treeIndex, 1);\n }", "public void leftViewBinaryTree(TreeNode root) {\n if (root == null) {\n return;\n }\n int count = 0;\n Queue<TreeNode> queue = new LinkedList<>();\n queue.add(root);\n count++;\n while (!queue.isEmpty()) {\n root = queue.poll();\n count--;\n if (count == queue.size()) {\n System.out.println(root.val);\n }\n if (root.left != null) {\n queue.add(root.left);\n count++;\n }\n if (root.right != null) {\n queue.add(root.right);\n count++;\n }\n }\n\n }", "public List<Integer> rightSideView(TreeNode root) {\n\t\tList<Integer> result = new ArrayList<>();\n\t\tif (root == null) {\n\t\t\treturn result;\n\t\t}\n\t\tQueue<TreeNode> queue = new LinkedList<>();\n\t\tqueue.offer(root);\n\t\twhile (!queue.isEmpty()) {\n\t\t\tint size = queue.size();\n\t\t\tint changeSize = size;\n\t\t\tList<Integer> tempList = new ArrayList<>();\n\t\t\twhile (changeSize > 0) {\n\t\t\t\tTreeNode tempNode = queue.poll();\n\t\t\t\ttempList.add(tempNode.val);\n\t\t\t\tif (tempNode.left != null) {\n\t\t\t\t\tqueue.offer(tempNode.left);\n\t\t\t\t}\n\t\t\t\tif (tempNode.right != null) {\n\t\t\t\t\tqueue.offer(tempNode.right);\n\t\t\t\t}\n\t\t\t\tchangeSize--;\n\t\t\t}\n\t\t\tresult.add(tempList.get(size - 1));\n\t\t}\n\t\treturn result;\n\t}", "private TreeNode traverseTree(Instance i) {\n TreeNode next = root;\n while (next != null && !next.isLeafNode()) {\n Attribute a = next.split.attribute;\n if (a.isNominal()) {\n next = next.nominals()[(int) i.value(a)];\n } else {\n if (i.value(a) < next.split.splitPoint) {\n next = next.left();\n } else {\n next = next.right();\n }\n }\n }\n return next;\n }", "public IAVLNode getRight() {\n\t\t\treturn this.right; // to be replaced by student code\n\t\t}" ]
[ "0.63390267", "0.633769", "0.63341653", "0.6239916", "0.6204135", "0.620085", "0.6120398", "0.611321", "0.61127263", "0.6062384", "0.6023233", "0.60194886", "0.5987592", "0.59694153", "0.5952331", "0.5894261", "0.58698857", "0.5861102", "0.58360064", "0.5829532", "0.5806222", "0.5804945", "0.57886124", "0.578166", "0.57814807", "0.5775153", "0.5769864", "0.57644045", "0.57562417", "0.5733041", "0.57317483", "0.57145655", "0.5714021", "0.56869483", "0.56827724", "0.5669865", "0.565152", "0.56404555", "0.56139606", "0.56047887", "0.5602537", "0.55953103", "0.5588033", "0.55861", "0.5574927", "0.5573151", "0.55669653", "0.55648434", "0.55629295", "0.5553109", "0.55422205", "0.55353236", "0.5516155", "0.55137765", "0.5511938", "0.5511213", "0.5510655", "0.5487562", "0.5484329", "0.545722", "0.5455023", "0.5455023", "0.5455023", "0.54536295", "0.54507846", "0.5440763", "0.54346913", "0.54198205", "0.54151624", "0.54136246", "0.5411178", "0.54083586", "0.54072905", "0.5405679", "0.5402162", "0.5398077", "0.5397783", "0.5397399", "0.5391191", "0.5389802", "0.53893995", "0.538705", "0.5386619", "0.5385668", "0.5382426", "0.5382426", "0.5365327", "0.53651243", "0.5363505", "0.53535694", "0.53418094", "0.5341168", "0.5333128", "0.5328715", "0.5325371", "0.53206843", "0.5309947", "0.5308571", "0.53071666", "0.53045267" ]
0.6731188
0
/ Member methods Gets a member by member id
public Member getMember(int memberId) { for(Member m : members) { if(m.getMemberNumber() == memberId) { return m; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MemberPo findMember(final String id);", "@Override\n\tpublic Member getMember(int id) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic Member getMemberById(int id) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tMember member = session.get(Member.class, id);\r\n\t\treturn member;\r\n\t}", "@Override\r\n\tpublic Member getMember(Long id) throws NotFoundException, ExistException,\r\n\t\t\tMissingParameter, InvalidParameter {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Member getMember(String memberId) throws Exception {\n\t\treturn memberDao.getMember(memberId);\r\n\t}", "public Member getMember(int id){\n super.open();\n\n // 2. build query\n Cursor cursor =\n db.query(TABLE_MEMBER, // a. table\n COLUMNS, // b. column names\n \" id = ?\", // c. selections\n new String[] { String.valueOf(id) }, // d. selections args\n null, // e. group by\n null, // f. having\n null, // g. order by\n null); // h. limit\n\n // 3. if we got results get the first one\n if (cursor != null)\n cursor.moveToFirst();\n\n // 4. build Member object\n Member member = new Member();\n member.id = Integer.parseInt(cursor.getString(0));\n member.nickName = cursor.getString(1);\n member.type = cursor.getInt(2);\n member.joinDate = cursor.getString(3);\n\n\n Log.d(\"getNotice(\" + id + \")\", member.toString());\n\n // 5. return member\n return member;\n }", "@Override\n\tpublic Member getMemberById(int id) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tString hql = \"from Member m where m.id = :id\";\n\t\tQuery query = session.createQuery(hql);\n\t\tquery.setParameter(\"id\", id);\n\t\tList<Member> listMember = query.list();\n\t\t\n\t\tif(listMember.isEmpty()) {\n\t\t\treturn new Member();\n\t\t}\n\t\t\n\t\treturn listMember.get(0);\n\t}", "Member findById(Long id);", "public Member getMemberById(int id) {\n\t\tfor (Iterator<Member> it = db.iterator(); it.hasNext(); ) {\n\t\t\tMember m = it.next();\n\t\t\tif (m.getId() == id) {\n\t\t\t\treturn m;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "IMemberDto getMember(/*old :String searchMember*/Integer id);", "@Override\r\n\tpublic Member SearchMemberByID(String id) {\n\t\tMember m = new Member();\r\n\r\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tString sql = \"select * from member where id=?\";\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tps.setString(1, id);\r\n\t\t\trs = ps.executeQuery();\r\n\t\t\tSystem.out.println(id);\r\n\t\t\twhile (rs.next()) {\r\n\r\n\t\t\t\tm.setID(rs.getString(\"id\"));\r\n\t\t\t\tm.setPW(rs.getString(\"pw\"));\r\n\t\t\t\tm.setNickName(rs.getString(\"nickname\"));\r\n\t\t\t\tm.setQuiz(rs.getString(\"quiz\"));\r\n\t\t\t\tm.setAnswer(rs.getString(\"answer\"));\r\n\t\t\t\tm.setScore(rs.getInt(\"score\"));\r\n\t\t\t\t\r\n\t\t\t\treturn m;\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\tps.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn m;\r\n\t}", "public static Member findById(int id){\n setConnection();\n \n Member member = null;\n \n try{\n Statement statement = con.createStatement();\n \n //Query statement\n String query = \"SELECT * FROM member WHERE id = ?\";\n\n //Create mysql prepared statement\n PreparedStatement preparedStatement = con.prepareStatement(query);\n preparedStatement.setInt(1, id);\n \n //Execute the prepared statement\n if(preparedStatement.execute()){\n ResultSet result = preparedStatement.getResultSet();\n \n result.next();\n \n int memberId = result.getInt(1);\n String name = result.getString(2);\n String email = result.getString(3);\n String phone = result.getString(4);\n String address = result.getString(5);\n String dob = result.getString(6);\n \n member = new Member(memberId, name, email, phone, address, dob);\n }\n \n con.close();\n } catch (SQLException e){\n System.out.println(e.getMessage());\n }\n \n return member;\n }", "@GetMapping(\"/{memberId}\")\n public ResponseEntity<Member> findMember(@PathVariable Long memberId) {\n Member foundMember = memberService.findMemberById(memberId);\n return ResponseEntity.ok(foundMember);\n }", "@Override\r\n\tpublic MemberRefGd getMemberRef(String id) {\r\n\t\t//\r\n\r\n\t\treturn this.memberRefDgMap.getValue(id);\r\n\r\n\t}", "@Override\n\tpublic Member findMemberId(long memberId) {\n\t\treturn null;\n\t}", "public String getMember_id() {\r\n return member_id;\r\n }", "public String getMember_id() {\r\n return member_id;\r\n }", "public FamilyMember fetchFamilyMember(String id) throws FamilyMemberNotFoundException {\n if (isFamilyMemberMapNullOrEmpty(familyMemberMap) || !familyMemberMap.containsKey(id)) {\n LOGGER.error(\"Exception Occurred\");\n throw new FamilyMemberNotFoundException(\"family member does not exist with the given id \" + id);\n }\n return familyMemberMap.get(id);\n\n }", "public String getMemberid() {\n\t\treturn memberid;\n\t}", "public void setMemberID(String memberID){ this.memberID=memberID; }", "Member selectByPrimaryKey(Long id);", "public String getMemberID() {\n return memberID;\n }", "public MallMember selectOne(String id) {\n\t\tMallMember member = null;\n\t\tlogger.info(\"idcheck 시작\");\n\t\tMemberMapper mapper = sqlsession.getMapper(MemberMapper.class);\n\t\t\n\t\ttry{\n\t\t\tmember = mapper.selectOne(id);\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tlogger.info(\"idcheck 종료\");\n\t\treturn member;\n\t}", "public Member searchMemberByMemberId(List<Member> members,Long memberId) throws WorkShopException {\n try {\n for (Member member : members) {\n if (member.getMemberId().equals(memberId)) {\n return member;\n }\n }\n } catch (Exception e) {\n throw new WorkShopException(e);\n }\n return null;\n }", "@Override\n\tpublic Member searchByID(String memberID) {\n\t\tConnection conn = null;\n\t\tMember member = new Member();\n\t\ttry {\n\t\t\tconn = DbcpConnectionPool.getConnection();\n\t\t\tCallableStatement cstmt = conn.prepareCall(\"{call Member_searchByID(?)}\");\n\t\t\tcstmt.setString(1, memberID);\n\t\t\tResultSet rs = cstmt.executeQuery();\n\t\t\twhile(rs.next()){\n\t\t\t\tmember.setMemberID(rs.getString(\"MemberID\"));\n\t\t\t\tmember.setMemberCard(rs.getString(\"MemberCard\"));\n\t\t\t\tmember.setTotalCost(rs.getDouble(\"TotalCost\"));\n\t\t\t\tString time = rs.getString(\"RegDate\");\n\t\t\t\ttry {\n\t\t\t\t\tmember.setRegDate((Date)(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").parseObject(time)));\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\trs.close();\n\t\t\tcstmt.close();\n\t\t\tconn.close();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (member.getMemberID()!= null){\n\t\t\treturn member;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n\tpublic MemberVO selectOne(String id) {\n\t\treturn dao.selectOne(id);\n\t}", "@Override\n\tpublic MemberBean findById(String id) {\n\t\treturn null;\n\t}", "public int getMember(){\n String memberString = member.getSelectedItem().toString();\n int memberId = this.memberMap.get(memberString);\n \n System.out.println(\"getMember2: \"+ memberString +\",\"+ memberId);\n return memberId;\n }", "@Override\n public MemberDTO findOne(@PathVariable(\"id\") Long id) {\n return MemberDTO.builder().build();\n }", "public boolean existsMember(final String id);", "public Member getMember(int index) {\n return members.get(index);\n }", "public com.jspgou.cms.entity.ShopMember getMember () {\r\n\t\treturn member;\r\n\t}", "@Override\n\tpublic MemberDTO getMember(MemberDTO mdto) {\n\t\treturn mdao.getMember(mdto);\n\t}", "public MemberInfoDTO read(String id) {\n\t\treturn sqlSessionTemplate.selectOne(\"memberInfo.read\", id);\r\n\t}", "public void setMember_id(String member_id) {\r\n this.member_id = member_id;\r\n }", "public void setMember_id(String member_id) {\r\n this.member_id = member_id;\r\n }", "public String getMemberId() {\n return memberId;\n }", "public String getMemberId() {\n return memberId;\n }", "public Integer getMemberId() {\n return memberId;\n }", "public Integer getMemberId() {\n return memberId;\n }", "List<S> memberOf(String memberUuid);", "@Override\r\n\tpublic Member loginMember(String memberId) throws Exception {\n\t\treturn memberDao.getMember(memberId);\r\n\t}", "public Member getMember()\n {\n return m_member;\n }", "public Optional<GroupMember> findOne(String id) {\n log.debug(\"Request to get GroupMember : {}\", id);\n return groupMemberRepository.findById(id);\n }", "@Test\n public void testGetId() {\n System.out.println(\"getId\");\n Member instance = member;\n \n String expResult = \"myId\";\n String result = instance.getId();\n \n assertEquals(expResult, result);\n }", "@Override\n\tpublic MemberBean findById(MemberBean member) {\n\t\treturn null;\n\t}", "public Member getMember() {\n\t\treturn member; ////changed 'MeMbEr' to 'member'\r\n\t}", "public static ArrayList<Member> findById(String id){\n setConnection();\n \n ArrayList<Member> members = new ArrayList<>();\n \n try{\n Statement statement = con.createStatement();\n \n //Query statement\n String query = \"SELECT * FROM member WHERE id LIKE ?\";\n\n //Create mysql prepared statement\n PreparedStatement preparedStatement = con.prepareStatement(query);\n preparedStatement.setString(1, \"%\"+id+\"%\");\n \n //Execute the prepared statement\n ResultSet result = preparedStatement.executeQuery();\n \n while(result.next()){\n int memberId = result.getInt(1);\n String name = result.getString(2);\n String email = result.getString(3);\n String phone = result.getString(4);\n String address = result.getString(5);\n String dob = result.getString(6);\n \n members.add(new Member(memberId, name, email, phone, address, dob));\n }\n\n con.close();\n } catch (SQLException e){\n System.out.println(e.getMessage());\n }\n \n return members;\n }", "public void setMemberid(String memberid) {\n\t\tthis.memberid = memberid;\n\t}", "public RoomMember getMember(Collection<RoomMember> members, String userID) {\n if (isAlive()) {\n for (RoomMember member : members) {\n if (TextUtils.equals(userID, member.getUserId())) {\n return member;\n }\n }\n } else {\n Log.e(LOG_TAG, \"getMember : the session is not anymore active\");\n }\n return null;\n }", "public void setMemberId(Integer memberId) {\n this.memberId = memberId;\n }", "public void setMemberId(Integer memberId) {\n this.memberId = memberId;\n }", "@GetMapping(path=\"{id}\")\n public @ResponseBody TeamMember getTeamMember(@PathVariable long id){\n return teamMemberRepository.getOne(id);\n }", "public Optional<Memberr> findById(int id) {\n\t\treturn memberrepo.findById(id);\n\t}", "@Override\r\n\tpublic Member getMemberByPin(String pinMember) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tQuery query = session.createQuery(\"FROM Member WHERE pinMember =:pinMember\");\r\n\t\tquery.setString(\"pinMember\", pinMember);\r\n\t\tList<Member> member = query.list();\r\n\t\tif(!member.isEmpty())\r\n\t\treturn member.get(0);\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}", "@RequestMapping(\"/member\")\n\tpublic Member get(\n\t\t\t@RequestParam(value=\"id\",defaultValue=\"0\") int id,//\n\t\t\t@RequestParam(value=\"firstName\",defaultValue=\"Matt\") String firstName\n\t\t\t) {\n\t\tMember member = new Member(id, firstName, \"Payne\");\n\t\treturn member;\n\t}", "@Nullable\n public Member findMember(String memberName) {\n if (memberName == null)\n return null;\n\n return members.stream().filter(m -> m.name.equals(memberName)).findFirst().orElse(null);\n }", "int getMemberId1();", "public Integer getMemberId() {\n\t\treturn memberId;\n\t}", "public static User findUserById(int id) {\n\n User user = null;\n User targetUser = new User();\n IdentityMap<User> userIdentityMap = IdentityMap.getInstance(targetUser);\n\n String findUserById = \"SELECT * FROM public.member \"\n + \"WHERE id = '\" + id + \"'\";\n\n PreparedStatement stmt = DBConnection.prepare(findUserById);\n\n try {\n ResultSet rs = stmt.executeQuery();\n while(rs.next()) {\n user = load(rs);\n }\n DBConnection.close(stmt);\n rs.close();\n\n } catch (SQLException e) {\n System.out.println(\"Exception!\");\n e.printStackTrace();\n }\n if(user != null) {\n targetUser = userIdentityMap.get(user.getId());\n if(targetUser == null) {\n userIdentityMap.put(user.getId(), user);\n return user;\n }\n else\n return targetUser;\n }\n return user;\n }", "public void removeMember(int id) {\t\r\n\t\tMember m = this.getMember(id);\r\n\t\tmembers.remove(m);\r\n\t\t\r\n\t}", "@Override\r\n\tpublic Member getMemberByName(String name) throws NotFoundException,\r\n\t\t\tExistException, MissingParameter, InvalidParameter {\n\t\treturn null;\r\n\t}", "ScPartyMember selectByPrimaryKey(Integer id);", "@Override\r\n\tpublic MemberVO getMemberId(String memberCode) {\n\t\treturn sqlSession.selectOne(namespace + \".getMemberId\", memberCode);\r\n\t}", "OrgMemberRecord selectByPrimaryKey(String id);", "@Override\n\tpublic List<GymMember> getMyMember(int tid) {\n\t\t@SuppressWarnings({ \"deprecation\", \"rawtypes\" })\n\t\tQuery query = factory.getCurrentSession().createSQLQuery(\"CALL getMember(:tid1)\").setParameter(\"tid1\",tid).addEntity(GymMember.class);\n\t\t@SuppressWarnings({ \"deprecation\", \"unchecked\" })\n\t\tList<GymMember> list = query.list();\n\t\treturn list;\n\t}", "String getMemberOf();", "int getMemberId2();", "public void setMemberId(Integer memberId) {\n\t\tthis.memberId = memberId;\n\t}", "private BonusMember findMember(int memberNo) {\n\t\tfor (BonusMember member : members) {\n\t\t\tif (member.getMemberNo() == memberNo)\n\t\t\t\treturn member;\n\t\t}\n\t\treturn null;\n\t}", "Member getWidenedMatchingMember(String memberPath);", "@Override\n\tpublic MemberVO selectMember(String userid) {\n\t\treturn (MemberVO) sqlSession.selectOne(\"com.coderdy.myapp.member.dao.mapper.MemberMapper.selectMember\", userid);\n\t}", "@Override\n\tpublic SnsMemberVO selectSnsMember(String sns_id) {\n\t\treturn (SnsMemberVO) sqlSession.selectOne(\"com.coderdy.myapp.member.dao.mapper.MemberMapper.selectSnsMember\",\n\t\t\t\tsns_id);\n\t}", "Optional<GroupMembers> findOne(Long id);", "@Override\n public com.ext.portlet.model.StaffMember getStaffMember(long id)\n throws com.liferay.portal.kernel.exception.PortalException,\n com.liferay.portal.kernel.exception.SystemException {\n return _staffMemberLocalService.getStaffMember(id);\n }", "public static Member getMockMember(int nMember)\n {\n Member member = mock(Member.class);\n\n when(member.getId()).thenReturn(nMember);\n when(member.getUid()).thenReturn(new UID(2130706433 /* 127.0.0.1 */, new Date().getTime(), nMember));\n\n return member;\n }", "public Integer getMemberInfoId() {\n return memberInfoId;\n }", "void memberAdded(final String id);", "public IMemberInfo get(String memberHandle) {\n\t\treturn get((IMember)JavaCore.create(memberHandle));\n\t}", "public void setMemberId(String string) {\n\t\t\n\t}", "public Integer getMemberId() {\n return (Integer) get(2);\n }", "public void setMemberId(String memberId) {\n this.memberId = memberId == null ? null : memberId.trim();\n }", "public void setMemberId(String memberId) {\n this.memberId = memberId == null ? null : memberId.trim();\n }", "public int getMemberId1() {\n return memberId1_;\n }", "public boolean deleteMember(final String id);", "public AccessUser getMember(EntityPlayer player)\n {\n if (player != null)\n {\n //try UUID first\n UUID id = player.getGameProfile().getId();\n if (uuid_to_profile.containsKey(id))\n {\n return uuid_to_profile.get(id);\n }\n\n //try username last\n return getMember(player.getCommandSenderName());\n }\n return null;\n }", "Member getWidenedMatchingMember(String[] memberPath);", "MemberTag selectByPrimaryKey(Long id);", "public int getMemberId1() {\n return memberId1_;\n }", "@Override\n\tpublic ArrayList<MemberVO> idFind(String name) {\n\t\treturn mapper.idFind(name);\n\t}", "public Member(String lastName, String firstName, String email, int phoneNo, int id) {\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.email = email;\r\n\t\tthis.phoneNo = phoneNo;\r\n\t\tthis.id = id;\r\n\t\t\r\n\t\tthis.loans = new HashMap<>();\r\n\t}", "@GetMapping(\"/memberships/{id}\")\n @Timed\n public ResponseEntity<MembershipDTO> getMembership(@PathVariable Long id) {\n log.debug(\"REST request to get Membership : {}\", id);\n Optional<MembershipDTO> membershipDTO = membershipService.findOne(id);\n return ResponseUtil.wrapOrNotFound(membershipDTO);\n }", "@Override\n public String toString() {\n return \"Member{\" +\n \"memberId='\" + memberId + '\\'' +\n \", name='\" + name + '\\'' +\n \", membershipDuration=\" + membershipDuration +\n \", noOfMembers=\" + noOfMember +\n '}';\n }", "public Object getMemberId() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic MemberRefGd getMemberRef(String id, boolean force) {\r\n\t\t//\r\n\r\n\t\treturn this.memberRefDgMap.getValue(id, force);\r\n\r\n\t}", "public Member getUserByID(int userID) throws ClassNotFoundException{\n //sql statement\n String SearchUser_SQL = \"SELECT * FROM member WHERE member_ID = ?\";\n\n //creating an member object\n Member member = new Member();\n\n try(\n //initialising the database connection\n Connection conn = DatabaseConnection.connectDB();\n PreparedStatement statement = conn.prepareStatement(SearchUser_SQL);)\n { \n statement.setInt(1, userID);\n\n //executing the query and getting data\n ResultSet userdetails = statement.executeQuery(); \n\n userdetails.next();\n member.setUserID(userdetails.getInt(\"member_ID\"));\n member.setUsername(userdetails.getString(\"username\"));\n member.setPhone(userdetails.getString(\"mobile\"));\n member.setDob(userdetails.getString(\"dob\"));\n member.setGender(userdetails.getString(\"gender\"));\n member.setEmail(userdetails.getString(\"email\"));\n member.setPassword(userdetails.getString(\"password\"));\n\n //converting image to displayable format\n Blob image = userdetails.getBlob(\"profilepic\");\n byte[] imagedata = null ; \n imagedata = image.getBytes(1,(int)image.length());\n String imagedataBase64 = new String(Base64.getEncoder().encode(imagedata));\n member.setProfilepic(imagedataBase64);\n \n //closing the database connection\n conn.close();\n\n } catch (SQLException | ClassNotFoundException e){\n e.printStackTrace();\n } \n \n return member;\n }", "List<Member> findByName(String name);", "@Override\n\tpublic MemberVO idCheck(String userid) {\n\t\treturn sqlSession.selectOne(\"com.coderdy.myapp.member.dao.mapper.MemberMapper.idCheck\", userid);\n\t}", "default Member getNormalMember(Long memberSn) {\n return new Member();\n }", "@RequestMapping(value=\"/mod/{id}\",method = RequestMethod.GET)\n\tpublic String mod(@PathVariable int id, Model model){\n\t\tOptional<Member> member = memberDao.findById(id);\n\t\tmodel.addAttribute(\"data\",member);\n\t\treturn \"member/mod\";\n\t}" ]
[ "0.85547537", "0.831835", "0.81274503", "0.8124938", "0.8100918", "0.80557644", "0.80209404", "0.7998033", "0.77666557", "0.76869243", "0.7458054", "0.74160814", "0.7413312", "0.7402806", "0.7367189", "0.73445326", "0.73445326", "0.7270471", "0.7235342", "0.72177815", "0.72126037", "0.72090065", "0.71968377", "0.7181488", "0.7173337", "0.7146156", "0.7065997", "0.7025714", "0.699684", "0.6952557", "0.6949658", "0.69496256", "0.6935941", "0.6893805", "0.689052", "0.689052", "0.6881193", "0.6881193", "0.68305504", "0.68305504", "0.68265224", "0.67927074", "0.6792042", "0.67396003", "0.6731506", "0.67096025", "0.66915363", "0.6659934", "0.6623661", "0.6605822", "0.6604431", "0.6604431", "0.65976274", "0.6590445", "0.65849245", "0.65725684", "0.65490746", "0.65370595", "0.6509524", "0.6495965", "0.64799094", "0.6477884", "0.6465095", "0.64613783", "0.64576226", "0.6457129", "0.6438169", "0.6418276", "0.64103526", "0.6359593", "0.6359287", "0.6354485", "0.6341423", "0.6337685", "0.63082534", "0.62878746", "0.62836236", "0.6271488", "0.62697285", "0.62206763", "0.62085724", "0.6207061", "0.6207061", "0.6203098", "0.61907464", "0.61857224", "0.6172177", "0.61487395", "0.60873204", "0.6068117", "0.6028229", "0.6024083", "0.60133487", "0.60089934", "0.6001186", "0.5999663", "0.598338", "0.5971304", "0.5964944", "0.59645814" ]
0.7864779
8
Adds a member to the club. Don't talk about us on fight club!
public Member addMember(String surName, String firstName, String secondName) { currentNumber++; Member m = new Member(surName, firstName, secondName, currentNumber); members.add(m); return m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void addMember(final PartyMember member);", "public void addMember()\r\n\t{\r\n\t\tlistOfMembers.add(new Member(\r\n\t\t\t\tgetUserString(\"Enter Member's First Name\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Surname\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Email\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Telephone\"),\r\n\t\t\t\tgetUserInt(\"Enter Member's Number\"),\r\n\t\t\t\tgetUserString(\"Enter Member's Type\")\r\n\t\t\t\t));\r\n\t\t\r\n\t}", "protected void addMember() {\n\t\tString mPhoneNumber = phoneEditView.getText().toString();\n\t\t\n\t\tApiProxy apiProxy = new ApiProxy(this);\n\t\tapiProxy.addMember(mPhoneNumber);\n\t\t\n\t\tgoToFriendListPage();\n\t}", "void memberAdded(final String id);", "@Override\n public void add(User member) {\n super.add(member);\n members.add(member);\n }", "protected void addMember(MondrianMember member) {\r\n aMembers.add(member);\r\n }", "public boolean addMember(final MemberPo po);", "public void addMember(Player player) {\n this.members.add(player.getUniqueId().toString());\n }", "@Put\n public void addMember(){\n try {\n controller.addMember(getQueryValue(\"id\"), getQueryValue(\"name\"));\n }catch(MenuException e){\n System.out.println(e.getMessage());\n }\n }", "@Override\n\tpublic boolean addMember(MemberDTO member) {\n\t\treturn false;\n\t}", "public void addMember(Member m) {\n\t\tmembers.add(m);\n\t}", "public void addMember (String name) {\r\n\t\tgetMemberList().add(name);\r\n\t\tsaveMemberList();\r\n\t}", "public void AddMember(final Member member) {\n members.put(member.email, member);\n }", "public void addMember(String uuid) {\n this.members.add(uuid);\n }", "public void addMember(Player player) {\n\t\tif (members.isEmpty()) {\n\t\t\tcacheParty(this); // Caches the party if it went from empty to not empty\n\t\t}\n\t\tmembers.add(player.getUniqueId());\n\t}", "public void addMember(Person person) {\n\t\tmembers.add(person);\n\t}", "private void addPlayer(long gameId, long memberId)\r\n\t{\r\n\t\tGame game = gameService.lookupGame(gameId);\r\n\t\tMember member = memberDao.findById(memberId);\r\n\t\tlogger.debug(\"addPlayer game=\"+game.getName()+ \" member=\"+ member.getId());\r\n\t\t\r\n\t\t// check if member already in game, if so do not add (throw error too?)\r\n\t\tfor (Player p : game.getPlayers()) {\r\n\t\t\tif (p.getMember().getId() == member.getId()) {\r\n\t\t\t\tlogger.error(\"Member is already a player\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tPlayer player = new Player();\r\n\t\tplayer.setGame(game);\r\n\t\tplayer.setMember(member);\r\n\t\tplayer.setOrder(findNextPlayerOrder(game));\r\n\t\tplayerDao.create(player);\r\n\t\t\r\n\r\n\t}", "public boolean addMember(Account cl)\n\t{\n\t\treturn members.add(cl);\n\t}", "public void addMember(IMember member);", "public String addMember()//value=\"addmember\", method=RequestMethod.)\n\t{\n\t\treturn \"addmember\";\n\t}", "private void sendAddMember(String groupName, Host leader, Host newMember) throws RemoteException, NotBoundException, MalformedURLException, UnknownHostException {\n NameServiceClient stub = (NameServiceClient) Naming.lookup(\"rmi://\" + leader + \"/\" + NameServiceClient.class.getSimpleName());\n stub.addMember(groupName, newMember);\n }", "public void add(\n final MemberType member)\n {\n ArgumentChecker.assertIsNotNull(\"member\", member);\n this.getMembers().add(member);\n }", "public boolean addMember(EntityPlayer player)\n {\n //TODO trigger super profile that a new member was added\n return player != null && addMember(new AccessUser(player));\n }", "@Override\r\n\tpublic void add() {\n\t\tif(alreadyAdded()) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Member is already added\");\r\n\t\t}else {\r\n\t\t\t\r\n\t\t\t\ttry(Connection connection= db.getConnection();) {\r\n\t \t\r\n\t\t\t\t\r\n\t\t\t\tString addString=\"INSERT INTO members VALUES(?,?,?,?)\";\r\n\t\t\t\tpreparedStatement=connection.prepareStatement(addString);\r\n\t\t\t\tpreparedStatement.setString(1, super.getIdString());\r\n\t\t\t\tpreparedStatement.setString(2, super.getNameString());\r\n\t\t\t\tpreparedStatement.setString(3, super.getSurnameString());\r\n\t\t\t\tpreparedStatement.setString(4, super.getEmailString());\r\n\t\t\t\t\r\n\t\t\t\tpreparedStatement.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Something went wrong\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n\t\t\r\n\t}", "public void add(Member member) {\n\t\t//member.setCreated(new Date());\r\n\t\tdao.add(member);\r\n\t}", "public void add(String name)\n/* 15: */ {\n/* 16:14 */ this.members.add(name);\n/* 17: */ }", "public void addMember(Character c) {\r\n\t\tguildArray.add(c);\r\n\t}", "public Team addMember(Contestant contestant) {\r\n\t\tif (members.size() == MAX_MEMBERS)\r\n\t\t\tthrow new UnsupportedOperationException(\"team is full!\");\r\n\t\tmembers.add(contestant);\r\n\t\treturn this;\r\n\t}", "public void addTeamMember(String teamMember)\r\n\t{\r\n\t\tteamMembers.add(teamMember);\r\n\t}", "@Override\n\tpublic void addMember(String login, String password, String profile)\n\t\t\tthrows BadEntryException, MemberAlreadyExistsException {\n\n\t}", "@Override\n\tpublic void addMember(User user, UserProfile profileTemplate)\n\t\t\tthrows Exception {\n\n\t}", "User addMember(String companyId, String name, String memberEmail, boolean isGroupLead)\n throws InvalidRequestException;", "void add(Member node, long now);", "@Nonnull\n ResourceMember addMember(@Nonnull final User member, @Nonnull final Telegraf telegraf);", "public boolean addMember(Member member) {\n\t\tfor (Iterator<Member> it = db.iterator(); it.hasNext(); ) {\n\t\t\tMember m = it.next();\n\t\t\tif (m.getPersonalNumber().contentEquals(member.getPersonalNumber())) {\n\t\t\t\tSystem.err.println(\"ERROR: ID: \" + m.getPersonalNumber() + \" is already an registered user\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.totalMembers++;\n\t\tmember.setId(this.totalMembers);\n\t\tdb.add(member);\n\t\tthis.saveDatabase();\n\t\treturn true;\n\t\t\n\t}", "ClassBody addMember(ClassMember member);", "@Nonnull\n ResourceMember addMember(@Nonnull final String memberID, @Nonnull final String telegrafID);", "User addMember(final User user, GroupAssociation groupAssociation);", "public void createMember(Memberr member) {\n\t\tmemberrepo.save(member);\n\t}", "public static void addThief() {\r\n playerTeam.clearDead();\r\n if (playerTeam.teamSize() >= 4) {\r\n updateMessage(\"Time cheio\");\r\n return;\r\n }\r\n\r\n Thief newMember = new Thief(getPersonName(), 0);\r\n playerTeam.addMember(newMember);\r\n\r\n updateMessage(\"Adiocionado Ladrao\" + newMember.getName());\r\n }", "private static void addMember() {\n\t\ttry {\r\n\t\t\tString lastName = input(\"Enter last name: \"); // variable name changes LN to lastName\r\n\t\t\tString firstName = input(\"Enter first name: \"); // variable name changes FN to firstName\r\n\t\t\tString email = input(\"Enter email: \"); // varible name changes EM to email\r\n\t\t\tint phoneNumber = Integer.valueOf(input(\"Enter phone number: \")).intValue(); // variable name changes PN to phoneNumber\r\n\t\t\tmember M = library.Add_mem( lastName, firstName, email, phoneNumber); // variable name changes LIB library , LN to lastName, FN to firstName,EM to email\r\n\t\t\toutput(\"\\n\" + M + \"\\n\");\r\n\t\t\t\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\t output(\"\\nInvalid phone number\\n\");\r\n\t\t}\r\n\t\t\r\n\t}", "private void addNewMember(Event x) {\r\n \r\n \r\n \r\n }", "public void addMember(Account account) {\n\t\tthis.members.add(account);\n\t}", "public GuildMemberAddHandler(DiscordApi api) {\n super(api, true, \"GUILD_MEMBER_ADD\");\n }", "public static void registerMember(int character_id, int team_id) {\n team_members.put(character_id, team_id);\n }", "public void addMember(Member m) {\r\n\t\tint index=isDuplicate(m);\r\n\t\tif((index==-1)&&(!m.getName().equals(\"000\"))) {ms.add(m);}\r\n\t\tif(index!=-1) {\r\n\t\t\tif(!m.getName().equals(\"000\")) {ms.get(index).setName(m.getName());}\r\n\t\t\tif(m.hasAddress()) {ms.get(index).setAddress(m.getAddress());ms.get(index).setHasAddress();}\r\n\t\t\tif(m.hasBirthday()) {ms.get(index).setBirthday(Member.updateBirthday(m.getBirthday()));ms.get(index).setHasBirthday();}\r\n\t\t\tif(m.hasPoints()) {ms.get(index).setPoints(m.getPoints());ms.get(index).setHasPoints();}\r\n\t\t\tif(m.hasMileage()) {ms.get(index).setMileage(m.getMileage());ms.get(index).setHasMileage();}\r\n\t\t\tif(m.hasTier()) {ms.get(index).setTier(m.getTier());ms.get(index).setHasTier();}\r\n\t\t}\r\n\t}", "public boolean addMember(AccessUser obj)\n {\n if (isValid(obj))\n {\n if (obj.getUserID() != null)\n {\n uuid_to_profile.put(obj.getUserID(), obj);\n }\n username_to_profile.put(obj.username.toLowerCase(), obj);\n obj.setGroup(this);\n return true;\n }\n return false;\n }", "@Override\n\tpublic void insertMember(MemberDTO mdto) {\n\t\tmdao.insertMember(mdto);\n\t}", "void addPerson(Player player);", "public static void add(MemberSession ms) {\n//\t\taddMemberSession(ms, GPortalExecutionContext.getRequest().getSessionContext().getId());\n\t\tadd(ms, GPortalExecutionContext.getRequest().getSessionContext().getId());\n\t}", "public void addMember(List<Member> members , Member member) throws WorkShopException {\n try {\n members.add(member);\n fileService.writeMembers(members);\n } catch (WorkShopException e) {\n throw e;\n } catch (Exception e) {\n throw new WorkShopException(e);\n }\n }", "void addParticipant(Participant participant);", "public synchronized void addGroupMember(String groupName, String member) {\n\t\t\tgroupList.get(groupName).addMember(member);\n\t\t}", "@Override\n public void onClick(View v) {\n\n String firstName = firstName_et.getText().toString();\n String lastName = lastName_et.getText().toString();\n String emailId = email_et.getText().toString();\n\n addMember(firstName, lastName, emailId);\n\n }", "private static boolean addMemberToGroupOrProject(String url, String memberId, int accessLevel) {\n HttpPost post = new HttpPost(url);\n Gson gson = new Gson();\n AddMember member = new AddMember(memberId, accessLevel);\n setPostJson(post, gson.toJson(member));\n try {\n HttpResponse response = sendAuthenticated(post);\n return response.getStatusLine().getStatusCode() == 201;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }", "@Transactional(readOnly = false)\n public void addToEveryone(Member member) {\n MemberGroup memberGroup = new MemberGroup();\n memberGroup.setStatus(Constants.STATUS_ACTIVE);\n memberGroup.setDateCreated(new Date());\n memberGroup.setGroupName(Group.EVERYONE.name());//default group\n memberGroup.setMember(member);\n saveMemberGroup(memberGroup);\n }", "@Override\r\n public String addMember(String room, String user, String value) {\r\n Objects.requireNonNull(room);\r\n Objects.requireNonNull(user);\r\n Objects.requireNonNull(value);\r\n Map<String, String> roomMembers = this.members.get(room);\r\n if(roomMembers == null) {\r\n roomMembers = new ConcurrentHashMap<>();\r\n this.members.put(room, roomMembers);\r\n }\r\n final String previous = roomMembers.put(user, value);\r\n LOG.debug(\"After adding. Member: {}, value: {}, room: {}, room members: {}\", \r\n user, value, room, roomMembers);\r\n return previous;\r\n }", "private void addMember(String firstName, String lastName, String emailId) {\n Log.e(\"AddMember\", \"Fn \" + firstName + \", Ln \" + lastName + \"eid \" + emailId);\n\n\n// myRef.setValue(\"Hello, World!\");\n String key = myRef.push().getKey();\n Log.e(\"AddMember\", \"key \" + key);\n\n CoreMember member = new CoreMember(firstName, lastName, emailId);\n myRef.child(key).setValue(member, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {\n if (databaseError != null) {\n System.out.println(\"Data could not be saved \" + databaseError.getMessage());\n } else {\n System.out.println(\"Data saved successfully.\" + databaseReference.toString());\n memberKey = databaseReference.getKey();\n hideInputForm(true);\n\n }\n }\n });\n }", "public void addBoatToMember(Member m, String type, String length, String name) {\n\t\tif(m != null) {\n\t\t\tm.addBoat(type, length, name);\n\t\t\tthis.saveDatabase();\n\t\t} else {\n\t\t\tSystem.err.println(\"ERROR: No member with that id...\");\n\t\t}\n\t\tthis.saveDatabase();\n\t}", "@Override\n\tpublic void add(Memberlogin login) {\n\t\tiMemberLogin.add(login);\n\t}", "public void addHero(Hero h) {\r\n if (team.size() < MAX_MEMBER_IN_A_TEAM) {\r\n team.add(h);\r\n }\r\n }", "@Test\n public void testAddMine() throws Exception {\n Mine.addMine(9, 9);\n assertEquals(\"success\", Mine.addMine(9, 9));\n\n }", "@Override\n\tpublic void gotMember(Member member) {\n\t\tDebug.log(\"netbeansgui.GroupPanel\",Debug.DEBUG,\"Tab for \" + groupName + \" got member \" + member);\n\t\t((DefaultListModel)nodeList.getModel()).addElement(member);\n\t\t//nodeList.repaint();\n\t\tappend(String.format(\">>> %s joined group (%s)\",member.getName(),member.getID()));\n\t}", "@Override\r\n\tpublic void insertMember(Member member) throws Exception {\n\t\tmemberDao.insertMember(member);\r\n\t}", "@Deprecated\n public void addMember(int pos, Member m) {\n members.add(pos, m);\n }", "void addPlayer(Player newPlayer);", "public static boolean addMemberToProject(String projectId, String memberId,\n MemberAccessLevel accessLevel) {\n String url = BASE_URL + \"projects/\" + projectId + \"/members\";\n return addMemberToGroupOrProject(url, memberId, accessLevel.getId());\n }", "public void addParticipant(String uid) {\n\r\n if (!participants.contains(uid))\r\n participants.add(uid);\r\n }", "private void addFriend() {\n \tif (!friend.getText().equals(\"\")) {\n\t\t\tif (currentProfile != null) {\n\t\t\t\tif (!database.containsProfile(friend.getText())) {\n\t\t\t\t\tcanvas.showMessage(friend.getText() + \" profile does not exists\");\n\t\t\t\t} else if (isfriendsBefore()) {\n\t\t\t\t\tcanvas.showMessage(friend.getText() + \" is already a friend\");\n\t\t\t\t} else {\n\t\t\t\t\tmakeTheTwoFriends();\n\t\t\t\t\tcanvas.displayProfile(currentProfile);\n\t\t\t\t\tcanvas.showMessage(friend.getText() + \" added as friend\");\n\t\t\t\t}\n\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcanvas.showMessage(\"Select a profile to add friends\");\n\t\t\t}\n\t\t}\n\t}", "public void addCrew(CrewMember crew) {\n\t\tcrewList.add(crew);\n\t}", "@SuppressWarnings(\"serial\")\n\tpublic Member addMember(final String name,final String group,Boolean force_unique) throws Exception{\n\t\tif(force_unique)\n\t\t\tdelAllMember(name);\n\t\tGroup grp=addGroup(group);\t\t\n\t\treturn Member.findOrCreate(grp,new HashMap<String, String>(){{\n\t\t\tput(\"username\",name);\n\t\t}});\t\t\t\t\n\t}", "public void addNewFriend(View v) {\n final EditText editText = (EditText) findViewById(R.id.editText);\n String friendUsername = editText.getText().toString();\n //System.out.println(\"Add friend: \" + friendUsername);\n UserProfileManager.getInstance().addFriend(friendUsername);\n }", "@Override\n\tpublic void onUserListMemberAddition(User addedMember, User listOwner, UserList list) {\n\n\t}", "@Override\n\tpublic boolean registerMember(Member member) {\n\t\tSession session = null;\n\n\t\ttry {\n\t\t\tsession = sessionFactory.getCurrentSession();\n\t\t\tsession.save(member);\n\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlogger.info(\"Generating MemberID \" + member.getMemberId());\n\t\treturn true;\n\t}", "@Override\r\n\tpublic int insertMember(Member m) {\n\t\treturn mDAO.insertMember(sqlSession, m);\r\n\t}", "void create(Member member);", "public void addPerson(Person thePerson) {\r\n staff.add(thePerson);\r\n }", "protected void addMemberAction(Action a) {\r\n\t\tif (this.memberActions == null)\r\n\t\t\tthis.memberActions = new Vector<Action>(4);\r\n\t\tthis.memberActions.addElement(a);\r\n\t}", "public void addTeamMember(final Artifact artifact);", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n registerNewMember(request, response);\n }", "void addMember(Item item) throws AccessManagementException;", "@Override\n public void insertEntry(Entry entry) {\n members.add(entry);\n\n }", "void update(Member member);", "boolean addCharacterToGuild(long characterId, long guildId);", "void add(Actor actor);", "@Deprecated\n public boolean addMember(String name)\n {\n return getMember(name) == null && addMember(new AccessUser(name));\n }", "public void addActor(CastMember actor)\n\t{\n\t\tpeopleAct.add(actor);\n\t}", "@Override\n\tpublic int signup(MemberVO member) {\n\t\treturn mapper.signup(member);\n\t}", "public void addUser() {\n\t\tthis.users++;\n\t}", "public static void add() {\n Application.currentUserCan( 1 );\n render();\n }", "@Override\n public void addPlayer(Player player) {\n\n if(steadyPlayers.size()>0){\n PlayersMeetNotification.firePropertyChange(new PropertyChangeEvent(this, \"More than one Player in this Panel\",steadyPlayers,player));\n }\n steadyPlayers.add(player);\n\n }", "public int insertMember(MemberVO vo) throws Exception {\n\t\t return signupMapper.insertMember(vo);\n }", "public void addMember(Member member) {\r\n\t\tmember.setParentTypeDeclaration(this);\r\n\t\tmemberList.add(member);\r\n\t}", "public void addUser(ArrayList<Player> list,String U,String F,String G) {\r\n\t\tboolean flag = true;\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile (aa.hasNext()) {\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tif(in.getUserName().equals(U)){\r\n\t\t\t\tSystem.out.println(\"The player already exists.\");\r\n\t\t\t\tflag =false;\r\n\t\t\t\treturn;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\tif(flag)\r\n\t\t\tlist.add(new NimPlayer(U,F,G,0,0,\"Human\"));\r\n\t\tSystem.out.println(\"\");\r\n\t}", "@PUT\n @Path(\"/addMembers/{group}/user/{userName}\")\n public Response addMember(@PathParam(\"group\") String groupName, @PathParam(\"userName\") String userName) {\n try {\n GroupMessage groupMessage = accountService.getGroupByName(groupName);\n User admin = groupMessage.getAdmin();\n User user = userService.getUserByUsername(userName);\n accountService.addMemberToGroup(groupMessage, user, admin);\n return Response.ok().build();\n } catch (Exception e) {\n return Response.serverError().build();\n }\n\n }", "public static boolean addMemberToGroup(String groupId, String memberId,\n MemberAccessLevel accessLevel) {\n String url = BASE_URL + \"groups/\" + groupId + \"/members\";\n return addMemberToGroupOrProject(url, memberId, accessLevel.getId());\n }", "public void setMemberID(String memberID){ this.memberID=memberID; }", "void addMyTeam(Team team) throws HasTeamAlreadyException;", "@Override\n\tpublic void addPerson(User pUser) {\n\t\t\n\t}", "void addUser(User user);" ]
[ "0.78293324", "0.7736445", "0.75610715", "0.7389854", "0.73637164", "0.73143995", "0.7298666", "0.7276486", "0.7234268", "0.715552", "0.71164805", "0.7115829", "0.7075235", "0.70200163", "0.700464", "0.6998946", "0.699826", "0.6981281", "0.68820065", "0.6879625", "0.68366575", "0.6817176", "0.6798452", "0.6796882", "0.6779253", "0.67585146", "0.6704841", "0.6686376", "0.6674097", "0.6657828", "0.6626711", "0.6595399", "0.65946704", "0.65816236", "0.6571393", "0.65545577", "0.6542837", "0.6513463", "0.6467874", "0.64520955", "0.6445614", "0.6439322", "0.643891", "0.63597685", "0.6352826", "0.6325545", "0.6304325", "0.6273358", "0.62596375", "0.62558955", "0.623197", "0.6229451", "0.62109286", "0.6202493", "0.61927176", "0.6189868", "0.61803263", "0.6113138", "0.6109199", "0.61045384", "0.6087632", "0.6059144", "0.604603", "0.60274863", "0.60114664", "0.6003328", "0.59947276", "0.59888035", "0.59650457", "0.59648216", "0.5960096", "0.5958506", "0.59360015", "0.5927746", "0.5912014", "0.591064", "0.58907187", "0.5874235", "0.5870203", "0.5869848", "0.58467525", "0.58450013", "0.58430976", "0.58414674", "0.58292353", "0.581567", "0.581408", "0.5812707", "0.58115405", "0.5794612", "0.57857966", "0.5779998", "0.5778142", "0.577044", "0.5756619", "0.5751078", "0.5736492", "0.5733248", "0.5730424", "0.5722204" ]
0.5896404
76
Prints out all the members and their id
public void showMembers() { for(Member m: members) { m.show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printMembers() {\n\t\tthis.getListUsers().printList();\n\t}", "public String memberList() {\n\treturn roomMembers.stream().map(id -> {\n\t try {\n\t\treturn api.getUserById(id).get().getNicknameMentionTag();\n\t } catch (InterruptedException | ExecutionException e) {\n\t\te.printStackTrace();\n\t }\n\t return \"\";\n\t}).collect(Collectors.joining(\"\\n\"));\n }", "@Override\n public String toString() {\n return \"Member{\" +\n \"memberId='\" + memberId + '\\'' +\n \", name='\" + name + '\\'' +\n \", membershipDuration=\" + membershipDuration +\n \", noOfMembers=\" + noOfMember +\n '}';\n }", "@Get\n public String getMembers(){\n ArrayList<String> members = new ArrayList<>();\n try {\n members.addAll(controller.getMembers(getQueryValue(\"id\")));\n }catch(MenuException e){\n System.out.println(e.getMessage());\n }\n return new YaGson().toJson(members, ArrayList.class);\n }", "public String displayFamilyMembers() {\n int i = 1;\n StringBuilder ret = new StringBuilder();\n for (FamilyMember fam : this.famMemberList) {\n ret.append(i + \".\" + \" \" + fam.getSkinColour() + \" -> \" + fam.getActionValue());\n ret.append(\" | \");\n i++;\n }\n return ret.toString();\n }", "@Override\n public String toString() {\n return \"ID: \" + userID + \" Name: \" + name;\n }", "public String getMember_id() {\r\n return member_id;\r\n }", "public String getMember_id() {\r\n return member_id;\r\n }", "void display() {\n System.out.println(id + \" \" + name);\n }", "public String getMembers() {\r\n \t\tString members = _creator;\r\n \t\tfor (String member : _otherMembersList) {\r\n \t\t\tmembers.concat(\", \" + member);\r\n \t\t}\r\n \t\treturn members;\r\n \t}", "private static void getMember() {\n\t\toutput(\"\");\r\n\t\tfor (member member : library.getMember()) {// variable name LIB to library and MEMBER to getMember()\r\n\t\t\toutput(member + \"\\n\");\r\n\t\t}\t\t\r\n\t}", "public String getMemberid() {\n\t\treturn memberid;\n\t}", "public void showInfo() {\n\t\tfor (String key : list.keySet()) {\n\t\t\tSystem.out.println(\"\\tID: \" + key + list.get(key).toString());\n\t\t}\n\t}", "public String getMemberID() {\n return memberID;\n }", "void display() {\r\n\t\tSystem.out.println(id + \" \" + name);\r\n\t}", "public String serializeMembers() {\n String retString = \"\";\n\n for (String str : this.members) {\n retString += str + \",\";\n }\n\n return retString.substring(0, Math.max(retString.length() - 1, 0)); // Remove the last comma\n }", "public Stream<Long> members() {\n\treturn roomMembers.stream();\n }", "public List<String> getMembersVerboseList(List<Member> members) throws WorkShopException {\n List<String> verboseList = new ArrayList<String>();\n try {\n for (Member member : members) {\n String verboseInfo = \"member name : \" + member.getName() + \", personal number: \" + member.getPersonalNumber() + \", member id: \" + member.getMemberId() + \", boats info: \\n\";\n Iterator<Boat> boatIterator = member.getBoats();\n while ( boatIterator.hasNext()) {\n Boat boat = boatIterator.next();\n verboseInfo += \"boat id: \" + boat.getId() + \", boat size: \" + boat.getSize() + \", boat type: \" + boat.getType() + \"\\n\";\n }\n verboseList.add(verboseInfo);\n }\n } catch (Exception e) {\n throw new WorkShopException(e);\n }\n return verboseList;\n }", "void display() {\n System.out.println(id + \" \" + name + \" \" + age);\n }", "public void showInfo(Member member) {\n\n if (member != null) {\n System.out.println(member.getInfo());\n } else {\n System.out.println(\"Felaktigt medlemsnummer\");\n }\n }", "public ArrayList<Integer> getMemberIDs() {\n return memberIDs;\n }", "public GetMembers(String fn,String ln){\r\n\t\tfname = fn;\r\n\t\tlname = ln;\r\n\t\tmembers ++;\r\n\t\t\r\n\t\tSystem.out.printf(\"Constructor for %s %s, Members in the club %d.\\n\", fname,lname,members);\r\n\t}", "public void printList(){\n\t\tfor(User u : userList){\r\n\t\t\tSystem.out.println(\"Username: \" + u.getUsername() + \" | User ID: \" + u.getUserID() + \" | Hashcode: \" + u.getHashcode() + \" | Salt: \" + u.getSalt());\r\n\t\t}\r\n\t}", "public void show() {\r\n\t\tSystem.out.println(\"Id \\t Name \\t Address\");\r\n\t\t\r\n\t\tfor (int index = 0; index < emp.size(); index++) {\r\n\t\t\tSystem.out.println(emp.get(index).empId + \"\\t\" + emp.get(index).name +\"\\t\" + emp.get(index).adress);\r\n\t\t}\r\n\t}", "public static void index (Long id) {\n Member member = Member.findById(id);\n List<Assessment> assessmentlist = member.assessmentlist;\n Collections.sort(assessmentlist);\n Logger.info(\"Member id = \" + id);\n render(\"member.html\" , member, assessmentlist);\n }", "public int getMembers() {\n\t\treturn members;\n\t}", "public String getAllCommitteeMembers(){\r\n\t\tString allCommitteeMembers = \"\";\r\n\t\tfor(int index = 0; index < committeeMembers.size(); ++index){\r\n\t\t\tallCommitteeMembers += committeeMembers.get(index).returnNameInString() + \"\\n\\t\";\r\n\t\t}\r\n\t\treturn allCommitteeMembers;\r\n\t}", "public void show() {\n\t\tSystem.out.println(getId());\n\t}", "public void mem_list() {\n synchronized(chat_room) {\n Set id_set = cur_chat_room.keySet();\n Iterator iter = id_set.iterator();\n clearScreen(client_PW);\n client_PW.println(\"------------online member-----------\");\n while(iter.hasNext()) {\n String mem_id = (String)iter.next();\n if(mem_id != client_ID) {\n client_PW.println(mem_id);\n }\n }\n client_PW.flush();\n }\n }", "public void printModuleStudentInfo() {\t\r\n\tfor(int i =0; i<(StudentList.size()); i++) {\r\n\t\tStudent temp =StudentList.get(i);\r\n\t\tSystem.out.println(temp.getUserName());\r\n\t}\t\r\n}", "public static int getMembers() {\n\t\treturn members; \n\t}", "public static void printMemberTable() throws MemberException {\n\n Connection conn = null;\n PreparedStatement stmt = null;\n ResultSet rs = null;\n try {\n conn = DBConfiguration.getConnection();\n stmt = conn.prepareStatement(\n Configuration.SQL_06,\n ResultSet.TYPE_FORWARD_ONLY,\n ResultSet.CONCUR_READ_ONLY);\n rs = stmt.executeQuery();\n String current_account = null;\n while ( rs.next() ) {\n current_account = printRow(current_account,System.out,rs);\n }\n System.out.println();\n }\n catch(SQLException x) {\n String msg = \"SQLException: \" + x.getMessage();\n throw new MemberException( msg );\n }\n finally {\n DBConfiguration.closeSQLResultSet( rs );\n DBConfiguration.closeSQLStatement( stmt );\n DBConfiguration.closeSQLConnection( conn );\n }\n conn = null;\n stmt = null;\n rs = null;\n\n return;\n }", "public String getMemberId() {\n return memberId;\n }", "public String getMemberId() {\n return memberId;\n }", "public static void main( String[] args )\r\n {\n \tMember member;\r\n \tList<Member> members = new ArrayList<Member>();\r\n \tmember = new Member(\"홍길동\",\"대구\",13);\r\n \tmembers.add(member); //리스트에 한명의 데이터를 담겠다\r\n \tmember = new Member(\"강동원\",\"대구\",20);\r\n \tmembers.add(member);\r\n \tmember = new Member(\"신세경\",\"대구\",30);\r\n \tmembers.add(member);\r\n \t\r\n \tfor(Member m : members) {\r\n \t\tm.toString();\r\n \t}\r\n \t\r\n }", "@Override\n\tpublic String toString() {\n\t\treturn Name;// + \"||\" + ID;// + \"-\" + ID;\n\t}", "public void setMemberID(String memberID){ this.memberID=memberID; }", "void display()\n\t {\n\t\t System.out.println(\"Student ID: \"+id);\n\t\t System.out.println(\"Student Name: \"+name);\n\t\t System.out.println();\n\t }", "@Override\n\tpublic void output() {\n\t\tfor(User u :list) {\n\t\t\tif(list.size() > MIN_USER) {\n\t\t\t\tSystem.out.println(\"이름 : \"+u.getName());\n\t\t\t\tSystem.out.println(\"나이 : \"+u.getAge());\n\t\t\t\tSystem.out.println(\"주소 : \"+u.getAddr());\n\t\t\t\tSystem.out.println(\"=======================\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"입력된 정보가 없습니다.\");\n\t\t}", "public void showMemberBookings()\n {\n try\n {\n System.out.println(\"Please enter the memeber ID\");\n int memberId =sc.nextInt();\n Member mem = sportsClub.searchMember(memberId); \n \n if(mem==null || mem.getBookings()==null)\n {\n System.out.println(\"Sorry! Member is not found.\");\n }\n else\n {\n for(Booking bookingObj : mem.getBookings())\n {\n System.out.println(\"Booking made by \"+mem.getMemberName() +\" for \" + bookingObj.getBookingDate() + \" at \" + bookingObj.getBookingTime() + \" for \" + bookingObj.getBookingEndTime() + \" minutes on Court number \" + bookingObj.getCourt().getCourtId());\n\n }\n if(mem.getBookings().size()==0)\n System.out.println(\"Sorry! Currebtly no bookings done by the member \");\n }\n }\n catch(Exception e)\n {\n System.out.println(\"Error\"+e);\n }\n\n }", "public void info() {\r\n System.out.println(\" Name: \" + name + \" Facility: \" + facility + \" Floor: \" + floor + \" Covid: \"\r\n + positive + \" Age: \" + age + \" ID: \" + id);\r\n }", "public void printStudentList()\n {\n for(int i = 0; i < students.size(); i++)\n System.out.println( (i + 1) + \". \" + students.get(i).getName());\n }", "@Override\n\tpublic String toString() {\n\t\treturn id + \" \" + name + \" \" + surname;\n\t}", "private static void showStudentDB () {\n for (Student s : studentDB) {\n System.out.println(\"ID: \" + s.getID() + \"\\n\" + \"Student: \" + s.getName());\n }\n }", "public static void printFriends() {\n\r\n\t\tfor (Friend friend : friendMap.values()) {\r\n\t\t\tSystem.out.println(friend);\r\n\t\t}\r\n\r\n\t}", "public int count () {\n return member_id_list.length;\r\n }", "public String toString() { \r\n return \"\\n\\tId: \" + id + name;\r\n }", "void printNodesWithEdges()\n {\n for ( int i = 0; i < this.numNodes; i++ )\n {\n Node currNode = this.nodeList.get(i);\n System.out.println(\"Node id: \" + currNode.id );\n \n int numEdges = currNode.connectedNodes.size();\n for ( int j = 0; j < numEdges; j++ )\n {\n Node currEdge = currNode.connectedNodes.get(j);\n System.out.print(currEdge.id + \",\");\n }\n\n System.out.println();\n } \n\n \n }", "public void print() {\r\n System.out.print( getPlayer1Id() + \", \" );\r\n System.out.print( getPlayer2Id() + \", \");\r\n System.out.print(getDateYear() + \"-\" + getDateMonth() + \"-\" + getDateDay() + \", \");\r\n System.out.print( getTournament() + \", \");\r\n System.out.print(score + \", \");\r\n System.out.print(\"Winner: \" + winner);\r\n System.out.println();\r\n }", "@Override\n\tpublic synchronized String toString() {\n\t\treturn this.id + \" : \" + this.name;\n\t}", "public static void print_all() {\n for (int i = 0; i < roster.size(); i++)\n System.out.println(roster.get(i).print());\n\n System.out.println();\n }", "@Override\n public String toString() {\n \t\n \t//call method is empty to check if there is a first node\n if (isEmpty()) {\n return nameList + \" is empty\";\n }\n \n //here StringBuilder is used to make sentence: \"The (name of list) id\"\n StringBuilder buffer = new StringBuilder();\n buffer.append(\"The \").append(nameList).append(\" contains:\\n\");\n \n //create current node and assign it to first node\n Node<T> current = firstNode;\n \n \n //while current node has next node, retrieve data from current node and append a \",\" to make it readeble\n while (current != null) {\n buffer.append(current.getData()).append(\"\");\n current = current.getNext();\n }\n return buffer.toString();\n }", "public List<DN> getMembers() {\n\t\treturn members;\n\t}", "public void printUsers() {\n userAnya.printInfo();\n userRoma.printInfo();\n }", "public List<String> getMembers() {\n return this.members;\n }", "public String toString() {\n return String.format(\"%4d: %s\", id, name);\n }", "public void print() {\r\n\t\tif(isEmpty()) {\r\n\t\t\tSystem.out.printf(\"%s is Empty%n\", name);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.printf(\"%s: %n\", name);\r\n\t\tNode<E> current = first;//node to traverse the list\r\n\t\t\r\n\t\twhile(current != null) {\r\n\t\t\tSystem.out.printf(\"%d \", current.data);\r\n\t\t\tcurrent = current.next;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public List<User> getMembers() {\n return members;\n }", "public void printInfo(){\n\t\tSystem.out.println(\"id : \" + id + \" label : \" + label);\n\t\tSystem.out.println(\"vms : \" );\n\t\tfor(VirtualMachine v : vms){\n\t\t\tv.printInfo();\n\t\t}\n\t}", "@Override\r\n public String toString() {\r\n return \"(\" + idn + \",\" + this.n + \")\"; //il y avait un rpobleme avec id -> me disait que acces privé dans noeud\r\n }", "@Override\n\tpublic String toString() {\n\t\treturn id+\",\"+name+\",\"+age;\n\t}", "public String toString() {\n\t\treturn \"player \" + player.id + \"\\n\";\n\t}", "public static void printMemberTable() throws MemberException {\n\n Connection conn = null;\n PreparedStatement stmt = null;\n ResultSet rs = null;\n try {\n conn = DBConfiguration.getConnection();\n stmt = conn.prepareStatement(\n Configuration.SQL_01,\n ResultSet.TYPE_FORWARD_ONLY,\n ResultSet.CONCUR_READ_ONLY);\n rs = stmt.executeQuery();\n while ( rs.next() ) {\n printRow(System.out,rs);\n }\n }\n catch(SQLException x) {\n String msg = \"SQLException: \" + x.getMessage();\n throw new MemberException( msg );\n }\n finally {\n DBConfiguration.closeSQLResultSet( rs );\n DBConfiguration.closeSQLStatement( stmt );\n DBConfiguration.closeSQLConnection( conn );\n }\n conn = null;\n stmt = null;\n rs = null;\n\n return;\n }", "public String toString()\r\n\t\t{\r\n\t\t\treturn firstName + \"#\" + familyName + \"#\" + ID + \"#\";\r\n\t\t}", "public void display()\n {\n System.out.println(name);\n System.out.println(status);\n if (friendslist.size ==0){\n System.out.println(\"User has no friends :(\");\n for(String i: friendslist.size){\n System.out.println(friendslist.get(i));\n }\n }\n }", "@Override\r\n\tpublic List<MemberDTO> list() {\n\t\treturn session.selectList(NAMESPACE+\".list\");\r\n\t}", "public void printUserInfo(){\n System.out.print(\"Username: \"+ getName() + \"\\n\" + \"Birthday: \"+getBirthday()+ \"\\n\"+ \"Hometown: \"+getHome()+ \"\\n\"+ \"About: \" +getAbout()+ \" \\n\"+ \"Subscribers: \" + getSubscriptions());\n\t}", "public void showFriends(){\n\t /*condition to check if friend list is empty*/ \n\t if(friend.isEmpty()){\n\t System.out.println(\"Sorry !! You Don't have any friend in your Friend list\\n\");\n\t }\n\t /*printing friend list*/\n\t else{\n\t System.out.println(\"\\nYour Friend List ---\");\n\t int p=0;\n\t for(Map.Entry<String,String>entry:friend.entrySet()){\n\t \n\t System.out.println(++p+\" \"+entry.getKey());\n\t \n\t }\n\t }\n\t }", "private void printAllOwners(ArrayList<String> ownerList){\n for(int i = 0; i < ownerList.size(); i++){\n System.out.println(ownerList.get(i));\n }\n }", "@Override\n public String toString() {\n return id.toString();\n }", "@Override\r\n\tpublic List<Member> getAllMember() {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tList<Member> list = session.createCriteria(Member.class).list();\r\n\t\treturn list;\r\n\t}", "public void setMember_id(String member_id) {\r\n this.member_id = member_id;\r\n }", "public void setMember_id(String member_id) {\r\n this.member_id = member_id;\r\n }", "public ArrayList<Member> getAllMembers() {\n return memberDAO.getAllMembers();\n }", "public String toString() {\n return \"ID:\" + ID + \" \" + \"LastName:\" + LName + \" \" + \"FirstName:\" + FName + \" \";\n }", "private void ViewAccounts() {\n for (int k = 0; k < accountList.size(); k++) {\n\n System.out.print(k + \": \" + accountList.get(k) + \" || \");\n\n }\n }", "public MemberPo findMember(final String id);", "@Override\n\tpublic String toString() {\n\t\treturn id;\n\t}", "public void viewList() {\n\t\tSystem.out.println(\"Your have \" + contacts.size() + \" contacts:\");\n\t\tfor (int i=0; i<contacts.size(); i++) {\n\t\t\tSystem.out.println((i+1) + \". \" \n\t\t\t\t\t+ contacts.get(i).getName() + \" number: \" \n\t\t\t\t\t+ contacts.get(i).getPhoneNum());\n\t\t}\n\t}", "public String toString () {\n\t\treturn \"User, name = \" + this.getName() + \" id = \" + this.getId();\n \t}", "@Override\n public String toString() {\n return id.toString();\n }", "public int getMemberId1() {\n return memberId1_;\n }", "@Override\n public String toString() {\n return id;\n }", "public List<Member> members() {\n return list;\n }", "public static void main(String[] args) {\n\n\t\tArrayList<MemberVO> members = new ArrayList<MemberVO>();\n\n\t\t// 회원이름을 추가\n\t\tmembers.add(new MemberVO(\"홍길동\", \"111\"));\n\t\tmembers.add(new MemberVO(\"이몽룡\", \"112\"));\n\t\tmembers.add(new MemberVO(\"성춘향\",\"113\"));\n\t\tmembers.add(new MemberVO(\"장보고\",\"114\"));\n\t\tmembers.add(new MemberVO(\"장영실\",\"115\"));\n\t\tmembers.add(new MemberVO(\"임꺽정\",\"116\"));\n\t\tmembers.add(new MemberVO(\"정도전\",\"117\"));\n\t\tmembers.add(new MemberVO(\"장보고\",\"118\"));\n\t\tmembers.add(new MemberVO(\"장영실\",\"119\"));\n\t\tmembers.add(new MemberVO(\"임꺽정\",\"120\"));\n\t\tmembers.add(new MemberVO(\"정도전\",\"121\"));\n\t\t\n\t\tMemberVO vo = new MemberVO(\"장보고\",\"122\");\n\t\tmembers.add(vo);\n\t\tvo = new MemberVO(\"장영실\",\"123\");\n\t\tmembers.add(vo);\n\t\tvo = new MemberVO(\"임꺽정\",\"124\");\n\t\tmembers.add(vo);\n\t\t\n\t\tCollections.shuffle(members);\n\t\tfor(int i = 0 ; i < 3 ; i ++) {\n\t\t\tSystem.out.println((i+1)+\"번째 당첨자 : \"+members.get(i) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// = members.get(i).toString()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// memgers.get(i)는 members에 포함된\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 어떤 VO가 추출된다.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 객체를 println()으로 콘솔에 출력하도록 하면\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 자동으로 객체.toString() 메서드를 호출한다.\n\t\t\t\n\t\t}\n\t}", "@Override public String toString() {\r\n\t\tif(getID()<0) return new String(String.format(\"%s\", getName()));\r\n\t\treturn new String(String.format(\"%02d - %s\", getID() , getName()));\r\n\t}", "public void printAllUsers() {\n\t\tfor (User u : getUserSet()) {\n\t\t\tSystem.out.println(u);\n\t\t}\n\t}", "@Override\r\n\tpublic List<MemberVo> listAll() throws SQLException {\n\t\treturn client.selectList(\"member.listAll\");\r\n\t}", "List<S> memberOf(String memberUuid);", "@Override\r\n\tpublic List<MemberDto> list() {\n\t\treturn jdbcTemplate.query(\"select * from s_member\", mapper);\r\n\t}", "void printUsers() {\n if (server.hasUsers()) {\n writer.println(\"Connected users: \" + server.getUserNames());\n } else {\n writer.println(\"No other users connected\");\n }\n }", "public Integer getMemberId() {\n return memberId;\n }", "public Integer getMemberId() {\n return memberId;\n }", "@Override\n\tpublic List<Member> getAllMember() {\n\t\tSession session =sessionFactory.getCurrentSession();\n\t\tString hql = \"from Member\";\n\t\tList<Member> listMember = session.createQuery(hql).list();\n\t\t\n\t\tif(listMember.isEmpty()) {\n\t\t\t\treturn new ArrayList<>();\n\t\t}\n\t\t\n\t\treturn listMember;\n\t}", "public void print(){\n\t\tif(isEmpty()){\n\t\t\tSystem.out.printf(\"Empty %s\\n\", name);\n\t\t\treturn;\n\t\t}//end if\n\n\t\tSystem.out.printf(\"The %s is: \", name);\n\t\tListNode current = firstNode;\n\n\t\t//while not at end of list, output current node's data\n\t\twhile(current != null){\n\t\t\tSystem.out.printf(\"%s \", current.data);\n\t\t\tcurrent = current.nextNode;\n\t\t}//end while\n\n\t\tSystem.out.println(\"\\n\");\n\t}", "public void printAllPlayers(){\n for (Player player : players){\n player.printPlayerInfo();\n }\n }", "@Override\n public String toString() {\n return String.format(\"[id = %d, PIN: %s, LastName = %s, gender=%s, FirstName: %s]\", id, pin,LastName, gender, FirstName);\n }", "public void print() {\r\n Person tmp = saf.get(0);\r\n System.out.println(\"Person name : \" + tmp.getName() +\r\n \" Entering time : \" + tmp.getTime() +\r\n \" Waiting time : \" + tmp.getExitTime());\r\n }", "public void setMemberId(String string) {\n\t\t\n\t}", "@Override\n\tpublic List<Member> getAllMember() {\n\t\treturn null;\n\t}" ]
[ "0.7823905", "0.6945893", "0.67569804", "0.6575492", "0.65292615", "0.64948493", "0.64919853", "0.64919853", "0.648195", "0.64726114", "0.64423037", "0.6419758", "0.63923645", "0.6387537", "0.6319909", "0.6313532", "0.629648", "0.62829125", "0.6269026", "0.623481", "0.61709464", "0.6123527", "0.6122808", "0.610908", "0.6097887", "0.609548", "0.6091699", "0.609079", "0.60882", "0.607375", "0.60632753", "0.6027517", "0.6024496", "0.6024496", "0.6012851", "0.6003152", "0.59899527", "0.59865105", "0.59771156", "0.5973397", "0.59646255", "0.5961623", "0.5959895", "0.5956258", "0.59385765", "0.5930723", "0.5928481", "0.5924423", "0.59183615", "0.59159124", "0.5911729", "0.59063435", "0.59053165", "0.5884821", "0.5883056", "0.5880951", "0.5856692", "0.5853867", "0.58499885", "0.5837024", "0.58357346", "0.5823707", "0.5803904", "0.5791369", "0.5789684", "0.57868797", "0.57664305", "0.57632446", "0.57606536", "0.57562953", "0.5753061", "0.5745024", "0.5745024", "0.5743759", "0.5740726", "0.57353234", "0.5723209", "0.57190675", "0.5714362", "0.5711417", "0.5708406", "0.570691", "0.5704703", "0.5704322", "0.57012933", "0.56884164", "0.568274", "0.5679754", "0.56794256", "0.56786674", "0.5677571", "0.5674507", "0.5674507", "0.5660404", "0.56482553", "0.5645845", "0.564456", "0.56402844", "0.56381965", "0.56373054" ]
0.75076693
1
Removes a member from the club based on their id.
public void removeMember(int id) { Member m = this.getMember(id); members.remove(m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean deleteMember(final String id);", "public void deletemember(int id) {\n\t\tmemberrepo.deleteById(id);\n\t}", "void memberRemoved(final String id);", "public static void deleteMember (Long memberid) {\n Trainer trainer = Accounts.getLoggedInTrainer();\n Member member = Member.findById(memberid);\n\n Logger.info(\"Removing member \" + member.name);\n\n trainer.memberList.remove(member);\n trainer.save();\n member.delete();\n redirect(\"/trainer\");\n }", "void removeMember(final PartyMember member);", "public void removeMember(CrewMember member) {\r\n\t\tcrewMembers.remove(member);\r\n\t}", "public static void unregisterMember(int character_id) {\n team_members.remove(character_id);\n }", "public void removeUser(long id) {\n\troomMembers.remove(id);\n }", "void removeMemberById(final String accountId);", "void deleteMember(@Nonnull final String memberID, @Nonnull final String telegrafID);", "public void removeFamilyMember(String id) throws FamilyMemberNotFoundException {\n if (isFamilyMemberMapNullOrEmpty(familyMemberMap) || !familyMemberMap.containsKey(id)) {\n LOGGER.error(\"Exception Occurred\");\n throw new FamilyMemberNotFoundException(\"family member does not exist with the given id \" + id);\n }\n familyMemberMap.remove(id);\n }", "UserGroup removeMember(String companyId, String name, String memberEmail);", "public void delete(String id) {\n log.debug(\"Request to delete GroupMember : {}\", id);\n groupMemberRepository.deleteById(id);\n }", "public void removeMember(String uuid) {\n this.members.remove(uuid);\n }", "public void removeMember(Player player) {\n this.members.remove(player.getUniqueId().toString());\n }", "void deleteMember(@Nonnull final User member, @Nonnull final Telegraf telegraf);", "public void removeByid_(long id_);", "@Override\r\n\tpublic void delete(int id) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tMember member = new Member();\r\n\t\tmember.setId(id);\r\n\t\tmember.setNamaMember(\"lulu\");\r\n\t\tsession.delete(member);\r\n\t\tsession.flush();\r\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tMember member = new Member();\n\t\tmember.setId(id);\n\t\tsession.delete(member);\n\t}", "void remove(String id);", "void remove(String id);", "void remove(String id);", "public void deleteMember(IMember member);", "public void removeMember (String name) {\r\n\t\tgetMemberList().remove(name);\r\n\t\tsaveMemberList();\r\n\t}", "void remove(Long id);", "void remove(Long id);", "@DELETE\n\t@Path(\"/{groupId}/member/{memberId}\")\n\t@Produces(\"application/json\")\n\t@ApiDoc(\"Removes the member specified by userUUID from the group specified by groupUUID. \"\n\t\t\t+ \"Errors if the group or the user is not found. \"\n\t\t\t+ \"Also errors if the authenticated user is not authorized to edit the group \"\n\t\t\t+ \"or if removing the member would leave the group with no Admin member.\")\n\tpublic void removeMember(@PathParam(\"groupId\") final String groupId,\n\t\t\t@PathParam(\"memberId\") final String memberId) throws IllegalArgumentException,\n\t\t\tObjectNotFoundException, NdexException {\n\n\t\tlogger.info(userNameForLog() + \"[start: Removing member \" + memberId + \" from group \" + groupId + \"]\");\n\n\t\ttry (GroupDAO dao = getGroupDAO()){\n\t\t\tdao.removeMember(UUID.fromString(memberId), UUID.fromString(groupId), this.getLoggedInUser().getExternalId());\n\t\t\tdao.commit();\n\t\t\tlogger.info(userNameForLog() + \"[end: Member \" + memberId + \" removed from group \" + groupId + \"]\");\n\t\t} \n\t}", "private void removeOldMember(InternalDistributedMember id) {\n super.markDepartedMember(id);\n }", "UserGroup removeMember(String companyId, String name, String memberEmail, boolean isGroupLead);", "void remove(int id);", "@Override\n\tpublic void delete(long memberId) {\n\t\t\n\t}", "public void remove(String id) {\n\t\t\n\t}", "public void removeMember(Player player) {\n\t\tmembers.remove(player.getUniqueId());\n\t\tif (members.isEmpty()) {\n\t\t\tdeleteParty(this); // Uncaches empty parties\n\t\t}\n\t}", "@Override\r\n\tpublic void deleBusiMemberInfo(Long id) {\n\t\tbusiMemberInfoDao.deleteByKey(id);\r\n\t}", "@Override\r\n public void removeMember(MemberBase member) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n }", "@Override\n\tpublic void remove(MemberBean member) {\n\n\t}", "public void deleteData(Integer id) {\n\t\tMemberBean delBean = new MemberBean(id);\n//\t\tsession.delete(delBean);\n\t\tem.remove(delBean);\n\t}", "private AsyncFuture<Void> deleteMembersNode(final String memberId) {\n return bind(op -> op.delete()::inBackground,\n op -> op.forPath(MEMBERS + \"/\" + memberId)).directTransform(event -> null);\n }", "void removeUser(Long id);", "public void remove(Integer id) {\n\t\t\r\n\t}", "@Override\n\tpublic void deleteMember(MemberDTO mdto) {\n\t\tmdao.deleteMember(mdto);\n\t}", "@Override\n protected void removeMember() {\n }", "public void removePerson(int id) {\n\t\tsynchronized (this) {\n\t\t\tfor (int i = 0; i < people.size(); i++) {\n\t\t\t\tif (people.get(i).getId() == id) {\n\t\t\t\t\tpeople.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected void takeFamilyMember(FamilyMember famMember) {\n this.famMemberList.remove(famMember);\n }", "@DELETE\n\t@Path(\"/{groupid}/membership\")\n\t@Produces(\"application/json\")\n\t\n\tpublic void removeGroupMember(@PathParam(\"groupid\") final String groupIdStr,\n\t\t\t@QueryParam(\"userid\") final String memberIdStr) throws IllegalArgumentException,\n\t\t\tObjectNotFoundException, NdexException, SQLException {\n\n\n\t\tUUID memberId = UUID.fromString(memberIdStr);\n\t\t\n\t\tUUID groupId = UUID.fromString(groupIdStr);\n\t\ttry (GroupDAO dao = new GroupDAO()){\n\t\t\tif ( !dao.isGroupAdmin(groupId, getLoggedInUserId())) {\n\t\t\t if ( !memberId.equals(getLoggedInUserId())) {\n\t\t\t\t\tthrow new UnauthorizedOperationException(\"Unable to delete group membership: user need to be an admin of this group or can only make himself leave this group.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tdao.removeMember(memberId, groupId, \n\t\t\t\t\tdao.isGroupAdmin(groupId, getLoggedInUserId()) ? this.getLoggedInUser().getExternalId(): null);\n\t\t\tdao.commit();\n\t\t} \n\t}", "@Override\n\tpublic void deleteMember(MemberBean param) {\n\t\t\n\t}", "public void remove(Integer id) {\n\r\n\t}", "public int delete(String id) {\n\t\treturn sqlSessionTemplate.delete(\"memberInfo.delete\", id);\r\n\t}", "@Test\r\n\tpublic void testRemoveMember1() {\n\t\tproject.addMember(MEMBER_NAME1);\r\n\t\t\r\n\t\tproject.removeMember(MEMBER_NAME1);\r\n\t\t\r\n\t\tassertEquals(0, project.getMembers().size());\r\n\t}", "@Override\n public void removeMember(DavResource member) throws DavException {\n Session session = getRepositorySession();\n try {\n String itemPath = member.getLocator().getRepositoryPath();\n if (!exists() || !session.itemExists(itemPath)) {\n throw new DavException(DavServletResponse.SC_NOT_FOUND);\n }\n if (!getResourcePath().equals(Text.getRelativeParent(member.getResourcePath(), 1))) {\n throw new DavException(DavServletResponse.SC_CONFLICT, member.getResourcePath() + \"is not member of this resource (\" + getResourcePath() + \")\");\n }\n getRepositorySession().getItem(itemPath).remove();\n complete();\n } catch (RepositoryException e) {\n log.error(\"Unexpected error: \" + e.getMessage());\n throw new JcrDavException(e);\n }\n }", "public boolean deleteMember(Account cl)\n\t{\n\t\treturn members.remove(cl);\n\t}", "public void removeID(String id)\n { \n idReferences.remove(id); \n }", "@Override\n\tpublic void delete(Member member) {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = DbcpConnectionPool.getConnection();\n\t\t\tCallableStatement cstmt = conn.prepareCall(\"{call Member_delete(?)}\");\n\t\t\tcstmt.setString(1, member.getMemberID());\n\t\t\tcstmt.executeUpdate();\n\t\t\tcstmt.close();\n\t\t\tconn.close();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public int deleteMember(String id) {\n\t\tConnection conn = null;\n\t\tint resultrow=0;\n\t\tPreparedStatement pstmt = null;\n\t\ttry {\n\t\t\t\tconn= ConnectionHelper.getConnection(\"oracle\");\n\t\t\t\tString sql = \"delete from koreamember where id=?\";\n\t\t\t\tpstmt = conn.prepareStatement(sql);\n\t\t\t\tpstmt.setString(1, id);\n\t\t\t\tresultrow = pstmt.executeUpdate();\n\t\t\t\t\n\t\t}catch(Exception e) {\n\t\t\tSystem.out.println(\"delete : \" + e.getMessage());\n\t\t}finally {\n\t\t\tConnectionHelper.close(pstmt);\n\t\t\tConnectionHelper.close(conn);\n\t\t\ttry {\n\t\t\t\tconn.close(); //반환하기\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn resultrow;\n\t}", "void remover(Long id);", "void remover(Long id);", "@Override\r\n\tpublic void deleteByMember(int memberId) {\n\t\tString sql = \"DELETE FROM executetask WHERE et_member_id = ?\";\r\n\t\tupdate(sql,memberId);\r\n\t}", "@Override\n\tpublic void remove(int id) {\n\n\t}", "void delete(Member member);", "@Override\n\tpublic void remove(int id) {\n\t}", "@Override\n\tpublic void removeUser(int id) {\n\t\t\n\t}", "@Override\n public com.ext.portlet.model.StaffMember deleteStaffMember(long id)\n throws com.liferay.portal.kernel.exception.PortalException,\n com.liferay.portal.kernel.exception.SystemException {\n return _staffMemberLocalService.deleteStaffMember(id);\n }", "void remove(int id)throws IllegalArgumentException;", "E remove(Id id);", "@DeleteMapping(\"/memberships/{id}\")\n @Timed\n public ResponseEntity<Void> deleteMembership(@PathVariable Long id) {\n log.debug(\"REST request to delete Membership : {}\", id);\n membershipService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "public void remove(int i)\n/* 39: */ {\n/* 40:34 */ this.members.remove(i);\n/* 41: */ }", "public void delParticipant (int idParticipant){\n for (Participant participant :lesParticipants){\n if (participant.getIdParticipant()==idParticipant){\n lesParticipants.remove(participant);\n } \n }\n }", "boolean remove (I id);", "@Override\n\tpublic Member getMember(int id) {\n\t\treturn null;\n\t}", "@Override\r\n public String removeMember(String room, String user) {\r\n Objects.requireNonNull(room);\r\n Objects.requireNonNull(user);\r\n final Map<String, String> roomMembers = this.members.get(room);\r\n final String value = roomMembers == null || roomMembers.isEmpty() ? null : roomMembers.remove(user);\r\n LOG.debug(\"Member: {}, value: {}, room: {}, room members: {}\", \r\n user, value, room, roomMembers);\r\n return value;\r\n }", "public void removePlayer(int id) {\n\n Jogador j = this.listaJogadores.get(id);\n\n if(bankruptcy && j.temPropriedades() && j.isBankruptcy()){\n //System.out.println(\"vez: \" + vez + \"id: \" + id );\n jogoInterrompidoEm = vez = voltaVez(vez);\n j.addComandoGiveUp();\n j.removeComandoRoll();\n j.setBankruptcy(true);\n vez = voltaVez(id);\n if(build)\n j.removerComandoBuild();\n }else{\n falirJogador(id);\n }\n\n }", "public void removeBoatOfMember(Member m, int boatNr) {\n\t\tif(m != null) {\n\t\t\tm.removeBoat(m.getOwnedBoats().get(boatNr));\n\t\t} else {\n\t\t\tSystem.err.println(\"ERROR: No member with that id...\");\n\t\t}\n\t\tthis.saveDatabase();\n\t}", "@Override\r\n\tpublic void remove(GroupMember groupMember) {\n\t\tcacheDataImpl.del(CacheConfig.GROUPMEMBER_USERNAME, String.valueOf(groupMember.getId()));\r\n\t\tcacheDataImpl.del(CacheConfig.GROUPMEMBER_GROUPID, String.valueOf(groupMember.getId()));\r\n\t\tcacheDataImpl.del(CacheConfig.GROUPMEMBER_GRADE, String.valueOf(groupMember.getId()));\r\n\t}", "public void removeTeamMember(final Artifact artifact);", "public int DeleteOneMember(Member member) {\n\t\treturn memberDAO.DeleteOneMember(member);\r\n\t}", "public void removePlayer(UUID id) {\r\n for (Iterator<Player> plIterator = players.iterator(); plIterator.hasNext(); ) {\r\n Player player = plIterator.next();\r\n if (player.getId().equals(id)) {\r\n plIterator.remove();\r\n ((DefaultListModel) playerListGui.getModel()).removeElement(player);\r\n }\r\n }\r\n }", "void deletePersonById( final Long id );", "public boolean removeAccnt(String id){\n if(!(id.startsWith(\"9\"))){\n memberList.remove(id);\n System.out.println(\"#\"+id+\" retiré de la liste des membres.\");\n } else {\n proList.remove(id);\n System.out.println(\"#\"+id+\" retiré de la liste des professionnels.\");\n }\n return true;\n }", "@Override\n\tpublic void removeMember(User user) throws Exception {\n\n\t}", "public void delete(Long id) {\n playerGames.remove(find(id));\n }", "public Return removeMember(Parameter _parameter) {\n Instance instance = (Instance) _parameter.get(ParameterValues.INSTANCE);\n String tempID = ((Long) instance.getId()).toString();\n\n Context context = null;\n try {\n context = Context.getThreadContext();\n\n String abstractid =\n context.getParameter(\"oid\").substring(\n context.getParameter(\"oid\").indexOf(\".\") + 1);\n\n SearchQuery query = new SearchQuery();\n query.setQueryTypes(\"TeamWork_MemberRights\");\n query.addWhereExprEqValue(\"ID\", tempID);\n query.addWhereExprEqValue(\"AbstractLink\", abstractid);\n query.addSelect(\"UserAbstractLink\");\n query.executeWithoutAccessCheck();\n\n if (query.next()) {\n Long Userid = ((Person) query.get(\"UserAbstractLink\")).getId();\n query.close();\n\n query = new SearchQuery();\n query.setQueryTypes(\"TeamWork_Abstract2Abstract\");\n query.addWhereExprEqValue(\"AncestorLink\", abstractid);\n query.addSelect(\"AbstractLink\");\n query.executeWithoutAccessCheck();\n\n while (query.next()) {\n SearchQuery query2 = new SearchQuery();\n query2.setQueryTypes(\"TeamWork_Member\");\n query2.addWhereExprEqValue(\"AbstractLink\", query.get(\"AbstractLink\")\n .toString());\n query2.addWhereExprEqValue(\"UserAbstractLink\", Userid);\n query2.addSelect(\"OID\");\n query2.executeWithoutAccessCheck();\n if (query2.next()) {\n String delOID = (String) query2.get(\"OID\");\n Delete delete = new Delete(delOID);\n delete.execute();\n }\n query2.close();\n }\n query.close();\n } else {\n LOG.error(\"no\");\n }\n\n } catch (EFapsException e) {\n LOG.error(\"removeMember(ParameterInterface)\", e);\n }\n\n return null;\n\n }", "public Campus remove(long campusId) throws NoSuchCampusException;", "@Override\n\tpublic boolean removeMember(String name, String phone) {\n\t\treturn false;\n\t}", "@Override\n\tpublic int remove(String id) {\n\t\treturn 0;\n\t}", "void removeMember(Item item) throws AccessManagementException;", "public void removeMember(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(MEMBER$14, i);\n }\n }", "@SuppressWarnings(\"serial\")\n\tpublic void delMember(final String name,String group) throws Exception{\n\t\tGroup grp=addGroup(group);\n\t\tgrp.deleteChildren(Member.TAG, new HashMap<String, String>(){{\n\t\t\tput(\"username\",name);\n\t\t}});\n\t}", "public boolean remove(String id) throws SQLException\n {\n String update = \"DELETE FROM Persons WHERE teamId = ?\";\n PreparedStatement stmt = db.getPreparedStatement(update);\n stmt.setString(1, id);\n db.executeUpdate(stmt);\n\n return false;\n }", "void removeRole(String id) throws DataException;", "public void eliminarSolicitud(int id){\n listaSolicitudes.remove(id);\n }", "void removeIdFromList(Integer mCanalId);", "@Test\r\n\tpublic void testRemoveMember2() {\n\t\tproject.addMember(MEMBER_NAME1);\r\n\t\tproject.addMember(MEMBER_NAME2);\r\n\t\t\r\n\t\tproject.removeMember(MEMBER_NAME1);\r\n\t\t\r\n\t\tassertEquals(1, project.getMembers().size());\r\n\t\tassertFalse(project.getMembers().contains(MEMBER_NAME1));\r\n\t\tassertTrue(project.getMembers().contains(MEMBER_NAME2));\r\n\t}", "public static boolean destroy(int id){\n setConnection();\n \n try{\n Statement statement = con.createStatement();\n \n //Query statement \n String query = \"DELETE FROM member WHERE id = ?\";\n \n //Create mysql prepared statement\n PreparedStatement preparedStatement = con.prepareStatement(query);\n preparedStatement.setInt(1, id);\n \n if(preparedStatement.executeUpdate() > 0){\n return true;\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n \n return false;\n }", "public void removeItem(int id);", "public IMemberInfo remove(String handleId) {\n\t\tString key = getParentKey((IMember)JavaCore.create(handleId));\n\t\tIMemberSet memberSet = _map.get(key);\n\t\tif (memberSet != null)\n\t\t\treturn memberSet.remove(handleId);\n\t\treturn null;\n\t}", "public void deleteMember(List<Member> members,Member member,List<Boat> boats) throws WorkShopException {\n try {\n members.remove(member);\n Iterator<Boat> boatIterator = member.getBoats();\n while ( boatIterator.hasNext()) {\n Boat boat = boatIterator.next();\n boats.remove(boat);\n }\n fileService.writeBoats(boats);\n fileService.writeMembers(members);\n } catch (WorkShopException e) {\n throw e;\n } catch (Exception e) {\n throw new WorkShopException(e);\n }\n }", "public boolean removeSickPerson(int id) throws SQLException;", "@Override\n\tpublic boolean removeById(long id) {\n\t\treturn false;\n\t}", "@Override\n\tpublic Member findMemberId(long memberId) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void remove(Long id) throws IllegalArgumentException {\n\n\t}" ]
[ "0.7675656", "0.7626571", "0.7506733", "0.74995834", "0.73967206", "0.7209551", "0.7184176", "0.7146969", "0.70965254", "0.7085564", "0.6949207", "0.6942521", "0.69059986", "0.68829745", "0.6866083", "0.6783284", "0.66960675", "0.66929805", "0.6674563", "0.66411245", "0.66411245", "0.66411245", "0.66171837", "0.6595111", "0.65757984", "0.65757984", "0.6561426", "0.65414417", "0.65132123", "0.6506016", "0.65000266", "0.6496555", "0.64884853", "0.6474257", "0.64561427", "0.64542305", "0.64225906", "0.63951474", "0.6379636", "0.6358917", "0.63549685", "0.63381624", "0.63161224", "0.6291945", "0.6267521", "0.62548065", "0.6240544", "0.6196854", "0.6195723", "0.6194354", "0.61838347", "0.61730754", "0.61537474", "0.6147378", "0.6137543", "0.6137543", "0.60940796", "0.60607743", "0.60534567", "0.6048849", "0.6030109", "0.6005056", "0.59954345", "0.59710526", "0.5970961", "0.5970094", "0.596229", "0.5952447", "0.5949951", "0.5948808", "0.5945771", "0.59367925", "0.5934239", "0.59249985", "0.59213203", "0.5901637", "0.58954626", "0.58858776", "0.5860022", "0.5858291", "0.5837414", "0.5826855", "0.5826213", "0.5814718", "0.5800245", "0.57815844", "0.57812154", "0.57803386", "0.5777132", "0.5771439", "0.5761657", "0.5756412", "0.5749092", "0.5748872", "0.57457566", "0.57401407", "0.5739406", "0.5734723", "0.57288826", "0.572308" ]
0.8109896
0
/ Facility methods Returns a specific facility by providing a name
public Facility getFacility(String name) { return facilities.get(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Facility findById(Integer id);", "@Override\n public String toString() {\n return \"Facility{\" +\n \"facilityid=\" + facilityid +\n \", name='\" + name + '\\'' +\n \", population=\" + population +\n '}';\n }", "public int getFacilityId() {\r\n\t\treturn facilityId;\r\n\t}", "public org.hl7.fhir.CodeableConcept getFacilityType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().find_element_user(FACILITYTYPE$4, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public void removeFacility(String name) {\r\n\t\tfacilities.remove(name);\r\n\t}", "public Facility(String name, Integer population) {\n this.name = name;\n this.population = population;\n }", "public void addFacility(Facility someFacility);", "public void setFacilityid(int facilityid) {\n this.facilityid = facilityid;\n }", "public void addFacility(Facility f) {\r\n\t\tfacilities.put(f.name, f);\r\n\t}", "RiceCooker getByName(String name);", "public void setFacilityId(int facilityId) {\r\n\t\tthis.facilityId = facilityId;\r\n\t}", "Expertise findByName(String name);", "public org.hl7.fhir.CodeableConcept addNewFacilityType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().add_element_user(FACILITYTYPE$4);\n return target;\n }\n }", "public void setThisFacility(Facility thisFacility) {\n this.thisFacility = thisFacility;\n }", "String getFamily();", "String getFamily();", "String getFeature();", "String getFeature();", "public HashMap<String, HashMap<String, String>> getNearestFacility() {\n if (this.featureInfoHashMap==null) {\n return null;\n }\n return (HashMap<String, HashMap<String, String>>) this.featureInfoHashMap.entrySet().iterator().next();\n }", "String getName( String name );", "FeatureCall getFec();", "public StringBuilder getFacility(Element facilities) {\n\t\tStringBuilder facility = new StringBuilder();\n\t\tString prefix = \"\";\n\t\tfor (Element temp : facilities.select(\"span\")) {\n\t\t\tfacility.append(prefix);\n\t\t\tprefix = \",\";\n\t\t\tfacility.append(temp.text());\n }\n\t\treturn facility;\n\t}", "public String getXpeFacility() {\n return (String) getAttributeInternal(XPEFACILITY);\n }", "protected JsonTranslationFacility getJsonFacility( ) {\r\n\t\treturn this.jsonFacility;\r\n\t}", "public Faculty getFacultyById(String id) {\r\n\t\tFaculty f = null;\r\n\t\tfor(int i = 0; i < facultyDirectory.size(); i++) {\r\n\t\t\tif(facultyDirectory.get(i).getId().equals(id)) {\r\n\t\t\t\tf = facultyDirectory.get(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn f;\r\n\t}", "@Override\n\tpublic Facilities_type getFacilitiesTypeById(Integer facilitiesTypeId) {\n\t\treturn this.facilitiesDao.getFacilitiesTypeById(facilitiesTypeId);\n\t}", "public static String getName(String rfc) {\n\t\tString result = \"\";\n\t\ttry\n\t\t{\n\t\t\tstmt = conn.createStatement();\n\t\t\tquery = \"SELECT FNAME \" + \"FROM CREDIT.CUSTOMER \" + \"WHERE RFC='\" + rfc + \"'\";\n\t\t\trs = stmt.executeQuery(query);\n\t\t\t\n\t\t\twhile (rs.next())\n\t\t\t{\n\t\t\t\tresult = rs.getString(1);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(getMethodName(1) + \"\\t\" + result);\n\t\t\t\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}", "public Departmentdetails getDepartmentByName(String departmentName);", "public static DBFactory<? extends DBRecord<?>> getFactoryByName(String utableName)\n {\n String utn = DBFactory.getActualTableName(utableName);\n for (Iterator<DBFactory<? extends DBRecord<?>>> i = DBFactory.factoryList.iterator(); i.hasNext();) {\n DBFactory<? extends DBRecord<?>> fact = i.next();\n if (fact.getUntranslatedTableName().equals(utn)) { \n return fact; \n }\n }\n return null;\n }", "Category getByName(String name);", "public String getFaculty() {\n String tamperedFaculty = faculty.toUpperCase();\n return tamperedFaculty;\n }", "public Facility(String name, Integer population, Agepop agepop, Ethnicitypop ethnicitypop) {\n this.name = name;\n this.population = population;\n this.agepop = agepop;\n this.ethnicitypop = ethnicitypop;\n }", "public HashMap<String, HashMap<String, String>> getFurthestFacility() {\n Map.Entry<String, HashMap<String, String>> lastElement = null;\n while (this.featureInfoHashMap.entrySet().iterator().hasNext()) {\n lastElement = this.featureInfoHashMap.entrySet().iterator().next();\n }\n return (HashMap<String, HashMap<String, String>>) lastElement;\n }", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.6474163", "0.626019", "0.62068576", "0.61888766", "0.6132546", "0.6106485", "0.60493916", "0.57646227", "0.5752618", "0.5751618", "0.5566152", "0.55563664", "0.5555585", "0.55527365", "0.55465114", "0.55465114", "0.55313826", "0.55313826", "0.55116904", "0.5493871", "0.5480611", "0.54758716", "0.5475101", "0.5446891", "0.54430014", "0.544213", "0.54307044", "0.5413371", "0.54006994", "0.5382087", "0.5377795", "0.5366005", "0.5362977", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613", "0.53581613" ]
0.82239026
0
Adds a facility to the hash map
public void addFacility(Facility f) { facilities.put(f.name, f); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addFacility(Facility someFacility);", "public void add(String id, String flag) {\n\t\tthis.hashMap.put(id, flag);\n\t}", "public void add(Map<Variable, Object> instance) {\n\t\tthis.listInstance.add(instance);\n\t}", "void addPerformAt(Facility newPerformAt);", "public org.hl7.fhir.CodeableConcept addNewFacilityType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.CodeableConcept target = null;\n target = (org.hl7.fhir.CodeableConcept)get_store().add_element_user(FACILITYTYPE$4);\n return target;\n }\n }", "public static void assignFacilityToUse(Facility f, UseRequest useRequest)\n {\n Database.db.get(f).getFacilityUse().getSchedule().getSchedule().put(useRequest, useRequest.getIntervalSlot());\n }", "void add(String key);", "@Override\n public int hashCode() {\n int result = facilityid;\n result = 31 * result + (name != null ? name.hashCode() : 0);\n result = 31 * result + (population != null ? population.hashCode() : 0);\n return result;\n }", "public void addToFactor(Factor fac) {\n\t\tthis.occurrenceFactors.add(fac);\n\t}", "void add( Map< String, Object > paramMap );", "public void add(String masterKey, HashMap<String, String> featureInfo) {\n this.featureInfoHashMap.put(masterKey, featureInfo);\n }", "void addEntry(String key, Object value) {\n this.storageInputMap.put(key, value);\n }", "private void add(String key) {\n dict = add(dict, key, 0);\n }", "public void addToSectionCache(String id, Section s) {\n sectionIdToSection.put(id, s);\n }", "public void addToMap(){\n\t\tInteger hc = currentQuery.hashCode();\n\t\tif (!hmcache.containsKey(hc)) {\n\t\t\thmcache.put(hc, 0);\n\t\t}else{\n\t\t\tInteger val = hmcache.get(hc) + (currentQuery.getWords().size());\n\t\t\thmcache.put(hc, val);\n\t\t}\n\t}", "public String addToMap(String lunch) {\n questionThreeLunch = \"Baked Potato\";\n\t\thashMap.put(\"Lunch\", questionThreeLunch);\n\t\treturn lunch;\n\t}", "void setHashMap();", "@SuppressWarnings(\"unchecked\")\n protected void onAdd()\n {\n // issue add notification\n ObservableHashMap map = ObservableHashMap.this;\n if (map.hasListeners())\n {\n map.dispatchEvent(new MapEvent(map, MapEvent.ENTRY_INSERTED,\n getKey(), null, getValue()));\n }\n }", "public void enterScope() {\n\t\tmap.add(new HashMap<K, V>());\n\t}", "private void addToHashmap(String key, Long timestamp){\r\n\t\tkeyHashMap.putIfAbsent(key, new PriorityQueue<Long>());\r\n\t\tsynchronized(keyHashMap.get(key)){\r\n\t\t\tSystem.out.println(\"Added Key: \" + key + \" Time: \" + timestamp);\r\n\t\t\tkeyHashMap.get(key).add(timestamp);\r\n\t\t}\r\n\t}", "public void add(G item, int key){ //it adds methods using the int key\r\n int chain=hashFunction(key);\r\n ElectionNode x=new ElectionNode(item);\r\n x.next=electionTable[chain];\r\n electionTable[chain]=x;\r\n }", "void addEntry(K key, V value);", "@Override\n synchronized public void addEntry(Entry e) throws RemoteException {\n if (this.map.containsKey(e.getHash())) {\n return;\n }\n //System.out.println(\"Mapper.addEntry() :: entry=\"+e.getHash()+\",\"+e.getLocation());\n this.map.put(e.getHash(), e.getLocation());\n printAct(\">added entry:\" + e.hash);\n }", "private void addFeature()\r\n {\r\n MapGeometrySupport mgs = myCurrentGeometryHandler.getGeometry();\r\n MetaDataProvider mdp = myMetaDataHandler.getMetaDataProvider();\r\n TimeSpan span = buildTimeSpan(mdp);\r\n mgs.setTimeSpan(span);\r\n MapDataElement element = new DefaultMapDataElement(myFeatureId, span, myType, mdp, mgs);\r\n Color typeColor = myType.getBasicVisualizationInfo().getTypeColor().equals(DEFAULT_FEATURE_COLOR) ? myFeatureColor\r\n : myType.getBasicVisualizationInfo().getTypeColor();\r\n element.getVisualizationState().setColor(typeColor);\r\n myConsumer.addFeature(element);\r\n myFeatureCount++;\r\n }", "public void setFacilityid(int facilityid) {\n this.facilityid = facilityid;\n }", "private void addToMaps(String name, UUID uuid) {\n\n Calendar calendar = Calendar.getInstance();\n calendar.add(Calendar.DAY_OF_MONTH, 3);\n\n // Create the entry and populate the local maps\n CachedUUIDEntry entry = new CachedUUIDEntry(name, uuid, calendar);\n nameToUuidMap.put(name.toLowerCase(), entry);\n uuidToNameMap.put(uuid, entry);\n }", "public void add(G item,String key){\n int chain=hashFunction(key);\r\n if (electionTable[chain] != null) {\r\n System.out.println(\"input repeated key!!!\");\r\n return;\r\n }\r\n ElectionNode x=new ElectionNode(item);\r\n System.out.println(\"-----------add-------------- \" + chain);\r\n x.next=electionTable[chain];\r\n electionTable[chain]=x;\r\n }", "public static void addToMap()\n {\n Map<String, Integer> map = new HashMap<>();\n\n BiConsumer<String, Integer> mapAdderEveryTime = (s, i) -> map.put(s, i);\n\n mapAdderEveryTime.accept(\"key1\", 4);\n mapAdderEveryTime.accept(\"key2\", 4);\n\n BiConsumer<String, Integer> mapAdderIfPresent = (s, i) -> {\n map.computeIfPresent(s, (key, value) -> (value % 4 == 0) ? 0 : value +1);\n };\n\n mapAdderIfPresent.accept(\"key1\", 1);\n\n System.out.println(map);\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tprivate boolean checkAndAdd(DefinitionName key, DmsDefinition obj, HashMap map){\n if (map.containsKey(key))\n return(false);\n else\n map.put(key,obj);\n\n return(true);\n }", "@Override\n public void addMapInfo(GameMapInfo mapInfo) {\n }", "void addFeature(Feature feature);", "protected void registerData( int id, String key, RMItem value )\n {\n synchronized(m_itemHT) {\n m_itemHT.put(key, value);\n }\n }", "public void addEntry(NameSurferEntry entry) {\r\n\t\tentries.add(entry);\r\n\t}", "public void addFeatures(IFeature feature);", "public void addVendor_Scheme_Plan_Map() {\n\t\tboolean flg = false;\n\n\t\ttry {\n\n\t\t\tvspmDAO = new Vendor_Scheme_Plan_MapDAO();\n\t\t\tflg = vspmDAO.saveVendor_Scheme_Plan_Map(vspm);\n\t\t\tif (flg) {\n\t\t\t\tvspm = new Vendor_Scheme_Plan_Map();\n\t\t\t\tMessages.addGlobalInfo(\"New mapping has been added!\");\n\t\t\t} else {\n\t\t\t\tMessages.addGlobalInfo(\"Failed to add new mapping! Please try again later.\");\n\t\t\t}\n\n\t\t} catch (Exception exception) {\n\t\t\texception.printStackTrace();\n\t\t} finally {\n\t\t\tvspmDAO = null;\n\t\t}\n\t}", "public void addEntry(NameSurferEntry entry) {\n\t\tentries.add(entry);\n\t}", "private static void addEntriesToMap(\n\t\tMap<Character,Integer> map,String toSort, String poolOfOccurances\n\t\t){\n\n\t\t//Loop the toStort\n\t\tfor(int i=0;i<toSort.length();i++){\n\t\t\tmap.put(toSort.charAt(i),new Integer(getCharacterFrequence(toSort.charAt(i),poolOfOccurances)));\n\t\t}\n\n\t}", "void register(String name, K key, V value);", "public void add(String id, boolean flag, String claimKey) {\n\t\tif (flag == true) {\n\t\t\tthis.hashMap.put(id, NOT_FOUND);\n\t\t} else {\n\t\t\tthis.hashMap.put(id, FOUND);\n\t\t}\n\t\tif (claimKey != null) {\n\t\t\tthis.claimKeyHashMap.put(id, claimKey);\n\t\t}\n\t}", "public void add_entry(final Registration reg,\r\n\t\t\tForwardingInfo.action_t action, state_t state) {\r\n\r\n\t\tlock_.lock();\r\n\r\n\t\ttry {\r\n\t\t\tString name = String.format(\"registration-%d\", reg.regid());\r\n\t\t\tCustodyTimerSpec spec = CustodyTimerSpec.getDefaultInstance();\r\n\r\n\t\t\tlog_.add(new ForwardingInfo(state, action, name, reg.regid(), reg\r\n\t\t\t\t\t.endpoint(), spec));\r\n\t\t} finally {\r\n\t\t\tlock_.unlock();\r\n\r\n\t\t}\r\n\r\n\t}", "void add(K key, V value);", "public static void addFlight(Flight flightObj) {\r\n flightMap.put(flightObj.getFlightNumber(), flightObj);\r\n }", "@Override\r\n\tpublic void addNotice(Notice notice) {\n\t\tnoticemapper.insert(notice);\r\n\t}", "public static void addProduct(Product product){\r\n \r\n System.out.println(\"Adding Product \" + product.getProductName());\r\n productInvMap.put(productInvMap.size(),product);\r\n }", "public void add(Furniture f) {\r\n\t\tthis.furniture.add(f);\r\n\t}", "public void add(Feature f){\n if (debug) logger.info(\"feature added\");\n int z = fc.size();\n fc.add(f);\n fcLastEdits.clear();//clear possible feature edits\n fcLastEdits.add(f);\n lastEditType = EDIT_ADD;\n fireTableRowsInserted(z+1, z+1);\n }", "public void put(String uri, FunctionFactory f) { registry.put(uri,f) ; }", "void add(ThreadLocal<?> key, Object value) {\n for (int index = key.hash & mask;; index = next(index)) {\n Object k = table[index];\n if (k == null) {\n table[index] = key.reference;\n table[index + 1] = value;\n return;\n }\n }\n }", "MapComp<K, V> add(K k, V v);", "boolean add(Object key, Object value);", "private void addEntity(String name, int value)\n\t{\n\t\tmap.add(name, value);\n\t}", "public static <\n K,\n V> void addToCollectionMap(K key, V valueToAdd, Map<K, Collection<V>> map) {\n if (key != null && valueToAdd != null && map != null) {\n map.computeIfAbsent(key, Suppliers.asFunction(ArrayList::new)).add(valueToAdd);\n }\n }", "void add(KeyType key, ValueType value);", "public void add(int number) {\n if (hash.containsKey(number)) {\n hash.put(number, 2);\n } else {\n hash.put(number, 1);\n }\n }", "public void addSpecialization(String Special, double Gpa) {\n\t\thMap.put(Special, Gpa);\n\t}", "public synchronized void addHashToList(String file,HashMap<Integer,Integer> outcome){\n\t\tLinkedList<HashMap<Integer, Integer>> list = (LinkedList<HashMap<Integer,Integer>>)map.get(file);\n\t\tlist.add(outcome);\n\t}", "public void addFeature(@Nonnull Feature f) {\r\n features.add(f);\r\n }", "@Override\r\n\tpublic int addbus(HashMap<String, Object> map) {\n\t\treturn dao.addbus(map);\r\n\t}", "public void add(final TestInfo info) {\n\t\tclassToInfoMap.put(info.getContractTestClass(), info);\n\t\tSet<TestInfo> tiSet = interfaceToInfoMap.get(info.getClassUnderTest());\n\t\tif (tiSet == null) {\n\t\t\ttiSet = new HashSet<TestInfo>();\n\t\t\tinterfaceToInfoMap.put(info.getClassUnderTest(), tiSet);\n\t\t}\n\t\ttiSet.add(info);\n\t}", "@Override\r\n\tpublic void addToMap(MapView arg0) {\n\t\tsuper.addToMap(arg0);\r\n\t}", "public void add(String f){\n\t\tthis.vetor[contagem] = f;\n\t\tthis.contagem++;\n\t}", "public void add(int number) {\n // Write your code here\n if(map.containsKey(number)){\n map.put(number, map.get(number) + 1);\n }else{\n list.add(number);\n map.put(number, 1);\n }\n }", "private void insertEntry() {\n String desiredId = idField.getText();\n String desiredName = nameField.getText();\n String desiredMajor = majorField.getText();\n\n if (studentHashMap.containsKey(desiredId)) {\n this.displayStatusPanel(\n \"Error: A student with this information already exists.\",\n \"Error\",\n JOptionPane.WARNING_MESSAGE\n );\n } else {\n studentHashMap.put(desiredId, new Student(desiredName, desiredMajor));\n\n this.displayStatusPanel(\n \"Success: \" + desiredName + \" has been added.\",\n \"Success\",\n JOptionPane.INFORMATION_MESSAGE\n );\n }\n }", "public void add(BindRecord record) {\n map.put(record.getPeptide(), record);\n }", "public static void addFilterMap(WFJFilterMap filterMap) {\n validateFilterMap(filterMap);\n // Add this filter mapping to our registered set\n filterMaps.add(filterMap);\n }", "public void addAuthInfo(AuthInfo info);", "@Esercizio(nro = \"1.15\", pag = 29, descrizione = \"01) Scrivere una interfaccia che estenda Lookup\" +\n \"02) in modo tale da dichiarare im metodi add() e remove().\" +\n \"03) Implementare questa interfaccia in una nuova classe. \")\npublic interface LookupMigliorata extends Lookup { //01) = LookupMigliorata extends Lookup ---> estendo l'interfaccia\n //02) in modo tale da dichiarare im metodi add() e remove().\n public void add(String nome, Object obj); // inserito 2 parametri perche si aggiunge il nome = chiave e l'oggetto = valore hashmap\n //public nei metodi dell'interfaccia è opzionale\n public Object remove(String nome); //per rimuovere basta la stringa chiave ma restituisce Object rimosso.\n\n\n}", "public void firebaseAdd(HashMap hashMap){\n DatabaseReference myref = FirebaseDatabase.getInstance().getReference(hashMap.get(\"CafeId\").toString()).child(\"Menu\").child(hashMap.get(\"MenuKatagori\").toString()).child(hashMap.get(\"KatagoriId\").toString());\n myref.child(\"Fiyat\").setValue(hashMap.get(\"YeniDeger\").toString());\n\n\n }", "public abstract void addDetails();", "public void addItem(Item item) {\n\t\thashOperations.put(KEY, item.getId(), item);\n\t\t//valueOperations.set(KEY + item.getId(), item);\n\t}", "private void insert(String component, String feature) {\n\tthis.entities.putIfAbsent(component, new HashSet<String>());\n\tSet<String> componentFeatures = this.entities.get(component);\n\tcomponentFeatures.add(feature);\n\tthis.entities.put(component, componentFeatures);\n\t// From features to components which possess them\n\tthis.features.putIfAbsent(feature, new HashSet<String>());\n\tSet<String> components = this.features.get(feature);\n\tcomponents.add(component);\n\t//LogInfo.logs(\" adding: %s :: %s\", feature, component);\n\tthis.features.put(feature, components);\n }", "private void setUpHashMap(int number)\n {\n switch (number)\n {\n case 1:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n break;\n }\n case 2:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }\n case 3:\n {\n this.hourly.put(\"Today\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Day After Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }default:\n break;\n }\n }", "public void setThisFacility(Facility thisFacility) {\n this.thisFacility = thisFacility;\n }", "void insert(){\n \tFIR fir = new FIR();\r\n \tfir_id++;\r\n \tfir = fir.accept(fir_id);\r\n \thashaddress = hash(fir.category);\r\n \tFIR ptr;\r\n\t if(hashtable[hashaddress]==null){\r\n\t hashtable[hashaddress]=fir;\r\n\t }\r\n\t else{\r\n\t ptr=hashtable[hashaddress];\r\n\t while(ptr.next!=null){\r\n\t ptr=ptr.next;\r\n\t }\r\n\t ptr.next=fir;\r\n\t }\r\n\t //Time Complexity: O(n)\r\n }", "public void addKey(String key){\n itemMap.put(key, new ArrayList<>());\n }", "public void add(E e){\n int target = e.hashCode() % this.buckets;\n if(!data[target].contains(e)){\n data[target].add(e);\n }\n }", "private void addToMap(Word from, Word to) {\n Set<Word> s = wordMap.get(from);\n if(s == null) {\n s = new HashSet<>();\n wordMap.put(from, s);\n }\n s.add(to);\n }", "public void addPath(String path, IPathItem pathItem){\r\n pathsMap.put(path,pathItem);\r\n }", "public void add(String key, String def){\n add(key, def, true);\n }", "public void add(String key,String value){\n int index=hash(key);\n if (arr[index] == null)\n {\n arr[index] = new Llist();\n }\n arr[index].add(key, value);\n\n\n }", "public void addLevel()\r\n {\r\n tables.addFirst( new HashMap<String,T>() );\r\n counts.addFirst( 0 );\r\n }", "@Override\n\t\t\tpublic boolean addFact(Object fact) {\n\t\t\t\tthrow new IllegalStateException(\"Not implemented yet\");\n\t\t\t}", "public void addflight(Flight f)\n {\n \t this.mLegs.add(f);\n \t caltotaltraveltime();\n \t caltotalprice();\n }", "public void setFacilityId(int facilityId) {\r\n\t\tthis.facilityId = facilityId;\r\n\t}", "@Override\n public void addGrade(String firstName, String lastName, int pID, String grade) {\n Student s = new Student(firstName, lastName, pID);\n Grade g = new Grade(grade);\n\n for (Student key : map.keySet()) {\n if (key.compareTo(s) == 0) {\n map.replace(key, g);\n return;\n }\n }\n\n map.put(s, g);\n\n }", "@SuppressWarnings(\"serial\")\n protected void addInstance(\n Map<String, Object> keyMap, String key, CIMInstance instance)\n throws BaseCollectionException {\n try {\n Object result = keyMap.get(key);\n if (keyMap.containsKey(key) && result instanceof List<?>) {\n @SuppressWarnings(\"unchecked\")\n List<CIMInstance> cimInstanceList = (List<CIMInstance>) keyMap\n .get(key);\n\n cimInstanceList.add(instance);\n keyMap.put(key, cimInstanceList);\n } else {\n keyMap.put(key, instance);\n }\n } catch (Exception ex) {\n throw new BaseCollectionException(\n \"Error while adding CIMInstance to Map : \" + instance.getObjectPath(), ex) {\n @Override\n public int getErrorCode() {\n // To-Do errorCode\n return -1;\n }\n };\n }\n }", "@Override\n synchronized public void addMap(TreeMap toAdd) {\n this.map.putAll(toAdd);\n printAct(\"added a whole map with keys from:\" + toAdd.firstKey() + \" up to:\" + toAdd.lastKey());\n }", "public void put(int typecode, long capacity, String value) {\n\t\tMap<Long, String> map = weighted.get( typecode );\n\t\tif (map == null) {// add new ordered map\n\t\t\tmap = new TreeMap<Long, String>();\n\t\t\tweighted.put( typecode, map );\n\t\t}\n\t\tmap.put(capacity, value);\n\t}", "@Override\n public boolean add(E item) {\n if (item == null)\n throw new IllegalArgumentException(\"null invalid value for bag\");\n Counter count = map.get(item);\n if (count == null)\n map.put(item, new Counter(1));\n else\n count.increment();\n return true;\n }", "public void addInventory(String key, Integer value) {\n int currentValue = inventoryMap.getOrDefault(key, 0);\n inventoryMap.put(key, currentValue + value);\n }", "void addRegion(Region region);", "@Override\n\t\tpublic boolean add(java.util.Map.Entry<F, Double> arg0) {\n\t\t\tthrow new UnsupportedOperationException(\"Not yet implemented!\");\n\t\t}", "public void initialilzeMapEntry(String file){\n\t\tmap.put(file, new LinkedList<HashMap<Integer, Integer>>());\n\t}", "public boolean add(K key, V value){\r\n int loc = find(key);\r\n if(needToRehash()){\r\n rehash();\r\n }\r\n Entry<K,V> newEntry = new Entry<>(key,value);\r\n if(hashTable[loc]!= null && hashTable[loc].equals(key))\r\n return false;\r\n else{\r\n hashTable[loc] = newEntry;\r\n size++;\r\n return true;\r\n }\r\n }", "void addFeature(int index, Feature feature);", "private void add() {\n\n\t}", "public void add(int number) {\n // Write your code here\n if(map.containsKey(number)) {\n map.put(number, map.get(number) + 1);\n }else {\n map.put(number, 1);\n }\n }", "public void addFuelTankType(FuelCapacity Ftype) {\n\t\t\r\n\t}", "public void add(Literature literature) {\n\n literatureRegister.add(literature);\n }", "@Override\n public String toString() {\n return \"Facility{\" +\n \"facilityid=\" + facilityid +\n \", name='\" + name + '\\'' +\n \", population=\" + population +\n '}';\n }" ]
[ "0.6687771", "0.57535815", "0.57113355", "0.5710554", "0.5572915", "0.5561772", "0.5544694", "0.55198896", "0.54992574", "0.540989", "0.5409187", "0.53981197", "0.5384254", "0.5366334", "0.5365565", "0.5353093", "0.532904", "0.53085977", "0.5299987", "0.5291166", "0.52710736", "0.5269759", "0.52682996", "0.52525187", "0.5237944", "0.52352214", "0.52279097", "0.5226812", "0.5216032", "0.52070224", "0.5199575", "0.51973224", "0.5189851", "0.5182841", "0.5174041", "0.5161549", "0.51601607", "0.5159977", "0.5148019", "0.5126509", "0.5125604", "0.5116077", "0.5112717", "0.51120174", "0.5110723", "0.511019", "0.51051027", "0.51050484", "0.5099983", "0.50956213", "0.50729686", "0.5070559", "0.50549465", "0.5031892", "0.5029243", "0.50249314", "0.50244325", "0.5015991", "0.50123554", "0.50115955", "0.5002961", "0.5002229", "0.50009745", "0.4997064", "0.49968553", "0.49965724", "0.4996455", "0.49939418", "0.4985537", "0.49838972", "0.49785885", "0.4977763", "0.49755147", "0.49753463", "0.49735084", "0.49708152", "0.4964507", "0.49632332", "0.49617836", "0.49592698", "0.4957139", "0.49541047", "0.49539188", "0.495327", "0.49523404", "0.49501055", "0.49498075", "0.49472758", "0.49457785", "0.49384597", "0.49344003", "0.49316877", "0.49267083", "0.49251336", "0.4923515", "0.49212494", "0.49199572", "0.4918567", "0.49181965", "0.49154156" ]
0.7168937
0
Removes a facility by name
public void removeFacility(String name) { facilities.remove(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void remove(String name);", "void remove(String name);", "void remove(String name);", "void remove(String name) throws Exception;", "void removePerformAt(Facility oldPerformAt);", "boolean remove(String name);", "public abstract boolean remove(String name);", "void remove(String group, String name);", "void removeFlight(Flight flight);", "public Campus removeByname(java.lang.String name)\n\t\tthrows NoSuchCampusException;", "public void removeByname(java.lang.String name)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "public void removeClassificacao(String name)\n {\n this.classificacao.remove(name);\n }", "public void removeFightsystem( Fightsystem fightsystem )\r\n {\n\r\n }", "public void remove(final String name) {\r\n\t\tremove(names.indexOf(name));\r\n\t}", "public void removeFightsystem( Long fightsystemId )\r\n {\n\r\n }", "public void unsetFacilityType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FACILITYTYPE$4, 0);\n }\n }", "@Override\r\n\tpublic void deleteByName(String name) {\n\t\tint del = name.toUpperCase().charAt(0) - 'A';\r\n\t\tfor (int i = 0; i < array[del].size(); i++) {\r\n\t\t\tif (array[del].get(i).name == name) {\r\n\t\t\t\tarray[del].remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void removeClass(final String name);", "public void remove(ResourceLocation name) {\n data.remove(name.toString());\n }", "Object removeTemp(String name);", "public void removeName(Name arg0) {\n\n\t}", "void deleteCategoryByName(String categoryName);", "void removeHasInstitutionName(String oldHasInstitutionName);", "@Test\n\tpublic void testRemoveFacilityFromReservation() throws Exception {\n\t\tReservation res1 = dataHelper.createPersistedReservation(USER_ID,\n\t\t\t\tArrays.asList(infoBuilding.getId(), room1.getId()), validStartDate, validEndDate);\n\n\t\tbookingManagement.removeFacilityFromReservation(res1.getId(), room1.getId());\n\n\t\tres1 = bookingManagement.getReservation(res1.getId());\n\t\tassertNotNull(res1);\n\t\tassertEquals(1, res1.getBookedFacilityIds().size());\n\t\tassertTrue(res1.getBookedFacilityIds().contains(infoBuilding.getId()));\n\t}", "void removeGeneralName(int i);", "private void removeTeam(String teamName) {\n getTeam(teamName).unregister();\n }", "@Override\n\tpublic void deleteByName(String name) {\n\t\t\n\t}", "public UUID remove(String name) {\n\t\tUUID id = getId(name);\n\t\tif (id != null) {\n\t\t\tnames.remove(name);\n\t\t\tE t = dict.get(id);\n\t\t\tif (t != null) {\n\t\t\t\tlist.remove(t);\n\t\t\t} else {\n\t\t\t\tExits.Log.logp(Exits.Level.Warning, Exits.Common.Name, Exits.Common.Warning, \"Failed to remove unknown id {0}\", id);\n\t\t\t}\n\t\t\tdict.remove(id);\n\t\t\tConfig.serialize();\n\t\t}\n\t\treturn id;\n\t}", "public void removeGroup(String groupName) throws UnsupportedOperationException;", "public void remove(String name) {\n\t\tfor (int i = vibrationList.size() - 1; i >= 0; i--) {\r\n\t\t\tVibration vibration = vibrationList.get(i);\r\n\t\t\tif(vibration.getName().equals(name)){\r\n\t\t\t\tvibrationList.remove(vibration);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void remove(String id);", "void remove(String id);", "void remove(String id);", "public void removeMember (String name) {\r\n\t\tgetMemberList().remove(name);\r\n\t\tsaveMemberList();\r\n\t}", "String removeEdible(String name);", "boolean unregister(String name);", "void removeHeader(String headerName);", "void unsetName();", "void removePathItem(String name);", "public T remove(String name) {\n\t\tint idx = indexOf(name, 0);\n\t\tif (idx != -1)\n\t\t\treturn remove(idx);\n\t\treturn null;\n\t}", "public void delete(String name)\r\n\t{\r\n\t\tOntResource res = this.obtainOntResource(name);\r\n\t\tres.remove();\r\n\t}", "public void removeGroup(String name) {\n if(isGroup(name) == true) {\n /* Now remove the tab from the tabbedpain */\n tbMain.remove((JPanel)grouptabs.get(name));\n \n /* Remove the group from the hashmap */\n grouptabs.remove(name);\n }\n }", "public void removeContact() {\r\n\t\tSystem.out.println(\"enter the name of the contact you want to delete?\");\r\n\t\tString name = scanner.nextLine();\r\n\t\tint rowsEffected = service.removeContact(name);\r\n\t\tSystem.out.println(rowsEffected+\" row was removed\");\r\n\t}", "public void removeOperation(String name)\n {\n nameToOperation.remove(name);\n }", "public void removeName(String arg0) {\n\n\t}", "@Override\r\n public void logout(String facilityName) throws LoginException {\r\n HttpServletRequest request = this.getThreadLocalRequest();\r\n HttpSession session = request.getSession();\r\n String sessionId = null;\r\n if (session.getAttribute(\"SESSION_ID\") == null) { // First time login\r\n throw new LoginException(\"Session not valid\");\r\n } else {\r\n sessionId = (String) session.getAttribute(\"SESSION_ID\");\r\n }\r\n try {\r\n userManager.logout(sessionId, facilityName);\r\n } catch (AuthenticationException e) {\r\n throw new LoginException(e.getMessage());\r\n }\r\n }", "void eraseContact(String name) \r\n\t\t{\r\n\t\t\tfor(int i = 0; i < this.size(); i++)\r\n\t\t\t{\r\n\t\t\t String n = this.get(i).getContactName();\r\n\t\t\t \r\n\t\t\t\tif(n.equalsIgnoreCase(name))\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(n);\r\n\t\t\t\t\tCalendar.deleteEventBycontact(this.get(i));\r\n\t\t\t\t\tthis.remove(i);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "public void removeName(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(NAME$8, i);\n }\n }", "public void removeName(int arg0) {\n\n\t}", "void removeCategory(Category category);", "public void removeTicket(Ticket ticket) throws DavException;", "@Override\n\tpublic Object remove(String name) {\n\t\tMap<String, Object> scope = threadLocal.get();\n\t\treturn scope.remove(name);\n\t}", "public void RemoveStudent(String depName, String studentName) {\n\t\tdNode search = FindByName(depName);\n\t\tif (search != null)\n\t\t\tsearch.data.students.Remove(studentName);\n\t\telse\n\t\t\tSystem.out.println(\"Could not find the departmen \" + depName + \"to Remove \" + studentName);\n\t}", "void removeCollectionName(Object oldCollectionName);", "public void remove(String name)\n/* */ {\n/* 1177 */ for (int i = 0; i < this.attributes.size(); i++) {\n/* 1178 */ XMLAttribute attr = (XMLAttribute)this.attributes.elementAt(i);\n/* 1179 */ if (attr.getName().equals(name)) {\n/* 1180 */ this.attributes.removeElementAt(i);\n/* 1181 */ return;\n/* */ }\n/* */ }\n/* */ }", "public void removeInwDepartCompetence(final String id);", "public void removeByschoolId(long schoolId);", "void remove(String identifier) throws GuacamoleException;", "public void removeAgent(String layer, Agent a)\n/* 175: */ {\n/* 176:247 */ this.mapPanel.removeAgent(layer, a);\n/* 177: */ }", "void removeRide(String name, String park);", "public static void main_removeApplicant(){\n System.out.println(\"Enter Applicant Name: \");\n String name = input.nextLine();\n try {\n table.removeApplicant(name);\n System.out.println();\n } catch (ApplicantNotFoundException ex){\n System.out.println(\"Applicant not found.\");\n main_menu();\n }\n }", "public void removeFact(String fact) {\r\n\t\tif (_assertedFacs.contains(fact))\r\n\t\t\t_assertedFacs.remove(fact);\r\n\t}", "public void removeCourse(String course);", "public void removeType(String name) {\n String nameInLowerCase = Ascii.toLowerCase(name);\n Preconditions.checkState(!registered);\n Preconditions.checkArgument(types.containsKey(nameInLowerCase), \"missing key: %s\", name);\n types.remove(nameInLowerCase);\n }", "public void removeCompany(int id, String name) {\n }", "@Test\n public void testStaffFactoryRemove() {\n StaffController staffController = staffFactory.getStaffController();\n staffController.removeStaff(STAFF_NAME, 1);\n assertEquals(0, staffController.getStaffList().size());\n }", "public static void removeVisitor(String name){\n\t\t\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tvisitorListMap.remove(name);\n\t\t\t\tvisitorListModel.removeElement(name);\n\t\t\t}\n\t\t});\n\t\t\n\t}", "void remove(Team team);", "@Override\n\tpublic Campus removeByname(String name) throws NoSuchCampusException {\n\t\tCampus campus = findByname(name);\n\n\t\treturn remove(campus);\n\t}", "public void removeActor(Actor act) { ActorSet.removeElement(act); }", "public void deleteByName(String name){\r\n repository.deleteByName(name);\r\n }", "void remove(int id);", "void remover(String cpf)throws ProfessorCpfNExisteException;", "private void remove(String name) {\n if (team.getPokemon(name) != null) {\n System.out.println(\"You are going to remove \" + name);\n System.out.println(\"This process is inrevertable, are you sure? [y/n]\");\n String command = input.next();\n if (command.equals(\"y\") || command.equals(\"yes\")) {\n team.remove(name);\n System.out.println(name + \" has been removed form your team\");\n System.out.println(\"You currently have \" + team.count() + \" pokemons in your team\");\n }\n } else {\n System.out.println(name + \" is not found within your team\");\n }\n }", "public void deleteDepartmentByDeptName(String dept_name);", "Feature removeFeature(int index);", "void removeDetail(String id);", "public void removeFromFactor(Factor fac) {\n\t\tif (!this.occurrenceFactors.remove(fac)) {\n\t\t\tSystem.out.println(String.format(\"Tried to remove factor %d from RandVar %d occurrenceFactors list, but factor was not found.\",\n\t\t\t\t\tfac.index, this.index));\n\t\t}\n\t}", "public void remove();", "public void remove();", "public void remove();", "public void remove();", "public void remove();", "public void removePerson(Person p);", "public void del(String name) {\n\t\tfor (AddrBean ad : addrlist) {\n\t\t\tif (name.equals(ad.getUsername())) {\n\t\t\t\taddrlist.remove(ad);\n\t\t\t}\n\t\t}\n\t}", "public String removeAddressBook(String name)\n\t{\n\t\tif(!Utility.validateStringForAlphanumericOflength20(name))\n\t\t\treturn \"AddressBook Name should be Alphanumeric of Length 3-20 And Start with a Letter\";\n\t\tif(controller.isAddressBookExists(name).equals(Constants.SUCCSESS))\n\t\t\treturn controller.deleteAddressBook(name);\n\t\telse\n\t\t\treturn \"AddressBook '\"+ name +\"' doesn't exists...!!!\";\n\t}", "public final void removeFromChest(String name) {\n chestCharacters.remove(name);\n }", "void removeAirport(Long id);", "public void removeUsedFeature(final String name) {\n \t final List<Element> elementsToRemove = new LinkedList<Element>();\n for (final Element child : manifestElement.getChildren(ELEMENT_USES_FEATURE)) {\n if (name.equals(child.getAttributeValue(ATTRIBUTE_NAME))) {\n elementsToRemove.add(child);\n }\n }\n\n for (final Element element : elementsToRemove) {\n removeElementAndPrefix(element);\n }\n }", "public void removeList(String name){\n }", "boolean removeWorkByFolio(int folio);", "public void removeByequip_id(long equip_id);", "@Override\n\tpublic Facility_Host removeByfacilityId(long facilityId)\n\t\tthrows NoSuchFacility_HostException, SystemException {\n\t\tFacility_Host facility_Host = findByfacilityId(facilityId);\n\n\t\treturn remove(facility_Host);\n\t}", "void remove(String group);", "public void removeEntry(String name) throws NotPresentException {\n\t\tString key = name.toUpperCase();\n\t\trequireKeyExists(key);\n\t\tentries.remove(key);\n\t}", "public void removeWorld(String name){\n worlds.remove(getWorld(name));\n }", "private void removeStudy(int studyID) {\n\t}", "@Action( ACTION_REMOVE_FEATURE )\r\n public String doRemoveFeature( HttpServletRequest request )\r\n {\r\n int nId = Integer.parseInt( request.getParameter( PARAMETER_ID_FEATURE ) );\r\n FeatureHome.remove( nId );\r\n addInfo( INFO_FEATURE_REMOVED, getLocale( ) );\r\n\r\n return redirectView( request, VIEW_MANAGE_FEATURES );\r\n }", "@Override\n\tpublic void eliminarUsuaris(String name) {\n\t\treposUsuarios.deleteById(name);\n\t}", "public void removeCategory(String name, String passw)\n throws InvalidActionException, IncorrectPasswordException, NullPointerException{\n\n if(name == null || passw == null) throw new NullPointerException();\n if(!this.MasterPassw.equals(passw)) throw new IncorrectPasswordException(\"Password Errata\");\n if(!categories.containsKey(name)) throw new InvalidActionException(\"Categoria non presente\");\n categories.remove(name);\n numCategories--;\n }" ]
[ "0.71766275", "0.71501553", "0.71501553", "0.6953913", "0.67184293", "0.66599256", "0.66249377", "0.65774304", "0.6470068", "0.6400743", "0.6348273", "0.6336685", "0.626834", "0.6208479", "0.6196944", "0.6159727", "0.61582017", "0.6151515", "0.61405146", "0.6119645", "0.6092767", "0.6053853", "0.60355943", "0.5971609", "0.59482646", "0.59379154", "0.5937568", "0.5928184", "0.5902406", "0.58966225", "0.5885455", "0.5885455", "0.5885455", "0.58736706", "0.58729315", "0.5864396", "0.5859861", "0.5851362", "0.5842172", "0.58348674", "0.58276516", "0.5824346", "0.58220863", "0.5815025", "0.58115935", "0.58029395", "0.58012664", "0.579232", "0.5789467", "0.5774102", "0.5768726", "0.5764288", "0.57591826", "0.57562375", "0.5754684", "0.5743109", "0.573467", "0.57323325", "0.5728428", "0.57200027", "0.56968695", "0.5694984", "0.5693722", "0.5686844", "0.56784016", "0.5672728", "0.5656142", "0.5651377", "0.564921", "0.5641622", "0.5634705", "0.56306005", "0.5629917", "0.5627866", "0.5627313", "0.5619192", "0.56136227", "0.56110245", "0.55957437", "0.55957437", "0.55957437", "0.55957437", "0.55957437", "0.55903846", "0.55821383", "0.5574988", "0.55713844", "0.55654234", "0.55602133", "0.55543363", "0.55497134", "0.55486023", "0.55479807", "0.5538785", "0.5532346", "0.5525834", "0.5522276", "0.5515429", "0.55147827", "0.5514199" ]
0.84260684
0
Displays a list of facilities
public void showFacilities() { for(Facility f: facilities.values()) { System.out.println(f.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void show() {\r\n\t\tshowMembers();\r\n\t\tshowFacilities();\r\n\t}", "void showFacts(List<Fact> facts);", "public static void facultyText(){\n\t\tSystem.out.println(\"Enter: 1.'EXIT' 2.'ADD' 3.'REMOVE' 4.'FIND' 5.'SCHEDULE' 6.'GRANTS' 7.'MORE' -for more detail about options\");\n\t}", "@Override\r\n\tpublic void showlist() {\n int studentid = 0;\r\n System.out.println(\"请输入学生学号:\");\r\n studentid = input.nextInt();\r\n StudentDAO dao = new StudentDAOimpl();\r\n List<Course> list = dao.showlist(studentid);\r\n System.out.println(\"课程编号\\t课程名称\\t教师编号\\t课程课时\");\r\n for(Course c : list) {\r\n System.out.println(c.getCourseid()+\"\\t\"+c.getCoursename()+\"\\t\"+c.getTeacherid()+\"\\t\"+c.getCoursetime());\r\n }\r\n \r\n\t}", "public void showMemberCategoryMenu() {\n System.out.println(\"Visa lista med: \");\n System.out.println(\"\\t1. Barnmedlemmar\");\n System.out.println(\"\\t2. Ungdomsmedlemmar\");\n System.out.println(\"\\t3. Vuxenmedlemmar\");\n System.out.println(\"\\t4. Seniormedlemmar\");\n System.out.println(\"\\t5. VIP-medlemmar\");\n System.out.print(\"Ange val: \");\n }", "private static void listStaffByCategory(){\n\t\t\n\t\tshowMessage(\"Choose one category to list:\\n\");\n\t\tshowMessage(\"1 - Surgeon\");\n showMessage(\"2 - Nurse\");\n showMessage(\"3 - Vet\");\n showMessage(\"4 - Accountant\");\n showMessage(\"5 - ItSupport\");\n showMessage(\"6 - Secretary\");\n showMessage(\"7 - Back to previous menu.\");\n \n int option = getUserStaffByCategory();\n /** switch case option start below */\n switch (option){\n \tcase 1 : ToScreen.listEmployee(employee.getSurgeonList(), true); listStaffByCategory();\n break;\n case 2 : ToScreen.listEmployee(employee.getNurseList(), true); listStaffByCategory();\n break;\n case 3 : ToScreen.listEmployee(employee.getVetList(), true); listStaffByCategory();\n \tbreak;\n case 4 : ToScreen.listEmployee(employee.getAccountantList(), true); listStaffByCategory();\n \tbreak;\n case 5 : ToScreen.listEmployee(employee.getItSupportList(), true); listStaffByCategory();\n \tbreak;\n case 6 : ToScreen.listEmployee(employee.getSecretaryList(), true); listStaffByCategory();\n \tbreak;\n case 7 : main();\n break;\n \n default: listStaffByCategory();\n \n }\n\n\t}", "public void display()\n {\n System.out.println(name);\n System.out.println(status);\n if (friendslist.size ==0){\n System.out.println(\"User has no friends :(\");\n for(String i: friendslist.size){\n System.out.println(friendslist.get(i));\n }\n }\n }", "public static void facultyExtended(){\n\t\tSystem.out.println(\"Enter 'EXIT' to exit to the Main Menu\");\n\t\tSystem.out.println(\"Enter 'ADD' followed by: faculty ID, name, major, class, and GPA to add a student record\");\n\t\tSystem.out.println(\"Enter 'REMOVE' followed by a faculty ID to remove a student\");\n\t\tSystem.out.println(\"Enter 'FIND' followed by a faculty ID or name to pull up student's information\");\n\t\tSystem.out.println(\"Enter 'SCHEDULE' followed by a faculty ID or name to list all courses person is teaching\");\n\t\tSystem.out.println(\"Enter 'GRANTS' followed by a faculty ID or name to list all grant information\");\n\t}", "public void printList() {\n userListCtrl.showAll();\n }", "public static void listMainMenuOptions(){\n\t\tSystem.out.println(\"\\nWelcome to Vet Clinic Program. Please choose an option from the list below.\\n\");\n\t\tSystem.out.println(\"1: List all staff.\");\n\t\tSystem.out.println(\"2: List staff by category.\");\n\t\tSystem.out.println(\"3: List admin Staff performing a task.\");\n\t\tSystem.out.println(\"4: Search for a specific member of staff by name.\");\n\t\tSystem.out.println(\"5: List all animals.\");\n\t\tSystem.out.println(\"6: List animals by type.\");\n\t\tSystem.out.println(\"7: Search for a specific animal by name.\");\n\t\tSystem.out.println(\"8: See the Queue to the Veterinary\");\n\t\tSystem.out.println(\"9: Exit\");\n\t}", "public void viewList() {\n\t\tSystem.out.println(\"Your have \" + contacts.size() + \" contacts:\");\n\t\tfor (int i=0; i<contacts.size(); i++) {\n\t\t\tSystem.out.println((i+1) + \". \" \n\t\t\t\t\t+ contacts.get(i).getName() + \" number: \" \n\t\t\t\t\t+ contacts.get(i).getPhoneNum());\n\t\t}\n\t}", "public void displayFoulsForTeamA(int fouls) {\r\n TextView foulsView = (TextView) findViewById(R.id.team_a_fouls);\r\n foulsView.setText(String.valueOf(fouls));\r\n }", "private void displayListView() {\n\t\tArrayList<FillterItem> fillterList = new ArrayList<FillterItem>();\n\n\t\tfor (int i = 0; i < province.length; i++) {\n\t\t\tLog.i(\"\", \"province[i]: \" + province[i]);\n\t\t\tFillterItem fillter = new FillterItem();\n\t\t\tfillter.setStrContent(province[i]);\n\t\t\tfillter.setSelected(valueList[i]);\n\t\t\t// add data\n\t\t\tfillterList.add(fillter);\n\t\t}\n\n\t\t// create an ArrayAdaptar from the String Array\n\t\tdataAdapter = new MyCustomAdapter(getContext(),\n\t\t\t\tR.layout.item_fillter_header, fillterList);\n\n\t\t// Assign adapter to ListView\n\t\tlistView.setAdapter(dataAdapter);\n\n\t}", "private void viewList() {\r\n PrintListMenuView listMenu = new PrintListMenuView();\r\n listMenu.displayMenu();\r\n }", "public void displayUsers(){\n //go through the userName arraylist and add them to the listView\n for(String val:this.userNames){\n this.userListView.getItems().add(val);\n }\n }", "public void displayFoulsForTeamA(int foul) {\n TextView foulsView = findViewById(R.id.team_a_fouls);\n foulsView.setText(String.valueOf(foul));\n }", "@ManyToMany\r\n\t@OrderBy(\"name\")\r\n\tpublic Set<Facility> getFacilities() {\r\n\t\treturn facilities;\r\n\t}", "public void printList() {\n System.out.println(\"Disciplina \" + horario);\n System.out.println(\"Professor: \" + professor + \" sala: \" + sala);\n System.out.println(\"Lista de Estudantes:\");\n Iterator i = estudantes.iterator();\n while(i.hasNext()) {\n Estudante student = (Estudante)i.next();\n student.print();\n }\n System.out.println(\"Número de estudantes: \" + numberOfStudents());\n }", "public void display() {\n \n //Print the features representation\n System.out.println(\"\\nDENSE REPRESENTATION\\n\");\n \n //Print the header\n System.out.print(\"ID\\t\");\n for (short i = 0 ; i < dimension; i++) {\n System.out.format(\"%s\\t\\t\", i);\n }\n System.out.println();\n \n //Print all the instances\n for (Entry<String, Integer> entry : mapOfInstances.entrySet()) {\n System.out.format(\"%s\\t\", entry.getKey());\n for (int i = 0; i < vectorDimension(); i++) {\n //System.out.println(allFeatures.get(entry.getValue())[i]);\n System.out.format(\"%f\\t\", allValues.get(entry.getValue())[i]); \n }\n System.out.println();\n }\n }", "public HashMap<String, Object> sendListFacilityNames(){\n\t\tHashMap<String, Object> request = new HashMap<String, Object>();\n\t\trequest.put(\"service_type\", Constants.LIST_FACILITY);\n\t\t\n\t\treturn this.sendRequest(request);\n\t}", "private static final void displayAttractionSummary()\r\n {\r\n System.out.println(\"Display Attraction Summary Feature Selected!\");\r\n System.out.println(\"--------------------------------------\");\r\n \r\n // step through array of attractions with for loop\r\n for(int i = 0; i < attractionCount; i++)\r\n {\r\n attractionList[i].printDetails();\r\n System.out.println();\r\n }\r\n }", "@Override\n\tpublic List<Facilities> getFacilitiesById(Integer facilitiesId) {\n\t\treturn this.facilitiesDao.getFacilitiesById(facilitiesId);\n\t}", "void display(){\n System.out.println(\"Name:\"+name);\n System.out.println(\"Age:\"+age);\n System.out.println(\"Faculty:\"+faculty);\n System.out.println(\"Department:\"+department);\n System.out.println(\"IsHandicapped:\"+isHandicapped);\n }", "private void viewActiveCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < activeCourseList.size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(activeCourseList.get(i));\n } else {\n System.out.println((i + 1) + \": \" + activeCourseList.get(i).getName());\n }\n }\n\n }", "public void display () {\n System.out.println(rollNo + \" \" + name + \" \" + college );\n }", "@Transactional\n\tpublic List<Faculty> listAllFaculty() {\n\n\t\tCriteriaBuilder builder = getSession().getCriteriaBuilder();\n\t\tCriteriaQuery<Faculty> criteriaQuery = builder.createQuery(Faculty.class);\n\t\tRoot<Faculty> root = criteriaQuery.from(Faculty.class);\n\t\tcriteriaQuery.select(root);\n\t\tQuery<Faculty> query = getSession().createQuery(criteriaQuery);\n\n\t\t// query.setFirstResult((page - 1) * 5);\n\t\t// query.setMaxResults(5);\n\t\treturn query.getResultList();\n\t}", "private void showList() {\n select();\n //create adapter\n adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, studentInfo);\n //show data list\n listView.setAdapter(adapter);\n }", "public void display() {\n String box = \"\\n+--------------------------------------------+\\n\";\n String header = \"| \" + name;\n String lvlStat = \"Lv\" + level;\n for (int i=0; i<42-name.length()-lvlStat.length(); i++) {\n header += \" \";\n }\n header += lvlStat + \" |\\n\";\n System.out.println(box + header + \"| \" + getHealthBar() + \" |\" + box);\n }", "public void menuListados() {\n\t\tSystem.out.println(\"MENU LISTADOS\");\n\t\tSystem.out.println(\"1. Personas con la misma actividad\");\n\t\tSystem.out.println(\"2. Cantidad de personas con la misma actividad\");\n\t\tSystem.out.println(\"0. Salir\");\n\t}", "public List<String> displayuser() {\n\t\t// TODO Auto-generated method stub\n\t\tList<String> list = new ArrayList<>();\n\t\tlist = crud1.displayUsers();\n\t\treturn list;\n\t}", "public void showMembers() {\r\n\t\tfor(Member m: members) {\r\n\t\t\tm.show();\r\n\t\t}\r\n\t}", "public void show()\n {\n System.out.println( getFullName() + \", \" +\n String.format(Locale.ENGLISH, \"%.1f\", getAcademicPerformance()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getSocialActivity()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getCommunicability()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getInitiative()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getOrganizationalAbilities())\n );\n }", "void showPatients() {\n\t\t\t\n\t}", "public static void viewListOfRegistrants() {\n\t\tArrayList<Registrant> list_reg = getRegControl().listOfRegistrants();\r\n\t\tif (list_reg.size() == 0) {\r\n\t\t\tSystem.out.println(\"No Registrants loaded yet\\n\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"List of registrants:\\n\");\r\n\t\t\tfor (Registrant registrant : list_reg) {\r\n\t\t\t\tSystem.out.println(registrant.toString());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void userDisplay() {\n\n String nameList = \" | \";\n for (String username : students.keySet()) {\n nameList += \" \" + username + \" | \";\n\n\n }\n System.out.println(nameList);\n// System.out.println(students.get(nameList).getGrades());\n\n }", "public String displayFamilyMembers() {\n int i = 1;\n StringBuilder ret = new StringBuilder();\n for (FamilyMember fam : this.famMemberList) {\n ret.append(i + \".\" + \" \" + fam.getSkinColour() + \" -> \" + fam.getActionValue());\n ret.append(\" | \");\n i++;\n }\n return ret.toString();\n }", "public static void showAllVilla(){\n ArrayList<Villa> villaList = getListFromCSV(FuncGeneric.EntityType.VILLA);\n displayList(villaList);\n showServices();\n }", "private void displayMenu() {\r\n System.out.println(\"\\nSelect an option from below:\");\r\n System.out.println(\"\\t1. View current listings\");\r\n System.out.println(\"\\t2. List your vehicle\");\r\n System.out.println(\"\\t3. Remove your listing\");\r\n System.out.println(\"\\t4. Check if you won bid\");\r\n System.out.println(\"\\t5. Save listings file\");\r\n System.out.println(\"\\t6. Exit application\");\r\n\r\n }", "private void showFullMenu() {\r\n Menu[] menu = MenuFactory.showMenu();\r\n System.out.println(\"Menu_Id \\t Food_Name \\t Food_Type \\t\\t Calories \\t Food_Amount\");\r\n for (Menu m : menu) {\r\n System.out.println(m.getFoodId() + \"\\t\\t\" + m.getFoodName() + \"\\t\\t\" + m.getFoodType() + \"\\t\\t\\t\" + m.getCalories() + \"\\t\\t\" + m.getFoodAmt());\r\n }\r\n }", "public void displayLeaderCards() {\n int i = 1;\n for (LeaderCard card : leaderCards) {\n String toDisplay = i + \" \" + card.getName() + \" -> cost: \" +\n card.getActivationCost() +\" : \" + card.getCardCostType();\n if (card.isActivated()) {\n toDisplay += \" activated\";\n }\n this.sOut(toDisplay);\n i++;\n }\n }", "@Override\n\tpublic void showAirlines() {\n\t\tArrayList<Airline> airlines = Singleton.AirlineRegistDao().findAll();\n\t\tairlineOptions = \"\";\n\t\tfor (Airline airline : airlines) {\n\t\t\tairlineOptions += String.format(\"<li role=\\\"presentation\\\"> <a role=\\\"menuitem\\\" tabindex=\\\"-1\\\" href=javascript:void(0)>%s</a> </li>\\n\", airline.getName());\n\n\t\t}\n\t\tSystem.out.println(airlineOptions);\n\t}", "@Override\n\tpublic List<String> getFacilitiesNameById(List<Integer> facilitiesIds) {\n\t\treturn this.facilitiesDao.getFacilitiesNameById(facilitiesIds);\n\t}", "public void display()\n {\n for (int i = 0; i < length; i++)\n {\n System.out.print(list[i] + \" \");\n }\n\n System.out.println();\n }", "private void showListView()\n {\n SimpleCursorAdapter adapter = new SimpleCursorAdapter(\n this,\n R.layout.dataview,\n soldierDataSource.getCursorALL(), //\n _allColumns,\n new int[]{ R.id.soldierid, R.id.username, R.id.insertedphone, R.id.password},\n 0);\n\n table.setAdapter(adapter);\n }", "public void show() {\r\n List<Benefit> listBeneficio = service.findAll();\r\n if(listBeneficio!=null && !listBeneficio.isEmpty()){\r\n for(Benefit c: listBeneficio){\r\n LOGGER.info(c.toString());\r\n }\r\n }\r\n }", "public static void printList(){\n ui.showToUser(ui.DIVIDER, \"Here are the tasks in your list:\");\n for (int i=0; i<Tasks.size(); ++i){\n Task task = Tasks.get(i);\n Integer taskNumber = i+1;\n ui.showToUser(taskNumber + \".\" + task.toString());\n }\n ui.showToUser(ui.DIVIDER);\n }", "public FacultyScreen() {\n initComponents();\n }", "public String listViaje() {\n\t\t\t//resetForm();\n\t\t\treturn \"/boleta/list.xhtml\";\t\n\t\t}", "public static void printFruits() {\r\n\t\tSystem.out.println(\"\\nFruits Available in our store: \\n\");\r\n\t\tSystem.out.format(\"%5s\\t%10s\\t%10s\\t%10s\\t%10s\\n\", \"Id\", \"Name\", \"Quality\", \"Price\", \"Best Before Use\");\r\n\t\tfor (Fruit fruit : fruits.values()) {\r\n\t\t\tSystem.out.format(\"%5s\\t%10s\\t%10s\\t%10s\\t%10s\\n\", fruit.getId(), fruit.getName(), fruit.getQuality(),\r\n\t\t\t\t\tfruit.getPrice(), fruit.getBestBeforeUse());\r\n\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "private static void displayMenu() {\n System.out.println(\"Menu : \");\n System.out.println(\"Type any number for selection\");\n for (int i = 1; i <= totalPlayers; i++) {\n System.out.println(i + \")View \" + playerList.get(i - 1) + \" cards\");\n }\n System.out.println(\"8)Display Each Player's Hand Strength\");\n System.out.println(\"9)Declare Winner\");\n System.out.println(\"10)Exit\");\n }", "public void viewListofHomes() {\n\t\ttry {\n\t\t\t\n\t\t}catch(Exception e) {\n\t\t\tLog.addMessage(\"Failed to get list of homes\");\n\t\t\tSystem.out.println(e.getMessage().toString());\n\t\t\tAssert.assertTrue(false, \"Failed to get list of homes\");\n\t\t}\n\t}", "@GetMapping\n\tpublic List<UniversityStaffMember> viewAllStaffs() {\n\t\tList<UniversityStaffMember> list = universityService.viewAllStaffs();\n\t\tif (list.size() == 0)\n\t\t\tthrow new EmptyDataException(\"No University Staff in Database.\");\n\t\treturn list;\n\t}", "@Override\n\tpublic List<Facilities_type> getAllFacilitiesType() {\n\t\treturn this.facilitiesDao.getAllFacilitiesType();\n\t}", "@Override\n\tpublic void showCities() {\n\t\tArrayList<City> cities = Singleton.CityRegistDao().findAll();\n\t\tcityOptions = \"\";\n\t\tfor (City city : cities) {\n\t\t\tcityOptions += String.format(\"<li role=\\\"presentation\\\"> <a role=\\\"menuitem\\\" tabindex=\\\"-1\\\" href=javascript:void(0)>%s</a> </li>\\n\", city.getName(), city.getName());\n\t\t}\n\t\tSystem.out.println(cityOptions);\n\t}", "void displayCards(List<Card> cards, String title);", "public void display () {\n super.display ();\n if (joined == true) {\n System.out.println(\"Staff name: \"+staffName+\n \"\\nSalary: \"+salary+\n \"\\nWorking hour: \"+workingHour+\n \"\\nJoining date: \"+joiningDate+\n \"\\nQualification: \"+qualification+\n \"\\nAppointed by: \"+appointedBy);\n }\n }", "static void displayMenu(){\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Select operation:\");\n\t\tSystem.out.println(\"1-List movies\");\n\t\tSystem.out.println(\"2-Show movie details\");\n\t\tSystem.out.println(\"3-Add a movie\");\n\t\tSystem.out.println(\"4-Add an example set of 5 movies\");\n\t\tSystem.out.println(\"5-Exit\");\n\t}", "public void showstudents(){\n for (int i=0; i<slist.size(); i++){\n System.out.println(slist.get(i).getStudent());\n }\n }", "public void displayStudentFold(View view){\n\n classList = (ListView) findViewById(R.id.foldList);\n\n // get the student details\n list = new ArrayList<>();\n for (int i = 0; i < studentList.size(); i++) {\n list.add(studentList.get(i).getStudentName());\n }\n\n // sort the student list\n Collections.sort(studentList, new CustomComparator());\n\n adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);\n\n classList.setOnItemClickListener(null); // does not go anywhere when clicked\n // TODO: onClick will take the user to the information about the student's attendance\n\n classList.setAdapter(adapter);\n\n }", "public faculty() {\n initComponents();\n }", "private void showFavouriteList() {\n setToolbarText(R.string.title_activity_fave_list);\n showFavouriteIcon(false);\n buildList(getFavourites());\n }", "public void displayActionItemScreen() throws SQLException, ClassNotFoundException {\n String item = console_actionItemList.getSelectionModel().getSelectedItem();\n all_teams();\n all_members();\n if(item != null && !item.isEmpty())\n getAction_Name().setDisable(true);\n actionItemClass obj = new actionItemClass();\n obj.displayActionItemScreen(this,item);\n }", "private void displayMenu() {\n System.out.println(\"\\nSelect from:\");\n System.out.println(\"\\t1 -> add item to to-do list\");\n System.out.println(\"\\t2 -> remove item from to-do list\");\n System.out.println(\"\\t3 -> view to-do list\");\n System.out.println(\"\\t4 -> save work room to file\");\n System.out.println(\"\\t5 -> load work room from file\");\n System.out.println(\"\\t6 -> quit\");\n }", "public void displayCategories() {\n System.out.println(\"Categories:\");\n for(int i = 0; i < categories.size(); i++)\n System.out.println((i + 1) + \". \" + categories.get(i).getName());\n }", "@RequestMapping(value = \"/api/v1/getAllFacilitiesAsString\", method = RequestMethod.GET, produces=\"application/json\")\n\tpublic ResponseEntity getAllFacilitiesAsString() {\n\t\treturn wrapForPublic(() -> this.service.getAllFacilitiesAsString());\n\t}", "public List list(int pageNo, int pageSize) throws ApplicationException {\n\t\t\tStringBuffer sql = new StringBuffer(\"SELECT * FROM ST_FACULTY\");\n\t\t\tConnection conn = null;\n\t\t\tArrayList list = new ArrayList();\n\t\t\t\n\t\t\t// if page is greater than zero then apply pagination \n\t\t\tif (pageSize>0) {\n\t\t\t\tpageNo = (pageNo-1)*pageSize;\n\t\t\t\tsql.append(\" limit \"+ pageNo+ \" , \" + pageSize);\n\t\t\t}\n\t\t\ttry{\n\t\t\t\t\tconn = JDBCDataSource.getConnection();\n\t\t\t\t\tPreparedStatement pstmt = conn.prepareStatement(sql.toString());\n\t\t\t\t\tResultSet rs = pstmt.executeQuery();\n\t\t\t\t\twhile (rs.next()) {\n\t\t\t\t\t\tFacultyBean bean = new FacultyBean();\n\t\t\t\t\t\tbean.setId(rs.getLong(1));\n\t\t\t\t\t\tbean.setCollegeId(rs.getLong(2));\n\t\t\t\t\t\tbean.setSubjectId(rs.getLong(3));\n\t\t\t\t\t\tbean.setCourseId(rs.getLong(4));\n\t\t\t\t\t\t\n\t\t\t\t\t\tbean.setFirstName(rs.getString(5));\n\t\t\t\t\t\tbean.setLastName(rs.getString(6));\n\t\t\t\t\t\tbean.setGender(rs.getString(7));\n\t\t\t\t\t\tbean.setDob(rs.getDate(8));\n\t\t\t\t\t\tbean.setEmailId(rs.getString(9));\n\t\t\t\t\t\tbean.setMobileNo(rs.getString(10));\n\t\t\t\t\t\tbean.setCourseName(rs.getString(11));\n\t\t\t\t\t\tbean.setCollegeName(rs.getString(12));\n\t\t\t\t\t\tbean.setSubjectName(rs.getString(13));\n\t\t\t\t\t\tbean.setCreatedBy(rs.getString(14));\n\t\t\t\t\t\tbean.setModifiedBy(rs.getString(15));\n\t\t\t\t\t\tbean.setCreatedDatetime(rs.getTimestamp(16));\n\t\t\t\t\t\tbean.setModifiedDatetime(rs.getTimestamp(17));\n\t\t\t\t\t\tlist.add(bean);\n\t\t\t\t\t}rs.close();\n\t\t\t}catch(Exception e){\n\t\t\t//\tlog.error(\"Database Exception ......\" , e);\n\t\t\t\tthrow new ApplicationException(\"Exception in list method of FacultyModel\");\n\t\t\t}finally {\n\t\t\tJDBCDataSource.closeConnection(conn);\t\n\t\t\t}\n\t\t//\tlog.debug(\"Faculty Model List method End\");\n\t\t\treturn list;\n\t\t}", "public static void structEMain(){\n\n //Displaying the menu options by using the system out method\n System.out.println(\"1 - Create a new Structural Engineer Profile\");\n System.out.println(\"2 - Search for Structural Engineer Profile\\n\");\n\n System.out.println(\"0 - Continue\");\n }", "public void showFavorites() {\n System.out.println(\"Mina favoriter: \" + myFavorites.size());\n for (int i = 0; i < myFavorites.size(); i++) {\n System.out.println(\"\\n\" + (i + 1) + \". \" + myFavorites.get(i).getTitle() +\n \"\\nRegissör: \" + myFavorites.get(i).getDirector() + \" | \" +\n \"Genre: \" + myFavorites.get(i).getGenre() + \" | \" +\n \"År: \" + myFavorites.get(i).getYear() + \" | \" +\n \"Längd: \" + myFavorites.get(i).getDuration() + \" min | \" +\n \"Betyg: \" + myFavorites.get(i).getRating());\n }\n }", "@Override\n @RequiresPermissions(\"em.emtype.query\")\n public void index() {\n List<EmType> list = EmType.dao.list();\n \n setAttr(\"list\", JsonKit.toJson(list));\n render(\"equipment_type_list.jsp\");\n }", "@ModelAttribute(\"faculdades\")\n public List<Faculdade> listaFaculdades() {\n return faculdadeService.buscarTodos();\n }", "void display() {\n for (int i = 0; i < this.questions.size(); i++)\n this.questions.get(i).display(i, gradeable());\n }", "static void listerMenu() {\n System.out.println(\n \"-------------------------------------\\n\" +\n \"Saisir une option :\\n\" +\n \"1 : Liste des hôtes\\n\" +\n \"2 : Liste des logements\\n\" +\n \"3 : Liste des voyageurs\\n\" +\n \"4 : Liste des réservations\\n\" +\n \"5 : Fermer le programme\"\n );\n switch (Menu.choix(5)) {\n case 1:\n GestionHotes.listerHotes();\n break;\n case 2:\n GestionLogements.listerLogements();\n break;\n case 3:\n GestionVoyageurs.listerVoyageurs();\n break;\n case 4:\n GestionReservations.listerReservations();\n break;\n case 5:\n System.exit(0);\n break;\n }\n }", "@UML(identifier=\"facsimile\", obligation=OPTIONAL, specification=ISO_19115)\n Collection<String> getFacsimiles();", "public void displayFoulsForTeamB(int fouls) {\n TextView foulsView = findViewById(R.id.team_b_fouls);\n foulsView.setText(String.valueOf(fouls));\n }", "public interface OnFacilitiesFragmentListener {\n\n void switchOfFacilities(boolean isShowBBq, boolean isShowToilet, boolean isShowBin\n , boolean isShowRestaurant, boolean isShowSupermarket);\n }", "private void displayTeams() {\n SwapTeamMembersController.calculateTeamConstraints();\n System.out.println(\"\\nTeams formed are:\");\n for (Team team: Team.allTeams) {\n System.out.println(Constraint.ANSI_GREEN + \"\\nThe team ID\\t\\t\\t\\t: \" + team.getTeamID() + Constraint.ANSI_RESET +\n \"\\nThe Project Assigned\\t: \" + team.getProjectAssigned().getProjectId() + \": \" + team.getProjectAssigned().getProjectTitle() +\n \"\\nThe team's fitness is\\t: \" + team.getTeamFitness());\n System.out.print(\"\\nThe Students IDs of students in this team are: \\n\");\n for (Student student: team.getStudentsInTeam()) {\n System.out.print(student.getId() + \"\\tName: \" + student.getFirstName() + \"\\t\\tGender : \" + student.getGender() + \"\\t\\tExperience : \" + student.getExperience() + \" years\\n\");\n }\n int j = 1;\n System.out.println(\"\\nConstraints met are (with weightage):\");\n for (Constraint c: team.getConstraintsMet()) {\n System.out.println(j + \". \" + c.getConstraintDescription() + \"\\t: \" + c.getWeightAge());\n j++;\n }\n }\n }", "private void showFullMenu() {\n final Menu[] menu = MenuFactory.showMenu();\n System.out.println(\"Food_Id\" + \"\\t\" + \"Food_Name\" + \"\\t\" + \"Price\" + \"\\t\" + \"Prepration_Time\");\n for (final Menu m : menu) {\n System.out.println(m.getFoodId() + \"\\t\" + m.getFoodName() + \"\\t\" + m.getPrice() + \"\\t\" + m.getPreprationTime());\n }\n }", "public void Display() {\n this.data.Display();\n System.out.print(\"POSSIBLE CONNECTING FLIGHTS: \\n\\n\");\n this.DisplayList(this.head);\n }", "public List<String> show () {\n\t\treturn userDao.show();\n\t}", "public void display(){\r\n System.out.println(\"The Vacancy Number is : \" + getVacancyNumber());\r\n System.out.println(\"The Designation is : \" + getDesignation());\r\n System.out.println(\"The Job Type is : \" + getJobType());\r\n }", "private void showAll() {\n getAll();\n //show persons\n MainActivity.instance().displayPersonsRunnable = new DisplayPersonsRunnable(MainActivity.instance());\n this.thread = new Thread(MainActivity.instance().displayPersonsRunnable);\n this.thread.start();\n }", "public void displayFoulsForTeamB(int fouls) {\r\n TextView foulsView = (TextView) findViewById(R.id.team_b_fouls);\r\n foulsView.setText(String.valueOf(fouls));\r\n }", "public void showteachers(){\n for (int i=0; i<tlist.size(); i++){\n System.out.println(tlist.get(i).getTeacher());\n }\n }", "public void list()\n {\n for(Personality objectHolder : pList)\n {\n String toPrint = objectHolder.getDetails();\n System.out.println(toPrint);\n }\n }", "private void ViewAccounts() {\n for (int k = 0; k < accountList.size(); k++) {\n\n System.out.print(k + \": \" + accountList.get(k) + \" || \");\n\n }\n }", "void showAll();", "private void showPeopleList() {\n\t\t// If we do not have network, show an error\n\t\tif(! NetworkUtils.isOnline(getActivity())) {\n\t\t\tLog.i(m_fragmentName, \"showPeopleList() - Cannot show people's list because Network is Not Available\");\n\t\t\t\n\t\t\tfinal String title = getStringFromResources(R.string.error);\n\t\t\tfinal String message = getStringFromResources(R.string.noNetwork);\n\t\t\tif (m_uiUpdater != null) {\n\t\t\t\tm_uiUpdater.showAlert(title, message);\n\t\t\t}\n\t\t\t\n\t\t\t// Show Login UI\n\t\t\tif(m_uiUpdater != null) {\n\t\t\t\tm_uiUpdater.showLoginUi();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If this Fragment is attached\n\t\tif (m_fragmentAttached.get() && getArguments() != null) {\n\t\t\t// Get the friend data from Bundle\n\t\t\tList<PersonInCircle> personInCircleData = getArguments()\n\t\t\t\t\t.getParcelableArrayList(PEOPLE_IN_CIRCLE_DATA_KEY);\n\n\t\t\tif (personInCircleData != null && personInCircleData.size() > 0) {\n\t\t\t\tm_lvFriendsList.setVisibility(View.VISIBLE);\n\n\t\t\t\t// Update the data\n\t\t\t\tm_personAdapter.updateData(personInCircleData);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tm_lvFriendsList.setVisibility(View.INVISIBLE);\n\n\t\t\t\tfinal String title = getStringFromResources(R.string.warning);\n\t\t\t\tfinal String message = getStringFromResources(R.string.emptyPeopleList);\n\t\t\t\tif (m_uiUpdater != null) {\n\t\t\t\t\tm_uiUpdater.showAlert(title, message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\tm_lvFriendsList.setVisibility(View.INVISIBLE);\n\n\t\t\tfinal String title = getStringFromResources(R.string.warning);\n\t\t\tfinal String message = getStringFromResources(R.string.emptyPeopleList);\n\t\t\tif (m_uiUpdater != null) {\n\t\t\t\tm_uiUpdater.showAlert(title, message);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic boolean showInList()\n\t{\n\t\treturn true;\n\t}", "public static void displayOneCharacter (List<Character> listCP){\n System.out.println(\"enter the index of your character : \");\n int ch = getUserChoice();\n System.out.println(listCP.get(ch));\n }", "@Override\n\tpublic String show(String userName) {\n\t\tShowFriendData data = new ShowFriendData();\n\t\tArrayList<String> doList = data.finds(\"F\"+data.find(userName)) ;\n\t\tString list = \"\" ;\n\t\tfor(String temp : doList){\n\t\t\tlist = list+temp+\";\";\n\t\t}\n\t\treturn list;\n\t}", "public void viewStudents(List<Student> studentList) {\n\t\tfor (Student student : studentList) {\n\t\t\tSystem.out.format(\"%5d | \", student.getId());\n\t\t\tSystem.out.format(\"%20s | \", student.getName());\n\t\t\tSystem.out.format(\"%5d | \", student.getAge());\n\t\t\tSystem.out.format(\"%20s | \", student.getAddress());\n\t\t\tSystem.out.format(\"%10.1f%n\", student.getGpa());\n\t\t}\n\t}", "public void displaymenu()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to the COMP2396 Authentication system!\");\r\n\t\tSystem.out.println(\"1. Authenticate user\");\r\n\t\tSystem.out.println(\"2. Add user record\");\r\n\t\tSystem.out.println(\"3. Edit user record\");\r\n\t\tSystem.out.println(\"4. Reset user password\");\r\n\t\tSystem.out.println(\"What would you like to perform?\");\r\n\t}", "private void displayList(Ticket[] tickets){\n clrscr();\n System.out.println(\"Welcome to Zendesk Tickets Viewer!\\n\");\n System.out.println(\"Displaying PAGE \" + pageNumber + \"\\n\");\n System.out.printf(\"%-6s%-60s%-14s\\n\", \"ID\", \"Subject\", \"Date Created\");\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n // Handles if API is unavailable\n if(tickets != null){\n for (Ticket t: tickets) {\n String s = t.getSubject();\n if(s.length() > 60){\n s = s.substring(0,58);\n s += \"..\";\n }\n System.out.printf(\"%-6s%-60s%-14s\\n\", t.getId(), s, sdf.format(t.getCreated_at()));\n }\n } else {\n System.out.println(\"Sorry! Failed to retrieve tickets. The API might be unavailable or Username / Token is incorrect\");\n }\n\n if(pageNumber > 1){\n System.out.print(\"<-- Previous Page (P) | \");\n }\n if(hasMore){\n System.out.println(\"Next Page (N) -->\");\n }\n System.out.println(\"\");\n System.out.println(\"View Ticket Details (-Enter ID Number-) | Quit (Q)\");\n System.out.println(\"\");\n if (hasMore && pageNumber > 1) {\n System.out.println(\"What would you like to do? ( P / N / Q / #ID )\");\n } else if (pageNumber > 1 && !hasMore){\n System.out.println(\"What would you like to do? ( P / Q / #ID )\");\n } else if (pageNumber == 1 && hasMore){\n System.out.println(\"What would you like to do? ( N / Q / #ID )\");\n } else {\n System.out.println(\"What would you like to do? ( Q / #ID )\");\n }\n }", "@Override\n\t\tpublic oep_ResponseInfo getfacultylistforreport() {\n\t\t\tString facultyquery=\"SELECT a.faculty_id, CONCAT(a.`username`,' - ',a.`email`) faculty_firstname FROM `faculty_master` a \"\n\t\t\t\t\t+ \" JOIN `course_master` c ON a.`main_subject`=c.`course_id` JOIN `course_scheduling` d ON d.`program_name`=c.`course_id` \"\n\t\t\t\t\t+ \" JOIN `test_schedule` e ON e.`batch`=d.`cs_id` GROUP BY a.`faculty_id`\";\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tList<Object> facultyList = jdbcTemplate.query(facultyquery, new RowMapper() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic Object mapRow(ResultSet rs, int arg1) throws SQLException {\n\t\t\t\t\n\t\t\t\t\tMap<String, Object> map = new HashMap<String, Object>();\n\t\t\t\t\tmap.put(\"facultyid\", rs.getString(\"faculty_id\"));\n\t\t\t\t\tmap.put(\"facultyname\", rs.getString(\"faculty_firstname\"));\n\t\t\t\t \n\t\t\t\t\treturn map;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tresponse.setResponseType(\"S\");\n\t\t\tresponse.setResponseObj(facultyList);\n\t\t\tresponseInfo.setInventoryResponse(response);\n\t\t\treturn responseInfo;\n\t\t}", "private static void listFormat() {\n\t\tSystem.out.println(\"List of all your movies\");\n\t\tSystem.out.println(\"=======================\");\n\t\tfor (int i = 0; i < movList.size(); i++) {\n\t\t\tSystem.out.println(movList.get(i));\n\t\t}\n\t}", "public void showFriends(){\n\t /*condition to check if friend list is empty*/ \n\t if(friend.isEmpty()){\n\t System.out.println(\"Sorry !! You Don't have any friend in your Friend list\\n\");\n\t }\n\t /*printing friend list*/\n\t else{\n\t System.out.println(\"\\nYour Friend List ---\");\n\t int p=0;\n\t for(Map.Entry<String,String>entry:friend.entrySet()){\n\t \n\t System.out.println(++p+\" \"+entry.getKey());\n\t \n\t }\n\t }\n\t }", "public void printWeaponList(List<Weapon> list) {\n\t\tSystem.out.println(\"**** Available Weapons ****\");\n\t\tSystem.out.println(\"ID\\tName\\t\\tDamage\\tEquipped\");\n\t\tSystem.out.println(\"============================================================================================\");\n\t\tint id = 1;\n\t\tfor(Weapon w : list) {\t\t\n\t\t\tSystem.out.printf(id++ + \"\\t\" + w.getName() + \"\\t\\t\"+ w.getWeaponDmg()+ \"\\t\");\n\t\t\tif(w.isEquipped()) {\n\t\t\t\tSystem.out.println(\"Y\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"N\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println();\t\n\t}", "public String showList() {\n String listMessage = \"Here yer go! These are all your tasks!\";\n return listMessage;\n }", "public String DisplayStudents()\n\t{\t\n\t\tString studentList= \"\";\n\t\tint i=1; //the leading number that is interated for each student\n\t\tfor(Student b : classRoll)\n\t\t{\n\t\t\tstudentList += i + \". \" + b.getStrNameFirst ( ) + \" \" + b.getStrNameLast () +\"\\n\";\n\t\t\ti++;\n\t\t}\n\t\treturn studentList= getCourseName() +\"\\n\" + getCourseNumber()+\"\\n\" + getInstructor()+ \"\\n\" + studentList;\n\t}", "void display()\n\t {\n\t\t System.out.println(\"Student ID: \"+id);\n\t\t System.out.println(\"Student Name: \"+name);\n\t\t System.out.println();\n\t }" ]
[ "0.6838592", "0.62999415", "0.6169286", "0.6005821", "0.5997261", "0.59841627", "0.5953024", "0.5936878", "0.58782804", "0.58432174", "0.57568884", "0.5743153", "0.5733594", "0.57099056", "0.56441784", "0.56176674", "0.5568156", "0.5562678", "0.55516493", "0.5539682", "0.5534746", "0.55288243", "0.5521177", "0.5508062", "0.5500938", "0.5495992", "0.5495769", "0.54916686", "0.5474347", "0.5459482", "0.5456002", "0.5452468", "0.5443258", "0.54401386", "0.5437406", "0.5418247", "0.54165643", "0.540345", "0.5390905", "0.5366763", "0.53579795", "0.53534067", "0.535107", "0.5349851", "0.53484297", "0.5342913", "0.5342401", "0.53401566", "0.5338688", "0.5332055", "0.5328903", "0.53140116", "0.530607", "0.5305346", "0.5303334", "0.5299983", "0.5298282", "0.5294339", "0.52874744", "0.52829754", "0.5280554", "0.52722716", "0.5271214", "0.5271152", "0.526911", "0.52689517", "0.52663016", "0.52616453", "0.5256044", "0.5250554", "0.5249289", "0.5247325", "0.5235181", "0.52306706", "0.52300084", "0.52290565", "0.52286255", "0.5221782", "0.522152", "0.52145183", "0.52101576", "0.5208366", "0.52083045", "0.5208078", "0.5198526", "0.5193304", "0.51918226", "0.5187882", "0.518594", "0.518094", "0.5179927", "0.5179066", "0.51773536", "0.51770246", "0.51744175", "0.5171092", "0.51699376", "0.5167235", "0.5163989", "0.5162481" ]
0.73419243
0
/ Other methods Shows all information about the club
public void show() { showMembers(); showFacilities(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getClubname() {\n\t\treturn clubname;\r\n\t}", "public void info() {\r\n System.out.println(\" Name: \" + name + \" Facility: \" + facility + \" Floor: \" + floor + \" Covid: \"\r\n + positive + \" Age: \" + age + \" ID: \" + id);\r\n }", "public String toString () {\r\n\t\treturn (\"\\nName: \" + this.getName()\r\n\t\t\t\t+\"\\nNationality: \" + this.getCountryName()\t\t\r\n\t\t\t\t+\"\\nAge: \"+ this.dob.playerAge() +\" years old \"+ this.getDob() \r\n\t\t\t\t+\"\\nCurrent team:\" + this.getClubName() \r\n\t\t\t\t+\"\\nPosition: Forward\" \r\n\t\t\t\t+\"\\nGames Played: \" + this.getGamesPlayed()\r\n\t\t\t +\"\\nGoals Scored: \" + this.getGoalsScored()\r\n\t\t +\"\\nGoals Assisted: \" + this.getNumAssists ()\r\n\t\t +\"\\nGoals Shot on Target: \" + this.getShotsOnTarget ()\r\n\t\t\t +\"\\nCautions:\"\r\n\t\t\t\t+\"\\nYellow Cards: \" + this.getNumYellowCards()\r\n\t\t\t\t+\"\\nRed Cards: \" + this.getNumRedCards()\r\n\t\t );\r\n\r\n\t\t}", "private void show() {\n System.out.println(team.toString());\n }", "public void getInfo() {\n System.out.println(\"Content : \" + content);\n System.out.println(\"Name : \" + name);\n System.out.println(\"Location : (\" + locX + \",\" + locY + \")\");\n System.out.println(\"Weight : \" + String.format(\"%.5f\", weight) + \" kg/day\");\n System.out.println(\"Habitat : \" + habitat);\n System.out.println(\"Type : \" + type);\n System.out.println(\"Diet : \" + diet);\n System.out.println(\"Fodder : \" + String.format(\"%.5f\", getFodder()) + \" kg\");\n System.out.println(tamed ? \"Tame : Yes \" : \"Tame : No \");\n System.out.println(\"Number of Legs : \" + legs);\n }", "private void viewPage(String club) throws JSONException, InterruptedException {\r\n logger.log(Level.INFO, \"Would you like to view the \" + \r\n club + \" clubpage? (y/n)\");\r\n \r\n // if yes, go to club page\r\n // else return to display prompt\r\n if(\"y\".equalsIgnoreCase(in.nextLine())) {\r\n \t Club clubToView = new Club(club);\r\n \t clubToView.printClubPromptsAndInfo(PolyClubsConsole.user instanceof ClubAdmin);\r\n }\r\n \r\n else \r\n displaySearch(); \r\n }", "private void list() throws JSONException, InterruptedException {\r\n\t /**Database Manager Object used to access mlab.com*/\r\n db.setDataBaseDestination(cDatabase, null, true);\r\n db.accessDatabase();\r\n MongoCollection<Document> col = db.getEntireDatabaseResults();\r\n \r\n // iterator to go through clubs in database\r\n Iterable<Document> iter;\r\n iter = col.find();\r\n \r\n // ArrayList of clubs names \r\n ArrayList<String> clubs = new ArrayList<>();\r\n \r\n // add names to list\r\n for (Document doc : iter) {\r\n JSONObject profile = new JSONObject(doc);\r\n clubs.add(profile.get(cName).toString());\r\n }\r\n \r\n Collections.sort(clubs);\r\n \r\n for (String name : clubs)\r\n \t logger.log(Level.INFO, name);\r\n \r\n displayOpen();\r\n }", "public void playerDetailedInfo(Player p){\n System.out.println(\"Indicator: \" + indicator + \"\\nJoker: \"+joker);\n System.out.println(\"Winner: Player\" + p.getPlayerNo());\n System.out.println(\"Tile size: \" + p.getTiles().size());\n System.out.println(\"Joker count: \" + p.getJokerCount());\n System.out.println(\"Double score: \" + p.getDoubleCount()*2);\n System.out.println(\"All tiles in ascending order:\\t\" + p.getTiles());\n System.out.println(\"Clustered according to number: \\t\" + p.getNoClus());\n System.out.println(\"Total number clustering score: \" + p.totalNoClustering());\n System.out.println(\"Clustered according to color: \\t\" + p.getColClus());\n System.out.println(\"Total color clustering score: \" + p.totalColCluster());\n System.out.println(\"Final score of Player\"+p.getPlayerNo()+\": \" + p.getPlayerScore());\n }", "public void displayAll() {\n\t\tSystem.out.println(\"Title \"+this.getTitle());\n\t\tSystem.out.println(\"Artist \"+this.getArtist());\n\t\tSystem.out.println(\"Genre \"+this.genre);\n\t}", "@Override\r\n public void display() { //implements abstract display() method from Division.java\r\n System.out.println(\"Division Name: \" + getDivisionName());\r\n System.out.println(\"Account Number: \" + getAccountNumber());\r\n\r\n System.out.println(\"Country: \" + getCountry());\r\n System.out.println(\"Language Spoken: \" + getLanguageSpoken() + \"\\n\");\r\n\r\n }", "void getInfo() {\n\tSystem.out.println(\"My name is \"+name+\" and I am going to \"+school+\" and my grade is \"+grade);\n\t}", "public void searchClub(String club) throws JSONException, InterruptedException{\r\n /**Database Manager Object used to access mlab.com*/\r\n db.setDataBaseDestination(cDatabase, club, false);\r\n db.accessDatabase();\r\n\r\n // club returned by search or null if no club found\r\n JSONObject clubName = db.getSingleDatabaseResults();\r\n \r\n // if club is in database, ask user if they would like to view club\r\n // else display message and return to search prompt\r\n if(clubName != null) {\r\n String name = clubName.get(cName).toString();\r\n viewPage(name);\r\n }\r\n else {\r\n logger.log(Level.INFO, \"The club you entered is \" +\r\n \"not in the database.\");\r\n displaySearch();\r\n } \r\n }", "private static void displayStatistics(){\n\n Scanner scanner = new Scanner(System.in);\n System.out.print(\"Please enter Club Name: \");\n String clubName = scanner.nextLine();\n leagueManager.displayStatistics(clubName);\n }", "public void displayAllInfo(){\nSystem.out.println(\"Dimensions of the room - length in feet : \" + room.getLengthInFeet() + \" width in feet :\" + room.getWidthInFeet());\nSystem.out.println(\"Price per square foot :\" + pricePerSquareFoot);\nSystem.out.println(\"Total Cost :\" + calculateTotalCost());\n}", "private void displayChampionshipDetails()\n {\n displayLine();\n System.out.println(\"########Formula 9131 Championship Details########\");\n displayLine();\n System.out.println(getDrivers().getChampionshipDetails());\n }", "@Override\n public void display(){\n System.out.println(\"Student id: \"+getStudentId()+\"\\nName is: \"+getName()+\"\\nAge :\"+getAge()+\"\\nAcademic year: \"+getSchoolYear()\n +\"\\nNationality :\"+getNationality());\n }", "public void courseInfo() {\n\t\tList<Course> unfinishedCourses = super.getUnfinishedCourses();\n\t\tList<Course> finishedCourses = super.getFinishedCourses();\n\n\t\tString retStr = \"Unfinished Courses: \";\n\t\tfor (int i = 0; i < unfinishedCourses.size(); i++) {\n \tretStr += unfinishedCourses.get(i);\n \tif (i != unfinishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nFinished Courses: \";\n\t\tfor (int i = 0; i < finishedCourses.size(); i++) {\n \tretStr += finishedCourses.get(i);\n \tif (i != finishedCourses.size()-1) {\n\t\t\t\tretStr += \", \";\n \t}\n\t\t}\n\t\tretStr += \"\\nHP: \" + this.hp;\n\t\tSystem.out.println(retStr);\n\t}", "@Override\n protected void display() {\n System.out.println(\"Welcome to team builder tool!\");\n System.out.println(\"Current team: \" + team.getName());\n }", "public String getClubName(){\n\t\tInteger clubid = 0;\r\n\t\tString clubname = \"\";\r\n\t\t\r\n\t\tScahaDatabase db = (ScahaDatabase) ContextManager.getDatabase(\"ScahaDatabase\");\r\n\t\t\r\n\t\ttry{\r\n\r\n \t\t\t\r\n\t\t\tVector<Integer> v = new Vector<Integer>();\r\n\t\t\tv.add(this.getProfid());\r\n\t\t\tdb.getData(\"CALL scaha.getClubforPerson(?)\", v);\r\n\t\t \r\n\t\t\tif (db.getResultSet() != null){\r\n\t\t\t\t//need to add to an array\r\n\t\t\t\trs = db.getResultSet();\r\n\t\t\t\t\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\tthis.clubid = rs.getInt(\"idclub\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\tLOGGER.info(\"We have results for club for a profile\");\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\tdb.cleanup();\r\n \t\t\r\n\t\t\t//now lets retrieve club name\r\n\t\t\tv = new Vector<Integer>();\r\n\t\t\tv.add(this.clubid);\r\n\t\t\tdb.getData(\"CALL scaha.getClubNamebyId(?)\", v);\r\n\t\t \r\n\t\t\tif (db.getResultSet() != null){\r\n\t\t\t\t//need to add to an array\r\n\t\t\t\trs = db.getResultSet();\r\n\t\t\t\t\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\tclubname = rs.getString(\"clubname\");\r\n\t\t\t\t}\r\n\t\t\t\tLOGGER.info(\"We have results for club name\");\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\tdb.cleanup();\r\n\t\t\t\r\n \t} catch (SQLException e) {\r\n \t\t// TODO Auto-generated catch block\r\n \t\tLOGGER.info(\"ERROR IN loading club by profile\");\r\n \t\te.printStackTrace();\r\n \t\tdb.rollback();\r\n \t} finally {\r\n \t\t//\r\n \t\t// always clean up after yourself..\r\n \t\t//\r\n \t\tdb.free();\r\n \t}\r\n\t\t\r\n\t\treturn clubname;\r\n\t}", "private ArrayList<Club> parseClubJSONInfo(String clubJSONInfo)\n\t{\n\t\tArrayList<Club> clubs = new ArrayList<Club>();\n\t\tClub c;\n\t\ttry\n\t\t{\n\t\t\tJSONObject jsonObject = new JSONObject(clubJSONInfo); //a big string of values\n\t\t\t\n\t\t\t//Club Data -- contains ALL clubs\n \t\tJSONArray clubsArray = jsonObject.getJSONArray(\"clubs\");\n \t\t\n \t\tif(clubsArray.length() > 0)\n \t\t{\n\t \t\t// Grab the first club\n \t\t\tfor(int y = 0; y < clubsArray.length(); y++) \n\t\t\t\t{\n \t\t\t\tJSONObject club = clubsArray.getJSONObject(y);\n\t\t\t\t\n\t\t\t\t\t// Take all the info from the club JSON file\n\t\t\t\t\t\n\t\t\t\t\t//get the geopoint from the lat and lon\n\t\t\t\t\tdouble latitude = Double.parseDouble(club.getString(\"lat\"));\n\t\t\t double lonitude = Double.parseDouble(club.getString(\"lon\"));\n\t\t\t LatLng marker = new LatLng(latitude, lonitude);\n\t\t\t\t\tGeoPoint geo = new GeoPoint((int) (latitude * 1E6), (int) (lonitude * 1E6));\n\t\t\t\t\t\n\t\t\t\t\tString name = club.getString(\"name\");\n\t\t\t\t\tString grounds = club.getString(\"grounds\");\n\t\t\t\t\tString description = club.getString(\"description\");\n\t\t\t\t\tString colours = club.getString(\"colours\");\n\t\t\t\t\tString website = club.getString(\"website\");\n\t\t\t\t\tString facebook = club.getString(\"facebook\");\n\t\t\t\t\tString twitter = club.getString(\"twitter\");\n\t\t\t\t\tString email = club.getString(\"email\");\n\t\t\t\t\tString phone = club.getString(\"phone\");\n\t\t\t\t\t\n\t\t\t\t\t//now fill out the description\n\t\t\t\t\tString info = \"\"; \n\t\t\t\t\tif(grounds.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Log.i(\"log_tag\", \"Grounds = \\\"\" + grounds + \"\\\"\");\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += grounds.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\n\" + grounds.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(description.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += description.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\n\" + description.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(colours.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Colours: \" + colours.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nColours: \" + colours.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(website.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Web: \" + website.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nWeb: \" + website.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(facebook.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Facebook: \" + facebook.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nFacebook: \" + facebook.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(twitter.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Twitter: \" + twitter.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nTwitter: \" + twitter.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(email.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Email: \" + email.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nEmail: \" + email.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(phone.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Phone: \" + phone.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nPhone: \" + phone.toString();\n\t\t\t\t\t}\n\t\t\t\t\t//Log.i(\"log_tag\", \"Info = \\\"\" + info + \"\\\"\");\n\t\t\t\t\tc = new Club(name.toString(), info, geo, marker);\n\t\t\t\t\tclubs.add(c);\n\t \t\t}\n \t\t\t\n \t\t\tCollections.sort(clubs);\n \t\t}\n\t\t\t\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tLog.e(\"log_tag\", \"Error creating JSON Objects:\" + e.toString());\n\t\t}\n\t\t\n\t\treturn clubs;\n\t}", "private ClubSearch() \r\n {\r\n in = new Scanner(System.in);\r\n db = DatabaseManager.getInstance();\r\n \r\n openPrompt = \"Would you like to search for a club, \" +\r\n \t \"filter by type of club, list clubs, or exit? (s/f/l/e)\";\r\n cDatabase = \"ClubDatabase\";\r\n cName = \"ClubName\";\r\n }", "@Override\n public String toString()\n {\n return albumName + ' ' + artistName + ' ' + genre + '\\n';\n }", "@RequestMapping(value = \"/associations/{id}/clubs\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic List<Club> getClubs(@PathVariable Long id) {\n\t\tlog.debug(\"REST request to get Association Clubs: {}\", id);\n\t\tClub example = new Club();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(id);\n\t\texample.setAssociation(exampleAssociation);\n\t\treturn clubRepository.findAll(Example.of(example));\n\t}", "public void showInfo()\n\t{\n\t\tSystem.out.println(\"Account Number : \"+getAccountNumber());\n\t\tSystem.out.println(\"Balance : \"+getBalance());\n\t\tSystem.out.println(\"Tenure Year : \"+tenureYear);\n\t}", "public void show()\n {\n System.out.println( getFullName() + \", \" +\n String.format(Locale.ENGLISH, \"%.1f\", getAcademicPerformance()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getSocialActivity()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getCommunicability()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getInitiative()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getOrganizationalAbilities())\n );\n }", "@Override\n public void showInfo() {\n System.out.println(\"Garage {\");\n System.out.println(\"\\tGarage is \" + (isBig ? \"big\" : \"small\"));\n int i = 0;\n for (T car : carsInGarage) {\n System.out.println(\"\\tCar №\" + i + \": \" + car.getShortInfo());\n i++;\n }\n System.out.println(\"}\");\n }", "@Override\n\tpublic String toString() {\n\n\t\treturn String.format(\"[%s] %s (%s)\", this.getId(), this.getNaam(), sport);\n\t}", "public void printAllCities()\n { // to be implemented in part (d) }\n }", "@Override\r\n//displays the property of defensive players to console\r\npublic String toString() {\r\n\t\r\n\tdouble feet = getHeight()/12;\r\n\tdouble inches = getHeight()%12;\r\n\t\r\n\treturn \"\\n\" + \"\\nDefensive Player: \\n\" + getName() \r\n\t+ \"\\nCollege: \" + getCollege() \r\n\t+ \"\\nHighschool: \" + getHighschool() \r\n\t+ \"\\nAge: \" + getAge() \r\n\t+ \"\\nWeight: \" + getWeight() \r\n\t+ \"\\nHeight: \" + feet + \" ft\" + \" \" + inches + \" in\" \r\n\t+ \"\\nTeam Number: \" + getNumber() \r\n\t+ \"\\nExperience: \" + getExperience()\r\n\t+ \"\\nTeam: \" + getTeam() \r\n\t+ \"\\nPosition: \" +getPosition() \r\n\t+ \"\\nTackles : \" + getTackles() \r\n\t+ \"\\nSacks: \" +getSacks() \r\n\t+ \"\\nInterceptions: \" + getInterceptions();\r\n}", "public String toString(){\n\t\treturn \"Title: \" + super.getTitle() + \", Copies Available: \" + super.getCopiesAvailable()+\", Artist: \" + artist + \", Songs: \" + songs;\n\t}", "public void printWorld()\n\t{\n\t\tSystem.out.println(\"***********************World Info*************************\");\n\t\tfor(int i = 0; i<gameObj.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < gameObj[i].size(); j++)\n\t\t\t\tSystem.out.println(gameObj[i].get(j).toString());\n\t\t}\n\t\tSystem.out.println(\"***********************World Info*************************\");\n\t}", "public void printUserInfo(){\n System.out.print(\"Username: \"+ getName() + \"\\n\" + \"Birthday: \"+getBirthday()+ \"\\n\"+ \"Hometown: \"+getHome()+ \"\\n\"+ \"About: \" +getAbout()+ \" \\n\"+ \"Subscribers: \" + getSubscriptions());\n\t}", "public void listOfCourses() {//admin cagirisa bulunna kurslarin hepsi\n if (Courses.size() != 0) {\n System.out.printf(\"%s kullanicisinin dersleri\\n\", this.getUsername());\n for (int i = 0; i < this.Courses.size(); ++i) {\n System.out.printf(\"%d-%s\\n\", i, Courses.get(i));\n }\n } else {\n System.out.printf(\"%s kullanicinin dersi yok\\n\", this.getUsername());\n }\n }", "void display() {\n System.out.println(id + \" \" + name);\n }", "public void showMembers() {\r\n\t\tfor(Member m: members) {\r\n\t\t\tm.show();\r\n\t\t}\r\n\t}", "public void getInfo() {\n\t\tSystem.out.println(\"My name is \"+ name+ \" and my last name is \"+ lastName);\n\t\t\n\t\tgetInfo1();// we can access static method within non static \n\t\t\n\t}", "public void printPlayerStatus() {\n System.out.println(getName() + \" owns \" +\n getOwnedCountries().size() + \" countries and \"\n + getArmyCount() + \" armies.\");\n\n String ownedCountries = \"\";\n for (Country c : getOwnedCountries())\n {\n ownedCountries += c.getCountryName().name() + \": \" + c.getArmyOccupied() + \"\\n\";\n }\n System.out.println (ownedCountries);\n }", "public void getInfo(){\n System.out.println(\"Name: \" + name + \"\\n\" + \"Address: \" + address);\n }", "private void viewCourses() {\n Iterable<Course> courses = ctrl.getCourseRepo().findAll();\n courses.forEach(System.out::println);\n }", "public void showInfo() {\n\t\tfor (String key : list.keySet()) {\n\t\t\tSystem.out.println(\"\\tID: \" + key + list.get(key).toString());\n\t\t}\n\t}", "public static List<String> getSpainCoach() throws URISyntaxException, IOException {\n\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/77\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Team66Pojo team66Pojo =objectMapper.readValue(response.getEntity().getContent(),Team66Pojo.class);\n List<Squad> squad = team66Pojo.getSquad();\n List<String> nameOfSpainTeamCoach= new ArrayList<>();\n for (int i = 0; i <squad.size() ; i++) {\n try {\n if(squad.get(i).getRole().equals(\"COACH\")){\n\n nameOfSpainTeamCoach.add(squad.get(i).getName());\n }\n }catch (NullPointerException e){\n continue;\n }\n\n }\n return nameOfSpainTeamCoach;\n }", "@Override\n public void information() {\n System.out.println(\"\");\n System.out.println(\"Dog :\");\n System.out.println(\"Age : \" + getAge());\n System.out.println(\"Name : \" + getName());\n System.out.println(\"\");\n }", "public static void main(String[] args) {\n\n\t\tSystem.out.println(\"\\n -----===< Club Manager >===----- \\n\");\n\t\tSystem.out.println(\"\tWelcome To The Club! \");\n\t\tprintProp(\" \tUser: \", \"user.name\");\n\t\tprintProp(\" \tOS arch: \", \"os.arch\");\n\t\tprintProp(\" \tOS name: \", \"os.name\");\n\t\tprintProp(\" \tOS version: \", \"os.version\");\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tGregorianCalendar calendar = new GregorianCalendar();\n\t\tSystem.out.println(\" \tDate: \" + sdf.format(calendar.getTime()));\n\t\tSystem.out.println(\" -----=====================-----\");\n\t\tSystem.out.println(\"\");\n\n\t\tfinal ClubHelper ch = new ClubHelper();\n\t\t\n\t\tif(args.length==0){\n\n\t\tMenu m = new Menu(ch);\n\t\tm.run();\n\n\t\t}\n/**\n*If --member is inprinted by the caller: a list of all members will be listed.\n* the method printMembersAll(); is found in CLubHelper \n*/\n\t\telse if(args[0].equals(\"--members\")){\n\t\t\tch.printMembersAll();\n\n/**\n*If --teams is inprinted by the caller: a list of all teams will be listed\n*the method printMembersAll(); is found in CLubHelper \n*/\n\t\t}\n\t\telse if(args[0].equals(\"--teams\")){\n\t\t\tch.printTeamsAll();\n\t\t\t\n\t\t}\n\t\t\n\t\t\n \t\t }", "public void info()\n {\n System.out.println(toString());\n }", "public String toString() {\r\n return this.title + \" by \" + this.artist;\r\n }", "private static void displayStat() {\n Collection<Zone> zones = Universe.getInstance().getCarte().getCarte().values();\r\n System.out.println(\"Nb de personnes créées : \" + Universe.getInstance().getCarte().getPopulation().size());\r\n\r\n\r\n System.out.println(\"Nb de personnes créées en mer : \" + getPopulationByTile(Zone.Tile.SEA));\r\n System.out.println(\"Nb de personnes créées en plaine : \" + getPopulationByTile(Zone.Tile.EARTH));\r\n System.out.println(\"Nb de personnes créées en foret : \" + getPopulationByTile(Zone.Tile.FOREST));\r\n System.out.println(\"Nb de personnes créées en ville : \" + getPopulationByTile(Zone.Tile.TOWN));\r\n\r\n System.out.println(\"---------------\");\r\n\r\n System.out.println(\"Surface mer : \" + getSurfaceByTile(zones, Zone.Tile.SEA));\r\n System.out.println(\"Surface plaine : \" + getSurfaceByTile(zones, Zone.Tile.EARTH));\r\n System.out.println(\"Surface foret : \" + getSurfaceByTile(zones, Zone.Tile.FOREST));\r\n System.out.println(\"Surface ville : \" + getSurfaceByTile(zones, Zone.Tile.TOWN));\r\n\r\n System.out.println(\"---------------\");\r\n\r\n System.out.println(\"Densité mer : \" + new Double(getPopulationByTile(Zone.Tile.SEA) / getSurfaceByTile(zones, Zone.Tile.SEA)));\r\n System.out.println(\"Densité plaine : \" + new Double(getPopulationByTile(Zone.Tile.EARTH)) / new Double(getSurfaceByTile(zones, Zone.Tile.EARTH)));\r\n System.out.println(\"Densité foret : \" + new Double(getPopulationByTile(Zone.Tile.FOREST)) / new Double(getSurfaceByTile(zones, Zone.Tile.FOREST)));\r\n System.out.println(\"Densité ville : \" + new Double(getPopulationByTile(Zone.Tile.TOWN)) / new Double(getSurfaceByTile(zones, Zone.Tile.TOWN)));\r\n\r\n System.out.println(\"---------------\");\r\n System.out.println(\"Surface mer deserte : \" +zones.stream().filter(z-> z.getTile().equals(Zone.Tile.SEA) && CollectionUtils.isEmpty(z.getHabitants())).collect(Collectors.toList()).size());\r\n System.out.println(\"Surface plaine deserte : \" +zones.stream().filter(z-> z.getTile().equals(Zone.Tile.EARTH) && CollectionUtils.isEmpty(z.getHabitants())).collect(Collectors.toList()).size());\r\n System.out.println(\"Surface foret deserte: \" +zones.stream().filter(z-> z.getTile().equals(Zone.Tile.FOREST) && CollectionUtils.isEmpty(z.getHabitants())).collect(Collectors.toList()).size());\r\n System.out.println(\"Surface ville deserte: \" +zones.stream().filter(z-> z.getTile().equals(Zone.Tile.TOWN) && CollectionUtils.isEmpty(z.getHabitants())).collect(Collectors.toList()).size());\r\n System.out.println(\"---------------\");\r\n\r\n System.out.println(\"Surface mer habitée : \" +zones.stream().filter(z-> z.getTile().equals(Zone.Tile.SEA) && CollectionUtils.isNotEmpty(z.getHabitants())).collect(Collectors.toList()).size());\r\n System.out.println(\"Surface plaine habitée : \" +zones.stream().filter(z-> z.getTile().equals(Zone.Tile.EARTH) && CollectionUtils.isNotEmpty(z.getHabitants())).collect(Collectors.toList()).size());\r\n System.out.println(\"Surface foret habitée: \" +zones.stream().filter(z-> z.getTile().equals(Zone.Tile.FOREST) && CollectionUtils.isNotEmpty(z.getHabitants())).collect(Collectors.toList()).size());\r\n System.out.println(\"Surface ville habitée: \" +zones.stream().filter(z-> z.getTile().equals(Zone.Tile.TOWN) && CollectionUtils.isNotEmpty(z.getHabitants())).collect(Collectors.toList()).size());\r\n }", "public void showInformation() {\n\t\tSystem.out.println(\"Title: \" + getTitle());\n\t\tSystem.out.println(\"Time: \" + getTime());\n\t\tSystem.out.println(\"Number: \" + getNumber());\n\t}", "public void printOut(){\n\t\tSystem.out.println(\"iD: \" + this.getiD());\n\t\tSystem.out.println(\"Titel: \" + this.getTitel());\n\t\tSystem.out.println(\"Produktionsland: \" + this.getProduktionsLand());\n\t\tSystem.out.println(\"Filmlaenge: \" + this.getFilmLaenge());\n\t\tSystem.out.println(\"Originalsprache: \" + this.getOriginalSprache());\n\t\tSystem.out.println(\"Erscheinungsjahr: \" + this.getErscheinungsJahr());\n\t\tSystem.out.println(\"Altersfreigabe: \" + this.getAltersFreigabe());\n\t\tif(this.kameraHauptperson != null) {\n\t\t\tSystem.out.println( \"Kameraperson: \" + this.getKameraHauptperson().toString() );\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println( \"Keine Kameraperson vorhanden \");\n\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tif ( this.listFilmGenre != null) {\n\t\t\tfor( FilmGenre filmGenre: this.listFilmGenre ){\n\t\t\t\tSystem.out.println(\"Filmgenre: \" + filmGenre);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person darsteller: this.listDarsteller ){\n\t\t\tSystem.out.println(\"Darsteller: \" + darsteller);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person synchronSpr: this.listSynchronsprecher ){\n\t\t\tSystem.out.println(\"synchro: \" + synchronSpr);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Person regi: this.listRegisseure ){\n\t\t\tSystem.out.println(\"regi: \" + regi);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tfor( Musikstueck mstk: this.listMusickstuecke ){\n\t\t\tSystem.out.println(\"Musikstueck: \" + mstk);\n\t\t}\n\t\tSystem.out.println(\"----------------------------\");\n\t\tSystem.out.println(\"Datentraeger: \" + this.getDatentraeger());\n\t\tSystem.out.println(\"----------------------------\");\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"View all teams\");\n\t\tSystem.out.println(teamData.viewTeams());\n\t\t\n\t\tSystem.out.println(\"Search by conference\");\n\t\tSystem.out.println(teamData.searchConference(\"AFC\"));\n\t\tSystem.out.println(teamData.searchConference(\"NFC\"));\n\t\t\n\t\tSystem.out.println(\"Search by division\");\n\t\tSystem.out.println(teamData.searchDivision(\"NFC\", \"West\"));\n\t\tSystem.out.println(teamData.searchDivision(\"NFC\", \"East\"));\n\t\t\n\t\tSystem.out.println(\"View team roster\");\n\t\tSystem.out.println(teamData.viewTeamRoster(\"Bears\"));\n\t\tSystem.out.println(teamData.viewTeamRoster(\"Cowboys\"));\n\t\t\n\t\tSystem.out.println(\"List player data\");\n\t\tSystem.out.println(teamData.listPlayer(\"Romo\", \"Cowboys\"));\n\t\tSystem.out.println(teamData.listPlayer(\"Brady\", \"Patriots\"));\n\t\t\n\t\tSystem.out.println(\"List all match results\");\n\t\t//System.out.println(teamData.readMatchData()); //lists all match results for all weeks\n\t\t\n\t\tSystem.out.println(\"List match results by week\");\n\t\tSystem.out.println(teamData.viewMatchWeek(\"Week 5\"));\n\t\t\n\t\tSystem.out.println(\"View single team's match data\");\n\t\tSystem.out.println(teamData.viewMatchByTeam(\"Falcons\"));\n\t\tSystem.out.println(teamData.viewMatchByTeam(\"Cowboys\"));\n\t\t\n\t\tSystem.out.println(\"View Head to Head (team vs team)\");\n\t\tSystem.out.println(teamData.viewH2H(\"Patriots\", \"Dolphins\"));\n\t\tSystem.out.println(teamData.viewH2H(\"Panthers\", \"Eagles\"));\n\t\t\n\t\tSystem.out.println(\"View specific team wins\");\n\t\tSystem.out.println(teamData.viewTeamWins(\"Panthers\"));\n\t\t\n\t\tSystem.out.println(\"View specific team loses\");\n\t\tSystem.out.println(teamData.viewTeamLoses(\"Titans\"));\n\t\t\n\t\t//Haven't tested this fully\n\t\t//System.out.println(teamData.getTeamImage(\"Cowboys\"));\n\t}", "@Override\r\n\tpublic String toString()\r\n\t{\n\t\treturn this.getChannelName()+\"\\t\"+this.getTitle();\r\n\t}", "void printCarInfo();", "@Override\n public void visualize() {\n if (this.count() > 0){\n for (int i = 0; i < this.count(); i++){\n System.out.println(i + \".- \" + this.bench.get(i).getName() + \" (ID: \" + this.bench.get(i).getId() + \")\");\n }\n } else {\n System.out.println(\"La banca está vacía.\");\n }\n\n }", "public void info(){\r\n System.out.println(\"Title : \" + title);\r\n System.out.println(\"Author . \" + author);\r\n System.out.println(\"Location : \" + location);\r\n if (isAvailable){\r\n System.out.println(\"Available\");\r\n }\r\n else {\r\n System.out.println(\"Not available\");\r\n }\r\n\r\n }", "private void doSomething(){\n System.out.println(\"Robodromo \" + theRobodrome.getName() +\n \"\\nrighe e colonne, \" + this.theRobodrome.getRowCount() +\n \", \" + this.theRobodrome.getColumnCount());\n System.out.println(theTraining.getDeck());\n }", "void display() {\r\n\t\tSystem.out.println(id + \" \" + name);\r\n\t}", "private static void showMatchedDeckInfo() {\n }", "@Override\r\n\tpublic void showlist() {\n int studentid = 0;\r\n System.out.println(\"请输入学生学号:\");\r\n studentid = input.nextInt();\r\n StudentDAO dao = new StudentDAOimpl();\r\n List<Course> list = dao.showlist(studentid);\r\n System.out.println(\"课程编号\\t课程名称\\t教师编号\\t课程课时\");\r\n for(Course c : list) {\r\n System.out.println(c.getCourseid()+\"\\t\"+c.getCoursename()+\"\\t\"+c.getTeacherid()+\"\\t\"+c.getCoursetime());\r\n }\r\n \r\n\t}", "public static String about(){\r\n\treturn \"This subclass Goblins is a Monster with higher hit points, while maintaining the same stats for the others. Meant to frustrate the player since it'll take longer to kill.\";\r\n\r\n }", "public void printAllcourses() {\n\t\tfor (int i = 0; i < CourseManager.courses.size(); i++) {\n\t\t\tSystem.out.println(i + 1 + \". \" + CourseManager.courses.get(i).getName() + \", Section: \" + CourseManager.courses.get(i).getSection());\n\t\t}\n\t}", "private void viewSavedCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < courseList.getCourseList().size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(courseList.getCourseList().get(i));\n } else {\n System.out.println((i + 1) + \": \" + courseList.getCourseList().get(i).getName());\n }\n }\n }", "public static void show(){\n // We will test all the APIs here\n System.out.println(\"Pasture seeds: \" + PastureSeed.count + \"\\tPasture product : \" + PastureProduct.count);\n System.out.println(\"Corn seeds: \" + CornSeed.count + \"\\t\\tCorn product : \" + CornProduct.count);\n System.out.println(\"Rice seeds: \" + RiceSeed.count + \"\\t\\tRice product : \" + RiceProduct.count);\n }", "@Override\r\n\tpublic void print() {\n\t\tsuper.print();\r\n\t\tSystem.out.println(\"album=\" + album + \", year=\" + year);\r\n\t}", "public void printMovieInfo() {\n println(\"Title : \" + this.movie.getTitle());\n println(\"Showing Status: \" + this.movie.getShowingStatus().toString());\n println(\"Content Rating: \" + this.movie.getContentRating().toString());\n println(\"Runtime : \" + this.movie.getRuntime() + \" minutes\");\n println(\"Director : \" + this.movie.getDirector());\n print(\"Cast : \");\n StringBuilder s = new StringBuilder();\n for (String r : movie.getCasts()) {\n s.append(r + \"; \");\n }\n println(s.toString());\n println(\"Language : \" + this.movie.getLanguage());\n println(\"Opening : \" + this.movie.getFormattedDate());\n\n print(\"Synopsis : \");\n println(this.movie.getSynopsis(), 16);\n\n if(movie.getRatingTimes() != 0 ){\n print(\"Overall Rating :\");\n printStars(movie.getOverAllRating());\n } else {\n println(\"Overall Rating: N/A\");\n }\n if (movie.getRatingTimes() != 0){\n for (Review r : movie.getReview()) {\n print(\"Review : \");\n println(r.getComment(), 16);\n print(\"Rating : \");\n printStars(r.getRating());\n }\n }\n }", "public void viewDetails(){\n for(int i = 0; i < roads.size(); i++){\n System.out.println(roads.get(i).getName());\n System.out.println(roads.get(i).getNorthStatus() + \" - \" + roads.get(i).getNorthAdvisory());\n System.out.println(roads.get(i).getSouthStatus() + \" - \" + roads.get(i).getSouthAdvisory() + \"\\n\");\n }\n }", "@Override\n public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int i) {\n Log.d(TAG, \"onBindViewHolder: \" + ((RecmdClubViewHolder) viewHolder).title);\n ((RecmdClubViewHolder) viewHolder).title.setText(mClubList.get(i).getName());\n //show joined clubs\n //String list of all club\n if (mClubJoined != null) {\n if (mClubList.get(i) != null) {\n if (mClubJoined.contains(mClubList.get(i).getName()))\n ((RecmdClubViewHolder) viewHolder).isJoined.setVisibility(View.VISIBLE);\n }\n }\n }", "public String toString() {\n\t\treturn super.toString() + \"\\nLevel: \" + getTitle(level) + edu.toString();\n\t}", "void display()\n\t {\n\t\t System.out.println(\"Student ID: \"+id);\n\t\t System.out.println(\"Student Name: \"+name);\n\t\t System.out.println();\n\t }", "public String printInfo() {\n\t\treturn \"\\n=====================================================================\"+\r\n\t\t\t\t\"\\n Gaming Center Information\"+\r\n\t\t\t\t\"\\n=====================================================================\"+\r\n\t\t\t\t\"\\n Gaming center Name \\t= \" + centerName +\r\n\t\t\t\t\"\\n Location \\t\\t= \" + location + \r\n\t\t\t\t\"\\n Contact Number \\t= \" + contact+\r\n\t\t\t\t\"\\n Operating hour \\t= \"+ operatingHour+\r\n\t\t\t\t\"\\n Number of Employee \\t= \"+ noOfEmployee+ \" pax\";\r\n\t}", "public String toString() {\r\n return \"Name: \" + this.name + \" | ID#: \" + this.id + \" | Photos: \" + this.photos + \" | Albums: \" + this.albums;\r\n }", "void display() {\n System.out.println(id + \" \" + name + \" \" + age);\n }", "public void displaySongInfo() {\n\t\tSystem.out.println(\"Track number: \" + this.trackNumber + \"\\n\");\n\t\tSystem.out.println(\"Title: \" + this.songTitle + \"\\n\");\n\t\tSystem.out.println(\"Composer_Name: \" + this.composerName + \"\\n\");\n\t\tSystem.out.println(\"Voices: \" + this.voiceMap.keySet() + \"\\n\");\n\t\tSystem.out.println(\"Meter: \" + this.meter + \"\\n\");\n\t\tSystem.out.println(\"Default note length: \" + this.Length_Default + \"\\n\");\n\t\tSystem.out.println(\"Tempo: \" + this.tempo + \"\\n\");\n\t\tSystem.out.println(\"Key signature: \" + this.key + \"\\n\");\n\t}", "@Override\n public String toString() {\n return info();\n }", "public GetMembers(String fn,String ln){\r\n\t\tfname = fn;\r\n\t\tlname = ln;\r\n\t\tmembers ++;\r\n\t\t\r\n\t\tSystem.out.printf(\"Constructor for %s %s, Members in the club %d.\\n\", fname,lname,members);\r\n\t}", "public String toString() {\r\n\t\treturn officialID + \", \" + officialName;\r\n\t}", "public ArrayList<String> showCity();", "public void printDetails()\n {\n super.printDetails();\n System.out.println(\"The author is \" + author + \" and the isbn is \" + isbn); \n }", "public void print()\n\t{\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\tSystem.out.println(\"*********************Player Info*******************************\");\n\t\t\tSystem.out.println(\"[Lives: \" + lives + \"][Score: \" + score + \n\t\t\t\t\t\t\t\"][Time: \" + gameTime + \"]\");\n\t\t\tSystem.out.println(\"*********************Player Info*******************************\");\n\t\t}else\n\t\t\tSystem.out.println(\"Spawn a player ship to view game info\");\n\t}", "private void printInfo()\n {\n if(currentRoom.getItems().size() >= 1)\n {\n System.out.println(\"\\n\" + \"Items in room are: \" );\n ArrayList<Item> items = currentRoom.getItems();\n \n for(Item i : items)\n {\n System.out.println(i.getItemName() + i.getDescription()); \n }\n \n }\n \n \n \n if(currentRoom.getWeapons().size() >= 1)\n {\n System.out.println(\"\\n\" + \"Weapons in room are: \" );\n \n ArrayList<Weapon> weapons = currentRoom.getWeapons();\n for(Weapon w : weapons)\n {\n System.out.println(w.getWeaponName() + w.getDescription());\n }\n \n }\n \n \n }", "public void printCourseDetails()\n {\n // put your code here\n System.out.println(\"Course \" + codeNo + \" - \" + title);\n }", "public void print() {\r\n System.out.print( getPlayer1Id() + \", \" );\r\n System.out.print( getPlayer2Id() + \", \");\r\n System.out.print(getDateYear() + \"-\" + getDateMonth() + \"-\" + getDateDay() + \", \");\r\n System.out.print( getTournament() + \", \");\r\n System.out.print(score + \", \");\r\n System.out.print(\"Winner: \" + winner);\r\n System.out.println();\r\n }", "public void printSpeciesData(){\n\n System.out.println(\"A \" + this.name + \" has \" + this.legs + \" legs, \" + this.numberOfWings +\n \" wings, it is \" + this.wingColor + \", and likes a plant called \" + this.favFlower);\n\n }", "private void viewActiveCourseList() {\n boolean detailed = yesNoQuestion(\"Would you like to look at the detailed version? (just names if no)\");\n\n System.out.println(\"The current active courses are:\\n \");\n for (int i = 0; i < activeCourseList.size(); i++) {\n if (detailed) {\n System.out.println((i + 1) + \":\");\n detailedCoursePrint(activeCourseList.get(i));\n } else {\n System.out.println((i + 1) + \": \" + activeCourseList.get(i).getName());\n }\n }\n\n }", "private void printInfo() {\n for (Coordinate c1 : originCells) {\n System.out.println(\"Origin: \" + c1.toString());\n }\n for (Coordinate c2 : destCells) {\n System.out.println(\"destination: \" + c2.toString());\n }\n for (Coordinate c3 : waypointCells) {\n System.out.println(\"way point: \" + c3.toString());\n }\n }", "public String toString(){\n return name + \"|Pop: \" + pop + \"|Gdp: \" +gdp + \"|Social: \" +social + \"|Living: \" + living;\n }", "@Override\n public String toString() {\n return bestCommunity + \"\";\n }", "private void showAvailableCourts()\n {\n Scanner in=new Scanner(System.in);\n try\n {\n \n \n Scanner sc= new Scanner(System.in); \n System.out.println(\"Enter the Sport Name u want to Play :\");\n System.out.println(\"Basketball\\nBadminton\" );\n String sportName = sc.nextLine();\n Sport s = sportsClub.findSport(sportName); \n if(s == null)\n {\n System.out.println(\"No Sport Found\");\n }\n else\n {\n System.out.println(\"=========Available List==========\");\n }\n for(Court co : s.getCourtList())\n {\n System.out.println(\"Court number :\" + co.getCourtId());\n } \n System.out.println(\"=====================================\");\n }\n \n catch(Exception e)\n {\n System.out.println(\"Exception\"+e);\n }\n}", "public void Blueprint(){\r\n System.out.println(\"House features:\\nSquare Footage - \" + footage + \r\n \"\\nStories - \" + stories + \"\\nBedrooms - \" + bedrooms + \r\n \"\\nBathrooms - \" + bathrooms + \"\\n\");\r\n }", "public void printInfo() {\r\n System.out.printf(\"%-25s\", \"Nomor Rekam Medis Pasien\");\r\n System.out.println(\": \" + getNomorRekamMedis());\r\n System.out.printf(\"%-25s\", \"Nama Pasien\");\r\n System.out.println(\": \" + getNama());\r\n System.out.printf(\"%-25s\", \"Tempat, Tanggal Lahir\");\r\n System.out.print(\": \" + getTempatLahir() + \" , \");\r\n getTanggalKelahiran();\r\n System.out.printf(\"%-25s\", \"Alamat\");\r\n System.out.println(\": \" + getAlamat());\r\n System.out.println(\"\");\r\n }", "public void list()\n {\n for(Personality objectHolder : pList)\n {\n String toPrint = objectHolder.getDetails();\n System.out.println(toPrint);\n }\n }", "public void showMemberCategoryMenu() {\n System.out.println(\"Visa lista med: \");\n System.out.println(\"\\t1. Barnmedlemmar\");\n System.out.println(\"\\t2. Ungdomsmedlemmar\");\n System.out.println(\"\\t3. Vuxenmedlemmar\");\n System.out.println(\"\\t4. Seniormedlemmar\");\n System.out.println(\"\\t5. VIP-medlemmar\");\n System.out.print(\"Ange val: \");\n }", "public abstract void displayInfo();", "void display()\r\n\t{\r\n\t\tSystem.out.println(\"bikeid=\"+bikeid+\" bike name==\"+bikename);\r\n\t}", "private void displayGameHeader()\n {\n System.out.println(\"########Welcome to Formula 9131 Championship########\");\n }", "public static void main(String[] args) {\n\t\tMap<Club,Map<String,List<Player>>> complexMap = PlayerDB.fetchAllPlayers().stream()\r\n\t\t.collect(Collectors.groupingBy(Player::getClub, Collectors.groupingBy(player -> {\r\n\t\t\tPlayer p = (Player)player;\r\n\t\t\treturn p.getAge() <=33 ? \"young\": \"old\";\r\n\t\t})));\r\n\t\t\r\n\t\t//System.out.println(complexMap);\r\n\t\t\r\n\t\tMap<Club,Long> countKing = PlayerDB.fetchAllPlayers().stream()\r\n\t\t.collect(Collectors.groupingBy(Player::getClub, Collectors.counting()));\r\n\t\tSystem.out.println(countKing);\r\n\t}", "public void display(){\r\n \r\n System.out.println(\"\\n\\nHigh Population City\");\r\n highPop.display();\r\n System.out.println(\"Capital City\");\r\n capital.display();\r\n System.out.print(\"State Name: \" + stateName + \"\\nState Population: \" + statePop + \"\\n------------\");\r\n }", "public void showCities()\n {\n \tSystem.out.println(\"CITY LIST\");\n \t\n \tfor (int i = 0; i < cityNumber; i++)\n \t{\n \t\tSystem.out.println(city[i]);\n \t}\n }", "public void display() {\n \n //Print the features representation\n System.out.println(\"\\nDENSE REPRESENTATION\\n\");\n \n //Print the header\n System.out.print(\"ID\\t\");\n for (short i = 0 ; i < dimension; i++) {\n System.out.format(\"%s\\t\\t\", i);\n }\n System.out.println();\n \n //Print all the instances\n for (Entry<String, Integer> entry : mapOfInstances.entrySet()) {\n System.out.format(\"%s\\t\", entry.getKey());\n for (int i = 0; i < vectorDimension(); i++) {\n //System.out.println(allFeatures.get(entry.getValue())[i]);\n System.out.format(\"%f\\t\", allValues.get(entry.getValue())[i]); \n }\n System.out.println();\n }\n }", "@Override\n public String toString() {\n return(this.name + \": \" + this.bust + \", \" + this.chest +\n \", \" + this.waist + \", \" + this.inseam);\n }", "public void showHouses() {\n System.out.println(\"-----Houses List-----\");\n System.out.println(\"No\\tOwner\\tPhone\\t\\tAddress\\t\\t\\t\\tRent\\tState\");\n houseService.listHouse();\n System.out.println(\"------List Done------\");\n }", "private void displaySchalorship() {\n\n for (Scholarship scholarship : scholarshipDatabase) {\n\n stdOut.println(scholarship.toString() + \"\\n\");\n\n }\n }" ]
[ "0.69089514", "0.65345204", "0.6402487", "0.63700545", "0.6322894", "0.62478834", "0.6211397", "0.6159548", "0.6138739", "0.6118039", "0.60825247", "0.60365146", "0.60152626", "0.5978418", "0.5977409", "0.59773105", "0.5968088", "0.5916202", "0.59043366", "0.5873254", "0.58673877", "0.5864187", "0.58521515", "0.5845793", "0.58229", "0.58102405", "0.57888997", "0.5787971", "0.57823676", "0.5767643", "0.57522273", "0.5741822", "0.57332957", "0.5732724", "0.57206005", "0.5718254", "0.5711105", "0.5708601", "0.57006377", "0.5683856", "0.5683747", "0.56825835", "0.5676577", "0.56723696", "0.56681913", "0.56597364", "0.56518656", "0.565134", "0.5645069", "0.5643247", "0.5642194", "0.5634206", "0.5631558", "0.56220794", "0.5617182", "0.5616772", "0.56112915", "0.5606813", "0.56058997", "0.56014216", "0.559291", "0.5589687", "0.5574462", "0.55739975", "0.5564858", "0.5563695", "0.55633736", "0.55552155", "0.55459845", "0.5543528", "0.5539708", "0.55331403", "0.5528709", "0.5528318", "0.55242366", "0.5522606", "0.5521829", "0.5519271", "0.5517713", "0.55143446", "0.55140954", "0.5509355", "0.5508567", "0.55046934", "0.5503757", "0.55032665", "0.55021304", "0.55010426", "0.54982513", "0.54937184", "0.5490522", "0.5484674", "0.54836494", "0.547576", "0.54753035", "0.5473939", "0.5473825", "0.5472244", "0.54707694", "0.54706067" ]
0.5870853
20
AccessToken mAccessToken; User mUser;
@Override public void onCreate() { super.onCreate(); //是不是第一次打开此app // initSplashed(); //缓存文件 // initCache(); // initUser(); // initAccessToken(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected AccessToken getAccessToken() \n\t{\n\t\treturn accessToken;\n\t}", "public AccessToken getAccessToken() {\n return token;\n }", "public interface OauthAccessToken {\n byte[] getAuthentication();\n\n String getTokenId();\n\n String getAuthenticationId();\n\n byte[] getToken();\n\n void setTokenId(String tokenId);\n\n void setToken(byte[] token);\n\n void setAuthenticationId(String authenticationId);\n\n void setUsername(String username);\n\n void setAuthentication(byte[] authentication);\n\n void setRefreshToken(String refreshToken);\n\n void setClientId(String clientId);\n}", "public String getAccessToken();", "public String getAccessToken() {\n return accessToken;\n }", "void setOAuthAccessToken(AccessToken accessToken);", "public String getAccessToken() {\n return accessToken;\n }", "AccessToken getOAuthAccessToken(RequestToken requestToken) throws MoefouException;", "AccessToken getOAuthAccessToken() throws MoefouException;", "void setAccessToken(String accessToken);", "public String getAccessToken() {\n return accessToken;\n }", "public interface AccessTokenService extends Managed{\n public UserSession createAccessToken(UserSession userSession);\n\n public UserSession getUserFromAccessToken(String accessToken);\n\n public boolean isValidToken(String accessToken);\n\n public void removeAccessToken(String accessToken);\n\n public void removeUser(String userName);\n\n}", "public String getAccessToken(){\n //return \"3be8b617e076b96b2b0fa6369b6c72ed84318d72\";\n return MobileiaAuth.getInstance(mContext).getCurrentUser().getAccessToken();\n }", "String getAccessToken();", "String getAccessToken();", "@Transient\n\tpublic String getAccessToken() {\n\t\treturn accessToken;\n\t}", "@Override\n public Completable setAccessToken(DomainUserModel user) {\n return userService.setAccessToken(user);\n }", "public void setCurrentAccessToken() {\n String userAccessToken = null;\n String moderatorAccessToken = null;\n // Get tokens of local user and logged in moderator if existing.\n localUser = getLocalUser();\n if (localUser != null) {\n userAccessToken = localUser.getServerAccessToken();\n }\n if (loggedInModerator != null) {\n moderatorAccessToken = loggedInModerator.getServerAccessToken();\n }\n // Use the access token of the local moderator if available (logged in).\n accessToken = moderatorAccessToken;\n if (accessToken == null) {\n // Otherwise, use the access token of the local user.\n accessToken = userAccessToken;\n }\n }", "public String getAccessToken() {\n\t\treturn accessToken;\n\t}", "public String getAccessToken() {\n\t\treturn accessToken;\n\t}", "public void setAccessToken (AccessToken accessToken)\n\t{\n\t\tthis.accessToken = accessToken;\n\t}", "public interface OAuthTokenStoreAdapter {\n\n void storeAccessToken(AccessToken token);\n AccessToken retrieveAccessToken(String value);\n\n void storeRefreshToken(RefreshToken token);\n RefreshToken retrieveRefreshToken(String value);\n}", "public String getAccessToken () {\n\t\treturn this.accessToken;\n\t}", "public static String getAccessToken() {\n return accessToken;\n }", "@Override\n public void onResponse(String response) {\n\n try {\n\n SharedPreferences.Editor editor = prefs.edit();\n JSONObject data= new JSONObject(response);\n String token = data.getString(\"access_token\");\n editor.putString(\"token\", token);\n\n getDatosUser(usuario,token);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }", "@Nullable\n public String getAccessToken() {\n return accessToken;\n }", "@Api(1.0)\n @NonNull\n public String getAccessToken() {\n return mAccessToken;\n }", "@Override\n\t\t\t\t\tpublic void onSuccess(AccessToken token, UserClass.User user) {\n\t\t\t\t\t\tUtilUser.currentUser = user;\n\t\t\t\t\t\tUtilUser.currentToken = token;\n\t\t\t\t\t\tSystem.out.println(\"success\");\n\t\t\t\t\t\tSystem.out.println(\"user : \" + token.getUserId());\n\t\t\t\t\t\tSystem.out.println(\"username : \");\n\t\t\t\t\t\tIntent i = new Intent(getContext(), DrawerActivity.class);\n\t\t\t\t\t\tstartActivity(i);\n\t\t\t\t\t\tgetActivity().finish();\n\n\t\t\t\t\t}", "public User getUser(){return this.user;}", "@Override\n protected void onCompleted(User result) {\n mSession.storeAccessToken(result.getAccessToken(), result.getId(), result.getUsername(),\n result.getFullName());\n \n // Notify caller application\n callback.notifyCompleted();\n }", "public void setAccessToken(String accessToken) {\n mAccessToken = accessToken;\n retrieveAllUserData();\n }", "public static void setAccessToken(String accessToken) {\n }", "interface GetAccessTokenCallback {\n /**\n * Invoked on the UI thread if a token is provided by the AccountManager.\n *\n * @param token Access token, guaranteed not to be null.\n */\n void onGetTokenSuccess(AccessTokenData token);\n\n /**\n * Invoked on the UI thread if no token is available.\n *\n * @param isTransientError Indicates if the error is transient (network timeout or\n * unavailable, etc) or persistent (bad credentials, permission denied, etc).\n */\n void onGetTokenFailure(boolean isTransientError);\n }", "public void setAccessToken(String accessToken) throws IOException {\n this.accessToken = accessToken;\n fetchUserProfile();\n }", "private void getAccessToken(final String code, final OperationCallback<User> callback) {\n \n new Thread() {\n @Override\n public void run() {\n Log.i(TAG, \"Getting access token\");\n try {\n String postData = \"client_id=\" + CLIENT_ID + \"&client_secret=\" + CLIENT_SECRET +\n \"&grant_type=authorization_code\" + \"&redirect_uri=\" + CALLBACK_URL + \"&code=\" + code;\n String response = postRequest(TOKEN_URL, postData);\n \n Log.i(TAG, \"response \" + response);\n JSONObject jsonObj = (JSONObject) new JSONTokener(response).nextValue();\n \n mAccessToken = jsonObj.getString(\"access_token\");\n Log.i(TAG, \"Got access token: \" + mAccessToken);\n \n Gson gson = new Gson();\n User user = gson.fromJson(jsonObj.getJSONObject(\"user\").toString(), User.class);\n user.setAccessToken(mAccessToken);\n \n callback.notifyCompleted(user);\n } catch (Exception ex) {\n callback.notifyError(ex);\n Log.e(TAG, \"Error getting access token\", ex);\n }\n \n }\n }.start();\n }", "private void retrieveAccessToken() {\n Log.d(TAG, \"at retreiveAccessToken\");\n String accessURL = TWILIO_ACCESS_TOKEN_SERVER_URL + \"&identity=\" + \"1234\" + \"a\";\n Log.d(TAG, \"accessURL \" + accessURL);\n Ion.with(this).load(accessURL).asString().setCallback(new FutureCallback<String>() {\n @Override\n public void onCompleted(Exception e, String accessToken) {\n if (e == null) {\n Log.d(TAG, \"Access token: \" + accessToken);\n MainActivity.this.accessToken = accessToken;\n registerForCallInvites();\n } else {\n Toast.makeText(MainActivity.this,\n \"Error retrieving access token. Unable to make calls\",\n Toast.LENGTH_LONG).show();\n Log.d(TAG, e.toString());\n }\n }\n });\n }", "@Override\n public void acceptVisitor(AuthServiceVisitor visitor) {\n visitor.visitAccessToken(this);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(requestCode==request_Code){\n AuthenticationResponse response = AuthenticationClient.getResponse(resultCode,data);\n if(response.getType()==AuthenticationResponse.Type.TOKEN){\n accessToken = response.getAccessToken();\n }else{\n }\n }\n new SpotifyNewRelease(accessToken).execute();\n }", "@Override\n public void onResponse(String response) {\n Log.d(\"POST\", \"SUCCESS: \" + response);\n\n try {\n JSONObject jsonObject = new JSONObject(response);\n Users newUser = Users.getInstance();\n newUser.setAccessToken(jsonObject.getString(context.getString(R.string.api_access_token)));\n// newUser.setEmail(jsonObject.getString(context.getString(R.string.api_email)));\n newUser.setUserId(jsonObject.getString(context.getString(R.string.api_user)));\n// newUser.setName(jsonObject.getString(context.getString(R.string.api_name)));\n Log.d(\"POST\", \"NEW USER \" + newUser.getEmail() + \" \" + newUser.getAccessToken() + \" \" + newUser.getUserId());\n } catch (JSONException | NullPointerException e) {\n e.printStackTrace();\n }\n }", "AccessToken getOAuthAccessToken(RequestToken requestToken, String oauthVerifier) throws MoefouException;", "private void login() {\n User user;\n SharedPreferences preferences = context.getSharedPreferences(context.getString(R.string.user_shared_preferences), MODE_PRIVATE);\n preferences.edit().putLong(context.getString(R.string.user_id), -1).apply();\n if(preferences.getLong(context.getString(R.string.user_id), -1) != -1){\n user = User.getUser();\n }\n else{\n Globals.showDialog(\"New User\",\"Choose a user name\", LoginActivity.this);\n\n }\n user = new User();\n\n HttpUserService userService = new HttpUserService();\n Call<User> call = userService.login(user.getId());\n\n call.enqueue(new Callback<User>() {\n @Override\n public void onResponse(Call<User> call, Response<User> response) {\n asyncLogin(response);\n\n\n }\n\n @Override\n public void onFailure(Call<User> call, Throwable t) {\n Globals.showConnectionDialog(LoginActivity);\n\n }\n });\n }", "@Override\n protected OAuth2AccessToken getAccessToken(ClientDetails client, TokenRequest tokenRequest) {\n final String clientId = client.getClientId();\n if (clientId == null) {\n log.error(\"Failed to authenticate client {}\", clientId);\n throw new InvalidRequestException(\"Unknown Client ID.\");\n }\n\n MobileIDSession mobileIDSession = mobileIdSessionStore.get();\n boolean isComplete = mobileIdAuthService.isLoginComplete(mobileIDSession);\n\n if(!isComplete) {\n throw new MobileIdAuthNotCompleteException();\n }\n\n User user = userRepository.findByPersonalCode(mobileIDSession.personalCode);\n\n if (user == null) {\n log.error(\"Failed to authenticate user: couldn't find user with personal code {}\", mobileIDSession.personalCode);\n throw new InvalidRequestException(\"INVALID_USER_CREDENTIALS\");\n }\n\n Authentication userAuthentication = new PersonalCodeAuthentication(user, mobileIDSession, null);\n userAuthentication.setAuthenticated(true);\n\n final OAuth2Request oAuth2Request = tokenRequest.createOAuth2Request(client);\n final OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(oAuth2Request,\n userAuthentication\n );\n\n return getTokenServices().createAccessToken(oAuth2Authentication);\n }", "void onGetTokenSuccess(AccessTokenData token);", "public Token createAuthorizationToken(User user);", "public void setAccessToken(String accessToken) {\n\t\tthis.accessToken = accessToken;\n\t}", "public void setAccessToken(String accessToken) {\n\t\tthis.accessToken = accessToken;\n\t}", "public static String getAccessToken() {\n return \"\";\n }", "public interface IOauthService {\n\n @POST(\"/auth/token/\")\n void getAccessToken(@Body AccessTokenRequest accessTokenRequest,\n Callback<AccessTokenResponse> responseCallback);\n\n\n}", "public interface AccessTokenCallback<T> {\n void onError(Throwable th);\n\n void onSuccess(T t);\n }", "Future<String> getAccessToken(OkapiConnectionParams params);", "@Override\n public void onSuccess(LoginResult loginResult) {\n GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(),\n new GraphRequest.GraphJSONObjectCallback() {\n @Override\n public void onCompleted(JSONObject object, GraphResponse response) {\n try{\n email = object.getString(\"email\");\n name = object.getString(\"name\");\n\n } catch (JSONException ex) {\n ex.printStackTrace();\n Log.e(\"error\",ex.getMessage());\n }\n CheckUserOnPArse();\n\n }\n });\n Bundle parameters = new Bundle();\n parameters.putString(\"fields\",\"id,name,email\");\n request.setParameters(parameters);\n request.executeAsync();\n }", "public boolean setAccessToken(JSONObject response){\n boolean ret=false;\n Log.d(TAG, \"setAccessToken: \"+response);\n SharedPreferences.Editor editor=context.getSharedPreferences(Const.LINKAI_SHAREDPREFERENCE_FILE,Context.MODE_PRIVATE).edit();\n try {\n editor.putString(\"access_token\",response.getString(\"access_token\"));\n editor.putString(\"token_type\",response.getString(\"token_type\"));\n editor.putLong(\"expires_in\",Long.valueOf(response.getString(\"expires_in\")));\n// editor.putLong(\"expires_in\",10000);\n editor.putLong(\"token_timestamp\",new Date().getTime());\n editor.commit();\n ret=true;\n }catch (Exception e){\n e.printStackTrace();\n }\n return ret;\n }", "public static Oauth2AccessToken readAccessToken() {\n Oauth2AccessToken token = new Oauth2AccessToken();\n SharedPrefWrapper sharedPref = SharedPrefWrapper.getInstance();\n\n token.setUid(sharedPref.getWeiboUID());\n token.setToken(sharedPref.getWeiboAccessToken());\n token.setExpiresTime(sharedPref.getWeiboExpiresTime());\n return token;\n }", "public AuthToken loginUser(){\n return null;\n }", "public User getUser() { return this.user; }", "public java.lang.String getOauth_token(){\r\n return localOauth_token;\r\n }", "AccessToken getOAuthAccessToken(String oauthVerifier) throws MoefouException;", "public interface TokenProvider {\n /**\n * @return an always valid access token.\n */\n String getAccessToken();\n\n /**\n * Forces a refresh of all tokens.\n *\n * @return the newly refreshed access token.\n */\n String refreshTokens();\n}", "private void handleFacebookAccessToken(AccessToken token) {\n Log.d(TAG, \"handleFacebookAccessToken:\" + token);\n // [START_EXCLUDE silent]\n showProgressDialog();\n // [END_EXCLUDE]\n\n if (token == null) return;\n AuthCredential credential = FacebookAuthProvider.getCredential(token.getToken());\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"signInWithCredential:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n hideProgressDialog();\n if (!task.isSuccessful()) {\n Log.w(TAG, \"signInWithCredential\", task.getException());\n Toast.makeText(LogInActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n }\n else\n {\n currentUser = task.getResult().getUser();\n General.SetStringData(getApplicationContext(), Constants.FACEBOOK_LOGIN, \"true\");\n General.SetStringData(getApplicationContext(), Constants.GOOGLE_LOGIN, \"false\");\n General.SetStringData(getApplicationContext(), Constants.EMAIL_LOGIN, \"false\");\n // General.ShowToast(getApplicationContext(), \"Success\");\n General.currentUser = currentUser;\n Google_FacebookUserUpdate();\n }\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n\n }\n });\n }", "public void retrieveAccessToken(Context context) {\n PBookAuth mPBookAuth = mApplicationPreferences.getPBookAuth();\n if (mPBookAuth == null || TextUtils.isEmpty(mPBookAuth.getClientName())) {\n view.onReturnAccessToken(null, false);\n return;\n }\n Ion.with(context).load(ACCESS_TOKEN_SERVICE_URL).setBodyParameter(\"client\", mPBookAuth.getClientName()).setBodyParameter(\"phoneNumber\", mPBookAuth.getPhoneNumber()).setBodyParameter(\"platform\", PLATFORM_KEY).asString().setCallback(new FutureCallback<String>() {\n @Override\n public void onCompleted(Exception e, String accessToken) {\n if (e == null || !TextUtils.isEmpty(accessToken)) {\n mApplicationPreferences.setTwilioToken(accessToken);\n view.onReturnAccessToken(accessToken, true);\n } else {\n view.onReturnAccessToken(accessToken, false);\n }\n }\n });\n }", "@Transactional\n\tprivate void saveOrUpdateAccessToken() {\n\t\tString tfw = null;\n\t\ttry {\n\t\t\ttfw = this.getAccessTokenFromWechatServer();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (tokenConstant == null) {\n\t\t\ttokenConstant = new AccessToken();\n//\t\t\tconstant.setKey(Consts.access_token_key_in_db);\n//\t\t\tconstant.setValue(tfw);\n//\t\t\ttokenConstant.setUpdateTime(new Date());\n//\n//\t\t\tthis.tokenConstant = constant;\n//\t\t\tthis.constantMapper.insert(constant);\n\t\t\tlog.info(\"第一次获取accessToken\");\n\t\t}\n//\t\telse {\n//\t\t\tconstant.setValue(tfw);\n//\t\t\tconstant.setUpdateTime(new Date());\n//\n//\t\t\tthis.tokenConstant = constant;\n//\t\t\tthis.constantMapper.updateAccessToken(constant);\n//\t\t\tlog.info(\"accessToken已经更新\");\n//\t\t}\n\t\tWechatConsts.param_access_token=tfw;\n\t\t\n\t\ttokenConstant.setAccess_token(tfw);\n\t\ttokenConstant.setUpdateTime(new Date());\n\t}", "public String userToken() {\n return userToken;\n }", "public User getUserData();", "UserWithPersistedAuth getUserWithToken();", "@Override\n public User getUser() {\n return user;\n }", "@Override\n public User getUser() {\n return user;\n }", "private void getUserInfo(boolean checkAccessTokenResult, final AccessToken accessToken) {\n if (!checkAccessTokenResult) {\n //access token is not valid refresh\n RequestParams params = new RequestParams(WeChatManager.getRefreshAccessTokenUrl(sURLRefreshAccessToken, accessToken));\n x.http().request(HttpMethod.GET, params, new Callback.CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n parseRefreshAccessTokenResult(result);\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n }\n\n showLoading();\n //get userinfo\n RequestParams requestParams = new RequestParams(WeChatManager.getUserInfoUrl(sURLUserInfo, accessToken));\n x.http().request(HttpMethod.GET, requestParams, new Callback.CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n userinfo = new Gson().fromJson(result, UserInfoWX.class);\n\n String device_id= JPushInterface.getRegistrationID(LoginActivity.this);\n RequestParams entity = new RequestParams(Configurations.URL_THIRD_PARTY_LOGIN);\n entity.addParameter(Configurations.OPEN_ID, userinfo.getUnionid());\n entity.addParameter(Configurations.NICKNAME, userinfo.getNickname());\n entity.addParameter(Configurations.AVATOR, userinfo.getHeadimgurl());\n entity.addParameter(\"from\", \"wx\");\n entity.addParameter(Configurations.REG_ID,device_id);\n\n\n long timeStamp= TimeUtil.getCurrentTime();\n entity.addParameter(Configurations.TIMESTAMP, String.valueOf(timeStamp));\n entity.addParameter(Configurations.DEVICE_ID,device_id );\n\n Map<String,String> map=new TreeMap<>();\n map.put(Configurations.OPEN_ID, userinfo.getUnionid());\n map.put(Configurations.NICKNAME, userinfo.getNickname());\n map.put(Configurations.AVATOR, userinfo.getHeadimgurl());\n map.put(\"from\", \"wx\");\n map.put(Configurations.REG_ID,device_id);\n entity.addParameter(Configurations.SIGN, SignUtils.createSignString(device_id,timeStamp,map));\n\n\n x.http().request(HttpMethod.POST, entity, new CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n LogUtil.d(TAG, result);\n hideLoading();\n\n try {\n JSONObject object = new JSONObject(result);\n if (object.getInt(Configurations.STATUSCODE) == 200) {\n User user = JSON.parseObject(object.getJSONObject(\"results\").getString(\"user\"), User.class);\n SharedPrefUtil.loginSuccess(SharedPrefUtil.LOGIN_VIA_WECHAT);\n UserUtils.saveUserInfo(user);\n\n MobclickAgent.onProfileSignIn(\"WeChat\", user.getNickname());\n finish();\n } else {\n ToastUtil.showShort(LoginActivity.this, object.getString(Configurations.STATUSMSG));\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n hideLoading();\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n\n\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n }\n\n @Override\n public void onFinished() {\n }\n });\n }", "public void setAccessToken(String accessToken) {\n\t\t\tthis.accessToken = accessToken;\n\t\t}", "private void getUser(){\n user = new User();\n SharedPreferences preferences = getSharedPreferences(\"account\", MODE_PRIVATE);\n user.setId(preferences.getInt(\"id\", 0));\n user.setPhone(preferences.getString(\"phone\", \"\"));\n user.setType(preferences.getInt(\"type\",0));\n }", "public String getAccess_token() {\r\n\t\treturn access_token;\r\n\t}", "public User getUser();", "public void setUser(User user) { this.user = user; }", "public String getAccessToken() {\n readLock.lock();\n try {\n return accessToken;\n } finally {\n readLock.unlock();\n }\n }", "public String getUser()\n {\n return _user;\n }", "public String getAccessTokenUri() {\n return accessTokenUri;\n }", "void onOnlineLoginSuccess(User user);", "public AuthorizationToken(String token, String userName){\n this.token = token;\n this.userName = userName;\n }", "@Override\n public void authenticate() throws IOException, BadAccessIdOrKeyException {\n try{\n HttpPost post = new HttpPost(Constants.FRGXAPI_TOKEN);\n List<NameValuePair> params = new ArrayList<>();\n params.add(new BasicNameValuePair(\"grant_type\", \"apiAccessKey\"));\n params.add(new BasicNameValuePair(\"apiAccessId\", accessId));\n params.add(new BasicNameValuePair(\"apiAccessKey\", accessKey));\n post.setEntity(new UrlEncodedFormEntity(params, \"UTF-8\"));\n\n HttpResponse response = client.execute(post);\n String a = response.getStatusLine().toString();\n\n if(a.equals(\"HTTP/1.1 400 Bad Request\")){\n throw (new BadAccessIdOrKeyException(\"Bad Access Id Or Key\"));\n }\n HttpEntity entity = response.getEntity();\n String responseString = EntityUtils.toString(response.getEntity());\n\n JsonParser jsonParser = new JsonParser();\n JsonObject jo = (JsonObject) jsonParser.parse(responseString);\n if(jo.get(\"access_token\") == null){\n throw new NullResponseException(\"The Access Token you get is null.\");\n }\n String accessToken = jo.get(\"access_token\").getAsString();\n List<Header> headers = new ArrayList<>();\n headers.add(new BasicHeader(HttpHeaders.CONTENT_TYPE, \"application/json\"));\n headers.add(new BasicHeader(\"Authorization\", \"Bearer \" + accessToken));\n\n client = HttpClients.custom().setDefaultHeaders(headers).build();\n } catch (NullResponseException e) {\n System.out.println(e.getMsg());\n }\n }", "@Override\n\tpublic void login() {\n\t\tAccountManager accountManager = AccountManager.get(context);\n\t\tAccount[] accounts = accountManager.getAccountsByType(GOOGLE_ACCOUNT_TYPE);\n\t\tif(accounts.length < 1) throw new NotAccountException(\"This device not has account yet\");\n\t\tfinal String userName = accounts[0].name;\n\t\tfinal String accountType = accounts[0].type;\n\t\tBundle options = new Bundle();\n\t\tif(comService.isOffLine()){\n\t\t\tsetCurrentUser(new User(userName, userName, accountType));\n\t\t\treturn;\n\t\t}\n\t\taccountManager.getAuthToken(accounts[0], AUTH_TOKEN_TYPE, options, (Activity)context, \n\t\t\t\tnew AccountManagerCallback<Bundle>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run(AccountManagerFuture<Bundle> future) {\n\t\t\t\t\t\tString token = \"\";\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tBundle result = future.getResult();\n\t\t\t\t\t\t\ttoken = result.getString(AccountManager.KEY_AUTHTOKEN);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsetCurrentUser(new User(userName, userName, accountType, token));\n\t\t\t\t\t\t} catch (OperationCanceledException e) {\n\t\t\t\t\t\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tLog.d(\"Login\", \"Token: \" + token);\n\t\t\t\t\t}\n\t\t\t\t}, new Handler(new Handler.Callback() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean handleMessage(Message msg) {\n\t\t\t\t\t\tLog.d(\"Login\", msg.toString());\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t}", "protected final String getAccessToken() {\n Session currentSession = sessionTracker.getOpenSession();\n return (currentSession != null) ? currentSession.getAccessToken() : null;\n }", "@Override\n public void onSuccess(LoginResult loginResult) {\n GraphRequest request = GraphRequest.newMeRequest(\n loginResult.getAccessToken(),\n new GraphRequest.GraphJSONObjectCallback() {\n @Override\n public void onCompleted(\n JSONObject object,\n GraphResponse response) {\n\n //Log.e(\"FACEBOOK RESPONSE \", response.toString());\n jsonGraphObject = response.getJSONObject();\n\n //Get user detail and save it to loacal instances.\n getFacebookInfo();\n\n LoginManager.getInstance().logOut();\n\n //Save info to params and pass Login Type [Twitch,Facebook,Twitter].\n //saveInfoToParams(ApplicationGlobal.TAG_LOGIN_FACEBOOK);\n }\n });\n Bundle parameters = new Bundle();\n // parameters.putString(\"fields\", \"id,city,name,email,gender, birthday,first_name,locale,country,latitude,longitude,state,zip\");\n parameters.putString(\"fields\", \"email,first_name,last_name, locale, location\");\n request.setParameters(parameters);\n request.executeAsync();\n }", "public static void setAccessToken(String token, Context context){\n\t\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);\n\t\t\tSharedPreferences.Editor prefEditor = prefs.edit();\n\t\t\tprefEditor.putString(TWITTER_ACCESS_TOKEN, token);\n\t\t\tprefEditor.commit();\n\t\t\t\n\t\t}", "String createToken(User user);", "static public User getUser(HttpServletRequest request) {\n String accessToken = request.getParameter(\"access_token\");\n if (accessToken == null) {\n return null;\n } else {\n try {\n URL url = new URL(\n \"https://www.googleapis.com/oauth2/v1/tokeninfo\"\n + \"?access_token=\" + accessToken);\n\n Map<String, String> userData = mapper.readValue(\n new InputStreamReader(url.openStream(), \"UTF-8\"),\n new TypeReference<Map<String, String>>() {\n });\n if (userData.get(\"audience\") == null\n || userData.containsKey(\"error\")\n || !userData.get(\"audience\")\n .equals(Constants.CLIENT_ID)) {\n return null;\n } else {\n String email = userData.get(\"email\"),\n userId = userData.get(\"user_id\");\n User user = null;\n PersistenceManager pm = PMF.get().getPersistenceManager();\n try {\n user = pm.getObjectById(User.class, userId);\n } catch (JDOObjectNotFoundException ex) {\n user = new User(userId, email);\n pm.makePersistent(user);\n } finally {\n pm.close();\n }\n return user;\n }\n } catch (Exception ex) {\n System.err.println(ex.getMessage());\n return null;\n }\n }\n }", "public TokenResponse(String accessToken) {\n this.accessToken = accessToken;\n }", "@FormUrlEncoded\n @POST(\"/oauth/access_token\")\n Flowable<ResponseBody> getAccessToken(@Field(\"oauth_verifier\") String oauthVerifier);", "@Override\n public User getUserInfo() {\n return User.AUTHORIZED_USER;\n }", "@Override\n\t\t\t public void onCompleted(GraphUser user, Response response) \n\t\t\t {\n\t\t\t // TODO Auto-generated method stub\n\t\t\t if (user != null) \n\t\t\t {\n\t\t\t Log.e(\"session\",\"if open user\");\n\t\t\t try\n\t\t\t {\n\t\t\t \tstrFacebookEmail=user.asMap().get(\"email\").toString();\n\t\t\t\t\tLog.e(\"email\",\"hi\"+strFacebookEmail);\n\t\t\t\t\tstrFacebookName=user.getName();\n\t\t\t\t\tLog.e(\"name\",strFacebookName);\n\t\t\t\t\tstrFacebookId=user.getId();\n\t\t\t\t\tLog.e(\"fbid\",strFacebookId);\n\t\t\t\t\n\t\t\t\t\t \tstrFacebookProfilePic= \"http://graph.facebook.com/\"+strFacebookId+\"/picture?type=large\";\n\t\t\t\t\t\tprofilepicture=strFacebookProfilePic.replaceAll(\" \",\"%20\").trim();\n\t\t\t\t\t\n\t\t\t\t\t\tLog.e(\"profilepic\",strFacebookProfilePic);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfirstname=user.getFirstName();\n\t\t\t\t\t\tlastname=user.getLastName();\n\t\t\t\t\t\t\n\t\t\t\t\t\tLog.e(\"firstname\",firstname);\n\t\t\t\t\t\tLog.e(\"lastname\",lastname);\n\t\t\t\t\t\t\n\t\t\t\t\t\t mPrefs = PreferenceManager.getDefaultSharedPreferences(LoginScreenActivity.this);\n\t\t\t\t\t SharedPreferences.Editor editor = mPrefs.edit();\n\t\t\t\t\t editor.putString(\"email\",strFacebookEmail);\n\t\t\t\t\t \t editor.putString(\"access_token\",strAccesstoken);\n\t\t\t\t\t editor.putString(\"facebookid\",strFacebookId);\n\t\t\t\t\t editor.putString(\"profilepic\",strFacebookProfilePic);\n\t\t\t\t\t editor.putString(\"username\",strFacebookName);\n\t\t\t\t\t editor.putString(\"firstname\",firstname);\n\t\t\t\t\t editor.putString(\"lastname\",lastname);\n\t\t\t\t\t editor.putString(\"checkvalue\",\"2\");\n\t\t\t\t\t editor.commit();\n\t \n\t\t\t\t\t new LoginFacebook().execute();\n\t\t\t\t\t }\n\t\t\t catch(Exception e)\n\t\t\t {\n\t\t\t \te.printStackTrace();\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t }\n\t\t\t \n\t\t\t // Check for publish permissions \n\t\t\t \n\t\t\t \n\t\t\t }", "public static com.sawdust.gae.logic.User getUser(final HttpServletRequest request, final HttpServletResponse response, final AccessToken accessData)\r\n {\n if (null != response)\r\n {\r\n setP3P(response); // Just always set this...\r\n }\r\n\r\n com.sawdust.gae.logic.User user = null;\r\n\r\n if (null == user)\r\n {\r\n try\r\n {\r\n LOG.finer(String.format(\"Attempting google authorization...\"));\r\n user = getUser_Google(request, accessData, user);\r\n }\r\n catch (final Throwable e)\r\n {\r\n \tLOG.warning(Util.getFullString(e));\r\n }\r\n }\r\n\r\n if (null == user)\r\n {\r\n try\r\n {\r\n LOG.finer(String.format(\"Attempting facebook authorization...\"));\r\n user = getUser_Facebook(request, user);\r\n }\r\n catch (final Throwable e)\r\n {\r\n \tLOG.warning(Util.getFullString(e));\r\n }\r\n }\r\n\r\n if (null == user)\r\n {\r\n try\r\n {\r\n LOG.finer(String.format(\"Attempting signed-cookie authorization...\"));\r\n user = getUser_Cookied(request, user);\r\n }\r\n catch (final Throwable e)\r\n {\r\n \tLOG.warning(Util.getFullString(e));\r\n }\r\n }\r\n\r\n if (null == user)\r\n {\r\n LOG.finer(String.format(\"Using guest authorization...\"));\r\n final String email = getGuestId(request, response);\r\n if (null == email) \r\n {\r\n return null;\r\n }\r\n user = new com.sawdust.gae.logic.User(UserTypes.Guest, email, null);\r\n }\r\n LOG.fine(String.format(\"User is %s\", user.getId()));\r\n if (user.getUserID().endsWith(\"facebook.null\"))\r\n {\r\n user.setSite(\"http://apps.facebook.com/sawdust-games/\");\r\n }\r\n else if (user.getUserID().endsWith(\"facebook.beta\"))\r\n {\r\n user.setSite(\"http://apps.facebook.com/sawdust-games-beta/\");\r\n }\r\n return user;\r\n }", "private void getAccessToken(String userName, String encryptPassword) {\n RequestParams params = new RequestParams();\n params.put(Constant.OAUTH_REQUEST_PARAM_LOGIN_KEY, userName);\n params.put(Constant.OAUTH_REQUEST_PARAM_CLIENT_SIGN_DATA, encryptPassword);\n httpClient.get(API.LOGIN_GET_ACCESS_TOKEN, params, new JsonHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n super.onSuccess(statusCode, headers, response);\n httpClient.addCookie(JSESSIONID, response.optString(Constant.OAUTH_RESPONSE_ACCESS_TOKEN));\n getUserInfo();\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {\n super.onFailure(statusCode, headers, responseString, throwable);\n callback.onLoginFailed(throwable.getMessage(), ErrorCode.ERROR_CODE_WRONG_PASSWORD);\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {\n super.onFailure(statusCode, headers, throwable, errorResponse);\n callback.onLoginFailed(throwable.getMessage(), ErrorCode.ERROR_CODE_WRONG_PASSWORD);\n }\n });\n }", "public String getAccessToken() {\n if (accessToken == null || (System.currentTimeMillis() > (expirationTime - 60 * 1000))) {\n if (refreshToken != null) {\n try {\n this.refreshAccessToken();\n } catch (IOException e) {\n log.error(\"Error fetching access token\", e);\n }\n }\n }\n\n return accessToken;\n }", "String getAuthorizerAccessToken(String appId);", "@Override\n public void onCompleted(GraphUser user, Response response) {\n if (session == Session.getActiveSession()) {\n\n if (user != null && user.getProperty(\"email\") != null) {\n\n String email = user.getProperty(\"email\").toString();\n String firstName = user.getName().split(\" \")[0].trim();\n String lastName;\n if (user.getName().split(\" \").length >= 1) {\n lastName = user.getName().split(\" \")[1].trim();\n }\n Log.d(TAG, email);\n Log.d(TAG, session.getAccessToken());\n\n Log.d(TAG, \"Id \" + user.getId());\n Intent resultIntent = new Intent();\n resultIntent.putExtra(\"result\", LOGIN_SUCCESS);\n resultIntent.putExtra(\"social_network\", mSocialNetwork);\n resultIntent.putExtra(Constants.EMAIL, email);\n String profilePic =\n \"https://graph.facebook.com/\" +\n user.getId() + \"/picture?type=large\";\n\n resultIntent.putExtra(Constants.TOKEN, session.getAccessToken());\n resultIntent.putExtra(Constants.ID, Long.parseLong(user.getId()));\n resultIntent.putExtra(Constants.NAME, user.getName());\n resultIntent.putExtra(Constants.PHOTO, profilePic);\n Log.d(TAG,\"Email:\"+email);\n Log.d(TAG, \"Name:\" + user.getName());\n setResult(RESULT_OK, resultIntent);\n\n mProgressDialog.dismiss();\n finish();\n }\n }\n if (response.getError() != null) {\n // Handle errors, will do so later.\n Intent resultIntent = new Intent();\n resultIntent.putExtra(\"result\", LOGIN_FAILURE);\n setResult(RESULT_OK, resultIntent);\n mProgressDialog.dismiss();\n finish();\n }\n }", "public interface AuthAPIService {\n\n @FormUrlEncoded\n @POST(\"/oauth/token\")\n public Observable<Tokens> getAccessTokensObs(@Field(\"grant_type\") String grantType,\n @Field(\"scope\") String manageProject,\n @Header(\"Authorization\") String authHeader);\n\n}", "public UserAuthToken createUser(CreateUserRequest request);", "User getUser();", "User getUser();", "public abstract User getUser();", "public UserData getUser() {\n return user;\n }", "public AccessToken(String appId, String serviceName, String consumerKey, String accessToken, String tokenSecret, String userId, Date expiresIn, String refreshToken) {\n this.appId = appId;\n this.serviceName = serviceName;\n this.consumerKey = consumerKey;\n\t this.accessToken = accessToken;\n\t this.tokenSecret = tokenSecret;\n this.userId = userId;\n\t this.expiresIn = expiresIn;\n\t this.refreshToken = refreshToken;\n\t setAuthorization(new Date());\n }", "public interface RememberMeToken extends RememberMe {\n\n /**\n * Auth info primary key, integer or varchar\n * @return\n */\n Object getAuthInfoKey();\n\n /**\n * Set auth info pk\n * @param key\n */\n void setAuthInfoKey(Object key);\n\n /**\n * Last login time or access time\n * @return\n */\n Date getLastTime();\n\n /**\n * Set last time\n * @param lastTime\n */\n void setLastTime(Date lastTime);\n}" ]
[ "0.7444211", "0.71619326", "0.7030215", "0.69812727", "0.6951964", "0.69263035", "0.6924295", "0.6834426", "0.68271", "0.6813129", "0.68117", "0.67841965", "0.6750792", "0.6743683", "0.6743683", "0.6596804", "0.6590971", "0.65861475", "0.6580196", "0.6580196", "0.65343577", "0.6524409", "0.6524383", "0.6512712", "0.6482887", "0.64729595", "0.64460903", "0.6338994", "0.63155824", "0.6311229", "0.63101834", "0.62944454", "0.6287743", "0.6281169", "0.6259226", "0.6246552", "0.62393785", "0.6213274", "0.61916536", "0.61873305", "0.61683714", "0.6159891", "0.61471796", "0.6145397", "0.61336285", "0.61336285", "0.608373", "0.6080536", "0.6062904", "0.6053941", "0.59995675", "0.5993512", "0.59837466", "0.5976048", "0.59758455", "0.59680104", "0.59659815", "0.595415", "0.59294575", "0.59185463", "0.59152645", "0.59039885", "0.5903869", "0.5902415", "0.58920133", "0.58920133", "0.588873", "0.58802146", "0.5878596", "0.58732677", "0.5870399", "0.5868068", "0.5862219", "0.5861854", "0.5856618", "0.5854285", "0.5845669", "0.58334804", "0.5824613", "0.5818931", "0.5816964", "0.58159924", "0.58134", "0.5811655", "0.58042943", "0.58033144", "0.57919705", "0.5772209", "0.57688886", "0.5756222", "0.5753283", "0.5746416", "0.57458836", "0.57439643", "0.5718465", "0.5707969", "0.5707969", "0.5707161", "0.5705016", "0.5700613", "0.5700096" ]
0.0
-1
Shoot! This is the function where you start your work. You will receive a variable pState, which contains information about all birds, both dead and alive. Each bird contains all past moves. The state also contains the scores for all players and the number of time steps elapsed since the last time this function was called.
public Action shoot(GameState pState, Deadline pDue) { int firstStepShoot = 70; double ThresholdShootProb = 0.55; // If we don't have seen enough datas to make a shoot with confidence we don't shoot if (pState.getBird(0).getSeqLength() < firstStepShoot) { return new Action(-1, -1); } double bestShootProb = Double.NEGATIVE_INFINITY; int bestShoot = -1; int idBirdToShoot = -1; // First round we don't shoot if (pState.getRound() != 0) { // We are looking for the best probability to shoot for (int idBird = 0; idBird < pState.getNumBirds(); idBird++) { Bird currentBird = pState.getBird(idBird); if (currentBird.isAlive()) { double[][] observations = new double[currentBird.getSeqLength()][1]; for (int idObs = 0; idObs < currentBird.getSeqLength(); idObs++) { observations[idObs][0] = currentBird.getObservation(idObs); } // Now we want to find its species and its best HMM associated // To do that we just have to find the HMM which best maximize the likelihood of the observations int currentSpecies = Constants.SPECIES_UNKNOWN; double bestLikelihood = Double.NEGATIVE_INFINITY; HMMOfBirdSpecies bestHMM = null; for (int idSpecies = 0; idSpecies < Constants.COUNT_SPECIES; idSpecies++) { if (listHMM[idSpecies] != null) { HMMOfBirdSpecies currentHMM = listHMM[idSpecies]; double localLikehood = currentHMM.SequenceLikelihood(observations); if (localLikehood > bestLikelihood) { bestLikelihood = localLikehood; bestHMM = currentHMM; currentSpecies = idSpecies; } } } // At this moment we have the bestHMM which maximize the likelihood of our observations // We have also the species associated to this guess // We don't want to shoot at a black stork if (!(currentSpecies == Constants.SPECIES_BLACK_STORK) && bestLikelihood > -200 && bestHMM != null) { // Now we want to find the next observation which has the best probability to appear // We get our current State probability vector double[] currentPi_t = bestHMM.currentStateEstimation(observations); // We compute a vector which represent the probability of each observation to apperat at t+1 double[] nextObsDist = bestHMM.NextObsDistribution(currentPi_t); // We search for the best shoot to do by maximizing the probability double bestLocalShootProb = Double.NEGATIVE_INFINITY; int bestLocalShoot = -1; for (int idObs = 0; idObs < Constants.COUNT_MOVE; idObs++) { if (nextObsDist[idObs] > bestLocalShootProb) { bestLocalShootProb = nextObsDist[idObs]; bestLocalShoot = idObs; } } if (bestLocalShootProb > bestShootProb) { if (bestLocalShootProb >= ThresholdShootProb) { bestShootProb = bestLocalShootProb; bestShoot = bestLocalShoot; idBirdToShoot = idBird; } } } } } if (idBirdToShoot != -1) { System.err.println("shoot bird " + idBirdToShoot + "action " + bestShoot + " Prob " + bestShootProb); } } return new Action(idBirdToShoot, bestShoot); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initShootHash(GameState pState) {\n for (int i = 0; i < pState.getNumBirds(); i++) {\n hasTriedToShoot.put(pState.getBird(i), false);\n }\n }", "public void tick(){\n\t\tinput.tick();\n\t\t\n\t\tif(!this.gameOver){\n\t\t\tthis.updateGame();\n\t\t}else{\n\t\t\tif(input.down){\n\t\t\t\tbird.x = 80;\n\t\t\t\tbird.y = (HEIGHT-50)/2;\n\t\t\t\tthis.numGoals = 0;\n\t\t\t\tthis.obstacles.clear();\n\t\t\t\tthis.goals.clear();\n\t\t\t\tthis.gameOver = false;\n\t\t\t\tthis.begin = true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public BSState() {\n this.playerTurn=1;\n this.p1TotalHits=0;\n this.p2TotalHits=0;\n this.shipsAlive=10;\n this.shipsSunk=0;\n this.isHit=false;\n this.phaseOfGame=\"SetUp\";\n this.shotLocations=null;\n this.shipLocations=null;\n this.shipType=1;\n this.board=new String[10][20];\n //this.player1=new HumanPlayer;\n //this.player2=new ComputerPlayer;\n\n }", "private void tankWillShoot(Graphics2D g2d, GameState state) {\n if (state.isMouseClicked() && tankObject.getNumOfCannonBullet() > 0 && state.getGunType() % 2 == 1) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfCannonBullet(tankObject.getNumOfCannonBullet() - 1);\n if (tankObject.getCannonLevel() == 1) {\n state.getMissiles().add(new Missile(state, 15));\n state.getMissiles().get(state.getMissiles().size() - 1).missileDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/heavygun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (tankObject.getCannonLevel() == 2) {\n state.getMissiles().add(new Missile(state, 30));\n state.getMissiles().get(state.getMissiles().size() - 1).missileDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/heavygun.wav\", 0);\n state.setMouseClicked(false);\n }\n } else if (state.isMouseClicked() && tankObject.getNumOfCannonBullet() == 0 && state.getGunType() % 2 == 1) {\n AudioPlayer emptyGunSFX = new AudioPlayer(\"sound effects/emptyGun.wav\", 0);\n state.setMouseClicked(false);\n }\n for (Missile missile : state.getMissiles()) {\n missile.paint(g2d, state);\n }\n if (state.isMousePressed() && tankObject.getNumOfMachineGunBullet() > 0 && state.getGunType() % 2 == 0) {\n if (numOfRenderBullet1 == 0 && tankObject.getMachineGunLevel() == 1) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfMachineGunBullet(tankObject.getNumOfMachineGunBullet() - 1);\n state.getBullets().add(new Bullet(state, 20));\n state.getBullets().get(state.getBullets().size() - 1).bulletDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/lightgun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (numOfRenderBullet2 == 0 && tankObject.getMachineGunLevel() == 2) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfMachineGunBullet(tankObject.getNumOfMachineGunBullet() - 1);\n state.getBullets().add(new Bullet(state, 30));\n state.getBullets().get(state.getBullets().size() - 1).bulletDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/lightgun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (numOfRenderBullet1 <= 7) {\n numOfRenderBullet1++;\n }\n if (numOfRenderBullet1 == 7) {\n numOfRenderBullet1 = 0;\n }\n if (numOfRenderBullet2 <= 3) {\n numOfRenderBullet2++;\n }\n if (numOfRenderBullet2 == 3) {\n numOfRenderBullet2 = 0;\n }\n }\n else if (state.isMousePressed() && tankObject.getNumOfMachineGunBullet() == 0 && state.getGunType() % 2 == 0) {\n AudioPlayer emptyGunSFX = new AudioPlayer(\"sound effects/emptyGun.wav\", 0);\n }\n for (Bullet bullet : state.getBullets()) {\n bullet.paint(g2d, state);\n }\n }", "public void hit(GameState pState, int pBird, Deadline pDue) {\n System.err.println(\"Bird num + \" + pBird + \" was hit\");\n\n }", "private void enemiesWillShoot(Graphics2D g2d, GameState state) {\n if (numOfRenderShoot == 75) {\n numOfRenderShoot = 0;\n for (int i = 0; i < state.getEnemyTanks().size(); i++) {\n if (state.getEnemyTanks().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTanks().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTanks().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTanks().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyMissiles().add(new EnemyMissile(this, state, 10\n , state.getEnemyTanks().get(i)));\n state.getEnemyMissiles().get(state.getEnemyMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyCars().size(); i++) {\n if (state.getEnemyCars().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyCars().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyCars().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyCars().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyBullets().add(new EnemyBullet(this, state, 20\n , state.getEnemyCars().get(i)));\n state.getEnemyBullets().get(state.getEnemyBullets().size() - 1).bulletDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyWallTurrets().size(); i++) {\n if (state.getEnemyWallTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyWallTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyWallTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyWallTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyWallTurretMissiles().add(new EnemyWallTurretMissile(this, state, 15\n , state.getEnemyWallTurrets().get(i)));\n state.getEnemyWallTurretMissiles().get(state.getEnemyWallTurretMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n\n for (int i = 0; i < state.getEnemyTurrets().size(); i++) {\n if (state.getEnemyTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyHomingMissiles().add(new EnemyHomingMissile(this, state, 15\n , state.getEnemyTurrets().get(i)));\n state.getEnemyHomingMissiles().get(state.getEnemyHomingMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n }\n for (EnemyMissile enemyMissile : state.getEnemyMissiles()) {\n enemyMissile.paint(g2d, state);\n }\n for (EnemyBullet enemyBullet : state.getEnemyBullets()) {\n enemyBullet.paint(g2d, state);\n }\n for (EnemyWallTurretMissile enemyWallTurretMissile : state.getEnemyWallTurretMissiles()) {\n enemyWallTurretMissile.paint(g2d, state);\n }\n for (EnemyHomingMissile enemyHomingMissile : state.getEnemyHomingMissiles()) {\n enemyHomingMissile.paint(g2d, state);\n }\n }", "@Override\n\tpublic void startAction() {\n\t if (!balls.isEmpty() && firingBall == null) {\n\t gb.addToActiveList(this);\n\t //fire next ball\n\t firingBall = (Ball)balls.remove(0);\n\t firingBall.setAbsorbed(false);\n\t firingBall.setVy(-50*25);\n\t //align balls that are being held\n\t if (!balls.isEmpty()) setBalls();\n\t }\n\t}", "void shoot();", "public void shoot() {\n\r\n switch (shootstate) {\r\n case down:\r\n tempbutton = Components.shootsinglespeed;\r\n templimit = islimitshooterup();\r\n\r\n if (Components.shootsinglespeed && islimitshooterup() && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(singlespeed);\r\n Components.shootermotorleft2.setX(singlespeed);\r\n Components.shootermotorright.setX(-singlespeed);\r\n Components.shootermotorright2.setX(-singlespeed);\r\n\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n\r\n }\r\n shootpothigh = shootsinglepot;\r\n shootstate = movingup;\r\n } else if (Components.trusshp == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(trusshpspeed);\r\n Components.shootermotorleft2.setX(trusshpspeed);\r\n Components.shootermotorright.setX(-trusshpspeed);\r\n Components.shootermotorright2.setX(-trusshpspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = trusshppothigh;\r\n shootstate = movingup;\r\n }else if (Components.truss == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(trussspeed);\r\n Components.shootermotorleft2.setX(trussspeed);\r\n Components.shootermotorright.setX(-trussspeed);\r\n Components.shootermotorright2.setX(-trussspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = trusspothigh;\r\n shootstate = movingup;\r\n } else if (Components.pass == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(passspeed);\r\n Components.shootermotorleft2.setX(passspeed);\r\n Components.shootermotorright.setX(-passspeed);\r\n Components.shootermotorright2.setX(-passspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = passpot;\r\n shootstate = movingup;\r\n } else if (Components.longdistanceshoot == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(longdistancespeed);\r\n Components.shootermotorleft2.setX(longdistancespeed);\r\n Components.shootermotorright.setX(-longdistancespeed);\r\n Components.shootermotorright2.setX(-longdistancespeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = longdistancepot;\r\n shootstate = movingup;\r\n }\r\n else if (Components.shoot == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(shooterspeed);\r\n Components.shootermotorleft2.setX(shooterspeed);\r\n Components.shootermotorright.setX(-shooterspeed);\r\n Components.shootermotorright2.setX(-shooterspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = shootpot;\r\n shootstate = movingup;\r\n }else if (Components.slowmovingshoot == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(slowmovingspeed);\r\n Components.shootermotorleft2.setX(slowmovingspeed);\r\n Components.shootermotorright.setX(-slowmovingspeed);\r\n Components.shootermotorright2.setX(-slowmovingspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n slowmovingpot = shootpot;\r\n shootstate = movingup;\r\n }\r\n else if (Components.fastmovingshoot == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(fastmovingspeed);\r\n Components.shootermotorleft2.setX(fastmovingspeed);\r\n Components.shootermotorright.setX(-fastmovingspeed);\r\n Components.shootermotorright2.setX(-fastmovingspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n fastmovingpot = shootpot;\r\n\r\n }\r\n case movingup:\r\n if (islimitshooterup() == false || Components.potvalue >= shootpothigh) {\r\n shootstate = stopped;\r\n oldTime = DS.getMatchTime();\r\n try {\r\n Components.shootermotorleft.setX(0);\r\n Components.shootermotorleft2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n try {\r\n Components.shootermotorright.setX(0);\r\n Components.shootermotorright2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n break;\r\n\r\n case stopped:\r\n try {\r\n if (/*Components.shooterdown && */time - oldTime > .2 && islimitshooterdown() == true && Components.DownPickupLimit.get()) {\r\n\r\n Components.shootermotorleft.setX(shootdownspeed);\r\n Components.shootermotorleft2.setX(shootdownspeed);\r\n\r\n Components.shootermotorright.setX(-shootdownspeed);\r\n Components.shootermotorright2.setX(-shootdownspeed);\r\n\r\n shootstate = movingdown;\r\n }\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n break;\r\n\r\n case movingdown:\r\n if ((islimitshooterdown() == false) || (Components.potvalue < shootpotdown)) {\r\n\r\n try {\r\n Components.shootermotorleft.setX(0);\r\n Components.shootermotorleft2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n try {\r\n Components.shootermotorright.setX(0);\r\n Components.shootermotorright2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootstate = down;\r\n }\r\n }\r\n }", "public void ballShoot() {\n\n ballRight.setPower(-1);\n ballLeft.setPower(1);\n\n wait(2.0);\n\n flipper.setPosition(0.7);\n\n wait(0.5);\n\n flipper.setPosition(0.9);\n ballLeft.setPower(0);\n ballRight.setPower(0);\n\n\n }", "public void doAi(){\n\t\t\tif(MathHelper.getRandom(0, Game.FRAMERATE * 5) == 5){\n\t\t\t\tsetScared(true);\n\t\t\t}\n\t\t\n\t\t//Update rectangle\n\t\tsetRectangle(getX(), getY(), getTexture().getWidth(), getTexture().getHeight());\n\t\t\n\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\n\t\tif(rect.intersects(getRectangle())){\n\t\t\t\n\t\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\t\t\n\t\t\t\t\tsetDestinationX(StateGame.player.getX());\n\t\t\t\t\t\n\t\t\t\t\tsetDestinationY(StateGame.player.getY());\n\t\t\t\t\t\n\t\t\t\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\t\t\treachedDestination = (true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check for collision with jelly\n\t\tint checkedJelly = (0);\n\t\twhile(checkedJelly < EntityJelly.JELLY.size() && EntityJelly.JELLY.get(checkedJelly) != null){\n\t\t\tif(EntityJelly.JELLY.get(checkedJelly).getDead() == false){\n\t\t\t\tif(getRectangle().intersects(EntityJelly.JELLY.get(checkedJelly).getRectangle())){\n\t\t\t\t\tsetHealth(getHealth() - 2);\n\t\t\t\t\tif(MathHelper.getRandom(1, 10) == 10){\n\t\t\t\t\tAnnouncer.addAnnouncement(\"-2\", 60, EntityJelly.JELLY.get(checkedJelly).getX(), EntityJelly.JELLY.get(checkedJelly).getY());\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tcheckedJelly++;\n\t\t}\n\t\t\n\t\t//If we're out of health, kill the entity\n\t\tif(getHealth() < 0){\n\t\t\tsetDead(true);\n\t\t}\n\t\t\n\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\tif(reachedDestination == true){\n\t\t\t\tif(getScared() == false){\n\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(getScared() == false){\n\t\t\t\tif(getX() < getDestinationX())\n\t\t\t\t\tsetX(getX() + getSpeed());\n\t\t\t\tif(getX() > getDestinationX())\n\t\t\t\t\tsetX(getX() - getSpeed());\n\t\t\t\tif(getY() < getDestinationY())\n\t\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\tif(getY() > getDestinationY())\n\t\t\t\t\tsetY(getY() - getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void shoot() {\n\t\tif (playerList.size() > 0) {\n\t\t\tif (!someoneLose) {\n\t\t\t\tPlayer target = null;\n\t\t\t\tint remainingShips = SHIP_COUNT + 1;\n\t\t\t\tfor (Player player : playerList) {\n\t\t\t\t\tif (player.getRemainingShips() < remainingShips) {\n\t\t\t\t\t\ttarget = player;\n\t\t\t\t\t\tremainingShips = player.getRemainingShips();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSector targetSector = target.findFreeSector();\n\t\t\t\tlastTarget = targetSector.getMiddle();\n\t\t\t\tShootingThread st = new ShootingThread(chordImpl, targetSector.getMiddle());\n\t\t\t\tst.start();\n\t\t\t}\n\t\t}\n\t}", "public void doShit(int gameState) {\n\t\tif(gameState != 0){\n\t\t\tif (!songs.get(curSong).isPlaying()) {// If the song ends it will play another\n\t\t\t\t//System.out.println(\"Working?\");\n\t\t\t\tchangeSong(gameState);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (gameState != prevGameState) {\n\t\t\t\t\t//System.out.println(\"Working?\");\n\t\t\t\t\tprevGameState = gameState;\n\t\t\t\t\tchangeSong(gameState);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treset();//if it is at the start screen don't play anything\n\t\t}\n\t}", "public void hit(GameState pState, int pBird, Deadline pDue) {\n System.err.println(\"Hit bird \" + pBird);\n pState.getBird(pBird).kill();\n if(pBird == Constants.SPECIES_BLACK_STORK) {\n System.err.println(\"Hit black stork!\");\n }\n\n }", "public void RobotLoop() {\n if (mOperatorInterface.getVisionToggle()) {\n toggleVision();\n }\n\n mShooter.updateDistance(LastDistance);\n\n turretLoop();\n\n driveTrainLoop();\n\n updateSmartDashboard();\n\n State prevState = mState;\n IntakeState prevIntakeState = mIntakeState;\n ClimbingState prevClimbState = mClimbingState;\n ShootingState prevShootState = mShootingState;\n executeRobotStateMachine();\n if (prevState != mState) {\n mRobotLogger.log(\"Changed state to \" + mState);\n }\n if (prevIntakeState != mIntakeState) {\n mRobotLogger.log(\"Changed state to \" + mIntakeState);\n }\n if (prevClimbState != mClimbingState) {\n mRobotLogger.log(\"Changed state to \" + mClimbingState);\n }\n if (prevShootState != mShootingState) {\n mRobotLogger.log(\"Changed state to \" + mShootingState);\n }\n\n if (mOperatorInterface.getStateReset()) {\n mState = State.INTAKE;\n mIntakeState = IntakeState.IDLE;\n mClimbingState = ClimbingState.IDLE;\n mShootingState = ShootingState.IDLE;\n if (mState == State.SHOOTING) {\n mShootingState = ShootingState.SHOOTING_COMPLETE;\n }\n if (mState == State.INTAKE) {\n mIntakeState = IntakeState.IDLE;\n }\n }\n\n if (mOperatorInterface.isBarf()) {\n if (mIntakeState == IntakeState.STORAGE_EJECT) {\n mIntakeState = IntakeState.IDLE;\n } else {\n mIntakeState = IntakeState.STORAGE_EJECT;\n mBarfTimer.reset();\n mBarfTimer.start();\n }\n }\n\n // TODO: REMOVE THIS IT SHOULDNT BE HERE\n // check if we are shooting\n // TODO: remove this and only allow shooting if you have at least 1 ball\n checkTransitionToShooting();\n\n updateSmartDashboard();\n\n if (mOperatorInterface.getSpinUp()) {\n sIsSpinningUp = !sIsSpinningUp;\n }\n\n // spin up shooter if commanded\n if (sIsSpinningUp) {\n mShooter.start();\n } else if (mState != State.SHOOTING) {\n mShooter.stop();\n }\n\n // Shooter velocity trim\n if (mShooterVelocityTrimDown.update(mOperatorInterface.getShooterVelocityTrimDown())) {\n // mShooter.decreaseVelocity();\n } else if (mShooterVelocityTrimUp.update(mOperatorInterface.getShooterVelocityTrimUp())) {\n // mShooter.increaseVelocity();\n } else if (mOperatorInterface.getResetVelocityTrim()) {\n mShooter.resetVelocity();\n }\n }", "@Override\n public void update() {\n if(alive==false){\n afterBeKilled();\n return;\n }\n animate();\n chooseState();\n checkBeKilled();\n if(attack){\n if(timeBetweenShot<0){\n chooseDirection();\n attack();\n timeBetweenShot=15;\n }\n else{\n timeBetweenShot--;\n }\n\n }\n else{\n calculateMove();\n setRectangle();\n }\n }", "private double evalState(LabyrinthGameState state) {\n double score = 0;\n\n //Assign Percentages of Score\n final double treasureValTotal = 80; //Based on number of treasures left\n final double nearTreasureValTotal = 15; //Based on proximity to treasure\n final double typeTileValTotal = 1; //Based on which tile you are on\n final double numberOfConnectionsValTotal = 4; //Based on how many places you can move\n\n double treasureVal = 0;\n double nearTreasureVal = 0;\n double typeTileVal = 0;\n double numberOfConnectionsVal = 0;\n\n //calculating your treasure points\n treasureVal = (6.0 - (double)(state.getPlayerDeckSize(\n Player.values()[playerNum])))/6.0*treasureValTotal;\n\n int [] yourPos = state.getPlayerLoc(Player.values()[playerNum]).getLoc();\n int [] treasurePos = state.findTreasureLoc(Player.values()[playerNum]);\n if (treasurePos[0] == -1) {\n nearTreasureVal = (10.0 - findDistance(yourPos, findHome()))\n / 10.0 * nearTreasureValTotal;\n } else {\n nearTreasureVal = (10.0 - findDistance(yourPos, treasurePos))\n / 10.0 * nearTreasureValTotal;\n }\n\n //calculating points for the type of tile it can end on\n switch (state.getPlayerLoc(Player.values()[playerNum]).getType()) {\n case STRAIGHT:\n typeTileVal = 5.0 / 10.0 * typeTileValTotal;\n break;\n case INTERSECTION:\n typeTileVal = typeTileValTotal;\n break;\n default:\n typeTileVal = 3.0 / 10.0 * typeTileValTotal;\n break;\n }\n\n //calculating points based on # of connections created\n numberOfConnectionsVal = ((double)generatePossibleMoveActions(state).size()\n /49.0*numberOfConnectionsValTotal);\n\n //calculating final score\n score = (treasureVal + nearTreasureVal +\n typeTileVal + numberOfConnectionsVal)/100.0;\n\n return score;\n }", "@Override\n protected void execute() {\n double timePassed = Timer.getFPGATimestamp() - timePoint;\n\n boolean rumbleOver = (state == RUMBLE && timePassed > timeOn);\n boolean breakOver = (state == BREAK && timePassed > timeOff);\n\n if (rumbleOver) {\n rumble(false);\n if (repeatCount >= 0)\n repeatCount--;\n } else if (breakOver)\n rumble(true);\n }", "private void shoot() {\n }", "private void shoot() {\n }", "public int shoot(int[] prevRound, boolean[] alive)\n {\n\n \tif (prevRound == null) //First Round Strategy -> wait do nothing\n \t{\n \t\tSystem.err.println(\"[PLAYER3] First Round, I am id: \" + id + \" waiting...\");\n \t}\n \telse\n \t{\n\t\t\troundNum++;\n\t\t\tint prevRoundNum = roundNum-1;\n\t\t\t//update history\n\t\t\tfor (int i = 0; i < prevRound.length; i++)\n\t\t\t{\n\t\t\t\thistory[prevRoundNum][i] = prevRound[i];\n\t\t\t}\n\n\t\t\tif(equilibrium(prevRound, alive)) //If the game is in equilibrium, implement the end game strategy\n\t\t\t{\n\t\t\t\tSystem.err.println(\"[PLAYER3] The game is in equilibrium. Implementing end game strategy.\");\n\t\t\t\treturn endGame(prevRound, alive);\n\t\t\t}\n\t\t\t//Priority 1: Shoot person you shot at before if they are not dead\n\t\t\tint lastPersonShotAt = prevRound[id];\n\n\t\t\tif( lastPersonShotAt != -1 && alive[lastPersonShotAt] )\n\t\t\t{\n\t\t\tprintHistory();\n\t\t\t\treturn lastPersonShotAt;\n\t\t\t}\n\n\t\t\t//Priority 2: Shoot the person who shot you last round\n\t\t\tfor(int i = 0;i < prevRound.length; i++)\n\t\t\t{\n\t\t\t\tif( (prevRound[i] == id) && alive[i] )\n\t\t\t\t{\n\t\t\t\tprintHistory();\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Priority 3: Shoot at enemies that shot at friends\n\t\t\tfor(int i = 0;i < prevRound.length; i++)\n\t\t\t{\n\t\t\t\tfor(int j = 0;j < friends.length; j++)\n\t\t\t\t{\n\t\t\t\t\t// Did the player shoot a friend?\n\t\t\t\t\tif ( (friends[j] == prevRound[i]) && alive[i])\n\t\t\t\t\t{\n\t\t\t\t\t\t// Is the player an enemy\n\t\t\t\t\t\tfor(int k = 0;k < enemies.length; k++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (enemies[k] == i)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tprintHistory();\n\t\t\t\t\t\t\t\treturn i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//else keep a low profile by not killing neutral players\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \t}\n\t\tprintHistory();\n \treturn -1;\n }", "public void run()\n {\n // Used to keep track of time used to draw and update the game\n // This is used to limit the framerate later on\n long startTime;\n long deltaTime;\n \n // set up the pipes\n int pipeX = 600;\n Random randGen = new Random();\n for(int i = 0; i < topPipes.length; i++){\n // generating a random y position\n int pipeY = randGen.nextInt(HEIGHT - 2*minDistance) + minDistance;\n bottomPipes[i] = new Rectangle(pipeX, pipeY, pipeWidth, pipeHeight);\n topPipes[i] = new Rectangle(pipeX, pipeY - pipeGap - pipeHeight, pipeWidth, pipeHeight);\n // move the pipeX value over\n pipeX = pipeX + pipeWidth + pipeSpacing;\n }\n \n \n \n \n // the main game loop section\n // game will end if you set done = false;\n boolean done = false; \n while(!done)\n {\n // determines when we started so we can keep a framerate\n startTime = System.currentTimeMillis();\n \n // all your game rules and move is done in here\n // GAME LOGIC STARTS HERE \n \n // get the pipes moving\n if (start){\n if (!dead){\n \n \n for(int i = 0; i < topPipes.length; i++){\n topPipes[i].x = topPipes[i].x - speed;\n bottomPipes[i].x = bottomPipes[i].x - speed;\n // check if a pipe is off the screen\n if(topPipes[i].x + pipeWidth < 0){\n // move the pipe\n setPipe(i);\n }\n }\n }\n // get the bird to fall\n // apply gravity\n dy = dy + gravity;\n // apply the change in y to the bird\n if(jump && !lastjump){\n dy = jumpVelocity;\n }\n lastjump = jump;\n bird.y = bird.y + dy;\n if (bird.y<0||bird.y+bird.height > HEIGHT){\n done =true;\n }\n for (int i = 0; i <topPipes.length;i++){\n if(bird.intersects(topPipes[i])){\n done = true;\n }else if (bird.intersects(bottomPipes[i])){\n done =true;\n }\n }\n }\n // GAME LOGIC ENDS HERE \n \n // update the drawing (calls paintComponent)\n repaint();\n \n \n \n // SLOWS DOWN THE GAME BASED ON THE FRAMERATE ABOVE\n // USING SOME SIMPLE MATH\n deltaTime = System.currentTimeMillis() - startTime;\n try\n {\n if(deltaTime > desiredTime)\n {\n //took too much time, don't wait\n Thread.sleep(1);\n }else{\n // sleep to make up the extra time\n Thread.sleep(desiredTime - deltaTime);\n }\n }catch(Exception e){};\n }\n }", "void tick() {\n\t\tif (playing) {\n\t\t\t// Advance the paddle and ball in their current direction.\n\t\t\tpaddle.move();\n\t\t\tball.move();\n\t\t\t\n\t\t\t//Ball intersects Paddle \n\t\t\tif (ball.intersects(paddle) != 0) {\n\t\t\t\tball.hitObj(paddle, ball.intersects(paddle));\n\t\t\t}\n\t\t\t//Ball intersects Brick. If Intersects then set Brick DNE accordingly \n\t\t\tbrickArray = bricks.getBricksArray();\n\t\t\tfor (int x = 0; x < Bricks.getColumns(); x++) {\n\t\t\t\tfor (int y = 0; y < Bricks.getRows(); y++) {\n\t\t\t\t\tbrick = brickArray[x][y];\n\t\t\t\t\tif (ball.intersects(brick) != 0 && brick.exists()) {\n\t\t\t\t\t\tball.hitObj(brick, ball.intersects(brick));\n\t\t\t\t\t\tbrick.setDNE();\n\t\t\t\t\t\t/*if (!brick.containsPowerUp()) {\n\t\t\t\t\t\t\tpowerUp = PowerUps.createPowerUp();\n\t\t\t\t\t\t\tpowerUp.move();\n\t\t\t\t\t\t}*/ // Setting up the framework for PowerUps \n\t\t\t\t\t\tcurrScoreVal++; // Incrementing Score by 1\n\t\t\t\t\t\tyourScore.setText(\"Your Score: \" + currScoreVal.toString());\n\t\t\t\t\t\tstatus.setText(\"Good job!\");\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tball.hitWall();\n\n\t\t\t\t// check for the round end/lose a life conditions\n\t\t\t\tif (livesLeft != 0) {\n\t\t\t\t\tif (ball.getPy() >= COURT_HEIGHT - 10) {\n\t\t\t\t\t\tplaying = true;\n\t\t\t\t\t\tstatus.setText(\"You lost a life! Get Ready!\");\n\t\t\t\t\t\trepaint();\n\t\t\t\t\t\tlivesLeft--;\n\t\t\t\t\t\tint timedelay = 2000;\n\t\t\t\t\t\tif (livesLeft == 0) {\n\t\t\t\t\t\t\ttimedelay = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlives.setText(\" Lives: \" + livesLeft.toString() + \"| \");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(timedelay);\n\t\t\t\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tball.setPx(250);\n\t\t\t\t\t\tball.setPy(170);\n\t\t\t\t\t\tball.setVx(-2);\n\t\t\t\t\t\tball.setVy(-3);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Finish Game Conditions\n\t\t\t\tif (livesLeft == 0 || currScoreVal == Bricks.getBlocksCreated()) {\n\t\t\t\t\tplaying = false;\n\t\t\t\t\tif (currScoreVal < Bricks.getBlocksCreated()){\n\t\t\t\t\tstatus.setText(\"You lose!\");\n\t\t\t\t\t}\n\t\t\t\t\tif (currScoreVal == Bricks.getBlocksCreated()){\n\t\t\t\t\tstatus.setText(\"You Win!\");\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tString[] options = { \"Yes\", \"No\", \"Save Score\" };\n\t\t\t\t\tint response = JOptionPane.showOptionDialog(null,\n\t\t\t\t\t\t\t\"Your Final Score:\" + currScoreVal + \"\\n\" + \"Start New Game?\\n\", \"Game Over\",\n\t\t\t\t\t\t\tJOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]);\n\n\t\t\t\t\tif (response == 0) {\n\t\t\t\t\t\treset();\n\t\t\t\t\t}\n\t\t\t\t\telse if (response == 1) {\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t//Handling the Highscores. Only the Top 5 are Printed \n\t\t\t\t\telse if (response == 2) {\n\t\t\t\t\t\tString name = JOptionPane.showInputDialog(\"Enter your name?\");\n\t\t\t\t\t\tHighscores.addNewScore(currScoreVal,name);\n\t\t\t\t\t\tHighscores.writeFile();\n\t\t\t\t\t\tJDialog highScoreDialog = new JDialog();\n\t\t\t\t\t\tJPanel highscores = new JPanel();\n\t\t\t\t\t\thighscores.setLayout(new BoxLayout(highscores, BoxLayout.PAGE_AXIS));\n\t\t\t\t\t\tArrayList<String> entries = Highscores.topFiveEntries();\n\t\t\t\t\t\tJLabel highScore1 = new JLabel(\" 1: \" + entries.get(0));\n\t\t\t\t\t\tJLabel highScore2 = new JLabel(\" 2: \" + entries.get(1));\n\t\t\t\t\t\tJLabel highScore3 = new JLabel(\" 3: \" + entries.get(2));\n\t\t\t\t\t\tJLabel highScore4 = new JLabel(\" 4: \" + entries.get(3));\n\t\t\t\t\t\tJLabel highScore5 = new JLabel(\" 5: \" + entries.get(4));\n\t\t\t\t\t\tJLabel highscoreTitle = new JLabel(\" ~~~~~~TOP 5 HIGHSCORES~~~~~\");\n\t\t\t\t\t\thighscores.add(highscoreTitle);\n\t\t\t\t\t\thighscores.add(highScore1);\n\t\t\t\t\t\thighscores.add(highScore2);\n\t\t\t\t\t\thighscores.add(highScore3);\n\t\t\t\t\t\thighscores.add(highScore4);\n\t\t\t\t\t\thighscores.add(highScore5);\n\t\t\t\t\t\thighScoreDialog.add(highscores);\n\t\t\t\t\t\thighScoreDialog.pack();\n\t\t\t\t\t\thighScoreDialog.setSize(300, 300);\n\t\t\t\t\t\thighscores.setVisible(true);\n\t\t\t\t\t\thighScoreDialog.setLocationRelativeTo(null);\n\t\t\t\t\t\thighScoreDialog.setVisible(true);\n\t\t\t\t\t\tcurrScoreVal = 0;\n\t\t\t\t\t\tlivesLeft = 3;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update the display\n\t\t\t\trepaint();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void shoot() {\n\t\tthis.fired = true;\n\t\tghost.shot=true;\n\t}", "public void move()\n\t{\n time++;\n\t\tif (time % 10 == 0)\n\t\t{\n\t\t\thistogramFrame.clearData();\n\t\t}\n\t\tfor (int i = 0; i < nwalkers; i++)\n\t\t{\n\t\t\tdouble r = random.nextDouble();\n\t\t\tif (r <= pRight)\n\t\t\t{\n\t\t\t\txpositions[i] = xpositions[i] + 1;\n\t\t\t}\n\t\t\telse if (r < pRight + pLeft)\n\t\t\t{\n\t\t\t\txpositions[i] = xpositions[i] - 1;\n\t\t\t}\n\t\t\telse if (r < pRight + pLeft + pDown)\n\t\t\t{\n\t\t\t\typositions[i] = ypositions[i] - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\typositions[i] = ypositions[i] + 1;\n\t\t\t}\n\t\t\tif (time % 10 == 0)\n\t\t\t{\n\t\t\t\thistogramFrame.append(Math.sqrt(xpositions[i] * xpositions[i]\n\t\t\t\t\t\t+ ypositions[i] * ypositions[i]));\n\t\t\t}\n\t\t\txmax = Math.max(xpositions[i], xmax);\n\t\t\tymax = Math.max(ypositions[i], ymax);\n\t\t\txmin = Math.min(xpositions[i], xmin);\n\t\t\tymin = Math.min(ypositions[i], ymin);\n\t\t}\n\t}", "public void act ()\n {\n checkScroll();\n checkPlatform();\n checkXAxis();\n checkDeath();\n // get the current state of the mouse\n MouseInfo m = Greenfoot.getMouseInfo();\n // if the mouse is on the screen...\n if (m != null)\n {\n // if the mouse button was pressed\n if (Greenfoot.mousePressed(null))\n {\n // shoot\n player.shoot(m.getX(), m.getY());\n }\n }\n }", "public void startTurn() {\n nMovesBeforeGrabbing = 1;\n nMovesBeforeShooting = 0;\n\n if (damages.size() > 2)\n nMovesBeforeGrabbing = 2;\n\n if (damages.size() > 5)\n nMovesBeforeShooting = 1;\n\n playerStatus.isActive = true;\n }", "private void moveGame() {\r\n\t\tmoveFireball1();\r\n\t\tmoveFireball2();\r\n\t\tmoveMehran();\r\n\t\tmoveLaser();\r\n\t\tmoveBullet();\r\n\t\tcheckPlayerCollisions();\r\n\t\tcheckForBulletCollisions();\r\n\t\tpause(DELAY);\r\n\t\tcount++;\r\n\t}", "public void startOppTurn(GameState state) {\n }", "protected void execute() {\n \tif(Robot.robotState != Robot.RobotState.Climbing)\n \t\tRobot.shooter.speed(speed);\n }", "@Override\n\t\t\tpublic void shoot() {\n\t\t\t}", "private void tick() {\n keyManager.tick();\n if (keyManager.pause == false) {\n if (gameOver) {\n\n // advancing player with colision\n player.tick();\n //if there's a shot.\n\n int alienBombIndex = (int) (Math.random() * aliens.size());\n for (int i = 0; i < aliens.size(); i++) {\n Alien alien = aliens.get(i);\n alien.tick();\n if (shotVisible && shot.intersectAlien(alien)) {\n Assets.hitSound.play();\n alien.setDying(true);\n alien.setDeadCounter(6);\n shotVisible = false;\n }\n \n if(alien.isDead()){\n aliens.remove(i);\n if (aliens.size() == 0) {\n gameOver = false;\n }\n }\n\n alien.act(direction);\n }\n\n //Controlar el movimiento de los aliens\n for (Alien alien : aliens) {\n int x = alien.getX();\n if (x >= getWidth() - 30 && direction != -1) {\n direction = -1;\n alien.setDirection(-1);\n Iterator i1 = aliens.iterator();\n while (i1.hasNext()) {\n Alien a2 = (Alien) i1.next();\n a2.setY(a2.getY() + 15);\n }\n }\n if (x <= 5 && direction != 1) {\n direction = 1;\n alien.setDirection(1);\n Iterator i2 = aliens.iterator();\n while (i2.hasNext()) {\n Alien a = (Alien) i2.next();\n a.setY(a.getY() + 15);\n }\n }\n }\n\n //Controlar el spawning de las bombas\n Random generator = new Random();\n for (Alien alien : aliens) {\n int num = generator.nextInt(15);\n Bomb b = alien.getBomb();\n\n if (num == CHANCE && b.isDestroyed()) {\n b.setDestroyed(false);\n b.setX(alien.getX());\n b.setY(alien.getY());\n }\n\n b.tick();\n if (b.intersecta(player)) {\n Assets.deathSound.play();\n player.die();\n gameOver = false;\n }\n\n }\n\n if (shotVisible) {\n shot.tick();\n }\n if (!player.isDead() && keyManager.spacebar) {\n shoot();\n Assets.shotSound.play();\n }\n for (int i = 0; i < aliens.size(); i++) {\n if (aliens.get(i).getY() > 500) {\n gameOver = false;\n }\n }\n\n }\n }\n /// Save game in file\n if (keyManager.save) {\n try {\n\n vec.add(player);\n vec.add(shot);\n if(keyManager.pause){\n vec.add(new String(\"Pause\")); \n } else if (!gameOver){\n vec.add(new String(\"Game Over\"));\n } else {\n vec.add(new String(\"Active\"));\n }\n for (Alien alien : aliens) {\n vec.add(alien);\n }\n //Graba el vector en el archivo.\n grabaArchivo();\n } catch (IOException e) {\n System.out.println(\"Error\");\n }\n }\n /// Load game\n if (keyManager.load == true) {\n try {\n //Graba el vector en el archivo.\n leeArchivo();\n } catch (IOException e) {\n System.out.println(\"Error en cargar\");\n }\n }\n\n }", "public void move(){\n\t\tswitch(state){\r\n\t\t\tcase ATField.SPRITE_STAND:\r\n\t\t\t\tspriteX = 0;\r\n\t\t\t\tcoords = standbySprite.get(spriteX);\r\n\t\t\t\tspriteImg = new Rect(coords.left,coords.top,coords.right,coords.bottom);\r\n\t\t\t\tactualImg = new Rect(x, y, x + width, y + height);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\r\n\t\t\tcase ATField.SPRITE_WALK:\r\n\t\t\t\tif(spriteX >walkSprite.size() - 1){\r\n\t\t\t\t\tspriteX = 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcoords = walkSprite.get(spriteX);\r\n\t\t\t\tspriteImg = new Rect(coords.left,coords.top,coords.right,coords.bottom);\r\n\t\t\t\tactualImg = new Rect(x, y, x + width, y + height);\r\n\t\t\t\tspriteX++;\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase ATField.SPRITE_RUN:\r\n\t\t\t\t\r\n\t\t\t\tif(spriteX >runSprite.size() - 1){\r\n\t\t\t\t\tspriteX = 0;\r\n\t\t\t\t\tsetState(STAND);\r\n\t\t\t\t}\r\n\t\t\t\tcoords = runSprite.get(spriteX);\r\n\t\t\t\tspriteImg = new Rect(coords.left,coords.top,coords.right,coords.bottom);\r\n\t\t\t\tactualImg = new Rect(x, y, x + width, y + height);\r\n\t\t\t\tspriteX++;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase ATField.SPRITE_JUMP:\r\n\t\t\t\tif(spriteX >5){\r\n\t\t\t\t\tsetState(STAND);\r\n\t\t\t\t}\r\n\t\t\t\tcoords = jumpSprite.get(0);\r\n\t\t\t\tspriteImg = new Rect(coords.left,coords.top,coords.right,coords.bottom);\r\n\t\t\t\tactualImg = new Rect(x, y, x + width, y + height);\r\n\t\t\t\tspriteX++;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "void playerMove(State state);", "void animalMove(int x,int y, Living[][] map,int gridLength, int gridWidth){\r\n \r\n boolean age=map[x][y].getAge();\r\n boolean gender=map[x][y].getGender();\r\n boolean checkRight=false;\r\n boolean checkLeft=false;\r\n boolean checkUp=false;\r\n boolean checkDown=false;\r\n boolean up=false;\r\n boolean down=false;\r\n boolean right=false;\r\n boolean left=false;\r\n boolean baby=false;\r\n boolean turn=map[x][y].getMovement(); //Check to see if it moved before in the array\r\n \r\n double random=Math.random();\r\n \r\n \r\n \r\n \r\n //Checks to see if it is possible to even see to the left first\r\n if(y-1>=0){\r\n left=true;\r\n \r\n if(turn && (map[x][y-1] instanceof Plant) ){ //Check to see if there is plants and goes to plants\r\n map[x][y].gainHealth((map[x][y-1].getHealth()));\r\n map[x][y].setMovement(false); \r\n map[x][y-1]=map[x][y];\r\n map[x][y]=null;\r\n turn=false; \r\n }\r\n if(turn && (map[x][y-1] instanceof Sheep) && (age==map[x][y-1].getAge()) ){ \r\n //If the ages match they must be false to be adults and both be opposite genders\r\n if(turn && !(age) && !(gender==map[x][y-1].getGender()) && (map[x][y].getHealth()>19) && (map[x][y-1].getHealth()>19) ){\r\n \r\n //Success rate of conceiving\r\n if( (Math.random()<=0.85) ){ \r\n \r\n if( (x+1<gridLength) && (map[x+1][y]==null)&& !(baby) ){ //Following ifs check to see if a baby can be made surrounding the intitiating sheep\r\n map[x+1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true; \r\n }\r\n \r\n if( (x-1>=0) && (map[x-1][y]==null)&& !(baby) ){\r\n map[x-1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if((y+1<gridLength) && (map[x][y+1]==null) && !(baby) ){\r\n map[x][y+1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if(baby){ //If baby is made then sheep will lose health and turn is therefore over \r\n map[x][y].lowerHealth(10);\r\n map[x][y-1].lowerHealth(10);\r\n map[x][y].setMovement(false);\r\n map[x][y-1].setMovement(false);\r\n turn=false;\r\n baby=false;\r\n }\r\n }\r\n } \r\n }\r\n //If it can move to the left need to check if it can foresee more incase there wasn't any place for it to go\r\n if(y-2>=0){\r\n checkLeft=true;\r\n }\r\n }\r\n \r\n //Checks to see if it is possible to even see to the right first \r\n if(y+1<gridWidth){\r\n right=true;\r\n \r\n //Check to move on towards plants\r\n if(turn && (map[x][y+1] instanceof Plant)){\r\n map[x][y].gainHealth(map[x][y+1].getHealth()); \r\n map[x][y].setMovement(false); \r\n map[x][y+1]=map[x][y];\r\n map[x][y]=null;\r\n turn=false; \r\n }\r\n \r\n if(turn && (map[x][y+1] instanceof Sheep && age==map[x][y+1].getAge()) ){ \r\n //If the ages match they must be false to be adults and both be opposite genders\r\n if(turn && !(age) && !(gender==map[x][y+1].getGender()) && (map[x][y].getHealth()>19) && (map[x][y+1].getHealth()>19) ){\r\n \r\n //Success rate of conceiving\r\n if( (Math.random()<=0.85) ){\r\n \r\n if( (x+1<gridLength) && (map[x+1][y]==null) && !(baby) ){ //Following ifs check to see if a baby can be made surrounding the intitiating sheep\r\n \r\n map[x+1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true; \r\n }\r\n \r\n if( (x-1>=0) && (map[x-1][y]==null) && !(baby) ){\r\n map[x-1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if( (y-1>=0) && (map[x][y-1]==null) && !(baby) ){\r\n map[x][y-1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if(baby){ //If baby is made then sheeps will lose health and turn is therefore over \r\n map[x][y].lowerHealth(10);\r\n map[x][y+1].lowerHealth(10);\r\n map[x][y].setMovement(false);\r\n map[x][y+1].setMovement(false);\r\n turn=false; \r\n baby=false;\r\n }\r\n }\r\n } \r\n }\r\n \r\n //If it can move to the right need to check if it can foresee more incase there wasn't any place for it to go\r\n if(y+2<gridWidth){ \r\n checkRight=true;\r\n }\r\n } \r\n \r\n //Check to see if it can go up\r\n if(x-1>=0){\r\n up=true;\r\n \r\n //Check for plant to go on to upwards \r\n if(turn && (map[x-1][y] instanceof Plant) ){\r\n map[x][y].gainHealth(map[x-1][y].getHealth()); \r\n map[x][y].setMovement(false); \r\n map[x-1][y]=map[x][y];\r\n map[x][y]=null;\r\n turn=false;\r\n }\r\n \r\n if(turn && (map[x-1][y] instanceof Sheep) && (age==map[x-1][y].getAge()) ){ \r\n //If the ages match age must be false to be adults and both be opposite genders and have more then 19 health\r\n if(turn && !age && !(gender==map[x-1][y].getGender()) &&map[x][y].getHealth()>19 &&map[x-1][y].getHealth()>19){\r\n \r\n //Success rate of conceiving\r\n if( (Math.random()<=0.85) ){\r\n if( (y+1<gridLength) && (map[x][y+1]==null) && !(baby) ){ //Following ifs check to see if a baby can be made surrounding the intitiating sheep\r\n \r\n map[x][y+1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true; \r\n }\r\n if( (y-1>=0) && (map[x][y-1]==null) && !(baby) ){\r\n map[x][y-1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n \r\n if( (x+1<gridLength) && (map[x+1][y]==null) && !(baby) ){\r\n map[x+1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n \r\n if(baby){ //If baby is made then sheep will lose health and turn is therefore over \r\n map[x][y].lowerHealth(10);\r\n map[x-1][y].lowerHealth(10);\r\n map[x][y].setMovement(false);\r\n map[x-1][y].setMovement(false);\r\n turn=false; \r\n baby=false;\r\n }\r\n }\r\n } \r\n }\r\n \r\n //If it can move to upwards need to check if it can foresee more incase there wasn't any place for it to go\r\n if(x-2>=0){\r\n checkUp=true; \r\n }\r\n } \r\n //Check to see where to go downwards\r\n if(x+1<gridLength){\r\n down=true; \r\n \r\n //Check to see if any plants are downwards\r\n if(turn && (map[x+1][y] instanceof Plant) ){\r\n map[x][y].gainHealth( (map[x+1][y].getHealth()));\r\n map[x][y].setMovement(false);\r\n map[x+1][y]=map[x][y];\r\n map[x][y]=null;\r\n turn=false;\r\n } \r\n \r\n if(turn && (map[x+1][y] instanceof Sheep) && (age==map[x+1][y].getAge()) ){ \r\n \r\n //If the ages match they must be false to be adults and both be opposite genders\r\n if(turn && !(age) && !(gender==map[x+1][y].getGender()) && (map[x][y].getHealth()>=20) && (map[x+1][y].getHealth()>=20) ){\r\n \r\n //Success rate of conceiving\r\n if( (Math.random()<=0.85) ){\r\n if( (y+1<gridLength) && (map[x][y+1]==null) && !(baby) ){ //Following ifs check to see if a baby can be made surrounding the intitiating sheep \r\n map[x][y+1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true; \r\n }\r\n if( (y-1>=0) && (map[x][y-1]==null) && !(baby) ){\r\n map[x][y-1]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if( (x-1>=0) && (map[x+1][y]==null) && !(baby) ){\r\n map[x-1][y]=new Sheep(10,0,true,true,(Math.random()>0.5)); \r\n baby=true;\r\n }\r\n if(baby){ //If baby is made then sheep will lose health and turn is therefore over \r\n map[x][y].lowerHealth(10);\r\n map[x+1][y].lowerHealth(10);\r\n map[x][y].setMovement(false);\r\n map[x+1][y].setMovement(false);\r\n turn=false;\r\n baby=false;\r\n }\r\n }\r\n } \r\n } \r\n if(x+2<gridLength){\r\n checkDown=true;\r\n }\r\n } \r\n \r\n //Movement towards plant only if no immediate sheep/plants are there to move to\r\n if(turn && checkRight && (map[x][y+2] instanceof Plant) ){\r\n if(map[x][y+1]==null){\r\n \r\n map[x][y+1]=map[x][y];\r\n map[x][y]=null;\r\n map[x][y+1].setMovement(false);\r\n turn=false;\r\n }\r\n }\r\n if(turn && checkDown && (map[x+2][y] instanceof Plant) ){\r\n if(map[x+1][y]==null){\r\n map[x+1][y]=map[x][y];\r\n map[x][y]=null;\r\n map[x+1][y].setMovement(false);\r\n turn=false;\r\n }\r\n } \r\n if(turn && checkUp && (map[x-2][y] instanceof Plant) ){\r\n if(map[x-1][y]==null){\r\n \r\n map[x-1][y]=map[x][y];\r\n map[x][y]=null;\r\n map[x-1][y].setMovement(false);\r\n turn=false;\r\n }\r\n }\r\n \r\n if(turn && checkLeft && (map[x][y-2] instanceof Plant) ){\r\n if(map[x][y-1]==null){\r\n map[x][y-1]=map[x][y];\r\n map[x][y]=null;\r\n map[x][y-1].setMovement(false);\r\n turn=false;\r\n }\r\n }\r\n \r\n //Random Movement if there are no plants to move towards \r\n if(turn && right && (random<=0.2) ){\r\n if(map[x][y+1]==null){\r\n map[x][y].setMovement(false);\r\n map[x][y+1]=map[x][y];\r\n map[x][y]=null; \r\n }\r\n }\r\n if(turn && left && (random>0.2) && (random<=0.4) ){\r\n if(map[x][y-1]==null){\r\n map[x][y].setMovement(false);\r\n map[x][y-1]=map[x][y];\r\n map[x][y]=null;\r\n }\r\n }\r\n if(turn && up && (random>0.4) && (random<=0.6) ){\r\n if(map[x-1][y]==null){\r\n map[x][y].setMovement(false);\r\n map[x-1][y]=map[x][y];\r\n map[x][y]=null;\r\n }\r\n }\r\n if(turn && down && (random>0.6) && (random<=0.8) ){\r\n if(map[x+1][y]==null){\r\n map[x][y].setMovement(false);\r\n map[x+1][y]=map[x][y];\r\n map[x][y]=null;\r\n }\r\n }\r\n }", "public void shoot(Graphics g, Pea[] p, Dooley d, int numPeas) {\r\n\t\tfor(int i = 0; i < numPeas; i++) {\r\n \t\tif(p[i].getMoving()) {\t\r\n \t\t\tp[i].setX(d.getX() + 17);\r\n \t\t\tp[i].paint(g);\r\n \t\t}\r\n \t}\r\n\t}", "public void updateState() {\n\n // After each frame, the unit has a slight morale recovery, but only up to the full base morale.\n morale = Math.min(morale + GameplayConstants.MORALE_RECOVERY, GameplayConstants.BASE_MORALE);\n\n if (morale < GameplayConstants.PANIC_MORALE) {\n state = UnitState.ROUTING;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.ROUTING);\n }\n } else if (state == UnitState.ROUTING && morale > GameplayConstants.RECOVER_MORALE) {\n this.repositionTo(averageX, averageY, goalAngle);\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.MOVING);\n }\n }\n\n // Update the state of each single and the average position\n double sumX = 0;\n double sumY = 0;\n double sumZ = 0;\n int count = 0;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.updateState();\n sumX += single.getX();\n sumY += single.getY();\n sumZ += single.getZ();\n count += 1;\n }\n averageX = sumX / count;\n averageY = sumY / count;\n averageZ = sumZ / count;\n\n // Updating soundSink\n soundSink.setX(averageX);\n soundSink.setY(averageY);\n soundSink.setZ(averageZ);\n\n // Update the bounding box.\n updateBoundingBox();\n\n // Update stamina\n updateStamina();\n }", "@Override\n public void doAction() {\n checkRep();\n if (!storedBalls.isEmpty()) {\n Ball ballToShootOut = storedBalls.remove();\n ballToShootOut.setVelocity(new Vect(0,STOREDBALLVELOCITY));\n ballToShootOut.setActive(true);\n }\n checkRep();\n }", "protected void execute() {\n \t\n \tcurrent_time = System.currentTimeMillis();\n \t\n \tlift.liftDown(LIFT_SPEED);\n }", "public int TakeStep()\n\t\t{\n\t\t// the eventual movement command is placed here\n\t\tVec2\tresult = new Vec2(0,0);\n\n\t\t// get the current time for timestamps\n\t\tlong\tcurr_time = abstract_robot.getTime();\n\n\n\t\t/*--- Get some sensor data ---*/\n\t\t// get vector to the ball\n\t\tVec2 ball = abstract_robot.getBall(curr_time);\n\n\t\t// get vector to our and their goal\n\t\tVec2 ourgoal = abstract_robot.getOurGoal(curr_time);\n\t\tVec2 theirgoal = abstract_robot.getOpponentsGoal(curr_time);\n\n\t\t// get a list of the positions of our teammates\n\t\tVec2[] teammates = abstract_robot.getTeammates(curr_time);\n\n\t\t// find the closest teammate\n\t\tVec2 closestteammate = new Vec2(99999,0);\n\t\tfor (int i=0; i< teammates.length; i++)\n\t\t\t{\n\t\t\tif (teammates[i].r < closestteammate.r)\n\t\t\t\tclosestteammate = teammates[i];\n\t\t\t}\n\n\n\t\t/*--- now compute some strategic places to go ---*/\n\t\t// compute a point one robot radius\n\t\t// behind the ball.\n\t\tVec2 kickspot = new Vec2(ball.x, ball.y);\n\t\tkickspot.sub(theirgoal);\n\t\tkickspot.setr(abstract_robot.RADIUS);\n\t\tkickspot.add(ball);\n\n\t\t// compute a point three robot radii\n\t\t// behind the ball.\n\t\tVec2 backspot = new Vec2(ball.x, ball.y);\n\t\tbackspot.sub(theirgoal);\n\t\tbackspot.setr(abstract_robot.RADIUS*5);\n\t\tbackspot.add(ball);\n\n\t\t// compute a north and south spot\n\t\tVec2 northspot = new Vec2(backspot.x,backspot.y+0.7);\n\t\tVec2 southspot = new Vec2(backspot.x,backspot.y-0.7);\n\n\t\t// compute a position between the ball and defended goal\n\t\tVec2 goaliepos = new Vec2(ourgoal.x + ball.x,\n\t\t\t\tourgoal.y + ball.y);\n\t\tgoaliepos.setr(goaliepos.r*0.5);\n\n\t\t// a direction away from the closest teammate.\n\t\tVec2 awayfromclosest = new Vec2(closestteammate.x,\n\t\t\t\tclosestteammate.y);\n\t\tawayfromclosest.sett(awayfromclosest.t + Math.PI);\n\n\n\t\t/*--- go to one of the places depending on player num ---*/\n\t\tint mynum = abstract_robot.getPlayerNumber(curr_time);\n\n\t\t/*--- Goalie ---*/\n\t\tif (mynum == 0)\n\t\t\t{\n\t\t\t// go to the goalie position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = goaliepos;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.1) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- midback ---*/\n\t\telse if (mynum == 1)\n\t\t\t{\n\t\t\t// go to a midback position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = backspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 2)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = northspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 4)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = southspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.3 )\n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*---Lead Forward ---*/\n\t\telse if (mynum == 3)\n\t\t\t{\n\t\t\t// if we are more than 4cm away from the ball\n\t\t\tif (ball.r > .3)\n\t\t\t\t// go to a good kicking position\n\t\t\t\tresult = kickspot;\n\t\t\telse\n\t\t\t\t// go to the ball\n\t\t\t\tresult = ball;\n\t\t\t}\n\n\n\t\t/*--- Send commands to actuators ---*/\n\t\t// set the heading\n\t\tabstract_robot.setSteerHeading(curr_time, result.t);\n\n\t\t// set speed at maximum\n\t\tabstract_robot.setSpeed(curr_time, 1.0);\n\n\t\t// kick it if we can\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\tabstract_robot.kick(curr_time);\n\n\t\t/*--- Send message to other robot ---*/\n\t\t// COMMUNICATION\n\t\t// if I can kick\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\t{\n\t\t\t// and I am robot #3\n\t\t\tif ((mynum==3))\n\t\t\t\t{\n\t\t\t\t// construct a message\n\t\t\t\tStringMessage m = new StringMessage();\n\t\t\t\tm.val = (new Integer(mynum)).toString();\n\t\t\t\tm.val = m.val.concat(\" can kick\");\n\n\t\t\t\t// send the message to robot 2\n\t\t\t\t// note: broadcast and multicast are also\n\t\t\t\t// available.\n\t\t\t\ttry{abstract_robot.unicast(2,m);}\n\t\t\t\tcatch(CommunicationException e){}\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- Look for incoming messages ---*/\n\t\t//COMMUNICATION\n\t\twhile (messagesin.hasMoreElements())\n\t\t\t{\n\t\t\tStringMessage recvd = \n\t\t\t\t(StringMessage)messagesin.nextElement();\n\t\t\tSystem.out.println(mynum + \" received:\\n\" + recvd);\n\t\t\t}\n\n\t\t// tell the parent we're OK\n\t\treturn(CSSTAT_OK);\n\t\t}", "public void shoot() {\r\n\t\twhile (rounds > 1) {\r\n\t\t\trounds--;\r\n\t\t\tSystem.out.println(gunType + \" is shooting now\\n\" + rounds + \" \\nCLACK! CLACK! CLAK! CLAK! CLAK!\");\r\n\t\t\tif (rounds == 1) {\r\n\t\t\t\tSystem.out.println(\"Magazine's Empty!! \\nRELOAD!!\\nRELOAD!!!\\nRELAOD!!!\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "@Override\n //Runs the game. Contains the overall game loop\n public void run() {\n Pool.initializePool();\n //Initialize the game\n initializeGame();\n \n //Main game loop\n while (true) {\n //Sequence of evaluating for each bird its coordinate as well as the\n //next tube's, updates the game by detecting collisions and if the bird\n //should flap, and learns by determining the fitness of the best bird. \n eval();\n update();\n learn();\n\n //Redraws the game\n repaint();\n \n //Adjusts the speed of the game by reducing the sleeptime. Adjusted if \n //user clicks mouse button\n try {\n if(!speedUp)\n Thread.sleep(20L);\n else\n Thread.sleep(2L);\n } catch (final InterruptedException e) {\n }\n }\n }", "public void act() \n {\n moveAround(); \n addBomb(); \n touchGhost(); \n }", "protected void execute() \n {\n \tRobot.ballManipSubsystem.setTopRollerToShootingSpeed();\n }", "public void tick(){\r\n if(MouseManager.mousePressed){ // Checks to see if the mouse has been clicked.\r\n if(Game.mouseX >= 390 && Game.mouseX <= 610 && Game.mouseY >= 415 && Game.mouseY < 500){\r\n // If the mouse is clicked and the button is hovered, resets the lost and tied variables to false,\r\n // and then sets the State to betState, getting ready for a new hand.\r\n GameState.lost = false; // ...\r\n GameState.tied = false; // ...\r\n State.setState(game.betState); // ...\r\n }\r\n }\r\n }", "static public void proccessGame(){\n int nextBallLeft = settingOfTheGame.getBallX() + settingOfTheGame.getBallDeltaX();\n int nextBallRight = settingOfTheGame.getBallX() + settingOfTheGame.getDiameter() + settingOfTheGame.getBallDeltaX();\n int nextBallTop = settingOfTheGame.getBallY() + settingOfTheGame.getBallDeltaY();\n int nextBallBottom = settingOfTheGame.getBallY() + settingOfTheGame.getDiameter() + settingOfTheGame.getBallDeltaY();\n\n int playerOneRight = settingOfTheGame.getFirst().getPlayerX() + settingOfTheGame.getFirst().getPlayerX();\n int playerOneTop = settingOfTheGame.getFirst().getPlayerY();\n int playerOneBottom = settingOfTheGame.getFirst().getPlayerY() + settingOfTheGame.getFirst().getPlayerHeight();\n\n float playerTwoLeft = settingOfTheGame.getSecond().getPlayerX();\n float playerTwoTop = settingOfTheGame.getSecond().getPlayerY();\n float playerTwoBottom = settingOfTheGame.getSecond().getPlayerY() + settingOfTheGame.getSecond().getPlayerHeight();\n\n //ball bounces off top and bottom of screen\n if (nextBallTop < 0 || nextBallBottom > 600) {\n settingOfTheGame.setBallDeltaY(settingOfTheGame.getBallDeltaY()*(-1));\n }\n\n //will the ball go off the left side?\n if (nextBallLeft < playerOneRight) {\n //is it going to miss the paddle?\n if (nextBallTop > playerOneBottom || nextBallBottom < playerOneTop) {\n\n Score.second++;\n\n if (Score.second == 3) {\n settingOfTheGame.setPlaying(false);\n settingOfTheGame.setGameOver(true);\n }\n\n settingOfTheGame.setBallX(250);\n settingOfTheGame.setBallY(250);\n } else {\n settingOfTheGame.setBallDeltaX(settingOfTheGame.getBallDeltaX()*(-1));\n }\n }\n\n //will the ball go off the right side?\n if (nextBallRight > playerTwoLeft) {\n //is it going to miss the paddle?\n if (nextBallTop > playerTwoBottom || nextBallBottom < playerTwoTop) {\n\n Score.first++;\n\n if (Score.first == 3) {\n settingOfTheGame.setPlaying(false);\n settingOfTheGame.setGameOver(true);\n }\n\n settingOfTheGame.setBallX(250);\n settingOfTheGame.setBallY(250);\n } else {\n settingOfTheGame.setBallDeltaX(settingOfTheGame.getBallDeltaX()*(-1));\n }\n }\n\n //move the ball\n settingOfTheGame.setBallX(settingOfTheGame.getBallX()+settingOfTheGame.getBallDeltaX()); //ballX += ballDeltaX;\n settingOfTheGame.setBallY(settingOfTheGame.getBallY()+settingOfTheGame.getBallDeltaY());//ballY += ballDeltaY;\n }", "@Override\n public void execute() {\n // Shooter is up to speed and hasn't shot a ball since it sped up, then run\n // index to fire a ball\n inThreshold = Globals.flyWheelSpeed > shooterPID.flyWheelSpeedMinimum\n && Globals.flyWheelSpeed < shooterPID.flyWheelSpeedMinimum + 100;\n if (inThreshold && alreadyRun == false) {\n index.run(Constants.indexSpeed);\n timer.start();\n alreadyRun = true;\n ballsShot++;\n // Once the index has run for long enough to fire a ball, stop running the index\n } else if (inThreshold && alreadyRun == true && timer.get() > Constants.indexRunTime) {\n index.run(0);\n alreadyRun = false;\n // Once the shooter has lost speed due to shooting the ball, set alreadyRun to\n // false\n // so that the next time it gets up to speed, a ball can be fired again\n } else if (!inThreshold) {\n alreadyRun = false;\n index.run(0);\n // by default, set index to 0 speed.\n } else {\n index.run(0);\n }\n }", "public void doAction()\n {\n \n //Location of the player\n int cX = w.getPlayerX();\n int cY = w.getPlayerY();\n \n //Basic action:\n //Grab Gold if we can.\n if (w.hasGlitter(cX, cY))\n {\n w.doAction(World.A_GRAB);\n return;\n }\n \n //Basic action:\n //We are in a pit. Climb up.\n if (w.isInPit())\n {\n w.doAction(World.A_CLIMB);\n return;\n }\n //Test the environment\n /*if (w.hasBreeze(cX, cY))\n {\n System.out.println(\"I am in a Breeze\");\n }\n if (w.hasStench(cX, cY))\n {\n System.out.println(\"I am in a Stench\");\n }\n if (w.hasPit(cX, cY))\n {\n System.out.println(\"I am in a Pit\");\n }\n if (w.getDirection() == World.DIR_RIGHT)\n {\n System.out.println(\"I am facing Right\");\n }\n if (w.getDirection() == World.DIR_LEFT)\n {\n System.out.println(\"I am facing Left\");\n }\n if (w.getDirection() == World.DIR_UP)\n {\n System.out.println(\"I am facing Up\");\n }\n if (w.getDirection() == World.DIR_DOWN)\n {\n System.out.println(\"I am facing Down\");\n }\n */\n \n //decide next move\n if(w.hasStench(cX, cY)&&w.hasArrow())//Wumpus can be shot if located\n {\n if((w.hasStench(cX, cY+2))||(w.hasStench(cX-1, cY+1)&&w.isVisited(cX-1, cY))||(w.hasStench(cX+1, cY+1)&&w.isVisited(cX+1, cY)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX+2, cY))||(w.hasStench(cX+1, cY-1)&&w.isVisited(cX, cY-1))||(w.hasStench(cX+1, cY+1)&&w.isVisited(cX, cY+1)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX, cY-2))||(w.hasStench(cX-1, cY-1)&&w.isVisited(cX-1, cY))||(w.hasStench(cX+1, cY-1)&&w.isVisited(cX+1, cY)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX-2, cY))||(w.hasStench(cX-1, cY+1)&&w.isVisited(cX, cY+1))||(w.hasStench(cX-1, cY-1)&&w.isVisited(cX, cY-1)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n else if(cX==1&&cY==1) //First tile. Shoot North. If wumpus still alive, store its location as (2,1) to avoid it\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n if(w.hasStench(cX, cY))\n {\n wumpusLoc[0] = 2;\n wumpusLoc[1] = 1;\n }\n }\n else if(cX==1&&cY==4) //Condition for corner\n {\n if(w.isVisited(1, 3))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(2, 4))\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if(cX==4&&cY==1) //Condition for corner\n {\n if(w.isVisited(3, 1))\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(4, 2))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if(cX==4&&cY==4) //Condition for corner\n {\n if(w.isVisited(3, 4))\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(4, 3))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if((cX==1)&&(w.isVisited(cX+1, cY-1))) //Condition for edge\n {\n \n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((cX==4)&&(w.isVisited(cX-1, cY-1))) //Condition for edge\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((cY==1)&&(w.isVisited(cX-1, cY+1))) //Condition for edge\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else if((cY==4)&&(w.isVisited(cX-1, cY-1))) //Condition for edge\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else //Can't locate wumpus, go back to safe location\n {\n turnTo((w.getDirection()+2)%4);\n w.doAction(World.A_MOVE);\n }\n }\n else // No stench. Explore \n {\n if(w.isValidPosition(cX, cY-1)&&!w.isVisited(cX, cY-1)&&isSafe(cX, cY-1)) \n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX+1, cY)&&!w.isVisited(cX+1, cY)&&isSafe(cX+1, cY))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX-1, cY)&&!w.isVisited(cX-1, cY)&&isSafe(cX-1,cY))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_MOVE);\n }\n else\n {\n if(w.isValidPosition(cX, cY+1))\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX+1, cY))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX-1, cY))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_MOVE);\n }\n }\n }\n \n }", "protected void execute() {\n timeRunning = timeSinceInitialized();\n if (!Robot.lifter2.getunder15()) {\n Robot.shooter.set(190);\n System.out.println(\"In position: \"+inPosition.get());\n } else {\n System.out.println(\"under angle don't shoot!\");\n }\n \n }", "public Answer shoot(){\n if (this.isOccuped()){\n this.ship.hit();\n if (this.ship.hasBeenSunk()){\n\tthis.hasBeenShot = true;\n return Answer.SUNK;\n }\n else{\n\tthis.hasBeenShot = true;\n return Answer.HIT;\n }\n }\n else{\n this.hasBeenShot = true;\n return Answer.MISSED;\n }\n }", "public void run() {\r\n this.createBallsOnTopOfPaddle();\r\n this.running = true;\r\n this.runner.run(new CountdownAnimation(2, 3, sprites));\r\n this.runner.run(this);\r\n }", "public void update()\n\t{\n\t\t//\tTHE WORLD HAS ENDED DO NOT EXECUTE FURTHER\n\t\tif( end )\n\t\t{\n\t\t\tsafeEnd = true;\n\t\t\treturn;\n\t\t}\n\n\t\t//Plot graphics\n\t\tif(plot){\n\t\t\thealthyFunction.show(infectedFunction, healthyFunction);\n\t\t\tbusFunction.show(infectedFunction, seasFunction, busFunction, colFunction, ellFunction, smpaFunction, lawFunction);\n\t\t\tplot = false;\n\t\t}\n\n\t\t//\tsafe point to manage human/zombie ratios\n\t\t//\tTODO: Modify infect to also switch zombies to humans\n\t\tinfect();\n\t\tgetWell();\n\t\taddFromQueue();\n\n\t\t//\tupdate all entities\n\t\tfor( Zombie z: zombies )\n\t\t{\n\t\t\tz.update(zombiesPaused);\n\t\t}\n\t\tfor( Entity h: humans )\n\t\t{\n\t\t\th.update(humansPaused);\n\t\t}\n\n\t\tif( zc!=zombies.size() || hc!=humans.size() )\n\t\t{\n\t\t\tzc = zombies.size();\n\t\t\thc = humans.size();\n\t\t\tSystem.out.println(zc+\"/\"+hc);\n\t\t}\n\n\t\t//Add points to our functions\n\t\thealthyFunction.add(time,humans.size());\n\t\tinfectedFunction.add(time,zombies.size());\n\t\tseascount = smpacount = ellcount = lawcount = buscount = colcount = 0;\n\t\tfor (int i = 0; i < humans.size(); i++) {\n\t\t\tEntity curr = humans.get(i);\n\t\t\tif (curr instanceof SEAS) {\n\t\t\t\tseascount++;\n\t\t\t} else if (curr instanceof SMPA) {\n\t\t\t\tsmpacount++;\n\t\t\t} else if (curr instanceof Elliot) {\n\t\t\t\tellcount++;\n\t\t\t} else if (curr instanceof Law) {\n\t\t\t\tlawcount++;\n\t\t\t} else if (curr instanceof Business) {\n\t\t\t\tbuscount++;\n\t\t\t} else if (curr instanceof Columbian) {\n\t\t\t\tcolcount++;\n\t\t\t}\n\t\t}\n\t\tbusFunction.add(time, buscount);\n\t\tcolFunction.add(time, colcount);\n\t\tellFunction.add(time, ellcount);\n\t\tlawFunction.add(time, lawcount);\n\t\tsmpaFunction.add(time, smpacount);\n\t\tseasFunction.add(time, seascount);\n\t\ttime++;\n\t}", "public void tick(){\n\t\tfor(int i=0;i<object.size(); i++){\n\t\t\ttempObject = object.get(i);\n\t\t\ttempObject.tick(object);\n\t\t\tif(tempObject.getId() == ObjectId.Player){\n\t\t\t\tif(tempObject.position.x == MouseInput.exitPosition.x&&\n\t\t\t\t tempObject.position.y == MouseInput.exitPosition.y){\n\t\t\t\t\tgame.score += game.timeLeft;\n\t\t\t\t\tSystem.out.println(\"exited\");\n\t\t\t\t\tgame.levelCompleted=true;\n\t\t\t\t}\n\t\t\t\tif(game.player.health <= 0){\n\t\t\t\t\tobject.clear();\n\t\t\t\t\tgame.gameLoop=1;\n\t\t\t\t\tgame.State=STATE.GAMEOVER;\n\t\t\t}\n\t\t}\n\t\t// bomb is null when exploded\t\t\n\t\tif(Bomb.exploded(bomb, object)){\n\t\t\tbomb=null;\t\t\t\n\t\t}\n\t\t\n\t\tif(System.currentTimeMillis()-Player.tHit < 3000){\n\t\t\tPlayer.invincible = true;\n\t\t}\n\t\telse{\n\t\t\tPlayer.invincible = false;\n\t\t}\n\t\t\n\t\tif(Power.consumed(power, object)) {\n\t\t\tpower=null;\n\t\t}\n\t\t}\n\t\t\n\t}", "public BSGameState(BSGameState bs) {\n this.humanPlayerBoard = new int[10][10];\n this.computerPlayerBoard = new int[10][10];\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n this.humanPlayerBoard[i][j] = bs.humanPlayerBoard[i][j];\n this.computerPlayerBoard[i][j] = bs.computerPlayerBoard[i][j];\n }\n }\n // initalize rest of data\n turnCode = bs.turnCode;\n humanPlayerHits = bs.humanPlayerHits;\n computerPlayerHits = bs.computerPlayerHits;\n inGame = true;\n\n playerShips = new Ship[5];\n computerShips = new Ship[5];\n\n for (int i = 0; i < 5; i++) {\n playerShips[i] = bs.playerShips[i];\n computerShips[0] = bs.computerShips[i];\n }\n computerPlayerMiss = bs.computerPlayerMiss;\n humanPlayerMiss = bs.humanPlayerMiss;\n }", "public void step() {\r\n\t\tcard1 = player1.getCard();\r\n\t\tcard2 = player2.getCard();\r\n\t\twarPile.add(card1);\r\n\t\twarPile.add(card2);\r\n\t\tgameState = \"Player 1: \" + card1 + \"\\n\" + \"Player 2: \" + card2 + \"\\n\";\r\n\t\tif(card1.getRank() == card2.getRank()) {\r\n\t\t\tgameState = \"Cards added to the War Pile\" + \"\\n\";\r\n\t\t}else if(card1.getRank() > card2.getRank()){\r\n\t\t\ttransferCards(player1);\r\n\t\t\tgameState = \"Cards go to Player 1 \\n\";\r\n\t\t}else {\r\n\t\t\ttransferCards(player2);\r\n\t\t\tgameState = \"Cards go to Player 2 \\n\";\r\n\t\t}\r\n\t\tmoves ++;\r\n\t}", "@Override\n\tpublic void Animate(Batch batch, float x, float y, float width, float height, float stateTime) {\n\t\tdifferenceTime = stateTime - differenceTime;\n\t\tloopTime+=differenceTime;\n\t\tif(biting){\n\t\t\tif(currentDirection == Direction.LEFT){\n\t\t\t\tbatch.draw(biteRight.getKeyFrame(loopTime, false), x, y, width, height);\n\t\t\t\tif(biteRight.isAnimationFinished(loopTime)){\n\t\t\t\t\t//entity.setCurrentState(new NormalFishState(entity));\n\t\t\t\t\tentity.setAnimationBehavior(new AnimateSimpleFish(entity, currentDirection));\n\t\t\t\t\tbiting = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbatch.draw(biteLeft.getKeyFrame(loopTime, false), x, y, width, height);\n\t\t\t\tif(biteLeft.isAnimationFinished(loopTime)){\n\t\t\t\t\t//entity.setCurrentState(new NormalFishState(entity));\n\t\t\t\t\tentity.setAnimationBehavior(new AnimateSimpleFish(entity, currentDirection));\n\t\t\t\t\tbiting = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(turning){\n\t\t\tif(currentDirection == Direction.RIGHT){\n\t\t\t\tbatch.draw(turnRight.getKeyFrame(loopTime, false), x, y, width, height);\n\t\t\t\tif(turnRight.isAnimationFinished(loopTime)){\n\t\t\t\t\tturning = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbatch.draw(turnLeft.getKeyFrame(loopTime, false), x, y, width, height);\n\t\t\t\tif(turnLeft.isAnimationFinished(loopTime)){\n\t\t\t\t\tturning = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(currentDirection == Direction.RIGHT){\n\t\t\t\tbatch.draw(right.getKeyFrame(stateTime), x, y, width, height);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbatch.draw(left.getKeyFrame(stateTime), x, y, width, height);\n\t\t\t}\t\n\t\t}\n\t\tdifferenceTime = stateTime;\n\t}", "private void physicsTickAlive() {\n\t\t// Physics stuff\n\t\tsetThrusts();\n\t\tmoveEverything(deltaTimeAlive);\n\t\tageScoreMarkers(deltaTimeAlive);\n\t\tshootBullets();\n\t\t\n\t\tcollideTankToWall();\n\t\tcollideTankToTank();\n\t\tcollideBulletToWall();\n\t\tcollideBulletToTank();\n\t}", "public void runAnimation() {\n int fps = 0;\n int frames = 0;\n long totalTime = 0;\n long curTime = System.currentTimeMillis();\n long lastTime = curTime;\n // Start the loop.\n while (true) {\n try {\n // Calculations for FPS.\n lastTime = curTime;\n curTime = System.currentTimeMillis();\n totalTime += curTime - lastTime;\n if (totalTime > 1000) {\n totalTime -= 1000;\n fps = frames;\n frames = 0;\n }\n ++frames;\n // clear back buffer...\n g2d = buffer.createGraphics();\n g2d.setColor(Color.WHITE);\n g2d.fillRect(0, 0, X, Y);\n // Draw entities\n ArrayList<Spawn> living = new ArrayList<Spawn>();\n if (engine != null) {\n living.addAll(engine.getFullState().living);\n }\n for (int i = 0; i < living.size(); i++) {\n g2d.setColor(Color.BLACK);\n Spawn s = living.get(i);\n g2d.fill(new Ellipse2D.Double(s.getX(), s.getY(), s.getRadius() * 2, s.getRadius() * 2));\n }\n for (int i = 0; i < living.size(); i++) {\n g2d.setColor(Color.RED);\n Spawn s = living.get(i);\n g2d.drawLine((int) (s.getCenterX()), (int) (s.getCenterY()), (int) (s.getCenterX() + s.vx()), (int) (s.getCenterY() + s.vy()));\n }\n // display frames per second...\n g2d.setFont(new Font(\"Courier New\", Font.PLAIN, 12));\n g2d.setColor(Color.GREEN);\n g2d.drawString(String.format(\"FPS: %s\", fps), 20, 20);\n // Blit image and flip...\n graphics = b.getDrawGraphics();\n graphics.drawImage(buffer, 0, 0, null);\n if (!b.contentsLost())\n b.show();\n // Let the OS have a little time...\n Thread.sleep(15);\n } catch (InterruptedException e) {\n } finally {\n // release resources\n if (graphics != null)\n graphics.dispose();\n if (g2d != null)\n g2d.dispose();\n }\n }\n }", "@Override\n public void hero_dies() {\n SoundPlayer.playHeroDies();\n this.stop();\n\n get_hero().setPosition(PLAYER_START_POSITION);\n start();\n\n // setting every flower to its original position\n //reason: hero can knock the flower out of the pipe when it hits it\n for (int i = 0; i < get_pipes().size(); i++) {\n if (get_pipes().get(i).with_flower()) {\n get_pipes().get(i).get_flower().setLinearVelocity(new Vec2(0f, 0f));\n get_pipes().get(i).get_flower().setPosition(get_pipes().get(i).get_flower().get_original_position());\n }\n }\n \n for (int i = 0; i < get_fire_rods().size(); i++) {\n get_fire_rods().get(i).reset_position();\n }\n get_hero().addLife(-1);\n if (get_hero().get_life() < 1){\n getGameController().gameOver();\n //get_sound_player().stop_level_two_music();\n }\n }", "@Override\n public void update(GameContainer gc, StateBasedGame stateBasedGame, int delta) throws SlickException {\n timeSinceStart += delta;\n rtimeSinceStart += delta;\n Input input = gc.getInput();\n int mouseX = input.getMouseX();\n int mouseY = input.getMouseY();\n\n\n basicbulletSheet.rotate(90f);\n basicbulletSheet.setCenterOfRotation(16, 16);\n\n // Move this bullet\n for (int i = 0; i < bulletList.size(); i++) {\n bullet = bulletList.get(i);\n bullet.move();\n }\n\n //Add this tower to the this towerList\n if (Tower.isBasicPlaced()) {\n basicTowers.add(new BasicTower());\n System.out.println(basicTowers);\n Tower.setBasicPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isBomberPlaced()) {\n bomberTowers.add(new BomberTower());\n System.out.println(bomberTowers);\n Tower.setBomberPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isSniperPlaced()) {\n sniperTowers.add(new SniperTower());\n System.out.println(sniperTowers);\n Tower.setSniperPlaced(false);\n }\n\n //Add this tower to the this towerList\n if (Tower.isQuickPlaced()) {\n quickTowers.add(new QuickTower());\n System.out.println(quickTowers);\n Tower.setQuickPlaced(false);\n }\n\n //For this tower, calculate how often this tower will shoot bullets\n for (BasicTower basicTower1 : basicTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n if (rtimeSinceStart > basicTower1.rcoolDown + basicTower1.rlastShot) {\n if (enemy.Playrect.intersects(basicTower1.Radius)) {\n basicTower1.basicClicked.setRotation((float) getTargetAngle(basicTower1.towerX,\n basicTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n basicTower1.basicClicked.setCenterOfRotation(32, 32);\n basicTower1.rlastShot = rtimeSinceStart;\n }\n }\n if (timeSinceStart > basicTower1.coolDown + basicTower1.lastShot) {\n if (enemy.Playrect.intersects(basicTower1.Radius)) {\n addNewBullet2(basicTower1.towerX, basicTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 10);\n basicTower1.lastShot = timeSinceStart;\n }\n\n }\n }\n }\n\n //For this tower, calculate how often this tower will shoot bullets\n for (BomberTower bomberTower1 : bomberTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n if (rtimeSinceStart > bomberTower1.rcoolDown + bomberTower1.rlastShot) {\n if (enemy.Playrect.intersects(bomberTower1.Radius)) {\n bomberTower1.bomberClicked.setRotation((float) getTargetAngle(bomberTower1.bombertowerX,\n bomberTower1.bombertowerY, enemy.getStartPosX(), enemy.getStartPosY()));\n bomberTower1.bomberClicked.setCenterOfRotation(32, 32);\n bomberTower1.rlastShot = rtimeSinceStart;\n }\n }\n if (timeSinceStart > bomberTower1.coolDown + bomberTower1.lastShot) {\n if (enemy.Playrect.intersects(bomberTower1.Radius)) {\n addNewBullet2(bomberTower1.bombertowerX, bomberTower1.bombertowerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 10);\n bomberTower1.lastShot = timeSinceStart;\n }\n }\n }\n }\n //For this tower, calculate how often this tower will shoot bullets\n for (SniperTower sniperTower1 : sniperTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n\n if (rtimeSinceStart > sniperTower1.rcoolDown + sniperTower1.rlastShot) {\n if (enemy.Playrect.intersects(sniperTower1.Radius)) {\n sniperTower1.sniperClicked.setRotation((float) getTargetAngle(sniperTower1.towerX,\n sniperTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n sniperTower1.sniperClicked.setCenterOfRotation(32, 32);\n sniperTower1.rlastShot = rtimeSinceStart;\n }\n }\n\n if (timeSinceStart > sniperTower1.coolDown + sniperTower1.lastShot) {\n if (enemy.Playrect.intersects(sniperTower1.Radius)) {\n addNewBullet2(sniperTower1.towerX, sniperTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 50);\n sniperTower1.lastShot = timeSinceStart;\n }\n\n }\n }\n }\n //For this tower, calculate how often this tower will shoot bullets\n for (QuickTower quickTower1 : quickTowers) {\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 10);\n\n if (rtimeSinceStart > quickTower1.rcoolDown + quickTower1.rlastShot) {\n if (enemy.Playrect.intersects(quickTower1.Radius)) {\n quickTower1.quickClicked.setRotation((float) getTargetAngle(quickTower1.towerX,\n quickTower1.towerY, enemy.getStartPosX(), enemy.getStartPosY()));\n quickTower1.quickClicked.setCenterOfRotation(32, 32);\n quickTower1.rlastShot = rtimeSinceStart;\n }\n }\n\n\n if (timeSinceStart > quickTower1.coolDown + quickTower1.lastShot) {\n if (enemy.Playrect.intersects(quickTower1.Radius)) {\n radiusVisited = true;\n addNewBullet2(quickTower1.towerX, quickTower1.towerY, enemy.getStartPosX(),\n enemy.getStartPosY(), 5);\n quickTower1.lastShot = timeSinceStart;\n }\n }\n\n }\n }\n\n //A spawn is in progress\n if (spawninProgress) {\n timePassedEnemy += delta;\n if (timePassedEnemy > 800) {\n enemies.add(new Enemy());\n enemySpawns++;\n timePassedEnemy = 0;\n }\n }\n //When enough enemies has spawned, stop the spawninProgress\n if (enemySpawns == enemyCounter) {\n spawninProgress = false;\n //hasbeenDead = false;\n enemySpawns = 0;\n enemyCounter++;\n }\n\n //When no more enemies on maps\n if (enemies.size() == 0) {\n waveinProgress = false;\n startWaveCount = 0;\n }\n\n //Start a new level when there's no more enemies on the map\n if (loadMap.MAP[mouseY / w][mouseX / w] == 16) {\n if (input.isMousePressed(0) && startWaveCount == 0 && !waveinProgress) {\n startWaveCount++;\n if (startWaveCount == 1 && enemies.size() == 0 && !waveinProgress) {\n waveinProgress = true;\n gc.resume();\n spawninProgress = true;\n currentLevel++;\n }\n }\n }\n\n //For each new level, increase the HP of each enemy\n if (currentLevel < currentLevel + 1 && !waveinProgress) {\n for (Enemy enemyHP : enemies) {\n if (enemyHP.getStartPosX() <= 0 && enemyHP.getHP() < enemyHP.startHP + currentLevel) {\n enemyHP.setHP(enemyHP.getHP() + currentLevel);\n }\n }\n }\n\n\n //For each enemies, if enemies has finished their way, decrease player HP\n //and set them inactive\n for (Enemy enemyList : enemies) {\n if (enemyList.counter >= enemyList.path.getLength() - 1) {\n player.decreaseLife();\n bulletCount = 0;\n enemyList.isActive = false;\n }\n\n //If enemies' hp is zero, set them inactive and remove from the list\n if (enemyList.getHP() <= 0) {\n enemyList.isActive = false;\n bulletCount = 0;\n player.addCredits(20);\n }\n enemyList.update(gc, stateBasedGame, delta);\n }\n for (int i = 0; i < enemies.size(); i++) {\n if (!enemies.get(i).isActive) {\n enemies.remove(enemies.get(i));\n }\n }\n\n //For all objects, update\n for (GameObject obj : objects)\n try {\n obj.update(gc, stateBasedGame, delta);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n //Go to Menu\n if (gc.getInput().isKeyPressed(Input.KEY_ESCAPE)) {\n gc.getInput().clearKeyPressedRecord();\n stateBasedGame.enterState(2);\n }\n\n\n }", "public void tick() {\r\n\r\n\t\tif (!targeted) {\r\n\t\t\tTarget = acquireTarget();\r\n\t\t} else if (timeSinceLastShot > firingSpeed) {\r\n\t\t\tangle = calculateAngle();\r\n\t\t\tshoot(Target);\r\n\t\t\ttimeSinceLastShot = 0;\r\n\t\t}\r\n\t\tif (Target == null || Target.isAlive() == false) {\r\n\t\t\ttargeted = false;\r\n\t\t}\r\n\r\n\t\ttimeSinceLastShot += Delta();\r\n\r\n\t\tfor (Dart dart : darts) {\r\n\t\t\tdart.tick();\r\n\t\t}\r\n\r\n\t\tdraw();\r\n\t}", "public int[] guess(GameState pState, Deadline pDue) {\n /*\n * Here you should write your clever algorithms to guess the species of\n * each bird. This skeleton makes no guesses, better safe than sorry!\n */\n\n double logProb;\n int[] lguess = new int[pState.getNumBirds()];\n int species;\n\n for (int i = 0; i < pState.getNumBirds(); ++i) {\n species = -1;\n logProb = Double.NEGATIVE_INFINITY;\n Bird currentBird = pState.getBird(i);\n\n double[][] observations = new double[currentBird.getSeqLength()][1];\n for (int j = 0; j < currentBird.getSeqLength(); j++) {\n if (currentBird.wasAlive(j)) {\n observations[j][0] = currentBird.getObservation(j);\n }\n }\n\n for (int j = 0; j < nbSpecies; j++) {\n if (listHMM[j] != null) {\n HMMOfBirdSpecies currentHMM = listHMM[j];\n double newLogProb = currentHMM.SequenceLikelihood(observations);\n // System.err.println(\"Species \" + speciesName(j) + \" Prob = \" + newLogProb);\n if (newLogProb > logProb) {\n logProb = newLogProb;\n species = j;\n }\n }\n\n }\n\n if (species == -1 || logProb < - 200) {\n for (int k = 0; k < nbSpecies; k++) {\n if (listHMM[k] == null) {\n species = k;\n logProb = Double.NEGATIVE_INFINITY;\n break;\n }\n }\n }\n\n System.err.println(\"Estimation for Bird number \" + i + \" \" + speciesName(species) + \" with p :\" + logProb);\n lguess[i] = species;\n\n }\n guess = lguess.clone();\n return lguess;\n }", "@Override\n public DirType getMove(GameState state) {\n if (print) System.out.println(\"\\n\\n\");\n this.gb.update(state); // Must be done every turn\n this.findEnemySnake(); // Update Enemy Snake's head Location\n this.markDangerTiles(); // Mark tiles the Enemy Snake can reach and filled\n if (print) this.gb.printBoard();\n if (print) System.out.println(\"DIVEBOMB ENTER -> Us_X: \" + this.us_head_x + \", Us_Y: \" + this.us_head_y + \" -> \" + this.us_num);\n Tile target = this.diveBomb();\n if (print) System.out.print(\"DIVEBOMB EXIT -> Target_X: \" + target.getX() + \" Target_Y: \" + target.getY());\n DirType retVal = getDir(target);\n if (print) System.out.println(\" Dir: \" + retVal);\n\n\n if (this.us_num == 0) {\n System.out.println(\"\\n\\n\\n\");\n GameBoard gb= new GameBoard(state, 1,0);\n gb.update(state);\n float val = USuckUnless.grade(state, this.us_num, DirType.South);\n System.out.println(val);\n this.gb.printBoard();\n }\n return retVal;\n }", "public void playOneTurn() {\r\n //the number of balls in the game\r\n this.ballCounter = new Counter(this.levelInformation.numberOfBalls());\r\n Sleeper sleeper = new Sleeper();\r\n\r\n this.runner = new AnimationRunner(gui, 60, sleeper);\r\n this.paddle.getRectangle().setUpperLeft(new Point(WIDTH_SCREEN / 2 - (this.levelInformation.paddleWidth() / 2),\r\n HI_SCREEN - 40));\r\n //initialize the balls\r\n initializeBall();\r\n\r\n //start the game by counting down\r\n if (this.sprites != null) {\r\n this.runner.run(new CountdownAnimation(2, 4, this.sprites));\r\n }\r\n //run the game\r\n this.running = true;\r\n this.runner.run(this);\r\n\r\n }", "public void shoot() {\n\n //DOWN\n if (moveDown && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (5 + this.getySpeed()) * this.getBulletSpeedMulti());\n\n } else if (moveDown && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (-5 + this.getySpeed() / 2) * this.getBulletSpeedMulti());\n } else if (moveDown && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n } else if (moveDown && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n }\n\n //UP\n else if (moveUp && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (5 + this.getySpeed() / 2) * this.getBulletSpeedMulti());\n\n } else if (moveUp && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), (-5 + this.getySpeed()) * this.getBulletSpeedMulti());\n\n } else if (moveUp && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n } else if (moveUp && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), (this.getySpeed()) * this.getBulletSpeedMulti());\n }\n\n //LEFT \n else if (moveLeft && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (5) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (-5) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (-5 + this.getxSpeed()) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } else if (moveLeft && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (5 + this.getxSpeed() / 2) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n }\n\n //RIGHT\n else if (moveRight && shootDown) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (5) * this.getBulletSpeedMulti());\n } else if (moveRight && shootUp) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (this.getxSpeed()) * this.getBulletSpeedMulti(), (-5) * this.getBulletSpeedMulti());\n } else if (moveRight && shootLeft) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (-5 + this.getxSpeed() / 2) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } else if (moveRight && shootRight) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), (5 + this.getxSpeed()) * this.getBulletSpeedMulti(), (0) * this.getBulletSpeedMulti());\n } //STANDING STILL\n \n \n if (shootDown && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), 5 * this.getBulletSpeedMulti());\n } else if (shootUp && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 0 * this.getBulletSpeedMulti(), -5 * this.getBulletSpeedMulti());\n\n } else if (shootLeft && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), -5 * this.getBulletSpeedMulti(), 0 * this.getBulletSpeedMulti());\n\n } else if (shootRight && !moving) {\n bController.addBullet(\"playerbullet.png\",this.getxPos(), this.getyPos(), this.getRadius(), 5 * this.getBulletSpeedMulti(), 0 * this.getBulletSpeedMulti());\n\n }\n }", "public void stolenMonster(GameState state) {\n }", "public void firePS()\n\t{\n\t\tif(gameObj[1].size() > 0 && ((PlayerShip)gameObj[1].get(0)).getMissileCount() > 0)\n\t\t{\n\t\t\t/*Create a new Missile\n\t\t\t * and set its location equal \n\t\t\t * to the PlayerShip and speed greater than\n\t\t\t * that of the PlayerShip\n\t\t\t */\n\t\t\tMissile mis = new Missile(false);\n\t\t\tmis.setDirection(((PlayerShip)gameObj[1].get(0)).getLauncher().getDirection());\n\t\t\tmis.setLocation(gameObj[1].get(0).getLocation());\n\t\t\tmis.setSpeed(((PlayerShip)gameObj[1].get(0)).getSpeed() + 4);\t\n\t\t\t//call fireMissile method from PlayerShip to decrement missile count\n\t\t\t((PlayerShip)gameObj[1].get(0)).fireMissile();\t\n\t\t\t//add Missile to the game world\n\t\t\tgameObj[4].add(mis);\n\t\t\tSystem.out.println(\"PS has fired a misile\");\t\n\t\t}else\n\t\t\tSystem.out.println(\"A player ship is not currently spawned or no missiles are left\");\n\t}", "public void move() {\n\t\tsetHealth(getHealth() - 1);\n\t\t//status();\n\t\tint row = getPosition().getRow() ;\n\t\tint column = getPosition().getColumn();\n\t\tint randomInt = (int)((Math.random()*2) - 1);\n\t\t\n\t\tif(hunter == false && row < 33) {\n\t\t\tif(row == 32) {\n\t\t\t\tgetPosition().setCoordinates(row -1 , randomInt);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(row == 0) {\n\t\t\t\tgetPosition().setCoordinates(row + 1 , randomInt);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(column == 99) {\n\t\t\t\tgetPosition().setCoordinates(randomInt , column - 1);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\tif(column == 0) {\n\t\t\t\tgetPosition().setCoordinates(randomInt , column + 1);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t}\n\t\tif(hunter == false && row > 32) {\n\t\t\t//setHealth(100);\n\t\t\tgetPosition().setCoordinates(row -1 , randomInt);\n\t\t\tsetPosition(getPosition()) ;\n\t\t}\n\t\telse {\n\t\t\tif(row < 65 && hunter == true) {\n\t\t\t\tgetPosition().setCoordinates(row + 1, column);\n\t\t\t\tsetPosition(getPosition()) ;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgetPosition().setCoordinates(65, column);\n\t\t\t\tsetPosition(getPosition());\n\t\t\t\t//Check if there is a gazelle\n\t\t\t\tPair [][] range = {{Drawer.pairs[row+1][column-1],Drawer.pairs[row+1][column],\n\t\t\t\t\t\t\t Drawer.pairs[row+1][column+1]}, {\n\t\t\t\t\t\t\t Drawer.pairs[row+2][column-1],\n\t\t\t\t\t\t\t Drawer.pairs[row+2][column],Drawer.pairs[row+2][column+1]}};\n\t\t\t\t\n\t\t\t\tfor(Pair [] line: range) {\n\t\t\t\t\tfor(Pair prey: line) {\n\t\t\t\t\t\tif(prey.getAnimal() instanceof Gazelle ) {\n\t\t\t\t\t\t\tattack();\n\t\t\t\t\t\t\tprey.getAnimal().die();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void action() throws Exception {\n if (!can_hit || count > 0)\n count++;\n if (count == 100) {\n can_hit = true;\n }\n else if (count == this.bombCountLimit) {\n bombPlaced--;\n count = 0;\n }\n\n if(Gdx.input.isKeyJustPressed(Input.Keys.SPACE)){\n go_ia=!go_ia;\n }\n if(go_ia){\n ia_count++;\n if(ia_count==11)\n ia_count=0;\n }\n if(go_ia&&ia_count==10) {\n\n int move = -1;\n int mode = 0;\n\n\n\n log.info(\"count bomb: \" + count);\n\n double enemyDist = sqrt(pow((playerX - enemyX), 2)+pow((playerY - enemyY), 2));\n if(powerUpFree) {\n currentGoalX = goalX;\n currentGoalY = goalY;\n if(deepSearch){\n currentGoalX = 1;\n currentGoalY = 1;\n }\n if(enemyDist < 7 && !enemyClean){\n if(enemyDist <= bombRange && sqrt(pow((playerX - goalX), 2)+pow((playerY - goalY), 2)) > 2)\n mode = 2;\n\n }\n }\n\n\n\n if (!can_hit) {\n mode = 1;\n log.info(\"can't hit\");\n }\n else if(doorLocked) {\n mode = 3;\n }\n /*if (count > 0 && count <= this.bombCountLimit && (playerX!=bombGoalX || playerY!=bombGoalY)){\n currentGoalX = bombGoalX;\n currentGoalY = bombGoalY;\n log.info(\"bomb goal\");\n }*/\n\n\n\n\n log.info(\"CURRENT goal x: \" + currentGoalX +\", CURRENT goal y: \" + currentGoalY);\n log.info(\"CURRENT bombgoal x: \" + bombGoalX +\", current bombgoal y: \" + bombGoalY);\n log.info(\"CURRENT player x: \" + playerX +\", current player y: \" + playerY);\n log.info(\"powerup free: \" + powerUpFree);\n log.info(\"CURRENT ENEMY: [\" + enemyX + \", \" + enemyY + \"] \");\n\n ArrayList<Action> actions = new ArrayList<>();\n ArrayList<Wall> walls = new ArrayList<>();\n ArrayList<EnemyPath> enemyPaths = new ArrayList<>();\n ArrayList<Around> around = new ArrayList<>();\n\n playerX = this.x/40;\n playerY = this.y/40;\n\n for( int i = 0; i < 4; i++ ){\n if (can_move[i]) {\n if (mode != 1 || checkSafe(i))\n actions.add(new Action(i));\n walls.add(new Wall(i, 0));\n }\n else if (can_destroy[i]){\n walls.add(new Wall(i, 1));\n if (mode != 1 || checkSafe(i))\n actions.add(new Action(i));\n }\n else\n walls.add(new Wall(i, 3));\n if(freeAround[i])\n around.add(new Around(i, 0));\n else\n around.add(new Around(i, 2));\n\n if ( !enemyFree[i] && enemyDist > bombRange)\n enemyPaths.add(new EnemyPath(i, 1));\n if( !enemyFree[i] && enemyDist <= bombRange || (bombRange == 1 && enemyDist <= 2))\n enemyPaths.add(new EnemyPath(i, 2));\n else if (enemyDist <= bombRange)\n enemyPaths.add(new EnemyPath(i, 1));\n else if(enemyFree[i])\n enemyPaths.add(new EnemyPath(i, 0));\n }\n if(sqrt(pow((playerX - bombGoalX), 2)+pow((playerY - bombGoalY), 2)) > bombRange ||\n mode != 1 || (playerX != bombGoalX && playerY != bombGoalY))\n actions.add(new Action(4));\n\n ai.load_fact( new Position(playerX, playerY),\n actions,\n makeDistances(buildDistances(currentGoalX, currentGoalY)),\n makeBombDistances(buildDistances(bombX, bombY)),\n makeEnemyDistances(buildDistances(enemyX, enemyY)),\n walls,\n around,\n enemyPaths,\n new Mode(mode)\n );\n\n AnswerSets answers = ai.getAnswerSets();\n while(answers.getAnswersets().get(0).getAnswerSet().isEmpty()){\n ai.load_fact( new Position(playerX, playerY),\n actions,\n makeDistances(buildDistances(currentGoalX, currentGoalY)),\n makeBombDistances(buildDistances(bombX, bombY)),\n makeEnemyDistances(buildDistances(enemyX, enemyY)),\n walls,\n around,\n enemyPaths,\n new Mode(mode)\n );\n answers = ai.getAnswerSets();\n }\n\n for (AnswerSet an : answers.getAnswersets()) {\n Pattern pattern = Pattern.compile(\"^choice\\\\((\\\\d+)\\\\)\");\n Matcher matcher;\n for (String atom : an.getAnswerSet()) {\n //System.out.println(atom);\n matcher = pattern.matcher(atom);\n\n if (matcher.find()) {\n log.info(\"DLV output: \" + matcher.group(1));\n move = Integer.parseInt(matcher.group(1));\n }\n }\n }\n if (move == 1) {\n set_allCan_move(0, true);\n this.x += 40;\n }\n else if (move == 2) {\n set_allCan_move(0, true);\n this.y += 40;\n }\n else if (move == 3) {\n set_allCan_move(0, true);\n this.y -= 40;\n }\n else if (move == 0) {\n set_allCan_move(0, true);\n this.x -= 40;\n }\n else if (move == 4 && can_hit && (playerX != goalX || playerY != goalY)) {\n ai_hit = true;\n can_hit = false;\n this.bombX=playerX;\n this.bombY=playerY;\n this.bombGoalX=playerX;\n this.bombGoalY=playerY;\n bombPlaced++;\n }\n moves.add(move);\n ai.clear();\n }\n else{\n playerX = this.x/40;\n playerY = this.y/40;\n }\n\n\n if (Gdx.input.isKeyPressed(Input.Keys.A)&&can_move[0]) {\n set_allCan_move(0, true);\n this.x -= 5;\n }\n if (Gdx.input.isKeyPressed(Input.Keys.D)&&can_move[1]) {\n set_allCan_move(0, true);\n this.x += 5;\n }\n if (Gdx.input.isKeyPressed((Input.Keys.W))&&can_move[2]) {\n this.y += 5;\n set_allCan_move(0, true);\n }\n if (Gdx.input.isKeyPressed((Input.Keys.S))&&can_move[3]){\n set_allCan_move(0, true);\n this.y -= 5;\n }\n if (Gdx.input.isKeyPressed((Input.Keys.Z)) && can_hit) {\n can_hit = false;\n this.bombX=playerX;\n this.bombY=playerY;\n this.bombGoalX=playerX;\n this.bombGoalY=playerY;\n bombPlaced++;\n }\n\n if (Gdx.input.isKeyPressed((Input.Keys.N)))\n log.info(\"CURRENT ENEMY: [\" + enemyX + \", \" + enemyY + \"] \");\n }", "public void tick() {\n\r\n\t\tdouble angle = Math.atan2(getY()-y, getX()-x);\r\n\t\tif(seeking||Math.sqrt(((getX()-x)/1000)*((getX()-x)/1000)+((getY()-y)/1000)*((getY()-y)/1000))*1000>range[stage]){\r\n\r\n\t\t\tx += (int)(speed *Math.cos(angle));\r\n\t\t\ty += (int)(speed *Math.sin(angle));\t\t\r\n\t\t}else if(stage==0){\r\n\t\t\tstage=1;\r\n\t\t}\r\n\t\telse seeking = true;\r\n\t\tif(health<=0)\r\n\t\t{\r\n\t\t\tHandler.removeObject(this);\r\n\t\t\trage = rage + 1;\r\n\r\n\t\t}\r\n\t}", "public void shoot(){\n // boss bullete attract to player\n int bulletPosX = PApplet.parseInt(posX + (speed * cos(angle)));\n int bulletPosY = (int)(posY + hei / 2);\n float bulletAngle = atan2(Main.player.posY - bulletPosY, Main.player.posX - bulletPosX);\n int bulletVelX = (int)(8 * cos(bulletAngle));\n int bulletVelY = (int)(8 * sin(bulletAngle));\n bossBullets.add(new Bullet(bulletPosX,bulletPosY,bulletVelX,bulletVelY,1,attack));\n }", "public void act() \n {\n frameCount++;\n animateFlying();\n if (getWorld() instanceof DreamWorld)\n {\n dream();\n }\n else if (getWorld() instanceof FinishScreen)\n {\n runEnd();\n }\n }", "public void update(float deltaTime) {\n if (creationPoint.y != (int)(GameView.instance.groundLevel - height*3/4) || creationPoint.x != x+width/2){\n creationPoint.x = x+width/2-width/4;\n creationPoint.y = (int)(GameView.instance.groundLevel - height/2)+height/8;\n }\n\n\n if(isStanding) {\n\n /*System.out.println(creationPoint.x);\n System.out.println(GameView.instance.player.position.x);\n System.out.println(GameView.instance.player.position.x-creationPoint.x);\n System.out.println(GameView.instance.cameraSize*attackRange);*/\n\n tax();\n\n\n //=======================================================================================//\n\n //Buildings\n\n //=======================================================================================//\n\n\n grow();\n\n\n // = ======== == ==\n // = = == == ==\n // ===== == ====\n // = = == == ===\n\n if (inRange() && !surrender) {\n countdown+=GameView.instance.fixedDeltaTime;\n //System.out.println(countdown);\n float shootSpeed=4-lv;\n if (countdown > 1000*shootSpeed) {\n\n if (countdown > 1200*shootSpeed && attack == 0) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown > 1400*shootSpeed && attack == 1) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown > 1600*shootSpeed && attack == 2) {\n Attack();\n\n attack += 1;\n }\n\n if (countdown >= 1800*shootSpeed) {\n countdown = 0;\n attack = 0;\n }\n }\n }\n if ((Scene.instance.timeOfDay) / (Scene.instance.dayLength) > 0.6) {\n spawnedNPC = false;\n }\n if(!spawnedNPC) {\n //spawning thief\n if ((townFear > 20 && lv != 0 && (currentGold < maxGold / 2)) || (goldRate < 200 && lv != 0) && Scene.instance.day > 2) {\n GameView.instance.npc_pool.spawnThiefs(x, (int) GameView.instance.groundLevel, 1, this);\n }\n if(!surrender) {\n //spawning dragonslayer\n if (townFear > 30 && lv != 0) {\n GameView.instance.npc_pool.spawnDragonLayers(x, (int) GameView.instance.groundLevel, this);\n }\n\n //spawning wizard\n if (townFear > 35 && lv == 2 && !summonedWizard) {\n GameView.instance.npc_pool.spawnFarmers(x, (int) GameView.instance.groundLevel, this);\n summonedWizard = true;\n }\n }\n spawnedNPC = true;\n }\n\n if(!surrender) {\n if (townFear > surrenderFear) {\n surrender = true;\n flag.setSurrender(surrender);\n SoundEffects.instance.play(SoundEffects.TRIBUTE);\n }\n }\n else {\n if(townFear < surrenderFear/2) {\n surrender = false;\n flag.setSurrender(surrender);\n\n }\n }\n\n\n\n Flagposition(deltaTime);\n }\n else {\n buildingImage = SpriteManager.instance.getBuildingSprite(\"FortressRuin\");\n\n if(beenEmptied == false){\n GoldPool.instance.spawnGold(collider.centerX(), collider.centerY(),Math.min(currentGold,100*(lv+1)) );\n beenEmptied = true;\n }\n townFear = 0;\n }\n\n //==== ===== ===== = == ==== ============================\n //= = == = = = = == = = ============================\n //==== == ===== ===== == ==== ============================\n //= == ===== = = = == = == ============================\n repair(deltaTime);\n\n for(int i = 0; i < currentBuildingsLeft.size(); i++){\n currentBuildingsLeft.get(i).update(deltaTime);\n }\n\n for(int i = 0; i < currentBuildingsRight.size(); i++){\n currentBuildingsRight.get(i).update(deltaTime);\n }\n super.update(deltaTime);\n\n }", "void tick() {\n\t\tif (playing) {\n\t\t\tdeadcannon = null;\n\t\t\t// sets general output message\n\t\t\tstatus.setText(\"Engaging alien wave \" + Integer.toString(level)+ \" \");\n\n\t\t\t// controls the first shot fired by the aliens\n\t\t\tif (shot1 == null) {\n\t\t\t\tint count1 = 0;\n\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\tif (alien3[i]!=null) {if (!alien3[i].Destroyed) count1++ ;}\n\t\t\t\t}\n\t\t\t\tif (count1 > 1) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\tshootbottom().pos_x + 18, shootbottom().pos_y); \n\t\t\t\telse {\n\t\t\t\t\tint count2 = 0;\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null) {if(!alien2[i].Destroyed)count2++;}\n\t\t\t\t\t}\n\t\t\t\t\tif (count2 > 1) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\tshootmiddle().pos_x + 18, shootmiddle().pos_y);\n\t\t\t\t\telse {\n\t\t\t\t\t\tint count3 = 0;\n\t\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\t\tif (alien1[i]!=null) {if(!alien1[i].Destroyed)count3++;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (count3 != 0) shot1 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\t\tshoottop().pos_x + 18, shoottop().pos_y);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// controls the second shot fired by the aliens\n\t\t\tif (shot2 == null) {\n\t\t\t\tint count4 = 0;\n\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\tif (alien3[i]!=null) {if (!alien3[i].Destroyed) count4++ ;}\n\t\t\t\t}\n\t\t\t\tif (count4 != 0) {shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\tshootbottom().pos_x + 18, shootbottom().pos_y); \n\t\t\t\tStdAudio.play(\"zap.wav\"); }\n\t\t\t\telse {\n\t\t\t\t\tint count5 = 0;\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null) {if(!alien2[i].Destroyed)count5++;}\n\t\t\t\t\t}\n\t\t\t\t\tif (count5 != 0) { shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\tshootmiddle().pos_x + 18, shootmiddle().pos_y);\n\t\t\t\t\tStdAudio.play(\"zap.wav\"); }\n\t\t\t\t\telse {\n\t\t\t\t\t\tint count6 = 0;\n\t\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\t\tif (alien1[i]!=null) {if(!alien1[i].Destroyed)count6++;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (count6 != 0) {shot2 = new Shot(COURT_WIDTH, COURT_HEIGHT, \n\t\t\t\t\t\t\t\tshoottop().pos_x + 18, shoottop().pos_y);\n\t\t\t\t\t\tStdAudio.play(\"zap.wav\");}\n\t\t\t\t\t\telse {level = level + 1; \n\t\t\t\t\t\tnewlevel();\n\t\t\t\t\t\tthescore=thescore + 100;\n\t\t\t\t\t\tStdAudio.play(\"up.wav\");}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move bullet and delete if it reaches the roof\n\t\t\tif (bullet!= null) {\n\t\t\t\tbullet.move();\n\t\t\t\tif (bullet.pos_y == 0) bullet = null;\n\t\t\t}\n\n\t\t\t// controls movement of first shot\n\t\t\tif (shot1 != null) {\n\t\t\t\tshot1.move();\n\t\t\t\tif (shot1.pos_y > 435) shot1 = null;\n\t\t\t}\n\t\t\t// controls movement of second shot\n\t\t\tif (shot2 != null) {\n\t\t\t\tshot2.move();\n\t\t\t\tif (shot2.pos_y > 435) shot2 = null;\n\t\t\t}\n\n\t\t\t// For Top Row\n\n\t\t\t// change alien direction if a wall is reached\n\t\t\tif (alien1[0] != null && alien1[9] != null){\n\t\t\t\tif (alien1[0].pos_x == 0 || alien1[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\t\t\tif (alien1[i]!=null){alien1[i].v_x = -alien1[i].v_x;\n\t\t\t\t\t\talien1[i].pos_y=alien1[i].pos_y+15;\n\t\t\t\t\t\tif (alien1[i].pos_y >= 385 && !alien1[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false;\n\t\t\t\t\t\t\tstatus.setText(\"You have been overrun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\t \n\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\tif (alien1[i] != null) \n\t\t\t\t\talien1[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien1.length; i++) {\n\t\t\t\tif (alien1[i] != null && bullet != null) {\n\t\t\t\t\tif (alien1[i].intersects(bullet) && !alien1[i].Destroyed) { \n\t\t\t\t\t\talien1[i].Destroyed=true;\n\t\t\t\t\t\tthescore += 20;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10 ) {\n\t\t\t\t\t\t\talien1[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For Second Row\n\n\t\t\t// change alien direction if a wall is reached\n\t\t\tif (alien2[0] != null && alien2[9] != null){\n\t\t\t\tif (alien2[0].pos_x == 0 || alien2[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\t\t\tif (alien2[i]!=null){alien2[i].v_x = -alien2[i].v_x;\n\t\t\t\t\t\talien2[i].pos_y=alien2[i].pos_y+15;\n\t\t\t\t\t\tif (alien2[i].pos_y >= 385 && !alien2[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false; \n\t\t\t\t\t\t\tstatus.setText(\"You have been ovverun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\tif (alien2[i] != null) \n\t\t\t\t\talien2[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien2.length; i++) {\n\t\t\t\tif (alien2[i] != null && bullet != null) {\n\t\t\t\t\tif (alien2[i].intersects(bullet) && !alien2[i].Destroyed) { \n\t\t\t\t\t\talien2[i].Destroyed=true;\n\t\t\t\t\t\tthescore +=15;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10 ) {\n\t\t\t\t\t\t\talien2[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//For third row\n\n\t\t\t//change alien direction if a wall is reached\n\t\t\tif (alien3[0] != null && alien3[9] != null){\n\t\t\t\tif (alien3[0].pos_x == 0 || alien3[9].pos_x == 730) {\n\t\t\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\t\t\tif (alien3[i]!=null){alien3[i].v_x = -alien3[i].v_x;\n\t\t\t\t\t\talien3[i].pos_y=alien3[i].pos_y+15;\n\t\t\t\t\t\tif (alien3[i].pos_y >= 385 && !alien3[i].Destroyed){\n\t\t\t\t\t\t\tplaying = false;\n\t\t\t\t\t\t\tstatus.setText(\"You have been ovverrun and Earth \"+\n\t\t\t\t\t\t\t\t\t\"has been destroyed. You are a terrible \"+\n\t\t\t\t\t\t\t\t\t\"defender of humanity. \");\n\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move the aliens as group\n\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\tif (alien3[i] != null) \n\t\t\t\t\talien3[i].move();\n\t\t\t}\n\n\t\t\t// destroy both bullet and aliens if bullet hits\n\t\t\tfor (int i = 0; i < alien3.length; i++) {\n\t\t\t\tif (alien3[i] != null && bullet != null) {\n\t\t\t\t\tif (alien3[i].intersects(bullet) && !alien3[i].Destroyed) { \n\t\t\t\t\t\talien3[i].Destroyed=true;\n\t\t\t\t\t\tthescore += 10;\n\t\t\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\t\t\tbullet = null;\n\t\t\t\t\t\tif (i == 0 || i == 10) {\n\t\t\t\t\t\t\talien3[i].img_file = \"black.jpg\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// destroy cannon if shot\n\t\t\tif (shot1 != null) {\n\t\t\t\tif (shot1.intersects(cannon)){ dead = true; \n\t\t\t\tthelives = thelives - 1;\n\t\t\t\tStdAudio.play(\"bigboom.wav\");\n\t\t\t\tcannon.img_file = \"dead.jpg\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (shot2 != null) {\n\t\t\t\tif (shot2.intersects(cannon)){ dead = true; \n\t\t\t\tthelives = thelives - 1;\n\t\t\t\tStdAudio.play(\"bigboom.wav\");}\n\t\t\t\tcannon.img_file = \"dead.jpg\";\n\t\t\t}\n\n\t\t\t// ends the game when all lives are lost\n\t\t\tif (thelives <= 0) {\n\t\t\t\tplaying = false; \n\t\t\t\tStdAudio.play(\"bomb-02.wav\");\n\t\t\t\tstatus.setText(\"You have been killed and Earth has been \" +\n\t\t\t\t\t\t\"destroyed. You are a terrible defender \" +\n\t\t\t\t\t\t\"of humanity. \");\n\t\t\t}\n\n\t\t\t//makes sure lives cannot become negative\n\t\t\tif (thelives <= 0) {\n\t\t\t\tthelives = 0;\n\t\t\t\tdeadcannon = new DeadCannon(COURT_WIDTH, COURT_HEIGHT);\n\t\t\t\tdeadcannon.pos_x = cannon.pos_x;\n\t\t\t\tStdAudio.play(\"loss.wav\");\n\t\t\t}\n\n\t\t\t//set the text labels at the bottom of the screen\n\t\t\tmyscore.setText(\"Score = \"+ Integer.toString(thescore)+ \" \");\n\t\t\tmylives.setText(\"Lives = \"+ Integer.toString(thelives));\n\t\t\trepaint();\n\t\t\n\t\t\t//move cannon\n\t\t\tcannon.move();\n\t\t} \n\t}", "public void step(SimState state) {\n station = (Station) state;\n updateOccupancy();\n if(station.getWriteResults()) {\n //writeTemporalOccupancy();\n updateStateDataFrame();\n updateAggregateDataFrame();\n //writeState(false);\n // End simulation when all people have left\n if (station.area.getAllObjects().size() == 0) {\n System.out.printf(\"Writing data out\");\n long sysTime = System.currentTimeMillis();\n //writeParameters(\"parameters_\" + sysTime + \".html\");\n System.out.printf(\".\");\n writeAverageOccupancy();\n System.out.printf(\".\");\n writeDataFrame(stateDataFrame, \"state_data\" + sysTime + \".txt\");\n System.out.printf(\".\");\n writeDataFrame(aggregateDataFrame, \"aggregate_data\" + sysTime + \".txt\");\n System.out.printf(\".\");\n station.finish();\n System.out.println(\"Finished!\");\n }\n }\n }", "void start () {\n System.out.println(\"Starting the game\");\n score = 0;\n updateScore();\n stepDelay = startingSpeed;\n isFalling = false;\n gameOver = false;\n board.clear();\n board.clearTemp();\n setNormalSpeed();\n spawnNewPiece();\n updateView();\n resetLoop();\n }", "private void tick() {\n\n if (StateManager.getState() != null) {\n StateManager.getState().tick();\n }\n this.backgroundFrames--;\n if (this.backgroundFrames == 0) {\n this.backgroundFrames = Const.TOTAL_BACKGROUND_FRAMES;\n }\n//Check all changed variables for the player\n player.tick();\n long elapsed = (System.nanoTime() - time) / (Const.DRAWING_DELAY - (4000 * Enemy.getDifficulty()));\n//Check if enough time is passed to add new enemy or if spawnSpot is available\n if (elapsed > (this.delay - Enemy.getDifficulty() * 300)&& Road.isSpotAvailable()) {\n enemies.add(new Enemy());\n time = System.nanoTime();\n }\n//Loop for checking all changed variables for the enemies and check if they intersects with the player\n for (int j = 0; j < enemies.size(); j++) {\n enemies.get(j).tick();\n if(enemies.get(j).getY() > Const.ROAD_BOTTOM_BORDER + 200){\n Road.getOccupiedSpawnPoints()[Const.SPAWN_POINTS.indexOf(enemies.get(j).getX())] = false;\n player.setScore(player.getScore() + 50);\n enemies.remove(j);\n continue;\n }\n enemyBoundingBox = enemies.get(j).getEnemyRectangle();\n if (player.getBoundingBox().intersects(enemyBoundingBox)) {\n reset();\n if(player.getLives() == 0){\n gameOver();\n }\n break;\n }\n }\n }", "public void shoot(Graphics g) {\r\n\t\tlevelManager.shoot(g);\r\n\t}", "void gameStarted();", "void gameStarted();", "public static void tick() {\n control.tick();\n drive.tick();\n shoot.tick();\n shittake.tick();\n }", "private void handleShooting(SpaceWars game, GameGUI gui) {\r\n\t\tif (gui.isShotPressed()) {\r\n\t\t\tfire(game);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void execute() {\n\t\tm_FlywheelSubsystem.shoot();\r\n\t}", "public Shooter() {\n fire1 = new Solenoid(1);\n fire2 = new Solenoid(4);\n returnValve = new Solenoid(3);\n latchSolenoid = new Solenoid(2);\n FFM = true;\n m_enabled = true;\n shooting = false;\n reloading = false;\n initShooter();\n }", "protected void execute() {\r\n if (machineState != 5) {\r\n shootAtBeginAutonomous();\r\n } else if (machineState == 5) {\r\n if (!lineFound()) {\r\n initalizeFeederAndShooter();\r\n Robot.chassis.driveMecanumNormalized(-0.5, 0, 0);\r\n } else {\r\n driveOnLine();\r\n shootOnce();\r\n }\r\n }\r\n }", "public static void main(String args[]) {\n OthelloState state = new OthelloState(8);\n OthelloPlayer players[] = {new OthelloMinMaxTushar(9), new OthelloAlphaBetaTushar(6)};\n \n do{\n // Display the current state in the console:\n System.out.println(\"\\nCurrent state, \" + OthelloState.PLAYER_NAMES[state.nextPlayerToMove] + \" to move:\");\n System.out.print(state);\n \n // Get the move from the player:\n OthelloMove move = players[state.nextPlayerToMove].getMove(state); \n System.out.println(move);\n state = state.applyMoveCloning(move); \n }while(!state.gameOver());\n\n // Show the result of the game:\n System.out.println(\"\\nFinal state with score: \" + state.score());\n System.out.println(state);\n }", "private void combatPhase() {\n \t\n \tpause();\n \tDice.setFinalValMinusOne();\n\n \t// Go through each battle ground a resolve each conflict\n \tfor (Coord c : battleGrounds) {\n \t\t\n \tClickObserver.getInstance().setTerrainFlag(\"\");\n \t\n \tSystem.out.println(\"Entering battleGround\");\n \t\tfinal Terrain battleGround = Board.getTerrainWithCoord(c);\n \t\t\n \t\t// find the owner of terrain for post combat\n \tPlayer owner = battleGround.getOwner();\n \t\n \t\t// simulate a click on the first battleGround, cover all other terrains\n \t\tClickObserver.getInstance().setClickedTerrain(battleGround);\n \t\tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\tClickObserver.getInstance().whenTerrainClicked();\n \t\tBoard.applyCovers();\n \t\tClickObserver.getInstance().getClickedTerrain().uncover();\n \tClickObserver.getInstance().setTerrainFlag(\"Disabled\");\n }\n });\n \t\t\n \t\t// Get the fort\n \t Fort battleFort = battleGround.getFort(); \n \t\t\n \t\t// List of players to battle in the terrain\n \t\tArrayList<Player> combatants = new ArrayList<Player>();\n \t\t\n \t\t// List of pieces that can attack (including forts, city/village)\n \t\tHashMap<String, ArrayList<Piece>> attackingPieces = new HashMap<String, ArrayList<Piece>>();\n \t\t\n \t\tSystem.out.println(battleGround.getContents().keySet());\n \t\t\n \t\tIterator<String> keySetIterator = battleGround.getContents().keySet().iterator();\n\t \twhile(keySetIterator.hasNext()) {\n\t \t\tString key = keySetIterator.next();\n\t \t\t\n \t\t\tcombatants.add(battleGround.getContents().get(key).getOwner());\n \t\t\tattackingPieces.put(battleGround.getContents().get(key).getOwner().getName(), (ArrayList<Piece>) battleGround.getContents().get(key).getStack().clone()); \n \t\t\t\n\t \t}\n\t \t\n\t \t\n\t \t\n\t \t// if the owner of the terrain has no pieces, just a fort or city/village\n\t\t\tif (!combatants.contains(battleGround.getOwner()) && battleFort != null) {\n\t\t\t\tcombatants.add(battleGround.getOwner());\n\t\t\t\tattackingPieces.put(battleGround.getOwner().getName(), new ArrayList<Piece>());\n\t\t\t}\n\n \t\t// add forts and city/village to attackingPieces\n \t\tif (battleFort != null) {\n \t\t\tattackingPieces.get(battleGround.getOwner().getName()).add(battleFort);\n \t\t}\n \t\t\n \t\tkeySetIterator = attackingPieces.keySet().iterator();\n\t \twhile (keySetIterator.hasNext()) {\n\t \t\tString key = keySetIterator.next();\n\t \t\t\n\t \t\tfor (Piece p : attackingPieces.get(key)) {\n\t \t\t\tif (p.getName().equals(\"Baron Munchhausen\") || p.getName().equals(\"Grand Duke\")) {\n\t \t\t\t\tif (p.getOwner() != battleGround.getOwner())\n\t \t\t\t\t\t((Performable)p).specialAbility();\n\t \t\t\t}\n\t \t\t\t\t\n\t \t\t}\n\t \t}\n \t\t// TODO implement city/village\n// \t\tif (City and village stuff here)\n \t\tSystem.out.println(combatants);\n \t\t\n \t\tboolean exploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t// Fight until all attackers are dead, or until the attacker becomes the owner of the hex\n \t\twhile (combatants.size() > 1 || exploring) {\n \t\t\t\n /////////////Exploration\n \t// Check if this is an exploration battle:\n \t\t// Must fight other players first\n \t\t\tboolean fightingWildThings = false;\n \tif (exploring) {\n\n \t\t\t\t// Set the battleGround explored\n \t\t\t\tbattleGround.setExplored(true);\n \t\n \t\tString exploringPlayer = null;\n \t\tIterator<String> keySetIter = battleGround.getContents().keySet().iterator();\n \t \twhile(keySetIter.hasNext()) {\n \t \t\tString key = keySetIter.next();\n \t \t\texploringPlayer = key;\n \t \t}\n \t\tplayer = battleGround.getContents(exploringPlayer).getOwner();\n \t\tplayer.flipAllUp();\n \t \t\n \t\t// Get user to roll die to see if explored right away\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \tDiceGUI.getInstance().uncover();\n \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n \t \t\t\t+ \", roll the die. You need a 1 or a 6 to explore this terrain without a fight!\");\n \t }\n \t\t\t\t});\n \t\t\t\t\n \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\tint luckyExplore = -1;\n \t\t\t\twhile (luckyExplore == -1) {\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\tluckyExplore = Dice.getFinalVal();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// If success TODO FIX this \n \t\t\t\tif (luckyExplore == 1 || luckyExplore == 6) {\n \t\t\t\t\t\n \t\t\t\t\t// Cover die. Display msg\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \tDiceGUI.getInstance().cover();\n \t\t \tGUI.getHelpText().setText(\"Attack phase: Congrats!\" + player.getName() \n \t\t \t\t\t+ \"!, You get the terrain!\");\n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\texploring = false;\n \t\t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\t} else { // Else failure. Must fight or bribe\n \t\t\t\t\t\n \t\t\t\t\tfightingWildThings = true;\n \t\t\t\t\t\n \t\t\t\t\t// Cover die. Display msg\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \tDiceGUI.getInstance().cover();\n \t\t \tbattleGround.coverPieces();\n \t\t \tGUI.getHelpText().setText(\"Attack phase: Boooo!\" + player.getName() \n \t\t \t\t\t+ \"!, You have to bribe, or fight for your right to explore!\");\n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t// add luckyExplore amount of pieces to terrain under wildThing player\n \t\t\t\t\tfinal ArrayList<Piece> wildPieces = TheCup.getInstance().draw(luckyExplore);\n \t\t\t\t\t\t\n \t\t\t\t\t// Update the infopanel with played pieces. Active done button\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \twildThings.playWildPieces(wildPieces, battleGround);\n \t\t GUI.getDoneButton().setDisable(false);\n \t\t battleGround.coverPieces();\n \t\t \tInfoPanel.showTileInfo(battleGround);\n \t\t \n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t//////Bribing here\n \t\t\t\t\tpause();\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectCreatureToBribe\");\n \t\t\t\t\t\n \t\t\t\t\t// Uncover the pieces that the player can afford to bribe\n \t\t\t\t\t// canPay is false if there are no Pieces that the user can afford to bribe\n \t\t\t\t\tboolean canPay = false;\n \t\t\t\t\tfor (final Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n \t\t\t\t\t\tif (((Combatable)p).getCombatValue() <= player.getGold()) {\n \t\t\t\t\t\t\tcanPay = true;\n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t\t\t @Override\n \t\t\t\t public void run() {\n \t\t\t\t \tp.uncover();\n \t\t\t\t }\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\ttry { Thread.sleep(50); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t// Continue looping until there are no more pieces user can afford to bribe, or user hits done button\n \t\t\t\t\twhile (canPay && isPaused) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t\t @Override\n\t \t\t public void run() {\n\t \t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t \t\t \t\t\t+ \", Click on creatures you would like to bribe\");\n\t \t\t }\n \t\t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t\t// wait for user to hit done, or select a piece\n \t\t\t\t\t\tpieceClicked = null;\n \t\t\t\t\t\twhile(pieceClicked == null && isPaused) {\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (pieceClicked != null) {\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// spend gold for bribing. Remove clicked creature\n \t\t\t\t\t\t\tplayer.spendGold(((Combatable)pieceClicked).getCombatValue());\n \t\t\t\t\t\t\t((Combatable)pieceClicked).inflict();\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// cover pieces that are too expensive\n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t\t\t @Override\n \t\t\t\t public void run() {\n \t\t\t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n \t\t\t \t\t\t+ \" bribed \" + pieceClicked.getName());\n \t\t\t\t \tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t \tif (battleGround.getContents(wildThings.getName()) != null) {\n\t \t\t\t\t for (Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n\t \t\t\t\t \tif (((Combatable)p).getCombatValue() > player.getGold())\n\t \t\t\t\t \t\tp.cover();\n\t \t\t\t\t }\n \t\t\t\t \t}\n \t\t\t\t }\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// Check if there are any pieces user can afford to bribe and set canPay to true if so\n \t\t\t\t\t\t\tcanPay = false;\n \t\t\t\t\t\t\tif (battleGround.getContents(wildThings.getName()) == null || battleGround.getContents(wildThings.getName()).getStack().size() == 1)\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\telse {\n\t \t\t\t\t\t\t\tfor (final Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n\t \t\t\t\t\t\t\t\tif (((Combatable)p).getCombatValue() <= player.getGold()) {\n\t \t\t\t\t\t\t\t\t\tcanPay = true;\n\t \t\t\t\t\t\t\t\t\tbreak;\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t @Override\n\t\t\t public void run() {\n\t\t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t\t \t\t\t+ \" done bribing\");\n\t\t\t }\n \t\t\t\t\t});\n \t\t\t\t\tSystem.out.println(\"Made it past bribing\");\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\t\n \t\t\t\t\t// Done bribing, on to fighting\n \t\t\t\t\t\n \t\t\t\t\t// find another player to control wildThings and move on to regular combat\n \t\t\t\t\t// to be used later \n \t\t\t\t\tPlayer explorer = player;\n \t\t\t\t\tPlayer wildThingsController = null;\n \t\t\t\t\tfor (Player p : playerList) {\n \t\t\t\t\t\tif (!p.getName().equals(player.getName()))\n \t\t\t\t\t\t\twildThingsController = p;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// If wild things still has pieces left:\n \t\t\t\t\tif (battleGround.getContents().containsKey(wildThings.getName())) {\n\t \t\t\t\t\tcombatants.add(battleGround.getContents().get(wildThings.getName()).getOwner());\n\t \t \t\t\tattackingPieces.put(wildThings.getName(), (ArrayList<Piece>) battleGround.getContents().get(wildThings.getName()).getStack().clone()); \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// cover pieces again\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \tbattleGround.coverPieces();\n \t }\n \t\t\t\t});\n \t\t\t\t\n \t\t\t\tplayer.flipAllDown();\n \t} // end if (exploring)\n \t\t\t\n \t\t\tSystem.out.println(\"combatants.size() > 1 : \" + combatants.size());\n \t\t\tSystem.out.println(combatants);\n \t\t\t\n \t\t\t// This hashMap keeps track of the player to attack for each player\n \t\t\tHashMap<String, Player> toAttacks = new HashMap<String, Player>();\n\n\t\t\t\t// each player selects which other player to attack in case of more than two combatants\n \t\t\tif (combatants.size() > 2) {\n \t\t\t\t\n \t\t\t\tfor (final Player p : combatants) {\n \t\t\t\t\tif (!p.isWildThing()) {\n\t \t \t\tpause();\n\t \t \t\tClickObserver.getInstance().setPlayerFlag(\"Attacking: SelectPlayerToAttack\");\n\t \t \t\tplayer = p;\n\t\t \tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t \tPlayerBoard.getInstance().applyCovers();\n\t\t \t \tbattleGround.coverPieces();\n\t\t \t \t GUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t\t \t + \", select which player to attack\");\n\t\t\t \t \t}\n\t\t \t });\n\t\t \tfor (final Player pl : combatants) {\n\t\t \t\tif (!pl.getName().equals(player.getName())) {\n\t\t \t\t\tPlatform.runLater(new Runnable() {\n\t\t \t \t @Override\n\t\t \t \t public void run() {\n\t\t \t \t \tPlayerBoard.getInstance().uncover(pl);\n\t\t \t \t }\n\t\t \t\t\t});\n\t\t \t\t}\n\t\t \t}\n\t\t \twhile (isPaused) {\n\t\t \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t\t \t }\n\t\t \t\n\t\t \t// ClickObserver sets playerClicked, then unpauses. This stores what player is attacking what player\n\t\t \ttoAttacks.put(p.getName(), playerClicked);\n\t \t \t\tClickObserver.getInstance().setPlayerFlag(\"\");\n\t\t \t\n\t \t \t} \n \t\t\t\t}\n \t\t\t\tcombatants.remove(wildThings);\n \t\t\t\tPlayerBoard.getInstance().removeCovers();\n \t\t\t\t\n \t } else { // Only two players fighting\n \t \t\n \t \tfor (Player p1 : combatants) {\n \t \t\tfor (Player p2 : combatants) {\n \t \t\t\tif (!p1.getName().equals(p2.getName())) {\n \t \t \ttoAttacks.put(p1.getName(), p2);\n \t \t\t\t}\n \t \t\t}\n \t \t}\n \t }\n \t\t\t\n ///////////////////Call out bluffs here:\n \t\t\tbattleGround.flipPiecesUp();\n \t\t\tfor (final Player p : combatants) {\n \t\t\t\t\n \t\t\t\t// Make sure not wildThings\n \t\t\t\tif (!p.isWildThing()) {\n \t\t\t\t\t\n \t\t\t\t\tArrayList <Piece> callOuts = new ArrayList<Piece>();\n \t\t\t\t\t\n \t\t\t\t\tfor (final Piece ap : attackingPieces.get(p.getName())) {\n \t\t\t\t\t\t\n \t\t\t\t\t\t// If not supported the gtfo\n \t\t\t\t\t\tif (!ap.isSupported()) {\n\n \t\t\t\t\t\t\tcallOuts.add(ap);\n \t\t\t\t\t\t\t((Combatable)ap).inflict();\n \t\t\t\t\t\t\ttry { Thread.sleep(250); } catch( Exception e ){ return; } \n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t \t @Override\n\t \t \t public void run() {\n\t \t \t \tInfoPanel.showTileInfo(battleGround);\n\t \t \t \tGUI.getHelpText().setText(\"Attack phase: \" + p.getName()\n\t\t\t \t + \" lost their \" + ap.getName() + \" in a called bluff!\");\n\t \t \t }\n\t \t\t\t});\n \t\t\t\t\t\t\ttry { Thread.sleep(250); } catch( Exception e ){ return; } \n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tfor (Piece co : callOuts) {\n \t\t\t\t\t\tattackingPieces.get(p.getName()).remove(co);\n \t\t\t\t\t}\n\t\t\t\t\t\tif (attackingPieces.get(p.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(p.getName());\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tPlayer baby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\t// Set up this HashMap that will store successful attacking pieces\n \t\t\tHashMap<String, ArrayList<Piece>> successAttacks = new HashMap<String, ArrayList<Piece>>();\n \t\t\t// Set up this HashMap that will store piece marked to get damage inflicted\n\t\t\t\tHashMap<String, ArrayList<Piece>> toInflict = new HashMap<String, ArrayList<Piece>>();\n \t\t\tfor (Player p : combatants) {\n \t\t\t\t\n \t\t\t\tsuccessAttacks.put(p.getName(), new ArrayList<Piece>());\n \t\t\t\ttoInflict.put(p.getName(), new ArrayList<Piece>());\n \t\t\t}\n \t\t\t\n \t\t\t// Array List of pieces that need to be used during a particular phase\n\t\t\t\tfinal ArrayList<Piece> phaseThings = new ArrayList<Piece>();\n\t\t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Magic!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n/////////////////////// Magic phase\n \t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its magic. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && ((Combatable)p).isMagic() && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover magic pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece mag : phaseThings) \n\t \t\t\t\t\tmag.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n\n\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\t\t\t\tSystem.out.println(\"attackingPieces.size(): \" + attackingPieces.size());\n\t\t\t\t\tSystem.out.println(\"attackingPieces.keySet(): \" + attackingPieces.keySet());\n\t\t\t\t\tIterator<String> keySetIte = battleGround.getContents().keySet().iterator();\n \t \twhile(keySetIte.hasNext()) {\n \t \t\tString key = keySetIte.next();\n\n \t\t\t\t\tSystem.out.println(\"key: \" + key);\n \t\t\t\t\tSystem.out.println(\"attackingPieces.get(key).size():\\n\" + attackingPieces.get(key).size());\n \t\t\t\t\tSystem.out.println(\"attackingPieces.get(key):\\n\" + attackingPieces.get(key));\n \t \t}\n\t\t\t\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more magic pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a magic piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a magic piece to attack with\");\n\t \t }\n\t \t });\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tpieceClicked.highLight();\n\t \t \tDiceGUI.getInstance().uncover();\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t \t \t\t\t+ \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\n\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\t\tint attackStrength = -1;\n \t\t\t\t\twhile (attackStrength == -1) {\n \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n \t\t\t\t\t}\n\t\t\t\t\t\t\n \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t \t @Override\n \t \t public void run() {\n \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n \t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n \t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\t\t \t }\n\t \t\t\t\t\t});\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName()); // 'defender'\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ti++;\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\t\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Ranged!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n//////////////////// Ranged phase\n\t\t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its ranged. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && ((Combatable)p).isRanged() && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover ranged pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece ran : phaseThings) \n\t \t\t\t\t\tran.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more ranged pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a ranged piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a ranged piece to attack with\");\n\t \t }\n\t \t });\n\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tpieceClicked.highLight();\n\t \t \tDiceGUI.getInstance().uncover();\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t \t + \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\n\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\t\tint attackStrength = -1;\n \t\t\t\t\twhile (attackStrength == -1) {\n \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n \t\t\t\t\t}\n\t\t\t\t\t\t\n \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t \t @Override\n \t \t public void run() {\n \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n \t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n \t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\t\t \t }\n\t \t\t\t\t\t});\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName());\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n\t\t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Melee!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n\n///////////////////////////// Melee phase\n\t\t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its melee. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && !(((Combatable)p).isRanged() || ((Combatable)p).isMagic()) && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover melee pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece mel : phaseThings) \n\t \t\t\t\t\tmel.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n \t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more melee pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a melee piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a melee piece to attack with\");\n\t \t }\n\t \t });\n\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// Is it a charging piece?\n\t \t\t\t\tint charger;\n\t \t\t\t\tif (((Combatable)pieceClicked).isCharging()) {\n\t \t\t\t\t\tcharger = 2;\n\t \t\t\t\t} else\n\t \t\t\t\t\tcharger = 1;\n\t \t\t\t\t\n\t \t\t\t\t// do twice if piece is a charger\n\t \t\t\t\tfor (int i = 0; i < charger; i++) {\n\t \t\t\t\t\t\n\t\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t \tpieceClicked.highLight();\n\t\t \t \tDiceGUI.getInstance().uncover();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t\t \t + \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t\t \t }\n\t \t\t\t\t\t});\n\t \t\t\t\t\t\n\t\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n\t \t\t\t\t\tint attackStrength = -1;\n\t \t\t\t\t\twhile (attackStrength == -1) {\n\t \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n\t \t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n\t \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t \t @Override\n\t \t \t public void run() {\n\t \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n\t \t \t\t\t\t\t\tpieceClicked.cover();\n\t \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n\t \t \t }\n\t \t\t\t\t\t});\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t\t \t\t\t\t\t\tpieceClicked.cover();\n\t \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\t\t\t \t }\n\t\t \t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\t// If piece is charging, and it is its first attack, remove the cover again\n\t \t\t\t\t\tif (((Combatable)pieceClicked).isCharging() && i == 0) {\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t \t \tpieceClicked.uncover();\n\t\t\t \t }\n\t \t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n\t \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n\t \t\t\t\t}\n\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName());\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n \t\t\t\t\t\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n \t\t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n\t\t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Retreat!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n \t\t\t\n \t\t\t\n//////////////////////// Retreat phase\n\t\t\t\t// Can only retreat to a Terrain that has been explored and has no ememies on it\n\t\t\t\t\n\t\t\t\t// Display message, activate done button\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tGUI.getHelpText().setText(\"Attack phase: Retreat some of your armies?\");\n\t\t GUI.getDoneButton().setDisable(false);\n\t }\n\t }); \t\t\t\t\n\t\t\t\t\n\t\t\t\t// For each combatant, ask if they would like to retreat\n\t\t for (Player pl : combatants) {\n\t\t \t\n\t\t \t// Make sure wildThings aren't trying to get away\n\t\t \tif (!pl.isWildThing()) {\n\t\t\t \tplayer = pl;\n\t \t InfoPanel.uncover(player.getName());\n\t\t\t\t ClickObserver.getInstance().setActivePlayer(player);\n\t\t\t\t ClickObserver.getInstance().setCreatureFlag(\"Combat: SelectRetreaters\");\n\t\t\t\t \n\t\t\t\t // Pause and wait for player to hit done button\n\t\t\t\t pause();\n\t\t\t Platform.runLater(new Runnable() {\n\t\t\t @Override\n\t\t\t public void run() {\n\t\t\t \tbattleGround.coverPieces();\n\t\t\t \tbattleGround.uncoverPieces(player.getName());\n\t\t\t \tbattleGround.coverFort();\n\t\t\t \t GUI.getHelpText().setText(\"Attack Phase: \" + player.getName() + \", You can retreat your armies\");\n\t\t\t }\n\t\t\t });\n\t\t\t\t while (isPaused && battleGround.getContents(player.getName()) != null) {\n\t\t\t \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t\t\t\t }\t \n\t\t\t\t ClickObserver.getInstance().setTerrainFlag(\"Disabled\");\n\t\t\t\t \n\t\t\t\t // TODO, maybe an if block here asking user if they would like to attack \n\t\t\t\t System.out.println(attackingPieces + \"---BEFORE CLEARING\");\n\t\t\t\t // Re-populate attackingPieces to check for changes\n\t\t\t\t attackingPieces.clear();\n\t\t\t\t Iterator<String> keySetIterator2 = battleGround.getContents().keySet().iterator();\n\t\t\t\t \twhile(keySetIterator2.hasNext()) {\n\t\t\t\t \t\tString key = keySetIterator2.next();\n System.out.println(key + \"=====key\");\n\t\t\t \t\t\tattackingPieces.put(battleGround.getContents().get(key).getOwner().getName(), (ArrayList<Piece>) battleGround.getContents().get(key).getStack().clone()); \n\t\t\t\t \t}\n // System.out.println(attackingPieces);\n\t\t\t\t \t// if the owner of the terrain has no pieces, just a fort or city/village\n System.out.println(\"===battleground\"+battleGround);\n System.out.println(\"===attackingPieces\"+attackingPieces);\n System.out.println(combatants.contains(battleGround.getOwner()) ? \"TRUE\" : \"FALSE\");\n\t\t\t\t\t\tif (combatants.contains(battleGround.getOwner()) && battleFort != null) {\n System.out.println(battleGround + \"===battleground\");\n\t\t\t\t\t\t\tattackingPieces.put(battleGround.getOwner().getName(), new ArrayList<Piece>());\n System.out.println(attackingPieces + \"===attacking pieces\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (battleFort != null) {\n System.out.println(battleFort.getName() + \"===battlefort\");\n System.out.println(battleFort.getOwner().getName() + \"===battlefort's owner\");\n \n\t\t\t\t\t\t\tattackingPieces.get(battleFort.getOwner().getName()).add(battleFort);\n System.out.println(attackingPieces.get(battleFort.getOwner().getName()));\n\t\t\t\t\t\t}\n\t//\t\t\t\t\tif (battleGround city/village)\n\t\t\t\t\t\t// TODO city/village\n\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t // Check if all the players pieces are now gone\n\t\t\t\t if (!attackingPieces.containsKey(player.getName())) {\n\t\t\t\t \t\n\t\t\t\t \t// Display message, and remove player from combatants\n\t\t\t\t \tPlatform.runLater(new Runnable() {\n\t\t\t\t @Override\n\t\t\t\t public void run() {\n\t\t\t\t \t GUI.getHelpText().setText(\"Attack Phase: \" + player.getName() + \" has retreated all of their pieces!\");\n\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t \t\n\t\t\t\t \t// If there is only 1 player fighting for the hex, \n\t\t\t\t \tif (attackingPieces.size() == 1) \n\t\t\t\t \t\tbreak;\n\t\t\t\t \t\n\t\t\t\t \t// Pause because somebody just retreated\n\t\t\t\t \ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t }\n\t\t\t\t \n\n\t \t InfoPanel.cover(player.getName());\n\t\t\t\t \n\t\t\t }\n\t\t }\n\t\t \n\t\t // Done button no longer needed\n\t\t Platform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t GUI.getDoneButton().setDisable(true);\n\t\t }\n\t\t });\n\t\t ClickObserver.getInstance().setCreatureFlag(\"\");\n\t\t ClickObserver.getInstance().setFortFlag(\"\");\n\t\t \n\t\t // Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\n\t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n\t\t\t\t\n\t\t\t\t// Add wildthings back to combatants if they were removed\n\t\t\t\tif (battleGround.getContents().containsKey(wildThings.getName()) && !combatants.contains(wildThings))\n\t\t\t\t\tcombatants.add(wildThings);\n\t\t\t\t\n \t\t} // end while (combatants.size() > 1 || exploring)\n \t\tbattleGround.coverFort();\n \t\t\n////////////////// Post Combat\n \t\t\n \t\t// sets player as the winner of the combat\n \t\t// Can be null if battle takes place on a hex owned by nobody, and each player lost all pieces\n \t\tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n \tbattleGround.removeBattleHex();\n }\n \t\t});\n \t\t\n \t\tif (combatants.size() == 0)\n \t\t\tplayer = battleGround.getOwner();\n \t\telse if (combatants.size() == 1 && combatants.get(0).getName().equals(wildThings.getName()))\n \t\t\tplayer = null;\n \t\telse\n \t\t\tplayer = combatants.get(0);\n \t\t\n \t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n \t\tSystem.out.println(\"combatants: \" + combatants);\n \t\tfor (Player p : combatants) {\n \t\tSystem.out.println(\"p.getName(): \"+ p.getName());\n \t\t\t\n \t\t}\n \t\tSystem.out.println(\"owner: \" + owner);\n \t\tSystem.out.println(\"combatants.get(0): \" + combatants.get(0));\n \t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n \t\t\n \t\t\n \t\t// Change ownership of hex to winner\n \t\tboolean ownerChanged = false;\n \t\tif (owner != null && combatants.size() > 0 && !battleGround.getOwner().equals(combatants.get(0))) {\n \t\t\tbattleGround.getOwner().removeHex(battleGround);\n \t\t\tcombatants.get(0).addHexOwned(battleGround);\n \t\t\townerChanged = true;\n \t\t}\n\t\t\t\n \t\t// See if fort is kept or downgraded.\n \t\tif (battleFort != null) {\n if (battleFort.getName().equals(\"Citadel\")) {\n owner.setCitadel(false);\n player.setCitadel(true);\n battleFort.healFort();\n player.addHexOwned(battleGround);\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", you get to keep the fort!\");\n }\n });\n checkWinners();\n return;\n }\n \t\t\n\t\t\t\t// Get player to click dice to see if fort is kept\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", roll the die to see if the fort is kept or downgraded\");\n\t \tDiceGUI.getInstance().uncover();\n\t \tInfoPanel.showTileInfo(battleGround);\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n\t\t\t\tint oneOrSixGood = -1;\n\t\t\t\twhile (oneOrSixGood == -1) {\n\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t\t\t\t\toneOrSixGood = Dice.getFinalVal();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if a 1 or 6, keep fort (Keep it.... not turn it into a keep)\n\t\t\t\tif (oneOrSixGood == 1 || oneOrSixGood == 6) {\n\t\t\t\t\tbattleFort.healFort();\n\t\t\t\t\tplayer.addHexOwned(battleGround);\n\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", you get to keep the fort!\");\n\t\t }\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tbattleFort.downgrade();Platform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", the fort was destroyed!\");\n\t\t }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tInfoPanel.showTileInfo(battleGround);\n\t }\n\t });\n\t\t\t\t\n\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n\t\t\t\t\n\t\t\t\t\n \t\t}\n\n \t\tbattleGround.flipPiecesDown();\n\t\t\t// TODO city/village and special incomes if they are kept or lost/damaged \n \t\t\n \t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t}/// end Post combat\n\n \tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n//\t\t\t\tInfoPanel.showBattleStats();\n \tBoard.removeCovers();\n }\n\t\t});\n \t\n\t\tClickObserver.getInstance().setTerrainFlag(\"\");\n\t\tClickObserver.getInstance().setPlayerFlag(\"\");\n\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\tbattleGrounds.clear();\n }", "public void reveal(GameState pState, int[] pSpecies, Deadline pDue) {\n int score = 0;\n\n boolean[] newObs = {false, false, false, false, false, false};\n for (int i = 0; i < pSpecies.length; i++) {\n\n int currentSpecies = pSpecies[i];\n if (currentSpecies == guess[i]) {\n score++;\n }\n System.err.println(\"Bird num \" + i + \" : \" + speciesName(currentSpecies));\n Bird currentBird = pState.getBird(i);\n\n for (int j = 0; j < currentBird.getSeqLength(); j++) {\n if (currentBird.wasAlive(j)) {\n newObs[currentSpecies] = true;\n listObs.get(currentSpecies).add(currentBird.getObservation(j));\n }\n }\n\n }\n for (int i = 0; i < nbSpecies; i++) {\n int size = listObs.get(i).size();\n if (size >= 70 && newObs[i] && size <= 1000) {\n\n double[][] observationsMatrix = new double[size][1];\n for (int z = 0; z < size; z++) {\n observationsMatrix[z][0] = listObs.get(i).get(z);\n }\n int nbStates;\n int nbIterations = 50;\n\n if (size <= 100) {\n nbStates = 2;\n } else if (size <= 300) {\n nbStates = 3;\n } else {\n nbStates = 4;\n }\n\n HMMOfBirdSpecies newHMMOfBirdSpecies = new HMMOfBirdSpecies(transitionMatrixInit(nbStates), emissionMatrixInit(nbStates, nbTypesObservations), piMatrixInit(nbStates));\n newHMMOfBirdSpecies.BaumWelchAlgorithm(observationsMatrix, nbIterations);\n newHMMOfBirdSpecies.setTrained(true);\n\n listHMM[i] = newHMMOfBirdSpecies;\n\n }\n }\n\n System.err.println(\"Result : \" + score + \"/\" + pSpecies.length);\n }", "private void tick() {\n\n if (state == STATE.PAUSE) {\n return;\n }\n\n if (state == STATE.MENU || state == STATE.INSTRUCTIONS) {\n return;\n }\n\n if (spaceShips.size() == 0) {\n reset();\n state = STATE.MENU;\n return;\n }\n\n if (versus && spaceShips.size() == 1) {\n reset();\n state = STATE.MENU;\n versus = false;\n return;\n }\n\n if (!versus) {\n\n enemyGenerator.tick();\n powerUpGenerator.tick();\n score.tick();\n difficulty.tick();\n collision();\n }\n collisionVS();\n }", "public void perform(GameState state) {\n\n selectCrop(state);\n\n// returnBack(state); // add back in for command lines\n }", "public void gameStarted() {\n\t\treset();\n\t\tSystem.out.println(\"Game Started\");\n\n\t\t// allow me to manually control units during the game\n\t\tbwapi.enableUserInput();\n\t\t\n\t\t// set game speed to 30 (0 is the fastest. Tournament speed is 20)\n\t\t// You can also change the game speed from within the game by \"/speed X\" command.\n\t\tbwapi.setGameSpeed(20);\n\t\t\n\t\t// analyze the map\n\t\tbwapi.loadMapData(true);\n\t\t\n\n\t\t// This is called at the beginning of the game. You can \n\t\t// initialize some data structures (or do something similar) \n\t\t// if needed. For example, you should maintain a memory of seen \n\t\t// enemy buildings.\n\t\tbwapi.printText(\"This map is called \"+bwapi.getMap().getName());\n\t\tbwapi.printText(\"Enemy race ID: \"+String.valueOf(bwapi.getEnemies().get(0).getRaceID()));\t// Z=0,T=1,P=2\n\t\t\n\t\tmanagers.put(ArmyManager.class.getSimpleName(), ArmyManager.getInstance());\n\t\tmanagers.put(BuildManager.class.getSimpleName(), BuildManager.getInstance());\n\t\tmanagers.put(ResourceManager.class.getSimpleName(), ResourceManager.getInstance());\n\t\tmanagers.put(ScoutManager.class.getSimpleName(), ScoutManager.getInstance());\n\t\tmanagers.put(TrashManager.class.getSimpleName(), TrashManager.getInstance());\n\t\tmanagers.put(UnitManager.class.getSimpleName(), UnitManager.getInstance());\n\t\tfor (Manager manager : managers.values())\n\t\t\tmanager.reset();\n\t}", "State(int[][] startBoardState, int [][] goalBoardState){\n this.currentBoardState = startBoardState;\n this.goalBoardState = goalBoardState;\n this.g_cost = 0;\n this.parentState = null;\n }", "@Override\n public void startState() {\n Spell.clear();\n initGoldRenderers();\n initBackground();\n startBattleState();\n isOver = false;\n }", "void updateGameState(GameState gameState);", "void testBigBang(Tester t) {\r\n initData();\r\n FloodItWorld g = this.runGame;\r\n int worldWidth = 1000;\r\n int worldHeight = 1000;\r\n double tickRate = .012;\r\n g.bigBang(worldWidth, worldHeight, tickRate);\r\n }", "public void act() \n {\n\n World wrld = getWorld();\n if(frameCounter >= frameWait)\n {\n super.act();\n frameCounter = 0;\n }\n else\n {\n frameCounter++;\n }\n if (dying)\n deathcounter++;\n GreenfootImage trans = getImage();\n trans.scale(500,500);\n setImage(trans);\n setLocation(getX(), (getY()));\n\n if (deathcounter > 10)\n {\n wrld.removeObject(this);\n ((Universe)wrld).score += 50;\n }\n else if (getX() < 10)\n wrld.removeObject(this);\n }", "public void gameUpdate() {\n\t\t\n\t\t// Remember our homeTilePosition at the first frame\n\t\tif (bwapi.getFrameCount() == 1) {\n\t\t\tint cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Terran_Command_Center.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Zerg_Hatchery.ordinal(), 0, 0);\n\t\t\tif (cc == -1) cc = BuildManager.getInstance().getNearestUnit(UnitTypes.Protoss_Nexus.ordinal(), 0, 0);\n\t\t\thomePositionX = bwapi.getUnit(cc).getX();\n\t\t\thomePositionY = bwapi.getUnit(cc).getY();\n\t\t\n\t\t\tResourceManager.getInstance().gameStart(bwapi.getMyUnits());\n\t\t}\n\t\t\n\t\t/*\n\t\tif(ResourceManager.getInstance().numWorkers() == 10 && ScoutManager.getInstance().numScouts() == 0) {\n\t\t\tbwapi.printText(\"Assigning a scout\");\n\t\t\tneedsScout();\n\t\t}\n\t\t*/\n\t\t\n\t\tfor (Manager manager : managers.values())\n\t\t\tmanager.gameUpdate();\n\t\t\n\t\t// Draw debug information on screen\n\t\tdrawDebugInfo();\n\n\t\t\n\t\t// Call the act() method every 30 frames\n\t\tif (bwapi.getFrameCount() % 30 == 0) {\n\t\t\tact();\n\t\t}\n\t}", "public void startGame(){\n\t\t\r\n\t\tframe = new JFrame();\r\n\t\t\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\r\n\t\tframe.setSize(1600, 900);\r\n\t\t\r\n\t\tframe.setVisible(true);\r\n\t\t\r\n\t\tframe.setResizable(false);\r\n\r\n\t\tpanel = new JPanel();\r\n\t\t\r\n\t\tframe.addKeyListener(new KeyListener(){\r\n\t\t\tpublic void keyPressed(KeyEvent ke) {\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_UP)\r\n\t\t\t\t\tup = true;\r\n\t\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_DOWN)\r\n\t\t\t\t\tdown = true;\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_LEFT)\r\n\t\t\t\t\tleft = true;\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_RIGHT)\r\n\t\t\t\t\tright = true;\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_Z)\r\n\t\t\t\t\tshoot = true;\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_SPACE)\r\n\t\t\t\t\tburn = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpublic void keyReleased(KeyEvent ke) {\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_UP)\r\n\t\t\t\t\tup = false;\r\n\t\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_DOWN)\r\n\t\t\t\t\tdown = false;\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_LEFT)\r\n\t\t\t\t\tleft = false;\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_RIGHT)\r\n\t\t\t\t\tright = false;\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_Z)\r\n\t\t\t\t\tshoot = false;\r\n\t\t\t\t\r\n\t\t\t\tif(ke.getKeyCode() == KeyEvent.VK_SPACE)\r\n\t\t\t\t\tburn = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpublic void keyTyped(KeyEvent ke) {}\r\n\t\t});\t\r\n\t\t\r\n\t\tframe.setContentPane(panel);\r\n\t\t\r\n\t\tbigBoy = new PlayerTomcat(800,450,100);\r\n\t\t\r\n\t\thud = new HeadUp();\r\n\t\t\r\n\t\tnew EnemyPlane((float) (Math.random() * 1600),(float) (Math.random() * 900),0);\r\n\t\tnew EnemyPlane((float) (Math.random() * 1600),(float) (Math.random() * 900),0);\r\n\t\tnew EnemyPlane((float) (Math.random() * 1600),(float) (Math.random() * 900),0);\r\n\t\tnew move((float) (Math.random() * 1600),(float) (Math.random() * 600),0);\r\n\t\tnew move((float) (Math.random() * 1600),(float) (Math.random() * 600),0);\r\n\t\tboolean swetch = true;\r\n\t\t\r\n\t\tfirst = new BufferedImage(1600,900, BufferedImage.SCALE_FAST);\r\n\t\tsecond = new BufferedImage(1600,900, BufferedImage.SCALE_FAST);\r\n\t\t\r\n\t\tGraphics2D g = (Graphics2D) first.getGraphics();\r\n\t\t\r\n\t\tGradientPaint horizon;\r\n\t\t\r\n\t\t\r\n\t\twhile(true) {\r\n\t\t\tlastTime = System.nanoTime();\r\n\t\t\t\r\n\t\t\tEntity.updateAll();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(swetch)\r\n\t\t\t\tg = (Graphics2D) first.getGraphics();\r\n\t\t\telse\r\n\t\t\t\tg = (Graphics2D) second.getGraphics();\r\n\t\t\t\r\n\t\t\tg.setColor(new Color(153,204,255));\r\n\t\t\tg.fillRect(0, 0, 1600, 900);\r\n\t\t\t\r\n\t\t\thorizon = new GradientPaint(0, 900 - ((int)bigBoy.getY()), Color.WHITE, 0, 100, new Color(153,204,255));\r\n\t\t\tg.setPaint(horizon);\r\n\t\t\tg.fillRect(0, 000, 1600, 900 -((int)bigBoy.getY()/2));\r\n\t\t\t\r\n\t\t\t//make ground\r\n\t\t\tif(skip == 0){\r\n\t\t\t\tfor(int counter = 700; counter <= 1000; counter += 50){\r\n\t\t\t\t\tif(flop){\r\n\t\t\t\t\t\tg.setColor(new Color(12, 122, 14));\r\n\t\t\t\t\t\tflop = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tg.setColor(new Color(22,132,24));\r\n\t\t\t\t\t\tflop = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tg.fillRect(0, counter-((int)bigBoy.getY()/2), 1600, 900);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tfor(int counter = 700; counter <= 1000; counter += 50){\r\n\t\t\t\t\tif(flop){\r\n\t\t\t\t\t\tg.setColor(new Color(12, 122, 14));\r\n\t\t\t\t\t\tflop = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tg.setColor(new Color(22,132,24));\r\n\t\t\t\t\t\tflop = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tg.fillRect(0, counter-((int)bigBoy.getY()/2), 1600, 900);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tskip ++;\r\n\t\t\tif(skip > 50){\r\n\t\t\t\tskip = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tEntity.drawAll(g);\r\n\t\t\t\r\n\t\t\thud.update();\r\n\t\t\tg.drawImage(hud.sprite, 0, 0, null);\r\n\t\t\t\r\n\t\t\tif(swetch)\r\n\t\t\t\tpanel.getGraphics().drawImage(first, 0, 0, null);\r\n\t\t\telse\r\n\t\t\t\tpanel.getGraphics().drawImage(second, 0, 0, null);\r\n\t\t}\r\n\t \r\n\t}", "public void startGame() {\n\t\timages = new ImageContainer();\n\t\ttimer = new Timer(15, this);\n\t\ttimer.setRepeats(true);\n\t\tlevelStartTimer = new Timer(2000, this);\n\t\thighScore = new HighScore();\n\t\tpacmanAnimation = new PacmanAnimation(images.pacman, new int[] { 3, 2,\n\t\t\t\t0, 1, 2 });\n\t\tactualLevel = 1;\n\t\tinitNewLevel();\n\t}", "public void handStarted(int position, GameState gs, Card[] cards) {\r\n }" ]
[ "0.6471876", "0.62065166", "0.61668485", "0.61461014", "0.6078503", "0.6048616", "0.5986267", "0.5932453", "0.59172803", "0.5879283", "0.58205754", "0.58195126", "0.5788233", "0.57765377", "0.5766554", "0.5754361", "0.57498187", "0.57428914", "0.57259685", "0.57259685", "0.5721681", "0.5719241", "0.57004046", "0.5685103", "0.56806785", "0.5670939", "0.5667948", "0.5660349", "0.565834", "0.5644264", "0.56258786", "0.56219995", "0.5616989", "0.56141543", "0.56129897", "0.5609235", "0.56057316", "0.56026024", "0.55926126", "0.5565954", "0.55517936", "0.5549237", "0.55357164", "0.55280596", "0.55257326", "0.5525478", "0.55210036", "0.5519003", "0.5510589", "0.5509832", "0.5508168", "0.5507876", "0.5505428", "0.5497032", "0.54954726", "0.5483906", "0.5473491", "0.5471076", "0.5469106", "0.5465268", "0.5463642", "0.54603326", "0.545831", "0.54507595", "0.5449626", "0.54486716", "0.5443934", "0.5442008", "0.54305726", "0.54257447", "0.5413826", "0.5408338", "0.54082596", "0.54074264", "0.53996694", "0.53972465", "0.53962225", "0.53937817", "0.53908795", "0.53908795", "0.53906924", "0.53856194", "0.5384125", "0.5381194", "0.5379711", "0.53757656", "0.5373805", "0.53729224", "0.53702503", "0.5366847", "0.5358688", "0.53550684", "0.5347298", "0.5345912", "0.5345536", "0.53413826", "0.5340919", "0.53406954", "0.53378236", "0.5334995" ]
0.683113
0
Guess the species! This function will be called at the end of each round, to give you a chance to identify the species of the birds for extra points. Fill the vector with guesses for the all birds. Use SPECIES_UNKNOWN to avoid guessing.
public int[] guess(GameState pState, Deadline pDue) { /* * Here you should write your clever algorithms to guess the species of * each bird. This skeleton makes no guesses, better safe than sorry! */ double logProb; int[] lguess = new int[pState.getNumBirds()]; int species; for (int i = 0; i < pState.getNumBirds(); ++i) { species = -1; logProb = Double.NEGATIVE_INFINITY; Bird currentBird = pState.getBird(i); double[][] observations = new double[currentBird.getSeqLength()][1]; for (int j = 0; j < currentBird.getSeqLength(); j++) { if (currentBird.wasAlive(j)) { observations[j][0] = currentBird.getObservation(j); } } for (int j = 0; j < nbSpecies; j++) { if (listHMM[j] != null) { HMMOfBirdSpecies currentHMM = listHMM[j]; double newLogProb = currentHMM.SequenceLikelihood(observations); // System.err.println("Species " + speciesName(j) + " Prob = " + newLogProb); if (newLogProb > logProb) { logProb = newLogProb; species = j; } } } if (species == -1 || logProb < - 200) { for (int k = 0; k < nbSpecies; k++) { if (listHMM[k] == null) { species = k; logProb = Double.NEGATIVE_INFINITY; break; } } } System.err.println("Estimation for Bird number " + i + " " + speciesName(species) + " with p :" + logProb); lguess[i] = species; } guess = lguess.clone(); return lguess; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int[] guess(GameState pState, Deadline pDue) {\n /*\n * Here you should write your clever algorithms to guess the species of\n * each bird. This skeleton makes no guesses, better safe than sorry!\n */\n int[] lGuess = new int[pState.getNumBirds()];\n for (int i = 0; i < pState.getNumBirds(); i++) {\n int specie = 0;\n double maxVal = -100000000;\n Bird b = pState.getBird(i);\n int[] obsSeq = getBirdSeqUntilDeath(b);\n if (obsSeq.length == 0) {\n lGuess[i] = Constants.SPECIES_UNKNOWN;\n continue;\n }\n for (BirdModel birdModel : birdModelGuesses.values()) {\n// System.err.println(\"birdtype: \" + birdModel.birdType);\n double prob = birdModel.model.logProbForObsSeq(obsSeq);\n if (prob > maxVal) {\n maxVal = prob;\n specie = birdModel.birdType;\n }\n }\n// System.err.println(\"MAXVAL: \" + maxVal);\n lGuess[i] = specie;\n }\n\n return lGuess;\n }", "public Animal findAnimalZoo(String species) {\n for (int i = 0; i < numRegions; i++) {\n Animal[] temp = regionList[i].getRegionAnimals(); //regionList[i].getAnimalList(); @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ NO GETANIMALIST METHOD YET@@@@@@@@@@@@@@@@@@@@@@@@@\n for (int j = 0; j < regionList[i].getRegionSpec().getNumAnimals(); j++) {\n if (temp[j].getSpecies().equals(species)) {\n return temp[i]; \n }\n }\n }\n return null;\n }", "private void fetchUnknownBirdsNames(Session session) {\n QAQCMain.log.info(\"Getting the birds with unknown name\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.speciesName, species.site.siteCode from Species as species \"\n + \"where not exists (from RefBirds as ref where ref.refBirdsName like species.speciesName) \"\n + \"and species.speciesGroup like 'B'\"\n + \"order by species.speciesName ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n Object[] columnNames = {\"Site\", \"Birds Name\"};\n model.setColumnIdentifiers(columnNames);\n updateNumResults(i);\n }", "private void fetchUnknownSpeciesNames(Session session) {\n QAQCMain.log.info(\"Getting the species with unknown name\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.speciesName, species.site.siteCode from Species as species \"\n + \"where not exists (from RefSpecies as ref where ref.refSpeciesName like species.speciesName) \"\n + \"and species.speciesGroup not like 'B'\"\n + \"order by species.speciesName ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n\n model.insertRow(i, tuple);\n i++;\n }\n Object[] columnNames = {\"Site\", \"Species Name\"};\n model.setColumnIdentifiers(columnNames);\n\n updateNumResults(i);\n }", "protected void initializePopulation () {\n\t\tfor (int i = 0; i < this.speciesSize; i++) {\n\t\t\tthis.detectors.add(DetectorFactory.makeDetector(this.featuresLength, this.typeBias, this.generalityBias));\n\t\t}\n\t}", "public java.util.ArrayList<Species> getAllSpecies() {\n ArrayList<Species> answer = new ArrayList<Species>();\n getAllDescendantSpecies(overallRoot, answer);\n return answer;\n \n }", "public void magic(){\n //no joke, this is literally what I named the method last year\n Student previous = this.students.get(0);\n for (Species s2:this.species) s2.getStudents().clear();\n for (Student s:this.students) {\n boolean notFoundSpecies = true;\n for (Species species:this.species) {\n if(species.sameSpecies(s.getBrain())){\n species.addStudent(s);\n notFoundSpecies = false;\n break;\n }\n }\n if(notFoundSpecies) this.species.add(new Species(s));\n }\n this.students.sort(Comparator.comparingDouble(Student::getScore).reversed());\n this.species.forEach(Species::sort);\n this.species.sort(Comparator.comparingDouble(Species::getBestScore).reversed());\n ArrayList<Species> speciesArrayList = this.species;\n for (int i = 0; i < speciesArrayList.size(); i++) {\n System.out.print(\"Species \" + i + \" Score: \" + speciesArrayList.get(i).getBestScore() + \" \");\n }\n System.out.println();\n\n if(Config.printGenerationScores) {\n System.out.print(\"bar [\");\n for (Species species : this.species)\n for (Student s2 : species.getStudents()) System.out.print(s2.getScore() + \", \");\n System.out.println(\"]\");\n System.out.print(\"foobar [\");\n for (Student student : this.students) System.out.print(student.getScore() + \", \");\n System.out.println(\"]\");\n System.out.print(\"foo [\");\n this.species.forEach(s -> System.out.print(s.getBestScore() + \", \"));\n System.out.print(\"]\");\n }\n\n if(this.killThemAll){\n while(5 < this.species.size()){\n this.species.remove(5);\n }\n this.killThemAll = false;\n System.out.println(\"Extinction Complete\");\n }\n for (Species s:this.species) {\n s.eliminate();\n s.shareScore();\n s.setAverage();\n }\n\n Student temp = this.species.get(0).getStudents().get(0);\n temp.setGen(this.gen);\n if(temp.getScore() >= this.bestScore){\n //Here it is! The beholden, the stupid, the idiotic, player #0\n //its alive!\n //temp.getPlayer().getComponent(PlayerComponent.class).setDead(false);\n //temp = temp.duplicate(temp.getPlayer());\n System.out.printf(\"Old Best: %f New Best: %f\", this.bestScore, temp.getScore());\n this.bestScore = temp.getScore();\n temp.getBrain().saveNetwork();\n }\n System.out.println();\n int i = 2;\n while(i < this.species.size()){\n if(this.species.get(i).getNoChange() >= 15){\n this.species.remove(i);\n i -= 1;\n }\n i += 1;\n }\n System.out.printf(\"Generation: %d Number of Changes: %d Number of Species: %d\\n\",\n this.gen, this.innovationHistory.size(), this.species.size());\n //very convenient and hopefully not slower\n double avgSum = this.species.stream().mapToDouble(Species::getBestScore).sum();\n ArrayList<Student> kids = new ArrayList<>();\n for (Species s:this.species) {\n kids.add(s.getChamp().duplicate(s.getChamp().getPlayer()));\n int studentNumber = (int)(Math.floor(s.getAverage() / avgSum * this.students.size()) - 1);\n for (int j = 0; j < studentNumber; j++) {\n kids.add(s.newStudent(this.innovationHistory));\n }\n }\n if(kids.size() < this.students.size()) kids.add(previous.duplicate(previous.getPlayer()));\n while(kids.size() < this.students.size()) kids.add(this.species.get(0).newStudent(this.innovationHistory));\n this.students = new ArrayList<>(kids);\n this.gen++;\n for (Student s:this.students) {\n s.getBrain().generateNetwork();\n }\n }", "public void reveal(GameState pState, int[] pSpecies, Deadline pDue) {\n int score = 0;\n\n boolean[] newObs = {false, false, false, false, false, false};\n for (int i = 0; i < pSpecies.length; i++) {\n\n int currentSpecies = pSpecies[i];\n if (currentSpecies == guess[i]) {\n score++;\n }\n System.err.println(\"Bird num \" + i + \" : \" + speciesName(currentSpecies));\n Bird currentBird = pState.getBird(i);\n\n for (int j = 0; j < currentBird.getSeqLength(); j++) {\n if (currentBird.wasAlive(j)) {\n newObs[currentSpecies] = true;\n listObs.get(currentSpecies).add(currentBird.getObservation(j));\n }\n }\n\n }\n for (int i = 0; i < nbSpecies; i++) {\n int size = listObs.get(i).size();\n if (size >= 70 && newObs[i] && size <= 1000) {\n\n double[][] observationsMatrix = new double[size][1];\n for (int z = 0; z < size; z++) {\n observationsMatrix[z][0] = listObs.get(i).get(z);\n }\n int nbStates;\n int nbIterations = 50;\n\n if (size <= 100) {\n nbStates = 2;\n } else if (size <= 300) {\n nbStates = 3;\n } else {\n nbStates = 4;\n }\n\n HMMOfBirdSpecies newHMMOfBirdSpecies = new HMMOfBirdSpecies(transitionMatrixInit(nbStates), emissionMatrixInit(nbStates, nbTypesObservations), piMatrixInit(nbStates));\n newHMMOfBirdSpecies.BaumWelchAlgorithm(observationsMatrix, nbIterations);\n newHMMOfBirdSpecies.setTrained(true);\n\n listHMM[i] = newHMMOfBirdSpecies;\n\n }\n }\n\n System.err.println(\"Result : \" + score + \"/\" + pSpecies.length);\n }", "public void postSpeciation() {\n\t\tif (speciesTarget > 0) {\r\n\t\t\tadjustThreshold();\r\n\t\t}\r\n\r\n\t\t// remove dead species\r\n\t\tfor (int i = 0; i < speciesList.size(); i++) {\r\n\r\n\t\t\tspeciesList.get(i).updateBestFitness();\r\n\r\n\t\t\tif ((speciesList.get(i).size() < 1) || (speciesList.get(i).isStagnant())) {\r\n\t\t\t\tspeciesList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected String getSpecies() {\n\t\treturn species;\n\t}", "@Override\n\tpublic String getSpecies() {\n\t\treturn \"homo sapien\";\n\t}", "public void updateSpecies (String treeSpeciesName, int crownShape,\r\n\t\t\t\t\t\t\t\tdouble ellipsoidTruncationRatio, \r\n\t\t\t\t\t\t\t\tdouble heightDbhAllometricCoeffA, double heightDbhAllometricCoeffB,\r\n\t\t\t\t\t\t\t\tdouble crownDbhAllometricCoeffA, double crownDbhAllometricCoeffB,\r\n\t\t\t\t\t\t\t\tdouble stemDbhAllometricCoeffA, double stemDbhAllometricCoeffB, double stemDbhAllometricCoeffC, \r\n\t\t\t\t\t\t\t\tdouble dcbFromDbhAllometricCoeff,\r\n\t\t\t\t\t\t\t\tdouble stumpToStemBiomassRatio,\r\n\t\t\t\t\t\t\t\tdouble cRAreaToFRLengthRatio, \r\n\t\t\t\t\t\t\t\tdouble initialTargetLfrRatio,\r\n\t\t\t\t\t\t\t\tdouble leafAreaCrownVolCoefA, double leafAreaCrownVolCoefB,\r\n\t\t\t\t\t\t\t\tdouble woodAreaDensity, double leafParAbsorption, double leafNirAbsorption, double clumpingCoef,\r\n\t\t\t\t\t\t\t\tint phenologyType,\r\n\t\t\t\t\t\t\t\tint budBurstTempAccumulationDateStart,\r\n\t\t\t\t\t\t\t\tdouble budBurstTempThreshold,\r\n\t\t\t\t\t\t\t\tdouble budBurstAccumulatedTemp,\r\n\t\t\t\t\t\t\t\tint leafExpansionDuration,\r\n\t\t\t\t\t\t\t\tint budBurstToLeafFallDuration,\r\n\t\t\t\t\t\t\t\tint leafFallDuration,\r\n\t\t\t\t\t\t\t\tdouble leafFallFrostThreshold,\r\n\t\t\t\t\t\t\t\tint budBurstDelayMinAfterPollaring,\r\n\t\t\t\t\t\t\t\tint budBurstDelayMaxAfterPollaring,\r\n\t\t\t\t\t\t\t\tdouble stemFlowCoefficient,\r\n\t\t\t\t\t\t\t\tdouble stemFlowMax,\r\n\t\t\t\t\t\t\t\tdouble wettability,\r\n\t\t\t\t\t\t\t\tdouble transpirationCoefficient,\r\n\t\t\t\t\t\t\t\tdouble lueMax,\r\n\t\t\t\t\t\t\t\tint leafAgeForLueMax,\r\n\t\t\t\t\t\t\t\tdouble leafSenescenceTimeConstant,\r\n\t\t\t\t\t\t\t\tdouble leafCarbonContent,\r\n\t\t\t\t\t\t\t\tdouble leafMassArea,\r\n\t\t\t\t\t\t\t\tdouble luxuryNCoefficient,\r\n\t\t\t\t\t\t\t\tdouble targetNCoefficient,\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble rootNRemobFraction,\r\n\t\t\t\t\t\t\t\tdouble leafNRemobFraction,\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble targetNSCFraction,\r\n\t\t\t\t\t\t\t\tdouble maxNSCUseFraction,\r\n\t\t\t\t\t\t\t\tdouble maxNSCUseFoliageFraction,\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tint rsStressMethod,\r\n\t\t\t\t\t\t\t\tint lueStressMethod,\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble rsNoStressResponsiveness,\r\n\t\t\t\t\t\t\t\tdouble rsWaterStressResponsiveness,\r\n\t\t\t\t\t\t\t\tdouble rsNitrogenStressResponsiveness,\r\n\t\t\t\t\t\t\t\tdouble lueWaterStressResponsiveness,\r\n\t\t\t\t\t\t\t\tdouble lueNitrogenStressResponsiveness,\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble maxTargetLfrRatioDailyVariation,\r\n\t\t\t\t\t\t\t\tdouble targetLfrRatioUpperDrift,\r\n\t\t\t\t\t\t\t\tdouble minTargetLfrRatio,\r\n\t\t\t\t\t\t\t\tdouble maxTargetLfrRatio,\r\n\t\t\t\t\t\t\t\tdouble optiNCBranch,\r\n\t\t\t\t\t\t\t\tdouble optiNCCoarseRoot,\r\n\t\t\t\t\t\t\t\tdouble optiNCFineRoot,\r\n\t\t\t\t\t\t\t\tdouble optiNCFoliage,\r\n\t\t\t\t\t\t\t\tdouble optiNCStem,\r\n\t\t\t\t\t\t\t\tdouble optiNCStump,\r\n\t\t\t\t\t\t\t\tdouble woodDensity,\r\n\t\t\t\t\t\t\t\tdouble branchVolumeRatio,\r\n\t\t\t\t\t\t\t\tdouble woodCarbonContent,\r\n\t\t\t\t\t\t\t\tdouble maxCrownRadiusInc,\r\n\t\t\t\t\t\t\t\tdouble maxHeightInc,\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble imbalanceThreshold,\r\n\t\t\t\t\t\t\t\tdouble leafSenescenceRate,\r\n\t\t\t\t\t\t\t\tdouble coarseRootAnoxiaResistance,\r\n\t\t\t\t\t\t\t\tdouble specificRootLength,\r\n\t\t\t\t\t\t\t\tdouble colonisationThreshold,\r\n\t\t\t\t\t\t\t\tdouble colonisationFraction,\r\n\t\t\t\t\t\t\t\tdouble fineRootLifespan,\r\n\t\t\t\t\t\t\t\tdouble fineRootAnoxiaLifespan,\r\n\t\t\t\t\t\t\t\tdouble horizontalPreference,\r\n\t\t\t\t\t\t\t\tdouble geotropismFactor,\r\n\t\t\t\t\t\t\t\tdouble localWaterUptakeFactor,\r\n\t\t\t\t\t\t\t\tdouble sinkDistanceEffect,\r\n\t\t\t\t\t\t\t\tdouble localNitrogenUptakeFactor,\r\n\t\t\t\t\t\t\t\tint coarseRootTopologyType,\r\n\t\t\t\t\t\t\t\tdouble rootDiameter, double rootConductivity,\r\n\t\t\t\t\t\t\t\tdouble alpha,\r\n\t\t\t\t\t\t\t\tdouble minTranspirationPotential,double maxTranspirationPotential,\r\n\t\t\t\t\t\t\t\tdouble bufferPotential, double longitudinalResistantFactor) {\r\n\r\n\t\tthis.name = treeSpeciesName;\r\n\t\tthis.crownShape = crownShape;\r\n\t\tthis.ellipsoidTruncationRatio = ellipsoidTruncationRatio;\r\n\t\tthis.heightDbhAllometricCoeffA = heightDbhAllometricCoeffA;\r\n\t\tthis.heightDbhAllometricCoeffB = heightDbhAllometricCoeffB;\r\n\t\tthis.crownDbhAllometricCoeffA = crownDbhAllometricCoeffA;\r\n\t\tthis.crownDbhAllometricCoeffB = crownDbhAllometricCoeffB;\r\n\t\tthis.stemDbhAllometricCoeffA = stemDbhAllometricCoeffA;\r\n\t\tthis.stemDbhAllometricCoeffB = stemDbhAllometricCoeffB;\r\n\t\tthis.stemDbhAllometricCoeffC = stemDbhAllometricCoeffC;\r\n\t\tthis.dcbFromDbhAllometricCoeff = dcbFromDbhAllometricCoeff;\r\n\t\tthis.stumpToStemBiomassRatio = stumpToStemBiomassRatio;\r\n\t\tthis.cRAreaToFRLengthRatio = cRAreaToFRLengthRatio;\r\n\t\tthis.initialTargetLfrRatio = initialTargetLfrRatio; \r\n\t\tthis.leafAreaCrownVolCoefA = leafAreaCrownVolCoefA;\r\n\t\tthis.leafAreaCrownVolCoefB = leafAreaCrownVolCoefB;\r\n\t\tthis.woodAreaDensity = woodAreaDensity;\r\n\t\tthis.leafParAbsorption = leafParAbsorption;\r\n\t\tthis.leafNirAbsorption = leafNirAbsorption;\r\n\t\tthis.clumpingCoef = clumpingCoef;\r\n\t\tthis.phenologyType = phenologyType;\r\n\t\tthis.budBurstTempAccumulationDateStart = budBurstTempAccumulationDateStart;\r\n\t\tthis.budBurstTempThreshold = budBurstTempThreshold;\r\n\t\tthis.budBurstAccumulatedTemp = budBurstAccumulatedTemp;\r\n\t\tthis.leafExpansionDuration = leafExpansionDuration;\r\n\t\tthis.budBurstToLeafFallDuration = budBurstToLeafFallDuration;\r\n\t\tthis.leafFallDuration = leafFallDuration;\r\n\t\tthis.leafFallFrostThreshold = leafFallFrostThreshold;\r\n\t\tthis.budBurstDelayMinAfterPollaring = budBurstDelayMinAfterPollaring;\r\n\t\tthis.budBurstDelayMaxAfterPollaring = budBurstDelayMaxAfterPollaring;\r\n\t\tthis.stemFlowCoefficient = stemFlowCoefficient;\r\n\t\tthis.stemFlowMax = stemFlowMax;\r\n\t\tthis.wettability = wettability;\r\n\t\tthis.transpirationCoefficient = transpirationCoefficient;\r\n\t\tthis.lueMax = lueMax;\r\n\t\tthis.leafAgeForLueMax = leafAgeForLueMax;\r\n\t\tthis.leafSenescenceTimeConstant = leafSenescenceTimeConstant;\r\n\t\tthis.leafCarbonContent = leafCarbonContent;\r\n\t\tthis.leafMassArea = leafMassArea;\r\n\t\tthis.luxuryNCoefficient = luxuryNCoefficient;\r\n\t\tthis.targetNCoefficient = targetNCoefficient;\r\n\t\tthis.rootNRemobFraction = rootNRemobFraction;\r\n\t\tthis.leafNRemobFraction = leafNRemobFraction;\r\n\t\tthis.targetNSCFraction = targetNSCFraction;\r\n\t\tthis.maxNSCUseFraction = maxNSCUseFraction;\r\n\t\tthis.maxNSCUseFoliageFraction = maxNSCUseFoliageFraction;\r\n\t\tthis.rsNoStressResponsiveness = rsNoStressResponsiveness;\r\n\t\tthis.rsWaterStressResponsiveness = rsWaterStressResponsiveness;\r\n\t\tthis.rsNitrogenStressResponsiveness = rsNitrogenStressResponsiveness;\r\n\t\tthis.lueWaterStressResponsiveness = lueWaterStressResponsiveness;\r\n\t\tthis.lueNitrogenStressResponsiveness = lueNitrogenStressResponsiveness;\r\n\t\tthis.maxTargetLfrRatioDailyVariation = maxTargetLfrRatioDailyVariation;\r\n\t\tthis.targetLfrRatioUpperDrift = targetLfrRatioUpperDrift;\r\n\t\tthis.minTargetLfrRatio = minTargetLfrRatio;\r\n\t\tthis.maxTargetLfrRatio = maxTargetLfrRatio;\r\n\t\tthis.optiNCBranch = optiNCBranch;\r\n\t\tthis.optiNCCoarseRoot = optiNCCoarseRoot;\r\n\t\tthis.optiNCFineRoot = optiNCFineRoot;\r\n\t\tthis.optiNCFoliage = optiNCFoliage;\r\n\t\tthis.optiNCStem = optiNCStem;\r\n\t\tthis.optiNCStump = optiNCStump;\r\n\t\tthis.woodDensity = woodDensity;\r\n\t\tthis.branchVolumeRatio = branchVolumeRatio;\r\n\t\tthis.woodCarbonContent = woodCarbonContent;\t\r\n\t\tthis.maxCrownRadiusInc = maxCrownRadiusInc;\r\n\t\tthis.maxHeightInc = maxHeightInc;\r\n\t\tthis.leafSenescenceRate = leafSenescenceRate;\r\n\t\tthis.imbalanceThreshold= imbalanceThreshold;\r\n\t\tthis.specificRootLength = specificRootLength;\r\n\t\tthis.coarseRootAnoxiaResistance=coarseRootAnoxiaResistance;\r\n\t\tthis.colonisationThreshold = colonisationThreshold;\r\n\t\tthis.colonisationFraction = colonisationFraction;\r\n\t\tthis.fineRootLifespan= fineRootLifespan;\r\n\t\tthis.fineRootAnoxiaLifespan = fineRootAnoxiaLifespan;\r\n\t\tthis.horizontalPreference= horizontalPreference;\r\n\t\tthis.geotropismFactor= geotropismFactor;\r\n\t\tthis.localWaterUptakeFactor = localWaterUptakeFactor;\r\n\t\tthis.sinkDistanceEffect = sinkDistanceEffect;\r\n\t\tthis.localNitrogenUptakeFactor = localNitrogenUptakeFactor;\r\n\t\tthis.coarseRootTopologyType = coarseRootTopologyType;\r\n\t\tthis.treeRootDiameter = rootDiameter;\r\n\t\tthis.treeRootConductivity = rootConductivity;\r\n\t\tthis.treeAlpha = alpha;\r\n\t\tthis.treeMinTranspirationPotential = minTranspirationPotential;\r\n\t\tthis.treeMaxTranspirationPotential = maxTranspirationPotential;\r\n\t\tthis.treeBufferPotential = bufferPotential;\r\n\t\tthis.treeLongitudinalResistantFactor = longitudinalResistantFactor;\r\n\t}", "private void fetchUnknownOSpeciesNames(Session session) {\n QAQCMain.log.info(\"Getting the other species with unknown name\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.otherSpeciesName, species.site.siteCode from OtherSpecies as species \"\n + \"where not exists (from RefSpecies as ref where ref.refSpeciesName like species.otherSpeciesName) \"\n + \"and species.otherSpeciesGroup not like 'B'\"\n + \"order by species.otherSpeciesName ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n Object[] columnNames = {\"Site\", \"Other Species Name\"};\n model.setColumnIdentifiers(columnNames);\n updateNumResults(i);\n\n }", "public void reproduce(int generation, IPopulation pop, List<ISpecies> sorted_species) {\n\t\tfor(ISpecies specie : sorted_species){\r\n\r\n\t\t\tList<IOrganism> organisms = specie.getOrganisms();\r\n\r\n\t\t\t// outside the species\r\n\t\t\tint orgnum = 0;\r\n\r\n\t\t\tIOrganism mom = null;\r\n\t\t\tIOrganism baby = null;\r\n\t\t\tIGenome new_genome = null;\r\n\t\t\tIOrganism _organism = null;\r\n\t\t\tIOrganism _dad = null;\r\n\r\n\t\t\tif (specie.getExpectedOffspring() > 0 && organisms.size() == 0)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t// elements for this species\r\n\t\t\tint poolsize = organisms.size() - 1;\r\n\r\n\t\t\t// the champion of the 'this' species is the first element of the species;\r\n\t\t\tIOrganism thechamp = organisms.get(0);\r\n\t\t\tboolean champ_done = false; // Flag the preservation of the champion\r\n\r\n\t\t\t// Create the designated number of offspring for the Species one at a time.\r\n\t\t\tfor (int count = 0; count < specie.getExpectedOffspring(); count++) {\r\n\r\n\t\t\t\t// If we have a super_champ (Population champion), finish off some special clones.\r\n\t\t\t\tif (thechamp.getSuperChampOffspring() > 0) {\r\n\r\n\t\t\t\t\t// save in mom current champ;\r\n\t\t\t\t\tmom = thechamp;\r\n\t\t\t\t\t// create a new genome from this copy\r\n\t\t\t\t\tnew_genome = mom.getGenome().duplicate(count);\r\n\t\t\t\t\tif ((thechamp.getSuperChampOffspring()) > 1) {\r\n\t\t\t\t\t\tif (RandomUtils.randomDouble() < .8 || evolutionParameters.getDoubleParameter(MUTATE_ADD_LINK_PROB) == 0.0)\r\n\t\t\t\t\t\t\tevolutionStrategy.getMutationStrategy().mutateLinkWeight(new_genome, evolutionParameters.getDoubleParameter(WEIGHT_MUT_POWER), 1.0, MutationType.GAUSSIAN);\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// Sometimes we add a link to a superchamp\r\n\t\t\t\t\t\t\tnew_genome.generatePhenotype(generation);\r\n\t\t\t\t\t\t\tevolutionStrategy.getMutationStrategy().mutateAddLink(new_genome,pop);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation);\r\n\t\t\t\t\tthechamp.incrementSuperChampOffspring();\r\n\t\t\t\t} // end population champ\r\n\r\n\t\t\t\t// If we have a Species champion, just clone it\r\n\t\t\t\telse if ((!champ_done) && (specie.getExpectedOffspring() > 5)) {\r\n\t\t\t\t\tmom = thechamp; // Mom is the champ\r\n\t\t\t\t\tnew_genome = mom.getGenome().duplicate(count);\r\n\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation); // Baby is\r\n\t\t\t\t\t// just like mommy\r\n\t\t\t\t\tchamp_done = true;\r\n\r\n\t\t\t\t} else if (RandomUtils.randomDouble() < evolutionParameters.getDoubleParameter(MUTATE_ONLY_PROB) || poolsize == 1) {\r\n\r\n\t\t\t\t\t// Choose the random parent\r\n\t\t\t\t\torgnum = RandomUtils.randomInt(0, poolsize);\r\n\t\t\t\t\t_organism = organisms.get(orgnum);\r\n\t\t\t\t\tmom = _organism;\r\n\t\t\t\t\tnew_genome = mom.getGenome().duplicate(count);\r\n\r\n\t\t\t\t\t// Do the mutation depending on probabilities of various mutations\r\n\t\t\t\t\tevolutionStrategy.getMutationStrategy().mutate(new_genome,pop,generation);\r\n\r\n\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation);\r\n\t\t\t\t}\r\n\t\t\t\t// Otherwise we should mate\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Choose the random mom\r\n\t\t\t\t\torgnum = RandomUtils.randomInt(0, poolsize);\r\n\t\t\t\t\t_organism = organisms.get(orgnum);\r\n\r\n\t\t\t\t\t// save in mom\r\n\t\t\t\t\tmom = _organism;\r\n\t\t\t\t\t// Choose random dad...\r\n\t\t\t\t\t// Mate within Species\r\n\t\t\t\t\tif (RandomUtils.randomDouble() > evolutionParameters.getDoubleParameter(INTERSPECIES_MATE_RATE)) {\r\n\t\t\t\t\t\torgnum = RandomUtils.randomInt(0, poolsize);\r\n\t\t\t\t\t\t_organism = organisms.get(orgnum);\r\n\t\t\t\t\t\t_dad = _organism;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Mate outside Species\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// save current species\r\n\t\t\t\t\t\tISpecies randspecies = specie;\r\n\t\t\t\t\t\t// Select a random species\r\n\t\t\t\t\t\tint giveup = 0;\r\n\t\t\t\t\t\t// Give up if you can't find a different Species\r\n\t\t\t\t\t\twhile ((randspecies == specie) && (giveup < 5)) {\r\n\r\n\t\t\t\t\t\t\t// Choose a random species tending towards better species\r\n\t\t\t\t\t\t\tdouble randmult = Math.min(1.0, RandomUtils.randomGaussian() / 4);\r\n\r\n\t\t\t\t\t\t\t// This tends to select better species\r\n\t\t\t\t\t\t\tint sp_ext = Math.max(0, (int) Math.floor((randmult * (sorted_species.size() - 1.0)) + 0.5));\r\n\t\t\t\t\t\t\trandspecies = sorted_species.get(sp_ext);\r\n\t\t\t\t\t\t\t++giveup;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_dad = randspecies.getOrganisms().get(0);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnew_genome = evolutionStrategy.getCrossoverStrategy().performCrossover(mom,_dad,count);\r\n\r\n\t\t\t\t\t// Determine whether to mutate the baby's Genome\r\n\t\t\t\t\t// This is done randomly or if the mom and dad are the same organism\r\n\t\t\t\t\tif (RandomUtils.randomDouble() > evolutionParameters.getDoubleParameter(MATE_ONLY_PROB) || \r\n\t\t\t\t\t\t\t_dad.getGenome().getId() == mom.getGenome().getId() || \r\n\t\t\t\t\t\t\t_dad.getGenome().compatibility(mom.getGenome()) == 0.0) {\r\n\r\n\t\t\t\t\t\tevolutionStrategy.getMutationStrategy().mutate(new_genome,pop,generation);\r\n\t\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation);\r\n\t\t\t\t\t} \r\n\t\t\t\t\t// end block of prob\r\n\t\t\t\t\t// Determine whether to mutate the baby's Genome\r\n\t\t\t\t\t// This is done randomly or if the mom and dad are the same organism\r\n\r\n\t\t\t\t\t// Create the baby without mutating first\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation);\r\n\t\t\t\t}\r\n\t\t\t\tevolutionStrategy.getSpeciationStrategy().addOrganismToSpecies(pop, baby);\r\n\t\t\t} // end offspring cycle\r\n\t\t}\r\n\t}", "void placeFruit()\n\t{\n\t\t// .first is x-coordinate, it gets a number between 1 and 16\n\t\tfruit[0] = randomPoint();\n\t\t// .second is y-coordinate, it gets a number between 1 and 16\n\t\tfruit[1] = randomPoint();\n\t\tfruit[2] = randomPoint();\n\n\t\t// loops the snakes length\n\t\tfor (int i = 0; i < theSnake.getLength(); i++)\n\t\t{\n\t\t\t// checks for fruit being on/under snake\n\t\t\tif (theSnake.getXofPartI(i) == fruit[0] && theSnake.getYofPartI(i) == fruit[1] && theSnake.getZofPartI(i) == fruit[2])\n\t\t\t{\n\t\t\t\t// Picks new spot for fruit, because it was found on the snake\n\t\t\t\tfruit[0] = randomPoint();\n\t\t\t\tfruit[1] = randomPoint();\n\t\t\t\tfruit[2] = randomPoint();\n\t\t\t\t// just in case the fruit landed on the snake again\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t}", "public void populateRiver()\n\t{\n\t\twhile (emptyIndices.size() != 10) // 10 animals requirement at start\n\t\t{\n\t\t\tswitch (rng.nextInt(3))\n\t\t\t{\n\t\t\tcase 0:\n\t\t\t\triver[rng.nextInt(20)] = new Bear();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\triver[rng.nextInt(20)] = new Fish();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\triver[rng.nextInt(20)] = null;\n\t\t\t}\n\t\t\tfindEmpty(); // force emptyIndices update\n\t\t}\n\t}", "public PokemonSpecies findSeenSpeciesData(String name) throws PokedexException {\n PokemonSpecies rv = null;\n String nameLower = name.toLowerCase();\n Iterator<PokemonSpecies> it = pokedex.iterator();\n PokemonSpecies currentSpecies;\n while(it.hasNext()) {\n currentSpecies = it.next();\n if(currentSpecies.getSpeciesName().equals(nameLower)) {\n rv = currentSpecies;\n break;\n }\n }\n if(rv == null) {\n throw new PokedexException(String.format(Config.UNSEEN_POKEMON, name));\n }\n return rv;\n }", "public List<String> getSpecies() {\n\t\tif (species == null || species.isEmpty())\n\t\t\tspecies = getSpeciesFromMiapes();\n\t\tif (species != null) {\n\t\t\tfinal List<String> ret = new ArrayList<String>();\n\t\t\tfor (final String specie : species) {\n\t\t\t\tret.add(ProteomeXchangeFilev2_1.MTD + TAB + \"species\" + TAB + specie);\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t\treturn null;\n\t}", "private void fetchUnknownSpeciesCodes(Session session) {\n QAQCMain.log.info(\"Getting the species with unknown code\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.speciesCode, species.site.siteCode from Species as species \"\n + \"where not exists (from RefSpecies as ref where ref.refSpeciesCode like species.speciesCode) \"\n + \"and species.speciesGroup not like 'B'\"\n + \"order by species.speciesCode ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n\n Object[] columnNames = {\"Site\", \"Species Code\"};\n model.setColumnIdentifiers(columnNames);\n updateNumResults(i);\n }", "private int[] placeFruit() {\n\t\t\n\t\tint []point = new int[2];\n\t\t\n\t\tint helpX, helpY, foodX = 0, foodY = 0;\n\t\tboolean helpS,helpO;\t// for Snake and Obstacles\n\t\tboolean collision = true;\n\t\tArrayList<Obstacle> obstacles = Controller.getInstance().getObstacles();\n\n\t\twhile(collision) {\n\t\t\t\t\n\t\t\thelpS =helpO= false;\n\t\t\tfoodX = (rand.nextInt(BWIDTH)*GameObject.SIZE)+GameObject.SIZE/2;\n\t\t\tfoodY = (rand.nextInt(BHEIGHT)*GameObject.SIZE)+GameObject.SIZE/2;\n\t\t\t\t\n\t\t\tfor(int i = 0; i < snake.getSize(); ++i) {\n\t\t\t\t\t\n\t\t\t\thelpX = snake.getBodyPart(i).getX();\n\t\t\t\thelpY = snake.getBodyPart(i).getY();\n\t\n\t\t\t\tif(helpX == foodX && helpY == foodY) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(i == snake.getSize() - 1) {\n\t\t\t\t\thelpS = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(helpS) {\n\n\n\n\t\t\t\t\tfor(int i = 0; i < obstacles.size(); ++i) {\n\n\t\t\t\t\t\thelpX = obstacles.get(i).getX();\n\t\t\t\t\t\thelpY = obstacles.get(i).getY();\n\n\t\t\t\t\t\tif(foodX == helpX && foodY == helpY) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(i == obstacles.size() - 1) {\n\t\t\t\t\t\t\thelpO = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\tif(helpO) {\n\t\t\t\t\tcollision = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpoint[0] = foodX;\n\t\tpoint[1] = foodY;\n\t\treturn point;\t\n\t}", "@Override\r\n\tpublic String getSpecies()\r\n\t{\r\n\t\treturn \"\";\r\n\t}", "public final void setSpeciesID(final int i) {\r\n\t\tthis.speciesID = i;\r\n\t}", "public void addNewSpecies(PokemonSpecies species) {\n pokedex.add(species);\n }", "public interface Species {\r\n\r\n\r\n\t/**\r\n\t * Calculate the amount that a species will spawn.\r\n\t */\r\n\tvoid calculateSpawnAmount();\r\n\r\n\t/**\r\n\t * Choose a worthy parent for mating.\r\n\t * \r\n\t * @return The parent genome.\r\n\t */\r\n\tGenome chooseParent();\r\n\r\n\t/**\r\n\t * @return The age of this species.\r\n\t */\r\n\tint getAge();\r\n\r\n\t/**\r\n\t * @return The best score for this species.\r\n\t */\r\n\tdouble getBestScore();\r\n\r\n\t/**\r\n\t * @return How many generations with no improvement.\r\n\t */\r\n\tint getGensNoImprovement();\r\n\r\n\t/**\r\n\t * @return Get the leader for this species. The leader is the genome with\r\n\t * the best score.\r\n\t */\r\n\tGenome getLeader();\r\n\r\n\t/**\r\n\t * @return The numbers of this species.\r\n\t */\r\n\tList<Genome> getMembers();\r\n\r\n\t/**\r\n\t * @return The number of genomes this species will try to spawn into the\r\n\t * next generation.\r\n\t */\r\n\tdouble getNumToSpawn();\r\n\r\n\t/**\r\n\t * @return The number of spawns this species requires.\r\n\t */\r\n\tdouble getSpawnsRequired();\r\n\r\n\t/**\r\n\t * @return The species ID.\r\n\t */\r\n\tlong getSpeciesID();\r\n\r\n\t/**\r\n\t * Purge old unsuccessful genomes.\r\n\t */\r\n\tvoid purge();\r\n\r\n\t/**\r\n\t * Set the age of this species.\r\n\t * @param age The age.\r\n\t */\r\n\tvoid setAge(int age);\r\n\r\n\t/**\r\n\t * Set the best score.\r\n\t * @param bestScore The best score.\r\n\t */\r\n\tvoid setBestScore(double bestScore);\r\n\r\n\t/**\r\n\t * Set the number of generations with no improvement.\r\n\t * @param gensNoImprovement The number of generations with\r\n\t * no improvement.\r\n\t */\r\n\tvoid setGensNoImprovement(int gensNoImprovement);\r\n\r\n\t/**\r\n\t * Set the leader of this species.\r\n\t * @param leader The leader of this species.\r\n\t */\r\n\tvoid setLeader(Genome leader);\r\n\r\n\t/**\r\n\t * Set the number of spawns required.\r\n\t * @param spawnsRequired The number of spawns required.\r\n\t */\r\n\tvoid setSpawnsRequired(double spawnsRequired);\r\n}", "public void reveal(GameState pState, int[] pSpecies, Deadline pDue) {\n for (int i = 0; i < pSpecies.length; i++) {\n if (pDue.remainingMs() < timeBreak)\n break;\n int birdType = pSpecies[i];\n if (birdType == Constants.SPECIES_UNKNOWN)\n continue;\n\n BirdModel bm = birdModelGuesses.get(birdType);\n Bird bird = pState.getBird(i);\n int[] obsSeq = getBirdSeqUntilDeath(bird);\n if (bm == null) {\n birdModelGuesses.put(birdType, new BirdModel(birdType));\n }\n birdModelGuesses.get(birdType).addSequence(obsSeq);\n// System.err.println(\"Bird \" + i + \" is of specie \" + pSpecies[i]);\n }\n\n\n //Räkna Baum welch\n for(BirdModel bm : birdModelGuesses.values()) {\n if (pDue.remainingMs() < timeBreak)\n break;\n int seqCount = bm.savedSequences.size();\n if (seqCount > 0) {\n// int[][] obsSeqs = bm.savedSequences.toArray(new int[seqCount][timePeriod]);\n\n BaumWelch bw = new BaumWelch(bm.model, bm.savedSequences);\n bw.run();\n// bm.emptySavedSequences();\n }\n }\n t=0;\n }", "public static Species[] loadSpeciesFile(String filename) {\n java.util.Scanner input = null;\n java.io.File inputFile = new java.io.File(filename);\n try {\n input = new java.util.Scanner(inputFile);\n } catch( java.io.FileNotFoundException e ) {\n System.err.println(\"Error: Unable to open file \" + filename);\n System.exit(1);\n }\n \n String current = \"\";\n if(input.hasNext())\n current = input.next();\n List<Species> speciesList = new ArrayList<Species>();\n while(input.hasNext()) {\n int count = 0;\n int i = 0;\n StringBuilder sequence = new StringBuilder();\n String speciesName = \"\";\n while(count < 6 && i < current.length() && current.substring(0,1).equals(\">\") ) {\n if(current.charAt(i) == '|')\n count++;\n if(count == 6 && !current.substring(i + 1).contains(\"|\")) {\n speciesName = current.substring(i + 1);\n }\n i++;\n }\n if(count == 6) {\n current = input.next();\n boolean next = true;\n while (next == true && !current.substring(0,1).equals(\">\")) {\n sequence.append(current);\n if(input.hasNext())\n current = input.next();\n else\n next = false;\n }\n String[] sequenceArray = new String[sequence.length()];\n for(int j = 0; j < sequence.length(); j++) {\n sequenceArray[j] = Character.toString(sequence.charAt(j));\n }\n Species currSpecies = new Species(speciesName, sequenceArray);\n speciesList.add(currSpecies);\n }\n else\n current = input.next();\n }\n Species[] arraySpecies = new Species[speciesList.size()];\n for (int i = 0; i < speciesList.size(); i++) {\n arraySpecies[i] = speciesList.get(i);\n }\n return arraySpecies;\n }", "public void handleGuess(String s) {\n\n if (!word.contains(s)) {\n incorrectGuesses++;\n wrongList.add(s);\n if (incorrectGuesses == 8) {\n gameOver();\n }\n } else {\n correctList.add(s);\n updateWord(s.charAt(0));\n }\n }", "private void fetchUnknownBirdsCodes(Session session) {\n QAQCMain.log.info(\"Getting the birds with unknown code\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.speciesCode, species.site.siteCode from Species as species \"\n + \"where not exists (from RefBirds as ref where ref.refBirdsCode like species.speciesCode) \"\n + \"and species.speciesGroup like 'B'\"\n + \"order by species.speciesCode ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n Object[] columnNames = {\"Site\", \"Birds Code\"};\n model.setColumnIdentifiers(columnNames);\n updateNumResults(i);\n }", "public static void reproduce (Species [][] map, int sheepHealth, int wolfHealth, int plantHealth) {\n \n // Place the baby\n int babyY, babyX;\n \n // Check if the baby has been placed\n int spawned = 0;\n \n for (int y = 0; y < map[0].length; y++){\n for (int x = 0; x < map.length; x++){\n \n boolean [][] breeding = breedChoice (map, x, y, plantHealth);\n \n // Sheep upwards to breed with\n if (breeding[0][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y-1][x]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep downwards to breed with\n } else if (breeding[1][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y+1][x]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep to the left to breed with\n } else if (breeding[2][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y][x-1]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep to the right to breed with\n } else if (breeding[3][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y][x+1]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Wolf upwards to breed with\n } else if (breeding[0][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y-1][x]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf downwards to breed with\n } else if (breeding[1][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y+1][x]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf to the left to breed with\n } else if (breeding[2][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y][x-1]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf to the right to breed with\n } else if (breeding[3][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y][x+1]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n }\n \n }\n }\n \n }", "private void doQualitativeSpecies(QualitativeModel qualModel)\n \t{\n \t\tfor (QualitativeSpecies qs : qualModel.getListOfQualitativeSpecies())\n \t\t{\n \t\t\t//\t\t\tPathwayElement pelt = createOrGetSpecies(qs.getId(), xco, yco, GlyphClazz.BIOLOGICAL_ACTIVITY);\n \t\t\tPathwayElement pelt = SbgnTemplates.createGlyph(GlyphClazz.BIOLOGICAL_ACTIVITY, pwy, xco, yco);\n \t\t\tpelt.setGraphId(qs.getId());\n \t\t\tpelt.setTextLabel(qs.getName());\n \n \t\t\tList<String> t = qs.filterCVTerms(CVTerm.Qualifier.BQB_IS, \"miriam\");\n \t\t\tif (t.size() > 0)\n \t\t\t{\n \t\t\t\tXref ref = Xref.fromUrn(t.get(0));\n \t\t\t\tif (ref == null)\n \t\t\t\t{\n \t\t\t\t\tSystem.out.println (\"WARNING: couldn't convert \" + t.get(0) + \" to Xref\");\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tpelt.setGeneID(ref.getId());\n \t\t\t\t\tpelt.setDataSource(ref.getDataSource());\n \t\t\t\t}\n \t\t\t}\n \n \t\t\tpwy.add(pelt);\n \n \t\t\tnextLocation();\n \t\t}\n \t}", "public void guess(){\n\t\tfor(int i=0;i<size;i++){\n\t\t\tfor(int j=0;j<size;j++){\n\t\t\t\tif(!boundary[i][j]){\n\t\t\t\t\tvalues[i][j]=100/(.05*i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}", "public void prepareForSpeciation() {\n\t\tfor (Species s : speciesList) {\r\n\t\t\ts.assignRep();\r\n\t\t}\r\n\r\n\t\t// clear the old species list\r\n\t\tfor (Species s : speciesList) {\r\n\t\t\ts.clearMembers();\r\n\t\t}\r\n\t}", "private static void loadSpeciesFromArray(ArrayList<String> items) {\n String genus = null;\n Long id = 0l;\n String name = null;\n //String breed = null;\n String plugKind = null;\n String[] socketLabels = new String[0];\n String[] socketKinds = new String[0];\n //boolean[] isSocketInlineProc = new boolean[0];\n //boolean areSocketsInlineProcs = false;\n \n //int plugType = -1;\n //ArgumentDescriptor[] defaultArgs = new ArgumentDescriptor[0];\n \n int i = 0;\n while (i < items.size()) {\n String item = items.get(i);\n \n if (item.equals(\"BlockSpecies\")) {\n name = items.get(i + 1);\n //System.out.println(\"loading species \" + name);\n i += 2;\n continue;\n }\n \n if (item.equals(\"genus\")) {\n genus = items.get(i + 1);\n i += 2;\n continue;\n }\n \n if (item.equals(\"breed\")) {\n //breed = items.get(i + 1);\n i += 2;\n continue;\n }\n \n if (item.equals(\"id\")) {\n String value = items.get(i + 1);\n id = Long.valueOf(value);\n i += 2;\n continue;\n }\n \n if (item.equals(\"plug-kind\")) {\n plugKind = items.get(i + 1);\n //TODO plugType = BlockGenus.getKindForKindName(value);\n i += 2;\n continue;\n }\n \n if (item.equals(\"sockets\")) {\n String value = items.get(i + 1);\n int numSockets = Integer.parseInt(value);\n i += 2;\n \n socketLabels = new String[numSockets];\n socketKinds = new String[numSockets];\n //isSocketInlineProc = new boolean[numSockets];\n //defaultArgs = new ArgumentDescriptor[numSockets];\n \n for (int currentSocket = 0;\n currentSocket < numSockets;\n currentSocket++) {\n \n String label = items.get(i);\n assert(label.equals(\"socket-label\"));\n socketLabels[currentSocket] = items.get(i + 1);\n \n label = items.get(i + 2);\n assert(label.equals(\"socket-kind\"));\n socketKinds[currentSocket] =\n items.get(i + 3);\n i += 4;\n \n if(i < items.size())\n {\n String nextToken = items.get(i);\n \n if(nextToken.equals(\"inline-proc\"))\n {\n //isSocketInlineProc[currentSocket] = true;\n //areSocketsInlineProcs = true;\n \n i++;\n }\n }\n }\n continue;\n }\n \n if (item.equals(\"default-arguments\")) {\n String value = items.get(i + 1);\n int numDefaultArgs = Integer.parseInt(value);\n i += 2;\n \n int currentSocket;\n for(currentSocket = 0; currentSocket < numDefaultArgs; currentSocket++)\n {\n String label = items.get(i);\n assert(label.equals(\"species-name\"));\n String argSpeciesName = items.get(i + 1);\n \n if (!argSpeciesName.equals(\"null\")) {\n\n label = items.get(i + 2);\n assert(label.equals(\"kind\"));\n /*TODO int argKind =\n BlockGenus.getKindForKindName(\n items.get(i + 3));*/\n \n label = items.get(i + 4);\n assert(label.equals(\"initial-text\"));\n// String argInitText = items.get(i + 5); // XXX not read\n i += 6;\n \n// String argInitCommand = argInitText;\n \n if((i < items.size()) && (items.get(i).equals(\"initial-command\")))\n {\n// argInitCommand = items.get(i + 1);\n i += 2;\n }\n \n /* TODO defaultArgs[currentSocket] =\n new ArgumentDescriptor(\n argSpeciesName,\n argKind,\n argInitText,\n argInitCommand);*/\n // if(name.equals(\"runforsometime\"))\n //System.out.println(name+\" def arg at \"+currentSocket+\" out of \"+numDefaultArgs+\" \" +defaultArgs[currentSocket].getSaveString());\n } else {\n i += 2;\n \n //TODO defaultArgs[currentSocket] = null;\n \n }\n }\n /*TODO for( ; currentSocket < socketNames.length; currentSocket++)\n defaultArgs[currentSocket] = null;*/\n \n continue;\n }\n \n if(item.equals(\"initial-label\"))\n {\n //don't care about initialLabel\n //stored in BlockGenus\n //initialLabel = items.get(i + 1);\n \n i += 2;\n \n continue;\n }\n \n if(item.equals(\"initial-command\"))\n {\n //don't care about initial command\n //stored in block genus\n //initialCommand = items.get(i + 1);\n \n i += 2;\n \n continue;\n }\n \n // skip the next if we haven't found anything we know\n i += 2;\n }\n \n assert(name != null);\n assert(genus != null);\n assert(id.longValue() >= 0l);\n \n \n speciesMap.put(id+name, new SpeciesData(name, plugKind, socketKinds, socketLabels));\n \n if(DEBUG)\n \tSystem.out.println(\"Loaded species: \"+id+\": \"+speciesMap.get(id+name));\n }", "public String getSpecies() {\n if(species == null)\n return \"\";\n return species;\n }", "public void changeOfSpecies(int iOldNumSpecies, int[] p_iIndexer,\n String[] p_sNewSpecies) throws ModelException {\n super.changeOfSpecies(iOldNumSpecies, p_iIndexer, p_sNewSpecies);\n\n ModelEnum oEnum;\n int iNumSpecies = p_sNewSpecies.length, i;\n\n //This is a change of species - add enums to any null spots\n for (i = 0; i < iNumSpecies; i++) {\n if (null == mp_iWhatAdultHDFunction.getValue().get(i)) {\n oEnum = new ModelEnum(new int[] {\n 2, 1, 0}, new String[] {\"Reverse Linear\",\n \"Linear\", \"Standard\"}, \"Function used\", \"\");\n oEnum.setValue(\"Standard\");\n mp_iWhatAdultHDFunction.getValue().remove(i);\n mp_iWhatAdultHDFunction.getValue().add(i, oEnum);\n }\n\n if (null == mp_iWhatSaplingHDFunction.getValue().get(i)) {\n oEnum = new ModelEnum(new int[] {3, 2, 1, 0}, \n new String[] {\"Power\", \"Reverse Linear\", \"Linear\", \"Standard\"},\n \"Function used\", \"\");\n oEnum.setValue(\"Standard\");\n mp_iWhatSaplingHDFunction.getValue().remove(i);\n mp_iWhatSaplingHDFunction.getValue().add(i, oEnum);\n }\n\n if (null == mp_iWhatSeedlingHDFunction.getValue().get(i)) {\n oEnum = new ModelEnum(new int[] {2, 1, 0}, \n new String[] {\"Reverse Linear\", \"Linear\", \"Standard\"},\n \"Function used\", \"\");\n oEnum.setValue(\"Standard\");\n mp_iWhatSeedlingHDFunction.getValue().remove(i);\n mp_iWhatSeedlingHDFunction.getValue().add(i, oEnum);\n }\n\n if (null == mp_iWhatAdultCRDFunction.getValue().get(i)) {\n oEnum = new ModelEnum(new int[] {3, 2, 1, 0}, \n new String[] {\"NCI\", \"Non-Spatial Density Dependent\", \n \"Chapman-Richards\", \"Standard\"}, \"Function used\", \"\");\n oEnum.setValue(\"Standard\");\n mp_iWhatAdultCRDFunction.getValue().remove(i);\n mp_iWhatAdultCRDFunction.getValue().add(i, oEnum);\n }\n\n if (null == mp_iWhatSaplingCRDFunction.getValue().get(i)) {\n oEnum = new ModelEnum(new int[] {3, 1, 0}, \n new String[] {\"NCI\", \"Chapman-Richards\", \"Standard\"}, \n \"Function used\", \"\");\n oEnum.setValue(\"Standard\");\n mp_iWhatSaplingCRDFunction.getValue().remove(i);\n mp_iWhatSaplingCRDFunction.getValue().add(i, oEnum);\n }\n\n if (null == mp_iWhatAdultCDHFunction.getValue().get(i)) {\n oEnum = new ModelEnum(new int[] {3, 2, 1, 0}, \n new String[] {\"NCI\", \"Non-Spatial Density Dependent\", \n \"Chapman-Richards\", \"Standard\"}, \"Function used\", \"\");\n oEnum.setValue(\"Standard\");\n mp_iWhatAdultCDHFunction.getValue().remove(i);\n mp_iWhatAdultCDHFunction.getValue().add(i, oEnum);\n }\n\n if (null == mp_iWhatSaplingCDHFunction.getValue().get(i)) {\n oEnum = new ModelEnum(new int[] {3, 1, 0}, \n new String[] {\"NCI\", \"Chapman-Richards\", \"Standard\"}, \n \"Function used\", \"\");\n oEnum.setValue(\"Standard\");\n mp_iWhatSaplingCDHFunction.getValue().remove(i);\n mp_iWhatSaplingCDHFunction.getValue().add(i, oEnum);\n }\n }\n \n //We already had lambdas. What we want to do is preserve any for species\n //that didn't change, because they may have values.\n\n //Create an array of the lambda arrays, placed in the new species\n //order\n ModelData[] p_oNCI = new ModelData[iNumSpecies];\n int iCode;\n\n for (i = 0; i < iNumSpecies; i++) {\n p_oNCI[i] = null;\n }\n\n //Get the existing lambdas and put them where they go in our arrays -\n //any for species that were removed will be left behind\n for (i = 0; i < mp_oAllData.size(); i++) {\n ModelData oData = mp_oAllData.get(i);\n String sKey = oData.getDescriptor().toLowerCase();\n if (sKey.indexOf(\"nci crown radius lambda\") > -1) {\n //Get the species\n String sSpecies;\n sKey = oData.getDescriptor();\n sSpecies = sKey.substring(28, sKey.indexOf(\" Neighbors\")).replace(' ', '_');\n iCode = -1;\n for (int iSp = 0; iSp < iNumSpecies; iSp++) {\n if (p_sNewSpecies[iSp].equals(sSpecies)) {\n iCode = iSp; break;\n }\n }\n //iCode = oPop.getSpeciesCodeFromName(sSpecies);\n if (iCode > -1) {\n p_oNCI[iCode] = oData;\n }\n }\n }\n\n //Now remove all lambdas from the required data and from all behaviors\n for (i = 0; i < mp_oAllData.size(); i++) {\n ModelData oData = mp_oAllData.get(i);\n String sKey = oData.getDescriptor().toLowerCase();\n if (sKey.indexOf(\"nci crown radius lambda\") > -1) {\n mp_oAllData.remove(i);\n i--;\n }\n }\n\n\n //Now add back the lambdas, creating new ones for any new species\n for (i = 0; i < p_oNCI.length; i++) {\n if (p_oNCI[i] == null) {\n String sSpName = p_sNewSpecies[i];\n p_oNCI[i] = new ModelVector(\"NCI Crown Radius Lambda for \"\n + sSpName.replace('_', ' ') + \" Neighbors\",\n \"tr_nciCR\" + sSpName + \"NeighborLambda\", \"tr_ncrlVal\",\n 0, ModelVector.FLOAT);\n }\n mp_oAllData.add(p_oNCI[i]);\n }\n \n \n //Create an array of the lambda arrays, placed in the new species\n //order\n \n for (i = 0; i < iNumSpecies; i++) {\n p_oNCI[i] = null;\n }\n\n //Get the existing lambdas and put them where they go in our arrays -\n //any for species that were removed will be left behind\n for (i = 0; i < mp_oAllData.size(); i++) {\n ModelData oData = mp_oAllData.get(i);\n String sKey = oData.getDescriptor().toLowerCase();\n if (sKey.indexOf(\"nci crown depth lambda\") > -1) {\n //get the species\n String sSpecies;\n sKey = oData.getDescriptor();\n sSpecies = sKey.substring(27, sKey.indexOf(\" Neighbors\")).replace(' ', '_');\n iCode = -1;\n for (int iSp = 0; iSp < iNumSpecies; iSp++) {\n if (p_sNewSpecies[iSp].equals(sSpecies)) {\n iCode = iSp; break;\n }\n }\n //iCode = oPop.getSpeciesCodeFromName(sSpecies);\n if (iCode > -1) {\n p_oNCI[iCode] = oData;\n }\n }\n }\n\n //Now remove all lambdas from the required data and from all behaviors\n for (i = 0; i < mp_oAllData.size(); i++) {\n ModelData oData = mp_oAllData.get(i);\n String sKey = oData.getDescriptor().toLowerCase();\n if (sKey.indexOf(\"nci crown depth lambda\") > -1) {\n mp_oAllData.remove(i);\n i--;\n }\n }\n\n\n //Now add back the lambdas, creating new ones for any new species\n for (i = 0; i < p_oNCI.length; i++) {\n if (p_oNCI[i] == null) {\n String sSpName = p_sNewSpecies[i];\n p_oNCI[i] = new ModelVector(\"NCI Crown Depth Lambda for \"\n + sSpName.replace('_', ' ') + \" Neighbors\",\n \"tr_nciCD\" + sSpName + \"NeighborLambda\", \"tr_ncdlVal\",\n 0, ModelVector.FLOAT);\n }\n mp_oAllData.add(p_oNCI[i]);\n }\n }", "private void LotsofGrasp()\n\t{\n\t\t\n\t\tArrayList<FirmlyGraspIt> myRuns = new ArrayList<FirmlyGraspIt>();\n\t\t\n\t\tArrayList<Integer> myNums = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\tFirmlyGraspIt sampleRun = new FirmlyGraspIt();\n\t\tFirmlyGraspIt otherRun = new FirmlyGraspIt();\n\t\t\n\t\tmyRuns.add(sampleRun);\n\t\tmyRuns.add(sampleRun);\n\t\tmyRuns.add(otherRun);\n\t\t\n\t\tfor (int index =0; index < myRuns.size(); index +=1)\n\t\t\t\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, myRuns.get(index).getName());\n\t\t\t\n\t\t\tFirmlyGraspIt currentRun = myRuns.get(index);\n\t\t\tJOptionPane.showMessageDialog(null, currentRun.getName());\n\t\t\tcurrentRun.setName(\"The new name is \" + index + \"run\");\n\t\t\tcurrentRun.setDistance(index * (int) (Math.random() * 300));\n\t\t\t\n\t\t}\n\t\t\n\t\t{\n\t\t\t\n\t\t}\n\t\n\t\t\n\t\tfor (int index = myRuns.size() - 1; index >= 0; index -= 1)\n\t\t{\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (FirmlyGraspIt current : myRuns)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, \"The run is named:\" + current.getName());\n\t\t}\n\t\t\n\t}", "public void infect() {\n\t\tPlagueAgent current = this;\n\t\tif (!current.infected) {\n\t\t\tfor (PlagueAgent a : plagueWorld.getNeighbors(current, 5)) {\n\t\t\t\tif (a.infected) {\n\t\t\t\t\tint luck = Utilities.rng.nextInt(100);\n\t\t\t\t\tif (luck < plagueWorld.VIRULENCE) {\n\t\t\t\t\t\tthis.infected = true;\n\t\t\t\t\t\tplagueWorld.newInfection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplagueWorld.changed();\n\t}", "public void setNamesForArray(){\n //check the vehicle random image to identify car brand\n if(randNum<=2){\n //Adding the letters of name to the namesArray\n namesArray.add(\"a\");\n namesArray.add(\"u\");\n namesArray.add(\"d\");\n namesArray.add(\"i\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<4; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=3 && randNum<=5){\n //Adding the letters of name to the namesArray\n namesArray.add(\"b\");\n namesArray.add(\"e\");\n namesArray.add(\"n\");\n namesArray.add(\"z\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<4; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=6 && randNum<=8){\n //Adding the letters of name to the namesArray\n namesArray.add(\"b\");\n namesArray.add(\"m\");\n namesArray.add(\"w\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<3; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=9 && randNum<=11){\n //Adding the letters of name to the namesArray\n namesArray.add(\"f\");\n namesArray.add(\"e\");\n namesArray.add(\"r\");\n namesArray.add(\"r\");\n namesArray.add(\"a\");\n namesArray.add(\"r\");\n namesArray.add(\"i\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<7; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=12 && randNum<=14){\n //Adding the letters of name to the namesArray\n namesArray.add(\"j\");\n namesArray.add(\"a\");\n namesArray.add(\"g\");\n namesArray.add(\"u\");\n namesArray.add(\"a\");\n namesArray.add(\"r\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<6; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=15 && randNum<=17){\n //Adding the letters of name to the namesArray\n namesArray.add(\"k\");\n namesArray.add(\"i\");\n namesArray.add(\"a\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<3; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=18 && randNum<=20){\n //Adding the letters of name to the namesArray\n namesArray.add(\"n\");\n namesArray.add(\"i\");\n namesArray.add(\"s\");\n namesArray.add(\"s\");\n namesArray.add(\"a\");\n namesArray.add(\"n\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<6; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=21 && randNum<=23){\n //Adding the letters of name to the namesArray\n namesArray.add(\"r\");\n namesArray.add(\"e\");\n namesArray.add(\"n\");\n namesArray.add(\"a\");\n namesArray.add(\"u\");\n namesArray.add(\"l\");\n namesArray.add(\"t\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<7; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=24 && randNum<=26){\n //Adding the letters of name to the namesArray\n namesArray.add(\"s\");\n namesArray.add(\"u\");\n namesArray.add(\"z\");\n namesArray.add(\"u\");\n namesArray.add(\"k\");\n namesArray.add(\"i\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<6; i++){\n dashesArray.add(\"-\");\n }\n\n }\n //check the vehicle random image to identify car brand\n else if (randNum>=27 && randNum<=29){\n //Adding the letters of name to the namesArray\n namesArray.add(\"t\");\n namesArray.add(\"o\");\n namesArray.add(\"y\");\n namesArray.add(\"o\");\n namesArray.add(\"t\");\n namesArray.add(\"a\");\n\n //Adding the same number of dashes as the name to the array\n for (int i=0; i<6; i++){\n dashesArray.add(\"-\");\n }\n }\n }", "@Override\n public ColorRow breakerGuess(int pegs, int colors) {\n if (turnBlacks.size() == 0 && turnWhites.size() == 0) {\n ColorRow initialGuess = breakerInitialGuess(pegs, colors);\n gameGuesses.add(initialGuess);\n return initialGuess;\n }\n int generation = 0;\n boolean feasibleNotFull = true;\n initPopulation(pegs, colors);\n calculateFitness();\n sortFeasibleByFitness(fitness, population);\n while (feasibleCodes.isEmpty()) {\n generation = 0;\n while (feasibleNotFull && generation <= GENERATION_SIZE) {\n evolvePopulation(pegs, colors);\n calculateFitness();\n sortFeasibleByFitness(fitness, population);\n feasibleNotFull = addToFeasibleCodes();\n generation += 1;\n }\n\n }\n ColorRow guess = feasibleCodes.get((int) (Math.random() * feasibleCodes.size()));\n gameGuesses.add(guess);\n return guess;\n }", "private Species getRandomSpeciesBaisedAdjustedFitness(Random random) {\r\n\t\tdouble completeWeight = 0.0;\r\n\t\tfor (Species s : species) {\r\n\t\t\tcompleteWeight += s.totalAdjustedFitness;\r\n\t\t}\r\n\t\tdouble r = Math.random() * completeWeight;\r\n\t\tdouble countWeight = 0.0;\r\n\t\tfor (Species s : species) {\r\n\t\t\tcountWeight += s.totalAdjustedFitness;\r\n\t\t\tif (countWeight >= r) {\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow new RuntimeException(\"Couldn't find a species... Number is species in total is \" + species.size()\r\n\t\t\t\t+ \", and the toatl adjusted fitness is \" + completeWeight);\r\n\t}", "public List<Species> getSpeciesList() {\n return speciesList;\n }", "public int InitVessels() {\n int[] vesselCheck = CircleHood(true, VESSEL_SPACING_MIN);\n int[] circleIs = new int[vesselCheck.length / 2];\n int[] ret= GenIndicesArray(length);\n Shuffle(ret, length, length, rn);\n int[] indices = ret;\n int nVesselsRequested = (int) (length / VESSEL_SPACING_MEAN*VESSEL_SPACING_MEAN);\n int nVesselsPlaced = 0;\n for (int i : indices) {\n int x=ItoX(i);\n int y=ItoY(i);\n //make sure that we aren't putting a vessel too close to the edge\n if(x>=VESSEL_EDGE_MAX_DIST&&y>=VESSEL_EDGE_MAX_DIST&&xDim-x>VESSEL_EDGE_MAX_DIST&&yDim-y>VESSEL_EDGE_MAX_DIST) {\n int nNeigbhors = HoodToOccupiedIs(vesselCheck, circleIs, ItoX(i), ItoY(i));\n for (int j = 0; j < nNeigbhors + 1; j++) {\n if (j == nNeigbhors) {\n MarkCell_II newVessel = NewAgentSQ(i);\n newVessel.InitVessel();\n nVesselsPlaced++;\n if (nVesselsPlaced == nVesselsRequested) {\n return nVesselsPlaced;\n }\n } else if (GetAgent(circleIs[j]).type == VESSEL) {\n break;\n }\n }\n }\n }\n return nVesselsPlaced;\n }", "public void rgs() {\n\t\tArrayList<int[]> front = this.unknown;\n\t\tRandom rand = new Random();\n\t\tint index = rand.nextInt(front.size());\n\t\tint loc[] = front.get(index);\n\t\tprobe(loc[0], loc[1]);\n\t\trgsCount++;\n\t\tSystem.out.println(\"RGS: probe[\" +loc[0] + \",\" + loc[1] + \"]\");\n\t\tshowMap();\n\t}", "public List<Plant> initPlantList(final FieldPlant species)\n {\n final List<Plant> plantList = new ArrayList<>();\n\n if( species == FieldPlant.MORE )\n {\n final int randomCount = new Random().nextInt(25) + 25;\n for( int i = 0; i < randomCount; i++ )\n {\n plantList.add(new More(new Random().nextFloat() * 70));\n }\n }\n else if( species == FieldPlant.WHEAT )\n {\n final int randomCount = new Random().nextInt(25) + 25;\n for( int i = 0; i < randomCount; i++ )\n {\n plantList.add(new Wheat(new Random().nextFloat() * 70));\n }\n }\n else\n {\n LOG.warn(\"unauthorized entry - no data passed on\");\n }\n\n return plantList;\n }", "public int getMySpeciesIdentifier() {\n return mySpeciesIdentifier;\n }", "@Override\n public Token[] generateGuessTokens() {\n Token[] guess = new Token[NUM_TOKENS];\n int len = Token.values().length;\n if (this.curToken < len) {\n Arrays.fill(guess, Token.values()[this.curToken]);\n } else {\n List<String> solList = new ArrayList<>(this.possibleSol);\n guess = this.readTokens(solList.get(this.curToken - len));\n this.curToken ++;\n }\n return guess;\n }", "@Override\r\n\tpublic Code nextGuess() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tRandom randGen = new Random();\r\n\t\tCode newCode;\r\n\t\t\r\n\t\tArrayList<String> values;\r\n\t\twhile(true)\r\n\t\t{values = new ArrayList<String>();\r\n\t\tfor (int i = 0; i < super.getNumVars(); i++)\r\n\t\t{\r\n\t\t\tint colorIndex = randGen.nextInt((super.getColorList().size()));\r\n\t\t\tvalues.add(super.getColorList().get(colorIndex));\r\n\t\t}\r\n\t\t\r\n\t\tnewCode = new Code(super.getNumVars());\r\n\t\t\r\n\t\tfor (int i = 0; i < values.size(); i++)\r\n\t\t{\r\n\t\t\tnewCode.addEntry(values.get(i));\r\n\t\t}\r\n\t\t//contains method for code\r\n\t\t\r\n\t\tboolean shouldBreak=true;//(guessHistory.size()==0?true:false);\r\n\t\tfor(int i=0,totalequal=0;i<guessHistory.size();++i,totalequal=0)\r\n\t\t{\r\n\t\t\tCode itrHistory=guessHistory.get(i);\r\n\t\t\tfor(int j=0;j<super.getNumVars();++j)\r\n\t\t\tif(newCode.colorAt(j).equals(itrHistory.colorAt(j)))\r\n\t\t\t\t\ttotalequal++;\r\n\t\t\t\t\r\n\t\t\tif(totalequal==super.getNumVars())\r\n\t\t\t\tshouldBreak=false;\r\n\t\t\t\r\n\t\t}\r\n\t\tif(shouldBreak)\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tguessHistory.add(newCode);\r\n\t\treturn newCode;\r\n\t}", "@Override\n public Answer getAnswer(Guess guess) {\n\n \tint row = guess.row;\n \tint col = guess.column;\n \tCoordinate enemyShot = world.new Coordinate();\n \tenemyShot.column = col;\n \tenemyShot.row = row;\n \t\n \t//store enemy's shot\n \tenemyShots.add(enemyShot);\n \tAnswer a = new Answer();\n\n \t//loop all ship locations and its coordinate, if enemy shot same as ship coordinate there is a hit \n \tfor (ShipLocation shipLocation: shipLocations) {\n \t\tfor (Coordinate coordinate: shipLocation.coordinates) {\n \t\t\tif (coordinate.row == row && coordinate.column == col) {\n \t\t\t\ta.isHit = true;\n \t\t\n \t\t\t\t//if enemy shots contain a whole ship coordinates, there is a ship sunk\n \t \t\tif (enemyShots.containsAll(shipLocation.coordinates)) {\n \t \t\t\ta.shipSunk = shipLocation.ship;\n \t \t\t}\n \t\t\t\t\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \t\n\n // dummy return\n return a;\n }", "@Override\n public Set<String> makeGuess(char guess) throws GuessAlreadyMadeException {\n\n for(String word : myDictionary) {\n ArrayList<Integer> indices = new ArrayList<>();\n for (int i = 0; i < word.length(); i++) {\n if(word.charAt(i) == guess) {\n indices.add(i);\n }\n }\n boolean matchFound = false;\n for (Map.Entry<Pattern, Set<String>> entry : myMap.entrySet()) {\n Pattern myPattern = entry.getKey();\n Set<String> myStrings = entry.getValue();\n if(indices.equals(myPattern.ReturnIndices())) {\n myStrings.add(word);\n //myNewDictionary.add(word);\n matchFound = true;\n }\n\n }\n if(matchFound == false) {\n Pattern myNewPattern = new Pattern(word.length(), word, indices);\n Set<String> myNewString = new HashSet<>();\n myNewString.add(word);\n //myNewDictionary.add(word);\n myMap.put(myNewPattern, myNewString);\n }\n\n }\n this.myDictionary = RunEvilAlgorithm();\n this.myMap = new HashMap<>();\n //make a function to run evil algorithm\n return myDictionary;\n }", "public int getSpeciesAmount() {\r\n\t\treturn species.size();\r\n\t}", "@Override\n public String setChosenHorse(int i) {\n chosenHorse = mounts.get(i - 1);\n return chosenHorse.getName();\n }", "private void fetchUnknownOSpeciesCodes(Session session) {\n QAQCMain.log.info(\"Getting sites with other species with unknown code\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.otherSpeciesCode, species.site.siteCode from OtherSpecies as species \"\n + \"where not exists (from RefSpecies as ref where ref.refSpeciesCode like species.otherSpeciesCode) \"\n + \"and species.otherSpeciesGroup not like 'B'\"\n + \"order by species.otherSpeciesCode ASC\";\n Query q = session.createQuery(hql);\n\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n\n Object[] columnNames = {\"Site\", \"Other Species Code\"};\n model.setColumnIdentifiers(columnNames);\n\n updateNumResults(i);\n\n }", "public int getNumberOfAnimalSpecies() {\n\t\treturn numberOfAnimalSpecies;\n\t}", "private void setupDefaultHarbourMap() {\n defaultHarbourMap.put(getHashCodeofPair(-3,-11), HarbourKind.SPECIAL_BRICK);\n defaultHarbourMap.put(getHashCodeofPair(-2,-10), HarbourKind.SPECIAL_BRICK);\n defaultHarbourMap.put(getHashCodeofPair(0,-10), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(1,-11), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(2,-10), HarbourKind.SPECIAL_ORE);\n defaultHarbourMap.put(getHashCodeofPair(2,-8), HarbourKind.SPECIAL_ORE);\n defaultHarbourMap.put(getHashCodeofPair(-5,-7), HarbourKind.SPECIAL_WOOD);\n defaultHarbourMap.put(getHashCodeofPair(-4,-8), HarbourKind.SPECIAL_WOOD);\n defaultHarbourMap.put(getHashCodeofPair(-5,-5), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(-4,-4), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(3,-5), HarbourKind.SPECIAL_GRAIN);\n defaultHarbourMap.put(getHashCodeofPair(4,-4), HarbourKind.SPECIAL_GRAIN);\n defaultHarbourMap.put(getHashCodeofPair(-2,2), HarbourKind.SPECIAL_WOOL);\n defaultHarbourMap.put(getHashCodeofPair(-1,1), HarbourKind.SPECIAL_WOOL);\n defaultHarbourMap.put(getHashCodeofPair(1,1), HarbourKind.GENERIC);\n defaultHarbourMap.put(getHashCodeofPair(2,2), HarbourKind.GENERIC);\n }", "public void infect()\n\t{\n\t\t//\tuse a traditional for loop here\n\t\tint maxHuman = humans.size();\n\t\tfor( int i=0; i<maxHuman; i++ )\n\t\t{\n\t\t\tif( humans.get(i).getInfect() )\n\t\t\t{\n\t\t\t\t//\tadd a zombie\n\t\t\t\tzombies.add( new Zombie(humans.get(i).x,humans.get(i).y,humans.get(i).facing,dp,humans.get(i).type));\n\t\t\t\thumans.remove(i);\n\n\t\t\t\t//\thandle indexes correctly to avoid a fault\n\t\t\t\tmaxHuman--;\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t}", "public static void eatApple(int i) {\r\n\t\tstate = MOVE;\r\n\t\tscore++;\r\n\r\n\t\tsnake.addLast(lastTail);\r\n\r\n\t\tfood.remove(i);\r\n\t\twhile (true) {\r\n\t\t\tint x = r.nextInt(ROWS);\r\n\t\t\tint y = r.nextInt(COLUMNS);\r\n\r\n\t\t\tif (field[x][y] == EMPTY) {\r\n\t\t\t\tfood.add(new int[] { APPLE, x, y });\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public final void mT__61() throws RecognitionException {\n try {\n int _type = T__61;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalSpeADL.g:59:7: ( 'species' )\n // InternalSpeADL.g:59:9: 'species'\n {\n match(\"species\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public int guess(int i) {\n return 1;\n }", "public static int make_guess(int hits, int strikes) {\n int myguess = 1000;\n\n /*\n * IMPLEMENT YOUR GUESS STRATEGY HERE\n */\n\n //First guess is always 1122, which is suggested by Donald Knuth in Mastermind(4,6)\n if (isFirstGuess){\n isFirstGuess = false;\n myguess = 1122; //Initial guess recommended by Donald Knuth\n SOLVER.setGuess(new Code(1122, true));\n } else {\n Response response = new Response(strikes, hits);\n SOLVER.processResponse(response);\n Code guess = SOLVER.guess();\n myguess = guess.getCode();\n }\n\n return myguess;\n }", "public static void main(String[] args) {\n System.out.println(\"Implementation 1: Using arrays\");\n Bird[] birds = new Bird[6]; // new empty Bird[]\n\n for(int i = 0; i < birds.length; i++) {\n // Code to randomly fill birds[i] with either a BlackBird or an Emu\n // This will produce a random number of type double between 0 and 1,\n // then it will round it to the nearest value and cast it to an integer value.\n int randomNumber = (int) Math.round(Math.random());\n // Value 0 for BlackBirds\n if (randomNumber == 0) {\n birds[i] = new BlackBird();\n } else { // Value 1 for Emus\n birds[i] = new Emu();\n }\n // Call to the sings() method of the superclass\n System.out.println(birds[i].getName() + \" can sing?: \" + birds[i].sings());\n // A polymorphic call to the sing() method\n birds[i].sing();\n if (birds[i] instanceof FlyingBird) {\n // Downcast a Bird object to a FlyingBird object\n System.out.println(birds[i].getName() + \" can fly?: \" + ((FlyingBird) birds[i]).flys());\n }\n }\n\n /** Implementation 2: Using any List implementation for the Bird instances\n * Note: Only code repeated here for simplicity of the implementation\n * (don't need to create additional methods for the main class) */\n System.out.println(\"--------------------------------------\");\n System.out.println(\"Implementation 2: Using List implementation\");\n\n List<Bird> birdsList = new ArrayList<Bird>();\n // Code to randomly fill birdsList with either a BlackBird or an Emu\n int aRandomNumber = (int) Math.round(Math.random());\n // Value 0 for BlackBirds\n if (aRandomNumber == 0) {\n birdsList.add(new BlackBird());\n } else { // Value 1 for Emus\n birdsList.add(new Emu());\n }\n for (Bird bird : birdsList) {\n // Call to the sings() method of the superclass\n System.out.println(bird.getName() + \" can sing?: \" + bird.sings());\n // A polymorphic call to the sing() method\n bird.sing();\n if (bird instanceof FlyingBird) {\n // Downcast a Bird object to a FlyingBird object\n System.out.println(bird.getName() + \" can fly?: \" + ((FlyingBird) bird).flys());\n }\n }\n }", "public void initializeGame() {\n speed = 75;\n ticks = 0;\n ticksTubes = 0;\n best = null;\n score = 0;\n\n //Make a new pool of birds based on the parameters set in the species'\n //genomes\n birds.clear();\n for (final Species species : Pool.species)\n for (final Genome genome : species.genomes) {\n genome.generateNetwork();\n birds.add(new Bird(species, genome));\n }\n tubes.clear();\n }", "private int[][] replaceLowestFitness(int[][] population, ArrayList<int[]> replacers) {\n\t\tfloat[] fitnesses = new float[population.length];\n\t\tfor (int i = 0; i < population.length; i++) {\n\t\t\tfitnesses[i] = getFitness(population[i]);\n\t\t}\n\n\t\t//find worst chromosomes around\n\t\tArrayList<Integer> worstFitnessesIndexes = new ArrayList<Integer>();\n\t\tfloat[] fitnessesSorted = fitnesses.clone();\n\t\tArrays.sort(fitnessesSorted);\n\t\tfor (int i = 0; i < population.length; i++) {\n\t\t\tfor (int j = 0; j < replacers.size() + 1; j++) {\n\t\t\t\tif (fitnesses[i] <= fitnessesSorted[j]) {\n\t\t\t\t\tworstFitnessesIndexes.add(new Integer(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (worstFitnessesIndexes.size() > replacers.size() + 1) //only find as many bad chromosomes as we have replacements\n\t\t\t\tbreak;\n\t\t}\n\n\t\tfor (int i = 0; i < replacers.size(); i++) {\n\t\t\tint[] replacer = replacers.get(i);\n\t\t\tpopulation[worstFitnessesIndexes.get(i)] = replacer; //replace worst fitnesses with replacements\n\t\t}\n\n\t\tpopulation[worstFitnessesIndexes.get(replacers.size())] = eliteChromosome; //make sure elite stays\n\t\treturn population;\n\t}", "public void clearSpecies() {\n // Override in proxy if lazily loaded; otherwise does nothing\n }", "public void setSpeciesList(@NonNull final List<Species> speciesList) {\n this.speciesList = speciesList;\n }", "private void findSuits(){\r\n //index keeps track of temp index location in iteration\r\n int index = 0;\r\n\r\n //temp will hold the new array\r\n char[] temp = new char[5];\r\n\r\n //for loop checks handstr for the different suits and if they are there puts them into array\r\n for (int i = 0; i < handStr.length(); i++){\r\n\r\n if(handStr.charAt(i) == 'C' || handStr.charAt(i) == 'D'\r\n || handStr.charAt(i) == 'S' || handStr.charAt(i) == 'H'){\r\n temp[index] = handStr.charAt(i);\r\n index++;\r\n }\r\n }\r\n\r\n setSuitArr(temp);\r\n\r\n }", "public static void main(String[] args) {\n ArrayList<Bird> birds = new ArrayList<>();\n Scanner scan = new Scanner(System.in);\n \n while (true){\n System.out.print(\"? \");\n String input = scan.nextLine();\n \n if (input.equals(\"Add\")){\n System.out.print(\"Name: \");\n String inputName = scan.nextLine();\n System.out.print(\"Name in Latin: \");\n String inputNameLat = scan.nextLine();\n Bird bird = new Bird(inputName, inputNameLat);\n birds.add(bird);\n }\n \n if (input.equals(\"Observation\")){\n System.out.print(\"Bird? \");\n String inputBird = scan.nextLine();\n int contained = 0;\n \n for (int j = 0; j<birds.size(); j++){\n if (birds.get(j).getName().equals(inputBird)){\n contained = 1;\n }\n }\n \n if (contained == 1){\n for (int i = 0; i<birds.size(); i++){\n if (birds.get(i).getName().equals(inputBird)){\n birds.get(i).counter(1);\n } \n }\n } else {\n System.out.println(\"Not a bird!\");\n } \n }\n \n if (input.equals(\"All\")){\n for (int i = 0; i<birds.size();i++){\n System.out.println(birds.get(i).getName()+\" (\"+birds.get(i).getNameLat()+\"): \"+birds.get(i).getCount()+\" observations\");\n } \n }\n \n if (input.equals(\"One\")){\n System.out.print(\"Bird? \");\n String one = scan.nextLine();\n for (int i = 0; i<birds.size(); i++){\n if (birds.get(i).getName().equals(one)){\n System.out.println(birds.get(i).getName()+\" (\"+birds.get(i).getNameLat()+\"): \"+birds.get(i).getCount()+\" observations\");\n }\n }\n }\n \n if (input.equals(\"Quit\")){\n break;\n }\n\n }\n }", "Species getSpeciesById(int index);", "private void InitializeHumanHand(){\n for(int i = 0; i < 7; i++){\n //Add to the human hand\n handHuman.add(deck.get(i));\n }\n\n for(int i = 6; i >= 0; i--){\n deck.remove(i);\n }\n\n /*\n System.out.println(\"HUMAN\");\n for(int i = 0; i < handHuman.size(); i++){\n System.out.println(handHuman.get(i));\n }\n\n System.out.println(\"DECK AFTER REMOVE\");\n for(int i = 0; i < deck.size(); i++){\n System.out.println(deck.get(i));\n }\n */\n }", "public static String getSpeciesInfo(TreeList list, String species){\n\t\t// create and new string that will act as header that lets the user know that \n\t\t// the program will display the popularity of the tree species in the city\n\t\tString info= \"Popularity in the city:\\n\";\n\t\tString equals= \":\";\n\t\t\n\t\t// create an array to hold all the boroughs in NYC\n\t\tString[] boroArray= {\"NYC\",\"Manhattan\",\"Bronx\",\"Brooklyn\",\"Queens\",\"Staten Island\"};\n\t\t\n\t\t// iterate through the array to obtain which borough the appropriate information\n\t\t// needs to be gathered for\n\t\tfor (int x=0; x<boroArray.length;x++){\n\t\t\tString boro= boroArray[x];\n\t\t\t// if boro equals NYC create a formatted string that includes the getTotalNumberOfTrees() method\n\t\t\t// to the info string. If not, create a similar formatted string for the boroughs instead\n\t\t\tif (boro.equals(\"NYC\")){\n\t\t\t\t// create an integer variable that represents the number of the \n\t\t\t\t// particular tree species that grows in NYC\n\t\t\t\tint treesInCity = 0;\n\t\t\t\t\n\t\t\t\t// create a loop to search through each borough and add the number of the particular\n\t\t\t\t// tree species that appears in every borough to treesInCity\n\t\t\t\tfor (int i=1; i<boroArray.length;i++){\n\t\t\t\t\ttreesInCity+=list.getCountByTreeSpeciesBorough(species,boroArray[i]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// create an integer variable that represents the total number of trees in NYC\n\t\t\t\tint totalTreesInCity = list.getTotalNumberOfTrees();\n\t\t\t\t\n\t\t\t\t// create an integer variable that represents the percent amount of that species in NYC.\n\t\t\t\t// send treesInCity and totalTreesInCity to the calculatePercent method to find the percent amount\n\t\t\t\t// of a particular tree species in NYC\n\t\t\t\tfloat percentOfSpecies = calculatePercent(treesInCity,totalTreesInCity);\n\t\t\t\t\n\t\t\t\t// add NYC to the info string\n\t\t\t\tinfo+=String.format(\"\\t%s%12s\",boro,equals);\n\t\t\t\t\n\t\t\t\t// create a formatted string to add to info that contains all the information\n\t\t\t\tString treeInfo= String.format(\"%,d(%,d)\", treesInCity,totalTreesInCity);\n\t\t\t\tinfo+=String.format(\"%18s\\t%6.2f\",treeInfo,percentOfSpecies);\n\t\t\t\tinfo+=\"%\\n\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// create an integer variable that represents the number of the particular tree species that grows in the borough\n\t\t\t\tint treesInBoro = list.getCountByTreeSpeciesBorough(species,boro);\n\t\t\t\t\n\t\t\t\t// create an integer variable that represents the total number of trees in the borough\n\t\t\t\tint totalTreesInBoro = list.getCountByBorough(boro);\n\t\t\t\t\n\t\t\t\t// create an integer variable that represents the percent amount of that species in the borough\n\t\t\t\tfloat percentOfSpecies;\n\t\t\t\t\n\t\t\t\t// if the trees in the borough is 0 as well as the total trees, set percentOfSpecies\n\t\t\t\t// equal to 0\n\t\t\t\tif (treesInBoro==0&&totalTreesInBoro==0){\n\t\t\t\t\tpercentOfSpecies=0;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t// create an integer variable that represents the percent amount of that species in the borough.\n\t\t\t\t\t// send treesInBoro and totalTreesInBoro to the calculatePercent method to find the percent amount\n\t\t\t\t\t// of a particular tree species in the borough\n\t\t\t\t\tpercentOfSpecies = calculatePercent(treesInBoro,totalTreesInBoro);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// format the info string\n\t\t\t\tif (boro.equalsIgnoreCase(\"manhattan\")){\n\t\t\t\t\tinfo+=String.format(\"\\t%s%6s\",boro,equals);\n\t\t\t\t}\n\t\t\t\telse if (boro.equalsIgnoreCase(\"bronx\")){\n\t\t\t\t\tinfo+=String.format(\"\\t%s%10s\",boro,equals);\n\t\t\t\t}\n\t\t\t\telse if (boro.equalsIgnoreCase(\"brooklyn\")){\n\t\t\t\t\tinfo+=String.format(\"\\t%s%7s\",boro,equals);\n\t\t\t\t}\n\t\t\t\telse if (boro.equalsIgnoreCase(\"queens\")){\n\t\t\t\t\tinfo+=String.format(\"\\t%s%9s\",boro,equals);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tinfo+=String.format(\"\\t%s%2s\",boro,equals);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// create a formatted string to add to info that contains all the information\n\t\t\t\tString treeInfo= String.format(\"%,d(%,d)\", treesInBoro,totalTreesInBoro);\n\t\t\t\tinfo+=String.format(\"%18s\\t%6.2f\",treeInfo, percentOfSpecies);\n\t\t\t\tinfo+=\"%\\n\";\n\t\t\t}\n\n\t\t}\n\t\t// return the formatted info string\n\t\treturn info;\n\t}", "public static void guessWords(String guess) {\n String newEmptyString = \"\";\n for (int i = 0; i < CategorySelector.word.length(); i++) { // Grabbing word\n if (CategorySelector.word.charAt(i) == guess.charAt(0)) {\n newEmptyString += guess.charAt(0);\n } else if (emptyString.charAt(i) != '_') {\n newEmptyString += CategorySelector.word.charAt(i);\n } else {\n newEmptyString += \"_\";\n }\n }\n\n if (emptyString.equals(newEmptyString)) {\n count++;\n paintHangman();\n } else {\n emptyString = newEmptyString;\n }\n if (emptyString.equals(CategorySelector.word)) {\n System.out.println(\"Correct! You win! The word was \" + CategorySelector.word);\n }\n }", "public void printGuess() {\r\n\t\t//Regular for loop because I still have a hard time with for each loops :/\r\n\t\tfor(int x = 0; x < movieGuess.length; x++) {\r\n\t\t\tSystem.out.print(movieGuess[x] + \" \");\t\t\r\n\t\t\t}\r\n\t\tSystem.out.println(\"\\n\");\r\n\t}", "public void addAllJugglersToFirstCircuitChoice() {\n for (int currentJuggler = 0; currentJuggler < jugglers.size(); currentJuggler++) { // For each juggler who needs to be added to a circuit...\n int currentJugglerMostDesiredCircuitIndex = jugglers.get(currentJuggler).getDesiredCircuits().get(0);\n Circuit currentJugglerMostDesiredCircuit = circuits.get(currentJugglerMostDesiredCircuitIndex);\n currentJugglerMostDesiredCircuit // Get the current juggler's most desired circuit...\n .getJugglersInCircuit().add(currentJuggler); //... and add this juggler's number to the circuit\n\n // If we now have too many jugglers in the circuit:\n // 1) Identify the least-suitable juggler in this circuit (using dot-product)\n // 2) Remove him from this circuit\n // 3) Find his next-most-preferred circuit and put him in there\n // , remove the one least suited for this circuit and put him in his next-desired\n if (currentJugglerMostDesiredCircuit.getJugglersInCircuit().size() > MAX_JUGGLERS_PER_CIRCUIT) {\n int worstJugglerInCircuitNumber = currentJuggler; // This number corresponds to the juggler who is going to be kicked out of this circuit. Defaults to the juggler who just got in, because he has to prove himself first!\n // Check each juggler. If they are worse than the new juggler, they become the \"worst juggler in the circuit\", and will be kicked out.\n for (Integer jugglerNumber : currentJugglerMostDesiredCircuit.getJugglersInCircuit()) {\n if (jugglers.get(jugglerNumber).getDotProduct(currentJugglerMostDesiredCircuit) < jugglers.get(worstJugglerInCircuitNumber).getDotProduct(currentJugglerMostDesiredCircuit)) {\n worstJugglerInCircuitNumber = jugglerNumber;\n }\n }\n kickToLowerDesiredCircuit(worstJugglerInCircuitNumber, currentJugglerMostDesiredCircuitIndex); // Kicks this juggler from this circuit to his next one\n }\n }\n }", "public void testChangeOfSpecies() {\n GUIManager oManager = null;\n String sFileName = null;\n try {\n oManager = new GUIManager(null);\n sFileName = writeValidXMLFile();\n oManager.inputXMLParameterFile(sFileName);\n \n //Now change the species\n String[] sNewSpecies = new String[] {\n \"Species 3\",\n \"Species 2\",\n \"Species 1\",\n \"Species 4\",\n \"Species 5\",\n \"Species 6\"};\n \n oManager.getTreePopulation().setSpeciesNames(sNewSpecies);\n ManagementBehaviors oManagementBeh = oManager.getManagementBehaviors();\n ArrayList<Behavior> p_oBehs = oManagementBeh.getBehaviorByParameterFileTag(\"QualityVigorClassifier\");\n assertEquals(1, p_oBehs.size());\n QualityVigorClassifier oQual = (QualityVigorClassifier) p_oBehs.get(0);\n \n assertEquals(3, oQual.mp_oQualityVigorSizeClasses.size());\n \n QualityVigorSizeClass oClass = oQual.mp_oQualityVigorSizeClasses.get(0);\n assertEquals(10, oClass.m_fMinDbh, 0.0001);\n assertEquals(20, oClass.m_fMaxDbh, 0.0001);\n \n assertEquals(0.78, ((Float)oClass.mp_fProbVigorous.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.88, ((Float)oClass.mp_fProbVigorous.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oClass.mp_fProbVigorous.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.61, ((Float)oClass.mp_fProbVigorous.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.33, ((Float)oClass.mp_fProbSawlog.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.64, ((Float)oClass.mp_fProbSawlog.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(1, ((Float)oClass.mp_fProbSawlog.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.55, ((Float)oClass.mp_fProbSawlog.getValue().get(4)).floatValue(), 0.0001);\n \n \n oClass = oQual.mp_oQualityVigorSizeClasses.get(1);\n assertEquals(20, oClass.m_fMinDbh, 0.0001);\n assertEquals(30, oClass.m_fMaxDbh, 0.0001);\n \n assertEquals(0.33, ((Float)oClass.mp_fProbVigorous.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.81, ((Float)oClass.mp_fProbVigorous.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.64, ((Float)oClass.mp_fProbVigorous.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.32, ((Float)oClass.mp_fProbVigorous.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.32, ((Float)oClass.mp_fProbSawlog.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.69, ((Float)oClass.mp_fProbSawlog.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.33, ((Float)oClass.mp_fProbSawlog.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.58, ((Float)oClass.mp_fProbSawlog.getValue().get(4)).floatValue(), 0.0001);\n \n \n oClass = oQual.mp_oQualityVigorSizeClasses.get(2);\n assertEquals(30, oClass.m_fMinDbh, 0.0001);\n assertEquals(40, oClass.m_fMaxDbh, 0.0001);\n \n assertEquals(0.34, ((Float)oClass.mp_fProbVigorous.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.57, ((Float)oClass.mp_fProbVigorous.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.26, ((Float)oClass.mp_fProbVigorous.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.46, ((Float)oClass.mp_fProbVigorous.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.13, ((Float)oClass.mp_fProbSawlog.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.36, ((Float)oClass.mp_fProbSawlog.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.66, ((Float)oClass.mp_fProbSawlog.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.45, ((Float)oClass.mp_fProbSawlog.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.1, ((Float)oQual.mp_fQualVigorBeta0Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oQual.mp_fQualVigorBeta0Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.3, ((Float)oQual.mp_fQualVigorBeta0Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.4, ((Float)oQual.mp_fQualVigorBeta0Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.2, ((Float)oQual.mp_fQualVigorBeta11Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(2.35, ((Float)oQual.mp_fQualVigorBeta11Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.1, ((Float)oQual.mp_fQualVigorBeta11Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(2.43, ((Float)oQual.mp_fQualVigorBeta11Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(-2.3, ((Float)oQual.mp_fQualVigorBeta12Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(1.12, ((Float)oQual.mp_fQualVigorBeta12Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.32, ((Float)oQual.mp_fQualVigorBeta12Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(1.3, ((Float)oQual.mp_fQualVigorBeta12Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.13, ((Float)oQual.mp_fQualVigorBeta13Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(1, ((Float)oQual.mp_fQualVigorBeta13Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(-0.2, ((Float)oQual.mp_fQualVigorBeta13Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(1, ((Float)oQual.mp_fQualVigorBeta13Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.9, ((Float)oQual.mp_fQualVigorBeta14Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oQual.mp_fQualVigorBeta14Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(-1, ((Float)oQual.mp_fQualVigorBeta14Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oQual.mp_fQualVigorBeta14Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(1, ((Float)oQual.mp_fQualVigorBeta15Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.25, ((Float)oQual.mp_fQualVigorBeta15Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(1, ((Float)oQual.mp_fQualVigorBeta15Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(-0.45, ((Float)oQual.mp_fQualVigorBeta15Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(1, ((Float)oQual.mp_fQualVigorBeta16Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.36, ((Float)oQual.mp_fQualVigorBeta16Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oQual.mp_fQualVigorBeta16Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.46, ((Float)oQual.mp_fQualVigorBeta16Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.01, ((Float)oQual.mp_fQualVigorBeta2Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.02, ((Float)oQual.mp_fQualVigorBeta2Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.04, ((Float)oQual.mp_fQualVigorBeta2Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.1, ((Float)oQual.mp_fQualVigorBeta2Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.001, ((Float)oQual.mp_fQualVigorBeta3Vig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.2, ((Float)oQual.mp_fQualVigorBeta3Vig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.3, ((Float)oQual.mp_fQualVigorBeta3Vig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.4, ((Float)oQual.mp_fQualVigorBeta3Vig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.25, ((Float)oQual.mp_fQualVigorBeta0Qual.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(1.13, ((Float)oQual.mp_fQualVigorBeta0Qual.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oQual.mp_fQualVigorBeta0Qual.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(1.15, ((Float)oQual.mp_fQualVigorBeta0Qual.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.36, ((Float)oQual.mp_fQualVigorBeta11Qual.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oQual.mp_fQualVigorBeta11Qual.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.4, ((Float)oQual.mp_fQualVigorBeta11Qual.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oQual.mp_fQualVigorBeta11Qual.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.02, ((Float)oQual.mp_fQualVigorBeta12Qual.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(10, ((Float)oQual.mp_fQualVigorBeta12Qual.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.3, ((Float)oQual.mp_fQualVigorBeta12Qual.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(30, ((Float)oQual.mp_fQualVigorBeta12Qual.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.2, ((Float)oQual.mp_fQualVigorBeta13Qual.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(10, ((Float)oQual.mp_fQualVigorBeta13Qual.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(-0.3, ((Float)oQual.mp_fQualVigorBeta13Qual.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(30, ((Float)oQual.mp_fQualVigorBeta13Qual.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(-0.2, ((Float)oQual.mp_fQualVigorBeta14Qual.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(10, ((Float)oQual.mp_fQualVigorBeta14Qual.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(-0.4, ((Float)oQual.mp_fQualVigorBeta14Qual.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(30, ((Float)oQual.mp_fQualVigorBeta14Qual.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(-0.2, ((Float)oQual.mp_fQualVigorBeta2Qual.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(10, ((Float)oQual.mp_fQualVigorBeta2Qual.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0, ((Float)oQual.mp_fQualVigorBeta2Qual.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(30, ((Float)oQual.mp_fQualVigorBeta2Qual.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(1, ((Float)oQual.mp_fQualVigorBeta3Qual.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(10, ((Float)oQual.mp_fQualVigorBeta3Qual.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.1, ((Float)oQual.mp_fQualVigorBeta3Qual.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(30, ((Float)oQual.mp_fQualVigorBeta3Qual.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.1, ((Float)oQual.mp_fQualVigorProbNewAdultsVig.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.25, ((Float)oQual.mp_fQualVigorProbNewAdultsVig.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.5, ((Float)oQual.mp_fQualVigorProbNewAdultsVig.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.74, ((Float)oQual.mp_fQualVigorProbNewAdultsVig.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(0.9, ((Float)oQual.mp_fQualVigorProbNewAdultsQual.getValue().get(1)).floatValue(), 0.0001);\n assertEquals(0.25, ((Float)oQual.mp_fQualVigorProbNewAdultsQual.getValue().get(0)).floatValue(), 0.0001);\n assertEquals(0.3, ((Float)oQual.mp_fQualVigorProbNewAdultsQual.getValue().get(3)).floatValue(), 0.0001);\n assertEquals(0.74, ((Float)oQual.mp_fQualVigorProbNewAdultsQual.getValue().get(4)).floatValue(), 0.0001);\n \n assertEquals(6, oQual.mp_iQualVigorDeciduous.getValue().size());\n for (int i = 0; i < oQual.mp_iQualVigorDeciduous.getValue().size(); i++)\n assertNotNull(oQual.mp_iQualVigorDeciduous.getValue().get(i));\n assertEquals(1, ((ModelEnum)oQual.mp_iQualVigorDeciduous.getValue().get(1)).getValue());\n assertEquals(0, ((ModelEnum)oQual.mp_iQualVigorDeciduous.getValue().get(0)).getValue());\n assertEquals(1, ((ModelEnum)oQual.mp_iQualVigorDeciduous.getValue().get(3)).getValue());\n assertEquals(0, ((ModelEnum)oQual.mp_iQualVigorDeciduous.getValue().get(4)).getValue());\n\n System.out.println(\"Change of species test succeeded.\");\n }\n catch (ModelException oErr) {\n fail(\"Change of species test failed with message \" + oErr.getMessage());\n }\n catch (java.io.IOException oE) {\n fail(\"Caught IOException. Message: \" + oE.getMessage());\n }\n finally {\n new File(sFileName).delete();\n }\n }", "public static void userGuess() {\n\t\tSystem.out.println(\"It's time for you to guess. \");\n\t\tSystem.out.print(\"The computer will pick 4 numbers, each from 1 to 6: (\");\n\n\t\t// prints out all color options\n\t\tprintColor();\n\t\tSystem.out.println(\"You will try to guess what that exact sequence is in 12 tries, good luck!\");\n\t\tSystem.out.println(\"If you want to give up, enter 'quit' or 'exit'\");\n\t\tSystem.out.println(\"If you need a hint, enter 'hint'\");\n\t\tSystem.out.println(\"If you want some statistics, enter 'stats'\");\n\n\t\t// have computer pick random sequence\n\t\tRandom random = new Random();\n\t\tfor (int i = 0; i < NUM_COLOR_ROUND; i++) {\n\t\t\tcomputerCode[i] = random.nextInt(colors.length) + 1;\n\t\t}\n\n\t\t// scanner to input user data\n\t\ttry (Scanner scanner = new Scanner(System.in)) {\n\t\t\t// allows the user to input 12 guesses\n\t\t\twhile (totalGuess < MAX_GUESS) {\n\t\t\t\t// if you haven't entered 12 guesses allow more\n\t\t\t\tSystem.out.print(\"Please enter 4 numbers, each from 1 to 6: (\");\n\t\t\t\tprintColor();\n\n\t\t\t\t// reads the line into an array\n\t\t\t\tint[] user_guesses = new int[NUM_COLOR_ROUND];\n\t\t\t\tint index = 0;\n\t\t\t\twhile (index < NUM_COLOR_ROUND) {\n\t\t\t\t\t// reads the entire user input into a line\n\t\t\t\t\tString guess = scanner.nextLine();\n\n\t\t\t\t\t// check if user wants hint\n\t\t\t\t\tif (Objects.equals(\"hint\", guess)) {\n\t\t\t\t\t\thint();\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants to quit\n\t\t\t\t\tif (Objects.equals(\"quit\", guess.toLowerCase()) || Objects.equals(\"exit\", guess.toLowerCase())) {\n\t\t\t\t\t\tSystem.out.println(\"You quit, better luck next time! \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\n\t\t\t\t\t// checks if user wants stats\n\t\t\t\t\tif (Objects.equals(\"stats\", guess.toLowerCase())) {\n\t\t\t\t\t\tdisplayStats();\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (char ch : guess.toCharArray()) {\n\t\t\t\t\t\tif (index == NUM_COLOR_ROUND) {\n\t\t\t\t\t\t\t// if more than 4 digits are used, only the first 4 are entered into array\n\t\t\t\t\t\t\tSystem.out.println(\"Warning: only the first four digits are taken as your guess.\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ch > '0' && ch < '7') {\n\t\t\t\t\t\t\tuser_guesses[index++] = ch - '0';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tint digitLeft = NUM_COLOR_ROUND - index;\n\t\t\t\t\tif (digitLeft > 0) {\n\t\t\t\t\t\t// if <4 digits are entered, then the program asks the user to enter the\n\t\t\t\t\t\t// remaining to make 4\n\t\t\t\t\t\tSystem.out.println(String.format(\"Please enter %d more digits (1 to 6 only)\", digitLeft));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// total number of guesses so far\n\t\t\t\ttotalGuess++;\n\n\t\t\t\t// prints out total number of guesses so far\n\t\t\t\tSystem.out.println(\"Total number of guesses: \" + totalGuess);\n\t\t\t\t// prints out your guess\n\t\t\t\tSystem.out.println(\"Your guess is: \" + Arrays.toString(user_guesses));\n\n\t\t\t\t// checks if user wins, if not, gives feedback on their guess\n\t\t\t\tint[] result = compareGuess(computerCode, user_guesses);\n\t\t\t\tint numRightPos = result[0];\n\t\t\t\tint numWrongPos = result[1];\n\t\t\t\tif (numRightPos == NUM_COLOR_ROUND) {\n\t\t\t\t\tSystem.out.println(\"You win!\");\n\t\t\t\t\tstoreStats(totalGuess, fileName);\n\t\t\t\t\tdisplayStats();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(String.format(\n\t\t\t\t\t\t\t\"Correct position and color (BLACK): %d; Wrong position but correct color (WHITE): %d\",\n\t\t\t\t\t\t\tnumRightPos, numWrongPos));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (totalGuess >= MAX_GUESS) {\n\t\t\t// if user has done 12 guesses, game is over\n\t\t\tSystem.out.println(\"You lose!\");\n\t\t\tSystem.out.println(\"Here is what computer generated: \" + Arrays.toString(computerCode));\n\t\t\tstoreStats(0, fileName);\n\t\t\tdisplayStats();\n\t\t}\n\t}", "public static void initGame() {\r\n\t\tfor (int i = 0; i < ROWS; i++) {\r\n\t\t\tfor (int j = 0; j < COLUMNS; j++) {\r\n\t\t\t\tfield[i][j] = EMPTY;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsnake.addFirst(new int[] { r.nextInt(ROWS), r.nextInt(COLUMNS) });\r\n\t\tfield[snake.getFirst()[0]][snake.getFirst()[1]] = SNAKE;\r\n\r\n\t\twhile (true) {\r\n\t\t\tint x = r.nextInt(ROWS);\r\n\t\t\tint y = r.nextInt(COLUMNS);\r\n\r\n\t\t\tif (field[x][y] == EMPTY) {\r\n\t\t\t\tfood.add(new int[] { APPLE, x, y });\r\n\t\t\t\tfield[x][y] = APPLE;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void addGeneralPatty(String s) {\n\t\tMyStack newBurger = new MyStack();\n\t\tif (pattyCount < MAX_PATTY) {\n\t\t\twhile (myBurger.size() != 0) {\n\t\t\t\tString top = (String) myBurger.peek();\n\t\t\t\tif (pattyCount > 0) {\n\t\t\t\t\tif (top.equals(\"Cheddar\") || top.equals(\"Mozzarella\") || top.equals(\"Pepperjack\")\t\n\t\t\t\t\t\t\t|| top.equals(\"Beef\") || top.equals(\"Chicken\") || top.equals(\"Veggie\")) {\t\n\t\t\t\t\t\tif (s.equals(\"Beef\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Beef\");\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (s.equals(\"Chicken\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Chicken\");\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (s.equals(\"Veggie\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Veggie\");\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tString ingredient = (String) myBurger.pop();\t\t\t\t\t\t\n\t\t\t\t\tnewBurger.push(ingredient);\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t} else if (pattyCount == 0) {\n\t\t\t\t\tif (top.equals(\"Mushrooms\") || top.equals(\"Mustard\") || top.equals(\"Ketchup\")\n\t\t\t\t\t\t\t|| top.equals(\"Bottom Bun\")) {\n\t\t\t\t\t\tif (s.equals(\"Beef\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Beef\");\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} if (s.equals(\"Chicken\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Chicken\");\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} if (s.equals(\"Veggie\")) {\n\t\t\t\t\t\t\tnewBurger.push(\"Veggie\");\n\t\t\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\t\tnewBurger.push(ingredient);\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (myBurger.size() != 0) {\n\t\t\t\tString ingredient = (String) myBurger.pop();\n\t\t\t\tnewBurger.push(ingredient);\n\t\t\t}\n\t\t\twhile (newBurger.size() != 0) {\n\t\t\t\tString ingredient = (String) newBurger.pop();\n\t\t\t\tmyBurger.push(ingredient);\n\t\t\t}\n\t\t\tpattyCount++;\n\t\t} else {\n\t\t\tSystem.out.println(\"cant add anymore patties\");\n\t\t}\n\t}", "private void loadSpeciesInFirstAnswer(int firstCriteria, int optionselected) {\n ArrayList<String> list = criteriaList.get(firstCriteria).getOptionList().get(optionselected).getEntities();\n for (String s : list) {\n speciesLeft.add(s);\n }\n }", "private void swellForests(Square[][]Squares, int rows, int columns, int[][] terrainLoc)\n {\n // for loop to go through every second column\n for (int a = 1; a < rows-1; a=a+2)\n {\n // for loop to go through every row\n for (int b = 1 ; b < columns-1 ; b++)\n {\n // checking for seeds\n if (terrainLoc[a][b] == 2)\n {\n // randoming the amount of forests to add around the found seed\n int rand = (int ) (Math.random() * 8 +1);\n \n // for loop to random the locations and place the new forest tiles\n for (int c = 0 ; c<=rand;c++)\n { \n int randvalue = (int ) (Math.random() * 8 +1);\n \n switch (randvalue)\n {\n case 1: Squares[a-1][b-1].setTerrain(2); // vasen ylänurkka\n case 2: Squares[a][b-1].setTerrain(2); // yläpuoli\n case 3: Squares[a+1][b-1].setTerrain(2); // oikea ylänurkka\n case 4: Squares[a-1][b].setTerrain(2); // vasen\n case 5: Squares[a+1][b].setTerrain(2); // oikea\n case 6: Squares[a-1][b+1].setTerrain(2); // vasen alanurkka\n case 7: Squares[a][b+1].setTerrain(2); // alapuoli\n case 8: Squares[a+1][b+1].setTerrain(2); // oikea alanurkka\n }\n }\n }\n }\n }\n }", "public static List<Bunny> getListOfVeryCuteBunniesNamedSteve() {\n String selectionString = \"name='steve' AND cuteValue > 66\";\n// Long time = Calendar.getInstance().getTimeInMillis();\n QueryResultIterable<Bunny> iterable =\n cupboard().withDatabase(db).query(Bunny.class).withSelection(selectionString).query();\n List<Bunny> list = getListFromQueryResultIterator(iterable);\n return list;\n }", "public ArrayList<Cell> findPlacesToGiveBirth() {\r\n\r\n // Randomly choose the number of babies.\r\n int numOfBabyToBeBorn = new Random().nextInt(this.numOfBaby()) + 1;\r\n\r\n ArrayList<Cell> newEmpty = this.getNeighbours(1);\r\n Collections.shuffle(newEmpty);\r\n\r\n ArrayList<Cell> placeToBeBorn = new ArrayList<Cell>();\r\n\r\n int countEmptyCell = 0;\r\n\r\n for (int findEmpt = 0; findEmpt < newEmpty.size()\r\n && countEmptyCell < numOfBabyToBeBorn; findEmpt++, countEmptyCell++) {\r\n if (newEmpty.get(findEmpt).getInhabit() == null \r\n && isTerrainAccessiable(newEmpty.get(findEmpt))) {\r\n placeToBeBorn.add(newEmpty.get(findEmpt));\r\n }\r\n }\r\n return placeToBeBorn;\r\n }", "public abstract ArrayList<Inhabitant> reproduce(ArrayList<Cell> toBeBorn);", "public static int [] moveDecision (Species [][] map, int x , int y, int plantHealth) {\n \n // Directions: Up = 1, Down = 2, Left = 3, Right = 4\n // Last choice is random movement\n // Animals: sheep = 0, wolves = 1\n int [] directionChoice = new int [] {1 + (int)(Math.random() * 4), 1 + (int)(Math.random() * 4)};\n \n // Find any animals\n if ((map[y][x] != null) && (!(map[y][x] instanceof Plant))) {\n \n // Sheep decisions (sheep cannot decide whether or not to move away from wolves)\n if (map[y][x] instanceof Sheep) {\n \n // First choice is to eat\n if ((y > 0) && (map[y-1][x] instanceof Plant)) {\n directionChoice[0] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Plant)) {\n directionChoice[0] = 2;\n } else if ((x > 0) &&(map[y][x-1] instanceof Plant)) {\n directionChoice[0] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Plant)) {\n directionChoice[0] = 4;\n \n // Wolf decisions\n } else if (map[y][x] instanceof Wolf) {\n \n // First choice is to eat\n if ((y > 0) && (map[y-1][x] instanceof Sheep)) {\n directionChoice[1] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Sheep)) {\n directionChoice[1] = 2;\n } else if ((x > 0) && (map[y][x-1] instanceof Sheep)) {\n directionChoice[1] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Sheep)) {\n directionChoice[1] = 4;\n \n // Second choice is to fight a weaker wolf\n } else if ((y > 0) && (map[y-1][x] instanceof Wolf)) {\n directionChoice[1] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Wolf)) {\n directionChoice[1] = 2;\n } else if ((x > 0) && (map[y][x-1] instanceof Wolf)) {\n directionChoice[1] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Wolf)) {\n directionChoice[1] = 4;\n }\n }\n \n }\n }\n return directionChoice; // Return choice to allow animals to move\n }", "public void addAnimals() throws IOException {\n\t\tint b = 0;\n\t\tint c = 0;\n\t\tint a = 0;\n\t\tArrayList<GameObjects> animals = new ArrayList<GameObjects>();\n\t\tRandom rand = new Random();\n\t\twhile(b<bigFish) {\n\t\t\tanimals.add(new BigFish(frameWidth, frameHeight, (int)(frameWidth/6 + rand.nextInt((int)(frameWidth/2))), (int)(frameHeight/4 + frameHeight/10 + rand.nextInt((int)(frameHeight - frameHeight/2)))));\n\t\t\tb+=1;\n\t\t}\n\t\twhile(c<crab) {\n\t\t\tanimals.add(new Crab(frameWidth, frameHeight, (int)(frameWidth/6 + rand.nextInt((int)(frameWidth - frameWidth/3))), (int)(frameHeight/4 + frameHeight/10 + rand.nextInt((int)(frameHeight - frameHeight/2)))));\n\t\t\tc+=1;\n\t\t}\n\t\twhile(a<algae) {\n\t\t\tanimals.add(new Algae(frameWidth, frameHeight, (int)(frameWidth/6 + rand.nextInt((int)(frameWidth - frameWidth/3))), (int)(frameHeight/4 + frameHeight/10 + rand.nextInt((int)(frameHeight - frameHeight/2)))));\n\t\t\ta+=1;\n\t\t}\n\n\t\tanimals.add(new BigFish(frameWidth, frameHeight));\n\t\tanimals.add(new Crab(frameWidth, frameHeight));\n\t\tanimals.add(new Algae(frameWidth, frameHeight));\n\n\t\tthis.objects = animals;\n\t}", "protected void DoOneGibbsSample(){\n\t\t//this array is the array of trees for this given sample\n\t\tfinal bartMachineTreeNode[] bart_trees = new bartMachineTreeNode[num_trees];\t\t\t\t\n\t\tfinal TreeArrayIllustration tree_array_illustration = new TreeArrayIllustration(gibbs_sample_num, unique_name);\n\n\t\t//we cycle over each tree and update it according to formulas 15, 16 on p274\n\t\tdouble[] R_j = new double[n];\n\t\tfor (int t = 0; t < num_trees; t++){\n\t\t\tif (verbose){\n\t\t\t\tGibbsSampleDebugMessage(t);\n\t\t\t}\n\t\t\tR_j = SampleTree(gibbs_sample_num, t, bart_trees, tree_array_illustration);\n\t\t\tSampleMusWrapper(gibbs_sample_num, t);\t\t\t\t\n\t\t}\n\t\t//now we have the last residual vector which we pass on to sample sigsq\n\t\tSampleSigsq(gibbs_sample_num, getResidualsFromFullSumModel(gibbs_sample_num, R_j));\n\t\tif (tree_illust){\n\t\t\tillustrate(tree_array_illustration);\n\t\t}\n\t}", "public boolean infect() {\n\t\t/* Remove all events related to this virus */\n\t\tfor (int i = 0; i < Sim.events.size(); i++)\n\t\t\tif (Sim.events.elementAt(i).org.equals(this))\n\t\t\t\tSim.events.elementAt(i).delete = true;\n\n\t\t/* Choose a bacteria to infect */\n\t\tBacterium chosen_bacterium = Sim.bas.get(Sim.randy.nextInt(Sim.bas\n\t\t\t\t.size()));\n\n\t\t/* check probability of successful infection */\n\t\tif ((((1 - chosen_bacterium.prob_surface) * this.prob_surface) >= Sim.randy\n\t\t\t\t.nextDouble())\n\t\t\t\t&& (((1 - chosen_bacterium.prob_enzymes) * this.prob_enzymes) >= Sim.randy\n\t\t\t\t\t\t.nextDouble()) && !chosen_bacterium.infected) {\n\n\t\t\t/* Update virus object */\n\t\t\tthis.current_ba = chosen_bacterium;\n\n\t\t\t/* Update bacteria object */\n\t\t\tchosen_bacterium.infected = true;\n\t\t\tchosen_bacterium.lp = this;\n\n\t\t\t/* Update bas_infected DataSeries in Sim */\n\t\t\tSim.bas_infected++;\n\n\t\t\t/* Create \"switch\" and \"secrete\" event */\n\t\t\tSim.events.add(new Event(this, rate_switch, EVENT_TYPE.SWITCHPHASE));\n\t\t\tSim.events.add(new Event(this, rate_secrete, EVENT_TYPE.SECRETE));\n\n\t\t\treturn true;\n\t\t\t\n\t\t} \n\t\t/* check to see if virus has failed to infect */\n\t\telse{ \n\t\t\n\t\t\t/* Remove this virus from lambda vector and update counters */\n\t\t\tfor (int i = 0; i < Sim.lps.size(); i++) {\n\t\t\t\tif (Sim.lps.elementAt(i).equals(this)) {\n\t\t\t\t\tSim.lps.remove(i);\n\t\t\t\t\tSim.lps_sum_sr -= this.prob_surface;\n\t\t\t\t\tSim.lps_sum_enz -= this.prob_enzymes;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false; \n\t\t}\n\n\t}", "private void harvest() {\n\t\t// if VERY far from flower, it must have died. start scouting\n\t\tif(grid.getDistance(grid.getLocation(targetFlower),grid.getLocation(this)) > 200) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// if crop storage is full, return to hive with information\n\t\telse if(food >= maxCrop) {\n\t\t\tif(targetFlower != null) {\n\t\t\t\tlastFlowerNectar = targetFlower.food;\n\t\t\t}\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if daylight is diminishing, return to hive\n\t\telse if(clock.time > (endForagingTime + 1.0)){\n\t\t\tlastFlowerNectar = 0;\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if flower loses all nectar, start scouting for new flower\n\t\telse if(targetFlower.food <= 0){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// semi-random decision to scout for new flower if current flower has low food\n\t\telse if(RandomHelper.nextIntFromTo(0,(int)(maxFlowerNectar/4)) > targetFlower.food &&\n\t\t\t\tRandomHelper.nextDoubleFromTo(0,1) < forageNoise){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// otherwise continue harvesting current flower\n\t\telse{\n\t\t\thover(grid.getLocation(targetFlower));\n\t\t\ttargetFlower.food -= foragingRate;\n\t\t\tfood += foragingRate;\n\t\t\tfood -= lowMetabolicRate;\n\t\t}\n\t}", "private Alien getRandomAlien() {\n\t\twhile(roamingAliens >= 0){\n\t\t\tint i = random.nextInt(gameObject.size());\n\t\t\tif(gameObject.get(i)instanceof Alien)\n\t\t\t\treturn (Alien) gameObject.get(i);\n\t\t}\n\t\treturn null;\n\t}", "public void random(){\r\n\t\tRandom rand = new Random();\r\n\t\trandArray = new int[6];\r\n\t\tfor (int i = 0; i < 6; i++){\r\n\t\t\t//Randomly generated number from zero to nine\r\n\t\t\trandom = rand.nextInt(10);\r\n\t\t\t//Random values stored into the array\r\n\t\t\trandArray[i] = random;\r\n\t\t\tif(i == 0){\r\n\t\t\t\ta = random;\r\n\t\t\t}\r\n\t\t\tif(i == 1){\r\n\t\t\t\tb = random;\r\n\t\t\t}\r\n\t\t\tif(i == 2){\r\n\t\t\t\tc = random;\r\n\t\t\t}\r\n\t\t\tif(i == 3){\r\n\t\t\t\td = random;\r\n\t\t\t}\r\n\t\t\tif(i == 4){\r\n\t\t\t\tf = random;\r\n\t\t\t}\r\n\t\t\tif(i == 5){\r\n\t\t\t\tg = random;\r\n\t\t\t}\r\n\t\t\t//Random values outputted\r\n\t\t\t//Prints out if the hint was not used.\r\n\t\t\tif (executed == false || guessed == true ){\r\n\t\t\t\tprint(randArray[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Prints out if the hint was not used.\r\n\t\tif (executed == false || guessed == true){\r\n\t\t\tprintln(\" Randomly Generated Value\");\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void nextGuessResult(ResultPegs resultPegs) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t\t// Not used here\r\n\t}", "public String[] runRegularSeason()\n {\n int r = new Random().nextInt(1 + 1);\n String[] temp;\n\n int starting = new Random().nextInt(14 + 1);\n int ending = new Random().nextInt(14 + 1);\n\n for(int i = 0; i < standings.length; i++)\n {\n temp = standings[ending];\n\n if(standings[ending][1].compareTo(standings[starting][1]) > 0 && r == 1)\n {\n standings[ending] = standings[starting];\n standings[starting] = temp;\n }\n\n starting = new Random().nextInt(14 + 1);\n ending = new Random().nextInt(14 + 1);\n r = new Random().nextInt(1 + 1);\n }\n\n //Set playoff Array\n for(int i = 0; i < playoffs.length; i++)\n {\n playoffs[i] = standings[i][0];\n }\n\n return playoffs;\n }", "public BasicSpecies() {\r\n\r\n\t}", "public void printSpeciesData(){\n\n System.out.println(\"A \" + this.name + \" has \" + this.legs + \" legs, \" + this.numberOfWings +\n \" wings, it is \" + this.wingColor + \", and likes a plant called \" + this.favFlower);\n\n }", "public void clearGuess() {\n\t\tthis.guessTimes = 0;\n\t}", "public static void wordsToGuess(String [] myWords){\n myWords[0] = \"tesseract\";\n myWords[1] = \"vibranium\";\n myWords[2] = \"mjolnir\";\n myWords[3] = \"jarvis\";\n myWords[4] = \"avengers\";\n myWords[5] = \"wakanda\";\n myWords[6] = \"mixtape\";\n myWords[7] = \"assemble\";\n myWords[8] = \"queens\";\n myWords[9] = \"inevitable\";\n }", "public List<Bear> solvedBears() {\n // TODO: Fix me.\n return this.bear;\n }", "public abstract void nextGuessResult(ResultPegs resultPegs);", "private void removeGuess() {\n\t\tguessList[this.getLastPlayIndex()] = null;\n\t\tif (this.getLastPlayIndex() > 0)\n\t\t\tlastMoveID--;\n\t}", "public String printSpeciePairMostSimilar()\n\t{\n\t\tStringBuilder toReturn = new StringBuilder();\n\n\t\ttoReturn.append(\"SPECIES PAIR MOST SIMILAR IN ACTIVITY (FREQUENCY)\\n\");\n\t\ttoReturn.append(\" Consider those species with 25 or more pictures\\n\");\n\n\t\tSpecies lowest = null;\n\t\tSpecies lowestOther = null;\n\t\tdouble lowestFrequency = Double.MAX_VALUE;\n\n\t\tfor (Species species : analysis.getAllImageSpecies())\n\t\t{\n\t\t\tfor (Species other : analysis.getAllImageSpecies())\n\t\t\t{\n\t\t\t\tList<ImageEntry> imagesWithSpecies = new ImageQuery().speciesOnly(species).query(images);\n\t\t\t\tList<ImageEntry> imagesWithSpeciesOther = new ImageQuery().speciesOnly(other).query(images);\n\t\t\t\tint totalImages = imagesWithSpecies.size();\n\t\t\t\tint totalImagesOther = imagesWithSpeciesOther.size();\n\t\t\t\tdouble activitySimilarity = 0;\n\n\t\t\t\tif (totalImages >= 25 && totalImagesOther >= 25 && !species.equals(other))\n\t\t\t\t{\n\t\t\t\t\t// 24 hrs\n\t\t\t\t\tfor (int i = 0; i < 24; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTime = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpecies);\n\t\t\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTimeOther = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpeciesOther);\n\t\t\t\t\t\tdouble numImages = imagesWithSpeciesAtTime.size();\n\t\t\t\t\t\tdouble numImagesOther = imagesWithSpeciesAtTimeOther.size();\n\t\t\t\t\t\tdouble frequency = numImages / totalImages;\n\t\t\t\t\t\tdouble frequencyOther = numImagesOther / totalImagesOther;\n\t\t\t\t\t\tdouble difference = frequency - frequencyOther;\n\t\t\t\t\t\t// Frequency squared\n\t\t\t\t\t\tactivitySimilarity = activitySimilarity + difference * difference;\n\t\t\t\t\t}\n\n\t\t\t\t\tactivitySimilarity = Math.sqrt(activitySimilarity);\n\n\t\t\t\t\tif (lowestFrequency >= activitySimilarity)\n\t\t\t\t\t{\n\t\t\t\t\t\tlowestFrequency = activitySimilarity;\n\t\t\t\t\t\tlowest = species;\n\t\t\t\t\t\tlowestOther = other;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (lowest != null)\n\t\t{\n\t\t\ttoReturn.append(String.format(\"Hour %-28s %-28s\\n\", lowest.getName(), lowestOther.getName()));\n\n\t\t\tList<ImageEntry> imagesWithSpecies = new ImageQuery().speciesOnly(lowest).query(images);\n\t\t\tList<ImageEntry> imagesWithSpeciesOther = new ImageQuery().speciesOnly(lowestOther).query(images);\n\t\t\tint totalImages = imagesWithSpecies.size();\n\t\t\tint totalImagesOther = imagesWithSpeciesOther.size();\n\t\t\tdouble activitySimilarity = 0;\n\n\t\t\t// 24 hrs\n\t\t\tfor (int i = 0; i < 24; i++)\n\t\t\t{\n\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTime = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpecies);\n\t\t\t\tList<ImageEntry> imagesWithSpeciesAtTimeOther = new ImageQuery().timeFrame(i, i + 1).query(imagesWithSpeciesOther);\n\t\t\t\tdouble numImages = imagesWithSpeciesAtTime.size();\n\t\t\t\tdouble numImagesOther = imagesWithSpeciesAtTimeOther.size();\n\t\t\t\tdouble frequency = numImages / totalImages;\n\t\t\t\tdouble frequencyOther = numImagesOther / totalImagesOther;\n\t\t\t\tdouble difference = frequency - frequencyOther;\n\t\t\t\t// Frequency squared\n\t\t\t\tactivitySimilarity = activitySimilarity + difference * difference;\n\n\t\t\t\ttoReturn.append(String.format(\"%02d:00-%02d:00 %5.3f %5.3f\\n\", i, i + 1, frequency, frequencyOther));\n\t\t\t}\n\t\t}\n\n\t\ttoReturn.append(\"\\n\");\n\n\t\treturn toReturn.toString();\n\t}", "public void setMySpeciesIdentifier(int mySpeciesIdentifier) {\n this.mySpeciesIdentifier = mySpeciesIdentifier;\n }", "public void addToWatchlist(@NonNull MonitoringArea place, @NonNull Species species, @IntRange(from = 1) int count) {\n if (isTerminated()) {\n throw new BirdCountTerminatedException(this);\n } else if (!observedSpecies.containsKey(place)) {\n WatchList list = new WatchList();\n list.addSightingFor(species, count);\n observedSpecies.put(place, list);\n } else {\n observedSpecies.get(place).addSightingFor(species, count);\n }\n }" ]
[ "0.5601165", "0.54854214", "0.5459347", "0.5359019", "0.522513", "0.503152", "0.5031104", "0.5001068", "0.49942857", "0.49920428", "0.49785888", "0.49545473", "0.4929225", "0.49271715", "0.49219915", "0.491115", "0.49100053", "0.4877695", "0.48717985", "0.4843218", "0.4841928", "0.48315528", "0.480713", "0.48069334", "0.476369", "0.4754535", "0.4744428", "0.47439584", "0.47287497", "0.4719211", "0.47174397", "0.46742058", "0.46542084", "0.4626935", "0.4576622", "0.45387658", "0.45304313", "0.4515396", "0.45077443", "0.45057887", "0.44960624", "0.44954282", "0.4461721", "0.44502518", "0.44431433", "0.44378296", "0.44370496", "0.44302076", "0.44231147", "0.44092268", "0.4396036", "0.43929023", "0.43919465", "0.43853652", "0.43783197", "0.43764967", "0.43659788", "0.43597442", "0.4345243", "0.43414763", "0.43295184", "0.43260777", "0.43243986", "0.43231365", "0.43191847", "0.4309704", "0.43043464", "0.42974615", "0.42741653", "0.42733675", "0.42723125", "0.4262414", "0.42525408", "0.42389092", "0.42351875", "0.4234898", "0.42261696", "0.42223197", "0.42159322", "0.42062724", "0.4197066", "0.41940066", "0.41852435", "0.41771013", "0.4170852", "0.41694206", "0.41602886", "0.41557539", "0.41513056", "0.41466945", "0.41374326", "0.41358772", "0.41287544", "0.41263455", "0.4124318", "0.4117874", "0.4117659", "0.4115154", "0.4104351", "0.41025275" ]
0.6054023
0
If you hit the bird you were trying to shoot, you will be notified through this function.
public void hit(GameState pState, int pBird, Deadline pDue) { System.err.println("Bird num + " + pBird + " was hit"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void shoot() {\n\t\tthis.fired = true;\n\t\tghost.shot=true;\n\t}", "private void shoot() {\n }", "private void shoot() {\n }", "@Override\n\t\t\tpublic void shoot() {\n\t\t\t}", "void shoot();", "public Answer shoot(){\n if (this.isOccuped()){\n this.ship.hit();\n if (this.ship.hasBeenSunk()){\n\tthis.hasBeenShot = true;\n return Answer.SUNK;\n }\n else{\n\tthis.hasBeenShot = true;\n return Answer.HIT;\n }\n }\n else{\n this.hasBeenShot = true;\n return Answer.MISSED;\n }\n }", "void hitEvent(Block beingHit, Ball hitter);", "void hitEvent(Block beingHit, Ball hitter);", "public void takesHit()\n {\n // TODO: replace this line with your code\n }", "@Override\r\n\tboolean shootAt(int row, int column) {\r\n\t\t\r\n\t\t\tthis.getHit()[0]=true;\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t}", "public void shoot() {\n\t\tgetWeapon().triggerMain();\n\t\tsetShooting(true);\n\t}", "private void handleShoot(ID source, ID target, Boolean hit, Player shootedPlayer) {\n\t\tint hittedSector = shootedPlayer.shootInIntervalOfPlayer(target);\n\t\tshootedPlayer.setHittedSector(hittedSector, hit);\n\t\tif (hit) {\n\t\t\tif (source.compareTo(chordImpl.getID()) == 0)\n\t\t\t\tGUIMessageQueue.getInstance().addMessage(\"I got a hit\");\n\t\t\telse {\n\t\t\t\tGUIMessageQueue.getInstance().addMessage(\"Player with ID: \" + source.toString() + \" got a hit\");\n\t\t\t}\n\t\t}\n\t}", "public void hit(GameState pState, int pBird, Deadline pDue) {\n System.err.println(\"Hit bird \" + pBird);\n pState.getBird(pBird).kill();\n if(pBird == Constants.SPECIES_BLACK_STORK) {\n System.err.println(\"Hit black stork!\");\n }\n\n }", "public void shootIntoRocket(){\n shoot.set(ROCKET_SHOOT);\n }", "@Override\r\n\tboolean shootAt(int row, int col) {\r\n\t\tboolean[] newHit = new boolean[1]; \r\n\t\tnewHit[0] = true; \r\n\t\tthis.setHit(newHit); \r\n\t\treturn false; \r\n\t}", "private void handleShooting(SpaceWars game, GameGUI gui) {\r\n\t\tif (gui.isShotPressed()) {\r\n\t\t\tfire(game);\r\n\t\t}\r\n\t}", "public void shoot() {\r\n\t\twhile (rounds > 1) {\r\n\t\t\trounds--;\r\n\t\t\tSystem.out.println(gunType + \" is shooting now\\n\" + rounds + \" \\nCLACK! CLACK! CLAK! CLAK! CLAK!\");\r\n\t\t\tif (rounds == 1) {\r\n\t\t\t\tSystem.out.println(\"Magazine's Empty!! \\nRELOAD!!\\nRELOAD!!!\\nRELAOD!!!\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public void shoot(Agent agent) throws RemoteException {\n\t}", "@Override\n\tpublic void onHitted(EntityDamageByEntityEvent e, Player damager, Player victim) {\n\t\t\n\t}", "public void tryToFire() {\n\t\tif (System.currentTimeMillis() - lastFire < firingInterval) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// if we waited long enough, create the shot entity, and record the time.\n\t\tlastFire = System.currentTimeMillis();\n\t\tShotEntity shot = new ShotEntity(this,\"shot.gif\",ship.getX()+10,ship.getY()-30, 1);\n\t\tentities.add(shot);\n\t}", "private void shoot() {\n\t\tif (playerList.size() > 0) {\n\t\t\tif (!someoneLose) {\n\t\t\t\tPlayer target = null;\n\t\t\t\tint remainingShips = SHIP_COUNT + 1;\n\t\t\t\tfor (Player player : playerList) {\n\t\t\t\t\tif (player.getRemainingShips() < remainingShips) {\n\t\t\t\t\t\ttarget = player;\n\t\t\t\t\t\tremainingShips = player.getRemainingShips();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSector targetSector = target.findFreeSector();\n\t\t\t\tlastTarget = targetSector.getMiddle();\n\t\t\t\tShootingThread st = new ShootingThread(chordImpl, targetSector.getMiddle());\n\t\t\t\tst.start();\n\t\t\t}\n\t\t}\n\t}", "public void shoot(){\r\n \tgame.pending.add(new Bullet(this, bulletlife));\t\r\n }", "@Override\n\tpublic void onHit() {\n\t\t\n\t}", "public void enemyShoot()\r\n\t{\r\n\t\tfor (Enemy enemies : enemy)\r\n\t\t{\r\n\t\t\tif (enemies.getHasFired())\r\n\t\t\t{\r\n\t\t\t\tBullet enemyPew = enemies.shoot();\r\n\t\t\t\tif (enemyPew != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.add(enemyPew);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void tankWillShoot(Graphics2D g2d, GameState state) {\n if (state.isMouseClicked() && tankObject.getNumOfCannonBullet() > 0 && state.getGunType() % 2 == 1) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfCannonBullet(tankObject.getNumOfCannonBullet() - 1);\n if (tankObject.getCannonLevel() == 1) {\n state.getMissiles().add(new Missile(state, 15));\n state.getMissiles().get(state.getMissiles().size() - 1).missileDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/heavygun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (tankObject.getCannonLevel() == 2) {\n state.getMissiles().add(new Missile(state, 30));\n state.getMissiles().get(state.getMissiles().size() - 1).missileDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/heavygun.wav\", 0);\n state.setMouseClicked(false);\n }\n } else if (state.isMouseClicked() && tankObject.getNumOfCannonBullet() == 0 && state.getGunType() % 2 == 1) {\n AudioPlayer emptyGunSFX = new AudioPlayer(\"sound effects/emptyGun.wav\", 0);\n state.setMouseClicked(false);\n }\n for (Missile missile : state.getMissiles()) {\n missile.paint(g2d, state);\n }\n if (state.isMousePressed() && tankObject.getNumOfMachineGunBullet() > 0 && state.getGunType() % 2 == 0) {\n if (numOfRenderBullet1 == 0 && tankObject.getMachineGunLevel() == 1) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfMachineGunBullet(tankObject.getNumOfMachineGunBullet() - 1);\n state.getBullets().add(new Bullet(state, 20));\n state.getBullets().get(state.getBullets().size() - 1).bulletDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/lightgun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (numOfRenderBullet2 == 0 && tankObject.getMachineGunLevel() == 2) {\n if (!state.getInfiniteMissilesCheatCode().isCheatCodeEntered())\n tankObject.setNumOfMachineGunBullet(tankObject.getNumOfMachineGunBullet() - 1);\n state.getBullets().add(new Bullet(state, 30));\n state.getBullets().get(state.getBullets().size() - 1).bulletDirection(state);\n AudioPlayer tankMissileSFX = new AudioPlayer(\"sound effects/lightgun.wav\", 0);\n state.setMouseClicked(false);\n }\n if (numOfRenderBullet1 <= 7) {\n numOfRenderBullet1++;\n }\n if (numOfRenderBullet1 == 7) {\n numOfRenderBullet1 = 0;\n }\n if (numOfRenderBullet2 <= 3) {\n numOfRenderBullet2++;\n }\n if (numOfRenderBullet2 == 3) {\n numOfRenderBullet2 = 0;\n }\n }\n else if (state.isMousePressed() && tankObject.getNumOfMachineGunBullet() == 0 && state.getGunType() % 2 == 0) {\n AudioPlayer emptyGunSFX = new AudioPlayer(\"sound effects/emptyGun.wav\", 0);\n }\n for (Bullet bullet : state.getBullets()) {\n bullet.paint(g2d, state);\n }\n }", "public void avatarShoot()\r\n\t{\r\n\t\tBullet avatarPew = avatar.shoot();\r\n\t\tif (avatarPew!= null)\r\n\t\t{\r\n\t\t\tbullets.add(avatarPew);\r\n\t\t}\r\n\t}", "public void onHitRobot(HitRobotEvent event) {\n\n\n if (!isTeammate(event.getName())) {\n target = robots.get(event.getName());\n if (getGunTurnRemaining() == 0) {\n fire(3);\n ahead(60);\n }\n\n\n } else {\n turnRight(90);\n setAhead(1000);\n setChargerTarget();\n }\n if (missed) {\n pointGunToVector(target.getLocation());\n fire(3);\n }\n }", "private void shoot()\n\t{\n\t\t//Speed movement of the bullet\n\t\tint speed = 0;\n\t\t//Damage dealt by the bullet\n\t\tint damage = 0;\n\t\t//Angle used to shoot. Used only by the vulcan weapon\n\t\tdouble angle = 0;\n\t\t\n\t\tif(weapon == PROTON_WEAPON)\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 10;\n\t\t\tbulletPool.getBulletPool(weapon).getBullet(getX()+37, getY()-this.getHeight()+30, speed, damage, 0);\n\t\t\tSoundManager.getInstance().playSound(\"protonshoot\", false);\n\t\t}\t\n\t\telse if(weapon == VULCAN_WEAPON)\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 2;\n\t\t\tangle = 10;\n\t\t\t\n\t\t\tbulletPool.getBulletPool(weapon).getThreeBullets(getX() +27, getX()+37, getX()+47,\n\t\t\t\t\tgetY()-this.getHeight()+30, speed, damage, (int)angle);\n\t\t\tSoundManager.getInstance().playSound(\"vulcanshoot\", false);\n\t\t}\t\t\n\t\telse\n\t\t{\n\t\t\tspeed = 15;\n\t\t\tdamage = 15;\n\t\t\tangle = 0;\n\t\t\t\n\t\t\tbulletPool.getBulletPool(weapon).getBullet(getX()+37, getY()-this.getHeight()+30,\n\t\t\t\t\t\tspeed, damage, angle);\n\t\t\tSoundManager.getInstance().playSound(\"gammashoot\", false);\n\t\t}\t\n\t}", "protected boolean shootAt(int row, int column){\n\n //update shots fired\n //call Ship.shootAt to update the ship\n //check if new ship sunk\n this.shotsFired++;\n boolean prevSunk = ships[row][column].isSunk();\n\n ships[row][column].shootAt(row, column);\n boolean currSunk = ships[row][column].isSunk();\n if (!prevSunk && currSunk) shipsSunk++;\n\n //if the location is empty, return false\n if (!isOccupied(row,column)) return false;\n //if the location has a real ship but already sunk\n if (prevSunk) return false;\n //if the location has a real ship an is not sunk yet\n else {\n this.hitCount++;\n return true;\n }\n\n }", "public void shoot(){\n // boss bullete attract to player\n int bulletPosX = PApplet.parseInt(posX + (speed * cos(angle)));\n int bulletPosY = (int)(posY + hei / 2);\n float bulletAngle = atan2(Main.player.posY - bulletPosY, Main.player.posX - bulletPosX);\n int bulletVelX = (int)(8 * cos(bulletAngle));\n int bulletVelY = (int)(8 * sin(bulletAngle));\n bossBullets.add(new Bullet(bulletPosX,bulletPosY,bulletVelX,bulletVelY,1,attack));\n }", "public boolean shootLastShotHit(Board enemyBoard) \r\n {\r\n \t\r\n \t\r\n \treturn true;\r\n }", "@Override\n\tpublic void onHitPlayer(EntityDamageByEntityEvent e, Player damager, Player victim) {\n\t\t\n\t}", "private void shoot(float angle) {\n\t\tfloat arc = FIRING_ARC;\n\t\tif (weapon instanceof BanditTripleShot)\n\t\t\tarc *= 2;\n\t\t\t\n\t\tif (angle < FIRING_ARC && angle > - FIRING_ARC) {\n\t\t\t//System.out.println(\"BANDIT: shooting\");\n\t\t\tweapon.shoot();\n\t\t}\n\t}", "@Override\n public void hitEvent(Block beingHit, Ball hitter) {\n //checking if we hit the death block\n //creating the upper left point of the death block\n Point upLeftDeathBlock = new Point(0.0, 600.0);\n if (beingHit.getCollisionRectangle().getUpperLeft().equals(upLeftDeathBlock)) {\n hitter.removeFromGame(this.gameLevel);\n this.remainingBalls.decrease(1);\n return;\n }\n //in regular cases\n return;\n\n }", "@Override\n\tpublic void takeHit(int attack) {\n\n\t}", "@Override\n\tpublic void fire(Ball firer) {\n\t balls.add(firer);\n\t firer.setAbsorbed(true);\n\t setBalls();\n\t firer.setVx(0);\n\t firer.setVy(0);\n\t //somehow ball being fired out came back and hit!\n\t if (firer.equals(firingBall)) {\n\t firingBall = null;\n\t gb.removeFromActiveList(this);\n\t }\n\t gb.resetScore();\n\t\tsuper.fire(firer);\n\t}", "boolean takeShot(Point shot);", "public void hitEvent(Block beingHit, Ball hitter) {\r\n this.currentScore.increase(5);\r\n if (beingHit.getHitPoints() == 0) {\r\n this.currentScore.increase(10);\r\n }\r\n }", "public void registerHit(boolean alive) {\n\t\tSystem.out.println(\"Player \" + self + \" registered a hit\");\r\n\t}", "public void registerShotFired(Coordinate target) {\r\n boolean hit = false;\r\n boolean shipSunk = false;\r\n boolean fleetSunk = false;\r\n if (data.gameState == 3) { //Player One fired \r\n hit = database.getShipPresent(2, target);\r\n if (hit) { //if hit, check to see if the Ship is sunk\r\n target.setCoordState(State.Status.HIT);\r\n database.updateShipStatus(1, target);\r\n game.getPlayerTwo().getPlayerFleet().updateFleetCoordStatus(target);\r\n data.hit = (target.getxCoord()-65) + ((target.getyCoord()-1)*12);\r\n data.hitFlag = true;\r\n try {\r\n shipSunk = game.getPlayerTwo().getPlayerFleet().checkIfSunk(target);\r\n data.shipsRemaining = game.getPlayerTwo().getPlayerFleet().getCurrentFleetSize();\r\n } catch (Exception ex) {\r\n Logger.getLogger(Model.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n else { //Missed\r\n target.setCoordState(State.Status.MISS);\r\n database.updateShipStatus(1, target);\r\n }\r\n if (shipSunk)\r\n fleetSunk = game.getPlayerTwo().getPlayerFleet().checkFleetSunk();\r\n } \r\n else if (data.gameState == 4) { //Player Two fired \r\n hit = database.getShipPresent(1, target);\r\n if (hit) {\r\n target.setCoordState(State.Status.HIT);\r\n database.updateShipStatus(1, target);\r\n game.getPlayerOne().getPlayerFleet().updateFleetCoordStatus(target);\r\n data.hit = (target.getxCoord()-65) + ((target.getyCoord()-1)*12);\r\n data.hitFlag = true;\r\n try {\r\n shipSunk = game.getPlayerOne().getPlayerFleet().checkIfSunk(target);\r\n data.shipsRemaining = game.getPlayerOne().getPlayerFleet().getCurrentFleetSize();\r\n } catch (Exception ex) {\r\n Logger.getLogger(Model.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n else { //Missed\r\n target.setCoordState(State.Status.MISS);\r\n database.updateShipStatus(1, target);\r\n }\r\n if (shipSunk)\r\n fleetSunk = game.getPlayerOne().getPlayerFleet().checkFleetSunk();\r\n }\r\n \r\n if (shipSunk) //A Ship has been sunk\r\n data.shipSunkFlag = true;\r\n if (fleetSunk) //A Fleet has been sunk, so the game is over\r\n winGame();\r\n \r\n setChanged();\r\n notifyObservers(data);\r\n \r\n if (data.gameState == 3) //Switch to Player 2 turn for next register\r\n data.gameState = 4;\r\n else if (data.gameState == 4) //Switch to Player 1 turn for next register\r\n data.gameState = 3;\r\n data.hitFlag = false;\r\n data.shipSunkFlag = false;\r\n }", "public boolean fire(RobotInfo enemy) throws GameActionException {\n if (rc.getType() == RobotType.LUMBERJACK) return strike(enemy);\n if (rc.hasAttacked()) return false; //One such check (just in case)\n Direction toEnemy = rc.getLocation().directionTo(enemy.location);\n if (shouldFirePentad(enemy)){\n rc.firePentadShot(toEnemy);\n }\n else if(shouldFireTriad(enemy)){\n rc.fireTriadShot(toEnemy);\n }\n else{\n if (rc.canFireSingleShot()){\n rc.fireSingleShot(toEnemy);\n }\n }\n return false;\n }", "public abstract void fire();", "public abstract void fire();", "private void collision(){\n\t\tboolean touched = false;\n\t\tboolean hit;\n\t\tint j =0;\n\t\twhile ( j< this.game_.getSaveBaby().size() && !touched){\n\t\t\tBabyBunnies b = this.game_.getSaveBaby().get(j);\n\t\t\ttouched = this.game_.getBunnyHood().getPosition().dst(b.getPosition())<=80;\n\t\t\thit = this.game_.getWolf().getPosition().dst(b.getPosition())<=80;\n\t\t\tif (touched){\n\t\t\t\tthis.game_.setBabySaved(b);\n\t\t\t}\n\t\t\tif (hit){\n\t\t\t\tthis.game_.wolfCatchBunnies(b);\n\t\t\t\t/**\n\t\t\t\t * Test de callback, retour vers l app android\n\t\t\t\t */\n\t\t\t\tif(this.game_.getScoreWolf()==3){\n\t\t\t\t\tif (this.gameCallBack != null) {\n\n this.gameCallBack.gameOverActivity(this.game_.getScoreBunny());\n\t\t\t\t\t\tthis.isGameOver=true;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tGdx.app.log(\"MyGame\", \"To use this class you must implement MyGameCallback!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tj++;\n\t\t}\n\t}", "public void shootNoHit(Board enemyBoard) \r\n {\r\n \t//Condition is used so that coords will be rechosen until they work.\r\n \tboolean condition = true;\r\n \twhile(condition == true) \r\n \t{\r\n \t\tsetCoords();\r\n \t\tboolean shot = enemyBoard.checkShot(getCoordX(), getCoordY());\r\n \t\t\r\n \t\tif(shot == true) \r\n \t\t{\r\n \t\t\tSystem.out.println(getCoordX() + \" \" + getCoordY());\r\n \t\t\tcondition = false;\r\n \t\t\t\r\n \t\t}\r\n\r\n \t}\r\n \t//This checks whether or not the ai will have hit anything in the current turn\r\n \tboolean shotHitOrNot = enemyBoard.shotFired(getCoordX(), getCoordY());\r\n \r\n \tif(shotHitOrNot = true) \r\n \t{\r\n \t\tthis.hitLastTurn = false;\r\n \t}\r\n \telse \r\n \t{\r\n \t\tthis.hitLastTurn = false;\r\n \t}\r\n \t\r\n }", "private void dragonHit(Player p, boolean isLast) {\r\n\t\tp.updateClankInBag(-1);\r\n\t\t//String damageMsgE = \":dragon: Pulled ``\"+getName(p)+\"``'s clank\";\r\n\t\t//**[ :dragon: ]** **-1** :heart: **-0** :blue_heart:\r\n\t\tdragonAttackEventText += \"**-1** \"+p.getHeartString()+\" \";\r\n\t\tString damageMsgT = \":game_die: **\"+getName(p)+\"**\";\r\n\t\tif (isLast) {\r\n\t\t\tdamageMsgT = \"_ _ _ _ \"+damageMsgT;\r\n\t\t} else {\r\n\t\t\tdamageMsgT = \"** ** ** ** \"+damageMsgT;\r\n\t\t}\r\n\t\tif (p.isFree()) {\r\n\t\t\tgameChannel.sendMessage(damageMsgT+\"'s clank was pulled, but they already escaped\").queueAfter(dragonAttackingDelay, TimeUnit.MILLISECONDS);\r\n\t\t\t//addEvent(damageMsgE + \", but they already escaped\",false);\r\n\t\t} else if (p.isDead()) {\r\n\t\t\tgameChannel.sendMessage(damageMsgT+\"'s clank was pulled, but they already died\").queueAfter(dragonAttackingDelay, TimeUnit.MILLISECONDS);\r\n\t\t\t//addEvent(damageMsgE + \", but they already died\",false);\r\n\t\t} else {\r\n\t\t\tgameChannel.sendMessage(damageMsgT+\"'s clank was pulled and got hit by the dragon! **-1** :broken_heart: **\"+(p.getHealth()-1)+\"** Health Left\").queueAfter(dragonAttackingDelay, TimeUnit.MILLISECONDS);\r\n\t\t\t//addEvent(damageMsgE + \" **-1** :broken_heart: **\"+(p.getHealth()-1)+\"** Health Left\",false);\r\n\t\t}\r\n\t\tupdateHealth(p,-1);\r\n\t\tif (isLast && !dragonAttackEventText.contentEquals(\"**[ :dragon: ]** \")) {\r\n\t\t\tupdateBoardNoImageChange();\r\n\t\t}\r\n\t}", "private void notifyHit(Ball hitter) {\r\n List<HitListener> listeners = new ArrayList<>(this.getHitListeners());\r\n for (HitListener hl : listeners) {\r\n hl.hitEvent(this, hitter);\r\n }\r\n }", "@Override\r\n\tpublic void onPlayerHit(Player p) {\n\t\tParUtils.createParticle(Particles.EXPLOSION, loc, 0, 0, 0, 1, 0);\r\n\t\tplaySound(Sound.ENTITY_DRAGON_FIREBALL_EXPLODE,loc,1,1);\r\n\t\t//p.setVelocity(dir.multiply(speed/2));\r\n\t\tdoKnockback(p, caster.getLocation(), 1 );\r\n\t\tdamage(p, 2, caster);\r\n\t}", "public void onHit() {\n //override this to provide extra functionality\n }", "private void enemiesWillShoot(Graphics2D g2d, GameState state) {\n if (numOfRenderShoot == 75) {\n numOfRenderShoot = 0;\n for (int i = 0; i < state.getEnemyTanks().size(); i++) {\n if (state.getEnemyTanks().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTanks().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTanks().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTanks().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyMissiles().add(new EnemyMissile(this, state, 10\n , state.getEnemyTanks().get(i)));\n state.getEnemyMissiles().get(state.getEnemyMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyCars().size(); i++) {\n if (state.getEnemyCars().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyCars().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyCars().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyCars().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyBullets().add(new EnemyBullet(this, state, 20\n , state.getEnemyCars().get(i)));\n state.getEnemyBullets().get(state.getEnemyBullets().size() - 1).bulletDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n for (int i = 0; i < state.getEnemyWallTurrets().size(); i++) {\n if (state.getEnemyWallTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyWallTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyWallTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyWallTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyWallTurretMissiles().add(new EnemyWallTurretMissile(this, state, 15\n , state.getEnemyWallTurrets().get(i)));\n state.getEnemyWallTurretMissiles().get(state.getEnemyWallTurretMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n\n for (int i = 0; i < state.getEnemyTurrets().size(); i++) {\n if (state.getEnemyTurrets().get(i).getLocY() < state.getTankLocY() + 500 && state.getEnemyTurrets().get(i).getLocY() > state.getTankLocY() - 400 &&\n state.getEnemyTurrets().get(i).getLocX() < state.getTankLocX() + 800 && state.getEnemyTurrets().get(i).getLocX() > state.getTankLocX() - 500) {\n state.getEnemyHomingMissiles().add(new EnemyHomingMissile(this, state, 15\n , state.getEnemyTurrets().get(i)));\n state.getEnemyHomingMissiles().get(state.getEnemyHomingMissiles().size() - 1).missileDirection(state);\n AudioPlayer enemyGunShotSFX = new AudioPlayer(\"sound effects/enemyshot.wav\", 0);\n }\n }\n }\n for (EnemyMissile enemyMissile : state.getEnemyMissiles()) {\n enemyMissile.paint(g2d, state);\n }\n for (EnemyBullet enemyBullet : state.getEnemyBullets()) {\n enemyBullet.paint(g2d, state);\n }\n for (EnemyWallTurretMissile enemyWallTurretMissile : state.getEnemyWallTurretMissiles()) {\n enemyWallTurretMissile.paint(g2d, state);\n }\n for (EnemyHomingMissile enemyHomingMissile : state.getEnemyHomingMissiles()) {\n enemyHomingMissile.paint(g2d, state);\n }\n }", "private void shoot(boolean canShoot, java.util.List<Enemy> enemiesInVicinity) {\n if (canShoot) {\n shotEnemy = null;\n if (!enemiesInVicinity.isEmpty()){\n boolean shotEnamies = shootAt(enemyWithLowestHealth(enemiesInVicinity));\n if (shotEnamies) resetCooldown();\n }\n }\n }", "public void Hit()\n {\n this.numLives--;\n //Oscillate visible and not if the number of lives is greater than zero\n if(this.numLives > 0)\n {\n this.damaged = true;\n this.Blink(1);\n\n }\n }", "private void notifyHit(Ball hitter) {\n // Make a copy of the hitListeners before iterating over them.\n List<HitListener> listeners = new ArrayList<HitListener>(this.hitListeners);\n // Notify all listeners about a hit event:\n for (HitListener hl : listeners) {\n hl.hitEvent(this, hitter);\n }\n }", "public boolean playerFire(int x, int y)\n\t{\n\t\tint result = aiGrid.fireAt(x, y);\n\t\tif (result == 0) {\n\t\t\t//miss\n\t\t\tSystem.out.println(\"\\nMISS\\n\");\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\tif (result == 1) {\n\t\t\t\t//hit\n\t\t\t\tSystem.out.println(\"\\nHIT\\n\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//Already fired there\n\t\t\t\tSystem.out.println(\"Already fired here.\");\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "public void hitEvent(Block beingHit, Ball hitter) {\r\n if (beingHit.getHitPoints() == 0) {\r\n this.currentScore.increase(10);\r\n return;\r\n }\r\n\r\n this.currentScore.increase(5);\r\n }", "public void shoot(){\n int bulletPosX = posX;\n int bulletPosY = posY;\n int bulletVelX = 0;\n int bulletVelY = -9;\n //add the new bullets to the array of bullets\n bullets.add(new Bullet(bulletPosX,bulletPosY,bulletVelX,bulletVelY,0,attack));\n }", "public abstract void fire(Player holder);", "@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)\n public void onProjectileHitEvent(@NotNull ProjectileHitEvent event) {\n\n if (event.getEntity() instanceof EnderPearl) {\n\n EnderPearl pearl = (EnderPearl) event.getEntity();\n if (pearl.getShooter() instanceof Entity) {\n Entity shooter = (Entity) pearl.getShooter();\n\n Block block = event.getHitBlock();\n if (block != null && block.getType() == Material.END_GATEWAY && event.getHitBlockFace() != null) {\n\n Teleportal teleportal = Teleportal.getFromStruct(block);\n if (teleportal != null) {\n if (shooter instanceof Player) {\n if (!shooter.hasPermission(\"teleportals.player.use\")) {\n sendMsg(shooter, \"no-perms-use\");\n return;\n }\n }\n boolean tryNonOccludedExit = getConfig().getBoolean(\"teleportal.try-non-occluded-exit\", true);\n boolean failOnFullyOccludedExit = getConfig().getBoolean(\"teleportal.fail-on-fully-occluded-exit\", false);\n\n if (!teleportal.teleport(shooter, event.getHitBlockFace(), tryNonOccludedExit, failOnFullyOccludedExit)) {\n\n if (shooter instanceof Player) {\n int damageAmount = getConfig().getInt(\"teleportal.usage-fail-damage\", 1);\n if (damageAmount > 0) {\n ((Player) shooter).damage(damageAmount);\n }\n }\n }\n }\n }\n }\n }\n }", "private void shoot(GObject bottom, GObject bottomLeft, GObject topRight, GObject bottomRight, GObject topLeft) {\r\n\t\t//if(bullet == null && bottom != null && bottomLeft == null && topRight == null && bottomRight == null && topLeft == null) {\r\n\t\t\t{bullet = new GRect(BULLET_WIDTH, BULLET_HEIGHT);\r\n\t\t\tbullet.setFilled(true);\r\n\t\t\tbullet.setColor(Color.green);\r\n\t\t\tif(facingEast == true) {\r\n\t\t\t\tbulletVelocity = BULLET_SPEED;\r\n\t\t\t\tadd(bullet, player.getX() + player.getWidth() + 1, player.getY() + player.getHeight() * 3/5.0);\r\n\t\t\t} else {\r\n\t\t\t\tbulletVelocity = -BULLET_SPEED;\r\n\t\t\t\tadd(bullet, player.getX() - BULLET_WIDTH, player.getY() + player.getHeight() * 3/5.0);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void findShootedPlayer(UUID id) {\n\t\n\t\tif(healths.contains(id.toString()))\n\t\t\t{\n\t\t\t\thealths.put(id.toString(),healths.get(id.toString())-20);\n\t\t\t\tSystem.out.println(\"ghostEntity \"+id.toString() +\"was shooted\");\n\t\t\t\tif(healths.get(id.toString())<=0)\n\t\t\t\t{\n\t\t\t\t\thealths.put(id.toString(),100);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic void onEntityHit(LivingEntity ent) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onEntityHit(LivingEntity ent) {\n\t\t\r\n\t}", "public void shoot(){\r\n\t\tif(numberOfArrows>0){\r\n\t\t\tnumberOfArrows--;\r\n\t\t\tPosition positionWumpus = b.getWumpus().getPosition();\r\n\t\t\tif (position.checkShoot(positionWumpus))\r\n\t\t\t\tb.getWumpus().kill();\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"There are no more arrows.\");\r\n\t}", "boolean wasHit();", "@Override\n\tpublic void handleCollision(ICollider otherObject) {\n\t\tSystem.out.println(\"i hit a flame :(\");\n\t}", "public void checkForBounce()\n {\n if (isTouching(mid.class)){\n \n bounce = 1;\n \n \n }\n \n \n \n \n if (getY() <= 0 || getY() >= getWorld().getHeight() -1 )\n {\n \n dY = -dY;\n \n }\n \n \n if(isTouching(Pad1.class )){\n \n if (bounce == 1){\n \n \n Greenfoot.playSound(\"paddleHit.wav\"); \n dX = -dX;\n bounce = 0;\n change(); \n }\n \n \n }\n \n \n \n }", "void fire(WarParticipant target, WarParticipant attacker, int noOfShooters);", "@Override\r\n\tpublic void onThink() {\n\t\tint random = (shotsFired + 1) % 3 - 1;\r\n\t\tVacuumProjectile projectile = new VacuumProjectile(DAMAGE * this.owner.finalDamageOutputModifier, SPEED, this.owner.direction, Point.add(this.owner.gridLoc, new Point(0, random)), this.owner.teamID);\r\n\t\tthis.getMap().addGameElement(projectile);\r\n\t\tthis.shotsFired++;\r\n\t\tif(this.shotsFired >= NUM_SHOTS) {\r\n\t\t\tthis.finishSpell();\r\n\t\t}\r\n\t}", "void hitBall() {\n \n System.out.println(this.golfBall.vel_vector.x + \",\"\n + this.golfBall.vel_vector.y + \",\"\n + this.golfBall.acc_vector.x + \",\"\n + this.golfBall.acc_vector.y);\n \n if (this.golfBall.stopped) {\n new Sound(\"resources/hit.wav\").play();\n this.golfBall.stopped = false;\n this.golfBall.acc(this.strokeAcc.x, this.strokeAcc.y);\n this.strokes += 1;\n }\n \n }", "void ponderhit();", "@Override\r\n\tpublic void onEntityHit(LivingEntity ent) {\n\r\n\t}", "public void fireShot() {\n\t\tVector3 position = player.getPositionVector();\n\t\tVector3 rotation = player.getRotationVector();\n\t\tVector3 scale = player.getScaleVector();\n\t\tAsteroidsLaser laser = new AsteroidsLaser(GameObject.ROOT, this, rotation.z);\n\t\tlaser.translate(position);\n\t\tlaserShots.add(laser);\n\t}", "public void trackBullets(){\n // bossbullet control, if it hit the bound, remove the bullet\n for(int i = 0; i < bossBullets.size(); i++){\n Bullet tempBullet = bossBullets.get(i);\n tempBullet.update();\n tempBullet.drawBullet();\n // print (tempBullet.posX, tempBullet.posY,'\\n');\n if(tempBullet.detectBound()){\n bossBullets.remove(i);\n continue;\n }\n\n if(tempBullet.hitObject(Main.player) && !Main.player.invincible){\n Main.player.decreaseHealth(1);\n Main.player.posX = width / 2;\n Main.player.posY = height * 9 / 10;\n Main.player.invincible = true;\n Main.player.invincibleTime = millis();\n }\n\n }\n }", "public void hit() {\n if (explodeTime == 0) {\n if (isExplosive) {\n region = explodeAnimation.getKeyFrame(explodeTime, false);\n explodeTime += Gdx.graphics.getDeltaTime();\n width = region.getRegionWidth();\n height = region.getRegionHeight();\n position.sub(width / 2, height / 2);\n direction = new Vector2(1, 0);\n explosionSound.play();\n } else {\n impactSound.play();\n active = false;\n }\n }\n }", "@Override\n\tpublic void shoot(Plateau p) {\n\t\tif(!noMunition()) {\n\t\t\tuseMunition();\n\t\t\t//complete\n\t\t}\n\t\t\n\t}", "public void act ()\n {\n checkScroll();\n checkPlatform();\n checkXAxis();\n checkDeath();\n // get the current state of the mouse\n MouseInfo m = Greenfoot.getMouseInfo();\n // if the mouse is on the screen...\n if (m != null)\n {\n // if the mouse button was pressed\n if (Greenfoot.mousePressed(null))\n {\n // shoot\n player.shoot(m.getX(), m.getY());\n }\n }\n }", "public void shootBullet( ){\n bulletsFired.add(new Bullet((short)(this.xPos + BOX_HEIGHT), (short)((this.getYPos() + (BOX_HEIGHT+15))), this.xPos, this.id, (byte) 0, (byte) 0, shootingDirection, currentWeapon.getKey()));\n\n byte weaponFired = currentWeapon.getKey();\n switch (weaponFired){\n case PISTOL_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(DEFAULT_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.pistolSound);\n break;\n case MACHINEGUN_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(MACHINEGUN_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(MACHINEGUN_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case SHOTGUN_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(SHOTGUN_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(SHOTGUN_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.shotgunSound);\n break;\n case SNIPER_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(SNIPER_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(SNIPER_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case UZI_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(UZI_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(UZI_RANGE);\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.machineGunSound);\n break;\n case AI_WEAPON_ID: bulletsFired.get(bulletsFired.size()-1).setDmg(AI_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n System.out.println(\"Bullet sound \" + audioHandler.getSoundEffectVolume());\n audioHandler.updateSFXVolume(audioHandler.getSoundEffectVolume());\n audioHandler.playSoundEffect(audioHandler.pistolSound);\n break;\n default: bulletsFired.get(bulletsFired.size()-1).setDmg(DEFAULT_DMG);\n bulletsFired.get(bulletsFired.size()-1).setRange(DEFAULT_RANGE);\n\n }\n }", "@Override\r\n public void hitEvent(Block beingHit, Ball hitter) {\n this.currentScore.increase(5);\r\n if (beingHit.getHitPoints() == 1) {\r\n this.currentScore.increase(10);\r\n }\r\n }", "public void isShooting(GameContainer gc) throws LineUnavailableException{\r\n\t\tif(gc.getInput().isKeyPressed(Input.KEY_SPACE) || gc.getInput().isKeyPressed(Input.KEY_UP)){\r\n\t\t\tif(!this.bullet.isMoved()){\r\n\t\t\t\tthis.playSound();\r\n\t\t\t\tanimation = this.shooting;\r\n\t\t\t\tthis.bullet.position.x = super.getShape().getCenterX();\r\n\t\t\t\tthis.bullet.position.y = super.getShape().getCenterY();\r\n\t\t\t\tthis.getBullet().setMoved(true);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.getBullet().isMoved()){\r\n\t\t\tthis.bullet.move();\r\n\t\t}\r\n\t}", "void fire() {\r\n // firing a shot takes energy\r\n if (!expendEnergy(BULLET_ENERGY))\r\n return;\r\n\r\n //create a bullet object so it doesn't hit the ship that's firing it\r\n double xV = getXVel() + BULLET_SPEED * (Math.cos(orientation));\r\n double yV = getYVel() + BULLET_SPEED * (Math.sin(orientation));\r\n\r\n // create the actual bullet\r\n new Bullet(\r\n getGame(),\r\n (getXPos() + ((getSize()/2 + 2) * (Math.cos(orientation))) + xV),\r\n (getYPos() + ((getSize()/2 + 2) * (Math.sin(orientation))) + yV),\r\n xV,\r\n yV);\r\n }", "public boolean shoot() {\n if (!isReloading && System.currentTimeMillis() - previousShotTime > shootInterval * 1000 && ammoRemaining > 0) {\n\n previousShotTime = System.currentTimeMillis();\n\n ammoRemaining--;\n audioPlayer.setSpatial(holder);\n audioPlayer.playOnce();\n // score -= 50;\n Vec2 angle = Vec2\n .Vector2FromAngleInDegrees(transform.getGlobalRotation().getAngleInDegrees() - 90 + (Math.random() * spread * 2 - spread));\n\n Vec2 spawnPosition = transform.getWorldPosition();\n\n Projectile p = new Projectile(spawnPosition,\n Vec2\n .Vector2FromAngleInDegrees(\n transform.getGlobalRotation().getAngleInDegrees() - 90 + (Math.random() * spread * 2 - spread)),\n new Sprite(projectilePath));\n p.setSpeed(speed);\n p.setSource(holder);\n p.getCollider().addInteractionLayer(\"Block\");\n p.getCollider().addInteractionLayer(\"Hittable\");\n p.getCollider().addInteractionLayer(\"Walk\");\n p.setOnCollisionListener(other -> {\n if (other.getGameObject() instanceof Player && other.getGameObject() != holder) {\n Player player = (Player) other.getGameObject();\n player.hit(alteredDmg);\n if (GameEngine.DEBUG) {\n System.out.println(\"Bullet Hit \" + other.getName());\n }\n p.destroy();\n\n// player.destroy();\n } else if (other.getGameObject() instanceof Enemy) {\n Enemy e = ((Enemy) other.getGameObject());\n e.hit(alteredDmg);\n if (!e.isAlive()) { // CHeck if enemy survived\n ((Player) p.getSource()).killedEnemy();\n }\n p.destroy();\n } else if (other.getTag() == \"Block\") {\n p.destroy();\n }\n\n });\n return true;\n } else if(ammoRemaining <= 0){\n reloadWeapon();\n return false;\n }else\n return false;\n }", "void logShot(UUID shooter, UUID projectile);", "@Override\n\tpublic void processIngoingHit(Hit hit) {\n\t\tdamageReceived += hit.getDamage();\n\t}", "public void shoot(ArrayList<Bullet> alienBullets)\r\n\t{\r\n\t\t//do nothing usually\r\n\t}", "public void shoot() {\n _shooterMotor1.set(_targetRPM);\n }", "@Override\r\n public void onHit(int damage){\n if(box2body != null){\r\n hp -= damage;\r\n screen.getGameManager().get(\"Sounds/orc-34-hit.wav\", Sound.class).play();\r\n if(this.hp <= 0) {\r\n screen.bodiesToDelete.add(box2body);\r\n deleteFlag = true;\r\n screen.spawnedCreatures.remove(this);\r\n screen.getGameManager().get(\"Sounds/orc-32-death.wav\", Sound.class).play();\r\n\r\n //Award Experience\r\n screen.getPlayer().awardExperience(this.experienceValue);\r\n screen.getPlayer().increaseKillCount();\r\n }\r\n }\r\n //Attack player when damaged\r\n //Prevents player from sniping monsters using Wander AI\r\n if(currentState != State.ATTACKING){\r\n Vector2 orcPosition = new Vector2(box2body.getPosition().x, box2body.getPosition().y);\r\n Vector2 playerPosition = new Vector2(screen.getPlayer().box2body.getPosition().x, screen.getPlayer().box2body.getPosition().y);\r\n\r\n currentState = State.HASBEENATTACKED;\r\n velocity = new Vector2(playerPosition.x - orcPosition.x, playerPosition.y - orcPosition.y);\r\n box2body.setLinearVelocity(velocity.scl(speed));\r\n }\r\n }", "@Override\n\tpublic Bullet shoot(int hx, int hy) {\n\t\treturn null;\n\t}", "public void Fire()\n {\n Random random = new Random();\n int randNum = random.nextInt(limit);\n\n //Check to see if this bomb is dropped\n if(!owner.BehindInvader() && !this.Visible() && randNum == HIT_VAL)\n {\n //Set this bomb to visible\n this.Visible(true);\n this.PlaySound();\n this.x = this.owner.X();\n this.y = this.owner.Y();\n }\n\n //Check for collision with the defender\n if(Bomb.enemy.Visible() && this.Visible() && this.Collision(Bomb.enemy))\n {\n Bomb.enemy.Hit();\n this.Visible(false);\n }\n //Move the bomb down\n else if(this.Visible())\n {\n this.y++;\n\n //Check for collision with the floor\n if(this.y >= GameConstants.GROUND - this.imageHeight)\n {\n this.Visible(false);\n }\n //Check for collision with the barriers\n for(Barrier barrier : Bomb.barriers.Barriers())\n {\n for(BarrierBlock block : barrier.BarrierBlocks())\n {\n if(this.Collision(block))\n {\n block.Visible(false);\n //Removal could cause Comodification issue\n block.Damaged(true);\n this.Visible(false);\n //May not need this return\n return;\n }\n }\n }\n }\n }", "@Override\n\tpublic void didContact(GameEntity entity){\n\t\tif (entity.getClass() == Enemy.class){\n\n\t\t\tentity.receiveDamage(100);\n\t\t\tthis.receiveDamage(10);\n\t\t\tSystem.out.println(\"hit enemy\");\n\t\t}\n\t}", "public boolean isShooting()\r\n\t{\r\n\t\treturn false;\r\n\t}", "private void fire(GameEngine gameEngine) {\n Bullet bullet1 = gameEngine.getBulletEnemy();\n if (bullet1 == null) {\n return;\n }\n bullet1.init(this, positionX + imageWidth/2, positionY, 0);\n gameEngine.addGameObject(bullet1);\n gameEngine.playSound(1);\n }", "private boolean shootAt(Enemy enemy) {\n if (nextAttack == 0) {\n enemy.setHealth(enemy.getHealth() - tower.getDamage());\n shotEnemy = enemy;\n return true;\n }\n return false;\n }", "private void attackPlayer()\n\t{\n\t\tif(shootTimer.done())\n\t\t{\n\t\t\tProjectile spiderWeb = new SpiderWeb(x, y);\n\t\t\tGame.objectWaitingRoom.add(spiderWeb);\n\t\t\tspiderWeb.shoot();\n\t\t\tshootTimer.setTime(200);\n\t\t}\n\t}", "public void shootIntoCargoShip(){\n shoot.set(SHIP_SHOOT);\n }", "public void shootGun() {\n\t\tammo--;\n\t}", "public void collisionEvent(Bludger bludger) {\r\n if (getPossessionStatus()) {\r\n dropQuaffle();\r\n }\r\n super.collisionEvent(bludger);\r\n\r\n stun();\r\n }", "public void trackAndFire() {\n \t \tdouble theta;\n double distanciaObjetivo = myPos.distance(objetivo.pos);\n //Hallar el proximo punto en un perímetro definido\n \t\t//(30,30) elimina bordes y despues el -60 para la longitud de los dados\n Rectangle2D.Double perimetro = new Rectangle2D.Double(30, 30, getBattleFieldWidth() - 60, getBattleFieldHeight() - 60);\n \n \n \n //if my cannon is locked and ready and i got some energy left fire with\n //appropiate energy to not get stuck, fire in the execute rather than now\n \n if(getGunTurnRemaining() == 0 && myEnergy > 1) {\n setFire( Math.min(Math.min(myEnergy/6.0, 1000/distanciaObjetivo), objetivo.energy/3.0) );\n }\n \n //any other case, ill get aim lock with this function\n //normalize sets between pi -pi\n setTurnGunRightRadians(Utils.normalRelativeAngle(angulo(objetivo.pos, myPos) - getGunHeadingRadians()));\n \n\n double distNextPunto = myPos.distance(futurePos);\n \n \n if(distNextPunto > 20) {\n \t//aun estamos lejos\n \n \t\t\n \t\t//theta es el angulo que hemos de cortar para ponernos \"encarando\" bien\n theta = angulo(futurePos, myPos) - getHeadingRadians();\n \n \n double sentido = 1;\n \n if(Math.cos(theta) < 0) {\n theta += Math.PI;\n sentido = -1;\n }\n \n setAhead(distNextPunto * sentido);\n theta = Utils.normalRelativeAngle(theta);\n setTurnRightRadians(theta);\n \n if(theta > 1)setMaxVelocity(0.0);\n else setMaxVelocity(8.0); // max\n \n \t\n \n } else {\n \t //ENTRO AQUI SI ME QUEDA POCO PARA LLEGAR, SMOOTH CORNERING\n\n \t\t\n //probar 1000 coordenadas\n int iterNum = 1000;\n Point2D.Double cand;\n for(int i =0; i < iterNum; i++){\n \n //i dont want it to be close to another bot, thats the meaning of distanciaObjetivo*0.8\n cand = hallarPunto(myPos, Math.min(distanciaObjetivo*0.8, 100 + iterNum*Math.random()), 2*Math.PI*Math.random());\n if(perimetro.contains(cand) && evalHeuristic(cand) < evalHeuristic(futurePos)) {\n futurePos = cand;\n }\n \n \n } \n \n prevPos = myPos;\n \n }\n }", "@Override\r\n\tpublic void tick(){\n\t\tif(!alert){\r\n\t\t\tif(hostileToPlayer&&closeEnoughToAlert(World.player))\r\n\t\t\t\t{alert=true;target=World.player;}\r\n\t\t}\r\n\t\t\r\n\t\tif(alert&&null!=target){\r\n\t\t\t//For now, advance towards the player\r\n\t\t\tPathfinder.moveTowards(this, target);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//If within attacking range but not yet attacking, and not stunned, do so.\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public void hit() throws CellPlayedException{\r\n if(!hit){\r\n this.hit = true;\r\n if(ship != null){\r\n ship.hit();\r\n }\r\n }else{\r\n throw new CellPlayedException(row, column);\r\n }\r\n }", "public void fireBullet(){\n\t\tBullet bullet = new Bullet(ship);\n\t\tbullets.add(bullet);\n\t\tsoundMan.playBulletSound();\n\t}" ]
[ "0.7552979", "0.73623794", "0.73623794", "0.73553425", "0.7004215", "0.6885554", "0.6876932", "0.6876932", "0.6863094", "0.6786361", "0.6770162", "0.6716397", "0.66803575", "0.66603196", "0.6611647", "0.65619606", "0.65274507", "0.6522705", "0.6483393", "0.64699084", "0.64614314", "0.6384048", "0.637042", "0.6365536", "0.63374287", "0.633657", "0.6324986", "0.6324186", "0.6301184", "0.629834", "0.6275141", "0.62641376", "0.6258952", "0.6254584", "0.6250016", "0.624962", "0.6248329", "0.6233555", "0.6226907", "0.6222339", "0.6214247", "0.619988", "0.619988", "0.61864775", "0.61818194", "0.61753225", "0.617443", "0.6172707", "0.6169064", "0.6166265", "0.61626786", "0.61614573", "0.61578166", "0.6157657", "0.61566347", "0.6153272", "0.6152373", "0.61509734", "0.61458087", "0.61420083", "0.6138236", "0.6138236", "0.6127108", "0.612611", "0.61221915", "0.61133075", "0.6108392", "0.6104051", "0.6099919", "0.6071676", "0.60704386", "0.6069126", "0.60680634", "0.60649854", "0.6064474", "0.6059867", "0.6058754", "0.60564476", "0.6049071", "0.6047401", "0.60468435", "0.60429716", "0.60393476", "0.6030202", "0.6027981", "0.6026335", "0.601161", "0.60086286", "0.60055244", "0.60007536", "0.59958094", "0.5991327", "0.59905744", "0.59870654", "0.59860545", "0.598158", "0.5971552", "0.5969836", "0.59690577", "0.5968513" ]
0.68419814
9
If you made any guesses, you will find out the true species of those birds through this function.
public void reveal(GameState pState, int[] pSpecies, Deadline pDue) { int score = 0; boolean[] newObs = {false, false, false, false, false, false}; for (int i = 0; i < pSpecies.length; i++) { int currentSpecies = pSpecies[i]; if (currentSpecies == guess[i]) { score++; } System.err.println("Bird num " + i + " : " + speciesName(currentSpecies)); Bird currentBird = pState.getBird(i); for (int j = 0; j < currentBird.getSeqLength(); j++) { if (currentBird.wasAlive(j)) { newObs[currentSpecies] = true; listObs.get(currentSpecies).add(currentBird.getObservation(j)); } } } for (int i = 0; i < nbSpecies; i++) { int size = listObs.get(i).size(); if (size >= 70 && newObs[i] && size <= 1000) { double[][] observationsMatrix = new double[size][1]; for (int z = 0; z < size; z++) { observationsMatrix[z][0] = listObs.get(i).get(z); } int nbStates; int nbIterations = 50; if (size <= 100) { nbStates = 2; } else if (size <= 300) { nbStates = 3; } else { nbStates = 4; } HMMOfBirdSpecies newHMMOfBirdSpecies = new HMMOfBirdSpecies(transitionMatrixInit(nbStates), emissionMatrixInit(nbStates, nbTypesObservations), piMatrixInit(nbStates)); newHMMOfBirdSpecies.BaumWelchAlgorithm(observationsMatrix, nbIterations); newHMMOfBirdSpecies.setTrained(true); listHMM[i] = newHMMOfBirdSpecies; } } System.err.println("Result : " + score + "/" + pSpecies.length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int[] guess(GameState pState, Deadline pDue) {\n /*\n * Here you should write your clever algorithms to guess the species of\n * each bird. This skeleton makes no guesses, better safe than sorry!\n */\n\n double logProb;\n int[] lguess = new int[pState.getNumBirds()];\n int species;\n\n for (int i = 0; i < pState.getNumBirds(); ++i) {\n species = -1;\n logProb = Double.NEGATIVE_INFINITY;\n Bird currentBird = pState.getBird(i);\n\n double[][] observations = new double[currentBird.getSeqLength()][1];\n for (int j = 0; j < currentBird.getSeqLength(); j++) {\n if (currentBird.wasAlive(j)) {\n observations[j][0] = currentBird.getObservation(j);\n }\n }\n\n for (int j = 0; j < nbSpecies; j++) {\n if (listHMM[j] != null) {\n HMMOfBirdSpecies currentHMM = listHMM[j];\n double newLogProb = currentHMM.SequenceLikelihood(observations);\n // System.err.println(\"Species \" + speciesName(j) + \" Prob = \" + newLogProb);\n if (newLogProb > logProb) {\n logProb = newLogProb;\n species = j;\n }\n }\n\n }\n\n if (species == -1 || logProb < - 200) {\n for (int k = 0; k < nbSpecies; k++) {\n if (listHMM[k] == null) {\n species = k;\n logProb = Double.NEGATIVE_INFINITY;\n break;\n }\n }\n }\n\n System.err.println(\"Estimation for Bird number \" + i + \" \" + speciesName(species) + \" with p :\" + logProb);\n lguess[i] = species;\n\n }\n guess = lguess.clone();\n return lguess;\n }", "public int[] guess(GameState pState, Deadline pDue) {\n /*\n * Here you should write your clever algorithms to guess the species of\n * each bird. This skeleton makes no guesses, better safe than sorry!\n */\n int[] lGuess = new int[pState.getNumBirds()];\n for (int i = 0; i < pState.getNumBirds(); i++) {\n int specie = 0;\n double maxVal = -100000000;\n Bird b = pState.getBird(i);\n int[] obsSeq = getBirdSeqUntilDeath(b);\n if (obsSeq.length == 0) {\n lGuess[i] = Constants.SPECIES_UNKNOWN;\n continue;\n }\n for (BirdModel birdModel : birdModelGuesses.values()) {\n// System.err.println(\"birdtype: \" + birdModel.birdType);\n double prob = birdModel.model.logProbForObsSeq(obsSeq);\n if (prob > maxVal) {\n maxVal = prob;\n specie = birdModel.birdType;\n }\n }\n// System.err.println(\"MAXVAL: \" + maxVal);\n lGuess[i] = specie;\n }\n\n return lGuess;\n }", "public static boolean [][] breedChoice (Species [][] map, int x, int y, int plantHealth) {\n // First int: direction\n // Second int: sheep or wolf\n boolean [][] breeding = {\n {false, false},\n {false, false},\n {false, false},\n {false, false},\n };\n \n // Check null pointer exceptions\n if (map[y][x] != null) {\n\n // Breed sheep\n if ((map[y][x] instanceof Sheep) && (y > 0) && (map[y-1][x] instanceof Sheep)) {\n if ((((Sheep)map[y][x]).getGender() != ((Sheep)map[y-1][x]).getGender()) && (map[y][x].getHealth() > 20) && (map[y-1][x].getHealth() > 20) && (((Sheep)map[y][x]).getAge() > 5) && (((Sheep)map[y-1][x]).getAge() > 5)) {\n breeding[0][0] = true;\n }\n } else if ((map[y][x] instanceof Sheep) && (y < map[0].length - 2) && (map[y+1][x] instanceof Sheep)) {\n if ((((Sheep)map[y][x]).getGender() != ((Sheep)map[y+1][x]).getGender()) && (map[y][x].getHealth() > 20) && (map[y+1][x].getHealth() > 20) && (((Sheep)map[y][x]).getAge() > 5) && (((Sheep)map[y+1][x]).getAge() > 5)) {\n breeding[1][0] = true;\n }\n } else if ((map[y][x] instanceof Sheep) && (x > 0) && (map[y][x-1] instanceof Sheep)) {\n if ((((Sheep)map[y][x]).getGender() != ((Sheep)map[y][x-1]).getGender()) && (map[y][x].getHealth() > 20) && (map[y][x-1].getHealth() > 20) && (((Sheep)map[y][x]).getAge() > 5) && (((Sheep)map[y][x-1]).getAge() > 5)) {\n breeding[2][0] = true;\n }\n } else if ((map[y][x] instanceof Sheep) && (x < map.length - 2) && (map[y][x+1] instanceof Sheep)) {\n if ((((Sheep)map[y][x]).getGender() != ((Sheep)map[y][x+1]).getGender()) && (map[y][x].getHealth() > 20) && (map[y][x+1].getHealth() > 20) && (((Sheep)map[y][x]).getAge() > 5) && (((Sheep)map[y][x+1]).getAge() > 5)) {\n breeding[3][0] = true;\n }\n \n // Breed wolves\n } else if ((map[y][x] instanceof Wolf) && (y > 0) && (map[y-1][x] instanceof Wolf)) {\n if ((((Wolf)map[y][x]).getGender() != ((Wolf)map[y-1][x]).getGender()) && (map[y][x].getHealth() > 20) && (map[y-1][x].getHealth() > 20) && (((Wolf)map[y][x]).getAge() > 5) && (((Wolf)map[y-1][x]).getAge() > 5)) {\n breeding[0][1] = true;\n }\n } else if ((map[y][x] instanceof Wolf) && (y < map[0].length - 2) && (map[y+1][x] instanceof Wolf)) {\n if ((((Wolf)map[y][x]).getGender() != ((Wolf)map[y+1][x]).getGender()) && (map[y][x].getHealth() > 20) && (map[y+1][x].getHealth() > 20) && (((Wolf)map[y][x]).getAge() > 5) && (((Wolf)map[y+1][x]).getAge() > 5)) {\n breeding[1][1] = true;\n }\n } else if ((map[y][x] instanceof Wolf) && (x > 0) && (map[y][x-1] instanceof Wolf)) {\n if ((((Wolf)map[y][x]).getGender() != ((Wolf)map[y][x-1]).getGender()) && (map[y][x].getHealth() > 20) && (map[y][x-1].getHealth() > 20) && (((Wolf)map[y][x]).getAge() > 5) && (((Wolf)map[y][x-1]).getAge() > 5)) {\n breeding[2][1] = true;\n }\n } else if ((map[y][x] instanceof Wolf) && (x < map.length - 2) && (map[y][x+1] instanceof Wolf)) {\n if ((((Wolf)map[y][x]).getGender() != ((Wolf)map[y][x+1]).getGender()) && (map[y][x].getHealth() > 20) && (map[y][x+1].getHealth() > 20) && (((Wolf)map[y][x]).getAge() > 5) && (((Wolf)map[y][x+1]).getAge() > 5)) {\n breeding[3][1] = true;\n }\n }\n \n }\n return breeding;\n }", "public static void reproduce (Species [][] map, int sheepHealth, int wolfHealth, int plantHealth) {\n \n // Place the baby\n int babyY, babyX;\n \n // Check if the baby has been placed\n int spawned = 0;\n \n for (int y = 0; y < map[0].length; y++){\n for (int x = 0; x < map.length; x++){\n \n boolean [][] breeding = breedChoice (map, x, y, plantHealth);\n \n // Sheep upwards to breed with\n if (breeding[0][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y-1][x]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep downwards to breed with\n } else if (breeding[1][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y+1][x]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep to the left to breed with\n } else if (breeding[2][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y][x-1]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Sheep to the right to breed with\n } else if (breeding[3][0]) {\n ((Sheep)map[y][x]).reproduceHealthLost(10);\n ((Sheep)map[y][x+1]).reproduceHealthLost(10);\n \n // Make baby sheep\n Sheep sheep = new Sheep(sheepHealth, x, y);\n \n // Place the baby sheep\n do {\n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = sheep;\n spawned = 1;\n }\n } while (spawned == 0);\n \n // Wolf upwards to breed with\n } else if (breeding[0][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y-1][x]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf downwards to breed with\n } else if (breeding[1][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y+1][x]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf to the left to breed with\n } else if (breeding[2][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y][x-1]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n // Wolf to the right to breed with\n } else if (breeding[3][1]) {\n ((Wolf)map[y][x]).reproduceHealthLost(10);\n ((Wolf)map[y][x+1]).reproduceHealthLost(10);\n \n // Make baby wolf\n Wolf wolf = new Wolf(wolfHealth, x, y);\n \n // Place the baby wolf\n do { \n babyY = (int)(Math.random() * map.length);\n babyX = (int)(Math.random() * map.length);\n if (map[babyY][babyX] == null) {\n map[babyY][babyX] = wolf;\n spawned = 1; \n }\n } while (spawned == 0);\n \n }\n \n }\n }\n \n }", "public ArrayList<Cell> findPlacesToGiveBirth() {\r\n\r\n // Randomly choose the number of babies.\r\n int numOfBabyToBeBorn = new Random().nextInt(this.numOfBaby()) + 1;\r\n\r\n ArrayList<Cell> newEmpty = this.getNeighbours(1);\r\n Collections.shuffle(newEmpty);\r\n\r\n ArrayList<Cell> placeToBeBorn = new ArrayList<Cell>();\r\n\r\n int countEmptyCell = 0;\r\n\r\n for (int findEmpt = 0; findEmpt < newEmpty.size()\r\n && countEmptyCell < numOfBabyToBeBorn; findEmpt++, countEmptyCell++) {\r\n if (newEmpty.get(findEmpt).getInhabit() == null \r\n && isTerrainAccessiable(newEmpty.get(findEmpt))) {\r\n placeToBeBorn.add(newEmpty.get(findEmpt));\r\n }\r\n }\r\n return placeToBeBorn;\r\n }", "public Animal findAnimalZoo(String species) {\n for (int i = 0; i < numRegions; i++) {\n Animal[] temp = regionList[i].getRegionAnimals(); //regionList[i].getAnimalList(); @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ NO GETANIMALIST METHOD YET@@@@@@@@@@@@@@@@@@@@@@@@@\n for (int j = 0; j < regionList[i].getRegionSpec().getNumAnimals(); j++) {\n if (temp[j].getSpecies().equals(species)) {\n return temp[i]; \n }\n }\n }\n return null;\n }", "public void reveal(GameState pState, int[] pSpecies, Deadline pDue) {\n for (int i = 0; i < pSpecies.length; i++) {\n if (pDue.remainingMs() < timeBreak)\n break;\n int birdType = pSpecies[i];\n if (birdType == Constants.SPECIES_UNKNOWN)\n continue;\n\n BirdModel bm = birdModelGuesses.get(birdType);\n Bird bird = pState.getBird(i);\n int[] obsSeq = getBirdSeqUntilDeath(bird);\n if (bm == null) {\n birdModelGuesses.put(birdType, new BirdModel(birdType));\n }\n birdModelGuesses.get(birdType).addSequence(obsSeq);\n// System.err.println(\"Bird \" + i + \" is of specie \" + pSpecies[i]);\n }\n\n\n //Räkna Baum welch\n for(BirdModel bm : birdModelGuesses.values()) {\n if (pDue.remainingMs() < timeBreak)\n break;\n int seqCount = bm.savedSequences.size();\n if (seqCount > 0) {\n// int[][] obsSeqs = bm.savedSequences.toArray(new int[seqCount][timePeriod]);\n\n BaumWelch bw = new BaumWelch(bm.model, bm.savedSequences);\n bw.run();\n// bm.emptySavedSequences();\n }\n }\n t=0;\n }", "public void magic(){\n //no joke, this is literally what I named the method last year\n Student previous = this.students.get(0);\n for (Species s2:this.species) s2.getStudents().clear();\n for (Student s:this.students) {\n boolean notFoundSpecies = true;\n for (Species species:this.species) {\n if(species.sameSpecies(s.getBrain())){\n species.addStudent(s);\n notFoundSpecies = false;\n break;\n }\n }\n if(notFoundSpecies) this.species.add(new Species(s));\n }\n this.students.sort(Comparator.comparingDouble(Student::getScore).reversed());\n this.species.forEach(Species::sort);\n this.species.sort(Comparator.comparingDouble(Species::getBestScore).reversed());\n ArrayList<Species> speciesArrayList = this.species;\n for (int i = 0; i < speciesArrayList.size(); i++) {\n System.out.print(\"Species \" + i + \" Score: \" + speciesArrayList.get(i).getBestScore() + \" \");\n }\n System.out.println();\n\n if(Config.printGenerationScores) {\n System.out.print(\"bar [\");\n for (Species species : this.species)\n for (Student s2 : species.getStudents()) System.out.print(s2.getScore() + \", \");\n System.out.println(\"]\");\n System.out.print(\"foobar [\");\n for (Student student : this.students) System.out.print(student.getScore() + \", \");\n System.out.println(\"]\");\n System.out.print(\"foo [\");\n this.species.forEach(s -> System.out.print(s.getBestScore() + \", \"));\n System.out.print(\"]\");\n }\n\n if(this.killThemAll){\n while(5 < this.species.size()){\n this.species.remove(5);\n }\n this.killThemAll = false;\n System.out.println(\"Extinction Complete\");\n }\n for (Species s:this.species) {\n s.eliminate();\n s.shareScore();\n s.setAverage();\n }\n\n Student temp = this.species.get(0).getStudents().get(0);\n temp.setGen(this.gen);\n if(temp.getScore() >= this.bestScore){\n //Here it is! The beholden, the stupid, the idiotic, player #0\n //its alive!\n //temp.getPlayer().getComponent(PlayerComponent.class).setDead(false);\n //temp = temp.duplicate(temp.getPlayer());\n System.out.printf(\"Old Best: %f New Best: %f\", this.bestScore, temp.getScore());\n this.bestScore = temp.getScore();\n temp.getBrain().saveNetwork();\n }\n System.out.println();\n int i = 2;\n while(i < this.species.size()){\n if(this.species.get(i).getNoChange() >= 15){\n this.species.remove(i);\n i -= 1;\n }\n i += 1;\n }\n System.out.printf(\"Generation: %d Number of Changes: %d Number of Species: %d\\n\",\n this.gen, this.innovationHistory.size(), this.species.size());\n //very convenient and hopefully not slower\n double avgSum = this.species.stream().mapToDouble(Species::getBestScore).sum();\n ArrayList<Student> kids = new ArrayList<>();\n for (Species s:this.species) {\n kids.add(s.getChamp().duplicate(s.getChamp().getPlayer()));\n int studentNumber = (int)(Math.floor(s.getAverage() / avgSum * this.students.size()) - 1);\n for (int j = 0; j < studentNumber; j++) {\n kids.add(s.newStudent(this.innovationHistory));\n }\n }\n if(kids.size() < this.students.size()) kids.add(previous.duplicate(previous.getPlayer()));\n while(kids.size() < this.students.size()) kids.add(this.species.get(0).newStudent(this.innovationHistory));\n this.students = new ArrayList<>(kids);\n this.gen++;\n for (Student s:this.students) {\n s.getBrain().generateNetwork();\n }\n }", "private void fetchUnknownBirdsNames(Session session) {\n QAQCMain.log.info(\"Getting the birds with unknown name\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.speciesName, species.site.siteCode from Species as species \"\n + \"where not exists (from RefBirds as ref where ref.refBirdsName like species.speciesName) \"\n + \"and species.speciesGroup like 'B'\"\n + \"order by species.speciesName ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n Object[] columnNames = {\"Site\", \"Birds Name\"};\n model.setColumnIdentifiers(columnNames);\n updateNumResults(i);\n }", "public Population breedPopulation(EvolutionState state)\r\n {\n if( previousPopulation != null )\r\n {\r\n if( previousPopulation.subpops.length != state.population.subpops.length )\r\n state.output.fatal( \"The current population should have the same number of subpopulations as the previous population.\" );\r\n for( int i = 0 ; i < previousPopulation.subpops.length ; i++ )\r\n {\r\n if( state.population.subpops[i].individuals.length != previousPopulation.subpops[i].individuals.length )\r\n state.output.fatal( \"Subpopulation \" + i + \" should have the same number of individuals in all generations.\" );\r\n for( int j = 0 ; j < state.population.subpops[i].individuals.length ; j++ )\r\n if( previousPopulation.subpops[i].individuals[j].fitness.betterThan( state.population.subpops[i].individuals[j].fitness ) )\r\n state.population.subpops[i].individuals[j] = previousPopulation.subpops[i].individuals[j];\r\n }\r\n previousPopulation = null;\r\n }\r\n\r\n // prepare the breeder (some global statistics might need to be computed here)\r\n prepareDEBreeder(state);\r\n\r\n // create the new population\r\n Population newpop = (Population) state.population.emptyClone();\r\n\r\n // breed the children\r\n for( int subpop = 0 ; subpop < state.population.subpops.length ; subpop++ )\r\n {\r\n if (state.population.subpops[subpop].individuals.length < 4) // Magic number, sorry. createIndividual() requires at least 4 individuals in the pop\r\n state.output.fatal(\"Subpopulation \" + subpop + \" has fewer than four individuals, and so cannot be used with DEBreeder.\");\r\n \r\n Individual[] inds = state.population.subpops[subpop].individuals;\r\n for( int i = 0 ; i < inds.length ; i++ )\r\n {\r\n newpop.subpops[subpop].individuals[i] = createIndividual( state, subpop, inds, i, 0); // unthreaded for now\r\n }\r\n }\r\n\r\n // store the current population for competition with the new children\r\n previousPopulation = state.population;\r\n return newpop;\r\n }", "@Override\n\tpublic String getSpecies() {\n\t\treturn \"homo sapien\";\n\t}", "protected String getSpecies() {\n\t\treturn species;\n\t}", "protected void DoOneGibbsSample(){\n\t\t//this array is the array of trees for this given sample\n\t\tfinal bartMachineTreeNode[] bart_trees = new bartMachineTreeNode[num_trees];\t\t\t\t\n\t\tfinal TreeArrayIllustration tree_array_illustration = new TreeArrayIllustration(gibbs_sample_num, unique_name);\n\n\t\t//we cycle over each tree and update it according to formulas 15, 16 on p274\n\t\tdouble[] R_j = new double[n];\n\t\tfor (int t = 0; t < num_trees; t++){\n\t\t\tif (verbose){\n\t\t\t\tGibbsSampleDebugMessage(t);\n\t\t\t}\n\t\t\tR_j = SampleTree(gibbs_sample_num, t, bart_trees, tree_array_illustration);\n\t\t\tSampleMusWrapper(gibbs_sample_num, t);\t\t\t\t\n\t\t}\n\t\t//now we have the last residual vector which we pass on to sample sigsq\n\t\tSampleSigsq(gibbs_sample_num, getResidualsFromFullSumModel(gibbs_sample_num, R_j));\n\t\tif (tree_illust){\n\t\t\tillustrate(tree_array_illustration);\n\t\t}\n\t}", "public static void breedAll() {\n int a, b; //Pointers to select parents\n\n //While loop to ensure full carrying capacity of population\n while (Population.size() <= maxPop) {\n //Sorts by Fitness level first\n sortByFitlvl();\n\n //Selects Two Random Parents\n a = (int) (Math.abs(Utilities.sharpGauss(4)) * Population.size());\n b = (int) (Math.abs(Utilities.sharpGauss(4)) * Population.size());\n //System.out.println(a+\"\\t\"+b+\"\\t\"+Population.size());\n\n // Between 1-2 children\n int children = rand.nextInt(2)+1;\n for (int i = 0; i < children; i++) {\n Population.add(Breeder.breed(Population.get(a), Population.get(b), 0.1));\n }\n\n //sortByFitlvl();\n }\n\n if (debug)\n printPopulation(true);\n }", "public List<Bear> solvedBears() {\n // TODO: Fix me.\n return this.bear;\n }", "private void fetchUnknownBirdsCodes(Session session) {\n QAQCMain.log.info(\"Getting the birds with unknown code\");\n DefaultTableModel model = (DefaultTableModel) tabDisplaySites.getModel();\n String hql = \"select species.speciesCode, species.site.siteCode from Species as species \"\n + \"where not exists (from RefBirds as ref where ref.refBirdsCode like species.speciesCode) \"\n + \"and species.speciesGroup like 'B'\"\n + \"order by species.speciesCode ASC\";\n Query q = session.createQuery(hql);\n Iterator itr = q.iterate();\n int i = 0;\n while (itr.hasNext()) {\n Object[] tabRes = (Object[]) itr.next();\n Object[] tuple = {tabRes[1], tabRes[0]};\n model.insertRow(i, tuple);\n i++;\n }\n Object[] columnNames = {\"Site\", \"Birds Code\"};\n model.setColumnIdentifiers(columnNames);\n updateNumResults(i);\n }", "private boolean isFound(int remaingingMarbles) {\n\n return (Math.log(remaingingMarbles) / Math.log(2)) % 1 == 0 ;\n\n }", "public static int [] population() {\n \n // Declare int array containing plants, sheep, wolves population, and number of turns respectively\n int [] numCounter = new int [] {0, 0, 0, 0};\n \n // Check map for species\n for (int y = 0; y < map[0].length; y++) {\n for (int x = 0; x < map.length; x++) {\n \n // Find the number of plants and add one to the count each time a plant is found\n if (map[y][x] instanceof Plant) {\n numCounter[0] += 1;\n \n // Find the number of sheep and add one to the count each time a sheep is found\n } else if (map[y][x] instanceof Sheep) {\n numCounter[1] += 1;\n \n // Find the number of wolves and add one to the count each time a wolf is found\n } else if (map[y][x] instanceof Wolf) {\n numCounter[2] += 1;\n }\n \n }\n }\n \n // Add a turn\n numCounter[3] += 1;\n \n // Return the int array with population of each species\n return numCounter;\n \n }", "private Cell getSnowballTarget() {\n Cell[][] blocks = gameState.map;\n int mostWormInRange = 0;\n Cell chosenCell = null;\n\n for (int i = currentWorm.position.x - 5; i <= currentWorm.position.x + 5; i++) {\n for (int j = currentWorm.position.y - 5; j <= currentWorm.position.y + 5; j++) {\n if (isValidCoordinate(i, j)\n && euclideanDistance(i, j, currentWorm.position.x, currentWorm.position.y) <= 5) {\n List<Cell> affectedCells = getSurroundingCells(i, j);\n affectedCells.add(blocks[j][i]);\n int wormInRange = 0;\n for (Cell cell : affectedCells) {\n for (Worm enemyWorm : opponent.worms) {\n if (enemyWorm.position.x == cell.x && enemyWorm.position.y == cell.y\n && enemyWorm.roundsUntilUnfrozen == 0 && enemyWorm.health > 0)\n wormInRange++;\n }\n for (Worm myWorm : player.worms) {\n if (myWorm.position.x == cell.x && myWorm.position.y == cell.y && myWorm.health > 0)\n wormInRange = -5;\n }\n }\n if (wormInRange > mostWormInRange) {\n mostWormInRange = wormInRange;\n chosenCell = blocks[j][i];\n }\n }\n }\n }\n\n return chosenCell;\n }", "@Override\r\n\tpublic Code nextGuess() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tRandom randGen = new Random();\r\n\t\tCode newCode;\r\n\t\t\r\n\t\tArrayList<String> values;\r\n\t\twhile(true)\r\n\t\t{values = new ArrayList<String>();\r\n\t\tfor (int i = 0; i < super.getNumVars(); i++)\r\n\t\t{\r\n\t\t\tint colorIndex = randGen.nextInt((super.getColorList().size()));\r\n\t\t\tvalues.add(super.getColorList().get(colorIndex));\r\n\t\t}\r\n\t\t\r\n\t\tnewCode = new Code(super.getNumVars());\r\n\t\t\r\n\t\tfor (int i = 0; i < values.size(); i++)\r\n\t\t{\r\n\t\t\tnewCode.addEntry(values.get(i));\r\n\t\t}\r\n\t\t//contains method for code\r\n\t\t\r\n\t\tboolean shouldBreak=true;//(guessHistory.size()==0?true:false);\r\n\t\tfor(int i=0,totalequal=0;i<guessHistory.size();++i,totalequal=0)\r\n\t\t{\r\n\t\t\tCode itrHistory=guessHistory.get(i);\r\n\t\t\tfor(int j=0;j<super.getNumVars();++j)\r\n\t\t\tif(newCode.colorAt(j).equals(itrHistory.colorAt(j)))\r\n\t\t\t\t\ttotalequal++;\r\n\t\t\t\t\r\n\t\t\tif(totalequal==super.getNumVars())\r\n\t\t\t\tshouldBreak=false;\r\n\t\t\t\r\n\t\t}\r\n\t\tif(shouldBreak)\r\n\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tguessHistory.add(newCode);\r\n\t\treturn newCode;\r\n\t}", "private void doQualitativeSpecies(QualitativeModel qualModel)\n \t{\n \t\tfor (QualitativeSpecies qs : qualModel.getListOfQualitativeSpecies())\n \t\t{\n \t\t\t//\t\t\tPathwayElement pelt = createOrGetSpecies(qs.getId(), xco, yco, GlyphClazz.BIOLOGICAL_ACTIVITY);\n \t\t\tPathwayElement pelt = SbgnTemplates.createGlyph(GlyphClazz.BIOLOGICAL_ACTIVITY, pwy, xco, yco);\n \t\t\tpelt.setGraphId(qs.getId());\n \t\t\tpelt.setTextLabel(qs.getName());\n \n \t\t\tList<String> t = qs.filterCVTerms(CVTerm.Qualifier.BQB_IS, \"miriam\");\n \t\t\tif (t.size() > 0)\n \t\t\t{\n \t\t\t\tXref ref = Xref.fromUrn(t.get(0));\n \t\t\t\tif (ref == null)\n \t\t\t\t{\n \t\t\t\t\tSystem.out.println (\"WARNING: couldn't convert \" + t.get(0) + \" to Xref\");\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tpelt.setGeneID(ref.getId());\n \t\t\t\t\tpelt.setDataSource(ref.getDataSource());\n \t\t\t\t}\n \t\t\t}\n \n \t\t\tpwy.add(pelt);\n \n \t\t\tnextLocation();\n \t\t}\n \t}", "public static void main(String[] args) {\n System.out.println(\"Implementation 1: Using arrays\");\n Bird[] birds = new Bird[6]; // new empty Bird[]\n\n for(int i = 0; i < birds.length; i++) {\n // Code to randomly fill birds[i] with either a BlackBird or an Emu\n // This will produce a random number of type double between 0 and 1,\n // then it will round it to the nearest value and cast it to an integer value.\n int randomNumber = (int) Math.round(Math.random());\n // Value 0 for BlackBirds\n if (randomNumber == 0) {\n birds[i] = new BlackBird();\n } else { // Value 1 for Emus\n birds[i] = new Emu();\n }\n // Call to the sings() method of the superclass\n System.out.println(birds[i].getName() + \" can sing?: \" + birds[i].sings());\n // A polymorphic call to the sing() method\n birds[i].sing();\n if (birds[i] instanceof FlyingBird) {\n // Downcast a Bird object to a FlyingBird object\n System.out.println(birds[i].getName() + \" can fly?: \" + ((FlyingBird) birds[i]).flys());\n }\n }\n\n /** Implementation 2: Using any List implementation for the Bird instances\n * Note: Only code repeated here for simplicity of the implementation\n * (don't need to create additional methods for the main class) */\n System.out.println(\"--------------------------------------\");\n System.out.println(\"Implementation 2: Using List implementation\");\n\n List<Bird> birdsList = new ArrayList<Bird>();\n // Code to randomly fill birdsList with either a BlackBird or an Emu\n int aRandomNumber = (int) Math.round(Math.random());\n // Value 0 for BlackBirds\n if (aRandomNumber == 0) {\n birdsList.add(new BlackBird());\n } else { // Value 1 for Emus\n birdsList.add(new Emu());\n }\n for (Bird bird : birdsList) {\n // Call to the sings() method of the superclass\n System.out.println(bird.getName() + \" can sing?: \" + bird.sings());\n // A polymorphic call to the sing() method\n bird.sing();\n if (bird instanceof FlyingBird) {\n // Downcast a Bird object to a FlyingBird object\n System.out.println(bird.getName() + \" can fly?: \" + ((FlyingBird) bird).flys());\n }\n }\n }", "public void gossipGirl(){\n\t\tfor(Point p: currentPiece){\n\t\t\twell[p.x + pieceOrigin.x][p.y + pieceOrigin.y] = currentColor;\n\t\t}\n\t\trowChecked();\n\n\t\tsetNewPiece();\n\t\tgetNewPiece();\n\t}", "private int[] placeFruit() {\n\t\t\n\t\tint []point = new int[2];\n\t\t\n\t\tint helpX, helpY, foodX = 0, foodY = 0;\n\t\tboolean helpS,helpO;\t// for Snake and Obstacles\n\t\tboolean collision = true;\n\t\tArrayList<Obstacle> obstacles = Controller.getInstance().getObstacles();\n\n\t\twhile(collision) {\n\t\t\t\t\n\t\t\thelpS =helpO= false;\n\t\t\tfoodX = (rand.nextInt(BWIDTH)*GameObject.SIZE)+GameObject.SIZE/2;\n\t\t\tfoodY = (rand.nextInt(BHEIGHT)*GameObject.SIZE)+GameObject.SIZE/2;\n\t\t\t\t\n\t\t\tfor(int i = 0; i < snake.getSize(); ++i) {\n\t\t\t\t\t\n\t\t\t\thelpX = snake.getBodyPart(i).getX();\n\t\t\t\thelpY = snake.getBodyPart(i).getY();\n\t\n\t\t\t\tif(helpX == foodX && helpY == foodY) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\tif(i == snake.getSize() - 1) {\n\t\t\t\t\thelpS = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(helpS) {\n\n\n\n\t\t\t\t\tfor(int i = 0; i < obstacles.size(); ++i) {\n\n\t\t\t\t\t\thelpX = obstacles.get(i).getX();\n\t\t\t\t\t\thelpY = obstacles.get(i).getY();\n\n\t\t\t\t\t\tif(foodX == helpX && foodY == helpY) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(i == obstacles.size() - 1) {\n\t\t\t\t\t\t\thelpO = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\tif(helpO) {\n\t\t\t\t\tcollision = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpoint[0] = foodX;\n\t\tpoint[1] = foodY;\n\t\treturn point;\t\n\t}", "@Override\n public Answer getAnswer(Guess guess) {\n\n \tint row = guess.row;\n \tint col = guess.column;\n \tCoordinate enemyShot = world.new Coordinate();\n \tenemyShot.column = col;\n \tenemyShot.row = row;\n \t\n \t//store enemy's shot\n \tenemyShots.add(enemyShot);\n \tAnswer a = new Answer();\n\n \t//loop all ship locations and its coordinate, if enemy shot same as ship coordinate there is a hit \n \tfor (ShipLocation shipLocation: shipLocations) {\n \t\tfor (Coordinate coordinate: shipLocation.coordinates) {\n \t\t\tif (coordinate.row == row && coordinate.column == col) {\n \t\t\t\ta.isHit = true;\n \t\t\n \t\t\t\t//if enemy shots contain a whole ship coordinates, there is a ship sunk\n \t \t\tif (enemyShots.containsAll(shipLocation.coordinates)) {\n \t \t\t\ta.shipSunk = shipLocation.ship;\n \t \t\t}\n \t\t\t\t\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \t\n\n // dummy return\n return a;\n }", "void findBuddies() {\n\t\tScanner in = new Scanner(System.in);\n\t\t\n\t\t/*calling buddyMaker() to initialize our Buddy objects*/\n\t\tString buddyFile = buddyList;\n\t\twhile(true) {\n\t\t\ttry {\n\t\t\t\tbuddyMaker(buddyFile);\n\t\t\t\tbreak;\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"Error: File not found. Please re-enter file name\\n(should be type .csv) or type 'q' to quit:\");\n\t\t\t\tbuddyFile = in.next();\n\t\t\t\tif (buddyFile.toLowerCase().equals(\"q\"))\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\telse\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t};\n\t\t\n\t\t/*calling readKeywords() to initialize our interests*/\n\t\tString wordFile = wordList;\n\t\tHashSet<String> keywords;\n\t\twhile(true) {\n\t\t\ttry {\n\t\t\t\tkeywords = readKeywords(wordFile);\n\t\t\t\tbreak;\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"Error: File not found. Please re-enter file name\\n(should be type .csv) or type 'q' to quit:\");\n\t\t\t\twordFile = in.next();\n\t\t\t\tif (wordFile.toLowerCase().equals(\"q\"))\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\telse\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t};\n\t\t\n\t\tin.close();\n\t\t\n\t\t/*initializing interests for each buddy*/\n\t\tSystem.out.println(\"------------------------------\\nSorting interests...\");\n\t\tfor (Buddy b : buddies) {\n\t\t\tb.findInterests(keywords);\n\t\t\tb.sortInterests();\n\t\t\tSystem.out.println(b.name + \": \" + b.interests);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"------------------------------\\nMatchmaking...\");\n\t\tmatch(groupSize, buddies);\n\t\t\n\t\t/*printing out the results*/\n\t\tfor (ArrayList<Buddy> group : matches) {\n\t\t\tSystem.out.printf(\"-------- GROUP of (%d) --------\\n\", group.size());\n\t\t\tfor (Buddy b: group) {\n\t\t\t\tSystem.out.println(b.name);\n\t\t\t}\n\t\t}\n\t\tSystem.out.printf(\"------------------------------\\nMade %d groups total\", matches.size());\n\t}", "public java.util.ArrayList<Species> getAllSpecies() {\n ArrayList<Species> answer = new ArrayList<Species>();\n getAllDescendantSpecies(overallRoot, answer);\n return answer;\n \n }", "private void obtainProblem(){\n followers = frame.getFollowers();\n followers = Math.min(followers, CreatureFactory.getStrongestMonster().getFollowers() * Formation.MAX_MEMBERS);\n maxCreatures = frame.getMaxCreatures();\n heroes = frame.getHeroes();//is this field needed?\n prioritizedHeroes = frame.getHeroes(Priority.ALWAYS);\n //create boss formation\n LinkedList<Creature> list = new LinkedList<>();\n list.add(frame.getBoss());\n bossFormation = new Formation(list);\n containsRandomBoss = bossFormation.containsRandomHeroes();\n yourRunes = frame.getYourRunes();\n for (int i = 0; i < Formation.MAX_MEMBERS; i++){\n //System.out.println(yourRunes[i]);\n if (!(yourRunes[i] instanceof Nothing)){\n hasRunes = true;\n //System.out.println(\"hasRunes\");\n break;\n }\n }\n \n NHWBEasy = heroes.length == 0 && prioritizedHeroes.length == 0 && frame.getBoss().getMainSkill().WBNHEasy() && !hasRunes && !containsRandomBoss;\n \n }", "public void printDogsOfBreed(String breed){\n System.out.println(\"Here are the \" + breed + \" dogs in the shelter:\");\n ArrayList<Dog> specificDogs = dogsOfBreed(breed);\n for(Dog d : specificDogs){d.printInfo();}\n }", "boolean willEggHatch(IGeneticMob geneticMob);", "public void printSpeciesData(){\n\n System.out.println(\"A \" + this.name + \" has \" + this.legs + \" legs, \" + this.numberOfWings +\n \" wings, it is \" + this.wingColor + \", and likes a plant called \" + this.favFlower);\n\n }", "private void LotsofGrasp()\n\t{\n\t\t\n\t\tArrayList<FirmlyGraspIt> myRuns = new ArrayList<FirmlyGraspIt>();\n\t\t\n\t\tArrayList<Integer> myNums = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\tFirmlyGraspIt sampleRun = new FirmlyGraspIt();\n\t\tFirmlyGraspIt otherRun = new FirmlyGraspIt();\n\t\t\n\t\tmyRuns.add(sampleRun);\n\t\tmyRuns.add(sampleRun);\n\t\tmyRuns.add(otherRun);\n\t\t\n\t\tfor (int index =0; index < myRuns.size(); index +=1)\n\t\t\t\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, myRuns.get(index).getName());\n\t\t\t\n\t\t\tFirmlyGraspIt currentRun = myRuns.get(index);\n\t\t\tJOptionPane.showMessageDialog(null, currentRun.getName());\n\t\t\tcurrentRun.setName(\"The new name is \" + index + \"run\");\n\t\t\tcurrentRun.setDistance(index * (int) (Math.random() * 300));\n\t\t\t\n\t\t}\n\t\t\n\t\t{\n\t\t\t\n\t\t}\n\t\n\t\t\n\t\tfor (int index = myRuns.size() - 1; index >= 0; index -= 1)\n\t\t{\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (FirmlyGraspIt current : myRuns)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, \"The run is named:\" + current.getName());\n\t\t}\n\t\t\n\t}", "void analyze(CaveGen g) {\n caveGenCount += 1; \n\n // count the number of purple flowers\n int num = 0;\n for (Teki t: g.placedTekis) {\n if (t.tekiName.equalsIgnoreCase(\"blackpom\"))\n num += 1;\n }\n if (num > 5) num = 5;\n numPurpleFlowers[num] += 1;\n\n // report about missing treasures\n // print the seed everytime we see a missing treasure\n int minTreasure = 0, actualTreasure = 0;\n for (Item t: g.spawnItem) { minTreasure += t.min; }\n for (Teki t: g.spawnTekiConsolidated) { if (t.itemInside != null) minTreasure += t.min; }\n actualTreasure += g.placedItems.size();\n for (Teki t: g.placedTekis) {\n if (t.itemInside != null)\n actualTreasure += 1;\n }\n int expectedMissingTreasures = 0;\n if (\"CH29 1\".equals(g.specialCaveInfoName + \" \" + g.sublevel))\n expectedMissingTreasures = 1; // This level is always missing a treasure\n boolean missingUnexpectedTreasure = actualTreasure + expectedMissingTreasures < minTreasure;\n if (missingUnexpectedTreasure) {\n println(\"Missing treasure: \" + g.specialCaveInfoName + \" \" + g.sublevel + \" \" + Drawer.seedToString(g.initialSeed));\n missingTreasureCount += 1;\n }\n\n // Good layout finder (story mode)\n if (CaveGen.findGoodLayouts && !CaveGen.challengeMode && !missingUnexpectedTreasure) {\n boolean giveWorstLayoutsInstead = CaveGen.findGoodLayoutsRatio < 0;\n\n ArrayList<Teki> placedTekisWithItems = new ArrayList<Teki>();\n for (Teki t: g.placedTekis) {\n if (t.itemInside != null)\n placedTekisWithItems.add(t);\n }\n\n String ignoreItems = \"g_futa_kyodo,flower_blue,tape_blue,kinoko_doku,flower_red,futa_a_silver,cookie_m_l,chocolate\";\n String findTekis = \"\"; //\"whitepom,blackpom\";\n\n // Compute the waypoints on the shortest paths\n ArrayList<WayPoint> wpOnShortPath = new ArrayList<WayPoint>();\n for (Item t: g.placedItems) { // Treasures\n if (ignoreItems.contains(t.itemName.toLowerCase())) continue;\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n for (Teki t: placedTekisWithItems) { // Treasures inside enemies\n if (ignoreItems.contains(t.itemInside.toLowerCase())) continue;\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n for (Teki t: g.placedTekis) { // Other tekis\n if (findTekis.contains(t.tekiName.toLowerCase())) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n }\n /*if (g.placedHole != null) {\n WayPoint wp = g.closestWayPoint(g.placedHole);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }\n if (g.placedGeyser != null) {\n WayPoint wp = g.closestWayPoint(g.placedGeyser);\n while (!wp.isStart) {\n if (!wpOnShortPath.contains(wp)) wpOnShortPath.add(wp);\n wp = wp.backWp;\n }\n }*/\n\n // add up distance penalty for score\n int score = 0;\n for (WayPoint wp: wpOnShortPath) {\n score += wp.distToStart - wp.backWp.distToStart;\n } \n // add up enemy penalties for score\n for (Teki t: g.placedTekis) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n if (wpOnShortPath.contains(wp)) {\n score += Parser.tekiDifficulty.get(t.tekiName.toLowerCase());\n }\n }\n // add up gate penalties for score\n for (Gate t: g.placedGates) {\n WayPoint wp = g.closestWayPoint(t.spawnPoint);\n if (g.placedHole != null && g.placedHole.mapUnit.type == 0 && g.placedHole.mapUnit.doors.get(0).spawnPoint == t.spawnPoint)\n score += t.life / 3; // covers hole\n // if (g.placedGeyser != null && g.placedGeyser.mapUnit.type == 0 && g.placedGeyser.mapUnit.doors.get(0).spawnPoint == t.spawnPoint)\n // score += t.life / 3; // covers geyser\n if (wpOnShortPath.contains(wp))\n score += t.life / 3; // covers path back to ship\n }\n\n if (giveWorstLayoutsInstead) score *= -1;\n\n // keep a sorted list of the scores\n allScores.add(score);\n\n // only print good ones\n if (CaveGen.indexBeingGenerated > CaveGen.numToGenerate/10 && \n score <= allScores.get((int)(allScores.size()*Math.abs(CaveGen.findGoodLayoutsRatio))) \n || score == allScores.get(0) && CaveGen.indexBeingGenerated > CaveGen.numToGenerate/40) {\n CaveGen.images = true;\n println(\"GoodLayoutScore: \" + Drawer.seedToString(g.initialSeed) + \" -> \" + score);\n }\n else {\n CaveGen.images = false;\n }\n\n }\n\n // good layout finder (challenge mode)\n if (CaveGen.findGoodLayouts && CaveGen.challengeMode) {\n boolean giveWorstLayoutsInstead = CaveGen.findGoodLayoutsRatio < 0;\n\n // compute the number of pokos availible\n int pokosAvailible = 0;\n for (Teki t: g.placedTekis) {\n String name = t.tekiName.toLowerCase();\n if (plantNames.contains(\",\" + name + \",\")) continue;\n if (hazardNames.contains(\",\" + name + \",\")) continue;\n if (name.equalsIgnoreCase(\"egg\"))\n pokosAvailible += 10; // mitites\n else if (!noCarcassNames.contains(\",\" + name + \",\") && !name.contains(\"pom\"))\n pokosAvailible += Parser.pokos.get(t.tekiName.toLowerCase());\n if (t.itemInside != null)\n pokosAvailible += Parser.pokos.get(t.itemInside.toLowerCase());\n }\n for (Item t: g.placedItems)\n pokosAvailible += Parser.pokos.get(t.itemName.toLowerCase());\n\n // compute the number of pikmin*seconds required to complete the level\n float pikminSeconds = 0;\n for (Teki t: g.placedTekis) {\n if (plantNames.contains(\",\" + t.tekiName.toLowerCase() + \",\")) continue;\n if (hazardNames.contains(\",\" + t.tekiName.toLowerCase() + \",\")) continue;\n pikminSeconds += workFunction(g, t.tekiName, t.spawnPoint);\n if (t.itemInside != null)\n pikminSeconds += workFunction(g, t.itemInside, t.spawnPoint);\n }\n for (Item t: g.placedItems) {\n pikminSeconds += workFunction(g, t.itemName, t.spawnPoint);\n }\n pikminSeconds += workFunction(g, \"hole\", g.placedHole);\n pikminSeconds += workFunction(g, \"geyser\", g.placedGeyser);\n // gates??\n // hazards??\n \n int score = -pokosAvailible * 1000 + (int)(pikminSeconds/2);\n if (giveWorstLayoutsInstead) score *= -1;\n\n // keep a sorted list of the scores\n allScores.add(score);\n\n // only print good ones\n if (CaveGen.indexBeingGenerated > CaveGen.numToGenerate/10 && \n score <= allScores.get((int)(allScores.size()*Math.abs(CaveGen.findGoodLayoutsRatio))) \n || score == allScores.get(0) && CaveGen.indexBeingGenerated > CaveGen.numToGenerate/40) {\n CaveGen.images = true;\n println(\"GoodLayoutScore: \" + Drawer.seedToString(g.initialSeed) + \" -> \" + score);\n }\n else {\n CaveGen.images = false;\n }\n }\n }", "private int blastForRna(Genome genome) {\n // Collect the contigs from the genome.\n DnaDataStream contigs = new DnaDataStream(genome);\n // This will hold the locations found. Each location will be mapped to the associated hit's description (a taxonomy\n // string). If two locations overlap on the same strand, they will be merged, but only the first hit's description is\n // kept.\n List<RnaDescriptor> descriptors = new ArrayList<RnaDescriptor>();\n // BLAST the contigs against the Silva database in batches.\n DnaDataStream buffer = new DnaDataStream(BATCH_SIZE, 11);\n BatchStreamIterator iter = new BatchStreamIterator(contigs, buffer, BATCH_SIZE);\n while (iter.hasNext()) {\n DnaDataStream newContigs = (DnaDataStream) iter.next();\n List<BlastHit> hits = this.silvaDB.blast(newContigs, this.parms);\n log.info(\"{} hits found against {}.\", hits.size(), genome);\n for (BlastHit hit : hits) {\n // Create a descriptor for the hit.\n RnaDescriptor thisHit = new RnaDescriptor(genome, hit);\n // Check to see if it merges with an existing hit.\n boolean merged = false;\n for (int i = 0; i < descriptors.size() && ! merged; i++)\n merged = descriptors.get(i).checkForMerge(thisHit);\n if (! merged)\n descriptors.add(thisHit);\n }\n }\n // Record the BLAST hits from this genome.\n for (RnaDescriptor descriptor : descriptors)\n this.reporter.recordHit(descriptor);\n // Return the number found.\n return descriptors.size();\n }", "public static void main(String[] args) {\n\r\n\tBird eagle = new Bird();\r\n\tBird amazon = new Bird();\r\n\tBird cardinal = new Bird();\r\n\tBird owls = new Bird();\r\n\t\r\n\tSystem.out.println();\r\n\t\t\r\n\teagle.setBreed();\r\n\teagle.setColour();\r\n\teagle.setSize();\r\n\teagle.setClassification();\r\n\t\r\n\tSystem.out.println();\r\n\t\r\n\tamazon.setBreed();\r\n\tamazon.setColour();\r\n\tamazon.setSize();\r\n\tamazon.setClassification();\r\n\t\r\n\tSystem.out.println();\r\n\t\r\n\tcardinal.setBreed();\r\n\tcardinal.setColour();\r\n\tcardinal.setSize();\r\n\tcardinal.setClassification();\r\n\t\r\n\tSystem.out.println();\r\n\t\r\n\towls.setBreed();\r\n\towls.setColour();\r\n\towls.setSize();\r\n\towls.setClassification();\r\n\t\r\n\tSystem.out.println();\r\n\t\r\n\tSystem.out.println(\"Breed: \" + eagle.getBreed());\r\n\tSystem.out.println(\"Colour: \" + eagle.getColour());\r\n\tSystem.out.println(\"Size: \" + eagle.getSize());\r\n\tSystem.out.println(\"Classification: \" + eagle.getClassification());\r\n\t\r\n\tSystem.out.println();\r\n\t\r\n\tSystem.out.println(\"Breed: \" + amazon.getBreed());\r\n\tSystem.out.println(\"Colour: \" + amazon.getColour());\r\n\tSystem.out.println(\"Size: \" + amazon.getSize());\r\n\tSystem.out.println(\"Classification: \" + amazon.getClassification());\r\n\t\r\n\tSystem.out.println();\r\n\t\r\n\tSystem.out.println(\"Breed: \" + cardinal.getBreed());\r\n\tSystem.out.println(\"Colour: \" + cardinal.getColour());\r\n\tSystem.out.println(\"Size: \" + cardinal.getSize());\r\n\tSystem.out.println(\"Classification: \" + cardinal.getClassification());\r\n\t\r\n\tSystem.out.println();\r\n\t\r\n\tSystem.out.println(\"Breed: \" + owls.getBreed());\r\n\tSystem.out.println(\"Colour: \" + owls.getColour());\r\n\tSystem.out.println(\"Size: \" + owls.getSize());\r\n\tSystem.out.println(\"Classification: \" + owls.getClassification());\r\n\t}", "public void evaluateHand(){only public for testing\n //hand types will be\n //1 royal flush\n //2 straight flush\n //3 four of a kind\n //4 full house\n //5 flush\n //6 straight\n //7 three of a kind\n //8 two pair\n //9 pair\n //10 high card\n //hand secondary values will have to some how account for\n //the lead card of a flush or straight or the bigger pair\n //\n HandType = 0;\n\n //----------checking flush----------\n boolean flush = true;//will flip the vriable when proven wrong\n //if Hand.suites all equal\n for(Card c : Hand) {\n if (!c.getSuite().contains(Hand[0].getSuite())) {\n flush = false;\n }\n }\n //--Handtype = 5//flush\n if(flush){\n HandType=5;\n }\n\n //----------checking pair, two pair, boat,three of a kind, four of a kind----------\n int countmatches=0;\n HashMap<Integer, ArrayList<Card>> maskd = new HashMap<>();\n int[] mask = new int[5];\n int currentmask=1;\n maskd.put(0, new ArrayList<>());\n mask[0]=0;\n maskd.get(0).add(this.Hand[0]);\n //if any two hand.value equal\n for(int comp = 0; comp<Hand.length;comp++){//comparitor\n for(int check = comp+1; check<Hand.length;check++) {//checker\n //System.out.print(\"{\"+comp+check+\"}\");\n if(0==Hand[comp].compareTo(Hand[check])){\n //System.out.println(\"pair\"+Hand[comp]+Hand[check]);\n countmatches++;\n /*if(pairprimary==0&&!(pairprimary==Hand[check].getValue())){\n pairprimary=Hand[check].getValue();\n }else if(pairsecondary==0){\n pairsecondary=Hand[check].getValue();\n }//this wont work for boats\n */\n //create mask?\n if(mask[comp]==0){\n mask[comp]=currentmask;\n maskd.put(currentmask,new ArrayList<>());\n maskd.get(currentmask).add(this.Hand[comp]);\n currentmask++;\n if(maskd.get(0).contains(this.Hand[comp])){\n maskd.get(0).remove(this.Hand[comp]);\n }\n }\n mask[check]=mask[comp];\n if(!maskd.get(mask[comp]).contains(this.Hand[check])) {\n if(maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).remove(this.Hand[check]);\n maskd.get(mask[comp]).add(this.Hand[check]);\n }\n continue;\n }\n if(!maskd.get(0).contains(this.Hand[check]))\n maskd.get(0).add(this.Hand[check]);\n }\n }\n\n //for(int m:maskd.keySet())\n // System.out.print(\"\"+m+\":\"+maskd.get(m));\n //System.out.println(\"\");\n\n if(HandType==0)\n switch (countmatches){ //basically i'm counting the collisions\n case 1: HandType=9;break;//one pair\n case 2: HandType=8;break;//two pair\n case 3: HandType=7;break;//triple\n case 4: HandType=4;break;//boat\n case 6: HandType=3;break;//four of a kind\n case 10: HandType=-1;break;//five of a kind\n }//reorder cards by mask?\n if(countmatches>0){\n Card[] newhand = new Card[5];\n int bigger = 0;\n if(currentmask==3) {//two pair boat\n //two pair\n if (maskd.get(1).get(0).getValue()\n > maskd.get(2).get(0).getValue()) {\n bigger = 1;\n } else {\n bigger = 2;\n }\n\n //boat\n if (maskd.get(1).size() == 3) {\n bigger = 1;\n }\n if (maskd.get(2).size() == 3) {\n bigger = 2;\n }\n }else {\n //one pair???\n bigger = 1;\n }\n\n for(int i = 0; i<5;i++){\n //if(maskd.containsKey(bigger)) {\n if(!maskd.get(bigger).isEmpty()) {\n newhand[i] = maskd.get(bigger).get(0);\n //if (maskd.get(bigger).size() > 0) {\n maskd.get(bigger).remove(0);\n //} else {\n // bigger = Math.abs(bigger - 3);\n //}\n }else{\n if(maskd.containsKey(Math.abs(bigger-3))){\n if(!maskd.get(Math.abs(bigger-3)).isEmpty()){\n bigger = Math.abs(bigger-3);\n }else{\n bigger = 0;\n }\n }else{\n bigger = 0;\n }\n i--;\n }\n //}\n\n }//end for loop\n\n //end pair bits\n\n //System.out.println(newhand);\n this.Hand=newhand;\n }//end reshuffle hand if statement\n //----------checking for straight----------\n //if first card is ace and second card is a 5, treat ace as one\n if(Hand[0].getValue()==14&&Hand[1].getValue()==5) {\n Hand[0] = new Card(\"Ace\", Hand[0].getSuite(), 1);\n //Hand[0].Value=1;\n this.sortHand();\n this.flipHand();\n }\n //go through hand and see if all 5 values are consecutive\n int n = Hand[0].getValue();\n boolean straight = true;\n for(int i = 1;i<Hand.length; i++){\n n--;\n if(!(Hand[i].getValue()==n)){\n straight=false;\n }\n }\n if(straight){\n //if above true\n //--if handtype = 5\n if(HandType==5) {\n //----if card1 is ace\n if (Hand[0].getValue() == 14) {\n //------handtype = 1 //royal flush\n HandType = 1;\n } else {\n //----else\n HandType=2;\n //------handtype = 2 //straight flush\n }\n }else {\n //--else //not a flush\n HandType=6;\n //----handtype = 6 //straight\n }\n }\n\n //----------checking high card----------\n //if handtype = 0\n if(HandType==0) {\n HandType=10;\n //--hand card = 10\n }\n }", "public void learn() {\n best = birds.get(0);\n boolean allDead = true;\n for (final Bird bird : birds) {\n if (bird.dead)\n continue;\n allDead = false;\n\n //Set fitness to -1.0 to begin with, and then adjusts according to\n //the number of ticks and flaps. Note: the ticks are essentially a marker\n //for distance travelled as the ticks do not reset to 0 until the level\n //resets\n double fitness = ticks - bird.flaps * 1.5;\n fitness = fitness == 0.0 ? -1.0 : fitness;\n\n //updates the birds fitness (while still alive)\n bird.genome.fitness = fitness;\n if (fitness > Pool.maxFitness)\n Pool.maxFitness = fitness;\n\n //The best bird's fitness is updated as game progresses\n if (fitness > best.genome.fitness)\n best = bird;\n }\n\n //If all the birds are dead, start a new generation and restart the level\n if (allDead) {\n Pool.newGeneration();\n initializeGame();\n }\n }", "static void neighborhood()\r\n { \r\n // Puts the earth in a world and the three different color turtles in that world\r\n earth = new World();\r\n turtle1 = new Turtle(earth);\r\n turtle1.setColor(Color.BLUE);\r\n turtle2 = new Turtle(earth);\r\n turtle2.setColor(Color.RED);\r\n turtle3 = new Turtle(earth);\r\n turtle3.setColor(Color.GREEN);\r\n house(100, 100, turtle1);\r\n house(250, 100, turtle2);\r\n house(400, 100, turtle3);\r\n\r\n }", "public void Biome(Square[][]Squares, int rows, int columns)\n {\n \n grid = rows*columns;\n terrainLoc = new int[rows][columns];\n mountains =(grid/10000)+2;\n forests = (grid/1200)+2;\n \n createSeedForest(Squares, rows, columns, forests, terrainLoc);\n swellForests(Squares, rows, columns, terrainLoc);\n createSeedMountains(Squares, rows, columns, mountains, terrainLoc);\n swellMountains(Squares, rows, columns, terrainLoc);\n createValley(Squares, rows, columns, grid);\n createRiver(Squares, rows, columns, terrainLoc);\n \n }", "public boolean getGotLucky()\n {\n return (die1.getFacevalue() == 6 && die2.getFacevalue() == 6 && lastThrow[0] == 6 && lastThrow[1] == 6);\n }", "protected void initializePopulation () {\n\t\tfor (int i = 0; i < this.speciesSize; i++) {\n\t\t\tthis.detectors.add(DetectorFactory.makeDetector(this.featuresLength, this.typeBias, this.generalityBias));\n\t\t}\n\t}", "public PokemonSpecies findSeenSpeciesData(String name) throws PokedexException {\n PokemonSpecies rv = null;\n String nameLower = name.toLowerCase();\n Iterator<PokemonSpecies> it = pokedex.iterator();\n PokemonSpecies currentSpecies;\n while(it.hasNext()) {\n currentSpecies = it.next();\n if(currentSpecies.getSpeciesName().equals(nameLower)) {\n rv = currentSpecies;\n break;\n }\n }\n if(rv == null) {\n throw new PokedexException(String.format(Config.UNSEEN_POKEMON, name));\n }\n return rv;\n }", "private Cell getBananaTarget() {\n Cell[][] blocks = gameState.map;\n int mostWormInRange = 0;\n Cell chosenCell = null;\n boolean wormAtCenter;\n\n for (int i = currentWorm.position.x - currentWorm.bananaBomb.range; i <= currentWorm.position.x + currentWorm.bananaBomb.range; i++){\n for (int j = currentWorm.position.y - currentWorm.bananaBomb.range; j <= currentWorm.position.y + currentWorm.bananaBomb.range; j++){\n wormAtCenter = false;\n if (isValidCoordinate(i, j)\n && euclideanDistance(i, j, currentWorm.position.x, currentWorm.position.y) <= 5) {\n List<Cell> affectedCells = getBananaAffectedCell(i, j);\n\n int wormInRange = 0;\n for (Cell cell : affectedCells) {\n for (Worm enemyWorm : opponent.worms) {\n if (enemyWorm.position.x == cell.x && enemyWorm.position.y == cell.y\n && enemyWorm.health > 0)\n wormInRange++;\n if (enemyWorm.position.x == i && enemyWorm.position.y == j)\n wormAtCenter = true;\n }\n for (Worm myWorm : player.worms) {\n if (myWorm.position.x == cell.x && myWorm.position.y == cell.y && myWorm.health > 0)\n wormInRange = -5;\n }\n }\n if (wormInRange > mostWormInRange) {\n mostWormInRange = wormInRange;\n chosenCell = blocks[j][i];\n } else if (wormInRange == mostWormInRange && wormAtCenter) {\n chosenCell = blocks[j][i];\n }\n }\n }\n }\n\n return chosenCell;\n }", "private boolean checkGuess(char c){\r\n boolean contains = false;\r\n for (int i = 0; i < wordArray.length; i++) {\r\n if (wordArray[i] == c) {\r\n contains = true;\r\n hidden[i] = c;\r\n }\r\n }\r\n if (!contains){\r\n guesses.add(c);\r\n }\r\n return contains;\r\n }", "void drawBones(){\n\t for(Skeleton s : skeletons){\n\t drawBones(s.frame);\n\t }\n\t}", "public static String play(GuessWhoGame g) {\n if (g.hairIsColor(Color.BROWN)) {\n if (g.eyeIsColor(Color.BROWN)) {\n if (g.shirtIsColor(Color.GREEN)) {\n if (g.isWearingGlasses()) {\n return \"Bob\";\n } else {\n return \"Dave\";\n }\n } else {\n if (g.shirtIsColor(Color.RED)) {\n if (g.isWearingHat()) {\n return \"Robert\";\n } else {\n return \"Quinn\";\n }\n } else {\n return \"Zander\";\n }\n }\n } else {\n if (g.shirtIsColor(Color.RED)) {\n if (g.eyeIsColor(Color.BLUE)) {\n if (g.isWearingGlasses()) {\n if (g.isSmiling()) {\n return \"Mallie\";\n } else {\n return \"Wendy\";\n }\n } else {\n return \"Nick\";\n }\n } else {\n if (g.isWearingGlasses()) {\n return \"Emily\";\n } else {\n return \"Philip\";\n }\n }\n } else {\n if (g.shirtIsColor(Color.GREEN)) {\n if (g.eyeIsColor(Color.BLUE)) {\n return \"Alice\";\n } else {\n if (g.eyeIsColor(Color.GREEN)) {\n return \"Frank\";\n } else {\n return \"Isabelle\";\n }\n }\n } else {\n return \"Tucker\";\n }\n }\n }\n } else {\n if (g.eyeIsColor(Color.BROWN)) {\n if (g.hairIsColor(Color.BLACK)) {\n if (g.isWearingGlasses()) {\n return \"Xavier\";\n } else {\n if (g.shirtIsColor(Color.BLUE)) {\n return \"Olivia\";\n } else {\n return \"Ursula\";\n }\n }\n } else {\n if (g.hairIsColor(Color.BLOND)) {\n if (g.shirtIsColor(Color.RED)) {\n return \"Henry\";\n } else {\n return \"Jack\";\n }\n } else {\n if (g.isWearingHat()) {\n return \"Sarah\";\n } else {\n return \"Victor\";\n }\n }\n }\n } else {\n if (g.hairIsColor(Color.BLACK)) {\n if (g.eyeIsColor(Color.BLUE)) {\n if (g.isSmiling()) {\n return \"Gertrude\";\n } else {\n return \"Carol\";\n }\n } else {\n return \"Karen\";\n }\n } else {\n if (g.shirtIsColor(Color.BLUE)) {\n return \"Larry\";\n } else {\n return \"Yasmine\";\n }\n }\n } \n }\n \n //return null;\n }", "public static void main(String[] args) {\n ArrayList<Bird> birds = new ArrayList<>();\n Scanner scan = new Scanner(System.in);\n \n while (true){\n System.out.print(\"? \");\n String input = scan.nextLine();\n \n if (input.equals(\"Add\")){\n System.out.print(\"Name: \");\n String inputName = scan.nextLine();\n System.out.print(\"Name in Latin: \");\n String inputNameLat = scan.nextLine();\n Bird bird = new Bird(inputName, inputNameLat);\n birds.add(bird);\n }\n \n if (input.equals(\"Observation\")){\n System.out.print(\"Bird? \");\n String inputBird = scan.nextLine();\n int contained = 0;\n \n for (int j = 0; j<birds.size(); j++){\n if (birds.get(j).getName().equals(inputBird)){\n contained = 1;\n }\n }\n \n if (contained == 1){\n for (int i = 0; i<birds.size(); i++){\n if (birds.get(i).getName().equals(inputBird)){\n birds.get(i).counter(1);\n } \n }\n } else {\n System.out.println(\"Not a bird!\");\n } \n }\n \n if (input.equals(\"All\")){\n for (int i = 0; i<birds.size();i++){\n System.out.println(birds.get(i).getName()+\" (\"+birds.get(i).getNameLat()+\"): \"+birds.get(i).getCount()+\" observations\");\n } \n }\n \n if (input.equals(\"One\")){\n System.out.print(\"Bird? \");\n String one = scan.nextLine();\n for (int i = 0; i<birds.size(); i++){\n if (birds.get(i).getName().equals(one)){\n System.out.println(birds.get(i).getName()+\" (\"+birds.get(i).getNameLat()+\"): \"+birds.get(i).getCount()+\" observations\");\n }\n }\n }\n \n if (input.equals(\"Quit\")){\n break;\n }\n\n }\n }", "public void findHouse() {\n\t\tSystem.out.println(\"找房子\");\n\t}", "public abstract ArrayList<Inhabitant> reproduce(ArrayList<Cell> toBeBorn);", "public void rgs() {\n\t\tArrayList<int[]> front = this.unknown;\n\t\tRandom rand = new Random();\n\t\tint index = rand.nextInt(front.size());\n\t\tint loc[] = front.get(index);\n\t\tprobe(loc[0], loc[1]);\n\t\trgsCount++;\n\t\tSystem.out.println(\"RGS: probe[\" +loc[0] + \",\" + loc[1] + \"]\");\n\t\tshowMap();\n\t}", "public void findEnemySnake() {\n // Cheap fix to GameState spawning a food on a person's HeadPiece\n if (this.gb.heads.size() == 1) {\n if (print) System.out.println(\" ONLY 1 HEAD FOUND IN GAME BOARD!\");\n HeadPiece h1 = this.gb.heads.get(0);\n if ((h1.getX() == this.us_head_x) && (h1.getY() == this.us_head_y)) {\n // fucking panic i guess\n if (print) System.out.println(\" CANNOT FIND ENEMY HEAD?????\");\n this.enemy_head_x = 0;\n this.enemy_head_y = 0;\n } else {\n // Correctly found enemy head\n this.enemy_head_x = h1.getX();\n this.enemy_head_y = h1.getY();\n }\n return;\n }\n\n // Find the enemy snake head and update member variables\n HeadPiece h1 = this.gb.heads.get(0);\n HeadPiece h2 = this.gb.heads.get(1);\n HeadPiece enemyHead;\n if ((h1.getX() == this.us_head_x) && (h1.getY() == this.us_head_y)) {\n enemyHead = h2;\n } else {\n enemyHead = h1;\n }\n this.enemy_head_x = enemyHead.getX();\n this.enemy_head_y = enemyHead.getY();\n }", "public static int [] moveDecision (Species [][] map, int x , int y, int plantHealth) {\n \n // Directions: Up = 1, Down = 2, Left = 3, Right = 4\n // Last choice is random movement\n // Animals: sheep = 0, wolves = 1\n int [] directionChoice = new int [] {1 + (int)(Math.random() * 4), 1 + (int)(Math.random() * 4)};\n \n // Find any animals\n if ((map[y][x] != null) && (!(map[y][x] instanceof Plant))) {\n \n // Sheep decisions (sheep cannot decide whether or not to move away from wolves)\n if (map[y][x] instanceof Sheep) {\n \n // First choice is to eat\n if ((y > 0) && (map[y-1][x] instanceof Plant)) {\n directionChoice[0] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Plant)) {\n directionChoice[0] = 2;\n } else if ((x > 0) &&(map[y][x-1] instanceof Plant)) {\n directionChoice[0] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Plant)) {\n directionChoice[0] = 4;\n \n // Wolf decisions\n } else if (map[y][x] instanceof Wolf) {\n \n // First choice is to eat\n if ((y > 0) && (map[y-1][x] instanceof Sheep)) {\n directionChoice[1] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Sheep)) {\n directionChoice[1] = 2;\n } else if ((x > 0) && (map[y][x-1] instanceof Sheep)) {\n directionChoice[1] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Sheep)) {\n directionChoice[1] = 4;\n \n // Second choice is to fight a weaker wolf\n } else if ((y > 0) && (map[y-1][x] instanceof Wolf)) {\n directionChoice[1] = 1;\n } else if ((y < map[0].length - 2) && (map[y+1][x] instanceof Wolf)) {\n directionChoice[1] = 2;\n } else if ((x > 0) && (map[y][x-1] instanceof Wolf)) {\n directionChoice[1] = 3;\n } else if ((x < map.length - 2) && (map[y][x+1] instanceof Wolf)) {\n directionChoice[1] = 4;\n }\n }\n \n }\n }\n return directionChoice; // Return choice to allow animals to move\n }", "boolean isGoodBiome(BiomeGenBase biome);", "public void findShips(int game[][]) {\n\t\tint counter =0; // total number of cells searched\n\t\tint count = 0;\n\t\tString carr=\"\"; // Concatenating the carrier strings.\n\t\tString sub = \"\"; // Concatenating the submarines strings.\n\t\t//System.out.println(\"Horizontal is implemented\"+ game);\n\t\tfor(int i=0 ; i<25; i++) {\n\t\t\tfor(int j =0; j<25;j++) {\n\t\t\t\tif(game[i][j]==1) {\n\t\t\t\t\t//System.out.print(\" Found Carrier at (\"+i+\",\"+j+\") \");\n\t\t\t\t\tString a = \"(\"+i+\",\"+j+\")\";\n\t\t\t\t\tcarr = carr.concat(a);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if(game[i][j]==2) {\n\t\t\t\t\t//System.out.print(\" Found submarine at (\"+i+\",\"+j+\") \");\n\t\t\t\t\tString b = \"(\"+i+\",\"+j+\")\";\n\t\t\t\t\tsub = sub.concat(b);\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tif(count==8) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"Strategy: Horizontal Sweep\");\n\t\tSystem.out.println(\"Number of cells searched: \"+counter);\n\t\tSystem.out.print(\"Found Carrier at \"+carr+\";\");\n\t\tSystem.out.println(\" Found Sub at \"+sub);\n\t\t\n\t}", "public String getBird() {\r\n\t\treturn bird;\r\n\t}", "public void reproduce(int generation, IPopulation pop, List<ISpecies> sorted_species) {\n\t\tfor(ISpecies specie : sorted_species){\r\n\r\n\t\t\tList<IOrganism> organisms = specie.getOrganisms();\r\n\r\n\t\t\t// outside the species\r\n\t\t\tint orgnum = 0;\r\n\r\n\t\t\tIOrganism mom = null;\r\n\t\t\tIOrganism baby = null;\r\n\t\t\tIGenome new_genome = null;\r\n\t\t\tIOrganism _organism = null;\r\n\t\t\tIOrganism _dad = null;\r\n\r\n\t\t\tif (specie.getExpectedOffspring() > 0 && organisms.size() == 0)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t// elements for this species\r\n\t\t\tint poolsize = organisms.size() - 1;\r\n\r\n\t\t\t// the champion of the 'this' species is the first element of the species;\r\n\t\t\tIOrganism thechamp = organisms.get(0);\r\n\t\t\tboolean champ_done = false; // Flag the preservation of the champion\r\n\r\n\t\t\t// Create the designated number of offspring for the Species one at a time.\r\n\t\t\tfor (int count = 0; count < specie.getExpectedOffspring(); count++) {\r\n\r\n\t\t\t\t// If we have a super_champ (Population champion), finish off some special clones.\r\n\t\t\t\tif (thechamp.getSuperChampOffspring() > 0) {\r\n\r\n\t\t\t\t\t// save in mom current champ;\r\n\t\t\t\t\tmom = thechamp;\r\n\t\t\t\t\t// create a new genome from this copy\r\n\t\t\t\t\tnew_genome = mom.getGenome().duplicate(count);\r\n\t\t\t\t\tif ((thechamp.getSuperChampOffspring()) > 1) {\r\n\t\t\t\t\t\tif (RandomUtils.randomDouble() < .8 || evolutionParameters.getDoubleParameter(MUTATE_ADD_LINK_PROB) == 0.0)\r\n\t\t\t\t\t\t\tevolutionStrategy.getMutationStrategy().mutateLinkWeight(new_genome, evolutionParameters.getDoubleParameter(WEIGHT_MUT_POWER), 1.0, MutationType.GAUSSIAN);\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t// Sometimes we add a link to a superchamp\r\n\t\t\t\t\t\t\tnew_genome.generatePhenotype(generation);\r\n\t\t\t\t\t\t\tevolutionStrategy.getMutationStrategy().mutateAddLink(new_genome,pop);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation);\r\n\t\t\t\t\tthechamp.incrementSuperChampOffspring();\r\n\t\t\t\t} // end population champ\r\n\r\n\t\t\t\t// If we have a Species champion, just clone it\r\n\t\t\t\telse if ((!champ_done) && (specie.getExpectedOffspring() > 5)) {\r\n\t\t\t\t\tmom = thechamp; // Mom is the champ\r\n\t\t\t\t\tnew_genome = mom.getGenome().duplicate(count);\r\n\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation); // Baby is\r\n\t\t\t\t\t// just like mommy\r\n\t\t\t\t\tchamp_done = true;\r\n\r\n\t\t\t\t} else if (RandomUtils.randomDouble() < evolutionParameters.getDoubleParameter(MUTATE_ONLY_PROB) || poolsize == 1) {\r\n\r\n\t\t\t\t\t// Choose the random parent\r\n\t\t\t\t\torgnum = RandomUtils.randomInt(0, poolsize);\r\n\t\t\t\t\t_organism = organisms.get(orgnum);\r\n\t\t\t\t\tmom = _organism;\r\n\t\t\t\t\tnew_genome = mom.getGenome().duplicate(count);\r\n\r\n\t\t\t\t\t// Do the mutation depending on probabilities of various mutations\r\n\t\t\t\t\tevolutionStrategy.getMutationStrategy().mutate(new_genome,pop,generation);\r\n\r\n\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation);\r\n\t\t\t\t}\r\n\t\t\t\t// Otherwise we should mate\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Choose the random mom\r\n\t\t\t\t\torgnum = RandomUtils.randomInt(0, poolsize);\r\n\t\t\t\t\t_organism = organisms.get(orgnum);\r\n\r\n\t\t\t\t\t// save in mom\r\n\t\t\t\t\tmom = _organism;\r\n\t\t\t\t\t// Choose random dad...\r\n\t\t\t\t\t// Mate within Species\r\n\t\t\t\t\tif (RandomUtils.randomDouble() > evolutionParameters.getDoubleParameter(INTERSPECIES_MATE_RATE)) {\r\n\t\t\t\t\t\torgnum = RandomUtils.randomInt(0, poolsize);\r\n\t\t\t\t\t\t_organism = organisms.get(orgnum);\r\n\t\t\t\t\t\t_dad = _organism;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Mate outside Species\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// save current species\r\n\t\t\t\t\t\tISpecies randspecies = specie;\r\n\t\t\t\t\t\t// Select a random species\r\n\t\t\t\t\t\tint giveup = 0;\r\n\t\t\t\t\t\t// Give up if you can't find a different Species\r\n\t\t\t\t\t\twhile ((randspecies == specie) && (giveup < 5)) {\r\n\r\n\t\t\t\t\t\t\t// Choose a random species tending towards better species\r\n\t\t\t\t\t\t\tdouble randmult = Math.min(1.0, RandomUtils.randomGaussian() / 4);\r\n\r\n\t\t\t\t\t\t\t// This tends to select better species\r\n\t\t\t\t\t\t\tint sp_ext = Math.max(0, (int) Math.floor((randmult * (sorted_species.size() - 1.0)) + 0.5));\r\n\t\t\t\t\t\t\trandspecies = sorted_species.get(sp_ext);\r\n\t\t\t\t\t\t\t++giveup;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t_dad = randspecies.getOrganisms().get(0);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnew_genome = evolutionStrategy.getCrossoverStrategy().performCrossover(mom,_dad,count);\r\n\r\n\t\t\t\t\t// Determine whether to mutate the baby's Genome\r\n\t\t\t\t\t// This is done randomly or if the mom and dad are the same organism\r\n\t\t\t\t\tif (RandomUtils.randomDouble() > evolutionParameters.getDoubleParameter(MATE_ONLY_PROB) || \r\n\t\t\t\t\t\t\t_dad.getGenome().getId() == mom.getGenome().getId() || \r\n\t\t\t\t\t\t\t_dad.getGenome().compatibility(mom.getGenome()) == 0.0) {\r\n\r\n\t\t\t\t\t\tevolutionStrategy.getMutationStrategy().mutate(new_genome,pop,generation);\r\n\t\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation);\r\n\t\t\t\t\t} \r\n\t\t\t\t\t// end block of prob\r\n\t\t\t\t\t// Determine whether to mutate the baby's Genome\r\n\t\t\t\t\t// This is done randomly or if the mom and dad are the same organism\r\n\r\n\t\t\t\t\t// Create the baby without mutating first\r\n\t\t\t\t\telse \r\n\t\t\t\t\t\tbaby = FeatFactory.newOrganism(0.0, new_genome, generation);\r\n\t\t\t\t}\r\n\t\t\t\tevolutionStrategy.getSpeciationStrategy().addOrganismToSpecies(pop, baby);\r\n\t\t\t} // end offspring cycle\r\n\t\t}\r\n\t}", "public void findBestTwoCardHandName() {\n if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(14, 'x', 14) == true) {//aces, any suit\n bestHandFromCardsNickNameString = \"Pocket Rockets\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'y', 14) == true) {//king, then ace, same suit\n bestHandFromCardsNickNameString = \"Big Slick in a Suit\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Full Auto\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(8, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Dead Man's Hand\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 13) == true) {\n bestHandFromCardsNickNameString = \"Cowboys King Kong\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"The Dog\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(12, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"Ladies\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(3, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"The Waiter\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 9) == true) {\n bestHandFromCardsNickNameString = \"A German Dime\";\n } else if (allCards[0].value == allCards[1].value) {\n bestHandFromCardsNickNameString = \"Pocket Pair\";\n } else if (allCards[0].suit == allCards[1].suit) {\n bestHandFromCardsNickNameString = \"Flush Rush\";\n } else if (allCards[0].value == allCards[1].value + 1 || allCards[0].value + 1 == allCards[1].value || (allCards[0].value == 14 && allCards[1].value == 2) || (allCards[0].value == 2 && allCards[1].value == 14) ) {\n bestHandFromCardsNickNameString = \"Straight Bait\";\n } else if (allCards[0].value == 14 || allCards[1].value == 14) {\n bestHandFromCardsNickNameString = \"A Spike\";\n } else if (allCards[0].value == 13 || allCards[1].value == 13) {\n bestHandFromCardsNickNameString = \"A Dame\";\n } else if (allCards[0].value == 12 || allCards[1].value == 12) {\n bestHandFromCardsNickNameString = \"A Jackal\";\n } else if (allCards[0].value == 11 || allCards[1].value == 11) {\n bestHandFromCardsNickNameString = \"A Fishhook\";\n } else if (allCards[0].value == 10 || allCards[1].value == 10) {\n bestHandFromCardsNickNameString = \"A Sawbuck\";\n } else if (allCards[0].value == 9 || allCards[1].value == 9) {\n bestHandFromCardsNickNameString = \"Nina Ross\";\n } else {\n bestHandFromCardsNickNameString = \"Down on Your Luck\";\n }\n \n System.out.println(\"findBestTwoCardHandName---->>> \" + bestHandFromCardsNickNameString);\n\n }", "public static void hardestBoss() {\r\n // Get array with names of bosses.\r\n BossNames[] names = BossNames.values();\r\n\r\n // Get array of damage/attack points of the bosses.\r\n Boss boss = new Boss();\r\n int bossDamage[] = boss.getBossDamage();\r\n\r\n // Calculate max damage/attack points using for-each loop.\r\n int maxDamage = bossDamage[0];\r\n for (int damage : bossDamage) {\r\n if (damage > maxDamage) {\r\n maxDamage = damage;\r\n }\r\n }\r\n\r\n // Search array for maxDamage to calculate index.\r\n int index = -1;\r\n for (int i = 0; i < bossDamage.length; i++) {\r\n if (bossDamage[i] == maxDamage) {\r\n index = i;\r\n }\r\n }\r\n\r\n if (index != -1) {\r\n console.println(\"The boss with the greatest attack points is \" + names[index] + \".\");\r\n }\r\n }", "public List<Bed> solvedBeds() {\n // TODO: Fix me.\n return bed;\n }", "@Override\n public ColorRow breakerGuess(int pegs, int colors) {\n if (turnBlacks.size() == 0 && turnWhites.size() == 0) {\n ColorRow initialGuess = breakerInitialGuess(pegs, colors);\n gameGuesses.add(initialGuess);\n return initialGuess;\n }\n int generation = 0;\n boolean feasibleNotFull = true;\n initPopulation(pegs, colors);\n calculateFitness();\n sortFeasibleByFitness(fitness, population);\n while (feasibleCodes.isEmpty()) {\n generation = 0;\n while (feasibleNotFull && generation <= GENERATION_SIZE) {\n evolvePopulation(pegs, colors);\n calculateFitness();\n sortFeasibleByFitness(fitness, population);\n feasibleNotFull = addToFeasibleCodes();\n generation += 1;\n }\n\n }\n ColorRow guess = feasibleCodes.get((int) (Math.random() * feasibleCodes.size()));\n gameGuesses.add(guess);\n return guess;\n }", "@Override\r\n\tpublic String getSpecies()\r\n\t{\r\n\t\treturn \"\";\r\n\t}", "public void initializeGame() {\n speed = 75;\n ticks = 0;\n ticksTubes = 0;\n best = null;\n score = 0;\n\n //Make a new pool of birds based on the parameters set in the species'\n //genomes\n birds.clear();\n for (final Species species : Pool.species)\n for (final Genome genome : species.genomes) {\n genome.generateNetwork();\n birds.add(new Bird(species, genome));\n }\n tubes.clear();\n }", "private static SnowyScheme constructSnowyScheme() {\n\t\t/* Setup a basic dam scheme */\n\t\t\n\t\t/*Dam setup \n\t\t * Used ML for water and MW for power, didn't add outflow as it depends on the dam, coeff wasn't changed\n\t\t */\t\t\n\t\t/**dam\n\t\t * @param count - Variable used as an identifier.\n\t\t * @param capacity - The maximum water capacity of the dam.\n\t\t * @param initialLevel - The water level of the dam starts with this value.\n\t\t * @param downstream - Variable representing where water flows when the dam is overflowing.\n\t\t * @param coeff - Coefficient of the power-water equation (used to determine power generated per litre of water).\n\t\t * @param maxPwr - max power the generator in the dam can produce \n\t\t */\n\t\t\n\t /** river\n\t * @param count - An id\n\t * @param max - A max value before flooding\n\t * @param min - A min value before drought\n\t * @param initialFlow - What the river starts at\n\t * @param length - Length of the river\n\t * @param out - Where the water flow goes.\n\t */\n\t\t\n\t\t// Dams\n\t\tDam blowering = new Dam(\"Blowering\", 1628000, 1628000/2, null , (float)0.3, 80); \n\t\tDam talbingo = new Dam(\"Talbingo\", 921400, 921400/2, null, (float)0.3, 1500); \t\t\n\t\tDam tumut2 = new Dam(\"Tumut 2\", 2677, 2677/2, null, (float)0.3, 286); \t\t\n\t\tDam tumut1 = new Dam(\"Tumut 1\", 52793, 52793/2, null, (float)0.3, 330); \t\t\n\t\tDam guthega = new Dam(\"Guthega\", 1604, 1604/2, null, (float)0.3, 60);\n\t\tDam murray = new Dam(\"Murray\", 2344, 2344/2, null, (float)0.3, 1500);\n\t\tDam jounama = new Dam(\"Jounama\", 43542, 43542/2, null, (float)0.3, 0);\n\t\tDam tooma = new Dam(\"Tooma\", 28124, 28124/2, null, (float)0.3, 0);\n\t\tDam happyJacks = new Dam(\"Happy Jacks\", 271, 271/2, null, (float)0.3, 0);\n\t\tDam tangara = new Dam(\"Tangara\", 254099, 254099/2, null, (float)0.3, 0);\n\t\tDam eucumbene = new Dam(\"Eucumbene\", 4798400, 4798400/2, null, (float)0.3, 0);\n\t\tDam jindabyne = new Dam(\"Jindabyne\", 688287, 688287/2, null, (float)0.3, 0);\n\t\tDam islandBendDam = new Dam(\"Island Bend\", 3084, 3084/2, null, (float)0.3, 0);\n\t\tDam geehi = new Dam(\"Geehi\", 21093, 21093/2, null, (float)0.3, 0);\n\t\tDam khancoban = new Dam(\"Khancoban\", 26643, 26643/2, null, (float)0.3, 0);\n\n\t\tSnowyScheme scheme = new SnowyScheme(murray);\n\t\tscheme.addDam(blowering);\n\t\tscheme.addDam(talbingo);\n\t\tscheme.addDam(tumut2);\n\t\tscheme.addDam(tumut1);\n\t\tscheme.addDam(guthega);\n\t\tscheme.addDam(murray);\n\t\tscheme.addDam(jounama);\n\t\tscheme.addDam(tooma);\n\t\tscheme.addDam(happyJacks);\n\t\tscheme.addDam(tangara);\n\t\tscheme.addDam(eucumbene);\n\t\tscheme.addDam(jindabyne);\n\t\tscheme.addDam(islandBendDam);\n\t\tscheme.addDam(geehi);\n\t\tscheme.addDam(khancoban);\n\t\t\n\t\t// Rivers\n\t\tRiver hightoBlowering = new River(\"Blowering to Ocean\", 100, 10 , 50, 10, scheme.getOcean()); // From blowering to ocean\n\t\tblowering.connectTo(hightoBlowering);\n\t\tscheme.addRiver(hightoBlowering);\n\t\tRiver junamaToblowering = new River(\"Junama To Blowering\", 54, 5 , 25, (float) 17.857, blowering);\n\t\tjounama.connectTo(junamaToblowering);\n\t\tscheme.addRiver(junamaToblowering);\n\t\tRiver talbingoTojunama = new River(\"Talbingo to Junama\", 27, 3 , 10, (float) 8.923, jounama);\n\t\ttalbingo.connectTo(talbingoTojunama);\n\t\tscheme.addRiver(talbingoTojunama);\n\t\tRiver tumutToTalbingo = new River(\"Tumut to Talbingo\", 89, 9 , 40, (float) 29.762, talbingo);\n\t\ttumut2.connectTo(tumutToTalbingo);\n\t\tscheme.addRiver(tumutToTalbingo);\n\t\tRiver tumutToTamut = new River(\"Tumut 1 to Tumut 2\", 27, 3 , 15, (float) 8.929, tumut2);\n\t\ttumut1.connectTo(tumutToTamut);\n\t\tscheme.addRiver(tumutToTamut);\n\t\tRiver toomaToTumut = new River(\"Tooma to Tumut 1\", 45, 5, 25, (float) 14.881, tumut1);\n\t\ttooma.connectTo(toomaToTumut);\n\t\tscheme.addRiver(toomaToTumut);\n\t\tRiver happyJToTumut = new River(\"Happy Jacks to Tumut 1\", 45, 5, 25, (float) 14.881, tumut1);\n\t\thappyJacks.connectTo(happyJToTumut);\n\t\tscheme.addRiver(happyJToTumut);\n\t\tPipe eucumbeneToHappyJ = new Pipe(\"Eucumbene to Happy Jacks\", 50 , 100, (float) 0.5, eucumbene, happyJacks);\n\t\tscheme.addPipe(eucumbeneToHappyJ);\n\t\tRiver tangaraToEucumbene = new River(\"Tangara to Eucumbene\", 107, 10 , 50, (float) 35.714, eucumbene);\n\t\ttangara.connectTo(tangaraToEucumbene);\n\t\tscheme.addRiver(tangaraToEucumbene);\n\t\tRiver eucumbeneToJindabyne = new River(\"Eucumbene To Jinabyne\", 928, 93 , 400, (float) 32.738, jindabyne);\n\t\teucumbene.connectTo(eucumbeneToJindabyne);\n\t\tscheme.addRiver(eucumbeneToJindabyne);\n\t\tRiver snowyRiver = new River(\"Snowy River\", 1000, 10 , 500, 100, scheme.getOcean());\n\t\tjindabyne.connectTo(snowyRiver);\n\t\tscheme.addRiver(snowyRiver);\n\t\tPipe jindabyneToIsland = new Pipe(\"JindaByne to Island Bend\", 50, 100, (float) 0.5, islandBendDam, jindabyne);\n\t\tscheme.addPipe(jindabyneToIsland);\n\t\tPipe eucumbeneToIsland = new Pipe(\"Eucumbene to Island\", 50, 100, (float) 0.5, islandBendDam, eucumbene);\n\t\tscheme.addPipe(eucumbeneToIsland);\n\t\tRiver guthegaToIsland = new River(\"Guthega to Island Bend\", 54, 5 , 20, (float) 17.857, islandBendDam);\n\t\tguthega.connectTo(guthegaToIsland);\n\t\tscheme.addRiver(guthegaToIsland);\n\t\tRiver islandToGeehi = new River(\"Island Bend to Geehi\", 48, 5 , 20, (float) 16.071, geehi);\n\t\tislandBendDam.connectTo(islandToGeehi);\n\t\tscheme.addRiver(islandToGeehi);\n\t\tRiver geehiToMurray = new River(\"Geehi to Murray\", 45, 5 , 20, (float) 14.881, murray);\n\t\tgeehi.connectTo(geehiToMurray);\n\t\tscheme.addRiver(geehiToMurray);\n\t\tRiver murrayToKhancoban = new River(\"Murray to Khancoban\", 31, 3 , 10, (float) 10.119, khancoban);\n\t\tmurray.connectTo(murrayToKhancoban);\n\t\tscheme.addRiver(murrayToKhancoban);\n\t\tRiver khancobanRiver = new River(\"Khancoban to Ocean\", 100, 0 , 50, 100, scheme.getOcean());\n\t\tkhancoban.connectTo(khancobanRiver);\n\t\tscheme.addRiver(khancobanRiver);\n\n\t\tSystem.out.print(\"The model is \");\n\t\t\n\t\tif(scheme.validateModel())\n\t\t\tSystem.out.println(\"valid\");\n\t\telse{\n\t\t\tSystem.out.println(\"invalid\");\n\t\t}\n\t\t\n\t\treturn scheme;\n\t}", "public String getSpecies() {\n if(species == null)\n return \"\";\n return species;\n }", "public void updateSpecies (String treeSpeciesName, int crownShape,\r\n\t\t\t\t\t\t\t\tdouble ellipsoidTruncationRatio, \r\n\t\t\t\t\t\t\t\tdouble heightDbhAllometricCoeffA, double heightDbhAllometricCoeffB,\r\n\t\t\t\t\t\t\t\tdouble crownDbhAllometricCoeffA, double crownDbhAllometricCoeffB,\r\n\t\t\t\t\t\t\t\tdouble stemDbhAllometricCoeffA, double stemDbhAllometricCoeffB, double stemDbhAllometricCoeffC, \r\n\t\t\t\t\t\t\t\tdouble dcbFromDbhAllometricCoeff,\r\n\t\t\t\t\t\t\t\tdouble stumpToStemBiomassRatio,\r\n\t\t\t\t\t\t\t\tdouble cRAreaToFRLengthRatio, \r\n\t\t\t\t\t\t\t\tdouble initialTargetLfrRatio,\r\n\t\t\t\t\t\t\t\tdouble leafAreaCrownVolCoefA, double leafAreaCrownVolCoefB,\r\n\t\t\t\t\t\t\t\tdouble woodAreaDensity, double leafParAbsorption, double leafNirAbsorption, double clumpingCoef,\r\n\t\t\t\t\t\t\t\tint phenologyType,\r\n\t\t\t\t\t\t\t\tint budBurstTempAccumulationDateStart,\r\n\t\t\t\t\t\t\t\tdouble budBurstTempThreshold,\r\n\t\t\t\t\t\t\t\tdouble budBurstAccumulatedTemp,\r\n\t\t\t\t\t\t\t\tint leafExpansionDuration,\r\n\t\t\t\t\t\t\t\tint budBurstToLeafFallDuration,\r\n\t\t\t\t\t\t\t\tint leafFallDuration,\r\n\t\t\t\t\t\t\t\tdouble leafFallFrostThreshold,\r\n\t\t\t\t\t\t\t\tint budBurstDelayMinAfterPollaring,\r\n\t\t\t\t\t\t\t\tint budBurstDelayMaxAfterPollaring,\r\n\t\t\t\t\t\t\t\tdouble stemFlowCoefficient,\r\n\t\t\t\t\t\t\t\tdouble stemFlowMax,\r\n\t\t\t\t\t\t\t\tdouble wettability,\r\n\t\t\t\t\t\t\t\tdouble transpirationCoefficient,\r\n\t\t\t\t\t\t\t\tdouble lueMax,\r\n\t\t\t\t\t\t\t\tint leafAgeForLueMax,\r\n\t\t\t\t\t\t\t\tdouble leafSenescenceTimeConstant,\r\n\t\t\t\t\t\t\t\tdouble leafCarbonContent,\r\n\t\t\t\t\t\t\t\tdouble leafMassArea,\r\n\t\t\t\t\t\t\t\tdouble luxuryNCoefficient,\r\n\t\t\t\t\t\t\t\tdouble targetNCoefficient,\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble rootNRemobFraction,\r\n\t\t\t\t\t\t\t\tdouble leafNRemobFraction,\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble targetNSCFraction,\r\n\t\t\t\t\t\t\t\tdouble maxNSCUseFraction,\r\n\t\t\t\t\t\t\t\tdouble maxNSCUseFoliageFraction,\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tint rsStressMethod,\r\n\t\t\t\t\t\t\t\tint lueStressMethod,\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble rsNoStressResponsiveness,\r\n\t\t\t\t\t\t\t\tdouble rsWaterStressResponsiveness,\r\n\t\t\t\t\t\t\t\tdouble rsNitrogenStressResponsiveness,\r\n\t\t\t\t\t\t\t\tdouble lueWaterStressResponsiveness,\r\n\t\t\t\t\t\t\t\tdouble lueNitrogenStressResponsiveness,\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble maxTargetLfrRatioDailyVariation,\r\n\t\t\t\t\t\t\t\tdouble targetLfrRatioUpperDrift,\r\n\t\t\t\t\t\t\t\tdouble minTargetLfrRatio,\r\n\t\t\t\t\t\t\t\tdouble maxTargetLfrRatio,\r\n\t\t\t\t\t\t\t\tdouble optiNCBranch,\r\n\t\t\t\t\t\t\t\tdouble optiNCCoarseRoot,\r\n\t\t\t\t\t\t\t\tdouble optiNCFineRoot,\r\n\t\t\t\t\t\t\t\tdouble optiNCFoliage,\r\n\t\t\t\t\t\t\t\tdouble optiNCStem,\r\n\t\t\t\t\t\t\t\tdouble optiNCStump,\r\n\t\t\t\t\t\t\t\tdouble woodDensity,\r\n\t\t\t\t\t\t\t\tdouble branchVolumeRatio,\r\n\t\t\t\t\t\t\t\tdouble woodCarbonContent,\r\n\t\t\t\t\t\t\t\tdouble maxCrownRadiusInc,\r\n\t\t\t\t\t\t\t\tdouble maxHeightInc,\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tdouble imbalanceThreshold,\r\n\t\t\t\t\t\t\t\tdouble leafSenescenceRate,\r\n\t\t\t\t\t\t\t\tdouble coarseRootAnoxiaResistance,\r\n\t\t\t\t\t\t\t\tdouble specificRootLength,\r\n\t\t\t\t\t\t\t\tdouble colonisationThreshold,\r\n\t\t\t\t\t\t\t\tdouble colonisationFraction,\r\n\t\t\t\t\t\t\t\tdouble fineRootLifespan,\r\n\t\t\t\t\t\t\t\tdouble fineRootAnoxiaLifespan,\r\n\t\t\t\t\t\t\t\tdouble horizontalPreference,\r\n\t\t\t\t\t\t\t\tdouble geotropismFactor,\r\n\t\t\t\t\t\t\t\tdouble localWaterUptakeFactor,\r\n\t\t\t\t\t\t\t\tdouble sinkDistanceEffect,\r\n\t\t\t\t\t\t\t\tdouble localNitrogenUptakeFactor,\r\n\t\t\t\t\t\t\t\tint coarseRootTopologyType,\r\n\t\t\t\t\t\t\t\tdouble rootDiameter, double rootConductivity,\r\n\t\t\t\t\t\t\t\tdouble alpha,\r\n\t\t\t\t\t\t\t\tdouble minTranspirationPotential,double maxTranspirationPotential,\r\n\t\t\t\t\t\t\t\tdouble bufferPotential, double longitudinalResistantFactor) {\r\n\r\n\t\tthis.name = treeSpeciesName;\r\n\t\tthis.crownShape = crownShape;\r\n\t\tthis.ellipsoidTruncationRatio = ellipsoidTruncationRatio;\r\n\t\tthis.heightDbhAllometricCoeffA = heightDbhAllometricCoeffA;\r\n\t\tthis.heightDbhAllometricCoeffB = heightDbhAllometricCoeffB;\r\n\t\tthis.crownDbhAllometricCoeffA = crownDbhAllometricCoeffA;\r\n\t\tthis.crownDbhAllometricCoeffB = crownDbhAllometricCoeffB;\r\n\t\tthis.stemDbhAllometricCoeffA = stemDbhAllometricCoeffA;\r\n\t\tthis.stemDbhAllometricCoeffB = stemDbhAllometricCoeffB;\r\n\t\tthis.stemDbhAllometricCoeffC = stemDbhAllometricCoeffC;\r\n\t\tthis.dcbFromDbhAllometricCoeff = dcbFromDbhAllometricCoeff;\r\n\t\tthis.stumpToStemBiomassRatio = stumpToStemBiomassRatio;\r\n\t\tthis.cRAreaToFRLengthRatio = cRAreaToFRLengthRatio;\r\n\t\tthis.initialTargetLfrRatio = initialTargetLfrRatio; \r\n\t\tthis.leafAreaCrownVolCoefA = leafAreaCrownVolCoefA;\r\n\t\tthis.leafAreaCrownVolCoefB = leafAreaCrownVolCoefB;\r\n\t\tthis.woodAreaDensity = woodAreaDensity;\r\n\t\tthis.leafParAbsorption = leafParAbsorption;\r\n\t\tthis.leafNirAbsorption = leafNirAbsorption;\r\n\t\tthis.clumpingCoef = clumpingCoef;\r\n\t\tthis.phenologyType = phenologyType;\r\n\t\tthis.budBurstTempAccumulationDateStart = budBurstTempAccumulationDateStart;\r\n\t\tthis.budBurstTempThreshold = budBurstTempThreshold;\r\n\t\tthis.budBurstAccumulatedTemp = budBurstAccumulatedTemp;\r\n\t\tthis.leafExpansionDuration = leafExpansionDuration;\r\n\t\tthis.budBurstToLeafFallDuration = budBurstToLeafFallDuration;\r\n\t\tthis.leafFallDuration = leafFallDuration;\r\n\t\tthis.leafFallFrostThreshold = leafFallFrostThreshold;\r\n\t\tthis.budBurstDelayMinAfterPollaring = budBurstDelayMinAfterPollaring;\r\n\t\tthis.budBurstDelayMaxAfterPollaring = budBurstDelayMaxAfterPollaring;\r\n\t\tthis.stemFlowCoefficient = stemFlowCoefficient;\r\n\t\tthis.stemFlowMax = stemFlowMax;\r\n\t\tthis.wettability = wettability;\r\n\t\tthis.transpirationCoefficient = transpirationCoefficient;\r\n\t\tthis.lueMax = lueMax;\r\n\t\tthis.leafAgeForLueMax = leafAgeForLueMax;\r\n\t\tthis.leafSenescenceTimeConstant = leafSenescenceTimeConstant;\r\n\t\tthis.leafCarbonContent = leafCarbonContent;\r\n\t\tthis.leafMassArea = leafMassArea;\r\n\t\tthis.luxuryNCoefficient = luxuryNCoefficient;\r\n\t\tthis.targetNCoefficient = targetNCoefficient;\r\n\t\tthis.rootNRemobFraction = rootNRemobFraction;\r\n\t\tthis.leafNRemobFraction = leafNRemobFraction;\r\n\t\tthis.targetNSCFraction = targetNSCFraction;\r\n\t\tthis.maxNSCUseFraction = maxNSCUseFraction;\r\n\t\tthis.maxNSCUseFoliageFraction = maxNSCUseFoliageFraction;\r\n\t\tthis.rsNoStressResponsiveness = rsNoStressResponsiveness;\r\n\t\tthis.rsWaterStressResponsiveness = rsWaterStressResponsiveness;\r\n\t\tthis.rsNitrogenStressResponsiveness = rsNitrogenStressResponsiveness;\r\n\t\tthis.lueWaterStressResponsiveness = lueWaterStressResponsiveness;\r\n\t\tthis.lueNitrogenStressResponsiveness = lueNitrogenStressResponsiveness;\r\n\t\tthis.maxTargetLfrRatioDailyVariation = maxTargetLfrRatioDailyVariation;\r\n\t\tthis.targetLfrRatioUpperDrift = targetLfrRatioUpperDrift;\r\n\t\tthis.minTargetLfrRatio = minTargetLfrRatio;\r\n\t\tthis.maxTargetLfrRatio = maxTargetLfrRatio;\r\n\t\tthis.optiNCBranch = optiNCBranch;\r\n\t\tthis.optiNCCoarseRoot = optiNCCoarseRoot;\r\n\t\tthis.optiNCFineRoot = optiNCFineRoot;\r\n\t\tthis.optiNCFoliage = optiNCFoliage;\r\n\t\tthis.optiNCStem = optiNCStem;\r\n\t\tthis.optiNCStump = optiNCStump;\r\n\t\tthis.woodDensity = woodDensity;\r\n\t\tthis.branchVolumeRatio = branchVolumeRatio;\r\n\t\tthis.woodCarbonContent = woodCarbonContent;\t\r\n\t\tthis.maxCrownRadiusInc = maxCrownRadiusInc;\r\n\t\tthis.maxHeightInc = maxHeightInc;\r\n\t\tthis.leafSenescenceRate = leafSenescenceRate;\r\n\t\tthis.imbalanceThreshold= imbalanceThreshold;\r\n\t\tthis.specificRootLength = specificRootLength;\r\n\t\tthis.coarseRootAnoxiaResistance=coarseRootAnoxiaResistance;\r\n\t\tthis.colonisationThreshold = colonisationThreshold;\r\n\t\tthis.colonisationFraction = colonisationFraction;\r\n\t\tthis.fineRootLifespan= fineRootLifespan;\r\n\t\tthis.fineRootAnoxiaLifespan = fineRootAnoxiaLifespan;\r\n\t\tthis.horizontalPreference= horizontalPreference;\r\n\t\tthis.geotropismFactor= geotropismFactor;\r\n\t\tthis.localWaterUptakeFactor = localWaterUptakeFactor;\r\n\t\tthis.sinkDistanceEffect = sinkDistanceEffect;\r\n\t\tthis.localNitrogenUptakeFactor = localNitrogenUptakeFactor;\r\n\t\tthis.coarseRootTopologyType = coarseRootTopologyType;\r\n\t\tthis.treeRootDiameter = rootDiameter;\r\n\t\tthis.treeRootConductivity = rootConductivity;\r\n\t\tthis.treeAlpha = alpha;\r\n\t\tthis.treeMinTranspirationPotential = minTranspirationPotential;\r\n\t\tthis.treeMaxTranspirationPotential = maxTranspirationPotential;\r\n\t\tthis.treeBufferPotential = bufferPotential;\r\n\t\tthis.treeLongitudinalResistantFactor = longitudinalResistantFactor;\r\n\t}", "private void collision(){\n\t\tboolean touched = false;\n\t\tboolean hit;\n\t\tint j =0;\n\t\twhile ( j< this.game_.getSaveBaby().size() && !touched){\n\t\t\tBabyBunnies b = this.game_.getSaveBaby().get(j);\n\t\t\ttouched = this.game_.getBunnyHood().getPosition().dst(b.getPosition())<=80;\n\t\t\thit = this.game_.getWolf().getPosition().dst(b.getPosition())<=80;\n\t\t\tif (touched){\n\t\t\t\tthis.game_.setBabySaved(b);\n\t\t\t}\n\t\t\tif (hit){\n\t\t\t\tthis.game_.wolfCatchBunnies(b);\n\t\t\t\t/**\n\t\t\t\t * Test de callback, retour vers l app android\n\t\t\t\t */\n\t\t\t\tif(this.game_.getScoreWolf()==3){\n\t\t\t\t\tif (this.gameCallBack != null) {\n\n this.gameCallBack.gameOverActivity(this.game_.getScoreBunny());\n\t\t\t\t\t\tthis.isGameOver=true;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tGdx.app.log(\"MyGame\", \"To use this class you must implement MyGameCallback!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tj++;\n\t\t}\n\t}", "void breed() {\n\t\tSystem.out.println(\"Ape breeding\");\n\t}", "public void findLittlesWhoRankedBig(String selectedBig){\n ArrayList<String> littlesWhoWant = new ArrayList<>();\n for (Map.Entry little: matching.littlesPreferences.entrySet()){\n String aLittle = little.getKey().toString();\n ArrayList<String> prefBigs = matching.littlesPreferences.get(aLittle);\n if (prefBigs.contains(selectedBig)){\n littlesWhoWant.add(aLittle);\n }\n }\n setLinedText(whoRanksBigResultsLabel, littlesWhoWant);\n }", "public static void ageAnimal (Species [][] map) {\n \n // Check map for animals\n for (int y = 0; y < map[0].length; y++) {\n for (int x = 0; x < map.length; x++) {\n \n // Age any sheep found\n if (map[y][x] instanceof Sheep) {\n ((Sheep)map[y][x]).gainAge();\n \n // Age any wolves found\n } else if (map[y][x] instanceof Wolf) {\n ((Wolf)map[y][x]).gainAge();\n }\n \n }\n }\n \n }", "public int getNumberOfAnimalSpecies() {\n\t\treturn numberOfAnimalSpecies;\n\t}", "public static String getSpeciesInfo(TreeList list, String species){\n\t\t// create and new string that will act as header that lets the user know that \n\t\t// the program will display the popularity of the tree species in the city\n\t\tString info= \"Popularity in the city:\\n\";\n\t\tString equals= \":\";\n\t\t\n\t\t// create an array to hold all the boroughs in NYC\n\t\tString[] boroArray= {\"NYC\",\"Manhattan\",\"Bronx\",\"Brooklyn\",\"Queens\",\"Staten Island\"};\n\t\t\n\t\t// iterate through the array to obtain which borough the appropriate information\n\t\t// needs to be gathered for\n\t\tfor (int x=0; x<boroArray.length;x++){\n\t\t\tString boro= boroArray[x];\n\t\t\t// if boro equals NYC create a formatted string that includes the getTotalNumberOfTrees() method\n\t\t\t// to the info string. If not, create a similar formatted string for the boroughs instead\n\t\t\tif (boro.equals(\"NYC\")){\n\t\t\t\t// create an integer variable that represents the number of the \n\t\t\t\t// particular tree species that grows in NYC\n\t\t\t\tint treesInCity = 0;\n\t\t\t\t\n\t\t\t\t// create a loop to search through each borough and add the number of the particular\n\t\t\t\t// tree species that appears in every borough to treesInCity\n\t\t\t\tfor (int i=1; i<boroArray.length;i++){\n\t\t\t\t\ttreesInCity+=list.getCountByTreeSpeciesBorough(species,boroArray[i]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// create an integer variable that represents the total number of trees in NYC\n\t\t\t\tint totalTreesInCity = list.getTotalNumberOfTrees();\n\t\t\t\t\n\t\t\t\t// create an integer variable that represents the percent amount of that species in NYC.\n\t\t\t\t// send treesInCity and totalTreesInCity to the calculatePercent method to find the percent amount\n\t\t\t\t// of a particular tree species in NYC\n\t\t\t\tfloat percentOfSpecies = calculatePercent(treesInCity,totalTreesInCity);\n\t\t\t\t\n\t\t\t\t// add NYC to the info string\n\t\t\t\tinfo+=String.format(\"\\t%s%12s\",boro,equals);\n\t\t\t\t\n\t\t\t\t// create a formatted string to add to info that contains all the information\n\t\t\t\tString treeInfo= String.format(\"%,d(%,d)\", treesInCity,totalTreesInCity);\n\t\t\t\tinfo+=String.format(\"%18s\\t%6.2f\",treeInfo,percentOfSpecies);\n\t\t\t\tinfo+=\"%\\n\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// create an integer variable that represents the number of the particular tree species that grows in the borough\n\t\t\t\tint treesInBoro = list.getCountByTreeSpeciesBorough(species,boro);\n\t\t\t\t\n\t\t\t\t// create an integer variable that represents the total number of trees in the borough\n\t\t\t\tint totalTreesInBoro = list.getCountByBorough(boro);\n\t\t\t\t\n\t\t\t\t// create an integer variable that represents the percent amount of that species in the borough\n\t\t\t\tfloat percentOfSpecies;\n\t\t\t\t\n\t\t\t\t// if the trees in the borough is 0 as well as the total trees, set percentOfSpecies\n\t\t\t\t// equal to 0\n\t\t\t\tif (treesInBoro==0&&totalTreesInBoro==0){\n\t\t\t\t\tpercentOfSpecies=0;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t// create an integer variable that represents the percent amount of that species in the borough.\n\t\t\t\t\t// send treesInBoro and totalTreesInBoro to the calculatePercent method to find the percent amount\n\t\t\t\t\t// of a particular tree species in the borough\n\t\t\t\t\tpercentOfSpecies = calculatePercent(treesInBoro,totalTreesInBoro);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// format the info string\n\t\t\t\tif (boro.equalsIgnoreCase(\"manhattan\")){\n\t\t\t\t\tinfo+=String.format(\"\\t%s%6s\",boro,equals);\n\t\t\t\t}\n\t\t\t\telse if (boro.equalsIgnoreCase(\"bronx\")){\n\t\t\t\t\tinfo+=String.format(\"\\t%s%10s\",boro,equals);\n\t\t\t\t}\n\t\t\t\telse if (boro.equalsIgnoreCase(\"brooklyn\")){\n\t\t\t\t\tinfo+=String.format(\"\\t%s%7s\",boro,equals);\n\t\t\t\t}\n\t\t\t\telse if (boro.equalsIgnoreCase(\"queens\")){\n\t\t\t\t\tinfo+=String.format(\"\\t%s%9s\",boro,equals);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tinfo+=String.format(\"\\t%s%2s\",boro,equals);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// create a formatted string to add to info that contains all the information\n\t\t\t\tString treeInfo= String.format(\"%,d(%,d)\", treesInBoro,totalTreesInBoro);\n\t\t\t\tinfo+=String.format(\"%18s\\t%6.2f\",treeInfo, percentOfSpecies);\n\t\t\t\tinfo+=\"%\\n\";\n\t\t\t}\n\n\t\t}\n\t\t// return the formatted info string\n\t\treturn info;\n\t}", "public void baptism() {\n for (Card targetCard : Battle.getInstance().getActiveAccount().getActiveCardsOnGround().values()) {\n if (targetCard instanceof Minion) {\n targetCard.setHolyBuff(2, 1);\n }\n }\n }", "public boolean lookAtWinCard(){\n boolean winCard = false;\n for(Card cards: playerHand){\n if(cards.getCardName().equals(\"Magnetite\")){\n winCard = true;\n }\n }\n return winCard;\n }", "public boolean computerGuess()\r\n\t{\r\n\t\tboolean isWhite;\r\n\t\tint randomBool = (int) (Math.random()*50);\r\n\t\tif(randomBool<25)\r\n\t\t\tisWhite = true;\r\n\t\telse\r\n\t\t\tisWhite = false;\r\n\t\twhile(newGame.containsColor(isWhite) == false)\r\n\t\t{\r\n\t\t\trandomBool = (int) (Math.random()*50);\r\n\t\t\tif(randomBool<25)\r\n\t\t\t\tisWhite = true;\r\n\t\t\telse\r\n\t\t\t\tisWhite = false;\r\n\t\t}\r\n\t\tint randomPanel = (int) (Math.random()*newGame.getUserHandLength());\r\n\t\t//System.out.println(randomPanel);\r\n\t\tint randomGuess = (int) (Math.random()*12);\r\n\t\tif(newGame.getCompHand().contains(new Panel(isWhite,randomGuess,false)))\r\n\t\t{\r\n\t\t\tif(newGame.getUserHand().getPanel(randomPanel).compareTo(new Panel(isWhite,randomGuess,false)) == 0)\r\n\t\t\t\treturn true;\r\n\t\t\telse \r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean VerifyHumanChoice(int value){\n String card = handHuman.get(value);\n System.out.print(\"CARD IN VERIFY HUMAN\" + card);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Can play any card ontop to determine suite\n topCard = card;\n return true;\n }\n\n if(card.contains(\"8\")){\n //valid because 8s are wild cards, human can place it\n topCard = card;\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if(firstLetter.equals(topFirstLetter)){\n topCard = card;\n return true;\n }\n\n else{\n if(topFirstLetter.equals(\"c\")){\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"h\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"d\")){\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n\n else if(topFirstLetter.equals(\"s\")){\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if(card.contains(temp)){\n topCard = card;\n return true;\n }\n\n }\n }\n\n //You can't play this card\n return false;\n }", "public int eightball (int points, int life)\n {\n\tchar doesntmatter = IBIO.inputChar (\"Type anything to proceed on your journey: \");\n\tprintSlow (\"\\nOff into the hallways, just like last year. As you glance at your schedule, you realize you have a new course - Divination?\");\n\tprintSlow (\"You walk into your class, spotting a weird teacher with even weirder glasses, who calls your name and asks you to read a magical leaf\");\n\tint prediction = (int) (Math.random () * 5) + 1;\n\tprintSlow (\"\\n\\n\\t***The Divination Tea Leaf***\");\n\tSystem.out.println (\"\\t\\t |\");\n\tSystem.out.println (\"\\t\\t .'|'.\");\n\t;\n\tSystem.out.println (\"\\t\\t /.'|\\\\ \\\\ \");\n\tSystem.out.println (\"\\t\\t | /|'.|\");\n\tSystem.out.println (\"\\t\\t \\\\ |\\\\/\");\n\tSystem.out.println (\"\\t\\t \\\\|/\");\n\tSystem.out.println (\"\\t\\t , \");\n\tprintSlow (\"~Endorsed and encouraged by Hogwart's very own Prof. Trelawny~\");\n\tprintSlow (\"Your inner eye believes that the following about your current quest is true:\\n\");\n\n\t//int yn = IBIO.inputInt (\"Enter a yes or no question: \");\n\t// Maybe I can make ^ change something based on the Tea Leaf's output\n\tif (prediction == 1)\n\t{\n\t printSlow (\"The divination leaf seems to be in your favour, increasing your courage for future battles!\\n\\n\");\n\t points += 5;\n\t return 1;\n\t}\n\n\n\telse if (prediction == 2)\n\t{\n\t printSlow (\"You feel empowered knowing that the odds of your victory in the future will be empowered.\\n\\n\");\n\t points += 10;\n\t return 1;\n\t}\n\n\n\telse if (prediction == 3)\n\t{\n\t printSlow (\"You feel slightly weak after staring at a leaf for a long amount of time without any resolve\\n\\n\");\n\t points -= 5;\n\t return 1;\n\t}\n\n\n\telse if (prediction == 4)\n\t{\n\t printSlow (\"You read through the leaf that your chances in the upcoming battle are greatly reduced.\\n\\n\");\n\t points -= 10;\n\t return 1;\n\t}\n\n\n\telse\n\t{\n\t printSlow (\"Professor Trelawny runs over to you, and shrieks *AAAAAAAHHHH* before changing her tone of voice\");\n\t printSlow (\"As someone must pass every year, this year the leaves say it SHALL be you!\\n\\n\");\n\t return 2;\n\t}\n }", "public boolean isGuessed() {\n return isGuessed;\n }", "public boolean getHasGuessed() {\n\t\treturn this.hasGuessed;\r\n\t}", "public void launchBall() {\n\n\t\tint contBlue = 0, contRed = 0, red = 0, blue = 0, maxScore = 0;\n\t\t// You can modify this value to play more matches (Important: Odd/Uneven value)\n\t\tint bestOf = 5;\n\n\t\tfor (int i = 0; i < bestOf; i++) {\n\n\t\t\tSystem.out.println(\"Red team launch\");\n\t\t\tred = (int) (Math.random() * (200 - 0));\n\t\t\tSystem.out.println(red);\n\t\t\tmaxScore = (red > maxScore) ? red : maxScore;\n\n\t\t\tSystem.out.println(\"Blue team launch\");\n\t\t\tblue = (int) (Math.random() * (200 - 0));\n\t\t\tSystem.out.println(blue);\n\t\t\t// Find the highest score between bluePoints and redPoints\n\t\t\tmaxScore = (blue > maxScore) ? blue : maxScore;\n\t\t\t// Count which team has more score than the other one\n\t\t\tif (red > blue)\n\n\t\t\t\tcontRed++;\n\n\t\t\telse\n\n\t\t\t\tcontBlue++;\n\n\t\t}\n\t\tint option;\n\t\t// Try: Throw error if you introduce a String or Char instead Integer\n\t\ttry {\n\t\t\tdo {\n\t\t\t\tSystem.out.println(\"What ratio was the highest score? (1.0-50/2.50-100/3.100-150/4.150-200)\");\n\t\t\t\toption = scanner.nextInt();\n\t\t\t\t// Minigame to hit the ratio of highest score\n\t\t\t\tswitch (option) {\n\n\t\t\t\tcase 1: {\n\n\t\t\t\t\tif (maxScore >= 0 && maxScore < 50)\n\t\t\t\t\t\tSystem.out.println(\"You win, the highest score is: \" + maxScore);\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Sorry, that's not the highest score\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 2: {\n\t\t\t\t\tif (maxScore >= 50 && maxScore < 100)\n\t\t\t\t\t\tSystem.out.println(\"You win, the highest score is: \" + maxScore);\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Sorry, that's not the highest score\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t\tcase 3: {\n\t\t\t\t\tif (maxScore >= 100 && maxScore < 150)\n\t\t\t\t\t\tSystem.out.println(\"You win, the highest score is: \" + maxScore);\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Sorry, that's not the highest score\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tcase 4: {\n\t\t\t\t\tif (maxScore >= 150 && maxScore <= 200)\n\t\t\t\t\t\tSystem.out.println(\"You win, the highest score is: \" + maxScore);\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Sorry, that's not the highest score\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tSystem.err.println(\"Insert valid value\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (option > 4 || option < 1);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Please, insert an Intenger value\");\n\t\t\tscanner.next();\n\t\t}\n\t\tSystem.out.println(\"The highest score was \" + maxScore);\n\n\t\tSystem.out.println(\"The match is over Blue: \" + contBlue + \" wins, y Red: \" + contRed + \" wins\");\n\t\t// Show which team won\n\t\tif (contRed > contBlue) {\n\n\t\t\tSystem.out.println(\"Red wins\");\n\t\t\tthis.redWins = contRed;\n\n\t\t} else {\n\n\t\t\tSystem.out.println(\"Blue wins\");\n\t\t\tthis.blueWins = contBlue;\n\n\t\t}\n\t}", "public void guess(){\n\t\tfor(int i=0;i<size;i++){\n\t\t\tfor(int j=0;j<size;j++){\n\t\t\t\tif(!boundary[i][j]){\n\t\t\t\t\tvalues[i][j]=100/(.05*i+1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}", "public boolean throwPokeball(AbstractPokemon wildPokemon)\n {\n System.out.println(toString() + \" threw a \" + pokeball.toString() + \"!\");\n int ballFactor = pokeball.getFactor();\n if(pokeball instanceof Masterball)\n return true;\n int d = wildPokemon.getCatchRate() / ballFactor;\n if (d >= 256)\n return false;\n else\n {\n int pokemonsHP = wildPokemon.getHealth();\n if (pokemonsHP == 0)\n pokemonsHP = 4;\n int factor1 = (wildPokemon.getMaxHealth() * 255) / ballFactor;\n int factor2 = wildPokemon.getHealth() / 4;\n if (factor2 == 0)\n factor2 = 1;\n int factorTotal = factor1 / factor2;\n if (factorTotal > 255)\n factorTotal = 255;\n int probabilityOfCapture = (d * factorTotal) / 255;\n if (probabilityOfCapture > 70)\n return true;\n else\n return false;\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tString genome = MyFileReader.loadGenome(\"data/testgenome.txt\");\n\t\tgenome += \"$\";\n\t\t\t\t\n\t\tBurrowsWheelerStructure bws = new BurrowsWheelerStructure(genome);\n\t\tbws.init();\n\t\t\n//\t\tbwt.printTable(bwt.suffixArray);\n//\t\tbwt.printTable(bwt.L);\n//\t\tbwt.printTable(bwt.F);\n//\t\tbwt.printTable(bwt.encode());\n\t\tSystem.out.println(bws.map);\n\t\tSystem.out.println(bws.first);\n//\t\tbwt.printTable(bwt.ranks);\n\t\t\n\t\tbws.find(new Seed(\"ggg\"));\n\t\t\n\n\t}", "public interface Species {\r\n\r\n\r\n\t/**\r\n\t * Calculate the amount that a species will spawn.\r\n\t */\r\n\tvoid calculateSpawnAmount();\r\n\r\n\t/**\r\n\t * Choose a worthy parent for mating.\r\n\t * \r\n\t * @return The parent genome.\r\n\t */\r\n\tGenome chooseParent();\r\n\r\n\t/**\r\n\t * @return The age of this species.\r\n\t */\r\n\tint getAge();\r\n\r\n\t/**\r\n\t * @return The best score for this species.\r\n\t */\r\n\tdouble getBestScore();\r\n\r\n\t/**\r\n\t * @return How many generations with no improvement.\r\n\t */\r\n\tint getGensNoImprovement();\r\n\r\n\t/**\r\n\t * @return Get the leader for this species. The leader is the genome with\r\n\t * the best score.\r\n\t */\r\n\tGenome getLeader();\r\n\r\n\t/**\r\n\t * @return The numbers of this species.\r\n\t */\r\n\tList<Genome> getMembers();\r\n\r\n\t/**\r\n\t * @return The number of genomes this species will try to spawn into the\r\n\t * next generation.\r\n\t */\r\n\tdouble getNumToSpawn();\r\n\r\n\t/**\r\n\t * @return The number of spawns this species requires.\r\n\t */\r\n\tdouble getSpawnsRequired();\r\n\r\n\t/**\r\n\t * @return The species ID.\r\n\t */\r\n\tlong getSpeciesID();\r\n\r\n\t/**\r\n\t * Purge old unsuccessful genomes.\r\n\t */\r\n\tvoid purge();\r\n\r\n\t/**\r\n\t * Set the age of this species.\r\n\t * @param age The age.\r\n\t */\r\n\tvoid setAge(int age);\r\n\r\n\t/**\r\n\t * Set the best score.\r\n\t * @param bestScore The best score.\r\n\t */\r\n\tvoid setBestScore(double bestScore);\r\n\r\n\t/**\r\n\t * Set the number of generations with no improvement.\r\n\t * @param gensNoImprovement The number of generations with\r\n\t * no improvement.\r\n\t */\r\n\tvoid setGensNoImprovement(int gensNoImprovement);\r\n\r\n\t/**\r\n\t * Set the leader of this species.\r\n\t * @param leader The leader of this species.\r\n\t */\r\n\tvoid setLeader(Genome leader);\r\n\r\n\t/**\r\n\t * Set the number of spawns required.\r\n\t * @param spawnsRequired The number of spawns required.\r\n\t */\r\n\tvoid setSpawnsRequired(double spawnsRequired);\r\n}", "public void infect() {\n\t\tPlagueAgent current = this;\n\t\tif (!current.infected) {\n\t\t\tfor (PlagueAgent a : plagueWorld.getNeighbors(current, 5)) {\n\t\t\t\tif (a.infected) {\n\t\t\t\t\tint luck = Utilities.rng.nextInt(100);\n\t\t\t\t\tif (luck < plagueWorld.VIRULENCE) {\n\t\t\t\t\t\tthis.infected = true;\n\t\t\t\t\t\tplagueWorld.newInfection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplagueWorld.changed();\n\t}", "public static void showHands(){\n Scanner scan=new Scanner(System.in);//call the Scanner constructor\n int Deck[]=new int[52];//set up the array for deck\n String answer=\"\";\n do{\n //store 0 to 51 into the Deck array\n for(int i=0;i<Deck.length;i++){\n Deck[i] = i; \n }\n \n int Hand[]={-1,-1,-1,-1,-1};//set up and initialize the array for hand\n \n Random r = new Random ();//Decalre a instance of the Random generator\n int k = Deck.length;//declare a variable to show the effective length of the Deck array\n //set up a loop to draw cards from the deck ramdomly\n for(int j=0;j<Hand.length;j++){\n int draw = r.nextInt(k-1);\n Hand[j] = Deck[draw];//store the ramdom pick from Deck into Hand\n //set the random pick in Deck to -1 and swap with the last effective number in Deck\n Deck[draw]=Deck[k-1];\n Deck[k-1]= -1;\n k--;//reduce the effective array size\n }\n \n //set up the strings, which will indicate the result\n String Clubs = \"Clubs: \";\n String Diamonds = \"Diamonds: \";\n String Hearts = \"Hearts: \";\n String Spades = \"Spades: \";\n //set up a loop to determine the kind and value of each card in hand\n for(int j=0;j<Hand.length;j++){\n int kind = Hand[j]/13;//calculate the kind of the card\n int rank = Hand[j]%13;//calculete the rank of the card\n switch (kind){\n case 0:\n switch (rank){\n case 0:\n Clubs += \"A \";\n break;\n case 1:\n Clubs += \"K \";\n break; \n case 2:\n Clubs += \"Q \";\n break; \n case 3:\n Clubs += \"J \";\n break; \n case 4:\n Clubs += \"10 \";\n break; \n case 5:\n Clubs += \"9 \";\n break; \n case 6:\n Clubs += \"8 \";\n break; \n case 7:\n Clubs += \"7 \";\n break; \n case 8:\n Clubs += \"6 \";\n break; \n case 9:\n Clubs += \"5 \";\n break; \n case 10:\n Clubs += \"4 \";\n break; \n case 11:\n Clubs += \"3 \";\n break; \n case 12:\n Clubs += \"2 \";\n break; \n } \n break;\n case 1:\n switch (rank){\n case 0:\n Diamonds += \"A \";\n break;\n case 1:\n Diamonds += \"K \";\n break; \n case 2:\n Diamonds += \"Q \";\n break; \n case 3:\n Diamonds += \"J \";\n break; \n case 4:\n Diamonds += \"10 \";\n break; \n case 5:\n Diamonds += \"9 \";\n break; \n case 6:\n Diamonds += \"8 \";\n break; \n case 7:\n Diamonds += \"7 \";\n break; \n case 8:\n Diamonds += \"6 \";\n break; \n case 9:\n Diamonds += \"5 \";\n break; \n case 10:\n Diamonds += \"4 \";\n break; \n case 11:\n Diamonds += \"3 \";\n break; \n case 12:\n Diamonds += \"2 \";\n break; \n } \n break;\n case 2:\n switch (rank){\n case 0:\n Hearts += \"A \";\n break;\n case 1:\n Hearts += \"K \";\n break; \n case 2:\n Hearts += \"Q \";\n break; \n case 3:\n Hearts += \"J \";\n break; \n case 4:\n Hearts += \"10 \";\n break; \n case 5:\n Hearts += \"9 \";\n break; \n case 6:\n Hearts += \"8 \";\n break; \n case 7:\n Hearts += \"7 \";\n break; \n case 8:\n Hearts += \"6 \";\n break; \n case 9:\n Hearts += \"5 \";\n break; \n case 10:\n Hearts += \"4 \";\n break; \n case 11:\n Hearts += \"3 \";\n break; \n case 12:\n Hearts += \"2 \";\n break; \n } \n break;\n case 3:\n switch (rank){\n case 0:\n Spades += \"A \";\n break;\n case 1:\n Spades += \"K \";\n break; \n case 2:\n Spades += \"Q \";\n break; \n case 3:\n Spades += \"J \";\n break; \n case 4:\n Spades += \"10 \";\n break; \n case 5:\n Spades += \"9 \";\n break; \n case 6:\n Spades += \"8 \";\n break; \n case 7:\n Spades += \"7 \";\n break; \n case 8:\n Spades += \"6 \";\n break; \n case 9:\n Spades += \"5 \";\n break; \n case 10:\n Spades += \"4 \";\n break; \n case 11:\n Spades += \"3 \";\n break; \n case 12:\n Spades += \"2 \";\n break; \n } \n break;\n }\n }\n \n //print out the results\n System.out.println(Clubs);\n System.out.println(Diamonds);\n System.out.println(Hearts);\n System.out.println(Spades);\n //ask user for input\n System.out.print(\"Go again? Enter 'y' or 'Y', anything else to quit- \");\n answer=scan.next();\n }while(answer.equals(\"Y\") || answer.equals(\"y\"));\n return;\n }", "private void tryToKillStuff(final Bomb b) {\n \t\tfor (Bomb bomb : bombs)\n \t\t\tif (bomb != b && !bomb.isCurrentlyExploding())\n \t\t\t\tif (eac.isInExplosionArea(b, bomb)) {\n \t\t\t\t\tbomb.goBomf();\n \t\t\t\t}\n \n \t\tif (eac.isInExplosionArea(b, bman.get(0))) {\n \t\t\talive = false;\n \t\t\tgui.lost();\n \t\t}\n \t}", "public Recognition findSkytone() {\n List<Recognition> recogs = this.findBricks();\n boolean one_seen = false;\n Recognition skystone = null;\n for (Recognition recog : recogs) {\n if (recog.getLabel() == \"Skystone\") {\n if (one_seen) {\n return null;\n } //if this is the second we're seeing, return null\n else {\n one_seen = true;\n skystone = recog;\n }\n }\n }\n return skystone; //will be null if we never saw a skystone, or defined if not\n }", "static boolean goldInInnerBags(ArrayList<String> innerBags) {\n // if the inner bags are atleast 1, then check inner bags otherwise return false.\n if(innerBags.isEmpty()) {\n // if there is a bag that is shiny gold coloured then return true\n if(innerBags.contains(\"shiny gold\")) {\n return true;\n // else look through the second layer of inner bags\n } else {\n boolean goldBagFound = false;\n int iterator = 0;\n // recursively iterate through inner bags until reached the end\n // return if a gold bag is found.\n while (!goldBagFound && iterator < innerBags.size()) {\n goldBagFound = goldInInnerBags(colouredBags.get(innerBags.get(iterator)));\n iterator = iterator + 1;\n }\n return goldBagFound;\n }\n } else {\n return false;\n }\n }", "public boolean[] feedback(int[] guess) {\n\n boolean[] feedback = new boolean[nSlots];\n\n for (int i = 0; i < this.nSlots; i++) {\n feedback[i] = (guess[i] == this.code[i]);\n }\n return feedback;\n }", "public int labyrinth (int points, int difficulty, int life)\n {\n\tint mines = (4 * difficulty);\n\n\tfor (int i = 0 ; i < 5 ; i++)\n\t{\n\t for (int j = 0 ; j < 5 ; j++)\n\t\tminefield [i] [j] = 's';\n\t}\n\n\n\tfor (int s = 0 ; s < mines ; s++)\n\t{\n\t int k = (int) (Math.random () * 5);\n\t int t = (int) (Math.random () * 5);\n\t while (minefield [k] [t] == 'm')\n\t {\n\t\tk = (int) (Math.random () * 5);\n\t\tt = (int) (Math.random () * 5);\n\t }\n\t minefield [k] [t] = 'm';\n\t}\n\n\n\tint minenum = 0;\n\tint safenum = 0;\n\tint square;\n\twhile (safenum < 5 && minenum != 3)\n\t{\n\t grid ();\n\t do\n\t {\n\t\tSystem.out.println (\" The Trapped Room\");\n\t\tsquare = IBIO.inputInt (\"\\nEnter the square you want to pick: \");\n\t }\n\t while (square >= 25);\n\t int x = (square / 5);\n\t int y = (square % 5);\n\t if (minefield [x] [y] == 'm')\n\t {\n\t\tminenum++;\n\t\tpoints += 5;\n\t\tprintSlow (\"Ouch, you hit a jinx! Be careful, you only have \" + (3 - minenum) + \" before you perish!\\n\");\n\t\tminefield [x] [y] = 'b';\n\t }\n\t else if (minefield [x] [y] == 'b' || minefield [x] [y] == 'v')\n\t {\n\t\tprintSlow (\"Nice try Harry, but you can't pick the same square twice!\");\n\t }\n\t else\n\t {\n\t\tsafenum++;\n\t\tminefield [x] [y] = 'v';\n\t\tprintSlow (\"Good job, only \" + (5 - safenum) + \" until you're safe!\\n\");\n\t }\n\t if (minenum == 3)\n\t\treturn 3;\n\n\n\t}\n\n\tprintSlow (\"Good job, you defeated Voldemort and his graveyard puzzle!\");\n\n\n\treturn 1;\n }", "public int bunnyEars_2(int bunnies) {\n // Base case: if bunnies==0, just return 0.\n if (bunnies == 0) return 0;\n\n // Recursive case: otherwise, make a recursive call with bunnies-1\n // (towards the base case), and fix up what it returns.\n return 2 + bunnyEars(bunnies-1);\n }", "public abstract void nextGuessResult(ResultPegs resultPegs);", "@Override\n public Set<String> makeGuess(char guess) throws GuessAlreadyMadeException {\n\n for(String word : myDictionary) {\n ArrayList<Integer> indices = new ArrayList<>();\n for (int i = 0; i < word.length(); i++) {\n if(word.charAt(i) == guess) {\n indices.add(i);\n }\n }\n boolean matchFound = false;\n for (Map.Entry<Pattern, Set<String>> entry : myMap.entrySet()) {\n Pattern myPattern = entry.getKey();\n Set<String> myStrings = entry.getValue();\n if(indices.equals(myPattern.ReturnIndices())) {\n myStrings.add(word);\n //myNewDictionary.add(word);\n matchFound = true;\n }\n\n }\n if(matchFound == false) {\n Pattern myNewPattern = new Pattern(word.length(), word, indices);\n Set<String> myNewString = new HashSet<>();\n myNewString.add(word);\n //myNewDictionary.add(word);\n myMap.put(myNewPattern, myNewString);\n }\n\n }\n this.myDictionary = RunEvilAlgorithm();\n this.myMap = new HashMap<>();\n //make a function to run evil algorithm\n return myDictionary;\n }", "@Override\n public boolean checkForScoringCondition(BotState botState) {\n Location botLocation = new Location(botState.x, botState.y);\n for (var ballLocation: ballLocations) {\n if (botLocation.getDistance(ballLocation) < SCORING_DISTANCE) {\n // The robot picked up the ball!\n logger.info(\"FOUND A BALL BOT=\"+botLocation+\" ball=\"+ballLocation);\n ballLocations.remove(ballLocation);\n return true;\n }\n }\n return false;\n }", "public ArrayList<Guppy> spawn() {\n if (!this.isFemale) { return null; }\n if (this.ageInWeeks < MINIMUM_SPAWNING_AGE) { return null; }\n if (Double.compare(this.randomNumberGenerator.nextDouble(), SPAWN_CHANCE) > 0) { return null; }\n\n ArrayList<Guppy> babyGuppies = new ArrayList<>();\n int babiesAmount = this.randomNumberGenerator.nextInt(MAX_BABIES_SPAWN_AMOUNT + 1);\n for (int i = 0; i < babiesAmount; i++) {\n babyGuppies.add(new Guppy(this.genus,\n this.species,\n 0,\n this.randomNumberGenerator.nextBoolean(),\n this.generationNumber + 1,\n (this.healthCoefficient + 1) / 2));\n }\n return babyGuppies;\n }", "private void parseBed() {\n\t\tBed[] bed = Bed.parseFile(bedFile, 0, 0);\n\t\tHashMap<String, ArrayList<Bed>> geneBed = new HashMap<String, ArrayList<Bed>>();\n\t\tfor (Bed b: bed){\n\t\t\tif (b.getName() == null || b.getName().equals(\".\")) Misc.printErrAndExit(\"ERROR; this bed line doesn't contain a gene name \"+b.toString());\n\t\t\tString[] splitName = Misc.COMMA.split(b.getName());\n\t\t\tfor (String sn: splitName) {\n\t\t\t\t//appropriate anno type\n\t\t\t\tif (requiredAnnoType !=null && sn.contains(requiredAnnoType)==false) continue;\n\t\t\t\tint lastUnderscore = sn.lastIndexOf('_');\n\t\t\t\tString geneName = sn.substring(0, lastUnderscore);\n\t\t\t\tArrayList<Bed> beds = geneBed.get(geneName);\n\t\t\t\tif (beds == null) {\n\t\t\t\t\tbeds = new ArrayList<Bed>();\n\t\t\t\t\tgeneBed.put(geneName, beds);\n\t\t\t\t}\n\t\t\t\tbeds.add(b);\n\t\t\t}\n\t\t}\n\t\tIO.pl(\"\\t\"+geneBed.size()+ \"\\tNumber of Genes \");\n\n\t\t//build genes for those with two or more exons\n\t\tArrayList<UCSCGeneLine> genesAL = new ArrayList<UCSCGeneLine>();\n\t\tfor (String name: geneBed.keySet()) {\n\t\t\tArrayList<Bed> beds = geneBed.get(name);\n\t\t\tif (beds.size() < minNumExons) continue;\n\t\t\tBed[] toSort = new Bed[beds.size()];\n\t\t\tbeds.toArray(toSort);\n\t\t\tArrays.sort(toSort);\n\t\t\tUCSCGeneLine ugl = new UCSCGeneLine(toSort, name);\n\t\t\tgenesAL.add(ugl);\n\t\t}\n\t\tUCSCGeneModelTableReader reader = new UCSCGeneModelTableReader();\n\t\tUCSCGeneLine[] genes = new UCSCGeneLine[genesAL.size()];\n\t\tgenesAL.toArray(genes);\n\t\treader.setGeneLines(genes);\n\n\t\tIO.pl(\"\\t\"+ genes.length + \"\\tPassing criteria\");\n\n\t\tif (genes == null || genes.length == 0) Misc.printExit(\"\\nProblem loading your USCS gene model table or bed file? No genes/ regions?\\n\");\n\t\t//check ordering\n\t\tif (reader.checkStartStopOrder() == false) Misc.printExit(\"\\nOne of your regions's coordinates are reversed. Check that each start is less than the stop.\\n\");\n\t\t//check gene name is unique\n\t\tif (reader.uniqueGeneNames() == false) Misc.printExit(\"\\nDuplicate gene names were found in your gene / bed file, these must be unique.\\n\");\n\t\t//check that genes are stranded\n\t\tif (reader.checkStrand() == false) Misc.printExit(\"\\nError: your bed file doesn't appear to be stranded?\\n\");\n\t\tchromGenes = reader.getChromSpecificGeneLines();\n\n\t}", "public int getMySpeciesIdentifier() {\n return mySpeciesIdentifier;\n }", "boolean monkeyBusiness(Monkey[] monkeys) {\n boolean allSmiles;\n int smiles = 0;\n for(Monkey monkey: monkeys) {\n if(monkey.smile) {\n smiles++;\n }\n }\n allSmiles = smiles >= (double) monkeys.length / 2;\n return allSmiles;\n }", "public void printGuess() {\r\n\t\t//Regular for loop because I still have a hard time with for each loops :/\r\n\t\tfor(int x = 0; x < movieGuess.length; x++) {\r\n\t\t\tSystem.out.print(movieGuess[x] + \" \");\t\t\r\n\t\t\t}\r\n\t\tSystem.out.println(\"\\n\");\r\n\t}", "public void Populate(int bombs) {\n\t\tint row = 0,col = 0,randnumber = 0;\n\t\tRandom rnd = new Random();\n\t\t\n\t\t// array list of every position on grid\n\t\tcoordinate = new ArrayList<Integer>(height*width);\n\t\tfor(int i = 0;i<height*width;i++) {\n\t\t\tcoordinate.add(i);\n\t\t}\n\t\t\n\t\tfor(int i = 0;i<bombs;i++) {\n\t\t\t// randomly chooses a position to put a bomb in\n\t\t\trandnumber = rnd.nextInt(coordinate.size());\n\t\t\tbomblocate[i] = coordinate.get(randnumber);\n\t\t\trow = coordinate.get(randnumber)/width;\n\t\t\tcol = coordinate.get(randnumber)%width;\n\t\t\tgrid[row][col] = 9;\n\t\t\t\n\t\t\tUpdateSurround(row,col);\n\t\t\t\n\t\t\t// removes the possible position from array list\n\t\t\tcoordinate.remove(randnumber);\n\t\t}\n\t}" ]
[ "0.7035752", "0.6379736", "0.6174024", "0.61658424", "0.58725613", "0.57561576", "0.56954557", "0.5680558", "0.55570394", "0.5490196", "0.5395804", "0.5381076", "0.5369821", "0.5363035", "0.533047", "0.5286034", "0.5274578", "0.5267939", "0.52662265", "0.5259135", "0.5258442", "0.5228287", "0.5208203", "0.5204223", "0.51866996", "0.5173715", "0.51684564", "0.5143701", "0.5141153", "0.5138829", "0.5128297", "0.51274365", "0.5126823", "0.51079816", "0.5107563", "0.51050717", "0.5100944", "0.5098423", "0.50972456", "0.5094982", "0.50907344", "0.5086696", "0.5086367", "0.5083242", "0.50831044", "0.50827914", "0.50797516", "0.50753444", "0.5065567", "0.50642824", "0.5050011", "0.50498205", "0.5047849", "0.50378036", "0.5035874", "0.5022396", "0.4996163", "0.49789357", "0.4961664", "0.4953667", "0.49515218", "0.4951144", "0.49451882", "0.49448085", "0.4922245", "0.49208745", "0.49098176", "0.49093348", "0.49022615", "0.49007985", "0.48999992", "0.4898587", "0.48961058", "0.4895618", "0.4891764", "0.48879102", "0.48812526", "0.48797482", "0.487969", "0.48762184", "0.48722053", "0.48714384", "0.4870822", "0.48704422", "0.48702043", "0.48530307", "0.48520318", "0.48102814", "0.4807516", "0.47971153", "0.47970724", "0.47895068", "0.47853515", "0.47848806", "0.47840485", "0.47821966", "0.47805673", "0.4777259", "0.4775933", "0.47758177" ]
0.5948121
4
for Wo Spec table
public List<ModelCurrency> getModelCurrencyList() { return modelCurrencyList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private JTable getJTable_spect() {\n\n\t\tspectColumn.add(\"Specialist Name\");\n\t\tspectColumn.add(\"Specialist Type\");\n\t\tspectColumn.add(\"Booking Date\");\n\t\tspectColumn.add(\"Time-period\");\n\t\tspectColumn.add(\"Member ID\");\n\t\tspectColumn.add(\"Room\");\n\n\t\tfor (int i=0; i<50; i++){\n\t\t\tVector<String> row = new Vector<String>();\n\t\t\trow.add(\"\");\n\t\t\trow.add(\"\");\n\t\t\trow.add(\"\");\n\t\t\trow.add(\"\");\n\t\t\trow.add(\"\");\n\t\t\trow.add(\"\");\n\t\t\tspectRow.add(row);\n\t\t}\n\n\t\tif (jTable_spect == null) {\n\t\t\tjTable_spect = new JTable(new AllTableModel(spectRow, spectColumn));\n\t\t\tjTable_spect.setRowHeight(30);\n\t\t}\n\t\t\n\t\treturn jTable_spect;\n\t\t\n\t}", "public void initTable();", "private void AdditionalSetUpTable() {\n TableColumnModel stuffcm = stuffTable.getColumnModel();\n \n //update: 22 juni 2006 add column code and modal so we can remove them in propertiesComboBox\n //ActionPerformed when we click \"Additonal Properties\"\n //we have to reference name column so we can put category and code column\n //in the left of the name column\n category = stuffcm.getColumn(0);\n code = stuffcm.getColumn(1);\n \n modal = stuffcm.getColumn(3);\n sale = stuffcm.getColumn(4);\n quantity = stuffcm.getColumn(5);\n \n //update: 2 july 2006, add two column; s = t, Third T\n s_t = stuffcm.getColumn(17);\n third = stuffcm.getColumn(18);\n \n //make it middle\n class MiddleCellEditor extends DefaultTableCellRenderer {\n MiddleCellEditor() {\n super();\n setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n }\n }\n quantity.setCellRenderer( new MiddleCellEditor() );\n \n length = stuffcm.getColumn(8);\n length.setCellRenderer( new MiddleCellEditor() );\n width = stuffcm.getColumn(9);\n width.setCellRenderer( new MiddleCellEditor() );\n height = stuffcm.getColumn(10);\n height.setCellRenderer( new MiddleCellEditor() );\n volume = stuffcm.getColumn(11);\n volume.setCellRenderer( new MiddleCellEditor() );\n primary = stuffcm.getColumn(12);\n measurement = stuffcm.getColumn(13);\n measurement.setCellRenderer( new MiddleCellEditor() );\n secondary = stuffcm.getColumn(14);\n produceritem = stuffcm.getColumn(15);\n selleritem = stuffcm.getColumn(16);\n //index column\n TableColumn stuffcol = stuffcm.getColumn(7);\n stuffTable.removeColumn(stuffcol);\n //comment column\n stufftc = stuffTable.getColumnModel().getColumn(6);\n if(!displayComment.isSelected())\n stuffTable.removeColumn(stufftc);\n \n //remove all column first for the first time\n stuffTable.removeColumn(modal);\n stuffTable.removeColumn(sale);\n stuffTable.removeColumn(quantity);\n stuffTable.removeColumn(code);\n stuffTable.removeColumn(category);\n stuffTable.removeColumn(s_t);\n stuffTable.removeColumn(third);\n \n propertiesComboBoxActionPerformed(null);\n \n //additional setup for \"index\" and \"comment\" column on employeeTable\n TableColumnModel employeecm = employeeTable.getColumnModel();\n //index column\n TableColumn employeecol = employeecm.getColumn(9);\n employeeTable.removeColumn(employeecol);\n //comment column\n employeetc = employeecm.getColumn(8);\n if(!displayCommentEmployee.isSelected())\n employeeTable.removeColumn(employeetc);\n \n //additional setup for sellerTable\n TableColumnModel sellercm = sellerTable.getColumnModel();\n //index column\n TableColumn sellercol = sellercm.getColumn(4);\n sellerTable.removeColumn(sellercol);\n //comment column\n sellertc = sellercm.getColumn(3);\n if(!displayCommentSeller.isSelected())\n sellerTable.removeColumn(sellertc);\n \n //additional setup for salesmanTable\n TableColumnModel salesmancm = salesmanTable.getColumnModel();\n //index column\n TableColumn salesmancol = salesmancm.getColumn(8);\n salesmanTable.removeColumn(salesmancol);\n //comment column\n salesmantc = salesmancm.getColumn(7);\n if(!displayCommentSeller.isSelected())\n salesmanTable.removeColumn(salesmantc);\n \n //additional setup for ProducerTable\n TableColumnModel producercm = ProducerTable.getColumnModel();\n //index column\n TableColumn producercol = producercm.getColumn(4);\n ProducerTable.removeColumn(producercol);\n //comment column\n producertc = producercm.getColumn(3);\n if(!DisplayCommentProducer.isSelected())\n ProducerTable.removeColumn(producertc);\n \n //additional setup for customerTable\n TableColumnModel customercm = customerTable.getColumnModel();\n //index column\n TableColumn customercol = customercm.getColumn(4);\n customerTable.removeColumn(customercol);\n //comment column\n customertc = customercm.getColumn(3);\n if(!displayCommentCustomer.isSelected())\n customerTable.removeColumn(customertc);\n \n //additional setup for commisionerTable\n TableColumnModel commisionercm = commisionerTable.getColumnModel();\n //index column\n TableColumn commisionercol = commisionercm.getColumn(4);\n commisionerTable.removeColumn(commisionercol);\n //comment columnlist\n commisionertc = commisionercm.getColumn(3);\n if(!displayCommentCommisioner.isSelected())\n commisionerTable.removeColumn(commisionertc);\n \n //additional setup for debtcreditTable\n// TableColumn debtcreditcol = DebtCreditTable.getColumnModel().getColumn(5);\n// DebtCreditTable.removeColumn(debtcreditcol);\n \n //additional setup for debt table\n TableColumn debtcol = DebtTable.getColumnModel().getColumn(5);\n DebtTable.removeColumn(debtcol);\n \n //additional setup for sale ( edit trans ) table\n TableColumn salecol = SaleTable.getColumnModel().getColumn(6);\n SaleTable.removeColumn(salecol);\n \n //additional setup for purchase ( edit trans ) table\n TableColumn purchasecol = PurchaseTable.getColumnModel().getColumn(6);\n PurchaseTable.removeColumn(purchasecol);\n \n //additional setup for credit table\n TableColumn creditcol = CreditTable.getColumnModel().getColumn(5);\n CreditTable.removeColumn(creditcol);\n \n //additional setup for warehouseTB\n TableColumn warehouseindexcol = WarehouseTB.getColumnModel().getColumn(3);\n WarehouseTB.removeColumn(warehouseindexcol);\n \n //additional setup for containerTB\n TableColumn containerindexcol = ContainerTB.getColumnModel().getColumn(4);\n ContainerTB.removeColumn(containerindexcol);\n }", "void initTable();", "public Table buildAssetDetailsTable(ManufacturingOrder dto) {\n\n\t\tTable table = new Table();\n\t\ttable.addAttribute(\"id\", \"normalTableNostripe\");\n\t\ttable.addAttribute(\"align\", \"center\");\n\t\ttable.addAttribute(\"cellSpacing\", \"0\");\n\t\ttable.addAttribute(\"cellPadding\", \"0\");\n\t\ttable.addAttribute(\"border\", \"1\");\n\t\ttable.addAttribute(\"class\", \"classContentTable\");\n\t\ttable.addAttribute(\"style\",\n\t\t\t\t\"white-space: nowrap; word-spacing: normal; width: 610px\");\n\t\ttable.addTableHeaderAttribute(\"class\", \"fixedHeader\");\n\t\ttable.addTableBodyAttribute(\"class\", \"scrollContent\");\n\n\t\tif (dto.getAssetConfig() != null && dto.getAssetConfig().size() > 0) {\n\n\t\t\tint count = 0;\n\n\t\t\tfor (AssetConfig asset : dto.getAssetConfig()) {\n\n\t\t\t\tTableRow row = new TableRow();\n\n\t\t\t\tTableData facility = new TableData(new SimpleText(\n\t\t\t\t\t\tvalidateDisplayField(asset.getFacility())));\n\t\t\t\tfacility.addAttribute(\"style\",\n\t\t\t\t\t\t\"width: 10% ; vertical-align: middle\");\n\n\t\t\t\tTableData workCenterCode = new TableData(new SimpleText(\n\t\t\t\t\t\tvalidateDisplayField(asset.getWorkCenterCode())));\n\t\t\t\tworkCenterCode.addAttribute(\"style\",\n\t\t\t\t\t\t\"width: 15% ; vertical-align: middle\");\n\n\t\t\t\tTableData description = new TableData(new SimpleText(\n\t\t\t\t\t\tvalidateDisplayField(asset.getDescription())));\n\t\t\t\tdescription.addAttribute(\"style\",\n\t\t\t\t\t\t\"width: 35% ; vertical-align: middle\");\n\n\t\t\t\tTableData assetNumber = new TableData(new SimpleText(\n\t\t\t\t\t\tvalidateDisplayField(/*asset.getAssetNumber()*/\"123456789123456\")));\n\t\t\t\tassetNumber.addAttribute(\"style\",\n\t\t\t\t\t\t\"width: 20% ; vertical-align: middle\");\n\n\t\t\t\tString statusFlag = asset.getStatus();\n\n\t\t\t\tTableData status;\n\t\t\t\tif (!\"A\".equalsIgnoreCase(statusFlag)) {\n\t\t\t\t\tstatus = new TableData(\n\t\t\t\t\t\t\tnew SimpleText(\n\t\t\t\t\t\t\t\t\t\"<input type=\\\"checkbox\\\" name=\\\"statusFlag_Chkbox\\\" value=\\\"A\\\" />\"));\n\t\t\t\t} else {\n\t\t\t\t\tstatus = new TableData(\n\t\t\t\t\t\t\tnew SimpleText(\n\t\t\t\t\t\t\t\t\t\"<input type=\\\"checkbox\\\" name=\\\"statusFlag_Chkbox\\\" value=\\\"A\\\" checked=\\\"checked\\\"/>\"));\n\t\t\t\t}\n\t\t\t\tstatus.addAttribute(\"style\",\n\t\t\t\t\t\t\"width: 10% ; vertical-align: middle\");\n\t\t\t\tstatus.addAttribute(\"disabled\", \"disabled\");\n\n\t\t\t\tTableData editImage = new TableData(new Image(\n\t\t\t\t\t\t\"static/images/edit.jpg\", \"Edit\"));\n\t\t\t\teditImage.addAttribute(\"style\", \"width: 10%\");\n\t\t\t\teditImage.addAttribute(\"onClick\", \"javascript:edit('\" + count\n\t\t\t\t\t\t+ \"','\"\n\t\t\t\t\t\t+ validateDisplayField(asset.getWorkCenterCode())\n\t\t\t\t\t\t+ \"','\" + asset.getFacility() + \"','\"\n\t\t\t\t\t\t+ validateDisplayField(asset.getDescription()) + \"','\"\n\t\t\t\t\t\t+ asset.getAssetNumber() + \"','\" + asset.getStatus()\n\t\t\t\t\t\t+ \"');\");\n\t\t\t\teditImage.addAttribute(\"style\", \"cursor: pointer;\");\n\n\t\t\t\trow.addTableData(facility);\n\t\t\t\trow.addTableData(workCenterCode);\n\t\t\t\trow.addTableData(assetNumber);\n\t\t\t\trow.addTableData(description);\n\t\t\t\trow.addTableData(status);\n\t\t\t\trow.addTableData(editImage);\n\n\t\t\t\tif (count % 2 == 0) {\n\t\t\t\t\trow.addAttribute(\"class\", \"normalRow\");\n\t\t\t\t} else {\n\t\t\t\t\trow.addAttribute(\"class\", \"alternateRow\");\n\t\t\t\t}\n\t\t\t\ttable.addTableRow(row);\n\t\t\t\tcount++;\n\n\t\t\t}\n\t\t}\n\n\t\treturn table;\n\t}", "private void initTable() {\n\t\tDefaultTableModel dtm = (DefaultTableModel)table.getModel();\n\t\tdtm.setRowCount(0);\t\t\n\t\tfor(int i=0;i<MainUi.controller.sale.items.size();i++){\n\t\t\tVector v1 = new Vector();\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getProdSpec().getTitle());\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getCopies());\n\t\t\tdtm.addRow(v1);\n\t\t}\n\t\tlblNewLabel.setText(\"\"+MainUi.controller.sale.getTotal());\n\t}", "public List<String> getSpecifications() {\n\t\tString sql =\"select specification from specifications\";\n\t\tList<String> res = jdbcTemplate.queryForList(sql, String.class);\n\t\treturn res;\n\t}", "public String[][] fill_table()\n {\n int j=0;\n String[][] data = new String[0][];\n for (Map.Entry<String,Descriptor> entry :parms.getDescriptors().entrySet()) {\n\n data[j][0]=entry.getValue().getId();\n data[j][1]= String.valueOf(entry.getValue().getType());\n data[j][2]= String.valueOf(entry.getValue().getCapacity());\n data[j][3]= String.valueOf(entry.getValue().getState());\n data[j][4]= String.valueOf(entry.getValue().getNbRequest());\n data[j][5]= String.valueOf(entry.getValue().getRequest());\n data[j][6]= String.valueOf(entry.getValue().getRange());\n data[j][7]= String.valueOf(entry.getValue().getService());\n Point p=entry.getValue().getPosition();\n data[j][8]= String.valueOf(p.getX());\n data[j][9]= String.valueOf(p.getY());\n j++;\n }\n return data;\n }", "Table getTable();", "@Override\n\tpublic String specs() {\n\t\treturn \"Sedan from Toyota with engine verion \"+engine.type();\n\t}", "@Override\n\tpublic void configTable() {\n\t\tString[][] colNames = { { \"Name\", \"name\" }, { \"Ward No\", \"wardNo\" }, { \"Max. patients\", \"maxPatients\" }, { \"No of Patients\", \"patientCount\" },\n\t\t\t\t{ \"No of Employees\", \"employeeCount\" }};\n\n\t\tfor (String[] colName : colNames) {\n\t\t\tTableColumn<Ward, String> col = new TableColumn<>(colName[0]);\n\t\t\tcol.setCellValueFactory(new PropertyValueFactory<>(colName[1]));\n\t\t\ttable.getColumns().add(col);\n\t\t}\n\n\t\ttable.setItems(tableData);\n\t\t\n\t}", "@Test\n void technicalStatusPerBatchTableTest() throws Exception {\n\n jCtrl.getTrainer2(); // initialize data\n\n // call technicalStatusPerBatchTable() and get returned list\n List<TechnicalStatusPerBatch> result = tspbServ.technicalStatusPerBatchTable(1);\n\n // check if returned list contains TechnicalStatusPerBatch objects\n assertTrue(result.get(0) instanceof TechnicalStatusPerBatch);\n }", "public Units getUnitTable();", "public abstract List<ColumnSpecification> metadata();", "private void prepareTable() {\n TeamsRepository tr = new TeamsRepository();\n //ka uradim ovo dle odma mi samo inicijalizuje tabelu\n// tblTeams.setModel(new TeamsTableModel(tr.getTeams()));\n// ni ovaj kod mi nista nije radio\n// TeamsTableModel ttm = new TeamsTableModel(tr.getTeams());\n TableColumnModel tcm = tblTeams.getColumnModel();\n TableColumn tc = tcm.getColumn(1);\n TableCellEditor tce = new DefaultCellEditor(getComboBox());\n tc.setCellEditor(tce);\n }", "List<SpecValuePO> selectByExample(SpecValuePOExample example);", "private void setUpTable()\n {\n //Setting the outlook of the table\n bookTable.setColumnReorderingAllowed(true);\n bookTable.setColumnCollapsingAllowed(true);\n \n \n bookTable.setContainerDataSource(allBooksBean);\n \n \n //Setting up the table data row and column\n /*bookTable.addContainerProperty(\"id\", Integer.class, null);\n bookTable.addContainerProperty(\"book name\",String.class, null);\n bookTable.addContainerProperty(\"author name\", String.class, null);\n bookTable.addContainerProperty(\"description\", String.class, null);\n bookTable.addContainerProperty(\"book genres\", String.class, null);\n */\n //The initial values in the table \n db.connectDB();\n try{\n allBooks = db.getAllBooks();\n }catch(SQLException ex)\n {\n ex.printStackTrace();\n }\n db.closeDB();\n allBooksBean.addAll(allBooks);\n \n //Set Visible columns (show certain columnes)\n bookTable.setVisibleColumns(new Object[]{\"id\",\"bookName\", \"authorName\", \"description\" ,\"bookGenreString\"});\n \n //Set height and width\n bookTable.setHeight(\"370px\");\n bookTable.setWidth(\"1000px\");\n \n //Allow the data in the table to be selected\n bookTable.setSelectable(true);\n \n //Save the selected row by saving the change Immediately\n bookTable.setImmediate(true);\n //Set the table on listener for value change\n bookTable.addValueChangeListener(new Property.ValueChangeListener()\n {\n public void valueChange(ValueChangeEvent event) {\n \n }\n\n });\n }", "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}", "private void fillTable(){\n tblModel.setRowCount(0);// xoa cac hang trong bang\n \n for(Student st: list){\n tblModel.addRow(new String[]{st.getStudentId(), st.getName(), st.getMajor(),\"\"\n + st.getMark(), st.getCapacity(), \"\" + st.isBonnus()});\n // them (\"\" + )de chuyen doi kieu float va boolean sang string\n \n }\n tblModel.fireTableDataChanged();\n }", "String getTableDefines();", "private void tableProspect() throws Exception{\n modelProspect = new DefaultTableModel(new Object[][]{}, headerProspect());\n jTable_Prospects.setModel(modelProspect);\n TableColumnModel columnModel = jTable_Prospects.getColumnModel();\n columnModel.getColumn(0).setPreferredWidth(70);\n columnModel.getColumn(1).setPreferredWidth(120);\n columnModel.getColumn(2).setPreferredWidth(80);\n columnModel.getColumn(3).setPreferredWidth(100);\n columnModel.getColumn(4).setPreferredWidth(150);\n columnModel.getColumn(5).setPreferredWidth(100);\n columnModel.getColumn(6).setPreferredWidth(80);\n columnModel.getColumn(7).setPreferredWidth(150);\n columnModel.getColumn(8).setPreferredWidth(50);\n columnModel.getColumn(9).setPreferredWidth(100);\n columnModel.getColumn(10).setPreferredWidth(30);\n AfficherListProspect();\n }", "public List<ModelWOChdListCustom>findSpecificationById(Long specificationId);", "@Override\n protected void initResultTable() {\n }", "List<Assist_table> selectByExample(Assist_tableExample example);", "public Vector getListSpecializations(){\n Vector listQualifications = new Vector();\n try{\n String sqlGet = \"SELECT * FROM qualification ORDER BY qualification_name\";\n\n ResultSet rsGet = this.queryData(sqlGet);\n int order = 0;\n while(rsGet.next()){\n order++;\n Vector dataSet = new Vector();\n dataSet.add(rsGet.getInt(\"qualification_id\"));\n dataSet.add(rsGet.getString(\"qualification_name\"));\n\n listQualifications.add(dataSet);\n }\n } catch(Exception e){\n System.out.println(e.getMessage());\n }\n return listQualifications;\n }", "protected abstract void initialiseTable();", "final public AlterTableSpecification AlterTableSpecification() throws ParseException {Token tk;\n ColumnConstraint constraint;\n tk = jj_consume_token(ADD);\n constraint = ColumnConstraint();\nreturn new AlterTableSpecification(tk.image, constraint);\n}", "private void UpdateTable() {\n\t\t\t\t\n\t\t\t}", "short[][] productionTable();", "private void initSimpleTable(){\n List<Names> balloonVisibilityList = new ArrayList<Names>();\n balloonVisibilityList.add(Extensions.Names.FEATURE);\n\n List<Names> hList = new ArrayList<Names>();\n hList.add(Extensions.Names.BASIC_LINK);\n\n List<Names> wList = new ArrayList<Names>();\n wList.add(Extensions.Names.BASIC_LINK);\n\n List<Names> xList = new ArrayList<Names>();\n xList.add(Extensions.Names.BASIC_LINK);\n\n List<Names> yList = new ArrayList<Names>();\n yList.add(Extensions.Names.BASIC_LINK);\n\n simpleTable.put(GxConstants.TAG_BALLOON_VISIBILITY, balloonVisibilityList);\n simpleTable.put(GxConstants.TAG_H, hList);\n simpleTable.put(GxConstants.TAG_W, wList);\n simpleTable.put(GxConstants.TAG_X, xList);\n simpleTable.put(GxConstants.TAG_Y, yList);\n }", "private void populateTable() {\n \n DefaultTableModel dtm = (DefaultTableModel) tblAllCars.getModel();\n dtm.setRowCount(0);\n \n for(Car car : carFleet.getCarFleet()){\n \n Object[] row = new Object[8];\n row[0]=car.getBrandName();\n row[1]=car.getModelNumber();\n row[2]=car.getSerialNumber();\n row[3]=car.getMax_seats();\n row[4]=car.isAvailable();\n row[5]=car.getYearOfManufacturing();\n row[6]=car.isMaintenenceCerticateExpiry();\n row[7]=car.getCity();\n \n dtm.addRow(row);\n \n }\n }", "public CellTable<Attribute> getTable() {\n\n\t\tretrieveData();\n\n\t\t// Table data provider.\n\t\tdataProvider = new ListDataProvider<Attribute>(list);\n\n\t\t// Cell table\n\t\ttable = new PerunTable<Attribute>(list);\n\n\t\t// Connect the table to the data provider.\n\t\tdataProvider.addDataDisplay(table);\n\n\t\t// Sorting\n\t\tListHandler<Attribute> columnSortHandler = new ListHandler<Attribute>(dataProvider.getList());\n\t\ttable.addColumnSortHandler(columnSortHandler);\n\n\t\t// set empty content & loader\n\t\ttable.setEmptyTableWidget(loaderImage);\n\n\t\t// checkbox column column\n\t\tif (checkable) {\n\t\t\t// table selection\n\t\t\ttable.setSelectionModel(selectionModel, DefaultSelectionEventManager.<Attribute> createCheckboxManager(0));\n\t\t\ttable.addCheckBoxColumn();\n\t\t}\n\n\t\t// Create ID column.\n\t\ttable.addIdColumn(\"Attr ID\", null, 90);\n\n\t\t// Name column\n\t\tColumn<Attribute, Attribute> nameColumn = JsonUtils.addColumn(new PerunAttributeNameCell());\n\n\t\t// Description column\n\t\tColumn<Attribute, Attribute> descriptionColumn = JsonUtils.addColumn(new PerunAttributeDescriptionCell());\n\n\t\t// Value column\n\t\tColumn<Attribute, Attribute> valueColumn = JsonUtils.addColumn(new PerunAttributeValueCell());\n\t\tvalueColumn.setFieldUpdater(new FieldUpdater<Attribute, Attribute>() {\n\t\t\tpublic void update(int index, Attribute object, Attribute value) {\n\t\t\t\tobject = value;\n\t\t\t\tselectionModel.setSelected(object, object.isAttributeValid());\n\t\t\t}\n\t\t});\n\n\t\t// updates the columns size\n\t\tthis.table.setColumnWidth(nameColumn, 200.0, Unit.PX);\n\n\t\t// Sorting name column\n\t\tnameColumn.setSortable(true);\n\t\tcolumnSortHandler.setComparator(nameColumn, new AttributeComparator<Attribute>(AttributeComparator.Column.TRANSLATED_NAME));\n\n\t\t// Sorting description column\n\t\tdescriptionColumn.setSortable(true);\n\t\tcolumnSortHandler.setComparator(descriptionColumn, new AttributeComparator<Attribute>(AttributeComparator.Column.TRANSLATED_DESCRIPTION));\n\n\t\t// Add sorting\n\t\tthis.table.addColumnSortHandler(columnSortHandler);\n\n\t\t// Add the columns.\n\t\tthis.table.addColumn(nameColumn, \"Name\");\n\t\tthis.table.addColumn(valueColumn, \"Value\");\n\t\tthis.table.addColumn(descriptionColumn, \"Description\");\n\n\t\treturn table;\n\n\t}", "public void bindingTable(){\n String[] header={\"Region Id\",\"Region Name\"};\n DefaultTableModel defaultTableModel = new DefaultTableModel(header, 0);\n for (Region region : regionController.binding()) {\n// for (Region binding : regionController.binding(\"region_id\",\"asc\")) {\n Object[] region1 ={\n region.getRegionId(),region.getRegionName()\n };\n defaultTableModel.addRow(region1);\n }\n tableRegion.setModel(defaultTableModel);\n }", "Table createTable();", "@Before\n public void setUp() {\n table = new Table();\n ArrayList<Column> col = new ArrayList<Column>();\n col.add(new NumberColumn(\"numbers\"));\n\n table.add(new Record(col, new Value[] {new NumberValue(11)}));\n table.add(new Record(col, new Value[] {new NumberValue(13)}));\n table.add(new Record(col, new Value[] {new NumberValue(22)}));\n table.add(new Record(col, new Value[] {new NumberValue(28)}));\n table.add(new Record(col, new Value[] {new NumberValue(44)}));\n table.add(new Record(col, new Value[] {new NumberValue(23)}));\n table.add(new Record(col, new Value[] {new NumberValue(46)}));\n table.add(new Record(col, new Value[] {new NumberValue(56)}));\n table.add(new Record(col, new Value[] {new NumberValue(45)}));\n table.add(new Record(col, new Value[] {new NumberValue(45)}));\n table.add(new Record(col, new Value[] {new NullValue()}));\n table.add(new Record(col, new Value[] {new NumberValue(45)}));\n table.add(new Record(col, new Value[] {new NumberValue(34)}));\n table.add(new Record(col, new Value[] {new NumberValue(5)}));\n table.add(new Record(col, new Value[] {new NumberValue(123)}));\n table.add(new Record(col, new Value[] {new NumberValue(48)}));\n table.add(new Record(col, new Value[] {new NumberValue(50)}));\n table.add(new Record(col, new Value[] {new NumberValue(13)}));\n }", "private void createTable(GTViewSet viewSet)\r\n\t{\r\n\t\tString[] columnNames = {\r\n\t\t\tRB.getString(\"gui.dialog.NBSelectTraitsPanel.traitsColumn\"),\r\n\t\t\tRB.getString(\"gui.dialog.NBSelectTraitsPanel.experimentColumn\"),\r\n\t\t\tRB.getString(\"gui.dialog.NBSelectTraitsPanel.showColumn\")\r\n\t\t};\r\n\r\n\t\tArrayList<Trait> traits = viewSet.getDataSet().getTraits();\r\n\r\n\t\tint[] selected = null;\r\n\t\tif (mode == SelectTraitsDialog.HEATMAP_TRAITS)\r\n\t\t\tselected = viewSet.getTraits();\r\n\t\telse\r\n\t\t\tselected = viewSet.getTxtTraits();\r\n\r\n\t\tObject[][] data = new Object[traits.size()][3];\r\n\r\n\t\tfor (int i = 0; i < data.length; i++)\r\n\t\t{\r\n\t\t\tdata[i][0] = traits.get(i).getName();\r\n\t\t\tdata[i][1] = traits.get(i).getExperiment();\r\n\r\n\t\t\t// Search the current list of visible traits to see if this trait\r\n\t\t\t// is one of them. If it is, enable it in the table\r\n\t\t\tboolean show = false;\r\n\t\t\tfor (int j = 0; j < selected.length; j++)\r\n\t\t\t\tif (selected[j] == i)\r\n\t\t\t\t\tshow = true;\r\n\r\n\t\t\tdata[i][2] = show;\r\n\t\t}\r\n\r\n\t\ttable.setModel(new DefaultTableModel(data, columnNames)\r\n\t\t{\r\n\t\t\tpublic Class getColumnClass(int c) {\r\n\t\t\t\treturn getValueAt(0, c).getClass();\r\n\t\t\t}\r\n\r\n\t\t\t// Column 1 contains the tickboxes, and must be editable\r\n\t\t\tpublic boolean isCellEditable(int row, int col) {\r\n\t\t\t\treturn col == 2;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\ttable.getColumnModel().getColumn(2).setPreferredWidth(10);\r\n\r\n\t\tTableRowSorter<DefaultTableModel> sorter = new TableRowSorter<>((DefaultTableModel)table.getModel());\r\n\t\ttable.setRowSorter(sorter);\r\n\t}", "public Table buildNewAssetTable(ManufacturingOrder dto) {\n\n\t\tTable table = new Table();\n\t\ttable.addAttribute(\"id\", \"normalTableNostripe\");\n\t\ttable.addAttribute(\"align\", \"center\");\n\t\ttable.addAttribute(\"cellSpacing\", \"0\");\n\t\ttable.addAttribute(\"cellPadding\", \"0\");\n\t\ttable.addAttribute(\"border\", \"1\");\n\t\ttable.addAttribute(\"class\", \"classContentTable\");\n\t\ttable.addAttribute(\"style\",\n\t\t\t\t\"white-space: nowrap; word-spacing: normal; width: 500px\");\n\t\ttable.addTableHeaderAttribute(\"class\", \"fixedHeader\");\n\t\ttable.addTableBodyAttribute(\"class\", \"scrollContent\");\n\n\t\tTableRow row = new TableRow();\n\n\t\tInputField assetNumberText = new InputField(\"assetNumber\", \"\",\n\t\t\t\tInputType.TEXT);\n\t\tassetNumberText.addAttribute(\"maxlength\", \"6\");\n\t\tassetNumberText.addAttribute(\"size\", \"10\");\n\t\tTableData asset = null;\n\t\tif (dto.getEditFlag()) {\n\t\t\tasset = new TableData(new SimpleText(dto.getAssetNumber()));\n\t\t\tasset.addAttribute(\"style\", \"width: 10% ; vertical-align: middle\");\n\n\t\t} else {\n\t\t\tasset = new TableData(assetNumberText);\n\t\t\tasset.addAttribute(\"style\", \"width: 30%\");\n\t\t}\n\t\tString desc = \"\";\n\n\t\tif (dto.getEditFlag()) {\n\t\t\tdesc = dto.getDescription();\n\t\t}\n\n\t\tInputField description = new InputField(\"descrip\", desc, InputType.TEXT);\n\t\tdescription.addAttribute(\"maxlength\", \"100\");\n\t\tdescription.addAttribute(\"size\", \"30\");\n\t\tTableData descriptionText = new TableData(description);\n\t\tdescriptionText.addAttribute(\"style\", \"width: 40%\");\n\n\t\tTableData status = null;\n\t\tif (dto.getEditFlag()) {\n\n\t\t\tif (dto.getStatus() == null || !(\"A\".equals(dto.getStatus()))) {\n\n\t\t\t\tstatus = new TableData(\n\t\t\t\t\t\tnew SimpleText(\n\t\t\t\t\t\t\t\t\"<input type=\\\"checkbox\\\" name=\\\"statusFlag_Chk\\\" value=\\\"A\\\"/>\"));\n\t\t\t} else {\n\t\t\t\tstatus = new TableData(\n\t\t\t\t\t\tnew SimpleText(\n\t\t\t\t\t\t\t\t\"<input type=\\\"checkbox\\\" name=\\\"statusFlag_Chk\\\" value=\\\"A\\\" checked=\\\"checked\\\"/>\"));\n\t\t\t}\n\n\t\t\tTableData facility = new TableData(new SimpleText(dto\n\t\t\t\t\t.getSelectedFacility()));\n\t\t\tfacility.addAttribute(\"style\",\n\t\t\t\t\t\"width: 10% ; vertical-align: middle\");\n\n\t\t\tTableData workCenter = new TableData(new SimpleText(dto\n\t\t\t\t\t.getWorkCenterCode()));\n\t\t\tworkCenter.addAttribute(\"style\",\n\t\t\t\t\t\"width: 10% ; vertical-align: middle\");\n\t\t\trow.addTableData(facility);\n\t\t\trow.addTableData(workCenter);\n\t\t\tstatus.addAttribute(\"style\", \"width: 10%\");\n\t\t\tdescriptionText.addAttribute(\"style\", \"width: 30%\");\n\n\t\t} else {\n\t\t\tstatus = new TableData(\n\t\t\t\t\tnew SimpleText(\n\t\t\t\t\t\t\t\"<input type=\\\"checkbox\\\" name=\\\"statusFlag_Chk\\\" value=\\\"A\\\" checked=\\\"checked\\\"/>\"));\n\t\t\tstatus.addAttribute(\"style\", \"width: 20%\");\n\t\t}\n\t\trow.addTableData(asset);\n\t\trow.addTableData(descriptionText);\n\t\trow.addTableData(status);\n\n\t\trow.addAttribute(\"class\", \"normalRow\");\n\n\t\ttable.addTableRow(row);\n\n\t\treturn table;\n\t}", "private void installHPSoftwareTable() {}", "protected boolean getTableDesc()\n\t\t{\n\t\t\treturn Desc ;\n\t\t}", "public Table<Integer, Integer, String> getData();", "tbls createtbls();", "private GenericTableView populateSeriesSamplesTableView(String viewName) {\n\t GenericTable table = assembler.createTable();\n GenericTableView tableView = new GenericTableView (viewName, 5, table);\n tableView.setRowsSelectable();\n\t\ttableView.addCollection(0, 0);\n tableView.setCollectionBottons(1);\n tableView.setDisplayTotals(false);\n //tableView.setColAlignment(2, 0);\n tableView.setColAlignment(5, 0);\n tableView.setColAlignment(6, 0);\n \n return tableView;\n }", "private void initializeGUITableHeaders(){\n TableColumn<HeapData, Integer> addressColumn = new TableColumn<>(\"Address\");\n addressColumn.setCellValueFactory(new PropertyValueFactory<>(\"address\"));\n TableColumn<HeapData, String> valueColumn = new TableColumn<>(\"Value\");\n valueColumn.setCellValueFactory(new PropertyValueFactory<>(\"value\"));\n valueColumn.setMinWidth(100);\n this.heapTableList.getColumns().addAll(addressColumn, valueColumn);\n\n TableColumn<SymbolData, String> variableNameColumn = new TableColumn<>(\"Variable Name\");\n variableNameColumn.setCellValueFactory(new PropertyValueFactory<>(\"variableName\"));\n variableNameColumn.setMinWidth(100);\n TableColumn<SymbolData, String> valColumn = new TableColumn<>(\"Value\");\n valColumn.setCellValueFactory(new PropertyValueFactory<>(\"value\"));\n symbolTableList.getColumns().addAll(variableNameColumn, valColumn);\n\n TableColumn<SemaphoreData,String> indexColumn = new TableColumn<>(\"Index\");\n indexColumn.setCellValueFactory(new PropertyValueFactory<>(\"index\"));\n TableColumn<SemaphoreData,Integer> valueColumnSem = new TableColumn<>(\"Value\");\n valueColumnSem.setCellValueFactory(new PropertyValueFactory<>(\"value\"));\n TableColumn<SemaphoreData,ArrayList<Integer>>valuesColumn = new TableColumn<>(\"Values\");\n valuesColumn.setCellValueFactory(new PropertyValueFactory<>(\"values\"));\n this.semaphoreTable.getColumns().addAll(indexColumn,valueColumnSem,valuesColumn);\n\n }", "List<TABLE41> selectByExample(TABLE41Example example);", "@Test void testInterpretTable() {\n sql(\"select * from \\\"hr\\\".\\\"emps\\\" order by \\\"empid\\\"\")\n .returnsRows(\"[100, 10, Bill, 10000.0, 1000]\",\n \"[110, 10, Theodore, 11500.0, 250]\",\n \"[150, 10, Sebastian, 7000.0, null]\",\n \"[200, 20, Eric, 8000.0, 500]\");\n }", "private void initColumnBtech()\r\n\t{\r\n\t\tstudNoBColumn.setCellValueFactory(new PropertyValueFactory<>(\"studendID\"));\r\n\t\tnameBColumn.setCellValueFactory(new PropertyValueFactory<>(\"name\"));\r\n\t\tsurnameBColumn.setCellValueFactory(new PropertyValueFactory<>(\"surname\"));\r\n\t\tsupervisorBColumn.setCellValueFactory(new PropertyValueFactory<>(\"supervisor\"));\r\n\t\temailBColumn.setCellValueFactory(new PropertyValueFactory<>(\"email\"));\r\n\t\tcellphoneNoBColumn.setCellValueFactory(new PropertyValueFactory<>(\"cellphone\"));\r\n\t\tstationBColumn.setCellValueFactory(new PropertyValueFactory<>(\"station\"));\r\n\t\tcourseBColumn.setCellValueFactory(new PropertyValueFactory<>(\"course\"));\r\n\t}", "private void createTable(int columns, int rows, String[] column_name,\n\t\t\tObject[] row_data) {\n\t\ttblStationary = new Table(canvas2, SWT.MULTI | SWT.BORDER\n\t\t\t\t| SWT.FULL_SELECTION);\n\t\ttblStationary.setLinesVisible(true);\n\t\ttblStationary.setHeaderVisible(true);\n\n\t\tfor (int i = 0; i < columns; i++) {\n\t\t\tcolumn = new TableColumn(tblStationary, SWT.NONE);\n\n\t\t\tif (i == 0) {\n\t\t\t\tcolumn.setText(column_name[i]);\n\t\t\t\tcolumn.setWidth(50);\n\t\t\t} else if (i == 1) {\n\t\t\t\tcolumn.setText(column_name[i]);\n\t\t\t\tcolumn.setWidth(230);\n\t\t\t} else {\n\t\t\t\tcolumn.setText(column_name[i]);\n\t\t\t\tcolumn.setWidth(100);\n\t\t\t}\n\t\t}\n\n\t\teditor1 = new TableEditor[rows];\n\t\ttxtTopay = new Text[rows];\n\n\t\teditor2 = new TableEditor[rows];\n\t\ttxtPaid = new Text[rows];\n\n\t\teditor3 = new TableEditor[rows];\n\t\ttxtBilling = new Text[rows];\n\n\t\teditor4 = new TableEditor[rows];\n\t\ttxtCr = new Text[rows];\n\n\t\t// Drawing initial table items\n\t\tfor (int rowId = 0; rowId < rows; rowId++) {\n\n\t\t\titem = new TableItem(tblStationary, SWT.NONE);\n\n\t\t\titem.setText(0, Integer.toString((rowId + 1)));\n\n\t\t\t// First Column station\n\t\t\titem.setText(1, (((StationsDTO) (row_data[rowId])).getName()\n\t\t\t\t\t+ \" - \" + ((StationsDTO) row_data[rowId]).getId()));\n\n\t\t\t// Draw Text Field\n\t\t\teditor1[rowId] = new TableEditor(tblStationary);\n\t\t\ttxtTopay[rowId] = new Text(tblStationary, SWT.NONE);\n\t\t\ttxtTopay[rowId].addVerifyListener(new NumericValidation());\n\t\t\teditor1[rowId].grabHorizontal = true;\n\t\t\teditor1[rowId].setEditor(txtTopay[rowId], item, 2);\n\n\t\t\t// Draw Text Field\n\t\t\teditor2[rowId] = new TableEditor(tblStationary);\n\t\t\ttxtPaid[rowId] = new Text(tblStationary, SWT.NONE);\n\t\t\ttxtPaid[rowId].addVerifyListener(new NumericValidation());\n\t\t\teditor2[rowId].grabHorizontal = true;\n\t\t\teditor2[rowId].setEditor(txtPaid[rowId], item, 3);\n\n\t\t\t// Draw Text Field\n\t\t\teditor3[rowId] = new TableEditor(tblStationary);\n\t\t\ttxtBilling[rowId] = new Text(tblStationary, SWT.NONE);\n\t\t\ttxtBilling[rowId].addVerifyListener(new NumericValidation());\n\t\t\teditor3[rowId].grabHorizontal = true;\n\t\t\teditor3[rowId].setEditor(txtBilling[rowId], item, 4);\n\n\t\t\t// Draw Text Field\n\t\t\teditor4[rowId] = new TableEditor(tblStationary);\n\t\t\ttxtCr[rowId] = new Text(tblStationary, SWT.NONE);\n\t\t\ttxtCr[rowId].addVerifyListener(new NumericValidation());\n\t\t\teditor4[rowId].grabHorizontal = true;\n\t\t\teditor4[rowId].setEditor(txtCr[rowId], item, 5);\n\n\t\t}\n\t\ttblStationary.setBounds(32, 43, 750, 380);\n\n\t}", "public void setup() {\r\n // These setters could be used to override the default.\r\n // this.setDatabasePolicy(new null());\r\n // this.setJDBCHelper(JDBCHelperFactory.create());\r\n this.setTableName(\"chm62edt_habitat_syntaxa\");\r\n this.setTableAlias(\"A\");\r\n this.setReadOnly(true);\r\n\r\n this.addColumnSpec(\r\n new CompoundPrimaryKeyColumnSpec(\r\n new StringColumnSpec(\"ID_HABITAT\", \"getIdHabitat\",\r\n \"setIdHabitat\", DEFAULT_TO_ZERO, NATURAL_PRIMARY_KEY),\r\n new StringColumnSpec(\"ID_SYNTAXA\", \"getIdSyntaxa\",\r\n \"setIdSyntaxa\", DEFAULT_TO_EMPTY_STRING,\r\n NATURAL_PRIMARY_KEY)));\r\n this.addColumnSpec(\r\n new StringColumnSpec(\"RELATION_TYPE\", \"getRelationType\",\r\n \"setRelationType\", DEFAULT_TO_NULL));\r\n this.addColumnSpec(\r\n new StringColumnSpec(\"ID_SYNTAXA_SOURCE\", \"getIdSyntaxaSource\",\r\n \"setIdSyntaxaSource\", DEFAULT_TO_EMPTY_STRING, REQUIRED));\r\n\r\n JoinTable syntaxa = new JoinTable(\"chm62edt_syntaxa B\", \"ID_SYNTAXA\",\r\n \"ID_SYNTAXA\");\r\n\r\n syntaxa.addJoinColumn(new StringJoinColumn(\"NAME\", \"setSyntaxaName\"));\r\n syntaxa.addJoinColumn(new StringJoinColumn(\"AUTHOR\", \"setSyntaxaAuthor\"));\r\n this.addJoinTable(syntaxa);\r\n\r\n JoinTable syntaxasource = new JoinTable(\"chm62edt_syntaxa_source C\",\r\n \"ID_SYNTAXA_SOURCE\", \"ID_SYNTAXA_SOURCE\");\r\n\r\n syntaxasource.addJoinColumn(new StringJoinColumn(\"SOURCE\", \"setSource\"));\r\n syntaxasource.addJoinColumn(\r\n new StringJoinColumn(\"SOURCE_ABBREV\", \"setSourceAbbrev\"));\r\n syntaxasource.addJoinColumn(new IntegerJoinColumn(\"ID_DC\", \"setIdDc\"));\r\n this.addJoinTable(syntaxasource);\r\n }", "@Test\n public void doGetTable()\n throws Exception\n {\n logger.info(\"doGetTable - enter\");\n\n // Mock mapping.\n Schema mockMapping = SchemaBuilder.newBuilder()\n .addField(\"mytext\", Types.MinorType.VARCHAR.getType())\n .addField(\"mykeyword\", Types.MinorType.VARCHAR.getType())\n .addField(new Field(\"mylong\", FieldType.nullable(Types.MinorType.LIST.getType()),\n Collections.singletonList(new Field(\"mylong\",\n FieldType.nullable(Types.MinorType.BIGINT.getType()), null))))\n .addField(\"myinteger\", Types.MinorType.INT.getType())\n .addField(\"myshort\", Types.MinorType.SMALLINT.getType())\n .addField(\"mybyte\", Types.MinorType.TINYINT.getType())\n .addField(\"mydouble\", Types.MinorType.FLOAT8.getType())\n .addField(new Field(\"myscaled\",\n new FieldType(true, Types.MinorType.BIGINT.getType(), null,\n ImmutableMap.of(\"scaling_factor\", \"10.0\")), null))\n .addField(\"myfloat\", Types.MinorType.FLOAT4.getType())\n .addField(\"myhalf\", Types.MinorType.FLOAT4.getType())\n .addField(\"mydatemilli\", Types.MinorType.DATEMILLI.getType())\n .addField(\"mydatenano\", Types.MinorType.DATEMILLI.getType())\n .addField(\"myboolean\", Types.MinorType.BIT.getType())\n .addField(\"mybinary\", Types.MinorType.VARCHAR.getType())\n .addField(\"mynested\", Types.MinorType.STRUCT.getType(), ImmutableList.of(\n new Field(\"l1long\", FieldType.nullable(Types.MinorType.BIGINT.getType()), null),\n new Field(\"l1date\", FieldType.nullable(Types.MinorType.DATEMILLI.getType()), null),\n new Field(\"l1nested\", FieldType.nullable(Types.MinorType.STRUCT.getType()), ImmutableList.of(\n new Field(\"l2short\", FieldType.nullable(Types.MinorType.LIST.getType()),\n Collections.singletonList(new Field(\"l2short\",\n FieldType.nullable(Types.MinorType.SMALLINT.getType()), null))),\n new Field(\"l2binary\", FieldType.nullable(Types.MinorType.VARCHAR.getType()),\n null))))).build();\n\n // Real mapping.\n LinkedHashMap<String, Object> mapping = new ObjectMapper().readValue(\n \"{\\n\" +\n \" \\\"mishmash\\\" : {\\n\" + // Index: mishmash\n \" \\\"mappings\\\" : {\\n\" +\n \" \\\"_meta\\\" : {\\n\" + // _meta:\n \" \\\"mynested.l1nested.l2short\\\" : \\\"list\\\",\\n\" + // mynested.l1nested.l2short: LIST<SMALLINT>\n \" \\\"mylong\\\" : \\\"list\\\"\\n\" + // mylong: LIST<BIGINT>\n \" },\\n\" +\n \" \\\"properties\\\" : {\\n\" +\n \" \\\"mybinary\\\" : {\\n\" + // mybinary:\n \" \\\"type\\\" : \\\"binary\\\"\\n\" + // type: binary (VARCHAR)\n \" },\\n\" +\n \" \\\"myboolean\\\" : {\\n\" + // myboolean:\n \" \\\"type\\\" : \\\"boolean\\\"\\n\" + // type: boolean (BIT)\n \" },\\n\" +\n \" \\\"mybyte\\\" : {\\n\" + // mybyte:\n \" \\\"type\\\" : \\\"byte\\\"\\n\" + // type: byte (TINYINT)\n \" },\\n\" +\n \" \\\"mydatemilli\\\" : {\\n\" + // mydatemilli:\n \" \\\"type\\\" : \\\"date\\\"\\n\" + // type: date (DATEMILLI)\n \" },\\n\" +\n \" \\\"mydatenano\\\" : {\\n\" + // mydatenano:\n \" \\\"type\\\" : \\\"date_nanos\\\"\\n\" + // type: date_nanos (DATEMILLI)\n \" },\\n\" +\n \" \\\"mydouble\\\" : {\\n\" + // mydouble:\n \" \\\"type\\\" : \\\"double\\\"\\n\" + // type: double (FLOAT8)\n \" },\\n\" +\n \" \\\"myfloat\\\" : {\\n\" + // myfloat:\n \" \\\"type\\\" : \\\"float\\\"\\n\" + // type: float (FLOAT4)\n \" },\\n\" +\n \" \\\"myhalf\\\" : {\\n\" + // myhalf:\n \" \\\"type\\\" : \\\"half_float\\\"\\n\" + // type: half_float (FLOAT4)\n \" },\\n\" +\n \" \\\"myinteger\\\" : {\\n\" + // myinteger:\n \" \\\"type\\\" : \\\"integer\\\"\\n\" + // type: integer (INT)\n \" },\\n\" +\n \" \\\"mykeyword\\\" : {\\n\" + // mykeyword:\n \" \\\"type\\\" : \\\"keyword\\\"\\n\" + // type: keyword (VARCHAR)\n \" },\\n\" +\n \" \\\"mylong\\\" : {\\n\" + // mylong: LIST\n \" \\\"type\\\" : \\\"long\\\"\\n\" + // type: long (BIGINT)\n \" },\\n\" +\n \" \\\"mynested\\\" : {\\n\" + // mynested: STRUCT\n \" \\\"properties\\\" : {\\n\" +\n \" \\\"l1date\\\" : {\\n\" + // mynested.l1date:\n \" \\\"type\\\" : \\\"date_nanos\\\"\\n\" + // type: date_nanos (DATEMILLI)\n \" },\\n\" +\n \" \\\"l1long\\\" : {\\n\" + // mynested.l1long:\n \" \\\"type\\\" : \\\"long\\\"\\n\" + // type: long (BIGINT)\n \" },\\n\" +\n \" \\\"l1nested\\\" : {\\n\" + // mynested.l1nested: STRUCT\n \" \\\"properties\\\" : {\\n\" +\n \" \\\"l2binary\\\" : {\\n\" + // mynested.l1nested.l2binary:\n \" \\\"type\\\" : \\\"binary\\\"\\n\" + // type: binary (VARCHAR)\n \" },\\n\" +\n \" \\\"l2short\\\" : {\\n\" + // mynested.l1nested.l2short: LIST\n \" \\\"type\\\" : \\\"short\\\"\\n\" + // type: short (SMALLINT)\n \" }\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \" },\\n\" +\n \" \\\"myscaled\\\" : {\\n\" + // myscaled:\n \" \\\"type\\\" : \\\"scaled_float\\\",\\n\" + // type: scaled_float (BIGINT)\n \" \\\"scaling_factor\\\" : 10.0\\n\" + // factor: 10\n \" },\\n\" +\n \" \\\"myshort\\\" : {\\n\" + // myshort:\n \" \\\"type\\\" : \\\"short\\\"\\n\" + // type: short (SMALLINT)\n \" },\\n\" +\n \" \\\"mytext\\\" : {\\n\" + // mytext:\n \" \\\"type\\\" : \\\"text\\\"\\n\" + // type: text (VARCHAR)\n \" }\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\\n\", LinkedHashMap.class);\n LinkedHashMap<String, Object> index = (LinkedHashMap<String, Object>) mapping.get(\"mishmash\");\n LinkedHashMap<String, Object> mappings = (LinkedHashMap<String, Object>) index.get(\"mappings\");\n\n when(mockClient.getMapping(nullable(String.class))).thenReturn(mappings);\n\n // Get real mapping.\n when(domainMapProvider.getDomainMap(null)).thenReturn(ImmutableMap.of(\"movies\",\n \"https://search-movies-ne3fcqzfipy6jcrew2wca6kyqu.us-east-1.es.amazonaws.com\"));\n handler = new ElasticsearchMetadataHandler(awsGlue, new LocalKeyFactory(), awsSecretsManager, amazonAthena,\n \"spill-bucket\", \"spill-prefix\", domainMapProvider, clientFactory, 10, com.google.common.collect.ImmutableMap.of());\n GetTableRequest req = new GetTableRequest(fakeIdentity(), \"queryId\", \"elasticsearch\",\n new TableName(\"movies\", \"mishmash\"));\n GetTableResponse res = handler.doGetTable(allocator, req);\n Schema realMapping = res.getSchema();\n\n logger.info(\"doGetTable - {}\", res);\n\n // Test1 - Real mapping must NOT be empty.\n assertTrue(\"Real mapping is empty!\", realMapping.getFields().size() > 0);\n // Test2 - Real and mocked mappings must have the same fields.\n assertTrue(\"Real and mocked mappings are different!\",\n ElasticsearchSchemaUtils.mappingsEqual(realMapping, mockMapping));\n\n logger.info(\"doGetTable - exit\");\n }", "@Override\n\tpublic void willCreateTables(Connection con, DataMap map) throws Exception {\n\t\tDbEntity e = map.getDbEntity(\"PRIMITIVES_TEST\");\n\t\tif (e != null) {\n\t\t\te.getAttribute(\"BOOLEAN_COLUMN\").setMandatory(true);\n\t\t}\n\t\tDbEntity e1 = map.getDbEntity(\"INHERITANCE_SUB_ENTITY3\");\n\t\tif (e1 != null) {\n\t\t\te1.getAttribute(\"SUBENTITY_BOOL_ATTR\").setMandatory(true);\n\t\t}\n\t\tDbEntity e2 = map.getDbEntity(\"MT_TABLE_BOOL\");\n\t\tif (e2 != null) {\n\t\t\te2.getAttribute(\"BOOLEAN_COLUMN\").setMandatory(true);\n\t\t}\n\t\tDbEntity e3 = map.getDbEntity(\"QUALIFIED1\");\n\t\tif (e3 != null) {\n\t\t\te3.getAttribute(\"DELETED\").setMandatory(true);\n\t\t}\n\n\t\tDbEntity e4 = map.getDbEntity(\"QUALIFIED2\");\n\t\tif (e4 != null) {\n\t\t\te4.getAttribute(\"DELETED\").setMandatory(true);\n\t\t}\n\n\t\tDbEntity e5 = map.getDbEntity(\"Painting\");\n\t\tif (e5 != null) {\n\t\t\tif (e5.getAttribute(\"NEWCOL2\") != null) {\n\t\t\t\te5.getAttribute(\"DELETED\").setMandatory(true);\n\t\t\t}\n\t\t}\n\n\t\tDbEntity e6 = map.getDbEntity(\"SOFT_TEST\");\n\t\tif (e6 != null) {\n\t\t\te6.getAttribute(\"DELETED\").setMandatory(true);\n\t\t}\n\n\t}", "public void tableViewSetup() {\n nameColumn.setCellValueFactory(new PropertyValueFactory<>(\"Name\"));\n productTable.getColumns().add(nameColumn);\n\n manuColumn.setCellValueFactory(new PropertyValueFactory<>(\"Manufacturer\"));\n productTable.getColumns().add(manuColumn);\n\n typeColumn.setCellValueFactory(new PropertyValueFactory<>(\"Type\"));\n productTable.getColumns().add(typeColumn);\n }", "String getBaseTable();", "public void prepareTable(){\n\n TableColumn<Student, String> firstNameCol = new TableColumn<>(\"FirstName\");\n firstNameCol.setMinWidth(100);\n firstNameCol.setCellValueFactory(new PropertyValueFactory<>(\"firstname\"));\n\n TableColumn<Student, String> lastNameCol = new TableColumn<>(\"LastName\");\n lastNameCol.setMinWidth(100);\n lastNameCol.setCellValueFactory(new PropertyValueFactory<>(\"lastname\"));\n\n TableColumn<Student, String> formCol = new TableColumn<>(\"Form\");\n formCol.setMinWidth(100);\n formCol.setCellValueFactory(new PropertyValueFactory<>(\"form\"));\n\n TableColumn<Student, String> streamCol = new TableColumn<>(\"Stream\");\n streamCol.setMinWidth(100);\n streamCol.setCellValueFactory(new PropertyValueFactory<>(\"stream\"));\n\n TableColumn<Student, String> dateOfBirthCol = new TableColumn<>(\"Favorite Game\");\n dateOfBirthCol.setMinWidth(100);\n dateOfBirthCol.setCellValueFactory(new PropertyValueFactory<>(\"dateOfBirth\"));\n\n TableColumn<Student, String> genderCol = new TableColumn<>(\"Gender\");\n genderCol.setMinWidth(100);\n genderCol.setCellValueFactory(new PropertyValueFactory<>(\"gender\"));\n\n TableColumn<Student, Integer> ageCol = new TableColumn<>(\"age\");\n ageCol.setMinWidth(100);\n ageCol.setCellValueFactory(new PropertyValueFactory<>(\"age\"));\n\n TableColumn<Student, Integer> admissionCol = new TableColumn<>(\"Admission\");\n admissionCol.setMinWidth(100);\n admissionCol.setCellValueFactory(new PropertyValueFactory<>(\"admission\"));\n\n\n table.getColumns().addAll(admissionCol,firstNameCol,lastNameCol,formCol,streamCol,dateOfBirthCol,genderCol,ageCol);\n table.setItems(dao.selectAll());\n\n }", "public Spec() {\n super();\n // TODO Auto-generated constructor stub\n }", "public String toString() {\n\t\treturn \"JoinTableSpec(\"+leftTable.toString()+\" INNER JOIN \"+rightTable.toString()\n\t\t\t\t+\" ON \"+leftCell.toString()+\" = \"+rightCell.toString()+\")\";\n\t}", "private void createMainTable(Section subCatPart)\r\n throws BadElementException, MalformedURLException, IOException {\r\n \r\n \r\n PdfPTable table = new PdfPTable(model.getColumnCount());\r\n table.setWidthPercentage(100.0f);\r\n \r\n PdfPCell c1;\r\n for(int i = 0; i < model.getColumnCount(); i++){\r\n c1 = new PdfPCell(new Phrase(model.getColumnName(i)));\r\n c1.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n table.addCell(c1);\r\n }\r\n table.setHeaderRows(1);\r\n\r\n for(int row = 0; row < model.getRowCount(); row++){\r\n for (int col = 0; col < model.getColumnCount(); col++) {\r\n String input = model.getValueAt(row, col).toString();\r\n if(input.equals(\"true\"))\r\n input = \"X\";\r\n if(input.equals(\"false\"))\r\n input = \"\";\r\n PdfPCell cell = new PdfPCell(new Phrase(input));\r\n cell.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n table.addCell(cell);\r\n \r\n }\r\n }\r\n subCatPart.add(table);\r\n }", "private void buildIngredientTable(){\n\n //IL=IM.getIngredientItemArrayList();\n\n\n\n ingredientTable = new JTable();\n ingredientTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);\n\n ingredientTable.getTableHeader().setReorderingAllowed(false);\n\n DTM = IM.getIngDTM();\n ingredientTable.setModel(DTM);\n\n ingredientTable.setRowSelectionAllowed(true);\n\n ingredientTable.setPreferredScrollableViewportSize(new Dimension(500, 50));\n ingredientTable.setDragEnabled(false);\n ingredientTable.setDefaultEditor(Object.class, null);\n //TODO\n\n TableColumnModel columnModel = ingredientTable.getColumnModel();\n columnModel.getColumn(1).setWidth(500);\n\n scrollPane = new JScrollPane(ingredientTable,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n scrollPane.setPreferredSize(new Dimension(450, 450));\n\n }", "public void readValuesfromtableWithoutHeadings()\n\t {\n\t\t open();\n\t\t List<Map<Object, String>> tab1= withColumns(\"Last Name \" ,\"First Name\",\"Email\", \"Due\" , \"Web Site\" , \"My Test\") \n\t\t\t\t .readRowsFrom(table);\n\t\t System.out.println(tab1);\n\t }", "public static void updateTable()\r\n\t{\r\n\t\tfor (int i = 0; i < DataHandler.getClassesSize(); i++)\r\n\t\t{\r\n\t\t\ttable.getModel().setValueAt(\r\n\t\t\t\t\tString.valueOf(LogicHandler.getRelativeOccurences(DataHandler.getList(), DataHandler.getSampleSize())[i]),\r\n\t\t\t\t\ti, 3);\r\n\t\t}\r\n\t}", "private void initTable() {\n \t\t// init table\n \t\ttable.setCaption(TABLE_CAPTION);\n \t\ttable.setPageLength(10);\n \t\ttable.setSelectable(true);\n \t\ttable.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);\n \t\ttable.setColumnCollapsingAllowed(true);\n \t\ttable.setColumnReorderingAllowed(true);\n \t\ttable.setSelectable(true);\n \t\t// this class handles table actions (see handleActions method below)\n \t\ttable.addActionHandler(this);\n \t\ttable.setDescription(ACTION_DESCRIPTION);\n \n \t\t// populate Toolkit table component with test SQL table rows\n \t\ttry {\n \t\t\tQueryContainer qc = new QueryContainer(\"SELECT * FROM employee\",\n \t\t\t\t\tsampleDatabase.getConnection());\n \t\t\ttable.setContainerDataSource(qc);\n \t\t} catch (SQLException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\t// define which columns should be visible on Table component\n \t\ttable.setVisibleColumns(new Object[] { \"FIRSTNAME\", \"LASTNAME\",\n \t\t\t\t\"TITLE\", \"UNIT\" });\n \t\ttable.setItemCaptionPropertyId(\"ID\");\n \t}", "@Test\n \tpublic void mapTable() {\n \t\t\n \t\tString[][] data = { { \"11\", \"12\" }, { \"21\", \"22\" } };\n \n \t\tTable table = tableWith(data,\"c1\",\"c2\");\n \n \t\tTableMapDirectives directives = new TableMapDirectives(table.columns().get(0));\n \t\t\n \t\tdirectives.add(column(\"TAXOCODE\"))\n \t\t .add(column(\"ISSCAAP\"))\n \t\t .add(column(\"Scientific_name\"))\n \t\t .add(column(\"English_name\").language(\"en\"))\n \t\t .add(column(\"French_name\").language(\"fr\"))\n \t\t .add(column(\"Spanish_name\").language(\"es\"))\n \t\t .add(column(\"Author\"))\n \t\t .add(column(\"Family\"))\n \t\t .add(column(\"Order\"));\n \n \t\tOutcome outcome = service.map(table, directives);\n \t\t\n \t\tassertNotNull(outcome.result());\n \t}", "public Lecturers getLecTable();", "public void paramTable() {\n jTable2.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);\n mode = (DefaultTableModel) jTable2.getModel();\n dtcm = (DefaultTableColumnModel) jTable2.getColumnModel();\n\n jTable2.setRowHeight(40);\n largeurColoneMax(dtcm, 0, 70);\n largeurColoneMax(dtcm, 3, 50);\n largeurColoneMax(dtcm, 4, 100);\n largeurColoneMax(dtcm, 6, 90);\n largeurColoneMax(dtcm, 9, 70);\n\n TableCellRenderer tbcProjet = getTableCellRenderer();\n TableCellRenderer tbcProjet2 = getTableHeaderRenderer();\n for (int i = 0; i < jTable2.getColumnCount(); i++) {\n TableColumn tc = jTable2.getColumnModel().getColumn(i);\n tc.setCellRenderer(tbcProjet);\n tc.setHeaderRenderer(tbcProjet2);\n\n }\n\n }", "TableFull createTableFull();", "@Override\n\tpublic String selectgoodsSpecById(Integer id) {\n\t\treturn orderMapper.selectgoodsSpecById(id);\n\t}", "private Table getHeaderForNewAssetTable(ManufacturingOrder dto) {\n\n\t\tTableHeaderData assetNumberHeaderData = new TableHeaderData(\n\t\t\t\tnew SimpleText(\"Asset #\"));\n\t\tassetNumberHeaderData.addAttribute(\"style\", \"width: 22%\");\n\n\t\tTableHeaderData descriptionHeaderData = new TableHeaderData(\n\t\t\t\tnew SimpleText(\"Description\"));\n\n\t\tTableHeaderData statusHeaderData = new TableHeaderData(new SimpleText(\n\t\t\t\t\"Active\"));\n\n\t\tArrayList<TableHeaderData> headers = new ArrayList<TableHeaderData>();\n\n\t\tif (dto.getEditFlag()) {\n\n\t\t\tTableHeaderData facilityHeaderData = new TableHeaderData(\n\t\t\t\t\tnew SimpleText(\"Facility\"));\n\t\t\tfacilityHeaderData.addAttribute(\"style\", \"width:10%\");\n\n\t\t\tTableHeaderData workCenterHeaderData = new TableHeaderData(\n\t\t\t\t\tnew SimpleText(\"Work Center\"));\n\t\t\tworkCenterHeaderData.addAttribute(\"style\", \"width: 10%\");\n\n\t\t\tTableHeaderData assetHeaderData = new TableHeaderData(\n\t\t\t\t\tnew SimpleText(\"Asset\"));\n\t\t\tassetHeaderData.addAttribute(\"style\", \"width: 10%\");\n\n\t\t\tstatusHeaderData.addAttribute(\"style\", \"width: 10%\");\n\t\t\tdescriptionHeaderData.addAttribute(\"style\", \"width: 30%\");\n\t\t\theaders.add(facilityHeaderData);\n\t\t\theaders.add(workCenterHeaderData);\n\t\t\theaders.add(assetHeaderData);\n\t\t\theaders.add(descriptionHeaderData);\n\t\t\theaders.add(statusHeaderData);\n\t\t} else {\n\t\t\tdescriptionHeaderData.addAttribute(\"style\", \"width: 30%\");\n\t\t\tstatusHeaderData.addAttribute(\"style\", \"width: 15%\");\n\n\t\t\theaders.add(assetNumberHeaderData);\n\t\t\theaders.add(descriptionHeaderData);\n\t\t\theaders.add(statusHeaderData);\n\n\t\t}\n\n\t\tTableHeader tableHeader = new TableHeader(headers);\n\t\ttableHeader.addAttribute(\"style\", \"text-align: center;\");\n\t\tTable table = new Table();\n\t\ttable.setTableHeader(tableHeader);\n\t\ttable.addAttribute(\"id\", \"normalTableNostripe\");\n\t\ttable.addAttribute(\"align\", \"center\");\n\t\ttable.addAttribute(\"cellSpacing\", \"0\");\n\t\ttable.addAttribute(\"cellPadding\", \"0\");\n\t\ttable.addAttribute(\"border\", \"1\");\n\t\ttable.addAttribute(\"class\", \"classContentTable\");\n\t\ttable.addAttribute(\"style\",\n\t\t\t\t\"white-space: nowrap; word-spacing: normal; width: 500px\");\n\t\ttable.addTableHeaderAttribute(\"class\", \"fixedHeader\");\n\t\ttable.addTableBodyAttribute(\"class\", \"scrollContent\");\n\n\t\treturn table;\n\n\t}", "@Override\n public Class<GoodsSpecProductRecord> getRecordType() {\n return GoodsSpecProductRecord.class;\n }", "private HashMap getTableRow(int rowNum)\r\n {\r\n HashMap hashRow = new HashMap() ;\r\n int colTotal = codeTableModel.getColumnCount()-1;\r\n for (int colCount=0; colCount <= codeTableModel.getColumnCount()-1; colCount++)\r\n { // for each column u will build a hashmap\r\n// if (colCount == 1 )\r\n// {//sponsor name is not in update sp.\r\n// continue;\r\n// }\r\n TableColumn column = codeTableColumnModel.getColumn(colCount) ;\r\n ColumnBean columnBean = (ColumnBean)column.getIdentifier() ;\r\n Object val = null ;\r\n // the whole idea of setting up the columnBean as the identifier is that u get to know\r\n // all abt the structure details of the column, so u can create appropriate type of object\r\n // and stick it in to the hashMap\r\n if (columnBean.getDataType().equals(\"NUMBER\"))\r\n {\r\n if (codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount) == null\r\n ||(codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount).equals(\"\")))\r\n {\r\n val = null ; //new Integer(0)\r\n }\r\n else\r\n {\r\n val = codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount);\r\n if (val instanceof ComboBoxBean)\r\n {\r\n if (((ComboBoxBean)val).getCode().equals(\"\"))// user deleted selection\r\n val = null;\r\n else\r\n val = new Integer(((ComboBoxBean)val).getCode().toString());\r\n }\r\n else\r\n {\r\n val = new Integer(val.toString()) ;\r\n }\r\n }\r\n }\r\n\r\n if (columnBean.getDataType().equals(\"VARCHAR2\"))\r\n {\r\n if (codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount)==null)\r\n {\r\n val = \"\";\r\n }\r\n else\r\n {\r\n val = codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount).toString() ;\r\n }\r\n }\r\n\r\n if (columnBean.getDataType().equals(\"DATE\"))\r\n {\r\n //coeusdev-568 start\r\n //Date today = new Date();\r\n //coeusdev-568 end\r\n if (codeTableModel.getValueAt(sorter.getIndexForRow(rowNum), codeTableModel.getColumnCount()-1).equals(\"I\")) // if itz an insert\r\n { //AV_ & AW_ will be the same for insert\r\n //coeusdev-568 start\r\n //val = new java.sql.Timestamp(today.getTime());\r\n val = CoeusUtils.getDBTimeStamp();\r\n //coeusdev-568 end\r\n }\r\n else\r\n { // for update\r\n // there will be only two dates in any table one AV_UPDATE_TIMESTAMP and the other one AW_UPDATE_TIMESTAMP\r\n if (columnBean.getQualifier().equals(\"VALUE\"))\r\n { //AV_...\r\n //coeusdev-568 start\r\n //val = new java.sql.Timestamp(today.getTime());\r\n val = CoeusUtils.getDBTimeStamp();\r\n //coeusdev-568 end\r\n }\r\n else\r\n { //AW_...\r\n val = java.sql.Timestamp.valueOf(codeTableModel.getValueAt(sorter.getIndexForRow(rowNum),colCount).toString()) ;\r\n }\r\n }\r\n }\r\n\r\n hashRow.put(columnBean.getColIdentifier(), val) ;\r\n } //end for\r\n return hashRow;\r\n }", "@Override\r\n\tprotected String getTable() {\n\t\treturn TABLE;\r\n\t}", "public void test2() throws ClassNotFoundException, SQLException {\r\n\t\tsqlTable tbl = new sqlTable();\r\n\t\ttbl.printInAplication(\"SELECT * FROM metropolises WHERE metropolis like \" + \"\\\"%m%\" + \"\\\";\");\r\n\t\tVector<Object> v1 = tbl.getGrid().get(0);\r\n\t\tVector<Object> v2 = tbl.getGrid().get(1);\r\n\t\tVector<Object> v3 = tbl.getGrid().get(2);\r\n\t\tassertTrue(v1.get(0).equals(\"Mumbai\"));\r\n\t\tassertTrue(v2.get(0).equals(\"Rome\")); \r\n\t\tassertTrue(v3.get(0).equals(\"Melbourne\"));\r\n\t}", "Object getTables();", "public void readTableData2() {\n\t\tint colCount = driver.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr[1]/th\"))\n\t\t\t\t.size();\n\t\tSystem.out.println(\"colCount\" + colCount);\n\t\t// Find row size\n\t\tint rowCount = driver\n\t\t\t\t.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td/parent::*\")).size();\n\t\tSystem.out.println(\"rowCount\" + rowCount);\n\t\t// Find xpath for 1st row and 1st column. Break into multiple parts such\n\t\t// that row and column no can be iterated.\n\t\tString firstPart = \"(//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td[2]/parent::tr)[\";\n\t\tString secondPart = \"]\";\n\t\t// Loop through rows one by one. Start from 1st row till row count.\n\t\tfor (int i = 1; i <= rowCount; i++) {\n\t\t\t\tString finalPart = firstPart + i + secondPart;\n\t\t\t\tSystem.out.println(finalPart);\n\t\t\t\tString text = driver.findElement(By.xpath(finalPart)).getText();\n\t\t\t\tSystem.out.print(text + \" | \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void assertOnTableElements()\n {\n\t open();\n\t inTable(table).shouldHaveRowElementsWhere(the(\"First name\" , equalTo(\"Frank\")));\n }", "public JTable getJrTbl2() {\n\t\tForMngJrArticleModel fmngJr = new ForMngJrArticleModel();\n\t\tDefaultTableModel defModel = new DefaultTableModel(0,8);\n\t\tJTable jTblForJr = new JTable(defModel);\n\t\tfor(int i =0; i<getJrArtArrayList().size();i++) {\n\t\t\tfmngJr = getJrArtArrayList().get(i);\n\t\t\t//condition to check if there is availability of articles that the logged in researcher has not hired\n\t\t\tif(!fmngJr.getNmOfRe().contains(loggedReseId) && !fmngJr.getNoOfJr().contentEquals(\"0\")) {\n\t\t\t\tObject[] objData = {fmngJr.getArNmOfJr(), fmngJr.getAuthNmOfJr(),fmngJr.getNmOfJr(), fmngJr.getYrOfJr(), fmngJr.getVolOfJr(),fmngJr.getIssOfJr(),fmngJr.getPgOfJr(),fmngJr.getNoOfJr()};\n\t\t\t\tdefModel.addRow(objData);\n\t\t\t}\n\t\t}\n\n\t\tString reColTitles[] = {\"Name of Article\", \"Author/s\",\"Journal Title\", \"<html>Publication<br>Year</html>\",\"Volume No.\",\"Issue No.\",\"Page No.\",\"<html>No. of Articles<br>Available</html>\"};\n\t\tdefModel.setColumnIdentifiers(reColTitles);\n\t\tjTblForJr.setRowHeight(28);\n\n\t\tJTableHeader tblHeader = jTblForJr.getTableHeader();\n\t\ttblHeader.setPreferredSize(new Dimension(100,35));\n\t\ttblHeader.setBackground(new Color(21, 34, 49));\n\t\ttblHeader.setForeground(Color.WHITE);\n\n\t\treturn jTblForJr;\n\t}", "private int h1(int p){\n\t\t return p % table.length;\n\t}", "void prepareTables();", "public abstract void configureTables();", "@Override\n protected Map<TableUniqueName, String> tableSubstitution() {\n return ImmutableMap.of();\n }", "private static void initialize_sensorTypeToTableProperties() {\n\t\tinitialized_LinkType();\n\t\tinitialized_RoadActivitysType();\n\t\tinitialized_SealevelType();\n\t\tinitialized_SnowDepthType();\n\t\tinitialized_SnowFallType();\n\t\tinitialized_TrafficType();\n\t\tinitialized_WeatherType();\n\t\tinitialized_BikeHireType();\n\t\tinitialized_RailwayStationType();\n\t\tinitialized_ADSBHubType();\n\t}", "public TableModel getTableModel() {\n\t\tfinal int numEach = calcMags.length+1;\n\t\tfinal int rows = probs.rowKeySet().size()*numEach;\n\t\tfinal int cols = 4;\n\t\treturn new AbstractTableModel() {\n\n\t\t\t@Override\n\t\t\tpublic int getRowCount() {\n\t\t\t\treturn rows;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int getColumnCount() {\n\t\t\t\treturn cols;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Object getValueAt(int rowIndex, int columnIndex) {\n\t\t\t\tif (rowIndex == 0)\n\t\t\t\t\treturn headers[columnIndex];\n\t\t\t\trowIndex -= 1;\n\t\t\t\tint m = rowIndex % numEach;\n\t\t\t\tint d = rowIndex / numEach;\n\t\t\t\t\n\t\t\t\tif (columnIndex == 0) {\n\t\t\t\t\tif (m == 0)\n\t\t\t\t\t\treturn durations[d].label;\n\t\t\t\t\telse if (m == 1)\n\t\t\t\t\t\treturn df.format(Date.from(startDate));\n\t\t\t\t\telse if (m == 2)\n\t\t\t\t\t\treturn \"through\";\n\t\t\t\t\telse if (m == 3)\n\t\t\t\t\t\treturn df.format(Date.from(endDates[d]));\n\t\t\t\t\telse\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t} else {\n\t\t\t\t\tif (m >= calcMags.length)\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\tdouble mag = calcMags[m];\n\t\t\t\t\tif (columnIndex == 1) {\n\t\t\t\t\t\tif (m == minMags.length) {\n\t\t\t\t\t\t\treturn \"M ≥ Main (\" + ((float)mag) + \")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"M ≥ \"+(float)mag;\n\t\t\t\t\t} else if (columnIndex == 2) {\n\t\t\t\t\t\tint lower = (int)(numEventsLower.get(durations[d], mag)+0.5);\n\t\t\t\t\t\tint upper = (int)(numEventsUpper.get(durations[d], mag)+0.5);\n\t\t\t\t\t\tint median = (int)(numEventsMedian.get(durations[d], mag)+0.5);\n\t\t\t\t\t\tif (upper == 0)\n\t\t\t\t\t\t\treturn \"*\";\n\t\t\t\t\t\treturn lower + \" to \" + upper + \", median \" + median;\n\t\t\t\t\t} else if (columnIndex == 3) {\n\n\t\t\t\t\t\tdouble prob = 100.0 * probs.get(durations[d], mag);\n\t\t\t\t\t\tString probFormatted;\n\t\t\t\t\t\tif (prob < 1.0e-6 && prob > 0.0) {\n\t\t\t\t\t\t\tprobFormatted = SimpleUtils.double_to_string (\"%.2e\", prob);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdouble probRounded = SimpleUtils.round_double_via_string (\"%.2e\", prob);\n\t\t\t\t\t\t\tprobFormatted = SimpleUtils.double_to_string_trailz (\"%.8f\", SimpleUtils.TRAILZ_REMOVE, probRounded);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn probFormatted + \" %\";\n\n\t\t\t\t\t\t//int prob = (int)(100d*probs.get(durations[d], mag) + 0.5);\n\t\t\t\t\t\t//if (prob == 0)\n\t\t\t\t\t\t//\treturn \"*\";\n\t\t\t\t\t\t//else if (prob == 100)\n\t\t\t\t\t\t//\treturn \">99 %\";\n\t\t\t\t\t\t//return prob+\" %\";\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\t\n\t\t};\n\t}", "List<TargetTable> retrieveShortCadenceTargetTable(TargetTable ttable);", "private void callSetLayerPreviewTable() {\n \t\t\t\t\t\t\tfor(String key : columnUnits.keySet()) {\r\n \t\t\t\t\t\t\t\tString units = columnUnits.get(key);\r\n \t\t\t\t\t\t\t\tcolumnDescriptions.put(key, columnDescriptions.get(key) + \" (\" + units + \")\");\r\n \t\t\t\t\t\t\t}\t\t\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\tview.setLayerPreviewTable(layerPreviewFinal.getRows(), columnDisplayOrder, columnDescriptions, columnUnits);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n \t\t\t\t\t\t}", "private Object getTable() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@Override\r\n\tpublic void initializeTableContents() {\n\t\t\r\n\t}", "private void createTable() {\n\t\t// Tao dataModel & table \n\t\tdataModel = new DefaultTableModel(headers, 0);\n\t\ttable.setModel(dataModel);\n\t\t\n\t\tnapDuLieuChoBang();\n\t}", "public void testCreateTable() {\n LOG.info(\"Entering testCreateTable.\");\n\n // Specify the table descriptor.\n HTableDescriptor htd = new HTableDescriptor(tableName);\n\n // Set the column family name to info.\n HColumnDescriptor hcd = new HColumnDescriptor(\"info\");\n\n // Set data encoding methods,HBase provides DIFF,FAST_DIFF,PREFIX\n // and PREFIX_TREE\n hcd.setDataBlockEncoding(DataBlockEncoding.FAST_DIFF);\n\n // Set compression methods, HBase provides two default compression\n // methods:GZ and SNAPPY\n // GZ has the highest compression rate,but low compression and\n // decompression effeciency,fit for cold data\n // SNAPPY has low compression rate, but high compression and\n // decompression effeciency,fit for hot data.\n // it is advised to use SANPPY\n hcd.setCompressionType(Compression.Algorithm.SNAPPY);\n\n htd.addFamily(hcd);\n\n Admin admin = null;\n try {\n // Instantiate an Admin object.\n admin = conn.getAdmin();\n if (!admin.tableExists(tableName)) {\n LOG.info(\"Creating table...\");\n admin.createTable(htd);\n LOG.info(admin.getClusterStatus());\n LOG.info(admin.listNamespaceDescriptors());\n LOG.info(\"Table created successfully.\");\n } else {\n LOG.warn(\"table already exists\");\n }\n } catch (IOException e) {\n LOG.error(\"Create table failed.\");\n } finally {\n if (admin != null) {\n try {\n // Close the Admin object.\n admin.close();\n } catch (IOException e) {\n LOG.error(\"Failed to close admin \", e);\n }\n }\n }\n LOG.info(\"Exiting testCreateTable.\");\n }", "public JTable create() {\n\n Object[] colName = null;\n int columnsNumber = 0;\n\n columnsNumber = 2;\n colName = new Object[columnsNumber];\n\n colName[0] = MessagesManager.get(\"name\");\n colName[1] = MessagesManager.get(\"value\");\n\n Properties p = System.getProperties();\n\n Enumeration keys = p.keys();\n\n List<String> listKeys = new Vector<String>();\n\n while (keys.hasMoreElements()) {\n String key = (String) keys.nextElement();\n listKeys.add(key);\n }\n\n Collections.sort(listKeys);\n\n Object[][] data = new Object[listKeys.size()][columnsNumber];\n\n for (int i = 0; i < listKeys.size(); i++) {\n String key = listKeys.get(i);\n String value = p.getProperty(key);\n\n data[i][0] = key;\n data[i][1] = value;\n\n }\n\n // TableSorter is a tool class to sort columns by clicking on headers\n TableSorter sorter = new TableSorter(new TableModelNonEditable(data, colName));\n\n // We will create out own getCellRenderer() in the JTable, so that it can call\n // PgeepTableCellRenderer\n// JTable jTable1 = new JTable(sorter) \n// {\n// public TableCellRenderer getCellRenderer(int row, int column) \n// {\n// return new PgeepTableCellRenderer(owner);\n// } \n// };\n\n JTable jTable1 = new JTable(sorter);\n\n // Set the Table Header Display\n Font fontHeader = new Font(m_font.getName(), Font.PLAIN, m_font.getSize());\n JTableHeader jTableHeader = jTable1.getTableHeader();\n jTableHeader.setFont(fontHeader);\n sorter.setTableHeader(jTableHeader);\n\n jTable1.setFont(m_font);\n jTable1.setColumnSelectionAllowed(false);\n jTable1.setRowSelectionAllowed(true);\n jTable1.setAutoscrolls(true);\n\n //jTable1.setColumnModel(new MyTableColumnModel());\n //jTable1.setAutoCreateColumnsFromModel(true);\n\n jTable1.setShowHorizontalLines(false);\n jTable1.setShowVerticalLines(true);\n\n jTable1.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);\n\n // Resize last column (if necessary)\n jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\n\n // use an Expansion factor of 1.3x for change between 12 and Arial,17 \n JTableUtil.calcColumnWidths(jTable1, 1.00);\n\n return jTable1;\n }", "@Override\n\tpublic List<HeadUnit> getallHeadUnitDetail() {\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\tString sql = \"SELECT * FROM headunit\";\n\t\tList<HeadUnit> listHeadunit = jdbcTemplate.query(sql, new RowMapper<HeadUnit>() {\n\t\t\t@Override\n\t\t\tpublic HeadUnit mapRow(ResultSet rs, int rowNum) throws SQLException {\n\t\t\t\t// set parameters\n\t\t\t\tHeadUnit headunit = new HeadUnit();\n\t\t\t\theadunit.setHeadunitid(rs.getLong(\"headunit_id\"));\n\t\t\t\theadunit.setUserid(rs.getInt(\"user_id\"));\n\t\t\t\theadunit.setCarname(rs.getString(\"carname\"));\n\t\t\t\theadunit.setHduuid(rs.getString(\"hduuid\"));\n\t\t\t\theadunit.setAppversion(rs.getString(\"appversion\"));\n\t\t\t\theadunit.setGcmregistartionkey(rs.getString(\"gcmregistartionkey\"));\n\t\t\t\theadunit.setCreateddate(rs.getDate(\"createddate\"));\n\t\t\t\treturn headunit;\n\t\t\t}\n\t\t});\n\t\treturn listHeadunit;\n\t}", "public interface Table\n extends Tabular\n{\n /** @return the names of the columns in this table or an empty list if no columns have been defined, never null */\n List<String> getColumns();\n\n /**\n * Define the name of a column\n *\n * @param index the position in the header starting with 0\n * @param name the name to be used for this column\n * @return this to allow chaining\n */\n Table setColumn(int index, String name);\n\n /**\n * Determine the name of a column if the position is known.\n *\n * @param index the position in the header starting with 0\n * @return the column name at the given position, null if unknown\n */\n String getColumn(int index);\n\n /**\n * Determine the index of a column if the name is known.\n *\n * @param column the case insensitive name of the respective column\n * @return the index of the column in the headings, -1 if the column is unknown\n */\n int indexOf(String column);\n\n /**\n * Retrieve the value of the given row and column\n *\n * If the row is out of bounds or the column is unknown will simply return <code>null</code> to indicate that no value\n * has been set.\n *\n * @param column the column name in the table\n * @param row the row number in the table starting with 0\n * @return the associated value of that cell, can be null\n */\n\n String getValue(String column, int row);\n\n /**\n * Retrieve the configuration parameters of this table.\n *\n * As there can be many implementations of a table and these implementations are configured in a different manner,\n * this is the place where these parameters can be retrieved in a uniform manner and passed to other layers, e.g. to\n * configure appropriate writers and readers or simply to setup the respective factories.\n *\n * @return the not-null list of (key, value) pairs that configure this particular table\n */\n Map<String, String> getParameters();\n}", "private EstabelecimentoTable() {\n\t\t\t}", "public SwitchColTable() {\r\r\r\r\n }", "TableId table();", "WebElement getTableRecordAtIndex(int idx);", "List<PropertySpecification> propertySpecifications(ModelContext context);", "private static void setTableWithData()\n {\n /* Se establecen el tamaño de la tabla */\n table.setSize(1280, 630);\n table.setMaximumSize(new Dimension(1280, 630));\n table.setMinimumSize(new Dimension(1280, 630));\n\n /* Se garantiza que cada fila (album) tiene un alto proporcional de acuerdo con el numero de cancioens */\n Iterator iteratorPerRow = listSizePerRow.iterator();\n int sizePerRow, i;\n i = 0;\n while (iteratorPerRow.hasNext())\n {\n sizePerRow = (Integer) iteratorPerRow.next(); \n table.setRowHeight(i, sizePerRow);\n i++;\n }\n\n /* Se setea el ancho de cada columna */\n setSize(table, JSoundsMainWindowViewController.ALBUM_COVER_COLUMN, 200);\n setSize(table, JSoundsMainWindowViewController.ALBUM_INFO_COLUMN, 230);\n setSize(table, JSoundsMainWindowViewController.NUMBER_SONG_COLUMN, 50);\n setSize(table, JSoundsMainWindowViewController.LIST_SONG_COLUMN, 400);\n setSize(table, JSoundsMainWindowViewController.GENDER_SONG_COLUMN, 230);\n\n /* Renderizado del la imagen del album */\n JLabelTableRenderer jltcr = new JLabelTableRenderer();\n jltcr.setVerticalAlignment(SwingConstants.TOP);\n jltcr.setHorizontalAlignment(SwingConstants.CENTER);\n\n table.getColumnModel().getColumn(0).setCellRenderer(jltcr);\n\n\n /* Renderizados de cada columna */\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.ALBUM_INFO_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.ALBUM_INFO_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.NUMBER_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.NUMBER_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LIST_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LIST_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.GENDER_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.GENDER_SONG_COLUMN).setCellEditor(new JListTableEditor());\n\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LAST_PLAYED_SONG_COLUMN).setCellRenderer(new JListTableRenderer());\n table.getColumnModel().getColumn(JSoundsMainWindowViewController.LAST_PLAYED_SONG_COLUMN).setCellEditor(new JListTableEditor()); \n }", "private void makeTable() {\n String [] cols = new String[] {\"Planets\", \"Weights (in lbs)\", \"Weights (in kgs)\"};\n model = new DefaultTableModel(result,cols) {\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }\n };\n table = new JTable(model);\n JScrollPane scrollPane = new JScrollPane(table);\n scrollPane.setPreferredSize(new Dimension(310,155));\n middlePanel.add(scrollPane);\n revalidate();\n repaint();\n }", "private void setTable() {\n try {\n DefaultTableModel dtm = (DefaultTableModel) table.getModel();\n dtm.setRowCount(0);\n ArrayList<Item> itemList = ItemController.getAllItem();\n if (itemList != null) {\n for (Item item : itemList) {\n String qoh = BatchController.getQOH(item.getCode());\n if (qoh != null) {\n if (item.getRol() >= Integer.valueOf(qoh)) {\n Object row[] = {item.getCode(), item.getDesciption(), item.getRol(), qoh};\n dtm.addRow(row);\n }\n }\n\n }\n }\n if (dtm.getRowCount() == 0) {\n JOptionPane.showMessageDialog(this, \"Stock level is above ROL\");\n }\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ROL.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(ROL.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void fillMyGoodsTable() {\n\t\tHashMap<Goods, Integer> myGoods = ship.getMyGoods();\n\t\tDefaultTableModel model = (DefaultTableModel)this.myGoodsTable.getModel();\n\t\tint number = 1;\n\t\tfor (HashMap.Entry<Goods, Integer> set: myGoods.entrySet()) {\n\t\t\tString name = set.getKey().getName();\n\t\t\tint quantity = set.getKey().getQuantityOwned();\n\t\t\tint price = set.getValue();\n\t\t\tmodel.addRow(new Object [] {number, name, quantity, price});\n\t\t\tnumber++;\n\t\t}\n\t}", "public void initTable() {\n this.table.setSelectable(true);\n this.table.setImmediate(true);\n this.table.setWidth(\"100%\");\n this.table.addListener(this);\n this.table.setDropHandler(this);\n this.table.addActionHandler(this);\n this.table.setDragMode(TableDragMode.ROW);\n this.table.setSizeFull();\n\n this.table.setColumnCollapsingAllowed(true);\n // table.setColumnReorderingAllowed(true);\n\n // BReiten definieren\n this.table.setColumnExpandRatio(LABEL_ICON, 1);\n this.table.setColumnExpandRatio(LABEL_DATEINAME, 3);\n this.table.setColumnExpandRatio(LABEL_DATUM, 2);\n this.table.setColumnExpandRatio(LABEL_GROESSE, 1);\n this.table.setColumnExpandRatio(LABEL_ACCESS_MODES, 1);\n this.table.setColumnHeader(LABEL_ICON, \"\");\n }", "private static AdqlValidator.ValidatorTable\n toValidatorTable( TopcatModel tcModel, final String tname ) {\n StarTable dataTable = tcModel.getDataModel();\n int ncol = dataTable.getColumnCount();\n final AdqlValidator.ValidatorColumn[] vcols =\n new AdqlValidator.ValidatorColumn[ ncol ];\n final AdqlValidator.ValidatorTable vtable =\n new AdqlValidator.ValidatorTable() {\n public String getName() {\n return tname;\n }\n public AdqlValidator.ValidatorColumn[] getColumns() {\n return vcols;\n }\n };\n for ( int ic = 0; ic < ncol; ic++ ) {\n final String cname = dataTable.getColumnInfo( ic ).getName();\n vcols[ ic ] = new AdqlValidator.ValidatorColumn() {\n public String getName() {\n return cname;\n }\n public AdqlValidator.ValidatorTable getTable() {\n return vtable;\n }\n };\n }\n return vtable;\n }", "protected int getTableCondtion()\n\t\t{\n\t\t\treturn Condtion ;\n\t\t}" ]
[ "0.5945184", "0.56738466", "0.565493", "0.5654352", "0.56157774", "0.5545742", "0.55190974", "0.5513246", "0.54720235", "0.5464172", "0.54596746", "0.545949", "0.5458838", "0.5457717", "0.5449424", "0.54137385", "0.53929746", "0.53876793", "0.5351799", "0.5345157", "0.53438497", "0.53402203", "0.5338381", "0.532162", "0.5302431", "0.530114", "0.5297229", "0.5285793", "0.5283025", "0.52804697", "0.5276082", "0.5269908", "0.5269874", "0.5265193", "0.5264853", "0.5251196", "0.5250362", "0.52421534", "0.5231179", "0.5226686", "0.5218706", "0.5216819", "0.52124536", "0.5208852", "0.5187082", "0.5185147", "0.5166865", "0.516376", "0.5163287", "0.5159902", "0.51549846", "0.51544696", "0.5153648", "0.5149143", "0.51450324", "0.5140496", "0.51400393", "0.51371795", "0.5135751", "0.5134871", "0.51306206", "0.5127826", "0.5125891", "0.5125219", "0.51250315", "0.5111789", "0.51081663", "0.51062924", "0.50947285", "0.50845903", "0.5078622", "0.5078259", "0.5071517", "0.5070083", "0.50627345", "0.5056224", "0.50473136", "0.50434506", "0.5037723", "0.5028366", "0.50234485", "0.50216335", "0.5018277", "0.501801", "0.5017954", "0.50176376", "0.5011425", "0.5010339", "0.50087506", "0.50063944", "0.5004961", "0.5003774", "0.49972206", "0.49896798", "0.49877042", "0.49876383", "0.49871284", "0.4984735", "0.4984724", "0.49840245", "0.49823064" ]
0.0
-1
Bluetooth is now Enabled, are Bluetooth Advertisements supported on this device?
private void checkBlFunctAdvert() { if (blAdapt.isMultipleAdvertisementSupported()) { checkPermLocation(); } else { DialogCreator.createDialogAlert(this, R.string.txt_bl_adv_needed, R.string.txt_bl_descr_adv_needed, R.string.txt_ok, null, new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { finish(); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isBluetoothEnabled() {\n BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();\n if (bluetooth == null)\n return false;//\"device not BT capable\";\n return bluetooth.isEnabled();\n }", "public void checkForBluetooth() {\n if (hasBluetoothSupport()) {\n ensureBluetoothEnabled();\n } else {\n showToast(\"Device does not support BlueTooth\");\n }\n }", "private boolean hasBluetoothSupport() {\n mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n return (mBluetoothAdapter != null);\n }", "public boolean checkBluetooth() {\n if (!mActivity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Toast.makeText(mActivity, R.string.ble_not_supported, Toast.LENGTH_SHORT).show();\n }\n\n // Initializes a Bluetooth adapter. For API level 18 and above, get a reference to\n // BluetoothAdapter through BluetoothManager.\n final BluetoothManager bluetoothManager =\n (BluetoothManager) mActivity.getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n\n // Checks if Bluetooth is supported on the device.\n if (mBluetoothAdapter == null) {\n Toast.makeText(mActivity, R.string.error_bluetooth_not_supported, Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }", "private void setupBluetooth() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Toast.makeText(this, R.string.ble_not_supported, Toast.LENGTH_SHORT).show();\n finish();\n }\n\n // Initializes Bluetooth adapter.\n final BluetoothManager bluetoothManager =\n (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n bluetoothAdapter = bluetoothManager.getAdapter();\n\n // Ensures Bluetooth is available on the device and it is enabled. If not,\n // displays a dialog requesting user permission to enable Bluetooth.\n if (bluetoothAdapter == null || !bluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n\n Set<BluetoothDevice> pairedDevices = bluetoothAdapter.getBondedDevices();\n\n if (pairedDevices.size() > 0) {\n // There are paired devices. Get the name and address of each paired device.\n for (BluetoothDevice device : pairedDevices) {\n String deviceName = device.getName();\n String deviceHardwareAddress = device.getAddress(); // MAC address\n String deviceType = device.getBluetoothClass().getDeviceClass() + \"\";\n\n Movie movie = new Movie(deviceName, deviceHardwareAddress, deviceType);\n movieList.add(movie);\n\n }\n\n mAdapter.notifyDataSetChanged();\n }\n }", "private void checkBluetoothEnabled()\r\n {\r\n if (!mBluetoothAdapter.isEnabled())\r\n {\r\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n startActivityForResult(enableBtIntent, BLUETOOTH_ENABLE_REQUEST_ID);\r\n } else\r\n checkNfcEnabled();\r\n }", "private void ensureBluetoothEnabled() {\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(\n BluetoothAdapter.ACTION_REQUEST_ENABLE);\n main.startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n } else {\n connectToBluetoothDevice(\"00:06:66:64:42:97\"); // Hard coded MAC of the BT-device.\n Log.i(tag, \"Connected to device!\");\n }\n }", "private void ensureBluetoothIsEnabled(){\r\n\t\t//if Bluetooth is not enabled, enable it now\r\n\t\tif (!mBtAdapter.isEnabled()) { \t\t\r\n \t enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n \t startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\r\n \t}\r\n\t}", "private void enableBT() {\n if (bluetoothAdapter == null) {\n Log.e(LOG_TAG, \"Bluetooth is not supported\");\n } else if (!bluetoothAdapter.isEnabled()) {\n bluetoothAdapter.enable();\n }\n }", "private boolean BluetoothAvailable()\n {\n if (BT == null)\n return false;\n else\n return true;\n }", "@Override\n public void checkBluetoothInteface() {\n if (!isConnected) {\n checkForBluetooth();\n }\n }", "public void advertiseNow() {\n if (btLeAdv == null) {\r\n \tLog.v(TAG, \"btLeAdv is null!\");\r\n \tisAdvertising = false;\r\n \treturn;\r\n }\r\n\t\t\r\n\t\t// make our Base UUID the service UUID\r\n UUID serviceUUID = UUID.fromString(theBaseUUID);\r\n\t\t\r\n // make a new service\r\n theService = new BluetoothGattService(serviceUUID, BluetoothGattService.SERVICE_TYPE_PRIMARY);\r\n\t\t\r\n\t\t// loop over all the characteristics and add them to the service\r\n for (Entry<UUID, BluetoothGattCharacteristic> entry : myBGCs.entrySet()) {\r\n \t//entry.getKey();\r\n \ttheService.addCharacteristic(entry.getValue());\r\n }\r\n \r\n // make sure we're all cleared out before we add new stuff\r\n gattServices.clear();\r\n gattServiceIDs.clear();\r\n \r\n \tgattServices.add(theService);\r\n gattServiceIDs.add(new ParcelUuid(theService.getUuid()));\r\n\r\n \t// if we're already advertising, just quit here\r\n // TODO: if we get this far and advertising is already started, we may want reset everything!\r\n if(isAdvertising) return;\r\n\r\n // - calls bluetoothManager.openGattServer(activity, whatever_the_callback_is) as gattServer\r\n // --- this callback needs to override: onCharacteristicWriteRequest, onCharacteristicReadRequest,\r\n // ---- onServiceAdded, and onConnectionStateChange\r\n // then iterates over an ArrayList<BluetoothGattService> and calls .addService for each\r\n \r\n\r\n // start the gatt server and get a handle to it\r\n btGattServer = btMgr.openGattServer(thisContext, gattServerCallback);\r\n\r\n // loop over the ArrayList of BluetoothGattService(s) and add each to the gatt server \r\n for(int i = 0; i < gattServices.size(); i++) {\r\n \tbtGattServer.addService(gattServices.get(i));\r\n }\r\n \r\n\r\n // the AdvertiseData and AdvertiseSettings are both required\r\n //AdvertiseData.Builder dataBuilder = new AdvertiseData.Builder();\r\n AdvertisementData.Builder dataBuilder = new AdvertisementData.Builder();\r\n AdvertiseSettings.Builder settingsBuilder = new AdvertiseSettings.Builder();\r\n \r\n // allows us to fit in a 31 byte advertisement\r\n dataBuilder.setIncludeTxPowerLevel(false);\r\n \r\n // this is the operative call which gives the parceluuid info to our advertiser to link to our gatt server\r\n // dataBuilder.setServiceUuids(gattServiceIDs); // correspond to the advertisingServices UUIDs as ParcelUUIDs\r\n \r\n // API 5.0\r\n /*\r\n for (ParcelUuid pu: gattServiceIDs) {\r\n \tdataBuilder.addServiceUuid(pu);\r\n }\r\n */\r\n // API L\r\n dataBuilder.setServiceUuids(gattServiceIDs);\r\n \r\n // this spells FART, and right now apparently doesn't do anything\r\n byte[] serviceData = {0x46, 0x41, 0x52, 0x54}; \r\n \r\n UUID tUID = new UUID((long) 0x46, (long) 0x41);\r\n ParcelUuid serviceDataID = new ParcelUuid(tUID);\r\n \r\n // API 5.0\r\n // dataBuilder.addServiceData(serviceDataID, serviceData);\r\n \r\n // API L\r\n dataBuilder.setServiceData(serviceDataID, serviceData);\r\n \r\n // i guess we need all these things for our settings\r\n settingsBuilder.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY);\r\n settingsBuilder.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH);\r\n \r\n // API L\r\n settingsBuilder.setType(AdvertiseSettings.ADVERTISE_TYPE_CONNECTABLE);\r\n \r\n // API 5.0 \r\n //settingsBuilder.setConnectable(true);\r\n \r\n // API L\r\n \r\n \r\n\r\n //settingsBuilder.setType(AdvertiseSettings.ADVERTISE_TYPE_CONNECTABLE);\r\n\r\n // we created this earlier with bluetoothAdapter.getBluetoothLeAdvertiser();\r\n // - looks like we also need to have an advertiseCallback\r\n // --- this needs to override onSuccess and onFailure, and really those are just for debug messages\r\n // --- but it looks like you HAVE to do this\r\n // set our boolean so we don't try to re-advertise\r\n isAdvertising = true;\r\n \r\n try {\r\n \tbtLeAdv.startAdvertising(settingsBuilder.build(), dataBuilder.build(), advertiseCallback);\r\n } catch (Exception ex) {\r\n \tisAdvertising = false;\t\r\n }\r\n \r\n\r\n\r\n\t}", "private void startAdvertising() {\n BluetoothAdapter bluetoothAdapter = mBluetoothManager.getAdapter();\n if (!bluetoothAdapter.isEnabled()) {\n System.out.println(\"does not support\");\n }\n if (!bluetoothAdapter.isMultipleAdvertisementSupported()) {\n //Device does not support Bluetooth LE\n System.out.println(\"does not support\");\n }\n\n mBluetoothLeAdvertiser = bluetoothAdapter.getBluetoothLeAdvertiser();\n if (mBluetoothLeAdvertiser == null) {\n Log.w(TAG, \"Failed to create advertiser\");\n return;\n }\n\n AdvertiseSettings settings = new AdvertiseSettings.Builder()\n .setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY)\n .setConnectable(true)\n .setTimeout(0)\n .setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH)\n .build();\n\n AdvertiseData data = new AdvertiseData.Builder()\n .setIncludeDeviceName(true)\n .setIncludeTxPowerLevel(false)\n .addServiceUuid(new ParcelUuid(TimeProfile.TIME_SERVICE))\n .build();\n\n mBluetoothLeAdvertiser\n .startAdvertising(settings, data, mAdvertiseCallback);\n }", "private void checkBleSupportAndInitialize() {\n Log.d(TAG, \"checkBleSupportAndInitialize: \");\n // Use this check to determine whether BLE is supported on the device.\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Log.d(TAG,\"device_ble_not_supported \");\n Toast.makeText(this, R.string.device_ble_not_supported,Toast.LENGTH_SHORT).show();\n return;\n }\n // Initializes a Blue tooth adapter.\n final BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n\n if (mBluetoothAdapter == null) {\n // Device does not support Blue tooth\n Log.d(TAG, \"device_ble_not_supported \");\n Toast.makeText(this,R.string.device_ble_not_supported, Toast.LENGTH_SHORT).show();\n return;\n }\n\n //打开蓝牙\n if (!mBluetoothAdapter.isEnabled()) {\n Log.d(TAG, \"open bluetooth \");\n bluetoothUtils.openBluetooth();\n }\n }", "private void CheckBtIsOn() {\n mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\n if (!mBluetoothAdapter.isEnabled()) {\n Toast.makeText(getApplicationContext(), \"Bluetooth Disabled!\",\n Toast.LENGTH_SHORT).show();\n\n // Start activity to show bluetooth options\n Intent enableBtIntent = new Intent(mBluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }", "public void checkBluetooth(BluetoothAdapter bluetoothAdapter){\n if(bluetoothAdapter == null || !bluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }", "private void checkBTState() {\n\n if(btAdapter==null) {\n Toast.makeText(getBaseContext(), \"Device does not support bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n if (btAdapter.isEnabled()) {\n } else {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "private void checkBTState() {\n\n if (btAdapter == null) {\n Toast.makeText(getBaseContext(), \"Device does not support bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n if (btAdapter.isEnabled()) {\n } else {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "void activateBlue(BluetoothAdapter bluetoothAdapter){\r\n if (!bluetoothAdapter.isEnabled()) {\r\n Intent enableBlueTooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n startActivityForResult(enableBlueTooth, REQUEST_CODE_ENABLE_BLUETOOTH);\r\n }\r\n }", "private void getBluetoothState() {\r\n\r\n\t\t if (bluetoothAdapter == null) {\r\n\t\t\t bluetoothStatusSetup.setText(\"Bluetooth NOT supported\");\r\n\t\t } else if (!(bluetoothAdapter.isEnabled())) {\r\n\t\t\t bluetoothStatusSetup.setText(\"Bluetooth is NOT Enabled!\");\r\n\t\t\t Intent enableBtIntent = new Intent(\r\n\t\t\t\t\t BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n\t\t\t startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\r\n\t\t\t getBluetoothState();\r\n\t\t }\r\n\r\n\t\t if (bluetoothAdapter.isEnabled()) {\r\n\r\n\t\t\t if (bluetoothAdapter.isDiscovering()) {\r\n\t\t\t\t bluetoothStatusSetup.setText(\"Bluetooth is currently in device discovery process.\");\r\n\t\t\t } else {\r\n\t\t\t\t bluetoothStatusSetup.setText(\"Bluetooth is Enabled.\");\r\n\t\t\t }\r\n\t\t }\r\n\t }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkBluetooth() {\n\t\tboolean flag = oTest.checkBluetooth();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "public static boolean getBluetoothAdapterIsEnabled() {\n\t\treturn mBluetoothAdapterIsEnabled;\n\t}", "private void initBLESetup() {\n // Initializes Bluetooth adapter.\n final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = bluetoothManager.getAdapter();\n //Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app.\n //Obtaining dynamic permissions from the user\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { //23\n if (this.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"This app needs location access.\");\n builder.setMessage(\"Please grant location access to this app.\");\n builder.setPositiveButton(android.R.string.ok, null);\n builder.setOnDismissListener(new DialogInterface.OnDismissListener() {\n public void onDismiss(DialogInterface dialog) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, PERMISSION_REQUEST_COARSE_LOCATION);\n }\n\n });// See onRequestPermissionsResult callback method for negative behavior\n builder.show();\n }\n }\n // Create callback methods\n if (Build.VERSION.SDK_INT >= 21) //LOLLIPOP\n newerVersionScanCallback = new ScanCallback() {\n @Override\n public void onScanResult(int callbackType, ScanResult result) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n BluetoothDevice btDevice = result.getDevice();\n ScanRecord mScanRecord = result.getScanRecord();\n int rssi = result.getRssi();\n// Log.i(TAG, \"Address: \"+ btDevice.getAddress());\n// Log.i(TAG, \"TX Power Level: \" + result.getScanRecord().getTxPowerLevel());\n// Log.i(TAG, \"RSSI in DBm: \" + rssi);\n// Log.i(TAG, \"Manufacturer data: \"+ mScanRecord.getManufacturerSpecificData());\n// Log.i(TAG, \"device name: \"+ mScanRecord.getDeviceName());\n// Log.i(TAG, \"Advertise flag: \"+ mScanRecord.getAdvertiseFlags());\n// Log.i(TAG, \"service uuids: \"+ mScanRecord.getServiceUuids());\n// Log.i(TAG, \"Service data: \"+ mScanRecord.getServiceData());\n byte[] recordBytes = mScanRecord.getBytes();\n\n iBeacon ib = parseBLERecord(recordBytes);\n\n if (ib != null) {\n setLog(ib.getUuid(), ib.getMajor(), ib.getMinor(), rssi);\n\n }\n }\n }\n\n @Override\n public void onScanFailed(int errorCode) {\n Log.e(\"Scan Failed\", \"Error Code: \" + errorCode);\n }\n };\n else\n olderVersionScanCallback =\n new BluetoothAdapter.LeScanCallback() {\n @Override\n public void onLeScan(final BluetoothDevice device, final int rssi,\n final byte[] scanRecord) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Log.i(\"onLeScan\", device.toString());\n\n iBeacon ib = parseBLERecord(scanRecord);\n\n if (ib != null) {\n setLog(ib.getUuid(), ib.getMajor(), ib.getMinor(), rssi);\n\n }\n }\n });\n }\n };\n }", "private boolean BTEnabled() {\n if (!BT.isEnabled()) { // Ask user's permission to switch the Bluetooth adapter On.\n Intent enableIntent = new Intent(\n BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableIntent, REQUEST_ENABLE_BT);\n return false;\n } else {\n DisplayToast(\"Bluetooth is already on\");\n return true;\n }\n }", "public void findBluetooth() {\n BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (mBluetoothAdapter == null) {\n // Device does not support Bluetooth\n btStatusDisplay.setText(\"Device does not support Bluetooth\");\n }\n btStatusDisplay.setText(\"Trying to connect...\");\n\n /** Pops up request to enable if found not enabled */\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n /** Get reference to scale as Bluetooth device \"mmDevice\" */\n Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();\n if (pairedDevices.size() > 0) {\n for (BluetoothDevice device : pairedDevices) {\n if (device.getName().equals(\"BLUE\")) {\n mmDevice = device;\n btStatusDisplay.setText(\"Bluetooth device found\");\n break;\n }\n }\n }\n }", "private void addBluetoothUsage() {\n BatterySipper bs = new BatterySipper(BatterySipper.DrainType.BLUETOOTH, null, 0);\n mBluetoothPowerCalculator.calculateRemaining(bs, mStats, mRawRealtimeUs, mRawUptimeUs,\n mStatsType);\n aggregateSippers(bs, mBluetoothSippers, \"Bluetooth\");\n if (bs.totalPowerMah > 0) {\n mUsageList.add(bs);\n }\n }", "@Override\n public void onClick(View v) {\n if (mBluetoothAdapter.isEnabled()) {\n\n }\n }", "private void validateBleSupport() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Snackbar.make(txtStatus, \"No LE Support.\", Snackbar.LENGTH_LONG).show();\n } else {\n\n /*\n * We need to enforce that Bluetooth is first enabled, and take the\n * user to settings to enable it if they have not done so.\n */\n BluetoothAdapter mBluetoothAdapter = BluetoothAdapter\n .getDefaultAdapter();\n\n if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {\n Log.d(TAG, \"onResume: Bluetooth is disabled\");\n //Bluetooth is disabled, request enabling it\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivity(enableBtIntent);\n }\n }\n\n }", "private void checkBTState() {\n\n if(btAdapter==null) {\n Toast.makeText(getContext(), \"El dispositivo no soporta bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n if (btAdapter.isEnabled()) {\n } else {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "private void checkBTState() {\n if(bluetoothAdapter==null) {\n errorExit(\"Fatal Error\", \"Bluetooth not supported\");\n } else {\n if (!bluetoothAdapter.isEnabled()) {\n //Prompt user to turn on Bluetooth\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (bluetoothAdapter == null) {\n //Display a toast notifying the user that their device doesn’t support Bluetooth//\n Toast.makeText(getApplicationContext(), \"This device doesn’t support Bluetooth\", Toast.LENGTH_LONG).show();\n } else {\n //If BluetoothAdapter doesn’t return null, then the device does support Bluetooth//\n Toast.makeText(getApplicationContext(), \"This device does support Bluetooth\", Toast.LENGTH_LONG).show();\n }\n }", "public void checkBTState() {\n if(mAdapter==null) {\n errorExit(\"Fatal Error\", \"Bluetooth not support\");\n } else {\n if (mAdapter.isEnabled()) {\n Log.d(TAG, \"...Bluetooth ON...\");\n } else {\n //Prompt user to turn on Bluetooth\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n ((Activity) mContext).startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "@Override\r\n\tprotected void onHandleIntent(Intent intent) {\n\t\tfinal BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\r\n\t\tmBluetoothAdapter = bluetoothManager.getAdapter();\r\n\r\n\t\t// Checks if Bluetooth is supported on the device.\r\n\t\tif (mBluetoothAdapter == null) {\r\n\t\t\tLog.i(TAG, \"Bluetooth is not supported\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tLog.i(TAG, \"mBluetoothAdapter = \" + mBluetoothAdapter);\r\n\t\t}\r\n\r\n\t\t//启用蓝牙\r\n\t\t//mBluetoothAdapter.enable();\r\n\t\t//Log.i(TAG, \"mBluetoothAdapter.enable\");\r\n\t\t\r\n\t\tmBLE = new BluetoothLeClass(this);\r\n\t\t\r\n\t\tif (!mBLE.initialize()) {\r\n\t\t\tLog.e(TAG, \"Unable to initialize Bluetooth\");\r\n\t\t}\r\n\t\tLog.i(TAG, \"mBLE = e\" + mBLE);\r\n\r\n\t\t// 发现BLE终端的Service时回调\r\n\t\tmBLE.setOnServiceDiscoverListener(mOnServiceDiscover);\r\n\r\n\t\t// 收到BLE终端数据交互的事件\r\n\t\tmBLE.setOnDataAvailableListener(mOnDataAvailable);\r\n\t\t\r\n\t\t//开始扫描\r\n\t\tmBLE.scanLeDevice(true);\r\n\t\t\r\n\t\t/*\r\n\t\tMRBluetoothManage.Init(this, new MRBluetoothEvent() {\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultStatus(int result) {\r\n\t\t\t\tswitch (result) {\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_NOT_OPEN:\r\n\t\t\t\t\t//Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\r\n\t\t\t\t\t//startActivityForResult(enableBtIntent, 100);\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_NOT_OPEN\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_INIT_OK:\r\n\t\t\t\t\tMRBluetoothManage.scanAndConnect();\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_INIT_OK\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_SCAN_START:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_SCAN_START\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_SCAN_END:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_SCAN_END\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_START:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_START\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_OK:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_OK\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase MRBluetoothManage.MRBLUETOOTHSTATUS_CONNECT_CLOSE:\r\n\t\t\t\t\tLog.d(TAG, \"MRBLUETOOTHSTATUS_CONNECT_CLOSE\");\r\n\t\t\t\t\tMRBluetoothManage.stop();\r\n\t\t\t\t\tMRBluetoothManage.scanAndConnect();\r\n\t\t\t\t\t//MRBluetoothManage.Init(BluetoothService.this, this);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultDevice(ArrayList<BluetoothDevice> deviceList) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void ResultData(byte[] data) {\r\n\t\t\t\tLog.i(TAG, data.toString());\r\n\t\t\t\tbyte[] wenDuByte = new byte[2];\r\n\t\t\t\tbyte[] shiDuByte = new byte[2];\r\n\t\t\t\tbyte[] shuiFenByte = new byte[2];\r\n\t\t\t\tbyte[] ziWaiXianByte = new byte[2];\r\n\t\t\t\tSystem.arraycopy(data, 4, wenDuByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 6, shiDuByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 8, shuiFenByte, 0, 2);\r\n\t\t\t\tSystem.arraycopy(data, 10, ziWaiXianByte, 0, 2);\r\n\t\t\t\tTestModel model = new TestModel();\r\n\t\t\t\tmodel.wenDu = BitConverter.toShort(wenDuByte);\r\n\t\t\t\tmodel.shiDu = BitConverter.toShort(shiDuByte);\r\n\t\t\t\tmodel.shuiFen = BitConverter.toShort(shuiFenByte);\r\n\t\t\t\tmodel.ziWaiXian = BitConverter.toShort(ziWaiXianByte);\r\n\t\t\t\t//Log.d(TAG, model.toString());\r\n\t\t\t\tsendData(model);\r\n\t\t\t}\r\n\t\t});\r\n\t\t*/\r\n\t}", "private void checkBTState() {\n if(btAdapter==null) {\n errorExit(\"Fatal Error\", \"Bluetooth not support\");\n } else {\n if (btAdapter.isEnabled()) {\n Log.d(TAG, \"...Bluetooth ON...\");\n } else {\n //Prompt user to turn on Bluetooth\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 1);\n }\n }\n }", "private void updateBluetoothList(){\n\t\tif(bluetoothAdapter == null){\n\t\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\t\tbuilder.setTitle(R.string.no_bt_error_dialog_title);\n\t\t\tbuilder.setMessage(R.string.no_bt_error_dialog_message);\n\t\t\tbuilder.setNeutralButton(R.string.no_bt_error_dialog_btn, new OnClickListener() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\tfinish();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\t//check if it is enabled\n//\t\tif (!bluetoothAdapter.isEnabled()) {\n//\t\t Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n//\t\t startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n//\t\t}\n\t\t\n\t\tSet<BluetoothDevice> pairedDevices = bluetoothAdapter\n\t\t\t\t.getBondedDevices();\n\t\t\n\t\tpairedlist = new ArrayList<BluetoothDevice>();\n\t\t\n\t\tif (pairedDevices.size() > 0) {\n\t\t\tfor (BluetoothDevice device : pairedDevices) {\n\t\t\t\tif (isDeviceUsefulForSMS(device.getBluetoothClass()\n\t\t\t\t\t\t.getMajorDeviceClass())) {\n\t\t\t\t\tpairedlist.add(device);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(pairedlist.size() <= 0){\n\t\t\tshowBTPairedDialog();\n\t\t}\n\t\t\n\t\tupdateBTListView();\n\t}", "@Override\n public void askPermission() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Uff\");\n builder.setMessage(\"This device does not support Bluetooth LE. Buy another phone.\");\n builder.setPositiveButton(android.R.string.ok, null);\n finish();\n }\n\n //Checking if the Bluetooth is on/off\n BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (mBluetoothAdapter == null) {\n // Device does not support Bluetooth\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Uff\");\n builder.setMessage(\"This device does not support Bluetooth.\");\n builder.setPositiveButton(android.R.string.ok, null);\n } else {\n if (!mBluetoothAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, 2);\n }\n }\n\n }", "public boolean initialize() {\n // For API level 18 and above, get a reference to BluetoothAdapter through\n // BluetoothManager.\n if (mBluetoothManager == null) {\n mBluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n if (mBluetoothManager == null) {\n Log.e(TAG, \"Unable to initialize BluetoothManager.\");\n return false;\n }\n }\n\n mBluetoothAdapter = mBluetoothManager.getAdapter();\n if (mBluetoothAdapter == null) {\n Log.e(TAG, \"Unable to obtain a BluetoothAdapter.\");\n return false;\n }\n\n return true;\n }", "public void bluetooth_enable_discoverability()\r\n {\n\t\t\r\n Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\r\n\t\tdiscoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\r\n\t\tLoaderActivity.m_Activity.startActivity(discoverableIntent);\r\n\t\tserver_connect_thread = new Server_Connect_Thread();\r\n\t\tserver_connect_thread.start();\r\n\t\tmessages.clear();\r\n }", "private void initPlugin() {\n if (bluetoothAdapter == null) {\n Log.e(LOG_TAG, \"Bluetooth is not supported\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is supported\");\n\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.hasBT = true;\");\n\n //test if BLE supported\n if (!mcordova.getActivity().getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Log.e(LOG_TAG, \"BluetoothLE is not supported\");\n } else {\n Log.e(LOG_TAG, \"BluetoothLE is supported\");\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.hasBTLE = true;\");\n }\n \n // test if BT is connected to a headset\n \n if (bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET) == BluetoothProfile.STATE_CONNECTED ) {\n Log.e(LOG_TAG, \" Bluetooth connected to headset\");\n sendJS(\"javascript:cordova.fireWindowEvent('BluetoothStatus.connected');\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is not connected to a headset \" + bluetoothAdapter.getProfileConnectionState(BluetoothProfile.HEADSET));\n }\n\n //test if BT enabled\n if (bluetoothAdapter.isEnabled()) {\n Log.e(LOG_TAG, \"Bluetooth is enabled\");\n\n sendJS(\"javascript:cordova.plugins.BluetoothStatus.BTenabled = true;\");\n sendJS(\"javascript:cordova.fireWindowEvent('BluetoothStatus.enabled');\");\n } else {\n Log.e(LOG_TAG, \"Bluetooth is not enabled\");\n }\n }\n }", "@Override\n public void onBluetoothDeviceFound(BluetoothDevice btDevice) {\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n Log.d(TAG, \"onActivityResult called\");\n\n if (requestCode == REQUEST_ENABLE_BT && resultCode == Activity.RESULT_CANCELED) {\n\n // User choose NOT to enable Bluetooth.\n mAlertBlue = null;\n showNegativeDialog(getResources().getString(R.string.blue_error_title),\n getResources().getString(R.string.blue_error_msg)\n );\n\n } else {\n\n // User choose to enable Bluetooth.\n mAlertBlue = null;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)\n verifyPermissions(mActivity);\n else {\n mBluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);\n mBluetoothAdapter = mBluetoothManager.getAdapter();\n scanLeDevice(true);\n }\n }\n }", "public void checkPermission(){\n Log.d(\"BluetoothLeService\", \"initialize is \" + mBluetoothManager);\n if (mBluetoothManager == null) {\n mBluetoothManager = (BluetoothManager) this.getSystemService(Context.BLUETOOTH_SERVICE);\n if (mBluetoothManager == null) {\n Log.e(TAG, \"Unable to initialize BluetoothManager.\");\n return;\n }\n }\n\n mBluetoothAdapter = mBluetoothManager.getAdapter();\n if (mBluetoothAdapter == null) {\n Log.e(TAG, \"Unable to obtain a BluetoothAdapter.\");\n return;\n }\n\n if (!mBluetoothAdapter.isEnabled()) mBluetoothAdapter.enable();\n\n int PERMISSION_ALL = 1;\n /*\n String[] PERMISSIONS = {\n Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.WRITE_EXTERNAL_STORAGE,\n Manifest.permission.READ_EXTERNAL_STORAGE,\n Manifest.permission.GET_ACCOUNTS};\n */\n String[] PERMISSIONS = {\n Manifest.permission.ACCESS_COARSE_LOCATION\n };\n\n if (!hasPermissions(this, PERMISSIONS)) {\n ActivityCompat.requestPermissions( this, PERMISSIONS, PERMISSION_ALL);\n }\n }", "private void checkEnableBt() {\n if (mBtAdapter == null || !mBtAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }", "public void connect_bt(String deviceAddress) {\n Intent intent = new Intent(\"OBDStatus\");\n intent.putExtra(\"message\", \"Trying to connect with device\");\n context.sendBroadcast(intent);\n disconnect();\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n btAdapter.cancelDiscovery();\n if (deviceAddress == null || deviceAddress.isEmpty()) {\n intent.putExtra(\"message\", \"Device not found\");\n context.sendBroadcast(intent);\n return;\n }\n\n if (!btAdapter.isEnabled()) {\n intent.putExtra(\"message\", \"Bluetooth is disabled\");\n context.sendBroadcast(intent);\n return;\n }\n\n BluetoothDevice device = btAdapter.getRemoteDevice(deviceAddress);\n\n UUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805F9B34FB\");\n\n try {\n socket = device.createInsecureRfcommSocketToServiceRecord(uuid);\n socket.connect();\n isConnected = true;\n intent.putExtra(\"message\", \"OBD connected\");\n context.sendBroadcast(intent);\n } catch (IOException e) {\n Log.e(\"gping2\", \"There was an error while establishing Bluetooth connection. Falling back..\", e);\n Class<?> clazz = socket.getRemoteDevice().getClass();\n Class<?>[] paramTypes = new Class<?>[]{Integer.TYPE};\n BluetoothSocket sockFallback = null;\n try {\n Method m = clazz.getMethod(\"createInsecureRfcommSocket\", paramTypes);\n Object[] params = new Object[]{Integer.valueOf(1)};\n sockFallback = (BluetoothSocket) m.invoke(socket.getRemoteDevice(), params);\n sockFallback.connect();\n isConnected = true;\n socket = sockFallback;\n intent.putExtra(\"message\", \"OBD connected\");\n context.sendBroadcast(intent);\n } catch (Exception e2) {\n intent.putExtra(\"message\", \"OBD Connection error\");\n context.sendBroadcast(intent);\n Log.e(\"gping2\", \"BT connect error\");\n }\n }\n this.deviceAddress = deviceAddress;\n saveNewAddress();\n }", "private void checkBTState() {\n\t\tif (btAdapter == null) {\n\t\t\terrorExit(\"Fatal Error\", \"Bluetooth not support\");\n\t\t} else {\n\t\t\tif (btAdapter.isEnabled()) {\n\t\t\t\tLog.d(TAG, \"...Bluetooth ON...\");\n\t\t\t} else {\n\t\t\t\t// Prompt user to turn on Bluetooth\n\t\t\t\tIntent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\t\t\tstartActivityForResult(enableBtIntent, 1);\n\t\t\t}\n\t\t}\n\t}", "private void bluetooth_connect_device() throws IOException\n {\n try\n {\n myBluetooth = BluetoothAdapter.getDefaultAdapter();\n address = myBluetooth.getAddress();\n pairedDevices = myBluetooth.getBondedDevices();\n if (pairedDevices.size()>0)\n {\n for(BluetoothDevice bt : pairedDevices)\n {\n address=bt.getAddress().toString();name = bt.getName().toString();\n Toast.makeText(getApplicationContext(),\"Connected\", Toast.LENGTH_SHORT).show();\n\n }\n }\n\n }\n catch(Exception we){}\n myBluetooth = BluetoothAdapter.getDefaultAdapter();//get the mobile bluetooth device\n BluetoothDevice dispositivo = myBluetooth.getRemoteDevice(address);//connects to the device's address and checks if it's available\n btSocket = dispositivo.createInsecureRfcommSocketToServiceRecord(myUUID);//create a RFCOMM (SPP) connection\n btSocket.connect();\n try { t1.setText(\"BT Name: \"+name+\"\\nBT Address: \"+address); }\n catch(Exception e){}\n }", "private void connectBluetooth() {\n try {\n if (blueTooth == null && macSet) {\n Log.d(\"lol\", \"macSet connect bluetooootooththoth\");\n blueTooth = new BluetoothConnection(macAddress, this, listener);\n blueTooth.connect();\n }\n } catch (Exception e) {\n Log.d(\"lol\", \"Failed connection: \" + e.getMessage() + \" \" + e.getClass());\n }\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n // if user chooses not to enable Bluetooth.\n if (requestCode == REQUEST_ENABLE_BT && resultCode == Activity.RESULT_CANCELED) {\n showToast(\"Bluetooth is required for this application to work\");\n return;\n }\n super.onActivityResult(requestCode, resultCode, data);\n }", "private void checkLocationAndBluetoothPermissions() {\n if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Toast.makeText(this, \"This phone does not support Bluetooth 4.0. Bubble Hub Application requires Bluetooth 4.0 in order to operate.\", Toast.LENGTH_SHORT).show();\n finish();\n }\n\n if(!BluetoothAdapter.getDefaultAdapter().isEnabled()) { //if BT is present but is turned off\n CustomLogger.log(\"MainActivity: onCreate: Ask user to turn on BT.\");\n\n //Ask to the user turn the bluetooth on\n Intent turnBTon = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(turnBTon, 1);\n }\n\n if (Build.VERSION.SDK_INT >= 23) {\n if (!haveLocationPermissions()) {\n mDeviceList.setVisibility(View.GONE);\n mTopTextLinearLayout.setVisibility(View.GONE);\n mLocationPermissionWarningLinearLayout.setVisibility(View.VISIBLE);\n CustomLogger.log(\"MainActivity: onCreate: missing location permissions\");\n requestLocationPermission(this, LOCATION_PERMISSION_REQUEST_CODE);\n } else {\n CustomLogger.log(\"MainActivity: onCreate: got location permissions\");\n mLocationPermissionWarningLinearLayout.setVisibility(View.GONE);\n mDeviceList.setVisibility(View.VISIBLE);\n mTopTextLinearLayout.setVisibility(View.VISIBLE);\n }\n }\n }", "void setBluetoothService(BluetoothService bluetoothService);", "protected boolean isAdvertisementDisabled(LocalDevice device) {\n/* 353 */ DiscoveryOptions options = getUpnpService().getRegistry().getDiscoveryOptions(device.getIdentity().getUdn());\n/* 354 */ return (options != null && !options.isAdvertised());\n/* */ }", "public boolean mBTInit1(){\n //Initialize the bluetooth adapter\n if (oBTadapter !=null) return true ;\n oBTadapter = BluetoothAdapter.getDefaultAdapter();\n return (oBTadapter != null);\n }", "public S<T> bluetooth(Boolean enable){\n\t\t \t \n\t\t\t BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\t\t\t boolean isEnabled = bluetoothAdapter.isEnabled();\n\t\t\t if (enable && !isEnabled) {\n\t\t\t bluetoothAdapter.enable(); \n\t\t\t }\n\t\t\t else if(!enable && isEnabled) {\n\t\t\t bluetoothAdapter.disable();\n\t\t\t }\n\n\t\t return this;\n\t }", "@Override\r\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n super.onActivityResult(requestCode, resultCode, data);\r\n Log.v(TAG, \"** onActivityResult **\");\r\n // determine from which activity\r\n switch (requestCode) {\r\n // if it was the request to enable Bluetooth:\r\n case REQUEST_ENABLE_BT:\r\n if (resultCode == Activity.RESULT_OK) {\r\n // Bluetooth is enabled now\r\n Log.v(TAG, \"** Bluetooth is now enabled**\");\r\n } else {\r\n // user decided not to enable Bluetooth so exit application\r\n Log.v(TAG, \"** Bluetooth is NOT enabled**\");\r\n Toast.makeText(this, \"Bluetooth not enabled\",\r\n Toast.LENGTH_LONG).show();\r\n finish();\r\n }\r\n }\r\n }", "void bluetoothDeactivated();", "private void turnOnBT() {\n\t\tIntent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\tstartActivityForResult(intent, 1);\n\t}", "public BlueMeshServiceBuilder bluetooth( boolean enabled ){\n bluetoothEnabled = enabled;\n return this;\n }", "private void setupBluetooth() throws NullPointerException{\n if( Utils.isOS( Utils.OS.ANDROID ) ){\n \t\n // Gets bluetooth hardware from phone and makes sure that it is\n // non-null;\n BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n \n // If bluetooth hardware does not exist...\n if (adapter == null) {\n Log.d(TAG, \"BluetoothAdapter is is null\");\n throw new NullPointerException(\"BluetoothAdapter is null\");\n } else {\n Log.d(TAG, \"BluetoothAdapter is is non-null\");\n }\n \n bluetoothName = adapter.getName();\n \n //TODO: restart bluetooth?\n \t\n try {\n bluetoothConnectionThreads.add( new ServerThread(adapter, router, uuid) );\n } catch (NullPointerException e) {\n throw e;\n }\n if (Constants.DEBUG)\n Log.d(TAG, \"Sever Thread Created\");\n // Create a new clientThread\n bluetoothConnectionThreads.add( new ClientThread(adapter, router, uuid) );\n if (Constants.DEBUG)\n Log.d(TAG, \"Client Thread Created\");\n }\n else if( Utils.isOS( Utils.OS.WINDOWS ) ){\n //TODO: implement this\n }\n else if( Utils.isOS( Utils.OS.LINUX ) ){\n //TODO: implement this\n }\n else if( Utils.isOS( Utils.OS.OSX ) ){\n //TODO: implement this\n }\n else{\n //TODO: throw exception?\n }\n \n }", "public void startBluetooth(){\n mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n if (!mBluetoothAdapter.isEnabled()) {\n Intent btIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n //btIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(btIntent);\n }\n mBluetoothAdapter.startDiscovery();\n System.out.println(\"@ start\");\n IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);\n getActivity().registerReceiver(mReceiver, filter);\n }", "public void connect(View v) {\n turnOn(v);\n startActivity(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS));\n Toast.makeText(getApplicationContext(), \"Select device\", Toast.LENGTH_LONG).show();\n System.err.println(bluetoothAdapter.getBondedDevices());\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n mCheckBt = false;\n if (requestCode == REQUEST_ENABLE_BT && resultCode != RESULT_OK) {\n// mScanButton.setEnabled(false);\n Toast.makeText(this, getString(R.string.bluetooth_not_enabled), Toast.LENGTH_LONG).show();\n }\n }", "public void discoverDevices(){\r\n \t// If we're already discovering, stop it\r\n if (mBtAdapter.isDiscovering()) {\r\n mBtAdapter.cancelDiscovery();\r\n }\r\n \r\n Toast.makeText(this, \"Listining for paired devices.\", Toast.LENGTH_LONG).show();\r\n \tmBtAdapter.startDiscovery(); \r\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n \n Log.d(TAG, \"onActivityResult \" + resultCode);\n switch (requestCode) {\n //for now, only dealiing with insecure connection\n //i don't think its possible to have secure connections with a serial profile\n case REQUEST_CONNECT_DEVICE_INSECURE:\n if(resultCode == Activity.RESULT_OK){\n setupBluetooth();//since BT is enabled, setup client service\n connectToDevice(data, false);\n }\n else\n setStatus(BluetoothClientService.STATE_NONE);\n break;\n case REQUEST_ENABLE_BT:\n // When the request to enable Bluetooth returns\n if (resultCode == Activity.RESULT_OK) {\n Toast.makeText(this, \"Bluetooth is now enabled\", Toast.LENGTH_SHORT).show();\n }\n else {\n // User did not enable Bluetooth or an error occurred\n Log.d(TAG, \"BT not enabled\");\n Toast.makeText(this, R.string.bt_not_enabled_leaving, Toast.LENGTH_SHORT).show();\n finish();\n }\n }\n }", "public void onCreate() {\n\t\tSystem.out.println(\"This service is called!\");\n\t\tmyBluetoothAdapter= BluetoothAdapter.getDefaultAdapter();\n\t\tmyBluetoothAdapter.enable();\n\t\tSystemClock.sleep(5000);\n\t\tif (myBluetoothAdapter.isEnabled()){\n\t\t\tSystem.out.println(\"BT is enabled...\");\n\t\t\tdiscover = myBluetoothAdapter.startDiscovery();\n\t\t}\n\t\tSystem.out.println(myBluetoothAdapter.getScanMode());\n\t\t\n\t\tSystem.out.println(\"Discovering: \"+myBluetoothAdapter.isDiscovering());\n\t\t//registerReceiver(bReceiver, new IntentFilter(BluetoothDevice.ACTION_FOUND));\n\t\tIntentFilter filter1 = new IntentFilter(BluetoothDevice.ACTION_FOUND);\n\t\tIntentFilter filter2 = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);\n\t\tthis.registerReceiver(bReceiver, filter1);\n\t\tthis.registerReceiver(bReceiver, filter2);\n\t\t//registerReceiver(bReceiver, new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED));\n\t}", "private void bluetoothConnect() {\n\n btDevice = btAdapter.getRemoteDevice(EDISON_ADDRESS);\n if (btDevice == null) {\n Log.d(TAG,\"get remote device fail!\");\n finish();\n }\n\n try {\n btSocket = btDevice.createRfcommSocketToServiceRecord(SSP_UUID);\n } catch (IOException e) {\n Log.d(TAG,\"bluetooth socket create fail.\");\n }\n //save resource by cancel discovery\n btAdapter.cancelDiscovery();\n\n //connect\n try {\n btSocket.connect();\n Log.d(TAG,\"Connection established.\");\n } catch ( IOException e) {\n try {\n btSocket.close();\n }catch (IOException e2) {\n Log.d(TAG,\"unable to close socket after connect fail.\");\n }\n }\n\n //prepare outStream to send message\n try {\n outStream = btSocket.getOutputStream();\n } catch (IOException e) {\n Log.d(TAG,\"output stream init fail!\");\n }\n\n }", "public boolean isCanBleed() {\n\t\treturn canBleed;\n\t}", "public synchronized BluetoothService getBluetoothService(){\n\t\treturn bluetoothService;\n\t}", "public void listDevices(final BluetoothAdapter bluetoothAdapter){\n Set<BluetoothDevice> pairedDevices = bluetoothAdapter.getBondedDevices();\n ArrayList pairedDeviceList = new ArrayList();\n String address = null;\n\n if (pairedDevices.size() > 0) {\n int i = 0;\n // There are paired devices. Get the name and address of each paired device.\n for (BluetoothDevice device : pairedDevices) {\n String deviceName = device.getName().trim();\n String deviceHardwareAddress = device.getAddress(); // MAC address\n if (deviceName.equals(DEVICE_NAME)){\n address = device.getAddress().trim();\n System.out.println(address +\"\\n\");\n }\n pairedDeviceList.add(\"Device Name: \" + deviceName + \" Device MAC Address: \" + deviceHardwareAddress);\n }\n\n System.out.println(pairedDeviceList.get(0) + \"\\n\");\n\n final String finalAddress = address;\n AsyncTask.execute(new Runnable(){\n @Override\n public void run(){\n bluetoothDevice = bluetoothAdapter.getRemoteDevice(finalAddress);\n BLEDevice = new BluetoothLeService(bluetoothDevice, quantifenUUID);\n BLEDevice.connect(BluetoothActivity.this, testUUID);\n }\n });\n\n\n }\n }", "public static void checkPhoneSettings(Activity activity){\n\t\tif (mBluetoothAdapter == null) {\n\t\t //!TODO\n\t\t} else {\n\t\t\tLog.v(\"\", \"Bluetooth is supported\");\n\t\t\t//Check if bluetooth is enabled. If not, request the user to enable it.\n\t\t\tif (!mBluetoothAdapter.isEnabled()) {\n\t\t\t\tLog.v(\"\", \"Bluetooth is not turned on\");\n\t\t\t Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n\t\t\t activity.startActivityForResult(enableBtIntent,REQUEST_ENABLE_BT);\n\t\t\t}\n\t\t}\n\t}", "public void discoverable()\n {\n if(mEnable) {\n Log.d(LOGTAG, \"Make discoverable\");\n if(mBluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {\n listen(false); // Stop listening if were listening\n Intent i = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n i.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\n mContext.startActivity(i);\n listen(true); // Start again\n }\n }\n }", "private void checkBluetoothPermissions() {\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {\n int permissionCheck = activity.checkSelfPermission(\"Manifest.permission.ACCESS_FINE_LOCATION\");\n permissionCheck += activity.checkSelfPermission(\"Manifest.permission.ACCESS_COARSE_LOCATION\");\n if (permissionCheck != 0) {\n\n ((Activity) activity).requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.ACCESS_COARSE_LOCATION},\n 1001); //Any number\n }\n } else {\n Log.d(TAG, \"checkBluetoothPermissions: No need to check permissions. SDK version < LOLLIPOP.\");\n }\n }", "public void onActivityResult(int requestCode, int resultCode, Intent data){\r\n \tif(!mBtAdapter.isEnabled()){\r\n\t\t\tToast.makeText(this, \"Please ensure bluetooth is enabled!\", Toast.LENGTH_LONG).show();\r\n\r\n\t\t\tIntent finishIntent = new Intent();\r\n finishIntent.putExtra(EXTRA_DEVICE_ADDRESS, \"finish\");\r\n setResult(RESULT_BT_NOT_ENABLED, finishIntent);\r\n\t\t\tBluetoothActivity.this.finish();\r\n\t\t}\r\n }", "private boolean verifyBTConnected() {\n if (btSocket != null && btSocket.isConnected()) {\n return true;\n }\n\n sendConnectionMessage(EventMessage.EventType.HW_CONNECTING);\n try {\n if (btDevice == null) {\n btDevice = btAdapter.getRemoteDevice(btAddress);\n }\n\n btSocket = btDevice.createInsecureRfcommSocketToServiceRecord(uuid);\n btSocket.connect();\n\n mmInStream = btSocket.getInputStream();\n mmOutStream = btSocket.getOutputStream();\n sendConnectionMessage(EventMessage.EventType.HW_CONNECTED);\n return true;\n } catch (IOException e) {\n Log.d(TAG, \"Exception creating BT socket in BT thread: \" + e.toString());\n btDevice = null;\n return false;\n }\n }", "private void connectToAdapter() {\n if (chosen) {\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n BluetoothDevice device = btAdapter.getRemoteDevice(deviceAddress);\n UUID uuid = UUID.fromString(\"00001101-0000-1000-8000-00805F9B34FB\");\n // creation and connection of a bluetooth socket\n try {\n BluetoothSocket socket = device.createInsecureRfcommSocketToServiceRecord(uuid);\n socket.connect();\n setBluetoothSocket(socket);\n connected = true;\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n connect.setText(\"Disconnect\");\n connect.setTextColor(Color.RED);\n }\n });\n } catch (IOException e) {\n Log.d(\"Exception\", \"Bluetooth IO Exception c\");\n connected = false;\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(currContext, R.string.cannotConnect, Toast.LENGTH_SHORT).show();\n connect.setText(\"Connect\");\n connect.setTextColor(Color.BLACK);\n mode.setEnabled(true);\n }\n });\n }\n }\n if (bluetoothSocket.getRemoteDevice().getAddress() != null)\n Log.d(TAG, \"Bluetooth connected\");\n Log.d(TAG, \"Device address: \" + bluetoothSocket.getRemoteDevice().getAddress());\n initializeCom();\n }", "public boolean setBluetoothEnabled(boolean enabled) {\n return isBluetoothAvailable() && (enabled ? mBluetoothAdapter.enable()\n : mBluetoothAdapter.disable());\n }", "@Override\n public boolean isAudioConnected(BluetoothDevice bluetoothDevice) throws RemoteException {\n Parcel parcel = Parcel.obtain();\n Parcel parcel2 = Parcel.obtain();\n try {\n parcel.writeInterfaceToken(Stub.DESCRIPTOR);\n boolean bl = true;\n if (bluetoothDevice != null) {\n parcel.writeInt(1);\n bluetoothDevice.writeToParcel(parcel, 0);\n } else {\n parcel.writeInt(0);\n }\n if (!this.mRemote.transact(6, parcel, parcel2, 0) && Stub.getDefaultImpl() != null) {\n bl = Stub.getDefaultImpl().isAudioConnected(bluetoothDevice);\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n parcel2.readException();\n int n = parcel2.readInt();\n if (n == 0) {\n bl = false;\n }\n parcel2.recycle();\n parcel.recycle();\n return bl;\n }\n catch (Throwable throwable) {\n parcel2.recycle();\n parcel.recycle();\n throw throwable;\n }\n }", "private void setDiscoverableBt() {\n\t\tIntent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n\t\tdiscoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, MADN3SCamera.DISCOVERABLE_TIME);\n\t\tstartActivity(discoverableIntent);\n\t}", "public String getBluetoothAddress() {\n return addressStr;\n }", "private void initBluetooth() {\n IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);\n this.registerReceiver(mReceiver, filter);\n\n // Register for broadcasts when discovery has finished\n filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);\n this.registerReceiver(mReceiver, filter);\n\n // Get the local Bluetooth adapter\n mBtAdapter = BluetoothAdapter.getDefaultAdapter();\n\n // Get a set of currently paired devices\n Set<BluetoothDevice> pairedDevices = mBtAdapter.getBondedDevices();\n\n // Initialize the BluetoothChatService to perform bluetooth connections\n mChatService = new BluetoothChatService(this, mHandler);\n }", "private void btnFindDevicesClicked(Intent intent, int findDeviceRequest)\n {\n if (btAdapter.isEnabled()) startActivityForResult(intent, findDeviceRequest);\n // Else display error until bluetooth is enabled\n else\n {\n Toast.makeText(getApplicationContext(), \"Enable Bluetooth to continue\", Toast.LENGTH_SHORT).show();\n setUpBluetooth();\n }\n }", "public void onStart(){ \r\n\t\t//ensure bluetooth is enabled \r\n\t\tensureBluetoothIsEnabled();\r\n\t\tsuper.onStart(); \t\r\n\t}", "boolean isPeripheralAccess();", "public static boolean isBleEnabled() {\n\t\tfinal BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();\n\t\treturn adapter != null && adapter.isEnabled();\n\t}", "private void selectAvailableDevices() {\n\n ArrayList deviceStrs = new ArrayList();\n final ArrayList<String> devices = new ArrayList();\n\n BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();\n // checking and enabling bluetooth\n if (!btAdapter.isEnabled()) {\n Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n } else {\n btAdapter = BluetoothAdapter.getDefaultAdapter();\n Set<BluetoothDevice> pairedDevices = btAdapter.getBondedDevices();\n if (pairedDevices.size() > 0) {\n for (BluetoothDevice device : pairedDevices) {\n deviceStrs.add(device.getName() + \"\\n\" + device.getAddress());\n devices.add(device.getAddress());\n }\n }\n\n // show a list of paired devices to connect with\n final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);\n ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.select_dialog_singlechoice,\n deviceStrs.toArray(new String[deviceStrs.size()]));\n alertDialog.setSingleChoiceItems(adapter, -1, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n int position = ((AlertDialog) dialog).getListView().getCheckedItemPosition();\n String deviceAddress = devices.get(position);\n setDeviceAddress(deviceAddress);\n chosen = true;\n //notify user for ongoing connection\n launchRingDialog();\n\n }\n });\n\n alertDialog.setTitle(R.string.blueChose);\n alertDialog.show();\n }\n }", "@Override\n public void onClick(View v) {\n BluetoothAdapter myBleAdapter = BluetoothAdapter.getDefaultAdapter();\n myBleAdapter.enable();\n\n if (myBleWrapper.isBtEnabled() == true) {\n tV1.setTextColor(Color.parseColor(\"#000000\"));\n tV1.setText(\"Yo ble is on\");\n }\n// else\n// {\n// tV1.setText(\"ble is off\");\n// }\n }", "@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)\n private void beaconManagerSetup(){\n\n Log.i(\"beaconManager\",\"beaconManagerSetup\");\n\n //Beacon manager setup\n beaconManager = BeaconManager.getInstanceForApplication(this);\n beaconManager.bind(this);\n beaconManager.getBeaconParsers().add(new BeaconParser().\n setBeaconLayout(\"m:2-3=0215,i:4-15,i:16-19,i:20-23,p:24-24\"));\n\n //setBeaconLayout(\"m:2-3=0215,i:4-19,i:20-23,i:24-27,p:28-28\"));\n // Detect the Eddystone main identifier (UID) frame:\n beaconManager.getBeaconParsers().add(new BeaconParser().\n setBeaconLayout(\"s:0-1=feaa,m:2-2=00,p:3-3:-41,i:4-13,i:14-19\"));\n\n // Detect the Eddystone telemetry (TLM) frame:\n beaconManager.getBeaconParsers().add(new BeaconParser().\n setBeaconLayout(\"x,s:0-1=feaa,m:2-2=20,d:3-3,d:4-5,d:6-7,d:8-11,d:12-15\"));\n\n // Detect the Eddystone URL frame:\n beaconManager.getBeaconParsers().add(new BeaconParser().\n setBeaconLayout(\"s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-20\"));\n\n //beaconManager.setForegroundScanPeriod(ONE_SECOND);\n //beaconManager.setForegroundBetweenScanPeriod(2*ONE_SECOND);\n\n\n beaconManager.setForegroundScanPeriod(50);\n beaconManager.setForegroundBetweenScanPeriod(0);\n beaconManager.removeAllMonitorNotifiers();\n //beaconManager.removeAllRangeNotifiers();\n\n // Get the details for all the beacons we encounter.\n region = new Region(\"justGiveMeEverything\", null, null, null);\n bluetoothManager = (BluetoothManager)\n getSystemService(Context.BLUETOOTH_SERVICE);\n //ActivityCompat.requestPermissions(this, PERMISSIONS_STORAGE, 1001);\n }", "public void initDevice() {\n myBluetoothAdapter = android.bluetooth.BluetoothAdapter.getDefaultAdapter();\n pairedDevices = myBluetoothAdapter.getBondedDevices();\n }", "public interface BluetoothListener {\n\t/**\n\t * Get a description of the game, to be displayed on the BluetoothFragment layout.\n\t * @return\n\t */\n\tString getHelpString();\n\t\n\t/**\n\t * @see #onConnectedAsServer(String)\n\t */\n\tvoid onConnectedAsClient(String deviceName);\n\t\n\t/**\n\t * The 2 devices have established a bluetooth connection.\n\t * The typical action at this point is to hide the bluetooth\n\t * fragment and show the game fragment. From now on the\n\t * communication between client and server is symmetrical:\n\t * both devices can equally send and receive messages.\n\t * \n\t * Sometimes it is useful to know which device requested the\n\t * connection (the client) and which side accepted that\n\t * connection (the server).\n\t * \n\t * @param deviceName the name of the remote device\n\t */\n\tvoid onConnectedAsServer(String deviceName);\n\t\n\t/**\n\t * Typically the Activity will hide the game fragment and show\n\t * the BluetoothFragment, to allow the user to re-connect.\n\t */\n\tvoid onConnectionLost();\n\t\n\tvoid onError(String message);\n\t\n\t/**\n\t * A data message has been received from the remote device.\n\t * This corresponds to the other device performing a write().\n\t * @see BluetoothService#write(byte[] data)\n\t * \n\t * @param data\n\t */\n\tvoid onMessageRead(byte[] data);\n\t\n\t/**\n\t * A status message sent by the bluetooth service to be displayed\n\t * by the activity using Toast.\n\t * @param string\n\t */\n\tvoid onMessageToast(String string);\n\t\n\t/**\n\t * Called when the state of the bluetooth service has changed.\n\t * @see class BluetoothService.BTState for possible values.\n\t * @param state\n\t */\n\tvoid onStateChange(BluetoothService.BTState state);\n\t\n\t/**\n\t * Pass the object that will handle bluetooth communication.\n\t * Null if bluetooth not available on this device.\n\t * The main method to use in communication is write(byte[] data)\n\t * \n\t * @see BluetoothService#write(byte[] data)\n\t * @param bluetoothService\n\t */\n\tvoid setBluetoothService(BluetoothService bluetoothService);\n\n\t/**\n\t * A status message sent by the bluetooth service to be displayed\n\t * somewhere.\n\t * @param message\n\t */\n\tvoid setStatusMessage(String message);\n}", "private void checkBTState() {\n if(btAdapter==null) {\n btState.setImageResource(R.drawable.ic_action_off);\n errorExit(\"Fatal Error\", \"Bluetooth не поддерживается\");\n\n } else {\n if (btAdapter.isEnabled()) {\n Log.d(TAG, \"...Bluetooth включен...\");\n btState.setImageResource(R.drawable.ic_action_on);\n } else {\n //Prompt user to turn on Bluetooth\n Intent enableBtIntent = new Intent(btAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);\n }\n }\n }", "public String getMacBluetooth()\n/* */ {\n/* 69 */ return this.macBluetooth;\n/* */ }", "private void onEnableBluetoothResponse(int resultCode) {\n\t\tif (resultCode == RESULT_OK) {\n\t\t\tlogger.debug(\"onEnableBluetoothResponse(): Bluetooth enabled. Starting Workout Service.\");\n\t\t\tworkoutServiceIntent = new Intent(this, WorkoutService.class);\n\t\t\tstartService(workoutServiceIntent);\n\t\t\tbindService(workoutServiceIntent, workoutServiceConn, BIND_AUTO_CREATE);\n\t\t}\n\n\t\telse {\n\t\t\tlogger.warn(\"onEnableBluetoothResponse(): User elected not to enable Bluetooth. Activity will now finish.\");\n\t\t\tfinish();\n\t\t}\n\t}", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif(resultCode == RESULT_CANCELED) {\n\t\t\tToast.makeText(getApplicationContext(), \"Bluetooth must be enabled to continue\", Toast.LENGTH_SHORT).show();\n\t\t\tfinish();\n\t\t}\n\t}", "public void listBT() {\n Log.d(\"Main Activity\", \"Listing BT elements\");\n if (searchBt) {\n //Discover bluetooth devices\n final List<String> list = new ArrayList<>();\n list.add(\"\");\n pairedDevices.addAll(mBluetoothAdapter.getBondedDevices());\n // If there are paired devices\n if (pairedDevices.size() > 0) {\n // Loop through paired devices\n for (BluetoothDevice device : pairedDevices) {\n // Add the name and address to an array adapter to show in a ListView\n list.add(device.getName() + \"\\n\" + device.getAddress());\n }\n }\n if (!h7) {\n Log.d(\"Main Activity\", \"Listing BTLE elements\");\n final BluetoothAdapter.LeScanCallback leScanCallback = new BluetoothAdapter.LeScanCallback() {\n public void onLeScan(final BluetoothDevice device, final int rssi, final byte[] scanRecord) {\n if (!list.contains(device.getName() + \"\\n\" + device.getAddress())) {\n Log.d(\"Main Activity\", \"Adding \" + device.getName());\n list.add(device.getName() + \"\\n\" + device.getAddress());\n pairedDevices.add(device);\n }\n }\n };\n\n\n Thread scannerBTLE = new Thread() {\n public void run() {\n Log.d(\"Main Activity\", \"Starting scanning for BTLE\");\n mBluetoothAdapter.startLeScan(leScanCallback);\n try {\n Thread.sleep(5000);\n Log.d(\"Main Activity\", \"Stoping scanning for BTLE\");\n mBluetoothAdapter.stopLeScan(leScanCallback);\n } catch (InterruptedException e) {\n Log.e(\"Main Activity\", \"ERROR: on scanning\");\n }\n }\n };\n\n scannerBTLE.start();\n }\n\n //Populate drop down\n spinner1 = (Spinner) findViewById(R.id.spinner1);\n ArrayAdapter<String> dataAdapter = new ArrayAdapter<>(this,\n android.R.layout.simple_spinner_item, list);\n dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spinner1.setOnItemSelectedListener(this);\n spinner1.setAdapter(dataAdapter);\n\n for (int i = 0; i < dataAdapter.getCount(); i++) {\n if (dataAdapter.getItem(i).contains(\"Polar H7\")) spinner1.setSelection(i);\n }\n\n if (DataHandler.getInstance().getID() != 0 && DataHandler.getInstance().getID() < spinner1.getCount())\n spinner1.setSelection(DataHandler.getInstance().getID());\n }\n }", "@Override\n public void onConnectionStateChange(BluetoothGatt gatt, int status,\n int newState) {\n Log.i(\"onConnectionStateChange\", \"The connection status has changed. status:\" + status + \" newState:\" + newState + \"\");\n try {\n if(status == BluetoothGatt.GATT_SUCCESS) {\n switch (newState) {\n // Has been connected to the device\n case BluetoothProfile.STATE_CONNECTED:\n Log.i(\"onConnectionStateChange\", \"Has been connected to the device\");\n if(_ConnectionStatus == ConnectionStatus.Connecting) {\n _ConnectionStatus = ConnectionStatus.Connected;\n try {\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnConnected();\n if (gatt.getDevice().getBondState() == BluetoothDevice.BOND_BONDED){\n //Url : https://github.com/NordicSemiconductor/Android-DFU-Library/blob/release/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java\n Log.i(\"onConnectionStateChange\",\"Waiting 1600 ms for a possible Service Changed indication...\");\n // Connection successfully sleep 1600ms, the connection success rate will increase\n Thread.sleep(1600);\n }\n } catch (Exception e){}\n // Discover service\n gatt.discoverServices();\n }\n break;\n // The connection has been disconnected\n case BluetoothProfile.STATE_DISCONNECTED:\n Log.i(\"onConnectionStateChange\", \"The connection has been disconnected\");\n if(_ConnectionStatus == ConnectionStatus.Connected) {\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnDisConnected();\n }\n Close();\n _ConnectionStatus = ConnectionStatus.DisConnected;\n break;\n /*case BluetoothProfile.STATE_CONNECTING:\n Log.i(\"onConnectionStateChange\", \"Connecting ...\");\n _ConnectionStatus = ConnectionStatus.Connecting;\n break;\n case BluetoothProfile.STATE_DISCONNECTING:\n Log.i(\"onConnectionStateChange\", \"Disconnecting ...\");\n _ConnectionStatus = ConnectionStatus.DisConnecting;\n break;*/\n default:\n Log.e(\"onConnectionStateChange\", \"newState:\" + newState);\n break;\n }\n }else {\n Log.i(\"onConnectionStateChange\", \"GATT error\");\n Close();\n if(_ConnectionStatus == ConnectionStatus.Connecting\n && _Timeout - (new Date().getTime() - _ConnectStartTime.getTime()) > 0) {\n Log.i(\"Connect\", \"Gatt Error! Try to reconnect (\"+_ConnectIndex+\")...\");\n _ConnectionStatus = ConnectionStatus.DisConnected;\n Connect(); // Connect\n }else {\n _ConnectionStatus = ConnectionStatus.DisConnected;\n if (_PeripheryBluetoothServiceCallBack != null)\n _PeripheryBluetoothServiceCallBack.OnDisConnected();\n }\n }\n }catch (Exception ex){\n Log.e(\"onConnectionStateChange\", ex.toString());\n }\n super.onConnectionStateChange(gatt, status, newState);\n }", "static public BluetoothAdapter getAdapter(Context context) {\n BluetoothAdapter adapter = null;\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {\n BluetoothManager bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);\n if (bluetoothManager != null) {\n adapter = bluetoothManager.getAdapter();\n }\n }else{\n adapter = BluetoothAdapter.getDefaultAdapter();\n }\n return adapter;\n }", "public void buttonClick_connect(View view)\n\t{\n\t\tAppSettings.showConnectionLost = false;\n\t\tLog.i(TAG, \"showConnectionLost = false\");\n\t\t\n\t\tAppSettings.bluetoothConnection = new BluetoothConnection(this.getApplicationContext(), this.btConnectionHandler);\n\t\tBluetoothAdapter btAdapter = AppSettings.bluetoothConnection.getBluetoothAdapter();\n\t\t\n\t\t// If the adapter is null, then Bluetooth is not supported\n if (btAdapter == null) {\n \tToast.makeText(getApplicationContext(), R.string.bt_not_available, Toast.LENGTH_LONG).show();\n }\n else {\n \t// If Bluetooth is not on, request that it be enabled.\n if (!btAdapter.isEnabled()) {\n Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(enableIntent, REQUEST_ENABLE_BT);\n }\n else {\n \t// Launch the DeviceListActivity to see devices and do scan\n Intent serverIntent = new Intent(getApplicationContext(), DeviceListActivity.class);\n startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE);\n }\n }\n\t}", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\t\n\t\tswitch (requestCode) {\n\t\tcase REQUEST_ENABLE_BT:\n\t\t\tif(resultCode != RESULT_OK){\n\t\t\t\tToast.makeText(this, \"An error occured while enabling BT.\", Toast.LENGTH_LONG).show();\n\t\t\t\thasBTenabled = false;\n\t\t\t\tfinish();\n\t\t\t}else{\n\t\t\t\tsetupBTService();\n\t\t\t\tupdateBluetoothList();\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase BT_SETTINGS_RESULT:\n\t\t\tupdateBluetoothList();\n\t\t\tbreak;\n\t\t\t\n case REQUEST_CONNECT_DEVICE_SECURE:\n // When DeviceListActivity returns with a device to connect\n if (resultCode == Activity.RESULT_OK) {\n connectDevice(data, true);\n }\n break;\n\t\t}\n\t}", "private void addPairedDevices(){\r\n\t\t// ensure devices wont be added twice\r\n\t\tmPairedDevicesArrayAdapter.clear();\r\n\t\tSet<BluetoothDevice> pairedDevices = mBtAdapter.getBondedDevices();\r\n\t\t//bluetooth has to be enabled\r\n\t\tif(mBtAdapter.isEnabled()){\r\n\t\t\t//there are no paired devices ...\r\n\t\t\tif(pairedDevices.size() == 0){\r\n\t \t\t//inform user to pair devices manually\r\n\t \t\tToast.makeText(this, \"No paired devices detected. Please pair devices!\", Toast.LENGTH_SHORT).show();\r\n\t \t\treturnToPriviousActivityWithoutDevice();\r\n\t \t} \r\n\t\t\t//there are paired devices ...\r\n\t\t\telse{\r\n\t\t\t\t//inform user\r\n\t \t\tToast.makeText(this, \"Paired devices detected.\", Toast.LENGTH_SHORT).show();\r\n\t \t\tfindViewById(R.id.paired_devices).setVisibility(View.VISIBLE); \t\t\r\n\t \t // Loop through paired devices\r\n\t \t for (BluetoothDevice device : pairedDevices) {\r\n\t \t // Add the name and address to an array adapter to show in a ListView\t \t \t\r\n\t \t mPairedDevicesArrayAdapter.add(device.getName() + \"\\n\" + device.getAddress());\r\n\t \t }\r\n\t \t}\r\n\t\t}\r\n\t}", "private void turnOn(View v) {\n bluetoothAdapter.enable();\n }", "public Set<BluetoothDevice> getPairedDevicesList(){\n if(isBluetoothSupported()){\n if(!baBTAdapter.isEnabled()){\n turnOnBluetooth();\n }\n }\n else{\n return null;\n }\n\n return baBTAdapter.getBondedDevices();\n }" ]
[ "0.7413601", "0.73962694", "0.7348643", "0.73156166", "0.7093279", "0.707295", "0.7059008", "0.70546395", "0.70229244", "0.7022385", "0.69265133", "0.68739736", "0.68275964", "0.67498994", "0.6738965", "0.667543", "0.66629004", "0.6645454", "0.6625548", "0.6624498", "0.65894234", "0.6570413", "0.65571064", "0.6544536", "0.65362984", "0.6527652", "0.64889526", "0.6438717", "0.64282936", "0.6422319", "0.6414623", "0.64050967", "0.63900375", "0.6374744", "0.6358562", "0.634303", "0.6340623", "0.6309885", "0.62735045", "0.62509876", "0.62106985", "0.6205324", "0.61919886", "0.61707383", "0.6166652", "0.61523324", "0.61493844", "0.61411107", "0.6132348", "0.6106185", "0.60830873", "0.60810226", "0.60784096", "0.6067724", "0.60645276", "0.6064121", "0.6063246", "0.60579365", "0.6053357", "0.60082436", "0.59985834", "0.59914356", "0.59855735", "0.5970844", "0.59669757", "0.5913485", "0.59116924", "0.59104866", "0.59093535", "0.5888941", "0.5868644", "0.58652073", "0.5861585", "0.5860549", "0.585909", "0.583287", "0.58145666", "0.58101857", "0.58071643", "0.58045197", "0.5799041", "0.57977813", "0.5776696", "0.57749313", "0.5773802", "0.57682", "0.57647324", "0.57517546", "0.5748761", "0.5718338", "0.5718217", "0.57103765", "0.5707097", "0.5703508", "0.57006633", "0.56982815", "0.56933355", "0.5682973", "0.5681461", "0.5680398" ]
0.5765102
86
Handle navigation view item clicks here.
@SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.nav_camera) { // Handle the camera action } else if (id == R.id.nav_gallery) { } else if (id == R.id.nav_slideshow) { } else if (id == R.id.nav_manage) { } else if (id == R.id.nav_share) { } else if (id == R.id.nav_send) { } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "void onDialogNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }", "@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }", "@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }", "@Override\n public void onClick(View view) {\n listener.menuButtonClicked(view.getId());\n }", "@Override\r\n\tpublic boolean onNavigationItemSelected(int itemPosition, long itemId) {\n\t\tLog.d(\"SomeTag\", \"Get click event at position: \" + itemPosition);\r\n\t\tswitch (itemPosition) {\r\n\t\tcase 1:\r\n\t\t\tIntent i = new Intent();\r\n\t\t\ti.setClass(getApplicationContext(), MainActivity.class);\r\n\t\t\tstartActivity(i);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\tcase 2 :\r\n\t\t\tIntent intent = new Intent(this,WhiteListActivity.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }", "@Override\n\tpublic void rightNavClick() {\n\t\t\n\t}", "@Override\n public void OnItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (itemClicked != null)\n\t\t\t\t\titemClicked.OnItemClicked((BusinessType)item.getTag(), item);\n\t\t\t}", "@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\thandleClick(position);\n\t\t\t}", "@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }", "@Override\n public void onItemClick(int pos) {\n }", "@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }", "private void handleNavClick(View view) {\n final String label = ((TextView) view).getText().toString();\n if (\"Logout\".equals(label)) {\n logout();\n }\n if (\"Profile\".equals(label)) {\n final Intent intent = new Intent(this, ViewProfileActivity.class);\n startActivity(intent);\n }\n if (\"Search\".equals(label)){\n final Intent intent = new Intent(this, SearchActivity.class);\n startActivity(intent);\n }\n if (\"Home\".equals(label)) {\n final Intent intent = new Intent(this, HomeActivity.class);\n startActivity(intent);\n }\n }", "void onMenuItemClicked();", "@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}", "@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}", "@Override\n public void onItemClick(View view, String data) {\n }", "abstract public void onSingleItemClick(View view);", "@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }", "@Override\n public void itemClick(int pos) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n TextView textView = (TextView)view;\n switch(textView.getText().toString()){\n case \"NavBar\":\n Intent nav = new Intent(this, NavDrawerActivity.class);\n startActivity(nav);\n break;\n }\n\n //Toast.makeText(MainActivity.this,\"Go to \" + textView.getText().toString() + \" page.\",Toast.LENGTH_LONG).show();\n }", "@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\n public void onItemClick(Nson parent, View view, int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }", "@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }", "@Override\n\t\tpublic void onClick(View view) {\n\t\t\tif (iOnItemClickListener != null) {\n\t\t\t\tiOnItemClickListener.onItemClick(view, null, getAdapterPosition());\n\t\t\t}\n\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "public void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n public void onItemOfListClicked(Object o) {\n UserProfileFragmentDirections.ActionUserProfileFragmentToEventProfileFragment action = UserProfileFragmentDirections.actionUserProfileFragmentToEventProfileFragment((MyEvent) o);\n navController.navigate(action);\n }", "@Override\n public void onClick(View view) {\n if(mFrom.equals(NetConstants.BOOKMARK_IN_TAB)) {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), NetConstants.G_BOOKMARK_DEFAULT,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n else {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), mFrom,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_ds_note) {\n // Handle the camera action\n } else if (id == R.id.nav_ds_todo) {\n\n } else if (id == R.id.nav_ql_the) {\n\n } else if (id == R.id.nav_tuychinh) {\n Intent intent = new Intent(this, CustomActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }", "@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "void onLinkClicked(@Nullable ContentId itemId);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:\n Intent homeIntent = new Intent(this, MainActivity.class);\n startActivity(homeIntent);\n break;\n case R.id.send_email:\n Intent mailIntent = new Intent(this, ContactActivity.class);\n startActivity(mailIntent);\n break;\n case R.id.send_failure_ticket:\n Intent ticketIntent = new Intent(this, TicketActivity.class);\n startActivity(ticketIntent);\n break;\n case R.id.position:\n Intent positionIntent = new Intent(this, LocationActivity.class);\n startActivity(positionIntent);\n break;\n case R.id.author:\n UrlRedirect urlRed = new UrlRedirect(this.getApplicationContext(),getString(R.string.linkedinDeveloper));\n urlRed.redirect();\n break;\n default:\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main_activity);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@SuppressWarnings(\"ConstantConditions\")\n public void onItemClicked(@NonNull Item item) {\n getView().openDetail(item);\n }", "void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n startNavigation();\n }", "void onItemClick(int position);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_logs) {\n startActivity(new Intent(this, LogView.class));\n } else if (id == R.id.nav_signOut) {\n signOut();\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tpresenter.onItemClicked(position);\n\t}", "@Override\n public void onClick(View view) {\n listener.onMenuButtonSelected(view.getId());\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tHashMap<String, Object> item = (HashMap<String, Object>) arg0\n\t\t\t\t\t\t.getAdapter().getItem(arg2);\n\n\t\t\t\tIntent intent = new Intent(ViewActivity.this,\n\t\t\t\t\t\tContentActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"_id\", item.get(\"_id\").toString());\n\t\t\t\tbundle.putString(\"_CityEventID\", item.get(\"_CityEventID\")\n\t\t\t\t\t\t.toString());\n\t\t\t\tbundle.putString(\"_type\", String.valueOf(_type));\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onClick(View view) {\n Navigation.findNavController(view).navigate(R.id.addEventFragment);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }", "void clickItem(int uid);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_categories) {\n Intent intent = new Intent(getApplicationContext(), CategoryActivity.class);\n startActivity(intent, compat.toBundle());\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"category\");\n\n } else if (id == R.id.nav_top_headlines) {\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"home\");\n Intent intent = new Intent(getApplicationContext(), HomeActivity.class);\n startActivity(intent, compat.toBundle());\n } else if (id == R.id.nav_search) {\n // Do nothing\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(View view, int position) {\n\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_orders) {\n\n Intent orderStatusIntent = new Intent(Home.this , OrderStatus.class);\n startActivity(orderStatusIntent);\n\n } else if (id == R.id.nav_banner) {\n\n Intent bannerIntent = new Intent(Home.this , BannerActivity.class);\n startActivity(bannerIntent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }", "public void onItemClick(View view, int position) {\n\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}", "void onClick(View item, View widget, int position, int which);", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n Intent intent;\n switch(item.getItemId()){\n case R.id.nav_home:\n finish();\n intent = new Intent(this, NavigationActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_calendar:\n finish();\n intent = new Intent(this, EventHome.class);\n startActivity(intent);\n return true;\n case R.id.nav_discussion:\n return true;\n case R.id.nav_settings:\n intent = new Intent(this, SettingsActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_app_blocker:\n intent = new Intent(this, AppBlockingActivity.class);\n startActivity(intent);\n return true;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case R.id.nav_home:\n break;\n\n case R.id.nav_favourites:\n\n if (User.getInstance().getUser() == null) {\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n }\n\n Intent intent = new Intent(getApplicationContext(), PlaceItemListActivity.class);\n startActivity(intent);\n\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonRgtRgtMenuClick(v);\n\t\t\t}", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n Toast.makeText(this, \"gallery is clicked!\", Toast.LENGTH_LONG).show();\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "public void menuClicked(MenuItem menuItemSelected);", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_my_account) {\n startActivity(new Intent(this, MyAccountActivity.class));\n } else if (id == R.id.nav_message_inbox) {\n startActivity(new Intent(this, MessageInboxActivity.class));\n } else if (id == R.id.nav_view_offers) {\n //Do Nothing\n } else if (id == R.id.nav_create_listing) {\n startActivity(new Intent(this, CreateListingActivity.class));\n } else if (id == R.id.nav_view_listings) {\n startActivity(new Intent(this, ViewListingsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\r\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t}" ]
[ "0.7882029", "0.7235578", "0.6987005", "0.69458413", "0.6917864", "0.6917864", "0.6883472", "0.6875181", "0.68681556", "0.6766498", "0.67418456", "0.67207", "0.6716157", "0.6713947", "0.6698189", "0.66980195", "0.66793925", "0.66624063", "0.66595167", "0.6646381", "0.6641224", "0.66243863", "0.6624042", "0.66207093", "0.6602551", "0.6602231", "0.6599443", "0.65987265", "0.65935796", "0.6585869", "0.658491", "0.65811735", "0.65765643", "0.65751576", "0.65694076", "0.6561757", "0.65582377", "0.65581614", "0.6552827", "0.6552827", "0.6549224", "0.65389794", "0.65345114", "0.65337104", "0.652419", "0.652419", "0.6522521", "0.652146", "0.6521068", "0.6519354", "0.65165275", "0.65159816", "0.65028816", "0.6498054", "0.6498054", "0.64969087", "0.64937705", "0.6488544", "0.64867324", "0.64866185", "0.64865905", "0.6484047", "0.6481108", "0.6474686", "0.64628965", "0.64551884", "0.6446893", "0.64436555", "0.64436555", "0.64436555", "0.64436555", "0.64436555", "0.64386237", "0.643595", "0.64356565", "0.64329195", "0.6432562", "0.6429554", "0.64255124", "0.64255124", "0.64121485", "0.64102405", "0.64095175", "0.64095175", "0.64094734", "0.640727", "0.64060104", "0.640229", "0.6397359", "0.6392996", "0.63921124", "0.63899696", "0.63885015", "0.63885015", "0.63873845", "0.6368818", "0.6368818", "0.63643163", "0.63643163", "0.63643163", "0.6358884" ]
0.0
-1
A sample Cashier interface built to unit test a CashierAgent.
public interface Cashier { // Sent from waiter to computer a bill for a customer public abstract void msgComputeBill(String choice, Customer c, Waiter w, int tableNumber, Map<String, Double> menu); // Sent from a customer when making a payment public abstract void msgPayment(Customer customer, Cash cash); public abstract void msgAskForPayment(String food, int batchSize, Market market, double price); public abstract String getCash(); public abstract String getTotalDebt(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void cash() {\n System.out.println(BotClient.getCash(0));\n }", "@Test\n public void testAuthorization() throws Throwable {\n Method defineCustomer = EZShop.class.getMethod(\"receiveCashPayment\", Integer.class, double.class);\n testAccessRights(defineCustomer, new Object[] {saleId, toBePaid},\n new Role[] {Role.SHOP_MANAGER, Role.ADMINISTRATOR, Role.CASHIER});\n }", "static void testCaculator(){\n }", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n Cic.main(args);\n \n }", "@Test\n public void testCollectPayment() {\n System.out.println(\"collectPayment\");\n Money moneyType = Money.QUARTER;\n int unitCount = 0;\n //CashRegister instance = new CashRegister();\n instance.collectPayment(moneyType, unitCount);\n }", "@Test\n\tpublic void AccountCredit_test() { Using HamCrest \t\t\n\t\t// Exercise code to run and test\n\t\t//\n\t\tmiCuenta.setHolder(this.arg1);\n\t\t//\n\t\tmiCuenta.setBalance(this.arg2); \n\t\t//\n\t\tmiCuenta.setZone(this.arg3);\n\t\t//\n\t\tmiCuenta.debit(this.arg4);\n\t\tint Debit = miCuenta.getBalance(); \t\t\t\t\n\t\t// Verify\n\t\tassertThat(this.arg5, is(Debit));\n\t\t\n\t}", "SpaceInvaderTest createSpaceInvaderTest();", "@Test\r\n public void testCashReceipt() {\r\n \r\n instance = new Controller(dbMgr);\r\n instance.cashReceipt();\r\n \r\n }", "@Test\r\n\tpublic void client() {\n\t}", "public interface ChainCodeService {\n String chainCodeInstall();\n String chainCodeInstantiate(String[] args);\n String chainCodeUpgrade(String[] args);\n String chainCodeInvoke(String fcn, String[] args);\n String chainCodeQuery(String fcn, String[] args);\n}", "public ClimbingClubTest()\n {\n \n }", "@Test\n public void buy() {\n System.out.println(client.purchase(1, 0, 1));\n }", "@Test\r\n public void testPayByCash() {\r\n \r\n int paidAmount = 100;\r\n int cost = 60;\r\n instance = new Controller(dbMgr);\r\n int expResult = 40;\r\n int result = instance.payByCash(paidAmount, cost);\r\n assertEquals(expResult, result);\r\n \r\n }", "public interface IntegrationTest {\n}", "@Test\r\n public void testPayByCard() {\r\n \r\n int cost = 60;\r\n \r\n instance.payByCard(cost);\r\n \r\n }", "@Test\n public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\"));\n addCharges(charges, amountPlusInterestPercentageDisbursementCharge, \"1\", null);\n\n Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper\n .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n clientID.toString(), collateralId);\n Assertions.assertNotNull(collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"126.04\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"126.06\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"157.57\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"31.51\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"126.06\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3309.06\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"94.53\", \"31.51\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"157.57\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"157.57\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID,\n (Integer) getloanCharge(amountPlusInterestPercentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"63.02\", \"31.51\", \"31.51\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3277.55\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.0\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2791.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"157.57\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3303\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3149.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3241.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3121.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3121.19\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT));\n }", "public interface Action {\n\n /**\n * The executeAction method takes in actionInfo and runs the action code\n * @param actionInfo all information sent by the test file to the action\n */\n public void executeAction( String actionInfo );\n\n}", "@Test \n public void bookHotelTestWithCreditCard() throws BookHotelFault, DatatypeConfigurationException{\n try{\n BookHotelInputType input = CreateBookHotelInputType(\"booking_Hotel_2\", \"Thor-Jensen Claus\", \"50408825\", 5, 9);\n boolean result = bookHotel(input);\n assertEquals(true, result); \n } catch(BookHotelFault e){\n System.out.println(e.getMessage());\n fail();\n }\n }", "@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n CashRegister.main(args);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "@Test\n public void issuerTest() {\n // TODO: test issuer\n }", "@Test\n public void loanWithCahargesOfTypeAmountPlusInterestPercentageAndUpfrontAccrualAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\"));\n addCharges(charges, amountPlusInterestPercentageDisbursementCharge, \"1\", null);\n\n Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper\n .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n\n Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"126.04\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"126.06\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"31.51\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"31.51\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"126.04\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"126.04\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 September 2011\", \"1\"));\n\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"29 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"29 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3309.06\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"94.53\", \"31.51\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"157.57\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID,\n (Integer) getloanCharge(amountPlusInterestPercentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"63.02\", \"31.51\", \"31.51\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.DEBIT));\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3277.55\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.0\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3303\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3241.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3121.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make over payment for repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3221.61\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3221.61\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForLiabilityAccount(overpaymentAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100.42\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);\n }", "@Test\n public void loanWithCahargesOfTypeAmountPercentageAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer percentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\"));\n addCharges(charges, percentageDisbursementCharge, \"1\", null);\n\n Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer percentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n clientID.toString(), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"120.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"149.11\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"29.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"120.00\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3300.60\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"120.00\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"90.89\", \"29.11\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"149.11\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"149.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"61.19\", \"29.11\", \"29.70\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3271.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2791.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"149.11\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.78\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3149.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"30.29\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3240.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3120.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3120.58\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"30.90\"), JournalEntry.TransactionType.CREDIT));\n }", "public void credit(){\r\n\t\tSystem.out.println(\"HSBC-- Credit method called from Interface USBank \");\r\n\t}", "@Test\n public void company() {\n System.out.println(client.companyName(1));\n }", "@Test\n\tpublic void cognitiveArchitectureStructureTest() {\n\t\ttry {\n\t\t\t// Create the agent\n\t\t\tString cognitiveAgentName = \"CognitiveAgent\";\n\n\t\t\t// Main codelet handler\n\t\t\tString mainCodeletHandlerName = \"MainProcessCodeletHandler\";\n\t\t\tString mainCodeletHandlerServiceAddress = cognitiveAgentName + \":\" + mainCodeletHandlerName;\n\n\t\t\t// Codelethandler Activate Concepts\n\t\t\tString activateConceptsCodeletTriggerName = \"ActivateConceptsCodeletHandlerTrigger\";\n\t\t\tString activateConceptsCodeletHandlerName = \"ActivateConceptsCodeletHandler\";\n\n\t\t\t// Codelethandler Create goals\n\t\t\tString createGoalsCodeletTriggerName = \"CreateGoalsCodeletHandlerTrigger\";\n\t\t\tString createGoalsCodeletHandlerName = \"CreateGoalsCodeletHandler\";\n\n\t\t\t// Codelethandler Activate beliefs\n\t\t\tString activateBeliefsCodeletTriggerName = \"ActivateBeliefsCodeletHandlerTrigger\";\n\t\t\tString activateBeliefsCodeletHandlerName = \"ActivateBeliefsCodeletHandler\";\n\n\t\t\t// CodeletHandler Propose Options\n\t\t\tString proposeOptionsCodeletTriggerName = \"ProposeOptionsCodeletHandlerTrigger\";\n\t\t\tString proposeOptionsCodeletHandlerName = \"ProposeOptionsCodeletHandler\";\n\n\t\t\t// CodeletHandler Propose Actions\n\t\t\tString proposeActionsCodeletTriggerName = \"ProposeActionsCodeletHandlerTrigger\";\n\t\t\tString proposeActionsCodeletHandlerName = \"ProposeActionsCodeletHandler\";\n\n\t\t\t// CodeletHandler Evaluate Options\n\t\t\tString evaluteOptionsCodeletTriggerName = \"EvaluateOptionsCodeletHandlerTrigger\";\n\t\t\tString evaluteOptionsCodeletHandlerName = \"EvaluateOptionsCodeletHandler\";\n\n\t\t\t// Codelet Select option (here, no codelethandler is executed, just a normal\n\t\t\t// codelet)\n\t\t\tString selectOptionCodeletName = \"SelectOptionCodelet\";\n\n\t\t\t// Codelet Execute Action\n\t\t\tString executeActionCodeletName = \"ExecuteActionCodelet\";\n\n\t\t\t// Memories\n\t\t\tString namespaceWorkingMemory = \"workingmemory\";\n\t\t\tString namespaceInternalStateMemory = \"internalstatememory\";\n\t\t\tString namespaceLongTermMemory = \"longtermmemory\";\n\n\t\t\t// Generate the configuration for the KORE system\n\t\t\tlog.info(\"Generate system configuration\");\n\t\t\t// Controller\n\t\t\tCellConfig cognitiveAgentConfig = CellConfig.newConfig(cognitiveAgentName)\n\t\t\t\t\t// Main codelethandler\n\t\t\t\t\t.addCellfunction(\n\t\t\t\t\t\t\tCellFunctionConfig.newConfig(mainCodeletHandlerName, CellFunctionCodeletHandler.class)\n\t\t\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEWORKINGMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\t\t\tnamespaceWorkingMemory)\n\t\t\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEINTERNALMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\t\t\tnamespaceInternalStateMemory))\n\t\t\t\t\t// Process codelethandlers\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(activateConceptsCodeletHandlerName, CellFunctionCodeletHandler.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEWORKINGMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceWorkingMemory)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEINTERNALMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceInternalStateMemory))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(createGoalsCodeletHandlerName, CellFunctionCodeletHandler.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEWORKINGMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceWorkingMemory)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEINTERNALMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceInternalStateMemory))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(activateBeliefsCodeletHandlerName, CellFunctionCodeletHandler.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEWORKINGMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceWorkingMemory)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEINTERNALMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceInternalStateMemory))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(proposeOptionsCodeletHandlerName, CellFunctionCodeletHandler.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEWORKINGMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceWorkingMemory)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEINTERNALMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceInternalStateMemory))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(proposeActionsCodeletHandlerName, CellFunctionCodeletHandler.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEWORKINGMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceWorkingMemory)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEINTERNALMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceInternalStateMemory))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(evaluteOptionsCodeletHandlerName, CellFunctionCodeletHandler.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEWORKINGMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceWorkingMemory)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodeletHandler.ATTRIBUTEINTERNALMEMORYADDRESS,\n\t\t\t\t\t\t\t\t\tnamespaceInternalStateMemory))\n\t\t\t\t\t// Add main process codelets\n\t\t\t\t\t// Add trigger codelets\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(activateConceptsCodeletTriggerName, CellFunctionHandlerTriggerCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tmainCodeletHandlerServiceAddress)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, \"1\")\n\t\t\t\t\t\t\t.setProperty(CellFunctionHandlerTriggerCodelet.codeletHandlerServiceUriName,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + activateConceptsCodeletHandlerName))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(createGoalsCodeletTriggerName, CellFunctionHandlerTriggerCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tmainCodeletHandlerServiceAddress)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, \"2\")\n\t\t\t\t\t\t\t.setProperty(CellFunctionHandlerTriggerCodelet.codeletHandlerServiceUriName,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + createGoalsCodeletHandlerName))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(activateBeliefsCodeletTriggerName, CellFunctionHandlerTriggerCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tmainCodeletHandlerServiceAddress)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, \"3\")\n\t\t\t\t\t\t\t.setProperty(CellFunctionHandlerTriggerCodelet.codeletHandlerServiceUriName,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + activateBeliefsCodeletHandlerName))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(proposeOptionsCodeletTriggerName, CellFunctionHandlerTriggerCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tmainCodeletHandlerServiceAddress)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, \"4\")\n\t\t\t\t\t\t\t.setProperty(CellFunctionHandlerTriggerCodelet.codeletHandlerServiceUriName,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + proposeOptionsCodeletHandlerName))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(proposeActionsCodeletTriggerName, CellFunctionHandlerTriggerCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tmainCodeletHandlerServiceAddress)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, \"5\")\n\t\t\t\t\t\t\t.setProperty(CellFunctionHandlerTriggerCodelet.codeletHandlerServiceUriName,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + proposeActionsCodeletHandlerName))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig\n\t\t\t\t\t\t\t.newConfig(evaluteOptionsCodeletTriggerName, CellFunctionHandlerTriggerCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tmainCodeletHandlerServiceAddress)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, \"6\")\n\t\t\t\t\t\t\t.setProperty(CellFunctionHandlerTriggerCodelet.codeletHandlerServiceUriName,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + evaluteOptionsCodeletHandlerName));\n\t\t\t// Direct codelets\n\t\t\t// .addCellfunction(CellFunctionConfig.newConfig(selectOptionCodeletName,\n\t\t\t// OptionSelectorCodelet.class)\n\t\t\t// .setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t// mainCodeletHandlerServiceAddress)\n\t\t\t// .setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, \"7\"))\n\t\t\t// .addCellfunction(CellFunctionConfig.newConfig(executeActionCodeletName,\n\t\t\t// ActionExecutorCodelet.class)\n\t\t\t// .setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t// mainCodeletHandlerServiceAddress)\n\t\t\t// .setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, \"8\"));\n\n\t\t\t// Add the specific codelets\n\t\t\tString incrementServiceName = \"incrementservice\";\n\t\t\tString incrementDatapoint1 = \"incrementme1\";\n\t\t\tString incrementDatapoint2 = \"incrementme2\";\n\n\t\t\tcognitiveAgentConfig\n\t\t\t\t\t// .addCellfunction(CellFunctionConfig.newConfig(incrementServiceName,\n\t\t\t\t\t// CFIncrementService.class)\n\t\t\t\t\t// .addManagedDatapoint(DatapointConfig.newConfig(CFIncrementService.ATTRIBUTEINCREMENTDATAPOINT,\n\t\t\t\t\t// namespaceWorkingMemory + \".\" + incrementDatapoint,\n\t\t\t\t\t// SyncMode.SUBSCRIBEWRITEBACK)))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet11\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + activateConceptsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint1))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet12\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + createGoalsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint1))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet13\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + activateBeliefsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint1))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet14\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + proposeOptionsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint1))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet15\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + proposeActionsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint1))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet16\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + evaluteOptionsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint1));\n\n\t\t\tcognitiveAgentConfig\n\t\t\t\t\t// .addCellfunction(CellFunctionConfig.newConfig(incrementServiceName,\n\t\t\t\t\t// CFIncrementService.class)\n\t\t\t\t\t// .addManagedDatapoint(DatapointConfig.newConfig(CFIncrementService.ATTRIBUTEINCREMENTDATAPOINT,\n\t\t\t\t\t// namespaceWorkingMemory + \".\" + incrementDatapoint,\n\t\t\t\t\t// SyncMode.SUBSCRIBEWRITEBACK)))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet21\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + activateConceptsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint2))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet22\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + createGoalsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint2))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet23\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + activateBeliefsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint2))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet24\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + proposeOptionsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint2))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet25\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + proposeActionsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint2))\n\t\t\t\t\t.addCellfunction(CellFunctionConfig.newConfig(\"IncrementCodelet26\", IncrementNumberCodelet.class)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTECODELETHANDLERADDRESS,\n\t\t\t\t\t\t\t\t\tcognitiveAgentName + \":\" + evaluteOptionsCodeletHandlerName)\n\t\t\t\t\t\t\t.setProperty(CellFunctionCodelet.ATTRIBUTEEXECUTIONORDER, 0)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESERVICENAME, incrementServiceName)\n\t\t\t\t\t\t\t.setProperty(IncrementNumberCodelet.ATTRIBUTESUBADDRESS, incrementDatapoint2));\n\n\t\t\tlog.debug(\"Start agent with config={}\", cognitiveAgentConfig);\n\n\t\t\tCellGatewayImpl cogsys = this.launcher.createAgent(cognitiveAgentConfig);\n\n\t\t\tsynchronized (this) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.wait(5000);\n\t\t\t\t} catch (InterruptedException e) {\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Write initial value on the incrementaddress\n\t\t\tcogsys.getCommunicator().write(\n\t\t\t\t\tDatapointBuilder.newDatapoint(namespaceWorkingMemory + \".\" + incrementDatapoint1).setValue(0));\n\t\t\tcogsys.getCommunicator().write(\n\t\t\t\t\tDatapointBuilder.newDatapoint(namespaceWorkingMemory + \".\" + incrementDatapoint2).setValue(0));\n\n\t\t\tlog.info(\"=== All agents initialized ===\");\n\n\t\t\t// memoryAgent.getCommunicator().write(Datapoint.newDatapoint(processDatapoint).setValue(new\n\t\t\t// JsonPrimitive(startValue)));\n\t\t\t// cogsys.getCommunicator().execute(cognitiveAgentName, mainCodeletHandlerName,\n\t\t\t// Arrays.asList(\n\t\t\t// Datapoint.newDatapoint(\"method\").setValue(\"executecodelethandler\"),\n\t\t\t// Datapoint.newDatapoint(\"blockingmethod\").setValue(new JsonPrimitive(true))),\n\t\t\t// 10000);\n\n\t\t\tJsonRpcRequest request1 = new JsonRpcRequest(\"executecodelethandler\", 1);\n\t\t\trequest1.setParameterAsValue(0, false);\n\n\t\t\tcogsys.getCommunicator().executeServiceQueryDatapoints(cognitiveAgentName, mainCodeletHandlerName, request1,\n\t\t\t\t\tcognitiveAgentName, mainCodeletHandlerName + \".state\",\n\t\t\t\t\tnew JsonPrimitive(ServiceState.FINISHED.toString()), 200000);\n\n\t\t\t// synchronized (this) {\n\t\t\t// try {\n\t\t\t// this.wait(1000);\n\t\t\t// } catch (InterruptedException e) {\n\t\t\t//\n\t\t\t// }\n\t\t\t// }\n\n\t\t\t// log.info(\"Read working memory={}\", cogsys.getDataStorage());\n\n\t\t\tint result1 = (int) (cogsys.getCommunicator().read(namespaceWorkingMemory + \".\" + incrementDatapoint1)\n\t\t\t\t\t.getValue().getAsDouble());\n\t\t\tint result2 = (int) (cogsys.getCommunicator().read(namespaceWorkingMemory + \".\" + incrementDatapoint1)\n\t\t\t\t\t.getValue().getAsDouble());\n\t\t\tint expectedResult1 = 6;\n\t\t\tint expectedResult2 = 6;\n\n\t\t\tlog.debug(\"correct value={}, actual value={}\", expectedResult1, result1);\n\n\t\t\tassertEquals(expectedResult1, result1);\n\n\t\t\tlog.debug(\"correct value={}, actual value={}\", expectedResult2, result2);\n\t\t\tassertEquals(expectedResult2, result2);\n\t\t\tlog.info(\"Test passed\");\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Error testing system\", e);\n\t\t\tfail(\"Error\");\n\t\t}\n\n\t}", "@Test\n public void loanWithCahargesAndUpfrontAccrualAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer percentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\"));\n addCharges(charges, percentageDisbursementCharge, \"1\", null);\n\n Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer percentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"120.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"149.11\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"29.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"120.00\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3300.60\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"120.00\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"90.89\", \"29.11\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"149.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"61.19\", \"29.11\", \"29.70\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.DEBIT));\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3271.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.78\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3240.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3120.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make over payment for repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3220.58\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3220.58\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForLiabilityAccount(overpaymentAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);\n }", "public void CashPayment()\n {\n }", "@Test\n public void channelTest() {\n // TODO: test channel\n }", "@Test\n public void testRedshiftCredit() throws Exception {\n Line line = new Line(LineItemType.Credit, \"us-east-1\", \"\", redshift, \"Node:ds2.xlarge\", \"RunComputeNode:0001\", \"AWS Credit\", PricingTerm.onDemand, \"2020-03-01T00:00:00Z\", \"2020-04-01T00:00:01Z\", \"0.0000000000\", \"-38.3100000000\", \"\");\n ProcessTest test = new ProcessTest(line, Result.delay, 31);\n Datum[] expected = {\n new Datum(CostType.credit, a2, Region.US_EAST_1, null, redshiftInstance, Operation.ondemandInstances, \"ds2.xlarge\", -0.0515, 0),\n };\n test.run(\"2020-03-01T00:00:00Z\", expected); \n }", "@Test\n public void loanWithFlatCahargesAndCashBasedAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer flatDisbursement = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper.getLoanDisbursementJSON());\n addCharges(charges, flatDisbursement, \"100\", null);\n Integer flatSpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", false));\n addCharges(charges, flatSpecifiedDueDate, \"100\", \"29 September 2011\");\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, CASH_BASED, assetAccount, incomeAccount, expenseAccount, overpaymentAccount);\n\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"200.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"100.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"150.00\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"50.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3301.49\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"150.00\", \"50.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2911.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"150.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240.00\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), \"29 October 2011\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"150.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"100.00\", \"50.0\", \"50.0\");\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3251.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2969.72\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"181.77\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"29 September 2011\", \"100\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatPenaltySpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"100\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"2811.49\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"150.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"240\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3129.11\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"50.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"122.38\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"10 January 2012\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"100\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3239.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"100\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3139.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3139.68\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3139.68\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3089.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"50.00\"), JournalEntry.TransactionType.CREDIT));\n }", "@Test\r\n public void testGetCustomer() {\r\n }", "public void visitCashChanger( DevCat devCat ) {}", "@Test\n public void testGatewayCreateProducerChef() {\n // TODO: test GatewayCreateProducerChef\n }", "public static void main(String[] args) {\n\t\tDomestic_Consumer dc=new Domestic_Consumer(111,\"vishal\");\r\n\t\t//better way to implement runtime polymorhism\r\n\t\t//ref variable of interface pointing to implementing class\r\n\t\tElectric_Domestic dom=new Domestic_Consumer(123,\"java\");\r\n\t\tint bill=dom.calcBill(130);\r\n\t\tSystem.out.println(\"Totl bill is \"+bill);\r\n\t\t bill=dc.calcBill(100);\r\n\t\tSystem.out.println(\"bill is\" +bill);\r\n\r\n\t}", "Testcase createTestcase();", "public static void main(String[] args) {\n //create three types of clients\n //the last two will inherit from the first\n //\n //create a type of client by assigning the class to a variable and running the constructor\n TrialClient trial = new TrialClient();\n Client client = new Client();\n PremiumClient premium = new PremiumClient();\n //\n //Create a visual text output of dependencies:\n System.out.println(\"Who bought what with dependencies:\");\n System.out.println(\"**********************************\");\n System.out.println();\n //run the bought method of trial client, this outputs its ownership\n System.out.println(\"The trial client tried:\");\n trial.bought();\n //\n System.out.println();\n System.out.println(\"The standard client bought:\");\n client.bought();\n //\n System.out.println();\n System.out.println(\"The premium client received:\");\n premium.bought();\n\n }", "@Test\n\tpublic void customerLogin()\n\t{\n\t\tCustomerFacade cf = cust.login(\"Customer2\", \"4321\", ClientType.CUSTOMER);\n\t\tAssert.assertNotNull(cf);\n\t}", "@Test\n public void sell() {\n System.out.println(client.sell(1, 0, 1));\n }", "public interface PerformanceTest {}", "public void credit(){\n\n System.out.println(\"HSBC\");\n\n\n }", "public SafewalkClientImplTest( String testName ) {\n super( testName );\n }", "public FlightTest(){\n }", "@Test\n public void loanWithChargesOfTypeAmountPlusInterestPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer amountPlusInterestPercentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\"));\n addCharges(charges, amountPlusInterestPercentageDisbursementCharge, \"1\", null);\n\n Integer amountPlusInterestPercentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper\n .getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer amountPlusInterestPercentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST, \"1\", false));\n addCharges(charges, amountPlusInterestPercentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"126.06\", \"0.0\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"126.04\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"126.06\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"157.57\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"31.51\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"126.06\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"126.06\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3309.06\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"126.06\", \"0.0\");\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"94.53\", \"31.51\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"157.57\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID,\n (Integer) getloanCharge(amountPlusInterestPercentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, \"1\", \"63.02\", \"31.51\", \"31.51\");\n\n /*\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount( assetAccount, \"20 September 2011\", new JournalEntry(\n * Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.CREDIT));\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount (expenseAccount, \"20 September 2011\", new\n * JournalEntry(Float.parseFloat(\"31.51\"), JournalEntry.TransactionType.DEBIT));\n */\n\n final String jobName = \"Add Accrual Transactions\";\n\n SCHEDULER_JOB_HELPER.executeAndAwaitJob(jobName);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n checkAccrualTransactions(loanSchedule, loanID);\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3277.55\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3277.55\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(amountPlusInterestPercentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.0\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3309.06\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3303\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3303\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON(\n String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3241.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3121.19\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3121.19\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3121.19\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);\n }", "public interface BusinessActionsRestClient {\n}", "@Test\npublic void testAddBalance(){ \n sut.addBalance(100,1,new Account());\n}", "public interface ICordysGatewayClientFactory\r\n{\r\n /**\r\n * Return a client (the factory is also responsable for creating the gateway).\r\n *\r\n * @return A cordys gateway client.\r\n */\r\n ICordysGatewayClient getGatewayClientInstance();\r\n}", "@Test\n void getGreeting() {\n System.out.println(controller.getGreeting());\n }", "static void SampleItinerary()\n {\n System.out.println(\"\\n ***Everyone piles on the boat and goes to Molokai***\");\n\n bg.AdultRowToMolokai();\n bg.ChildRideToMolokai();\n bg.AdultRideToMolokai();\n bg.ChildRideToMolokai();\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\n\t\t\t\tpublic void verifySAPGasCustomer_AnnualServiceAmount()\t\n\t\t\t\t{\t\n\t\t\t\t\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verifies the SAP SMR page for Electricity customer\");\n\t\t\t\tSMRAccountDetails smrProfile = new TestDataHelper().getAllSMRUserProfile(\"SAPSMRGasUserforsingleMeter\");\n\t\t\t\t\t\t new SubmitMeterReadAction()\n\t\t\t\t\t\t .openSMRpage(\"Gas\")\n\t\t\t\t\t\t.verifyAnonymousSAPGasCustomersRewrite(smrProfile);\n\t\t\t\t}", "public interface ChargenClient {\n \n /**\n * Prints a message to the input stream.\n *\n * @param stream - a PrintStream that holds the buffer\n */\n public abstract void printToStream(PrintStream stream);\n}", "public interface Domainclient {\n public void investment();\n}", "@Test\n public void testGiveAccount() {\n System.out.println(\"giveAccount\");\n String name = \"Gert Hansen\";\n String address = \"Grønnegade 12\";\n String phone = \"98352010\";\n CustomerCtr instance = new CustomerCtr();\n int customerID = instance.createCustomer(name, address, phone);\n String type = \"Visa\";\n int regNo = 39292492;\n int cardNo = 457153253;\n instance.giveAccount(customerID, type, regNo, cardNo);\n Account result = instance.getCustomer(customerID).getAccount();\n assertNotNull(result);\n assertEquals(\"Visa\", result.getType());\n assertEquals(39292492, result.getRegNr());\n assertEquals(457153253, result.getCardNr());\n // TODO review the generated test code and remove the default call to fail.\n// fail(\"The test case is a prototype.\");\n }", "void initialize (ZyniAgent agent, Object ... args);", "public void testBaseCase() {\n\t\tConfig config = loadConfig(\"test/scenarios/equil/config.xml\");\n\t\tconfig.controler().setLastIteration(0);\n\t\tconfig.controler().setWritePlansInterval(0);\n\t\tControler controler = new Controler(config);\n\t\tcontroler.setCreateGraphs(false);\n\t\tcontroler.setDumpDataAtEnd(false);\n\t\tcontroler.getConfig().controler().setWriteEventsInterval(0);\n\t\tcontroler.run();\n\t\tPlanAlgorithm router = controler.createRoutingAlgorithm();\n\t\tassertFalse(\"BaseCase must not use area-toll router.\", router instanceof PlansCalcAreaTollRoute);\n\t\tTravelDisutility travelCosts = controler.createTravelCostCalculator();\n\t\tassertFalse(\"BaseCase must not use TollTravelCostCalculator.\", travelCosts instanceof TravelDisutilityIncludingToll);\n\t}", "public static void helloAgent(){\n\t\tHelloAgent agent = new HelloAgent();\r\n\t\r\n\t}", "public static void main(String[] args) {\n\t\tTestCricket tc=new TestCricket();\n\t\ttc.cricLogin();\n\n\t}", "@Test\r\n public void testRentOut() {\r\n }", "@Test\n public void seatsTest() {\n // TODO: test seats\n }", "public static void main(String[] args) {\n boolean deterministic = Arguments.parseArguments(args);\n\n Runtime rt = Runtime.instance();\n Profile p = new ProfileImpl();\n ContainerController container = rt.createAgentContainer(p);\n\n try {\n VehicleAgent[] vehicles = createVehicles(10,10,10);\n startVehicles(vehicles, container);\n\n ControlTowerAgent controlTowerAgent = new ControlTowerAgent();\n AgentController controlTower = container.acceptNewAgent(ControlTowerAgent.getDFName(), controlTowerAgent);\n LoggerHelper.get().logInfo(\"START - Started control tower\");\n controlTower.start();\n\n ClientAgent clientAgent = new ClientAgent(\"johnny\", ControlTowerAgent.getDFName(), deterministic);\n AgentController client = container.acceptNewAgent(clientAgent.getClientName(), clientAgent);\n String deterministicInfo = deterministic ? \"deterministic\" : \"random\";\n LoggerHelper.get().logInfo(\"CLIENT - Started \" + deterministicInfo + \" client \" + clientAgent.getClientName());\n client.start();\n } catch (StaleProxyException e) {\n e.printStackTrace();\n }\n }", "public CustomerTest()\n {\n }", "@Test\n public void consentsTest() {\n // TODO: test consents\n }", "public void testConstructor() {\n String name = \"moo\";\n String version = \"1.5\";\n\n Agent agent = new Agent(name, version);\n\n assertEquals(agent.getName(), name, \"Unexpected agent name.\");\n assertEquals(agent.getVersion(), version, \"Unexpected agent version.\");\n assertEquals(agent.toString(), name + \"/\" + version, \"Unexpected agent display representation.\");\n }", "public interface Coffee {\n void drink();\n}", "private ContestChannel createContestChannelForTest() {\r\n\r\n ContestChannel channel = new ContestChannel();\r\n channel.setContestChannelId(1L);\r\n channel.setDescription(\"desc\");\r\n return channel;\r\n }", "@Test\n public void testCrediCard() {\n PaymentInstrument instrument = new PaymentInstrument();\n instrument.setCardNumber(\"5424000000000015\");\n instrument.setCvv(\"999\");\n instrument.setMonth(\"12\");\n instrument.setYear(\"17\");\n\n PaymentGatewayRequest gatewayRequest = new PaymentGatewayRequest(\"Bying Test prodocut\", 6, instrument,300.00);\n gatewayRequest.setCustomerId(\"1419278590612\");\n gatewayRequest.setInvoiceNumber(\"INV0001\");\n gatewayRequest.setRefId(\"IN00021\");\n PaymentGatewayResponse process = authorizedNetGateway.process(gatewayRequest);\n\n LOG.debug(\"Response returend is \" + process);\n Assert.assertTrue(process.isSuccess());\n\n }", "public interface Comunicator {\n \n\n}", "public interface Colorizer\n {\n // TBD\n }", "public interface FeaturedDataAgent {\n\n /**\n * load feature from API.\n */\n void loadFeatured();\n}", "@Test\n public void agreementTest() {\n // TODO: test agreement\n }", "public AcuityTest() {\r\n }", "public static void main(String[] args) {\n\t\tCandyMachine cm = new CandyMachine(1);\r\n\t\tcm.printState();\r\n\t\tcm.insertCoin();\r\n\t\tcm.printState();\r\n\t\tcm.turnCrunk();\r\n\t\tcm.printState();\r\n\t\tcm.returnCoin();\r\n\t}", "public ClientInformationTest()\n {\n }", "@Test\n public void costTest() {\n // TODO: test cost\n }", "@Test\n public void loanWithChargesOfTypeAmountPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer percentageDisbursementCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanDisbursementJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\"));\n addCharges(charges, percentageDisbursementCharge, \"1\", null);\n\n Integer percentageSpecifiedDueDateCharge = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageSpecifiedDueDateCharge, \"1\", \"29 September 2011\");\n\n Integer percentageInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", false));\n addCharges(charges, percentageInstallmentFee, \"1\", \"29 September 2011\");\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_PERIODIC, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"120.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"120.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"149.11\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"29.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,\n GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n ArrayList<HashMap> loanTransactionDetails = LOAN_TRANSACTION_HELPER.getLoanTransactionDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n validateAccrualTransactionForDisbursementCharge(loanTransactionDetails);\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"120.00\"), JournalEntry.TransactionType.CREDIT));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.0\", \"120.00\", \"0.0\");\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3300.60\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageDisbursementCharge, loanCharges, \"1\", \"0.00\", \"120.00\", \"0.0\");\n validateCharge(percentageSpecifiedDueDateCharge, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"90.89\", \"29.11\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), \"29 October 2011\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"149.70\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(percentageInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentageInstallmentFee, loanCharges, \"1\", \"61.19\", \"29.11\", \"29.70\");\n\n /*\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount( assetAccount, \"20 September 2011\", new\n * JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.CREDIT));\n * JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount (expenseAccount, \"20 September 2011\", new\n * JournalEntry(Float.parseFloat(\"29.7\"), JournalEntry.TransactionType.DEBIT));\n */\n\n final String jobName = \"Add Accrual Transactions\";\n\n SCHEDULER_JOB_HELPER.executeAndAwaitJob(jobName);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n checkAccrualTransactions(loanSchedule, loanID);\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3271.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3271.49\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, \"1\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"29 September 2011\", \"1\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(percentagePenaltySpecifiedDueDate, loanCharges, \"1\", \"0.00\", \"120.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"120\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3300.60\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.78\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.78\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), \"10 January 2012\", \"1\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"120\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3240.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"120\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"120\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3120.58\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3120.58\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3120.58\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);\n }", "public interface GFac {\n\n /**\n * Initialized method, this method must call one time before use any other method.\n * @param experimentCatalog\n * @param appCatalog\n * @param curatorClient\n * @param publisher\n * @return\n */\n public boolean init(ExperimentCatalog experimentCatalog, AppCatalog appCatalog, CuratorFramework curatorClient, LocalEventPublisher publisher);\n\n /**\n * This is the job launching method outsiders of GFac can use, this will invoke the GFac handler chain and providers\n * And update the registry occordingly, so the users can query the database to retrieve status and output from Registry\n *\n * @param experimentID\n * @return boolean Successful acceptence of the jobExecution returns a true value\n * @throws GFacException\n */\n public boolean submitJob(String experimentID,String taskID, String gatewayID, String tokenId) throws GFacException;\n\n /**\n * This method can be used in a handler to ivvoke outhandler asynchronously\n * @param processContext\n * @throws GFacException\n */\n public void invokeOutFlowHandlers(ProcessContext processContext) throws GFacException;\n\n /**\n * This method can be used to handle re-run case asynchronously\n * @param processContext\n * @throws GFacException\n */\n public void reInvokeOutFlowHandlers(ProcessContext processContext) throws GFacException;\n\n /**\n * This operation can be used to cancel an already running experiment\n * @return Successful cancellation will return true\n * @throws GFacException\n */\n public boolean cancel(String experimentID, String taskID, String gatewayID, String tokenId)throws GFacException;\n\n}", "@Test\n public void testProxy() {\n Dell dell = new Dell();\n Proxy proxy = new Proxy(dell);\n proxy.salePc();\n }", "interface zacs\n{\n\n\tpublic abstract void zac(BasePendingResult basependingresult);\n}", "public void testLizard(){\n }", "public interface CreditCardStore\r\n{\r\n /**\r\n * This method should add the credit card number to the store given a pass key.\r\n *\r\n * @param cc The credit card number.\r\n * @param key The pass key.\r\n * @throws CreditCardAPIException if an error occurs.\r\n */\r\n public void addCc(String cc, String key) throws CreditCardAPIException;\r\n \r\n /**\r\n * This method should edit the credit card number in the store given a pass key.\r\n *\r\n * @param cc The credit card number.\r\n * @param key The pass key.\r\n * @throws CreditCardAPIException if an error occurs.\r\n */\r\n public void editCc(String cc, String key) throws CreditCardAPIException;\r\n \r\n /**\r\n * This method should delete the credit card number to the store given a pass key.\r\n *\r\n * @param cc The credit card number.\r\n * @param key The pass key.\r\n * @throws CreditCardAPIException if an error occurs.\r\n */\r\n public void deleteCc(String cc, String key) throws CreditCardAPIException;\r\n \r\n /**\r\n * This method should return the credit card number from the store given a pass key.\r\n *\r\n * @param key The pass key.\r\n * @return String\r\n * @throws CreditCardAPIException if an error occurs.\r\n */\r\n public String getCc(String key) throws CreditCardAPIException;\r\n}", "public interface AccountControlDataAgent {\n void loginUser(String phoneNo,String password);\n void RegisterUser(String phoneNo,String password,String name);\n}", "public static void main(String[] args) {\n\t\t\n\t\tHDFCBank hd= new HDFCBank();\n\t\thd.credit();\n\t\thd.debit();\n\t\thd.loan();\n\t\t\n\t\t\n\n\t}", "public interface Restaurant4Customer {\n\n\t/**\n\t * @param amount The cost that was not paid and is added to the amount owed by the customer\n\t *\n\t * Sent by the cashier if the customer does not have enough money to pay.\n\t */\n\tpublic abstract void msgPayNextTime(double amount);\n\n\tpublic abstract void msgAnimationFinishedGoToSeat();\n\n\tpublic abstract void msgAnimationFinishedGoToWaitingArea();\n\n\tpublic abstract void msgAnimationFinishedLeaveRestaurant();\n\n\tpublic abstract void gotHungry();\n\n\tpublic abstract Object getGui();\n\n\tpublic abstract void setWaiter(Restaurant4Waiter waiter);\n\n\tpublic abstract void msgRestaurantIsFull(int seat);\n\n\tpublic abstract void msgFollowMe(int table);\n\n\tpublic abstract void msgWhatDoYouWant();\n\n\tpublic abstract void msgChooseNewOrder();\n\n\tpublic abstract void msgHereIsYourFood();\n\n\tpublic abstract void msgHereIsYourCheck(double checkAmt);\n\n\tpublic abstract void setHost(Restaurant4Host h1);\n\n\tpublic abstract void setCashier(Restaurant4Cashier ca);\n\n}", "public Odi11AgentImpl() {\n }", "@Test\n public void testAddACopy() {\n }", "public interface Citizen {\n public abstract void sayHello();\n}", "public interface IPSAgent\n{\n /**\n * This method is the first one to be called by the Agent Manager just after\n * instantiating the implementing class object. This is called only once in\n * the object's life cycle.\n * @param configData - DOM Element representing the configuration data\n * defined in the configuration file. The implementor dictates the DTD for\n * the element depending on what he needs.\n * @throws PSAgentException if initialization fails for any reason\n */\n void init(Element configData) throws PSAgentException;\n\n /**\n * This method is the engine of the agent and called any time a service from\n * this agent is requested by the Agent Manager.\n * @param action - name of the action to be excuted by the agent.\n * @param params - Map (name, value pairs) of all parameters from the\n * request\n * @param response <code>IPSAgentHandlerResponse</code> object that can be\n * used to set the results of execution of the action. If the requested\n * action is not implmented or enough parameters are not supplied to execute\n * the action, the result can be set to error.\n */\n void executeAction(String action, Map params,\n IPSAgentHandlerResponse response);\n\n /**\n * This method is called by the Agent Manager while shuttingdown. May be\n * used to do any cleaning.\n */\n void terminate();\n}", "@Test\r\n\tpublic void client2() {\n\t}", "public interface ControllcurveService extends Service<Controllcurve> {\n\n}", "@Test\r\n public void testGetCost() {\r\n \r\n String regNo = \"ABC123\";\r\n instance = new Controller(dbMgr);\r\n int expResult = 60;\r\n int result = instance.getCost(regNo);\r\n assertEquals(expResult, result);\r\n \r\n }", "static void SampleItinerary() {\n\t\tSystem.out.println(\"\\n ***Everyone piles on the boat and goes to Molokai***\");\n\t\tbg.AdultRowToMolokai();\n\t\tbg.ChildRideToMolokai();\n\t\tbg.AdultRideToMolokai();\n\t\tbg.ChildRideToMolokai();\n\t}", "private DataClayMockObject() {\n\n\t}", "public AcceptanceTestRun() {\n }", "@Test\n public void testGetActions() {\n }", "@Given(\"a customer\")\n\tpublic void givenACustomer() {\n\t}", "@Test\n public void loanWithFlatCahargesAndUpfrontAccrualAccountingEnabled() {\n\n final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);\n ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);\n\n // Add charges with payment mode regular\n List<HashMap> charges = new ArrayList<>();\n Integer flatDisbursement = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC, ChargesHelper.getLoanDisbursementJSON());\n addCharges(charges, flatDisbursement, \"100\", null);\n Integer flatSpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", false));\n\n Integer flatInstallmentFee = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanInstallmentJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"50\", false));\n addCharges(charges, flatInstallmentFee, \"50\", null);\n\n final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();\n final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();\n final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();\n final Account overpaymentAccount = ACCOUNT_HELPER.createLiabilityAccount();\n\n List<HashMap> collaterals = new ArrayList<>();\n\n final Integer collateralId = CollateralManagementHelper.createCollateralProduct(REQUEST_SPEC, RESPONSE_SPEC);\n Assertions.assertNotNull(collateralId);\n final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(REQUEST_SPEC, RESPONSE_SPEC,\n String.valueOf(clientID), collateralId);\n Assertions.assertNotNull(clientCollateralId);\n addCollaterals(collaterals, clientCollateralId, BigDecimal.valueOf(1));\n\n final Integer loanProductID = createLoanProduct(false, ACCRUAL_UPFRONT, assetAccount, incomeAccount, expenseAccount,\n overpaymentAccount);\n final Integer loanID = applyForLoanApplication(clientID, loanProductID, charges, null, \"12,000.00\", collaterals);\n Assertions.assertNotNull(loanID);\n HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);\n\n ArrayList<HashMap> loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n verifyLoanRepaymentSchedule(loanSchedule);\n\n List<HashMap> loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"200.00\", \"0.0\", \"0.0\");\n\n // check for disbursement fee\n HashMap disbursementDetail = loanSchedule.get(0);\n validateNumberForEqual(\"100.00\", String.valueOf(disbursementDetail.get(\"feeChargesDue\")));\n\n // check for charge at specified date and installment fee\n HashMap firstInstallment = loanSchedule.get(1);\n validateNumberForEqual(\"50.00\", String.valueOf(firstInstallment.get(\"feeChargesDue\")));\n\n // check for installment fee\n HashMap secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"50.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n\n LOG.info(\"-----------------------------------APPROVE LOAN-----------------------------------------\");\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.approveLoan(\"20 September 2011\", loanID);\n LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);\n LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap);\n\n LOG.info(\"-------------------------------DISBURSE LOAN-------------------------------------------\");\n String loanDetails = LOAN_TRANSACTION_HELPER.getLoanDetails(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.disburseLoanWithNetDisbursalAmount(\"20 September 2011\", loanID,\n JsonPath.from(loanDetails).get(\"netDisbursalAmount\").toString());\n LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);\n\n final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"200.00\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"12000.00\"), JournalEntry.TransactionType.DEBIT) };\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 September 2011\", assetAccountInitialEntry);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"20 September 2011\",\n new JournalEntry(Float.parseFloat(\"605.94\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT),\n new JournalEntry(Float.parseFloat(\"200.00\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), \"29 September 2011\", \"100\"));\n\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"100.00\", \"0.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"29 September 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.DEBIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForIncomeAccount(incomeAccount, \"29 September 2011\",\n new JournalEntry(Float.parseFloat(\"100.00\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"-------------Make repayment 1-----------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 October 2011\", Float.parseFloat(\"3301.49\"), loanID);\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatDisbursement, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatSpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"150.00\", \"50.0\", \"0.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), \"29 October 2011\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"150.00\", String.valueOf(secondInstallment.get(\"feeChargesDue\")));\n LOG.info(\"----------- Waive installment charge for 2nd installment ---------\");\n LOAN_TRANSACTION_HELPER.waiveChargesForLoan(loanID, (Integer) getloanCharge(flatInstallmentFee, loanCharges).get(\"id\"),\n LoanTransactionHelper.getWaiveChargeJSON(String.valueOf(2)));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatInstallmentFee, loanCharges, \"50\", \"100.00\", \"50.0\", \"50.0\");\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"50.0\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"50.0\"), JournalEntry.TransactionType.DEBIT));\n\n LOG.info(\"----------Make repayment 2------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3251.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3251.49\"), JournalEntry.TransactionType.CREDIT));\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"0\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"--------------Waive interest---------------\");\n LOAN_TRANSACTION_HELPER.waiveInterest(\"20 December 2011\", String.valueOf(61.79), loanID);\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap thirdInstallment = loanSchedule.get(3);\n validateNumberForEqual(\"60.59\", String.valueOf(thirdInstallment.get(\"interestOutstanding\")));\n\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForExpenseAccount(expenseAccount, \"20 December 2011\",\n new JournalEntry(Float.parseFloat(\"61.79\"), JournalEntry.TransactionType.DEBIT));\n\n Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,\n ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, \"100\", true));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"29 September 2011\", \"100\"));\n loanCharges.clear();\n loanCharges = LOAN_TRANSACTION_HELPER.getLoanCharges(loanID);\n validateCharge(flatPenaltySpecifiedDueDate, loanCharges, \"100\", \"0.00\", \"100.0\", \"0.0\");\n\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n secondInstallment = loanSchedule.get(2);\n validateNumberForEqual(\"100\", String.valueOf(secondInstallment.get(\"totalOutstandingForPeriod\")));\n\n // checking the journal entry as applied penalty has been collected\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 October 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n\n LOG.info(\"----------Make repayment 3 advance------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 November 2011\", Float.parseFloat(\"3301.49\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 November 2011\",\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3301.49\"), JournalEntry.TransactionType.CREDIT));\n LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper\n .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), \"10 January 2012\", \"100\"));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n HashMap fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"100\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3239.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Pay applied penalty ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"100\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"100\"), JournalEntry.TransactionType.CREDIT));\n loanSchedule.clear();\n loanSchedule = LOAN_TRANSACTION_HELPER.getLoanRepaymentSchedule(REQUEST_SPEC, RESPONSE_SPEC, loanID);\n fourthInstallment = loanSchedule.get(4);\n validateNumberForEqual(\"0\", String.valueOf(fourthInstallment.get(\"penaltyChargesOutstanding\")));\n validateNumberForEqual(\"3139.68\", String.valueOf(fourthInstallment.get(\"totalOutstandingForPeriod\")));\n\n LOG.info(\"----------Make over payment for repayment 4 ------------\");\n LOAN_TRANSACTION_HELPER.makeRepayment(\"20 January 2012\", Float.parseFloat(\"3220.60\"), loanID);\n JOURNAL_ENTRY_HELPER.checkJournalEntryForAssetAccount(assetAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"3220.60\"), JournalEntry.TransactionType.DEBIT),\n new JournalEntry(Float.parseFloat(\"3139.68\"), JournalEntry.TransactionType.CREDIT));\n JOURNAL_ENTRY_HELPER.checkJournalEntryForLiabilityAccount(overpaymentAccount, \"20 January 2012\",\n new JournalEntry(Float.parseFloat(\"80.92\"), JournalEntry.TransactionType.CREDIT));\n loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, \"status\");\n LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap);\n }", "public void testSpock(){\n }", "public static void main(String [] args) {\r\n \r\n new CardsClient();\r\n \r\n }", "DefaultAgent(Controller controller) {\r\n\t\tthis.controller = controller;\r\n\t}", "public static void main(String[] args) {\n\n CashRegister cassa1 = new CashRegister();\n\n cassa1.getPrice(3.50);\n cassa1.getPrice(4.0);\n cassa1.getPrice(55.75);\n\n double total = cassa1.getTotal();\n String change = cassa1.getChange(200);\n\n System.out.println(total);\n System.out.println(change);\n\n }", "@Test\n public void testCreateCustomer() {\n System.out.println(\"createCustomer\");\n String name = \"Gert Hansen\";\n String address = \"Grønnegade 12\";\n String phone = \"98352010\";\n CustomerCtr instance = new CustomerCtr();\n int customerID = instance.createCustomer(name, address, phone);\n Customer result = instance.getCustomer(customerID);\n assertEquals(\"Gert Hansen\", result.getName());\n assertEquals(\"Grønnegade 12\", result.getAddress());\n assertEquals(\"98352010\", result.getPhone());\n // TODO review the generated test code and remove the default call to fail.\n// fail(\"The test case is a prototype.\");\n }" ]
[ "0.60757816", "0.58433324", "0.5831298", "0.5801079", "0.5792243", "0.5771532", "0.5770693", "0.5746383", "0.5709868", "0.57039803", "0.56801814", "0.56555516", "0.56343997", "0.5567539", "0.5563684", "0.55627614", "0.55593187", "0.5472155", "0.5455134", "0.54501474", "0.5427519", "0.54231006", "0.5401335", "0.5380306", "0.5374294", "0.5361435", "0.5349157", "0.5348659", "0.5345949", "0.5341139", "0.5335771", "0.53333753", "0.53258276", "0.53077286", "0.53048414", "0.5301704", "0.525818", "0.5255292", "0.52482593", "0.52283967", "0.52220535", "0.52110136", "0.5196941", "0.5196917", "0.5192522", "0.51831377", "0.5182038", "0.5176102", "0.5165048", "0.51637626", "0.5161625", "0.5157513", "0.51500314", "0.51446015", "0.5144401", "0.5139791", "0.5137551", "0.5134436", "0.5127897", "0.51208997", "0.51198393", "0.51174337", "0.51141715", "0.51073104", "0.5101569", "0.5099362", "0.50993323", "0.5095191", "0.5093811", "0.50903994", "0.50877255", "0.5087089", "0.50835663", "0.5081324", "0.50808424", "0.5080447", "0.5080252", "0.5073412", "0.50732243", "0.50721294", "0.506519", "0.50554454", "0.5054562", "0.5047103", "0.5046929", "0.5041699", "0.50410455", "0.50410175", "0.5038928", "0.5035334", "0.50351375", "0.50330174", "0.5027573", "0.50186396", "0.5016179", "0.5014491", "0.50076884", "0.50072026", "0.5000979", "0.5000563" ]
0.66031045
0
Sent from waiter to computer a bill for a customer
public abstract void msgComputeBill(String choice, Customer c, Waiter w, int tableNumber, Map<String, Double> menu);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void msgPayment(Customer customer, Cash cash);", "private void handleConfirmBillPayment() {\n\t\t// TODO Auto-generated method stub\n\t\ttry {\n\t\t\tPaymentBiller request = new PaymentBiller();\n\t\t\tObjectFactory f = new ObjectFactory();\n\t\t\tCommonParam2 commonParam = f.createCommonParam2();\n\t\t\t\n\t\t\tcommonParam.setProcessingCode(f.createCommonParam2ProcessingCode(\"100601\"));\n\t\t\tcommonParam.setChannelId(f.createCommonParam2ChannelId(\"6018\"));\n\t\t\tcommonParam.setChannelType(f.createCommonParam2ChannelType(\"PB\"));\n\t\t\tcommonParam.setNode(f.createCommonParam2Node(\"WOW_CHANNEL\"));\n\t\t\tcommonParam.setCurrencyAmount(f.createCommonParam2CurrencyAmount(\"IDR\"));\n\t\t\tcommonParam.setAmount(f.createCommonParam2Amount(String.valueOf(billPayBean.getBillAmount())));\n\t\t\tcommonParam.setCurrencyfee(f.createCommonParam2Currencyfee(billPayBean.getFeeCurrency()));\n\t\t\tcommonParam.setFee(f.createCommonParam2Fee(String.valueOf(billPayBean.getFeeAmount())));\n\t\t\tcommonParam.setTransmissionDateTime(f.createCommonParam2TransmissionDateTime(PortalUtils.getSaveXMLGregorianCalendar(Calendar.getInstance()).toXMLFormat()));\n\t\t\tcommonParam.setRequestId(f.createCommonParam2RequestId(MobiliserUtils.getExternalReferenceNo(isystemEndpoint)));\n\t\t\tcommonParam.setAcqId(f.createCommonParam2AcqId(\"213\"));\n\t\t\tcommonParam.setReferenceNo(f.createCommonParam2ReferenceNo(String.valueOf(billPayBean.getReferenceNumber())));\n\t\t\tcommonParam.setTerminalId(f.createCommonParam2TerminalId(\"WOW\"));\n\t\t\tcommonParam.setTerminalName(f.createCommonParam2TerminalName(\"WOW\"));\n\t\t\tcommonParam.setOriginal(f.createCommonParam2Original(billPayBean.getAdditionalData()));\n\t\t\t\n\t\t\trequest.setCommonParam(commonParam);\n\t\t\tPhoneNumber phone = new PhoneNumber(this.getMobiliserWebSession().getBtpnLoggedInCustomer().getUsername());\n\t\t\trequest.setAccountNo(phone.getNationalFormat());\n\t\t\trequest.setBillerCustNo( billPayBean.getSelectedBillerId().getId()); \n\t\t\trequest.setDebitType(\"0\");\n\t\t\trequest.setInstitutionCode(billPayBean.getBillerId());\n\t\t\trequest.setProductID(billPayBean.getProductId());\n\t\t\trequest.setUnitId(\"0901\");\n\t\t\trequest.setProcessingCodeBiller(\"501000\");\n\t\t\t\n\t\t\tString desc1=\"Bill Payment\";\n\t\t\tString desc2= billPayBean.getBillerId();\n\t\t\tString desc3=\"\";\n\t\t\t\n\t\t\trequest.setAdditionalData1(desc1);\n\t\t\trequest.setAdditionalData2(desc2);\n\t\t\trequest.setAdditionalData3(desc3);\n\t\t\t\n\t\t\tPaymentBillerResponse response = new PaymentBillerResponse();\n\t\t\t\n\t\t\tresponse = (PaymentBillerResponse) webServiceTemplete.marshalSendAndReceive(request, \n\t\t\t\t\tnew WebServiceMessageCallback() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void doWithMessage(WebServiceMessage message) throws IOException,\n\t\t\t\t\t\tTransformerException {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t((SoapMessage) message)\n\t\t\t\t\t.setSoapAction(\"com_btpn_biller_ws_provider_BtpnBillerWsTopup_Binder_paymentBiller\");\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tif (response.getResponseCode().equals(\"00\")) {\n\t\t\t\tbillPayBean.setStatusMessage(getLocalizer().getString(\"success.perform.billpayment\", this));\n\t\t\t\tsetResponsePage(new BankBillPaymentStatusPage(billPayBean));\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(MobiliserUtils.errorMessage(response.getResponseCode(), response.getResponseDesc(), getLocalizer(), this));\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\terror(getLocalizer().getString(\"error.exception\", this));\n\t\t\tLOG.error(\"An exception was thrown\", e);\n\t\t}\n\t}", "public PhoneBill(String customerName) {\n this.customerName = customerName;\n }", "public void generateBill(){\n System.out.println(\" Supermercado la 33 \");\n System.out.println(getName());\n System.out.println(getId());\n System.out.println(LocalDate.now() + \" -- \" +LocalTime.now());\n //System.out.println(\"Cantidad Denominacion nombre precio \");\n for (int i=0; i<bill.getProducts().size(); i++){\n Product temporal = bill.getProducts().get(i);\n System.out.println(temporal.getAvailableQuantity().getAmount() + \" \" + temporal.getAvailableQuantity().getProductDenomination() + \" \"\n + temporal.getName() + \" \" + temporal.getAvailableQuantity().getAmount() * temporal.getPrice());\n }\n System.out.println(\"Total : \" + bill.calculateTotal());\n System.out.println(\" Gracias por su compra vuelva pronto \");\n\n }", "static String serve(Customer customer) {\r\n\t\tString serviceReport = String.format(\r\n\t\t\t\"%d: %s %s arrived at %s to %s $%.2f and spoke to teller %d. Current balance: $%.2f\",\r\n\t\t\tcustomer.customerId,\r\n\t\t\tcustomer.firstName,\r\n\t\t\tcustomer.lastName,\r\n\t\t\tCustomerFunctions.getTime(customer.arrivalTime),\r\n\t\t\tCustomerFunctions.transactionTypeString(customer.transactionType),\r\n\t\t\tcustomer.transactionAmount,\r\n\t\t\tcustomer.tellerNo,\r\n\t\t\tcustomer.balance\r\n\t\t\t);\r\n\r\n\t\t// Perform deposit / withdrawl on customer account\r\n\t\tif (customer.transactionType == 'D') customer.balance += customer.transactionAmount;\r\n\t\telse customer.balance -= customer.transactionAmount;\r\n\r\n\t\tserviceReport += String.format(\r\n\t\t\t\", New balance: $%.2f, Wait time: %d minutes%n%n\",\r\n\t\t\tcustomer.balance,\r\n\t\t\tcustomer.serviceTime\r\n\t\t\t);\r\n\r\n\t\t// Add to teller totals\r\n\t\ttellerCount[customer.tellerNo - 1] += 1;\r\n\t\tif (customer.transactionType == 'D') tellerDeposits[customer.tellerNo - 1] += customer.transactionAmount;\r\n\t\telse tellerWithdrawls[customer.tellerNo-1] += customer.transactionAmount;\r\n\r\n\t\treturn serviceReport;\r\n\t}", "private void takeOrder(MyCustomer customer) {\n\tDo(\"Taking \" + customer.cmr +\"'s order.\");\n\tPosition tablePos = new Position(tables[customer.tableNum].getX()-1,\n\t\t\t\t\t tables[customer.tableNum].getY()+1);\n\tguiMoveFromCurrentPostionTo(tablePos);\n\tcustomer.state = CustomerState.NO_ACTION;\n\tcustomer.cmr.msgWhatWouldYouLike();\n\tstateChanged();\n }", "public void ventaBilleteMaquina1()\n {\n maquina1.insertMoney(500);\n maquina1.printTicket();\n }", "public Result notifyAllCustomer(Long productID) {\n Coupons coupon = formFactory.form(Coupons.class).bindFromRequest().get();\n List<UserInfo> customers = Product.find.byId(productID).purchaser;\n CouponSendCenter sender = CouponSendCenter.find.byId(session().get(\"email\"));\n\n coupon.sender = sender;\n sender.coupon.add(coupon);\n sender.productID = Product.find.byId(productID).name;\n sender.update();\n\n for(int i = 0; i < customers.size(); i++) {\n CouponReceiveCenter receiver = CouponReceiveCenter.find.byId(customers.get(i).emailID);\n coupon.receiver.add(receiver);\n }\n coupon.save();\n\n return GO_HOME;\n }", "Receipt chargeOrder(PizzaOrder order, CreditCard creditCard);", "void requestTicket(String customerName)\n {\n\ttc.customerName = customerName;\n\ttc.run(); // Sells ticket. Prints ticket to console.\n }", "@Override\n\tpublic void gatherRetailCustomerInfo(RetailCustomer retailCustomer) {\n\t\tretailCustomerUserBill = new Billing();\n\t\tthis.retailCustomer = retailCustomer;\n\t}", "private void pay() {\r\n System.out.println(\"Customer sent payment\");\r\n }", "private void giveFoodToCustomer(MyCustomer customer) {\n\tDo(\"Giving finished order of \" + customer.choice +\" to \" + customer.cmr);\n\tPosition inFrontOfGrill = new Position(customer.food.getX()-1,customer.food.getY());\n\tguiMoveFromCurrentPostionTo(inFrontOfGrill);//in front of grill\n\twaiter.pickUpFood(customer.food);\n\tPosition tablePos = new Position(tables[customer.tableNum].getX()-1,\n\t\t\t\t\t tables[customer.tableNum].getY()+1);\n\tguiMoveFromCurrentPostionTo(tablePos);\n\twaiter.serveFood(tables[customer.tableNum]);\n\tcustomer.state = CustomerState.NO_ACTION;\n\tcustomer.cmr.msgHereIsYourFood(customer.choice);\n\tstateChanged();\n }", "public int calculateBill() {\n\t\treturn chargeVehicle(); \n\t}", "public static int placeBill(String customerName, String customerMobileNumber, int tableNumber) {\n\t\tDate date = new Date();\n\n\t\tString leftAlignFormat = \"| %-4d | %-25s | %-4d |%n\";\n\t\tint i = 0, bill = 0;\n\t\tSystem.out.format(\"+-----------------------------------------+%n\");\n\t\tSystem.out.format(\"+--------------------BILL-----------------+%n\");\n\t\tSystem.out.format(\"+-----------------------------------------+%n\");\n\t\tSystem.out.println(\"Bill Issued=> \" + date);\n\t\tSystem.out.println(\"Customer Name=> \" + customerName);\n\t\tSystem.out.println(\"Customer Mobile Number=> \" + customerMobileNumber);\n\t\tSystem.out.println(\"Customer Table Number=> \" + tableNumber);\n\t\tSystem.out.format(\"+-----------------------------------------+%n\");\n\t\tSystem.out.format(\"+------+---------------------------+------+%n\");\n\t\tSystem.out.format(\"|S.No. | Food Item |Price |%n\");\n\t\tSystem.out.format(\"+------+---------------------------+------+%n\");\n\t\tfor (Integer foodItem : order) {\n\t\t\ti++;\n\t\t\tSystem.out.format(leftAlignFormat, i, Menu.getDishName(foodItem), Menu.getDishPrice(foodItem));\n\t\t\tbill += Menu.getDishPrice(foodItem);\n\n\t\t}\n\t\tSystem.out.format(\"+------+---------------------------+------+%n\");\n\t\tSystem.out.println(\"Total Amount=> \" + bill + \"/-\");\n\t\tSystem.out.println(\"Thank you for shopping\");\n\t\tSystem.out.format(\"+------+---------------------------+------+%n\");\n\t\treturn bill;\n\t}", "@Override\n\tpublic String printBillInvoice(Billing bill) {\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tstringBuilder.append(\"RetailCustomer Details:\");\n\t\tstringBuilder.append(retailCustomer);\n\t\tstringBuilder.append(\"Shop the following:\");\n\t\tstringBuilder.append(bill.getOnlineShoppingCartItem());\n\t\tstringBuilder.append(\" Total Bill Amount : \");\n\t\tstringBuilder.append(bill.getTotalBill());\n\t\tstringBuilder.append(\" Bill Amount After RetailCustomer Discount:\");\n\t\tstringBuilder.append(bill.getTotalBillAfterRetailCustomerTypeDiscount());\n\t\tstringBuilder.append(\" Bill Amount After final Discount:\");\n\t\tstringBuilder.append(bill.getTotalBillCost());\n\t\treturn stringBuilder.toString();\n\t}", "private void giveOrderToCook(MyCustomer customer) {\n\tDo(\"Giving \" + customer.cmr + \"'s choice of \" + customer.choice + \" to cook\");\n\tcustomer.state = CustomerState.NO_ACTION;\n\tcook.msgHereIsAnOrder(this, customer.tableNum, customer.choice);\n\tstateChanged();\n }", "private static CreditRequest getRequestDataFromCustomer() {\n\t\treturn new CreditRequest(0, new Vector<Warrantor>(), null, null, null, null);\n\t}", "public void ventaBilleteMaquina2()\n {\n maquina2.insertMoney(600);\n maquina1.printTicket();\n }", "public _179._6._235._119.cebwebservice.Bill billing_CalculateDetailMonthlyBill(java.lang.String accessToken, int tariff, int kwh) throws java.rmi.RemoteException;", "public String getBillSouce() {\n return billSouce;\n }", "public void checkOut(Customer customer) {\n\n customer.greetCustomer();\n System.out.println(\"--------------------------------------\");\n\n // Tussentotaalprijs berekenen en printen\n int firstTotalPrice = calculateTotalPrice(customer.basket);\n\n System.out.println(\"Het tussentotaal is: \" + firstTotalPrice + \" euro\");\n\n // Korting berekenen\n int discount = calculateDiscount(customer.basket);\n\n //int finalTotalPrice = calculateEndPrice(firstTotalPrice, discount);\n }", "public void msgImReadyToOrder(CustomerAgent customer){\n\t//print(\"received msgImReadyToOrder from:\"+customer);\n\tfor(int i=0; i < customers.size(); i++){\n\t //if(customers.get(i).cmr.equals(customer)){\n\t if (customers.get(i).cmr == customer){\n\t\tcustomers.get(i).state = CustomerState.READY_TO_ORDER;\n\t\tstateChanged();\n\t\treturn;\n\t }\n\t}\n\tSystem.out.println(\"msgImReadyToOrder in WaiterAgent, didn't find him?\");\n }", "@Override\r\n\tpublic void fundTransfer(String sender, String reciever, double amount) {\n\t\t\r\n\t\tString name, newMobileNo;\r\n\t\tfloat age;\r\n\t\tdouble amountFund;\r\n\t\t\r\n\t\tCustomer custSender = custMap.get(sender);\r\n\t\tCustomer custReciever = custMap.get(reciever);\r\n\t\t\r\n\t\tdouble recieverAmount = custReciever.getInitialBalance();\r\n\t\tdouble senderAmount = custSender.getInitialBalance();\r\n\t\tif(senderAmount - amount > 500){\r\n\t\t\trecieverAmount += amount;\r\n\t\t\tsenderAmount -= amount;\r\n\t\t\tSystem.out.println(\"Fund Transferred\");\r\n\t\t}\r\n\t\tname = custSender.getName();\r\n\t\tnewMobileNo = custSender.getMobileNo();\r\n\t\tage = custSender.getAge();\r\n\t\tamountFund = senderAmount;\r\n\t\t\r\n\t\tcustSender.setAge(age);\r\n\t\tcustSender.setInitialBalance(senderAmount);\r\n\t\tcustSender.setMobileNo(newMobileNo);\r\n\t\tcustSender.setName(name);\r\n\t\t\r\n\t\tcustMap.put(newMobileNo, custSender);\r\n\t\t\r\n\t\tname = custReciever.getName();\r\n\t\tnewMobileNo = custReciever.getMobileNo();\r\n\t\tage = custReciever.getAge();\r\n\t\tamountFund = recieverAmount;\r\n\t\t\r\n\t\tcustReciever.setAge(age);\r\n\t\tcustReciever.setInitialBalance(recieverAmount);\r\n\t\tcustReciever.setMobileNo(newMobileNo);\r\n\t\tcustReciever.setName(name);\r\n\t\t\r\n\t\tcustMap.put(newMobileNo, custReciever);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public Bill getBill() {\n return bill;\n }", "public void cashReceipt(int amount){\r\n System.out.println(\"Take the receipt\");\r\n }", "SerialResponse createCustomer(PinCustomerPost pinCustomerPost);", "public Long getBillNo() {\n return billNo;\n }", "private void calculateBill() {\n\t\tif (unit <= 100) {\r\n\t\t\tbill = unit * 5;\r\n\t\t}else if(unit<=200){\r\n\t\t\tbill=((unit-100)*7+500);\r\n\t\t}else if(unit<=300){\r\n\t\t\tbill=((unit-200)*10+1200);\r\n\t\t}else if(unit>300){\r\n\t\t\tbill=((unit-300)*15+2200);\r\n\t\t}\r\n\t\tSystem.out.println(\"EB amount is :\"+bill);\r\n\t}", "public void msgSitCustomerAtTable(CustomerAgent customer, int tableNum){\n\tMyCustomer c = new MyCustomer(customer, tableNum);\n\tc.state = CustomerState.NEED_SEATED;\n\tcustomers.add(c);\n\tstateChanged();\n }", "@Override\n\tpublic void msgAtCashier() {\n\t\t\n\t}", "private void sendBucks() {\n\t\tint userid = userID;\n\n\t\tfor (int i = 0; i < userServices.getAllUsers().length; i++) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"User: \" + userList.get(i).getId() + \"\\t\" + \"username: \" + userList.get(i).getUsername() + \"\\n\");\n\t\t}\n\n\t\tSystem.out.println(\"Select and ID you want to send TE Bucks to: \\n\");\n\n\t\tint sendTo = Integer.parseInt(scan.nextLine());\n\n\t\tSystem.out.println(\"How much money?\");\n\t\tBigDecimal money = (new BigDecimal(scan.nextLine()));\n\n\t\ttry {\n\t\t\tif (accountServices.getBalanceByAccountID(userid).compareTo(money) < 0) {\n\t\t\t\tSystem.out.println(\"You do not have enough funds to make transfer\");\n\t\t\t\tsendBucks();\n\n\t\t\t}\n\t\t} catch (AccountsServicesException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t\tTransfers holder = sendTransfer(userid, sendTo, money);\n\t\taccountServices.sendMoney(userid, holder);\n\n\t\ttry {\n\t\t\tSystem.out.println(\"$\" + money + \" sent to \" + sendTo);\n\t\t\tSystem.out.println(\"New balance: $\" + accountServices.getBalanceByAccountID(userid));\n\t\t} catch (AccountsServicesException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public BackOrder(Customer customer, Washer washer, int quantity) {\r\n\t\tthis.customer = customer;\r\n\t\tthis.washer = washer;\r\n\t\tthis.quantity = quantity;\r\n\t}", "@Override\r\n\tpublic void billGenerate() {\n\t\t\r\n\t}", "@Override\n\tpublic void notifyCustomer() {\n\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\"Customer Credit has been Charged more than $400\", \"Warning\",\n\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t}", "public void setCustomerPurchase(double purchase) { this.customerPurchase = purchase; }", "public void purchase() {\r\n\t\tdo {\r\n\t\t\tString id = getToken(\"Enter customer id: \");\r\n\t\t\tString brand = getToken(\"Enter washer brand: \");\r\n\t\t\tString model = getToken(\"Enter washer model: \");\r\n\t\t\tint quantity = getInteger(\"Enter quantity to purchase: \");\r\n\t\t\tboolean purchased = store.purchaseWasher(id, brand, model, quantity);\r\n\t\t\tif (purchased) {\r\n\t\t\t\tSystem.out.println(\"Purchased \" + quantity + \" of \" + brand + \" \" + model + \" for customer \" + id);\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Purchase unsuccessful.\");\r\n\t\t\t}\r\n\t\t} while (yesOrNo(\"Make another Purchase?\"));\r\n\t}", "public void credit(){\n\t\tSystem.out.println(\"HSBC BANK :: CREDIT\");\n\t}", "private void sendBucks() {\n\t\tconsole.printUsers(userService.getAll(currentUser.getToken()));\n\t\tSystem.out.println(\"\");\n\n\t\tBoolean validResponse = false;\n\t\tint selectedUserId = -1;\n\t\tBigDecimal transferAmount = new BigDecimal(0);\n\t\tBigDecimal zero = new BigDecimal(0);\n\t\tBigDecimal currentBalance = (accountService.getAccountBalance(currentUser.getToken()));\n\t\tTransfer transfer = new Transfer();\n\n\t\twhile (true) {\n\t\t\t// ask which user you want to send money to or exit\n\t\t\tselectedUserId = console.getUserInputInteger(\"Enter ID of user you are sending to (0 to cancel)\");\n\t\t\tif (selectedUserId == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (selectedUserId > 0 && selectedUserId <= userService.getAll(currentUser.getToken()).length) {\n\t\t\t\t// prompt for amount to send\n\t\t\t\ttransferAmount = console.getUserInputBigDecimal(\"Enter amount\");\n\t\t\t\t// transfer money\n\n\t\t\t\tif (transferAmount.compareTo(zero) == 1 && transferAmount.compareTo(currentBalance) <= 0) {\n\n\t\t\t\t\ttransfer.setFromUserId(currentUser.getUser().getId());\n\t\t\t\t\ttransfer.setToUserId(selectedUserId);\n\t\t\t\t\ttransfer.setTransferAmount(transferAmount);\n\t\t\t\t\ttransfer.setStatusOfTransferId(2);\n\t\t\t\t\ttransfer.setTypeOfTransferId(2);\n\n\t\t\t\t\t\n\t\t\t\t\ttransferService.createTransfer(currentUser.getToken(), transfer);\n\t\t\t\t\tSystem.out.println(\"\\nTransfer Complete!\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println(\"\\nInsufficient Funds! Please try again.\\n\");\n\n\t\t\t}\n\t\t}\n\n\t}", "public void addCustomerMoney(Coin c){\n customerMoney.add(c);\n }", "public void notifyCustomer(String message) {}", "private void sendBucks() {\n\t\ttry {\n\t\t\tSystem.out.println(\"Please choose a user to send TE Bucks to:\");\n\t\t\tUser toUser;\n\t\t\tboolean isValidUser;\n\t\t\tdo {\n\t\t\t\ttoUser = (User)console.getChoiceFromOptions(userService.getUsers());\n\t\t\t\tisValidUser = ( toUser\n\t\t\t\t\t\t\t\t.getUsername()\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(currentUser.getUser().getUsername())\n\t\t\t\t\t\t\t ) ? false : true;\n\n\t\t\t\tif(!isValidUser) {\n\t\t\t\t\tSystem.out.println(\"You can not send money to yourself\");\n\t\t\t\t}\n\t\t\t} while (!isValidUser);\n\t\t\t\n\t\t\t// Select an amount\n\t\t\tBigDecimal amount = new BigDecimal(\"0.00\");\n\t\t\tboolean isValidAmount = false;\n\t\t\tdo {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tamount = new BigDecimal(console.getUserInput(\"Enter An Amount (0 to cancel):\\n \"));\n\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\tSystem.out.println(\"Please enter a numerical value\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tisValidAmount = amount.doubleValue() < userService\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getBalance(currentUserId)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.doubleValue();\n\t\t\t\tif(!isValidAmount) {\n\t\t\t\t\tSystem.out.println(\"You can not send more money than you have available!\");\n\t\t\t\t}\n\t\t\t\tif(amount.doubleValue() < 0.99 && amount.doubleValue() > 0.00) {\n\t\t\t\t\tSystem.out.println(\"You must send at least $0.99 TEB\");\n\t\t\t\t\tisValidAmount = false;\n\t\t\t\t} else if (amount.doubleValue() == 0.00) {\n\t\t\t\t\tmainMenu();\n\t\t\t\t}\n\t\t\t} while(!isValidAmount);\n\n\t\t\t// Create transfer object\n\t\t\tboolean confirmedAmount = false;\n\t\t\tString confirm = \"\";\n\t\t\tTransfer transfer = null;\n\t\t\twhile (!confirmedAmount) {\n\t\t\t\tconfirm = console.getUserInput(\"You entered: \" + amount.toPlainString() + \" TEB. Is this correct? (y/n)\");\n\t\t\t\tif (confirm.toLowerCase().startsWith(\"y\")) {\n\t\t\t\t\t// transferService to POST to server db\n\t\t\t\t\ttransfer = createTransferObj(\"Send\", \"Approved\", currentUserId, toUser.getId(), amount);\n\t\t\t\t\tboolean hasSent = transferService.sendBucks(currentUserId, toUser.getId(), transfer);\n\t\t\t\t\tif (hasSent) {\n\t\t\t\t\t\t// TODO :: Test this\n\t\t\t\t\t\tSystem.out.println(\"The code executed\");\n\t\t\t\t\t}\n\t\t\t\t\tconfirmedAmount = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Send canceled.\");\n\t\t\t\t\tconfirmedAmount = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t} \n\t\t\t}\n\t\t}catch(UserServiceException ex) {\n\t\t\tSystem.out.println(\"User Service Exception\");\n\t\t}catch(TransferServiceException ex) {\n\t\t\tSystem.out.println(\"Transfer Service Exception\");\n\t\t}\n\t\t\n\t}", "public void setBillNo(Long billNo) {\n this.billNo = billNo;\n }", "@Async\n public boolean sendTransferFromNotificationSMS(Customer source, Customer dest, Double rewardQty, RewardCurrency rewardCurrency, MessageWrapper messageWrapper) throws InspireNetzException {\n HashMap<String,String> fields = new HashMap<>(0);\n\n // Add the qty\n fields.put(\"#qty\",generalUtils.getFormattedValue(rewardQty));\n\n // Add the currencyname\n fields.put(\"#currencyname\",rewardCurrency.getRwdCurrencyName());\n\n // Add the recepient name\n fields.put(\"#receipientname\",dest.getCusLoyaltyId());\n\n /* // Get the reward balance\n CustomerRewardBalance customerRewardBalance = customerRewardBalanceService.findByCrbLoyaltyIdAndCrbMerchantNoAndCrbRewardCurrency(source.getCusLoyaltyId(),source.getCusMerchantNo(),rewardCurrency.getRwdCurrencyId());\n*/\n //get the reward balance\n List<CustomerRewardBalance> customerRewardBalances = customerRewardBalanceService.searchBalances(source.getCusMerchantNo(),source.getCusLoyaltyId(),rewardCurrency.getRwdCurrencyId());\n\n //if the list contains any entries set reward balance to the placeholder\n if(customerRewardBalances != null && customerRewardBalances.size()>0){\n\n // Send the points formatted\n fields.put(\"#points\",generalUtils.getFormattedValue(customerRewardBalances.get(0).getCrbRewardBalance()));\n\n }\n\n // Set the date\n String toDay = generalUtils.convertDateToFormat(new Date(System.currentTimeMillis()),\"dd MMM yyyy\");\n\n // Set the value for #date placeholder\n fields.put(\"#date\", toDay);\n\n //log the activity\n customerActivityService.logActivity(source.getCusLoyaltyId(), CustomerActivityType.TRANSFER_POINT, \"Transferred \" + generalUtils.getFormattedValue(rewardQty) + \" points to :\" + dest.getCusLoyaltyId(), source.getCusMerchantNo(), \"\");\n\n messageWrapper.setParams(fields);\n\n messageWrapper.setSpielName(MessageSpielValue.SPIEL_TRANSFER_POINT_FROM);\n\n\n messageWrapper.setMerchantNo(source.getCusMerchantNo());\n\n messageWrapper.setLoyaltyId(source.getCusLoyaltyId());\n\n messageWrapper.setChannel(MessageSpielChannel.ALL);\n\n messageWrapper.setIsCustomer(IndicatorStatus.YES);\n\n return userMessagingService.transmitNotification(messageWrapper);\n\n }", "public void testTwoAddressLineItems() throws InterruptedException {\n Customer customer = CustomerService.getInstance().getCustomerById(new Integer(5305));\r\n ir.printInvoice(custInv, customer);\r\n }", "@Override\n\tpublic void msgIWantStuff(MarketCustomer c, ArrayList<String> needs) {\n\t\tprint(\"Recieved order from Customer: \" + c.getCustomerName());\n\t\tmyCustomers.add(new MyCustomer(c, needs));\n\t\tprint(\"Size of myCustomer list: \" + myCustomers.size());\n\t\tstateChanged();\n\t}", "public void run()\n\t{\n\t\t// print which customer was created\n\t\tSystem.out.println(\"Customer \" + customerNumber + \" created\");\n\t\t\n\t\t// try to enter the post office and print when succesful\n\t\ttry {\n\t\t\tProject2.max_capacity.acquire();\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t\tSystem.out.println(\"Customer \" + customerNumber + \" enters post office\");\n\t\t\n\t\t// try to be attended by a postal worker\n\t\ttry {\n\t\t\tProject2.worker_ready.acquire();\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t\t\n\t\t// add customer to the serving customer queue by locking mutex\n\t\ttry {\n\t\t\tProject2.servingCustomerMutex.acquire();\n\t\t} catch (InterruptedException e) {\n\t\t}\n\t\t\n\t\t// adding this customer to the serving customer queue\n\t\tProject2.servingCustomer.add(this);\n\t\t// signal that this customer is ready to be served\n\t\tProject2.cust_ready.release();\n\n\t\t// unlock serving customer mutex\n\t\tProject2.servingCustomerMutex.release();\n\t\t\t\t\n\t\t// keep track of whether the customer is finished to move on\n\t\ttry {\n\t\t\tProject2.customers_finished[customerNumber].acquire();\n\t\t} catch (InterruptedException e)\n\t\t{\t\n\t\t}\n\t\t\n\t\t// print that customer leaves post office\n\t\tSystem.out.println(\"Customer \" + customerNumber + \" leaves post office\");\n\t\t// signify that another customer can enter the post office now\n\t\tProject2.max_capacity.release();\n\t}", "public String getBillCode() {\r\n return billCode;\r\n }", "public void credit() {\n \tSystem.out.println(\"HSBC--Credit--from US Bank\");\n }", "private void seatCustomer(MyCustomer customer) {\n\t//Notice how we print \"customer\" directly. It's toString method will do it.\n\tDo(\"Seating \" + customer.cmr + \" at table \" + (customer.tableNum+1));\n\t//move to customer first.\n\tCustomer guiCustomer = customer.cmr.getGuiCustomer();\n\tguiMoveFromCurrentPostionTo(new Position(guiCustomer.getX()+1,guiCustomer.getY()));\n\twaiter.pickUpCustomer(guiCustomer);\n\tPosition tablePos = new Position(tables[customer.tableNum].getX()-1,\n\t\t\t\t\t tables[customer.tableNum].getY()+1);\n\tguiMoveFromCurrentPostionTo(tablePos);\n\twaiter.seatCustomer(tables[customer.tableNum]);\n\tcustomer.state = CustomerState.NO_ACTION;\n\tcustomer.cmr.msgFollowMeToTable(this, new Menu());\n\tstateChanged();\n }", "public void setCustomer(String customer) {\n this.customer = customer;\n }", "public void setCustomer(String Cus){\n\n this.customer = Cus;\n }", "String getBillString();", "private void mSaveBillData(int TenderType) { // TenderType:\r\n // 1=PayCash\r\n // 2=PayBill\r\n\r\n // Insert all bill items to database\r\n InsertBillItems();\r\n\r\n // Insert bill details to database\r\n InsertBillDetail(TenderType);\r\n\r\n updateMeteringData();\r\n\r\n /*if (isPrintBill) {\r\n // Print bill\r\n PrintBill();\r\n }*/\r\n }", "public void transferMoney(int customerAccountId, int accountId) throws SQLException {\n // check if the customer has this account\n boolean customerOwnsAccount = false;\n for (int i = 0; i < this.currentCustomer.getAccounts().size(); i++) {\n if (customerAccountId == this.currentCustomer.getAccounts().get(i).getId()) {\n customerOwnsAccount = true;\n break;\n }\n }\n // it is safe to proceed since the customer accounts have been authenticated\n if (customerOwnsAccount) {\n Account customerAccount = DatabaseSelectHelper.getAccountDetails(customerAccountId);\n // try and catch for valid input (int) expected\n try {\n System.out.println(\"Enter amount you wish to transfer:\");\n // take user input as a big decimal\n BigDecimal bigAmount = new BigDecimal(br.readLine());\n if (bigAmount.compareTo(customerAccount.getBalance()) <= 0) {\n // try to update accounts\n try {\n // update the account which received money in database\n DatabaseUpdateHelper.updateAccountBalance(\n bigAmount.add(DatabaseSelectHelper.getBalance(accountId)), accountId);\n // update account which transfered money in database\n DatabaseUpdateHelper.updateAccountBalance(\n customerAccount.getBalance().subtract(bigAmount), customerAccountId);\n // update the customer object for printing reasons for other options\n this.currentCustomer.updateAccounts();\n // Explicitly tell user money is transfered\n System.out.println(\"you have successfully transfered money to account \" + accountId);\n \n } catch (Exception e) {\n System.out.println(\"The account ID you wish to transfer money to does not exist\");\n }\n // error printing\n } else {\n System.out.println(\"This account does not have enough money to send this amount\");\n }\n \n } catch (Exception e) {\n System.out.println(\"Invalid amount\");\n }\n // error printing\n } else {\n System.out.println(\"You do not have access to this account\");\n }\n \n }", "private static void generateTransferCustomer(int branchID) {\n long oldAccountNo = getRandAccountFromBranchD(branchID);\n int newBranch = getRandBranchExcept(branchID);\n long newAccountNo = getNewAccountNo(newBranch);\n writeToFile(String.format(\"%d %d\\n\", oldAccountNo, newAccountNo));\n }", "@Override\n public void makeOffer(Item item, Customer customer, double amount) {\n itemRepo.createOffer(item,customer,amount);\n }", "public void setBudgetCustomerId(Number value) {\n setAttributeInternal(BUDGETCUSTOMERID, value);\n }", "@Override\r\n\tpublic ResponseBean buyTicket(CustomerReqDto customerReqDto) {\n\r\n\t\tAdminDto adminDto = adminDao.findConcertDetails(customerReqDto.getConcertName(),\r\n\t\t\t\tcustomerReqDto.getTicketType());\r\n\r\n\t\tif (adminDto == null) {\r\n\t\t\tthrow new ResourceNotFoundException(\"Resource Not Found\");\r\n\t\t} else {\r\n\r\n\t\t\tList<TicketDto> ticketObjList = customerReqDto.getTicketDto();\r\n\t\t\tList<Integer> ticketNoList = new ArrayList<>();\r\n\t\t\tfor (TicketDto ticketNo : ticketObjList) {\r\n\t\t\t\tticketNoList.add(ticketNo.getTicketNo());\r\n\t\t\t}\r\n\t\t\tList<Integer> ticketList = ticketDao.validateTicketNos(ticketNoList);\r\n\r\n\t\t\tif (!CollectionUtils.isEmpty(ticketList)) {\r\n\t\t\t\tthrow new TicketBlockedException(\"ticket already booked\", ticketList);\r\n\t\t\t}\r\n\t\t\t{\r\n\t\t\t\tBigDecimal price = adminDto.getTicketPrice();\r\n\t\t\t\tList<TicketDto> list = new ArrayList<>();\r\n\t\t\t\tCustomerDto customerDto = new CustomerDto();\r\n\t\t\t\tfor (TicketDto ticketDto : ticketObjList) {\r\n\r\n\t\t\t\t\tif (ticketDto.getTicketNo() <= adminDto.getTicketNoTo()\r\n\t\t\t\t\t\t\t&& ticketDto.getTicketNo() >= adminDto.getTicketNoFrom()\r\n\t\t\t\t\t\t\t&& customerReqDto.getTicketPrice().equals(price)) {\r\n\t\t\t\t\t\tlist.add(ticketDto);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tBeanUtils.copyProperties(customerReqDto, customerDto);\r\n\t\t\t\tcustomerDao.save(customerDto);\r\n\t\t\t\tResponseBean res = new ResponseBean();\r\n\t\t\t\tres.setObj(customerDto);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void CreateCustomer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void printBill() {\n System.out.println(\"BILL FOR TABLE #\" + id);\n for (MenuItem item : bill.getItems()) {\n if (item.getPrice() == 0.0) {\n System.out.println(item.getQuantity() + \" \" + item.getName() + \": $\" + String.format(\"%.2f\", item.getTotal()) + \" Sent back because: \" + item.getComment() + \".\");\n } else {\n System.out.println(item.getQuantity() + \" \" + item.getName() + \": $\" + String.format(\"%.2f\", item.getTotal()));\n }\n for (Ingredient addedIng : item.getExtraIngredients()) {\n System.out.println(\"add \" + item.getQuantity() + \" \" + addedIng.getName() + \": $\" + String.format(\"%.2f\", addedIng.getPrice() * item.getQuantity()));\n }\n for (Ingredient removedIng : item.getRemovedIngredients()) {\n System.out.println(\"remove \" + item.getQuantity() + \" \" + removedIng.getName() + \": -$\" + String.format(\"%.2f\", removedIng.getPrice() * item.getQuantity()));\n }\n\n }\n System.out.println(\"Total: $\" + getBillPrice() + \"\\n\");\n }", "public void startSale() {\r\n System.out.println(\"[CashRegister] startSale\");\r\n System.out.println(\"\");\r\n\r\n //receipt = new Receipt(customerId); \r\n receipt = new Receipt(\"100\");\r\n\r\n //addItemToSale(productId, quantity);\r\n addItemToSale(\"A101\", 10);\r\n\r\n addItemToSale(\"B205\", 6);\r\n\r\n addItemToSale(\"C222\", 12);\r\n\r\n }", "void payBills();", "@Override\r\n\tpublic void solicitarMonto(int monto) {\n\t\tSystem.out.println(\"Comprobar dinero dentro de la cuenta\");\r\n\t\tSystem.out.println(\"Leer monto\");\r\n\t}", "public static void main(String[] args) {\n Teller t = new Teller();\n Customer c1 = new Customer(\"Suthee\", 'F', \"11/22 BKK\", 30);\n t.newAccount(c1, 500);\n t.newAccount(c1, 1000);\n\n t.deposit(c1, 100, 500);\n t.withdraw(c1,100,200);\n\n t.deposit(c1,101,1200);\n t.withdraw(c1,101,500);\n\n System.out.println(\"Transaction Information\");\n ArrayList<Account> list = c1.getListBankAccount();\n for (Account account:list) {\n System.out.println(account);\n }\n }", "void placeOrder(Cashier cashier){\n }", "@Async\n public boolean sendTransferToNotificationSMS(Customer source, Customer dest, Double rewardQty, RewardCurrency rewardCurrency, MessageWrapper messageWrapper) throws InspireNetzException {\n HashMap<String,String> fields = new HashMap<>(0);\n\n // Add the qty\n fields.put(\"#qty\",generalUtils.getFormattedValue(rewardQty));\n\n // Add the currencyname\n fields.put(\"#currencyname\",rewardCurrency.getRwdCurrencyName());\n\n // Add the sender name\n fields.put(\"#sender\",source.getCusLoyaltyId());\n\n /*// Get the reward balance\n CustomerRewardBalance customerRewardBalance = customerRewardBalanceService.findByCrbLoyaltyIdAndCrbMerchantNoAndCrbRewardCurrency(dest.getCusLoyaltyId(),dest.getCusMerchantNo(),rewardCurrency.getRwdCurrencyId());*/\n\n //get the reward balance\n List<CustomerRewardBalance> customerRewardBalances = customerRewardBalanceService.searchBalances(dest.getCusMerchantNo(),dest.getCusLoyaltyId(),rewardCurrency.getRwdCurrencyId());\n\n //if the list contains any entries set reward balance to the placeholder\n if(customerRewardBalances != null && customerRewardBalances.size()>0){\n\n // Send the points formatted\n fields.put(\"#points\",generalUtils.getFormattedValue(customerRewardBalances.get(0).getCrbRewardBalance()));\n\n }\n\n\n // Set the date\n String toDay = generalUtils.convertDateToFormat(new Date(System.currentTimeMillis()),\"dd MMM yyyy\");\n\n // Replace the date\n fields.put(\"#date\", toDay);\n\n //log the activity\n customerActivityService.logActivity(dest.getCusLoyaltyId(), CustomerActivityType.TRANSFER_POINT, \"Received \" + generalUtils.getFormattedValue(rewardQty) + \" points from :\" + source.getCusLoyaltyId(), source.getCusMerchantNo(), \"\");\n\n messageWrapper.setParams(fields);\n\n messageWrapper.setSpielName(MessageSpielValue.SPIEL_TRANSFER_POINT_TO);\n\n messageWrapper.setLoyaltyId(dest.getCusLoyaltyId());\n messageWrapper.setMerchantNo(dest.getCusMerchantNo());\n messageWrapper.setChannel(MessageSpielChannel.ALL);\n messageWrapper.setIsCustomer(IndicatorStatus.YES);\n\n return userMessagingService.transmitNotification(messageWrapper);\n\n }", "public void msgHereIsMyChoice(CustomerAgent customer, String choice){\n\tfor(MyCustomer c:customers){\n\t if(c.cmr.equals(customer)){\n\t\tc.choice = choice;\n\t\tc.state = CustomerState.ORDER_PENDING;\n\t\ttables[c.tableNum].takeOrder(choice.substring(0,2)+\"?\");\n\t\tstateChanged();\n\t\treturn;\n\t }\n\t}\n }", "private void addCustomer() {\n try {\n FixCustomerController fixCustomerController = ServerConnector.getServerConnector().getFixCustomerController();\n\n FixCustomer fixCustomer = new FixCustomer(txtCustomerName.getText(), txtCustomerNIC.getText(), String.valueOf(comJobrole.getSelectedItem()), String.valueOf(comSection.getSelectedItem()), txtCustomerTele.getText());\n\n boolean addFixCustomer = fixCustomerController.addFixCustomer(fixCustomer);\n\n if (addFixCustomer) {\n JOptionPane.showMessageDialog(null, \"Customer Added Success !!\");\n } else {\n JOptionPane.showMessageDialog(null, \"Customer Added Fail !!\");\n }\n\n } catch (NotBoundException | MalformedURLException | RemoteException ex) {\n new ServerNull().setVisible(true);\n } catch (ClassNotFoundException | IOException ex) {\n Logger.getLogger(InputCustomers.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void mailPromo(String fname, String customerEmail, String promo, double discount){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"cinema4050@gmail.com\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"New Promotion!\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \"+fname + \"!\\n\\n\"\r\n\t + \"We are emailing you to inform you that there is a new promotion.\\n\"\r\n\t + \"Use code -- \"+promo+\" -- to save $\" + discount + \"0 on your next purchase on CINEMA4050!\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "private void requestBucks() {\n\t\ttry {\n\t\t\tSystem.out.println(\"Please choose a user to request TE Bucks from:\");\n\t\t\tUser fromUser;\n\t\t\tboolean isValidUser;\n\t\t\tdo {\n\t\t\t\tfromUser = (User)console.getChoiceFromOptions(userService.getUsers());\n\t\t\t\tisValidUser = ( fromUser\n\t\t\t\t\t\t\t\t.getUsername()\n\t\t\t\t\t\t\t\t.equalsIgnoreCase(currentUser.getUser().getUsername())\n\t\t\t\t\t\t\t ) ? false : true;\n\n\t\t\t\tif(!isValidUser) {\n\t\t\t\t\tSystem.out.println(\"You can not request money from yourself\");\n\t\t\t\t}\n\t\t\t} while (!isValidUser);\n\t\t\t\n\t\t\t// Select an amount\n\t\t\tBigDecimal amount = new BigDecimal(\"0.00\");\n\t\t\tboolean isValidAmount = false;\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\tamount = new BigDecimal(console.getUserInput(\"Enter An Amount (0 to cancel):\\n \"));\n\t\t\t\t\tisValidAmount = true;\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\tSystem.out.println(\"Please enter a numerical value\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(amount.doubleValue() < 0.99 && amount.doubleValue() > 0.00) {\n\t\t\t\t\tSystem.out.println(\"You cannot request less than $0.99 TEB\");\n\t\t\t\t\tisValidAmount = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (amount.doubleValue() == 0.00) {\n\t\t\t\t\tmainMenu();\n\t\t\t\t}\n\t\t\t} while(!isValidAmount);\n\n\t\t\t// Create transfer object\n\t\t\tboolean confirmedAmount = false;\n\t\t\tString confirm = \"\";\n\t\t\tTransfer transfer = null;\n\t\t\twhile (!confirmedAmount) {\n\t\t\t\tconfirm = console.getUserInput(\"You entered: \" + amount.toPlainString() + \" TEB. Is this correct? (y/n)\");\n\t\t\t\tif (confirm.toLowerCase().startsWith(\"y\")) {\n\t\t\t\t\t// transferService to POST to server db\n\t\t\t\t\tSystem.out.println(\"You are requesting: \" + amount.toPlainString() +\n\t\t\t\t\t\t\t\" TEB from \" + fromUser.getUsername());\n\t\t\t\t\ttransfer = createTransferObj(\"Request\", \"Pending\",\n\t\t\t\t\t\t\t\t\tcurrentUserId, fromUser.getId(), amount);\n\t\t\t\t\tboolean hasSent = \n\t\t\t\t\t\t\ttransferService.sendBucks(currentUserId, fromUser.getId(), transfer);\n\t\t\t\t\tif (hasSent) {\n\t\t\t\t\t\t// TODO :: Test this\n\t\t\t\t\t\tSystem.out.println(\"The code executed\");\n\t\t\t\t\t}\n\t\t\t\t\tconfirmedAmount = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Request canceled.\");\n\t\t\t\t\tconfirmedAmount = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t} \t\n\t\t\t}\n\t\t\t\n\t\t}catch(UserServiceException ex) {\n\t\t\tSystem.out.println(\"User Service Exception\");\n\t\t}catch(TransferServiceException ex) {\n\t\t\tSystem.out.println(\"Transfer Service Exception\");\n\t\t}\n\t\t\n\t}", "@Override\n public String toString() {\n return super.toString() + String.format(\": Customer %d arrives\",\n this.customer.getId());\n }", "void purchaseMade();", "public void sendData(Customer customer){\n\n this.countriesList = CountryDAOImpl.getAllCountries();\n\n\n this.idTB.setText(Integer.toString(customer.getId()));\n this.nameTB.setText(customer.getName());\n this.addressTB.setText(customer.getAddress());\n this.postCodeTB.setText(customer.getPostalCode());\n this.phone.setText(customer.getPhoneNumber());\n this.countryCB.setItems(this.countriesList);\n setCountrySelected(customer.getCountry(), customer.getDivision());\n setCustomer(customer);\n }", "public Customer(int custNum) \n\t{\n\t\t// stores the randomly assigned task where 1 is buying stamps, 2 is mailing a letter, and 3 is mailing a package\n\t\ttask = (int)(Math.random()*3 )+ 1; // randomly generates a number from 1 to 3\n\t\tcustomerNumber = custNum; // keeps track of which customer this is\n\t}", "public void sendLetter(Letter<?> letter) {\n\t\tletter.getSender().getBankAccount().debit(letter.getCost());\n\t\tthis.postbox.add(letter);\n\t\tif(letter.getCost() > 1) {\n\t\t\tSystem.out.println(\"-> \" + letter.getSender().getName() + \" mails \" + letter + \" to \" + letter.getReceiver().getName() +\" for a cost of \" + letter.getCost() + \" euros\");\n\t\t\tSystem.out.println(\" - \" + letter.getCost() + \" euros are debited from \" + letter.getSender().getName() + \" account whose balance is now \" + letter.getSender().getBankAccount().getAmount() + \" euros\");\n\t\t} else {\n\t\t\tSystem.out.println(\"-> \" + letter.getSender().getName() + \" mails \" + letter + \" to \" + letter.getReceiver().getName() +\" for a cost of \" + letter.getCost() + \" euro\");\n\t\t\tSystem.out.println(\" - \" + letter.getCost() + \" euro are debited from \" + letter.getSender().getName() + \" account whose balance is now \" + letter.getSender().getBankAccount().getAmount() + \" euros\");\n\t\t}\n\t}", "Order sendNotificationNewOrder(Order order);", "private void PayBill() {\r\n Cursor crsrBillDetail = dbBillScreen.getBillDetailByCustomer(iCustId, 2, Float.parseFloat(tvBillAmount.getText().toString()));\r\n if (crsrBillDetail.moveToFirst()) {\r\n strPaymentStatus = \"Paid\";\r\n PrintNewBill(businessDate, 1);\r\n } else {\r\n if (strPaymentStatus== null || strPaymentStatus.equals(\"\"))\r\n strPaymentStatus = \"CashOnDelivery\";\r\n\r\n\r\n ArrayList<AddedItemsToOrderTableClass> orderItemList = new ArrayList<>();\r\n int taxType =0;\r\n for (int iRow = 0; iRow < tblOrderItems.getChildCount(); iRow++) {\r\n\r\n int menuCode =0;\r\n String itemName= \"\";\r\n double quantity=0.00;\r\n double rate=0.00;\r\n double igstRate=0.00;\r\n double igstAmt=0.00;\r\n double cgstRate=0.00;\r\n double cgstAmt=0.00;\r\n double sgstRate=0.00;\r\n double sgstAmt=0.00;\r\n double cessRate=0.00;\r\n double cessAmt=0.00;\r\n double subtotal=0.00;\r\n double billamount=0.00;\r\n double discountamount=0.00;\r\n\r\n TableRow RowBillItem = (TableRow) tblOrderItems.getChildAt(iRow);\r\n\r\n\r\n // Item Number\r\n if (RowBillItem.getChildAt(0) != null) {\r\n CheckBox ItemNumber = (CheckBox) RowBillItem.getChildAt(0);\r\n menuCode = (Integer.parseInt(ItemNumber.getText().toString()));\r\n }\r\n\r\n // Item Name\r\n if (RowBillItem.getChildAt(1) != null) {\r\n TextView ItemName = (TextView) RowBillItem.getChildAt(1);\r\n itemName = (ItemName.getText().toString());\r\n }\r\n\r\n\r\n\r\n // Quantity\r\n if (RowBillItem.getChildAt(3) != null) {\r\n EditText Quantity = (EditText) RowBillItem.getChildAt(3);\r\n String qty_str = Quantity.getText().toString();\r\n double qty_d = 0.00;\r\n if(qty_str==null || qty_str.equals(\"\"))\r\n {\r\n Quantity.setText(\"0.00\");\r\n }else\r\n {\r\n qty_d = Double.parseDouble(qty_str);\r\n }\r\n quantity = (Double.parseDouble(String.format(\"%.2f\",qty_d)));\r\n\r\n }\r\n\r\n // Rate\r\n if (RowBillItem.getChildAt(4) != null) {\r\n EditText Rate = (EditText) RowBillItem.getChildAt(4);\r\n String rate_str = Rate.getText().toString();\r\n double rate_d = 0.00;\r\n if((rate_str==null || rate_str.equals(\"\")))\r\n {\r\n Rate.setText(\"0.00\");\r\n }else\r\n {\r\n rate_d = Double.parseDouble(rate_str);\r\n }\r\n rate = (Double.parseDouble(String.format(\"%.2f\",rate_d)));\r\n\r\n }\r\n\r\n\r\n // Service Tax Percent\r\n\r\n if(chk_interstate.isChecked()) // IGST\r\n {\r\n cgstRate =0;\r\n cgstAmt =0;\r\n sgstRate =0;\r\n sgstAmt =0;\r\n if (RowBillItem.getChildAt(23) != null) {\r\n TextView iRate = (TextView) RowBillItem.getChildAt(23);\r\n igstRate = (Double.parseDouble(String.format(\"%.2f\",\r\n Double.parseDouble(iRate.getText().toString()))));\r\n }\r\n\r\n // Service Tax Amount\r\n if (RowBillItem.getChildAt(24) != null) {\r\n TextView iAmt = (TextView) RowBillItem.getChildAt(24);\r\n igstAmt = Double.parseDouble(String.format(\"%.2f\",\r\n Double.parseDouble(iAmt.getText().toString())));\r\n }\r\n\r\n\r\n }else // CGST+SGST\r\n {\r\n igstRate =0;\r\n igstAmt =0;\r\n if (RowBillItem.getChildAt(15) != null) {\r\n TextView ServiceTaxPercent = (TextView) RowBillItem.getChildAt(15);\r\n sgstRate = (Double.parseDouble(String.format(\"%.2f\",\r\n Double.parseDouble(ServiceTaxPercent.getText().toString()))));\r\n }\r\n\r\n // Service Tax Amount\r\n if (RowBillItem.getChildAt(16) != null) {\r\n TextView ServiceTaxAmount = (TextView) RowBillItem.getChildAt(16);\r\n sgstAmt = Double.parseDouble(String.format(\"%.2f\",\r\n Double.parseDouble(ServiceTaxAmount.getText().toString())));\r\n }\r\n\r\n // Sales Tax %\r\n if (RowBillItem.getChildAt(6) != null) {\r\n TextView SalesTaxPercent = (TextView) RowBillItem.getChildAt(6);\r\n cgstRate = Double.parseDouble(String.format(\"%.2f\",\r\n Double.parseDouble(SalesTaxPercent.getText().toString())));\r\n }\r\n // Sales Tax Amount\r\n if (RowBillItem.getChildAt(7) != null) {\r\n TextView SalesTaxAmount = (TextView) RowBillItem.getChildAt(7);\r\n cgstAmt = Double.parseDouble(String.format(\"%.2f\",\r\n Double.parseDouble(SalesTaxAmount.getText().toString())));\r\n }\r\n }\r\n if (RowBillItem.getChildAt(25) != null) {\r\n TextView cessRt = (TextView)RowBillItem.getChildAt(25);\r\n if(!cessRt.getText().toString().equals(\"\"))\r\n cessRate = Double.parseDouble(cessRt.getText().toString());\r\n }\r\n if (RowBillItem.getChildAt(26) != null) {\r\n TextView cessAt = (TextView)RowBillItem.getChildAt(26);\r\n if(!cessAt.getText().toString().equals(\"\"))\r\n cessAmt = Double.parseDouble(cessAt.getText().toString());\r\n }\r\n\r\n\r\n\r\n // Tax Type\r\n if (RowBillItem.getChildAt(13) != null) {\r\n TextView TaxType = (TextView) RowBillItem.getChildAt(13);\r\n taxType = (Integer.parseInt(TaxType.getText().toString()));\r\n }\r\n // subtotal\r\n subtotal = (rate*quantity) + igstAmt+cgstAmt+sgstAmt;\r\n\r\n AddedItemsToOrderTableClass orderItem = new AddedItemsToOrderTableClass( menuCode, itemName, quantity, rate,\r\n igstRate,igstAmt, cgstRate, cgstAmt, sgstRate,sgstAmt, rate*quantity,subtotal, billamount,cessRate,cessAmt,discountamount);\r\n orderItemList.add(orderItem);\r\n }\r\n\r\n Bundle bundle = new Bundle();\r\n bundle.putDouble(Constants.TOTALBILLAMOUNT, Double.parseDouble(tvBillAmount.getText().toString()));\r\n bundle.putDouble(Constants.TAXABLEVALUE, Double.parseDouble(tvSubTotal.getText().toString()));\r\n\r\n// bundle.putDouble(Constants.ROUNDOFFAMOUNT, Double.parseDouble(edtRoundOff.getText().toString()));\r\n if (tvOthercharges.getText().toString().isEmpty()) {\r\n bundle.putDouble(Constants.OTHERCHARGES, Double.parseDouble(tvOthercharges.getText().toString()));\r\n } else {\r\n bundle.putDouble(Constants.OTHERCHARGES, Double.parseDouble(tvOthercharges.getText().toString()));\r\n }\r\n bundle.putDouble(Constants.DISCOUNTAMOUNT, Double.parseDouble(tvDiscountAmount.getText().toString()));\r\n bundle.putInt(Constants.TAXTYPE, isForwardTaxEnabled);\r\n //bundle.putInt(CUSTID, Integer.parseInt(tvCustId.getText().toString()));\r\n bundle.putString(Constants.PHONENO, edtCustPhoneNo.getText().toString());\r\n bundle.putParcelableArrayList(Constants.ORDERLIST, orderItemList);\r\n if (chk_interstate.isChecked()) {\r\n double igstAmount = Double.parseDouble(tvIGSTValue.getText().toString());\r\n double cessAmount = Double.parseDouble(tvcessValue.getText().toString());\r\n bundle.putDouble(Constants.TAXAMOUNT, igstAmount + cessAmount);\r\n } else {\r\n double sgstAmount = Double.parseDouble(tvSGSTValue.getText().toString());\r\n double cgstAmount = Double.parseDouble(tvCGSTValue.getText().toString());\r\n double cessAmount = Double.parseDouble(tvcessValue.getText().toString());\r\n bundle.putDouble(Constants.TAXAMOUNT, cgstAmount + sgstAmount + cessAmount);\r\n }\r\n\r\n fm = getSupportFragmentManager();\r\n proceedToPayBillingFragment = new PayBillFragment();\r\n proceedToPayBillingFragment.initProceedToPayListener(this);\r\n proceedToPayBillingFragment.setArguments(bundle);\r\n proceedToPayBillingFragment.show(fm, \"Proceed To Pay\");\r\n\r\n /* Intent intentTender = new Intent(myContext, PayBillActivity.class);\r\n intentTender.putExtra(\"TotalAmount\", tvBillAmount.getText().toString());\r\n intentTender.putExtra(\"CustId\", edtCustId.getText().toString());\r\n intentTender.putExtra(\"phone\", edtCustPhoneNo.getText().toString());\r\n intentTender.putExtra(\"USER_NAME\", strUserName);\r\n intentTender.putExtra(\"BaseValue\", Float.parseFloat(tvSubTotal.getText().toString()));\r\n intentTender.putExtra(\"ORDER_DELIVERED\", strOrderDelivered);\r\n intentTender.putExtra(\"OtherCharges\", Double.parseDouble(tvOthercharges.getText().toString()));\r\n intentTender.putExtra(\"TaxType\", taxType);// forward/reverse\r\n intentTender.putParcelableArrayListExtra(\"OrderList\", orderItemList);\r\n startActivityForResult(intentTender, 1);*/\r\n //mSaveBillData(2, true);\r\n //PrintNewBill();\r\n }\r\n\r\n /*int iResult = dbBillScreen.deleteKOTItems(iCustId, String.valueOf(jBillingMode));\r\n Log.d(\"Delivery:\", \"Items deleted from pending KOT:\" + iResult);*/\r\n\r\n //ClearAll();\r\n //Close(null);\r\n }", "public void msgIWantFood(RestaurantThreeCustomer cust) {\n\t\tfor (Table table : tables) {\n\t\t\tif (!table.isOccupied()) {\n\t\t\t\twaitingCustomers.add(cust);\n\t\t\t\tAlertLog.getInstance().logMessage(AlertTag.valueOf(system.getName()), \"Restaurant 3 Host: \" + person.getName(), \"Assigning customer to waiter.\" + waiterIndex);\n\t\t\t\tstateChanged();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t//no free tables\n\t\tAlertLog.getInstance().logMessage(AlertTag.valueOf(system.getName()), \"Restaurant 3 Host: \" + person.getName(), \"Alerting customer that restaurant is full.\");\n\t\tcust.msgRestaurantFull();\n\t}", "@Override\n\tpublic void businessMoney() {\n\n\t}", "public void customerPurchase(int number) {\n assert number<=availableNumber: \"Customer cannot buy more than available number of the stock.\";\n this.refresh(number);\n availableNumber -= number;\n }", "@Override\r\n\tpublic int insertMonthlybill(int customerID, long mobileNo, Bill bill) {\n\t\treturn 0;\r\n\t}", "public Booking makeBooking(Customer customer, Airline flight, int baggage, String type, Date date);", "@Override\n\tpublic void saveCustomer(AMOUNT theCustomer) {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n\t\t// save the customer ... \n\t\tcurrentSession.save(theCustomer);\n\t}", "void pay(Order order);", "public interface Cashier {\n\t\n\t// Sent from waiter to computer a bill for a customer\n\tpublic abstract void msgComputeBill(String choice, Customer c, Waiter w, int tableNumber, Map<String, Double> menu);\n\t\n\t// Sent from a customer when making a payment\n\tpublic abstract void msgPayment(Customer customer, Cash cash);\n\n\tpublic abstract void msgAskForPayment(String food, int batchSize, Market market, double price);\n\n\tpublic abstract String getCash();\t\n\t\n\tpublic abstract String getTotalDebt(); \n}", "private static void generateAddCustomer(int branchID) {\n long accountNo = getNewAccountNo(branchID);\n int balance = getRandomBalance();\n writeToFile(String.format(\"%d %d\\n\", accountNo, balance));\n }", "@Override\n\tpublic void showConfirmation(Customer customer, List<Item> items, double totalPrice, int loyaltyPointsEarned) {\n\t}", "public void printBill(){\r\n\t\tint numOfItems = ItemsList.size();\r\n\t\tfor(int i = 0;i<numOfItems;i++){\r\n\t\t\tSystem.out.println(\"1\" + ItemsList.get(i).getName() + \"at \" + ItemsList.get(i).getPrice());\r\n\t\t}\r\n\t\tSystem.out.printf(\"Sales Tax: %.2f\\n\", taxTotal);\r\n\t\tSystem.out.println(\"Total: \" + total);\r\n\t}", "public double MakeBooking(Customer InputCustomer) {\n\t\tdouble TotalPrice = 0.0;\n\t\tdouble Midprice = 0.0;\n\t\t\n\t\t\n\t\tMidprice = (this.basePrice*this.Rate*InputCustomer.DefaultadultSeats);\n\t\tTotalPrice = TotalPrice + (Midprice-(Midprice*this.concession));\n\t\treturn TotalPrice;\n\t\t\n\t\t\n\t\t\n\t}", "private void transferCoin(Player customer, MarketObject<?> x) throws IllegalStateException {\n\t\tPlayer seller=game.getPlayerByID(x.getSellingPlayer().getPlayerID());\n\t\tif(customer.checkCoins(x.getPrice()))\n\t\t\tseller.setCoins(\n\t\t\t\tseller.getCoins() + x.getPrice());\n\t\telse\n\t\t\tthrow new IllegalStateException(\"Impossible to buy. You only own \"\n\t\t\t\t\t+customer.getCoins()+\" instead of the \"+x.getPrice()+\" required\");\n\t\t\n\t}", "public void setBillToId(java.lang.String billToId) {\n this.billToId = billToId;\n }", "public void processBills() {\r\n \r\n System.out.printf(\"%nHow many bills are there to process? \");\r\n int numBills = input.nextInt(); //local variable captures int from user.\r\n \r\n cableBills = new Invoice[numBills];\r\n billingStmts = new String[numBills];\r\n \r\n for(int i=0; i < numBills; i++) {\r\n cableBills[i] = new Invoice();\r\n cableBills[i].setCustNm(i);\r\n cableBills[i].determineCableSrv(i);\r\n cableBills[i].setMoviesPurchased(i);\r\n \r\n double total = cableBills[i].getMoviePurchased() + cableBills[i].getCableSrv(); //local variable calculates the total/\r\n double movieCharges = cableBills[i].getMoviePurchased(); //local variable calculates the movie charges.\r\n \r\n billingStmts[i] = String.format(\"%nCustomer: %S\"\r\n + \"%n%nCable Service: %20c%,10.2f\"\r\n + \"%nMovies-On-Demand-HD: %14c%,10.2f\"\r\n + \"%n%nTOTAL DUE: %24c%,10.2f%n\",\r\n cableBills[i].getCustNm(), '$',\r\n cableBills[i].getCableSrv(), ' ', movieCharges, '$', total);\r\n }\r\n }", "boolean addBillToReservation(long billId, long reservationId);", "public void run() {\n\n\t\tSimulation.logEvent(SimulationEvent.customerStarting(this));\n\t\ttry {\n\t\t\t/*\n\t\t\t * Customer attempts to enter the coffee shop here The Semaphore\n\t\t\t * blocks them when it reaches 0.\n\t\t\t */\n\t\t\ttableSpace.acquire();\n\t\t\t/*i do not use reentrantlocks between classes anymore because i need \n\t\t\t * some way for unique synchronization. \n\t\t\t * */\n\t\t\t\n\t\t\t\n\t\t\t/* The simulation logs the event once they have entered in */\n\t\t\tSimulation\n\t\t\t\t\t.logEvent(SimulationEvent.customerEnteredCoffeeShop(this));\n\t\t\t\n\t\t\t\n\t\t\tsynchronized (orders) {\n\t\t\t\torders.add(new FoodOrder(this.orderNum, this.order, this));\n\t\t\t\tSimulation.logEvent(SimulationEvent.customerPlacedOrder(this,\n\t\t\t\t\t\tthis.order, this.orderNum));\n\t\t\t\torders.notifyAll();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/*This customer is notified that cook has completed the \n\t\t\t * order. It breaks out when the cook has finally placed \n\t\t\t * This notification is unique however.\n\t\t\t * */\n\t\t\twhile(Simulation.custMap.get(this) == false){\n\t\t\t\tThread.sleep(15);\n\t\t\t}\n\t\t\t\t\n\t\t\tSimulation.logEvent(SimulationEvent.customerReceivedOrder(this,\n\t\t\t\t\tthis.order, this.orderNum));\n\t\t\t\n\t\t\tSimulation\n\t\t\t\t\t.logEvent(SimulationEvent.customerLeavingCoffeeShop(this));\n\t\t\ttableSpace.release();\n\n\t\t} catch (InterruptedException e) {\n\n\t\t}\n\t}", "public void purchase(Book book1, Client client1) {\n\t\tclient1.getBuyBookList().add(book1);\n\t\t//book1.getBuyBookClient().add(client1);\n\t}", "public abstract void generateReceipt(Transaction trans);", "public void PDFBill(Orders o) throws FileNotFoundException, DocumentException {\n\n\t\tOrdersBLL orderBLL = new OrdersBLL();\n\t\t\n\t\tDate d = new Date();\n\t\t\n\t\tDocument document = new Document();\n\t\t\n\t\tString fileName = \"Bill-report\" + countBills + \".pdf\";\n\t\tcountBills++;\n\t\tPdfWriter.getInstance(document, new FileOutputStream(fileName));\n\t\t\n\t\tdocument.open();//open document\n\n\t\t//create paragraph\n\t\tParagraph intro = new Paragraph(\"Bill\");\n\t\tParagraph space = new Paragraph(\" \");\n\t\tParagraph date = new Paragraph(d.toString());\n\t\tPdfPTable table = new PdfPTable(5);\n\n\t\t//create a cell\n\t\tPdfPCell c1 = new PdfPCell(new Paragraph(\"Id\"));\n\t\tPdfPCell c2 = new PdfPCell(new Paragraph(\"Customer Name\"));\n\t\tPdfPCell c3 = new PdfPCell(new Paragraph(\"Product Name\"));\n\t\tPdfPCell c4 = new PdfPCell(new Paragraph(\"Quantity\"));\n\t\tPdfPCell c5 = new PdfPCell(new Paragraph(\"Total price\"));\n\n\n\t\t//add the cells to the table\n\t\ttable.addCell(c1);\n\t\ttable.addCell(c2);\n\t\ttable.addCell(c3);\n\t\ttable.addCell(c4);\n\t\ttable.addCell(c5);\n\n\t\tString[] arr = orderBLL.printBill(o);\n\t\tc1 = new PdfPCell(new Paragraph(arr[0]));\n\t\tc2 = new PdfPCell(new Paragraph(arr[1]));\n\t\tc3 = new PdfPCell(new Paragraph(arr[2]));\n\t\tc4 = new PdfPCell(new Paragraph(arr[3]));\n\t\tc5 = new PdfPCell(new Paragraph(arr[4]));\n\n\n\t\ttable.addCell(c1);\n\t\ttable.addCell(c2);\n\t\ttable.addCell(c3);\n\t\ttable.addCell(c4);\n\t\ttable.addCell(c5);\n\n\n\t\t//add the objects to the document\n\t\tdocument.add(space);\n\t\tdocument.add(intro);\n\t\tdocument.add(space);\n\t\tdocument.add(date);\n\t\tdocument.add(space);\n\t\tdocument.add(table);\n\n\t\tdocument.close();\n\t}", "public void addCustomer(){\n Customer customer = new Customer();\n customer.setId(data.numberOfCustomer());\n customer.setFirstName(GetChoiceFromUser.getStringFromUser(\"Enter First Name: \"));\n customer.setLastName(GetChoiceFromUser.getStringFromUser(\"Enter Last Name: \"));\n data.addCustomer(customer,data.getBranch(data.getBranchEmployee(ID).getBranchID()));\n System.out.println(\"Customer has added Successfully!\");\n }", "public java.lang.String getBillToId() {\n return billToId;\n }" ]
[ "0.6697588", "0.6518283", "0.64701945", "0.6392233", "0.63716817", "0.6338844", "0.62638026", "0.62253106", "0.6143277", "0.6125255", "0.61200947", "0.6106541", "0.6087872", "0.60431296", "0.6037598", "0.6021887", "0.6007642", "0.5969093", "0.5968476", "0.5959978", "0.5953239", "0.5948947", "0.59489214", "0.59065527", "0.58708507", "0.58649784", "0.58477736", "0.5844975", "0.58387274", "0.58308107", "0.58298284", "0.58248717", "0.58183914", "0.5792593", "0.5792282", "0.5775624", "0.5755281", "0.5752207", "0.57522005", "0.575214", "0.57337874", "0.5726909", "0.5723449", "0.5720253", "0.5719016", "0.5716978", "0.57100385", "0.570927", "0.5706604", "0.5700794", "0.5699652", "0.56978273", "0.56930816", "0.5692817", "0.5684511", "0.56819105", "0.5676442", "0.5676359", "0.56757677", "0.5673257", "0.5672478", "0.5669462", "0.56615955", "0.56531096", "0.56513155", "0.565123", "0.5650545", "0.56502473", "0.56476593", "0.5646992", "0.5632248", "0.5618318", "0.56174684", "0.5609416", "0.56025064", "0.55881685", "0.5580558", "0.5576797", "0.55753744", "0.55745244", "0.5572569", "0.55656815", "0.5561253", "0.5555876", "0.55489063", "0.5545249", "0.55425286", "0.5541686", "0.553441", "0.5530421", "0.5529341", "0.5524817", "0.5524173", "0.5523682", "0.5522728", "0.5521964", "0.5517218", "0.551611", "0.5504431", "0.5503079" ]
0.6345403
5
Sent from a customer when making a payment
public abstract void msgPayment(Customer customer, Cash cash);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void pay() {\r\n System.out.println(\"Customer sent payment\");\r\n }", "public void makePayment() {\r\n System.out.println(\"pay\");\r\n setPayed(true);\r\n }", "@Override\n\tpublic void pay() {\n\t\tcreditCard.makePayment();\n\n\t}", "@Override\r\n\tpublic void makePayment(int price) {\n\t\tSystem.out.println(\"Payment Of Rs. \"+price+\" Through COD Successfull. Thank You!\");\r\n\t}", "public void calculatePayment() {}", "void pay(Order order);", "public void CashPayment()\n {\n }", "public void autoPay() {}", "void pay(Payment payment) {\n\n\t}", "void purchaseMade();", "@Override\n\tpublic String addPayment(PaymentRequest paymentRequest) {\n\t\treturn \"Courier Booked successfully\";\n\t}", "CarPaymentMethod processPayPal();", "String makePayment(String userName, String teamName, Payment payment) throws RemoteException, InterruptedException;", "@Override\r\n\tpublic void makePayment(Payment p, int amount) {\n\t\t\r\n\t}", "Receipt chargeOrder(PizzaOrder order, CreditCard creditCard);", "public void startPayment() {\r\n final Activity activity = this;\r\n\r\n final Checkout co = new Checkout();\r\n\r\n try {\r\n JSONObject options = new JSONObject();\r\n options.put(\"name\", \"Farm2Home\");\r\n options.put(\"description\", \"Consumption charges\");\r\n //You can omit the image option to fetch the image from dashboard\r\n // options.put(\"image\", \"https://rzp-mobile.s3.amazonaws.com/images/rzp.png\");\r\n options.put(\"currency\", \"INR\");\r\n options.put(\"amount\", \"500\");\r\n\r\n // JSONObject preFill = new JSONObject();\r\n // preFill.put(\"email\", \"sm@razorpay.com\");\r\n // preFill.put(\"contact\", \"9876543210\");\r\n\r\n // options.put(\"prefill\", preFill);\r\n\r\n co.open(activity, options);\r\n } catch (Exception e) {\r\n Toast.makeText(activity, \"Error in payment: \" + e.getMessage(), Toast.LENGTH_SHORT)\r\n .show();\r\n e.printStackTrace();\r\n }\r\n }", "public void startPayment() {\n double ruppes = Double.parseDouble(price);\n final Activity activity = this;\n final Checkout co = new Checkout();\n try {\n JSONObject options = new JSONObject();\n options.put(\"name\", getResources().getString(R.string.application_name));\n options.put(\"description\", \"\");\n //You can omit the image option to fetch the image from dashboard\n options.put(\"image\", getResources().getDrawable(R.mipmap.ic_app_logo));\n options.put(\"currency\", \"INR\");\n options.put(\"amount\", ruppes * 100);\n JSONObject preFill = new JSONObject();\n preFill.put(\"email\", \"multipz.paresh@gmail.com\");\n preFill.put(\"contact\", \"8758689113\");\n options.put(\"prefill\", preFill);\n co.open(activity, options);\n } catch (Exception e) {\n Toast.makeText(activity, \"Error in payment: \" + e.getMessage(), Toast.LENGTH_SHORT)\n .show();\n e.printStackTrace();\n }\n }", "@Override\r\n public void pay() {\n }", "@Override\n public void payment(BigDecimal amount, String reference) {\n System.out.println(\"Called payment() with following info: \\namount: \" + amount + \"\\nReference Nr:\" + reference);\n\n }", "@Override\r\n\tpublic void paidBehavior() {\n\t\tSystem.out.println(\"You paid using your Vias card\");\r\n\t\t\r\n\t}", "public IBankTransfert payment();", "void paymentOrder(long orderId);", "@Override\n public String pay(int amount) {\n return (amount +\" paid with credit/debit card.\");\n }", "public void makePayment(String amount, String paymentRef) {\n JudoSDKManager.setKeyAndSecret(getApplicationContext(), API_TOKEN, API_SECRET);\n\n// Set environment to Sandbox\n JudoSDKManager.setSandboxMode(getApplicationContext());\n\n String customerRef = Settings.Secure.getString(getApplicationContext().getContentResolver(),\n Settings.Secure.ANDROID_ID);\n\n Intent intent = JudoSDKManager.makeAPayment(getApplicationContext(), JUDO_ID, \"GBP\", amount, paymentRef, customerRef, null);\n startActivityForResult(intent, ACTION_CARD_PAYMENT);\n }", "private void makePayment(User user, Scanner sc, Payment payment) {\n\t\tboolean run = true;\n\t\tdo {\n\t\t\tlog.info(\"\\nPayment Processing\\n\");\n\t\t\tlog.info(\"Current Payment: \" + payment + \"\\n\");\n\n\t\t\tMap<String, Object> makePaymentArgs = new HashMap<>();\n\t\t\tmakePaymentArgs.put(\"offer\", payment.getOffer());\n\t\t\tmakePaymentArgs.put(\"user\", user);\n\t\t\tmakePaymentArgs.put(\"amount\", payment.getOffer().getBalance());\n\t\t\tcService.makePayment(makePaymentArgs);\n\n\t\t\tlog.info(\"\\nPayment is complete:\");\n\t\t\tlog.info(\"\t\tPress anything else to exit\");\n\t\t\tString choice = sc.nextLine();\n\t\t\tswitch (choice) {\n\t\t\tdefault:\n\t\t\t\tlog.info(\"\\nGoing back to the PAYMENTS DASHBOARD\\n\");\n\t\t\t\trun = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (run);\n\t}", "@Override\r\n\t\t\t\t\t\t\t\t\t\t\tpublic void Payment(String result) {\n\r\n\t\t\t\t\t\t\t\t\t\t\t}", "public void makePayment()\n\t{\n\t\tif(this.inProgress())\n\t\t{\n\t\t\tthis.total += this.getPaymentDue();\n\t\t\tthis.currentTicket.setPaymentTime(this.clock.getTime());\n\t\t}\t\t\n\t}", "@Override\n public void makePayment(Item item, Customer customer, double amount) {\n itemRepo.createPayment(item,customer,amount);\n }", "CarPaymentMethod processCreditCard();", "public void payCharge()\r\n\t{\r\n\t\tSystem.out.print(\"This method is used for pay charge\");\t\r\n\t}", "public void sendPaymentToMerchant() {\n // Check for successful send and a BIP70 Payment requirement\n if (lastBitcoinSentEvent != null && lastBitcoinSentEvent.isSendWasSuccessful()) {\n Preconditions.checkNotNull(getPaymentRequestData());\n Preconditions.checkState(getPaymentRequestData().isPresent());\n Preconditions.checkNotNull(getPaymentRequestData().get().getPaymentSessionSummary());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().isPresent());\n Preconditions.checkState(getPaymentRequestData().get().getPaymentSessionSummary().get().hasPaymentSession());\n\n PaymentSessionSummary paymentSessionSummary = getPaymentRequestData().get().getPaymentSessionSummary().get();\n\n // Send the Payment message to the merchant\n try {\n final List<Transaction> transactionsSent = Lists.newArrayList(lastBitcoinSentEvent.getTransaction().get());\n final PaymentRequestData finalPaymentRequestData = getPaymentRequestData().get();\n\n final Optional<PaymentSessionSummary.PaymentProtocolResponseDto> dto = paymentSessionSummary.sendPaymentSessionPayment(\n transactionsSent,\n lastBitcoinSentEvent.getChangeAddress(),\n getSendBitcoinEnterPaymentMemoPanelModel().getPaymentMemo());\n\n final Protos.Payment finalPayment = dto.get().getFinalPayment();\n final ListenableFuture<PaymentProtocol.Ack> future = dto.get().getFuture();\n\n if (future != null) {\n Futures.addCallback(\n future, new FutureCallback<PaymentProtocol.Ack>() {\n @Override\n public void onSuccess(PaymentProtocol.Ack result) {\n\n // Have successfully received a PaymentAck from the merchant\n log.info(\"Received PaymentAck from merchant. Memo: {}\", result.getMemo());\n getSendBitcoinShowPaymentACKMemoPanelModel().setPaymentACKMemo(result.getMemo());\n\n PaymentProtocolService paymentProtocolService = CoreServices.getPaymentProtocolService();\n\n if (finalPayment != null) {\n Optional<Protos.PaymentACK> paymentACK = paymentProtocolService.newPaymentACK(finalPayment, result.getMemo());\n\n finalPaymentRequestData.setPayment(Optional.of(finalPayment));\n finalPaymentRequestData.setPaymentACK(paymentACK);\n log.debug(\"Saving PaymentMemo of {} and PaymentACKMemo of {}\", finalPayment.getMemo(), paymentACK.isPresent() ? paymentACK.get().getMemo() : \"n/a\");\n WalletService walletService = CoreServices.getOrCreateWalletService(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletId());\n walletService.addPaymentRequestData(finalPaymentRequestData);\n\n // Write payments\n CharSequence password = WalletManager.INSTANCE.getCurrentWalletSummary().get().getWalletPassword().getPassword();\n if (password != null) {\n walletService.writePayments(password);\n }\n\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(true, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_OK, null));\n } else {\n log.error(\"No payment and hence cannot save payment or paymentACK\");\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Failed to communicate with the merchant\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }\n });\n } else {\n throw new PaymentProtocolException(\"Failed to create future from Ack\");\n }\n } catch (IOException | PaymentProtocolException e) {\n log.error(\"Unexpected failure\", e);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{e.getClass().getCanonicalName() + \" \" + e.getMessage()}));\n }\n } else {\n String message = \"Bitcoin not sent successfully so no payment sent to requestor\";\n log.debug(message);\n CoreEvents.firePaymentSentToRequestorEvent(new PaymentSentToRequestorEvent(false, CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED, new String[]{message}));\n }\n }", "@Override\n\tpublic void msgPaymentAccepted(Lord l,double amount) {\n\t\t\n\t}", "String confirmPayment(String userName, String teamName, Payment payment) throws RemoteException,\n InterruptedException;", "public void makeAnotherPayment() {\n btnMakeAnotherPayment().click();\n }", "@Override\r\n\tpublic void pay(long dateTime, float charge) {\n\t\t\r\n\t}", "public void performPayment() {\n payment.executePayment(amount);\n }", "private void handleConfirmBillPayment() {\n\t\t// TODO Auto-generated method stub\n\t\ttry {\n\t\t\tPaymentBiller request = new PaymentBiller();\n\t\t\tObjectFactory f = new ObjectFactory();\n\t\t\tCommonParam2 commonParam = f.createCommonParam2();\n\t\t\t\n\t\t\tcommonParam.setProcessingCode(f.createCommonParam2ProcessingCode(\"100601\"));\n\t\t\tcommonParam.setChannelId(f.createCommonParam2ChannelId(\"6018\"));\n\t\t\tcommonParam.setChannelType(f.createCommonParam2ChannelType(\"PB\"));\n\t\t\tcommonParam.setNode(f.createCommonParam2Node(\"WOW_CHANNEL\"));\n\t\t\tcommonParam.setCurrencyAmount(f.createCommonParam2CurrencyAmount(\"IDR\"));\n\t\t\tcommonParam.setAmount(f.createCommonParam2Amount(String.valueOf(billPayBean.getBillAmount())));\n\t\t\tcommonParam.setCurrencyfee(f.createCommonParam2Currencyfee(billPayBean.getFeeCurrency()));\n\t\t\tcommonParam.setFee(f.createCommonParam2Fee(String.valueOf(billPayBean.getFeeAmount())));\n\t\t\tcommonParam.setTransmissionDateTime(f.createCommonParam2TransmissionDateTime(PortalUtils.getSaveXMLGregorianCalendar(Calendar.getInstance()).toXMLFormat()));\n\t\t\tcommonParam.setRequestId(f.createCommonParam2RequestId(MobiliserUtils.getExternalReferenceNo(isystemEndpoint)));\n\t\t\tcommonParam.setAcqId(f.createCommonParam2AcqId(\"213\"));\n\t\t\tcommonParam.setReferenceNo(f.createCommonParam2ReferenceNo(String.valueOf(billPayBean.getReferenceNumber())));\n\t\t\tcommonParam.setTerminalId(f.createCommonParam2TerminalId(\"WOW\"));\n\t\t\tcommonParam.setTerminalName(f.createCommonParam2TerminalName(\"WOW\"));\n\t\t\tcommonParam.setOriginal(f.createCommonParam2Original(billPayBean.getAdditionalData()));\n\t\t\t\n\t\t\trequest.setCommonParam(commonParam);\n\t\t\tPhoneNumber phone = new PhoneNumber(this.getMobiliserWebSession().getBtpnLoggedInCustomer().getUsername());\n\t\t\trequest.setAccountNo(phone.getNationalFormat());\n\t\t\trequest.setBillerCustNo( billPayBean.getSelectedBillerId().getId()); \n\t\t\trequest.setDebitType(\"0\");\n\t\t\trequest.setInstitutionCode(billPayBean.getBillerId());\n\t\t\trequest.setProductID(billPayBean.getProductId());\n\t\t\trequest.setUnitId(\"0901\");\n\t\t\trequest.setProcessingCodeBiller(\"501000\");\n\t\t\t\n\t\t\tString desc1=\"Bill Payment\";\n\t\t\tString desc2= billPayBean.getBillerId();\n\t\t\tString desc3=\"\";\n\t\t\t\n\t\t\trequest.setAdditionalData1(desc1);\n\t\t\trequest.setAdditionalData2(desc2);\n\t\t\trequest.setAdditionalData3(desc3);\n\t\t\t\n\t\t\tPaymentBillerResponse response = new PaymentBillerResponse();\n\t\t\t\n\t\t\tresponse = (PaymentBillerResponse) webServiceTemplete.marshalSendAndReceive(request, \n\t\t\t\t\tnew WebServiceMessageCallback() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void doWithMessage(WebServiceMessage message) throws IOException,\n\t\t\t\t\t\tTransformerException {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t((SoapMessage) message)\n\t\t\t\t\t.setSoapAction(\"com_btpn_biller_ws_provider_BtpnBillerWsTopup_Binder_paymentBiller\");\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tif (response.getResponseCode().equals(\"00\")) {\n\t\t\t\tbillPayBean.setStatusMessage(getLocalizer().getString(\"success.perform.billpayment\", this));\n\t\t\t\tsetResponsePage(new BankBillPaymentStatusPage(billPayBean));\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(MobiliserUtils.errorMessage(response.getResponseCode(), response.getResponseDesc(), getLocalizer(), this));\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\terror(getLocalizer().getString(\"error.exception\", this));\n\t\t\tLOG.error(\"An exception was thrown\", e);\n\t\t}\n\t}", "int payInTurbo(String turboCardNo, float turboAmount, String destinationTurboOfCourse, String installmentsButInTurbo);", "@Override\n\tpublic void payCreditCard() {\n System.out.println(\"creditcard payed\");\t\t\n\t}", "public io.grpc.stub.StreamObserver<lnrpc.Rpc.SendRequest> sendPayment(\n io.grpc.stub.StreamObserver<lnrpc.Rpc.SendResponse> responseObserver) {\n return asyncBidiStreamingCall(\n getChannel().newCall(getSendPaymentMethod(), getCallOptions()), responseObserver);\n }", "private void returnDeposit(String paymentInfo) {\n }", "@Override\n public int pay(String cardNo, float amount, String destination, String installments) {\n System.out.println(\"********* pay method of ModernPayment interface is working ***********\");\n System.out.print(\"A payment of \" + amount + \"TL was made to the credit card number \" + cardNo + \" of the \" + destination + \" Bank \");\n System.out.println(\"and \" + installments + \" installments were made to payment.\");\n System.out.println();\n return 1;\n }", "@Override\n\tpublic void processPayment() {\n\t\t\n\t\tsetIsSuccessful();\n\t}", "@Override\r\n\tpublic void fundTransfer(String sender, String reciever, double amount) {\n\t\t\r\n\t\tString name, newMobileNo;\r\n\t\tfloat age;\r\n\t\tdouble amountFund;\r\n\t\t\r\n\t\tCustomer custSender = custMap.get(sender);\r\n\t\tCustomer custReciever = custMap.get(reciever);\r\n\t\t\r\n\t\tdouble recieverAmount = custReciever.getInitialBalance();\r\n\t\tdouble senderAmount = custSender.getInitialBalance();\r\n\t\tif(senderAmount - amount > 500){\r\n\t\t\trecieverAmount += amount;\r\n\t\t\tsenderAmount -= amount;\r\n\t\t\tSystem.out.println(\"Fund Transferred\");\r\n\t\t}\r\n\t\tname = custSender.getName();\r\n\t\tnewMobileNo = custSender.getMobileNo();\r\n\t\tage = custSender.getAge();\r\n\t\tamountFund = senderAmount;\r\n\t\t\r\n\t\tcustSender.setAge(age);\r\n\t\tcustSender.setInitialBalance(senderAmount);\r\n\t\tcustSender.setMobileNo(newMobileNo);\r\n\t\tcustSender.setName(name);\r\n\t\t\r\n\t\tcustMap.put(newMobileNo, custSender);\r\n\t\t\r\n\t\tname = custReciever.getName();\r\n\t\tnewMobileNo = custReciever.getMobileNo();\r\n\t\tage = custReciever.getAge();\r\n\t\tamountFund = recieverAmount;\r\n\t\t\r\n\t\tcustReciever.setAge(age);\r\n\t\tcustReciever.setInitialBalance(recieverAmount);\r\n\t\tcustReciever.setMobileNo(newMobileNo);\r\n\t\tcustReciever.setName(name);\r\n\t\t\r\n\t\tcustMap.put(newMobileNo, custReciever);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic String pay(double amount) {\n\t\treturn \"Paid : $\" + amount + \" using PayPal.\" + \"Email: \" + this.emailId + \"password : \" + this.password;\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource()==pay){\n if(model.getflag()==true&&!model.getCustomer().getUsername().isEmpty()){\n order.setName(NameOnCard.getText());\n order.setAddress(Address.getText());\n if(type==OrderType.delivery){\n boolean payflag=model.getCustomer().paythebill(model.getCustomer().getOrder(),CardNumber.getText(),ExpirationTime.getText(),NameOnCard.getText());\n boolean addressflag=false;\n if(Address.getText().isEmpty()){\n addressflag=true;\n }\n if(payflag==true && addressflag==false){\n\n JOptionPane.showMessageDialog(this,\"Payment succeed!\");\n dispose();\n }\n else if( addressflag==true){\n JOptionPane.showMessageDialog(this,\"Address required\");\n }\n else{\n JOptionPane.showMessageDialog(this,\"Invalid card info\");\n }\n }\n else{\n boolean payflag=model.getCustomer().paythebill(model.getCustomer().getOrder(),CardNumber.getText(),ExpirationTime.getText(),NameOnCard.getText());\n\n if(payflag==true){\n\n JOptionPane.showMessageDialog(this,\"Payment succeed!\");\n dispose();\n }\n\n else{\n JOptionPane.showMessageDialog(this,\"Invalid card info\");\n }\n }\n\n }else{\n\n int index=model.getOrders().size()-1;\n\n if(type==OrderType.delivery){\n\n order.setName(NameOnCard.getText());\n order.setAddress(Address.getText());\n boolean addressflag=false;\n if(Address.getText().isEmpty()){\n addressflag=true;\n }\n boolean payflag=model.paythebill(model.getOrders().get(index),CardNumber.getText(),ExpirationTime.getText(),NameOnCard.getText());\n if(payflag==true && addressflag==false){\n\n JOptionPane.showMessageDialog(this,\"Payment succeed!\");\n dispose();\n }\n else if( addressflag==true){\n JOptionPane.showMessageDialog(this,\"Address required\");\n }\n else{\n JOptionPane.showMessageDialog(this,\"Invalid card info\");\n }\n }\n else{\n\n order.setName(NameOnCard.getText());\n order.setAddress(Address.getText());\n\n\n boolean payflag=model.paythebill(model.getOrders().get(index),CardNumber.getText(),ExpirationTime.getText(),NameOnCard.getText());\n if(payflag==true ){\n\n JOptionPane.showMessageDialog(this,\"Payment succeed!\");\n dispose();\n }\n\n else{\n JOptionPane.showMessageDialog(this,\"Invalid card info\");\n }\n }\n\n }\n }\n if(e.getSource()==cancel){\n dispose();\n }\n\n }", "public void pay(InternalAccountOwner from, InternalAccountOwner to, BigDecimal amount) {\n PerformPaymentData data;\n try {\n data = transactionService.getPaymentData(from, to, null);\n } catch (EntityNotFoundException e) {\n System.out.println(\"Some of the users were not found. Transaction aborted.\");\n return;\n }\n\n // try to figure out the type of payment (for some reason)\n List<TransferTypeWithCurrencyVO> types = data.getPaymentTypes();\n TransferTypeWithCurrencyVO paymentType = CollectionHelper.first(types);\n if (paymentType == null) {\n System.out.println(\"There is no possible payment type.\");\n }\n\n // set up payment to be made\n PerformPaymentDTO payment = new PerformPaymentDTO();\n payment.setType(paymentType);\n payment.setFrom(from);\n payment.setTo(to);\n payment.setAmount(amount);\n\n try {\n PaymentVO result = paymentService.perform(payment);\n TransactionAuthorizationStatus authStatus = result.getAuthorizationStatus();\n if (authStatus == TransactionAuthorizationStatus.PENDING_AUTHORIZATION) {\n System.out.println(\"The payment is pending authorization.\");\n } else {\n System.out.println(\"The payment has been processed.\");\n }\n } catch (InsufficientBalanceException e) {\n System.out.println(\"Insufficient balance\");\n } catch (MaxPaymentsPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MaxPaymentsPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of transfers \"\n + e.getMaxPayments() + \" has been reached\");\n } catch (MinTimeBetweenPaymentsException e) {\n System.out.println(\"A minimum period of time should be awaited to make \"\n + \"a payment of this type\");\n } catch (MaxAmountPerDayExceededException e) {\n System.out.println(\"Maximum daily amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerWeekExceededException e) {\n System.out.println(\"Maximum weekly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (MaxAmountPerMonthExceededException e) {\n System.out.println(\"Maximum monthly amount of \"\n + e.getMaxAmount() + \" has been reached\");\n } catch (Exception e) {\n System.out.println(\"The payment couldn't be performed\");\n }\n\n }", "private void sendMoney(String amount, String address) {\n//\t\tAlertDialog ad = new AlertDialog.Builder(DonateActivity.this).create(); \n//\t\tad.setMessage(\"Sending money is disabled for testing purposes. See DonateActivity.sendMoney()\"); \n//\t\tad.setButton(DialogInterface.BUTTON_POSITIVE, \"OK\", new DialogInterface.OnClickListener() { \n//\t\t @Override \n//\t\t public void onClick(DialogInterface dialog, int which) { \n//\t\t dialog.dismiss(); \n//\t\t } \n//\t\t}); \n//\t\tad.show();\n\t\t\n\t\t// TODO: uncomment this when you want to send money\n \tString url = \"https://coinbase.com/api/v1/transactions/send_money/\";\n\t\tnew SendMoneyTask().execute(url, amount, address);\n \t//Intent intent = new Intent(getApplicationContext(), ThankYouActivity.class);\n \t//intent.putExtra(\"charity\", charity);\n \t//startActivity(intent);\n }", "private void confirmDrugOrder(String paySerialNumber) {\r\n\r\n showNetworkCacheCardView();\r\n lockPayNowOrHavePayButton(BEING_VERIFICATION);\r\n String requestAction = \"confirmOrder\";\r\n String parameter = \"&paySerialNumber=\" + paySerialNumber;\r\n HttpUtil.sendOkHttpRequest(requestAction, parameter, new Callback() {\r\n @Override\r\n public void onFailure(Call call, IOException e) {\r\n //because of network,the client can't recive message,but has success.\r\n closeNetworkCacheCardView();\r\n showErrorCardView(ACCESS_TIMEOUT);\r\n lockPayNowOrHavePayButton(ACCESS_TIMEOUT);\r\n }\r\n\r\n @Override\r\n public void onResponse(Call call, Response response) throws IOException {\r\n message = gson.fromJson(response.body().string(), Message.class);\r\n closeNetworkCacheCardView();\r\n if (message.isSuccess()) {\r\n // show pay success\r\n showPaySuccessCardView();\r\n lockPayNowOrHavePayButton(HAVE_PAY);\r\n } else {\r\n // other problems.it cause update fail\r\n showErrorCardView(UNKNOWN_ERROR);\r\n lockPayNowOrHavePayButton(UNKNOWN_ERROR);\r\n }\r\n }\r\n });\r\n\r\n }", "public void purchase() {\r\n\t\tdo {\r\n\t\t\tString id = getToken(\"Enter customer id: \");\r\n\t\t\tString brand = getToken(\"Enter washer brand: \");\r\n\t\t\tString model = getToken(\"Enter washer model: \");\r\n\t\t\tint quantity = getInteger(\"Enter quantity to purchase: \");\r\n\t\t\tboolean purchased = store.purchaseWasher(id, brand, model, quantity);\r\n\t\t\tif (purchased) {\r\n\t\t\t\tSystem.out.println(\"Purchased \" + quantity + \" of \" + brand + \" \" + model + \" for customer \" + id);\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Purchase unsuccessful.\");\r\n\t\t\t}\r\n\t\t} while (yesOrNo(\"Make another Purchase?\"));\r\n\t}", "@Override\n public String getDescription() {\n return \"Ordinary payment\";\n }", "public void cashReceipt(int amount){\r\n System.out.println(\"Take the receipt\");\r\n }", "public void mailPromo(String fname, String customerEmail, String promo, double discount){\n\t Properties props = makeProps();\r\n\t \r\n\t final String username = \"cinema4050@gmail.com\";\r\n\t final String password = \"movie4050\";\r\n\t \r\n\t try{\r\n\t Session session = Session.getDefaultInstance(props, \r\n\t new Authenticator(){\r\n\t protected PasswordAuthentication getPasswordAuthentication() {\r\n\t return new PasswordAuthentication(username,password);}});\r\n\t // -- Create a new message --\r\n\t Message msg = new MimeMessage(session);\r\n\t \r\n\t /* from */\r\n\t msg.setFrom(new InternetAddress(username));\r\n\t \r\n\t /* to */\r\n\t msg.setRecipients(Message.RecipientType.TO, \r\n\t InternetAddress.parse(customerEmail,false));\r\n\t /* title */\r\n\t msg.setSubject(\"New Promotion!\");\r\n\t \r\n\t /* text field */ \r\n\t String sendThis = \"Hello \"+fname + \"!\\n\\n\"\r\n\t + \"We are emailing you to inform you that there is a new promotion.\\n\"\r\n\t + \"Use code -- \"+promo+\" -- to save $\" + discount + \"0 on your next purchase on CINEMA4050!\\n\"\r\n\t + \"Thank you for using our service!\\n\";\r\n\t msg.setText(sendThis);\r\n\t msg.setSentDate(new Date());\r\n\t Transport.send(msg);\r\n\t \r\n\t System.out.println(\"Message sent.\");\r\n\t }catch (MessagingException e){ \r\n\t System.out.println(\"Error: \" + e);\r\n\t }\r\n\t \r\n\t }", "@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource()==autopay){\n model.getCustomer().getOrder().orderStatus=OrderStatus.paid;\n dispose();\n }\n\n if(e.getSource()==Paywithanothercard){\n if(model.getCustomer().getOrder().orderStatus.name().equals(\"unpaid\")){\n //String orNUm=model.getCustomer().or.orderNumber;\n new Payment(model.getCustomer().getOrder(),model.getCustomer().getOrder().orderType);\n // System.out.println(model.getCustomer().or.orderNumber+\" \"+model.getCustomer().or.orderStatus);\n }else{\n JOptionPane.showMessageDialog(this,\n \"Your order has paied\", \"Error Message\",\n JOptionPane.ERROR_MESSAGE);\n }\n dispose();\n }\n\n\n if(e.getSource()==cancel){\n dispose();\n }\n\n }", "public void transact() {\n\t\truPay.transact();\n\n\t}", "void buyDevCard();", "public void payment(double total_sales_of_transaction) {\n String payment_typ = \"\";\n Scanner scan = new Scanner(System.in);\n\n System.out.printf(\"Which payment type do you wish to use?\\n\");\n System.out.printf(\"1. Cash\\n\");\n System.out.printf(\"2. Card\\n\");\n \n\n do {\n System.out.printf(\"Please enter your choice :\");\n try {\n choice = scan.nextInt();\n } catch (InputMismatchException e) {\n scan.next();\n System.out.println(\"Something went wrong.\\n\");\n }\n } while (choice<1 || choice >2);\n\n \n\n\n if (choice == 2) {\n boolean valid_ccN = false;\n cerdit_card_ID = scan.nextLine();\n while (valid_ccN == false) {\n valid_ccN = verifiying_payment(cerdit_card_ID);\n if(valid_ccN == true){break;}\n scan.next();\n System.out.println(\"Please enter a valid CC number :\");\n cerdit_card_ID = scan.nextLine();\n }\n\n System.out.println(\"Your payment has been accpeted.\\n\");\n payment_typ = \"CC\";\n payment_used = \"CARD\";\n\n } else {\n verifiying_payment();\n payment_typ = \"C\";\n payment_used = \"CASH\";\n\n }\n\n payment_id = generate_payment_ID(payment_typ);\n printPaymentSummary();\n }", "public void payedConfirmation(){\n\t\tassert reserved: \"a seat also needs to be reserved when bought\";\n\t\tassert customerId != -1: \"this seat needs to have a valid user id\";\n\t\tpayed = true;\n\t}", "public static String payWithMoMo(String transactionId, String mobile, Double amount, String email, String customerName, String returnUrl) throws Exception{\n String privateKey = PRIVATE_KEY;\n HttpURLConnection client = (HttpURLConnection) new URL(\"https://api.flutterwave.com/v3/payments\").openConnection();\n client.setRequestMethod(\"POST\");\n client.setDoOutput(true);\n client.addRequestProperty(\"Content-type\", \"application/json\");\n client.addRequestProperty(\"Authorization\", \"Bearer \"+privateKey);\n JSONObject customer = new JSONObject();\n customer.put(\"name\", customerName);\n customer.put(\"email\", email);\n JSONObject data = new JSONObject();\n data.put(\"tx_ref\", transactionId);\n data.put(\"amount\", amount);\n data.put(\"currency\", \"USD\");\n data.put(\"customer\", customer);\n data.put(\"redirect_url\", returnUrl);\n client.getOutputStream().write(data.toJSONString().getBytes());\n client.getInputStream();\n JSONParser jsonp = new JSONParser();\n String url = (String)(((JSONObject)((JSONObject)jsonp.parse(new InputStreamReader(client.getInputStream()))).get(\"data\"))).get(\"link\");\n return url;\n }", "private static String sendPayment(String name, String numberCard, YearMonth dateValidCard, int numParcel, double value, BufferedReader in, PrintWriter out) throws IOException {\n\t\t//formatando a string de retorno dos dados\n\t\tout.println(String.format(\"%s;%s;%s;%d;%s\", name, numberCard, dateValidCard.format(DateTimeFormatter.ofPattern(\"MM/yyyy\")), numParcel, String.valueOf(value)));\n\t\t\n\t\tString status = in.readLine();\n\t\t\n\t\tif (status.equals(\"OK\")) {\n\t\t\treturn null;\n\t\t}else {\n\t\t\treturn status;\n\t\t}\n\t}", "@Test(priority = 4)\n\tpublic void testPayment() {\n\t\tlogger = extent.startTest(\"passed\");\n\t\tWebDriverWait wait = new WebDriverWait(driver, 100);\n\t\twait.until(ExpectedConditions.presenceOfElementLocated(By.className(\"payment-info\")));\n\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"swit\\\"]/div[1]\")).click();\n\t\tdriver.findElement(By.id(\"btn\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t// For netbanking login\n\t\tdriver.findElement(By.name(\"username\")).sendKeys(\"123456\");\n\t\tdriver.findElement(By.name(\"password\")).sendKeys(\"Pass@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='LOGIN']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Payment Gateway\");\n\n\t\t//\n\t\tdriver.findElement(By.name(\"transpwd\")).sendKeys(\"Trans@456\");\n\t\tdriver.findElement(By.xpath(\"//input[@type='submit' and @value='PayNow']\")).click();\n\t\tAssert.assertEquals(driver.getTitle(), \"Order Details\");\n\t\tlogger.log(LogStatus.PASS, \"testPayment Testcase is passed\");\n\t}", "private void generateAndSubmitOrder()\n {\n OrderSingle order = Factory.getInstance().createOrderSingle();\n order.setOrderType(OrderType.Limit);\n order.setPrice(BigDecimal.ONE);\n order.setQuantity(BigDecimal.TEN);\n order.setSide(Side.Buy);\n order.setInstrument(new Equity(\"METC\"));\n order.setTimeInForce(TimeInForce.GoodTillCancel);\n if(send(order)) {\n recordOrderID(order.getOrderID());\n }\n }", "@Override\n\tpublic String pay(ZFTMerchantConfig merchant, ZFTOrderConfig order) throws Exception {\n\t\treturn null;\n\t}", "public void onPayClick(){\n this.user.updateCreditDec(priceToBePaid);\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Information Dialog\");\n alert.setHeaderText(null);\n alert.setContentText(\"Payment successful! You payed \" + cost.getText());\n alert.showAndWait();\n }", "public void save_order_without_payment(String advert, String userWhoGive,String userWhoGet,Date date,Date start, Date finish,Float price);", "@Override\n\tpublic void msgAtCashier() {\n\t\t\n\t}", "static String serve(Customer customer) {\r\n\t\tString serviceReport = String.format(\r\n\t\t\t\"%d: %s %s arrived at %s to %s $%.2f and spoke to teller %d. Current balance: $%.2f\",\r\n\t\t\tcustomer.customerId,\r\n\t\t\tcustomer.firstName,\r\n\t\t\tcustomer.lastName,\r\n\t\t\tCustomerFunctions.getTime(customer.arrivalTime),\r\n\t\t\tCustomerFunctions.transactionTypeString(customer.transactionType),\r\n\t\t\tcustomer.transactionAmount,\r\n\t\t\tcustomer.tellerNo,\r\n\t\t\tcustomer.balance\r\n\t\t\t);\r\n\r\n\t\t// Perform deposit / withdrawl on customer account\r\n\t\tif (customer.transactionType == 'D') customer.balance += customer.transactionAmount;\r\n\t\telse customer.balance -= customer.transactionAmount;\r\n\r\n\t\tserviceReport += String.format(\r\n\t\t\t\", New balance: $%.2f, Wait time: %d minutes%n%n\",\r\n\t\t\tcustomer.balance,\r\n\t\t\tcustomer.serviceTime\r\n\t\t\t);\r\n\r\n\t\t// Add to teller totals\r\n\t\ttellerCount[customer.tellerNo - 1] += 1;\r\n\t\tif (customer.transactionType == 'D') tellerDeposits[customer.tellerNo - 1] += customer.transactionAmount;\r\n\t\telse tellerWithdrawls[customer.tellerNo-1] += customer.transactionAmount;\r\n\r\n\t\treturn serviceReport;\r\n\t}", "private void takeOrder(MyCustomer customer) {\n\tDo(\"Taking \" + customer.cmr +\"'s order.\");\n\tPosition tablePos = new Position(tables[customer.tableNum].getX()-1,\n\t\t\t\t\t tables[customer.tableNum].getY()+1);\n\tguiMoveFromCurrentPostionTo(tablePos);\n\tcustomer.state = CustomerState.NO_ACTION;\n\tcustomer.cmr.msgWhatWouldYouLike();\n\tstateChanged();\n }", "public void payForOrder(){\n\t\tcurrentOrder.setDate(new Date()); // setting date to current\n\t\t\n\t\t//Checking if tendered money is enough to pay for the order.\n\t\tfor(;;){\n\t\t\tJOptionPane.showMessageDialog(this.getParent(), new CheckoutPanel(currentOrder), \"\", JOptionPane.PLAIN_MESSAGE);\n\t\t\tif(currentOrder.getTendered().compareTo(currentOrder.getSubtotal())==-1){\n\t\t\t\tJOptionPane.showMessageDialog(this.getParent(), \"Not enough money tendered\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t//Setting order number.\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tString str = df.format(currentOrder.getDate());\n\t\tString number = Integer.toString(till.getOrders().size()+1) +\"/\"+str;\n\t\tcurrentOrder.setNumber(number);\n\t\t\n\t\t//Setting customer name.\n\t\tcurrentOrder.setCustomerName(custNameField.getText());\n\t\t\n\t\t//Adding current order to orders list.\n\t\ttill.getOrders().add(currentOrder); \n\t\t\n\t\t//Displays the receipt.\n\t\tJOptionPane.showMessageDialog(this.getParent(), new ReceiptPanel(currentOrder), \"Receipt\", \n\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t\t\n\t\t//Resets OrderPanel.\n\t\tthis.resetOrder();\n\t}", "public ModelPayment(double payment) {\n this.payment = payment;\n }", "public void credit() {\n \tSystem.out.println(\"HSBC--Credit--from US Bank\");\n }", "private String PayAgentPayment(HttpServletRequest request) {\n\n try {\n HttpSession session = request.getSession();\n int serviceId = Integer.parseInt(request.getParameter(CONFIG.PARAM_SERVICE_ID));\n int operationId = Integer.parseInt(request.getParameter(CONFIG.OPERATION_ID));\n String amount = request.getParameter(CONFIG.AMOUNT);\n String agentIdentifier = request.getParameter(CONFIG.PARAM_MSISDN);\n int custId = Integer.parseInt((String) request.getSession().getAttribute(CONFIG.PARAM_PIN));\n String lang = request.getSession().getAttribute(CONFIG.lang).equals(\"\") ? \"en\" : \"ar\";\n\n Donation_AgentPaymentRequestDTO agentPaymentRequestDTO = new Donation_AgentPaymentRequestDTO();\n agentPaymentRequestDTO.setSERVICE_ID(serviceId);\n agentPaymentRequestDTO.setOPERATION_ID(operationId);\n agentPaymentRequestDTO.setAMOUNT(amount);\n agentPaymentRequestDTO.setCUSTOMER_ID(custId);\n agentPaymentRequestDTO.setAGENT_IDENTIFIER(agentIdentifier);\n agentPaymentRequestDTO.setCHANNEL(\"WEB\");\n agentPaymentRequestDTO.setLANG(lang);\n String national_id = request.getParameter(\"national_ID\");\n agentPaymentRequestDTO.setNATIONAL_ID(national_id);\n\n DonationAgentPaymentRespponseDto agentPaymentRespponseDto = MasaryManager.getInstance().do_agent_payment_without_inquiry(agentPaymentRequestDTO);\n MasaryManager.logger.info(\"Error code \" + agentPaymentRespponseDto.getSTATUS_CODE());\n if (agentPaymentRespponseDto.getSTATUS_CODE().equals(\"200\")) {\n\n session.setAttribute(\"donationPaymentResponse\", agentPaymentRespponseDto);\n session.setAttribute(\"SERVICE_ID\", (String.valueOf(serviceId)));\n\n// request.setAttribute(\"Fees\", fees.trim());\n return CONFIG.PAGE_PAY_AGENTPAYMENT;\n } else {\n request.getSession().setAttribute(\"ErrorCode\", CONFIG.getBillErrorCode(request.getSession())\n .concat(agentPaymentRespponseDto.getSTATUS_CODE())\n .concat(\" \")\n .concat(agentPaymentRespponseDto.getSTATUS_MESSAGE()));\n return CONFIG.PAGE_Agent_Payment;\n\n }\n\n } catch (Exception e) {\n MasaryManager.logger.error(\"Exception\" + e.getMessage(), e);\n\n request.getSession().setAttribute(\"ErrorCode\", e.getMessage());\n return CONFIG.PAGE_Agent_Payment;\n }\n\n }", "Order sendNotificationNewOrder(Order order);", "private void payButtonClicked() {\n if (checkBoxAgreedTAC.isChecked()) {\n boolean validCard = validateCard();\n if (validCard) {\n Double payAmount = Double.parseDouble(textViewPrepaidPrice.getText().toString());\n MainActivity.bus.post(new PrepayPaymentAttemptEvent(payAmount, Long.parseLong(litersToBuy.getText().toString())));\n if (PrepayCalculatorFragment.this.payDialog != null) {\n PrepayCalculatorFragment.this.payDialog.dismiss();\n }\n }\n } else {\n Toast.makeText(getActivity(), getResources().getString(R.string.TACMustAgreedMessage), Toast.LENGTH_SHORT).show();\n }\n\n }", "public void printReceipt(int amount){\r\n PaymentAuthorization payAuth = new PaymentAuthorization();\r\n if (payAuth.authRequest(card)){\r\n System.out.println(\"Take the receipt\");\r\n }\r\n }", "SerialResponse createCustomer(PinCustomerPost pinCustomerPost);", "@PostMapping(\"/payment/pay/{user_id}/{order_id}/{amount}\")\n public String postPayment(@PathVariable(name=\"user_id\") String user_id, @PathVariable(name=\"amount\") Integer amount) {\n String credit = \"\";\n try (ActorClient client = new ActorClient()) {\n ActorProxyBuilder<PaymentActor> builder = new ActorProxyBuilder(PaymentActor.class, client);\n// List<Thread> threads = new ArrayList<>(NUM_ACTORS);\n ExecutorService threadPool = Executors.newSingleThreadExecutor();\n\n ActorId actorId = new ActorId(user_id);\n PaymentActor actor = builder.build(actorId);\n Future<String> future =\n threadPool.submit(new CallActor(actorId.toString(), actor, 3, amount));\n\n credit = future.get();\n\n System.out.println(\"Got user credit: \"+credit);\n\n } catch (ExecutionException | InterruptedException e) {\n e.printStackTrace();\n }\n\n String json = \"{\\\"user_id\\\":\"+user_id+\",\"+\"\\\"credit\\\":\"+credit+\"}\";\n return json;\n }", "@Override\n\n public void onClick(View v) {\n\n simplify.createCardToken(cardEditor.getCard(), new CardToken.Callback() {\n\n @Override\n\n public void onSuccess(CardToken cardToken) {\n\n //Toast.makeText(getBaseContext(), \"Success\", Toast.LENGTH_SHORT).show();\n //finish();\n RequestManager.getInstance().init(getBaseContext());\n RequestManager.getInstance().paymentRequest(cardToken.getId());\n\n }\n\n @Override\n\n public void onError(Throwable throwable) {\n\n Toast.makeText(getBaseContext(), \"Success\", Toast.LENGTH_SHORT).show();\n\n }\n\n });\n\n\n }", "public void onBuyPressed() {\n PayPalPayment payment = new PayPalPayment(new BigDecimal(String.valueOf(totalAmount)), \"USD\", \"Total Price\",\n PayPalPayment.PAYMENT_INTENT_SALE);\n\n Intent intent = new Intent(this, PaymentActivity.class);\n\n // send the same configuration for restart resiliency\n intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);\n\n intent.putExtra(PaymentActivity.EXTRA_PAYMENT, payment);\n\n startActivityForResult(intent, 0);\n }", "@Override\n public double pay() {\n double payment = super.pay() + (this.commision_rate * this.total_sales);\n this.total_sales = 0;\n return payment;\n }", "@Async\n public boolean sendTransferToNotificationSMS(Customer source, Customer dest, Double rewardQty, RewardCurrency rewardCurrency, MessageWrapper messageWrapper) throws InspireNetzException {\n HashMap<String,String> fields = new HashMap<>(0);\n\n // Add the qty\n fields.put(\"#qty\",generalUtils.getFormattedValue(rewardQty));\n\n // Add the currencyname\n fields.put(\"#currencyname\",rewardCurrency.getRwdCurrencyName());\n\n // Add the sender name\n fields.put(\"#sender\",source.getCusLoyaltyId());\n\n /*// Get the reward balance\n CustomerRewardBalance customerRewardBalance = customerRewardBalanceService.findByCrbLoyaltyIdAndCrbMerchantNoAndCrbRewardCurrency(dest.getCusLoyaltyId(),dest.getCusMerchantNo(),rewardCurrency.getRwdCurrencyId());*/\n\n //get the reward balance\n List<CustomerRewardBalance> customerRewardBalances = customerRewardBalanceService.searchBalances(dest.getCusMerchantNo(),dest.getCusLoyaltyId(),rewardCurrency.getRwdCurrencyId());\n\n //if the list contains any entries set reward balance to the placeholder\n if(customerRewardBalances != null && customerRewardBalances.size()>0){\n\n // Send the points formatted\n fields.put(\"#points\",generalUtils.getFormattedValue(customerRewardBalances.get(0).getCrbRewardBalance()));\n\n }\n\n\n // Set the date\n String toDay = generalUtils.convertDateToFormat(new Date(System.currentTimeMillis()),\"dd MMM yyyy\");\n\n // Replace the date\n fields.put(\"#date\", toDay);\n\n //log the activity\n customerActivityService.logActivity(dest.getCusLoyaltyId(), CustomerActivityType.TRANSFER_POINT, \"Received \" + generalUtils.getFormattedValue(rewardQty) + \" points from :\" + source.getCusLoyaltyId(), source.getCusMerchantNo(), \"\");\n\n messageWrapper.setParams(fields);\n\n messageWrapper.setSpielName(MessageSpielValue.SPIEL_TRANSFER_POINT_TO);\n\n messageWrapper.setLoyaltyId(dest.getCusLoyaltyId());\n messageWrapper.setMerchantNo(dest.getCusMerchantNo());\n messageWrapper.setChannel(MessageSpielChannel.ALL);\n messageWrapper.setIsCustomer(IndicatorStatus.YES);\n\n return userMessagingService.transmitNotification(messageWrapper);\n\n }", "private void make_payment(int studentId)\n\t{\n\t\t\n\t\tdouble fee =0.0;\n\t\ttry\n\t\t{\n\t\t\tregistrationInterface.calculateFee(studentId);\n\t\t} \n\t\tcatch (SQLException e) \n\t\t{\n\n\t\t\tlogger.info(e.getMessage());\n\t\t}\n\n\t\tif(fee == 0.0)\n\t\t{\n\t\t\tlogger.info(\"You have not registered for any courses yet\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\tlogger.info(\"Your total fee = \" + fee);\n\t\t\tlogger.info(\"Want to continue Fee Payment(y/n)\");\n\t\t\tString ch = sc.next();\n\t\t\tif(ch.equals(\"y\"))\n\t\t\t{\n\t\t\t\tlogger.info(\"Select Mode of Payment:\");\n\t\t\t\t\n\t\t\t\tint index = 1;\n\t\t\t\tfor(ModeOfPayment mode : ModeOfPayment.values())\n\t\t\t\t{\n\t\t\t\t\tlogger.info(index + \" \" + mode);\n\t\t\t\t\tindex = index + 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tModeOfPayment mode = ModeOfPayment.getModeofPayment(sc.nextInt());\n\t\t\t\t\n\t\t\t\tif(mode == null)\n\t\t\t\t\tlogger.info(\"Invalid Input\");\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tNotification notify=null;\n\t\t\t\t\ttry \n\t\t\t\t\t{\n\t\t\t\t\t\tnotify = registrationInterface.payFee(studentId, mode,fee);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (SQLException e) \n\t\t\t\t\t{\n\n\t\t\t\t\t\tlogger.info(e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlogger.info(\"Your Payment is successful\");\n\t\t\t\t\tlogger.info(\"Your transaction id : \" + notify.getReferenceId());\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "public String formPaymentNeeded()\r\n {\r\n return formError(\"402 Payment required\",\"Payment is required\");\r\n }", "@Override\n\tprotected String showConfirmation() {\n\t\treturn \"Payment is successful. Check your credit card statement for PetSitters, Inc.\";\n\t}", "@Async\n public boolean sendTransferFromNotificationSMS(Customer source, Customer dest, Double rewardQty, RewardCurrency rewardCurrency, MessageWrapper messageWrapper) throws InspireNetzException {\n HashMap<String,String> fields = new HashMap<>(0);\n\n // Add the qty\n fields.put(\"#qty\",generalUtils.getFormattedValue(rewardQty));\n\n // Add the currencyname\n fields.put(\"#currencyname\",rewardCurrency.getRwdCurrencyName());\n\n // Add the recepient name\n fields.put(\"#receipientname\",dest.getCusLoyaltyId());\n\n /* // Get the reward balance\n CustomerRewardBalance customerRewardBalance = customerRewardBalanceService.findByCrbLoyaltyIdAndCrbMerchantNoAndCrbRewardCurrency(source.getCusLoyaltyId(),source.getCusMerchantNo(),rewardCurrency.getRwdCurrencyId());\n*/\n //get the reward balance\n List<CustomerRewardBalance> customerRewardBalances = customerRewardBalanceService.searchBalances(source.getCusMerchantNo(),source.getCusLoyaltyId(),rewardCurrency.getRwdCurrencyId());\n\n //if the list contains any entries set reward balance to the placeholder\n if(customerRewardBalances != null && customerRewardBalances.size()>0){\n\n // Send the points formatted\n fields.put(\"#points\",generalUtils.getFormattedValue(customerRewardBalances.get(0).getCrbRewardBalance()));\n\n }\n\n // Set the date\n String toDay = generalUtils.convertDateToFormat(new Date(System.currentTimeMillis()),\"dd MMM yyyy\");\n\n // Set the value for #date placeholder\n fields.put(\"#date\", toDay);\n\n //log the activity\n customerActivityService.logActivity(source.getCusLoyaltyId(), CustomerActivityType.TRANSFER_POINT, \"Transferred \" + generalUtils.getFormattedValue(rewardQty) + \" points to :\" + dest.getCusLoyaltyId(), source.getCusMerchantNo(), \"\");\n\n messageWrapper.setParams(fields);\n\n messageWrapper.setSpielName(MessageSpielValue.SPIEL_TRANSFER_POINT_FROM);\n\n\n messageWrapper.setMerchantNo(source.getCusMerchantNo());\n\n messageWrapper.setLoyaltyId(source.getCusLoyaltyId());\n\n messageWrapper.setChannel(MessageSpielChannel.ALL);\n\n messageWrapper.setIsCustomer(IndicatorStatus.YES);\n\n return userMessagingService.transmitNotification(messageWrapper);\n\n }", "@Override\n\tpublic void tranfermoney() {\n\t\tSystem.out.println(\"hsbc tranfermoney\");\n\t}", "String getPaymentInformation();", "public JSONResponse pay(HashMap<String, String> parameters) {\n\t\tString pos = parameters.get(\"pos\"); \t\t\t\t\t\t// the point of sale code.\n\t\tString reservationid = parameters.get(\"reservationid\");\t\t// the ID of the reservation.\n\t\tString date = parameters.get(\"date\"); \t\t\t\t\t\t// the date of the payment.\n\t\tString emailaddress = parameters.get(\"emailaddress\"); \t\t// the email address of the payer.\n\t\tString cardholder = parameters.get(\"cardholder\");\t\t\t// the card holder name.\n\t\tString cardnumber = parameters.get(\"cardnumber\");\t\t\t// the card number.\n\t\tString cardmonth = parameters.get(\"cardmonth\");\t\t\t\t// the card expiry month.\n\t\tString cardyear = parameters.get(\"cardyear\");\t\t\t\t// the card expiry year.\n\t\tString cardcode = parameters.get(\"cardcode\");\t\t\t\t// the card CCV code.\n\t\tString amount = parameters.get(\"amount\");\t\t\t\t\t// the amount to be charged to the card.\n\t\tString remote_host = parameters.get(\"remote_host\");\t\t\t// the remote host URL.\n\n\t\tDouble value = Double.valueOf(amount);\n\t\tif (pos == null || pos.isEmpty() || Model.decrypt(pos).length() > 10) {throw new ServiceException(Error.pos_invalid, pos);}\n\t\tif (reservationid == null || reservationid.isEmpty() || reservationid.length() > 10) {throw new ServiceException(Error.reservation_id, reservationid);}\n\t\tif (emailaddress == null || emailaddress.isEmpty() || !Party.isEmailAddress(emailaddress)) {throw new ServiceException(Error.party_emailaddress, emailaddress);}\n\t\tif (cardholder == null || cardholder.isEmpty() || cardholder.length() > 100) {throw new ServiceException(Error.card_holder, cardholder);}\n\t\tif (cardnumber == null || cardnumber.isEmpty() || cardnumber.length() > 20) {throw new ServiceException(Error.card_number, cardnumber);}\n\t\tif (cardmonth == null || cardmonth.isEmpty() || cardmonth.length() != 2) {throw new ServiceException(Error.card_month, cardmonth);}\n\t\tif (cardyear == null || cardyear.isEmpty() || cardyear.length() != 4) {throw new ServiceException(Error.card_year, cardyear);}\n\t\tif (cardcode == null || cardcode.isEmpty() || cardcode.length() < 3) {throw new ServiceException(Error.card_code, cardcode);}\n\t\tif (value == null || value <= 0.0) {throw new ServiceException(Error.card_amount, amount);}\n\n\t\tSqlSession sqlSession = RazorServer.openSession();\n\t\tPayWidgetItem result = new PayWidgetItem();\n\t\ttry {\n\t\t\tJSONService.getParty(sqlSession, pos);\n\t\t\tReservation reservation = sqlSession.getMapper(ReservationMapper.class).read(reservationid);\n//\t\t\tParty customer = JSONService.getCustomer (sqlSession, emailaddress, familyname, firstname, reservation.getOrganizationid(), agent.getId());\n//\t\t\treservation.setCustomerid(customer.getId());\n//\t\t\tFinance finance = JSONService.getFinance(sqlSession, customer.getId(), cardholder, cardnumber, cardmonth, cardyear,\tcardcode);\n//\t\t\treservation.setFinanceid(finance.getId());\n//\t\t\treservation.setNotes(notes);\n//\t\t\tsqlSession.getMapper(ReservationMapper.class).update(reservation);\n\n\t\t\tElement element = PaygateHandler.getXML(reservation.getName(), cardholder, cardnumber, cardmonth + cardyear, value, reservation.getCurrency(), cardcode, emailaddress, remote_host);\n\n\t\t\tEvent<Journal> event = JSONService.cardReceipt(sqlSession, reservation, element, cardholder, value);\n\t\t\tresult.setId(reservation.getOrganizationid());\n\t\t\tresult.setName(event.getName());\n\t\t\tresult.setState(RazorWidget.State.SUCCESS.name());\n\t\t\tresult.setAmount(value);\n\t\t\tresult.setCurrency(reservation.getCurrency());\n\t\t\tresult.setMessage(JSONService.getNotes(element));\n\t\t\tsqlSession.commit();\n\t\t}\n\t\tcatch (Throwable x) {\n\t\t\tsqlSession.rollback();\n\t\t\tresult.setId(null);\n\t\t\tresult.setName(null);\n\t\t\tresult.setState(RazorWidget.State.FAILURE.name());\n\t\t\tresult.setAmount(value == null ? 0.0 : value);\n\t\t\tresult.setCurrency(Currency.Code.USD.name());\n\t\t\tresult.setMessage(x.getMessage());\n\t\t}\n\t\tfinally {sqlSession.close();}\n\t\treturn result;\n\t}", "void sendTransaction(IUserAccount target, ITransaction trans, IUserAccount user);", "public io.grpc.stub.StreamObserver<lnrpc.Rpc.SendRequest> sendPayment(\n io.grpc.stub.StreamObserver<lnrpc.Rpc.SendResponse> responseObserver) {\n return asyncUnimplementedStreamingCall(getSendPaymentMethod(), responseObserver);\n }", "public abstract void generateReceipt(Transaction trans);", "ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewCapitalPayed();", "@Override\n public void onClick(View v) {\n merchantWebService = new MerchantWebService();\n merchantWebService.setKey(mPaymentParams.getKey());\n merchantWebService.setCommand(PayuConstants.SAVE_USER_CARD);\n merchantWebService.setHash(mPayuHashes.getSaveCardHash());\n merchantWebService.setVar1(mPaymentParams.getUserCredentials());\n merchantWebService.setVar2(\"\" + cardHolderNameEditText.getText().toString());\n merchantWebService.setVar3(PayuConstants.CC);\n merchantWebService.setVar4(PayuConstants.CC);\n merchantWebService.setVar5(\"\" + cardNameEditText.getText().toString());\n merchantWebService.setVar6(\"\" + cardNumberEditText.getText().toString());\n merchantWebService.setVar7(\"\" + cardExpiryMonthEditText.getText().toString());\n merchantWebService.setVar8(\"\" + cardExpiryYearEditText.getText().toString());\n\n postData = new MerchantWebServicePostParams(merchantWebService).getMerchantWebServicePostParams();\n\n if (postData.getCode() == PayuErrors.NO_ERROR) {\n payuConfig.setData(postData.getResult());\n\n SaveCardTask saveCardTask = new SaveCardTask(PayUVerifyApiActivity.this);\n saveCardTask.execute(payuConfig);\n\n // lets cancel the dialog.\n saveUserCardDialog.dismiss();\n } else {\n Toast.makeText(PayUVerifyApiActivity.this, postData.getResult(), Toast.LENGTH_LONG).show();\n }\n }", "private static CreditRequest getRequestDataFromCustomer() {\n\t\treturn new CreditRequest(0, new Vector<Warrantor>(), null, null, null, null);\n\t}", "@SuppressWarnings(\"unused\")\r\n @Override\r\n public void onPaymentSuccess(String razorpayPaymentID) {\r\n try {\r\n Toast.makeText(this, \"Payment Successful: \" + razorpayPaymentID, Toast.LENGTH_SHORT).show();\r\n } catch (Exception e) {\r\n Log.e(TAG, \"Exception in onPaymentSuccess\", e);\r\n }\r\n }", "SerialResponse charge(PinChargePost pinChargePost);", "void payBills();", "private void payByBalance(final View v) {\n if (!SanyiSDK.getCurrentStaffPermissionById(ConstantsUtil.PERMISSION_CASHIER)) {\n\n\n Toast.makeText(activity, getString(R.string.str_common_no_privilege), Toast.LENGTH_LONG).show();\n\n return;\n }\n final CashierPayment paymentMode = new CashierPayment();\n paymentMode.paymentType = ConstantsUtil.PAYMENT_STORE_VALUE;\n paymentMode.paymentName = getString(R.string.rechargeable_card);\n if (SanyiSDK.rest.config.isMemberUsePassword) {\n MemberPwdPopWindow memberPwdPopWindow = new MemberPwdPopWindow(v, activity, new MemberPwdPopWindow.OnSureListener() {\n\n @Override\n public void onSureClick(final String pwd) {\n // TODO Auto-generated method stub\n final NumPadPopWindow numPadPopWindow = new NumPadPopWindow(v, getActivity(), cashierResult, paymentMode, new NumPadPopWindow.OnSureListener() {\n\n @Override\n public void onSureClick(Double value, Double change) {\n // TODO Auto-generated method stub\n checkPresenterImpl.addMemberPayment(value, pwd);\n }\n });\n numPadPopWindow.show();\n\n\n }\n });\n memberPwdPopWindow.show();\n return;\n }\n final NumPadPopWindow numPadPopWindow = new NumPadPopWindow(v, getActivity(), cashierResult, paymentMode, new NumPadPopWindow.OnSureListener() {\n\n @Override\n public void onSureClick(Double value, Double change) {\n // TODO Auto-generated method stub\n checkPresenterImpl.addMemberPayment(value, null);\n }\n });\n numPadPopWindow.show();\n }", "@Override\n\tpublic int makepayment(Payment payment) {\n\t\treturn paydao.doPayment(payment);\n\t}", "public void credit(){\n\t\tSystem.out.println(\"HSBC BANK :: CREDIT\");\n\t}" ]
[ "0.7960023", "0.71942973", "0.71487105", "0.70263946", "0.69803244", "0.6896528", "0.68387526", "0.6763297", "0.6740802", "0.67080206", "0.6681718", "0.6675397", "0.6667499", "0.66209507", "0.6618174", "0.6610594", "0.6607914", "0.6592107", "0.65861595", "0.65809476", "0.65771705", "0.6559712", "0.65504515", "0.65302926", "0.6457362", "0.6437285", "0.6421148", "0.64128625", "0.64033884", "0.6398461", "0.6397763", "0.6392108", "0.63779753", "0.6376724", "0.63735944", "0.63500214", "0.6316736", "0.6313345", "0.6305749", "0.62824166", "0.62608343", "0.62508595", "0.62440866", "0.6241295", "0.6236767", "0.6207598", "0.6188232", "0.61865854", "0.61276615", "0.6107554", "0.61039925", "0.6103088", "0.60832673", "0.60826176", "0.60772103", "0.6056866", "0.604334", "0.60345924", "0.6030414", "0.6014461", "0.6011438", "0.6010376", "0.6008849", "0.60009646", "0.59963584", "0.5975984", "0.59724504", "0.5972134", "0.5960526", "0.59514713", "0.5951068", "0.5941358", "0.5937803", "0.5933593", "0.59296316", "0.592648", "0.59237695", "0.59112275", "0.59011906", "0.5897911", "0.5896214", "0.5891129", "0.587798", "0.58754575", "0.5860134", "0.5859085", "0.5856543", "0.58529115", "0.58500457", "0.5842811", "0.5842387", "0.58417064", "0.58400655", "0.58321875", "0.58284104", "0.58036023", "0.5803416", "0.58017266", "0.58009183", "0.57965064" ]
0.74700296
1
Package only. For AttributeMap use.
static AttributeSet createKeySet(Hashtable hashtable) { Hashtable newElements = new Hashtable(); Enumeration e = hashtable.keys(); while (e.hasMoreElements()) { Object next = e.nextElement(); newElements.put(next, next); } return new AttributeSet(newElements); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Map getAttributes();", "java.util.Map<java.lang.String, java.lang.String> getAttributesMap();", "public AttributeMap()\r\n\t{\r\n\t\tsuper();\r\n\t}", "Map getGenAttributes();", "@Override\npublic void processAttributes() {\n\t\n}", "public abstract Map<String, Object> getAttributes();", "public interface AttributeMap{\n\n /**\n * List of attribute names\n *\n * @return\n */\n public Set<String> getAttributeNames();\n\n /**\n * Does it contain the attributes of the specified name\n *\n * @param name\n * @return\n */\n public boolean containAttribute(String name);\n\n /**\n * Return the attribute value of the specified name\n *\n * @param name\n * @return\n */\n public String getAttribute(String name);\n\n}", "@Override\r\n protected void parseAttributes()\r\n {\n\r\n }", "@Override\n\tpublic Map<String, Object> getAttributeMap() {\n\t\treturn null;\n\t}", "public Map<String, String> getAttributes();", "Map<String, String> getAttributes();", "Map getPassThroughAttributes();", "@Override\n\tpublic Attributes getAttributes() {\n\t\treturn (Attributes)map.get(ATTRIBUTES);\n\t}", "private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}", "public Map<String, Object> getAttributes();", "public Map<String, Object> getAttributes();", "Attributes getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "@Override\n\tpublic void visitAttribute(Object attr) {\n\t}", "@Override\npublic void setAttributes() {\n\t\n}", "@Override\r\n\tpublic Map<String, Object> getAttributes() {\n\t\treturn null;\r\n\t}", "public abstract AnnotationMap mo30683d();", "@Override\n public void visitAttribute(Attribute attribute) {\n }", "protected abstract void createAttributes();", "public Map<String,Object> getAttributeMap() {\r\n return Maps.newHashMap(attributeMap);\r\n }", "IAttributes getAttributes();", "public HashMap<String, String> GetRawAttributes();", "@Override\n\tpublic Map<String, Object> getAttributeMap(int arg0) {\n\t\treturn null;\n\t}", "public Map<String, Object> getAttrs();", "@Override public void visitAttribute(Attribute attr) {\n }", "default Attribute getAttribute(AttributeName attributeName) {return (Attribute) attributeName;}", "private String loadAttributeName() {\n return parseMapField().getKey();\n }", "@Test\n public void requireKeysForAttributes() {\n Set<Attribute> attributes = EnumSet.copyOf(Arrays.asList(Attribute.values()));\n Set<Attribute> implementedAttributes = Arrays.stream(AttributeManager.Key.values())\n .map(AttributeManager.Key::getAttribute)\n .collect(() -> EnumSet.noneOf(Attribute.class), AbstractCollection::add, AbstractCollection::addAll);\n\n attributes.removeAll(implementedAttributes);\n\n if (!attributes.isEmpty()) {\n throw new RuntimeException(\"Some Attributes are not supported by glowstone: \" + attributes);\n }\n }", "protected abstract boolean populateAttributes();", "BidiMap<String, DictionarySimpleAttribute> getUnmodifiableAttributes() {\n\t\treturn UnmodifiableBidiMap.unmodifiableBidiMap(this.attributes);\n\t}", "@Override\n\t\t\t\t\tpublic Attribute handleMapKey(Element parent, FTypeRef src) {\n\t\t\t\t\t\treturn super.handleMapKey(parent, src);\n\t\t\t\t\t}", "public interface AttrValue {\n\n /**\n * 执行属性规则\n *\n * @return 返回Map以attrName为Key属性值正确的格式为value\n */\n Object getAttrValue(Map<String, Object> attrValueContext, String empId) throws Exception;\n\n /**\n * 获取属性的排序\n *\n * @return 排序值越小越靠前\n */\n int getOrder();\n\n}", "@Override public void visitAttribute(Attribute attr) {\n }", "@Override public void visitAttribute(Attribute attr) {\n }", "@Override\n\tpublic AttributeMap getAttributes() {\n\t\treturn defaultEdgle.getAttributes();\n\t}", "@Override\n\tpublic void reflectWith(AttributeReflector reflector) {\n\n\t}", "@Test\n public void testAttributeManagement() {\n Tag tag = new BaseTag(\"testtag\");\n String attributeName = \"testAttr\";\n String attributeValue = \"testValue\";\n tag.addAttribute(attributeName, attributeValue);\n assertEquals(\"Wrong attribute value returned\", attributeValue, tag.getAttribute(attributeName));\n assertNotNull(\"No attribute map\", tag.getAttributes());\n assertEquals(\"Wrong attribute map size\", 1, tag.getAttributes().size());\n assertEquals(\"Wrong attribute in map\", attributeValue, tag.getAttributes().get(attributeName));\n tag.removeAttribute(attributeName);\n assertNull(\"Attribute was not removed\", tag.getAttribute(attributeName));\n }", "public Attributes getAttributes() { return this.attributes; }", "private AttributesMap(Builder builder) {\n super(builder);\n }", "public PropertyMap createAttributeMap(XMLName attributeName)\n {\n checkState();\n return super.createAttributeMap(attributeName);\n }", "Object getAttribute(String key);", "Object getAttribute(String key);", "@Override\n protected AttributeInitializer getAttributeInitializer() {\n return attributeInitializer;\n }", "void initGlobalAttributes() {\n\n\t}", "@Override\r\n\tpublic Map<String, String> getAttributes() {\r\n\t\treturn this.attributes;\r\n\t}", "public abstract ImportAttributes getAttributes();", "public Map<String, Object> getAttributesMap() {\n\t\treturn this.staticAttributes;\n\t}", "public AttributeContainer() {\n super();\n }", "public interface Attributable extends Serializable {\n\n Map<String, Object> getAttrs();\n\n default void setAttrs(Map<String, Object> attrs) {\n if (attrs != null && attrs.size() > 0) {\n getAttrs().putAll(attrs);\n }\n }\n\n default <V> V getOrDefault(String key, V defaultValue) {\n V v = defaultValue;\n if (containsKey(key)) {\n v = getAttr(key);\n }\n return v;\n }\n\n @SuppressWarnings(\"unchecked\")\n default <V> V getAttr(String key) {\n return (V) getAttrs().get(key);\n }\n\n\n default void setAttr(String key, Object value) {\n getAttrs().put(key, value);\n }\n\n default void remove(String key) {\n getAttrs().remove(key);\n }\n\n default boolean containsKey(String key) {\n return getAttrs().containsKey(key);\n }\n\n default boolean containsValue(Object value) {\n return getAttrs().containsValue(value);\n }\n}", "protected LPDMODOMAttribute() {\n }", "public java.util.Collection getAttributes();", "java.lang.String getAttributesOrThrow(java.lang.String key);", "@Override\n\tpublic void setAttributes(AttributeMap arg0) {\n\t\tdefaultEdgle.setAttributes(arg0);\n\t}", "@Override\n public int getAttributeCount() { return 0; }", "@Override\n\tpublic Map changeAttributes(Map arg0) {\n\t\treturn defaultEdgle.changeAttributes(arg0);\n\t}", "java.lang.String getAttribute();", "public interface AttributeFun {\n}", "public interface Attribute {\n\n /**\n * The id of the attribute. This will be unique for all attributes in a\n * graph. However, if an attribute is removed from the graph, future\n * attributes may (and probably will) reuse this id.\n *\n * @return the id of the attribute.\n */\n public int getId();\n\n /**\n * Sets the id of this attribute.\n *\n * @param id the new id of this attribute.\n */\n public void setId(final int id);\n\n /**\n * Returns the element type that this attribute is associated with.\n *\n * @return the element type that this attribute is associated with.\n */\n public GraphElementType getElementType();\n\n /**\n * Sets the element type of this attribute.\n *\n * @param elementType the new element type of this attribute.\n */\n public void setElementType(final GraphElementType elementType);\n\n /**\n * The type of this attribute.\n * <p>\n * This is a String as returned by\n * {@link au.gov.asd.tac.constellation.graph.attribute.AttributeDescription#getName()}\n * from one of the registered AttributeDescription instances.\n *\n * @return The type of this attribute.\n */\n public String getAttributeType();\n\n /**\n * Sets the type of this attribute.\n *\n * @param attributeType the new type of the attribute.\n */\n public void setAttributeType(final String attributeType);\n\n /**\n * Return the name of the attribute. This name will be unique for all\n * attributes associated with the same element type in a graph. This is the\n * value that is presented to the user in the UI and the most common way in\n * which attributes are looked up in the graph.\n *\n * @return the name of the attribute.\n */\n public String getName();\n\n /**\n * Sets a new name for this attribute.\n *\n * @param name the new name for the attribute.\n * @see Attribute#getName()\n */\n public void setName(final String name);\n\n /**\n * Returns the description of an attribute. The description provides more\n * detailed information about the attribute such as how it is being used or\n * and constraints that should be observed.\n *\n * @return the description of an attribute.\n */\n public String getDescription();\n\n /**\n * Sets a new description of an attribute.\n *\n * @param description the new description of the attribute.\n * @see Attribute#getDescription()\n */\n public void setDescription(final String description);\n\n /**\n * Returns the current default value for this attribute. This is the value\n * that new elements will get when they are created.\n *\n * @return the current default value for this attribute.\n */\n public Object getDefaultValue();\n\n /**\n * Sets the new default value for this attribute. This will not change the\n * values of any existing elements but rather the value that new elements\n * will get given when they are created.\n *\n * @param defaultValue the new default value for the attribute.\n */\n public void setDefaultValue(final Object defaultValue);\n\n /**\n * Returns the class of the attribute description that defines this\n * attribute.\n *\n * @return the class of the attribute description that defines this\n * attribute.\n */\n public Class<? extends AttributeDescription> getDataType();\n\n /**\n * Sets the data type of this attribute.\n *\n * @param dataType the new datatype of this attribute.\n */\n public void setDataType(final Class<? extends AttributeDescription> dataType);\n\n /**\n * Returns the attribute merger for this attribute.\n *\n * @return the attribute merger for this attribute.\n */\n public GraphAttributeMerger getAttributeMerger();\n\n /**\n * Sets the attribute merger for this attribute.\n *\n * @param attributeMerger the attribute merger for this attribute.\n */\n public void setAttributeMerger(final GraphAttributeMerger attributeMerger);\n}", "@Override\n public int getAttributeCount()\n {\n return 3;\n }", "@Override\n public List<MappedField<?>> getAttributes() {\n return attributes;\n }", "public final Map<String, DomAttr> getAttributesMap() {\n return attributes_;\n }", "public Collection<HbAttributeInternal> attributes();", "protected abstract void bindAttributes();", "@Override\r\n\t\tpublic boolean hasAttributes()\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}", "private BaseAttribute getAttribute(Map<String, BaseAttribute> attributes, MongoDbKeyAttributeMapper keyAttributeMapper, String keyName) {\n BaseAttribute attribute;\n\n if (keyAttributeMapper == null || keyAttributeMapper.getAttributeName() == null) {\n attribute = attributes.get(keyName);\n if (attribute == null) {\n attribute = new BasicAttribute(keyName);\n }\n } else {\n attribute = attributes.get(keyAttributeMapper.getAttributeName());\n if (attribute == null) {\n attribute = new BasicAttribute(keyAttributeMapper.getAttributeName());\n }\n }\n\n return attribute;\n }", "Attribute getAttribute();", "ArrayList getAttributes();", "public ExtensionAttributes_() {\n }", "private static Map<String, String> createPropertiesAttrib() {\r\n Map<String, String> map = new HashMap<String, String>();\r\n map.put(\"Property1\", \"Value1SA\");\r\n map.put(\"Property3\", \"Value3SA\");\r\n return map;\r\n }", "public PropertyMap createAttributeMap(String uri, String localName)\n {\n checkState();\n return super.createAttributeMap(uri, localName);\n }", "@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type) {\n }", "public Map getAttributeValueMap() {\n return m_attributeValueMap;\n }", "public Object get(String aName) { return _attrMap.get(aName); }", "private Attribute createAttribute() {\n\t\t\tAttribute att = AttributeFactory.createAttribute(getName(), getValueType());\n\t\t\tatt.getAnnotations().clear();\n\t\t\tatt.getAnnotations().putAll(getAnnotations());\n\t\t\tattribute = att;\n\t\t\treturn att;\n\t\t}", "@Override\n\t\t\t\t\tpublic Attribute handleMapValue(Element parent, FTypeRef src) {\n\t\t\t\t\t\treturn super.handleMapValue(parent, src);\n\t\t\t\t\t}", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void addAttribute(String name, String value) {\n\t\t\t\n\t\t}", "public void addAttributeMap(PropertyMap propMap)\n throws XMLMiddlewareException\n {\n checkState();\n super.addAttributeMap(propMap);\n }", "public Map<String, String> getAttributes() {\n\t\treturn atts;\n\t}", "public void removeAllAttributeMaps()\n {\n checkState();\n super.removeAllAttributeMaps();\n }", "Map<String, ?> attributesWithQuotes() {\n return attributesWithQuotes(true);\n }", "public Map<TextAttribute,?> getAttributes(){\n return (Map<TextAttribute,?>)getRequestedAttributes().clone();\n }", "Attribute createAttribute();", "Attribute createAttribute();", "default void putAttribute(ConceptName name, Attribute attribute) {}", "String getAttribute();", "public Set<String> getAttributes() {\r\n return attributeMap.keySet();\r\n }", "public Attr() {\n\t\t\tsuper();\n\t\t}", "@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type, byte flags) {\n }", "public Map<String, Set<String>> getAttributes() {\n return attributes;\n }", "private void initReservedAttributes()\n {\n addIgnoreProperty(ATTR_IF_NAME);\n addIgnoreProperty(ATTR_REF);\n addIgnoreProperty(ATTR_UNLESS_NAME);\n addIgnoreProperty(ATTR_BEAN_CLASS);\n addIgnoreProperty(ATTR_BEAN_NAME);\n }", "boolean isAttribute();", "@Override\n\tpublic void buildAttributes(JDefinedClass cls) {\n\n\t}", "public int getAttributeCount()\n/* */ {\n/* 728 */ return this.attributes.size();\n/* */ }" ]
[ "0.7505182", "0.71348387", "0.71048224", "0.7055574", "0.70125765", "0.7000309", "0.69758904", "0.67749894", "0.6686078", "0.66785973", "0.6601267", "0.66010445", "0.65871704", "0.6584471", "0.658143", "0.658143", "0.6528605", "0.6514837", "0.6514837", "0.6514837", "0.6490964", "0.63836837", "0.6366685", "0.63455695", "0.63411635", "0.6337817", "0.63297427", "0.6328154", "0.6321995", "0.63192755", "0.6309181", "0.62726194", "0.62530386", "0.62338877", "0.6214334", "0.62080556", "0.62037915", "0.61994284", "0.61964744", "0.6193316", "0.6193316", "0.6185953", "0.6159316", "0.6155239", "0.61094904", "0.61003256", "0.60931987", "0.60920966", "0.60920966", "0.6084286", "0.60538197", "0.60414135", "0.60325825", "0.60323733", "0.60105175", "0.5986817", "0.59775305", "0.5958243", "0.595616", "0.5941854", "0.593797", "0.593032", "0.59202033", "0.59194154", "0.59117484", "0.5909976", "0.5906615", "0.5906", "0.5894446", "0.5893554", "0.589208", "0.58903426", "0.58713406", "0.5869087", "0.58605766", "0.5859527", "0.5847124", "0.5846923", "0.5844901", "0.5830185", "0.582597", "0.5824353", "0.58207613", "0.58207613", "0.58186257", "0.5797271", "0.5794794", "0.57909846", "0.57881236", "0.5781044", "0.5781044", "0.5780779", "0.57707554", "0.5765691", "0.5759213", "0.57577795", "0.5755687", "0.57502025", "0.57452416", "0.57399493", "0.572542" ]
0.0
-1
Create a new, empty AttributeSet. The set is semantically equivalent to EMPTY_SET.
public AttributeSet() { elements = new Hashtable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public EfficientTerminalSet empty() {\n return new EfficientTerminalSet(terminals, indices, new int[data.length]);\n }", "public static FeatureSet empty() {\n return new FeatureSet(ImmutableSet.of(), ImmutableSet.of());\n }", "static Set createEmpty() {\n return new EmptySet();\n }", "public AttributeSet immutable() {\r\n return ImmutableAttributeSet.copyOf(this);\r\n }", "public Builder clearAttributes() {\n if (attributesBuilder_ == null) {\n attributes_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000004);\n onChanged();\n } else {\n attributesBuilder_.clear();\n }\n return this;\n }", "private EmptySet() {}", "public Builder clearSetAttribute() {\n if (setAttributeBuilder_ == null) {\n setAttribute_ = alluxio.proto.journal.File.SetAttributeEntry.getDefaultInstance();\n onChanged();\n } else {\n setAttributeBuilder_.clear();\n }\n bitField0_ = (bitField0_ & ~0x08000000);\n return this;\n }", "public AttributeSet flatCopy() {\r\n AttributeSet res = new AttributeSet();\r\n for (String k : getAllAttributes()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "@Override\n\tpublic AttributeSet getAttributes() {\n\t\treturn null;\n\t}", "public AttributeSet getAttributes() {\n return null;\n }", "private void init(final AttributeSet set) {\n }", "private Set() {\n this(\"<Set>\", null, null);\n }", "public Builder clearAttributes() {\n if (attributesBuilder_ == null) {\n attributes_ = null;\n onChanged();\n } else {\n attributes_ = null;\n attributesBuilder_ = null;\n }\n\n return this;\n }", "static IntSet empty() {\n if (emptySet == null) {\n emptySet = new EmptySet();\n }\n return emptySet;\n }", "public ArraySet() {\n\t\tthis(DEFAULT_CAPACITY);\n\t}", "@SuppressWarnings(\"unchecked\") // Nested sets are immutable, so a downcast is fine.\n <E> NestedSet<E> emptySet() {\n return (NestedSet<E>) emptySet;\n }", "public Builder clearSetAcl() {\n if (setAclBuilder_ == null) {\n setAcl_ = alluxio.proto.journal.File.SetAclEntry.getDefaultInstance();\n onChanged();\n } else {\n setAclBuilder_.clear();\n }\n bitField0_ = (bitField0_ & ~0x04000000);\n return this;\n }", "public Builder clearFdset() {\n bitField0_ = (bitField0_ & ~0x00000010);\n fdset_ = null;\n if (fdsetBuilder_ != null) {\n fdsetBuilder_.dispose();\n fdsetBuilder_ = null;\n }\n onChanged();\n return this;\n }", "public AttributeSet copy() {\r\n AttributeSet res = new AttributeSet(parent.orNull());\r\n for (String k : attributeMap.keySet()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "@Override\r\n\tpublic void clear() {\n\t\tset.clear();\r\n\t}", "static AttributeSet createKeySet(Hashtable hashtable) {\n\n Hashtable newElements = new Hashtable();\n\n Enumeration e = hashtable.keys();\n while (e.hasMoreElements()) {\n Object next = e.nextElement();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "public void makeEmpty(){\n for(int element = set.length - 1; element >= 0; element--){\n remove(set[element]);\n }\n }", "public AgileSet() {\n currentSize = 0.0;\n }", "public void clear() {\n\t\tthis.set.clear();\n\t\tthis.size = 0;\n\t}", "public AttributeSet(Object elem) {\n\n elements = new Hashtable(1, 1);\n elements.put(elem, elem);\n }", "private void createNullSet()\n\t{\n\t\tm_values = null;\n\t}", "public PointSET() { // construct an empty set of points\n\n }", "public AttributeSet unionWith(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "@Override\n\tpublic void setEmpty() {\n\t\t\n\t}", "public void makeEmpty( )\n {\n doClear( );\n }", "public SetSet() {\n\t}", "public static Tag emptyTag() {\n\t\treturn new Tag(NAME, \"\");\n\t}", "public RandomizedSet() {\r\n set = new HashSet<>();\r\n }", "public static TracingMetadata empty() {\n return EMPTY;\n }", "public Builder clearItems() {\n items_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public Builder clearNoUnions() {\n bitField0_ = (bitField0_ & ~0x00000080);\n noUnions_ = false;\n onChanged();\n return this;\n }", "public Dataset getEmptyDataset() {\r\n\t\treturn InitialData.emptyClone();\r\n\t}", "public org.ga4gh.models.CallSet.Builder clearCreated() {\n created = null;\n fieldSetFlags()[4] = false;\n return this;\n }", "public Builder clearKeyspaces() {\n if (keyspacesBuilder_ == null) {\n keyspaces_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n } else {\n keyspacesBuilder_.clear();\n }\n return this;\n }", "private void setEmpty() {\n\t\tfor (int r = 0; r < board.length; r++)\n\t\t\tfor (int c = 0; c < board[r].length; c++)\n\t\t\t\tboard[r][c] = new Cell(false, false,\n\t\t\t\t\t\tfalse, false); // totally clear.\n\t}", "public void makeEmpty() {\r\n for (int i = 0; i < tableSize; i++) {\r\n table[i] = new DList<Entry<K, V>>();\r\n }\r\n }", "public Builder clearTag() {\n if (tagBuilder_ == null) {\n tag_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000080);\n onChanged();\n } else {\n tagBuilder_.clear();\n }\n return this;\n }", "public boolean isEmpty(){\n if(set.length == 0)\n return true;\n return false;\n }", "public String getDefaultAttributeSet () {\r\n return defaultAttributeSet;\r\n }", "public Vector4d setZero() {\n\t\tx = y = z = w =0;\n\t\treturn this;\n\t}", "public static CharSequence emptyCharSequence() {\n return EMPTY;\n }", "public static NonpositiveRequiredCapabilityMatch newEmptyMatch() {\r\n return new Mutable(null, null, null, null);\r\n }", "public final Marking clearColor()\n {\n clear( COLOR_KEY );\n return this;\n }", "public static <T> Set<T> createSet(T... setEntries) {\n\t\tif (setEntries == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new HashSet<T>(Arrays.asList(setEntries));\n\t}", "public Dataset clearTagsEntries() {\n this.tags = null;\n return this;\n }", "public Builder clearXAxisCharacteristicIdNull() {\n \n xAxisCharacteristicIdNull_ = false;\n onChanged();\n return this;\n }", "public Builder clearHat() {\n bitField0_ = (bitField0_ & ~0x00000020);\n hat_ = 0;\n onChanged();\n return this;\n }", "public StatsSet() {\n this(DSL.name(\"stats_set\"), null);\n }", "public Builder clearGroupByCategoryNull() {\n \n groupByCategoryNull_ = false;\n onChanged();\n return this;\n }", "public static java.util.Set unmodifiableSet(java.util.Set arg0)\n { return null; }", "Set createSet();", "public static DuplicateNameMatch newEmptyMatch() {\r\n return new Mutable(null, null);\r\n }", "public Builder clearCached() {\n cached_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000040);\n onChanged();\n return this;\n }", "public Builder clearProps() {\n if (propsBuilder_ == null) {\n props_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n } else {\n propsBuilder_.clear();\n }\n return this;\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn set.isEmpty();\r\n\t}", "public Builder clearAligning() {\n bitField0_ = (bitField0_ & ~0x00000008);\n aligning_ = false;\n onChanged();\n return this;\n }", "public void makeEmpty();", "public void makeEmpty();", "public RandomizedSet() {\n m = new HashMap<>();\n l = new ArrayList<>();\n }", "public RandomizedSet() {\n set = new HashMap<>();\n list = new ArrayList<>();\n }", "public Builder clearData() {\n data_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public Builder clearData() {\n data_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public MapAssertion<K, V> isEmpty() {\n checkActualIsNotNull();\n if (!getActual().isEmpty()) {\n throw getAssertionErrorBuilder().addMessage(Messages.Fail.Actual.IS_EMPTY).addActual().build();\n }\n return this;\n }", "public baconhep.TTau.Builder clearAntiEleMVA5Cat() {\n fieldSetFlags()[10] = false;\n return this;\n }", "public void clearAttributes() {\n\t\t// Clear all attributes\n\t\tfor (BusinessObject child : getChildren()) {\n\t\t\tif (child.isAttribute()) {\n\t\t\t\tchild.clear();\n\t\t\t}\n\t\t}\n\t}", "public void makeEmpty()\n {\n root = nil;\n }", "public Builder clearA() {\n \n a_ = 0;\n onChanged();\n return this;\n }", "public Builder clearA() {\n \n a_ = 0;\n onChanged();\n return this;\n }", "public Builder clearMnc() {\n \n mnc_ = 0;\n onChanged();\n return this;\n }", "public void clear() {\n this.entries = new Empty<>();\n }", "public Builder clearC() {\n bitField0_ = (bitField0_ & ~0x00000001);\n c_ = 0;\n onChanged();\n return this;\n }", "public Set() {\n\t\tlist = new LinkedList<Object>();\n\t}", "public Builder clearData() {\n data_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public AttributeSet(Object[] elems) {\n\n elements = new Hashtable(elems.length, 1);\n for (int i=0; i < elems.length; i++) {\n Object next = elems[i];\n elements.put(next, next);\n }\n }", "public void makeEmpty() { \r\n for (int i = 0; i < hash_table.length; i++) {\r\n if (hash_table[i] != null) {\r\n hash_table[i] = null;\r\n }\r\n }\r\n size = 0;\r\n }", "public Set(){\n setSet(new int[0]);\n }", "void setEmpty() {\n this.lo = 1;\n this.hi = 0;\n }", "@attribute(value = \"\", required = false, defaultValue=\"false\")\r\n\tpublic void removeAll() {\r\n\t\tcombo.removeAll();\r\n\t}", "public boolean isUnset() {\n boolean isUnset = false;\n for (ASTNode child : this.getNode().getChildren(TokenSet.create(AsciiDocTokenTypes.ATTRIBUTE_UNSET))) {\n ASTNode treePrev = child.getTreePrev();\n if (treePrev != null && treePrev.getElementType() == AsciiDocTokenTypes.ATTRIBUTE_NAME_START) {\n isUnset = true;\n break;\n }\n ASTNode treeNext = child.getTreeNext();\n if (treeNext != null && treeNext.getElementType() == AsciiDocTokenTypes.ATTRIBUTE_NAME_END) {\n isUnset = true;\n break;\n }\n }\n return isUnset;\n }", "public Builder clearArguments() {\n arguments_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n return this;\n }", "public static Scope empty(){\n return EMPTY;\n }", "public RandomizedSet() {\n map = new HashMap<>();\n }", "public static Query empty() {\n return new Query();\n }", "public org.apache.gora.cascading.test.storage.TestRow.Builder clearDefaultStringEmpty() {\n defaultStringEmpty = null;\n fieldSetFlags()[1] = false;\n return this;\n }", "public AttributeSet subtract(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n newElements.remove(iter.next());\n }\n\n return new AttributeSet(newElements);\n }", "public Canary clearTagsEntries() {\n this.tags = null;\n return this;\n }", "public Builder clearDatasetIds() {\n datasetIds_ = com.google.protobuf.LazyStringArrayList.EMPTY;\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n return this;\n }", "public final synchronized void removeAllAttributes() {\n\t if ( m_cache != null)\n\t \tm_cache.clear();\n\t m_cache = null;\n\t}", "public Builder clearClusteringKey() {\n clusteringKey_ = com.google.protobuf.LazyStringArrayList.EMPTY;\n bitField0_ = (bitField0_ & ~0x00000004);\n onChanged();\n return this;\n }", "public RandomizedSet() {\n list = new ArrayList<>();\n map = new HashMap<>();\n }", "public void makeEmpty( )\r\n\t{\r\n\t\troot = null;\r\n\t}", "public Builder clearRequestedValues() {\n requestedValues_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000004);\n onChanged();\n return this;\n }", "public Builder clearA() {\n bitField0_ = (bitField0_ & ~0x00000001);\n a_ = -1F;\n onChanged();\n return this;\n }", "@Test\r\n public void clearEmpty() throws Exception {\r\n TreeSet<String> check = new TreeSet<>();\r\n check.clear();\r\n assertTrue(check.isEmpty());\r\n }", "protected Set() {\n size = 0;\n set = new int[TEN];\n }" ]
[ "0.653113", "0.6523105", "0.6459341", "0.6172644", "0.6023888", "0.59481245", "0.5927418", "0.59239423", "0.5878183", "0.57390445", "0.57371056", "0.5702493", "0.56668466", "0.5615367", "0.5580979", "0.54509014", "0.5450636", "0.5405183", "0.539788", "0.53969747", "0.5332978", "0.532348", "0.5315506", "0.5287262", "0.5286106", "0.5218168", "0.5213727", "0.52065974", "0.5154793", "0.5125823", "0.50807595", "0.50741225", "0.50663316", "0.50593907", "0.50462127", "0.5040503", "0.5035014", "0.50336075", "0.5016713", "0.5015733", "0.50128776", "0.50080764", "0.49918112", "0.49868286", "0.4986791", "0.49642885", "0.49531907", "0.49380055", "0.49280593", "0.49149585", "0.49128467", "0.49068224", "0.48997232", "0.48927152", "0.48779365", "0.48768145", "0.48710108", "0.48563427", "0.48514506", "0.48491743", "0.48412088", "0.48376253", "0.48376253", "0.4835541", "0.48335132", "0.48333463", "0.48333463", "0.48308632", "0.4826258", "0.48223135", "0.4819329", "0.48114815", "0.48114815", "0.48090476", "0.48083082", "0.48066214", "0.4805625", "0.48049295", "0.48038703", "0.47976756", "0.4797529", "0.47939745", "0.47925508", "0.4788851", "0.47862053", "0.47841123", "0.47840208", "0.47782478", "0.47753", "0.4772342", "0.47699478", "0.47669625", "0.47628686", "0.47610322", "0.47559974", "0.47535458", "0.47507322", "0.47462016", "0.47461516", "0.4743314" ]
0.68274224
0
Create a new AttributeSet with the single element elem.
public AttributeSet(Object elem) { elements = new Hashtable(1, 1); elements.put(elem, elem); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AttributeSet addElement(Object element) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n newElements.put(element, element);\n return new AttributeSet(newElements);\n }", "public AttributeSet(Object[] elems) {\n\n elements = new Hashtable(elems.length, 1);\n for (int i=0; i < elems.length; i++) {\n Object next = elems[i];\n elements.put(next, next);\n }\n }", "public AttributeSet() {\n\n elements = new Hashtable();\n }", "public static AttributeSet with(String key, Object val) {\r\n AttributeSet res = new AttributeSet();\r\n res.put(key, val);\r\n return res;\r\n }", "public void setElement(T elem)\n {\n\n element = elem;\n }", "public static AttributeSet withParent(AttributeSet par) {\r\n return new AttributeSet(par);\r\n }", "@TimeComplexity(\"O(1)\")\n\tpublic E setElement(E eT)\n\t{\n\t\t//TCJ: the cost does not vary with input size so it is constant\n\t\tE temp = element;\n\t\telement = eT;\n\t\treturn temp;\n\t}", "public AnnotationDefaultAttr(ElemValPair s) { //\r\n elem = s;\r\n }", "private void init(final AttributeSet set) {\n }", "public View create(Element elem) {\n return null;\n }", "protected Element el(String tag, Node i){\n\t\tElement e = doc.createElement(tag);\n\t\tif (i instanceof Attr) { \n\t\t\te.setAttributeNode((Attr)i);\n\t\t} else {\n\t\t\te.appendChild(i);\n\t\t}\n\t\treturn e;\n\t}", "public AttributeSet immutable() {\r\n return ImmutableAttributeSet.copyOf(this);\r\n }", "public void setElem(int elem)\r\n\t{\r\n\t\tthis.elem = elem;\r\n\t}", "public void setElement(String newElem) { element = newElem;}", "public Attribute( Element eleAttr ) {\n strClass = eleAttr.getAttributeValue( \"class\" );\n strAttrName = eleAttr.getAttributeValue( \"name\" );\n strName = Utils.formatAttrName( strAttrName );\n String strDecimal = eleAttr.getAttributeValue( \"decimal\" );\n if( strDecimal != null && strDecimal.length() > 0 ) {\n bDecimal = Byte.parseByte( strDecimal );\n }\n String strLength = eleAttr.getAttributeValue( \"length\" );\n if( strLength != null && strLength.length() > 0 ) {\n lLength = Long.parseLong( strLength );\n }\n strJavaClass = javaClass();\n bID = strClass.equals( \"com.space.core.model.feature.attr.IdType\" );\n bNullable = !Boolean.parseBoolean( eleAttr.getAttributeValue( \"mandatory\" ) );\n String strIndex = eleAttr.getAttributeValue( \"index\" );\n if( strIndex != null ) {\n if( strIndex.equals( \"unique\" ) ) {\n bIndexType = INDEX_UNIQUE;\n } else if( strIndex.equals( \"duplicate\" ) ) {\n bIndexType = INDEX_DUPLICATE;\n }\n }\n }", "public AttributeSet and(String key, Object val) {\r\n put(key, val);\r\n return this;\r\n }", "public View create(Element elem, int p0, int p1) {\n return null;\n }", "private Attr newAttr(String tipo, String valor) {\n/* 341 */ Attr atrib = this.pagHTML.createAttribute(tipo);\n/* 342 */ atrib.setValue(valor);\n/* 343 */ return atrib;\n/* */ }", "public static Element createElementAttrib(String elementName, String attribName1,String attribValue1,String attribName2,String attribValue2,Document docnew) throws ParserConfigurationException\r\n\t\t{\r\n\t\t\tElement elm = docnew.createElement(elementName);\r\n\t\t\tAttr Id = docnew.createAttribute(attribName1);\r\n\t\t\tId.setValue(attribValue1);\r\n\t\t\telm.setAttributeNode(Id);\r\n\t\t\tif((attribName2.length()>0) &&(attribValue2.length()>0))\r\n\t\t\t{\r\n\t\t\t\tAttr Idd = docnew.createAttribute(attribName2);\r\n\t\t\t\tIdd.setValue(attribValue2);\r\n\t\t\t\telm.setAttributeNode(Idd);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn elm;\r\n\t\t}", "@Override\r\n\t\tpublic Attr setAttributeNode(Attr newAttr) throws DOMException\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "public AttributeSet unionWith(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "Atributo createAtributo();", "public Element toElement(SimpleElement elem, Document doc)\n\t{\n\t\tElement root = doc.createElement(elem.getName());\n\t\t\n\t\tpopulateAttributes(root, elem);\n\t\tpopulateChildren(root, elem);\n\t\t\n\t\treturn root;\n\t}", "public EdmAttribute setupAttribute(String val) {\n EdmAttribute a = new EdmAttribute(val);\n return a;\n }", "Attribute createAttribute();", "Attribute createAttribute();", "private void addAttr( Element e ) {\r\n\t\tString attr_name = Utils.replaceWhitespaces(\r\n\t\t\tInputs.getStr( \"¿Nombre del atributo?\" ), '_'\r\n\t\t);\r\n\t\tString attr_value = Inputs.getStr( \"¿Valor del atributo?\" );\r\n\r\n\t\tAttr attr = doc.createAttribute( attr_name );\r\n\t\tattr.setValue( attr_value );\r\n\t\te.setAttributeNode( attr );\r\n\r\n\t\t// shorten way\r\n\t\t// e.setAttribute( \"id\", \"1\" );\r\n\t}", "protected Element el(String tag, Node[] childs){\n\t\tElement e = doc.createElement(tag);\n\t\tfor (Node i: childs){\n\t\t\tif (i instanceof Attr) { \n\t\t\t\te.setAttributeNode((Attr)i);\n\t\t\t} else {\n\t\t\t\te.appendChild(i);\n\t\t\t}\n\t\t}\n\t\treturn e;\n\t}", "public Attr() {\n\t\t\tsuper();\n\t\t}", "Element createElement();", "public AttributeSet copy() {\r\n AttributeSet res = new AttributeSet(parent.orNull());\r\n for (String k : attributeMap.keySet()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "public void set(int x, int y, int elem){\n matriz[x][y] = elem;\n }", "public ElementObject(WebElement element) {\n // check null value\n super(0); //0 : Element is THERE\n this.element = element;\n this._originalStyle = element.getAttribute(\"style\");\n }", "public String getElementAttribute(int row, int attr);", "public GUIAttributeSet getAttributeSet(long setId) throws ServerException;", "public AttributeSet flatCopy() {\r\n AttributeSet res = new AttributeSet();\r\n for (String k : getAllAttributes()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "protected void mergeAttributes( Element element, AttributeSet attr, AttributeFilter filter, SimpleFeature feature )\n \t{\n \t\tif( attr.size() > 0 )\n \t\t{\n \t\t\tfor( String key: attr.keySet() )\n \t\t\t{\n \t\t\t\tif( filter != null )\n \t\t\t\t{\n \t\t\t\t\tif( filter.isKept( key ) )\n \t\t\t\t\t\telement.setAttribute( key, attr.get( key ) );\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\telement.setAttribute( key, attr.get( key ) );\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n //\t\tif( addEdgeShapeAttribute && element instanceof Edge )\n //\t\t\taddEdgeShapeStyle( (Edge)element, feature );\n \t}", "public org.ccsds.moims.mo.mal.structures.Element createElement()\n {\n return new BasicUpdate();\n }", "public Element(Element element) {\n\t\tElement src = element.clone();\n\n\t\tthis.attributes = src.attributes;\n\t\tthis.name = src.name;\n\t\tthis.defxmlns = src.defxmlns;\n\t\tthis.xmlns = src.xmlns;\n\t\tthis.children = src.children;\n\t}", "public Element createElementWithAttrs(String tagName, Hashtable attrs) {\r\n\t\tif (null == attrs) {\r\n\t\t\tlog.error(\"No attributes defined.\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tElement element = doc.createElement(tagName);\r\n\t\tEnumeration e = attrs.keys();\r\n\t\t\r\n\t\twhile (e.hasMoreElements()) {\r\n\t\t\tString name = (String)e.nextElement();\r\n\t\t\tString value = (String)attrs.get(name);\r\n\t\t\telement.setAttribute(name, value);\r\n\t\t}\r\n\t\treturn element;\r\n\t}", "public Builder setSetAttribute(alluxio.proto.journal.File.SetAttributeEntry value) {\n if (setAttributeBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n setAttribute_ = value;\n onChanged();\n } else {\n setAttributeBuilder_.setMessage(value);\n }\n bitField0_ |= 0x08000000;\n return this;\n }", "protected abstract M createNewElement();", "@Function Attr createAttribute(String name);", "@Override\n\tpublic void setElement(Element element) {\n\t\t\n\t}", "public void setElement(Object e) {\n element = e;\n }", "TAttribute createTAttribute();", "public CMLElement makeElementInContext(Element parent) {\r\n return new CMLVector3();\r\n\r\n }", "@Override\r\n\tprotected Element createLeafElement(Element parent, AttributeSet a, int p0, int p1) {\n\t\tswitch (this.leafContext) {\r\n\t\t\tcase ATTRIBUTE_NAME:\r\n\t\t\t\treturn new AttributeNameLeafElement(parent, a, p0, p1);\r\n\t\t\tcase ATTRIBUTE_VALUE:\r\n\t\t\t\treturn new AttributeValueLeafElement(parent, a, p0, p1);\r\n\t\t\tdefault:\r\n\t\t\t\t// fall-back case\r\n\t\t\t\treturn super.createLeafElement(parent, a, p0, p1);\r\n\t\t}\r\n\t}", "Element createXmlDeepSkyTargetElement(Element element, String xsiType) {\n\n if (element == null) {\n return null;\n }\n\n Document ownerDoc = element.getOwnerDocument();\n\n // Get or create the container element\n Element e_Targets = null;\n boolean created = false;\n NodeList nodeList = ownerDoc.getElementsByTagName(RootElement.XML_TARGET_CONTAINER);\n if (nodeList.getLength() == 0) { // we're the first element. Create container element\n e_Targets = ownerDoc.createElement(RootElement.XML_TARGET_CONTAINER);\n created = true;\n } else {\n e_Targets = (Element) nodeList.item(0); // there should be only one container element\n }\n\n // Check if this element doesn't exist so far\n nodeList = e_Targets.getElementsByTagName(ITarget.XML_ELEMENT_TARGET);\n if (nodeList.getLength() > 0) {\n Node currentNode = null;\n NamedNodeMap attributes = null;\n for (int i = 0; i < nodeList.getLength(); i++) { // iterate over all found nodes\n currentNode = nodeList.item(i);\n attributes = currentNode.getAttributes();\n Node idAttribute = attributes.getNamedItem(ISchemaElement.XML_ELEMENT_ATTRIBUTE_ID);\n if ((idAttribute != null) // if ID attribute is set and equals this objects ID, return existing element\n && (idAttribute.getNodeValue().trim().equals(this.getID().trim()))) {\n // Not sure if this is good!? Maybe we should return currentNode and make\n // doublicity check in caller\n // class!?\n return null;\n }\n }\n }\n\n // Create the new target element\n Element e_Target = this.createXmlTargetElement(e_Targets);\n e_Targets.appendChild(e_Target);\n\n // Set XSI:Type\n e_Target.setAttribute(ITarget.XML_XSI_TYPE, xsiType);\n\n if (smallDiameter != null) {\n Element e_SmallDiameter = ownerDoc.createElement(XML_ELEMENT_SMALLDIAMETER);\n e_SmallDiameter = smallDiameter.setToXmlElement(e_SmallDiameter);\n\n e_Target.appendChild(e_SmallDiameter);\n }\n\n if (largeDiameter != null) {\n Element e_LargeDiameter = ownerDoc.createElement(XML_ELEMENT_LARGEDIAMETER);\n e_LargeDiameter = largeDiameter.setToXmlElement(e_LargeDiameter);\n\n e_Target.appendChild(e_LargeDiameter);\n }\n\n if (!Float.isNaN(visibleMagnitude)) {\n Element e_VisMag = ownerDoc.createElement(XML_ELEMENT_VISIBLEMAGNITUDE);\n Node n_VisMagText = ownerDoc.createTextNode(Float.toString(this.getVisibleMagnitude()));\n e_VisMag.appendChild(n_VisMagText);\n\n e_Target.appendChild(e_VisMag);\n }\n\n if (surfaceBrightness != null) {\n Element e_SurfBr = ownerDoc.createElement(XML_ELEMENT_SURFACEBRIGHTNESS);\n e_SurfBr = surfaceBrightness.setToXmlElement(e_SurfBr);\n\n e_Target.appendChild(e_SurfBr);\n }\n\n // If container element was created, add container here so that XML sequence\n // fits forward references\n // Calling the appendChild in the if avbe would cause the session container to\n // be located before\n // observers and sites container\n if (created) {\n ownerDoc.getDocumentElement().appendChild(e_Targets);\n }\n\n return e_Target;\n\n }", "public void setElement(T newvalue);", "static AttributeSet createKeySet(Hashtable hashtable) {\n\n Hashtable newElements = new Hashtable();\n\n Enumeration e = hashtable.keys();\n while (e.hasMoreElements()) {\n Object next = e.nextElement();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "public Builder mergeSetAttribute(alluxio.proto.journal.File.SetAttributeEntry value) {\n if (setAttributeBuilder_ == null) {\n if (((bitField0_ & 0x08000000) == 0x08000000) &&\n setAttribute_ != alluxio.proto.journal.File.SetAttributeEntry.getDefaultInstance()) {\n setAttribute_ =\n alluxio.proto.journal.File.SetAttributeEntry.newBuilder(setAttribute_).mergeFrom(value).buildPartial();\n } else {\n setAttribute_ = value;\n }\n onChanged();\n } else {\n setAttributeBuilder_.mergeFrom(value);\n }\n bitField0_ |= 0x08000000;\n return this;\n }", "public void setElement (T element) {\r\n\t\t\r\n\t\tthis.element = element;\r\n\t\r\n\t}", "AttributeLayout createAttributeLayout();", "public Element generateElement(Document dom);", "protected XMLElement createAnotherElement() {\n return new XMLElement(this.conversionTable,\n this.skipLeadingWhitespace,\n false,\n this.ignoreCase);\n }", "E createDefaultElement();", "protected Attr attr(String name, String value){\n\t\tAttr a = doc.createAttribute(name);\n\t\ta.setValue(value);\n\t\treturn a;\n\t}", "public VAttributeSet getAttributeSet(String names[]) throws VlException\n {\n \treturn new VAttributeSet(getAttributes(names)); \n }", "protected Element el(String tag){\n\t\treturn doc.createElement(tag);\n\t}", "void setAttribute(String name, Object value);", "void setAttribute(String name, Object value);", "public void setElement(T element) {\n\t\tthis.element = element;\n\t}", "public void setElement(Element element) {\n this.element = element;\n }", "public Node(T ele) {\r\n\t\t\tthis.ele = ele;\r\n\t\t}", "Element getElement() {\n\t\tElement result = element.clone();\n\t\tresult.setName(table.getName());\n\t\treturn result;\n\t}", "public E set(int index, E element);", "public Element addAttribute(String name,String value,Document document){\n\t\tElement attr = document.createElement(name); \n\t\tattr.appendChild(document.createTextNode(value));\n\t\treturn attr;\n\t}", "@Override\n\tpublic <E> void add(Attr<E> newAttr) {\n\t\t\n\t}", "public static AttributeDesignatorType fromElement(Element element) throws SAMLException {\n try {\n JAXBContext jc = SAMLJAXBUtil.getJAXBContext();\n \n javax.xml.bind.Unmarshaller u = jc.createUnmarshaller();\n return (AttributeDesignatorType)u.unmarshal(element);\n } catch ( Exception ex) {\n throw new SAMLException(ex.getMessage());\n }\n }", "protected abstract T _createWithSingleElement(DeserializationContext ctxt, Object value);", "public EntityAttribute intern(EntityAttribute att) {\r\n\t\tEntityAttribute result = null;\r\n\t\t// this version seems to have no measurable advantage:\r\n//\t\tresult = internedAttributes.get(att);\r\n//\t\tif (result == null && !ignoredAttNames.contains(att.getName())\r\n//\t\t\t\t&& (!ignorePathNames || !att.getName().contains(\":\"))) {\r\n//\t\t\tresult = new EntityAttribute\r\n//\t\t\t(intern(att.getName()), intern(att.getValue()));\r\n//\t\t\tinternedAttributes.put(result, result);\r\n//\t\t}\r\n//\t\treturn result;\r\n\t\tif (!ignoredAttKeys.contains(att.getKey())\r\n\t\t\t\t&& (!ignorePathKeys || !att.getKey().contains(\":\"))) {\r\n\t\t\tatt.setKey(intern(att.getKey()));\r\n\t\t\tatt.setValue(intern(att.getValue()));\r\n\t\t\tresult = att;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public AttributeSet intersectWith(AttributeSet s) {\n\n Hashtable newElements = new Hashtable();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n if (elements.get(next) != null) {\n newElements.put(next, next);\n }\n }\n\n return new AttributeSet(newElements);\n }", "void set(int index, Object element);", "public void addAttValue(final FileMincAttElem elem, final Object value, final int index) {\r\n elem.setValue(value, index);\r\n }", "public void setElement(int element, int rowIndex, int colIndex){\r\n\t\r\n\t\tmat[rowIndex][colIndex]=element;\r\n\t\r\n\t}", "T set(int index, T element);", "public LineView(Element elem) {\n super(elem);\n }", "@Override\n public E set(int index, E elem) {\n\t E first = _store[index];\n\t _store[index] =elem;\n\t return first;\n }", "@Override\n\tpublic void setAttribute(String arg0, Object arg1) {\n\n\t}", "public void setAttrib(gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Attrib attrib) {\r\n this.attrib = attrib;\r\n }", "public View create(Element elem)\n {\n if(isTextEval) {\n return new bluej.debugmgr.texteval.TextEvalSyntaxView(elem);\n }\n else {\n return new MoeSyntaxView(elem, errorMgr);\n }\n }", "public ElementObjectSupport(ContainerI c, Element element) {\r\n\t\tthis(c, null, element);\r\n\t}", "public AttrObject(){\t\r\n\tvalue = null;\r\n }", "private Attribute createAttribute() {\n\t\t\tAttribute att = AttributeFactory.createAttribute(getName(), getValueType());\n\t\t\tatt.getAnnotations().clear();\n\t\t\tatt.getAnnotations().putAll(getAnnotations());\n\t\t\tattribute = att;\n\t\t\treturn att;\n\t\t}", "public final StyleStyle dup() {\r\n // don't use an ODXMLDocument attribute, search for our document in an ODPackage, that way\r\n // even if our element changes document (toSingle()) we will find the proper ODXMLDocument\r\n final ODXMLDocument xmlFile = this.pkg.getXMLFile(this.getElement().getDocument());\r\n final String unusedName = xmlFile.findUnusedName(getFamily(), this.desc == null ? this.getName() : this.desc.getBaseName());\r\n final Element clone = (Element) this.getElement().clone();\r\n clone.setAttribute(\"name\", unusedName, this.getSTYLE());\r\n JDOMUtils.insertAfter(this.getElement(), singleton(clone));\r\n return this.desc == null ? new StyleStyle(this.pkg, clone) : this.desc.create(this.pkg, clone);\r\n }", "AdditionalAttributes setAttribute(String name, Object value, boolean force);", "public alluxio.proto.journal.File.SetAttributeEntry.Builder getSetAttributeBuilder() {\n bitField0_ |= 0x08000000;\n onChanged();\n return getSetAttributeFieldBuilder().getBuilder();\n }", "public void setID( Element elem, GraphObject go ) {\n NamedNodeMap docmap = elem.getAttributes();\n String oldID = getNamedAttributeFromMap( docmap, \"id\" );\n if ( oldID == null ) {\n return; // a special case when copying, since the top level element has no info\n }\n if ( !isKeepIDs() ) {\n oldNewIDs.put( oldID, go.objectID.toString() );\n } else {\n go.objectID = new GraphObjectID( oldID );\n }\n }", "public static native Element overwrite(Element oldElem, Element newElem)/*-{\r\n\t\treturn $wnd.Ext.DomHelper.overwrite(oldElem, newElem);\r\n\t}-*/;", "public XmlProtoAttributeBuilder getOrCreateAndroidAttribute(String name, int resourceId) {\n return getOrCreateAttributeInternal(\n /* attributePredicate= */ attr ->\n attr.getName().equals(name)\n && attr.getNamespaceUri().equals(ANDROID_NAMESPACE_URI)\n && attr.getResourceId() == resourceId,\n /* attributeFactory= */ () ->\n XmlAttribute.newBuilder()\n .setName(name)\n .setNamespaceUri(ANDROID_NAMESPACE_URI)\n .setResourceId(resourceId));\n }", "public TempList<T> set(int index, T elem) {\n chk();\n list.set(index, elem);\n return this;\n }", "HTMLElement createHTMLElement();", "private com.google.protobuf.SingleFieldBuilder<\n alluxio.proto.journal.File.SetAttributeEntry, alluxio.proto.journal.File.SetAttributeEntry.Builder, alluxio.proto.journal.File.SetAttributeEntryOrBuilder> \n getSetAttributeFieldBuilder() {\n if (setAttributeBuilder_ == null) {\n setAttributeBuilder_ = new com.google.protobuf.SingleFieldBuilder<\n alluxio.proto.journal.File.SetAttributeEntry, alluxio.proto.journal.File.SetAttributeEntry.Builder, alluxio.proto.journal.File.SetAttributeEntryOrBuilder>(\n setAttribute_,\n getParentForChildren(),\n isClean());\n setAttribute_ = null;\n }\n return setAttributeBuilder_;\n }", "@org.junit.Test\n public void constrCompelemAttr3() {\n final XQuery query = new XQuery(\n \"element elem {//west/@mark, //west/@west-attr-1}\",\n ctx);\n try {\n query.context(node(file(\"prod/AxisStep/TopMany.xml\")));\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertSerialization(\"<elem mark=\\\"w0\\\" west-attr-1=\\\"w1\\\"/>\", false)\n );\n }", "public void setAttrib(String name, String value);", "@Test\n\tpublic void addAttribute() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\n\t\tXMLTagParser.editElement(\"Person\", \"name\", \"tony\");\n\t\tassertEquals(XMLTagParser.getTagValueFromElement(\"Person\", \"name\"), \"tony\");\n\t}", "public void setElement(WebElement element) {\n\t\t\r\n\t}", "public void setElement(String v){\n\t\ttry{\n\t\tsetProperty(SCHEMA_ELEMENT_NAME + \"/element\",v);\n\t\t_Element=null;\n\t\t} catch (Exception e1) {logger.error(e1);}\n\t}", "public String getElementAttribute(int row, int attr, int chromosome);" ]
[ "0.6940441", "0.63560545", "0.62211156", "0.5749023", "0.5557387", "0.5546714", "0.5416203", "0.5257667", "0.51859707", "0.5183661", "0.5092546", "0.5072406", "0.50609845", "0.5033325", "0.5021887", "0.5000278", "0.49969417", "0.49900502", "0.49851537", "0.49815884", "0.49371022", "0.4909276", "0.49060792", "0.49014607", "0.48754713", "0.48754713", "0.48262337", "0.48096183", "0.4754695", "0.47516435", "0.47302538", "0.4723882", "0.47199976", "0.4667683", "0.4651868", "0.4648619", "0.46330914", "0.4629948", "0.4593596", "0.45919445", "0.45853683", "0.4577016", "0.4569823", "0.45687127", "0.45623574", "0.4557507", "0.4541063", "0.4524017", "0.45107245", "0.45030653", "0.44963962", "0.4475385", "0.44700053", "0.44693163", "0.4460439", "0.44463864", "0.44362015", "0.44321674", "0.44189787", "0.440895", "0.43899325", "0.43899325", "0.43770078", "0.4376739", "0.4362768", "0.43563673", "0.43519133", "0.43410134", "0.4332096", "0.43307167", "0.43278375", "0.4319912", "0.430894", "0.43028283", "0.43001568", "0.4299348", "0.42993295", "0.42952663", "0.42942107", "0.42855033", "0.42852086", "0.42839694", "0.42752934", "0.4274937", "0.427243", "0.42629588", "0.42617285", "0.426154", "0.42557988", "0.4243916", "0.42430082", "0.4241778", "0.42379385", "0.4229022", "0.42277324", "0.42275926", "0.4223663", "0.4218958", "0.4214064", "0.42085075" ]
0.78465086
0
Create a new AttributeSet containing the items in the array elems.
public AttributeSet(Object[] elems) { elements = new Hashtable(elems.length, 1); for (int i=0; i < elems.length; i++) { Object next = elems[i]; elements.put(next, next); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AttributeSet(Object elem) {\n\n elements = new Hashtable(1, 1);\n elements.put(elem, elem);\n }", "public AttributeSet() {\n\n elements = new Hashtable();\n }", "public VAttributeSet getAttributeSet(String names[]) throws VlException\n {\n \treturn new VAttributeSet(getAttributes(names)); \n }", "public AttributeSet unionWith(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "public AttributeSet addElement(Object element) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n newElements.put(element, element);\n return new AttributeSet(newElements);\n }", "public AttributeSet flatCopy() {\r\n AttributeSet res = new AttributeSet();\r\n for (String k : getAllAttributes()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "public AttributeSet copy() {\r\n AttributeSet res = new AttributeSet(parent.orNull());\r\n for (String k : attributeMap.keySet()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "public AttributeSet immutable() {\r\n return ImmutableAttributeSet.copyOf(this);\r\n }", "public ZYArraySet(){\n elements = (ElementType[])new Object[DEFAULT_INIT_LENGTH];\n }", "public static AttributeSet with(String key, Object val) {\r\n AttributeSet res = new AttributeSet();\r\n res.put(key, val);\r\n return res;\r\n }", "public AttributeSet intersectWith(AttributeSet s) {\n\n Hashtable newElements = new Hashtable();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n if (elements.get(next) != null) {\n newElements.put(next, next);\n }\n }\n\n return new AttributeSet(newElements);\n }", "private void init(final AttributeSet set) {\n }", "private void initTypedArray(Context context, AttributeSet attrs) {\n final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.rippleLayout);\n\n mRippleColor = typedArray.getColor(R.styleable.rippleLayout_color, DEFAULT_RIPPLE_COLOR);\n mStrokeWidth = typedArray.getDimension(R.styleable.rippleLayout_strokeWidth, DEFAULT_STROKE_WIDTH);\n mRippleRadius = typedArray.getDimension(R.styleable.rippleLayout_radius, DEFAULT_RADIUS);\n mAnimDuration = typedArray.getInt(R.styleable.rippleLayout_duration, DEFAULT_DURATION_TIME);\n mRippleViewNums = typedArray.getInt(R.styleable.rippleLayout_rippleNums, DEFAULT_RIPPLE_COUNT);\n mRippleScale = typedArray.getFloat(R.styleable.rippleLayout_scale, DEFAULT_SCALE);\n\n /**\n * recycle the typedArray\n */\n typedArray.recycle();\n }", "public final static WMAttribute[] fromAttributeInstances(\r\n IAttributeInstance[] attrs )\r\n {\r\n\r\n WMAttribute[] wmAttrs = new WMAttribute[attrs.length];\r\n for ( int i = 0; i < attrs.length; i++ ) {\r\n IAttributeInstance attr = attrs[i];\r\n if ( attr == null ) {\r\n break;\r\n }\r\n wmAttrs[i] = new WMAttributeImpl( attr.getName(), attr.getType(),\r\n attr.getValue() );\r\n }\r\n return wmAttrs;\r\n }", "public ZYArraySet(int initLength){\n if(initLength<0)\n throw new IllegalArgumentException(\"The length cannot be nagative\");\n elements = (ElementType[])new Object[initLength];\n }", "public void setAttributes(Attributes atts) {\n _length = atts.getLength();\n if (_length > 0) {\n \n if (_length >= _algorithmData.length) {\n resizeNoCopy();\n }\n \n int index = 0;\n for (int i = 0; i < _length; i++) {\n _data[index++] = atts.getURI(i);\n _data[index++] = atts.getLocalName(i);\n _data[index++] = atts.getQName(i);\n _data[index++] = atts.getType(i);\n _data[index++] = atts.getValue(i);\n index++;\n _toIndex[i] = false;\n _alphabets[i] = null;\n }\n }\n }", "protected abstract void useStyleAttributes(TypedArray attrs);", "public AttributeSet and(String key, Object val) {\r\n put(key, val);\r\n return this;\r\n }", "public TrustingMonotonicArraySet(T[] elements) {\n this();\n\n for (T element : elements) {\n add(element);\n }\n }", "static AttributeSet createKeySet(Hashtable hashtable) {\n\n Hashtable newElements = new Hashtable();\n\n Enumeration e = hashtable.keys();\n while (e.hasMoreElements()) {\n Object next = e.nextElement();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "public static void initializeClassAttributes() {\n\t\tAboraSupport.findAboraClass(IntegerVarArray.class).setAttributes( new Set().add(\"CONCRETE\").add(\"PSEUDOCOPY\"));\n\t}", "public _arrayInitExpr add(String...exprs){\n Stream.of(exprs).forEach(e -> add( _expr.of(e)));\n return this;\n }", "@Test \r\n\t\tpublic void testCreateSetFromArray() {\n\t\t\tInteger [] array = { 1, 2, 3, 4, 5, 6,7};\r\n\t\t\t// set = to the array of values \r\n\t\t\ttestingSet2 = new IntegerSet(array);\r\n\t\t\t// set created from the array is = to the array \r\n\t\t\tassertArrayEquals(testingSet2.toArray(), array); \r\n\t\t}", "public static AttributeSet withParent(AttributeSet par) {\r\n return new AttributeSet(par);\r\n }", "static void m663a(View view, AttributeSet attributeSet, int i, int i2) {\n Context context = view.getContext();\n TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, f439a, i, i2);\n try {\n if (obtainStyledAttributes.hasValue(0)) {\n view.setStateListAnimator(AnimatorInflater.loadStateListAnimator(context, obtainStyledAttributes.getResourceId(0, 0)));\n }\n obtainStyledAttributes.recycle();\n } catch (Throwable th) {\n obtainStyledAttributes.recycle();\n }\n }", "protected Element el(String tag, Node[] childs){\n\t\tElement e = doc.createElement(tag);\n\t\tfor (Node i: childs){\n\t\t\tif (i instanceof Attr) { \n\t\t\t\te.setAttributeNode((Attr)i);\n\t\t\t} else {\n\t\t\t\te.appendChild(i);\n\t\t\t}\n\t\t}\n\t\treturn e;\n\t}", "public Vector(boolean useGiven, double... elems) {\n\t\tif (useGiven) {\n\t\t\tthis.elements = elems;\n\t\t} else {\n\t\t\tthis.elements = new double[elems.length];\n\t\t\tfor (int i = elems.length - 1; i >= 0; i--) {\n\t\t\t\tthis.elements[i] = elems[i];\n\t\t\t}\n\t\t}\n\t\tdimensions = elems.length;\n\t}", "public static Set asSet(Object[] items) {\r\n \t\r\n \tSet set = new HashSet(items.length);\r\n \tfor (int i=0; i<items.length; i++) {\r\n \t\tset.add(items[i]);\r\n \t}\r\n \treturn set;\r\n }", "public Result addAttrs(List<TypedEntry<?>> entries) {\n return withAttrs(attrs.putAll(entries));\n }", "public ArgList(Object[] argList, int offset) {\n super(argList == null ? 0 : argList.length - offset);\n if (argList != null) {\n for (int i = offset; i < argList.length; i++)\n addElement(argList[i]);\n }\n }", "public void initAttributes(ObservableList<Item> items) {\n this.items = items;\n }", "private void initAttributes(Context context, AttributeSet attrs, int defStyleAttr) {\n\n textSize *= DENSITY;\n itemMargin *= DENSITY;\n selectedIndex = -1;\n /**\n * Getting values of the attributes from the XML.\n * The default value of the attribute is retained if it is not set from the XML or setters.\n */\n if (attrs != null) {\n final TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.HorizontalPicker, defStyleAttr, 0);\n backgroundSelector = array.getResourceId(R.styleable.HorizontalPicker_backgroundSelector, backgroundSelector);\n colorSelector = array.getResourceId(R.styleable.HorizontalPicker_textColorSelector, colorSelector);\n textSize = array.getDimensionPixelSize(R.styleable.HorizontalPicker_textSize, textSize);\n itemHeight = array.getDimensionPixelSize(R.styleable.HorizontalPicker_itemHeight, itemHeight);\n itemWidth = array.getDimensionPixelSize(R.styleable.HorizontalPicker_itemWidth, itemWidth);\n itemMargin = array.getDimensionPixelSize(R.styleable.HorizontalPicker_itemMargin, itemMargin);\n array.recycle();\n }\n\n }", "public static void addAtts(Collection<String> arr){\n\t\tarr.forEach(it -> selectedAtts.put(it,true));\n\t}", "@SafeVarargs\n public static <T> Set<T> makeSet(T... entries) {\n return new HashSet<>(Arrays.asList(entries));\n }", "public void setAttributes(EncodingAlgorithmAttributes atts) {\n _length = atts.getLength();\n if (_length > 0) {\n \n if (_length >= _algorithmData.length) {\n resizeNoCopy();\n }\n \n int index = 0;\n for (int i = 0; i < _length; i++) {\n _data[index++] = atts.getURI(i);\n _data[index++] = atts.getLocalName(i);\n _data[index++] = atts.getQName(i);\n _data[index++] = atts.getType(i);\n _data[index++] = atts.getValue(i);\n _data[index++] = atts.getAlgorithmURI(i);\n _algorithmIds[i] = atts.getAlgorithmIndex(i);\n _algorithmData[i] = atts.getAlgorithmData(i);\n _toIndex[i] = false;\n _alphabets[i] = null;\n }\n }\n }", "abstract CharArraySet build();", "@SafeVarargs\n public Array(T... items)\n {\n this.array = items;\n this.next = items.length;\n }", "public static final HashSet set (Object ... items) {\r\n HashSet result = new HashSet();\r\n for (int i=0; i<items.length; i++) {\r\n result.add(items[i]);\r\n }\r\n return result;\r\n }", "public void constructArray(){\n\t\tfor (int col = 0; col < cols; col++){\n\t\t\tfor (int row = 0; row < rows; row++){\n\t\t\t\tmap[col][row] = new Pixel();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void setAttributeIndices(String value) {\n\t\t\n\t}", "public ArrayList(Object[] e){\n this();\n for(Object i : e){\n this.add((T)i);\n }\n }", "public AttributeSet getAttributes() {\n return null;\n }", "public FancyArray(Object[] arr) {\r\n\t\t/*\r\n\t\t * Statt eines Konstruktors der Oberklasse kann ich auch\r\n\t\t * einen anderen Konstruktor der Klasse selbst aufrufen!\r\n\t\t * \r\n\t\t * Auch dazu benutzen wir das Schlüsselwort this,\r\n\t\t * so rufen wir den parameterlosen Konstruktor auf -\r\n\t\t * so kann ich auch Konstruktoren der gleichen Klasse verketten\r\n\t\t */\r\n\t\tthis();\r\n\t\t//nach dem Aufruf wird dieser Konstruktor weiter ausgeführt:\r\n\t\taddAll(arr);\r\n\t}", "public void setAttributeValues(String[] attributeValues){\n m_attributeValues = attributeValues;\n }", "public Vector(double... elems) {\n\t\tthis(false, elems);\n\t}", "public final void setAttributes(final String[] newAttributes) {\n this.attributes = newAttributes;\n }", "public Result addAttrs(TypedEntry<?>... entries) {\n return withAttrs(attrs.putAll(entries));\n }", "public AttributeSet subtract(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n newElements.remove(iter.next());\n }\n\n return new AttributeSet(newElements);\n }", "public ArraySet(Collection<? extends E> c)\n {\n super(c);\n addsEnabled = false;\n }", "public void expand(ArrayList<Integer> ids) {\n \n arrAttInfos = new ArrayList<ArrayAttributeInfo>();\n for (int i = 0; i < ids.size(); i++) {\n ArrayAttributeInfo aai = new ArrayAttributeInfo(ids.get(i));\n arrAttInfos.add(aai);\n }\n \n }", "private static VertexAttribute[] createAttributes(int numTexCoords, boolean hasColor, VertexAttribute... generics)\n\t{\n\t\tint genLen = generics != null ? generics.length : 0;\n\t\tint len = hasColor ? 2 : 1;\n\t\tVertexAttribute[] attr = new VertexAttribute[numTexCoords + len + genLen];\n\t\tint off = 0;\n\t\tattr[off++] = new VertexAttribute(Usage.Position, 2, ShaderProgram.POSITION_ATTRIBUTE);\n\t\tif (hasColor)\n\t\t\tattr[off++] = new VertexAttribute(Usage.ColorPacked, 4, ShaderProgram.COLOR_ATTRIBUTE);\n\t\tfor (int i = 0; i < numTexCoords; i++) //add texcoords\n\t\t\tattr[off++] = new VertexAttribute(Usage.TextureCoordinates, 2, ShaderProgram.TEXCOORD_ATTRIBUTE + i);\n\t\tif (generics != null)\n\t\t\tfor (VertexAttribute a : generics) //add generics\n\t\t\t\tattr[off++] = a;\n\t\treturn attr;\n\t}", "public DList( String Attribs)\r\n {\r\n this(); \r\n String param =\"\";\r\n if( Attribs != null )\r\n param = \" \"+Attribs;\r\n setAttribute(param);\r\n }", "@Override\n\tpublic AttributeSet getAttributes() {\n\t\treturn null;\n\t}", "set.addAll(Arrays.asList(a));", "public static Collection<Character> characterArrayToSet(Character[] charArray){\n\t\tCollection<Character> charSet = new HashSet<Character>();\n\t\tfor(Character c : charArray){\n\t\t\tcharSet.add(c);\n\t\t}\n\t\treturn charSet;\n\t}", "public AttributesSelector(String[] attributeNames) {\n\t\tallSelectedAttributes = new TreeSet<Integer>();\n\t\t\n\t\tGridBagLayout gridBagLayout = new GridBagLayout();\n\t\tgridBagLayout.columnWeights = new double[]{1.0};\n\t\tgridBagLayout.rowWeights = new double[]{0.0, 1.0};\n\t\tsetLayout(gridBagLayout);\n\t\t\n\t\tJLabel infoLabel = new JLabel(\"Select one or more attributes\");\n\t\tinfoLabel.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tGridBagConstraints gbc_infoLabel = new GridBagConstraints();\n\t\tgbc_infoLabel.insets = new Insets(5, 5, 5, 0);\n\t\tgbc_infoLabel.gridx = 0;\n\t\tgbc_infoLabel.gridy = 0;\n\t\tadd(infoLabel, gbc_infoLabel);\n\t\t\n\t\tattributeList = new JList<String>(attributeNames);\n\t\tattributeList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);\n\t\tattributeList.addListSelectionListener(this);\n\t\tGridBagConstraints gbc_list = new GridBagConstraints();\n\t\tgbc_list.insets = new Insets(0, 5, 5, 5);\n\t\tgbc_list.fill = GridBagConstraints.BOTH;\n\t\tgbc_list.gridx = 0;\n\t\tgbc_list.gridy = 1;\n\t\tadd(attributeList, gbc_list);\n\t}", "public static NewArrayExpression newArrayInit(Class type, Iterable<Expression> expressions) { throw Extensions.todo(); }", "protected static <T> Set<T> itemSet(T[] items) {\n return new HashSet<>(Arrays.asList(items));\n }", "public GUIAttributeSet getAttributeSet(long setId) throws ServerException;", "private void createItemsetsOfSize1() {\n itemsets = new ArrayList<>();\n for (int i = 0; i < numItems; i++) {\n String[] cand = {words.get(i)};\n itemsets.add(cand);\n }\n }", "public JsonElement apply(JsonElement instance) throws BadValueException {\r\n\t\tJsonArray array = new JsonArray();\r\n\t\tfor (Attribute subattribute : elements) {\r\n\t\t\tarray.add( subattribute.apply(instance) );\r\n\t\t}\r\n\t\treturn array;\r\n\t}", "public void setItems(Object[] newItems)\n {\n items = new Vector(newItems.length);\n for (int i=0; i < newItems.length; i++)\n {\n items.addElement(newItems[i]);\n }\n }", "protected void setArray(Expression expr)\n {\n setExpression(expr);\n }", "public VirtualDataSet(ActualDataSet source, int[] rows, Attribute[] attributes) { \n\t\tthis.source = source;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Sets the reference of VirtualDataSet's source to the ActualDataSet \n\t\tthis.numAttributes = attributes.length;\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Sets the variable numAttributes to be the number of attributes being passed in\n\t\tthis.numRows = rows.length;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Sets the variable numRows to be the number of indexes being passed in the parameter\n\t\tthis.attributes = attributes;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Sets the variable attributes to reference the attributes array being passed in the parameters\n\t\tint[] copyOfRows = new int[rows.length];\t\t\t\t\t\t\t\t\t\t\t\t\t//Creates a new copy of int array rows and stores it within variable copyOfRows\n\t\tfor(int i =0; i<copyOfRows.length; i++){\n\t\t\tcopyOfRows[i] = rows[i];\n\t\t}\n\t\tmap = copyOfRows;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Sets the variable map to reference rows\n\n\t\tAttribute[] copyOfAttributes = new Attribute[attributes.length];\t\t\t\t\t\t\t//Creates a deep copy of attributes array and stores it within variable copyOfAttributes\n\t\tfor(int i =0; i<attributes.length; i++){\n\t\t\tcopyOfAttributes[i] = attributes[i].clone();\n\t\t}\n\t\tfor(int j = 0; j<attributes.length; j++){\t\t\t\t\t\t\t\t\t\t\t\t\t//Loops through each attribute individually\n\t\t\tString []newValues = new String[rows.length];\t\t\t\t\t\t\t\t\t\t\t//Declares a new String array called newValues\n\t\t\tfor(int i =0; i<rows.length; i++){\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Loops through the rows array and stores the attributes corresponding to the indexes in rows array into String array newValues\n\t\t\t\tnewValues[i] = source.getValueAt(rows[i],copyOfAttributes[j].getAbsoluteIndex());\t\n\t\t\t}\n\t\t\tcopyOfAttributes[j].replaceValues(newValues);\t\t\t\t\t\t\t\t\t\t\t//Replaces the values stored within attributes array copyOfAttributes with newValues\t\t\t\t\n\t\t\tcopyOfAttributes[j].replaceValues(getUniqueAttributeValues(copyOfAttributes[j].getAbsoluteIndex()));\t//Replaces the values of attribute copyOfAttribute with the non-duplicated String array newValues\n\t\t}\n\n\t\tthis.attributes = copyOfAttributes;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Sets the reference of attributes to the newly edited attributes array copyOfAttributes\n\n\t}", "public void set(int[] ai);", "public ArraySet() {\n\t\tthis(DEFAULT_CAPACITY);\n\t}", "AttributeDeclarations createAttributeDeclarations();", "private XMLDocument addAttributes(Object[] attributes) {\r\n if (attributes != null) {\r\n for (int i = 0; i < attributes.length; i += 2) {\r\n Object name = attributes[i];\r\n\r\n if (name instanceof List<?>) {\r\n List<?> attributesList = (List<?>) name;\r\n i--;\r\n\r\n addAttributes(attributesList);\r\n\r\n } else {\r\n Object value = attributes[i + 1];\r\n xml.append(\" \").append(name).append(\"=\\\"\").append(value).append(\"\\\"\");\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n }", "public synchronized void setAttributes(final Set<? extends AttributeType> newValues) {\n attributes = copySet(newValues, attributes, AttributeType.class);\n }", "public ArrayListIterator(E... array) {\r\n\t\tthis(array, 0, array.length);\r\n\t}", "public Tuple(List<Term> elts) {\n\t\tTerm[] tmp = new Term[elts.size()];\n\t\tthis.elts = elts.toArray(tmp);\n\t}", "public void set(String[] as);", "EnsureExprsRule createEnsureExprsRule();", "public NavigationTabSet(@NotNull NavigationTabSetItem... navigationTabSetItemArr) {\n super(ArraysKt___ArraysKt.toList(navigationTabSetItemArr));\n Intrinsics.checkNotNullParameter(navigationTabSetItemArr, \"tabs\");\n }", "public ArrayMapIterator(SimpleEntry<K, V>[] entries) {\n this.entries = entries;\n }", "public static AColGroup create(double[] values) {\n\t\treturn create(ColIndexFactory.create(values.length), values);\n\t}", "private void setAttribute(ASTAttrSpecNode attrSpec)\n {\n ASTArraySpecNode arraySpec = attrSpec.getArraySpec();\n ASTAccessSpecNode accessSpec = attrSpec.getAccessSpec();\n \n if (arraySpec != null)\n setArraySpec(arraySpec);\n else if (accessSpec != null)\n setVisibility(accessSpec);\n else if (attrSpec.isParameter())\n setParameter();\n\n // TODO: Intent, etc.\n }", "public AttributeSet getClosure(AttributeSet attrs);", "public MutableArray(ARRAY paramARRAY, int paramInt, CustomDatumFactory paramCustomDatumFactory)\n/* */ {\n/* 155 */ this.length = -1;\n/* 156 */ this.elements = null;\n/* 157 */ this.datums = null;\n/* 158 */ this.pickled = paramARRAY;\n/* 159 */ this.pickledCorrect = true;\n/* 160 */ this.sqlType = paramInt;\n/* 161 */ this.old_factory = paramCustomDatumFactory;\n/* 162 */ this.isNChar = false;\n/* */ }", "private void setVertices(Vertex[] vs){\n\t\t\n\t\tvertices = new ArrayList<>();\n\t\toriginalVertices = new ArrayList<>();\n\t\tdouble scalar = ViewSettings.getScalar4();\n\n\t\tfor(Vertex v : vs){\n\t\t\tvertices.add(new Vertex(v.getX() * scalar, v.getY() * scalar, v.getZ() * scalar, v.getW() * scalar));\n\t\t\toriginalVertices.add(new Vertex(v.getX(), v.getY(), v.getZ(), v.getW()));\n\t\t}\n\t}", "public void setArr(int[] arr){ this.arr = arr; }", "public IndexedSetView(final Collection<T> items) {\n\t\tthis(items, Random.class);\n\t}", "public a generateLayoutParams(AttributeSet attributeSet) {\n return new a();\n }", "public static Drawable m123069a(int[] iArr) {\n return m123070a(iArr, Orientation.TR_BL);\n }", "public IRubyObject aset(IRubyObject[] args) {\n switch (args.length) {\n case 2:\n return aset(args[0], args[1]);\n case 3:\n return aset(args[0], args[1], args[2]);\n default:\n throw getRuntime().newArgumentError(\"wrong number of arguments (\" + args.length + \" for 2)\");\n }\n }", "public void\nsetColorIndexElt( SoNode node, int numIndices, \n int[] indices)\n{\n this.coinstate.colorindexarray = new IntArrayPtr(indices);\n this.coinstate.numdiffuse = numIndices;\n this.coinstate.packeddiffuse = false;\n}", "public MultiArrayDimension() {\n\t\tthis(\"\", 0, 0);\n\t}", "public abstract void init(ArrayList<String> ary);", "public Matrix3D(double[] d1) {\n super(3,3);\n int k = -1;\n for (int i=0 ; i<3 ; i++) { // loop over rows\n for (int j=0 ; j<3 ; j++) { // loop over columns\n k++;\n set(i,j,d1[k]); // d[i][j] = d1[k];\n }\n }\n }", "public synchronized void setAttributeInstances(final Set<? extends AttributeType> newValues) {\n attributeInstances = copySet(newValues, attributeInstances, AttributeType.class);\n }", "ListItem(Element[] elements) {\n\t\tsuper(elements);\n\t}", "public void setAttributesetarray(String attributesetarray) {\r\n this.attributesetarray = attributesetarray == null ? null : attributesetarray.trim();\r\n }", "public SeqItemset createExtendedWith(SeqItem it){\n\t\tSeqItemset newSet = new SeqItemset(m_itemset.length+1);\n\t\tSystem.arraycopy(m_itemset,0,newSet.m_itemset, 0, m_itemset.length);\n\t\tnewSet.m_itemset[m_itemset.length] = it;\n\t\treturn newSet;\n\t}", "List<Type> attribExprs(List<JCExpression> trees, Env<AttrContext> env, Type pt) {\n\t\tDEBUG.P(this,\"attribExprs(3)\");\n ListBuffer<Type> ts = new ListBuffer<Type>();\n for (List<JCExpression> l = trees; l.nonEmpty(); l = l.tail)\n ts.append(attribExpr(l.head, env, pt));\n\n\t\tDEBUG.P(0,this,\"attribExprs(3)\");\n return ts.toList();\n }", "public void setArray(int i, Array x);", "public Grid(int rows, int cols, String[] vals)\r\n\t{\r\n\t}", "public StackClass(int ele[]){\n \tsize=ele.length;\n \telements =new int[size];\n \ttop=size-1;\n \n \tfor(int i=0;i<ele.length;i++)\n \telements[i]=ele[i];\n\t}", "public void setHints(String[] attrHints, String[] attrHintValues) {\n \t\tfAttrHints = attrHints;\n \t\tfAttrHintValues = attrHintValues;\n \t}", "public SeqItemset(SeqItemset s)\n\t{\n\t\tm_size = s.m_size;\n\t\tm_elems = new short[m_size];\n\t\t//m_itemset = new SeqItem[m_size];\n\t\tfor (int i=0; i<m_size; i++)\n\t\t\tm_elems[i] = s.m_elems[i];\n\t}", "public static ClassAdStructAttr[] setAttributeValue(\n\t\t\t\t\t ClassAdStructAttr[] classAd,\n\t\t\t\t\t ClassAdStructAttr newAttr) {\n\tint len = classAd.length;\n for(int i=0;i<len;i++) {\n if((newAttr.getName()).compareToIgnoreCase(classAd[i].getName()) == 0) {\n\t\tclassAd[i].setValue(newAttr.getValue());\n\t\tclassAd[i].setType(newAttr.getType());\n\t\treturn classAd;\n\t }\n }\n\t//add new entry\n\tClassAdStructAttr[] newClassAd = new ClassAdStructAttr[len+1];\n\tfor(int i=0;i<len+1;i++)\n\t newClassAd[i] = new ClassAdStructAttr();\n\n\tfor(int i=0;i<len;i++) {\n\t newClassAd[i].setName(classAd[i].getName());\n\t newClassAd[i].setValue(classAd[i].getValue());\n\t newClassAd[i].setType(classAd[i].getType());\n\t}\n\tnewClassAd[len].setName(newAttr.getName());\n\tnewClassAd[len].setValue(newAttr.getValue());\n\tnewClassAd[len].setType(newAttr.getType());\n\treturn newClassAd;\n }" ]
[ "0.6161146", "0.594929", "0.58259773", "0.5568574", "0.55653435", "0.55450034", "0.51190734", "0.5109538", "0.5092664", "0.5045352", "0.4991938", "0.495583", "0.49189785", "0.4889772", "0.4807844", "0.46846557", "0.46572527", "0.45952156", "0.4571233", "0.45376617", "0.45056245", "0.4489758", "0.44761223", "0.44532654", "0.44332066", "0.44217438", "0.44199622", "0.43851674", "0.43386826", "0.4327787", "0.43200773", "0.43060946", "0.42924315", "0.42914614", "0.42586365", "0.4254528", "0.4247483", "0.42452788", "0.42399815", "0.42364824", "0.42350402", "0.42184305", "0.42172858", "0.4204521", "0.4195317", "0.41889107", "0.41870204", "0.41753617", "0.41696802", "0.415848", "0.41519567", "0.41494936", "0.41483352", "0.4146929", "0.4137862", "0.41291836", "0.41169316", "0.4113399", "0.4109804", "0.41086566", "0.41074374", "0.41003838", "0.40982607", "0.4095647", "0.40950495", "0.409162", "0.40834886", "0.40831023", "0.4082629", "0.40824237", "0.40779656", "0.40768442", "0.4076686", "0.4069431", "0.40605494", "0.405717", "0.40514612", "0.40510058", "0.40477386", "0.40423095", "0.40405506", "0.40381813", "0.40347156", "0.40233123", "0.40227574", "0.4016923", "0.40154433", "0.4013892", "0.40126652", "0.40122", "0.40037546", "0.40032274", "0.40018606", "0.3997", "0.39927176", "0.39890516", "0.3986874", "0.3983065", "0.39826995", "0.39786068" ]
0.7726321
0
Return true if the number of elements in this set is 0.
public boolean isEmpty() { return elements.isEmpty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isEmpty(){\n if(set.length == 0)\n return true;\n return false;\n }", "public boolean isEmpty(){\n\t\treturn (howMany==0);\n\t}", "public boolean isEmpty()\r\n {\r\n if (count > 0) return false;\r\n else return true;\r\n }", "public boolean isEmpty() {\n\t\treturn (N == 0);\t\n\t}", "public boolean isEmpty() {\n return pointsSet.isEmpty();\n }", "public boolean isEmpty() {\n return (count == 0);\n }", "public boolean isEmpty() {\n\t\treturn elements == 0;\n\t}", "public boolean isEmpty()\r\n\t{\r\n\t\treturn (count == 0);\r\n\t}", "public boolean isEmpty() {\n\t\treturn N == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn N == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn N == 0;\n\t}", "public boolean isEmpty()\r\n\t{\r\n\t\treturn count == 0;\r\n\t}", "public boolean isEmpty() {\n return elements == 0;\n }", "public boolean isEmpty() {\n return (this.count == 0);\n }", "public boolean isEmpty() {\r\n return N == 0;\r\n }", "public boolean isEmpty() { return count == 0; }", "public boolean isEmpty() {\n return count == 0;\n }", "public boolean isEmpty() {\n return count == 0;\n }", "public boolean isEmpty() {\n return count == 0;\n }", "public boolean isEmpty() {\n\t\treturn numElements == 0; // Dummy return\n\t}", "public boolean isEmpty() {\n return N == 0;\n }", "public boolean isEmpty() {\n return N == 0;\n }", "public boolean isEmpty() {\n return N == 0;\n }", "public boolean isEmpty() {\n return N == 0;\n }", "public boolean isZero()\r\n {\r\n boolean is = true;\r\n for (int i = 0; i < SIZE; i++)\r\n {\r\n if ( this.myArray[i] != 0)\r\n {\r\n is = false;\r\n }\r\n }\r\n return is;\r\n }", "public boolean isEmpty() {\n\t\treturn count == 0? true : false;\r\n\t}", "public boolean isEmpty() {\n return cnt == 0;\n }", "public boolean isEmpty() {\n\t\treturn count==0;\n\t}", "@Override\r\n\tpublic boolean isempty() {\n\t\treturn count<=0;\r\n\t\t\r\n\t}", "public boolean isEmpty() {\n return N == 0;\n }", "public boolean isEmpty() {\n\t\treturn numElements==0;\n\t}", "public boolean isEmpty() {\r\n\tfor (int i = 0; i < this.size; i++) {\r\n\t if (this.territory[0][i] != 0 || this.territory[1][i] != 0) {\r\n\t\treturn false;\r\n\t }\r\n\t}\r\n\r\n\treturn true;\r\n }", "public boolean isEmpty() {\n return (this.size == 0);\n }", "public boolean isEmpty() {\n return this.size == 0;\n }", "public boolean isEmpty() {\n return this.size == 0;\n }", "public boolean isEmpty(){\n return (count == 0);\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn set.isEmpty();\r\n\t}", "public boolean isEmpty() {\n\t\treturn(this.size == 0);\n\t}", "public boolean isEmpty()\r\n {\r\n return (size() == 0);\r\n }", "public boolean isEmpty()\n {\n return this.size == 0;\n }", "public boolean isEmpty()\n\t{\n\t\tif (counter > 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public boolean isEmpty() {\r\n\t\treturn n == 0;\r\n\t}", "public boolean isEmpty() {\n return (size() == 0);\n }", "public boolean isEmpty() {\n\t\treturn this.size == 0;\n\t}", "public boolean isEmpty(){\n\t\tboolean ans = false;\n\t\tif (_size == 0) ans = true;\n\t\treturn ans;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\tboolean respuesta = true;\n\t\tif(N > 0)\n\t\t{\n\t\t\trespuesta = false;\n\t\t}\n\t\treturn respuesta;\n\t}", "public boolean isEmpty () {\n return mPezCount == 0;\n }", "@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn count == 0;\r\n\t}", "public boolean isEmpty() {\r\n\t\tif (this.size == 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isEmpty() {\r\n return (size == 0);\r\n }", "public boolean isEmpty() {\n return size <= 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "public final boolean isEmpty() {\r\n\t\treturn this.size == 0;\r\n\t}", "public boolean isEmpty(){\r\n\t\treturn size() == 0;\r\n\t}", "public boolean isZero() {\r\n for (int i = 0; i < this.getDimension(); i++) {\r\n if (this.getComponent(i) != 0)\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isEmpty() {\n\t\treturn vector.isEmpty();\n\t}", "public boolean isEmpty() {\n return (size == 0);\n }", "public boolean isEmpty() {\n\t\tif (this.size() == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean isEmpty() \r\n\t{\r\n\t\treturn size() == 0;\r\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\r\n return size == 0;\r\n }", "public boolean isEmpty() {\r\n return size == 0;\r\n }", "public boolean isEmpty() {\n return (n == 0);\n }", "@Override\n public boolean isEmpty() {\n if (count == 0) {\n return true;\n }\n return false;\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn this.size == 0;\r\n\t}", "public boolean isEmpty() {\n\t\treturn (size == 0);\n\t}", "public boolean isEmpty() { \r\n \treturn n == 0;\r\n }", "public boolean isEmpty() {\r\n\t\tfor (double d : values) {\r\n\t\t\tif (!Double.isNaN(d)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean isEmpty() {\n\t\treturn size == 0;\r\n\t}", "public static boolean isEmpty() \r\n\t{\r\n\t\treturn m_count == 0;\r\n }", "public boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean isEmpty() {\n\t return size() == 0;\n\t }", "public boolean isEmpty() {\r\n\t\treturn size == 0;\r\n\t}", "public boolean isEmpty()\n {\n return count==0;\n }", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() { return size == 0; }", "public synchronized boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean isEmpty() {\n return size == 0;\n }", "public boolean isEmpty() {\n return size == 0;\n }", "public boolean isEmpty() {\n return size == 0;\n }", "public boolean isEmpty() {\n return size == 0;\n }", "public boolean isEmpty() {\n return size == 0;\n }", "public boolean isEmpty() {\n return size == 0;\n }", "public boolean isEmpty() {\n return size == 0;\n }", "public boolean isEmpty() {\n return size == 0;\n }" ]
[ "0.7810498", "0.7763007", "0.77491987", "0.7715473", "0.7700067", "0.7685114", "0.76734275", "0.76708424", "0.7654865", "0.7654865", "0.7654865", "0.7651606", "0.7640092", "0.76360947", "0.763547", "0.76225746", "0.76109225", "0.76109225", "0.76109225", "0.7596025", "0.7591164", "0.7591164", "0.7591164", "0.7591164", "0.757836", "0.7558464", "0.7550818", "0.7536836", "0.7533005", "0.7526615", "0.7513929", "0.7512682", "0.7508594", "0.75006825", "0.75006825", "0.74975103", "0.7495789", "0.74864566", "0.7471351", "0.7463764", "0.74628377", "0.74624807", "0.7459153", "0.7455037", "0.7442174", "0.74415547", "0.7439754", "0.74299836", "0.7428121", "0.7428083", "0.742746", "0.74266315", "0.74266315", "0.74266315", "0.74266315", "0.74266315", "0.74266315", "0.74266315", "0.74266315", "0.74266315", "0.74266315", "0.74248266", "0.7421944", "0.7412773", "0.7407484", "0.740301", "0.7402189", "0.74016833", "0.73998153", "0.73998153", "0.73998153", "0.73998153", "0.7397417", "0.7397417", "0.73965526", "0.73958814", "0.73912024", "0.738856", "0.73810565", "0.7380982", "0.73800606", "0.73769146", "0.7373511", "0.73663634", "0.73663634", "0.73663634", "0.7365719", "0.7363129", "0.73609143", "0.73595256", "0.73595256", "0.73595256", "0.73577666", "0.7357052", "0.7357052", "0.7357052", "0.7357052", "0.7357052", "0.7357052", "0.7357052", "0.7357052" ]
0.0
-1
Return the number of elements in this set.
public int size() { return elements.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int size() {\n \tint currentSize = 0;\n \t\n \tIterator<E> iterateSet = this.iterator();\n \t\n \t// calculates number of elements in this set\n \twhile(iterateSet.hasNext()) {\n \t\titerateSet.next();\n \t\tcurrentSize++;\t\t\n \t}\n \t\n \treturn currentSize;\n \t\n }", "public static int numElements() {\n return values().length;\n }", "public int size() {\n return set.size();\n }", "public int size() {\n\t\treturn set.size();\n\t}", "public final int size() {\n int size = 0;\n final Iterator iterator = this.iterator();\n while (iterator.hasNext()) {\n size++;\n iterator.next();\n }\n return size;\n }", "public int size() {\r\n\t\treturn set.size();\r\n\t}", "public int size() {\n\t\tint result = 0;\n\t\tfor (E val: this)\n\t\t\tresult++;\n\t\treturn result;\n\t}", "public int size() {\n\t\t// DO NOT CHANGE THIS METHOD\n\t\treturn numElements;\n\t}", "public int size() {\n\t\treturn this.elements.size();\n\t}", "public int size() {\n\t\treturn elements.size();\n\t}", "public int size() {\r\n\t\treturn elements.size();\r\n\t}", "public int getNumOfElements() {\n return numOfElements;\n }", "public int size() {\n return numOfElements;\n }", "public int size() {\r\n\t\treturn elements;\r\n\t}", "public int size() {\n\t\treturn elements;\n\t}", "public int size()\n\t{\n\t\treturn m_elements.size();\n\t}", "@Override\n public int size() {\n return theSet.size();\n }", "public int size() {\n\t\tint numElements = 0;\n\t\tfor (int i = 0; i < this.size; i++) {\n\t\t\tif (list[i] != null) {\n\t\t\t\tnumElements++;\n\t\t\t}\n\t\t}\n\t\treturn numElements;\n\t}", "@Override\r\n\tpublic int size() {\n\t\treturn set.size();\r\n\t}", "public int size() {\n return elements.size();\n }", "public int size() {\n return elements;\n }", "public int size() {\r\n assert numElements >= 0 : numElements;\r\n assert numElements <= capacity : numElements;\r\n assert numElements >= elementsByFitness.size() : numElements;\r\n return numElements;\r\n }", "public int getNrOfElements() {\n return this.nrOfElements;\n }", "@Override\n\tpublic int size() {\n\t\treturn util.iterator.IteratorUtilities.size(iterator());\n\t}", "public int getNumElements()\n {\n return numElements;\n }", "public int getNumElements() {\n return theMap.size();\n }", "public int getNumElements() {\n\t\treturn numElements;\n\t}", "public int getNumElements() {\n return numElements;\n }", "public int getNumElements() {\n return numElements;\n }", "public int getNumberOfElements();", "@Override\n\tpublic int size() {\n\t\treturn this.numberOfElements;\n\t}", "public int size() {\n return pointsSet.size();\n }", "public int size(){\n\t\tListUtilities start = this.returnToStart();\n\t\tint count = 1;\n\t\twhile(start.nextNum != null){\n\t\t\tcount++;\n\t\t\tstart = start.nextNum;\n\t\t}\n\t\treturn count;\n\t}", "public int size() {\r\n int temp = 0;\r\n for (int i = 0; i < elem.length; i++) {\r\n if (elem[i] != null) {\r\n temp++;\r\n }\r\n }\r\n return temp;\r\n }", "public int size() {\n //encapsulate\n int size = this.array.length;\n return size;\n }", "Long getNumberOfElement();", "public int size() {\n return pointSet.size();\n }", "public int size(){\n return set.length;\n }", "public int size() \r\n\t{\r\n\t\treturn getCounter();\r\n\t}", "public abstract Integer getNumberOfElements();", "public int size() {\n // DO NOT MODIFY THIS METHOD!\n return size;\n }", "public int size() {\n\t\tint count = 0;\n\t\tfor (int i = 0;i < contains.length;i++) {\n\t\t\tif (contains[i]) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public int size()\r\n\t{\r\n\t\treturn count;\r\n\t}", "public int getUnitCount() {\n return _elements.length;\n }", "public int size() {\n\t\treturn count;\n\t}", "public int size() {\n\t\treturn count;\n\t}", "public int size() {\n\t\treturn count;\n\t}", "public int size() {\n\t\tTree<K, V> t = this;\n\t\tint size = 1;\n\t\treturn size(t, size);\n\t}", "public int getSize() {\n\t\treturn numElements;\n\t}", "public final int size()\n {\n return m_count;\n }", "public int size() {\n // DO NOT MODIFY!\n return size;\n }", "public int size() {\n\t\treturn collection.size();\n\t}", "public int size()\r\n {\r\n return count;\r\n }", "public int size() {\n return count;\n }", "public static int size() \r\n\t{\r\n\t\treturn m_count;\r\n }", "public int size() {\n return this.wellsets.size();\n }", "public int size() {\n int counter = 1;\n Lista iter = new Lista(this);\n while (iter.next != null) {\n iter = iter.next;\n counter += 1;\n }\n return counter;\n }", "public int size() {\n return collection.size();\n }", "public int size() {\r\n int count = 0;\r\n for (int i = 0; i < SIZE; i++) {\r\n if (tree[i] != null) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n }", "public int size() {\n int size = 0;\n for (Collection<V> value : map.values()) {\n size += value.size();\n }\n return size;\n }", "public int size() {\n return this.collection.size();\n }", "public int count() {\n return Query.count(iterable);\n }", "public int size()\n {\n return count;\n }", "public int getLength() {\n return collection.size();\n }", "public final int size() {\r\n return sequentialSize(root);\r\n }", "public int size() {\r\n if (NumItems > Integer.MAX_VALUE) {\r\n return Integer.MAX_VALUE;\r\n }\r\n return NumItems;\r\n }", "public int size() {\n return doSize();\n }", "public int size()\n\t{\n\t\tint count = 0;\n\t\tif(this.isEmpty())\n\t\t\treturn count;\n\t\telse\n\t\t{\n\t\t\t// Loop through and count the number of nodes.\n\t\t\tNode<T> curr = head;\t\n\t\t\twhile(curr != null)\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t\tcurr = curr.getNext();\n\t\t\t}\n\t\t\treturn count;\n\t\t}\n\t}", "public int size() {\n int count = terminal ? 1 : 0;\n for (Set<String> child : children)\n if (child != null) count += child.size();\n return count;\n }", "public int size() {\n\t\treturn numEntries;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n return this.values.length;\n }", "public int size() {\n return itemsets.size();\n }", "@Override\n\tpublic int size() {\n\t\tint nr = 0;\n\t\tfor (int i = 0; i < nrb; i++) {\n\t\t\t// pentru fiecare bucket numar in lista asociata acestuia numarul de\n\t\t\t// elemente pe care le detine si le insumez\n\t\t\tfor (int j = 0; j < b.get(i).getEntries().size(); j++) {\n\t\t\t\tnr++;\n\t\t\t}\n\t\t}\n\t\treturn nr;// numaru total de elemente\n\t}", "public final int count() {\n\t\tCountFunction function = new CountFunction();\n\t\teach(function);\n\t\treturn function.getCount();\n\t}", "public int size()\r\n\t{\r\n\t\treturn this.size;\r\n\t}", "public int size() {\n return size(root);\n }", "public int size() {\n return size(root);\n }", "public int size() {\n return values.size();\n }", "public int size() {\n\t\treturn this.elts.length;\n\t}", "public final int size() {\r\n\t\treturn this.size;\r\n\t}", "public int size() {\r\n return N;\r\n }", "public int size() {\r\n // TODO\r\n return 0;\r\n }", "@Override\r\n\tpublic int size() {\r\n\t\treturn keySet().size();\r\n\t}", "public int size() {\n maintain();\n return collection.size();\n }", "public synchronized int size() {\n return count;\n }", "public int size() {\n synchronized (this.base) {\n return this.base.size();\n }\n }", "public int size() {\n\t\treturn size(root);\n\t}", "public int size() {\n\t\treturn size(root);\n\t}", "@Override\n public int size() {\n int count = 0;\n for (Counter c : map.values())\n count += c.value();\n return count;\n }", "public int size() {\n // TODO: Implement this method\n return size;\n }", "public int cardinality() {\n\t\treturn numElements; // dummy return\n\t}", "public int size()\n\t{\n\t\tint size = 0;\n\t\t\n\t\tfor (LinkedList<Entry> list : entries)\n\t\t\tsize += (list == null) ? 0 : list.size();\n\t\t\n\t\treturn size;\n\t}", "public int size()\n\t\t{\n\t\treturn N;\n\t\t}", "public int size() {\n\t\t// TODO\n\t\treturn size(root);\n\t}", "public int size() {\r\n\t\treturn q.size();\r\n\t}" ]
[ "0.8449712", "0.80771506", "0.8041713", "0.80383205", "0.8033485", "0.8031555", "0.8026929", "0.79232", "0.7856659", "0.78176403", "0.78111684", "0.7795271", "0.77854156", "0.77696896", "0.77526414", "0.7746857", "0.7738311", "0.7688831", "0.766553", "0.7658385", "0.7657563", "0.7654677", "0.7654286", "0.7649719", "0.75875795", "0.75652546", "0.75525224", "0.7552137", "0.7552137", "0.7506816", "0.74959826", "0.7444502", "0.7433303", "0.7420084", "0.7418532", "0.7417259", "0.73996526", "0.73918736", "0.73895204", "0.7387043", "0.73858696", "0.73662263", "0.73544437", "0.73539084", "0.7343881", "0.7343881", "0.7343881", "0.7338186", "0.7333993", "0.7331492", "0.7326124", "0.73088473", "0.73016745", "0.7271488", "0.72601545", "0.72557265", "0.725193", "0.7245598", "0.7229627", "0.7228313", "0.72045773", "0.71880454", "0.7179101", "0.71733284", "0.7170642", "0.7163116", "0.71612597", "0.71546966", "0.71487576", "0.7146769", "0.71461535", "0.71461535", "0.71461535", "0.71461535", "0.71461535", "0.71440536", "0.7137282", "0.7136302", "0.7121469", "0.711068", "0.7107199", "0.7107199", "0.7103306", "0.71002465", "0.7092364", "0.7089292", "0.7088845", "0.708869", "0.7086142", "0.708377", "0.7083177", "0.7081205", "0.7081205", "0.70741695", "0.706679", "0.7063558", "0.70546514", "0.704855", "0.7043381", "0.703847" ]
0.7872121
8
Return true if this set contains the given Object
public boolean contains(Object o) { Object value = elements.get(o); return value != null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean contains(Object o) {\n\t\treturn set.contains(o);\r\n\t}", "public boolean contains(Object o);", "public boolean contains(Object o);", "public boolean contains(T obj) {\r\n\t\tlogger.trace(\"Enter contains\");\r\n\t\tlogger.trace(\"Exit contains\");\r\n\t\treturn data.contains(obj);\r\n\t}", "boolean contains(Object o);", "boolean contains(Object o);", "boolean contains(Object o);", "public boolean containsObject(T obj);", "public boolean containsObject(T obj);", "public boolean evaluate(T obj) {\n\t\treturn set.contains(obj);\n\t}", "@Override\n public boolean contains(Object object) {\n T value = (T) object;\n boolean result = false;\n for (int index = 0; index < this.values.length; index++) {\n T data = (T) this.values[index];\n if (data != null) {\n if (value.equals(data)) {\n result = true;\n }\n }\n }\n\n return result;\n }", "public boolean contains(E obj){\n\t\tif (obj == null)\n\t\t\tthrow new IllegalArgumentException(\"The given item is null.\");\n\t\tfor(E val : this) {\n\t\t\tif(val.equals(obj))\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\t\tpublic boolean contains(Object o) {\n\t\t\treturn false;\n\t\t}", "public boolean contains(Object elem);", "@Override\n\tpublic boolean contains(Object o) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean contains(Object o) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean contains(Object o) {\n\t\treturn false;\n\t}", "@Override\n public boolean contains(Object o) {\n return map.containsKey(o);\n }", "public boolean contains(Object o) {\r\n return this.map.containsKey(o.hashCode());\r\n }", "@Override\n public boolean contains(Object o) {\n return theMap.keySet().contains(o);\n }", "public boolean contains(Object o) {\n\t\treturn map.containsKey(o);\n\t}", "boolean\tcontains(Object o);", "public boolean contains( T obj )\n {\n if(nodes.containsKey(obj)){\n \treturn true;\n }\n return false;\n }", "@Override\n\tpublic boolean contains(T obj) {\n\t\tif (cache.contains(obj))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "boolean contains(T o);", "public abstract boolean contains(Object item);", "public boolean contains(E obj)\n {\n Node m = head;\n while( m.getNext() != null)\n {\n m = m.getNext();\n if(m.getValue().equals(obj))\n {\n return true; \n }\n }\n return false;\n }", "@Override\n @SuppressWarnings(\"unchecked\")\n public boolean contains(Object o) {\n return search((E) o) != null;\n }", "public boolean contains(T obj) {\r\n return lastIndexOf(obj) != -1;\r\n }", "public boolean contains(Object value) {\n\t\treturn false;\n\t}", "@Override\n public boolean contains(T object) {\n for (int i = 0; i < this.size; i++) {\n if (array[i].equals(object)) {\n return true;\n }\n }\n return false;\n }", "public boolean contains(WModelObject object)\n\t{\n\t\treturn m_elements.contains(object);\n\t}", "@Override\n public boolean contains(Object o) {\n return indexOf(o) >= 0;\n }", "@Override\n public boolean contains(Object o) {\n return indexOf(o) >= 0;\n }", "@Override\n public boolean contains(Object o) {\n return contains(root, o);\n }", "public boolean contains(E value);", "public boolean containsObject(AdvObject obj) {\n\t\treturn objects.contains(obj); // Replace with your code\n\t}", "boolean contains();", "public abstract boolean contains(E e);", "public boolean contains(Object o) {\r\n return indexOf(o) != -1;\r\n }", "public boolean contains(T instance);", "@Override\n public boolean contains(T o) {\n if(o == null) return false;\n int hcode = hash(o);\n hcode %= array.length;\n\n if(array[hcode].empty()) return false;\n array[hcode].reset();\n while (!array[hcode].endpos()) {\n if (eqals(o, array[hcode].elem())) {\n return true;\n } else array[hcode].advance();\n }\n return false;\n }", "@Override\n public final boolean contains(final Object o) {\n return Collections.exists(getComponents(),\n new Assertion<PriorityList<? extends _PriorityElement_>>() {\n public boolean isTrueFor(PriorityList<? extends _PriorityElement_> s) {\n return s.contains(o);\n }\n });\n }", "@Override\n public boolean contains(Object o) {\n if (indexOf(o) == -1) {\n return false;\n } else {\n return true;\n }\n }", "public boolean contains (T target);", "public boolean contains (T target);", "public boolean contains(T target);", "public boolean contains (Object obj) {\n\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n\t\t\tif (obj.equals (p.myItem)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains (Object obj) {\n\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n\t\t\tif (obj.equals (p.myItem)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains (Object obj) {\n\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n\t\t\tif (obj.equals (p.myItem)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains (Object obj) {\n\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n\t\t\tif (obj.equals (p.myItem)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains(T val);", "public boolean contains(T item) {\n synchronized(this) {\n return _treeSet.contains(item);\n }\n }", "public synchronized boolean contains(\n Object oObject)\n {\n if (oObject == null || !this.m_GenericClass.isInstance(oObject))\n {\n return false;\n }\n\n // Assert: object != null && object instanceOf E\n E element = this.m_GenericClass.cast(oObject);\n\n return findNode(element).m_NodePointer != null;\n }", "public boolean contains(Object object){\n\t\tQueue queue = new Queue();\n\t\t\n\t\tqueue.enqueue(this);\n\t\t\n\t\twhile(!queue.isEmpty()){\n\t\t\tBinaryTree tree = (BinaryTree) queue.dequeue();\n\t\t\t\n\t\t\tif((object).equals(tree.getElement())){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tif(!tree.isLeaf()){\n\t\t\t\tif(!tree.leftTree().isEmpty())\n\t\t\t\t\tqueue.enqueue(tree.left);\n\t\t\t\tif(!tree.rightTree().isEmpty())\n\t\t\t\t\tqueue.enqueue(tree.right);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean contains(E e) {\n\t\treturn false;\n\t}", "@Override\n public boolean contains(Object o) {\n for (int i = 0; i < currentSize; i++) {\n if (container[i] == o) {\n return true;\n }\n }\n return false;\n }", "public boolean contains(Object value)\r\n {\r\n return contains(root, value);\r\n }", "@Override\r\n\tpublic boolean containsValue(Object value) {\r\n\t\tif (value == null) throw new NullPointerException();\r\n\t\tfor (K key : keySet()) {\r\n\t\t\tif (get(key).equals(value)) return true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean contains(Object o) {\n for(int i = 0; i < size; i++) {\n if(list[i].equals(o)) return true;\n }\n return false;\n }", "public boolean contains ( Object o ){\n\n \tboolean doesContain = false;\n\n \tfor(int i = 0; i < list.size(); i++){\n\n if(list.get(i).equals(o)){\n doesContain = true;\n }\n\n }\n\n \treturn doesContain;\n\n }", "@Override\n\tpublic boolean contains(Object o) {\n\t\tNode tempRoot = root;\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tE e = (E) o;\n\t\treturn helper(e,tempRoot);\n\t}", "public boolean contains(Object arg0) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean contains(Object entity) {\n\t\treturn false;\n\t}", "public boolean contains(T element);", "public boolean contains(E item) {\n \t\n \tif(item == null) {\n \t\tthrow new IllegalArgumentException(\"Invalid parameter!\");\n \t}\n \t\n \t// create iterator instance to go thru set\n \tIterator<E> iterateSet = this.iterator(); \t\n \twhile(iterateSet.hasNext()) {\n \t\t// searches for a target item\n \t\tif( iterateSet.next().equals(item)) {\n \t\t\treturn true;\n \t\t}\n \t}\n \t\n \treturn false;\n }", "public boolean contains(E element);", "public boolean contains(Object o) {\n if (o instanceof String) {\n return set.contains(((String) o).toLowerCase());\n } else {\n return set.contains(o);\n }\n }", "@Override\n\tpublic boolean contains(Object value) {\n\t\tif (indexOf(value) != -1) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "@Override\n public boolean contains(T item) {\n Node n = first;\n //walk through the linked list untill you reach the end\n while(n != null) {\n //see if the item exists in the set, if it does return true\n if(n.value.equals(item))\n return true;\n //move to the next node\n n = n.next;\n }\n //if not found return false\n return false;\n }", "public boolean contains(Object obj) {\n\t\tLinkedListNode<T> temp = head.getNext();\n\t\t\n\t\t// Look at each node\n\t\twhile(temp != tail) {\n\t\t\t// Check to see if the node's data is the same as the object\n\t\t\tif(temp.getData().equals(obj)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\t\n\t\t// If it wasn't found\n\t\treturn false;\n\t}", "public boolean contains(T entry) {\n return false;\n }", "@Override\r\n public boolean contains(E target) {\r\n if(find(target) != null) return true;\r\n return false;\r\n }", "boolean hasObject();", "boolean hasObject();", "boolean hasObject();", "boolean hasObject();", "boolean hasObject();", "boolean hasObject();", "boolean hasObject();", "boolean hasContains();", "@Override\n public boolean contains(Object item) {\n if (item == null)\n return false;\n return map.containsKey(item);\n }", "@Override public boolean equals(Object o) {\n if (this == o) { return true; }\n if ( !(o instanceof Set) ) { return false; }\n Set that = (Set) o;\n return that.size() == inner.size() &&\n containsAll(that);\n }", "boolean containsValue(Object value);", "@Override public boolean equals(Object object);", "public boolean doesContain(T t) {\n if (Arrays.asList(a).contains(t)) {\n return true;\n } else {\n return false;\n }\n }", "@Override\n\tpublic boolean contains(Type t) {\n\t\treturn true;\n\t}", "public boolean contains(K key);", "@Override\n public boolean contains(T item) {\n return itemMap.containsKey(item);\n }", "public boolean contains(Object o) {\n\t\tNode p;\n\t\tint k;\n\n\t\tif (o != null) {\n\t\t\tfor (k = 0, p = mHead.next; k < mSize; p = p.next, k++)\n\t\t\t\tif (o.equals(p.data))\n\t\t\t\t\treturn true;\n\t\t} else {\n\t\t\tfor (k = 0, p = mHead.next; k < mSize; p = p.next, k++)\n\t\t\t\tif (p.data == null)\n\t\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean contains(T data)\r\n {\r\n if(containsData.contains(data) == true) //Checking my hashset of data to see if our data has been inserted!\r\n return true;\r\n \r\n return false;//If we didnt find the node within our list, return false. \r\n }", "public boolean contains(OpenERPRecord o) {\r\n\t\treturn this.records.contains(o);\r\n\t}", "public boolean contains(Key key);", "public boolean contains(E item){\n\t\treturn (find(item) != null) ? true : false;\n\t}", "public boolean contains(E e){\n int target = e.hashCode() % this.buckets;\n return data[target].contains(e);\n }", "public boolean contains(Object o) {\n\t\tNode<E> check = head;\r\n\t\twhile(check.getNext() != null) {\r\n\t\t\tif(check.getData().equals((E)o))\r\n\t\t\t\treturn true;\r\n\t\t\tcheck = check.getNext();\r\n\t\t}\r\n\t\treturn tail.getData().equals(o);\r\n\t}", "boolean contains(T element);", "public boolean contains(Object element) {\n\n\t\tif (element == null) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"ArrayList cannot contain a null element.\");\n\t\t}\n\t\tfor (int i = 0; i < this.size; i++) {\n\t\t\tObject object = this.storedObjects[i];\n\t\t\tif (object.equals(element)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean contains(E element) {\r\n return items.contains(element);\r\n }", "@Override\r\n\t\tpublic boolean contains(E value) {\n\t\t\treturn value == null;\r\n\t\t}" ]
[ "0.85820484", "0.8231542", "0.8231542", "0.80120593", "0.7924936", "0.7924936", "0.7924936", "0.78990346", "0.78990346", "0.78719485", "0.7835848", "0.7773034", "0.76926386", "0.76742375", "0.76650685", "0.76650685", "0.76650685", "0.75830984", "0.7560869", "0.7520326", "0.751107", "0.7470832", "0.7457085", "0.7443941", "0.74351484", "0.740601", "0.73368543", "0.7335403", "0.73350406", "0.73320717", "0.73253036", "0.7266435", "0.72630763", "0.72630763", "0.7260722", "0.72271776", "0.7188291", "0.7166396", "0.7151629", "0.711694", "0.71115285", "0.7105274", "0.7101005", "0.71003914", "0.70902354", "0.70902354", "0.7082633", "0.7042272", "0.7042272", "0.7042272", "0.70410603", "0.7003057", "0.7000788", "0.69717133", "0.69669074", "0.6945318", "0.69357014", "0.69275016", "0.691655", "0.69157887", "0.68968016", "0.6891101", "0.68791807", "0.68658197", "0.68575925", "0.6847357", "0.68344826", "0.68094933", "0.6800243", "0.67919296", "0.6789384", "0.67783177", "0.6740567", "0.6730745", "0.6730745", "0.6730745", "0.6730745", "0.6730745", "0.6730745", "0.6730745", "0.6724134", "0.67137146", "0.67043054", "0.66994023", "0.66900325", "0.6686776", "0.6677672", "0.6675679", "0.6667244", "0.66662854", "0.66645265", "0.6655805", "0.6652988", "0.66482466", "0.6640776", "0.6640674", "0.66388243", "0.6631853", "0.6625782", "0.66255134" ]
0.7123745
39
Return true if this set contains all elements in the given Collection
public boolean containsAll(Collection coll) { return elements.keySet().containsAll(coll); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean containsAll(Collection<?> c) {\n\t\treturn set.containsAll(c);\r\n\t}", "@Override\n public boolean containsAll(final Collection<?> collection) {\n this.checkCollectionNotNull(collection);\n final Iterator<?> iterator = collection.iterator();\n\n while (iterator.hasNext()) {\n if (!this.contains(iterator.next())) {\n return false;\n }\n }\n\n return true;\n }", "boolean containsAll(Collection<?> c);", "public boolean containsAll(Collection c) {\r\n Enumeration e = c.elements();\r\n while (e.hasMoreElements())\r\n if(!contains(e.nextElement()))\r\n return false;\r\n\r\n return true;\r\n }", "public boolean containsAll(/*@ non_null @*/ java.util.Collection<E> c) {\n java.util.Iterator<E> celems = c.iterator();\n while (celems.hasNext()) {\n E o = celems.next();\n if (!has(o)) {\n return false;\n }\n }\n return true;\n }", "public boolean containsAll(Collection<?> c) {\n\t\tif(c.size() > size) return false;\r\n\t\tfor(Object e : c) {\r\n\t\t\tif(!contains(e))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean containsAll(Collection<?> c) {\n Object[] newArray = c.toArray();\n int check = 0;\n for (int i = 0; i < newArray.length; i++) {\n if (contains(newArray[i]))\n check++;\n }\n if(check == newArray.length) {\n return true;\n }\n return false;\n }", "public boolean containsAll(Collection<? extends Type> items);", "public boolean containsAll(Collection<?> c) {\n\t\tfor (Object o : c)\n\t\t\tif (!contains(o))\n\t\t\t\treturn false;\n\t\treturn true;\n\t}", "public boolean containsAll(Collection<?> arg0) {\n\t\treturn false;\n\t}", "public boolean containsAll(Collection<? extends T> items) {\n\n\t\tIterator<? extends T> itr = items.iterator();\n\n\t\twhile (itr.hasNext()) {\n\t\t\tif (!this.contains(itr.next())) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean containsAll(Collection<?> c) {\n\t\tthrow new NotImplementedException(\"Not yet implemented\"); \n\t}", "public boolean containsAll(Collection keys) {\r\n\r\n\t\treturn data.containsAll(keys);\r\n\t}", "@Override\n public boolean containsAll(Collection<?> c) {\n for (Object o : c) {\n if (!contains(o)) {\n return false;\n }\n }\n return true;\n }", "@Override\n\tpublic boolean containsAll(Collection<?> c) {\n\t\tboolean res = true;\n\n\t\tif (c instanceof ConjuntoEnteros) {\n\t\t\tif (((ConjuntoEnteros) c).getInf() != getInf()\n\t\t\t\t\t|| ((ConjuntoEnteros) c).getSup() != getSup())\n\t\t\t\tthrow new IllegalArgumentException();\n\n\t\t\tConjuntoEnteros caux = new ConjuntoEnteros(inf, sup);\n\t\t\tcaux.addAll((ConjuntoEnteros) c);\n\t\t\t((ConjuntoEnteros) caux).getConjunto().andNot(this.getConjunto());\n\t\t\t// RemoveAll en c de los elementos de this\n\t\t\tres = caux.size() == 0;\n\t\t\t// Otra opcion hacer la interseccion de c y this\n\t\t} else {\n\t\t\tfor (Object i : c) {\n\t\t\t\tres = contains(i) && res;\n\t\t\t\tif (!res)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "@Override\n\t\tpublic boolean containsAll(Collection<?> c) {\n\t\t\treturn false;\n\t\t}", "@Override\n\tpublic boolean containsAll(Collection<?> c) {\n\t\treturn false;\n\t}", "public boolean containsAll(ISet<E> otherSet) {\n\t\tif (otherSet == null)\n\t\t\tthrow new IllegalArgumentException(\"The given set it null.\");\n\t\tfor (E obj: otherSet) {\n\t\t\tif (!this.contains(obj))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "boolean hasAll();", "boolean hasAll();", "@Test\n public void testContainsAll_Contains() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "public boolean retainAll (Collection<?> collection) {\r\n\t\tboolean result = _list.retainAll (collection);\r\n\t\tHeapSet.heapify (this);\r\n\t\treturn result;\r\n\t}", "@Override public boolean equals(Object o) {\n if (this == o) { return true; }\n if ( !(o instanceof Set) ) { return false; }\n Set that = (Set) o;\n return that.size() == inner.size() &&\n containsAll(that);\n }", "@Override\r\n\tpublic boolean retainAll(Collection<?> c) {\n\t\treturn set.retainAll(c);\r\n\t}", "public boolean retainAll(Collection arg0) {\r\n\r\n\t\treturn data.retainAll(arg0);\r\n\t}", "public boolean containsAll(ISet<E> otherSet) {\n \tif(otherSet == null) {\n \t\tthrow new IllegalArgumentException(\"Invalid parameter!\");\n \t}\n \t\n \tIterator<E> otherIterateSet = otherSet.iterator();\n \t\n \twhile(otherIterateSet.hasNext()) {\n \t\tE item1 = otherIterateSet.next();\n \t\tboolean foundMatch = false;\n \t\t\n \t\t// searches this set for target element\n \t\tif(this.contains(item1)) {\n \t\t\tfoundMatch = true;\n \t\t}\n \t\t\n \t\t// if the current element was not found at all\n \t\tif(foundMatch == false)\n \t\t\treturn false;\n \t}\n \treturn true;\n }", "public static <T> ContainsAllSpecification<T> containsAll( Property<? extends Collection<T>> collectionProperty,\n Iterable<T> values )\n {\n NullArgumentException.validateNotNull( \"Values\", values );\n return new ContainsAllSpecification<>( property( collectionProperty ), values );\n }", "boolean retainAll(Collection<?> c);", "@Override\r\n\tpublic boolean containsAll(Collection<?> c)\r\n\t{\n\t\tthrow new UnsupportedOperationException(\"Series collection doesn't support this operation.\");\r\n\t}", "public boolean hasAll() {\n return all_ != null;\n }", "public boolean hasAll() {\n return all_ != null;\n }", "@Override // java.util.Collection, java.util.Set\r\n public boolean addAll(Collection<? extends E> collection) {\r\n b(this.f513d + collection.size());\r\n boolean added = false;\r\n Iterator<? extends E> it = collection.iterator();\r\n while (it.hasNext()) {\r\n added |= add(it.next());\r\n }\r\n return added;\r\n }", "boolean any(String collection);", "public static final boolean collectionContainsAny(\n Collection collection,\n Object[] array)\n {\n for (int i = 0, max = array.length; i < max; i++)\n {\n if (collection.contains(array[i]))\n return true;\n }\n return false;\n }", "@Override\n public boolean addAll(Collection<? extends E> c) {\n boolean result = true;\n for (E current : c) {\n result &= add(current);\n }\n return result;\n }", "@Override\n public boolean addAll(final Collection<? extends T> collection) {\n this.checkCollectionNotNull(collection);\n final Iterator<? extends T> iterator = collection.iterator();\n\n while (iterator.hasNext()) {\n this.add(iterator.next());\n }\n\n return collection.size() != 0;\n }", "public boolean addAll(Collection collection) {\n for (Iterator iterator = collection.iterator(); iterator.hasNext(); ) {\n this.add(iterator.next());\n }\n return true;\n }", "public boolean containsAll(OpenERPRecordSet c) {\r\n\t\tboolean allOK = true;\r\n\t\tIterator<OpenERPRecord> i = c.iterator();\r\n\t\twhile (i.hasNext()) {\r\n\t\t\tOpenERPRecord o = i.next();\r\n\t\t\tallOK = this.contains(o) && allOK;\r\n\t\t}\r\n\t\treturn allOK;\r\n\t}", "@Override\n public boolean containsAll(MyList c) {\n Object[] array = c.toArray();\n for (Object anArray : array) {\n if (!this.contains(anArray)) {\n return false;\n }\n }\n return true;\n }", "@Override\n\tpublic boolean containsAll(Collection<?> c) {\n\t\tthrow new UnsupportedOperationException();\n\t}", "@Test\n public void testContainsAll_Not_Contain() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n\n Collection c = Arrays.asList(1, 2, 5);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "public boolean retainAll(Collection<?> c) {\n\t\tif(c.isEmpty()) {\r\n\t\t\tclear();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tboolean flag = containsAll(c);\r\n\t\tfor(int i = 0; i < size; i++) {\r\n\t\t\tif(!c.contains(get(i)))\r\n\t\t\t\tremove(i--);\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "public static <T> boolean addAll(Collection<T> addTo, Iterator<? extends T> iterator){\n Preconditions.checkNotNull(addTo);\n Preconditions.checkNotNull(iterator);\n boolean wasModified = false;\n while(!iterator.hasNext()){\n wasModified |= addTo.add(iterator.next());\n }\n return wasModified;\n }", "boolean hasContains();", "public boolean addAll(ISet<E> otherSet) {\n\t\tif (otherSet == null)\n\t\t\tthrow new IllegalArgumentException(\"The given set is null.\");\n\t\tboolean result = false;\n\t\tfor (E obj: otherSet) {\n\t\t\tif (!this.contains(obj)) {\n\t\t\t\tthis.add(obj);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "boolean addAll(Collection<? extends E> c);", "public<T> boolean containsAny(final Collection<T> collection, final Filter<T> filter ){\n\t\tfor(T t:query.getOrEmpty(collection)){\n\t\t\tif(filter.applicable(t)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean removeAll(Collection<?> c);", "public boolean isEmpty( Collection<?> collection ){\n if( collection == null || collection.isEmpty() ){\n return true;\n }\n return false;\n }", "@Override\n public boolean retainAll(Collection<?> c) {\n Set<T> toRemove = new HashSet<>(elements);\n toRemove.removeAll(c);\n return removeAll(toRemove);\n }", "@Override\n public boolean retainAll(Collection<?> c) {\n boolean result = true;\n for (Object current : c) {\n if (!contains(current)) {\n result = false;\n }\n }\n for (E current : this) {\n if (!c.contains(current)) {\n result &= remove(current);\n }\n }\n return result;\n }", "@Test\n public void testContainsAll_Contains_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(3, 4, 5, 7);\n\n boolean expResult = true;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "public boolean addAll (Collection<? extends T> collection) {\r\n\t\tboolean result = _list.addAll (collection);\r\n\t\tHeapSet.heapify (this);\r\n\t\treturn result;\r\n\t}", "public boolean addAll(Collection<? extends E> c) {\n\t\tfor(Iterator<? extends E> it = c.iterator(); it.hasNext();)\r\n\t\t\tadd((E)it.next());\r\n\t\treturn !c.isEmpty();\r\n\t}", "@CanIgnoreReturnValue\n public static <T> boolean addAll(Collection<T> collection, Iterator<? extends T> it) {\n Preconditions.checkNotNull(collection);\n Preconditions.checkNotNull(it);\n boolean z = false;\n while (it.hasNext()) {\n z |= collection.add(it.next());\n }\n return z;\n }", "boolean contains();", "public boolean hasAll() {\n return allBuilder_ != null || all_ != null;\n }", "public boolean hasAll() {\n return allBuilder_ != null || all_ != null;\n }", "@Override\n\tpublic boolean addAll(Collection<? extends T> elements) {\n\t\tif ((elements == null) || (elements.size() == 0))\n\t\t\treturn false;\n\t\tboolean result = false;\n\t\tdouble prob = 1.0 / elements.size();\n\t\tfor (T item : elements) {\n\t\t\tresult = result | add(item, prob);\n\t\t}\n\t\treturn result;\n\t}", "public boolean removeAll(Collection<?> c) {\n Objects.requireNonNull(c);\n boolean modified = false;\n for (Iterator<K> i = iterator(); i.hasNext(); ) {\n if (c.contains(i.next())) {\n i.remove();\n modified = true;\n }\n }\n return modified;\n }", "@Override\r\n\tpublic boolean removeAll(Collection<?> c) {\n\t\treturn set.removeAll(c);\r\n\t}", "@Override\n public boolean removeAll(Collection<?> c) {\n boolean result = true;\n for (Object current : c) {\n result &= remove(current);\n }\n return result;\n }", "public boolean areAllAnswersCollect(){\n\t\tif(selectedA.isEmpty())\n\t\t\treturn false;\n\t\telse{\n\t\t\n\t\tfor(String Aanswer:selectedA){\n\t\t\tif(!(correctA.contains(Aanswer)))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn (selectedA.size() == correctA.size());\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic boolean equals(Object other) {\n\t\tif (!(other instanceof ISet<?>))\n\t\t\treturn false;\n\t\tif (((ISet<?>) other).size() != this.size())\n\t\t\treturn false;\n\t\tboolean check;\n\t\ttry {\n\t\t\tcheck = ((ISet<E>) other).containsAll(this) && this.containsAll((ISet<E>) other);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn check;\n\t}", "@Test\n public void testContainsAll_Not_Contain_Overflow() {\n\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(1);\n instance.add(4);\n instance.add(5);\n instance.add(4);\n instance.add(7);\n\n Collection c = Arrays.asList(1, 2, 5, 8);\n\n boolean expResult = false;\n boolean result = instance.containsAll(c);\n assertEquals(expResult, result);\n }", "public static <T> boolean m6262a(Collection<T> collection) {\n return collection == null || collection.isEmpty();\n }", "private boolean checksetunions(Set<String> set, HashMap<String, ArrayList<String>> c) {\n\t\tObject[] ckeys = c.keySet().toArray();\r\n\t\tfor (int i = 0; i < c.keySet().size(); i++) {\r\n\t\t\tif (c.get(ckeys[i]).containsAll(set)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "static boolean multiset_contains(Map m, Object o) {\n if (m == null) return false;\n for (Iterator i = m.values().iterator(); i.hasNext(); ) {\n Object p = i.next();\n if (p == o) return true;\n if (p instanceof Collection)\n if (((Collection) p).contains(o)) return true;\n }\n return false;\n }", "static public <T> boolean bagEquals(Collection<T> source, Collection<T> arg) {\n\t\t/* make copy of arguments in order to manipulate the collection*/\n\t\tif ( source.size() != arg.size() ) {\n\t\t\treturn false;\n\t\t}\n\t\tCollection<T> myArg = new ArrayList<T>( arg );\n\t\tfor ( T elem : source ) {\n\t\t\tif ( myArg.contains(elem) ) {\n\t\t\t\tmyArg.remove(elem);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn myArg.isEmpty();\n\t}", "public Boolean containsAny(Collection<Note> ns) {\n\t\tfor(Note n: ns) {\n\t\t\tif(this.contains(n)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean retainAll(final Collection<?> collection) {\n return this.removeCollection(collection, false);\n }", "@Override\r\n\tpublic boolean contains(Object o) {\n\t\treturn set.contains(o);\r\n\t}", "public boolean retainAll(Collection<?> arg0) {\n\t\treturn false;\n\t}", "public boolean hasNextInSet() {\n return (hasNext() &&\n (indexOfCurrentElement + 1 < firstIndexOfCurrentSet + quantity) &&\n (indexOfCurrentElement + 1 >= firstIndexOfCurrentSet)); \n }", "@Test\r\n public void containsAll() throws Exception {\r\n ArrayList<Integer> l = new ArrayList<>();\r\n l.add(2);\r\n l.add(3);\r\n assertTrue(sInt.containsAll(l));\r\n l.add(7);\r\n assertFalse(sInt.containsAll(l));\r\n }", "public static boolean isNotEmpty(Collection<?> collection) {\n return !isEmpty(collection);\n }", "public boolean addAll(Collection added)\n {\n boolean ret = super.addAll(added);\n normalize();\n return(ret);\n }", "public boolean removeAll(Collection<?> c) {\n Objects.requireNonNull(c);\n boolean modified = false;\n for (Iterator<Map.Entry<K,V>> i = iterator(); i.hasNext(); ) {\n if (c.contains(i.next())) {\n i.remove();\n modified = true;\n }\n }\n return modified;\n }", "@Test\n public void testAddAll_Collection() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(1, 2, 3);\n\n boolean expResult = true;\n boolean result = instance.addAll(c);\n assertEquals(expResult, result);\n\n }", "@Override\n\tpublic boolean addAll(Collection<? extends E> c) {\n\t\treturn false;\n\t}", "public static boolean isEqualSet(Collection set1, Collection set2) {\n/* 99 */ if (set1 == set2) {\n/* 100 */ return true;\n/* */ }\n/* 102 */ if (set1 == null || set2 == null || set1.size() != set2.size()) {\n/* 103 */ return false;\n/* */ }\n/* */ \n/* 106 */ return set1.containsAll(set2);\n/* */ }", "public boolean removeAll (Collection<?> collection) {\r\n\t\tboolean result = _list.removeAll (collection);\r\n\t\tHeapSet.heapify (this);\r\n\t\treturn result;\r\n\t}", "public boolean removeAll(Collection<? extends E> collection) {\n clear();\n // This is fucking dodgy lol.\n return true;\n }", "public boolean removeAll(Collection arg0) {\r\n\r\n\t\treturn data.removeAll(arg0);\r\n\t}", "public boolean removeAll(Collection<?> c) {\n\t\tfor(Iterator it = c.iterator(); it.hasNext();) {\r\n\t\t\tObject o = it.next();\r\n\t\t\tif(contains(o)) {\r\n\t\t\t\tremove(o);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean contains(SeqItemset set)\n\t{\n\t\tif (m_size<set.m_size) return false;\n\t\tint ind = 0;\n\t\tint i = 0;\n\t\twhile ((i<set.m_size) && (-1!=ind))\n\t\t{\n\t\t\tind = indexOf(set.elementIdAt(i));\n\t\t\ti++;\n\t\t}\n\t\tif (-1==ind) return false;\n\t\telse return true;\n\t}", "public boolean addAll(Collection<? extends Type> items);", "public<T> boolean containsOnly(final Collection<T> collection, final Filter<T> filter ){\t\t\n\t\tfor(T t:query.getOrEmpty(collection)){\n\t\t\tif(!filter.applicable(t)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static boolean equalsUnordered( Collection<?> collection1, Collection<?> collection2 )\r\n {\r\n //\r\n boolean retval = collection1.size() == collection2.size();\r\n \r\n //\r\n for ( Object iObject : collection1 )\r\n {\r\n retval &= collection2.contains( iObject );\r\n }\r\n \r\n //\r\n return retval;\r\n }", "@SuppressWarnings( {\"raw\", \"unchecked\"} )\n public static <T> ContainsAllSpecification<T> containsAllVariables(\n Property<? extends Collection<T>> collectionProperty,\n Iterable<Variable> variables )\n {\n NullArgumentException.validateNotNull( \"Variables\", variables );\n return new ContainsAllSpecification( property( collectionProperty ), variables );\n }", "public boolean isEmpty() {\n\t\tboolean empty = true;\n\t\tfor(int i = 0; i < contains.length && empty; i++) {\n\t\t\tif (contains[i]) {\n\t\t\t\tempty = false;\n\t\t\t}\n\t\t}\n\t\treturn empty;\n\t}", "public boolean addContainsAll(Collection<? extends T> arg0, double prob) {\n\t\tboolean val = false;\n\t\tfor (T t : arg0) {\n\t\t\tif (!contains(t))\n\t\t\t\tval |= add(t, prob);\n\t\t}\n\t\treturn val;\n\t}", "public static boolean isNotEmpty(final Collection<?> collection) {\n\n return !isEmpty(collection);\n }", "public boolean addAll(Collection<? extends Element> elements) {\n for (Element element : elements) {\n if (!add(element)) {\n return false;\n }\n }\n\n return true;\n }", "boolean hasMatchedElements();", "public boolean addAll(Iterable<T> c){\r\n\t\t//same addAll from HW2 denseboard\r\n\t\tboolean added = false;\r\n\t\tfor(T thing : c){\r\n\t\t\tadded |= this.add(thing);\r\n\t\t}\r\n\t\treturn added;\r\n\t}", "public static boolean isEmpty(Collection<?> collection) {\n return collection == null || collection.isEmpty();\n }", "@Override\n public boolean subset(SetI other) {\n if (count > other.size()) {\n return false;\n }\n\n for (Integer e : this) {\n // I have but other do not...\n if (!other.contains(e)) {\n return false;\n }\n }\n return true;\n }", "public boolean subset(ZYSet<ElementType> potentialSubset){\n for(ElementType e:potentialSubset){\n if(!this.contains(e)){\n return false;\n }\n }\n return true;\n }", "@Override\n\tpublic boolean retainAll(Collection<?> c) {\n\t\treturn false;\n\t}" ]
[ "0.831593", "0.8304394", "0.82719344", "0.7831122", "0.78011876", "0.77289784", "0.7673879", "0.766179", "0.7650303", "0.7646553", "0.756577", "0.7365343", "0.73405266", "0.73303115", "0.73233396", "0.73079175", "0.727438", "0.713501", "0.7027026", "0.7027026", "0.6972529", "0.69554365", "0.6950008", "0.69080687", "0.6903323", "0.6880562", "0.68790823", "0.6807605", "0.6801961", "0.67770565", "0.67770565", "0.67313325", "0.6710052", "0.6588063", "0.65846467", "0.65684724", "0.6567942", "0.6544839", "0.65104246", "0.65079254", "0.648386", "0.64668065", "0.6454665", "0.6438855", "0.6423475", "0.641643", "0.6413368", "0.6399525", "0.63984615", "0.63961935", "0.639549", "0.6392444", "0.63304836", "0.6330238", "0.6313892", "0.6245847", "0.62377846", "0.62377846", "0.6227413", "0.61823225", "0.6177241", "0.61632377", "0.61618346", "0.6155351", "0.61545897", "0.6127101", "0.6126512", "0.6124039", "0.6119658", "0.61162895", "0.6112612", "0.6108448", "0.6106602", "0.60916317", "0.60605836", "0.6039515", "0.60384405", "0.60277885", "0.6016256", "0.6002632", "0.5990287", "0.59764385", "0.5951555", "0.5949752", "0.5940936", "0.5937296", "0.59257495", "0.59098697", "0.5909672", "0.58956534", "0.5874016", "0.587016", "0.586865", "0.58572674", "0.58568186", "0.5850413", "0.58467335", "0.5845788", "0.58454543", "0.5843158" ]
0.8265085
3
Return an Enumeration of the elements in this set.
public Enumeration elements() { return elements.keys(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Enumeration elements() {\n\t\treturn new ValuesEnumeration(values);\n\t}", "public Enumeration elements() {\n return new MRUEnumeration(_hash.elements());\n }", "public Enumeration elements();", "public abstract Enumeration elements();", "public Enumeration<klasse> elements() {\n compress();\n EN = 0;\n return this;\n }", "public Enumeration elements()\n {\n return element.elements();\n }", "public synchronized Enumeration elements()\n\t{\n\t\treturn m_elements.elements();\n\t}", "public Enumeration getElements() {\r\n return elements.elements();\r\n }", "public Iterator iterator() {\n\n return new EnumerationIterator(elements.keys());\n }", "public Iterator<E> elementIterator() {\n return new EnumMultiset<E>.Itr<E>() {\n /* access modifiers changed from: package-private */\n public E output(int i) {\n return EnumMultiset.this.enumConstants[i];\n }\n };\n }", "public java.util.Enumeration elements () {\r\n methods = super.elements ();\r\n same_name_methods_index = 0;\r\n return this;\r\n }", "public BasicAttributesGrammarAccess.EnumerationElementElements getEnumerationElementAccess() {\n\t\treturn gaBasicAttributes.getEnumerationElementAccess();\n\t}", "public synchronized Enumeration<ServerDesc> elements() {\n return new Enumerator(VALUES);\n }", "public static java.util.Enumeration enumerate() {\n return _memberTable.elements();\n }", "@Override\n\tpublic Enumeration elements() {\n\t return Collections.enumeration(perms);\n\t}", "public Enumeration elements()\r\n/* 54: */ {\r\n/* 55:82 */ return this.pop.elements();\r\n/* 56: */ }", "public Enumeration components() {\n\t\treturn null;\n\t}", "@Override\n public synchronized Enumeration elements() {\n if ((System.currentTimeMillis() - this.lastCheck) > this.CACHE_TIME) {\n update();\n }\n return super.elements();\n }", "public List<Object> getEnum() {\n\t\treturn enumField;\n\t}", "public Enumeration elements()\n {\n return m_permissions.elements();\n }", "public abstract Enumeration keys();", "protected String getEnumeration()\n {\n return enumeration;\n }", "public Enumeration<Object> keys ();", "Enumeration createEnumeration();", "public HashSet getElements() {\n\treturn elements;\n }", "Enumeration getIds();", "public Enumeration getAttributes()\n {\n ensureLoaded();\n return m_tblAttribute.elements();\n }", "public static Enumeration<String> getKeys() {\n\t\tif (rb == null) {\n\t\t\treinit();\n\t\t}\n\n\t\treturn rb.getKeys();\n\t}", "public List<Enum<?>> enums()\n/* */ {\n/* 92 */ return Arrays.asList(this._values);\n/* */ }", "public List<VariableElement> getEnumConstants() {\n if (isEnum() == false) {\n throw new IllegalStateException();\n }\n TypeElement decl = (TypeElement) element;\n List<VariableElement> results = new ArrayList<>();\n for (Element member : decl.getEnclosedElements()) {\n if (isEnumConstant(member)) {\n results.add((VariableElement) member);\n }\n }\n return results;\n }", "public Iterator<Multiset.Entry<E>> entryIterator() {\n return new EnumMultiset<E>.Itr<Multiset.Entry<E>>() {\n /* access modifiers changed from: package-private */\n public Multiset.Entry<E> output(final int i) {\n return new Multisets.AbstractEntry<E>() {\n public E getElement() {\n return EnumMultiset.this.enumConstants[i];\n }\n\n public int getCount() {\n return EnumMultiset.this.counts[i];\n }\n };\n }\n };\n }", "@Override\n\tpublic Enumeration<String> getKeys() {\n\t\treturn null;\n\t}", "private static Enumeration getEmptyEnum() {\r\n return Collections.enumeration(Collections.EMPTY_LIST);\r\n }", "public Iterator getIterator() {\n return myElements.iterator();\n }", "public Enumeration edges();", "public ArrayList<Integer> getElements()\n {\n return this.elements;\n }", "@Override\r\n\t\t\t\t\t\tpublic Enumeration<String> getKeys() {\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}", "public static java.util.Enumeration enumeration(java.util.Collection arg0)\n { return null; }", "public synchronized Enumeration<Short> keys() {\n return new Enumerator(KEYS);\n }", "public static Enumeration getUseCounts() \n {\n return frequency.elements();\n }", "public Iterator iterator()\n {\n return new HashSetIterator();\n }", "public Integer[] enumProperty() {\n return null;\n }", "public Enumeration getImplements()\n {\n ensureLoaded();\n return m_tblInterface.keys();\n }", "public Enumeration vertices();", "public Iterator getTypes() {\r\n\t\treturn types == null ? EmptyStructures.EMPTY_ITERATOR : new ReadOnlyIterator(types.values());\r\n\t}", "public org.ccsds.moims.mo.mal.structures.Element createElement()\n {\n return _ENUMERATIONS[0];\n }", "public String getElement()\n {\n return \"enum\";\n }", "public static Enumeration getNames() \n {\n return frequency.keys();\n }", "E[] getCachedEnumValues();", "public Enumeration getFields()\n {\n ensureLoaded();\n return m_tblField.elements();\n }", "public Iterator<JacksonJrValue> elements() {\n return _values.iterator();\n }", "@Override\n public Set<T> asSet() {\n return new AbstractSet<T>() {\n @Override\n public Iterator<T> iterator() {\n return new Iterator<T>() {\n boolean foundNext;\n boolean hasNext;\n T next;\n \n private void findNext() {\n if (!foundNext) {\n hasNext = isPresent();\n if (hasNext) {\n try {\n next = get();\n } catch (NoSuchElementException e) {\n // in case there was a race and the value became absent\n hasNext = false;\n next = null;\n }\n } else {\n next = null;\n }\n foundNext = true;\n }\n }\n \n @Override\n public boolean hasNext() {\n findNext();\n return hasNext;\n }\n\n @Override\n public T next() {\n findNext();\n if (hasNext) {\n // no next after consuming the single present value \n hasNext = false;\n T ret = next;\n next = null;\n return ret;\n }\n throw new NoSuchElementException();\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException();\n }\n };\n }\n\n @Override\n public int size() {\n return isPresent() ? 1 : 0;\n }\n };\n }", "public Iterator<ArchiveEntry> getEnumerator ()\n\t{\n\t\treturn entries.values ().iterator ();\n\t}", "@Override\r\n\tpublic Vector<Integer> getTypes() {\n\t\treturn this.types;\r\n\t}", "public int elements() {\n\t\treturn elements;\n\n\t}", "public List<ImageStatisticsElementGroupElementImageState> getElements() {\n return unmodifiableList(elements);\n }", "public Iterator iterator() {\n\t return new EntryIterator(set.iterator());\n\t}", "public E output(int i) {\n return EnumMultiset.this.enumConstants[i];\n }", "public Enumeration getKeys() {\r\n PropertiesHolder propertiesHolder = this.getMergedProperties(Locale.getDefault());\r\n return propertiesHolder.getProperties().keys();\r\n }", "@Override\n public Iterator<Set<E>> iterator() {\n return new DisjointSetIterator(theSet);\n }", "public Set<E> getIn() {\n return in;\n }", "public Set getTypeSet()\n {\n Set set = new HashSet();\n\n Iterator it = attTypeList.keySet().iterator();\n while (it.hasNext())\n {\n // Get key\n Object attrName = it.next();\n Object type = attTypeList.get(attrName);\n set.add(type);\n }\n return set;\n }", "public Collection<V> values() {\n\t\treturn new ValueCollection();\n\t}", "public Iterator<E> iterator() {\n\t\treturn new Itr();\n\t}", "public Set<T> values() {\n\t\t// This is immutable to prevent add/remove operation by 3rd party developers.\n\t\treturn Collections.unmodifiableSet(values);\n\t}", "public Set<K> e() {\n return new c(this);\n }", "public Iterator<E> iterator() {\n return new SortedArraySetIterator(this);\n }", "public UnmodifiableIterator<K> iterator() {\n return mo8403b().iterator();\n }", "public boolean isEnumerated() {\r\n return enumerated;\r\n }", "public java.util.Enumeration getI13nActResourceSet() throws java.rmi.RemoteException, javax.ejb.FinderException;", "public List<Class<?>> getAllModelEnums() {\n\t\treturn ModelClasses.findModelEnums();\n\t}", "public java.util.Enumeration getAntennes() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n\n instantiateEJB();\n return ejbRef().getAntennes();\n }", "public Enumeration getKeys() throws AspException\n {\n return Contents.keys();\n }", "public boolean isEnumerated() {\n return enumerated;\n }", "public SideEnumElements getSideEnumAccess() {\r\n\t\treturn eSideEnum;\r\n\t}", "@Override\n public Iterator<Integer> iterator() {\n return new Iterator<>() {\n int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < Set.this.count;\n }\n\n @Override\n public Integer next() {\n return Set.this.arr[i++];\n }\n };\n }", "public Enumeration permissions();", "public com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum[] getImeModeArray()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n java.util.List targetList = new java.util.ArrayList();\r\n get_store().find_all_element_users(IMEMODE$0, targetList);\r\n com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum[] result = new com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum[targetList.size()];\r\n for (int i = 0, len = targetList.size() ; i < len ; i++)\r\n result[i] = (com.microsoft.schemas.xrm._2011.metadata.ImeMode.Enum)((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getEnumValue();\r\n return result;\r\n }\r\n }", "public Iterator<T> iterator() {\n return new SetIterator<T>(this.head);\n }", "@SafeVarargs\r\n\tpublic static <A extends Enum<A>> Set<A> hardenumset(A... elems)\r\n\t{\n\t\tif(elems.length == 0)\r\n\t\t{\r\n\t\t\treturn Collections.emptySet();\t\r\n\t\t}\r\n\t\t\r\n\t\tEnumSet<A> eset = EnumSet.of(elems[0]);\r\n\t\t\r\n\t\tfor(int i = 1; i < elems.length; i++)\r\n\t\t\t{ eset.add(elems[i]); }\r\n\t\t\r\n\t\treturn Collections.unmodifiableSet(eset);\r\n\t}", "public Enumeration getKeys() {\n // Not yet implemented -sorta\n return m_sql_bundle.getKeys();\n }", "public Iterator getValues() {\n synchronized (values) {\n return Collections.unmodifiableList(new ArrayList(values)).iterator();\n }\n }", "public List<MenuElement> getElements()\n {\n return elements;\n }", "public javax.accessibility.AccessibleStateSet getAccessibleStateSet() {\n try {\n return AccessibleStateAdapter.getAccessibleStateSet(TableCell.this,\n unoAccessibleContext.getAccessibleStateSet());\n } catch (com.sun.star.uno.RuntimeException e) {\n return AccessibleStateAdapter.getDefunctStateSet();\n }\n }", "public Iterator<PresenceStatus> getSupportedStatusSet()\n {\n return parentProvider.getJabberStatusEnum().getSupportedStatusSet();\n }", "@Override\n\tpublic AllegationsElement Elements() {\n\t\treturn new AllegationsElement(driver);\n\t}", "public synchronized Collection getElementos() {\n return elemento.values();\n }", "public final Enumeration getKeys() {\n/* 130 */ return getBundle().getKeys();\n/* */ }", "public Enumeration getLocales() {\n List list = new ArrayList();\n list.add(this.locale);\n return Collections.enumeration(list);\n }", "public Enumeration getGeneralEntities() {\r\n return generalEntities.elements();\r\n }", "public ArrayList<Integer> getE() {\r\n return this.e;\r\n }", "public Iterator<WellSetPOJOBigDecimal> iterator() {\n return this.wellsets.iterator();\n }", "public Set<Entry> getSet() {\n Set<Entry> litSet = this.litRegister;\n return litSet;\n }", "public OccurrenceIndicator getResultCardinality() {\n int card = exp.getInternalExpression().getCardinality();\n return OccurrenceIndicator.getOccurrenceIndicator(card);\n }", "public java.util.Enumeration enumerateDEALER() {\r\n\t\treturn new org.exolab.castor.util.IteratorEnumeration(_DEALERList.iterator());\r\n\t}", "public List<ITabDescriptor> getElements() {\n\t\treturn elements;\n\t}", "public AutoSelectionModel getAutoSelectValues() {\r\n return EnumUtil.getEnum(AutoSelectionModel.values(), getAttribute(\"autoSelectValues\"));\r\n }", "public EnumBase realResultEnum() {\n return realResultEnum;\r\n }", "public Iterable<HTMLElement> elements() {\n return iterable;\n }", "public synchronized Iterator<E> iterator()\n {\n return iteratorUpAll();\n }" ]
[ "0.805277", "0.8021577", "0.8007452", "0.7779738", "0.75173485", "0.7485072", "0.7444229", "0.74078214", "0.7225102", "0.7194973", "0.7022449", "0.6725003", "0.6636498", "0.6612374", "0.640282", "0.6336825", "0.6203985", "0.6194731", "0.6181465", "0.6151159", "0.6147289", "0.6124339", "0.6109447", "0.60881346", "0.6069581", "0.60360944", "0.60173434", "0.60145575", "0.5981451", "0.59071666", "0.5885512", "0.58691204", "0.58593214", "0.58590347", "0.58569145", "0.58219296", "0.58173615", "0.5798486", "0.57512355", "0.57195824", "0.57186604", "0.57132727", "0.57080364", "0.56931645", "0.56864184", "0.5683745", "0.56536937", "0.56505746", "0.56436646", "0.563022", "0.5619587", "0.5603612", "0.5602774", "0.5597316", "0.5567269", "0.5554493", "0.5552867", "0.55513775", "0.5542018", "0.55214405", "0.5507432", "0.5498128", "0.54894817", "0.5481082", "0.5475512", "0.5475073", "0.5471679", "0.5463146", "0.54611766", "0.5454282", "0.5452495", "0.5450565", "0.54463285", "0.5444025", "0.543869", "0.5431597", "0.54303485", "0.542576", "0.54255277", "0.541364", "0.5413124", "0.5411131", "0.53974676", "0.5389743", "0.5387484", "0.5383018", "0.5381485", "0.5377866", "0.53713334", "0.53707844", "0.5368347", "0.5362155", "0.53466713", "0.5336701", "0.53352576", "0.5334437", "0.5327754", "0.53241324", "0.532266", "0.53219485" ]
0.7318265
8
Return an Iterator with the elements in this set.
public Iterator iterator() { return new EnumerationIterator(elements.keys()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterator iterator() {\n\t return new EntryIterator(set.iterator());\n\t}", "@Override\n public Iterator<Integer> iterator() {\n return new Iterator<>() {\n int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < Set.this.count;\n }\n\n @Override\n public Integer next() {\n return Set.this.arr[i++];\n }\n };\n }", "public Iterator<T> iterator() {\n return new SetIterator<T>(this.head);\n }", "public Iterator iterator()\n {\n return new HashSetIterator();\n }", "public Iterator getIterator() {\n return myElements.iterator();\n }", "public Iterator<E> iterator() {\n return new SortedArraySetIterator(this);\n }", "public Iterator iterator() {\n maintain();\n return new MyIterator(collection.iterator());\n }", "@Override\n public Iterator<Set<E>> iterator() {\n return new DisjointSetIterator(theSet);\n }", "public Iterator<K> iterator()\n {\n return (new HashSet<K>(verts)).iterator();\n }", "public Iterator<T> getIterator();", "public Iterator<Object> iterator()\r\n {\r\n return new MyTreeSetIterator(root);\r\n }", "public Iterator<K> iterator()\n {\n\treturn (new HashSet<K>(verts)).iterator();\n }", "public Iterator iterator () {\n return new MyIterator (first);\n }", "public Iterator<E> iterator();", "public Iterator<E> iterator();", "public Iterator<E> iterator();", "public Iterator<T> iterator();", "public Iterator<T> iterator();", "public Iterator<T> iterator();", "public Iterator<T> iterator();", "public synchronized Iterator<E> iterator()\n {\n return iteratorUpAll();\n }", "public Iterator iterator()\r\n {\r\n return new IteratorImpl( this, home() );\r\n }", "Iterator<T> iterator();", "@Override\n public Iterator<E> iterator() {\n return new ElementIterator();\n }", "public Iterator<E> iterator() {\n\t\treturn new Itr();\n\t}", "Iterator<E> iterator();", "Iterator<E> iterator();", "public Iterator<T> getIterator() {\n return new Iterator(this);\n }", "@Override\n public Iterator<E> iterator() {\n return new InsideIterator(first);\n }", "public TW<E> iterator() {\n ImmutableMultiset immutableMultiset = (ImmutableMultiset) this;\n return new N5(immutableMultiset, immutableMultiset.entrySet().iterator());\n }", "@Override\n public Iterator<Map.Entry<K, V>> iterator() {\n return new SetIterator();\n }", "public Iterator<T> iterator(){\r\n\t\treturn new ChainedArraysIterator();\r\n\t}", "public Iterator<Integer> iterator() {\n\t\treturn new WrappedIntIterator(intIterator());\n\t}", "public T iterator();", "@Override\n public Iterator<T> iterator() {\n return this;\n }", "public Iterable<Key> iterator() {\n Queue<Key> queue = new LinkedList<>();\n inorder(root, queue);\n return queue;\n }", "@Override\r\n Iterator<E> iterator();", "@Override\r\n\tpublic Iterator<GIS_layer> iterator() {\n\t\treturn set.iterator();\r\n\t}", "@Override\n public Iterator<Pair<K, V>> iterator() {\n return new Iterator<Pair<K, V>>() {\n private int i = 0, j = -1;\n private boolean _hasNext = true;\n\n @Override\n public boolean hasNext() {\n return _hasNext;\n }\n\n @Override\n public Pair<K, V> next() {\n Pair<K, V> r = null;\n if (j >= 0) {\n List<Pair<K, V>> inl = l.get(i);\n r = inl.get(j++);\n if (j > inl.size())\n j = -1;\n }\n else {\n for (; i < l.size(); ++i) {\n List<Pair<K, V>> inl = l.get(i);\n if (inl == null)\n continue;\n r = inl.get(0);\n j = 1;\n }\n }\n if (r == null)\n _hasNext = false;\n return r;\n }\n };\n }", "@Override\r\n\tpublic Iterator<K> iterator() {\n\t\treturn keys.iterator();\r\n\t}", "public Iterator <item_t> iterator () {\n return new itor ();\n }", "public Iterator<T> iterator() {\r\n return new ArrayIterator(elements, size);\r\n }", "@Override\n\tpublic Iterator<WebElement> iterator() {\n\t\treturn this.elements.iterator();\n\t}", "@Override\n\tpublic final Iterator<T> iterator() {\n\t\treturn new IteratorImpl<>(value.get());\n\t}", "public Iterator<E> iterator(){\r\n return new IteratorHelper();\r\n }", "public Iterator<ElementType> iterator(){\n return new InnerIterator();\n }", "public Iterator<Type> iterator();", "public UnmodifiableIterator<K> iterator() {\n return mo8403b().iterator();\n }", "public Iterator<E> elementIterator() {\n return new EnumMultiset<E>.Itr<E>() {\n /* access modifiers changed from: package-private */\n public E output(int i) {\n return EnumMultiset.this.enumConstants[i];\n }\n };\n }", "public Iterator<K> iterator() {\n Set keySet = RBT.keySet();\n Iterator itr = keySet.iterator();\n return itr;\n }", "public Iterator<Item> iterator() {\n return new AIterator();\n }", "public final Iterator iterator() {\n return new WellsIterator(this);\n }", "public Iterator<Item> iterator() {\n RQIterator it = new RQIterator();\n return it;\n }", "public Iterable<MapElement> elements() {\n return new MapIterator() {\n\n @Override\n public MapElement next() {\n return findNext(true);\n }\n \n };\n }", "@Override\n public Iterator<T> iterator() {\n return items.iterator();\n }", "public Iterator<String> iterator() {\n return strings.iterator();\n }", "public Iterator<V> iterator()\n {\n return new Iterator<V>()\n {\n public boolean hasNext()\n {\n // STUB\n return false;\n } // hasNext()\n\n public V next()\n {\n // STUB\n return null;\n } // next()\n\n public void remove()\n throws UnsupportedOperationException\n {\n throw new UnsupportedOperationException();\n } // remove()\n }; // new Iterator<V>\n }", "@Override\n Iterator<T> iterator();", "public Iterator<X> iterator() {\n return map.keySet().iterator();\n }", "@Override\r\n public Iterator iterator(){\n return new MyIterator(this);\r\n }", "public Iterator<S> iterator() {\n\t\t// ..\n\t\treturn null;\n\t}", "public Iterator<Item> iterator() {\n return new LinkedBagIterator();\n }", "@Override\r\n\tpublic Iterator<T> iterator() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn this.iteratorInOrder();\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public Iterator<Tuple<T>> iterator() {\n Iterator<Tuple<T>> fi = (Iterator<Tuple<T>>) new FilteredIterator<T>(resultTable.iterator(), filterOn);\r\n return fi;\r\n }", "@Override\n @Nonnull Iterator<T> iterator();", "public Iterator<E> iterator()\r\n {\r\n return listIterator();\r\n }", "private Iterator getEntries(){\r\n\t\tSet entries = items.entrySet();\r\n\t\treturn entries.iterator();\r\n\t}", "public Iterator<T> iterator() {\n if (this.nrOfElements == 0) {\n return Collections.<T>emptyList().iterator();\n }\n return new Iterator<T>() {\n private Node walker = null;\n\n @Override\n public boolean hasNext() {\n return walker != last;\n }\n\n @Override\n public T next() {\n if (this.walker == null) {\n this.walker = first;\n return this.walker.getData();\n }\n\n if (this.walker.getNext() == null) {\n throw new NoSuchElementException();\n }\n\n this.walker = this.walker.getNext();\n return this.walker.getData();\n }\n };\n }", "@Override\n public Iterator<E> iterator() {\n return new HashBagIterator<>(this, map.entrySet().iterator());\n }", "@Override\n public Iterator iterator() {\n return new PairIterator();\n }", "public Iterator<Object[]> getIterator()\n\t{\n\t\tinit();\n\t\t\n\t\treturn new SimpleIterator();\n\t}", "public Iterator<T> iterator() {\r\n return byGenerations();\r\n }", "public Iterator iterator() {\n\t\treturn new IteratorLinkedList<T>(cabeza);\r\n\t}", "public Iterator<MapElement> iterator() {\n return this;\n }", "public ListIterator<T> getAllByRowsIterator() {\n\t\tAllByRowsIterator it = new AllByRowsIterator();\n\t\treturn it;\n\t}", "public Iterator<T> iterator() {\n\t\treturn new ReferentIterator();\n\t}", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "public Iterator<Item> iterator() {\n return new ArrayIterator();\n }", "@Override\n public Iterator<T> iterator() {\n return forwardIterator();\n }", "@Override\n public Iterator<Value> iterator()\n {\n return values.iterator();\n }", "Iterator<K> iterator();", "public Iterator<Item> iterator() {\n return new Iterator<Item>() {\n public boolean hasNext() {\n return false;\n }\n\n public Item next() {\n return null;\n }\n };\n }", "public Iterator<? extends E> iterator() {\n return (Iterator<? extends E>) Arrays.asList(queue).subList(startPos, queue.length).iterator();\n }", "public ListIterator<T> listIterator() {\n\t\tAllByRowsIterator it = new AllByRowsIterator();\n\t\treturn it;\n\t}", "public Iterator<E> iterator() {\r\n return this.map.values().iterator();\r\n }", "@Override\n\tpublic Iterator<T> iterator() {\n\t\t\n\t\treturn lista.iterator();\n\t}", "@Override\r\n\tpublic Iterator<Key> iterator() {\n\t\treturn new ListIterator();\r\n\t}", "public Iterator<Item> iterator() {\n\t\treturn new ListIterator(); \n\t\t}", "public /*@ non_null @*/ JMLIterator<E> iterator() {\n return new JMLEnumerationToIterator<E>(elements());\n }", "public UnmodifiableIterator<Entry<K, V>> iterator() {\n return mo8403b().iterator();\n }", "public IQuestionIterator iterator() {\n\t\treturn getQuestions().iterator();\n\t}", "public Iterator<T> iterator() {\n\t\treturn list.iterator();\n\t}", "public Iterator<Item> iterator() {\n return new ListIterator();\n\n }", "public Iterator<String> iterator();", "public Iterator<GPoint> iterator() {\n\t\treturn points.iterator();\n\t}", "@Override\n public Iterator<Node> iterator() {\n return this;\n }", "@Override\n public Iterator<Long> iterator() {\n Collection<Long> c = new ArrayList<>();\n synchronized (data) {\n for (int i=0; i<data.length; i++)\n c.add(get(i));\n }\n return c.iterator();\n }", "public Iterator<Item> iterator(){\n return new ArrayIterator();\n }" ]
[ "0.8211496", "0.7931124", "0.7891025", "0.788189", "0.7804635", "0.77403164", "0.7615106", "0.75392014", "0.7506572", "0.74502826", "0.7398634", "0.7344595", "0.73387086", "0.733422", "0.733422", "0.733422", "0.7332078", "0.7332078", "0.7332078", "0.7332078", "0.7316676", "0.73021716", "0.729566", "0.72601223", "0.7239984", "0.7225222", "0.7225222", "0.7202906", "0.71953255", "0.7189928", "0.7187476", "0.7177724", "0.7147649", "0.71374243", "0.71350783", "0.7120532", "0.7110142", "0.7101319", "0.7085717", "0.70744187", "0.70685107", "0.70630634", "0.7062935", "0.70512646", "0.70428014", "0.7042418", "0.704089", "0.70289046", "0.7026739", "0.7024617", "0.702333", "0.70206946", "0.7015297", "0.70107824", "0.7006721", "0.7001057", "0.69753575", "0.6970274", "0.6965694", "0.6963568", "0.69384325", "0.6937874", "0.69338727", "0.6923868", "0.6923721", "0.69174427", "0.6915515", "0.69150245", "0.69104546", "0.69094986", "0.68997276", "0.6895918", "0.6888173", "0.6882291", "0.6876397", "0.6872682", "0.68704695", "0.68704695", "0.68704695", "0.68704695", "0.68494785", "0.68380755", "0.68294644", "0.6817923", "0.68094623", "0.679714", "0.67809343", "0.67777056", "0.67764246", "0.67724675", "0.6772126", "0.67672026", "0.6761332", "0.6761161", "0.67545223", "0.675404", "0.6741608", "0.6740957", "0.67403", "0.67376465" ]
0.74990803
9
Fill in the given array with the elements in this set.
public Object[] toArray(Object[] storage) { Enumeration keys = elements.keys(); int n=0; while (keys.hasMoreElements()) { storage[n++] = keys.nextElement(); } return storage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void fillArray(int[][] array) {\n for (int i = 0; i < array.length; i++)\n for (int j = 0; j < array[i].length; j++)\n array[i][j] = i + j;\n\n // The following lines do nothing\n array = new int[1][1];\n array[0][0] = 239;\n }", "public static void linearFillArray(int[] array) {\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tarray[i] = i;\n\t\t}\n\n\t}", "public void setArray(int i, Array x);", "static void fill(int[] array)\n\t{\n\t\tRandom r = new Random();\n\t\tfor(int i = 0; i < array.length; i++)\n\t\t{\n\t\t\tarray[i] = r.nextInt(100);\n\t\t}\n\t}", "private static void fillArrayWithValues() {\n int[] myArray = new int[40];\n\n // fills my array with value 5\n Arrays.fill(myArray, 5);\n\n // iterate and then print\n for (int i = 0; i < myArray.length; i++) {\n System.out.println(myArray[i]);\n }\n }", "public static void randFillArray(int[] array) {\r\n\t\tRandom random = new Random();\r\n\t\tfor (int i=0; i < SIZE_OF_ARRAY; i++)\r\n\t\t\tarray[i] = random.nextInt(100);\r\n\t}", "static void arrayToSet()\n\t{\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\tString arr[] = {\"A\",\"B\",\"C\",\"D\",\"E\",\"A\"};\n\t\t\t\n\t\t\toList = Arrays.asList(arr);\n\t\t\tSystem.out.println(\"List: \"+oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>(oList);\n\t\t\t\n\t\t\tSystem.out.println(\"Set: \"+oSet);\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toSet = null;\n\t\t}\n\t}", "public static void fillArray(int[] array)\r\n {\r\n //Create a local scanner object\r\n Scanner sc = new Scanner(System.in);\r\n \r\n //Prompt user to enter the number of values within the array\r\n System.out.println(\"Enter \" + array.length + \" values\");\r\n \r\n //Loop through array and assign a value to each individual element\r\n for (int n=0; n < array.length; ++n) \r\n {\r\n \r\n System.out.println(\"Enter a value for element \" + n + \":\");\r\n \r\n array[n] = sc.nextInt();\r\n \r\n \r\n \r\n }\r\n \r\n \r\n }", "public static void fillArray() {\r\n\t\tfor (int i = 0; i < myOriginalArray.length - 1; i++) {\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tmyOriginalArray[i] = rand.nextInt(250);\r\n\t\t}\r\n\t\t// Copies original array 4 times for algorithm arrays\r\n\t\tmyBubbleArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmySelectionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyInsertionArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t\tmyQuickArray = Arrays.copyOf(myOriginalArray, myOriginalArray.length);\r\n\t}", "public TrustingMonotonicArraySet(T[] elements) {\n this();\n\n for (T element : elements) {\n add(element);\n }\n }", "static void fillArray(int[] ar)\n\t{\n\t Random r= new Random();\n\t for(int i = 0; i< ar.length; i++)\n\t {\n\t\t ar[i]= r.nextInt(100);\n\t }\n\t}", "public ZYArraySet(){\n elements = (ElementType[])new Object[DEFAULT_INIT_LENGTH];\n }", "set.addAll(Arrays.asList(a));", "public void set(int[] ai);", "public static int[] fillArray(int[] array, int size) {\r\n\t\tfor (int x = 0; x < size; x = x + 1) {\r\n\t\t\tarray[x] = ReadUserInput.readInt();\r\n\t\t}\r\n\t\treturn array;\r\n\t}", "public void setArray(Object[] array)\n\t{\n\t\tif (SanityManager.DEBUG)\n\t\t{\n\t\t\tSanityManager.ASSERT(array != null, \n\t\t\t\t\t\"array input to setArray() is null, code can't handle this.\");\n\t\t}\n\n\t\tthis.array = ArrayUtil.copy( array );\n\t}", "public Set(){\n setSet(new int[0]);\n }", "public void setArr(int[] arr){ this.arr = arr; }", "private void setSet(int[] set){\n this.set = set;\n }", "public ZYArraySet(int initLength){\n if(initLength<0)\n throw new IllegalArgumentException(\"The length cannot be nagative\");\n elements = (ElementType[])new Object[initLength];\n }", "public void setArray(int[] array) {\r\n this.array = array;\r\n }", "public static void main(String[] args) {\n\t\tint arr[]=new int[5];\r\n\t\tfor(int i=0;i<5;i++){\r\n\t\t\tarr[i]=i;\r\n\t\t}\r\n\t\tArrays.fill(arr,1,4,9);\r\n\t\r\nfor(int i=0;i<5;i++){\r\n\tSystem.out.println(arr[i]);\r\n}\r\n}", "public ArraySet() {\n\t\tthis(DEFAULT_CAPACITY);\n\t}", "protected void setArray(Object[] array){\r\n\t \tthis.array = array;\r\n\t }", "public void setArray(int[] array) {\r\n\t\tthis.array = array;\r\n\t}", "public static void initializeArr(String[] arr){\n\t for(int i = 0; i < arr.length; i++){\n\t arr[i] = \"\";\n\t }\n\t}", "@Test \r\n\t\tpublic void testCreateSetFromArray() {\n\t\t\tInteger [] array = { 1, 2, 3, 4, 5, 6,7};\r\n\t\t\t// set = to the array of values \r\n\t\t\ttestingSet2 = new IntegerSet(array);\r\n\t\t\t// set created from the array is = to the array \r\n\t\t\tassertArrayEquals(testingSet2.toArray(), array); \r\n\t\t}", "public void fillArrayWithNeg1(){\n\t\t\n\t\tArrays.fill(this.theArray, \"-1\");\n\t\t\n\t}", "static void fillArray(int[] array) {\n\t\tint i = 0;\r\n\t\tint number = 1;\r\n\t\twhile (i < array.length) {\r\n\t\t\tif ((int) Math.floor(Math.random() * Integer.MAX_VALUE) % 2 == 0) {\r\n\t\t\t\tnumber = number + (int) Math.floor(Math.random() * 5);\r\n\t\t\t\tarray[i] = number;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tnumber++;\r\n\t\t\t\tarray[i] = number;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public void setArray(int[] paramArrayOfInt)\n/* */ {\n/* 758 */ if (paramArrayOfInt == null) {\n/* 759 */ setNullArray();\n/* */ }\n/* */ else {\n/* 762 */ setArrayGeneric(paramArrayOfInt.length);\n/* */ \n/* 764 */ this.elements = new Object[this.length];\n/* */ \n/* 766 */ for (int i = 0; i < this.length; i++) {\n/* 767 */ this.elements[i] = Integer.valueOf(paramArrayOfInt[i]);\n/* */ }\n/* */ }\n/* */ }", "public boolean[][] fillMask(boolean arr[][]) {\r\n\t\tfor (int i = 0; i < arr.length; i++) {\r\n\t\t\tfor (int j = 0;j < arr[0].length; j++) {\r\n\t\t\t\tarr[i][j] = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn arr;\r\n\t}", "public static <T> Set<T> convertArrayToSet(T array[]) \r\n { \r\n \r\n // Create the Set by passing the Array \r\n // as parameter in the constructor \r\n Set<T> set = new HashSet<>(Arrays.asList(array)); \r\n \r\n // Return the converted Set \r\n return set; \r\n }", "public void extendArray() {\n int index = size();\n Object[] temp = new Object[index + 1];\n for (int i=0; i < index; i++) {\n temp[i] = AL[i];\n }\n AL = temp;\n }", "private void fillInArray(int[] myArray, int searchedValue) {\n\t\t\n\t\tmyArray[0] = searchedValue;\n\t\t\n\t\tfor(int i=1; i<myArray.length; i++) {\n\t\t\tint valueTemp = (int) (Math.random() * myArray.length);\n\t\t\t\n\t\t\tmyArray[i] = valueTemp;\t\t\t\n\t\t}\n\t}", "protected Set(int[] sortedArray, int newSize) {\n this.count = newSize;\n this.capacity = sortedArray.length;\n this.arr = sortedArray;\n }", "void setNullArray()\n/* */ {\n/* 1051 */ this.length = -1;\n/* 1052 */ this.elements = null;\n/* 1053 */ this.datums = null;\n/* 1054 */ this.pickled = null;\n/* 1055 */ this.pickledCorrect = false;\n/* */ }", "public static void initOneD(int[] array) {\n for (int i = 0; i < array.length; i++) {\n array[i] = (int) (Math.random() * 100);\n }\n }", "void setArray(int index, Array value) throws SQLException;", "public static int[] fillEvenNumbers(int[] array) {\n for (int i = 0; i < array.length; i++) {\n array[i] = 2 * i;\n }\n return array;\n }", "static SortedSet<Integer> getSet(int[] array){\n SortedSet<Integer> result = new TreeSet<Integer>();\n for (int i=0; i<array.length; i++){\n result.add(array[i]);\n }\n return result;\n }", "private void setIntArr(int[] intArr) {\r\n this.intArr = intArr;\r\n\r\n }", "static void set() {\n\t\tArrayList<Integer> arr1=new ArrayList<>();\n\t\tfor(int i=0;i<10;i++) arr1.add(i);\n\t\tfor(int x:arr1) System.out.print(x+\" \");\n\t\tSystem.out.println();\n\t\tarr1.set(3, 100);\n\t\tfor(int x:arr1) System.out.print(x+\" \");\n\t}", "private static void modifyArray(int[] array) {\n\t\t\n\t\tarray[0] = 99;\n\t\t\n\t\tarray = new int[5] ;\n\t\treturn;\n\t}", "void setDatumArray(Datum[] paramArrayOfDatum)\n/* */ {\n/* 979 */ if (paramArrayOfDatum == null) {\n/* 980 */ setNullArray();\n/* */ }\n/* */ else {\n/* 983 */ this.length = paramArrayOfDatum.length;\n/* 984 */ this.elements = null;\n/* 985 */ this.datums = ((Datum[])paramArrayOfDatum.clone());\n/* 986 */ this.pickled = null;\n/* 987 */ this.pickledCorrect = false;\n/* */ }\n/* */ }", "private void reset(){\n int j=0;\n for(int i=0; i<array.length; i++){\n if(j == itemCount) {return;}\n if(array[i]!=null){\n temp[j] = array[i];\n j++;\n }\n }\n }", "@Override\n\tpublic void\n\tfill( double value )\n\t{\n\t\tdata[0] = data[1] = data[2] = value;\n\t}", "public void init() {\n for (Point[] p : prev) {\n Arrays.fill(p, null);\n }\n }", "Array(int[] n) {\n\t\tarray = n;\n\t}", "public void setArray(int[] newArr){\n this.sortArray = newArr;\n }", "public void set(String[] as);", "public void setArray(double[] paramArrayOfDouble)\n/* */ {\n/* 725 */ if (paramArrayOfDouble == null) {\n/* 726 */ setNullArray();\n/* */ }\n/* */ else {\n/* 729 */ setArrayGeneric(paramArrayOfDouble.length);\n/* */ \n/* 731 */ this.elements = new Object[this.length];\n/* */ \n/* 733 */ for (int i = 0; i < this.length; i++) {\n/* 734 */ this.elements[i] = Double.valueOf(paramArrayOfDouble[i]);\n/* */ }\n/* */ }\n/* */ }", "public static String[] set(String[] strArray) {\n return unique(strArray);\n }", "public void setAll(Integer[][] newdata) {\r\n this.weekData = newdata;\r\n }", "public void addAll(T[] arr, int from, int length);", "public static int[] populateArray(int [] array) {\n int userInput;\n System.out.println(\"Enter 10 integers: \");\n for(int i = 0; i < array.length; i++){\n Scanner input = new Scanner(System.in);\n userInput = CheckInput.getInt();\n array[i] = userInput;\n }\n return array;\n }", "public void aendereWertFunktioniert(int[] arr) {\n\t\tif (arr.length > 0)\n\t\t\tarr[0] = 0;\n\t}", "public void setArray(long[] array) {\n\t\tthis.array = array;\n\t}", "public FancyArray(Object[] arr) {\r\n\t\t/*\r\n\t\t * Statt eines Konstruktors der Oberklasse kann ich auch\r\n\t\t * einen anderen Konstruktor der Klasse selbst aufrufen!\r\n\t\t * \r\n\t\t * Auch dazu benutzen wir das Schlüsselwort this,\r\n\t\t * so rufen wir den parameterlosen Konstruktor auf -\r\n\t\t * so kann ich auch Konstruktoren der gleichen Klasse verketten\r\n\t\t */\r\n\t\tthis();\r\n\t\t//nach dem Aufruf wird dieser Konstruktor weiter ausgeführt:\r\n\t\taddAll(arr);\r\n\t}", "ArrayView(final E[] array) {\n\t\tthis.array = Objects.requireNonNull(array);\n\t}", "protected void setAll() {\n for (int i=0; i <= (Numbers.INTEGER_WIDTH*8-2); i++) {\n \tthis.setBitAt(i);\n } \t\n }", "private void initialize(int[] arr) {\n a = ArraysUtils.sortAndRemoveDuplicates(arr);\n if (a.length != arr.length) {\n throw new IllegalArgumentException(\"Need unique list of numbers\");\n }\n numLeft = new BigInteger(total.toString());\n }", "public void makeArray() {\r\n for (int i = 0; i < A.length; i++) {\r\n A[i] = i;\r\n }\r\n }", "public void addAll(final int[] newArray) {\n for (int eachVal: newArray) {\n add(eachVal);\n }\n }", "void setUp(Comparable[] input) {\n\n\t\t// Clone input array, to get data from\n\t\tarray = Arrays.copyOf(input, input.length);\n\t\t\n\t\t/*\n\t\t * Initialize arrays:\n\t\t * \"data\" is the array of lists\n\t\t * \"next\" is the array of list tails\n\t\t * \"queue\" is the array for the queue implementation\n\t\t */\n\t\tdata = new int[input.length];\n\t\tnext = new int[input.length];\n\t\tqueue = new int[input.length];\n\t\t\n\t\t// fill array of tail with NIL values\n\t\tArrays.fill(next, NIL);\n\t\t\n\t\t// fill array of lists and queue with indexes\n\t\tfor (int i = 0; i < input.length; i++)\n\t\t\tdata[i] = queue[i] = i;\n\t\t\n\t\t// set queue pointers to the first cell\n\t\tqPush = qPoll = 0;\n\n\t\t/*\n\t\t * At this point queue is full.\n\t\t * So set flags: can poll, but cannot push\n\t\t */\n\t\tcanPush = false;\n\t\tcanPoll = true;\n\t}", "private void setInArray(int i, int j, E element) {\r\n\t\tmElements.set(j*mRowCount+i, element);\r\n\t}", "public static String[] setStringArrayToEmpty(String[] arr) {\n for (int i = 0; i < arr.length; i++) {\n arr[i] = \"empty\";\n }\n return arr;\n }", "public static int[] fillOddNumbers(int[] array) {\n for (int i = 0; i < array.length; i++) {\n array[i] = (2 * i) + 1;\n }\n return array;\n }", "private void setArray(byte[] initialArray)\r\n/* 60: */ {\r\n/* 61: 95 */ this.array = initialArray;\r\n/* 62: 96 */ this.tmpNioBuf = null;\r\n/* 63: */ }", "public static void warmUp(int[] arr) {\n arr[0] = 5;\n \n // arr = 3af -> [0,2,3]\n }", "void setNilScansArray(int i);", "public void fillSorted()\n {\n for (int i=0; i<list.length; i++)\n list[i] = i + 2;\n }", "public void set(double[] ad);", "Array(int x) {\n\t\tarray = new int[x];\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tarray[i] = 0; // make each index 0\n\t\t}\n\t}", "public void makeSet(int [] parent)\n\t\t{\n\t\t\tfor(int i = 0; i < edges; i++)\n\t\t\t\tparent[i] = i;\n\t\t}", "public static void setOrdinals(Ordinal[] array) {\r\n\t\tif(Arrays.stream(array).allMatch(o -> o.getOrdinal() == null)) {\r\n\t\t\tfor(int i=0; i<array.length; i++) {\r\n\t\t\t\tarray[i].setOrdinal(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void permutate(Object[] x) {\n for (int i = 0; i < x.length; i++) {\n int j = i + nextInt(x.length - i);\n Math.swap(x, i, j);\n }\n }", "private static int[] rearrange(int[] arr) {\n\t\t\n\t\tSet<Integer> set = new HashSet<Integer>();\n\t\t\n\t\t// Storing all the values in the HashSet\n\t\tfor(int i : arr) {\n\t\t\tset.add(i);\n\t\t}\n\t\t\n\t\tfor(int i=0; i<arr.length ; i++) {\n\t\t\t\n\t\t\tif(set.contains(i))\n\t\t\t\tarr[i] =i;\n\t\t\telse\n\t\t\t\tarr[i] = -1;\t\n\t\t}\n\t\t\n\t\t\n\t\treturn arr;\n\t}", "private static void initialise( String booth[] ) {\n\r\n for (int x = 0; x < 6; x++ ) { //Assigning all the 6 booths as \"empty\"\r\n booth[x] = \"empty\";\r\n }\r\n }", "void setStarArray(stars.StarType[] starArray);", "public void resetChangeableArrays(int[] reg)\n {\n valList = new LinkedList<Integer>();\n possibilityList = new LinkedList<Point>();\n for(int j = 0; j<accumulator.length; j ++)Arrays.fill(accumulator[j],0);\n //accumulator = zeroAccumulator;\n region = reg;\n \n }", "public void set(GPointsArray pts) {\n\t\tif (pts.getNPoints() == points.size()) {\n\t\t\tfor (int i = 0; i < points.size(); i++) {\n\t\t\t\tpoints.get(i).set(pts.get(i));\n\t\t\t}\n\t\t} else if (pts.getNPoints() > points.size()) {\n\t\t\tfor (int i = 0; i < points.size(); i++) {\n\t\t\t\tpoints.get(i).set(pts.get(i));\n\t\t\t}\n\n\t\t\tfor (int i = points.size(); i < pts.getNPoints(); i++) {\n\t\t\t\tpoints.add(new GPoint(pts.get(i)));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (int i = 0; i < pts.getNPoints(); i++) {\n\t\t\t\tpoints.get(i).set(pts.get(i));\n\t\t\t}\n\n\t\t\tpoints.subList(pts.getNPoints(), points.size()).clear();\n\t\t}\n\t}", "public void set(float[] values) {\n for (int i = 0; i < values.length; i++) {\n storage[i] = values[i];\n }\n }", "public static Set asSet(Object[] items) {\r\n \t\r\n \tSet set = new HashSet(items.length);\r\n \tfor (int i=0; i<items.length; i++) {\r\n \t\tset.add(items[i]);\r\n \t}\r\n \treturn set;\r\n }", "public void fill(String[] seqInput) throws BaseException\n {\n fill(stringsToBases(seqInput));\n }", "public void fillVector(){\n int n = min.length;\n for (int i = 0; i < n; i++) {\n this.x[i] = min.x[i] + (max.x[i] - min.x[i])*rn.uniformDeviate();\n }\n }", "public void fillPropertyArray()\n \t{\n \t\tsuper.fillPropertyArray();\n \t\tsuper.fillPropertyArray( gui );\n \t}", "public void addAll(T[] arr);", "void setArrayElement(int index, Object value);", "void setArrayElement(int index, Object value);", "public ArraySetLong(long[] numbers, int n) {\n\t\tnumElements = n;\n\t\ttheElements = new long[n*2];\n\t\tfor (int i=0; i<n; i++) {\n\t\t\ttheElements[i] = numbers[i];\n\t\t}\n\t}", "@SafeVarargs // can only be applied to final methods\n public final <T> T[] replaceFirstValueInArray(T value, T... array) {\n array[0] = value; // promise not to mess it up; but messing it up anyway\n return array;\n }", "void setContents(T[] contents);", "public void setArray(short[] paramArrayOfShort)\n/* */ {\n/* 824 */ if (paramArrayOfShort == null) {\n/* 825 */ setNullArray();\n/* */ }\n/* */ else {\n/* 828 */ setArrayGeneric(paramArrayOfShort.length);\n/* */ \n/* 830 */ this.elements = new Object[this.length];\n/* */ \n/* 832 */ for (int i = 0; i < this.length; i++) {\n/* 833 */ this.elements[i] = Integer.valueOf(paramArrayOfShort[i]);\n/* */ }\n/* */ }\n/* */ }", "public void initializeArray(){\n if(topOfStack==-1){\n for(int i=0;i<this.arr.length;i++){\n this.arr[i]=Integer.MIN_VALUE;\n }\n }\n }", "private void fillMap() {\n\t\tObject tile = new Object();\n\t\tfor(int x = 0; x < map.length; x++) {\n\t\t\tfor(int y = 0; y < map.length; y++) {\n\t\t\t\tmap[x][y] = tile;\n\t\t\t}\n\t\t}\n\t}", "public void setValues(Object[] vals)\n\t{\n\t\tvalues.clear();\n\n\t\tfor (int ctr=0; ctr<vals.length; ctr++)\n\t\t{\n\t\t\tvalues.add(vals[ctr] + \"\");\n\t\t}\n\t}", "public void fill(){\n int i = 0;\n for (Suit suit:Suit.values()){\n for (Rank rank:Rank.values()) {\n deck[i] = new Card(rank, suit);\n numCards++;\n i++;\n }\n }\n }", "@Override\r\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn set.toArray(a);\r\n\t}", "public OpenHashSet(java.lang.String[] data) {\n this();\n\n for (int i = 0; i < data.length; i++){\n if (data[i]!=null)\n add(data[i]);\n }\n }", "@Override\r\n\tpublic MySet intersectSets(MySet[] t) {\r\n\t\tallElements = new ArrayList<Integer>();\r\n\r\n\t\t\r\n\t\tfor(Object element: t[0]) {\r\n\t\t\tallElements.add(element);\r\n\t\t}\r\n\t\r\n\t\tfor(Object e: allElements) {\r\n\t\t\tInteger c = map.getOrDefault(e, 0);\r\n\t\t\tmap.put((E)e, c + 1);\r\n\t\t}\r\n\t\t\r\n\t\tMySet<E> returnSet = (MySet<E>) new Set2<Integer>();\r\n\t\tfor(Map.Entry<E, Integer> entry :map.entrySet())\r\n\t\t\tif(entry.getValue() >= dataSet[0].length) // check\r\n\t\t\t\treturnSet.add(entry.getKey());\r\n\t\t\r\n\t\t\r\n\t\treturn returnSet;\r\n\t}", "public static void fill(java.util.List arg0, java.lang.Object arg1)\n { return; }" ]
[ "0.6761103", "0.6488479", "0.6391357", "0.62594944", "0.61622036", "0.6130999", "0.6105224", "0.60986525", "0.6089715", "0.6064986", "0.60180354", "0.5959801", "0.593425", "0.57846355", "0.57457864", "0.5735022", "0.5730387", "0.57224673", "0.56984437", "0.56964535", "0.56743795", "0.56601995", "0.5658837", "0.5607853", "0.5582528", "0.55725116", "0.5553818", "0.5551419", "0.55512846", "0.5525839", "0.5496697", "0.5471913", "0.54677147", "0.5441559", "0.5361301", "0.53561383", "0.5334688", "0.5323312", "0.529565", "0.5275398", "0.5270438", "0.5265753", "0.522996", "0.5223392", "0.5216517", "0.51959676", "0.5191933", "0.51875836", "0.5186073", "0.5167577", "0.5157232", "0.5141819", "0.5141235", "0.5133283", "0.51329184", "0.5126442", "0.51231825", "0.5120382", "0.5110804", "0.51055163", "0.51006943", "0.5095181", "0.50950223", "0.50930125", "0.5091621", "0.5087156", "0.50845844", "0.50821245", "0.5060556", "0.50555736", "0.5043364", "0.5042855", "0.50385773", "0.5037425", "0.5021181", "0.50150335", "0.5013383", "0.50072944", "0.49962223", "0.4985929", "0.49819273", "0.49801537", "0.49779597", "0.4976086", "0.49718058", "0.4964793", "0.49645707", "0.49641567", "0.49641567", "0.49636632", "0.49626878", "0.4961271", "0.4955196", "0.49418092", "0.49295622", "0.492705", "0.49214795", "0.4918374", "0.49178305", "0.49154514", "0.4913866" ]
0.0
-1
Return an array with the elements in this set.
public Object[] toArray() { return toArray(new Object[size()]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic Object[] toArray() {\n\t\treturn set.toArray();\r\n\t}", "private Object[] elements() {\n return elements.toArray();\n }", "@Override\n public int[] toArray() {\n int[] result = new int[size];\n Entry tmp = first;\n for (int i = 0; i < size; i++) {\n result[i] = tmp.value;\n tmp = tmp.next;\n }\n return result;\n }", "@Override\n public Object[] toArray() {\n Object[] result = new Object[size];\n int i = 0;\n for (E e : this) {\n result[i++] = e;\n }\n return result;\n }", "public Object[] toArray() {\n Object[] arr = new Object[size];\n for(int i = 0; i < this.size; i++) {\n arr[i] = this.get(i);\n }\n return arr;\n }", "public WebElement[] toArray() {\n\t\treturn ToArrayFunction.toArray(this, elements);\n\t}", "public default T[] toArray() {\n Object[] array = new Object[size()];\n int i = 0;\n for (T t : this) {\n array[i++] = t;\n }\n return (T[]) array;\n }", "@Override\n\tpublic Object[] toArray() {\n\t\tObject[] result = copyArray(elements, size);\n\n\t\treturn result;\n\t}", "public Object[] getElements() {\r\n\t\treturn data.toArray();\r\n\t}", "private int[] getArray(Set<Integer> set) {\n int n = set.size();\n int[] array = new int[n];\n\n Iterator<Integer> iterator = set.iterator();\n int i = 0;\n while (iterator.hasNext()) {\n array[i] = iterator.next();\n i++;\n }\n return array;\n }", "public E[] values(){\n\t\tE[] output = (E[]) new Object[howMany];\n\t\tint j = 0;\n\t\tfor (int i = 0; i < elem.length; i++)\n\t\t\tif (elem[i] != null){\n\t\t\t\toutput[j] = elem[i];\n\t\t\t\tj = j + 1;\n\t\t\t}\n\t\treturn output;\n\t}", "public Polynomial[] getAsArray() {\n Polynomial[] list = new Polynomial[collection.size()];\n\n for (int i = 0; i < collection.size(); i++) {\n list[i] = collection.get(i);\n }\n return list;\n }", "public Object[] getElements() {\r\n\t\treturn elements.clone();\r\n\t}", "public Object[] getArray() {\n compress();\n return O;\n }", "@Override\n public T[] toArray() {\n //create the return array\n T[] result = (T[])new Object[this.getSize()];\n //make a count variable to move through the array and a reference\n //to the first node\n int index = 0;\n Node n = first;\n //copy the node data to the array\n while(n != null){\n result[index++] = n.value;\n n = n.next;\n }\n return result;\n }", "public int[] getArticulationVertices() {\n int[] xs = new int[set.cardinality()];\n for (int x = set.nextSetBit(0), i = 0;\n x >= 0;\n x = set.nextSetBit(x + 1), i++) {\n xs[i] = x;\n }\n return xs;\n }", "public HashSet getElements() {\n\treturn elements;\n }", "public Object[] toArray() {\n Object[] tmp = new Object[this.container.length];\n System.arraycopy(this.container, 0, tmp, 0, tmp.length);\n return tmp;\n }", "public Object[] toArray() {\n return Arrays.copyOf(this.values, this.index);\n }", "public int[] toArray() {\n return Arrays.copyOf(buffer, elementsCount);\n }", "public Object[] entrySet() {\n MyStack<Object> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current);\n current = current.getNext();\n }\n result.push(current);\n }\n }\n return result.toArray();\n }", "public double[] toArray() {\n\t\treturn acc.toArray();\n\t}", "public Object[] getList() {\n Object[] list = new Object[size()];\n copyInto(list);\n return list;\n }", "@Override\n public T[] toArray() {\n T[] result = (T[])new Object[numItems];\n for(int i = 0; i < numItems; i++)\n result[i] = arr[i];\n return result;\n }", "public V[] values() {\n MyStack<V> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current.getValue());\n current = current.getNext();\n }\n result.push(current.getValue());\n }\n }\n return result.toArray();\n }", "final public int[] getSubset() {\n\t\treturn subset;\n\t}", "@Override\n public T[] toArray() {\n return this.copyArray(this.data, this.size);\n }", "public E[] toArray() {\n return (E[]) Arrays.copyOfRange(queue, startPos, queue.length);\n }", "public int[] getSetsArray()\n\t{\n\t\treturn getSets().getSetsArray();\n\t}", "public double[][] getCompleteElements() {\n double[][] values = new double[getRowDimension()][getColumnDimension()];\n for (int rowIndex = 0; rowIndex < getRowDimension(); rowIndex++) {\n for (int columnIndex = 0; columnIndex < getColumnDimension(); columnIndex++) {\n values[rowIndex][columnIndex] = getElement(rowIndex, columnIndex);\n }\n }\n return values;\n }", "public Object[] toArray() {\n\t\treturn null;\n\t}", "public Object[] toArray() {\r\n Object[] arr = new Object[size];\r\n Node<T> current = head.next();\r\n for (int i = 0; i < size; i++) {\r\n arr[i] = current.getData();\r\n current = current.next();\r\n }\r\n return arr;\r\n }", "public List<Subset> getElements() {\n\t\treturn subSetList;\n\t}", "public Object[] toArray() {\n\t\tint k;\n\t\tNode p;\n\n\t\tObject[] retArray = new Object[mSize];\n\t\tfor (k = 0, p = mHead.next; k < mSize; k++, p = p.next)\n\t\t\tretArray[k] = p.data;\n\t\treturn retArray;\n\t}", "public java.util.List[] getPointArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(POINT$0, targetList);\n java.util.List[] result = new java.util.List[targetList.size()];\n for (int i = 0, len = targetList.size() ; i < len ; i++)\n result[i] = ((org.apache.xmlbeans.SimpleValue)targetList.get(i)).getListValue();\n return result;\n }\n }", "ArrayList<String> returnArray() {\n\t\treturn stringArray; // Return just the array and not the Set object\n\t}", "public double[] toArray() {\n\t\treturn new double[] {x, y, z};\n\t}", "public T[] toArray() {\n return null;\n }", "public int[] toArray() \n {\n \treturn arrayCopy(state);\n }", "@Override\n public Object[] toArray() {\n Object[] tempArray = new Object[size];\n Node n = this.head;\n int i = 0;\n while (i<size) {\n tempArray[i] = n.getData();\n i++;\n n = n.next;\n }\n return tempArray;\n }", "public O[] toArray()\r\n {\r\n\r\n @SuppressWarnings(\"unchecked\")\r\n O[] a = (O[]) new Object[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }", "public Object[] toArray(){\n\t\t// allocate the array an an iterator\n\t\t\t\tObject[] arr = new Object[hashTableSize];\n\t\t\t\tIterator<T> iter = iterator();\n\t\t\t\tint i = 0;\n\n\t\t\t\t// iterate the hash table and assign its\n\t\t\t\t// values into the array\n\t\t\t\twhile (iter.hasNext()) {\n\t\t\t\t\tarr[i] = iter.next();\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\treturn arr;\n\t}", "@Override\n public Object[] toArray() {\n Object[] result = new Object[currentSize];\n System.arraycopy(container, 0, result, 0, currentSize);\n return result;\n }", "public List<Pair<Integer, Integer>> getArray(){\n return qtadePorNum;\n }", "public int[] getIntArray() {\r\n\t\t\r\n\t\treturn (value.getIntArray());\r\n\t}", "public ArrayList<Integer> getElements()\n {\n return this.elements;\n }", "public Expression getArray()\n {\n return getExpression();\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic E[] toArray() {\r\n\t\tE[] array = null;\r\n\t\tif (!heap.isEmpty()) {\r\n\t\t\tarray = (E[]) Array.newInstance(heap.get(0).getClass(), heap.size());\r\n\t\t\tint i = 0;\r\n\t\t\tfor (E e : heap) {\r\n\t\t\t\tarray[i++] = e;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array;\r\n\t}", "E[] toArray();", "protected Object[] getArray(){\r\n\t \treturn array;\r\n\t }", "public Weet[] toArray() {\n /**\n * Used by getWeets() for returning a chronological array of weets.\n */\n\n /* If no insertions have been carried out, return the array of weets with no further operations */\n if (altered == false) {\n return WeetArray;\n }\n /**\n * Otherwise, define a new array dwArray (If M is the number of Date-Weet pairs, dwArray has size M),\n * make a call to an overloaded method with the generics of the B-Tree and dwArray as parameters,\n * set WeetArray equal to the new array and force WeetArray to return by setting 'altered' to false.\n */\n else {\n c = 0;\n altered = false;\n Weet[] dwArray = new Weet[size];\n toArray(root, height, dwArray);\n WeetArray = dwArray;\n return dwArray;\n }\n }", "public Object[] toArray() {\n Object[] arr = new Object[size];\n Node<E> cur = head;\n for(int i = 0; i < size; i++) {\n arr[i] = cur.item;\n cur = cur.next;\n }\n return arr;\n }", "public Object[] toArray() {\r\n\t\treturn this.records.toArray();\r\n\t}", "public int[] getInnerArray() {\n\t\treturn data;\n\t}", "T[] getValues();", "@Override\n\tpublic double[][] toArray() {\n\t\tint m = this.getRowsCount();\n\t\tint n = this.getColsCount();\n\t\tdouble[][] arr = new double[m][n];\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tarr[i][j] = this.get(i, j);\n\t\t\t}\n\t\t}\n\t\treturn arr;\n\t}", "public double[] getValues() {\n return values.clone();\n }", "public Object getArray() {\n\t\treturn array;\n\t}", "public Object[] toArray()\n\t{\n\t\treturn list.toArray();\n\t}", "public int[] getArray() {\r\n return array;\r\n }", "public final Object[] getArray() {\n return array;\n }", "public K[] keySet() {\n MyStack<K> result = new MyStack<>();\n\n for (Object entry : this.table) {\n if (entry != null) {\n Entry<K, V> current = (Entry<K, V>) entry;\n\n while (current.hasNext()) {\n result.push(current.getKey());\n current = current.getNext();\n }\n result.push(current.getKey());\n }\n }\n return result.toArray();\n }", "public int[] keysToArray()\r\n\t {\r\n\t\t if(this.size() == 0)\r\n\t\t {\r\n\t\t\t return new int[0];\r\n\t\t }\r\n\t\t int[] arr = new int[this.size()]; \r\n\t\t return this.root.keysToArray(arr, 0);\r\n\t }", "@Override\r\n\tpublic <T> T[] toArray(T[] a) {\n\t\treturn set.toArray(a);\r\n\t}", "default Object[] toArray() {\n return toArray(new Object[0]);\n }", "public java.lang.Object[] getIdsAsArray()\r\n {\r\n return (ids == null) ? null : ids.toArray();\r\n }", "public User[] toArray() {\n return this.base.values().toArray(new User[0]);\n }", "@Override\n\t\tpublic Object[] toArray() {\n\t\t\treturn snapshot().toArray();\n\t\t}", "public int [] getResultArr() {\n return maskResultArray;\n }", "public Object[] toArray() {\n\t\tObject[] arg = new Object[size];\r\n\t\t\r\n\t\tNode<E> current = head;\r\n\t\tint i = 0;\r\n\t\twhile(current != null) {\r\n\t\t\targ[i] = current.getData();\r\n\t\t\ti++;\r\n\t\t\tcurrent = current.getNext();;\r\n\t\t}\r\n\t\treturn arg;\r\n\t}", "public String[] getArray(){\n return (String[])this.items.toArray();\n }", "public int[] getArray() {\r\n\t\treturn array;\r\n\t}", "T[] getObjects() {\n\t\treturn this.array;\n\t}", "@Override\n\tpublic Object[] toArray() {\n\t\treturn snapshot().toArray();\n\t}", "public SubMenuItem[] getArray() {\n return this.toArray(new SubMenuItem[this.size()]);\n }", "public String[] getValues()\n\t{\n\t\tString[] retArr = new String[values.size()];\n\n\t\tvalues.toArray(retArr);\n\n\t\treturn retArr;\n\t}", "public Object[] toArray(){\n\n \tObject[] o = new Object[list.size()];\n\n o = list.toArray();\n\n \treturn o;\n\n }", "public Object[] toArray() {\n\t\tObject[] ret = new Object[currentSize];\n\t\tfor (int i = 0; i < currentSize; i++)\n\t\t\tret[i] = array[i];\n\t\treturn ret;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic T[] asArray() {\n\t\t// have to use explicit cast because we cannot use the alternative signature of toArray(T[]), as you cannot instantiate an array of a\n\t\t// type parameter (not even an empty array)\n\t\treturn (T[]) this.itemList.toArray();\n\t}", "public int[] getArray() {\n\t\treturn array;\n\t}", "public long[] toArray() {\n/* 406 */ long[] array = new long[(int)(this.max - this.min + 1L)];\n/* 407 */ for (int i = 0; i < array.length; i++) {\n/* 408 */ array[i] = this.min + i;\n/* */ }\n/* 410 */ return array;\n/* */ }", "public double[] getArray(){\n\t\t\tdouble[] temp = new double[count];\n\t\t\tfor (int i = 0; i < count; i++){\n\t\t\t\ttemp[i] = anArray[i];\n\t\t\t}\n\t\t\treturn temp;\n\t\t}", "public Object[] getValues();", "public float[] toArray() {\r\n float[] result = new float[size];\r\n System.arraycopy(elementData, 0, result, 0, size);\r\n return result;\r\n }", "public Student[] toArray()\r\n {\r\n Student[] students = new Student[number_of_entries];\r\n Node currentNode = first_node;\r\n int index = 0;\r\n\r\n while(currentNode != null && index < number_of_entries)\r\n {\r\n students[index] = currentNode.getData();\r\n index++;\r\n currentNode = currentNode.getNextNode();\r\n }\r\n\r\n return students;\r\n }", "public amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value[] getValueArray()\n {\n synchronized (monitor())\n {\n check_orphaned();\n java.util.List targetList = new java.util.ArrayList();\n get_store().find_all_element_users(VALUE$0, targetList);\n amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value[] result = new amdocs.iam.pd.webservices.productattrrel.productdetailsoutput.Value[targetList.size()];\n targetList.toArray(result);\n return result;\n }\n }", "public int[] get() {\n return res;\n }", "public int[] getValueArray() {\n return value;\n }", "public WFJFilterMap[] asArray() {\n synchronized (lock) {\n return array;\n }\n }", "public double[] getAsArray() {\n return position.getAsArray();\n }", "@Override\r\n\tpublic T[] toArray() {\r\n\t\t@SuppressWarnings(\"unchecked\")\r\n\t\tT[] result = (T[])new Object[topIndex + 1];\r\n\t\tfor(int index = 0; index < result.length; index ++) {\r\n\t\t\tresult[index] = stack[index];\r\n\t\t}\r\n\treturn result;\r\n\t}", "public double[] asArray() {\n final double[] result = new double[COMPONENTS];\n asArray(result);\n return result;\n }", "public E[] getArray() {\n return this.array;\n }", "public Product[] getAll() {\n Product[] list = new Product[3];\n try {\n list[0] = products[0].clone();\n list[1] = products[1].clone();\n list[2] = products[2].clone();\n } catch (CloneNotSupportedException ignored) {}\n\n return list;\n }", "@Override\n\tpublic Collection<V> values() {\n\t\tArrayList<V> valores = new ArrayList<V>();\n\t\tIterator it = tabla.iterator();\n\t\tint i = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tIterator it2 = tabla.get(i).valueSet().iterator();\n\t\t\tit.next();\n\t\t\tint j = 0;\n\t\t\twhile (it2.hasNext()) {\n\t\t\t\tit2.next();\n\t\t\t\tvalores.add(tabla.get(i).valueSet().get(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn new HashSet<V>(valores);\n\t}", "public Column[] toArray() {\n return toArray(new Column[subColumnSize()]);\n }", "public double[] toArray() \r\n\t{ \r\n\t\treturn Arrays.copyOf(storico, storico.length) ; \r\n\t}", "@Override\n\tpublic int[] toArray() {\n\t\treturn null;\n\t}", "int[] getValues()\n {\n return values_;\n }", "public ArrayList getChunks() {\n ArrayList tmp = new ArrayList();\n for (Iterator i = iterator(); i.hasNext(); ) {\n tmp.addAll(((Element) i.next()).getChunks());\n }\n return tmp;\n }" ]
[ "0.7925832", "0.75802314", "0.74089", "0.739003", "0.73530626", "0.72248614", "0.7158258", "0.7139311", "0.70801866", "0.7074345", "0.7074266", "0.706558", "0.7031909", "0.70129097", "0.69668263", "0.6963308", "0.69560313", "0.6945845", "0.69373274", "0.6902087", "0.6885156", "0.6842563", "0.6794286", "0.676339", "0.6756586", "0.6726258", "0.6721332", "0.6713714", "0.6708846", "0.669755", "0.6683499", "0.66767776", "0.6667482", "0.6642921", "0.6626775", "0.6624154", "0.6613025", "0.66120964", "0.6606454", "0.66024995", "0.6598108", "0.65911764", "0.6590358", "0.6578949", "0.6565996", "0.65578085", "0.654565", "0.6544293", "0.6542573", "0.65369385", "0.65364873", "0.6530238", "0.6465641", "0.64578456", "0.6451701", "0.6448242", "0.6444024", "0.6436167", "0.6435767", "0.64231795", "0.6422646", "0.6418988", "0.641791", "0.6396626", "0.63833207", "0.6382057", "0.6381703", "0.63678885", "0.63596356", "0.635765", "0.63553697", "0.6351376", "0.6346271", "0.6340498", "0.6328902", "0.6320963", "0.63144195", "0.63129944", "0.6306551", "0.6297336", "0.62951696", "0.6292871", "0.6283125", "0.62765783", "0.627481", "0.62711746", "0.62691367", "0.6257657", "0.62564373", "0.6238523", "0.62370485", "0.6230662", "0.62304634", "0.6224187", "0.6222345", "0.6218693", "0.62122893", "0.6211789", "0.62018275", "0.6195624" ]
0.6806449
22
Return an AttributeSet containing the elements of this set and the given element
public AttributeSet addElement(Object element) { Hashtable newElements = (Hashtable) elements.clone(); newElements.put(element, element); return new AttributeSet(newElements); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AttributeSet(Object elem) {\n\n elements = new Hashtable(1, 1);\n elements.put(elem, elem);\n }", "public AttributeSet() {\n\n elements = new Hashtable();\n }", "public AttributeSet unionWith(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "public AttributeSet and(String key, Object val) {\r\n put(key, val);\r\n return this;\r\n }", "public AttributeSet intersectWith(AttributeSet s) {\n\n Hashtable newElements = new Hashtable();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n if (elements.get(next) != null) {\n newElements.put(next, next);\n }\n }\n\n return new AttributeSet(newElements);\n }", "public AttributeSet copy() {\r\n AttributeSet res = new AttributeSet(parent.orNull());\r\n for (String k : attributeMap.keySet()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "public AttributeSet immutable() {\r\n return ImmutableAttributeSet.copyOf(this);\r\n }", "public AttributeSet(Object[] elems) {\n\n elements = new Hashtable(elems.length, 1);\n for (int i=0; i < elems.length; i++) {\n Object next = elems[i];\n elements.put(next, next);\n }\n }", "static AttributeSet createKeySet(Hashtable hashtable) {\n\n Hashtable newElements = new Hashtable();\n\n Enumeration e = hashtable.keys();\n while (e.hasMoreElements()) {\n Object next = e.nextElement();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "public AttributeSet flatCopy() {\r\n AttributeSet res = new AttributeSet();\r\n for (String k : getAllAttributes()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "@Override\n public T getCombinedElement()\n {\n return element;\n }", "public static AttributeSet with(String key, Object val) {\r\n AttributeSet res = new AttributeSet();\r\n res.put(key, val);\r\n return res;\r\n }", "public GUIAttributeSet getAttributeSet(long setId) throws ServerException;", "private void init(final AttributeSet set) {\n }", "public static AttributeSet withParent(AttributeSet par) {\r\n return new AttributeSet(par);\r\n }", "protected void mergeAttributes( Element element, AttributeSet attr, AttributeFilter filter, SimpleFeature feature )\n \t{\n \t\tif( attr.size() > 0 )\n \t\t{\n \t\t\tfor( String key: attr.keySet() )\n \t\t\t{\n \t\t\t\tif( filter != null )\n \t\t\t\t{\n \t\t\t\t\tif( filter.isKept( key ) )\n \t\t\t\t\t\telement.setAttribute( key, attr.get( key ) );\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\telement.setAttribute( key, attr.get( key ) );\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n //\t\tif( addEdgeShapeAttribute && element instanceof Edge )\n //\t\t\taddEdgeShapeStyle( (Edge)element, feature );\n \t}", "public final HashSet<Attribute> attributeSet() {\n final HashSet<Attribute> set = new HashSet<Attribute>();\n\n for (int i = 0; i < m_body.size(); i++) {\n final Condition c = m_body.get(i);\n set.add(c.getAttr());\n }\n\n return set;\n }", "public AttributeSet getAttributes() {\n return null;\n }", "public int set(int index, int element);", "public void createSet(String element) {\n\t\t\n\t\tSet<String> set = new HashSet<String>();\n\t\tset.add(element);\n\t\t\n\t\tMap<String, Set<String>> map = new HashMap<String, Set<String>>();\t\t\n\t\tmap.put(element, set);\n\t\t\n\t\tdisjointSet.add(map);\n\t\n\t}", "private Set buildSet(String attrName, Map attributes, Set resultSet) {\n Set vals = (Set) attributes.get(attrName);\n if ((vals != null) && !vals.isEmpty()) {\n resultSet.addAll(vals);\n }\n return (resultSet);\n }", "public E set(int index, E element);", "public VAttributeSet getAttributeSet(String names[]) throws VlException\n {\n \treturn new VAttributeSet(getAttributes(names)); \n }", "public Criteria andAttribEqualToColumn(SaleClassifyGood.Column column) {\n addCriterion(new StringBuilder(\"attrib = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@TimeComplexity(\"O(1)\")\n\tpublic E setElement(E eT)\n\t{\n\t\t//TCJ: the cost does not vary with input size so it is constant\n\t\tE temp = element;\n\t\telement = eT;\n\t\treturn temp;\n\t}", "public static Stream<Attr> attributesOf(@Nonnull final Element element) {\n\t\treturn streamOf(element.getAttributes()).map(Attr.class::cast); //the nodes should all be instances of Attr in this named node map\n\t}", "@Override\n\tpublic Set<Entry<K, V>> entrySet() {\n\t\tSet<Entry<K, V>> set = new HashSet<Entry<K, V>>();\n\t\tIterator it1 = tabla.iterator();\n\t\tint i = 0;\n\t\twhile (it1.hasNext()) {\n\t\t\tit1.next();\n\t\t\tIterator it2 = tabla.get(i).keySet().iterator();\n\t\t\tint j = 0;\n\t\t\twhile (it2.hasNext()) {\n\t\t\t\tit2.next();\n\t\t\t\tK clave = tabla.get(i).keySet().get(j);\n\t\t\t\tV valor = tabla.get(i).valueSet().get(j);\n\t\t\t\tEntrada<K, V> entry = new Entrada<K, V>(clave, valor);\n\t\t\t\tset.add(entry);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn set;\n\t}", "T set(int index, T element);", "@Override\n\tpublic AttributeSet getAttributes() {\n\t\treturn null;\n\t}", "public Criteria andAttr3EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr3 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "protected Element el(String tag, Node[] childs){\n\t\tElement e = doc.createElement(tag);\n\t\tfor (Node i: childs){\n\t\t\tif (i instanceof Attr) { \n\t\t\t\te.setAttributeNode((Attr)i);\n\t\t\t} else {\n\t\t\t\te.appendChild(i);\n\t\t\t}\n\t\t}\n\t\treturn e;\n\t}", "private SmallAttributeSet\n cacheAttributeSet(final AttributeSet aSet) {\n\n collectGarbageInCache();\n\n Reference r = (Reference)cache.get(aSet);\n SmallAttributeSet as = null;\n if (r != null) {\n as = (SmallAttributeSet)r.get();\n }\n\n if (as == null) {\n as = createSmallAttributeSet(aSet);\n cache.put(as, new WeakReference(as));\n }\n\n return as;\n }", "public int getM_AttributeSetInstance_ID();", "@Override\n\tpublic void setElement(Element element) {\n\t\t\n\t}", "public void getAtributOne() {\n log.info(\"getAtribut: get Attributes\");\n Search search = new Search();\n criteria.clean();\n\n criteria.setFileName(frameSearch.getPnSearch().getTxSearch().getText());\n criteria.setPath(frameSearch.getPnSearch().getTxLocation().getText());\n criteria.setHidden(frameSearch.getPnSearch().getChFileHidden().isSelected());\n criteria.setExtensionEnable(frameSearch.getPnSearch().getChSearchText().isSelected());\n criteria.setNameOwnwe(frameSearch.getTpDataBase().getTxBdata().getText());\n if (frameSearch.getPnSearch().getChKeySensitive().isSelected()) {\n log.debug(\"getAtribut: keySensitive select \" + frameSearch.getPnSearch().getChKeySensitive().isSelected());\n criteria.setKeySensitive(false);\n } else {\n log.debug(\"getAtribut: key sensitive no select \" + !frameSearch.getPnSearch().getChKeySensitive().isSelected());\n criteria.setKeySensitive(true);\n }\n log.info(\"getAtribut: set to criteria\");\n criteria.setFolder(frameSearch.getPnSearch().getChFolder().isSelected());\n criteria.setOwner(frameSearch.getPnSearch().getTxtOwner().getText());\n criteria.setCheckOwner(frameSearch.getPnSearch().getChOwner().isSelected());\n criteria.setReadOnly(frameSearch.getPnSearch().getChReadOnly().isSelected());\n criteria.setContent(frameSearch.getPnSearch().getTxtContent().getText());\n criteria.setCheckContent(frameSearch.getPnSearch().getChContent().isSelected());\n criteria.setCheckMod(frameSearch.getPnAdvanced().getChFechas().isSelected());\n criteria.setCheckCre(frameSearch.getPnAdvanced().getChCreation().isSelected());\n criteria.setChecAccess(frameSearch.getPnAdvanced().getChAccess().isSelected());\n criteria.setCheckSize(frameSearch.getPnAdvanced().getChsSize().isSelected());\n criteria.setSignSize((String) frameSearch.getPnAdvanced().getJcbSize().getSelectedItem());\n ArrayList<Asset> fileList = new ArrayList<>();\n search.searchPath(criteria);\n fileList = (ArrayList<Asset>) search.getResult();\n if (criteria.isExtensionEnable()) {\n ArrayList<String> resul = frameSearch.getPnSearch().getExtencion();\n System.out.println(\"CRIRIA\"+resul.size());\n criteria.setExtencionAux(String.join(\";\", resul));\n System.out.println(\"CRIRIA\"+criteria.getExtencionAux());\n fileList = search.extencion(fileList,criteria);\n }\n if (criteria.isCheckOwner()) {\n log.debug(\"getAtribut: check Owner \" + criteria.isCheckOwner());\n fileList = search.owner(fileList, criteria);\n }\n log.warn(\"getAtribut: check Owner \" + criteria.isCheckOwner());\n if (criteria.isReadOnly()) {\n log.debug(\"getAtribut: check Read Only \" + criteria.isReadOnly());\n fileList = search.searchReadOnly(fileList, criteria);\n }\n log.warn(\"getAtribut: check Read Only \" + criteria.isReadOnly());\n if (criteria.isCheckContent()) {\n log.debug(\"getAtribut: check Content \" + criteria.isCheckContent());\n fileList = search.searchContent(criteria, fileList);\n }\n log.warn(\"getAtribut: check Content \" + criteria.isCheckContent());\n if (frameSearch.getChAdvanced().isSelected()) {\n log.debug(\"getAtribut: check Advanced \" + frameSearch.getChAdvanced().isSelected());\n if (frameSearch.getPnAdvanced().getChsSize().isSelected()) {\n log.debug(\"getAtribut: size select \" + frameSearch.getPnAdvanced().getChsSize().isSelected());\n criteria.setSignSize(frameSearch.getPnAdvanced().getCbSize().getSelectedItem().toString());\n criteria.setType(frameSearch.getPnAdvanced().getJcbSize().getSelectedItem().toString());\n criteria.setSize(Double.parseDouble(frameSearch.getPnAdvanced().getTxSize().getText()));\n fileList = search.searchSze(fileList, criteria);\n }\n if ((frameSearch.getPnAdvanced().getChCreation().isSelected()) | (frameSearch.getPnAdvanced().getChFechas().isSelected()) | (frameSearch.getPnAdvanced().getChAccess().isSelected())) {\n ArrayList<Asset> aux = (ArrayList<Asset>) fileList.clone();\n if (frameSearch.getPnAdvanced().getChCreation().isSelected()) {\n log.debug(\"getAtribut: check date creation \" + frameSearch.getPnAdvanced().getChCreation().isSelected());\n criteria.setIniCreationFile(new Timestamp(frameSearch.getPnAdvanced().getDateCreationOne().getDate().getTime()));\n criteria.setFinCreationFile(new Timestamp(frameSearch.getPnAdvanced().getDateCreationTwo().getDate().getTime()));\n aux = search.searchDateCreation(aux, criteria);\n\n }\n if (frameSearch.getPnAdvanced().getChAccess().isSelected()) {\n log.debug(\"getAtribut: check date access \" + frameSearch.getPnAdvanced().getChAccess().isSelected());\n criteria.setIniAccessFile(new Timestamp(frameSearch.getPnAdvanced().getDateAccessOne().getDate().getTime()));\n criteria.setFinAccessFile(new Timestamp(frameSearch.getPnAdvanced().getDateAccessTwo().getDate().getTime()));\n aux = search.searchDateAccess(aux, criteria);\n\n }\n if (frameSearch.getPnAdvanced().getChFechas().isSelected()) {\n log.debug(\"getAtribut: check date \" + frameSearch.getPnAdvanced().getChFechas().isSelected());\n criteria.setIniModFile(new Timestamp(frameSearch.getPnAdvanced().getDateModificationOne().getDate().getTime()));\n criteria.setFinModFile(new Timestamp(frameSearch.getPnAdvanced().getDateModificationTwo().getDate().getTime()));\n aux = search.searchDateMod(aux, criteria);\n\n }\n fileList = aux;\n }\n if (frameSearch.getPnAdvanced().getChAttributes().isSelected()) {\n log.debug(\"getAtribut: check Attributes \" + frameSearch.getPnAdvanced().getChAttributes().isSelected());\n criteria.setCheckMulti(frameSearch.getPnAdvanced().getChAttributes().isSelected());\n fileList = search.searchMultimedia(fileList, criteria);\n if (frameSearch.getPnAdvanced().getChAtModify().isSelected()) {\n criteria.addItem(\"ASF\");\n }\n if (frameSearch.getPnAdvanced().getChAtHidden().isSelected()) {\n criteria.addItem(\"AVI\");\n }\n if (frameSearch.getPnAdvanced().getChAtFolder().isSelected()) {\n criteria.addItem(\"DIVX\");\n }\n if (frameSearch.getPnAdvanced().getChAtEncriptado().isSelected()) {\n criteria.addItem(\"FLV\");\n }\n if (frameSearch.getPnAdvanced().getChAtReading().isSelected()) {\n criteria.addItem(\"MPEG\");\n }\n if (frameSearch.getPnAdvanced().getChAtSistema().isSelected()) {\n criteria.addItem(\"WMV\");\n }\n if (frameSearch.getPnAdvanced().getChAtComprimido().isSelected()) {\n criteria.addItem(\"MP3\");\n }\n if (frameSearch.getPnAdvanced().getChAtVideo().isSelected()) {\n criteria.addItem(\"MP4\");\n }\n if (criteria.getFormatsMulti().size() > 0) {\n fileList = search.checkMulti(fileList, criteria);\n }\n if (!frameSearch.getPnAdvanced().selectFrame().equals(\"TODO\")) {\n criteria.setFrameRate(frameSearch.getPnAdvanced().selectFrame());\n fileList = search.checkFrame(fileList, criteria);\n }\n if (!frameSearch.getPnAdvanced().selectVideo().equals(\"TODO\")) {\n criteria.setVideoCode(frameSearch.getPnAdvanced().selectVideo());\n fileList = search.checkVideoCode(fileList, criteria);\n }\n if (!frameSearch.getPnAdvanced().selectResolution().equals(\"TODO\")) {\n criteria.setResolution(frameSearch.getPnAdvanced().selectResolution());\n fileList = search.checkResolution(fileList, criteria);\n }\n if (frameSearch.getPnAdvanced().getChTerm().isSelected()) {\n log.debug(\"getAtribut: check termination or extend \" + frameSearch.getPnAdvanced().getChTerm().isSelected());\n criteria.setScale(frameSearch.getPnAdvanced().getScaleDuration());\n criteria.setOperator(frameSearch.getPnAdvanced().getJcbSizeDuration().getSelectedItem().toString());\n criteria.setCantMulti(Double.parseDouble(frameSearch.getPnAdvanced().getTxTerm().getText()));\n fileList = search.searcDuration(fileList, criteria);\n }\n }\n }\n search.gsonCriterio(criteria);\n frameSearch.getTpDataBase().cleanTable();\n this.getCriteriaSaved();\n log.info(\"getAtribut: End\");\n }", "public AttributeSet getClosure(AttributeSet attrs);", "public alluxio.proto.journal.File.SetAttributeEntry.Builder getSetAttributeBuilder() {\n bitField0_ |= 0x08000000;\n onChanged();\n return getSetAttributeFieldBuilder().getBuilder();\n }", "public String getAttributesetarray() {\r\n return attributesetarray;\r\n }", "public Element writePropertysetElement(Document document) {\n Element createElementNS = document.createElementNS(Constants.NS_UPNP_EVENT_10, \"e:propertyset\");\n document.appendChild(createElementNS);\n return createElementNS;\n }", "@Override\n public Set keySet() {\n OmaLista palautettava = new OmaLista();\n\n for (int i = 0; i < this.values.length; i++) {\n if (this.values[i] != null) {\n for (int z = 0; z < this.values[i].size(); z++) {\n palautettava.add(this.values[i].value(z).getKey());\n }\n }\n }\n\n return palautettava;\n }", "private void setAdjuntos(Element element) {\r\n\t\tElement adjuntos = new Element(\"A_AdjuntosReglas\");\r\n\t\tadjuntos.setText(getReq().getObservaciones());\r\n\t\telement.addContent(adjuntos);\r\n\t}", "private void generateAntecedent(Element element, Set<SWRLAtom> antecedent) throws Exception {\n String name = element.getAttribute(\"name\");\n name = TextUtil.formatName(name);\n String operator = element.getAttribute(\"operator\");\n String value = element.getAttribute(\"value\");\n constructAtom(name, antecedent, value, operator);\n //System.out.printf(\"%s %s %s\\n\", name, operator, value);\n }", "Element getElement() {\n\t\tElement result = element.clone();\n\t\tresult.setName(table.getName());\n\t\treturn result;\n\t}", "public alluxio.proto.journal.File.SetAclEntry.Builder getSetAclBuilder() {\n bitField0_ |= 0x04000000;\n onChanged();\n return getSetAclFieldBuilder().getBuilder();\n }", "abstract CharArraySet build();", "public Set<K> e() {\n return new c(this);\n }", "OurIfcMaterialLayerSet createOurIfcMaterialLayerSet();", "public String getElementAttribute(int row, int attr);", "public String getAttributesAsString(Element element) {\n\tStringBuffer sb = new StringBuffer();\n\t\n\tList attrs = element.getAttributes();\n\tif(attrs.size() >0){\n\t\tsb.append(\" [\");;\n\t}else {\n\t\treturn \"\";\n\t}\n\tfor (int i = 0; i< element.getAttributes().size();i++){\n\t\tsb.append( ((Attribute)attrs.get(i)).getName() + \"=\"+ ((Attribute)attrs.get(i)).getValue()+\",\");\n\t}\n\tString rc = sb.toString();\n\tif(rc.charAt(rc.length()-1)==','){\n\t\trc=rc.replaceAll(\",$\", \"]\");\n\t}\n\treturn rc;\n}", "public SeqItemset createExtendedWith(SeqItem it){\n\t\tSeqItemset newSet = new SeqItemset(m_itemset.length+1);\n\t\tSystem.arraycopy(m_itemset,0,newSet.m_itemset, 0, m_itemset.length);\n\t\tnewSet.m_itemset[m_itemset.length] = it;\n\t\treturn newSet;\n\t}", "public void setElement(Element element) {\n this.element = element;\n }", "public HashSet<String> getUsefulAttributes() {\n\t\t \n\t\tHashSet<String> attr = new HashSet<>();\n\t\tQuery firstQ = this.rset.get(1); // get first query on rewriting set 'rset'.\n\t\t\n\t\tGrouping gPart = firstQ.getQueryTriple()._1();\n\t attr.addAll(gPart.getUsefulAttributes());\n\t \n\t Measuring mPart = firstQ.getQueryTriple()._2();\n\t attr.addAll(mPart.getMeasuringAttributes());\n\t \n\t\treturn attr;\n\t}", "public setAttribute_args(setAttribute_args other) {\n if (other.isSetPath()) {\n this.path = other.path;\n }\n if (other.isSetOptions()) {\n this.options = new SetAttributeTOptions(other.options);\n }\n }", "public AttributeSet subtract(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n newElements.remove(iter.next());\n }\n\n return new AttributeSet(newElements);\n }", "public alluxio.proto.journal.File.SetAttributeEntry getSetAttribute() {\n return setAttribute_;\n }", "public void testAssociateStylisticElement() throws Exception {\n try {\n cfg.associateStylisticAndAntiElements(null, null, null);\n fail(\"Expected an IllegalArgumentException\");\n } catch (IllegalArgumentException e) {\n }\n // code block\n {\n String[] children = null;\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 1, children);\n }\n // code block\n {\n String[] children = { \"x\" };\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 1, children);\n }\n // code block\n {\n String[] children = { \"x\", \"y\" };\n createSet(children);\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 2, children);\n }\n // code block\n {\n String[] children = { \"y\", \"zzz\" };\n createSet(children);\n String[] expectedChildren = { \"x\", \"y\", \"zzz\" };\n cfg.associateStylisticAndAntiElements(\"a\", null, permittedChildren);\n verifyStylisticAssociations(1, 3, expectedChildren);\n }\n }", "public TW<E> iterator() {\n ImmutableMultiset immutableMultiset = (ImmutableMultiset) this;\n return new N5(immutableMultiset, immutableMultiset.entrySet().iterator());\n }", "public static Element createElementAttrib(String elementName, String attribName1,String attribValue1,String attribName2,String attribValue2,Document docnew) throws ParserConfigurationException\r\n\t\t{\r\n\t\t\tElement elm = docnew.createElement(elementName);\r\n\t\t\tAttr Id = docnew.createAttribute(attribName1);\r\n\t\t\tId.setValue(attribValue1);\r\n\t\t\telm.setAttributeNode(Id);\r\n\t\t\tif((attribName2.length()>0) &&(attribValue2.length()>0))\r\n\t\t\t{\r\n\t\t\t\tAttr Idd = docnew.createAttribute(attribName2);\r\n\t\t\t\tIdd.setValue(attribValue2);\r\n\t\t\t\telm.setAttributeNode(Idd);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn elm;\r\n\t\t}", "public boolean select(String element, HashMap attributes);", "public void setElement (T element) {\r\n\t\t\r\n\t\tthis.element = element;\r\n\t\r\n\t}", "InlinedStatementConfigurator byElement(CtElement element) {\n\t\tCtStatement stmt = element instanceof CtStatement ? (CtStatement) element : element.getParent(CtStatement.class);\n\t\t//called for first parent statement of all current parameter substitutions\n\t\tstmt.accept(new CtAbstractVisitor() {\n\t\t\t@Override\n\t\t\tpublic void visitCtForEach(CtForEach foreach) {\n\t\t\t\tmarkAsInlined(foreach);\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void visitCtIf(CtIf ifElement) {\n\t\t\t\tmarkAsInlined(ifElement);\n\t\t\t}\n\t\t});\n\t\treturn this;\n\t}", "public gov.nih.nlm.ncbi.www.soap.eutils.efetch_pmc.Attrib getAttrib() {\r\n return attrib;\r\n }", "public String getElementAttribute(int row, int attr, int chromosome);", "public alluxio.proto.journal.File.SetAttributeEntry getSetAttribute() {\n if (setAttributeBuilder_ == null) {\n return setAttribute_;\n } else {\n return setAttributeBuilder_.getMessage();\n }\n }", "@Override\r\n\tpublic MySet intersectSets(MySet[] t) {\r\n\t\tallElements = new ArrayList<Integer>();\r\n\r\n\t\t\r\n\t\tfor(Object element: t[0]) {\r\n\t\t\tallElements.add(element);\r\n\t\t}\r\n\t\r\n\t\tfor(Object e: allElements) {\r\n\t\t\tInteger c = map.getOrDefault(e, 0);\r\n\t\t\tmap.put((E)e, c + 1);\r\n\t\t}\r\n\t\t\r\n\t\tMySet<E> returnSet = (MySet<E>) new Set2<Integer>();\r\n\t\tfor(Map.Entry<E, Integer> entry :map.entrySet())\r\n\t\t\tif(entry.getValue() >= dataSet[0].length) // check\r\n\t\t\t\treturnSet.add(entry.getKey());\r\n\t\t\r\n\t\t\r\n\t\treturn returnSet;\r\n\t}", "public String toString() {\n String str = new String();\n Iterator keys;\n Object key;\n\n keys = cache.keySet().iterator();\n while (keys.hasNext()) {\n key = keys.next();\n\n // Key is instance of AttributeSet (ALWAYS TRUE), print it\n str += key.toString() + \"\\n\";\n }\n\n return str;\n }", "public void setElement(T elem)\n {\n\n element = elem;\n }", "public HashSet getElements() {\n\treturn elements;\n }", "private static Webpage processElementAttributes(Webpage webpage, Element element, String tag) {\n //Current element is already catalogued\n if (Utils.bigHashHasKey(webpage.getElementAttributes(), tag)) {\n //Get current values\n HashMap<String, Integer> elementAttributes = webpage.getSpecificElementAttributes(tag);\n //Cycle through all attributes of the currently analyzed element\n for (Attribute attribute : element.attributes()) {\n String attributeName = Utils.removeLineBreaks(attribute.getKey().toLowerCase());\n //Current attribute is already catalogued for this element, increment it\n if (Utils.hashHasKey(elementAttributes, attributeName))\n elementAttributes = Utils.hashIncreaseValue(elementAttributes, attributeName, 1);\n //Current attribute is new for this element, add it\n else\n elementAttributes.put(attributeName, 1);\n }\n //Add the new values to the web page\n webpage.setSpecificElementAttributes(elementAttributes, tag);\n }\n //Current element is not catalogued, add it\n else {\n //Create new element attributes list\n HashMap<String, Integer> newElement = new HashMap<String, Integer>();\n //Add attributes\n for (Attribute attribute : element.attributes())\n newElement.put(Utils.removeLineBreaks(attribute.getKey().toLowerCase()), 1);\n //Add the new values to the web page\n webpage.setSpecificElementAttributes(newElement, tag);\n }\n return webpage;\n }", "protected void mo3286a(AttributeSet attributeSet) {\n float f = -1.0f;\n setAddStatesFromChildren(true);\n setOrientation(0);\n setGravity(17);\n int i = C2262R.drawable.asanpardakht_rounded_white_box_bg;\n String str = TtmlNode.ANONYMOUS_REGION_ID;\n String str2 = TtmlNode.ANONYMOUS_REGION_ID;\n String str3 = TtmlNode.ANONYMOUS_REGION_ID;\n if (attributeSet != null) {\n TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, C2262R.styleable.asanpardakht_AP);\n i = obtainStyledAttributes.getResourceId(C2262R.styleable.asanpardakht_AP_android_background, C2262R.drawable.asanpardakht_rounded_white_box_bg);\n str = obtainStyledAttributes.getString(C2262R.styleable.asanpardakht_AP_asanpardakht_label);\n str2 = obtainStyledAttributes.getString(C2262R.styleable.asanpardakht_AP_asanpardakht_monthHint);\n str3 = obtainStyledAttributes.getString(C2262R.styleable.asanpardakht_AP_asanpardakht_yearHint);\n f = obtainStyledAttributes.getDimension(C2262R.styleable.asanpardakht_AP_asanpardakht_inputTextSize, -1.0f);\n obtainStyledAttributes.recycle();\n }\n float f2 = f;\n int i2 = i;\n String str4 = str;\n str = str2;\n str2 = str3;\n float f3 = f2;\n if (i2 > 0) {\n setBackgroundResource(i2);\n }\n this.f7350c = (TextView) findViewById(C2262R.id.ap_txt_label);\n this.f7351d = (TextView) findViewById(C2262R.id.ap_txt_separator);\n this.f7348a = (EditText) findViewById(C2262R.id.asanpardakht_edt_card_expiration_month);\n this.f7349b = (EditText) findViewById(C2262R.id.asanpardakht_edt_card_expiration_year);\n this.f7350c.setText(str4);\n this.f7351d.setText(\"/\");\n if (f3 > BitmapDescriptorFactory.HUE_RED) {\n this.f7348a.setTextSize(0, f3);\n this.f7349b.setTextSize(0, f3);\n }\n this.f7348a.setHint(Html.fromHtml(String.format(\"<small>%s</small>\", new Object[]{str})));\n this.f7349b.setHint(Html.fromHtml(String.format(\"<small>%s</small>\", new Object[]{str2})));\n this.f7348a.setNextFocusForwardId(this.f7349b.getId());\n this.f7348a.addTextChangedListener(new C22781(this));\n this.f7349b.addTextChangedListener(new C22792(this));\n setFocusable(true);\n setFocusableInTouchMode(true);\n setOnFocusChangeListener(new C22803(this));\n }", "public Criteria andAttr1EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr1 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "Atributo createAtributo();", "public Builder mergeSetAttribute(alluxio.proto.journal.File.SetAttributeEntry value) {\n if (setAttributeBuilder_ == null) {\n if (((bitField0_ & 0x08000000) == 0x08000000) &&\n setAttribute_ != alluxio.proto.journal.File.SetAttributeEntry.getDefaultInstance()) {\n setAttribute_ =\n alluxio.proto.journal.File.SetAttributeEntry.newBuilder(setAttribute_).mergeFrom(value).buildPartial();\n } else {\n setAttribute_ = value;\n }\n onChanged();\n } else {\n setAttributeBuilder_.mergeFrom(value);\n }\n bitField0_ |= 0x08000000;\n return this;\n }", "private void copyAttributesToElement(NamedNodeMap attributes, Element element) {\n for (int i = 0; i < attributes.getLength(); ++i) {\n Attr toCopy = (Attr) attributes.item(i);\n element.setAttribute(toCopy.getName(), toCopy.getValue());\n }\n }", "public ElementLocationImpl(Element element) {\n ArrayList<String> components = new ArrayList<String>();\n Element ancestor = element;\n while (ancestor != null) {\n components.add(0, ((ElementImpl) ancestor).getIdentifier());\n ancestor = ancestor.getEnclosingElement();\n }\n this.components = components.toArray(new String[components.size()]);\n }", "public final void rule__KeyedElement__ElementAssignment_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:18665:1: ( ( ruleElement ) )\r\n // InternalGo.g:18666:2: ( ruleElement )\r\n {\r\n // InternalGo.g:18666:2: ( ruleElement )\r\n // InternalGo.g:18667:3: ruleElement\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getKeyedElementAccess().getElementElementParserRuleCall_1_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleElement();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getKeyedElementAccess().getElementElementParserRuleCall_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public Object[] getElements(Object inputElement) {\n\t\t\tObject[] resultados = ((Set<Rol>) inputElement).toArray();\n\t\t\treturn resultados;\n\t\t}", "public Iterator iterator() {\n\t return new EntryIterator(set.iterator());\n\t}", "@Override\r\n\tpublic CharacterStateSet createCharacterStateSet() {\r\n\t\tCharacterStateSetImpl characterStateSet = new CharacterStateSetImpl(getDocument());\r\n\t\tList<Element> currentCharElements = getChildrenByTagName(getFormatElement(), \"char\");\r\n\t\tList<Element> currentSetElements = getChildrenByTagName(getFormatElement(), \"set\");\r\n\t\tif ( ! currentCharElements.isEmpty() ) {\r\n\t\t\tElement firstCharElement = currentCharElements.get(0);\r\n\t\t\tgetFormatElement().insertBefore(characterStateSet.getElement(), firstCharElement);\r\n\t\t}\r\n\t\telse if ( ! currentSetElements.isEmpty() ) {\r\n\t\t\tElement firstSetElement = currentSetElements.get(0);\r\n\t\t\tgetFormatElement().insertBefore(characterStateSet.getElement(), firstSetElement);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tgetFormatElement().appendChild( characterStateSet.getElement() );\r\n\t\t}\r\n\t\tmCharacterStateSets.add(characterStateSet);\r\n\t\treturn characterStateSet;\r\n\t}", "public void setElement(T element) {\n\t\tthis.element = element;\n\t}", "protected Map<String, String> getElementAttributes() {\n // Preserve order of attributes\n Map<String, String> attrs = new HashMap<>();\n\n if (this.getName() != null) {\n attrs.put(\"name\", this.getName());\n }\n if (this.getValue() != null) {\n attrs.put(\"value\", this.getValue());\n }\n\n return attrs;\n }", "ElementSetNameType createElementSetNameType();", "public boolean setAttributes(Set<String> foundAttributes);", "public Element(Element element) {\n\t\tElement src = element.clone();\n\n\t\tthis.attributes = src.attributes;\n\t\tthis.name = src.name;\n\t\tthis.defxmlns = src.defxmlns;\n\t\tthis.xmlns = src.xmlns;\n\t\tthis.children = src.children;\n\t}", "@Override\n\tpublic AllegationsElement Elements() {\n\t\treturn new AllegationsElement(driver);\n\t}", "AttributeLayout createAttributeLayout();", "public static AttributeDesignatorType fromElement(Element element) throws SAMLException {\n try {\n JAXBContext jc = SAMLJAXBUtil.getJAXBContext();\n \n javax.xml.bind.Unmarshaller u = jc.createUnmarshaller();\n return (AttributeDesignatorType)u.unmarshal(element);\n } catch ( Exception ex) {\n throw new SAMLException(ex.getMessage());\n }\n }", "private void setUsuario(Element element) {\r\n\t\tUsuario user = (Usuario)Contexts.getSessionContext().get(\"user\");\r\n\t\t\r\n\t\tElement usuario = new Element(\"N_UsuarioAlta\");\r\n\t\tElement uniqueKey = new Element(\"uniqueKey\");\r\n\t\tuniqueKey.setAttribute(\"login_name\", user.getUsername());\r\n\t\tuniqueKey.setAttribute(\"campoCQ\", \"login_name\");\r\n\t\tuniqueKey.setAttribute(\"entidadCQ\", \"users\");\r\n\t\tusuario.addContent(uniqueKey);\r\n\t\telement.addContent(usuario);\r\n\t}", "@Override\n\tpublic ArregloDinamico<V> valueSet() {\n\t\tArregloDinamico<V> respuesta = new ArregloDinamico<V>(N);\n\t\tfor(int i = 0; i<M ; i++)\n\t\t{\n\t\t\tArregloDinamico<NodoTabla<K,V>> temporal = map.darElemento(i).getAll();\n\t\t\tfor(int j=0 ; j < temporal.size() ; j++)\n\t\t\t{\n\t\t\t\tNodoTabla<K,V> elemento = temporal.darElemento(j);\n\t\t\t\tif(elemento != null && elemento.darLlave() != null)\n\t\t\t\t\trespuesta.addLast(elemento.darValor());\t\n\t\t\t}\n\t\t}\n\t\treturn respuesta;\n\t}", "@Override\n\tpublic E set(int idx, E element) {\n\t\tif (element == null) throw new NullPointerException();\n\t\tif (idx < 0 || idx >= size()) throw new IndexOutOfBoundsException();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (element.equals(list[i]))\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tE output = null;\n\t\toutput = list[idx];\n\t\tlist[idx] = element;\n\t\treturn output;\n\t}", "public void setElement(Object e) {\n element = e;\n }", "List<Attribute<T, ?>> getAttributes();", "public void setElement(E element) {\n\t\t\tthis.element = element;\n\t\t}", "PreparedStatement smem_setup_web_crawl(WeightedCueElement el) throws SQLException\n {\n PreparedStatement q = null;\n \n // first, point to correct query and setup\n // query-specific parameters\n if(el.element_type == smem_cue_element_type.attr_t)\n {\n // attribute_s_id=?\n q = db.web_attr_all;\n }\n else if(el.element_type == smem_cue_element_type.value_const_t)\n {\n // attribute_s_id=? AND value_constant_s_id=?\n q = db.web_const_all;\n q.setLong(2, el.value_hash);\n }\n else if(el.element_type == smem_cue_element_type.value_lti_t)\n {\n q = db.web_lti_all;\n q.setLong(2, el.value_lti);\n }\n \n // all require hash as first parameter\n q.setLong(1, el.attr_hash);\n \n return q;\n }", "public HashMap getElement(Selector selector) {\n \t\t\tif (selector == null)\n \t\t\t\treturn null;\n \n \t\t\tString element;\n \t\t\tfor (int i = 0; i < elements.size(); i++) {\n \t\t\t\t// make pre-parse selector call\n \t\t\t\telement = (String) elements.get(i);\n \t\t\t\tif (selector.select(element)) {\n \t\t\t\t\t// parse selected entry\n \t\t\t\t\tHashMap attributes = new HashMap();\n \t\t\t\t\tString elementName;\n \t\t\t\t\tint j;\n \t\t\t\t\t// parse out element name\n \t\t\t\t\tfor (j = 0; j < element.length(); j++) {\n \t\t\t\t\t\tif (Character.isWhitespace(element.charAt(j)))\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tif (j >= element.length()) {\n \t\t\t\t\t\telementName = element;\n \t\t\t\t\t} else {\n \t\t\t\t\t\telementName = element.substring(0, j);\n \t\t\t\t\t\telement = element.substring(j);\n \t\t\t\t\t\t// parse out attributes\n \t\t\t\t\t\tStringTokenizer t = new StringTokenizer(element, \"=\\\"\"); //$NON-NLS-1$\n \t\t\t\t\t\tboolean isKey = true;\n \t\t\t\t\t\tString key = \"\"; //$NON-NLS-1$\n \t\t\t\t\t\twhile (t.hasMoreTokens()) {\n \t\t\t\t\t\t\tString token = t.nextToken().trim();\n \t\t\t\t\t\t\tif (!token.equals(\"\")) { //$NON-NLS-1$\n \t\t\t\t\t\t\t\t// collect (key, value) pairs\n \t\t\t\t\t\t\t\tif (isKey) {\n \t\t\t\t\t\t\t\t\tkey = token;\n \t\t\t\t\t\t\t\t\tisKey = false;\n \t\t\t\t\t\t\t\t} else {\n \t\t\t\t\t\t\t\t\tattributes.put(key, token);\n \t\t\t\t\t\t\t\t\tisKey = true;\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t// make post-parse selector call\n \t\t\t\t\tif (selector.select(elementName, attributes)) {\n \t\t\t\t\t\tattributes.put(\"<element>\", elementName); //$NON-NLS-1$\n \t\t\t\t\t\treturn attributes;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\treturn null;\n \t\t}", "public E set(int index, E element) {\n\t\tif(index < 0 || index > size) {\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\t} else if(index == size) {\r\n\t\t\tadd(element);\r\n\t\t\treturn element;\r\n\t\t}\r\n\t\tE e = getNode(index).getData();\r\n\t\tgetNode(index).setData(element);\r\n\t\treturn e;\r\n\t}", "public void setElement(E element)\n\t{\n\t\tthis.data = element;\n\t}", "Set createSet();", "public Criteria andAttr4EqualToColumn(BDicTreeCode.Column column) {\n addCriterion(new StringBuilder(\"attr4 = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }", "@Override\r\n public boolean equals(Object object)\r\n {\n if (!(object instanceof Attributesetinstance))\r\n {\r\n return false;\r\n }\r\n Attributesetinstance other = (Attributesetinstance) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))\r\n {\r\n return false;\r\n }\r\n return true;\r\n }" ]
[ "0.6229564", "0.6118462", "0.57212764", "0.5680495", "0.55171174", "0.5353464", "0.53435004", "0.53306234", "0.5097997", "0.50660765", "0.49740654", "0.4895829", "0.48138514", "0.47945586", "0.47856963", "0.47839087", "0.46347427", "0.46016854", "0.4576596", "0.45038158", "0.4466329", "0.4329163", "0.4328539", "0.4321147", "0.4297305", "0.42751536", "0.4207232", "0.41989255", "0.4177158", "0.41721615", "0.41550472", "0.41408104", "0.4140323", "0.41311264", "0.4107963", "0.40865517", "0.40820384", "0.40815574", "0.4079981", "0.40774432", "0.4074809", "0.40712765", "0.4059161", "0.40566754", "0.40489477", "0.40448275", "0.40300363", "0.402674", "0.40237", "0.40074915", "0.40045232", "0.40011963", "0.39867297", "0.39669728", "0.3958346", "0.39507705", "0.39484525", "0.39428723", "0.39279383", "0.3917174", "0.39141473", "0.39067003", "0.39042675", "0.39009032", "0.38932353", "0.3891845", "0.38803557", "0.38738763", "0.38668656", "0.38661787", "0.3863919", "0.38435793", "0.38400593", "0.38381493", "0.38343507", "0.38336915", "0.38285008", "0.38249135", "0.38242286", "0.38241962", "0.38142332", "0.38104168", "0.38056076", "0.38042727", "0.3803875", "0.38026774", "0.3796466", "0.37939295", "0.3785418", "0.37776038", "0.3775316", "0.37719095", "0.37685782", "0.3768416", "0.37674993", "0.37651083", "0.3763342", "0.3757474", "0.3756468", "0.3750756" ]
0.69513124
0
Return an AttributeSet which is the union of this set with the given set.
public AttributeSet unionWith(AttributeSet s) { Hashtable newElements = (Hashtable) elements.clone(); Iterator iter = s.iterator(); while (iter.hasNext()) { Object next = iter.next(); newElements.put(next, next); } return new AttributeSet(newElements); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ZYSet<ElementType> union(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n result.add(e);\n }\n for(ElementType e :otherSet){\n result.add(e);\n }\n \n return result;\n }", "public Set union(Set in_set) throws SetException {\n\t\tSet union = new Set(this);\n\t\tfor (Object element : in_set.list) {\n\t\t\tif (!member(element))\n\t\t\t\tunion.addItem(element);\n\t\t}\n\t\treturn union;\n\t}", "protected <Ty> HashSet<Ty> union(HashSet<Ty> setA, HashSet<Ty> setB) {\n HashSet<Ty> retSet = new HashSet<>();\n retSet.addAll(setA);\n retSet.addAll(setB);\n return retSet;\n }", "public Units union(Units set)\n\t{\n\t\tUnits result = new Units(this);\n\n\t\tresult.addAll(set);\n\n\t\treturn result;\n\t}", "public ISet<E> union(ISet<E> otherSet) {\n\t\tif (otherSet == null)\n\t\t\tthrow new IllegalArgumentException(\"The given set is null.\");\n\t\tISet<E> result = this.difference(otherSet);\n\t\tresult.addAll(this.intersection(otherSet));\n\t\tresult.addAll(otherSet.difference(this));\n\t\treturn result;\n\t}", "public SetSet setUnion(SetSet second){\n\t\tSetSet result = new SetSet(contents);\n\t\tfor(int i=0;i<second.size();i++){\n\t\t\tresult.add(second.get(i));\n\t\t}\n\t\treturn result;\n\t}", "public BSTSet union(BSTSet s) {\n int[] thisArray = BSTToArray();\n int[] sArray = s.BSTToArray();\n int[] unionArray = new int[thisArray.length + sArray.length];\n int unionArrayIndex = 0;\n\n // add both arrays together\n for (int i = 0; i < thisArray.length; i++) {\n unionArray[unionArrayIndex++] = thisArray[i];\n }\n\n for (int i = 0; i < sArray.length; i++) {\n unionArray[unionArrayIndex++] = sArray[i];\n }\n\n return new BSTSet(unionArray);\n }", "public static FlavorSet union(FlavorSet a, FlavorSet b) {\n if (a.isEmpty()) {\n return b;\n } else if (b.isEmpty()) {\n return a;\n } else {\n return new FlavorSet(\n Stream.concat(a.flavors.stream(), b.flavors.stream())\n .collect(ImmutableSortedSet.toImmutableSortedSet(FLAVOR_ORDERING)));\n }\n }", "public static <T> Set<T> union(final Set<T> a, final Set<T> b) {\n return new Set<T>() {\n public boolean has(final T n) {\n return a.has(n) || b.has(n);\n }\n };\n }", "public Set union(Set join){\n Set newSet = new Set();\n for(int element = 0; element < join.size(); element++){\n if (!elementOf(join.getSet()[element]))\n newSet.add(join.getSet()[element]);\n }\n for(int element = 0; element < set.length; element++){\n newSet.add(set[element]);\n }\n return newSet;\n }", "public AttributeSet intersectWith(AttributeSet s) {\n\n Hashtable newElements = new Hashtable();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n if (elements.get(next) != null) {\n newElements.put(next, next);\n }\n }\n\n return new AttributeSet(newElements);\n }", "public static Set unionRaw(Set s1, Set s2) {\n\t\t// Warning : HashSet is a raw type. References to generic type HashSet<E> should\n\t\t// be parameterized\n\t\tSet result = new HashSet(s1);\n\t\t// Warning : Type safety: The method addAll(Collection) belongs to the raw type\n\t\t// Set. References to generic type Set<E> should be parameterized\n\t\tresult.addAll(s2);\n\t\treturn result;\n\t}", "@Override\n public IntSet union(IntSet other) {\n return other;\n }", "public void unionSet(NSSet<? extends E> otherSet) {\n\t\tthis.wrappedSet.addAll(otherSet.getWrappedSet());\n\t}", "public static Set<Doc> or(Set<Doc> set1, Set<Doc> set2) {\r\n \t\tif(set1 == null)\r\n \t\t\tset1 = new TreeSet<Doc>();\r\n \t\tif(set2 == null)\r\n \t\t\tset2 = new TreeSet<Doc>();\r\n \t\t\r\n \t\tTreeSet<Doc> result = new TreeSet<Doc>(set1);\r\n \t\tresult.addAll(set2);\r\n \t\treturn result;\r\n \t}", "@SafeVarargs\n public static <T> Set<T> union(Set<T>... sets) {\n if (sets == null) return set();\n Set<T> result = set();\n for (Set<T> s : sets) {\n if (s != null) result.addAll(s);\n }\n return result;\n }", "private static <T> Set<T> union(Collection<T> c1, Collection<T> c2) {\n return Stream.concat(c1.stream(), c2.stream()).collect(Collectors.toUnmodifiableSet());\n }", "public static <T> Set<T> union(Set<? extends T> s1, Set<? extends T> s2) {\n Set<T> result = new HashSet<>(s1);\n result.addAll(s2);\n return result;\n }", "@Override\n public SetInterface<T> union(SetInterface<T> rhs) {\n //Declare return SetInterface\n SetInterface<T> answer = new ArraySet();\n //Add the items from the calling ArraySet to the return Set\n for (int i = 0; i < this.numItems; i++){\n answer.addItem(arr[i]);\n }\n //Convert the other set to an array in case it isnt and to \n //ease iteration\n T[] other = rhs.toArray();\n //Add the items from RHS to return Set\n for (int j = 0; j < rhs.getSize(); j++){\n answer.addItem(other[j]);\n }\n //Return the answer\n return answer; \n }", "@Override\n public SetInterface<T> union(SetInterface<T> rhs) {\n //create return SetInterface\n SetInterface<T> result = new LinkedSet();\n //add the items from the calling set to the result set\n Node n = first;\n while(n != null){\n result.addItem(n.value);\n n = n.next;\n }\n \n //convert rhs to an array so we know what we're dealing with\n T[] rhsArr = rhs.toArray();\n //add the items from rhsArr to result\n for(int i = 0; i < rhsArr.length; i++){\n result.addItem(rhsArr[i]);\n }\n \n return result;\n }", "public AttributeSet flatCopy() {\r\n AttributeSet res = new AttributeSet();\r\n for (String k : getAllAttributes()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "@Override\n public SetI union(SetI other) {\n Set o;\n\n if (!(other instanceof Set)) {\n // Different Set impl. Convertion needed.\n // Will impact performance.\n o = Set.fromAnotherImpl(other);\n }\n else {\n o = (Set) other;\n }\n\n int[] newArr = new int[count + o.count];\n int i = 0, j = 0, k = 0;\n\n // Merge sorted arrays.\n while (i < count && j < o.count) {\n // Skip duplicated elements.\n if (contains(o.arr[j])) {\n ++j;\n }\n else if (arr[i] < o.arr[j]) {\n newArr[k++] = arr[i++];\n }\n else {\n newArr[k++] = o.arr[j++];\n }\n }\n\n while (i < count) {\n newArr[k++] = arr[i++];\n }\n\n while (j < o.count) {\n // Skip duplicated elements.\n if (!contains(o.arr[j])) {\n newArr[k++] = o.arr[j];\n }\n ++j;\n }\n\n return new Set(newArr, k);\n }", "public Set xor(Set in_set) throws SetException {\n\t\tSet temp = union(in_set);\n\t\ttemp.removeItems(intersection(in_set));\n\n\t\treturn temp;\n\t}", "public static IntervalSet or(IntervalSet[] sets) {\n\t\tIntervalSet r = new IntervalSet();\n\t\tfor (IntervalSet s : sets)\n\t\t\tr.addAll(s);\n\t\treturn r;\n\t}", "public Bag union(Bag u) {\n return u;\n }", "public AttributeSet immutable() {\r\n return ImmutableAttributeSet.copyOf(this);\r\n }", "public void unionOf(IntegerSet set1, IntegerSet set2) {\n get = new int[0];\n for (int i : set1.get)\n insertElement(i);\n for (int i : set2.get)\n insertElement(i);\n }", "@Test\n\t public void test_Union_Set_Same() throws Exception{\n\t\t int[] setarray1= new int[]{1,2,3};\n\t\t int[] setarray2= new int[]{1,2,3};\n\t\t SET set = new SET(setarray1);\n\t\t int returnedArrOperation[] =set.Union(setarray1,setarray2); \n\t\t int []expectedArr = new int[] {1,2,3};\n\t\t Assert.assertArrayEquals( expectedArr, returnedArrOperation );\n\t }", "public Units intersection(Units set)\n\t{\n\t\tUnits result = new Units();\n\n\t\tfor (Unit unit : this)\n\t\t{\n\t\t\tif (set.contains(unit))\n\t\t\t{\n\t\t\t\tresult.add(unit);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public static Set unmodifiableSet(Set set) {\n/* 175 */ return UnmodifiableSet.decorate(set);\n/* */ }", "public Set Union(Set secondSet) {\n\t\t\n\t\tArrayList<String> firstArray = noDuplicates(stringArray);\n\t\t// Taking out duplications out of our sets by calling the noDuplicates private function\n\t\tArrayList<String> secondArray = noDuplicates(secondSet.returnArray());\n\t\t\n\t\tArrayList<String> unionOfBoth = new ArrayList<String>();\n\t\t// New ArrayList to hold the final values\n\t\t\n\t\tfor (int i=0; i < 10; i++) {\n\t\t\tif (firstArray.size() > i) {\n\t\t\t\tif (unionOfBoth.contains(firstArray.get(i)) == false && firstArray.get(i).equals(\"emptyElement\") == false) {\n\t\t\t\t\tunionOfBoth.add(firstArray.get(i));\n\t\t\t\t\t// If our final ArrayList does not already contain the element, and the item is not an empty string\n\t\t\t\t\t// (Does not contain the phrase \"emptyElement\"), then add it to our final ArrayList\n\t\t\t\t}\n\t\t\t\telse if (unionOfBoth.contains(firstArray.get(i)) == false && firstArray.get(i).equals(\"emptyElement\")) {\n\t\t\t\t\tunionOfBoth.add(\"\");\n\t\t\t\t\t// If our final ArrayList does not already contain the element, but the item is an empty string\n\t\t\t\t\t// (Does contain the phrase \"emptyElement\"), then add an empty string to our final ArrayList\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (secondArray.size() > i) {\n\t\t\t\tif (unionOfBoth.contains(secondArray.get(i)) == false && secondArray.get(i).equals(\"emptyElement\") == false) {\n\t\t\t\t\tunionOfBoth.add(secondArray.get(i));\n\t\t\t\t\t// If our final ArrayList does not already contain the element, and the item is not an empty string\n\t\t\t\t\t// (Does not contain the phrase \"emptyElement\"), then add it to our final ArrayList\n\t\t\t\t}\n\t\t\t\telse if (unionOfBoth.contains(secondArray.get(i)) == false && secondArray.get(i).equals(\"emptyElement\")) {\n\t\t\t\t\tunionOfBoth.add(\"\");\n\t\t\t\t\t// If our final ArrayList does not already contain the element, but the item is an empty string\n\t\t\t\t\t// (Does contain the phrase \"emptyElement\"), then add an empty string to our final ArrayList\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSet unionReturn = new Set(unionOfBoth); // Initiate a Set object from out final ArrayList\n\t\t\n\t\treturn unionReturn; // Return the final Set Object\n\t}", "@Override\n\tpublic SetLinkedList<T> union(SetLinkedList<T> otherSet) {\n\t\tthrow new UnsupportedOperationException(\"Not implemented yet!\");\n\t}", "private Set buildSet(String attrName, Map attributes, Set resultSet) {\n Set vals = (Set) attributes.get(attrName);\n if ((vals != null) && !vals.isEmpty()) {\n resultSet.addAll(vals);\n }\n return (resultSet);\n }", "@Test\r\n public void testUnion1() {\r\n int actual[] = set1.unionOfSets(set2);\r\n Assert.assertArrayEquals(new int[] { 1, 2, 3, 4, 5 }, actual);\r\n }", "public ArrayList<Predmet> union(ArrayList<ArrayList<Predmet>> listU){\n\t\tSet<Predmet> set = new HashSet<Predmet>();\n\t\t\n\t\tfor(ArrayList<Predmet> p : listU)\n\t\t\tset.addAll(p);\n\t\t\n\t\treturn new ArrayList<Predmet>(set);\n\t}", "public AttributeSet copy() {\r\n AttributeSet res = new AttributeSet(parent.orNull());\r\n for (String k : attributeMap.keySet()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "public alluxio.proto.journal.File.SetAclEntry.Builder getSetAclBuilder() {\n bitField0_ |= 0x04000000;\n onChanged();\n return getSetAclFieldBuilder().getBuilder();\n }", "public FeatureSet combine(final FeatureSet other) {\n final Set<Feature> enabled = new HashSet<>(this.enabled);\n enabled.addAll(other.enabled);\n\n final Set<Feature> disabled = new HashSet<>(this.disabled);\n disabled.addAll(other.disabled);\n\n return new FeatureSet(enabled, disabled);\n }", "@Test\n\tpublic void testAddAll() {\n\t Set<Integer> setA = new HashSet<>(Arrays.asList(1, 2, 3, 4, 5));\n\t Set<Integer> setB = new HashSet<>(Arrays.asList(9, 8, 7, 6, 5, 4, 3));\n\t setA.addAll(setB);\n\t Set<Integer> union = new HashSet<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9));\n\t assertEquals(setA, union);\n }", "public final HashSet<Attribute> attributeSet() {\n final HashSet<Attribute> set = new HashSet<Attribute>();\n\n for (int i = 0; i < m_body.size(); i++) {\n final Condition c = m_body.get(i);\n set.add(c.getAttr());\n }\n\n return set;\n }", "public AttributeSet subtract(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n newElements.remove(iter.next());\n }\n\n return new AttributeSet(newElements);\n }", "public UnmodifiableBitSet orBitSet(BitSet bs){\n\t\tUnmodifiableBitSet nbs = (UnmodifiableBitSet)this.clone();\n\t\tnbs.orBitSetInn(bs);\n\t\treturn nbs;\n\t}", "public ZYSet<ElementType> intersection(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n if(otherSet.contains(e)){\n result.add(e);\n }\n }\n return result;\n }", "@Test(expected = NullPointerException.class)\r\n\t\tpublic void testUnionWithNullInput() {\n\t\t\ttestingSet = new IntegerSet(null);\r\n\t\t\ttestingSet2= new IntegerSet(null); \r\n\t\t\t// union of 2 sets should result in null value \r\n\t\t\ttestingSet3= testingSet.union(testingSet, testingSet2);\r\n\t\t\t\r\n\t\t}", "@Override\n public SetInterface<T> symmDifference(SetInterface<T> rhs) {\n return this.difference(rhs).union(rhs.difference(this));\n }", "public Set setDifference(Set diff){\n Set newSet = new Set();\n for(int element = 0; element < set.length; element++){\n if(!diff.elementOf(set[element]))\n newSet.add(set[element]);\n }\n return newSet;\n }", "public static java.util.Set unmodifiableSet(java.util.Set arg0)\n { return null; }", "public static SortedSet unmodifiableSortedSet(SortedSet set) {\n/* 276 */ return UnmodifiableSortedSet.decorate(set);\n/* */ }", "@Test\r\n\t\tpublic void testUnion() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// 3rd set =to the union of the two lists \r\n\t\t\ttestingSet3= new IntegerSet(union);\r\n\t\t\t// 4th set equal to the union of sets 1 and 2 \r\n\t\t\ttestingSet4= testingSet.union(testingSet, testingSet2);\r\n\t\t\t// sets 3 and 4 should be equal\r\n\t\t\t// assertEquals method is deprecated \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\r\n\t\t\t \r\n\t\t}", "public static ImmutableGraph union( final ImmutableGraph g0, final ImmutableGraph g1 ) {\n\t\treturn g0 instanceof ArcLabelledImmutableGraph && g1 instanceof ArcLabelledImmutableGraph \n\t\t\t? union( (ArcLabelledImmutableGraph)g0, (ArcLabelledImmutableGraph)g1, (LabelMergeStrategy)null )\n\t\t\t\t\t: new UnionImmutableGraph( g0, g1 );\n\t}", "public Builder mergeSetAcl(alluxio.proto.journal.File.SetAclEntry value) {\n if (setAclBuilder_ == null) {\n if (((bitField0_ & 0x04000000) == 0x04000000) &&\n setAcl_ != alluxio.proto.journal.File.SetAclEntry.getDefaultInstance()) {\n setAcl_ =\n alluxio.proto.journal.File.SetAclEntry.newBuilder(setAcl_).mergeFrom(value).buildPartial();\n } else {\n setAcl_ = value;\n }\n onChanged();\n } else {\n setAclBuilder_.mergeFrom(value);\n }\n bitField0_ |= 0x04000000;\n return this;\n }", "public SecurityMetadataUniversalSet build() {\n return new SecurityMetadataUniversalSet(this);\n }", "public SetSet deepCopy(){\n\t\tSetSet copy = new SetSet();\n\t\tfor(int i=0;i<size();i++){\n\t\t\tcopy.add(get(i).deepCopy());\n\t\t}\n\t\treturn copy;\n\t}", "@Test\n\tpublic void testUnionSLLSetArrayAll0() {\n\n\t\tint[] arr1 = { 0, 0, 0 };\n\t\tint[] arr2 = { 0, 0, 0, 0 };\n\t\tint[] arr3 = { 0, 0 };\n\t\tint[] arr4 = { 0, 0 };\n\t\tSLLSet listObj100 = new SLLSet(arr1);\n\t\tSLLSet listObj99 = new SLLSet(arr2);\n\t\tSLLSet listObj98 = new SLLSet(arr3);\n\t\tSLLSet listObj97 = new SLLSet(arr4);\n\t\tSLLSet listObj96 = new SLLSet();\n\t\tSLLSet[] Array = { listObj100, listObj99, listObj98, listObj97, listObj96 }; // test static SLLSet union(sArray)\n\n\t\tSLLSet listObj23 = SLLSet.union(Array);\n\n\t\tString expected = \"0\";\n\t\tint expectedSize = 1;\n\n\t\tassertEquals(expectedSize, listObj23.getSize());\n\t\tassertEquals(expected, listObj23.toString());\n\n\t}", "public static <T> OrdinalSet<T> unify(OrdinalSet<T> A, OrdinalSet<T> B) {\r\n if (A == null) {\r\n throw new IllegalArgumentException(\"A is null\");\r\n }\r\n if (B == null) {\r\n throw new IllegalArgumentException(\"B is null\");\r\n }\r\n if (Assertions.verifyAssertions) {\r\n if (A.size() != 0 && B.size() != 0) {\r\n Assertions._assert(A.mapping.equals(B.mapping));\r\n }\r\n }\r\n \r\n if (A.S != null && B.S == null) {\r\n return new OrdinalSet<T>(A.S, A.mapping);\r\n } else if (A.S == null && B.S != null) {\r\n return new OrdinalSet<T>(B.S, B.mapping);\r\n }\r\n \r\n IntSet union = A.S.union(B.S);\r\n return new OrdinalSet<T>(union, A.mapping);\r\n }", "public VertexSet intersection(VertexSet ot) {\r\n\t\tVertexSet ans = new VertexSet();\r\n\t\tint i1=0,i2=0;\r\n\t\twhile(i1<this.size() & i2 < ot.size()) {\r\n\t\t\tint a1=this.at(i1), a2 = ot.at(i2);\r\n\t\t\tif(a1==a2) {\r\n\t\t\t\tans.add(a1); i1++; i2++;}\r\n\t\t\telse if(a1<a2) {i1++;}\r\n\t\t\telse i2++;\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public T union( T obj1, T obj2 )\n {\n // Find the root of each object; if either is not contained, the root\n // value will be null, and we throw an exception.\n Node root1 = getRoot(nodes.get(obj1));\n Node root2 = getRoot(nodes.get(obj2));\n if ( root1 == null && root2 == null )\n throw new NoSuchElementException( \"Sets do not contain either object: \" + obj1 + \", \" + obj2 );\n if ( root1 == null )\n throw new NoSuchElementException( \"Sets do not contain object: \" + obj1 );\n if ( root2 == null )\n throw new NoSuchElementException( \"Sets do not contain object: \" + obj2 );\n // If already were in same set, just return data from the root of that\n // set.\n if ( root1 == root2 )\n return root1.data;\n // If not already, then doing union reduces overall number of sets.\n numSets-- ;\n // We use root2 as the new parent if either (a) the trees containing\n // both inputs have same rank and a \"coin toss\" settles on this case,\n // or (b) the tree containing obj1 has lower rank.\n if ( ( root1.rank == root2.rank && Math.random() < 0.5 ) || root1.rank < root2.rank )\n {\n // When we link root1 to root2, size of set under root2 inreases.\n root1.parent = root2;\n root2.size += root1.size;\n \n // When we union two sets of same rank, new root gets higher rank.\n if ( root1.rank == root2.rank )\n root2.rank++ ;\n \n return root2.data;\n }\n else\n // We use root1 as the new parent if either (a) the trees containing\n // both inputs have same rank and a \"coin toss\" settles on this\n // case, or (b) the tree containing obj2 has lower rank.\n {\n // When we link root1 to root2, size of set under root2 inreases.\n root2.parent = root1;\n root1.size += root2.size;\n \n // When we union two sets of same rank, new root gets higher rank.\n if ( root1.rank == root2.rank )\n root1.rank++ ;\n \n return root1.data;\n }\n }", "public static Set orderedSet(Set set) {\n/* 236 */ return (Set)ListOrderedSet.decorate(set);\n/* */ }", "private static HashSet<Annotation> setDifference(HashSet<Annotation> setA,\r\n\t\t\tHashSet<Annotation> setB) {\r\n\r\n\t\tHashSet<Annotation> tmp = new HashSet<Annotation>(setA);\r\n\t\ttmp.removeAll(setB);\r\n\t\treturn tmp;\r\n\t}", "public Builder setCharSet(List<Character> charSet){\n mCharSet = charSet;\n return this;\n }", "public OrderedSet difference (OrderedSet set) {\n if (set == null)\n return null;\n boolean oldshow = show;\n boolean oldshowErro = showErro;\n show = false;\n showErro = false;\n for (DoubleLinkedList p=first; p!=null; p=p.getNext()) {\n Object info = p.getInfo();\n if (set.dictionary.get(info) != null)\n\tremove(info);\n }\n show = oldshow;\n showErro = oldshowErro;\n return this;\n }", "public static Set<Doc> and(Set<Doc> set1, Set<Doc> set2) {\r\n \t\t\r\n \t\tif((set1 == null) || (set2 == null)) {\r\n\t\t\tSystem.err.println(\"Doc.and() returning null!\");\r\n \t\t\treturn new TreeSet<Doc>();\r\n \t\t}\r\n \t\t//set1.retainAll(set2);\r\n \t\t//return set1;\r\n \t\t\r\n \t\tTreeSet<Doc> result = new TreeSet<Doc>();\r\n \t\tIterator<Doc> op1 = set1.iterator();\r\n \t\tIterator<Doc> op2 = set2.iterator();\r\n \t\t\r\n \t\tDoc current1 = getNext(op1);\r\n \t\tDoc current2 = getNext(op2);\r\n \r\n \t\twhile(current1!=null && current2!=null) {\r\n \t\t\t//If is the same document\r\n \t\t\tif(current1.getID() == current2.getID()) {\r\n \t\t\t\tresult.add(current1);\r\n \t\t\t\tcurrent1 = getNext(op1);\r\n \t\t\t\tcurrent2 = getNext(op2);\r\n \t\t\t}\r\n \t\t\t//If op2 is ahead of op1\r\n \t\t\telse if(current1.getID() < current2.getID()) \r\n \t\t\t\tcurrent1 = getNext(op1);\r\n \t\t\t//If op1 is ahead of op2\r\n \t\t\telse\r\n \t\t\t\tcurrent2 = getNext(op2);\r\n \t\t}\r\n \t\t\r\n \t\treturn result;\r\n \t}", "public RegexNode ReduceSet()\n\t{\n\t\t// Extract empty-set, one and not-one case as special\n\n\t\tif (RegexCharClass.IsEmpty(_str))\n\t\t{\n\t\t\t_type = Nothing;\n\t\t\t_str = null;\n\t\t}\n\t\telse if (RegexCharClass.IsSingleton(_str))\n\t\t{\n\t\t\t_ch = RegexCharClass.SingletonChar(_str);\n\t\t\t_str = null;\n\t\t\t_type += (One - Set);\n\t\t}\n\t\telse if (RegexCharClass.IsSingletonInverse(_str))\n\t\t{\n\t\t\t_ch = RegexCharClass.SingletonChar(_str);\n\t\t\t_str = null;\n\t\t\t_type += (Notone - Set);\n\t\t}\n\n\t\treturn this;\n\t}", "Set createSet();", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "public Criteria or() {\r\n\t\tCriteria criteria = createCriteriaInternal();\r\n\t\toredCriteria.add(criteria);\r\n\t\treturn criteria;\r\n\t}", "private void init(final AttributeSet set) {\n }", "public RegexNode ReduceAlternation()\n\t{\n\t\t// Combine adjacent sets/chars\n\n\t\tboolean wasLastSet;\n\t\tboolean lastNodeCannotMerge;\n\t\tRegexOptions optionsLast;\n\t\tRegexOptions optionsAt;\n\t\tint i;\n\t\tint j;\n\t\tRegexNode at;\n\t\tRegexNode prev;\n\n\t\tif (_children == null)\n\t\t{\n\t\t\treturn new RegexNode(RegexNode.Nothing, _options);\n\t\t}\n\n\t\twasLastSet = false;\n\t\tlastNodeCannotMerge = false;\n\t\toptionsLast = RegexOptions.forValue(0);\n\n\t\tfor (i = 0, j = 0; i < _children.size(); i++, j++)\n\t\t{\n\t\t\tat = _children.get(i);\n\n\t\t\tif (j < i)\n\t\t\t{\n\t\t\t\t_children.set(j, at);\n\t\t\t}\n\n\t\t\tfor (;;)\n\t\t\t{\n\t\t\t\tif (at._type == Alternate)\n\t\t\t\t{\n\t\t\t\t\tfor (int k = 0; k < at._children.size(); k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tat._children.get(k)._next = this;\n\t\t\t\t\t}\n\n\t\t\t\t\t//_children.InsertRange(i + 1, at._children);\n\t\t\t\t\t_children.addAll(i + 1, at._children);\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t\telse if (at._type == Set || at._type == One)\n\t\t\t\t{\n\t\t\t\t\t// Cannot merge sets if L or I options differ, or if either are negated.\n\t\t\t\t\toptionsAt = RegexOptions.forValue(at._options.getValue() & (RegexOptions.RightToLeft.getValue() | RegexOptions.IgnoreCase.getValue()));\n\n\n\t\t\t\t\tif (at._type == Set)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge || !RegexCharClass.IsMergeable(at._str))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twasLastSet = true;\n\t\t\t\t\t\t\tlastNodeCannotMerge = !RegexCharClass.IsMergeable(at._str);\n\t\t\t\t\t\t\toptionsLast = optionsAt;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (!wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge)\n\t\t\t\t\t{\n\t\t\t\t\t\twasLastSet = true;\n\t\t\t\t\t\tlastNodeCannotMerge = false;\n\t\t\t\t\t\toptionsLast = optionsAt;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// The last node was a Set or a One, we're a Set or One and our options are the same.\n\t\t\t\t\t// Merge the two nodes.\n\t\t\t\t\tj--;\n\t\t\t\t\tprev = _children.get(j);\n\n\t\t\t\t\tRegexCharClass prevCharClass;\n\t\t\t\t\tif (prev._type == RegexNode.One)\n\t\t\t\t\t{\n\t\t\t\t\t\tprevCharClass = new RegexCharClass();\n\t\t\t\t\t\tprevCharClass.AddChar(prev._ch);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprevCharClass = RegexCharClass.Parse(prev._str);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (at._type == RegexNode.One)\n\t\t\t\t\t{\n\t\t\t\t\t\tprevCharClass.AddChar(at._ch);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tRegexCharClass atCharClass = RegexCharClass.Parse(at._str);\n\t\t\t\t\t\tprevCharClass.AddCharClass(atCharClass);\n\t\t\t\t\t}\n\n\t\t\t\t\tprev._type = RegexNode.Set;\n\t\t\t\t\tprev._str = prevCharClass.ToStringClass();\n\n\t\t\t\t}\n\t\t\t\telse if (at._type == RegexNode.Nothing)\n\t\t\t\t{\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twasLastSet = false;\n\t\t\t\t\tlastNodeCannotMerge = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (j < i)\n\t\t{\n\t\t\t//_children.removeRange(j, i - j + j);\n\t\t\tArrayExt.removeRange(_children, j, i - j + j);\n\t\t}\n\n\t\treturn StripEnation(RegexNode.Nothing);\n\t}", "public Set intersection(Set intersect){\n Set newSet = new Set();\n for(int element = 0; element < intersect.size(); element++){\n if(elementOf(intersect.getSet()[element]))\n newSet.add(intersect.getSet()[element]);\n }\n return newSet;\n }", "public static MyLinkedList getUnion(MyLinkedList list1, MyLinkedList list2)\n {\n HashSet<Integer> set = new HashSet<>();\n\n Node temp = list1.getStart();\n while(temp != null)\n {\n set.add(temp.key);\n temp = temp.next;\n }\n\n temp = list2.getStart();\n while(temp != null)\n {\n set.add(temp.key);\n temp = temp.next;\n }\n\n MyLinkedList union = new MyLinkedList();\n for(int key : set)\n {\n union.addNode(new Node(key));\n }\n\n return union;\n }", "private Set() {\n this(\"<Set>\", null, null);\n }", "public static <T> Set<T> createSet(T... setEntries) {\n\t\tif (setEntries == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new HashSet<T>(Arrays.asList(setEntries));\n\t}", "public ZYSet<ElementType> difference(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n if(!otherSet.contains(e)){\n result.add(e);\n }\n }\n return result;\n }", "private static <T> Set<T> Create_UnModifiableSet_By_InputElements(@NonNull Set<T> set, @NonNull T... ts) {\n for (T t : ts) {\n set.add(t);\n }\n\n return Collections.unmodifiableSet(set);\n }", "public static void parseSetExp() {\n parseSLevel2();\n if (currToken.tokenType == Token.SETDIFFERENCE) {\n //TODO: Consume set difference token and add to output\n sb.append(\".intersect(\");\n getNextToken();\n parseSetExp();\n sb.append(\".complement())\");\n }\n \n }", "public static <T> Set<T> consolidateSets(Collection<Set<T>> inputSets) {\n\t\tSet<T> set = new HashSet<T>();\n\t\tfor (Set<T> inputSet : inputSets)\n\t\t\tset.addAll(inputSet);\n\t\treturn set;\n\t}", "public AttributeSet() {\n\n elements = new Hashtable();\n }", "private static Collection<Node> union(Collection<Node> xs, Collection<Node> ys) {\n if (xs == null || xs.size() == 0) {\n return ys;\n }\n if (ys == null || ys.size() == 0) {\n return xs;\n }\n \n List<Node> result = new ArrayList<>(xs);\n for (Node y : ys) {\n if (!result.contains(y)) {\n result.add(y);\n }\n }\n return result;\n }", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Criteria or() {\n\t\tCriteria criteria = createCriteriaInternal();\n\t\toredCriteria.add(criteria);\n\t\treturn criteria;\n\t}", "public Filter doUnion(Filter f);", "public ArrBag<T> union( ArrBag<T> other )\n {\n ArrBag<T> unionArray = new ArrBag<T>(other.size() + this.size()); \n\n int unionCount = 0; \n for (int i = 0; i <this.size(); i++ ){\n unionArray.add(this.get(i));\n unionCount++;\n } for (int i = 0; i<other.size(); i++){\n if (!unionArray.contains(other.get(i))){\n unionArray.add(other.get(i));\n unionCount ++;\n }\n }\n return unionArray;\n }", "@Override\n\tpublic Type union(Type t) {\n\t\treturn this;\n\t}", "public Criteria or() {\r\n Criteria criteria = createCriteriaInternal();\r\n oredCriteria.add(criteria);\r\n return criteria;\r\n }", "public Criteria or() {\r\n Criteria criteria = createCriteriaInternal();\r\n oredCriteria.add(criteria);\r\n return criteria;\r\n }", "public Criteria or() {\r\n Criteria criteria = createCriteriaInternal();\r\n oredCriteria.add(criteria);\r\n return criteria;\r\n }", "public Criteria or() {\r\n Criteria criteria = createCriteriaInternal();\r\n oredCriteria.add(criteria);\r\n return criteria;\r\n }", "public Criteria or() {\r\n Criteria criteria = createCriteriaInternal();\r\n oredCriteria.add(criteria);\r\n return criteria;\r\n }" ]
[ "0.6636998", "0.66219664", "0.6524542", "0.6369096", "0.6365199", "0.6319036", "0.6284456", "0.6204892", "0.61709136", "0.6161312", "0.6132267", "0.61091477", "0.6087155", "0.59426415", "0.5908252", "0.589908", "0.587668", "0.58606076", "0.57428306", "0.5722368", "0.5710172", "0.5695464", "0.5626474", "0.54939973", "0.54831046", "0.5474488", "0.5448863", "0.5434676", "0.54091024", "0.5400408", "0.5184058", "0.5167659", "0.51525176", "0.5106836", "0.504281", "0.5037613", "0.49636087", "0.4960612", "0.49506408", "0.49392346", "0.49310082", "0.49305528", "0.49300122", "0.4889503", "0.48880652", "0.48870006", "0.48869482", "0.4859968", "0.48567352", "0.48376742", "0.48331738", "0.4830956", "0.48223636", "0.48157692", "0.48041385", "0.47793698", "0.47428825", "0.47408196", "0.4730582", "0.47027284", "0.47009003", "0.46811843", "0.46729752", "0.46639955", "0.46428096", "0.46428096", "0.46428096", "0.46428096", "0.46428096", "0.46322557", "0.46305993", "0.46240476", "0.46191457", "0.46132803", "0.46095076", "0.46087036", "0.46060726", "0.45981336", "0.45950967", "0.45938417", "0.45931903", "0.45916295", "0.45916295", "0.45916295", "0.45916295", "0.45916295", "0.45916295", "0.45916295", "0.45916295", "0.45916295", "0.45916295", "0.45916295", "0.45811895", "0.45767695", "0.45765993", "0.4565991", "0.4565991", "0.4565991", "0.4565991", "0.4565991" ]
0.7684396
0
Return an AttributeSet which is the intersection of this set with the given set.
public AttributeSet intersectWith(AttributeSet s) { Hashtable newElements = new Hashtable(); Iterator iter = s.iterator(); while (iter.hasNext()) { Object next = iter.next(); if (elements.get(next) != null) { newElements.put(next, next); } } return new AttributeSet(newElements); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Set intersection(Set in_set) throws SetException {\n\t\tSet intersection = new Set();\n\t\tfor (Object element : in_set.list) {\n\t\t\tif (member(element))\n\t\t\t\tintersection.addItem(element);\n\t\t}\n\t\treturn intersection;\n\t}", "public ZYSet<ElementType> intersection(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n if(otherSet.contains(e)){\n result.add(e);\n }\n }\n return result;\n }", "public Units intersection(Units set)\n\t{\n\t\tUnits result = new Units();\n\n\t\tfor (Unit unit : this)\n\t\t{\n\t\t\tif (set.contains(unit))\n\t\t\t{\n\t\t\t\tresult.add(unit);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public <T> Set<T> intersect(Set<T> set1, Set<T> set2) {\n\t\tSet<T> intersection = new HashSet<T>(set1);\n\t\tintersection.retainAll(set2);\n\t\treturn intersection;\n\t}", "public Set intersection(Set intersect){\n Set newSet = new Set();\n for(int element = 0; element < intersect.size(); element++){\n if(elementOf(intersect.getSet()[element]))\n newSet.add(intersect.getSet()[element]);\n }\n return newSet;\n }", "public ISet<E> intersection(ISet<E> otherSet){\n \t\n \tif(otherSet == null) {\n \t\tthrow new IllegalArgumentException(\"Invalid parameter!\");\n \t}\n \t\n \t// calculate the intersection by getting total union of sets\n \tISet<E> totalSet = this.union(otherSet);\n \t\n \t// calculate total difference between sets\n \tISet<E> diff1 = this.difference(otherSet);\n \tISet<E> diff2 = otherSet.difference(this);\n \tISet<E> allDiff = diff1.union(diff2);\n \n \t// returns all the elements that are common between the sets\n \treturn totalSet.difference(allDiff);\n }", "public BSTSet intersection(BSTSet s) {\n int[] thisArray = BSTToArray();\n int[] sArray = s.BSTToArray();\n int[] interArray = justDuplicates(thisArray, sArray);\n\n sortArray(interArray);\n\n return new BSTSet(interArray);\n }", "public VertexSet intersection(VertexSet ot) {\r\n\t\tVertexSet ans = new VertexSet();\r\n\t\tint i1=0,i2=0;\r\n\t\twhile(i1<this.size() & i2 < ot.size()) {\r\n\t\t\tint a1=this.at(i1), a2 = ot.at(i2);\r\n\t\t\tif(a1==a2) {\r\n\t\t\t\tans.add(a1); i1++; i2++;}\r\n\t\t\telse if(a1<a2) {i1++;}\r\n\t\t\telse i2++;\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "protected <Ty> HashSet<Ty> intersection(HashSet<Ty> setA, HashSet<Ty> setB) {\n HashSet<Ty> retSet = new HashSet<>();\n for (Ty t : setA) {\n if (setB.contains(t)) {\n retSet.add(t);\n }\n }\n return retSet;\n }", "public static <T> Set<T> intersection(final Set<T> a, final Set<T> b) {\n return new Set<T>() {\n public boolean has(final T n) {\n return a.has(n) && b.has(n);\n }\n };\n }", "@Override\n public SetI intersection(SetI other) {\n int[] newArr;\n int i = 0;\n SetI shorter, longer;\n\n // Begin with a shorter one.\n if (count > other.size()) {\n shorter = other;\n longer = this;\n newArr = new int[other.size()];\n }\n else {\n shorter = this;\n longer = other;\n newArr = new int[count];\n }\n\n // For each element I have,\n for (Integer e : shorter) {\n // If you also have it...\n if (longer.contains(e)) {\n newArr[i++] = e;\n }\n }\n\n return new Set(newArr, i);\n }", "@SafeVarargs\n public static <T> Set<T> intersection(Set<T>... sets) {\n if (sets == null) return set();\n Set<T> result = set(sets[0]);\n for (int i = 1; i < sets.length; i++) {\n result = intersectTwoSets(result, sets[i]);\n }\n return result;\n }", "public AttributeSet unionWith(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n Object next = iter.next();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "private Set<String> intersection(Set<String> s1, Set<String> s2) {\n Set<String> intersection = new HashSet<>(s1);\n intersection.retainAll(s2);\n return intersection;\n }", "private Set<String> getIntersection( Set<String> a, Set<String> b ) {\n\t\tSet<String> intersection = new HashSet<String>(a);\n\t\tintersection.retainAll(b);\n\t\treturn intersection;\n\t}", "@Override\n public SetInterface<T> intersection(SetInterface<T> rhs) {\n //Declare return SetInterface\n SetInterface<T> result = new ArraySet();\n //If the item is in both sets, add it to the result\n //Iterate through the calling Set\n for (int i = 0; i < numItems; i++){\n //if the item is also in RHS, add it to the result\n if(rhs.contains(arr[i]))\n result.addItem(arr[i]);\n }\n return result;\n }", "public static Set<Doc> and(Set<Doc> set1, Set<Doc> set2) {\r\n \t\t\r\n \t\tif((set1 == null) || (set2 == null)) {\r\n\t\t\tSystem.err.println(\"Doc.and() returning null!\");\r\n \t\t\treturn new TreeSet<Doc>();\r\n \t\t}\r\n \t\t//set1.retainAll(set2);\r\n \t\t//return set1;\r\n \t\t\r\n \t\tTreeSet<Doc> result = new TreeSet<Doc>();\r\n \t\tIterator<Doc> op1 = set1.iterator();\r\n \t\tIterator<Doc> op2 = set2.iterator();\r\n \t\t\r\n \t\tDoc current1 = getNext(op1);\r\n \t\tDoc current2 = getNext(op2);\r\n \r\n \t\twhile(current1!=null && current2!=null) {\r\n \t\t\t//If is the same document\r\n \t\t\tif(current1.getID() == current2.getID()) {\r\n \t\t\t\tresult.add(current1);\r\n \t\t\t\tcurrent1 = getNext(op1);\r\n \t\t\t\tcurrent2 = getNext(op2);\r\n \t\t\t}\r\n \t\t\t//If op2 is ahead of op1\r\n \t\t\telse if(current1.getID() < current2.getID()) \r\n \t\t\t\tcurrent1 = getNext(op1);\r\n \t\t\t//If op1 is ahead of op2\r\n \t\t\telse\r\n \t\t\t\tcurrent2 = getNext(op2);\r\n \t\t}\r\n \t\t\r\n \t\treturn result;\r\n \t}", "public Set Intersection(Set secondSet) {\n\t\t\t\n\t\tArrayList<String> firstArray = noDuplicates(stringArray);\n\t\t// Taking out duplications out of our sets by calling the noDuplicates private function\n\t\tArrayList<String> secondArray = noDuplicates(secondSet.returnArray());\n\t\t\n\t\tArrayList<String> intersectionOfBoth = new ArrayList<String>();\n\t\t// New ArrayList to hold the final values\n\t\t\n\t\tfor (int i=0; i < firstArray.size(); i++) {\n\t\t\tif (secondArray.contains(firstArray.get(i)) && intersectionOfBoth.contains(firstArray.get(i)) == false) {\n\t\t\t\tintersectionOfBoth.add(firstArray.get(i));\n\t\t\t\t// If our second array contains that same element from our first array, and the final ArrayList\n\t\t\t\t// does not already contain that element, then add it to our final ArrayList\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tSet intersectionReturn = new Set(intersectionOfBoth); // Initiate a Set object from our final ArrayList\n\t\t\n\t\treturn intersectionReturn; // Return our Set Object\n\t}", "public ISet<E> union(ISet<E> otherSet) {\n\t\tif (otherSet == null)\n\t\t\tthrow new IllegalArgumentException(\"The given set is null.\");\n\t\tISet<E> result = this.difference(otherSet);\n\t\tresult.addAll(this.intersection(otherSet));\n\t\tresult.addAll(otherSet.difference(this));\n\t\treturn result;\n\t}", "public Set union(Set in_set) throws SetException {\n\t\tSet union = new Set(this);\n\t\tfor (Object element : in_set.list) {\n\t\t\tif (!member(element))\n\t\t\t\tunion.addItem(element);\n\t\t}\n\t\treturn union;\n\t}", "public static void parseSetExp() {\n parseSLevel2();\n if (currToken.tokenType == Token.SETDIFFERENCE) {\n //TODO: Consume set difference token and add to output\n sb.append(\".intersect(\");\n getNextToken();\n parseSetExp();\n sb.append(\".complement())\");\n }\n \n }", "public Set xor(Set in_set) throws SetException {\n\t\tSet temp = union(in_set);\n\t\ttemp.removeItems(intersection(in_set));\n\n\t\treturn temp;\n\t}", "private static Set<Item> multiSetIntersection(List<Set<Item>> setList) {\n Set<Item> interQrels = new HashSet<>(setList.get(0));\r\n \r\n for (int i = 1; i< setList.size();i++) {\r\n interQrels.retainAll(setList.get(i)); // intersection with two (and one)\r\n }\r\n\r\n return interQrels;\r\n }", "@Override\n public SetInterface<T> intersection(SetInterface<T> rhs) {\n //create the return SetInterface\n SetInterface<T> result = new LinkedSet();\n Node n = first;\n //move through the modes\n while(n != null){\n //check if the item is also in rhs\n if(rhs.contains(n.value))\n result.addItem(n.value);\n n = n.next;\n }\n return result;\n }", "public static <T> void intersectionToSet1(HashSet<T> set1, HashSet<T> set2) {\n for (T element : set1) {\n if (!set2.contains(element)) {\n set1.remove(element);\n }\n }\n }", "public void intersectionOf(IntegerSet set1, IntegerSet set2) {\n get = new int[0];\n for (int i : set1.get)\n if (set2.hasElement(i))\n insertElement(i);\n }", "public intersection(){}", "@Override\r\n\tpublic MySet intersectSets(MySet[] t) {\r\n\t\tallElements = new ArrayList<Integer>();\r\n\r\n\t\t\r\n\t\tfor(Object element: t[0]) {\r\n\t\t\tallElements.add(element);\r\n\t\t}\r\n\t\r\n\t\tfor(Object e: allElements) {\r\n\t\t\tInteger c = map.getOrDefault(e, 0);\r\n\t\t\tmap.put((E)e, c + 1);\r\n\t\t}\r\n\t\t\r\n\t\tMySet<E> returnSet = (MySet<E>) new Set2<Integer>();\r\n\t\tfor(Map.Entry<E, Integer> entry :map.entrySet())\r\n\t\t\tif(entry.getValue() >= dataSet[0].length) // check\r\n\t\t\t\treturnSet.add(entry.getKey());\r\n\t\t\r\n\t\t\r\n\t\treturn returnSet;\r\n\t}", "@Override\n\tpublic SetLinkedList<T> intersection(SetLinkedList<T> otherSet) {\n\t\tthrow new UnsupportedOperationException(\"Not implemented yet!\");\n\t}", "protected <Ty> HashSet<Ty> union(HashSet<Ty> setA, HashSet<Ty> setB) {\n HashSet<Ty> retSet = new HashSet<>();\n retSet.addAll(setA);\n retSet.addAll(setB);\n return retSet;\n }", "public Coordinates intersection() {\n return intersection;\n }", "@Test\n\tpublic void testRetainAll() {\n\t Set<Integer> setA = new HashSet<>(Arrays.asList(1, 2, 3, 4, 5));\n\t\tSet<Integer> setB = new HashSet<>(Arrays.asList(9, 8, 7, 6, 5, 4, 3));\n\t setA.retainAll(setB);\n\t Set<Integer> intersection = new HashSet<>(Arrays.asList(3, 4, 5));\n\t assertEquals(setA, intersection);\n }", "public static void intersectionUsingSet(Integer[] firstArray, Integer[] secondArray)\n\t{\n\t LinkedHashSet<Integer> set = new LinkedHashSet<Integer>();\n\t \n\t set.addAll(Arrays.asList(firstArray));\n\t \n\t set.retainAll(Arrays.asList(secondArray));\n\t \n\t Integer[] intersectionArray = set.toArray(new Integer[set.size()]);\n\t \n\t System.out.println(\"Intersection of two arrays using set is : \");\n\t \n\t for(int i=0; i<intersectionArray.length; i++)\n\t {\n\t \tSystem.out.print(intersectionArray[i]+\" \");\n\t }\n\t}", "public Filter intersection(Filter f);", "private static HashSet<Annotation> setDifference(HashSet<Annotation> setA,\r\n\t\t\tHashSet<Annotation> setB) {\r\n\r\n\t\tHashSet<Annotation> tmp = new HashSet<Annotation>(setA);\r\n\t\ttmp.removeAll(setB);\r\n\t\treturn tmp;\r\n\t}", "public ZYSet<ElementType> union(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n result.add(e);\n }\n for(ElementType e :otherSet){\n result.add(e);\n }\n \n return result;\n }", "public int[] intersectionUsingSets(int[] nums1, int[] nums2) {\n Set<Integer> setA = new HashSet<>();\n Set<Integer> intersection = new HashSet<>();\n for (int num : nums1) {\n setA.add(num);\n }\n\n for (int num : nums2) {\n if (setA.contains(num)) {\n intersection.add(num);\n }\n }\n\n return getIntersectionResult(intersection);\n }", "public Set setDifference(Set diff){\n Set newSet = new Set();\n for(int element = 0; element < set.length; element++){\n if(!diff.elementOf(set[element]))\n newSet.add(set[element]);\n }\n return newSet;\n }", "public Set retainAll(final int[] newSet) {\n Set s2 = new Set();\n for (int i = 0; i < size; i++) {\n for (int element : newSet) {\n if (set[i] == element) {\n s2.add(set[i]);\n }\n }\n }\n // for (int i = 0; i < size; i++) {\n // if (newSet.contains(set[i])) {\n // s2.add(set[i]);\n // }\n // }\n return s2;\n }", "@Test(expected = NullPointerException.class)\r\n\t\tpublic void testIntersectionWithNullInput() {\r\n\t\t\ttestingSet = new IntegerSet(null);\r\n\t\t\ttestingSet2= new IntegerSet(null); \r\n\t\t\t\r\n\t\t\t// union of 2 null sets \r\n\t\t\ttestingSet3= testingSet.intersection(testingSet, testingSet2);\r\n\t\t}", "public OrderedSet difference (OrderedSet set) {\n if (set == null)\n return null;\n boolean oldshow = show;\n boolean oldshowErro = showErro;\n show = false;\n showErro = false;\n for (DoubleLinkedList p=first; p!=null; p=p.getNext()) {\n Object info = p.getInfo();\n if (set.dictionary.get(info) != null)\n\tremove(info);\n }\n show = oldshow;\n showErro = oldshowErro;\n return this;\n }", "public final HashSet<Attribute> attributeSet() {\n final HashSet<Attribute> set = new HashSet<Attribute>();\n\n for (int i = 0; i < m_body.size(); i++) {\n final Condition c = m_body.get(i);\n set.add(c.getAttr());\n }\n\n return set;\n }", "com.google.ads.googleads.v6.resources.SharedSet getSharedSet();", "public SetSet setDifference(SetSet second){\n\t\tSetSet result = new SetSet();\n\t\tfor(int i=0;i<size();i++){\n\t\t\tif(second.contains(get(i))==-1){\n\t\t\t\tresult.add(get(i));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "@Override\n public IntSet union(IntSet other) {\n return other;\n }", "public static Set<Doc> or(Set<Doc> set1, Set<Doc> set2) {\r\n \t\tif(set1 == null)\r\n \t\t\tset1 = new TreeSet<Doc>();\r\n \t\tif(set2 == null)\r\n \t\t\tset2 = new TreeSet<Doc>();\r\n \t\t\r\n \t\tTreeSet<Doc> result = new TreeSet<Doc>(set1);\r\n \t\tresult.addAll(set2);\r\n \t\treturn result;\r\n \t}", "public static Set synchronizedSet(Set set) {\n/* 162 */ return SynchronizedSet.decorate(set);\n/* */ }", "private SmallAttributeSet\n cacheAttributeSet(final AttributeSet aSet) {\n\n collectGarbageInCache();\n\n Reference r = (Reference)cache.get(aSet);\n SmallAttributeSet as = null;\n if (r != null) {\n as = (SmallAttributeSet)r.get();\n }\n\n if (as == null) {\n as = createSmallAttributeSet(aSet);\n cache.put(as, new WeakReference(as));\n }\n\n return as;\n }", "public SetSet setUnion(SetSet second){\n\t\tSetSet result = new SetSet(contents);\n\t\tfor(int i=0;i<second.size();i++){\n\t\t\tresult.add(second.get(i));\n\t\t}\n\t\treturn result;\n\t}", "public Set union(Set join){\n Set newSet = new Set();\n for(int element = 0; element < join.size(); element++){\n if (!elementOf(join.getSet()[element]))\n newSet.add(join.getSet()[element]);\n }\n for(int element = 0; element < set.length; element++){\n newSet.add(set[element]);\n }\n return newSet;\n }", "private AddressSet getMappedIntersection(MemoryBlock mappedBlock, AddressSet set) {\n\t\tAddressSet mappedIntersection = new AddressSet();\n\t\tList<MemoryBlockSourceInfo> sourceInfos = mappedBlock.getSourceInfos();\n\t\t// mapped blocks can only ever have one sourceInfo\n\t\tMemoryBlockSourceInfo info = sourceInfos.get(0);\n\t\tAddressRange range = info.getMappedRange().get();\n\t\tAddressSet resolvedIntersection = set.intersect(new AddressSet(range));\n\t\tfor (AddressRange resolvedRange : resolvedIntersection) {\n\t\t\tAddressRange mappedRange = getMappedRange(mappedBlock, resolvedRange);\n\t\t\tif (mappedRange != null) {\n\t\t\t\tmappedIntersection.add(mappedRange);\n\t\t\t}\n\t\t}\n\t\treturn mappedIntersection;\n\t}", "public static <T> Set<T> union(final Set<T> a, final Set<T> b) {\n return new Set<T>() {\n public boolean has(final T n) {\n return a.has(n) || b.has(n);\n }\n };\n }", "com.google.ads.googleads.v6.resources.CampaignSharedSet getCampaignSharedSet();", "@Test\r\n\t\tpublic void testIntersection() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// create 3rdset = to the intersection list \r\n\t\t\ttestingSet3= new IntegerSet(intersection);\r\n\t\t\t// create 4th set =to the intersection of set1 and set2\r\n\t\t\ttestingSet4= testingSet.intersection(testingSet, testingSet2);\r\n\t\t\t// sets 3 and set 4 should be equal \r\n\t\t\t// assertEquals for these parameters is a deprecated method \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\t \r\n\t\t}", "public AttributeSet immutable() {\r\n return ImmutableAttributeSet.copyOf(this);\r\n }", "@Test\n public void testIntersection1()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {33, 100000};\n List<Integer> expected = Arrays.asList(33, 100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public boolean containsAll(ISet<E> otherSet) {\n \tif(otherSet == null) {\n \t\tthrow new IllegalArgumentException(\"Invalid parameter!\");\n \t}\n \t\n \tIterator<E> otherIterateSet = otherSet.iterator();\n \t\n \twhile(otherIterateSet.hasNext()) {\n \t\tE item1 = otherIterateSet.next();\n \t\tboolean foundMatch = false;\n \t\t\n \t\t// searches this set for target element\n \t\tif(this.contains(item1)) {\n \t\t\tfoundMatch = true;\n \t\t}\n \t\t\n \t\t// if the current element was not found at all\n \t\tif(foundMatch == false)\n \t\t\treturn false;\n \t}\n \treturn true;\n }", "public boolean equals (SetADT<T> set);", "public boolean containsAll(ISet<E> otherSet) {\n\t\tif (otherSet == null)\n\t\t\tthrow new IllegalArgumentException(\"The given set it null.\");\n\t\tfor (E obj: otherSet) {\n\t\t\tif (!this.contains(obj))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public Iterator<Set<E>> iterator() {\n return new DisjointSetIterator(theSet);\n }", "private List<Attribute> calculateIntersection(Instance i1, Instance i2) {\n List<Attribute> intersection = new LinkedList<Attribute>();\n for (Attribute currentAttr : this.m_possibleAttributes) {\n if (!currentAttr.equals(this.m_splittingAttribute)) {\n // It is sufficient to check only if the attribute is missing in the first instance\n if (!i1.isMissing(currentAttr) && !i2.isMissing(currentAttr) &&\n (i1.stringValue(currentAttr).equals(i2.stringValue(currentAttr)))) {\n intersection.add(currentAttr);\n }\n }\n }\n return intersection;\n }", "@SafeVarargs\n public static <T> boolean intersects(Set<T>... sets) {\n return !intersection(sets).isEmpty();\n }", "public static <E> boolean intersects(Set<E> a, Set<E> b) {\n if (!(a.size() < b.size())) {\n // The documentation for Sets.intersection() suggests that it's best that the first set be smaller.\n // Hopefully they actually tested that! :D\n // (Could just use that. But, uh, this code is already written...)\n Set<E> c = a;\n a = b;\n b = c;\n }\n for (E e : a) {\n if (b.contains(e)) return true;\n }\n return false;\n }", "private static Set symmetricSetDifference (Set<Integer> set1, Set<Integer> set2)\n {\n Set<Integer> skæringspunktet = new HashSet<Integer>(set1);\n\n // Holder på set2 også\n skæringspunktet.retainAll(set2);\n\n // Set1 fjerner alt fra Settet\n set1.removeAll(skæringspunktet);\n // Set1 fjerner alt fra Settet\n set2.removeAll(skæringspunktet);\n\n // Tilføjer alt fra set2 til set1\n set1.addAll(set2);\n\n // Returnerer set1\n return set1;\n }", "private static <T> Set<T> union(Collection<T> c1, Collection<T> c2) {\n return Stream.concat(c1.stream(), c2.stream()).collect(Collectors.toUnmodifiableSet());\n }", "public int[] intersection1(int[] nums1, int[] nums2) {\n Set<Integer> nums1Set = new HashSet<>();\n Set<Integer> nums2Set = new HashSet<>();\n\n for (int i = 0; i < nums1.length; i++) {\n nums1Set.add(nums1[i]);\n }\n for (int i = 0; i < nums2.length; i++) {\n nums2Set.add(nums2[i]);\n }\n\n nums1Set.retainAll(nums2Set);\n\n int[] res = new int[nums1Set.size()];\n int i = 0;\n for (int s: nums1Set) {\n res[i++] = s;\n }\n return res;\n }", "public DisjointSets getSets()\n\t{\n\t\treturn sets;\n\t}", "public AttributeSet copy() {\r\n AttributeSet res = new AttributeSet(parent.orNull());\r\n for (String k : attributeMap.keySet()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "private static Set<String> m23474a(Set<String> set, Set<String> set2) {\n if (set.isEmpty()) {\n return set2;\n }\n if (set2.isEmpty()) {\n return set;\n }\n HashSet hashSet = new HashSet(set.size() + set2.size());\n hashSet.addAll(set);\n hashSet.addAll(set2);\n return hashSet;\n }", "public static Set predicatedSet(Set set, Predicate predicate) {\n/* 192 */ return PredicatedSet.decorate(set, predicate);\n/* */ }", "private void init(final AttributeSet set) {\n }", "com.google.ads.googleads.v6.resources.CampaignSharedSetOrBuilder getCampaignSharedSetOrBuilder();", "Set createSet();", "public Formula intersect(Formula a, Formula b) {\n Set<Variable> variables = Collections.emptySet();\n\n if (!a.equals(Utils.trueConst())) {\n VariableExtractorVisitor visitor = new VariableExtractorVisitor();\n a.accept(visitor);\n variables = visitor.getResult();\n }\n FormulaEvaluatorVisitor evaluator = new FormulaEvaluatorVisitor(variables);\n b.accept(evaluator);\n return evaluator.isCurrentValue() ? a : null;\n }", "public void unionSet(NSSet<? extends E> otherSet) {\n\t\tthis.wrappedSet.addAll(otherSet.getWrappedSet());\n\t}", "public boolean isIntersection( Set<String> a, Set<String> b ) {\n\t\tfor ( String v1 : a ) {\n\t\t\tif ( b.contains( v1 ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "com.google.ads.googleads.v6.resources.SharedSetOrBuilder getSharedSetOrBuilder();", "static AttributeSet createKeySet(Hashtable hashtable) {\n\n Hashtable newElements = new Hashtable();\n\n Enumeration e = hashtable.keys();\n while (e.hasMoreElements()) {\n Object next = e.nextElement();\n newElements.put(next, next);\n }\n\n return new AttributeSet(newElements);\n }", "public Units union(Units set)\n\t{\n\t\tUnits result = new Units(this);\n\n\t\tresult.addAll(set);\n\n\t\treturn result;\n\t}", "public AttributeSet and(String key, Object val) {\r\n put(key, val);\r\n return this;\r\n }", "public AttributeSet flatCopy() {\r\n AttributeSet res = new AttributeSet();\r\n for (String k : getAllAttributes()) {\r\n res.put(k, copyValue(get(k)));\r\n }\r\n return res;\r\n }", "public ObjectColor intersection(ObjectColor other) {\n ObjectColor newColor = new ObjectColor();\n newColor.white = white && other.white;\n newColor.blue = blue && other.blue;\n newColor.black = black && other.black;\n newColor.red = red && other.red;\n newColor.green = green && other.green;\n\n newColor.gold = gold && other.gold;\n return newColor;\n }", "public ArrayList <Integer> getIntersection (RuleSet RS) {\n \n ArrayList <Integer> a = new ArrayList ();\n HashSet<Integer> map1 = new HashSet<>(this.indexesOfPrec);\n HashSet<Integer> map2 = new HashSet<>(RS.indexesOfPrec);\n \n map1.retainAll(map2);\n\n a.addAll(map1);\n return a;\n }", "public ZYSet<ElementType> difference(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n if(!otherSet.contains(e)){\n result.add(e);\n }\n }\n return result;\n }", "public static <T> Set<T> createSet(T... setEntries) {\n\t\tif (setEntries == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new HashSet<T>(Arrays.asList(setEntries));\n\t}", "@Test\n public void testIntersection2()\n {\n final int[] ints1 = {33, 100000};\n final int[] ints2 = {34, 100000};\n List<Integer> expected = Collections.singletonList(100000);\n\n ConciseSet set1 = new ConciseSet();\n for (int i : ints1) {\n set1.add(i);\n }\n ConciseSet set2 = new ConciseSet();\n for (int i : ints2) {\n set2.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "public FeatureSet combine(final FeatureSet other) {\n final Set<Feature> enabled = new HashSet<>(this.enabled);\n enabled.addAll(other.enabled);\n\n final Set<Feature> disabled = new HashSet<>(this.disabled);\n disabled.addAll(other.disabled);\n\n return new FeatureSet(enabled, disabled);\n }", "public BSTSet union(BSTSet s) {\n int[] thisArray = BSTToArray();\n int[] sArray = s.BSTToArray();\n int[] unionArray = new int[thisArray.length + sArray.length];\n int unionArrayIndex = 0;\n\n // add both arrays together\n for (int i = 0; i < thisArray.length; i++) {\n unionArray[unionArrayIndex++] = thisArray[i];\n }\n\n for (int i = 0; i < sArray.length; i++) {\n unionArray[unionArrayIndex++] = sArray[i];\n }\n\n return new BSTSet(unionArray);\n }", "Set<CACell> automateNGetOuterLayerSet(CACrystal crystal, final Set<CACell> set);", "public static java.util.Set synchronizedSet(java.util.Set arg0)\n { return null; }", "public static org.ga4gh.models.CallSet.Builder newBuilder(org.ga4gh.models.CallSet other) {\n return new org.ga4gh.models.CallSet.Builder(other);\n }", "public static <T> Set<T> union(Set<? extends T> s1, Set<? extends T> s2) {\n Set<T> result = new HashSet<>(s1);\n result.addAll(s2);\n return result;\n }", "public static Collection<Character> intersect(String string1, String string2){\n\t\t Collection<Character> vector1 = uniqueCharacters(stringToCharacterSet(string1));\n\t\t Collection<Character> vector2 = uniqueCharacters(stringToCharacterSet(string2));\n\t\t Collection<Character> intersectVector = new TreeSet<Character>();\n\t\t for(Character c1 : vector1){\n\t\t\t for(Character c2 : vector2){\n\t\t\t\t if(c1.equals(c2)){\n\t\t\t\t\t intersectVector.add(c1);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t return intersectVector;\n\t}", "static public boolean setEquals(Set source, Set arg) {\n\t\tif ( source.size() != arg.size() ) {\n\t\t\treturn false;\n\t\t}\n\t\tIterator it = arg.iterator();\n\t\twhile ( it.hasNext() ) {\n\t\t\tObject elem = it.next();\n\t\t\tif ( !source.contains(elem) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n\t\tInteger[] firstArray = {0,2,4,6,8};\n\t Integer[] secondArray = {1,3,10,4,7,8,9};\n\t \n\t intersectionUsingSet(firstArray, secondArray);\n\n\t System.out.println();\n\t \n\t // Array with duplicate elements in the array\n\t Integer[] firstArray1 = {0,2,2,4,6,6,8};\n\t Integer[] secondArray2 = {1,3,10,10,4,7,8,9};\n\t \n\t intersectionUsingSet(firstArray1, secondArray2);\n\t}", "public AttributeSet subtract(AttributeSet s) {\n\n Hashtable newElements = (Hashtable) elements.clone();\n\n Iterator iter = s.iterator();\n while (iter.hasNext()) {\n newElements.remove(iter.next());\n }\n\n return new AttributeSet(newElements);\n }", "public static Set unionRaw(Set s1, Set s2) {\n\t\t// Warning : HashSet is a raw type. References to generic type HashSet<E> should\n\t\t// be parameterized\n\t\tSet result = new HashSet(s1);\n\t\t// Warning : Type safety: The method addAll(Collection) belongs to the raw type\n\t\t// Set. References to generic type Set<E> should be parameterized\n\t\tresult.addAll(s2);\n\t\treturn result;\n\t}", "@Test\n public void testIntersection6()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n for (int i = 0; i < 5; i++) {\n set1.add(i);\n }\n for (int i = 1000; i < 1005; i++) {\n set1.add(i);\n }\n\n ConciseSet set2 = new ConciseSet();\n for (int i = 800; i < 805; i++) {\n set2.add(i);\n }\n for (int i = 806; i < 1005; i++) {\n set2.add(i);\n }\n\n for (int i = 1000; i < 1005; i++) {\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }", "@SafeVarargs\n public static <T> Set<T> union(Set<T>... sets) {\n if (sets == null) return set();\n Set<T> result = set();\n for (Set<T> s : sets) {\n if (s != null) result.addAll(s);\n }\n return result;\n }", "@Test\n public void testIntersection3()\n {\n List<Integer> expected = new ArrayList<>();\n ConciseSet set1 = new ConciseSet();\n ConciseSet set2 = new ConciseSet();\n for (int i = 0; i < 1000; i++) {\n set1.add(i);\n set2.add(i);\n expected.add(i);\n }\n\n verifyIntersection(expected, set1, set2);\n }" ]
[ "0.6786277", "0.66098136", "0.64922404", "0.64588684", "0.6426616", "0.6333198", "0.6309208", "0.61024183", "0.60618347", "0.60473406", "0.5932486", "0.5864417", "0.57987046", "0.56736684", "0.5664216", "0.55688214", "0.5533735", "0.5417081", "0.53688216", "0.5346928", "0.53446597", "0.5335763", "0.53326243", "0.5274474", "0.5267747", "0.5239637", "0.5169526", "0.5159141", "0.5153093", "0.5148857", "0.5104592", "0.5095328", "0.5030067", "0.49829623", "0.4976376", "0.49519745", "0.49292606", "0.48664173", "0.48550132", "0.48499066", "0.48405513", "0.48375392", "0.48309574", "0.48182994", "0.48116192", "0.480957", "0.48092106", "0.47968897", "0.47736928", "0.47718564", "0.4747463", "0.473721", "0.4736893", "0.4733451", "0.47131202", "0.46693546", "0.46362162", "0.4622902", "0.46201637", "0.4612088", "0.4602547", "0.45900828", "0.45888576", "0.45838055", "0.45834514", "0.45650992", "0.45648798", "0.4555809", "0.4548475", "0.4537132", "0.45366585", "0.45332232", "0.452782", "0.45198208", "0.4516772", "0.45032197", "0.4483263", "0.44734246", "0.4471091", "0.44703606", "0.4469852", "0.4467379", "0.4461473", "0.44593376", "0.44564003", "0.44529042", "0.4451735", "0.44288516", "0.44276854", "0.44274125", "0.44231942", "0.44224197", "0.44174534", "0.44053483", "0.43888715", "0.4381638", "0.43682903", "0.4355156", "0.43534288", "0.4350924" ]
0.7370187
0